Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/wtap/if_wtapvar.h
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
MALLOC_DECLARE(M_WTAP); | MALLOC_DECLARE(M_WTAP); | ||||
MALLOC_DECLARE(M_WTAP_PACKET); | MALLOC_DECLARE(M_WTAP_PACKET); | ||||
MALLOC_DECLARE(M_WTAP_BEACON); | MALLOC_DECLARE(M_WTAP_BEACON); | ||||
MALLOC_DECLARE(M_WTAP_RXBUF); | MALLOC_DECLARE(M_WTAP_RXBUF); | ||||
MALLOC_DECLARE(M_WTAP_PLUGIN); | MALLOC_DECLARE(M_WTAP_PLUGIN); | ||||
/* driver-specific node state */ | /* driver-specific node state */ | ||||
struct wtap_node { | struct wtap_node { | ||||
struct ieee80211_node an_node; /* base class */ | struct ieee80211_node an_node; /* base class */ | ||||
/* future addons */ | /* future addons */ | ||||
}; | }; | ||||
#define WTAP_NODE(ni) ((struct ath_node *)(ni)) | #define WTAP_NODE(ni) ((struct ath_node *)(ni)) | ||||
#define WTAP_NODE_CONST(ni) ((const struct ath_node *)(ni)) | #define WTAP_NODE_CONST(ni) ((const struct ath_node *)(ni)) | ||||
struct wtap_buf { | struct wtap_buf { | ||||
STAILQ_ENTRY(wtap_buf) bf_list; | STAILQ_ENTRY(wtap_buf) bf_list; | ||||
struct mbuf *m; /* mbuf for buf */ | struct mbuf *m; /* mbuf for buf */ | ||||
}; | }; | ||||
typedef STAILQ_HEAD(, wtap_buf) wtap_bufhead; | typedef STAILQ_HEAD(, wtap_buf) wtap_bufhead; | ||||
#define WTAP_BUF_BUSY 0x00000002 /* (tx) desc owned by h/w */ | #define WTAP_BUF_BUSY 0x00000002 /* (tx) desc owned by h/w */ | ||||
struct wtap_vap { | struct wtap_vap { | ||||
struct ieee80211vap av_vap; /* base class */ | struct ieee80211vap av_vap; /* base class */ | ||||
int32_t id; /* wtap id */ | int32_t id; /* wtap id */ | ||||
struct cdev *av_dev; /* userspace injecting frames */ | struct cdev *av_dev; /* userspace injecting frames */ | ||||
struct wtap_medium *av_md; /* back pointer */ | struct wtap_medium *av_md; /* back pointer */ | ||||
struct mbuf *beacon; /* beacon */ | struct mbuf *beacon; /* beacon */ | ||||
struct ieee80211_node *bf_node; /* pointer to the node */ | struct ieee80211_node *bf_node; /* pointer to the node */ | ||||
struct callout av_swba; /* software beacon alert */ | struct callout av_swba; /* software beacon alert */ | ||||
uint32_t av_bcinterval; /* beacon interval */ | uint32_t av_bcinterval; /* beacon interval */ | ||||
void (*av_recv_mgmt)(struct ieee80211_node *, | void (*av_recv_mgmt)(struct ieee80211_node *, struct mbuf *, int, | ||||
struct mbuf *, int, const struct ieee80211_rx_stats *, int, int); | const struct ieee80211_rx_stats *, int, int); | ||||
int (*av_newstate)(struct ieee80211vap *, | int (*av_newstate)(struct ieee80211vap *, enum ieee80211_state, int); | ||||
enum ieee80211_state, int); | |||||
void (*av_bmiss)(struct ieee80211vap *); | void (*av_bmiss)(struct ieee80211vap *); | ||||
}; | }; | ||||
#define WTAP_VAP(vap) ((struct wtap_vap *)(vap)) | #define WTAP_VAP(vap) ((struct wtap_vap *)(vap)) | ||||
struct taskqueue; | struct taskqueue; | ||||
struct wtap_softc { | struct wtap_softc { | ||||
struct ieee80211com sc_ic; | struct ieee80211com sc_ic; | ||||
char name[7]; /* wtapXX\0 */ | char name[7]; /* wtapXX\0 */ | ||||
int32_t id; | int32_t id; | ||||
int32_t up; | int32_t up; | ||||
struct wtap_medium *sc_md; /* interface medium */ | struct wtap_medium *sc_md; /* interface medium */ | ||||
struct ieee80211_node* (* sc_node_alloc) | struct ieee80211_node *(*sc_node_alloc)(struct ieee80211vap *, | ||||
(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN]); | const uint8_t[IEEE80211_ADDR_LEN]); | ||||
void (*sc_node_free)(struct ieee80211_node *); | void (*sc_node_free)(struct ieee80211_node *); | ||||
struct mtx sc_mtx; /* master lock (recursive) */ | struct mtx sc_mtx; /* master lock (recursive) */ | ||||
struct taskqueue *sc_tq; /* private task queue */ | struct taskqueue *sc_tq; /* private task queue */ | ||||
wtap_bufhead sc_rxbuf; /* receive buffer */ | wtap_bufhead sc_rxbuf; /* receive buffer */ | ||||
struct task sc_rxtask; /* rx int processing */ | struct task sc_rxtask; /* rx int processing */ | ||||
struct wtap_tx_radiotap_header sc_tx_th; | struct wtap_tx_radiotap_header sc_tx_th; | ||||
int sc_tx_th_len; | int sc_tx_th_len; | ||||
struct wtap_rx_radiotap_header sc_rx_th; | struct wtap_rx_radiotap_header sc_rx_th; | ||||
int sc_rx_th_len; | int sc_rx_th_len; | ||||
}; | }; | ||||
int32_t wtap_attach(struct wtap_softc *, const uint8_t *macaddr); | int32_t wtap_attach(struct wtap_softc *, const uint8_t *macaddr); | ||||
int32_t wtap_detach(struct wtap_softc *); | int32_t wtap_detach(struct wtap_softc *); | ||||
void wtap_resume(struct wtap_softc *); | void wtap_resume(struct wtap_softc *); | ||||
void wtap_suspend(struct wtap_softc *); | void wtap_suspend(struct wtap_softc *); | ||||
void wtap_shutdown(struct wtap_softc *); | void wtap_shutdown(struct wtap_softc *); | ||||
void wtap_intr(struct wtap_softc *); | void wtap_intr(struct wtap_softc *); | ||||
void wtap_inject(struct wtap_softc *, struct mbuf *); | void wtap_inject(struct wtap_softc *, struct mbuf *); | ||||
#endif | #endif |