Soumya Bhat | be6cc17 | 2016-12-30 14:42:58 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2016 The Linux Foundation. All rights reserved. |
| 3 | * |
| 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 |
| 43 | |
| 44 | /* 802.11 cap info */ |
| 45 | #define WLAN_CAPINFO_ESS 0x0001 |
| 46 | #define WLAN_CAPINFO_IBSS 0x0002 |
| 47 | #define WLAN_CAPINFO_CF_POLLABLE 0x0004 |
| 48 | #define WLAN_CAPINFO_CF_POLLREQ 0x0008 |
| 49 | #define WLAN_CAPINFO_PRIVACY 0x0010 |
| 50 | #define WLAN_CAPINFO_SHORT_PREAMBLE 0x0020 |
| 51 | #define WLAN_CAPINFO_PBCC 0x0040 |
| 52 | #define WLAN_CAPINFO_CHNL_AGILITY 0x0080 |
| 53 | #define WLAN_CAPINFO_SPECTRUM_MGMT 0x0100 |
| 54 | #define WLAN_CAPINFO_QOS 0x0200 |
| 55 | #define WLAN_CAPINFO_SHORT_SLOTTIME 0x0400 |
| 56 | #define WLAN_CAPINFO_APSD 0x0800 |
| 57 | #define WLAN_CAPINFO_RADIOMEAS 0x1000 |
| 58 | #define WLAN_CAPINFO_DSSSOFDM 0x2000 |
| 59 | |
| 60 | /* Allowed time to wait for Object creation */ |
| 61 | #define WLAN_VDEV_CREATE_TIMEOUT_CNT 300 |
| 62 | /* 25 msec */ |
| 63 | #define WLAN_VDEV_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1) |
| 64 | |
| 65 | #define WLAN_PDEV_CREATE_TIMEOUT_CNT 300 |
| 66 | /* 25 msec */ |
| 67 | #define WLAN_PDEV_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1) |
| 68 | |
| 69 | #define WLAN_PSOC_CREATE_TIMEOUT_CNT 300 |
| 70 | /* 25 msec */ |
| 71 | #define WLAN_PSOC_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1) |
| 72 | |
| 73 | /** |
| 74 | * enum wlan_umac_comp_id - UMAC component id |
| 75 | * @WLAN_UMAC_COMP_MLME: MLME |
| 76 | * @WLAN_UMAC_COMP_SCANMGR: SCAN MGR |
| 77 | * @WLAN_UMAC_COMP_SCANCACHE: SCAN CACHE |
| 78 | * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx |
| 79 | * |
| 80 | * This id is static. |
| 81 | * On Adding new component, new id has to be assigned |
| 82 | */ |
| 83 | enum wlan_umac_comp_id { |
| 84 | WLAN_UMAC_COMP_MLME = 0, |
| 85 | WLAN_UMAC_COMP_SCANMGR = 1, |
| 86 | WLAN_UMAC_COMP_SCANCACHE = 2, |
| 87 | WLAN_UMAC_COMP_MGMT_TXRX = 3, |
| 88 | }; |
| 89 | |
| 90 | /** |
| 91 | * enum WLAN_DEV_TYPE - for DA or OL architecture types |
| 92 | * @WLAN_DEV_DA: Direct attach |
| 93 | * @WLAN_DEV_OL: Partial offload |
| 94 | * @WLAN_DEV_INVALID: Invalid dev type |
| 95 | */ |
| 96 | typedef enum { |
| 97 | WLAN_DEV_DA = 0, |
| 98 | WLAN_DEV_OL = 1, |
| 99 | WLAN_DEV_INVALID = 3, |
| 100 | } WLAN_DEV_TYPE; |
| 101 | |
| 102 | /** |
| 103 | * enum wlan_phymode - phy mode |
| 104 | * @WLAN_PHYMODE_AUTO: autoselect |
| 105 | * @WLAN_PHYMODE_11A: 5GHz, OFDM |
| 106 | * @WLAN_PHYMODE_11B: 2GHz, CCK |
| 107 | * @WLAN_PHYMODE_11G: 2GHz, OFDM |
| 108 | * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20 |
| 109 | * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20 |
| 110 | * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1) |
| 111 | * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1) |
| 112 | * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1) |
| 113 | * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1) |
| 114 | * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40 |
| 115 | * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40 |
| 116 | * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20 |
| 117 | * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1) |
| 118 | * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1) |
| 119 | * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40 |
| 120 | * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80 |
| 121 | * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160 |
| 122 | * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80 |
| 123 | */ |
| 124 | enum wlan_phymode { |
| 125 | WLAN_PHYMODE_AUTO = 0, |
| 126 | WLAN_PHYMODE_11A = 1, |
| 127 | WLAN_PHYMODE_11B = 2, |
| 128 | WLAN_PHYMODE_11G = 3, |
| 129 | WLAN_PHYMODE_11NA_HT20 = 4, |
| 130 | WLAN_PHYMODE_11NG_HT20 = 5, |
| 131 | WLAN_PHYMODE_11NA_HT40PLUS = 6, |
| 132 | WLAN_PHYMODE_11NA_HT40MINUS = 7, |
| 133 | WLAN_PHYMODE_11NG_HT40PLUS = 8, |
| 134 | WLAN_PHYMODE_11NG_HT40MINUS = 9, |
| 135 | WLAN_PHYMODE_11NG_HT40 = 10, |
| 136 | WLAN_PHYMODE_11NA_HT40 = 11, |
| 137 | WLAN_PHYMODE_11AC_VHT20 = 12, |
| 138 | WLAN_PHYMODE_11AC_VHT40PLUS = 13, |
| 139 | WLAN_PHYMODE_11AC_VHT40MINUS = 14, |
| 140 | WLAN_PHYMODE_11AC_VHT40 = 15, |
| 141 | WLAN_PHYMODE_11AC_VHT80 = 16, |
| 142 | WLAN_PHYMODE_11AC_VHT160 = 17, |
| 143 | WLAN_PHYMODE_11AC_VHT80_80 = 18, |
| 144 | }; |
| 145 | |
| 146 | #define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1) |
| 147 | |
| 148 | /** |
| 149 | * enum wlan_peer_type - peer type |
| 150 | * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same |
| 151 | * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode |
| 152 | * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode |
| 153 | * @WLAN_PEER_TDLS: TDLS Peer |
| 154 | * @WLAN_PEER_NAWDS: NAWDS Peer |
| 155 | * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node) |
| 156 | */ |
| 157 | enum wlan_peer_type { |
| 158 | WLAN_PEER_SELF = 1, |
| 159 | WLAN_PEER_AP = 2, |
| 160 | WLAN_PEER_STA = 3, |
| 161 | WLAN_PEER_TDLS = 4, |
| 162 | WLAN_PEER_NAWDS = 5, |
| 163 | WLAN_PEER_STA_TEMP = 6, |
| 164 | }; |
| 165 | |
| 166 | /* MAC address length */ |
| 167 | #define WLAN_MACADDR_LEN 6 |
| 168 | /* Util API to copy the MAC address */ |
| 169 | #define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN) |
| 170 | /* Util API to compare the MAC address */ |
| 171 | #define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN) |
| 172 | |
| 173 | #endif /* _WLAN_OBJMGR_CMN_H_*/ |