Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: use oneshot blink API for LED triggers
From: Fabio Baltieri @ 2013-07-25 10:00 UTC (permalink / raw)
  To: Johannes Berg
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel,
	Fabio Baltieri

Change mac80211 LED trigger code to use the generic
led_trigger_blink_oneshot() API for transmit and receive activity
indication.

This gives a better feedback to the user, as with the new API each
activity event results in a visible blink, while a constant traffic
results in a continuous blink at constant rate.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
---

Changes from v1:
- fixed some wrong indentations

 net/mac80211/ieee80211_i.h |  1 -
 net/mac80211/led.c         | 19 +++++++------------
 net/mac80211/led.h         |  2 +-
 net/mac80211/status.c      |  2 +-
 net/mac80211/tx.c          |  1 -
 5 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8412a30..1178139 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1063,7 +1063,6 @@ struct ieee80211_local {
 	u32 dot11TransmittedFrameCount;
 
 #ifdef CONFIG_MAC80211_LEDS
-	int tx_led_counter, rx_led_counter;
 	struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
 	struct tpt_led_trigger *tpt_led_trigger;
 	char tx_led_name[32], rx_led_name[32],
diff --git a/net/mac80211/led.c b/net/mac80211/led.c
index bcffa69..e2b8364 100644
--- a/net/mac80211/led.c
+++ b/net/mac80211/led.c
@@ -12,27 +12,22 @@
 #include <linux/export.h>
 #include "led.h"
 
+#define MAC80211_BLINK_DELAY 50 /* ms */
+
 void ieee80211_led_rx(struct ieee80211_local *local)
 {
+	unsigned long led_delay = MAC80211_BLINK_DELAY;
 	if (unlikely(!local->rx_led))
 		return;
-	if (local->rx_led_counter++ % 2 == 0)
-		led_trigger_event(local->rx_led, LED_OFF);
-	else
-		led_trigger_event(local->rx_led, LED_FULL);
+	led_trigger_blink_oneshot(local->rx_led, &led_delay, &led_delay, 0);
 }
 
-/* q is 1 if a packet was enqueued, 0 if it has been transmitted */
-void ieee80211_led_tx(struct ieee80211_local *local, int q)
+void ieee80211_led_tx(struct ieee80211_local *local)
 {
+	unsigned long led_delay = MAC80211_BLINK_DELAY;
 	if (unlikely(!local->tx_led))
 		return;
-	/* not sure how this is supposed to work ... */
-	local->tx_led_counter += 2*q-1;
-	if (local->tx_led_counter % 2 == 0)
-		led_trigger_event(local->tx_led, LED_OFF);
-	else
-		led_trigger_event(local->tx_led, LED_FULL);
+	led_trigger_blink_oneshot(local->tx_led, &led_delay, &led_delay, 0);
 }
 
 void ieee80211_led_assoc(struct ieee80211_local *local, bool associated)
diff --git a/net/mac80211/led.h b/net/mac80211/led.h
index e0275d9..6ca2f29 100644
--- a/net/mac80211/led.h
+++ b/net/mac80211/led.h
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_MAC80211_LEDS
 void ieee80211_led_rx(struct ieee80211_local *local);
-void ieee80211_led_tx(struct ieee80211_local *local, int q);
+void ieee80211_led_tx(struct ieee80211_local *local);
 void ieee80211_led_assoc(struct ieee80211_local *local,
 			 bool associated);
 void ieee80211_led_radio(struct ieee80211_local *local,
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 4343920..e3c889b 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -557,7 +557,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 
 	rcu_read_unlock();
 
-	ieee80211_led_tx(local, 0);
+	ieee80211_led_tx(local);
 
 	/* SNMP counters
 	 * Fragments are passed to low-level drivers as separate skbs, so these
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4105d0c..6c4e60d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1281,7 +1281,6 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
 				    txpending);
 
 	ieee80211_tpt_led_trig_tx(local, fc, led_len);
-	ieee80211_led_tx(local, 1);
 
 	WARN_ON_ONCE(!skb_queue_empty(skbs));
 
-- 
1.8.2


^ permalink raw reply related

* Re: [PATCH] mac80211: use oneshot blink API for LED triggers
From: Fabio Baltieri @ 2013-07-25  9:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <1374739101.8827.7.camel@jlt4.sipsolutions.net>

On Thu, Jul 25, 2013 at 09:58:21AM +0200, Johannes Berg wrote:
> > So, are you definitely rejecting this patch or should I fix indentation
> > and send a v2?
> 
> I think I'll take it, I kinda hope nobody will really care much about it
> but the behaviour looks better and the code is simpler, so ... :)

Good enough...  I'll send the v2 then. :-)

Thanks,
Fabio

-- 
Fabio Baltieri

^ permalink raw reply

* Re: [PATCH] mac80211: use oneshot blink API for LED triggers
From: Johannes Berg @ 2013-07-25  7:58 UTC (permalink / raw)
  To: Fabio Baltieri; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <20130724085337.GA7096@balto.lan>

On Wed, 2013-07-24 at 10:53 +0200, Fabio Baltieri wrote:
> On Wed, Jul 24, 2013 at 10:14:25AM +0200, Johannes Berg wrote:
> > On Wed, 2013-07-24 at 02:09 +0200, Fabio Baltieri wrote:
> > > Changes mac80211 LED trigger code to use the generic
> > > led_trigger_blink_oneshot() API for transmit and receive activity
> > > indication.
> > > 
> > > This gives a better feedback to the user, as with the new API each
> > > activity event results in a visible blink, while a constant traffic
> > > results in a continuous blink at constant rate.
> > 
> > This seems a little pointless since our throughput-based trigger can do
> > very similar (but somewhat better) behaviour? Maybe that should just be
> > the default instead, with some sane default setup values?
> 
> Ok but that requires driver specific support and it's only implemented
> on a subset of currently available drivers.

Not necessarily, it's just done that way because we expected everyone to
have their own idea of what the blink speeds should be, possibly even
depending on the maximum speed the hardware can do etc.

> This at least makes the basic tx/rx indication capability a better.

Fair enough.

> > (Regardless of that, you also have indentation problems in your patch)
> 
> Ok, I guess you are referring to the this:
> 
> +       led_trigger_blink_oneshot(local->tx_led,                                
> +                       &led_delay, &led_delay, 0);                             

Yes, that was the place I noticed, didn't check more closely.

> So, are you definitely rejecting this patch or should I fix indentation
> and send a v2?

I think I'll take it, I kinda hope nobody will really care much about it
but the behaviour looks better and the code is simpler, so ... :)

johannes


^ permalink raw reply

* Re: [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register
From: Johannes Berg @ 2013-07-25  7:53 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1374413809-26005-1-git-send-email-arik@wizery.com>

On Sun, 2013-07-21 at 16:36 +0300, Arik Nemtsov wrote:
> The current regdomain was not always set by the core. This causes
> cards with a custom regulatory domain to ignore user initiated changes
> if done before the card was registered.

Applied, thanks.

johannes


^ permalink raw reply

* Re: [PATCH 33/36] net: rfkill: convert class code to use dev_groups
From: Johannes Berg @ 2013-07-25  7:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, John W. Linville, linux-wireless, netdev
In-Reply-To: <1374703539-9705-34-git-send-email-gregkh@linuxfoundation.org>

On Wed, 2013-07-24 at 15:05 -0700, Greg Kroah-Hartman wrote:
> The dev_attrs field of struct class is going away soon, dev_groups
> should be used instead.  This converts the rfkill class code to use the
> correct field.
> 
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: John W. Linville <linville@tuxdriver.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> 
> Johnannes, feel free to take this through your tree, or ACK it and I can
> take it through mine.

Looks good to me, go ahead and take it, we're not going to modify this
code.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

johannes


^ permalink raw reply

* Re: [PATCH 32/36] net: wireless: convert class code to use dev_groups
From: Johannes Berg @ 2013-07-25  7:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, John W. Linville, linux-wireless, netdev
In-Reply-To: <1374703539-9705-33-git-send-email-gregkh@linuxfoundation.org>

On Wed, 2013-07-24 at 15:05 -0700, Greg Kroah-Hartman wrote:
> The dev_attrs field of struct class is going away soon, dev_groups
> should be used instead.  This converts the networking wireless class
> code to use the correct field.
> 
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: John W. Linville <linville@tuxdriver.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> 
> John, feel free to take this through your tree, or ACK it and I can take
> it through mine.

It's cfg80211 so it should be me, but I don't expect any conflicts so
please take it.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

johannes


^ permalink raw reply

* Re: pull request: wireless 2013-07-24
From: David Miller @ 2013-07-25  7:07 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20130724180400.GF2385@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 24 Jul 2013 14:04:01 -0400

> This is another batch of fixes intended for the 3.11 stream.  FWIW,
> this is the first request with fixes from the mac80211 and iwlwifi
> trees as well.

Pulled, thanks John.


^ permalink raw reply

* [PATCH 33/36] net: rfkill: convert class code to use dev_groups
From: Greg Kroah-Hartman @ 2013-07-24 22:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Johannes Berg, John W. Linville,
	linux-wireless, netdev
In-Reply-To: <1374703539-9705-1-git-send-email-gregkh@linuxfoundation.org>

The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the rfkill class code to use the
correct field.

Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

Johnannes, feel free to take this through your tree, or ACK it and I can
take it through mine.

 net/rfkill/core.c | 90 +++++++++++++++++++++++++------------------------------
 1 file changed, 41 insertions(+), 49 deletions(-)

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 1cec5e4f..1bacc107 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -576,14 +576,14 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
 }
 EXPORT_SYMBOL(rfkill_set_states);
 
-static ssize_t rfkill_name_show(struct device *dev,
-				struct device_attribute *attr,
-				char *buf)
+static ssize_t name_show(struct device *dev, struct device_attribute *attr,
+			 char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%s\n", rfkill->name);
 }
+static DEVICE_ATTR_RO(name);
 
 static const char *rfkill_get_type_str(enum rfkill_type type)
 {
@@ -611,54 +611,52 @@ static const char *rfkill_get_type_str(enum rfkill_type type)
 	}
 }
 
-static ssize_t rfkill_type_show(struct device *dev,
-				struct device_attribute *attr,
-				char *buf)
+static ssize_t type_show(struct device *dev, struct device_attribute *attr,
+			 char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%s\n", rfkill_get_type_str(rfkill->type));
 }
+static DEVICE_ATTR_RO(type);
 
-static ssize_t rfkill_idx_show(struct device *dev,
-			       struct device_attribute *attr,
-			       char *buf)
+static ssize_t index_show(struct device *dev, struct device_attribute *attr,
+			  char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%d\n", rfkill->idx);
 }
+static DEVICE_ATTR_RO(index);
 
-static ssize_t rfkill_persistent_show(struct device *dev,
-			       struct device_attribute *attr,
-			       char *buf)
+static ssize_t persistent_show(struct device *dev,
+			       struct device_attribute *attr, char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%d\n", rfkill->persistent);
 }
+static DEVICE_ATTR_RO(persistent);
 
-static ssize_t rfkill_hard_show(struct device *dev,
-				 struct device_attribute *attr,
-				 char *buf)
+static ssize_t hard_show(struct device *dev, struct device_attribute *attr,
+			 char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 );
 }
+static DEVICE_ATTR_RO(hard);
 
-static ssize_t rfkill_soft_show(struct device *dev,
-				 struct device_attribute *attr,
-				 char *buf)
+static ssize_t soft_show(struct device *dev, struct device_attribute *attr,
+			 char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0 );
 }
 
-static ssize_t rfkill_soft_store(struct device *dev,
-				  struct device_attribute *attr,
-				  const char *buf, size_t count)
+static ssize_t soft_store(struct device *dev, struct device_attribute *attr,
+			  const char *buf, size_t count)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 	unsigned long state;
@@ -680,6 +678,7 @@ static ssize_t rfkill_soft_store(struct device *dev,
 
 	return count;
 }
+static DEVICE_ATTR_RW(soft);
 
 static u8 user_state_from_blocked(unsigned long state)
 {
@@ -691,18 +690,16 @@ static u8 user_state_from_blocked(unsigned long state)
 	return RFKILL_USER_STATE_UNBLOCKED;
 }
 
-static ssize_t rfkill_state_show(struct device *dev,
-				 struct device_attribute *attr,
-				 char *buf)
+static ssize_t state_show(struct device *dev, struct device_attribute *attr,
+			  char *buf)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
 	return sprintf(buf, "%d\n", user_state_from_blocked(rfkill->state));
 }
 
-static ssize_t rfkill_state_store(struct device *dev,
-				  struct device_attribute *attr,
-				  const char *buf, size_t count)
+static ssize_t state_store(struct device *dev, struct device_attribute *attr,
+			   const char *buf, size_t count)
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 	unsigned long state;
@@ -725,32 +722,27 @@ static ssize_t rfkill_state_store(struct device *dev,
 
 	return count;
 }
+static DEVICE_ATTR_RW(state);
 
-static ssize_t rfkill_claim_show(struct device *dev,
-				 struct device_attribute *attr,
-				 char *buf)
+static ssize_t claim_show(struct device *dev, struct device_attribute *attr,
+			  char *buf)
 {
 	return sprintf(buf, "%d\n", 0);
 }
-
-static ssize_t rfkill_claim_store(struct device *dev,
-				  struct device_attribute *attr,
-				  const char *buf, size_t count)
-{
-	return -EOPNOTSUPP;
-}
-
-static struct device_attribute rfkill_dev_attrs[] = {
-	__ATTR(name, S_IRUGO, rfkill_name_show, NULL),
-	__ATTR(type, S_IRUGO, rfkill_type_show, NULL),
-	__ATTR(index, S_IRUGO, rfkill_idx_show, NULL),
-	__ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL),
-	__ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store),
-	__ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store),
-	__ATTR(soft, S_IRUGO|S_IWUSR, rfkill_soft_show, rfkill_soft_store),
-	__ATTR(hard, S_IRUGO, rfkill_hard_show, NULL),
-	__ATTR_NULL
+static DEVICE_ATTR_RO(claim);
+
+static struct attribute *rfkill_dev_attrs[] = {
+	&dev_attr_name.attr,
+	&dev_attr_type.attr,
+	&dev_attr_index.attr,
+	&dev_attr_persistent.attr,
+	&dev_attr_state.attr,
+	&dev_attr_claim.attr,
+	&dev_attr_soft.attr,
+	&dev_attr_hard.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(rfkill_dev);
 
 static void rfkill_release(struct device *dev)
 {
@@ -830,7 +822,7 @@ static int rfkill_resume(struct device *dev)
 static struct class rfkill_class = {
 	.name		= "rfkill",
 	.dev_release	= rfkill_release,
-	.dev_attrs	= rfkill_dev_attrs,
+	.dev_groups	= rfkill_dev_groups,
 	.dev_uevent	= rfkill_dev_uevent,
 	.suspend	= rfkill_suspend,
 	.resume		= rfkill_resume,
-- 
1.8.3.rc0.20.gb99dd2e


^ permalink raw reply related

* [PATCH 32/36] net: wireless: convert class code to use dev_groups
From: Greg Kroah-Hartman @ 2013-07-24 22:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Johannes Berg, John W. Linville,
	linux-wireless, netdev
In-Reply-To: <1374703539-9705-1-git-send-email-gregkh@linuxfoundation.org>

The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the networking wireless class
code to use the correct field.

Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

John, feel free to take this through your tree, or ACK it and I can take
it through mine.

 net/wireless/sysfs.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
index a23253e0..9ee6bc1a 100644
--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -30,7 +30,8 @@ static ssize_t name ## _show(struct device *dev,			\
 			      char *buf)				\
 {									\
 	return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member);	\
-}
+}									\
+static DEVICE_ATTR_RO(name)
 
 SHOW_FMT(index, "%d", wiphy_idx);
 SHOW_FMT(macaddress, "%pM", wiphy.perm_addr);
@@ -42,7 +43,7 @@ static ssize_t name_show(struct device *dev,
 	struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy;
 	return sprintf(buf, "%s\n", dev_name(&wiphy->dev));
 }
-
+static DEVICE_ATTR_RO(name);
 
 static ssize_t addresses_show(struct device *dev,
 			      struct device_attribute *attr,
@@ -60,15 +61,17 @@ static ssize_t addresses_show(struct device *dev,
 
 	return buf - start;
 }
-
-static struct device_attribute ieee80211_dev_attrs[] = {
-	__ATTR_RO(index),
-	__ATTR_RO(macaddress),
-	__ATTR_RO(address_mask),
-	__ATTR_RO(addresses),
-	__ATTR_RO(name),
-	{}
+static DEVICE_ATTR_RO(addresses);
+
+static struct attribute *ieee80211_attrs[] = {
+	&dev_attr_index.attr,
+	&dev_attr_macaddress.attr,
+	&dev_attr_address_mask.attr,
+	&dev_attr_addresses.attr,
+	&dev_attr_name.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(ieee80211);
 
 static void wiphy_dev_release(struct device *dev)
 {
@@ -146,7 +149,7 @@ struct class ieee80211_class = {
 	.name = "ieee80211",
 	.owner = THIS_MODULE,
 	.dev_release = wiphy_dev_release,
-	.dev_attrs = ieee80211_dev_attrs,
+	.dev_groups = ieee80211_groups,
 	.dev_uevent = wiphy_uevent,
 #ifdef CONFIG_PM
 	.suspend = wiphy_suspend,
-- 
1.8.3.rc0.20.gb99dd2e


^ permalink raw reply related

* Re: interested in py80211?
From: Arend van Spriel @ 2013-07-24 21:06 UTC (permalink / raw)
  To: Will Hawkins; +Cc: Johannes Berg, linux-wireless, Thomas Graf
In-Reply-To: <51EFF8FC.8070101@opentechinstitute.org>

On 07/24/2013 05:55 PM, Will Hawkins wrote:
> Thanks for posting about this effort. I would be very interested in
> helping out on development. I will stay up-to-date on things via your
> github page. Otherwise, please continue to keep the list updated on your
> progress.


Thanks, Will

Based on feedback from Johannes I have taken a bit different approach. I 
submitted some patches to libnl adding the SWIG api for python there. 
Thomas took those patches recently. So the idea is to do the rest of the 
nl80211 specific stuff in Python. I am looking into pycparser as I would 
like to extract certain code fragments from nl80211.[ch] so keeping 
py80211 in sync with nl80211 can be automated.


Regards,
Arend

> On 07/12/2013 09:32 AM, Arend van Spriel wrote:
>> On 07/12/13 10:02, Johannes Berg wrote:
>>> Yep, I'd totally be interested. Not that I don't have enough things on
>>> my plate already ;-)
>>>
>>> On Wed, 2013-07-03 at 22:57 +0200, Arend van Spriel wrote:
>>>> A common say in Linux arena is "when you have an itch, just scratch it".
>>>
>>> :-)
>>>
>>>> My itch is that tools like ifconfig and iw are great, but in an
>>>> automated test environment it kind of sucks to parse output, which is
>>>> confirmed by blurb from iw: "Do NOT screenscrape this tool, we don't
>>>> consider its output stable.".
>>>
>>> Heh, yeah ...
>>>
>>>> Ever since my first contact with Python I tend to favor it over other
>>>> scripting alternatives so I decided to scratch my itch with that and
>>>> another old acquaintance called SWIG. With those I went to create
>>>> py80211. A first attempt was to have SWIG create a wrapper API directly
>>>> exposing the libnl-3 API, but that did not feel comfortable in a
>>>> scripting environment. So the level of abstraction is a bit higher. It
>>>> is just in a kick-off state (eg. can only send u32 attributes), but I
>>>> decided to push it to github anyway.
>>>
>>> Another approach might be exposing the libnl APIs and then build a
>>> higher-level library in python. Have you considered that? That might
>>> make it useful to other users of netlink as well, while keeping a 'nice'
>>> nl80211 API?
>>
>> I am still at that fork in the road and not sure about it. The libnl
>> project itself already has libnl stuff exposed in a python lib being the
>> core api and route. So I could go and add genl support to that and build
>> the high-level python library from there.
>>
>> Regards,
>> Arend
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-wireless" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>



^ permalink raw reply

* Re: IBSS-RSN support for BCM4313
From: Arend van Spriel @ 2013-07-24 20:57 UTC (permalink / raw)
  To: Jordan McCarthy; +Cc: linux-wireless
In-Reply-To: <51EFC944.40502@opentechinstitute.org>

On 07/24/2013 02:32 PM, Jordan McCarthy wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Linux wireless folk,
> 	I am a developer at a non-profit working on a wireless mesh networking
> platform, and we've just discovered that we have a fleet of netbooks
> with the Broadcom 4313 chipset, one that does not work particularly well
> (and sometimes not at all) in ad-hoc mode.

For certain variants of that chipset the brcmsmac driver does not 
perform well regardless the mode it is in. So could you provide some 
more details on the bcm4313 chipset. Can you provide contents from 
/sys/kernel/debug/brcmsmac/bcma*/hardware (if that is the correct path).

Regards,
Arend


^ permalink raw reply

* Lowest Supported Rate for Unicast Management Frame
From: Chun-Yeow Yeoh @ 2013-07-24 19:36 UTC (permalink / raw)
  To: linux-wireless

Hi, all

Just would like know is there any reason of having the unicast
management frame sent at lowest supported rate for the STA even if we
set the basic rate which could be higher than the lowest supported
rate for the STA.

-----
Chun-Yeow

^ permalink raw reply

* Re: [PATCH 18/21] mwifiex: handle driver initialization error paths
From: John W. Linville @ 2013-07-24 19:02 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar, Avinash Patil,
	Yogesh Powar, Nishant Sarmukadam, Frank Huang
In-Reply-To: <477F20668A386D41ADCC57781B1F70430EA311794C@SC-VEXCH1.marvell.com>

On Wed, Jul 24, 2013 at 11:48:25AM -0700, Bing Zhao wrote:
> Hi John,
> 
> > This one didn't apply on the current wireless-next tree.  Can you
> > fix it up?
> 
> 18/21 and 19/21 depend on this patch:
> 
> commit 232fde062e0a2cc52e8e18a50cda361b4ba88f34
> Author: Daniel Drake <dsd@laptop.org>
> Date:   Sat Jul 13 10:57:10 2013 -0400
> 
>     mwifiex: fix IRQ enable/disable
> 
> which is in wireless.git and wireless-testing.git currently.
> 
> 
> We can apply 18 and 19 later after commit 232fde0 is merged back to wireless-next.git.
> (I will send you a reminder to merge these two patches once commit 232fde0 is in -next tree.)
> 
> Thanks,
> Bing

OK, thanks for checking!

-- 
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 18/21] mwifiex: handle driver initialization error paths
From: Bing Zhao @ 2013-07-24 18:48 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar, Avinash Patil,
	Yogesh Powar, Nishant Sarmukadam, Frank Huang
In-Reply-To: <20130724151651.GD2385@tuxdriver.com>

Hi John,

> This one didn't apply on the current wireless-next tree.  Can you
> fix it up?

18/21 and 19/21 depend on this patch:

commit 232fde062e0a2cc52e8e18a50cda361b4ba88f34
Author: Daniel Drake <dsd@laptop.org>
Date:   Sat Jul 13 10:57:10 2013 -0400

    mwifiex: fix IRQ enable/disable

which is in wireless.git and wireless-testing.git currently.


We can apply 18 and 19 later after commit 232fde0 is merged back to wireless-next.git.
(I will send you a reminder to merge these two patches once commit 232fde0 is in -next tree.)

Thanks,
Bing


^ permalink raw reply

* pull request: wireless 2013-07-24
From: John W. Linville @ 2013-07-24 18:04 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 33567 bytes --]

