Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * |
| 30 | * Date: 08/15/13 |
| 31 | * History:- |
| 32 | * Date Modified by Modification Information |
| 33 | * -------------------------------------------------------------------- |
| 34 | */ |
| 35 | #ifndef __LIM_RMC_H |
| 36 | #define __LIM_RMC_H |
| 37 | |
| 38 | #ifdef WLAN_FEATURE_RMC |
| 39 | |
| 40 | typedef enum { |
| 41 | eLIM_RMC_ENABLE_REQ = 0, |
| 42 | eLIM_RMC_DISABLE_REQ = 1, |
| 43 | eLIM_RMC_BECOME_RULER_RESP = 2, |
| 44 | eLIM_RMC_RULER_SELECT_RESP = 3, |
| 45 | eLIM_RMC_RULER_PICK_NEW = 4, |
| 46 | eLIM_RMC_OTA_RULER_INFORM_CANCELLED = 5, |
| 47 | eLIM_RMC_OTA_RULER_INFORM_ACK = 6, |
| 48 | eLIM_RMC_OTA_RULER_INFORM_SELECTED = 7, |
| 49 | } eRmcMessageType; |
| 50 | |
| 51 | typedef enum { |
| 52 | eRMC_RULER_NOT_SELECTED = 0, |
| 53 | eRMC_RULER_ENABLE_REQUESTED = 1, |
| 54 | eRMC_RULER_OTA_REQUEST_SENT = 2, |
| 55 | eRMC_RULER_ACTIVE = 3, |
| 56 | } eRmcMcastTxState; |
| 57 | |
| 58 | typedef enum { |
| 59 | eRMC_IS_NOT_A_RULER = 0, |
| 60 | eRMC_RULER_PENDING = 1, |
| 61 | eRMC_IS_A_RULER = 2, |
| 62 | } eRmcRulerState; |
| 63 | |
| 64 | enum { |
| 65 | eRMC_SUGGEST_RULER_CMD = 0, |
| 66 | eRMC_BECOME_RULER_CMD = 1, |
| 67 | }; |
| 68 | |
| 69 | enum { |
| 70 | eRMC_RULER_ACCEPTED = 0, //Host-->FW |
| 71 | eRMC_RULER_CANCELLED = 1, //Host-->FW |
| 72 | eRMC_RULER_PICK_NEW = 2, //FW-->Host |
| 73 | }; |
| 74 | |
| 75 | /* tRoleType; */ |
| 76 | typedef enum |
| 77 | { |
| 78 | eRMC_RULER_ROLE, |
| 79 | eRMC_TRANSMITTER_ROLE, |
| 80 | } eRmcRole; |
| 81 | |
| 82 | #define RMC_MCAST_GROUPS_HASH_SIZE 32 |
| 83 | |
| 84 | typedef struct sLimRmcGroupContext |
| 85 | { |
| 86 | tSirMacAddr transmitter; |
| 87 | eRmcRulerState isRuler; |
| 88 | struct sLimRmcGroupContext *next; |
| 89 | } tLimRmcGroupContext, *tpLimRmcGroupContext; |
| 90 | |
| 91 | typedef struct sLimRmcContext |
| 92 | { |
| 93 | tANI_BOOLEAN rmcEnabled; |
| 94 | tSirMacAddr ruler; |
| 95 | eRmcMcastTxState state; |
| 96 | TX_TIMER gRmcRulerSelectTimer; |
| 97 | tANI_U32 rmcTimerValInTicks; |
| 98 | vos_lock_t lkRmcLock; |
| 99 | tLimRmcGroupContext *rmcGroupRxHashTable[RMC_MCAST_GROUPS_HASH_SIZE]; |
| 100 | } tLimRmcContext, *tpLimRmcContext; |
| 101 | |
| 102 | |
| 103 | void limRmcInit(tpAniSirGlobal pMac); |
| 104 | void limRmcCleanup(tpAniSirGlobal pMac); |
| 105 | void limRmcTransmitterDelete(tpAniSirGlobal pMac, tSirMacAddr transmitter); |
| 106 | void limRmcIbssDelete(tpAniSirGlobal pMac); |
| 107 | void limRmcDumpStatus(tpAniSirGlobal pMac); |
| 108 | |
| 109 | VOS_STATUS |
| 110 | limRmcTriggerRulerSelection(tpAniSirGlobal pMac, tSirMacAddr macAddr); |
| 111 | #endif /* WLAN_FEATURE_RMC */ |
| 112 | |
| 113 | #endif /* __LIM_RMC_H */ |