Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] Bluetooth: btmrvl: support Marvell Bluetooth device SD8897
From: Gustavo Padovan @ 2013-05-20 20:49 UTC (permalink / raw)
  To: Bing Zhao; +Cc: linux-bluetooth, linux-wireless, Marcel Holtmann, Frank Huang
In-Reply-To: <1368494132-23701-1-git-send-email-bzhao@marvell.com>

Hi Bing,

* Bing Zhao <bzhao@marvell.com> [2013-05-13 18:15:32 -0700]:

> The register offsets have been changed in SD8897 and newer chips.
> Define a new btmrvl_sdio_card_reg map for SD88xx.
> 
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> Signed-off-by: Frank Huang <frankh@marvell.com>
> ---
>  drivers/bluetooth/Kconfig       |  4 ++--
>  drivers/bluetooth/btmrvl_sdio.c | 28 ++++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+), 2 deletions(-)

Patch has been applied to bluetooth.git. Thanks.

	Gustavo

^ permalink raw reply

* Re: pull request: wireless 2013-05-20
From: David Miller @ 2013-05-20 21:05 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20130520193644.GD11502@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 20 May 2013 15:36:44 -0400

> This pull request is intended for the 3.10 series.  It contains a
> variety of fixes for problems discovered during the merge window and
> after 3.10-rc1.

Pulled, thanks John.

^ permalink raw reply

* iwlwifi dmar errors in 3.9.2
From: Ilia Mirkin @ 2013-05-20 21:12 UTC (permalink / raw)
  To: linux-wireless

Hello,

I recently upgraded to 3.9.2 from 3.7.10, and have begun to see some
DMAR errors in my log. Here are a bunch of them:
http://pastebin.com/wgq0JW0S

This does not seem to negatively affect wifi -- it seems to work just
fine without any extra cajoling, but thought this might be worth
reporting. I also don't know exactly what's triggering the issue.
Hopefully the logs provide the necessary info though.

# lspci -nn -s 03:00.0
03:00.0 Network controller [0280]: Intel Corporation Centrino
Ultimate-N 6300 [8086:4238] (rev 3e)

The machine is a Thinkpad T420s. I've only recently enabled VT-d (and
thus IOMMU), which is perhaps why these didn't happen before... not
sure of the exact timing vs the kernel upgrade.

Let me know if there's any additional info you'd like to get from me.

Thanks,

  -ilia

^ permalink raw reply

* Problem with iwlwifi kernel 3.9.0 and 3.9.2
From: Flavio @ 2013-05-20 21:26 UTC (permalink / raw)
  To: linux-wireless

Hello,

I've recently changed my wifi router and I'm experiencing something
really strange with my wifi connection.
If I try to connect to my access point using windows, I don't have any
problem, but if I try with Linux (Gentoo Linux
x86_64) I cannot connect to my Access Point unless I do the following steps:

ifconfig wlan0 down
rmmod iwldvm
rmmod iwlwifi
modprobe iwlwifi
ifconfig wlan0 up

otherwise if I try to connect to my access point / wifi router, Wicd
tells me that I inserted a wrong password.
I've even tried with another live linux distribution, and I don't have
this issue.

I use gentoo-sources-3.9.2 kernel.

Anway, I see a lot of these lines into the ringbuffer:
[   10.597894] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   10.604842] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   10.974579] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   10.981532] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   11.170175] udevd (1281) used greatest stack depth: 3904 bytes left
[   11.177626] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   12.943205] ehci-pci 0000:00:1d.0: reused qh ffff88025442db80 schedule
[   12.943220] usb 2-1.2.4: link qh8-0601/ffff88025442db80 start 3 [1/2 us]
[   14.966790] ehci-pci 0000:00:1a.0: reused qh ffff880256313780 schedule
[   14.966809] usb 1-1.2: link qh1-0601/ffff880256313780 start 0 [1/2 us]
[   16.040474] r8169 0000:05:00.0 eth0: unable to load firmware patch
rtl_nic/rtl8168e-3.fw (-2)
[   16.053919] r8169 0000:05:00.0 eth0: link down
[   16.053984] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.290113] EXT4-fs (sdb2): re-mounted. Opts: discard,data=ordered,commit=600
[   16.361332] EXT4-fs (sdb3): re-mounted. Opts: discard,user_xattr,commit=600
[   21.357366] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   21.364249] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   21.575272] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   21.657055] r8169 0000:05:00.0 eth0: link down
[   21.657128] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   21.700948] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   21.707855] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   21.917497] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   31.326409] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   31.333315] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   31.549301] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   31.632951] r8169 0000:05:00.0 eth0: link down
[   31.633017] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   31.674518] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   31.681424] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   31.901246] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   32.708189] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   32.715113] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   32.930218] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   33.019577] r8169 0000:05:00.0 eth0: link down
[   33.019645] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   41.426395] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   41.433323] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   41.648486] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   41.732823] r8169 0000:05:00.0 eth0: link down
[   41.732902] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   41.782637] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   41.789542] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   42.003966] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   42.801094] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   42.808009] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   43.022852] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   43.109315] r8169 0000:05:00.0 eth0: link down
[   43.109382] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   50.550516] ata1.00: configured for UDMA/133
[   50.550520] ata1: EH complete
[   50.556920] ata2.00: configured for UDMA/133
[   50.556924] ata2: EH complete
[   50.640043] EXT4-fs (sdb2): re-mounted. Opts: discard,commit=600
[   50.679807] EXT4-fs (sdb3): re-mounted. Opts: discard,user_xattr,commit=600
[   51.314954] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   51.321836] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   51.517346] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   51.584493] r8169 0000:05:00.0 eth0: link down
[   51.584529] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   51.622496] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   51.629524] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   51.825554] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   52.651756] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   52.658680] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   52.874838] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   52.964131] r8169 0000:05:00.0 eth0: link down
[   52.964196] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   55.297179] cc1 (3560) used greatest stack depth: 3560 bytes left
[   57.035425] ehci-pci 0000:00:1a.0: reused qh ffff880255754a80 schedule
[   57.035431] usb 1-1.3: link qh16-0001/ffff880255754a80 start 3 [1/0 us]
[   57.035539] usb 1-1.3: unlink qh16-0001/ffff880255754a80 start 3 [1/0 us]
[   58.078190] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   58.085086] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   58.278011] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   58.341392] r8169 0000:05:00.0 eth0: link down
[   58.341432] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   75.980776] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   75.987691] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   76.198996] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   76.282766] r8169 0000:05:00.0 eth0: link down
[   76.282848] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   76.336181] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   76.343115] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   76.552906] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   78.929615] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[   78.936515] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[   79.147113] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   79.231901] r8169 0000:05:00.0 eth0: link down
[   79.231989] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  125.566966] Intel(R) Wireless WiFi driver for Linux, in-tree:
[  125.566975] Copyright(c) 2003-2013 Intel Corporation
[  125.567862] iwlwifi 0000:02:00.0: irq 50 for MSI/MSI-X
[  125.569289] iwlwifi 0000:02:00.0: loaded firmware version 18.168.6.1
[  125.573184] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled
[  125.573198] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUGFS disabled
[  125.573206] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
[  125.573214] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEVICE_TESTMODE disabled
[  125.573222] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_P2P disabled
[  125.573232] iwlwifi 0000:02:00.0: Detected Intel(R) Centrino(R)
Advanced-N 6230 AGN, REV=0xB0
[  125.573311] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  125.589763] ieee80211 phy1: Selected rate control algorithm 'iwl-agn-rs'
[  131.463071] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  131.469967] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  131.849054] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  131.855971] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  132.059034] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  155.659291] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  155.666217] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  155.878162] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  155.960425] r8169 0000:05:00.0 eth0: link down
[  155.960500] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  156.013922] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  156.020848] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  156.232123] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  158.686204] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  158.693095] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  158.909408] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  158.996422] r8169 0000:05:00.0 eth0: link down
[  158.996489] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  165.945974] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  165.952897] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  166.165433] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  166.241019] r8169 0000:05:00.0 eth0: link down
[  166.241097] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  166.298743] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[  166.305659] iwlwifi 0000:02:00.0: Radio type=0x1-0x2-0x0
[  166.520184] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  168.607165] wlan0: authenticate with 9c:d3:6d:f7:95:02
[  168.612821] wlan0: send auth to 9c:d3:6d:f7:95:02 (try 1/3)
[  168.615680] wlan0: authenticated
[  168.615720] wlan0: waiting for beacon from 9c:d3:6d:f7:95:02
[  168.711236] wlan0: associate with 9c:d3:6d:f7:95:02 (try 1/3)
[  168.714864] wlan0: RX AssocResp from 9c:d3:6d:f7:95:02 (capab=0x411
status=0 aid=2)
[  168.718389] wlan0: associated
[  168.718442] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

I don't know if this is normal or not, but since when I changed the
wifi router I'm experiencing the problem described above.
Could you help me to debug the problem?
I don't understand if this has something to do with my configuration
or if there's a bug somewhere.
the /etc/modprobe.d/iwlwifi.conf file is empty.

Feel free to ask for further information you would need.

Thanks a lot,

-- 
Flavio

^ permalink raw reply

* Re: rt3070-based usb device won't accept mac address changes
From: Bruno Randolf @ 2013-05-20 23:40 UTC (permalink / raw)
  To: Alessandro Lannocca; +Cc: linux-wireless, helmut.schaa, IvDoorn, gwingerde
In-Reply-To: <CAMfPB_yVuSD765CAycUtdWBTvEEam=MpdCGKpWDJAvFiEjvLrw@mail.gmail.com>

On 05/18/2013 10:07 PM, Alessandro Lannocca wrote:
> After digging a bit into linux-stable.git I found the culprit: this
> regression comes from commit #
> 6c50f9459e62eb133563fd23606f68bfc9d120e8 (rt2x00: Use addr_mask to
> disallow invalid MAC addresses in mutli-bssid mode) ; reverting it
> fixes the problem, tested by me in compat-drivers-2013-03-28-5-u .
>
>
> I can't tell if reverting that commit adds any trouble as I'm not a
> developer; however I'm sure you guys will know how to handle the
> situation.

Basically the driver got more picky and only allows the last 3 bit of 
the MAC address changed. I just found out that if you generate your new 
MAC accordingly it works!

I wonder wether this is addr_mask is necessary for all RT chipsets, 
since mine (RT5372) happily accepted different MAC addresses before, 
also in multi-AP configurations...

bruno

^ permalink raw reply

* Build problem with current git repo
From: Larry Finger @ 2013-05-20 23:58 UTC (permalink / raw)
  To: backports; +Cc: linux-wireless

Pulling from the git repo today and trying to do a 'make menuconfig' results in 
the following error:

finger@larrylap:~/backports/backport> make menuconfig
Makefile.real:1: versions: No such file or directory
make[1]: *** No rule to make target `versions'.  Stop.
make: *** [menuconfig] Error 2

The first line of Makefile.real contains "include versions", but that file does 
not exist. It seems as if versions has not been committed to the repo.

After I copied that file from a tarball source version, I then get the error

finger@larrylap:~/backports/backport> make menuconfig
make[2]: `mconf' is up to date.
Kconfig:27: can't open file "net/wireless/Kconfig"
make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2

Larry


^ permalink raw reply

* [PATCH 2/2] cfg80211/nl80211: Add coalesce support
From: Bing Zhao @ 2013-05-21  1:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, Luis R. Rodriguez, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho, Amitkumar Karwar, Bing Zhao
In-Reply-To: <1369099918-4921-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

Add set/get configuration support for packet coalesce.

