* B43: MGMT (TX callback) fail
From: Manuel Schölling @ 2009-08-11 16:51 UTC (permalink / raw)
To: linux-wireless
Hi,
I'm using hostapd 0.6.9 with b43 (Kernel 2.6.29-gentoo-r5-twam, 410.2160 of
Broadcom's proprietary driver) with this minimal config:
interface=wlan1
driver=nl80211
ssid=test
(I have two b43 cards: wlan0 and wlan1).
The ssid is not broadcasted and when I want to connect with my laptop (atheros
card), I get this debugging output:
Configuration file: hostapd.conf
Opening raw packet socket for ifindex 143960616
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=27 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=27 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=27 dBm
RATE[0] rate=10 flags=0x2
RATE[1] rate=20 flags=0x6
RATE[2] rate=55 flags=0x4
RATE[3] rate=110 flags=0x4
Passive scanning not supported
Flushing old station entries
Deauthenticate all stations
Using interface wlan1 with hwaddr 00:14:a4:30:20:2d and ssid 'test'
wlan1: Setup of interface done.
MGMT (TX callback) ACK
STA 00:15:af:12:a7:cb sent probe request for broadcast SSID
MGMT (TX callback) fail
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
MGMT (TX callback) ACK
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
MGMT (TX callback) fail
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
MGMT (TX callback) fail
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
MGMT (TX callback) ACK
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
STA 00:c0:a8:cc:23:27 sent probe request for our SSID
MGMT (TX callback) fail
mgmt::proberesp cb
MGMT (TX callback) fail
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for our SSID
MGMT (TX callback) ACK
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
MGMT (TX callback) fail
mgmt::proberesp cb
STA 00:c0:a8:cc:23:27 sent probe request for broadcast SSID
MGMT (TX callback) fail
mgmt::proberesp cb
^CSignal 2 received - terminating
Flushing old station entries
Deauthenticate all stations
Seems like there were the same problems with rt2x00
(http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?f=5&t=5005) but the patch
there only affects the rt2x00 driver.
Please ask if you need more information.
Cheers,
Manuel
^ permalink raw reply
* Re: [PATCH 2/2] usbnet: add rx queue pausing
From: Jussi Kivilinna @ 2009-08-11 16:50 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linville, David Brownell
In-Reply-To: <1250002657.13529.63.camel@johannes.local>
Quoting "Johannes Berg" <johannes@sipsolutions.net>:
> On Tue, 2009-08-11 at 17:52 +0300, Jussi Kivilinna wrote:
>
>> + if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
>> + struct sk_buff *skb2;
>> +
>> + skb2 = skb_clone(skb, GFP_ATOMIC);
>> + if (unlikely(!skb2))
>> + return;
>> +
>> + skb_queue_tail(&dev->rxq_pause, skb2);
>> + kfree_skb(skb);
>
> Why clone and then free the original?
>
Ah, I had some problems and let this in. No reason, works fine without
cloning. I'll post v2 soon.
-Jussi
^ permalink raw reply
* Re: Roaming behavior
From: David Seira @ 2009-08-11 15:11 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <20090811135915.GC2684@tuxdriver.com>
El mar, 11-08-2009 a las 09:59 -0400, John W. Linville escribió:
> On Tue, Aug 11, 2009 at 12:44:51PM +0000, David Seira wrote:
>
> > I asked in the ath5k-user list about how to change roaming behavior of
> > ath5k. Pavel Roskin told me that I asked here.
> > I need to modify the roaming behavior, where can I do this?
>
> This is mostly in the hands of wpa_supplicant...what modifications
> do you want to make?
>
> John
Hi.
I want to delete this behavior because I'm developing an application
which do that alone.
Thanks for all,
David
P.D: I have an OpenWRT r16278. The files that I want to modify were in
compat-wireless-2009-05-21, but I don't know which are.
^ permalink raw reply
* Re: [PATCH 2/2] usbnet: add rx queue pausing
From: Johannes Berg @ 2009-08-11 14:58 UTC (permalink / raw)
To: Jussi Kivilinna; +Cc: linux-wireless, linville, David Brownell
In-Reply-To: <20090811145208.20888.70513.stgit@fate.lan>
[-- Attachment #1: Type: text/plain, Size: 275 bytes --]
On Tue, 2009-08-11 at 17:52 +0300, Jussi Kivilinna wrote:
> + if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
> + struct sk_buff *skb2;
> +
> + skb2 = skb_clone(skb, GFP_ATOMIC);
> + if (unlikely(!skb2))
> + return;
that leaks the original afaict.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] usbnet: add rx queue pausing
From: Johannes Berg @ 2009-08-11 14:57 UTC (permalink / raw)
To: Jussi Kivilinna; +Cc: linux-wireless, linville, David Brownell
In-Reply-To: <20090811145208.20888.70513.stgit@fate.lan>
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
On Tue, 2009-08-11 at 17:52 +0300, Jussi Kivilinna wrote:
> + if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
> + struct sk_buff *skb2;
> +
> + skb2 = skb_clone(skb, GFP_ATOMIC);
> + if (unlikely(!skb2))
> + return;
> +
> + skb_queue_tail(&dev->rxq_pause, skb2);
> + kfree_skb(skb);
Why clone and then free the original?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH 2/2] usbnet: add rx queue pausing
From: Jussi Kivilinna @ 2009-08-11 14:52 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, David Brownell, Jussi Kivilinna
In-Reply-To: <20090811145203.20888.83008.stgit@fate.lan>
Add rx queue pausing to usbnet. This is needed by rndis_wlan so that it can
control rx queue and prevent received packets from being send forward before
rndis_wlan receives and handles 'media connect'-indication. Without this
establishing WPA connections is hard and fail often.
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
drivers/net/usb/usbnet.c | 52 ++++++++++++++++++++++++++++++++++++-
drivers/net/wireless/rndis_wlan.c | 13 +++++++++
include/linux/usb/usbnet.h | 6 ++++
3 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index af1fe46..06cf18a 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -233,6 +233,19 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
{
int status;
+ if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
+ struct sk_buff *skb2;
+
+ skb2 = skb_clone(skb, GFP_ATOMIC);
+ if (unlikely(!skb2))
+ return;
+
+ skb_queue_tail(&dev->rxq_pause, skb2);
+ kfree_skb(skb);
+
+ return;
+ }
+
skb->protocol = eth_type_trans (skb, dev->net);
dev->net->stats.rx_packets++;
dev->net->stats.rx_bytes += skb->len;
@@ -526,6 +539,41 @@ static void intr_complete (struct urb *urb)
}
/*-------------------------------------------------------------------------*/
+void usbnet_pause_rx(struct usbnet *dev)
+{
+ set_bit(EVENT_RX_PAUSED, &dev->flags);
+
+ if (netif_msg_rx_status(dev))
+ devdbg(dev, "paused rx queue enabled");
+}
+EXPORT_SYMBOL_GPL(usbnet_pause_rx);
+
+void usbnet_resume_rx(struct usbnet *dev)
+{
+ struct sk_buff *skb;
+ int num = 0;
+
+ clear_bit(EVENT_RX_PAUSED, &dev->flags);
+
+ while ((skb = skb_dequeue(&dev->rxq_pause)) != NULL) {
+ usbnet_skb_return(dev, skb);
+ num++;
+ }
+
+ tasklet_schedule(&dev->bh);
+
+ if (netif_msg_rx_status(dev))
+ devdbg(dev, "paused rx queue disabled, %d skbs requeued", num);
+}
+EXPORT_SYMBOL_GPL(usbnet_resume_rx);
+
+void usbnet_purge_paused_rxq(struct usbnet *dev)
+{
+ skb_queue_purge(&dev->rxq_pause);
+}
+EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq);
+
+/*-------------------------------------------------------------------------*/
// unlink pending rx/tx; completion handlers do all other cleanup
@@ -623,6 +671,8 @@ int usbnet_stop (struct net_device *net)
usb_kill_urb(dev->interrupt);
+ usbnet_purge_paused_rxq(dev);
+
/* deferred work (task, timer, softirq) must also stop.
* can't flush_scheduled_work() until we drop rtnl (later),
* else workers could deadlock; so make workers a NOP.
@@ -1113,7 +1163,6 @@ static void usbnet_bh (unsigned long param)
}
-\f
/*-------------------------------------------------------------------------
*
* USB Device Driver support
@@ -1210,6 +1259,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
skb_queue_head_init (&dev->rxq);
skb_queue_head_init (&dev->txq);
skb_queue_head_init (&dev->done);
+ skb_queue_head_init(&dev->rxq_pause);
dev->bh.func = usbnet_bh;
dev->bh.data = (unsigned long) dev;
INIT_WORK (&dev->kevent, kevent);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 828dc18..d42692d 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1764,8 +1764,15 @@ static int rndis_iw_set_essid(struct net_device *dev,
if (!wrqu->essid.flags || length == 0)
return disassociate(usbdev, 1);
- else
+ else {
+ /* Pause and purge rx queue, so we don't pass packets before
+ * 'media connect'-indication.
+ */
+ usbnet_pause_rx(usbdev);
+ usbnet_purge_paused_rxq(usbdev);
+
return set_essid(usbdev, &ssid);
+ }
}
@@ -2328,6 +2335,8 @@ get_bssid:
memcpy(evt.ap_addr.sa_data, bssid, ETH_ALEN);
wireless_send_event(usbdev->net, SIOCGIWAP, &evt, NULL);
}
+
+ usbnet_resume_rx(usbdev);
}
if (test_and_clear_bit(WORK_LINK_DOWN, &priv->work_pending)) {
@@ -2541,6 +2550,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
switch (msg->status) {
case RNDIS_STATUS_MEDIA_CONNECT:
+ usbnet_pause_rx(usbdev);
+
devinfo(usbdev, "media connect");
/* queue work to avoid recursive calls into rndis_command */
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index de8b4b1..0951425 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -53,6 +53,7 @@ struct usbnet {
struct sk_buff_head rxq;
struct sk_buff_head txq;
struct sk_buff_head done;
+ struct sk_buff_head rxq_pause;
struct urb *interrupt;
struct tasklet_struct bh;
@@ -63,6 +64,7 @@ struct usbnet {
# define EVENT_RX_MEMORY 2
# define EVENT_STS_SPLIT 3
# define EVENT_LINK_RESET 4
+# define EVENT_RX_PAUSED 5
};
static inline struct usb_driver *driver_of(struct usb_interface *intf)
@@ -190,6 +192,10 @@ extern void usbnet_defer_kevent (struct usbnet *, int);
extern void usbnet_skb_return (struct usbnet *, struct sk_buff *);
extern void usbnet_unlink_rx_urbs(struct usbnet *);
+extern void usbnet_pause_rx(struct usbnet *);
+extern void usbnet_resume_rx(struct usbnet *);
+extern void usbnet_purge_paused_rxq(struct usbnet *);
+
extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd);
extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd);
extern u32 usbnet_get_link (struct net_device *net);
^ permalink raw reply related
* [PATCH 1/2] Revert "rndis_wlan: wait association to complete"
From: Jussi Kivilinna @ 2009-08-11 14:52 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, Jussi Kivilinna
"rndis_wlan: wait association to complete" would block SIOCSIWESSID
to fix broken WPA associations. This is wrong way of fixing the
problem, so revert this one.
This reverts commit 1f717679fe4e2c804bab964b60bb01c69ef015c7.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
drivers/net/wireless/rndis_wlan.c | 47 ++++---------------------------------
1 files changed, 5 insertions(+), 42 deletions(-)
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index f2e7505..828dc18 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -378,7 +378,6 @@ enum wpa_key_mgmt { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
#define WORK_LINK_UP (1<<0)
#define WORK_LINK_DOWN (1<<1)
#define WORK_SET_MULTICAST_LIST (1<<2)
-#define WORK_ASSOC_WAIT (1<<3)
#define COMMAND_BUFFER_SIZE (CONTROL_BUFFER_SIZE + sizeof(struct rndis_set))
@@ -437,7 +436,6 @@ struct rndis_wlan_private {
struct work_struct work;
struct mutex command_lock;
spinlock_t stats_lock;
- struct completion assoc_wait;
unsigned long work_pending;
struct ieee80211_supported_band band;
@@ -938,9 +936,7 @@ static int get_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
}
-#define ASSOC_TIMEOUT_JIFFIES (HZ*10)
-static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid,
- bool wait)
+static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
{
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
int ret;
@@ -952,21 +948,6 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid,
devdbg(usbdev, "set_essid: radio_on = 1");
}
- if (!wait)
- return ret;
-
- /* If we return now, userspace would get association events too late
- * (after receiving first packets from access point). This causes
- * WPA authentication to fail.
- */
- set_bit(WORK_ASSOC_WAIT, &priv->work_pending);
- queue_work(priv->workqueue, &priv->work);
-
- wait_for_completion_interruptible_timeout(&priv->assoc_wait,
- ASSOC_TIMEOUT_JIFFIES);
-
- clear_bit(WORK_ASSOC_WAIT, &priv->work_pending);
-
return ret;
}
@@ -1028,7 +1009,7 @@ static int disassociate(struct usbnet *usbdev, int reset_ssid)
ssid.essid[1] = 0xff;
for (i = 2; i < sizeof(ssid.essid); i++)
ssid.essid[i] = 0x1 + (ssid.essid[i] * 0xfe / 0xff);
- ret = set_essid(usbdev, &ssid, false);
+ ret = set_essid(usbdev, &ssid);
}
return ret;
}
@@ -1784,7 +1765,7 @@ static int rndis_iw_set_essid(struct net_device *dev,
if (!wrqu->essid.flags || length == 0)
return disassociate(usbdev, 1);
else
- return set_essid(usbdev, &ssid, true);
+ return set_essid(usbdev, &ssid);
}
@@ -2025,7 +2006,7 @@ static int rndis_iw_set_encode(struct net_device *dev,
if (index == priv->encr_tx_key_index)
/* ndis drivers want essid to be set after setting encr */
- set_essid(usbdev, &priv->essid, false);
+ set_essid(usbdev, &priv->essid);
return 0;
}
@@ -2307,20 +2288,7 @@ static void rndis_wlan_worker(struct work_struct *work)
unsigned char bssid[ETH_ALEN];
struct ndis_80211_assoc_info *info;
int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32;
- int ret, offset, len;
- __le32 tmp = 0;
-
- if (test_bit(WORK_ASSOC_WAIT, &priv->work_pending)) {
- /* dummy OID to poll device */
- len = sizeof(tmp);
- rndis_query_oid(usbdev, OID_GEN_XMIT_ERROR, &tmp, &len);
-
- /* requeue work if no link up response from device */
- if (!test_bit(WORK_LINK_UP, &priv->work_pending)) {
- msleep(10);
- queue_work(priv->workqueue, &priv->work);
- }
- }
+ int ret, offset;
if (test_and_clear_bit(WORK_LINK_UP, &priv->work_pending)) {
netif_carrier_on(usbdev->net);
@@ -2360,8 +2328,6 @@ get_bssid:
memcpy(evt.ap_addr.sa_data, bssid, ETH_ALEN);
wireless_send_event(usbdev->net, SIOCGIWAP, &evt, NULL);
}
-
- complete_all(&priv->assoc_wait);
}
if (test_and_clear_bit(WORK_LINK_DOWN, &priv->work_pending)) {
@@ -2864,7 +2830,6 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
mutex_init(&priv->command_lock);
spin_lock_init(&priv->stats_lock);
- init_completion(&priv->assoc_wait);
/* because rndis_command() sleeps we need to use workqueue */
priv->workqueue = create_singlethread_workqueue("rndis_wlan");
@@ -2967,7 +2932,6 @@ static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf)
/* turn radio off */
disassociate(usbdev, 0);
- complete_all(&priv->assoc_wait);
cancel_delayed_work_sync(&priv->stats_work);
cancel_delayed_work_sync(&priv->scan_work);
cancel_work_sync(&priv->work);
@@ -3017,7 +2981,6 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
retval = disassociate(usbdev, 0);
priv->work_pending = 0;
- complete_all(&priv->assoc_wait);
cancel_delayed_work_sync(&priv->stats_work);
cancel_delayed_work_sync(&priv->scan_work);
cancel_work_sync(&priv->work);
^ permalink raw reply related
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: David Miller @ 2009-08-11 14:49 UTC (permalink / raw)
To: jkosina
Cc: joe, linville, julia, netdev, linux-kernel, kernel-janitors,
linux-wireless
In-Reply-To: <alpine.LRH.2.00.0908111555410.11142@twin.jikos.cz>
From: Jiri Kosina <jkosina@suse.cz>
Date: Tue, 11 Aug 2009 15:55:46 +0200 (CEST)
> On Tue, 28 Jul 2009, Joe Perches wrote:
>
>> > Why not just create a plain "WIRELESS" umbrella entry that contains
>> > all of drivers/net/wireless, net/mac80211, and net/wireless?
>> Whatever works for John I suppose. John, do you have a preference?
>> I was trying to avoid the "S: Maintained" label
>> and was copying the form of this section:
>>
>> NETWORKING DRIVERS
>> L: netdev@vger.kernel.org
>> W: http://www.linuxfoundation.org/en/Net
>> T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
>> S: Odd Fixes
>> F: drivers/net/
>
> Just out of curiosity, why is drivers/net marked as "Odd fixes" and not
> "Maintained"?
Because it depends upon the individual driver maintainers. For
example, I don't think one could claim 3c515.c or other ISA ethernet
drivers to be in any kind of "Maintained" state.
^ permalink raw reply
* [PATCH] trivial: remove duplicate "different" from comment
From: Thadeu Lima de Souza Cascardo @ 2009-08-11 14:18 UTC (permalink / raw)
To: trivial
Cc: johannes, davem, linville, lrodriguez, linux-wireless, netdev,
linux-kernel, Thadeu Lima de Souza Cascardo
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
net/wireless/reg.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index fc7a484..f256dff 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1424,7 +1424,7 @@ static int ignore_request(struct wiphy *wiphy,
if (last_wiphy != wiphy) {
/*
* Two cards with two APs claiming different
- * different Country IE alpha2s. We could
+ * Country IE alpha2s. We could
* intersect them, but that seems unlikely
* to be correct. Reject second one for now.
*/
--
1.6.3.3
^ permalink raw reply related
* Re: Libertas: Association request to the driver failed
From: Roel Kluin @ 2009-08-11 7:02 UTC (permalink / raw)
To: John W. Linville; +Cc: Daniel Mack, libertas-dev, linux-wireless, linux-kernel
In-Reply-To: <20090810175939.GH2733@tuxdriver.com>
The size of the tmp buffer was too small, causing a regression
rates->rates has an arraysize of 1, so a memcpy with
MAX_RATES (14) was already causing reads out of bounds.
In get_common_rates() the memset/memcpy can be moved upwards.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Tested-by: Daniel Mack <daniel@caiaq.de>
---
> Delta patch, please...
Here,
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index d699737..ba0164a 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -44,8 +44,8 @@ static int get_common_rates(struct lbs_private *priv,
u16 *rates_size)
{
u8 *card_rates = lbs_bg_rates;
- int ret = 0, i, j;
- u8 tmp[(ARRAY_SIZE(lbs_bg_rates) - 1) * (*rates_size - 1)];
+ int i, j;
+ u8 tmp[MAX_RATES * ARRAY_SIZE(lbs_bg_rates)];
size_t tmp_size = 0;
/* For each rate in card_rates that exists in rate1, copy to tmp */
@@ -62,20 +62,23 @@ static int get_common_rates(struct lbs_private *priv,
lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size);
lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate);
+ memset(rates, 0, *rates_size);
+ *rates_size = min_t(u16, tmp_size, *rates_size);
+ memcpy(rates, tmp, *rates_size);
+
if (!priv->enablehwauto) {
for (i = 0; i < tmp_size; i++) {
if (tmp[i] == priv->cur_rate)
- goto done;
+ break;
+ }
+ if (i == tmp_size) {
+ lbs_pr_alert("Previously set fixed data rate %#x isn't "
+ "compatible with the network.\n",
+ priv->cur_rate);
+ return -1;
}
- lbs_pr_alert("Previously set fixed data rate %#x isn't "
- "compatible with the network.\n", priv->cur_rate);
- ret = -1;
}
-done:
- memset(rates, 0, *rates_size);
- *rates_size = min_t(int, tmp_size, *rates_size);
- memcpy(rates, tmp, *rates_size);
- return ret;
+ return 0;
}
@@ -319,8 +322,8 @@ static int lbs_associate(struct lbs_private *priv,
rates = (struct mrvl_ie_rates_param_set *) pos;
rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
- memcpy(&rates->rates, &bss->rates, MAX_RATES);
tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES);
+ memcpy(&rates->rates, &bss->rates, tmplen);
if (get_common_rates(priv, rates->rates, &tmplen)) {
ret = -1;
goto done;
^ permalink raw reply related
* Re: [PATCH 2.6.30] iwl3945: fix rfkill switch
From: Stanislaw Gruszka @ 2009-08-11 14:09 UTC (permalink / raw)
To: reinette chatre
Cc: linux-wireless@vger.kernel.org, Zhu, Yi, John W. Linville,
stable@kernel.org
In-Reply-To: <1249922692.30019.5610.camel@rc-desk>
Hello Reinette.
On Mon, Aug 10, 2009 at 09:44:52AM -0700, reinette chatre wrote:
> On Thu, 2009-08-06 at 23:31 -0700, Stanislaw Gruszka wrote:
> > On Thu, Aug 06, 2009 at 01:15:58PM -0700, reinette chatre wrote:
> > > On Thu, 2009-08-06 at 00:19 -0700, Stanislaw Gruszka wrote:
> > > > On Wed, Aug 05, 2009 at 03:51:49PM -0700, reinette chatre wrote:
> > > > > On Tue, 2009-08-04 at 05:35 -0700, Stanislaw Gruszka wrote:
> > > > > > Due to rfkill and iwlwifi mishmash of SW / HW killswitch representation,
> > > > > > we have race conditions which make unable turn wifi radio on, after enable
> > > > > > and disable again killswitch. I can observe this problem on my laptop
> > > > > > with iwl3945 device.
> > > > > >
> > > > > > In rfkill core HW switch and SW switch are separate 'states'. Device can
> > > > > > be only in one of 3 states: RFKILL_STATE_SOFT_BLOCKED, RFKILL_STATE_UNBLOCKED,
> > > > > > RFKILL_STATE_HARD_BLOCKED. Whereas in iwlwifi driver we have separate bits
> > > > > > STATUS_RF_KILL_HW and STATUS_RF_KILL_SW for HW and SW switches - radio can be
> > > > > > turned on, only if both bits are cleared.
> > > > > >
> > > > > > In this particular race conditions, radio can not be turned on if in driver
> > > > > > STATUS_RF_KILL_SW bit is set, and rfkill core is in state
> > > > > > RFKILL_STATE_HARD_BLOCKED, because rfkill core is unable to call
> > > > > > rfkill->toggle_radio(). This situation can be entered in case:
> > > > > >
> > > > >
> > > > > I am trying to understand this race condition ...
> > > > >
> > > > > > - killswitch is turned on
> > > > > > - rfkill core 'see' button change first and move to RFKILL_STATE_SOFT_BLOCKED
> > > > > > also call ->toggle_radio() and STATE_RF_KILL_SW in driver is set
> > > > > > - iwl3945 get info about button from hardware to set STATUS_RF_KILL_HW bit and
> > > > > > force rfkill to move to RFKILL_STATE_HARD_BLOCKED
> > > > >
> > > > > ok - so at this point we have rfkill == RFKILL_STATE_HARD_BLOCKED, and
> > > > > driver == STATE_RF_KILL_SW | STATE_RF_KILL_HW
> > > > >
> > > > > > - killsiwtch is turend off
> > > >
> > > > Here rfkill core routines are called. Rfkill wants to clear STATUS_RF_KILL_SW
> > > > but it can not as state is RFKILL_STATE_HARD_BLOCKED.
> > > >
> > > > > > - driver clear STATUS_RF_KILL_HW
> > > > >
> > > > > at this point the driver should clear STATE_RF_KILL_HW and then call
> > > > > iwl_rfkill_set_hw_state(). From what I can tell, in
> > > > > iwl_rfkill_set_hw_state() the test for iwl_is_rfkill_sw() will cause the
> > > > > driver to call rfkill_force_state for RFKILL_STATE_SOFT_BLOCKED
> > > > >
> > > > > So, from what I understand after the above the status will be
> > > > >
> > > > > rfkill == RFKILL_STATE_SOFT_BLOCKED, and driver == STATE_RF_KILL_SW
> > > >
> > > > Thats right. But rfkill core no longer wants to manipulate state via
> > > > ->toggle_radio() and radio stays disabled.
> > > >
> > > > > > - rfkill core is unable to clear STATUS_RF_KILL_SW in driver
> > > > >
> > > > > I do not understand why this is a problem here. Could you please
> > > > > highlight what I am missing?
> > > >
> > > > In my description I miss the most important part, sorry. Race is when the
> > > > switches are performed in that order:
> > > >
> > > > Radio enabled
> > > > - rfkill SW on
> > > > - driver HW on
> > > > Radio disabled - ok
> > > > - rfkill SW off <- problem not clearing STATUS_RF_KILL_SW
>
> Yes. I assume that what happens here is that rfkill notifies user that
> state changes to RFKILL_STATE_UNBLOCKED. In your new patch the driver
> will now clear STATUS_RF_KILL_SW, with STATUS_RF_KILL_HW still being
> set. So, in this run, after iwl_rfkill_soft_rf_kill is called there will
> be a state mismatch with rfkill thinking the system is unblocked while
> the driver has it as hard blocked. This is not right.
In such case we return -EBUSY from iwl_rfkill_soft_rf_kill() - rfkill
state not change. I made a comment it will be HARD_BLOCKED, this
is not true anymore, it can be also in state SOFT_BLOCKED . However
comment was true with previous version of the patch for 2.6.29, where
there was no HARD -> SOFT downgrade and that part was called only when
rfkill state was HARD_BLOCKED.
> Can this be fixed by adding a iwl_rfkill_set_hw_state in this run?
We can not call iwl_rfkill_set_hw_state in iwl_rfkill_soft_rt_kill
as rfkill->muttex is taken. We eventually can force state in the same ugly
way as is done for case RFKILL_STATE_SOFT_BLOCKED and I think, this is good
idea :) , below not tested delta patch:
diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
index d6b6098..636c04a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
@@ -35,6 +35,19 @@
#include "iwl-dev.h"
#include "iwl-core.h"
+static void iwl_force_rfkill_state(struct iwl_priv *priv,
+ enum rfkill_state state)
+{
+ enum rfkill_state oldstate;
+
+ oldstate = priv->rfkill->state;
+ priv->rfkill->state = state;
+
+ /* rfkill_uevent() */
+ if (oldstate != state)
+ kobject_uevent(&priv->rfkill->dev.kobj, KOBJ_CHANGE);
+}
+
/* software rf-kill from user */
static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
{
@@ -54,8 +67,9 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
case RFKILL_STATE_UNBLOCKED:
if (iwl_is_rfkill_hw(priv)) {
err = -EBUSY;
- /* pass error to rfkill core to make it state HARD
+ /* pass error to rfkill core, make it state HARD
* BLOCKED and disable software kill switch */
+ iwl_force_rfkill_state(priv, RFKILL_STATE_HARD_BLOCKED);
}
iwl_radio_kill_sw_enable_radio(priv);
break;
@@ -63,10 +77,10 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
iwl_radio_kill_sw_disable_radio(priv);
/* rfkill->mutex lock is taken */
if (priv->rfkill->state == RFKILL_STATE_HARD_BLOCKED) {
- /* force rfkill core state to be SOFT BLOCKED,
+ /* force rfkill core state to be in SOFT BLOCKED,
* otherwise core will be unable to disable software
* kill switch */
- priv->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
+ iwl_force_rfkill_state(priv, RFKILL_STATE_SOFT_BLOCKED);
}
break;
default:
> > > > - driver HW off
> > > > Radio disabled - wrong
> > > >
> > > > Everything is fine when actions are in that order:
> > > >
> > > > Radio enabled
> > > > - rfkill SW on
> > > > - driver HW on
> > > > Radio disabled - ok
> > > > - driver HW off
> > > > - rfkill SW off
> > > > Radio enabled - ok
> > >
> > >
> > > Thanks for the explanation.
> > >
> > > >
> > > > > >
> > > > > > Additionally call to rfkill_epo() when STATUS_RF_KILL_HW in driver is set
> > > > > > cause move to the same situation.
> > > > > >
> > > > > > In 2.6.31 this problem is fixed due to _total_ rewrite of rfkill subsystem.
> > > > > > This is a quite small fix for 2.6.30.x in iwl3945 driver. We disable
> > > > > > STATUS_RF_KILL_SW bit regardless of HW bit state. Also report to rfkill
> > > > > > subsystem SW switch bit before HW switch bit to move rfkill subsystem
> > > > > > to SOFT_BLOCK rather than HARD_BLOCK.
> > > > > >
> > > > > > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > > > > > ---
> > > > > > I'm not sure if this is good candidate for stable as this is not backport
> > > > > > of upstream commit. Also I did not test this patch with other iwlwifi devices,
> > > > > > only with iwl3945.
> > > > > >
> > > > > > drivers/net/wireless/iwlwifi/iwl-rfkill.c | 24 ++++++++++++++----------
> > > > > > 1 files changed, 14 insertions(+), 10 deletions(-)
> > > > > >
> > > > > > diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
> > > > > > index 2ad9faf..d6b6098 100644
> > > > > > --- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
> > > > > > +++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
> > > > > > @@ -54,21 +54,28 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
> > > > > > case RFKILL_STATE_UNBLOCKED:
> > > > > > if (iwl_is_rfkill_hw(priv)) {
> > > > > > err = -EBUSY;
> > > > > > - goto out_unlock;
> > > > > > + /* pass error to rfkill core to make it state HARD
> > > > > > + * BLOCKED and disable software kill switch */
> > > > > > }
> > > > > > iwl_radio_kill_sw_enable_radio(priv);
> > > > > > break;
> > > > > > case RFKILL_STATE_SOFT_BLOCKED:
> > > > > > iwl_radio_kill_sw_disable_radio(priv);
> > > > > > + /* rfkill->mutex lock is taken */
> > > > > > + if (priv->rfkill->state == RFKILL_STATE_HARD_BLOCKED) {
> > > > > > + /* force rfkill core state to be SOFT BLOCKED,
> > > > > > + * otherwise core will be unable to disable software
> > > > > > + * kill switch */
> > > > > > + priv->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
> > > > > > + }
> > > > >
> > > > > I understand that you are directly changing the rfkill internals because
> > > > > the mutex is taken ... but this really does not seem right to directly
> > > > > modify the rfkill state in this way.
> > > >
> > > > Agree this is dirty hack, but I did not find a better way. Eventually,
> > > > if we add call to rfkill_uevent(), this would behave the same
> > > > as rfkill_force_state() .
> > >
> > > Sorry, but I really do not understand why this code is needed. From what
> > > you say rfkill can be in one of three states: RFKILL_STATE_UNBLOCKED,
> > > RFKILL_STATE_SOFT_BLOCKED, or RFKILL_STATE_HARD_BLOCKED. From what I
> > > understand the above code is called when there is an rfkill state change
> > > and the new state is provided. So, only _one_ of the three states will
> > > be provided as parameter. This state is then tested - so in the case
> > > that you modified here the state has already been tested to be
> > > RFKILL_STATE_SOFT_BLOCKED. How is it thus possible that it can be
> > > RFKILL_STATE_HARD_BLOCKED also?
> >
> > Local variable state != priv->rfkill->state . See rfkill_toggle_radio()
> > especially this part:
> >
> > if (force || state != rfkill->state) {
> > retval = rfkill->toggle_radio(rfkill->data, state);
> > /* never allow a HARD->SOFT downgrade! */
>
> This comment makes me even more concerned about this patch. It
> explicitly states "never allow a HARD->SOFT downgrade!" and that is what
> your patch now seems to do.
Yes, but that was rewritten in upstream ...
> > if (!retval && rfkill->state != RFKILL_STATE_HARD_BLOCKED)
> > rfkill->state = state;
> > }
> >
> > Without the change rfkill core will be in state RFKILL_STATE_HARD_BLOCKED and
> > latter will not clear STATE_RF_KILL_SW.
> >
> > All hunks from the patch are needed on my laptop (lenoveo T60) to make
> > killswitch works as expected. Applying only some hunks from the patch helps
> > is one case or other, but without all hunks there is still possible to have
> > radio disabled when killswitch is off.
>
> >From what I can tell this patch introduced a disagreement of rfkill
> state between driver and rfkill system.
In driver we have no states, but separate bits for each killswitch. Situation
gets better after rfkill rewrite where also rfkill core become to have separate
bits, but with 2.6.30 we have no such luck.
Currently we have "states" like below:
STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_HARD_BLOCKED
STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
Patch is intended to work like that:
STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
> Maybe if we can sort this out we do not need all these hunks?
Sort out ... uff, it's hard to explain all possible thinks that
can happen here - ok let's try.
RH bugzilla report is here:
http://bugzilla.redhat.com/show_bug.cgi?id=498622
Report was originally for fedora version of 2.6.29 and patch without ugly force
HARD->SOFT downgrade, fix the bug. However in vanilla 2.6.30.4 problem is worse
due to some changes to input (or rfkill-input) layer. Except above ordering,
which can make radio disabled when killswitch is off, similarly things can be
done is such order:
STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
driver HW on
STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
rfkill SW on ( -> rfkill_epo() -> rfkill_toggle_radio() with force = 1)
STATUS_RF_KILL_HW=1, STATUS_RF_KILL_SW=1, RFKILL_STATE_HARD_BLOCKED
rfkill SW off (HARD_BLOCKED not clearing STATUS_RF_KILL_SW)
STATUS_RF_KILL_HW=1, STATUS_RF_KILL_SW=1, RFKILL_STATE_HARD_BLOCKED
driver HW off (called from iwl_bg_rf_kill())
STATUS_RF_KILL_HW=0, STATUS_RF_KILL_SW=1, RFKILL_STATE_SOFT_BLOCKED
rfkill core no longer wants to turn radio on
I guess problems only happens on iwl3945 due to HW killswitch is
checked from workqueue in polling way. If this would be interrupt we
will probably not encounter races.
Cheers
Stanislaw
^ permalink raw reply related
* Re: Roaming behavior
From: John W. Linville @ 2009-08-11 13:59 UTC (permalink / raw)
To: David Seira; +Cc: linux-wireless
In-Reply-To: <loom.20090811T124332-602@post.gmane.org>
On Tue, Aug 11, 2009 at 12:44:51PM +0000, David Seira wrote:
> I asked in the ath5k-user list about how to change roaming behavior of
> ath5k. Pavel Roskin told me that I asked here.
> I need to modify the roaming behavior, where can I do this?
This is mostly in the hands of wpa_supplicant...what modifications
do you want to make?
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: Jiri Kosina @ 2009-08-11 13:55 UTC (permalink / raw)
To: Joe Perches
Cc: David Miller, linville, julia, netdev, linux-kernel,
kernel-janitors, linux-wireless
In-Reply-To: <1248806896.18284.14.camel@Joe-Laptop.home>
On Tue, 28 Jul 2009, Joe Perches wrote:
> > Why not just create a plain "WIRELESS" umbrella entry that contains
> > all of drivers/net/wireless, net/mac80211, and net/wireless?
> Whatever works for John I suppose. John, do you have a preference?
> I was trying to avoid the "S: Maintained" label
> and was copying the form of this section:
>
> NETWORKING DRIVERS
> L: netdev@vger.kernel.org
> W: http://www.linuxfoundation.org/en/Net
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
> S: Odd Fixes
> F: drivers/net/
Just out of curiosity, why is drivers/net marked as "Odd fixes" and not
"Maintained"?
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] ath9k: Fix read buffer overflow
From: Roel Kluin @ 2009-08-11 6:49 UTC (permalink / raw)
To: John W. Linville
Cc: Jouni Malinen, linux-wireless, ath9k-devel, Andrew Morton
In-Reply-To: <20090810202622.GB6060@tuxdriver.com>
Prevent a read of powInfo[-1] in the first iteration.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index ce0e86c..e67db2c 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -150,10 +150,10 @@ static void ath9k_hw_get_legacy_target_powers(struct ath_hw *ah,
IS_CHAN_2GHZ(chan))) {
matchIndex = i;
break;
- } else if ((freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
- IS_CHAN_2GHZ(chan))) &&
- (freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
- IS_CHAN_2GHZ(chan)))) {
+ } else if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
+ IS_CHAN_2GHZ(chan)) && i > 0 &&
+ freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
+ IS_CHAN_2GHZ(chan))) {
lowIndex = i - 1;
break;
}
@@ -268,10 +268,10 @@ static void ath9k_hw_get_target_powers(struct ath_hw *ah,
matchIndex = i;
break;
} else
- if ((freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
- IS_CHAN_2GHZ(chan))) &&
- (freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
- IS_CHAN_2GHZ(chan)))) {
+ if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
+ IS_CHAN_2GHZ(chan)) && i > 0 &&
+ freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
+ IS_CHAN_2GHZ(chan))) {
lowIndex = i - 1;
break;
}
^ permalink raw reply related
* [PATCH] iw: fix typos in MCS set parsing code
From: Gabor Juhos @ 2009-08-11 6:47 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless@vger.kernel.org, Luis R. Rodriguez, Gabor Juhos
The current code uses wrong binary operator for masking,
and the shift values for the 'tx_max_num_spatial_streams' and
'tx_unequal_modulation' fields are off-by-one.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
info.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/info.c b/info.c
index 2db0fc7..542745b 100644
--- a/info.c
+++ b/info.c
@@ -159,8 +159,8 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
max_rx_supp_data_rate = ((mcs[10] >> 8) & ((mcs[11] & 0x3) << 8));
tx_mcs_set_defined = !!(mcs[12] & (1 << 0));
tx_mcs_set_equal = !(mcs[12] & (1 << 1));
- tx_max_num_spatial_streams = (mcs[12] | ((1 << 3) | (1 << 4))) + 1;
- tx_unequal_modulation = !!(mcs[12] & (1 << 5));
+ tx_max_num_spatial_streams = (mcs[12] & ((1 << 2) | (1 << 3))) + 1;
+ tx_unequal_modulation = !!(mcs[12] & (1 << 4));
if (max_rx_supp_data_rate)
printf("\t\tHT Max RX data rate: %d Mbps\n", max_rx_supp_data_rate);
--
1.5.3.2
^ permalink raw reply related
* Roaming behavior
From: David Seira @ 2009-08-11 12:44 UTC (permalink / raw)
To: linux-wireless
Hi.
I asked in the ath5k-user list about how to change roaming behavior of
ath5k. Pavel Roskin told me that I asked here.
I need to modify the roaming behavior, where can I do this?
Thanks for all,
David
P.D: sorry for my poor english
^ permalink raw reply
* Re: [PATCH] wl1271: fix compiler warnings on 64 bit archs
From: Stephen Rothwell @ 2009-08-11 10:07 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless, linville, linux-next, linux-kernel
In-Reply-To: <1249981107-21746-1-git-send-email-luciano.coelho@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]
Hi Luciano,
On Tue, 11 Aug 2009 11:58:27 +0300 Luciano Coelho <luciano.coelho@nokia.com> wrote:
>
> +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
> @@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
>
> wl1271_debug(DEBUG_BOOT, "starting firmware upload");
>
> - wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", fw_data_len,
> - CHUNK_SIZE);
> + wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
> + (u32) fw_data_len, CHUNK_SIZE);
fw_data_len is a size_t and so should be printed with %zd.
> @@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
> addr = dest + chunk_num * CHUNK_SIZE;
> p = buf + chunk_num * CHUNK_SIZE;
> wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
> - fw_data_len % CHUNK_SIZE, p, addr);
> + (u32) fw_data_len % CHUNK_SIZE, p, addr);
ditto.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [PATCH] wl1271: fix compiler warnings on 64 bit archs
From: Luciano Coelho @ 2009-08-11 8:58 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, linux-next, linux-kernel, sfr
There were a few warnings when compiling the wl1271 driver on 64 bit
architectures. This was due to size mismatch of integers.
This commit fixes the following warnings:
drivers/net/wireless/wl12xx/wl1271_main.c: In function 'wl1271_irq_work':
drivers/net/wireless/wl12xx/wl1271_main.c:184: warning: large integer implicitly truncated to unsigned type
drivers/net/wireless/wl12xx/wl1271_boot.c: In function 'wl1271_boot_upload_firmware_chunk':
drivers/net/wireless/wl12xx/wl1271_boot.c:103: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
drivers/net/wireless/wl12xx/wl1271_boot.c:150: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
drivers/net/wireless/wl12xx/wl1271_boot.c: In function 'wl1271_boot_enable_interrupts':
drivers/net/wireless/wl12xx/wl1271_boot.c:278: warning: large integer implicitly truncated to unsigned type
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
drivers/net/wireless/wl12xx/wl1271_boot.c | 9 +++++----
drivers/net/wireless/wl12xx/wl1271_main.c | 3 ++-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index 4c22f25..2b5d101 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -100,8 +100,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
wl1271_debug(DEBUG_BOOT, "starting firmware upload");
- wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d", fw_data_len,
- CHUNK_SIZE);
+ wl1271_debug(DEBUG_BOOT, "fw_data_len %d chunk_size %d",
+ (u32) fw_data_len, CHUNK_SIZE);
if ((fw_data_len % 4) != 0) {
@@ -148,7 +148,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
addr = dest + chunk_num * CHUNK_SIZE;
p = buf + chunk_num * CHUNK_SIZE;
wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%d B) 0x%p to 0x%x",
- fw_data_len % CHUNK_SIZE, p, addr);
+ (u32) fw_data_len % CHUNK_SIZE, p, addr);
wl1271_spi_mem_write(wl, addr, p, fw_data_len % CHUNK_SIZE);
return 0;
@@ -275,7 +275,8 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
static void wl1271_boot_enable_interrupts(struct wl1271 *wl)
{
enable_irq(wl->irq);
- wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK, ~(WL1271_INTR_MASK));
+ wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK,
+ WL1271_ACX_INTR_ALL & ~(WL1271_INTR_MASK));
wl1271_reg_write32(wl, HI_CFG, HI_CFG_DEF_VAL);
}
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 3bb45ce..4102d59 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -181,7 +181,8 @@ static void wl1271_irq_work(struct work_struct *work)
} while (intr && --ctr);
out_sleep:
- wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK, ~(WL1271_INTR_MASK));
+ wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK,
+ WL1271_ACX_INTR_ALL & ~(WL1271_INTR_MASK));
wl1271_ps_elp_sleep(wl);
out:
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH RFC] b43: LP-PHY: Implement reading band SPROM
From: Gábor Stefanik @ 2009-08-11 12:15 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger
Cc: Broadcom Wireless, linux-wireless
In-Reply-To: <4A80A120.30607@gmail.com>
A few glitches I have noticed have been highlighted below; they will
be fixed in the for-checkin patch.
Nevertheless, the review request still stands.
2009/8/11 Gábor Stefanik <netrolller.3d@gmail.com>:
> Some of the new variables in b43_phy_lp appear to be dead code in
> the vendor driver; they will be removed if they remain unused when
> LP-PHY implementation is finished.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> I've added a few FIXME comments, please review them.
> Also please check that I used the correct types (e.g. u16) for the new
> variables.
>
> Variable name mappings vs. the specification:
> cckpo = tmp3
> ofdmpo = tmp2
> maxpwr = tmp1
>
> The array txpwr_srom_max[3] has been broken up into 3 variables,
> each called max_tx_pwr_{low|med|hi}_band. A struct holding 3 named u16s
> may also be a good choice, but I am not fond of using an array for this.
>
> drivers/net/wireless/b43/phy_lp.c | 83
> ++++++++++++++++++++++++++++++++++++-
> drivers/net/wireless/b43/phy_lp.h | 16 +++++++
> 2 files changed, 98 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index 43272a8..46fe476 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -59,6 +59,87 @@ static void b43_lpphy_op_free(struct b43_wldev *dev)
> dev->phy.lp = NULL;
> }
>
> +static void lpphy_read_band_sprom(struct b43_wldev *dev)
> +{
> + struct b43_phy_lp *lpphy = dev->phy.lp;
> + struct ssb_bus *bus = dev->dev->bus;
> + u16 cckpo, maxpwr;
> + u32 ofdmpo;
> + int i;
> +
> + if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
> + lpphy->tx_isolation_med_band = bus->sprom.tri2g;
> + lpphy->bx_arch = bus->sprom.bxa2g;
> + lpphy->rssi_vf = bus->sprom.rssismf2g;
> + lpphy->rssi_vc = bus->sprom.rssismc2g;
> + lpphy->rssi_gs = bus->sprom.rssisav2g;
> + lpphy->txpa[0] = bus->sprom.pa0b0;
> + lpphy->txpa[1] = bus->sprom.pa0b1;
> + lpphy->txpa[2] = bus->sprom.pa0b2;
> + maxpwr = bus->sprom.maxpwr_bg;
> + lpphy->max_tx_pwr_med_band = maxpwr;
> + cckpo = bus->sprom.cck2gpo;
> + ofdmpo = bus->sprom.ofdm2gpo;
> + if (cckpo) {
> + for (i = 0; i < 4; i++) {
> + lpphy->tx_max_rate[i] =
> + maxpwr - (ofdmpo & 0xF) * 2;
> + ofdmpo << 4;
This was meant to be ofdmpo <<= 4;
> + }
> + ofdmpo = bus->sprom.ofdm2gpo;
> + for (i = 4; i < 15; i++) {
> + lpphy->tx_max_rate[i] =
> + maxpwr - (ofdmpo & 0xF) * 2;
> + ofdmpo << 4;
Same here.
> + }
> + } else {
> + ofdmpo &= 0xFF;
> + for (i = 0; i < 4; i++)
> + lpphy->tx_max_rate[i] = maxpwr;
> + for (i = 4; i < 15; i++)
> + lpphy->tx_max_rate[i] = maxpwr - ofdmpo;
> + }
> + } else { /* 5GHz */
> + lpphy->tx_isolation_low_band = bus->sprom.tri5gl;
> + lpphy->tx_isolation_med_band = bus->sprom.tri5g;
> + lpphy->tx_isolation_hi_band = bus->sprom.tri5gh;
> + lpphy->bx_arch = bus->sprom.bxa5g;
> + lpphy->rssi_vf = bus->sprom.rssismf5g;
> + lpphy->rssi_vc = bus->sprom.rssismc5g;
> + lpphy->rssi_gs = bus->sprom.rssisav5g;
> + lpphy->txpa[0] = bus->sprom.pa1b0;
> + lpphy->txpa[1] = bus->sprom.pa1b1;
> + lpphy->txpa[2] = bus->sprom.pa1b2;
> + lpphy->txpal[0] = bus->sprom.pa1lob0;
> + lpphy->txpal[1] = bus->sprom.pa1lob1;
> + lpphy->txpal[2] = bus->sprom.pa1lob2;
> + lpphy->txpah[0] = bus->sprom.pa1hib0;
> + lpphy->txpah[1] = bus->sprom.pa1hib1;
> + lpphy->txpah[2] = bus->sprom.pa1hib2;
> + maxpwr = bus->sprom.maxpwr_al;
> + ofdmpo = bus->sprom.ofdm5glpo;
> + lpphy->max_tx_pwr_low_band = maxpwr;
> + for (i = 4; i < 12; i++) {
> + lpphy->tx_max_ratel[i] = maxpwr - (ofdmpo & 0xF) *
> 2;
> + ofdmpo << 4;
Ditto.
> + }
> + maxpwr = bus->sprom.maxpwr_a;
> + ofdmpo = bus->sprom.ofdm5gpo;
> + lpphy->max_tx_pwr_med_band = maxpwr;
> + for (i = 4; i < 12; i++) {
> + lpphy->tx_max_rate[i] = maxpwr - (ofdmpo & 0xF) * 2;
> + ofdmpo << 4;
Ditto.
> + }
> + maxpwr = bus->sprom.maxpwr_ah;
> + ofdmpo = bus->sprom.ofdm5ghpo;
> + lpphy->max_tx_pwr_hi_band = maxpwr;
> + for (i = 4; i < 12; i++) {
> + lpphy->tx_max_rateh[i] = maxpwr - (ofdmpo & 0xF) *
> 2;
> + ofdmpo << 4;
Ditto.
> + }
> + }
> +}
> +
> static void lpphy_adjust_gain_table(struct b43_wldev *dev)
> {
> struct b43_phy_lp *lpphy = dev->phy.lp;
> @@ -694,7 +775,7 @@ static void lpphy_tx_pctl_init(struct b43_wldev *dev)
>
> static int b43_lpphy_op_init(struct b43_wldev *dev)
> {
> - /* TODO: band SPROM */
> + lpphy_read_band_sprom(dev); //FIXME should this be in
> prepare_structs?
> lpphy_baseband_init(dev);
> lpphy_radio_init(dev);
> //TODO calibrate RC
> diff --git a/drivers/net/wireless/b43/phy_lp.h
> b/drivers/net/wireless/b43/phy_lp.h
> index 13d89ea..9d0443c 100644
> --- a/drivers/net/wireless/b43/phy_lp.h
> +++ b/drivers/net/wireless/b43/phy_lp.h
> @@ -831,6 +831,22 @@ struct b43_phy_lp {
> /* Transmit isolation high band */
> u8 tx_isolation_hi_band; /* FIXME initial value? */
>
> + /* Max transmit power medium band */
> + u16 max_tx_pwr_med_band;
> + /* Max transmit power low band */
> + u16 max_tx_pwr_low_band;
> + /* Max transmit power high band */
> + u16 max_tx_pwr_hi_band;
> +
> + /* FIXME What are these used for? */
> + /* FIXME Is 15 the correct array size? */
> + u16 tx_sprom_max_rate[15];
> + u16 tx_sprom_max_ratel[15];
> + u16 tx_sprom_max_rateh[15];
> +
> + /* Transmit power arrays */
> + s16 txpa[3], txpal[3], txpah[3];
> +
> /* Receive power offset */
> u8 rx_pwr_offset; /* FIXME initial value? */
>
> --
> 1.6.2.4
>
>
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [PATCH] iw: fix typos in MCS set parsing code
From: Gabor Juhos @ 2009-08-11 7:20 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org, Luis R. Rodriguez
In-Reply-To: <1249973644.5903.14.camel@johannes.local>
Johannes Berg írta:
> On Tue, 2009-08-11 at 08:47 +0200, Gabor Juhos wrote:
>> The current code uses wrong binary operator for masking,
>> and the shift values for the 'tx_max_num_spatial_streams' and
>> 'tx_unequal_modulation' fields are off-by-one.
>
>> - tx_max_num_spatial_streams = (mcs[12] | ((1 << 3) | (1 << 4))) + 1;
>> - tx_unequal_modulation = !!(mcs[12] & (1 << 5));
>> + tx_max_num_spatial_streams = (mcs[12] & ((1 << 2) | (1 << 3))) + 1;
>> + tx_unequal_modulation = !!(mcs[12] & (1 << 4));
>
> Are you sure? The "Supported MCS Set" field is defined as a series of
> _bits_, and the bits are transmitted the other way around within each
> byte.
Yes, I'm sure. Here are the relevant definitions from <linux/ieee80211.h>:
#define IEEE80211_HT_MCS_TX_DEFINED 0x01
#define IEEE80211_HT_MCS_TX_RX_DIFF 0x02
/* value 0 == 1 stream etc */
#define IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK 0x0C
#define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT 2
#define IEEE80211_HT_MCS_TX_MAX_STREAMS 4
#define IEEE80211_HT_MCS_TX_UNEQUAL_MODULATION 0x10
Gabor
^ permalink raw reply
* Re: [PATCH] CRDA and cross-compilation
From: Philip A. Prindeville @ 2009-08-11 5:52 UTC (permalink / raw)
To: Pavel Roskin; +Cc: Luis R. Rodriguez, Jon Loeliger, wireless
In-Reply-To: <1249950344.14653.51.camel@mj>
Pavel Roskin wrote:
> On Mon, 2009-08-10 at 16:55 -0700, Philip A. Prindeville wrote:
>
>> You're right: that comment was much more helpful... does it apply to the first file or the second or both?
>>
>> And what in particular is a mess?
>
> Cross compilation is not easy. That's why there are such
> "metadistros" (for the lack of a better word) as buildroot and
> openembedded. They have special entries for every package that specify
> how to cross-compile it. There are patches for many sources, although
> it's better to have such files applied to the upstream sources. But
> it's inevitable that the build is influenced in some way to
> cross-compile, often by specifying variables on the make command line.
>
> I believe the developers of buildroot and openembedded would be able to
> deal with CRDA as is. If they find something that could be improved,
> they can send a patch, but I don't think they will bother to change so
> many things as your patch does.
>
> Besides, it's one thing to follow sane rules that simplify
> cross-compilation, such as providing the fourth argument to
> AC_RUN_IFELSE in configure.ac or not using uname to determine the target
> architecture. It's another thing to support cross-compilation in a way
> unique to the package. The gain is miniscule, and the potential for
> breaking is substantial.
>
> Most importantly, you are wasting time of people who could be doing
> something they are better at, such as development of wireless drivers.
>
> There is no point in pushing the same patch over and over again, just
> because you wrote it. Please try to accept the fact that it's not
> useful for others. Maybe it was useful for you as an exercise. But now
> you are not helping. Please move on and do something else.
Pavel,
Consider the code in the form of the latest submission. The conditional-compilation path *is* necessary.
Here's why.
Consider that at some point someone decides to spruce up the functionality of CRDA, perhaps by adding internationalization/NLS (just to pick an example)... and adds code for GETTEXT or some other library.
Then they decide that it isn't optional, it's a requirement.
Currently to make things build, I'd have to call:
make -C crda USE_OPENSSL=1 NL1FOUND=Y NLLIBNAME=libnl-1 NLLIBS=-lnl-1 ...
just to get it to compile successfully.
Then someone has the brilliant idea above (of adding new functionality, and making it mandatory), and adds a corresponding bit of code like:
ifeq ($(NLLIBNAME),)
$(error Cannot find development files for any supported version of libnl)
endif
to do the equivalent functionality. Bingo. The cross-compilation would break, and I'd have to come back and stare at the makefile and add to an ever increasing list of variables that had to be passed in.
But that's not even the worst of it.
NL1FOUND is an internal variable! It's used as a temporary for some transient state in the makefile... It shouldn't even be externally visible, ditto for NLLIBNAME. Yet if I don't pass this variable in, the make dies with the above $(error ...) message.
And you're telling me that my patch is a glory mess?
Not hardly.
At least my proposed fix compartmentalizes the auto-configuration bits from the list of external state that needs to be passed in, so it's quickly apparent which is which.
-Philip
^ permalink raw reply
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
From: david woo @ 2009-08-11 11:47 UTC (permalink / raw)
To: Johannes Berg
Cc: javier@cozybit.com, linux-wireless@vger.kernel.org,
andrey@cozybit.com, linville@tuxdriver.com,
devel@lists.open80211s.org
In-Reply-To: <1249987806.5705.0.camel@johannes.local>
[-- Attachment #1: Type: text/plain, Size: 2745 bytes --]
Johannes Berg 写道:
> On Tue, 2009-08-11 at 18:22 +0800, David Woo wrote:
>> static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>> struct ieee80211_mgmt *mgmt,
>> - u8 *preq_elem, u32 metric)
>> -{
>> + u8 *preq_elem, u32 metric) {
>
> And other than adding this coding style mistake, what does this patch
> do?
>
> johannes
It's my first time to submit the patch file, I just mean to submit the attched
patch file.
[PATCH] mac80211: Fix preq frame process and peer link frame baselen.
This patch is just to fix rreq reply condition, and peer link confirm frame baselen.
Signed-off-by: David Woo <xinhua_wu@realsil.com.cn>
---
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index e1a763e..c065854 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -397,7 +397,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt,
- u8 *preq_elem, u32 metric) {
+ u8 *preq_elem, u32 metric)
+{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
struct mesh_path *mpath;
u8 *dst_addr, *orig_addr;
@@ -430,7 +431,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
if ((!(mpath->flags & MESH_PATH_DSN_VALID)) ||
DSN_LT(mpath->dsn, dst_dsn)) {
mpath->dsn = dst_dsn;
- mpath->flags &= MESH_PATH_DSN_VALID;
+ mpath->flags |= MESH_PATH_DSN_VALID;
} else if ((!(dst_flags & MP_F_DO)) &&
(mpath->flags & MESH_PATH_ACTIVE)) {
reply = true;
@@ -447,14 +448,15 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
if (reply) {
lifetime = PREQ_IE_LIFETIME(preq_elem);
- ttl = ifmsh->mshcfg.dot11MeshTTL;
- if (ttl != 0)
+ ttl = PREQ_IE_TTL(preq_elem);
+ if (ttl != 0) {
+ ttl = ifmsh->mshcfg.dot11MeshTTL;
mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr,
cpu_to_le32(dst_dsn), 0, orig_addr,
cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl,
cpu_to_le32(lifetime), cpu_to_le32(metric),
0, sdata);
- else
+ } else
ifmsh->mshstats.dropped_frames_ttl++;
}
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index cb14253..ffcbad7 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -409,7 +409,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt;
if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) {
baseaddr += 4;
- baselen -= 4;
+ baselen += 4;
}
ieee802_11_parse_elems(baseaddr, len - baselen, &elems);
if (!elems.peer_link) {
David
[-- Attachment #2: mesh.patch --]
[-- Type: text/x-patch, Size: 2053 bytes --]
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index e1a763e..c065854 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -397,7 +397,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt,
- u8 *preq_elem, u32 metric) {
+ u8 *preq_elem, u32 metric)
+{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
struct mesh_path *mpath;
u8 *dst_addr, *orig_addr;
@@ -430,7 +431,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
if ((!(mpath->flags & MESH_PATH_DSN_VALID)) ||
DSN_LT(mpath->dsn, dst_dsn)) {
mpath->dsn = dst_dsn;
- mpath->flags &= MESH_PATH_DSN_VALID;
+ mpath->flags |= MESH_PATH_DSN_VALID;
} else if ((!(dst_flags & MP_F_DO)) &&
(mpath->flags & MESH_PATH_ACTIVE)) {
reply = true;
@@ -447,14 +448,15 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
if (reply) {
lifetime = PREQ_IE_LIFETIME(preq_elem);
- ttl = ifmsh->mshcfg.dot11MeshTTL;
- if (ttl != 0)
+ ttl = PREQ_IE_TTL(preq_elem);
+ if (ttl != 0) {
+ ttl = ifmsh->mshcfg.dot11MeshTTL;
mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr,
cpu_to_le32(dst_dsn), 0, orig_addr,
cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl,
cpu_to_le32(lifetime), cpu_to_le32(metric),
0, sdata);
- else
+ } else
ifmsh->mshstats.dropped_frames_ttl++;
}
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index cb14253..ffcbad7 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -409,7 +409,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt;
if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) {
baseaddr += 4;
- baselen -= 4;
+ baselen += 4;
}
ieee802_11_parse_elems(baseaddr, len - baselen, &elems);
if (!elems.peer_link) {
^ permalink raw reply related
* diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
From: David Woo @ 2009-08-11 10:22 UTC (permalink / raw)
To: javier; +Cc: linux-wireless, andrey, johannes, linville, devel
static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt,
- u8 *preq_elem, u32 metric)
-{
+ u8 *preq_elem, u32 metric) {
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
struct mesh_path *mpath;
u8 *dst_addr, *orig_addr;
@@ -431,7 +430,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
if ((!(mpath->flags & MESH_PATH_DSN_VALID)) ||
DSN_LT(mpath->dsn, dst_dsn)) {
mpath->dsn = dst_dsn;
- mpath->flags |= MESH_PATH_DSN_VALID;
+ mpath->flags &= MESH_PATH_DSN_VALID;
} else if ((!(dst_flags & MP_F_DO)) &&
(mpath->flags & MESH_PATH_ACTIVE)) {
reply = true;
@@ -448,15 +447,14 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
if (reply) {
lifetime = PREQ_IE_LIFETIME(preq_elem);
- ttl = PREQ_IE_TTL(preq_elem);
- if (ttl != 0) {
- ttl = ifmsh->mshcfg.dot11MeshTTL;
+ ttl = ifmsh->mshcfg.dot11MeshTTL;
+ if (ttl != 0)
mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr,
cpu_to_le32(dst_dsn), 0, orig_addr,
cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl,
cpu_to_le32(lifetime), cpu_to_le32(metric),
0, sdata);
- } else
+ else
ifmsh->mshstats.dropped_frames_ttl++;
}
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index ffcbad7..cb14253 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -409,7 +409,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt;
if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) {
baseaddr += 4;
- baselen += 4;
+ baselen -= 4;
}
ieee802_11_parse_elems(baseaddr, len - baselen, &elems);
if (!elems.peer_link) {
^ permalink raw reply related
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
From: Johannes Berg @ 2009-08-11 10:50 UTC (permalink / raw)
To: David Woo; +Cc: javier, linux-wireless, andrey, linville, devel
In-Reply-To: <1249986145-6531-1-git-send-email-xinhua_wu@realsil.com.cn>
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
On Tue, 2009-08-11 at 18:22 +0800, David Woo wrote:
> static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
> struct ieee80211_mgmt *mgmt,
> - u8 *preq_elem, u32 metric)
> -{
> + u8 *preq_elem, u32 metric) {
And other than adding this coding style mistake, what does this patch
do?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] iw: fix typos in MCS set parsing code
From: Johannes Berg @ 2009-08-11 6:54 UTC (permalink / raw)
To: Gabor Juhos; +Cc: linux-wireless@vger.kernel.org, Luis R. Rodriguez
In-Reply-To: <1249973250-9235-1-git-send-email-juhosg@openwrt.org>
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
On Tue, 2009-08-11 at 08:47 +0200, Gabor Juhos wrote:
> The current code uses wrong binary operator for masking,
> and the shift values for the 'tx_max_num_spatial_streams' and
> 'tx_unequal_modulation' fields are off-by-one.
> - tx_max_num_spatial_streams = (mcs[12] | ((1 << 3) | (1 << 4))) + 1;
> - tx_unequal_modulation = !!(mcs[12] & (1 << 5));
> + tx_max_num_spatial_streams = (mcs[12] & ((1 << 2) | (1 << 3))) + 1;
> + tx_unequal_modulation = !!(mcs[12] & (1 << 4));
Are you sure? The "Supported MCS Set" field is defined as a series of
_bits_, and the bits are transmitted the other way around within each
byte.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox