xref: /wlan-driver/fw-api/fw/htt_common.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2012-2016, 2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
6*5113495bSYour Name  *
7*5113495bSYour Name  *
8*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
9*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
10*5113495bSYour Name  * above copyright notice and this permission notice appear in all
11*5113495bSYour Name  * copies.
12*5113495bSYour Name  *
13*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
14*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
15*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
16*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
17*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
18*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
21*5113495bSYour Name  */
22*5113495bSYour Name 
23*5113495bSYour Name /*
24*5113495bSYour Name  * This file was originally distributed by Qualcomm Atheros, Inc.
25*5113495bSYour Name  * under proprietary terms before Copyright ownership was assigned
26*5113495bSYour Name  * to the Linux Foundation.
27*5113495bSYour Name  */
28*5113495bSYour Name 
29*5113495bSYour Name /**
30*5113495bSYour Name  * @file htt_common.h
31*5113495bSYour Name  *
32*5113495bSYour Name  * @details the public header file of HTT layer shared between host and firmware
33*5113495bSYour Name  */
34*5113495bSYour Name 
35*5113495bSYour Name #ifndef _HTT_COMMON_H_
36*5113495bSYour Name #define _HTT_COMMON_H_
37*5113495bSYour Name 
38*5113495bSYour Name #include <htt_deps.h> /* A_UINT32 */
39*5113495bSYour Name 
40*5113495bSYour Name enum htt_sec_type {
41*5113495bSYour Name     htt_sec_type_none,
42*5113495bSYour Name     htt_sec_type_wep128,
43*5113495bSYour Name     htt_sec_type_wep104,
44*5113495bSYour Name     htt_sec_type_wep40,
45*5113495bSYour Name     htt_sec_type_tkip,
46*5113495bSYour Name     htt_sec_type_tkip_nomic,
47*5113495bSYour Name     htt_sec_type_aes_ccmp,
48*5113495bSYour Name     htt_sec_type_wapi,
49*5113495bSYour Name     htt_sec_type_aes_ccmp_256,
50*5113495bSYour Name     htt_sec_type_aes_gcmp,
51*5113495bSYour Name     htt_sec_type_aes_gcmp_256,
52*5113495bSYour Name 
53*5113495bSYour Name     /* keep this last! */
54*5113495bSYour Name     htt_num_sec_types
55*5113495bSYour Name };
56*5113495bSYour Name 
57*5113495bSYour Name enum htt_rx_ind_mpdu_status {
58*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_UNKNOWN = 0x0,
59*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_OK,
60*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_ERR_FCS,
61*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_ERR_DUP,
62*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_ERR_REPLAY,
63*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_ERR_INV_PEER,
64*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_UNAUTH_PEER, /* only accept EAPOL frames */
65*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_OUT_OF_SYNC,
66*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_MGMT_CTRL, /* Non-data in promiscuous mode */
67*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR,
68*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_DECRYPT_ERR,
69*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_MPDU_LENGTH_ERR,
70*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_ENCRYPT_REQUIRED_ERR,
71*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_PRIVACY_ERR,
72*5113495bSYour Name 
73*5113495bSYour Name     /*
74*5113495bSYour Name      * MISC: discard for unspecified reasons.
75*5113495bSYour Name      * Leave this enum value last.
76*5113495bSYour Name      */
77*5113495bSYour Name     HTT_RX_IND_MPDU_STATUS_ERR_MISC = 0xFF
78*5113495bSYour Name };
79*5113495bSYour Name 
80*5113495bSYour Name #define HTT_INVALID_PEER    0xffff
81*5113495bSYour Name #define HTT_INVALID_VDEV    0xff
82*5113495bSYour Name 
83*5113495bSYour Name #define HTT_NON_QOS_TID     16
84*5113495bSYour Name #define HTT_INVALID_TID     31
85*5113495bSYour Name 
86*5113495bSYour Name #define HTT_TX_EXT_TID_DEFAULT              0
87*5113495bSYour Name #define HTT_TX_EXT_TID_NON_QOS_MCAST_BCAST HTT_NON_QOS_TID
88*5113495bSYour Name #define HTT_TX_EXT_TID_MGMT                17
89*5113495bSYour Name #define HTT_TX_EXT_TID_INVALID             HTT_INVALID_TID
90*5113495bSYour Name #define HTT_TX_EXT_TID_NONPAUSE            19
91*5113495bSYour Name 
92*5113495bSYour Name 
93*5113495bSYour Name 
94*5113495bSYour Name #define HTT_TX_L3_CKSUM_OFFLOAD      1
95*5113495bSYour Name #define HTT_TX_L4_CKSUM_OFFLOAD      2
96*5113495bSYour Name 
97*5113495bSYour Name 
98*5113495bSYour Name /**
99*5113495bSYour Name  * @brief General specification of the tx frame contents
100*5113495bSYour Name  *
101*5113495bSYour Name  * @details
102*5113495bSYour Name  * For efficiency, the HTT packet type values correspond
103*5113495bSYour Name  * to the bit positions of the WAL packet type values, so the
104*5113495bSYour Name  * translation is a simple shift operation.
105*5113495bSYour Name  * The exception is the "mgmt" type, which specifies frame payload
106*5113495bSYour Name  * type rather than L2 header type.
107*5113495bSYour Name  */
108*5113495bSYour Name enum htt_pkt_type {
109*5113495bSYour Name     htt_pkt_type_raw = 0,
110*5113495bSYour Name     htt_pkt_type_native_wifi = 1,
111*5113495bSYour Name     htt_pkt_type_ethernet = 2,
112*5113495bSYour Name     htt_pkt_type_mgmt = 3,
113*5113495bSYour Name     htt_pkt_type_eth2 = 4,
114*5113495bSYour Name 
115*5113495bSYour Name     /* keep this last */
116*5113495bSYour Name     htt_pkt_num_types
117*5113495bSYour Name };
118*5113495bSYour Name 
119*5113495bSYour Name /*
120*5113495bSYour Name  * TX MSDU ID partition -
121*5113495bSYour Name  * FW supports bigger MSDU ID partition which is defined as
122*5113495bSYour Name  * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN
123*5113495bSYour Name  * When both host and FW support new partition, FW uses
124*5113495bSYour Name  * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN
125*5113495bSYour Name  * If host doesn't support, FW falls back to HTT_TX_IPA_MSDU_ID_SPACE_BEGIN
126*5113495bSYour Name  * Handshaking is done through WMI_READY and WMI_INIT
127*5113495bSYour Name  */
128*5113495bSYour Name #define HTT_TX_HOST_MSDU_ID_SPACE_BEGIN 0
129*5113495bSYour Name #define HTT_TX_IPA_MSDU_ID_SPACE_BEGIN  3000
130*5113495bSYour Name #define TGT_RX2TX_MSDU_ID_SPACE_BEGIN 6000
131*5113495bSYour Name #define HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN  8192  /* = 0x2000 = b10,0000,0000,0000 */
132*5113495bSYour Name #define TGT_RX2TX_NEW_MSDU_ID_SPACE_BEGIN   12288 /* = 0x3000 = b11,0000,0000,0000 */
133*5113495bSYour Name 
134*5113495bSYour Name /* HTT Access Category values */
135*5113495bSYour Name enum HTT_AC_WMM {
136*5113495bSYour Name     /* WMM Access Categories */
137*5113495bSYour Name     HTT_AC_WMM_BE         = 0x0,
138*5113495bSYour Name     HTT_AC_WMM_BK         = 0x1,
139*5113495bSYour Name     HTT_AC_WMM_VI         = 0x2,
140*5113495bSYour Name     HTT_AC_WMM_VO         = 0x3,
141*5113495bSYour Name 
142*5113495bSYour Name     HTT_NUM_AC_WMM        = 0x4,
143*5113495bSYour Name 
144*5113495bSYour Name     /* extension Access Categories */
145*5113495bSYour Name     HTT_AC_EXT_NON_QOS    = 0x4,
146*5113495bSYour Name     HTT_AC_EXT_UCAST_MGMT = 0x5,
147*5113495bSYour Name     HTT_AC_EXT_MCAST_DATA = 0x6,
148*5113495bSYour Name     HTT_AC_EXT_MCAST_MGMT = 0x7,
149*5113495bSYour Name };
150*5113495bSYour Name 
151*5113495bSYour Name enum HTT_AC_WMM_MASK {
152*5113495bSYour Name     /* WMM Access Categories */
153*5113495bSYour Name     HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
154*5113495bSYour Name     HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
155*5113495bSYour Name     HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
156*5113495bSYour Name     HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
157*5113495bSYour Name     /* extension Access Categories */
158*5113495bSYour Name     HTT_AC_EXT_NON_QOS_MASK    = (1 << HTT_AC_EXT_NON_QOS),
159*5113495bSYour Name     HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
160*5113495bSYour Name     HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
161*5113495bSYour Name     HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
162*5113495bSYour Name };
163*5113495bSYour Name #define HTT_AC_MASK_WMM \
164*5113495bSYour Name     (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
165*5113495bSYour Name      HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
166*5113495bSYour Name #define HTT_AC_MASK_EXT \
167*5113495bSYour Name     (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
168*5113495bSYour Name     HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
169*5113495bSYour Name #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
170*5113495bSYour Name 
171*5113495bSYour Name /** 2 word representation of MAC addr */
172*5113495bSYour Name typedef struct {
173*5113495bSYour Name     /** upper 4 bytes of  MAC address */
174*5113495bSYour Name     A_UINT32 mac_addr31to0;
175*5113495bSYour Name     /** lower 2 bytes of  MAC address */
176*5113495bSYour Name     A_UINT32 mac_addr47to32;
177*5113495bSYour Name } htt_mac_addr;
178*5113495bSYour Name 
179*5113495bSYour Name #define HTT_STATS_MAX_CHAINS 8
180*5113495bSYour Name 
181*5113495bSYour Name #endif /* _HTT_COMMON_H_ */
182