blob: f7107edc36973f31661d10cfaa560d7d2142dfd7 [file] [log] [blame]
Soumya Bhatbe6cc172016-12-30 14:42:58 +05301/*
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +05302 * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
Soumya Bhatbe6cc172016-12-30 14:42:58 +05303 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18 /**
19 * DOC: This file provides the common definitions for object manager
20 */
21
22#ifndef _WLAN_CMN_H_
23#define _WLAN_CMN_H_
24
25/* Max no of UMAC components */
26#define WLAN_UMAC_MAX_COMPONENTS 25
27/* Max no. of radios, a pSoc/Device can support */
28#define WLAN_UMAC_MAX_PDEVS 3
29/* Max no. of VDEV per PSOC */
30#define WLAN_UMAC_PSOC_MAX_VDEVS 51
31/* Max no. of VDEVs, a PDEV can support */
32#define WLAN_UMAC_PDEV_MAX_VDEVS 17
33/* Max no. of Peers, a device can support */
34#define WLAN_UMAC_PSOC_MAX_PEERS 1024
35
36/* Max length of a SSID */
37#define WLAN_SSID_MAX_LEN 32
38
39/* Max no. of Stations can be associated to VDEV*/
40#define WLAN_UMAC_MAX_AP_PEERS WLAN_UMAC_PSOC_MAX_PEERS
41/* Max no. of peers for STA vap */
42#define WLAN_UMAC_MAX_STA_PEERS 2
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053043/* Max vdev_id */
44#define WLAN_UMAC_VDEV_ID_MAX 0xFF
Soumya Bhatbe6cc172016-12-30 14:42:58 +053045
46/* 802.11 cap info */
47#define WLAN_CAPINFO_ESS 0x0001
48#define WLAN_CAPINFO_IBSS 0x0002
49#define WLAN_CAPINFO_CF_POLLABLE 0x0004
50#define WLAN_CAPINFO_CF_POLLREQ 0x0008
51#define WLAN_CAPINFO_PRIVACY 0x0010
52#define WLAN_CAPINFO_SHORT_PREAMBLE 0x0020
53#define WLAN_CAPINFO_PBCC 0x0040
54#define WLAN_CAPINFO_CHNL_AGILITY 0x0080
55#define WLAN_CAPINFO_SPECTRUM_MGMT 0x0100
56#define WLAN_CAPINFO_QOS 0x0200
57#define WLAN_CAPINFO_SHORT_SLOTTIME 0x0400
58#define WLAN_CAPINFO_APSD 0x0800
59#define WLAN_CAPINFO_RADIOMEAS 0x1000
60#define WLAN_CAPINFO_DSSSOFDM 0x2000
61
62/* Allowed time to wait for Object creation */
63#define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
64 /* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053065#define WLAN_VDEV_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053066
67#define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
68 /* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053069#define WLAN_PDEV_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053070
71#define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
72/* 25 msec */
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +053073#define WLAN_PSOC_CREATE_TIMEOUT 25
Soumya Bhatbe6cc172016-12-30 14:42:58 +053074
75/**
76 * enum wlan_umac_comp_id - UMAC component id
Sandeep Puligilla7225a3b2017-01-15 18:13:37 -080077 * @WLAN_UMAC_COMP_MLME: MLME
78 * @WLAN_UMAC_COMP_SCAN: SCAN MGR
Soumya Bhatbe6cc172016-12-30 14:42:58 +053079 * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx
Krunal Sonic4e35922017-02-01 14:59:01 -080080 * @WLAN_UMAC_COMP_SERIALIZATION: Serialization
Mukul Sharmad8fd1442017-02-03 11:27:17 +053081 * @WLAN_UMAC_COMP_PMO: PMO component
Wu Gaof482dea2017-02-16 11:39:12 +080082 * @WLAN_UMAC_COMP_P2P: P2P
Krunal Sonic4e35922017-02-01 14:59:01 -080083 * @WLAN_UMAC_COMP_ID_MAX: Maximum components in UMAC
Soumya Bhatbe6cc172016-12-30 14:42:58 +053084 *
85 * This id is static.
86 * On Adding new component, new id has to be assigned
87 */
88enum wlan_umac_comp_id {
Krunal Sonic4e35922017-02-01 14:59:01 -080089 WLAN_UMAC_COMP_MLME = 0,
90 WLAN_UMAC_COMP_SCAN = 1,
91 WLAN_UMAC_COMP_MGMT_TXRX = 2,
92 WLAN_UMAC_COMP_SERIALIZATION = 3,
Mukul Sharmad8fd1442017-02-03 11:27:17 +053093 WLAN_UMAC_COMP_PMO = 4,
Wu Gaof482dea2017-02-16 11:39:12 +080094 WLAN_UMAC_COMP_P2P = 5,
Krunal Sonic4e35922017-02-01 14:59:01 -080095 WLAN_UMAC_COMP_ID_MAX,
Soumya Bhatbe6cc172016-12-30 14:42:58 +053096};
97
98/**
99 * enum WLAN_DEV_TYPE - for DA or OL architecture types
100 * @WLAN_DEV_DA: Direct attach
101 * @WLAN_DEV_OL: Partial offload
102 * @WLAN_DEV_INVALID: Invalid dev type
103 */
104typedef enum {
105 WLAN_DEV_DA = 0,
106 WLAN_DEV_OL = 1,
107 WLAN_DEV_INVALID = 3,
108} WLAN_DEV_TYPE;
109
110/**
111 * enum wlan_phymode - phy mode
112 * @WLAN_PHYMODE_AUTO: autoselect
113 * @WLAN_PHYMODE_11A: 5GHz, OFDM
114 * @WLAN_PHYMODE_11B: 2GHz, CCK
115 * @WLAN_PHYMODE_11G: 2GHz, OFDM
116 * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
117 * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
118 * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
119 * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
120 * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
121 * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
122 * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
123 * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
124 * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
125 * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
126 * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
127 * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
128 * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
129 * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
130 * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
131 */
132enum wlan_phymode {
133 WLAN_PHYMODE_AUTO = 0,
134 WLAN_PHYMODE_11A = 1,
135 WLAN_PHYMODE_11B = 2,
136 WLAN_PHYMODE_11G = 3,
137 WLAN_PHYMODE_11NA_HT20 = 4,
138 WLAN_PHYMODE_11NG_HT20 = 5,
139 WLAN_PHYMODE_11NA_HT40PLUS = 6,
140 WLAN_PHYMODE_11NA_HT40MINUS = 7,
141 WLAN_PHYMODE_11NG_HT40PLUS = 8,
142 WLAN_PHYMODE_11NG_HT40MINUS = 9,
143 WLAN_PHYMODE_11NG_HT40 = 10,
144 WLAN_PHYMODE_11NA_HT40 = 11,
145 WLAN_PHYMODE_11AC_VHT20 = 12,
146 WLAN_PHYMODE_11AC_VHT40PLUS = 13,
147 WLAN_PHYMODE_11AC_VHT40MINUS = 14,
148 WLAN_PHYMODE_11AC_VHT40 = 15,
149 WLAN_PHYMODE_11AC_VHT80 = 16,
150 WLAN_PHYMODE_11AC_VHT160 = 17,
151 WLAN_PHYMODE_11AC_VHT80_80 = 18,
152};
153
154#define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
155
156/**
157 * enum wlan_peer_type - peer type
158 * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
159 * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
160 * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
161 * @WLAN_PEER_TDLS: TDLS Peer
162 * @WLAN_PEER_NAWDS: NAWDS Peer
163 * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530164 * @WLAN_PEER_IBSS: IBSS Peer
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530165 */
166enum wlan_peer_type {
167 WLAN_PEER_SELF = 1,
168 WLAN_PEER_AP = 2,
169 WLAN_PEER_STA = 3,
170 WLAN_PEER_TDLS = 4,
171 WLAN_PEER_NAWDS = 5,
172 WLAN_PEER_STA_TEMP = 6,
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530173 WLAN_PEER_IBSS = 7,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530174};
175
176/* MAC address length */
177#define WLAN_MACADDR_LEN 6
178/* Util API to copy the MAC address */
179#define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
180/* Util API to compare the MAC address */
181#define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
182
183#endif /* _WLAN_OBJMGR_CMN_H_*/