Dave,

This is another batch of fixes intended for the 3.11 stream.  FWIW,
this is the first request with fixes from the mac80211 and iwlwifi
trees as well.

Regarding the mac80211 bits, Johannes says:

"Here I have a fix for RSSI thresholds in mesh, two minstrel fixes from
Felix, an nl80211 fix from Michal and four various fixes I did myself."

As for the iwlwifi bits, Johannes says:

"Here I have a fix for debugfs directory creation (causing a spurious
error message), two scanning fixes from David Spinadel, an LED fix and
two patches related to a BA session problem that eventually caused
firmware crashes from Emmanuel and a small BT fix for older devices as
well as a workaround for a firmware problem with APs with very small
beacon intervals from myself."

Along with those:

Arend van Spriel addresses a lock-up and a NULL pointer dereference
in brcmfmac.

Daniel Drake fixes an unhandled interrupt during device tear down
in mwifiex.

Larry Finger corrects a wil6210 build error.

Oleksij Rempel fixes two ath9k_htc problems related to keeping the
driver and firmware in sync.

Solomon Peachy gives us a cw1200 fix to avoid an oops in monitor mode.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit f8c0aca9fda7856a8a8d61d523ba3187affbd714:

  fec: Add MODULE_ALIAS (2013-07-23 17:23:16 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git for-davem

for you to fetch changes up to 18e1ccb6ca35f995006749d20d9bd6ef40d736fd:

  Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem (2013-07-24 11:50:38 -0400)

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

Alexander Bondar (1):
      iwlwifi: mvm: Fix VIF specific debugfs directory creation

Arend van Spriel (2):
      brcmfmac: decrement pending 8021x count upon tx failure
      brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface

Chun-Yeow Yeoh (1):
      nl80211: fix the setting of RSSI threshold value for mesh

Daniel Drake (1):
      mwifiex: fix IRQ enable/disable

David Spinadel (2):
      iwlwifi: mvm: fix bug in scan ssid
      iwlwifi: mvm: remove extra SSID from probe request

Emmanuel Grumbach (3):
      iwlwifi: mvm: unregister leds when registration failed
      iwlwifi: mvm: fix L2P BA ressources leak
      iwlwifi: mvm: track the number of Rx BA sessions

Felix Fietkau (2):
      mac80211/minstrel_ht: fix cck rate sampling
      mac80211/minstrel: fix NULL pointer dereference issue

Johannes Berg (6):
      cfg80211: fix bugs in new SME implementation
      regulatory: add missing rtnl locking
      mac80211: fix ethtool stats for non-station interfaces
      mac80211: fix duplicate retransmission detection
      iwlwifi: dvm: don't send BT_CONFIG on devices w/o Bluetooth
      iwlwifi: mvm: refuse connection to APs with BI < 16

John W. Linville (3):
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem

Larry Finger (1):
      ath: wil6210: Fix build error

Michal Kazior (1):
      nl80211: fix mgmt tx status and testmode reporting for netns

Oleksij Rempel (2):
      ath9k_htc: do some initial hardware configuration
      ath9k_htc: reboot firmware if it was loaded

Solomon Peachy (1):
      cw1200: Fix OOPS in monitor mode

 drivers/net/wireless/ath/ath9k/hif_usb.c           |  4 +-
 drivers/net/wireless/ath/ath9k/htc_drv_init.c      |  1 +
 drivers/net/wireless/ath/wil6210/debugfs.c         |  4 +-
 .../net/wireless/brcm80211/brcmfmac/dhd_linux.c    |  2 +-
 drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c |  8 +-
 drivers/net/wireless/cw1200/txrx.c                 |  2 +-
 drivers/net/wireless/iwlwifi/dvm/main.c            |  2 +-
 drivers/net/wireless/iwlwifi/mvm/debugfs.c         |  6 +-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c        | 23 +++++-
 drivers/net/wireless/iwlwifi/mvm/mvm.h             |  1 +
 drivers/net/wireless/iwlwifi/mvm/scan.c            | 10 ++-
 drivers/net/wireless/iwlwifi/mvm/sta.c             | 23 +++++-
 drivers/net/wireless/mwifiex/init.c                | 10 +--
 drivers/net/wireless/mwifiex/main.c                | 13 +++-
 drivers/net/wireless/mwifiex/main.h                |  1 +
 drivers/net/wireless/mwifiex/sdio.c                | 91 ++++++++++------------
 drivers/net/wireless/mwifiex/sdio.h                |  3 -
 net/mac80211/cfg.c                                 |  2 +
 net/mac80211/rc80211_minstrel.c                    |  3 +-
 net/mac80211/rc80211_minstrel_ht.c                 | 10 ++-
 net/mac80211/rx.c                                  | 10 ++-
 net/wireless/nl80211.c                             | 11 ++-
 net/wireless/reg.c                                 |  2 +
 net/wireless/sme.c                                 | 29 ++++++-
 24 files changed, 184 insertions(+), 87 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 2469db5..5205a36 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
 
 	usb_set_intfdata(interface, NULL);
 
-	if (!unplugged && (hif_dev->flags & HIF_USB_START))
+	/* If firmware was loaded we should drop it
+	 * go back to first stage bootloader. */
+	if (!unplugged && (hif_dev->flags & HIF_USB_READY))
 		ath9k_hif_usb_reboot(udev);
 
 	kfree(hif_dev);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 71a183f..c3676bf 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -861,6 +861,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv,
 	if (error != 0)
 		goto err_rx;
 
+	ath9k_hw_disable(priv->ah);
 #ifdef CONFIG_MAC80211_LEDS
 	/* must be initialized before ieee80211_register_hw */
 	priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index e8308ec..ab63676 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix,
 				   le16_to_cpu(hdr.type), hdr.flags);
 			if (len <= MAX_MBOXITEM_SIZE) {
 				int n = 0;
-				unsigned char printbuf[16 * 3 + 2];
+				char printbuf[16 * 3 + 2];
 				unsigned char databuf[MAX_MBOXITEM_SIZE];
 				void __iomem *src = wmi_buffer(wil, d.addr) +
 					sizeof(struct wil6210_mbox_hdr);
@@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
 		seq_printf(s, "  SKB = %p\n", skb);
 
 		if (skb) {
-			unsigned char printbuf[16 * 3 + 2];
+			char printbuf[16 * 3 + 2];
 			int i = 0;
 			int len = le16_to_cpu(d->dma.length);
 			void *p = skb->data;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index 8e89755..8009901 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -242,7 +242,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp,
 {
 	unsigned long flags;
 
-	if (!ifp)
+	if (!ifp || !ifp->ndev)
 		return;
 
 	brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n",
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index f0d9f7f..29b1f24 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -1744,13 +1744,14 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
 	ulong flags;
 	int fifo = BRCMF_FWS_FIFO_BCMC;
 	bool multicast = is_multicast_ether_addr(eh->h_dest);
+	bool pae = eh->h_proto == htons(ETH_P_PAE);
 
 	/* determine the priority */
 	if (!skb->priority)
 		skb->priority = cfg80211_classify8021d(skb);
 
 	drvr->tx_multicast += !!multicast;
-	if (ntohs(eh->h_proto) == ETH_P_PAE)
+	if (pae)
 		atomic_inc(&ifp->pend_8021x_cnt);
 
 	if (!brcmf_fws_fc_active(fws)) {
@@ -1781,6 +1782,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
 		brcmf_fws_schedule_deq(fws);
 	} else {
 		brcmf_err("drop skb: no hanger slot\n");
+		if (pae) {
+			atomic_dec(&ifp->pend_8021x_cnt);
+			if (waitqueue_active(&ifp->pend_8021x_wait))
+				wake_up(&ifp->pend_8021x_wait);
+		}
 		brcmu_pkt_buf_free_skb(skb);
 	}
 	brcmf_fws_unlock(drvr, flags);
diff --git a/drivers/net/wireless/cw1200/txrx.c b/drivers/net/wireless/cw1200/txrx.c
index 5862c37..e824d4d 100644
--- a/drivers/net/wireless/cw1200/txrx.c
+++ b/drivers/net/wireless/cw1200/txrx.c
@@ -1165,7 +1165,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
 		if (cw1200_handle_action_rx(priv, skb))
 			return;
 	} else if (ieee80211_is_beacon(frame->frame_control) &&
-		   !arg->status &&
+		   !arg->status && priv->vif &&
 		   !memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid,
 			   ETH_ALEN)) {
 		const u8 *tim_ie;
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 3952ddf..1531a4f 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -758,7 +758,7 @@ int iwl_alive_start(struct iwl_priv *priv)
 					 BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
 		if (ret)
 			return ret;
-	} else {
+	} else if (priv->lib->bt_params) {
 		/*
 		 * default is 2-wire BT coexexistence support
 		 */
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index e56ed2a..c24a744 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -988,7 +988,11 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 	char buf[100];
 
-	if (!dbgfs_dir)
+	/*
+	 * Check if debugfs directory already exist before creating it.
+	 * This may happen when, for example, resetting hw or suspend-resume
+	 */
+	if (!dbgfs_dir || mvmvif->dbgfs_dir)
 		return;
 
 	mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir);
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index e08683b..1eedc42 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -257,7 +257,11 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 	if (ret)
 		return ret;
 
-	return ieee80211_register_hw(mvm->hw);
+	ret = ieee80211_register_hw(mvm->hw);
+	if (ret)
+		iwl_mvm_leds_exit(mvm);
+
+	return ret;
 }
 
 static void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
