libertas cleanups (for 2.6.22)
cover libertas cleanups (for 2.6.22)
This set contains libertas cleanups for 2.6.22.
Dan
Quoted 1 line · Dan Williams
This set contains libertas cleanups for 2.6.22.
Patches 1 - 19 did not appear?
Only patch #0 (to which I'm replying) appeared.
Jeff
Quoted 6 lines · Jeff Garzik
Quoted 1 line · Dan Williams
This set contains libertas cleanups for 2.6.22.
Patches 1 - 19 did not appear?
Only patch #0 (to which I'm replying) appeared.
Was waiting until it showed up, and had to catch a bus home. Posting them now.
Dan
PATCH 1/19 libertas: remove WPA_SUPPLICANT structure
In reply to Dan WilliamsStart to normalize bss_descriptor with ieee80211_network so we can eventually replace bss_descriptor more easily.
--- drivers/net/wireless/libertas/scan.c | 115 +++++++++++++-------------------- drivers/net/wireless/libertas/scan.h | 8 ++- 2 files changed, 50 insertions(+), 73 deletions(-)
drivers/net/wireless/libertas/scan.c +45 -70
@@ -95,10 +95,9 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled - && adapter->scantable[index].wpa_supplicant.wpa_ie[0 ] != -WPA_IE - && adapter->scantable[index].wpa2_supplicant.wpa_ie[0 ] != -WPA2_IE && adapter->secinfo.Encryptionmode ==CIPHER_NONE + && adapter->scantable[index].wpa_ie[0 ] !=WPA_IE + && adapter->scantable[index].rsn_ie[0 ] !=WPA2_IE + && adapter->secinfo.Encryptionmode ==CIPHER_NONE && !adapter->scantable[index].privacy) {/* no security */ LEAVE ();
@@ -113,21 +112,17 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) }else if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled && adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled - && (adapter->scantable[index].wpa_supplicant. - wpa_ie[0 ] - ==WPA_IE ) + && (adapter->scantable[index].wpa_ie[0 ] ==WPA_IE )/* privacy bit may NOT be set in some APs like LinkSys WRT54G && adapter->scantable[index].privacy */ ) {/* WPA enabled */ - lbs_pr_debug(1, + lbs_pr_debug(1, "is_network_compatible() WPA: index=%d wpa_ie=%#x " "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s Encmode=%#x " "privacy=%#x\n", index, - adapter->scantable[index].wpa_supplicant. - wpa_ie[0], - adapter->scantable[index].wpa2_supplicant. - wpa_ie[0], + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) ? "e" : "d", (adapter->secinfo.WPAenabled) ? "e" : "d",
@@ -139,21 +134,17 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) }else if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled && !adapter->secinfo.WPAenabled && adapter->secinfo.WPA2enabled - && (adapter->scantable[index].wpa2_supplicant. - wpa_ie[0 ] - ==WPA2_IE ) + && (adapter->scantable[index].rsn_ie[0 ] ==WPA2_IE )/* privacy bit may NOT be set in some APs like LinkSys WRT54G && adapter->scantable[index].privacy */ ) {/* WPA2 enabled */ - lbs_pr_debug(1, + lbs_pr_debug(1, "is_network_compatible() WPA2: index=%d wpa_ie=%#x " "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s Encmode=%#x " "privacy=%#x\n", index, - adapter->scantable[index].wpa_supplicant. - wpa_ie[0], - adapter->scantable[index].wpa2_supplicant. - wpa_ie[0], + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) ? "e" : "d", (adapter->secinfo.WPAenabled) ? "e" : "d",
@@ -165,35 +156,30 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) }else if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled - && (adapter->scantable[index].wpa_supplicant. - wpa_ie[0 ] - !=WPA_IE ) - && (adapter->scantable[index].wpa2_supplicant. - wpa_ie[0 ] - !=WPA2_IE ) + && (adapter->scantable[index].wpa_ie[0 ] !=WPA_IE ) + && (adapter->scantable[index].rsn_ie[0 ] !=WPA2_IE ) && adapter->secinfo.Encryptionmode !=CIPHER_NONE && adapter->scantable[index].privacy) {/* dynamic WEP enabled */ -lbs_pr_debug (1 , +lbs_pr_debug (1 ,"is_network_compatible() dynamic WEP: index=%d " "wpa_ie=%#x wpa2_ie=%#x Encmode=%#x privacy=%#x\n" , index, - adapter->scantable[index].wpa_supplicant. - wpa_ie[0 ], - adapter->scantable[index].wpa2_supplicant. - wpa_ie[0 ], adapter->secinfo.Encryptionmode, + adapter->scantable[index].wpa_ie[0 ], + adapter->scantable[index].rsn_ie[0 ], + adapter->secinfo.Encryptionmode, adapter->scantable[index].privacy);LEAVE ();return index; }/* security doesn't match */ - lbs_pr_debug(1, + lbs_pr_debug(1, "is_network_compatible() FAILED: index=%d wpa_ie=%#x " "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s Encmode=%#x privacy=%#x\n", index, - adapter->scantable[index].wpa_supplicant.wpa_ie[0], - adapter->scantable[index].wpa2_supplicant.wpa_ie[0], + adapter->scantable[index].wpa_ie[0], + adapter->scantable[index].rsn_ie[0], (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) ? "e" : "d", (adapter->secinfo.WPAenabled) ? "e" : "d",
@@ -924,8 +910,6 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry,u8 founddatarateie;int bytesleftforcurrentbeacon; -struct WPA_SUPPLICANT *pwpa_supplicant; -struct WPA_SUPPLICANT *pwpa2_supplicant;struct IE_WPA *pIe;const u8 oui01[4 ] = {0x00 ,0x50 ,0xf2 ,0x01 };
@@ -962,9 +946,6 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry, bytesleftforcurrentbeacon = beaconsize; - pwpa_supplicant = &pBSSEntry->wpa_supplicant; - pwpa2_supplicant = &pBSSEntry->wpa2_supplicant; -memcpy (pBSSEntry->macaddress, pcurrentptr,ETH_ALEN ); lbs_pr_debug(1, "InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n", pBSSEntry->macaddress[0], pBSSEntry->macaddress[1],
@@ -1160,27 +1141,27 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry,#define IE_ID_LEN_FIELDS_BYTES 2 pIe = (struct IE_WPA *)pcurrentptr; -if (!memcmp (pIe->oui, oui01,sizeof (oui01))) { - pwpa_supplicant->wpa_ie_len - =min_t (size_t, elemlen +IE_ID_LEN_FIELDS_BYTES , -sizeof (pwpa_supplicant->wpa_ie)); -memcpy (pwpa_supplicant->wpa_ie, - pcurrentptr, - pwpa_supplicant->wpa_ie_len); -lbs_dbg_hex ("InterpretIE: Resp WPA_IE" , - pwpa_supplicant->wpa_ie, elemlen); - } +if (memcmp (pIe->oui, oui01,sizeof (oui01))) +break ; + + pBSSEntry->wpa_ie_len =min_t (size_t, + elemlen +IE_ID_LEN_FIELDS_BYTES , +sizeof (pBSSEntry->wpa_ie)); +memcpy (pBSSEntry->wpa_ie, pcurrentptr, + pBSSEntry->wpa_ie_len); +lbs_dbg_hex ("InterpretIE: Resp WPA_IE" , + pBSSEntry->wpa_ie, elemlen);break ;case WPA2_IE : pIe = (struct IE_WPA *)pcurrentptr; - pwpa2_supplicant->wpa_ie_len - =min_t (size_t, elemlen +IE_ID_LEN_FIELDS_BYTES , -sizeof (pwpa2_supplicant->wpa_ie)); -memcpy (pwpa2_supplicant->wpa_ie, - pcurrentptr, pwpa2_supplicant->wpa_ie_len); - + + pBSSEntry->rsn_ie_len =min_t (size_t, + elemlen +IE_ID_LEN_FIELDS_BYTES , +sizeof (pBSSEntry->rsn_ie)); +memcpy (pBSSEntry->rsn_ie, pcurrentptr, + pBSSEntry->rsn_ie_len);lbs_dbg_hex ("InterpretIE: Resp WPA2_IE" , - pwpa2_supplicant->wpa_ie, elemlen); + pBSSEntry->rsn_ie, elemlen);break ;case TIM :break ;
@@ -1745,30 +1726,24 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,/* Add new value to event */ current_val = current_ev +IW_EV_LCP_LEN ; -if (adapter->scantable[i].wpa2_supplicant.wpa_ie[0 ] ==WPA2_IE ) { +if (adapter->scantable[i].rsn_ie[0 ] ==WPA2_IE ) {memset (&iwe,0 ,sizeof (iwe));memset (buf,0 ,sizeof (buf)); -memcpy (buf, adapter->scantable[i]. - wpa2_supplicant.wpa_ie, - adapter->scantable[i].wpa2_supplicant. - wpa_ie_len); +memcpy (buf, adapter->scantable[i].rsn_ie, + adapter->scantable[i].rsn_ie_len); iwe.cmd =IWEVGENIE ; - iwe.u.data.length = adapter->scantable[i]. - wpa2_supplicant.wpa_ie_len; + iwe.u.data.length = adapter->scantable[i].rsn_ie_len; iwe.len =IW_EV_POINT_LEN + iwe.u.data.length; current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, buf); } -if (adapter->scantable[i].wpa_supplicant.wpa_ie[0 ] ==WPA_IE ) { +if (adapter->scantable[i].wpa_ie[0 ] ==WPA_IE ) {memset (&iwe,0 ,sizeof (iwe));memset (buf,0 ,sizeof (buf)); -memcpy (buf, adapter->scantable[i]. - wpa_supplicant.wpa_ie, - adapter->scantable[i].wpa_supplicant. - wpa_ie_len); +memcpy (buf, adapter->scantable[i].wpa_ie, + adapter->scantable[i].wpa_ie_len); iwe.cmd =IWEVGENIE ; - iwe.u.data.length = adapter->scantable[i]. - wpa_supplicant.wpa_ie_len; + iwe.u.data.length = adapter->scantable[i].wpa_ie_len; iwe.len =IW_EV_POINT_LEN + iwe.u.data.length; current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, buf);
drivers/net/wireless/libertas/scan.h +5 -3
@@ -10,6 +10,7 @@#ifndef _WLAN_SCAN_H#define _WLAN_SCAN_H +#include <net/ieee80211.h> #include "hostcmd.h" /**
@@ -170,9 +171,10 @@ struct bss_descriptor {struct ieeetypes_countryinfofullset countryinfo; -struct WPA_SUPPLICANT wpa_supplicant; -struct WPA_SUPPLICANT wpa2_supplicant; - +u8 wpa_ie[MAX_WPA_IE_LEN ]; +size_t wpa_ie_len; +u8 rsn_ie[MAX_WPA_IE_LEN ]; +size_t rsn_ie_len; }; extern int libertas_SSID_cmp(struct WLAN_802_11_SSID *ssid1,
Signature · 1 line
1.5.0.6
PATCH 2/19 libertas: use <net/ieee80211.h> for MAX_WPA_IE_LEN
In reply to Dan Williams--- drivers/net/wireless/libertas/dev.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/wireless/libertas/dev.h +1 -2
@@ -10,6 +10,7 @@#include <linux/wireless.h> #include <linux/ethtool.h> #include <linux/debugfs.h> +#include <net/ieee80211.h> #include "defs.h" #include "scan.h"
@@ -198,7 +199,6 @@ struct assoc_request {struct wlan_802_11_security secinfo;/** WPA Information Elements*/ -#define MAX_WPA_IE_LEN 64u8 wpa_ie[MAX_WPA_IE_LEN ];u8 wpa_ie_len; };
@@ -339,7 +339,6 @@ struct _wlan_adapter {struct WLAN_802_11_KEY wpa_unicast_key;/** WPA Information Elements*/ -#define MAX_WPA_IE_LEN 64u8 wpa_ie[MAX_WPA_IE_LEN ];u8 wpa_ie_len;
Signature · 1 line
1.5.0.6
PATCH 3/19 libertas: fix size of SSID comparison in stop_adhoc check
In reply to Dan Williams--- drivers/net/wireless/libertas/assoc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/libertas/assoc.c +1 -1
@@ -333,7 +333,7 @@ static int should_stop_adhoc(wlan_adapter *adapter,if (adapter->curbssparams.ssid.ssidlength != assoc_req->ssid.ssidlength)return 1 ;if (memcmp (adapter->curbssparams.ssid.ssid, assoc_req->ssid.ssid, -sizeof (struct WLAN_802_11_SSID ))) + adapter->curbssparams.ssid.ssidlength))return 1 ;/* FIXME: deal with 'auto' mode somehow */
Signature · 1 line
1.5.0.6
PATCH 4/19 libertas: remove 8021xauthalgs private ioctl
In reply to Dan WilliamsUseless; it set an internal variable that was unused anyway. A supplicant handles all 802.1x authentication, not the driver.
--- drivers/net/wireless/libertas/defs.h | 9 --------- drivers/net/wireless/libertas/dev.h | 1 - drivers/net/wireless/libertas/fw.c | 1 - drivers/net/wireless/libertas/ioctl.c | 30 ------------------------------ drivers/net/wireless/libertas/wext.c | 6 ------ 5 files changed, 0 insertions(+), 47 deletions(-)
drivers/net/wireless/libertas/defs.h +0 -9
@@ -230,15 +230,6 @@ enum WLAN_802_11_AUTH_ALG { AUTH_ALG_NETWORK_EAP = 8, }; -/** WLAN_802_1X_AUTH_ALG */ -enum WLAN_802_1X_AUTH_ALG { -WLAN_1X_AUTH_ALG_NONE =1 , -WLAN_1X_AUTH_ALG_LEAP =2 , -WLAN_1X_AUTH_ALG_TLS =4 , -WLAN_1X_AUTH_ALG_TTLS =8 , -WLAN_1X_AUTH_ALG_MD5 =16 , -}; -/** WLAN_802_11_ENCRYPTION_MODE */ enum WLAN_802_11_ENCRYPTION_MODE {CIPHER_NONE ,
drivers/net/wireless/libertas/dev.h +0 -1
@@ -59,7 +59,6 @@ struct wlan_802_11_security {u8 WPA2enabled;enum WLAN_802_11_WEP_STATUS WEPstatus;enum WLAN_802_11_AUTHENTICATION_MODE authmode; -enum WLAN_802_1X_AUTH_ALG auth1xalg;enum WLAN_802_11_ENCRYPTION_MODE Encryptionmode; };
drivers/net/wireless/libertas/fw.c +0 -1
@@ -201,7 +201,6 @@ static void wlan_init_adapter(wlan_private * priv) adapter->wep_tx_keyidx =0 ; adapter->secinfo.WEPstatus = wlan802_11WEPdisabled; adapter->secinfo.authmode = wlan802_11authmodeopen; - adapter->secinfo.auth1xalg =WLAN_1X_AUTH_ALG_NONE ; adapter->secinfo.Encryptionmode =CIPHER_NONE ; adapter->inframode = wlan802_11infrastructure;
drivers/net/wireless/libertas/ioctl.c +0 -30
@@ -618,32 +618,6 @@ static int wlan_setauthalg_ioctl(wlan_private * priv, struct ifreq *req)return 0 ; } -/** -* @brief Set 802.1x authentication mode -* @param priv A pointer to wlan_private structure -* @param req A pointer to ifreq structure -* @return 0 --success, otherwise fail -*/ -static int wlan_set8021xauthalg_ioctl (wlan_private * priv,struct ifreq *req) -{ -int alg; -struct iwreq *wrq = (struct iwreq *)req; - -if (wrq->u.data.flags ==0 ) { -//from iwpriv subcmd - alg =SUBCMD_DATA (wrq); - }else { -//from wpa_supplicant subcmd -if (copy_from_user (&alg, wrq->u.data.pointer,sizeof (int ))) { -lbs_pr_debug (1 ,"Copy from user failed\n" ); -return -EFAULT ; - } - } -lbs_pr_debug (1 ,"802.1x auth alg is %#x\n" , alg); - priv->adapter->secinfo.auth1xalg = alg; -return 0 ; -} -static int wlan_setencryptionmode_ioctl (wlan_private * priv,struct ifreq *req) {int mode;
@@ -2073,10 +2047,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ret =wlan_setauthalg_ioctl (priv, req);break ; -case WLANSET8021XAUTHALG : - ret =wlan_set8021xauthalg_ioctl (priv, req); -break ; -case WLANSETENCRYPTIONMODE : ret =wlan_setencryptionmode_ioctl (priv, req);break ;
drivers/net/wireless/libertas/wext.c +0 -6
@@ -1088,12 +1088,6 @@ static const struct iw_priv_args wlan_private_args[] = {"authalgs" , }, { -WLANSET8021XAUTHALG , -IW_PRIV_TYPE_INT |IW_PRIV_SIZE_FIXED |1 , -IW_PRIV_TYPE_NONE , -"8021xauthalgs" , - }, - {WLANSETENCRYPTIONMODE ,IW_PRIV_TYPE_INT |IW_PRIV_SIZE_FIXED |1 , IW_PRIV_TYPE_NONE,
Signature · 1 line
1.5.0.6
PATCH 5/19 libertas: remove setauthalg private ioctl
In reply to Dan WilliamsObsoleted by SIOCSIWAUTH's IW_AUTH_80211_AUTH_ALG option introduced by WE-18.
--- drivers/net/wireless/libertas/defs.h | 7 ----- drivers/net/wireless/libertas/ioctl.c | 45 --------------------------------- drivers/net/wireless/libertas/wext.c | 6 ---- 3 files changed, 0 insertions(+), 58 deletions(-)
(quoted diff) +0 -0
b/drivers/net/wireless/libertas/defs.h
index 888a007..15fcb2c 100644
drivers/net/wireless/libertas/defs.h +0 -7
@@ -223,13 +223,6 @@ enum SNRNF_DATA {MAX_TYPE_AVG }; -/** WLAN_802_11_AUTH_ALG*/ -enum WLAN_802_11_AUTH_ALG { -AUTH_ALG_OPEN_SYSTEM =1 , -AUTH_ALG_SHARED_KEY =2 , -AUTH_ALG_NETWORK_EAP =8 , -}; -/** WLAN_802_11_ENCRYPTION_MODE */ enum WLAN_802_11_ENCRYPTION_MODE {CIPHER_NONE ,
(quoted diff) +0 -0
b/drivers/net/wireless/libertas/ioctl.c
index c53c0f9..f70930a 100644
drivers/net/wireless/libertas/ioctl.c +0 -0
@@ -577,47 +577,6 @@ static int
wlan_set_multiple_dtim_ioctl(wlan_private * priv, struct ifreq *req)
return ret;
}
-/**
- * @brief Set authentication mode - * @param priv A pointer to wlan_private structure - * @param req A pointer to ifreq structure - * @return 0 --success, otherwise fail
- */
-static int wlan_setauthalg_ioctl(wlan_private * priv, struct ifreq *req)
-{
- int alg;
- struct iwreq *wrq = (struct iwreq *)req;
- wlan_adapter *adapter = priv->adapter;
-
- if (wrq->u.data.flags == 0) {
- //from iwpriv subcmd
- alg = SUBCMD_DATA(wrq);
- } else {
- //from wpa_supplicant subcmd
- if (copy_from_user(&alg, wrq->u.data.pointer, sizeof(alg))) {
- lbs_pr_debug(1, "Copy from user failed\n");
- return -EFAULT;
- }
- }
-
- lbs_pr_debug(1, "auth alg is %#x\n", alg);
-
- switch (alg) {
- case AUTH_ALG_SHARED_KEY:
- adapter->secinfo.authmode = wlan802_11authmodeshared;
- break;
- case AUTH_ALG_NETWORK_EAP:
- adapter->secinfo.authmode =
- wlan802_11authmodenetworkEAP;
- break;
- case AUTH_ALG_OPEN_SYSTEM:
- default:
- adapter->secinfo.authmode = wlan802_11authmodeopen;
- break;
- }
- return 0;
-}
-
static int wlan_setencryptionmode_ioctl(wlan_private * priv, struct
ifreq *req)
{
int mode;
@@ -2043,10 +2002,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
ret = wlan_set_multiple_dtim_ioctl(priv, req); break;
- case WLANSETAUTHALG:
- ret = wlan_setauthalg_ioctl(priv, req);
- break;
-
case WLANSETENCRYPTIONMODE:
ret = wlan_setencryptionmode_ioctl(priv, req); break;
(quoted diff) +0 -0
b/drivers/net/wireless/libertas/wext.c
index 81ee83c..d161787 100644
drivers/net/wireless/libertas/wext.c +0 -0
@@ -1082,12 +1082,6 @@ static const struct iw_priv_args
wlan_private_args[] = {
IW_PRIV_TYPE_NONE,
"settxant"},
{
- WLANSETAUTHALG,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- IW_PRIV_TYPE_NONE,
- "authalgs",
- },
- {
WLANSETENCRYPTIONMODE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_NONE,
Signature · 1 line
1.5.0.6
PATCH 5/19 libertas: remove setauthalg private ioctl
I screwed up formatting, please use this one.
Obsoleted by SIOCSIWAUTH's IW_AUTH_80211_AUTH_ALG option introduced by WE-18.
--- drivers/net/wireless/libertas/defs.h | 7 ----- drivers/net/wireless/libertas/ioctl.c | 45 --------------------------------- drivers/net/wireless/libertas/wext.c | 6 ---- 3 files changed, 0 insertions(+), 58 deletions(-)
drivers/net/wireless/libertas/defs.h +0 -7
@@ -223,13 +223,6 @@ enum SNRNF_DATA {MAX_TYPE_AVG }; -/** WLAN_802_11_AUTH_ALG*/ -enum WLAN_802_11_AUTH_ALG { -AUTH_ALG_OPEN_SYSTEM =1 , -AUTH_ALG_SHARED_KEY =2 , -AUTH_ALG_NETWORK_EAP =8 , -}; -/** WLAN_802_11_ENCRYPTION_MODE */ enum WLAN_802_11_ENCRYPTION_MODE {CIPHER_NONE ,
drivers/net/wireless/libertas/ioctl.c +0 -45
57 lines not on this page · raw message
drivers/net/wireless/libertas/wext.c +0 -6
@@ -1082,12 +1082,6 @@ static const struct iw_priv_args wlan_private_args[] = {IW_PRIV_TYPE_NONE , "settxant"}, { -WLANSETAUTHALG , -IW_PRIV_TYPE_INT |IW_PRIV_SIZE_FIXED |1 , -IW_PRIV_TYPE_NONE , -"authalgs" , - }, - {WLANSETENCRYPTIONMODE ,IW_PRIV_TYPE_INT |IW_PRIV_SIZE_FIXED |1 , IW_PRIV_TYPE_NONE,
Signature · 1 line
1.5.0.6
PATCH 6/19 libertas: remove incorrect vi modelines
In reply to Dan Williams--- drivers/net/wireless/libertas/join.h | 3 --- drivers/net/wireless/libertas/scan.c | 3 --- drivers/net/wireless/libertas/scan.h | 3 --- 3 files changed, 0 insertions(+), 9 deletions(-)
(quoted diff) +0 -0
b/drivers/net/wireless/libertas/join.h
index 8efa245..0e6d928 100644
drivers/net/wireless/libertas/join.h +0 -3
@@ -1,6 +1,3 @@ -/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */ -/** * Interface for the wlan infrastructure and adhoc join routines *
(quoted diff) +0 -0
b/drivers/net/wireless/libertas/scan.c
index 400558a..29b1192 100644
drivers/net/wireless/libertas/scan.c +0 -3
@@ -1,6 +1,3 @@ -/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */ -/** * Functions implementing wlan scan IOCTL and firmware command APIs *
(quoted diff) +0 -0
b/drivers/net/wireless/libertas/scan.h
index 1a8756e..486bdc4 100644
drivers/net/wireless/libertas/scan.h +0 -3
@@ -1,6 +1,3 @@ -/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */ -/** * Interface for the wlan network scan routines *
Signature · 1 line
1.5.0.6
PATCH 6/19 libertas: remove incorrect vi modelines
I screwed up formatting, please use this one.
--- drivers/net/wireless/libertas/join.h | 3 --- drivers/net/wireless/libertas/scan.c | 3 --- drivers/net/wireless/libertas/scan.h | 3 --- 3 files changed, 0 insertions(+), 9 deletions(-)
drivers/net/wireless/libertas/join.h +0 -3
@@ -1,6 +1,3 @@ -/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */ -/** * Interface for the wlan infrastructure and adhoc join routines *
drivers/net/wireless/libertas/scan.c +0 -3
@@ -1,6 +1,3 @@ -/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */ -/** * Functions implementing wlan scan IOCTL and firmware command APIs *
drivers/net/wireless/libertas/scan.h +0 -3
@@ -1,6 +1,3 @@ -/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */ -/** * Interface for the wlan network scan routines *
Signature · 1 line
1.5.0.6
PATCH 7/19 libertas: remove setencryptionmode private ioctl and Encryptionmode variable
In reply to Dan WilliamsMostly unused, and its functionality is provided by other internal members like WEPstatus, WPAenabled, WPA2enabled, and SIOCSIWGENIE.
--- drivers/net/wireless/libertas/cmdresp.c | 2 -- drivers/net/wireless/libertas/defs.h | 9 --------- drivers/net/wireless/libertas/dev.h | 1 - drivers/net/wireless/libertas/fw.c | 1 - drivers/net/wireless/libertas/ioctl.c | 28 ---------------------------- drivers/net/wireless/libertas/scan.c | 17 +++++------------ 6 files changed, 5 insertions(+), 53 deletions(-)
drivers/net/wireless/libertas/cmdresp.c +0 -2
@@ -72,8 +72,6 @@ void libertas_mac_event_disconnected(wlan_private * priv) adapter->secinfo.WPAenabled =0 ; adapter->secinfo.WPA2enabled =0 ; adapter->wpa_ie_len =0 ; - adapter->secinfo.auth1xalg =WLAN_1X_AUTH_ALG_NONE ; - adapter->secinfo.Encryptionmode =CIPHER_NONE ; adapter->connect_status = libertas_disconnected;
drivers/net/wireless/libertas/defs.h +0 -9
@@ -223,15 +223,6 @@ enum SNRNF_DATA {MAX_TYPE_AVG }; -/** WLAN_802_11_ENCRYPTION_MODE */ -enum WLAN_802_11_ENCRYPTION_MODE { -CIPHER_NONE , -CIPHER_WEP40 , -CIPHER_TKIP , -CIPHER_CCMP , -CIPHER_WEP104 , -}; -/** WLAN_802_11_POWER_MODE */ enum WLAN_802_11_POWER_MODE { wlan802_11powermodecam,
drivers/net/wireless/libertas/dev.h +0 -1
@@ -59,7 +59,6 @@ struct wlan_802_11_security {u8 WPA2enabled;enum WLAN_802_11_WEP_STATUS WEPstatus;enum WLAN_802_11_AUTHENTICATION_MODE authmode; -enum WLAN_802_11_ENCRYPTION_MODE Encryptionmode; };/** Current Basic Service Set State Structure */
drivers/net/wireless/libertas/fw.c +0 -1
@@ -201,7 +201,6 @@ static void wlan_init_adapter(wlan_private * priv) adapter->wep_tx_keyidx =0 ; adapter->secinfo.WEPstatus = wlan802_11WEPdisabled; adapter->secinfo.authmode = wlan802_11authmodeopen; - adapter->secinfo.Encryptionmode =CIPHER_NONE ; adapter->inframode = wlan802_11infrastructure; adapter->assoc_req =NULL ;
drivers/net/wireless/libertas/ioctl.c +0 -28
@@ -577,30 +577,6 @@ static int wlan_set_multiple_dtim_ioctl(wlan_private * priv, struct ifreq *req)return ret; } -static int wlan_setencryptionmode_ioctl (wlan_private * priv,struct ifreq *req) -{ -int mode; -struct iwreq *wrq = (struct iwreq *)req; - -ENTER (); - -if (wrq->u.data.flags ==0 ) { -//from iwpriv subcmd - mode =SUBCMD_DATA (wrq); - }else { -//from wpa_supplicant subcmd -if (copy_from_user (&mode, wrq->u.data.pointer,sizeof (int ))) { -lbs_pr_debug (1 ,"Copy from user failed\n" ); -return -EFAULT ; - } - } -lbs_pr_debug (1 ,"encryption mode is %#x\n" , mode); - priv->adapter->secinfo.Encryptionmode = mode; - -LEAVE (); -return 0 ; -} -static void adjust_mtu (wlan_private * priv) {int mtu_increment =0 ;
@@ -2002,10 +1978,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ret =wlan_set_multiple_dtim_ioctl (priv, req);break ; -case WLANSETENCRYPTIONMODE : - ret =wlan_setencryptionmode_ioctl (priv, req); -break ; -case WLAN_SET_LINKMODE : ret =wlan_set_linkmode_ioctl (priv, req);break ;
drivers/net/wireless/libertas/scan.c +5 -12
@@ -94,7 +94,6 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) && !adapter->secinfo.WPA2enabled && adapter->scantable[index].wpa_ie[0] != WPA_IE && adapter->scantable[index].rsn_ie[0] != WPA2_IE - && adapter->secinfo.Encryptionmode == CIPHER_NONE && !adapter->scantable[index].privacy) {/* no security */ LEAVE ();
@@ -116,7 +115,7 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)/* WPA enabled */ lbs_pr_debug(1, "is_network_compatible() WPA: index=%d wpa_ie=%#x " - "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s Encmode=%#x " + "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " "privacy=%#x\n", index, adapter->scantable[index].wpa_ie[0], adapter->scantable[index].rsn_ie[0],
@@ -124,7 +123,6 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) wlan802_11WEPenabled) ? "e" : "d", (adapter->secinfo.WPAenabled) ?"e" :"d" , (adapter->secinfo.WPA2enabled) ?"e" :"d" , - adapter->secinfo.Encryptionmode, adapter->scantable[index].privacy);LEAVE ();return index;
@@ -138,7 +136,7 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)/* WPA2 enabled */ lbs_pr_debug(1, "is_network_compatible() WPA2: index=%d wpa_ie=%#x " - "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s Encmode=%#x " + "wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s " "privacy=%#x\n", index, adapter->scantable[index].wpa_ie[0], adapter->scantable[index].rsn_ie[0],
@@ -146,7 +144,6 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) wlan802_11WEPenabled) ? "e" : "d", (adapter->secinfo.WPAenabled) ?"e" :"d" , (adapter->secinfo.WPA2enabled) ?"e" :"d" , - adapter->secinfo.Encryptionmode, adapter->scantable[index].privacy);LEAVE ();return index;
@@ -155,16 +152,14 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) && !adapter->secinfo.WPA2enabled && (adapter->scantable[index].wpa_ie[0] != WPA_IE) && (adapter->scantable[index].rsn_ie[0] != WPA2_IE) - && adapter->secinfo.Encryptionmode != CIPHER_NONE && adapter->scantable[index].privacy) {/* dynamic WEP enabled */ lbs_pr_debug (1 ,"is_network_compatible() dynamic WEP: index=%d " -"wpa_ie=%#x wpa2_ie=%#x Encmode=%#x privacy=%#x\n" , +"wpa_ie=%#x wpa2_ie=%#x privacy=%#x\n" , index, adapter->scantable[index].wpa_ie[0 ], adapter->scantable[index].rsn_ie[0 ], - adapter->secinfo.Encryptionmode, adapter->scantable[index].privacy);LEAVE ();return index;
@@ -173,15 +168,13 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)/* security doesn't match */ lbs_pr_debug (1 ,"is_network_compatible() FAILED: index=%d wpa_ie=%#x " -"wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s Encmode=%#x privacy=%#x\n" , +"wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s privacy=%#x\n" , index, adapter->scantable[index].wpa_ie[0 ], adapter->scantable[index].rsn_ie[0 ], - (adapter->secinfo.WEPstatus == - wlan802_11WEPenabled) ?"e" :"d" , + (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) ?"e" :"d" , (adapter->secinfo.WPAenabled) ?"e" :"d" , (adapter->secinfo.WPA2enabled) ?"e" :"d" , - adapter->secinfo.Encryptionmode, adapter->scantable[index].privacy);LEAVE ();return -ECONNREFUSED ;
Signature · 1 line
1.5.0.6
PATCH 8/19 libertas: remove setwpaie private ioctl
In reply to Dan WilliamsObsoleted by SIOCSIWGENIE.
--- drivers/net/wireless/libertas/ioctl.c | 58 --------------------------------- drivers/net/wireless/libertas/wext.c | 5 --- 2 files changed, 0 insertions(+), 63 deletions(-)
drivers/net/wireless/libertas/ioctl.c +0 -58
@@ -478,61 +478,6 @@ static int wlan_get_adhoc_status_ioctl(wlan_private * priv, struct iwreq *wrq) }/** -* @brief Set/Get WPA IE -* @param priv A pointer to wlan_private structure -* @param req A pointer to ifreq structure -* @return 0 --success, otherwise fail -*/ -static int wlan_setwpaie_ioctl (wlan_private * priv,struct ifreq *req) -{ -struct iwreq *wrq = (struct iwreq *)req; -wlan_adapter *adapter = priv->adapter; -int ret =0 ; - -ENTER (); - -if (wrq->u.data.length) { -if (wrq->u.data.length >sizeof (adapter->wpa_ie)) { -lbs_pr_debug (1 ,"failed to copy WPA IE, too big \n" ); -return -EFAULT ; - } -if (copy_from_user (adapter->wpa_ie, wrq->u.data.pointer, - wrq->u.data.length)) { -lbs_pr_debug (1 ,"failed to copy WPA IE \n" ); -return -EFAULT ; - } - adapter->wpa_ie_len = wrq->u.data.length; -lbs_pr_debug (1 ,"Set wpa_ie_len=%d IE=%#x\n" , adapter->wpa_ie_len, - adapter->wpa_ie[0 ]); -lbs_dbg_hex ("wpa_ie" , adapter->wpa_ie, adapter->wpa_ie_len); -if (adapter->wpa_ie[0 ] ==WPA_IE ) - adapter->secinfo.WPAenabled =1 ; -else if (adapter->wpa_ie[0 ] ==WPA2_IE ) - adapter->secinfo.WPA2enabled =1 ; -else { - adapter->secinfo.WPAenabled =0 ; - adapter->secinfo.WPA2enabled =0 ; - } - }else { -memset (adapter->wpa_ie,0 ,sizeof (adapter->wpa_ie)); - adapter->wpa_ie_len = wrq->u.data.length; -lbs_pr_debug (1 ,"Reset wpa_ie_len=%d IE=%#x\n" , - adapter->wpa_ie_len, adapter->wpa_ie[0 ]); - adapter->secinfo.WPAenabled =0 ; - adapter->secinfo.WPA2enabled =0 ; - } - -// enable/disable RSN in firmware if WPA is enabled/disabled -// depending on variable adapter->secinfo.WPAenabled is set or not - ret =libertas_prepare_and_send_command (priv, cmd_802_11_enable_rsn, - cmd_act_set, cmd_option_waitforrsp, -0 ,NULL ); - -LEAVE (); -return ret; -} - -/** * @brief Set Auto prescan * @param priv A pointer to wlan_private structure * @param wrq A pointer to iwreq structure
@@ -1846,9 +1791,6 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) }/* End of switch */ break ; -case WLANSETWPAIE : - ret =wlan_setwpaie_ioctl (priv, req); -break ;case WLAN_SETINT_GETINT :/* The first 4 bytes of req->ifr_data is sub-ioctl number * after 4 bytes sits the payload.
drivers/net/wireless/libertas/wext.c +0 -5
@@ -1330,11 +1330,6 @@ static const struct iw_priv_args wlan_private_args[] = {IW_PRIV_TYPE_CHAR |128 , ""}, { -WLANSETWPAIE , -IW_PRIV_TYPE_CHAR |IW_PRIV_SIZE_FIXED |24 , -IW_PRIV_TYPE_NONE , - "setwpaie"}, - {WLANGETLOG ,IW_PRIV_TYPE_NONE , IW_PRIV_TYPE_CHAR | GETLOG_BUFSIZE,
Signature · 1 line
1.5.0.6
PATCH 9/19 libertas: Use standard values instead of WLAN_802_11_AUTHENTICATION_MODE
In reply to Dan WilliamsRemove WLAN_802_11_AUTHENTICATION_MODE enum and use IW_AUTH_ALG_* instead.
--- drivers/net/wireless/libertas/assoc.c | 3 +- drivers/net/wireless/libertas/defs.h | 7 ---- drivers/net/wireless/libertas/dev.h | 2 +- drivers/net/wireless/libertas/fw.c | 2 +- drivers/net/wireless/libertas/join.c | 31 +++++++++++++++---- drivers/net/wireless/libertas/wext.c | 52 ++++++++++---------------------- 6 files changed, 43 insertions(+), 54 deletions(-)
drivers/net/wireless/libertas/assoc.c +1 -2
@@ -300,8 +300,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter, }if (test_bit (ASSOC_FLAG_SECINFO , &assoc_req->flags)) { -if (adapter->secinfo.authmode != - assoc_req->secinfo.authmode) { +if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) {lbs_pr_debug (1 ,"Deauthenticating due to updated security " "info in configuration request.\n" );return 1 ;
drivers/net/wireless/libertas/defs.h +0 -7
@@ -276,13 +276,6 @@ enum WLAN_802_11_NETWORK_INFRASTRUCTURE {wlan802_11infrastructuremax }; -/** WLAN_802_11_AUTHENTICATION_MODE */ -enum WLAN_802_11_AUTHENTICATION_MODE { - wlan802_11authmodeopen =0x00 , - wlan802_11authmodeshared =0x01 , - wlan802_11authmodenetworkEAP =0x80 , -}; -/** WLAN_802_11_WEP_STATUS */ enum WLAN_802_11_WEP_STATUS { wlan802_11WEPenabled,
drivers/net/wireless/libertas/dev.h +1 -1
@@ -58,7 +58,7 @@ struct wlan_802_11_security {u8 WPAenabled;u8 WPA2enabled;enum WLAN_802_11_WEP_STATUS WEPstatus; -enum WLAN_802_11_AUTHENTICATION_MODE authmode; +u8 auth_mode; };/** Current Basic Service Set State Structure */
drivers/net/wireless/libertas/fw.c +1 -1
@@ -200,7 +200,7 @@ static void wlan_init_adapter(wlan_private * priv)memset (&adapter->wep_keys[i],0 ,sizeof (struct WLAN_802_11_KEY )); adapter->wep_tx_keyidx =0 ; adapter->secinfo.WEPstatus = wlan802_11WEPdisabled; - adapter->secinfo.authmode = wlan802_11authmodeopen; + adapter->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ; adapter->inframode = wlan802_11infrastructure; adapter->assoc_req =NULL ;
drivers/net/wireless/libertas/join.c +24 -7
@@ -398,22 +398,39 @@ int libertas_cmd_80211_authenticate(wlan_private * priv, void *pdata_buf) {wlan_adapter *adapter = priv->adapter; -struct cmd_ds_802_11_authenticate *pauthenticate = - &cmd->params.auth; +struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth; +int ret =-1 ;u8 *bssid = pdata_buf; cmd->command =cpu_to_le16 (cmd_802_11_authenticate); - cmd->size = -cpu_to_le16 (sizeof (struct cmd_ds_802_11_authenticate ) - +S_DS_GEN ); + cmd->size =cpu_to_le16 (sizeof (struct cmd_ds_802_11_authenticate ) + +S_DS_GEN ); + +/* translate auth mode to 802.11 defined wire value */ +switch (adapter->secinfo.auth_mode) { +case IW_AUTH_ALG_OPEN_SYSTEM : + pauthenticate->authtype =0x00 ; +break ; +case IW_AUTH_ALG_SHARED_KEY : + pauthenticate->authtype =0x01 ; +break ; +case IW_AUTH_ALG_LEAP : + pauthenticate->authtype =0x80 ; +break ; +default : +lbs_pr_debug (1 ,"AUTH_CMD: invalid auth alg 0x%X\n" , + adapter->secinfo.auth_mode); + goto out; + } - pauthenticate->authtype = adapter->secinfo.authmode;memcpy (pauthenticate->macaddr, bssid,ETH_ALEN );lbs_pr_debug (1 ,"AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n" , bssid[0 ], bssid[1 ], bssid[2 ], bssid[3 ], bssid[4 ], bssid[5 ]); + ret =0 ; -return 0 ; +out: +return ret; } int libertas_cmd_80211_deauthenticate(wlan_private * priv,
drivers/net/wireless/libertas/wext.c +16 -36
111 lines not on this page · raw message
Signature · 1 line
1.5.0.6
PATCH 10/19 libertas: remove WLAN_802_11_WEP_STATUS enum
In reply to Dan WilliamsAlso change WEPstatus to "wep_enabled"; it's clearer and consistent with the WPAenabled and WPA2enabled members.
--- drivers/net/wireless/libertas/assoc.c | 2 +- drivers/net/wireless/libertas/defs.h | 6 ----- drivers/net/wireless/libertas/dev.h | 2 +- drivers/net/wireless/libertas/fw.c | 3 +- drivers/net/wireless/libertas/join.c | 13 +++++------ drivers/net/wireless/libertas/scan.c | 30 +++++++++++------------- drivers/net/wireless/libertas/wext.c | 39 ++++++++++++++++----------------- 7 files changed, 42 insertions(+), 53 deletions(-)
drivers/net/wireless/libertas/assoc.c +1 -1
@@ -196,7 +196,7 @@ static int assoc_helper_wep_keys(wlan_private *priv, goto out;/* enable/disable the MAC's WEP packet filter */ -if (assoc_req->secinfo.WEPstatus == wlan802_11WEPenabled) +if (assoc_req->secinfo.wep_enabled) adapter->currentpacketfilter |= cmd_act_mac_wep_enable;else adapter->currentpacketfilter &= ~cmd_act_mac_wep_enable;
drivers/net/wireless/libertas/defs.h +0 -6
@@ -276,12 +276,6 @@ enum WLAN_802_11_NETWORK_INFRASTRUCTURE {wlan802_11infrastructuremax }; -/** WLAN_802_11_WEP_STATUS */ -enum WLAN_802_11_WEP_STATUS { - wlan802_11WEPenabled, - wlan802_11WEPdisabled, -}; -/** SNMP_MIB_INDEX_e */ enum SNMP_MIB_INDEX_e { desired_bsstype_i =0 ,
drivers/net/wireless/libertas/dev.h +1 -1
@@ -57,7 +57,7 @@ struct region_channel {struct wlan_802_11_security {u8 WPAenabled;u8 WPA2enabled; -enum WLAN_802_11_WEP_STATUS WEPstatus; +u8 wep_enabled;u8 auth_mode; };
drivers/net/wireless/libertas/fw.c +1 -2
@@ -194,12 +194,11 @@ static void wlan_init_adapter(wlan_private * priv) adapter->scanmode = cmd_bss_type_any;/* 802.11 specific */ - adapter->secinfo.WEPstatus = wlan802_11WEPdisabled; + adapter->secinfo.wep_enabled =0 ;for (i =0 ; i <sizeof (adapter->wep_keys) /sizeof (adapter->wep_keys[0 ]); i++)memset (&adapter->wep_keys[i],0 ,sizeof (struct WLAN_802_11_KEY )); adapter->wep_tx_keyidx =0 ; - adapter->secinfo.WEPstatus = wlan802_11WEPdisabled; adapter->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ; adapter->inframode = wlan802_11infrastructure;
drivers/net/wireless/libertas/join.c +6 -7
@@ -15,6 +15,8 @@#include "join.h" #include "dev.h" +#define AD_HOC_CAP_PRIVACY_ON 1 +/** * @brief This function finds out the common rates between rate1 and rate2. *
@@ -683,15 +685,12 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, adhs->probedelay =cpu_to_le16 (cmd_scan_probe_delay_time);/* set up privacy in adapter->scantable[i] */ -if (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) { - -#define AD_HOC_CAP_PRIVACY_ON 1 -lbs_pr_debug (1 ,"ADHOC_S_CMD: WEPstatus set, privacy to WEP\n" ); +if (adapter->secinfo.wep_enabled) { +lbs_pr_debug (1 ,"ADHOC_S_CMD: WEP enabled, setting privacy on\n" ); pbssdesc->privacy = wlan802_11privfilter8021xWEP; adhs->cap.privacy =AD_HOC_CAP_PRIVACY_ON ; }else { -lbs_pr_debug (1 ,"ADHOC_S_CMD: WEPstatus NOT set, Setting " -"privacy to ACCEPT ALL\n" ); +lbs_pr_debug (1 ,"ADHOC_S_CMD: WEP disabled, setting privacy off\n" ); pbssdesc->privacy = wlan802_11privfilteracceptall; }
@@ -849,7 +848,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, padhocjoin->bssdescriptor.ssparamset.ibssparamset.atimwindow =cpu_to_le16 (pbssdesc->atimwindow); -if (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) { +if (adapter->secinfo.wep_enabled) { padhocjoin->bssdescriptor.cap.privacy =AD_HOC_CAP_PRIVACY_ON ; }
drivers/net/wireless/libertas/scan.c +14 -16
@@ -89,7 +89,7 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)ENTER ();if (adapter->scantable[index].inframode == mode) { -if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled +if ( !adapter->secinfo.wep_enabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled && adapter->scantable[index].wpa_ie[0] != WPA_IE
@@ -98,14 +98,14 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)/* no security */ LEAVE ();return index; - }else if (adapter->secinfo.WEPstatus == wlan802_11WEPenabled + }else if ( adapter->secinfo.wep_enabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled && adapter->scantable[index].privacy) {/* static WEP enabled */ LEAVE ();return index; - }else if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled + }else if ( !adapter->secinfo.wep_enabled && adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled && (adapter->scantable[index].wpa_ie[0] == WPA_IE)
@@ -119,14 +119,13 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)"privacy=%#x\n" , index, adapter->scantable[index].wpa_ie[0 ], adapter->scantable[index].rsn_ie[0 ], - (adapter->secinfo.WEPstatus == - wlan802_11WEPenabled) ?"e" :"d" , - (adapter->secinfo.WPAenabled) ?"e" :"d" , - (adapter->secinfo.WPA2enabled) ?"e" :"d" , + adapter->secinfo.wep_enabled ?"e" :"d" , + adapter->secinfo.WPAenabled ?"e" :"d" , + adapter->secinfo.WPA2enabled ?"e" :"d" , adapter->scantable[index].privacy);LEAVE ();return index; - }else if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled + }else if ( !adapter->secinfo.wep_enabled && !adapter->secinfo.WPAenabled && adapter->secinfo.WPA2enabled && (adapter->scantable[index].rsn_ie[0] == WPA2_IE)
@@ -140,14 +139,13 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode)"privacy=%#x\n" , index, adapter->scantable[index].wpa_ie[0 ], adapter->scantable[index].rsn_ie[0 ], - (adapter->secinfo.WEPstatus == - wlan802_11WEPenabled) ?"e" :"d" , - (adapter->secinfo.WPAenabled) ?"e" :"d" , - (adapter->secinfo.WPA2enabled) ?"e" :"d" , + adapter->secinfo.wep_enabled ?"e" :"d" , + adapter->secinfo.WPAenabled ?"e" :"d" , + adapter->secinfo.WPA2enabled ?"e" :"d" , adapter->scantable[index].privacy);LEAVE ();return index; - }else if (adapter->secinfo.WEPstatus == wlan802_11WEPdisabled + }else if ( !adapter->secinfo.wep_enabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled && (adapter->scantable[index].wpa_ie[0] != WPA_IE)
@@ -172,9 +170,9 @@ static int is_network_compatible(wlan_adapter * adapter, int index, int mode) index, adapter->scantable[index].wpa_ie[0 ], adapter->scantable[index].rsn_ie[0 ], - (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) ?"e" :"d" , - (adapter->secinfo.WPAenabled) ?"e" :"d" , - (adapter->secinfo.WPA2enabled) ?"e" :"d" , + adapter->secinfo.wep_enabled ?"e" :"d" , + adapter->secinfo.WPAenabled ?"e" :"d" , + adapter->secinfo.WPA2enabled ?"e" :"d" , adapter->scantable[index].privacy);LEAVE ();return -ECONNREFUSED ;
drivers/net/wireless/libertas/wext.c +19 -20
@@ -1556,8 +1556,7 @@ static int wlan_set_freq(struct net_device *dev, struct iw_request_info *info,/* If station is WEP enabled, send the * command to set WEP in firmware */ -if (adapter->secinfo.WEPstatus == - wlan802_11WEPenabled) { +if (adapter->secinfo.wep_enabled) {lbs_pr_debug (1 ,"set_freq: WEP enabled\n" ); ret = libertas_prepare_and_send_command(priv, cmd_802_11_set_wep,
@@ -1786,8 +1785,9 @@ static int wlan_get_encode(struct net_device *dev,break ; } -if ((adapter->secinfo.WEPstatus == wlan802_11WEPenabled) - || adapter->secinfo.WPAenabled || adapter->secinfo.WPA2enabled) { +if ( adapter->secinfo.wep_enabled + || adapter->secinfo.WPAenabled + || adapter->secinfo.WPA2enabled) { dwrq->flags &= ~IW_ENCODE_DISABLED ; }else { dwrq->flags |=IW_ENCODE_DISABLED ;
@@ -1801,8 +1801,7 @@ static int wlan_get_encode(struct net_device *dev,if (index <0 ) index = adapter->wep_tx_keyidx; -if ((adapter->wep_keys[index].len) && - (adapter->secinfo.WEPstatus == wlan802_11WEPenabled)) { +if ((adapter->wep_keys[index].len) && adapter->secinfo.wep_enabled) {memcpy (extra, adapter->wep_keys[index].key, adapter->wep_keys[index].len); dwrq->length = adapter->wep_keys[index].len;
@@ -1886,7 +1885,7 @@ static int wlan_set_wep_key(struct assoc_request *assoc_req, assoc_req->wep_tx_keyidx = index; } - assoc_req->secinfo.WEPstatus = wlan802_11WEPenabled; + assoc_req->secinfo.wep_enabled =1 ;LEAVE ();return 0 ;
@@ -1918,7 +1917,7 @@ static void disable_wep(struct assoc_request *assoc_req) assoc_req->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ;/* Clear WEP keys and mark WEP as disabled */ - assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; + assoc_req->secinfo.wep_enabled =0 ;for (i =0 ; i <4 ; i++) assoc_req->wep_keys[i].len =0 ;
@@ -1970,8 +1969,7 @@ static int wlan_set_encode(struct net_device *dev,/* If WEP isn't enabled, or if there is no key data but a valid * index, set the TX key. */ -if ((assoc_req->secinfo.WEPstatus != wlan802_11WEPenabled) - || (dwrq->length ==0 && !is_default)) +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);
@@ -2046,23 +2044,24 @@ static int wlan_get_encodeext(struct net_device *dev, dwrq->flags = index +1 ;memset (ext,0 ,sizeof (*ext)); -if ((adapter->secinfo.WEPstatus == wlan802_11WEPdisabled) - && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled) { +if ( !adapter->secinfo.wep_enabled + && !adapter->secinfo.WPAenabled + && !adapter->secinfo.WPA2enabled) { ext->alg =IW_ENCODE_ALG_NONE ; ext->key_len =0 ; dwrq->flags |=IW_ENCODE_DISABLED ; }else {u8 *key =NULL ; -if ((adapter->secinfo.WEPstatus == wlan802_11WEPenabled) +if ( adapter->secinfo.wep_enabled && !adapter->secinfo.WPAenabled && !adapter->secinfo.WPA2enabled) { ext->alg =IW_ENCODE_ALG_WEP ; ext->key_len = adapter->wep_keys[index].len; key = &adapter->wep_keys[index].key[0 ]; - }else if ((adapter->secinfo.WEPstatus == wlan802_11WEPdisabled) && - (adapter->secinfo.WPAenabled || - adapter->secinfo.WPA2enabled)) { + }else if ( !adapter->secinfo.wep_enabled + && (adapter->secinfo.WPAenabled || + adapter->secinfo.WPA2enabled)) {/* WPA */ ext->alg =IW_ENCODE_ALG_TKIP ; ext->key_len =0 ;
@@ -2132,7 +2131,7 @@ static int wlan_set_encodeext(struct net_device *dev,/* If WEP isn't enabled, or if there is no key data but a valid * index, or if the set-TX-key flag was passed, set the TX key. */ -if ((assoc_req->secinfo.WEPstatus != wlan802_11WEPenabled) +if ( !assoc_req->secinfo.wep_enabled || (dwrq->length ==0 && !is_default) || (ext->ext_flags &IW_ENCODE_EXT_SET_TX_KEY )) set_tx_key =1 ;
@@ -2331,12 +2330,12 @@ static int wlan_set_auth(struct net_device *dev, }if (dwrq->value &IW_AUTH_WPA_VERSION_WPA ) { assoc_req->secinfo.WPAenabled =1 ; - assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; + assoc_req->secinfo.wep_enabled =0 ; assoc_req->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ; }if (dwrq->value &IW_AUTH_WPA_VERSION_WPA2 ) { assoc_req->secinfo.WPA2enabled =1 ; - assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; + assoc_req->secinfo.wep_enabled =0 ; assoc_req->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ; } updated =1 ;
@@ -2372,7 +2371,7 @@ static int wlan_set_auth(struct net_device *dev, !assoc_req->secinfo.WPA2enabled) { assoc_req->secinfo.WPAenabled =1 ; assoc_req->secinfo.WPA2enabled =1 ; - assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled; + assoc_req->secinfo.wep_enabled =0 ; assoc_req->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ; } }else {
Signature · 1 line
1.5.0.6
PATCH 11/19 libertas: remove WLAN_802_11_NETWORK_INFRASTRUCTURE enum
In reply to Dan WilliamsUse standard IW_MODE_* constants instead.
--- drivers/net/wireless/libertas/assoc.c | 34 ++++++++-------- drivers/net/wireless/libertas/cmd.c | 13 +++--- drivers/net/wireless/libertas/cmdresp.c | 2 +- drivers/net/wireless/libertas/defs.h | 9 ---- drivers/net/wireless/libertas/dev.h | 5 +- drivers/net/wireless/libertas/fw.c | 2 +- drivers/net/wireless/libertas/ioctl.c | 6 +- drivers/net/wireless/libertas/join.c | 30 ++++++-------- drivers/net/wireless/libertas/scan.c | 42 +++++++++---------- drivers/net/wireless/libertas/scan.h | 11 ++--- drivers/net/wireless/libertas/wext.c | 65 ++++++++----------------------- 11 files changed, 86 insertions(+), 133 deletions(-)
drivers/net/wireless/libertas/assoc.c +17 -17
@@ -23,13 +23,13 @@ static int assoc_helper_essid(wlan_private *priv,ENTER ();lbs_pr_debug (1 ,"New SSID requested: %s\n" , assoc_req->ssid.ssid); -if (assoc_req->mode == wlan802_11infrastructure) { +if (assoc_req->mode ==IW_MODE_INFRA ) {if (adapter->prescan) {libertas_send_specific_SSID_scan (priv, &assoc_req->ssid,1 ); } i =libertas_find_SSID_in_list (adapter, &assoc_req->ssid, -NULL , wlan802_11infrastructure); +NULL ,IW_MODE_INFRA );if (i >=0 ) {lbs_pr_debug (1 ,"SSID found in scan list ... associating...\n" );
@@ -44,7 +44,7 @@ static int assoc_helper_essid(wlan_private *priv,lbs_pr_debug (1 ,"SSID '%s' not found; cannot associate\n" , assoc_req->ssid.ssid); } - }else if (assoc_req->mode == wlan802_11ibss) { + }else if (assoc_req->mode ==IW_MODE_ADHOC ) {/* Scan for the network, do not save previous results. Stale * scan data will cause us to join a non-existant adhoc network */
@@ -52,7 +52,7 @@ static int assoc_helper_essid(wlan_private *priv,/* Search for the requested SSID in the scan table */ i =libertas_find_SSID_in_list (adapter, &assoc_req->ssid,NULL , - wlan802_11ibss); +IW_MODE_ADHOC );if (i >=0 ) {lbs_pr_debug (1 ,"SSID found at %d in List, so join\n" , ret);libertas_join_adhoc_network (priv, &adapter->scantable[i]);
@@ -90,10 +90,10 @@ static int assoc_helper_bssid(wlan_private *priv, goto out; } -if (assoc_req->mode == wlan802_11infrastructure) { +if (assoc_req->mode ==IW_MODE_INFRA ) { ret =wlan_associate (priv, &adapter->scantable[i]);lbs_pr_debug (1 ,"ASSOC: return from wlan_associate(bssd) was %d\n" , ret); - }else if (assoc_req->mode == wlan802_11ibss) { + }else if (assoc_req->mode ==IW_MODE_ADHOC ) {libertas_join_adhoc_network (priv, &adapter->scantable[i]); } memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
@@ -142,23 +142,23 @@ static int assoc_helper_mode(wlan_private *priv,ENTER (); -if (assoc_req->mode == adapter->inframode) { +if (assoc_req->mode == adapter->mode) {LEAVE ();return 0 ; } -if (assoc_req->mode == wlan802_11infrastructure) { +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; } - adapter->inframode = assoc_req->mode; + adapter->mode = assoc_req->mode; ret =libertas_prepare_and_send_command (priv, cmd_802_11_snmp_mib,0 , cmd_option_waitforrsp,OID_802_11_INFRASTRUCTURE_MODE , - (void *) assoc_req->mode); + (void *) (size_t ) assoc_req->mode);LEAVE ();return ret;
@@ -315,7 +315,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,/* FIXME: deal with 'auto' mode somehow */ if (test_bit (ASSOC_FLAG_MODE , &assoc_req->flags)) { -if (assoc_req->mode != wlan802_11infrastructure) +if (assoc_req->mode !=IW_MODE_INFRA )return 1 ; }
@@ -337,7 +337,7 @@ static int should_stop_adhoc(wlan_adapter *adapter,/* FIXME: deal with 'auto' mode somehow */ if (test_bit (ASSOC_FLAG_MODE , &assoc_req->flags)) { -if (assoc_req->mode != wlan802_11ibss) +if (assoc_req->mode !=IW_MODE_ADHOC )return 1 ; }
@@ -381,7 +381,7 @@ void wlan_association_worker(struct work_struct *work) }if (find_any_ssid) { -enum WLAN_802_11_NETWORK_INFRASTRUCTURE new_mode; +u8 new_mode; ret =libertas_find_best_network_SSID (priv, &assoc_req->ssid, assoc_req->mode, &new_mode);
@@ -392,7 +392,7 @@ void wlan_association_worker(struct work_struct *work) }/* Ensure we switch to the mode of the AP */ -if (assoc_req->mode == wlan802_11autounknown) { +if (assoc_req->mode ==IW_MODE_AUTO ) {set_bit (ASSOC_FLAG_MODE , &assoc_req->flags); assoc_req->mode = new_mode; }
@@ -402,7 +402,7 @@ void wlan_association_worker(struct work_struct *work)* Check if the attributes being changing require deauthentication * from the currently associated infrastructure access point. */ -if (adapter->inframode == wlan802_11infrastructure) { +if (adapter->mode ==IW_MODE_INFRA ) {if (should_deauth_infrastructure (adapter, assoc_req)) { ret =libertas_send_deauthentication (priv);if (ret) {
@@ -411,7 +411,7 @@ void wlan_association_worker(struct work_struct *work) ret); } } - }else if (adapter->inframode == wlan802_11ibss) { + }else if (adapter->mode ==IW_MODE_ADHOC ) {if (should_stop_adhoc (adapter, assoc_req)) { ret =libertas_stop_adhoc_network (priv);if (ret) {
@@ -542,7 +542,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter) assoc_req->channel = adapter->curbssparams.channel;if (!test_bit (ASSOC_FLAG_MODE , &assoc_req->flags)) - assoc_req->mode = adapter->inframode; + assoc_req->mode = adapter->mode;if (!test_bit (ASSOC_FLAG_BSSID , &assoc_req->flags)) { memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,
drivers/net/wireless/libertas/cmd.c +7 -6
@@ -381,15 +381,16 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv,switch (cmd_oid) {case OID_802_11_INFRASTRUCTURE_MODE : { -enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode = - (enum WLAN_802_11_NETWORK_INFRASTRUCTURE ) pdata_buf; +u8 mode = (u8 ) (size_t ) pdata_buf; pSNMPMIB->querytype =cpu_to_le16 (cmd_act_set); pSNMPMIB->oid =cpu_to_le16 ((u16 ) desired_bsstype_i); pSNMPMIB->bufsize =sizeof (u8); -if (mode == wlan802_11infrastructure) - ucTemp =SNMP_MIB_VALUE_INFRA ; -else - ucTemp =SNMP_MIB_VALUE_ADHOC ; +if (mode ==IW_MODE_ADHOC ) { + ucTemp =SNMP_MIB_VALUE_ADHOC ; + }else { +/* Infra and Auto modes */ + ucTemp =SNMP_MIB_VALUE_INFRA ; + }memmove (pSNMPMIB->value, &ucTemp,sizeof (u8));
drivers/net/wireless/libertas/cmdresp.c +1 -1
@@ -809,7 +809,7 @@ int libertas_process_rx_command(wlan_private * priv)if (result) {lbs_pr_debug (1 ,"CMD_RESP: PS command failed- %#x \n" , resp->result); -if (adapter->inframode == wlan802_11ibss) { +if (adapter->mode ==IW_MODE_ADHOC ) {/* * We should not re-try enter-ps command in * ad-hoc mode. It takes place in
drivers/net/wireless/libertas/defs.h +0 -9
@@ -267,15 +267,6 @@ enum mv_ms_type {MVMS_EVENT }; -/** WLAN_802_11_NETWORK_INFRASTRUCTURE */ -enum WLAN_802_11_NETWORK_INFRASTRUCTURE { - wlan802_11ibss, - wlan802_11infrastructure, - wlan802_11autounknown, -/*defined as upper bound */ - wlan802_11infrastructuremax -}; -/** SNMP_MIB_INDEX_e */ enum SNMP_MIB_INDEX_e { desired_bsstype_i =0 ,
drivers/net/wireless/libertas/dev.h +3 -2
@@ -183,7 +183,7 @@ struct assoc_request {struct WLAN_802_11_SSID ssid;u8 channel; -enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode; +u8 mode;u8 bssid[ETH_ALEN ];/** WEP keys */
@@ -252,7 +252,8 @@ struct _wlan_adapter {/** current ssid/bssid related parameters*/ struct current_bss_params curbssparams; -enum WLAN_802_11_NETWORK_INFRASTRUCTURE inframode; +/* IW_MODE_* */ +u8 mode;struct bss_descriptor *pattemptedbssdesc;
drivers/net/wireless/libertas/fw.c +1 -1
@@ -200,7 +200,7 @@ static void wlan_init_adapter(wlan_private * priv)memset (&adapter->wep_keys[i],0 ,sizeof (struct WLAN_802_11_KEY )); adapter->wep_tx_keyidx =0 ; adapter->secinfo.auth_mode =IW_AUTH_ALG_OPEN_SYSTEM ; - adapter->inframode = wlan802_11infrastructure; + adapter->mode =IW_MODE_INFRA ; adapter->assoc_req =NULL ;
drivers/net/wireless/libertas/ioctl.c +3 -3
@@ -445,8 +445,8 @@ static int wlan_get_adhoc_status_ioctl(wlan_private * priv, struct iwreq *wrq)memset (status,0 ,sizeof (status)); -switch (adapter->inframode) { -case wlan802_11ibss: +switch (adapter->mode) { +case IW_MODE_ADHOC :if (adapter->connect_status == libertas_connected) {if (adapter->adhoccreate)memcpy (&status,"AdhocStarted" ,sizeof (status));
@@ -456,7 +456,7 @@ static int wlan_get_adhoc_status_ioctl(wlan_private * priv, struct iwreq *wrq)memcpy (&status,"AdhocIdle" ,sizeof (status)); }break ; -case wlan802_11infrastructure: +case IW_MODE_INFRA :memcpy (&status,"Inframode" ,sizeof (status));break ;default :
drivers/net/wireless/libertas/join.c +13 -17
@@ -87,7 +87,7 @@ int libertas_send_deauth(wlan_private * priv)wlan_adapter *adapter = priv->adapter;int ret =0 ; -if (adapter->inframode == wlan802_11infrastructure && +if (adapter->mode ==IW_MODE_INFRA && adapter->connect_status == libertas_connected) ret =libertas_send_deauthentication (priv);else
@@ -101,7 +101,7 @@ int libertas_do_adhocstop_ioctl(wlan_private * priv)wlan_adapter *adapter = priv->adapter;int ret =0 ; -if (adapter->inframode == wlan802_11ibss && +if (adapter->mode ==IW_MODE_ADHOC && adapter->connect_status == libertas_connected) ret =libertas_stop_adhoc_network (priv);else
@@ -209,8 +209,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs/* check if the requested SSID is already joined */ if (adapter->curbssparams.ssid.ssidlength && !libertas_SSID_cmp (&pbssdesc->ssid, &adapter->curbssparams.ssid) - && (adapter->curbssparams.bssdescriptor.inframode == - wlan802_11ibss)) { + && (adapter->mode ==IW_MODE_ADHOC )) {lbs_pr_debug (1 , "ADHOC_J_CMD: New ad-hoc SSID is the same as current, "
@@ -278,7 +277,7 @@ int libertas_idle_off(wlan_private * priv)ENTER ();if (adapter->connect_status == libertas_disconnected) { -if (adapter->inframode == wlan802_11infrastructure) { +if (adapter->mode ==IW_MODE_INFRA ) {if (memcmp (adapter->previousbssid, zeromac,sizeof (zeromac)) !=0 ) {
@@ -296,7 +295,7 @@ int libertas_idle_off(wlan_private * priv) i =libertas_find_SSID_in_list (adapter, &adapter->previousssid, adapter->previousbssid, - adapter->inframode); + adapter->mode);if (i <0 ) { libertas_send_specific_BSSID_scan(priv,
@@ -308,8 +307,7 @@ int libertas_idle_off(wlan_private * priv) previousssid, adapter-> previousbssid, - adapter-> - inframode); + adapter->mode); }if (i <0 ) {
@@ -317,8 +315,7 @@ int libertas_idle_off(wlan_private * priv) i =libertas_find_SSID_in_list (adapter, &adapter-> previousssid,NULL , - adapter-> - inframode); + adapter->mode); }if (i <0 ) {
@@ -329,8 +326,7 @@ int libertas_idle_off(wlan_private * priv) i =libertas_find_SSID_in_list (adapter, &adapter-> previousssid,NULL , - adapter-> - inframode); + adapter->mode); }if (i >=0 ) {
@@ -340,7 +336,7 @@ int libertas_idle_off(wlan_private * priv) scantable[i]); } } - }else if (adapter->inframode == wlan802_11ibss) { + }else if (adapter->mode ==IW_MODE_ADHOC ) { ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start, 0,
@@ -367,7 +363,7 @@ int libertas_idle_on(wlan_private * priv)int ret =0 ;if (adapter->connect_status == libertas_connected) { -if (adapter->inframode == wlan802_11infrastructure) { +if (adapter->mode ==IW_MODE_INFRA ) {lbs_pr_debug (1 ,"Previous SSID = %s\n" , adapter->previousssid.ssid); memmove(&adapter->previousssid,
@@ -375,7 +371,7 @@ int libertas_idle_on(wlan_private * priv) sizeof(struct WLAN_802_11_SSID));libertas_send_deauth (priv); - }else if (adapter->inframode == wlan802_11ibss) { + }else if (adapter->mode ==IW_MODE_ADHOC ) { ret =libertas_stop_adhoc_network (priv); }
@@ -569,7 +565,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,lbs_pr_debug (1 ,"ASSOC_CMD: rates->header.len = %d\n" , rates->header.len);/* set IBSS field */ -if (pbssdesc->inframode == wlan802_11infrastructure) { +if (pbssdesc->mode ==IW_MODE_INFRA ) {#define CAPINFO_ESS_MODE 1 passo->capinfo.ess =CAPINFO_ESS_MODE ; }
@@ -643,7 +639,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,/* set the BSS type */ adhs->bsstype = cmd_bss_type_ibss; - pbssdesc->inframode = wlan802_11ibss; + pbssdesc->mode =IW_MODE_ADHOC ; adhs->beaconperiod = adapter->beaconperiod;/* set Physical param set */
drivers/net/wireless/libertas/scan.c +20 -22
136 lines not on this page · raw message
drivers/net/wireless/libertas/scan.h +5 -6
@@ -153,7 +153,7 @@ struct bss_descriptor {u32 atimwindow; -enum WLAN_802_11_NETWORK_INFRASTRUCTURE inframode; +u8 mode;u8 libertas_supported_rates[WLAN_SUPPORTED_RATES ];int extra_ie;
@@ -177,14 +177,13 @@ struct bss_descriptor {extern int libertas_SSID_cmp (struct WLAN_802_11_SSID *ssid1,struct WLAN_802_11_SSID *ssid2);extern int libertas_find_SSID_in_list (wlan_adapter * adapter,struct WLAN_802_11_SSID *ssid, -u8 * bssid,int mode); -int libertas_find_best_SSID_in_list (wlan_adapter * adapter,enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode); -extern int libertas_find_BSSID_in_list (wlan_adapter * adapter,u8 * bssid,int mode); +u8 * bssid,u8 mode); +int libertas_find_best_SSID_in_list (wlan_adapter * adapter,u8 mode); +extern int libertas_find_BSSID_in_list (wlan_adapter * adapter,u8 * bssid,u8 mode);int libertas_find_best_network_SSID (wlan_private * priv,struct WLAN_802_11_SSID *pSSID, -enum WLAN_802_11_NETWORK_INFRASTRUCTURE preferred_mode, -enum WLAN_802_11_NETWORK_INFRASTRUCTURE *out_mode); +u8 preferred_mode,u8 *out_mode); extern int libertas_send_specific_SSID_scan(wlan_private * priv, struct WLAN_802_11_SSID *prequestedssid,
drivers/net/wireless/libertas/wext.c +16 -49
126 lines not on this page · raw message
Signature · 1 line
1.5.0.6
PATCH 12/19 libertas: Get rid of version.h
In reply to Dan Williams--- drivers/net/wireless/libertas/main.c | 7 +++++++ drivers/net/wireless/libertas/version.h | 7 ------- drivers/net/wireless/libertas/wext.c | 2 -- 3 files changed, 7 insertions(+), 9 deletions(-)
drivers/net/wireless/libertas/version.h +0 -7
@@ -1,8 +1 @@ -#define DRIVER_RELEASE_VERSION "320.p0" -const char libertas_driver_version[] ="COMM-USB8388-" DRIVER_RELEASE_VERSION -#ifdef DEBUG -"-dbg" -#endif - ""; -
drivers/net/wireless/libertas/main.c +7 -0
@@ -21,6 +21,13 @@#include "debugfs.h" #include "assoc.h" +#define DRIVER_RELEASE_VERSION "320.p0" +const char libertas_driver_version[] ="COMM-USB8388-" DRIVER_RELEASE_VERSION +#ifdef DEBUG +"-dbg" +#endif + ""; +#ifdef ENABLE_PM static struct pm_dev *wlan_pm_dev =NULL ;#endif
drivers/net/wireless/libertas/wext.c +0 -1
@@ -17,7 +17,6 @@#include "defs.h" #include "dev.h" #include "join.h" -#include "version.h" #include "wext.h" #include "assoc.h"
Signature · 1 line
1.5.0.6
PATCH 13/19 libertas: Purge non-mesh ioctls
In reply to Dan Williams--- drivers/net/wireless/libertas/README | 516 ------------- drivers/net/wireless/libertas/ioctl.c | 1349 --------------------------------- drivers/net/wireless/libertas/join.c | 135 ---- drivers/net/wireless/libertas/join.h | 4 - drivers/net/wireless/libertas/wext.c | 274 ------- drivers/net/wireless/libertas/wext.h | 85 -- 6 files changed, 0 insertions(+), 2363 deletions(-)
If it's too big to get through vger, please see:
http://people.redhat.com/dcbw/libertas-patches/0013-libertas-Purge-non-mesh-ioctls.patch
drivers/net/wireless/libertas/README +0 -516
@@ -40,64 +40,11 @@ NAME SYNOPSIS iwpriv <ethX> <command> [sub-command] ... - iwpriv ethX version - iwpriv ethX scantype [sub-command] - iwpriv ethX getSNR <n> - iwpriv ethX getNF <n> - iwpriv ethX getRSSI <n> - iwpriv ethX setrxant <n> - iwpriv ethX getrxant - iwpriv ethX settxant <n> - iwpriv ethX gettxant - iwpriv ethX authalgs <n> - iwpriv ethX pre-TBTT <n> - iwpriv ethX 8021xauthalgs <n> - iwpriv ethX encryptionmode <n> iwpriv ethX setregioncode <n> iwpriv ethX getregioncode - iwpriv ethX setbcnavg <n> - iwpriv ethX getbcnavg - iwpriv ethX setdataavg <n> - iwpriv ethX setlisteninter <n> - iwpriv ethX getlisteninter - iwpriv ethX setmultipledtim <n> - iwpriv ethX getmultipledtim - iwpriv ethX atimwindow <n> - iwpriv ethX deauth - iwpriv ethX adhocstop - iwpriv ethX radioon - iwpriv ethX radiooff - iwpriv ethX reasso-on - iwpriv ethX reasso-off - iwpriv ethX scanmode [sub-command] - iwpriv ethX setwpaie <n> - iwpriv ethX wlanidle-off - iwpriv ethX wlanidle-on - iwpriv ethX getcis - iwpriv ethX getlog - iwpriv ethX getadhocstatus - iwpriv ethX adhocgrate <n> - -Version 4 Command: - iwpriv ethX inactvityto <n> - iwpriv ethX sleeppd <n> - iwpriv ethX enable11d <n> - iwpriv ethX tpccfg <n> - iwpriv ethX powercfg <n> - iwpriv ethX setafc <n> - iwpriv ethX getafc Version 5 Command: iwpriv ethX ledgpio <n> - iwpriv ethX scanprobes <n> - iwpriv ethX lolisteninter <n> - iwpriv ethX rateadapt <n> <m> - iwpriv ethX txcontrol <n> - iwpriv ethX psnullinterval <n> - iwpriv ethX prescan <n> - iwpriv ethX getrxinfo - iwpriv ethX gettxrate - iwpriv ethX beaconinterval BT Commands: The blinding table (BT) contains a list of mac addresses that should be
@@ -150,114 +97,6 @@ DESCRIPTION The ethX parameter specifies the network device that is to be used to perform this command on. it could be eth0, eth1 etc. -version - This is used to get the current version of the driver and the firmware. - -scantype - This command is used to set the scan type to be used by the driver in - the scan command. This setting will not be used while performing a scan - for a specific SSID, as it is always done with scan type being active. - - where the sub-commands are: - - active -- to set the scan type to active - passive -- to set the scan type to passive - get -- to get the scan type set in the driver - -getSNR - This command gets the average and non average value of Signal to Noise - Ratio of Beacon and Data. - - where value is:- - 0 -- Beacon non-average. - 1 -- Beacon average. - 2 -- Data non-average. - 3 -- Data average. - - If no value is given, all four values are returned in the order mentioned - above. - - Note: This command is available only when STA is connected. - -getRSSI - This command gets the average and non average value os Receive Signal - Strength of Beacon and Data. - - where value is:- - 0 -- Beacon non-average. - 1 -- Beacon average. - 2 -- Data non-average. - 3 -- Data average. - - Note: This command is available only when STA is connected. - -getNF - This command gets the average and non average value of Noise Floor of - Beacon and Data. - - where value is:- - 0 -- Beacon non-average. - 1 -- Beacon average. - 2 -- Data non-average. - 3 -- Data average. - - Note: This command is available only when STA is connected. - -setrxant - This command is used to set the mode for Rx antenna. - - The options that can be sent are:- - 1 -- Antenna 1. - 2 -- Antenna 2. - 0xFFFF -- Diversity. - - Usage: - iwpriv ethX setrxant 0x01: select Antenna 1. - -getrxant - This command is used to get the mode for Rx antenna. - - -settxant - This command is used to set the mode for Tx antenna. - The options that can be sent are:- - 1 -- Antenna 1. - 2 -- Antenna 2. - 0xFFFF -- Diversity. - Usage: - iwpriv ethX settxant 0x01: select Antenna 1. - -gettxant - This command is used to get the mode for Tx antenna. - -authalgs - This command is used by the WPA supplicant to set the authentication - algorithms in the station. - -8021xauthalgs - This command is used by the WPA supplicant to set the 8021.x authentication algorithm type - station. - - where values can be:- - 1 -- None - 2 -- LEAP - 4 -- TLS - 8 -- TTLs - 16 -- MD5 - - -encryptionmode - This command is used by the WPA supplicant to set the encryption algorithm. - - where values can be:- - 0 -- NONE - 1 -- WEP40 - 2 -- TKIP - 3 -- CCMP - 4 -- WEP104 - -pre-TBTT - This command is used to set pre-TBTT time period where value is in microseconds. - setregioncode This command is used to set the region code in the station. where value is 'region code' for various regions like
@@ -270,114 +109,6 @@ getregioncode This command is used to get the region code information set in the station. -setbcnavg - Set the weighting factor for calculating RSSI. - -getbcnavg - Get weighting factor for calculating RSSI. - -setdataavg - Set the weighting factor for calculating SNR. - -setlisteninter - This command is used to set the listen interval in the - station. - - where the value ranges between 1 - 255 - -getlisteninter - This command is used to get the listen interval value set in the - station. - -setmultipledtim - This command is used to set the multiple dtim value in the - station. - where the value is 1,2,3,4,5,0xfffe - 0xfffe means the firmware will use listen interval in association - command for waking up - -getmultipledtim - This command is used to get the multiple dtim value set in the station. - -atimwindow - This command is used to set the atim value in the - station. - - where the value ranges between 0 - 50 - -deauth - This command is used to send the de-authentication to the AP with which - the station is associated. This command is valid only when - station is in Infrastructure mode. - - Note: This command is available only when STA is connected. - -adhocstop - This command is used to stop beacon transmission from the station and - go into idle state in ad-hoc mode. - - Note: This command is available only when STA is connected. - -radioon - This command is used to turn on the RF antenna. - -radiooff - This command is sued to turn off the RF antenna. - -scanmode - This command is used to set the station to scan for either IBSS - networks or BSS networks or both BSS and IBSS networks. This - command can be used with sub commands, - - where the value for - bss -- Scan All the BSS networks. - ibss -- Scan All the IBSS networks. - any -- Scan both BSS and IBSS networks. - - - -setwpaie - This command is used by WPA supplicant to send the WPA-IE to the driver. - -wlanidle-off - This command is used to get into idle state. - - Note: This command is available only when STA is connected. - -wlanidle-on - This command is used to get off the idle state. - - Note: This command is available only when STA is connected. - - -getlog - This command is used to get the 802.11 statistics available in the - station. - - Note: This command is available only when STA is connected. - -getadhocstatus - This command is used to get the ad-hoc Network Status. - - The various status codes are: - AdhocStarted - AdhocJoined - AdhocIdle - InfraMode - AutoUnknownMode - - Note: This command is available only when STA is connected. - -adhocgrate - This command is used to enable(1) g_rate, Disable(0) g_rate - and request(2) the status which g_rate is disabled/enabled, - for Ad-hoc creator. - - where value is:- - 0 -- Disabled - 1 -- Enabled - 2 -- Get - ledgpio This command is used to set/get LEDs.
@@ -400,253 +131,6 @@ ledgpio Note: LED0 is invalid Note: Maximum Number of LEDs are 16. -inactivityto - This command is used by the host to set/get the inactivity timeout value, - which specifies when WLAN device is put to sleep. - - Usage: - iwpriv ethX inactivityto [<timeout>] - - where the parameter are: - timeout: timeout value in milliseconds. - - Example: - iwpriv eth1 inactivityto - "get the timeout value" - - iwpriv eth1 inactivityto X - "set timeout value to X ms" - - -sleeppd - This command is used to configure the sleep period of the WLAN device. - - Usage: - iwpriv ethX sleeppd [<sleep period>] - - where the parameter are: - Period: sleep period in milliseconds. Range 10~60. - - Example: - iwpriv eth1 sleeppd 10 - "set period as 10 ms" - iwpriv eth1 sleeppd - "get the sleep period configuration" - -enable11d - This command is used to control 11d - where value is:- - 1 -- Enabled - 0 -- Disabled - 2 -- Get - - - - -tpccfg - Enables or disables automatic transmit power control. - - The first parameter turns this feature on (1) or off (0). When turning - on, the user must also supply four more parameters in the following - order: - -UseSNR (Use SNR (in addition to PER) for TPC algorithm), - -P0 (P0 power level for TPC), - -P1 (P1 power level for TPC), - -P2 (P2 power level for TPC). - - Usage: - iwpriv ethX tpccfg: Get current configuration - iwpriv ethX tpccfg 0: disable auto TPC - iwpriv ethX tpccfg 0x01 0x00 0x05 0x0a 0x0d: enable auto TPC; do not use SNR; - P0=0x05; P1=0x0a; P2=0x0d; - iwpriv ethX tpccfg 0x01 0x01 0x05 0x0a 0x0d: enable auto TPC; use SNR; - P0=0x05; P1=0x0a; P2=0x0d. - -powercfg - Enables or disables power adaptation. - - The first parameter turns this feature on (1) or off (0). When turning - on, the user must also supply three more parameters in the following - order: - -P0 (P0 power level for Power Adaptation), - -P1 (P1 power level for Power Adaptation), - -P2 (P2 power level for Power Adaptation). - - Usage: - iwpriv ethX powercfg: Get current configuration - iwpriv ethX powercfg 0: disable power adaptation - iwpriv ethX powercfg 1 0x0d 0x0f 0x12: enable power adaptation; - P0=0x0d; P1=0x0f; P2=0x12. - -getafc - This command returns automatic frequency control parameters. It returns - three integers: - -P0: automatic is on (1), or off (0), - -P1: current timing offset in PPM (part per million), and - -P2: current frequency offset in PPM. - -setafc - Set automatic frequency control options. - - The first parameter turns automatic on (1) or off (0). - The user must supply two more parameters in either case, in the following - order: - - When auto is on: - - -P0 (automatic adjustment frequency threshold in PPM), - -P1 (automatic adjustment period in beacon period), - - When auto is off: - - -P0 (manual adjustment timing offset in PPM), and - -P1 (manual adjustment frequency offset in PPM). - - Usage: - iwpriv ethX setafc 0 10 10: manual adjustment, both timing and frequcncy - offset are 10 PPM. - - iwpriv ethX setafc 1 10 10 enable afc, automatic adjustment, - frequency threshold 10 PPM, for every 10 beacon periods. - - - -scanprobes - This command sets number of probe requests per channel. - - Usage: - iwpriv ethX scanprobes 3 (set scan probes to 3) - iwpriv ethX scanprobes (get scan probes) - -lolisteninter - This command sets the value of listen interval. - - Usage: - iwpriv ethX lolisteninter 234 (set the lolisteninter to 234) - iwpriv ethX lolisteninter (get the lolisteninter value) - -rateadapt - This command sets the data rates bitmap. - Where <n> - 0: Disable auto rate adapt - 1: Enable auto rate adapt - - <m> - data rate bitmap - Bit Data rate - 0 1 Mbps - 1 2 Mbps - 2 5.5 Mbps - 3 11 Mbps - 4 Reserved - 5 6 Mbps - 6 9 Mbps - 7 12 Mbps - 8 18 Mbps - 9 24 Mbps - 10 36 Mbps - 11 48 Mbps - 12 54 Mbps - 12-15 Reserved - - Usage: - iwpriv ethX rateadapt - read the currect data rate setting - iwpriv ethX rateadapt 1 0x07 - enable auto data rate adapt and - data rates are 1Mbps, 2Mbsp and 5.5Mbps - - -txcontrol - This command is used to set the Tx rate, ack policy, and retry limit on a per packet basis. - - Where value <n> is: - if bit[4] == 1: - bit[3:0] -- 0 1 2 3 4 5 6 7 8 9 10 11 12 13-16 - Data Rate(Mbps) -- 1 2 5.5 11 Rsv 6 9 12 18 24 36 48 54 Rsv - - bit[12:8] - if bit[12] == 1, bit[11:8] specifies the Tx retry limit. - - bit[14:13] specifies per packet ack policy: - bit[14:13] - 1 0 use immediate ack policy for this packet - 1 1 use no ack policy for this packet - 0 x use the per-packet ack policy setting - - Usage: - iwpriv ethX txcontrol 0x7513 - Use no-ack policy, 5 retires for Tx, 11Mbps rate - - - -psnullinterval - This command is used to set/request NULL package interval for Power Save - under infrastructure mode. - - where value is:- - -1 -- Disabled - n>0 -- Set interval as n (seconds) - -prescan - This command is used to enable (1)/disable(0) auto prescan before assoicate to the ap - - where value is:- - 0 -- Disabled - 1 -- Enabled - 2 -- Get - -getrxinfo - This command gets non average value of Signal to Noise Ratio of Data and rate index. - - The following table shows RateIndex and Rate - - RateIndex Data rate - 0 1 Mbps - 1 2 Mbps - 2 5.5 Mbps - 3 11 Mbps - 4 Reserved - 5 6 Mbps - 6 9 Mbps - 7 12 Mbps - 8 18 Mbps - 9 24 Mbps - 10 36 Mbps - 11 48 Mbps - 12 54 Mbps - 13-15 Reserved - -gettxrate - This command gets current Tx rate index of the first packet associated with Rate Adaptation. - - The following table shows RateIndex and Rate - - RateIndex Data rate - 0 1 Mbps - 1 2 Mbps - 2 5.5 Mbps - 3 11 Mbps - 4 Reserved - 5 6 Mbps - 6 9 Mbps - 7 12 Mbps - 8 18 Mbps - 9 24 Mbps - 10 36 Mbps - 11 48 Mbps - 12 54 Mbps - 13-15 Reserved - -bcninterval - This command is used to sets beacon interval in adhoc mode when an argument is given, and gets current adhoc - beacon interval when no argument is given. The valid beacon interval is between 20 - 1000, - default beacon interval is 100. - - Usage: - iwpriv ethX bcninterval 100 (set adhoc beacon interval to 100) - iwpriv ethX bcninterval (get adhoc beacon interval) - fwt_add This command is used to insert an entry into the FWT table. The list of parameters must follow the following structure:
drivers/net/wireless/libertas/ioctl.c +0 -1349
1,417 lines not on this page · raw message
drivers/net/wireless/libertas/join.c +0 -135
147 lines not on this page · raw message
drivers/net/wireless/libertas/join.h +0 -4
@@ -37,10 +37,6 @@ extern int libertas_ret_80211_disassociate(wlan_private * priv,extern int libertas_ret_80211_associate (wlan_private * priv,struct cmd_ds_command *resp); -extern int libertas_idle_on (wlan_private * priv); -extern int libertas_idle_off (wlan_private * priv); - -extern int libertas_do_adhocstop_ioctl (wlan_private * priv);extern int libertas_reassociation_thread (void *data);struct WLAN_802_11_SSID ;
drivers/net/wireless/libertas/wext.c +0 -274
324 lines not on this page · raw message
drivers/net/wireless/libertas/wext.h +0 -85
115 lines not on this page · raw message
Signature · 1 line
1.5.0.6
PATCH 14/19 libertas: remove SUPPORT_BOOT_COMMAND
In reply to Dan WilliamsRemove the static definition of SUPPORT_BOOT_COMMAND.
--- drivers/net/wireless/libertas/Makefile | 3 +-- drivers/net/wireless/libertas/if_usb.c | 2 -- drivers/net/wireless/libertas/if_usb.h | 2 -- 3 files changed, 1 insertions(+), 6 deletions(-)
drivers/net/wireless/libertas/Makefile +1 -2
@@ -12,8 +12,7 @@ EXTRA_CFLAGS += -DDEBUG -DPROC_DEBUG endif -# This is needed to support the newer boot2 bootloader (v >= 3104) -EXTRA_CFLAGS += -DSUPPORT_BOOT_COMMAND +#EXTRA_CFLAGS += usb8xxx-objs += if_bootcmd.o usb8xxx-objs += if_usb.o
drivers/net/wireless/libertas/if_usb.c +0 -2
@@ -775,7 +775,6 @@ restart:return -1 ; } -#ifdef SUPPORT_BOOT_COMMAND cardp->bootcmdresp =0 ; do { int j = 0;
@@ -796,7 +795,6 @@ restart: }return -1 ; } -#endif i =0 ; priv->adapter->fw_ready =0 ;
drivers/net/wireless/libertas/if_usb.h +0 -2
@@ -12,7 +12,6 @@#define USB8388_VID_2 0x05a3#define USB8388_PID_2 0x8388 -#ifdef SUPPORT_BOOT_COMMAND #define BOOT_CMD_FW_BY_USB 0x01#define BOOT_CMD_FW_IN_EEPROM 0x02#define BOOT_CMD_UPDATE_BOOT2 0x03
@@ -36,7 +35,6 @@ struct bootcmdrespStru8 u8result;u8 au8dumy[2 ]; }; -#endif /* SUPPORT_BOOT_COMMAND */ /* read callback private data */ struct read_cb_info {
Signature · 1 line
1.5.0.6
PATCH 15/19 libertas: Clean up debug defines
In reply to Dan Williams--- drivers/net/wireless/libertas/Makefile | 8 -------- drivers/net/wireless/libertas/defs.h | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/net/wireless/libertas/Makefile +0 -8
@@ -1,5 +1,3 @@ -# EXTRA_CFLAGS += -Wpacked - usb8xxx-objs := main.o fw.o wext.o \ rx.o tx.o cmd.o \ cmdresp.o scan.o \
@@ -7,12 +5,6 @@ usb8xxx-objs := main.o fw.o wext.o \ ioctl.o debugfs.o \ ethtool.o assoc.o -ifeq ($(CONFIG_LIBERTAS_USB_DEBUG), y) -EXTRA_CFLAGS += -DDEBUG -DPROC_DEBUG -endif - - -#EXTRA_CFLAGS += usb8xxx-objs += if_bootcmd.o usb8xxx-objs += if_usb.o
drivers/net/wireless/libertas/defs.h +5 -0
@@ -9,6 +9,11 @@extern unsigned int libertas_debug; +#ifdef CONFIG_LIBERTAS_DEBUG +#define DEBUG +#define PROC_DEBUG +#endif +#define DRV_NAME "usb8xxx" #define lbs_pr_info(format, args...) \
Signature · 1 line
1.5.0.6
PATCH 16/19 libertas: made debugfs.c sparse-clean, found an unused function that way
In reply to Dan WilliamsSubject says it all.
--- drivers/net/wireless/libertas/debugfs.c | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-)
drivers/net/wireless/libertas/debugfs.c +4 -13
@@ -7,6 +7,7 @@#include "dev.h" #include "decl.h" #include "host.h" +#include "debugfs.h" static struct dentry *libertas_dir =NULL ;static char *szStates[] = {
@@ -1648,7 +1649,7 @@ struct libertas_debugfs_files {struct file_operations fops; }; -struct libertas_debugfs_files debugfs_files[] = { +static struct libertas_debugfs_files debugfs_files[] = { {"info" ,0444 ,FOPS (libertas_dev_info, write_file_dummy), }, {"getscantable" ,0444 ,FOPS (libertas_getscantable, write_file_dummy), },
@@ -1658,7 +1659,7 @@ struct libertas_debugfs_files debugfs_files[] = { { "setuserscan", 0600, FOPS(NULL, libertas_setuserscan), }, }; -struct libertas_debugfs_files debugfs_events_files[] = { +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,
@@ -1673,7 +1674,7 @@ struct libertas_debugfs_files debugfs_events_files[] = { libertas_highsnr_write), }, }; -struct libertas_debugfs_files debugfs_regs_files[] = { +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), },
@@ -1923,13 +1924,3 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev) &libertas_debug_fops); } -/** -* @brief remove proc file -* -* @param priv pointer wlan_private -* @return N/A -*/ -void libertas_debug_remove (wlan_private * priv) -{ -debugfs_remove (priv->debugfs_debug); -}
Signature · 1 line
1.5.0.6
PATCH 17/19 libertas: fix missing unlock in TX error path
In reply to Dan Williams--- drivers/net/wireless/libertas/if_usb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/libertas/if_usb.c +1 -0
@@ -626,6 +626,7 @@ static void if_usb_receive(struct urb *urb) cardp->usb_event_cause);if (cardp->usb_event_cause &0xffff0000 ) {libertas_send_tx_feedback (priv); +spin_unlock (&priv->adapter->driver_lock);break ; } cardp->usb_event_cause =le32_to_cpu (cardp->usb_event_cause) <<3 ;
Signature · 1 line
1.5.0.6
PATCH 18/19 libertas: sparse fixes
In reply to Dan WilliamsFix various issues reported by sparse.
--- drivers/net/wireless/libertas/ioctl.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/wireless/libertas/ioctl.c +10 -9
@@ -680,6 +680,7 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req)*/ static int wlan_fwt_cleanup_ioctl (wlan_private * priv,struct ifreq *req) { +struct iwreq *wrq = (struct iwreq *)req;static struct cmd_ds_fwt_access fwt_access;int ret;
@@ -695,7 +696,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) (void *)&fwt_access);if (ret ==0 ) - req->ifr_data = (char *)(le32_to_cpu (fwt_access.references)); + wrq->u.param.value =le32_to_cpu (fwt_access.references);else return -EFAULT ;
@@ -711,6 +712,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req)*/ static int wlan_fwt_time_ioctl (wlan_private * priv,struct ifreq *req) { +struct iwreq *wrq = (struct iwreq *)req;static struct cmd_ds_fwt_access fwt_access;int ret;
@@ -726,7 +728,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) (void *)&fwt_access);if (ret ==0 ) - req->ifr_data = (char *)(le32_to_cpu (fwt_access.references)); + wrq->u.param.value =le32_to_cpu (fwt_access.references);else return -EFAULT ;
@@ -742,6 +744,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req)*/ static int wlan_mesh_get_ttl_ioctl (wlan_private * priv,struct ifreq *req) { +struct iwreq *wrq = (struct iwreq *)req;struct cmd_ds_mesh_access mesh_access;int ret;
@@ -754,9 +757,8 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) cmd_option_waitforrsp,0 , (void *)&mesh_access); -if (ret ==0 ) { - req->ifr_data = (char *)(le32_to_cpu (mesh_access.data[0 ])); - } +if (ret ==0 ) + wrq->u.param.value =le32_to_cpu (mesh_access.data[0 ]);else return -EFAULT ;
@@ -832,10 +834,9 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)/* The first 4 bytes of req->ifr_data is sub-ioctl number * after 4 bytes sits the payload. */ - subcmd = wrq->u.data.flags;//from wpa_supplicant subcmd - + subcmd = wrq->u.data.flags;if (!subcmd) - subcmd = (int )req->ifr_data;//from iwpriv subcmd + subcmd = (int )wrq->u.param.value;switch (subcmd) {case WLANSETREGION :
@@ -887,7 +888,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)break ;case WLAN_SETNONE_GETONEINT : -switch ((int )req->ifr_data) { +switch (wrq->u.param.value) {case WLANGETREGION : pdata = (int *)wrq->u.name; *pdata = (int )adapter->regioncode;
Signature · 1 line
1.5.0.6
PATCH 19/19 libertas: 64-bit cleanups
In reply to Dan Williams--- drivers/net/wireless/libertas/cmd.c | 12 ++++++------ drivers/net/wireless/libertas/debugfs.c | 14 +++++++++----- drivers/net/wireless/libertas/if_usb.c | 2 +- drivers/net/wireless/libertas/join.c | 3 --- drivers/net/wireless/libertas/rx.c | 4 ++-- drivers/net/wireless/libertas/scan.c | 4 ++-- drivers/net/wireless/libertas/tx.c | 2 +- 7 files changed, 21 insertions(+), 20 deletions(-)
drivers/net/wireless/libertas/cmd.c +6 -6
@@ -948,8 +948,8 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, uspin_unlock_irqrestore (&adapter->driver_lock, flags); -lbs_pr_debug (1 ,"QUEUE_CMD: Inserted node=0x%x, cmd=0x%x in cmdpendingq\n" , - (u32 ) cmdnode, +lbs_pr_debug (1 ,"QUEUE_CMD: Inserted node=%p, cmd=0x%x in cmdpendingq\n" , + cmdnode, ((struct cmd_ds_gen *)cmdnode->bufvirtualaddr)->command); done:
@@ -977,8 +977,8 @@ static int DownloadcommandToStation(wlan_private * priv,ENTER ();if (!adapter || !cmdnode) { -lbs_pr_debug (1 ,"DNLD_CMD: adapter = %#x, cmdnode = %#x\n" , - (int )adapter, (int )cmdnode); +lbs_pr_debug (1 ,"DNLD_CMD: adapter = %p, cmdnode = %p\n" , + adapter, cmdnode);if (cmdnode) {spin_lock_irqsave (&adapter->driver_lock, flags);__libertas_cleanup_and_insert_cmd (priv, cmdnode);
@@ -1175,8 +1175,8 @@ int libertas_prepare_and_send_command(wlan_private * priv, cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; -lbs_pr_debug (1 ,"PREP_CMD: Val of cmd ptr =0x%x, command=0x%X\n" , - (u32 ) cmdptr, cmd_no); +lbs_pr_debug (1 ,"PREP_CMD: Val of cmd ptr=%p, command=0x%X\n" , + cmdptr, cmd_no);if (!cmdptr) {lbs_pr_debug (1 ,"PREP_CMD: bufvirtualaddr of cmdnode is NULL\n" );
drivers/net/wireless/libertas/debugfs.c +9 -5
@@ -277,7 +277,7 @@ static void libertas_parse_ssid(char *buf, size_t count,if (!end) end = buf + count -1 ; - size =min (IW_ESSID_MAX_SIZE , end - hold); + size =min ((size_t )IW_ESSID_MAX_SIZE , (size_t ) (end - hold));strncpy (scan_cfg->specificSSID, hold, size);return ;
@@ -1779,7 +1779,7 @@ void libertas_debugfs_remove_one(wlan_private *priv)struct debug_data {char name[32 ];u32 size; -u32 addr; +size_t addr; };/* To debug any member of wlan_adapter, simply add one line here.
@@ -1826,6 +1826,8 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf, val = *((u16 *) d[i].addr); else if (d[i].size == 4) val = *((u32 *) d[i].addr); + else if (d[i].size == 8) + val = *((u64 *) d[i].addr); pos +=sprintf (p + pos,"%s=%d\n" , d[i].name, val); }
@@ -1845,7 +1847,7 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,* @param data data to write * @return number of data */ -static int wlan_debugfs_write (struct file *f,const char __user *buf, +static ssize_t wlan_debugfs_write (struct file *f,const char __user *buf,size_t cnt,loff_t *ppos) {int r, i;
@@ -1887,12 +1889,14 @@ static int wlan_debugfs_write(struct file *f, const char __user *buf, *((u16 *) d[i].addr) = (u16 ) r; else if (d[i].size == 4) *((u32 *) d[i].addr) = (u32 ) r; + else if (d[i].size == 8) + *((u64 *) d[i].addr) = (u64 ) r;break ; }while (1 ); }kfree (pdata); -return cnt; +return (ssize_t )cnt; }static struct file_operations libertas_debug_fops = {
@@ -1917,7 +1921,7 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev)return ;for (i =0 ; i < num_of_items; i++) - items[i].addr += (u32 ) priv->adapter; + items[i].addr += (size_t ) priv->adapter; priv->debugfs_debug = debugfs_create_file("debug", 0644, priv->debugfs_dir, &items[0],
drivers/net/wireless/libertas/if_usb.c +1 -1
@@ -388,7 +388,7 @@ static int __if_usb_submit_rx_urb(wlan_private * priv,usb_fill_bulk_urb (cardp->rx_urb, cardp->udev,usb_rcvbulkpipe (cardp->udev, cardp->bulk_in_endpointAddr), - skb->tail +IPFIELD_ALIGN_OFFSET , + (void *) (skb->tail + (size_t )IPFIELD_ALIGN_OFFSET ),MRVDRV_ETH_RX_PACKET_BUFFER_SIZE , callbackfn, rinfo);
drivers/net/wireless/libertas/join.c +0 -3
@@ -663,9 +663,6 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, padhocjoin->bssdescriptor.BSSID[5 ], padhocjoin->bssdescriptor.SSID); -lbs_pr_debug (1 ,"ADHOC_J_CMD: Data Rate = %x\n" , - (u32 ) padhocjoin->bssdescriptor.datarates); -/* failtimeout */ padhocjoin->failtimeout =cpu_to_le16 (MRVDRV_ASSOCIATION_TIME_OUT );
drivers/net/wireless/libertas/rx.c +2 -2
@@ -210,7 +210,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) goto done; } -lbs_pr_debug (1 ,"RX Data: skb->len - sizeof(RxPd) = %d - %d = %d\n" , +lbs_pr_debug (1 ,"RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n" , skb->len,sizeof (struct rxpd ), skb->len -sizeof (struct rxpd )); lbs_dbg_hex("RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr,
@@ -364,7 +364,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) priv->stats.rx_errors++; } -lbs_pr_debug (1 ,"RX Data: skb->len - sizeof(RxPd) = %d - %d = %d\n" , +lbs_pr_debug (1 ,"RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n" , skb->len,sizeof (struct rxpd ), skb->len -sizeof (struct rxpd ));/* create the exported radio header */
drivers/net/wireless/libertas/scan.c +2 -2
@@ -1085,7 +1085,7 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry, sizeof(pcountryinfo->countrycode) || pcountryinfo->len > 254) {lbs_pr_debug (1 ,"InterpretIE: 11D- Err " -"CountryInfo len =%d min=%d max=254\n" , +"CountryInfo len =%d min=%zd max=254\n" , pcountryinfo->len,sizeof (pcountryinfo->countrycode));LEAVE ();
@@ -1551,7 +1551,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,for (i =0 ; i < adapter->numinscantable; i++) {if ((current_ev +MAX_SCAN_CELL_SIZE ) >= end_buf) {lbs_pr_debug (1 ,"i=%d break out: current_ev=%p end_buf=%p " -"MAX_SCAN_CELL_SIZE=%d\n" , +"MAX_SCAN_CELL_SIZE=%zd\n" , i, current_ev, end_buf,MAX_SCAN_CELL_SIZE );break ; }
drivers/net/wireless/libertas/tx.c +1 -1
@@ -78,7 +78,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) min_t(unsigned int, skb->len, 100));if (!skb->len || (skb->len >MRVDRV_ETH_TX_PACKET_BUFFER_SIZE )) { -lbs_pr_debug (1 ,"Tx error: Bad skb length %d : %d\n" , +lbs_pr_debug (1 ,"Tx error: Bad skb length %d : %zd\n" , skb->len,MRVDRV_ETH_TX_PACKET_BUFFER_SIZE ); ret =-1 ; goto done;
Signature · 1 line
1.5.0.6