2015-06-10 08:06:50

by Johnny Kim

[permalink] [raw]
Subject: [PATCH 0/4] staging: wilc1000: fix compile warnings and clean other

Hello Greg.

I have rebased on the lastest staging-testing and fixed compile warnings
This patches is prepared to fix the compatibilty issue for 64bit machine
and wrong casting.

I am aware that the others should be patched additonally.
However I need internally to discuss on the other patch. Then, the others
will be sent soon.

Johnny.

Johnny Kim (4):
staging: wilc1000: modify data type
staging: wilc1000: add syntax for 64-bit machine
staging: wilc1000: modify printk format
staging: wilc1000: remove uninitialized warnings

drivers/staging/wilc1000/coreconfigurator.c | 4 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 158 ++++++++++++----------
drivers/staging/wilc1000/host_interface.h | 6 +-
drivers/staging/wilc1000/linux_wlan.c | 14 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 18 +--
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +-
drivers/staging/wilc1000/wilc_wlan.c | 27 ++--
drivers/staging/wilc1000/wilc_wlan.h | 6 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 4 +-
10 files changed, 136 insertions(+), 105 deletions(-)

--
1.9.1



2015-06-10 08:07:16

by Johnny Kim

[permalink] [raw]
Subject: [PATCH 3/4] staging: wilc1000: modify printk format

This remove compile warnings about printk format.

Signed-off-by: Johnny Kim <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
drivers/staging/wilc1000/linux_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4b005fa..e4ad07a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -703,7 +703,7 @@ static WILC_Sint32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperat
strWID.s32ValueSize = sizeof(WILC_Uint32);

/*Sending Cfg*/
- PRINT_INFO(HOSTINF_DBG, "(WILC_Uint32)pstrWFIDrv= %x \n", (WILC_Uint32)pstrWFIDrv);
+ PRINT_INFO(HOSTINF_DBG, "(size_t)pstrWFIDrv= %p \n", pstrWFIDrv);

s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);

@@ -6631,7 +6631,7 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
g_obtainingIP = WILC_FALSE;
#endif

- PRINT_D(HOSTINF_DBG, "Global handle pointer value=%x\n", (WILC_Uint32)pstrWFIDrv);
+ PRINT_D(HOSTINF_DBG, "Global handle pointer value=%p\n", pstrWFIDrv);
/* /////////////////////////////////////// */
if (clients_count == 0) {
sema_init(&hSemHostIFthrdEnd, 0);
@@ -6933,7 +6933,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)


if (pstrWFIDrv == NULL || pstrWFIDrv == terminated_handle) {
- PRINT_ER("NetworkInfo received but driver not init[%x]\n", (WILC_Uint32)pstrWFIDrv);
+ PRINT_ER("NetworkInfo received but driver not init[%p]\n", pstrWFIDrv);
return;
}

@@ -7053,7 +7053,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;


- PRINT_D(GENERIC_DBG, "Scan notification received %x\n", (WILC_Uint32)pstrWFIDrv);
+ PRINT_D(GENERIC_DBG, "Scan notification received %p\n", pstrWFIDrv);

if (pstrWFIDrv == NULL || pstrWFIDrv == terminated_handle) {
return;
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 49d7d8c..cb0765f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1113,7 +1113,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n
#endif
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
- PRINT_D(INIT_DBG, "Host = %x\n", (WILC_Uint32)pstrWFIDrv);
+ PRINT_D(INIT_DBG, "Host = %p\n", pstrWFIDrv);

PRINT_D(INIT_DBG, "MAC address is : %02x-%02x-%02x-%02x-%02x-%02x\n", mac_add[0], mac_add[1], mac_add[2], mac_add[3], mac_add[4], mac_add[5]);
wilc_get_chipid(0);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index e6cc1e9..f3068c0 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -844,7 +844,7 @@ static int WILC_WFI_CfgConnect(struct wiphy *wiphy, struct net_device *dev,

host_int_set_wfi_drv_handler((size_t)priv->hWILCWFIDrv);

- PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%x]\n", sme->ssid, dev, (WILC_Uint32)priv->hWILCWFIDrv);
+ PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%p]\n", sme->ssid, dev, priv->hWILCWFIDrv);
#ifdef WILC_P2P
if (!(WILC_strncmp(sme->ssid, "DIRECT-", 7))) {
PRINT_D(CFG80211_DBG, "Connected to Direct network,OBSS disabled\n");
@@ -1147,7 +1147,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
PRINT_D(CFG80211_DBG, "Adding key with cipher suite = %x\n", params->cipher);

/*BugID_5137*/
- PRINT_D(CFG80211_DBG, "%x %x %d\n", (WILC_Uint32)wiphy, (WILC_Uint32)netdev, key_index);
+ PRINT_D(CFG80211_DBG, "%p %p %d\n", wiphy, netdev, key_index);

PRINT_D(CFG80211_DBG, "key %x %x %x\n", params->key[0],
params->key[1],
@@ -3062,7 +3062,7 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;
nic->iftype = AP_MODE;
- PRINT_D(CORECONFIG_DBG, "(WILC_Uint32)priv->hWILCWFIDrv[%x]\n", (WILC_Uint32)priv->hWILCWFIDrv);
+ PRINT_D(CORECONFIG_DBG, "priv->hWILCWFIDrv[%p]\n", priv->hWILCWFIDrv);

#ifndef SIMULATION
PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n");
@@ -3108,7 +3108,7 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type;

- PRINT_D(CORECONFIG_DBG, "(WILC_Uint32)priv->hWILCWFIDrv[%x]\n", (WILC_Uint32)priv->hWILCWFIDrv);
+ PRINT_D(CORECONFIG_DBG, "priv->hWILCWFIDrv[%p]\n", priv->hWILCWFIDrv);

#ifndef SIMULATION
#ifdef WILC_P2P
--
1.9.1


2015-06-10 08:06:59

by Johnny Kim

[permalink] [raw]
Subject: [PATCH 1/4] staging: wilc1000: modify data type

This replace the argument of the function to the independent data type
in system.

Signed-off-by: Johnny Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 4 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 132 +++++++++++-----------
drivers/staging/wilc1000/host_interface.h | 6 +-
drivers/staging/wilc1000/linux_wlan.c | 10 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +-
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +-
drivers/staging/wilc1000/wilc_wlan.c | 8 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 4 +-
9 files changed, 86 insertions(+), 86 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index e3e3f20..fa1c99a 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -1949,7 +1949,7 @@ WILC_Sint32 ConfigWaitResponse(WILC_Char *pcRespBuffer, WILC_Sint32 s32MaxRespBu
*/
#ifdef SIMULATION
WILC_Sint32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
- WILC_Uint32 u32WIDsCount, WILC_Bool bRespRequired, WILC_Uint32 drvHandler)
+ WILC_Uint32 u32WIDsCount, WILC_Bool bRespRequired, size_t drvHandler)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
WILC_Sint32 err = WILC_SUCCESS;
@@ -2128,7 +2128,7 @@ extern wilc_wlan_oup_t *gpstrWlanOps;
* @version 1.0
*/
WILC_Sint32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
- WILC_Uint32 u32WIDsCount, WILC_Bool bRespRequired, WILC_Uint32 drvHandler)
+ WILC_Uint32 u32WIDsCount, WILC_Bool bRespRequired, size_t drvHandler)
{
WILC_Sint32 counter = 0, ret = 0;
if (gpstrWlanOps == NULL) {
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 73cdbef..03672d0 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -476,7 +476,7 @@ extern WILC_Sint32 CoreConfiguratorInit(void);
extern WILC_Sint32 CoreConfiguratorDeInit(void);

extern WILC_Sint32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
- WILC_Uint32 u32WIDsCount, WILC_Bool bRespRequired, WILC_Uint32 drvHandler);
+ WILC_Uint32 u32WIDsCount, WILC_Bool bRespRequired, size_t drvHandler);
extern WILC_Sint32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo);
extern WILC_Sint32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo);

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index afe5126..cfe3364 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -584,7 +584,7 @@ u8 gu8Flushed11iMode;
u8 gu8FlushedAuthType;
WILC_Uint32 gu32FlushedJoinReqSize;
WILC_Uint32 gu32FlushedInfoElemAsocSize;
-WILC_Uint32 gu8FlushedJoinReqDrvHandler;
+size_t gu8FlushedJoinReqDrvHandler;
#define REAL_JOIN_REQ 0
#define FLUSHED_JOIN_REQ 1
#define FLUSHED_BYTE_POS 79 /* Position the byte indicating flushing in the flushed request */
@@ -622,7 +622,7 @@ static WILC_Sint32 Handle_SetChannel(void *drvHandler, tstrHostIFSetChan *pstrHo

PRINT_D(HOSTINF_DBG, "Setting channel\n");
/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to set channel\n");
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
@@ -659,10 +659,10 @@ static WILC_Sint32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSe

/*Sending Cfg*/

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);