@@ -385,6 +389,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
 	ieee80211_wake_queues(mvm->hw);
 
 	mvm->vif_count = 0;
+	mvm->rx_ba_sessions = 0;
 }
 
 static int iwl_mvm_mac_start(struct ieee80211_hw *hw)
@@ -1006,6 +1011,21 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 	mutex_lock(&mvm->mutex);
 	if (old_state == IEEE80211_STA_NOTEXIST &&
 	    new_state == IEEE80211_STA_NONE) {
+		/*
+		 * Firmware bug - it'll crash if the beacon interval is less
+		 * than 16. We can't avoid connecting at all, so refuse the
+		 * station state change, this will cause mac80211 to abandon
+		 * attempts to connect to this AP, and eventually wpa_s will
+		 * blacklist the AP...
+		 */
+		if (vif->type == NL80211_IFTYPE_STATION &&
+		    vif->bss_conf.beacon_int < 16) {
+			IWL_ERR(mvm,
+				"AP %pM beacon interval is %d, refusing due to firmware bug!\n",
+				sta->addr, vif->bss_conf.beacon_int);
+			ret = -EINVAL;
+			goto out_unlock;
+		}
 		ret = iwl_mvm_add_sta(mvm, vif, sta);
 	} else if (old_state == IEEE80211_STA_NONE &&
 		   new_state == IEEE80211_STA_AUTH) {
@@ -1038,6 +1058,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 	} else {
 		ret = -EIO;
 	}
