summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wilink_6_1/platforms/os/linux/src/WlanDrvWext.c175
-rw-r--r--wilink_6_1/stad/src/Connection_Managment/admCtrlWpa.c3
-rw-r--r--wilink_6_1/stad/src/Connection_Managment/connInfra.c2
-rw-r--r--wilink_6_1/stad/src/Data_link/rx.c13
-rw-r--r--wilink_6_1/wpa_supplicant_lib/driver_ti.c19
-rw-r--r--wilink_6_1/wpa_supplicant_lib/driver_ti.h3
6 files changed, 117 insertions, 98 deletions
diff --git a/wilink_6_1/platforms/os/linux/src/WlanDrvWext.c b/wilink_6_1/platforms/os/linux/src/WlanDrvWext.c
index afdd147..4eec78a 100644
--- a/wilink_6_1/platforms/os/linux/src/WlanDrvWext.c
+++ b/wilink_6_1/platforms/os/linux/src/WlanDrvWext.c
@@ -166,82 +166,86 @@ int wlanDrvWext_Handler (struct net_device *dev,
void *iw_req,
void *extra)
{
- int rc;
- TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);
- ti_private_cmd_t my_command;
- struct iw_mlme mlme;
- void *copy_to_buf=NULL, *param3=NULL;
+ int rc;
+ TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);
+ ti_private_cmd_t my_command;
+ struct iw_mlme mlme;
+ void *copy_to_buf=NULL, *param3=NULL;
- os_memoryZero(drv, &my_command, sizeof(ti_private_cmd_t));
- os_memoryZero(drv, &mlme, sizeof(struct iw_mlme));
-
- switch (info->cmd)
- {
- case SIOCIWFIRSTPRIV:
- {
- void *copy_from_buf;
+ os_memoryZero(drv, &my_command, sizeof(ti_private_cmd_t));
+ os_memoryZero(drv, &mlme, sizeof(struct iw_mlme));
- if (os_memoryCopyFromUser(drv, &my_command, ((union iwreq_data *)iw_req)->data.pointer, sizeof(ti_private_cmd_t)))
- {
- os_printf ("wlanDrvWext_Handler() os_memoryCopyFromUser FAILED !!!\n");
- return TI_NOK;
- }
- if (IS_PARAM_FOR_MODULE(my_command.cmd, DRIVER_MODULE_PARAM))
- {
- /* If it's a driver level command, handle it here and exit */
- switch (my_command.cmd)
- {
- case DRIVER_INIT_PARAM:
- return wlanDrvIf_LoadFiles (drv, my_command.in_buffer);
-
- case DRIVER_START_PARAM:
- return wlanDrvIf_Start (dev);
+ switch (info->cmd)
+ {
+ case SIOCIWFIRSTPRIV:
+ {
+ void *copy_from_buf;
- case DRIVER_STOP_PARAM:
- return wlanDrvIf_Stop (dev);
+ if (os_memoryCopyFromUser(drv, &my_command, ((union iwreq_data *)iw_req)->data.pointer, sizeof(ti_private_cmd_t)))
+ {
+ os_printf ("wlanDrvWext_Handler() os_memoryCopyFromUser FAILED !!!\n");
+ return TI_NOK;
+ }
+ if (IS_PARAM_FOR_MODULE(my_command.cmd, DRIVER_MODULE_PARAM))
+ {
+ /* If it's a driver level command, handle it here and exit */
+ switch (my_command.cmd)
+ {
+ case DRIVER_INIT_PARAM:
+ return wlanDrvIf_LoadFiles(drv, my_command.in_buffer);
- case DRIVER_STATUS_PARAM:
- *(TI_UINT32 *)my_command.out_buffer =
- (drv->tCommon.eDriverState == DRV_STATE_RUNNING) ? TI_TRUE : TI_FALSE;
- return TI_OK;
- }
- }
- /* if we are still here handle a normal private command*/
+ case DRIVER_START_PARAM:
+ return wlanDrvIf_Start(dev);
- if ((my_command.in_buffer) && (my_command.in_buffer_len))
- {
- copy_from_buf = my_command.in_buffer;
- my_command.in_buffer = os_memoryAlloc(drv, my_command.in_buffer_len);
- if (os_memoryCopyFromUser(drv, my_command.in_buffer, copy_from_buf, my_command.in_buffer_len))
- {
- os_printf ("wlanDrvWext_Handler() os_memoryCopyFromUser 1 FAILED !!!\n");
- return TI_NOK;
- }
- }
- if ((my_command.out_buffer) && (my_command.out_buffer_len))
- {
- copy_to_buf = my_command.out_buffer;
- my_command.out_buffer = os_memoryAlloc(drv, my_command.out_buffer_len);
- }
- param3 = &my_command;
- }
- break;
+ case DRIVER_STOP_PARAM:
+ return wlanDrvIf_Stop(dev);
- case SIOCSIWMLME:
- {
- os_memoryCopyFromUser(drv, &mlme, ((union iwreq_data *)iw_req)->data.pointer, sizeof(struct iw_mlme));
- param3 = &mlme;
- }
- break;
- }
- /* If the friver is not running, return NOK */
- if (drv->tCommon.eDriverState != DRV_STATE_RUNNING)
- {
- return TI_NOK;
- }
+ case DRIVER_STATUS_PARAM:
+ *(TI_UINT32 *)my_command.out_buffer =
+ (drv->tCommon.eDriverState == DRV_STATE_RUNNING) ? TI_TRUE : TI_FALSE;
+ return TI_OK;
+ }
+ }
+ /* if we are still here handle a normal private command*/
- /* Call the Cmd module with the given user paramters */
- rc = (cmdHndlr_InsertCommand (drv->tCommon.hCmdHndlr,
+ if ((my_command.in_buffer) && (my_command.in_buffer_len))
+ {
+ copy_from_buf = my_command.in_buffer;
+ my_command.in_buffer = os_memoryAlloc(drv, my_command.in_buffer_len);
+ if (os_memoryCopyFromUser(drv, my_command.in_buffer, copy_from_buf, my_command.in_buffer_len))
+ {
+ os_printf("wlanDrvWext_Handler() os_memoryCopyFromUser 1 FAILED !!!\n");
+ return TI_NOK;
+ }
+ }
+ if ((my_command.out_buffer) && (my_command.out_buffer_len))
+ {
+ copy_to_buf = my_command.out_buffer;
+ my_command.out_buffer = os_memoryAlloc(drv, my_command.out_buffer_len);
+ }
+ param3 = &my_command;
+ }
+ break;
+
+ case SIOCSIWMLME:
+ {
+ os_memoryCopyFromUser(drv, &mlme, ((union iwreq_data *)iw_req)->data.pointer, sizeof(struct iw_mlme));
+ param3 = &mlme;
+ }
+ break;
+ }
+ /* If the friver is not running, return NOK */
+ if (drv->tCommon.eDriverState != DRV_STATE_RUNNING)
+ {
+ if (my_command.in_buffer)
+ os_memoryFree(drv, my_command.in_buffer, my_command.in_buffer_len);
+ if (my_command.out_buffer)
+ os_memoryFree(drv,my_command.out_buffer,my_command.out_buffer_len);
+ return TI_NOK;
+ }
+
+ /* Call the Cmd module with the given user paramters */
+ rc = cmdHndlr_InsertCommand(drv->tCommon.hCmdHndlr,
info->cmd,
info->flags,
iw_req,
@@ -249,21 +253,20 @@ int wlanDrvWext_Handler (struct net_device *dev,
extra,
0,
param3,
- NULL));
- /* Here we are after the command was completed */
- if (my_command.in_buffer)
- {
- os_memoryFree (drv, my_command.in_buffer, my_command.in_buffer_len);
- }
- if (my_command.out_buffer)
- {
- if (os_memoryCopyToUser(drv, copy_to_buf, my_command.out_buffer, my_command.out_buffer_len))
- {
- os_printf ("wlanDrvWext_Handler() os_memoryCopyToUser FAILED !!!\n");
- rc = TI_NOK;
- }
- os_memoryFree (drv, my_command.out_buffer, my_command.out_buffer_len);
- }
-
- return rc;
+ NULL);
+ /* Here we are after the command was completed */
+ if (my_command.in_buffer)
+ {
+ os_memoryFree(drv, my_command.in_buffer, my_command.in_buffer_len);
+ }
+ if (my_command.out_buffer)
+ {
+ if (os_memoryCopyToUser(drv, copy_to_buf, my_command.out_buffer, my_command.out_buffer_len))
+ {
+ os_printf("wlanDrvWext_Handler() os_memoryCopyToUser FAILED !!!\n");
+ rc = TI_NOK;
+ }
+ os_memoryFree(drv, my_command.out_buffer, my_command.out_buffer_len);
+ }
+ return rc;
}
diff --git a/wilink_6_1/stad/src/Connection_Managment/admCtrlWpa.c b/wilink_6_1/stad/src/Connection_Managment/admCtrlWpa.c
index 3a92561..77041ba 100644
--- a/wilink_6_1/stad/src/Connection_Managment/admCtrlWpa.c
+++ b/wilink_6_1/stad/src/Connection_Managment/admCtrlWpa.c
@@ -1251,7 +1251,8 @@ TI_STATUS admCtrlWpa_parseIe(admCtrl_t *pAdmCtrl, TI_UINT8 *pWpaIe, wpaIeData_t
curWpaIe +=4;
/* Include all AP key management supported suites in the wpaData structure */
- pWpaData->KeyMngSuite[index+1] = curKeyMngSuite;
+ if ((index+1) < MAX_WPA_KEY_MNG_SUITES)
+ pWpaData->KeyMngSuite[index+1] = curKeyMngSuite;
}
pWpaData->KeyMngSuite[0] = maxKeyMngSuite;
diff --git a/wilink_6_1/stad/src/Connection_Managment/connInfra.c b/wilink_6_1/stad/src/Connection_Managment/connInfra.c
index 866b0fe..b48acdf 100644
--- a/wilink_6_1/stad/src/Connection_Managment/connInfra.c
+++ b/wilink_6_1/stad/src/Connection_Managment/connInfra.c
@@ -856,7 +856,7 @@ static TI_STATUS prepare_send_disconnect(void *pData)
/* Start the disconnect complete time out timer.
Disconect Complete event, which stops the timer. */
- tmr_StartTimer (pConn->hConnTimer, conn_timeout, (TI_HANDLE)pConn, DISCONNECT_TIMEOUT_MSEC * 4, TI_FALSE);
+ tmr_StartTimer (pConn->hConnTimer, conn_timeout, (TI_HANDLE)pConn, DISCONNECT_TIMEOUT_MSEC, TI_FALSE);
/* FW will send the disconn frame according to disConnType */
TWD_CmdFwDisconnect (pConn->hTWD, pConn->disConnType, pConn->disConnReasonToAP);
diff --git a/wilink_6_1/stad/src/Data_link/rx.c b/wilink_6_1/stad/src/Data_link/rx.c
index 52436fe..beb234f 100644
--- a/wilink_6_1/stad/src/Data_link/rx.c
+++ b/wilink_6_1/stad/src/Data_link/rx.c
@@ -39,28 +39,28 @@
/***************************************************************************/
#define __FILE_ID__ FILE_ID_54
#include "tidef.h"
-#include "paramOut.h"
+#include "paramOut.h"
#include "rx.h"
#include "osApi.h"
#include "timer.h"
#include "DataCtrl_Api.h"
#include "Ctrl.h"
#include "802_11Defs.h"
-#include "Ethernet.h"
+#include "Ethernet.h"
#include "report.h"
#include "rate.h"
#include "mlmeApi.h"
#include "rsnApi.h"
#include "smeApi.h"
#include "siteMgrApi.h"
-#include "GeneralUtil.h"
+#include "GeneralUtil.h"
#include "EvHandler.h"
#ifdef XCC_MODULE_INCLUDED
#include "XCCMngr.h"
#endif
#include "TWDriver.h"
#include "RxBuf.h"
-#include "DrvMainModules.h"
+#include "DrvMainModules.h"
#include "bmtrace_api.h"
#include "PowerMgr_API.h"
@@ -184,7 +184,7 @@ void rxData_init (TStadHandlesList *pStadHandles)
pRxData->hEvHandler = pStadHandles->hEvHandler;
pRxData->hTimer = pStadHandles->hTimer;
pRxData->hPowerMgr = pStadHandles->hPowerMgr;
-
+
pRxData->rxDataExcludeUnencrypted = DEF_EXCLUDE_UNENCYPTED;
pRxData->rxDataExludeBroadcastUnencrypted = DEF_EXCLUDE_UNENCYPTED;
pRxData->rxDataEapolDestination = DEF_EAPOL_DESTINATION;
@@ -239,7 +239,7 @@ TI_STATUS rxData_SetDefaults (TI_HANDLE hRxData, rxDataInitParams_t * rxDataInit
{
rxData_t *pRxData = (rxData_t *)hRxData;
int i;
-
+
/* init rx data filters */
pRxData->filteringEnabled = rxDataInitParams->rxDataFiltersEnabled;
pRxData->filteringDefaultAction = rxDataInitParams->rxDataFiltersDefaultAction;
@@ -814,7 +814,6 @@ static TI_STATUS rxData_addRxDataFilter (TI_HANDLE hRxData, TRxDataFilterRequest
lenFieldPatterns,
fieldPatterns);
- return TI_OK;
}
/***************************************************************************
diff --git a/wilink_6_1/wpa_supplicant_lib/driver_ti.c b/wilink_6_1/wpa_supplicant_lib/driver_ti.c
index a579be1..5b1d637 100644
--- a/wilink_6_1/wpa_supplicant_lib/driver_ti.c
+++ b/wilink_6_1/wpa_supplicant_lib/driver_ti.c
@@ -134,12 +134,17 @@ static int wpa_driver_tista_private_send( void *priv, u32 ioctl_cmd, void *bufIn
iwr.u.data.flags = 0;
res = ioctl(drv->ioctl_sock, SIOCIWFIRSTPRIV, &iwr);
- if(res != 0)
+ if (0 != res)
{
wpa_printf(MSG_ERROR, "ERROR - wpa_driver_tista_private_send - error sending Wext private IOCTL to STA driver (ioctl_cmd = %x, res = %d, errno = %d)", ioctl_cmd, res, errno);
+ drv->errors++;
+ if (drv->errors > MAX_NUMBER_SEQUENTIAL_ERRORS) {
+ drv->errors = 0;
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED");
+ }
return -1;
}
-
+ drv->errors = 0;
wpa_printf(MSG_DEBUG, "wpa_driver_tista_private_send ioctl_cmd = %x res = %d", ioctl_cmd, res);
return 0;
@@ -153,7 +158,7 @@ static int wpa_driver_tista_driver_start( void *priv )
res = wpa_driver_tista_private_send(priv, DRIVER_START_PARAM, &uDummyBuf, sizeof(uDummyBuf), NULL, 0);
- if(0 != res)
+ if (0 != res)
wpa_printf(MSG_ERROR, "ERROR - Failed to start driver!");
else {
os_sleep(0, WPA_DRIVER_WEXT_WAIT_US); /* delay 400 ms */
@@ -593,6 +598,11 @@ static int wpa_driver_tista_driver_cmd( void *priv, char *cmd, char *buf, size_t
wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED");
}
}
+ if( os_strcasecmp(cmd, "reload") == 0 ) {
+ wpa_printf(MSG_DEBUG,"Reload command");
+ ret = 0;
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED");
+ }
else if( os_strcasecmp(cmd, "macaddr") == 0 ) {
wpa_driver_tista_get_mac_addr(priv);
wpa_printf(MSG_DEBUG, "Macaddr command");
@@ -834,6 +844,9 @@ void * wpa_driver_tista_init(void *ctx, const char *ifname)
/* BtCoex mode is read from tiwlan.ini file */
drv->btcoex_mode = 0; /* SG_DISABLE */
+
+ /* Number of sequential errors */
+ drv->errors = 0;
return drv;
}
diff --git a/wilink_6_1/wpa_supplicant_lib/driver_ti.h b/wilink_6_1/wpa_supplicant_lib/driver_ti.h
index ab36ab3..6f36119 100644
--- a/wilink_6_1/wpa_supplicant_lib/driver_ti.h
+++ b/wilink_6_1/wpa_supplicant_lib/driver_ti.h
@@ -53,6 +53,8 @@
#define RX_IPV4_MULTICAST_FILTER 2
#define RX_IPV6_MULTICAST_FILTER 3
+#define MAX_NUMBER_SEQUENTIAL_ERRORS 4
+
typedef enum {
BLUETOOTH_COEXISTENCE_MODE_ENABLED = 0,
BLUETOOTH_COEXISTENCE_MODE_DISABLED,
@@ -73,5 +75,6 @@ struct wpa_driver_ti_data {
u32 btcoex_mode; /* BtCoex Mode */
int last_scan; /* Last scan type */
SHLIST scan_merge_list; /* Previous scan list */
+ int errors; /* Number of sequential errors */
};
#endif