Description: wlan 5GHz adapter

Feature or Bugfix:Feature
Binary Source: No

Signed-off-by: YOUR_NAME <fangdong7@huawei.com>
This commit is contained in:
YOUR_NAME
2021-12-01 07:18:22 +00:00
parent fa46417a2c
commit 8736d5e844
+7 -7
View File
@@ -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 {