From a55bfc13a392e03d9ed173a33af740d3a7c5b0a8 Mon Sep 17 00:00:00 2001 From: zianed Date: Wed, 19 May 2021 23:40:11 +0800 Subject: [PATCH] modify word spell --- include/wifi/hdf_wifi_event.h | 10 +++++----- include/wifi/hdf_wifi_product.h | 2 +- include/wifi/net_device.h | 10 +++++----- include/wifi/wifi_inc.h | 2 +- include/wifi/wifi_mac80211_ops.h | 12 ++++++------ include/wifi/wifi_module.h | 2 +- model/network/wifi/platform/src/qos/flow_control.c | 8 ++++++-- model/sensor/driver/common/src/sensor_common.c | 2 +- model/sensor/driver/common/src/sensor_parser.c | 2 +- support/posix/src/osal_thread.c | 3 +-- .../config/hcs_parser/unittest/hcs_config_test.c | 2 +- 11 files changed, 29 insertions(+), 26 deletions(-) diff --git a/include/wifi/hdf_wifi_event.h b/include/wifi/hdf_wifi_event.h index a1c68fc8f..cfae47b11 100644 --- a/include/wifi/hdf_wifi_event.h +++ b/include/wifi/hdf_wifi_event.h @@ -32,8 +32,8 @@ * @version 1.0 */ -#ifndef __HDF_WIFI_EVENT_H__ -#define __HDF_WIFI_EVENT_H__ +#ifndef HDF_WIFI_EVENT_H +#define HDF_WIFI_EVENT_H #include "hdf_wifi_cmd.h" #include "wifi_mac80211_ops.h" @@ -52,7 +52,7 @@ extern "C" { * @version 1.0 */ struct RateInfo { - uint8_t flags; /**< Flag field, used to indicate a specific rate transmission type of 802.11n */ + uint8_t flags; /**< Flag, used to indicate a specific rate transmission type of 802.11n */ uint8_t mcs; /**< Modulation and Coding Scheme (MCS) index of the HT/VHT/HE rate */ uint16_t legacy; /**< 100 kbit/s bit rate defined in 802.11a/b/g */ uint8_t nss; /**< Number of streams (for VHT and HE only) */ @@ -268,7 +268,7 @@ struct Ieee80211Mgmt { struct ScannedBssInfo { int32_t signal; /**< Signal strength */ int16_t freq; /**< Center frequency of the channel where the BSS is located */ - uint8_t arry[2]; /**< Reserved */ + uint8_t array[2]; /**< Reserved */ uint32_t mgmtLen; /**< Management frame length */ struct Ieee80211Mgmt *mgmt; /**< Start address of the management frame */ }; @@ -482,5 +482,5 @@ int32_t HdfWifiEventResetResult(const uint8_t chipId, int32_t resetStatus); #endif #endif -#endif /* __HDF_WIFI_EVENT_H__ */ +#endif /* HDF_WIFI_EVENT_H */ /** @} */ diff --git a/include/wifi/hdf_wifi_product.h b/include/wifi/hdf_wifi_product.h index 1007523cf..40bf88420 100644 --- a/include/wifi/hdf_wifi_product.h +++ b/include/wifi/hdf_wifi_product.h @@ -113,7 +113,7 @@ struct WifiModule* HdfWlanGetModule(void); struct HdfWlanDevice *HdfWlanGetWlanDevice(uint8_t chipId); /** - * @brief Send broadcast event. + * @brief Sends a broadcast event. * * @param id Indicates the ID of the event to send. * @param data Indicates the pointer to the event information. diff --git a/include/wifi/net_device.h b/include/wifi/net_device.h index d13adb0fa..9b1b59634 100644 --- a/include/wifi/net_device.h +++ b/include/wifi/net_device.h @@ -387,7 +387,7 @@ struct TcpHeader { uint16_t sPort; /**< Source port number */ uint16_t dPort; /**< Destination port number */ uint32_t seqNum; /**< Sequence number */ - uint32_t ackNum; /**< Acknowledgement number */ + uint32_t ackNum; /**< Acknowledgment number */ uint8_t offset; /**< Header length */ uint8_t flags; /**< Flags */ uint16_t window; /**< Window size */ @@ -465,7 +465,7 @@ typedef struct NetDevice { char name[IFNAMSIZ]; /**< Network device name {@link IFNAMSIZ} */ NetLinkType LinkLayerType; /**< Data link layer type */ IfType funType; /**< Network port type */ - char macAddr[MAC_ADDR_SIZE]; /**< MAC address {@link MAC_ADDR_SIZE} */ + unsigned char macAddr[MAC_ADDR_SIZE]; /**< MAC address {@link MAC_ADDR_SIZE} */ uint32_t flags; /**< Network port status */ uint32_t mtu; /**< Maximum transmission unit */ int32_t watchdogTime; /**< Watchdog duration */ @@ -496,12 +496,12 @@ struct NetDeviceInterFace { void (*deInit)(struct NetDevice *netDev); /**< Deinitializes a network device to be delete. */ int32_t (*open)(struct NetDevice *netDev); /**< Opens the data link layer. */ int32_t (*stop)(struct NetDevice *netDev); /**< Closes the data link layer. */ - NetDevTxResult (*xmit)(struct NetDevice *netDev, NetBuf *netBuff); /**< Sends data. */ + NetDevTxResult (*xmit)(struct NetDevice *netDev, NetBuf *netBuff); /**< Sends data. */ int32_t (*ioctl)(struct NetDevice *netDev, IfReq *req, int32_t cmd); /**< Used for the control command word. */ int32_t (*setMacAddr)(struct NetDevice *netDev, void *addr); /**< Sets the MAC address. */ struct NetDevStats *(*getStats)(struct NetDevice *netDev); /**< Obtains the statistics. */ void (*setNetIfStatus)(struct NetDevice *netDev, NetIfStatus status); /**< Sets the network port status. */ - uint16_t (*selectQueue)(struct NetDevice *netDev, NetBuf *netBuff);/**< Selects a priority queue. */ + uint16_t (*selectQueue)(struct NetDevice *netDev, NetBuf *netBuff); /**< Selects a priority queue. */ uint32_t (*netifNotify)(struct NetDevice *netDev, NetDevNotify *notify); /**< Notifies the network port status. */ int32_t (*changeMtu)(struct NetDevice *netDev, int32_t newMtu); /**< Changes the maximum number of * transmission units. @@ -658,7 +658,7 @@ int32_t NetIfSetAddr(const struct NetDevice *netDevice, const IpV4Addr *ipAddr, * @brief Notifies the network layer of the network port state. * * @param netDevice Indicates the pointer to the network device obtained during initialization. - * @paramstatus Indicates the network port state, as enumerated in {@link NetIfSatus}. + * @param status Indicates the network port state, as enumerated in {@link NetIfSatus}. * @param status Indicates the network port state, as enumerated in {@link NetIfSatus}. * * @return Returns 0 if the operation is successful; returns a non-zero value otherwise. diff --git a/include/wifi/wifi_inc.h b/include/wifi/wifi_inc.h index f1ec5336f..5e25c080e 100644 --- a/include/wifi/wifi_inc.h +++ b/include/wifi/wifi_inc.h @@ -62,7 +62,7 @@ struct BusDev; * @version 1.0 */ enum WifiMainFeatureType { - HDF_WIFI_FEATURE_AP, /**< AP */ + HDF_WIFI_FEATURE_AP, /**< Access point (AP) */ HDF_WIFI_FEATURE_STA, /**< Station */ HDF_WIFI_FEATURE_P2P, /**< Peer-to-peer (P2P) */ HDF_WIFI_FEATURE_NAN, /**< Neighbor Awareness Networking (NAN) */ diff --git a/include/wifi/wifi_mac80211_ops.h b/include/wifi/wifi_mac80211_ops.h index eb498f911..4e1244bfb 100644 --- a/include/wifi/wifi_mac80211_ops.h +++ b/include/wifi/wifi_mac80211_ops.h @@ -32,8 +32,8 @@ * @version 1.0 */ -#ifndef _WIFI_MAC80211_OPS_H_ -#define _WIFI_MAC80211_OPS_H_ +#ifndef WIFI_MAC80211_OPS_H +#define WIFI_MAC80211_OPS_H #include "net_device.h" #include "hdf_wifi_cmd.h" @@ -440,9 +440,9 @@ struct WlanAPConf { struct WlanHwCapability { void (*Release)(struct WlanHwCapability *self); /**< Function for releasing the hardware capability */ struct WlanBand *bands[IEEE80211_NUM_BANDS]; /**< Frequency bands */ - uint16_t htCapability; /**< High-throughput (HT) capability */ - uint16_t supportedRateCount;/**< Number of supported rates */ - uint16_t *supportedRates; /**< An array of supported rates in 100 kbit/s */ + uint16_t htCapability; /**< High-throughput (HT) capability */ + uint16_t supportedRateCount; /**< Number of supported rates */ + uint16_t *supportedRates; /**< An array of supported rates in 100 kbit/s */ }; /** @@ -767,5 +767,5 @@ struct HdfMac80211APOps { int32_t (*GetAssociatedStasInfo)(NetDevice *netDev, WifiStaInfo *staInfo, uint32_t num); }; -#endif // _WIFI_MAC80211_OPS_H_ +#endif // WIFI_MAC80211_OPS_H /** @} */ diff --git a/include/wifi/wifi_module.h b/include/wifi/wifi_module.h index f58b04dd1..6bb836c2d 100644 --- a/include/wifi/wifi_module.h +++ b/include/wifi/wifi_module.h @@ -206,7 +206,7 @@ int16_t InitWifiModule(struct WifiModule *module, const struct HdfConfigWlanModu #define RETURN_IF_CHIPOPS_NOT_IMPLEMENT(chipOps, opsName) \ do { \ - if ((chipOps) == NULL ||(chipOps)->opsName == NULL) { \ + if ((chipOps) == NULL || (chipOps)->opsName == NULL) { \ HDF_LOGE("macOps" #opsName "not implement"); \ return HDF_ERR_INVALID_OBJECT; \ } \ diff --git a/model/network/wifi/platform/src/qos/flow_control.c b/model/network/wifi/platform/src/qos/flow_control.c index 923598eb8..b4963f5cd 100644 --- a/model/network/wifi/platform/src/qos/flow_control.c +++ b/model/network/wifi/platform/src/qos/flow_control.c @@ -101,7 +101,7 @@ static FlowControlQueueID IpProcessFunc(const void *buff, uint32_t len) return QUEUE_ID_COUNT; } if (len < sizeof(struct IpHeader)) { - HDF_LOGE("%s fail: len not right!", __func__); + HDF_LOGE("%s fail: IpHeader len not right!", __func__); return QUEUE_ID_COUNT; } ipHeader = (struct IpHeader *)buff; @@ -116,6 +116,10 @@ static FlowControlQueueID IpProcessFunc(const void *buff, uint32_t len) * ---------------------------------------------------------------------- */ id = TosToFcQueueId(ipHeader->tos >> IP_PRI_SHIFT); + if ((len - sizeof(struct IpHeader)) < sizeof(struct UdpHeader)) { + HDF_LOGE("%s fail: UdpHeader len not right!", __func__); + return QUEUE_ID_COUNT; + } udpHdr = (struct UdpHeader *)(ipHeader + 1); if (((ntohs(ipHeader->fragInfo) & 0x1FFF) == 0) && IsDhcpPort(udpHdr, len - sizeof(struct IpHeader))) { id = VIP_QUEUE_ID; @@ -381,7 +385,7 @@ void DeInitFlowControl(struct FlowControlModule *fcm) return; } - /* 1:Detroy task. 2:Destroy osalwait. 3:free NetBuff. */ + /* 1:Destroy task. 2:Destroy osalwait. 3:free NetBuff. */ DestroyFlowControlTask(fcm); for (i = 0; i < FLOW_DIR_COUNT; i++) { OsalSemDestroy(&fcm->sem[i]); diff --git a/model/sensor/driver/common/src/sensor_common.c b/model/sensor/driver/common/src/sensor_common.c index a48719f97..c7130f677 100644 --- a/model/sensor/driver/common/src/sensor_common.c +++ b/model/sensor/driver/common/src/sensor_common.c @@ -160,4 +160,4 @@ void DestroySensorThread(struct OsalThread *thread, uint8_t *status) OsalThreadDestroy(thread); *status = SENSOR_THREAD_DESTROY; -} +} \ No newline at end of file diff --git a/model/sensor/driver/common/src/sensor_parser.c b/model/sensor/driver/common/src/sensor_parser.c index 0030fc487..57472baa5 100644 --- a/model/sensor/driver/common/src/sensor_parser.c +++ b/model/sensor/driver/common/src/sensor_parser.c @@ -379,4 +379,4 @@ int32_t GetSensorBaseConfigData(const struct DeviceResourceNode *node, struct Se CHECK_PARSER_RESULT_RETURN_VALUE(ret, "accelAttr"); return HDF_SUCCESS; -} +} \ No newline at end of file diff --git a/support/posix/src/osal_thread.c b/support/posix/src/osal_thread.c index 4fcfce157..12c162ff9 100644 --- a/support/posix/src/osal_thread.c +++ b/support/posix/src/osal_thread.c @@ -11,7 +11,6 @@ #include "hdf_base.h" #include "hdf_log.h" #include "osal_mem.h" - #ifndef PTHREAD_STACK_MIN #define OSAL_PTHREAD_STACK_MIN 4096 #else @@ -79,7 +78,7 @@ int32_t OsalThreadCreate(struct OsalThread *thread, OsalThreadEntry threadEntry, int32_t OsalThreadDestroy(struct OsalThread *thread) { - if (thread->realThread != NULL) { + if (thread != NULL && thread->realThread != NULL) { OsalMemFree(thread->realThread); thread->realThread = NULL; } diff --git a/test/unittest/ability/config/hcs_parser/unittest/hcs_config_test.c b/test/unittest/ability/config/hcs_parser/unittest/hcs_config_test.c index cb2ea0c12..b5757268e 100644 --- a/test/unittest/ability/config/hcs_parser/unittest/hcs_config_test.c +++ b/test/unittest/ability/config/hcs_parser/unittest/hcs_config_test.c @@ -1019,4 +1019,4 @@ int HcsTestGetNodeAttrRefFail(void) return HDF_FAILURE; } return HDF_SUCCESS; -} +} \ No newline at end of file -- Gitee