123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #ifndef WME_H
- #define WME_H
- #ifdef __linux__
- #include <endian.h>
- #endif
- #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
- #include <sys/types.h>
- #include <sys/endian.h>
- #endif
- extern inline u16 tsinfo(int tag1d, int contention_based, int direction)
- {
- return (tag1d << 11) | (contention_based << 7) | (direction << 5) |
- (tag1d << 1);
- }
- struct wme_information_element {
-
- u8 oui[3];
- u8 oui_type;
- u8 oui_subtype;
- u8 version;
- u8 acInfo;
- } __attribute__ ((packed));
- struct wme_ac_parameter {
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-
- u8 aifsn:4,
- acm:1,
- aci:2,
- reserved:1;
-
- u8 eCWmin:4,
- eCWmax:4;
- #elif __BYTE_ORDER == __BIG_ENDIAN
-
- u8 reserved:1,
- aci:2,
- acm:1,
- aifsn:4;
-
- u8 eCWmax:4,
- eCWmin:4;
- #else
- #error "Please fix <endian.h>"
- #endif
-
- le16 txopLimit;
- } __attribute__ ((packed));
- struct wme_parameter_element {
-
- u8 oui[3];
- u8 oui_type;
- u8 oui_subtype;
- u8 version;
- u8 acInfo;
- u8 reserved;
- struct wme_ac_parameter ac[4];
- } __attribute__ ((packed));
- struct wme_tspec_info_element {
- u8 eid;
- u8 length;
- u8 oui[3];
- u8 oui_type;
- u8 oui_subtype;
- u8 version;
- u16 ts_info;
- u16 nominal_msdu_size;
- u16 maximum_msdu_size;
- u32 minimum_service_interval;
- u32 maximum_service_interval;
- u32 inactivity_interval;
- u32 start_time;
- u32 minimum_data_rate;
- u32 mean_data_rate;
- u32 maximum_burst_size;
- u32 minimum_phy_rate;
- u32 peak_data_rate;
- u32 delay_bound;
- u16 surplus_bandwidth_allowance;
- u16 medium_time;
- } __attribute__ ((packed));
- enum {
- WME_AC_BK = 1,
- WME_AC_BE = 0,
- WME_AC_VI = 2,
- WME_AC_VO = 3
- };
- struct ieee80211_mgmt;
- u8 * hostapd_eid_wme(struct hostapd_data *hapd, u8 *eid);
- int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len);
- int hostapd_wme_sta_config(struct hostapd_data *hapd, struct sta_info *sta);
- void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
- size_t len);
- #endif
|