blob: b49d7092b4f0bb11db5749fc26e830fbd72cbf70 [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
81 * @WLAN_UMAC_COMP_ID_MAX: Maximum components in UMAC
Soumya Bhatbe6cc172016-12-30 14:42:58 +053082 *
83 * This id is static.
84 * On Adding new component, new id has to be assigned
85 */
86enum wlan_umac_comp_id {
Krunal Sonic4e35922017-02-01 14:59:01 -080087 WLAN_UMAC_COMP_MLME = 0,
88 WLAN_UMAC_COMP_SCAN = 1,
89 WLAN_UMAC_COMP_MGMT_TXRX = 2,
90 WLAN_UMAC_COMP_SERIALIZATION = 3,
91 WLAN_UMAC_COMP_ID_MAX,
Soumya Bhatbe6cc172016-12-30 14:42:58 +053092};
93
94/**
95 * enum WLAN_DEV_TYPE - for DA or OL architecture types
96 * @WLAN_DEV_DA: Direct attach
97 * @WLAN_DEV_OL: Partial offload
98 * @WLAN_DEV_INVALID: Invalid dev type
99 */
100typedef enum {
101 WLAN_DEV_DA = 0,
102 WLAN_DEV_OL = 1,
103 WLAN_DEV_INVALID = 3,
104} WLAN_DEV_TYPE;
105
106/**
107 * enum wlan_phymode - phy mode
108 * @WLAN_PHYMODE_AUTO: autoselect
109 * @WLAN_PHYMODE_11A: 5GHz, OFDM
110 * @WLAN_PHYMODE_11B: 2GHz, CCK
111 * @WLAN_PHYMODE_11G: 2GHz, OFDM
112 * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
113 * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
114 * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
115 * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
116 * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
117 * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
118 * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
119 * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
120 * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
121 * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
122 * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
123 * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
124 * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
125 * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
126 * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
127 */
128enum wlan_phymode {
129 WLAN_PHYMODE_AUTO = 0,
130 WLAN_PHYMODE_11A = 1,
131 WLAN_PHYMODE_11B = 2,
132 WLAN_PHYMODE_11G = 3,
133 WLAN_PHYMODE_11NA_HT20 = 4,
134 WLAN_PHYMODE_11NG_HT20 = 5,
135 WLAN_PHYMODE_11NA_HT40PLUS = 6,
136 WLAN_PHYMODE_11NA_HT40MINUS = 7,
137 WLAN_PHYMODE_11NG_HT40PLUS = 8,
138 WLAN_PHYMODE_11NG_HT40MINUS = 9,
139 WLAN_PHYMODE_11NG_HT40 = 10,
140 WLAN_PHYMODE_11NA_HT40 = 11,
141 WLAN_PHYMODE_11AC_VHT20 = 12,
142 WLAN_PHYMODE_11AC_VHT40PLUS = 13,
143 WLAN_PHYMODE_11AC_VHT40MINUS = 14,
144 WLAN_PHYMODE_11AC_VHT40 = 15,
145 WLAN_PHYMODE_11AC_VHT80 = 16,
146 WLAN_PHYMODE_11AC_VHT160 = 17,
147 WLAN_PHYMODE_11AC_VHT80_80 = 18,
148};
149
150#define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
151
152/**
153 * enum wlan_peer_type - peer type
154 * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
155 * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
156 * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
157 * @WLAN_PEER_TDLS: TDLS Peer
158 * @WLAN_PEER_NAWDS: NAWDS Peer
159 * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530160 * @WLAN_PEER_IBSS: IBSS Peer
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530161 */
162enum wlan_peer_type {
163 WLAN_PEER_SELF = 1,
164 WLAN_PEER_AP = 2,
165 WLAN_PEER_STA = 3,
166 WLAN_PEER_TDLS = 4,
167 WLAN_PEER_NAWDS = 5,
168 WLAN_PEER_STA_TEMP = 6,
Selvaraj, Sridharafd3a5b2017-01-04 11:00:10 +0530169 WLAN_PEER_IBSS = 7,
Soumya Bhatbe6cc172016-12-30 14:42:58 +0530170};
171
172/* MAC address length */
173#define WLAN_MACADDR_LEN 6
174/* Util API to copy the MAC address */
175#define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
176/* Util API to compare the MAC address */
177#define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
178
179#endif /* _WLAN_OBJMGR_CMN_H_*/