Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: Start dropping PCMCIA from compat-wireless for 2.6.38+
From: Holger Schurig @ 2010-12-16 13:17 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <AANLkTimWaopJnU5T6OZvqm4YSvSZeXs0dh7oMfU+ERJ8@mail.gmail.com>

> You use libertas_cs on an embedded device with compat-wireless, OK,
> thanks for the feedback. If you can help with patches when PCMCIA crap
> is advanced that would help too.

The problem is that I work on this in an on-off way. If a customer 
notices some heavy bug with the current kernel on our devices, I'll do 
the upgrade dance. As long as everything works, I'm lazy --- or busy 
doing other things.

And I'm looking for a new job anyway :-)

Greetings,
Holger

-- 
Homepage: http://www.holgerschurig.de

^ permalink raw reply

* Re: Realtek rtl8188 support?
From: Walter Goldens @ 2010-12-16 13:25 UTC (permalink / raw)
  To: Larry Finger
  Cc: Gábor Stefanik, John W. Linville, Stefan Lippers-Hollmann,
	wireless
In-Reply-To: <4CCD856E.9010006@lwfinger.net>

Realtek has not yet sent me the code for the USB
> devices, but as the chip
> and core code is common, it should not be far behind.
> 
> Larry

Hey Larry,

Whats the status quo for the USB driver?

Walter


      

^ permalink raw reply

* Re: Realtek rtl8188 support?
From: Larry Finger @ 2010-12-16 14:10 UTC (permalink / raw)
  To: Walter Goldens
  Cc: Gábor Stefanik, John W. Linville, Stefan Lippers-Hollmann,
	wireless
In-Reply-To: <955019.64728.qm@web56808.mail.re3.yahoo.com>

On 12/16/2010 07:25 AM, Walter Goldens wrote:
> Realtek has not yet sent me the code for the USB
>> devices, but as the chip
>> and core code is common, it should not be far behind.

> Hey Larry,
> 
> Whats the status quo for the USB driver?

Realtek is still testing/finishing. They sent me the firmware, which I pushed to
linux-firmware, thus that part is ready.

As we just got the code for the PCIe version into wireless-testing yesterday, I
hope that the good news on it will help the USB effort.

Larry


^ permalink raw reply

* wimaxd daemon bug
From: Alexander Khryukin @ 2010-12-16 14:10 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <370262.79515.qm@web56806.mail.re3.yahoo.com>

Good day.
I have
1.MeeGo 1.1
2.Intel Corporation WiMAX/WiFi Link 6050 Series (rev 2c)
3.Wimax network that named 'Yota'


wimaxcu scan wide
WARNING: Wide scan may take upto 2 minutes...
NSP : Yota
    ID          : 21
    Signal      : Excellent
    RSSI        : -62 dBm
    CINR        : 29 dB
    Network Type: Home Network
    Activated.



Then i try to connect with Yota-network

wimaxcu connect network 21
Connecting to Yota Network...
Connection successful

[root@meego-desktop ~]# /usr/bin/wimaxd -d -i wmx0
Enter Command:
q - Quit AppSrv
t - Trace ReInit (ReLoads Registry Values)
u - uplink(Apdo uplink event
h - Help
d - Toggle driver messages to display - debug & internal only


AppSrv is ready !
Act_FullRestart!
Act_DriverDeviceStatus - DRIVER_UP
CTRL-EVENT-EAP-STARTED EAP authentication started
Sending EapResponse. Data size: 25
CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=13
CTRL-EVENT-EAP-METHOD EAP vendor 0 method 13 (TLS) selected
Sending EapResponse. Data size: 60
Sending EapResponse. Data size: 60
Sending EapResponse. Data size: 6
Sending EapResponse. Data size: 6
Sending EapResponse. Data size: 1310
Sending EapResponse. Data size: 1144
Sending EapResponse. Data size: 6
CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
CTRL-EVENT-EAP-STARTED EAP authentication started
Sending EapResponse. Data size: 17
CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=13
CTRL-EVENT-EAP-METHOD EAP vendor 0 method 13 (TLS) selected
Sending EapResponse. Data size: 60
Sending EapResponse. Data size: 6
Sending EapResponse. Data size: 6
Sending EapResponse. Data size: 1310
Sending EapResponse. Data size: 1144
Sending EapResponse. Data size: 6


Then i try to reconnect

[root@meego-desktop ~]# wimaxcu connect network 21
Current Preferred Profile is:
    ID  : 21
    Name: Yota
Connecting to Yota Network...
Connection failure


Next i try to

wimaxll -i wmx0 reset
and start daemon again

/usr/bin/wimaxd -d -i wmx0

Connect to network

imaxcu connect network 21
Current Preferred Profile is:
    ID  : 21
    Name: Yota
Connecting to Yota Network...
Connection successful


Wimaxd version wimax-1.5.1-35.13.i586.rpm    
from Inaky Perez-Gonzalez repo.
http://download.meego.com/live/home:/inaky:/pegatron-idf-2010/Trunk/i586/


uname -a
Linux meego-desktop 2.6.36-1.9_mezon.12.1-netbook #1 SMP PREEMPT Wed Dec
15 20:01:48 MSK 2010 i686 i686 i386 GNU/Linux



steps to reproduce:
1.Plug on Intel Corporation WiMAX/WiFi Link 6050 Series (rev 2c)
2.Install any version on wimaxd
3.wimaxcu connect any_network_id
4.wait about 2 minutes
5.connection dropped.
6.try connect again, and see "connection failure"
7.wimaxll -i wmx0 rese
8.connect to network again (it will be succeeded)
9.Proceed to step 4


^ permalink raw reply

* [RFC 0/2] remain-on-channel HW offload
From: Johannes Berg @ 2010-12-16 14:15 UTC (permalink / raw)
  To: linux-wireless

This adds functionality to enable remain-on-channel
hardware offload to mac80211 drivers. Any frames
transmitted during that time get a new TX flag and
must be transmitted correctly by the driver -- any
other activity isn't stopped, so the device must
have different queues for the different frames.

johannes


^ permalink raw reply

* [RFC 1/2] mac80211: implement hardware offload for remain-on-channel
From: Johannes Berg @ 2010-12-16 14:15 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <20101216141518.879668720@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

This allows drivers to support remain-on-channel
offload if they implement smarter timing or need
to use a device implementation like iwlwifi.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/mac80211.h      |   19 ++++++++++
 net/mac80211/cfg.c          |   81 ++++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/driver-ops.h   |   30 ++++++++++++++++
 net/mac80211/driver-trace.h |   80 +++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h  |    8 ++++
 net/mac80211/iface.c        |    9 +++-
 net/mac80211/main.c         |    5 ++
 net/mac80211/offchannel.c   |   75 ++++++++++++++++++++++++++++++++++++++++
 8 files changed, 304 insertions(+), 3 deletions(-)

--- wireless-testing.orig/include/net/mac80211.h	2010-12-14 17:06:54.000000000 +0100
+++ wireless-testing/include/net/mac80211.h	2010-12-14 17:07:39.000000000 +0100
@@ -365,6 +365,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(21),
 	IEEE80211_TX_CTL_LDPC			= BIT(22),
 	IEEE80211_TX_CTL_STBC			= BIT(23) | BIT(24),
+	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(25),
 };
 
 #define IEEE80211_TX_CTL_STBC_SHIFT		23
@@ -1824,6 +1825,12 @@ struct ieee80211_ops {
 	int (*napi_poll)(struct ieee80211_hw *hw, int budget);
 	int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
 	int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
+
+	int (*remain_on_channel)(struct ieee80211_hw *hw,
+				 struct ieee80211_channel *chan,
+				 enum nl80211_channel_type channel_type,
+				 int duration);
+	int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
 };
 
 /**
@@ -2727,6 +2734,18 @@ void ieee80211_request_smps(struct ieee8
  */
 void ieee80211_key_removed(struct ieee80211_key_conf *key_conf);
 
