2009-04-30 00:33:31 +04:00
|
|
|
#ifndef __WL12XX_80211_H__
|
|
|
|
#define __WL12XX_80211_H__
|
|
|
|
|
|
|
|
#include <linux/if_ether.h> /* ETH_ALEN */
|
2010-12-09 12:31:27 +03:00
|
|
|
#include <linux/if_arp.h>
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
/* RATES */
|
|
|
|
#define IEEE80211_CCK_RATE_1MB 0x02
|
|
|
|
#define IEEE80211_CCK_RATE_2MB 0x04
|
|
|
|
#define IEEE80211_CCK_RATE_5MB 0x0B
|
|
|
|
#define IEEE80211_CCK_RATE_11MB 0x16
|
|
|
|
#define IEEE80211_OFDM_RATE_6MB 0x0C
|
|
|
|
#define IEEE80211_OFDM_RATE_9MB 0x12
|
|
|
|
#define IEEE80211_OFDM_RATE_12MB 0x18
|
|
|
|
#define IEEE80211_OFDM_RATE_18MB 0x24
|
|
|
|
#define IEEE80211_OFDM_RATE_24MB 0x30
|
|
|
|
#define IEEE80211_OFDM_RATE_36MB 0x48
|
|
|
|
#define IEEE80211_OFDM_RATE_48MB 0x60
|
|
|
|
#define IEEE80211_OFDM_RATE_54MB 0x6C
|
|
|
|
#define IEEE80211_BASIC_RATE_MASK 0x80
|
|
|
|
|
|
|
|
#define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
|
|
|
|
#define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
|
|
|
|
#define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
|
|
|
|
#define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
|
|
|
|
#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
|
|
|
|
#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
|
|
|
|
#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
|
|
|
|
#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
|
|
|
|
#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
|
|
|
|
#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
|
|
|
|
#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
|
|
|
|
#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
|
|
|
|
|
|
|
|
#define IEEE80211_CCK_RATES_MASK 0x0000000F
|
|
|
|
#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
|
|
|
|
IEEE80211_CCK_RATE_2MB_MASK)
|
|
|
|
#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
|
|
|
|
IEEE80211_CCK_RATE_5MB_MASK | \
|
|
|
|
IEEE80211_CCK_RATE_11MB_MASK)
|
|
|
|
|
|
|
|
#define IEEE80211_OFDM_RATES_MASK 0x00000FF0
|
|
|
|
#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_12MB_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_24MB_MASK)
|
|
|
|
#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_9MB_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_18MB_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_36MB_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_48MB_MASK | \
|
|
|
|
IEEE80211_OFDM_RATE_54MB_MASK)
|
|
|
|
#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
|
|
|
|
IEEE80211_CCK_DEFAULT_RATES_MASK)
|
|
|
|
|
|
|
|
|
|
|
|
/* This really should be 8, but not for our firmware */
|
|
|
|
#define MAX_SUPPORTED_RATES 32
|
|
|
|
#define MAX_COUNTRY_TRIPLETS 32
|
|
|
|
|
|
|
|
/* Headers */
|
|
|
|
struct ieee80211_header {
|
|
|
|
__le16 frame_ctl;
|
|
|
|
__le16 duration_id;
|
|
|
|
u8 da[ETH_ALEN];
|
|
|
|
u8 sa[ETH_ALEN];
|
|
|
|
u8 bssid[ETH_ALEN];
|
|
|
|
__le16 seq_ctl;
|
|
|
|
u8 payload[0];
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct wl12xx_ie_header {
|
|
|
|
u8 id;
|
|
|
|
u8 len;
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
/* IEs */
|
|
|
|
|
|
|
|
struct wl12xx_ie_ssid {
|
|
|
|
struct wl12xx_ie_header header;
|
2011-07-13 12:39:16 +04:00
|
|
|
char ssid[IEEE80211_MAX_SSID_LEN];
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct wl12xx_ie_rates {
|
|
|
|
struct wl12xx_ie_header header;
|
|
|
|
u8 rates[MAX_SUPPORTED_RATES];
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct wl12xx_ie_ds_params {
|
|
|
|
struct wl12xx_ie_header header;
|
|
|
|
u8 channel;
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct country_triplet {
|
|
|
|
u8 channel;
|
|
|
|
u8 num_channels;
|
|
|
|
u8 max_tx_power;
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct wl12xx_ie_country {
|
|
|
|
struct wl12xx_ie_header header;
|
2011-03-07 22:14:23 +03:00
|
|
|
u8 country_string[IEEE80211_COUNTRY_STRING_LEN];
|
2009-04-30 00:33:31 +04:00
|
|
|
struct country_triplet triplets[MAX_COUNTRY_TRIPLETS];
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* Templates */
|
|
|
|
|
|
|
|
struct wl12xx_null_data_template {
|
|
|
|
struct ieee80211_header header;
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct wl12xx_ps_poll_template {
|
2009-10-15 11:33:29 +04:00
|
|
|
__le16 fc;
|
|
|
|
__le16 aid;
|
2009-04-30 00:33:31 +04:00
|
|
|
u8 bssid[ETH_ALEN];
|
|
|
|
u8 ta[ETH_ALEN];
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
|
|
|
struct wl12xx_qos_null_data_template {
|
|
|
|
struct ieee80211_header header;
|
|
|
|
__le16 qos_ctl;
|
2010-06-02 22:10:09 +04:00
|
|
|
} __packed;
|
2009-04-30 00:33:31 +04:00
|
|
|
|
2010-12-09 12:31:27 +03:00
|
|
|
struct wl12xx_arp_rsp_template {
|
|
|
|
struct ieee80211_hdr_3addr hdr;
|
|
|
|
|
|
|
|
u8 llc_hdr[sizeof(rfc1042_header)];
|
2010-12-22 14:38:52 +03:00
|
|
|
__be16 llc_type;
|
2010-12-09 12:31:27 +03:00
|
|
|
|
|
|
|
struct arphdr arp_hdr;
|
|
|
|
u8 sender_hw[ETH_ALEN];
|
2010-12-22 14:38:52 +03:00
|
|
|
__be32 sender_ip;
|
2010-12-09 12:31:27 +03:00
|
|
|
u8 target_hw[ETH_ALEN];
|
2010-12-22 14:38:52 +03:00
|
|
|
__be32 target_ip;
|
2010-12-09 12:31:27 +03:00
|
|
|
} __packed;
|
|
|
|
|
2010-10-16 20:19:53 +04:00
|
|
|
struct wl12xx_disconn_template {
|
|
|
|
struct ieee80211_header header;
|
|
|
|
__le16 disconn_reason;
|
|
|
|
} __packed;
|
|
|
|
|
2009-04-30 00:33:31 +04:00
|
|
|
#endif
|