Skip to contentSkip to conversation

mac80211 powersave rework

RFC/RFT New Seth Forshee 2 participants 17 messages Dec 16, 2013 – Dec 17, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Johannes,

This is a set of patches that I've been working on on-and-off for several months, in response to your feedback to some less ambitious changes I submitted previously to fix off-channel problems with Broadcom hardware [1] (though I haven't taken things so far as what you suggest there). The patches fix the Broadcom problems and should also make powersave capable of supporting multi-interface devices.

The patches add a new powersave sub-module which handles the direct hardware control of PS. The managed mode code is changed to instead control only the PS state of individual interfaces. The hardware PS state of a device is changed only from the PS module by aggregating the PS states of that device's interfaces.

The patches also add a new driver callback named change_ps to inform drivers of changes to interface PS states. My expectation is that multi-interface drivers will require something like this, but this is one area in particular where I'd like to get some feedback. I have already put this interface to use though in the Broadcom drivers to make them aware of when the HWPS field should be enabled for transmitting nullfuncs with the PM bit set.

Along with all of this I did a little bit of general clean-up of the managed mode PS code as well as some necessary changes to the scan and off-channel code.

So far I've tested this with iwlwifi, ath9k, b43, and brcmsmac, and everything seems to be working well. I've also been using the code for a couple of weeks on two machines with no sign of ill effects, so I think the code is fairly stable, at least for managed mode. I do need to test a few more specific code paths and double check that no additional locking is needed. I also haven't done testing with anything other than managed mode yet, though other modes should be largely unaffected by the changes.

Please take a look and let me know what you think. I would also love to receive testing feedback from anyone who'd like to try out these changes.

Thanks,
Seth

[1] http://marc.info/?l=linux-wireless&m=135838252227053

Seth Forshee (8):
mac80211: Move dynamic PS data out of common code
mac80211: Add per-interface powersave states and parameters
mac80211: Add powersave module
mac80211: Use PS module for managed mode powersave
mac80211: Don't start dynamic PS timer when leaving off-channel if
still scanning
brcmsmac: Set MCTL_HPS when PM should be set
b43: Allow HWPS state to be changed
b43: Set B43_MACCTL_HWPS when PM should be set

 drivers/net/wireless/b43/main.c                    |  24 ++-
 .../net/wireless/brcm80211/brcmsmac/mac80211_if.c  |   7 +
 drivers/net/wireless/brcm80211/brcmsmac/main.c     |  17 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.h     |   1 +
 include/net/mac80211.h                             |  90 ++++++--
 net/mac80211/Makefile                              |   3 +-
 net/mac80211/cfg.c                                 |   9 +-
 net/mac80211/driver-ops.h                          |  13 ++
 net/mac80211/ieee80211_i.h                         |  29 +--
 net/mac80211/iface.c                               |  11 +-
 net/mac80211/main.c                                |   7 -
 net/mac80211/mlme.c                                | 240 ++++++++++-----------
 net/mac80211/offchannel.c                          |  61 ++----
 net/mac80211/pm.c                                  |  17 +-
 net/mac80211/ps.c                                  | 162 ++++++++++++++
 net/mac80211/rx.c                                  |  10 +-
 net/mac80211/scan.c                                |  14 ++
 net/mac80211/status.c                              |  15 +-
 net/mac80211/trace.h                               |  27 +++
 net/mac80211/tx.c                                  |  16 +-
 net/mac80211/util.c                                |  58 ++++-
 21 files changed, 562 insertions(+), 269 deletions(-)
 create mode 100644 net/mac80211/ps.c
#1 lore raw

RFC PATCH 1/8 mac80211: Move dynamic PS data out of common code

The timers and work structs for dynamic powersave are used only for managed interfaces, so move them to ieee80211_if_managed and deal with them only in sections of code specifically dealing with managed mode interfaces.

---
 net/mac80211/ieee80211_i.h | 11 +++---
 net/mac80211/iface.c       |  3 --
 net/mac80211/main.c        |  7 ----
 net/mac80211/mlme.c        | 89 +++++++++++++++++++++++++++++++---------------
 net/mac80211/offchannel.c  |  6 ++--
 net/mac80211/pm.c          | 17 +++++----
 net/mac80211/rx.c          | 10 +-----
 net/mac80211/status.c      |  4 +--
 net/mac80211/tx.c          |  4 +--
 net/mac80211/util.c        | 11 ++++++
 10 files changed, 94 insertions(+), 68 deletions(-)
net/mac80211/ieee80211_i.h +5 -6
index ed5bf8b..785d1b8 100644
@@ -387,10 +387,13 @@ struct ieee80211_if_managed {
 	struct timer_list conn_mon_timer;
 	struct timer_list bcn_mon_timer;
 	struct timer_list chswitch_timer;
+	struct timer_list dynamic_ps_timer;
 	struct work_struct monitor_work;
 	struct work_struct chswitch_work;
 	struct work_struct beacon_connection_loss_work;
 	struct work_struct csa_connection_drop_work;
+	struct work_struct dynamic_ps_enable_work;
+	struct work_struct dynamic_ps_disable_work;
 
 	unsigned long beacon_timeout;
 	unsigned long probe_timeout;
@@ -1188,9 +1191,6 @@ struct ieee80211_local {
 	 * interface (and monitors) in PS, this then points there.
 	 */
 	struct ieee80211_sub_if_data *ps_sdata;
-	struct work_struct dynamic_ps_enable_work;
-	struct work_struct dynamic_ps_disable_work;
-	struct timer_list dynamic_ps_timer;
 	struct notifier_block network_latency_notifier;
 	struct notifier_block ifa_notifier;
 	struct notifier_block ifa6_notifier;
@@ -1363,6 +1363,7 @@ void ieee80211_send_pspoll(struct ieee80211_local *local,
 			   struct ieee80211_sub_if_data *sdata);
 void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
 void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
+void ieee80211_mgd_notify_rx(struct ieee80211_rx_data *rx);
 int ieee80211_max_network_latency(struct notifier_block *nb,
 				  unsigned long data, void *dummy);
 int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
@@ -1594,6 +1595,7 @@ static inline int __ieee80211_resume(struct ieee80211_hw *hw)
 extern void *mac80211_wiphy_privid; /* for wiphy privid */
 u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
 			enum nl80211_iftype type);
+void ieee80211_notify_rx(struct ieee80211_rx_data *rx);
 int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
 			     int rate, int erp, int short_preamble,
 			     int shift);
@@ -1654,9 +1656,6 @@ static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
 	ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0);
 }
 
-void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
-void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
-void ieee80211_dynamic_ps_timer(unsigned long data);
 void ieee80211_send_nullfunc(struct ieee80211_local *local,
 			     struct ieee80211_sub_if_data *sdata,
 			     int powersave);
net/mac80211/iface.c +0 -3
index 7aa9f9d..784b651 100644
@@ -816,9 +816,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		netif_addr_unlock_bh(sdata->dev);
 	}
 
-	del_timer_sync(&local->dynamic_ps_timer);
-	cancel_work_sync(&local->dynamic_ps_enable_work);
-
 	cancel_work_sync(&sdata->recalc_smps);
 	sdata->vif.csa_active = false;
 	cancel_work_sync(&sdata->csa_finalize_work);
net/mac80211/main.c +0 -7
index fa34cd2..4ab607c 100644
@@ -614,13 +614,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 	INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter);
 	local->smps_mode = IEEE80211_SMPS_OFF;
 
-	INIT_WORK(&local->dynamic_ps_enable_work,
-		  ieee80211_dynamic_ps_enable_work);
-	INIT_WORK(&local->dynamic_ps_disable_work,
-		  ieee80211_dynamic_ps_disable_work);
-	setup_timer(&local->dynamic_ps_timer,
-		    ieee80211_dynamic_ps_timer, (unsigned long) local);
-
 	INIT_WORK(&local->sched_scan_stopped_work,
 		  ieee80211_sched_scan_stopped_work);
 
net/mac80211/mlme.c +60 -29

210 lines not on this page · raw message

net/mac80211/offchannel.c +3 -3
index 0c2a294..2049a0a 100644
@@ -33,11 +33,11 @@ static void ieee80211_offchannel_ps_enable(struct ieee80211_sub_if_data *sdata)
 
 	/* FIXME: what to do when local->pspolling is true? */
 