+/**
+ * ieee80211_ready_on_channel - notification of remain-on-channel start
+ * @hw: pointer as obtained from ieee80211_alloc_hw()
+ */
+void ieee80211_ready_on_channel(struct ieee80211_hw *hw);
+
+/**
+ * ieee80211_remain_on_channel_expired - remain_on_channel duration expired
+ * @hw: pointer as obtained from ieee80211_alloc_hw()
+ */
+void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
+
 /* Rate control API */
 
 /**
--- wireless-testing.orig/net/mac80211/cfg.c	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/cfg.c	2010-12-14 17:07:39.000000000 +0100
@@ -1562,6 +1562,37 @@ static int ieee80211_set_bitrate_mask(st
 	return 0;
 }
 
+static int ieee80211_remain_on_channel_hw(struct ieee80211_local *local,
+					  struct net_device *dev,
+					  struct ieee80211_channel *chan,
+					  enum nl80211_channel_type chantype,
+					  unsigned int duration, u64 *cookie)
+{
+	int ret;
+	u32 random_cookie;
+
+	lockdep_assert_held(&local->mtx);
+
+	if (local->hw_roc_cookie)
+		return -EBUSY;
+	/* must be nonzero */
+	random_cookie = random32() | 1;
+
+	*cookie = random_cookie;
+	local->hw_roc_dev = dev;
+	local->hw_roc_cookie = random_cookie;
+	local->hw_roc_channel = chan;
+	local->hw_roc_channel_type = chantype;
+	local->hw_roc_duration = duration;
+	ret = drv_remain_on_channel(local, chan, chantype, duration);
+	if (ret) {
+		local->hw_roc_channel = NULL;
+		local->hw_roc_cookie = 0;
+	}
+
+	return ret;
+}
+
 static int ieee80211_remain_on_channel(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       struct ieee80211_channel *chan,
@@ -1570,16 +1601,60 @@ static int ieee80211_remain_on_channel(s
 				       u64 *cookie)
 {
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct ieee80211_local *local = sdata->local;
+
+	if (local->ops->remain_on_channel) {
+		int ret;
+
+		mutex_lock(&local->mtx);
+		ret = ieee80211_remain_on_channel_hw(local, dev,
+						     chan, channel_type,
+						     duration, cookie);
+		mutex_unlock(&local->mtx);
+
+		return ret;
+	}
 
 	return ieee80211_wk_remain_on_channel(sdata, chan, channel_type,
 					      duration, cookie);
 }
 
+static int ieee80211_cancel_remain_on_channel_hw(struct ieee80211_local *local,
+						 u64 cookie)
+{
+	int ret;
+
+	lockdep_assert_held(&local->mtx);
+
+	if (local->hw_roc_cookie != cookie)
+		return -ENOENT;
+
+	ret = drv_cancel_remain_on_channel(local);
+	if (ret)
+		return ret;
+
+	local->hw_roc_cookie = 0;
+	local->hw_roc_channel = NULL;
+
+	return 0;
+}
+
 static int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
 					      struct net_device *dev,
 					      u64 cookie)
 {
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct ieee80211_local *local = sdata->local;
+
+	if (local->ops->cancel_remain_on_channel) {
+		int ret;
+
+		mutex_lock(&local->mtx);
+		ret = ieee80211_cancel_remain_on_channel_hw(local, cookie);
+		mutex_unlock(&local->mtx);
+
+		return ret;
+	}
 
 	return ieee80211_wk_cancel_remain_on_channel(sdata, cookie);
 }
@@ -1631,6 +1706,12 @@ static int ieee80211_mgmt_tx(struct wiph
 	     channel_type != local->_oper_channel_type))
 		is_offchan = true;
 
+	if (chan == local->hw_roc_channel) {
+		/* TODO: check channel type? */
+		is_offchan = false;
+		flags |= IEEE80211_TX_CTL_TX_OFFCHAN;
+	}
+
 	if (is_offchan && !offchan)
 		return -EBUSY;
 
--- wireless-testing.orig/net/mac80211/ieee80211_i.h	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h	2010-12-14 17:07:39.000000000 +0100
@@ -938,6 +938,13 @@ struct ieee80211_local {
 	} debugfs;
 #endif
 
+	struct ieee80211_channel *hw_roc_channel;
+	struct net_device *hw_roc_dev;
+	struct work_struct hw_roc_start, hw_roc_done;
+	enum nl80211_channel_type hw_roc_channel_type;
+	unsigned int hw_roc_duration;
+	u32 hw_roc_cookie;
+
 	/* dummy netdev for use w/ NAPI */
 	struct net_device napi_dev;
 
@@ -1129,6 +1136,7 @@ void ieee80211_offchannel_stop_beaconing
 void ieee80211_offchannel_stop_station(struct ieee80211_local *local);
 void ieee80211_offchannel_return(struct ieee80211_local *local,
 				 bool enable_beaconing);
+void ieee80211_hw_roc_setup(struct ieee80211_local *local);
 
 /* interface handling */
 int ieee80211_iface_init(void);
--- wireless-testing.orig/net/mac80211/offchannel.c	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/offchannel.c	2010-12-14 17:07:39.000000000 +0100
@@ -14,6 +14,7 @@
  */
 #include <net/mac80211.h>
 #include "ieee80211_i.h"
