diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-11-15 18:05:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:04:46 -0800 |
commit | 1007832103d016d1563fab71d4cf2b057a0bcceb (patch) | |
tree | 3b5080b01bee6e1f98cc9489382c534e963ac748 /drivers/net/wireless/libertas | |
parent | 9a62f73b1a3bbd35a6f84fcd6636e672b09981ec (diff) | |
download | blackbird-op-linux-1007832103d016d1563fab71d4cf2b057a0bcceb.tar.gz blackbird-op-linux-1007832103d016d1563fab71d4cf2b057a0bcceb.zip |
libertas: move to uniform lbs_/LBS_ namespace
This patch unifies the namespace of variables, functions defines
and structures. It does:
- rename libertas_XXX to lbs_XXX
- rename LIBERTAS_XXX to lbs_XXX
- rename wlan_XXX to lbs_XXX
- rename WLAN_XXX to LBS_XXX (but only those that were
defined in libertas-local *.h files, e.g. not defines
from net/ieee80211.h)
While passing, I fixed some checkpatch.pl errors too.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
29 files changed, 1546 insertions, 1542 deletions
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c index 8bbd3227e6fb..d16f566e878b 100644 --- a/drivers/net/wireless/libertas/11d.c +++ b/drivers/net/wireless/libertas/11d.c @@ -43,7 +43,7 @@ static struct chan_freq_power channel_freq_power_UN_BG[] = { {14, 2484, TX_PWR_DEFAULT} }; -static u8 wlan_region_2_code(u8 * region) +static u8 lbs_region_2_code(u8 *region) { u8 i; @@ -60,7 +60,7 @@ static u8 wlan_region_2_code(u8 * region) return (region_code_mapping[0].code); } -static u8 *wlan_code_2_region(u8 code) +static u8 *lbs_code_2_region(u8 code) { u8 i; @@ -79,7 +79,7 @@ static u8 *wlan_code_2_region(u8 code) * @param nrchan number of channels * @return the nrchan-th chan number */ -static u8 wlan_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 * chan) +static u8 lbs_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 *chan) /*find the nrchan-th chan after the firstchan*/ { u8 i; @@ -113,7 +113,7 @@ static u8 wlan_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 * chan) * @param parsed_region_chan pointer to parsed_region_chan_11d * @return TRUE; FALSE */ -static u8 wlan_channel_known_11d(u8 chan, +static u8 lbs_channel_known_11d(u8 chan, struct parsed_region_chan_11d * parsed_region_chan) { struct chan_power_11d *chanpwr = parsed_region_chan->chanpwr; @@ -134,7 +134,7 @@ static u8 wlan_channel_known_11d(u8 chan, return 0; } -u32 libertas_chan_2_freq(u8 chan, u8 band) +u32 lbs_chan_2_freq(u8 chan, u8 band) { struct chan_freq_power *cf; u16 i; @@ -152,7 +152,7 @@ u32 libertas_chan_2_freq(u8 chan, u8 band) static int generate_domain_info_11d(struct parsed_region_chan_11d *parsed_region_chan, - struct wlan_802_11d_domain_reg * domaininfo) + struct lbs_802_11d_domain_reg *domaininfo) { u8 nr_subband = 0; @@ -217,7 +217,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d * @param *parsed_region_chan pointer to parsed_region_chan_11d * @return N/A */ -static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_chan, +static void lbs_generate_parsed_region_chan_11d(struct region_channel *region_chan, struct parsed_region_chan_11d * parsed_region_chan) { @@ -238,7 +238,7 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ parsed_region_chan->band = region_chan->band; parsed_region_chan->region = region_chan->region; memcpy(parsed_region_chan->countrycode, - wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN); + lbs_code_2_region(region_chan->region), COUNTRY_CODE_LEN); lbs_deb_11d("region 0x%x, band %d\n", parsed_region_chan->region, parsed_region_chan->band); @@ -264,7 +264,7 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ * @param chan chan * @return TRUE;FALSE */ -static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) +static u8 lbs_region_chan_supported_11d(u8 region, u8 band, u8 chan) { struct chan_freq_power *cfp; int cfp_no; @@ -273,7 +273,7 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) lbs_deb_enter(LBS_DEB_11D); - cfp = libertas_get_region_cfp_table(region, band, &cfp_no); + cfp = lbs_get_region_cfp_table(region, band, &cfp_no); if (cfp == NULL) return 0; @@ -338,7 +338,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* /*Step1: check region_code */ parsed_region_chan->region = region = - wlan_region_2_code(countryinfo->countrycode); + lbs_region_2_code(countryinfo->countrycode); lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region); lbs_deb_hex(LBS_DEB_11D, "countrycode", (char *)countryinfo->countrycode, @@ -367,7 +367,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* for (i = 0; idx < MAX_NO_OF_CHAN && i < nrchan; i++) { /*step4: channel is supported? */ - if (!wlan_get_chan_11d(band, firstchan, i, &curchan)) { + if (!lbs_get_chan_11d(band, firstchan, i, &curchan)) { /* Chan is not found in UN table */ lbs_deb_11d("chan is not supported: %d \n", i); break; @@ -375,7 +375,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* lastchan = curchan; - if (wlan_region_chan_supported_11d + if (lbs_region_chan_supported_11d (region, band, curchan)) { /*step5: Check if curchan is supported by mrvl in region */ parsed_region_chan->chanpwr[idx].chan = curchan; @@ -411,14 +411,14 @@ done: * @param parsed_region_chan pointer to parsed_region_chan_11d * @return PASSIVE if chan is unknown; ACTIVE if chan is known */ -u8 libertas_get_scan_type_11d(u8 chan, +u8 lbs_get_scan_type_11d(u8 chan, struct parsed_region_chan_11d * parsed_region_chan) { u8 scan_type = CMD_SCAN_TYPE_PASSIVE; lbs_deb_enter(LBS_DEB_11D); - if (wlan_channel_known_11d(chan, parsed_region_chan)) { + if (lbs_channel_known_11d(chan, parsed_region_chan)) { lbs_deb_11d("found, do active scan\n"); scan_type = CMD_SCAN_TYPE_ACTIVE; } else { @@ -430,7 +430,7 @@ u8 libertas_get_scan_type_11d(u8 chan, } -void libertas_init_11d(wlan_private * priv) +void lbs_init_11d(lbs_private * priv) { priv->adapter->enable11d = 0; memset(&(priv->adapter->parsed_region_chan), 0, @@ -440,10 +440,10 @@ void libertas_init_11d(wlan_private * priv) /** * @brief This function sets DOMAIN INFO to FW - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @return 0; -1 */ -static int set_domain_info_11d(wlan_private * priv) +static int set_domain_info_11d(lbs_private * priv) { int ret; @@ -452,7 +452,7 @@ static int set_domain_info_11d(wlan_private * priv) return 0; } - ret = libertas_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO, + ret = lbs_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, 0, NULL); if (ret) @@ -463,13 +463,13 @@ static int set_domain_info_11d(wlan_private * priv) /** * @brief This function setups scan channels - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @param band band * @return 0 */ -int libertas_set_universaltable(wlan_private * priv, u8 band) +int lbs_set_universaltable(lbs_private * priv, u8 band) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u16 size = sizeof(struct chan_freq_power); u16 i = 0; @@ -492,20 +492,20 @@ int libertas_set_universaltable(wlan_private * priv, u8 band) /** * @brief This function implements command CMD_802_11D_DOMAIN_INFO - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @param cmd pointer to cmd buffer * @param cmdno cmd ID * @param cmdOption cmd action * @return 0 */ -int libertas_cmd_802_11d_domain_info(wlan_private * priv, +int lbs_cmd_802_11d_domain_info(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmdno, u16 cmdoption) { struct cmd_ds_802_11d_domain_info *pdomaininfo = &cmd->params.domaininfo; struct mrvlietypes_domainparamset *domain = &pdomaininfo->domain; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u8 nr_subband = adapter->domainreg.nr_subband; lbs_deb_enter(LBS_DEB_11D); @@ -552,11 +552,11 @@ done: /** * @brief This function parses countryinfo from AP and download country info to FW - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @param resp pointer to command response buffer * @return 0; -1 */ -int libertas_ret_802_11d_domain_info(wlan_private * priv, +int lbs_ret_802_11d_domain_info(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp; @@ -598,14 +598,14 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, /** * @brief This function parses countryinfo from AP and download country info to FW - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @return 0; -1 */ -int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, +int lbs_parse_dnld_countryinfo_11d(lbs_private * priv, struct bss_descriptor * bss) { int ret; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_11D); if (priv->adapter->enable11d) { @@ -620,7 +620,7 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, } memset(&adapter->domainreg, 0, - sizeof(struct wlan_802_11d_domain_reg)); + sizeof(struct lbs_802_11d_domain_reg)); generate_domain_info_11d(&adapter->parsed_region_chan, &adapter->domainreg); @@ -640,13 +640,13 @@ done: /** * @brief This function generates 11D info from user specified regioncode and download to FW - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @return 0; -1 */ -int libertas_create_dnld_countryinfo_11d(wlan_private * priv) +int lbs_create_dnld_countryinfo_11d(lbs_private * priv) { int ret; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct region_channel *region_chan; u8 j; @@ -679,12 +679,12 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) memset(&adapter->parsed_region_chan, 0, sizeof(struct parsed_region_chan_11d)); - wlan_generate_parsed_region_chan_11d(region_chan, + lbs_generate_parsed_region_chan_11d(region_chan, &adapter-> parsed_region_chan); memset(&adapter->domainreg, 0, - sizeof(struct wlan_802_11d_domain_reg)); + sizeof(struct lbs_802_11d_domain_reg)); generate_domain_info_11d(&adapter->parsed_region_chan, &adapter->domainreg); diff --git a/drivers/net/wireless/libertas/11d.h b/drivers/net/wireless/libertas/11d.h index 3a6d1f8db78f..4f7f0deb6c84 100644 --- a/drivers/net/wireless/libertas/11d.h +++ b/drivers/net/wireless/libertas/11d.h @@ -2,8 +2,8 @@ * This header file contains data structures and * function declarations of 802.11d */ -#ifndef _WLAN_11D_ -#define _WLAN_11D_ +#ifndef _LBS_11D_ +#define _LBS_11D_ #include "types.h" #include "defs.h" @@ -52,7 +52,7 @@ struct cmd_ds_802_11d_domain_info { } __attribute__ ((packed)); /** domain regulatory information */ -struct wlan_802_11d_domain_reg { +struct lbs_802_11d_domain_reg { /** country Code*/ u8 countrycode[COUNTRY_CODE_LEN]; /** No. of subband*/ @@ -78,26 +78,26 @@ struct region_code_mapping { u8 code; }; -u8 libertas_get_scan_type_11d(u8 chan, +u8 lbs_get_scan_type_11d(u8 chan, struct parsed_region_chan_11d *parsed_region_chan); -u32 libertas_chan_2_freq(u8 chan, u8 band); +u32 lbs_chan_2_freq(u8 chan, u8 band); -void libertas_init_11d(wlan_private * priv); +void lbs_init_11d(lbs_private * priv); -int libertas_set_universaltable(wlan_private * priv, u8 band); +int lbs_set_universaltable(lbs_private * priv, u8 band); -int libertas_cmd_802_11d_domain_info(wlan_private * priv, +int lbs_cmd_802_11d_domain_info(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmdno, u16 cmdOption); -int libertas_ret_802_11d_domain_info(wlan_private * priv, +int lbs_ret_802_11d_domain_info(lbs_private * priv, struct cmd_ds_command *resp); struct bss_descriptor; -int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, +int lbs_parse_dnld_countryinfo_11d(lbs_private * priv, struct bss_descriptor * bss); -int libertas_create_dnld_countryinfo_11d(wlan_private * priv); +int lbs_create_dnld_countryinfo_11d(lbs_private * priv); -#endif /* _WLAN_11D_ */ +#endif diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index b61b176e9d07..e52b1eead288 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c @@ -38,10 +38,10 @@ static void print_assoc_req(const char * extra, struct assoc_request * assoc_req } -static int assoc_helper_essid(wlan_private *priv, +static int assoc_helper_essid(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; struct bss_descriptor * bss; int channel = -1; @@ -58,15 +58,15 @@ static int assoc_helper_essid(wlan_private *priv, lbs_deb_assoc("New SSID requested: '%s'\n", escape_essid(assoc_req->ssid, assoc_req->ssid_len)); if (assoc_req->mode == IW_MODE_INFRA) { - libertas_send_specific_ssid_scan(priv, assoc_req->ssid, + lbs_send_specific_ssid_scan(priv, assoc_req->ssid, assoc_req->ssid_len, 0); - bss = libertas_find_ssid_in_list(adapter, assoc_req->ssid, + bss = lbs_find_ssid_in_list(adapter, assoc_req->ssid, assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); if (bss != NULL) { lbs_deb_assoc("SSID found in scan list, associating\n"); memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - ret = wlan_associate(priv, assoc_req); + ret = lbs_associate(priv, assoc_req); } else { lbs_deb_assoc("SSID not found; cannot associate\n"); } @@ -74,23 +74,23 @@ static int assoc_helper_essid(wlan_private *priv, /* Scan for the network, do not save previous results. Stale * scan data will cause us to join a non-existant adhoc network */ - libertas_send_specific_ssid_scan(priv, assoc_req->ssid, + lbs_send_specific_ssid_scan(priv, assoc_req->ssid, assoc_req->ssid_len, 1); /* Search for the requested SSID in the scan table */ - bss = libertas_find_ssid_in_list(adapter, assoc_req->ssid, + bss = lbs_find_ssid_in_list(adapter, assoc_req->ssid, assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel); if (bss != NULL) { lbs_deb_assoc("SSID found, will join\n"); memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - libertas_join_adhoc_network(priv, assoc_req); + lbs_join_adhoc_network(priv, assoc_req); } else { /* else send START command */ lbs_deb_assoc("SSID not found, creating adhoc network\n"); memcpy(&assoc_req->bss.ssid, &assoc_req->ssid, IW_ESSID_MAX_SIZE); assoc_req->bss.ssid_len = assoc_req->ssid_len; - libertas_start_adhoc_network(priv, assoc_req); + lbs_start_adhoc_network(priv, assoc_req); } } @@ -99,10 +99,10 @@ static int assoc_helper_essid(wlan_private *priv, } -static int assoc_helper_bssid(wlan_private *priv, +static int assoc_helper_bssid(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; struct bss_descriptor * bss; DECLARE_MAC_BUF(mac); @@ -111,7 +111,7 @@ static int assoc_helper_bssid(wlan_private *priv, print_mac(mac, assoc_req->bssid)); /* Search for index position in list for requested MAC */ - bss = libertas_find_bssid_in_list(adapter, assoc_req->bssid, + bss = lbs_find_bssid_in_list(adapter, assoc_req->bssid, assoc_req->mode); if (bss == NULL) { lbs_deb_assoc("ASSOC: WAP: BSSID %s not found, " @@ -121,10 +121,10 @@ static int assoc_helper_bssid(wlan_private *priv, memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); if (assoc_req->mode == IW_MODE_INFRA) { - ret = wlan_associate(priv, assoc_req); - lbs_deb_assoc("ASSOC: wlan_associate(bssid) returned %d\n", ret); + ret = lbs_associate(priv, assoc_req); + lbs_deb_assoc("ASSOC: lbs_associate(bssid) returned %d\n", ret); } else if (assoc_req->mode == IW_MODE_ADHOC) { - libertas_join_adhoc_network(priv, assoc_req); + lbs_join_adhoc_network(priv, assoc_req); } out: @@ -133,7 +133,7 @@ out: } -static int assoc_helper_associate(wlan_private *priv, +static int assoc_helper_associate(lbs_private *priv, struct assoc_request * assoc_req) { int ret = 0, done = 0; @@ -162,10 +162,10 @@ static int assoc_helper_associate(wlan_private *priv, } -static int assoc_helper_mode(wlan_private *priv, +static int assoc_helper_mode(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; lbs_deb_enter(LBS_DEB_ASSOC); @@ -175,12 +175,12 @@ static int assoc_helper_mode(wlan_private *priv, if (assoc_req->mode == IW_MODE_INFRA) { if (adapter->psstate != PS_STATE_FULL_POWER) - libertas_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - adapter->psmode = WLAN802_11POWERMODECAM; + lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); + adapter->psmode = LBS802_11POWERMODECAM; } adapter->mode = assoc_req->mode; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, 0, CMD_OPTION_WAITFORRSP, OID_802_11_INFRASTRUCTURE_MODE, @@ -192,26 +192,26 @@ done: } -static int update_channel(wlan_private * priv) +static int update_channel(lbs_private * priv) { /* the channel in f/w could be out of sync, get the current channel */ - return libertas_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, + return lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, CMD_OPT_802_11_RF_CHANNEL_GET, CMD_OPTION_WAITFORRSP, 0, NULL); } -void libertas_sync_channel(struct work_struct *work) +void lbs_sync_channel(struct work_struct *work) { - wlan_private *priv = container_of(work, wlan_private, sync_channel); + lbs_private *priv = container_of(work, lbs_private, sync_channel); if (update_channel(priv) != 0) lbs_pr_info("Channel synchronization failed."); } -static int assoc_helper_channel(wlan_private *priv, +static int assoc_helper_channel(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; lbs_deb_enter(LBS_DEB_ASSOC); @@ -227,7 +227,7 @@ static int assoc_helper_channel(wlan_private *priv, lbs_deb_assoc("ASSOC: channel: %d -> %d\n", adapter->curbssparams.channel, assoc_req->channel); - ret = libertas_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, CMD_OPT_802_11_RF_CHANNEL_SET, CMD_OPTION_WAITFORRSP, 0, &assoc_req->channel); if (ret < 0) { @@ -263,10 +263,10 @@ done: } -static int assoc_helper_wep_keys(wlan_private *priv, +static int assoc_helper_wep_keys(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int i; int ret = 0; @@ -277,13 +277,13 @@ static int assoc_helper_wep_keys(wlan_private *priv, || assoc_req->wep_keys[1].len || assoc_req->wep_keys[2].len || assoc_req->wep_keys[3].len) { - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SET_WEP, CMD_ACT_ADD, CMD_OPTION_WAITFORRSP, 0, assoc_req); } else { - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SET_WEP, CMD_ACT_REMOVE, CMD_OPTION_WAITFORRSP, @@ -298,7 +298,7 @@ static int assoc_helper_wep_keys(wlan_private *priv, adapter->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE; else adapter->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE; - ret = libertas_set_mac_packet_filter(priv); + ret = lbs_set_mac_packet_filter(priv); if (ret) goto out; @@ -318,10 +318,10 @@ out: return ret; } -static int assoc_helper_secinfo(wlan_private *priv, +static int assoc_helper_secinfo(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; u32 do_wpa; u32 rsn = 0; @@ -329,9 +329,9 @@ static int assoc_helper_secinfo(wlan_private *priv, lbs_deb_enter(LBS_DEB_ASSOC); memcpy(&adapter->secinfo, &assoc_req->secinfo, - sizeof(struct wlan_802_11_security)); + sizeof(struct lbs_802_11_security)); - ret = libertas_set_mac_packet_filter(priv); + ret = lbs_set_mac_packet_filter(priv); if (ret) goto out; @@ -341,7 +341,7 @@ static int assoc_helper_secinfo(wlan_private *priv, */ /* Get RSN enabled/disabled */ - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_ENABLE_RSN, CMD_ACT_GET, CMD_OPTION_WAITFORRSP, @@ -358,7 +358,7 @@ static int assoc_helper_secinfo(wlan_private *priv, /* Set RSN enabled/disabled */ rsn = do_wpa; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_ENABLE_RSN, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, @@ -370,7 +370,7 @@ out: } -static int assoc_helper_wpa_keys(wlan_private *priv, +static int assoc_helper_wpa_keys(lbs_private *priv, struct assoc_request * assoc_req) { int ret = 0; @@ -385,7 +385,7 @@ static int assoc_helper_wpa_keys(wlan_private *priv, if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_KEY_MATERIAL, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, @@ -399,7 +399,7 @@ static int assoc_helper_wpa_keys(wlan_private *priv, if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_KEY_MATERIAL, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, @@ -413,10 +413,10 @@ out: } -static int assoc_helper_wpa_ie(wlan_private *priv, +static int assoc_helper_wpa_ie(lbs_private *priv, struct assoc_request * assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; lbs_deb_enter(LBS_DEB_ASSOC); @@ -434,10 +434,10 @@ static int assoc_helper_wpa_ie(wlan_private *priv, } -static int should_deauth_infrastructure(wlan_adapter *adapter, +static int should_deauth_infrastructure(lbs_adapter *adapter, struct assoc_request * assoc_req) { - if (adapter->connect_status != LIBERTAS_CONNECTED) + if (adapter->connect_status != LBS_CONNECTED) return 0; if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { @@ -475,13 +475,13 @@ static int should_deauth_infrastructure(wlan_adapter *adapter, } -static int should_stop_adhoc(wlan_adapter *adapter, +static int should_stop_adhoc(lbs_adapter *adapter, struct assoc_request * assoc_req) { - if (adapter->connect_status != LIBERTAS_CONNECTED) + if (adapter->connect_status != LBS_CONNECTED) return 0; - if (libertas_ssid_cmp(adapter->curbssparams.ssid, + if (lbs_ssid_cmp(adapter->curbssparams.ssid, adapter->curbssparams.ssid_len, assoc_req->ssid, assoc_req->ssid_len) != 0) return 1; @@ -501,10 +501,10 @@ static int should_stop_adhoc(wlan_adapter *adapter, } -void libertas_association_worker(struct work_struct *work) +void lbs_association_worker(struct work_struct *work) { - wlan_private *priv = container_of(work, wlan_private, assoc_work.work); - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = container_of(work, lbs_private, assoc_work.work); + lbs_adapter *adapter = priv->adapter; struct assoc_request * assoc_req = NULL; int ret = 0; int find_any_ssid = 0; @@ -538,7 +538,7 @@ void libertas_association_worker(struct work_struct *work) if (find_any_ssid) { u8 new_mode; - ret = libertas_find_best_network_ssid(priv, assoc_req->ssid, + ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, &assoc_req->ssid_len, assoc_req->mode, &new_mode); if (ret) { lbs_deb_assoc("Could not find best network\n"); @@ -559,7 +559,7 @@ void libertas_association_worker(struct work_struct *work) */ if (adapter->mode == IW_MODE_INFRA) { if (should_deauth_infrastructure(adapter, assoc_req)) { - ret = libertas_send_deauthentication(priv); + ret = lbs_send_deauthentication(priv); if (ret) { lbs_deb_assoc("Deauthentication due to new " "configuration request failed: %d\n", @@ -568,7 +568,7 @@ void libertas_association_worker(struct work_struct *work) } } else if (adapter->mode == IW_MODE_ADHOC) { if (should_stop_adhoc(adapter, assoc_req)) { - ret = libertas_stop_adhoc_network(priv); + ret = lbs_stop_adhoc_network(priv); if (ret) { lbs_deb_assoc("Teardown of AdHoc network due to " "new configuration request failed: %d\n", @@ -649,7 +649,7 @@ void libertas_association_worker(struct work_struct *work) success = 0; } - if (adapter->connect_status != LIBERTAS_CONNECTED) { + if (adapter->connect_status != LBS_CONNECTED) { lbs_deb_assoc("ASSOC: association attempt unsuccessful, " "not connected.\n"); success = 0; @@ -661,11 +661,11 @@ void libertas_association_worker(struct work_struct *work) escape_essid(adapter->curbssparams.ssid, adapter->curbssparams.ssid_len), print_mac(mac, adapter->curbssparams.bssid)); - libertas_prepare_and_send_command(priv, + lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, CMD_OPTION_WAITFORRSP, 0, NULL); - libertas_prepare_and_send_command(priv, + lbs_prepare_and_send_command(priv, CMD_802_11_GET_LOG, 0, CMD_OPTION_WAITFORRSP, 0, NULL); } else { @@ -692,7 +692,7 @@ done: /* * Caller MUST hold any necessary locks */ -struct assoc_request * wlan_get_association_request(wlan_adapter *adapter) +struct assoc_request *lbs_get_association_request(lbs_adapter *adapter) { struct assoc_request * assoc_req; @@ -753,7 +753,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter) if (!test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { memcpy(&assoc_req->secinfo, &adapter->secinfo, - sizeof(struct wlan_802_11_security)); + sizeof(struct lbs_802_11_security)); } if (!test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { diff --git a/drivers/net/wireless/libertas/assoc.h b/drivers/net/wireless/libertas/assoc.h index ed737eb995c0..462931cbf3be 100644 --- a/drivers/net/wireless/libertas/assoc.h +++ b/drivers/net/wireless/libertas/assoc.h @@ -1,14 +1,14 @@ /* Copyright (C) 2006, Red Hat, Inc. */ -#ifndef _WLAN_ASSOC_H_ -#define _WLAN_ASSOC_H_ +#ifndef _LBS_ASSOC_H_ +#define _LBS_ASSOC_H_ #include "dev.h" -void libertas_association_worker(struct work_struct *work); +void lbs_association_worker(struct work_struct *work); -struct assoc_request * wlan_get_association_request(wlan_adapter *adapter); +struct assoc_request * lbs_get_association_request(lbs_adapter *adapter); -void libertas_sync_channel(struct work_struct *work); +void lbs_sync_channel(struct work_struct *work); -#endif /* _WLAN_ASSOC_H */ +#endif /* _LBS_ASSOC_H */ diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index be5cfd8402c7..5b2a1c7c5f05 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c @@ -37,7 +37,7 @@ static u8 is_command_allowed_in_ps(__le16 command) return 0; } -static int wlan_cmd_hw_spec(wlan_private * priv, struct cmd_ds_command *cmd) +static int lbs_cmd_hw_spec(lbs_private * priv, struct cmd_ds_command *cmd) { struct cmd_ds_get_hw_spec *hwspec = &cmd->params.hwspec; @@ -51,7 +51,7 @@ static int wlan_cmd_hw_spec(wlan_private * priv, struct cmd_ds_command *cmd) return 0; } -static int wlan_cmd_802_11_ps_mode(wlan_private * priv, +static int lbs_cmd_802_11_ps_mode(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action) { @@ -90,7 +90,7 @@ static int wlan_cmd_802_11_ps_mode(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_inactivity_timeout(wlan_private * priv, +static int lbs_cmd_802_11_inactivity_timeout(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -114,11 +114,11 @@ static int wlan_cmd_802_11_inactivity_timeout(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_sleep_params(wlan_private * priv, +static int lbs_cmd_802_11_sleep_params(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_sleep_params *sp = &cmd->params.sleep_params; lbs_deb_enter(LBS_DEB_CMD); @@ -145,13 +145,13 @@ static int wlan_cmd_802_11_sleep_params(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_set_wep(wlan_private * priv, +static int lbs_cmd_802_11_set_wep(lbs_private * priv, struct cmd_ds_command *cmd, u32 cmd_act, void * pdata_buf) { struct cmd_ds_802_11_set_wep *wep = &cmd->params.wep; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; struct assoc_request * assoc_req = pdata_buf; @@ -219,7 +219,7 @@ done: return ret; } -static int wlan_cmd_802_11_enable_rsn(wlan_private * priv, +static int lbs_cmd_802_11_enable_rsn(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void * pdata_buf) @@ -272,7 +272,7 @@ static void set_one_wpa_key(struct MrvlIEtype_keyParamSet * pkeyparamset, lbs_deb_leave(LBS_DEB_CMD); } -static int wlan_cmd_802_11_key_material(wlan_private * priv, +static int lbs_cmd_802_11_key_material(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, u32 cmd_oid, void *pdata_buf) @@ -319,7 +319,7 @@ done: return ret; } -static int wlan_cmd_802_11_reset(wlan_private * priv, +static int lbs_cmd_802_11_reset(lbs_private * priv, struct cmd_ds_command *cmd, int cmd_action) { struct cmd_ds_802_11_reset *reset = &cmd->params.reset; @@ -334,7 +334,7 @@ static int wlan_cmd_802_11_reset(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_get_log(wlan_private * priv, +static int lbs_cmd_802_11_get_log(lbs_private * priv, struct cmd_ds_command *cmd) { lbs_deb_enter(LBS_DEB_CMD); @@ -346,7 +346,7 @@ static int wlan_cmd_802_11_get_log(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_get_stat(wlan_private * priv, +static int lbs_cmd_802_11_get_stat(lbs_private * priv, struct cmd_ds_command *cmd) { lbs_deb_enter(LBS_DEB_CMD); @@ -358,13 +358,13 @@ static int wlan_cmd_802_11_get_stat(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, +static int lbs_cmd_802_11_snmp_mib(lbs_private * priv, struct cmd_ds_command *cmd, int cmd_action, int cmd_oid, void *pdata_buf) { struct cmd_ds_802_11_snmp_mib *pSNMPMIB = &cmd->params.smib; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u8 ucTemp; lbs_deb_enter(LBS_DEB_CMD); @@ -479,11 +479,11 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_radio_control(wlan_private * priv, +static int lbs_cmd_802_11_radio_control(lbs_private * priv, struct cmd_ds_command *cmd, int cmd_action) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_radio_control *pradiocontrol = &cmd->params.radio; lbs_deb_enter(LBS_DEB_CMD); @@ -519,7 +519,7 @@ static int wlan_cmd_802_11_radio_control(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_rf_tx_power(wlan_private * priv, +static int lbs_cmd_802_11_rf_tx_power(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -563,7 +563,7 @@ static int wlan_cmd_802_11_rf_tx_power(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_monitor_mode(wlan_private * priv, +static int lbs_cmd_802_11_monitor_mode(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -583,13 +583,13 @@ static int wlan_cmd_802_11_monitor_mode(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_rate_adapt_rateset(wlan_private * priv, +static int lbs_cmd_802_11_rate_adapt_rateset(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action) { struct cmd_ds_802_11_rate_adapt_rateset *rateadapt = &cmd->params.rateset; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); cmd->size = @@ -605,12 +605,12 @@ static int wlan_cmd_802_11_rate_adapt_rateset(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_data_rate(wlan_private * priv, +static int lbs_cmd_802_11_data_rate(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action) { struct cmd_ds_802_11_data_rate *pdatarate = &cmd->params.drate; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -621,7 +621,7 @@ static int wlan_cmd_802_11_data_rate(wlan_private * priv, pdatarate->action = cpu_to_le16(cmd_action); if (cmd_action == CMD_ACT_SET_TX_FIX_RATE) { - pdatarate->rates[0] = libertas_data_rate_to_fw_index(adapter->cur_rate); + pdatarate->rates[0] = lbs_data_rate_to_fw_index(adapter->cur_rate); lbs_deb_cmd("DATA_RATE: set fixed 0x%02X\n", adapter->cur_rate); } else if (cmd_action == CMD_ACT_SET_TX_AUTO) { @@ -632,12 +632,12 @@ static int wlan_cmd_802_11_data_rate(wlan_private * priv, return 0; } -static int wlan_cmd_mac_multicast_adr(wlan_private * priv, +static int lbs_cmd_mac_multicast_adr(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action) { struct cmd_ds_mac_multicast_adr *pMCastAdr = &cmd->params.madr; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mac_multicast_adr) + @@ -655,7 +655,7 @@ static int wlan_cmd_mac_multicast_adr(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_rf_channel(wlan_private * priv, +static int lbs_cmd_802_11_rf_channel(lbs_private * priv, struct cmd_ds_command *cmd, int option, void *pdata_buf) { @@ -676,10 +676,10 @@ static int wlan_cmd_802_11_rf_channel(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_rssi(wlan_private * priv, +static int lbs_cmd_802_11_rssi(lbs_private * priv, struct cmd_ds_command *cmd) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); cmd->command = cpu_to_le16(CMD_802_11_RSSI); @@ -698,15 +698,15 @@ static int wlan_cmd_802_11_rssi(wlan_private * priv, return 0; } -static int wlan_cmd_reg_access(wlan_private * priv, +static int lbs_cmd_reg_access(lbs_private * priv, struct cmd_ds_command *cmdptr, u8 cmd_action, void *pdata_buf) { - struct wlan_offset_value *offval; + struct lbs_offset_value *offval; lbs_deb_enter(LBS_DEB_CMD); - offval = (struct wlan_offset_value *)pdata_buf; + offval = (struct lbs_offset_value *)pdata_buf; switch (cmdptr->command) { case CMD_MAC_REG_ACCESS: @@ -773,11 +773,11 @@ static int wlan_cmd_reg_access(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_mac_address(wlan_private * priv, +static int lbs_cmd_802_11_mac_address(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); cmd->command = cpu_to_le16(CMD_802_11_MAC_ADDRESS); @@ -797,11 +797,11 @@ static int wlan_cmd_802_11_mac_address(wlan_private * priv, return 0; } -static int wlan_cmd_802_11_eeprom_access(wlan_private * priv, +static int lbs_cmd_802_11_eeprom_access(lbs_private * priv, struct cmd_ds_command *cmd, int cmd_action, void *pdata_buf) { - struct wlan_ioctl_regrdwr *ea = pdata_buf; + struct lbs_ioctl_regrdwr *ea = pdata_buf; lbs_deb_enter(LBS_DEB_CMD); @@ -819,7 +819,7 @@ static int wlan_cmd_802_11_eeprom_access(wlan_private * priv, return 0; } -static int wlan_cmd_bt_access(wlan_private * priv, +static int lbs_cmd_bt_access(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -857,7 +857,7 @@ static int wlan_cmd_bt_access(wlan_private * priv, return 0; } -static int wlan_cmd_fwt_access(wlan_private * priv, +static int lbs_cmd_fwt_access(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -879,7 +879,7 @@ static int wlan_cmd_fwt_access(wlan_private * priv, return 0; } -static int wlan_cmd_mesh_access(wlan_private * priv, +static int lbs_cmd_mesh_access(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -901,7 +901,7 @@ static int wlan_cmd_mesh_access(wlan_private * priv, return 0; } -static int wlan_cmd_set_boot2_ver(wlan_private * priv, +static int lbs_cmd_set_boot2_ver(lbs_private * priv, struct cmd_ds_command *cmd, u16 cmd_action, void *pdata_buf) { @@ -913,10 +913,10 @@ static int wlan_cmd_set_boot2_ver(wlan_private * priv, } /* - * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for + * Note: NEVER use lbs_queue_cmd() with addtail==0 other than for * the command timer, because it does not account for queued commands. */ -void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) +void lbs_queue_cmd(lbs_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) { unsigned long flags; struct cmd_ds_command *cmdptr; @@ -968,12 +968,12 @@ done: * For now - we are not performing the endian conversion the second time - but * for PS and DEEP_SLEEP we need to worry */ -static int DownloadcommandToStation(wlan_private * priv, +static int DownloadcommandToStation(lbs_private * priv, struct cmd_ctrl_node *cmdnode) { unsigned long flags; struct cmd_ds_command *cmdptr; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = -1; u16 cmdsize; u16 command; @@ -990,7 +990,7 @@ static int DownloadcommandToStation(wlan_private * priv, spin_lock_irqsave(&adapter->driver_lock, flags); if (!cmdptr || !cmdptr->size) { lbs_deb_host("DNLD_CMD: cmdptr is NULL or zero\n"); - __libertas_cleanup_and_insert_cmd(priv, cmdnode); + __lbs_cleanup_and_insert_cmd(priv, cmdnode); spin_unlock_irqrestore(&adapter->driver_lock, flags); goto done; } @@ -1015,7 +1015,7 @@ static int DownloadcommandToStation(wlan_private * priv, lbs_deb_host("DNLD_CMD: hw_host_to_card failed\n"); spin_lock_irqsave(&adapter->driver_lock, flags); adapter->cur_cmd_retcode = ret; - __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); + __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->nr_cmd_pending--; adapter->cur_cmd = NULL; spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -1038,7 +1038,7 @@ done: return ret; } -static int wlan_cmd_mac_control(wlan_private * priv, +static int lbs_cmd_mac_control(lbs_private * priv, struct cmd_ds_command *cmd) { struct cmd_ds_mac_control *mac = &cmd->params.macctrl; @@ -1060,9 +1060,9 @@ static int wlan_cmd_mac_control(wlan_private * priv, * This function inserts command node to cmdfreeq * after cleans it. Requires adapter->driver_lock held. */ -void __libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node *ptempcmd) +void __lbs_cleanup_and_insert_cmd(lbs_private * priv, struct cmd_ctrl_node *ptempcmd) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; if (!ptempcmd) return; @@ -1071,22 +1071,22 @@ void __libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node list_add_tail((struct list_head *)ptempcmd, &adapter->cmdfreeq); } -static void libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node *ptempcmd) +static void lbs_cleanup_and_insert_cmd(lbs_private * priv, struct cmd_ctrl_node *ptempcmd) { unsigned long flags; spin_lock_irqsave(&priv->adapter->driver_lock, flags); - __libertas_cleanup_and_insert_cmd(priv, ptempcmd); + __lbs_cleanup_and_insert_cmd(priv, ptempcmd); spin_unlock_irqrestore(&priv->adapter->driver_lock, flags); } -int libertas_set_radio_control(wlan_private * priv) +int lbs_set_radio_control(lbs_private * priv) { int ret = 0; lbs_deb_enter(LBS_DEB_CMD); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_RADIO_CONTROL, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -1098,14 +1098,14 @@ int libertas_set_radio_control(wlan_private * priv) return ret; } -int libertas_set_mac_packet_filter(wlan_private * priv) +int lbs_set_mac_packet_filter(lbs_private * priv) { int ret = 0; lbs_deb_enter(LBS_DEB_CMD); /* Send MAC control command to station */ - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_MAC_CONTROL, 0, 0, 0, NULL); lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); @@ -1115,7 +1115,7 @@ int libertas_set_mac_packet_filter(wlan_private * priv) /** * @brief This function prepare the command before send to firmware. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param cmd_no command number * @param cmd_action command action: GET or SET * @param wait_option wait option: wait response or not @@ -1123,13 +1123,13 @@ int libertas_set_mac_packet_filter(wlan_private * priv) * @param pdata_buf A pointer to informaion buffer * @return 0 or -1 */ -int libertas_prepare_and_send_command(wlan_private * priv, +int lbs_prepare_and_send_command(lbs_private * priv, u16 cmd_no, u16 cmd_action, u16 wait_option, u32 cmd_oid, void *pdata_buf) { int ret = 0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *cmdnode; struct cmd_ds_command *cmdptr; unsigned long flags; @@ -1148,7 +1148,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, goto done; } - cmdnode = libertas_get_free_cmd_ctrl_node(priv); + cmdnode = lbs_get_free_cmd_ctrl_node(priv); if (cmdnode == NULL) { lbs_deb_host("PREP_CMD: cmdnode is NULL\n"); @@ -1159,7 +1159,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, goto done; } - libertas_set_cmd_ctrl_node(priv, cmdnode, cmd_oid, wait_option, pdata_buf); + lbs_set_cmd_ctrl_node(priv, cmdnode, cmd_oid, wait_option, pdata_buf); cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; @@ -1167,7 +1167,7 @@ int libertas_prepare_and_send_command(wlan_private * priv, if (!cmdptr) { lbs_deb_host("PREP_CMD: cmdptr is NULL\n"); - libertas_cleanup_and_insert_cmd(priv, cmdnode); + lbs_cleanup_and_insert_cmd(priv, cmdnode); ret = -1; goto done; } @@ -1181,116 +1181,116 @@ int libertas_prepare_and_send_command(wlan_private * priv, switch (cmd_no) { case CMD_GET_HW_SPEC: - ret = wlan_cmd_hw_spec(priv, cmdptr); + ret = lbs_cmd_hw_spec(priv, cmdptr); break; case CMD_802_11_PS_MODE: - ret = wlan_cmd_802_11_ps_mode(priv, cmdptr, cmd_action); + ret = lbs_cmd_802_11_ps_mode(priv, cmdptr, cmd_action); break; case CMD_802_11_SCAN: - ret = libertas_cmd_80211_scan(priv, cmdptr, pdata_buf); + ret = lbs_cmd_80211_scan(priv, cmdptr, pdata_buf); break; case CMD_MAC_CONTROL: - ret = wlan_cmd_mac_control(priv, cmdptr); + ret = lbs_cmd_mac_control(priv, cmdptr); break; case CMD_802_11_ASSOCIATE: case CMD_802_11_REASSOCIATE: - ret = libertas_cmd_80211_associate(priv, cmdptr, pdata_buf); + ret = lbs_cmd_80211_associate(priv, cmdptr, pdata_buf); break; case CMD_802_11_DEAUTHENTICATE: - ret = libertas_cmd_80211_deauthenticate(priv, cmdptr); + ret = lbs_cmd_80211_deauthenticate(priv, cmdptr); break; case CMD_802_11_SET_WEP: - ret = wlan_cmd_802_11_set_wep(priv, cmdptr, cmd_action, pdata_buf); + ret = lbs_cmd_802_11_set_wep(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_802_11_AD_HOC_START: - ret = libertas_cmd_80211_ad_hoc_start(priv, cmdptr, pdata_buf); + ret = lbs_cmd_80211_ad_hoc_start(priv, cmdptr, pdata_buf); break; case CMD_CODE_DNLD: break; case CMD_802_11_RESET: - ret = wlan_cmd_802_11_reset(priv, cmdptr, cmd_action); + ret = lbs_cmd_802_11_reset(priv, cmdptr, cmd_action); break; case CMD_802_11_GET_LOG: - ret = wlan_cmd_802_11_get_log(priv, cmdptr); + ret = lbs_cmd_802_11_get_log(priv, cmdptr); break; case CMD_802_11_AUTHENTICATE: - ret = libertas_cmd_80211_authenticate(priv, cmdptr, pdata_buf); + ret = lbs_cmd_80211_authenticate(priv, cmdptr, pdata_buf); break; case CMD_802_11_GET_STAT: - ret = wlan_cmd_802_11_get_stat(priv, cmdptr); + ret = lbs_cmd_802_11_get_stat(priv, cmdptr); break; case CMD_802_11_SNMP_MIB: - ret = wlan_cmd_802_11_snmp_mib(priv, cmdptr, + ret = lbs_cmd_802_11_snmp_mib(priv, cmdptr, cmd_action, cmd_oid, pdata_buf); break; case CMD_MAC_REG_ACCESS: case CMD_BBP_REG_ACCESS: case CMD_RF_REG_ACCESS: - ret = wlan_cmd_reg_access(priv, cmdptr, cmd_action, pdata_buf); + ret = lbs_cmd_reg_access(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_802_11_RF_CHANNEL: - ret = wlan_cmd_802_11_rf_channel(priv, cmdptr, + ret = lbs_cmd_802_11_rf_channel(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_802_11_RF_TX_POWER: - ret = wlan_cmd_802_11_rf_tx_power(priv, cmdptr, + ret = lbs_cmd_802_11_rf_tx_power(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_802_11_RADIO_CONTROL: - ret = wlan_cmd_802_11_radio_control(priv, cmdptr, cmd_action); + ret = lbs_cmd_802_11_radio_control(priv, cmdptr, cmd_action); break; case CMD_802_11_DATA_RATE: - ret = wlan_cmd_802_11_data_rate(priv, cmdptr, cmd_action); + ret = lbs_cmd_802_11_data_rate(priv, cmdptr, cmd_action); break; case CMD_802_11_RATE_ADAPT_RATESET: - ret = wlan_cmd_802_11_rate_adapt_rateset(priv, + ret = lbs_cmd_802_11_rate_adapt_rateset(priv, cmdptr, cmd_action); break; case CMD_MAC_MULTICAST_ADR: - ret = wlan_cmd_mac_multicast_adr(priv, cmdptr, cmd_action); + ret = lbs_cmd_mac_multicast_adr(priv, cmdptr, cmd_action); break; case CMD_802_11_MONITOR_MODE: - ret = wlan_cmd_802_11_monitor_mode(priv, cmdptr, + ret = lbs_cmd_802_11_monitor_mode(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_802_11_AD_HOC_JOIN: - ret = libertas_cmd_80211_ad_hoc_join(priv, cmdptr, pdata_buf); + ret = lbs_cmd_80211_ad_hoc_join(priv, cmdptr, pdata_buf); break; case CMD_802_11_RSSI: - ret = wlan_cmd_802_11_rssi(priv, cmdptr); + ret = lbs_cmd_802_11_rssi(priv, cmdptr); break; case CMD_802_11_AD_HOC_STOP: - ret = libertas_cmd_80211_ad_hoc_stop(priv, cmdptr); + ret = lbs_cmd_80211_ad_hoc_stop(priv, cmdptr); break; case CMD_802_11_ENABLE_RSN: - ret = wlan_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action, + ret = lbs_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_802_11_KEY_MATERIAL: - ret = wlan_cmd_802_11_key_material(priv, cmdptr, cmd_action, + ret = lbs_cmd_802_11_key_material(priv, cmdptr, cmd_action, cmd_oid, pdata_buf); break; @@ -1300,11 +1300,11 @@ int libertas_prepare_and_send_command(wlan_private * priv, break; case CMD_802_11_MAC_ADDRESS: - ret = wlan_cmd_802_11_mac_address(priv, cmdptr, cmd_action); + ret = lbs_cmd_802_11_mac_address(priv, cmdptr, cmd_action); break; case CMD_802_11_EEPROM_ACCESS: - ret = wlan_cmd_802_11_eeprom_access(priv, cmdptr, + ret = lbs_cmd_802_11_eeprom_access(priv, cmdptr, cmd_action, pdata_buf); break; @@ -1322,17 +1322,17 @@ int libertas_prepare_and_send_command(wlan_private * priv, goto done; case CMD_802_11D_DOMAIN_INFO: - ret = libertas_cmd_802_11d_domain_info(priv, cmdptr, + ret = lbs_cmd_802_11d_domain_info(priv, cmdptr, cmd_no, cmd_action); break; case CMD_802_11_SLEEP_PARAMS: - ret = wlan_cmd_802_11_sleep_params(priv, cmdptr, cmd_action); + ret = lbs_cmd_802_11_sleep_params(priv, cmdptr, cmd_action); break; case CMD_802_11_INACTIVITY_TIMEOUT: - ret = wlan_cmd_802_11_inactivity_timeout(priv, cmdptr, + ret = lbs_cmd_802_11_inactivity_timeout(priv, cmdptr, cmd_action, pdata_buf); - libertas_set_cmd_ctrl_node(priv, cmdnode, 0, 0, pdata_buf); + lbs_set_cmd_ctrl_node(priv, cmdnode, 0, 0, pdata_buf); break; case CMD_802_11_TPC_CFG: @@ -1379,19 +1379,19 @@ int libertas_prepare_and_send_command(wlan_private * priv, ret = 0; break; case CMD_BT_ACCESS: - ret = wlan_cmd_bt_access(priv, cmdptr, cmd_action, pdata_buf); + ret = lbs_cmd_bt_access(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_FWT_ACCESS: - ret = wlan_cmd_fwt_access(priv, cmdptr, cmd_action, pdata_buf); + ret = lbs_cmd_fwt_access(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_MESH_ACCESS: - ret = wlan_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf); + ret = lbs_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_SET_BOOT2_VER: - ret = wlan_cmd_set_boot2_ver(priv, cmdptr, cmd_action, pdata_buf); + ret = lbs_cmd_set_boot2_ver(priv, cmdptr, cmd_action, pdata_buf); break; case CMD_GET_TSF: @@ -1409,14 +1409,14 @@ int libertas_prepare_and_send_command(wlan_private * priv, /* return error, since the command preparation failed */ if (ret != 0) { lbs_deb_host("PREP_CMD: command preparation failed\n"); - libertas_cleanup_and_insert_cmd(priv, cmdnode); + lbs_cleanup_and_insert_cmd(priv, cmdnode); ret = -1; goto done; } cmdnode->cmdwaitqwoken = 0; - libertas_queue_cmd(adapter, cmdnode, 1); + lbs_queue_cmd(adapter, cmdnode, 1); wake_up_interruptible(&priv->waitq); if (wait_option & CMD_OPTION_WAITFORRSP) { @@ -1439,23 +1439,23 @@ done: lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); return ret; } -EXPORT_SYMBOL_GPL(libertas_prepare_and_send_command); +EXPORT_SYMBOL_GPL(lbs_prepare_and_send_command); /** * @brief This function allocates the command buffer and link * it to command free queue. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return 0 or -1 */ -int libertas_allocate_cmd_buffer(wlan_private * priv) +int lbs_allocate_cmd_buffer(lbs_private * priv) { int ret = 0; u32 ulbufsize; u32 i; struct cmd_ctrl_node *tempcmd_array; u8 *ptempvirtualaddr; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_HOST); @@ -1484,7 +1484,7 @@ int libertas_allocate_cmd_buffer(wlan_private * priv) for (i = 0; i < MRVDRV_NUM_OF_CMD_BUFFER; i++) { init_waitqueue_head(&tempcmd_array[i].cmdwait_q); - libertas_cleanup_and_insert_cmd(priv, &tempcmd_array[i]); + lbs_cleanup_and_insert_cmd(priv, &tempcmd_array[i]); } ret = 0; @@ -1497,15 +1497,15 @@ done: /** * @brief This function frees the command buffer. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return 0 or -1 */ -int libertas_free_cmd_buffer(wlan_private * priv) +int lbs_free_cmd_buffer(lbs_private * priv) { u32 ulbufsize; /* Someone needs to die for this. Slowly and painfully */ unsigned int i; struct cmd_ctrl_node *tempcmd_array; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_HOST); @@ -1541,13 +1541,13 @@ done: * @brief This function gets a free command node if available in * command free queue. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return cmd_ctrl_node A pointer to cmd_ctrl_node structure or NULL */ -struct cmd_ctrl_node *libertas_get_free_cmd_ctrl_node(wlan_private * priv) +struct cmd_ctrl_node *lbs_get_free_cmd_ctrl_node(lbs_private * priv) { struct cmd_ctrl_node *tempnode; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; unsigned long flags; lbs_deb_enter(LBS_DEB_HOST); @@ -1602,14 +1602,14 @@ static void cleanup_cmdnode(struct cmd_ctrl_node *ptempnode) /** * @brief This function initializes the command node. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param ptempnode A pointer to cmd_ctrl_node structure * @param cmd_oid cmd oid: treated as sub command * @param wait_option wait option: wait response or not * @param pdata_buf A pointer to informaion buffer * @return 0 or -1 */ -void libertas_set_cmd_ctrl_node(wlan_private * priv, +void lbs_set_cmd_ctrl_node(lbs_private * priv, struct cmd_ctrl_node *ptempnode, u32 cmd_oid, u16 wait_option, void *pdata_buf) { @@ -1630,19 +1630,19 @@ void libertas_set_cmd_ctrl_node(wlan_private * priv, * pending queue. It will put fimware back to PS mode * if applicable. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return 0 or -1 */ -int libertas_execute_next_command(wlan_private * priv) +int lbs_execute_next_command(lbs_private * priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *cmdnode = NULL; struct cmd_ds_command *cmdptr; unsigned long flags; int ret = 0; // Debug group is LBS_DEB_THREAD and not LBS_DEB_HOST, because the - // only caller to us is libertas_thread() and we get even when a + // only caller to us is lbs_thread() and we get even when a // data packet is received lbs_deb_enter(LBS_DEB_THREAD); @@ -1683,7 +1683,7 @@ int libertas_execute_next_command(wlan_private * priv) /* * 1. Non-PS command: * Queue it. set needtowakeup to TRUE if current state - * is SLEEP, otherwise call libertas_ps_wakeup to send Exit_PS. + * is SLEEP, otherwise call lbs_ps_wakeup to send Exit_PS. * 2. PS command but not Exit_PS: * Ignore it. * 3. PS command Exit_PS: @@ -1702,7 +1702,7 @@ int libertas_execute_next_command(wlan_private * priv) since it is blocked in main_thread. */ adapter->needtowakeup = 1; } else - libertas_ps_wakeup(priv, 0); + lbs_ps_wakeup(priv, 0); ret = 0; goto done; @@ -1722,7 +1722,7 @@ int libertas_execute_next_command(wlan_private * priv) lbs_deb_host( "EXEC_NEXT_CMD: ignore ENTER_PS cmd\n"); list_del((struct list_head *)cmdnode); - libertas_cleanup_and_insert_cmd(priv, cmdnode); + lbs_cleanup_and_insert_cmd(priv, cmdnode); ret = 0; goto done; @@ -1733,7 +1733,7 @@ int libertas_execute_next_command(wlan_private * priv) lbs_deb_host( "EXEC_NEXT_CMD: ignore EXIT_PS cmd in sleep\n"); list_del((struct list_head *)cmdnode); - libertas_cleanup_and_insert_cmd(priv, cmdnode); + lbs_cleanup_and_insert_cmd(priv, cmdnode); adapter->needtowakeup = 1; ret = 0; @@ -1753,9 +1753,9 @@ int libertas_execute_next_command(wlan_private * priv) * check if in power save mode, if yes, put the device back * to PS mode */ - if ((adapter->psmode != WLAN802_11POWERMODECAM) && + if ((adapter->psmode != LBS802_11POWERMODECAM) && (adapter->psstate == PS_STATE_FULL_POWER) && - (adapter->connect_status == LIBERTAS_CONNECTED)) { + (adapter->connect_status == LBS_CONNECTED)) { if (adapter->secinfo.WPAenabled || adapter->secinfo.WPA2enabled) { /* check for valid WPA group keys */ @@ -1764,13 +1764,13 @@ int libertas_execute_next_command(wlan_private * priv) lbs_deb_host( "EXEC_NEXT_CMD: WPA enabled and GTK_SET" " go back to PS_SLEEP"); - libertas_ps_sleep(priv, 0); + lbs_ps_sleep(priv, 0); } } else { lbs_deb_host( "EXEC_NEXT_CMD: cmdpendingq empty, " "go back to PS_SLEEP"); - libertas_ps_sleep(priv, 0); + lbs_ps_sleep(priv, 0); } } } @@ -1781,7 +1781,7 @@ done: return ret; } -void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str) +void lbs_send_iwevcustom_event(lbs_private *priv, s8 *str) { union iwreq_data iwrq; u8 buf[50]; @@ -1805,10 +1805,10 @@ void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str) lbs_deb_leave(LBS_DEB_WEXT); } -static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size) +static int sendconfirmsleep(lbs_private *priv, u8 *cmdptr, u16 size) { unsigned long flags; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; lbs_deb_enter(LBS_DEB_HOST); @@ -1847,7 +1847,7 @@ static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size) return ret; } -void libertas_ps_sleep(wlan_private * priv, int wait_option) +void lbs_ps_sleep(lbs_private * priv, int wait_option) { lbs_deb_enter(LBS_DEB_HOST); @@ -1856,7 +1856,7 @@ void libertas_ps_sleep(wlan_private * priv, int wait_option) * Remove this check if it is to be supported in IBSS mode also */ - libertas_prepare_and_send_command(priv, CMD_802_11_PS_MODE, + lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE, CMD_SUBCMD_ENTER_PS, wait_option, 0, NULL); lbs_deb_leave(LBS_DEB_HOST); @@ -1865,19 +1865,19 @@ void libertas_ps_sleep(wlan_private * priv, int wait_option) /** * @brief This function sends Exit_PS command to firmware. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param wait_option wait response or not * @return n/a */ -void libertas_ps_wakeup(wlan_private * priv, int wait_option) +void lbs_ps_wakeup(lbs_private * priv, int wait_option) { __le32 Localpsmode; lbs_deb_enter(LBS_DEB_HOST); - Localpsmode = cpu_to_le32(WLAN802_11POWERMODECAM); + Localpsmode = cpu_to_le32(LBS802_11POWERMODECAM); - libertas_prepare_and_send_command(priv, CMD_802_11_PS_MODE, + lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE, CMD_SUBCMD_EXIT_PS, wait_option, 0, &Localpsmode); @@ -1888,14 +1888,14 @@ void libertas_ps_wakeup(wlan_private * priv, int wait_option) * @brief This function checks condition and prepares to * send sleep confirm command to firmware if ok. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param psmode Power Saving mode * @return n/a */ -void libertas_ps_confirm_sleep(wlan_private * priv, u16 psmode) +void lbs_ps_confirm_sleep(lbs_private * priv, u16 psmode) { unsigned long flags =0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u8 allowed = 1; lbs_deb_enter(LBS_DEB_HOST); @@ -1917,8 +1917,8 @@ void libertas_ps_confirm_sleep(wlan_private * priv, u16 psmode) spin_unlock_irqrestore(&adapter->driver_lock, flags); if (allowed) { - lbs_deb_host("sending libertas_ps_confirm_sleep\n"); - sendconfirmsleep(priv, (u8 *) & adapter->libertas_ps_confirm_sleep, + lbs_deb_host("sending lbs_ps_confirm_sleep\n"); + sendconfirmsleep(priv, (u8 *) & adapter->lbs_ps_confirm_sleep, sizeof(struct PS_CMD_ConfirmSleep)); } else { lbs_deb_host("sleep confirm has been delayed\n"); diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 8f90892ea22e..6c1fdb8f11fb 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c @@ -20,15 +20,15 @@ * reports disconnect to upper layer, clean tx/rx packets, * reset link state etc. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return n/a */ -void libertas_mac_event_disconnected(wlan_private * priv) +void lbs_mac_event_disconnected(lbs_private * priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; union iwreq_data wrqu; - if (adapter->connect_status != LIBERTAS_CONNECTED) + if (adapter->connect_status != LBS_CONNECTED) return; lbs_deb_enter(LBS_DEB_CMD); @@ -65,7 +65,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) adapter->curbssparams.ssid_len), adapter->curbssparams.ssid_len); - adapter->connect_status = LIBERTAS_DISCONNECTED; + adapter->connect_status = LBS_DISCONNECTED; /* Clear out associated SSID and BSSID since connection is * no longer valid. @@ -77,7 +77,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) if (adapter->psstate != PS_STATE_FULL_POWER) { /* make firmware to exit PS mode */ lbs_deb_cmd("disconnected, so exit PS mode\n"); - libertas_ps_wakeup(priv, 0); + lbs_ps_wakeup(priv, 0); } lbs_deb_leave(LBS_DEB_CMD); } @@ -85,11 +85,11 @@ void libertas_mac_event_disconnected(wlan_private * priv) /** * @brief This function handles MIC failure event. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @para event the event id * @return n/a */ -static void handle_mic_failureevent(wlan_private * priv, u32 event) +static void handle_mic_failureevent(lbs_private * priv, u32 event) { char buf[50]; @@ -104,15 +104,15 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event) strcat(buf, "multicast "); } - libertas_send_iwevcustom_event(priv, buf); + lbs_send_iwevcustom_event(priv, buf); lbs_deb_leave(LBS_DEB_CMD); } -static int wlan_ret_reg_access(wlan_private * priv, +static int lbs_ret_reg_access(lbs_private * priv, u16 type, struct cmd_ds_command *resp) { int ret = 0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -152,12 +152,12 @@ static int wlan_ret_reg_access(wlan_private * priv, return ret; } -static int wlan_ret_get_hw_spec(wlan_private * priv, +static int lbs_ret_get_hw_spec(lbs_private * priv, struct cmd_ds_command *resp) { u32 i; struct cmd_ds_get_hw_spec *hwspec = &resp->params.hwspec; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; DECLARE_MAC_BUF(mac); @@ -183,7 +183,7 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { /* use the region code to search for the index */ - if (adapter->regioncode == libertas_region_code_to_index[i]) { + if (adapter->regioncode == lbs_region_code_to_index[i]) { break; } } @@ -201,12 +201,12 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, if (priv->mesh_dev) memcpy(priv->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN); - if (libertas_set_regiontable(priv, adapter->regioncode, 0)) { + if (lbs_set_regiontable(priv, adapter->regioncode, 0)) { ret = -1; goto done; } - if (libertas_set_universaltable(priv, 0)) { + if (lbs_set_universaltable(priv, 0)) { ret = -1; goto done; } @@ -216,11 +216,11 @@ done: return ret; } -static int wlan_ret_802_11_sleep_params(wlan_private * priv, +static int lbs_ret_802_11_sleep_params(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_sleep_params *sp = &resp->params.sleep_params; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -240,14 +240,14 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, return 0; } -static int wlan_ret_802_11_stat(wlan_private * priv, +static int lbs_ret_802_11_stat(lbs_private * priv, struct cmd_ds_command *resp) { lbs_deb_enter(LBS_DEB_CMD); /* currently adapter->wlan802_11Stat is unused struct cmd_ds_802_11_get_stat *p11Stat = &resp->params.gstat; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; // TODO Convert it to Big endian befor copy memcpy(&adapter->wlan802_11Stat, @@ -257,7 +257,7 @@ static int wlan_ret_802_11_stat(wlan_private * priv, return 0; } -static int wlan_ret_802_11_snmp_mib(wlan_private * priv, +static int lbs_ret_802_11_snmp_mib(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_snmp_mib *smib = &resp->params.smib; @@ -299,12 +299,12 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, return 0; } -static int wlan_ret_802_11_key_material(wlan_private * priv, +static int lbs_ret_802_11_key_material(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_key_material *pkeymaterial = &resp->params.keymaterial; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u16 action = le16_to_cpu(pkeymaterial->action); lbs_deb_enter(LBS_DEB_CMD); @@ -355,11 +355,11 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, return 0; } -static int wlan_ret_802_11_mac_address(wlan_private * priv, +static int lbs_ret_802_11_mac_address(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_mac_address *macadd = &resp->params.macadd; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -369,11 +369,11 @@ static int wlan_ret_802_11_mac_address(wlan_private * priv, return 0; } -static int wlan_ret_802_11_rf_tx_power(wlan_private * priv, +static int lbs_ret_802_11_rf_tx_power(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_rf_tx_power *rtp = &resp->params.txp; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -385,11 +385,11 @@ static int wlan_ret_802_11_rf_tx_power(wlan_private * priv, return 0; } -static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, +static int lbs_ret_802_11_rate_adapt_rateset(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_rate_adapt_rateset *rates = &resp->params.rateset; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -402,11 +402,11 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, return 0; } -static int wlan_ret_802_11_data_rate(wlan_private * priv, +static int lbs_ret_802_11_data_rate(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_data_rate *pdatarate = &resp->params.drate; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -416,18 +416,18 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, /* FIXME: get actual rates FW can do if this command actually returns * all data rates supported. */ - adapter->cur_rate = libertas_fw_index_to_data_rate(pdatarate->rates[0]); + adapter->cur_rate = lbs_fw_index_to_data_rate(pdatarate->rates[0]); lbs_deb_cmd("DATA_RATE: current rate 0x%02x\n", adapter->cur_rate); lbs_deb_leave(LBS_DEB_CMD); return 0; } -static int wlan_ret_802_11_rf_channel(wlan_private * priv, +static int lbs_ret_802_11_rf_channel(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_rf_channel *rfchannel = &resp->params.rfchannel; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u16 action = le16_to_cpu(rfchannel->action); u16 newchannel = le16_to_cpu(rfchannel->currentchannel); @@ -446,11 +446,11 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv, return 0; } -static int wlan_ret_802_11_rssi(wlan_private * priv, +static int lbs_ret_802_11_rssi(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_rssi_rsp *rssirsp = &resp->params.rssirsp; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -477,12 +477,12 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, return 0; } -static int wlan_ret_802_11_eeprom_access(wlan_private * priv, +static int lbs_ret_802_11_eeprom_access(lbs_private * priv, struct cmd_ds_command *resp) { - wlan_adapter *adapter = priv->adapter; - struct wlan_ioctl_regrdwr *pbuf; - pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; + lbs_adapter *adapter = priv->adapter; + struct lbs_ioctl_regrdwr *pbuf; + pbuf = (struct lbs_ioctl_regrdwr *) adapter->prdeeprom; lbs_deb_enter_args(LBS_DEB_CMD, "len %d", le16_to_cpu(resp->params.rdeeprom.bytecount)); @@ -503,11 +503,11 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, return 0; } -static int wlan_ret_get_log(wlan_private * priv, +static int lbs_ret_get_log(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_get_log *logmessage = &resp->params.glog; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_CMD); @@ -518,11 +518,11 @@ static int wlan_ret_get_log(wlan_private * priv, return 0; } -static int libertas_ret_802_11_enable_rsn(wlan_private * priv, +static int lbs_ret_802_11_enable_rsn(lbs_private * priv, struct cmd_ds_command *resp) { struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u32 * pdata_buf = adapter->cur_cmd->pdata_buf; lbs_deb_enter(LBS_DEB_CMD); @@ -538,11 +538,11 @@ static int libertas_ret_802_11_enable_rsn(wlan_private * priv, static inline int handle_cmd_response(u16 respcmd, struct cmd_ds_command *resp, - wlan_private *priv) + lbs_private *priv) { int ret = 0; unsigned long flags; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_HOST); @@ -550,47 +550,47 @@ static inline int handle_cmd_response(u16 respcmd, case CMD_RET(CMD_MAC_REG_ACCESS): case CMD_RET(CMD_BBP_REG_ACCESS): case CMD_RET(CMD_RF_REG_ACCESS): - ret = wlan_ret_reg_access(priv, respcmd, resp); + ret = lbs_ret_reg_access(priv, respcmd, resp); break; case CMD_RET(CMD_GET_HW_SPEC): - ret = wlan_ret_get_hw_spec(priv, resp); + ret = lbs_ret_get_hw_spec(priv, resp); break; case CMD_RET(CMD_802_11_SCAN): - ret = libertas_ret_80211_scan(priv, resp); + ret = lbs_ret_80211_scan(priv, resp); break; case CMD_RET(CMD_802_11_GET_LOG): - ret = wlan_ret_get_log(priv, resp); + ret = lbs_ret_get_log(priv, resp); break; case CMD_RET_802_11_ASSOCIATE: case CMD_RET(CMD_802_11_ASSOCIATE): case CMD_RET(CMD_802_11_REASSOCIATE): - ret = libertas_ret_80211_associate(priv, resp); + ret = lbs_ret_80211_associate(priv, resp); break; case CMD_RET(CMD_802_11_DISASSOCIATE): case CMD_RET(CMD_802_11_DEAUTHENTICATE): - ret = libertas_ret_80211_disassociate(priv, resp); + ret = lbs_ret_80211_disassociate(priv, resp); break; case CMD_RET(CMD_802_11_AD_HOC_START): case CMD_RET(CMD_802_11_AD_HOC_JOIN): - ret = libertas_ret_80211_ad_hoc_start(priv, resp); + ret = lbs_ret_80211_ad_hoc_start(priv, resp); break; case CMD_RET(CMD_802_11_GET_STAT): - ret = wlan_ret_802_11_stat(priv, resp); + ret = lbs_ret_802_11_stat(priv, resp); break; case CMD_RET(CMD_802_11_SNMP_MIB): - ret = wlan_ret_802_11_snmp_mib(priv, resp); + ret = lbs_ret_802_11_snmp_mib(priv, resp); break; case CMD_RET(CMD_802_11_RF_TX_POWER): - ret = wlan_ret_802_11_rf_tx_power(priv, resp); + ret = lbs_ret_802_11_rf_tx_power(priv, resp); break; case CMD_RET(CMD_802_11_SET_AFC): @@ -612,45 +612,45 @@ static inline int handle_cmd_response(u16 respcmd, break; case CMD_RET(CMD_802_11_ENABLE_RSN): - ret = libertas_ret_802_11_enable_rsn(priv, resp); + ret = lbs_ret_802_11_enable_rsn(priv, resp); break; case CMD_RET(CMD_802_11_DATA_RATE): - ret = wlan_ret_802_11_data_rate(priv, resp); + ret = lbs_ret_802_11_data_rate(priv, resp); break; case CMD_RET(CMD_802_11_RATE_ADAPT_RATESET): - ret = wlan_ret_802_11_rate_adapt_rateset(priv, resp); + ret = lbs_ret_802_11_rate_adapt_rateset(priv, resp); break; case CMD_RET(CMD_802_11_RF_CHANNEL): - ret = wlan_ret_802_11_rf_channel(priv, resp); + ret = lbs_ret_802_11_rf_channel(priv, resp); break; case CMD_RET(CMD_802_11_RSSI): - ret = wlan_ret_802_11_rssi(priv, resp); + ret = lbs_ret_802_11_rssi(priv, resp); break; case CMD_RET(CMD_802_11_MAC_ADDRESS): - ret = wlan_ret_802_11_mac_address(priv, resp); + ret = lbs_ret_802_11_mac_address(priv, resp); break; case CMD_RET(CMD_802_11_AD_HOC_STOP): - ret = libertas_ret_80211_ad_hoc_stop(priv, resp); + ret = lbs_ret_80211_ad_hoc_stop(priv, resp); break; case CMD_RET(CMD_802_11_KEY_MATERIAL): - ret = wlan_ret_802_11_key_material(priv, resp); + ret = lbs_ret_802_11_key_material(priv, resp); break; case CMD_RET(CMD_802_11_EEPROM_ACCESS): - ret = wlan_ret_802_11_eeprom_access(priv, resp); + ret = lbs_ret_802_11_eeprom_access(priv, resp); break; case CMD_RET(CMD_802_11D_DOMAIN_INFO): - ret = libertas_ret_802_11d_domain_info(priv, resp); + ret = lbs_ret_802_11d_domain_info(priv, resp); break; case CMD_RET(CMD_802_11_SLEEP_PARAMS): - ret = wlan_ret_802_11_sleep_params(priv, resp); + ret = lbs_ret_802_11_sleep_params(priv, resp); break; case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT): spin_lock_irqsave(&adapter->driver_lock, flags); @@ -713,11 +713,11 @@ static inline int handle_cmd_response(u16 respcmd, return ret; } -int libertas_process_rx_command(wlan_private * priv) +int lbs_process_rx_command(lbs_private * priv) { u16 respcmd; struct cmd_ds_command *resp; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; ulong flags; u16 result; @@ -749,7 +749,7 @@ int libertas_process_rx_command(wlan_private * priv) if (!(respcmd & 0x8000)) { lbs_deb_host("invalid response!\n"); adapter->cur_cmd_retcode = -1; - __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); + __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->nr_cmd_pending--; adapter->cur_cmd = NULL; spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -774,27 +774,27 @@ int libertas_process_rx_command(wlan_private * priv) /* * We should not re-try enter-ps command in * ad-hoc mode. It takes place in - * libertas_execute_next_command(). + * lbs_execute_next_command(). */ if (adapter->mode == IW_MODE_ADHOC && action == CMD_SUBCMD_ENTER_PS) - adapter->psmode = WLAN802_11POWERMODECAM; + adapter->psmode = LBS802_11POWERMODECAM; } else if (action == CMD_SUBCMD_ENTER_PS) { adapter->needtowakeup = 0; adapter->psstate = PS_STATE_AWAKE; lbs_deb_host("CMD_RESP: ENTER_PS command response\n"); - if (adapter->connect_status != LIBERTAS_CONNECTED) { + if (adapter->connect_status != LBS_CONNECTED) { /* * When Deauth Event received before Enter_PS command * response, We need to wake up the firmware. */ lbs_deb_host( - "disconnected, invoking libertas_ps_wakeup\n"); + "disconnected, invoking lbs_ps_wakeup\n"); spin_unlock_irqrestore(&adapter->driver_lock, flags); mutex_unlock(&adapter->lock); - libertas_ps_wakeup(priv, 0); + lbs_ps_wakeup(priv, 0); mutex_lock(&adapter->lock); spin_lock_irqsave(&adapter->driver_lock, flags); } @@ -806,7 +806,7 @@ int libertas_process_rx_command(wlan_private * priv) lbs_deb_host("CMD_RESP: PS action 0x%X\n", action); } - __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); + __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->nr_cmd_pending--; adapter->cur_cmd = NULL; spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -837,7 +837,7 @@ int libertas_process_rx_command(wlan_private * priv) } - __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); + __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->nr_cmd_pending--; adapter->cur_cmd = NULL; spin_unlock_irqrestore(&adapter->driver_lock, flags); @@ -853,7 +853,7 @@ int libertas_process_rx_command(wlan_private * priv) spin_lock_irqsave(&adapter->driver_lock, flags); if (adapter->cur_cmd) { /* Clean up and Put current command back to cmdfreeq */ - __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); + __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); adapter->nr_cmd_pending--; WARN_ON(adapter->nr_cmd_pending > 128); adapter->cur_cmd = NULL; @@ -866,10 +866,10 @@ done: return ret; } -int libertas_process_event(wlan_private * priv) +int lbs_process_event(lbs_private * priv) { int ret = 0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; u32 eventcause; lbs_deb_enter(LBS_DEB_CMD); @@ -887,17 +887,17 @@ int libertas_process_event(wlan_private * priv) case MACREG_INT_CODE_DEAUTHENTICATED: lbs_deb_cmd("EVENT: deauthenticated\n"); - libertas_mac_event_disconnected(priv); + lbs_mac_event_disconnected(priv); break; case MACREG_INT_CODE_DISASSOCIATED: lbs_deb_cmd("EVENT: disassociated\n"); - libertas_mac_event_disconnected(priv); + lbs_mac_event_disconnected(priv); break; case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: lbs_deb_cmd("EVENT: link lost\n"); - libertas_mac_event_disconnected(priv); + lbs_mac_event_disconnected(priv); break; case MACREG_INT_CODE_PS_SLEEP: @@ -911,7 +911,7 @@ int libertas_process_event(wlan_private * priv) } adapter->psstate = PS_STATE_PRE_SLEEP; - libertas_ps_confirm_sleep(priv, (u16) adapter->psmode); + lbs_ps_confirm_sleep(priv, (u16) adapter->psmode); break; @@ -932,10 +932,10 @@ int libertas_process_event(wlan_private * priv) * wait for the command processing to finish * before resuming sending * adapter->needtowakeup will be set to FALSE - * in libertas_ps_wakeup() + * in lbs_ps_wakeup() */ lbs_deb_cmd("waking up ...\n"); - libertas_ps_wakeup(priv, 0); + lbs_ps_wakeup(priv, 0); } break; @@ -979,7 +979,7 @@ int libertas_process_event(wlan_private * priv) break; } lbs_pr_info("EVENT: MESH_AUTO_STARTED\n"); - adapter->connect_status = LIBERTAS_CONNECTED; + adapter->connect_status = LBS_CONNECTED; if (priv->mesh_open == 1) { netif_wake_queue(priv->mesh_dev); netif_carrier_on(priv->mesh_dev); diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index 95dd4edf64cf..1b382cfaf37a 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c @@ -11,14 +11,14 @@ #include "host.h" #include "debugfs.h" -static struct dentry *libertas_dir = NULL; +static struct dentry *lbs_dir; static char *szStates[] = { "Connected", "Disconnected" }; #ifdef PROC_DEBUG -static void libertas_debug_init(wlan_private * priv, struct net_device *dev); +static void lbs_debug_init(lbs_private * priv, struct net_device *dev); #endif static int open_file_generic(struct inode *inode, struct file *file) @@ -35,10 +35,10 @@ static ssize_t write_file_dummy(struct file *file, const char __user *buf, static const size_t len = PAGE_SIZE; -static ssize_t libertas_dev_info(struct file *file, char __user *userbuf, +static ssize_t lbs_dev_info(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; size_t pos = 0; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -56,10 +56,10 @@ static ssize_t libertas_dev_info(struct file *file, char __user *userbuf, } -static ssize_t libertas_getscantable(struct file *file, char __user *userbuf, +static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; size_t pos = 0; int numscansdone = 0, res; unsigned long addr = get_zeroed_page(GFP_KERNEL); @@ -98,11 +98,11 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf, return res; } -static ssize_t libertas_sleepparams_write(struct file *file, +static ssize_t lbs_sleepparams_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t buf_size, res; int p1, p2, p3, p4, p5, p6; unsigned long addr = get_zeroed_page(GFP_KERNEL); @@ -125,7 +125,7 @@ static ssize_t libertas_sleepparams_write(struct file *file, priv->adapter->sp.sp_extsleepclk = p5; priv->adapter->sp.sp_reserved = p6; - res = libertas_prepare_and_send_command(priv, + res = lbs_prepare_and_send_command(priv, CMD_802_11_SLEEP_PARAMS, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -140,17 +140,17 @@ out_unlock: return res; } -static ssize_t libertas_sleepparams_read(struct file *file, char __user *userbuf, +static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res; size_t pos = 0; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_prepare_and_send_command(priv, + res = lbs_prepare_and_send_command(priv, CMD_802_11_SLEEP_PARAMS, CMD_ACT_GET, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -171,10 +171,10 @@ out_unlock: return res; } -static ssize_t libertas_extscan(struct file *file, const char __user *userbuf, +static ssize_t lbs_extscan(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; union iwreq_data wrqu; unsigned long addr = get_zeroed_page(GFP_KERNEL); @@ -186,7 +186,7 @@ static ssize_t libertas_extscan(struct file *file, const char __user *userbuf, goto out_unlock; } - libertas_send_specific_ssid_scan(priv, buf, strlen(buf)-1, 0); + lbs_send_specific_ssid_scan(priv, buf, strlen(buf)-1, 0); memset(&wrqu, 0, sizeof(union iwreq_data)); wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); @@ -196,8 +196,8 @@ out_unlock: return count; } -static int libertas_parse_chan(char *buf, size_t count, - struct wlan_ioctl_user_scan_cfg *scan_cfg, int dur) +static int lbs_parse_chan(char *buf, size_t count, + struct lbs_ioctl_user_scan_cfg *scan_cfg, int dur) { char *start, *end, *hold, *str; int i = 0; @@ -233,8 +233,8 @@ static int libertas_parse_chan(char *buf, size_t count, return i; } -static void libertas_parse_bssid(char *buf, size_t count, - struct wlan_ioctl_user_scan_cfg *scan_cfg) +static void lbs_parse_bssid(char *buf, size_t count, + struct lbs_ioctl_user_scan_cfg *scan_cfg) { char *hold; unsigned int mac[ETH_ALEN]; @@ -248,8 +248,8 @@ static void libertas_parse_bssid(char *buf, size_t count, memcpy(scan_cfg->bssid, mac, ETH_ALEN); } -static void libertas_parse_ssid(char *buf, size_t count, - struct wlan_ioctl_user_scan_cfg *scan_cfg) +static void lbs_parse_ssid(char *buf, size_t count, + struct lbs_ioctl_user_scan_cfg *scan_cfg) { char *hold, *end; ssize_t size; @@ -268,7 +268,7 @@ static void libertas_parse_ssid(char *buf, size_t count, return; } -static int libertas_parse_clear(char *buf, size_t count, const char *tag) +static int lbs_parse_clear(char *buf, size_t count, const char *tag) { char *hold; int val; @@ -285,8 +285,8 @@ static int libertas_parse_clear(char *buf, size_t count, const char *tag) return val; } -static int libertas_parse_dur(char *buf, size_t count, - struct wlan_ioctl_user_scan_cfg *scan_cfg) +static int lbs_parse_dur(char *buf, size_t count, + struct lbs_ioctl_user_scan_cfg *scan_cfg) { char *hold; int val; @@ -300,8 +300,8 @@ static int libertas_parse_dur(char *buf, size_t count, return val; } -static void libertas_parse_probes(char *buf, size_t count, - struct wlan_ioctl_user_scan_cfg *scan_cfg) +static void lbs_parse_probes(char *buf, size_t count, + struct lbs_ioctl_user_scan_cfg *scan_cfg) { char *hold; int val; @@ -317,8 +317,8 @@ static void libertas_parse_probes(char *buf, size_t count, return; } -static void libertas_parse_type(char *buf, size_t count, - struct wlan_ioctl_user_scan_cfg *scan_cfg) +static void lbs_parse_type(char *buf, size_t count, + struct lbs_ioctl_user_scan_cfg *scan_cfg) { char *hold; int val; @@ -338,19 +338,19 @@ static void libertas_parse_type(char *buf, size_t count, return; } -static ssize_t libertas_setuserscan(struct file *file, +static ssize_t lbs_setuserscan(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; - struct wlan_ioctl_user_scan_cfg *scan_cfg; + struct lbs_ioctl_user_scan_cfg *scan_cfg; union iwreq_data wrqu; int dur; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - scan_cfg = kzalloc(sizeof(struct wlan_ioctl_user_scan_cfg), GFP_KERNEL); + scan_cfg = kzalloc(sizeof(struct lbs_ioctl_user_scan_cfg), GFP_KERNEL); if (!scan_cfg) return -ENOMEM; @@ -360,18 +360,18 @@ static ssize_t libertas_setuserscan(struct file *file, goto out_unlock; } - scan_cfg->bsstype = WLAN_SCAN_BSS_TYPE_ANY; + scan_cfg->bsstype = LBS_SCAN_BSS_TYPE_ANY; - dur = libertas_parse_dur(buf, count, scan_cfg); - libertas_parse_chan(buf, count, scan_cfg, dur); - libertas_parse_bssid(buf, count, scan_cfg); - scan_cfg->clear_bssid = libertas_parse_clear(buf, count, "clear_bssid="); - libertas_parse_ssid(buf, count, scan_cfg); - scan_cfg->clear_ssid = libertas_parse_clear(buf, count, "clear_ssid="); - libertas_parse_probes(buf, count, scan_cfg); - libertas_parse_type(buf, count, scan_cfg); + dur = lbs_parse_dur(buf, count, scan_cfg); + lbs_parse_chan(buf, count, scan_cfg, dur); + lbs_parse_bssid(buf, count, scan_cfg); + scan_cfg->clear_bssid = lbs_parse_clear(buf, count, "clear_bssid="); + lbs_parse_ssid(buf, count, scan_cfg); + scan_cfg->clear_ssid = lbs_parse_clear(buf, count, "clear_ssid="); + lbs_parse_probes(buf, count, scan_cfg); + lbs_parse_type(buf, count, scan_cfg); - wlan_scan_networks(priv, scan_cfg, 1); + lbs_scan_networks(priv, scan_cfg, 1); wait_event_interruptible(priv->adapter->cmd_pending, !priv->adapter->nr_cmd_pending); @@ -384,21 +384,21 @@ out_unlock: return count; } -static int libertas_event_initcmd(wlan_private *priv, void **response_buf, +static int lbs_event_initcmd(lbs_private *priv, void **response_buf, struct cmd_ctrl_node **cmdnode, struct cmd_ds_command **cmd) { u16 wait_option = CMD_OPTION_WAITFORRSP; - if (!(*cmdnode = libertas_get_free_cmd_ctrl_node(priv))) { - lbs_deb_debugfs("failed libertas_get_free_cmd_ctrl_node\n"); + if (!(*cmdnode = lbs_get_free_cmd_ctrl_node(priv))) { + lbs_deb_debugfs("failed lbs_get_free_cmd_ctrl_node\n"); return -ENOMEM; } if (!(*response_buf = kmalloc(3000, GFP_KERNEL))) { lbs_deb_debugfs("failed to allocate response buffer!\n"); return -ENOMEM; } - libertas_set_cmd_ctrl_node(priv, *cmdnode, 0, wait_option, NULL); + lbs_set_cmd_ctrl_node(priv, *cmdnode, 0, wait_option, NULL); init_waitqueue_head(&(*cmdnode)->cmdwait_q); (*cmdnode)->pdata_buf = *response_buf; (*cmdnode)->cmdflags |= CMD_F_HOSTCMD; @@ -410,11 +410,11 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf, return 0; } -static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, +static ssize_t lbs_lowrssi_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -424,7 +424,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) { free_page(addr); return res; @@ -433,7 +433,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -480,9 +480,9 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, return res; } -static u16 libertas_get_events_bitmap(wlan_private *priv) +static u16 lbs_get_events_bitmap(lbs_private *priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -490,14 +490,14 @@ static u16 libertas_get_events_bitmap(wlan_private *priv) int res; u16 event_bitmap; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) return res; event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -525,12 +525,12 @@ static u16 libertas_get_events_bitmap(wlan_private *priv) return event_bitmap; } -static ssize_t libertas_lowrssi_write(struct file *file, +static ssize_t lbs_lowrssi_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res, buf_size; int value, freq, subscribed, cmd_len; struct cmd_ctrl_node *pcmdnode; @@ -554,9 +554,9 @@ static ssize_t libertas_lowrssi_write(struct file *file, goto out_unlock; } - event_bitmap = libertas_get_events_bitmap(priv); + event_bitmap = lbs_get_events_bitmap(priv); - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) goto out_unlock; @@ -576,7 +576,7 @@ static ssize_t libertas_lowrssi_write(struct file *file, event_bitmap |= subscribed ? 0x0001 : 0x0; event->events = cpu_to_le16(event_bitmap); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -606,11 +606,11 @@ out_unlock: return res; } -static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, +static ssize_t lbs_lowsnr_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -620,7 +620,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) { free_page(addr); return res; @@ -629,7 +629,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -678,12 +678,12 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, return res; } -static ssize_t libertas_lowsnr_write(struct file *file, +static ssize_t lbs_lowsnr_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res, buf_size; int value, freq, subscribed, cmd_len; struct cmd_ctrl_node *pcmdnode; @@ -707,9 +707,9 @@ static ssize_t libertas_lowsnr_write(struct file *file, goto out_unlock; } - event_bitmap = libertas_get_events_bitmap(priv); + event_bitmap = lbs_get_events_bitmap(priv); - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) goto out_unlock; @@ -728,7 +728,7 @@ static ssize_t libertas_lowsnr_write(struct file *file, event_bitmap |= subscribed ? 0x0002 : 0x0; event->events = cpu_to_le16(event_bitmap); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -759,11 +759,11 @@ out_unlock: return res; } -static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, +static ssize_t lbs_failcount_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -773,7 +773,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) { free_page(addr); return res; @@ -782,7 +782,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -830,12 +830,12 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, return res; } -static ssize_t libertas_failcount_write(struct file *file, +static ssize_t lbs_failcount_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res, buf_size; int value, freq, subscribed, cmd_len; struct cmd_ctrl_node *pcmdnode; @@ -859,9 +859,9 @@ static ssize_t libertas_failcount_write(struct file *file, goto out_unlock; } - event_bitmap = libertas_get_events_bitmap(priv); + event_bitmap = lbs_get_events_bitmap(priv); - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) goto out_unlock; @@ -880,7 +880,7 @@ static ssize_t libertas_failcount_write(struct file *file, event_bitmap |= subscribed ? 0x0004 : 0x0; event->events = cpu_to_le16(event_bitmap); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -910,11 +910,11 @@ out_unlock: return res; } -static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, +static ssize_t lbs_bcnmiss_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -924,7 +924,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) { free_page(addr); return res; @@ -933,7 +933,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -981,12 +981,12 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, return res; } -static ssize_t libertas_bcnmiss_write(struct file *file, +static ssize_t lbs_bcnmiss_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res, buf_size; int value, freq, subscribed, cmd_len; struct cmd_ctrl_node *pcmdnode; @@ -1010,9 +1010,9 @@ static ssize_t libertas_bcnmiss_write(struct file *file, goto out_unlock; } - event_bitmap = libertas_get_events_bitmap(priv); + event_bitmap = lbs_get_events_bitmap(priv); - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) goto out_unlock; @@ -1030,7 +1030,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file, event_bitmap |= subscribed ? 0x0008 : 0x0; event->events = cpu_to_le16(event_bitmap); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -1060,11 +1060,11 @@ out_unlock: return res; } -static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, +static ssize_t lbs_highrssi_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -1074,7 +1074,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) { free_page(addr); return res; @@ -1083,7 +1083,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -1132,12 +1132,12 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, return res; } -static ssize_t libertas_highrssi_write(struct file *file, +static ssize_t lbs_highrssi_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res, buf_size; int value, freq, subscribed, cmd_len; struct cmd_ctrl_node *pcmdnode; @@ -1161,9 +1161,9 @@ static ssize_t libertas_highrssi_write(struct file *file, goto out_unlock; } - event_bitmap = libertas_get_events_bitmap(priv); + event_bitmap = lbs_get_events_bitmap(priv); - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) goto out_unlock; @@ -1182,7 +1182,7 @@ static ssize_t libertas_highrssi_write(struct file *file, event_bitmap |= subscribed ? 0x0010 : 0x0; event->events = cpu_to_le16(event_bitmap); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -1210,11 +1210,11 @@ out_unlock: return res; } -static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, +static ssize_t lbs_highsnr_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *pcmdnode; struct cmd_ds_command *pcmdptr; struct cmd_ds_802_11_subscribe_event *event; @@ -1224,7 +1224,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) { free_page(addr); return res; @@ -1233,7 +1233,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, event = &pcmdptr->params.subscribe_event; event->action = cpu_to_le16(CMD_ACT_GET); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -1282,12 +1282,12 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, return res; } -static ssize_t libertas_highsnr_write(struct file *file, +static ssize_t lbs_highsnr_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; ssize_t res, buf_size; int value, freq, subscribed, cmd_len; struct cmd_ctrl_node *pcmdnode; @@ -1311,9 +1311,9 @@ static ssize_t libertas_highsnr_write(struct file *file, goto out_unlock; } - event_bitmap = libertas_get_events_bitmap(priv); + event_bitmap = lbs_get_events_bitmap(priv); - res = libertas_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); + res = lbs_event_initcmd(priv, &response_buf, &pcmdnode, &pcmdptr); if (res < 0) goto out_unlock; @@ -1332,7 +1332,7 @@ static ssize_t libertas_highsnr_write(struct file *file, event_bitmap |= subscribed ? 0x0020 : 0x0; event->events = cpu_to_le16(event_bitmap); - libertas_queue_cmd(adapter, pcmdnode, 1); + lbs_queue_cmd(adapter, pcmdnode, 1); wake_up_interruptible(&priv->waitq); /* Sleep until response is generated by FW */ @@ -1362,12 +1362,12 @@ out_unlock: return res; } -static ssize_t libertas_rdmac_read(struct file *file, char __user *userbuf, +static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; - struct wlan_offset_value offval; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; + struct lbs_offset_value offval; ssize_t pos = 0; int ret; unsigned long addr = get_zeroed_page(GFP_KERNEL); @@ -1376,7 +1376,7 @@ static ssize_t libertas_rdmac_read(struct file *file, char __user *userbuf, offval.offset = priv->mac_offset; offval.value = 0; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_MAC_REG_ACCESS, 0, CMD_OPTION_WAITFORRSP, 0, &offval); mdelay(10); @@ -1388,11 +1388,11 @@ static ssize_t libertas_rdmac_read(struct file *file, char __user *userbuf, return ret; } -static ssize_t libertas_rdmac_write(struct file *file, +static ssize_t lbs_rdmac_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -1409,15 +1409,15 @@ out_unlock: return res; } -static ssize_t libertas_wrmac_write(struct file *file, +static ssize_t lbs_wrmac_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; u32 offset, value; - struct wlan_offset_value offval; + struct lbs_offset_value offval; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -1434,7 +1434,7 @@ static ssize_t libertas_wrmac_write(struct file *file, offval.offset = offset; offval.value = value; - res = libertas_prepare_and_send_command(priv, + res = lbs_prepare_and_send_command(priv, CMD_MAC_REG_ACCESS, 1, CMD_OPTION_WAITFORRSP, 0, &offval); mdelay(10); @@ -1445,12 +1445,12 @@ out_unlock: return res; } -static ssize_t libertas_rdbbp_read(struct file *file, char __user *userbuf, +static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; - struct wlan_offset_value offval; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; + struct lbs_offset_value offval; ssize_t pos = 0; int ret; unsigned long addr = get_zeroed_page(GFP_KERNEL); @@ -1459,7 +1459,7 @@ static ssize_t libertas_rdbbp_read(struct file *file, char __user *userbuf, offval.offset = priv->bbp_offset; offval.value = 0; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_BBP_REG_ACCESS, 0, CMD_OPTION_WAITFORRSP, 0, &offval); mdelay(10); @@ -1472,11 +1472,11 @@ static ssize_t libertas_rdbbp_read(struct file *file, char __user *userbuf, return ret; } -static ssize_t libertas_rdbbp_write(struct file *file, +static ssize_t lbs_rdbbp_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -1493,15 +1493,15 @@ out_unlock: return res; } -static ssize_t libertas_wrbbp_write(struct file *file, +static ssize_t lbs_wrbbp_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; u32 offset, value; - struct wlan_offset_value offval; + struct lbs_offset_value offval; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -1518,7 +1518,7 @@ static ssize_t libertas_wrbbp_write(struct file *file, offval.offset = offset; offval.value = value; - res = libertas_prepare_and_send_command(priv, + res = lbs_prepare_and_send_command(priv, CMD_BBP_REG_ACCESS, 1, CMD_OPTION_WAITFORRSP, 0, &offval); mdelay(10); @@ -1529,12 +1529,12 @@ out_unlock: return res; } -static ssize_t libertas_rdrf_read(struct file *file, char __user *userbuf, +static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; - wlan_adapter *adapter = priv->adapter; - struct wlan_offset_value offval; + lbs_private *priv = file->private_data; + lbs_adapter *adapter = priv->adapter; + struct lbs_offset_value offval; ssize_t pos = 0; int ret; unsigned long addr = get_zeroed_page(GFP_KERNEL); @@ -1543,7 +1543,7 @@ static ssize_t libertas_rdrf_read(struct file *file, char __user *userbuf, offval.offset = priv->rf_offset; offval.value = 0; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_RF_REG_ACCESS, 0, CMD_OPTION_WAITFORRSP, 0, &offval); mdelay(10); @@ -1556,11 +1556,11 @@ static ssize_t libertas_rdrf_read(struct file *file, char __user *userbuf, return ret; } -static ssize_t libertas_rdrf_write(struct file *file, +static ssize_t lbs_rdrf_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -1577,15 +1577,15 @@ out_unlock: return res; } -static ssize_t libertas_wrrf_write(struct file *file, +static ssize_t lbs_wrrf_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - wlan_private *priv = file->private_data; + lbs_private *priv = file->private_data; ssize_t res, buf_size; u32 offset, value; - struct wlan_offset_value offval; + struct lbs_offset_value offval; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; @@ -1602,7 +1602,7 @@ static ssize_t libertas_wrrf_write(struct file *file, offval.offset = offset; offval.value = value; - res = libertas_prepare_and_send_command(priv, + res = lbs_prepare_and_send_command(priv, CMD_RF_REG_ACCESS, 1, CMD_OPTION_WAITFORRSP, 0, &offval); mdelay(10); @@ -1620,69 +1620,69 @@ out_unlock: .write = (fwrite), \ } -struct libertas_debugfs_files { +struct lbs_debugfs_files { char *name; int perm; struct file_operations fops; }; -static struct libertas_debugfs_files debugfs_files[] = { - { "info", 0444, FOPS(libertas_dev_info, write_file_dummy), }, - { "getscantable", 0444, FOPS(libertas_getscantable, +static struct lbs_debugfs_files debugfs_files[] = { + { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), }, + { "getscantable", 0444, FOPS(lbs_getscantable, write_file_dummy), }, - { "sleepparams", 0644, FOPS(libertas_sleepparams_read, - libertas_sleepparams_write), }, - { "extscan", 0600, FOPS(NULL, libertas_extscan), }, - { "setuserscan", 0600, FOPS(NULL, libertas_setuserscan), }, + { "sleepparams", 0644, FOPS(lbs_sleepparams_read, + lbs_sleepparams_write), }, + { "extscan", 0600, FOPS(NULL, lbs_extscan), }, + { "setuserscan", 0600, FOPS(NULL, lbs_setuserscan), }, }; -static struct libertas_debugfs_files debugfs_events_files[] = { - {"low_rssi", 0644, FOPS(libertas_lowrssi_read, - libertas_lowrssi_write), }, - {"low_snr", 0644, FOPS(libertas_lowsnr_read, - libertas_lowsnr_write), }, - {"failure_count", 0644, FOPS(libertas_failcount_read, - libertas_failcount_write), }, - {"beacon_missed", 0644, FOPS(libertas_bcnmiss_read, - libertas_bcnmiss_write), }, - {"high_rssi", 0644, FOPS(libertas_highrssi_read, - libertas_highrssi_write), }, - {"high_snr", 0644, FOPS(libertas_highsnr_read, - libertas_highsnr_write), }, +static struct lbs_debugfs_files debugfs_events_files[] = { + {"low_rssi", 0644, FOPS(lbs_lowrssi_read, + lbs_lowrssi_write), }, + {"low_snr", 0644, FOPS(lbs_lowsnr_read, + lbs_lowsnr_write), }, + {"failure_count", 0644, FOPS(lbs_failcount_read, + lbs_failcount_write), }, + {"beacon_missed", 0644, FOPS(lbs_bcnmiss_read, + lbs_bcnmiss_write), }, + {"high_rssi", 0644, FOPS(lbs_highrssi_read, + lbs_highrssi_write), }, + {"high_snr", 0644, FOPS(lbs_highsnr_read, + lbs_highsnr_write), }, }; -static struct libertas_debugfs_files debugfs_regs_files[] = { - {"rdmac", 0644, FOPS(libertas_rdmac_read, libertas_rdmac_write), }, - {"wrmac", 0600, FOPS(NULL, libertas_wrmac_write), }, - {"rdbbp", 0644, FOPS(libertas_rdbbp_read, libertas_rdbbp_write), }, - {"wrbbp", 0600, FOPS(NULL, libertas_wrbbp_write), }, - {"rdrf", 0644, FOPS(libertas_rdrf_read, libertas_rdrf_write), }, - {"wrrf", 0600, FOPS(NULL, libertas_wrrf_write), }, +static struct lbs_debugfs_files debugfs_regs_files[] = { + {"rdmac", 0644, FOPS(lbs_rdmac_read, lbs_rdmac_write), }, + {"wrmac", 0600, FOPS(NULL, lbs_wrmac_write), }, + {"rdbbp", 0644, FOPS(lbs_rdbbp_read, lbs_rdbbp_write), }, + {"wrbbp", 0600, FOPS(NULL, lbs_wrbbp_write), }, + {"rdrf", 0644, FOPS(lbs_rdrf_read, lbs_rdrf_write), }, + {"wrrf", 0600, FOPS(NULL, lbs_wrrf_write), }, }; -void libertas_debugfs_init(void) +void lbs_debugfs_init(void) { - if (!libertas_dir) - libertas_dir = debugfs_create_dir("libertas_wireless", NULL); + if (!lbs_dir) + lbs_dir = debugfs_create_dir("lbs_wireless", NULL); return; } -void libertas_debugfs_remove(void) +void lbs_debugfs_remove(void) { - if (libertas_dir) - debugfs_remove(libertas_dir); + if (lbs_dir) + debugfs_remove(lbs_dir); return; } -void libertas_debugfs_init_one(wlan_private *priv, struct net_device *dev) +void lbs_debugfs_init_one(lbs_private *priv, struct net_device *dev) { int i; - struct libertas_debugfs_files *files; - if (!libertas_dir) + struct lbs_debugfs_files *files; + if (!lbs_dir) goto exit; - priv->debugfs_dir = debugfs_create_dir(dev->name, libertas_dir); + priv->debugfs_dir = debugfs_create_dir(dev->name, lbs_dir); if (!priv->debugfs_dir) goto exit; @@ -1722,13 +1722,13 @@ void libertas_debugfs_init_one(wlan_private *priv, struct net_device *dev) } #ifdef PROC_DEBUG - libertas_debug_init(priv, dev); + lbs_debug_init(priv, dev); #endif exit: return; } -void libertas_debugfs_remove_one(wlan_private *priv) +void lbs_debugfs_remove_one(lbs_private *priv) { int i; @@ -1755,8 +1755,8 @@ void libertas_debugfs_remove_one(wlan_private *priv) #ifdef PROC_DEBUG -#define item_size(n) (FIELD_SIZEOF(wlan_adapter, n)) -#define item_addr(n) (offsetof(wlan_adapter, n)) +#define item_size(n) (FIELD_SIZEOF(lbs_adapter, n)) +#define item_addr(n) (offsetof(lbs_adapter, n)) struct debug_data { @@ -1765,7 +1765,7 @@ struct debug_data { size_t addr; }; -/* To debug any member of wlan_adapter, simply add one line here. +/* To debug any member of lbs_adapter, simply add one line here. */ static struct debug_data items[] = { {"intcounter", item_size(intcounter), item_addr(intcounter)}, @@ -1786,7 +1786,7 @@ static int num_of_items = ARRAY_SIZE(items); * @param data data to output * @return number of output data */ -static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf, +static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { int val = 0; @@ -1830,7 +1830,7 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf, * @param data data to write * @return number of data */ -static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf, +static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf, size_t cnt, loff_t *ppos) { int r, i; @@ -1882,21 +1882,21 @@ static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf, return (ssize_t)cnt; } -static struct file_operations libertas_debug_fops = { +static struct file_operations lbs_debug_fops = { .owner = THIS_MODULE, .open = open_file_generic, - .write = wlan_debugfs_write, - .read = wlan_debugfs_read, + .write = lbs_debugfs_write, + .read = lbs_debugfs_read, }; /** * @brief create debug proc file * - * @param priv pointer wlan_private + * @param priv pointer lbs_private * @param dev pointer net_device * @return N/A */ -static void libertas_debug_init(wlan_private * priv, struct net_device *dev) +static void lbs_debug_init(lbs_private * priv, struct net_device *dev) { int i; @@ -1908,7 +1908,7 @@ static void libertas_debug_init(wlan_private * priv, struct net_device *dev) priv->debugfs_debug = debugfs_create_file("debug", 0644, priv->debugfs_dir, &items[0], - &libertas_debug_fops); + &lbs_debug_fops); } #endif diff --git a/drivers/net/wireless/libertas/debugfs.h b/drivers/net/wireless/libertas/debugfs.h index 880a11b95d26..c97584581980 100644 --- a/drivers/net/wireless/libertas/debugfs.h +++ b/drivers/net/wireless/libertas/debugfs.h @@ -1,6 +1,10 @@ -void libertas_debugfs_init(void); -void libertas_debugfs_remove(void); +#ifndef _LBS_DEBUGFS_H_ +#define _LBS_DEBUGFS_H_ -void libertas_debugfs_init_one(wlan_private *priv, struct net_device *dev); -void libertas_debugfs_remove_one(wlan_private *priv); +void lbs_debugfs_init(void); +void lbs_debugfs_remove(void); +void lbs_debugfs_init_one(lbs_private *priv, struct net_device *dev); +void lbs_debugfs_remove_one(lbs_private *priv); + +#endif diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h index 87fea9d5b90a..7dd76f8e8d2d 100644 --- a/drivers/net/wireless/libertas/decl.h +++ b/drivers/net/wireless/libertas/decl.h @@ -3,80 +3,80 @@ * functions defined in other source files */ -#ifndef _WLAN_DECL_H_ -#define _WLAN_DECL_H_ +#ifndef _LBS_DECL_H_ +#define _LBS_DECL_H_ #include <linux/device.h> #include "defs.h" /** Function Prototype Declaration */ -struct wlan_private; +struct lbs_private; struct sk_buff; struct net_device; -int libertas_set_mac_packet_filter(wlan_private * priv); +int lbs_set_mac_packet_filter(lbs_private * priv); -void libertas_send_tx_feedback(wlan_private * priv); +void lbs_send_tx_feedback(lbs_private * priv); -int libertas_free_cmd_buffer(wlan_private * priv); +int lbs_free_cmd_buffer(lbs_private * priv); struct cmd_ctrl_node; -struct cmd_ctrl_node *libertas_get_free_cmd_ctrl_node(wlan_private * priv); +struct cmd_ctrl_node *lbs_get_free_cmd_ctrl_node(lbs_private * priv); -void libertas_set_cmd_ctrl_node(wlan_private * priv, +void lbs_set_cmd_ctrl_node(lbs_private * priv, struct cmd_ctrl_node *ptempnode, u32 cmd_oid, u16 wait_option, void *pdata_buf); -int libertas_prepare_and_send_command(wlan_private * priv, +int lbs_prepare_and_send_command(lbs_private * priv, u16 cmd_no, u16 cmd_action, u16 wait_option, u32 cmd_oid, void *pdata_buf); -void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail); +void lbs_queue_cmd(lbs_adapter *adapter, struct cmd_ctrl_node *cmdnode, u8 addtail); -int libertas_allocate_cmd_buffer(wlan_private * priv); -int libertas_execute_next_command(wlan_private * priv); -int libertas_process_event(wlan_private * priv); -void libertas_interrupt(struct net_device *); -int libertas_set_radio_control(wlan_private * priv); -u32 libertas_fw_index_to_data_rate(u8 index); -u8 libertas_data_rate_to_fw_index(u32 rate); -void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen); +int lbs_allocate_cmd_buffer(lbs_private * priv); +int lbs_execute_next_command(lbs_private * priv); +int lbs_process_event(lbs_private * priv); +void lbs_interrupt(struct net_device *); +int lbs_set_radio_control(lbs_private * priv); +u32 lbs_fw_index_to_data_rate(u8 index); +u8 lbs_data_rate_to_fw_index(u32 rate); +void lbs_get_fwversion(lbs_adapter *adapter, char *fwversion, int maxlen); -void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb); +void lbs_upload_rx_packet(lbs_private * priv, struct sk_buff *skb); /** The proc fs interface */ -int libertas_process_rx_command(wlan_private * priv); -int libertas_process_tx(wlan_private * priv, struct sk_buff *skb); -void __libertas_cleanup_and_insert_cmd(wlan_private * priv, +int lbs_process_rx_command(lbs_private * priv); +int lbs_process_tx(lbs_private * priv, struct sk_buff *skb); +void __lbs_cleanup_and_insert_cmd(lbs_private * priv, struct cmd_ctrl_node *ptempcmd); -int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band); +int lbs_set_regiontable(lbs_private * priv, u8 region, u8 band); -int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *); +int lbs_process_rxed_packet(lbs_private * priv, struct sk_buff *); -void libertas_ps_sleep(wlan_private * priv, int wait_option); -void libertas_ps_confirm_sleep(wlan_private * priv, u16 psmode); -void libertas_ps_wakeup(wlan_private * priv, int wait_option); +void lbs_ps_sleep(lbs_private * priv, int wait_option); +void lbs_ps_confirm_sleep(lbs_private * priv, u16 psmode); +void lbs_ps_wakeup(lbs_private * priv, int wait_option); -void libertas_tx_runqueue(wlan_private *priv); +void lbs_tx_runqueue(lbs_private *priv); -struct chan_freq_power *libertas_find_cfp_by_band_and_channel( - wlan_adapter * adapter, u8 band, u16 channel); +struct chan_freq_power *lbs_find_cfp_by_band_and_channel( + lbs_adapter *adapter, u8 band, u16 channel); -void libertas_mac_event_disconnected(wlan_private * priv); +void lbs_mac_event_disconnected(lbs_private * priv); -void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str); +void lbs_send_iwevcustom_event(lbs_private *priv, s8 *str); /* main.c */ -struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, +struct chan_freq_power *lbs_get_region_cfp_table(u8 region, u8 band, int *cfp_no); -wlan_private *libertas_add_card(void *card, struct device *dmdev); -int libertas_remove_card(wlan_private *priv); -int libertas_start_card(wlan_private *priv); -int libertas_stop_card(wlan_private *priv); -int libertas_add_mesh(wlan_private *priv, struct device *dev); -void libertas_remove_mesh(wlan_private *priv); -int libertas_reset_device(wlan_private *priv); - -#endif /* _WLAN_DECL_H_ */ +lbs_private *lbs_add_card(void *card, struct device *dmdev); +int lbs_remove_card(lbs_private *priv); +int lbs_start_card(lbs_private *priv); +int lbs_stop_card(lbs_private *priv); +int lbs_add_mesh(lbs_private *priv, struct device *dev); +void lbs_remove_mesh(lbs_private *priv); +int lbs_reset_device(lbs_private *priv); + +#endif diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h index 3a0c9beefcf8..81ab99c3f49f 100644 --- a/drivers/net/wireless/libertas/defs.h +++ b/drivers/net/wireless/libertas/defs.h @@ -2,8 +2,8 @@ * This header file contains global constant/enum definitions, * global variable declaration. */ -#ifndef _WLAN_DEFS_H_ -#define _WLAN_DEFS_H_ +#ifndef _LBS_DEFS_H_ +#define _LBS_DEFS_H_ #include <linux/spinlock.h> @@ -41,11 +41,11 @@ #define LBS_DEB_HEX 0x00200000 #define LBS_DEB_SDIO 0x00400000 -extern unsigned int libertas_debug; +extern unsigned int lbs_debug; #ifdef DEBUG #define LBS_DEB_LL(grp, grpnam, fmt, args...) \ -do { if ((libertas_debug & (grp)) == (grp)) \ +do { if ((lbs_debug & (grp)) == (grp)) \ printk(KERN_DEBUG DRV_NAME grpnam "%s: " fmt, \ in_interrupt() ? " (INT)" : "", ## args); } while (0) #else @@ -96,8 +96,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in int i = 0; if (len && - (libertas_debug & LBS_DEB_HEX) && - (libertas_debug & grp)) + (lbs_debug & LBS_DEB_HEX) && + (lbs_debug & grp)) { for (i = 1; i <= len; i++) { if ((i & 0xf) == 1) { @@ -138,7 +138,7 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in #define MRVDRV_ASSOCIATION_TIME_OUT 255 #define MRVDRV_SNAP_HEADER_LEN 8 -#define WLAN_UPLD_SIZE 2312 +#define LBS_UPLD_SIZE 2312 #define DEV_NAME_LEN 32 /** Misc constants */ @@ -262,12 +262,12 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in #define UNSET_MESH_FRAME(x) (x->cb[6]=0) /** Global Variable Declaration */ -typedef struct _wlan_private wlan_private; -typedef struct _wlan_adapter wlan_adapter; -extern const char libertas_driver_version[]; -extern u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE]; +typedef struct _lbs_private lbs_private; +typedef struct _lbs_adapter lbs_adapter; +extern const char lbs_driver_version[]; +extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE]; -extern u8 libertas_bg_rates[MAX_RATES]; +extern u8 lbs_bg_rates[MAX_RATES]; /** ENUM definition*/ /** SNRNF_TYPE */ @@ -284,13 +284,13 @@ enum SNRNF_DATA { MAX_TYPE_AVG }; -/** WLAN_802_11_POWER_MODE */ -enum WLAN_802_11_POWER_MODE { - WLAN802_11POWERMODECAM, - WLAN802_11POWERMODEMAX_PSP, - WLAN802_11POWERMODEFAST_PSP, +/** LBS_802_11_POWER_MODE */ +enum LBS_802_11_POWER_MODE { + LBS802_11POWERMODECAM, + LBS802_11POWERMODEMAX_PSP, + LBS802_11POWERMODEFAST_PSP, /*not a real mode, defined as an upper bound */ - WLAN802_11POWEMODEMAX + LBS802_11POWEMODEMAX }; /** PS_STATE */ @@ -308,16 +308,16 @@ enum DNLD_STATE { DNLD_CMD_SENT }; -/** WLAN_MEDIA_STATE */ -enum WLAN_MEDIA_STATE { - LIBERTAS_CONNECTED, - LIBERTAS_DISCONNECTED +/** LBS_MEDIA_STATE */ +enum LBS_MEDIA_STATE { + LBS_CONNECTED, + LBS_DISCONNECTED }; -/** WLAN_802_11_PRIVACY_FILTER */ -enum WLAN_802_11_PRIVACY_FILTER { - WLAN802_11PRIVFILTERACCEPTALL, - WLAN802_11PRIVFILTER8021XWEP +/** LBS_802_11_PRIVACY_FILTER */ +enum LBS_802_11_PRIVACY_FILTER { + LBS802_11PRIVFILTERACCEPTALL, + LBS802_11PRIVFILTER8021XWEP }; /** mv_ms_type */ @@ -382,4 +382,4 @@ enum SNMP_MIB_VALUE_e { #define FWT_DEFAULT_SLEEPMODE 0 #define FWT_DEFAULT_SNR 0 -#endif /* _WLAN_DEFS_H_ */ +#endif diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 1fb807aa91b9..27db5d4389a7 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -1,10 +1,10 @@ /** * This file contains definitions and data structures specific * to Marvell 802.11 NIC. It contains the Device Information - * structure wlan_adapter. + * structure lbs_adapter. */ -#ifndef _WLAN_DEV_H_ -#define _WLAN_DEV_H_ +#ifndef _LBS_DEV_H_ +#define _LBS_DEV_H_ #include <linux/netdevice.h> #include <linux/wireless.h> @@ -15,7 +15,7 @@ #include "defs.h" #include "scan.h" -extern struct ethtool_ops libertas_ethtool_ops; +extern struct ethtool_ops lbs_ethtool_ops; #define MAX_BSSID_PER_CHANNEL 16 @@ -53,7 +53,7 @@ struct region_channel { struct chan_freq_power *CFP; }; -struct wlan_802_11_security { +struct lbs_802_11_security { u8 WPAenabled; u8 WPA2enabled; u8 wep_enabled; @@ -87,7 +87,7 @@ struct sleep_params { }; /* Mesh statistics */ -struct wlan_mesh_stats { +struct lbs_mesh_stats { u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */ u32 fwd_unicast_cnt; /* Fwd: Unicast counter */ u32 fwd_drop_ttl; /* Fwd: TTL zero */ @@ -99,7 +99,7 @@ struct wlan_mesh_stats { }; /** Private structure for the MV device */ -struct _wlan_private { +struct _lbs_private { int open; int mesh_open; int infra_open; @@ -109,7 +109,7 @@ struct _wlan_private { char name[DEV_NAME_LEN]; void *card; - wlan_adapter *adapter; + lbs_adapter *adapter; struct net_device *dev; struct net_device_stats stats; @@ -118,7 +118,7 @@ struct _wlan_private { struct ieee80211_device *ieee; struct iw_statistics wstats; - struct wlan_mesh_stats mstats; + struct lbs_mesh_stats mstats; struct dentry *debugfs_dir; struct dentry *debugfs_debug; struct dentry *debugfs_files[6]; @@ -136,7 +136,7 @@ struct _wlan_private { /** Upload length */ u32 upld_len; /* Upload buffer */ - u8 upld_buf[WLAN_UPLD_SIZE]; + u8 upld_buf[LBS_UPLD_SIZE]; /* Download sent: bit0 1/0=data_sent/data_tx_done, bit1 1/0=cmd_sent/cmd_tx_done, @@ -155,9 +155,9 @@ struct _wlan_private { struct work_struct sync_channel; /** Hardware access */ - int (*hw_host_to_card) (wlan_private * priv, u8 type, u8 * payload, u16 nb); - int (*hw_get_int_status) (wlan_private * priv, u8 *); - int (*hw_read_event_cause) (wlan_private *); + int (*hw_host_to_card) (lbs_private *priv, u8 type, u8 *payload, u16 nb); + int (*hw_get_int_status) (lbs_private *priv, u8 *); + int (*hw_read_event_cause) (lbs_private *); }; /** Association request @@ -194,7 +194,7 @@ struct assoc_request { struct enc_key wpa_mcast_key; struct enc_key wpa_unicast_key; - struct wlan_802_11_security secinfo; + struct lbs_802_11_security secinfo; /** WPA Information Elements*/ u8 wpa_ie[MAX_WPA_IE_LEN]; @@ -205,7 +205,7 @@ struct assoc_request { }; /** Wlan adapter data structure*/ -struct _wlan_adapter { +struct _lbs_adapter { /** STATUS variables */ u8 fwreleasenumber[4]; u32 fwcapinfo; @@ -213,7 +213,7 @@ struct _wlan_adapter { struct mutex lock; - u8 tmptxbuf[WLAN_UPLD_SIZE]; + u8 tmptxbuf[LBS_UPLD_SIZE]; /* protected by hard_start_xmit serialization */ /** command-related variables */ @@ -302,13 +302,13 @@ struct _wlan_adapter { u32 psstate; u8 needtowakeup; - struct PS_CMD_ConfirmSleep libertas_ps_confirm_sleep; + struct PS_CMD_ConfirmSleep lbs_ps_confirm_sleep; struct assoc_request * pending_assoc_req; struct assoc_request * in_progress_assoc_req; /** Encryption parameter */ - struct wlan_802_11_security secinfo; + struct lbs_802_11_security secinfo; /** WEP keys */ struct enc_key wep_keys[4]; @@ -350,7 +350,7 @@ struct _wlan_adapter { struct region_channel universal_channel[MAX_REGION_CHANNEL_NUM]; /** 11D and Domain Regulatory Data */ - struct wlan_802_11d_domain_reg domainreg; + struct lbs_802_11d_domain_reg domainreg; struct parsed_region_chan_11d parsed_region_chan; /** FSM variable for 11d support */ @@ -358,7 +358,7 @@ struct _wlan_adapter { /** MISCELLANEOUS */ u8 *prdeeprom; - struct wlan_offset_value offsetvalue; + struct lbs_offset_value offsetvalue; struct cmd_ds_802_11_get_log logmsg; @@ -368,4 +368,4 @@ struct _wlan_adapter { u8 last_scanned_channel; }; -#endif /* _WLAN_DEV_H_ */ +#endif diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c index 3dae15211b6a..8121399f4b90 100644 --- a/drivers/net/wireless/libertas/ethtool.c +++ b/drivers/net/wireless/libertas/ethtool.c @@ -19,35 +19,35 @@ static const char * mesh_stat_strings[]= { "tx_failed_cnt" }; -static void libertas_ethtool_get_drvinfo(struct net_device *dev, +static void lbs_ethtool_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - wlan_private *priv = (wlan_private *) dev->priv; + lbs_private *priv = (lbs_private *) dev->priv; char fwver[32]; - libertas_get_fwversion(priv->adapter, fwver, sizeof(fwver) - 1); + lbs_get_fwversion(priv->adapter, fwver, sizeof(fwver) - 1); strcpy(info->driver, "libertas"); - strcpy(info->version, libertas_driver_version); + strcpy(info->version, lbs_driver_version); strcpy(info->fw_version, fwver); } /* All 8388 parts have 16KiB EEPROM size at the time of writing. * In case that changes this needs fixing. */ -#define LIBERTAS_EEPROM_LEN 16384 +#define LBS_EEPROM_LEN 16384 -static int libertas_ethtool_get_eeprom_len(struct net_device *dev) +static int lbs_ethtool_get_eeprom_len(struct net_device *dev) { - return LIBERTAS_EEPROM_LEN; + return LBS_EEPROM_LEN; } -static int libertas_ethtool_get_eeprom(struct net_device *dev, +static int lbs_ethtool_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 * bytes) { - wlan_private *priv = (wlan_private *) dev->priv; - wlan_adapter *adapter = priv->adapter; - struct wlan_ioctl_regrdwr regctrl; + lbs_private *priv = (lbs_private *) dev->priv; + lbs_adapter *adapter = priv->adapter; + struct lbs_ioctl_regrdwr regctrl; char *ptr; int ret; @@ -55,7 +55,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, regctrl.offset = eeprom->offset; regctrl.NOB = eeprom->len; - if (eeprom->offset + eeprom->len > LIBERTAS_EEPROM_LEN) + if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN) return -EINVAL; // mutex_lock(&priv->mutex); @@ -70,7 +70,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, lbs_deb_ethtool("action:%d offset: %x NOB: %02x\n", regctrl.action, regctrl.offset, regctrl.NOB); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_EEPROM_ACCESS, regctrl.action, CMD_OPTION_WAITFORRSP, 0, @@ -87,7 +87,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, ptr = (char *)adapter->prdeeprom; /* skip the command header, but include the "value" u32 variable */ - ptr = ptr + sizeof(struct wlan_ioctl_regrdwr) - 4; + ptr = ptr + sizeof(struct lbs_ioctl_regrdwr) - 4; /* * Return the result back to the user @@ -105,17 +105,17 @@ done: return ret; } -static void libertas_ethtool_get_stats(struct net_device * dev, +static void lbs_ethtool_get_stats(struct net_device * dev, struct ethtool_stats * stats, u64 * data) { - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; struct cmd_ds_mesh_access mesh_access; int ret; lbs_deb_enter(LBS_DEB_ETHTOOL); /* Get Mesh Statistics */ - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS, CMD_OPTION_WAITFORRSP, 0, &mesh_access); @@ -143,7 +143,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev, lbs_deb_enter(LBS_DEB_ETHTOOL); } -static int libertas_ethtool_get_sset_count(struct net_device * dev, int sset) +static int lbs_ethtool_get_sset_count(struct net_device * dev, int sset) { switch (sset) { case ETH_SS_STATS: @@ -153,7 +153,7 @@ static int libertas_ethtool_get_sset_count(struct net_device * dev, int sset) } } -static void libertas_ethtool_get_strings (struct net_device * dev, +static void lbs_ethtool_get_strings(struct net_device *dev, u32 stringset, u8 * s) { @@ -173,12 +173,12 @@ static void libertas_ethtool_get_strings (struct net_device * dev, lbs_deb_enter(LBS_DEB_ETHTOOL); } -struct ethtool_ops libertas_ethtool_ops = { - .get_drvinfo = libertas_ethtool_get_drvinfo, - .get_eeprom = libertas_ethtool_get_eeprom, - .get_eeprom_len = libertas_ethtool_get_eeprom_len, - .get_sset_count = libertas_ethtool_get_sset_count, - .get_ethtool_stats = libertas_ethtool_get_stats, - .get_strings = libertas_ethtool_get_strings, +struct ethtool_ops lbs_ethtool_ops = { + .get_drvinfo = lbs_ethtool_get_drvinfo, + .get_eeprom = lbs_ethtool_get_eeprom, + .get_eeprom_len = lbs_ethtool_get_eeprom_len, + .get_sset_count = lbs_ethtool_get_sset_count, + .get_ethtool_stats = lbs_ethtool_get_stats, + .get_strings = lbs_ethtool_get_strings, }; diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h index b37ddbca969f..3746f702d980 100644 --- a/drivers/net/wireless/libertas/host.h +++ b/drivers/net/wireless/libertas/host.h @@ -2,8 +2,8 @@ * This file contains definitions of WLAN commands. */ -#ifndef _HOST_H_ -#define _HOST_H_ +#ifndef _LBS_HOST_H_ +#define _LBS_HOST_H_ /** PUBLIC DEFINITIONS */ #define DEFAULT_AD_HOC_CHANNEL 6 @@ -287,4 +287,4 @@ enum cmd_mesh_access_opts { #define MACREG_INT_CODE_SNR_HIGH 0x0000001d #define MACREG_INT_CODE_MESH_AUTO_STARTED 0x00000023 -#endif /* _HOST_H_ */ +#endif diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h index e1045dc02cce..6477ce0839d7 100644 --- a/drivers/net/wireless/libertas/hostcmd.h +++ b/drivers/net/wireless/libertas/hostcmd.h @@ -2,8 +2,8 @@ * This file contains the function prototypes, data structure * and defines for all the host/station commands */ -#ifndef __HOSTCMD__H -#define __HOSTCMD__H +#ifndef _LBS_HOSTCMD_H +#define _LBS_HOSTCMD_H #include <linux/wireless.h> #include "11d.h" @@ -86,13 +86,13 @@ struct cmd_ctrl_node { /* Generic structure to hold all key types. */ struct enc_key { u16 len; - u16 flags; /* KEY_INFO_* from wlan_defs.h */ - u16 type; /* KEY_TYPE_* from wlan_defs.h */ + u16 flags; /* KEY_INFO_* from defs.h */ + u16 type; /* KEY_TYPE_* from defs.h */ u8 key[32]; }; -/* wlan_offset_value */ -struct wlan_offset_value { +/* lbs_offset_value */ +struct lbs_offset_value { u32 offset; u32 value; }; diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index d383c0f9fe3e..b0b95cf2e7c9 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c @@ -57,7 +57,7 @@ MODULE_LICENSE("GPL"); struct if_cs_card { struct pcmcia_device *p_dev; - wlan_private *priv; + lbs_private *priv; void __iomem *iobase; }; @@ -263,7 +263,7 @@ static irqreturn_t if_cs_interrupt(int irq, void *data) if (!card->priv->adapter->cur_cmd) wake_up_interruptible(&card->priv->waitq); - if (card->priv->adapter->connect_status == LIBERTAS_CONNECTED) + if (card->priv->adapter->connect_status == LBS_CONNECTED) netif_wake_queue(card->priv->dev); } @@ -271,7 +271,7 @@ static irqreturn_t if_cs_interrupt(int irq, void *data) if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK); } - libertas_interrupt(card->priv->dev); + lbs_interrupt(card->priv->dev); return IRQ_HANDLED; } @@ -286,7 +286,7 @@ static irqreturn_t if_cs_interrupt(int irq, void *data) /* * Called from if_cs_host_to_card to send a command to the hardware */ -static int if_cs_send_cmd(wlan_private *priv, u8 *buf, u16 nb) +static int if_cs_send_cmd(lbs_private *priv, u8 *buf, u16 nb) { struct if_cs_card *card = (struct if_cs_card *)priv->card; int ret = -1; @@ -331,7 +331,7 @@ done: /* * Called from if_cs_host_to_card to send a data to the hardware */ -static void if_cs_send_data(wlan_private *priv, u8 *buf, u16 nb) +static void if_cs_send_data(lbs_private *priv, u8 *buf, u16 nb) { struct if_cs_card *card = (struct if_cs_card *)priv->card; @@ -354,7 +354,7 @@ static void if_cs_send_data(wlan_private *priv, u8 *buf, u16 nb) /* * Get the command result out of the card. */ -static int if_cs_receive_cmdres(wlan_private *priv, u8* data, u32 *len) +static int if_cs_receive_cmdres(lbs_private *priv, u8 *data, u32 *len) { int ret = -1; u16 val; @@ -386,7 +386,7 @@ out: } -static struct sk_buff *if_cs_receive_data(wlan_private *priv) +static struct sk_buff *if_cs_receive_data(lbs_private *priv) { struct sk_buff *skb = NULL; u16 len; @@ -616,7 +616,7 @@ done: /********************************************************************/ /* Send commands or data packets to the card */ -static int if_cs_host_to_card(wlan_private *priv, u8 type, u8 *buf, u16 nb) +static int if_cs_host_to_card(lbs_private *priv, u8 type, u8 *buf, u16 nb) { int ret = -1; @@ -641,10 +641,10 @@ static int if_cs_host_to_card(wlan_private *priv, u8 type, u8 *buf, u16 nb) } -static int if_cs_get_int_status(wlan_private *priv, u8 *ireg) +static int if_cs_get_int_status(lbs_private *priv, u8 *ireg) { struct if_cs_card *card = (struct if_cs_card *)priv->card; - //wlan_adapter *adapter = priv->adapter; + /* lbs_adapter *adapter = priv->adapter; */ int ret = 0; u16 int_cause; u8 *cmdbuf; @@ -668,7 +668,7 @@ sbi_get_int_status_exit: /* is there a data packet for us? */ if (*ireg & IF_CS_C_S_RX_UPLD_RDY) { struct sk_buff *skb = if_cs_receive_data(priv); - libertas_process_rxed_packet(priv, skb); + lbs_process_rxed_packet(priv, skb); *ireg &= ~IF_CS_C_S_RX_UPLD_RDY; } @@ -698,7 +698,7 @@ out: } -static int if_cs_read_event_cause(wlan_private *priv) +static int if_cs_read_event_cause(lbs_private *priv) { lbs_deb_enter(LBS_DEB_CS); @@ -746,7 +746,7 @@ static void if_cs_release(struct pcmcia_device *p_dev) static int if_cs_probe(struct pcmcia_device *p_dev) { int ret = -ENOMEM; - wlan_private *priv; + lbs_private *priv; struct if_cs_card *card; /* CIS parsing */ tuple_t tuple; @@ -856,7 +856,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out2; /* Make this card known to the libertas driver */ - priv = libertas_add_card(card, &p_dev->dev); + priv = lbs_add_card(card, &p_dev->dev); if (!priv) { ret = -ENOMEM; goto out2; @@ -885,7 +885,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) if_cs_enable_ints(card); /* And finally bring the card up */ - if (libertas_start_card(priv) != 0) { + if (lbs_start_card(priv) != 0) { lbs_pr_err("could not activate card\n"); goto out3; } @@ -894,7 +894,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out; out3: - libertas_remove_card(priv); + lbs_remove_card(priv); out2: ioport_unmap(card->iobase); out1: @@ -917,8 +917,8 @@ static void if_cs_detach(struct pcmcia_device *p_dev) lbs_deb_enter(LBS_DEB_CS); - libertas_stop_card(card->priv); - libertas_remove_card(card->priv); + lbs_stop_card(card->priv); + lbs_remove_card(card->priv); if_cs_disable_ints(card); if_cs_release(p_dev); kfree(card); @@ -939,7 +939,7 @@ static struct pcmcia_device_id if_cs_ids[] = { MODULE_DEVICE_TABLE(pcmcia, if_cs_ids); -static struct pcmcia_driver libertas_driver = { +static struct pcmcia_driver lbs_driver = { .owner = THIS_MODULE, .drv = { .name = DRV_NAME, @@ -955,7 +955,7 @@ static int __init if_cs_init(void) int ret; lbs_deb_enter(LBS_DEB_CS); - ret = pcmcia_register_driver(&libertas_driver); + ret = pcmcia_register_driver(&lbs_driver); lbs_deb_leave(LBS_DEB_CS); return ret; } @@ -964,7 +964,7 @@ static int __init if_cs_init(void) static void __exit if_cs_exit(void) { lbs_deb_enter(LBS_DEB_CS); - pcmcia_unregister_driver(&libertas_driver); + pcmcia_unregister_driver(&lbs_driver); lbs_deb_leave(LBS_DEB_CS); } diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 4f1efb108c28..0c762eea7a34 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c @@ -40,11 +40,11 @@ #include "dev.h" #include "if_sdio.h" -static char *libertas_helper_name = NULL; -module_param_named(helper_name, libertas_helper_name, charp, 0644); +static char *lbs_helper_name = NULL; +module_param_named(helper_name, lbs_helper_name, charp, 0644); -static char *libertas_fw_name = NULL; -module_param_named(fw_name, libertas_fw_name, charp, 0644); +static char *lbs_fw_name = NULL; +module_param_named(fw_name, lbs_fw_name, charp, 0644); static const struct sdio_device_id if_sdio_ids[] = { { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_LIBERTAS) }, @@ -82,7 +82,7 @@ struct if_sdio_packet { struct if_sdio_card { struct sdio_func *func; - wlan_private *priv; + lbs_private *priv; int model; unsigned long ioport; @@ -154,7 +154,7 @@ static int if_sdio_handle_cmd(struct if_sdio_card *card, card->int_cause |= MRVDRV_CMD_UPLD_RDY; - libertas_interrupt(card->priv->dev); + lbs_interrupt(card->priv->dev); ret = 0; @@ -194,7 +194,7 @@ static int if_sdio_handle_data(struct if_sdio_card *card, memcpy(data, buffer, size); - libertas_process_rxed_packet(card->priv, skb); + lbs_process_rxed_packet(card->priv, skb); ret = 0; @@ -236,7 +236,7 @@ static int if_sdio_handle_event(struct if_sdio_card *card, card->event = event; card->int_cause |= MRVDRV_CARDEVENT; - libertas_interrupt(card->priv->dev); + lbs_interrupt(card->priv->dev); spin_unlock_irqrestore(&card->priv->adapter->driver_lock, flags); @@ -694,7 +694,7 @@ out: /* Libertas callbacks */ /*******************************************************************/ -static int if_sdio_host_to_card(wlan_private *priv, u8 type, u8 *buf, u16 nb) +static int if_sdio_host_to_card(lbs_private *priv, u8 type, u8 *buf, u16 nb) { int ret; struct if_sdio_card *card; @@ -775,7 +775,7 @@ out: return ret; } -static int if_sdio_get_int_status(wlan_private *priv, u8 *ireg) +static int if_sdio_get_int_status(lbs_private *priv, u8 *ireg) { struct if_sdio_card *card; @@ -791,7 +791,7 @@ static int if_sdio_get_int_status(wlan_private *priv, u8 *ireg) return 0; } -static int if_sdio_read_event_cause(wlan_private *priv) +static int if_sdio_read_event_cause(lbs_private *priv) { struct if_sdio_card *card; @@ -836,7 +836,7 @@ static void if_sdio_interrupt(struct sdio_func *func) */ if (cause & IF_SDIO_H_INT_DNLD) { if ((card->priv->dnld_sent == DNLD_DATA_SENT) && - (card->priv->adapter->connect_status == LIBERTAS_CONNECTED)) + (card->priv->adapter->connect_status == LBS_CONNECTED)) netif_wake_queue(card->priv->dev); card->priv->dnld_sent = DNLD_RES_RECEIVED; } @@ -857,7 +857,7 @@ static int if_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) { struct if_sdio_card *card; - wlan_private *priv; + lbs_private *priv; int ret, i; unsigned int model; struct if_sdio_packet *packet; @@ -905,15 +905,15 @@ static int if_sdio_probe(struct sdio_func *func, card->helper = if_sdio_models[i].helper; card->firmware = if_sdio_models[i].firmware; - if (libertas_helper_name) { + if (lbs_helper_name) { lbs_deb_sdio("overriding helper firmware: %s\n", - libertas_helper_name); - card->helper = libertas_helper_name; + lbs_helper_name); + card->helper = lbs_helper_name; } - if (libertas_fw_name) { - lbs_deb_sdio("overriding firmware: %s\n", libertas_fw_name); - card->firmware = libertas_fw_name; + if (lbs_fw_name) { + lbs_deb_sdio("overriding firmware: %s\n", lbs_fw_name); + card->firmware = lbs_fw_name; } sdio_claim_host(func); @@ -951,7 +951,7 @@ static int if_sdio_probe(struct sdio_func *func, if (ret) goto reclaim; - priv = libertas_add_card(card, &func->dev); + priv = lbs_add_card(card, &func->dev); if (!priv) { ret = -ENOMEM; goto reclaim; @@ -975,7 +975,7 @@ static int if_sdio_probe(struct sdio_func *func, if (ret) goto reclaim; - ret = libertas_start_card(priv); + ret = lbs_start_card(priv); if (ret) goto err_activate_card; @@ -1020,8 +1020,8 @@ static void if_sdio_remove(struct sdio_func *func) card->priv->adapter->surpriseremoved = 1; lbs_deb_sdio("call remove card\n"); - libertas_stop_card(card->priv); - libertas_remove_card(card->priv); + lbs_stop_card(card->priv); + lbs_remove_card(card->priv); flush_scheduled_work(); diff --git a/drivers/net/wireless/libertas/if_sdio.h b/drivers/net/wireless/libertas/if_sdio.h index dfcaea7b168f..533bdfbf5d2a 100644 --- a/drivers/net/wireless/libertas/if_sdio.h +++ b/drivers/net/wireless/libertas/if_sdio.h @@ -9,8 +9,8 @@ * your option) any later version. */ -#ifndef LIBERTAS_IF_SDIO_H -#define LIBERTAS_IF_SDIO_H +#ifndef _LBS_IF_SDIO_H +#define _LBS_IF_SDIO_H #define IF_SDIO_IOPORT 0x00 diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index cb59f46ed126..797d3fbf7154 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -21,8 +21,8 @@ static const char usbdriver_name[] = "usb8xxx"; static u8 *default_fw_name = "usb8388.bin"; -static char *libertas_fw_name = NULL; -module_param_named(fw_name, libertas_fw_name, charp, 0644); +static char *lbs_fw_name; +module_param_named(fw_name, lbs_fw_name, charp, 0644); /* * We need to send a RESET command to all USB devices before @@ -45,9 +45,9 @@ MODULE_DEVICE_TABLE(usb, if_usb_table); static void if_usb_receive(struct urb *urb); static void if_usb_receive_fwload(struct urb *urb); static int if_usb_prog_firmware(struct usb_card_rec *cardp); -static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb); -static int if_usb_get_int_status(wlan_private * priv, u8 *); -static int if_usb_read_event_cause(wlan_private *); +static int if_usb_host_to_card(lbs_private *priv, u8 type, u8 *payload, u16 nb); +static int if_usb_get_int_status(lbs_private *priv, u8 *); +static int if_usb_read_event_cause(lbs_private *); static int usb_tx_block(struct usb_card_rec *cardp, u8 *payload, u16 nb); static void if_usb_free(struct usb_card_rec *cardp); static int if_usb_submit_rx_urb(struct usb_card_rec *cardp); @@ -65,7 +65,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) /* handle the transmission complete validations */ if (urb->status == 0) { - wlan_private *priv = cardp->priv; + lbs_private *priv = cardp->priv; /* lbs_deb_usbd(&urb->dev->dev, "URB status is successfull\n"); @@ -77,7 +77,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) * valid at firmware load time. */ if (priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct net_device *dev = priv->dev; priv->dnld_sent = DNLD_RES_RECEIVED; @@ -86,7 +86,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) if (!adapter->cur_cmd) wake_up_interruptible(&priv->waitq); - if ((adapter->connect_status == LIBERTAS_CONNECTED)) { + if ((adapter->connect_status == LBS_CONNECTED)) { netif_wake_queue(dev); netif_wake_queue(priv->mesh_dev); } @@ -136,7 +136,7 @@ static int if_usb_probe(struct usb_interface *intf, struct usb_device *udev; struct usb_host_interface *iface_desc; struct usb_endpoint_descriptor *endpoint; - wlan_private *priv; + lbs_private *priv; struct usb_card_rec *cardp; int i; @@ -222,12 +222,12 @@ static int if_usb_probe(struct usb_interface *intf, goto err_prog_firmware; } - if (!(priv = libertas_add_card(cardp, &udev->dev))) + if (!(priv = lbs_add_card(cardp, &udev->dev))) goto err_prog_firmware; cardp->priv = priv; - if (libertas_add_mesh(priv, &udev->dev)) + if (lbs_add_mesh(priv, &udev->dev)) goto err_add_mesh; cardp->eth_dev = priv->dev; @@ -242,7 +242,7 @@ static int if_usb_probe(struct usb_interface *intf, msleep_interruptible(200); priv->adapter->fw_ready = 1; - if (libertas_start_card(priv)) + if (lbs_start_card(priv)) goto err_start_card; list_add_tail(&cardp->list, &usb_devices); @@ -253,9 +253,9 @@ static int if_usb_probe(struct usb_interface *intf, return 0; err_start_card: - libertas_remove_mesh(priv); + lbs_remove_mesh(priv); err_add_mesh: - libertas_remove_card(priv); + lbs_remove_card(priv); err_prog_firmware: if_usb_reset_device(cardp); dealloc: @@ -273,7 +273,7 @@ error: static void if_usb_disconnect(struct usb_interface *intf) { struct usb_card_rec *cardp = usb_get_intfdata(intf); - wlan_private *priv = (wlan_private *) cardp->priv; + lbs_private *priv = (lbs_private *) cardp->priv; lbs_deb_enter(LBS_DEB_MAIN); @@ -283,12 +283,12 @@ static void if_usb_disconnect(struct usb_interface *intf) list_del(&cardp->list); if (priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; adapter->surpriseremoved = 1; - libertas_stop_card(priv); - libertas_remove_mesh(priv); - libertas_remove_card(priv); + lbs_stop_card(priv); + lbs_remove_mesh(priv); + lbs_remove_card(priv); } /* Unlink and free urb */ @@ -302,7 +302,7 @@ static void if_usb_disconnect(struct usb_interface *intf) /** * @brief This function download FW - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @return 0 */ static int if_prog_firmware(struct usb_card_rec *cardp) @@ -385,7 +385,7 @@ static int if_prog_firmware(struct usb_card_rec *cardp) static int if_usb_reset_device(struct usb_card_rec *cardp) { int ret; - wlan_private * priv = cardp->priv; + lbs_private * priv = cardp->priv; lbs_deb_enter(LBS_DEB_USB); @@ -395,7 +395,7 @@ static int if_usb_reset_device(struct usb_card_rec *cardp) ret = usb_reset_device(cardp->udev); if (!ret && priv) { msleep(10); - ret = libertas_reset_device(priv); + ret = lbs_reset_device(priv); msleep(10); } @@ -406,7 +406,7 @@ static int if_usb_reset_device(struct usb_card_rec *cardp) /** * @brief This function transfer the data to the device. - * @param priv pointer to wlan_private + * @param priv pointer to lbs_private * @param payload pointer to payload data * @param nb data length * @return 0 or -1 @@ -583,7 +583,7 @@ exit: static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, struct usb_card_rec *cardp, - wlan_private *priv) + lbs_private *priv) { if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { @@ -596,14 +596,14 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, skb_reserve(skb, IPFIELD_ALIGN_OFFSET); skb_put(skb, recvlength); skb_pull(skb, MESSAGE_HEADER_LEN); - libertas_process_rxed_packet(priv, skb); + lbs_process_rxed_packet(priv, skb); priv->upld_len = (recvlength - MESSAGE_HEADER_LEN); } static inline void process_cmdrequest(int recvlength, u8 *recvbuff, struct sk_buff *skb, struct usb_card_rec *cardp, - wlan_private *priv) + lbs_private *priv) { u8 *cmdbuf; if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { @@ -631,7 +631,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, priv->upld_len); kfree_skb(skb); - libertas_interrupt(priv->dev); + lbs_interrupt(priv->dev); spin_unlock(&priv->adapter->driver_lock); lbs_deb_usbd(&cardp->udev->dev, @@ -652,7 +652,7 @@ static void if_usb_receive(struct urb *urb) struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; struct sk_buff *skb = rinfo->skb; struct usb_card_rec *cardp = (struct usb_card_rec *) rinfo->cardp; - wlan_private * priv = cardp->priv; + lbs_private * priv = cardp->priv; int recvlength = urb->actual_length; u8 *recvbuff = NULL; @@ -695,14 +695,14 @@ static void if_usb_receive(struct urb *urb) lbs_deb_usbd(&cardp->udev->dev,"**EVENT** 0x%X\n", cardp->usb_event_cause); if (cardp->usb_event_cause & 0xffff0000) { - libertas_send_tx_feedback(priv); + lbs_send_tx_feedback(priv); spin_unlock(&priv->adapter->driver_lock); break; } cardp->usb_event_cause <<= 3; cardp->usb_int_cause |= MRVDRV_CARDEVENT; kfree_skb(skb); - libertas_interrupt(priv->dev); + lbs_interrupt(priv->dev); spin_unlock(&priv->adapter->driver_lock); goto rx_exit; default: @@ -720,13 +720,13 @@ rx_exit: /** * @brief This function downloads data to FW - * @param priv pointer to wlan_private structure + * @param priv pointer to lbs_private structure * @param type type of data * @param buf pointer to data buffer * @param len number of bytes * @return 0 or -1 */ -static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb) +static int if_usb_host_to_card(lbs_private *priv, u8 type, u8 *payload, u16 nb) { struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; @@ -753,7 +753,7 @@ static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 n } /* called with adapter->driver_lock held */ -static int if_usb_get_int_status(wlan_private * priv, u8 * ireg) +static int if_usb_get_int_status(lbs_private *priv, u8 *ireg) { struct usb_card_rec *cardp = priv->card; @@ -765,7 +765,7 @@ static int if_usb_get_int_status(wlan_private * priv, u8 * ireg) return 0; } -static int if_usb_read_event_cause(wlan_private * priv) +static int if_usb_read_event_cause(lbs_private * priv) { struct usb_card_rec *cardp = priv->card; @@ -856,10 +856,10 @@ static int if_usb_prog_firmware(struct usb_card_rec *cardp) lbs_deb_enter(LBS_DEB_USB); - if ((ret = request_firmware(&cardp->fw, libertas_fw_name, + if ((ret = request_firmware(&cardp->fw, lbs_fw_name, &cardp->udev->dev)) < 0) { lbs_pr_err("request_firmware() failed with %#x\n", ret); - lbs_pr_err("firmware %s not found\n", libertas_fw_name); + lbs_pr_err("firmware %s not found\n", lbs_fw_name); goto done; } @@ -940,7 +940,7 @@ done: static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) { struct usb_card_rec *cardp = usb_get_intfdata(intf); - wlan_private *priv = cardp->priv; + lbs_private *priv = cardp->priv; lbs_deb_enter(LBS_DEB_USB); @@ -954,7 +954,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) struct cmd_ds_mesh_access mesh_access; memset(&mesh_access, 0, sizeof(mesh_access)); mesh_access.data[0] = cpu_to_le32(1); - libertas_prepare_and_send_command(priv, + lbs_prepare_and_send_command(priv, CMD_MESH_ACCESS, CMD_ACT_MESH_SET_AUTOSTART_ENABLED, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); @@ -976,7 +976,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) static int if_usb_resume(struct usb_interface *intf) { struct usb_card_rec *cardp = usb_get_intfdata(intf); - wlan_private *priv = cardp->priv; + lbs_private *priv = cardp->priv; lbs_deb_enter(LBS_DEB_USB); @@ -994,7 +994,7 @@ static int if_usb_resume(struct usb_interface *intf) struct cmd_ds_mesh_access mesh_access; memset(&mesh_access, 0, sizeof(mesh_access)); mesh_access.data[0] = cpu_to_le32(0); - libertas_prepare_and_send_command(priv, + lbs_prepare_and_send_command(priv, CMD_MESH_ACCESS, CMD_ACT_MESH_SET_AUTOSTART_ENABLED, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); @@ -1027,8 +1027,8 @@ static int if_usb_init_module(void) lbs_deb_enter(LBS_DEB_MAIN); - if (libertas_fw_name == NULL) { - libertas_fw_name = default_fw_name; + if (lbs_fw_name == NULL) { + lbs_fw_name = default_fw_name; } ret = usb_register(&if_usb_driver); @@ -1044,7 +1044,7 @@ static void if_usb_exit_module(void) lbs_deb_enter(LBS_DEB_MAIN); list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list) { - libertas_prepare_and_send_command(cardp->priv, CMD_802_11_RESET, + lbs_prepare_and_send_command(cardp->priv, CMD_802_11_RESET, CMD_ACT_HALT, 0, 0, NULL); } diff --git a/drivers/net/wireless/libertas/if_usb.h b/drivers/net/wireless/libertas/if_usb.h index e07a10ed28b5..9b4230864c43 100644 --- a/drivers/net/wireless/libertas/if_usb.h +++ b/drivers/net/wireless/libertas/if_usb.h @@ -1,5 +1,5 @@ -#ifndef _LIBERTAS_IF_USB_H -#define _LIBERTAS_IF_USB_H +#ifndef _LBS_IF_USB_H +#define _LBS_IF_USB_H #include <linux/list.h> diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c index dc24a05c9447..90c25f478123 100644 --- a/drivers/net/wireless/libertas/join.c +++ b/drivers/net/wireless/libertas/join.c @@ -30,16 +30,16 @@ * NOTE: Setting the MSB of the basic rates need to be taken * care, either before or after calling this function * - * @param adapter A pointer to wlan_adapter structure + * @param adapter A pointer to lbs_adapter structure * @param rate1 the buffer which keeps input and output * @param rate1_size the size of rate1 buffer; new size of buffer on return * * @return 0 or -1 */ -static int get_common_rates(wlan_adapter * adapter, u8 * rates, u16 *rates_size) +static int get_common_rates(lbs_adapter *adapter, u8 *rates, u16 *rates_size) { - u8 *card_rates = libertas_bg_rates; - size_t num_card_rates = sizeof(libertas_bg_rates); + u8 *card_rates = lbs_bg_rates; + size_t num_card_rates = sizeof(lbs_bg_rates); int ret = 0, i, j; u8 tmp[30]; size_t tmp_size = 0; @@ -85,7 +85,7 @@ done: * @param rates buffer of data rates * @param len size of buffer */ -static void libertas_set_basic_rate_flags(u8 * rates, size_t len) +static void lbs_set_basic_rate_flags(u8 *rates, size_t len) { int i; @@ -104,7 +104,7 @@ static void libertas_set_basic_rate_flags(u8 * rates, size_t len) * @param rates buffer of data rates * @param len size of buffer */ -void libertas_unset_basic_rate_flags(u8 * rates, size_t len) +void lbs_unset_basic_rate_flags(u8 *rates, size_t len) { int i; @@ -116,19 +116,19 @@ void libertas_unset_basic_rate_flags(u8 * rates, size_t len) /** * @brief Associate to a specific BSS discovered in a scan * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param pbssdesc Pointer to the BSS descriptor to associate with. * * @return 0-success, otherwise fail */ -int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) +int lbs_associate(lbs_private *priv, struct assoc_request *assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret; lbs_deb_enter(LBS_DEB_JOIN); - ret = libertas_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE, 0, CMD_OPTION_WAITFORRSP, 0, assoc_req->bss.bssid); @@ -142,9 +142,9 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) else adapter->preamble = CMD_TYPE_LONG_PREAMBLE; - libertas_set_radio_control(priv); + lbs_set_radio_control(priv); - ret = libertas_prepare_and_send_command(priv, CMD_802_11_ASSOCIATE, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_ASSOCIATE, 0, CMD_OPTION_WAITFORRSP, 0, assoc_req); done: @@ -155,13 +155,13 @@ done: /** * @brief Start an Adhoc Network * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param adhocssid The ssid of the Adhoc Network * @return 0--success, -1--fail */ -int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * assoc_req) +int lbs_start_adhoc_network(lbs_private *priv, struct assoc_request *assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; adapter->adhoccreate = 1; @@ -174,12 +174,12 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass adapter->preamble = CMD_TYPE_LONG_PREAMBLE; } - libertas_set_radio_control(priv); + lbs_set_radio_control(priv); lbs_deb_join("AdhocStart: channel = %d\n", assoc_req->channel); lbs_deb_join("AdhocStart: band = %d\n", assoc_req->band); - ret = libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_START, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_AD_HOC_START, 0, CMD_OPTION_WAITFORRSP, 0, assoc_req); return ret; @@ -188,15 +188,15 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass /** * @brief Join an adhoc network found in a previous scan * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param pbssdesc Pointer to a BSS descriptor found in a previous scan * to attempt to join * * @return 0--success, -1--fail */ -int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * assoc_req) +int lbs_join_adhoc_network(lbs_private *priv, struct assoc_request *assoc_req) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct bss_descriptor * bss = &assoc_req->bss; int ret = 0; @@ -211,11 +211,11 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso /* check if the requested SSID is already joined */ if ( adapter->curbssparams.ssid_len - && !libertas_ssid_cmp(adapter->curbssparams.ssid, + && !lbs_ssid_cmp(adapter->curbssparams.ssid, adapter->curbssparams.ssid_len, bss->ssid, bss->ssid_len) && (adapter->mode == IW_MODE_ADHOC) - && (adapter->connect_status == LIBERTAS_CONNECTED)) { + && (adapter->connect_status == LBS_CONNECTED)) { union iwreq_data wrqu; lbs_deb_join("ADHOC_J_CMD: New ad-hoc SSID is the same as " @@ -243,14 +243,14 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso adapter->preamble = CMD_TYPE_SHORT_PREAMBLE; } - libertas_set_radio_control(priv); + lbs_set_radio_control(priv); lbs_deb_join("AdhocJoin: channel = %d\n", assoc_req->channel); lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band); adapter->adhoccreate = 0; - ret = libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_JOIN, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_AD_HOC_JOIN, 0, CMD_OPTION_WAITFORRSP, OID_802_11_SSID, assoc_req); @@ -258,38 +258,38 @@ out: return ret; } -int libertas_stop_adhoc_network(wlan_private * priv) +int lbs_stop_adhoc_network(lbs_private * priv) { - return libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_STOP, + return lbs_prepare_and_send_command(priv, CMD_802_11_AD_HOC_STOP, 0, CMD_OPTION_WAITFORRSP, 0, NULL); } /** * @brief Send Deauthentication Request * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return 0--success, -1--fail */ -int libertas_send_deauthentication(wlan_private * priv) +int lbs_send_deauthentication(lbs_private *priv) { - return libertas_prepare_and_send_command(priv, CMD_802_11_DEAUTHENTICATE, + return lbs_prepare_and_send_command(priv, CMD_802_11_DEAUTHENTICATE, 0, CMD_OPTION_WAITFORRSP, 0, NULL); } /** * @brief This function prepares command of authenticate. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param cmd A pointer to cmd_ds_command structure * @param pdata_buf Void cast of pointer to a BSSID to authenticate with * * @return 0 or -1 */ -int libertas_cmd_80211_authenticate(wlan_private * priv, +int lbs_cmd_80211_authenticate(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth; int ret = -1; u8 *bssid = pdata_buf; @@ -329,10 +329,10 @@ out: return ret; } -int libertas_cmd_80211_deauthenticate(wlan_private * priv, +int lbs_cmd_80211_deauthenticate(lbs_private *priv, struct cmd_ds_command *cmd) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_deauthenticate *dauth = &cmd->params.deauth; lbs_deb_enter(LBS_DEB_JOIN); @@ -352,10 +352,10 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv, return 0; } -int libertas_cmd_80211_associate(wlan_private * priv, +int lbs_cmd_80211_associate(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_associate *passo = &cmd->params.associate; int ret = 0; struct assoc_request * assoc_req = pdata_buf; @@ -431,7 +431,7 @@ int libertas_cmd_80211_associate(wlan_private * priv, /* Set MSB on basic rates as the firmware requires, but _after_ * copying to current bss rates. */ - libertas_set_basic_rate_flags(rates->rates, tmplen); + lbs_set_basic_rate_flags(rates->rates, tmplen); if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { rsn = (struct mrvlietypes_rsnparamset *) pos; @@ -448,7 +448,7 @@ int libertas_cmd_80211_associate(wlan_private * priv, /* update curbssparams */ adapter->curbssparams.channel = bss->phyparamset.dsparamset.currentchan; - if (libertas_parse_dnld_countryinfo_11d(priv, bss)) { + if (lbs_parse_dnld_countryinfo_11d(priv, bss)) { ret = -1; goto done; } @@ -468,10 +468,10 @@ done: return ret; } -int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, +int lbs_cmd_80211_ad_hoc_start(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_ad_hoc_start *adhs = &cmd->params.ads; int ret = 0; int cmdappendsize = 0; @@ -548,8 +548,8 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, adhs->probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME); memset(adhs->rates, 0, sizeof(adhs->rates)); - ratesize = min(sizeof(adhs->rates), sizeof(libertas_bg_rates)); - memcpy(adhs->rates, libertas_bg_rates, ratesize); + ratesize = min(sizeof(adhs->rates), sizeof(lbs_bg_rates)); + memcpy(adhs->rates, lbs_bg_rates, ratesize); /* Copy the ad-hoc creating rates into Current BSS state structure */ memset(&adapter->curbssparams.rates, 0, sizeof(adapter->curbssparams.rates)); @@ -558,14 +558,14 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, /* Set MSB on basic rates as the firmware requires, but _after_ * copying to current bss rates. */ - libertas_set_basic_rate_flags(adhs->rates, ratesize); + lbs_set_basic_rate_flags(adhs->rates, ratesize); lbs_deb_join("ADHOC_S_CMD: rates=%02x %02x %02x %02x \n", adhs->rates[0], adhs->rates[1], adhs->rates[2], adhs->rates[3]); lbs_deb_join("ADHOC_S_CMD: AD HOC Start command is ready\n"); - if (libertas_create_dnld_countryinfo_11d(priv)) { + if (lbs_create_dnld_countryinfo_11d(priv)) { lbs_deb_join("ADHOC_S_CMD: dnld_countryinfo_11d failed\n"); ret = -1; goto done; @@ -580,7 +580,7 @@ done: return ret; } -int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv, +int lbs_cmd_80211_ad_hoc_stop(lbs_private *priv, struct cmd_ds_command *cmd) { cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_STOP); @@ -589,10 +589,10 @@ int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv, return 0; } -int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, +int lbs_cmd_80211_ad_hoc_join(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_ad_hoc_join *join_cmd = &cmd->params.adj; struct assoc_request * assoc_req = pdata_buf; struct bss_descriptor *bss = &assoc_req->bss; @@ -652,7 +652,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, /* Set MSB on basic rates as the firmware requires, but _after_ * copying to current bss rates. */ - libertas_set_basic_rate_flags(join_cmd->bss.rates, ratesize); + lbs_set_basic_rate_flags(join_cmd->bss.rates, ratesize); join_cmd->bss.ssparamset.ibssparamset.atimwindow = cpu_to_le16(bss->atimwindow); @@ -663,12 +663,12 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, join_cmd->bss.capability = cpu_to_le16(tmp); } - if (adapter->psmode == WLAN802_11POWERMODEMAX_PSP) { + if (adapter->psmode == LBS802_11POWERMODEMAX_PSP) { /* wake up first */ __le32 Localpsmode; - Localpsmode = cpu_to_le32(WLAN802_11POWERMODECAM); - ret = libertas_prepare_and_send_command(priv, + Localpsmode = cpu_to_le32(LBS802_11POWERMODECAM); + ret = lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE, CMD_ACT_SET, 0, 0, &Localpsmode); @@ -679,7 +679,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, } } - if (libertas_parse_dnld_countryinfo_11d(priv, bss)) { + if (lbs_parse_dnld_countryinfo_11d(priv, bss)) { ret = -1; goto done; } @@ -692,10 +692,10 @@ done: return ret; } -int libertas_ret_80211_associate(wlan_private * priv, +int lbs_ret_80211_associate(lbs_private *priv, struct cmd_ds_command *resp) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; union iwreq_data wrqu; struct ieeetypes_assocrsp *passocrsp; @@ -762,7 +762,7 @@ int libertas_ret_80211_associate(wlan_private * priv, } if (status_code) { - libertas_mac_event_disconnected(priv); + lbs_mac_event_disconnected(priv); ret = -1; goto done; } @@ -771,7 +771,7 @@ int libertas_ret_80211_associate(wlan_private * priv, le16_to_cpu(resp->size) - S_DS_GEN); /* Send a Media Connected event, according to the Spec */ - adapter->connect_status = LIBERTAS_CONNECTED; + adapter->connect_status = LBS_CONNECTED; lbs_deb_join("ASSOC_RESP: assocated to '%s'\n", escape_essid(bss->ssid, bss->ssid_len)); @@ -809,21 +809,21 @@ done: return ret; } -int libertas_ret_80211_disassociate(wlan_private * priv, +int lbs_ret_80211_disassociate(lbs_private *priv, struct cmd_ds_command *resp) { lbs_deb_enter(LBS_DEB_JOIN); - libertas_mac_event_disconnected(priv); + lbs_mac_event_disconnected(priv); lbs_deb_leave(LBS_DEB_JOIN); return 0; } -int libertas_ret_80211_ad_hoc_start(wlan_private * priv, +int lbs_ret_80211_ad_hoc_start(lbs_private *priv, struct cmd_ds_command *resp) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; u16 command = le16_to_cpu(resp->command); u16 result = le16_to_cpu(resp->result); @@ -852,8 +852,8 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, */ if (result) { lbs_deb_join("ADHOC_RESP: failed\n"); - if (adapter->connect_status == LIBERTAS_CONNECTED) { - libertas_mac_event_disconnected(priv); + if (adapter->connect_status == LBS_CONNECTED) { + lbs_mac_event_disconnected(priv); } ret = -1; goto done; @@ -867,7 +867,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, escape_essid(bss->ssid, bss->ssid_len)); /* Send a Media Connected event, according to the Spec */ - adapter->connect_status = LIBERTAS_CONNECTED; + adapter->connect_status = LBS_CONNECTED; if (command == CMD_RET(CMD_802_11_AD_HOC_START)) { /* Update the created network descriptor with the new BSSID */ @@ -904,12 +904,12 @@ done: return ret; } -int libertas_ret_80211_ad_hoc_stop(wlan_private * priv, +int lbs_ret_80211_ad_hoc_stop(lbs_private *priv, struct cmd_ds_command *resp) { lbs_deb_enter(LBS_DEB_JOIN); - libertas_mac_event_disconnected(priv); + lbs_mac_event_disconnected(priv); lbs_deb_leave(LBS_DEB_JOIN); return 0; diff --git a/drivers/net/wireless/libertas/join.h b/drivers/net/wireless/libertas/join.h index 894a072b9f8d..5c2b2df5e577 100644 --- a/drivers/net/wireless/libertas/join.h +++ b/drivers/net/wireless/libertas/join.h @@ -2,52 +2,52 @@ * Interface for the wlan infrastructure and adhoc join routines * * Driver interface functions and type declarations for the join module - * implemented in wlan_join.c. Process all start/join requests for + * implemented in join.c. Process all start/join requests for * both adhoc and infrastructure networks */ -#ifndef _WLAN_JOIN_H -#define _WLAN_JOIN_H +#ifndef _LBS_JOIN_H +#define _LBS_JOIN_H #include "defs.h" #include "dev.h" struct cmd_ds_command; -int libertas_cmd_80211_authenticate(wlan_private * priv, +int lbs_cmd_80211_authenticate(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf); -int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, +int lbs_cmd_80211_ad_hoc_join(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf); -int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv, +int lbs_cmd_80211_ad_hoc_stop(lbs_private *priv, struct cmd_ds_command *cmd); -int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, +int lbs_cmd_80211_ad_hoc_start(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf); -int libertas_cmd_80211_deauthenticate(wlan_private * priv, +int lbs_cmd_80211_deauthenticate(lbs_private *priv, struct cmd_ds_command *cmd); -int libertas_cmd_80211_associate(wlan_private * priv, +int lbs_cmd_80211_associate(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf); -int libertas_ret_80211_ad_hoc_start(wlan_private * priv, +int lbs_ret_80211_ad_hoc_start(lbs_private *priv, struct cmd_ds_command *resp); -int libertas_ret_80211_ad_hoc_stop(wlan_private * priv, +int lbs_ret_80211_ad_hoc_stop(lbs_private *priv, struct cmd_ds_command *resp); -int libertas_ret_80211_disassociate(wlan_private * priv, +int lbs_ret_80211_disassociate(lbs_private *priv, struct cmd_ds_command *resp); -int libertas_ret_80211_associate(wlan_private * priv, +int lbs_ret_80211_associate(lbs_private *priv, struct cmd_ds_command *resp); -int libertas_start_adhoc_network(wlan_private * priv, +int lbs_start_adhoc_network(lbs_private *priv, struct assoc_request * assoc_req); -int libertas_join_adhoc_network(wlan_private * priv, +int lbs_join_adhoc_network(lbs_private *priv, struct assoc_request * assoc_req); -int libertas_stop_adhoc_network(wlan_private * priv); +int lbs_stop_adhoc_network(lbs_private *priv); -int libertas_send_deauthentication(wlan_private * priv); +int lbs_send_deauthentication(lbs_private *priv); -int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req); +int lbs_associate(lbs_private *priv, struct assoc_request *assoc_req); -void libertas_unset_basic_rate_flags(u8 * rates, size_t len); +void lbs_unset_basic_rate_flags(u8 *rates, size_t len); #endif diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 1823b48a8ba7..825970af3419 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c @@ -24,7 +24,7 @@ #include "join.h" #define DRIVER_RELEASE_VERSION "323.p0" -const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION +const char lbs_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION #ifdef DEBUG "-dbg" #endif @@ -32,80 +32,80 @@ const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION /* Module parameters */ -unsigned int libertas_debug = 0; -module_param(libertas_debug, int, 0644); -EXPORT_SYMBOL_GPL(libertas_debug); +unsigned int lbs_debug; +EXPORT_SYMBOL_GPL(lbs_debug); +module_param_named(libertas_debug, lbs_debug, int, 0644); -#define WLAN_TX_PWR_DEFAULT 20 /*100mW */ -#define WLAN_TX_PWR_US_DEFAULT 20 /*100mW */ -#define WLAN_TX_PWR_JP_DEFAULT 16 /*50mW */ -#define WLAN_TX_PWR_FR_DEFAULT 20 /*100mW */ -#define WLAN_TX_PWR_EMEA_DEFAULT 20 /*100mW */ +#define LBS_TX_PWR_DEFAULT 20 /*100mW */ +#define LBS_TX_PWR_US_DEFAULT 20 /*100mW */ +#define LBS_TX_PWR_JP_DEFAULT 16 /*50mW */ +#define LBS_TX_PWR_FR_DEFAULT 20 /*100mW */ +#define LBS_TX_PWR_EMEA_DEFAULT 20 /*100mW */ /* Format { channel, frequency (MHz), maxtxpower } */ /* band: 'B/G', region: USA FCC/Canada IC */ static struct chan_freq_power channel_freq_power_US_BG[] = { - {1, 2412, WLAN_TX_PWR_US_DEFAULT}, - {2, 2417, WLAN_TX_PWR_US_DEFAULT}, - {3, 2422, WLAN_TX_PWR_US_DEFAULT}, - {4, 2427, WLAN_TX_PWR_US_DEFAULT}, - {5, 2432, WLAN_TX_PWR_US_DEFAULT}, - {6, 2437, WLAN_TX_PWR_US_DEFAULT}, - {7, 2442, WLAN_TX_PWR_US_DEFAULT}, - {8, 2447, WLAN_TX_PWR_US_DEFAULT}, - {9, 2452, WLAN_TX_PWR_US_DEFAULT}, - {10, 2457, WLAN_TX_PWR_US_DEFAULT}, - {11, 2462, WLAN_TX_PWR_US_DEFAULT} + {1, 2412, LBS_TX_PWR_US_DEFAULT}, + {2, 2417, LBS_TX_PWR_US_DEFAULT}, + {3, 2422, LBS_TX_PWR_US_DEFAULT}, + {4, 2427, LBS_TX_PWR_US_DEFAULT}, + {5, 2432, LBS_TX_PWR_US_DEFAULT}, + {6, 2437, LBS_TX_PWR_US_DEFAULT}, + {7, 2442, LBS_TX_PWR_US_DEFAULT}, + {8, 2447, LBS_TX_PWR_US_DEFAULT}, + {9, 2452, LBS_TX_PWR_US_DEFAULT}, + {10, 2457, LBS_TX_PWR_US_DEFAULT}, + {11, 2462, LBS_TX_PWR_US_DEFAULT} }; /* band: 'B/G', region: Europe ETSI */ static struct chan_freq_power channel_freq_power_EU_BG[] = { - {1, 2412, WLAN_TX_PWR_EMEA_DEFAULT}, - {2, 2417, WLAN_TX_PWR_EMEA_DEFAULT}, - {3, 2422, WLAN_TX_PWR_EMEA_DEFAULT}, - {4, 2427, WLAN_TX_PWR_EMEA_DEFAULT}, - {5, 2432, WLAN_TX_PWR_EMEA_DEFAULT}, - {6, 2437, WLAN_TX_PWR_EMEA_DEFAULT}, - {7, 2442, WLAN_TX_PWR_EMEA_DEFAULT}, - {8, 2447, WLAN_TX_PWR_EMEA_DEFAULT}, - {9, 2452, WLAN_TX_PWR_EMEA_DEFAULT}, - {10, 2457, WLAN_TX_PWR_EMEA_DEFAULT}, - {11, 2462, WLAN_TX_PWR_EMEA_DEFAULT}, - {12, 2467, WLAN_TX_PWR_EMEA_DEFAULT}, - {13, 2472, WLAN_TX_PWR_EMEA_DEFAULT} + {1, 2412, LBS_TX_PWR_EMEA_DEFAULT}, + {2, 2417, LBS_TX_PWR_EMEA_DEFAULT}, + {3, 2422, LBS_TX_PWR_EMEA_DEFAULT}, + {4, 2427, LBS_TX_PWR_EMEA_DEFAULT}, + {5, 2432, LBS_TX_PWR_EMEA_DEFAULT}, + {6, 2437, LBS_TX_PWR_EMEA_DEFAULT}, + {7, 2442, LBS_TX_PWR_EMEA_DEFAULT}, + {8, 2447, LBS_TX_PWR_EMEA_DEFAULT}, + {9, 2452, LBS_TX_PWR_EMEA_DEFAULT}, + {10, 2457, LBS_TX_PWR_EMEA_DEFAULT}, + {11, 2462, LBS_TX_PWR_EMEA_DEFAULT}, + {12, 2467, LBS_TX_PWR_EMEA_DEFAULT}, + {13, 2472, LBS_TX_PWR_EMEA_DEFAULT} }; /* band: 'B/G', region: Spain */ static struct chan_freq_power channel_freq_power_SPN_BG[] = { - {10, 2457, WLAN_TX_PWR_DEFAULT}, - {11, 2462, WLAN_TX_PWR_DEFAULT} + {10, 2457, LBS_TX_PWR_DEFAULT}, + {11, 2462, LBS_TX_PWR_DEFAULT} }; /* band: 'B/G', region: France */ static struct chan_freq_power channel_freq_power_FR_BG[] = { - {10, 2457, WLAN_TX_PWR_FR_DEFAULT}, - {11, 2462, WLAN_TX_PWR_FR_DEFAULT}, - {12, 2467, WLAN_TX_PWR_FR_DEFAULT}, - {13, 2472, WLAN_TX_PWR_FR_DEFAULT} + {10, 2457, LBS_TX_PWR_FR_DEFAULT}, + {11, 2462, LBS_TX_PWR_FR_DEFAULT}, + {12, 2467, LBS_TX_PWR_FR_DEFAULT}, + {13, 2472, LBS_TX_PWR_FR_DEFAULT} }; /* band: 'B/G', region: Japan */ static struct chan_freq_power channel_freq_power_JPN_BG[] = { - {1, 2412, WLAN_TX_PWR_JP_DEFAULT}, - {2, 2417, WLAN_TX_PWR_JP_DEFAULT}, - {3, 2422, WLAN_TX_PWR_JP_DEFAULT}, - {4, 2427, WLAN_TX_PWR_JP_DEFAULT}, - {5, 2432, WLAN_TX_PWR_JP_DEFAULT}, - {6, 2437, WLAN_TX_PWR_JP_DEFAULT}, - {7, 2442, WLAN_TX_PWR_JP_DEFAULT}, - {8, 2447, WLAN_TX_PWR_JP_DEFAULT}, - {9, 2452, WLAN_TX_PWR_JP_DEFAULT}, - {10, 2457, WLAN_TX_PWR_JP_DEFAULT}, - {11, 2462, WLAN_TX_PWR_JP_DEFAULT}, - {12, 2467, WLAN_TX_PWR_JP_DEFAULT}, - {13, 2472, WLAN_TX_PWR_JP_DEFAULT}, - {14, 2484, WLAN_TX_PWR_JP_DEFAULT} + {1, 2412, LBS_TX_PWR_JP_DEFAULT}, + {2, 2417, LBS_TX_PWR_JP_DEFAULT}, + {3, 2422, LBS_TX_PWR_JP_DEFAULT}, + {4, 2427, LBS_TX_PWR_JP_DEFAULT}, + {5, 2432, LBS_TX_PWR_JP_DEFAULT}, + {6, 2437, LBS_TX_PWR_JP_DEFAULT}, + {7, 2442, LBS_TX_PWR_JP_DEFAULT}, + {8, 2447, LBS_TX_PWR_JP_DEFAULT}, + {9, 2452, LBS_TX_PWR_JP_DEFAULT}, + {10, 2457, LBS_TX_PWR_JP_DEFAULT}, + {11, 2462, LBS_TX_PWR_JP_DEFAULT}, + {12, 2467, LBS_TX_PWR_JP_DEFAULT}, + {13, 2472, LBS_TX_PWR_JP_DEFAULT}, + {14, 2484, LBS_TX_PWR_JP_DEFAULT} }; /** @@ -153,13 +153,13 @@ static struct region_cfp_table region_cfp_table[] = { /** * the table to keep region code */ -u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] = +u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE] = { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 }; /** * 802.11b/g supported bitrates (in 500Kb/s units) */ -u8 libertas_bg_rates[MAX_RATES] = +u8 lbs_bg_rates[MAX_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c, 0x00, 0x00 }; @@ -179,7 +179,7 @@ static u8 fw_data_rates[MAX_RATES] = * @param idx The index of data rate * @return data rate or 0 */ -u32 libertas_fw_index_to_data_rate(u8 idx) +u32 lbs_fw_index_to_data_rate(u8 idx) { if (idx >= sizeof(fw_data_rates)) idx = 0; @@ -192,7 +192,7 @@ u32 libertas_fw_index_to_data_rate(u8 idx) * @param rate data rate * @return index or 0 */ -u8 libertas_data_rate_to_fw_index(u32 rate) +u8 lbs_data_rate_to_fw_index(u32 rate) { u8 i; @@ -213,13 +213,13 @@ u8 libertas_data_rate_to_fw_index(u32 rate) /** * @brief Get function for sysfs attribute anycast_mask */ -static ssize_t libertas_anycast_get(struct device * dev, +static ssize_t lbs_anycast_get(struct device *dev, struct device_attribute *attr, char * buf) { struct cmd_ds_mesh_access mesh_access; memset(&mesh_access, 0, sizeof(mesh_access)); - libertas_prepare_and_send_command(to_net_dev(dev)->priv, + lbs_prepare_and_send_command(to_net_dev(dev)->priv, CMD_MESH_ACCESS, CMD_ACT_MESH_GET_ANYCAST, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); @@ -230,7 +230,7 @@ static ssize_t libertas_anycast_get(struct device * dev, /** * @brief Set function for sysfs attribute anycast_mask */ -static ssize_t libertas_anycast_set(struct device * dev, +static ssize_t lbs_anycast_set(struct device *dev, struct device_attribute *attr, const char * buf, size_t count) { struct cmd_ds_mesh_access mesh_access; @@ -240,86 +240,86 @@ static ssize_t libertas_anycast_set(struct device * dev, sscanf(buf, "%x", &datum); mesh_access.data[0] = cpu_to_le32(datum); - libertas_prepare_and_send_command((to_net_dev(dev))->priv, + lbs_prepare_and_send_command((to_net_dev(dev))->priv, CMD_MESH_ACCESS, CMD_ACT_MESH_SET_ANYCAST, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); return strlen(buf); } -int libertas_add_rtap(wlan_private *priv); -void libertas_remove_rtap(wlan_private *priv); +int lbs_add_rtap(lbs_private *priv); +void lbs_remove_rtap(lbs_private *priv); /** * Get function for sysfs attribute rtap */ -static ssize_t libertas_rtap_get(struct device * dev, +static ssize_t lbs_rtap_get(struct device *dev, struct device_attribute *attr, char * buf) { - wlan_private *priv = (wlan_private *) (to_net_dev(dev))->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = (lbs_private *) (to_net_dev(dev))->priv; + lbs_adapter *adapter = priv->adapter; return snprintf(buf, 5, "0x%X\n", adapter->monitormode); } /** * Set function for sysfs attribute rtap */ -static ssize_t libertas_rtap_set(struct device * dev, +static ssize_t lbs_rtap_set(struct device *dev, struct device_attribute *attr, const char * buf, size_t count) { int monitor_mode; - wlan_private *priv = (wlan_private *) (to_net_dev(dev))->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = (lbs_private *) (to_net_dev(dev))->priv; + lbs_adapter *adapter = priv->adapter; sscanf(buf, "%x", &monitor_mode); - if (monitor_mode != WLAN_MONITOR_OFF) { + if (monitor_mode != LBS_MONITOR_OFF) { if(adapter->monitormode == monitor_mode) return strlen(buf); - if (adapter->monitormode == WLAN_MONITOR_OFF) { + if (adapter->monitormode == LBS_MONITOR_OFF) { if (adapter->mode == IW_MODE_INFRA) - libertas_send_deauthentication(priv); + lbs_send_deauthentication(priv); else if (adapter->mode == IW_MODE_ADHOC) - libertas_stop_adhoc_network(priv); - libertas_add_rtap(priv); + lbs_stop_adhoc_network(priv); + lbs_add_rtap(priv); } adapter->monitormode = monitor_mode; } else { - if(adapter->monitormode == WLAN_MONITOR_OFF) + if (adapter->monitormode == LBS_MONITOR_OFF) return strlen(buf); - adapter->monitormode = WLAN_MONITOR_OFF; - libertas_remove_rtap(priv); + adapter->monitormode = LBS_MONITOR_OFF; + lbs_remove_rtap(priv); netif_wake_queue(priv->dev); netif_wake_queue(priv->mesh_dev); } - libertas_prepare_and_send_command(priv, + lbs_prepare_and_send_command(priv, CMD_802_11_MONITOR_MODE, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, 0, &adapter->monitormode); return strlen(buf); } /** - * libertas_rtap attribute to be exported per mshX interface + * lbs_rtap attribute to be exported per mshX interface * through sysfs (/sys/class/net/mshX/libertas-rtap) */ -static DEVICE_ATTR(libertas_rtap, 0644, libertas_rtap_get, - libertas_rtap_set ); +static DEVICE_ATTR(lbs_rtap, 0644, lbs_rtap_get, + lbs_rtap_set ); /** * anycast_mask attribute to be exported per mshX interface * through sysfs (/sys/class/net/mshX/anycast_mask) */ -static DEVICE_ATTR(anycast_mask, 0644, libertas_anycast_get, libertas_anycast_set); +static DEVICE_ATTR(anycast_mask, 0644, lbs_anycast_get, lbs_anycast_set); -static ssize_t libertas_autostart_enabled_get(struct device * dev, +static ssize_t lbs_autostart_enabled_get(struct device *dev, struct device_attribute *attr, char * buf) { struct cmd_ds_mesh_access mesh_access; memset(&mesh_access, 0, sizeof(mesh_access)); - libertas_prepare_and_send_command(to_net_dev(dev)->priv, + lbs_prepare_and_send_command(to_net_dev(dev)->priv, CMD_MESH_ACCESS, CMD_ACT_MESH_GET_AUTOSTART_ENABLED, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); @@ -327,19 +327,19 @@ static ssize_t libertas_autostart_enabled_get(struct device * dev, return sprintf(buf, "%d\n", le32_to_cpu(mesh_access.data[0])); } -static ssize_t libertas_autostart_enabled_set(struct device * dev, +static ssize_t lbs_autostart_enabled_set(struct device *dev, struct device_attribute *attr, const char * buf, size_t count) { struct cmd_ds_mesh_access mesh_access; uint32_t datum; - wlan_private * priv = (to_net_dev(dev))->priv; + lbs_private *priv = (to_net_dev(dev))->priv; int ret; memset(&mesh_access, 0, sizeof(mesh_access)); sscanf(buf, "%d", &datum); mesh_access.data[0] = cpu_to_le32(datum); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_MESH_ACCESS, CMD_ACT_MESH_SET_AUTOSTART_ENABLED, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); @@ -350,16 +350,16 @@ static ssize_t libertas_autostart_enabled_set(struct device * dev, } static DEVICE_ATTR(autostart_enabled, 0644, - libertas_autostart_enabled_get, libertas_autostart_enabled_set); + lbs_autostart_enabled_get, lbs_autostart_enabled_set); -static struct attribute *libertas_mesh_sysfs_entries[] = { +static struct attribute *lbs_mesh_sysfs_entries[] = { &dev_attr_anycast_mask.attr, &dev_attr_autostart_enabled.attr, NULL, }; -static struct attribute_group libertas_mesh_attr_group = { - .attrs = libertas_mesh_sysfs_entries, +static struct attribute_group lbs_mesh_attr_group = { + .attrs = lbs_mesh_sysfs_entries, }; /** @@ -375,8 +375,8 @@ static struct attribute_group libertas_mesh_attr_group = { */ static int pre_open_check(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = (lbs_private *) dev->priv; + lbs_adapter *adapter = priv->adapter; int i = 0; while (!adapter->fw_ready && i < 20) { @@ -397,16 +397,16 @@ static int pre_open_check(struct net_device *dev) * @param dev A pointer to net_device structure * @return 0 */ -static int libertas_dev_open(struct net_device *dev) +static int lbs_dev_open(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = (lbs_private *) dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_NET); priv->open = 1; - if (adapter->connect_status == LIBERTAS_CONNECTED) { + if (adapter->connect_status == LBS_CONNECTED) { netif_carrier_on(priv->dev); if (priv->mesh_dev) netif_carrier_on(priv->mesh_dev); @@ -425,16 +425,16 @@ static int libertas_dev_open(struct net_device *dev) * @param dev A pointer to net_device structure * @return 0 */ -static int libertas_mesh_open(struct net_device *dev) +static int lbs_mesh_open(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv ; + lbs_private *priv = (lbs_private *) dev->priv ; if (pre_open_check(dev) == -1) return -1; priv->mesh_open = 1 ; netif_wake_queue(priv->mesh_dev); if (priv->infra_open == 0) - return libertas_dev_open(priv->dev) ; + return lbs_dev_open(priv->dev) ; return 0; } @@ -444,22 +444,22 @@ static int libertas_mesh_open(struct net_device *dev) * @param dev A pointer to net_device structure * @return 0 */ -static int libertas_open(struct net_device *dev) +static int lbs_open(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv ; + lbs_private *priv = (lbs_private *) dev->priv ; if(pre_open_check(dev) == -1) return -1; priv->infra_open = 1 ; netif_wake_queue(priv->dev); if (priv->open == 0) - return libertas_dev_open(priv->dev) ; + return lbs_dev_open(priv->dev) ; return 0; } -static int libertas_dev_close(struct net_device *dev) +static int lbs_dev_close(struct net_device *dev) { - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; lbs_deb_enter(LBS_DEB_NET); @@ -476,14 +476,14 @@ static int libertas_dev_close(struct net_device *dev) * @param dev A pointer to net_device structure * @return 0 */ -static int libertas_mesh_close(struct net_device *dev) +static int lbs_mesh_close(struct net_device *dev) { - wlan_private *priv = (wlan_private *) (dev->priv); + lbs_private *priv = (lbs_private *) (dev->priv); priv->mesh_open = 0; netif_stop_queue(priv->mesh_dev); if (priv->infra_open == 0) - return libertas_dev_close(dev); + return lbs_dev_close(dev); else return 0; } @@ -494,23 +494,23 @@ static int libertas_mesh_close(struct net_device *dev) * @param dev A pointer to net_device structure * @return 0 */ -static int libertas_close(struct net_device *dev) +static int lbs_close(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv; + lbs_private *priv = (lbs_private *) dev->priv; netif_stop_queue(dev); priv->infra_open = 0; if (priv->mesh_open == 0) - return libertas_dev_close(dev); + return lbs_dev_close(dev); else return 0; } -static int libertas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { int ret = 0; - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; lbs_deb_enter(LBS_DEB_NET); @@ -523,7 +523,7 @@ static int libertas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) if (priv->mesh_dev) netif_stop_queue(priv->mesh_dev); - if (libertas_process_tx(priv, skb) == 0) + if (lbs_process_tx(priv, skb) == 0) dev->trans_start = jiffies; done: lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); @@ -531,54 +531,54 @@ done: } /** - * @brief Mark mesh packets and handover them to libertas_hard_start_xmit + * @brief Mark mesh packets and handover them to lbs_hard_start_xmit * */ -static int libertas_mesh_pre_start_xmit(struct sk_buff *skb, +static int lbs_mesh_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) { - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; int ret; lbs_deb_enter(LBS_DEB_MESH); - if(priv->adapter->monitormode != WLAN_MONITOR_OFF) { + if (priv->adapter->monitormode != LBS_MONITOR_OFF) { netif_stop_queue(dev); return -EOPNOTSUPP; } SET_MESH_FRAME(skb); - ret = libertas_hard_start_xmit(skb, priv->dev); + ret = lbs_hard_start_xmit(skb, priv->dev); lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); return ret; } /** - * @brief Mark non-mesh packets and handover them to libertas_hard_start_xmit + * @brief Mark non-mesh packets and handover them to lbs_hard_start_xmit * */ -static int libertas_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int lbs_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) { - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; int ret; lbs_deb_enter(LBS_DEB_NET); - if(priv->adapter->monitormode != WLAN_MONITOR_OFF) { + if (priv->adapter->monitormode != LBS_MONITOR_OFF) { netif_stop_queue(dev); return -EOPNOTSUPP; } UNSET_MESH_FRAME(skb); - ret = libertas_hard_start_xmit(skb, dev); + ret = lbs_hard_start_xmit(skb, dev); lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); return ret; } -static void libertas_tx_timeout(struct net_device *dev) +static void lbs_tx_timeout(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv; + lbs_private *priv = (lbs_private *) dev->priv; lbs_deb_enter(LBS_DEB_TX); @@ -588,14 +588,14 @@ static void libertas_tx_timeout(struct net_device *dev) dev->trans_start = jiffies; if (priv->adapter->currenttxskb) { - if (priv->adapter->monitormode != WLAN_MONITOR_OFF) { + if (priv->adapter->monitormode != LBS_MONITOR_OFF) { /* If we are here, we have not received feedback from the previous packet. Assume TX_FAIL and move on. */ priv->adapter->eventcause = 0x01000000; - libertas_send_tx_feedback(priv); + lbs_send_tx_feedback(priv); } else wake_up_interruptible(&priv->waitq); - } else if (priv->adapter->connect_status == LIBERTAS_CONNECTED) { + } else if (priv->adapter->connect_status == LBS_CONNECTED) { netif_wake_queue(priv->dev); if (priv->mesh_dev) netif_wake_queue(priv->mesh_dev); @@ -607,21 +607,21 @@ static void libertas_tx_timeout(struct net_device *dev) /** * @brief This function returns the network statistics * - * @param dev A pointer to wlan_private structure + * @param dev A pointer to lbs_private structure * @return A pointer to net_device_stats structure */ -static struct net_device_stats *libertas_get_stats(struct net_device *dev) +static struct net_device_stats *lbs_get_stats(struct net_device *dev) { - wlan_private *priv = (wlan_private *) dev->priv; + lbs_private *priv = (lbs_private *) dev->priv; return &priv->stats; } -static int libertas_set_mac_address(struct net_device *dev, void *addr) +static int lbs_set_mac_address(struct net_device *dev, void *addr) { int ret = 0; - wlan_private *priv = (wlan_private *) dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = (lbs_private *) dev->priv; + lbs_adapter *adapter = priv->adapter; struct sockaddr *phwaddr = addr; lbs_deb_enter(LBS_DEB_NET); @@ -637,7 +637,7 @@ static int libertas_set_mac_address(struct net_device *dev, void *addr) lbs_deb_hex(LBS_DEB_NET, "addr", phwaddr->sa_data, ETH_ALEN); memcpy(adapter->current_addr, phwaddr->sa_data, ETH_ALEN); - ret = libertas_prepare_and_send_command(priv, CMD_802_11_MAC_ADDRESS, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_MAC_ADDRESS, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -657,7 +657,7 @@ done: return ret; } -static int libertas_copy_multicast_address(wlan_adapter * adapter, +static int lbs_copy_multicast_address(lbs_adapter *adapter, struct net_device *dev) { int i = 0; @@ -672,10 +672,10 @@ static int libertas_copy_multicast_address(wlan_adapter * adapter, } -static void libertas_set_multicast_list(struct net_device *dev) +static void lbs_set_multicast_list(struct net_device *dev) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int oldpacketfilter; DECLARE_MAC_BUF(mac); @@ -718,7 +718,7 @@ static void libertas_set_multicast_list(struct net_device *dev) CMD_ACT_MAC_MULTICAST_ENABLE; adapter->nr_of_multicastmacaddr = - libertas_copy_multicast_address(adapter, dev); + lbs_copy_multicast_address(adapter, dev); lbs_deb_net("multicast addresses: %d\n", dev->mc_count); @@ -729,7 +729,7 @@ static void libertas_set_multicast_list(struct net_device *dev) adapter->multicastlist[i])); } /* send multicast addresses to firmware */ - libertas_prepare_and_send_command(priv, + lbs_prepare_and_send_command(priv, CMD_MAC_MULTICAST_ADR, CMD_ACT_SET, 0, 0, NULL); @@ -738,25 +738,25 @@ static void libertas_set_multicast_list(struct net_device *dev) } if (adapter->currentpacketfilter != oldpacketfilter) { - libertas_set_mac_packet_filter(priv); + lbs_set_mac_packet_filter(priv); } lbs_deb_leave(LBS_DEB_NET); } /** - * @brief This function handles the major jobs in the WLAN driver. + * @brief This function handles the major jobs in the LBS driver. * It handles all events generated by firmware, RX data received * from firmware and TX data sent from kernel. * - * @param data A pointer to wlan_thread structure + * @param data A pointer to lbs_thread structure * @return 0 */ -static int libertas_thread(void *data) +static int lbs_thread(void *data) { struct net_device *dev = data; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; wait_queue_t wait; u8 ireg = 0; @@ -836,7 +836,7 @@ static int libertas_thread(void *data) adapter->hisregcpy &= ~MRVDRV_CMD_UPLD_RDY; spin_unlock_irq(&adapter->driver_lock); - libertas_process_rx_command(priv); + lbs_process_rx_command(priv); spin_lock_irq(&adapter->driver_lock); } @@ -853,7 +853,7 @@ static int libertas_thread(void *data) continue; } spin_unlock_irq(&adapter->driver_lock); - libertas_process_event(priv); + lbs_process_event(priv); } else spin_unlock_irq(&adapter->driver_lock); @@ -861,7 +861,7 @@ static int libertas_thread(void *data) if (adapter->psstate == PS_STATE_PRE_SLEEP) { if (!priv->dnld_sent && !adapter->cur_cmd) { if (adapter->connect_status == - LIBERTAS_CONNECTED) { + LBS_CONNECTED) { lbs_deb_thread( "main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p " "dnld_sent=%d cur_cmd=%p, confirm now\n", @@ -870,7 +870,7 @@ static int libertas_thread(void *data) priv->dnld_sent, adapter->cur_cmd); - libertas_ps_confirm_sleep(priv, + lbs_ps_confirm_sleep(priv, (u16) adapter->psmode); } else { /* workaround for firmware sending @@ -894,15 +894,15 @@ static int libertas_thread(void *data) /* Execute the next command */ if (!priv->dnld_sent && !priv->adapter->cur_cmd) - libertas_execute_next_command(priv); + lbs_execute_next_command(priv); /* Wake-up command waiters which can't sleep in - * libertas_prepare_and_send_command + * lbs_prepare_and_send_command */ if (!adapter->nr_cmd_pending) wake_up_all(&adapter->cmd_pending); - libertas_tx_runqueue(priv); + lbs_tx_runqueue(priv); } del_timer(&adapter->command_timer); @@ -918,13 +918,13 @@ static int libertas_thread(void *data) * HW spec from firmware and set basic parameters to * firmware. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return 0 or -1 */ -static int wlan_setup_firmware(wlan_private * priv) +static int lbs_setup_firmware(lbs_private *priv) { int ret = -1; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_mesh_access mesh_access; lbs_deb_enter(LBS_DEB_FW); @@ -934,7 +934,7 @@ static int wlan_setup_firmware(wlan_private * priv) */ memset(adapter->current_addr, 0xff, ETH_ALEN); - ret = libertas_prepare_and_send_command(priv, CMD_GET_HW_SPEC, + ret = lbs_prepare_and_send_command(priv, CMD_GET_HW_SPEC, 0, CMD_OPTION_WAITFORRSP, 0, NULL); if (ret) { @@ -942,10 +942,10 @@ static int wlan_setup_firmware(wlan_private * priv) goto done; } - libertas_set_mac_packet_filter(priv); + lbs_set_mac_packet_filter(priv); /* Get the supported Data rates */ - ret = libertas_prepare_and_send_command(priv, CMD_802_11_DATA_RATE, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_DATA_RATE, CMD_ACT_GET_TX_RATE, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -958,7 +958,7 @@ static int wlan_setup_firmware(wlan_private * priv) if (priv->mesh_dev) { memset(&mesh_access, 0, sizeof(mesh_access)); mesh_access.data[0] = cpu_to_le32(0); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_MESH_ACCESS, CMD_ACT_MESH_SET_AUTOSTART_ENABLED, CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); @@ -970,7 +970,7 @@ static int wlan_setup_firmware(wlan_private * priv) } /* Set the boot2 version in firmware */ - ret = libertas_prepare_and_send_command(priv, CMD_SET_BOOT2_VER, + ret = lbs_prepare_and_send_command(priv, CMD_SET_BOOT2_VER, 0, CMD_OPTION_WAITFORRSP, 0, NULL); ret = 0; @@ -985,8 +985,8 @@ done: */ static void command_timer_fn(unsigned long data) { - wlan_private *priv = (wlan_private *)data; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = (lbs_private *)data; + lbs_adapter *adapter = priv->adapter; struct cmd_ctrl_node *ptempnode; struct cmd_ds_command *cmd; unsigned long flags; @@ -1013,16 +1013,16 @@ static void command_timer_fn(unsigned long data) spin_unlock_irqrestore(&adapter->driver_lock, flags); lbs_deb_fw("re-sending same command because of timeout\n"); - libertas_queue_cmd(adapter, ptempnode, 0); + lbs_queue_cmd(adapter, ptempnode, 0); wake_up_interruptible(&priv->waitq); return; } -static int libertas_init_adapter(wlan_private * priv) +static int lbs_init_adapter(lbs_private *priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; size_t bufsize; int i, ret = 0; @@ -1043,17 +1043,17 @@ static int libertas_init_adapter(wlan_private * priv) &adapter->network_free_list); } - adapter->libertas_ps_confirm_sleep.seqnum = cpu_to_le16(++adapter->seqnum); - adapter->libertas_ps_confirm_sleep.command = + adapter->lbs_ps_confirm_sleep.seqnum = cpu_to_le16(++adapter->seqnum); + adapter->lbs_ps_confirm_sleep.command = cpu_to_le16(CMD_802_11_PS_MODE); - adapter->libertas_ps_confirm_sleep.size = + adapter->lbs_ps_confirm_sleep.size = cpu_to_le16(sizeof(struct PS_CMD_ConfirmSleep)); - adapter->libertas_ps_confirm_sleep.action = + adapter->lbs_ps_confirm_sleep.action = cpu_to_le16(CMD_SUBCMD_SLEEP_CONFIRMED); memset(adapter->current_addr, 0xff, ETH_ALEN); - adapter->connect_status = LIBERTAS_DISCONNECTED; + adapter->connect_status = LBS_DISCONNECTED; adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; adapter->mode = IW_MODE_INFRA; adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; @@ -1061,7 +1061,7 @@ static int libertas_init_adapter(wlan_private * priv) adapter->radioon = RADIO_ON; adapter->auto_rate = 1; adapter->capability = WLAN_CAPABILITY_SHORT_PREAMBLE; - adapter->psmode = WLAN802_11POWERMODECAM; + adapter->psmode = LBS802_11POWERMODECAM; adapter->psstate = PS_STATE_FULL_POWER; mutex_init(&adapter->lock); @@ -1081,7 +1081,7 @@ static int libertas_init_adapter(wlan_private * priv) adapter->nr_cmd_pending = 0; /* Allocate the command buffers */ - if (libertas_allocate_cmd_buffer(priv)) { + if (lbs_allocate_cmd_buffer(priv)) { lbs_pr_err("Out of memory allocating command buffers\n"); ret = -1; } @@ -1090,9 +1090,9 @@ out: return ret; } -static void libertas_free_adapter(wlan_private * priv) +static void lbs_free_adapter(lbs_private *priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; if (!adapter) { lbs_deb_fw("why double free adapter?\n"); @@ -1100,7 +1100,7 @@ static void libertas_free_adapter(wlan_private * priv) } lbs_deb_fw("free command buffer\n"); - libertas_free_cmd_buffer(priv); + lbs_free_cmd_buffer(priv); lbs_deb_fw("free command_timer\n"); del_timer(&adapter->command_timer); @@ -1117,32 +1117,32 @@ static void libertas_free_adapter(wlan_private * priv) /** * @brief This function adds the card. it will probe the - * card, allocate the wlan_priv and initialize the device. + * card, allocate the lbs_priv and initialize the device. * * @param card A pointer to card - * @return A pointer to wlan_private structure + * @return A pointer to lbs_private structure */ -wlan_private *libertas_add_card(void *card, struct device *dmdev) +lbs_private *lbs_add_card(void *card, struct device *dmdev) { struct net_device *dev = NULL; - wlan_private *priv = NULL; + lbs_private *priv = NULL; lbs_deb_enter(LBS_DEB_NET); /* Allocate an Ethernet device and register it */ - if (!(dev = alloc_etherdev(sizeof(wlan_private)))) { + if (!(dev = alloc_etherdev(sizeof(lbs_private)))) { lbs_pr_err("init ethX device failed\n"); goto done; } priv = dev->priv; - /* allocate buffer for wlan_adapter */ - if (!(priv->adapter = kzalloc(sizeof(wlan_adapter), GFP_KERNEL))) { - lbs_pr_err("allocate buffer for wlan_adapter failed\n"); + /* allocate buffer for lbs_adapter */ + if (!(priv->adapter = kzalloc(sizeof(lbs_adapter), GFP_KERNEL))) { + lbs_pr_err("allocate buffer for lbs_adapter failed\n"); goto err_kzalloc; } - if (libertas_init_adapter(priv)) { + if (lbs_init_adapter(priv)) { lbs_pr_err("failed to initialize adapter structure.\n"); goto err_init_adapter; } @@ -1154,46 +1154,46 @@ wlan_private *libertas_add_card(void *card, struct device *dmdev) priv->hotplug_device = dmdev; /* Setup the OS Interface to our functions */ - dev->open = libertas_open; - dev->hard_start_xmit = libertas_pre_start_xmit; - dev->stop = libertas_close; - dev->set_mac_address = libertas_set_mac_address; - dev->tx_timeout = libertas_tx_timeout; - dev->get_stats = libertas_get_stats; + dev->open = lbs_open; + dev->hard_start_xmit = lbs_pre_start_xmit; + dev->stop = lbs_close; + dev->set_mac_address = lbs_set_mac_address; + dev->tx_timeout = lbs_tx_timeout; + dev->get_stats = lbs_get_stats; dev->watchdog_timeo = 5 * HZ; - dev->ethtool_ops = &libertas_ethtool_ops; + dev->ethtool_ops = &lbs_ethtool_ops; #ifdef WIRELESS_EXT - dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def; + dev->wireless_handlers = (struct iw_handler_def *)&lbs_handler_def; #endif dev->flags |= IFF_BROADCAST | IFF_MULTICAST; - dev->set_multicast_list = libertas_set_multicast_list; + dev->set_multicast_list = lbs_set_multicast_list; SET_NETDEV_DEV(dev, dmdev); priv->rtap_net_dev = NULL; - if (device_create_file(dmdev, &dev_attr_libertas_rtap)) + if (device_create_file(dmdev, &dev_attr_lbs_rtap)) goto err_init_adapter; lbs_deb_thread("Starting main thread...\n"); init_waitqueue_head(&priv->waitq); - priv->main_thread = kthread_run(libertas_thread, dev, "libertas_main"); + priv->main_thread = kthread_run(lbs_thread, dev, "lbs_main"); if (IS_ERR(priv->main_thread)) { lbs_deb_thread("Error creating main thread.\n"); goto err_kthread_run; } - priv->work_thread = create_singlethread_workqueue("libertas_worker"); - INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker); - INIT_DELAYED_WORK(&priv->scan_work, libertas_scan_worker); - INIT_WORK(&priv->sync_channel, libertas_sync_channel); + priv->work_thread = create_singlethread_workqueue("lbs_worker"); + INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker); + INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker); + INIT_WORK(&priv->sync_channel, lbs_sync_channel); goto done; err_kthread_run: - device_remove_file(dmdev, &dev_attr_libertas_rtap); + device_remove_file(dmdev, &dev_attr_lbs_rtap); err_init_adapter: - libertas_free_adapter(priv); + lbs_free_adapter(priv); err_kzalloc: free_netdev(dev); @@ -1203,29 +1203,29 @@ done: lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv); return priv; } -EXPORT_SYMBOL_GPL(libertas_add_card); +EXPORT_SYMBOL_GPL(lbs_add_card); -int libertas_remove_card(wlan_private *priv) +int lbs_remove_card(lbs_private *priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct net_device *dev = priv->dev; union iwreq_data wrqu; lbs_deb_enter(LBS_DEB_MAIN); - libertas_remove_rtap(priv); + lbs_remove_rtap(priv); dev = priv->dev; - device_remove_file(priv->hotplug_device, &dev_attr_libertas_rtap); + device_remove_file(priv->hotplug_device, &dev_attr_lbs_rtap); cancel_delayed_work(&priv->scan_work); cancel_delayed_work(&priv->assoc_work); destroy_workqueue(priv->work_thread); - if (adapter->psmode == WLAN802_11POWERMODEMAX_PSP) { - adapter->psmode = WLAN802_11POWERMODECAM; - libertas_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); + if (adapter->psmode == LBS802_11POWERMODEMAX_PSP) { + adapter->psmode = LBS802_11POWERMODECAM; + lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); } memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN); @@ -1236,7 +1236,7 @@ int libertas_remove_card(wlan_private *priv) adapter->surpriseremoved = 1; kthread_stop(priv->main_thread); - libertas_free_adapter(priv); + lbs_free_adapter(priv); priv->dev = NULL; free_netdev(dev); @@ -1244,10 +1244,10 @@ int libertas_remove_card(wlan_private *priv) lbs_deb_leave(LBS_DEB_MAIN); return 0; } -EXPORT_SYMBOL_GPL(libertas_remove_card); +EXPORT_SYMBOL_GPL(lbs_remove_card); -int libertas_start_card(wlan_private *priv) +int lbs_start_card(lbs_private *priv) { struct net_device *dev = priv->dev; int ret = -1; @@ -1255,19 +1255,19 @@ int libertas_start_card(wlan_private *priv) lbs_deb_enter(LBS_DEB_MAIN); /* poke the firmware */ - ret = wlan_setup_firmware(priv); + ret = lbs_setup_firmware(priv); if (ret) goto done; /* init 802.11d */ - libertas_init_11d(priv); + lbs_init_11d(priv); if (register_netdev(dev)) { lbs_pr_err("cannot register ethX device\n"); goto done; } - libertas_debugfs_init_one(priv, dev); + lbs_debugfs_init_one(priv, dev); lbs_pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name); @@ -1277,10 +1277,10 @@ done: lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); return ret; } -EXPORT_SYMBOL_GPL(libertas_start_card); +EXPORT_SYMBOL_GPL(lbs_start_card); -int libertas_stop_card(wlan_private *priv) +int lbs_stop_card(lbs_private *priv) { struct net_device *dev = priv->dev; int ret = -1; @@ -1292,7 +1292,7 @@ int libertas_stop_card(wlan_private *priv) netif_stop_queue(priv->dev); netif_carrier_off(priv->dev); - libertas_debugfs_remove_one(priv); + lbs_debugfs_remove_one(priv); /* Flush pending command nodes */ spin_lock_irqsave(&priv->adapter->driver_lock, flags); @@ -1307,16 +1307,16 @@ int libertas_stop_card(wlan_private *priv) lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); return ret; } -EXPORT_SYMBOL_GPL(libertas_stop_card); +EXPORT_SYMBOL_GPL(lbs_stop_card); /** * @brief This function adds mshX interface * - * @param priv A pointer to the wlan_private structure + * @param priv A pointer to the lbs_private structure * @return 0 if successful, -X otherwise */ -int libertas_add_mesh(wlan_private *priv, struct device *dev) +int lbs_add_mesh(lbs_private *priv, struct device *dev) { struct net_device *mesh_dev = NULL; int ret = 0; @@ -1332,12 +1332,12 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev) mesh_dev->priv = priv; priv->mesh_dev = mesh_dev; - mesh_dev->open = libertas_mesh_open; - mesh_dev->hard_start_xmit = libertas_mesh_pre_start_xmit; - mesh_dev->stop = libertas_mesh_close; - mesh_dev->get_stats = libertas_get_stats; - mesh_dev->set_mac_address = libertas_set_mac_address; - mesh_dev->ethtool_ops = &libertas_ethtool_ops; + mesh_dev->open = lbs_mesh_open; + mesh_dev->hard_start_xmit = lbs_mesh_pre_start_xmit; + mesh_dev->stop = lbs_mesh_close; + mesh_dev->get_stats = lbs_get_stats; + mesh_dev->set_mac_address = lbs_set_mac_address; + mesh_dev->ethtool_ops = &lbs_ethtool_ops; memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, sizeof(priv->dev->dev_addr)); @@ -1353,7 +1353,7 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev) goto err_free; } - ret = sysfs_create_group(&(mesh_dev->dev.kobj), &libertas_mesh_attr_group); + ret = sysfs_create_group(&(mesh_dev->dev.kobj), &lbs_mesh_attr_group); if (ret) goto err_unregister; @@ -1371,10 +1371,10 @@ done: lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); return ret; } -EXPORT_SYMBOL_GPL(libertas_add_mesh); +EXPORT_SYMBOL_GPL(lbs_add_mesh); -void libertas_remove_mesh(wlan_private *priv) +void lbs_remove_mesh(lbs_private *priv) { struct net_device *mesh_dev; @@ -1388,7 +1388,7 @@ void libertas_remove_mesh(wlan_private *priv) netif_stop_queue(mesh_dev); netif_carrier_off(priv->mesh_dev); - sysfs_remove_group(&(mesh_dev->dev.kobj), &libertas_mesh_attr_group); + sysfs_remove_group(&(mesh_dev->dev.kobj), &lbs_mesh_attr_group); unregister_netdev(mesh_dev); priv->mesh_dev = NULL ; @@ -1397,7 +1397,7 @@ void libertas_remove_mesh(wlan_private *priv) out: lbs_deb_leave(LBS_DEB_MAIN); } -EXPORT_SYMBOL_GPL(libertas_remove_mesh); +EXPORT_SYMBOL_GPL(lbs_remove_mesh); /** * @brief This function finds the CFP in @@ -1408,7 +1408,7 @@ EXPORT_SYMBOL_GPL(libertas_remove_mesh); * @param cfp_no A pointer to CFP number * @return A pointer to CFP */ -struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *cfp_no) +struct chan_freq_power *lbs_get_region_cfp_table(u8 region, u8 band, int *cfp_no) { int i, end; @@ -1430,9 +1430,9 @@ struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *c return NULL; } -int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band) +int lbs_set_regiontable(lbs_private *priv, u8 region, u8 band) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; int i = 0; @@ -1444,7 +1444,7 @@ int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band) memset(adapter->region_channel, 0, sizeof(adapter->region_channel)); { - cfp = libertas_get_region_cfp_table(region, band, &cfp_no); + cfp = lbs_get_region_cfp_table(region, band, &cfp_no); if (cfp != NULL) { adapter->region_channel[i].nrcfp = cfp_no; adapter->region_channel[i].CFP = cfp; @@ -1472,13 +1472,13 @@ out: * @param dev A pointer to net_device structure * @return n/a */ -void libertas_interrupt(struct net_device *dev) +void lbs_interrupt(struct net_device *dev) { - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; lbs_deb_enter(LBS_DEB_THREAD); - lbs_deb_thread("libertas_interrupt: intcounter=%d\n", + lbs_deb_thread("lbs_interrupt: intcounter=%d\n", priv->adapter->intcounter); priv->adapter->intcounter++; @@ -1494,35 +1494,35 @@ void libertas_interrupt(struct net_device *dev) lbs_deb_leave(LBS_DEB_THREAD); } -EXPORT_SYMBOL_GPL(libertas_interrupt); +EXPORT_SYMBOL_GPL(lbs_interrupt); -int libertas_reset_device(wlan_private *priv) +int lbs_reset_device(lbs_private *priv) { int ret; lbs_deb_enter(LBS_DEB_MAIN); - ret = libertas_prepare_and_send_command(priv, CMD_802_11_RESET, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_RESET, CMD_ACT_HALT, 0, 0, NULL); msleep_interruptible(10); lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); return ret; } -EXPORT_SYMBOL_GPL(libertas_reset_device); +EXPORT_SYMBOL_GPL(lbs_reset_device); -static int libertas_init_module(void) +static int lbs_init_module(void) { lbs_deb_enter(LBS_DEB_MAIN); - libertas_debugfs_init(); + lbs_debugfs_init(); lbs_deb_leave(LBS_DEB_MAIN); return 0; } -static void libertas_exit_module(void) +static void lbs_exit_module(void) { lbs_deb_enter(LBS_DEB_MAIN); - libertas_debugfs_remove(); + lbs_debugfs_remove(); lbs_deb_leave(LBS_DEB_MAIN); } @@ -1531,32 +1531,32 @@ static void libertas_exit_module(void) * rtap interface support fuctions */ -static int libertas_rtap_open(struct net_device *dev) +static int lbs_rtap_open(struct net_device *dev) { netif_carrier_off(dev); netif_stop_queue(dev); return 0; } -static int libertas_rtap_stop(struct net_device *dev) +static int lbs_rtap_stop(struct net_device *dev) { return 0; } -static int libertas_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int lbs_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { netif_stop_queue(dev); return -EOPNOTSUPP; } -static struct net_device_stats *libertas_rtap_get_stats(struct net_device *dev) +static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev) { - wlan_private *priv = dev->priv; + lbs_private *priv = dev->priv; return &priv->ieee->stats; } -void libertas_remove_rtap(wlan_private *priv) +void lbs_remove_rtap(lbs_private *priv) { if (priv->rtap_net_dev == NULL) return; @@ -1565,7 +1565,7 @@ void libertas_remove_rtap(wlan_private *priv) priv->rtap_net_dev = NULL; } -int libertas_add_rtap(wlan_private *priv) +int lbs_add_rtap(lbs_private *priv) { int rc = 0; @@ -1582,11 +1582,11 @@ int libertas_add_rtap(wlan_private *priv) strcpy(priv->rtap_net_dev->name, "rtap%d"); priv->rtap_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; - priv->rtap_net_dev->open = libertas_rtap_open; - priv->rtap_net_dev->stop = libertas_rtap_stop; - priv->rtap_net_dev->get_stats = libertas_rtap_get_stats; - priv->rtap_net_dev->hard_start_xmit = libertas_rtap_hard_start_xmit; - priv->rtap_net_dev->set_multicast_list = libertas_set_multicast_list; + priv->rtap_net_dev->open = lbs_rtap_open; + priv->rtap_net_dev->stop = lbs_rtap_stop; + priv->rtap_net_dev->get_stats = lbs_rtap_get_stats; + priv->rtap_net_dev->hard_start_xmit = lbs_rtap_hard_start_xmit; + priv->rtap_net_dev->set_multicast_list = lbs_set_multicast_list; priv->rtap_net_dev->priv = priv; priv->ieee->iw_mode = IW_MODE_MONITOR; @@ -1602,8 +1602,8 @@ int libertas_add_rtap(wlan_private *priv) } -module_init(libertas_init_module); -module_exit(libertas_exit_module); +module_init(lbs_init_module); +module_exit(lbs_exit_module); MODULE_DESCRIPTION("Libertas WLAN Driver Library"); MODULE_AUTHOR("Marvell International Ltd."); diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 0420e5b9ff9b..204955904340 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c @@ -35,19 +35,19 @@ struct rx80211packethdr { void *eth80211_hdr; } __attribute__ ((packed)); -static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb); +static int process_rxed_802_11_packet(lbs_private *priv, struct sk_buff *skb); /** * @brief This function computes the avgSNR . * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return avgSNR */ -static u8 wlan_getavgsnr(wlan_private * priv) +static u8 lbs_getavgsnr(lbs_private *priv) { u8 i; u16 temp = 0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; if (adapter->numSNRNF == 0) return 0; for (i = 0; i < adapter->numSNRNF; i++) @@ -59,14 +59,14 @@ static u8 wlan_getavgsnr(wlan_private * priv) /** * @brief This function computes the AvgNF * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return AvgNF */ -static u8 wlan_getavgnf(wlan_private * priv) +static u8 lbs_getavgnf(lbs_private *priv) { u8 i; u16 temp = 0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; if (adapter->numSNRNF == 0) return 0; for (i = 0; i < adapter->numSNRNF; i++) @@ -78,13 +78,13 @@ static u8 wlan_getavgnf(wlan_private * priv) /** * @brief This function save the raw SNR/NF to our internel buffer * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param prxpd A pointer to rxpd structure of received packet * @return n/a */ -static void wlan_save_rawSNRNF(wlan_private * priv, struct rxpd *p_rx_pd) +static void lbs_save_rawSNRNF(lbs_private *priv, struct rxpd *p_rx_pd) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; if (adapter->numSNRNF < DEFAULT_DATA_AVG_FACTOR) adapter->numSNRNF++; adapter->rawSNR[adapter->nextSNRNF] = p_rx_pd->snr; @@ -98,13 +98,13 @@ static void wlan_save_rawSNRNF(wlan_private * priv, struct rxpd *p_rx_pd) /** * @brief This function computes the RSSI in received packet. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param prxpd A pointer to rxpd structure of received packet * @return n/a */ -static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) +static void lbs_compute_rssi(lbs_private *priv, struct rxpd *p_rx_pd) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_RX); @@ -115,10 +115,10 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) adapter->SNR[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->snr; adapter->NF[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->nf; - wlan_save_rawSNRNF(priv, p_rx_pd); + lbs_save_rawSNRNF(priv, p_rx_pd); - adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE; - adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE; + adapter->SNR[TYPE_RXPD][TYPE_AVG] = lbs_getavgsnr(priv) * AVG_SCALE; + adapter->NF[TYPE_RXPD][TYPE_AVG] = lbs_getavgnf(priv) * AVG_SCALE; lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n", adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); @@ -134,11 +134,11 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) lbs_deb_leave(LBS_DEB_RX); } -void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) +void lbs_upload_rx_packet(lbs_private *priv, struct sk_buff *skb) { lbs_deb_rx("skb->data %p\n", skb->data); - if (priv->adapter->monitormode != WLAN_MONITOR_OFF) { + if (priv->adapter->monitormode != LBS_MONITOR_OFF) { skb->protocol = eth_type_trans(skb, priv->rtap_net_dev); } else { if (priv->mesh_dev && IS_MESH_FRAME(skb)) @@ -154,13 +154,13 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) * @brief This function processes received packet and forwards it * to kernel/upper layer * - * @param priv A pointer to wlan_private + * @param priv A pointer to lbs_private * @param skb A pointer to skb which includes the received packet * @return 0 or -1 */ -int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) +int lbs_process_rxed_packet(lbs_private *priv, struct sk_buff *skb) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; struct rxpackethdr *p_rx_pkt; @@ -173,7 +173,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) lbs_deb_enter(LBS_DEB_RX); - if (priv->adapter->monitormode != WLAN_MONITOR_OFF) + if (priv->adapter->monitormode != LBS_MONITOR_OFF) return process_rxed_802_11_packet(priv, skb); p_rx_pkt = (struct rxpackethdr *) skb->data; @@ -258,22 +258,22 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) * only if the rate is auto */ if (adapter->auto_rate) - adapter->cur_rate = libertas_fw_index_to_data_rate(p_rx_pd->rx_rate); + adapter->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate); - wlan_compute_rssi(priv, p_rx_pd); + lbs_compute_rssi(priv, p_rx_pd); lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); priv->stats.rx_bytes += skb->len; priv->stats.rx_packets++; - libertas_upload_rx_packet(priv, skb); + lbs_upload_rx_packet(priv, skb); ret = 0; done: lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret); return ret; } -EXPORT_SYMBOL_GPL(libertas_process_rxed_packet); +EXPORT_SYMBOL_GPL(lbs_process_rxed_packet); /** * @brief This function converts Tx/Rx rates from the Marvell WLAN format @@ -319,13 +319,13 @@ static u8 convert_mv_rate_to_radiotap(u8 rate) * @brief This function processes a received 802.11 packet and forwards it * to kernel/upper layer * - * @param priv A pointer to wlan_private + * @param priv A pointer to lbs_private * @param skb A pointer to skb which includes the received packet * @return 0 or -1 */ -static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) +static int process_rxed_802_11_packet(lbs_private *priv, struct sk_buff *skb) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = 0; struct rx80211packethdr *p_rx_pkt; @@ -359,7 +359,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); /* create the exported radio header */ - if(priv->adapter->monitormode == WLAN_MONITOR_OFF) { + if (priv->adapter->monitormode == LBS_MONITOR_OFF) { /* no radio header */ /* chop the rxpd */ skb_pull(skb, sizeof(struct rxpd)); @@ -409,15 +409,15 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) * only if the rate is auto */ if (adapter->auto_rate) - adapter->cur_rate = libertas_fw_index_to_data_rate(prxpd->rx_rate); + adapter->cur_rate = lbs_fw_index_to_data_rate(prxpd->rx_rate); - wlan_compute_rssi(priv, prxpd); + lbs_compute_rssi(priv, prxpd); lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); priv->stats.rx_bytes += skb->len; priv->stats.rx_packets++; - libertas_upload_rx_packet(priv, skb); + lbs_upload_rx_packet(priv, skb); ret = 0; diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index ad1e67d984ce..30e1a8e8a16a 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c @@ -39,8 +39,8 @@ //! Memory needed to store a max number/size SSID TLV for a firmware scan #define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvlietypes_ssidparamset)) -//! Maximum memory needed for a wlan_scan_cmd_config with all TLVs at max -#define MAX_SCAN_CFG_ALLOC (sizeof(struct wlan_scan_cmd_config) \ +//! Maximum memory needed for a lbs_scan_cmd_config with all TLVs at max +#define MAX_SCAN_CFG_ALLOC (sizeof(struct lbs_scan_cmd_config) \ + sizeof(struct mrvlietypes_numprobes) \ + CHAN_TLV_MAX_SIZE \ + SSID_TLV_MAX_SIZE) @@ -80,7 +80,7 @@ static inline void clear_bss_descriptor (struct bss_descriptor * bss) memset(bss, 0, offsetof(struct bss_descriptor, list)); } -static inline int match_bss_no_security(struct wlan_802_11_security * secinfo, +static inline int match_bss_no_security(struct lbs_802_11_security *secinfo, struct bss_descriptor * match_bss) { if ( !secinfo->wep_enabled @@ -94,7 +94,7 @@ static inline int match_bss_no_security(struct wlan_802_11_security * secinfo, return 0; } -static inline int match_bss_static_wep(struct wlan_802_11_security * secinfo, +static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo, struct bss_descriptor * match_bss) { if ( secinfo->wep_enabled @@ -106,7 +106,7 @@ static inline int match_bss_static_wep(struct wlan_802_11_security * secinfo, return 0; } -static inline int match_bss_wpa(struct wlan_802_11_security * secinfo, +static inline int match_bss_wpa(struct lbs_802_11_security *secinfo, struct bss_descriptor * match_bss) { if ( !secinfo->wep_enabled @@ -121,7 +121,7 @@ static inline int match_bss_wpa(struct wlan_802_11_security * secinfo, return 0; } -static inline int match_bss_wpa2(struct wlan_802_11_security * secinfo, +static inline int match_bss_wpa2(struct lbs_802_11_security *secinfo, struct bss_descriptor * match_bss) { if ( !secinfo->wep_enabled @@ -136,7 +136,7 @@ static inline int match_bss_wpa2(struct wlan_802_11_security * secinfo, return 0; } -static inline int match_bss_dynamic_wep(struct wlan_802_11_security * secinfo, +static inline int match_bss_dynamic_wep(struct lbs_802_11_security *secinfo, struct bss_descriptor * match_bss) { if ( !secinfo->wep_enabled @@ -163,13 +163,13 @@ static inline int match_bss_dynamic_wep(struct wlan_802_11_security * secinfo, * 0 0 0 0 !=NONE 1 0 0 yes Dynamic WEP * * - * @param adapter A pointer to wlan_adapter + * @param adapter A pointer to lbs_adapter * @param index Index in scantable to check against current driver settings * @param mode Network mode: Infrastructure or IBSS * * @return Index in scantable, or error code if negative */ -static int is_network_compatible(wlan_adapter * adapter, +static int is_network_compatible(lbs_adapter *adapter, struct bss_descriptor * bss, u8 mode) { int matched = 0; @@ -235,7 +235,7 @@ done: * * @return 0--ssid is same, otherwise is different */ -int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) +int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) { if (ssid1_len != ssid2_len) return -1; @@ -256,13 +256,13 @@ int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) /** * @brief Create a channel list for the driver to scan based on region info * - * Only used from wlan_scan_setup_scan_config() + * Only used from lbs_scan_setup_scan_config() * * Use the driver region/band information to construct a comprehensive list * of channels to scan. This routine is used for any scan that is not * provided a specific channel list to scan. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param scanchanlist Output parameter: resulting channel list to scan * @param filteredscan Flag indicating whether or not a BSSID or SSID filter * is being sent in the command to firmware. Used to @@ -272,12 +272,12 @@ int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) * * @return void */ -static void wlan_scan_create_channel_list(wlan_private * priv, +static void lbs_scan_create_channel_list(lbs_private *priv, struct chanscanparamset * scanchanlist, u8 filteredscan) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct region_channel *scanregion; struct chan_freq_power *cfp; int rgnidx; @@ -297,7 +297,7 @@ static void wlan_scan_create_channel_list(wlan_private * priv, for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) { if (priv->adapter->enable11d && - adapter->connect_status != LIBERTAS_CONNECTED) { + adapter->connect_status != LBS_CONNECTED) { /* Scan all the supported chan for the first scan */ if (!adapter->universal_channel[rgnidx].valid) continue; @@ -319,7 +319,7 @@ static void wlan_scan_create_channel_list(wlan_private * priv, if (priv->adapter->enable11d) { scantype = - libertas_get_scan_type_11d(cfp->channel, + lbs_get_scan_type_11d(cfp->channel, &adapter-> parsed_region_chan); } @@ -357,24 +357,24 @@ static void wlan_scan_create_channel_list(wlan_private * priv, /* Delayed partial scan worker */ -void libertas_scan_worker(struct work_struct *work) +void lbs_scan_worker(struct work_struct *work) { - wlan_private *priv = container_of(work, wlan_private, scan_work.work); + lbs_private *priv = container_of(work, lbs_private, scan_work.work); - wlan_scan_networks(priv, NULL, 0); + lbs_scan_networks(priv, NULL, 0); } /** - * @brief Construct a wlan_scan_cmd_config structure to use in issue scan cmds + * @brief Construct a lbs_scan_cmd_config structure to use in issue scan cmds * - * Application layer or other functions can invoke wlan_scan_networks - * with a scan configuration supplied in a wlan_ioctl_user_scan_cfg struct. - * This structure is used as the basis of one or many wlan_scan_cmd_config + * Application layer or other functions can invoke lbs_scan_networks + * with a scan configuration supplied in a lbs_ioctl_user_scan_cfg struct. + * This structure is used as the basis of one or many lbs_scan_cmd_config * commands that are sent to the command processing module and sent to * firmware. * - * Create a wlan_scan_cmd_config based on the following user supplied + * Create a lbs_scan_cmd_config based on the following user supplied * parameters (if present): * - SSID filter * - BSSID filter @@ -385,7 +385,7 @@ void libertas_scan_worker(struct work_struct *work) * If the number of probes is not set, use the adapter default setting * Qualify the channel * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param puserscanin NULL or pointer to scan configuration parameters * @param ppchantlvout Output parameter: Pointer to the start of the * channel TLV portion of the output scan config @@ -403,9 +403,9 @@ void libertas_scan_worker(struct work_struct *work) * * @return resulting scan configuration */ -static struct wlan_scan_cmd_config * -wlan_scan_setup_scan_config(wlan_private * priv, - const struct wlan_ioctl_user_scan_cfg * puserscanin, +static struct lbs_scan_cmd_config * +lbs_scan_setup_scan_config(lbs_private *priv, + const struct lbs_ioctl_user_scan_cfg *puserscanin, struct mrvlietypes_chanlistparamset ** ppchantlvout, struct chanscanparamset * pscanchanlist, int *pmaxchanperscan, @@ -414,7 +414,7 @@ wlan_scan_setup_scan_config(wlan_private * priv, { struct mrvlietypes_numprobes *pnumprobestlv; struct mrvlietypes_ssidparamset *pssidtlv; - struct wlan_scan_cmd_config * pscancfgout = NULL; + struct lbs_scan_cmd_config *pscancfgout = NULL; u8 *ptlvpos; u16 numprobes; int chanidx; @@ -523,13 +523,13 @@ wlan_scan_setup_scan_config(wlan_private * priv, if (!puserscanin || !puserscanin->chanlist[0].channumber) { /* Create a default channel scan list */ lbs_deb_scan("creating full region channel list\n"); - wlan_scan_create_channel_list(priv, pscanchanlist, + lbs_scan_create_channel_list(priv, pscanchanlist, *pfilteredscan); goto out; } for (chanidx = 0; - chanidx < WLAN_IOCTL_USER_SCAN_CHAN_MAX + chanidx < LBS_IOCTL_USER_SCAN_CHAN_MAX && puserscanin->chanlist[chanidx].channumber; chanidx++) { channel = puserscanin->chanlist[chanidx].channumber; @@ -579,14 +579,14 @@ out: /** * @brief Construct and send multiple scan config commands to the firmware * - * Only used from wlan_scan_networks() + * Only used from lbs_scan_networks() * - * Previous routines have created a wlan_scan_cmd_config with any requested + * Previous routines have created a lbs_scan_cmd_config with any requested * TLVs. This function splits the channel TLV into maxchanperscan lists * and sends the portion of the channel TLV along with the other TLVs - * to the wlan_cmd routines for execution in the firmware. + * to the lbs_cmd routines for execution in the firmware. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param maxchanperscan Maximum number channels to be included in each * scan command sent to firmware * @param filteredscan Flag indicating whether or not a BSSID or SSID @@ -600,13 +600,13 @@ out: * * @return 0 or error return otherwise */ -static int wlan_scan_channel_list(wlan_private * priv, +static int lbs_scan_channel_list(lbs_private *priv, int maxchanperscan, u8 filteredscan, - struct wlan_scan_cmd_config * pscancfgout, + struct lbs_scan_cmd_config *pscancfgout, struct mrvlietypes_chanlistparamset * pchantlvout, struct chanscanparamset * pscanchanlist, - const struct wlan_ioctl_user_scan_cfg * puserscanin, + const struct lbs_ioctl_user_scan_cfg *puserscanin, int full_scan) { struct chanscanparamset *ptmpchan; @@ -720,7 +720,7 @@ static int wlan_scan_channel_list(wlan_private * priv, } /* Send the scan command to the firmware with the specified cfg */ - ret = libertas_prepare_and_send_command(priv, CMD_802_11_SCAN, 0, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SCAN, 0, 0, 0, pscancfgout); if (scanned >= 2 && !full_scan) { ret = 0; @@ -751,10 +751,10 @@ out: } /* - * Only used from wlan_scan_networks() + * Only used from lbs_scan_networks() */ -static void clear_selected_scan_list_entries(wlan_adapter *adapter, - const struct wlan_ioctl_user_scan_cfg *scan_cfg) +static void clear_selected_scan_list_entries(lbs_adapter *adapter, + const struct lbs_ioctl_user_scan_cfg *scan_cfg) { struct bss_descriptor *bss; struct bss_descriptor *safe; @@ -812,21 +812,21 @@ out: * order to send the appropriate scan commands to firmware to populate or * update the internal driver scan table * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param puserscanin Pointer to the input configuration for the requested * scan. * @param full_scan ??? * * @return 0 or < 0 if error */ -int wlan_scan_networks(wlan_private * priv, - const struct wlan_ioctl_user_scan_cfg * puserscanin, +int lbs_scan_networks(lbs_private *priv, + const struct lbs_ioctl_user_scan_cfg *puserscanin, int full_scan) { - wlan_adapter * adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct mrvlietypes_chanlistparamset *pchantlvout; struct chanscanparamset * scan_chan_list = NULL; - struct wlan_scan_cmd_config * scan_cfg = NULL; + struct lbs_scan_cmd_config *scan_cfg = NULL; u8 filteredscan; u8 scancurrentchanonly; int maxchanperscan; @@ -846,13 +846,13 @@ int wlan_scan_networks(wlan_private * priv, cancel_delayed_work(&priv->scan_work); scan_chan_list = kzalloc(sizeof(struct chanscanparamset) * - WLAN_IOCTL_USER_SCAN_CHAN_MAX, GFP_KERNEL); + LBS_IOCTL_USER_SCAN_CHAN_MAX, GFP_KERNEL); if (scan_chan_list == NULL) { ret = -ENOMEM; goto out; } - scan_cfg = wlan_scan_setup_scan_config(priv, + scan_cfg = lbs_scan_setup_scan_config(priv, puserscanin, &pchantlvout, scan_chan_list, @@ -876,7 +876,7 @@ int wlan_scan_networks(wlan_private * priv, } } - ret = wlan_scan_channel_list(priv, + ret = lbs_scan_channel_list(priv, maxchanperscan, filteredscan, scan_cfg, @@ -897,7 +897,7 @@ int wlan_scan_networks(wlan_private * priv, mutex_unlock(&adapter->lock); #endif - if (priv->adapter->connect_status == LIBERTAS_CONNECTED) { + if (priv->adapter->connect_status == LBS_CONNECTED) { netif_carrier_on(priv->dev); netif_wake_queue(priv->dev); if (priv->mesh_dev) { @@ -928,7 +928,7 @@ out: * * @return 0 or -1 */ -static int libertas_process_bss(struct bss_descriptor * bss, +static int lbs_process_bss(struct bss_descriptor *bss, u8 ** pbeaconinfo, int *bytesleft) { struct ieeetypes_fhparamset *pFH; @@ -1139,7 +1139,7 @@ static int libertas_process_bss(struct bss_descriptor * bss, /* Timestamp */ bss->last_scanned = jiffies; - libertas_unset_basic_rate_flags(bss->rates, sizeof(bss->rates)); + lbs_unset_basic_rate_flags(bss->rates, sizeof(bss->rates)); ret = 0; @@ -1153,13 +1153,13 @@ done: * * Used in association code * - * @param adapter A pointer to wlan_adapter + * @param adapter A pointer to lbs_adapter * @param bssid BSSID to find in the scan list * @param mode Network mode: Infrastructure or IBSS * * @return index in BSSID list, or error return code (< 0) */ -struct bss_descriptor *libertas_find_bssid_in_list(wlan_adapter * adapter, +struct bss_descriptor *lbs_find_bssid_in_list(lbs_adapter *adapter, u8 * bssid, u8 mode) { struct bss_descriptor * iter_bss; @@ -1205,14 +1205,14 @@ out: * * Used in association code * - * @param adapter A pointer to wlan_adapter + * @param adapter A pointer to lbs_adapter * @param ssid SSID to find in the list * @param bssid BSSID to qualify the SSID selection (if provided) * @param mode Network mode: Infrastructure or IBSS * * @return index in BSSID list */ -struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, +struct bss_descriptor *lbs_find_ssid_in_list(lbs_adapter *adapter, u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, int channel) { @@ -1230,7 +1230,7 @@ struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, || (iter_bss->last_scanned < tmp_oldest->last_scanned)) tmp_oldest = iter_bss; - if (libertas_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len, + if (lbs_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len, ssid, ssid_len) != 0) continue; /* ssid doesn't match */ if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) @@ -1277,11 +1277,11 @@ out: * Search the scan table for the best SSID that also matches the current * adapter network preference (infrastructure or adhoc) * - * @param adapter A pointer to wlan_adapter + * @param adapter A pointer to lbs_adapter * * @return index in BSSID list */ -static struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter, +static struct bss_descriptor *lbs_find_best_ssid_in_list(lbs_adapter *adapter, u8 mode) { u8 bestrssi = 0; @@ -1323,27 +1323,27 @@ static struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * ad * * Used from association worker. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param pSSID A pointer to AP's ssid * * @return 0--success, otherwise--fail */ -int libertas_find_best_network_ssid(wlan_private * priv, +int lbs_find_best_network_ssid(lbs_private *priv, u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int ret = -1; struct bss_descriptor * found; lbs_deb_enter(LBS_DEB_SCAN); - wlan_scan_networks(priv, NULL, 1); + lbs_scan_networks(priv, NULL, 1); if (adapter->surpriseremoved) goto out; wait_event_interruptible(adapter->cmd_pending, !adapter->nr_cmd_pending); - found = libertas_find_best_ssid_in_list(adapter, preferred_mode); + found = lbs_find_best_ssid_in_list(adapter, preferred_mode); if (found && (found->ssid_len > 0)) { memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE); *out_ssid_len = found->ssid_len; @@ -1366,11 +1366,11 @@ out: * * @return 0 --success, otherwise fail */ -int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, +int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_SCAN); @@ -1392,7 +1392,7 @@ int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, * * Used in association code and from debugfs * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param ssid A pointer to the SSID to scan for * @param ssid_len Length of the SSID * @param clear_ssid Should existing scan results with this SSID @@ -1402,11 +1402,11 @@ int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, * * @return 0-success, otherwise fail */ -int libertas_send_specific_ssid_scan(wlan_private * priv, +int lbs_send_specific_ssid_scan(lbs_private *priv, u8 *ssid, u8 ssid_len, u8 clear_ssid) { - wlan_adapter *adapter = priv->adapter; - struct wlan_ioctl_user_scan_cfg scancfg; + lbs_adapter *adapter = priv->adapter; + struct lbs_ioctl_user_scan_cfg scancfg; int ret = 0; lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s', clear %d", @@ -1420,7 +1420,7 @@ int libertas_send_specific_ssid_scan(wlan_private * priv, scancfg.ssid_len = ssid_len; scancfg.clear_ssid = clear_ssid; - wlan_scan_networks(priv, &scancfg, 1); + lbs_scan_networks(priv, &scancfg, 1); if (adapter->surpriseremoved) { ret = -1; goto out; @@ -1443,11 +1443,11 @@ out: #define MAX_CUSTOM_LEN 64 -static inline char *libertas_translate_scan(wlan_private *priv, +static inline char *lbs_translate_scan(lbs_private *priv, char *start, char *stop, struct bss_descriptor *bss) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct chan_freq_power *cfp; char *current_val; /* For rates */ struct iw_event iwe; /* Temporary buffer */ @@ -1459,7 +1459,7 @@ static inline char *libertas_translate_scan(wlan_private *priv, lbs_deb_enter(LBS_DEB_SCAN); - cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, bss->channel); + cfp = lbs_find_cfp_by_band_and_channel(adapter, 0, bss->channel); if (!cfp) { lbs_deb_scan("Invalid channel number %d\n", bss->channel); start = NULL; @@ -1515,7 +1515,7 @@ static inline char *libertas_translate_scan(wlan_private *priv, */ if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate - && !libertas_ssid_cmp(adapter->curbssparams.ssid, + && !lbs_ssid_cmp(adapter->curbssparams.ssid, adapter->curbssparams.ssid_len, bss->ssid, bss->ssid_len)) { int snr, nf; @@ -1549,7 +1549,7 @@ static inline char *libertas_translate_scan(wlan_private *priv, stop, &iwe, IW_EV_PARAM_LEN); } if ((bss->mode == IW_MODE_ADHOC) - && !libertas_ssid_cmp(adapter->curbssparams.ssid, + && !lbs_ssid_cmp(adapter->curbssparams.ssid, adapter->curbssparams.ssid_len, bss->ssid, bss->ssid_len) && adapter->adhoccreate) { @@ -1606,12 +1606,12 @@ out: * * @return 0 --success, otherwise fail */ -int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, +int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { #define SCAN_ITEM_SIZE 128 - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int err = 0; char *ev = extra; char *stop = ev + dwrq->length; @@ -1622,7 +1622,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, /* Update RSSI if current BSS is a locally created ad-hoc BSS */ if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) { - libertas_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, + lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, CMD_OPTION_WAITFORRSP, 0, NULL); } @@ -1650,7 +1650,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, } /* Translate to WE format this entry */ - next_ev = libertas_translate_scan(priv, ev, stop, iter_bss); + next_ev = lbs_translate_scan(priv, ev, stop, iter_bss); if (next_ev == NULL) continue; ev = next_ev; @@ -1677,24 +1677,24 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, /** * @brief Prepare a scan command to be sent to the firmware * - * Called from libertas_prepare_and_send_command() in cmd.c + * Called from lbs_prepare_and_send_command() in cmd.c * * Sends a fixed lenght data part (specifying the BSS type and BSSID filters) * as well as a variable number/length of TLVs to the firmware. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param cmd A pointer to cmd_ds_command structure to be sent to * firmware with the cmd_DS_801_11_SCAN structure - * @param pdata_buf Void pointer cast of a wlan_scan_cmd_config struct used + * @param pdata_buf Void pointer cast of a lbs_scan_cmd_config struct used * to set the fields/TLVs for the command sent to firmware * * @return 0 or -1 */ -int libertas_cmd_80211_scan(wlan_private * priv, +int lbs_cmd_80211_scan(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf) { struct cmd_ds_802_11_scan *pscan = &cmd->params.scan; - struct wlan_scan_cmd_config *pscancfg = pdata_buf; + struct lbs_scan_cmd_config *pscancfg = pdata_buf; lbs_deb_enter(LBS_DEB_SCAN); @@ -1750,14 +1750,14 @@ static inline int is_same_network(struct bss_descriptor *src, * | bufsize and sizeof the fixed fields above) | * .-----------------------------------------------------------. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param resp A pointer to cmd_ds_command * * @return 0 or -1 */ -int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp) +int lbs_ret_80211_scan(lbs_private *priv, struct cmd_ds_command *resp) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct cmd_ds_802_11_scan_rsp *pscan; struct bss_descriptor * iter_bss; struct bss_descriptor * safe; @@ -1821,7 +1821,7 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp) /* Process the data fields and IEs returned for this BSS */ memset(&new, 0, sizeof (struct bss_descriptor)); - if (libertas_process_bss(&new, &pbssinfo, &bytesleft) != 0) { + if (lbs_process_bss(&new, &pbssinfo, &bytesleft) != 0) { /* error parsing the scan response, skipped */ lbs_deb_scan("SCAN_RESP: process_bss returned ERROR\n"); continue; diff --git a/drivers/net/wireless/libertas/scan.h b/drivers/net/wireless/libertas/scan.h index c29c031bef8c..7ed66f40d181 100644 --- a/drivers/net/wireless/libertas/scan.h +++ b/drivers/net/wireless/libertas/scan.h @@ -2,10 +2,10 @@ * Interface for the wlan network scan routines * * Driver interface functions and type declarations for the scan module - * implemented in wlan_scan.c. + * implemented in scan.c. */ -#ifndef _WLAN_SCAN_H -#define _WLAN_SCAN_H +#ifndef _LBS_SCAN_H +#define _LBS_SCAN_H #include <net/ieee80211.h> #include "hostcmd.h" @@ -13,38 +13,38 @@ /** * @brief Maximum number of channels that can be sent in a setuserscan ioctl * - * @sa wlan_ioctl_user_scan_cfg + * @sa lbs_ioctl_user_scan_cfg */ -#define WLAN_IOCTL_USER_SCAN_CHAN_MAX 50 +#define LBS_IOCTL_USER_SCAN_CHAN_MAX 50 -//! Infrastructure BSS scan type in wlan_scan_cmd_config -#define WLAN_SCAN_BSS_TYPE_BSS 1 +//! Infrastructure BSS scan type in lbs_scan_cmd_config +#define LBS_SCAN_BSS_TYPE_BSS 1 -//! Adhoc BSS scan type in wlan_scan_cmd_config -#define WLAN_SCAN_BSS_TYPE_IBSS 2 +//! Adhoc BSS scan type in lbs_scan_cmd_config +#define LBS_SCAN_BSS_TYPE_IBSS 2 -//! Adhoc or Infrastructure BSS scan type in wlan_scan_cmd_config, no filter -#define WLAN_SCAN_BSS_TYPE_ANY 3 +//! Adhoc or Infrastructure BSS scan type in lbs_scan_cmd_config, no filter +#define LBS_SCAN_BSS_TYPE_ANY 3 /** * @brief Structure used internally in the wlan driver to configure a scan. * * Sent to the command processing module to configure the firmware - * scan command prepared by libertas_cmd_80211_scan. + * scan command prepared by lbs_cmd_80211_scan. * - * @sa wlan_scan_networks + * @sa lbs_scan_networks * */ -struct wlan_scan_cmd_config { +struct lbs_scan_cmd_config { /** * @brief BSS type to be sent in the firmware command * * Field can be used to restrict the types of networks returned in the * scan. valid settings are: * - * - WLAN_SCAN_BSS_TYPE_BSS (infrastructure) - * - WLAN_SCAN_BSS_TYPE_IBSS (adhoc) - * - WLAN_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure) + * - LBS_SCAN_BSS_TYPE_BSS (infrastructure) + * - LBS_SCAN_BSS_TYPE_IBSS (adhoc) + * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure) */ u8 bsstype; @@ -68,12 +68,12 @@ struct wlan_scan_cmd_config { }; /** - * @brief IOCTL channel sub-structure sent in wlan_ioctl_user_scan_cfg + * @brief IOCTL channel sub-structure sent in lbs_ioctl_user_scan_cfg * * Multiple instances of this structure are included in the IOCTL command * to configure a instance of a scan on the specific channel. */ -struct wlan_ioctl_user_scan_chan { +struct lbs_ioctl_user_scan_chan { u8 channumber; //!< channel Number to scan u8 radiotype; //!< Radio type: 'B/G' band = 0, 'A' band = 1 u8 scantype; //!< Scan type: Active = 0, Passive = 1 @@ -83,23 +83,23 @@ struct wlan_ioctl_user_scan_chan { /** * @brief IOCTL input structure to configure an immediate scan cmd to firmware * - * Used in the setuserscan (WLAN_SET_USER_SCAN) private ioctl. Specifies + * Used in the setuserscan (LBS_SET_USER_SCAN) private ioctl. Specifies * a number of parameters to be used in general for the scan as well - * as a channel list (wlan_ioctl_user_scan_chan) for each scan period + * as a channel list (lbs_ioctl_user_scan_chan) for each scan period * desired. * - * @sa libertas_set_user_scan_ioctl + * @sa lbs_set_user_scan_ioctl */ -struct wlan_ioctl_user_scan_cfg { +struct lbs_ioctl_user_scan_cfg { /** * @brief BSS type to be sent in the firmware command * * Field can be used to restrict the types of networks returned in the * scan. valid settings are: * - * - WLAN_SCAN_BSS_TYPE_BSS (infrastructure) - * - WLAN_SCAN_BSS_TYPE_IBSS (adhoc) - * - WLAN_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure) + * - LBS_SCAN_BSS_TYPE_BSS (infrastructure) + * - LBS_SCAN_BSS_TYPE_IBSS (adhoc) + * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure) */ u8 bsstype; @@ -128,7 +128,7 @@ struct wlan_ioctl_user_scan_cfg { /** * @brief Variable number (fixed maximum) of channels to scan up */ - struct wlan_ioctl_user_scan_chan chanlist[WLAN_IOCTL_USER_SCAN_CHAN_MAX]; + struct lbs_ioctl_user_scan_chan chanlist[LBS_IOCTL_USER_SCAN_CHAN_MAX]; }; /** @@ -174,30 +174,30 @@ struct bss_descriptor { struct list_head list; }; -int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len); +int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len); -struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, - u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, - int channel); +struct bss_descriptor *lbs_find_ssid_in_list(lbs_adapter *adapter, + u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode, + int channel); -struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter, - u8 * bssid, u8 mode); +struct bss_descriptor *lbs_find_bssid_in_list(lbs_adapter *adapter, + u8 *bssid, u8 mode); -int libertas_find_best_network_ssid(wlan_private * priv, u8 *out_ssid, +int lbs_find_best_network_ssid(lbs_private *priv, u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode); -int libertas_send_specific_ssid_scan(wlan_private * priv, u8 *ssid, +int lbs_send_specific_ssid_scan(lbs_private *priv, u8 *ssid, u8 ssid_len, u8 clear_ssid); -int libertas_cmd_80211_scan(wlan_private * priv, +int lbs_cmd_80211_scan(lbs_private *priv, struct cmd_ds_command *cmd, void *pdata_buf); -int libertas_ret_80211_scan(wlan_private * priv, +int lbs_ret_80211_scan(lbs_private *priv, struct cmd_ds_command *resp); -int wlan_scan_networks(wlan_private * priv, - const struct wlan_ioctl_user_scan_cfg * puserscanin, +int lbs_scan_networks(lbs_private *priv, + const struct lbs_ioctl_user_scan_cfg *puserscanin, int full_scan); struct ifreq; @@ -205,11 +205,11 @@ struct ifreq; struct iw_point; struct iw_param; struct iw_request_info; -int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, +int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra); -int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, +int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra); -void libertas_scan_worker(struct work_struct *work); +void lbs_scan_worker(struct work_struct *work); -#endif /* _WLAN_SCAN_H */ +#endif diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index fbec06c10dd7..93725ce55b10 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c @@ -52,11 +52,11 @@ static u32 convert_radiotap_rate_to_mv(u8 rate) * @brief This function processes a single packet and sends * to IF layer * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param skb A pointer to skb which includes TX packet * @return 0 or -1 */ -static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) +static int SendSinglePacket(lbs_private *priv, struct sk_buff *skb) { int ret = 0; struct txpd localtxpd; @@ -86,7 +86,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) plocaltxpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); p802x_hdr = skb->data; - if (priv->adapter->monitormode != WLAN_MONITOR_OFF) { + if (priv->adapter->monitormode != LBS_MONITOR_OFF) { /* locate radiotap header */ pradiotap_hdr = (struct tx_radiotap_hdr *)skb->data; @@ -106,7 +106,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) } /* copy destination address from 802.3 or 802.11 header */ - if (priv->adapter->monitormode != WLAN_MONITOR_OFF) + if (priv->adapter->monitormode != LBS_MONITOR_OFF) memcpy(plocaltxpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN); else memcpy(plocaltxpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN); @@ -144,7 +144,7 @@ done: priv->stats.tx_errors++; } - if (!ret && priv->adapter->monitormode != WLAN_MONITOR_OFF) { + if (!ret && priv->adapter->monitormode != LBS_MONITOR_OFF) { /* Keep the skb to echo it back once Tx feedback is received from FW */ skb_orphan(skb); @@ -164,9 +164,9 @@ done: } -void libertas_tx_runqueue(wlan_private *priv) +void lbs_tx_runqueue(lbs_private *priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; int i; spin_lock(&adapter->txqueue_lock); @@ -180,9 +180,9 @@ void libertas_tx_runqueue(wlan_private *priv) spin_unlock(&adapter->txqueue_lock); } -static void wlan_tx_queue(wlan_private *priv, struct sk_buff *skb) +static void lbs_tx_queue(lbs_private *priv, struct sk_buff *skb) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; spin_lock(&adapter->txqueue_lock); @@ -205,10 +205,10 @@ static void wlan_tx_queue(wlan_private *priv, struct sk_buff *skb) * @brief This function checks the conditions and sends packet to IF * layer if everything is ok. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @return n/a */ -int libertas_process_tx(wlan_private * priv, struct sk_buff *skb) +int lbs_process_tx(lbs_private *priv, struct sk_buff *skb) { int ret = -1; @@ -223,7 +223,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb) if ((priv->adapter->psstate == PS_STATE_SLEEP) || (priv->adapter->psstate == PS_STATE_PRE_SLEEP)) { - wlan_tx_queue(priv, skb); + lbs_tx_queue(priv, skb); return ret; } @@ -239,20 +239,20 @@ done: * @brief This function sends to the host the last transmitted packet, * filling the radiotap headers with transmission information. * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @param status A 32 bit value containing transmission status. * * @returns void */ -void libertas_send_tx_feedback(wlan_private * priv) +void lbs_send_tx_feedback(lbs_private *priv) { - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; struct tx_radiotap_hdr *radiotap_hdr; u32 status = adapter->eventcause; int txfail; int try_count; - if (adapter->monitormode == WLAN_MONITOR_OFF || + if (adapter->monitormode == LBS_MONITOR_OFF || adapter->currenttxskb == NULL) return; @@ -270,13 +270,13 @@ void libertas_send_tx_feedback(wlan_private * priv) try_count = (status >> 16) & 0xff; radiotap_hdr->data_retries = (try_count) ? (1 + adapter->txretrycount - try_count) : 0; - libertas_upload_rx_packet(priv, adapter->currenttxskb); + lbs_upload_rx_packet(priv, adapter->currenttxskb); adapter->currenttxskb = NULL; priv->adapter->TxLockFlag = 0; - if (priv->adapter->connect_status == LIBERTAS_CONNECTED) { + if (priv->adapter->connect_status == LBS_CONNECTED) { netif_wake_queue(priv->dev); if (priv->mesh_dev) netif_wake_queue(priv->mesh_dev); } } -EXPORT_SYMBOL_GPL(libertas_send_tx_feedback); +EXPORT_SYMBOL_GPL(lbs_send_tx_feedback); diff --git a/drivers/net/wireless/libertas/types.h b/drivers/net/wireless/libertas/types.h index a43a5f63c879..8a454454e2a9 100644 --- a/drivers/net/wireless/libertas/types.h +++ b/drivers/net/wireless/libertas/types.h @@ -1,8 +1,8 @@ /** * This header file contains definition for global types */ -#ifndef _WLAN_TYPES_ -#define _WLAN_TYPES_ +#ifndef _LBS_TYPES_H_ +#define _LBS_TYPES_H_ #include <linux/if_ether.h> #include <asm/byteorder.h> @@ -250,4 +250,4 @@ struct mrvlietypes_ledgpio { struct led_pin ledpin[1]; } __attribute__ ((packed)); -#endif /* _WLAN_TYPES_ */ +#endif diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 19c2873d2d78..57fe5f67a05a 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c @@ -21,7 +21,7 @@ #include "assoc.h" -static inline void libertas_postpone_association_work(wlan_private *priv) +static inline void lbs_postpone_association_work(lbs_private *priv) { if (priv->adapter->surpriseremoved) return; @@ -29,7 +29,7 @@ static inline void libertas_postpone_association_work(wlan_private *priv) queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2); } -static inline void libertas_cancel_association_work(wlan_private *priv) +static inline void lbs_cancel_association_work(lbs_private *priv) { cancel_delayed_work(&priv->assoc_work); kfree(priv->adapter->pending_assoc_req); @@ -40,12 +40,12 @@ static inline void libertas_cancel_association_work(wlan_private *priv) /** * @brief Find the channel frequency power info with specific channel * - * @param adapter A pointer to wlan_adapter structure + * @param adapter A pointer to lbs_adapter structure * @param band it can be BAND_A, BAND_G or BAND_B * @param channel the channel for looking * @return A pointer to struct chan_freq_power structure or NULL if not find. */ -struct chan_freq_power *libertas_find_cfp_by_band_and_channel(wlan_adapter * adapter, +struct chan_freq_power *lbs_find_cfp_by_band_and_channel(lbs_adapter *adapter, u8 band, u16 channel) { struct chan_freq_power *cfp = NULL; @@ -70,7 +70,7 @@ struct chan_freq_power *libertas_find_cfp_by_band_and_channel(wlan_adapter * ada } if (!cfp && channel) - lbs_deb_wext("libertas_find_cfp_by_band_and_channel: can't find " + lbs_deb_wext("lbs_find_cfp_by_band_and_channel: can't find " "cfp by band %d / channel %d\n", band, channel); return cfp; @@ -79,12 +79,12 @@ struct chan_freq_power *libertas_find_cfp_by_band_and_channel(wlan_adapter * ada /** * @brief Find the channel frequency power info with specific frequency * - * @param adapter A pointer to wlan_adapter structure + * @param adapter A pointer to lbs_adapter structure * @param band it can be BAND_A, BAND_G or BAND_B * @param freq the frequency for looking * @return A pointer to struct chan_freq_power structure or NULL if not find. */ -static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter, +static struct chan_freq_power *find_cfp_by_band_and_freq(lbs_adapter *adapter, u8 band, u32 freq) { struct chan_freq_power *cfp = NULL; @@ -119,14 +119,14 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter, /** * @brief Set Radio On/OFF * - * @param priv A pointer to wlan_private structure + * @param priv A pointer to lbs_private structure * @option Radio Option * @return 0 --success, otherwise fail */ -static int wlan_radio_ioctl(wlan_private * priv, u8 option) +static int lbs_radio_ioctl(lbs_private *priv, u8 option) { int ret = 0; - wlan_adapter *adapter = priv->adapter; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -134,7 +134,7 @@ static int wlan_radio_ioctl(wlan_private * priv, u8 option) lbs_deb_wext("switching radio %s\n", option ? "on" : "off"); adapter->radioon = option; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_RADIO_CONTROL, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -147,22 +147,22 @@ static int wlan_radio_ioctl(wlan_private * priv, u8 option) /** * @brief Copy active data rates based on adapter mode and status * - * @param adapter A pointer to wlan_adapter structure + * @param adapter A pointer to lbs_adapter structure * @param rate The buf to return the active rates */ -static void copy_active_data_rates(wlan_adapter * adapter, u8 * rates) +static void copy_active_data_rates(lbs_adapter *adapter, u8 *rates) { lbs_deb_enter(LBS_DEB_WEXT); - if (adapter->connect_status != LIBERTAS_CONNECTED) - memcpy(rates, libertas_bg_rates, MAX_RATES); + if (adapter->connect_status != LBS_CONNECTED) + memcpy(rates, lbs_bg_rates, MAX_RATES); else memcpy(rates, adapter->curbssparams.rates, MAX_RATES); lbs_deb_leave(LBS_DEB_WEXT); } -static int wlan_get_name(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_name(struct net_device *dev, struct iw_request_info *info, char *cwrq, char *extra) { @@ -175,16 +175,16 @@ static int wlan_get_name(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_get_freq(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info, struct iw_freq *fwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct chan_freq_power *cfp; lbs_deb_enter(LBS_DEB_WEXT); - cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, + cfp = lbs_find_cfp_by_band_and_channel(adapter, 0, adapter->curbssparams.channel); if (!cfp) { @@ -202,15 +202,15 @@ static int wlan_get_freq(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_get_wap(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_wap(struct net_device *dev, struct iw_request_info *info, struct sockaddr *awrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); - if (adapter->connect_status == LIBERTAS_CONNECTED) { + if (adapter->connect_status == LBS_CONNECTED) { memcpy(awrq->sa_data, adapter->curbssparams.bssid, ETH_ALEN); } else { memset(awrq->sa_data, 0, ETH_ALEN); @@ -221,11 +221,11 @@ static int wlan_get_wap(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_set_nick(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_nick(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -246,11 +246,11 @@ static int wlan_set_nick(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_nick(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -267,14 +267,14 @@ static int wlan_get_nick(struct net_device *dev, struct iw_request_info *info, static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); /* Use nickname to indicate that mesh is on */ - if (adapter->connect_status == LIBERTAS_CONNECTED) { + if (adapter->connect_status == LBS_CONNECTED) { strncpy(extra, "Mesh", 12); extra[12] = '\0'; dwrq->length = strlen(extra); @@ -289,12 +289,12 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; u32 rthr = vwrq->value; lbs_deb_enter(LBS_DEB_WEXT); @@ -307,7 +307,7 @@ static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, adapter->rtsthsd = rthr; } - ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, OID_802_11_RTS_THRESHOLD, &rthr); @@ -315,17 +315,17 @@ static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, return ret; } -static int wlan_get_rts(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); adapter->rtsthsd = 0; - ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, CMD_ACT_GET, CMD_OPTION_WAITFORRSP, OID_802_11_RTS_THRESHOLD, NULL); if (ret) @@ -341,13 +341,13 @@ out: return ret; } -static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; u32 fthr = vwrq->value; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -360,7 +360,7 @@ static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info, adapter->fragthsd = fthr; } - ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, OID_802_11_FRAGMENTATION_THRESHOLD, &fthr); @@ -368,17 +368,17 @@ static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info, return ret; } -static int wlan_get_frag(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); adapter->fragthsd = 0; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, CMD_ACT_GET, CMD_OPTION_WAITFORRSP, OID_802_11_FRAGMENTATION_THRESHOLD, NULL); @@ -395,11 +395,11 @@ out: return ret; } -static int wlan_get_mode(struct net_device *dev, +static int lbs_get_mode(struct net_device *dev, struct iw_request_info *info, u32 * uwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -421,17 +421,17 @@ static int mesh_wlan_get_mode(struct net_device *dev, return 0; } -static int wlan_get_txpow(struct net_device *dev, +static int lbs_get_txpow(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_TX_POWER, CMD_ACT_TX_POWER_OPT_GET, CMD_OPTION_WAITFORRSP, 0, NULL); @@ -454,12 +454,12 @@ out: return ret; } -static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -474,7 +474,7 @@ static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info, /* Adding 1 to convert retry count to try count */ adapter->txretrycount = vwrq->value + 1; - ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, CMD_ACT_SET, CMD_OPTION_WAITFORRSP, OID_802_11_TX_RETRYCOUNT, NULL); @@ -490,17 +490,17 @@ out: return ret; } -static int wlan_get_retry(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int ret = 0; lbs_deb_enter(LBS_DEB_WEXT); adapter->txretrycount = 0; - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB, CMD_ACT_GET, CMD_OPTION_WAITFORRSP, OID_802_11_TX_RETRYCOUNT, NULL); @@ -558,12 +558,12 @@ static inline void sort_channels(struct iw_freq *freq, int num) * @param extra A pointer to extra data buf * @return 0 --success, otherwise fail */ -static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_range(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { int i, j; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct iw_range *range = (struct iw_range *)extra; struct chan_freq_power *cfp; u8 rates[MAX_RATES + 1]; @@ -589,7 +589,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, range->num_frequency = 0; if (priv->adapter->enable11d && - adapter->connect_status == LIBERTAS_CONNECTED) { + adapter->connect_status == LBS_CONNECTED) { u8 chan_no; u8 band; @@ -610,7 +610,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, lbs_deb_wext("chan_no %d\n", chan_no); range->freq[range->num_frequency].i = (long)chan_no; range->freq[range->num_frequency].m = - (long)libertas_chan_2_freq(chan_no, band) * 100000; + (long)lbs_chan_2_freq(chan_no, band) * 100000; range->freq[range->num_frequency].e = 1; range->num_frequency++; } @@ -735,11 +735,11 @@ out: return 0; } -static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_power(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -748,9 +748,9 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, */ if (vwrq->disabled) { - adapter->psmode = WLAN802_11POWERMODECAM; + adapter->psmode = LBS802_11POWERMODECAM; if (adapter->psstate != PS_STATE_FULL_POWER) { - libertas_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); + lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); } return 0; @@ -765,33 +765,33 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, return -EINVAL; } - if (adapter->psmode != WLAN802_11POWERMODECAM) { + if (adapter->psmode != LBS802_11POWERMODECAM) { return 0; } - adapter->psmode = WLAN802_11POWERMODEMAX_PSP; + adapter->psmode = LBS802_11POWERMODEMAX_PSP; - if (adapter->connect_status == LIBERTAS_CONNECTED) { - libertas_ps_sleep(priv, CMD_OPTION_WAITFORRSP); + if (adapter->connect_status == LBS_CONNECTED) { + lbs_ps_sleep(priv, CMD_OPTION_WAITFORRSP); } lbs_deb_leave(LBS_DEB_WEXT); return 0; } -static int wlan_get_power(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_power(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int mode; lbs_deb_enter(LBS_DEB_WEXT); mode = adapter->psmode; - if ((vwrq->disabled = (mode == WLAN802_11POWERMODECAM)) - || adapter->connect_status == LIBERTAS_DISCONNECTED) + if ((vwrq->disabled = (mode == LBS802_11POWERMODECAM)) + || adapter->connect_status == LBS_DISCONNECTED) { goto out; } @@ -803,7 +803,7 @@ out: return 0; } -static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) +static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev) { enum { POOR = 30, @@ -813,8 +813,8 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) EXCELLENT = 95, PERFECT = 100 }; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; u32 rssi_qual; u32 tx_qual; u32 quality = 0; @@ -827,7 +827,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) priv->wstats.status = adapter->mode; /* If we're not associated, all quality values are meaningless */ - if (adapter->connect_status != LIBERTAS_CONNECTED) + if (adapter->connect_status != LBS_CONNECTED) goto out; /* Quality by RSSI */ @@ -890,9 +890,9 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) stats_valid = 1; /* update stats asynchronously for future calls */ - libertas_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, + lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, 0, 0, NULL); - libertas_prepare_and_send_command(priv, CMD_802_11_GET_LOG, 0, + lbs_prepare_and_send_command(priv, CMD_802_11_GET_LOG, 0, 0, 0, NULL); out: if (!stats_valid) { @@ -912,19 +912,19 @@ out: } -static int wlan_set_freq(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info, struct iw_freq *fwrq, char *extra) { int ret = -EINVAL; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct chan_freq_power *cfp; struct assoc_request * assoc_req; lbs_deb_enter(LBS_DEB_WEXT); mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; goto out; @@ -949,7 +949,7 @@ static int wlan_set_freq(struct net_device *dev, struct iw_request_info *info, goto out; } - cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, fwrq->m); + cfp = lbs_find_cfp_by_band_and_channel(adapter, 0, fwrq->m); if (!cfp) { goto out; } @@ -960,9 +960,9 @@ static int wlan_set_freq(struct net_device *dev, struct iw_request_info *info, out: if (ret == 0) { set_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } else { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } mutex_unlock(&adapter->lock); @@ -970,11 +970,11 @@ out: return ret; } -static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; u32 new_rate; u16 action; int ret = -EINVAL; @@ -1006,7 +1006,7 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, adapter->auto_rate = 0; } - ret = libertas_prepare_and_send_command(priv, CMD_802_11_DATA_RATE, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_DATA_RATE, action, CMD_OPTION_WAITFORRSP, 0, NULL); out: @@ -1014,15 +1014,15 @@ out: return ret; } -static int wlan_get_rate(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); - if (adapter->connect_status == LIBERTAS_CONNECTED) { + if (adapter->connect_status == LBS_CONNECTED) { vwrq->value = adapter->cur_rate * 500000; if (adapter->auto_rate) @@ -1039,12 +1039,12 @@ static int wlan_get_rate(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_set_mode(struct net_device *dev, +static int lbs_set_mode(struct net_device *dev, struct iw_request_info *info, u32 * uwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct assoc_request * assoc_req; lbs_deb_enter(LBS_DEB_WEXT); @@ -1058,14 +1058,14 @@ static int wlan_set_mode(struct net_device *dev, } mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } else { assoc_req->mode = *uwrq; set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); lbs_deb_wext("Switching to mode: 0x%x\n", *uwrq); } mutex_unlock(&adapter->lock); @@ -1085,12 +1085,12 @@ out: * @param extra A pointer to extra data buf * @return 0 --success, otherwise fail */ -static int wlan_get_encode(struct net_device *dev, +static int lbs_get_encode(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, u8 * extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; lbs_deb_enter(LBS_DEB_WEXT); @@ -1171,7 +1171,7 @@ static int wlan_get_encode(struct net_device *dev, * @param set_tx_key Force set TX key (1 = yes, 0 = no) * @return 0 --success, otherwise fail */ -static int wlan_set_wep_key(struct assoc_request *assoc_req, +static int lbs_set_wep_key(struct assoc_request *assoc_req, const char *key_material, u16 key_length, u16 index, @@ -1289,20 +1289,20 @@ static void disable_wpa(struct assoc_request *assoc_req) * @param extra A pointer to extra data buf * @return 0 --success, otherwise fail */ -static int wlan_set_encode(struct net_device *dev, +static int lbs_set_encode(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct assoc_request * assoc_req; u16 is_default = 0, index = 0, set_tx_key = 0; lbs_deb_enter(LBS_DEB_WEXT); mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; goto out; @@ -1328,7 +1328,7 @@ static int wlan_set_encode(struct net_device *dev, if (!assoc_req->secinfo.wep_enabled || (dwrq->length == 0 && !is_default)) set_tx_key = 1; - ret = wlan_set_wep_key(assoc_req, extra, dwrq->length, index, set_tx_key); + ret = lbs_set_wep_key(assoc_req, extra, dwrq->length, index, set_tx_key); if (ret) goto out; @@ -1346,9 +1346,9 @@ static int wlan_set_encode(struct net_device *dev, out: if (ret == 0) { set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } else { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } mutex_unlock(&adapter->lock); @@ -1365,14 +1365,14 @@ out: * @param extra A pointer to extra data buf * @return 0 on success, otherwise failure */ -static int wlan_get_encodeext(struct net_device *dev, +static int lbs_get_encodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { int ret = -EINVAL; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; int index, max_key_len; @@ -1472,14 +1472,14 @@ out: * @param extra A pointer to extra data buf * @return 0 --success, otherwise fail */ -static int wlan_set_encodeext(struct net_device *dev, +static int lbs_set_encodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; int alg = ext->alg; struct assoc_request * assoc_req; @@ -1487,7 +1487,7 @@ static int wlan_set_encodeext(struct net_device *dev, lbs_deb_enter(LBS_DEB_WEXT); mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; goto out; @@ -1514,7 +1514,7 @@ static int wlan_set_encodeext(struct net_device *dev, set_tx_key = 1; /* Copy key to driver */ - ret = wlan_set_wep_key (assoc_req, ext->key, ext->key_len, index, + ret = lbs_set_wep_key(assoc_req, ext->key, ext->key_len, index, set_tx_key); if (ret) goto out; @@ -1587,9 +1587,9 @@ static int wlan_set_encodeext(struct net_device *dev, out: if (ret == 0) { - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } else { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } mutex_unlock(&adapter->lock); @@ -1598,20 +1598,20 @@ out: } -static int wlan_set_genie(struct net_device *dev, +static int lbs_set_genie(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int ret = 0; struct assoc_request * assoc_req; lbs_deb_enter(LBS_DEB_WEXT); mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; goto out; @@ -1634,9 +1634,9 @@ static int wlan_set_genie(struct net_device *dev, out: if (ret == 0) { set_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } else { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } mutex_unlock(&adapter->lock); @@ -1644,14 +1644,14 @@ out: return ret; } -static int wlan_get_genie(struct net_device *dev, +static int lbs_get_genie(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -1674,13 +1674,13 @@ out: } -static int wlan_set_auth(struct net_device *dev, +static int lbs_set_auth(struct net_device *dev, struct iw_request_info *info, struct iw_param *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct assoc_request * assoc_req; int ret = 0; int updated = 0; @@ -1688,7 +1688,7 @@ static int wlan_set_auth(struct net_device *dev, lbs_deb_enter(LBS_DEB_WEXT); mutex_lock(&adapter->lock); - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; goto out; @@ -1763,9 +1763,9 @@ out: if (ret == 0) { if (updated) set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } else if (ret != -EOPNOTSUPP) { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } mutex_unlock(&adapter->lock); @@ -1773,14 +1773,14 @@ out: return ret; } -static int wlan_get_auth(struct net_device *dev, +static int lbs_get_auth(struct net_device *dev, struct iw_request_info *info, struct iw_param *dwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -1813,25 +1813,25 @@ static int wlan_get_auth(struct net_device *dev, } -static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) { int ret = 0; - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; u16 dbm; lbs_deb_enter(LBS_DEB_WEXT); if (vwrq->disabled) { - wlan_radio_ioctl(priv, RADIO_OFF); + lbs_radio_ioctl(priv, RADIO_OFF); return 0; } adapter->preamble = CMD_TYPE_AUTO_PREAMBLE; - wlan_radio_ioctl(priv, RADIO_ON); + lbs_radio_ioctl(priv, RADIO_ON); /* Userspace check in iwrange if it should use dBm or mW, * therefore this should never happen... Jean II */ @@ -1847,7 +1847,7 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, lbs_deb_wext("txpower set %d dbm\n", dbm); - ret = libertas_prepare_and_send_command(priv, + ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_TX_POWER, CMD_ACT_TX_POWER_OPT_SET_LOW, CMD_OPTION_WAITFORRSP, 0, (void *)&dbm); @@ -1856,11 +1856,11 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, return ret; } -static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, +static int lbs_get_essid(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; lbs_deb_enter(LBS_DEB_WEXT); @@ -1872,7 +1872,7 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, /* * Get the current SSID */ - if (adapter->connect_status == LIBERTAS_CONNECTED) { + if (adapter->connect_status == LBS_CONNECTED) { memcpy(extra, adapter->curbssparams.ssid, adapter->curbssparams.ssid_len); extra[adapter->curbssparams.ssid_len] = '\0'; @@ -1892,11 +1892,11 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, return 0; } -static int wlan_set_essid(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; int ret = 0; u8 ssid[IW_ESSID_MAX_SIZE]; u8 ssid_len = 0; @@ -1932,7 +1932,7 @@ out: mutex_lock(&adapter->lock); if (ret == 0) { /* Get or create the current association request */ - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { ret = -ENOMEM; } else { @@ -1940,13 +1940,13 @@ out: memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE); assoc_req->ssid_len = ssid_len; set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } } /* Cancel the association request if there was an error */ if (ret != 0) { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); } mutex_unlock(&adapter->lock); @@ -1964,11 +1964,11 @@ out: * @param extra A pointer to extra data buf * @return 0 --success, otherwise fail */ -static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info, +static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info, struct sockaddr *awrq, char *extra) { - wlan_private *priv = dev->priv; - wlan_adapter *adapter = priv->adapter; + lbs_private *priv = dev->priv; + lbs_adapter *adapter = priv->adapter; struct assoc_request * assoc_req; int ret = 0; DECLARE_MAC_BUF(mac); @@ -1983,15 +1983,15 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info, mutex_lock(&adapter->lock); /* Get or create the current association request */ - assoc_req = wlan_get_association_request(adapter); + assoc_req = lbs_get_association_request(adapter); if (!assoc_req) { - libertas_cancel_association_work(priv); + lbs_cancel_association_work(priv); ret = -ENOMEM; } else { /* Copy the BSSID to the association request */ memcpy(&assoc_req->bssid, awrq->sa_data, ETH_ALEN); set_bit(ASSOC_FLAG_BSSID, &assoc_req->flags); - libertas_postpone_association_work(priv); + lbs_postpone_association_work(priv); } mutex_unlock(&adapter->lock); @@ -1999,7 +1999,7 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info, return ret; } -void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen) +void lbs_get_fwversion(lbs_adapter *adapter, char *fwversion, int maxlen) { char fwver[32]; @@ -2025,19 +2025,19 @@ void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen) /* * iwconfig settable callbacks */ -static const iw_handler wlan_handler[] = { +static const iw_handler lbs_handler[] = { (iw_handler) NULL, /* SIOCSIWCOMMIT */ - (iw_handler) wlan_get_name, /* SIOCGIWNAME */ + (iw_handler) lbs_get_name, /* SIOCGIWNAME */ (iw_handler) NULL, /* SIOCSIWNWID */ (iw_handler) NULL, /* SIOCGIWNWID */ - (iw_handler) wlan_set_freq, /* SIOCSIWFREQ */ - (iw_handler) wlan_get_freq, /* SIOCGIWFREQ */ - (iw_handler) wlan_set_mode, /* SIOCSIWMODE */ - (iw_handler) wlan_get_mode, /* SIOCGIWMODE */ + (iw_handler) lbs_set_freq, /* SIOCSIWFREQ */ + (iw_handler) lbs_get_freq, /* SIOCGIWFREQ */ + (iw_handler) lbs_set_mode, /* SIOCSIWMODE */ + (iw_handler) lbs_get_mode, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ - (iw_handler) wlan_get_range, /* SIOCGIWRANGE */ + (iw_handler) lbs_get_range, /* SIOCGIWRANGE */ (iw_handler) NULL, /* SIOCSIWPRIV */ (iw_handler) NULL, /* SIOCGIWPRIV */ (iw_handler) NULL, /* SIOCSIWSTATS */ @@ -2046,56 +2046,56 @@ static const iw_handler wlan_handler[] = { iw_handler_get_spy, /* SIOCGIWSPY */ iw_handler_set_thrspy, /* SIOCSIWTHRSPY */ iw_handler_get_thrspy, /* SIOCGIWTHRSPY */ - (iw_handler) wlan_set_wap, /* SIOCSIWAP */ - (iw_handler) wlan_get_wap, /* SIOCGIWAP */ + (iw_handler) lbs_set_wap, /* SIOCSIWAP */ + (iw_handler) lbs_get_wap, /* SIOCGIWAP */ (iw_handler) NULL, /* SIOCSIWMLME */ (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ - (iw_handler) libertas_set_scan, /* SIOCSIWSCAN */ - (iw_handler) libertas_get_scan, /* SIOCGIWSCAN */ - (iw_handler) wlan_set_essid, /* SIOCSIWESSID */ - (iw_handler) wlan_get_essid, /* SIOCGIWESSID */ - (iw_handler) wlan_set_nick, /* SIOCSIWNICKN */ - (iw_handler) wlan_get_nick, /* SIOCGIWNICKN */ + (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */ + (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */ + (iw_handler) lbs_set_essid, /* SIOCSIWESSID */ + (iw_handler) lbs_get_essid, /* SIOCGIWESSID */ + (iw_handler) lbs_set_nick, /* SIOCSIWNICKN */ + (iw_handler) lbs_get_nick, /* SIOCGIWNICKN */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ - (iw_handler) wlan_set_rate, /* SIOCSIWRATE */ - (iw_handler) wlan_get_rate, /* SIOCGIWRATE */ - (iw_handler) wlan_set_rts, /* SIOCSIWRTS */ - (iw_handler) wlan_get_rts, /* SIOCGIWRTS */ - (iw_handler) wlan_set_frag, /* SIOCSIWFRAG */ - (iw_handler) wlan_get_frag, /* SIOCGIWFRAG */ - (iw_handler) wlan_set_txpow, /* SIOCSIWTXPOW */ - (iw_handler) wlan_get_txpow, /* SIOCGIWTXPOW */ - (iw_handler) wlan_set_retry, /* SIOCSIWRETRY */ - (iw_handler) wlan_get_retry, /* SIOCGIWRETRY */ - (iw_handler) wlan_set_encode, /* SIOCSIWENCODE */ - (iw_handler) wlan_get_encode, /* SIOCGIWENCODE */ - (iw_handler) wlan_set_power, /* SIOCSIWPOWER */ - (iw_handler) wlan_get_power, /* SIOCGIWPOWER */ + (iw_handler) lbs_set_rate, /* SIOCSIWRATE */ + (iw_handler) lbs_get_rate, /* SIOCGIWRATE */ + (iw_handler) lbs_set_rts, /* SIOCSIWRTS */ + (iw_handler) lbs_get_rts, /* SIOCGIWRTS */ + (iw_handler) lbs_set_frag, /* SIOCSIWFRAG */ + (iw_handler) lbs_get_frag, /* SIOCGIWFRAG */ + (iw_handler) lbs_set_txpow, /* SIOCSIWTXPOW */ + (iw_handler) lbs_get_txpow, /* SIOCGIWTXPOW */ + (iw_handler) lbs_set_retry, /* SIOCSIWRETRY */ + (iw_handler) lbs_get_retry, /* SIOCGIWRETRY */ + (iw_handler) lbs_set_encode, /* SIOCSIWENCODE */ + (iw_handler) lbs_get_encode, /* SIOCGIWENCODE */ + (iw_handler) lbs_set_power, /* SIOCSIWPOWER */ + (iw_handler) lbs_get_power, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ - (iw_handler) wlan_set_genie, /* SIOCSIWGENIE */ - (iw_handler) wlan_get_genie, /* SIOCGIWGENIE */ - (iw_handler) wlan_set_auth, /* SIOCSIWAUTH */ - (iw_handler) wlan_get_auth, /* SIOCGIWAUTH */ - (iw_handler) wlan_set_encodeext,/* SIOCSIWENCODEEXT */ - (iw_handler) wlan_get_encodeext,/* SIOCGIWENCODEEXT */ + (iw_handler) lbs_set_genie, /* SIOCSIWGENIE */ + (iw_handler) lbs_get_genie, /* SIOCGIWGENIE */ + (iw_handler) lbs_set_auth, /* SIOCSIWAUTH */ + (iw_handler) lbs_get_auth, /* SIOCGIWAUTH */ + (iw_handler) lbs_set_encodeext,/* SIOCSIWENCODEEXT */ + (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ (iw_handler) NULL, /* SIOCSIWPMKSA */ }; static const iw_handler mesh_wlan_handler[] = { (iw_handler) NULL, /* SIOCSIWCOMMIT */ - (iw_handler) wlan_get_name, /* SIOCGIWNAME */ + (iw_handler) lbs_get_name, /* SIOCGIWNAME */ (iw_handler) NULL, /* SIOCSIWNWID */ (iw_handler) NULL, /* SIOCGIWNWID */ - (iw_handler) wlan_set_freq, /* SIOCSIWFREQ */ - (iw_handler) wlan_get_freq, /* SIOCGIWFREQ */ + (iw_handler) lbs_set_freq, /* SIOCSIWFREQ */ + (iw_handler) lbs_get_freq, /* SIOCGIWFREQ */ (iw_handler) NULL, /* SIOCSIWMODE */ (iw_handler) mesh_wlan_get_mode, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ - (iw_handler) wlan_get_range, /* SIOCGIWRANGE */ + (iw_handler) lbs_get_range, /* SIOCGIWRANGE */ (iw_handler) NULL, /* SIOCSIWPRIV */ (iw_handler) NULL, /* SIOCGIWPRIV */ (iw_handler) NULL, /* SIOCSIWSTATS */ @@ -2108,46 +2108,46 @@ static const iw_handler mesh_wlan_handler[] = { (iw_handler) NULL, /* SIOCGIWAP */ (iw_handler) NULL, /* SIOCSIWMLME */ (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ - (iw_handler) libertas_set_scan, /* SIOCSIWSCAN */ - (iw_handler) libertas_get_scan, /* SIOCGIWSCAN */ + (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */ + (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */ (iw_handler) NULL, /* SIOCSIWESSID */ (iw_handler) NULL, /* SIOCGIWESSID */ (iw_handler) NULL, /* SIOCSIWNICKN */ (iw_handler) mesh_get_nick, /* SIOCGIWNICKN */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ - (iw_handler) wlan_set_rate, /* SIOCSIWRATE */ - (iw_handler) wlan_get_rate, /* SIOCGIWRATE */ - (iw_handler) wlan_set_rts, /* SIOCSIWRTS */ - (iw_handler) wlan_get_rts, /* SIOCGIWRTS */ - (iw_handler) wlan_set_frag, /* SIOCSIWFRAG */ - (iw_handler) wlan_get_frag, /* SIOCGIWFRAG */ - (iw_handler) wlan_set_txpow, /* SIOCSIWTXPOW */ - (iw_handler) wlan_get_txpow, /* SIOCGIWTXPOW */ - (iw_handler) wlan_set_retry, /* SIOCSIWRETRY */ - (iw_handler) wlan_get_retry, /* SIOCGIWRETRY */ - (iw_handler) wlan_set_encode, /* SIOCSIWENCODE */ - (iw_handler) wlan_get_encode, /* SIOCGIWENCODE */ - (iw_handler) wlan_set_power, /* SIOCSIWPOWER */ - (iw_handler) wlan_get_power, /* SIOCGIWPOWER */ + (iw_handler) lbs_set_rate, /* SIOCSIWRATE */ + (iw_handler) lbs_get_rate, /* SIOCGIWRATE */ + (iw_handler) lbs_set_rts, /* SIOCSIWRTS */ + (iw_handler) lbs_get_rts, /* SIOCGIWRTS */ + (iw_handler) lbs_set_frag, /* SIOCSIWFRAG */ + (iw_handler) lbs_get_frag, /* SIOCGIWFRAG */ + (iw_handler) lbs_set_txpow, /* SIOCSIWTXPOW */ + (iw_handler) lbs_get_txpow, /* SIOCGIWTXPOW */ + (iw_handler) lbs_set_retry, /* SIOCSIWRETRY */ + (iw_handler) lbs_get_retry, /* SIOCGIWRETRY */ + (iw_handler) lbs_set_encode, /* SIOCSIWENCODE */ + (iw_handler) lbs_get_encode, /* SIOCGIWENCODE */ + (iw_handler) lbs_set_power, /* SIOCSIWPOWER */ + (iw_handler) lbs_get_power, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ - (iw_handler) wlan_set_genie, /* SIOCSIWGENIE */ - (iw_handler) wlan_get_genie, /* SIOCGIWGENIE */ - (iw_handler) wlan_set_auth, /* SIOCSIWAUTH */ - (iw_handler) wlan_get_auth, /* SIOCGIWAUTH */ - (iw_handler) wlan_set_encodeext,/* SIOCSIWENCODEEXT */ - (iw_handler) wlan_get_encodeext,/* SIOCGIWENCODEEXT */ + (iw_handler) lbs_set_genie, /* SIOCSIWGENIE */ + (iw_handler) lbs_get_genie, /* SIOCGIWGENIE */ + (iw_handler) lbs_set_auth, /* SIOCSIWAUTH */ + (iw_handler) lbs_get_auth, /* SIOCGIWAUTH */ + (iw_handler) lbs_set_encodeext,/* SIOCSIWENCODEEXT */ + (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ (iw_handler) NULL, /* SIOCSIWPMKSA */ }; -struct iw_handler_def libertas_handler_def = { - .num_standard = ARRAY_SIZE(wlan_handler), - .standard = (iw_handler *) wlan_handler, - .get_wireless_stats = wlan_get_wireless_stats, +struct iw_handler_def lbs_handler_def = { + .num_standard = ARRAY_SIZE(lbs_handler), + .standard = (iw_handler *) lbs_handler, + .get_wireless_stats = lbs_get_wireless_stats, }; struct iw_handler_def mesh_handler_def = { .num_standard = ARRAY_SIZE(mesh_wlan_handler), .standard = (iw_handler *) mesh_wlan_handler, - .get_wireless_stats = wlan_get_wireless_stats, + .get_wireless_stats = lbs_get_wireless_stats, }; diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h index 6aa444c7de8d..a563d9a231b6 100644 --- a/drivers/net/wireless/libertas/wext.h +++ b/drivers/net/wireless/libertas/wext.h @@ -1,11 +1,11 @@ /** * This file contains definition for IOCTL call. */ -#ifndef _WLAN_WEXT_H_ -#define _WLAN_WEXT_H_ +#ifndef _LBS_WEXT_H_ +#define _LBS_WEXT_H_ -/** wlan_ioctl_regrdwr */ -struct wlan_ioctl_regrdwr { +/** lbs_ioctl_regrdwr */ +struct lbs_ioctl_regrdwr { /** Which register to access */ u16 whichreg; /** Read or Write */ @@ -15,9 +15,9 @@ struct wlan_ioctl_regrdwr { u32 value; }; -#define WLAN_MONITOR_OFF 0 +#define LBS_MONITOR_OFF 0 -extern struct iw_handler_def libertas_handler_def; +extern struct iw_handler_def lbs_handler_def; extern struct iw_handler_def mesh_handler_def; -#endif /* _WLAN_WEXT_H_ */ +#endif |