-	del_timer_sync(&local->dynamic_ps_timer);
+	del_timer_sync(&ifmgd->dynamic_ps_timer);
 	del_timer_sync(&ifmgd->bcn_mon_timer);
 	del_timer_sync(&ifmgd->conn_mon_timer);
 
-	cancel_work_sync(&local->dynamic_ps_enable_work);
+	cancel_work_sync(&ifmgd->dynamic_ps_enable_work);
 
 	if (local->hw.conf.flags & IEEE80211_CONF_PS) {
 		local->offchannel_ps_enabled = true;
@@ -94,7 +94,7 @@ static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
 		 * the AP that we are awake.
 		 */
 		ieee80211_send_nullfunc(local, sdata, 0);
-		mod_timer(&local->dynamic_ps_timer, jiffies +
+		mod_timer(&sdata->u.mgd.dynamic_ps_timer, jiffies +
 			  msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 	}
 
net/mac80211/pm.c +10 -7
index 3401262..894c497 100644
@@ -52,13 +52,6 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 	/* Don't try to run timers while suspended. */
 	del_timer_sync(&local->sta_cleanup);
 
-	 /*
-	 * Note that this particular timer doesn't need to be
-	 * restarted at resume.
-	 */
-	cancel_work_sync(&local->dynamic_ps_enable_work);
-	del_timer_sync(&local->dynamic_ps_timer);
-
 	local->wowlan = wowlan && local->open_count;
 	if (local->wowlan) {
 		int err = drv_suspend(local, wowlan);
@@ -106,6 +99,16 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 		    sdata->vif.type == NL80211_IFTYPE_MONITOR)
 			continue;
 
+		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+			struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+			 /*
+			 * Note that this particular timer doesn't need to be
+			 * restarted at resume.
+			 */
+			cancel_work_sync(&ifmgd->dynamic_ps_enable_work);
+			del_timer_sync(&ifmgd->dynamic_ps_timer);
+		}
+
 		drv_remove_interface(local, sdata);
 	}
 
net/mac80211/rx.c +1 -9
index 2dfa755..5707566 100644
@@ -2212,7 +2212,6 @@ static ieee80211_rx_result debug_noinline
 ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 {
 	struct ieee80211_sub_if_data *sdata = rx->sdata;
-	struct ieee80211_local *local = rx->local;
 	struct net_device *dev = sdata->dev;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
 	__le16 fc = hdr->frame_control;
@@ -2258,14 +2257,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 	dev->stats.rx_packets++;
 	dev->stats.rx_bytes += rx->skb->len;
 
-	if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
-	    !is_multicast_ether_addr(
-		    ((struct ethhdr *)rx->skb->data)->h_dest) &&
-	    (!local->scanning &&
-	     !test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))) {
-			mod_timer(&local->dynamic_ps_timer, jiffies +
-			 msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
-	}
+	ieee80211_notify_rx(rx);
 
 	ieee80211_deliver_skb(rx);
 
net/mac80211/status.c +2 -2
index 1ee85c4..3298fe9 100644
@@ -740,8 +740,8 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 			local->ps_sdata->u.mgd.flags |=
 					IEEE80211_STA_NULLFUNC_ACKED;
 		} else
-			mod_timer(&local->dynamic_ps_timer, jiffies +
-					msecs_to_jiffies(10));
+			mod_timer(&local->ps_sdata->u.mgd.dynamic_ps_timer,
+				  jiffies + msecs_to_jiffies(10));
 	}
 
 	ieee80211_report_used_skb(local, skb, false);
net/mac80211/tx.c +2 -2
index 6d59e21..0ffc2066 100644
@@ -253,14 +253,14 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
 						IEEE80211_QUEUE_STOP_REASON_PS);
 		ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
 		ieee80211_queue_work(&local->hw,
-				     &local->dynamic_ps_disable_work);
+				     &ifmgd->dynamic_ps_disable_work);
 	}
 
 	/* Don't restart the timer if we're not disassociated */
 	if (!ifmgd->associated)
 		return TX_CONTINUE;
 
