diff options
author | Pavel Roskin <proski@gnu.org> | 2007-03-05 17:42:51 -0500 |
---|---|---|
committer | Guido Guenther <agx@bogon.sigxcpu.org> | 2007-03-06 09:59:27 +0100 |
commit | 81f76614951ed3bab78387781a1e0fc15ff82f5d (patch) | |
tree | 378a2cad223ce6bae4aefe5baf9da3792c91aa45 /at76_usb.h | |
parent | ecf1e5852b79763c6d2829a2291d7ebaed2c6519 (diff) |
[PATCH] Reuse more structures from Linux ieee80211 headers
Eliminate all local definitions for management frames. Use Linux
structures instead. Use struct ieee80211_info_element for information
elements in management frames.
Use min_t() instead of min() in the affected code when casts are already
present or would be needed.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Diffstat (limited to 'at76_usb.h')
-rw-r--r-- | at76_usb.h | 71 |
1 files changed, 5 insertions, 66 deletions
@@ -665,80 +665,22 @@ struct p80211msg } __attribute__ ((packed)); #define BEACON_MAX_DATA_LENGTH 1500 -/* beacon in ieee80211_hdr_3addr.payload */ -struct ieee802_11_beacon_data { - u8 timestamp[8]; /* TSFTIMER */ - __le16 beacon_interval; /* Kms between TBTTs (Target Beacon Transmission Times) */ - __le16 capability_information; - u8 data[BEACON_MAX_DATA_LENGTH]; /* contains: SSID (tag,length,value), - Supported Rates (tlv), channel */ -} __attribute__ ((packed)); -/* disassoc frame in ieee80211_hdr_3addr.payload */ -struct ieee802_11_disassoc_frame { - __le16 reason; -} __attribute__ ((packed)); #define DISASSOC_FRAME_SIZE \ - (AT76C503_TX_HDRLEN + IEEE802_11_MGMT_HEADER_SIZE +\ - sizeof(struct ieee802_11_disassoc_frame)) - -/* assoc request in ieee80211_hdr_3addr.payload */ -struct ieee802_11_assoc_req { - __le16 capability; - __le16 listen_interval; - u8 data[1]; /* variable number of bytes for SSID - and supported rates (tlv coded) */ -}; + (AT76C503_TX_HDRLEN + sizeof(struct ieee80211_disassoc)) + /* the maximum size of an AssocReq packet */ #define ASSOCREQ_MAX_SIZE \ - (AT76C503_TX_HDRLEN + IEEE802_11_MGMT_HEADER_SIZE +\ - offsetof(struct ieee802_11_assoc_req,data) +\ + (AT76C503_TX_HDRLEN + sizeof(struct ieee80211_assoc_request) + \ 1+1+IW_ESSID_MAX_SIZE + 1+1+4) -/* reassoc request in ieee80211_hdr_3addr.payload */ -struct ieee802_11_reassoc_req { - __le16 capability; - __le16 listen_interval; - u8 curr_ap[ETH_ALEN]; /* the bssid of the AP we are - currently associated to */ - u8 data[1]; /* variable number of bytes for SSID - and supported rates (tlv coded) */ -} __attribute__ ((packed)); - /* the maximum size of an AssocReq packet */ #define REASSOCREQ_MAX_SIZE \ - (AT76C503_TX_HDRLEN + IEEE802_11_MGMT_HEADER_SIZE +\ - offsetof(struct ieee802_11_reassoc_req,data) +\ + (AT76C503_TX_HDRLEN + sizeof(struct ieee80211_reassoc_request) + \ 1+1+IW_ESSID_MAX_SIZE + 1+1+4) -/* assoc/reassoc response */ -struct ieee802_11_assoc_resp { - __le16 capability; - __le16 status; - __le16 assoc_id; - u8 data[1]; /* variable number of bytes for - supported rates (tlv coded) */ -} __attribute__ ((packed)); - -/* auth. request/response in ieee80211_hdr_3addr.payload */ -struct ieee802_11_auth_frame { - __le16 algorithm; - __le16 seq_nr; - __le16 status; - u8 challenge[0]; -} __attribute__ ((packed)); /* for shared secret auth, add the challenge text size */ -#define AUTH_FRAME_SIZE \ - (AT76C503_TX_HDRLEN + IEEE802_11_MGMT_HEADER_SIZE +\ - sizeof(struct ieee802_11_auth_frame)) - -/* deauth frame in ieee80211_hdr_3addr.payload */ -struct ieee802_11_deauth_frame { - __le16 reason; -} __attribute__ ((packed)); -#define DEAUTH_FRAME_SIZE \ - (AT76C503_TX_HDRLEN + IEEE802_11_MGMT_HEADER_SIZE +\ - sizeof(struct ieee802_11_disauth_frame)) +#define AUTH_FRAME_SIZE (AT76C503_TX_HDRLEN + sizeof(struct ieee80211_auth)) /* how often do we re-try these packets ? */ #define AUTH_RETRIES 3 @@ -770,9 +712,6 @@ static const u8 hw_rates[4] = {0x82,0x84,0x0b,0x16}; /* the max padding size for tx in bytes (see calc_padding) */ #define MAX_PADDING_SIZE 53 -/* the size of the ieee802.11 header (excl. the at76c503 tx header) */ -#define IEEE802_11_MGMT_HEADER_SIZE offsetof(struct ieee80211_hdr_3addr, payload) - /* at76_debug bits */ #define DBG_PROGRESS 0x00000001 /* progress of scan-join-(auth-assoc)-connected */ #define DBG_BSS_TABLE 0x00000002 /* show the bss table after scans */ |