1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 #ifndef HDF_WLAN_CONFIG_H 9 #define HDF_WLAN_CONFIG_H 10 11 #include "device_resource_if.h" 12 #define WLAN_DEVICE_MAX 3 13 #define WLAN_MAX_CHIP_NUM 3 14 #define BUS_FUNC_MAX 1 15 #define CHIP_SDIO_DEVICE_ID_COUNT 1 16 17 struct HdfConfigWlanStation { 18 const char *name; 19 uint8_t mode; 20 }; 21 22 struct HdfConfigWlanHostAp { 23 const char *name; 24 uint8_t mode; 25 uint8_t vapResNum; 26 uint8_t userResNum; 27 }; 28 29 struct HdfConfigWlanP2P { 30 const char *name; 31 uint8_t mode; 32 }; 33 34 struct HdfConfigWlanMac80211 { 35 uint8_t mode; 36 }; 37 38 struct HdfConfigWlanPhy { 39 uint8_t mode; 40 }; 41 42 struct HdfConfigWlanModuleConfig { 43 uint32_t featureMap; 44 const char *msgName; 45 struct HdfConfigWlanStation station; 46 struct HdfConfigWlanHostAp hostAp; 47 struct HdfConfigWlanP2P p2p; 48 struct HdfConfigWlanMac80211 mac80211; 49 struct HdfConfigWlanPhy Phy; 50 }; 51 52 /* ----------------------------------------------* 53 * deviceList architecture * 54 * ---------------------------------------------- */ 55 struct HdfConfigWlanPower { 56 uint8_t powerSeqDelay; 57 uint8_t powerType; 58 uint8_t gpioId; 59 uint8_t activeLevel; 60 }; 61 62 63 struct HdfConfWlanPowers { 64 uint8_t powerCount; 65 struct HdfConfigWlanPower power0; 66 struct HdfConfigWlanPower power1; 67 }; 68 69 struct HdfConfWlanRest { 70 uint8_t resetType; 71 uint8_t gpioId; 72 uint8_t activeLevel; 73 uint8_t resetHoldTime; 74 }; 75 76 struct HdfConfigWlanBus { 77 uint8_t busType; 78 uint8_t busIdx; 79 uint8_t funcNum[BUS_FUNC_MAX]; 80 uint32_t funcNumSize; 81 uint16_t timeout; 82 uint16_t blockSize; 83 }; 84 85 struct HdfConfigWlanDevInst { 86 uint8_t deviceInstId; 87 struct HdfConfWlanPowers powers; 88 struct HdfConfWlanRest reset; 89 struct HdfConfigWlanBus bus; 90 uint8_t bootUpTimeOut; 91 }; 92 93 struct HdfConfigWlanDeviceList { 94 struct HdfConfigWlanDevInst deviceInst[WLAN_DEVICE_MAX]; 95 uint16_t deviceListSize; 96 }; 97 /* ----------------------------------------------* 98 * chip config * 99 * ---------------------------------------------- */ 100 struct HdfConfWlanSdioArgs { 101 uint16_t vendorId; 102 uint16_t deviceId[1]; 103 }; 104 struct HdfConfigWlanChipInst { 105 const char *driverName; 106 struct HdfConfWlanSdioArgs chipSdio; 107 }; 108 struct HdfConfigWlanChipList { 109 struct HdfConfigWlanChipInst chipInst[WLAN_MAX_CHIP_NUM]; 110 uint16_t chipInstSize; 111 }; 112 113 struct HdfConfigWlanConfig { 114 const char* hostChipName; 115 struct HdfConfigWlanModuleConfig moduleConfig; 116 struct HdfConfigWlanDeviceList deviceList; 117 struct HdfConfigWlanChipList chipList; 118 }; 119 struct HdfConfigWlanRoot { 120 struct HdfConfigWlanConfig wlanConfig; 121 }; 122 123 struct HdfConfigWlanRoot *HdfWlanGetModuleConfigRoot(void); 124 int32_t HdfParseWlanConfig(const struct DeviceResourceNode *node); 125 126 #endif