Linux wireless drivers development
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Tomas Winkler <tomas.winkler@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 04/13] mac80211: make listen_interval be limited by low level driver
Date: Fri, 18 Jul 2008 13:53:00 +0800	[thread overview]
Message-ID: <1216360389-5352-5-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1216360389-5352-4-git-send-email-yi.zhu@intel.com>

From: Tomas Winkler <tomas.winkler@intel.com>

This patch makes possible for a driver to specify maximal listen interval
The possibility for user to configure listen interval is not implemented
yet, currently the maximum provided by the driver or 1 is used.
Mac80211 uses config handler to set listen interval for to the driver.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 include/net/mac80211.h |    9 ++++++++-
 net/mac80211/main.c    |    5 +++++
 net/mac80211/mlme.c    |    6 ++++--
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e0e4cd9..612634f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -438,6 +438,7 @@ enum ieee80211_conf_flags {
  * @radio_enabled: when zero, driver is required to switch off the radio.
  *	TODO make a flag
  * @beacon_int: beacon interval (TODO make interface config)
+ * @listen_interval: listen interval in units of beacon interval
  * @flags: configuration flags defined above
  * @power_level: requested transmit power (in dBm)
  * @max_antenna_gain: maximum antenna gain (in dBi)
@@ -452,6 +453,7 @@ struct ieee80211_conf {
 	int radio_enabled;
 
 	int beacon_int;
+	u16 listen_interval;
 	u32 flags;
 	int power_level;
 	int max_antenna_gain;
@@ -794,6 +796,9 @@ enum ieee80211_hw_flags {
  * @max_signal: Maximum value for signal (rssi) in RX information, used
  *     only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
  *
+ * @max_listen_interval: max listen interval in units of beacon interval
+ *     that HW supports
+ *
  * @queues: number of available hardware transmit queues for
  *	data packets. WMM/QoS requires at least four, these
  *	queues need to have configurable access parameters.
@@ -821,7 +826,9 @@ struct ieee80211_hw {
 	unsigned int extra_tx_headroom;
 	int channel_change_time;
 	int vif_data_size;
-	u16 queues, ampdu_queues;
+	u16 queues;
+	u16 ampdu_queues;
+	u16 max_listen_interval;
 	s8 max_signal;
 };
 
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 10533bf..6fa2336 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1712,6 +1712,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 	if (local->hw.conf.beacon_int < 10)
 		local->hw.conf.beacon_int = 100;
 
+	if (local->hw.max_listen_interval == 0)
+		local->hw.max_listen_interval = 1;
+
+	local->hw.conf.listen_interval = local->hw.max_listen_interval;
+
 	local->wstats_flags |= local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC |
 						  IEEE80211_HW_SIGNAL_DB |
 						  IEEE80211_HW_SIGNAL_DBM) ?
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 8925b0e..1dabfba 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -778,7 +778,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
 		mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT,
 						   IEEE80211_STYPE_REASSOC_REQ);
 		mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab);
-		mgmt->u.reassoc_req.listen_interval = cpu_to_le16(1);
+		mgmt->u.reassoc_req.listen_interval =
+				cpu_to_le16(local->hw.conf.listen_interval);
 		memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid,
 		       ETH_ALEN);
 	} else {
@@ -786,7 +787,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
 		mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT,
 						   IEEE80211_STYPE_ASSOC_REQ);
 		mgmt->u.assoc_req.capab_info = cpu_to_le16(capab);
-		mgmt->u.assoc_req.listen_interval = cpu_to_le16(1);
+		mgmt->u.reassoc_req.listen_interval =
+				cpu_to_le16(local->hw.conf.listen_interval);
 	}
 
 	/* SSID */
-- 
1.5.3.6


  reply	other threads:[~2008-07-18  5:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18  5:52 [PATCH 00/13] iwlwifi driver 07/18 updates Zhu Yi
2008-07-18  5:52 ` [PATCH 01/13] iwlwifi: add power save to 5000 HW Zhu Yi
2008-07-18  5:52   ` [PATCH 02/13] iwlwifi: corrects power_level in sysfs Zhu Yi
2008-07-18  5:52     ` [PATCH 03/13] mac80211: pass dtim_period to low level driver Zhu Yi
2008-07-18  5:53       ` Zhu Yi [this message]
2008-07-18  5:53         ` [PATCH 05/13] iwlwifi: use dtim_period from association, and set listen_interval Zhu Yi
2008-07-18  5:53           ` [PATCH 06/13] iwlwifi: move iwl4965_mac_ampdu_action to iwl4965-base.c Zhu Yi
2008-07-18  5:53             ` [PATCH 07/13] iwlwifi: move beacon handling " Zhu Yi
2008-07-18  5:53               ` [PATCH 08/13] iwlwifi: move iwl4965_set_pwr_src " Zhu Yi
2008-07-18  5:53                 ` [PATCH 09/13] iwlwifi: rename iwl-4695-rs to iwl-agn-rs Zhu Yi
2008-07-18  5:53                   ` [PATCH 10/13] iwlwifi: kill iwl4965_fill_rs_info Zhu Yi
2008-07-18  5:53                     ` [PATCH 11/13] iwlwifi: set led register in disassociation Zhu Yi
2008-07-18  5:53                       ` [PATCH 12/13] mac80211: remove unused variable agg_queue Zhu Yi
2008-07-18  5:53                         ` [PATCH 13/13] iwlwifi: bug fix in AGG flow - cast const to ULL Zhu Yi
2008-07-18  8:23           ` [PATCH 05/13] iwlwifi: use dtim_period from association, and set listen_interval Johannes Berg
2008-07-18  8:53             ` Tomas Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1216360389-5352-5-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomas.winkler@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox