aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/scan.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-11-23 09:43:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:54 -0500
commit69f9032d9dfeb763b467fdbe8cf5938f5457083a (patch)
tree613598938e17e1a7514e0da3817f3cfebbe346a9 /drivers/net/wireless/libertas/scan.c
parent96287ac4f7b387acbe17e24b5e1bcbf3bc0e75cd (diff)
libertas: remove arbitrary typedefs
New typedefs are usually frowned upon. This patch changes libertas_adapter -> struct libertas_adapter libertas_priv -> struct libertas_priv While passing, make everything checkpatch.pl-clean that gets touches. 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.c79
1 files changed, 41 insertions, 38 deletions
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 13a0838aa1e6..4e465bb4fd6f 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -163,13 +163,13 @@ static inline int match_bss_dynamic_wep(struct lbs_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 lbs_adapter 166 * @param adapter A pointer to struct 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(lbs_adapter *adapter, 172static int is_network_compatible(struct 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;
@@ -262,7 +262,7 @@ int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len)
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 lbs_private structure 265 * @param priv A pointer to struct 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 lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len)
272 * 272 *
273 * @return void 273 * @return void
274 */ 274 */
275static void lbs_scan_create_channel_list(lbs_private *priv, 275static void lbs_scan_create_channel_list(struct lbs_private *priv,
276 struct chanscanparamset * scanchanlist, 276 struct chanscanparamset * scanchanlist,
277 u8 filteredscan) 277 u8 filteredscan)
278{ 278{
279 279
280 lbs_adapter *adapter = priv->adapter; 280 struct 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;
@@ -360,7 +360,9 @@ static void lbs_scan_create_channel_list(lbs_private *priv,
360/* Delayed partial scan worker */ 360/* Delayed partial scan worker */
361void lbs_scan_worker(struct work_struct *work) 361void lbs_scan_worker(struct work_struct *work)
362{ 362{
363 lbs_private *priv = container_of(work, lbs_private, scan_work.work); 363 struct lbs_private *priv = container_of(work,
364 struct lbs_private,
365 scan_work.work);
364 366
365 lbs_scan_networks(priv, NULL, 0); 367 lbs_scan_networks(priv, NULL, 0);
366} 368}
@@ -386,7 +388,7 @@ void lbs_scan_worker(struct work_struct *work)
386 * If the number of probes is not set, use the adapter default setting 388 * If the number of probes is not set, use the adapter default setting
387 * Qualify the channel 389 * Qualify the channel
388 * 390 *
389 * @param priv A pointer to lbs_private structure 391 * @param priv A pointer to struct lbs_private structure
390 * @param puserscanin NULL or pointer to scan configuration parameters 392 * @param puserscanin NULL or pointer to scan configuration parameters
391 * @param ppchantlvout Output parameter: Pointer to the start of the 393 * @param ppchantlvout Output parameter: Pointer to the start of the
392 * channel TLV portion of the output scan config 394 * channel TLV portion of the output scan config
@@ -405,7 +407,7 @@ void lbs_scan_worker(struct work_struct *work)
405 * @return resulting scan configuration 407 * @return resulting scan configuration
406 */ 408 */
407static struct lbs_scan_cmd_config * 409static struct lbs_scan_cmd_config *
408lbs_scan_setup_scan_config(lbs_private *priv, 410lbs_scan_setup_scan_config(struct lbs_private *priv,
409 const struct lbs_ioctl_user_scan_cfg *puserscanin, 411 const struct lbs_ioctl_user_scan_cfg *puserscanin,
410 struct mrvlietypes_chanlistparamset ** ppchantlvout, 412 struct mrvlietypes_chanlistparamset ** ppchantlvout,
411 struct chanscanparamset * pscanchanlist, 413 struct chanscanparamset * pscanchanlist,
@@ -587,7 +589,7 @@ out:
587 * and sends the portion of the channel TLV along with the other TLVs 589 * and sends the portion of the channel TLV along with the other TLVs
588 * to the lbs_cmd routines for execution in the firmware. 590 * to the lbs_cmd routines for execution in the firmware.
589 * 591 *
590 * @param priv A pointer to lbs_private structure 592 * @param priv A pointer to struct lbs_private structure
591 * @param maxchanperscan Maximum number channels to be included in each 593 * @param maxchanperscan Maximum number channels to be included in each
592 * scan command sent to firmware 594 * scan command sent to firmware
593 * @param filteredscan Flag indicating whether or not a BSSID or SSID 595 * @param filteredscan Flag indicating whether or not a BSSID or SSID
@@ -601,7 +603,7 @@ out:
601 * 603 *
602 * @return 0 or error return otherwise 604 * @return 0 or error return otherwise
603 */ 605 */
604static int lbs_scan_channel_list(lbs_private *priv, 606static int lbs_scan_channel_list(struct lbs_private *priv,
605 int maxchanperscan, 607 int maxchanperscan,
606 u8 filteredscan, 608 u8 filteredscan,
607 struct lbs_scan_cmd_config *pscancfgout, 609 struct lbs_scan_cmd_config *pscancfgout,
@@ -754,7 +756,7 @@ out:
754/* 756/*
755 * Only used from lbs_scan_networks() 757 * Only used from lbs_scan_networks()
756*/ 758*/
757static void clear_selected_scan_list_entries(lbs_adapter *adapter, 759static void clear_selected_scan_list_entries(struct lbs_adapter *adapter,
758 const struct lbs_ioctl_user_scan_cfg *scan_cfg) 760 const struct lbs_ioctl_user_scan_cfg *scan_cfg)
759{ 761{
760 struct bss_descriptor *bss; 762 struct bss_descriptor *bss;
@@ -813,18 +815,18 @@ out:
813 * order to send the appropriate scan commands to firmware to populate or 815 * order to send the appropriate scan commands to firmware to populate or
814 * update the internal driver scan table 816 * update the internal driver scan table
815 * 817 *
816 * @param priv A pointer to lbs_private structure 818 * @param priv A pointer to struct lbs_private structure
817 * @param puserscanin Pointer to the input configuration for the requested 819 * @param puserscanin Pointer to the input configuration for the requested
818 * scan. 820 * scan.
819 * @param full_scan ??? 821 * @param full_scan ???
820 * 822 *
821 * @return 0 or < 0 if error 823 * @return 0 or < 0 if error
822 */ 824 */
823int lbs_scan_networks(lbs_private *priv, 825int lbs_scan_networks(struct lbs_private *priv,
824 const struct lbs_ioctl_user_scan_cfg *puserscanin, 826 const struct lbs_ioctl_user_scan_cfg *puserscanin,
825 int full_scan) 827 int full_scan)
826{ 828{
827 lbs_adapter *adapter = priv->adapter; 829 struct lbs_adapter *adapter = priv->adapter;
828 struct mrvlietypes_chanlistparamset *pchantlvout; 830 struct mrvlietypes_chanlistparamset *pchantlvout;
829 struct chanscanparamset * scan_chan_list = NULL; 831 struct chanscanparamset * scan_chan_list = NULL;
830 struct lbs_scan_cmd_config *scan_cfg = NULL; 832 struct lbs_scan_cmd_config *scan_cfg = NULL;
@@ -1155,13 +1157,13 @@ done:
1155 * 1157 *
1156 * Used in association code 1158 * Used in association code
1157 * 1159 *
1158 * @param adapter A pointer to lbs_adapter 1160 * @param adapter A pointer to struct lbs_adapter
1159 * @param bssid BSSID to find in the scan list 1161 * @param bssid BSSID to find in the scan list
1160 * @param mode Network mode: Infrastructure or IBSS 1162 * @param mode Network mode: Infrastructure or IBSS
1161 * 1163 *
1162 * @return index in BSSID list, or error return code (< 0) 1164 * @return index in BSSID list, or error return code (< 0)
1163 */ 1165 */
1164struct bss_descriptor *lbs_find_bssid_in_list(lbs_adapter *adapter, 1166struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_adapter *adapter,
1165 u8 * bssid, u8 mode) 1167 u8 * bssid, u8 mode)
1166{ 1168{
1167 struct bss_descriptor * iter_bss; 1169 struct bss_descriptor * iter_bss;
@@ -1207,14 +1209,14 @@ out:
1207 * 1209 *
1208 * Used in association code 1210 * Used in association code
1209 * 1211 *
1210 * @param adapter A pointer to lbs_adapter 1212 * @param adapter A pointer to struct lbs_adapter
1211 * @param ssid SSID to find in the list 1213 * @param ssid SSID to find in the list
1212 * @param bssid BSSID to qualify the SSID selection (if provided) 1214 * @param bssid BSSID to qualify the SSID selection (if provided)
1213 * @param mode Network mode: Infrastructure or IBSS 1215 * @param mode Network mode: Infrastructure or IBSS
1214 * 1216 *
1215 * @return index in BSSID list 1217 * @return index in BSSID list
1216 */ 1218 */
1217struct bss_descriptor *lbs_find_ssid_in_list(lbs_adapter *adapter, 1219struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_adapter *adapter,
1218 u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, 1220 u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode,
1219 int channel) 1221 int channel)
1220{ 1222{
@@ -1279,12 +1281,13 @@ out:
1279 * Search the scan table for the best SSID that also matches the current 1281 * Search the scan table for the best SSID that also matches the current
1280 * adapter network preference (infrastructure or adhoc) 1282 * adapter network preference (infrastructure or adhoc)
1281 * 1283 *
1282 * @param adapter A pointer to lbs_adapter 1284 * @param adapter A pointer to struct lbs_adapter
1283 * 1285 *
1284 * @return index in BSSID list 1286 * @return index in BSSID list
1285 */ 1287 */
1286static struct bss_descriptor *lbs_find_best_ssid_in_list(lbs_adapter *adapter, 1288static struct bss_descriptor *lbs_find_best_ssid_in_list(
1287 u8 mode) 1289 struct lbs_adapter *adapter,
1290 u8 mode)
1288{ 1291{
1289 u8 bestrssi = 0; 1292 u8 bestrssi = 0;
1290 struct bss_descriptor * iter_bss; 1293 struct bss_descriptor * iter_bss;
@@ -1325,15 +1328,15 @@ static struct bss_descriptor *lbs_find_best_ssid_in_list(lbs_adapter *adapter,
1325 * 1328 *
1326 * Used from association worker. 1329 * Used from association worker.
1327 * 1330 *
1328 * @param priv A pointer to lbs_private structure 1331 * @param priv A pointer to struct lbs_private structure
1329 * @param pSSID A pointer to AP's ssid 1332 * @param pSSID A pointer to AP's ssid
1330 * 1333 *
1331 * @return 0--success, otherwise--fail 1334 * @return 0--success, otherwise--fail
1332 */ 1335 */
1333int lbs_find_best_network_ssid(lbs_private *priv, 1336int lbs_find_best_network_ssid(struct lbs_private *priv,
1334 u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode) 1337 u8 *out_ssid, u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode)
1335{ 1338{
1336 lbs_adapter *adapter = priv->adapter; 1339 struct lbs_adapter *adapter = priv->adapter;
1337 int ret = -1; 1340 int ret = -1;
1338 struct bss_descriptor * found; 1341 struct bss_descriptor * found;
1339 1342
@@ -1371,8 +1374,8 @@ out:
1371int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, 1374int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
1372 struct iw_param *vwrq, char *extra) 1375 struct iw_param *vwrq, char *extra)
1373{ 1376{
1374 lbs_private *priv = dev->priv; 1377 struct lbs_private *priv = dev->priv;
1375 lbs_adapter *adapter = priv->adapter; 1378 struct lbs_adapter *adapter = priv->adapter;
1376 1379
1377 lbs_deb_enter(LBS_DEB_SCAN); 1380 lbs_deb_enter(LBS_DEB_SCAN);
1378 1381
@@ -1394,7 +1397,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
1394 * 1397 *
1395 * Used in association code and from debugfs 1398 * Used in association code and from debugfs
1396 * 1399 *
1397 * @param priv A pointer to lbs_private structure 1400 * @param priv A pointer to struct lbs_private structure
1398 * @param ssid A pointer to the SSID to scan for 1401 * @param ssid A pointer to the SSID to scan for
1399 * @param ssid_len Length of the SSID 1402 * @param ssid_len Length of the SSID
1400 * @param clear_ssid Should existing scan results with this SSID 1403 * @param clear_ssid Should existing scan results with this SSID
@@ -1404,10 +1407,10 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
1404 * 1407 *
1405 * @return 0-success, otherwise fail 1408 * @return 0-success, otherwise fail
1406 */ 1409 */
1407int lbs_send_specific_ssid_scan(lbs_private *priv, 1410int lbs_send_specific_ssid_scan(struct lbs_private *priv,
1408 u8 *ssid, u8 ssid_len, u8 clear_ssid) 1411 u8 *ssid, u8 ssid_len, u8 clear_ssid)
1409{ 1412{
1410 lbs_adapter *adapter = priv->adapter; 1413 struct lbs_adapter *adapter = priv->adapter;
1411 struct lbs_ioctl_user_scan_cfg scancfg; 1414 struct lbs_ioctl_user_scan_cfg scancfg;
1412 int ret = 0; 1415 int ret = 0;
1413 1416
@@ -1445,11 +1448,11 @@ out:
1445 1448
1446#define MAX_CUSTOM_LEN 64 1449#define MAX_CUSTOM_LEN 64
1447 1450
1448static inline char *lbs_translate_scan(lbs_private *priv, 1451static inline char *lbs_translate_scan(struct lbs_private *priv,
1449 char *start, char *stop, 1452 char *start, char *stop,
1450 struct bss_descriptor *bss) 1453 struct bss_descriptor *bss)
1451{ 1454{
1452 lbs_adapter *adapter = priv->adapter; 1455 struct lbs_adapter *adapter = priv->adapter;
1453 struct chan_freq_power *cfp; 1456 struct chan_freq_power *cfp;
1454 char *current_val; /* For rates */ 1457 char *current_val; /* For rates */
1455 struct iw_event iwe; /* Temporary buffer */ 1458 struct iw_event iwe; /* Temporary buffer */
@@ -1612,8 +1615,8 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
1612 struct iw_point *dwrq, char *extra) 1615 struct iw_point *dwrq, char *extra)
1613{ 1616{
1614#define SCAN_ITEM_SIZE 128 1617#define SCAN_ITEM_SIZE 128
1615 lbs_private *priv = dev->priv; 1618 struct lbs_private *priv = dev->priv;
1616 lbs_adapter *adapter = priv->adapter; 1619 struct lbs_adapter *adapter = priv->adapter;
1617 int err = 0; 1620 int err = 0;
1618 char *ev = extra; 1621 char *ev = extra;
1619 char *stop = ev + dwrq->length; 1622 char *stop = ev + dwrq->length;
@@ -1684,7 +1687,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
1684 * Sends a fixed lenght data part (specifying the BSS type and BSSID filters) 1687 * Sends a fixed lenght data part (specifying the BSS type and BSSID filters)
1685 * as well as a variable number/length of TLVs to the firmware. 1688 * as well as a variable number/length of TLVs to the firmware.
1686 * 1689 *
1687 * @param priv A pointer to lbs_private structure 1690 * @param priv A pointer to struct lbs_private structure
1688 * @param cmd A pointer to cmd_ds_command structure to be sent to 1691 * @param cmd A pointer to cmd_ds_command structure to be sent to
1689 * firmware with the cmd_DS_801_11_SCAN structure 1692 * firmware with the cmd_DS_801_11_SCAN structure
1690 * @param pdata_buf Void pointer cast of a lbs_scan_cmd_config struct used 1693 * @param pdata_buf Void pointer cast of a lbs_scan_cmd_config struct used
@@ -1692,7 +1695,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
1692 * 1695 *
1693 * @return 0 or -1 1696 * @return 0 or -1
1694 */ 1697 */
1695int lbs_cmd_80211_scan(lbs_private *priv, 1698int lbs_cmd_80211_scan(struct lbs_private *priv,
1696 struct cmd_ds_command *cmd, void *pdata_buf) 1699 struct cmd_ds_command *cmd, void *pdata_buf)
1697{ 1700{
1698 struct cmd_ds_802_11_scan *pscan = &cmd->params.scan; 1701 struct cmd_ds_802_11_scan *pscan = &cmd->params.scan;
@@ -1752,14 +1755,14 @@ static inline int is_same_network(struct bss_descriptor *src,
1752 * | bufsize and sizeof the fixed fields above) | 1755 * | bufsize and sizeof the fixed fields above) |
1753 * .-----------------------------------------------------------. 1756 * .-----------------------------------------------------------.
1754 * 1757 *
1755 * @param priv A pointer to lbs_private structure 1758 * @param priv A pointer to struct lbs_private structure
1756 * @param resp A pointer to cmd_ds_command 1759 * @param resp A pointer to cmd_ds_command
1757 * 1760 *
1758 * @return 0 or -1 1761 * @return 0 or -1
1759 */ 1762 */
1760int lbs_ret_80211_scan(lbs_private *priv, struct cmd_ds_command *resp) 1763int lbs_ret_80211_scan(struct lbs_private *priv, struct cmd_ds_command *resp)
1761{ 1764{
1762 lbs_adapter *adapter = priv->adapter; 1765 struct lbs_adapter *adapter = priv->adapter;
1763 struct cmd_ds_802_11_scan_rsp *pscan; 1766 struct cmd_ds_802_11_scan_rsp *pscan;
1764 struct bss_descriptor * iter_bss; 1767 struct bss_descriptor * iter_bss;
1765 struct bss_descriptor * safe; 1768 struct bss_descriptor * safe;