aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-12-18 20:03:34 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:59:51 -0500
commit5727ef1b2e797a1922f5bc239b6afb2b4cfb80bc (patch)
tree16fb0c8afcb1c5282fcc45ffa90c8e34b0daa6d4 /include
parented1b6cc7f80f831e192704b05b9917f9cc37be15 (diff)
cfg80211/nl80211: station handling
This patch adds station handling to cfg80211/nl80211. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h68
-rw-r--r--include/net/cfg80211.h55
2 files changed, 123 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index f1e455a8b4de..85e2d7d1f9e3 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -7,6 +7,18 @@
7 */ 7 */
8 8
9/** 9/**
10 * DOC: Station handling
11 *
12 * Stations are added per interface, but a special case exists with VLAN
13 * interfaces. When a station is bound to an AP interface, it may be moved
14 * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
15 * The station is still assumed to belong to the AP interface it was added
16 * to.
17 *
18 * TODO: need more info?
19 */
20
21/**
10 * enum nl80211_commands - supported nl80211 commands 22 * enum nl80211_commands - supported nl80211 commands
11 * 23 *
12 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 24 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -56,6 +68,16 @@
56 * parameters are like for %NL80211_CMD_SET_BEACON. 68 * parameters are like for %NL80211_CMD_SET_BEACON.
57 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it 69 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
58 * 70 *
71 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
72 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
73 * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
74 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
75 * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
76 * the interface identified by %NL80211_ATTR_IFINDEX.
77 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
78 * or, if no MAC address given, all stations, on the interface identified
79 * by %NL80211_ATTR_IFINDEX.
80 *
59 * @NL80211_CMD_MAX: highest used command number 81 * @NL80211_CMD_MAX: highest used command number
60 * @__NL80211_CMD_AFTER_LAST: internal use 82 * @__NL80211_CMD_AFTER_LAST: internal use
61 */ 83 */
@@ -83,6 +105,11 @@ enum nl80211_commands {
83 NL80211_CMD_NEW_BEACON, 105 NL80211_CMD_NEW_BEACON,
84 NL80211_CMD_DEL_BEACON, 106 NL80211_CMD_DEL_BEACON,
85 107
108 NL80211_CMD_GET_STATION,
109 NL80211_CMD_SET_STATION,
110 NL80211_CMD_NEW_STATION,
111 NL80211_CMD_DEL_STATION,
112
86 /* add commands here */ 113 /* add commands here */
87 114
88 /* used to define NL80211_CMD_MAX below */ 115 /* used to define NL80211_CMD_MAX below */
@@ -120,6 +147,17 @@ enum nl80211_commands {
120 * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE 147 * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
121 * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE 148 * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
122 * 149 *
150 * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
151 * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
152 * &enum nl80211_sta_flags.
153 * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
154 * IEEE 802.11 7.3.1.6 (u16).
155 * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
156 * rates as defined by IEEE 802.11 7.3.2.2 but without the length
157 * restriction (at most %NL80211_MAX_SUPP_RATES).
158 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
159 * to, or the AP interface the station was originally added to to.
160 *
123 * @NL80211_ATTR_MAX: highest attribute number currently defined 161 * @NL80211_ATTR_MAX: highest attribute number currently defined
124 * @__NL80211_ATTR_AFTER_LAST: internal use 162 * @__NL80211_ATTR_AFTER_LAST: internal use
125 */ 163 */
@@ -147,12 +185,20 @@ enum nl80211_attrs {
147 NL80211_ATTR_BEACON_HEAD, 185 NL80211_ATTR_BEACON_HEAD,
148 NL80211_ATTR_BEACON_TAIL, 186 NL80211_ATTR_BEACON_TAIL,
149 187
188 NL80211_ATTR_STA_AID,
189 NL80211_ATTR_STA_FLAGS,
190 NL80211_ATTR_STA_LISTEN_INTERVAL,
191 NL80211_ATTR_STA_SUPPORTED_RATES,
192 NL80211_ATTR_STA_VLAN,
193
150 /* add attributes here, update the policy in nl80211.c */ 194 /* add attributes here, update the policy in nl80211.c */
151 195
152 __NL80211_ATTR_AFTER_LAST, 196 __NL80211_ATTR_AFTER_LAST,
153 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 197 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
154}; 198};
155 199
200#define NL80211_MAX_SUPP_RATES 32
201
156/** 202/**
157 * enum nl80211_iftype - (virtual) interface types 203 * enum nl80211_iftype - (virtual) interface types
158 * 204 *
@@ -184,4 +230,26 @@ enum nl80211_iftype {
184 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 230 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
185}; 231};
186 232
233/**
234 * enum nl80211_sta_flags - station flags
235 *
236 * Station flags. When a station is added to an AP interface, it is
237 * assumed to be already associated (and hence authenticated.)
238 *
239 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
240 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
241 * with short barker preamble
242 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
243 */
244enum nl80211_sta_flags {
245 __NL80211_STA_FLAG_INVALID,
246 NL80211_STA_FLAG_AUTHORIZED,
247 NL80211_STA_FLAG_SHORT_PREAMBLE,
248 NL80211_STA_FLAG_WME,
249
250 /* keep last */
251 __NL80211_STA_FLAG_AFTER_LAST,
252 NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
253};
254
187#endif /* __LINUX_NL80211_H */ 255#endif /* __LINUX_NL80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index fc94852e967b..df650935e268 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -89,6 +89,47 @@ struct beacon_parameters {
89 int head_len, tail_len; 89 int head_len, tail_len;
90}; 90};
91 91
92/**
93 * enum station_flags - station flags
94 *
95 * Station capability flags. Note that these must be the bits
96 * according to the nl80211 flags.
97 *
98 * @STATION_FLAG_CHANGED: station flags were changed
99 * @STATION_FLAG_AUTHORIZED: station is authorized to send frames (802.1X)
100 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
101 * with short preambles
102 * @STATION_FLAG_WME: station is WME/QoS capable
103 */
104enum station_flags {
105 STATION_FLAG_CHANGED = 1<<0,
106 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED,
107 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE,
108 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME,
109};
110
111/**
112 * struct station_parameters - station parameters
113 *
114 * Used to change and create a new station.
115 *
116 * @vlan: vlan interface station should belong to
117 * @supported_rates: supported rates in IEEE 802.11 format
118 * (or NULL for no change)
119 * @supported_rates_len: number of supported rates
120 * @station_flags: station flags (see &enum station_flags)
121 * @listen_interval: listen interval or -1 for no change
122 * @aid: AID or zero for no change
123 */
124struct station_parameters {
125 u8 *supported_rates;
126 struct net_device *vlan;
127 u32 station_flags;
128 int listen_interval;
129 u16 aid;
130 u8 supported_rates_len;
131};
132
92/* from net/wireless.h */ 133/* from net/wireless.h */
93struct wiphy; 134struct wiphy;
94 135
@@ -130,6 +171,12 @@ struct wiphy;
130 * interface. This should reject the call when no beacon has been 171 * interface. This should reject the call when no beacon has been
131 * configured. 172 * configured.
132 * @del_beacon: Remove beacon configuration and stop sending the beacon. 173 * @del_beacon: Remove beacon configuration and stop sending the beacon.
174 *
175 * @add_station: Add a new station.
176 *
177 * @del_station: Remove a station; @mac may be NULL to remove all stations.
178 *
179 * @change_station: Modify a given station.
133 */ 180 */
134struct cfg80211_ops { 181struct cfg80211_ops {
135 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 182 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
@@ -155,6 +202,14 @@ struct cfg80211_ops {
155 int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev, 202 int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev,
156 struct beacon_parameters *info); 203 struct beacon_parameters *info);
157 int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev); 204 int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev);
205
206
207 int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
208 u8 *mac, struct station_parameters *params);
209 int (*del_station)(struct wiphy *wiphy, struct net_device *dev,
210 u8 *mac);
211 int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
212 u8 *mac, struct station_parameters *params);
158}; 213};
159 214
160#endif /* __NET_CFG80211_H */ 215#endif /* __NET_CFG80211_H */