+ out_unlock:
 	mutex_unlock(&mvm->mutex);
 
 	return ret;
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index d40d7db..420e82d 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -419,6 +419,7 @@ struct iwl_mvm {
 	struct work_struct sta_drained_wk;
 	unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)];
 	atomic_t pending_frames[IWL_MVM_STATION_COUNT];
+	u8 rx_ba_sessions;
 
 	/* configured by mac80211 */
 	u32 rts_threshold;
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 2157b0f..268f027 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -137,8 +137,8 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd,
 {
 	int fw_idx, req_idx;
 
-	fw_idx = 0;
-	for (req_idx = req->n_ssids - 1; req_idx > 0; req_idx--) {
+	for (req_idx = req->n_ssids - 1, fw_idx = 0; req_idx > 0;
+	     req_idx--, fw_idx++) {
 		cmd->direct_scan[fw_idx].id = WLAN_EID_SSID;
 		cmd->direct_scan[fw_idx].len = req->ssids[req_idx].ssid_len;
 		memcpy(cmd->direct_scan[fw_idx].ssid,
@@ -153,7 +153,9 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd,
  * just to notify that this scan is active and not passive.
  * In order to notify the FW of the number of SSIDs we wish to scan (including
  * the zero-length one), we need to set the corresponding bits in chan->type,
- * one for each SSID, and set the active bit (first).
+ * one for each SSID, and set the active bit (first). The first SSID is already
+ * included in the probe template, so we need to set only req->n_ssids - 1 bits
+ * in addition to the first bit.
  */
 static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids)
 {
@@ -179,7 +181,7 @@ static void iwl_mvm_scan_fill_channels(struct iwl_scan_cmd *cmd,
 	__le32 chan_type_value;
 
 	if (req->n_ssids > 0)
-		chan_type_value = cpu_to_le32(BIT(req->n_ssids + 1) - 1);
+		chan_type_value = cpu_to_le32(BIT(req->n_ssids) - 1);
 	else
 		chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE;
 
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 62fe520..85d4bbe 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -608,6 +608,8 @@ int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *bsta)
 	return ret;
 }
 
+#define IWL_MAX_RX_BA_SESSIONS 16
+
 int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 		       int tid, u16 ssn, bool start)
 {
@@ -618,11 +620,20 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 
 	lockdep_assert_held(&mvm->mutex);
 
+	if (start && mvm->rx_ba_sessions >= IWL_MAX_RX_BA_SESSIONS) {
+		IWL_WARN(mvm, "Not enough RX BA SESSIONS\n");
+		return -ENOSPC;
+	}
+
 	cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color);
 	cmd.sta_id = mvm_sta->sta_id;
 	cmd.add_modify = STA_MODE_MODIFY;
-	cmd.add_immediate_ba_tid = (u8) tid;
-	cmd.add_immediate_ba_ssn = cpu_to_le16(ssn);
+	if (start) {
+		cmd.add_immediate_ba_tid = (u8) tid;
+		cmd.add_immediate_ba_ssn = cpu_to_le16(ssn);
+	} else {
+		cmd.remove_immediate_ba_tid = (u8) tid;
+	}
 	cmd.modify_mask = start ? STA_MODIFY_ADD_BA_TID :
 				  STA_MODIFY_REMOVE_BA_TID;
 
@@ -648,6 +659,14 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 		break;
 	}
 
+	if (!ret) {
+		if (start)
+			mvm->rx_ba_sessions++;
+		else if (mvm->rx_ba_sessions > 0)
+			/* check that restart flow didn't zero the counter */
+			mvm->rx_ba_sessions--;
+	}
+
 	return ret;
 }
 
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index caaf4bd..2cf8b96 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -693,7 +693,7 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
 		if (!ret) {
 			dev_notice(adapter->dev,
 				   "WLAN FW already running! Skip FW dnld\n");
-			goto done;
+			return 0;
 		}
 
 		poll_num = MAX_FIRMWARE_POLL_TRIES;
@@ -719,14 +719,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
 poll_fw:
 	/* Check if the firmware is downloaded successfully or not */
 	ret = adapter->if_ops.check_fw_status(adapter, poll_num);
-	if (ret) {
+	if (ret)
 		dev_err(adapter->dev, "FW failed to be active in time\n");
-		return -1;
-	}
-done:
-	/* re-enable host interrupt for mwifiex after fw dnld is successful */
-	if (adapter->if_ops.enable_int)
-		adapter->if_ops.enable_int(adapter);
 
 	return ret;
 }
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index e15ab72..1753431 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -427,6 +427,10 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
 				"Cal data request_firmware() failed\n");
 	}
 
+	/* enable host interrupt after fw dnld is successful */
+	if (adapter->if_ops.enable_int)
+		adapter->if_ops.enable_int(adapter);
+
 	adapter->init_wait_q_woken = false;
 	ret = mwifiex_init_fw(adapter);
 	if (ret == -1) {
@@ -478,6 +482,8 @@ err_add_intf:
 	mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev);
 	rtnl_unlock();
 err_init_fw:
+	if (adapter->if_ops.disable_int)
+		adapter->if_ops.disable_int(adapter);
 	pr_debug("info: %s: unregister device\n", __func__);
 	adapter->if_ops.unregister_dev(adapter);
 done:
@@ -855,7 +861,7 @@ mwifiex_add_card(void *card, struct semaphore *sem,
 	INIT_WORK(&adapter->main_work, mwifiex_main_work_queue);
 
 	/* Register the device. Fill up the private data structure with relevant
-	   information from the card and request for the required IRQ. */
+	   information from the card. */
 	if (adapter->if_ops.register_dev(adapter)) {
 		pr_err("%s: failed to register mwifiex device\n", __func__);
 		goto err_registerdev;
@@ -919,6 +925,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
 	if (!adapter)
 		goto exit_remove;
 
+	/* We can no longer handle interrupts once we start doing the teardown
+	 * below. */
+	if (adapter->if_ops.disable_int)
+		adapter->if_ops.disable_int(adapter);
+
 	adapter->surprise_removed = true;
 
 	/* Stop data */
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 3da73d3..253e0bd 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -601,6 +601,7 @@ struct mwifiex_if_ops {
 	int (*register_dev) (struct mwifiex_adapter *);
 	void (*unregister_dev) (struct mwifiex_adapter *);
 	int (*enable_int) (struct mwifiex_adapter *);
+	void (*disable_int) (struct mwifiex_adapter *);
 	int (*process_int_status) (struct mwifiex_adapter *);
 	int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *,
 			     struct mwifiex_tx_param *);
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 5ee5ed0..5ef49f2 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -51,6 +51,7 @@ static struct mwifiex_if_ops sdio_ops;
 static struct semaphore add_remove_card_sem;
 
 static int mwifiex_sdio_resume(struct device *dev);
+static void mwifiex_sdio_interrupt(struct sdio_func *func);
 
 /*
  * SDIO probe.
@@ -296,6 +297,15 @@ static struct sdio_driver mwifiex_sdio = {
 	}
 };
 
+/* Write data into SDIO card register. Caller claims SDIO device. */
+static int
+mwifiex_write_reg_locked(struct sdio_func *func, u32 reg, u8 data)
+{
+	int ret = -1;
+	sdio_writeb(func, data, reg, &ret);
+	return ret;
+}
+
 /*
  * This function writes data into SDIO card register.
  */
@@ -303,10 +313,10 @@ static int
 mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u8 data)
 {
 	struct sdio_mmc_card *card = adapter->card;
-	int ret = -1;
+	int ret;
 
 	sdio_claim_host(card->func);
-	sdio_writeb(card->func, data, reg, &ret);
+	ret = mwifiex_write_reg_locked(card->func, reg, data);
 	sdio_release_host(card->func);
 
 	return ret;
@@ -685,23 +695,15 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat)
  * The host interrupt mask is read, the disable bit is reset and
  * written back to the card host interrupt mask register.
  */
-static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter)
+static void mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter)
 {
-	u8 host_int_mask, host_int_disable = HOST_INT_DISABLE;
-
-	/* Read back the host_int_mask register */
-	if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask))
-		return -1;
-
-	/* Update with the mask and write back to the register */
-	host_int_mask &= ~host_int_disable;
-
-	if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG, host_int_mask)) {
-		dev_err(adapter->dev, "disable host interrupt failed\n");
-		return -1;
-	}
+	struct sdio_mmc_card *card = adapter->card;
+	struct sdio_func *func = card->func;
 
-	return 0;
+	sdio_claim_host(func);
+	mwifiex_write_reg_locked(func, HOST_INT_MASK_REG, 0);
+	sdio_release_irq(func);
+	sdio_release_host(func);
 }
 
 /*
@@ -713,14 +715,29 @@ static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter)
 static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter)
 {
 	struct sdio_mmc_card *card = adapter->card;
+	struct sdio_func *func = card->func;
+	int ret;
+
+	sdio_claim_host(func);
+
+	/* Request the SDIO IRQ */
+	ret = sdio_claim_irq(func, mwifiex_sdio_interrupt);
+	if (ret) {
+		dev_err(adapter->dev, "claim irq failed: ret=%d\n", ret);
+		goto out;
+	}
 
 	/* Simply write the mask to the register */
-	if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG,
-			      card->reg->host_int_enable)) {
+	ret = mwifiex_write_reg_locked(func, HOST_INT_MASK_REG,
+				       card->reg->host_int_enable);
+	if (ret) {
 		dev_err(adapter->dev, "enable host interrupt failed\n");
-		return -1;
+		sdio_release_irq(func);
 	}
-	return 0;
+
+out:
+	sdio_release_host(func);
+	return ret;
 }
 
 /*
@@ -997,9 +1014,6 @@ mwifiex_sdio_interrupt(struct sdio_func *func)
 	}
 	adapter = card->adapter;
 
-	if (adapter->surprise_removed)
-		return;
-
 	if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP)
 		adapter->ps_state = PS_STATE_AWAKE;
 
@@ -1728,9 +1742,7 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter)
 	struct sdio_mmc_card *card = adapter->card;
 
 	if (adapter->card) {
-		/* Release the SDIO IRQ */
 		sdio_claim_host(card->func);
