aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/scan.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-11-15 18:05:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:46 -0500
commit1007832103d016d1563fab71d4cf2b057a0bcceb (patch)
tree3b5080b01bee6e1f98cc9489382c534e963ac748 /drivers/net/wireless/libertas/scan.c
parent9a62f73b1a3bbd35a6f84fcd6636e672b09981ec (diff)
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/scan.c')
-rw-r--r--drivers/net/wireless/libertas/scan.c184
1 files changed, 92 insertions, 92 deletions
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 @@
39//! Memory needed to store a max number/size SSID TLV for a firmware scan 39//! Memory needed to store a max number/size SSID TLV for a firmware scan
40#define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvlietypes_ssidparamset)) 40#define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvlietypes_ssidparamset))
41 41
42//! Maximum memory needed for a wlan_scan_cmd_config with all TLVs at max 42//! Maximum memory needed for a lbs_scan_cmd_config with all TLVs at max
43#define MAX_SCAN_CFG_ALLOC (sizeof(struct wlan_scan_cmd_config) \ 43#define MAX_SCAN_CFG_ALLOC (sizeof(struct lbs_scan_cmd_config) \
44 + sizeof(struct mrvlietypes_numprobes) \ 44 + sizeof(struct mrvlietypes_numprobes) \
45 + CHAN_TLV_MAX_SIZE \ 45 + CHAN_TLV_MAX_SIZE \
46 + SSID_TLV_MAX_SIZE) 46 + SSID_TLV_MAX_SIZE)
@@ -80,7 +80,7 @@ static inline void clear_bss_descriptor (struct bss_descriptor * bss)
80 memset(bss, 0, offsetof(struct bss_descriptor, list)); 80 memset(bss, 0, offsetof(struct bss_descriptor, list));
81} 81}
82 82
83static inline int match_bss_no_security(struct wlan_802_11_security * secinfo, 83static inline int match_bss_no_security(struct lbs_802_11_security *secinfo,
84 struct bss_descriptor * match_bss) 84 struct bss_descriptor * match_bss)
85{ 85{
86 if ( !secinfo->wep_enabled 86 if ( !secinfo->wep_enabled
@@ -94,7 +94,7 @@ static inline int match_bss_no_security(struct wlan_802_11_security * secinfo,
94 return 0; 94 return 0;
95} 95}
96 96
97static inline int match_bss_static_wep(struct wlan_802_11_security * secinfo, 97static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo,
98 struct bss_descriptor * match_bss) 98 struct bss_descriptor * match_bss)
99{ 99{
100 if ( secinfo->wep_enabled 100 if ( secinfo->wep_enabled
@@ -106,7 +106,7 @@ static inline int match_bss_static_wep(struct wlan_802_11_security * secinfo,
106 return 0; 106 return 0;
107} 107}
108 108
109static inline int match_bss_wpa(struct wlan_802_11_security * secinfo, 109static inline int match_bss_wpa(struct lbs_802_11_security *secinfo,
110 struct bss_descriptor * match_bss) 110 struct bss_descriptor * match_bss)
111{ 111{
112 if ( !secinfo->wep_enabled 112 if ( !secinfo->wep_enabled
@@ -121,7 +121,7 @@ static inline int match_bss_wpa(struct wlan_802_11_security * secinfo,
121 return 0; 121 return 0;
122} 122}
123 123
124static inline int match_bss_wpa2(struct wlan_802_11_security * secinfo, 124static inline int match_bss_wpa2(struct lbs_802_11_security *secinfo,
125 struct bss_descriptor * match_bss) 125 struct bss_descriptor * match_bss)
126{ 126{
127 if ( !secinfo->wep_enabled 127 if ( !secinfo->wep_enabled
@@ -136,7 +136,7 @@ static inline int match_bss_wpa2(struct wlan_802_11_security * secinfo,
136 return 0; 136 return 0;
137} 137}
138 138
139static inline int match_bss_dynamic_wep(struct wlan_802_11_security * secinfo, 139static inline int match_bss_dynamic_wep(struct lbs_802_11_security *secinfo,
140 struct bss_descriptor * match_bss) 140 struct bss_descriptor * match_bss)
141{ 141{
142 if ( !secinfo->wep_enabled 142 if ( !secinfo->wep_enabled
@@ -163,13 +163,13 @@ static inline int match_bss_dynamic_wep(struct wlan_802_11_security * secinfo,
163 * 0 0 0 0 !=NONE 1 0 0 yes Dynamic WEP 163 * 0 0 0 0 !=NONE 1 0 0 yes Dynamic WEP
164 * 164 *
165 * 165 *
166 * @param adapter A pointer to wlan_adapter 166 * @param adapter A pointer to lbs_adapter
167 * @param index Index in scantable to check against current driver settings 167 * @param index Index in scantable to check against current driver settings
168 * @param mode Network mode: Infrastructure or IBSS 168 * @param mode Network mode: Infrastructure or IBSS
169 * 169 *
170 * @return Index in scantable, or error code if negative 170 * @return Index in scantable, or error code if negative
171 */ 171 */
172static int is_network_compatible(wlan_adapter * adapter, 172static int is_network_compatible(lbs_adapter *adapter,
173 struct bss_descriptor * bss, u8 mode) 173 struct bss_descriptor * bss, u8 mode)
174{ 174{
175 int matched = 0; 175 int matched = 0;
@@ -235,7 +235,7 @@ done:
235 * 235 *
236 * @return 0--ssid is same, otherwise is different 236 * @return 0--ssid is same, otherwise is different
237 */ 237 */
238int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len) 238int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len)
239{ 239{
240 if (ssid1_len != ssid2_len) 240 if (ssid1_len != ssid2_len)
241 return -1; 241 return -1;
@@ -256,13 +256,13 @@ int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len)
256/** 256/**
257 * @brief Create a channel list for the driver to scan based on region info 257 * @brief Create a channel list for the driver to scan based on region info
258 * 258 *
259 * Only used from wlan_scan_setup_scan_config() 259 * Only used from lbs_scan_setup_scan_config()
260 * 260 *
261 * Use the driver region/band information to construct a comprehensive list 261 * Use the driver region/band information to construct a comprehensive list
262 * of channels to scan. This routine is used for any scan that is not 262 * of channels to scan. This routine is used for any scan that is not
263 * provided a specific channel list to scan. 263 * provided a specific channel list to scan.
264 * 264 *
265 * @param priv A pointer to wlan_private structure 265 * @param priv A pointer to lbs_private structure
266 * @param scanchanlist Output parameter: resulting channel list to scan 266 * @param scanchanlist Output parameter: resulting channel list to scan
267 * @param filteredscan Flag indicating whether or not a BSSID or SSID filter 267 * @param filteredscan Flag indicating whether or not a BSSID or SSID filter
268 * is being sent in the command to firmware. Used to 268 * 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)
272 * 272 *
273 * @return void 273 * @return void
274 */ 274 */
275static void wlan_scan_create_channel_list(wlan_private * priv, 275static void lbs_scan_create_channel_list(lbs_private *priv,
276 struct chanscanparamset * scanchanlist, 276 struct chanscanparamset * scanchanlist,
277 u8 filteredscan) 277 u8 filteredscan)
278{ 278{
279 279
280 wlan_adapter *adapter = priv->adapter; 280 lbs_adapter *adapter = priv->adapter;
281 struct region_channel *scanregion; 281 struct region_channel *scanregion;
282 struct chan_freq_power *cfp; 282 struct chan_freq_power *cfp;
283 int rgnidx; 283 int rgnidx;
@@ -297,7 +297,7 @@ static void wlan_scan_create_channel_list(wlan_private * priv,
297 297
298 for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) { 298 for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) {
299 if (priv->adapter->enable11d && 299 if (priv->adapter->enable11d &&
300 adapter->connect_status != LIBERTAS_CONNECTED) { 300 adapter->connect_status != LBS_CONNECTED) {
301 /* Scan all the supported chan for the first scan */ 301 /* Scan all the supported chan for the first scan */
302 if (!adapter->universal_channel[rgnidx].valid) 302 if (!adapter->universal_channel[rgnidx].valid)
303 continue; 303 continue;
@@ -319,7 +319,7 @@ static void wlan_scan_create_channel_list(wlan_private * priv,
319 319
320 if (priv->adapter->enable11d) { 320 if (priv->adapter->enable11d) {
321 scantype = 321 scantype =
322 libertas_get_scan_type_11d(cfp->channel, 322 lbs_get_scan_type_11d(cfp->channel,
323 &adapter-> 323 &adapter->
324 parsed_region_chan); 324 parsed_region_chan);
325 } 325 }
@@ -357,24 +357,24 @@ static void wlan_scan_create_channel_list(wlan_private * priv,
357 357
358 358
359/* Delayed partial scan worker */ 359/* Delayed partial scan worker */
360void libertas_scan_worker(struct work_struct *work) 360void lbs_scan_worker(struct work_struct *work)
361{ 361{
362 wlan_private *priv = container_of(work, wlan_private, scan_work.work); 362 lbs_private *priv = container_of(work, lbs_private, scan_work.work);
363 363
364 wlan_scan_networks(priv, NULL, 0); 364 lbs_scan_networks(priv, NULL, 0);
365} 365}
366 366
367 367
368/** 368/**
369 * @brief Construct a wlan_scan_cmd_config structure to use in issue scan cmds 369 * @brief Construct a lbs_scan_cmd_config structure to use in issue scan cmds
370 * 370 *
371 * Application layer or other functions can invoke wlan_scan_networks 371 * Application layer or other functions can invoke lbs_scan_networks
372 * with a scan configuration supplied in a wlan_ioctl_user_scan_cfg struct. 372 * with a scan configuration supplied in a lbs_ioctl_user_scan_cfg struct.
373 * This structure is used as the basis of one or many wlan_scan_cmd_config 373 * This structure is used as the basis of one or many lbs_scan_cmd_config
374 * commands that are sent to the command processing module and sent to 374 * commands that are sent to the command processing module and sent to
375 * firmware. 375 * firmware.
376 * 376 *
377 * Create a wlan_scan_cmd_config based on the following user supplied 377 * Create a lbs_scan_cmd_config based on the following user supplied
378 * parameters (if present): 378 * parameters (if present):
379 * - SSID filter 379 * - SSID filter
380 * - BSSID filter 380 * - BSSID filter
@@ -385,7 +385,7 @@ void libertas_scan_worker(struct work_struct *work)
385 * If the number of probes is not set, use the adapter default setting 385 * If the number of probes is not set, use the adapter default setting
386 * Qualify the channel 386 * Qualify the channel
387 * 387 *
388 * @param priv A pointer to wlan_private structure 388 * @param priv A pointer to lbs_private structure
389 * @param puserscanin NULL or pointer to scan configuration parameters 389 * @param puserscanin NULL or pointer to scan configuration parameters
390 * @param ppchantlvout Output parameter: Pointer to the start of the 390 * @param ppchantlvout Output parameter: Pointer to the start of the
391 * channel TLV portion of the output scan config 391 * channel TLV portion of the output scan config
@@ -403,9 +403,9 @@ void libertas_scan_worker(struct work_struct *work)
403 * 403 *
404 * @return resulting scan configuration 404 * @return resulting scan configuration
405 */ 405 */
406static struct wlan_scan_cmd_config * 406static struct lbs_scan_cmd_config *
407wlan_scan_setup_scan_config(wlan_private * priv, 407lbs_scan_setup_scan_config(lbs_private *priv,
408 const struct wlan_ioctl_user_scan_cfg * puserscanin, 408 const struct lbs_ioctl_user_scan_cfg *puserscanin,
409 struct mrvlietypes_chanlistparamset ** ppchantlvout, 409 struct mrvlietypes_chanlistparamset ** ppchantlvout,
410 struct chanscanparamset * pscanchanlist, 410 struct chanscanparamset * pscanchanlist,
411 int *pmaxchanperscan, 411 int *pmaxchanperscan,
@@ -414,7 +414,7 @@ wlan_scan_setup_scan_config(wlan_private * priv,
414{ 414{
415 struct mrvlietypes_numprobes *pnumprobestlv; 415 struct mrvlietypes_numprobes *pnumprobestlv;
416 struct mrvlietypes_ssidparamset *pssidtlv; 416 struct mrvlietypes_ssidparamset *pssidtlv;
417 struct wlan_scan_cmd_config * pscancfgout = NULL; 417 struct lbs_scan_cmd_config *pscancfgout = NULL;
418 u8 *ptlvpos; 418 u8 *ptlvpos;
419 u16 numprobes; 419 u16 numprobes;
420 int chanidx; 420 int chanidx;
@@ -523,13 +523,13 @@ wlan_scan_setup_scan_config(wlan_private * priv,
523 if (!puserscanin || !puserscanin->chanlist[0].channumber) { 523 if (!puserscanin || !puserscanin->chanlist[0].channumber) {
524 /* Create a default channel scan list */ 524 /* Create a default channel scan list */
525 lbs_deb_scan("creating full region channel list\n"); 525 lbs_deb_scan("creating full region channel list\n");
526 wlan_scan_create_channel_list(priv, pscanchanlist, 526 lbs_scan_create_channel_list(priv, pscanchanlist,
527 *pfilteredscan); 527 *pfilteredscan);
528 goto out; 528 goto out;
529 } 529 }
530 530
531 for (chanidx = 0; 531 for (chanidx = 0;
532 chanidx < WLAN_IOCTL_USER_SCAN_CHAN_MAX 532 chanidx < LBS_IOCTL_USER_SCAN_CHAN_MAX
533 && puserscanin->chanlist[chanidx].channumber; chanidx++) { 533 && puserscanin->chanlist[chanidx].channumber; chanidx++) {
534 534
535 channel = puserscanin->chanlist[chanidx].channumber; 535 channel = puserscanin->chanlist[chanidx].channumber;
@@ -579,14 +579,14 @@ out:
579/** 579/**
580 * @brief Construct and send multiple scan config commands to the firmware 580 * @brief Construct and send multiple scan config commands to the firmware
581 * 581 *
582 * Only used from wlan_scan_networks() 582 * Only used from lbs_scan_networks()
583 * 583 *
584 * Previous routines have created a wlan_scan_cmd_config with any requested 584 * Previous routines have created a lbs_scan_cmd_config with any requested
585 * TLVs. This function splits the channel TLV into maxchanperscan lists 585 * TLVs. This function splits the channel TLV into maxchanperscan lists
586 * and sends the portion of the channel TLV along with the other TLVs 586 * and sends the portion of the channel TLV along with the other TLVs
587 * to the wlan_cmd routines for execution in the firmware. 587 * to the lbs_cmd routines for execution in the firmware.
588 * 588 *
589 * @param priv A pointer to wlan_private structure 589 * @param priv A pointer to lbs_private structure
590 * @param maxchanperscan Maximum number channels to be included in each 590 * @param maxchanperscan Maximum number channels to be included in each
591 * scan command sent to firmware 591 * scan command sent to firmware
592 * @param filteredscan Flag indicating whether or not a BSSID or SSID 592 * @param filteredscan Flag indicating whether or not a BSSID or SSID
@@ -600,13 +600,13 @@ out:
600 * 600 *
601 * @return 0 or error return otherwise 601 * @return 0 or error return otherwise
602 */ 602 */
603static int wlan_scan_channel_list(wlan_private * priv, 603static int lbs_scan_channel_list(lbs_private *priv,
604 int maxchanperscan, 604 int maxchanperscan,
605 u8 filteredscan, 605 u8 filteredscan,
606 struct wlan_scan_cmd_config * pscancfgout, 606 struct lbs_scan_cmd_config *pscancfgout,
607 struct mrvlietypes_chanlistparamset * pchantlvout, 607 struct mrvlietypes_chanlistparamset * pchantlvout,
608 struct chanscanparamset * pscanchanlist, 608 struct chanscanparamset * pscanchanlist,
609 const struct wlan_ioctl_user_scan_cfg * puserscanin, 609 const struct lbs_ioctl_user_scan_cfg *puserscanin,
610 int full_scan) 610 int full_scan)
611{ 611{
612 struct chanscanparamset *ptmpchan; 612 struct chanscanparamset *ptmpchan;
@@ -720,7 +720,7 @@ static int wlan_scan_channel_list(wlan_private * priv,
720 } 720 }
721 721
722 /* Send the scan command to the firmware with the specified cfg */ 722 /* Send the scan command to the firmware with the specified cfg */
723 ret = libertas_prepare_and_send_command(priv, CMD_802_11_SCAN, 0, 723 ret = lbs_prepare_and_send_command(priv, CMD_802_11_SCAN, 0,
724 0, 0, pscancfgout); 724 0, 0, pscancfgout);
725 if (scanned >= 2 && !full_scan) { 725 if (scanned >= 2 && !full_scan) {
726 ret = 0; 726 ret = 0;
@@ -751,10 +751,10 @@ out:
751} 751}
752 752
753/* 753/*
754 * Only used from wlan_scan_networks() 754 * Only used from lbs_scan_networks()
755*/ 755*/
756static void clear_selected_scan_list_entries(wlan_adapter *adapter, 756static void clear_selected_scan_list_entries(lbs_adapter *adapter,
757 const struct wlan_ioctl_user_scan_cfg *scan_cfg) 757 const struct lbs_ioctl_user_scan_cfg *scan_cfg)
758{ 758{
759 struct bss_descriptor *bss; 759 struct bss_descriptor *bss;
760 struct bss_descriptor *safe; 760 struct bss_descriptor *safe;
@@ -812,21 +812,21 @@ out:
812 * order to send the appropriate scan commands to firmware to populate or 812 * order to send the appropriate scan commands to firmware to populate or
813 * update the internal driver scan table 813 * update the internal driver scan table
814 * 814 *
815 * @param priv A pointer to wlan_private structure 815 * @param priv A pointer to lbs_private structure
816 * @param puserscanin Pointer to the input configuration for the requested 816 * @param puserscanin Pointer to the input configuration for the requested
817 * scan. 817 * scan.
818 * @param full_scan ??? 818 * @param full_scan ???
819 * 819 *
820 * @return 0 or < 0 if error 820 * @return 0 or < 0 if error
821 */ 821 */
822int wlan_scan_networks(wlan_private * priv, 822int lbs_scan_networks(lbs_private *priv,
823 const struct wlan_ioctl_user_scan_cfg * puserscanin, 823 const struct lbs_ioctl_user_scan_cfg *puserscanin,
824 int full_scan) 824 int full_scan)
825{ 825{
826 wlan_adapter * adapter = priv->adapter; 826 lbs_adapter *adapter = priv->adapter;
827 struct mrvlietypes_chanlistparamset *pchantlvout; 827 struct mrvlietypes_chanlistparamset *pchantlvout;
828 struct chanscanparamset * scan_chan_list = NULL; 828 struct chanscanparamset * scan_chan_list = NULL;
829 struct wlan_scan_cmd_config * scan_cfg = NULL; 829 struct lbs_scan_cmd_config *scan_cfg = NULL;
830 u8 filteredscan; 830 u8 filteredscan;
831 u8 scancurrentchanonly; 831 u8 scancurrentchanonly;
832 int maxchanperscan; 832 int maxchanperscan;
@@ -846,13 +846,13 @@ int wlan_scan_networks(wlan_private * priv,
846 cancel_delayed_work(&priv->scan_work); 846 cancel_delayed_work(&priv->scan_work);
847 847
848 scan_chan_list = kzalloc(sizeof(struct chanscanparamset) * 848 scan_chan_list = kzalloc(sizeof(struct chanscanparamset) *
849 WLAN_IOCTL_USER_SCAN_CHAN_MAX, GFP_KERNEL); 849 LBS_IOCTL_USER_SCAN_CHAN_MAX, GFP_KERNEL);
850 if (scan_chan_list == NULL) { 850 if (scan_chan_list == NULL) {
851 ret = -ENOMEM; 851 ret = -ENOMEM;
852 goto out; 852 goto out;
853 } 853 }
854 854
855 scan_cfg = wlan_scan_setup_scan_config(priv, 855 scan_cfg = lbs_scan_setup_scan_config(priv,
856 puserscanin, 856 puserscanin,
857 &pchantlvout, 857 &pchantlvout,
858 scan_chan_list, 858 scan_chan_list,
@@ -876,7 +876,7 @@ int wlan_scan_networks(wlan_private * priv,
876 } 876 }
877 } 877 }
878 878
879 ret = wlan_scan_channel_list(priv, 879 ret = lbs_scan_channel_list(priv,
880 maxchanperscan, 880 maxchanperscan,
881 filteredscan, 881 filteredscan,
882 scan_cfg, 882 scan_cfg,
@@ -897,7 +897,7 @@ int wlan_scan_networks(wlan_private * priv,
897 mutex_unlock(&adapter->lock); 897 mutex_unlock(&adapter->lock);
898#endif 898#endif
899 899
900 if (priv->adapter->connect_status == LIBERTAS_CONNECTED) { 900 if (priv->adapter->connect_status == LBS_CONNECTED) {
901 netif_carrier_on(priv->dev); 901 netif_carrier_on(priv->dev);
902 netif_wake_queue(priv->dev); 902 netif_wake_queue(priv->dev);
903 if (priv->mesh_dev) { 903 if (priv->mesh_dev) {
@@ -928,7 +928,7 @@ out:
928 * 928 *
929 * @return 0 or -1 929 * @return 0 or -1
930 */ 930 */
931static int libertas_process_bss(struct bss_descriptor * bss, 931static int lbs_process_bss(struct bss_descriptor *bss,
932 u8 ** pbeaconinfo, int *bytesleft) 932 u8 ** pbeaconinfo, int *bytesleft)
933{ 933{
934 struct ieeetypes_fhparamset *pFH; 934 struct ieeetypes_fhparamset *pFH;
@@ -1139,7 +1139,7 @@ static int libertas_process_bss(struct bss_descriptor * bss,
1139 1139
1140 /* Timestamp */ 1140 /* Timestamp */
1141 bss->last_scanned = jiffies; 1141 bss->last_scanned = jiffies;
1142 libertas_unset_basic_rate_flags(bss->rates, sizeof(bss->rates)); 1142 lbs_unset_basic_rate_flags(bss->rates, sizeof(bss->rates));
1143 1143
1144 ret = 0; 1144 ret = 0;
1145 1145
@@ -1153,13 +1153,13 @@ done:
1153 * 1153 *
1154 * Used in association code 1154 * Used in association code
1155 * 1155 *
1156 * @param adapter A pointer to wlan_adapter 1156 * @param adapter A pointer to lbs_adapter
1157 * @param bssid BSSID to find in the scan list 1157 * @param bssid BSSID to find in the scan list
1158 * @param mode Network mode: Infrastructure or IBSS 1158 * @param mode Network mode: Infrastructure or IBSS
1159 * 1159 *
1160 * @return index in BSSID list, or error return code (< 0) 1160 * @return index in BSSID list, or error return code (< 0)
1161 */ 1161 */
1162struct bss_descriptor *libertas_find_bssid_in_list(wlan_adapter * adapter, 1162struct bss_descriptor *lbs_find_bssid_in_list(lbs_adapter *adapter,
1163 u8 * bssid, u8 mode) 1163 u8 * bssid, u8 mode)
1164{ 1164{
1165 struct bss_descriptor * iter_bss; 1165 struct bss_descriptor * iter_bss;
@@ -1205,14 +1205,14 @@ out:
1205 * 1205 *
1206 * Used in association code 1206 * Used in association code
1207 * 1207 *
1208 * @param adapter A pointer to wlan_adapter 1208 * @param adapter A pointer to lbs_adapter
1209 * @param ssid SSID to find in the list 1209 * @param ssid SSID to find in the list
1210 * @param bssid BSSID to qualify the SSID selection (if provided) 1210 * @param bssid BSSID to qualify the SSID selection (if provided)
1211 * @param mode Network mode: Infrastructure or IBSS 1211 * @param mode Network mode: Infrastructure or IBSS
1212 * 1212 *
1213 * @return index in BSSID list 1213 * @return index in BSSID list
1214 */ 1214 */
1215struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, 1215struct bss_descriptor *lbs_find_ssid_in_list(lbs_adapter *adapter,
1216 u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, 1216 u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode,
1217 int channel) 1217 int channel)
1218{ 1218{
@@ -1230,7 +1230,7 @@ struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter,
1230 || (iter_bss->last_scanned < tmp_oldest->last_scanned)) 1230 || (iter_bss->last_scanned < tmp_oldest->last_scanned))
1231 tmp_oldest = iter_bss; 1231 tmp_oldest = iter_bss;
1232 1232
1233 if (libertas_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len, 1233 if (lbs_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len,
1234 ssid, ssid_len) != 0) 1234 ssid, ssid_len) != 0)
1235 continue; /* ssid doesn't match */ 1235 continue; /* ssid doesn't match */
1236 if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) 1236 if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0)
@@ -1277,11 +1277,11 @@ out:
1277 * Search the scan table for the best SSID that also matches the current 1277 * Search the scan table for the best SSID that also matches the current
1278 * adapter network preference (infrastructure or adhoc) 1278 * adapter network preference (infrastructure or adhoc)
1279 * 1279 *
1280 * @param adapter A pointer to wlan_adapter 1280 * @param adapter A pointer to lbs_adapter
1281 * 1281 *
1282 * @return index in BSSID list 1282 * @return index in BSSID list
1283 */ 1283 */
1284static struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter, 1284static struct bss_descriptor *lbs_find_best_ssid_in_list(lbs_adapter *adapter,
1285 u8 mode) 1285 u8 mode)
1286{ 1286{
1287 u8 bestrssi = 0; 1287 u8 bestrssi = 0;
@@ -1323,27 +1323,27 @@ static struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * ad
1323 * 1323 *
1324 * Used from association worker. 1324 * Used from association worker.
1325 * 1325 *
1326 * @param priv A pointer to wlan_private structure 1326 * @param priv A pointer to lbs_private structure
1327 * @param pSSID A pointer to AP's ssid 1327 * @param pSSID A pointer to AP's ssid
1328 * 1328 *
1329 * @return 0--success, otherwise--fail 1329 * @return 0--success, otherwise--fail
1330 */ 1330 */
1331int libertas_find_best_network_ssid(wlan_private * priv, 1331int lbs_find_best_network_ssid(lbs_private *priv,
1332 u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode) 1332 u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode)
1333{ 1333{
1334 wlan_adapter *adapter = priv->adapter; 1334 lbs_adapter *adapter = priv->adapter;
1335 int ret = -1; 1335 int ret = -1;
1336 struct bss_descriptor * found; 1336 struct bss_descriptor * found;
1337 1337
1338 lbs_deb_enter(LBS_DEB_SCAN); 1338 lbs_deb_enter(LBS_DEB_SCAN);
1339 1339
1340 wlan_scan_networks(priv, NULL, 1); 1340 lbs_scan_networks(priv, NULL, 1);
1341 if (adapter->surpriseremoved) 1341 if (adapter->surpriseremoved)
1342 goto out; 1342 goto out;
1343 1343
1344 wait_event_interruptible(adapter->cmd_pending, !adapter->nr_cmd_pending); 1344 wait_event_interruptible(adapter->cmd_pending, !adapter->nr_cmd_pending);
1345 1345
1346 found = libertas_find_best_ssid_in_list(adapter, preferred_mode); 1346 found = lbs_find_best_ssid_in_list(adapter, preferred_mode);
1347 if (found && (found->ssid_len > 0)) { 1347 if (found && (found->ssid_len > 0)) {
1348 memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE); 1348 memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE);
1349 *out_ssid_len = found->ssid_len; 1349 *out_ssid_len = found->ssid_len;
@@ -1366,11 +1366,11 @@ out:
1366 * 1366 *
1367 * @return 0 --success, otherwise fail 1367 * @return 0 --success, otherwise fail
1368 */ 1368 */
1369int libertas_set_scan(struct net_device *dev, struct iw_request_info *info, 1369int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
1370 struct iw_param *vwrq, char *extra) 1370 struct iw_param *vwrq, char *extra)
1371{ 1371{
1372 wlan_private *priv = dev->priv; 1372 lbs_private *priv = dev->priv;
1373 wlan_adapter *adapter = priv->adapter; 1373 lbs_adapter *adapter = priv->adapter;
1374 1374
1375 lbs_deb_enter(LBS_DEB_SCAN); 1375 lbs_deb_enter(LBS_DEB_SCAN);
1376 1376
@@ -1392,7 +1392,7 @@ int libertas_set_scan(struct net_device *dev, struct iw_request_info *info,
1392 * 1392 *
1393 * Used in association code and from debugfs 1393 * Used in association code and from debugfs
1394 * 1394 *
1395 * @param priv A pointer to wlan_private structure 1395 * @param priv A pointer to lbs_private structure
1396 * @param ssid A pointer to the SSID to scan for 1396 * @param ssid A pointer to the SSID to scan for
1397 * @param ssid_len Length of the SSID 1397 * @param ssid_len Length of the SSID
1398 * @param clear_ssid Should existing scan results with this SSID 1398 * @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,
1402 * 1402 *
1403 * @return 0-success, otherwise fail 1403 * @return 0-success, otherwise fail
1404 */ 1404 */
1405int libertas_send_specific_ssid_scan(wlan_private * priv, 1405int lbs_send_specific_ssid_scan(lbs_private *priv,
1406 u8 *ssid, u8 ssid_len, u8 clear_ssid) 1406 u8 *ssid, u8 ssid_len, u8 clear_ssid)
1407{ 1407{
1408 wlan_adapter *adapter = priv->adapter; 1408 lbs_adapter *adapter = priv->adapter;
1409 struct wlan_ioctl_user_scan_cfg scancfg; 1409 struct lbs_ioctl_user_scan_cfg scancfg;
1410 int ret = 0; 1410 int ret = 0;
1411 1411
1412 lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s', clear %d", 1412 lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s', clear %d",
@@ -1420,7 +1420,7 @@ int libertas_send_specific_ssid_scan(wlan_private * priv,
1420 scancfg.ssid_len = ssid_len; 1420 scancfg.ssid_len = ssid_len;
1421 scancfg.clear_ssid = clear_ssid; 1421 scancfg.clear_ssid = clear_ssid;
1422 1422
1423 wlan_scan_networks(priv, &scancfg, 1); 1423 lbs_scan_networks(priv, &scancfg, 1);
1424 if (adapter->surpriseremoved) { 1424 if (adapter->surpriseremoved) {
1425 ret = -1; 1425 ret = -1;
1426 goto out; 1426 goto out;
@@ -1443,11 +1443,11 @@ out:
1443 1443
1444#define MAX_CUSTOM_LEN 64 1444#define MAX_CUSTOM_LEN 64
1445 1445
1446static inline char *libertas_translate_scan(wlan_private *priv, 1446static inline char *lbs_translate_scan(lbs_private *priv,
1447 char *start, char *stop, 1447 char *start, char *stop,
1448 struct bss_descriptor *bss) 1448 struct bss_descriptor *bss)
1449{ 1449{
1450 wlan_adapter *adapter = priv->adapter; 1450 lbs_adapter *adapter = priv->adapter;
1451 struct chan_freq_power *cfp; 1451 struct chan_freq_power *cfp;
1452 char *current_val; /* For rates */ 1452 char *current_val; /* For rates */
1453 struct iw_event iwe; /* Temporary buffer */ 1453 struct iw_event iwe; /* Temporary buffer */
@@ -1459,7 +1459,7 @@ static inline char *libertas_translate_scan(wlan_private *priv,
1459 1459
1460 lbs_deb_enter(LBS_DEB_SCAN); 1460 lbs_deb_enter(LBS_DEB_SCAN);
1461 1461
1462 cfp = libertas_find_cfp_by_band_and_channel(adapter, 0, bss->channel); 1462 cfp = lbs_find_cfp_by_band_and_channel(adapter, 0, bss->channel);
1463 if (!cfp) { 1463 if (!cfp) {
1464 lbs_deb_scan("Invalid channel number %d\n", bss->channel); 1464 lbs_deb_scan("Invalid channel number %d\n", bss->channel);
1465 start = NULL; 1465 start = NULL;
@@ -1515,7 +1515,7 @@ static inline char *libertas_translate_scan(wlan_private *priv,
1515 */ 1515 */
1516 if ((adapter->mode == IW_MODE_ADHOC) 1516 if ((adapter->mode == IW_MODE_ADHOC)
1517 && adapter->adhoccreate 1517 && adapter->adhoccreate
1518 && !libertas_ssid_cmp(adapter->curbssparams.ssid, 1518 && !lbs_ssid_cmp(adapter->curbssparams.ssid,
1519 adapter->curbssparams.ssid_len, 1519 adapter->curbssparams.ssid_len,
1520 bss->ssid, bss->ssid_len)) { 1520 bss->ssid, bss->ssid_len)) {
1521 int snr, nf; 1521 int snr, nf;
@@ -1549,7 +1549,7 @@ static inline char *libertas_translate_scan(wlan_private *priv,
1549 stop, &iwe, IW_EV_PARAM_LEN); 1549 stop, &iwe, IW_EV_PARAM_LEN);
1550 } 1550 }
1551 if ((bss->mode == IW_MODE_ADHOC) 1551 if ((bss->mode == IW_MODE_ADHOC)
1552 && !libertas_ssid_cmp(adapter->curbssparams.ssid, 1552 && !lbs_ssid_cmp(adapter->curbssparams.ssid,
1553 adapter->curbssparams.ssid_len, 1553 adapter->curbssparams.ssid_len,
1554 bss->ssid, bss->ssid_len) 1554 bss->ssid, bss->ssid_len)
1555 && adapter->adhoccreate) { 1555 && adapter->adhoccreate) {
@@ -1606,12 +1606,12 @@ out:
1606 * 1606 *
1607 * @return 0 --success, otherwise fail 1607 * @return 0 --success, otherwise fail
1608 */ 1608 */
1609int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, 1609int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
1610 struct iw_point *dwrq, char *extra) 1610 struct iw_point *dwrq, char *extra)
1611{ 1611{
1612#define SCAN_ITEM_SIZE 128 1612#define SCAN_ITEM_SIZE 128
1613 wlan_private *priv = dev->priv; 1613 lbs_private *priv = dev->priv;
1614 wlan_adapter *adapter = priv->adapter; 1614 lbs_adapter *adapter = priv->adapter;
1615 int err = 0; 1615 int err = 0;
1616 char *ev = extra; 1616 char *ev = extra;
1617 char *stop = ev + dwrq->length; 1617 char *stop = ev + dwrq->length;
@@ -1622,7 +1622,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
1622 1622
1623 /* Update RSSI if current BSS is a locally created ad-hoc BSS */ 1623 /* Update RSSI if current BSS is a locally created ad-hoc BSS */
1624 if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) { 1624 if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) {
1625 libertas_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, 1625 lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
1626 CMD_OPTION_WAITFORRSP, 0, NULL); 1626 CMD_OPTION_WAITFORRSP, 0, NULL);
1627 } 1627 }
1628 1628
@@ -1650,7 +1650,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
1650 } 1650 }
1651 1651
1652 /* Translate to WE format this entry */ 1652 /* Translate to WE format this entry */
1653 next_ev = libertas_translate_scan(priv, ev, stop, iter_bss); 1653 next_ev = lbs_translate_scan(priv, ev, stop, iter_bss);
1654 if (next_ev == NULL) 1654 if (next_ev == NULL)
1655 continue; 1655 continue;
1656 ev = next_ev; 1656 ev = next_ev;
@@ -1677,24 +1677,24 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
1677/** 1677/**
1678 * @brief Prepare a scan command to be sent to the firmware 1678 * @brief Prepare a scan command to be sent to the firmware
1679 * 1679 *
1680 * Called from libertas_prepare_and_send_command() in cmd.c 1680 * Called from lbs_prepare_and_send_command() in cmd.c
1681 * 1681 *
1682 * Sends a fixed lenght data part (specifying the BSS type and BSSID filters) 1682 * Sends a fixed lenght data part (specifying the BSS type and BSSID filters)
1683 * as well as a variable number/length of TLVs to the firmware. 1683 * as well as a variable number/length of TLVs to the firmware.
1684 * 1684 *
1685 * @param priv A pointer to wlan_private structure 1685 * @param priv A pointer to lbs_private structure
1686 * @param cmd A pointer to cmd_ds_command structure to be sent to 1686 * @param cmd A pointer to cmd_ds_command structure to be sent to
1687 * firmware with the cmd_DS_801_11_SCAN structure 1687 * firmware with the cmd_DS_801_11_SCAN structure
1688 * @param pdata_buf Void pointer cast of a wlan_scan_cmd_config struct used 1688 * @param pdata_buf Void pointer cast of a lbs_scan_cmd_config struct used
1689 * to set the fields/TLVs for the command sent to firmware 1689 * to set the fields/TLVs for the command sent to firmware
1690 * 1690 *
1691 * @return 0 or -1 1691 * @return 0 or -1
1692 */ 1692 */
1693int libertas_cmd_80211_scan(wlan_private * priv, 1693int lbs_cmd_80211_scan(lbs_private *priv,
1694 struct cmd_ds_command *cmd, void *pdata_buf) 1694 struct cmd_ds_command *cmd, void *pdata_buf)
1695{ 1695{
1696 struct cmd_ds_802_11_scan *pscan = &cmd->params.scan; 1696 struct cmd_ds_802_11_scan *pscan = &cmd->params.scan;
1697 struct wlan_scan_cmd_config *pscancfg = pdata_buf; 1697 struct lbs_scan_cmd_config *pscancfg = pdata_buf;
1698 1698
1699 lbs_deb_enter(LBS_DEB_SCAN); 1699 lbs_deb_enter(LBS_DEB_SCAN);
1700 1700
@@ -1750,14 +1750,14 @@ static inline int is_same_network(struct bss_descriptor *src,
1750 * | bufsize and sizeof the fixed fields above) | 1750 * | bufsize and sizeof the fixed fields above) |
1751 * .-----------------------------------------------------------. 1751 * .-----------------------------------------------------------.
1752 * 1752 *
1753 * @param priv A pointer to wlan_private structure 1753 * @param priv A pointer to lbs_private structure
1754 * @param resp A pointer to cmd_ds_command 1754 * @param resp A pointer to cmd_ds_command
1755 * 1755 *
1756 * @return 0 or -1 1756 * @return 0 or -1
1757 */ 1757 */
1758int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp) 1758int lbs_ret_80211_scan(lbs_private *priv, struct cmd_ds_command *resp)
1759{ 1759{
1760 wlan_adapter *adapter = priv->adapter; 1760 lbs_adapter *adapter = priv->adapter;
1761 struct cmd_ds_802_11_scan_rsp *pscan; 1761 struct cmd_ds_802_11_scan_rsp *pscan;
1762 struct bss_descriptor * iter_bss; 1762 struct bss_descriptor * iter_bss;
1763 struct bss_descriptor * safe; 1763 struct bss_descriptor * safe;
@@ -1821,7 +1821,7 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
1821 1821
1822 /* Process the data fields and IEs returned for this BSS */ 1822 /* Process the data fields and IEs returned for this BSS */
1823 memset(&new, 0, sizeof (struct bss_descriptor)); 1823 memset(&new, 0, sizeof (struct bss_descriptor));
1824 if (libertas_process_bss(&new, &pbssinfo, &bytesleft) != 0) { 1824 if (lbs_process_bss(&new, &pbssinfo, &bytesleft) != 0) {
1825 /* error parsing the scan response, skipped */ 1825 /* error parsing the scan response, skipped */
1826 lbs_deb_scan("SCAN_RESP: process_bss returned ERROR\n"); 1826 lbs_deb_scan("SCAN_RESP: process_bss returned ERROR\n");
1827 continue; 1827 continue;