#ifndef _SYS_NET80211_HT_H
#define _SYS_NET80211_HT_H
#ifdef __cplusplus
extern "C" {
#endif
struct ieee80211com;
struct ieee80211_node;
struct ieee80211_channel;
#define IEEE80211_AGGR_BAWMAX 64
#define IEEE80211_NONHT_PRESENT_AGE (60*1000)
#define M_AMPDU 0x8000
#define M_WEP 0x4000
#define M_80211_RX (M_AMPDU | M_WEP)
typedef uint16_t ieee80211_seq;
struct ieee80211_tx_ampdu {
ushort_t txa_flags;
#define IEEE80211_AGGR_IMMEDIATE 0x0001
#define IEEE80211_AGGR_XCHGPEND 0x0002
#define IEEE80211_AGGR_RUNNING 0x0004
#define IEEE80211_AGGR_SETUP 0x0008
#define IEEE80211_AGGR_NAK 0x0010
uint8_t txa_ac;
uint8_t txa_token;
int txa_qbytes;
short txa_qframes;
ieee80211_seq txa_seqstart;
ieee80211_seq txa_start;
uint16_t txa_wnd;
uint8_t txa_attempts;
clock_t txa_lastrequest;
timeout_id_t txa_timer;
};
#define IEEE80211_AMPDU_RUNNING(tap) \
(((tap)->txa_flags & IEEE80211_AGGR_RUNNING) != 0)
#define IEEE80211_AMPDU_REQUESTED(tap) \
(((tap)->txa_flags & (IEEE80211_AGGR_RUNNING | \
IEEE80211_AGGR_XCHGPEND | IEEE80211_AGGR_NAK)) != 0)
struct ieee80211_rx_ampdu {
int rxa_flags;
int rxa_qbytes;
short rxa_qframes;
ieee80211_seq rxa_seqstart;
ieee80211_seq rxa_start;
uint16_t rxa_wnd;
clock_t rxa_age;
int rxa_nframes;
mblk_t *rxa_m[IEEE80211_AGGR_BAWMAX];
};
void ieee80211_ht_attach(struct ieee80211com *);
void ieee80211_ht_detach(struct ieee80211com *);
void ieee80211_ht_announce(struct ieee80211com *);
extern const int ieee80211_htrates[16];
const struct ieee80211_htrateset *ieee80211_get_suphtrates(
struct ieee80211com *, const struct ieee80211_channel *);
int ieee80211_setup_htrates(struct ieee80211_node *,
const uint8_t *htcap, int flags);
void ieee80211_setup_basic_htrates(struct ieee80211_node *,
const uint8_t *htinfo);
mblk_t *ieee80211_decap_amsdu(struct ieee80211_node *, mblk_t *);
int ieee80211_ampdu_reorder(struct ieee80211_node *, mblk_t *);
void ieee80211_recv_bar(struct ieee80211_node *, mblk_t *);
void ieee80211_ht_node_init(struct ieee80211_node *, const uint8_t *);
void ieee80211_ht_node_cleanup(struct ieee80211_node *);
struct ieee80211_channel *ieee80211_ht_adjust_channel(struct ieee80211com *,
struct ieee80211_channel *, int);
void ieee80211_ht_wds_init(struct ieee80211_node *);
void ieee80211_ht_node_join(struct ieee80211_node *);
void ieee80211_ht_node_leave(struct ieee80211_node *);
void ieee80211_htinfo_update(struct ieee80211com *, int protmode);
void ieee80211_ht_timeout(struct ieee80211com *);
void ieee80211_parse_htcap(struct ieee80211_node *, const uint8_t *);
void ieee80211_parse_htinfo(struct ieee80211_node *, const uint8_t *);
void ieee80211_recv_action(struct ieee80211_node *,
const uint8_t *, const uint8_t *);
int ieee80211_ampdu_request(struct ieee80211_node *,
struct ieee80211_tx_ampdu *);
void ieee80211_ampdu_stop(struct ieee80211_node *,
struct ieee80211_tx_ampdu *);
int ieee80211_send_bar(struct ieee80211_node *,
const struct ieee80211_tx_ampdu *);
int ieee80211_send_action(struct ieee80211_node *, int, int, uint16_t [4]);
uint8_t *ieee80211_add_htcap(uint8_t *, struct ieee80211_node *);
uint8_t *ieee80211_add_htcap_vendor(uint8_t *, struct ieee80211_node *);
uint8_t *ieee80211_add_htinfo(uint8_t *, struct ieee80211_node *);
uint8_t *ieee80211_add_htinfo_vendor(uint8_t *, struct ieee80211_node *);
struct ieee80211_beacon_offsets;
void ieee80211_ht_update_beacon(struct ieee80211com *,
struct ieee80211_beacon_offsets *);
#ifdef __cplusplus
}
#endif
#endif