This feature needs to be advertised during driver initialization.
Drivers can do required hardware settings based on user configuration.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 include/net/cfg80211.h       |  51 +++++++++
 include/uapi/linux/nl80211.h |  57 +++++++++-
 net/wireless/core.c          |   2 +
 net/wireless/core.h          |  22 ++++
 net/wireless/nl80211.c       | 265 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 394 insertions(+), 3 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4585b63..dcbf125 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1739,6 +1739,35 @@ struct cfg80211_wowlan {
 };
 
 /**
+ * struct cfg80211_coalesce_rules - Coalesce rule parameters
+ *
+ * This structure defines coalesce rule for the device.
+ * @delay: maximum coalescing delay in msecs.
+ * @condition: condition for packet coalescence.
+ *	i.e. pattern 'match' or 'no match'
+ * @patterns: array of packet patterns
+ * @n_patterns: number of patterns
+ */
+struct cfg80211_coalesce_rules {
+	int delay;
+	u8 condition;
+	struct cfg80211_pkt_pattern *patterns;
+	int n_patterns;
+};
+
+/**
+ * struct cfg80211_coalesce - Packet coalescing settings
+ *
+ * This structure defines coalescing settings.
+ * @rules: array of coalesce rules
+ * @n_rules: number of rules
+ */
+struct cfg80211_coalesce {
+	struct cfg80211_coalesce_rules **rules;
+	int n_rules;
+};
+
+/**
  * struct cfg80211_wowlan_wakeup - wakeup report
  * @disconnect: woke up by getting disconnected
  * @magic_pkt: woke up by receiving magic packet
@@ -2024,6 +2053,7 @@ struct cfg80211_update_ft_ies_params {
  *	driver can take the most appropriate actions.
  * @crit_proto_stop: Indicates critical protocol no longer needs increased link
  *	reliability. This operation can not fail.
+ * @set_coalesce: Set coalesce parameters.
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2259,6 +2289,8 @@ struct cfg80211_ops {
 				    u16 duration);
 	void	(*crit_proto_stop)(struct wiphy *wiphy,
 				   struct wireless_dev *wdev);
+	int	(*set_coalesce)(struct wiphy *wiphy,
+				struct cfg80211_coalesce_rules *rule);
 };
 
 /*
@@ -2483,6 +2515,23 @@ struct wiphy_wowlan_support {
 };
 
 /**
+ * struct wiphy_coalesce_support - coalesce support data
+ * @n_rules: maximum number of coalesce rules
+ * @n_patterns: number of supported patterns
+ *	(see nl80211.h for the pattern definition)
+ * @pattern_max_len: maximum length of each pattern
+ * @pattern_min_len: minimum length of each pattern
+ * @max_pkt_offset: maximum Rx packet offset
+ */
+struct wiphy_coalesce_support {
+	int n_rules;
+	int n_patterns;
+	int pattern_max_len;
+	int pattern_min_len;
+	int max_pkt_offset;
+};
+
+/**
  * struct wiphy - wireless hardware description
  * @reg_notifier: the driver's regulatory notification callback,
  *	note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2589,6 +2638,7 @@ struct wiphy_wowlan_support {
  *	802.11-2012 8.4.2.29 for the defined fields.
  * @extended_capabilities_mask: mask of the valid values
  * @extended_capabilities_len: length of the extended capabilities
+ * @wiphy_coalesce_support coalesce: coalesce support information
  */
 struct wiphy {
 	/* assign these fields before you register the wiphy */
@@ -2697,6 +2747,7 @@ struct wiphy {
 	const struct iw_handler_def *wext;
 #endif
 
+	struct wiphy_coalesce_support coalesce;
 	char priv[0] __aligned(NETDEV_ALIGN);
 };
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 000dd1d..3a6bffe 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -648,6 +648,10 @@
  * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
  *	return back to normal.
  *
+ * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
+ *
+ * @NL80211_CMD_SET_COALESCE: Add new coalesce rule.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -810,6 +814,9 @@ enum nl80211_commands {
 	NL80211_CMD_CRIT_PROTOCOL_START,
 	NL80211_CMD_CRIT_PROTOCOL_STOP,
 
+	NL80211_CMD_GET_COALESCE,
+	NL80211_CMD_SET_COALESCE,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -1431,6 +1438,8 @@ enum nl80211_commands {
  * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
  *      the connection should have increased reliability (u16).
  *
+ * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1729,6 +1738,8 @@ enum nl80211_attrs {
 	NL80211_ATTR_CRIT_PROT_ID,
 	NL80211_ATTR_MAX_CRIT_PROT_DURATION,
 
+	NL80211_ATTR_COALESCE_RULE,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -3027,7 +3038,6 @@ enum nl80211_cqm_rssi_threshold_event {
 	NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
 };
 
-
 /**
  * enum nl80211_tx_power_setting - TX power adjustment
  * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
@@ -3079,8 +3089,10 @@ enum nl80211_packet_pattern_attr {
  * @max_pkt_offset: maximum Rx packet offset
  *
  * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
- * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
- * capability information given by the kernel to userspace.
+ * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
+ * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
+ * %NL80211_ATTR_COALESCE_RULE in the capability information given
+ * by the kernel to userspace.
  */
 struct nl80211_pattern_support {
 	__u32 max_patterns;
@@ -3290,6 +3302,41 @@ enum nl80211_wowlan_tcp_attrs {
 };
 
 /**
+ * struct nl80211_coalesce_rule_support - coalesce rule support information
+ * @max_rules: maximum number of rules supported
+ * @pat: packet pattern support information
+ *
+ * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
+ * capability information given by the kernel to userspace.
+ */
+struct nl80211_coalesce_rule_support {
+	__u32 max_rules;
+	struct nl80211_pattern_support pat;
+} __attribute__((packed));
+
+/**
+ * enum nl80211_attr_coalesce_rule - coalesce rule attribute
+ * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
+ * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
+ * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence.
+ *	i.e. pattern 'match' or 'no match'
+ * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
+ *	after these fixed number of bytes of received packet
+ * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
+ * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
+ */
+enum nl80211_attr_coalesce_rule {
+	__NL80211_COALESCE_RULE_INVALID,
+	NL80211_ATTR_COALESCE_RULE_DELAY,
+	NL80211_ATTR_COALESCE_RULE_CONDITION,
+	NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
+
+	/* keep last */
+	NUM_NL80211_ATTR_COALESCE_RULE,
+	NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
+};
+
+/**
  * enum nl80211_iface_limit_attrs - limit attributes
  * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
  * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
@@ -3569,6 +3616,9 @@ enum nl80211_ap_sme_features {
  *	Peering Management entity which may be implemented by registering for
  *	beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
  *	still generated by the driver.
+ * @NL80211_FEATURE_PACKET_COALESCE: This driver support packet coalescing
+ *	feature. Packets are buffered in firmware based on configured rules
+ *	to reduce unwanted packet or interrupt to host.
  */
 enum nl80211_feature_flags {
 	NL80211_FEATURE_SK_TX_STATUS			= 1 << 0,
@@ -3588,6 +3638,7 @@ enum nl80211_feature_flags {
 	NL80211_FEATURE_ADVERTISE_CHAN_LIMITS		= 1 << 14,
 	NL80211_FEATURE_FULL_AP_CLIENT_STATE		= 1 << 15,
 	NL80211_FEATURE_USERSPACE_MPM			= 1 << 16,
+	NL80211_FEATURE_PACKET_COALESCE			= 1 << 17,
 };
 
 /**
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 68f0c96..72a41da 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -737,6 +737,8 @@ void wiphy_unregister(struct wiphy *wiphy)
 	if (rdev->wowlan && rdev->ops->set_wakeup)
 		rdev_set_wakeup(rdev, false);
 	cfg80211_rdev_free_wowlan(rdev);
+
+	cfg80211_rdev_free_coalesce(rdev);
 }
 EXPORT_SYMBOL(wiphy_unregister);
 
diff --git a/net/wireless/core.h b/net/wireless/core.h
index fd35dae..a0feff6 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -91,6 +91,8 @@ struct cfg80211_registered_device {
 	/* netlink port which started critical protocol (0 means not started) */
 	u32 crit_proto_nlportid;
 
+	struct cfg80211_coalesce *coalesce;
+
 	/* must be last because of the way we do wiphy_priv(),
 	 * and it should at least be aligned to NETDEV_ALIGN */
 	struct wiphy wiphy __aligned(NETDEV_ALIGN);
@@ -119,6 +121,26 @@ cfg80211_rdev_free_wowlan(struct cfg80211_registered_device *rdev)
 	kfree(rdev->wowlan);
 }
 
+static inline void
+cfg80211_rdev_free_coalesce(struct cfg80211_registered_device *rdev)
+{
+	int i, j;
+	struct cfg80211_coalesce_rules *rule;
+
+	if (!rdev->coalesce)
+		return;
+
+	for (i = 0; i < rdev->coalesce->n_rules; i++) {
+		rule = rdev->coalesce->rules[i];
+		for (j = 0; j < rule->n_patterns; j++)
+			kfree(rule->patterns[j].mask);
+		kfree(rule->patterns);
+		kfree(rule);
+	}
+	kfree(rdev->coalesce->rules);
+	kfree(rdev->coalesce);
+}
+
 extern struct workqueue_struct *cfg80211_wq;
 extern struct mutex cfg80211_mutex;
 extern struct list_head cfg80211_rdev_list;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5f640de..8cfca0c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -432,6 +432,14 @@ nl80211_wowlan_tcp_policy[NUM_NL80211_WOWLAN_TCP] = {
 	[NL80211_WOWLAN_TCP_WAKE_MASK] = { .len = 1 },
 };
 
+/* policy for coalesce rule attributes */
+static const struct nla_policy
+nl80211_coalesce_policy[NUM_NL80211_ATTR_COALESCE_RULE] = {
+	[NL80211_ATTR_COALESCE_RULE_DELAY] = { .type = NLA_U32 },
+	[NL80211_ATTR_COALESCE_RULE_CONDITION] = { .type = NLA_U8 },
+	[NL80211_ATTR_COALESCE_RULE_PKT_PATTERN] = { .type = NLA_NESTED },
+};
+
 /* policy for GTK rekey offload attributes */
 static const struct nla_policy
 nl80211_rekey_policy[NUM_NL80211_REKEY_DATA] = {
@@ -1035,6 +1043,27 @@ static int nl80211_send_wowlan(struct sk_buff *msg,
 }
 #endif
 
+static int nl80211_send_coalesce(struct sk_buff *msg,
+				 struct cfg80211_registered_device *dev,
+				 bool large)
+{
+	struct nl80211_coalesce_rule_support rule;
+
+	if (!dev->wiphy.coalesce.n_patterns || !dev->wiphy.coalesce.n_rules)
+		return 0;
+
+	rule.max_rules = dev->wiphy.coalesce.n_rules;
+	rule.pat.max_patterns = dev->wiphy.coalesce.n_patterns;
+	rule.pat.min_pattern_len = dev->wiphy.coalesce.pattern_min_len;
+	rule.pat.max_pattern_len = dev->wiphy.coalesce.pattern_max_len;
+	rule.pat.max_pkt_offset = dev->wiphy.coalesce.max_pkt_offset;
+
+	if (nla_put(msg, NL80211_ATTR_COALESCE_RULE, sizeof(rule), &rule))
+		return -ENOBUFS;
+
+	return 0;
+}
+
 static int nl80211_send_band_rateinfo(struct sk_buff *msg,
 				      struct ieee80211_supported_band *sband)
 {
@@ -1546,6 +1575,12 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
 			    dev->wiphy.vht_capa_mod_mask))
 			goto nla_put_failure;
 
+		(*split_start)++;
+		break;
+	case 10:
+		if (nl80211_send_coalesce(msg, dev, split))
+			goto nla_put_failure;
+
 		/* done */
 		*split_start = 0;
 		break;
@@ -8007,6 +8042,221 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
 }
 #endif
 
+static int nl80211_send_coalesce_rules(struct sk_buff *msg,
+				       struct cfg80211_registered_device *rdev)
+{
+	struct nlattr *nl_pats, *nl_pat, *nl_rule, *nl_rules;
+	int i, j, pat_len;
+	struct cfg80211_coalesce_rules *rule;
+
+	if (!rdev->coalesce->n_rules)
+		return 0;
+
+	nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE);
+	if (!nl_rules)
+		return -ENOBUFS;
+
+	for (i = 0; i < rdev->coalesce->n_rules; i++) {
+		nl_rule = nla_nest_start(msg, i + 1);
+		if (!nl_rule)
+			return -ENOBUFS;
+
+		rule = rdev->coalesce->rules[i];
+		if (nla_put_u32(msg, NL80211_ATTR_COALESCE_RULE_DELAY,
+				rule->delay))
+			return -ENOBUFS;
+
+		if (nla_put_u8(msg, NL80211_ATTR_COALESCE_RULE_CONDITION,
+			       rule->condition))
+			return -ENOBUFS;
+
+		nl_pats = nla_nest_start(msg,
+				NL80211_ATTR_COALESCE_RULE_PKT_PATTERN);
+		if (!nl_pats)
+			return -ENOBUFS;
+
+		for (j = 0; j < rule->n_patterns; j++) {
+			nl_pat = nla_nest_start(msg, j + 1);
+			if (!nl_pat)
+				return -ENOBUFS;
+			pat_len = rule->patterns[j].pattern_len;
+			if (nla_put(msg, NL80211_PKTPAT_MASK,
+				    DIV_ROUND_UP(pat_len, 8),
+				    rule->patterns[j].mask) ||
+			    nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len,
+				    rule->patterns[j].pattern) ||
+			    nla_put_u32(msg, NL80211_PKTPAT_OFFSET,
+					rule->patterns[j].pkt_offset))
+				return -ENOBUFS;
+			nla_nest_end(msg, nl_pat);
+		}
+		nla_nest_end(msg, nl_pats);
+		nla_nest_end(msg, nl_rule);
+	}
+	nla_nest_end(msg, nl_rules);
+
+	return 0;
+}
+
+static int nl80211_get_coalesce(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct sk_buff *msg;
+	void *hdr;
+
+	if (!rdev->wiphy.coalesce.n_patterns || !rdev->wiphy.coalesce.n_rules)
+		return -EOPNOTSUPP;
+
+	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	if (!msg)
+		return -ENOMEM;
+
+	hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
+			     NL80211_CMD_GET_COALESCE);
+	if (!hdr)
+		goto nla_put_failure;
+
+	if (rdev->coalesce && nl80211_send_coalesce_rules(msg, rdev))
+		goto nla_put_failure;
+
+	genlmsg_end(msg, hdr);
+	return genlmsg_reply(msg, info);
+
+nla_put_failure:
+	nlmsg_free(msg);
+	return -ENOBUFS;
+}
+
+static int nl80211_set_coalesce(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct nlattr *tb[NUM_NL80211_ATTR_COALESCE_RULE];
+	struct wiphy_coalesce_support *coalesce = &rdev->wiphy.coalesce;
+	struct cfg80211_coalesce_rules new_rule = {};
+	struct cfg80211_coalesce_rules *nrule;
+	int err, i;
+
+	if (!(rdev->wiphy.features & NL80211_FEATURE_PACKET_COALESCE))
+		return -EOPNOTSUPP;
+	if (!rdev->ops->set_coalesce)
+		return -EOPNOTSUPP;
+
+	if (!info->attrs[NL80211_ATTR_COALESCE_RULE]) {
+		cfg80211_rdev_free_coalesce(rdev);
+		rdev->coalesce = NULL;
+		rdev->ops->set_coalesce(&rdev->wiphy, NULL);
+		return 0;
+	}
+
+	if (!rdev->coalesce) {
+		rdev->coalesce = kzalloc(sizeof(*rdev->coalesce), GFP_KERNEL);
+		rdev->coalesce->rules = kcalloc(coalesce->n_rules,
+						sizeof(void *), GFP_KERNEL);
+	}
+
+	if (rdev->coalesce->n_rules >= coalesce->n_rules)
+		return -EOPNOTSUPP;
+
+	err = nla_parse(tb, NL80211_ATTR_COALESCE_RULE_MAX,
+			nla_data(info->attrs[NL80211_ATTR_COALESCE_RULE]),
+			nla_len(info->attrs[NL80211_ATTR_COALESCE_RULE]),
+			nl80211_coalesce_policy);
+	if (err)
+		return err;
+
+	new_rule.delay = nla_get_u32(tb[NL80211_ATTR_COALESCE_RULE_DELAY]);
+	new_rule.condition =
+		nla_get_u8(tb[NL80211_ATTR_COALESCE_RULE_CONDITION]);
+
+	if (tb[NL80211_ATTR_COALESCE_RULE_PKT_PATTERN]) {
+		struct nlattr *pat;
+		int n_patterns = 0;
+		int rem, pat_len, mask_len, pkt_offset;
+		struct nlattr *pat_tb[NUM_NL80211_PKTPAT];
+
+		nla_for_each_nested(pat,
+				    tb[NL80211_ATTR_COALESCE_RULE_PKT_PATTERN],
+				    rem)
+			n_patterns++;
+		if (n_patterns > coalesce->n_patterns)
+			return -EINVAL;
+
+		new_rule.patterns = kcalloc(n_patterns,
+						sizeof(new_rule.patterns[0]),
+						GFP_KERNEL);
+		if (!new_rule.patterns)
+			return -ENOMEM;
+
+		new_rule.n_patterns = n_patterns;
+		i = 0;
+
+		nla_for_each_nested(pat,
+				    tb[NL80211_ATTR_COALESCE_RULE_PKT_PATTERN],
+				    rem) {
+			nla_parse(pat_tb, MAX_NL80211_PKTPAT, nla_data(pat),
+				  nla_len(pat), NULL);
+			err = -EINVAL;
+			if (!pat_tb[NL80211_PKTPAT_MASK] ||
+			    !pat_tb[NL80211_PKTPAT_PATTERN])
+				goto error;
+			pat_len = nla_len(pat_tb[NL80211_PKTPAT_PATTERN]);
+			mask_len = DIV_ROUND_UP(pat_len, 8);
+			if (nla_len(pat_tb[NL80211_PKTPAT_MASK]) !=
+			    mask_len)
+				goto error;
+			if (pat_len > coalesce->pattern_max_len ||
+			    pat_len < coalesce->pattern_min_len)
+				goto error;
+
+			if (!pat_tb[NL80211_PKTPAT_OFFSET])
+				pkt_offset = 0;
+			else
+				pkt_offset = nla_get_u32(
+					pat_tb[NL80211_PKTPAT_OFFSET]);
+			if (pkt_offset > coalesce->max_pkt_offset)
+				goto error;
+			new_rule.patterns[i].pkt_offset = pkt_offset;
+
+			new_rule.patterns[i].mask =
+				kmalloc(mask_len + pat_len, GFP_KERNEL);
+			if (!new_rule.patterns[i].mask) {
+				err = -ENOMEM;
+				goto error;
+			}
+			new_rule.patterns[i].pattern =
+				new_rule.patterns[i].mask + mask_len;
+			memcpy(new_rule.patterns[i].mask,
+			       nla_data(pat_tb[NL80211_PKTPAT_MASK]),
+			       mask_len);
+			new_rule.patterns[i].pattern_len = pat_len;
+			memcpy(new_rule.patterns[i].pattern,
+			       nla_data(pat_tb[NL80211_PKTPAT_PATTERN]),
+			       pat_len);
+			i++;
+		}
+	}
+
+	nrule = kmemdup(&new_rule, sizeof(new_rule), GFP_KERNEL);
+	if (!nrule) {
+		err = -ENOMEM;
+		goto error;
+	}
+
+	err = rdev->ops->set_coalesce(&rdev->wiphy, nrule);
+	if (err)
+		goto error;
+
+	rdev->coalesce->rules[rdev->coalesce->n_rules++] = nrule;
+
+	return 0;
+
+error:
+	for (i = 0; i < new_rule.n_patterns; i++)
+		kfree(new_rule.patterns[i].mask);
+	kfree(new_rule.patterns);
+	return err;
+}
+
 static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -9026,6 +9276,21 @@ static struct genl_ops nl80211_ops[] = {
 		.flags = GENL_ADMIN_PERM,
 		.internal_flags = NL80211_FLAG_NEED_WDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
+	},
+	{
+		.cmd = NL80211_CMD_GET_COALESCE,
+		.doit = nl80211_get_coalesce,
+		.policy = nl80211_policy,
+		.internal_flags = NL80211_FLAG_NEED_WIPHY |
+				  NL80211_FLAG_NEED_RTNL,
+	},
+	{
+		.cmd = NL80211_CMD_SET_COALESCE,
+		.doit = nl80211_set_coalesce,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+		.internal_flags = NL80211_FLAG_NEED_WIPHY |
+				  NL80211_FLAG_NEED_RTNL,
 	}
 };
 
