hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __INC_QOS_TYPE_H
#define __INC_QOS_TYPE_H
 
/*
 * ACI/AIFSN Field.
 * Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 * Note: 1 Byte Length
 */
struct aci_aifsn {
   u8    aifsn:4;
   u8    acm:1;
   u8    aci:2;
   u8:1;
};
 
/*
 * Direction Field Values.
 * Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
 */
enum direction_value {
   DIR_UP            = 0,        // 0x00    // UpLink
   DIR_DOWN        = 1,        // 0x01    // DownLink
   DIR_DIRECT        = 2,        // 0x10    // DirectLink
   DIR_BI_DIR        = 3,        // 0x11    // Bi-Direction
};
 
/*
 * TS Info field in WMM TSPEC Element.
 * Ref:
 *    1. WMM spec 2.2.11: WME TSPEC Element, p.18.
 *    2. 8185 QoS code: QOS_TSINFO [def. in QoS_mp.h]
 * Note: sizeof 3 Bytes
 */
struct qos_tsinfo {
   u16        uc_traffic_type:1;            //WMM is reserved
   u16        uc_tsid:4;
   u16        uc_direction:2;
   u16        uc_access_policy:2;            //WMM: bit8=0, bit7=1
   u16        uc_aggregation:1;            //WMM is reserved
   u16        uc_psb:1;                //WMMSA is APSD
   u16        uc_up:3;
   u16        uc_ts_info_ack_policy:2;    //WMM is reserved
   u8        uc_schedule:1;                //WMM is reserved
   u8:7;
};
 
/*
 * WMM TSPEC Body.
 * Ref: WMM spec 2.2.11: WME TSPEC Element, p.16.
 * Note: sizeof 55 bytes
 */
struct tspec_body {
   struct qos_tsinfo    ts_info;    //u8    TSInfo[3];
   u16    nominal_msd_usize;
   u16    max_msd_usize;
   u32    min_service_itv;
   u32    max_service_itv;
   u32    inactivity_itv;
   u32    suspen_itv;
   u32    service_start_time;
   u32    min_data_rate;
   u32    mean_data_rate;
   u32    peak_data_rate;
   u32    max_burst_size;
   u32    delay_bound;
   u32    min_phy_rate;
   u16    surplus_bandwidth_allowance;
   u16    medium_time;
};
 
/*
 *      802.11 Management frame Status Code field
 */
struct octet_string {
   u8        *octet;
   u16             length;
};
 
#define is_ac_valid(ac)            (((ac) <= 7) ? true : false)
 
#endif // #ifndef __INC_QOS_TYPE_H