0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 #ifndef _LINUX_P80211NETDEV_H
0055 #define _LINUX_P80211NETDEV_H
0056
0057 #include <linux/interrupt.h>
0058 #include <linux/wireless.h>
0059 #include <linux/netdevice.h>
0060
0061 #define WLAN_RELEASE "0.3.0-staging"
0062
0063 #define WLAN_DEVICE_CLOSED 0
0064 #define WLAN_DEVICE_OPEN 1
0065
0066 #define WLAN_MACMODE_NONE 0
0067 #define WLAN_MACMODE_IBSS_STA 1
0068 #define WLAN_MACMODE_ESS_STA 2
0069 #define WLAN_MACMODE_ESS_AP 3
0070
0071
0072 #define WLAN_MSD_HWPRESENT_PENDING 1
0073 #define WLAN_MSD_HWFAIL 2
0074 #define WLAN_MSD_HWPRESENT 3
0075 #define WLAN_MSD_FWLOAD_PENDING 4
0076 #define WLAN_MSD_FWLOAD 5
0077 #define WLAN_MSD_RUNNING_PENDING 6
0078 #define WLAN_MSD_RUNNING 7
0079
0080 #ifndef ETH_P_ECONET
0081 #define ETH_P_ECONET 0x0018
0082 #endif
0083
0084 #define ETH_P_80211_RAW (ETH_P_ECONET + 1)
0085
0086 #ifndef ARPHRD_IEEE80211
0087 #define ARPHRD_IEEE80211 801
0088 #endif
0089
0090 #ifndef ARPHRD_IEEE80211_PRISM
0091 #define ARPHRD_IEEE80211_PRISM 802
0092 #endif
0093
0094
0095 #define P80211_NSDCAP_HARDWAREWEP 0x01
0096 #define P80211_NSDCAP_SHORT_PREAMBLE 0x10
0097 #define P80211_NSDCAP_HWFRAGMENT 0x80
0098 #define P80211_NSDCAP_AUTOJOIN 0x100
0099 #define P80211_NSDCAP_NOSCAN 0x200
0100
0101
0102 struct p80211_frmrx {
0103 u32 mgmt;
0104 u32 assocreq;
0105 u32 assocresp;
0106 u32 reassocreq;
0107 u32 reassocresp;
0108 u32 probereq;
0109 u32 proberesp;
0110 u32 beacon;
0111 u32 atim;
0112 u32 disassoc;
0113 u32 authen;
0114 u32 deauthen;
0115 u32 mgmt_unknown;
0116 u32 ctl;
0117 u32 pspoll;
0118 u32 rts;
0119 u32 cts;
0120 u32 ack;
0121 u32 cfend;
0122 u32 cfendcfack;
0123 u32 ctl_unknown;
0124 u32 data;
0125 u32 dataonly;
0126 u32 data_cfack;
0127 u32 data_cfpoll;
0128 u32 data__cfack_cfpoll;
0129 u32 null;
0130 u32 cfack;
0131 u32 cfpoll;
0132 u32 cfack_cfpoll;
0133 u32 data_unknown;
0134 u32 decrypt;
0135 u32 decrypt_err;
0136 };
0137
0138
0139 struct iw_statistics *p80211wext_get_wireless_stats(struct net_device *dev);
0140
0141 extern struct iw_handler_def p80211wext_handler_def;
0142
0143
0144 #define NUM_WEPKEYS 4
0145 #define MAX_KEYLEN 32
0146
0147 #define HOSTWEP_DEFAULTKEY_MASK GENMASK(1, 0)
0148 #define HOSTWEP_SHAREDKEY BIT(3)
0149 #define HOSTWEP_DECRYPT BIT(4)
0150 #define HOSTWEP_ENCRYPT BIT(5)
0151 #define HOSTWEP_PRIVACYINVOKED BIT(6)
0152 #define HOSTWEP_EXCLUDEUNENCRYPTED BIT(7)
0153
0154 extern int wlan_watchdog;
0155 extern int wlan_wext_write;
0156
0157
0158 struct wlandevice {
0159 void *priv;
0160
0161
0162 char name[WLAN_DEVNAMELEN_MAX];
0163 char *nsdname;
0164
0165 u32 state;
0166 u32 msdstate;
0167 u32 hwremoved;
0168
0169
0170 unsigned int irq;
0171 unsigned int iobase;
0172 unsigned int membase;
0173 u32 nsdcaps;
0174
0175
0176 unsigned int ethconv;
0177
0178
0179 int (*open)(struct wlandevice *wlandev);
0180 int (*close)(struct wlandevice *wlandev);
0181 void (*reset)(struct wlandevice *wlandev);
0182 int (*txframe)(struct wlandevice *wlandev, struct sk_buff *skb,
0183 struct p80211_hdr *p80211_hdr,
0184 struct p80211_metawep *p80211_wep);
0185 int (*mlmerequest)(struct wlandevice *wlandev, struct p80211msg *msg);
0186 int (*set_multicast_list)(struct wlandevice *wlandev,
0187 struct net_device *dev);
0188 void (*tx_timeout)(struct wlandevice *wlandev);
0189
0190
0191 u8 bssid[WLAN_BSSID_LEN];
0192 struct p80211pstr32 ssid;
0193 u32 macmode;
0194 int linkstatus;
0195
0196
0197 u8 wep_keys[NUM_WEPKEYS][MAX_KEYLEN];
0198 u8 wep_keylens[NUM_WEPKEYS];
0199 int hostwep;
0200
0201
0202 unsigned long request_pending;
0203
0204
0205
0206
0207 struct net_device *netdev;
0208
0209
0210 struct tasklet_struct rx_bh;
0211
0212 struct sk_buff_head nsd_rxq;
0213
0214
0215 struct p80211_frmrx rx;
0216
0217 struct iw_statistics wstats;
0218
0219
0220 u8 spy_number;
0221 char spy_address[IW_MAX_SPY][ETH_ALEN];
0222 struct iw_quality spy_stat[IW_MAX_SPY];
0223 };
0224
0225
0226 int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int keylen);
0227 int wep_decrypt(struct wlandevice *wlandev, u8 *buf, u32 len, int key_override,
0228 u8 *iv, u8 *icv);
0229 int wep_encrypt(struct wlandevice *wlandev, u8 *buf, u8 *dst, u32 len,
0230 int keynum, u8 *iv, u8 *icv);
0231
0232 int wlan_setup(struct wlandevice *wlandev, struct device *physdev);
0233 void wlan_unsetup(struct wlandevice *wlandev);
0234 int register_wlandev(struct wlandevice *wlandev);
0235 int unregister_wlandev(struct wlandevice *wlandev);
0236 void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb);
0237 void p80211netdev_hwremoved(struct wlandevice *wlandev);
0238 #endif