- if ((pstrHostIfSetDrvHandler->u32Address) == (WILC_Uint32)NULL) {
+ if ((pstrHostIfSetDrvHandler->u32Address) == (size_t)NULL) {
up(&hSemDeinitDrvHandle);
}

@@ -705,10 +705,10 @@ static WILC_Sint32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperat
/*Sending Cfg*/
PRINT_INFO(HOSTINF_DBG, "(WILC_Uint32)pstrWFIDrv= %x \n", (WILC_Uint32)pstrWFIDrv);

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);


- if ((pstrHostIfSetOperationMode->u32Mode) == (WILC_Uint32)NULL) {
+ if ((pstrHostIfSetOperationMode->u32Mode) == 0) {
up(&hSemDeinitDrvHandle);
}

@@ -755,7 +755,7 @@ WILC_Sint32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
strWID.ps8WidVal = (u8 *)pu8IPAddr;
strWID.s32ValueSize = IP_ALEN;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);



@@ -799,7 +799,7 @@ WILC_Sint32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
strWID.ps8WidVal = (u8 *)WILC_MALLOC(IP_ALEN);
strWID.s32ValueSize = IP_ALEN;

- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);

PRINT_INFO(HOSTINF_DBG, "%d.%d.%d.%d\n", (u8)(strWID.ps8WidVal[0]), (u8)(strWID.ps8WidVal[1]), (u8)(strWID.ps8WidVal[2]), (u8)(strWID.ps8WidVal[3]));

@@ -859,7 +859,7 @@ static WILC_Sint32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddres
strWID.s32ValueSize = ETH_ALEN;
PRINT_D(GENERIC_DBG, "mac addr = :%x:%x:%x:%x:%x:%x\n", strWID.ps8WidVal[0], strWID.ps8WidVal[1], strWID.ps8WidVal[2], strWID.ps8WidVal[3], strWID.ps8WidVal[4], strWID.ps8WidVal[5]);
/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to set mac address\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -897,7 +897,7 @@ static WILC_Sint32 Handle_GetMacAddress(void *drvHandler, tstrHostIfGetMacAddres
strWID.s32ValueSize = ETH_ALEN;

/*Sending Cfg*/
- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)drvHandler);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_FALSE, (size_t)drvHandler);
if (s32Error) {
PRINT_ER("Failed to get mac address\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -1205,7 +1205,7 @@ static WILC_Sint32 Handle_CfgParam(void *drvHandler, tstrHostIFCfgParamAttr *str
}
u8WidCnt++;
}
- s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, WILC_FALSE, (size_t)pstrWFIDrv);

if (s32Error) {
PRINT_ER("Error in setting CFG params\n");
@@ -1372,7 +1372,7 @@ static WILC_Sint32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFs
gbScanWhileConnected = WILC_FALSE;
}

- s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (size_t)pstrWFIDrv);

if (s32Error) {
PRINT_ER("Failed to send scan paramters config packet\n");
@@ -1450,7 +1450,7 @@ static WILC_Sint32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent)
strWID.s32ValueSize = sizeof(WILC_Char);

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to set abort running scan\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -1649,7 +1649,7 @@ static WILC_Sint32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrH
/* ////////////////////// */
#endif

- s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Handle_Connect()] failed to send config packet\n");
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
@@ -1978,7 +1978,7 @@ static WILC_Sint32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrH
/*BugID_5137*/
if (WILC_memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7)) {
memcpy(gu8FlushedJoinReq, pu8CurrByte, gu32FlushedJoinReqSize);
- gu8FlushedJoinReqDrvHandler = (WILC_Uint32)pstrWFIDrv;
+ gu8FlushedJoinReqDrvHandler = (size_t)pstrWFIDrv;
}