+#include "driver-trace.h"
 
 /*
  * inform AP that we will go to sleep so that it will buffer the frames
@@ -190,3 +191,77 @@ void ieee80211_offchannel_return(struct
 	}
 	mutex_unlock(&local->iflist_mtx);
 }
+
+static void ieee80211_hw_roc_start(struct work_struct *work)
+{
+	struct ieee80211_local *local =
+		container_of(work, struct ieee80211_local, hw_roc_start);
+
+	mutex_lock(&local->mtx);
+
+	if (!local->hw_roc_channel) {
+		mutex_unlock(&local->mtx);
+		return;
+	}
+
+	ieee80211_recalc_idle(local);
+
+	cfg80211_ready_on_channel(local->hw_roc_dev, local->hw_roc_cookie,
+				  local->hw_roc_channel,
+				  local->hw_roc_channel_type,
+				  local->hw_roc_duration,
+				  GFP_KERNEL);
+	mutex_unlock(&local->mtx);
+}
+
+void ieee80211_ready_on_channel(struct ieee80211_hw *hw)
+{
+	struct ieee80211_local *local = hw_to_local(hw);
+
+	trace_api_ready_on_channel(local);
+
+	ieee80211_queue_work(hw, &local->hw_roc_start);
+}
+EXPORT_SYMBOL_GPL(ieee80211_ready_on_channel);
+
+static void ieee80211_hw_roc_done(struct work_struct *work)
+{
+	struct ieee80211_local *local =
+		container_of(work, struct ieee80211_local, hw_roc_done);
+
+	mutex_lock(&local->mtx);
+
+	if (!local->hw_roc_channel) {
+		mutex_unlock(&local->mtx);
+		return;
+	}
+
+	cfg80211_remain_on_channel_expired(local->hw_roc_dev,
+					   local->hw_roc_cookie,
+					   local->hw_roc_channel,
+					   local->hw_roc_channel_type,
+					   GFP_KERNEL);
+
+	local->hw_roc_channel = NULL;
+	local->hw_roc_cookie = 0;
+
+	ieee80211_recalc_idle(local);
+
+	mutex_unlock(&local->mtx);
+}
+
+void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw)
+{
+	struct ieee80211_local *local = hw_to_local(hw);
+
+	trace_api_remain_on_channel_expired(local);
+
+	ieee80211_queue_work(hw, &local->hw_roc_done);
+}
+EXPORT_SYMBOL_GPL(ieee80211_remain_on_channel_expired);
+
+void ieee80211_hw_roc_setup(struct ieee80211_local *local)
+{
+	INIT_WORK(&local->hw_roc_start, ieee80211_hw_roc_start);
+	INIT_WORK(&local->hw_roc_done, ieee80211_hw_roc_done);
+}
--- wireless-testing.orig/net/mac80211/main.c	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/main.c	2010-12-14 17:07:39.000000000 +0100
@@ -603,6 +603,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(
 
 	ieee80211_led_names(local);
 
+	ieee80211_hw_roc_setup(local);
+
 	return local_to_hw(local);
 }
 EXPORT_SYMBOL(ieee80211_alloc_hw);
@@ -747,7 +749,8 @@ int ieee80211_register_hw(struct ieee802
 		}
 	}
 
-	local->hw.wiphy->max_remain_on_channel_duration = 5000;
+	if (!local->ops->remain_on_channel)
+		local->hw.wiphy->max_remain_on_channel_duration = 5000;
 
 	result = wiphy_register(local->hw.wiphy);
 	if (result < 0)
--- wireless-testing.orig/net/mac80211/iface.c	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/iface.c	2010-12-14 17:07:39.000000000 +0100
@@ -1264,7 +1264,7 @@ u32 __ieee80211_recalc_idle(struct ieee8
 {
 	struct ieee80211_sub_if_data *sdata;
 	int count = 0;
-	bool working = false, scanning = false;
+	bool working = false, scanning = false, hw_roc = false;
 	struct ieee80211_work *wk;
 	unsigned int led_trig_start = 0, led_trig_stop = 0;
 
@@ -1308,6 +1308,9 @@ u32 __ieee80211_recalc_idle(struct ieee8
 		local->scan_sdata->vif.bss_conf.idle = false;
 	}
 
+	if (local->hw_roc_channel)
+		hw_roc = true;
+
 	list_for_each_entry(sdata, &local->interfaces, list) {
 		if (sdata->old_idle == sdata->vif.bss_conf.idle)
 			continue;
@@ -1316,7 +1319,7 @@ u32 __ieee80211_recalc_idle(struct ieee8
 		ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IDLE);
 	}
 
-	if (working || scanning)
+	if (working || scanning || hw_roc)
 		led_trig_start |= IEEE80211_TPT_LEDTRIG_FL_WORK;
 	else
 		led_trig_stop |= IEEE80211_TPT_LEDTRIG_FL_WORK;
@@ -1328,6 +1331,8 @@ u32 __ieee80211_recalc_idle(struct ieee8
 
 	ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop);
 
+	if (hw_roc)
+		return ieee80211_idle_off(local, "hw remain-on-channel");
 	if (working)
 		return ieee80211_idle_off(local, "working");
 	if (scanning)
--- wireless-testing.orig/net/mac80211/driver-ops.h	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/driver-ops.h	2010-12-14 17:07:39.000000000 +0100
@@ -465,4 +465,34 @@ static inline int drv_get_antenna(struct
 	return ret;
 }
 
+static inline int drv_remain_on_channel(struct ieee80211_local *local,
+					struct ieee80211_channel *chan,
+					enum nl80211_channel_type chantype,
+					unsigned int duration)
+{
+	int ret;
+
+	might_sleep();
+
+	trace_drv_remain_on_channel(local, chan, chantype, duration);
+	ret = local->ops->remain_on_channel(&local->hw, chan, chantype,
+					    duration);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
+static inline int drv_cancel_remain_on_channel(struct ieee80211_local *local)
+{
+	int ret;
+
+	might_sleep();
+
+	trace_drv_cancel_remain_on_channel(local);
+	ret = local->ops->cancel_remain_on_channel(&local->hw);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
--- wireless-testing.orig/net/mac80211/driver-trace.h	2010-12-14 17:06:55.000000000 +0100
+++ wireless-testing/net/mac80211/driver-trace.h	2010-12-14 17:07:39.000000000 +0100
@@ -933,6 +933,50 @@ TRACE_EVENT(drv_get_antenna,
 	)
 );
 
+TRACE_EVENT(drv_remain_on_channel,
+	TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
+		 enum nl80211_channel_type chantype, unsigned int duration),
+
+	TP_ARGS(local, chan, chantype, duration),
+
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		__field(int, center_freq)
+		__field(int, channel_type)
+		__field(unsigned int, duration)
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		__entry->center_freq = chan->center_freq;
+		__entry->channel_type = chantype;
+		__entry->duration = duration;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT " freq:%dMHz duration:%dms",
+		LOCAL_PR_ARG, __entry->center_freq, __entry->duration
+	)
+);
+
+TRACE_EVENT(drv_cancel_remain_on_channel,
+	TP_PROTO(struct ieee80211_local *local),
+
+	TP_ARGS(local),
+
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT, LOCAL_PR_ARG
+	)
+);
+
 /*
  * Tracing for API calls that drivers call.
  */
@@ -1170,6 +1214,42 @@ TRACE_EVENT(api_chswitch_done,
 	)
 );
 
+TRACE_EVENT(api_ready_on_channel,
+	TP_PROTO(struct ieee80211_local *local),
+
+	TP_ARGS(local),
+
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT, LOCAL_PR_ARG
+	)
+);
+
+TRACE_EVENT(api_remain_on_channel_expired,
+	TP_PROTO(struct ieee80211_local *local),
+
+	TP_ARGS(local),
+
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT, LOCAL_PR_ARG
+	)
+);
+
 /*
  * Tracing for internal functions
  * (which may also be called in response to driver calls)



^ permalink raw reply

* [RFC 2/2] mac80211: implement off-channel TX using hw r-o-c offload
From: Johannes Berg @ 2010-12-16 14:15 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <20101216141518.879668720@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

When the driver has remain-on-channel offload,
implement off-channel transmission using that
primitive.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/cfg.c         |   59 +++++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h |    2 +
 net/mac80211/offchannel.c  |   30 +++++++++++++++-------
 3 files changed, 81 insertions(+), 10 deletions(-)

--- wireless-testing.orig/net/mac80211/cfg.c	2010-12-16 08:04:15.000000000 +0100
+++ wireless-testing/net/mac80211/cfg.c	2010-12-16 14:45:18.000000000 +0100
@@ -1610,6 +1610,7 @@ static int ieee80211_remain_on_channel(s
 		ret = ieee80211_remain_on_channel_hw(local, dev,
 						     chan, channel_type,
 						     duration, cookie);
+		local->hw_roc_for_tx = false;
 		mutex_unlock(&local->mtx);
 
 		return ret;
@@ -1749,6 +1750,49 @@ static int ieee80211_mgmt_tx(struct wiph
 
 	*cookie = (unsigned long) skb;
 
+	if (is_offchan && local->ops->remain_on_channel) {
+		unsigned int duration;
+		int ret;
+
+		mutex_lock(&local->mtx);
+		/*
+		 * If the duration is zero, then the driver
+		 * wouldn't actually do anything. Set it to
+		 * 100 for now.
+		 *
+		 * TODO: cancel the off-channel operation
+		 *       when we get the SKB's TX status and
+		 *       the wait time was zero before.
+		 */
+		duration = 100;
+		if (wait)
+			duration = wait;
+		ret = ieee80211_remain_on_channel_hw(local, dev, chan,
+						     channel_type,
+						     duration, cookie);
+		if (ret) {
+			kfree_skb(skb);
+			mutex_unlock(&local->mtx);
+			return ret;
+		}
+
+		local->hw_roc_for_tx = true;
+		local->hw_roc_duration = wait;
+
+		/*
+		 * queue up frame for transmission after
+		 * ieee80211_ready_on_channel call
+		 */
+
+		/* modify cookie to prevent API mismatches */
+		*cookie ^= 2;
+		IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN;
+		local->hw_roc_skb = skb;
+		mutex_unlock(&local->mtx);
+
+		return 0;
+	}
+
 	/*
 	 * Can transmit right away if the channel was the
 	 * right one and there's no wait involved... If a
@@ -1789,6 +1833,21 @@ static int ieee80211_mgmt_tx_cancel_wait
 	int ret = -ENOENT;
 
 	mutex_lock(&local->mtx);
+
+	if (local->ops->cancel_remain_on_channel) {
+		cookie ^= 2;
+		ret = ieee80211_cancel_remain_on_channel_hw(local, cookie);
+
+		if (ret == 0) {
+			kfree_skb(local->hw_roc_skb);
+			local->hw_roc_skb = NULL;
+		}
+
+		mutex_unlock(&local->mtx);
+
+		return ret;
+	}
+
 	list_for_each_entry(wk, &local->work_list, list) {
 		if (wk->sdata != sdata)
 			continue;
--- wireless-testing.orig/net/mac80211/ieee80211_i.h	2010-12-16 08:04:15.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h	2010-12-16 14:39:27.000000000 +0100
@@ -940,10 +940,12 @@ struct ieee80211_local {
 
 	struct ieee80211_channel *hw_roc_channel;
 	struct net_device *hw_roc_dev;
+	struct sk_buff *hw_roc_skb;
 	struct work_struct hw_roc_start, hw_roc_done;
 	enum nl80211_channel_type hw_roc_channel_type;
 	unsigned int hw_roc_duration;
 	u32 hw_roc_cookie;
+	bool hw_roc_for_tx;
 
 	/* dummy netdev for use w/ NAPI */
 	struct net_device napi_dev;