-		sdio_release_irq(card->func);
 		sdio_disable_func(card->func);
 		sdio_release_host(card->func);
 		sdio_set_drvdata(card->func, NULL);
@@ -1744,7 +1756,7 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter)
  */
 static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
 {
-	int ret = 0;
+	int ret;
 	struct sdio_mmc_card *card = adapter->card;
 	struct sdio_func *func = card->func;
 
@@ -1753,22 +1765,14 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
 
 	sdio_claim_host(func);
 
-	/* Request the SDIO IRQ */
-	ret = sdio_claim_irq(func, mwifiex_sdio_interrupt);
-	if (ret) {
-		pr_err("claim irq failed: ret=%d\n", ret);
-		goto disable_func;
-	}
-
 	/* Set block size */
 	ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE);
+	sdio_release_host(func);
 	if (ret) {
 		pr_err("cannot set SDIO block size\n");
-		ret = -1;
-		goto release_irq;
+		return ret;
 	}
 
-	sdio_release_host(func);
 	sdio_set_drvdata(func, card);
 
 	adapter->dev = &func->dev;
@@ -1776,15 +1780,6 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
 	strcpy(adapter->fw_name, card->firmware);
 
 	return 0;
-
-release_irq:
-	sdio_release_irq(func);
-disable_func:
-	sdio_disable_func(func);
-	sdio_release_host(func);
-	adapter->card = NULL;
-
-	return -1;
 }
 
 /*
@@ -1813,9 +1808,6 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
 	 */
 	mwifiex_read_reg(adapter, HOST_INTSTATUS_REG, &sdio_ireg);
 
-	/* Disable host interrupt mask register for SDIO */
-	mwifiex_sdio_disable_host_int(adapter);
-
 	/* Get SDIO ioport */
 	mwifiex_init_sdio_ioport(adapter);
 
@@ -1957,6 +1949,7 @@ static struct mwifiex_if_ops sdio_ops = {
 	.register_dev = mwifiex_register_dev,
 	.unregister_dev = mwifiex_unregister_dev,
 	.enable_int = mwifiex_sdio_enable_host_int,
+	.disable_int = mwifiex_sdio_disable_host_int,
 	.process_int_status = mwifiex_process_int_status,
 	.host_to_card = mwifiex_sdio_host_to_card,
 	.wakeup = mwifiex_pm_wakeup_card,
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h
index 6d51dfd..532ae0a 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -92,9 +92,6 @@
 /* Host Control Registers : Download host interrupt mask */
 #define DN_LD_HOST_INT_MASK		(0x2U)
 
-/* Disable Host interrupt mask */
-#define	HOST_INT_DISABLE		0xff
-
 /* Host Control Registers : Host interrupt status */
 #define HOST_INTSTATUS_REG		0x03
 /* Host Control Registers : Upload host interrupt status */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8184d12..43dd752 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -666,6 +666,8 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy,
 			if (sta->sdata->dev != dev)
 				continue;
 
+			sinfo.filled = 0;
+			sta_set_sinfo(sta, &sinfo);
 			i = 0;
 			ADD_STA_STATS(sta);
 		}
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index ac7ef54..e6512e2 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -290,7 +290,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
 	struct minstrel_rate *msr, *mr;
 	unsigned int ndx;
 	bool mrr_capable;
-	bool prev_sample = mi->prev_sample;
+	bool prev_sample;
 	int delta;
 	int sampling_ratio;
 
@@ -314,6 +314,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
 			(mi->sample_count + mi->sample_deferred / 2);
 
 	/* delta < 0: no sampling required */
+	prev_sample = mi->prev_sample;
 	mi->prev_sample = false;
 	if (delta < 0 || (!mrr_capable && prev_sample))
 		return;
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 5b2d301..f5aed96 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -804,10 +804,18 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
 
 	sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES];
 	info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
+	rate->count = 1;
+
+	if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) {
+		int idx = sample_idx % ARRAY_SIZE(mp->cck_rates);
+		rate->idx = mp->cck_rates[idx];
+		rate->flags = 0;
+		return;
+	}
+
 	rate->idx = sample_idx % MCS_GROUP_RATES +
 		    (sample_group->streams - 1) * MCS_GROUP_RATES;
 	rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags;
-	rate->count = 1;
 }
 
 static void
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 23dbcfc..2c5a79b 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -936,8 +936,14 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx)
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
 
-	/* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */
-	if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) {
+	/*
+	 * Drop duplicate 802.11 retransmissions
+	 * (IEEE 802.11-2012: 9.3.2.10 "Duplicate detection and recovery")
+	 */
+	if (rx->skb->len >= 24 && rx->sta &&
+	    !ieee80211_is_ctl(hdr->frame_control) &&
+	    !ieee80211_is_qos_nullfunc(hdr->frame_control) &&
+	    !is_multicast_ether_addr(hdr->addr1)) {
 		if (unlikely(ieee80211_has_retry(hdr->frame_control) &&
 			     rx->sta->last_seq_ctrl[rx->seqno_idx] ==
 			     hdr->seq_ctrl)) {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1cc47ac..25d217d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4770,9 +4770,9 @@ do {									    \
 	FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshForwarding, 0, 1,
 				  mask, NL80211_MESHCONF_FORWARDING,
 				  nla_get_u8);
-	FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, 1, 255,
+	FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, -255, 0,
 				  mask, NL80211_MESHCONF_RSSI_THRESHOLD,
-				  nla_get_u32);
+				  nla_get_s32);
 	FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode, 0, 16,
 				  mask, NL80211_MESHCONF_HT_OPMODE,
 				  nla_get_u16);
@@ -6613,12 +6613,14 @@ EXPORT_SYMBOL(cfg80211_testmode_alloc_event_skb);
 
 void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
 {
+	struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0];
 	void *hdr = ((void **)skb->cb)[1];
 	struct nlattr *data = ((void **)skb->cb)[2];
 
 	nla_nest_end(skb, data);
 	genlmsg_end(skb, hdr);
-	genlmsg_multicast(skb, 0, nl80211_testmode_mcgrp.id, gfp);
+	genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), skb, 0,
+				nl80211_testmode_mcgrp.id, gfp);
 }
 EXPORT_SYMBOL(cfg80211_testmode_event);
 #endif
@@ -10064,7 +10066,8 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
 
 	genlmsg_end(msg, hdr);
 
-	genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
+	genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+				nl80211_mlme_mcgrp.id, gfp);
 	return;
 
  nla_put_failure:
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5a24c98..5a950f3 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2279,7 +2279,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
 static void reg_timeout_work(struct work_struct *work)
 {
 	REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n");
+	rtnl_lock();
 	restore_regulatory_settings(true);
+	rtnl_unlock();
 }
 
 int __init regulatory_init(void)
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 1d3cfb1..81c8a10 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -34,8 +34,10 @@ struct cfg80211_conn {
 		CFG80211_CONN_SCAN_AGAIN,
 		CFG80211_CONN_AUTHENTICATE_NEXT,
 		CFG80211_CONN_AUTHENTICATING,
+		CFG80211_CONN_AUTH_FAILED,
 		CFG80211_CONN_ASSOCIATE_NEXT,
 		CFG80211_CONN_ASSOCIATING,
+		CFG80211_CONN_ASSOC_FAILED,
 		CFG80211_CONN_DEAUTH,
 		CFG80211_CONN_CONNECTED,
 	} state;
@@ -164,6 +166,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
 					  NULL, 0,
 					  params->key, params->key_len,
 					  params->key_idx, NULL, 0);
+	case CFG80211_CONN_AUTH_FAILED:
+		return -ENOTCONN;
 	case CFG80211_CONN_ASSOCIATE_NEXT:
 		BUG_ON(!rdev->ops->assoc);
 		wdev->conn->state = CFG80211_CONN_ASSOCIATING;
@@ -188,10 +192,17 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
 					     WLAN_REASON_DEAUTH_LEAVING,
 					     false);
 		return err;
+	case CFG80211_CONN_ASSOC_FAILED:
+		cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
+				     NULL, 0,
+				     WLAN_REASON_DEAUTH_LEAVING, false);
+		return -ENOTCONN;
 	case CFG80211_CONN_DEAUTH:
 		cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
 				     NULL, 0,
 				     WLAN_REASON_DEAUTH_LEAVING, false);
+		/* free directly, disconnected event already sent */
+		cfg80211_sme_free(wdev);
 		return 0;
 	default:
 		return 0;
@@ -371,7 +382,7 @@ bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status)
 		return true;
 	}
 
-	wdev->conn->state = CFG80211_CONN_DEAUTH;
+	wdev->conn->state = CFG80211_CONN_ASSOC_FAILED;
 	schedule_work(&rdev->conn_work);
 	return false;
 }
@@ -383,7 +394,13 @@ void cfg80211_sme_deauth(struct wireless_dev *wdev)
 
 void cfg80211_sme_auth_timeout(struct wireless_dev *wdev)
 {
-	cfg80211_sme_free(wdev);
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+	if (!wdev->conn)
+		return;
+
+	wdev->conn->state = CFG80211_CONN_AUTH_FAILED;
+	schedule_work(&rdev->conn_work);
 }
 
 void cfg80211_sme_disassoc(struct wireless_dev *wdev)
