diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-02 07:01:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-03 14:06:14 -0400 |
commit | 7643a2c3fcc13cd6fbd731f214463547383418ae (patch) | |
tree | e2e41315f0d38a8627456303820b5c1c2a9b54a6 /include/net/cfg80211.h | |
parent | c64fb01627e24725d1f9d535e4426475a4415753 (diff) |
cfg80211: move txpower wext from mac80211
This patch introduces new cfg80211 API to set the TX power
via cfg80211, puts the wext code into cfg80211 and updates
mac80211 to use all that. The -ENETDOWN bits are a hack but
will go away soon.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f20da7d63b1e..8b8e4b893625 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -752,6 +752,21 @@ enum wiphy_params_flags { | |||
752 | }; | 752 | }; |
753 | 753 | ||
754 | /** | 754 | /** |
755 | * enum tx_power_setting - TX power adjustment | ||
756 | * | ||
757 | * @TX_POWER_AUTOMATIC: the dbm parameter is ignored | ||
758 | * @TX_POWER_LIMITED: limit TX power by the dbm parameter | ||
759 | * @TX_POWER_FIXED: fix TX power to the dbm parameter | ||
760 | * @TX_POWER_OFF: turn off completely (will go away) | ||
761 | */ | ||
762 | enum tx_power_setting { | ||
763 | TX_POWER_AUTOMATIC, | ||
764 | TX_POWER_LIMITED, | ||
765 | TX_POWER_FIXED, | ||
766 | TX_POWER_OFF, | ||
767 | }; | ||
768 | |||
769 | /** | ||
755 | * struct cfg80211_ops - backend description for wireless configuration | 770 | * struct cfg80211_ops - backend description for wireless configuration |
756 | * | 771 | * |
757 | * This struct is registered by fullmac card drivers and/or wireless stacks | 772 | * This struct is registered by fullmac card drivers and/or wireless stacks |
@@ -837,6 +852,11 @@ enum wiphy_params_flags { | |||
837 | * @changed bitfield (see &enum wiphy_params_flags) describes which values | 852 | * @changed bitfield (see &enum wiphy_params_flags) describes which values |
838 | * have changed. The actual parameter values are available in | 853 | * have changed. The actual parameter values are available in |
839 | * struct wiphy. If returning an error, no value should be changed. | 854 | * struct wiphy. If returning an error, no value should be changed. |
855 | * | ||
856 | * @set_tx_power: set the transmit power according to the parameters | ||
857 | * @get_tx_power: store the current TX power into the dbm variable; | ||
858 | * return 0 if successful; or -ENETDOWN if successful but power | ||
859 | * is disabled (this will go away) | ||
840 | */ | 860 | */ |
841 | struct cfg80211_ops { | 861 | struct cfg80211_ops { |
842 | int (*suspend)(struct wiphy *wiphy); | 862 | int (*suspend)(struct wiphy *wiphy); |
@@ -928,6 +948,10 @@ struct cfg80211_ops { | |||
928 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | 948 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); |
929 | 949 | ||
930 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 950 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
951 | |||
952 | int (*set_tx_power)(struct wiphy *wiphy, | ||
953 | enum tx_power_setting type, int dbm); | ||
954 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | ||
931 | }; | 955 | }; |
932 | 956 | ||
933 | /* | 957 | /* |
@@ -1451,6 +1475,12 @@ int cfg80211_wext_siwencode(struct net_device *dev, | |||
1451 | int cfg80211_wext_giwencode(struct net_device *dev, | 1475 | int cfg80211_wext_giwencode(struct net_device *dev, |
1452 | struct iw_request_info *info, | 1476 | struct iw_request_info *info, |
1453 | struct iw_point *erq, char *keybuf); | 1477 | struct iw_point *erq, char *keybuf); |
1478 | int cfg80211_wext_siwtxpower(struct net_device *dev, | ||
1479 | struct iw_request_info *info, | ||
1480 | union iwreq_data *data, char *keybuf); | ||
1481 | int cfg80211_wext_giwtxpower(struct net_device *dev, | ||
1482 | struct iw_request_info *info, | ||
1483 | union iwreq_data *data, char *keybuf); | ||
1454 | 1484 | ||
1455 | /* | 1485 | /* |
1456 | * callbacks for asynchronous cfg80211 methods, notification | 1486 | * callbacks for asynchronous cfg80211 methods, notification |