--- wireless-testing.orig/net/mac80211/offchannel.c	2010-12-16 08:04:15.000000000 +0100
+++ wireless-testing/net/mac80211/offchannel.c	2010-12-16 14:41:08.000000000 +0100
@@ -196,6 +196,7 @@ static void ieee80211_hw_roc_start(struc
 {
 	struct ieee80211_local *local =
 		container_of(work, struct ieee80211_local, hw_roc_start);
+	struct ieee80211_sub_if_data *sdata;
 
 	mutex_lock(&local->mtx);
 
@@ -206,11 +207,19 @@ static void ieee80211_hw_roc_start(struc
 
 	ieee80211_recalc_idle(local);
 
-	cfg80211_ready_on_channel(local->hw_roc_dev, local->hw_roc_cookie,
-				  local->hw_roc_channel,
-				  local->hw_roc_channel_type,
-				  local->hw_roc_duration,
-				  GFP_KERNEL);
+	if (local->hw_roc_skb) {
+		sdata = IEEE80211_DEV_TO_SUB_IF(local->hw_roc_dev);
+		ieee80211_tx_skb(sdata, local->hw_roc_skb);
+		local->hw_roc_skb = NULL;
+	} else {
+		cfg80211_ready_on_channel(local->hw_roc_dev,
+					  local->hw_roc_cookie,
+					  local->hw_roc_channel,
+					  local->hw_roc_channel_type,
+					  local->hw_roc_duration,
+					  GFP_KERNEL);
+	}
+
 	mutex_unlock(&local->mtx);
 }
 
@@ -236,11 +245,12 @@ static void ieee80211_hw_roc_done(struct
 		return;
 	}
 
-	cfg80211_remain_on_channel_expired(local->hw_roc_dev,
-					   local->hw_roc_cookie,
-					   local->hw_roc_channel,
-					   local->hw_roc_channel_type,
-					   GFP_KERNEL);
+	if (!local->hw_roc_for_tx)
+		cfg80211_remain_on_channel_expired(local->hw_roc_dev,
+						   local->hw_roc_cookie,
+						   local->hw_roc_channel,
+						   local->hw_roc_channel_type,
+						   GFP_KERNEL);
 
 	local->hw_roc_channel = NULL;
 	local->hw_roc_cookie = 0;



^ permalink raw reply

* Re: iwl rfkill suddenly dropped to hard block
From: Evgeniy Polyakov @ 2010-12-16 14:40 UTC (permalink / raw)
  To: John W. Linville
  Cc: Intel Linux Wireless, netdev, linux-wireless, wey-yi.w.guy
In-Reply-To: <20101215201126.GG2377@tuxdriver.com>

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

On Wed, Dec 15, 2010 at 03:11:27PM -0500, John W. Linville (linville@tuxdriver.com) wrote:
> To be honest, nearly every report of "suddenly my rfkill is stuck
> on" is because the laptop has multiple rfkill keys, usually with
> one of them a slider along the edge of the case.  In particular,
> Thinkpads have such switches.  The slider gets accidently engaged
> (possibly while the laptop is being transported or somesuch) and
> suddenly wireless stops working.

I feel incredibly stupid, but...
I found the key :)

-- 
	Evgeniy Polyakov

[-- Attachment #2: 16-12-2010-i-must-be-blond.png --]
[-- Type: image/png, Size: 141801 bytes --]

^ permalink raw reply

* Re: [RFC 0/2] remain-on-channel HW offload
From: Johannes Berg @ 2010-12-16 14:40 UTC (permalink / raw)
  To: Chuck Crisler; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <14A60364A8914B6FA548CF6DCEDDBD06@ChuckPC>

Chuck,

Allow me to respond on the list, this might be useful for more people.

On Thu, 2010-12-16 at 09:33 -0500, Chuck Crisler wrote:
> Johannes, I missed the discussion about this new capability. Would you 
> either give me a pointer to a doc or send me something that would allow me 
> to better understand what this is intended for? We are currently beginning a 
> re-design of our system and this might be very useful to us. At the least I 
> need to understand what it means.

I haven't really discussed this new functionality with anyone yet. So
you didn't really miss any discussion -- there was none. I just posted
the patchset out of the blue after having tried various approaches to
implementing P2P with Intel hardware.

The problem, it turns out, is that the device will refuse to receive
probe request frames unless put into a "P2P mode". Additionally, the
device implements (periodic) off-channel times for this.

Initially, I tried more involved approaches where we offload the entire
"P2P search" functionality to the device/driver. It turns out, however,
that this requires massive changes in wpa_supplicant, and after poring
over it for a couple of weeks I've come to the conclusion that I can't
make those changes in the short to medium term.

Instead, therefore, I've come up with this approach. When the supplicant
requests an off-channel period for P2P, I will hand it off to the driver
(patch 1). And when it requests an off-channel TX, I'll synthesise that
in mac80211 using the offload (patch 2) -- this I will also need to
extend later.

That's about it. Does that answer your question?

johannes


^ permalink raw reply

* [PATCH] rtlwifi: convert to __packed notation
From: John W. Linville @ 2010-12-16 14:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Larry Finger, John W. Linville

Use "__packed" instead of "__attribute__ ((packed))"...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/rtlwifi/pci.h                 |    6 +++---
 .../net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h  |    6 +++---
 drivers/net/wireless/rtlwifi/wifi.h                |    8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/pci.h b/drivers/net/wireless/rtlwifi/pci.h
index cdde858..d36a669 100644
--- a/drivers/net/wireless/rtlwifi/pci.h
+++ b/drivers/net/wireless/rtlwifi/pci.h
@@ -131,15 +131,15 @@ enum pci_bridge_vendor {
 
 struct rtl_rx_desc {
 	u32 dword[8];
-} __attribute__ ((packed));
+} __packed;
 
 struct rtl_tx_desc {
 	u32 dword[16];
-} __attribute__ ((packed));
+} __packed;
 
 struct rtl_tx_cmd_desc {
 	u32 dword[16];
-} __attribute__ ((packed));
+} __packed;
 
 struct rtl8192_tx_ring {
 	struct rtl_tx_desc *desc;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h
index 91e13c3..53d0e0a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h
@@ -535,7 +535,7 @@ struct rx_fwinfo_92c {
 	u8 sgi_en:1;
 	u8 rxsc:2;
 	u8 reserve:4;
-} __attribute__ ((packed));
+} __packed;
 
 struct tx_desc_92c {
 	u32 pktsize:16;
@@ -637,7 +637,7 @@ struct tx_desc_92c {
 	u32 nextdescaddress64;
 
 	u32 reserve_pass_pcie_mm_limit[4];
-} __attribute__ ((packed));
+} __packed;
 
 struct rx_desc_92c {
 	u32 length:14;
@@ -695,7 +695,7 @@ struct rx_desc_92c {
 	u32 bufferaddress;
 	u32 bufferaddress64;
 
-} __attribute__ ((packed));
+} __packed;
 
 void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr,
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 0dd6824..3844dc9 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -551,13 +551,13 @@ struct rtl_hdr_3addr {
 	u8 addr3[ETH_ALEN];
 	__le16 seq_ctl;
 	u8 payload[0];
-} __attribute__ ((packed));
+} __packed;
 
 struct rtl_info_element {
 	u8 id;
 	u8 len;
 	u8 data[0];
-} __attribute__ ((packed));
+} __packed;
 
 struct rtl_probe_rsp {
 	struct rtl_hdr_3addr header;
@@ -567,7 +567,7 @@ struct rtl_probe_rsp {
 	/*SSID, supported rates, FH params, DS params,
 	   CF params, IBSS params, TIM (if beacon), RSN */
 	struct rtl_info_element info_element[0];
-} __attribute__ ((packed));
+} __packed;
 
 /*LED related.*/
 /*ledpin Identify how to implement this SW led.*/
