qcacmn: Replace A_UINT with appropriate types
There are instances of use of older A_UINT/A_INT. Replace all such instances with the qdf u_int*_t/int*_t. Change-Id: I7ce29b03f29a0d1a0cf87cfd3c846f4694da4c2a CR's-Fixed: 2210869
This commit is contained in:
138
wmi_tlv_helper.c
138
wmi_tlv_helper.c
@@ -54,17 +54,17 @@
|
||||
WMITLV_SET_ATTRB0(id), \
|
||||
WMITLV_TABLE(id,SET_TLV_ATTRIB, NULL, 0)
|
||||
|
||||
A_UINT32 cmd_attr_list[] = {
|
||||
uint32_t cmd_attr_list[] = {
|
||||
WMITLV_ALL_CMD_LIST(WMITLV_GET_CMD_EVT_ATTRB_LIST)
|
||||
};
|
||||
|
||||
A_UINT32 evt_attr_list[] = {
|
||||
uint32_t evt_attr_list[] = {
|
||||
WMITLV_ALL_EVT_LIST(WMITLV_GET_CMD_EVT_ATTRB_LIST)
|
||||
};
|
||||
|
||||
#ifdef NO_DYNAMIC_MEM_ALLOC
|
||||
static wmitlv_cmd_param_info *g_wmi_static_cmd_param_info_buf;
|
||||
A_UINT32 g_wmi_static_max_cmd_param_tlvs;
|
||||
uint32_t g_wmi_static_max_cmd_param_tlvs;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ A_UINT32 g_wmi_static_max_cmd_param_tlvs;
|
||||
*/
|
||||
void
|
||||
wmitlv_set_static_param_tlv_buf(void *param_tlv_buf,
|
||||
A_UINT32 max_tlvs_accomodated)
|
||||
uint32_t max_tlvs_accomodated)
|
||||
{
|
||||
#ifdef NO_DYNAMIC_MEM_ALLOC
|
||||
g_wmi_static_cmd_param_info_buf = param_tlv_buf;
|
||||
@@ -110,12 +110,12 @@ wmitlv_set_static_param_tlv_buf(void *param_tlv_buf,
|
||||
* Return: 0 if success. Return >=1 if failure.
|
||||
*/
|
||||
static
|
||||
A_UINT32 wmitlv_get_attributes(A_UINT32 is_cmd_id, A_UINT32 cmd_event_id,
|
||||
A_UINT32 curr_tlv_order,
|
||||
uint32_t wmitlv_get_attributes(uint32_t is_cmd_id, uint32_t cmd_event_id,
|
||||
uint32_t curr_tlv_order,
|
||||
wmitlv_attributes_struc *tlv_attr_ptr)
|
||||
{
|
||||
A_UINT32 i, base_index, num_tlvs, num_entries;
|
||||
A_UINT32 *pAttrArrayList;
|
||||
uint32_t i, base_index, num_tlvs, num_entries;
|
||||
uint32_t *pAttrArrayList;
|
||||
|
||||
if (is_cmd_id) {
|
||||
pAttrArrayList = &cmd_attr_list[0];
|
||||
@@ -198,15 +198,15 @@ A_UINT32 wmitlv_get_attributes(A_UINT32 is_cmd_id, A_UINT32 cmd_event_id,
|
||||
*/
|
||||
static int
|
||||
wmitlv_check_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
A_UINT32 param_buf_len, A_UINT32 is_cmd_id,
|
||||
A_UINT32 wmi_cmd_event_id)
|
||||
uint32_t param_buf_len, uint32_t is_cmd_id,
|
||||
uint32_t wmi_cmd_event_id)
|
||||
{
|
||||
wmitlv_attributes_struc attr_struct_ptr;
|
||||
A_UINT32 buf_idx = 0;
|
||||
A_UINT32 tlv_index = 0;
|
||||
A_UINT8 *buf_ptr = (unsigned char *)param_struc_ptr;
|
||||
A_UINT32 expected_num_tlvs, expected_tlv_len;
|
||||
A_INT32 error = -1;
|
||||
uint32_t buf_idx = 0;
|
||||
uint32_t tlv_index = 0;
|
||||
uint8_t *buf_ptr = (unsigned char *)param_struc_ptr;
|
||||
uint32_t expected_num_tlvs, expected_tlv_len;
|
||||
int32_t error = -1;
|
||||
|
||||
/* Get the number of TLVs for this command/event */
|
||||
if (wmitlv_get_attributes
|
||||
@@ -223,9 +223,9 @@ wmitlv_check_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
expected_num_tlvs = attr_struct_ptr.cmd_num_tlv;
|
||||
|
||||
while ((buf_idx + WMI_TLV_HDR_SIZE) <= param_buf_len) {
|
||||
A_UINT32 curr_tlv_tag =
|
||||
uint32_t curr_tlv_tag =
|
||||
WMITLV_GET_TLVTAG(WMITLV_GET_HDR(buf_ptr));
|
||||
A_UINT32 curr_tlv_len =
|
||||
uint32_t curr_tlv_len =
|
||||
WMITLV_GET_TLVLEN(WMITLV_GET_HDR(buf_ptr));
|
||||
|
||||
if ((buf_idx + WMI_TLV_HDR_SIZE + curr_tlv_len) > param_buf_len) {
|
||||
@@ -287,7 +287,7 @@ wmitlv_check_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
attr_struct_ptr.tag_id) {
|
||||
expected_tlv_len =
|
||||
roundup(expected_tlv_len,
|
||||
sizeof(A_UINT32));
|
||||
sizeof(uint32_t));
|
||||
}
|
||||
|
||||
if (curr_tlv_len != expected_tlv_len) {
|
||||
@@ -328,10 +328,10 @@ wmitlv_check_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
|
||||
if (curr_tlv_tag ==
|
||||
WMITLV_TAG_ARRAY_STRUC) {
|
||||
A_UINT8 *tlv_buf_ptr = NULL;
|
||||
A_UINT32 in_tlv_len;
|
||||
A_UINT32 idx;
|
||||
A_UINT32 num_of_elems;
|
||||
uint8_t *tlv_buf_ptr = NULL;
|
||||
uint32_t in_tlv_len;
|
||||
uint32_t idx;
|
||||
uint32_t num_of_elems;
|
||||
|
||||
/* Verify length of inner TLVs */
|
||||
|
||||
@@ -404,11 +404,11 @@ wmitlv_check_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
}
|
||||
|
||||
/* Check TLV length is aligned to 4 bytes or not */
|
||||
if ((curr_tlv_len % sizeof(A_UINT32)) != 0) {
|
||||
if ((curr_tlv_len % sizeof(uint32_t)) != 0) {
|
||||
wmi_tlv_print_error
|
||||
("%s: ERROR: TLV length %d for Cmd=0x%x is not aligned to %zu bytes\n",
|
||||
__func__, curr_tlv_len, wmi_cmd_event_id,
|
||||
sizeof(A_UINT32));
|
||||
sizeof(uint32_t));
|
||||
goto Error_wmitlv_check_tlv_params;
|
||||
}
|
||||
|
||||
@@ -443,9 +443,9 @@ Error_wmitlv_check_tlv_params:
|
||||
*/
|
||||
int
|
||||
wmitlv_check_event_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
A_UINT32 param_buf_len, A_UINT32 wmi_cmd_event_id)
|
||||
uint32_t param_buf_len, uint32_t wmi_cmd_event_id)
|
||||
{
|
||||
A_UINT32 is_cmd_id = 0;
|
||||
uint32_t is_cmd_id = 0;
|
||||
|
||||
return wmitlv_check_tlv_params
|
||||
(os_handle, param_struc_ptr, param_buf_len, is_cmd_id,
|
||||
@@ -467,10 +467,10 @@ wmitlv_check_event_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
*/
|
||||
int
|
||||
wmitlv_check_command_tlv_params(void *os_handle, void *param_struc_ptr,
|
||||
A_UINT32 param_buf_len,
|
||||
A_UINT32 wmi_cmd_event_id)
|
||||
uint32_t param_buf_len,
|
||||
uint32_t wmi_cmd_event_id)
|
||||
{
|
||||
A_UINT32 is_cmd_id = 1;
|
||||
uint32_t is_cmd_id = 1;
|
||||
|
||||
return wmitlv_check_tlv_params
|
||||
(os_handle, param_struc_ptr, param_buf_len, is_cmd_id,
|
||||
@@ -495,20 +495,20 @@ qdf_export_symbol(wmitlv_check_command_tlv_params);
|
||||
*/
|
||||
static int
|
||||
wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
A_UINT32 param_buf_len, A_UINT32 is_cmd_id,
|
||||
A_UINT32 wmi_cmd_event_id, void **wmi_cmd_struct_ptr)
|
||||
uint32_t param_buf_len, uint32_t is_cmd_id,
|
||||
uint32_t wmi_cmd_event_id, void **wmi_cmd_struct_ptr)
|
||||
{
|
||||
wmitlv_attributes_struc attr_struct_ptr;
|
||||
A_UINT32 buf_idx = 0;
|
||||
A_UINT32 tlv_index = 0;
|
||||
A_UINT32 num_of_elems = 0;
|
||||
uint32_t buf_idx = 0;
|
||||
uint32_t tlv_index = 0;
|
||||
uint32_t num_of_elems = 0;
|
||||
int tlv_size_diff = 0;
|
||||
A_UINT8 *buf_ptr = (unsigned char *)param_struc_ptr;
|
||||
uint8_t *buf_ptr = (unsigned char *)param_struc_ptr;
|
||||
wmitlv_cmd_param_info *cmd_param_tlvs_ptr = NULL;
|
||||
A_UINT32 remaining_expected_tlvs = 0xFFFFFFFF;
|
||||
A_UINT32 len_wmi_cmd_struct_buf;
|
||||
A_UINT32 free_buf_len;
|
||||
A_INT32 error = -1;
|
||||
uint32_t remaining_expected_tlvs = 0xFFFFFFFF;
|
||||
uint32_t len_wmi_cmd_struct_buf;
|
||||
uint32_t free_buf_len;
|
||||
int32_t error = -1;
|
||||
|
||||
/* Get the number of TLVs for this command/event */
|
||||
if (wmitlv_get_attributes
|
||||
@@ -564,9 +564,9 @@ wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
|
||||
while (((buf_idx + WMI_TLV_HDR_SIZE) <= param_buf_len)
|
||||
&& (remaining_expected_tlvs)) {
|
||||
A_UINT32 curr_tlv_tag =
|
||||
uint32_t curr_tlv_tag =
|
||||
WMITLV_GET_TLVTAG(WMITLV_GET_HDR(buf_ptr));
|
||||
A_UINT32 curr_tlv_len =
|
||||
uint32_t curr_tlv_len =
|
||||
WMITLV_GET_TLVLEN(WMITLV_GET_HDR(buf_ptr));
|
||||
int num_padding_bytes = 0;
|
||||
|
||||
@@ -633,7 +633,7 @@ wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
} else {
|
||||
/* This TLV has a variable number of elements */
|
||||
if (WMITLV_TAG_ARRAY_STRUC == attr_struct_ptr.tag_id) {
|
||||
A_UINT32 in_tlv_len = 0;
|
||||
uint32_t in_tlv_len = 0;
|
||||
|
||||
if (curr_tlv_len != 0) {
|
||||
in_tlv_len =
|
||||
@@ -683,9 +683,9 @@ wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
if ((WMITLV_TAG_ARRAY_STRUC == attr_struct_ptr.tag_id) &&
|
||||
(tlv_size_diff != 0)) {
|
||||
void *new_tlv_buf = NULL;
|
||||
A_UINT8 *tlv_buf_ptr = NULL;
|
||||
A_UINT32 in_tlv_len;
|
||||
A_UINT32 i;
|
||||
uint8_t *tlv_buf_ptr = NULL;
|
||||
uint32_t in_tlv_len;
|
||||
uint32_t i;
|
||||
|
||||
if (attr_struct_ptr.tag_varied_size == WMITLV_SIZE_FIX) {
|
||||
/* This is not allowed. The tag WMITLV_TAG_ARRAY_STRUC can
|
||||
@@ -727,7 +727,7 @@ wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
wmi_tlv_OS_MEMZERO(new_tlv_buf,
|
||||
(num_of_elems *
|
||||
attr_struct_ptr.tag_struct_size));
|
||||
tlv_buf_ptr = (A_UINT8 *) new_tlv_buf;
|
||||
tlv_buf_ptr = (uint8_t *) new_tlv_buf;
|
||||
for (i = 0; i < num_of_elems; i++) {
|
||||
if (tlv_size_diff > 0) {
|
||||
/* Incoming structure size is greater than expected
|
||||
@@ -753,9 +753,9 @@ wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
}
|
||||
#else
|
||||
{
|
||||
A_UINT8 *src_addr;
|
||||
A_UINT8 *dst_addr;
|
||||
A_UINT32 buf_mov_len;
|
||||
uint8_t *src_addr;
|
||||
uint8_t *dst_addr;
|
||||
uint32_t buf_mov_len;
|
||||
|
||||
if (tlv_size_diff < 0) {
|
||||
/* Incoming structure size is smaller than expected size
|
||||
@@ -939,9 +939,9 @@ wmitlv_check_and_pad_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
{
|
||||
/* Note: tlv_size_diff is a value less than zero */
|
||||
/* Move the Subsequent TLVs by amount of bytes needs to be padded */
|
||||
A_UINT8 *src_addr;
|
||||
A_UINT8 *dst_addr;
|
||||
A_UINT32 src_len;
|
||||
uint8_t *src_addr;
|
||||
uint8_t *dst_addr;
|
||||
uint32_t src_len;
|
||||
|
||||
num_padding_bytes = (tlv_size_diff * -1);
|
||||
|
||||
@@ -999,11 +999,11 @@ Error_wmitlv_check_and_pad_tlvs:
|
||||
*/
|
||||
int
|
||||
wmitlv_check_and_pad_event_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
A_UINT32 param_buf_len,
|
||||
A_UINT32 wmi_cmd_event_id,
|
||||
uint32_t param_buf_len,
|
||||
uint32_t wmi_cmd_event_id,
|
||||
void **wmi_cmd_struct_ptr)
|
||||
{
|
||||
A_UINT32 is_cmd_id = 0;
|
||||
uint32_t is_cmd_id = 0;
|
||||
return wmitlv_check_and_pad_tlvs
|
||||
(os_handle, param_struc_ptr, param_buf_len, is_cmd_id,
|
||||
wmi_cmd_event_id, wmi_cmd_struct_ptr);
|
||||
@@ -1025,11 +1025,11 @@ qdf_export_symbol(wmitlv_check_and_pad_event_tlvs);
|
||||
*/
|
||||
int
|
||||
wmitlv_check_and_pad_command_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
A_UINT32 param_buf_len,
|
||||
A_UINT32 wmi_cmd_event_id,
|
||||
uint32_t param_buf_len,
|
||||
uint32_t wmi_cmd_event_id,
|
||||
void **wmi_cmd_struct_ptr)
|
||||
{
|
||||
A_UINT32 is_cmd_id = 1;
|
||||
uint32_t is_cmd_id = 1;
|
||||
return wmitlv_check_and_pad_tlvs
|
||||
(os_handle, param_struc_ptr, param_buf_len, is_cmd_id,
|
||||
wmi_cmd_event_id, wmi_cmd_struct_ptr);
|
||||
@@ -1046,8 +1046,8 @@ wmitlv_check_and_pad_command_tlvs(void *os_handle, void *param_struc_ptr,
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void wmitlv_free_allocated_tlvs(A_UINT32 is_cmd_id,
|
||||
A_UINT32 cmd_event_id,
|
||||
static void wmitlv_free_allocated_tlvs(uint32_t is_cmd_id,
|
||||
uint32_t cmd_event_id,
|
||||
void **wmi_cmd_struct_ptr)
|
||||
{
|
||||
void *ptr = *wmi_cmd_struct_ptr;
|
||||
@@ -1109,7 +1109,7 @@ break;
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void wmitlv_free_allocated_command_tlvs(A_UINT32 cmd_event_id,
|
||||
void wmitlv_free_allocated_command_tlvs(uint32_t cmd_event_id,
|
||||
void **wmi_cmd_struct_ptr)
|
||||
{
|
||||
wmitlv_free_allocated_tlvs(1, cmd_event_id, wmi_cmd_struct_ptr);
|
||||
@@ -1125,7 +1125,7 @@ void wmitlv_free_allocated_command_tlvs(A_UINT32 cmd_event_id,
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void wmitlv_free_allocated_event_tlvs(A_UINT32 cmd_event_id,
|
||||
void wmitlv_free_allocated_event_tlvs(uint32_t cmd_event_id,
|
||||
void **wmi_cmd_struct_ptr)
|
||||
{
|
||||
wmitlv_free_allocated_tlvs(0, cmd_event_id, wmi_cmd_struct_ptr);
|
||||
@@ -1180,12 +1180,12 @@ wmi_versions_can_downgrade(int num_whitelist,
|
||||
wmi_abi_version *opp_vers,
|
||||
wmi_abi_version *out_vers)
|
||||
{
|
||||
A_UINT8 can_try_to_downgrade;
|
||||
A_UINT32 my_major_vers = WMI_VER_GET_MAJOR(my_vers->abi_version_0);
|
||||
A_UINT32 my_minor_vers = WMI_VER_GET_MINOR(my_vers->abi_version_0);
|
||||
A_UINT32 opp_major_vers = WMI_VER_GET_MAJOR(opp_vers->abi_version_0);
|
||||
A_UINT32 opp_minor_vers = WMI_VER_GET_MINOR(opp_vers->abi_version_0);
|
||||
A_UINT32 downgraded_minor_vers;
|
||||
uint8_t can_try_to_downgrade;
|
||||
uint32_t my_major_vers = WMI_VER_GET_MAJOR(my_vers->abi_version_0);
|
||||
uint32_t my_minor_vers = WMI_VER_GET_MINOR(my_vers->abi_version_0);
|
||||
uint32_t opp_major_vers = WMI_VER_GET_MAJOR(opp_vers->abi_version_0);
|
||||
uint32_t opp_minor_vers = WMI_VER_GET_MINOR(opp_vers->abi_version_0);
|
||||
uint32_t downgraded_minor_vers;
|
||||
|
||||
if ((my_vers->abi_version_ns_0 != opp_vers->abi_version_ns_0) ||
|
||||
(my_vers->abi_version_ns_1 != opp_vers->abi_version_ns_1) ||
|
||||
@@ -1222,7 +1222,7 @@ wmi_versions_can_downgrade(int num_whitelist,
|
||||
/* Try to see we can downgrade the supported version */
|
||||
downgraded_minor_vers = my_minor_vers;
|
||||
while (downgraded_minor_vers > opp_minor_vers) {
|
||||
A_UINT8 downgraded = false;
|
||||
uint8_t downgraded = false;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_whitelist; i++) {
|
||||
|
Reference in New Issue
Block a user