From 011e2c52d81d34612e619ee28793ee89c4d6ba4b Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Thu, 10 Mar 2022 07:48:40 +0000 Subject: [PATCH] Description:modify 3568 ap fail Feature or Bugfix:Bugfix Binary Source: No Signed-off-by: YOUR_NAME --- .../network/wifi/core/components/softap/ap.c | 12 +++++------ model/network/wifi/include/hdf_wifi_cmd.h | 21 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/model/network/wifi/core/components/softap/ap.c b/model/network/wifi/core/components/softap/ap.c index b65c6019..7c468c72 100644 --- a/model/network/wifi/core/components/softap/ap.c +++ b/model/network/wifi/core/components/softap/ap.c @@ -295,7 +295,7 @@ static int32_t WifiCmdStopAp(const RequestContext *context, struct HdfSBuf *reqD static int32_t WifiCmdChangeBeacon(const RequestContext *context, struct HdfSBuf *reqData, struct HdfSBuf *rspData) { struct NetDevice *netdev = NULL; - WifiApSetting *apSettings = NULL; + WifiApSetting apSettings; const char *ifName = NULL; (void)context; (void)rspData; @@ -308,19 +308,19 @@ static int32_t WifiCmdChangeBeacon(const RequestContext *context, struct HdfSBuf HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ifName"); return HDF_FAILURE; } - if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings->beaconData.head), &(apSettings->beaconData.headLen))) { + if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings.beaconData.head), &(apSettings.beaconData.headLen))) { HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "head"); return HDF_FAILURE; } - if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings->beaconData.tail), &(apSettings->beaconData.tailLen))) { + if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings.beaconData.tail), &(apSettings.beaconData.tailLen))) { HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "tail"); return HDF_FAILURE; } - if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings->ssid), &(apSettings->ssidLen))) { + if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings.ssid), &(apSettings.ssidLen))) { HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ssid"); return HDF_FAILURE; } - if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings->meshSsid), &(apSettings->meshSsidLen))) { + if (!HdfSbufReadBuffer(reqData, (const void **)&(apSettings.meshSsid), &(apSettings.meshSsidLen))) { HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "meshSsid"); return HDF_FAILURE; } @@ -329,7 +329,7 @@ static int32_t WifiCmdChangeBeacon(const RequestContext *context, struct HdfSBuf HDF_LOGE("%s:netdev not found!ifName=%s", __func__, ifName); return HDF_FAILURE; } - return ChangeBeacon(netdev, apSettings); + return ChangeBeacon(netdev, &apSettings); } static int32_t WifiCmdStaRemove(const RequestContext *context, struct HdfSBuf *reqData, struct HdfSBuf *rspData) diff --git a/model/network/wifi/include/hdf_wifi_cmd.h b/model/network/wifi/include/hdf_wifi_cmd.h index 611e05d9..91994132 100644 --- a/model/network/wifi/include/hdf_wifi_cmd.h +++ b/model/network/wifi/include/hdf_wifi_cmd.h @@ -10,7 +10,6 @@ #define HDF_WIFI_CMD_H #include "hdf_base.h" -#include #include "net_device.h" #include "hdf_device_desc.h" #include "hdf_sbuf.h" @@ -163,7 +162,7 @@ typedef struct { typedef struct { int32_t reassoc; - size_t ieLen; + uint32_t ieLen; uint8_t *ie; uint8_t macAddr[ETH_ADDR_LEN]; uint8_t resv[2]; @@ -185,14 +184,14 @@ typedef struct { typedef struct { uint32_t freq; - size_t dataLen; + uint32_t dataLen; uint8_t *data; uint64_t *cookie; } WifiMlmeData; typedef struct { - size_t headLen; - size_t tailLen; + uint32_t headLen; + uint32_t tailLen; uint8_t *head; uint8_t *tail; } WifiBeaconData; @@ -202,7 +201,7 @@ typedef struct { uint8_t *src; uint8_t *bssid; uint8_t *data; - size_t dataLen; + uint32_t dataLen; } WifiActionData; typedef struct { @@ -275,13 +274,13 @@ typedef struct { typedef struct { WifiFreqParams freqParams; WifiBeaconData beaconData; - size_t ssidLen; + uint32_t ssidLen; int32_t beaconInterval; int32_t dtimPeriod; uint8_t *ssid; uint8_t hiddenSsid; uint8_t authType; - size_t meshSsidLen; + uint32_t meshSsidLen; uint8_t *meshSsid; } WifiApSetting; @@ -331,7 +330,7 @@ typedef struct { typedef struct { uint8_t ssid[MAX_SSID_LEN]; - size_t ssidLen; + uint32_t ssidLen; } WifiDriverScanSsid; typedef struct { @@ -389,9 +388,9 @@ typedef struct { typedef struct { uint8_t *reqIe; - size_t reqIeLen; + uint32_t reqIeLen; uint8_t *respIe; - size_t respIeLen; + uint32_t respIeLen; uint8_t bssid[ETH_ADDR_LEN]; uint8_t rsv[2]; uint16_t status;