@@ -589,7 +589,7 @@ struct rtl_qos_parameters {
 	u8 aifs;
 	u8 flag;
 	__le16 tx_op;
-} __attribute__ ((packed));
+} __packed;
 
 struct rt_smooth_data {
 	u32 elements[100];	/*array to store values */
-- 
1.7.3.3


^ permalink raw reply related

* Re: iwl rfkill suddenly dropped to hard block
From: John W. Linville @ 2010-12-16 14:42 UTC (permalink / raw)
  To: Evgeniy Polyakov
  Cc: Intel Linux Wireless, netdev, linux-wireless, wey-yi.w.guy
In-Reply-To: <20101216144000.GA16183@ioremap.net>

On Thu, Dec 16, 2010 at 05:40:00PM +0300, Evgeniy Polyakov wrote:
> On Wed, Dec 15, 2010 at 03:11:27PM -0500, John W. Linville (linville@tuxdriver.com) wrote:
> > To be honest, nearly every report of "suddenly my rfkill is stuck
> > on" is because the laptop has multiple rfkill keys, usually with
> > one of them a slider along the edge of the case.  In particular,
> > Thinkpads have such switches.  The slider gets accidently engaged
> > (possibly while the laptop is being transported or somesuch) and
> > suddenly wireless stops working.
> 
> I feel incredibly stupid, but...
> I found the key :)

Nice to start the day with a laugh! ;-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH] rtlwifi: convert to __packed notation
From: Larry Finger @ 2010-12-16 15:05 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <1292510088-7449-1-git-send-email-linville@tuxdriver.com>

