aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2010-02-17 10:58:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-19 15:52:40 -0500
commitffb9eb3d8b450c22bbbc688c6b630141ac476fd9 (patch)
tree0e9677ea9df5b86fedf814236bf049a0f0435f6a /include
parent088ea189c4c75cdf211146faa4b341a0f7476be6 (diff)
nl80211: add power save commands
The most needed command from nl80211, which Wireless Extensions had, is support for power save mode. Add a simple command to make it possible to enable and disable power save via nl80211. I was also planning about extending the interface, for example adding the timeout value, but after thinking more about this I decided not to do it. Basically there were three reasons: Firstly, the parameters for power save are very much hardware dependent. Trying to find a unified interface which would work with all hardware, and still make sense to users, will be very difficult. Secondly, IEEE 802.11 power save implementation in Linux is still in state of flux. We have a long way to still to go and there is no way to predict what kind of implementation we will have after few years. And because we need to support nl80211 interface a long time, practically forever, adding now parameters to nl80211 might create maintenance problems later on. Third issue are the users. Power save parameters are mostly used for debugging, so debugfs is better, more flexible, interface for this. For example, wpa_supplicant currently doesn't configure anything related to power save mode. It's better to strive that kernel can automatically optimise the power save parameters, like with help of pm qos network and other traffic parameters. Later on, when we have better understanding of power save, we can extend this command with more features, if there's a need for that. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h10
-rw-r--r--include/net/cfg80211.h7
2 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 8e6384f8fda6..28ba20fda3e2 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -416,6 +416,9 @@ enum nl80211_commands {
416 NL80211_CMD_ACTION, 416 NL80211_CMD_ACTION,
417 NL80211_CMD_ACTION_TX_STATUS, 417 NL80211_CMD_ACTION_TX_STATUS,
418 418
419 NL80211_CMD_SET_POWER_SAVE,
420 NL80211_CMD_GET_POWER_SAVE,
421
419 /* add new commands above here */ 422 /* add new commands above here */
420 423
421 /* used to define NL80211_CMD_MAX below */ 424 /* used to define NL80211_CMD_MAX below */
@@ -837,6 +840,8 @@ enum nl80211_attrs {
837 840
838 NL80211_ATTR_ACK, 841 NL80211_ATTR_ACK,
839 842
843 NL80211_ATTR_PS_STATE,
844
840 /* add attributes here, update the policy in nl80211.c */ 845 /* add attributes here, update the policy in nl80211.c */
841 846
842 __NL80211_ATTR_AFTER_LAST, 847 __NL80211_ATTR_AFTER_LAST,
@@ -1573,4 +1578,9 @@ enum nl80211_band {
1573 NL80211_BAND_5GHZ, 1578 NL80211_BAND_5GHZ,
1574}; 1579};
1575 1580
1581enum nl80211_ps_state {
1582 NL80211_PS_DISABLED,
1583 NL80211_PS_ENABLED,
1584};
1585
1576#endif /* __LINUX_NL80211_H */ 1586#endif /* __LINUX_NL80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7188934b64d3..3d134a1fb96b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1150,7 +1150,6 @@ struct cfg80211_ops {
1150 enum nl80211_channel_type channel_type, 1150 enum nl80211_channel_type channel_type,
1151 const u8 *buf, size_t len, u64 *cookie); 1151 const u8 *buf, size_t len, u64 *cookie);
1152 1152
1153 /* some temporary stuff to finish wext */
1154 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1153 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1155 bool enabled, int timeout); 1154 bool enabled, int timeout);
1156}; 1155};
@@ -1489,6 +1488,9 @@ struct wireless_dev {
1489 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; 1488 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1490 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 1489 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1491 1490
1491 bool ps;
1492 int ps_timeout;
1493
1492#ifdef CONFIG_CFG80211_WEXT 1494#ifdef CONFIG_CFG80211_WEXT
1493 /* wext data */ 1495 /* wext data */
1494 struct { 1496 struct {
@@ -1500,8 +1502,7 @@ struct wireless_dev {
1500 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 1502 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
1501 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1503 u8 ssid[IEEE80211_MAX_SSID_LEN];
1502 s8 default_key, default_mgmt_key; 1504 s8 default_key, default_mgmt_key;
1503 bool ps, prev_bssid_valid; 1505 bool prev_bssid_valid;
1504 int ps_timeout;
1505 } wext; 1506 } wext;
1506#endif 1507#endif
1507}; 1508};