PRINT_D(GENERIC_DBG, "send HOST_IF_WAITING_CONN_RESP\n");
@@ -1990,7 +1990,7 @@ static WILC_Sint32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrH
PRINT_D(GENERIC_DBG, "save bssid = %x:%x:%x:%x:%x:%x\n", (u8ConnectedSSID[0]), (u8ConnectedSSID[1]), (u8ConnectedSSID[2]), (u8ConnectedSSID[3]), (u8ConnectedSSID[4]), (u8ConnectedSSID[5]));
}

- s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Handle_Connect()] failed to send config packet\n");
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
@@ -2206,7 +2206,7 @@ static WILC_Sint32 Handle_ConnectTimeout(void *drvHandler)

PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to send dissconect config packet\n");
}
@@ -2232,11 +2232,11 @@ static WILC_Sint32 Handle_ConnectTimeout(void *drvHandler)
WILC_memset(u8ConnectedSSID, 0, ETH_ALEN);
/*BugID_5213*/
/*Freeing flushed join request params on connect timeout*/
- if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (WILC_Uint32)drvHandler) {
+ if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (size_t)drvHandler) {
WILC_FREE(gu8FlushedJoinReq);
gu8FlushedJoinReq = NULL;
}
- if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (WILC_Uint32)drvHandler) {
+ if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (size_t)drvHandler) {
WILC_FREE(gu8FlushedInfoElemAsoc);
gu8FlushedInfoElemAsoc = NULL;
}
@@ -2657,11 +2657,11 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncI
/*BugID_5213*/
/*Freeing flushed join request params on receiving*/
/*MAC_DISCONNECTED while connected*/
- if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (WILC_Uint32)drvHandler) {
+ if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (size_t)drvHandler) {
WILC_FREE(gu8FlushedJoinReq);
gu8FlushedJoinReq = NULL;
}
- if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (WILC_Uint32)drvHandler) {
+ if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (size_t)drvHandler) {
WILC_FREE(gu8FlushedInfoElemAsoc);
gu8FlushedInfoElemAsoc = NULL;
}
@@ -2767,7 +2767,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
strWIDList[3].ps8WidVal = (WILC_Sint8 *)pu8keybuf;


- s32Error = SendConfigPkt(SET_CFG, strWIDList, 4, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, 4, WILC_TRUE, (size_t)pstrWFIDrv);
WILC_FREE(pu8keybuf);


@@ -2795,7 +2795,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
strWID.ps8WidVal = (WILC_Sint8 *)pu8keybuf;
strWID.s32ValueSize = pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen + 2;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
WILC_FREE(pu8keybuf);
} else if (pstrHostIFkeyAttr->u8KeyAction & REMOVEKEY) {

@@ -2807,7 +2807,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
strWID.ps8WidVal = s8idxarray;
strWID.s32ValueSize = 1;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
} else {
strWID.u16WIDid = (WILC_Uint16)WID_KEY_ID;
strWID.enuWIDtype = WID_CHAR;
@@ -2816,7 +2816,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)

PRINT_D(HOSTINF_DBG, "Setting default key index\n");

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
}
up(&(pstrWFIDrv->hSemTestKeyBlock));
break;
@@ -2862,7 +2862,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
strWIDList[1].ps8WidVal = (WILC_Sint8 *)pu8keybuf;
strWIDList[1].s32ValueSize = RX_MIC_KEY_MSG_LEN;

- s32Error = SendConfigPkt(SET_CFG, strWIDList, 2, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, 2, WILC_TRUE, (size_t)pstrWFIDrv);

WILC_FREE(pu8keybuf);

@@ -2909,7 +2909,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
strWID.ps8WidVal = (WILC_Sint8 *)pu8keybuf;
strWID.s32ValueSize = RX_MIC_KEY_MSG_LEN;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);

WILC_FREE(pu8keybuf);

@@ -2966,7 +2966,7 @@ _WPARxGtk_end_case_:
strWIDList[1].ps8WidVal = (WILC_Sint8 *)pu8keybuf;
strWIDList[1].s32ValueSize = PTK_KEY_MSG_LEN + 1;

- s32Error = SendConfigPkt(SET_CFG, strWIDList, 2, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, strWIDList, 2, WILC_TRUE, (size_t)pstrWFIDrv);
WILC_FREE(pu8keybuf);

/* ////////////////////////// */
@@ -3007,7 +3007,7 @@ _WPARxGtk_end_case_:
strWID.ps8WidVal = (WILC_Sint8 *)pu8keybuf;
strWID.s32ValueSize = PTK_KEY_MSG_LEN;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
WILC_FREE(pu8keybuf);

/* ////////////////////////// */
@@ -3046,7 +3046,7 @@ _WPAPtk_end_case_:
strWID.ps8WidVal = (WILC_Sint8 *)pu8keybuf;
strWID.s32ValueSize = (pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid * PMKSA_KEY_LEN) + 1;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);

WILC_FREE(pu8keybuf);
break;
@@ -3095,7 +3095,7 @@ static void Handle_Disconnect(void *drvHandler)

WILC_memset(u8ConnectedSSID, 0, ETH_ALEN);

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);

if (s32Error) {
PRINT_ER("Failed to send dissconect config packet\n");
@@ -3159,11 +3159,11 @@ static void Handle_Disconnect(void *drvHandler)


/*BugID_5137*/
- if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (WILC_Uint32)drvHandler) {
+ if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (size_t)drvHandler) {
WILC_FREE(gu8FlushedJoinReq);
gu8FlushedJoinReq = NULL;
}
- if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (WILC_Uint32)drvHandler) {
+ if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (size_t)drvHandler) {
WILC_FREE(gu8FlushedInfoElemAsoc);
gu8FlushedInfoElemAsoc = NULL;
}
@@ -3208,7 +3208,7 @@ static WILC_Sint32 Switch_Log_Terminal(void *drvHandler)
strWID.ps8WidVal = &dummy;
strWID.s32ValueSize = sizeof(WILC_Char);

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);


