mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi
[safe/jmp/linux-2.6] / include / net / cfg80211.h
index c0d1f5b..5389afd 100644 (file)
@@ -178,6 +178,8 @@ struct station_parameters {
  * @STATION_INFO_SIGNAL: @signal filled
  * @STATION_INFO_TX_BITRATE: @tx_bitrate fields are filled
  *  (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
+ * @STATION_INFO_RX_PACKETS: @rx_packets filled
+ * @STATION_INFO_TX_PACKETS: @tx_packets filled
  */
 enum station_info_flags {
        STATION_INFO_INACTIVE_TIME      = 1<<0,
@@ -188,6 +190,8 @@ enum station_info_flags {
        STATION_INFO_PLINK_STATE        = 1<<5,
        STATION_INFO_SIGNAL             = 1<<6,
        STATION_INFO_TX_BITRATE         = 1<<7,
+       STATION_INFO_RX_PACKETS         = 1<<8,
+       STATION_INFO_TX_PACKETS         = 1<<9,
 };
 
 /**
@@ -235,6 +239,8 @@ struct rate_info {
  * @plink_state: mesh peer link state
  * @signal: signal strength of last received packet in dBm
  * @txrate: current unicast bitrate to this station
+ * @rx_packets: packets received from this station
+ * @tx_packets: packets transmitted to this station
  */
 struct station_info {
        u32 filled;
@@ -246,6 +252,8 @@ struct station_info {
        u8 plink_state;
        s8 signal;
        struct rate_info txrate;
+       u32 rx_packets;
+       u32 tx_packets;
 };
 
 /**
@@ -341,30 +349,9 @@ struct bss_parameters {
 };
 
 /**
- * enum reg_set_by - Indicates who is trying to set the regulatory domain
- * @REGDOM_SET_BY_INIT: regulatory domain was set by initialization. We will be
- *     using a static world regulatory domain by default.
- * @REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world regulatory domain.
- * @REGDOM_SET_BY_USER: User asked the wireless core to set the
- *     regulatory domain.
- * @REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the wireless core
- *     it thinks its knows the regulatory domain we should be in.
- * @REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an 802.11 country
- *     information element with regulatory information it thinks we
- *     should consider.
- */
-enum reg_set_by {
-       REGDOM_SET_BY_INIT,
-       REGDOM_SET_BY_CORE,
-       REGDOM_SET_BY_USER,
-       REGDOM_SET_BY_DRIVER,
-       REGDOM_SET_BY_COUNTRY_IE,
-};
-
-/**
  * enum environment_cap - Environment parsed from country IE
  * @ENVIRON_ANY: indicates country IE applies to both indoor and
- *     outdoor operation.
+ *     outdoor operation.
  * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation
  * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation
  */
@@ -375,15 +362,15 @@ enum environment_cap {
 };
 
 /**
- * struct regulatory_request - receipt of last regulatory request
+ * struct regulatory_request - used to keep track of regulatory requests
  *
- * @wiphy: this is set if this request's initiator is
+ * @wiphy_idx: this is set if this request's initiator is
  *     %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
  *     can be used by the wireless core to deal with conflicts
  *     and potentially inform users of which devices specifically
  *     cased the conflicts.
  * @initiator: indicates who sent this request, could be any of
- *     of those set in reg_set_by, %REGDOM_SET_BY_*
+ *     of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
  * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
  *     regulatory domain. We have a few special codes:
  *     00 - World regulatory domain
@@ -396,14 +383,16 @@ enum environment_cap {
  *     country IE
  * @country_ie_env: lets us know if the AP is telling us we are outdoor,
  *     indoor, or if it doesn't matter
+ * @list: used to insert into the reg_requests_list linked list
  */
 struct regulatory_request {
-       struct wiphy *wiphy;
-       enum reg_set_by initiator;
+       int wiphy_idx;
+       enum nl80211_reg_initiator initiator;
        char alpha2[2];
        bool intersect;
        u32 country_ie_checksum;
        enum environment_cap country_ie_env;
+       struct list_head list;
 };
 
 struct ieee80211_freq_range {
@@ -482,26 +471,6 @@ struct ieee80211_txq_params {
        u8 aifs;
 };
 
-/**
- * struct mgmt_extra_ie_params - Extra management frame IE parameters
- *
- * Used to add extra IE(s) into management frames. If the driver cannot add the
- * requested data into all management frames of the specified subtype that are
- * generated in kernel or firmware/hardware, it must reject the configuration
- * call. The IE data buffer is added to the end of the specified management
- * frame body after all other IEs. This addition is not applied to frames that
- * are injected through a monitor interface.
- *
- * @subtype: Management frame subtype
- * @ies: IE data buffer or %NULL to remove previous data
- * @ies_len: Length of @ies in octets
- */
-struct mgmt_extra_ie_params {
-       u8 subtype;
-       u8 *ies;
-       int ies_len;
-};
-
 /* from net/wireless.h */
 struct wiphy;
 
@@ -525,6 +494,8 @@ struct cfg80211_ssid {
  * @n_ssids: number of SSIDs
  * @channels: channels to scan on.
  * @n_channels: number of channels for each band
+ * @ie: optional information element(s) to add into Probe Request or %NULL
+ * @ie_len: length of ie in octets
  * @wiphy: the wiphy this was for
  * @ifidx: the interface index
  */
@@ -533,6 +504,8 @@ struct cfg80211_scan_request {
        int n_ssids;
        struct ieee80211_channel **channels;
        u32 n_channels;
+       u8 *ie;
+       size_t ie_len;
 
        /* internal */
        struct wiphy *wiphy;
@@ -565,8 +538,8 @@ enum cfg80211_signal_type {
  * @information_elements: the information elements (Note that there
  *     is no guarantee that these are well-formed!)
  * @len_information_elements: total length of the information elements
- * @signal: signal strength value
- * @signal_type: signal type
+ * @signal: signal strength value (type depends on the wiphy's signal_type)
+ * @hold: BSS should not expire
  * @free_priv: function pointer to free private data
  * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
  */
@@ -581,13 +554,111 @@ struct cfg80211_bss {
        size_t len_information_elements;
 
        s32 signal;
-       enum cfg80211_signal_type signal_type;
 
        void (*free_priv)(struct cfg80211_bss *bss);
        u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
 };
 
 /**
+ * struct cfg80211_auth_request - Authentication request data
+ *
+ * This structure provides information needed to complete IEEE 802.11
+ * authentication.
+ * NOTE: This structure will likely change when more code from mac80211 is
+ * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too.
+ * Before using this in a driver that does not use mac80211, it would be better
+ * to check the status of that work and better yet, volunteer to work on it.
+ *
+ * @chan: The channel to use or %NULL if not specified (auto-select based on
+ *     scan results)
+ * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case);
+ *     this field is required to be present; if the driver wants to help with
+ *     BSS selection, it should use (yet to be added) MLME event to allow user
+ *     space SME to be notified of roaming candidate, so that the SME can then
+ *     use the authentication request with the recommended BSSID and whatever
+ *     other data may be needed for authentication/association
+ * @ssid: SSID or %NULL if not yet available
+ * @ssid_len: Length of ssid in octets
+ * @auth_type: Authentication type (algorithm)
+ * @ie: Extra IEs to add to Authentication frame or %NULL
+ * @ie_len: Length of ie buffer in octets
+ */
+struct cfg80211_auth_request {
+       struct ieee80211_channel *chan;
+       u8 *peer_addr;
+       const u8 *ssid;
+       size_t ssid_len;
+       enum nl80211_auth_type auth_type;
+       const u8 *ie;
+       size_t ie_len;
+};
+
+/**
+ * struct cfg80211_assoc_request - (Re)Association request data
+ *
+ * This structure provides information needed to complete IEEE 802.11
+ * (re)association.
+ * NOTE: This structure will likely change when more code from mac80211 is
+ * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too.
+ * Before using this in a driver that does not use mac80211, it would be better
+ * to check the status of that work and better yet, volunteer to work on it.
+ *
+ * @chan: The channel to use or %NULL if not specified (auto-select based on
+ *     scan results)
+ * @peer_addr: The address of the peer STA (AP BSSID); this field is required
+ *     to be present and the STA must be in State 2 (authenticated) with the
+ *     peer STA
+ * @ssid: SSID
+ * @ssid_len: Length of ssid in octets
+ * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
+ * @ie_len: Length of ie buffer in octets
+ */
+struct cfg80211_assoc_request {
+       struct ieee80211_channel *chan;
+       u8 *peer_addr;
+       const u8 *ssid;
+       size_t ssid_len;
+       const u8 *ie;
+       size_t ie_len;
+};
+
+/**
+ * struct cfg80211_deauth_request - Deauthentication request data
+ *
+ * This structure provides information needed to complete IEEE 802.11
+ * deauthentication.
+ *
+ * @peer_addr: The address of the peer STA (AP BSSID); this field is required
+ *     to be present and the STA must be authenticated with the peer STA
+ * @ie: Extra IEs to add to Deauthentication frame or %NULL
+ * @ie_len: Length of ie buffer in octets
+ */
+struct cfg80211_deauth_request {
+       u8 *peer_addr;
+       u16 reason_code;
+       const u8 *ie;
+       size_t ie_len;
+};
+
+/**
+ * struct cfg80211_disassoc_request - Disassociation request data
+ *
+ * This structure provides information needed to complete IEEE 802.11
+ * disassocation.
+ *
+ * @peer_addr: The address of the peer STA (AP BSSID); this field is required
+ *     to be present and the STA must be associated with the peer STA
+ * @ie: Extra IEs to add to Disassociation frame or %NULL
+ * @ie_len: Length of ie buffer in octets
+ */
+struct cfg80211_disassoc_request {
+       u8 *peer_addr;
+       u16 reason_code;
+       const u8 *ie;
+       size_t ie_len;
+};
+
+/**
  * struct cfg80211_ops - backend description for wireless configuration
  *
  * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -653,12 +724,15 @@ struct cfg80211_bss {
  *
  * @set_channel: Set channel
  *
- * @set_mgmt_extra_ie: Set extra IE data for management frames
- *
  * @scan: Request to do a scan. If returning zero, the scan request is given
  *     the driver, and will be valid until passed to cfg80211_scan_done().
  *     For scan results, call cfg80211_inform_bss(); you can call this outside
  *     the scan/scan_done bracket too.
+ *
+ * @auth: Request to authenticate with the specified peer
+ * @assoc: Request to (re)associate with the specified peer
+ * @deauth: Request to deauthenticate from the specified peer
+ * @disassoc: Request to disassociate from the specified peer
  */
 struct cfg80211_ops {
        int     (*suspend)(struct wiphy *wiphy);
@@ -733,12 +807,17 @@ struct cfg80211_ops {
                               struct ieee80211_channel *chan,
                               enum nl80211_channel_type channel_type);
 
-       int     (*set_mgmt_extra_ie)(struct wiphy *wiphy,
-                                    struct net_device *dev,
-                                    struct mgmt_extra_ie_params *params);
-
        int     (*scan)(struct wiphy *wiphy, struct net_device *dev,
                        struct cfg80211_scan_request *request);
+
+       int     (*auth)(struct wiphy *wiphy, struct net_device *dev,
+                       struct cfg80211_auth_request *req);
+       int     (*assoc)(struct wiphy *wiphy, struct net_device *dev,
+                        struct cfg80211_assoc_request *req);
+       int     (*deauth)(struct wiphy *wiphy, struct net_device *dev,
+                         struct cfg80211_deauth_request *req);
+       int     (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
+                           struct cfg80211_disassoc_request *req);
 };
 
 /* temporary wext handlers */
@@ -755,6 +834,9 @@ int cfg80211_wext_siwscan(struct net_device *dev,
 int cfg80211_wext_giwscan(struct net_device *dev,
                          struct iw_request_info *info,
                          struct iw_point *data, char *extra);
+int cfg80211_wext_giwrange(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *extra);
 
 /**
  * cfg80211_scan_done - notify that scan finished
@@ -770,6 +852,7 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
  *
  * @wiphy: the wiphy reporting the BSS
  * @bss: the found BSS
+ * @signal: the signal strength, type depends on the wiphy's signal_type
  * @gfp: context flags
  *
  * This informs cfg80211 that BSS information was found and
@@ -779,8 +862,7 @@ struct cfg80211_bss*
 cfg80211_inform_bss_frame(struct wiphy *wiphy,
                          struct ieee80211_channel *channel,
                          struct ieee80211_mgmt *mgmt, size_t len,
-                         s32 signal, enum cfg80211_signal_type sigtype,
-                         gfp_t gfp);
+                         s32 signal, gfp_t gfp);
 
 struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
                                      struct ieee80211_channel *channel,
@@ -813,4 +895,67 @@ void cfg80211_put_bss(struct cfg80211_bss *bss);
  */
 void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
 
+/**
+ * cfg80211_send_rx_auth - notification of processed authentication
+ * @dev: network device
+ * @buf: authentication frame (header + body)
+ * @len: length of the frame data
+ *
+ * This function is called whenever an authentication has been processed in
+ * station mode.
+ */
+void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
+
+/**
+ * cfg80211_send_rx_assoc - notification of processed association
+ * @dev: network device
+ * @buf: (re)association response frame (header + body)
+ * @len: length of the frame data
+ *
+ * This function is called whenever a (re)association response has been
+ * processed in station mode.
+ */
+void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
+
+/**
+ * cfg80211_send_rx_deauth - notification of processed deauthentication
+ * @dev: network device
+ * @buf: deauthentication frame (header + body)
+ * @len: length of the frame data
+ *
+ * This function is called whenever deauthentication has been processed in
+ * station mode.
+ */
+void cfg80211_send_rx_deauth(struct net_device *dev, const u8 *buf,
+                            size_t len);
+
+/**
+ * cfg80211_send_rx_disassoc - notification of processed disassociation
+ * @dev: network device
+ * @buf: disassociation response frame (header + body)
+ * @len: length of the frame data
+ *
+ * This function is called whenever disassociation has been processed in
+ * station mode.
+ */
+void cfg80211_send_rx_disassoc(struct net_device *dev, const u8 *buf,
+                              size_t len);
+
+/**
+ * cfg80211_hold_bss - exclude bss from expiration
+ * @bss: bss which should not expire
+ *
+ * In a case when the BSS is not updated but it shouldn't expire this
+ * function can be used to mark the BSS to be excluded from expiration.
+ */
+void cfg80211_hold_bss(struct cfg80211_bss *bss);
+
+/**
+ * cfg80211_unhold_bss - remove expiration exception from the BSS
+ * @bss: bss which can expire again
+ *
+ * This function marks the BSS to be expirable again.
+ */
+void cfg80211_unhold_bss(struct cfg80211_bss *bss);
+
 #endif /* __NET_CFG80211_H */