-	mod_timer(&local->dynamic_ps_timer, jiffies +
+	mod_timer(&ifmgd->dynamic_ps_timer, jiffies +
 		  msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 
 	return TX_CONTINUE;
net/mac80211/util.c +11 -0
index 875e172..010cd2c 100644
@@ -95,6 +95,17 @@ u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
 	return NULL;
 }
 
+void ieee80211_notify_rx(struct ieee80211_rx_data *rx)
+{
+	switch(rx->sdata->vif.type) {
+	case NL80211_IFTYPE_MONITOR:
+		ieee80211_mgd_notify_rx(rx);
+		break;
+	default:
+		break;
+	}
+}
+
 void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx)
 {
 	struct sk_buff *skb;
Signature · 1 line
1.8.3.2
maintainer
#2 lore raw

RFC PATCH 1/8 mac80211: Move dynamic PS data out of common code

net/mac80211/util.c u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, · line 102

Quoted 5 lines · Seth Forshee
net/mac80211/util.c +5 -0
+void ieee80211_notify_rx(struct ieee80211_rx_data *rx)
+{
+	switch(rx->sdata->vif.type) {
+	case NL80211_IFTYPE_MONITOR:
+		ieee80211_mgd_notify_rx(rx);

This ... seems wrong.

Also, we already have ieee80211_sta_rx_notify() which you want, I think?

With this change, do you even still need local->ps_sdata?

johannes

#3 lore raw

RFC PATCH 1/8 mac80211: Move dynamic PS data out of common code

Quoted 9 lines · Johannes Berg

net/mac80211/util.c u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, · line 102

Quoted 5 lines · Seth Forshee
net/mac80211/util.c +5 -0
+void ieee80211_notify_rx(struct ieee80211_rx_data *rx)
+{
+	switch(rx->sdata->vif.type) {
+	case NL80211_IFTYPE_MONITOR:
+		ieee80211_mgd_notify_rx(rx);

This ... seems wrong.

Yeah, it is. I guess there's always been enough tx while I was testing to keep the dynamic ps timer updated.

Quoted 1 line

Also, we already have ieee80211_sta_rx_notify() which you want, I think?

I'm not sure, that's called earlier in the rx handlers. I guess that probably only matters if there's an rx error, and the only penalty is coming out of PS briefly. So I could probably use that instead.

Quoted 1 line

With this change, do you even still need local->ps_sdata?

Some of the code still uses ps_sdata, but I do remove it in a later patch. I might be able to remove it here, but it's easier to do it when the managed code changes to use the PS module.

#4 lore raw

RFC PATCH 2/8 mac80211: Add per-interface powersave states and parameters

In reply to Seth Forshee

In preparation for managing powersave states on a per-interface basis, add powersave states and parameters to the interface- specific data structures. Also add a change_ps driver callback to notify drivers about changes to interface powersave states.

The new members and callback are unused here but will be utilized by subsequent commits.

---
 include/net/mac80211.h    | 43 +++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/driver-ops.h | 13 +++++++++++++
 net/mac80211/trace.h      | 27 +++++++++++++++++++++++++++
 3 files changed, 83 insertions(+)
include/net/mac80211.h +43 -0
index 3cd408b..03e4a63 100644
@@ -1103,6 +1103,26 @@ enum ieee80211_vif_flags {
 };
 
 /**
+ * enum ieee80211_vif_ps_mode - virtual interface power save mode
+ *
+ * Ordered in terms of increasing wakefulness.
+ *
+ * @IEEE80211_VIF_PS_INACTIVE: the interface is not currently open
+ * @IEEE80211_VIF_PS_DOZE: the interface is in a low-power mode and may
+ *	not be able to transmit or receive frames
+ * @IEEE80211_VIF_PS_AWAKE_PM: the interface is awake and able to transmit
+ *	and receive frames but PM may be set in frame control
+ * @IEEE80211_VIF_PS_AWAKE: the interface is fully awake and able to
+ *	transmit and receive frames
+ */
+enum ieee80211_vif_ps_mode {
+	IEEE80211_VIF_PS_INACTIVE,
+	IEEE80211_VIF_PS_DOZE,
+	IEEE80211_VIF_PS_AWAKE_PM,
+	IEEE80211_VIF_PS_AWAKE,
+};
+
+/**
  * struct ieee80211_vif - per-interface data
  *
  * Data in this structure is continually present for driver
@@ -1129,6 +1149,19 @@ enum ieee80211_vif_flags {
  * @debugfs_dir: debugfs dentry, can be used by drivers to create own per
  *	interface debug files. Note that it will be NULL for the virtual
  *	monitor interface (if that is requested.)
+ * @ps_mode: power save mode of this vif
+ * @dynamic_ps_active: indicates whether dynamic PS is active for this vif
+ * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the
+ *	powersave documentation below. This variable is valid only when
+ *	the interface is in the doze state.
+ * @max_sleep_period: the maximum number of beacon intervals to sleep for
+ *	before checking the beacon for a TIM bit (managed mode only); this
+ *	value will be only achievable between DTIM frames, the hardware
+ *	needs to check for the multicast traffic bit in DTIM beacons.
+ *	This variable is valid only when the interface is in the doze state.
+ * @ps_dtim_period: The DTIM period of the AP we're connected to, for use
+ *	in power saving. Power saving will not be enabled until a beacon
+ *	has been received and the DTIM period is known.
  * @drv_priv: data area for driver use, will always be aligned to
  *	sizeof(void *).
  */
@@ -1144,6 +1177,11 @@ struct ieee80211_vif {
 
 	struct ieee80211_chanctx_conf __rcu *chanctx_conf;
 
+	enum ieee80211_vif_ps_mode ps_mode;
+	bool dynamic_ps_active;
+	int dynamic_ps_timeout, max_sleep_period;
+	u8 ps_dtim_period;
+
 	u32 driver_flags;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
@@ -2390,6 +2428,10 @@ enum ieee80211_roc_type {
  *	of the bss parameters has changed when a call is made. The callback
  *	can sleep.
  *
+ * @change_ps: Change the power save mode or parameters for the given virtual
+ *	interface. @next_tbtt is required for mesh powersave but is currently
+ *	unused. This callback is optional and may sleep.
+ *
  * @prepare_multicast: Prepare for multicast filter configuration.
  *	This callback is optional, and its return value is passed
  *	to configure_filter(). This callback must be atomic.
@@ -2754,6 +2796,7 @@ struct ieee80211_ops {
 				 struct ieee80211_vif *vif,
 				 struct ieee80211_bss_conf *info,
 				 u32 changed);
+	void (*change_ps)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 
 	int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 	void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
net/mac80211/driver-ops.h +13 -0
index 5d03c47..8e708bd7 100644
@@ -227,6 +227,19 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local,
 	trace_drv_return_void(local);
 }
 
+static inline void drv_change_ps(struct ieee80211_local *local,
+				 struct ieee80211_sub_if_data *sdata)
+{
+	might_sleep();
+
+	check_sdata_in_driver(sdata);
+
+	trace_drv_change_ps(local, sdata);
+	if (local->ops->change_ps)
+		local->ops->change_ps(&local->hw, &sdata->vif);
+	trace_drv_return_void(local);
+}
+
 static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
 					struct netdev_hw_addr_list *mc_list)
 {
net/mac80211/trace.h +27 -0
index e9ccf22..fcc9ac5 100644
@@ -422,6 +422,33 @@ TRACE_EVENT(drv_bss_info_changed,
 	)
 );
 
+TRACE_EVENT(drv_change_ps,
+	TP_PROTO(struct ieee80211_local *local,
+		 struct ieee80211_sub_if_data *sdata),
+
+	TP_ARGS(local, sdata),
+
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		VIF_ENTRY
+		__field(int, ps_mode)
+		__field(bool, dynamic_ps_active)
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		VIF_ASSIGN;
+		__entry->ps_mode = sdata->vif.ps_mode;
+		__entry->dynamic_ps_active = sdata->vif.dynamic_ps_active;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT  VIF_PR_FMT "mode:%d dynamic_ps:%sactive",
+		LOCAL_PR_ARG, VIF_PR_ARG, __entry->ps_mode,
+		__entry->dynamic_ps_active ? "" : "in"
+	)
+);
+
 TRACE_EVENT(drv_prepare_multicast,
 	TP_PROTO(struct ieee80211_local *local, int mc_count),
 
Signature · 1 line
1.8.3.2
maintainer
#5 lore raw

RFC PATCH 2/8 mac80211: Add per-interface powersave states and parameters

Quoted 7 lines · Seth Forshee

In preparation for managing powersave states on a per-interface basis, add powersave states and parameters to the interface- specific data structures. Also add a change_ps driver callback to notify drivers about changes to interface powersave states.

The new members and callback are unused here but will be utilized by subsequent commits.

Can't say I like that part much, it just makes it harder to review.

Quoted 13 lines

/**
+ * enum ieee80211_vif_ps_mode - virtual interface power save mode
+ *
+ * Ordered in terms of increasing wakefulness.
+ *
+ * @IEEE80211_VIF_PS_INACTIVE: the interface is not currently open
+ * @IEEE80211_VIF_PS_DOZE: the interface is in a low-power mode and may
+ * not be able to transmit or receive frames
+ * @IEEE80211_VIF_PS_AWAKE_PM: the interface is awake and able to transmit
+ * and receive frames but PM may be set in frame control
+ * @IEEE80211_VIF_PS_AWAKE: the interface is fully awake and able to
+ * transmit and receive frames
+ */

include/net/mac80211.h enum ieee80211_vif_flags { · line 1119

Quoted 2 lines
include/net/mac80211.h +2 -0
+enum ieee80211_vif_ps_mode {
+	IEEE80211_VIF_PS_INACTIVE,

Does this INACTIVE thing really make sense? It should just be undefined if it's not associated, no? Doing this might make people want to rely on this to indicate associated-ness or something...

include/net/mac80211.h enum ieee80211_vif_flags { · line 1122

Quoted 2 lines
include/net/mac80211.h +2 -0
+	IEEE80211_VIF_PS_AWAKE_PM,
+	IEEE80211_VIF_PS_AWAKE,

The distinction between these seems somewhat unclear? "PM may be set"?

Quoted 5 lines

+ * @ps_mode: power save mode of this vif
+ * @dynamic_ps_active: indicates whether dynamic PS is active for this vif
+ * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the
+ * powersave documentation below. This variable is valid only when
+ * the interface is in the doze state.

Quoted 8 lines

+ * @max_sleep_period: the maximum number of beacon intervals to sleep for
+ * before checking the beacon for a TIM bit (managed mode only); this
+ * value will be only achievable between DTIM frames, the hardware
+ * needs to check for the multicast traffic bit in DTIM beacons.
+ * This variable is valid only when the interface is in the doze state.
+ * @ps_dtim_period: The DTIM period of the AP we're connected to, for use
+ * in power saving. Power saving will not be enabled until a beacon
+ * has been received and the DTIM period is known.

Should these really be in the vif struct? They still seem somewhat internal to the implementation.

johannes

#6 lore raw

RFC PATCH 2/8 mac80211: Add per-interface powersave states and parameters

Quoted 10 lines · Johannes Berg
Quoted 7 lines · Seth Forshee

In preparation for managing powersave states on a per-interface basis, add powersave states and parameters to the interface- specific data structures. Also add a change_ps driver callback to notify drivers about changes to interface powersave states.

The new members and callback are unused here but will be utilized by subsequent commits.

Can't say I like that part much, it just makes it harder to review.

Okay, I can squash it into the other patch easily enough.

Quoted 11 lines
Quoted 11 lines

/**
+ * enum ieee80211_vif_ps_mode - virtual interface power save mode
+ *
+ * Ordered in terms of increasing wakefulness.
+ *
+ * @IEEE80211_VIF_PS_INACTIVE: the interface is not currently open
+ * @IEEE80211_VIF_PS_DOZE: the interface is in a low-power mode and may
+ * not be able to transmit or receive frames
+ * @IEEE80211_VIF_PS_AWAKE_PM: the interface is awake and able to transmit
+ * and receive frames but PM may be set in frame control
+ * @IEEE80211_VIF_PS_AWAKE: the interface is fully awake and able to

Quoted 8 lines

include/net/mac80211.h enum ieee80211_vif_flags { · line 1119

Quoted 4 lines

+ * transmit and receive frames
+ */

include/net/mac80211.h +2 -0
+enum ieee80211_vif_ps_mode {
+	IEEE80211_VIF_PS_INACTIVE,

Does this INACTIVE thing really make sense? It should just be undefined if it's not associated, no? Doing this might make people want to rely on this to indicate associated-ness or something...

I use it to detect attempts to set the PS mode on interface which aren't opened, but perhaps that isn't necessary. I'll look into it.

Quoted 4 lines

include/net/mac80211.h enum ieee80211_vif_flags { · line 1122

Quoted 2 lines
include/net/mac80211.h +2 -0
+	IEEE80211_VIF_PS_AWAKE_PM,
+	IEEE80211_VIF_PS_AWAKE,

The distinction between these seems somewhat unclear? "PM may be set"?

This is for Broadcom. It needs to be told somehow that mac80211 wants to transmit frames with PM set, otherwise it's clearing them in the HW. I thought about using a flag too, so long as there's some way to tell it to set PM without powering down the hw.

Quoted 14 lines
Quoted 5 lines

+ * @ps_mode: power save mode of this vif
+ * @dynamic_ps_active: indicates whether dynamic PS is active for this vif
+ * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the
+ * powersave documentation below. This variable is valid only when
+ * the interface is in the doze state.

Quoted 8 lines

+ * @max_sleep_period: the maximum number of beacon intervals to sleep for
+ * before checking the beacon for a TIM bit (managed mode only); this
+ * value will be only achievable between DTIM frames, the hardware
+ * needs to check for the multicast traffic bit in DTIM beacons.
+ * This variable is valid only when the interface is in the doze state.
+ * @ps_dtim_period: The DTIM period of the AP we're connected to, for use
+ * in power saving. Power saving will not be enabled until a beacon
+ * has been received and the DTIM period is known.

Quoted 2 lines

Should these really be in the vif struct? They still seem somewhat internal to the implementation.

I made an assumption that multi-interface drivers would want to be told about PS states and parameters for individual interfaces. This notification happens via the change_ps callback using these members from the vif.

#7 lore raw

RFC PATCH 3/8 mac80211: Add powersave module

In reply to Seth Forshee

The current powersave implementation manages the hw PS state directly based on the type of interface attached to the device, making it unsuitable for supporting multiple vifs on a single device. This commit adds a new powersave module which will take over the direct control of the hw PS states. The power states of interfaces will be managed based on the interface type, and the PS module will aggregate the interface states for a device and set the hw PS state accordingly.

This commit adds the PS module but leaves it unused. Later commits will convert the rest of mac80211 to use this module.

---
 include/net/mac80211.h     |  47 +++++++------
 net/mac80211/Makefile      |   3 +-
 net/mac80211/ieee80211_i.h |   8 +++
 net/mac80211/ps.c          | 162 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 200 insertions(+), 20 deletions(-)
 create mode 100644 net/mac80211/ps.c
include/net/mac80211.h +28 -19
index 03e4a63..3c9ce86 100644
@@ -1870,22 +1870,29 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
 /**
  * DOC: Powersave support
  *
+ * There are two methods by which drivers can support powersave. Drivers
+ * which support only a single interface can use the information in
+ * &struct ieee80211_conf from the config() callback. Drivers supporting
+ * multiple interfaces must implement the change_ps() callback and use the
+ * per-interface powersave state in &struct ieee80211_vif. Details for using
+ * both techniques are described in subsequent sections.
+ *
  * mac80211 has support for various powersave implementations.
  *
  * First, it can support hardware that handles all powersaving by itself,
  * such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS hardware
- * flag. In that case, it will be told about the desired powersave mode
- * with the %IEEE80211_CONF_PS flag depending on the association status.
- * The hardware must take care of sending nullfunc frames when necessary,
- * i.e. when entering and leaving powersave mode. The hardware is required
- * to look at the AID in beacons and signal to the AP that it woke up when
- * it finds traffic directed to it.
- *
- * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in
- * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused
- * with hardware wakeup and sleep states. Driver is responsible for waking
- * up the hardware before issuing commands to the hardware and putting it
- * back to sleep at appropriate times.
+ * flag. In that case, depending on association status, it will be told about
+ * the desired powersave mode with the @ps_mode field or the
+ * %IEEE80211_CONF_PS flag. The hardware must take care of sending nullfunc
+ * frames when necessary, i.e. when entering and leaving powersave mode. The
+ * hardware is required to look at the AID in beacons and signal to the AP
+ * that it woke up when it finds traffic directed to it.
+ *
+ * When @ps_mode == %IEEE80211_VIF_PS_DOZE or the %IEEE80211_CONF_PS flag is
+ * set it means that the powersave mode defined in IEEE 802.11-2007 section
+ * 11.2 is enabled. This is not to be confused with hardware wakeup and sleep
+ * states. The driver is responsible for waking up the hardware before issuing
+ * commands to the hardware and putting it back to sleep at appropriate times.
  *
  * When PS is enabled, hardware needs to wakeup for beacons and receive the
  * buffered multicast/broadcast frames after the beacon. Also it must be
@@ -1903,19 +1910,21 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
  * hardware stays awake for a user-specified period of time after sending a
  * frame so that reply frames need not be buffered and therefore delayed to
  * the next wakeup. It's compromise of getting good enough latency when
- * there's data traffic and still saving significantly power in idle
- * periods.
+ * there's data traffic and still saving significant power in idle periods.
  *
  * Dynamic powersave is simply supported by mac80211 enabling and disabling
  * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS
  * flag and mac80211 will handle everything automatically. Additionally,
  * hardware having support for the dynamic PS feature may set the
  * %IEEE80211_HW_SUPPORTS_DYNAMIC_PS flag to indicate that it can support
- * dynamic PS mode itself. The driver needs to look at the
- * @dynamic_ps_timeout hardware configuration value and use it that value
- * whenever %IEEE80211_CONF_PS is set. In this case mac80211 will disable
- * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
- * enabled whenever user has enabled powersave.
+ * dynamic PS mode itself. Single-interface drivers need to look at the
+ * @dynamic_ps_timeout hardware configuration value and use that value
+ * whenever %IEEE80211_CONF_PS is set. Drivers supporting multiple interfaces
+ * should look at @dynamic_ps_active whenever @ps_mode is
+ * %IEEE80211_VIF_PS_DOZE to determine if dynamic powersave is enabled and
+ * use the @dynamic_ps_timeout value in &struct ieee80211_vif. In this case
+ * mac80211 will disable dynamic PS feature in stack and will just keep
+ * powersave enabled whenever the user has enabled powersave.
  *
  * Driver informs U-APSD client support by enabling
  * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the
net/mac80211/Makefile +2 -1
index 9d7d840..9416198 100644
@@ -25,7 +25,8 @@ mac80211-y := \
 	wme.o \
 	event.o \
 	chan.o \
-	trace.o mlme.o
+	trace.o mlme.o \
+	ps.o
 
 mac80211-$(CONFIG_MAC80211_LEDS) += led.o
 mac80211-$(CONFIG_MAC80211_DEBUGFS) += \
net/mac80211/ieee80211_i.h +8 -0
index 785d1b8..a489676 100644
@@ -1180,6 +1180,7 @@ struct ieee80211_local {
 #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
 
 
+	int awake_cnt;
 	int total_ps_buffered; /* total number of all buffered unicast and
 				* multicast packets for power saving stations
 				*/
@@ -1788,6 +1789,13 @@ int ieee80211_cs_headroom(struct ieee80211_local *local,
 			  struct cfg80211_crypto_settings *crypto,
 			  enum nl80211_iftype iftype);
 
+/* power save */
+void ieee80211_ps_init_vif(struct ieee80211_sub_if_data *sdata);
+void ieee80211_ps_vif_open(struct ieee80211_sub_if_data *sdata);
+void ieee80211_ps_vif_close(struct ieee80211_sub_if_data *sdata);
+void ieee80211_vif_set_ps_mode(struct ieee80211_sub_if_data *sdata,
+			       enum ieee80211_vif_ps_mode mode);
+
 #ifdef CONFIG_MAC80211_NOINLINE
 #define debug_noinline noinline
 #else
net/mac80211/ps.c new file +162 -0

162 lines not on this page · raw message

Signature · 1 line
1.8.3.2
maintainer
#8 lore raw

RFC PATCH 3/8 mac80211: Add powersave module

Quoted 3 lines · Seth Forshee

+ * When @ps_mode == %IEEE80211_VIF_PS_DOZE or the %IEEE80211_CONF_PS flag is
+ * set it means that the powersave mode defined in IEEE 802.11-2007 section
+ * 11.2 is enabled.

We might consider updating the references to 802.11-2012 since everything shuffled around.

net/mac80211/ieee80211_i.h struct ieee80211_local { · line 1183

Quoted 6 lines

+++ b/net/mac80211/ieee80211_i.h

net/mac80211/ieee80211_i.h +1 -0
@@ -1180,6 +1180,7 @@ struct ieee80211_local {
 #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
 
 
+	int awake_cnt;

How will the locking for this possibly work? :)

net/mac80211/ps.c line 22

Quoted 13 lines
net/mac80211/ps.c new file +13 -0
+#include <linux/nl80211.h>
+#include <linux/pm_qos.h>
+#include <net/mac80211.h>
+#include "ieee80211_i.h"
+#include "driver-ops.h"
+
+/*
+ * Sets the PS parameters in ieee80211_conf. Uses parameters from the first
+ * managed interface found which has power save enabled, or failing that
+ * the parameters from an arbitrary managed interface are used.
+ */
+static void ieee80211_set_ps_params(struct ieee80211_local *local) { struct
+	ieee80211_sub_if_data *sdata, *ps_sdata = NULL;

what happened to indentation here??

net/mac80211/ps.c line 24

Quoted 1 line
net/mac80211/ps.c new file +1 -0
+	list_for_each_entry(sdata, &local->interfaces, list) {

locking?

net/mac80211/ps.c line 36

Quoted 2 lines
net/mac80211/ps.c new file +2 -0
+	if (ps_sdata) {
+		struct ieee80211_vif *vif = &sdata->vif;

add a newline here please

Quoted 4 lines
net/mac80211/ps.c new file +4 -0
+static void __ieee80211_vif_set_ps_mode(struct ieee80211_sub_if_data *sdata,
+					enum ieee80211_vif_ps_mode mode)
+{
+	struct ieee80211_local *local = sdata->local;

net/mac80211/ps.c line 76

Quoted 10 lines
net/mac80211/ps.c new file +10 -0
+
+	if (WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_MONITOR))
+		return;
+
+	switch (mode) {
+	case IEEE80211_VIF_PS_INACTIVE:
+	case IEEE80211_VIF_PS_DOZE:
+		if (sdata->vif.ps_mode > IEEE80211_VIF_PS_DOZE &&
+		    !WARN_ON(local->awake_cnt <= 0))
+			local->awake_cnt--;

locking?

johannes

#9 lore raw

RFC PATCH 3/8 mac80211: Add powersave module

Quoted 8 lines · Johannes Berg
Quoted 3 lines · Seth Forshee

+ * When @ps_mode == %IEEE80211_VIF_PS_DOZE or the %IEEE80211_CONF_PS flag is
+ * set it means that the powersave mode defined in IEEE 802.11-2007 section
+ * 11.2 is enabled.

We might consider updating the references to 802.11-2012 since everything shuffled around.

Okay.

Quoted 8 lines

net/mac80211/ieee80211_i.h struct ieee80211_local { · line 1183

Quoted 6 lines

+++ b/net/mac80211/ieee80211_i.h

net/mac80211/ieee80211_i.h +1 -0
@@ -1180,6 +1180,7 @@ struct ieee80211_local {
 #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
 
 
+	int awake_cnt;

How will the locking for this possibly work? :)

Well, I did warn that I still need to look at locking ;-)

Mostly the access is already serialized, either by nature of going through ieee80211_recalc_ps which already has locking rules or by being run on the device workqueue. I need to try and grok how all the current mac80211 locking works and see if I need to add something new. Suggestions are welcome :-)

Quoted 16 lines
Quoted 4 lines
net/mac80211/ps.c new file +3 -0
+#include <linux/nl80211.h>
+#include <linux/pm_qos.h>
+#include <net/mac80211.h>

net/mac80211/ps.c line 22

Quoted 10 lines
net/mac80211/ps.c new file +10 -0
+#include "ieee80211_i.h"
+#include "driver-ops.h"
+
+/*
+ * Sets the PS parameters in ieee80211_conf. Uses parameters from the first
+ * managed interface found which has power save enabled, or failing that
+ * the parameters from an arbitrary managed interface are used.
+ */
+static void ieee80211_set_ps_params(struct ieee80211_local *local) { struct
+	ieee80211_sub_if_data *sdata, *ps_sdata = NULL;

what happened to indentation here??

Hmm, I don't know. Probably I accidentally hit J in vim a couple of times and didn't notice.

Quoted 4 lines

net/mac80211/ps.c line 36

Quoted 2 lines
net/mac80211/ps.c new file +2 -0
+	if (ps_sdata) {
+		struct ieee80211_vif *vif = &sdata->vif;

add a newline here please

Okay.

#10 lore raw

RFC PATCH 4/8 mac80211: Use PS module for managed mode powersave

In reply to Seth Forshee

Convert the managed mode code to manipulate interface PS states rather than changing the hw PS state directly. The off-channel and scan code must be updated at the same time in order to avoid conflicts with the PS module.

---
 net/mac80211/cfg.c         |   9 +--
 net/mac80211/ieee80211_i.h |  10 +--
 net/mac80211/iface.c       |   8 ++-
 net/mac80211/mlme.c        | 173 +++++++++++++++++----------------------------
 net/mac80211/offchannel.c  |  57 +++++----------
 net/mac80211/scan.c        |  14 ++++
 net/mac80211/status.c      |  13 ++--
 net/mac80211/tx.c          |  12 ++--
 net/mac80211/util.c        |  47 +++++++++---
 9 files changed, 159 insertions(+), 184 deletions(-)
net/mac80211/cfg.c +3 -6
index f80e8c4..40040ad 100644
@@ -552,7 +552,7 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
 		sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
 	if (sdata->vif.bss_conf.use_short_slot)
 		sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
-	sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period;
+	sinfo->bss_param.dtim_period = sdata->vif.ps_dtim_period;
 	sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
 
 	sinfo->sta_flags.set = 0;
@@ -1596,7 +1596,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
 
 	if (sdata->vif.type == NL80211_IFTYPE_STATION &&
 	    params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
-		ieee80211_recalc_ps(local, -1);
+		ieee80211_recalc_ps(sdata);
 		ieee80211_recalc_ps_vif(sdata);
 	}
 
@@ -2532,10 +2532,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 	__ieee80211_request_smps_mgd(sdata, sdata->u.mgd.req_smps);
 	sdata_unlock(sdata);
 
-	if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
-		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
-
-	ieee80211_recalc_ps(local, -1);
+	ieee80211_recalc_ps(sdata);
 	ieee80211_recalc_ps_vif(sdata);
 
 	return 0;
net/mac80211/ieee80211_i.h +3 -7
index a489676..4b0750f 100644
@@ -394,6 +394,7 @@ struct ieee80211_if_managed {
 	struct work_struct csa_connection_drop_work;
 	struct work_struct dynamic_ps_enable_work;
 	struct work_struct dynamic_ps_disable_work;
+	enum ieee80211_vif_ps_mode offchannel_ps_mode;
 
 	unsigned long beacon_timeout;
 	unsigned long probe_timeout;
@@ -1186,12 +1187,6 @@ struct ieee80211_local {
 				*/
 
 	bool pspolling;
-	bool offchannel_ps_enabled;
-	/*
-	 * PS can only be enabled when we have exactly one managed
-	 * interface (and monitors) in PS, this then points there.
-	 */
-	struct ieee80211_sub_if_data *ps_sdata;
 	struct notifier_block network_latency_notifier;
 	struct notifier_block ifa_notifier;
 	struct notifier_block ifa6_notifier;
@@ -1362,7 +1357,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
 			   struct cfg80211_disassoc_request *req);
 void ieee80211_send_pspoll(struct ieee80211_local *local,
 			   struct ieee80211_sub_if_data *sdata);
-void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
+void ieee80211_recalc_ps(struct ieee80211_sub_if_data *sdata);
+void ieee80211_mgd_recalc_ps(struct ieee80211_sub_if_data *sdata);
 void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
 void ieee80211_mgd_notify_rx(struct ieee80211_rx_data *rx);
 int ieee80211_max_network_latency(struct notifier_block *nb,
net/mac80211/iface.c +5 -3
index 784b651..6444a50 100644
@@ -682,7 +682,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 	if (hw_reconf_flags)
 		ieee80211_hw_config(local, hw_reconf_flags);
 
-	ieee80211_recalc_ps(local, -1);
+	ieee80211_ps_vif_open(sdata);
 
 	if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
 	    sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
@@ -943,6 +943,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		return;
 	}
 
+	ieee80211_ps_vif_close(sdata);
+
 	switch (sdata->vif.type) {
 	case NL80211_IFTYPE_AP_VLAN:
 		break;
@@ -963,8 +965,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 			drv_remove_interface(local, sdata);
 	}
 
-	ieee80211_recalc_ps(local, -1);
-
 	if (local->open_count == 0) {
 		ieee80211_stop_device(local);
 
@@ -1609,6 +1609,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 		strlcpy(sdata->name, name, IFNAMSIZ);
 		ieee80211_assign_perm_addr(local, wdev->address, type);
 		memcpy(sdata->vif.addr, wdev->address, ETH_ALEN);
+		ieee80211_ps_init_vif(sdata);
 	} else {
 		if (local->hw.queues >= IEEE80211_NUM_ACS)
 			txqs = IEEE80211_NUM_ACS;
@@ -1644,6 +1645,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 		ndev->ieee80211_ptr = &sdata->wdev;
 		memcpy(sdata->vif.addr, ndev->dev_addr, ETH_ALEN);
 		memcpy(sdata->name, ndev->name, IFNAMSIZ);
+		ieee80211_ps_init_vif(sdata);
 
 		sdata->dev = ndev;
 	}
net/mac80211/mlme.c +64 -109

334 lines not on this page · raw message

net/mac80211/offchannel.c +18 -39

77 lines not on this page · raw message

net/mac80211/scan.c +14 -0
index 4d73c46..b0e538e 100644
@@ -345,6 +345,8 @@ EXPORT_SYMBOL(ieee80211_scan_completed);
 
 static int ieee80211_start_sw_scan(struct ieee80211_local *local)
 {
+	struct ieee80211_sub_if_data *sdata;
+
 	/* Software scan is not supported in multi-channel cases */
 	if (local->use_chanctx)
 		return -EOPNOTSUPP;
@@ -378,6 +380,11 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
 	/* We need to set power level at maximum rate for scanning. */
 	ieee80211_hw_config(local, 0);
 
+	sdata = rcu_dereference_protected(local->scan_sdata,
+					  lockdep_is_held(&local->mtx));
+	if (sdata && sdata->vif.ps_mode != IEEE80211_VIF_PS_AWAKE)
+		ieee80211_vif_set_ps_mode(sdata, IEEE80211_VIF_PS_AWAKE);
+
 	ieee80211_queue_delayed_work(&local->hw,
 				     &local->scan_work, 0);
 
@@ -726,6 +733,8 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local,
 static void ieee80211_scan_state_resume(struct ieee80211_local *local,
 					unsigned long *next_delay)
 {
+	struct ieee80211_sub_if_data *sdata;
+
 	ieee80211_offchannel_stop_vifs(local);
 
 	if (local->ops->flush) {
@@ -737,6 +746,11 @@ static void ieee80211_scan_state_resume(struct ieee80211_local *local,
 	/* remember when we left the operating channel */
 	local->leave_oper_channel_time = jiffies;
 
+	sdata = rcu_dereference_protected(local->scan_sdata,
+					  lockdep_is_held(&local->mtx));
+	if (sdata && sdata->vif.ps_mode != IEEE80211_VIF_PS_AWAKE)
+		ieee80211_vif_set_ps_mode(sdata, IEEE80211_VIF_PS_AWAKE);
+
 	/* advance to the next channel to be scanned */
 	local->next_scan_state = SCAN_SET_CHANNEL;
 }
net/mac80211/status.c +7 -6
index 3298fe9..5e001e0 100644
@@ -732,15 +732,16 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 			local->dot11FailedCount++;
 	}
 
+	sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev);
 	if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc) &&
 	    (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) &&
 	    !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
-	    local->ps_sdata && !(local->scanning)) {
-		if (info->flags & IEEE80211_TX_STAT_ACK) {
-			local->ps_sdata->u.mgd.flags |=
-					IEEE80211_STA_NULLFUNC_ACKED;
-		} else
-			mod_timer(&local->ps_sdata->u.mgd.dynamic_ps_timer,
+	    sdata->vif.ps_mode < IEEE80211_VIF_PS_AWAKE &&
+	    !(local->scanning)) {
+		if (info->flags & IEEE80211_TX_STAT_ACK)
+			sdata->u.mgd.flags |= IEEE80211_STA_NULLFUNC_ACKED;
+		else
+			mod_timer(&sdata->u.mgd.dynamic_ps_timer,
 				  jiffies + msecs_to_jiffies(10));
 	}
 
net/mac80211/tx.c +7 -5
index 0ffc2066..995fae4 100644
@@ -198,6 +198,7 @@ static ieee80211_tx_result debug_noinline
 ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
 {
 	struct ieee80211_local *local = tx->local;
+	struct ieee80211_sub_if_data *sdata = tx->sdata;
 	struct ieee80211_if_managed *ifmgd;
 
 	/* driver doesn't support power save */
@@ -209,14 +210,15 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
 		return TX_CONTINUE;
 
 	/* dynamic power save disabled */
-	if (local->hw.conf.dynamic_ps_timeout <= 0)
+	if (sdata->vif.dynamic_ps_timeout <= 0)
 		return TX_CONTINUE;
 
 	/* we are scanning, don't enable power save */
 	if (local->scanning)
 		return TX_CONTINUE;
 
-	if (!local->ps_sdata)
+	if (!sdata->vif.dynamic_ps_active &&
+	    sdata->vif.ps_mode == IEEE80211_VIF_PS_AWAKE)
 		return TX_CONTINUE;
 
 	/* No point if we're going to suspend */
@@ -227,7 +229,7 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
 	if (tx->sdata->vif.type != NL80211_IFTYPE_STATION)
 		return TX_CONTINUE;
 
-	ifmgd = &tx->sdata->u.mgd;
+	ifmgd = &sdata->u.mgd;
 
 	/*
 	 * Don't wakeup from power save if u-apsd is enabled, voip ac has
@@ -247,7 +249,7 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
 	    skb_get_queue_mapping(tx->skb) == IEEE80211_AC_VO)
 		return TX_CONTINUE;
 
-	if (local->hw.conf.flags & IEEE80211_CONF_PS) {
+	if (sdata->vif.ps_mode == IEEE80211_VIF_PS_DOZE) {
 		ieee80211_stop_queues_by_reason(&local->hw,
 						IEEE80211_MAX_QUEUE_MAP,
 						IEEE80211_QUEUE_STOP_REASON_PS);
@@ -261,7 +263,7 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
 		return TX_CONTINUE;
 
 	mod_timer(&ifmgd->dynamic_ps_timer, jiffies +
-		  msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
+		  msecs_to_jiffies(sdata->vif.dynamic_ps_timeout));
 
 	return TX_CONTINUE;
 }
net/mac80211/util.c +38 -9

72 lines not on this page · raw message

Signature · 1 line
1.8.3.2
maintainer
#11 lore raw

RFC PATCH 4/8 mac80211: Use PS module for managed mode powersave

net/mac80211/iface.c int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) · line 685

Quoted 8 lines · Seth Forshee
net/mac80211/iface.c +1 -1
@@ -682,7 +682,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 	if (hw_reconf_flags)
 		ieee80211_hw_config(local, hw_reconf_flags);
 
-	ieee80211_recalc_ps(local, -1);
+	ieee80211_ps_vif_open(sdata);

I have a feeling that now that we have very regular join/leave code, and are guaranteed to go through disassoc when the interface is stopped, we probably don't need all the hooks in this file at all any more.

net/mac80211/iface.c int ieee80211_if_add(struct ieee80211_local *local, const char *name, · line 1612

Quoted 5 lines
net/mac80211/iface.c +1 -0
@@ -1609,6 +1609,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 		strlcpy(sdata->name, name, IFNAMSIZ);
 		ieee80211_assign_perm_addr(local, wdev->address, type);
 		memcpy(sdata->vif.addr, wdev->address, ETH_ALEN);
+		ieee80211_ps_init_vif(sdata);

That doesn't really seem like the right place? Shouldn't it somehow be specific for managed interfaces, and be reset when the interface changes type, for example?

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) · line 735

Quoted 7 lines
net/mac80211/status.c +1 -0
@@ -732,15 +732,16 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 			local->dot11FailedCount++;
 	}
 
+	sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev);

This isn't safe, the interface can go away while the SKB is on some hardware queue. Look at what we do in ieee80211_report_used_skb() and maybe refactor that somehow.

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) · line 739

Quoted 5 lines
net/mac80211/status.c +1 -1
-	if (local->hw.conf.flags & IEEE80211_CONF_PS) {
+	if (sdata->vif.ps_mode == IEEE80211_VIF_PS_DOZE) {
 		ieee80211_stop_queues_by_reason(&local->hw,
 						IEEE80211_MAX_QUEUE_MAP,
 						IEEE80211_QUEUE_STOP_REASON_PS);

This is a bit odd now - shouldn't you only stop the queues for that interface? Or is this still assuming only a single interface?

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)

Quoted 11 lines
net/mac80211/status.c +8 -2
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (sdata->vif.type != NL80211_IFTYPE_STATION)
+			continue;
+		if (!sdata->u.mgd.associated)
+			continue;
+		if (sdata->vif.ps_mode != IEEE80211_VIF_PS_AWAKE)
+			continue;
 
-			ieee80211_send_nullfunc(local, sdata, 0);
-		}
+		ieee80211_send_nullfunc(local, sdata, 0);

Unrelated to your patch, but we should probably send a nullfunc(PM=1) packet for the other cases to detect if we got disconnected. Or wake up briefly, and go back to sleep later or something ...

net/mac80211/status.c

Quoted 10 lines
net/mac80211/status.c +10 -0
+void ieee80211_recalc_ps(struct ieee80211_sub_if_data *sdata)
+{
+	switch (sdata->vif.type) {
+	case NL80211_IFTYPE_STATION:
+		ieee80211_mgd_recalc_ps(sdata);
+		break;
+	default:
+		break;
+	}
+}

Would that make more sense in ps.c now?

net/mac80211/status.c

Quoted 2 lines
net/mac80211/status.c +2 -0
+int ieee80211_max_network_latency(struct notifier_block *nb,
+				  unsigned long data, void *dummy)

ditto?

net/mac80211/status.c

Quoted 2 lines
net/mac80211/status.c +2 -0
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry_rcu(sdata, &local->interfaces, list) {

locking mutex & then rcu seems weird.
johannes

#12 lore raw

RFC PATCH 4/8 mac80211: Use PS module for managed mode powersave

Quoted 8 lines · Johannes Berg
Quoted 6 lines · Seth Forshee
net/mac80211/iface.c +0 -0
@@ -682,7 +682,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 	if (hw_reconf_flags)
 		ieee80211_hw_config(local, hw_reconf_flags);
 
Quoted 6 lines

net/mac80211/iface.c int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) · line 685

Quoted 2 lines
net/mac80211/iface.c +1 -1
-	ieee80211_recalc_ps(local, -1);
+	ieee80211_ps_vif_open(sdata);

I have a feeling that now that we have very regular join/leave code, and are guaranteed to go through disassoc when the interface is stopped, we probably don't need all the hooks in this file at all any more.

Okay, I'll look at this.

Quoted 9 lines

net/mac80211/iface.c int ieee80211_if_add(struct ieee80211_local *local, const char *name, · line 1612

Quoted 5 lines
net/mac80211/iface.c +1 -0
@@ -1609,6 +1609,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 		strlcpy(sdata->name, name, IFNAMSIZ);
 		ieee80211_assign_perm_addr(local, wdev->address, type);
 		memcpy(sdata->vif.addr, wdev->address, ETH_ALEN);
+		ieee80211_ps_init_vif(sdata);

That doesn't really seem like the right place? Shouldn't it somehow be specific for managed interfaces, and be reset when the interface changes type, for example?

I intended the PS code to be usable for other interface types and tried to isolate the parts specific to managed mode. Right now at minimum other interface types need to "open" the interface with the PS module to reference awake_count.

Maybe this is the wrong place though. I'll look at it.

Quoted 11 lines

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) · line 735

Quoted 7 lines
net/mac80211/status.c +1 -0
@@ -732,15 +732,16 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 			local->dot11FailedCount++;
 	}
 
+	sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev);

This isn't safe, the interface can go away while the SKB is on some hardware queue. Look at what we do in ieee80211_report_used_skb() and maybe refactor that somehow.

Okay. This was using ps_sdata, so I need some other way to get at sdata. I'll look at that code.

Quoted 8 lines

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) · line 739

Quoted 5 lines
net/mac80211/status.c +1 -1
-	if (local->hw.conf.flags & IEEE80211_CONF_PS) {
+	if (sdata->vif.ps_mode == IEEE80211_VIF_PS_DOZE) {
 		ieee80211_stop_queues_by_reason(&local->hw,
 						IEEE80211_MAX_QUEUE_MAP,
 						IEEE80211_QUEUE_STOP_REASON_PS);

This is a bit odd now - shouldn't you only stop the queues for that interface? Or is this still assuming only a single interface?

You're right, this probably should just stop the interface queues.

Quoted 29 lines

net/mac80211/status.c void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)

Quoted 11 lines
net/mac80211/status.c +8 -2
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (sdata->vif.type != NL80211_IFTYPE_STATION)
+			continue;
+		if (!sdata->u.mgd.associated)
+			continue;
+		if (sdata->vif.ps_mode != IEEE80211_VIF_PS_AWAKE)
+			continue;
 
-			ieee80211_send_nullfunc(local, sdata, 0);
-		}
+		ieee80211_send_nullfunc(local, sdata, 0);

Unrelated to your patch, but we should probably send a nullfunc(PM=1) packet for the other cases to detect if we got disconnected. Or wake up briefly, and go back to sleep later or something ...

net/mac80211/status.c

Quoted 10 lines
net/mac80211/status.c +10 -0
+void ieee80211_recalc_ps(struct ieee80211_sub_if_data *sdata)
+{
+	switch (sdata->vif.type) {
+	case NL80211_IFTYPE_STATION:
+		ieee80211_mgd_recalc_ps(sdata);
+		break;
+	default:
+		break;
+	}
+}

Would that make more sense in ps.c now?

Quoted 4 lines

net/mac80211/status.c

Quoted 2 lines
net/mac80211/status.c +2 -0
+int ieee80211_max_network_latency(struct notifier_block *nb,
+				  unsigned long data, void *dummy)

ditto?

I guess so, either one seems okay to me.

Quoted 4 lines

net/mac80211/status.c

Quoted 2 lines
net/mac80211/status.c +2 -0
+	mutex_lock(&local->iflist_mtx);
+	list_for_each_entry_rcu(sdata, &local->interfaces, list) {

locking mutex & then rcu seems weird.

Oops. I'll fix that.

#13 lore raw

RFC PATCH 5/8 mac80211: Don't start dynamic PS timer when leaving off-channel if still scanning

In reply to Seth Forshee

Most of mac80211 does not update the dynamic PS timer during scans, but ieee80211_offchannel_ps_disable() will still restart it if a scan is in progress. It doesn't make sense to do this if no other code is updating the timer, so update this function to only restart the timer if not scanning.

---
 net/mac80211/offchannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/offchannel.c +1 -1
index 5802c00..1744886 100644
@@ -72,7 +72,7 @@ static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
 	ieee80211_vif_set_ps_mode(sdata, mode);
 	if (mode == IEEE80211_VIF_PS_AWAKE) {
 		ieee80211_send_nullfunc(local, sdata, 0);
-		if (sdata->vif.dynamic_ps_active)
+		if (sdata->vif.dynamic_ps_active && !local->scanning)
 			mod_timer(&ifmgd->dynamic_ps_timer, jiffies +
 				  msecs_to_jiffies(sdata->vif.dynamic_ps_timeout));
 	}
Signature · 1 line
1.8.3.2
#14 lore raw

RFC PATCH 6/8 brcmsmac: Set MCTL_HPS when PM should be set

In reply to Seth Forshee

Even though powersave is not supported MCTL_HPS still needs to be set in order to transmit nullfunc frames with PM set. Add support for the change_ps callback to set this bit whenever the powersave mode requires PM to be set.

---
 drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c |  7 +++++++
 drivers/net/wireless/brcm80211/brcmsmac/main.c        | 17 ++++++++++-------
 drivers/net/wireless/brcm80211/brcmsmac/main.h        |  1 +
 3 files changed, 18 insertions(+), 7 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +7 -0
index e71ce8c..e6a8c72 100644
@@ -734,6 +734,12 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
 	return;
 }
 
+void brcms_ops_change_ps(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+	struct brcms_info *wl = hw->priv;
+	brcms_c_set_ps_ctrl(wl->wlc, vif);
+}
+
 static void
 brcms_ops_configure_filter(struct ieee80211_hw *hw,
 			unsigned int changed_flags,
@@ -944,6 +950,7 @@ static const struct ieee80211_ops brcms_ops = {
 	.remove_interface = brcms_ops_remove_interface,
 	.config = brcms_ops_config,
 	.bss_info_changed = brcms_ops_bss_info_changed,
+	.change_ps = brcms_ops_change_ps,
 	.configure_filter = brcms_ops_configure_filter,
 	.sw_scan_start = brcms_ops_sw_scan_start,
 	.sw_scan_complete = brcms_ops_sw_scan_complete,
drivers/net/wireless/brcm80211/brcmsmac/main.c +10 -7
index 8138f1c..5d4dabb 100644
@@ -3072,10 +3072,13 @@ static void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
  * conditions under which the PM bit should be set in outgoing frames
  * and STAY_AWAKE is meaningful
  */
-static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
+static bool brcms_c_ps_allowed(struct brcms_c_info *wlc,
+			       struct ieee80211_vif *vif)
 {
-	/* not supporting PS so always return false for now */
-	return false;
+	if (!vif)
+		return false;
+	return vif->ps_mode == IEEE80211_VIF_PS_DOZE ||
+	       vif->ps_mode == IEEE80211_VIF_PS_AWAKE_PM;
 }
 
 static void brcms_c_statsupd(struct brcms_c_info *wlc)
@@ -3748,13 +3751,13 @@ brcms_c_duty_cycle_set(struct brcms_c_info *wlc, int duty_cycle, bool isOFDM,
 }
 
 /* push sw hps and wake state through hardware */
-static void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc)
+void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc, struct ieee80211_vif *vif)
 {
 	u32 v1, v2;
 	bool hps;
 	bool awake_before;
 
-	hps = brcms_c_ps_allowed(wlc);
+	hps = brcms_c_ps_allowed(wlc, vif);
 
 	brcms_dbg_mac80211(wlc->hw->d11core, "wl%d: hps %d\n", wlc->pub->unit,
 			   hps);
@@ -3901,7 +3904,7 @@ static void brcms_c_setband(struct brcms_c_info *wlc,
 		return;
 
 	/* wait for at least one beacon before entering sleeping state */
-	brcms_c_set_ps_ctrl(wlc);
+	brcms_c_set_ps_ctrl(wlc, NULL);
 
 	/* band-specific initializations */
 	brcms_c_bsinit(wlc);
@@ -7938,7 +7941,7 @@ void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)
 			     bi << CFPREP_CBI_SHIFT);
 
 		/* Update maccontrol PM related bits */
-		brcms_c_set_ps_ctrl(wlc);
+		brcms_c_set_ps_ctrl(wlc, NULL);
 	}
 
 	brcms_c_bandinit_ordered(wlc, chanspec);
drivers/net/wireless/brcm80211/brcmsmac/main.h +1 -0
index c4d135c..58abbe3 100644
@@ -622,6 +622,7 @@ int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
 
 int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
 void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
+void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc, struct ieee80211_vif *vif);
 u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, uint mac_len);
 u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
 			       bool use_rspec, u16 mimo_ctlchbw);
Signature · 1 line
1.8.3.2
#15 lore raw

RFC PATCH 7/8 b43: Allow HWPS state to be changed

In reply to Seth Forshee

During background scans mac80211 wants to set powersave at the AP so that frames will be buffered while off-channel. In order to do this on Broadcom chips B43_MACCTL_HWPS needs to be set when transmitting the nullfunc frames to enable powersave, however b43_power_saving_ctl_bits() doesn't allow it to be set.

Rework this function a bit to allow setting HWPS. First, initialize the hwps and awake variables based off the macctl register to avoid changing the unintentionally changing the values. It's not really necessary to set awake since it is later forced to true, but it does no harm and might help avoid future problems.

Second, remove the force set of hwps to false. No code currently tries to change the hwps state anyway, so this results in no functional change.

---
 drivers/net/wireless/b43/main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/b43/main.c +5 -3
index ccd24f0a..bc6ba1c 100644
@@ -1117,6 +1117,10 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags)
 		    (ps_flags & B43_PS_DISABLED));
 	B43_WARN_ON((ps_flags & B43_PS_AWAKE) && (ps_flags & B43_PS_ASLEEP));
 
+	macctl = b43_read32(dev, B43_MMIO_MACCTL);
+	hwps = !!(macctl & B43_MACCTL_HWPS);
+	awake = !!(macctl & B43_MACCTL_AWAKE);
+
 	if (ps_flags & B43_PS_ENABLED) {
 		hwps = true;
 	} else if (ps_flags & B43_PS_DISABLED) {
@@ -1135,11 +1139,9 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags)
 		//      successful, set bit26
 	}
 
-/* FIXME: For now we force awake-on and hwps-off */
-	hwps = false;
+/* FIXME: For now we force awake-on */
 	awake = true;
 
-	macctl = b43_read32(dev, B43_MMIO_MACCTL);
 	if (hwps)
 		macctl |= B43_MACCTL_HWPS;
 	else
Signature · 1 line
1.8.3.2
#16 lore raw

RFC PATCH 8/8 b43: Set B43_MACCTL_HWPS when PM should be set

In reply to Seth Forshee

Even though powersave is not supported the HWPS bit still needs to be set in order to transmit nullfunc frames with PM set. Add support for the change_ps callback to set this bit whenever the powersave mode requires PM to be set.

---
 drivers/net/wireless/b43/main.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/net/wireless/b43/main.c +16 -0
index bc6ba1c..d883160 100644
@@ -4030,6 +4030,21 @@ out_unlock_mutex:
 	mutex_unlock(&wl->mutex);
 }
 
+static void b43_op_change_ps(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif)
+{
+	struct b43_wl *wl = hw_to_b43_wl(hw);
+	unsigned int ps_flags;
+
+	if (vif->ps_mode == IEEE80211_VIF_PS_DOZE ||
+	    vif->ps_mode == IEEE80211_VIF_PS_AWAKE_PM)
+		ps_flags = B43_PS_ENABLED;
+	else
+		ps_flags = B43_PS_DISABLED;
+
+	b43_power_saving_ctl_bits(wl->current_dev, ps_flags);
+}
+
 static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 			  struct ieee80211_vif *vif, struct ieee80211_sta *sta,
 			  struct ieee80211_key_conf *key)
@@ -5031,6 +5046,7 @@ static const struct ieee80211_ops b43_hw_ops = {
 	.remove_interface	= b43_op_remove_interface,
 	.config			= b43_op_config,
 	.bss_info_changed	= b43_op_bss_info_changed,
+	.change_ps		= b43_op_change_ps,
 	.configure_filter	= b43_op_configure_filter,
 	.set_key		= b43_op_set_key,
 	.update_tkip_key	= b43_op_update_tkip_key,
Signature · 1 line
1.8.3.2