if (s32Error) {
@@ -3252,7 +3252,7 @@ static WILC_Sint32 Handle_GetChnl(void *drvHandler)

PRINT_D(HOSTINF_DBG, "Getting channel value\n");

- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Failed to get channel number\n");
@@ -3296,7 +3296,7 @@ static void Handle_GetRssi(void *drvHandler)
/*Sending Cfg*/
PRINT_D(HOSTINF_DBG, "Getting RSSI value\n");

- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to get RSSI value\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -3327,7 +3327,7 @@ static void Handle_GetLinkspeed(void *drvHandler)
/*Sending Cfg*/
PRINT_D(HOSTINF_DBG, "Getting LINKSPEED value\n");

- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to get LINKSPEED value\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -3377,7 +3377,7 @@ WILC_Sint32 Handle_GetStatistics(void *drvHandler, tstrStatistics *pstrStatistic
strWIDList[u32WidsCount].ps8WidVal = (WILC_Sint8 *)(&(pstrStatistics->u32TxFailureCount));
u32WidsCount++;

- s32Error = SendConfigPkt(GET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (WILC_Uint32)drvHandler);
+ s32Error = SendConfigPkt(GET_CFG, strWIDList, u32WidsCount, WILC_FALSE, (size_t)drvHandler);

if (s32Error) {
PRINT_ER("Failed to send scan paramters config packet\n");
@@ -3425,7 +3425,7 @@ static WILC_Sint32 Handle_Get_InActiveTime(void *drvHandler, tstrHostIfStaInacti
PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");


- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Failed to SET incative time\n");
@@ -3439,7 +3439,7 @@ static WILC_Sint32 Handle_Get_InActiveTime(void *drvHandler, tstrHostIfStaInacti
strWID.s32ValueSize = sizeof(WILC_Uint32);


- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Failed to get incative time\n");
@@ -3520,7 +3520,7 @@ static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaco


/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to send add beacon config packet\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -3565,7 +3565,7 @@ static void Handle_DelBeacon(void *drvHandler, tstrHostIFDelBeacon *pstrDelBeaco
/* TODO: build del beacon message*/

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {

PRINT_ER("Failed to send delete beacon config packet\n");
@@ -3662,7 +3662,7 @@ static void Handle_AddStation(void *drvHandler, tstrWILC_AddStaParam *pstrStatio
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error != WILC_SUCCESS) {

PRINT_ER("Failed to send add station config packet\n");
@@ -3718,7 +3718,7 @@ static void Handle_DelAllSta(void *drvHandler, tstrHostIFDelAllSta *pstrDelAllSt
}

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {

PRINT_ER("Failed to send add station config packe\n");
@@ -3766,7 +3766,7 @@ static void Handle_DelStation(void *drvHandler, tstrHostIFDelSta *pstrDelStaPara
WILC_memcpy(pu8CurrByte, pstrDelStaParam->au8MacAddr, ETH_ALEN);

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {

PRINT_ER("Failed to send add station config packe\n");
@@ -3810,7 +3810,7 @@ static void Handle_EditStation(void *drvHandler, tstrWILC_AddStaParam *pstrStati
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)pstrWFIDrv);
if (s32Error) {

PRINT_ER("Failed to send edit station config packet\n");
@@ -3887,7 +3887,7 @@ static int Handle_RemainOnChan(void *drvHandler, tstrHostIfRemainOnChan *pstrHos
strWID.ps8WidVal[1] = (WILC_Sint8)pstrHostIfRemainOnChan->u16Channel;

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to set remain on channel\n");
}
@@ -3945,7 +3945,7 @@ static int Handle_RegisterFrame(void *drvHandler, tstrHostIfRegisterFrame *pstrH


/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to frame register config packet\n");
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
@@ -3997,7 +3997,7 @@ static WILC_Uint32 Handle_ListenStateExpired(void *drvHandler, tstrHostIfRemainO
strWID.ps8WidVal[1] = FALSE_FRMWR_CHANNEL;

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to set remain on channel\n");
goto _done_;
@@ -4083,7 +4083,7 @@ static void Handle_PowerManagement(void *drvHandler, tstrHostIfPowerMgmtParam *s
PRINT_D(HOSTINF_DBG, "Handling Power Management\n");

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to send power management config packet\n");
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
@@ -4135,7 +4135,7 @@ static void Handle_SetMulticastFilter(void *drvHandler, tstrHostIFSetMulti *strH
memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->u32count) * ETH_ALEN));

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (WILC_Uint32)drvHandler);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_FALSE, (size_t)drvHandler);
if (s32Error) {
PRINT_ER("Failed to send setup multicast config packet\n");
WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -4203,7 +4203,7 @@ static WILC_Sint32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo
/* Group Buffer Timeout */
*ptr++ = 0;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error)
PRINT_D(HOSTINF_DBG, "Couldn't open BA Session\n");

@@ -4227,7 +4227,7 @@ static WILC_Sint32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo
*ptr++ = ((strHostIfBASessionInfo->u16SessionTimeout >> 16) & 0xFF);
/*Ack-Policy */
*ptr++ = 3;
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);

if (strWID.ps8WidVal != NULL)
WILC_FREE(strWID.ps8WidVal);
@@ -4277,7 +4277,7 @@ static WILC_Sint32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo
/* Delba Reason */
*ptr++ = 32; /* Unspecific QOS reason */

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error)
PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n");

@@ -4295,7 +4295,7 @@ static WILC_Sint32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo
/* TID*/
*ptr++ = strHostIfBASessionInfo->u8Ted;

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);

if (strWID.ps8WidVal != NULL)
WILC_FREE(strWID.ps8WidVal);
@@ -4346,7 +4346,7 @@ static WILC_Sint32 Handle_DelAllRxBASessions(void *drvHandler, tstrHostIfBASessi
/* Delba Reason */
*ptr++ = 32; /* Unspecific QOS reason */

- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error)
PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n");

@@ -5443,7 +5443,7 @@ WILC_Sint32 host_int_get_site_survey_results(WILC_WFIDrvHandle hWFIDrv,
astrWIDList[1].ps8WidVal = ppu8RcvdSiteSurveyResults[1];
astrWIDList[1].s32ValueSize = u32MaxSiteSrvyFragLen;

- s32Error = SendConfigPkt(GET_CFG, astrWIDList, 2, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, astrWIDList, 2, WILC_TRUE, (size_t)pstrWFIDrv);

/*get the value by searching the local copy*/
if (s32Error) {
@@ -5811,7 +5811,7 @@ WILC_Sint32 host_int_get_assoc_res_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocR


/* Sending Configuration packet */
- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Failed to send association response config packet\n");
*pu32RcvdAssocRespInfoLen = 0;
@@ -5928,7 +5928,7 @@ WILC_Sint32 host_int_wait_msg_queue_idle(void)

}

-WILC_Sint32 host_int_set_wfi_drv_handler(WILC_Uint32 u32address)
+WILC_Sint32 host_int_set_wfi_drv_handler(size_t u32address)
{
WILC_Sint32 s32Error = WILC_SUCCESS;

@@ -6062,7 +6062,7 @@ WILC_Sint32 host_int_test_set_int_wid(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32
strWID.s32ValueSize = sizeof(WILC_Uint32);

/*Sending Cfg*/
- s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
if (s32Error) {
PRINT_ER("Test Function: Failed to set wid value\n");
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
@@ -6154,7 +6154,7 @@ WILC_Sint32 host_int_test_get_int_wid(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 *pu
strWID.ps8WidVal = (WILC_Sint8 *)pu32TestMemAddr;
strWID.s32ValueSize = sizeof(WILC_Uint32);

- s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
+ s32Error = SendConfigPkt(GET_CFG, &strWID, 1, WILC_TRUE, (size_t)pstrWFIDrv);
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Test Function: Failed to get wid value\n");
@@ -6837,7 +6837,7 @@ WILC_Sint32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
WILC_TimerDestroy(&(pstrWFIDrv->hRemainOnChannel), NULL);
#endif

- host_int_set_wfi_drv_handler((WILC_Uint32)NULL);
+ host_int_set_wfi_drv_handler((size_t)NULL);
down(&hSemDeinitDrvHandle);


@@ -6918,7 +6918,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrHostIFmsg strHostIFmsg;
- WILC_Uint32 drvHandler;
+ size_t drvHandler;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;

drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
@@ -6968,7 +6968,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrHostIFmsg strHostIFmsg;
- WILC_Uint32 drvHandler;
+ size_t drvHandler;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;

/*BugID_5348*/
@@ -7031,7 +7031,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrHostIFmsg strHostIFmsg;
- WILC_Uint32 drvHandler;
+ size_t drvHandler;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;
drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -7241,7 +7241,7 @@ WILC_Sint32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32Interv
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
- tstrHostIFmsg strHostIFmsg;
+ tstrHostIFmsg strHostIFmsg = {0,};
tstrHostIFSetBeacon *pstrSetBeaconParam = &strHostIFmsg.uniHostIFmsgBody.strHostIFSetBeacon;

if (pstrWFIDrv == NULL) {
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index d03a575..fca93d5 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -277,7 +277,7 @@ typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback f

/* typedef WILC_Uint32 WILC_WFIDrvHandle; */
typedef struct {
- WILC_Sint32 s32Dummy;
+ size_t s32Dummy;
} *WILC_WFIDrvHandle;

/*!
@@ -336,7 +336,7 @@ typedef struct {
} tstrWILC_UsrConnReq;

typedef struct {
- WILC_Uint32 u32Address;
+ size_t u32Address;
} tstrHostIfSetDrvHandler;

typedef struct {
@@ -1323,7 +1323,7 @@ WILC_Sint32 host_int_frame_register(WILC_WFIDrvHandle hWFIDrv, WILC_Uint16 u16Fr
* @date
* @version 1.0
*/
-WILC_Sint32 host_int_set_wfi_drv_handler(WILC_Uint32 u32address);
+WILC_Sint32 host_int_set_wfi_drv_handler(size_t u32address);
WILC_Sint32 host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32mode);

static WILC_Sint32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 860f336..49d7d8c 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1124,9 +1124,9 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n
goto _fail_;
}

- *(int *)c_val = (WILC_Uint32)pstrWFIDrv;
+ *(size_t*)c_val = (size_t)pstrWFIDrv;

- if (!g_linux_wlan->oup.wlan_cfg_set(1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0))
+ if (!g_linux_wlan->oup.wlan_cfg_set(1, WID_SET_DRV_HANDLER, c_val, sizeof(size_t), 0, 0))
goto _fail_;

/*to tell fw that we are going to use PC test - WILC specific*/
@@ -1364,7 +1364,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n
goto _fail_;

c_val[0] = 1; /* Enable N with immediate block ack. */
- if (!g_linux_wlan->oup.wlan_cfg_set(0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, (WILC_Uint32)pstrWFIDrv))
+ if (!g_linux_wlan->oup.wlan_cfg_set(0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, (size_t)pstrWFIDrv))
goto _fail_;

return 0;
@@ -2100,7 +2100,7 @@ int mac_open(struct net_device *ndev)
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
if (ndev == g_linux_wlan->strInterfaceInfo[i].wilc_netdev) {
memcpy(g_linux_wlan->strInterfaceInfo[i].aSrcAddress, mac_add, ETH_ALEN);
- g_linux_wlan->strInterfaceInfo[i].drvHandler = (WILC_Uint32)priv->hWILCWFIDrv;
+ g_linux_wlan->strInterfaceInfo[i].drvHandler = (size_t)priv->hWILCWFIDrv;
break;
}
}
@@ -2548,7 +2548,7 @@ void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset)
return;
}

- skb_reserve(skb, (unsigned int)skb->data & 0x3);
+ skb_reserve(skb, (uintptr_t)skb->data & 0x3);

if (g_linux_wlan == NULL || wilc_netdev == NULL) {
PRINT_ER("wilc_netdev in g_linux_wlan is NULL");
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 0db7f3d..e6cc1e9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -747,7 +747,7 @@ static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct cfg80211_scan_request *r

priv->u32RcvdChCount = 0;

- host_int_set_wfi_drv_handler((WILC_Uint32)priv->hWILCWFIDrv);
+ host_int_set_wfi_drv_handler((size_t)priv->hWILCWFIDrv);


reset_shadow_found(priv);
@@ -842,7 +842,7 @@ static int WILC_WFI_CfgConnect(struct wiphy *wiphy, struct net_device *dev,
priv = wiphy_priv(wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)(priv->hWILCWFIDrv);

- host_int_set_wfi_drv_handler((WILC_Uint32)priv->hWILCWFIDrv);
+ host_int_set_wfi_drv_handler((size_t)priv->hWILCWFIDrv);

PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%x]\n", sme->ssid, dev, (WILC_Uint32)priv->hWILCWFIDrv);
#ifdef WILC_P2P
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index b322f0f..39ec0ac 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -185,7 +185,7 @@ typedef struct {
typedef struct {
uint8_t aSrcAddress[ETH_ALEN];
uint8_t aBSSID[ETH_ALEN];
- uint32_t drvHandler;
+ size_t drvHandler;
struct net_device *wilc_netdev;
} tstrInterfaceInfo;
typedef struct {
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 9edc851..739be55 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1863,13 +1863,13 @@ static void wilc_wlan_cleanup(void)

}

-static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler)
+static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
wilc_cfg_frame_t *cfg = &p->cfg_frame;
int total_len = p->cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE;
int seq_no = p->cfg_seq_no % 256;
- int driver_handler = (WILC_Uint32)drvHandler;
+ size_t driver_handler = (size_t)drvHandler;


/**
@@ -1900,7 +1900,7 @@ static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler)
return 0;
}

-static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t buffer_size, int commit, uint32_t drvHandler)
+static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t buffer_size, int commit, size_t drvHandler)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
uint32_t offset;
@@ -1939,7 +1939,7 @@ static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t

return ret_size;
}
-static int wilc_wlan_cfg_get(int start, uint32_t wid, int commit, uint32_t drvHandler)
+static int wilc_wlan_cfg_get(int start, WILC_Uint16 wid, int commit, size_t drvHandler)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
uint32_t offset;
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index dd86ca7..399d931 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -215,8 +215,8 @@ typedef struct {
void (*wlan_handle_rx_que)(void);
void (*wlan_handle_rx_isr)(void);
void (*wlan_cleanup)(void);
- int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, uint32_t);
- int (*wlan_cfg_get)(int, uint32_t, int, uint32_t);
+ int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, size_t);
+ int (*wlan_cfg_get)(int, WILC_Uint16, int, size_t);
int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t);
/*Bug3959: transmitting mgmt frames received from host*/
#if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P)
--
1.9.1


2015-06-10 08:07:23

by Johnny Kim

[permalink] [raw]
Subject: [PATCH 4/4] staging: wilc1000: remove uninitialized warnings

This patch is for the initialization of the local variables.

Signed-off-by: Johnny Kim <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index cb0765f..10de9d7 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2778,7 +2778,7 @@ late_initcall(init_wilc_driver);
static void __exit exit_wilc_driver(void)
{
int i = 0;
- perInterface_wlan_t *nic[NUM_CONCURRENT_IFC];
+ perInterface_wlan_t *nic[NUM_CONCURRENT_IFC] = {NULL,};
#define CLOSE_TIMEOUT (12 * 1000)

if ((g_linux_wlan != NULL) && (((g_linux_wlan->strInterfaceInfo[0].wilc_netdev) != NULL)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index f3068c0..aa79a5d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -829,9 +829,9 @@ static int WILC_WFI_CfgConnect(struct wiphy *wiphy, struct net_device *dev,
WILC_Uint32 i;
u8 u8security = NO_ENCRYPT;
AUTHTYPE_T tenuAuth_type = ANY;
- WILC_Char *pcgroup_encrypt_val;
- WILC_Char *pccipher_group;
- WILC_Char *pcwpa_version;
+ WILC_Char *pcgroup_encrypt_val = NULL;
+ WILC_Char *pccipher_group = NULL;
+ WILC_Char *pcwpa_version = NULL;

struct WILC_WFI_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
--
1.9.1


2015-06-10 19:37:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 2/4] staging: wilc1000: add syntax for 64-bit machine

On Wed, Jun 10, 2015 at 05:06:45PM +0900, Johnny Kim wrote:
> The driver take pointer value to integer value for message packet.
> So, The driver was fixed to save and load the address
> on 64-bit machine.
>
> Signed-off-by: Johnny Kim <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 24 ++++++++++++++++++++----
> drivers/staging/wilc1000/wilc_wlan.c | 19 +++++++++++++++----
> drivers/staging/wilc1000/wilc_wlan.h | 6 +++++-
> 3 files changed, 40 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index cfe3364..4b005fa 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -6918,9 +6918,14 @@ void NetworkInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
> {
> WILC_Sint32 s32Error = WILC_SUCCESS;
> tstrHostIFmsg strHostIFmsg;
> - size_t drvHandler;
> + size_t drvHandler = 0;
> tstrWILC_WFIDrv *pstrWFIDrv = NULL;
>
> +#ifdef CONFIG_64BIT
> + drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
> + drvHandler <<= 32;
> +#endif

Ick, no, you should never have #ifdef lines in your .c files, that shows
you are doing something really wrong. You will note that other drivers
do not do this. Please fix this up properly.

thanks,

greg k-h

2015-06-11 00:42:08

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 3/4] staging: wilc1000: modify printk format

On Wed, Jun 10, 2015 at 05:06:46PM +0900, Johnny Kim wrote:
> This remove compile warnings about printk format.
>
> Signed-off-by: Johnny Kim <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 8 ++++----
> drivers/staging/wilc1000/linux_wlan.c | 2 +-
> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 4b005fa..e4ad07a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -703,7 +703,7 @@ static WILC_Sint32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperat
> strWID.s32ValueSize = sizeof(WILC_Uint32);
>
> /*Sending Cfg*/
> - PRINT_INFO(HOSTINF_DBG, "(WILC_Uint32)pstrWFIDrv= %x \n", (WILC_Uint32)pstrWFIDrv);
> + PRINT_INFO(HOSTINF_DBG, "(size_t)pstrWFIDrv= %p \n", pstrWFIDrv);

why is size_t in the printk message, can't that just be dropped?

I'll take this, but it looks odd...


2015-06-11 00:41:02

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/4] staging: wilc1000: modify data type

On Wed, Jun 10, 2015 at 05:06:44PM +0900, Johnny Kim wrote:
> -static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler)
> +static int wilc_wlan_cfg_commit(int type, size_t drvHandler)

Shouldn't this just be a void *? And if so, why not the real function
pointer instead?

Also, lots of these seem to be just pointers, please use a pointer
instead of hiding it in a size_t as that's the most portable, and
correct, way to do it. No need to hide any function pointers here, this
isn't Windows :)

thanks,

greg k-h

2015-06-10 10:12:58

by Julian Calaby

[permalink] [raw]
Subject: Re: [PATCH 2/4] staging: wilc1000: add syntax for 64-bit machine

Hi Johnny,

On Wed, Jun 10, 2015 at 6:06 PM, Johnny Kim <[email protected]> wrote:
> The driver take pointer value to integer value for message packet.
> So, The driver was fixed to save and load the address
> on 64-bit machine.
>
> Signed-off-by: Johnny Kim <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 24 ++++++++++++++++++++----
> drivers/staging/wilc1000/wilc_wlan.c | 19 +++++++++++++++----
> drivers/staging/wilc1000/wilc_wlan.h | 6 +++++-
> 3 files changed, 40 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index cfe3364..4b005fa 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -6918,9 +6918,14 @@ void NetworkInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
> {
> WILC_Sint32 s32Error = WILC_SUCCESS;
> tstrHostIFmsg strHostIFmsg;
> - size_t drvHandler;
> + size_t drvHandler = 0;
> tstrWILC_WFIDrv *pstrWFIDrv = NULL;
>
> +#ifdef CONFIG_64BIT
> + drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
> + drvHandler <<= 32;
> +#endif
> +

This does nothing as it's overwritten in the next line.

> drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
> pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>
> @@ -6968,13 +6973,18 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
> {
> WILC_Sint32 s32Error = WILC_SUCCESS;
> tstrHostIFmsg strHostIFmsg;
> - size_t drvHandler;
> + size_t drvHandler = 0;
> tstrWILC_WFIDrv *pstrWFIDrv = NULL;
>
> /*BugID_5348*/
> down(&hSemHostIntDeinit);
>
> - drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
> +#ifdef CONFIG_64BIT
> + drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
> + drvHandler <<= 32;
> +#endif
> +
> + drvHandler |= ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
> pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
> PRINT_D(HOSTINF_DBG, "General asynchronous info packet received \n");
>
> @@ -7031,8 +7041,14 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
> {
> WILC_Sint32 s32Error = WILC_SUCCESS;
> tstrHostIFmsg strHostIFmsg;
> - size_t drvHandler;
> + size_t drvHandler = 0;
> tstrWILC_WFIDrv *pstrWFIDrv = NULL;
> +
> +#ifdef CONFIG_64BIT
> + drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
> + drvHandler <<= 32;
> +#endif
> +

Same here.

> drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
> pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>
> diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
> index 739be55..d20ffe0 100644
> --- a/drivers/staging/wilc1000/wilc_wlan.c
> +++ b/drivers/staging/wilc1000/wilc_wlan.c
> @@ -1867,7 +1867,7 @@ static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
> {
> wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
> wilc_cfg_frame_t *cfg = &p->cfg_frame;
> - int total_len = p->cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE;
> + int total_len = p->cfg_frame_offset + sizeof(size_t) + DRIVER_HANDLER_SIZE;
> int seq_no = p->cfg_seq_no % 256;
> size_t driver_handler = (size_t)drvHandler;
>
> @@ -1883,10 +1883,21 @@ static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
> cfg->wid_header[1] = seq_no; /* sequence number */
> cfg->wid_header[2] = (uint8_t)total_len;
> cfg->wid_header[3] = (uint8_t)(total_len >> 8);
> +#ifdef CONFIG_64BIT
> cfg->wid_header[4] = (uint8_t)driver_handler;
> - cfg->wid_header[5] = (uint8_t)(driver_handler >> 8);
> - cfg->wid_header[6] = (uint8_t)(driver_handler >> 16);
> - cfg->wid_header[7] = (uint8_t)(driver_handler >> 24);
> + cfg->wid_header[5] = (uint8_t)(driver_handler >> 8L);
> + cfg->wid_header[6] = (uint8_t)(driver_handler >> 16L);
> + cfg->wid_header[7] = (uint8_t)(driver_handler >> 24L);
> + cfg->wid_header[8] = (uint8_t)(driver_handler >> 32L);
> + cfg->wid_header[9] = (uint8_t)(driver_handler >> 40L);
> + cfg->wid_header[10] = (uint8_t)(driver_handler >> 48L);
> + cfg->wid_header[11] = (uint8_t)(driver_handler >> 56L);
> +#else
> + cfg->wid_header[4] = (uint8_t)driver_handler;
> + cfg->wid_header[5] = (uint8_t)(driver_handler >> 8L);
> + cfg->wid_header[6] = (uint8_t)(driver_handler >> 16L);
> + cfg->wid_header[7] = (uint8_t)(driver_handler >> 24L);
> +#endif
> p->cfg_seq_no = seq_no;
>
> /**
> diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
> index 0ba7ec6..e026baf 100644
> --- a/drivers/staging/wilc1000/wilc_wlan.h
> +++ b/drivers/staging/wilc1000/wilc_wlan.h
> @@ -15,7 +15,11 @@
> #define DRIVER_HANDLER_SIZE 4
> #define MAX_MAC_HDR_LEN 26 /* QOS_MAC_HDR_LEN */
> #define SUB_MSDU_HEADER_LENGTH 14
> +#ifdef CONFIG_64BIT
> +#define SNAP_HDR_LEN 12
> +#else
> #define SNAP_HDR_LEN 8
> +#endif
> #define ETHERNET_HDR_LEN 14
> #define WORD_ALIGNMENT_PAD 0
>
> @@ -297,7 +301,7 @@ typedef struct {
> uint8_t ether_header[14];
> uint8_t ip_header[20];
> uint8_t udp_header[8];
> - uint8_t wid_header[8];
> + uint8_t wid_header[4+sizeof(uintptr_t)];
> uint8_t frame[MAX_CFG_FRAME_SIZE];
> } wilc_cfg_frame_t;

How about you turn wid_header into a proper struct with a function
pointer instead of adding horrible hacks on top of already horrible
code?

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

2015-06-11 14:46:12

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/4] staging: wilc1000: modify data type

On Thu, Jun 11, 2015 at 02:33:39PM +0900, Johnny Kim wrote:
>
> On 2015년 06월 11일 09:40, Greg KH wrote:
> >On Wed, Jun 10, 2015 at 05:06:44PM +0900, Johnny Kim wrote:
> >>-static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler)
> >>+static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
> >Shouldn't this just be a void *? And if so, why not the real function
> >pointer instead?
> >
> >Also, lots of these seem to be just pointers, please use a pointer
> >instead of hiding it in a size_t as that's the most portable, and
> >correct, way to do it. No need to hide any function pointers here, this
> >isn't Windows :)
> >
> >thanks,
> >
> >greg k-h
>
> To replace the integer to the pointer as your counsel, I need a lot of
> discussion internally.

Why "internally"? Why not here in the development community?

> But I will fix the type and the related things like your thinking.

thank you.

> I know there is the build warning for 64-bit machine and this driver stays
> in BROKEN status on linux-next.
> I want to know if the reason is 64bit build warning.

Probably, fix them up and then we can see about getting that broken
status removed.

thanks,

greg k-h

2015-06-10 09:36:30

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/4] staging: wilc1000: modify data type

On Wed, Jun 10, 2015 at 05:06:44PM +0900, Johnny Kim wrote:
> This replace the argument of the function to the independent data type
> in system.
>
> Signed-off-by: Johnny Kim <[email protected]>

This changelog says what you are doing but not why.

What is the point of ->u32Address? Now that it's not 32 bits, the name
makes no sense. Why not just make it a pointer?

There was someone changing all the datatypes with sed. In some ways,
those patches were easier to review because they were mindless and not
really expected to make sense. After we just sed the code to make it
look more normal then we can think about 64 bit bugs (like this patch
and the next).

regards,
dan carpenter


2015-06-10 08:07:08

by Johnny Kim

[permalink] [raw]
Subject: [PATCH 2/4] staging: wilc1000: add syntax for 64-bit machine

The driver take pointer value to integer value for message packet.
So, The driver was fixed to save and load the address
on 64-bit machine.

Signed-off-by: Johnny Kim <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 24 ++++++++++++++++++++----
drivers/staging/wilc1000/wilc_wlan.c | 19 +++++++++++++++----
drivers/staging/wilc1000/wilc_wlan.h | 6 +++++-
3 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index cfe3364..4b005fa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6918,9 +6918,14 @@ void NetworkInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrHostIFmsg strHostIFmsg;
- size_t drvHandler;
+ size_t drvHandler = 0;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;

+#ifdef CONFIG_64BIT
+ drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
+ drvHandler <<= 32;
+#endif
+
drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;

@@ -6968,13 +6973,18 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrHostIFmsg strHostIFmsg;
- size_t drvHandler;
+ size_t drvHandler = 0;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;

/*BugID_5348*/
down(&hSemHostIntDeinit);

- drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
+#ifdef CONFIG_64BIT
+ drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
+ drvHandler <<= 32;
+#endif
+
+ drvHandler |= ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
PRINT_D(HOSTINF_DBG, "General asynchronous info packet received \n");

@@ -7031,8 +7041,14 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, WILC_Uint32 u32Length)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
tstrHostIFmsg strHostIFmsg;
- size_t drvHandler;
+ size_t drvHandler = 0;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;
+
+#ifdef CONFIG_64BIT
+ drvHandler = ((pu8Buffer[u32Length - 8]) | (pu8Buffer[u32Length - 7] << 8) | (pu8Buffer[u32Length - 6] << 16) | (pu8Buffer[u32Length - 5] << 24));
+ drvHandler <<= 32;
+#endif
+
drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 739be55..d20ffe0 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1867,7 +1867,7 @@ static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
wilc_cfg_frame_t *cfg = &p->cfg_frame;
- int total_len = p->cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE;
+ int total_len = p->cfg_frame_offset + sizeof(size_t) + DRIVER_HANDLER_SIZE;
int seq_no = p->cfg_seq_no % 256;
size_t driver_handler = (size_t)drvHandler;

@@ -1883,10 +1883,21 @@ static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
cfg->wid_header[1] = seq_no; /* sequence number */
cfg->wid_header[2] = (uint8_t)total_len;
cfg->wid_header[3] = (uint8_t)(total_len >> 8);
+#ifdef CONFIG_64BIT
cfg->wid_header[4] = (uint8_t)driver_handler;
- cfg->wid_header[5] = (uint8_t)(driver_handler >> 8);
- cfg->wid_header[6] = (uint8_t)(driver_handler >> 16);
- cfg->wid_header[7] = (uint8_t)(driver_handler >> 24);
+ cfg->wid_header[5] = (uint8_t)(driver_handler >> 8L);
+ cfg->wid_header[6] = (uint8_t)(driver_handler >> 16L);
+ cfg->wid_header[7] = (uint8_t)(driver_handler >> 24L);
+ cfg->wid_header[8] = (uint8_t)(driver_handler >> 32L);
+ cfg->wid_header[9] = (uint8_t)(driver_handler >> 40L);
+ cfg->wid_header[10] = (uint8_t)(driver_handler >> 48L);
+ cfg->wid_header[11] = (uint8_t)(driver_handler >> 56L);
+#else
+ cfg->wid_header[4] = (uint8_t)driver_handler;
+ cfg->wid_header[5] = (uint8_t)(driver_handler >> 8L);
+ cfg->wid_header[6] = (uint8_t)(driver_handler >> 16L);
+ cfg->wid_header[7] = (uint8_t)(driver_handler >> 24L);
+#endif
p->cfg_seq_no = seq_no;

/**
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index 0ba7ec6..e026baf 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -15,7 +15,11 @@
#define DRIVER_HANDLER_SIZE 4
#define MAX_MAC_HDR_LEN 26 /* QOS_MAC_HDR_LEN */
#define SUB_MSDU_HEADER_LENGTH 14
+#ifdef CONFIG_64BIT
+#define SNAP_HDR_LEN 12
+#else
#define SNAP_HDR_LEN 8
+#endif
#define ETHERNET_HDR_LEN 14
#define WORD_ALIGNMENT_PAD 0

@@ -297,7 +301,7 @@ typedef struct {
uint8_t ether_header[14];
uint8_t ip_header[20];
uint8_t udp_header[8];
- uint8_t wid_header[8];
+ uint8_t wid_header[4+sizeof(uintptr_t)];
uint8_t frame[MAX_CFG_FRAME_SIZE];
} wilc_cfg_frame_t;

--
1.9.1


2015-06-11 05:33:42

by Johnny Kim

[permalink] [raw]
Subject: Re: [PATCH 1/4] staging: wilc1000: modify data type


On 2015년 06월 11일 09:40, Greg KH wrote:
> On Wed, Jun 10, 2015 at 05:06:44PM +0900, Johnny Kim wrote:
>> -static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler)
>> +static int wilc_wlan_cfg_commit(int type, size_t drvHandler)
> Shouldn't this just be a void *? And if so, why not the real function
> pointer instead?
>
> Also, lots of these seem to be just pointers, please use a pointer
> instead of hiding it in a size_t as that's the most portable, and
> correct, way to do it. No need to hide any function pointers here, this
> isn't Windows :)
>
> thanks,
>
> greg k-h

To replace the integer to the pointer as your counsel, I need a lot of
discussion internally. But I will fix the type and the related things
like your thinking.

I know there is the build warning for 64-bit machine and this driver stays
in BROKEN status on linux-next.
I want to know if the reason is 64bit build warning.

Thanks for your help.

Regards
Johnny