Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
net
cfg80211.h
Go to the documentation of this file.
1
#ifndef __NET_CFG80211_H
2
#define __NET_CFG80211_H
3
/*
4
* 802.11 device and configuration interface
5
*
6
* Copyright 2006-2010 Johannes Berg <
[email protected]
>
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License version 2 as
10
* published by the Free Software Foundation.
11
*/
12
13
#include <linux/netdevice.h>
14
#include <
linux/debugfs.h
>
15
#include <linux/list.h>
16
#include <
linux/bug.h
>
17
#include <linux/netlink.h>
18
#include <
linux/skbuff.h
>
19
#include <
linux/nl80211.h
>
20
#include <linux/if_ether.h>
21
#include <
linux/ieee80211.h
>
22
#include <
net/regulatory.h
>
23
61
/*
62
* wireless hardware capability structures
63
*/
64
76
enum
ieee80211_band
{
77
IEEE80211_BAND_2GHZ
=
NL80211_BAND_2GHZ
,
78
IEEE80211_BAND_5GHZ
=
NL80211_BAND_5GHZ
,
79
IEEE80211_BAND_60GHZ
=
NL80211_BAND_60GHZ
,
80
81
/* keep last */
82
IEEE80211_NUM_BANDS
83
};
84
101
enum
ieee80211_channel_flags
{
102
IEEE80211_CHAN_DISABLED
= 1<<0,
103
IEEE80211_CHAN_PASSIVE_SCAN
= 1<<1,
104
IEEE80211_CHAN_NO_IBSS
= 1<<2,
105
IEEE80211_CHAN_RADAR
= 1<<3,
106
IEEE80211_CHAN_NO_HT40PLUS
= 1<<4,
107
IEEE80211_CHAN_NO_HT40MINUS
= 1<<5,
108
IEEE80211_CHAN_NO_OFDM
= 1<<6,
109
};
110
111
#define IEEE80211_CHAN_NO_HT40 \
112
(IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS)
113
135
struct
ieee80211_channel
{
136
enum
ieee80211_band
band
;
137
u16
center_freq
;
138
u16
hw_value
;
139
u32
flags
;
140
int
max_antenna_gain
;
141
int
max_power
;
142
int
max_reg_power
;
143
bool
beacon_found
;
144
u32
orig_flags
;
145
int
orig_mag
,
orig_mpwr
;
146
};
147
169
enum
ieee80211_rate_flags
{
170
IEEE80211_RATE_SHORT_PREAMBLE
= 1<<0,
171
IEEE80211_RATE_MANDATORY_A
= 1<<1,
172
IEEE80211_RATE_MANDATORY_B
= 1<<2,
173
IEEE80211_RATE_MANDATORY_G
= 1<<3,
174
IEEE80211_RATE_ERP_G
= 1<<4,
175
};
176
191
struct
ieee80211_rate
{
192
u32
flags
;
193
u16
bitrate
;
194
u16
hw_value
,
hw_value_short
;
195
};
196
209
struct
ieee80211_sta_ht_cap
{
210
u16
cap
;
/* use IEEE80211_HT_CAP_ */
211
bool
ht_supported
;
212
u8
ampdu_factor
;
213
u8
ampdu_density
;
214
struct
ieee80211_mcs_info
mcs
;
215
};
216
227
struct
ieee80211_sta_vht_cap
{
228
bool
vht_supported
;
229
u32
cap
;
/* use IEEE80211_VHT_CAP_ */
230
struct
ieee80211_vht_mcs_info
vht_mcs
;
231
};
232
250
struct
ieee80211_supported_band
{
251
struct
ieee80211_channel
*
channels
;
252
struct
ieee80211_rate
*
bitrates
;
253
enum
ieee80211_band
band
;
254
int
n_channels
;
255
int
n_bitrates
;
256
struct
ieee80211_sta_ht_cap
ht_cap
;
257
struct
ieee80211_sta_vht_cap
vht_cap
;
258
};
259
260
/*
261
* Wireless hardware/device configuration structures and methods
262
*/
263
283
struct
vif_params
{
284
int
use_4addr
;
285
};
286
300
struct
key_params
{
301
u8
*
key
;
302
u8
*
seq
;
303
int
key_len
;
304
int
seq_len
;
305
u32
cipher
;
306
};
307
322
enum
survey_info_flags
{
323
SURVEY_INFO_NOISE_DBM
= 1<<0,
324
SURVEY_INFO_IN_USE
= 1<<1,
325
SURVEY_INFO_CHANNEL_TIME
= 1<<2,
326
SURVEY_INFO_CHANNEL_TIME_BUSY
= 1<<3,
327
SURVEY_INFO_CHANNEL_TIME_EXT_BUSY
= 1<<4,
328
SURVEY_INFO_CHANNEL_TIME_RX
= 1<<5,
329
SURVEY_INFO_CHANNEL_TIME_TX
= 1<<6,
330
};
331
350
struct
survey_info
{
351
struct
ieee80211_channel
*
channel
;
352
u64
channel_time
;
353
u64
channel_time_busy
;
354
u64
channel_time_ext_busy
;
355
u64
channel_time_rx
;
356
u64
channel_time_tx
;
357
u32
filled
;
358
s8
noise
;
359
};
360
379
struct
cfg80211_crypto_settings
{
380
u32
wpa_versions
;
381
u32
cipher_group
;
382
int
n_ciphers_pairwise
;
383
u32
ciphers_pairwise
[
NL80211_MAX_NR_CIPHER_SUITES
];
384
int
n_akm_suites
;
385
u32
akm_suites
[
NL80211_MAX_NR_AKM_SUITES
];
386
bool
control_port
;
387
__be16
control_port_ethertype
;
388
bool
control_port_no_encrypt
;
389
};
390
410
struct
cfg80211_beacon_data
{
411
const
u8
*
head
, *
tail
;
412
const
u8
*
beacon_ies
;
413
const
u8
*
proberesp_ies
;
414
const
u8
*
assocresp_ies
;
415
const
u8
*
probe_resp
;
416
417
size_t
head_len
,
tail_len
;
418
size_t
beacon_ies_len
;
419
size_t
proberesp_ies_len
;
420
size_t
assocresp_ies_len
;
421
size_t
probe_resp_len
;
422
};
423
443
struct
cfg80211_ap_settings
{
444
struct
ieee80211_channel
*
channel
;
445
enum
nl80211_channel_type
channel_type
;
446
447
struct
cfg80211_beacon_data
beacon
;
448
449
int
beacon_interval
,
dtim_period
;
450
const
u8
*
ssid
;
451
size_t
ssid_len
;
452
enum
nl80211_hidden_ssid
hidden_ssid
;
453
struct
cfg80211_crypto_settings
crypto
;
454
bool
privacy
;
455
enum
nl80211_auth_type
auth_type
;
456
int
inactivity_timeout
;
457
};
458
466
enum
plink_actions
{
467
PLINK_ACTION_INVALID
,
468
PLINK_ACTION_OPEN
,
469
PLINK_ACTION_BLOCK
,
470
};
471
479
enum
station_parameters_apply_mask
{
480
STATION_PARAM_APPLY_UAPSD
=
BIT
(0),
481
};
482
509
struct
station_parameters
{
510
u8
*
supported_rates
;
511
struct
net_device
*
vlan
;
512
u32
sta_flags_mask
,
sta_flags_set
;
513
u32
sta_modify_mask
;
514
int
listen_interval
;
515
u16
aid
;
516
u8
supported_rates_len
;
517
u8
plink_action
;
518
u8
plink_state
;
519
struct
ieee80211_ht_cap
*
ht_capa
;
520
u8
uapsd_queues
;
521
u8
max_sp
;
522
};
523
553
enum
station_info_flags
{
554
STATION_INFO_INACTIVE_TIME
= 1<<0,
555
STATION_INFO_RX_BYTES
= 1<<1,
556
STATION_INFO_TX_BYTES
= 1<<2,
557
STATION_INFO_LLID
= 1<<3,
558
STATION_INFO_PLID
= 1<<4,
559
STATION_INFO_PLINK_STATE
= 1<<5,
560
STATION_INFO_SIGNAL
= 1<<6,
561
STATION_INFO_TX_BITRATE
= 1<<7,
562
STATION_INFO_RX_PACKETS
= 1<<8,
563
STATION_INFO_TX_PACKETS
= 1<<9,
564
STATION_INFO_TX_RETRIES
= 1<<10,
565
STATION_INFO_TX_FAILED
= 1<<11,
566
STATION_INFO_RX_DROP_MISC
= 1<<12,
567
STATION_INFO_SIGNAL_AVG
= 1<<13,
568
STATION_INFO_RX_BITRATE
= 1<<14,
569
STATION_INFO_BSS_PARAM
= 1<<15,
570
STATION_INFO_CONNECTED_TIME
= 1<<16,
571
STATION_INFO_ASSOC_REQ_IES
= 1<<17,
572
STATION_INFO_STA_FLAGS
= 1<<18,
573
STATION_INFO_BEACON_LOSS_COUNT
= 1<<19,
574
STATION_INFO_T_OFFSET
= 1<<20,
575
};
576
588
enum
rate_info_flags
{
589
RATE_INFO_FLAGS_MCS
= 1<<0,
590
RATE_INFO_FLAGS_40_MHZ_WIDTH
= 1<<1,
591
RATE_INFO_FLAGS_SHORT_GI
= 1<<2,
592
RATE_INFO_FLAGS_60G
= 1<<3,
593
};
594
604
struct
rate_info
{
605
u8
flags
;
606
u8
mcs
;
607
u16
legacy
;
608
};
609
620
enum
bss_param_flags
{
621
BSS_PARAM_FLAGS_CTS_PROT
= 1<<0,
622
BSS_PARAM_FLAGS_SHORT_PREAMBLE
= 1<<1,
623
BSS_PARAM_FLAGS_SHORT_SLOT_TIME
= 1<<2,
624
};
625
635
struct
sta_bss_parameters
{
636
u8
flags
;
637
u8
dtim_period
;
638
u16
beacon_interval
;
639
};
640
679
struct
station_info
{
680
u32
filled
;
681
u32
connected_time
;
682
u32
inactive_time
;
683
u32
rx_bytes
;
684
u32
tx_bytes
;
685
u16
llid
;
686
u16
plid
;
687
u8
plink_state
;
688
s8
signal
;
689
s8
signal_avg
;
690
struct
rate_info
txrate
;
691
struct
rate_info
rxrate
;
692
u32
rx_packets
;
693
u32
tx_packets
;
694
u32
tx_retries
;
695
u32
tx_failed
;
696
u32
rx_dropped_misc
;
697
struct
sta_bss_parameters
bss_param
;
698
struct
nl80211_sta_flag_update
sta_flags
;
699
700
int
generation
;
701
702
const
u8
*
assoc_req_ies
;
703
size_t
assoc_req_ies_len
;
704
705
u32
beacon_loss_count
;
706
s64
t_offset
;
707
708
/*
709
* Note: Add a new enum station_info_flags value for each new field and
710
* use it to check which fields are initialized.
711
*/
712
};
713
726
enum
monitor_flags
{
727
MONITOR_FLAG_FCSFAIL
= 1<<
NL80211_MNTR_FLAG_FCSFAIL
,
728
MONITOR_FLAG_PLCPFAIL
= 1<<
NL80211_MNTR_FLAG_PLCPFAIL
,
729
MONITOR_FLAG_CONTROL
= 1<<
NL80211_MNTR_FLAG_CONTROL
,
730
MONITOR_FLAG_OTHER_BSS
= 1<<
NL80211_MNTR_FLAG_OTHER_BSS
,
731
MONITOR_FLAG_COOK_FRAMES
= 1<<
NL80211_MNTR_FLAG_COOK_FRAMES
,
732
};
733
748
enum
mpath_info_flags
{
749
MPATH_INFO_FRAME_QLEN
=
BIT
(0),
750
MPATH_INFO_SN
=
BIT
(1),
751
MPATH_INFO_METRIC
=
BIT
(2),
752
MPATH_INFO_EXPTIME
=
BIT
(3),
753
MPATH_INFO_DISCOVERY_TIMEOUT
=
BIT
(4),
754
MPATH_INFO_DISCOVERY_RETRIES
=
BIT
(5),
755
MPATH_INFO_FLAGS
=
BIT
(6),
756
};
757
776
struct
mpath_info
{
777
u32
filled
;
778
u32
frame_qlen
;
779
u32
sn
;
780
u32
metric
;
781
u32
exptime
;
782
u32
discovery_timeout
;
783
u8
discovery_retries
;
784
u8
flags
;
785
786
int
generation
;
787
};
788
807
struct
bss_parameters
{
808
int
use_cts_prot
;
809
int
use_short_preamble
;
810
int
use_short_slot_time
;
811
u8
*
basic_rates
;
812
u8
basic_rates_len
;
813
int
ap_isolate
;
814
int
ht_opmode
;
815
};
816
880
struct
mesh_config
{
881
u16
dot11MeshRetryTimeout
;
882
u16
dot11MeshConfirmTimeout
;
883
u16
dot11MeshHoldingTimeout
;
884
u16
dot11MeshMaxPeerLinks
;
885
u8
dot11MeshMaxRetries
;
886
u8
dot11MeshTTL
;
887
u8
element_ttl
;
888
bool
auto_open_plinks
;
889
u32
dot11MeshNbrOffsetMaxNeighbor
;
890
u8
dot11MeshHWMPmaxPREQretries
;
891
u32
path_refresh_time
;
892
u16
min_discovery_timeout
;
893
u32
dot11MeshHWMPactivePathTimeout
;
894
u16
dot11MeshHWMPpreqMinInterval
;
895
u16
dot11MeshHWMPperrMinInterval
;
896
u16
dot11MeshHWMPnetDiameterTraversalTime
;
897
u8
dot11MeshHWMPRootMode
;
898
u16
dot11MeshHWMPRannInterval
;
899
bool
dot11MeshGateAnnouncementProtocol
;
900
bool
dot11MeshForwarding
;
901
s32
rssi_threshold
;
902
u16
ht_opmode
;
903
u32
dot11MeshHWMPactivePathToRootTimeout
;
904
u16
dot11MeshHWMProotInterval
;
905
u16
dot11MeshHWMPconfirmationInterval
;
906
};
907
925
struct
mesh_setup
{
926
struct
ieee80211_channel
*
channel
;
927
enum
nl80211_channel_type
channel_type
;
928
const
u8
*
mesh_id
;
929
u8
mesh_id_len
;
930
u8
sync_method
;
931
u8
path_sel_proto
;
932
u8
path_metric
;
933
const
u8
*
ie
;
934
u8
ie_len
;
935
bool
is_authenticated
;
936
bool
is_secure
;
937
int
mcast_rate
[
IEEE80211_NUM_BANDS
];
938
};
939
950
struct
ieee80211_txq_params
{
951
enum
nl80211_ac
ac
;
952
u16
txop
;
953
u16
cwmin
;
954
u16
cwmax
;
955
u8
aifs
;
956
};
957
958
/* from net/wireless.h */
959
struct
wiphy
;
960
989
struct
cfg80211_ssid
{
990
u8
ssid
[
IEEE80211_MAX_SSID_LEN
];
991
u8
ssid_len
;
992
};
993
1009
struct
cfg80211_scan_request
{
1010
struct
cfg80211_ssid
*
ssids
;
1011
int
n_ssids
;
1012
u32
n_channels
;
1013
const
u8
*
ie
;
1014
size_t
ie_len
;
1015
1016
u32
rates
[
IEEE80211_NUM_BANDS
];
1017
1018
struct
wireless_dev
*
wdev
;
1019
1020
/* internal */
1021
struct
wiphy
*
wiphy
;
1022
bool
aborted
;
1023
bool
no_cck
;
1024
1025
/* keep last */
1026
struct
ieee80211_channel
*
channels
[0];
1027
};
1028
1034
struct
cfg80211_match_set
{
1035
struct
cfg80211_ssid
ssid
;
1036
};
1037
1057
struct
cfg80211_sched_scan_request
{
1058
struct
cfg80211_ssid
*
ssids
;
1059
int
n_ssids
;
1060
u32
n_channels
;
1061
u32
interval
;
1062
const
u8
*
ie
;
1063
size_t
ie_len
;
1064
struct
cfg80211_match_set
*
match_sets
;
1065
int
n_match_sets
;
1066
s32
rssi_thold
;
1067
1068
/* internal */
1069
struct
wiphy
*
wiphy
;
1070
struct
net_device
*
dev
;
1071
1072
/* keep last */
1073
struct
ieee80211_channel
*
channels
[0];
1074
};
1075
1083
enum
cfg80211_signal_type
{
1084
CFG80211_SIGNAL_TYPE_NONE
,
1085
CFG80211_SIGNAL_TYPE_MBM
,
1086
CFG80211_SIGNAL_TYPE_UNSPEC
,
1087
};
1088
1113
struct
cfg80211_bss
{
1114
struct
ieee80211_channel
*
channel
;
1115
1116
u8
bssid
[
ETH_ALEN
];
1117
u64
tsf
;
1118
u16
beacon_interval
;
1119
u16
capability
;
1120
u8
*
information_elements
;
1121
size_t
len_information_elements
;
1122
u8
*
beacon_ies
;
1123
size_t
len_beacon_ies
;
1124
u8
*
proberesp_ies
;
1125
size_t
len_proberesp_ies
;
1126
1127
s32
signal
;
1128
1129
void
(*
free_priv
)(
struct
cfg80211_bss
*bss);
1130
u8
priv
[0]
__attribute__
((__aligned__(
sizeof
(
void
*))));
1131
};
1132
1139
const
u8
*
ieee80211_bss_get_ie
(
struct
cfg80211_bss
*bss,
u8
ie);
1140
1141
1156
struct
cfg80211_auth_request
{
1157
struct
cfg80211_bss
*
bss
;
1158
const
u8
*
ie
;
1159
size_t
ie_len
;
1160
enum
nl80211_auth_type
auth_type
;
1161
const
u8
*
key
;
1162
u8
key_len
,
key_idx
;
1163
};
1164
1170
enum
cfg80211_assoc_req_flags
{
1171
ASSOC_REQ_DISABLE_HT
=
BIT
(0),
1172
};
1173
1194
struct
cfg80211_assoc_request
{
1195
struct
cfg80211_bss
*
bss
;
1196
const
u8
*
ie
, *
prev_bssid
;
1197
size_t
ie_len
;
1198
struct
cfg80211_crypto_settings
crypto
;
1199
bool
use_mfp
;
1200
u32
flags
;
1201
struct
ieee80211_ht_cap
ht_capa
;
1202
struct
ieee80211_ht_cap
ht_capa_mask
;
1203
};
1204
1216
struct
cfg80211_deauth_request
{
1217
const
u8
*
bssid
;
1218
const
u8
*
ie
;
1219
size_t
ie_len
;
1220
u16
reason_code
;
1221
bool
local_state_change
;
1222
};
1223
1237
struct
cfg80211_disassoc_request
{
1238
struct
cfg80211_bss
*
bss
;
1239
const
u8
*
ie
;
1240
size_t
ie_len
;
1241
u16
reason_code
;
1242
bool
local_state_change
;
1243
};
1244
1271
struct
cfg80211_ibss_params
{
1272
u8
*
ssid
;
1273
u8
*
bssid
;
1274
struct
ieee80211_channel
*
channel
;
1275
enum
nl80211_channel_type
channel_type
;
1276
u8
*
ie
;
1277
u8
ssid_len
,
ie_len
;
1278
u16
beacon_interval
;
1279
u32
basic_rates
;
1280
bool
channel_fixed
;
1281
bool
privacy
;
1282
bool
control_port
;
1283
int
mcast_rate
[
IEEE80211_NUM_BANDS
];
1284
};
1285
1313
struct
cfg80211_connect_params
{
1314
struct
ieee80211_channel
*
channel
;
1315
u8
*
bssid
;
1316
u8
*
ssid
;
1317
size_t
ssid_len
;
1318
enum
nl80211_auth_type
auth_type
;
1319
u8
*
ie
;
1320
size_t
ie_len
;
1321
bool
privacy
;
1322
struct
cfg80211_crypto_settings
crypto
;
1323
const
u8
*
key
;
1324
u8
key_len
,
key_idx
;
1325
u32
flags
;
1326
int
bg_scan_period
;
1327
struct
ieee80211_ht_cap
ht_capa
;
1328
struct
ieee80211_ht_cap
ht_capa_mask
;
1329
};
1330
1339
enum
wiphy_params_flags
{
1340
WIPHY_PARAM_RETRY_SHORT
= 1 << 0,
1341
WIPHY_PARAM_RETRY_LONG
= 1 << 1,
1342
WIPHY_PARAM_FRAG_THRESHOLD
= 1 << 2,
1343
WIPHY_PARAM_RTS_THRESHOLD
= 1 << 3,
1344
WIPHY_PARAM_COVERAGE_CLASS
= 1 << 4,
1345
};
1346
1347
/*
1348
* cfg80211_bitrate_mask - masks for bitrate control
1349
*/
1350
struct
cfg80211_bitrate_mask
{
1351
struct
{
1352
u32
legacy
;
1353
u8
mcs
[
IEEE80211_HT_MCS_MASK_LEN
];
1354
}
control
[
IEEE80211_NUM_BANDS
];
1355
};
1365
struct
cfg80211_pmksa
{
1366
u8
*
bssid
;
1367
u8
*
pmkid
;
1368
};
1369
1380
struct
cfg80211_wowlan_trig_pkt_pattern
{
1381
u8
*
mask
, *
pattern
;
1382
int
pattern_len
;
1383
};
1384
1400
struct
cfg80211_wowlan
{
1401
bool
any
,
disconnect
,
magic_pkt
,
gtk_rekey_failure
,
1402
eap_identity_req
,
four_way_handshake
,
1403
rfkill_release
;
1404
struct
cfg80211_wowlan_trig_pkt_pattern
*
patterns
;
1405
int
n_patterns
;
1406
};
1407
1414
struct
cfg80211_gtk_rekey_data
{
1415
u8
kek
[
NL80211_KEK_LEN
];
1416
u8
kck
[
NL80211_KCK_LEN
];
1417
u8
replay_ctr
[
NL80211_REPLAY_CTR_LEN
];
1418
};
1419
1626
struct
cfg80211_ops
{
1627
int
(*
suspend
)(
struct
wiphy
*
wiphy
,
struct
cfg80211_wowlan
*wow);
1628
int
(*
resume
)(
struct
wiphy
*
wiphy
);
1629
void
(*
set_wakeup
)(
struct
wiphy
*
wiphy
,
bool
enabled
);
1630
1631
struct
wireless_dev
* (*add_virtual_intf)(
struct
wiphy
*
wiphy
,
1632
const
char
*
name
,
1633
enum
nl80211_iftype
type
,
1634
u32
*
flags
,
1635
struct
vif_params
*
params
);
1636
int
(*
del_virtual_intf
)(
struct
wiphy
*
wiphy
,
1637
struct
wireless_dev
*wdev);
1638
int
(*
change_virtual_intf
)(
struct
wiphy
*
wiphy
,
1639
struct
net_device
*
dev
,
1640
enum
nl80211_iftype
type
,
u32
*
flags
,
1641
struct
vif_params
*
params
);
1642
1643
int
(*
add_key
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev,
1644
u8
key_index
,
bool
pairwise,
const
u8
*
mac_addr
,
1645
struct
key_params
*
params
);
1646
int
(*
get_key
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev,
1647
u8
key_index
,
bool
pairwise,
const
u8
*
mac_addr
,
1648
void
*
cookie
,
1649
void
(*
callback
)(
void
*
cookie
,
struct
key_params
*));
1650
int
(*
del_key
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev,
1651
u8
key_index
,
bool
pairwise,
const
u8
*
mac_addr
);
1652
int
(*
set_default_key
)(
struct
wiphy
*
wiphy
,
1653
struct
net_device
*netdev,
1654
u8
key_index
,
bool
unicast,
bool
multicast);
1655
int
(*
set_default_mgmt_key
)(
struct
wiphy
*
wiphy
,
1656
struct
net_device
*netdev,
1657
u8
key_index
);
1658
1659
int
(*
start_ap
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1660
struct
cfg80211_ap_settings
*settings);
1661
int
(*
change_beacon
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1662
struct
cfg80211_beacon_data
*
info
);
1663
int
(*
stop_ap
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
);
1664
1665
1666
int
(*
add_station
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1667
u8
*
mac
,
struct
station_parameters
*
params
);
1668
int
(*
del_station
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1669
u8
*
mac
);
1670
int
(*
change_station
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1671
u8
*
mac
,
struct
station_parameters
*
params
);
1672
int
(*
get_station
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1673
u8
*
mac
,
struct
station_info
*
sinfo
);
1674
int
(*
dump_station
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1675
int
idx
,
u8
*
mac
,
struct
station_info
*
sinfo
);
1676
1677
int
(*
add_mpath
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1678
u8
*
dst
,
u8
*next_hop);
1679
int
(*
del_mpath
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1680
u8
*
dst
);
1681
int
(*
change_mpath
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1682
u8
*
dst
,
u8
*next_hop);
1683
int
(*
get_mpath
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1684
u8
*
dst
,
u8
*next_hop,
1685
struct
mpath_info
*
pinfo
);
1686
int
(*
dump_mpath
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1687
int
idx
,
u8
*
dst
,
u8
*next_hop,
1688
struct
mpath_info
*
pinfo
);
1689
int
(*
get_mesh_config
)(
struct
wiphy
*
wiphy
,
1690
struct
net_device
*
dev
,
1691
struct
mesh_config
*conf);
1692
int
(*
update_mesh_config
)(
struct
wiphy
*
wiphy
,
1693
struct
net_device
*
dev
,
u32
mask
,
1694
const
struct
mesh_config
*nconf);
1695
int
(*
join_mesh
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1696
const
struct
mesh_config
*conf,
1697
const
struct
mesh_setup
*
setup
);
1698
int
(*
leave_mesh
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
);
1699
1700
int
(*
change_bss
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1701
struct
bss_parameters
*
params
);
1702
1703
int
(*
set_txq_params
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1704
struct
ieee80211_txq_params
*
params
);
1705
1706
int
(*
libertas_set_mesh_channel
)(
struct
wiphy
*
wiphy
,
1707
struct
net_device
*
dev
,
1708
struct
ieee80211_channel
*
chan
);
1709
1710
int
(*
set_monitor_channel
)(
struct
wiphy
*
wiphy
,
1711
struct
ieee80211_channel
*
chan
,
1712
enum
nl80211_channel_type
channel_type
);
1713
1714
int
(*
scan
)(
struct
wiphy
*
wiphy
,
1715
struct
cfg80211_scan_request
*
request
);
1716
1717
int
(*
auth
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1718
struct
cfg80211_auth_request
*
req
);
1719
int
(*
assoc
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1720
struct
cfg80211_assoc_request
*
req
);
1721
int
(*
deauth
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1722
struct
cfg80211_deauth_request
*
req
);
1723
int
(*
disassoc
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1724
struct
cfg80211_disassoc_request
*
req
);
1725
1726
int
(*
connect
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1727
struct
cfg80211_connect_params
*sme);
1728
int
(*
disconnect
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1729
u16
reason_code
);
1730
1731
int
(*
join_ibss
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1732
struct
cfg80211_ibss_params
*
params
);
1733
int
(*
leave_ibss
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
);
1734
1735
int
(*
set_wiphy_params
)(
struct
wiphy
*
wiphy
,
u32
changed
);
1736
1737
int
(*
set_tx_power
)(
struct
wiphy
*
wiphy
,
1738
enum
nl80211_tx_power_setting
type
,
int
mbm);
1739
int
(*
get_tx_power
)(
struct
wiphy
*
wiphy
,
int
*
dbm
);
1740
1741
int
(*
set_wds_peer
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1742
const
u8
*
addr
);
1743
1744
void
(*
rfkill_poll
)(
struct
wiphy
*
wiphy
);
1745
1746
#ifdef CONFIG_NL80211_TESTMODE
1747
int
(*testmode_cmd)(
struct
wiphy
*
wiphy
,
void
*
data
,
int
len
);
1748
int
(*testmode_dump)(
struct
wiphy
*
wiphy
,
struct
sk_buff
*
skb
,
1749
struct
netlink_callback
*
cb
,
1750
void
*
data
,
int
len
);
1751
#endif
1752
1753
int
(*
set_bitrate_mask
)(
struct
wiphy
*
wiphy
,
1754
struct
net_device
*
dev
,
1755
const
u8
*peer,
1756
const
struct
cfg80211_bitrate_mask
*
mask
);
1757
1758
int
(*
dump_survey
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev,
1759
int
idx
,
struct
survey_info
*
info
);
1760
1761
int
(*
set_pmksa
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev,
1762
struct
cfg80211_pmksa
*pmksa);
1763
int
(*
del_pmksa
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev,
1764
struct
cfg80211_pmksa
*pmksa);
1765
int
(*
flush_pmksa
)(
struct
wiphy
*
wiphy
,
struct
net_device
*netdev);
1766
1767
int
(*
remain_on_channel
)(
struct
wiphy
*
wiphy
,
1768
struct
wireless_dev
*wdev,
1769
struct
ieee80211_channel
*
chan
,
1770
enum
nl80211_channel_type
channel_type
,
1771
unsigned
int
duration
,
1772
u64
*
cookie
);
1773
int
(*
cancel_remain_on_channel
)(
struct
wiphy
*
wiphy
,
1774
struct
wireless_dev
*wdev,
1775
u64
cookie
);
1776
1777
int
(*
mgmt_tx
)(
struct
wiphy
*
wiphy
,
struct
wireless_dev
*wdev,
1778
struct
ieee80211_channel
*
chan
,
bool
offchan,
1779
enum
nl80211_channel_type
channel_type
,
1780
bool
channel_type_valid,
unsigned
int
wait
,
1781
const
u8
*
buf
,
size_t
len
,
bool
no_cck,
1782
bool
dont_wait_for_ack,
u64
*
cookie
);
1783
int
(*
mgmt_tx_cancel_wait
)(
struct
wiphy
*
wiphy
,
1784
struct
wireless_dev
*wdev,
1785
u64
cookie
);
1786
1787
int
(*
set_power_mgmt
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1788
bool
enabled
,
int
timeout
);
1789
1790
int
(*
set_cqm_rssi_config
)(
struct
wiphy
*
wiphy
,
1791
struct
net_device
*
dev
,
1792
s32
rssi_thold,
u32
rssi_hyst);
1793
1794
int
(*
set_cqm_txe_config
)(
struct
wiphy
*
wiphy
,
1795
struct
net_device
*
dev
,
1796
u32
rate
,
u32
pkts,
u32
intvl);
1797
1798
void
(*
mgmt_frame_register
)(
struct
wiphy
*
wiphy
,
1799
struct
wireless_dev
*wdev,
1800
u16
frame_type
,
bool
reg
);
1801
1802
int
(*
set_antenna
)(
struct
wiphy
*
wiphy
,
u32
tx_ant,
u32
rx_ant);
1803
int
(*
get_antenna
)(
struct
wiphy
*
wiphy
,
u32
*tx_ant,
u32
*rx_ant);
1804
1805
int
(*
set_ringparam
)(
struct
wiphy
*
wiphy
,
u32
tx
,
u32
rx
);
1806
void
(*
get_ringparam
)(
struct
wiphy
*
wiphy
,
1807
u32
*
tx
,
u32
*tx_max,
u32
*
rx
,
u32
*rx_max);
1808
1809
int
(*
sched_scan_start
)(
struct
wiphy
*
wiphy
,
1810
struct
net_device
*
dev
,
1811
struct
cfg80211_sched_scan_request
*
request
);
1812
int
(*
sched_scan_stop
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
);
1813
1814
int
(*
set_rekey_data
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1815
struct
cfg80211_gtk_rekey_data
*
data
);
1816
1817
int
(*
tdls_mgmt
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1818
u8
*peer,
u8
action_code
,
u8
dialog_token
,
1819
u16
status_code
,
const
u8
*
buf
,
size_t
len
);
1820
int
(*
tdls_oper
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1821
u8
*peer,
enum
nl80211_tdls_operation
oper);
1822
1823
int
(*
probe_client
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1824
const
u8
*peer,
u64
*
cookie
);
1825
1826
int
(*
set_noack_map
)(
struct
wiphy
*
wiphy
,
1827
struct
net_device
*
dev
,
1828
u16
noack_map);
1829
1830
int
(*
get_et_sset_count
)(
struct
wiphy
*
wiphy
,
1831
struct
net_device
*
dev
,
int
sset);
1832
void
(*
get_et_stats
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1833
struct
ethtool_stats
*
stats
,
u64
*
data
);
1834
void
(*
get_et_strings
)(
struct
wiphy
*
wiphy
,
struct
net_device
*
dev
,
1835
u32
sset,
u8
*
data
);
1836
1837
struct
ieee80211_channel
*
1838
(*get_channel)(
struct
wiphy
*
wiphy
,
1839
struct
wireless_dev
*wdev,
1840
enum
nl80211_channel_type
*
type
);
1841
1842
int
(*
start_p2p_device
)(
struct
wiphy
*
wiphy
,
1843
struct
wireless_dev
*wdev);
1844
void
(*
stop_p2p_device
)(
struct
wiphy
*
wiphy
,
1845
struct
wireless_dev
*wdev);
1846
};
1847
1848
/*
1849
* wireless hardware and networking interfaces structures
1850
* and registration/helper functions
1851
*/
1852
1911
enum
wiphy_flags
{
1912
WIPHY_FLAG_CUSTOM_REGULATORY
=
BIT
(0),
1913
WIPHY_FLAG_STRICT_REGULATORY
=
BIT
(1),
1914
WIPHY_FLAG_DISABLE_BEACON_HINTS
=
BIT
(2),
1915
WIPHY_FLAG_NETNS_OK
=
BIT
(3),
1916
WIPHY_FLAG_PS_ON_BY_DEFAULT
=
BIT
(4),
1917
WIPHY_FLAG_4ADDR_AP
=
BIT
(5),
1918
WIPHY_FLAG_4ADDR_STATION
=
BIT
(6),
1919
WIPHY_FLAG_CONTROL_PORT_PROTOCOL
=
BIT
(7),
1920
WIPHY_FLAG_IBSS_RSN
=
BIT
(8),
1921
WIPHY_FLAG_MESH_AUTH
=
BIT
(10),
1922
WIPHY_FLAG_SUPPORTS_SCHED_SCAN
=
BIT
(11),
1923
/* use hole at 12 */
1924
WIPHY_FLAG_SUPPORTS_FW_ROAM
=
BIT
(13),
1925
WIPHY_FLAG_AP_UAPSD
=
BIT
(14),
1926
WIPHY_FLAG_SUPPORTS_TDLS
=
BIT
(15),
1927
WIPHY_FLAG_TDLS_EXTERNAL_SETUP
=
BIT
(16),
1928
WIPHY_FLAG_HAVE_AP_SME
=
BIT
(17),
1929
WIPHY_FLAG_REPORTS_OBSS
=
BIT
(18),
1930
WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD
=
BIT
(19),
1931
WIPHY_FLAG_OFFCHAN_TX
=
BIT
(20),
1932
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL
=
BIT
(21),
1933
};
1934
1940
struct
ieee80211_iface_limit
{
1941
u16
max
;
1942
u16
types
;
1943
};
1944
2001
struct
ieee80211_iface_combination
{
2002
const
struct
ieee80211_iface_limit
*
limits
;
2003
u32
num_different_channels
;
2004
u16
max_interfaces
;
2005
u8
n_limits
;
2006
bool
beacon_int_infra_match
;
2007
};
2008
2009
struct
mac_address
{
2010
u8
addr
[
ETH_ALEN
];
2011
};
2012
2013
struct
ieee80211_txrx_stypes
{
2014
u16
tx
,
rx
;
2015
};
2016
2033
enum
wiphy_wowlan_support_flags
{
2034
WIPHY_WOWLAN_ANY
=
BIT
(0),
2035
WIPHY_WOWLAN_MAGIC_PKT
=
BIT
(1),
2036
WIPHY_WOWLAN_DISCONNECT
=
BIT
(2),
2037
WIPHY_WOWLAN_SUPPORTS_GTK_REKEY
=
BIT
(3),
2038
WIPHY_WOWLAN_GTK_REKEY_FAILURE
=
BIT
(4),
2039
WIPHY_WOWLAN_EAP_IDENTITY_REQ
=
BIT
(5),
2040
WIPHY_WOWLAN_4WAY_HANDSHAKE
=
BIT
(6),
2041
WIPHY_WOWLAN_RFKILL_RELEASE
=
BIT
(7),
2042
};
2043
2052
struct
wiphy_wowlan_support
{
2053
u32
flags
;
2054
int
n_patterns
;
2055
int
pattern_max_len
;
2056
int
pattern_min_len
;
2057
};
2058
2154
struct
wiphy
{
2155
/* assign these fields before you register the wiphy */
2156
2157
/* permanent MAC address(es) */
2158
u8
perm_addr
[
ETH_ALEN
];
2159
u8
addr_mask
[
ETH_ALEN
];
2160
2161
struct
mac_address
*
addresses
;
2162
2163
const
struct
ieee80211_txrx_stypes
*
mgmt_stypes
;
2164
2165
const
struct
ieee80211_iface_combination
*
iface_combinations
;
2166
int
n_iface_combinations
;
2167
u16
software_iftypes
;
2168
2169
u16
n_addresses
;
2170
2171
/* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
2172
u16
interface_modes
;
2173
2174
u32
flags
,
features
;
2175
2176
u32
ap_sme_capa
;
2177
2178
enum
cfg80211_signal_type
signal_type
;
2179
2180
int
bss_priv_size
;
2181
u8
max_scan_ssids
;
2182
u8
max_sched_scan_ssids
;
2183
u8
max_match_sets
;
2184
u16
max_scan_ie_len
;
2185
u16
max_sched_scan_ie_len
;
2186
2187
int
n_cipher_suites
;
2188
const
u32
*
cipher_suites
;
2189
2190
u8
retry_short
;
2191
u8
retry_long
;
2192
u32
frag_threshold
;
2193
u32
rts_threshold
;
2194
u8
coverage_class
;
2195
2196
char
fw_version
[
ETHTOOL_BUSINFO_LEN
];
2197
u32
hw_version
;
2198
2199
#ifdef CONFIG_PM
2200
struct
wiphy_wowlan_support
wowlan;
2201
#endif
2202
2203
u16
max_remain_on_channel_duration
;
2204
2205
u8
max_num_pmkids
;
2206
2207
u32
available_antennas_tx
;
2208
u32
available_antennas_rx
;
2209
2210
/*
2211
* Bitmap of supported protocols for probe response offloading
2212
* see &enum nl80211_probe_resp_offload_support_attr. Only valid
2213
* when the wiphy flag @WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD is set.
2214
*/
2215
u32
probe_resp_offload
;
2216
2217
/* If multiple wiphys are registered and you're handed e.g.
2218
* a regular netdev with assigned ieee80211_ptr, you won't
2219
* know whether it points to a wiphy your driver has registered
2220
* or not. Assign this to something global to your driver to
2221
* help determine whether you own this wiphy or not. */
2222
const
void
*
privid
;
2223
2224
struct
ieee80211_supported_band
*
bands
[
IEEE80211_NUM_BANDS
];
2225
2226
/* Lets us get back the wiphy on the callback */
2227
int
(*
reg_notifier
)(
struct
wiphy
*
wiphy
,
2228
struct
regulatory_request
*
request
);
2229
2230
/* fields below are read-only, assigned by cfg80211 */
2231
2232
const
struct
ieee80211_regdomain
*
regd
;
2233
2234
/* the item in /sys/class/ieee80211/ points to this,
2235
* you need use set_wiphy_dev() (see below) */
2236
struct
device
dev
;
2237
2238
/* protects ->resume, ->suspend sysfs callbacks against unregister hw */
2239
bool
registered
;
2240
2241
/* dir in debugfs: ieee80211/<wiphyname> */
2242
struct
dentry
*
debugfsdir
;
2243
2244
const
struct
ieee80211_ht_cap
*
ht_capa_mod_mask
;
2245
2246
#ifdef CONFIG_NET_NS
2247
/* the network namespace this phy lives in currently */
2248
struct
net
*
_net
;
2249
#endif
2250
2251
#ifdef CONFIG_CFG80211_WEXT
2252
const
struct
iw_handler_def
*wext;
2253
#endif
2254
2255
char
priv
[0]
__attribute__
((__aligned__(
NETDEV_ALIGN
)));
2256
};
2257
2258
static
inline
struct
net
*wiphy_net(
struct
wiphy
*
wiphy
)
2259
{
2260
return
read_pnet
(&wiphy->_net);
2261
}
2262
2263
static
inline
void
wiphy_net_set(
struct
wiphy
*
wiphy
,
struct
net
*
net
)
2264
{
2265
write_pnet
(&wiphy->_net, net);
2266
}
2267
2273
static
inline
void
*wiphy_priv(
struct
wiphy
*
wiphy
)
2274
{
2275
BUG_ON
(!wiphy);
2276
return
&wiphy->priv;
2277
}
2278
2284
static
inline
struct
wiphy
*priv_to_wiphy(
void
*
priv
)
2285
{
2286
BUG_ON
(!priv);
2287
return
container_of
(priv,
struct
wiphy
, priv);
2288
}
2289
2296
static
inline
void
set_wiphy_dev(
struct
wiphy
*
wiphy
,
struct
device
*
dev
)
2297
{
2298
wiphy->
dev
.parent =
dev
;
2299
}
2300
2306
static
inline
struct
device
*wiphy_dev(
struct
wiphy
*
wiphy
)
2307
{
2308
return
wiphy->
dev
.parent;
2309
}
2310
2316
static
inline
const
char
*wiphy_name(
const
struct
wiphy
*
wiphy
)
2317
{
2318
return
dev_name(&wiphy->
dev
);
2319
}
2320
2333
struct
wiphy
*
wiphy_new
(
const
struct
cfg80211_ops
*ops,
int
sizeof_priv);
2334
2342
extern
int
wiphy_register
(
struct
wiphy
*
wiphy
);
2343
2353
extern
void
wiphy_unregister
(
struct
wiphy
*
wiphy
);
2354
2360
extern
void
wiphy_free
(
struct
wiphy
*
wiphy
);
2361
2362
/* internal structs */
2363
struct
cfg80211_conn
;
2364
struct
cfg80211_internal_bss
;
2365
struct
cfg80211_cached_keys
;
2366
2412
struct
wireless_dev
{
2413
struct
wiphy
*
wiphy
;
2414
enum
nl80211_iftype
iftype
;
2415
2416
/* the remainder of this struct should be private to cfg80211 */
2417
struct
list_head
list
;
2418
struct
net_device
*
netdev
;
2419
2420
u32
identifier
;
2421
2422
struct
list_head
mgmt_registrations
;
2423
spinlock_t
mgmt_registrations_lock
;
2424
2425
struct
mutex
mtx
;
2426
2427
struct
work_struct
cleanup_work
;
2428
2429
bool
use_4addr
,
p2p_started
;
2430
2431
u8
address
[
ETH_ALEN
]
__aligned
(
sizeof
(
u16
));
2432
2433
/* currently used for IBSS and SME - might be rearranged later */
2434
u8
ssid
[
IEEE80211_MAX_SSID_LEN
];
2435
u8
ssid_len
,
mesh_id_len
,
mesh_id_up_len
;
2436
enum
{
2437
CFG80211_SME_IDLE
,
2438
CFG80211_SME_CONNECTING
,
2439
CFG80211_SME_CONNECTED
,
2440
}
sme_state
;
2441
struct
cfg80211_conn
*
conn
;
2442
struct
cfg80211_cached_keys
*
connect_keys
;
2443
2444
struct
list_head
event_list
;
2445
spinlock_t
event_lock
;
2446
2447
struct
cfg80211_internal_bss
*
current_bss
;
/* associated / joined */
2448
struct
ieee80211_channel
*
preset_chan
;
2449
enum
nl80211_channel_type
preset_chantype
;
2450
2451
/* for AP and mesh channel tracking */
2452
struct
ieee80211_channel
*
channel
;
2453
2454
bool
ibss_fixed
;
2455
2456
bool
ps
;
2457
int
ps_timeout
;
2458
2459
int
beacon_interval
;
2460
2461
u32
ap_unexpected_nlportid
;
2462
2463
#ifdef CONFIG_CFG80211_WEXT
2464
/* wext data */
2465
struct
{
2466
struct
cfg80211_ibss_params
ibss;
2467
struct
cfg80211_connect_params
connect;
2468
struct
cfg80211_cached_keys
*
keys
;
2469
u8
*ie;
2470
size_t
ie_len
;
2471
u8
bssid
[
ETH_ALEN
], prev_bssid[
ETH_ALEN
];
2472
u8
ssid
[
IEEE80211_MAX_SSID_LEN
];
2473
s8
default_key, default_mgmt_key;
2474
bool
prev_bssid_valid;
2475
} wext;
2476
#endif
2477
};
2478
2479
static
inline
u8
*wdev_address(
struct
wireless_dev
*wdev)
2480
{
2481
if
(wdev->
netdev
)
2482
return
wdev->
netdev
->dev_addr;
2483
return
wdev->address;
2484
}
2485
2491
static
inline
void
*wdev_priv(
struct
wireless_dev
*wdev)
2492
{
2493
BUG_ON
(!wdev);
2494
return
wiphy_priv(wdev->
wiphy
);
2495
}
2496
2508
extern
int
ieee80211_channel_to_frequency
(
int
chan
,
enum
ieee80211_band
band);
2509
2514
extern
int
ieee80211_frequency_to_channel
(
int
freq
);
2515
2516
/*
2517
* Name indirection necessary because the ieee80211 code also has
2518
* a function named "ieee80211_get_channel", so if you include
2519
* cfg80211's header file you get cfg80211's version, if you try
2520
* to include both header files you'll (rightfully!) get a symbol
2521
* clash.
2522
*/
2523
extern
struct
ieee80211_channel
*
__ieee80211_get_channel
(
struct
wiphy
*
wiphy
,
2524
int
freq
);
2530
static
inline
struct
ieee80211_channel
*
2531
ieee80211_get_channel(
struct
wiphy
*
wiphy
,
int
freq
)
2532
{
2533
return
__ieee80211_get_channel
(wiphy, freq);
2534
}
2535
2548
struct
ieee80211_rate
*
2549
ieee80211_get_response_rate
(
struct
ieee80211_supported_band
*sband,
2550
u32
basic_rates,
int
bitrate
);
2551
2552
/*
2553
* Radiotap parsing functions -- for controlled injection support
2554
*
2555
* Implemented in net/wireless/radiotap.c
2556
* Documentation in Documentation/networking/radiotap-headers.txt
2557
*/
2558
2559
struct
radiotap_align_size
{
2560
uint8_t
align
:4,
size
:4;
2561
};
2562
2563
struct
ieee80211_radiotap_namespace
{
2564
const
struct
radiotap_align_size
*
align_size
;
2565
int
n_bits
;
2566
uint32_t
oui
;
2567
uint8_t
subns
;
2568
};
2569
2570
struct
ieee80211_radiotap_vendor_namespaces
{
2571
const
struct
ieee80211_radiotap_namespace
*
ns
;
2572
int
n_ns
;
2573
};
2574
2604
struct
ieee80211_radiotap_iterator
{
2605
struct
ieee80211_radiotap_header
*
_rtheader
;
2606
const
struct
ieee80211_radiotap_vendor_namespaces
*
_vns
;
2607
const
struct
ieee80211_radiotap_namespace
*
current_namespace
;
2608
2609
unsigned
char
*
_arg
, *
_next_ns_data
;
2610
__le32
*
_next_bitmap
;
2611
2612
unsigned
char
*
this_arg
;
2613
int
this_arg_index
;
2614
int
this_arg_size
;
2615
2616
int
is_radiotap_ns
;
2617
2618
int
_max_length
;
2619
int
_arg_index
;
2620
uint32_t
_bitmap_shifter
;
2621
int
_reset_on_ext
;
2622
};
2623
2624
extern
int
ieee80211_radiotap_iterator_init
(
2625
struct
ieee80211_radiotap_iterator
*iterator,
2626
struct
ieee80211_radiotap_header
*radiotap_header,
2627
int
max_length,
const
struct
ieee80211_radiotap_vendor_namespaces
*vns);
2628
2629
extern
int
ieee80211_radiotap_iterator_next
(
2630
struct
ieee80211_radiotap_iterator
*iterator);
2631
2632
2633
extern
const
unsigned
char
rfc1042_header
[6];
2634
extern
const
unsigned
char
bridge_tunnel_header
[6];
2635
2646
unsigned
int
ieee80211_get_hdrlen_from_skb
(
const
struct
sk_buff
*
skb
);
2647
2652
unsigned
int
__attribute_const__
ieee80211_hdrlen
(
__le16
fc
);
2653
2661
unsigned
int
ieee80211_get_mesh_hdrlen
(
struct
ieee80211s_hdr
*meshhdr);
2662
2677
int
ieee80211_data_to_8023
(
struct
sk_buff
*
skb
,
const
u8
*
addr
,
2678
enum
nl80211_iftype
iftype
);
2679
2688
int
ieee80211_data_from_8023
(
struct
sk_buff
*
skb
,
const
u8
*
addr
,
2689
enum
nl80211_iftype
iftype
,
u8
*
bssid
,
bool
qos);
2690
2706
void
ieee80211_amsdu_to_8023s
(
struct
sk_buff
*
skb
,
struct
sk_buff_head
*
list
,
2707
const
u8
*
addr
,
enum
nl80211_iftype
iftype
,
2708
const
unsigned
int
extra_headroom,
2709
bool
has_80211_header);
2710
2715
unsigned
int
cfg80211_classify8021d
(
struct
sk_buff
*
skb
);
2716
2731
const
u8
*
cfg80211_find_ie
(
u8
eid,
const
u8
*ies,
int
len);
2732
2748
const
u8
*
cfg80211_find_vendor_ie
(
unsigned
int
oui
,
u8
oui_type,
2749
const
u8
*ies,
int
len);
2750
2780
extern
int
regulatory_hint
(
struct
wiphy
*
wiphy
,
const
char
*alpha2);
2781
2794
extern
void
wiphy_apply_custom_regulatory
(
2795
struct
wiphy
*
wiphy
,
2796
const
struct
ieee80211_regdomain
*regd);
2797
2820
extern
int
freq_reg_info
(
struct
wiphy
*
wiphy
,
2821
u32
center_freq,
2822
u32
desired_bw_khz,
2823
const
struct
ieee80211_reg_rule
**reg_rule);
2824
2825
/*
2826
* callbacks for asynchronous cfg80211 methods, notification
2827
* functions and BSS handling helpers
2828
*/
2829
2837
void
cfg80211_scan_done
(
struct
cfg80211_scan_request
*
request
,
bool
aborted
);
2838
2844
void
cfg80211_sched_scan_results
(
struct
wiphy
*
wiphy
);
2845
2855
void
cfg80211_sched_scan_stopped
(
struct
wiphy
*
wiphy
);
2856
2872
struct
cfg80211_bss
*
__must_check
2873
cfg80211_inform_bss_frame
(
struct
wiphy
*
wiphy
,
2874
struct
ieee80211_channel
*
channel
,
2875
struct
ieee80211_mgmt
*
mgmt
,
size_t
len,
2876
s32
signal
,
gfp_t
gfp);
2877
2897
struct
cfg80211_bss
*
__must_check
2898
cfg80211_inform_bss
(
struct
wiphy
*
wiphy
,
2899
struct
ieee80211_channel
*
channel
,
2900
const
u8
*
bssid
,
u64
tsf
,
u16
capability
,
2901
u16
beacon_interval
,
const
u8
*ie,
size_t
ielen,
2902
s32
signal
,
gfp_t
gfp);
2903
2904
struct
cfg80211_bss
*
cfg80211_get_bss
(
struct
wiphy
*
wiphy
,
2905
struct
ieee80211_channel
*
channel
,
2906
const
u8
*
bssid
,
2907
const
u8
*
ssid
,
size_t
ssid_len,
2908
u16
capa_mask,
u16
capa_val);
2909
static
inline
struct
cfg80211_bss
*
2910
cfg80211_get_ibss(
struct
wiphy
*
wiphy
,
2911
struct
ieee80211_channel
*
channel
,
2912
const
u8
*
ssid
,
size_t
ssid_len)
2913
{
2914
return
cfg80211_get_bss
(wiphy, channel,
NULL
, ssid, ssid_len,
2915
WLAN_CAPABILITY_IBSS
,
WLAN_CAPABILITY_IBSS
);
2916
}
2917
2918
struct
cfg80211_bss
*
cfg80211_get_mesh
(
struct
wiphy
*
wiphy
,
2919
struct
ieee80211_channel
*
channel
,
2920
const
u8
*meshid,
size_t
meshidlen,
2921
const
u8
*meshcfg);
2928
void
cfg80211_ref_bss
(
struct
cfg80211_bss
*bss);
2929
2936
void
cfg80211_put_bss
(
struct
cfg80211_bss
*bss);
2937
2948
void
cfg80211_unlink_bss
(
struct
wiphy
*
wiphy
,
struct
cfg80211_bss
*bss);
2949
2961
void
cfg80211_send_rx_auth
(
struct
net_device
*
dev
,
const
u8
*
buf
,
size_t
len);
2962
2970
void
cfg80211_send_auth_timeout
(
struct
net_device
*
dev
,
const
u8
*
addr
);
2971
2985
void
cfg80211_send_rx_assoc
(
struct
net_device
*
dev
,
struct
cfg80211_bss
*bss,
2986
const
u8
*
buf
,
size_t
len);
2987
2995
void
cfg80211_send_assoc_timeout
(
struct
net_device
*
dev
,
const
u8
*
addr
);
2996
3007
void
cfg80211_send_deauth
(
struct
net_device
*
dev
,
const
u8
*
buf
,
size_t
len);
3008
3017
void
__cfg80211_send_deauth
(
struct
net_device
*
dev
,
const
u8
*
buf
,
size_t
len);
3018
3029
void
cfg80211_send_disassoc
(
struct
net_device
*
dev
,
const
u8
*
buf
,
size_t
len);
3030
3039
void
__cfg80211_send_disassoc
(
struct
net_device
*
dev
,
const
u8
*
buf
,
3040
size_t
len);
3041
3052
void
cfg80211_send_unprot_deauth
(
struct
net_device
*
dev
,
const
u8
*
buf
,
3053
size_t
len);
3054
3065
void
cfg80211_send_unprot_disassoc
(
struct
net_device
*
dev
,
const
u8
*
buf
,
3066
size_t
len);
3067
3081
void
cfg80211_michael_mic_failure
(
struct
net_device
*
dev
,
const
u8
*
addr
,
3082
enum
nl80211_key_type
key_type,
int
key_id
,
3083
const
u8
*
tsc
,
gfp_t
gfp);
3084
3099
void
cfg80211_ibss_joined
(
struct
net_device
*
dev
,
const
u8
*
bssid
,
gfp_t
gfp);
3100
3114
void
cfg80211_notify_new_peer_candidate
(
struct
net_device
*
dev
,
3115
const
u8
*
macaddr
,
const
u8
*ie,
u8
ie_len
,
gfp_t
gfp);
3116
3136
void
wiphy_rfkill_set_hw_state
(
struct
wiphy
*
wiphy
,
bool
blocked);
3137
3142
void
wiphy_rfkill_start_polling
(
struct
wiphy
*
wiphy
);
3143
3148
void
wiphy_rfkill_stop_polling
(
struct
wiphy
*
wiphy
);
3149
3150
#ifdef CONFIG_NL80211_TESTMODE
3151
3183
struct
sk_buff
*cfg80211_testmode_alloc_reply_skb(
struct
wiphy
*
wiphy
,
3184
int
approxlen);
3185
3197
int
cfg80211_testmode_reply(
struct
sk_buff
*
skb
);
3198
3218
struct
sk_buff
*cfg80211_testmode_alloc_event_skb(
struct
wiphy
*
wiphy
,
3219
int
approxlen,
gfp_t
gfp);
3220
3231
void
cfg80211_testmode_event(
struct
sk_buff
*
skb
,
gfp_t
gfp);
3232
3233
#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
3234
#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
3235
#else
3236
#define CFG80211_TESTMODE_CMD(cmd)
3237
#define CFG80211_TESTMODE_DUMP(cmd)
3238
#endif
3239
3257
void
cfg80211_connect_result
(
struct
net_device
*
dev
,
const
u8
*
bssid
,
3258
const
u8
*req_ie,
size_t
req_ie_len,
3259
const
u8
*resp_ie,
size_t
resp_ie_len,
3260
u16
status
,
gfp_t
gfp);
3261
3277
void
cfg80211_roamed
(
struct
net_device
*
dev
,
3278
struct
ieee80211_channel
*
channel
,
3279
const
u8
*
bssid
,
3280
const
u8
*req_ie,
size_t
req_ie_len,
3281
const
u8
*resp_ie,
size_t
resp_ie_len,
gfp_t
gfp);
3282
3305
void
cfg80211_roamed_bss
(
struct
net_device
*
dev
,
struct
cfg80211_bss
*bss,
3306
const
u8
*req_ie,
size_t
req_ie_len,
3307
const
u8
*resp_ie,
size_t
resp_ie_len,
gfp_t
gfp);
3308
3321
void
cfg80211_disconnected
(
struct
net_device
*
dev
,
u16
reason
,
3322
u8
*ie,
size_t
ie_len
,
gfp_t
gfp);
3323
3334
void
cfg80211_ready_on_channel
(
struct
wireless_dev
*wdev,
u64
cookie
,
3335
struct
ieee80211_channel
*
chan
,
3336
enum
nl80211_channel_type
channel_type
,
3337
unsigned
int
duration
,
gfp_t
gfp);
3338
3347
void
cfg80211_remain_on_channel_expired
(
struct
wireless_dev
*wdev,
u64
cookie
,
3348
struct
ieee80211_channel
*
chan
,
3349
enum
nl80211_channel_type
channel_type
,
3350
gfp_t
gfp);
3351
3352
3361
void
cfg80211_new_sta
(
struct
net_device
*
dev
,
const
u8
*
mac_addr
,
3362
struct
station_info
*
sinfo
,
gfp_t
gfp);
3363
3371
void
cfg80211_del_sta
(
struct
net_device
*
dev
,
const
u8
*
mac_addr
,
gfp_t
gfp);
3372
3388
void
cfg80211_conn_failed
(
struct
net_device
*
dev
,
const
u8
*
mac_addr
,
3389
enum
nl80211_connect_failed_reason
reason
,
3390
gfp_t
gfp);
3391
3409
bool
cfg80211_rx_mgmt
(
struct
wireless_dev
*wdev,
int
freq
,
int
sig_dbm,
3410
const
u8
*
buf
,
size_t
len
,
gfp_t
gfp);
3411
3425
void
cfg80211_mgmt_tx_status
(
struct
wireless_dev
*wdev,
u64
cookie
,
3426
const
u8
*
buf
,
size_t
len
,
bool
ack
,
gfp_t
gfp);
3427
3428
3438
void
cfg80211_cqm_rssi_notify
(
struct
net_device
*
dev
,
3439
enum
nl80211_cqm_rssi_threshold_event
rssi_event,
3440
gfp_t
gfp);
3441
3451
void
cfg80211_cqm_pktloss_notify
(
struct
net_device
*
dev
,
3452
const
u8
*peer,
u32
num_packets,
gfp_t
gfp);
3453
3466
void
cfg80211_cqm_txe_notify
(
struct
net_device
*
dev
,
const
u8
*peer,
3467
u32
num_packets,
u32
rate
,
u32
intvl,
gfp_t
gfp);
3468
3476
void
cfg80211_gtk_rekey_notify
(
struct
net_device
*
dev
,
const
u8
*
bssid
,
3477
const
u8
*replay_ctr,
gfp_t
gfp);
3478
3487
void
cfg80211_pmksa_candidate_notify
(
struct
net_device
*
dev
,
int
index
,
3488
const
u8
*
bssid
,
bool
preauth,
gfp_t
gfp);
3489
3502
bool
cfg80211_rx_spurious_frame
(
struct
net_device
*
dev
,
3503
const
u8
*
addr
,
gfp_t
gfp);
3504
3518
bool
cfg80211_rx_unexpected_4addr_frame
(
struct
net_device
*
dev
,
3519
const
u8
*
addr
,
gfp_t
gfp);
3520
3529
void
cfg80211_probe_status
(
struct
net_device
*
dev
,
const
u8
*
addr
,
3530
u64
cookie
,
bool
acked,
gfp_t
gfp);
3531
3545
void
cfg80211_report_obss_beacon
(
struct
wiphy
*
wiphy
,
3546
const
u8
*
frame
,
size_t
len
,
3547
int
freq
,
int
sig_dbm,
gfp_t
gfp);
3548
3558
bool
cfg80211_can_beacon_sec_chan
(
struct
wiphy
*
wiphy
,
3559
struct
ieee80211_channel
*
chan
,
3560
enum
nl80211_channel_type
channel_type
);
3561
3562
/*
3563
* cfg80211_ch_switch_notify - update wdev channel and notify userspace
3564
* @dev: the device which switched channels
3565
* @freq: new channel frequency (in MHz)
3566
* @type: channel type
3567
*
3568
* Acquires wdev_lock, so must only be called from sleepable driver context!
3569
*/
3570
void
cfg80211_ch_switch_notify
(
struct
net_device
*
dev
,
int
freq
,
3571
enum
nl80211_channel_type
type
);
3572
3573
/*
3574
* cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units)
3575
* @rate: given rate_info to calculate bitrate from
3576
*
3577
* return 0 if MCS index >= 32
3578
*/
3579
u32
cfg80211_calculate_bitrate
(
struct
rate_info
*
rate
);
3580
3595
void
cfg80211_unregister_wdev
(
struct
wireless_dev
*wdev);
3596
3597
/* Logging, debugging and troubleshooting/diagnostic helpers. */
3598
3599
/* wiphy_printk helpers, similar to dev_printk */
3600
3601
#define wiphy_printk(level, wiphy, format, args...) \
3602
dev_printk(level, &(wiphy)->dev, format, ##args)
3603
#define wiphy_emerg(wiphy, format, args...) \
3604
dev_emerg(&(wiphy)->dev, format, ##args)
3605
#define wiphy_alert(wiphy, format, args...) \
3606
dev_alert(&(wiphy)->dev, format, ##args)
3607
#define wiphy_crit(wiphy, format, args...) \
3608
dev_crit(&(wiphy)->dev, format, ##args)
3609
#define wiphy_err(wiphy, format, args...) \
3610
dev_err(&(wiphy)->dev, format, ##args)
3611
#define wiphy_warn(wiphy, format, args...) \
3612
dev_warn(&(wiphy)->dev, format, ##args)
3613
#define wiphy_notice(wiphy, format, args...) \
3614
dev_notice(&(wiphy)->dev, format, ##args)
3615
#define wiphy_info(wiphy, format, args...) \
3616
dev_info(&(wiphy)->dev, format, ##args)
3617
3618
#define wiphy_debug(wiphy, format, args...) \
3619
wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
3620
3621
#define wiphy_dbg(wiphy, format, args...) \
3622
dev_dbg(&(wiphy)->dev, format, ##args)
3623
3624
#if defined(VERBOSE_DEBUG)
3625
#define wiphy_vdbg wiphy_dbg
3626
#else
3627
#define wiphy_vdbg(wiphy, format, args...) \
3628
({ \
3629
if (0) \
3630
wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \
3631
0; \
3632
})
3633
#endif
3634
3635
/*
3636
* wiphy_WARN() acts like wiphy_printk(), but with the key difference
3637
* of using a WARN/WARN_ON to get the message out, including the
3638
* file/line information and a backtrace.
3639
*/
3640
#define wiphy_WARN(wiphy, format, args...) \
3641
WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args);
3642
3643
#endif
/* __NET_CFG80211_H */
Generated on Thu Jan 10 2013 14:08:42 for Linux Kernel by
1.8.2