@@ -399,7 +416,13 @@ void cfg80211_sme_disassoc(struct wireless_dev *wdev)
 
 void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev)
 {
-	cfg80211_sme_disassoc(wdev);
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+	if (!wdev->conn)
+		return;
+
+	wdev->conn->state = CFG80211_CONN_ASSOC_FAILED;
+	schedule_work(&rdev->conn_work);
 }
 
 static int cfg80211_sme_connect(struct wireless_dev *wdev,
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related

* Re: Fwd: TP-LINK 8200ND
From: Vihang Patel @ 2013-07-24 17:58 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <51EFF3DD.80000@lwfinger.net>

Thanks Larry,

I have already tried the Ndiswrapper using both the TP-Link provided
Windows XP(64 & 32bit) drivers as well as ones provided by Realtek on
Ubuntu 12.04 and 13.04. Both scenarios freezes the OS. And in scenario
that I save it in conf file for it to load on startup, the OS freezes
on startup. No luck there. Would be interesting to see if anyone else
got it to work using ndiswrapper.

Vihang

On Wed, Jul 24, 2013 at 11:33 PM, Larry Finger
<Larry.Finger@lwfinger.net> wrote:
> On 07/24/2013 08:50 AM, Vihang Patel wrote:
>>
>> Hi,
>>
>> I understand there was a thread on linux drivers for TP-LINK8200ND
>> with rtl8192cu chipset, but it ran cold with no resolution. I was
>> wondering if there if anyone found a resolution on that.
>>
>> I have tried installing the drivers provided by realtek as well on
>> both Ubuntu 12.004 and 13.04. Scorched the internet, and was able to
>> get it to detect the device but it wont connect to any of the Wireless
>> networks.
>>
>> Any help would be helpful.
>
>
> The USB ID has been added to the mainline and stable kernels; however, the
> device does not work for me. The latest vendor driver sent privately to me
> can make a connection; however, the throughput is less than 1 Mbps. I have
> not yet had a chance to investigate as this card is low on my priority list.
>
> I have added the Realtek developer to this reply (Bcc). Perhaps the company
> has made some progress; however, when I last contacted them, they did not
> have an instance of this particular card. It seems that your only viable
> option at this time would probably be the Windows driver with ndiswrapper. I
> have not tested this option.
>
> Larry
>
>

^ permalink raw reply

* Re: interested in py80211?
From: Will Hawkins @ 2013-07-24 15:55 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: Johannes Berg, linux-wireless, Thomas Graf
In-Reply-To: <51E00577.60305@broadcom.com>

Thanks for posting about this effort. I would be very interested in
helping out on development. I will stay up-to-date on things via your
github page. Otherwise, please continue to keep the list updated on your
progress.

Will

On 07/12/2013 09:32 AM, Arend van Spriel wrote:
> On 07/12/13 10:02, Johannes Berg wrote:
>> Yep, I'd totally be interested. Not that I don't have enough things on
>> my plate already ;-)
>>
>> On Wed, 2013-07-03 at 22:57 +0200, Arend van Spriel wrote:
>>> A common say in Linux arena is "when you have an itch, just scratch it".
>>
>> :-)
>>
>>> My itch is that tools like ifconfig and iw are great, but in an
>>> automated test environment it kind of sucks to parse output, which is
>>> confirmed by blurb from iw: "Do NOT screenscrape this tool, we don't
>>> consider its output stable.".
>>
>> Heh, yeah ...
>>
>>> Ever since my first contact with Python I tend to favor it over other
>>> scripting alternatives so I decided to scratch my itch with that and
>>> another old acquaintance called SWIG. With those I went to create
>>> py80211. A first attempt was to have SWIG create a wrapper API directly
>>> exposing the libnl-3 API, but that did not feel comfortable in a
>>> scripting environment. So the level of abstraction is a bit higher. It
>>> is just in a kick-off state (eg. can only send u32 attributes), but I
>>> decided to push it to github anyway.
>>
>> Another approach might be exposing the libnl APIs and then build a
>> higher-level library in python. Have you considered that? That might
>> make it useful to other users of netlink as well, while keeping a 'nice'
>> nl80211 API?
> 
> I am still at that fork in the road and not sure about it. The libnl
> project itself already has libnl stuff exposed in a python lib being the
> core api and route. So I could go and add genl support to that and build
> the high-level python library from there.
> 
> Regards,
> Arend
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe
> linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: Fwd: TP-LINK 8200ND
From: Larry Finger @ 2013-07-24 15:33 UTC (permalink / raw)
  To: Vihang Patel; +Cc: linux-wireless
In-Reply-To: <CA+Gu+Ky5rCwCrWJkCKXsPEFodaARdf5DkmES3TN_UNuUqTnYVA@mail.gmail.com>

On 07/24/2013 08:50 AM, Vihang Patel wrote:
> Hi,
>
> I understand there was a thread on linux drivers for TP-LINK8200ND
> with rtl8192cu chipset, but it ran cold with no resolution. I was
> wondering if there if anyone found a resolution on that.
>
> I have tried installing the drivers provided by realtek as well on
> both Ubuntu 12.004 and 13.04. Scorched the internet, and was able to
> get it to detect the device but it wont connect to any of the Wireless
> networks.
>
> Any help would be helpful.

The USB ID has been added to the mainline and stable kernels; however, the 
device does not work for me. The latest vendor driver sent privately to me can 
make a connection; however, the throughput is less than 1 Mbps. I have not yet 
had a chance to investigate as this card is low on my priority list.

I have added the Realtek developer to this reply (Bcc). Perhaps the company has 
made some progress; however, when I last contacted them, they did not have an 
instance of this particular card. It seems that your only viable option at this 
time would probably be the Windows driver with ndiswrapper. I have not tested 
this option.

Larry



^ permalink raw reply

* Re: [PATCH 18/21] mwifiex: handle driver initialization error paths
From: John W. Linville @ 2013-07-24 15:16 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless, Amitkumar Karwar, Avinash Patil,
	Yogesh Ashok Powar, Nishant Sarmukadam, Frank Huang
In-Reply-To: <1374545878-15683-19-git-send-email-bzhao@marvell.com>

This one didn't apply on the current wireless-next tree.  Can you
fix it up?