On 12/16/2010 08:34 AM, John W. Linville wrote:
> Use "__packed" instead of "__attribute__ ((packed))"...
> 
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>  drivers/net/wireless/rtlwifi/pci.h                 |    6 +++---
>  .../net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h  |    6 +++---
>  drivers/net/wireless/rtlwifi/wifi.h                |    8 ++++----
>  3 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/rtlwifi/pci.h b/drivers/net/wireless/rtlwifi/pci.h
> index cdde858..d36a669 100644
> --- a/drivers/net/wireless/rtlwifi/pci.h
> +++ b/drivers/net/wireless/rtlwifi/pci.h
> @@ -131,15 +131,15 @@ enum pci_bridge_vendor {
>  
>  struct rtl_rx_desc {
>  	u32 dword[8];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rtl_tx_desc {
>  	u32 dword[16];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rtl_tx_cmd_desc {
>  	u32 dword[16];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rtl8192_tx_ring {
>  	struct rtl_tx_desc *desc;
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h
> index 91e13c3..53d0e0a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-trx.h
> @@ -535,7 +535,7 @@ struct rx_fwinfo_92c {
>  	u8 sgi_en:1;
>  	u8 rxsc:2;
>  	u8 reserve:4;
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct tx_desc_92c {
>  	u32 pktsize:16;
> @@ -637,7 +637,7 @@ struct tx_desc_92c {
>  	u32 nextdescaddress64;
>  
>  	u32 reserve_pass_pcie_mm_limit[4];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rx_desc_92c {
>  	u32 length:14;
> @@ -695,7 +695,7 @@ struct rx_desc_92c {
>  	u32 bufferaddress;
>  	u32 bufferaddress64;
>  
> -} __attribute__ ((packed));
> +} __packed;
>  
>  void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
>  			  struct ieee80211_hdr *hdr,
> diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
> index 0dd6824..3844dc9 100644
> --- a/drivers/net/wireless/rtlwifi/wifi.h
> +++ b/drivers/net/wireless/rtlwifi/wifi.h
> @@ -551,13 +551,13 @@ struct rtl_hdr_3addr {
>  	u8 addr3[ETH_ALEN];
>  	__le16 seq_ctl;
>  	u8 payload[0];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rtl_info_element {
>  	u8 id;
>  	u8 len;
>  	u8 data[0];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rtl_probe_rsp {
>  	struct rtl_hdr_3addr header;
> @@ -567,7 +567,7 @@ struct rtl_probe_rsp {
>  	/*SSID, supported rates, FH params, DS params,
>  	   CF params, IBSS params, TIM (if beacon), RSN */
>  	struct rtl_info_element info_element[0];
> -} __attribute__ ((packed));
> +} __packed;
>  
>  /*LED related.*/
>  /*ledpin Identify how to implement this SW led.*/
> @@ -589,7 +589,7 @@ struct rtl_qos_parameters {
>  	u8 aifs;
>  	u8 flag;
>  	__le16 tx_op;
> -} __attribute__ ((packed));
> +} __packed;
>  
>  struct rt_smooth_data {
>  	u32 elements[100];	/*array to store values */

ACK.

As a point of interest, is this the "new" recommended way? The reason I ask is
that the Linux headers are mostly in the attribute form.

Larry

^ permalink raw reply

* [PATCH] rtl8192ce: Update MAINTAINERS
From: Larry Finger @ 2010-12-16 15:13 UTC (permalink / raw)
  To: John W Linville; +Cc: linux-wireless

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Index: wireless-testing/MAINTAINERS
===================================================================
--- wireless-testing.orig/MAINTAINERS
+++ wireless-testing/MAINTAINERS
@@ -5055,6 +5055,16 @@ T:	git git://git.kernel.org/pub/scm/linu
 S:	Maintained
 F:	drivers/net/wireless/rtl818x/rtl8187*
 
+RTL8192CE WIRELESS DRIVER
+M:	Larry Finger <Larry.Finger@lwfinger.net>
+M:	Chaoming Li <chaoming_li@realsil.com.cn>
+L:	linux-wireless@vger.kernel.org
+W:	http://linuxwireless.org/
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
+S:	Maintained
+F:	drivers/net/wireless/rtlwifi/
+F:	drivers/net/wireless/rtl8192ce/
+
 S3 SAVAGE FRAMEBUFFER DRIVER
 M:	Antonino Daplas <adaplas@gmail.com>
 L:	linux-fbdev@vger.kernel.org

^ permalink raw reply

* Re: [PATCH] rtlwifi: convert to __packed notation
From: John W. Linville @ 2010-12-16 15:21 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <4D0A2AA8.5060808@lwfinger.net>

On Thu, Dec 16, 2010 at 09:05:12AM -0600, Larry Finger wrote:
> On 12/16/2010 08:34 AM, John W. Linville wrote:
> > Use "__packed" instead of "__attribute__ ((packed))"...
> > 
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
 
> ACK.
> 
> As a point of interest, is this the "new" recommended way? The reason I ask is
> that the Linux headers are mostly in the attribute form.

AIUI, "__packed" is the one true way.  I think this facilitates
compling the kernel with compilers other than GCC.

At any rate, Dave Miller threatened to injure me if I kept sending him stuff using 
"__attribute__ ((packed))"... :-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* rt2400pci.ko and it's AES/WPA2 support [Not subscribed to the list]
From: Jar @ 2010-12-16 15:44 UTC (permalink / raw)
  To: linux-wireless

Hello,

I can't find direct answer from the net archives. But in case of someone 
knows: Does the rt2400pci.ko support AES encryption and/or WPA2 in 
newest kernels and wpa_supplicant?

-- 
Best Regards, Jar

^ permalink raw reply

* Re: [PATCH] mac80211: Push idle state to driver before stop
From: Paul Stewart @ 2010-12-16 16:02 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, luis.rodriguez
In-Reply-To: <1292504020.3612.17.camel@jlt3.sipsolutions.net>

On Thu, Dec 16, 2010 at 4:53 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2010-12-16 at 04:46 -0800, Paul Stewart wrote:
> Not really -- the driver may throw away all internal state, mac80211
> will (attempt to) restore it all through drv_config() with changed = ~0.
> Evidently ath9k has some magic that makes this fail?

The magic in question is as follows (ath9k_config()):

    if (changed & IEEE80211_CONF_CHANGE_IDLE) {
        bool enable_radio;
        bool all_wiphys_idle;
        bool idle = !!(conf->flags & IEEE80211_CONF_IDLE);

        spin_lock_bh(&sc->wiphy_lock);
        all_wiphys_idle =  ath9k_all_wiphys_idle(sc);
       ath9k_set_wiphy_idle(aphy, idle);

        enable_radio = (!idle && all_wiphys_idle);

        /*
         * After we unlock here its possible another wiphy
         * can be re-renabled so to account for that we will
         * only disable the radio toward the end of this routine
         * if by then all wiphys are still idle.
         */
        spin_unlock_bh(&sc->wiphy_lock);

        if (enable_radio) {
            sc->ps_idle = false;
            ath_radio_enable(sc, hw);
            ath_dbg(common, ATH_DBG_CONFIG,
                    "not-idle: enabling radio\n");
        }
    }

So, ath9k enables and disables the radio based on ps_idle (the
internal state), but that's not re-evaluated unless the wiphys
actually change.  In this case they do not change because ath9k was
never informed that the wiphy went idle (all_wiphys_idle evaluates to
false).  One solution would be to do an ah9k_set_wiphy_idle(aphy,
true) in ath9k_stop() instead of Luis' previous suggestion of setting
sc->ps_idle directly.  Perhaps in January when I return from vacation
I'll test this to make sure that performs as intended in the
suspend-resume-while-associated case.  It's a little bit of a lie to
do it in this case since in fact as far as mac80211 is concerned, the
wiphy is not idle in this case.

--
Paul

^ permalink raw reply

* Re: [PATCH] rtlwifi: convert to __packed notation
From: Larry Finger @ 2010-12-16 16:03 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <20101216152121.GB2413@tuxdriver.com>

On 12/16/2010 09:21 AM, John W. Linville wrote:
> On Thu, Dec 16, 2010 at 09:05:12AM -0600, Larry Finger wrote:
>> On 12/16/2010 08:34 AM, John W. Linville wrote:
>>> Use "__packed" instead of "__attribute__ ((packed))"...
>>>
>>> Signed-off-by: John W. Linville<linville@tuxdriver.com>
>
>> ACK.
>>
>> As a point of interest, is this the "new" recommended way? The reason I ask is
>> that the Linux headers are mostly in the attribute form.
>
> AIUI, "__packed" is the one true way.  I think this facilitates
> compling the kernel with compilers other than GCC.
>
> At any rate, Dave Miller threatened to injure me if I kept sending him stuff using
> "__attribute__ ((packed))"... :-)

We certainly would not want that. Maintainers are too hard to find.

One point I missed earlier. As you are affecting both rtlwifi and rtl8192ce, 
both should be in the patch title.

Larry

^ permalink raw reply

* Re: [PATCH] iwlwifi: Fix error: struct iwl_lq_sta has no member named dbg_fixed_rate
From: Guy, Wey-Yi @ 2010-12-16 16:13 UTC (permalink / raw)
  To: sedat.dilek@gmail.com
  Cc: Stephen Rothwell, John Linville, LKML, wireless, Berg, Johannes,
	Randy Dunlap
In-Reply-To: <AANLkTink67RM4mp537UxFcx4g-9Dx+ymbW0A=cCu3C4g@mail.gmail.com>

Hi Sedat,

On Thu, 2010-12-16 at 03:46 -0800, Sedat Dilek wrote:
> Attached patch fixes an issue with linux-next (20101216) and iwlwifi (see [1]).
> 
> - Sedat -
> 
> [1] http://lkml.org/lkml/2010/12/16/101

ACKed-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>

Thank you very much for catch this mistake and fix it so quickly.

Wey


^ permalink raw reply

* Re: [PATCH] iwlwifi: Fix error: struct iwl_lq_sta has no member named dbg_fixed_rate
From: Sedat Dilek @ 2010-12-16 16:30 UTC (permalink / raw)
  To: Guy, Wey-Yi
  Cc: Stephen Rothwell, John Linville, LKML, wireless, Berg, Johannes,
	Randy Dunlap
In-Reply-To: <1292516015.27593.26.camel@wwguy-ubuntu>

On Thu, Dec 16, 2010 at 5:13 PM, Guy, Wey-Yi <wey-yi.w.guy@intel.com> wrote:
> Hi Sedat,
>
> On Thu, 2010-12-16 at 03:46 -0800, Sedat Dilek wrote:
>> Attached patch fixes an issue with linux-next (20101216) and iwlwifi (see [1]).
>>
>> - Sedat -
>>
>> [1] http://lkml.org/lkml/2010/12/16/101
>
> ACKed-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
>
> Thank you very much for catch this mistake and fix it so quickly.
>
> Wey
>
>

N.p., the patch is now in wireless-next-2.6 GIT master (so we will
have it in next-20101217).
Thanks John.

- Sedat -

^ permalink raw reply

* Re: rt2400pci.ko and it's AES/WPA2 support [Not subscribed to the list]
From: Ivo Van Doorn @ 2010-12-16 16:42 UTC (permalink / raw)
  To: Jar; +Cc: linux-wireless
In-Reply-To: <4D0A33E2.9090509@pcuf.fi>

Hi,


> I can't find direct answer from the net archives. But in case of someone
> knows: Does the rt2400pci.ko support AES encryption and/or WPA2 in newest
> kernels and wpa_supplicant?

Yes, it does support it. It is all software encryption though, since there
is no hardware acceleration possible with this hardware.

Ivo

^ permalink raw reply

* Re: rt2400pci.ko and it's AES/WPA2 support [Not subscribed to the list]
From: Jar @ 2010-12-16 16:55 UTC (permalink / raw)
  To: Ivo Van Doorn; +Cc: linux-wireless
In-Reply-To: <AANLkTinxi_VrCeboC0j2T_oMtQxvYP_oAzmXXr4KNetA@mail.gmail.com>

On 16.12.2010 18:42, Ivo Van Doorn wrote:
> Yes, it does support it. It is all software encryption though, since there
> is no hardware acceleration possible with this hardware.

Thanks a lot!!!! Now I only have to find reason why Lubuntu wants to use 
TKIP and not AES, even when the access point advertises AES (and TKIP) 
capability in the scan results.

-- 
Best Regards, Jar

^ permalink raw reply

* [PATCH] rtlwifi: Switch ;ocking from semaphores to mutexes
From: Larry Finger @ 2010-12-16 17:10 UTC (permalink / raw)
  To: John W Linville, Johannes Berg; +Cc: linux-wireless

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John,

This change was requested by Johannes.

Larry
---

Index: wireless-testing/drivers/net/wireless/rtlwifi/base.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/base.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/base.c
@@ -309,8 +309,8 @@ int rtl_init_core(struct ieee80211_hw *h
 	}
 
 	/* <4> locks */
-	sema_init(&rtlpriv->locks.ips_sem, 1);
-	sema_init(&rtlpriv->locks.conf_sem, 1);
+	mutex_init(&rtlpriv->locks.ips_mutex);
+	mutex_init(&rtlpriv->locks.conf_mutex);
 	spin_lock_init(&rtlpriv->locks.irq_th_lock);
 	spin_lock_init(&rtlpriv->locks.h2c_lock);
 	spin_lock_init(&rtlpriv->locks.rf_ps_lock);
Index: wireless-testing/drivers/net/wireless/rtlwifi/core.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/core.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/core.c
@@ -43,13 +43,13 @@ static int rtl_op_start(struct ieee80211
 		return 0;
 	if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
 		return 0;
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	err = rtlpriv->intf_ops->adapter_start(hw);
 	if (err)
 		goto out;
 	rtl_watch_dog_timer_callback((unsigned long)hw);
 out:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 	return err;
 }
 
@@ -68,7 +68,7 @@ static void rtl_op_stop(struct ieee80211
 		mdelay(1);
 	}
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	mac->link_state = MAC80211_NOLINK;
 	memset(mac->bssid, 0, 6);
@@ -79,7 +79,7 @@ static void rtl_op_stop(struct ieee80211
 	rtl_deinit_deferred_work(hw);
 	rtlpriv->intf_ops->adapter_stop(hw);
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 static int rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
@@ -119,7 +119,7 @@ static int rtl_op_add_interface(struct i
 
 	rtl_ips_nic_on(hw);
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	switch (vif->type) {
 	case NL80211_IFTYPE_STATION:
 		if (mac->beacon_enabled == 1) {
@@ -156,7 +156,7 @@ static int rtl_op_add_interface(struct i
 	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr);
 
 out:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 	return err;
 }
 
@@ -166,7 +166,7 @@ static void rtl_op_remove_interface(stru
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	/* Free beacon resources */
 	if ((mac->opmode == NL80211_IFTYPE_AP) ||
@@ -190,7 +190,7 @@ static void rtl_op_remove_interface(stru
 	mac->opmode = NL80211_IFTYPE_UNSPECIFIED;
 	rtlpriv->cfg->ops->set_network_type(hw, mac->opmode);
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 
@@ -202,7 +202,7 @@ static int rtl_op_config(struct ieee8021
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	struct ieee80211_conf *conf = &hw->conf;
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {	/*BIT(2)*/
 		RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
 			 ("IEEE80211_CONF_CHANGE_LISTEN_INTERVAL\n"));
@@ -303,7 +303,7 @@ static int rtl_op_config(struct ieee8021
 					       hw->conf.channel_type);
 	}
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 
 	return 0;
 }
@@ -450,7 +450,7 @@ static void rtl_op_bss_info_changed(stru
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	if ((vif->type == NL80211_IFTYPE_ADHOC) ||
 	    (vif->type == NL80211_IFTYPE_AP) ||
@@ -700,7 +700,7 @@ static void rtl_op_bss_info_changed(stru
 	}
 
 out:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 static u64 rtl_op_get_tsf(struct ieee80211_hw *hw)
@@ -852,7 +852,7 @@ static int rtl_op_set_key(struct ieee802
 		  sta ? sta->addr : bcast_addr));
 	rtlpriv->sec.being_setkey = true;
 	rtl_ips_nic_on(hw);
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	/* <1> get encryption alg */
 	switch (key->cipher) {
 	case WLAN_CIPHER_SUITE_WEP40:
@@ -970,7 +970,7 @@ static int rtl_op_set_key(struct ieee802
 			 ("cmd_err:%x!!!!:\n", cmd));
 	}
 out_unlock:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 	rtlpriv->sec.being_setkey = false;
 	return err;
 }
@@ -986,7 +986,7 @@ static void rtl_op_rfkill_poll(struct ie
 	if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
 		return;
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	/*if Radio On return true here */
 	radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
@@ -1004,7 +1004,7 @@ static void rtl_op_rfkill_poll(struct ie
 		}
 	}
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 const struct ieee80211_ops rtl_ops = {
Index: wireless-testing/drivers/net/wireless/rtlwifi/ps.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/ps.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/ps.c
@@ -287,7 +287,7 @@ void rtl_ips_nic_on(struct ieee80211_hw
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	enum rf_pwrstate rtstate;
 
-	down(&rtlpriv->locks.ips_sem);
+	mutex_lock(&rtlpriv->locks.ips_mutex);
 
 	if (ppsc->b_inactiveps) {
 		rtstate = ppsc->rfpwr_state;
@@ -303,7 +303,7 @@ void rtl_ips_nic_on(struct ieee80211_hw
 		}
 	}
 
-	up(&rtlpriv->locks.ips_sem);
+	mutex_unlock(&rtlpriv->locks.ips_mutex);
 }
 
 /*for FW LPS*/
Index: wireless-testing/drivers/net/wireless/rtlwifi/wifi.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/wifi.h
+++ wireless-testing/drivers/net/wireless/rtlwifi/wifi.h
@@ -1193,8 +1193,8 @@ struct rtl_hal_cfg {
 
 struct rtl_locks {
 	/*sem */
-	struct semaphore ips_sem;
-	struct semaphore conf_sem;
+	struct mutex ips_mutex;
+	struct mutex conf_mutex;
 
 	/*spin lock */
 	spinlock_t irq_th_lock;

^ permalink raw reply

* [PATCH V2] rtlwifi: Switch locking from semaphores to mutexes
From: Larry Finger @ 2010-12-16 17:13 UTC (permalink / raw)
  To: John W Linville, Johannes Berg; +Cc: linux-wireless

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

V2 - fix typo in subject line

John,

This change was requested by Johannes.

Larry
---

Index: wireless-testing/drivers/net/wireless/rtlwifi/base.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/base.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/base.c
@@ -309,8 +309,8 @@ int rtl_init_core(struct ieee80211_hw *h
 	}
 
 	/* <4> locks */
-	sema_init(&rtlpriv->locks.ips_sem, 1);
-	sema_init(&rtlpriv->locks.conf_sem, 1);
+	mutex_init(&rtlpriv->locks.ips_mutex);
+	mutex_init(&rtlpriv->locks.conf_mutex);
 	spin_lock_init(&rtlpriv->locks.irq_th_lock);
 	spin_lock_init(&rtlpriv->locks.h2c_lock);
 	spin_lock_init(&rtlpriv->locks.rf_ps_lock);
Index: wireless-testing/drivers/net/wireless/rtlwifi/core.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/core.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/core.c
@@ -43,13 +43,13 @@ static int rtl_op_start(struct ieee80211
 		return 0;
 	if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
 		return 0;
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	err = rtlpriv->intf_ops->adapter_start(hw);
 	if (err)
 		goto out;
 	rtl_watch_dog_timer_callback((unsigned long)hw);
 out:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 	return err;
 }
 
@@ -68,7 +68,7 @@ static void rtl_op_stop(struct ieee80211
 		mdelay(1);
 	}
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	mac->link_state = MAC80211_NOLINK;
 	memset(mac->bssid, 0, 6);
@@ -79,7 +79,7 @@ static void rtl_op_stop(struct ieee80211
 	rtl_deinit_deferred_work(hw);
 	rtlpriv->intf_ops->adapter_stop(hw);
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 static int rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
@@ -119,7 +119,7 @@ static int rtl_op_add_interface(struct i
 
 	rtl_ips_nic_on(hw);
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	switch (vif->type) {
 	case NL80211_IFTYPE_STATION:
 		if (mac->beacon_enabled == 1) {
@@ -156,7 +156,7 @@ static int rtl_op_add_interface(struct i
 	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr);
 
 out:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 	return err;
 }
 
@@ -166,7 +166,7 @@ static void rtl_op_remove_interface(stru
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	/* Free beacon resources */
 	if ((mac->opmode == NL80211_IFTYPE_AP) ||
@@ -190,7 +190,7 @@ static void rtl_op_remove_interface(stru
 	mac->opmode = NL80211_IFTYPE_UNSPECIFIED;
 	rtlpriv->cfg->ops->set_network_type(hw, mac->opmode);
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 
@@ -202,7 +202,7 @@ static int rtl_op_config(struct ieee8021
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	struct ieee80211_conf *conf = &hw->conf;
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {	/*BIT(2)*/
 		RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
 			 ("IEEE80211_CONF_CHANGE_LISTEN_INTERVAL\n"));
@@ -303,7 +303,7 @@ static int rtl_op_config(struct ieee8021
 					       hw->conf.channel_type);
 	}
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 
 	return 0;
 }
@@ -450,7 +450,7 @@ static void rtl_op_bss_info_changed(stru
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	if ((vif->type == NL80211_IFTYPE_ADHOC) ||
 	    (vif->type == NL80211_IFTYPE_AP) ||
@@ -700,7 +700,7 @@ static void rtl_op_bss_info_changed(stru
 	}
 
 out:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 static u64 rtl_op_get_tsf(struct ieee80211_hw *hw)
@@ -852,7 +852,7 @@ static int rtl_op_set_key(struct ieee802
 		  sta ? sta->addr : bcast_addr));
 	rtlpriv->sec.being_setkey = true;
 	rtl_ips_nic_on(hw);
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 	/* <1> get encryption alg */
 	switch (key->cipher) {
 	case WLAN_CIPHER_SUITE_WEP40:
@@ -970,7 +970,7 @@ static int rtl_op_set_key(struct ieee802
 			 ("cmd_err:%x!!!!:\n", cmd));
 	}
 out_unlock:
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 	rtlpriv->sec.being_setkey = false;
 	return err;
 }
@@ -986,7 +986,7 @@ static void rtl_op_rfkill_poll(struct ie
 	if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
 		return;
 
-	down(&rtlpriv->locks.conf_sem);
+	mutex_lock(&rtlpriv->locks.conf_mutex);
 
 	/*if Radio On return true here */
 	radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
@@ -1004,7 +1004,7 @@ static void rtl_op_rfkill_poll(struct ie
 		}
 	}
 
-	up(&rtlpriv->locks.conf_sem);
+	mutex_unlock(&rtlpriv->locks.conf_mutex);
 }
 
 const struct ieee80211_ops rtl_ops = {
Index: wireless-testing/drivers/net/wireless/rtlwifi/ps.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/ps.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/ps.c
@@ -287,7 +287,7 @@ void rtl_ips_nic_on(struct ieee80211_hw
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	enum rf_pwrstate rtstate;
 
-	down(&rtlpriv->locks.ips_sem);
+	mutex_lock(&rtlpriv->locks.ips_mutex);
 
 	if (ppsc->b_inactiveps) {
 		rtstate = ppsc->rfpwr_state;
@@ -303,7 +303,7 @@ void rtl_ips_nic_on(struct ieee80211_hw
 		}
 	}
 
-	up(&rtlpriv->locks.ips_sem);
+	mutex_unlock(&rtlpriv->locks.ips_mutex);
 }
 
 /*for FW LPS*/
Index: wireless-testing/drivers/net/wireless/rtlwifi/wifi.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/wifi.h
+++ wireless-testing/drivers/net/wireless/rtlwifi/wifi.h
@@ -1193,8 +1193,8 @@ struct rtl_hal_cfg {
 
 struct rtl_locks {
 	/*sem */
-	struct semaphore ips_sem;
-	struct semaphore conf_sem;
+	struct mutex ips_mutex;
+	struct mutex conf_mutex;
 
 	/*spin lock */
 	spinlock_t irq_th_lock;

^ permalink raw reply

* [PATCH] checkpatch.pl: Add "prefer __packed" check
From: Joe Perches @ 2010-12-16 17:25 UTC (permalink / raw)
  To: John W. Linville, Andy Whitcroft, Andrew Morton
  Cc: Larry Finger, linux-wireless, LKML
In-Reply-To: <20101216152121.GB2413@tuxdriver.com>

There's a __packed #define for this __attribute__((packed)).
Might as well get checkpatch to tell people about it.

Signed-off-by: Joe Perches <joe@perches.com>

---

On Thu, 2010-12-16 at 10:21 -0500, John W. Linville wrote:
> On Thu, Dec 16, 2010 at 09:05:12AM -0600, Larry Finger wrote:
> > On 12/16/2010 08:34 AM, John W. Linville wrote:
> > > Use "__packed" instead of "__attribute__ ((packed))"...
> > As a point of interest, is this the "new" recommended way? The reason I ask is
> > that the Linux headers are mostly in the attribute form.
> AIUI, "__packed" is the one true way.  I think this facilitates
> compiling the kernel with compilers other than GCC.
> 
> At any rate, Dave Miller threatened to injure me if I kept sending him stuff using 
> "__attribute__ ((packed))"... :-)

 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e3c7fc0..6fc24af 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2743,6 +2743,11 @@ sub process {
 			WARN("plain inline is preferred over $1\n" . $herecurr);
 		}
 
+# Check for __attribute__ packed, prefer __packed
+		if ($line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) {
+			WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr);
+		}
+
 # check for sizeof(&)
 		if ($line =~ /\bsizeof\s*\(\s*\&/) {
 			WARN("sizeof(& should be avoided\n" . $herecurr);




^ permalink raw reply related

* Re: [PATCH] mac80211: Push idle state to driver before stop
From: Luis R. Rodriguez @ 2010-12-16 17:44 UTC (permalink / raw)
  To: Paul Stewart
  Cc: Johannes Berg, linux-wireless@vger.kernel.org, Luis Rodriguez
In-Reply-To: <AANLkTinWkYK2Zu1LsKw9YQ4dAXJ2b_quEvZLc59-c_5q@mail.gmail.com>

On Thu, Dec 16, 2010 at 08:02:27AM -0800, Paul Stewart wrote:
> On Thu, Dec 16, 2010 at 4:53 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Thu, 2010-12-16 at 04:46 -0800, Paul Stewart wrote:
> > Not really -- the driver may throw away all internal state, mac80211
> > will (attempt to) restore it all through drv_config() with changed = ~0.
> > Evidently ath9k has some magic that makes this fail?
> 
> The magic in question is as follows (ath9k_config()):
> 
>     if (changed & IEEE80211_CONF_CHANGE_IDLE) {
>         bool enable_radio;
>         bool all_wiphys_idle;
>         bool idle = !!(conf->flags & IEEE80211_CONF_IDLE);
> 
>         spin_lock_bh(&sc->wiphy_lock);
>         all_wiphys_idle =  ath9k_all_wiphys_idle(sc);
>        ath9k_set_wiphy_idle(aphy, idle);
> 
>         enable_radio = (!idle && all_wiphys_idle);
> 
>         /*
>          * After we unlock here its possible another wiphy
>          * can be re-renabled so to account for that we will
>          * only disable the radio toward the end of this routine
>          * if by then all wiphys are still idle.
>          */
>         spin_unlock_bh(&sc->wiphy_lock);
> 
>         if (enable_radio) {
>             sc->ps_idle = false;
>             ath_radio_enable(sc, hw);
>             ath_dbg(common, ATH_DBG_CONFIG,
>                     "not-idle: enabling radio\n");
>         }
>     }
> 
> So, ath9k enables and disables the radio based on ps_idle (the
> internal state), but that's not re-evaluated unless the wiphys
> actually change.  In this case they do not change because ath9k was
> never informed that the wiphy went idle (all_wiphys_idle evaluates to
> false).  One solution would be to do an ah9k_set_wiphy_idle(aphy,
> true) in ath9k_stop() instead of Luis' previous suggestion of setting
> sc->ps_idle directly.  Perhaps in January when I return from vacation
> I'll test this to make sure that performs as intended in the
> suspend-resume-while-associated case.  It's a little bit of a lie to
> do it in this case since in fact as far as mac80211 is concerned, the
> wiphy is not idle in this case.

Try this:

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c68205d..3de3dbf 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1350,6 +1350,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
 	ath9k_ps_restore(sc);
 
 	sc->ps_idle = true;
+	ath9k_set_wiphy_idle(aphy, true);
 	ath_radio_disable(sc, hw);
 
 	sc->sc_flags |= SC_OP_INVALID;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 7ca8499..4538283 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -310,6 +310,7 @@ static int ath_pci_resume(struct device *device)
 	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
 
 	sc->ps_idle = true;
+	ath9k_set_wiphy_idle(aphy, true);
 	ath_radio_disable(sc, hw);
 
 	return 0;

^ permalink raw reply related


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