#ifndef __WI_HOSTAP_H__
#define __WI_HOSTAP_H__
#define WIHAP_MAX_STATIONS 1800
struct hostap_sta {
u_int8_t addr[6];
u_int16_t asid;
u_int16_t flags;
u_int16_t sig_info;
u_int16_t capinfo;
u_int8_t rates;
};
#define HOSTAP_FLAGS_AUTHEN 0x0001
#define HOSTAP_FLAGS_ASSOC 0x0002
#define HOSTAP_FLAGS_PERM 0x0004
#define HOSTAP_FLAGS_BITS "\20\01AUTH\02ASSOC\03PERM"
#define SIOCHOSTAP_GET _IOWR('i', 200, struct ifreq)
#define SIOCHOSTAP_ADD _IOWR('i', 201, struct ifreq)
#define SIOCHOSTAP_DEL _IOWR('i', 202, struct ifreq)
#define SIOCHOSTAP_GETALL _IOWR('i', 203, struct ifreq)
#define SIOCHOSTAP_GFLAGS _IOWR('i', 204, struct ifreq)
#define SIOCHOSTAP_SFLAGS _IOWR('i', 205, struct ifreq)
#define WIHAPFL_ACTIVE 0x0001
#define WIHAPFL_MAC_FILT 0x0002
#define WIHAPFL_CANTCHANGE (WIHAPFL_ACTIVE)
struct hostap_getall {
int nstations;
struct hostap_sta *addr;
int size;
};
#ifdef _KERNEL
struct wihap_sta_info {
TAILQ_ENTRY(wihap_sta_info) list;
LIST_ENTRY(wihap_sta_info) hash;
struct wi_softc *sc;
u_int8_t addr[6];
u_short flags;
struct timeout tmo;
u_int16_t asid;
u_int16_t capinfo;
u_int16_t sig_info;
u_int8_t rates;
u_int8_t tx_curr_rate;
u_int8_t tx_max_rate;
u_int32_t *challenge;
};
#define WI_SIFLAGS_ASSOC HOSTAP_FLAGS_ASSOC
#define WI_SIFLAGS_AUTHEN HOSTAP_FLAGS_AUTHEN
#define WI_SIFLAGS_PERM HOSTAP_FLAGS_PERM
#define WI_SIFLAGS_DEAD 0x1000
#define WI_STA_HASH_SIZE 113
#if WI_STA_HASH_SIZE*16 >= 2007
#error "WI_STA_HASH_SIZE too big"
#endif
#if WI_STA_HASH_SIZE*16 < WIHAP_MAX_STATIONS
#error "WI_STA_HASH_SIZE too small"
#endif
struct wihap_info {
TAILQ_HEAD(sta_list, wihap_sta_info) sta_list;
LIST_HEAD(sta_hash, wihap_sta_info) sta_hash[WI_STA_HASH_SIZE];
u_int16_t apflags;
int n_stations;
u_int16_t asid_inuse_mask[WI_STA_HASH_SIZE];
int inactivity_time;
struct timeout tmo;
};
#define WIHAP_DFLT_INACTIVITY_TIME (120)
struct wi_softc;
struct wi_frame;
int wihap_check_tx(struct wihap_info *, u_int8_t [], u_int8_t *);
int wihap_data_input(struct wi_softc *, struct wi_frame *, struct mbuf *);
int wihap_ioctl(struct wi_softc *, u_long, caddr_t);
void wihap_init(struct wi_softc *);
void wihap_mgmt_input(struct wi_softc *, struct wi_frame *, struct mbuf *);
void wihap_shutdown(struct wi_softc *);
#endif
#endif