1 #ifndef __NET_CFG80211_H
2 #define __NET_CFG80211_H
4 #include <linux/netlink.h>
5 #include <linux/skbuff.h>
6 #include <linux/nl80211.h>
7 #include <net/genetlink.h>
10 * 802.11 configuration in-kernel interface
12 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
15 /* Radiotap header iteration
16 * implemented in net/wireless/radiotap.c
17 * docs in Documentation/networking/radiotap-headers.txt
20 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
21 * @rtheader: pointer to the radiotap header we are walking through
22 * @max_length: length of radiotap header in cpu byte ordering
23 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
24 * @this_arg: pointer to current radiotap arg
25 * @arg_index: internal next argument index
26 * @arg: internal next argument pointer
27 * @next_bitmap: internal pointer to next present u32
28 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
31 struct ieee80211_radiotap_iterator
{
32 struct ieee80211_radiotap_header
*rtheader
;
43 extern int ieee80211_radiotap_iterator_init(
44 struct ieee80211_radiotap_iterator
*iterator
,
45 struct ieee80211_radiotap_header
*radiotap_header
,
48 extern int ieee80211_radiotap_iterator_next(
49 struct ieee80211_radiotap_iterator
*iterator
);
53 * struct key_params - key information
55 * Information about a key
58 * @key_len: length of key material
59 * @cipher: cipher suite selector
60 * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used
61 * with the get_key() callback, must be in little endian,
62 * length given by @seq_len.
73 * struct beacon_parameters - beacon parameters
75 * Used to configure the beacon for an interface.
77 * @head: head portion of beacon (before TIM IE)
78 * or %NULL if not changed
79 * @tail: tail portion of beacon (after TIM IE)
80 * or %NULL if not changed
81 * @interval: beacon interval or zero if not changed
82 * @dtim_period: DTIM period or zero if not changed
83 * @head_len: length of @head
84 * @tail_len: length of @tail
86 struct beacon_parameters
{
88 int interval
, dtim_period
;
89 int head_len
, tail_len
;
93 * enum station_flags - station flags
95 * Station capability flags. Note that these must be the bits
96 * according to the nl80211 flags.
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
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
,
112 * struct station_parameters - station parameters
114 * Used to change and create a new station.
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
124 struct station_parameters
{
126 struct net_device
*vlan
;
130 u8 supported_rates_len
;
133 /* from net/wireless.h */
137 * struct cfg80211_ops - backend description for wireless configuration
139 * This struct is registered by fullmac card drivers and/or wireless stacks
140 * in order to handle configuration requests on their interfaces.
142 * All callbacks except where otherwise noted should return 0
143 * on success or a negative error code.
145 * All operations are currently invoked under rtnl for consistency with the
146 * wireless extensions but this is subject to reevaluation as soon as this
147 * code is used more widely and we have a first user without wext.
149 * @add_virtual_intf: create a new virtual interface with the given name
151 * @del_virtual_intf: remove the virtual interface determined by ifindex.
153 * @change_virtual_intf: change type of virtual interface
155 * @add_key: add a key with the given parameters. @mac_addr will be %NULL
156 * when adding a group key.
158 * @get_key: get information about the key with the given parameters.
159 * @mac_addr will be %NULL when requesting information for a group
160 * key. All pointers given to the @callback function need not be valid
163 * @del_key: remove a key given the @mac_addr (%NULL for a group key)
166 * @set_default_key: set the default key on an interface
168 * @add_beacon: Add a beacon with given parameters, @head, @interval
169 * and @dtim_period will be valid, @tail is optional.
170 * @set_beacon: Change the beacon parameters for an access point mode
171 * interface. This should reject the call when no beacon has been
173 * @del_beacon: Remove beacon configuration and stop sending the beacon.
175 * @add_station: Add a new station.
177 * @del_station: Remove a station; @mac may be NULL to remove all stations.
179 * @change_station: Modify a given station.
181 struct cfg80211_ops
{
182 int (*add_virtual_intf
)(struct wiphy
*wiphy
, char *name
,
183 enum nl80211_iftype type
);
184 int (*del_virtual_intf
)(struct wiphy
*wiphy
, int ifindex
);
185 int (*change_virtual_intf
)(struct wiphy
*wiphy
, int ifindex
,
186 enum nl80211_iftype type
);
188 int (*add_key
)(struct wiphy
*wiphy
, struct net_device
*netdev
,
189 u8 key_index
, u8
*mac_addr
,
190 struct key_params
*params
);
191 int (*get_key
)(struct wiphy
*wiphy
, struct net_device
*netdev
,
192 u8 key_index
, u8
*mac_addr
, void *cookie
,
193 void (*callback
)(void *cookie
, struct key_params
*));
194 int (*del_key
)(struct wiphy
*wiphy
, struct net_device
*netdev
,
195 u8 key_index
, u8
*mac_addr
);
196 int (*set_default_key
)(struct wiphy
*wiphy
,
197 struct net_device
*netdev
,
200 int (*add_beacon
)(struct wiphy
*wiphy
, struct net_device
*dev
,
201 struct beacon_parameters
*info
);
202 int (*set_beacon
)(struct wiphy
*wiphy
, struct net_device
*dev
,
203 struct beacon_parameters
*info
);
204 int (*del_beacon
)(struct wiphy
*wiphy
, struct net_device
*dev
);
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
,
211 int (*change_station
)(struct wiphy
*wiphy
, struct net_device
*dev
,
212 u8
*mac
, struct station_parameters
*params
);
215 #endif /* __NET_CFG80211_H */