-- 
1.8.0


^ permalink raw reply related

* [PATCH 2/2] iw: add coalesce support
From: Bing Zhao @ 2013-05-21  1:32 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, Luis R. Rodriguez, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho, Amitkumar Karwar, Bing Zhao
In-Reply-To: <1369099936-4954-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

User can add one coalesce rule at a time using 'iw coalesce add'
command. The settings can be cleared using 'iw coalesce disable'
command. 'iw coalesce show' displays current configuration.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 Makefile   |   2 +-
 coalesce.c | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 info.c     |  14 ++++
 3 files changed, 248 insertions(+), 1 deletion(-)
 create mode 100644 coalesce.c

diff --git a/Makefile b/Makefile
index c485b5e..f042e30 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ OBJS = iw.o genl.o event.o info.o phy.o \
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
 	reason.o status.o connect.o link.o offch.o ps.o cqm.o \
-	bitrate.o wowlan.o roc.o p2p.o
+	bitrate.o wowlan.o coalesce.o roc.o p2p.o
 OBJS += sections.o
 
 OBJS-$(HWSIM) += hwsim.o
diff --git a/coalesce.c b/coalesce.c
new file mode 100644
index 0000000..d5ab900
--- /dev/null
+++ b/coalesce.c
@@ -0,0 +1,233 @@
+#include <net/if.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <netlink/genl/genl.h>
+#include <netlink/genl/family.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/msg.h>
+#include <netlink/attr.h>
+
+#include <arpa/inet.h>
+
+#include "nl80211.h"
+#include "iw.h"
+
+SECTION(coalesce);
+
+static int handle_coalesce_add(struct nl80211_state *state, struct nl_cb *cb,
+			       struct nl_msg *msg, int argc, char **argv,
+			       enum id_input id)
+{
+	struct nlattr *coalesce, *pattern;
+	struct nl_msg *patterns = NULL;
+	enum {
+		PS_REG,
+		PS_PAT,
+	} parse_state = PS_REG;
+	int err = -ENOBUFS;
+	unsigned char *pat, *mask;
+	size_t patlen;
+	int patnum = 0, pkt_offset;
+	char *eptr, *value1, *value2, *sptr = NULL, *end;
+	unsigned int condition;
+
+	coalesce = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE);
+	if (!coalesce)
+		return -ENOBUFS;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_COALESCE_RULE_DELAY,
+		    strtoul(argv[0], &end, 10));
+	if (*end != '\0')
+		return 1;
+
+	argv++;
+	argc--;
+
+	condition = strtoul(argv[0], &end, 10);
+
+	if (condition != 1 && condition != 0)
+		return 1;
+
+	if (*end)
+		return 1;
+
+	NLA_PUT_U8(msg, NL80211_ATTR_COALESCE_RULE_CONDITION, condition);
+
+	argv++;
+	argc--;
+
+	while (argc) {
+		switch (parse_state) {
+		case PS_REG:
+			if (strcmp(argv[0], "patterns") == 0) {
+				parse_state = PS_PAT;
+				patterns = nlmsg_alloc();
+				if (!patterns) {
+					err = -ENOMEM;
+					goto nla_put_failure;
+				}
+			} else {
+				err = 1;
+				goto nla_put_failure;
+			}
+			break;
+		case PS_PAT:
+			value1 = strtok_r(argv[0], "+", &sptr);
+			value2 = strtok_r(NULL, "+", &sptr);
+
+			if (!value2) {
+				pkt_offset = 0;
+				value2 = value1;
+			} else {
+				pkt_offset = strtoul(value1, &eptr, 10);
+				if (eptr != value1 + strlen(value1)) {
+					err = 1;
+					goto nla_put_failure;
+				}
+			}
+
+			if (parse_hex_mask(value2, &pat, &patlen, &mask)) {
+				err = 1;
+				goto nla_put_failure;
+			}
+
+			pattern = nla_nest_start(patterns, ++patnum);
+			NLA_PUT(patterns, NL80211_PKTPAT_MASK,
+				DIV_ROUND_UP(patlen, 8), mask);
+			NLA_PUT(patterns, NL80211_PKTPAT_PATTERN, patlen, pat);
+			NLA_PUT_U32(patterns, NL80211_PKTPAT_OFFSET,
+				    pkt_offset);
+			nla_nest_end(patterns, pattern);
+			free(mask);
+			free(pat);
+			break;
+		}
+		argv++;
+		argc--;
+	}
+
+	if (patterns)
+		nla_put_nested(msg, NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
+			       patterns);
+
+	nla_nest_end(msg, coalesce);
+	err = 0;
+ nla_put_failure:
+	nlmsg_free(patterns);
+	return err;
+}
+COMMAND(coalesce, add, "<delay> <0|1> patterns [offset1+]<pattern1> ...]",
+	NL80211_CMD_SET_COALESCE, 0, CIB_PHY, handle_coalesce_add,
+	"Add coalesce rule.\n"
+	"Maximum coalescing delay in msec.\n"
+	"Condition is 0/1 i.e. 'not match'/'match' the patterns\n"
+	"Each pattern is given as a bytestring with '-' in places where any byte\n"
+	"may be present, e.g. 00:11:22:-:44 will match 00:11:22:33:44 and\n"
+	"00:11:22:33:ff:44 etc.\n"
+	"Offset and pattern should be separated by '+', e.g. 18+43:34:00:12 will match "
+	"'43:34:00:12' after 18 bytes of offset in Rx packet.\n\n");
+
+
+static int
+handle_coalesce_disable(struct nl80211_state *state, struct nl_cb *cb,
+			struct nl_msg *msg, int argc, char **argv,
+			enum id_input id)
+{
+	/* just a set w/o coalesce attribute */
+	return 0;
+}
+COMMAND(coalesce, disable, "", NL80211_CMD_SET_COALESCE, 0, CIB_PHY,
+	handle_coalesce_disable, "Disable coalesce.");
+
+static int print_coalesce_handler(struct nl_msg *msg, void *arg)
+{
+	struct nlattr *attrs[NL80211_ATTR_MAX + 1];
+	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+	struct nlattr *pattern, *rule;
+	int rem_pattern, rem_rule;
+	bool condition;
+	int delay;
+
+	nla_parse(attrs, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+		  genlmsg_attrlen(gnlh, 0), NULL);
+
+	if (!attrs[NL80211_ATTR_COALESCE_RULE]) {
+		printf("Coalesce is disabled.\n");
+		return NL_SKIP;
+	}
+
+	printf("Coalesce is enabled:\n");
+
+	nla_for_each_nested(rule, attrs[NL80211_ATTR_COALESCE_RULE], rem_rule) {
+		struct nlattr *ruleattr[NUM_NL80211_ATTR_COALESCE_RULE];
+
+		nla_parse(ruleattr, NL80211_ATTR_COALESCE_RULE_MAX,
+			  nla_data(rule), nla_len(rule), NULL);
+
+		delay = nla_get_u32(ruleattr[NL80211_ATTR_COALESCE_RULE_DELAY]);
+		condition =
+		     nla_get_u8(ruleattr[NL80211_ATTR_COALESCE_RULE_CONDITION]);
+
+		printf("Rule - max coalescing delay: %dmsec condition:", delay);
+		if (condition)
+			printf("match\n");
+		else
+			printf("not match\n");
+
+		if (ruleattr[NL80211_ATTR_COALESCE_RULE_PKT_PATTERN]) {
+			nla_for_each_nested(pattern,
+					ruleattr[NL80211_ATTR_COALESCE_RULE_PKT_PATTERN],
+					rem_pattern) {
+				struct nlattr *patattr[NUM_NL80211_PKTPAT];
+				int i, patlen, masklen, pkt_offset;
+				uint8_t *mask, *pat;
+
+				nla_parse(patattr, MAX_NL80211_PKTPAT,
+					  nla_data(pattern), nla_len(pattern),
+					  NULL);
+				if (!patattr[NL80211_PKTPAT_MASK] ||
+				    !patattr[NL80211_PKTPAT_PATTERN] ||
+				    !patattr[NL80211_PKTPAT_OFFSET]) {
+					printf(" * (invalid pattern specification)\n");
+					continue;
+				}
+				masklen = nla_len(patattr[NL80211_PKTPAT_MASK]);
+				patlen = nla_len(patattr[NL80211_PKTPAT_PATTERN]);
+				pkt_offset = nla_get_u32(patattr[NL80211_PKTPAT_OFFSET]);
+				if (DIV_ROUND_UP(patlen, 8) != masklen) {
+					printf(" * (invalid pattern specification)\n");
+					continue;
+				}
+				printf(" * packet offset: %d", pkt_offset);
+				printf(" pattern: ");
+				pat = nla_data(patattr[NL80211_PKTPAT_PATTERN]);
+				mask = nla_data(patattr[NL80211_PKTPAT_MASK]);
+				for (i = 0; i < patlen; i++) {
+					if (mask[i / 8] & (1 << (i % 8)))
+						printf("%.2x", pat[i]);
+					else
+						printf("--");
+					if (i != patlen - 1)
+						printf(":");
+				}
+				printf("\n");
+			}
+		}
+	}
+
+	return NL_SKIP;
+}
+
+static int handle_coalesce_show(struct nl80211_state *state, struct nl_cb *cb,
+			      struct nl_msg *msg, int argc, char **argv,
+			      enum id_input id)
+{
+	nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
+		  print_coalesce_handler, NULL);
+
+	return 0;
+}
+COMMAND(coalesce, show, "", NL80211_CMD_GET_COALESCE, 0, CIB_PHY, handle_coalesce_show,
+	"Show coalesce status.");
diff --git a/info.c b/info.c
index d893ffc..849da67 100644
--- a/info.c
+++ b/info.c
@@ -528,6 +528,20 @@ broken_combination:
 			printf("\tDevice supports AP scan.\n");
 	}
 