On Mon, Jul 22, 2013 at 07:17:55PM -0700, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> mwifiex_fw_dpc() asynchronously takes care of firmware download
> and initialization. Currently the error paths in mwifiex_fw_dpc()
> are not handled. So if wrong firmware is downloaded, required
> cleanup work is not performed. memory is leaked and workqueue
> remains unterminated in this case.
> 
> mwifiex_terminate_workqueue() is moved to avoid forward
> declaration.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> ---
>  drivers/net/wireless/mwifiex/main.c | 83 ++++++++++++++++++++++++-------------
>  drivers/net/wireless/mwifiex/main.h |  1 +
>  2 files changed, 56 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
> index e64c369..5644c7f 100644
> --- a/drivers/net/wireless/mwifiex/main.c
> +++ b/drivers/net/wireless/mwifiex/main.c
> @@ -390,6 +390,17 @@ static void mwifiex_free_adapter(struct mwifiex_adapter *adapter)
>  }
>  
>  /*
> + * This function cancels all works in the queue and destroys
> + * the main workqueue.
> + */
> +static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter)
> +{
> +	flush_workqueue(adapter->workqueue);
> +	destroy_workqueue(adapter->workqueue);
> +	adapter->workqueue = NULL;
> +}
> +
> +/*
>   * This function gets firmware and initializes it.
>   *
>   * The main initialization steps followed are -
> @@ -398,7 +409,7 @@ static void mwifiex_free_adapter(struct mwifiex_adapter *adapter)
>   */
>  static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
>  {
> -	int ret;
> +	int ret, i;
>  	char fmt[64];
>  	struct mwifiex_private *priv;
>  	struct mwifiex_adapter *adapter = context;
> @@ -407,7 +418,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
>  	if (!firmware) {
>  		dev_err(adapter->dev,
>  			"Failed to get firmware %s\n", adapter->fw_name);
> -		goto done;
> +		goto err_dnld_fw;
>  	}
>  
>  	memset(&fw, 0, sizeof(struct mwifiex_fw_image));
> @@ -420,7 +431,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
>  	else
>  		ret = mwifiex_dnld_fw(adapter, &fw);
>  	if (ret == -1)
> -		goto done;
> +		goto err_dnld_fw;
>  
>  	dev_notice(adapter->dev, "WLAN FW is active\n");
>  
> @@ -432,13 +443,15 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
>  	}
>  
>  	/* enable host interrupt after fw dnld is successful */
> -	if (adapter->if_ops.enable_int)
> -		adapter->if_ops.enable_int(adapter);
> +	if (adapter->if_ops.enable_int) {
> +		if (adapter->if_ops.enable_int(adapter))
> +			goto err_dnld_fw;
> +	}
>  
>  	adapter->init_wait_q_woken = false;
>  	ret = mwifiex_init_fw(adapter);
>  	if (ret == -1) {
> -		goto done;
> +		goto err_init_fw;
>  	} else if (!ret) {
>  		adapter->hw_status = MWIFIEX_HW_STATUS_READY;
>  		goto done;
> @@ -447,12 +460,12 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
>  	wait_event_interruptible(adapter->init_wait_q,
>  				 adapter->init_wait_q_woken);
>  	if (adapter->hw_status != MWIFIEX_HW_STATUS_READY)
> -		goto done;
> +		goto err_init_fw;
>  
>  	priv = adapter->priv[MWIFIEX_BSS_ROLE_STA];
>  	if (mwifiex_register_cfg80211(adapter)) {
>  		dev_err(adapter->dev, "cannot register with cfg80211\n");
> -		goto err_init_fw;
> +		goto err_register_cfg80211;
>  	}
>  
>  	rtnl_lock();
> @@ -483,13 +496,39 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
>  	goto done;
>  
>  err_add_intf:
> -	mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev);
> +	for (i = 0; i < adapter->priv_num; i++) {
> +		priv = adapter->priv[i];
> +
> +		if (!priv)
> +			continue;
> +
> +		if (priv->wdev && priv->netdev)
> +			mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev);
> +	}
>  	rtnl_unlock();
> +err_register_cfg80211:
> +	wiphy_unregister(adapter->wiphy);
> +	wiphy_free(adapter->wiphy);
>  err_init_fw:
>  	if (adapter->if_ops.disable_int)
>  		adapter->if_ops.disable_int(adapter);
> +err_dnld_fw:
>  	pr_debug("info: %s: unregister device\n", __func__);
> -	adapter->if_ops.unregister_dev(adapter);
> +	if (adapter->if_ops.unregister_dev)
> +		adapter->if_ops.unregister_dev(adapter);
> +
> +	if ((adapter->hw_status == MWIFIEX_HW_STATUS_FW_READY) ||
> +	    (adapter->hw_status == MWIFIEX_HW_STATUS_READY)) {
> +		pr_debug("info: %s: shutdown mwifiex\n", __func__);
> +		adapter->init_wait_q_woken = false;
> +
> +		if (mwifiex_shutdown_drv(adapter) == -EINPROGRESS)
> +			wait_event_interruptible(adapter->init_wait_q,
> +						 adapter->init_wait_q_woken);
> +	}
> +	adapter->surprise_removed = true;
> +	mwifiex_terminate_workqueue(adapter);
> +	mwifiex_free_adapter(adapter);
>  done:
>  	if (adapter->cal_data) {
>  		release_firmware(adapter->cal_data);
> @@ -497,6 +536,7 @@ done:
>  	}
>  	release_firmware(adapter->firmware);
>  	complete(&adapter->fw_load);
> +	up(adapter->card_sem);
>  	return;
>  }
>  
> @@ -807,18 +847,6 @@ static void mwifiex_main_work_queue(struct work_struct *work)
>  }
>  
>  /*
> - * This function cancels all works in the queue and destroys
> - * the main workqueue.
> - */
> -static void
> -mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter)
> -{
> -	flush_workqueue(adapter->workqueue);
> -	destroy_workqueue(adapter->workqueue);
> -	adapter->workqueue = NULL;
> -}
> -
> -/*
>   * This function adds the card.
>   *
>   * This function follows the following major steps to set up the device -
> @@ -846,6 +874,7 @@ mwifiex_add_card(void *card, struct semaphore *sem,
>  	}
>  
>  	adapter->iface_type = iface_type;
> +	adapter->card_sem = sem;
>  
>  	adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING;
>  	adapter->surprise_removed = false;
> @@ -876,17 +905,12 @@ mwifiex_add_card(void *card, struct semaphore *sem,
>  		goto err_init_fw;
>  	}
>  
> -	up(sem);
>  	return 0;
>  
>  err_init_fw:
>  	pr_debug("info: %s: unregister device\n", __func__);
>  	if (adapter->if_ops.unregister_dev)
>  		adapter->if_ops.unregister_dev(adapter);
> -err_registerdev:
> -	adapter->surprise_removed = true;
> -	mwifiex_terminate_workqueue(adapter);
> -err_kmalloc:
>  	if ((adapter->hw_status == MWIFIEX_HW_STATUS_FW_READY) ||
>  	    (adapter->hw_status == MWIFIEX_HW_STATUS_READY)) {
>  		pr_debug("info: %s: shutdown mwifiex\n", __func__);
> @@ -896,7 +920,10 @@ err_kmalloc:
>  			wait_event_interruptible(adapter->init_wait_q,
>  						 adapter->init_wait_q_woken);
>  	}
> -
> +err_registerdev:
> +	adapter->surprise_removed = true;
> +	mwifiex_terminate_workqueue(adapter);
> +err_kmalloc:
>  	mwifiex_free_adapter(adapter);
>  
>  err_init_sw:
> diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
> index bb28d3d..9ee3b1b 100644
> --- a/drivers/net/wireless/mwifiex/main.h
> +++ b/drivers/net/wireless/mwifiex/main.h
> @@ -749,6 +749,7 @@ struct mwifiex_adapter {
>  
>  	atomic_t is_tx_received;
>  	atomic_t pending_bridged_pkts;
> +	struct semaphore *card_sem;
>  };
>  
>  int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
> -- 
> 1.8.2.3
> 
> 

-- 
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 19/21] mwifiex: code rearrangement in sdio.c
From: John W. Linville @ 2013-07-24 15:17 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless, Amitkumar Karwar, Avinash Patil,
	Yogesh Ashok Powar, Nishant Sarmukadam, Frank Huang
In-Reply-To: <1374545878-15683-20-git-send-email-bzhao@marvell.com>

This one also did not apply on the current wireless-next...

On Mon, Jul 22, 2013 at 07:17:56PM -0700, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> Some function definitions are moved to appropriate place
> to avoid forward declarations.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> ---
>  drivers/net/wireless/mwifiex/sdio.c | 211 ++++++++++++++++++------------------
>  1 file changed, 104 insertions(+), 107 deletions(-)
> 
> diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
> index c32a735..1eb5efa1 100644
> --- a/drivers/net/wireless/mwifiex/sdio.c
> +++ b/drivers/net/wireless/mwifiex/sdio.c
> @@ -50,9 +50,6 @@ static struct mwifiex_if_ops sdio_ops;
>  
>  static struct semaphore add_remove_card_sem;
>  
> -static int mwifiex_sdio_resume(struct device *dev);
> -static void mwifiex_sdio_interrupt(struct sdio_func *func);
> -
>  /*
>   * SDIO probe.
>   *
> @@ -113,6 +110,51 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
>  }
>  
>  /*
> + * SDIO resume.
> + *
> + * Kernel needs to suspend all functions separately. Therefore all
> + * registered functions must have drivers with suspend and resume
> + * methods. Failing that the kernel simply removes the whole card.
> + *
> + * If already not resumed, this function turns on the traffic and
> + * sends a host sleep cancel request to the firmware.
> + */
> +static int mwifiex_sdio_resume(struct device *dev)
> +{
> +	struct sdio_func *func = dev_to_sdio_func(dev);
> +	struct sdio_mmc_card *card;
> +	struct mwifiex_adapter *adapter;
> +	mmc_pm_flag_t pm_flag = 0;
> +
> +	if (func) {
> +		pm_flag = sdio_get_host_pm_caps(func);
> +		card = sdio_get_drvdata(func);
> +		if (!card || !card->adapter) {
> +			pr_err("resume: invalid card or adapter\n");
> +			return 0;
> +		}
> +	} else {
> +		pr_err("resume: sdio_func is not specified\n");
> +		return 0;
> +	}
> +
> +	adapter = card->adapter;
> +
> +	if (!adapter->is_suspended) {
> +		dev_warn(adapter->dev, "device already resumed\n");
> +		return 0;
> +	}
> +
> +	adapter->is_suspended = false;
> +
> +	/* Disable Host Sleep */
> +	mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA),
> +			  MWIFIEX_ASYNC_CMD);
> +
> +	return 0;
> +}
> +
> +/*
>   * SDIO remove.
>   *
>   * This function removes the interface and frees up the card structure.
> @@ -212,51 +254,6 @@ static int mwifiex_sdio_suspend(struct device *dev)
>  	return ret;
>  }
>  
> -/*
> - * SDIO resume.
> - *
> - * Kernel needs to suspend all functions separately. Therefore all
> - * registered functions must have drivers with suspend and resume
> - * methods. Failing that the kernel simply removes the whole card.
> - *
> - * If already not resumed, this function turns on the traffic and
> - * sends a host sleep cancel request to the firmware.
> - */
> -static int mwifiex_sdio_resume(struct device *dev)
> -{
> -	struct sdio_func *func = dev_to_sdio_func(dev);
> -	struct sdio_mmc_card *card;
> -	struct mwifiex_adapter *adapter;
> -	mmc_pm_flag_t pm_flag = 0;
> -
> -	if (func) {
> -		pm_flag = sdio_get_host_pm_caps(func);
> -		card = sdio_get_drvdata(func);
> -		if (!card || !card->adapter) {
> -			pr_err("resume: invalid card or adapter\n");
> -			return 0;
> -		}
> -	} else {
> -		pr_err("resume: sdio_func is not specified\n");
> -		return 0;
> -	}
> -
> -	adapter = card->adapter;
> -
> -	if (!adapter->is_suspended) {
> -		dev_warn(adapter->dev, "device already resumed\n");
> -		return 0;
> -	}
> -
> -	adapter->is_suspended = false;
> -
> -	/* Disable Host Sleep */
> -	mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA),
> -			  MWIFIEX_ASYNC_CMD);
> -
> -	return 0;
> -}
> -
>  /* Device ID for SD8786 */
>  #define SDIO_DEVICE_ID_MARVELL_8786   (0x9116)
>  /* Device ID for SD8787 */
> @@ -707,6 +704,65 @@ static void mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter)
>  }
>  
>  /*
> + * This function reads the interrupt status from card.
> + */
> +static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
> +{
> +	struct sdio_mmc_card *card = adapter->card;
> +	u8 sdio_ireg;
> +	unsigned long flags;
> +
> +	if (mwifiex_read_data_sync(adapter, card->mp_regs,
> +				   card->reg->max_mp_regs,
> +				   REG_PORT | MWIFIEX_SDIO_BYTE_MODE_MASK, 0)) {
> +		dev_err(adapter->dev, "read mp_regs failed\n");
> +		return;
> +	}
> +
> +	sdio_ireg = card->mp_regs[HOST_INTSTATUS_REG];
> +	if (sdio_ireg) {
> +		/*
> +		 * DN_LD_HOST_INT_STATUS and/or UP_LD_HOST_INT_STATUS
> +		 * For SDIO new mode CMD port interrupts
> +		 *	DN_LD_CMD_PORT_HOST_INT_STATUS and/or
> +		 *	UP_LD_CMD_PORT_HOST_INT_STATUS
> +		 * Clear the interrupt status register
> +		 */
> +		dev_dbg(adapter->dev, "int: sdio_ireg = %#x\n", sdio_ireg);
> +		spin_lock_irqsave(&adapter->int_lock, flags);
> +		adapter->int_status |= sdio_ireg;
> +		spin_unlock_irqrestore(&adapter->int_lock, flags);
> +	}
> +}
> +
> +/*
> + * SDIO interrupt handler.
> + *
> + * This function reads the interrupt status from firmware and handles
> + * the interrupt in current thread (ksdioirqd) right away.
> + */
> +static void
> +mwifiex_sdio_interrupt(struct sdio_func *func)
> +{
> +	struct mwifiex_adapter *adapter;
> +	struct sdio_mmc_card *card;
> +
> +	card = sdio_get_drvdata(func);
> +	if (!card || !card->adapter) {
> +		pr_debug("int: func=%p card=%p adapter=%p\n",
> +			 func, card, card ? card->adapter : NULL);
> +		return;
> +	}
> +	adapter = card->adapter;
> +
> +	if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP)
> +		adapter->ps_state = PS_STATE_AWAKE;
> +
> +	mwifiex_interrupt_status(adapter);
> +	mwifiex_main_process(adapter);
> +}
> +
> +/*
>   * This function enables the host interrupt.
>   *
>   * The host interrupt enable mask is written to the card
> @@ -963,65 +1019,6 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
>  }
>  
>  /*
> - * This function reads the interrupt status from card.
> - */
> -static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
> -{
> -	struct sdio_mmc_card *card = adapter->card;
> -	u8 sdio_ireg;
> -	unsigned long flags;
> -
> -	if (mwifiex_read_data_sync(adapter, card->mp_regs,
> -				   card->reg->max_mp_regs,
> -				   REG_PORT | MWIFIEX_SDIO_BYTE_MODE_MASK, 0)) {
> -		dev_err(adapter->dev, "read mp_regs failed\n");
> -		return;
> -	}
> -
> -	sdio_ireg = card->mp_regs[HOST_INTSTATUS_REG];
> -	if (sdio_ireg) {
> -		/*
> -		 * DN_LD_HOST_INT_STATUS and/or UP_LD_HOST_INT_STATUS
> -		 * For SDIO new mode CMD port interrupts
> -		 *	DN_LD_CMD_PORT_HOST_INT_STATUS and/or
> -		 *	UP_LD_CMD_PORT_HOST_INT_STATUS
> -		 * Clear the interrupt status register
> -		 */
> -		dev_dbg(adapter->dev, "int: sdio_ireg = %#x\n", sdio_ireg);
> -		spin_lock_irqsave(&adapter->int_lock, flags);
> -		adapter->int_status |= sdio_ireg;
> -		spin_unlock_irqrestore(&adapter->int_lock, flags);
> -	}
> -}
> -
> -/*
> - * SDIO interrupt handler.
> - *
> - * This function reads the interrupt status from firmware and handles
> - * the interrupt in current thread (ksdioirqd) right away.
> - */
> -static void
> -mwifiex_sdio_interrupt(struct sdio_func *func)
> -{
> -	struct mwifiex_adapter *adapter;
> -	struct sdio_mmc_card *card;
> -
> -	card = sdio_get_drvdata(func);
> -	if (!card || !card->adapter) {
> -		pr_debug("int: func=%p card=%p adapter=%p\n",
> -			 func, card, card ? card->adapter : NULL);
> -		return;
> -	}
> -	adapter = card->adapter;
> -
> -	if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP)
> -		adapter->ps_state = PS_STATE_AWAKE;
> -
> -	mwifiex_interrupt_status(adapter);
> -	mwifiex_main_process(adapter);
> -}
> -
> -/*
>   * This function decodes a received packet.
>   *
>   * Based on the type, the packet is treated as either a data, or
> -- 
> 1.8.2.3
> 
> 

-- 
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] ssb: drop BROKEN from SSB_SFLASH
From: Hauke Mehrtens @ 2013-07-24 15:04 UTC (permalink / raw)
  To: John W. Linville; +Cc: Rafał Miłecki, linux-wireless
In-Reply-To: <20130724145500.GC2385@tuxdriver.com>

On 07/24/2013 04:55 PM, John W. Linville wrote:
> Did Hauke respond to this?
> 
> On Tue, Jun 25, 2013 at 10:13:46AM +0200, Rafał Miłecki wrote:
>> With recent patches ssb can fetch info about serial flash and register
>> it as a platform device. No more reasons to mark it BROKEN.
>>
>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
>> Cc: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>> Hauke: does it look OK for you? Did you give it a try?
>> ---
>>  drivers/ssb/Kconfig                    |    2 +-
>>  drivers/ssb/driver_chipcommon_sflash.c |    8 +++-----
>>  2 files changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
>> index 4f0dd37..775251d 100644
>> --- a/drivers/ssb/Kconfig
>> +++ b/drivers/ssb/Kconfig
>> @@ -139,7 +139,7 @@ config SSB_DRIVER_MIPS
>>  
>>  config SSB_SFLASH
>>  	bool "SSB serial flash support"
>> -	depends on SSB_DRIVER_MIPS && BROKEN
>> +	depends on SSB_DRIVER_MIPS
>>  	default y
>>  
>>  # Assumption: We are on embedded, if we compile the MIPS core.
>> diff --git a/drivers/ssb/driver_chipcommon_sflash.c b/drivers/ssb/driver_chipcommon_sflash.c
>> index e84cf04..50328de 100644
>> --- a/drivers/ssb/driver_chipcommon_sflash.c
>> +++ b/drivers/ssb/driver_chipcommon_sflash.c
>> @@ -151,8 +151,8 @@ int ssb_sflash_init(struct ssb_chipcommon *cc)
>>  	sflash->size = sflash->blocksize * sflash->numblocks;
>>  	sflash->present = true;
>>  
>> -	pr_info("Found %s serial flash (blocksize: 0x%X, blocks: %d)\n",
>> -		e->name, e->blocksize, e->numblocks);
>> +	pr_info("Found %s serial flash (size: %dKiB, blocksize: 0x%X, blocks: %d)\n",
>> +		e->name, sflash->size / 1024, e->blocksize, e->numblocks);
>>  
>>  	/* Prepare platform device, but don't register it yet. It's too early,
>>  	 * malloc (required by device_private_init) is not available yet. */
>> @@ -160,7 +160,5 @@ int ssb_sflash_init(struct ssb_chipcommon *cc)
>>  					 sflash->size;
>>  	ssb_sflash_dev.dev.platform_data = sflash;
>>  
>> -	pr_err("Serial flash support is not implemented yet!\n");
>> -
>> -	return -ENOTSUPP;
>> +	return 0;
>>  }

