1 /*****************************************************************************
3 (c) Cambridge Silicon Radio Limited 2011
4 All rights reserved and confidential information of CSR
6 Refer to LICENSE.txt included with this source for details
9 *****************************************************************************/
11 #ifndef CSR_WIFI_VIF_UTILS_H
12 #define CSR_WIFI_VIF_UTILS_H
18 /* STANDARD INCLUDES ********************************************************/
20 /* PROJECT INCLUDES *********************************************************/
21 /* including this file for CsrWifiInterfaceMode*/
22 #include "csr_wifi_private_common.h"
24 /* MACROS *******************************************************************/
26 /* Common macros for NME and SME to be used temporarily until SoftMAC changes are made */
27 #define CSR_WIFI_NUM_INTERFACES (u8)0x1
28 #define CSR_WIFI_INTERFACE_IN_USE (u16)0x0
30 /* This is used at places where interface Id isn't available*/
31 #define CSR_WIFI_INTERFACE_ZERO 0
32 #define CSR_WIFI_INTERFACE_STA 0
33 #define CSR_WIFI_INTERFACE_AMP 0
36 #define CSR_WIFI_VIF_UTILS_UNDEFINED_TAG 0xFFFF
38 /* Extract the Interface Id from the event */
39 #define CsrWifiVifUtilsGetVifTagFromEvent(msg) \
40 ((u16) * ((u16 *) ((u8 *) (msg) + sizeof(CsrWifiFsmEvent))))
42 /* The HPI Vif combines the type and the interface id */
43 #define CsrWifiVifUtilsGetVifTagFromHipEvent(msg) \
44 ((msg)->virtualInterfaceIdentifier & 0x00FF)
46 #define CsrWifiVifUtilsPackHipEventVif(type, interfaceId) \
47 ((u16)((interfaceId) | ((type) << 8)))
50 /* TYPES DEFINITIONS ********************************************************/
52 /* GLOBAL VARIABLE DECLARATIONS *********************************************/
54 /* PUBLIC FUNCTION PROTOTYPES ***********************************************/
58 * First checks if the mode is supported capability bitmap of the interface.
59 * If this succeeds, then checks if running this mode on this interface is allowed.
61 * @param[in] u8 : interface capability bitmap
62 * @param[in] u8* : pointer to the array of current interface modes
63 * @param[in] u16 : interfaceTag
64 * @param[in] CsrWifiInterfaceMode : mode
67 * u8 : returns true if the interface is allowed to operate in the mode otherwise false.
69 extern u8 CsrWifiVifUtilsCheckCompatibility(u8 interfaceCapability,
70 u8 *currentInterfaceModes,
72 CsrWifiInterfaceMode mode);
76 * Checks if the specified interface is supported.
77 * NOTE: Only checks that the interface is supported, no checks are made to
78 * determine whether a supported interface may be made active.
80 * @param[in] u16 : interfaceTag
83 * u8 : returns true if the interface is supported, otherwise false.
85 extern u8 CsrWifiVifUtilsIsSupported(u16 interfaceTag);
90 * Registers the virtual interface utils logging details.
91 * Should only be called once at initialisation.
98 void CsrWifiVifUtilsLogTextRegister(void);
100 #define CsrWifiVifUtilsLogTextRegister()
107 #endif /* CSR_WIFI_VIF_UTILS_H */