aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-10 22:56:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-05-11 14:54:54 -0400
commit6affe785aaf983253b27e71e67bf5fceaee6ff88 (patch)
treeeb4614822ddf8f3658d4e6716527af17a0031b24 /drivers
parent43631e15c1cd056a76272047c6ebe9edbaa06f25 (diff)
[PATCH] libertas: remove WLAN_802_11_AUTHENTICATION_MODE
Remove WLAN_802_11_AUTHENTICATION_MODE enum and use IW_AUTH_ALG_* instead. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/assoc.c3
-rw-r--r--drivers/net/wireless/libertas/defs.h7
-rw-r--r--drivers/net/wireless/libertas/dev.h2
-rw-r--r--drivers/net/wireless/libertas/fw.c2
-rw-r--r--drivers/net/wireless/libertas/join.c31
-rw-r--r--drivers/net/wireless/libertas/wext.c52
6 files changed, 43 insertions, 54 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index dfffabc41dd0..7ebd83605776 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -300,8 +300,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
300 } 300 }
301 301
302 if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { 302 if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
303 if (adapter->secinfo.authmode != 303 if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) {
304 assoc_req->secinfo.authmode) {
305 lbs_pr_debug(1, "Deauthenticating due to updated security " 304 lbs_pr_debug(1, "Deauthenticating due to updated security "
306 "info in configuration request.\n"); 305 "info in configuration request.\n");
307 return 1; 306 return 1;
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index a6dee5e4c1b3..9f5459332bbc 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -276,13 +276,6 @@ enum WLAN_802_11_NETWORK_INFRASTRUCTURE {
276 wlan802_11infrastructuremax 276 wlan802_11infrastructuremax
277}; 277};
278 278
279/** WLAN_802_11_AUTHENTICATION_MODE */
280enum WLAN_802_11_AUTHENTICATION_MODE {
281 wlan802_11authmodeopen = 0x00,
282 wlan802_11authmodeshared = 0x01,
283 wlan802_11authmodenetworkEAP = 0x80,
284};
285
286/** WLAN_802_11_WEP_STATUS */ 279/** WLAN_802_11_WEP_STATUS */
287enum WLAN_802_11_WEP_STATUS { 280enum WLAN_802_11_WEP_STATUS {
288 wlan802_11WEPenabled, 281 wlan802_11WEPenabled,
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 440b96d4da80..eb490a645cc2 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -58,7 +58,7 @@ struct wlan_802_11_security {
58 u8 WPAenabled; 58 u8 WPAenabled;
59 u8 WPA2enabled; 59 u8 WPA2enabled;
60 enum WLAN_802_11_WEP_STATUS WEPstatus; 60 enum WLAN_802_11_WEP_STATUS WEPstatus;
61 enum WLAN_802_11_AUTHENTICATION_MODE authmode; 61 u8 auth_mode;
62}; 62};
63 63
64/** Current Basic Service Set State Structure */ 64/** Current Basic Service Set State Structure */
diff --git a/drivers/net/wireless/libertas/fw.c b/drivers/net/wireless/libertas/fw.c
index 6911113f1acf..f2d626d7de48 100644
--- a/drivers/net/wireless/libertas/fw.c
+++ b/drivers/net/wireless/libertas/fw.c
@@ -200,7 +200,7 @@ static void wlan_init_adapter(wlan_private * priv)
200 memset(&adapter->wep_keys[i], 0, sizeof(struct WLAN_802_11_KEY)); 200 memset(&adapter->wep_keys[i], 0, sizeof(struct WLAN_802_11_KEY));
201 adapter->wep_tx_keyidx = 0; 201 adapter->wep_tx_keyidx = 0;
202 adapter->secinfo.WEPstatus = wlan802_11WEPdisabled; 202 adapter->secinfo.WEPstatus = wlan802_11WEPdisabled;
203 adapter->secinfo.authmode = wlan802_11authmodeopen; 203 adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
204 adapter->inframode = wlan802_11infrastructure; 204 adapter->inframode = wlan802_11infrastructure;
205 205
206 adapter->assoc_req = NULL; 206 adapter->assoc_req = NULL;
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index 11682cbe752b..149531c77938 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -398,22 +398,39 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
398 void *pdata_buf) 398 void *pdata_buf)
399{ 399{
400 wlan_adapter *adapter = priv->adapter; 400 wlan_adapter *adapter = priv->adapter;
401 struct cmd_ds_802_11_authenticate *pauthenticate = 401 struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth;
402 &cmd->params.auth; 402 int ret = -1;
403 u8 *bssid = pdata_buf; 403 u8 *bssid = pdata_buf;
404 404
405 cmd->command = cpu_to_le16(cmd_802_11_authenticate); 405 cmd->command = cpu_to_le16(cmd_802_11_authenticate);
406 cmd->size = 406 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
407 cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate) 407 + S_DS_GEN);
408 + S_DS_GEN); 408
409 /* translate auth mode to 802.11 defined wire value */
410 switch (adapter->secinfo.auth_mode) {
411 case IW_AUTH_ALG_OPEN_SYSTEM:
412 pauthenticate->authtype = 0x00;
413 break;
414 case IW_AUTH_ALG_SHARED_KEY:
415 pauthenticate->authtype = 0x01;
416 break;
417 case IW_AUTH_ALG_LEAP:
418 pauthenticate->authtype = 0x80;
419 break;
420 default:
421 lbs_pr_debug(1, "AUTH_CMD: invalid auth alg 0x%X\n",
422 adapter->secinfo.auth_mode);
423 goto out;
424 }
409 425
410 pauthenticate->authtype = adapter->secinfo.authmode;
411 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); 426 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
412 427
413 lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n", 428 lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n",
414 bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]); 429 bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
430 ret = 0;
415 431
416 return 0; 432out:
433 return ret;
417} 434}
418 435
419int libertas_cmd_80211_deauthenticate(wlan_private * priv, 436int libertas_cmd_80211_deauthenticate(wlan_private * priv,
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index cfce23d50524..22eacd2b6de4 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1772,13 +1772,13 @@ static int wlan_get_encode(struct net_device *dev,
1772 dwrq->flags = 0; 1772 dwrq->flags = 0;
1773 1773
1774 /* Authentication method */ 1774 /* Authentication method */
1775 switch (adapter->secinfo.authmode) { 1775 switch (adapter->secinfo.auth_mode) {
1776 case wlan802_11authmodeopen: 1776 case IW_AUTH_ALG_OPEN_SYSTEM:
1777 dwrq->flags = IW_ENCODE_OPEN; 1777 dwrq->flags = IW_ENCODE_OPEN;
1778 break; 1778 break;
1779 1779
1780 case wlan802_11authmodeshared: 1780 case IW_AUTH_ALG_SHARED_KEY:
1781 case wlan802_11authmodenetworkEAP: 1781 case IW_AUTH_ALG_LEAP:
1782 dwrq->flags = IW_ENCODE_RESTRICTED; 1782 dwrq->flags = IW_ENCODE_RESTRICTED;
1783 break; 1783 break;
1784 default: 1784 default:
@@ -1915,7 +1915,7 @@ static void disable_wep(struct assoc_request *assoc_req)
1915 int i; 1915 int i;
1916 1916
1917 /* Set Open System auth mode */ 1917 /* Set Open System auth mode */
1918 assoc_req->secinfo.authmode = wlan802_11authmodeopen; 1918 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
1919 1919
1920 /* Clear WEP keys and mark WEP as disabled */ 1920 /* Clear WEP keys and mark WEP as disabled */
1921 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; 1921 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
@@ -1984,9 +1984,9 @@ static int wlan_set_encode(struct net_device *dev,
1984 set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags); 1984 set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags);
1985 1985
1986 if (dwrq->flags & IW_ENCODE_RESTRICTED) { 1986 if (dwrq->flags & IW_ENCODE_RESTRICTED) {
1987 assoc_req->secinfo.authmode = wlan802_11authmodeshared; 1987 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
1988 } else if (dwrq->flags & IW_ENCODE_OPEN) { 1988 } else if (dwrq->flags & IW_ENCODE_OPEN) {
1989 assoc_req->secinfo.authmode = wlan802_11authmodeopen; 1989 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
1990 } 1990 }
1991 1991
1992out: 1992out:
@@ -2144,11 +2144,9 @@ static int wlan_set_encodeext(struct net_device *dev,
2144 goto out; 2144 goto out;
2145 2145
2146 if (dwrq->flags & IW_ENCODE_RESTRICTED) { 2146 if (dwrq->flags & IW_ENCODE_RESTRICTED) {
2147 assoc_req->secinfo.authmode = 2147 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
2148 wlan802_11authmodeshared;
2149 } else if (dwrq->flags & IW_ENCODE_OPEN) { 2148 } else if (dwrq->flags & IW_ENCODE_OPEN) {
2150 assoc_req->secinfo.authmode = 2149 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
2151 wlan802_11authmodeopen;
2152 } 2150 }
2153 2151
2154 /* Mark the various WEP bits as modified */ 2152 /* Mark the various WEP bits as modified */
@@ -2334,14 +2332,12 @@ static int wlan_set_auth(struct net_device *dev,
2334 if (dwrq->value & IW_AUTH_WPA_VERSION_WPA) { 2332 if (dwrq->value & IW_AUTH_WPA_VERSION_WPA) {
2335 assoc_req->secinfo.WPAenabled = 1; 2333 assoc_req->secinfo.WPAenabled = 1;
2336 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; 2334 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
2337 assoc_req->secinfo.authmode = 2335 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
2338 wlan802_11authmodeopen;
2339 } 2336 }
2340 if (dwrq->value & IW_AUTH_WPA_VERSION_WPA2) { 2337 if (dwrq->value & IW_AUTH_WPA_VERSION_WPA2) {
2341 assoc_req->secinfo.WPA2enabled = 1; 2338 assoc_req->secinfo.WPA2enabled = 1;
2342 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; 2339 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
2343 assoc_req->secinfo.authmode = 2340 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
2344 wlan802_11authmodeopen;
2345 } 2341 }
2346 updated = 1; 2342 updated = 1;
2347 break; 2343 break;
@@ -2359,14 +2355,11 @@ static int wlan_set_auth(struct net_device *dev,
2359 2355
2360 case IW_AUTH_80211_AUTH_ALG: 2356 case IW_AUTH_80211_AUTH_ALG:
2361 if (dwrq->value & IW_AUTH_ALG_SHARED_KEY) { 2357 if (dwrq->value & IW_AUTH_ALG_SHARED_KEY) {
2362 assoc_req->secinfo.authmode = 2358 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
2363 wlan802_11authmodeshared;
2364 } else if (dwrq->value & IW_AUTH_ALG_OPEN_SYSTEM) { 2359 } else if (dwrq->value & IW_AUTH_ALG_OPEN_SYSTEM) {
2365 assoc_req->secinfo.authmode = 2360 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
2366 wlan802_11authmodeopen;
2367 } else if (dwrq->value & IW_AUTH_ALG_LEAP) { 2361 } else if (dwrq->value & IW_AUTH_ALG_LEAP) {
2368 assoc_req->secinfo.authmode = 2362 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_LEAP;
2369 wlan802_11authmodenetworkEAP;
2370 } else { 2363 } else {
2371 ret = -EINVAL; 2364 ret = -EINVAL;
2372 } 2365 }
@@ -2380,8 +2373,7 @@ static int wlan_set_auth(struct net_device *dev,
2380 assoc_req->secinfo.WPAenabled = 1; 2373 assoc_req->secinfo.WPAenabled = 1;
2381 assoc_req->secinfo.WPA2enabled = 1; 2374 assoc_req->secinfo.WPA2enabled = 1;
2382 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; 2375 assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
2383 assoc_req->secinfo.authmode = 2376 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
2384 wlan802_11authmodeopen;
2385 } 2377 }
2386 } else { 2378 } else {
2387 assoc_req->secinfo.WPAenabled = 0; 2379 assoc_req->secinfo.WPAenabled = 0;
@@ -2438,19 +2430,7 @@ static int wlan_get_auth(struct net_device *dev,
2438 break; 2430 break;
2439 2431
2440 case IW_AUTH_80211_AUTH_ALG: 2432 case IW_AUTH_80211_AUTH_ALG:
2441 switch (adapter->secinfo.authmode) { 2433 dwrq->value = adapter->secinfo.auth_mode;
2442 case wlan802_11authmodeshared:
2443 dwrq->value = IW_AUTH_ALG_SHARED_KEY;
2444 break;
2445 case wlan802_11authmodeopen:
2446 dwrq->value = IW_AUTH_ALG_OPEN_SYSTEM;
2447 break;
2448 case wlan802_11authmodenetworkEAP:
2449 dwrq->value = IW_AUTH_ALG_LEAP;
2450 break;
2451 default:
2452 break;
2453 }
2454 break; 2434 break;
2455 2435
2456 case IW_AUTH_WPA_ENABLED: 2436 case IW_AUTH_WPA_ENABLED: