?? common_atheros_sdiostack_ar6000_wlan.patch
字號:
+#define WMM_PARAM_LOGCWMAX_M 0xf0 /* Mask for CwMax field (in log) */+#define WMM_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */++#define WMM_AC_TO_TID(_ac) ( \+ ((_ac) == WMM_AC_VO) ? 6 : \+ ((_ac) == WMM_AC_VI) ? 5 : \+ ((_ac) == WMM_AC_BK) ? 1 : \+ 0)++#define TID_TO_WMM_AC(_tid) ( \+ ((_tid) < 1) ? WMM_AC_BE : \+ ((_tid) < 3) ? WMM_AC_BK : \+ ((_tid) < 6) ? WMM_AC_VI : \+ WMM_AC_VO)+/*+ * Management information element payloads.+ */++enum {+ IEEE80211_ELEMID_SSID = 0,+ IEEE80211_ELEMID_RATES = 1,+ IEEE80211_ELEMID_FHPARMS = 2,+ IEEE80211_ELEMID_DSPARMS = 3,+ IEEE80211_ELEMID_CFPARMS = 4,+ IEEE80211_ELEMID_TIM = 5,+ IEEE80211_ELEMID_IBSSPARMS = 6,+ IEEE80211_ELEMID_COUNTRY = 7,+ IEEE80211_ELEMID_CHALLENGE = 16,+ /* 17-31 reserved for challenge text extension */+ IEEE80211_ELEMID_PWRCNSTR = 32,+ IEEE80211_ELEMID_PWRCAP = 33,+ IEEE80211_ELEMID_TPCREQ = 34,+ IEEE80211_ELEMID_TPCREP = 35,+ IEEE80211_ELEMID_SUPPCHAN = 36,+ IEEE80211_ELEMID_CHANSWITCH = 37,+ IEEE80211_ELEMID_MEASREQ = 38,+ IEEE80211_ELEMID_MEASREP = 39,+ IEEE80211_ELEMID_QUIET = 40,+ IEEE80211_ELEMID_IBSSDFS = 41,+ IEEE80211_ELEMID_ERP = 42,+ IEEE80211_ELEMID_RSN = 48,+ IEEE80211_ELEMID_XRATES = 50,+ IEEE80211_ELEMID_TPC = 150,+ IEEE80211_ELEMID_CCKM = 156,+ IEEE80211_ELEMID_VENDOR = 221, /* vendor private */+};++#define ATH_OUI 0x7f0300 /* Atheros OUI */+#define ATH_OUI_TYPE 0x01+#define ATH_OUI_SUBTYPE 0x01+#define ATH_OUI_VERSION 0x00++#define WPA_OUI 0xf25000+#define WPA_OUI_TYPE 0x01+#define WPA_VERSION 1 /* current supported version */++#define WPA_CSE_NULL 0x00+#define WPA_CSE_WEP40 0x01+#define WPA_CSE_TKIP 0x02+#define WPA_CSE_CCMP 0x04+#define WPA_CSE_WEP104 0x05++#define WPA_ASE_NONE 0x00+#define WPA_ASE_8021X_UNSPEC 0x01+#define WPA_ASE_8021X_PSK 0x02++#define RSN_OUI 0xac0f00+#define RSN_VERSION 1 /* current supported version */++#define RSN_CSE_NULL 0x00+#define RSN_CSE_WEP40 0x01+#define RSN_CSE_TKIP 0x02+#define RSN_CSE_WRAP 0x03+#define RSN_CSE_CCMP 0x04+#define RSN_CSE_WEP104 0x05++#define RSN_ASE_NONE 0x00+#define RSN_ASE_8021X_UNSPEC 0x01+#define RSN_ASE_8021X_PSK 0x02++#define RSN_CAP_PREAUTH 0x01++#define WMM_OUI 0xf25000+#define WMM_OUI_TYPE 0x02+#define WMM_INFO_OUI_SUBTYPE 0x00+#define WMM_PARAM_OUI_SUBTYPE 0x01+#define WMM_VERSION 1++/* WMM stream classes */+#define WMM_NUM_AC 4+#define WMM_AC_BE 0 /* best effort */+#define WMM_AC_BK 1 /* background */+#define WMM_AC_VI 2 /* video */+#define WMM_AC_VO 3 /* voice */++/* TSPEC related */+#define ACTION_CATEGORY_CODE_TSPEC 17+#define ACTION_CODE_TSPEC_ADDTS 0+#define ACTION_CODE_TSPEC_ADDTS_RESP 1+#define ACTION_CODE_TSPEC_DELTS 2++typedef enum {+ TSPEC_STATUS_CODE_ADMISSION_ACCEPTED = 0,+ TSPEC_STATUS_CODE_ADDTS_INVALID_PARAMS = 0x1,+ TSPEC_STATUS_CODE_ADDTS_REQUEST_REFUSED = 0x3,+ TSPEC_STATUS_CODE_UNSPECIFIED_QOS_RELATED_FAILURE = 0xC8,+ TSPEC_STATUS_CODE_REQUESTED_REFUSED_POLICY_CONFIGURATION = 0xC9,+ TSPEC_STATUS_CODE_INSUFFCIENT_BANDWIDTH = 0xCA,+ TSPEC_STATUS_CODE_INVALID_PARAMS = 0xCB,+ TSPEC_STATUS_CODE_DELTS_SENT = 0x30,+ TSPEC_STATUS_CODE_DELTS_RECV = 0x31,+} TSPEC_STATUS_CODE;++/*+ * WMM/802.11e Tspec Element+ */+typedef struct wmm_tspec_ie_t {+ A_UINT8 elementId;+ A_UINT8 len;+ A_UINT8 oui[3];+ A_UINT8 ouiType;+ A_UINT8 ouiSubType;+ A_UINT8 version;+ A_UINT16 tsInfo_info;+ A_UINT8 tsInfo_reserved;+ A_UINT16 nominalMSDU;+ A_UINT16 maxMSDU;+ A_UINT32 minServiceInt;+ A_UINT32 maxServiceInt;+ A_UINT32 inactivityInt;+ A_UINT32 suspensionInt;+ A_UINT32 serviceStartTime;+ A_UINT32 minDataRate;+ A_UINT32 meanDataRate;+ A_UINT32 peakDataRate;+ A_UINT32 maxBurstSize;+ A_UINT32 delayBound;+ A_UINT32 minPhyRate;+ A_UINT16 sba;+ A_UINT16 mediumTime;+} __ATTRIB_PACK WMM_TSPEC_IE;+++/*+ * BEACON management packets+ *+ * octet timestamp[8]+ * octet beacon interval[2]+ * octet capability information[2]+ * information element+ * octet elemid+ * octet length+ * octet information[length]+ */++#define IEEE80211_BEACON_INTERVAL(beacon) \+ ((beacon)[8] | ((beacon)[9] << 8))+#define IEEE80211_BEACON_CAPABILITY(beacon) \+ ((beacon)[10] | ((beacon)[11] << 8))++#define IEEE80211_CAPINFO_ESS 0x0001+#define IEEE80211_CAPINFO_IBSS 0x0002+#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004+#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008+#define IEEE80211_CAPINFO_PRIVACY 0x0010+#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020+#define IEEE80211_CAPINFO_PBCC 0x0040+#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080+/* bits 8-9 are reserved */+#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400+#define IEEE80211_CAPINFO_APSD 0x0800+/* bit 12 is reserved */+#define IEEE80211_CAPINFO_DSSSOFDM 0x2000+/* bits 14-15 are reserved */++/*+ * Authentication Modes+ */++enum ieee80211_authmode {+ IEEE80211_AUTH_NONE = 0,+ IEEE80211_AUTH_OPEN = 1,+ IEEE80211_AUTH_SHARED = 2,+ IEEE80211_AUTH_8021X = 3,+ IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */+ /* NB: these are used only for ioctls */+ IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x */+ IEEE80211_AUTH_WPA_PSK = 6, /* WPA/RSN w/ PSK */+ IEEE80211_AUTH_WPA_CCKM = 7, /* WPA/RSN IE w/ CCKM */+};++#endif /* _NET80211_IEEE80211_H_ */Index: linux-2.6.18/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h===================================================================--- /dev/null+++ linux-2.6.18/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h@@ -0,0 +1,120 @@+/*+ * Copyright (c) 2004-2006 Atheros Communications Inc.+ * Portions Copyright (c) 2001 Atsushi Onoe, 2002-2005 Sam Leffler, Errno Consulting+ *+ * Wireless Network driver for Atheros AR6001+ *+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License version 2 as+ * published by the Free Software Foundation;+ *+ * Software distributed under the License is distributed on an "AS+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or+ * implied. See the License for the specific language governing+ * rights and limitations under the License.+ *+ *+ * This file contains the definitions for the AR6000 linux driver.+ *+ */++#ifndef _IEEE80211_IOCTL_H_+#define _IEEE80211_IOCTL_H_++#ifdef __cplusplus+extern "C" {+#endif++/*+ * Extracted from the MADWIFI net80211/ieee80211_ioctl.h+ */++/*+ * WPA/RSN get/set key request. Specify the key/cipher+ * type and whether the key is to be used for sending and/or+ * receiving. The key index should be set only when working+ * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').+ * Otherwise a unicast/pairwise key is specified by the bssid+ * (on a station) or mac address (on an ap). They key length+ * must include any MIC key data; otherwise it should be no+ more than IEEE80211_KEYBUF_SIZE.+ */+struct ieee80211req_key {+ u_int8_t ik_type; /* key/cipher type */+ u_int8_t ik_pad;+ u_int16_t ik_keyix; /* key index */+ u_int8_t ik_keylen; /* key length in bytes */+ u_int8_t ik_flags;+#define IEEE80211_KEY_XMIT 0x01+#define IEEE80211_KEY_RECV 0x02+#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */+ u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];+ u_int64_t ik_keyrsc; /* key receive sequence counter */+ u_int64_t ik_keytsc; /* key transmit sequence counter */+ u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];+};+/*+ * Delete a key either by index or address. Set the index+ * to IEEE80211_KEYIX_NONE when deleting a unicast key.+ */+struct ieee80211req_del_key {+ u_int8_t idk_keyix; /* key index */+ u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];+};+/*+ * MLME state manipulation request. IEEE80211_MLME_ASSOC+ * only makes sense when operating as a station. The other+ * requests can be used when operating as a station or an+ * ap (to effect a station).+ */+struct ieee80211req_mlme {+ u_int8_t im_op; /* operation to perform */+#define IEEE80211_MLME_ASSOC 1 /* associate station */+#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */+#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */+#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */+#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */+ u_int16_t im_reason; /* 802.11 reason code */+ u_int8_t im_macaddr[IEEE80211_ADDR_LEN];+};++struct ieee80211req_addpmkid {+ u_int8_t pi_bssid[IEEE80211_ADDR_LEN];+ u_int8_t pi_enable;+ u_int8_t pi_pmkid[16];+};++#define AUTH_ALG_OPEN_SYSTEM 0x01+#define AUTH_ALG_SHARED_KEY 0x02+#define AUTH_ALG_LEAP 0x04++struct ieee80211req_authalg {+ u_int8_t auth_alg;+};++enum {+ IEEE80211_PARAM_AUTHMODE = 3, /* Authentication Mode */+ IEEE80211_PARAM_MCASTCIPHER = 5,+ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */+ IEEE80211_PARAM_UCASTCIPHER = 8,+ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */+ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */+ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */+ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */+ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */+ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */+};++/*+ * Values for IEEE80211_PARAM_WPA+ */+#define WPA_MODE_WPA1 1+#define WPA_MODE_WPA2 2+#define WPA_MODE_AUTO 3+#define WPA_MODE_NONE 4++#ifdef __cplusplus+}+#endif++#endif /* _IEEE80211_IOCTL_H_ */Index: linux-2.6.18/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h===================================================================--- /dev/null+++ linux-2.6.18/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h@@ -0,0 +1,74 @@+/*+ * Copyright (c) 2001 Atsushi Onoe+ * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting+ * Copyright 2006 ATheros Communications, Inc.+ *+ * Wireless Network driver for Atheros AR6001+ *+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License version 2 as+ * published by the Free Software Foundation;+ *+ * Software distributed under the License is distributed on an "AS+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or+ * implied. See the License for the specific language governing+ * rights and limitations under the License.+ *+ *+ */+#ifndef _IEEE80211_NODE_H_+#define _IEEE80211_NODE_H_++/*+ * Node locking definitions.+ */+#define IEEE80211_NODE_LOCK_INIT(_nt) A_MUTEX_INIT(&(_nt)->nt_nodelock)+#define IEEE80211_NODE_LOCK_DESTROY(_nt)+#define IEEE80211_NODE_LOCK(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock)+#define IEEE80211_NODE_UNLOCK(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock)+#define IEEE80211_NODE_LOCK_BH(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock)+#define IEEE80211_NODE_UNLOCK_BH(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock)+#define IEEE80211_NODE_LOCK_ASSERT(_nt)++/*+ * Node reference counting definitions.+ *+ * ieee80211_node_initref initialize the reference count to 1+ * ieee80211_node_incref add a reference+ * ieee80211_node_decref remove a reference+ * ieee80211_node_dectestref remove a reference and return 1 if this+ * is the last reference, otherwise 0+ * ieee80211_node_refcnt reference count for printing (only)+ */+#define ieee80211_node_initref(_ni) ((_ni)->ni_refcnt = 1)+#define ieee80211_node_incref(_ni) ((_ni)->ni_refcnt++)+#define ieee80211_node_decref(_ni) ((_ni)->ni_refcnt--)+#define ieee80211_node_dectestref(_ni) (((_ni)->ni_refcnt--) == 0)+#define ieee80211_node_refcnt(_ni) ((_ni)->ni_refcnt)++#define IEEE80211_NODE_HASHSIZE 32+/* simple hash is enough for variation of macaddr */+#define IEEE80211_NODE_HASH(addr) \+ (((const A_UINT8 *)(addr))[IEEE80211_ADDR_LEN - 1] % \+ IEEE80211_NODE_HASHSIZE)++/*+ * Table of ieee80211_node instances. Each ieee80211com+ * has at least one for holding the scan candidates.+ * When operating as an access point or in ibss mode there+ * is a second table for associated stations or neighbors.+ */+struct ieee80211_node_table {+ void *nt_wmip; /* back reference */+ A_MUTEX_T nt_nodelock; /* on node table */+ struct bss *nt_node_first; /* information of all nodes */+ struct bss *nt_node_last; /* information of all nodes */+ struct bss *nt_hash[IEEE80211_NODE_HASHSIZE];+ const char *nt_name; /* for debugging */+ A_UINT32 nt_scangen; /* gen# for timeout scan */+ A_TIMER nt_inact_timer;+};++#define WLAN_NODE_INACT_TIMEOUT_MSEC 10000++#endif /* _IEEE80211_NODE_H_ */Index: linux-2.6.18/drivers/sdio/function/wlan/ar6000/include/osapi_linux.h===================================================================--- /dev/null+++ linux-2.6.18/drivers/sdio/function/wlan/ar6000/include/osapi_linux.h@@ -0,0 +1,167 @@+/*+ * Copyright 2003-2006 Atheros Communications, Inc.+ *+ * Wireless Network driver for Atheros AR6001+ *+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License version 2 as
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -