aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-04-20 12:39:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:17 -0400
commitb9a5f8cab751d362f7c2d94899ca788c22fcd1ef (patch)
treee769e2f59ef845cf7c7cc93b64d33eeed49bb9f7 /include
parent9e52b0623c6eb49c3f23a326c1fb97bdecc49ba1 (diff)
nl80211: Add set/get for frag/rts threshold and retry limits
Add new nl80211 attributes that can be used with NL80211_CMD_SET_WIPHY and NL80211_CMD_GET_WIPHY to manage fragmentation/RTS threshold and retry limits. Since these values are stored in struct wiphy, remove the local copy from mac80211 where feasible (frag & rts threshold). The retry limits are currently needed in struct ieee80211_conf, but these could be eventually removed since the driver should have access to the values in struct wiphy. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h24
-rw-r--r--include/net/cfg80211.h50
2 files changed, 72 insertions, 2 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 25ce3e42bd10..dc9d9ec5d1ae 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -46,8 +46,10 @@
46 * to get a list of all present wiphys. 46 * to get a list of all present wiphys.
47 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or 47 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
48 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, 48 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
49 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or 49 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
50 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. 50 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
51 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
52 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
51 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request 53 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
52 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and 54 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
53 * %NL80211_ATTR_WIPHY_NAME. 55 * %NL80211_ATTR_WIPHY_NAME.
@@ -337,6 +339,18 @@ enum nl80211_commands {
337 * NL80211_CHAN_HT20 = HT20 only 339 * NL80211_CHAN_HT20 = HT20 only
338 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel 340 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
339 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel 341 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
342 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
343 * less than or equal to the RTS threshold; allowed range: 1..255;
344 * dot11ShortRetryLimit; u8
345 * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is
346 * greater than the RTS threshold; allowed range: 1..255;
347 * dot11ShortLongLimit; u8
348 * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum
349 * length in octets for frames; allowed range: 256..8000, disable
350 * fragmentation with (u32)-1; dot11FragmentationThreshold; u32
351 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
352 * larger than or equal to this use RTS/CTS handshake); allowed range:
353 * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32
340 * 354 *
341 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on 355 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
342 * @NL80211_ATTR_IFNAME: network interface name 356 * @NL80211_ATTR_IFNAME: network interface name
@@ -565,6 +579,12 @@ enum nl80211_attrs {
565 579
566 NL80211_ATTR_FREQ_FIXED, 580 NL80211_ATTR_FREQ_FIXED,
567 581
582
583 NL80211_ATTR_WIPHY_RETRY_SHORT,
584 NL80211_ATTR_WIPHY_RETRY_LONG,
585 NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
586 NL80211_ATTR_WIPHY_RTS_THRESHOLD,
587
568 /* add attributes here, update the policy in nl80211.c */ 588 /* add attributes here, update the policy in nl80211.c */
569 589
570 __NL80211_ATTR_AFTER_LAST, 590 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 601eac64b02d..54bc69c83691 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -744,6 +744,20 @@ struct cfg80211_ibss_params {
744}; 744};
745 745
746/** 746/**
747 * enum wiphy_params_flags - set_wiphy_params bitfield values
748 * WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed
749 * WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed
750 * WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed
751 * WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed
752 */
753enum wiphy_params_flags {
754 WIPHY_PARAM_RETRY_SHORT = 1 << 0,
755 WIPHY_PARAM_RETRY_LONG = 1 << 1,
756 WIPHY_PARAM_FRAG_THRESHOLD = 1 << 2,
757 WIPHY_PARAM_RTS_THRESHOLD = 1 << 3,
758};
759
760/**
747 * struct cfg80211_ops - backend description for wireless configuration 761 * struct cfg80211_ops - backend description for wireless configuration
748 * 762 *
749 * This struct is registered by fullmac card drivers and/or wireless stacks 763 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -823,6 +837,11 @@ struct cfg80211_ibss_params {
823 * cfg80211_ibss_joined(), also call that function when changing BSSID due 837 * cfg80211_ibss_joined(), also call that function when changing BSSID due
824 * to a merge. 838 * to a merge.
825 * @leave_ibss: Leave the IBSS. 839 * @leave_ibss: Leave the IBSS.
840 *
841 * @set_wiphy_params: Notify that wiphy parameters have changed;
842 * @changed bitfield (see &enum wiphy_params_flags) describes which values
843 * have changed. The actual parameter values are available in
844 * struct wiphy. If returning an error, no value should be changed.
826 */ 845 */
827struct cfg80211_ops { 846struct cfg80211_ops {
828 int (*suspend)(struct wiphy *wiphy); 847 int (*suspend)(struct wiphy *wiphy);
@@ -912,6 +931,8 @@ struct cfg80211_ops {
912 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev, 931 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev,
913 struct cfg80211_ibss_params *params); 932 struct cfg80211_ibss_params *params);
914 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); 933 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev);
934
935 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed);
915}; 936};
916 937
917/* 938/*
@@ -945,6 +966,11 @@ struct cfg80211_ops {
945 * @signal_type: signal type reported in &struct cfg80211_bss. 966 * @signal_type: signal type reported in &struct cfg80211_bss.
946 * @cipher_suites: supported cipher suites 967 * @cipher_suites: supported cipher suites
947 * @n_cipher_suites: number of supported cipher suites 968 * @n_cipher_suites: number of supported cipher suites
969 * @retry_short: Retry limit for short frames (dot11ShortRetryLimit)
970 * @retry_long: Retry limit for long frames (dot11LongRetryLimit)
971 * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
972 * -1 = fragmentation disabled, only odd values >= 256 used
973 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
948 */ 974 */
949struct wiphy { 975struct wiphy {
950 /* assign these fields before you register the wiphy */ 976 /* assign these fields before you register the wiphy */
@@ -967,6 +993,11 @@ struct wiphy {
967 int n_cipher_suites; 993 int n_cipher_suites;
968 const u32 *cipher_suites; 994 const u32 *cipher_suites;
969 995
996 u8 retry_short;
997 u8 retry_long;
998 u32 frag_threshold;
999 u32 rts_threshold;
1000
970 /* If multiple wiphys are registered and you're handed e.g. 1001 /* If multiple wiphys are registered and you're handed e.g.
971 * a regular netdev with assigned ieee80211_ptr, you won't 1002 * a regular netdev with assigned ieee80211_ptr, you won't
972 * know whether it points to a wiphy your driver has registered 1003 * know whether it points to a wiphy your driver has registered
@@ -1345,6 +1376,25 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,
1345struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy, 1376struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
1346 struct iw_freq *freq); 1377 struct iw_freq *freq);
1347 1378
1379int cfg80211_wext_siwrts(struct net_device *dev,
1380 struct iw_request_info *info,
1381 struct iw_param *rts, char *extra);
1382int cfg80211_wext_giwrts(struct net_device *dev,
1383 struct iw_request_info *info,
1384 struct iw_param *rts, char *extra);
1385int cfg80211_wext_siwfrag(struct net_device *dev,
1386 struct iw_request_info *info,
1387 struct iw_param *frag, char *extra);
1388int cfg80211_wext_giwfrag(struct net_device *dev,
1389 struct iw_request_info *info,
1390 struct iw_param *frag, char *extra);
1391int cfg80211_wext_siwretry(struct net_device *dev,
1392 struct iw_request_info *info,
1393 struct iw_param *retry, char *extra);
1394int cfg80211_wext_giwretry(struct net_device *dev,
1395 struct iw_request_info *info,
1396 struct iw_param *retry, char *extra);
1397
1348/* 1398/*
1349 * callbacks for asynchronous cfg80211 methods, notification 1399 * callbacks for asynchronous cfg80211 methods, notification
1350 * functions and BSS handling helpers 1400 * functions and BSS handling helpers