+	if (tb_msg[NL80211_ATTR_COALESCE_RULE]) {
+		struct nl80211_coalesce_rule_support *rule;
+		struct nl80211_pattern_support *pat;
+
+		printf("\tCoalesce support:\n");
+		rule = nla_data(tb_msg[NL80211_ATTR_COALESCE_RULE]);
+		pat = &rule->pat;
+		printf("\t\t * Maximum %u coalesce rules supported\n"
+		       "\t\t * Each rule contains upto %u patterns of %u-%u bytes,\n"
+		       "\t\t   maximum packet offset %u bytes\n",
+			rule->max_rules, pat->max_patterns, pat->min_pattern_len,
+			pat->max_pattern_len, pat->max_pkt_offset);
+	}
+
 	return NL_SKIP;
 }
 
-- 
1.8.0


^ permalink raw reply related

* [PATCH 1/2] iw: use updated structures and enums for packet pattern
From: Bing Zhao @ 2013-05-21  1:32 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, Luis R. Rodriguez, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho, Amitkumar Karwar, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

They are renamed so that they can be used for new feature.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 info.c   |  2 +-
 wowlan.c | 32 ++++++++++++++++----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/info.c b/info.c
index 54d9a8d..d893ffc 100644
--- a/info.c
+++ b/info.c
@@ -432,7 +432,7 @@ broken_combination:
 			[NL80211_WOWLAN_TRIG_RFKILL_RELEASE] = { .type = NLA_FLAG },
 			[NL80211_WOWLAN_TRIG_TCP_CONNECTION] = { .type = NLA_NESTED },
 		};
