diff options
| author | Arun Kumar Khandavalli <c_arunku@qti.qualcomm.com> | 2014-03-30 18:18:12 -0700 |
|---|---|---|
| committer | Pitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com> | 2014-04-15 02:06:27 +0530 |
| commit | a48ca81f46654e22b32ba390bb94a2616775dce4 (patch) | |
| tree | 03fbea3ef2c69830db5cae4e90d588cbd12e15e4 | |
| parent | 286e69f49a4c5992fa9e98a42388b77c8875ee07 (diff) | |
wlan: Resolving 64-bit Compilation Errors.
Due to different pointer size's in ILP32 and LP64,typecasting
a void pointer to int is resulting in "cast from pointer to
integer of different size" error.Resolved compilation errors
by using "uintprt_t" datatype which is internally typecasted
to unsigned long and also performed the sanity on 32-bit
device.
Change-Id: I9b571416121da91b365248b4b3d1aa32c52f101e
CRs-Fixed: 581989
| -rw-r--r-- | CORE/DXE/src/wlan_qct_dxe.c | 41 | ||||
| -rw-r--r-- | CORE/DXE/src/wlan_qct_dxe_i.h | 4 |
2 files changed, 25 insertions, 20 deletions
diff --git a/CORE/DXE/src/wlan_qct_dxe.c b/CORE/DXE/src/wlan_qct_dxe.c index 7017c5868dc3..378c0b65f67c 100644 --- a/CORE/DXE/src/wlan_qct_dxe.c +++ b/CORE/DXE/src/wlan_qct_dxe.c @@ -1074,7 +1074,8 @@ static wpt_status dxeDescAllocAndLink WLANDXE_DescType *prevDesc = NULL; WLANDXE_DescCtrlBlkType *currentCtrlBlk = NULL; unsigned int idx; - void *physAddress = NULL; + void *physAddressAlloc = NULL; + wpt_uint32 physAddress; #ifdef WLANDXE_TEST_CHANNEL_ENABLE WLANDXE_ChannelCBType *testTXChannelCB = &dxeCtrlBlk->dxeChannel[WDTS_CHANNEL_H2H_TEST_TX]; WLANDXE_DescCtrlBlkType *currDescCtrlBlk = testTXChannelCB->headCtrlBlk; @@ -1097,7 +1098,8 @@ static wpt_status dxeDescAllocAndLink /* allocate all DXE descriptors for this channel in one chunk */ channelEntry->descriptorAllocation = (WLANDXE_DescType *) wpalDmaMemoryAllocate(sizeof(WLANDXE_DescType)*channelEntry->numDesc, - &physAddress); + &physAddressAlloc); + physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); if(NULL == channelEntry->descriptorAllocation) { HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, @@ -1115,40 +1117,43 @@ static wpt_status dxeDescAllocAndLink // descriptors were allocated in a chunk -- use the current one memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "Allocated Descriptor VA %p, PA %p", currentDesc, physAddress); + "Allocated Descriptor VA %p, PA %p", currentDesc, physAddressAlloc); #else if(WDTS_CHANNEL_H2H_TEST_RX != channelEntry->channelType) { // allocate a descriptor currentDesc = (WLANDXE_DescType *)wpalDmaMemoryAllocate(sizeof(WLANDXE_DescType), - &physAddress); + &physAddressAlloc); memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); + physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); } else { currentDesc = currDescCtrlBlk->linkedDesc; - physAddress = (void *)currDescCtrlBlk->linkedDescPhyAddr; + physAddress = currDescCtrlBlk->linkedDescPhyAddr; currDescCtrlBlk = (WLANDXE_DescCtrlBlkType *)currDescCtrlBlk->nextCtrlBlk; } #endif /* WLANDXE_TEST_CHANNEL_ENABLE */ #else #ifndef WLANDXE_TEST_CHANNEL_ENABLE - currentDesc = (WLANDXE_DescType *)wpalAcpuDdrDxeDescMemoryAllocate(&physAddress); + currentDesc = (WLANDXE_DescType *)wpalAcpuDdrDxeDescMemoryAllocate(&physAddressAlloc); memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "Allocated Descriptor VA %p, PA %p", currentDesc, physAddress); + "Allocated Descriptor VA %p, PA %p", currentDesc, physAddressAlloc); + physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); #else if(WDTS_CHANNEL_H2H_TEST_RX != channelEntry->channelType) { - currentDesc = (WLANDXE_DescType *)wpalAcpuDdrDxeDescMemoryAllocate(&physAddress); + currentDesc = (WLANDXE_DescType *)wpalAcpuDdrDxeDescMemoryAllocate(&physAddressAlloc); memset((wpt_uint8 *)currentDesc, 0, sizeof(WLANDXE_DescType)); HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - "Allocated Descriptor VA %p, PA %p", currentDesc, physAddress); + "Allocated Descriptor VA %p, PA %p", currentDesc, physAddressAlloc); + physAddress = (wpt_uint32) (uintptr_t)(physAddressAlloc); } else { currentDesc = currDescCtrlBlk->linkedDesc; - physAddress = (void *)currDescCtrlBlk->linkedDescPhyAddr; + physAddress = currDescCtrlBlk->linkedDescPhyAddr; currDescCtrlBlk = (WLANDXE_DescCtrlBlkType *)currDescCtrlBlk->nextCtrlBlk; } #endif /* WLANDXE_TEST_CHANNEL_ENABLE */ @@ -1162,14 +1167,14 @@ static wpt_status dxeDescAllocAndLink } currentCtrlBlk->linkedDesc = currentDesc; - currentCtrlBlk->linkedDescPhyAddr = (unsigned int)physAddress; + currentCtrlBlk->linkedDescPhyAddr = physAddress; /* First descriptor, next none * descriptor bottom location is first descriptor address */ if(0 == idx) { currentDesc->dxedesc.dxe_short_desc.phyNextL = 0; channelEntry->DescBottomLoc = currentDesc; - channelEntry->descBottomLocPhyAddr = (unsigned int)physAddress; + channelEntry->descBottomLocPhyAddr = physAddress; } /* Not first, not last descriptor * may make link for previous descriptor with current descriptor @@ -1177,7 +1182,7 @@ static wpt_status dxeDescAllocAndLink else if((0 < idx) && (idx < (channelEntry->numDesc - 1))) { prevDesc->dxedesc.dxe_short_desc.phyNextL = - WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)physAddress); + WLANDXE_U32_SWAP_ENDIAN(physAddress); } /* Last descriptor * make a ring by asign next pointer as first descriptor @@ -1185,9 +1190,9 @@ static wpt_status dxeDescAllocAndLink else if((channelEntry->numDesc - 1) == idx) { prevDesc->dxedesc.dxe_short_desc.phyNextL = - WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)physAddress); + WLANDXE_U32_SWAP_ENDIAN(physAddress); currentDesc->dxedesc.dxe_short_desc.phyNextL = - WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)channelEntry->headCtrlBlk->linkedDescPhyAddr); + WLANDXE_U32_SWAP_ENDIAN(channelEntry->headCtrlBlk->linkedDescPhyAddr); } /* If Current Channel is RX channel PAL Packet and OS packet buffer should be @@ -1240,7 +1245,7 @@ static wpt_status dxeDescAllocAndLink #ifndef WLANDXE_TEST_CHANNEL_ENABLE // advance to the next pre-allocated descriptor in the chunk currentDesc++; - physAddress = ((wpt_int8 *)physAddress) + sizeof(WLANDXE_DescType); + physAddress = (physAddress + sizeof(WLANDXE_DescType)); #endif #endif } @@ -2193,7 +2198,7 @@ static wpt_status dxeRXFrameSingleBufferAlloc /* DXE descriptor must have SWAPPED addres in it's structure * !!! SWAPPED !!! */ currentDesc->dxedesc.dxe_short_desc.dstMemAddrL = - WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)currentPalPacketBuffer->pBDPhys); + WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)(uintptr_t)currentPalPacketBuffer->pBDPhys); return status; } @@ -3278,7 +3283,7 @@ static wpt_status dxeTXPushFrame /* Program DXE descriptor */ currentDesc->dxedesc.dxe_short_desc.srcMemAddrL = - WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)sourcePhysicalAddress); + WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)(uintptr_t)sourcePhysicalAddress); /* Just normal data transfer from aCPU Flat Memory to BMU Q */ if((WDTS_CHANNEL_TX_LOW_PRI == channelEntry->channelType) || diff --git a/CORE/DXE/src/wlan_qct_dxe_i.h b/CORE/DXE/src/wlan_qct_dxe_i.h index 223764482baa..1905e3855fac 100644 --- a/CORE/DXE/src/wlan_qct_dxe_i.h +++ b/CORE/DXE/src/wlan_qct_dxe_i.h @@ -518,7 +518,7 @@ typedef struct void *nextCtrlBlk; wpt_packet *xfrFrame; WLANDXE_DescType *linkedDesc; - unsigned int linkedDescPhyAddr; + wpt_uint32 linkedDescPhyAddr; wpt_uint32 ctrlBlkOrder; #ifdef FEATURE_R33D wpt_uint32 shadowBufferVa; @@ -605,7 +605,7 @@ typedef struct WLANDXE_DescType *descriptorAllocation; #endif WLANDXE_DescType *DescBottomLoc; - unsigned int descBottomLocPhyAddr; + wpt_uint32 descBottomLocPhyAddr; wpt_uint32 numDesc; wpt_uint32 numFreeDesc; wpt_uint32 numRsvdDesc; |
