Skip to contentSkip to conversation

WE-21 for bcm43xx (wireless-2.6 git)

PATCH In review Jean Tourrilhes 3 participants 5 messages Aug 30, 2006 – Aug 31, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 WE-21 for bcm43xx (wireless-2.6 git)

Hi,

WE-21 for Broadcom driver and SoftMAC...
This version is for wireless-2.6 git.

Jean

-----------------------------------------------------------

net/ieee80211/softmac/ieee80211softmac_wx.c renamed from net/ieee80211/softmac/ieee80211softmac_wx.20.c +4 -4
diff -u -p linux/net/ieee80211/softmac/ieee80211softmac_wx.20.c linux/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -80,10 +80,10 @@ ieee80211softmac_wx_set_essid(struct net
 	 * If it's our network, ignore the change, we're already doing it!
 	 */
 	if((sm->associnfo.associating || sm->associated) &&
-	   (data->essid.flags && data->essid.length && extra)) {
+	   (data->essid.flags && data->essid.length)) {
 		/* Get the associating network */
 		n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
-		if(n && n->essid.len == (data->essid.length - 1) &&
+		if(n && (n->essid.len == data->essid.length) &&
 		   !memcmp(n->essid.data, extra, n->essid.len)) {
 			dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
 				MAC_ARG(sm->associnfo.bssid));
@@ -109,8 +109,8 @@ ieee80211softmac_wx_set_essid(struct net
 	sm->associnfo.static_essid = 0;
 	sm->associnfo.assoc_wait = 0;
 
-	if (data->essid.flags && data->essid.length && extra /*required?*/) {
-		length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE);
+	if (data->essid.flags && data->essid.length) {
+		length = min((int) data->essid.length, IW_ESSID_MAX_SIZE);
 		if (length) {
 			memcpy(sm->associnfo.req_essid.data, extra, length);
 			sm->associnfo.static_essid = 1;
drivers/net/wireless/bcm43xx/bcm43xx_wx.c renamed from drivers/net/wireless/bcm43xx/bcm43xx_wx.20.c +1 -1
diff -u -p linux/drivers/net/wireless/bcm43xx/bcm43xx_wx.20.c linux/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -334,7 +334,7 @@ static int bcm43xx_wx_get_nick(struct ne
 	size_t len;
 
 	mutex_lock(&bcm->mutex);
-	len = strlen(bcm->nick) + 1;
+	len = strlen(bcm->nick);
 	memcpy(extra, bcm->nick, len);
 	data->data.length = (__u16)len;
 	data->data.flags = 1;
#1 lore raw
Quoted 8 lines · Jean Tourrilhes

Hi,

WE-21 for Broadcom driver and SoftMAC...
This version is for wireless-2.6 git.

Jean

Next time CC Larry Finger <[email protected]>, as he is the bcm43xx-softmac maintainer, please.

Quoted 42 lines

-----------------------------------------------------------

diff -u -p linux/net/ieee80211/softmac/ieee80211softmac_wx.20.c linux/net/ieee80211/softmac/ieee80211softmac_wx.c

net/ieee80211/softmac/ieee80211softmac_wx.c renamed from net/ieee80211/softmac/ieee80211softmac_wx.20.c +4 -4
@@ -80,10 +80,10 @@ ieee80211softmac_wx_set_essid(struct net
 	 * If it's our network, ignore the change, we're already doing it!
 	 */
 	if((sm->associnfo.associating || sm->associated) &&
-	   (data->essid.flags && data->essid.length && extra)) {
+	   (data->essid.flags && data->essid.length)) {
 		/* Get the associating network */
 		n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
-		if(n && n->essid.len == (data->essid.length - 1) &&
+		if(n && (n->essid.len == data->essid.length) &&
 		   !memcmp(n->essid.data, extra, n->essid.len)) {
 			dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
 				MAC_ARG(sm->associnfo.bssid));
@@ -109,8 +109,8 @@ ieee80211softmac_wx_set_essid(struct net
 	sm->associnfo.static_essid = 0;
 	sm->associnfo.assoc_wait = 0;
 
-	if (data->essid.flags && data->essid.length && extra /*required?*/) {
-		length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE);
+	if (data->essid.flags && data->essid.length) {
+		length = min((int) data->essid.length, IW_ESSID_MAX_SIZE);
 		if (length) {
 			memcpy(sm->associnfo.req_essid.data, extra, length);
 			sm->associnfo.static_essid = 1;

diff -u -p linux/drivers/net/wireless/bcm43xx/bcm43xx_wx.20.c linux/drivers/net/wireless/bcm43xx/bcm43xx_wx.c

drivers/net/wireless/bcm43xx/bcm43xx_wx.c renamed from drivers/net/wireless/bcm43xx/bcm43xx_wx.20.c +1 -1
@@ -334,7 +334,7 @@ static int bcm43xx_wx_get_nick(struct ne
 	size_t len;
 
 	mutex_lock(&bcm->mutex);
-	len = strlen(bcm->nick) + 1;
+	len = strlen(bcm->nick);
 	memcpy(extra, bcm->nick, len);
 	data->data.length = (__u16)len;
 	data->data.flags = 1;
Signature · 1 line
Greetings Michael.
#2 lore raw
Quoted 6 lines · Michael Buesch
Quoted 5 lines · Jean Tourrilhes

Hi,

WE-21 for Broadcom driver and SoftMAC...
This version is for wireless-2.6 git.

Quoted 8 lines
Quoted 3 lines

Jean

Next time CC Larry Finger <[email protected]>, as he is the bcm43xx-softmac maintainer, please.

This is the version of the patch for out-of-tree, I guess you
will need it. Not tested.

Regards,

Jean

-------------------------------------------------------------

net/ieee80211/softmac/ieee80211softmac_wx.c renamed from net/ieee80211/softmac/ieee80211softmac_wx.20.c +10 -4
diff -u -p linux/net/ieee80211/softmac/ieee80211softmac_wx.20.c linux/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -63,6 +63,12 @@ ieee80211softmac_wx_get_scan_results(str
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results);
 
+#if WIRELESS_EXT > 20
+#define IW_ESSID_FIX	0
+#else
+#define IW_ESSID_FIX	1
+#endif
+
 int
 ieee80211softmac_wx_set_essid(struct net_device *net_dev,
 			      struct iw_request_info *info,
@@ -80,10 +86,10 @@ ieee80211softmac_wx_set_essid(struct net
 	 * If it's our network, ignore the change, we're already doing it!
 	 */
 	if((sm->associnfo.associating || sm->associated) &&
-	   (data->essid.flags && data->essid.length && extra)) {
+	   (data->essid.flags && data->essid.length)) {
 		/* Get the associating network */
 		n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
-		if(n && n->essid.len == (data->essid.length - 1) &&
+		if(n && n->essid.len == (data->essid.length - IW_ESSID_FIX) &&
 		   !memcmp(n->essid.data, extra, n->essid.len)) {
 			dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
 				MAC_ARG(sm->associnfo.bssid));
@@ -109,8 +115,8 @@ ieee80211softmac_wx_set_essid(struct net
 	sm->associnfo.static_essid = 0;
 	sm->associnfo.assoc_wait = 0;
 
-	if (data->essid.flags && data->essid.length && extra /*required?*/) {
-		length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE);
+	if (data->essid.flags && data->essid.length) {
+		length = min((int) data->essid.length - IW_ESSID_FIX, IW_ESSID_MAX_SIZE);
 		if (length) {
 			memcpy(sm->associnfo.req_essid.data, extra, length);
 			sm->associnfo.static_essid = 1;
drivers/net/wireless/bcm43xx/bcm43xx_wx.c renamed from drivers/net/wireless/bcm43xx/bcm43xx_wx.20.c +4 -0
diff -u -p linux/drivers/net/wireless/bcm43xx/bcm43xx_wx.20.c linux/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -334,7 +334,11 @@ static int bcm43xx_wx_get_nick(struct ne
 	size_t len;
 
 	mutex_lock(&bcm->mutex);
+#if WIRELESS_EXT > 20
+	len = strlen(bcm->nick);
+#else
 	len = strlen(bcm->nick) + 1;
+#endif
 	memcpy(extra, bcm->nick, len);
 	data->data.length = (__u16)len;
 	data->data.flags = 1;
maintainer
#3 lore raw

Jean,

Quoted 2 lines

This is the version of the patch for out-of-tree, I guess you
will need it. Not tested.

We don't, neither softmac nor bcm43xx is maintained out-of-tree any more.

johannes

#4 lore raw
Quoted 9 lines · Johannes Berg

Jean,

Quoted 2 lines

This is the version of the patch for out-of-tree, I guess you
will need it. Not tested.

We don't, neither softmac nor bcm43xx is maintained out-of-tree any more.

johannes

Cool. I should have checked...

Jean