From c0268882d96e126ede3ea8f1e1c3f45d03854403 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Tue, 30 Nov 2021 07:29:37 +0000 Subject: [PATCH 01/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 19 +++++++++++++++++-- model/network/wifi/include/hdf_wifi_cmd.h | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index c3822c35..eac22836 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -29,6 +29,7 @@ #endif #define WIFI_24G_CHANNEL_NUM 14 +#define WIFI_5G_CHANNEL_NUM 24 #define DEFAULT_EAPOL_PACKAGE_SIZE 800 Service *g_baseService = NULL; @@ -495,18 +496,32 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe featureData->channelNum = band->channelCount; featureData->htCapab = capability->htCapability; + for (loop = 0; loop < band->channelCount; ++loop) { + featureData->iee80211Channel[loop].flags = band->channels[loop].flags; + featureData->iee80211Channel[loop].freq = band->channels[loop].centerFreq; + featureData->iee80211Channel[loop].channel = band->channels[loop].channelId; + } + } else if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { + struct WlanBand *band = capability->bands[IEEE80211_BAND_2GHZ]; + if (band->channelCount > WIFI_5G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + ret = HDF_FAILURE; + break; + } + featureData->channelNum = band->channelCount; + featureData->htCapab = capability->htCapability; + for (loop = 0; loop < band->channelCount; ++loop) { featureData->iee80211Channel[loop].flags = band->channels[loop].flags; featureData->iee80211Channel[loop].freq = band->channels[loop].centerFreq; featureData->iee80211Channel[loop].channel = band->channels[loop].channelId; } } else { - HDF_LOGE("%s: Supportting 2.4G is required by now!", __func__); + HDF_LOGE("%s: Supportting 2.4G/5G is required by now!", __func__); ret = HDF_FAILURE; break; } - // 5G not supported } while (false); if (capability->Release != NULL) { diff --git a/model/network/wifi/include/hdf_wifi_cmd.h b/model/network/wifi/include/hdf_wifi_cmd.h index 5a89f2fe..9233c64a 100644 --- a/model/network/wifi/include/hdf_wifi_cmd.h +++ b/model/network/wifi/include/hdf_wifi_cmd.h @@ -319,7 +319,7 @@ typedef struct { uint16_t bitrate[MAX_SUPPORTED_RATE]; uint16_t htCapab; uint8_t resv[2]; - WifiIeee80211Channel iee80211Channel[14]; + WifiIeee80211Channel iee80211Channel[24]; } WifiHwFeatureData; typedef struct { From 8870e80f96b005f5f7992ba8d28002eefb3c7dac Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Tue, 30 Nov 2021 07:45:53 +0000 Subject: [PATCH 02/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index eac22836..0d6c6084 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -470,6 +470,7 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe { int32_t ret = HDF_SUCCESS; struct WlanHwCapability *capability = GetHwCapability(netdev); + struct WlanBand *band = NULL; if (capability == NULL) { HDF_LOGE("%s:GetHwCapability failed!", __func__); return HDF_FAILURE; @@ -492,35 +493,27 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); ret = HDF_FAILURE; break; - } - featureData->channelNum = band->channelCount; - featureData->htCapab = capability->htCapability; - - for (loop = 0; loop < band->channelCount; ++loop) { - featureData->iee80211Channel[loop].flags = band->channels[loop].flags; - featureData->iee80211Channel[loop].freq = band->channels[loop].centerFreq; - featureData->iee80211Channel[loop].channel = band->channels[loop].channelId; - } + } } else if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { - struct WlanBand *band = capability->bands[IEEE80211_BAND_2GHZ]; + band = capability->bands[IEEE80211_BAND_5GHZ]; if (band->channelCount > WIFI_5G_CHANNEL_NUM) { HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); ret = HDF_FAILURE; break; - } - featureData->channelNum = band->channelCount; - featureData->htCapab = capability->htCapability; - - for (loop = 0; loop < band->channelCount; ++loop) { - featureData->iee80211Channel[loop].flags = band->channels[loop].flags; - featureData->iee80211Channel[loop].freq = band->channels[loop].centerFreq; - featureData->iee80211Channel[loop].channel = band->channels[loop].channelId; - } + } } else { HDF_LOGE("%s: Supportting 2.4G/5G is required by now!", __func__); ret = HDF_FAILURE; break; } + featureData->channelNum = band->channelCount; + featureData->htCapab = capability->htCapability; + + for (loop = 0; loop < band->channelCount; ++loop) { + featureData->iee80211Channel[loop].flags = band->channels[loop].flags; + featureData->iee80211Channel[loop].freq = band->channels[loop].centerFreq; + featureData->iee80211Channel[loop].channel = band->channels[loop].channelId; + } } while (false); From fa46417a2c6b6a9d1408aaf1c74ce9ee69b6a537 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Tue, 30 Nov 2021 08:07:47 +0000 Subject: [PATCH 03/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 43 ++++++++++++++-------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index 0d6c6084..c4fe594e 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -466,6 +466,31 @@ static int32_t WifiCmdSetMode(const RequestContext *context, struct HdfSBuf *req return ret; } +static int32_t WifiCheckChannelNum(struct WlanHwCapability *capability,struct WlanBand *band) +{ + if (capability == NULL || band == NULL) { + HDF_LOGE("%s: capability or band is NULL", __func__); + return HDF_ERR_INVALID_PARAM; + } + if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { + band = capability->bands[IEEE80211_BAND_2GHZ]; + if (band->channelCount > WIFI_24G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + return HDF_FAILURE; + } + } else if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { + band = capability->bands[IEEE80211_BAND_5GHZ]; + if (band->channelCount > WIFI_5G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + return HDF_FAILURE; + } + } else { + HDF_LOGE("%s: Supportting 2.4G/5G is required by now!", __func__); + return HDF_FAILURE; + } + return HDF_SUCCESS; +} + static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *featureData) { int32_t ret = HDF_SUCCESS; @@ -487,25 +512,11 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe featureData->bitrate[loop] = capability->supportedRates[loop]; } - if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { - struct WlanBand *band = capability->bands[IEEE80211_BAND_2GHZ]; - if (band->channelCount > WIFI_24G_CHANNEL_NUM) { - HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); - ret = HDF_FAILURE; - break; - } - } else if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { - band = capability->bands[IEEE80211_BAND_5GHZ]; - if (band->channelCount > WIFI_5G_CHANNEL_NUM) { - HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); - ret = HDF_FAILURE; - break; - } - } else { - HDF_LOGE("%s: Supportting 2.4G/5G is required by now!", __func__); + if (WifiCheckChannelNum(capability, &band) != HDF_SUCCESS) { ret = HDF_FAILURE; break; } + featureData->channelNum = band->channelCount; featureData->htCapab = capability->htCapability; From 8736d5e844d6a01fe8606dcf7cb05cf80fa42fda Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Wed, 1 Dec 2021 07:18:22 +0000 Subject: [PATCH 04/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index c4fe594e..ea7d2c1d 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -466,22 +466,22 @@ static int32_t WifiCmdSetMode(const RequestContext *context, struct HdfSBuf *req return ret; } -static int32_t WifiCheckChannelNum(struct WlanHwCapability *capability,struct WlanBand *band) +static int32_t WifiCheckChannelNum(struct WlanHwCapability *capability,struct WlanBand **band) { if (capability == NULL || band == NULL) { HDF_LOGE("%s: capability or band is NULL", __func__); return HDF_ERR_INVALID_PARAM; } if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { - band = capability->bands[IEEE80211_BAND_2GHZ]; - if (band->channelCount > WIFI_24G_CHANNEL_NUM) { - HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + *band = capability->bands[IEEE80211_BAND_2GHZ]; + if ((*band)->channelCount > WIFI_24G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, (*band)->channelCount); return HDF_FAILURE; } } else if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { - band = capability->bands[IEEE80211_BAND_5GHZ]; - if (band->channelCount > WIFI_5G_CHANNEL_NUM) { - HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + *band = capability->bands[IEEE80211_BAND_5GHZ]; + if ((*band)->channelCount > WIFI_5G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, (*band)->channelCount); return HDF_FAILURE; } } else { From 5df24045170b090d292b26b1cdf9eace8d367fba Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Thu, 2 Dec 2021 07:25:56 +0000 Subject: [PATCH 05/10] Description: wlan 5GHz adapter framework Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/include/hdf_wifi_cmd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/network/wifi/include/hdf_wifi_cmd.h b/model/network/wifi/include/hdf_wifi_cmd.h index 9233c64a..8096da70 100644 --- a/model/network/wifi/include/hdf_wifi_cmd.h +++ b/model/network/wifi/include/hdf_wifi_cmd.h @@ -313,13 +313,14 @@ typedef struct { } WifiIeee80211Channel; #define MAX_SUPPORTED_RATE 12 +#define WIFI_5G_CHANNEL_NUM 24 typedef struct { int32_t channelNum; uint16_t bitrate[MAX_SUPPORTED_RATE]; uint16_t htCapab; uint8_t resv[2]; - WifiIeee80211Channel iee80211Channel[24]; + WifiIeee80211Channel iee80211Channel[WIFI_5G_CHANNEL_NUM]; } WifiHwFeatureData; typedef struct { From f02d7c4c8891eefd75ce5a27fdd8da0d2515fa5e Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 10 Dec 2021 04:37:34 +0000 Subject: [PATCH 06/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/hdf_wifi_core.c | 4 ++ model/network/wifi/core/module/wifi_base.c | 67 +++++++++++----------- model/network/wifi/include/hdf_wifi_cmd.h | 9 ++- 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/model/network/wifi/core/hdf_wifi_core.c b/model/network/wifi/core/hdf_wifi_core.c index bbb107ea..058d3a7b 100644 --- a/model/network/wifi/core/hdf_wifi_core.c +++ b/model/network/wifi/core/hdf_wifi_core.c @@ -515,6 +515,10 @@ static int32_t HdfWlanMainInit(struct HdfDeviceObject *device) HDF_LOGE("%s:HdfWlanGetConfig get wlan config failed!", __func__); return HDF_FAILURE; } + int regVirtualAddr = IO_DEVICE_ADDR(0x12010000+0x0154); +    uint32_t currentValue = readl(regVirtualAddr); +    currentValue |= 0x0c; // Set to 25MHz +    writel(currentValue, regVirtualAddr); /* feature init */ rootConfig = HdfWlanGetModuleConfigRoot(); moduleConfig = &rootConfig->wlanConfig.moduleConfig; diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index ea7d2c1d..9aea27b8 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -29,7 +29,7 @@ #endif #define WIFI_24G_CHANNEL_NUM 14 -#define WIFI_5G_CHANNEL_NUM 24 +#define WIFI_MAX_CHANNEL_NUM 24 #define DEFAULT_EAPOL_PACKAGE_SIZE 800 Service *g_baseService = NULL; @@ -466,29 +466,23 @@ static int32_t WifiCmdSetMode(const RequestContext *context, struct HdfSBuf *req return ret; } -static int32_t WifiCheckChannelNum(struct WlanHwCapability *capability,struct WlanBand **band) +static void WifiGetChannelData(struct WlanBand *band, WifiHwFeatureData **featureData, struct WlanHwCapability *capability, uint32_t iee80211band) { - if (capability == NULL || band == NULL) { - HDF_LOGE("%s: capability or band is NULL", __func__); - return HDF_ERR_INVALID_PARAM; + uint32_t loop; + if (band == NULL || featureData == NULL) + { + HDF_LOGE("%s: band or featureData is NULL", __func__); + return; } - if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { - *band = capability->bands[IEEE80211_BAND_2GHZ]; - if ((*band)->channelCount > WIFI_24G_CHANNEL_NUM) { - HDF_LOGE("%s: channels %u out of range", __func__, (*band)->channelCount); - return HDF_FAILURE; - } - } else if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { - *band = capability->bands[IEEE80211_BAND_5GHZ]; - if ((*band)->channelCount > WIFI_5G_CHANNEL_NUM) { - HDF_LOGE("%s: channels %u out of range", __func__, (*band)->channelCount); - return HDF_FAILURE; - } - } else { - HDF_LOGE("%s: Supportting 2.4G/5G is required by now!", __func__); - return HDF_FAILURE; - } - return HDF_SUCCESS; + + (*featureData)->bands[iee80211band].channelNum = band->channelCount; + (*featureData)->htCapab = capability->htCapability; + + for (loop = 0; loop < band->channelCount; ++loop) { + (*featureData)->bands[iee80211band].iee80211Channel[loop].freq = band->channels[loop].centerFreq; + (*featureData)->bands[iee80211band].iee80211Channel[loop].flags = band->channels[loop].flags; + (*featureData)->bands[iee80211band].iee80211Channel[loop].channel = band->channels[loop].channelId; + } } static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *featureData) @@ -511,19 +505,24 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe HDF_LOGV("%s: supported rate %u", __func__, capability->supportedRates[loop]); featureData->bitrate[loop] = capability->supportedRates[loop]; } - - if (WifiCheckChannelNum(capability, &band) != HDF_SUCCESS) { - ret = HDF_FAILURE; - break; - } - featureData->channelNum = band->channelCount; - featureData->htCapab = capability->htCapability; - - for (loop = 0; loop < band->channelCount; ++loop) { - featureData->iee80211Channel[loop].flags = band->channels[loop].flags; - featureData->iee80211Channel[loop].freq = band->channels[loop].centerFreq; - featureData->iee80211Channel[loop].channel = band->channels[loop].channelId; + if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { + band = capability->bands[IEEE80211_BAND_2GHZ]; + if (band->channelCount > WIFI_24G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + ret = HDF_FAILURE; + break; + } + WifiGetChannelData(band, &featureData, capability, IEEE80211_BAND_2GHZ); + } + if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { + band = capability->bands[IEEE80211_BAND_5GHZ]; + if (band->channelCount > WIFI_5G_CHANNEL_NUM) { + HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); + ret = HDF_FAILURE; + break; + } + WifiGetChannelData(band, &featureData, capability, IEEE80211_BAND_5GHZ); } } while (false); diff --git a/model/network/wifi/include/hdf_wifi_cmd.h b/model/network/wifi/include/hdf_wifi_cmd.h index 8096da70..62583369 100644 --- a/model/network/wifi/include/hdf_wifi_cmd.h +++ b/model/network/wifi/include/hdf_wifi_cmd.h @@ -313,14 +313,19 @@ typedef struct { } WifiIeee80211Channel; #define MAX_SUPPORTED_RATE 12 -#define WIFI_5G_CHANNEL_NUM 24 +#define WIFI_MAX_CHANNEL_NUM 24 + +typedef struct { + int32_t channelNum; /**< Number of channels */ + WifiIeee80211Channel iee80211Channel[WIFI_MAX_CHANNEL_NUM]; /**< WLAN channel structures */ +}WlanBands; typedef struct { int32_t channelNum; uint16_t bitrate[MAX_SUPPORTED_RATE]; uint16_t htCapab; uint8_t resv[2]; - WifiIeee80211Channel iee80211Channel[WIFI_5G_CHANNEL_NUM]; + WlanBands bands[2]; } WifiHwFeatureData; typedef struct { From ff2d77e8d9c9e406694214183958ecfcb7e71fd4 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 10 Dec 2021 06:29:28 +0000 Subject: [PATCH 07/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index 9aea27b8..70b0db14 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -517,7 +517,7 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe } if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { band = capability->bands[IEEE80211_BAND_5GHZ]; - if (band->channelCount > WIFI_5G_CHANNEL_NUM) { + if (band->channelCount > WIFI_MAX_CHANNEL_NUM) { HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); ret = HDF_FAILURE; break; From 8293cb400037637e12f6152050e8d2b8b289aa32 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 10 Dec 2021 07:01:34 +0000 Subject: [PATCH 08/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/hdf_wifi_core.c | 4 ---- model/network/wifi/core/module/wifi_base.c | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/model/network/wifi/core/hdf_wifi_core.c b/model/network/wifi/core/hdf_wifi_core.c index 058d3a7b..bbb107ea 100644 --- a/model/network/wifi/core/hdf_wifi_core.c +++ b/model/network/wifi/core/hdf_wifi_core.c @@ -515,10 +515,6 @@ static int32_t HdfWlanMainInit(struct HdfDeviceObject *device) HDF_LOGE("%s:HdfWlanGetConfig get wlan config failed!", __func__); return HDF_FAILURE; } - int regVirtualAddr = IO_DEVICE_ADDR(0x12010000+0x0154); -    uint32_t currentValue = readl(regVirtualAddr); -    currentValue |= 0x0c; // Set to 25MHz -    writel(currentValue, regVirtualAddr); /* feature init */ rootConfig = HdfWlanGetModuleConfigRoot(); moduleConfig = &rootConfig->wlanConfig.moduleConfig; diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index 70b0db14..b74133d1 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -489,7 +489,6 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe { int32_t ret = HDF_SUCCESS; struct WlanHwCapability *capability = GetHwCapability(netdev); - struct WlanBand *band = NULL; if (capability == NULL) { HDF_LOGE("%s:GetHwCapability failed!", __func__); return HDF_FAILURE; @@ -507,7 +506,7 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe } if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { - band = capability->bands[IEEE80211_BAND_2GHZ]; + struct WlanBand *band = capability->bands[IEEE80211_BAND_2GHZ]; if (band->channelCount > WIFI_24G_CHANNEL_NUM) { HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); ret = HDF_FAILURE; @@ -516,7 +515,7 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe WifiGetChannelData(band, &featureData, capability, IEEE80211_BAND_2GHZ); } if (capability->bands[IEEE80211_BAND_5GHZ] != NULL) { - band = capability->bands[IEEE80211_BAND_5GHZ]; + struct WlanBand *band = capability->bands[IEEE80211_BAND_5GHZ]; if (band->channelCount > WIFI_MAX_CHANNEL_NUM) { HDF_LOGE("%s: channels %u out of range", __func__, band->channelCount); ret = HDF_FAILURE; From 34ec0d57a9a17ed9c683625966d48d1c099b02c7 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 10 Dec 2021 08:15:17 +0000 Subject: [PATCH 09/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 4 ++-- model/network/wifi/include/hdf_wifi_cmd.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index b74133d1..8fc2c093 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -469,7 +469,7 @@ static int32_t WifiCmdSetMode(const RequestContext *context, struct HdfSBuf *req static void WifiGetChannelData(struct WlanBand *band, WifiHwFeatureData **featureData, struct WlanHwCapability *capability, uint32_t iee80211band) { uint32_t loop; - if (band == NULL || featureData == NULL) + if (band == NULL || featureData == NULL || *featureData == NULL) { HDF_LOGE("%s: band or featureData is NULL", __func__); return; @@ -504,7 +504,7 @@ static int32_t WifiFillHwFeature(struct NetDevice *netdev, WifiHwFeatureData *fe HDF_LOGV("%s: supported rate %u", __func__, capability->supportedRates[loop]); featureData->bitrate[loop] = capability->supportedRates[loop]; } - + if (capability->bands[IEEE80211_BAND_2GHZ] != NULL) { struct WlanBand *band = capability->bands[IEEE80211_BAND_2GHZ]; if (band->channelCount > WIFI_24G_CHANNEL_NUM) { diff --git a/model/network/wifi/include/hdf_wifi_cmd.h b/model/network/wifi/include/hdf_wifi_cmd.h index 62583369..68e9ea94 100644 --- a/model/network/wifi/include/hdf_wifi_cmd.h +++ b/model/network/wifi/include/hdf_wifi_cmd.h @@ -325,7 +325,7 @@ typedef struct { uint16_t bitrate[MAX_SUPPORTED_RATE]; uint16_t htCapab; uint8_t resv[2]; - WlanBands bands[2]; + WlanBands bands[IEEE80211_NUM_BANDS]; } WifiHwFeatureData; typedef struct { From d8ebb9b961ff0bdd6cc4958d128eb540215df1a0 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 10 Dec 2021 08:39:54 +0000 Subject: [PATCH 10/10] Description: wlan 5GHz adapter Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/include/hdf_wifi_cmd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/network/wifi/include/hdf_wifi_cmd.h b/model/network/wifi/include/hdf_wifi_cmd.h index 68e9ea94..611e05d9 100644 --- a/model/network/wifi/include/hdf_wifi_cmd.h +++ b/model/network/wifi/include/hdf_wifi_cmd.h @@ -314,6 +314,7 @@ typedef struct { #define MAX_SUPPORTED_RATE 12 #define WIFI_MAX_CHANNEL_NUM 24 +#define SUPPORTED_NUM_BANDS 2 typedef struct { int32_t channelNum; /**< Number of channels */ @@ -325,7 +326,7 @@ typedef struct { uint16_t bitrate[MAX_SUPPORTED_RATE]; uint16_t htCapab; uint8_t resv[2]; - WlanBands bands[IEEE80211_NUM_BANDS]; + WlanBands bands[SUPPORTED_NUM_BANDS]; } WifiHwFeatureData; typedef struct {