Hi,

I do not own a device with a serial flash chip connected to ssb. This
patch looks ok to me, please apply it.

Hauke


^ permalink raw reply

* Re: [PATCH] ssb: drop BROKEN from SSB_SFLASH
From: John W. Linville @ 2013-07-24 14:55 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless, Hauke Mehrtens
In-Reply-To: <1372148026-9750-1-git-send-email-zajec5@gmail.com>

Did Hauke respond to this?

On Tue, Jun 25, 2013 at 10:13:46AM +0200, Rafał Miłecki wrote:
> With recent patches ssb can fetch info about serial flash and register
> it as a platform device. No more reasons to mark it BROKEN.
> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> Cc: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> Hauke: does it look OK for you? Did you give it a try?
> ---
>  drivers/ssb/Kconfig                    |    2 +-
>  drivers/ssb/driver_chipcommon_sflash.c |    8 +++-----
>  2 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
> index 4f0dd37..775251d 100644
> --- a/drivers/ssb/Kconfig
> +++ b/drivers/ssb/Kconfig
> @@ -139,7 +139,7 @@ config SSB_DRIVER_MIPS
>  
>  config SSB_SFLASH
>  	bool "SSB serial flash support"
> -	depends on SSB_DRIVER_MIPS && BROKEN
> +	depends on SSB_DRIVER_MIPS
>  	default y
>  
>  # Assumption: We are on embedded, if we compile the MIPS core.
> diff --git a/drivers/ssb/driver_chipcommon_sflash.c b/drivers/ssb/driver_chipcommon_sflash.c
> index e84cf04..50328de 100644
> --- a/drivers/ssb/driver_chipcommon_sflash.c
> +++ b/drivers/ssb/driver_chipcommon_sflash.c
> @@ -151,8 +151,8 @@ int ssb_sflash_init(struct ssb_chipcommon *cc)
>  	sflash->size = sflash->blocksize * sflash->numblocks;
>  	sflash->present = true;
>  
> -	pr_info("Found %s serial flash (blocksize: 0x%X, blocks: %d)\n",
> -		e->name, e->blocksize, e->numblocks);
> +	pr_info("Found %s serial flash (size: %dKiB, blocksize: 0x%X, blocks: %d)\n",
> +		e->name, sflash->size / 1024, e->blocksize, e->numblocks);
>  
>  	/* Prepare platform device, but don't register it yet. It's too early,
>  	 * malloc (required by device_private_init) is not available yet. */
> @@ -160,7 +160,5 @@ int ssb_sflash_init(struct ssb_chipcommon *cc)
>  					 sflash->size;
>  	ssb_sflash_dev.dev.platform_data = sflash;
>  
> -	pr_err("Serial flash support is not implemented yet!\n");
> -
> -	return -ENOTSUPP;
> +	return 0;
>  }
> -- 
> 1.7.10.4
> 
> 

-- 
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: IBSS-RSN support for BCM4313
From: Hauke Mehrtens @ 2013-07-24 14:40 UTC (permalink / raw)
  To: Jordan McCarthy; +Cc: linux-wireless
In-Reply-To: <51EFC944.40502@opentechinstitute.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/24/2013 02:32 PM, Jordan McCarthy wrote:
> Hi Linux wireless folk, I am a developer at a non-profit working on
> a wireless mesh networking platform, and we've just discovered that
> we have a fleet of netbooks with the Broadcom 4313 chipset, one
> that does not work particularly well (and sometimes not at all) in
> ad-hoc mode.
> 
> What's more, none of the available drivers seem to support
> IBSS-RSN, which is absolutely essential for the requirements of our
> platform. Accordingly, I wondered if anyone has any experience
> trying to get the BCM4313 to work in an IBSS-RSN configuration, and
> if not, what is needed to get either of the following:
> 
> - brcmsmac to support adhoc mode - b43 to cover the BCM4313

Hi Jordan,

I added basic adhoc mode support to brcmsmac in 3.10 [0].
This did not got much testing by me. If you want to improve this have
a look on how b43 handles adhoc mode and looking into the initial
brcmsmac commit to staging also helps.

Hauke

[0]:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c55b3766054d3db7a9732c6c8a1c81afac2cfaa6
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJR7+dOAAoJEIZ0px9YPRMy/XEP/0B7JBgJYZwwbZZOX4reia6F
XGDoJ3FARwmTgsrIyR9ad8bkEjGUnBfXaln/9we1ePRGG+3floLgY7AifX6iaKib
C6wh3ivFLD05l2CkHLUR1As9o0kh09m+ke34gF0JzQ5g7CLAmNtHhoE1NcPXVsfd
VyRI35Gz47hO1w5b66zPmM8rMx1ua1I31gCJ50Cjbk3EEgnrQqtERxpwKrZTd13w
0qDR7gShcAoFYYBvKbf4mScJbuzOkYwOU9cpn6nIbZm48uhgpPHjR1fuuK5UF7dn
ZyDxdap4S4f9lQPPZtC+ne9SWigP6wuYxHZiUTL6jbcZcL14AHzDdQfuIzO+4cjK
+GPomc4BkDnhWg9AcbzquF9tw9YE7h0aKGHknB1DYTkRZnvTrwKjsGdu9TBxwlFz
QHe+pTHOndf+s9/aGqYm/sxq3GOGXHl+OUp8ErOUzLRCvCvy+QyHDBPoeT8BYe6/
k513hqc1eV64ypV/Mns2V1ZbLiLC7huK6pgcrQSeNfvq6JHw8fmMZuhuIVARum1R
iiEnuX7ZbR3L+MgJTE9K7RT5nkrRyj1/IAxd4/hPulBmCHkQnRFM2f+rVOBa5U/k
MsqgaCwEVotlHDy+lXFDQTyhWsizEGW2ebZihP3EI2I3U4qEuLgFg2pNG29ded8w
OrVIlJi8TbUXAbJWpyDC
=M1wB
-----END PGP SIGNATURE-----

^ permalink raw reply

* Re: QCA vs community contributions to QCA drivers
From: John W. Linville @ 2013-07-24 14:11 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <CAB=NE6W7udZBy0WR9pT6QBJxXoz6RkFEZccotihPCHNT6Q4jCg@mail.gmail.com>

On Tue, Jul 23, 2013 at 03:09:15PM -0700, Luis R. Rodriguez wrote:
> Here's a google drive spreadsheet anyone can view of QCA vs community
> contributions to QCA device drivers:
> 
> https://docs.google.com/spreadsheet/ccc?key=0AtNdeeyGJEJ7dG45U2xrZldlQm80Nlg5QzEwUmtNUGc
> 
> If you'd like to contribute feel free to drop me a line or contact of
> the other QCA device driver maintainers.

I'm not sure what the expectation is, but those numbers look pretty
good to me...?

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: Wake-On-Wireless and Deauthentication
From: greg.huber @ 2013-07-24 13:56 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, daniel.wagner, Dan Williams
In-Reply-To: <CAB=NE6UPz=6NuCMvy5FEM9QBg9rhwFTw0mG2YVTX3r3dLG=1cQ@mail.gmail.com>

I moved over to an ARM embedded proto board and was able to get further.
When suspended, the wireless card appears to stay awake and I can see the
WoW magic-packets as well as other traffic to that NIC. First problem is that
this is kernel 3.0.35 which I read does not yet support wake-on-wireless.

The second question that perhaps one of you can answer is whether or not
the external WAKE_EN# interrupt signal (pin 1 on a mPCIe card) is used to
resume the system, or is the PCIe interrupt expected to resume the system.
I scoped the WAKE_EN# signal but do not see any activity. I also looked at
later drivers,  I don't see this signal activated as an interrupt source, but
I'm still looking.

Thank You.

Greg

On 07/18/2013 09:38 PM, Luis R. Rodriguez wrote:
> On Wed, Jul 17, 2013 at 11:11 AM, greg.huber <greg.huber@carestream.com> wrote:
>> I'm trying to get Wake-on-wireless working with an Atheros AR9462.
>> The problem I seem to be having is that there is a Deauth requested
>> when the system is suspended. Does anyone know how to keep the
>> association while suspended?? I'm using kernel 3.9.9.
>>
>> The log after waking (from keyboard)
>>
>> [  320.117062] wlp3s0: deauthenticating from 00:24:01:12:de:7a by local choice
>> (reason=3)
> Typical managers for networking will disassociate you (and therefore
> deauth first) prior to kicking the system to suspend. To test WoW you
> need to run the supplicant manually because as far as I can tell the
> GUI managers don't consider if WoW was enabled or not. In such a case
> that WoW was enabled the GUI managers should not send the
> deauth/disassoc.
>
>   Luis
>


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox