aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/prism54/isl_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/prism54/isl_ioctl.c')
-rw-r--r--drivers/net/wireless/prism54/isl_ioctl.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index e7700b4257eb..a87eb51886c8 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -1,5 +1,4 @@
1/* 1/*
2 *
3 * Copyright (C) 2002 Intersil Americas Inc. 2 * Copyright (C) 2002 Intersil Americas Inc.
4 * (C) 2003,2004 Aurelien Alleaume <slts@free.fr> 3 * (C) 2003,2004 Aurelien Alleaume <slts@free.fr>
5 * (C) 2003 Herbert Valerio Riedel <hvr@gnu.org> 4 * (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
@@ -55,12 +54,12 @@ static const unsigned char scan_rate_list[] = { 2, 4, 11, 22,
55 * prism54_mib_mode_helper - MIB change mode helper function 54 * prism54_mib_mode_helper - MIB change mode helper function
56 * @mib: the &struct islpci_mib object to modify 55 * @mib: the &struct islpci_mib object to modify
57 * @iw_mode: new mode (%IW_MODE_*) 56 * @iw_mode: new mode (%IW_MODE_*)
58 * 57 *
59 * This is a helper function, hence it does not lock. Make sure 58 * This is a helper function, hence it does not lock. Make sure
60 * caller deals with locking *if* necessary. This function sets the 59 * caller deals with locking *if* necessary. This function sets the
61 * mode-dependent mib values and does the mapping of the Linux 60 * mode-dependent mib values and does the mapping of the Linux
62 * Wireless API modes to Device firmware modes. It also checks for 61 * Wireless API modes to Device firmware modes. It also checks for
63 * correct valid Linux wireless modes. 62 * correct valid Linux wireless modes.
64 */ 63 */
65static int 64static int
66prism54_mib_mode_helper(islpci_private *priv, u32 iw_mode) 65prism54_mib_mode_helper(islpci_private *priv, u32 iw_mode)
@@ -118,7 +117,7 @@ prism54_mib_mode_helper(islpci_private *priv, u32 iw_mode)
118 * 117 *
119 * this function initializes the struct given as @mib with defaults, 118 * this function initializes the struct given as @mib with defaults,
120 * of which many are retrieved from the global module parameter 119 * of which many are retrieved from the global module parameter
121 * variables. 120 * variables.
122 */ 121 */
123 122
124void 123void
@@ -134,7 +133,7 @@ prism54_mib_init(islpci_private *priv)
134 authen = CARD_DEFAULT_AUTHEN; 133 authen = CARD_DEFAULT_AUTHEN;
135 wep = CARD_DEFAULT_WEP; 134 wep = CARD_DEFAULT_WEP;
136 filter = CARD_DEFAULT_FILTER; /* (0) Do not filter un-encrypted data */ 135 filter = CARD_DEFAULT_FILTER; /* (0) Do not filter un-encrypted data */
137 dot1x = CARD_DEFAULT_DOT1X; 136 dot1x = CARD_DEFAULT_DOT1X;
138 mlme = CARD_DEFAULT_MLME_MODE; 137 mlme = CARD_DEFAULT_MLME_MODE;
139 conformance = CARD_DEFAULT_CONFORMANCE; 138 conformance = CARD_DEFAULT_CONFORMANCE;
140 power = 127; 139 power = 127;
@@ -229,7 +228,7 @@ prism54_get_wireless_stats(struct net_device *ndev)
229 } else 228 } else
230 priv->iwstatistics.qual.updated = 0; 229 priv->iwstatistics.qual.updated = 0;
231 230
232 /* Update our wireless stats, but do not schedule to often 231 /* Update our wireless stats, but do not schedule to often
233 * (max 1 HZ) */ 232 * (max 1 HZ) */
234 if ((priv->stats_timestamp == 0) || 233 if ((priv->stats_timestamp == 0) ||
235 time_after(jiffies, priv->stats_timestamp + 1 * HZ)) { 234 time_after(jiffies, priv->stats_timestamp + 1 * HZ)) {
@@ -706,7 +705,7 @@ prism54_get_scan(struct net_device *ndev, struct iw_request_info *info,
706 * Starting with WE-17, the buffer can be as big as needed. 705 * Starting with WE-17, the buffer can be as big as needed.
707 * But the device won't repport anything if you change the value 706 * But the device won't repport anything if you change the value
708 * of IWMAX_BSS=24. */ 707 * of IWMAX_BSS=24. */
709 708
710 rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r); 709 rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r);
711 bsslist = r.ptr; 710 bsslist = r.ptr;
712 711
@@ -786,7 +785,7 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info,
786 return rvalue; 785 return rvalue;
787} 786}
788 787
789/* Provides no functionality, just completes the ioctl. In essence this is a 788/* Provides no functionality, just completes the ioctl. In essence this is a
790 * just a cosmetic ioctl. 789 * just a cosmetic ioctl.
791 */ 790 */
792static int 791static int
@@ -1105,7 +1104,7 @@ prism54_set_encode(struct net_device *ndev, struct iw_request_info *info,
1105 &key); 1104 &key);
1106 } 1105 }
1107 /* 1106 /*
1108 * If a valid key is set, encryption should be enabled 1107 * If a valid key is set, encryption should be enabled
1109 * (user may turn it off later). 1108 * (user may turn it off later).
1110 * This is also how "iwconfig ethX key on" works 1109 * This is also how "iwconfig ethX key on" works
1111 */ 1110 */
@@ -1127,7 +1126,7 @@ prism54_set_encode(struct net_device *ndev, struct iw_request_info *info,
1127 } 1126 }
1128 /* now read the flags */ 1127 /* now read the flags */
1129 if (dwrq->flags & IW_ENCODE_DISABLED) { 1128 if (dwrq->flags & IW_ENCODE_DISABLED) {
1130 /* Encoding disabled, 1129 /* Encoding disabled,
1131 * authen = DOT11_AUTH_OS; 1130 * authen = DOT11_AUTH_OS;
1132 * invoke = 0; 1131 * invoke = 0;
1133 * exunencrypt = 0; */ 1132 * exunencrypt = 0; */
@@ -1215,7 +1214,7 @@ prism54_get_txpower(struct net_device *ndev, struct iw_request_info *info,
1215 vwrq->value = (s32) r.u / 4; 1214 vwrq->value = (s32) r.u / 4;
1216 vwrq->fixed = 1; 1215 vwrq->fixed = 1;
1217 /* radio is not turned of 1216 /* radio is not turned of
1218 * btw: how is possible to turn off only the radio 1217 * btw: how is possible to turn off only the radio
1219 */ 1218 */
1220 vwrq->disabled = 0; 1219 vwrq->disabled = 0;
1221 1220
@@ -2355,17 +2354,17 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2355 handle_request(priv, mlme, oid); 2354 handle_request(priv, mlme, oid);
2356 send_formatted_event(priv, "Authenticate request (ex)", mlme, 1); 2355 send_formatted_event(priv, "Authenticate request (ex)", mlme, 1);
2357 2356
2358 if (priv->iw_mode != IW_MODE_MASTER 2357 if (priv->iw_mode != IW_MODE_MASTER
2359 && mlmeex->state != DOT11_STATE_AUTHING) 2358 && mlmeex->state != DOT11_STATE_AUTHING)
2360 break; 2359 break;
2361 2360
2362 confirm = kmalloc(sizeof(struct obj_mlmeex) + 6, GFP_ATOMIC); 2361 confirm = kmalloc(sizeof(struct obj_mlmeex) + 6, GFP_ATOMIC);
2363 2362
2364 if (!confirm) 2363 if (!confirm)
2365 break; 2364 break;
2366 2365
2367 memcpy(&confirm->address, mlmeex->address, ETH_ALEN); 2366 memcpy(&confirm->address, mlmeex->address, ETH_ALEN);
2368 printk(KERN_DEBUG "Authenticate from: address:\t%02x:%02x:%02x:%02x:%02x:%02x\n", 2367 printk(KERN_DEBUG "Authenticate from: address:\t%02x:%02x:%02x:%02x:%02x:%02x\n",
2369 mlmeex->address[0], 2368 mlmeex->address[0],
2370 mlmeex->address[1], 2369 mlmeex->address[1],
2371 mlmeex->address[2], 2370 mlmeex->address[2],
@@ -2399,10 +2398,10 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2399 handle_request(priv, mlme, oid); 2398 handle_request(priv, mlme, oid);
2400 send_formatted_event(priv, "Associate request (ex)", mlme, 1); 2399 send_formatted_event(priv, "Associate request (ex)", mlme, 1);
2401 2400
2402 if (priv->iw_mode != IW_MODE_MASTER 2401 if (priv->iw_mode != IW_MODE_MASTER
2403 && mlmeex->state != DOT11_STATE_ASSOCING) 2402 && mlmeex->state != DOT11_STATE_ASSOCING)
2404 break; 2403 break;
2405 2404
2406 confirm = kmalloc(sizeof(struct obj_mlmeex), GFP_ATOMIC); 2405 confirm = kmalloc(sizeof(struct obj_mlmeex), GFP_ATOMIC);
2407 2406
2408 if (!confirm) 2407 if (!confirm)
@@ -2418,7 +2417,7 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2418 2417
2419 if (!wpa_ie_len) { 2418 if (!wpa_ie_len) {
2420 printk(KERN_DEBUG "No WPA IE found from " 2419 printk(KERN_DEBUG "No WPA IE found from "
2421 "address:\t%02x:%02x:%02x:%02x:%02x:%02x\n", 2420 "address:\t%02x:%02x:%02x:%02x:%02x:%02x\n",
2422 mlmeex->address[0], 2421 mlmeex->address[0],
2423 mlmeex->address[1], 2422 mlmeex->address[1],
2424 mlmeex->address[2], 2423 mlmeex->address[2],
@@ -2436,14 +2435,14 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2436 mgt_set_varlen(priv, oid, confirm, wpa_ie_len); 2435 mgt_set_varlen(priv, oid, confirm, wpa_ie_len);
2437 2436
2438 kfree(confirm); 2437 kfree(confirm);
2439 2438
2440 break; 2439 break;
2441 2440
2442 case DOT11_OID_REASSOCIATEEX: 2441 case DOT11_OID_REASSOCIATEEX:
2443 handle_request(priv, mlme, oid); 2442 handle_request(priv, mlme, oid);
2444 send_formatted_event(priv, "Reassociate request (ex)", mlme, 1); 2443 send_formatted_event(priv, "Reassociate request (ex)", mlme, 1);
2445 2444
2446 if (priv->iw_mode != IW_MODE_MASTER 2445 if (priv->iw_mode != IW_MODE_MASTER
2447 && mlmeex->state != DOT11_STATE_ASSOCING) 2446 && mlmeex->state != DOT11_STATE_ASSOCING)
2448 break; 2447 break;
2449 2448
@@ -2462,7 +2461,7 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2462 2461
2463 if (!wpa_ie_len) { 2462 if (!wpa_ie_len) {
2464 printk(KERN_DEBUG "No WPA IE found from " 2463 printk(KERN_DEBUG "No WPA IE found from "
2465 "address:\t%02x:%02x:%02x:%02x:%02x:%02x\n", 2464 "address:\t%02x:%02x:%02x:%02x:%02x:%02x\n",
2466 mlmeex->address[0], 2465 mlmeex->address[0],
2467 mlmeex->address[1], 2466 mlmeex->address[1],
2468 mlmeex->address[2], 2467 mlmeex->address[2],
@@ -2474,13 +2473,13 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2474 break; 2473 break;
2475 } 2474 }
2476 2475
2477 confirm->size = wpa_ie_len; 2476 confirm->size = wpa_ie_len;
2478 memcpy(&confirm->data, wpa_ie, wpa_ie_len); 2477 memcpy(&confirm->data, wpa_ie, wpa_ie_len);
2479 2478
2480 mgt_set_varlen(priv, oid, confirm, wpa_ie_len); 2479 mgt_set_varlen(priv, oid, confirm, wpa_ie_len);
2481 2480
2482 kfree(confirm); 2481 kfree(confirm);
2483 2482
2484 break; 2483 break;
2485 2484
2486 default: 2485 default:
@@ -2547,10 +2546,10 @@ enum {
2547#define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \ 2546#define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
2548((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data)) 2547((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data))
2549 2548
2550/* Maximum length for algorithm names (-1 for nul termination) 2549/* Maximum length for algorithm names (-1 for nul termination)
2551 * used in ioctl() */ 2550 * used in ioctl() */
2552#define HOSTAP_CRYPT_ALG_NAME_LEN 16 2551#define HOSTAP_CRYPT_ALG_NAME_LEN 16
2553 2552
2554struct prism2_hostapd_param { 2553struct prism2_hostapd_param {
2555 u32 cmd; 2554 u32 cmd;
2556 u8 sta_addr[ETH_ALEN]; 2555 u8 sta_addr[ETH_ALEN];
@@ -2623,7 +2622,7 @@ prism2_ioctl_set_encryption(struct net_device *dev,
2623 &key); 2622 &key);
2624 } 2623 }
2625 /* 2624 /*
2626 * If a valid key is set, encryption should be enabled 2625 * If a valid key is set, encryption should be enabled
2627 * (user may turn it off later). 2626 * (user may turn it off later).
2628 * This is also how "iwconfig ethX key on" works 2627 * This is also how "iwconfig ethX key on" works
2629 */ 2628 */
@@ -2645,7 +2644,7 @@ prism2_ioctl_set_encryption(struct net_device *dev,
2645 } 2644 }
2646 /* now read the flags */ 2645 /* now read the flags */
2647 if (param->u.crypt.flags & IW_ENCODE_DISABLED) { 2646 if (param->u.crypt.flags & IW_ENCODE_DISABLED) {
2648 /* Encoding disabled, 2647 /* Encoding disabled,
2649 * authen = DOT11_AUTH_OS; 2648 * authen = DOT11_AUTH_OS;
2650 * invoke = 0; 2649 * invoke = 0;
2651 * exunencrypt = 0; */ 2650 * exunencrypt = 0; */
@@ -2712,7 +2711,7 @@ prism2_ioctl_set_generic_element(struct net_device *ndev,
2712 2711
2713 ret = mgt_set_varlen(priv, DOT11_OID_ATTACHMENT, attach, len); 2712 ret = mgt_set_varlen(priv, DOT11_OID_ATTACHMENT, attach, len);
2714 2713
2715 if (ret == 0) 2714 if (ret == 0)
2716 printk(KERN_DEBUG "%s: WPA IE Attachment was set\n", 2715 printk(KERN_DEBUG "%s: WPA IE Attachment was set\n",
2717 ndev->name); 2716 ndev->name);
2718 } 2717 }
@@ -2872,7 +2871,7 @@ prism54_set_wpa(struct net_device *ndev, struct iw_request_info *info,
2872 mlme = DOT11_MLME_AUTO; 2871 mlme = DOT11_MLME_AUTO;
2873 printk("%s: Disabling WPA\n", ndev->name); 2872 printk("%s: Disabling WPA\n", ndev->name);
2874 break; 2873 break;
2875 case 2: 2874 case 2:
2876 case 1: /* WPA */ 2875 case 1: /* WPA */
2877 printk("%s: Enabling WPA\n", ndev->name); 2876 printk("%s: Enabling WPA\n", ndev->name);
2878 break; 2877 break;