aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-07-18 01:53:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-04 15:09:07 -0400
commitea95bba41e69c616bb1512cf59d22f33266b8568 (patch)
treefe3d17351465189b041bf20c0c9f6c4835d63997
parent98f7dfd86cbbd377e2cbc293529681b914296f68 (diff)
mac80211: make listen_interval be limited by low level driver
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/mac80211.h9
-rw-r--r--net/mac80211/main.c5
-rw-r--r--net/mac80211/mlme.c6
3 files changed, 17 insertions, 3 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9d99f2e0a204..b397e4d984c7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -432,6 +432,7 @@ enum ieee80211_conf_flags {
432 * @radio_enabled: when zero, driver is required to switch off the radio. 432 * @radio_enabled: when zero, driver is required to switch off the radio.
433 * TODO make a flag 433 * TODO make a flag
434 * @beacon_int: beacon interval (TODO make interface config) 434 * @beacon_int: beacon interval (TODO make interface config)
435 * @listen_interval: listen interval in units of beacon interval
435 * @flags: configuration flags defined above 436 * @flags: configuration flags defined above
436 * @power_level: requested transmit power (in dBm) 437 * @power_level: requested transmit power (in dBm)
437 * @max_antenna_gain: maximum antenna gain (in dBi) 438 * @max_antenna_gain: maximum antenna gain (in dBi)
@@ -446,6 +447,7 @@ struct ieee80211_conf {
446 int radio_enabled; 447 int radio_enabled;
447 448
448 int beacon_int; 449 int beacon_int;
450 u16 listen_interval;
449 u32 flags; 451 u32 flags;
450 int power_level; 452 int power_level;
451 int max_antenna_gain; 453 int max_antenna_gain;
@@ -787,6 +789,9 @@ enum ieee80211_hw_flags {
787 * @max_signal: Maximum value for signal (rssi) in RX information, used 789 * @max_signal: Maximum value for signal (rssi) in RX information, used
788 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 790 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
789 * 791 *
792 * @max_listen_interval: max listen interval in units of beacon interval
793 * that HW supports
794 *
790 * @queues: number of available hardware transmit queues for 795 * @queues: number of available hardware transmit queues for
791 * data packets. WMM/QoS requires at least four, these 796 * data packets. WMM/QoS requires at least four, these
792 * queues need to have configurable access parameters. 797 * queues need to have configurable access parameters.
@@ -814,7 +819,9 @@ struct ieee80211_hw {
814 unsigned int extra_tx_headroom; 819 unsigned int extra_tx_headroom;
815 int channel_change_time; 820 int channel_change_time;
816 int vif_data_size; 821 int vif_data_size;
817 u16 queues, ampdu_queues; 822 u16 queues;
823 u16 ampdu_queues;
824 u16 max_listen_interval;
818 s8 max_signal; 825 s8 max_signal;
819}; 826};
820 827
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index a4c5b90de769..0c02c471bca2 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1689,6 +1689,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1689 if (local->hw.conf.beacon_int < 10) 1689 if (local->hw.conf.beacon_int < 10)
1690 local->hw.conf.beacon_int = 100; 1690 local->hw.conf.beacon_int = 100;
1691 1691
1692 if (local->hw.max_listen_interval == 0)
1693 local->hw.max_listen_interval = 1;
1694
1695 local->hw.conf.listen_interval = local->hw.max_listen_interval;
1696
1692 local->wstats_flags |= local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC | 1697 local->wstats_flags |= local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC |
1693 IEEE80211_HW_SIGNAL_DB | 1698 IEEE80211_HW_SIGNAL_DB |
1694 IEEE80211_HW_SIGNAL_DBM) ? 1699 IEEE80211_HW_SIGNAL_DBM) ?
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 591e6331c427..779affd8b8fe 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -774,7 +774,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
774 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 774 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT,
775 IEEE80211_STYPE_REASSOC_REQ); 775 IEEE80211_STYPE_REASSOC_REQ);
776 mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); 776 mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab);
777 mgmt->u.reassoc_req.listen_interval = cpu_to_le16(1); 777 mgmt->u.reassoc_req.listen_interval =
778 cpu_to_le16(local->hw.conf.listen_interval);
778 memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid, 779 memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid,
779 ETH_ALEN); 780 ETH_ALEN);
780 } else { 781 } else {
@@ -782,7 +783,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
782 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 783 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT,
783 IEEE80211_STYPE_ASSOC_REQ); 784 IEEE80211_STYPE_ASSOC_REQ);
784 mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); 785 mgmt->u.assoc_req.capab_info = cpu_to_le16(capab);
785 mgmt->u.assoc_req.listen_interval = cpu_to_le16(1); 786 mgmt->u.reassoc_req.listen_interval =
787 cpu_to_le16(local->hw.conf.listen_interval);
786 } 788 }
787 789
788 /* SSID */ 790 /* SSID */