* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Ohad Ben-Cohen @ 2010-08-12 6:40 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: DebBarma, Tarun Kanti, felipe.balbi@nokia.com, Kalle Valo,
Pandita, Vikram, akpm@linux-foundation.org,
Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
linux-wireless@vger.kernel.org, Mark Brown,
linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
Chikkature Rajashekar, Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <20100811212513.GC827@n2100.arm.linux.org.uk>
On Thu, Aug 12, 2010 at 12:25 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>I've outlined a far simpler and easiler solution
> which avoids this kind of abuse, and given suggestions on how to extend
> it to support multiple instances.
>
Do you mean:
http://www.spinics.net/lists/arm-kernel/msg95338.html
?
I was under the impression you eventually discarded that approach in that post.
Please tell me if you still support it,
Thanks,
Ohad.
^ permalink raw reply
* Re: [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc
From: Luciano Coelho @ 2010-08-12 6:48 UTC (permalink / raw)
To: ext Joe Perches; +Cc: netdev, linux-wireless, linux-kernel@vger.kernel.org
In-Reply-To: <1281546168.3976.39.camel@Joe-Laptop.home>
On Wed, 2010-08-11 at 19:02 +0200, ext Joe Perches wrote:
> These changes may be slightly safer in some instances.
>
> There are other kzalloc calls with a multiply, but those
> calls are typically "small fixed #" * sizeof(some pointer)"
> and those are not converted.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
[...]
> drivers/net/wireless/wl12xx/wl1271_scan.c | 2 +-
[...]
> diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
> index fec43ee..30dc100 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_scan.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
> @@ -248,7 +248,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
>
> wl->scan.req = req;
>
> - wl->scan.scanned_ch = kzalloc(req->n_channels *
> + wl->scan.scanned_ch = kcalloc(req->n_channels,
> sizeof(*wl->scan.scanned_ch),
> GFP_KERNEL);
> wl1271_scan_stm(wl);
For the wl1271 part:
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
--
Cheers,
Luca.
^ permalink raw reply
* [PATCH] ath9k_htc: Fix disconnect issue in HT40 mode.
From: Vivek Natarajan @ 2010-08-12 7:24 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Set WLAN_RC_40_FLAG only if the current channel configuration
is HT40 enabled.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index ebed9d1..7d09b4b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -366,7 +366,8 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
caps = WLAN_RC_HT_FLAG;
if (sta->ht_cap.mcs.rx_mask[1])
caps |= WLAN_RC_DS_FLAG;
- if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
+ if ((sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
+ (conf_is_ht40(&priv->hw->conf)))
caps |= WLAN_RC_40_FLAG;
if (conf_is_ht40(&priv->hw->conf) &&
(sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40))
--
1.7.2.1
^ permalink raw reply related
* Re: [PATCH] ath9k_htc: Fix disconnect issue in HT40 mode.
From: Luis R. Rodriguez @ 2010-08-12 7:25 UTC (permalink / raw)
To: Vivek Natarajan; +Cc: linville, linux-wireless
In-Reply-To: <1281597845-6342-1-git-send-email-vnatarajan@atheros.com>
On Thu, Aug 12, 2010 at 12:24 AM, Vivek Natarajan
<vnatarajan@atheros.com> wrote:
> Set WLAN_RC_40_FLAG only if the current channel configuration
> is HT40 enabled.
What does this fix? Is this a stable fix, if so why?
Luis
^ permalink raw reply
* [PATCH v2] ath9k_htc: Fix disconnect issue in HT40 mode.
From: Vivek Natarajan @ 2010-08-12 8:53 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, stable
Some APs advertise that they may be HT40 capable in the capabilites
but the current operating channel configuration may be only HT20.
This causes disconnection as ath9k_htc sets WLAN_RC_40_FLAG despite
the AP operating in HT20 mode.
Hence set this flag only if the current channel configuration
is HT40 enabled.
Cc: stable@kernel.org
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index ebed9d1..7d09b4b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -366,7 +366,8 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
caps = WLAN_RC_HT_FLAG;
if (sta->ht_cap.mcs.rx_mask[1])
caps |= WLAN_RC_DS_FLAG;
- if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
+ if ((sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
+ (conf_is_ht40(&priv->hw->conf)))
caps |= WLAN_RC_40_FLAG;
if (conf_is_ht40(&priv->hw->conf) &&
(sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40))
--
1.7.2.1
^ permalink raw reply related
* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Russell King - ARM Linux @ 2010-08-12 9:55 UTC (permalink / raw)
To: Ohad Ben-Cohen
Cc: DebBarma, Tarun Kanti, felipe.balbi@nokia.com, Kalle Valo,
Pandita, Vikram, akpm@linux-foundation.org,
Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
linux-wireless@vger.kernel.org, Mark Brown,
linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
Chikkature Rajashekar, Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <AANLkTikDhzGVFZhNJZic9xYX9bL_NhOW=4LS-cTFSG0i@mail.gmail.com>
On Thu, Aug 12, 2010 at 09:40:19AM +0300, Ohad Ben-Cohen wrote:
> On Thu, Aug 12, 2010 at 12:25 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> >I've outlined a far simpler and easiler solution
> > which avoids this kind of abuse, and given suggestions on how to extend
> > it to support multiple instances.
> >
>
> Do you mean:
> http://www.spinics.net/lists/arm-kernel/msg95338.html
> ?
>
> I was under the impression you eventually discarded that approach in
> that post.
Indeed.
I'm talking about my first suggestion:
http://lists.arm.linux.org.uk/lurker/message/20100804.114148.bf961e83.en.html
which was later expanded by Vitaly:
http://lists.arm.linux.org.uk/lurker/message/20100804.140119.f476c29c.en.html
I don't think anyone had any negative comments against that proposal.
^ permalink raw reply
* [PATCH] mac80211: check RX crypto for sta key
From: Johannes Berg @ 2010-08-12 11:14 UTC (permalink / raw)
To: John Linville; +Cc: Juuso Oikarinen, linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
My previous patch removing decrypted && iv-stripped
checks from the crypto algorithms turned out to be
completely wrong since in the common case of using
a per-station key the check wasn't there. Rather
than revert it, add a check to this case so that
the crypto algorithms don't need to be able to deal
with already decrypted and verified frames.
Reported-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Tested-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/rx.c | 3 +++
1 file changed, 3 insertions(+)
--- wireless-testing.orig/net/mac80211/rx.c 2010-08-11 14:37:13.000000000 +0200
+++ wireless-testing/net/mac80211/rx.c 2010-08-12 13:11:17.000000000 +0200
@@ -873,6 +873,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_
if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
rx->key = stakey;
+ if ((status->flag & RX_FLAG_DECRYPTED) &&
+ (status->flag & RX_FLAG_IV_STRIPPED))
+ return RX_CONTINUE;
/* Skip decryption if the frame is not protected. */
if (!ieee80211_has_protected(fc))
return RX_CONTINUE;
^ permalink raw reply
* [PATCH] cfg80211: mark ieee80211_hdrlen const
From: Johannes Berg @ 2010-08-12 12:49 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
This function analyses only its single, value-passed
argument, and has no side effects. Thus it can be
const, which makes mac80211 smaller, for example:
text data bss dec hex filename
362518 16720 884 380122 5ccda mac80211.ko (before)
362358 16720 884 379962 5cc3a mac80211.ko (after)
a 160 byte saving in text size, and an optimisation
because the function won't be called as often.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/net/cfg80211.h | 2 +-
net/wireless/util.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2010-08-12 14:19:40.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2010-08-12 14:19:41.000000000 +0200
@@ -1715,7 +1715,7 @@ unsigned int ieee80211_get_hdrlen_from_s
* ieee80211_hdrlen - get header length in bytes from frame control
* @fc: frame control field in little-endian format
*/
-unsigned int ieee80211_hdrlen(__le16 fc);
+unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
/**
* ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
--- wireless-testing.orig/net/wireless/util.c 2010-08-12 14:19:40.000000000 +0200
+++ wireless-testing/net/wireless/util.c 2010-08-12 14:19:41.000000000 +0200
@@ -221,7 +221,7 @@ const unsigned char bridge_tunnel_header
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
EXPORT_SYMBOL(bridge_tunnel_header);
-unsigned int ieee80211_hdrlen(__le16 fc)
+unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc)
{
unsigned int hdrlen = 24;
^ permalink raw reply
* [PATCH] mac80211: remove unused don't-encrypt flag
From: Johannes Berg @ 2010-08-12 13:37 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, Jouni Malinen
From: Johannes Berg <johannes.berg@intel.com>
When MFP is disabled, action frames will not
be encrypted since they are management frames
and the only management frames that can then
be encrypted are authentication frames.
Therefore, setting the don't-encrypt flag on
action frames is unnecessary.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/cfg.c | 2 --
1 file changed, 2 deletions(-)
--- wireless-testing.orig/net/mac80211/cfg.c 2010-08-12 13:42:52.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2010-08-12 13:42:54.000000000 +0200
@@ -1575,8 +1575,6 @@ static int ieee80211_action(struct wiphy
return -ENOLINK;
break;
case NL80211_IFTYPE_STATION:
- if (!(sdata->u.mgd.flags & IEEE80211_STA_MFP_ENABLED))
- flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
break;
default:
return -EOPNOTSUPP;
^ permalink raw reply
* [PATCH] cfg80211/mac80211: extensible frame processing
From: Johannes Berg @ 2010-08-12 13:38 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Allow userspace to register for more than just
action frames by giving the frame subtype, and
make it possible to use this in various modes
as well.
With some tweaks and some added functionality
this will, in the future, also be usable in AP
mode and be able to replace the cooked monitor
interface currently used in that case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/linux/nl80211.h | 93 +++++++++++++++++++++++------
include/net/cfg80211.h | 56 ++++++++++-------
net/mac80211/cfg.c | 12 +--
net/mac80211/ieee80211_i.h | 1
net/mac80211/iface.c | 6 -
net/mac80211/main.c | 37 +++++++++++
net/mac80211/rx.c | 137 ++++++++++++++++++++++++++++++------------
net/mac80211/status.c | 2
net/mac80211/util.c | 6 -
net/wireless/core.c | 8 +-
net/wireless/core.h | 21 +++---
net/wireless/mlme.c | 144 +++++++++++++++++++++++++++++----------------
net/wireless/nl80211.c | 108 +++++++++++++++++++++++++--------
net/wireless/nl80211.h | 14 ++--
net/wireless/util.c | 2
15 files changed, 452 insertions(+), 195 deletions(-)
--- wireless-testing.orig/include/linux/nl80211.h 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/include/linux/nl80211.h 2010-08-12 13:56:32.000000000 +0200
@@ -40,6 +40,43 @@
*/
/**
+ * DOC: Frame transmission/registration support
+ *
+ * Frame transmission and registration support exists to allow userspace
+ * management entities such as wpa_supplicant react to management frames
+ * that are not being handled by the kernel. This includes, for example,
+ * certain classes of action frames that cannot be handled in the kernel
+ * for various reasons.
+ *
+ * Frame registration is done on a per-interface basis and registrations
+ * cannot be removed other than by closing the socket. It is possible to
+ * specify a registration filter to register, for example, only for a
+ * certain type of action frame. In particular with action frames, those
+ * that userspace registers for will not be returned as unhandled by the
+ * driver, so that the registered application has to take responsibility
+ * for doing that.
+ *
+ * The type of frame that can be registered for is also dependent on the
+ * driver and interface type. The frame types are advertised in wiphy
+ * attributes so applications know what to expect.
+ *
+ * NOTE: When an interface changes type while registrations are active,
+ * these registrations are ignored until the interface type is
+ * changed again. This means that changing the interface type can
+ * lead to a situation that couldn't otherwise be produced, but
+ * any such registrations will be dormant in the sense that they
+ * will not be serviced, i.e. they will not receive any frames.
+ *
+ * Frame transmission allows userspace to send for example the required
+ * responses to action frames. It is subject to some sanity checking,
+ * but many frames can be transmitted. When a frame was transmitted, its
+ * status is indicated to the sending socket.
+ *
+ * For more technical details, see the corresponding command descriptions
+ * below.
+ */
+
+/**
* enum nl80211_commands - supported nl80211 commands
*
* @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -301,16 +338,18 @@
* rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
* and @NL80211_ATTR_TX_RATES the set of allowed rates.
*
- * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames
- * (via @NL80211_CMD_ACTION) for processing in userspace. This command
- * requires an interface index and a match attribute containing the first
- * few bytes of the frame that should match, e.g. a single byte for only
- * a category match or four bytes for vendor frames including the OUI.
- * The registration cannot be dropped, but is removed automatically
- * when the netlink socket is closed. Multiple registrations can be made.
- * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This
- * command is used both as a request to transmit an Action frame and as an
- * event indicating reception of an Action frame that was not processed in
+ * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
+ * (via @NL80211_CMD_FRAME) for processing in userspace. This command
+ * requires an interface index, a frame type attribute (optional for
+ * backward compatibility reasons, if not given assumes action frames)
+ * and a match attribute containing the first few bytes of the frame
+ * that should match, e.g. a single byte for only a category match or
+ * four bytes for vendor frames including the OUI. The registration
+ * cannot be dropped, but is removed automatically when the netlink
+ * socket is closed. Multiple registrations can be made.
+ * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
+ * command is used both as a request to transmit a management frame and
+ * as an event indicating reception of a frame that was not processed in
* kernel code, but is for us (i.e., which may need to be processed in a
* user space application). %NL80211_ATTR_FRAME is used to specify the
* frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
@@ -320,8 +359,8 @@
* operational channel). When called, this operation returns a cookie
* (%NL80211_ATTR_COOKIE) that will be included with the TX status event
* pertaining to the TX request.
- * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame
- * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies
+ * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
+ * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
* the TX command and %NL80211_ATTR_FRAME includes the contents of the
* frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
* the frame.
@@ -429,9 +468,12 @@ enum nl80211_commands {
NL80211_CMD_SET_TX_BITRATE_MASK,
- NL80211_CMD_REGISTER_ACTION,
- NL80211_CMD_ACTION,
- NL80211_CMD_ACTION_TX_STATUS,
+ NL80211_CMD_REGISTER_FRAME,
+ NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
+ NL80211_CMD_FRAME,
+ NL80211_CMD_ACTION = NL80211_CMD_FRAME,
+ NL80211_CMD_FRAME_TX_STATUS,
+ NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
NL80211_CMD_SET_POWER_SAVE,
NL80211_CMD_GET_POWER_SAVE,
@@ -708,7 +750,16 @@ enum nl80211_commands {
* is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
*
* @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
- * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION.
+ * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
+ * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
+ * @NL80211_CMD_REGISTER_FRAME command.
+ * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
+ * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
+ * information about which frame types can be transmitted with
+ * %NL80211_CMD_FRAME.
+ * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
+ * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
+ * information about which frame types can be registered for RX.
*
* @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
* acknowledged by the recipient.
@@ -891,6 +942,10 @@ enum nl80211_attrs {
NL80211_ATTR_WIPHY_TX_POWER_SETTING,
NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
+ NL80211_ATTR_TX_FRAME_TYPES,
+ NL80211_ATTR_RX_FRAME_TYPES,
+ NL80211_ATTR_FRAME_TYPE,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -947,7 +1002,7 @@ enum nl80211_attrs {
* @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
* @NL80211_IFTYPE_MESH_POINT: mesh point
* @NL80211_IFTYPE_MAX: highest interface type number currently defined
- * @__NL80211_IFTYPE_AFTER_LAST: internal use
+ * @NUM_NL80211_IFTYPES: number of defined interface types
*
* These values are used with the %NL80211_ATTR_IFTYPE
* to set the type of an interface.
@@ -964,8 +1019,8 @@ enum nl80211_iftype {
NL80211_IFTYPE_MESH_POINT,
/* keep last */
- __NL80211_IFTYPE_AFTER_LAST,
- NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
+ NUM_NL80211_IFTYPES,
+ NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
};
/**
--- wireless-testing.orig/include/net/cfg80211.h 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2010-08-12 14:17:29.000000000 +0200
@@ -1020,7 +1020,7 @@ struct cfg80211_pmksa {
* @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
* This allows the operation to be terminated prior to timeout based on
* the duration value.
- * @action: Transmit an action frame
+ * @mgmt_tx: Transmit a management frame
*
* @testmode_cmd: run a test mode command
*
@@ -1172,7 +1172,7 @@ struct cfg80211_ops {
struct net_device *dev,
u64 cookie);
- int (*action)(struct wiphy *wiphy, struct net_device *dev,
+ int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type,
bool channel_type_valid,
@@ -1236,6 +1236,10 @@ struct mac_address {
u8 addr[ETH_ALEN];
};
+struct ieee80211_txrx_stypes {
+ u16 tx, rx;
+};
+
/**
* struct wiphy - wireless hardware description
* @reg_notifier: the driver's regulatory notification callback
@@ -1286,6 +1290,10 @@ struct mac_address {
* @privid: a pointer that drivers can use to identify if an arbitrary
* wiphy is theirs, e.g. in global notifiers
* @bands: information about bands/channels supported by this device
+ *
+ * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or
+ * transmitted through nl80211, points to an array indexed by interface
+ * type
*/
struct wiphy {
/* assign these fields before you register the wiphy */
@@ -1294,9 +1302,12 @@ struct wiphy {
u8 perm_addr[ETH_ALEN];
u8 addr_mask[ETH_ALEN];
- u16 n_addresses;
struct mac_address *addresses;
+ const struct ieee80211_txrx_stypes *mgmt_stypes;
+
+ u16 n_addresses;
+
/* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
u16 interface_modes;
@@ -1492,8 +1503,8 @@ struct cfg80211_cached_keys;
* set by driver (if supported) on add_interface BEFORE registering the
* netdev and may otherwise be used by driver read-only, will be update
* by cfg80211 on change_interface
- * @action_registrations: list of registrations for action frames
- * @action_registrations_lock: lock for the list
+ * @mgmt_registrations: list of registrations for management frames
+ * @mgmt_registrations_lock: lock for the list
* @mtx: mutex used to lock data in this struct
* @cleanup_work: work struct used for cleanup that can't be done directly
*/
@@ -1505,8 +1516,8 @@ struct wireless_dev {
struct list_head list;
struct net_device *netdev;
- struct list_head action_registrations;
- spinlock_t action_registrations_lock;
+ struct list_head mgmt_registrations;
+ spinlock_t mgmt_registrations_lock;
struct mutex mtx;
@@ -2373,38 +2384,39 @@ void cfg80211_new_sta(struct net_device
struct station_info *sinfo, gfp_t gfp);
/**
- * cfg80211_rx_action - notification of received, unprocessed Action frame
+ * cfg80211_rx_mgmt - notification of received, unprocessed management frame
* @dev: network device
* @freq: Frequency on which the frame was received in MHz
- * @buf: Action frame (header + body)
+ * @buf: Management frame (header + body)
* @len: length of the frame data
* @gfp: context flags
- * Returns %true if a user space application is responsible for rejecting the
- * unrecognized Action frame; %false if no such application is registered
- * (i.e., the driver is responsible for rejecting the unrecognized Action
- * frame)
+ *
+ * Returns %true if a user space application has registered for this frame.
+ * For action frames, that makes it responsible for rejecting unrecognized
+ * action frames; %false otherwise, in which case for action frames the
+ * driver is responsible for rejecting the frame.
*
* This function is called whenever an Action frame is received for a station
* mode interface, but is not processed in kernel.
*/
-bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf,
- size_t len, gfp_t gfp);
+bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf,
+ size_t len, gfp_t gfp);
/**
- * cfg80211_action_tx_status - notification of TX status for Action frame
+ * cfg80211_mgmt_tx_status - notification of TX status for management frame
* @dev: network device
- * @cookie: Cookie returned by cfg80211_ops::action()
- * @buf: Action frame (header + body)
+ * @cookie: Cookie returned by cfg80211_ops::mgmt_tx()
+ * @buf: Management frame (header + body)
* @len: length of the frame data
* @ack: Whether frame was acknowledged
* @gfp: context flags
*
- * This function is called whenever an Action frame was requested to be
- * transmitted with cfg80211_ops::action() to report the TX status of the
+ * This function is called whenever a management frame was requested to be
+ * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the
* transmission attempt.
*/
-void cfg80211_action_tx_status(struct net_device *dev, u64 cookie,
- const u8 *buf, size_t len, bool ack, gfp_t gfp);
+void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie,
+ const u8 *buf, size_t len, bool ack, gfp_t gfp);
/**
--- wireless-testing.orig/net/wireless/nl80211.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2010-08-12 13:56:32.000000000 +0200
@@ -156,6 +156,7 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_WIPHY_TX_POWER_SETTING] = { .type = NLA_U32 },
[NL80211_ATTR_WIPHY_TX_POWER_LEVEL] = { .type = NLA_U32 },
+ [NL80211_ATTR_FRAME_TYPE] = { .type = NLA_U16 },
};
/* policy for the attributes */
@@ -437,6 +438,8 @@ static int nl80211_send_wiphy(struct sk_
struct ieee80211_rate *rate;
int i;
u16 ifmodes = dev->wiphy.interface_modes;
+ const struct ieee80211_txrx_stypes *mgmt_stypes =
+ dev->wiphy.mgmt_stypes;
hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_WIPHY);
if (!hdr)
@@ -587,7 +590,7 @@ static int nl80211_send_wiphy(struct sk_
CMD(flush_pmksa, FLUSH_PMKSA);
CMD(remain_on_channel, REMAIN_ON_CHANNEL);
CMD(set_bitrate_mask, SET_TX_BITRATE_MASK);
- CMD(action, ACTION);
+ CMD(mgmt_tx, FRAME);
if (dev->wiphy.flags & WIPHY_FLAG_NETNS_OK) {
i++;
NLA_PUT_U32(msg, i, NL80211_CMD_SET_WIPHY_NETNS);
@@ -608,6 +611,53 @@ static int nl80211_send_wiphy(struct sk_
nla_nest_end(msg, nl_cmds);
+ if (mgmt_stypes) {
+ u16 stypes;
+ struct nlattr *nl_ftypes, *nl_ifs;
+ enum nl80211_iftype ift;
+
+ nl_ifs = nla_nest_start(msg, NL80211_ATTR_TX_FRAME_TYPES);
+ if (!nl_ifs)
+ goto nla_put_failure;
+
+ for (ift = 0; ift < NUM_NL80211_IFTYPES; ift++) {
+ nl_ftypes = nla_nest_start(msg, ift);
+ if (!nl_ftypes)
+ goto nla_put_failure;
+ i = 0;
+ stypes = mgmt_stypes[ift].tx;
+ while (stypes) {
+ if (stypes & 1)
+ NLA_PUT_U16(msg, NL80211_ATTR_FRAME_TYPE,
+ (i << 4) | IEEE80211_FTYPE_MGMT);
+ stypes >>= 1;
+ i++;
+ }
+ nla_nest_end(msg, nl_ftypes);
+ }
+
+ nl_ifs = nla_nest_start(msg, NL80211_ATTR_RX_FRAME_TYPES);
+ if (!nl_ifs)
+ goto nla_put_failure;
+
+ for (ift = 0; ift < NUM_NL80211_IFTYPES; ift++) {
+ nl_ftypes = nla_nest_start(msg, ift);
+ if (!nl_ftypes)
+ goto nla_put_failure;
+ i = 0;
+ stypes = mgmt_stypes[ift].rx;
+ while (stypes) {
+ if (stypes & 1)
+ NLA_PUT_U16(msg, NL80211_ATTR_FRAME_TYPE,
+ (i << 4) | IEEE80211_FTYPE_MGMT);
+ stypes >>= 1;
+ i++;
+ }
+ nla_nest_end(msg, nl_ftypes);
+ }
+ nla_nest_end(msg, nl_ifs);
+ }
+
return genlmsg_end(msg, hdr);
nla_put_failure:
@@ -4717,17 +4767,18 @@ static int nl80211_set_tx_bitrate_mask(s
return err;
}
-static int nl80211_register_action(struct sk_buff *skb, struct genl_info *info)
+static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev;
struct net_device *dev;
+ u16 frame_type = IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION;
int err;
if (!info->attrs[NL80211_ATTR_FRAME_MATCH])
return -EINVAL;
- if (nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]) < 1)
- return -EINVAL;
+ if (info->attrs[NL80211_ATTR_FRAME_TYPE])
+ frame_type = nla_get_u16(info->attrs[NL80211_ATTR_FRAME_TYPE]);
rtnl_lock();
@@ -4742,12 +4793,13 @@ static int nl80211_register_action(struc
}
/* not much point in registering if we can't reply */
- if (!rdev->ops->action) {
+ if (!rdev->ops->mgmt_tx) {
err = -EOPNOTSUPP;
goto out;
}
- err = cfg80211_mlme_register_action(dev->ieee80211_ptr, info->snd_pid,
+ err = cfg80211_mlme_register_mgmt(dev->ieee80211_ptr, info->snd_pid,
+ frame_type,
nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),
nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]));
out:
@@ -4758,7 +4810,7 @@ static int nl80211_register_action(struc
return err;
}
-static int nl80211_action(struct sk_buff *skb, struct genl_info *info)
+static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev;
struct net_device *dev;
@@ -4781,7 +4833,7 @@ static int nl80211_action(struct sk_buff
if (err)
goto unlock_rtnl;
- if (!rdev->ops->action) {
+ if (!rdev->ops->mgmt_tx) {
err = -EOPNOTSUPP;
goto out;
}
@@ -4824,17 +4876,17 @@ static int nl80211_action(struct sk_buff
}
hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0,
- NL80211_CMD_ACTION);
+ NL80211_CMD_FRAME);
if (IS_ERR(hdr)) {
err = PTR_ERR(hdr);
goto free_msg;
}
- err = cfg80211_mlme_action(rdev, dev, chan, channel_type,
- channel_type_valid,
- nla_data(info->attrs[NL80211_ATTR_FRAME]),
- nla_len(info->attrs[NL80211_ATTR_FRAME]),
- &cookie);
+ err = cfg80211_mlme_mgmt_tx(rdev, dev, chan, channel_type,
+ channel_type_valid,
+ nla_data(info->attrs[NL80211_ATTR_FRAME]),
+ nla_len(info->attrs[NL80211_ATTR_FRAME]),
+ &cookie);
if (err)
goto free_msg;
@@ -5333,14 +5385,14 @@ static struct genl_ops nl80211_ops[] = {
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = NL80211_CMD_REGISTER_ACTION,
- .doit = nl80211_register_action,
+ .cmd = NL80211_CMD_REGISTER_FRAME,
+ .doit = nl80211_register_mgmt,
.policy = nl80211_policy,
.flags = GENL_ADMIN_PERM,
},
{
- .cmd = NL80211_CMD_ACTION,
- .doit = nl80211_action,
+ .cmd = NL80211_CMD_FRAME,
+ .doit = nl80211_tx_mgmt,
.policy = nl80211_policy,
.flags = GENL_ADMIN_PERM,
},
@@ -6040,9 +6092,9 @@ void nl80211_send_sta_event(struct cfg80
nl80211_mlme_mcgrp.id, gfp);
}
-int nl80211_send_action(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, u32 nlpid,
- int freq, const u8 *buf, size_t len, gfp_t gfp)
+int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev, u32 nlpid,
+ int freq, const u8 *buf, size_t len, gfp_t gfp)
{
struct sk_buff *msg;
void *hdr;
@@ -6052,7 +6104,7 @@ int nl80211_send_action(struct cfg80211_
if (!msg)
return -ENOMEM;
- hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_ACTION);
+ hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME);
if (!hdr) {
nlmsg_free(msg);
return -ENOMEM;
@@ -6080,10 +6132,10 @@ int nl80211_send_action(struct cfg80211_
return -ENOBUFS;
}
-void nl80211_send_action_tx_status(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, u64 cookie,
- const u8 *buf, size_t len, bool ack,
- gfp_t gfp)
+void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev, u64 cookie,
+ const u8 *buf, size_t len, bool ack,
+ gfp_t gfp)
{
struct sk_buff *msg;
void *hdr;
@@ -6092,7 +6144,7 @@ void nl80211_send_action_tx_status(struc
if (!msg)
return;
- hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_ACTION_TX_STATUS);
+ hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME_TX_STATUS);
if (!hdr) {
nlmsg_free(msg);
return;
@@ -6179,7 +6231,7 @@ static int nl80211_netlink_notify(struct
list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list)
list_for_each_entry_rcu(wdev, &rdev->netdev_list, list)
- cfg80211_mlme_unregister_actions(wdev, notify->pid);
+ cfg80211_mlme_unregister_socket(wdev, notify->pid);
rcu_read_unlock();
--- wireless-testing.orig/net/wireless/core.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2010-08-12 13:56:32.000000000 +0200
@@ -433,7 +433,7 @@ int wiphy_register(struct wiphy *wiphy)
/* sanity check ifmodes */
WARN_ON(!ifmodes);
- ifmodes &= ((1 << __NL80211_IFTYPE_AFTER_LAST) - 1) & ~1;
+ ifmodes &= ((1 << NUM_NL80211_IFTYPES) - 1) & ~1;
if (WARN_ON(ifmodes != wiphy->interface_modes))
wiphy->interface_modes = ifmodes;
@@ -685,8 +685,8 @@ static int cfg80211_netdev_notifier_call
INIT_WORK(&wdev->cleanup_work, wdev_cleanup_work);
INIT_LIST_HEAD(&wdev->event_list);
spin_lock_init(&wdev->event_lock);
- INIT_LIST_HEAD(&wdev->action_registrations);
- spin_lock_init(&wdev->action_registrations_lock);
+ INIT_LIST_HEAD(&wdev->mgmt_registrations);
+ spin_lock_init(&wdev->mgmt_registrations_lock);
mutex_lock(&rdev->devlist_mtx);
list_add_rcu(&wdev->list, &rdev->netdev_list);
@@ -806,7 +806,7 @@ static int cfg80211_netdev_notifier_call
sysfs_remove_link(&dev->dev.kobj, "phy80211");
list_del_rcu(&wdev->list);
rdev->devlist_generation++;
- cfg80211_mlme_purge_actions(wdev);
+ cfg80211_mlme_purge_registrations(wdev);
#ifdef CONFIG_CFG80211_WEXT
kfree(wdev->wext.keys);
#endif
--- wireless-testing.orig/net/wireless/core.h 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/wireless/core.h 2010-08-12 13:48:00.000000000 +0200
@@ -331,16 +331,17 @@ void __cfg80211_connect_result(struct ne
const u8 *resp_ie, size_t resp_ie_len,
u16 status, bool wextev,
struct cfg80211_bss *bss);
-int cfg80211_mlme_register_action(struct wireless_dev *wdev, u32 snd_pid,
- const u8 *match_data, int match_len);
-void cfg80211_mlme_unregister_actions(struct wireless_dev *wdev, u32 nlpid);
-void cfg80211_mlme_purge_actions(struct wireless_dev *wdev);
-int cfg80211_mlme_action(struct cfg80211_registered_device *rdev,
- struct net_device *dev,
- struct ieee80211_channel *chan,
- enum nl80211_channel_type channel_type,
- bool channel_type_valid,
- const u8 *buf, size_t len, u64 *cookie);
+int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
+ u16 frame_type, const u8 *match_data,
+ int match_len);
+void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid);
+void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
+int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
+ struct net_device *dev,
+ struct ieee80211_channel *chan,
+ enum nl80211_channel_type channel_type,
+ bool channel_type_valid,
+ const u8 *buf, size_t len, u64 *cookie);
/* SME */
int __cfg80211_connect(struct cfg80211_registered_device *rdev,
--- wireless-testing.orig/net/wireless/mlme.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2010-08-12 14:06:14.000000000 +0200
@@ -748,31 +748,51 @@ void cfg80211_new_sta(struct net_device
}
EXPORT_SYMBOL(cfg80211_new_sta);
-struct cfg80211_action_registration {
+struct cfg80211_mgmt_registration {
struct list_head list;
u32 nlpid;
int match_len;
+ __le16 frame_type;
+
u8 match[];
};
-int cfg80211_mlme_register_action(struct wireless_dev *wdev, u32 snd_pid,
- const u8 *match_data, int match_len)
+int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
+ u16 frame_type, const u8 *match_data,
+ int match_len)
{
- struct cfg80211_action_registration *reg, *nreg;
+ struct cfg80211_mgmt_registration *reg, *nreg;
int err = 0;
+ u16 mgmt_type;
+
+ if (!wdev->wiphy->mgmt_stypes)
+ return -EOPNOTSUPP;
+
+ if ((frame_type & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT)
+ return -EINVAL;
+
+ if (frame_type & ~(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
+ return -EINVAL;
+
+ mgmt_type = (frame_type & IEEE80211_FCTL_STYPE) >> 4;
+ if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx & BIT(mgmt_type)))
+ return -EINVAL;
nreg = kzalloc(sizeof(*reg) + match_len, GFP_KERNEL);
if (!nreg)
return -ENOMEM;
- spin_lock_bh(&wdev->action_registrations_lock);
+ spin_lock_bh(&wdev->mgmt_registrations_lock);
- list_for_each_entry(reg, &wdev->action_registrations, list) {
+ list_for_each_entry(reg, &wdev->mgmt_registrations, list) {
int mlen = min(match_len, reg->match_len);
+ if (frame_type != le16_to_cpu(reg->frame_type))
+ continue;
+
if (memcmp(reg->match, match_data, mlen) == 0) {
err = -EALREADY;
break;
@@ -787,62 +807,75 @@ int cfg80211_mlme_register_action(struct
memcpy(nreg->match, match_data, match_len);
nreg->match_len = match_len;
nreg->nlpid = snd_pid;
- list_add(&nreg->list, &wdev->action_registrations);
+ nreg->frame_type = cpu_to_le16(frame_type);
+ list_add(&nreg->list, &wdev->mgmt_registrations);
out:
- spin_unlock_bh(&wdev->action_registrations_lock);
+ spin_unlock_bh(&wdev->mgmt_registrations_lock);
return err;
}
-void cfg80211_mlme_unregister_actions(struct wireless_dev *wdev, u32 nlpid)
+void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid)
{
- struct cfg80211_action_registration *reg, *tmp;
+ struct cfg80211_mgmt_registration *reg, *tmp;
- spin_lock_bh(&wdev->action_registrations_lock);
+ spin_lock_bh(&wdev->mgmt_registrations_lock);
- list_for_each_entry_safe(reg, tmp, &wdev->action_registrations, list) {
+ list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) {
if (reg->nlpid == nlpid) {
list_del(®->list);
kfree(reg);
}
}
- spin_unlock_bh(&wdev->action_registrations_lock);
+ spin_unlock_bh(&wdev->mgmt_registrations_lock);
}
-void cfg80211_mlme_purge_actions(struct wireless_dev *wdev)
+void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev)
{
- struct cfg80211_action_registration *reg, *tmp;
+ struct cfg80211_mgmt_registration *reg, *tmp;
- spin_lock_bh(&wdev->action_registrations_lock);
+ spin_lock_bh(&wdev->mgmt_registrations_lock);
- list_for_each_entry_safe(reg, tmp, &wdev->action_registrations, list) {
+ list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) {
list_del(®->list);
kfree(reg);
}
- spin_unlock_bh(&wdev->action_registrations_lock);
+ spin_unlock_bh(&wdev->mgmt_registrations_lock);
}
-int cfg80211_mlme_action(struct cfg80211_registered_device *rdev,
- struct net_device *dev,
- struct ieee80211_channel *chan,
- enum nl80211_channel_type channel_type,
- bool channel_type_valid,
- const u8 *buf, size_t len, u64 *cookie)
+int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
+ struct net_device *dev,
+ struct ieee80211_channel *chan,
+ enum nl80211_channel_type channel_type,
+ bool channel_type_valid,
+ const u8 *buf, size_t len, u64 *cookie)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
const struct ieee80211_mgmt *mgmt;
+ u16 stype;
- if (rdev->ops->action == NULL)
+ if (!wdev->wiphy->mgmt_stypes)
return -EOPNOTSUPP;
+
+ if (!rdev->ops->mgmt_tx)
+ return -EOPNOTSUPP;
+
if (len < 24 + 1)
return -EINVAL;
mgmt = (const struct ieee80211_mgmt *) buf;
- if (!ieee80211_is_action(mgmt->frame_control))
+
+ if (!ieee80211_is_mgmt(mgmt->frame_control))
+ return -EINVAL;
+
+ stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
+ if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].tx & BIT(stype >> 4)))
return -EINVAL;
- if (mgmt->u.action.category != WLAN_CATEGORY_PUBLIC) {
+
+ if (ieee80211_is_action(mgmt->frame_control) &&
+ mgmt->u.action.category != WLAN_CATEGORY_PUBLIC) {
/* Verify that we are associated with the destination AP */
wdev_lock(wdev);
@@ -863,64 +896,75 @@ int cfg80211_mlme_action(struct cfg80211
return -EINVAL;
/* Transmit the Action frame as requested by user space */
- return rdev->ops->action(&rdev->wiphy, dev, chan, channel_type,
- channel_type_valid, buf, len, cookie);
+ return rdev->ops->mgmt_tx(&rdev->wiphy, dev, chan, channel_type,
+ channel_type_valid, buf, len, cookie);
}
-bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf,
- size_t len, gfp_t gfp)
+bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf,
+ size_t len, gfp_t gfp)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
- struct cfg80211_action_registration *reg;
- const u8 *action_data;
- int action_data_len;
+ struct cfg80211_mgmt_registration *reg;
+ const struct ieee80211_txrx_stypes *stypes =
+ &wiphy->mgmt_stypes[wdev->iftype];
+ struct ieee80211_mgmt *mgmt = (void *)buf;
+ const u8 *data;
+ int data_len;
bool result = false;
+ __le16 ftype = mgmt->frame_control &
+ cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE);
+ u16 stype;
+
+ stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
- /* frame length - min size excluding category */
- action_data_len = len - (IEEE80211_MIN_ACTION_SIZE - 1);
+ if (!(stypes->rx & BIT(stype)))
+ return false;
- /* action data starts with category */
- action_data = buf + IEEE80211_MIN_ACTION_SIZE - 1;
+ data = buf + ieee80211_hdrlen(mgmt->frame_control);
+ data_len = len - ieee80211_hdrlen(mgmt->frame_control);
- spin_lock_bh(&wdev->action_registrations_lock);
+ spin_lock_bh(&wdev->mgmt_registrations_lock);
+
+ list_for_each_entry(reg, &wdev->mgmt_registrations, list) {
+ if (reg->frame_type != ftype)
+ continue;
- list_for_each_entry(reg, &wdev->action_registrations, list) {
- if (reg->match_len > action_data_len)
+ if (reg->match_len > data_len)
continue;
- if (memcmp(reg->match, action_data, reg->match_len))
+ if (memcmp(reg->match, data, reg->match_len))
continue;
/* found match! */
/* Indicate the received Action frame to user space */
- if (nl80211_send_action(rdev, dev, reg->nlpid, freq,
- buf, len, gfp))
+ if (nl80211_send_mgmt(rdev, dev, reg->nlpid, freq,
+ buf, len, gfp))
continue;
result = true;
break;
}
- spin_unlock_bh(&wdev->action_registrations_lock);
+ spin_unlock_bh(&wdev->mgmt_registrations_lock);
return result;
}
-EXPORT_SYMBOL(cfg80211_rx_action);
+EXPORT_SYMBOL(cfg80211_rx_mgmt);
-void cfg80211_action_tx_status(struct net_device *dev, u64 cookie,
- const u8 *buf, size_t len, bool ack, gfp_t gfp)
+void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie,
+ const u8 *buf, size_t len, bool ack, gfp_t gfp)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
/* Indicate TX status of the Action frame to user space */
- nl80211_send_action_tx_status(rdev, dev, cookie, buf, len, ack, gfp);
+ nl80211_send_mgmt_tx_status(rdev, dev, cookie, buf, len, ack, gfp);
}
-EXPORT_SYMBOL(cfg80211_action_tx_status);
+EXPORT_SYMBOL(cfg80211_mgmt_tx_status);
void cfg80211_cqm_rssi_notify(struct net_device *dev,
enum nl80211_cqm_rssi_threshold_event rssi_event,
--- wireless-testing.orig/net/wireless/nl80211.h 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.h 2010-08-12 13:48:00.000000000 +0200
@@ -74,13 +74,13 @@ void nl80211_send_sta_event(struct cfg80
struct net_device *dev, const u8 *mac_addr,
struct station_info *sinfo, gfp_t gfp);
-int nl80211_send_action(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, u32 nlpid, int freq,
- const u8 *buf, size_t len, gfp_t gfp);
-void nl80211_send_action_tx_status(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, u64 cookie,
- const u8 *buf, size_t len, bool ack,
- gfp_t gfp);
+int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev, u32 nlpid, int freq,
+ const u8 *buf, size_t len, gfp_t gfp);
+void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev, u64 cookie,
+ const u8 *buf, size_t len, bool ack,
+ gfp_t gfp);
void
nl80211_send_cqm_rssi_notify(struct cfg80211_registered_device *rdev,
--- wireless-testing.orig/net/mac80211/cfg.c 2010-08-12 13:42:54.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2010-08-12 13:56:31.000000000 +0200
@@ -1541,11 +1541,11 @@ static int ieee80211_cancel_remain_on_ch
return ieee80211_wk_cancel_remain_on_channel(sdata, cookie);
}
-static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
- struct ieee80211_channel *chan,
- enum nl80211_channel_type channel_type,
- bool channel_type_valid,
- const u8 *buf, size_t len, u64 *cookie)
+static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
+ struct ieee80211_channel *chan,
+ enum nl80211_channel_type channel_type,
+ bool channel_type_valid,
+ const u8 *buf, size_t len, u64 *cookie)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
@@ -1645,6 +1645,6 @@ struct cfg80211_ops mac80211_config_ops
.set_bitrate_mask = ieee80211_set_bitrate_mask,
.remain_on_channel = ieee80211_remain_on_channel,
.cancel_remain_on_channel = ieee80211_cancel_remain_on_channel,
- .action = ieee80211_action,
+ .mgmt_tx = ieee80211_mgmt_tx,
.set_cqm_rssi_config = ieee80211_set_cqm_rssi_config,
};
--- wireless-testing.orig/net/mac80211/rx.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/mac80211/rx.c 2010-08-12 13:56:31.000000000 +0200
@@ -1929,13 +1929,36 @@ static void ieee80211_process_sa_query_r
}
static ieee80211_rx_result debug_noinline
+ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx)
+{
+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data;
+
+ /*
+ * From here on, look only at management frames.
+ * Data and control frames are already handled,
+ * and unknown (reserved) frames are useless.
+ */
+ if (rx->skb->len < 24)
+ return RX_DROP_MONITOR;
+
+ if (!ieee80211_is_mgmt(mgmt->frame_control))
+ return RX_DROP_MONITOR;
+
+ if (!(rx->flags & IEEE80211_RX_RA_MATCH))
+ return RX_DROP_MONITOR;
+
+ if (ieee80211_drop_unencrypted_mgmt(rx))
+ return RX_DROP_UNUSABLE;
+
+ return RX_CONTINUE;
+}
+
+static ieee80211_rx_result debug_noinline
ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
{
struct ieee80211_local *local = rx->local;
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data;
- struct sk_buff *nskb;
- struct ieee80211_rx_status *status;
int len = rx->skb->len;
if (!ieee80211_is_action(mgmt->frame_control))
@@ -1951,9 +1974,6 @@ ieee80211_rx_h_action(struct ieee80211_r
if (!(rx->flags & IEEE80211_RX_RA_MATCH))
return RX_DROP_UNUSABLE;
- if (ieee80211_drop_unencrypted_mgmt(rx))
- return RX_DROP_UNUSABLE;
-
switch (mgmt->u.action.category) {
case WLAN_CATEGORY_BACK:
/*
@@ -2044,17 +2064,36 @@ ieee80211_rx_h_action(struct ieee80211_r
goto queue;
}
+ return RX_CONTINUE;
+
invalid:
- /*
- * For AP mode, hostapd is responsible for handling any action
- * frames that we didn't handle, including returning unknown
- * ones. For all other modes we will return them to the sender,
- * setting the 0x80 bit in the action category, as required by
- * 802.11-2007 7.3.1.11.
- */
- if (sdata->vif.type == NL80211_IFTYPE_AP ||
- sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
- return RX_DROP_MONITOR;
+ rx->flags |= IEEE80211_MALFORMED_ACTION_FRM;
+ /* will return in the next handlers */
+ return RX_CONTINUE;
+
+ handled:
+ if (rx->sta)
+ rx->sta->rx_packets++;
+ dev_kfree_skb(rx->skb);
+ return RX_QUEUED;
+
+ queue:
+ rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
+ skb_queue_tail(&sdata->skb_queue, rx->skb);
+ ieee80211_queue_work(&local->hw, &sdata->work);
+ if (rx->sta)
+ rx->sta->rx_packets++;
+ return RX_QUEUED;
+}
+
+static ieee80211_rx_result debug_noinline
+ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx)
+{
+ struct ieee80211_rx_status *status;
+
+ /* skip known-bad action frames and return them in the next handler */
+ if (rx->flags & IEEE80211_MALFORMED_ACTION_FRM)
+ return RX_CONTINUE;
/*
* Getting here means the kernel doesn't know how to handle
@@ -2064,10 +2103,44 @@ ieee80211_rx_h_action(struct ieee80211_r
*/
status = IEEE80211_SKB_RXCB(rx->skb);
- if (cfg80211_rx_action(rx->sdata->dev, status->freq,
- rx->skb->data, rx->skb->len,
- GFP_ATOMIC))
- goto handled;
+ if (cfg80211_rx_mgmt(rx->sdata->dev, status->freq,
+ rx->skb->data, rx->skb->len,
+ GFP_ATOMIC)) {
+ if (rx->sta)
+ rx->sta->rx_packets++;
+ dev_kfree_skb(rx->skb);
+ return RX_QUEUED;
+ }
+
+
+ return RX_CONTINUE;
+}
+
+static ieee80211_rx_result debug_noinline
+ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
+{
+ struct ieee80211_local *local = rx->local;
+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data;
+ struct sk_buff *nskb;
+ struct ieee80211_sub_if_data *sdata = rx->sdata;
+
+ if (!ieee80211_is_action(mgmt->frame_control))
+ return RX_CONTINUE;
+
+ /*
+ * For AP mode, hostapd is responsible for handling any action
+ * frames that we didn't handle, including returning unknown
+ * ones. For all other modes we will return them to the sender,
+ * setting the 0x80 bit in the action category, as required by
+ * 802.11-2007 7.3.1.11.
+ * Newer versions of hostapd shall also use the management frame
+ * registration mechanisms, but older ones still use cooked
+ * monitor interfaces so push all frames there.
+ */
+ if (!(rx->flags & IEEE80211_MALFORMED_ACTION_FRM) &&
+ (sdata->vif.type == NL80211_IFTYPE_AP ||
+ sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
+ return RX_DROP_MONITOR;
/* do not return rejected action frames */
if (mgmt->u.action.category & 0x80)
@@ -2086,20 +2159,8 @@ ieee80211_rx_h_action(struct ieee80211_r
ieee80211_tx_skb(rx->sdata, nskb);
}
-
- handled:
- if (rx->sta)
- rx->sta->rx_packets++;
dev_kfree_skb(rx->skb);
return RX_QUEUED;
-
- queue:
- rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
- skb_queue_tail(&sdata->skb_queue, rx->skb);
- ieee80211_queue_work(&local->hw, &sdata->work);
- if (rx->sta)
- rx->sta->rx_packets++;
- return RX_QUEUED;
}
static ieee80211_rx_result debug_noinline
@@ -2110,15 +2171,6 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
struct ieee80211_mgmt *mgmt = (void *)rx->skb->data;
__le16 stype;
- if (!(rx->flags & IEEE80211_RX_RA_MATCH))
- return RX_DROP_MONITOR;
-
- if (rx->skb->len < 24)
- return RX_DROP_MONITOR;
-
- if (ieee80211_drop_unencrypted_mgmt(rx))
- return RX_DROP_UNUSABLE;
-
rxs = ieee80211_work_rx_mgmt(rx->sdata, rx->skb);
if (rxs != RX_CONTINUE)
return rxs;
@@ -2346,7 +2398,10 @@ static void ieee80211_invoke_rx_handlers
if (res != RX_CONTINUE)
goto rxh_next;
+ CALL_RXH(ieee80211_rx_h_mgmt_check)
CALL_RXH(ieee80211_rx_h_action)
+ CALL_RXH(ieee80211_rx_h_userspace_mgmt)
+ CALL_RXH(ieee80211_rx_h_action_return)
CALL_RXH(ieee80211_rx_h_mgmt)
#undef CALL_RXH
@@ -2453,7 +2508,7 @@ static int prepare_for_handlers(struct i
break;
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_UNSPECIFIED:
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
/* should never get here */
WARN_ON(1);
break;
--- wireless-testing.orig/net/mac80211/status.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/mac80211/status.c 2010-08-12 13:48:00.000000000 +0200
@@ -296,7 +296,7 @@ void ieee80211_tx_status(struct ieee8021
}
if (info->flags & IEEE80211_TX_INTFL_NL80211_FRAME_TX)
- cfg80211_action_tx_status(
+ cfg80211_mgmt_tx_status(
skb->dev, (unsigned long) skb, skb->data, skb->len,
!!(info->flags & IEEE80211_TX_STAT_ACK), GFP_ATOMIC);
--- wireless-testing.orig/net/mac80211/main.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/mac80211/main.c 2010-08-12 13:56:31.000000000 +0200
@@ -390,6 +390,41 @@ static int ieee80211_ifa_changed(struct
}
#endif
+/* There isn't a lot of sense in it, but you can transmit anything you like */
+static const struct ieee80211_txrx_stypes
+ieee80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
+ [NL80211_IFTYPE_ADHOC] = {
+ .tx = 0xffff,
+ .rx = BIT(IEEE80211_STYPE_ACTION >> 4),
+ },
+ [NL80211_IFTYPE_STATION] = {
+ .tx = 0xffff,
+ .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+ BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
+ },
+ [NL80211_IFTYPE_AP] = {
+ .tx = 0xffff,
+ .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+ BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
+ BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+ BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+ BIT(IEEE80211_STYPE_AUTH >> 4) |
+ BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+ BIT(IEEE80211_STYPE_ACTION >> 4),
+ },
+ [NL80211_IFTYPE_AP_VLAN] = {
+ /* copy AP */
+ .tx = 0xffff,
+ .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+ BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
+ BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+ BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+ BIT(IEEE80211_STYPE_AUTH >> 4) |
+ BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+ BIT(IEEE80211_STYPE_ACTION >> 4),
+ },
+};
+
struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
const struct ieee80211_ops *ops)
{
@@ -419,6 +454,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(
if (!wiphy)
return NULL;
+ wiphy->mgmt_stypes = ieee80211_default_mgmt_stypes;
+
wiphy->flags |= WIPHY_FLAG_NETNS_OK |
WIPHY_FLAG_4ADDR_AP |
WIPHY_FLAG_4ADDR_STATION;
--- wireless-testing.orig/net/wireless/util.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/wireless/util.c 2010-08-12 14:17:29.000000000 +0200
@@ -823,7 +823,7 @@ int cfg80211_change_iface(struct cfg8021
/* monitor can't bridge anyway */
break;
case NL80211_IFTYPE_UNSPECIFIED:
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
/* not happening */
break;
}
--- wireless-testing.orig/net/mac80211/iface.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/mac80211/iface.c 2010-08-12 13:56:31.000000000 +0200
@@ -177,7 +177,7 @@ static int ieee80211_open(struct net_dev
/* no special treatment */
break;
case NL80211_IFTYPE_UNSPECIFIED:
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
/* cannot happen */
WARN_ON(1);
break;
@@ -630,7 +630,7 @@ static void ieee80211_teardown_sdata(str
case NL80211_IFTYPE_MONITOR:
break;
case NL80211_IFTYPE_UNSPECIFIED:
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
BUG();
break;
}
@@ -882,7 +882,7 @@ static void ieee80211_setup_sdata(struct
case NL80211_IFTYPE_AP_VLAN:
break;
case NL80211_IFTYPE_UNSPECIFIED:
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
BUG();
break;
}
--- wireless-testing.orig/net/mac80211/util.c 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/mac80211/util.c 2010-08-12 13:56:31.000000000 +0200
@@ -471,7 +471,7 @@ void ieee80211_iterate_active_interfaces
list_for_each_entry(sdata, &local->interfaces, list) {
switch (sdata->vif.type) {
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_AP_VLAN:
@@ -505,7 +505,7 @@ void ieee80211_iterate_active_interfaces
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
switch (sdata->vif.type) {
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_AP_VLAN:
@@ -1189,7 +1189,7 @@ int ieee80211_reconfig(struct ieee80211_
/* ignore virtual */
break;
case NL80211_IFTYPE_UNSPECIFIED:
- case __NL80211_IFTYPE_AFTER_LAST:
+ case NUM_NL80211_IFTYPES:
WARN_ON(1);
break;
}
--- wireless-testing.orig/net/mac80211/ieee80211_i.h 2010-08-12 13:36:55.000000000 +0200
+++ wireless-testing/net/mac80211/ieee80211_i.h 2010-08-12 13:48:00.000000000 +0200
@@ -170,6 +170,7 @@ typedef unsigned __bitwise__ ieee80211_r
#define IEEE80211_RX_RA_MATCH BIT(1)
#define IEEE80211_RX_AMSDU BIT(2)
#define IEEE80211_RX_FRAGMENTED BIT(3)
+#define IEEE80211_MALFORMED_ACTION_FRM BIT(4)
/* only add flags here that do not change with subframes of an aMPDU */
struct ieee80211_rx_data {
^ permalink raw reply
* Re: Hi,Linus Torvalds. There's a problem in r8192u driver in Linux new kernel.
From: Linus Torvalds @ 2010-08-12 16:06 UTC (permalink / raw)
To: Gauss Frank
Cc: linux-wireless, Greg Kroah-Hartman, Bartlomiej Zolnierkiewicz,
Jerry chuang, Florian Schilhabel
In-Reply-To: <AANLkTi=1NaRKc8QrQBGwU+c_17D86_Cqu9MopR_rso0H@mail.gmail.com>
On Thu, Aug 12, 2010 at 3:24 AM, Gauss Frank <gaussfrank@gmail.com> wrote:
> I'm using Debian and Ubuntu.
>
> In Ubuntu, I compiled Linux 2.6.35-1,which contains RealTek 8192U Wireless
> Driver. I'd installed firmware for r8192u, and I tried to connect to
> wireless.
>
> However, whenever I connect to a wireless-network, The Linux System freezes.
> And the computer can keep only a few time and it must freezes without
> connecting to a wireless network.
>
> I'm using Debian Lenny with an old version of Linux Kernel,2.6.26-2. I
> downloaded the old driver(2008) in www.d-link.com, and compiled, which can't
> be compiled in new Linux Kernel because of some struct or union redefined.
> and it runs well.
>
> So I make sure that the problem is from Linux Kernel or The Driver.
Please don't send reports like this to me privately, there's no point.
I won't be able to fix individual drivers that I don't know. Make a
public report, and try to figure out who is in charge of that driver.
I've added the most active rtl8192 authors/people to the Cc, along
with linux-wireless. Hopefully that includes somebody who can help.
Linus
^ permalink raw reply
* Re: Hi,Linus Torvalds. There's a problem in r8192u driver in Linux new kernel.
From: Greg KH @ 2010-08-12 16:19 UTC (permalink / raw)
To: Gauss Frank
Cc: Linus Torvalds, linux-wireless, Bartlomiej Zolnierkiewicz,
Jerry chuang, Florian Schilhabel
In-Reply-To: <AANLkTin3qXSbuWejTGJzz6cO6fycK4HqU4gn4gF1wEdp@mail.gmail.com>
On Thu, Aug 12, 2010 at 09:06:07AM -0700, Linus Torvalds wrote:
> On Thu, Aug 12, 2010 at 3:24 AM, Gauss Frank <gaussfrank@gmail.com> wrote:
> > I'm using Debian and Ubuntu.
> >
> > In Ubuntu, I compiled Linux 2.6.35-1,which contains RealTek 8192U Wireless
> > Driver. I'd installed firmware for r8192u, and I tried to connect to
> > wireless.
Can you try a kernel.org kernel release, and not a Ubuntu kernel? If
not, you're going to have to report this to the Ubuntu developers, not
much we can do here.
If so, can you see if the in-kernel version of the driver has ever
worked for your system? Try an older release, like 2.6.34 or 2.6.32 and
see if that works.
thanks,
greg k-h
^ permalink raw reply
* Re: Hi,Linus Torvalds. There's a problem in r8192u driver in Linux new kernel.
From: Larry Finger @ 2010-08-12 16:36 UTC (permalink / raw)
To: Gauss Frank
Cc: Linus Torvalds, linux-wireless, Greg Kroah-Hartman,
Bartlomiej Zolnierkiewicz, Jerry chuang, Florian Schilhabel
In-Reply-To: <AANLkTin3qXSbuWejTGJzz6cO6fycK4HqU4gn4gF1wEdp@mail.gmail.com>
Gauss,
What is the USB ID for your device. The reason I'm asking is that Florian and I
have been working on porting a new vendor driver for the 8192u devices. The plan
is to submit this to staging. At the moment, it has been tested with big- and
little-endian, and 32- and 64-bit systems. Everything is working except for
suspend and resume.
If your device is one of those that Realtek says works with this driver, and you
are willing to build a kernel from scratch, I will send you the URL for a git
tree containing it. That will have to be done privately as I'm still waiting for
Realtek to approve the copyright statements in the code. It is GPL'ed, so I do
not expect any difficulties, but their lawyers have to sign off.
Larry
^ permalink raw reply
* Re: [PATCH v2] cfg80211: fix race between sysfs and cfg80211
From: Maxime Bizon @ 2010-08-12 18:41 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1279852170.14136.0.camel@sakura.staff.proxad.net>
On Fri, 2010-07-23 at 04:29 +0200, Maxime Bizon wrote:
Hi,
> From: Maxime Bizon <mbizon@freebox.fr>
Any comment/ACK/NACK on this ?
Thanks,
--
Maxime
^ permalink raw reply
* Re: [PATCH v2] cfg80211: fix race between sysfs and cfg80211
From: Johannes Berg @ 2010-08-12 18:42 UTC (permalink / raw)
To: mbizon; +Cc: linux-wireless
In-Reply-To: <1281638499.12446.498.camel@sakura.staff.proxad.net>
On Thu, 2010-08-12 at 20:41 +0200, Maxime Bizon wrote:
> On Fri, 2010-07-23 at 04:29 +0200, Maxime Bizon wrote:
>
> Hi,
>
> > From: Maxime Bizon <mbizon@freebox.fr>
>
> Any comment/ACK/NACK on this ?
Err, it was merged a long time ago
johannes
^ permalink raw reply
* Compat-wireless release for 2010-08-12 is baked
From: Compat-wireless cronjob account @ 2010-08-12 19:04 UTC (permalink / raw)
To: linux-wireless
>From git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
38c112b..286bff9 history -> origin/history
+ e71de56...ab5f7cf master -> origin/master (forced update)
3d30701..5af568c stable -> origin/stable
* [new tag] next-20100812 -> next-20100812
compat-wireless code metrics
494644 - Total upstream lines of code being pulled
^ permalink raw reply
* Re: rt61pci - bad performance
From: Andrew Morton @ 2010-08-12 23:11 UTC (permalink / raw)
To: Andreas; +Cc: linux-kernel, Ivo van Doorn, Gertjan van Wingerde, linux-wireless
In-Reply-To: <i3lug9$bfn$1@ID-44327.news.uni-berlin.de>
(cc's added)
On Sun, 08 Aug 2010 11:49:49 +0200
Andreas <andihartmann@01019freenet.de> wrote:
> Hello!
>
> I've got the following hardware
>
>
> 01:05.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
> Subsystem: Micro-Star International Co., Ltd. Device b833
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 128, Cache Line Size: 64 bytes
> Interrupt: pin A routed to IRQ 21
> Region 0: Memory at cc000000 (32-bit, non-prefetchable) [size=32K]
> Capabilities: [40] Power Management version 2
> Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
> Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
> Kernel driver in use: ndiswrapper
>
>
> running on a 32bit notebook with kernel 2.6.34-12-desktop (OpenSuSE
> 11.3). There is no difference between the compat-wireless-modules
> 2010-07-20 and the original modules shipped with the openSuSE 11.3 kernel.
>
> If the rt61-chip is connected to a AP using rt61pci, the best
> throughput, which can be achieved (at the same place), is about 1,7
> MBytes/s.
>
> kernel: [ 656.112190] cfg80211: Calling CRDA to update world regulatory
> domain
> kernel: [ 656.112267] cfg80211: Calling CRDA for country: DE
> kernel: [ 656.169518] cfg80211: Regulatory domain changed to country: DE
> kernel: [ 656.169524] (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> kernel: [ 656.169528] (2400000 KHz - 2483500 KHz @ 40000 KHz),
> (N/A, 2000 mBm)
> kernel: [ 656.169532] (5150000 KHz - 5350000 KHz @ 40000 KHz),
> (N/A, 2000 mBm)
> kernel: [ 656.169535] (5470000 KHz - 5725000 KHz @ 40000 KHz),
> (N/A, 2698 mBm)
> kernel: [ 656.206228] rt61pci 0000:01:05.0: PCI INT A -> GSI 21 (level,
> low) -> IRQ 21
> kernel: [ 656.219941] phy0: Selected rate control algorithm 'minstrel'
> kernel: [ 656.222216] Registered led device: rt61pci-phy0::radio
> kernel: [ 656.222658] Registered led device: rt61pci-phy0::assoc
> kernel: notebook1 ifup: wlan0 device: RaLink RT2561/RT61 rev B
> 802.11g
>
>
>
> wlan0 IEEE 802.11bg ESSID:"--------"
> Mode:Managed Frequency:2.412 GHz Access Point: some AP
> Bit Rate=1 Mb/s Tx-Power=5 dBm
> Retry long limit:7 RTS thr:off Fragment thr:off
> Encryption key:off
> Power Management:off
> Link Quality=38/70 Signal level=-72 dBm
> Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
> Tx excessive retries:0 Invalid misc:0 Missed beacon:0
>
> The throughput is measured with ping -f -s 7000 and xosview -n.
>
>
>
>
> If I'm using ndiswrapper with the windows driver, first of all, I can
> see additional information in iwconfig:
>
> wlan0 IEEE 802.11g ESSID:"--------"
> Mode:Managed Frequency:2.412 GHz Access Point: some AP
> Bit Rate=54 Mb/s Tx-Power:20 dBm Sensitivity=-121 dBm
> RTS thr=2347 B Fragment thr=2346 B
> Encryption key:some key Security mode:restricted
> Power Management:off
> Link Quality:62/100 Signal level:-56 dBm Noise level:-96 dBm
> Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
> Tx excessive retries:0 Invalid misc:0 Missed beacon:0
>
>
> There is a switch for sensitivity (which is not supported with rt61pci)
> and the link quality compared with ndiswrapper is worse (38% to 62%).
>
> The following is remarkably too:
> ndiswrapper uses a Tx-Power of 20 dBm, rt61pci only 5 dBm. I don't know,
> why rt61pci uses 5 dBm. It's a hard limit and I can't set it on a value
> higher than 5 unless the driver is patched. Nevertheless, setting a
> higher value (of 20 dBm) by patch does not mean to get a better performance.
> Ndiswrapper shows an encryption key, rt61pci not. Does it mean, that
> rt61pci doesn't use hardware encryption?
>
>
> With ndiswrapper, the rt61pci-chip achieves a throughput of 2,6 MBytes/s
> - that's about 1 MByte/s more than rt61pci.
>
> I have to say, that the difference between rt61pci and ndiswrapper gets
> worse if the link quality is getting more badly. Or in other words:
> ndiswrapper handles bad connections better then rt61pci.
>
>
> Do you have any idea to get rt61pci working as fast as ndiswrapper?
>
^ permalink raw reply
* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Ohad Ben-Cohen @ 2010-08-13 0:01 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: DebBarma, Tarun Kanti, felipe.balbi@nokia.com, Kalle Valo,
Pandita, Vikram, akpm@linux-foundation.org,
Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
linux-wireless@vger.kernel.org, Mark Brown,
linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
Chikkature Rajashekar, Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <20100812095546.GA3354@n2100.arm.linux.org.uk>
On Thursday, August 12, 2010, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Aug 12, 2010 at 09:40:19AM +0300, Ohad Ben-Cohen wrote:
>> On Thu, Aug 12, 2010 at 12:25 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> >I've outlined a far simpler and easiler solution
>> > which avoids this kind of abuse, and given suggestions on how to extend
>> > it to support multiple instances.
>> >
>>
>> Do you mean:
>> http://www.spinics.net/lists/arm-kernel/msg95338.html
>> ?
>>
>> I was under the impression you eventually discarded that approach in
>> that post.
>
> Indeed.
>
> I'm talking about my first suggestion:
>
> http://lists.arm.linux.org.uk/lurker/message/20100804.114148.bf961e83.en.html
>
> which was later expanded by Vitaly:
>
> http://lists.arm.linux.org.uk/lurker/message/20100804.140119.f476c29c.en.html
>
> I don't think anyone had any negative comments against that proposal.
Thanks, I see what you mean now.
I'll give this a spin when I'm back (I'm away until e/o August)
>
^ permalink raw reply
* Re: rt61pci - bad performance
From: Helmut Schaa @ 2010-08-13 8:35 UTC (permalink / raw)
To: Andreas
Cc: Andrew Morton, linux-kernel, Ivo van Doorn, Gertjan van Wingerde,
linux-wireless
In-Reply-To: <20100812161157.00d5377f.akpm@linux-foundation.org>
Hi Andreas,
Am Freitag 13 August 2010 schrieb Andrew Morton:
> (cc's added)
>
> On Sun, 08 Aug 2010 11:49:49 +0200
> Andreas <andihartmann@01019freenet.de> wrote:
[...]
> > wlan0 IEEE 802.11bg ESSID:"--------"
> > Mode:Managed Frequency:2.412 GHz Access Point: some AP
> > Bit Rate=1 Mb/s Tx-Power=5 dBm
> > Retry long limit:7 RTS thr:off Fragment thr:off
> > Encryption key:off
> > Power Management:off
> > Link Quality=38/70 Signal level=-72 dBm
> > Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
> > Tx excessive retries:0 Invalid misc:0 Missed beacon:0
> >
> > The throughput is measured with ping -f -s 7000 and xosview -n.
This doesn't look like an appropriate way to measure the throughput. You
should use something like iperf [1] or netperf [2] for your measurements
to get more accurate results.
> > If I'm using ndiswrapper with the windows driver, first of all, I can
> > see additional information in iwconfig:
> >
> > wlan0 IEEE 802.11g ESSID:"--------"
> > Mode:Managed Frequency:2.412 GHz Access Point: some AP
> > Bit Rate=54 Mb/s Tx-Power:20 dBm Sensitivity=-121 dBm
> > RTS thr=2347 B Fragment thr=2346 B
> > Encryption key:some key Security mode:restricted
> > Power Management:off
> > Link Quality:62/100 Signal level:-56 dBm Noise level:-96 dBm
> > Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
> > Tx excessive retries:0 Invalid misc:0 Missed beacon:0
> >
> >
> > There is a switch for sensitivity (which is not supported with rt61pci)
> > and the link quality compared with ndiswrapper is worse (38% to 62%).
I wouldn't trust the link quality values that much, the calculation in rt61pi
is most likely different from what the windows driver does. So it is not
really comparable.
> > The following is remarkably too:
> > ndiswrapper uses a Tx-Power of 20 dBm, rt61pci only 5 dBm. I don't know,
> > why rt61pci uses 5 dBm. It's a hard limit and I can't set it on a value
> > higher than 5 unless the driver is patched. Nevertheless, setting a
> > higher value (of 20 dBm) by patch does not mean to get a better performance.
Could you elaborate please? Did you actually try to patch it or is this just
an assumption?
> > Ndiswrapper shows an encryption key, rt61pci not. Does it mean, that
> > rt61pci doesn't use hardware encryption?
hw crypto should be enabled by default in rt61pci, however, I don't know
if it is actually working ;)
> > With ndiswrapper, the rt61pci-chip achieves a throughput of 2,6 MBytes/s
> > - that's about 1 MByte/s more than rt61pci.
> >
> > I have to say, that the difference between rt61pci and ndiswrapper gets
> > worse if the link quality is getting more badly. Or in other words:
> > ndiswrapper handles bad connections better then rt61pci.
> >
> >
> > Do you have any idea to get rt61pci working as fast as ndiswrapper?
Please run proper measurements first and post the results again.
Thanks,
Helmut
[1] http://sourceforge.net/projects/iperf/
[2] http://www.netperf.org/
^ permalink raw reply
* [PATCH 1/1] wl1251: fix trigger scan timeout usage
From: ext-yuri.kululin @ 2010-08-13 9:46 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ameya.palande, ext-yuri.kululin
From: Yuri Kululin <ext-yuri.kululin@nokia.com>
Use appropriate command (CMD_TRIGGER_SCAN_TO) instead of scan command
(CMD_SCAN) to configure trigger scan timeout.
This was broken in commit 3a98c30f3e8bb1f32b5bcb74a39647b3670de275.
Cc: stable@kernel.org
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
---
drivers/net/wireless/wl12xx/wl1251_cmd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.c b/drivers/net/wireless/wl12xx/wl1251_cmd.c
index a37b30c..ce3722f 100644
--- a/drivers/net/wireless/wl12xx/wl1251_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1251_cmd.c
@@ -484,7 +484,7 @@ int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout)
cmd->timeout = timeout;
- ret = wl1251_cmd_send(wl, CMD_SCAN, cmd, sizeof(*cmd));
+ ret = wl1251_cmd_send(wl, CMD_TRIGGER_SCAN_TO, cmd, sizeof(*cmd));
if (ret < 0) {
wl1251_error("cmd trigger scan to failed: %d", ret);
goto out;
--
1.7.1.1
^ permalink raw reply related
* Re: [PATCH 1/1] wl1251: fix trigger scan timeout usage
From: Kalle Valo @ 2010-08-13 12:33 UTC (permalink / raw)
To: ext-yuri.kululin; +Cc: linux-wireless, ameya.palande
In-Reply-To: <8ca8a9b93496d16bc8b5956c3a7976c08b95282c.1281691901.git.ext-yuri.kululin@nokia.com>
ext-yuri.kululin@nokia.com writes:
> From: Yuri Kululin <ext-yuri.kululin@nokia.com>
>
> Use appropriate command (CMD_TRIGGER_SCAN_TO) instead of scan command
> (CMD_SCAN) to configure trigger scan timeout.
>
> This was broken in commit 3a98c30f3e8bb1f32b5bcb74a39647b3670de275.
Good find. I broke this last January, sorry about that.
John, the patch fixes this bug:
https://bugzilla.kernel.org/show_bug.cgi?id=16554
If possible, try to get this to 2.6.36. Otherwise wl1251 is more or
less broken. I'll make sure that this goes to stable releases as well.
> Cc: stable@kernel.org
> Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
> Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Thanks.
--
Kalle Valo
^ permalink raw reply
* [PATCH] ath9k_htc: load proper firmware for device ID 7015
From: Rajkumar Manoharan @ 2010-08-13 13:06 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Rajkumar Manoharan
This patch handles the firmware loading properly
for device ID 7015.
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
drivers/net/wireless/ath/ath9k/eeprom.h | 1 +
drivers/net/wireless/ath/ath9k/eeprom_9287.c | 7 ++++++-
drivers/net/wireless/ath/ath9k/hif_usb.c | 8 ++------
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 +
drivers/net/wireless/ath/ath9k/reg.h | 1 +
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 8750c55..7f48df1 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -191,6 +191,7 @@
#define AR9287_EEP_NO_BACK_VER AR9287_EEP_MINOR_VER_1
#define AR9287_EEP_START_LOC 128
+#define AR9287_HTC_EEP_START_LOC 256
#define AR9287_NUM_2G_CAL_PIERS 3
#define AR9287_NUM_2G_CCK_TARGET_POWERS 3
#define AR9287_NUM_2G_20_TARGET_POWERS 3
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 4a52cf0..dff2da7 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -34,9 +34,14 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
struct ar9287_eeprom *eep = &ah->eeprom.map9287;
struct ath_common *common = ath9k_hw_common(ah);
u16 *eep_data;
- int addr, eep_start_loc = AR9287_EEP_START_LOC;
+ int addr, eep_start_loc;
eep_data = (u16 *)eep;
+ if (ah->hw_version.devid == 0x7015)
+ eep_start_loc = AR9287_HTC_EEP_START_LOC;
+ else
+ eep_start_loc = AR9287_EEP_START_LOC;
+
if (!ath9k_hw_use_flash(ah)) {
ath_print(common, ATH_DBG_EEPROM,
"Reading from EEPROM, not flash\n");
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 61c1bee..17e7a9a 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -799,7 +799,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
}
kfree(buf);
- if (hif_dev->device_id == 0x7010)
+ if ((hif_dev->device_id == 0x7010) || (hif_dev->device_id == 0x7015))
firm_offset = AR7010_FIRMWARE_TEXT;
else
firm_offset = AR9271_FIRMWARE_TEXT;
@@ -901,6 +901,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
switch(hif_dev->device_id) {
case 0x7010:
+ case 0x7015:
case 0x9018:
if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202)
hif_dev->fw_name = FIRMWARE_AR7010_1_1;
@@ -912,11 +913,6 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
break;
}
- if (!hif_dev->fw_name) {
- dev_err(&udev->dev, "Can't determine firmware !\n");
- goto err_htc_hw_alloc;
- }
-
ret = ath9k_hif_usb_dev_init(hif_dev);
if (ret) {
ret = -EINVAL;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 148b433..2d42791 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -245,6 +245,7 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid)
switch(devid) {
case 0x7010:
+ case 0x7015:
case 0x9018:
priv->htc->credits = 45;
break;
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index 633e3d9..d01c4ad 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -899,6 +899,7 @@
#define AR_DEVID_7010(_ah) \
(((_ah)->hw_version.devid == 0x7010) || \
+ ((_ah)->hw_version.devid == 0x7015) || \
((_ah)->hw_version.devid == 0x9018))
#define AR_RADIO_SREV_MAJOR 0xf0
--
1.7.2.1
^ permalink raw reply related
* cfg80211 support for pre-auth
From: Dhiraj Gaurh @ 2010-08-13 14:40 UTC (permalink / raw)
To: linux-wireless
Hello folks,
PMK caching and pre-auth are not currently supported by
cfg80211/nl80211/supplicant. Actually the former is only not supported
by wpa_supplicant. I have fixed that and will be moving the code
upstream shortly.
BUT the latter is not even supported by cfg/nl. Anybody working on
that ? Actually support is not even there for using wext in this
scenario. So you just fail certification if you use cfg/nl. I need to
change this scenario.
Currently thinking if it is better to add support in cfg/nl/supplicant
or just use wext stuff and a patch.
I need an API in cfg80211 to let the driver tell cfg that it has got
beacon from another AP it can preauth with. Then the supplicant will
start the pre-auth process when it receives the message.
Currently in wext the IWEVPMKIDCAND is used for this to pass this info
from drivers to supplicant but this framework does not exist for
cfg80211.
After my changes, hopefully you will be able to pass certification by
simply using cfg/nl and removing wext entirely from the picture.
regards
Dhiraj
^ permalink raw reply
* [PATCH] ath5k: disable ASPM L0s for all cards
From: Luis R. Rodriguez @ 2010-08-13 15:27 UTC (permalink / raw)
To: linville
Cc: linux-wireless, ath5k-devel, linux-kernel, Maxim Levitsky,
David Quan, Matthew Garrett, Tim Gardner, Jussi Kivilinna, stable,
Luis R. Rodriguez
From: Maxim Levitsky <maximlevitsky@gmail.com>
Atheros PCIe wireless cards handled by ath5k do require L0s disabled.
For distributions shipping with CONFIG_PCIEASPM (this will be enabled
by default in the future in 2.6.36) this will also mean both L1 and L0s
will be disabled when a pre 1.1 PCIe device is detected. We do know L1
works correctly even for all ath5k pre 1.1 PCIe devices though but cannot
currently undue the effect of a blacklist, for details you can read
pcie_aspm_sanity_check() and see how it adjusts the device link
capability.
It may be possible in the future to implement some PCI API to allow
drivers to override blacklists for pre 1.1 PCIe but for now it is
best to accept that both L0s and L1 will be disabled completely for
distributions shipping with CONFIG_PCIEASPM rather than having this
issue present. Motivation for adding this new API will be to help
with power consumption for some of these devices.
Example of issues you'd see:
- On the Acer Aspire One (AOA150, Atheros Communications Inc. AR5001
Wireless Network Adapter [168c:001c] (rev 01)) doesn't work well
with ASPM enabled, the card will eventually stall on heavy traffic
with often 'unsupported jumbo' warnings appearing. Disabling
ASPM L0s in ath5k fixes these problems.
- On the same card you would see a storm of RXORN interrupts
even though medium is idle.
Credit for root causing and fixing the bug goes to Jussi Kivilinna.
Cc: David Quan <David.Quan@atheros.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Tim Gardner <tim.gardner@canonical.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
Maxim, it was just reported this patch never made it upstream
so I just took the liberty to submit it and also clear up the
commit log and comments a little more in terms of actual impact
and possible future fixes. I've also Cc'd stable so this can
get propagated down to 2.6.32 as well.
drivers/net/wireless/ath/ath5k/base.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 0d5de25..373dcfe 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -48,6 +48,7 @@
#include <linux/netdevice.h>
#include <linux/cache.h>
#include <linux/pci.h>
+#include <linux/pci-aspm.h>
#include <linux/ethtool.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
@@ -476,6 +477,26 @@ ath5k_pci_probe(struct pci_dev *pdev,
int ret;
u8 csz;
+ /*
+ * L0s needs to be disabled on all ath5k cards.
+ *
+ * For distributions shipping with CONFIG_PCIEASPM (this will be enabled
+ * by default in the future in 2.6.36) this will also mean both L1 and
+ * L0s will be disabled when a pre 1.1 PCIe device is detected. We do
+ * know L1 works correctly even for all ath5k pre 1.1 PCIe devices
+ * though but cannot currently undue the effect of a blacklist, for
+ * details you can read pcie_aspm_sanity_check() and see how it adjusts
+ * the device link capability.
+ *
+ * It may be possible in the future to implement some PCI API to allow
+ * drivers to override blacklists for pre 1.1 PCIe but for now it is
+ * best to accept that both L0s and L1 will be disabled completely for
+ * distributions shipping with CONFIG_PCIEASPM rather than having this
+ * issue present. Motivation for adding this new API will be to help
+ * with power consumption for some of these devices.
+ */
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
+
ret = pci_enable_device(pdev);
if (ret) {
dev_err(&pdev->dev, "can't enable device\n");
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] ath5k: disable ASPM L0s for all cards
From: Maxim Levitsky @ 2010-08-13 15:45 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: linville, linux-wireless, ath5k-devel, linux-kernel, David Quan,
Matthew Garrett, Tim Gardner, Jussi Kivilinna, stable
In-Reply-To: <1281713248-25761-1-git-send-email-lrodriguez@atheros.com>
On Fri, 2010-08-13 at 11:27 -0400, Luis R. Rodriguez wrote:
> From: Maxim Levitsky <maximlevitsky@gmail.com>
>
> Atheros PCIe wireless cards handled by ath5k do require L0s disabled.
> For distributions shipping with CONFIG_PCIEASPM (this will be enabled
> by default in the future in 2.6.36) this will also mean both L1 and L0s
> will be disabled when a pre 1.1 PCIe device is detected. We do know L1
> works correctly even for all ath5k pre 1.1 PCIe devices though but cannot
> currently undue the effect of a blacklist, for details you can read
> pcie_aspm_sanity_check() and see how it adjusts the device link
> capability.
>
> It may be possible in the future to implement some PCI API to allow
> drivers to override blacklists for pre 1.1 PCIe but for now it is
> best to accept that both L0s and L1 will be disabled completely for
> distributions shipping with CONFIG_PCIEASPM rather than having this
> issue present. Motivation for adding this new API will be to help
> with power consumption for some of these devices.
>
> Example of issues you'd see:
>
> - On the Acer Aspire One (AOA150, Atheros Communications Inc. AR5001
> Wireless Network Adapter [168c:001c] (rev 01)) doesn't work well
> with ASPM enabled, the card will eventually stall on heavy traffic
> with often 'unsupported jumbo' warnings appearing. Disabling
> ASPM L0s in ath5k fixes these problems.
>
> - On the same card you would see a storm of RXORN interrupts
> even though medium is idle.
>
> Credit for root causing and fixing the bug goes to Jussi Kivilinna.
>
> Cc: David Quan <David.Quan@atheros.com>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> Cc: Tim Gardner <tim.gardner@canonical.com>
> Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
> Cc: stable@kernel.org
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> ---
>
> Maxim, it was just reported this patch never made it upstream
> so I just took the liberty to submit it and also clear up the
> commit log and comments a little more in terms of actual impact
> and possible future fixes. I've also Cc'd stable so this can
> get propagated down to 2.6.32 as well.
Sure. In fact I don't deserve much credit on this patch. It is just one
line and besides ASPM is disabled anyway.
Thanks for Jussi Kivilinna again for finding this.
Best regards,
Maxim Levitsky
>
> drivers/net/wireless/ath/ath5k/base.c | 21 +++++++++++++++++++++
> 1 files changed, 21 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 0d5de25..373dcfe 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -48,6 +48,7 @@
> #include <linux/netdevice.h>
> #include <linux/cache.h>
> #include <linux/pci.h>
> +#include <linux/pci-aspm.h>
> #include <linux/ethtool.h>
> #include <linux/uaccess.h>
> #include <linux/slab.h>
> @@ -476,6 +477,26 @@ ath5k_pci_probe(struct pci_dev *pdev,
> int ret;
> u8 csz;
>
> + /*
> + * L0s needs to be disabled on all ath5k cards.
> + *
> + * For distributions shipping with CONFIG_PCIEASPM (this will be enabled
> + * by default in the future in 2.6.36) this will also mean both L1 and
> + * L0s will be disabled when a pre 1.1 PCIe device is detected. We do
> + * know L1 works correctly even for all ath5k pre 1.1 PCIe devices
> + * though but cannot currently undue the effect of a blacklist, for
> + * details you can read pcie_aspm_sanity_check() and see how it adjusts
> + * the device link capability.
> + *
> + * It may be possible in the future to implement some PCI API to allow
> + * drivers to override blacklists for pre 1.1 PCIe but for now it is
> + * best to accept that both L0s and L1 will be disabled completely for
> + * distributions shipping with CONFIG_PCIEASPM rather than having this
> + * issue present. Motivation for adding this new API will be to help
> + * with power consumption for some of these devices.
> + */
> + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
> +
> ret = pci_enable_device(pdev);
> if (ret) {
> dev_err(&pdev->dev, "can't enable device\n");
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox