1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 #ifndef __WI_HOSTAP_H__
38 #define __WI_HOSTAP_H__
39
40 #define WIHAP_MAX_STATIONS 1800
41
42 struct hostap_sta {
43 u_int8_t addr[6];
44 u_int16_t asid;
45 u_int16_t flags;
46 u_int16_t sig_info;
47 u_int16_t capinfo;
48 u_int8_t rates;
49 };
50
51 #define HOSTAP_FLAGS_AUTHEN 0x0001
52 #define HOSTAP_FLAGS_ASSOC 0x0002
53 #define HOSTAP_FLAGS_PERM 0x0004
54 #define HOSTAP_FLAGS_BITS "\20\01AUTH\02ASSOC\03PERM"
55
56 #define SIOCHOSTAP_GET _IOWR('i', 210, struct ifreq)
57 #define SIOCHOSTAP_ADD _IOWR('i', 211, struct ifreq)
58 #define SIOCHOSTAP_DEL _IOWR('i', 212, struct ifreq)
59 #define SIOCHOSTAP_GETALL _IOWR('i', 213, struct ifreq)
60 #define SIOCHOSTAP_GFLAGS _IOWR('i', 214, struct ifreq)
61 #define SIOCHOSTAP_SFLAGS _IOWR('i', 215, struct ifreq)
62
63
64 #define WIHAPFL_ACTIVE 0x0001
65 #define WIHAPFL_MAC_FILT 0x0002
66
67
68 #define WIHAPFL_CANTCHANGE (WIHAPFL_ACTIVE)
69
70 struct hostap_getall {
71 int nstations;
72 struct hostap_sta *addr;
73 int size;
74 };
75
76
77
78 #ifdef _KERNEL
79 struct wihap_sta_info {
80 TAILQ_ENTRY(wihap_sta_info) list;
81 LIST_ENTRY(wihap_sta_info) hash;
82
83 struct wi_softc *sc;
84 u_int8_t addr[6];
85 u_short flags;
86 struct timeout tmo;
87
88 u_int16_t asid;
89 u_int16_t capinfo;
90 u_int16_t sig_info;
91 u_int8_t rates;
92 u_int8_t tx_curr_rate;
93 u_int8_t tx_max_rate;
94 u_int32_t *challenge;
95 };
96
97 #define WI_SIFLAGS_ASSOC HOSTAP_FLAGS_ASSOC
98 #define WI_SIFLAGS_AUTHEN HOSTAP_FLAGS_AUTHEN
99 #define WI_SIFLAGS_PERM HOSTAP_FLAGS_PERM
100 #define WI_SIFLAGS_DEAD 0x1000
101
102 #define WI_STA_HASH_SIZE 113
103
104 #if WI_STA_HASH_SIZE*16 >= 2007
105 #error "WI_STA_HASH_SIZE too big"
106 #endif
107 #if WI_STA_HASH_SIZE*16 < WIHAP_MAX_STATIONS
108 #error "WI_STA_HASH_SIZE too small"
109 #endif
110
111 struct wihap_info {
112 TAILQ_HEAD(sta_list, wihap_sta_info) sta_list;
113 LIST_HEAD(sta_hash, wihap_sta_info) sta_hash[WI_STA_HASH_SIZE];
114
115 u_int16_t apflags;
116
117 int n_stations;
118 u_int16_t asid_inuse_mask[WI_STA_HASH_SIZE];
119
120 int inactivity_time;
121 struct timeout tmo;
122 };
123
124 #define WIHAP_DFLT_INACTIVITY_TIME (120)
125
126 struct wi_softc;
127 struct wi_frame;
128
129 int wihap_check_tx(struct wihap_info *, u_int8_t [], u_int8_t *);
130 int wihap_data_input(struct wi_softc *, struct wi_frame *, struct mbuf *);
131 int wihap_ioctl(struct wi_softc *, u_long, caddr_t);
132 void wihap_init(struct wi_softc *);
133 void wihap_mgmt_input(struct wi_softc *, struct wi_frame *, struct mbuf *);
134 void wihap_shutdown(struct wi_softc *);
135
136 #endif
137 #endif