Upgrade b43 and mac80211.
This also temporarly disables hostapd support for mac80211, as hostapd needs patches to compile against latest mac80211. Will do that in a seperate patch. SVN-Revision: 10466
This commit is contained in:
@@ -54,6 +54,8 @@
|
||||
#define IEEE80211_STYPE_ACTION 0x00D0
|
||||
|
||||
/* control */
|
||||
#define IEEE80211_STYPE_BACK_REQ 0x0080
|
||||
#define IEEE80211_STYPE_BACK 0x0090
|
||||
#define IEEE80211_STYPE_PSPOLL 0x00A0
|
||||
#define IEEE80211_STYPE_RTS 0x00B0
|
||||
#define IEEE80211_STYPE_CTS 0x00C0
|
||||
@@ -81,18 +83,18 @@
|
||||
|
||||
|
||||
/* miscellaneous IEEE 802.11 constants */
|
||||
#define IEEE80211_MAX_FRAG_THRESHOLD 2346
|
||||
#define IEEE80211_MAX_RTS_THRESHOLD 2347
|
||||
#define IEEE80211_MAX_FRAG_THRESHOLD 2352
|
||||
#define IEEE80211_MAX_RTS_THRESHOLD 2353
|
||||
#define IEEE80211_MAX_AID 2007
|
||||
#define IEEE80211_MAX_TIM_LEN 251
|
||||
#define IEEE80211_MAX_DATA_LEN 2304
|
||||
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
|
||||
6.2.1.1.2.
|
||||
|
||||
The figure in section 7.1.2 suggests a body size of up to 2312
|
||||
bytes is allowed, which is a bit confusing, I suspect this
|
||||
represents the 2304 bytes of real data, plus a possible 8 bytes of
|
||||
WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
|
||||
802.11e clarifies the figure in section 7.1.2. The frame body is
|
||||
up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */
|
||||
#define IEEE80211_MAX_DATA_LEN 2304
|
||||
/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */
|
||||
#define IEEE80211_MAX_FRAME_LEN 2352
|
||||
|
||||
#define IEEE80211_MAX_SSID_LEN 32
|
||||
|
||||
@@ -185,6 +187,25 @@ struct ieee80211_mgmt {
|
||||
u8 new_chan;
|
||||
u8 switch_count;
|
||||
} __attribute__((packed)) chan_switch;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
__le16 capab;
|
||||
__le16 timeout;
|
||||
__le16 start_seq_num;
|
||||
} __attribute__((packed)) addba_req;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
__le16 status;
|
||||
__le16 capab;
|
||||
__le16 timeout;
|
||||
} __attribute__((packed)) addba_resp;
|
||||
struct{
|
||||
u8 action_code;
|
||||
__le16 params;
|
||||
__le16 reason_code;
|
||||
} __attribute__((packed)) delba;
|
||||
} u;
|
||||
} __attribute__ ((packed)) action;
|
||||
} u;
|
||||
@@ -205,6 +226,72 @@ struct ieee80211_cts {
|
||||
u8 ra[6];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/**
|
||||
* struct ieee80211_bar - HT Block Ack Request
|
||||
*
|
||||
* This structure refers to "HT BlockAckReq" as
|
||||
* described in 802.11n draft section 7.2.1.7.1
|
||||
*/
|
||||
struct ieee80211_bar {
|
||||
__le16 frame_control;
|
||||
__le16 duration;
|
||||
__u8 ra[6];
|
||||
__u8 ta[6];
|
||||
__le16 control;
|
||||
__le16 start_seq_num;
|
||||
} __attribute__((packed));
|
||||
|
||||
/**
|
||||
* struct ieee80211_ht_cap - HT capabilities
|
||||
*
|
||||
* This structure refers to "HT capabilities element" as
|
||||
* described in 802.11n draft section 7.3.2.52
|
||||
*/
|
||||
struct ieee80211_ht_cap {
|
||||
__le16 cap_info;
|
||||
u8 ampdu_params_info;
|
||||
u8 supp_mcs_set[16];
|
||||
__le16 extended_ht_cap_info;
|
||||
__le32 tx_BF_cap_info;
|
||||
u8 antenna_selection_info;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/**
|
||||
* struct ieee80211_ht_cap - HT additional information
|
||||
*
|
||||
* This structure refers to "HT information element" as
|
||||
* described in 802.11n draft section 7.3.2.53
|
||||
*/
|
||||
struct ieee80211_ht_addt_info {
|
||||
u8 control_chan;
|
||||
u8 ht_param;
|
||||
__le16 operation_mode;
|
||||
__le16 stbc_param;
|
||||
u8 basic_set[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* 802.11n HT capabilities masks */
|
||||
#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002
|
||||
#define IEEE80211_HT_CAP_MIMO_PS 0x000C
|
||||
#define IEEE80211_HT_CAP_GRN_FLD 0x0010
|
||||
#define IEEE80211_HT_CAP_SGI_20 0x0020
|
||||
#define IEEE80211_HT_CAP_SGI_40 0x0040
|
||||
#define IEEE80211_HT_CAP_DELAY_BA 0x0400
|
||||
#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
|
||||
#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03
|
||||
#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C
|
||||
/* 802.11n HT IE masks */
|
||||
#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03
|
||||
#define IEEE80211_HT_IE_CHA_WIDTH 0x04
|
||||
#define IEEE80211_HT_IE_HT_PROTECTION 0x0003
|
||||
#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004
|
||||
#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010
|
||||
|
||||
/* MIMO Power Save Modes */
|
||||
#define WLAN_HT_CAP_MIMO_PS_STATIC 0
|
||||
#define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1
|
||||
#define WLAN_HT_CAP_MIMO_PS_INVALID 2
|
||||
#define WLAN_HT_CAP_MIMO_PS_DISABLED 3
|
||||
|
||||
/* Authentication algorithms */
|
||||
#define WLAN_AUTH_OPEN 0
|
||||
@@ -271,6 +358,18 @@ enum ieee80211_statuscode {
|
||||
WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
|
||||
WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
|
||||
WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
|
||||
/* 802.11e */
|
||||
WLAN_STATUS_UNSPECIFIED_QOS = 32,
|
||||
WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33,
|
||||
WLAN_STATUS_ASSOC_DENIED_LOWACK = 34,
|
||||
WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35,
|
||||
WLAN_STATUS_REQUEST_DECLINED = 37,
|
||||
WLAN_STATUS_INVALID_QOS_PARAM = 38,
|
||||
WLAN_STATUS_CHANGE_TSPEC = 39,
|
||||
WLAN_STATUS_WAIT_TS_DELAY = 47,
|
||||
WLAN_STATUS_NO_DIRECT_LINK = 48,
|
||||
WLAN_STATUS_STA_NOT_PRESENT = 49,
|
||||
WLAN_STATUS_STA_NOT_QSTA = 50,
|
||||
};
|
||||
|
||||
|
||||
@@ -301,6 +400,16 @@ enum ieee80211_reasoncode {
|
||||
WLAN_REASON_INVALID_RSN_IE_CAP = 22,
|
||||
WLAN_REASON_IEEE8021X_FAILED = 23,
|
||||
WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
|
||||
/* 802.11e */
|
||||
WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
|
||||
WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
|
||||
WLAN_REASON_DISASSOC_LOW_ACK = 34,
|
||||
WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35,
|
||||
WLAN_REASON_QSTA_LEAVE_QBSS = 36,
|
||||
WLAN_REASON_QSTA_NOT_USE = 37,
|
||||
WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
|
||||
WLAN_REASON_QSTA_TIMEOUT = 39,
|
||||
WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
|
||||
};
|
||||
|
||||
|
||||
@@ -319,6 +428,15 @@ enum ieee80211_eid {
|
||||
WLAN_EID_HP_PARAMS = 8,
|
||||
WLAN_EID_HP_TABLE = 9,
|
||||
WLAN_EID_REQUEST = 10,
|
||||
/* 802.11e */
|
||||
WLAN_EID_QBSS_LOAD = 11,
|
||||
WLAN_EID_EDCA_PARAM_SET = 12,
|
||||
WLAN_EID_TSPEC = 13,
|
||||
WLAN_EID_TCLAS = 14,
|
||||
WLAN_EID_SCHEDULE = 15,
|
||||
WLAN_EID_TS_DELAY = 43,
|
||||
WLAN_EID_TCLAS_PROCESSING = 44,
|
||||
WLAN_EID_QOS_CAPA = 46,
|
||||
/* 802.11h */
|
||||
WLAN_EID_PWR_CONSTRAINT = 32,
|
||||
WLAN_EID_PWR_CAPABILITY = 33,
|
||||
@@ -333,6 +451,9 @@ enum ieee80211_eid {
|
||||
/* 802.11g */
|
||||
WLAN_EID_ERP_INFO = 42,
|
||||
WLAN_EID_EXT_SUPP_RATES = 50,
|
||||
/* 802.11n */
|
||||
WLAN_EID_HT_CAPABILITY = 45,
|
||||
WLAN_EID_HT_EXTRA_INFO = 61,
|
||||
/* 802.11i */
|
||||
WLAN_EID_RSN = 48,
|
||||
WLAN_EID_WPA = 221,
|
||||
@@ -341,6 +462,32 @@ enum ieee80211_eid {
|
||||
WLAN_EID_QOS_PARAMETER = 222
|
||||
};
|
||||
|
||||
/* Action category code */
|
||||
enum ieee80211_category {
|
||||
WLAN_CATEGORY_SPECTRUM_MGMT = 0,
|
||||
WLAN_CATEGORY_QOS = 1,
|
||||
WLAN_CATEGORY_DLS = 2,
|
||||
WLAN_CATEGORY_BACK = 3,
|
||||
WLAN_CATEGORY_WMM = 17,
|
||||
};
|
||||
|
||||
/* BACK action code */
|
||||
enum ieee80211_back_actioncode {
|
||||
WLAN_ACTION_ADDBA_REQ = 0,
|
||||
WLAN_ACTION_ADDBA_RESP = 1,
|
||||
WLAN_ACTION_DELBA = 2,
|
||||
};
|
||||
|
||||
/* BACK (block-ack) parties */
|
||||
enum ieee80211_back_parties {
|
||||
WLAN_BACK_RECIPIENT = 0,
|
||||
WLAN_BACK_INITIATOR = 1,
|
||||
WLAN_BACK_TIMER = 2,
|
||||
};
|
||||
|
||||
/* A-MSDU 802.11n */
|
||||
#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
|
||||
|
||||
/* cipher suite selectors */
|
||||
#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
|
||||
#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
|
||||
|
||||
@@ -6,6 +6,18 @@
|
||||
* Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Station handling
|
||||
*
|
||||
* Stations are added per interface, but a special case exists with VLAN
|
||||
* interfaces. When a station is bound to an AP interface, it may be moved
|
||||
* into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
|
||||
* The station is still assumed to belong to the AP interface it was added
|
||||
* to.
|
||||
*
|
||||
* TODO: need more info?
|
||||
*/
|
||||
|
||||
/**
|
||||
* enum nl80211_commands - supported nl80211 commands
|
||||
*
|
||||
@@ -25,7 +37,7 @@
|
||||
* either a dump request on a %NL80211_ATTR_WIPHY or a specific get
|
||||
* on an %NL80211_ATTR_IFINDEX is supported.
|
||||
* @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
|
||||
%NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
|
||||
* %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
|
||||
* @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
|
||||
* to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
|
||||
* %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
|
||||
@@ -37,6 +49,35 @@
|
||||
* userspace to request deletion of a virtual interface, then requires
|
||||
* attribute %NL80211_ATTR_IFINDEX.
|
||||
*
|
||||
* @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
|
||||
* by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
|
||||
* @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or
|
||||
* %NL80211_ATTR_KEY_THRESHOLD.
|
||||
* @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
|
||||
* %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
|
||||
* attributes.
|
||||
* @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
|
||||
* or %NL80211_ATTR_MAC.
|
||||
*
|
||||
* @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a
|
||||
* %NL80222_CMD_NEW_BEACON message)
|
||||
* @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
|
||||
* using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
|
||||
* %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes.
|
||||
* @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
|
||||
* parameters are like for %NL80211_CMD_SET_BEACON.
|
||||
* @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
|
||||
*
|
||||
* @NL80211_CMD_GET_STATION: Get station attributes for station identified by
|
||||
* %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
|
||||
* @NL80211_CMD_SET_STATION: Set station attributes for station identified by
|
||||
* %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
|
||||
* @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
|
||||
* the interface identified by %NL80211_ATTR_IFINDEX.
|
||||
* @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
|
||||
* or, if no MAC address given, all stations, on the interface identified
|
||||
* by %NL80211_ATTR_IFINDEX.
|
||||
*
|
||||
* @NL80211_CMD_MAX: highest used command number
|
||||
* @__NL80211_CMD_AFTER_LAST: internal use
|
||||
*/
|
||||
@@ -54,6 +95,21 @@ enum nl80211_commands {
|
||||
NL80211_CMD_NEW_INTERFACE,
|
||||
NL80211_CMD_DEL_INTERFACE,
|
||||
|
||||
NL80211_CMD_GET_KEY,
|
||||
NL80211_CMD_SET_KEY,
|
||||
NL80211_CMD_NEW_KEY,
|
||||
NL80211_CMD_DEL_KEY,
|
||||
|
||||
NL80211_CMD_GET_BEACON,
|
||||
NL80211_CMD_SET_BEACON,
|
||||
NL80211_CMD_NEW_BEACON,
|
||||
NL80211_CMD_DEL_BEACON,
|
||||
|
||||
NL80211_CMD_GET_STATION,
|
||||
NL80211_CMD_SET_STATION,
|
||||
NL80211_CMD_NEW_STATION,
|
||||
NL80211_CMD_DEL_STATION,
|
||||
|
||||
/* add commands here */
|
||||
|
||||
/* used to define NL80211_CMD_MAX below */
|
||||
@@ -75,6 +131,42 @@ enum nl80211_commands {
|
||||
* @NL80211_ATTR_IFNAME: network interface name
|
||||
* @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
|
||||
*
|
||||
* @NL80211_ATTR_MAC: MAC address (various uses)
|
||||
*
|
||||
* @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
|
||||
* 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
|
||||
* keys
|
||||
* @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
|
||||
* @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
|
||||
* section 7.3.2.25.1, e.g. 0x000FAC04)
|
||||
* @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
|
||||
* CCMP keys, each six bytes in little endian
|
||||
*
|
||||
* @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
|
||||
* @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
|
||||
* @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
|
||||
* @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
|
||||
*
|
||||
* @NL80211_ATTR_STA_AID: Association ID for the station (u16)
|
||||
* @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
|
||||
* &enum nl80211_sta_flags.
|
||||
* @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
|
||||
* IEEE 802.11 7.3.1.6 (u16).
|
||||
* @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
|
||||
* rates as defined by IEEE 802.11 7.3.2.2 but without the length
|
||||
* restriction (at most %NL80211_MAX_SUPP_RATES).
|
||||
* @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
|
||||
* to, or the AP interface the station was originally added to to.
|
||||
* @NL80211_ATTR_STA_STATS: statistics for a station, part of station info
|
||||
* given for %NL80211_CMD_GET_STATION, nested attribute containing
|
||||
* info as possible, see &enum nl80211_sta_stats.
|
||||
*
|
||||
* @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
|
||||
* consisting of a nested array.
|
||||
*
|
||||
* @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
|
||||
* &enum nl80211_mntr_flags.
|
||||
*
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
*/
|
||||
@@ -89,12 +181,38 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_IFNAME,
|
||||
NL80211_ATTR_IFTYPE,
|
||||
|
||||
NL80211_ATTR_MAC,
|
||||
|
||||
NL80211_ATTR_KEY_DATA,
|
||||
NL80211_ATTR_KEY_IDX,
|
||||
NL80211_ATTR_KEY_CIPHER,
|
||||
NL80211_ATTR_KEY_SEQ,
|
||||
NL80211_ATTR_KEY_DEFAULT,
|
||||
|
||||
NL80211_ATTR_BEACON_INTERVAL,
|
||||
NL80211_ATTR_DTIM_PERIOD,
|
||||
NL80211_ATTR_BEACON_HEAD,
|
||||
NL80211_ATTR_BEACON_TAIL,
|
||||
|
||||
NL80211_ATTR_STA_AID,
|
||||
NL80211_ATTR_STA_FLAGS,
|
||||
NL80211_ATTR_STA_LISTEN_INTERVAL,
|
||||
NL80211_ATTR_STA_SUPPORTED_RATES,
|
||||
NL80211_ATTR_STA_VLAN,
|
||||
NL80211_ATTR_STA_STATS,
|
||||
|
||||
NL80211_ATTR_WIPHY_BANDS,
|
||||
|
||||
NL80211_ATTR_MNTR_FLAGS,
|
||||
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
#define NL80211_MAX_SUPP_RATES 32
|
||||
|
||||
/**
|
||||
* enum nl80211_iftype - (virtual) interface types
|
||||
*
|
||||
@@ -126,4 +244,139 @@ enum nl80211_iftype {
|
||||
NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_sta_flags - station flags
|
||||
*
|
||||
* Station flags. When a station is added to an AP interface, it is
|
||||
* assumed to be already associated (and hence authenticated.)
|
||||
*
|
||||
* @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
|
||||
* @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
|
||||
* with short barker preamble
|
||||
* @NL80211_STA_FLAG_WME: station is WME/QoS capable
|
||||
*/
|
||||
enum nl80211_sta_flags {
|
||||
__NL80211_STA_FLAG_INVALID,
|
||||
NL80211_STA_FLAG_AUTHORIZED,
|
||||
NL80211_STA_FLAG_SHORT_PREAMBLE,
|
||||
NL80211_STA_FLAG_WME,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_STA_FLAG_AFTER_LAST,
|
||||
NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_sta_stats - station statistics
|
||||
*
|
||||
* These attribute types are used with %NL80211_ATTR_STA_STATS
|
||||
* when getting information about a station.
|
||||
*
|
||||
* @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
|
||||
* @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
|
||||
* @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
|
||||
* @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
|
||||
* @__NL80211_STA_STAT_AFTER_LAST: internal
|
||||
* @NL80211_STA_STAT_MAX: highest possible station stats attribute
|
||||
*/
|
||||
enum nl80211_sta_stats {
|
||||
__NL80211_STA_STAT_INVALID,
|
||||
NL80211_STA_STAT_INACTIVE_TIME,
|
||||
NL80211_STA_STAT_RX_BYTES,
|
||||
NL80211_STA_STAT_TX_BYTES,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_STA_STAT_AFTER_LAST,
|
||||
NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_band_attr - band attributes
|
||||
* @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
|
||||
* @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
|
||||
* an array of nested frequency attributes
|
||||
* @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
|
||||
* an array of nested bitrate attributes
|
||||
*/
|
||||
enum nl80211_band_attr {
|
||||
__NL80211_BAND_ATTR_INVALID,
|
||||
NL80211_BAND_ATTR_FREQS,
|
||||
NL80211_BAND_ATTR_RATES,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_BAND_ATTR_AFTER_LAST,
|
||||
NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_frequency_attr - frequency attributes
|
||||
* @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
|
||||
* @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
|
||||
* regulatory domain.
|
||||
* @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
|
||||
* permitted on this channel in current regulatory domain.
|
||||
* @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
|
||||
* on this channel in current regulatory domain.
|
||||
* @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
|
||||
* on this channel in current regulatory domain.
|
||||
*/
|
||||
enum nl80211_frequency_attr {
|
||||
__NL80211_FREQUENCY_ATTR_INVALID,
|
||||
NL80211_FREQUENCY_ATTR_FREQ,
|
||||
NL80211_FREQUENCY_ATTR_DISABLED,
|
||||
NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
|
||||
NL80211_FREQUENCY_ATTR_NO_IBSS,
|
||||
NL80211_FREQUENCY_ATTR_RADAR,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
|
||||
NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_bitrate_attr - bitrate attributes
|
||||
* @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
|
||||
* @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
|
||||
* in 2.4 GHz band.
|
||||
*/
|
||||
enum nl80211_bitrate_attr {
|
||||
__NL80211_BITRATE_ATTR_INVALID,
|
||||
NL80211_BITRATE_ATTR_RATE,
|
||||
NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_BITRATE_ATTR_AFTER_LAST,
|
||||
NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_mntr_flags - monitor configuration flags
|
||||
*
|
||||
* Monitor configuration flags.
|
||||
*
|
||||
* @__NL80211_MNTR_FLAG_INVALID: reserved
|
||||
*
|
||||
* @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
|
||||
* @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
|
||||
* @NL80211_MNTR_FLAG_CONTROL: pass control frames
|
||||
* @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
|
||||
* @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
|
||||
* overrides all other flags.
|
||||
*
|
||||
* @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
|
||||
* @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
|
||||
*/
|
||||
enum nl80211_mntr_flags {
|
||||
__NL80211_MNTR_FLAG_INVALID,
|
||||
NL80211_MNTR_FLAG_FCSFAIL,
|
||||
NL80211_MNTR_FLAG_PLCPFAIL,
|
||||
NL80211_MNTR_FLAG_CONTROL,
|
||||
NL80211_MNTR_FLAG_OTHER_BSS,
|
||||
NL80211_MNTR_FLAG_COOK_FRAMES,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_MNTR_FLAG_AFTER_LAST,
|
||||
NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
#endif /* __LINUX_NL80211_H */
|
||||
|
||||
@@ -49,6 +49,140 @@ extern int ieee80211_radiotap_iterator_next(
|
||||
struct ieee80211_radiotap_iterator *iterator);
|
||||
|
||||
|
||||
/**
|
||||
* struct key_params - key information
|
||||
*
|
||||
* Information about a key
|
||||
*
|
||||
* @key: key material
|
||||
* @key_len: length of key material
|
||||
* @cipher: cipher suite selector
|
||||
* @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used
|
||||
* with the get_key() callback, must be in little endian,
|
||||
* length given by @seq_len.
|
||||
*/
|
||||
struct key_params {
|
||||
u8 *key;
|
||||
u8 *seq;
|
||||
int key_len;
|
||||
int seq_len;
|
||||
u32 cipher;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct beacon_parameters - beacon parameters
|
||||
*
|
||||
* Used to configure the beacon for an interface.
|
||||
*
|
||||
* @head: head portion of beacon (before TIM IE)
|
||||
* or %NULL if not changed
|
||||
* @tail: tail portion of beacon (after TIM IE)
|
||||
* or %NULL if not changed
|
||||
* @interval: beacon interval or zero if not changed
|
||||
* @dtim_period: DTIM period or zero if not changed
|
||||
* @head_len: length of @head
|
||||
* @tail_len: length of @tail
|
||||
*/
|
||||
struct beacon_parameters {
|
||||
u8 *head, *tail;
|
||||
int interval, dtim_period;
|
||||
int head_len, tail_len;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum station_flags - station flags
|
||||
*
|
||||
* Station capability flags. Note that these must be the bits
|
||||
* according to the nl80211 flags.
|
||||
*
|
||||
* @STATION_FLAG_CHANGED: station flags were changed
|
||||
* @STATION_FLAG_AUTHORIZED: station is authorized to send frames (802.1X)
|
||||
* @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
|
||||
* with short preambles
|
||||
* @STATION_FLAG_WME: station is WME/QoS capable
|
||||
*/
|
||||
enum station_flags {
|
||||
STATION_FLAG_CHANGED = 1<<0,
|
||||
STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED,
|
||||
STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE,
|
||||
STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct station_parameters - station parameters
|
||||
*
|
||||
* Used to change and create a new station.
|
||||
*
|
||||
* @vlan: vlan interface station should belong to
|
||||
* @supported_rates: supported rates in IEEE 802.11 format
|
||||
* (or NULL for no change)
|
||||
* @supported_rates_len: number of supported rates
|
||||
* @station_flags: station flags (see &enum station_flags)
|
||||
* @listen_interval: listen interval or -1 for no change
|
||||
* @aid: AID or zero for no change
|
||||
*/
|
||||
struct station_parameters {
|
||||
u8 *supported_rates;
|
||||
struct net_device *vlan;
|
||||
u32 station_flags;
|
||||
int listen_interval;
|
||||
u16 aid;
|
||||
u8 supported_rates_len;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum station_stats_flags - station statistics flags
|
||||
*
|
||||
* Used by the driver to indicate which info in &struct station_stats
|
||||
* it has filled in during get_station().
|
||||
*
|
||||
* @STATION_STAT_INACTIVE_TIME: @inactive_time filled
|
||||
* @STATION_STAT_RX_BYTES: @rx_bytes filled
|
||||
* @STATION_STAT_TX_BYTES: @tx_bytes filled
|
||||
*/
|
||||
enum station_stats_flags {
|
||||
STATION_STAT_INACTIVE_TIME = 1<<0,
|
||||
STATION_STAT_RX_BYTES = 1<<1,
|
||||
STATION_STAT_TX_BYTES = 1<<2,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct station_stats - station statistics
|
||||
*
|
||||
* Station information filled by driver for get_station().
|
||||
*
|
||||
* @filled: bitflag of flags from &enum station_stats_flags
|
||||
* @inactive_time: time since last station activity (tx/rx) in milliseconds
|
||||
* @rx_bytes: bytes received from this station
|
||||
* @tx_bytes: bytes transmitted to this station
|
||||
*/
|
||||
struct station_stats {
|
||||
u32 filled;
|
||||
u32 inactive_time;
|
||||
u32 rx_bytes;
|
||||
u32 tx_bytes;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum monitor_flags - monitor flags
|
||||
*
|
||||
* Monitor interface configuration flags. Note that these must be the bits
|
||||
* according to the nl80211 flags.
|
||||
*
|
||||
* @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS
|
||||
* @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP
|
||||
* @MONITOR_FLAG_CONTROL: pass control frames
|
||||
* @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
|
||||
* @MONITOR_FLAG_COOK_FRAMES: report frames after processing
|
||||
*/
|
||||
enum monitor_flags {
|
||||
MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
|
||||
MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL,
|
||||
MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
|
||||
MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
|
||||
MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
|
||||
};
|
||||
|
||||
/* from net/wireless.h */
|
||||
struct wiphy;
|
||||
|
||||
@@ -71,13 +205,66 @@ struct wiphy;
|
||||
*
|
||||
* @change_virtual_intf: change type of virtual interface
|
||||
*
|
||||
* @add_key: add a key with the given parameters. @mac_addr will be %NULL
|
||||
* when adding a group key.
|
||||
*
|
||||
* @get_key: get information about the key with the given parameters.
|
||||
* @mac_addr will be %NULL when requesting information for a group
|
||||
* key. All pointers given to the @callback function need not be valid
|
||||
* after it returns.
|
||||
*
|
||||
* @del_key: remove a key given the @mac_addr (%NULL for a group key)
|
||||
* and @key_index
|
||||
*
|
||||
* @set_default_key: set the default key on an interface
|
||||
*
|
||||
* @add_beacon: Add a beacon with given parameters, @head, @interval
|
||||
* and @dtim_period will be valid, @tail is optional.
|
||||
* @set_beacon: Change the beacon parameters for an access point mode
|
||||
* interface. This should reject the call when no beacon has been
|
||||
* configured.
|
||||
* @del_beacon: Remove beacon configuration and stop sending the beacon.
|
||||
*
|
||||
* @add_station: Add a new station.
|
||||
*
|
||||
* @del_station: Remove a station; @mac may be NULL to remove all stations.
|
||||
*
|
||||
* @change_station: Modify a given station.
|
||||
*/
|
||||
struct cfg80211_ops {
|
||||
int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
|
||||
enum nl80211_iftype type);
|
||||
enum nl80211_iftype type, u32 *flags);
|
||||
int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
|
||||
int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
|
||||
enum nl80211_iftype type);
|
||||
enum nl80211_iftype type, u32 *flags);
|
||||
|
||||
int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
|
||||
u8 key_index, u8 *mac_addr,
|
||||
struct key_params *params);
|
||||
int (*get_key)(struct wiphy *wiphy, struct net_device *netdev,
|
||||
u8 key_index, u8 *mac_addr, void *cookie,
|
||||
void (*callback)(void *cookie, struct key_params*));
|
||||
int (*del_key)(struct wiphy *wiphy, struct net_device *netdev,
|
||||
u8 key_index, u8 *mac_addr);
|
||||
int (*set_default_key)(struct wiphy *wiphy,
|
||||
struct net_device *netdev,
|
||||
u8 key_index);
|
||||
|
||||
int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct beacon_parameters *info);
|
||||
int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct beacon_parameters *info);
|
||||
int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev);
|
||||
|
||||
|
||||
int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
|
||||
u8 *mac, struct station_parameters *params);
|
||||
int (*del_station)(struct wiphy *wiphy, struct net_device *dev,
|
||||
u8 *mac);
|
||||
int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
|
||||
u8 *mac, struct station_parameters *params);
|
||||
int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
|
||||
u8 *mac, struct station_stats *stats);
|
||||
};
|
||||
|
||||
#endif /* __NET_CFG80211_H */
|
||||
|
||||
@@ -69,95 +69,20 @@
|
||||
* not do so then mac80211 may add this under certain circumstances.
|
||||
*/
|
||||
|
||||
#define IEEE80211_CHAN_W_SCAN 0x00000001
|
||||
#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x00000002
|
||||
#define IEEE80211_CHAN_W_IBSS 0x00000004
|
||||
|
||||
/* Channel information structure. Low-level driver is expected to fill in chan,
|
||||
* freq, and val fields. Other fields will be filled in by 80211.o based on
|
||||
* hostapd information and low-level driver does not need to use them. The
|
||||
* limits for each channel will be provided in 'struct ieee80211_conf' when
|
||||
* configuring the low-level driver with hw->config callback. If a device has
|
||||
* a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED
|
||||
* can be set to let the driver configure all fields */
|
||||
struct ieee80211_channel {
|
||||
short chan; /* channel number (IEEE 802.11) */
|
||||
short freq; /* frequency in MHz */
|
||||
int val; /* hw specific value for the channel */
|
||||
int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
|
||||
unsigned char power_level;
|
||||
unsigned char antenna_max;
|
||||
};
|
||||
|
||||
#define IEEE80211_RATE_ERP 0x00000001
|
||||
#define IEEE80211_RATE_BASIC 0x00000002
|
||||
#define IEEE80211_RATE_PREAMBLE2 0x00000004
|
||||
#define IEEE80211_RATE_SUPPORTED 0x00000010
|
||||
#define IEEE80211_RATE_OFDM 0x00000020
|
||||
#define IEEE80211_RATE_CCK 0x00000040
|
||||
#define IEEE80211_RATE_MANDATORY 0x00000100
|
||||
|
||||
#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
|
||||
#define IEEE80211_RATE_MODULATION(f) \
|
||||
(f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
|
||||
|
||||
/* Low-level driver should set PREAMBLE2, OFDM and CCK flags.
|
||||
* BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
|
||||
* configuration. */
|
||||
struct ieee80211_rate {
|
||||
int rate; /* rate in 100 kbps */
|
||||
int val; /* hw specific value for the rate */
|
||||
int flags; /* IEEE80211_RATE_ flags */
|
||||
int val2; /* hw specific value for the rate when using short preamble
|
||||
* (only when IEEE80211_RATE_PREAMBLE2 flag is set, i.e., for
|
||||
* 2, 5.5, and 11 Mbps) */
|
||||
signed char min_rssi_ack;
|
||||
unsigned char min_rssi_ack_delta;
|
||||
|
||||
/* following fields are set by 80211.o and need not be filled by the
|
||||
* low-level driver */
|
||||
int rate_inv; /* inverse of the rate (LCM(all rates) / rate) for
|
||||
* optimizing channel utilization estimates */
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_phymode - PHY modes
|
||||
* struct ieee80211_ht_bss_info - describing BSS's HT characteristics
|
||||
*
|
||||
* @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
|
||||
* @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
|
||||
* @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
|
||||
* backwards compatible with 11b mode
|
||||
* @NUM_IEEE80211_MODES: internal
|
||||
* This structure describes most essential parameters needed
|
||||
* to describe 802.11n HT characteristics in a BSS
|
||||
*
|
||||
* @primary_channel: channel number of primery channel
|
||||
* @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
|
||||
* @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection)
|
||||
*/
|
||||
enum ieee80211_phymode {
|
||||
MODE_IEEE80211A,
|
||||
MODE_IEEE80211B,
|
||||
MODE_IEEE80211G,
|
||||
|
||||
/* keep last */
|
||||
NUM_IEEE80211_MODES
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_hw_mode - PHY mode definition
|
||||
*
|
||||
* This structure describes the capabilities supported by the device
|
||||
* in a single PHY mode.
|
||||
*
|
||||
* @mode: the PHY mode for this definition
|
||||
* @num_channels: number of supported channels
|
||||
* @channels: pointer to array of supported channels
|
||||
* @num_rates: number of supported bitrates
|
||||
* @rates: pointer to array of supported bitrates
|
||||
* @list: internal
|
||||
*/
|
||||
struct ieee80211_hw_mode {
|
||||
struct list_head list;
|
||||
struct ieee80211_channel *channels;
|
||||
struct ieee80211_rate *rates;
|
||||
enum ieee80211_phymode mode;
|
||||
int num_channels;
|
||||
int num_rates;
|
||||
struct ieee80211_ht_bss_info {
|
||||
u8 primary_channel;
|
||||
u8 bss_cap; /* use IEEE80211_HT_IE_CHA_ */
|
||||
u8 bss_op_mode; /* use IEEE80211_HT_IE_ */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -208,6 +133,7 @@ struct ieee80211_tx_queue_stats_data {
|
||||
* @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
|
||||
* sent after a beacon
|
||||
* @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
|
||||
* @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
|
||||
*/
|
||||
enum ieee80211_tx_queue {
|
||||
IEEE80211_TX_QUEUE_DATA0,
|
||||
@@ -223,11 +149,12 @@ enum ieee80211_tx_queue {
|
||||
* this struct need to have fixed values. As soon as it is removed, we can
|
||||
* fix these entries. */
|
||||
IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
|
||||
IEEE80211_TX_QUEUE_BEACON = 7
|
||||
IEEE80211_TX_QUEUE_BEACON = 7,
|
||||
NUM_TX_DATA_QUEUES_AMPDU = 16
|
||||
};
|
||||
|
||||
struct ieee80211_tx_queue_stats {
|
||||
struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES];
|
||||
struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
|
||||
};
|
||||
|
||||
struct ieee80211_low_level_stats {
|
||||
@@ -237,16 +164,56 @@ struct ieee80211_low_level_stats {
|
||||
unsigned int dot11RTSSuccessCount;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_bss_change - BSS change notification flags
|
||||
*
|
||||
* These flags are used with the bss_info_changed() callback
|
||||
* to indicate which BSS parameter changed.
|
||||
*
|
||||
* @BSS_CHANGED_ASSOC: association status changed (associated/disassociated),
|
||||
* also implies a change in the AID.
|
||||
* @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed
|
||||
* @BSS_CHANGED_ERP_PREAMBLE: preamble changed
|
||||
*/
|
||||
enum ieee80211_bss_change {
|
||||
BSS_CHANGED_ASSOC = 1<<0,
|
||||
BSS_CHANGED_ERP_CTS_PROT = 1<<1,
|
||||
BSS_CHANGED_ERP_PREAMBLE = 1<<2,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_bss_conf - holds the BSS's changing parameters
|
||||
*
|
||||
* This structure keeps information about a BSS (and an association
|
||||
* to that BSS) that can change during the lifetime of the BSS.
|
||||
*
|
||||
* @assoc: association status
|
||||
* @aid: association ID number, valid only when @assoc is true
|
||||
* @use_cts_prot: use CTS protection
|
||||
* @use_short_preamble: use 802.11b short preamble
|
||||
*/
|
||||
struct ieee80211_bss_conf {
|
||||
/* association related data */
|
||||
bool assoc;
|
||||
u16 aid;
|
||||
/* erp related data */
|
||||
bool use_cts_prot;
|
||||
bool use_short_preamble;
|
||||
};
|
||||
|
||||
/* Transmit control fields. This data structure is passed to low-level driver
|
||||
* with each TX frame. The low-level driver is responsible for configuring
|
||||
* the hardware to use given values (depending on what is supported). */
|
||||
|
||||
struct ieee80211_tx_control {
|
||||
int tx_rate; /* Transmit rate, given as the hw specific value for the
|
||||
* rate (from struct ieee80211_rate) */
|
||||
int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw
|
||||
* specific value for the rate (from
|
||||
* struct ieee80211_rate) */
|
||||
struct ieee80211_vif *vif;
|
||||
struct ieee80211_rate *tx_rate;
|
||||
|
||||
/* Transmit rate for RTS/CTS frame */
|
||||
struct ieee80211_rate *rts_cts_rate;
|
||||
|
||||
/* retry rate for the last retries */
|
||||
struct ieee80211_rate *alt_retry_rate;
|
||||
|
||||
#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for
|
||||
* this frame */
|
||||
@@ -265,10 +232,16 @@ struct ieee80211_tx_control {
|
||||
#define IEEE80211_TXCTL_REQUEUE (1<<7)
|
||||
#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of
|
||||
* the frame */
|
||||
#define IEEE80211_TXCTL_SHORT_PREAMBLE (1<<9)
|
||||
#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send
|
||||
* using the through
|
||||
* set_retry_limit configured
|
||||
* long retry value */
|
||||
#define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */
|
||||
#define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM
|
||||
* beacon */
|
||||
#define IEEE80211_TXCTL_AMPDU (1<<13) /* this frame should be sent
|
||||
* as part of an A-MPDU */
|
||||
u32 flags; /* tx control flags defined
|
||||
* above */
|
||||
u8 key_idx; /* keyidx from hw->set_key(), undefined if
|
||||
@@ -276,22 +249,12 @@ struct ieee80211_tx_control {
|
||||
u8 retry_limit; /* 1 = only first attempt, 2 = one retry, ..
|
||||
* This could be used when set_retry_limit
|
||||
* is not implemented by the driver */
|
||||
u8 power_level; /* per-packet transmit power level, in dBm */
|
||||
u8 antenna_sel_tx; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
|
||||
u8 icv_len; /* length of the ICV/MIC field in octets */
|
||||
u8 iv_len; /* length of the IV field in octets */
|
||||
u8 queue; /* hardware queue to use for this frame;
|
||||
* 0 = highest, hw->queues-1 = lowest */
|
||||
struct ieee80211_rate *rate; /* internal 80211.o rate */
|
||||
struct ieee80211_rate *rts_rate; /* internal 80211.o rate
|
||||
* for RTS/CTS */
|
||||
int alt_retry_rate; /* retry rate for the last retries, given as the
|
||||
* hw specific value for the rate (from
|
||||
* struct ieee80211_rate). To be used to limit
|
||||
* packet dropping when probing higher rates, if hw
|
||||
* supports multiple retry rates. -1 = not used */
|
||||
int type; /* internal */
|
||||
int ifindex; /* internal */
|
||||
};
|
||||
|
||||
|
||||
@@ -312,6 +275,8 @@ struct ieee80211_tx_control {
|
||||
* the frame.
|
||||
* @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
|
||||
* the frame.
|
||||
* @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field)
|
||||
* is valid.
|
||||
*/
|
||||
enum mac80211_rx_flags {
|
||||
RX_FLAG_MMIC_ERROR = 1<<0,
|
||||
@@ -321,6 +286,7 @@ enum mac80211_rx_flags {
|
||||
RX_FLAG_IV_STRIPPED = 1<<4,
|
||||
RX_FLAG_FAILED_FCS_CRC = 1<<5,
|
||||
RX_FLAG_FAILED_PLCP_CRC = 1<<6,
|
||||
RX_FLAG_TSFT = 1<<7,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -330,26 +296,24 @@ enum mac80211_rx_flags {
|
||||
* supported by hardware) to the 802.11 code with each received
|
||||
* frame.
|
||||
* @mactime: MAC timestamp as defined by 802.11
|
||||
* @band: the active band when this frame was received
|
||||
* @freq: frequency the radio was tuned to when receiving this frame, in MHz
|
||||
* @channel: channel the radio was tuned to
|
||||
* @phymode: active PHY mode
|
||||
* @ssi: signal strength when receiving this frame
|
||||
* @signal: used as 'qual' in statistics reporting
|
||||
* @noise: PHY noise when receiving this frame
|
||||
* @antenna: antenna used
|
||||
* @rate: data rate
|
||||
* @rate_idx: index of data rate into band's supported rates
|
||||
* @flag: %RX_FLAG_*
|
||||
*/
|
||||
struct ieee80211_rx_status {
|
||||
u64 mactime;
|
||||
enum ieee80211_band band;
|
||||
int freq;
|
||||
int channel;
|
||||
enum ieee80211_phymode phymode;
|
||||
int ssi;
|
||||
int signal;
|
||||
int noise;
|
||||
int antenna;
|
||||
int rate;
|
||||
int rate_idx;
|
||||
int flag;
|
||||
};
|
||||
|
||||
@@ -360,12 +324,14 @@ struct ieee80211_rx_status {
|
||||
*
|
||||
* @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
|
||||
* because the destination STA was in powersave mode.
|
||||
*
|
||||
* @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
|
||||
* @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status
|
||||
* is for the whole aggregation.
|
||||
*/
|
||||
enum ieee80211_tx_status_flags {
|
||||
IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
|
||||
IEEE80211_TX_STATUS_ACK = 1<<1,
|
||||
IEEE80211_TX_STATUS_AMPDU = 1<<2,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -376,24 +342,25 @@ enum ieee80211_tx_status_flags {
|
||||
*
|
||||
* @control: a copy of the &struct ieee80211_tx_control passed to the driver
|
||||
* in the tx() callback.
|
||||
*
|
||||
* @flags: transmit status flags, defined above
|
||||
*
|
||||
* @ack_signal: signal strength of the ACK frame
|
||||
*
|
||||
* @retry_count: number of retries
|
||||
* @excessive_retries: set to 1 if the frame was retried many times
|
||||
* but not acknowledged
|
||||
*
|
||||
* @retry_count: number of retries
|
||||
*
|
||||
* @ampdu_ack_len: number of aggregated frames.
|
||||
* relevant only if IEEE80211_TX_STATUS_AMPDU was set.
|
||||
* @ampdu_ack_map: block ack bit map for the aggregation.
|
||||
* relevant only if IEEE80211_TX_STATUS_AMPDU was set.
|
||||
* @ack_signal: signal strength of the ACK frame
|
||||
* @queue_length: ?? REMOVE
|
||||
* @queue_number: ?? REMOVE
|
||||
*/
|
||||
struct ieee80211_tx_status {
|
||||
struct ieee80211_tx_control control;
|
||||
u8 flags;
|
||||
bool excessive_retries;
|
||||
u8 retry_count;
|
||||
bool excessive_retries;
|
||||
u8 ampdu_ack_len;
|
||||
u64 ampdu_ack_map;
|
||||
int ack_signal;
|
||||
int queue_length;
|
||||
int queue_number;
|
||||
@@ -406,11 +373,12 @@ struct ieee80211_tx_status {
|
||||
*
|
||||
* @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
|
||||
* @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
|
||||
*
|
||||
* @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
|
||||
*/
|
||||
enum ieee80211_conf_flags {
|
||||
IEEE80211_CONF_SHORT_SLOT_TIME = 1<<0,
|
||||
IEEE80211_CONF_RADIOTAP = 1<<1,
|
||||
IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
|
||||
IEEE80211_CONF_RADIOTAP = (1<<1),
|
||||
IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -420,38 +388,32 @@ enum ieee80211_conf_flags {
|
||||
*
|
||||
* @radio_enabled: when zero, driver is required to switch off the radio.
|
||||
* TODO make a flag
|
||||
* @channel: IEEE 802.11 channel number
|
||||
* @freq: frequency in MHz
|
||||
* @channel_val: hardware specific channel value for the channel
|
||||
* @phymode: PHY mode to activate (REMOVE)
|
||||
* @chan: channel to switch to, pointer to the channel information
|
||||
* @mode: pointer to mode definition
|
||||
* @regulatory_domain: ??
|
||||
* @beacon_int: beacon interval (TODO make interface config)
|
||||
* @flags: configuration flags defined above
|
||||
* @power_level: transmit power limit for current regulatory domain in dBm
|
||||
* @antenna_max: maximum antenna gain
|
||||
* @power_level: requested transmit power (in dBm)
|
||||
* @max_antenna_gain: maximum antenna gain (in dBi)
|
||||
* @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
|
||||
* 1/2: antenna 0/1
|
||||
* @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
|
||||
* @ht_conf: describes current self configuration of 802.11n HT capabilies
|
||||
* @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
|
||||
* @channel: the channel to tune to
|
||||
*/
|
||||
struct ieee80211_conf {
|
||||
int channel; /* IEEE 802.11 channel number */
|
||||
int freq; /* MHz */
|
||||
int channel_val; /* hw specific value for the channel */
|
||||
|
||||
enum ieee80211_phymode phymode;
|
||||
struct ieee80211_channel *chan;
|
||||
struct ieee80211_hw_mode *mode;
|
||||
unsigned int regulatory_domain;
|
||||
int radio_enabled;
|
||||
|
||||
int beacon_int;
|
||||
u32 flags;
|
||||
u8 power_level;
|
||||
u8 antenna_max;
|
||||
int power_level;
|
||||
int max_antenna_gain;
|
||||
u8 antenna_sel_tx;
|
||||
u8 antenna_sel_rx;
|
||||
|
||||
struct ieee80211_channel *channel;
|
||||
|
||||
struct ieee80211_ht_info ht_conf;
|
||||
struct ieee80211_ht_bss_info ht_bss_conf;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -479,14 +441,28 @@ enum ieee80211_if_types {
|
||||
IEEE80211_IF_TYPE_VLAN,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_vif - per-interface data
|
||||
*
|
||||
* Data in this structure is continually present for driver
|
||||
* use during the life of a virtual interface.
|
||||
*
|
||||
* @type: type of this virtual interface
|
||||
* @drv_priv: data area for driver use, will always be aligned to
|
||||
* sizeof(void *).
|
||||
*/
|
||||
struct ieee80211_vif {
|
||||
enum ieee80211_if_types type;
|
||||
/* must be last */
|
||||
u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_if_init_conf - initial configuration of an interface
|
||||
*
|
||||
* @if_id: internal interface ID. This number has no particular meaning to
|
||||
* drivers and the only allowed usage is to pass it to
|
||||
* ieee80211_beacon_get() and ieee80211_get_buffered_bc() functions.
|
||||
* This field is not valid for monitor interfaces
|
||||
* (interfaces of %IEEE80211_IF_TYPE_MNTR type).
|
||||
* @vif: pointer to a driver-use per-interface structure. The pointer
|
||||
* itself is also used for various functions including
|
||||
* ieee80211_beacon_get() and ieee80211_get_buffered_bc().
|
||||
* @type: one of &enum ieee80211_if_types constants. Determines the type of
|
||||
* added/removed interface.
|
||||
* @mac_addr: pointer to MAC address of the interface. This pointer is valid
|
||||
@@ -503,8 +479,8 @@ enum ieee80211_if_types {
|
||||
* in pure monitor mode.
|
||||
*/
|
||||
struct ieee80211_if_init_conf {
|
||||
int if_id;
|
||||
enum ieee80211_if_types type;
|
||||
struct ieee80211_vif *vif;
|
||||
void *mac_addr;
|
||||
};
|
||||
|
||||
@@ -597,9 +573,6 @@ struct ieee80211_key_conf {
|
||||
u8 key[0];
|
||||
};
|
||||
|
||||
#define IEEE80211_SEQ_COUNTER_RX 0
|
||||
#define IEEE80211_SEQ_COUNTER_TX 1
|
||||
|
||||
/**
|
||||
* enum set_key_cmd - key command
|
||||
*
|
||||
@@ -659,15 +632,19 @@ enum sta_notify_cmd {
|
||||
* %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because
|
||||
* otherwise the stack will not know when the DTIM beacon was sent.
|
||||
*
|
||||
* @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED:
|
||||
* Channels are already configured to the default regulatory domain
|
||||
* specified in the device's EEPROM
|
||||
* @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE:
|
||||
* Hardware is not capable of short slot operation on the 2.4 GHz band.
|
||||
*
|
||||
* @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
|
||||
* Hardware is not capable of receiving frames with short preamble on
|
||||
* the 2.4 GHz band.
|
||||
*/
|
||||
enum ieee80211_hw_flags {
|
||||
IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
|
||||
IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
|
||||
IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
|
||||
IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<3,
|
||||
IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
|
||||
IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -679,7 +656,8 @@ enum ieee80211_hw_flags {
|
||||
* @wiphy: This points to the &struct wiphy allocated for this
|
||||
* 802.11 PHY. You must fill in the @perm_addr and @dev
|
||||
* members of this structure using SET_IEEE80211_DEV()
|
||||
* and SET_IEEE80211_PERM_ADDR().
|
||||
* and SET_IEEE80211_PERM_ADDR(). Additionally, all supported
|
||||
* bands (with channels, bitrates) are registered here.
|
||||
*
|
||||
* @conf: &struct ieee80211_conf, device configuration, don't use.
|
||||
*
|
||||
@@ -706,15 +684,24 @@ enum ieee80211_hw_flags {
|
||||
*
|
||||
* @queues: number of available hardware transmit queues for
|
||||
* data packets. WMM/QoS requires at least four.
|
||||
*
|
||||
* @rate_control_algorithm: rate control algorithm for this hardware.
|
||||
* If unset (NULL), the default algorithm will be used. Must be
|
||||
* set before calling ieee80211_register_hw().
|
||||
*
|
||||
* @vif_data_size: size (in bytes) of the drv_priv data area
|
||||
* within &struct ieee80211_vif.
|
||||
*/
|
||||
struct ieee80211_hw {
|
||||
struct ieee80211_conf conf;
|
||||
struct wiphy *wiphy;
|
||||
struct workqueue_struct *workqueue;
|
||||
const char *rate_control_algorithm;
|
||||
void *priv;
|
||||
u32 flags;
|
||||
unsigned int extra_tx_headroom;
|
||||
int channel_change_time;
|
||||
int vif_data_size;
|
||||
u8 queues;
|
||||
s8 max_rssi;
|
||||
s8 max_signal;
|
||||
@@ -854,19 +841,22 @@ enum ieee80211_filter_flags {
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_erp_change_flags - erp change flags
|
||||
* enum ieee80211_ampdu_mlme_action - A-MPDU actions
|
||||
*
|
||||
* These flags are used with the erp_ie_changed() callback in
|
||||
* &struct ieee80211_ops to indicate which parameter(s) changed.
|
||||
* @IEEE80211_ERP_CHANGE_PROTECTION: protection changed
|
||||
* @IEEE80211_ERP_CHANGE_PREAMBLE: barker preamble mode changed
|
||||
* These flags are used with the ampdu_action() callback in
|
||||
* &struct ieee80211_ops to indicate which action is needed.
|
||||
* @IEEE80211_AMPDU_RX_START: start Rx aggregation
|
||||
* @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
|
||||
* @IEEE80211_AMPDU_TX_START: start Tx aggregation
|
||||
* @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
|
||||
*/
|
||||
enum ieee80211_erp_change_flags {
|
||||
IEEE80211_ERP_CHANGE_PROTECTION = 1<<0,
|
||||
IEEE80211_ERP_CHANGE_PREAMBLE = 1<<1,
|
||||
enum ieee80211_ampdu_mlme_action {
|
||||
IEEE80211_AMPDU_RX_START,
|
||||
IEEE80211_AMPDU_RX_STOP,
|
||||
IEEE80211_AMPDU_TX_START,
|
||||
IEEE80211_AMPDU_TX_STOP,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct ieee80211_ops - callbacks from mac80211 to the driver
|
||||
*
|
||||
@@ -922,6 +912,14 @@ enum ieee80211_erp_change_flags {
|
||||
* @config_interface: Handler for configuration requests related to interfaces
|
||||
* (e.g. BSSID changes.)
|
||||
*
|
||||
* @bss_info_changed: Handler for configuration requests related to BSS
|
||||
* parameters that may vary during BSS's lifespan, and may affect low
|
||||
* level driver (e.g. assoc/disassoc status, erp parameters).
|
||||
* This function should not be used if no BSS has been set, unless
|
||||
* for association indication. The @changed parameter indicates which
|
||||
* of the bss parameters has changed when a call is made. This callback
|
||||
* has to be atomic.
|
||||
*
|
||||
* @configure_filter: Configure the device's RX filter.
|
||||
* See the section "Frame filtering" for more information.
|
||||
* This callback must be implemented and atomic.
|
||||
@@ -936,30 +934,16 @@ enum ieee80211_erp_change_flags {
|
||||
* and remove_interface calls, i.e. while the interface with the
|
||||
* given local_address is enabled.
|
||||
*
|
||||
* @set_ieee8021x: Enable/disable IEEE 802.1X. This item requests wlan card
|
||||
* to pass unencrypted EAPOL-Key frames even when encryption is
|
||||
* configured. If the wlan card does not require such a configuration,
|
||||
* this function pointer can be set to NULL.
|
||||
*
|
||||
* @set_port_auth: Set port authorization state (IEEE 802.1X PAE) to be
|
||||
* authorized (@authorized=1) or unauthorized (=0). This function can be
|
||||
* used if the wlan hardware or low-level driver implements PAE.
|
||||
* mac80211 will filter frames based on authorization state in any case,
|
||||
* so this function pointer can be NULL if low-level driver does not
|
||||
* require event notification about port state changes.
|
||||
*
|
||||
* @hw_scan: Ask the hardware to service the scan request, no need to start
|
||||
* the scan state machine in stack.
|
||||
* the scan state machine in stack. The scan must honour the channel
|
||||
* configuration done by the regulatory agent in the wiphy's registered
|
||||
* bands.
|
||||
*
|
||||
* @get_stats: return low-level statistics
|
||||
*
|
||||
* @set_privacy_invoked: For devices that generate their own beacons and probe
|
||||
* response or association responses this updates the state of privacy_invoked
|
||||
* returns 0 for success or an error number.
|
||||
*
|
||||
* @get_sequence_counter: For devices that have internal sequence counters this
|
||||
* callback allows mac80211 to access the current value of a counter.
|
||||
* This callback seems not well-defined, tell us if you need it.
|
||||
* @get_tkip_seq: If your device implements TKIP encryption in hardware this
|
||||
* callback should be provided to read the TKIP transmit IVs (both IV32
|
||||
* and IV16) for the given key from hardware.
|
||||
*
|
||||
* @set_rts_threshold: Configuration of RTS threshold (if device needs it)
|
||||
*
|
||||
@@ -972,8 +956,6 @@ enum ieee80211_erp_change_flags {
|
||||
* @sta_notify: Notifies low level driver about addition or removal
|
||||
* of assocaited station or AP.
|
||||
*
|
||||
* @erp_ie_changed: Handle ERP IE change notifications. Must be atomic.
|
||||
*
|
||||
* @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
|
||||
* bursting) for a hardware TX queue. The @queue parameter uses the
|
||||
* %IEEE80211_TX_QUEUE_* constants. Must be atomic.
|
||||
@@ -1008,6 +990,15 @@ enum ieee80211_erp_change_flags {
|
||||
* @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
|
||||
* This is needed only for IBSS mode and the result of this function is
|
||||
* used to determine whether to reply to Probe Requests.
|
||||
*
|
||||
* @conf_ht: Configures low level driver with 802.11n HT data. Must be atomic.
|
||||
*
|
||||
* @ampdu_action: Perform a certain A-MPDU action
|
||||
* The RA/TID combination determines the destination and TID we want
|
||||
* the ampdu action to be performed for. The action is defined through
|
||||
* ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
|
||||
* is the first frame we expect to perform the action on. notice
|
||||
* that TX/RX_STOP can pass NULL for this parameter.
|
||||
*/
|
||||
struct ieee80211_ops {
|
||||
int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
@@ -1020,7 +1011,12 @@ struct ieee80211_ops {
|
||||
struct ieee80211_if_init_conf *conf);
|
||||
int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
|
||||
int (*config_interface)(struct ieee80211_hw *hw,
|
||||
int if_id, struct ieee80211_if_conf *conf);
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_if_conf *conf);
|
||||
void (*bss_info_changed)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_bss_conf *info,
|
||||
u32 changed);
|
||||
void (*configure_filter)(struct ieee80211_hw *hw,
|
||||
unsigned int changed_flags,
|
||||
unsigned int *total_flags,
|
||||
@@ -1029,25 +1025,17 @@ struct ieee80211_ops {
|
||||
int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
const u8 *local_address, const u8 *address,
|
||||
struct ieee80211_key_conf *key);
|
||||
int (*set_ieee8021x)(struct ieee80211_hw *hw, int use_ieee8021x);
|
||||
int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr,
|
||||
int authorized);
|
||||
int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
|
||||
int (*get_stats)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_low_level_stats *stats);
|
||||
int (*set_privacy_invoked)(struct ieee80211_hw *hw,
|
||||
int privacy_invoked);
|
||||
int (*get_sequence_counter)(struct ieee80211_hw *hw,
|
||||
u8* addr, u8 keyidx, u8 txrx,
|
||||
u32* iv32, u16* iv16);
|
||||
void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
|
||||
u32 *iv32, u16 *iv16);
|
||||
int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
|
||||
int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
|
||||
int (*set_retry_limit)(struct ieee80211_hw *hw,
|
||||
u32 short_retry, u32 long_retr);
|
||||
void (*sta_notify)(struct ieee80211_hw *hw, int if_id,
|
||||
void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
enum sta_notify_cmd, const u8 *addr);
|
||||
void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes,
|
||||
int cts_protection, int preamble);
|
||||
int (*conf_tx)(struct ieee80211_hw *hw, int queue,
|
||||
const struct ieee80211_tx_queue_params *params);
|
||||
int (*get_tx_stats)(struct ieee80211_hw *hw,
|
||||
@@ -1058,6 +1046,10 @@ struct ieee80211_ops {
|
||||
struct sk_buff *skb,
|
||||
struct ieee80211_tx_control *control);
|
||||
int (*tx_last_beacon)(struct ieee80211_hw *hw);
|
||||
int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
|
||||
int (*ampdu_action)(struct ieee80211_hw *hw,
|
||||
enum ieee80211_ampdu_mlme_action action,
|
||||
const u8 *addr, u16 tid, u16 *ssn);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1089,6 +1081,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw);
|
||||
extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
|
||||
extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
|
||||
extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
|
||||
extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
|
||||
#endif
|
||||
/**
|
||||
* ieee80211_get_tx_led_name - get name of TX LED
|
||||
@@ -1128,6 +1121,16 @@ static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_get_assoc_led_name - get name of association LED
|
||||
*
|
||||
* mac80211 creates a association LED trigger for each wireless hardware
|
||||
* that can be used to drive LEDs if your driver registers a LED device.
|
||||
* This function returns the name (or %NULL if not configured for LEDs)
|
||||
* of the trigger so you can automatically link the LED device.
|
||||
*
|
||||
* @hw: the hardware to get the LED trigger name for
|
||||
*/
|
||||
static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
|
||||
{
|
||||
#ifdef CONFIG_MAC80211_LEDS
|
||||
@@ -1137,10 +1140,24 @@ static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Register a new hardware PHYMODE capability to the stack. */
|
||||
int ieee80211_register_hwmode(struct ieee80211_hw *hw,
|
||||
struct ieee80211_hw_mode *mode);
|
||||
/**
|
||||
* ieee80211_get_radio_led_name - get name of radio LED
|
||||
*
|
||||
* mac80211 creates a radio change LED trigger for each wireless hardware
|
||||
* that can be used to drive LEDs if your driver registers a LED device.
|
||||
* This function returns the name (or %NULL if not configured for LEDs)
|
||||
* of the trigger so you can automatically link the LED device.
|
||||
*
|
||||
* @hw: the hardware to get the LED trigger name for
|
||||
*/
|
||||
static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
|
||||
{
|
||||
#ifdef CONFIG_MAC80211_LEDS
|
||||
return __ieee80211_get_radio_led_name(hw);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_unregister_hw - Unregister a hardware device
|
||||
@@ -1226,7 +1243,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
|
||||
/**
|
||||
* ieee80211_beacon_get - beacon generation function
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @control: will be filled with information needed to send this beacon.
|
||||
*
|
||||
* If the beacon frames are generated by the host system (i.e., not in
|
||||
@@ -1237,13 +1254,13 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
|
||||
* is responsible of freeing it.
|
||||
*/
|
||||
struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
|
||||
int if_id,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_tx_control *control);
|
||||
|
||||
/**
|
||||
* ieee80211_rts_get - RTS frame generation function
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @frame: pointer to the frame that is going to be protected by the RTS.
|
||||
* @frame_len: the frame length (in octets).
|
||||
* @frame_txctl: &struct ieee80211_tx_control of the frame.
|
||||
@@ -1254,7 +1271,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
|
||||
* the next RTS frame from the 802.11 code. The low-level is responsible
|
||||
* for calling this function before and RTS frame is needed.
|
||||
*/
|
||||
void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id,
|
||||
void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
const void *frame, size_t frame_len,
|
||||
const struct ieee80211_tx_control *frame_txctl,
|
||||
struct ieee80211_rts *rts);
|
||||
@@ -1262,7 +1279,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id,
|
||||
/**
|
||||
* ieee80211_rts_duration - Get the duration field for an RTS frame
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @frame_len: the length of the frame that is going to be protected by the RTS.
|
||||
* @frame_txctl: &struct ieee80211_tx_control of the frame.
|
||||
*
|
||||
@@ -1270,14 +1287,14 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id,
|
||||
* the duration field, the low-level driver uses this function to receive
|
||||
* the duration field value in little-endian byteorder.
|
||||
*/
|
||||
__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, int if_id,
|
||||
size_t frame_len,
|
||||
__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif, size_t frame_len,
|
||||
const struct ieee80211_tx_control *frame_txctl);
|
||||
|
||||
/**
|
||||
* ieee80211_ctstoself_get - CTS-to-self frame generation function
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @frame: pointer to the frame that is going to be protected by the CTS-to-self.
|
||||
* @frame_len: the frame length (in octets).
|
||||
* @frame_txctl: &struct ieee80211_tx_control of the frame.
|
||||
@@ -1288,7 +1305,8 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, int if_id,
|
||||
* the next CTS-to-self frame from the 802.11 code. The low-level is responsible
|
||||
* for calling this function before and CTS-to-self frame is needed.
|
||||
*/
|
||||
void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id,
|
||||
void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
const void *frame, size_t frame_len,
|
||||
const struct ieee80211_tx_control *frame_txctl,
|
||||
struct ieee80211_cts *cts);
|
||||
@@ -1296,7 +1314,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id,
|
||||
/**
|
||||
* ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
|
||||
* @frame_txctl: &struct ieee80211_tx_control of the frame.
|
||||
*
|
||||
@@ -1304,28 +1322,30 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id,
|
||||
* the duration field, the low-level driver uses this function to receive
|
||||
* the duration field value in little-endian byteorder.
|
||||
*/
|
||||
__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, int if_id,
|
||||
__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
size_t frame_len,
|
||||
const struct ieee80211_tx_control *frame_txctl);
|
||||
|
||||
/**
|
||||
* ieee80211_generic_frame_duration - Calculate the duration field for a frame
|
||||
* @hw: pointer obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @frame_len: the length of the frame.
|
||||
* @rate: the rate (in 100kbps) at which the frame is going to be transmitted.
|
||||
* @rate: the rate at which the frame is going to be transmitted.
|
||||
*
|
||||
* Calculate the duration field of some generic frame, given its
|
||||
* length and transmission rate (in 100kbps).
|
||||
*/
|
||||
__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, int if_id,
|
||||
__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
size_t frame_len,
|
||||
int rate);
|
||||
struct ieee80211_rate *rate);
|
||||
|
||||
/**
|
||||
* ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @if_id: interface ID from &struct ieee80211_if_init_conf.
|
||||
* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
|
||||
* @control: will be filled with information needed to send returned frame.
|
||||
*
|
||||
* Function for accessing buffered broadcast and multicast frames. If
|
||||
@@ -1344,7 +1364,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, int if_id,
|
||||
* use common code for all beacons.
|
||||
*/
|
||||
struct sk_buff *
|
||||
ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id,
|
||||
ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct ieee80211_tx_control *control);
|
||||
|
||||
/**
|
||||
@@ -1422,8 +1442,96 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
|
||||
*/
|
||||
void ieee80211_scan_completed(struct ieee80211_hw *hw);
|
||||
|
||||
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
#define MAC_ARG(x) ((u8*)(x))[0], ((u8*)(x))[1], ((u8*)(x))[2], \
|
||||
((u8*)(x))[3], ((u8*)(x))[4], ((u8*)(x))[5]
|
||||
/**
|
||||
* ieee80211_iterate_active_interfaces - iterate active interfaces
|
||||
*
|
||||
* This function iterates over the interfaces associated with a given
|
||||
* hardware that are currently active and calls the callback for them.
|
||||
*
|
||||
* @hw: the hardware struct of which the interfaces should be iterated over
|
||||
* @iterator: the iterator function to call, cannot sleep
|
||||
* @data: first argument of the iterator function
|
||||
*/
|
||||
void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
|
||||
void (*iterator)(void *data, u8 *mac,
|
||||
struct ieee80211_vif *vif),
|
||||
void *data);
|
||||
|
||||
/**
|
||||
* ieee80211_start_tx_ba_session - Start a tx Block Ack session.
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @ra: receiver address of the BA session recipient
|
||||
* @tid: the TID to BA on.
|
||||
* @return: success if addBA request was sent, failure otherwise
|
||||
*
|
||||
* Although mac80211/low level driver/user space application can estimate
|
||||
* the need to start aggregation on a certain RA/TID, the session level
|
||||
* will be managed by the mac80211.
|
||||
*/
|
||||
int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid);
|
||||
|
||||
/**
|
||||
* ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @ra: receiver address of the BA session recipient.
|
||||
* @tid: the TID to BA on.
|
||||
*
|
||||
* This function must be called by low level driver once it has
|
||||
* finished with preparations for the BA session.
|
||||
*/
|
||||
void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
|
||||
|
||||
/**
|
||||
* ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @ra: receiver address of the BA session recipient.
|
||||
* @tid: the TID to BA on.
|
||||
*
|
||||
* This function must be called by low level driver once it has
|
||||
* finished with preparations for the BA session.
|
||||
* This version of the function is irq safe.
|
||||
*/
|
||||
void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
|
||||
u16 tid);
|
||||
|
||||
/**
|
||||
* ieee80211_stop_tx_ba_session - Stop a Block Ack session.
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @ra: receiver address of the BA session recipient
|
||||
* @tid: the TID to stop BA.
|
||||
* @initiator: if indicates initiator DELBA frame will be sent.
|
||||
* @return: error if no sta with matching da found, success otherwise
|
||||
*
|
||||
* Although mac80211/low level driver/user space application can estimate
|
||||
* the need to stop aggregation on a certain RA/TID, the session level
|
||||
* will be managed by the mac80211.
|
||||
*/
|
||||
int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
|
||||
u8 *ra, u16 tid,
|
||||
enum ieee80211_back_parties initiator);
|
||||
|
||||
/**
|
||||
* ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @ra: receiver address of the BA session recipient.
|
||||
* @tid: the desired TID to BA on.
|
||||
*
|
||||
* This function must be called by low level driver once it has
|
||||
* finished with preparations for the BA session tear down.
|
||||
*/
|
||||
void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
|
||||
|
||||
/**
|
||||
* ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
|
||||
* @hw: pointer as obtained from ieee80211_alloc_hw().
|
||||
* @ra: receiver address of the BA session recipient.
|
||||
* @tid: the desired TID to BA on.
|
||||
*
|
||||
* This function must be called by low level driver once it has
|
||||
* finished with preparations for the BA session tear down.
|
||||
* This version of the function is irq safe.
|
||||
*/
|
||||
void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
|
||||
u16 tid);
|
||||
|
||||
#endif /* MAC80211_H */
|
||||
|
||||
307
package/mac80211/src/include/net/wireless.h
Normal file
307
package/mac80211/src/include/net/wireless.h
Normal file
@@ -0,0 +1,307 @@
|
||||
#ifndef __NET_WIRELESS_H
|
||||
#define __NET_WIRELESS_H
|
||||
|
||||
/*
|
||||
* 802.11 device management
|
||||
*
|
||||
* Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
|
||||
*/
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/list.h>
|
||||
#include <net/cfg80211.h>
|
||||
|
||||
/**
|
||||
* enum ieee80211_band - supported frequency bands
|
||||
*
|
||||
* The bands are assigned this way because the supported
|
||||
* bitrates differ in these bands.
|
||||
*
|
||||
* @IEEE80211_BAND_2GHZ: 2.4GHz ISM band
|
||||
* @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
|
||||
*/
|
||||
enum ieee80211_band {
|
||||
IEEE80211_BAND_2GHZ,
|
||||
IEEE80211_BAND_5GHZ,
|
||||
|
||||
/* keep last */
|
||||
IEEE80211_NUM_BANDS
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_channel_flags - channel flags
|
||||
*
|
||||
* Channel flags set by the regulatory control code.
|
||||
*
|
||||
* @IEEE80211_CHAN_DISABLED: This channel is disabled.
|
||||
* @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted
|
||||
* on this channel.
|
||||
* @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
|
||||
* @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
|
||||
*/
|
||||
enum ieee80211_channel_flags {
|
||||
IEEE80211_CHAN_DISABLED = 1<<0,
|
||||
IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
|
||||
IEEE80211_CHAN_NO_IBSS = 1<<2,
|
||||
IEEE80211_CHAN_RADAR = 1<<3,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_channel - channel definition
|
||||
*
|
||||
* This structure describes a single channel for use
|
||||
* with cfg80211.
|
||||
*
|
||||
* @center_freq: center frequency in MHz
|
||||
* @hw_value: hardware-specific value for the channel
|
||||
* @flags: channel flags from &enum ieee80211_channel_flags.
|
||||
* @orig_flags: channel flags at registration time, used by regulatory
|
||||
* code to support devices with additional restrictions
|
||||
* @band: band this channel belongs to.
|
||||
* @max_antenna_gain: maximum antenna gain in dBi
|
||||
* @max_power: maximum transmission power (in dBm)
|
||||
* @orig_mag: internal use
|
||||
* @orig_mpwr: internal use
|
||||
*/
|
||||
struct ieee80211_channel {
|
||||
enum ieee80211_band band;
|
||||
u16 center_freq;
|
||||
u16 hw_value;
|
||||
u32 flags;
|
||||
int max_antenna_gain;
|
||||
int max_power;
|
||||
u32 orig_flags;
|
||||
int orig_mag, orig_mpwr;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_rate_flags - rate flags
|
||||
*
|
||||
* Hardware/specification flags for rates. These are structured
|
||||
* in a way that allows using the same bitrate structure for
|
||||
* different bands/PHY modes.
|
||||
*
|
||||
* @IEEE80211_RATE_SHORT_PREAMBLE: Hardware can send with short
|
||||
* preamble on this bitrate; only relevant in 2.4GHz band and
|
||||
* with CCK rates.
|
||||
* @IEEE80211_RATE_MANDATORY_A: This bitrate is a mandatory rate
|
||||
* when used with 802.11a (on the 5 GHz band); filled by the
|
||||
* core code when registering the wiphy.
|
||||
* @IEEE80211_RATE_MANDATORY_B: This bitrate is a mandatory rate
|
||||
* when used with 802.11b (on the 2.4 GHz band); filled by the
|
||||
* core code when registering the wiphy.
|
||||
* @IEEE80211_RATE_MANDATORY_G: This bitrate is a mandatory rate
|
||||
* when used with 802.11g (on the 2.4 GHz band); filled by the
|
||||
* core code when registering the wiphy.
|
||||
* @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode.
|
||||
*/
|
||||
enum ieee80211_rate_flags {
|
||||
IEEE80211_RATE_SHORT_PREAMBLE = 1<<0,
|
||||
IEEE80211_RATE_MANDATORY_A = 1<<1,
|
||||
IEEE80211_RATE_MANDATORY_B = 1<<2,
|
||||
IEEE80211_RATE_MANDATORY_G = 1<<3,
|
||||
IEEE80211_RATE_ERP_G = 1<<4,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_rate - bitrate definition
|
||||
*
|
||||
* This structure describes a bitrate that an 802.11 PHY can
|
||||
* operate with. The two values @hw_value and @hw_value_short
|
||||
* are only for driver use when pointers to this structure are
|
||||
* passed around.
|
||||
*
|
||||
* @flags: rate-specific flags
|
||||
* @bitrate: bitrate in units of 100 Kbps
|
||||
* @hw_value: driver/hardware value for this rate
|
||||
* @hw_value_short: driver/hardware value for this rate when
|
||||
* short preamble is used
|
||||
*/
|
||||
struct ieee80211_rate {
|
||||
u32 flags;
|
||||
u16 bitrate;
|
||||
u16 hw_value, hw_value_short;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_ht_info - describing STA's HT capabilities
|
||||
*
|
||||
* This structure describes most essential parameters needed
|
||||
* to describe 802.11n HT capabilities for an STA.
|
||||
*
|
||||
* @ht_supported: is HT supported by STA, 0: no, 1: yes
|
||||
* @cap: HT capabilities map as described in 802.11n spec
|
||||
* @ampdu_factor: Maximum A-MPDU length factor
|
||||
* @ampdu_density: Minimum A-MPDU spacing
|
||||
* @supp_mcs_set: Supported MCS set as described in 802.11n spec
|
||||
*/
|
||||
struct ieee80211_ht_info {
|
||||
u16 cap; /* use IEEE80211_HT_CAP_ */
|
||||
u8 ht_supported;
|
||||
u8 ampdu_factor;
|
||||
u8 ampdu_density;
|
||||
u8 supp_mcs_set[16];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_supported_band - frequency band definition
|
||||
*
|
||||
* This structure describes a frequency band a wiphy
|
||||
* is able to operate in.
|
||||
*
|
||||
* @channels: Array of channels the hardware can operate in
|
||||
* in this band.
|
||||
* @band: the band this structure represents
|
||||
* @n_channels: Number of channels in @channels
|
||||
* @bitrates: Array of bitrates the hardware can operate with
|
||||
* in this band. Must be sorted to give a valid "supported
|
||||
* rates" IE, i.e. CCK rates first, then OFDM.
|
||||
* @n_bitrates: Number of bitrates in @bitrates
|
||||
*/
|
||||
struct ieee80211_supported_band {
|
||||
struct ieee80211_channel *channels;
|
||||
struct ieee80211_rate *bitrates;
|
||||
enum ieee80211_band band;
|
||||
int n_channels;
|
||||
int n_bitrates;
|
||||
struct ieee80211_ht_info ht_info;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wiphy - wireless hardware description
|
||||
* @idx: the wiphy index assigned to this item
|
||||
* @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
|
||||
*/
|
||||
struct wiphy {
|
||||
/* assign these fields before you register the wiphy */
|
||||
|
||||
/* permanent MAC address */
|
||||
u8 perm_addr[ETH_ALEN];
|
||||
|
||||
/* If multiple wiphys are registered and you're handed e.g.
|
||||
* a regular netdev with assigned ieee80211_ptr, you won't
|
||||
* know whether it points to a wiphy your driver has registered
|
||||
* or not. Assign this to something global to your driver to
|
||||
* help determine whether you own this wiphy or not. */
|
||||
void *privid;
|
||||
|
||||
struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
|
||||
|
||||
/* fields below are read-only, assigned by cfg80211 */
|
||||
|
||||
/* the item in /sys/class/ieee80211/ points to this,
|
||||
* you need use set_wiphy_dev() (see below) */
|
||||
struct device dev;
|
||||
|
||||
/* dir in debugfs: ieee80211/<wiphyname> */
|
||||
struct dentry *debugfsdir;
|
||||
|
||||
char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
|
||||
};
|
||||
|
||||
/** struct wireless_dev - wireless per-netdev state
|
||||
*
|
||||
* This structure must be allocated by the driver/stack
|
||||
* that uses the ieee80211_ptr field in struct net_device
|
||||
* (this is intentional so it can be allocated along with
|
||||
* the netdev.)
|
||||
*
|
||||
* @wiphy: pointer to hardware description
|
||||
*/
|
||||
struct wireless_dev {
|
||||
struct wiphy *wiphy;
|
||||
|
||||
/* private to the generic wireless code */
|
||||
struct list_head list;
|
||||
struct net_device *netdev;
|
||||
};
|
||||
|
||||
/**
|
||||
* wiphy_priv - return priv from wiphy
|
||||
*/
|
||||
static inline void *wiphy_priv(struct wiphy *wiphy)
|
||||
{
|
||||
BUG_ON(!wiphy);
|
||||
return &wiphy->priv;
|
||||
}
|
||||
|
||||
/**
|
||||
* set_wiphy_dev - set device pointer for wiphy
|
||||
*/
|
||||
static inline void set_wiphy_dev(struct wiphy *wiphy, struct device *dev)
|
||||
{
|
||||
wiphy->dev.parent = dev;
|
||||
}
|
||||
|
||||
/**
|
||||
* wiphy_dev - get wiphy dev pointer
|
||||
*/
|
||||
static inline struct device *wiphy_dev(struct wiphy *wiphy)
|
||||
{
|
||||
return wiphy->dev.parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* wiphy_name - get wiphy name
|
||||
*/
|
||||
static inline char *wiphy_name(struct wiphy *wiphy)
|
||||
{
|
||||
return wiphy->dev.bus_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* wdev_priv - return wiphy priv from wireless_dev
|
||||
*/
|
||||
static inline void *wdev_priv(struct wireless_dev *wdev)
|
||||
{
|
||||
BUG_ON(!wdev);
|
||||
return wiphy_priv(wdev->wiphy);
|
||||
}
|
||||
|
||||
/**
|
||||
* wiphy_new - create a new wiphy for use with cfg80211
|
||||
*
|
||||
* create a new wiphy and associate the given operations with it.
|
||||
* @sizeof_priv bytes are allocated for private use.
|
||||
*
|
||||
* the returned pointer must be assigned to each netdev's
|
||||
* ieee80211_ptr for proper operation.
|
||||
*/
|
||||
struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv);
|
||||
|
||||
/**
|
||||
* wiphy_register - register a wiphy with cfg80211
|
||||
*
|
||||
* register the given wiphy
|
||||
*
|
||||
* Returns a non-negative wiphy index or a negative error code.
|
||||
*/
|
||||
extern int wiphy_register(struct wiphy *wiphy);
|
||||
|
||||
/**
|
||||
* wiphy_unregister - deregister a wiphy from cfg80211
|
||||
*
|
||||
* unregister a device with the given priv pointer.
|
||||
* After this call, no more requests can be made with this priv
|
||||
* pointer, but the call may sleep to wait for an outstanding
|
||||
* request that is being handled.
|
||||
*/
|
||||
extern void wiphy_unregister(struct wiphy *wiphy);
|
||||
|
||||
/**
|
||||
* wiphy_free - free wiphy
|
||||
*/
|
||||
extern void wiphy_free(struct wiphy *wiphy);
|
||||
|
||||
/**
|
||||
* ieee80211_channel_to_frequency - convert channel number to frequency
|
||||
*/
|
||||
extern int ieee80211_channel_to_frequency(int chan);
|
||||
|
||||
/**
|
||||
* ieee80211_frequency_to_channel - convert frequency to channel number
|
||||
*/
|
||||
extern int ieee80211_frequency_to_channel(int freq);
|
||||
|
||||
#endif /* __NET_WIRELESS_H */
|
||||
Reference in New Issue
Block a user