qcacld-3.0: Replace Linux Fix-Width data-type with C-99 stdints
Protocol stack supposed to be HLOS-agnostic, but there is some use of Linux fixed-width types u8, u16, and u32. These should be replaced with C99 fixed-width types uint8_t, uint16_t, and uint32_t so that they will correctly be HLOS-agnostic and work on non-Linux targets. CRs-Fixed: 2326407 Change-Id: I8f9099a0170e4f94a54cdd6cc6c2e321a29af717
此提交包含在:
@@ -1535,16 +1535,17 @@ static QDF_STATUS find_ie_data_after_fils_session_ie(tpAniSirGlobal mac_ctx,
|
||||
*
|
||||
* Return: zero on success, error otherwise
|
||||
*/
|
||||
static int fils_aead_encrypt(const u8 *kek, unsigned int kek_len,
|
||||
const u8 *own_mac, const u8 *bssid,
|
||||
const u8 *snonce, const u8 *anonce,
|
||||
const u8 *data, size_t data_len, u8 *plain_text,
|
||||
size_t plain_text_len, u8 *out)
|
||||
static int fils_aead_encrypt(const uint8_t *kek, unsigned int kek_len,
|
||||
const uint8_t *own_mac, const uint8_t *bssid,
|
||||
const uint8_t *snonce, const uint8_t *anonce,
|
||||
const uint8_t *data, size_t data_len,
|
||||
uint8_t *plain_text, size_t plain_text_len,
|
||||
uint8_t *out)
|
||||
{
|
||||
u8 v[AES_BLOCK_SIZE];
|
||||
const u8 *aad[6];
|
||||
uint8_t v[AES_BLOCK_SIZE];
|
||||
const uint8_t *aad[6];
|
||||
size_t aad_len[6];
|
||||
u8 *buf;
|
||||
uint8_t *buf;
|
||||
int ret;
|
||||
|
||||
/* SIV Encrypt/Decrypt takes input key of length 256, 384 or 512 bits */
|
||||
@@ -1682,18 +1683,19 @@ QDF_STATUS aead_encrypt_assoc_req(tpAniSirGlobal mac_ctx,
|
||||
*
|
||||
* Return: zero on success, error otherwise
|
||||
*/
|
||||
static int fils_aead_decrypt(const u8 *kek, unsigned int kek_len,
|
||||
const u8 *own_mac, const u8 *bssid,
|
||||
const u8 *snonce, const u8 *anonce,
|
||||
const u8 *data, size_t data_len, u8 *ciphered_text,
|
||||
size_t ciphered_text_len, u8 *plain_text)
|
||||
static int fils_aead_decrypt(const uint8_t *kek, unsigned int kek_len,
|
||||
const uint8_t *own_mac, const uint8_t *bssid,
|
||||
const uint8_t *snonce, const uint8_t *anonce,
|
||||
const uint8_t *data, size_t data_len,
|
||||
uint8_t *ciphered_text, size_t ciphered_text_len,
|
||||
uint8_t *plain_text)
|
||||
{
|
||||
const u8 *aad[6];
|
||||
const uint8_t *aad[6];
|
||||
size_t aad_len[6];
|
||||
u8 *buf;
|
||||
uint8_t *buf;
|
||||
size_t buf_len;
|
||||
u8 v[AES_BLOCK_SIZE];
|
||||
u8 siv[AES_BLOCK_SIZE];
|
||||
uint8_t v[AES_BLOCK_SIZE];
|
||||
uint8_t siv[AES_BLOCK_SIZE];
|
||||
int ret;
|
||||
|
||||
/* SIV Encrypt/Decrypt takes input key of length 256, 384 or 512 bits */
|
||||
|
@@ -337,16 +337,16 @@ enum ds_mode {
|
||||
/* Macros for handling unaligned memory accesses */
|
||||
#define P2PIE_PUT_LE16(a, val) \
|
||||
do { \
|
||||
(a)[1] = ((u16) (val)) >> 8; \
|
||||
(a)[0] = ((u16) (val)) & 0xff; \
|
||||
(a)[1] = ((uint16_t) (val)) >> 8; \
|
||||
(a)[0] = ((uint16_t) (val)) & 0xff; \
|
||||
} while (0)
|
||||
|
||||
#define P2PIE_PUT_LE32(a, val) \
|
||||
do { \
|
||||
(a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[0] = (u8) (((u32) (val)) & 0xff); \
|
||||
(a)[3] = (uint8_t) ((((uint32_t) (val)) >> 24) & 0xff); \
|
||||
(a)[2] = (uint8_t) ((((uint32_t) (val)) >> 16) & 0xff); \
|
||||
(a)[1] = (uint8_t) ((((uint32_t) (val)) >> 8) & 0xff); \
|
||||
(a)[0] = (uint8_t) (((uint32_t) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -1930,7 +1930,7 @@ void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
|
||||
bool roam_synch_in_progress);
|
||||
|
||||
QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
|
||||
struct cdp_vdev *vdev, u8 peer_addr[6],
|
||||
struct cdp_vdev *vdev, uint8_t peer_addr[6],
|
||||
u_int32_t peer_type, u_int8_t vdev_id,
|
||||
bool roam_synch_in_progress);
|
||||
|
||||
@@ -1945,8 +1945,8 @@ QDF_STATUS wma_get_cca_stats(tp_wma_handle wma_handle,
|
||||
uint8_t vdev_id);
|
||||
|
||||
struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
|
||||
WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
|
||||
u8 dot11_mode);
|
||||
WLAN_PHY_MODE wma_chan_phy_mode(uint8_t chan, enum phy_ch_width chan_width,
|
||||
uint8_t dot11_mode);
|
||||
|
||||
#ifdef FEATURE_OEM_DATA_SUPPORT
|
||||
QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
|
||||
|
@@ -565,7 +565,7 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
|
||||
|
||||
QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
|
||||
struct cdp_vdev *vdev,
|
||||
u8 peer_addr[IEEE80211_ADDR_LEN],
|
||||
uint8_t peer_addr[IEEE80211_ADDR_LEN],
|
||||
uint32_t peer_type, uint8_t vdev_id,
|
||||
bool roam_synch_in_progress);
|
||||
|
||||
@@ -607,7 +607,7 @@ __wma_vdev_stop_resp_handler(wmi_vdev_stopped_event_fixed_param *resp_event);
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
|
||||
u32 len);
|
||||
uint32_t len);
|
||||
|
||||
struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
|
||||
struct add_sta_self_params *self_sta_req,
|
||||
@@ -655,7 +655,8 @@ uint32_t wma_get_bcn_rate_code(uint16_t rate);
|
||||
|
||||
int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
|
||||
|
||||
int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
|
||||
int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
int wma_unified_bcntx_status_event_handler(void *handle,
|
||||
uint8_t *cmd_param_info,
|
||||
|
@@ -2805,7 +2805,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
|
||||
*/
|
||||
if (status) {
|
||||
/* Call Download Cb so that umac can free the buffer */
|
||||
u32 rem;
|
||||
uint32_t rem;
|
||||
|
||||
if (tx_frm_download_comp_cb)
|
||||
tx_frm_download_comp_cb(wma_handle->mac_context,
|
||||
|
@@ -1717,7 +1717,7 @@ static struct wlan_objmgr_peer *wma_create_objmgr_peer(tp_wma_handle wma,
|
||||
*/
|
||||
QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
|
||||
struct cdp_vdev *vdev,
|
||||
u8 peer_addr[IEEE80211_ADDR_LEN],
|
||||
uint8_t peer_addr[IEEE80211_ADDR_LEN],
|
||||
uint32_t peer_type, uint8_t vdev_id,
|
||||
bool roam_synch_in_progress)
|
||||
{
|
||||
@@ -2275,7 +2275,7 @@ free_req_msg:
|
||||
}
|
||||
|
||||
int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
|
||||
u32 len)
|
||||
uint32_t len)
|
||||
{
|
||||
tp_wma_handle wma = (tp_wma_handle) handle;
|
||||
WMI_VDEV_STOPPED_EVENTID_param_tlvs *param_buf;
|
||||
|
@@ -644,8 +644,8 @@ QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE handle,
|
||||
*
|
||||
* Return: return WLAN_PHY_MODE
|
||||
*/
|
||||
WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
|
||||
u8 dot11_mode)
|
||||
WLAN_PHY_MODE wma_chan_phy_mode(uint8_t chan, enum phy_ch_width chan_width,
|
||||
uint8_t dot11_mode)
|
||||
{
|
||||
WLAN_PHY_MODE phymode = MODE_UNKNOWN;
|
||||
uint16_t bw_val = wlan_reg_get_bw_value(chan_width);
|
||||
@@ -1518,7 +1518,7 @@ QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
|
||||
*
|
||||
* Return: reason code in string format
|
||||
*/
|
||||
static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason)
|
||||
static const uint8_t *wma_wow_wake_reason_str(A_INT32 wake_reason)
|
||||
{
|
||||
switch (wake_reason) {
|
||||
case WOW_REASON_UNSPECIFIED:
|
||||
|
@@ -317,7 +317,8 @@ void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
|
||||
int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
tp_wma_handle wma = (tp_wma_handle) handle;
|
||||
WMI_PEER_STA_KICKOUT_EVENTID_param_tlvs *param_buf = NULL;
|
||||
@@ -2657,7 +2658,7 @@ static QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id,
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
len = *(u32 *) &bcn_info->beacon[0];
|
||||
len = *(uint32_t *) &bcn_info->beacon[0];
|
||||
if (len > SIR_MAX_BEACON_SIZE - sizeof(uint32_t)) {
|
||||
WMA_LOGE("%s: Received beacon len %u exceeding max limit %lu",
|
||||
__func__, len, SIR_MAX_BEACON_SIZE - sizeof(uint32_t));
|
||||
|
新增問題並參考
封鎖使用者