Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 1 | #ifndef __NET_CFG80211_H |
| 2 | #define __NET_CFG80211_H |
| 3 | |
| 4 | #include <linux/netlink.h> |
| 5 | #include <linux/skbuff.h> |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 6 | #include <linux/nl80211.h> |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 7 | #include <linux/if_ether.h> |
| 8 | #include <linux/ieee80211.h> |
| 9 | #include <linux/wireless.h> |
| 10 | #include <net/iw_handler.h> |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 11 | #include <net/genetlink.h> |
Johannes Berg | fee5267 | 2008-11-26 22:36:31 +0100 | [diff] [blame] | 12 | /* remove once we remove the wext stuff */ |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 13 | |
| 14 | /* |
| 15 | * 802.11 configuration in-kernel interface |
| 16 | * |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 17 | * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net> |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 18 | */ |
| 19 | |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 20 | /** |
| 21 | * struct vif_params - describes virtual interface parameters |
| 22 | * @mesh_id: mesh ID to use |
| 23 | * @mesh_id_len: length of the mesh ID |
| 24 | */ |
| 25 | struct vif_params { |
| 26 | u8 *mesh_id; |
| 27 | int mesh_id_len; |
| 28 | }; |
| 29 | |
Andy Green | 179f831 | 2007-07-10 19:29:38 +0200 | [diff] [blame] | 30 | /* Radiotap header iteration |
| 31 | * implemented in net/wireless/radiotap.c |
| 32 | * docs in Documentation/networking/radiotap-headers.txt |
| 33 | */ |
| 34 | /** |
| 35 | * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args |
| 36 | * @rtheader: pointer to the radiotap header we are walking through |
| 37 | * @max_length: length of radiotap header in cpu byte ordering |
| 38 | * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg |
| 39 | * @this_arg: pointer to current radiotap arg |
| 40 | * @arg_index: internal next argument index |
| 41 | * @arg: internal next argument pointer |
| 42 | * @next_bitmap: internal pointer to next present u32 |
| 43 | * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present |
| 44 | */ |
| 45 | |
| 46 | struct ieee80211_radiotap_iterator { |
| 47 | struct ieee80211_radiotap_header *rtheader; |
| 48 | int max_length; |
| 49 | int this_arg_index; |
| 50 | u8 *this_arg; |
| 51 | |
| 52 | int arg_index; |
| 53 | u8 *arg; |
| 54 | __le32 *next_bitmap; |
| 55 | u32 bitmap_shifter; |
| 56 | }; |
| 57 | |
| 58 | extern int ieee80211_radiotap_iterator_init( |
| 59 | struct ieee80211_radiotap_iterator *iterator, |
| 60 | struct ieee80211_radiotap_header *radiotap_header, |
| 61 | int max_length); |
| 62 | |
| 63 | extern int ieee80211_radiotap_iterator_next( |
| 64 | struct ieee80211_radiotap_iterator *iterator); |
| 65 | |
| 66 | |
Johannes Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 67 | /** |
| 68 | * struct key_params - key information |
| 69 | * |
| 70 | * Information about a key |
| 71 | * |
| 72 | * @key: key material |
| 73 | * @key_len: length of key material |
| 74 | * @cipher: cipher suite selector |
| 75 | * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used |
| 76 | * with the get_key() callback, must be in little endian, |
| 77 | * length given by @seq_len. |
| 78 | */ |
| 79 | struct key_params { |
| 80 | u8 *key; |
| 81 | u8 *seq; |
| 82 | int key_len; |
| 83 | int seq_len; |
| 84 | u32 cipher; |
| 85 | }; |
| 86 | |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 87 | /** |
| 88 | * struct beacon_parameters - beacon parameters |
| 89 | * |
| 90 | * Used to configure the beacon for an interface. |
| 91 | * |
| 92 | * @head: head portion of beacon (before TIM IE) |
| 93 | * or %NULL if not changed |
| 94 | * @tail: tail portion of beacon (after TIM IE) |
| 95 | * or %NULL if not changed |
| 96 | * @interval: beacon interval or zero if not changed |
| 97 | * @dtim_period: DTIM period or zero if not changed |
| 98 | * @head_len: length of @head |
| 99 | * @tail_len: length of @tail |
| 100 | */ |
| 101 | struct beacon_parameters { |
| 102 | u8 *head, *tail; |
| 103 | int interval, dtim_period; |
| 104 | int head_len, tail_len; |
| 105 | }; |
| 106 | |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 107 | /** |
| 108 | * enum station_flags - station flags |
| 109 | * |
| 110 | * Station capability flags. Note that these must be the bits |
| 111 | * according to the nl80211 flags. |
| 112 | * |
| 113 | * @STATION_FLAG_CHANGED: station flags were changed |
| 114 | * @STATION_FLAG_AUTHORIZED: station is authorized to send frames (802.1X) |
| 115 | * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames |
| 116 | * with short preambles |
| 117 | * @STATION_FLAG_WME: station is WME/QoS capable |
Jouni Malinen | 5394af4 | 2009-01-08 13:31:59 +0200 | [diff] [blame] | 118 | * @STATION_FLAG_MFP: station uses management frame protection |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 119 | */ |
| 120 | enum station_flags { |
| 121 | STATION_FLAG_CHANGED = 1<<0, |
| 122 | STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED, |
| 123 | STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE, |
| 124 | STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME, |
Jouni Malinen | 5394af4 | 2009-01-08 13:31:59 +0200 | [diff] [blame] | 125 | STATION_FLAG_MFP = 1<<NL80211_STA_FLAG_MFP, |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 126 | }; |
| 127 | |
| 128 | /** |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 129 | * enum plink_action - actions to perform in mesh peers |
| 130 | * |
| 131 | * @PLINK_ACTION_INVALID: action 0 is reserved |
| 132 | * @PLINK_ACTION_OPEN: start mesh peer link establishment |
| 133 | * @PLINK_ACTION_BLOCL: block traffic from this mesh peer |
| 134 | */ |
| 135 | enum plink_actions { |
| 136 | PLINK_ACTION_INVALID, |
| 137 | PLINK_ACTION_OPEN, |
| 138 | PLINK_ACTION_BLOCK, |
| 139 | }; |
| 140 | |
| 141 | /** |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 142 | * struct station_parameters - station parameters |
| 143 | * |
| 144 | * Used to change and create a new station. |
| 145 | * |
| 146 | * @vlan: vlan interface station should belong to |
| 147 | * @supported_rates: supported rates in IEEE 802.11 format |
| 148 | * (or NULL for no change) |
| 149 | * @supported_rates_len: number of supported rates |
| 150 | * @station_flags: station flags (see &enum station_flags) |
| 151 | * @listen_interval: listen interval or -1 for no change |
| 152 | * @aid: AID or zero for no change |
| 153 | */ |
| 154 | struct station_parameters { |
| 155 | u8 *supported_rates; |
| 156 | struct net_device *vlan; |
| 157 | u32 station_flags; |
| 158 | int listen_interval; |
| 159 | u16 aid; |
| 160 | u8 supported_rates_len; |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 161 | u8 plink_action; |
Jouni Malinen | 36aedc9 | 2008-08-25 11:58:58 +0300 | [diff] [blame] | 162 | struct ieee80211_ht_cap *ht_capa; |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 163 | }; |
| 164 | |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 165 | /** |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 166 | * enum station_info_flags - station information flags |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 167 | * |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 168 | * Used by the driver to indicate which info in &struct station_info |
| 169 | * it has filled in during get_station() or dump_station(). |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 170 | * |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 171 | * @STATION_INFO_INACTIVE_TIME: @inactive_time filled |
| 172 | * @STATION_INFO_RX_BYTES: @rx_bytes filled |
| 173 | * @STATION_INFO_TX_BYTES: @tx_bytes filled |
| 174 | * @STATION_INFO_LLID: @llid filled |
| 175 | * @STATION_INFO_PLID: @plid filled |
| 176 | * @STATION_INFO_PLINK_STATE: @plink_state filled |
Henning Rogge | 420e7fa | 2008-12-11 22:04:19 +0100 | [diff] [blame] | 177 | * @STATION_INFO_SIGNAL: @signal filled |
| 178 | * @STATION_INFO_TX_BITRATE: @tx_bitrate fields are filled |
| 179 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) |
Jouni Malinen | 98c8a60a | 2009-02-17 13:24:57 +0200 | [diff] [blame] | 180 | * @STATION_INFO_RX_PACKETS: @rx_packets filled |
| 181 | * @STATION_INFO_TX_PACKETS: @tx_packets filled |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 182 | */ |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 183 | enum station_info_flags { |
| 184 | STATION_INFO_INACTIVE_TIME = 1<<0, |
| 185 | STATION_INFO_RX_BYTES = 1<<1, |
| 186 | STATION_INFO_TX_BYTES = 1<<2, |
| 187 | STATION_INFO_LLID = 1<<3, |
| 188 | STATION_INFO_PLID = 1<<4, |
| 189 | STATION_INFO_PLINK_STATE = 1<<5, |
Henning Rogge | 420e7fa | 2008-12-11 22:04:19 +0100 | [diff] [blame] | 190 | STATION_INFO_SIGNAL = 1<<6, |
| 191 | STATION_INFO_TX_BITRATE = 1<<7, |
Jouni Malinen | 98c8a60a | 2009-02-17 13:24:57 +0200 | [diff] [blame] | 192 | STATION_INFO_RX_PACKETS = 1<<8, |
| 193 | STATION_INFO_TX_PACKETS = 1<<9, |
Henning Rogge | 420e7fa | 2008-12-11 22:04:19 +0100 | [diff] [blame] | 194 | }; |
| 195 | |
| 196 | /** |
| 197 | * enum station_info_rate_flags - bitrate info flags |
| 198 | * |
| 199 | * Used by the driver to indicate the specific rate transmission |
| 200 | * type for 802.11n transmissions. |
| 201 | * |
| 202 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled |
| 203 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission |
| 204 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
| 205 | */ |
| 206 | enum rate_info_flags { |
| 207 | RATE_INFO_FLAGS_MCS = 1<<0, |
| 208 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, |
| 209 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, |
| 210 | }; |
| 211 | |
| 212 | /** |
| 213 | * struct rate_info - bitrate information |
| 214 | * |
| 215 | * Information about a receiving or transmitting bitrate |
| 216 | * |
| 217 | * @flags: bitflag of flags from &enum rate_info_flags |
| 218 | * @mcs: mcs index if struct describes a 802.11n bitrate |
| 219 | * @legacy: bitrate in 100kbit/s for 802.11abg |
| 220 | */ |
| 221 | struct rate_info { |
| 222 | u8 flags; |
| 223 | u8 mcs; |
| 224 | u16 legacy; |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 225 | }; |
| 226 | |
| 227 | /** |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 228 | * struct station_info - station information |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 229 | * |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 230 | * Station information filled by driver for get_station() and dump_station. |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 231 | * |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 232 | * @filled: bitflag of flags from &enum station_info_flags |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 233 | * @inactive_time: time since last station activity (tx/rx) in milliseconds |
| 234 | * @rx_bytes: bytes received from this station |
| 235 | * @tx_bytes: bytes transmitted to this station |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 236 | * @llid: mesh local link id |
| 237 | * @plid: mesh peer link id |
| 238 | * @plink_state: mesh peer link state |
Henning Rogge | 420e7fa | 2008-12-11 22:04:19 +0100 | [diff] [blame] | 239 | * @signal: signal strength of last received packet in dBm |
| 240 | * @txrate: current unicast bitrate to this station |
Jouni Malinen | 98c8a60a | 2009-02-17 13:24:57 +0200 | [diff] [blame] | 241 | * @rx_packets: packets received from this station |
| 242 | * @tx_packets: packets transmitted to this station |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 243 | */ |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 244 | struct station_info { |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 245 | u32 filled; |
| 246 | u32 inactive_time; |
| 247 | u32 rx_bytes; |
| 248 | u32 tx_bytes; |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 249 | u16 llid; |
| 250 | u16 plid; |
| 251 | u8 plink_state; |
Henning Rogge | 420e7fa | 2008-12-11 22:04:19 +0100 | [diff] [blame] | 252 | s8 signal; |
| 253 | struct rate_info txrate; |
Jouni Malinen | 98c8a60a | 2009-02-17 13:24:57 +0200 | [diff] [blame] | 254 | u32 rx_packets; |
| 255 | u32 tx_packets; |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 256 | }; |
| 257 | |
Michael Wu | 66f7ac5 | 2008-01-31 19:48:22 +0100 | [diff] [blame] | 258 | /** |
| 259 | * enum monitor_flags - monitor flags |
| 260 | * |
| 261 | * Monitor interface configuration flags. Note that these must be the bits |
| 262 | * according to the nl80211 flags. |
| 263 | * |
| 264 | * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS |
| 265 | * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP |
| 266 | * @MONITOR_FLAG_CONTROL: pass control frames |
| 267 | * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering |
| 268 | * @MONITOR_FLAG_COOK_FRAMES: report frames after processing |
| 269 | */ |
| 270 | enum monitor_flags { |
| 271 | MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL, |
| 272 | MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL, |
| 273 | MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL, |
| 274 | MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS, |
| 275 | MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES, |
| 276 | }; |
| 277 | |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 278 | /** |
| 279 | * enum mpath_info_flags - mesh path information flags |
| 280 | * |
| 281 | * Used by the driver to indicate which info in &struct mpath_info it has filled |
| 282 | * in during get_station() or dump_station(). |
| 283 | * |
| 284 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled |
| 285 | * MPATH_INFO_DSN: @dsn filled |
| 286 | * MPATH_INFO_METRIC: @metric filled |
| 287 | * MPATH_INFO_EXPTIME: @exptime filled |
| 288 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled |
| 289 | * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled |
| 290 | * MPATH_INFO_FLAGS: @flags filled |
| 291 | */ |
| 292 | enum mpath_info_flags { |
| 293 | MPATH_INFO_FRAME_QLEN = BIT(0), |
| 294 | MPATH_INFO_DSN = BIT(1), |
| 295 | MPATH_INFO_METRIC = BIT(2), |
| 296 | MPATH_INFO_EXPTIME = BIT(3), |
| 297 | MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), |
| 298 | MPATH_INFO_DISCOVERY_RETRIES = BIT(5), |
| 299 | MPATH_INFO_FLAGS = BIT(6), |
| 300 | }; |
| 301 | |
| 302 | /** |
| 303 | * struct mpath_info - mesh path information |
| 304 | * |
| 305 | * Mesh path information filled by driver for get_mpath() and dump_mpath(). |
| 306 | * |
| 307 | * @filled: bitfield of flags from &enum mpath_info_flags |
| 308 | * @frame_qlen: number of queued frames for this destination |
| 309 | * @dsn: destination sequence number |
| 310 | * @metric: metric (cost) of this mesh path |
| 311 | * @exptime: expiration time for the mesh path from now, in msecs |
| 312 | * @flags: mesh path flags |
| 313 | * @discovery_timeout: total mesh path discovery timeout, in msecs |
| 314 | * @discovery_retries: mesh path discovery retries |
| 315 | */ |
| 316 | struct mpath_info { |
| 317 | u32 filled; |
| 318 | u32 frame_qlen; |
| 319 | u32 dsn; |
| 320 | u32 metric; |
| 321 | u32 exptime; |
| 322 | u32 discovery_timeout; |
| 323 | u8 discovery_retries; |
| 324 | u8 flags; |
| 325 | }; |
| 326 | |
Jouni Malinen | 9f1ba90 | 2008-08-07 20:07:01 +0300 | [diff] [blame] | 327 | /** |
| 328 | * struct bss_parameters - BSS parameters |
| 329 | * |
| 330 | * Used to change BSS parameters (mainly for AP mode). |
| 331 | * |
| 332 | * @use_cts_prot: Whether to use CTS protection |
| 333 | * (0 = no, 1 = yes, -1 = do not change) |
| 334 | * @use_short_preamble: Whether the use of short preambles is allowed |
| 335 | * (0 = no, 1 = yes, -1 = do not change) |
| 336 | * @use_short_slot_time: Whether the use of short slot time is allowed |
| 337 | * (0 = no, 1 = yes, -1 = do not change) |
Jouni Malinen | 90c97a0 | 2008-10-30 16:59:22 +0200 | [diff] [blame] | 338 | * @basic_rates: basic rates in IEEE 802.11 format |
| 339 | * (or NULL for no change) |
| 340 | * @basic_rates_len: number of basic rates |
Jouni Malinen | 9f1ba90 | 2008-08-07 20:07:01 +0300 | [diff] [blame] | 341 | */ |
| 342 | struct bss_parameters { |
| 343 | int use_cts_prot; |
| 344 | int use_short_preamble; |
| 345 | int use_short_slot_time; |
Jouni Malinen | 90c97a0 | 2008-10-30 16:59:22 +0200 | [diff] [blame] | 346 | u8 *basic_rates; |
| 347 | u8 basic_rates_len; |
Jouni Malinen | 9f1ba90 | 2008-08-07 20:07:01 +0300 | [diff] [blame] | 348 | }; |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 349 | |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 350 | /** |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 351 | * enum environment_cap - Environment parsed from country IE |
| 352 | * @ENVIRON_ANY: indicates country IE applies to both indoor and |
Luis R. Rodriguez | 7db90f4 | 2009-03-09 22:07:41 -0400 | [diff] [blame] | 353 | * outdoor operation. |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 354 | * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation |
| 355 | * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation |
| 356 | */ |
| 357 | enum environment_cap { |
| 358 | ENVIRON_ANY, |
| 359 | ENVIRON_INDOOR, |
| 360 | ENVIRON_OUTDOOR, |
| 361 | }; |
| 362 | |
| 363 | /** |
Luis R. Rodriguez | 806a9e3 | 2009-02-21 00:04:26 -0500 | [diff] [blame] | 364 | * struct regulatory_request - used to keep track of regulatory requests |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 365 | * |
Luis R. Rodriguez | 806a9e3 | 2009-02-21 00:04:26 -0500 | [diff] [blame] | 366 | * @wiphy_idx: this is set if this request's initiator is |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 367 | * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This |
| 368 | * can be used by the wireless core to deal with conflicts |
| 369 | * and potentially inform users of which devices specifically |
| 370 | * cased the conflicts. |
| 371 | * @initiator: indicates who sent this request, could be any of |
Luis R. Rodriguez | 7db90f4 | 2009-03-09 22:07:41 -0400 | [diff] [blame] | 372 | * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 373 | * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested |
| 374 | * regulatory domain. We have a few special codes: |
| 375 | * 00 - World regulatory domain |
| 376 | * 99 - built by driver but a specific alpha2 cannot be determined |
| 377 | * 98 - result of an intersection between two regulatory domains |
| 378 | * @intersect: indicates whether the wireless core should intersect |
| 379 | * the requested regulatory domain with the presently set regulatory |
| 380 | * domain. |
| 381 | * @country_ie_checksum: checksum of the last processed and accepted |
| 382 | * country IE |
| 383 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, |
| 384 | * indoor, or if it doesn't matter |
Luis R. Rodriguez | fe33eb3 | 2009-02-21 00:04:30 -0500 | [diff] [blame] | 385 | * @list: used to insert into the reg_requests_list linked list |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 386 | */ |
| 387 | struct regulatory_request { |
Luis R. Rodriguez | 806a9e3 | 2009-02-21 00:04:26 -0500 | [diff] [blame] | 388 | int wiphy_idx; |
Luis R. Rodriguez | 7db90f4 | 2009-03-09 22:07:41 -0400 | [diff] [blame] | 389 | enum nl80211_reg_initiator initiator; |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 390 | char alpha2[2]; |
| 391 | bool intersect; |
| 392 | u32 country_ie_checksum; |
| 393 | enum environment_cap country_ie_env; |
Luis R. Rodriguez | fe33eb3 | 2009-02-21 00:04:30 -0500 | [diff] [blame] | 394 | struct list_head list; |
Luis R. Rodriguez | 716f939 | 2009-01-22 15:05:51 -0800 | [diff] [blame] | 395 | }; |
| 396 | |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 397 | struct ieee80211_freq_range { |
| 398 | u32 start_freq_khz; |
| 399 | u32 end_freq_khz; |
| 400 | u32 max_bandwidth_khz; |
| 401 | }; |
| 402 | |
| 403 | struct ieee80211_power_rule { |
| 404 | u32 max_antenna_gain; |
| 405 | u32 max_eirp; |
| 406 | }; |
| 407 | |
| 408 | struct ieee80211_reg_rule { |
| 409 | struct ieee80211_freq_range freq_range; |
| 410 | struct ieee80211_power_rule power_rule; |
| 411 | u32 flags; |
| 412 | }; |
| 413 | |
| 414 | struct ieee80211_regdomain { |
| 415 | u32 n_reg_rules; |
| 416 | char alpha2[2]; |
| 417 | struct ieee80211_reg_rule reg_rules[]; |
| 418 | }; |
| 419 | |
Luis R. Rodriguez | b219cee | 2008-10-30 13:33:55 -0700 | [diff] [blame] | 420 | #define MHZ_TO_KHZ(freq) ((freq) * 1000) |
| 421 | #define KHZ_TO_MHZ(freq) ((freq) / 1000) |
| 422 | #define DBI_TO_MBI(gain) ((gain) * 100) |
| 423 | #define MBI_TO_DBI(gain) ((gain) / 100) |
| 424 | #define DBM_TO_MBM(gain) ((gain) * 100) |
| 425 | #define MBM_TO_DBM(gain) ((gain) / 100) |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 426 | |
| 427 | #define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ |
Luis R. Rodriguez | b219cee | 2008-10-30 13:33:55 -0700 | [diff] [blame] | 428 | .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \ |
| 429 | .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \ |
| 430 | .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \ |
| 431 | .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \ |
| 432 | .power_rule.max_eirp = DBM_TO_MBM(eirp), \ |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 433 | .flags = reg_flags, \ |
| 434 | } |
| 435 | |
colin@cozybit.com | 93da9cc | 2008-10-21 12:03:48 -0700 | [diff] [blame] | 436 | struct mesh_config { |
| 437 | /* Timeouts in ms */ |
| 438 | /* Mesh plink management parameters */ |
| 439 | u16 dot11MeshRetryTimeout; |
| 440 | u16 dot11MeshConfirmTimeout; |
| 441 | u16 dot11MeshHoldingTimeout; |
| 442 | u16 dot11MeshMaxPeerLinks; |
| 443 | u8 dot11MeshMaxRetries; |
| 444 | u8 dot11MeshTTL; |
| 445 | bool auto_open_plinks; |
| 446 | /* HWMP parameters */ |
| 447 | u8 dot11MeshHWMPmaxPREQretries; |
| 448 | u32 path_refresh_time; |
| 449 | u16 min_discovery_timeout; |
| 450 | u32 dot11MeshHWMPactivePathTimeout; |
| 451 | u16 dot11MeshHWMPpreqMinInterval; |
| 452 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
| 453 | }; |
| 454 | |
Jouni Malinen | 3188848 | 2008-10-30 16:59:24 +0200 | [diff] [blame] | 455 | /** |
| 456 | * struct ieee80211_txq_params - TX queue parameters |
| 457 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) |
| 458 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled |
| 459 | * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range |
| 460 | * 1..32767] |
| 461 | * @cwmax: Maximum contention window [a value of the form 2^n-1 in the range |
| 462 | * 1..32767] |
| 463 | * @aifs: Arbitration interframe space [0..255] |
| 464 | */ |
| 465 | struct ieee80211_txq_params { |
| 466 | enum nl80211_txq_q queue; |
| 467 | u16 txop; |
| 468 | u16 cwmin; |
| 469 | u16 cwmax; |
| 470 | u8 aifs; |
| 471 | }; |
| 472 | |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 473 | /* from net/wireless.h */ |
| 474 | struct wiphy; |
| 475 | |
Jouni Malinen | 72bdcf3 | 2008-11-26 16:15:24 +0200 | [diff] [blame] | 476 | /* from net/ieee80211.h */ |
| 477 | struct ieee80211_channel; |
| 478 | |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 479 | /** |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 480 | * struct cfg80211_ssid - SSID description |
| 481 | * @ssid: the SSID |
| 482 | * @ssid_len: length of the ssid |
| 483 | */ |
| 484 | struct cfg80211_ssid { |
| 485 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
| 486 | u8 ssid_len; |
| 487 | }; |
| 488 | |
| 489 | /** |
| 490 | * struct cfg80211_scan_request - scan request description |
| 491 | * |
| 492 | * @ssids: SSIDs to scan for (active scan only) |
| 493 | * @n_ssids: number of SSIDs |
| 494 | * @channels: channels to scan on. |
| 495 | * @n_channels: number of channels for each band |
Jouni Malinen | 70692ad | 2009-02-16 19:39:13 +0200 | [diff] [blame] | 496 | * @ie: optional information element(s) to add into Probe Request or %NULL |
| 497 | * @ie_len: length of ie in octets |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 498 | * @wiphy: the wiphy this was for |
| 499 | * @ifidx: the interface index |
| 500 | */ |
| 501 | struct cfg80211_scan_request { |
| 502 | struct cfg80211_ssid *ssids; |
| 503 | int n_ssids; |
| 504 | struct ieee80211_channel **channels; |
| 505 | u32 n_channels; |
Johannes Berg | de95a54 | 2009-04-01 11:58:36 +0200 | [diff] [blame] | 506 | const u8 *ie; |
Jouni Malinen | 70692ad | 2009-02-16 19:39:13 +0200 | [diff] [blame] | 507 | size_t ie_len; |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 508 | |
| 509 | /* internal */ |
| 510 | struct wiphy *wiphy; |
| 511 | int ifidx; |
| 512 | }; |
| 513 | |
| 514 | /** |
| 515 | * enum cfg80211_signal_type - signal type |
| 516 | * |
| 517 | * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available |
| 518 | * @CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm) |
| 519 | * @CFG80211_SIGNAL_TYPE_UNSPEC: signal strength, increasing from 0 through 100 |
| 520 | */ |
| 521 | enum cfg80211_signal_type { |
| 522 | CFG80211_SIGNAL_TYPE_NONE, |
| 523 | CFG80211_SIGNAL_TYPE_MBM, |
| 524 | CFG80211_SIGNAL_TYPE_UNSPEC, |
| 525 | }; |
| 526 | |
| 527 | /** |
| 528 | * struct cfg80211_bss - BSS description |
| 529 | * |
| 530 | * This structure describes a BSS (which may also be a mesh network) |
| 531 | * for use in scan results and similar. |
| 532 | * |
| 533 | * @bssid: BSSID of the BSS |
| 534 | * @tsf: timestamp of last received update |
| 535 | * @beacon_interval: the beacon interval as from the frame |
| 536 | * @capability: the capability field in host byte order |
| 537 | * @information_elements: the information elements (Note that there |
| 538 | * is no guarantee that these are well-formed!) |
| 539 | * @len_information_elements: total length of the information elements |
Johannes Berg | 77965c9 | 2009-02-18 18:45:06 +0100 | [diff] [blame] | 540 | * @signal: signal strength value (type depends on the wiphy's signal_type) |
Kalle Valo | a08c1c1 | 2009-03-22 21:57:28 +0200 | [diff] [blame] | 541 | * @hold: BSS should not expire |
Johannes Berg | 78c1c7e | 2009-02-10 21:25:57 +0100 | [diff] [blame] | 542 | * @free_priv: function pointer to free private data |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 543 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes |
| 544 | */ |
| 545 | struct cfg80211_bss { |
| 546 | struct ieee80211_channel *channel; |
| 547 | |
| 548 | u8 bssid[ETH_ALEN]; |
| 549 | u64 tsf; |
| 550 | u16 beacon_interval; |
| 551 | u16 capability; |
| 552 | u8 *information_elements; |
| 553 | size_t len_information_elements; |
| 554 | |
| 555 | s32 signal; |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 556 | |
Johannes Berg | 78c1c7e | 2009-02-10 21:25:57 +0100 | [diff] [blame] | 557 | void (*free_priv)(struct cfg80211_bss *bss); |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 558 | u8 priv[0] __attribute__((__aligned__(sizeof(void *)))); |
| 559 | }; |
| 560 | |
| 561 | /** |
Jouni Malinen | 636a5d3 | 2009-03-19 13:39:22 +0200 | [diff] [blame] | 562 | * struct cfg80211_auth_request - Authentication request data |
| 563 | * |
| 564 | * This structure provides information needed to complete IEEE 802.11 |
| 565 | * authentication. |
| 566 | * NOTE: This structure will likely change when more code from mac80211 is |
| 567 | * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. |
| 568 | * Before using this in a driver that does not use mac80211, it would be better |
| 569 | * to check the status of that work and better yet, volunteer to work on it. |
| 570 | * |
| 571 | * @chan: The channel to use or %NULL if not specified (auto-select based on |
| 572 | * scan results) |
| 573 | * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case); |
| 574 | * this field is required to be present; if the driver wants to help with |
| 575 | * BSS selection, it should use (yet to be added) MLME event to allow user |
| 576 | * space SME to be notified of roaming candidate, so that the SME can then |
| 577 | * use the authentication request with the recommended BSSID and whatever |
| 578 | * other data may be needed for authentication/association |
| 579 | * @ssid: SSID or %NULL if not yet available |
| 580 | * @ssid_len: Length of ssid in octets |
| 581 | * @auth_type: Authentication type (algorithm) |
| 582 | * @ie: Extra IEs to add to Authentication frame or %NULL |
| 583 | * @ie_len: Length of ie buffer in octets |
| 584 | */ |
| 585 | struct cfg80211_auth_request { |
| 586 | struct ieee80211_channel *chan; |
| 587 | u8 *peer_addr; |
| 588 | const u8 *ssid; |
| 589 | size_t ssid_len; |
| 590 | enum nl80211_auth_type auth_type; |
| 591 | const u8 *ie; |
| 592 | size_t ie_len; |
| 593 | }; |
| 594 | |
| 595 | /** |
| 596 | * struct cfg80211_assoc_request - (Re)Association request data |
| 597 | * |
| 598 | * This structure provides information needed to complete IEEE 802.11 |
| 599 | * (re)association. |
| 600 | * NOTE: This structure will likely change when more code from mac80211 is |
| 601 | * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. |
| 602 | * Before using this in a driver that does not use mac80211, it would be better |
| 603 | * to check the status of that work and better yet, volunteer to work on it. |
| 604 | * |
| 605 | * @chan: The channel to use or %NULL if not specified (auto-select based on |
| 606 | * scan results) |
| 607 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required |
| 608 | * to be present and the STA must be in State 2 (authenticated) with the |
| 609 | * peer STA |
| 610 | * @ssid: SSID |
| 611 | * @ssid_len: Length of ssid in octets |
| 612 | * @ie: Extra IEs to add to (Re)Association Request frame or %NULL |
| 613 | * @ie_len: Length of ie buffer in octets |
| 614 | */ |
| 615 | struct cfg80211_assoc_request { |
| 616 | struct ieee80211_channel *chan; |
| 617 | u8 *peer_addr; |
| 618 | const u8 *ssid; |
| 619 | size_t ssid_len; |
| 620 | const u8 *ie; |
| 621 | size_t ie_len; |
| 622 | }; |
| 623 | |
| 624 | /** |
| 625 | * struct cfg80211_deauth_request - Deauthentication request data |
| 626 | * |
| 627 | * This structure provides information needed to complete IEEE 802.11 |
| 628 | * deauthentication. |
| 629 | * |
| 630 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required |
| 631 | * to be present and the STA must be authenticated with the peer STA |
| 632 | * @ie: Extra IEs to add to Deauthentication frame or %NULL |
| 633 | * @ie_len: Length of ie buffer in octets |
| 634 | */ |
| 635 | struct cfg80211_deauth_request { |
| 636 | u8 *peer_addr; |
| 637 | u16 reason_code; |
| 638 | const u8 *ie; |
| 639 | size_t ie_len; |
| 640 | }; |
| 641 | |
| 642 | /** |
| 643 | * struct cfg80211_disassoc_request - Disassociation request data |
| 644 | * |
| 645 | * This structure provides information needed to complete IEEE 802.11 |
| 646 | * disassocation. |
| 647 | * |
| 648 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required |
| 649 | * to be present and the STA must be associated with the peer STA |
| 650 | * @ie: Extra IEs to add to Disassociation frame or %NULL |
| 651 | * @ie_len: Length of ie buffer in octets |
| 652 | */ |
| 653 | struct cfg80211_disassoc_request { |
| 654 | u8 *peer_addr; |
| 655 | u16 reason_code; |
| 656 | const u8 *ie; |
| 657 | size_t ie_len; |
| 658 | }; |
| 659 | |
| 660 | /** |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 661 | * struct cfg80211_ops - backend description for wireless configuration |
| 662 | * |
| 663 | * This struct is registered by fullmac card drivers and/or wireless stacks |
| 664 | * in order to handle configuration requests on their interfaces. |
| 665 | * |
| 666 | * All callbacks except where otherwise noted should return 0 |
| 667 | * on success or a negative error code. |
| 668 | * |
Johannes Berg | 43fb45cb | 2007-04-24 14:07:27 -0700 | [diff] [blame] | 669 | * All operations are currently invoked under rtnl for consistency with the |
| 670 | * wireless extensions but this is subject to reevaluation as soon as this |
| 671 | * code is used more widely and we have a first user without wext. |
| 672 | * |
Johannes Berg | 0378b3f | 2009-01-19 11:20:52 -0500 | [diff] [blame] | 673 | * @suspend: wiphy device needs to be suspended |
| 674 | * @resume: wiphy device needs to be resumed |
| 675 | * |
Johannes Berg | 60719ff | 2008-09-16 14:55:09 +0200 | [diff] [blame] | 676 | * @add_virtual_intf: create a new virtual interface with the given name, |
| 677 | * must set the struct wireless_dev's iftype. |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 678 | * |
| 679 | * @del_virtual_intf: remove the virtual interface determined by ifindex. |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 680 | * |
Johannes Berg | 60719ff | 2008-09-16 14:55:09 +0200 | [diff] [blame] | 681 | * @change_virtual_intf: change type/configuration of virtual interface, |
| 682 | * keep the struct wireless_dev's iftype updated. |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 683 | * |
Johannes Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 684 | * @add_key: add a key with the given parameters. @mac_addr will be %NULL |
| 685 | * when adding a group key. |
| 686 | * |
| 687 | * @get_key: get information about the key with the given parameters. |
| 688 | * @mac_addr will be %NULL when requesting information for a group |
| 689 | * key. All pointers given to the @callback function need not be valid |
| 690 | * after it returns. |
| 691 | * |
| 692 | * @del_key: remove a key given the @mac_addr (%NULL for a group key) |
| 693 | * and @key_index |
| 694 | * |
| 695 | * @set_default_key: set the default key on an interface |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 696 | * |
Jouni Malinen | 3cfcf6ac | 2009-01-08 13:32:02 +0200 | [diff] [blame] | 697 | * @set_default_mgmt_key: set the default management frame key on an interface |
| 698 | * |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 699 | * @add_beacon: Add a beacon with given parameters, @head, @interval |
| 700 | * and @dtim_period will be valid, @tail is optional. |
| 701 | * @set_beacon: Change the beacon parameters for an access point mode |
| 702 | * interface. This should reject the call when no beacon has been |
| 703 | * configured. |
| 704 | * @del_beacon: Remove beacon configuration and stop sending the beacon. |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 705 | * |
| 706 | * @add_station: Add a new station. |
| 707 | * |
| 708 | * @del_station: Remove a station; @mac may be NULL to remove all stations. |
| 709 | * |
| 710 | * @change_station: Modify a given station. |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 711 | * |
colin@cozybit.com | 93da9cc | 2008-10-21 12:03:48 -0700 | [diff] [blame] | 712 | * @get_mesh_params: Put the current mesh parameters into *params |
| 713 | * |
| 714 | * @set_mesh_params: Set mesh parameters. |
| 715 | * The mask is a bitfield which tells us which parameters to |
| 716 | * set, and which to leave alone. |
| 717 | * |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 718 | * @set_mesh_cfg: set mesh parameters (by now, just mesh id) |
Jouni Malinen | 9f1ba90 | 2008-08-07 20:07:01 +0300 | [diff] [blame] | 719 | * |
| 720 | * @change_bss: Modify parameters for a given BSS. |
Jouni Malinen | 3188848 | 2008-10-30 16:59:24 +0200 | [diff] [blame] | 721 | * |
| 722 | * @set_txq_params: Set TX queue parameters |
Jouni Malinen | 72bdcf3 | 2008-11-26 16:15:24 +0200 | [diff] [blame] | 723 | * |
| 724 | * @set_channel: Set channel |
Jouni Malinen | 9aed3cc | 2009-01-13 16:03:29 +0200 | [diff] [blame] | 725 | * |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 726 | * @scan: Request to do a scan. If returning zero, the scan request is given |
| 727 | * the driver, and will be valid until passed to cfg80211_scan_done(). |
| 728 | * For scan results, call cfg80211_inform_bss(); you can call this outside |
| 729 | * the scan/scan_done bracket too. |
Jouni Malinen | 636a5d3 | 2009-03-19 13:39:22 +0200 | [diff] [blame] | 730 | * |
| 731 | * @auth: Request to authenticate with the specified peer |
| 732 | * @assoc: Request to (re)associate with the specified peer |
| 733 | * @deauth: Request to deauthenticate from the specified peer |
| 734 | * @disassoc: Request to disassociate from the specified peer |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 735 | */ |
| 736 | struct cfg80211_ops { |
Johannes Berg | 0378b3f | 2009-01-19 11:20:52 -0500 | [diff] [blame] | 737 | int (*suspend)(struct wiphy *wiphy); |
| 738 | int (*resume)(struct wiphy *wiphy); |
| 739 | |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 740 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 741 | enum nl80211_iftype type, u32 *flags, |
| 742 | struct vif_params *params); |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 743 | int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 744 | int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 745 | enum nl80211_iftype type, u32 *flags, |
| 746 | struct vif_params *params); |
Johannes Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 747 | |
| 748 | int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, |
| 749 | u8 key_index, u8 *mac_addr, |
| 750 | struct key_params *params); |
| 751 | int (*get_key)(struct wiphy *wiphy, struct net_device *netdev, |
| 752 | u8 key_index, u8 *mac_addr, void *cookie, |
| 753 | void (*callback)(void *cookie, struct key_params*)); |
| 754 | int (*del_key)(struct wiphy *wiphy, struct net_device *netdev, |
| 755 | u8 key_index, u8 *mac_addr); |
| 756 | int (*set_default_key)(struct wiphy *wiphy, |
| 757 | struct net_device *netdev, |
| 758 | u8 key_index); |
Jouni Malinen | 3cfcf6ac | 2009-01-08 13:32:02 +0200 | [diff] [blame] | 759 | int (*set_default_mgmt_key)(struct wiphy *wiphy, |
| 760 | struct net_device *netdev, |
| 761 | u8 key_index); |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 762 | |
| 763 | int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, |
| 764 | struct beacon_parameters *info); |
| 765 | int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev, |
| 766 | struct beacon_parameters *info); |
| 767 | int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev); |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 768 | |
| 769 | |
| 770 | int (*add_station)(struct wiphy *wiphy, struct net_device *dev, |
| 771 | u8 *mac, struct station_parameters *params); |
| 772 | int (*del_station)(struct wiphy *wiphy, struct net_device *dev, |
| 773 | u8 *mac); |
| 774 | int (*change_station)(struct wiphy *wiphy, struct net_device *dev, |
| 775 | u8 *mac, struct station_parameters *params); |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 776 | int (*get_station)(struct wiphy *wiphy, struct net_device *dev, |
Luis Carlos Cobo | 2ec600d | 2008-02-23 15:17:06 +0100 | [diff] [blame] | 777 | u8 *mac, struct station_info *sinfo); |
| 778 | int (*dump_station)(struct wiphy *wiphy, struct net_device *dev, |
| 779 | int idx, u8 *mac, struct station_info *sinfo); |
| 780 | |
| 781 | int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev, |
| 782 | u8 *dst, u8 *next_hop); |
| 783 | int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev, |
| 784 | u8 *dst); |
| 785 | int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev, |
| 786 | u8 *dst, u8 *next_hop); |
| 787 | int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev, |
| 788 | u8 *dst, u8 *next_hop, |
| 789 | struct mpath_info *pinfo); |
| 790 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
| 791 | int idx, u8 *dst, u8 *next_hop, |
| 792 | struct mpath_info *pinfo); |
colin@cozybit.com | 93da9cc | 2008-10-21 12:03:48 -0700 | [diff] [blame] | 793 | int (*get_mesh_params)(struct wiphy *wiphy, |
| 794 | struct net_device *dev, |
| 795 | struct mesh_config *conf); |
| 796 | int (*set_mesh_params)(struct wiphy *wiphy, |
| 797 | struct net_device *dev, |
| 798 | const struct mesh_config *nconf, u32 mask); |
Jouni Malinen | 9f1ba90 | 2008-08-07 20:07:01 +0300 | [diff] [blame] | 799 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, |
| 800 | struct bss_parameters *params); |
Jouni Malinen | 3188848 | 2008-10-30 16:59:24 +0200 | [diff] [blame] | 801 | |
| 802 | int (*set_txq_params)(struct wiphy *wiphy, |
| 803 | struct ieee80211_txq_params *params); |
Jouni Malinen | 72bdcf3 | 2008-11-26 16:15:24 +0200 | [diff] [blame] | 804 | |
| 805 | int (*set_channel)(struct wiphy *wiphy, |
| 806 | struct ieee80211_channel *chan, |
Sujith | 094d05d | 2008-12-12 11:57:43 +0530 | [diff] [blame] | 807 | enum nl80211_channel_type channel_type); |
Jouni Malinen | 9aed3cc | 2009-01-13 16:03:29 +0200 | [diff] [blame] | 808 | |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 809 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, |
| 810 | struct cfg80211_scan_request *request); |
Jouni Malinen | 636a5d3 | 2009-03-19 13:39:22 +0200 | [diff] [blame] | 811 | |
| 812 | int (*auth)(struct wiphy *wiphy, struct net_device *dev, |
| 813 | struct cfg80211_auth_request *req); |
| 814 | int (*assoc)(struct wiphy *wiphy, struct net_device *dev, |
| 815 | struct cfg80211_assoc_request *req); |
| 816 | int (*deauth)(struct wiphy *wiphy, struct net_device *dev, |
| 817 | struct cfg80211_deauth_request *req); |
| 818 | int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, |
| 819 | struct cfg80211_disassoc_request *req); |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 820 | }; |
| 821 | |
Johannes Berg | fee5267 | 2008-11-26 22:36:31 +0100 | [diff] [blame] | 822 | /* temporary wext handlers */ |
| 823 | int cfg80211_wext_giwname(struct net_device *dev, |
| 824 | struct iw_request_info *info, |
| 825 | char *name, char *extra); |
Johannes Berg | e60c774 | 2008-11-26 23:31:40 +0100 | [diff] [blame] | 826 | int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, |
| 827 | u32 *mode, char *extra); |
| 828 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, |
| 829 | u32 *mode, char *extra); |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 830 | int cfg80211_wext_siwscan(struct net_device *dev, |
| 831 | struct iw_request_info *info, |
| 832 | union iwreq_data *wrqu, char *extra); |
| 833 | int cfg80211_wext_giwscan(struct net_device *dev, |
| 834 | struct iw_request_info *info, |
| 835 | struct iw_point *data, char *extra); |
Johannes Berg | 691597c | 2009-04-19 19:57:45 +0200 | [diff] [blame^] | 836 | int cfg80211_wext_siwmlme(struct net_device *dev, |
| 837 | struct iw_request_info *info, |
| 838 | struct iw_point *data, char *extra); |
Johannes Berg | 4aa188e | 2009-02-18 19:32:08 +0100 | [diff] [blame] | 839 | int cfg80211_wext_giwrange(struct net_device *dev, |
| 840 | struct iw_request_info *info, |
| 841 | struct iw_point *data, char *extra); |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 842 | |
| 843 | /** |
| 844 | * cfg80211_scan_done - notify that scan finished |
| 845 | * |
| 846 | * @request: the corresponding scan request |
| 847 | * @aborted: set to true if the scan was aborted for any reason, |
| 848 | * userspace will be notified of that |
| 849 | */ |
| 850 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); |
| 851 | |
| 852 | /** |
| 853 | * cfg80211_inform_bss - inform cfg80211 of a new BSS |
| 854 | * |
| 855 | * @wiphy: the wiphy reporting the BSS |
| 856 | * @bss: the found BSS |
Johannes Berg | 77965c9 | 2009-02-18 18:45:06 +0100 | [diff] [blame] | 857 | * @signal: the signal strength, type depends on the wiphy's signal_type |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 858 | * @gfp: context flags |
| 859 | * |
| 860 | * This informs cfg80211 that BSS information was found and |
| 861 | * the BSS should be updated/added. |
| 862 | */ |
| 863 | struct cfg80211_bss* |
| 864 | cfg80211_inform_bss_frame(struct wiphy *wiphy, |
| 865 | struct ieee80211_channel *channel, |
| 866 | struct ieee80211_mgmt *mgmt, size_t len, |
Johannes Berg | 77965c9 | 2009-02-18 18:45:06 +0100 | [diff] [blame] | 867 | s32 signal, gfp_t gfp); |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 868 | |
Jussi Kivilinna | 06aa7af | 2009-03-26 23:40:09 +0200 | [diff] [blame] | 869 | struct cfg80211_bss* |
| 870 | cfg80211_inform_bss(struct wiphy *wiphy, |
| 871 | struct ieee80211_channel *channel, |
| 872 | const u8 *bssid, |
| 873 | u64 timestamp, u16 capability, u16 beacon_interval, |
| 874 | const u8 *ie, size_t ielen, |
| 875 | s32 signal, gfp_t gfp); |
| 876 | |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 877 | struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, |
| 878 | struct ieee80211_channel *channel, |
| 879 | const u8 *bssid, |
Johannes Berg | 79420f0 | 2009-02-10 21:25:59 +0100 | [diff] [blame] | 880 | const u8 *ssid, size_t ssid_len, |
| 881 | u16 capa_mask, u16 capa_val); |
| 882 | static inline struct cfg80211_bss * |
| 883 | cfg80211_get_ibss(struct wiphy *wiphy, |
| 884 | struct ieee80211_channel *channel, |
| 885 | const u8 *ssid, size_t ssid_len) |
| 886 | { |
| 887 | return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len, |
| 888 | WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); |
| 889 | } |
| 890 | |
Johannes Berg | 2a51931 | 2009-02-10 21:25:55 +0100 | [diff] [blame] | 891 | struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy, |
| 892 | struct ieee80211_channel *channel, |
| 893 | const u8 *meshid, size_t meshidlen, |
| 894 | const u8 *meshcfg); |
| 895 | void cfg80211_put_bss(struct cfg80211_bss *bss); |
Johannes Berg | d491af1 | 2009-02-10 21:25:58 +0100 | [diff] [blame] | 896 | /** |
| 897 | * cfg80211_unlink_bss - unlink BSS from internal data structures |
| 898 | * @wiphy: the wiphy |
| 899 | * @bss: the bss to remove |
| 900 | * |
| 901 | * This function removes the given BSS from the internal data structures |
| 902 | * thereby making it no longer show up in scan results etc. Use this |
| 903 | * function when you detect a BSS is gone. Normally BSSes will also time |
| 904 | * out, so it is not necessary to use this function at all. |
| 905 | */ |
| 906 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); |
Johannes Berg | fee5267 | 2008-11-26 22:36:31 +0100 | [diff] [blame] | 907 | |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 908 | /** |
| 909 | * cfg80211_send_rx_auth - notification of processed authentication |
| 910 | * @dev: network device |
| 911 | * @buf: authentication frame (header + body) |
| 912 | * @len: length of the frame data |
| 913 | * |
| 914 | * This function is called whenever an authentication has been processed in |
| 915 | * station mode. |
| 916 | */ |
| 917 | void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); |
| 918 | |
| 919 | /** |
| 920 | * cfg80211_send_rx_assoc - notification of processed association |
| 921 | * @dev: network device |
| 922 | * @buf: (re)association response frame (header + body) |
| 923 | * @len: length of the frame data |
| 924 | * |
| 925 | * This function is called whenever a (re)association response has been |
| 926 | * processed in station mode. |
| 927 | */ |
| 928 | void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); |
| 929 | |
| 930 | /** |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 931 | * cfg80211_send_deauth - notification of processed deauthentication |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 932 | * @dev: network device |
| 933 | * @buf: deauthentication frame (header + body) |
| 934 | * @len: length of the frame data |
| 935 | * |
| 936 | * This function is called whenever deauthentication has been processed in |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 937 | * station mode. This includes both received deauthentication frames and |
| 938 | * locally generated ones. |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 939 | */ |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 940 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 941 | |
| 942 | /** |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 943 | * cfg80211_send_disassoc - notification of processed disassociation |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 944 | * @dev: network device |
| 945 | * @buf: disassociation response frame (header + body) |
| 946 | * @len: length of the frame data |
| 947 | * |
| 948 | * This function is called whenever disassociation has been processed in |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 949 | * station mode. This includes both received disassociation frames and locally |
| 950 | * generated ones. |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 951 | */ |
Jouni Malinen | 53b46b8 | 2009-03-27 20:53:56 +0200 | [diff] [blame] | 952 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); |
Jouni Malinen | 6039f6d | 2009-03-19 13:39:21 +0200 | [diff] [blame] | 953 | |
Kalle Valo | a08c1c1 | 2009-03-22 21:57:28 +0200 | [diff] [blame] | 954 | /** |
| 955 | * cfg80211_hold_bss - exclude bss from expiration |
| 956 | * @bss: bss which should not expire |
| 957 | * |
| 958 | * In a case when the BSS is not updated but it shouldn't expire this |
| 959 | * function can be used to mark the BSS to be excluded from expiration. |
| 960 | */ |
| 961 | void cfg80211_hold_bss(struct cfg80211_bss *bss); |
| 962 | |
| 963 | /** |
| 964 | * cfg80211_unhold_bss - remove expiration exception from the BSS |
| 965 | * @bss: bss which can expire again |
| 966 | * |
| 967 | * This function marks the BSS to be expirable again. |
| 968 | */ |
| 969 | void cfg80211_unhold_bss(struct cfg80211_bss *bss); |
| 970 | |
Jouni Malinen | a3b8b05 | 2009-03-27 21:59:49 +0200 | [diff] [blame] | 971 | /** |
| 972 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
| 973 | * @dev: network device |
| 974 | * @addr: The source MAC address of the frame |
| 975 | * @key_type: The key type that the received frame used |
| 976 | * @key_id: Key identifier (0..3) |
| 977 | * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) |
| 978 | * |
| 979 | * This function is called whenever the local MAC detects a MIC failure in a |
| 980 | * received frame. This matches with MLME-MICHAELMICFAILURE.indication() |
| 981 | * primitive. |
| 982 | */ |
| 983 | void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, |
| 984 | enum nl80211_key_type key_type, int key_id, |
| 985 | const u8 *tsc); |
| 986 | |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 987 | #endif /* __NET_CFG80211_H */ |