-		struct nl80211_wowlan_pattern_support *pat;
+		struct nl80211_pattern_support *pat;
 		int err;
 
 		err = nla_parse_nested(tb_wowlan, MAX_NL80211_WOWLAN_TRIG,
diff --git a/wowlan.c b/wowlan.c
index b4a2715..d323ca7 100644
--- a/wowlan.c
+++ b/wowlan.c
@@ -261,11 +261,11 @@ static int handle_wowlan_enable(struct nl80211_state *state, struct nl_cb *cb,
 			}
 
 			pattern = nla_nest_start(patterns, ++patnum);
-			NLA_PUT(patterns, NL80211_WOWLAN_PKTPAT_MASK,
+			NLA_PUT(patterns, NL80211_PKTPAT_MASK,
 				DIV_ROUND_UP(patlen, 8), mask);
-			NLA_PUT(patterns, NL80211_WOWLAN_PKTPAT_PATTERN,
-				patlen, pat);
-			NLA_PUT_U32(patterns, NL80211_WOWLAN_PKTPAT_OFFSET, pkt_offset);
+			NLA_PUT(patterns, NL80211_PKTPAT_PATTERN, patlen, pat);
+			NLA_PUT_U32(patterns, NL80211_PKTPAT_OFFSET,
+				    pkt_offset);
 			nla_nest_end(patterns, pattern);
 			free(mask);
 			free(pat);
@@ -356,29 +356,29 @@ static int print_wowlan_handler(struct nl_msg *msg, void *arg)
 		nla_for_each_nested(pattern,
 				    trig[NL80211_WOWLAN_TRIG_PKT_PATTERN],
 				    rem_pattern) {
-			struct nlattr *patattr[NUM_NL80211_WOWLAN_PKTPAT];
+			struct nlattr *patattr[NUM_NL80211_PKTPAT];
 			int i, patlen, masklen, pkt_offset;
 			uint8_t *mask, *pat;
-			nla_parse(patattr, MAX_NL80211_WOWLAN_PKTPAT,
-				  nla_data(pattern), nla_len(pattern),
-				  NULL);
-			if (!patattr[NL80211_WOWLAN_PKTPAT_MASK] ||
-			    !patattr[NL80211_WOWLAN_PKTPAT_PATTERN] ||
-			    !patattr[NL80211_WOWLAN_PKTPAT_OFFSET]) {
+			nla_parse(patattr, MAX_NL80211_PKTPAT,
+				  nla_data(pattern), nla_len(pattern), NULL);
+			if (!patattr[NL80211_PKTPAT_MASK] ||
+			    !patattr[NL80211_PKTPAT_PATTERN] ||
+			    !patattr[NL80211_PKTPAT_OFFSET]) {
 				printf(" * (invalid pattern specification)\n");
 				continue;
 			}
-			masklen = nla_len(patattr[NL80211_WOWLAN_PKTPAT_MASK]);
-			patlen = nla_len(patattr[NL80211_WOWLAN_PKTPAT_PATTERN]);
-			pkt_offset = nla_get_u32(patattr[NL80211_WOWLAN_PKTPAT_OFFSET]);
+			masklen = nla_len(patattr[NL80211_PKTPAT_MASK]);
+			patlen = nla_len(patattr[NL80211_PKTPAT_PATTERN]);
+			pkt_offset =
+				nla_get_u32(patattr[NL80211_PKTPAT_OFFSET]);
 			if (DIV_ROUND_UP(patlen, 8) != masklen) {
 				printf(" * (invalid pattern specification)\n");
 				continue;
 			}
 			printf(" * wake up on packet offset: %d", pkt_offset);
 			printf(" pattern: ");
-			pat = nla_data(patattr[NL80211_WOWLAN_PKTPAT_PATTERN]);
-			mask = nla_data(patattr[NL80211_WOWLAN_PKTPAT_MASK]);
+			pat = nla_data(patattr[NL80211_PKTPAT_PATTERN]);
+			mask = nla_data(patattr[NL80211_PKTPAT_MASK]);
 			for (i = 0; i < patlen; i++) {
 				if (mask[i / 8] & (1 << (i % 8)))
 					printf("%.2x", pat[i]);
-- 
1.8.0


^ permalink raw reply related

* [PATCH 1/2] cfg80211/nl80211: rename packet pattern related structures and enums
From: Bing Zhao @ 2013-05-21  1:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, Luis R. Rodriguez, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho, Amitkumar Karwar, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

Packet patterns provided by user are matched with received packets
for WoWLAN feature. Rename these structures and enums so that they
will be available for new feature.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/ath/ath9k/main.c   |  2 +-
 drivers/net/wireless/mwifiex/cfg80211.c |  3 +--
 drivers/net/wireless/ti/wlcore/main.c   | 10 ++++-----
 include/net/cfg80211.h                  |  6 +++---
 include/uapi/linux/nl80211.h            | 36 ++++++++++++++++-----------------
 net/wireless/nl80211.c                  | 34 +++++++++++++++----------------
 6 files changed, 44 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6963862..57e290e 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2123,7 +2123,7 @@ static void ath9k_wow_add_pattern(struct ath_softc *sc,
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath9k_wow_pattern *wow_pattern = NULL;
-	struct cfg80211_wowlan_trig_pkt_pattern *patterns = wowlan->patterns;
+	struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
 	int mask_len;
 	s8 i = 0;
 
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index d3c8ece..7a06f51 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2250,8 +2250,7 @@ EXPORT_SYMBOL_GPL(mwifiex_del_virtual_intf);
 
 #ifdef CONFIG_PM
 static bool
-mwifiex_is_pattern_supported(struct cfg80211_wowlan_trig_pkt_pattern *pat,
-			     s8 *byte_seq)
+mwifiex_is_pattern_supported(struct cfg80211_pkt_pattern *pat, s8 *byte_seq)
 {
 	int j, k, valid_byte_cnt = 0;
 	bool dont_care_byte = false;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 953111a..db3653f 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1328,7 +1328,7 @@ static struct sk_buff *wl12xx_alloc_dummy_packet(struct wl1271 *wl)
 
 #ifdef CONFIG_PM
 static int
-wl1271_validate_wowlan_pattern(struct cfg80211_wowlan_trig_pkt_pattern *p)
+wl1271_validate_wowlan_pattern(struct cfg80211_pkt_pattern *p)
 {
 	int num_fields = 0, in_field = 0, fields_size = 0;
 	int i, pattern_len = 0;
@@ -1471,9 +1471,9 @@ void wl1271_rx_filter_flatten_fields(struct wl12xx_rx_filter *filter,
  * Allocates an RX filter returned through f
  * which needs to be freed using rx_filter_free()
  */
-static int wl1271_convert_wowlan_pattern_to_rx_filter(
-	struct cfg80211_wowlan_trig_pkt_pattern *p,
-	struct wl12xx_rx_filter **f)
+static int
+wl1271_convert_wowlan_pattern_to_rx_filter(struct cfg80211_pkt_pattern *p,
+					   struct wl12xx_rx_filter **f)
 {
 	int i, j, ret = 0;
 	struct wl12xx_rx_filter *filter;
@@ -1575,7 +1575,7 @@ static int wl1271_configure_wowlan(struct wl1271 *wl,
 
 	/* Translate WoWLAN patterns into filters */
 	for (i = 0; i < wow->n_patterns; i++) {
-		struct cfg80211_wowlan_trig_pkt_pattern *p;
+		struct cfg80211_pkt_pattern *p;
 		struct wl12xx_rx_filter *filter = NULL;
 
 		p = &wow->patterns[i];
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 32a2f1b..4585b63 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1661,7 +1661,7 @@ struct cfg80211_pmksa {
 };
 
 /**
- * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern
+ * struct cfg80211_pkt_pattern - packet pattern
  * @mask: bitmask where to match pattern and where to ignore bytes,
  *	one bit per byte, in same format as nl80211
  * @pattern: bytes to match where bitmask is 1
@@ -1671,7 +1671,7 @@ struct cfg80211_pmksa {
  * Internal note: @mask and @pattern are allocated in one chunk of
  * memory, free @mask only!
  */
-struct cfg80211_wowlan_trig_pkt_pattern {
+struct cfg80211_pkt_pattern {
 	u8 *mask, *pattern;
 	int pattern_len;
 	int pkt_offset;
@@ -1733,7 +1733,7 @@ struct cfg80211_wowlan {
 	bool any, disconnect, magic_pkt, gtk_rekey_failure,
 	     eap_identity_req, four_way_handshake,
 	     rfkill_release;
-	struct cfg80211_wowlan_trig_pkt_pattern *patterns;
+	struct cfg80211_pkt_pattern *patterns;
 	struct cfg80211_wowlan_tcp *tcp;
 	int n_patterns;
 };
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 0632071..000dd1d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3041,11 +3041,11 @@ enum nl80211_tx_power_setting {
 };
 
 /**
- * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute
- * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute
- * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has
+ * enum nl80211_packet_pattern_attr - packet pattern attribute
+ * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
+ * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
  *	a zero bit are ignored
- * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have
+ * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
  *	a bit for each byte in the pattern. The lowest-order bit corresponds
  *	to the first byte of the pattern, but the bytes of the pattern are
  *	in a little-endian-like format, i.e. the 9th byte of the pattern
@@ -3056,23 +3056,23 @@ enum nl80211_tx_power_setting {
  *	Note that the pattern matching is done as though frames were not
  *	802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
  *	first (including SNAP header unpacking) and then matched.
- * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after
+ * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
  *	these fixed number of bytes of received packet
- * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
- * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
+ * @NUM_NL80211_PKTPAT: number of attributes
+ * @MAX_NL80211_PKTPAT: max attribute number
  */
-enum nl80211_wowlan_packet_pattern_attr {
-	__NL80211_WOWLAN_PKTPAT_INVALID,
-	NL80211_WOWLAN_PKTPAT_MASK,
-	NL80211_WOWLAN_PKTPAT_PATTERN,
-	NL80211_WOWLAN_PKTPAT_OFFSET,
+enum nl80211_packet_pattern_attr {
+	__NL80211_PKTPAT_INVALID,
+	NL80211_PKTPAT_MASK,
+	NL80211_PKTPAT_PATTERN,
+	NL80211_PKTPAT_OFFSET,
 
-	NUM_NL80211_WOWLAN_PKTPAT,
-	MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
+	NUM_NL80211_PKTPAT,
+	MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
 };
 
 /**
- * struct nl80211_wowlan_pattern_support - pattern support information
+ * struct nl80211_pattern_support - packet pattern support information
  * @max_patterns: maximum number of patterns supported
  * @min_pattern_len: minimum length of each pattern
  * @max_pattern_len: maximum length of each pattern
@@ -3082,7 +3082,7 @@ enum nl80211_wowlan_packet_pattern_attr {
  * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
  * capability information given by the kernel to userspace.
  */
-struct nl80211_wowlan_pattern_support {
+struct nl80211_pattern_support {
 	__u32 max_patterns;
 	__u32 min_pattern_len;
 	__u32 max_pattern_len;
@@ -3108,7 +3108,7 @@ struct nl80211_wowlan_pattern_support {
  *	pattern matching is done after the packet is converted to the MSDU.
  *
  *	In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
- *	carrying a &struct nl80211_wowlan_pattern_support.
+ *	carrying a &struct nl80211_pattern_support.
  *
  *	When reporting wakeup. it is a u32 attribute containing the 0-based
  *	index of the pattern that caused the wakeup, in the patterns passed
@@ -3265,7 +3265,7 @@ struct nl80211_wowlan_tcp_data_token_feature {
  * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
  *	u32 attribute holding the maximum length
  * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
- *	feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK
+ *	feature advertising. The mask works like @NL80211_PKTPAT_MASK
  *	but on the TCP payload only.
  * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
  * @MAX_NL80211_WOWLAN_TCP: highest attribute number
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5f10f7a..5f640de 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1014,7 +1014,7 @@ static int nl80211_send_wowlan(struct sk_buff *msg,
 		return -ENOBUFS;
 
 	if (dev->wiphy.wowlan.n_patterns) {
-		struct nl80211_wowlan_pattern_support pat = {
+		struct nl80211_pattern_support pat = {
 			.max_patterns = dev->wiphy.wowlan.n_patterns,
 			.min_pattern_len = dev->wiphy.wowlan.pattern_min_len,
 			.max_pattern_len = dev->wiphy.wowlan.pattern_max_len,
@@ -7570,12 +7570,11 @@ static int nl80211_send_wowlan_patterns(struct sk_buff *msg,
 		if (!nl_pat)
 			return -ENOBUFS;
 		pat_len = rdev->wowlan->patterns[i].pattern_len;
-		if (nla_put(msg, NL80211_WOWLAN_PKTPAT_MASK,
-			    DIV_ROUND_UP(pat_len, 8),
+		if (nla_put(msg, NL80211_PKTPAT_MASK, DIV_ROUND_UP(pat_len, 8),
 			    rdev->wowlan->patterns[i].mask) ||
-		    nla_put(msg, NL80211_WOWLAN_PKTPAT_PATTERN,
-			    pat_len, rdev->wowlan->patterns[i].pattern) ||
-		    nla_put_u32(msg, NL80211_WOWLAN_PKTPAT_OFFSET,
+		    nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len,
+			    rdev->wowlan->patterns[i].pattern) ||
+		    nla_put_u32(msg, NL80211_PKTPAT_OFFSET,
 				rdev->wowlan->patterns[i].pkt_offset))
 			return -ENOBUFS;
 		nla_nest_end(msg, nl_pat);
@@ -7915,7 +7914,7 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
 		struct nlattr *pat;
 		int n_patterns = 0;
 		int rem, pat_len, mask_len, pkt_offset;
-		struct nlattr *pat_tb[NUM_NL80211_WOWLAN_PKTPAT];
+		struct nlattr *pat_tb[NUM_NL80211_PKTPAT];
 
 		nla_for_each_nested(pat, tb[NL80211_WOWLAN_TRIG_PKT_PATTERN],
 				    rem)
@@ -7934,26 +7933,25 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
 
 		nla_for_each_nested(pat, tb[NL80211_WOWLAN_TRIG_PKT_PATTERN],
 				    rem) {
-			nla_parse(pat_tb, MAX_NL80211_WOWLAN_PKTPAT,
-				  nla_data(pat), nla_len(pat), NULL);
+			nla_parse(pat_tb, MAX_NL80211_PKTPAT, nla_data(pat),
+				  nla_len(pat), NULL);
 			err = -EINVAL;
-			if (!pat_tb[NL80211_WOWLAN_PKTPAT_MASK] ||
-			    !pat_tb[NL80211_WOWLAN_PKTPAT_PATTERN])
+			if (!pat_tb[NL80211_PKTPAT_MASK] ||
+			    !pat_tb[NL80211_PKTPAT_PATTERN])
 				goto error;
-			pat_len = nla_len(pat_tb[NL80211_WOWLAN_PKTPAT_PATTERN]);
+			pat_len = nla_len(pat_tb[NL80211_PKTPAT_PATTERN]);
 			mask_len = DIV_ROUND_UP(pat_len, 8);
-			if (nla_len(pat_tb[NL80211_WOWLAN_PKTPAT_MASK]) !=
-			    mask_len)
+			if (nla_len(pat_tb[NL80211_PKTPAT_MASK]) != mask_len)
 				goto error;
 			if (pat_len > wowlan->pattern_max_len ||
 			    pat_len < wowlan->pattern_min_len)
 				goto error;
 
-			if (!pat_tb[NL80211_WOWLAN_PKTPAT_OFFSET])
+			if (!pat_tb[NL80211_PKTPAT_OFFSET])
 				pkt_offset = 0;
 			else
 				pkt_offset = nla_get_u32(
-					pat_tb[NL80211_WOWLAN_PKTPAT_OFFSET]);
+					pat_tb[NL80211_PKTPAT_OFFSET]);
 			if (pkt_offset > wowlan->max_pkt_offset)
 				goto error;
 			new_triggers.patterns[i].pkt_offset = pkt_offset;
@@ -7967,11 +7965,11 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
 			new_triggers.patterns[i].pattern =
 				new_triggers.patterns[i].mask + mask_len;
 			memcpy(new_triggers.patterns[i].mask,
-			       nla_data(pat_tb[NL80211_WOWLAN_PKTPAT_MASK]),
+			       nla_data(pat_tb[NL80211_PKTPAT_MASK]),
 			       mask_len);
 			new_triggers.patterns[i].pattern_len = pat_len;
 			memcpy(new_triggers.patterns[i].pattern,
-			       nla_data(pat_tb[NL80211_WOWLAN_PKTPAT_PATTERN]),
+			       nla_data(pat_tb[NL80211_PKTPAT_PATTERN]),
 			       pat_len);
 			i++;
 		}
-- 
1.8.0


^ permalink raw reply related

* Re: Build problem with current git repo
From: Luis R. Rodriguez @ 2013-05-21  2:16 UTC (permalink / raw)
  To: Larry Finger; +Cc: backports@vger.kernel.org, linux-wireless
In-Reply-To: <519AB89E.1080001@lwfinger.net>

On Mon, May 20, 2013 at 4:58 PM, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> Pulling from the git repo today and trying to do a 'make menuconfig' results
> in the following error:
>
> finger@larrylap:~/backports/backport> make menuconfig

The new backports project requires you to run for example:

./gentree.py ~/linux-next/ ~/build/backports-20130520

Then you cd into ~/build/backports-20130520 and build there. Try that
with linux-next next-20130520. Note that gentree.py also accepts
--git-revision but in practice for me its faster to reset a tree than
to use that which walks the tree.

  Luis

^ permalink raw reply

* [PATCH 14/19] drivers/net/wireless/brcm80211/brcmfmac: add missing platform_driver owner
From: Libo Chen @ 2013-05-21  2:42 UTC (permalink / raw)
  To: brudley, arend, frankyl, meuleman, linville
  Cc: davem, linux-wireless, brcm80211-dev-list, netdev, linux-kernel,
	lizefan, libo.chen

set the owner of platform_driver, to ensure that the
caller of driver holds a module refernece

Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
 .../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 44fa0cd..11400b3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -606,7 +606,8 @@ static int brcmf_sdio_pd_remove(struct platform_device *pdev)
 static struct platform_driver brcmf_sdio_pd = {
 	.remove		= brcmf_sdio_pd_remove,
 	.driver		= {
-		.name	= BRCMFMAC_SDIO_PDATA_NAME
+		.name	= BRCMFMAC_SDIO_PDATA_NAME,
+		.owner	= THIS_MODULE,
 	}
 };
 
-- 
1.7.1



^ permalink raw reply related

* [RFC PATCH] net/wireless/mwifiex/pcie: Convert to dev_pm_ops from legacy pm ops
From: Shuah Khan @ 2013-05-21  2:33 UTC (permalink / raw)
  To: bzhao@marvell.com, linville@tuxdriver.com,
	rafael.j.wysocki@intel.com
  Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, shuahkhan@gmail.com, Shuah Khan

Q29udmVydCB0aGUgZHJpdmVyIHRvIHVzZSBkZXZfcG1fb3BzIGZvciBwb3dlciBtYW5hZ2VtZW50
IGFuZCByZW1vdmUgTGVnYWN5IFBNDQpoYW5kbGluZy4gVGhpcyBjaGFuZ2UgcmUtdXNlcyBleGlz
dGluZyBzdXNwZW5kIGFuZCByZXN1bWUgaW50ZXJmYWNlcyBmb3IgDQpkZXZfcG1fb3BzLg0KDQpT
aWduZWQtb2ZmLWJ5OiBTaHVhaCBLaGFuIDxzaHVhaC5raEBzYW1zdW5nLmNvbT4NCkNjOiBTaHVh
aCBLaGFuIDxzaHVhaGtoYW5AZ21haWwuY29tPg0KU3VnZ2VzdGVkLWJ5OiByYWZhZWwuai53eXNv
Y2tpQGludGVsLmNvbQ0KLS0tDQoNClJhZmFlbCwNCg0KVGhpcyBpcyB0aGUgZmlyc3QgZHJpdmVy
IHBhdGNoIHRvIGNvbnZlcnQgZHJpdmVycyB0byB1c2UgZGV2X3BtX29wcyBmb3INCnBvd2VyIG1h
bmFnZW1lbnQuIFBsZWFzZSByZXZpZXcgZm9yIHRoZSBhcHByb2FjaCBhbmQgbWFrZSBzdWdnZXN0
aW9ucyBmb3INCmltcHJvdmVtZW50Lg0KDQp0aGFua3MsDQotLSBTaHVhaA0KDQogZHJpdmVycy9u
ZXQvd2lyZWxlc3MvbXdpZmlleC9wY2llLmMgfCAgIDMzICsrKysrKysrKysrKysrKysrKysrKysr
KysrKy0tLS0tLQ0KIDEgZmlsZSBjaGFuZ2VkLCAyNyBpbnNlcnRpb25zKCspLCA2IGRlbGV0aW9u
cygtKQ0KDQpkaWZmIC0tZ2l0IGEvZHJpdmVycy9uZXQvd2lyZWxlc3MvbXdpZmlleC9wY2llLmMg
Yi9kcml2ZXJzL25ldC93aXJlbGVzcy9td2lmaWV4L3BjaWUuYw0KaW5kZXggMjBjOWM0Yy4uYTI3
MWM2NCAxMDA2NDQNCi0tLSBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL213aWZpZXgvcGNpZS5jDQor
KysgYi9kcml2ZXJzL25ldC93aXJlbGVzcy9td2lmaWV4L3BjaWUuYw0KQEAgLTg1LDcgKzg1LDcg
QEAgc3RhdGljIGJvb2wgbXdpZmlleF9wY2llX29rX3RvX2FjY2Vzc19odyhzdHJ1Y3QgbXdpZmll
eF9hZGFwdGVyICphZGFwdGVyKQ0KICAqIElmIGFscmVhZHkgbm90IHN1c3BlbmRlZCwgdGhpcyBm
dW5jdGlvbiBhbGxvY2F0ZXMgYW5kIHNlbmRzIGEgaG9zdA0KICAqIHNsZWVwIGFjdGl2YXRlIHJl
cXVlc3QgdG8gdGhlIGZpcm13YXJlIGFuZCB0dXJucyBvZmYgdGhlIHRyYWZmaWMuDQogICovDQot
c3RhdGljIGludCBtd2lmaWV4X3BjaWVfc3VzcGVuZChzdHJ1Y3QgcGNpX2RldiAqcGRldiwgcG1f
bWVzc2FnZV90IHN0YXRlKQ0KK3N0YXRpYyBpbnQgX19td2lmaWV4X3BjaWVfc3VzcGVuZChzdHJ1
Y3QgcGNpX2RldiAqcGRldikNCiB7DQogCXN0cnVjdCBtd2lmaWV4X2FkYXB0ZXIgKmFkYXB0ZXI7
DQogCXN0cnVjdCBwY2llX3NlcnZpY2VfY2FyZCAqY2FyZDsNCkBAIC0xMTIsNiArMTEyLDEzIEBA
IHN0YXRpYyBpbnQgbXdpZmlleF9wY2llX3N1c3BlbmQoc3RydWN0IHBjaV9kZXYgKnBkZXYsIHBt
X21lc3NhZ2VfdCBzdGF0ZSkNCiAJcmV0dXJuIDA7DQogfQ0KIA0KK3N0YXRpYyBpbnQgbXdpZmll
eF9wY2llX3N1c3BlbmQoc3RydWN0IGRldmljZSAqZGV2KQ0KK3sNCisJc3RydWN0IHBjaV9kZXYg
KnBkZXYgPSB0b19wY2lfZGV2KGRldik7DQorDQorCXJldHVybiBfX213aWZpZXhfcGNpZV9zdXNw
ZW5kKHBkZXYpOw0KK30NCisNCiAvKg0KICAqIEtlcm5lbCBuZWVkcyB0byBzdXNwZW5kIGFsbCBm
dW5jdGlvbnMgc2VwYXJhdGVseS4gVGhlcmVmb3JlIGFsbA0KICAqIHJlZ2lzdGVyZWQgZnVuY3Rp
b25zIG11c3QgaGF2ZSBkcml2ZXJzIHdpdGggc3VzcGVuZCBhbmQgcmVzdW1lDQpAQCAtMTIwLDcg
KzEyNyw3IEBAIHN0YXRpYyBpbnQgbXdpZmlleF9wY2llX3N1c3BlbmQoc3RydWN0IHBjaV9kZXYg
KnBkZXYsIHBtX21lc3NhZ2VfdCBzdGF0ZSkNCiAgKiBJZiBhbHJlYWR5IG5vdCByZXN1bWVkLCB0
aGlzIGZ1bmN0aW9uIHR1cm5zIG9uIHRoZSB0cmFmZmljIGFuZA0KICAqIHNlbmRzIGEgaG9zdCBz
bGVlcCBjYW5jZWwgcmVxdWVzdCB0byB0aGUgZmlybXdhcmUuDQogICovDQotc3RhdGljIGludCBt
d2lmaWV4X3BjaWVfcmVzdW1lKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KK3N0YXRpYyBpbnQgX19t
d2lmaWV4X3BjaWVfcmVzdW1lKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KIHsNCiAJc3RydWN0IG13
aWZpZXhfYWRhcHRlciAqYWRhcHRlcjsNCiAJc3RydWN0IHBjaWVfc2VydmljZV9jYXJkICpjYXJk
Ow0KQEAgLTE1MCw2ICsxNTcsMTMgQEAgc3RhdGljIGludCBtd2lmaWV4X3BjaWVfcmVzdW1lKHN0
cnVjdCBwY2lfZGV2ICpwZGV2KQ0KIA0KIAlyZXR1cm4gMDsNCiB9DQorDQorc3RhdGljIGludCBt
d2lmaWV4X3BjaWVfcmVzdW1lKHN0cnVjdCBkZXZpY2UgKmRldikNCit7DQorCXN0cnVjdCBwY2lf
ZGV2ICpwZGV2ID0gdG9fcGNpX2RldihkZXYpOw0KKw0KKwlyZXR1cm4gX19td2lmaWV4X3BjaWVf
cmVzdW1lKHBkZXYpOw0KK30NCiAjZW5kaWYNCiANCiAvKg0KQEAgLTIxMyw3ICsyMjcsNyBAQCBz
dGF0aWMgdm9pZCBtd2lmaWV4X3BjaWVfcmVtb3ZlKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KIAlp
ZiAodXNlcl9ybW1vZCkgew0KICNpZmRlZiBDT05GSUdfUE0NCiAJCWlmIChhZGFwdGVyLT5pc19z
dXNwZW5kZWQpDQotCQkJbXdpZmlleF9wY2llX3Jlc3VtZShwZGV2KTsNCisJCQlfX213aWZpZXhf
cGNpZV9yZXN1bWUocGRldik7DQogI2VuZGlmDQogDQogCQlmb3IgKGkgPSAwOyBpIDwgYWRhcHRl
ci0+cHJpdl9udW07IGkrKykNCkBAIC0yNDksNiArMjYzLDEzIEBAIHN0YXRpYyBERUZJTkVfUENJ
X0RFVklDRV9UQUJMRShtd2lmaWV4X2lkcykgPSB7DQogDQogTU9EVUxFX0RFVklDRV9UQUJMRShw
Y2ksIG13aWZpZXhfaWRzKTsNCiANCisjaWZkZWYgQ09ORklHX1BNDQorLyogUG93ZXIgTWFuYWdl
bWVudCBIb29rcyAqLw0KK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZGV2X3BtX29wcyBtd2lmaWV4X3Bj
aWVfcG1fb3BzID0gew0KKwlTRVRfU1lTVEVNX1NMRUVQX1BNX09QUyhtd2lmaWV4X3BjaWVfc3Vz
cGVuZCwgbXdpZmlleF9wY2llX3Jlc3VtZSkNCit9Ow0KKyNlbmRpZg0KKw0KIC8qIFBDSSBEZXZp
Y2UgRHJpdmVyICovDQogc3RhdGljIHN0cnVjdCBwY2lfZHJpdmVyIF9fcmVmZGF0YSBtd2lmaWV4
X3BjaWUgPSB7DQogCS5uYW1lICAgICA9ICJtd2lmaWV4X3BjaWUiLA0KQEAgLTI1Niw5ICsyNzcs
OSBAQCBzdGF0aWMgc3RydWN0IHBjaV9kcml2ZXIgX19yZWZkYXRhIG13aWZpZXhfcGNpZSA9IHsN
CiAJLnByb2JlICAgID0gbXdpZmlleF9wY2llX3Byb2JlLA0KIAkucmVtb3ZlICAgPSBtd2lmaWV4
X3BjaWVfcmVtb3ZlLA0KICNpZmRlZiBDT05GSUdfUE0NCi0JLyogUG93ZXIgTWFuYWdlbWVudCBI
b29rcyAqLw0KLQkuc3VzcGVuZCAgPSBtd2lmaWV4X3BjaWVfc3VzcGVuZCwNCi0JLnJlc3VtZSAg
ID0gbXdpZmlleF9wY2llX3Jlc3VtZSwNCisJLmRyaXZlciAgID0gew0KKwkJLnBtID0gJm13aWZp
ZXhfcGNpZV9wbV9vcHMsDQorCX0sDQogI2VuZGlmDQogfTsNCiANCi0tIA0KMS43LjEwLjQNCg0K
DQo=

^ permalink raw reply

* Re: rt3070-based usb device won't accept mac address changes
From: Helmut Schaa @ 2013-05-21  8:16 UTC (permalink / raw)
  To: Alessandro Lannocca; +Cc: linux-wireless
In-Reply-To: <CAMfPB_xTUy72YokSoYJezOX_gb54CJEd7V6+4pAfOHnAzUMJcQ@mail.gmail.com>

On Sat, May 18, 2013 at 5:10 PM, Alessandro Lannocca
<alessandro.lannocca@gmail.com> wrote:
> Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
> unable to change my alfa AWUS036NH mac address; a simple:
>
> ifconfig <device> down
> ifconfig <device> hw ether <random hw>
>
> results in:
>
> SIOCSIFHWADDR: Invalid argument

Do you have multiple wifi interfaces or just that single one?
Helmut

^ permalink raw reply

* [PATCH] mac80211: Allow single vif mac address change with addr_mask
From: Helmut Schaa @ 2013-05-21 12:54 UTC (permalink / raw)
  To: linux-wireless
  Cc: johannes, IvDoorn, gwingerde, stf_xl, Helmut Schaa,
	Alessandro Lannocca, Bruno Randolf

When changing the MAC address of a single vif mac80211 will check if the new
address fits into the address mask specified by the driver. This only needs
to be done when using multiple BSSIDs. Hence, check the new address only
against all other vifs.

Resolves:
https://bugzilla.kernel.org/show_bug.cgi?id=57371

Reported-by: Alessandro Lannocca <alessandro.lannocca@gmail.com>
Cc: Alessandro Lannocca <alessandro.lannocca@gmail.com>
Cc: Bruno Randolf <br1@thinktube.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 net/mac80211/iface.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 60f1ce5..c1a8c79 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -159,9 +159,10 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
 	return 0;
 }
 
-static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr)
+static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr)
 {
-	struct ieee80211_sub_if_data *sdata;
+	struct ieee80211_local *local = sdata->local;
+	struct ieee80211_sub_if_data *iter;
 	u64 new, mask, tmp;
 	u8 *m;
 	int ret = 0;
@@ -181,11 +182,14 @@ static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr)
 
 
 	mutex_lock(&local->iflist_mtx);
-	list_for_each_entry(sdata, &local->interfaces, list) {
-		if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
+	list_for_each_entry(iter, &local->interfaces, list) {
+		if (iter == sdata)
+			continue;
+
+		if (iter->vif.type == NL80211_IFTYPE_MONITOR)
 			continue;
 
-		m = sdata->vif.addr;
+		m = iter->vif.addr;
 		tmp =	((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) |
 			((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) |
 			((u64)m[4] << 1*8) | ((u64)m[5] << 0*8);
@@ -209,7 +213,7 @@ static int ieee80211_change_mac(struct net_device *dev, void *addr)
 	if (ieee80211_sdata_running(sdata))
 		return -EBUSY;
 
-	ret = ieee80211_verify_mac(sdata->local, sa->sa_data);
+	ret = ieee80211_verify_mac(sdata, sa->sa_data);
 	if (ret)
 		return ret;
 
-- 
1.7.10.4


^ permalink raw reply related

* [v3.9.x stable regression, bisected] iwlwifi/iwldvm has a 30s delay in EAP authentication
From: Kshitij Kulshreshtha @ 2013-05-21 14:09 UTC (permalink / raw)
  To: linux-kernel, linux-wireless; +Cc: gregkh

Hello,

I am currently running the openSUSE Tumbleweed distribution and have a
problem starting with the kernel v3.9.1 and also with kernel v3.9.2.

The iwldvm driver has an artificial delay of 30s when authenticating
with a radius server using EAP-TLS. This was not the case using kernel
v3.9.

I bisected the problem using local builds of the tumbleweed desktop
configuration. This is the result:

c30f37f8f1f8d06c142d67ba74955fd48b5cf5a4 is the first bad commit
commit c30f37f8f1f8d06c142d67ba74955fd48b5cf5a4
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Wed Apr 17 09:47:00 2013 +0300

    iwlwifi: dvm: don't send zeroed LQ cmd

    commit 63b77bf489881747c5118476918cc8c29378ee63 upstream.

    When the stations are being restored because of unassoc
    RXON, the LQ cmd may not have been initialized because it
    is initialized only after association.
    Sending zeroed LQ_CMD makes the fw unhappy: it raises
    SYSASSERT_2078.

    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    [move zero_lq and make static const]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

:040000 040000 fb6795b349a1765f357df8fcdf309e6e2613230b
5e542c8aef84287968515803efd193462c4a0d6b M      drivers

Reverting the above commit on top of kernel v3.9.3 fixes this 30s delay
but I've never seen a firmware restart of the iwldvm/iwlwifi driver in
my logs that would suggest that the SYSASSERT mentioned in the commit
message is happening. My hardware is Intel Centrino Advanced-N 6200 (rev
35) (pci_id 8086:422c).

I'll be happy to send any further information if required (Please CC me
in replies).

Thanks and regards.
Kshitij

The full log of the bisection is as follows:

[kulshres@apollo 3.9.y]$ git bisect log
# bad: [57049bb1dd0461d8423c3feceea36148d4335317] Linux 3.9.2
# good: [c1be5a5b1b355d40e6cf79cc979eb66dafa24ad1] Linux 3.9
git bisect start 'HEAD' 'v3.9'
# bad: [50f3a76bf2179283bba925a84839f23fcb42cd92] wireless: regulatory:
fix channel disabling race condition
git bisect bad 50f3a76bf2179283bba925a84839f23fcb42cd92
# bad: [5504e82764f41969a5f4e29af9f950f79ec3538a] crypto: crc32-pclmul -
Use gas macro for pclmulqdq
git bisect bad 5504e82764f41969a5f4e29af9f950f79ec3538a
# bad: [ad3b8a5451b342d58c16806dc6c0f750973c169b] USB: ftdi_sio: correct
ST Micro Connect Lite PIDs
git bisect bad ad3b8a5451b342d58c16806dc6c0f750973c169b
# good: [efaa9d79ccb5491181ea100dc6a9c575f626ef5a] powerpc: Add isync to
copy_and_flush
git bisect good efaa9d79ccb5491181ea100dc6a9c575f626ef5a
# bad: [af1f921702d4074dd61da0d4a2974d51ecd9c05d] mwifiex: Use
pci_release_region() instead of a pci_release_regions()
git bisect bad af1f921702d4074dd61da0d4a2974d51ecd9c05d
# good: [1a36af179e195ab85e1444cc760fd7a620289fa6] powerpc/spufs:
Initialise inode->i_ino in spufs_new_inode()
git bisect good 1a36af179e195ab85e1444cc760fd7a620289fa6
# bad: [c30f37f8f1f8d06c142d67ba74955fd48b5cf5a4] iwlwifi: dvm: don't
send zeroed LQ cmd
git bisect bad c30f37f8f1f8d06c142d67ba74955fd48b5cf5a4
# good: [34e3e78befc3c6f65f3e7ce70f0367745cd550b0] iwlwifi: fix freeing
uninitialized pointer
git bisect good 34e3e78befc3c6f65f3e7ce70f0367745cd550b0


-- 
Dr. Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.

^ permalink raw reply

* Re: [ath9k-devel] AR9287 ; 2-wire coexistence expected behavior
From: Adrian Chadd @ 2013-05-21 14:33 UTC (permalink / raw)
  To: sandeep suresh; +Cc: ath9k-devel, linux-wireless@vger.kernel.org
In-Reply-To: <1369118418.41680.YahooMailNeo@web193504.mail.sg3.yahoo.com>

Hi!

On 20 May 2013 23:40, sandeep suresh <sandeep.suresh@yahoo.co.in> wrote:
> Hello Mr.Adrian,
>     Greetings! I resumed my experiments with 2-wire co-existence with AR9287
> in WiFi AP mode.
> I was able to see that WLAN_STATUS signal being suppressed when BT_ACTIVE is
> enabled. I used a 100ms On and 100ms Off (Period = 200ms; 50% dc) for
> BT_ACTIVE. Just want to confirm the following before ensuring that I am
> seeing the expected behavior:
>
Cool! Can you share some code and register settings to enable this?

> 1. As I am running the WiFi AP with co-existence, other WiFi clients are
> connected to my AP. by means of diagnsosis (I have enabled diagnosis with
> modprobe ath9k btcoex_enabled=1 diag=0xffffffff), how can I find out if any
> WiFi clients are loosing connection and re-connecting back to AP.

I think you should enable hostapd logging. That will log the MLME events.

> 2. How can I come to know if any of the beacons in WiFi AP mode are getting
> missed? Diagnosis messages that I can look at.

You can look for missed beacon transmit events. That should tell you
if you're missing beacon transmission at all.

> 3. As diagnosis is enabled I see the following....is this a concern as there
> is disable and enable of IER?
> <7>ath: disable IER
> <7>ath: AR_IMR 0x918104b0 IER 0x1
> <7>ath: tx queue 2 (4bfc09c4), link ffde09c4
> <7>ath: enable IER
> <7>ath: Enable TXE on queue: 2
> <7>ath: disable IER
> <7>ath: AR_IMR 0x918104b0 IER 0x1

That's fine. That's what ath9k does with interrupts. :-)

> 4. How can I come to know if the ath9k drivers are getting reset and
> reinitializing?

There's a hw reset routine that gets called. You can just look for the
logging from that, or add a printk() yourself.



Adrian

^ permalink raw reply

* R: rt3070-based usb device won't accept mac address changes
From: Alessandro Lannocca @ 2013-05-21 15:07 UTC (permalink / raw)
  To: 'Helmut Schaa'; +Cc: 'linux-wireless'
In-Reply-To: <CAGXE3d8u4ORgmOAdKFbgYSA3qTQxfhKiT6feDMMwn_-ue0ehow@mail.gmail.com>

Hi, I have an ath9k-driven integrated card active at the same time (wlan0);
but only one wlan interface (wlan1) active on the rt2800usb phy, running in
managed mode.

Thank you for your time.

-----Messaggio originale-----
Da: Helmut Schaa [mailto:helmut.schaa@googlemail.com] 
Inviato: martedì 21 maggio 2013 10.16
A: Alessandro Lannocca
Cc: linux-wireless
Oggetto: Re: rt3070-based usb device won't accept mac address changes

On Sat, May 18, 2013 at 5:10 PM, Alessandro Lannocca
<alessandro.lannocca@gmail.com> wrote:
> Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm 
> unable to change my alfa AWUS036NH mac address; a simple:
>
> ifconfig <device> down
> ifconfig <device> hw ether <random hw>
>
> results in:
>
> SIOCSIFHWADDR: Invalid argument

Do you have multiple wifi interfaces or just that single one?
Helmut


^ permalink raw reply

* Re: [PATCH] mac80211: Allow single vif mac address change with addr_mask
From: Jakub Kiciński @ 2013-05-21 15:10 UTC (permalink / raw)
  To: Helmut Schaa
  Cc: linux-wireless, johannes, IvDoorn, gwingerde, stf_xl,
	Alessandro Lannocca, Bruno Randolf
In-Reply-To: <1369140893-22622-1-git-send-email-helmut.schaa@googlemail.com>

On Tue, 21 May 2013 14:54:53 +0200, Helmut Schaa wrote:
> When changing the MAC address of a single vif mac80211 will check if the new
> address fits into the address mask specified by the driver. This only needs
> to be done when using multiple BSSIDs. Hence, check the new address only
> against all other vifs.

Oh, I see that you already posted this patch for review! 

I think we should also take care of the way addresses for new
interfaces are chosen otherwise they'll just pick up
perm_addr and we will end up with incompatible MACs.

I created a patch for a user who reported this problem to
rt2x00 ML independently from Helmut.

--->8------------------

>From 63b32f4509d2c2bcf0ad791faa624b56a1947748 Mon Sep 17 00:00:00 2001
From: Jakub Kicinski <kubakici@wp.pl>
Date: Tue, 21 May 2013 13:05:43 +0200
Subject: [PATCH] mac80211: allow changing mac address on mac-masking devices

Some devices support multiple MAC addresses by
masking last few bits of the address.  Address
compatibility has to be checked only when there
is more than one interface - otherwise we can
just overwrite current address.

While at it fix inverted flow at the end of
ieee80211_change_mac.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
---
 net/mac80211/iface.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 60f1ce5..367aa3b 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -159,8 +159,9 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
 	return 0;
 }
 
-static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr)
+static int ieee80211_verify_mac(struct ieee80211_sub_if_data *target, u8 *addr)
 {
+	struct ieee80211_local *local = target->local;
 	struct ieee80211_sub_if_data *sdata;
 	u64 new, mask, tmp;
 	u8 *m;
@@ -184,6 +185,8 @@ static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr)
 	list_for_each_entry(sdata, &local->interfaces, list) {
 		if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
 			continue;
+		if (sdata == target)
+			continue;
 
 		m = sdata->vif.addr;
 		tmp =	((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) |
@@ -209,14 +212,15 @@ static int ieee80211_change_mac(struct net_device *dev, void *addr)
 	if (ieee80211_sdata_running(sdata))
 		return -EBUSY;
 
-	ret = ieee80211_verify_mac(sdata->local, sa->sa_data);
+	ret = ieee80211_verify_mac(sdata, sa->sa_data);
 	if (ret)
 		return ret;
 
 	ret = eth_mac_addr(dev, sa);
+	if (ret)
+		return ret;
 
-	if (ret == 0)
-		memcpy(sdata->vif.addr, sa->sa_data, ETH_ALEN);
+	memcpy(sdata->vif.addr, sa->sa_data, ETH_ALEN);
 
 	return ret;
 }
@@ -1479,7 +1483,17 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
 			break;
 		}
 
+		/*
+		 * Pick address of existing interface in case user changed
+		 * MAC address manually, default to perm_addr.
+		 */
 		m = local->hw.wiphy->perm_addr;
+		list_for_each_entry(sdata, &local->interfaces, list) {
+			if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
+				continue;
+			m = sdata->vif.addr;
+			break;
+		}
 		start = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) |
 			((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) |
 			((u64)m[4] << 1*8) | ((u64)m[5] << 0*8);
-- 
1.8.1.4


^ permalink raw reply related

* R: [PATCH] mac80211: Allow single vif mac address change with addr_mask
From: Alessandro Lannocca @ 2013-05-21 15:51 UTC (permalink / raw)
  To: 'Helmut Schaa'; +Cc: linux-wireless
In-Reply-To: <1369140893-22622-1-git-send-email-helmut.schaa@googlemail.com>

Tested right now against compat-drivers-2013-03-28-5-u and I can confirm it
works.

Thank you for your effort!

Alessandro Lannocca

-----Messaggio originale-----
Da: Helmut Schaa [mailto:helmut.schaa@googlemail.com] 
Inviato: martedì 21 maggio 2013 14.55
A: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net; IvDoorn@gmail.com; gwingerde@gmail.com;
stf_xl@wp.pl; Helmut Schaa; Alessandro Lannocca; Bruno Randolf
Oggetto: [PATCH] mac80211: Allow single vif mac address change with
addr_mask

When changing the MAC address of a single vif mac80211 will check if the new
address fits into the address mask specified by the driver. This only needs
to be done when using multiple BSSIDs. Hence, check the new address only
against all other vifs.

Resolves:
https://bugzilla.kernel.org/show_bug.cgi?id=57371

Reported-by: Alessandro Lannocca <alessandro.lannocca@gmail.com>
Cc: Alessandro Lannocca <alessandro.lannocca@gmail.com>
Cc: Bruno Randolf <br1@thinktube.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 net/mac80211/iface.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index
60f1ce5..c1a8c79 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -159,9 +159,10 @@ static int ieee80211_change_mtu(struct net_device *dev,
int new_mtu)
 	return 0;
 }
 
-static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr)
+static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 
+*addr)
 {
-	struct ieee80211_sub_if_data *sdata;
+	struct ieee80211_local *local = sdata->local;
+	struct ieee80211_sub_if_data *iter;
 	u64 new, mask, tmp;
 	u8 *m;
 	int ret = 0;
@@ -181,11 +182,14 @@ static int ieee80211_verify_mac(struct ieee80211_local
*local, u8 *addr)
 
 
 	mutex_lock(&local->iflist_mtx);
-	list_for_each_entry(sdata, &local->interfaces, list) {
-		if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
+	list_for_each_entry(iter, &local->interfaces, list) {
+		if (iter == sdata)
+			continue;
+
+		if (iter->vif.type == NL80211_IFTYPE_MONITOR)
 			continue;
 
-		m = sdata->vif.addr;
+		m = iter->vif.addr;
 		tmp =	((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) |
 			((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) |
 			((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); @@ -209,7
+213,7 @@ static int ieee80211_change_mac(struct net_device *dev, void
*addr)
 	if (ieee80211_sdata_running(sdata))
 		return -EBUSY;
 
-	ret = ieee80211_verify_mac(sdata->local, sa->sa_data);
+	ret = ieee80211_verify_mac(sdata, sa->sa_data);
 	if (ret)
 		return ret;
 
--
1.7.10.4



^ permalink raw reply

* RE: [RFC PATCH] net/wireless/mwifiex/pcie: Convert to dev_pm_ops from legacy pm ops
From: Bing Zhao @ 2013-05-21 18:49 UTC (permalink / raw)
  To: Shuah Khan, linville@tuxdriver.com, rafael.j.wysocki@intel.com
  Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, shuahkhan@gmail.com
In-Reply-To: <1369103589.12093.4.camel@lorien>

SGkgU2h1YWgsDQoNCj4gQ29udmVydCB0aGUgZHJpdmVyIHRvIHVzZSBkZXZfcG1fb3BzIGZvciBw
b3dlciBtYW5hZ2VtZW50IGFuZCByZW1vdmUgTGVnYWN5IFBNDQo+IGhhbmRsaW5nLiBUaGlzIGNo
YW5nZSByZS11c2VzIGV4aXN0aW5nIHN1c3BlbmQgYW5kIHJlc3VtZSBpbnRlcmZhY2VzIGZvcg0K
PiBkZXZfcG1fb3BzLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogU2h1YWggS2hhbiA8c2h1YWgua2hA
c2Ftc3VuZy5jb20+DQo+IENjOiBTaHVhaCBLaGFuIDxzaHVhaGtoYW5AZ21haWwuY29tPg0KPiBT
dWdnZXN0ZWQtYnk6IHJhZmFlbC5qLnd5c29ja2lAaW50ZWwuY29tDQoNCkFja2VkLWJ5OiBCaW5n
IFpoYW8gPGJ6aGFvQG1hcnZlbGwuY29tPg0KDQpUaGFua3MsDQpCaW5nDQoNCj4gLS0tDQo+IA0K
PiBSYWZhZWwsDQo+IA0KPiBUaGlzIGlzIHRoZSBmaXJzdCBkcml2ZXIgcGF0Y2ggdG8gY29udmVy
dCBkcml2ZXJzIHRvIHVzZSBkZXZfcG1fb3BzIGZvcg0KPiBwb3dlciBtYW5hZ2VtZW50LiBQbGVh
c2UgcmV2aWV3IGZvciB0aGUgYXBwcm9hY2ggYW5kIG1ha2Ugc3VnZ2VzdGlvbnMgZm9yDQo+IGlt
cHJvdmVtZW50Lg0KPiANCj4gdGhhbmtzLA0KPiAtLSBTaHVhaA0K

^ permalink raw reply

* [GIT] [3.10] NFC fixes
From: Samuel Ortiz @ 2013-05-21 23:07 UTC (permalink / raw)
  To: John W. Linville; +Cc: Linux Wireless, Linux NFC

Hi John,

This is the first batch of NFC fixes for 3.10, and it contains:

- 3 fixes for the NFC MEI support:
        * We now depend on the correct Kconfig symbol.
        * We register an MEI event callback whenever we enable an NFC device,
          otherwise we fail to read anything after an enable/disable cycle.
        * We only disable an MEI device from its disable mey_phy_ops,
          preventing useless consecutive disable calls.

- An NFC Makefile cleanup, as I forgot to remove a commented out line when
  moving the LLCP code to the NFC top level directory.

The following changes since commit 6bb4880d9ef30375da4507aeabd6dc261a2c6c2b:

  ath9k: fix draining aggregation tid buffers (2013-05-17 14:31:09 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-fixes.git tags/nfc-fixes-3.10-1

for you to fetch changes up to e3a6b14ceda0207c3405c6266e5177a85c0db044:

  NFC: mei: Do not disable MEI devices from their remove routine (2013-05-21 10:48:41 +0200)

----------------------------------------------------------------
Paul Bolle (1):
      NFC: Remove commented out LLCP related Makefile line

Samuel Ortiz (3):
      NFC: mei_phy depends on INTEL_MEI
      NFC: mei_phy: Register event callback when enabling the device
      NFC: mei: Do not disable MEI devices from their remove routine

 drivers/nfc/Kconfig         |    2 +-
 drivers/nfc/mei_phy.c       |    9 +++++++++
 drivers/nfc/microread/mei.c |   20 +++++---------------
 drivers/nfc/pn544/mei.c     |   20 +++++---------------
 net/nfc/Makefile            |    1 -
 5 files changed, 20 insertions(+), 32 deletions(-)

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply

* Re: [PATCH 2/2] cfg80211/nl80211: Add coalesce support
From: Luis R. Rodriguez @ 2013-05-21 23:23 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho, Amitkumar Karwar
In-Reply-To: <1369099918-4921-2-git-send-email-bzhao@marvell.com>

On Mon, May 20, 2013 at 06:31:58PM -0700, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> Add set/get configuration support for packet coalesce.
> 
> This feature needs to be advertised during driver initialization.
> Drivers can do required hardware settings based on user configuration.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>

I see nothing documenting clearly what this "coalesce" does.
Can you elaborate quite a bit both on the commit log and also
the documentation on nl80211.h what this is exactly? It would
also be good for you to express on your previous patch why
you want the rename.

If you add this also can you please be sure to update the wiki
for iw to document support for this?

  Luis

^ permalink raw reply

* RE: [PATCH 2/2] cfg80211/nl80211: Add coalesce support
From: Bing Zhao @ 2013-05-21 23:59 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linux-wireless@vger.kernel.org, Johannes Berg, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho, Amitkumar Karwar
In-Reply-To: <20130521232303.GX6529@pogo>

Hi Luis,

Thanks for your comments.

> > From: Amitkumar Karwar <akarwar@marvell.com>
> >
> > Add set/get configuration support for packet coalesce.
> >
> > This feature needs to be advertised during driver initialization.
> > Drivers can do required hardware settings based on user configuration.
> >
> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> > Signed-off-by: Bing Zhao <bzhao@marvell.com>
> 
> I see nothing documenting clearly what this "coalesce" does.
> Can you elaborate quite a bit both on the commit log and also
> the documentation on nl80211.h what this is exactly?

will add the documentations in v2.

> It would also be good for you to express on your previous patch why
> you want the rename.

"packet coalesce" will reuse the pattern structure (and its enum definitions) defined for
WoWLAN. It's renamed so that both WoWLAN and Coalesce can make use of it.

More elaborations will be added in v2 series.

> 
> If you add this also can you please be sure to update the wiki
> for iw to document support for this?

Sure. It will be done as soon as the iw patches are merged.

Thanks,
Bing

> 
>   Luis

^ permalink raw reply

* Re: [RFC 06/12] mac80211: notify bridge when leaving mesh
From: Thomas Pedersen @ 2013-05-22  1:09 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wirelss, Bob Copeland, open80211s
In-Reply-To: <1367934155.8328.21.camel@jlt4.sipsolutions.net>

Hey, Sorry for the late response.

On Tue, May 7, 2013 at 6:42 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Thu, 2013-05-02 at 19:33 -0700, Thomas Pedersen wrote:
>> After turning carrier off, any parent bridge interface
>> needs to be notified. Otherwise we would see a panic when
>> attempting to transmit frames on a mesh interface which
>> hadn't yet been put down.
>>
>> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
>> ---
>>  net/mac80211/mesh.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
>> index eac9988..271ddc9 100644
>> --- a/net/mac80211/mesh.c
>> +++ b/net/mac80211/mesh.c
>> @@ -993,6 +993,9 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
>>       struct beacon_data *bcn;
>>
>>       netif_carrier_off(sdata->dev);
>> +     if (sdata->dev->priv_flags & IFF_BRIDGE_PORT)
>> +             /* stop bridge transmissions */
>> +             call_netdevice_notifiers(NETDEV_CHANGE, sdata->dev);
>
> Err, this seems like a really bad hack? I don't really think drivers
> should call that?

Why not? We're just notifying the bridge interface that this port has
gone down, to avoid dereferencing a null pointer (on bridge flood
traffic) after the mesh_bss has been removed.

Is cfg80211_leave_mesh() an acceptable location for this fix?

--
Thomas

^ 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