OUTPUT_DIR ?= $(STA_DK_ROOT)/CUDK/CLI
-DK_INCS = -I $(CUDK_ROOT)/CLI/drv_inc \
- -I $(CUDK_ROOT)/CLI/pform_inc
+DK_INCS = -I $(COMMON)/inc \
+ -I $(COMSRC)/inc \
+ -I $(COMSRC)/utils \
+ -I $(COMSRC)/hal/inc \
+ -I $(COMSRC)/hal/hl_data \
+ -I $(COMSRC)/hal/hl_ctrl \
+ -I $(COMSRC)/hal/hw_data \
+ -I $(COMSRC)/hal/hw_ctrl \
+ -I $(COMSRC)/hal/security \
+ -I $(COMSRC)/hal/FirmwareApi \
+ -I $(COMSRC)/hal/TnetwServices \
+ -I $(COMSRC)/hal/TnetwServices/TNETW1251 \
+ -I $(COMSRC)/core/inc \
+ -I $(COMSRC)/core/data_ctrl/Tx \
+ -I $(COMSRC)/core/data_ctrl/Ctrl \
+ -I $(COMSRC)/core/data_ctrl/Ctrl/4X \
+ -I $(COMSRC)/core/sme/Inc \
+ -I $(COMSRC)/core/sme/siteMgr \
+ -I $(COMSRC)/core/sme/configMgr \
+ -I $(COMSRC)/core/sme/conn \
+ -I $(COMSRC)/core/rsn \
+ -I $(COMSRC)/core/rsn/mainKeysSm \
+ -I $(COMSRC)/core/rsn/mainKeysSm/keyDerive \
+ -I $(COMSRC)/core/rsn/inc \
+ -I $(COMSRC)/core/mlme \
+ -I $(COMSRC)/core/NetworkCtrl/inc \
+ -I $(COMSRC)/core/NetworkCtrl/Measurement \
+ -I $(COMSRC)/core/NetworkCtrl/RegulatoryDomain \
+ -I $(COMSRC)/core/NetworkCtrl/QOS \
+ -I $(CUDK_ROOT)/CLI
ifeq ($(EXC),y)
DK_INCS += \
-I $(CUDK_ROOT)/Inc/EXC \
-I $(CUDK_ROOT)/CLI/EXC
endif
+
ifeq ($(SG), y)
# DK_INCS += -I $(COMSRC)/core/NetworkCtrl/BThWlanCombo
endif
DEPS = $(SRCS:%.c=%.d)
# export CROSS_COMPILE ?= arm_v4t_le-
-export CROSS_COMPILE ?= arm-linux-
+export CROSS_COMPILE ?= arm-none-linux-gnueabi-
#ARMFLAGS = -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe
#ARMFLAGS += -mapcs -mno-sched-prolog -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4
SUPPL_TARGET = $(OUTPUT_DIR)/wlan_suppl
endif
-INCLUDES = $(DK_INCS) -I $(STA_DK_ROOT)/CUDK/CLI/pform_inc \
- -I $(STA_DK_ROOT)/CUDK/Inc
+INCLUDES = $(DK_INCS) -I $(STA_DK_ROOT)/pform/linux/inc \
+ -I $(STA_DK_ROOT)/CUDK/Inc \
+ -I $(STA_DK_ROOT)/pform/common/inc
ifeq ($(GWSI_SA), n)
ifeq ($(BUILD_SUPPL), y)
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
#include <unistd.h>
#include <termios.h>
#include <sys/socket.h>
-#include <linux/if.h>
+
+#include <linux/types.h> //jorjin
+#include <linux/if.h> //jorjin
#include <linux/wireless.h>
#include "tnetwCommon.h"
#endif /* __LINUX__ */
-
+
#include "g_tester.h"
#include "wspVer.h"
default:
return (FALSE);
}
-
+
}
static BOOL is_value_rate (tiUINT32 rate);
struct CHAN_FREQ {
OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS *CrossParams;
OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_CROSS_INDICATION_PARAMS *TrafficIntensityThresholdParams;
btCoexStatus_t *btCoexStatus;
-
+
#if defined (_WINDOWS)
#endif
g_tester_receive_event((tiUINT8)((IPC_EVENT_PARAMS *)pData)->uEventType);
if (pDisAssoc->uStatusCode == STATUS_PACKET_REJ_TIMEOUT)
{
console_printf_terminal("CLI Event - Disassociated due to no Auth response \n");
- }
+ }
else
{
console_printf_terminal("CLI Event - Disassociated due to Auth response packet with reason = %d\n", pDisAssoc->uStatusCode);
if (pDisAssoc->uStatusCode == STATUS_PACKET_REJ_TIMEOUT)
{
console_printf_terminal("CLI Event - Disassociated due to no Assoc response \n");
- }
+ }
else
{
console_printf_terminal("CLI Event - Disassociated due to Assoc response packet with reason = %d\n", pDisAssoc->uStatusCode);
switch ( eAuthStatusReason )
{
- case RSN_AUTH_STATUS_INVALID_TYPE:
+ case RSN_AUTH_STATUS_INVALID_TYPE:
console_printf_terminal("The reason: Invalid Authentication Type \n");
- break;
- case RSN_AUTH_STATUS_TIMEOUT:
+ break;
+ case RSN_AUTH_STATUS_TIMEOUT:
console_printf_terminal("The reason: Authentication Timeout \n");
- break;
+ break;
case RSN_AUTH_STATUS_CHALLENGE_FROM_AP_FAILED:
- case RSN_AUTH_STATUS_CHALLENGE_TO_AP_FAILED:
+ case RSN_AUTH_STATUS_CHALLENGE_TO_AP_FAILED:
console_printf_terminal("The reason: username or password incorrect \n");
break;
default:
console_printf_terminal("The reason: unknown = %d \n", eAuthStatusReason);
break;
}
-
+
}
break;
console_printf_terminal(" Rates: ");
for( i=0; i<MAX_SUPPORTED_RATES && i < data.len; i++ )
{
- console_printf_terminal("%g Mbps(%u%s)%s", RATE_2_MBPS(data.ratesString[i]),
+ console_printf_terminal("%g Mbps(%u%s)%s", RATE_2_MBPS(data.ratesString[i]),
data.ratesString[i],
IS_BASIC_RATE(data.ratesString[i]) ? " - basic" : "",
(i < data.len-1) ? "," : "" );
for( i=0; *buf && i < MAX_SUPPORTED_RATES; i++ )
{
val = (float) strtod(buf, &end_p);
- if(
+ if(
#ifndef _WINDOWS
- errno ||
+ errno ||
#endif
buf == end_p )
{
buf[0] = 0;
switch (nParms) {
-
+
case 0 :
- /*
+ /*
* No SSID & No BSSID are set -
* Use Any SSID & Any BSSID.
*/
TI_SetBSSID(g_id_adapter, &bssid );
TI_SetSSID(g_id_adapter, (tiUINT8 *) buf);
break;
-
+
case 1:
- /*
+ /*
* SSID set & BSSID insn't set -
* Use CLI's SSID & Any BSSID.
*/
- TI_SetBSSID(g_id_adapter, &bssid );
+ TI_SetBSSID(g_id_adapter, &bssid );
TI_SetSSID(g_id_adapter, (tiUINT8 *) parm[0].value);
break;
case 2:
- /*
+ /*
* Both SSID & BSSID are set -
* Use CLI's SSID & BSSID.
*/
UINT32 AverageFWDelay;
UINT32 AverageMacDelay;
tiINT32 status;
-
+
UNUSED(parm);
UNUSED(nParms);
{
console_printf_terminal("\nTx Queue %d:\n", TxQid);
console_printf_terminal("===========\n");
-
+
console_printf_terminal(" Total Good Frames : %d\n", statistics.txCounters[TxQid].XmitOk );
console_printf_terminal(" Unicast Bytes : %d\n", statistics.txCounters[TxQid].DirectedBytesXmit );
console_printf_terminal(" Unicast Frames : %d\n", statistics.txCounters[TxQid].DirectedFramesXmit );
console_printf_terminal(" No Link Failures : %d\n", statistics.txCounters[TxQid].NoLinkCounter );
console_printf_terminal(" Other Failures : %d\n", statistics.txCounters[TxQid].OtherFailCounter );
console_printf_terminal(" Max Consecutive Retry Failures : %d\n\n", statistics.txCounters[TxQid].MaxConsecutiveRetryFail );
-
+
console_printf_terminal(" Retry histogram:\n");
console_printf_terminal(" ----------------\n\n");
console_printf_terminal(" Retries: %8d %8d %8d %8d %8d %8d %8d %8d\n", 0, 1, 2, 3, 4, 5, 6, 7);
- console_printf_terminal(" packets: %8d %8d %8d %8d %8d %8d %8d %8d\n\n",
+ console_printf_terminal(" packets: %8d %8d %8d %8d %8d %8d %8d %8d\n\n",
statistics.txCounters[TxQid].RetryHistogram[ 0 ],
statistics.txCounters[TxQid].RetryHistogram[ 1 ],
statistics.txCounters[TxQid].RetryHistogram[ 2 ],
statistics.txCounters[TxQid].RetryHistogram[ 6 ],
statistics.txCounters[TxQid].RetryHistogram[ 7 ]);
console_printf_terminal(" Retries: %8d %8d %8d %8d %8d %8d %8d %8d\n", 8, 9, 10, 11, 12, 13, 14, 15);
- console_printf_terminal(" packets: %8d %8d %8d %8d %8d %8d %8d %8d\n\n",
+ console_printf_terminal(" packets: %8d %8d %8d %8d %8d %8d %8d %8d\n\n",
statistics.txCounters[TxQid].RetryHistogram[ 8 ],
statistics.txCounters[TxQid].RetryHistogram[ 9 ],
statistics.txCounters[TxQid].RetryHistogram[ 10 ],
OS_802_11_SSID ssid = { 0 };
OS_802_11_MAC_ADDRESS bssid = { 0xff,0xff,0xff,0xff,0xff,0xff };
char *ssid_str;
-
+
if( nParms == 0 )
{
if(!TI_GetCurrentSSID(g_id_adapter, &ssid))
/* set Short or Long Doze. no use of other parameters */
if( !TI_GetPowerLevelDozeMode(g_id_adapter,&mode ) )
{
- console_printf_terminal("Doze Mode in Auto Power Level: SHORT_DOZE - %d LONG_DOZE - %d\n",
+ console_printf_terminal("Doze Mode in Auto Power Level: SHORT_DOZE - %d LONG_DOZE - %d\n",
OS_POWER_MODE_SHORT_DOZE,OS_POWER_MODE_LONG_DOZE);
}
}
}
-void cmd_Beacon_Filter_Set_Desired_State(ConParm_t parm[], U16 nParms)
+void cmd_Beacon_Filter_Set_Desired_State(ConParm_t parm[], U16 nParms)
{
/*there are two modes : feature ACTIVE & PASSIV ( or NOT ACTIVE )*/
if( nParms )
}
}
-void cmd_Beacon_Filter_Get_Desired_State(ConParm_t parm[], U16 nParms)
+void cmd_Beacon_Filter_Get_Desired_State(ConParm_t parm[], U16 nParms)
{
UINT8 desState = FALSE ;
-
+
TI_GetBeaconFilterDesiredState(g_id_adapter, &desState ) ;
console_printf_terminal("Desired State is %s\n", (desState == FALSE)?"FILTER INACTIVE":"FILTER ACTIVE" );
-
-
+
+
}
appScanParams.desiredSsid.ssidString[ 0 ] = '\0';
}
else
- {
+ {
appScanParams.desiredSsid.len = strlen((char*)parm[0].value);
memcpy( &(appScanParams.desiredSsid.ssidString), (char*)parm[0].value, appScanParams.desiredSsid.len );
}
void cmd_Scan_app_channel_config(ConParm_t parm[], U16 nParms)
{
- scan_normalChannelEntry_t* pChannelEntry =
+ scan_normalChannelEntry_t* pChannelEntry =
&(appScanParams.channelEntry[ parm[0].value ].normalChannelEntry);
-
+
if (parm[2].value < parm[3].value)
{
console_printf_terminal ("Max Dwell Time must be larger than or equal to Min Dwell Time...\n");
int i;
scan_normalChannelEntry_t* pNormalChannel;
char bssId[18];
-
+
bssId[17] = '\0';
console_printf_terminal("Application Scan params:\n");
console_printf_terminal("SSID: %s, Type: %s\n", appScanParams.desiredSsid.ssidString, scanType2Str[ appScanParams.scanType ].name);
- console_printf_terminal("Band: %s, Number of probe req:%d, probe req. rate:%s\n",
+ console_printf_terminal("Band: %s, Number of probe req:%d, probe req. rate:%s\n",
band2Str[ appScanParams.band ].name, appScanParams.probeReqNumber, rate2StrFunc( appScanParams.probeRequestRate ) );
#ifdef TI_DBG
console_printf_terminal("Tid :%d\n\n", appScanParams.Tid);
console_printf_terminal("-------------------------------------------------------------------------------\n");
for ( i = 0; i < appScanParams.numOfChannels; i++ )
{
- pNormalChannel = &(appScanParams.channelEntry[ i ].normalChannelEntry);
+ pNormalChannel = &(appScanParams.channelEntry[ i ].normalChannelEntry);
mac2HexStr( &(pNormalChannel->bssId), bssId );
console_printf_terminal ("%2d %s %7d %7d %s%3d %1d\n",
pNormalChannel->channel, bssId, pNormalChannel->maxChannelDwellTime,
case SCAN_TYPE_TRIGGERED_ACTIVE:
case SCAN_TYPE_TRIGGERED_PASSIVE:
-
+
/* Check if valid TID */
if (((parm[ 4 ].value) > 7) && ((parm[ 4 ].value) != 255))
{
for ( i = 0; i < list.numOfEntries; i++ )
{
- console_printf_terminal( "%s %s %-7d %-4d %s\n",
- print_mac_2_str(list.BSSList[ i ].BSSID.addr), band2Str[ list.BSSList[ i ].band ].name,
- list.BSSList[ i ].channel, list.BSSList[ i ].RSSI,
+ console_printf_terminal( "%s %s %-7d %-4d %s\n",
+ print_mac_2_str(list.BSSList[ i ].BSSID.addr), band2Str[ list.BSSList[ i ].band ].name,
+ list.BSSList[ i ].channel, list.BSSList[ i ].RSSI,
(TRUE == list.BSSList[ i ].bNeighborAP ? "Yes" : "No") );
}
}
{
int i;
acTrfcType_e dtagToAcTable[MAX_NUM_OF_802_1d_TAGS];
-
+
for (i=0; i<MAX_NUM_OF_802_1d_TAGS; i++)
{
dtagToAcTable[i] = (UINT32) parm[i].value;
}
- console_printf_terminal("Input parameters =%d, %d, %d, %d, %d, %d, %d, %d\n",
+ console_printf_terminal("Input parameters =%d, %d, %d, %d, %d, %d, %d, %d\n",
(UINT32) parm[0].value,
(UINT32) parm[1].value,
(UINT32) parm[2].value,
(UINT32) parm[5].value,
(UINT32) parm[6].value,
(UINT32) parm[7].value);
-
+
if (TI_SetDTagToAcMappingTable(g_id_adapter, dtagToAcTable) == TI_RESULT_OK)
{
}
console_printf_terminal(" Parm 1 -- VAD timer duration in ms for enabling action\n");
if (TI_GetVAD(g_id_adapter, &pVadTimer) == TI_RESULT_OK)
{
-
- console_printf_terminal("Current param values: %d, %d\n",
+
+ console_printf_terminal("Current param values: %d, %d\n",
pVadTimer.vadTimerEnabled, pVadTimer.vadTimerDuration);
}
}
{
console_printf_terminal("Disabling VAD timer\n");
}
-
+
if (TI_SetVAD(g_id_adapter, &pVadTimer) == TI_RESULT_OK)
{
console_printf_terminal("Setting VAD is done\n");
}
- }
+ }
}
pQosParams.VoiceDeliveryProtocol=0;
pQosParams.PSDeliveryProtocol=0;
- if (nParms == 7) /* If the user has input 7 parameters, it means he gave Voice+PS delivery protocol values */
+ if (nParms == 7) /* If the user has input 7 parameters, it means he gave Voice+PS delivery protocol values */
{
pQosParams.VoiceDeliveryProtocol=parm[5].value;
pQosParams.PSDeliveryProtocol=parm[6].value;
console_printf_terminal("Since the VoiceDeliveryProtocol is PS_POLL, resetting PSDeliveryProtocol to Legacy\n");
}
}
-
+
if (TI_SetQosParameters(g_id_adapter, &pQosParams) == TI_RESULT_OK)
{
- console_printf_terminal("Sent QOS params to driver...\n AC Number=%d \n MaxLifeTime=%d \n DeliveryProtocolPsPoll = %d\n PSDeliveryProtocol = %d\n",
+ console_printf_terminal("Sent QOS params to driver...\n AC Number=%d \n MaxLifeTime=%d \n DeliveryProtocolPsPoll = %d\n PSDeliveryProtocol = %d\n",
pQosParams.acID,
pQosParams.MaxLifeTime,
pQosParams.VoiceDeliveryProtocol,
rxTimeOut.psPoll = parm[0].value;
rxTimeOut.UPSD = parm[1].value;
- if (nParms != 2)
+ if (nParms != 2)
{
console_printf_terminal("Please enter Rx Time Out:\n");
console_printf_terminal("Param 0 - psPoll (0 - 65000)\n");
{
if (TI_SetQosRxTimeOut(g_id_adapter, &rxTimeOut) == TI_RESULT_OK)
{
- console_printf_terminal("Sent QOS Rx TimeOut params to driver...\n PsPoll = %d\n UPSD = %d\n",
+ console_printf_terminal("Sent QOS Rx TimeOut params to driver...\n PsPoll = %d\n UPSD = %d\n",
rxTimeOut.psPoll,
rxTimeOut.UPSD);
}
while ((ch = pString[iter]))
{
- UINT8 val = ((ch >= '0' && ch <= '9') ? (ch - '0') :
+ UINT8 val = ((ch >= '0' && ch <= '9') ? (ch - '0') :
(ch >= 'A' && ch <= 'F') ? (0xA + ch - 'A') :
(ch >= 'a' && ch <= 'f') ? (0xA + ch - 'a') : 0);
memset(&Mib, 0, sizeof(Mib));
Mib.aMib = PLT_MIB_dot11MaxReceiveLifetime;
- if (nParms != 1)
+ if (nParms != 1)
{
console_printf_terminal("Max Rx lifetime: [0 - 4294967295(0xFFFFFFFF)]\n");
console_printf_terminal ("| AC | AdmCtrlFlag | AIFS | CwMin | CwMax | TXOPLimit |\n");
console_printf_terminal ("+----+-------------+----------+-----------+-----------+-----------+\n");
-
+
for (i=0; i<4; i++)
{
pACQosParams.uAC = i;
console_printf_terminal ("Unknown return value...\n");
break;
}
-
+
}
void cmd_get_ap_qos_capabilities(ConParm_t parm[], U16 nParms)
{
OS_802_11_THRESHOLD_CROSS_PARAMS pThresholdCrossParams;
tiUINT32 resultCode;
-
+
if (nParms == 3) /* If user supplied 3 parameters - this is a SET operation */
{
if ((is_value_rate(parm[1].value) == FALSE) || (is_value_rate(parm[2].value) == FALSE))
console_printf_terminal ("Invalid rate - PHY rate valid values are: 1,2,5,6,9,11,12,18,24,36,48,54\n");
return;
}
-
+
pThresholdCrossParams.uAC = parm[0].value;
pThresholdCrossParams.uHighThreshold = parm[1].value;
pThresholdCrossParams.uLowThreshold = parm[2].value;
-
+
if (pThresholdCrossParams.uLowThreshold > pThresholdCrossParams.uHighThreshold)
{
console_printf_terminal ("Low threshold cannot be higher than the High threshold...Aborting...\n");
pTrafficIntensityThresholds.uHighThreshold = parm[0].value;
pTrafficIntensityThresholds.uLowThreshold = parm[1].value;
pTrafficIntensityThresholds.TestInterval = parm[2].value;
-
+
if (pTrafficIntensityThresholds.uLowThreshold >= pTrafficIntensityThresholds.uHighThreshold)
{
console_printf_terminal ("Error: low threshold equal or greater than the high threshold...aborting...\n");
}
-
+
resultCode = TI_SetTrafficIntensityThresholds (g_id_adapter, &pTrafficIntensityThresholds);
-
+
if (resultCode == TI_RESULT_OK)
{
console_printf_terminal ("Successfully set traffic intensity thresholds...\n");
-
+
}
else
{
if (uParms >=2)
newUserTableEntry.DTag = (tiUINT8) parm[1].value;
-
+
switch(parm[0].value)
{
case D_TAG_CLSFR:
return;
break;
}
-
+
res = TI_RemoveClassifierEntry(g_id_adapter, &newUserTableEntry);
if (res)
{
if (uParms >=2)
newUserTableEntry.DTag = (UINT8) parm[1].value;
-
+
switch(parm[0].value)
{
case D_TAG_CLSFR:
return;
break;
}
-
+
res = TI_ConfigTxClassifier(g_id_adapter, sizeof(clsfr_tableEntry_t), (UINT8 *)&newUserTableEntry);
if (res)
{
TI_PollApPacketsFromAC (g_id_adapter,parm[0].value);
console_printf_terminal ("Poll AP packets (From AC %d) cmd sent to driver...\n",(int)parm[0].value);
}
-
+
}
void cmd_modify_rate(ConParm_t parm[], U16 nParms)
{
tiUINT32 data = 0, data1 = 0;
-
+
if( !TI_GetDesiredRate(g_id_adapter, &data1 ) )
{
TI_GetCurrentRate(g_id_adapter, &data );
}
else
{
- if (parm[0].value > MAX_TX_POWER)
+ if (parm[0].value > MAX_TX_POWER)
{
console_printf_terminal("Hey !!! You should use values between %d and %d\n", MIN_TX_POWER, MAX_TX_POWER);
return;
void cmd_enableDisable_802_11d(ConParm_t parm[], U16 nParms)
{
UINT8 data = 0;
- tiINT32 result;
+ tiINT32 result;
result = TI_Get_802_11d(g_id_adapter, &data );
if ( nParms == 0 )
console_printf_terminal("802_11d status=%d\n", data );
}
}
- else
+ else
{
result = TI_EnableDisable_802_11d(g_id_adapter, (UINT8) parm[0].value);
if ((result != TI_RESULT_OK) && (!parm[0].value))
}
}
-
+
}
void cmd_enableDisable_802_11h(ConParm_t parm[], U16 nParms)
{
UINT8 data = 0;
- tiINT32 result;
+ tiINT32 result;
result = TI_Get_802_11h(g_id_adapter, &data );
if( nParms == 0 )
console_printf_terminal("802_11h status=%d\n", data );
}
}
- else
+ else
{
TI_EnableDisable_802_11h(g_id_adapter, (UINT8) parm[0].value);
if (parm[0].value)
console_printf_terminal("802_11h status is updated to =%d\n", parm[0].value );
}
-
+
}
void cmd_d_Country_2_4Ie(ConParm_t parm[], U16 nParms)
{
- tiINT32 result;
+ tiINT32 result;
if( nParms == 0 )
{
}
-
+
}
void cmd_d_Country_5Ie(ConParm_t parm[], U16 nParms)
{
- tiINT32 result;
+ tiINT32 result;
if( nParms == 0 )
{
console_printf_terminal("802_11d Setting US Country for 5 GHz, result=%d\n", result);
}
-
+
}
void cmd_DFS_range(ConParm_t parm[], U16 nParms)
{
- tiINT32 result;
+ tiINT32 result;
DFS_ChannelRange_t DFS_ChannelRange;
if( nParms == 0 )
{
-
+
result = TI_Get_minMaxDfsChannels(g_id_adapter, &DFS_ChannelRange );
if( result == TI_RESULT_OK)
{
- console_printf_terminal("DFS min channel is %d, DFS max channel is %d\n",
+ console_printf_terminal("DFS min channel is %d, DFS max channel is %d\n",
DFS_ChannelRange.minDFS_channelNum, DFS_ChannelRange.maxDFS_channelNum);
}
}
DFS_ChannelRange.minDFS_channelNum = (UINT16) parm[0].value;
DFS_ChannelRange.maxDFS_channelNum = (UINT16) parm[1].value;
- console_printf_terminal("Given params: min channel %d, DFS max channel %d\n",
+ console_printf_terminal("Given params: min channel %d, DFS max channel %d\n",
parm[0].value, parm[1].value);
result = TI_Set_minMaxDfsChannels(g_id_adapter, DFS_ChannelRange);
if (result == TI_RESULT_OK)
{
- console_printf_terminal("Setting DFS min channel %d, DFS max channel %d\n",
+ console_printf_terminal("Setting DFS min channel %d, DFS max channel %d\n",
DFS_ChannelRange.minDFS_channelNum, DFS_ChannelRange.maxDFS_channelNum);
}
else
{
- console_printf_terminal("Setting DFS min channel %d, DFS max channel %d - FAILED !!\n",
+ console_printf_terminal("Setting DFS min channel %d, DFS max channel %d - FAILED !!\n",
DFS_ChannelRange.minDFS_channelNum, DFS_ChannelRange.maxDFS_channelNum);
}
}
-
+
}
#if 0
tiINT32 rssi ;
TI_GetRSSI(g_id_adapter, &rssi);
console_printf_terminal("\n Current RSSI : %d\n" ,rssi) ; // TRS:WDK - add return
-}
+}
/*will return SNR ratio*/
tiUINT32 snr ;
TI_GetSNR(g_id_adapter, &snr);
console_printf_terminal("\n Current SNR ratio : %d\n" ,snr) ; // TRS:WDK - add return
-}
+}
void cmd_modify_frag_threshold(ConParm_t parm[], U16 nParms)
{
void cmd_events_register(ConParm_t parm[], U16 nParms)
{
- tiUINT32 event;
+ tiUINT32 event;
IPC_EVENT_PARAMS pEvent;
if( nParms )
{
event = (tiUINT32)parm[0].value;
-
+
if (events_mask & (1 << event))
{
#ifndef _WINDOWS
{
#ifdef _WINDOWS
#else
- print_available_values(event_type);
+ print_available_values(event_type);
#endif
}
{
tiUINT32 event;
IPC_EVENT_PARAMS pEvent;
-
+
if( nParms )
{
event = (tiUINT32)parm[0].value;
pEvent.uEventType = event;
pEvent.uEventID = eventRegistered[pEvent.uEventType];
TI_UnRegisterEvent(g_id_adapter, &pEvent);
-
+
events_mask &= ~(1 << event);
#endif
}
{
#ifdef _WINDOWS
#else
- print_available_values(event_type);
+ print_available_values(event_type);
#endif
}
}
void cmd_bssid_list(ConParm_t parm[], U16 nParms)
{
-
+
OS_802_11_BSSID_EX BssIdInfo;
TI_GetSelectedBSSIDInfo(g_id_adapter, &BssIdInfo);
get_bssid_list(parm, nParms, FALSE , &BssIdInfo );
strcpy(buffer, "NONE ");
}
- if (( 0 == memcmp(pBssid->MacAddress ,bssid->MacAddress,sizeof(OS_802_11_MAC_ADDRESS)) ) &&
+ if (( 0 == memcmp(pBssid->MacAddress ,bssid->MacAddress,sizeof(OS_802_11_MAC_ADDRESS)) ) &&
(pBssid->NetworkTypeInUse == bssid->NetworkTypeInUse))
{
/*bssid->Rssi = staRssi ;*/
if (fullBssidList)
{
- console_printf_terminal(" TSF 0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x\n",
- bssid->IEs[0], bssid->IEs[1], bssid->IEs[2], bssid->IEs[3],
+ console_printf_terminal(" TSF 0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x\n",
+ bssid->IEs[0], bssid->IEs[1], bssid->IEs[2], bssid->IEs[3],
bssid->IEs[4], bssid->IEs[5], bssid->IEs[6], bssid->IEs[7]);
console_printf_terminal(" BeaconInterval 0x%02x%02x\n", bssid->IEs[9], bssid->IEs[8]);
console_printf_terminal(" Capabilities 0x%02x%02x\n", bssid->IEs[10], bssid->IEs[11]);
OS_802_11_MAC_ADDRESS MacAddress;
PACKED_UNION(Union,
tiUINT8 Reserved[2];
- tiUINT16 Capabilities;
+ tiUINT16 Capabilities;
);
OS_802_11_SSID Ssid;
tiUINT32 Privacy;
pBssid->Length = sizeof(OS_802_11_BSSID_EX) + sizeof(OS_802_11_FIXED_IEs) + MAX_BEACON_BODY_LENGTH;
if( TI_GetPrimaryBSSIDInfo(g_id_adapter, (OS_802_11_BSSID_EX*)pBssid))
return ;
-
+
console_printf_terminal("Primary BssId: Length = %d, IELength=%d \n" , pBssid->Length, pBssid->IELength);
if (pBssid->Length > sizeof(OS_802_11_BSSID_EX) + sizeof(OS_802_11_FIXED_IEs) + MAX_BEACON_BODY_LENGTH)
{
console_printf_terminal("Error - IELength = %d is too long!!\n", pBssid->IELength);
pBssid->IELength = 50;
- print_mac_2_str(pBssid->MacAddress),
+ print_mac_2_str(pBssid->MacAddress),
console_printf_terminal("SSID len=%d\n", pBssid->Ssid.SsidLength);
console_printf_terminal("%17s %7s %4s %5s %7s %10s %s\n", "MAC", "Privacy", "Rssi", "Infra", "Channel","Qos ", "SSID");
Qos = parseBssidIe((OS_802_11_BSSID_EX*)pBssid);
- if (Qos & dot11_WME_OUI_TYPE)
- {
- strcpy(buffer, "WME ");
- }
-
- if (Qos == 0)
- {
- strcpy(buffer, "NONE ");
- }
-
- console_printf_terminal("%s %7u %4d %5d %7d %10s %s\n",
- print_mac_2_str(pBssid->MacAddress),
- pBssid->Privacy, pBssid->Rssi,
- pBssid->InfrastructureMode, Freq2Chan(pBssid->Configuration.Union.channel),
- buffer,
- get_ssid_string(&pBssid->Ssid) );
-
- {
- console_printf_terminal(" TSF 0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x\n",
- pBssid->IEs[0], pBssid->IEs[1], pBssid->IEs[2], pBssid->IEs[3],
- pBssid->IEs[4], pBssid->IEs[5], pBssid->IEs[6], pBssid->IEs[7]);
- console_printf_terminal(" BeaconInterval 0x%02x%02x\n", pBssid->IEs[9], pBssid->IEs[8]);
- console_printf_terminal(" Capabilities 0x%02x%02x\n", pBssid->IEs[10], pBssid->IEs[11]);
- console_printf_terminal(" Variable IEs:\n");
- for (index=12; index<pBssid->IELength; index++)
- {
- if ((index-12)%8 == 0)
- {
- console_printf_terminal("\n ");
- }
- console_printf_terminal("0x%02x ",pBssid->IEs[index]);
-
- }
- console_printf_terminal("\n");
- }
+ if (Qos & dot11_WME_OUI_TYPE)
+ {
+ strcpy(buffer, "WME ");
+ }
+
+ if (Qos == 0)
+ {
+ strcpy(buffer, "NONE ");
+ }
+
+ console_printf_terminal("%s %7u %4d %5d %7d %10s %s\n",
+ print_mac_2_str(pBssid->MacAddress),
+ pBssid->Privacy, pBssid->Rssi,
+ pBssid->InfrastructureMode, Freq2Chan(pBssid->Configuration.Union.channel),
+ buffer,
+ get_ssid_string(&pBssid->Ssid) );
+
+ {
+ console_printf_terminal(" TSF 0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x-0x%02x\n",
+ pBssid->IEs[0], pBssid->IEs[1], pBssid->IEs[2], pBssid->IEs[3],
+ pBssid->IEs[4], pBssid->IEs[5], pBssid->IEs[6], pBssid->IEs[7]);
+ console_printf_terminal(" BeaconInterval 0x%02x%02x\n", pBssid->IEs[9], pBssid->IEs[8]);
+ console_printf_terminal(" Capabilities 0x%02x%02x\n", pBssid->IEs[10], pBssid->IEs[11]);
+ console_printf_terminal(" Variable IEs:\n");
+ for (index=12; index<pBssid->IELength; index++)
+ {
+ if ((index-12)%8 == 0)
+ {
+ console_printf_terminal("\n ");
+ }
+ console_printf_terminal("0x%02x ",pBssid->IEs[index]);
+
+ }
+ console_printf_terminal("\n");
+ }
console_printf_terminal("\nInfra.mode:");
print_available_values(BSS_type);
}
struct report_bit_desc_t report[] =
{
-
- /* Set 0 */
+
+ /* Set 0 */
{ CONFIG_MGR_MODULE_LOG, "CONFIG_MGR" },
{ SME_SM_MODULE_LOG, "SME_SM" },
{ SITE_MGR_MODULE_LOG, "SITE_MGR" },
{
int i;
tiUINT8 module_table[WLAN_MAX_LOG_MODULES];
-
+
if (!TI_GetReportModule(g_id_adapter, module_table))
{
console_printf_terminal("-------------------------------\n");
console_printf_terminal("%.5s\tState\t %s\n", "Index", "Desc");
-
+
for( i = 0; i < SIZE_ARR(report); i++)
{
/* Check if there is string content (the first character is not ZERO) */
void cmd_report_add(ConParm_t parm[], U16 nParms)
{
tiUINT8 module_table[WLAN_MAX_LOG_MODULES];
-
+
if( nParms != 1)
{
print_report_module_desc();
void cmd_report_clear(ConParm_t parm[], U16 nParms)
{
tiUINT8 module_table[WLAN_MAX_LOG_MODULES + 1];
-
+
if( nParms != 1)
{
print_report_module_desc();
}
else if(!TI_GetReportModule(g_id_adapter, module_table))
{
- if (parm[0].value == WLAN_MAX_LOG_MODULES)
+ if (parm[0].value == WLAN_MAX_LOG_MODULES)
{
memset(module_table, '0', WLAN_MAX_LOG_MODULES);
}
else if (parm[0].value < WLAN_MAX_LOG_MODULES)
{
- module_table[parm[0].value] = '0';
+ module_table[parm[0].value] = '0';
}
TI_SetReportModule(g_id_adapter, module_table);
}
{
U8 *ModuleTable = (U8 *)parm[0].value;
- if( nParms != 1)
+ if( nParms != 1)
{
print_report_module_desc();
}
tiUINT8 SeverityTable[WLAN_MAX_SEVERITIES];
#ifdef _WINDOWS
#endif /* _WINDOWS */
- if( nParms != 1)
+ if( nParms != 1)
{
if (!TI_GetReportSeverity( g_id_adapter, &SeverityTable[0]))
{
/* The bit is disabled - Enable it */
SeverityTable[parm[0].value] = '1';
}
-
+
TI_SetReportSeverity(g_id_adapter, SeverityTable);
}
else
{
char buf[PSK_BUFF_LEN], *pPassphrase;
unsigned int len, is_hex_key = 0;
-
-
+
+
if( nParms == 0 )
return;
pPassphrase = (char*)(parm[0].value);
memset(buf,0,PSK_BUFF_LEN);
-
+
if( nParms >= 2 )
- {
+ {
#ifdef _WINDOWS
#else
if( !stricmp((char *) parm[1].value, "hex") )
{
console_printf_terminal("The hexa PSKPassphrase must be at length of %d hexa digits \n",PSK_HEXA_LENGTH);
return ;
- }
+ }
}
else
{
}
memcpy(buf, (char*)(parm[0].value), len);
-
+
/*TI_SetPSKPassPhrase*/
TI_SetPSK(g_id_adapter, (tiCHAR *)buf);
}
/************** Roaming Manager functions ******************/
void cmd_Roaming_enable(ConParm_t parm[], U16 nParms)
-{
+{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- roamingMngrConfigParams.roamingMngrConfig.enableDisable = ROAMING_ENABLED;
+ roamingMngrConfigParams.roamingMngrConfig.enableDisable = ROAMING_ENABLED;
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
console_printf_terminal("Roaming is enabled \n");
}
void cmd_Roaming_disable(ConParm_t parm[], U16 nParms)
-{
+{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- roamingMngrConfigParams.roamingMngrConfig.enableDisable = ROAMING_DISABLED;
+ roamingMngrConfigParams.roamingMngrConfig.enableDisable = ROAMING_DISABLED;
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
console_printf_terminal("Roaming is disabled \n");
}
void cmd_Roaming_lowPassFilter(ConParm_t parm[], U16 nParms)
-{
+{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- if( nParms != 0 )
- {
+ if( nParms != 0 )
+ {
roamingMngrConfigParams.roamingMngrConfig.lowPassFilterRoamingAttempt = (UINT16) parm[0].value;
- }
+ }
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Time in sec to wait before low quality Roaming Triggers, \n lowPassFilterRoamingAttempt = %d sec\n",
+ console_printf_terminal("Time in sec to wait before low quality Roaming Triggers, \n lowPassFilterRoamingAttempt = %d sec\n",
roamingMngrConfigParams.roamingMngrConfig.lowPassFilterRoamingAttempt);
}
void cmd_Roaming_qualityIndicator(ConParm_t parm[], U16 nParms)
-{
+{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- if( nParms != 0 )
- {
- roamingMngrConfigParams.roamingMngrConfig.apQualityThreshold = (S8) parm[0].value;
- }
+ if( nParms != 0 )
+ {
+ roamingMngrConfigParams.roamingMngrConfig.apQualityThreshold = (S8) parm[0].value;
+ }
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Quality indicator (RSSI) to be used when comparing AP List matching quality, \n apQualityThreshold = %d \n",
+ console_printf_terminal("Quality indicator (RSSI) to be used when comparing AP List matching quality, \n apQualityThreshold = %d \n",
(roamingMngrConfigParams.roamingMngrConfig.apQualityThreshold));
}
-void cmd_Roaming_dataRetryThreshold(ConParm_t parm[], U16 nParms)
+void cmd_Roaming_dataRetryThreshold(ConParm_t parm[], U16 nParms)
{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
if( nParms != 0 )
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("dataRetryThreshold = %d \n",
+ console_printf_terminal("dataRetryThreshold = %d \n",
roamingMngrConfigParams.roamingMngrThresholdsConfig.dataRetryThreshold);
}
-void cmd_Roaming_numExpectedTbttForBSSLoss(ConParm_t parm[], U16 nParms)
+void cmd_Roaming_numExpectedTbttForBSSLoss(ConParm_t parm[], U16 nParms)
{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
if( nParms != 0 )
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Number of expected TBTTs for BSS Loss event, \n numExpectedTbttForBSSLoss = %d \n",
+ console_printf_terminal("Number of expected TBTTs for BSS Loss event, \n numExpectedTbttForBSSLoss = %d \n",
roamingMngrConfigParams.roamingMngrThresholdsConfig.numExpectedTbttForBSSLoss);
}
-void cmd_Roaming_txRateThreshold(ConParm_t parm[], U16 nParms)
+void cmd_Roaming_txRateThreshold(ConParm_t parm[], U16 nParms)
{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
if( nParms != 0 )
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("txRateThreshold = %d \n",
+ console_printf_terminal("txRateThreshold = %d \n",
roamingMngrConfigParams.roamingMngrThresholdsConfig.txRateThreshold);
}
-void cmd_Roaming_lowRssiThreshold(ConParm_t parm[], U16 nParms)
+void cmd_Roaming_lowRssiThreshold(ConParm_t parm[], U16 nParms)
{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
if( nParms != 0 )
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("lowRssiThreshold = %d \n",
+ console_printf_terminal("lowRssiThreshold = %d \n",
(roamingMngrConfigParams.roamingMngrThresholdsConfig.lowRssiThreshold));
}
-void cmd_Roaming_lowSnrThreshold(ConParm_t parm[], U16 nParms)
+void cmd_Roaming_lowSnrThreshold(ConParm_t parm[], U16 nParms)
{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
if( nParms != 0 )
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
console_printf_terminal("lowSnrThreshold = %d \n", roamingMngrConfigParams.roamingMngrThresholdsConfig.lowSnrThreshold);
}
-void cmd_Roaming_lowQualityForBackgroungScanCondition(ConParm_t parm[], U16 nParms)
+void cmd_Roaming_lowQualityForBackgroungScanCondition(ConParm_t parm[], U16 nParms)
{
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
if( nParms != 0 )
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Indicator used to increase the background scan period when quality is low, \n lowQualityForBackgroungScanCondition = %d \n",
+ console_printf_terminal("Indicator used to increase the background scan period when quality is low, \n lowQualityForBackgroungScanCondition = %d \n",
(roamingMngrConfigParams.roamingMngrThresholdsConfig.lowQualityForBackgroungScanCondition));
}
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Indicator used to reduce the background scan period when quality is normal, \n normalQualityForBackgroungScanCondition = %d \n",
+ console_printf_terminal("Indicator used to reduce the background scan period when quality is normal, \n normalQualityForBackgroungScanCondition = %d \n",
(roamingMngrConfigParams.roamingMngrThresholdsConfig.normalQualityForBackgroungScanCondition));
}
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Rssi Filter Weight = %d \n",
+ console_printf_terminal("Rssi Filter Weight = %d \n",
(roamingMngrConfigParams.roamingMngrThresholdsConfig.rssiFilterWeight));
}
}
TI_SetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
- console_printf_terminal("Snr FIlter Weight = %d \n",
+ console_printf_terminal("Snr FIlter Weight = %d \n",
(roamingMngrConfigParams.roamingMngrThresholdsConfig.snrFilterWeight));
}
TI_GetRoamingConfiguration (g_id_adapter, (UINT8*)&roamingMngrConfigParams, sizeof(roamingMngrConfigParams_t));
console_printf_terminal("Roaming is: %s \n", roamingMngrConfigParams.roamingMngrConfig.enableDisable ? "Enabled" : "Disabled");
- console_printf_terminal("lowPassFilterRoamingAttempt = %d sec, apQualityThreshold = %d\n",
+ console_printf_terminal("lowPassFilterRoamingAttempt = %d sec, apQualityThreshold = %d\n",
roamingMngrConfigParams.roamingMngrConfig.lowPassFilterRoamingAttempt,
roamingMngrConfigParams.roamingMngrConfig.apQualityThreshold);
console_printf_terminal("Roaming Triggers' thresholds are: \n");
console_printf_terminal("dataRetryThreshold = %d, lowQualityForBackgroungScanCondition = %d, \
lowRssiThreshold = %d, lowSnrThreshold = %d, normalQualityForBackgroungScanCondition = %d, \
-numExpectedTbttForBSSLoss = %d, txRateThreshold = %d \n",
+numExpectedTbttForBSSLoss = %d, txRateThreshold = %d \n",
roamingMngrConfigParams.roamingMngrThresholdsConfig.dataRetryThreshold,
roamingMngrConfigParams.roamingMngrThresholdsConfig.lowQualityForBackgroungScanCondition,
roamingMngrConfigParams.roamingMngrThresholdsConfig.lowRssiThreshold,
void cmd_bt_coe_get_status(ConParm_t parm[], U16 nParms)
{
U32 Values[NUM_OF_STATUS_PARAMS_IN_SG];
- /* The print is done inside the module */
- console_printf_terminal("Done by driver - ");
- if( TI_SetBtCoeGetStatus(g_id_adapter,(tiUINT32 *) Values) == OK ) {
- console_printf_terminal("Ok\n");
-/* console_printf_terminal("BT Coxistence status: \n\n");
+ /* The print is done inside the module */
+ TI_SetBtCoeGetStatus(g_id_adapter,(tiUINT32 *) Values);
+/* {
+ console_printf_terminal("BT Coxistence status: \n\n");
console_printf_terminal("Enable: %d\n", Values[0]);
console_printf_terminal("Rate: %d\n", Values[1]);
console_printf_terminal("BtSignaling: %d\n", Values[2]);
console_printf_terminal("WlanSlowAPMaxCTS: %d\n", Values[10]);
console_printf_terminal("WlanSlowAPMaxTimeToCTS: %d\n", Values[11]);
console_printf_terminal("T8_temporary: %d\n", Values[12]);
- console_printf_terminal("BTtoWLANSwitchTime: %d\n", Values[13]); */
+ console_printf_terminal("BTtoWLANSwitchTime: %d\n", Values[13]);
}
else
{
- console_printf_terminal("Fail\n");
-/* console_printf_terminal("Error reading status!\n"); */
- }
+ console_printf_terminal("Error reading status!\n");
+ }*/
}
-
+
void cmd_PLT_RxPerStart(ConParm_t parm[], U16 nParms)
{
UINT32 Status = TI_PLT_RxPerStart(g_id_adapter);
console_printf_terminal("Plt RX counters start failed\n");
}
-void cmd_PLT_RxPerStop(ConParm_t parm[], U16 nParms)
+void cmd_PLT_RxPerStop(ConParm_t parm[], U16 nParms)
{
UINT32 Status = TI_PLT_RxPerStop(g_id_adapter);
if (Status == OK)
{
PltRxPer_t PltRxPer;
UINT32 Status = TI_PLT_RxPerGetResults(g_id_adapter, &PltRxPer);
-
+
if (Status == OK)
{
console_printf_terminal("FCSErrorCount = %d\n", PltRxPer.FCSErrorCount);
console_printf_terminal("Plt RX counters Get results failed\n");
}
-void cmd_PLT_RegisterRead(ConParm_t parm[], U16 nParms)
+void cmd_PLT_RegisterRead(ConParm_t parm[], U16 nParms)
{
tiUINT32 RegAddress;
tiUINT32 RegValue;
/* Converting hex string to tiUINT32*/
pTmp = (char*)parm[0].value;
sscanf(pTmp , "%x", &RegAddress);
-
+
/*Call the API function */
Status = TI_PLT_ReadRegister(g_id_adapter, RegAddress, &RegValue);
if( Status == OK )
console_printf_terminal("Reg. %#lx = %#x (%d)\n", RegAddress, RegValue, RegValue );
}
-void cmd_PLT_RegisterWrite(ConParm_t parm[], U16 nParms)
+void cmd_PLT_RegisterWrite(ConParm_t parm[], U16 nParms)
{
tiUINT32 RegAddress;
tiUINT32 RegValue = 0;
tiUINT32 Status;
char* pTmp;
-
+
/* Converting hex string to tiUINT32*/
printf("cmd_PLT_RegisterWrite\n");
pTmp = (char*)parm[0].value;
sscanf(pTmp, "%x", &RegAddress);
pTmp = (char*)parm[1].value;
- sscanf(pTmp , "%x", &RegValue);
+ sscanf(pTmp , "%x", &RegValue);
printf("cmd_PLT_RegisterWrite %x %x\n", RegAddress, RegValue);
-
+
/*Call the API function */
Status = TI_PLT_WriteRegister(g_id_adapter, RegAddress, RegValue );
if (Status == OK)
console_printf_terminal("Plt register 0x%x is set to 0x%x OK.\n", RegAddress, RegValue);
else
console_printf_terminal("Plt register 0x%x is set to 0x%x NOK.\n", RegAddress, RegValue);
-
+
}
PltTxContinues.aSeqNumMode = parm[7].value;
PltTxContinues.aPacketLength = parm[8].value;
hexStr2MACAddr( (char*)parm[9].value, &(PltTxContinues.aPeerMacAddr) );
-
+
Status = TI_PLT_TxContiues(g_id_adapter, &PltTxContinues);
if (Status == OK)
}
}
-void cmd_PLT_TxStop(ConParm_t parm[], U16 nParms)
+void cmd_PLT_TxStop(ConParm_t parm[], U16 nParms)
{
UINT32 Status = TI_PLT_TxStop(g_id_adapter);
if (Status == OK)
console_printf_terminal("NOK\n");
}
-void cmd_PLT_MIB_CounterTable(ConParm_t parm[], U16 nParms)
+void cmd_PLT_MIB_CounterTable(ConParm_t parm[], U16 nParms)
{
PLT_MIB_t Mib;
UINT32 Status;
}
}
-void cmd_PLT_MIB_StationID(ConParm_t parm[], U16 nParms)
+void cmd_PLT_MIB_StationID(ConParm_t parm[], U16 nParms)
{
PLT_MIB_t Mib;
UINT32 Status;
memset(&Mib, 0, sizeof(Mib));
Mib.aMib = PLT_MIB_ctsToSelf;
- if (nParms != 1)
+ if (nParms != 1)
{
console_printf_terminal("CTS to self: [0 - Disable, 1 - Enable]\n");
}
{
Status = TI_PLT_ReadMIB(g_id_adapter, &Mib);
if (OK == Status)
- console_printf_terminal("ctsToSelf = %s (%d)\n",
+ console_printf_terminal("ctsToSelf = %s (%d)\n",
Mib.aData.CTSToSelfEnable?"Enable":"Disable",
Mib.aData.CTSToSelfEnable);
}
{
int FilteringEnable = Mib.aData.ArpIpAddressesTable.FilteringEnable;
console_printf_terminal("ARP IP Table:\n");
- console_printf_terminal("FilteringEnable: %s (%d)\n",
+ console_printf_terminal("FilteringEnable: %s (%d)\n",
FilteringEnable?"Enable":"Disable",
FilteringEnable);
- console_printf_terminal("ArpIpAddress: %d.%d.%d.%d\n",
+ console_printf_terminal("ArpIpAddress: %d.%d.%d.%d\n",
Mib.aData.ArpIpAddressesTable.addr[0],
Mib.aData.ArpIpAddressesTable.addr[1],
Mib.aData.ArpIpAddressesTable.addr[2],
int i;
console_printf_terminal("Group addresses Table:\n");
- console_printf_terminal("FilteringEnable: %s (%d)\n",
+ console_printf_terminal("FilteringEnable: %s (%d)\n",
FilteringEnable?"Enable":"Disable",
FilteringEnable);
console_printf_terminal("nNumberOfAddresses: %d\n", Mib.aData.GroupAddressTable.nNumberOfAddresses);
{
UINT32 Status;
PltGainGet_t PLTGainGet;
-
+
Status = TI_PLT_TxCalGainGet(g_id_adapter, &PLTGainGet);
if (Status == OK)
{
console_printf_terminal("TxLowerBound: %d(0x%x)\n", PLTGainGet.TxLowerBound, PLTGainGet.TxLowerBound);
}
else
- console_printf_terminal("NOK\n");
+ console_printf_terminal("NOK\n");
}
UINT32 GainChange;
OS_802_11_POWER_LEVELS mode;
-
+
if ((nParms == 0) || (nParms > 1))
{
console_printf_terminal("\n");
}
else
{
- console_printf_terminal("Gain Adjust was not performed becouse Default power-mode is not AWAKE\n");
+ console_printf_terminal("Gain Adjust was not performed becouse Default power-mode is not AWAKE\n");
console_printf_terminal("Please change defaultPowerLevel parametr in tiwlan.ini file first\n");
}
}
}
else
{
- /* use U8 cast to fix compile warning */
- tTxStart.refTxPower = (U8)parm[0].value;
+ /* use U8 cast to fix compile warning */
+ tTxStart.refTxPower = (U8)parm[0].value;
Status = TI_PLT_TxCalStart(g_id_adapter,&tTxStart);
if (Status == OK)
console_printf_terminal("OK\n");
UINT32 Status;
PltNvsResultsBuffer_t PltNvsResultsBuffer;
int i;
-
+
memset(&PltNvsResultsBuffer, 0, sizeof(PltNvsResultsBuffer));
Status = TI_PLT_RxTxCalNVSUpdateBuffer(g_id_adapter, &PltNvsResultsBuffer);
if (Status == OK)
console_printf_terminal("#%d\t %p\t %.4d\t ",
i,
PltNvsResultsBuffer.tables[i].offset,
- PltNvsResultsBuffer.tables[i].size);
+ PltNvsResultsBuffer.tables[i].size);
for (j=0; (j<PltNvsResultsBuffer.tables[i].size) && (j<NVS_RESULTS_MAX_UPDATE_TABLE_SIZE); j++)
{
console_printf_terminal("%.2x ", PltNvsResultsBuffer.tables[i].data[j]);
}
}
else
- console_printf_terminal("NOK\n");
+ console_printf_terminal("NOK\n");
}
void cmd_PLT_RxCal(ConParm_t parm[], U16 nParms)
{
UINT32 Status;
- PltRxCalibrationRequest_t PltRxCalibrationRequest;
+ PltRxCalibrationRequest_t PltRxCalibrationRequest;
OS_802_11_POWER_LEVELS mode;
if ((nParms == 0) || (nParms > 5))
}
else
{
- console_printf_terminal("Rx calibration was not performed becouse Default power-mode is not AWAKE\n");
+ console_printf_terminal("Rx calibration was not performed becouse Default power-mode is not AWAKE\n");
console_printf_terminal("Please change defaultPowerLevel parametr in tiwlan.ini file first\n");
}
}
}
else
{
- console_printf_terminal("Radio tune was not performed becouse Default power-mode is not AWAKE\n");
+ console_printf_terminal("Radio tune was not performed becouse Default power-mode is not AWAKE\n");
console_printf_terminal("Please change defaultPowerLevel parametr in tiwlan.ini file first\n");
}
}
#ifdef _WINDOWS
+ void cmd_SetRedirectToTiconFlag(ConParm_t parm[])
+ {
+ TI_Set_RedirectToTiconFlag(g_id_adapter, parm->value);
+ }
#endif /* ifdef _WINDOWS */
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
#ifndef _WINDOWS
#include <unistd.h>
#include <sys/socket.h>
-#include <linux/if.h>
+
+#include <linux/types.h> //jorjin
+#include <linux/if.h> //jorjin
#include <linux/wireless.h>
#endif /* __LINUX__ */
void cmd_set_Default_PowerLevel(ConParm_t parm[], U16 nParms);
void cmd_set_DozeModeInAutoPowerLevel(ConParm_t parm[], U16 nParms);
void cmd_set_min_power_level_boundary(ConParm_t parm[], U16 nParms);
-
+
void cmd_events_register(ConParm_t parm[], U16 nParms);
void cmd_events_unregister(ConParm_t parm[], U16 nParms);
void cmd_Roaming_qualityIndicator(ConParm_t parm[], U16 nParms);
void cmd_Roaming_getConfParams(ConParm_t parm[], U16 nParms);
-void cmd_Roaming_dataRetryThreshold(ConParm_t parm[], U16 nParms);
-void cmd_Roaming_numExpectedTbttForBSSLoss(ConParm_t parm[], U16 nParms);
-void cmd_Roaming_txRateThreshold(ConParm_t parm[], U16 nParms);
+void cmd_Roaming_dataRetryThreshold(ConParm_t parm[], U16 nParms);
+void cmd_Roaming_numExpectedTbttForBSSLoss(ConParm_t parm[], U16 nParms);
+void cmd_Roaming_txRateThreshold(ConParm_t parm[], U16 nParms);
void cmd_Roaming_lowSnrThreshold(ConParm_t parm[], U16 nParms);
-void cmd_Roaming_lowRssiThreshold(ConParm_t parm[], U16 nParms);
-void cmd_Roaming_lowQualityForBackgroungScanCondition(ConParm_t parm[], U16 nParms);
+void cmd_Roaming_lowRssiThreshold(ConParm_t parm[], U16 nParms);
+void cmd_Roaming_lowQualityForBackgroungScanCondition(ConParm_t parm[], U16 nParms);
void cmd_Roaming_normalQualityForBackgroungScanCondition(ConParm_t parm[], U16 nParms);
void cmd_Roaming_rssiFilterWeight(ConParm_t parm[], U16 nParms);
void cmd_Roaming_snrFilterWeight(ConParm_t parm[], U16 nParms);
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
#include <sys/stat.h>
#include <unistd.h>
+//#include <linux/types.h> //jorjin
+//#include <linux/if.h> //jorjin
#include "g_tester.h"
#include "console.h"
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
#ifdef _WINDOWS
#else /* __LINUX__ */
+
+#include <stddef.h> //jorjin
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <linux/if.h>
+
+#include <linux/types.h> //jorjin
+#include <linux/if.h> //jorjin
+#include <linux/socket.h> //jorjin
#include <linux/wireless.h>
-#include <stdarg.h>
+#include <stdarg.h>
#include <sys/socket.h>
#include <linux/in.h>
#include "ipc.h"
/************************************************************************
* console_printf_terminal *
************************************************************************
-DESCRIPTION: Sends a text message to host
+DESCRIPTION: Sends a text message to host
-CONTEXT: Any process, the 'p_shared_memory' points
+CONTEXT: Any process, the 'p_shared_memory' points
to the shared memory block
************************************************************************/
int console_printf_terminal(const char *arg_list ,...)
va_list ap;
tiUINT8 msg[MAX_HOST_MESSAGE_SIZE];
int message_length;
-
+
/***********************/
/* Format the message */
/*********************/
/************************************************************************
* console_send_buffer_to_host *
************************************************************************
-DESCRIPTION: Sends a text message to host
+DESCRIPTION: Sends a text message to host
-CONTEXT: Any process, the 'p_shared_memory' points
+CONTEXT: Any process, the 'p_shared_memory' points
to the shared memory block
************************************************************************/
int console_send_buffer_to_host(tiUINT8 module_inedx, tiUINT8 *buffer, tiUINT16 length)
{
/***********************/
/* Output to ethernet */
- /*********************/
-
+ /*********************/
+
/* Prepare the header */
protocol_header[0] = 'W'; /* Ethernet protocol Prefix */
- protocol_header[1] = length & 0xFF; /* Message size (first byte) */
+ protocol_header[1] = length & 0xFF; /* Message size (first byte) */
protocol_header[2] = (length >> 8) & 0xFF; /* Message size (second byte) */
/* Send the header */
/***********************/
/* OUTPUT to mux UART */
/*********************/
-
+
/* Write the protocol prefix */
protocol_header[0] = (28 << 3);
protocol_header[1] = length;
fwrite(protocol_header, 1, MUX_UART_PROTOCOL_PREFIX_SIZE, stdout);
-
+
/* Write the message */
fwrite(buffer, 1, length, stdout);
-
+
return_size = (MUX_UART_PROTOCOL_PREFIX_SIZE + length);
}
else
}
#endif /* __LINUX__ */
-
+
#ifdef _WINDOWS
#endif /* WINDOWS */
}
-
+
/* b-only, g-only, b&g mode, a-only, a&g mode b-plus-mode */
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) h, "Antenna", "tx/rx selected antenna" ) );
{
- ConParm_t aaa[] = { { "Enable RX diversity", CON_PARM_RANGE, 0, 1, 0 },
+ ConParm_t aaa[] = { { "Enable RX diversity", CON_PARM_RANGE, 0, 1, 0 },
{ "RX selected antenna", CON_PARM_RANGE, 1, 2, 2 },
- { "Enable TX diversity", CON_PARM_RANGE, 0, 1, 0 },
+ { "Enable TX diversity", CON_PARM_RANGE, 0, 1, 0 },
{ "TX selected antenna", CON_PARM_RANGE, 1, 2, 2 },
{ "Share RX and TX antennas", CON_PARM_RANGE, 0, 1, 1 },
CON_LAST_PARM };
consoleAddToken(h2, "Enable", "Enable Rx Data Filtering", (FuncToken_t) cmd_enable_rx_data_filters, NULL );
consoleAddToken(h2, "Disable", "Enable Rx Data Filtering", (FuncToken_t) cmd_disable_rx_data_filters, NULL );
{
- ConParm_t aaa[] =
+ ConParm_t aaa[] =
{
{ "Offset", CON_PARM_RANGE, 0, 255, 0 },
{ "Mask", CON_PARM_STRING, 0, 64, 0 },
consoleAddToken(h2, "Add", "Add Rx Data Filter", (FuncToken_t) cmd_add_rx_data_filter, aaa );
}
{
- ConParm_t aaa[] =
+ ConParm_t aaa[] =
{
{ "Offset", CON_PARM_RANGE, 0, 255, 0 },
{ "Mask", CON_PARM_STRING, 0, 64, 0 },
consoleAddToken(h, "Tx statistics", "Show tx statistics", (FuncToken_t) cmd_show_tx_statistics, aaa );
}
consoleAddToken(h, "Advanced", "Show advanced params", (FuncToken_t) cmd_show_advanced_params, NULL );
-
+
consoleAddToken(h, "Power consumption", "Show power consumption statistics", (FuncToken_t) cmd_show_power_consumption_stats, NULL );
-
+
/* -------------------------------------------- Privacy -------------------------------------------- */
CHK_NULL(h = (handle_t) consoleAddDirExt( (handle_t) NULL, "Privacy", "Privacy configuration" ) );
CON_LAST_PARM };
consoleAddToken(h, "Credentials", "Set Credentials ", (FuncToken_t)cmd_privacy_credent, aaa);
}
- {
+ {
ConParm_t aaa[] =
{
- { "Passphrase", CON_PARM_STRING, MIN_PSK_STRING_LENGTH, MAX_PSK_STRING_LENGTH, 0},
+ { "Passphrase", CON_PARM_STRING, MIN_PSK_STRING_LENGTH, MAX_PSK_STRING_LENGTH, 0},
{ "key type (hex | text) [text]", CON_PARM_OPTIONAL | CON_PARM_STRING, 0, 5, 0},
CON_LAST_PARM
};
}
consoleAddToken(h1, "cLear", "Clear All Params", (FuncToken_t) cmd_Scan_app_clear, NULL );
consoleAddToken(h1, "Display", "Display Params", (FuncToken_t) cmd_Scan_app_display, NULL );
-
+
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) h, "configPolicy", "Configure scan manager scan policy" ) );
{
ConParm_t aaa[] = {
CON_LAST_PARM };
consoleAddToken(h1, "Gloabal", "Set Global policy Params", (FuncToken_t) cmd_Scan_policy_global_config, aaa );
}
-
+
CHK_NULL(h2 = (handle_t) consoleAddDirExt( (handle_t) h1, "Band", "Configure band scan policy" ) );
{
ConParm_t aaa[] = {
{ "Probe req. rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
{ "TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
- CON_LAST_PARM };
+ CON_LAST_PARM };
consoleAddToken(h2, "Track", "Set tracking method params", (FuncToken_t) cmd_Scan_band_track_config, aaa );
}
{
{ "Probe req. rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
{ "TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
- CON_LAST_PARM };
+ CON_LAST_PARM };
consoleAddToken(h2, "Discovery", "Set Discovery method params", (FuncToken_t) cmd_Scan_band_discover_config, aaa );
}
{
{ "Probe req. rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
{ "TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
- CON_LAST_PARM };
+ CON_LAST_PARM };
consoleAddToken(h2, "Immediate", "Set Immediate method params", (FuncToken_t) cmd_Scan_band_immed_config, aaa );
}
-
+
consoleAddToken(h1, "Display", "Display Policy Params", (FuncToken_t) cmd_Scan_policy_display, NULL );
consoleAddToken(h1, "Clear", "Clear Polciy Params", (FuncToken_t) cmd_Scan_policy_clear, NULL );
consoleAddToken(h1, "Store", "Send policy to scan manager", (FuncToken_t) cmd_Scan_policy_store, NULL );
consoleAddToken(h1, "Get", "Get TSPEC Params", (FuncToken_t) cmd_get_tspec_params, UPid );
}
{
- ConParm_t UPid[] = { { "UserPriority", CON_PARM_RANGE, 0, 7, 1 },
+ ConParm_t UPid[] = { { "UserPriority", CON_PARM_RANGE, 0, 7, 1 },
{ "ReasonCode", CON_PARM_RANGE, 32, 45, 32 }, CON_LAST_PARM };
consoleAddToken(h1, "Delete", "Delete TSPEC", (FuncToken_t) cmd_delete_tspec, UPid );
}
ConParm_t ACid[] = { { "AC", CON_PARM_RANGE, 0, 3, 3 }, CON_LAST_PARM };
consoleAddToken(h1, "ac Status", "Get Current AC Status", (FuncToken_t) cmd_get_ac_status, ACid );
}
-
+
{
ConParm_t MediumUsageParams[] = {
{ "AC", CON_PARM_RANGE, 0, 3, 3 },
CON_LAST_PARM };
consoleAddToken(h, "Set_dtag2ac_mapping_table ", "Set dtag2ac mapping table", (FuncToken_t) cmd_set_dtag_to_ac_mapping_table, aaa );
}
-
+
{
ConParm_t aaa[] = {
{ "Enable", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 1, 0 },
consoleAddToken(h, "Max Rx Lifetime", "Max Rx Lifetime", (FuncToken_t) cmd_MaxRxLifetime_params, aaa );
}
+
+
-
-
-
+
/* -------------------------------------------- Power Management -------------------------------------------- */
-
+
CHK_NULL(h = (handle_t) consoleAddDirExt( (handle_t) NULL, "poWer", "Power Management" ) );
{
/* Set Power Mode Command */
{ "PowerSavePowerLevel", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 2, 2 }, /* Min/Max/Def */
CON_LAST_PARM };
consoleAddToken(h, "set_powersave_powerLevel", "Set the Power level during PowerSave", (FuncToken_t) cmd_set_PowerSave_PowerLevel, powerSavePowerLevelCmd );
-
+
}
{
/* Set default Power level Command */
{ "DefaultPowerLevel", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 2, 2 }, /* Min/Max/Def */
CON_LAST_PARM };
consoleAddToken(h, "set_deFault_powerlevel", "Set the default power level", (FuncToken_t) cmd_set_Default_PowerLevel, defaultPowerLevelCmd );
-
+
}
{
/* Set doze mode in auto power mode */
{ "DozeModeInAuto", CON_PARM_RANGE | CON_PARM_OPTIONAL, AUTO_POWER_MODE_DOZE_MODE_MIN_VALUE, AUTO_POWER_MODE_DOZE_MODE_MAX_VALUE, AUTO_POWER_MODE_DOZE_MODE_DEF_VALUE },
CON_LAST_PARM };
consoleAddToken(h, "set_doZe_mode_in_auto", "Set doze mode in auto power mode", (FuncToken_t) cmd_set_DozeModeInAutoPowerLevel, powerSaveDozeMode );
-
+
}
{
ConParm_t TrafficIntensityParams[] = {
}
consoleAddToken(h, "eNable", "enable traffic intensity events", (FuncToken_t) cmd_enable_traffic_events, NULL );
consoleAddToken(h, "Disable", "disable traffic intensity events", (FuncToken_t) cmd_disable_traffic_events, NULL );
-
+
/* -------------------------------------------- Events -------------------------------------------- */
CHK_NULL(h = (handle_t) consoleAddDirExt( (handle_t) NULL, "eVents", "Events" ) );
CHK_NULL(h = (handle_t) consoleAddDirExt( (handle_t) NULL, "Bt CoExsistance", "BT - Wlan CoExsistance" ) );
{
- ConParm_t aaa[] = { { "enable", CON_PARM_RANGE | CON_PARM_OPTIONAL,
+ ConParm_t aaa[] = { { "enable", CON_PARM_RANGE | CON_PARM_OPTIONAL,
SOFT_GEMINI_ENABLED_MIN, SOFT_GEMINI_ENABLED_MAX, 0 }, CON_LAST_PARM };
consoleAddToken(h, "Enable", "Enable BT Coexistense", (FuncToken_t) cmd_bt_coe_enable, aaa );
}
{
ConParm_t aaa[] = {
{ "wlanRxMinRateToRespectBtHp", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_WLAN_RX_MIN_RATE_MIN , SOFT_GEMINI_PARAMS_WLAN_RX_MIN_RATE_MAX, 0 },
- { "btHpMaxTime", CON_PARM_RANGE | CON_PARM_OPTIONAL,
+ SOFT_GEMINI_PARAMS_WLAN_RX_MIN_RATE_MIN , SOFT_GEMINI_PARAMS_WLAN_RX_MIN_RATE_MAX, 0 },
+ { "btHpMaxTime", CON_PARM_RANGE | CON_PARM_OPTIONAL,
SOFT_GEMINI_PARAMS_BT_HP_MAXTIME_MIN, SOFT_GEMINI_PARAMS_BT_HP_MAXTIME_MAX, 0 },
- { "wlanHpMaxTime", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
+ { "wlanHpMaxTime", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_WLAN_HP_MAX_TIME_MIN, SOFT_GEMINI_PARAMS_WLAN_HP_MAX_TIME_MAX, 0 },
- { "senseDisableTimer", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
+ { "senseDisableTimer", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_SENSE_DISABLE_TIMER_MIN, SOFT_GEMINI_PARAMS_SENSE_DISABLE_TIMER_MAX, 0 },
{ "protectiveRxTimeBeforeBtHp", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_PROTECTIVE_RX_TIME_MIN, SOFT_GEMINI_PARAMS_PROTECTIVE_RX_TIME_MAX, 0 },
{ "timeoutNextBtLpPacket", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_TIMEOUT_NEXT_BT_LP_PACKET_MIN, SOFT_GEMINI_PARAMS_TIMEOUT_NEXT_BT_LP_PACKET_MAX,0 },
{ "wakeUpTimeBeforeBeacon", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_TIME_BEFORE_BEACON_MIN , SOFT_GEMINI_PARAMS_TIME_BEFORE_BEACON_MAX, 0 },
+ SOFT_GEMINI_PARAMS_TIME_BEFORE_BEACON_MIN , SOFT_GEMINI_PARAMS_TIME_BEFORE_BEACON_MAX, 0 },
{ "hpdmMaxGuardTime", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_HPDM_MAX_TIME_MIN , SOFT_GEMINI_PARAMS_HPDM_MAX_TIME_MAX, 0 },
+ SOFT_GEMINI_PARAMS_HPDM_MAX_TIME_MIN , SOFT_GEMINI_PARAMS_HPDM_MAX_TIME_MAX, 0 },
{ "timeoutNextWlanPacket", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_TIME_OUT_NEXT_WLAN_MIN , SOFT_GEMINI_PARAMS_TIME_OUT_NEXT_WLAN_MAX, 0 },
+ SOFT_GEMINI_PARAMS_TIME_OUT_NEXT_WLAN_MIN , SOFT_GEMINI_PARAMS_TIME_OUT_NEXT_WLAN_MAX, 0 },
{ "sgAntennaType", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_SG_ANTENNA_TYPE_MIN, SOFT_GEMINI_PARAMS_SG_ANTENNA_TYPE_MAX , 0 },
- { "signalingType", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
+ { "signalingType", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_SIGNALING_TYPE_MIN, SOFT_GEMINI_PARAMS_SIGNALING_TYPE_MAX , 0 },
{ "afhLeverageOn", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_AFH_LEVERAGE_ON_MIN, SOFT_GEMINI_PARAMS_AFH_LEVERAGE_ON_MAX, 0 },
- { "numberQuietCycle", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
+ { "numberQuietCycle", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_NUMBER_QUIET_CYCLE_MIN, SOFT_GEMINI_PARAMS_NUMBER_QUIET_CYCLE_MAX , 0 },
{ "maxNumCts", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_MAX_NUM_CTS_MIN, SOFT_GEMINI_PARAMS_MAX_NUM_CTS_MAX, 0 },
{ "ackModeDuringBtLpInDualAnt", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
SOFT_GEMINI_PARAMS_ACK_MODE_MIN , SOFT_GEMINI_PARAMS_ACK_MODE_MAX, 0 },
{ "allowPaSdToggleDuringBtActivityEnable", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_ALLOW_PA_SD_MIN , SOFT_GEMINI_PARAMS_ALLOW_PA_SD_MAX, 0 },
+ SOFT_GEMINI_PARAMS_ALLOW_PA_SD_MIN , SOFT_GEMINI_PARAMS_ALLOW_PA_SD_MAX, 0 },
{ "sgAutoModeNoCts", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_AUTO_MODE_NO_CTS_MIN , SOFT_GEMINI_PARAMS_AUTO_MODE_NO_CTS_MAX, 0 },
+ SOFT_GEMINI_PARAMS_AUTO_MODE_NO_CTS_MIN , SOFT_GEMINI_PARAMS_AUTO_MODE_NO_CTS_MAX, 0 },
{ "numOfBtHpRespectedReq", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
- SOFT_GEMINI_PARAMS_BT_HP_RESPECTED_MIN , SOFT_GEMINI_PARAMS_BT_HP_RESPECTED_MAX, 0 },
+ SOFT_GEMINI_PARAMS_BT_HP_RESPECTED_MIN , SOFT_GEMINI_PARAMS_BT_HP_RESPECTED_MAX, 0 },
CON_LAST_PARM };
consoleAddToken(h, "Config", "Parameters configuration", (FuncToken_t) cmd_bt_coe_config, aaa );
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) NULL, "Report", "Debug features" ) );
{
- ConParm_t aaa[] =
- {
+ ConParm_t aaa[] =
+ {
{ "module table", CON_PARM_STRING | CON_PARM_OPTIONAL , WLAN_MAX_LOG_MODULES, WLAN_MAX_LOG_MODULES, 0 },
CON_LAST_PARM };
consoleAddToken(h1, "Set", "set report module table", (FuncToken_t) cmd_report_set, aaa );
}
{
- ConParm_t aaa[] =
- {
- { "module", CON_PARM_OPTIONAL, 0, 0, 0 },
- CON_LAST_PARM
+ ConParm_t aaa[] =
+ {
+ { "module", CON_PARM_OPTIONAL, 0, 0, 0 },
+ CON_LAST_PARM
};
consoleAddToken(h1, "Add", "set report for specified module", (FuncToken_t) cmd_report_add, aaa );
}
{
- ConParm_t aaa[] =
- {
- { "module", CON_PARM_OPTIONAL, 0, 0, 0 },
- CON_LAST_PARM
+ ConParm_t aaa[] =
+ {
+ { "module", CON_PARM_OPTIONAL, 0, 0, 0 },
+ CON_LAST_PARM
};
consoleAddToken(h1, "Clear", "clear report for specified module", (FuncToken_t) cmd_report_clear, aaa );
}
ConParm_t aaa[] = { { "osDbgState", CON_PARM_OPTIONAL , 0, 0, 0 }, CON_LAST_PARM };
consoleAddToken(h1, "Osdbgstate", "set OS abstraction layer debug dtate", (FuncToken_t) cmd_report_os_dbg_state, aaa );
}
-
+
/* -------------------------------------------- Debug -------------------------------------------- */
-
+
CHK_NULL(h = (handle_t) consoleAddDirExt( (handle_t) NULL, "dEbug", "Debug features" ) );
{
ConParm_t aaa[] = {{ "reg_num", 0, 0, 0, 0 },
{ "value", CON_PARM_OPTIONAL , 0, 0, 0 }, CON_LAST_PARM };
consoleAddToken(h, "Register", "read/write HW register", (FuncToken_t) cmd_hw_register, aaa );
}
-
+
{
ConParm_t aaa[] = {{ "func_num", CON_PARM_OPTIONAL, 0, 0, 0 },
{ "param", CON_PARM_OPTIONAL , 0, 0, 0 }, CON_LAST_PARM };
consoleAddToken(h, "print", "print driver debug info", (FuncToken_t) cmd_debug_driver_print, aaa );
}
-
-
+
+
{
ConParm_t aaa[] = { { "func_num", CON_PARM_OPTIONAL, 0, 0, 0 },
- { "string param", CON_PARM_LINE, 0, 128, 0 },
+ { "string param", CON_PARM_LINE, 0, 128, 0 },
CON_LAST_PARM };
consoleAddToken(h, "Buffer", "Pass the buffer to the driver", (FuncToken_t)cmd_debug_buffer_put, aaa );
}
consoleAddToken(h, "proFile report", "Show driver resource usage", (FuncToken_t) cmd_profile_report, NULL );
{
ConParm_t aaa[] = {{ "command_type", CON_PARM_DEFVAL | CON_PARM_RANGE, 1, 3, 3 },
- { "resolution", CON_PARM_OPTIONAL , 0, 0, 0 },
- CON_LAST_PARM
+ { "resolution", CON_PARM_OPTIONAL , 0, 0, 0 },
+ CON_LAST_PARM
};
consoleAddToken(h, "Cpu estimator command", "start/stop/reset cpu estimator", (FuncToken_t) cmd_profile_cpu_estimator_command, aaa );
}
-
+
#endif
-
+
#endif /*TI_DBG*/
/* -------------------------------------------- PLT -------------------------------------------- */
CON_LAST_PARM };
consoleAddToken(h1, "Write", "write register", (FuncToken_t) cmd_PLT_RegisterWrite, aaa );
}
-
+
{
ConParm_t aaa[] = {{ "Band", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 2, 0 },
{ "Channel", CON_PARM_OPTIONAL|CON_PARM_RANGE , 1, 161, 0 }, CON_LAST_PARM };
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) h, "rx Per", "RX PER test" ) );
{
ConParm_t aaa[] = {CON_LAST_PARM};
- consoleAddToken(h1, "Start", "Stop RX PER counters", (FuncToken_t) cmd_PLT_RxPerStart, aaa );
+ consoleAddToken(h1, "Start", "Stop RX PER counters", (FuncToken_t) cmd_PLT_RxPerStart, aaa );
consoleAddToken(h1, "stoP", "Stop RX PER counters", (FuncToken_t) cmd_PLT_RxPerStop, aaa );
consoleAddToken(h1, "Clear", "Clear RX PER counters", (FuncToken_t) cmd_PLT_RxPerClear, aaa );
consoleAddToken(h1, "Get", "Get RX PER counters", (FuncToken_t) cmd_PLT_RxPerGet, aaa );
}
-
+
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) h, "Tx", "TX test test" ) );
{
ConParm_t aaa[] = {{ "Band", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 2, 0 },
}
{
ConParm_t aaa[] = {{ "Band (0 - 2.4Ghz(B/G), 1 - 5Ghz(A), 2 - Japan(4.9Ghz))", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 2, 0 },
- { "Channel: (1..14(2.4Ghz), 1..180(5Ghz))", CON_PARM_OPTIONAL|CON_PARM_RANGE , 1, 161, 14 },
- { "Rate: 1-1M,2-2M,3-5.5M,4-11M,6-6M,7-9M,8-12M,9-18M.10-24M,11-36M,12-48M,13-54M", CON_PARM_OPTIONAL|CON_PARM_RANGE , 1, 13, 13 },
- { "preamble (0-long, 1-short)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 1, 1 },
- { "InterPacketDelay- Delay between packets (uSec)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 0xffffffff, 0 },
- { "Number of TX frames (0 - endless)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 0xffffffff, 100 },
- { "Test mode (5-Random data, 9-ZOZO(0,1,0,1,...))", CON_PARM_OPTIONAL|CON_PARM_RANGE , 5, 9, 9 },
- { "Sequance number mode (0 - fixed, 1 - incremented)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 1, 0 },
+ { "Channel: (1..14(2.4Ghz), 1..180(5Ghz))", CON_PARM_OPTIONAL|CON_PARM_RANGE , 1, 161, 14 },
+ { "Rate: 1-1M,2-2M,3-5.5M,4-11M,6-6M,7-9M,8-12M,9-18M.10-24M,11-36M,12-48M,13-54M", CON_PARM_OPTIONAL|CON_PARM_RANGE , 1, 13, 13 },
+ { "preamble (0-long, 1-short)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 1, 1 },
+ { "InterPacketDelay- Delay between packets (uSec)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 0xffffffff, 0 },
+ { "Number of TX frames (0 - endless)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 0xffffffff, 100 },
+ { "Test mode (5-Random data, 9-ZOZO(0,1,0,1,...))", CON_PARM_OPTIONAL|CON_PARM_RANGE , 5, 9, 9 },
+ { "Sequance number mode (0 - fixed, 1 - incremented)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 1, 0 },
{ "packet data length [bytes] (0 - 2284)", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 2284, 100 },
{ "peer mac address (xx:xx:xx:xx:xx:xx)", CON_PARM_STRING, 0, 18, 0 },
CON_LAST_PARM };
consoleAddToken(h1, "Stop", "Stop TX tests", (FuncToken_t) cmd_PLT_TxStop, aaa );
}
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) h, "Mib", "Mibs" ) );
- consoleAddToken(h1, "Counter table", "Read_MIB_CounterTable", (FuncToken_t) cmd_PLT_MIB_CounterTable, NULL);
+ consoleAddToken(h1, "Counter table", "Read_MIB_CounterTable", (FuncToken_t) cmd_PLT_MIB_CounterTable, NULL);
consoleAddToken(h1, "station Id", "MIB_Station_id", (FuncToken_t) cmd_PLT_MIB_StationID, NULL );
-
+
/* -------------------------------------------- PLT Calibrations -------------------------------------------- */
CHK_NULL(h1 = (handle_t) consoleAddDirExt( (handle_t) h, "Calibration", "RX/TX calibrations" ) );
{
ConParm_t aaa[] = {
- { "Expected Rssi (Input signal generated power [1/16 db])", CON_PARM_RANGE|CON_PARM_SIGN, -2000, 2000, 0 },
- { "Channel", CON_PARM_RANGE|CON_PARM_DEFVAL , 1, 161, 1 },
- { "Band (0- 2.4Ghz, 1- 5Ghz, 2- 4.9Ghz)", CON_PARM_RANGE|CON_PARM_DEFVAL , 0, 2, 0 },
- { "Interval between Samples (uSec)", CON_PARM_OPTIONAL|CON_PARM_DEFVAL , 0, 0xffff, 100 },
- { "Number of samples", CON_PARM_OPTIONAL|CON_PARM_RANGE|CON_PARM_DEFVAL , 1, 2000, 1000 },
+ { "Expected Rssi (Input signal generated power [1/16 db])", CON_PARM_RANGE|CON_PARM_SIGN, -2000, 2000, 0 },
+ { "Channel", CON_PARM_RANGE|CON_PARM_DEFVAL , 1, 161, 1 },
+ { "Band (0- 2.4Ghz, 1- 5Ghz, 2- 4.9Ghz)", CON_PARM_RANGE|CON_PARM_DEFVAL , 0, 2, 0 },
+ { "Interval between Samples (uSec)", CON_PARM_OPTIONAL|CON_PARM_DEFVAL , 0, 0xffff, 100 },
+ { "Number of samples", CON_PARM_OPTIONAL|CON_PARM_RANGE|CON_PARM_DEFVAL , 1, 2000, 1000 },
CON_LAST_PARM };
consoleAddToken(h1, "RX", "RX calibration", (FuncToken_t) cmd_PLT_RxCal, aaa );
}
-
+
CHK_NULL(h2 = (handle_t) consoleAddDirExt( (handle_t) h1, "TX", "TX calibrations" ) );
{
ConParm_t aaa[] = {{ "Ref Tx power dBM/10 ",CON_PARM_RANGE, MIN_TX_POWER, MAX_TX_POWER, 0 },
CON_LAST_PARM };
consoleAddToken(h2, "Start", "Start TX calibration", (FuncToken_t) cmd_PLT_TxCalStart, aaa );
- }
+ }
consoleAddToken(h2, "stoP", "Stop TX calibration", (FuncToken_t) cmd_PLT_TxCalStop, NULL );
consoleAddToken(h2, "gain Get", "Gain get", (FuncToken_t) cmd_PLT_TxCalGainGet, NULL );
{
CON_LAST_PARM };
consoleAddToken(h2, "gain Adjust", "Set gain", (FuncToken_t) cmd_PLT_TxCalGainAdjust, aaa );
}
-
+
consoleAddToken(h1, "Get_NVS_Buffer", "Get the NVS buffers needed for update", (FuncToken_t) cmd_PLT_RxTxCalNVSUpdateBuffer, NULL );
-
+
/* -------------------------------------------- Root -------------------------------------------- */
-
+
consoleAddToken(NULL, "aboUt", "About", (FuncToken_t) cmd_show_about, NULL );
consoleAddToken(NULL, "Quit", "quit", (FuncToken_t) quit_func, NULL );
#ifdef _WINDOWS
-#endif /* ifdef _WINDOWS */
+#endif /* ifdef _WINDOWS */
return 0;
}
goto init_driver_end;
}
eeprom_image_length = ftell(f1);
- printf("NVS size = %d\n", eeprom_image_length); /* Dm: */
rewind(f1);
}
#ifdef FIRMWARE_DYNAMIC_LOAD
#endif
/*********************/
- /* Reset CLI events */
+ /* Reset CLI events */
/*******************/
for (param.value = 0; param.value < IPC_EVENT_MAX; param.value++)
wipp_control_init();
/* Initialize debug module task */
- debug_module_init();
+// debug_module_init();
}
void deinit_extended_tools()
wipp_control_deinit();
/* Deinitializew debug module task */
- debug_module_deinit();
+// debug_module_deinit();
}
#endif
{
int i;
char *script_file = NULL;
- char *eeprom_file_name = "/NVS/nvs_map.bin";
- char *init_file_name = "/voice/tiwlan.ini";
- char *firmware_file_name = "/apps/firmware.bin";
+ char *eeprom_file_name = "nvs_map.bin";
+ char *init_file_name = "tiwlan.ini";
+ char *firmware_file_name = "firmware.bin";
int stop_UI = 0;
- int bypass_supplicant = 0;
+ int bypass_supplicant = 1; //jorjin
ConParm_t param;
// TRS:PGK -- To ensure that the data structure above is actually initialized to
return -1;
}
-#ifndef _WINDOWS
+#ifndef _WINDOWS
/* Initialize g_tester module */
g_tester_init();
#endif /* __LINUX__ */
init_console_menu();
init_scan_params();
-
+
#ifdef _WINDOWS
#endif /* ifdef _WINDOWS */
-
+
if( script_file )
{
stop_UI = consoleRunScript (script_file);
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
-
+#include <linux/types.h> //jorjin
+//#include <linux/if.h> //jorjin
#include "ipc.h"
#include "ticon.h"
#include "cu_cmd.h"
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <linux/if.h>
+
+#include <linux/types.h> //jorjin
+#include <linux/if.h> //jorjin
+
#include <linux/wireless.h>
#include <stdlib.h>
/*******************************************************************************
**+--------------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |**
-**| |**
+**| |**
**| Licensed under the Apache License, Version 2.0 (the "License"); |**
**| you may not use this file except in compliance with the License. |**
**| You may obtain a copy of the License at |**
-**| |**
+**| |**
**| http://www.apache.org/licenses/LICENSE-2.0 |**
-**| |**
+**| |**
**| Unless required by applicable law or agreed to in writing, software |**
**| distributed under the License is distributed on an "AS IS" BASIS, |**
**| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |**
tiINT32
CTI_WLAN_AdapterAPI::StopSM( )
{
-#ifdef TI_EMBEDDED_SUPPLICANT
#ifndef _WINDOWS
+#ifdef TI_EMBEDDED_SUPPLICANT
if (m_bSupplicantInUse && m_pSupplicant != NULL )
{
delete m_pSupplicant;
}
else
return TI_RESULT_FAILED;
+#endif
#else
-#endif
#endif
return TI_RESULT_OK;
}
delete [] m_pszAdapterName;
m_pszAdapterName = NULL;
}
-#ifdef TI_EMBEDDED_SUPPLICANT
#ifndef _WINDOWS
+#ifdef TI_EMBEDDED_SUPPLICANT
if (m_pSupplicant != NULL )
{
delete m_pSupplicant;
CUDK_ROOT ?= ..
IPC_DIR = $(CUDK_ROOT)/IPC
OAL_DIR = $(CUDK_ROOT)/OAL
-CROSS_COMPILE ?= arm_v4t_le-
+#CROSS_COMPILE ?= arm_v4t_le-
+CROSS_COMPILE ?=arm-none-linux-gnueabi-
SRCS = $(OAL_DIR)/Common/TI_OAL.cpp \
$(OAL_DIR)/Pform/Linux/TILibLinux.cpp \
- $(CUDK_ROOT)/UtilityAdapter/Linux/IpcWithTISMLinux.cpp \
$(CUDK_ROOT)/UtilityAdapter/TI_AdapterApi.cpp \
$(CUDK_ROOT)/UtilityAdapter/TI_Adapter.cpp \
$(CUDK_ROOT)/UtilityAdapter/CTI_Adapter.cpp \
- $(CUDK_ROOT)/UtilityAdapter/TI_IPC_Suppl.cpp \
$(IPC_DIR)/Linux/ipc_event.c \
$(IPC_DIR)/Linux/cu_ipc.c \
$(IPC_DIR)/Linux/ipc_user.c
-CFLAGS += -Wall -D__LINUX__ -D_IPC_SUPPL -DTI_EMBEDDED_SUPPLICANT
+CFLAGS += -Wall -D__LINUX__ -D_IPC_SUPPL
CFLAGS += $(DEBUGFLAGS)
CFLAGS += $(INCLUDEDIR) $(ARMFLAGS)
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
#define COUNTRY_STRING_LEN 3
/* Definitions for Rx Filter MIB. */
-#define PLT_MIB_RX_FILTER_PROMISCOUS_SET (UINT8) 0x01 /* set \97 Enable: Forward all frames to host driver*/
-#define PLT_MIB_RX_FILTER_PROMISCOUS_CLEAR (UINT8) 0x00 /* cleared \97 Disable: Do not orward all frames to the host driver*/
-#define PLT_MIB_RX_FILTER_BSSID_SET (UINT8) 0x02 /* set \97 filter enabled: receive only those frames that match the BSSID given in the Join command*/
-#define PLT_MIB_RX_FILTER_BSSID_CLEAR (UINT8) 0x00 /* cleared \97 filter disabled: ignore BSSID in receiving*/
+#define PLT_MIB_RX_FILTER_PROMISCOUS_SET (UINT8) 0x01 /* set ? Enable: Forward all frames to host driver*/
+#define PLT_MIB_RX_FILTER_PROMISCOUS_CLEAR (UINT8) 0x00 /* cleared ? Disable: Do not orward all frames to the host driver*/
+#define PLT_MIB_RX_FILTER_BSSID_SET (UINT8) 0x02 /* set ? filter enabled: receive only those frames that match the BSSID given in the Join command*/
+#define PLT_MIB_RX_FILTER_BSSID_CLEAR (UINT8) 0x00 /* cleared ? filter disabled: ignore BSSID in receiving*/
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
****************************************************************************/
/**************************************************************************/
-/* */
-/* MODULE: memMngr.h */
-/* PURPOSE: Driver memory management */
-/* */
+/* */
+/* MODULE: memMngr.h */
+/* PURPOSE: Driver memory management */
+/* */
/**************************************************************************/
#ifndef _MEM_MNGR_H_
#define _MEM_MNGR_H_
/* READ ONLY */
/* The user MUST not change the following fields */
UINT32 handle; /* handle of this MSDU data structure */
- mem_MSDU_T * nextFreeMSDU; /* pointer to the next Free MSDU when
+ mem_MSDU_T* nextFreeMSDU; /* pointer to the next Free MSDU when
this MSDU Buffer is in Free mode */
/* PUBLIC - For the use of the User */
UINT32 headerLen; /* the length of the 802.11 header */
- mem_BD_T * firstBDPtr; /* pointer to the first BD */
- mem_BD_T * lastBDPtr; /* pointer to the last BD */
+ mem_BD_T* firstBDPtr; /* pointer to the first BD */
+ mem_BD_T* lastBDPtr; /* pointer to the last BD */
ap_FreeMemFunc freeFunc; /* pointer to the Data Buffer free function */
UINT32 freeArgs[NUM_OF_FREE_ARGS]; /* arguments to be send with the free function */
UINT32 dataLen; /* length of the data (only data) of the firstBDPtr */
allocatingModule_e module; /* the allocating module */
/* support Msdu List */
- mem_MSDU_T * nextMSDUinList; /* pointer to the next MSDU in Tx queue link list. */
- mem_MSDU_T * prevMSDUinList; /* pointer to the previos MSDU in Tx queue link list. */
+ mem_MSDU_T* nextMSDUinList; /* pointer to the next MSDU in Tx queue link list. */
+ mem_MSDU_T* prevMSDUinList; /* pointer to the previos MSDU in Tx queue link list. */
UINT32 txFlags; /* Tx flags */
UINT8 txCompleteFlags; /* Tx complete flags */
UINT32 insertionTime; /* time of msdu insersion to driver. */
UINT8 qosTag; /* 802.11d qos tag */
-#ifdef DM_USE_WORKQUEUE
- mem_MSDU_T * msdu_next; /* Used for Workqueue list */
-#endif /* DM_USE_WORKQUEUE */
-#ifdef TI_DBG
+ #ifdef TI_DBG
UINT32 timeStamp [MAX_NUM_OF_TIME_STAMPS];
/* array of time stamps */
UINT32 timeStampNum; /* number of time stamps */
-#endif
+ #endif
};
typedef struct
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
****************************************************************************/
/*--------------------------------------------------------------------------*/
-/* Module: osDot11.h */
-/* */
-/* Purpose: */
-/* */
+/* Module: osDot11.h */
+/**/
+/* Purpose: */
+/**/
/*--------------------------------------------------------------------------*/
#ifndef __OSDOT11_H__
#define __OSDOT11_H__
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
driverStatus_e driverStatus;
/* HAL Control section */
- UINT8 halCtrlCtsToSelf;
+ UINT8 halCtrlCtsToSelf;
UINT8 halCtrlTxPowerDbm;
/* site manager section */
OS_802_11_THRESHOLD_CROSS_PARAMS QOSRateThreshold;
OS_802_11_QOS_DESIRED_PS_MODE qosDesiredPsMode;
- /* Power Manager */
- PowerMgr_PowerMode_e PowerMode;
- powerAutho_PowerPolicy_e PowerSavePowerLevel;
- powerAutho_PowerPolicy_e DefaultPowerLevel;
- PowerMgr_PowerMode_t powerMngPowerMode;
- PowerMgr_Priority_e powerMngPriority;
- PowerMgr_PowerMode_e powerMngDozeMode;
+ /*
+ Power Manager
+ */
+ PowerMgr_PowerMode_e PowerMode;
+ powerAutho_PowerPolicy_e PowerSavePowerLevel;
+ powerAutho_PowerPolicy_e DefaultPowerLevel;
+ PowerMgr_PowerMode_t powerMngPowerMode;
+ PowerMgr_Priority_e powerMngPriority;
+ PowerMgr_PowerMode_e powerMngDozeMode;
- /* txRatePolicy params */
- txRatePolicy_t TxRatePolicy;
+ /* txRatePolicy params */
+ txRatePolicy_t TxRatePolicy;
- TIWLN_RADIO_RX_QUALITY RxRadioQuality ;
+ TIWLN_RADIO_RX_QUALITY RxRadioQuality ;
- /*PLT MIB*/
- PLT_MIB_t PltMib;
+ /*PLT MIB*/
+ PLT_MIB_t PltMib;
} content;
-} paramInfo_t;
+}paramInfo_t;
/* Set/get params function prototype */
typedef TI_STATUS (*paramFunc_t)(TI_HANDLE handle, paramInfo_t *pParam);
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
/****************************************************************************
* *
- * MODULE: Roaming Manager *
- * PURPOSE: Roaming Manager Module Types * * *
+ * MODULE: Roaming Manager *
+ * PURPOSE: Roaming Manager Module Types *
+ * *
****************************************************************************/
#ifndef _ROAMING_MNGR_TYPES_H_
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
****************************************************************************/
/*--------------------------------------------------------------------------*/
-/* Module: SOFT_GEMINI_TYPES.H */
-/* */
-/* Purpose: This module contains All the system definisions. */
-/* */
+/* Module: SOFT_GEMINI_TYPES.H*/
+/**/
+/* Purpose: This module contains All the system definisions.*/
+/**/
/*--------------------------------------------------------------------------*/
#ifndef __SOFT_GEMINI_TYPES_H__
#define __SOFT_GEMINI_TYPES_H__
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
****************************************************************************/
/*--------------------------------------------------------------------------*/
-/* Module: SYSTEM_GENERAL_PARAM.H */
-/* */
-/* Purpose: This module contains All the system definisions. */
-/* */
+/* Module: SYSTEM_GENERAL_PARAM.H*/
+/**/
+/* Purpose: This module contains All the system definisions.*/
+/**/
/*--------------------------------------------------------------------------*/
#ifndef __SYSTEM_GENERAL_PARAM_H__
#define __SYSTEM_GENERAL_PARAM_H__
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#ifdef SEQUNCE_TRACE
return 1;
#endif
- /* Dm: os_protectLock(pTrc->hOs, pTrc->hProtect); */
+ os_protectLock(pTrc->hOs, pTrc->hProtect);
pEvt = &pTrc->Evt[pTrc->Idx];
pData = &pEvt->Info.TrcData;
if (pTrc->Num < TRACER_MAX_EVENTS)
pTrc->Num++;
- /* Dm: os_protectUnlock(pTrc->hOs, pTrc->hProtect); */
+ os_protectUnlock(pTrc->hOs, pTrc->hProtect);
return(0);
}
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#ifdef TI_DBG
pTnetwDrv->dbgCountSentPackets[aQueueId]++; /* Count packets sent from upper driver. */
-#endif
/* If null entry (not expected to happen) return ERROR. */
if (!pPktCtrlBlk)
{
-#ifdef TI_DBG
WLAN_REPORT_ERROR(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,
("TnetwDrv_txXfer_sendPacket(): Tx Ctrl-Blk allocation failed!!!\n"));
-#endif
return SEND_PACKET_ERROR;
}
+#endif
+
+
/*****************************************************************************************/
/* 2) Set the packet control block parameters (including descriptor structure). */
#ifdef TI_DBG
pTnetwDrv->dbgCountXferDoneCB[pPktCtrlBlk->txDescriptor.xmitQueue]++;
-#endif
/* If the pointed entry is already free, print error and exit (not expected to happen). */
if (pPktCtrlBlk->pNextFreeEntry != NULL)
{
-#ifdef TI_DBG
WLAN_REPORT_ERROR(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,
("TnetwDrv_TxXferDone(): Pkt already free!!, DescID=%d, dbgPktSeqNum=%d, flags=%d, packetId=0x%x, Queue=%d\n",
pPktCtrlBlk->txDescriptor.descID, pPktCtrlBlk->txPktParams.dbgPktSeqNum, pPktCtrlBlk->txPktParams.flags,
pPktCtrlBlk->txPktParams.packetId, pPktCtrlBlk->txDescriptor.xmitQueue));
-#endif
return;
}
+#endif
/* If Tx-complete already occurred, free the ctrl-blk. */
/* Note that this may happen when the Xfer-SM delays the Xfer-Done (for pipeline sequence). */
pTxResultInfo->descID, pPktCtrlBlk->txPktParams.dbgPktSeqNum, pPktCtrlBlk->txPktParams.flags,
pPktCtrlBlk->txPktParams.packetId, pPktCtrlBlk->txDescriptor.xmitQueue));
- pTnetwDrv->dbgCountTxCompleteCB[pPktCtrlBlk->txDescriptor.xmitQueue]++;
-#endif
+ pTnetwDrv->dbgCountTxCompleteCB[pPktCtrlBlk->txDescriptor.xmitQueue]++;
/* If the pointed entry is already free, print error and exit (not expected to happen). */
if (pPktCtrlBlk->pNextFreeEntry != NULL)
{
-#ifdef TI_DBG
WLAN_REPORT_ERROR(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,
("TnetwDrv_TxComplete(): Pkt already free!!, DescID=%d, dbgPktSeqNum=%d, flags=%d, packetId=0x%x, Queue=%d\n",
pTxResultInfo->descID, pPktCtrlBlk->txPktParams.dbgPktSeqNum, pPktCtrlBlk->txPktParams.flags,
pPktCtrlBlk->txPktParams.packetId, pPktCtrlBlk->txDescriptor.xmitQueue));
-#endif
return;
}
+#endif
/* Update the HwQueue to free queue resources. */
TnetwDrv_txHwQueue_free(pTnetwDrv, pPktCtrlBlk);
void TnetwDrv_printInfo(TI_HANDLE hTnetwDrv)
{
#ifdef TI_DBG
- TnetwDrv_t *pTnetwDrv = (TnetwDrv_t *)hTnetwDrv;
- int qIndex;
+ TnetwDrv_t *pTnetwDrv = (TnetwDrv_t *)hTnetwDrv;
+ int qIndex;
- WLAN_OS_REPORT(("TNETW Driver Tx Counters per Queue:\n"));
- WLAN_OS_REPORT(("===========================\n"));
+ WLAN_OS_REPORT(("TNETW Driver Tx Counters per Queue:\n"));
+ WLAN_OS_REPORT(("===========================\n"));
WLAN_OS_REPORT(("-------------- packets sent from upper driver ---------------\n"));
for(qIndex = 0; qIndex < MAX_NUM_OF_TX_QUEUES; qIndex++)
WLAN_OS_REPORT(("Queue %d = %d\n",qIndex, pTnetwDrv->dbgCountTxCompleteCB[qIndex]));
#endif /* TI_DBG */
}
+
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
/* Write null in the next-free index of the last entry. */
pTxCtrlBlk->TxCtrlBlkTbl[CTRL_BLK_ENTRIES_NUM - 1].pNextFreeEntry = NULL;
-#ifdef TI_DBG
+ #ifdef TI_DBG
pTxCtrlBlk->numUsedEntries = 0;
-#endif
+ #endif
return OK;
}
pFirstFreeEntry = &(pTxCtrlBlk->TxCtrlBlkTbl[0]);
pCurrentEntry = pFirstFreeEntry->pNextFreeEntry; /* Get free entry. */
+#ifdef TI_DBG
/* If no free entries, print error (not expected to happen) and return NULL. */
if (pCurrentEntry == NULL)
{
-#ifdef TI_DBG
WLAN_REPORT_ERROR(pTxCtrlBlk->hReport, TX_CTRL_BLK_MODULE_LOG,
("txCtrlBlk_alloc(): No free entry, UsedEntries=%d\n", pTxCtrlBlk->numUsedEntries));
-#endif
return NULL;
}
-#ifdef TI_DBG
pTxCtrlBlk->numUsedEntries++;
#endif
txCtrlBlkObj_t *pTxCtrlBlk = (txCtrlBlkObj_t *)hTxCtrlBlk;
txCtrlBlkEntry_t *pFirstFreeEntry = &(pTxCtrlBlk->TxCtrlBlkTbl[0]);
+#ifdef TI_DBG
/* If the pointed entry is already free, print error and exit (not expected to happen). */
if (pCurrentEntry->pNextFreeEntry != 0)
{
-#ifdef TI_DBG
WLAN_REPORT_ERROR(pTxCtrlBlk->hReport, TX_CTRL_BLK_MODULE_LOG,
("txCtrlBlk_free(): Entry %d alredy free, UsedEntries=%d\n",
pCurrentEntry->txDescriptor.descID, pTxCtrlBlk->numUsedEntries));
-#endif
return;
}
-#ifdef TI_DBG
pTxCtrlBlk->numUsedEntries--;
#endif
/***************************************************************************/
/* */
-/* MODULE: txCtrlBlk_api.h */
+/* MODULE: txCtrlBlk_api.h */
/* PURPOSE: Tx control block module API. */
/* */
/***************************************************************************/
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
pObj->hOs = hOs;
/* allocates Timer to use for CmdMBox timeout*/
- pObj->hTimer = os_timerCreate(hOs, CmdMBox_TimeOut, pObj);
- if (pObj->hTimer == NULL)
- {
+ pObj->hTimer = os_timerCreate(hOs, CmdMBox_TimeOut, pObj);
+ if (pObj->hTimer == NULL)
+ {
CmdMBox_Destroy(pObj);
- WLAN_OS_REPORT(("FATAL ERROR: CmdMBox_Create(): Error Creating CmdMBox Timer- Aborting\n"));
- return NULL;
- }
+ WLAN_OS_REPORT(("FATAL ERROR: CmdMBox_Create(): Error Creating CmdMBox Timer- Aborting\n"));
+ return NULL;
+ }
#if CMDMBOX_DEBUG_PRINT
StateString[0] = StateString_array[0];
***************************************/
case CMDMBOX_STATE_SENDCMD_NORMAL_WRITE_TRIG_v:
/* start timeout timer */
-#ifdef DM_USE_WORKQUEUE
- os_timerStart(pCmdMBox->hOs, pCmdMBox->hTimer,
- CMDMBOX_WAIT_TIMEOUT * 2, FALSE); /* Dm: Wait for 1000 ms */
-#else
os_timerStart(pCmdMBox->hOs, pCmdMBox->hTimer,
CMDMBOX_WAIT_TIMEOUT, FALSE);
-#endif
/* write the FW trigger */
rc = TNETWIF_WriteRegOpt (pCmdMBox->hTNETWIF,
***************************************/
case CMDMBOX_STATE_SENDCMD_BLOCKING_WRITE_TRIG_v:
/* init timeout counter */
- timeoutCounterExpire = (CMDMBOX_WAIT_TIMEOUT*CMDMBOX_US_TO_MS)/CMDMBOX_WAIT_CMPLT_STALL_TIME;
+ timeoutCounterExpire= (CMDMBOX_WAIT_TIMEOUT*CMDMBOX_US_TO_MS)/CMDMBOX_WAIT_CMPLT_STALL_TIME;
timeoutCounter = 0;
/* write the FW trigger */
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
{
HwAccess_T_new *pHwAccess;
int status = OK;
+
#ifdef HW_ACCESS_SDIO
SDIO_ConfigParams configParams;
#endif
pHwAccess = os_memoryAlloc(hOs, sizeof(HwAccess_T_new));
+
if (pHwAccess == NULL)
return NULL;
}
#ifdef HW_ACCESS_SDIO
-
pHwAccess->AsyncMode = FALSE;
os_memoryZero(hOs, &configParams, sizeof(SDIO_ConfigParams));
configParams.fconfig_peripheral = SDIO_TNETWConfig;
configParams.fconvert = NULL;
configParams.owner = pHwAccess;
-
status = SDIO_Init(&configParams, &pHwAccess->hDriver);
-
+
#elif HW_ACCESS_WSPI
pHwAccess->AsyncMode = TRUE;
os_memoryFree(pHwAccess->hOs, pHwAccess, sizeof(HwAccess_T_new));
return NULL;
}
-
+
return pHwAccess;
}
{
#ifdef HW_ACCESS_SDIO
- SDIO_Stop(pHwAccess->hDriver, 0);
- SDIO_Shutdown(pHwAccess->hDriver);
+ SDIO_Stop(pHwAccess->hOs, 0);
+ SDIO_Shutdown(pHwAccess->hOs);
#elif HW_ACCESS_WSPI
#endif
pHwAccess->hReport = hReport;
+//WLAN_OS_REPORT(("whal_hwAccess_Config,1-1\n"));
#ifdef GWSI_SPI_TEST
/* For GWSI_API_TEST this parameter should be maximum allowed because we don't use setPartition */
/*
Wait 200 usec for memory repair process to finish and device is ready.
*/
+
os_StalluSec(pHwAccess->hOs, 200);
-
+
pHwAccess->CB.CBFunc = CBFunc;
pHwAccess->CB.CBArg = CBArg;
pHwAccess->RegisterRegionAddr = HW_ACCESS_DOWN_PART0_SIZE;
pHwAccess->MemRegionAddr = HW_ACCESS_DOWN_PART0_ADDR;
pHwAccess->uBusError = 0;
-
status = SDIO_Start (pHwAccess->hDriver);
-
status = (status == SDIO_SUCCESS) ? TNETWIF_COMPLETE : TNETWIF_ERROR;
#elif HW_ACCESS_WSPI
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#include "TNETWIF.h"
#include "whalHwAccess.h"
#include "ElpCtrl.h"
-/* #include <linux/timer.h> */
+
/* Healthy timer timeout in milliseconds */
#define ELPCTRL_TIMER_TIMEOUT 100
* This Timeout means that we failed to wake up the FW
* so the only way out of it is to restart the device - by recovery
*/
- /* WLAN_OS_REPORT (("elpCtrl_TimerTimeout - ELP timeout timer expired! %lu\n", jiffies)); */
- WLAN_OS_REPORT (("elpCtrl_TimerTimeout - ELP timeout timer expired!\n"));
+ WLAN_OS_REPORT (("elpCtrl_TimerTimeout - ELP timeout timer expired!\n"));
if (pElpCtrl->fFail)
pElpCtrl->fFail (pElpCtrl->hFail, HW_AWAKE_FAILURE);
{
pElpCtrl->state = ELPS_WAKING_UP_MUX;
pElpCtrl->bMuxBackNeeded = TRUE;
-#ifdef DM_USE_WORKQUEUE
- /* printk("TI: %s:\t%lu - start timeout 1000 ms\n", __FUNCTION__, jiffies); */
- os_timerStart (pElpCtrl->hOs, pElpCtrl->hTimer, ELPCTRL_TIMER_TIMEOUT * 10, FALSE);
-#else
os_timerStart (pElpCtrl->hOs, pElpCtrl->hTimer, ELPCTRL_TIMER_TIMEOUT, FALSE);
-#endif
/*
* Mux to WLAN_READY and let the Arbiter wait for Txn complete
*/
if (pElpCtrl->state == ELPS_WAKING_UP_MUX)
{
pElpCtrl->state = ELPS_AWAKE;
- /* printk("TI: %s:\t%lu - stop timeout\n", __FUNCTION__, jiffies); */
os_timerStop (pElpCtrl->hOs, pElpCtrl->hTimer);
}
pElpCtrl->mode = ELPCTRL_MODE_KEEP_AWAKE;
pElpCtrl->state = ELPS_AWAKE;
- /* printk("TI: %s:\t%lu - stop timeout\n", __FUNCTION__, jiffies); */
os_timerStop (pElpCtrl->hOs, pElpCtrl->hTimer);
return OK;
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
return NOK;
}
-#ifdef EV_HANDLER_DEBUG
- if (ghEvHandler != hEvHandler)
- {
- return NOK;
- }
-#endif
+ #ifdef EV_HANDLER_DEBUG
+ if (ghEvHandler != hEvHandler)
+ {
+ return NOK;
+ }
+ #endif
pEvHandler = (EV_HANDLER_STRUCT_T*)hEvHandler;
HeadIndex = pEvHandler->SendEventArray.HeadIndex;
return NOK;
}
-#ifdef EV_HANDLER_DEBUG
- if (ghEvHandler != hEvHandler)
- {
- return NOK;
- }
-#endif
+ #ifdef EV_HANDLER_DEBUG
+ if (ghEvHandler != hEvHandler)
+ {
+ return NOK;
+ }
+ #endif
pEvHandler = (EV_HANDLER_STRUCT_T*)hEvHandler;
os_memoryCopy(pEvHandler->hOs,(UINT8*)&pNewEvent->EvParams,
(UINT8*)&pEvHandler->RegistrationArray[EvType][ModuleIndex],
sizeof(IPC_EVENT_PARAMS));
-
- if( Length > MAX_EVENT_DATA_SIZE ) { /* Dm: Security fix */
- PRINTF(DBG_INIT_ERROR, ("TI: %s Security Error\n", __FUNCTION__));
- return NOK;
- }
+
os_memoryCopy(pEvHandler->hOs,(UINT8*)pNewEvent->uBuffer,
(UINT8*)pData,Length);
pNewEvent->uBufferSize = Length;
- if(pNewEvent->EvParams.uDeliveryType == DELIVERY_PUSH)
+ if(pNewEvent->EvParams.uDeliveryType == DELIVERY_PUSH)
{
PRINTF(DBG_INIT_LOUD, (" EvHandlerSendEvent %d to OS \n", EvType));
PRINTF(DBG_INIT_LOUD, ("EvHandlerSendEvent Matching OS Registered event found at EvType = %d,"
return OK;
}
-/* ************************** Bottom Interface End **********************************/
-
+ /* ************************** Bottom Interface End **********************************/
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
pCurrBSS->lowRssiThreshold = params->lowQualityForBackgroungScanCondition;
pCurrBSS->highRssiThreshold = params->normalQualityForBackgroungScanCondition;
-
+
pCurrBSS->rssiFilterWeight = params->rssiFilterWeight;
pCurrBSS->snrFilterWeight = params->snrFilterWeight;
*aNormalQualityForBackgroungScanCondition = pCurrBSS->highRssiThreshold;
*rssiFilterWeight = pCurrBSS->rssiFilterWeight;
*snrFilterWeight = pCurrBSS->snrFilterWeight;
-
+
return OK;
}
}
else
{
- WLAN_REPORT_INFORMATION(pCurrBSS->hReport, CURR_BSS_MODULE_LOG,("Can't Regain BSS not connected !" ));
+ WLAN_REPORT_ERROR(pCurrBSS->hReport, CURR_BSS_MODULE_LOG,("Can't Regain BSS not connected !" ));
}
return OK;
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
fourX_Capabilities_t* pFourX_Capabilities)
{
char *capPtr;
- UINT32 len;
- UINT16 capLen;
+ UINT16 len,capLen;
WlanTIcap_t cap_type;
UINT8 ti_oui[] = TI_OUI;
len = DOT11_OUI_LEN+1; /* TI_OUI + version field */
- while(len < (UINT32)(site4xParams->hdr.eleLen)) /* Dm: Security fix */
+ while(len < site4xParams->hdr.eleLen)
{
cap_type = (WlanTIcap_t)(*((UINT16*)(capPtr)));
capPtr += 2;
pFourX_Capabilities->concatenationParams.concatenationSize = *((UINT16*)(capPtr));
capPtr += 2;
- len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + (UINT32)capLen /* val fields */;
+ len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + capLen /* val fields */;
break;
case TI_CAP_4X_CONT_WINDOW:
capPtr += 2;
pFourX_Capabilities->contentionWindowParams.CWMax = *((UINT16*)(capPtr));
capPtr += 2;
- len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + (UINT32)capLen /* val field */;
+ len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + capLen /* val field */;
break;
case TI_CAP_4X_CONT_WINDOW_COMBO:
capPtr += 2;
pFourX_Capabilities->CWCombParams.CWMin = *((UINT16*)(capPtr));
capPtr += 2;
- len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + (UINT32)capLen /* val field */;
+ len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + capLen /* val field */;
break;
case TI_CAP_4X_TCP_ACK_EMUL:
capPtr += 2;
capLen = *((UINT16*)(capPtr));
capPtr += 2;
- len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + (UINT32)capLen /* val field */;
+ len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + capLen /* val field */;
break;
case TI_CAP_TRICK_PACKET_ERP:
capPtr += 2;
capLen = *((UINT16*)(capPtr));
capPtr += 2;
- len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + (UINT32)capLen /* val field */;
+ len += sizeof(UINT16) /* type field */ + sizeof(UINT16) /* len field */ + capLen /* val field */;
break;
default:
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
/***************************************************************************/
-/* */
-/* MODULE: Rx.c */
-/* PURPOSE: Rx module functions */
-/* */
+/* */
+/* MODULE: Rx.c */
+/* PURPOSE: Rx module functions */
+/* */
/***************************************************************************/
#include "osTIType.h"
#include "paramIn.h"
hRxData->hOs = hOs;
/* allocate timer for debug throughput */
-#ifdef TI_DBG
+ #ifdef TI_DBG
hRxData->hThroughputTimer = os_timerCreate (hOs, rxData_printRxThroughput, hRxData);
if (!hRxData->hThroughputTimer)
{
return NULL;
}
hRxData->rxThroughputTimerEnable = FALSE;
-#endif
+ #endif
return(hRxData);
}
pRxData->rxDataEapolDestination = DEF_EAPOL_DESTINATION;
pRxData->rxDataPortStatus = DEF_RX_PORT_STATUS;
-#ifdef TI_DBG
+ #ifdef TI_DBG
/* reset counters */
/*rxData_resetCounters(pRxData);*/
/*rxData_resetDbgCounters(pRxData);*/
os_timerStop (pRxData->hOs, pRxData->hThroughputTimer);
pRxData->rxThroughputTimerEnable = FALSE;
}
-#endif
+ #endif
WLAN_REPORT_INFORMATION(pRxData->hReport, RX_DATA_MODULE_LOG,
(" rxData_stop() : Succeeded.\n"));
{
rxData_t *pRxData = (rxData_t *)hRxData;
- WLAN_REPORT_INFORMATION(pRxData->hReport, RX_DATA_MODULE_LOG,
+ WLAN_REPORT_ERROR(pRxData->hReport, RX_DATA_MODULE_LOG,
(" rxData_rcvMsduInOpenNotify: receiving data packet while in rx port status is open notify\n"));
WLAN_REPORT_DEBUG_RX(pRxData->hReport,
***************************************************************************/
static void rxData_rcvMsduData(TI_HANDLE hRxData, mem_MSDU_T *pMsdu, Rx_attr_t* pRxAttr)
{
-#ifdef CONFIG_TROUT_PWRSINK
- extern unsigned long num_rx_pkt_new;
-#endif
rxData_t *pRxData = (rxData_t *)hRxData;
EthernetHeader_t *pEthernetHeader;
- UINT16 EventMask = 0;
+ UINT16 EventMask = 0;
WLAN_REPORT_INFORMATION(pRxData->hReport, RX_DATA_MODULE_LOG,
pRxData->rxDataCounters.DirectedBytesRecv += pMsdu->dataLen;
EventMask |= DIRECTED_BYTES_RECV;
EventMask |= DIRECTED_FRAMES_RECV;
-#ifdef CONFIG_TROUT_PWRSINK
- num_rx_pkt_new++;
-#endif
}
else if ( IsMacAddressBroadcast(&pEthernetHeader->DstAddr))
{
pRxData->rxDataCounters.MulticastBytesRecv += pMsdu->dataLen;
EventMask |= MULTICAST_BYTES_RECV;
EventMask |= MULTICAST_FRAMES_RECV;
-#ifdef CONFIG_TROUT_PWRSINK
- num_rx_pkt_new++;
-#endif
}
pRxData->rxDataCounters.LastSecBytesRecv += pMsdu->dataLen;
- /*Handle PREAUTH_EAPOL_PACKET*/
- if(pEthernetHeader->TypeLength == PREAUTH_EAPOL_PACKET)
+ /*Handle PREAUTH_EAPOL_PACKET*/
+ if(pEthernetHeader->TypeLength == PREAUTH_EAPOL_PACKET)
{
WLAN_REPORT_INFORMATION(pRxData->hReport, RX_DATA_MODULE_LOG,
(" rxData_receiveMsduFromWlan() : Received an Pre-Auth EAPOL frame tranferred to OS\n"));
}
- rxData_DistributorRxEvent(pRxData,EventMask,(int)pMsdu->dataLen);
+ rxData_DistributorRxEvent(pRxData,EventMask,(int)pMsdu->dataLen);
- /* deliver packet to os */
- wlan_memMngrChangeMsduOwner(pRxData->hMemMngr,OS_ABS_RX_MODULE,pMsdu);
+ /* deliver packet to os */
+ wlan_memMngrChangeMsduOwner(pRxData->hMemMngr,OS_ABS_RX_MODULE,pMsdu);
os_receivePacket(pRxData->hOs, pMsdu, (UINT16)pMsdu->dataLen);
+
}
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
UINT32 count;
mem_MSDU_T* pTempMsdu;
- os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
if( this->CurrNumOfMsdu == 0 )
{
WLAN_REPORT_INFORMATION(this->hReport, TX_DATA_MODULE_LOG,
(" msduList_EmptyMsduList() : List is empty \n"));
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return OK;
}
pTempMsdu = pTempMsdu->nextMSDUinList;
}
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect);
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect);
/* free all msdu back to the memMngr */
if ((wlan_memMngrFreeListOfMSDU(this->hMemMgr, memMgr_MsduHandle( this->first))) != OK)
{
(" msduList_EmptyMsduList() : Msdu free failed \n"));
}
- os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
this->first = NULL;
this->last = NULL;
this->CurrNumOfMsdu = 0;
this->mediumTime = 0;
this->totalUsedTime = 0;
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return OK;
}
TI_STATUS msduList_Insert( MsduList_t* this , mem_MSDU_T **pMsdu )
{
- os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
if( this->CurrNumOfMsdu == 0 )
{
(*pMsdu)->nextMSDUinList = NULL;
(*pMsdu)->prevMSDUinList = NULL;
this->CurrNumOfMsdu++;
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
/* for debug */
if( this->CurrNumOfMsdu > this->maxCurrOfMsdu )
/* The list is full, remove the new coming msdu*/
WLAN_REPORT_INFORMATION(this->hReport, TX_DATA_MODULE_LOG,
(" msduList_MsduListIns() : New Msdu has to be removed \n"));
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
/* for debug */
if( this->CurrNumOfMsdu > this->maxCurrOfMsdu )
WLAN_REPORT_INFORMATION(this->hReport, TX_DATA_MODULE_LOG,
(" msduList_MsduListIns() : First Msdu was removed \n"));
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
/* indicate that the first msdu has removed */
/* for debug */
this->CurrNumOfMsdu++;
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
/* for debug */
if( this->CurrNumOfMsdu > this->maxCurrOfMsdu )
TI_STATUS msduList_GetFirst( MsduList_t *this, mem_MSDU_T **pMsdu)
{
- os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
if( this->CurrNumOfMsdu == 0 )
{
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return NOK;
}
this->CurrNumOfMsdu--;
(*pMsdu)->nextMSDUinList = NULL;
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return OK;
}
************************************************************************/
TI_STATUS msduList_WatchFirst( MsduList_t *this, mem_MSDU_T **pMsdu)
{
- os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(this->hOs, this->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
if( this->CurrNumOfMsdu == 0 )
{
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return NOK;
}
*pMsdu = this->first;
- os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(this->hOs, this->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return OK;
}
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
dot11_RSN_t *pRsnIe;
UINT8 curRsnData[255];
UINT8 rsnAssocIeLen;
- UINT16 length=0;
+ UINT8 length=0;
WLAN_REPORT_SM(pHandle->hReport, ASSOC_MODULE_LOG,
/* Get the RSN IE data */
pRsnIe = pFrame->content.assocRsp.pRsnIe;
- while ((length < pFrame->content.assocRsp.rsnIeLen) && (pFrame->content.assocRsp.rsnIeLen < 255))
+ while (length < pFrame->content.assocRsp.rsnIeLen && (pFrame->content.assocRsp.rsnIeLen < 255))
{
- if ((pRsnIe->hdr.eleLen + length + 2) > 255) { /* Dm: Security fix */
- WLAN_REPORT_ERROR(pHandle->hReport, ASSOC_MODULE_LOG,
- ("%s - Security Error: %u > 255\n", __FUNCTION__,(pRsnIe->hdr.eleLen + length + 2)));
- break;
- }
curRsnData[0+length] = pRsnIe->hdr.eleId;
curRsnData[1+length] = pRsnIe->hdr.eleLen;
os_memoryCopy(pHandle->hOs, &curRsnData[2+length], (void *)pRsnIe->rsnIeData, pRsnIe->hdr.eleLen);
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
if(pMsdu->dataLen-WLAN_HDR_LEN-TIME_STAMP_LEN-4 > MAX_BEACON_BODY_LENGTH)
{
- WLAN_REPORT_INFORMATION(pHandle->hReport, MLME_SM_MODULE_LOG,
+ WLAN_REPORT_ERROR(pHandle->hReport, MLME_SM_MODULE_LOG,
("mlmeParser_recv: probe response length out of range. length=%d, band=%d, channel=%d\n", pMsdu->dataLen-WLAN_HDR_LEN-TIME_STAMP_LEN-4, pRxAttr->band, pRxAttr->channel));
/* Error in parsing probe response packet - exit */
wlan_memMngrFreeMSDU(pHandle->hMemMgr, pMsdu->handle);
pTim->bmapControl = *(pData+2);
pData += 3;
- if ((pTim->hdr.eleLen - 3) > DOT11_PARTIAL_VIRTUAL_BITMAP_MAX) /* Dm: Security fix */
- {
- WLAN_REPORT_ERROR(pMlme->hReport, MLME_SM_MODULE_LOG,
- ("MLME_PARSER: Security Error: eleLen=%d, maxLen=%d\n",
- pTim->hdr.eleLen, DOT11_PARTIAL_VIRTUAL_BITMAP_MAX));
- return NOK;
- }
os_memoryCopy(pMlme->hOs, (void *)pTim->partialVirtualBmap, pData, pTim->hdr.eleLen - 3);
*pReadLen = pTim->hdr.eleLen + 2;
quiet->quietCount = *pData++;
quiet->quietPeriod = *pData++;
- quiet->quietDuration = *((UINT16*)pData); pData+=2; /* Dm: */
+ quiet->quietDuration = (*((UINT16*)pData))++;
quiet->quietOffset = *((UINT16*)pData);
return OK;
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
pSmeSm = os_memoryAlloc(hOs, sizeof(smeSm_t));
if (pSmeSm == NULL)
return NULL;
- os_memoryZero(hOs, pSmeSm, sizeof(smeSm_t)); /* Dm: Fix */
-
+
initVec |= (1 << SME_INIT_BIT);
pSmeSm->pFsm = smeSm_smCreate(hOs);
#define CFG_RX_CF_EN BIT_8 /* contention free frames.*/
#define CFG_RX_BCN_EN BIT_9 /* beacons.*/
#define CFG_RX_AUTH_EN BIT_10 /* authentication, deauthentication.*/
-#define CFG_RX_ASSOC_EN BIT_11 /* association related frames (all 5 subtypes \96 assoc req/resp,*/
+#define CFG_RX_ASSOC_EN BIT_11 /* association related frames (all 5 subtypes ? assoc req/resp,*/
typedef struct
unsigned virtualBM : 1; /* If asserted, the VBM in a Beacon frame contained */
/* more than 1 asserted bit*/
- unsigned bcast : 1; /* Indicates whether the received frame\92s address 1 */
+ unsigned bcast : 1; /* Indicates whether the received frame?s address 1 */
/* is a broadcast address.*/
unsigned matchSSID : 1; /* Indicates whether the received frame containing */
/* information element was interrogated. This field is */
/* automatically cleared when it is interrogated.*/
- uint32 validFrameCount; /* The number of MPDU\92s without PLCP header errors received*/
+ uint32 validFrameCount; /* The number of MPDU?s without PLCP header errors received*/
/* since the last time this information element was interrogated. */
/* This field is automatically cleared when it is interrogated.*/
{
INFO_ELE_HDR
- uint8 Enable; /* specifies if beacon early termination procedure is enabled or disabled: 0 \96 disabled, 1 \96 enabled */
+ uint8 Enable; /* specifies if beacon early termination procedure is enabled or disabled: 0 ?disabled, 1 ?enabled */
uint8 MaximumConsecutiveET; /* specifies the maximum number of consecutive beacons that may be early terminated. After this number is reached
- at least one full beacon must be correctly received in FW before beacon ET resumes. Legal range: 0 \96 255 */
+ at least one full beacon must be correctly received in FW before beacon ET resumes. Legal range: 0 ?255 */
uint8 padding[2];
}ACXBet_Enable_t;
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
#define MAC_ADDR_SIZE 6
-
-#ifndef HOST_COMPILE
-#define HOST_COMPILE /* temp fix for suppl build err */
-#endif
-
#ifdef HOST_COMPILE
#else
typedef struct macAddress_t
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
Mailbox error - Mailbox queue callback for case of timeout/error */
#ifdef USE_RECOVERY
whalCtrl_RegisterErrorsCallbacks(hWhalCtrl);
- #else
+ #else
CmdQueue_RegisterForErrorCB(pWhalCtrl->hCmdQueue, CBFunc, CBObj);
#endif
break;
* DESCRIPTION: Read ConfigOption information element from the wlan hardware.
* This is a special case where the data is already in the mailbox
* after wlan hardware reset and no interrogate command should be sent.
- * This read-only IE provides information stored in the adaptor\92s
+ * This read-only IE provides information stored in the adaptor\8aö
* non-volatile memory to host.
*
* INPUTS: None
Move Firmware download and eepromless functions into shmFwCtrl
Remove Info mailbox
Call whalBus to config queue addresses (ConfigHw)
- Move Utilities (print buffer, \85) from whalParams to shmUtils
+ Move Utilities (print buffer, ? from whalParams to shmUtils
Move DmaParams definitions to bus access
System
Add bus access objects into source.mak
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
{
return NOK;
}
- os_memoryZero(hOs, (*pFsm), sizeof(fsm_stateMachine_t)); /* Dm: Fix */
/* allocate memory for FSM matrix */
(*pFsm)->stateEventMatrix = (fsm_Matrix_t)os_memoryAlloc(hOs, MaxNoOfStates * MaxNoOfEvents * sizeof(fsm_actionCell_t));
os_memoryFree(hOs, *pFsm, sizeof(fsm_stateMachine_t));
return NOK;
}
- os_memoryZero(hOs, (*pFsm)->stateEventMatrix,
- (MaxNoOfStates * MaxNoOfEvents * sizeof(fsm_actionCell_t)));
+
/* update pFsm structure with parameters */
(*pFsm)->MaxNoOfStates = MaxNoOfStates;
(*pFsm)->MaxNoOfEvents = MaxNoOfEvents;
*currentState = pFsm->stateEventMatrix[(*currentState * pFsm->ActiveNoOfEvents) + event].nextState;
/* activate transition function */
- if( !(*pFsm->stateEventMatrix[(oldState * pFsm->ActiveNoOfEvents) + event].actionFunc) ) {
- return(NOK);
- }
status = (*pFsm->stateEventMatrix[(oldState * pFsm->ActiveNoOfEvents) + event].actionFunc)(pData);
return status;
**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
/* calculate the number of buffers needed */
dataBufNum = (len / tempBuffersPool->buffersSize) + 1;
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
allocBdTmp = pMemMngr->firstFreeBD;
*bdPtr = pMemMngr->firstFreeBD;
/* check if we have enough memory - Data buffers (in the selected pool) and Bds */
if ((pMemMngr->numFreeBD < dataBufNum) || (tempBuffersPool->numFreeDataBuf < dataBufNum))
{
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
WLAN_REPORT_ERROR(pMemMngr->hReport, MEM_MGR_MODULE_LOG,
("DB: mem_allocDataBuf: not enough memory numFreeBD=%d numFreeDataBuf=%d in Pool number=%d req DataBufs=%d\n",
pMemMngr->numFreeBD, tempBuffersPool->numFreeDataBuf,poolIndex, dataBufNum));
pMemMngr->numFreeBD -= dataBufNum;
tempBuffersPool->numFreeDataBuf -= dataBufNum;
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return OK;
}
return NOK;
}
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
allocBdTmp = pMemMngr->firstFreeBD;
*bdPtr = pMemMngr->firstFreeBD;
/* check if we have enough Bds */
if (pMemMngr->numFreeBD < bdNumber)
{
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
WLAN_REPORT_ERROR(pMemMngr->hReport, MEM_MGR_MODULE_LOG,
("DB: wlan_memMngrAllocBDs: not enough memory\n"));
*bdPtr = NULL;
/* update counter of free Bds */
pMemMngr->numFreeBD -= bdNumber;
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return OK;
}
}
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
/* check if we have enough free Msdu's */
if (pMemMngr->firstFreeMSDU == NULL)
/* no free MSDU buffers */
WLAN_REPORT_ERROR(pMemMngr->hReport, MEM_MGR_MODULE_LOG,
("wlan_memMngrAllocMSDU no free MSDU in MemMngr !!!\n"));
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
memMngrPrint(hMemMngr);
/* In case we dont have free msdu - free the allocated Bds */
/* update counter of free msdu's */
pMemMngr->numFreeMSDU--;
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
(*MSDUPtr)->nextFreeMSDU = NULL;
(*MSDUPtr)->freeFunc = NULL;
{
memMngr_t *pMemMngr = (memMngr_t *)hMemMngr;
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
if (pMemMngr->firstFreeMSDU == NULL)
{
/* no free MSDU buffers */
WLAN_REPORT_ERROR(pMemMngr->hReport, MEM_MGR_MODULE_LOG,
("wlan_memMngrAllocMSDUBufferOnly no free MSDU in MemMngr !!!\n"));
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
*MSDUPtr = NULL;
return NOK;
}
/* update counter of free msdu's */
pMemMngr->numFreeMSDU--;
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
(*MSDUPtr)->nextFreeMSDU = NULL;
(*MSDUPtr)->freeFunc = NULL;
{
WLAN_REPORT_ERROR(pMemMngr->hReport, MEM_MGR_MODULE_LOG,
("wlan_memMngrFreeListOfMSDU This MSDU is already free\n"));
- //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return NOK;
}
msduTmp = nextTmpMsdu;
}
}
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
/* reset the fields of the MSDU buffer */
pMemMngr->msduPool[handle].firstBDPtr = NULL;
pMemMngr->msduPool[handle].nextFreeMSDU = pMemMngr->firstFreeMSDU;
pMemMngr->firstFreeMSDU = &(pMemMngr->msduPool[handle]);
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
/* !!!!!!!! The free should be only after os_protectUnlock !!!!!!!! */
if (freeFunc != NULL)
{
memMngr_t *pMemMngr = (memMngr_t *)hMemMngr;
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
if (pMemMngr->buffersPool[poolIndex].firstFreeDataBuf == NULL) {
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
return NOK;
}
dataBuf = pMemMngr->buffersPool[poolIndex].firstFreeDataBuf;
pMemMngr->buffersPool[poolIndex].firstFreeDataBuf = pMemMngr->buffersPool[poolIndex].firstFreeDataBuf->nextDataBuf;
pMemMngr->buffersPool[poolIndex].numFreeDataBuf--;
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
return OK;
}
bdTmp = &(pMemMngr->bdPool[handle]);
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
while (bdTmp != NULL)
{
{
WLAN_REPORT_ERROR(pMemMngr->hReport, MEM_MGR_MODULE_LOG,
("DB: wlan_memMngrFreeBD FATAL ERROR: bdTmp->refCount < 0\n"));
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
return FALSE;
}
if (dataBuf != NULL)
bdTmp = nextBdTmp;
}
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* END OF CRITICAL SECTION */
return rc;
}
memMngr_t *pMemMngr = (memMngr_t *)hMemMngr;
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* START OF CRITICAL SECTION */
for(count = 0 ; count < pMemMngr->msduMaxNumber ; count++)
{
}
}
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
return OK;
}
if( destMsduHandle == WLAN_DRV_NULL_MEM_HANDLE || sourceMsduHandle == WLAN_DRV_NULL_MEM_HANDLE )
return NOK;
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
sourceMsdu = &(pMemMngr->msduPool[sourceMsduHandle]);
destMsdu = &(pMemMngr->msduPool[destMsduHandle]);
os_memoryCopy(pMemMngr->hOs, (void *)destMsdu->freeArgs, (void *)sourceMsdu->freeArgs,(NUM_OF_FREE_ARGS*sizeof(UINT32)));
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
return OK;
}
memMngr_t *pMemMngr = (memMngr_t *)hMemMngr;
mem_MSDU_T Msdu_tmp;
- os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
+ //os_protectLock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect); /* START OF CRITICAL SECTION */
/* copy msdu 1 to Temporary msdu */
Msdu_tmp.freeFunc = pMsdu_1->freeFunc;
pMsdu_2->firstBDPtr = Msdu_tmp.firstBDPtr;
pMsdu_2->lastBDPtr = Msdu_tmp.lastBDPtr;
- os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
+ //os_protectUnlock(pMemMngr->hOs, pMemMngr->hCriticalSectionProtect);/* END OF CRITICAL SECTION */
return OK;
}
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
#ifdef TI_DBG
-#ifdef TIWLAN_MSM7000
-#define debugFunction(a,b,c)
-#endif
-
#define IF_TIDEBUG(f) if (!((TiDebugFlag & (f))^(f)))
extern unsigned long TiDebugFlag;
ULONG UtilPltRxCal(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, PULONG pOutLength, ULONG InLength);
ULONG utilRxCalibrationStatus(PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, PULONG pOutLength, ULONG InLength);
+ULONG UtilWepKeyGet (PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, ULONG Length);
+ULONG UtilDesiredRatesSet (PTIWLN_ADAPTER_T pAdapter, PUCHAR pData, ULONG Length);
+
#endif /*__OSUTIL_H_*/
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
#include "IPCKernelApi.h"
#ifdef TI_DBG
-#ifndef TIWLAN_MSM7000
-#include "debug.h"
-#endif
+//#include "debug.h"
+#define debugFunction
#endif
TI_STATUS report_setParam(TI_HANDLE hReport, whalParamInfo_t *pParam );
/* return STATUS_INVALID_PARAMETER;*/
// os_protectLock(pAdapter, pAdapter->SystemProtect); /* Bug. Replaced with the line below -- MCS00035801 */
- /* Dm: os_protectLock(( (configMgr_t *)(pAdapter->CoreHalCtx) )->hOs, pAdapter->SystemProtect); */
+ os_protectLock(( (configMgr_t *)(pAdapter->CoreHalCtx) )->hOs, pAdapter->SystemProtect);
/* Initialiaze to TRUE all IOCTL's : Only in few cases there will be IOCTL that will
}
// os_protectUnlock(pAdapter, pAdapter->SystemProtect); /* Bug. Replaced with the line below. -- MCS00035801 */
- /* Dm: os_protectUnlock( ((configMgr_t *)(pAdapter->CoreHalCtx))->hOs, pAdapter->SystemProtect); */
+ os_protectUnlock( ((configMgr_t *)(pAdapter->CoreHalCtx))->hOs, pAdapter->SystemProtect);
return ntStatus;
}
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
*Length = 0;
return NOK;
}
- if (pListEx->NumberOfItems >
- ((0xFFFFFFFFUL - ((ULONG)sizeof(OS_802_11_BSSID_LIST) - 1)) /
- (ULONG)sizeof(OS_802_11_BSSID) + 1)) /* Dm: Security fix */
- {
- printk("TI: %s - Security Error\n", __FUNCTION__);
- PRINT(DBG_IOCTL_LOUD, "Number of AP is too big\n");
- os_memoryFree(pAdapter, pTempData, LocalLength);
- *Length = 0;
- return NOK;
- }
-
- pList = (OS_802_11_BSSID_LIST *)pData;
+
+
+ pList = (OS_802_11_BSSID_LIST*) pData;
pList->NumberOfItems = pListEx->NumberOfItems;
*Length = RetSize = sizeof(OS_802_11_BSSID_LIST) +
key.KeyLength = pWep->KeyLength;
- if( pWep->KeyLength > sizeof(key.KeyMaterial) ) { /* Dm: Security fix */
- printk("TI: %s - Security Error\n", __FUNCTION__);
- return EXTERNAL_SET_PARAM_DENIED;
- }
NdisMoveMemory(key.KeyMaterial, (void *)pWep->KeyMaterial, pWep->KeyLength);
/* Set the MAC Address to zero for WEP */
*Length = pPmkidList->Length;
else
*Length = 0;
- }
- else
+ } else
{
*Length = pPmkidList->Length;
}
Param.paramType = RSN_PMKID_LIST;
Param.paramLength = Length;
- if( Length > sizeof(Param.content) ) { /* Dm: Security fix */
- printk("TI: %s - Security Error\n",__FUNCTION__);
- return EXTERNAL_SET_PARAM_DENIED;
- }
NdisMoveMemory(&Param.content, pData, Length);
status = configMgr_setParam(pAdapter->CoreHalCtx, &Param);
retVal = UtilSetMixedMode(pAdapter, pData+sizeof(InfoCode), PureInfoLength);
break;
case VAL_DEFAULT_KEY_ID:
- retVal = UtilSetParam(pAdapter, RSN_DEFAULT_KEY_ID, pData+sizeof(InfoCode), PureInfoLength);
+ //retVal = UtilSetParam(pAdapter, RSN_DEFAULT_KEY_ID, pData+sizeof(InfoCode), PureInfoLength);
+ retVal = UtilSetParam(pAdapter, RSN_DEFAULT_KEY_ID, pData+sizeof(InfoCode), 4);
break;
default:
PRINT(DBG_IOCTL_LOUD, "case default\n");
return status;
}
+
+ULONG
+UtilWepKeyGet (
+ PTIWLN_ADAPTER_T pAdapter,
+ PUCHAR pData,
+ ULONG Length)
+{
+ securityKeys_t rsnkey;
+ securityKeys_t *wkey;
+ paramInfo_t Param;
+ TI_STATUS status;
+
+ wkey = (securityKeys_t *)pData;
+
+ /* Fill Param fields and get the 802_11 capability information */
+ Param.paramType = RSN_KEY_PARAM;
+ Param.paramLength = Length;
+ rsnkey.keyIndex = wkey->keyIndex;
+ Param.content.pRsnKey = &rsnkey;
+
+ status = configMgr_getParam(pAdapter->CoreHalCtx, &Param);
+
+ if(status != OK)
+ return NOK;
+
+ printk("UtilWepKeyGet 1 KeyIndex %x , keyLength=%d\n",
+ Param.content.pRsnKey->keyIndex, Param.content.pRsnKey->encLen);
+ NdisMoveMemory(wkey, Param.content.pRsnKey, sizeof(securityKeys_t));
+ printk("UtilWepKeyGet 2 KeyIndex %x , keyLength=%d\n",
+ wkey->keyIndex, wkey->encLen);
+ return status;
+}
+
+ULONG
+UtilDesiredRatesSet(
+ PTIWLN_ADAPTER_T pAdapter,
+ PUCHAR pData,
+ ULONG Length
+ )
+{
+ UCHAR rate;
+ ULONG retValue;
+
+ rate = (UCHAR) *(PULONG)pData;
+
+ retValue = UtilSetParam(pAdapter, SITE_MGR_DESIRED_TX_RATE_PARAM, (PUCHAR)&rate, sizeof(UCHAR));
+
+ return retValue;
+
+}
+
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#ifndef ESTA_DRV_INCLUDE_FILE
#define ESTA_DRV_INCLUDE_FILE
-#include <linux/version.h>
#include <linux/completion.h>
#include <linux/netdevice.h>
-#include <linux/interrupt.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#include <asm/arch/gpio.h>
-#else
-#include <mach/gpio.h>
-#endif
+#include <linux/version.h>
-#ifdef CONFIG_ANDROID_POWER
-#include <linux/android_power.h>
-#endif
+//#include <asm/arch/gpio.h>
#include "osTIType.h"
#include "osAdapter.h"
#endif
#include "linux_ioctl_common.h"
+
#define TIWLAN_DRV_NAME "tiwlan"
#define TIWLAN_DRV_IF_NAME TIWLAN_DRV_NAME"%d"
#define TIWLAN_DRV_NAME_WIRELESS_PROTO "IEEE 802.11-DS"
-#ifdef TIWLAN_MSM7000
-extern int trout_wifi_power(int on);
-extern void trout_wifi_reset(int on);
-extern void trout_wifi_set_carddetect(int val);
-#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#define NETDEV_SET_PRIVATE(dev, drv) dev->priv = drv
+#define NETDEV_GET_PRIVATE(dev) dev->priv
+#else
+#define NETDEV_SET_PRIVATE(dev, drv) dev->ml_priv = drv
+#define NETDEV_GET_PRIVATE(dev) dev->ml_priv
+#endif
+
+#define OMAP_WLAN_BASE 0xC8000000 /* VA*/
#ifndef TIWLAN_OMAP1610_REGBASE
#if defined(TIWLAN_OMAP1610_INNOVATOR)
#define TIWLAN_OMAP1610_REGBASE 0xEC100000 /* VA*/
#elif defined(TIWLAN_OMAP1610_WIPP) || defined(TIWLAN_OMAP1610_CRTWIPP)
-#ifndef OMAP_WLAN_BASE
-#define OMAP_WLAN_BASE 0
-#endif
#define TIWLAN_OMAP1610_REGBASE (OMAP_WLAN_BASE+0x100000)
#else
-/* Dm: #error TIWLAN_OMAP1610_REGBASE not defined for this platform */
+#error TIWLAN_OMAP1610_REGBASE not defined for this platform
#endif
#endif /* #ifndef TIWLAN_OMAP1610_REGBASE */
#if defined(TIWLAN_OMAP1610_INNOVATOR)
#define TIWLAN_OMAP1610_IRQ (OMAP_GPIO_IRQ(8))
#elif defined(TIWLAN_OMAP1610_CRTWIPP)
-#define TIWLAN_OMAP1610_IRQ (OMAP_GPIO_IRQ(2))
+#define TIWLAN_OMAP1610_IRQ (OMAP_GPIO_IRQ(83))//68
#elif defined(TIWLAN_OMAP1610_WIPP)
#define TIWLAN_OMAP1610_IRQ (OMAP_GPIO_IRQ(2))
#endif
#endif
-#ifdef CONFIG_TROUT_PWRSINK
-#define PWRSINK_WIFI_PERCENT_BASE 4
-#endif
-
-/* #define DM_USE_WORKQUEUE */
/* Driver structure */
struct tiwlan_net_dev {
+ int magic;
struct list_head list;
tiwlan_region_t acx_mem;
tiwlan_region_t eeprom_image;
tiwlan_region_t firmware_image;
int irq;
-#ifdef DM_USE_WORKQUEUE
- struct workqueue_struct *tiwlan_wq; /* Work Queue */
- struct work_struct tirq; /* Work Task for interrupt */
- struct work_struct tw; /* Work Task for other stuff */
- mem_MSDU_T *txmit_msdu_next;
- mem_MSDU_T *txmit_msdu_last;
- struct work_struct txmit; /* Work Task for transmit */
-#else
struct tasklet_struct tl; /* Control tasklet */
-#endif
-#ifdef CONFIG_TROUT_PWRSINK
- struct delayed_work trxw; /* Work Task for rx watchdog */
-#endif
-#ifdef CONFIG_ANDROID_POWER
- android_suspend_lock_t irq_wake_lock; /* Suspend Lock to keep system awake */
- android_suspend_lock_t xmit_wake_lock;
- android_suspend_lock_t timer_wake_lock;
- android_suspend_lock_t rx_wake_lock;
- int receive_packet; /* 1=packet was pushed to network stack */
-#endif
int interrupt_pending; /* 1=tasklet has to handle interrupts when awakes */
int dma_done;
struct list_head request_q; /* Requests queue: -> tasklet */
struct net_device *netdev;
void *priv; /* Pointer to struct net_device */
-#ifdef DRIVER_PROFILING
+ #ifdef DRIVER_PROFILING
tiwlan_pfofile_t fpro [MAX_PROFILE_BM]; /* Profiler functions */
unsigned max_number_of_timers; /* Maximum number of allocated timers */
unsigned total_us_of_bus_access_cpu_time; /* Total number of CPU time used by the bus driver since CPU estimator started */
unsigned driver_entry_start_time; /* Time measured at the start of last driver entry point */
unsigned bus_driver_entry_start_time; /* Time measured at the start of last bus driver entry point */
-#endif
+ #endif
-#ifdef GWSI_DRIVER
+ #ifdef GWSI_DRIVER
void *gwsi; /* GWSI manager handler */
void *gwsi_ev; /* GWSI event handler */
char gwsi_tester_buf [4096]; /* GWSI tester buffer */
-#endif
+ #endif
};
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#ifndef TI1610_IOCTL_INIT
#define TI1610_IOCTL_INIT
+//jorjin+
+#undef false
+#undef true
+//jorjin-
+
#include <linux/kernel.h>
#include <linux/module.h>
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#define MMC_OMAP_API_H
#ifdef __LINUX__
-#include <asm/io.h> /* include for SDIO Compilation */
+//#include <asm/io.h> /* include for SDIO Compilation */
#endif
/*
/* Request external format */
struct SDIO_Request {
- u16 block_len; /* Block length. Zero means byte mode */
- u8 *buffer; /* Pointer to the data buffer. Data must be
+ unsigned int block_len; /* Block length. Zero means byte mode */
+ unsigned char *buffer; /* Pointer to the data buffer. Data must be
contiguously allocated and write and release
protected by application. */
unsigned long physical_buffer;/* Physical address of the same buffer */
- u16 buffer_len; /* Data buffer length in bytes */
+ unsigned int buffer_len; /* Data buffer length in bytes */
SDIO_Address peripheral_addr;/* SDIO peripheral address */
- u32 acquire_window; /* Time out value. If not zero, means in case SDIO resources
+ unsigned long acquire_window; /* Time out value. If not zero, means in case SDIO resources
are not available, try to acquire it within acquire_window
time. Return with busy resources indication in case
of expiration. */
- u8 enqueue_flag; /* 0 - reject request if bus is not avaialable;
+ unsigned char enqueue_flag; /* 0 - reject request if bus is not avaialable;
1 - put request into waiting list.
This field is relevant only for synchronous requests.
In case acquire_window is not zero - the attempt to wait
SDIO_Handle handle; /* SDIO object handle */
SDIO_Owner owner; /* SDIO object owner handle */
void *user; /* Lower level handle */
- u8 access_flag; /* 0 means write operation !0 - read */
+ unsigned char access_flag; /* 0 means write operation !0 - read */
FNotify fnotify; /* callback for request completion notification */
FError ferror; /* callback for request error notification */
};
FConvert fconvert; /* convert peripheral address to host address function */
} SDIO_ConfigParams;
-/* Clock and DMA threshold values – should be tuned */
+/* Clock and DMA threshold values ??should be tuned */
#define MMC_DEV_MASTER_CLOCK 48000000 /* deviser=MASTER_CLOCK/CLOCK_RATE */
#define MMC_DEV_DATA_ALIGNMENT_DEFAULT 4
#define MMC_DEV_DATA_BLOCK_SIZE_DEFAULT 512
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#ifndef __OS_TYPES_H__
#define __OS_TYPES_H__
-#include <linux/version.h>
-
#ifndef VOID
#define VOID void
#define PVOID void*
#define TRUE 1
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
#if !defined(false)
#define false 0
#endif
#if !defined(true)
#define true 1
#endif
-#endif
#ifndef NULL
#if defined(__cplusplus)
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <linux/netlink.h>
-#include <linux/completion.h>
+#define mike
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
#ifdef TIWLAN_CARDBUS
#include <linux/pci.h>
#else
-#ifdef TIWLAN_OMAP1610
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#include <asm/arch-omap/tc.h>
-#else
-#include <mach/tc.h>
#endif
-#endif
-#ifdef TIWLAN_MSM7000
-#include <linux/mmc/core.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio_func.h>
-#include <linux/mmc/sdio_ids.h>
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#include <asm/arch/io.h>
-#include <asm/arch/hardware.h>
+
+
+//j+
+#include <asm/io.h>
+#include <asm/hardware.h>
#include <asm/arch/irqs.h>
-#else
-#include <mach/io.h>
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-#endif
+#include <asm/arch/gpio.h>
+//j-
+
#endif /* !TIWLAN_CARDBUS */
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/vmalloc.h>
-#include <linux/irq.h>
+#include <linux/irq.h>//g
#include <asm/io.h>
#include <asm/uaccess.h>
#include "Ethernet.h"
#include "tiwlan_profile.h"
-#ifdef CONFIG_TROUT_PWRSINK
-#include <asm/arch/trout_pwrsink.h>
-#define RX_RATE_INTERVAL_SEC 10
-unsigned long num_rx_pkt_new = 0;
-static unsigned long num_rx_pkt_last = 0;
-#endif
-
-#ifdef TIWLAN_MSM7000
-extern unsigned char *get_wifi_nvs_ram(void);
-extern void SDIO_SetFunc( struct sdio_func * );
-static struct proc_dir_entry *tiwlan_calibration;
-static struct completion sdio_wait;
-#endif
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
+#define io_p2v(pa) ((pa) + IO_OFFSET)/* Works for the entire IO Map */
+typedef struct { volatile u32 offset[4096]; } __regbase32;
+#define __REGV32(vaddr) ((__regbase32 *)((vaddr)&~4095)) \
+ ->offset[((vaddr)&4095)>>2]
+#define __REG32(paddr) __REGV32(io_p2v(paddr))
+
+#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= 192)
+#define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? \
+ 192+160 + ((nr) & 0x0f) : \
+ 160 + (nr))
+#endif
+
+//j+
+#define OMAP_GPIO_INDEX(nr) ((nr) & 0x1f)
+#define OMAP_GPIO_BIT(nr) (1 << OMAP_GPIO_INDEX(nr))
+
+//#define OMAP_MPUIO(nr) (192+ (nr))//192
+
+
+//j-
+
+/* IO CONFIG */
+
+#define CONTROL_BASE (0x48002000)
+
+#define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset))
+//#define CONTROL_PADCONF_DSS_DATA17 CONTROL_REG32(0x0B0)
+#define CONTROL_PADCONF_MCBSP1_CLKX CONTROL_REG32(0x198)
+#define CONTROL_PADCONF_DSS_DATA12B CONTROL_REG32(0x0F4)
+#define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0D8)
+#define CONTROL_PADCONF_DSS_PCLK CONTROL_REG32(0x0D4)
+#define CONTROL_PADCONF_SPI1_SIMO CONTROL_REG32(0x110)
+#define CONTROL_PADCONF_SPI2_SOMI CONTROL_REG32(0x118)
+
+#define GPIOX_BASE(X) (0x49050000+(0x2000*((X)-2))) //Start from GPIO2
+
+#define GPIO1_SYSCONFIG __REG32((GPIO1_BASE+0x10))
+#define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10))
+#define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10))
+
+/* GPIO 1 */
+#define GPIO1_BASE 0x48310000
+#define GPIO1_REG32(offset) __REG32(GPIO1_BASE + (offset))
+#define GPIO1_IRQENABLE1 GPIO1_REG32(0x01C)
+#define GPIO1_IRQSTATUS1 GPIO1_REG32(0x018)
+#define GPIO1_IRQENABLE2 GPIO1_REG32(0x02C)
+#define GPIO1_IRQSTATUS2 GPIO1_REG32(0x028)
+#define GPIO1_WAKEUPENABLE GPIO1_REG32(0x020)
+#define GPIO1_RISINGDETECT GPIO1_REG32(0x048)
+#define GPIO1_FALLINGDETECT GPIO1_REG32(0x04C)
+#define GPIO1_DATAIN GPIO1_REG32(0x038)
+#define GPIO1_OE GPIO1_REG32(0x034)
+#define GPIO1_DATAOUT GPIO1_REG32(0x03C)
+#define GPIO1_LEVELDETECT0 GPIO1_REG32(0x040)
+
+/* GPIO 2 */
+#define GPIO2_BASE GPIOX_BASE(2)
+#define GPIO2_REG32(offset) __REG32(GPIO2_BASE + (offset))
+#define GPIO2_IRQENABLE1 GPIO2_REG32(0x01C)
+#define GPIO2_IRQSTATUS1 GPIO2_REG32(0x018)
+#define GPIO2_IRQENABLE2 GPIO2_REG32(0x02C)
+#define GPIO2_IRQSTATUS2 GPIO2_REG32(0x028)
+#define GPIO2_WAKEUPENABLE GPIO2_REG32(0x020)
+#define GPIO2_RISINGDETECT GPIO2_REG32(0x048)
+#define GPIO2_FALLINGDETECT GPIO2_REG32(0x04C)
+#define GPIO2_DATAIN GPIO2_REG32(0x038)
+#define GPIO2_OE GPIO2_REG32(0x034)
+#define GPIO2_DATAOUT GPIO2_REG32(0x03C)
+#define GPIO2_LEVELDETECT0 GPIO2_REG32(0x040)
+#define GPIO2_DEBOUNCENABLE GPIO2_REG32(0x050)
+#define GPIO2_DEBOUNCINGTIME GPIO2_REG32(0x054)
+
+/* GPIO 3 */
+#define GPIO3_BASE GPIOX_BASE(3)
+#define GPIO3_REG32(offset) __REG32(GPIO3_BASE + (offset))
+#define GPIO3_IRQENABLE1 GPIO3_REG32(0x01C)
+#define GPIO3_IRQSTATUS1 GPIO3_REG32(0x018)
+#define GPIO3_IRQENABLE2 GPIO3_REG32(0x02C)
+#define GPIO3_IRQSTATUS2 GPIO3_REG32(0x028)
+#define GPIO3_WAKEUPENABLE GPIO3_REG32(0x020)
+#define GPIO3_RISINGDETECT GPIO3_REG32(0x048)
+#define GPIO3_FALLINGDETECT GPIO3_REG32(0x04C)
+#define GPIO3_DATAIN GPIO3_REG32(0x038)
+#define GPIO3_OE GPIO3_REG32(0x034)
+#define GPIO3_DATAOUT GPIO3_REG32(0x03C)
+#define GPIO3_LEVELDETECT0 GPIO3_REG32(0x040)
+#define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050)
+#define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054)
/* Drivers list */
static LIST_HEAD(tiwlan_drv_list);
MODULE_DESCRIPTION("TI WLAN Embedded Station Driver");
MODULE_LICENSE("GPL");
-extern int packed_struct_tst(void);
+extern int packed_struct_tst(void);
extern int proc_stat_init(TI_HANDLE);
extern int proc_stat_destroy(void);
+/* linux/irq.h declarations */
+extern void disable_irq(unsigned int);
+extern void enable_irq(unsigned int);
+
+
typedef void (* tiwlan_drv_isr_t)(int, void *, struct pt_regs *);
/* network device driver interface */
#define OS_WRITE_REG(drv,reg,val) \
- os_hwWriteMemRegisterUINT32(drv, (UINT32 *)((unsigned long)drv->acx_reg.va + reg), (__u32)(val))
+ os_hwWriteMemRegisterUINT32(drv, (UINT32 *)((unsigned long)drv->acx_reg.va + reg), (__u32)(val))
#define OS_READ_REG(drv,reg,val) \
- os_hwReadMemRegisterUINT32(drv, (UINT32 *)((unsigned long)drv->acx_reg.va + reg), &val)
+ os_hwReadMemRegisterUINT32(drv, (UINT32 *)((unsigned long)drv->acx_reg.va + reg), &val)
-#ifdef TIWLAN_OMAP1610
static void omap_memif_init(void)
{
- printk ("First function offset is: %p\n", omap_memif_init);
-#if defined(TIWLAN_OMAP1610_INNOVATOR)
- print_info("Setting CS1 Ref Clock = TC/4. \n");
- omap_writel(0x00000004, 0xFFFECC40 ); /* wlan change for cs2 to dynamic wait state */
- omap_writel(0x0000113a, 0xFFFECC18 ); /* EMIFS (nCS2) configuration */
-#elif defined(TIWLAN_OMAP1610_WIPP) || defined(TIWLAN_OMAP1610_CRTWIPP)
-
-#if defined(TIWLAN_OMAP1610_CRTWIPP)
- /*
- Init the GPIO to output*/
-
- /* Set OMAP pin H19 to GPIO57*/
+ //printk("set gpio_83 to gpio high\n");
- omap_writel(omap_readl(0xFFFE1014) | 0x00E00000, 0xFFFE1014 );
+// CONTROL_PADCONF_DSS_DATA17 &= ~0xFF000000; //clear gpio_9
+// CONTROL_PADCONF_DSS_DATA17 = CONTROL_PADCONF_DSS_DATA17 | 0x3000000; //set gpio_9 to gpio high
- /*ELP_REQ (GPIO_57) by GPIO_DIRECTION - set it as output*/
- omap_writel(omap_readl(0xFFFBBC34) & (~0x00000200), 0xFFFBBC34 );
-#endif /* TIWLAN_OMAP1610_CRTWIPP */
+// GPIO1_OE |= OMAP_GPIO_BIT(9); //set gpio_9 input
+// GPIO1_FALLINGDETECT |= OMAP_GPIO_BIT(9);
-/* The below configuration enables GPIO25 and GPIO_27 as output GPIOs - for debug purposes */
-#if defined(TIWLAN_OMAP1610_CRTWIPP_GPIO_DEBUG)
-
- omap_writel(omap_readl(0xFFFE1030) | 0x00000E00, 0xFFFE1030 );/* enable GPIO25 */
- omap_writel(omap_readl(0xFFFE1030) | 0x00000038, 0xFFFE1030 );/* enable GPIO27 */
-
- omap_writel(omap_readl(0xFFFBEC34) & (~0x00000200), 0xFFFBEC34 );/* Setting direction (as output) for GPIO25 */
- omap_writel(omap_readl(0xFFFBEC34) & (~0x00000800), 0xFFFBEC34 );/* Setting direction (as output) for GPIO27 */
-#endif /* TIWLAN_OMAP1610_CRTWIPP_GPIO_DEBUG */
+/*
+ GPIO3_OE |= OMAP_GPIO_BIT(86); //set gpio_86 input
+ GPIO3_IRQENABLE1 |= OMAP_GPIO_BIT(86); //enable irq gpio_84
+ GPIO3_FALLINGDETECT |= OMAP_GPIO_BIT(86);
+*/
+ //CONTROL_PADCONF_DSS_PCLK &= ~0xFF000000;
+ //CONTROL_PADCONF_DSS_PCLK = CONTROL_PADCONF_DSS_PCLK | 0x001c0000; //set to gpio mode
+#if 1
+ /* omap3530 */
+ CONTROL_PADCONF_DSS_DATA12B &= ~0xFF000000;
+ CONTROL_PADCONF_DSS_DATA12B = CONTROL_PADCONF_DSS_DATA12B | 0x01040000; //set to gpio mode
- /* RECOVERY*/
- print_info("Hard reset,perform PMEN toggle\n");
- os_hardResetTnetw();
+ GPIO3_OE |= OMAP_GPIO_BIT(83); //set gpio_83 input
+ GPIO3_IRQENABLE1 |= OMAP_GPIO_BIT(83); //enable irq gpio_83
+ GPIO3_FALLINGDETECT |= OMAP_GPIO_BIT(83);
+#else
+ /* omap3530 */
+ CONTROL_PADCONF_DSS_VSYNC &= ~0x0000FF00;
+ CONTROL_PADCONF_DSS_VSYNC = CONTROL_PADCONF_DSS_VSYNC | 0x00000104; //set to gpio mode
- print_info("Setting CS2 Ref Clock = TC/2. \n");
- __raw_writel(0x1, TIWLAN_OMAP1610_REGBASE+0x4cc); /* CLK=80MHz */
- omap_writel(0x20, EMIF_CFG_DYNAMIC_WS); /* Full handshake on CS2 */
- omap_writel(0x2441, EMIFS_CS2_CONFIG); /* 0x2021 on reworked board */
- omap_writel(0, EMIFS_ACS2);
+ GPIO3_OE |= OMAP_GPIO_BIT(68); //set gpio_68 input
+ GPIO3_IRQENABLE1 |= OMAP_GPIO_BIT(68); //enable irq gpio_68
+ GPIO3_FALLINGDETECT |= OMAP_GPIO_BIT(68);
+#endif
- print_info("%x=0x%lx\n", 0xFFFECC40, omap_readl(0xFFFECC40) );
- print_info("%x=0x%lx\n", 0xFFFECC18, omap_readl(0xFFFECC18) );
- print_info("%x=0x%lx\n", 0xFFFECC58, omap_readl(0xFFFECC58) );
-#endif /* WIPP, CRTWIPP */
+ //printk("set gpio_83 to gpio high end\n");
}
-#endif
static int tiwlan_register_events(tiwlan_net_dev_t *drv)
{
static int tiwlan_deb_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- __u32 addr=memdebug_addr;
- __u32 size=memdebug_size;
- __u32 trans_size=memdebug_trans_size;
- __u32 end;
- int in_line=0, max_in_line;
- int limit=count-80;
- int i=0;
- static int toggle;
-
- *eof = 1;
- if (!addr || !trans_size)
- return 0;
-
- /* fixme: add address validation */
-
- if (!size)
- size=1;
-
- end = addr + size*trans_size;
- if (trans_size==4)
- max_in_line = 4;
- else if (trans_size==2)
- max_in_line = 8;
- else
- max_in_line = 16;
-
- while(i<limit && addr<end)
- {
- if (!in_line)
- i += sprintf(page+i, "0x%08x: ", addr);
- if (trans_size==4)
- {
- i += sprintf(page+i, "0x%08x", *(__u32 *)addr);
- addr += 4;
- }
- else if (trans_size==2)
- {
- i += sprintf(page+i, "0x%04x", *(__u16 *)addr);
- addr += 2;
- }
- else
- {
- i += sprintf(page+i, "0x%02x", *(__u8 *)addr);
- addr += 1;
- }
- if (++in_line < max_in_line)
- *(page+i++)=' ';
- else
- {
- *(page+i++)='\n';
- in_line = 0;
- }
- }
- *(page+i++)='\n';
- /* For some reason read proc is get called twice for
- each "cat" operation
- */
- if (toggle)
- memdebug_addr = addr;
- toggle = !toggle;
+ __u32 addr=memdebug_addr;
+ __u32 size=memdebug_size;
+ __u32 trans_size=memdebug_trans_size;
+ __u32 end;
+ int in_line=0, max_in_line;
+ int limit=count-80;
+ int i=0;
+ static int toggle;
+
+ *eof = 1;
+ if (!addr || !trans_size)
+ return 0;
+
+ /* fixme: add address validation */
+
+ if (!size)
+ size=1;
+
+ end = addr + size*trans_size;
+ if (trans_size==4)
+ max_in_line = 4;
+ else if (trans_size==2)
+ max_in_line = 8;
+ else
+ max_in_line = 16;
+
+ while(i<limit && addr<end)
+ {
+ if (!in_line)
+ i += sprintf(page+i, "0x%08x: ", addr);
+ if (trans_size==4)
+ {
+ i += sprintf(page+i, "0x%08x", *(__u32 *)addr);
+ addr += 4;
+ }
+ else if (trans_size==2)
+ {
+ i += sprintf(page+i, "0x%04x", *(__u16 *)addr);
+ addr += 2;
+ }
+ else
+ {
+ i += sprintf(page+i, "0x%02x", *(__u8 *)addr);
+ addr += 1;
+ }
+ if (++in_line < max_in_line)
+ *(page+i++)=' ';
+ else
+ {
+ *(page+i++)='\n';
+ in_line = 0;
+ }
+ }
+ *(page+i++)='\n';
+ /* For some reason read proc is get called twice for
+ each "cat" operation
+ */
+ if (toggle)
+ memdebug_addr = addr;
+ toggle = !toggle;
- return i;
+ return i;
}
static char *rm_get_token(const char **p_buffer, unsigned long *p_buffer_len,
char *token, unsigned long token_len,
char del)
{
- const char *buffer=*p_buffer;
- __u32 buffer_len = *p_buffer_len;
+ const char *buffer=*p_buffer;
+ __u32 buffer_len = *p_buffer_len;
- while(buffer_len && token_len && *buffer!=del && *buffer)
- {
- *token++ = *buffer++;
- --buffer_len;
- --token_len;
- }
- while (buffer_len && *buffer==del)
- {
- ++buffer;
- --buffer_len;
- }
- *token = 0;
- *p_buffer = buffer;
- *p_buffer_len = buffer_len;
- return token;
+ while(buffer_len && token_len && *buffer!=del && *buffer)
+ {
+ *token++ = *buffer++;
+ --buffer_len;
+ --token_len;
+ }
+ while (buffer_len && *buffer==del)
+ {
+ ++buffer;
+ --buffer_len;
+ }
+ *token = 0;
+ *p_buffer = buffer;
+ *p_buffer_len = buffer_len;
+ return token;
}
static int tiwlan_deb_write_proc(struct file *file, const char *buffer,
unsigned long count, void *data)
{
- __u32 addr, size;
- char token[15];
- __u32 value;
- char *end;
- int buflen=count;
-
- /* buffer format is:
- d{w,h,b} addr[/size]
- s{w,h,b} addr=value
- */
- /* Parse string */
- rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
- if (token[0]=='d')
- {
- /* Display */
- if (!strcmp(token, "dw"))
- memdebug_trans_size = 4;
- else if (!strcmp(token, "dh"))
- memdebug_trans_size = 2;
- else if (!strcmp(token, "db"))
- memdebug_trans_size = 1;
- else
- {
- printk(KERN_INFO "rm: mem file write op is dw|dh|db|sw|sh|sb\n");
- return buflen;
- }
- /* Get address */
- rm_get_token(&buffer, &count, token, sizeof(token)-1, '/');
- addr = simple_strtoul(token, &end, 0);
- if ((end && *end) /* || !iopa(addr)*/)
- {
- printk(KERN_INFO "rm: address <%s> is invalid\n", token);
- return buflen;
- }
- if ((addr & (memdebug_trans_size-1)))
- {
- printk(KERN_INFO "rm: warning: address 0x%x is not aligned to size %u\n",
- addr, memdebug_trans_size);
- }
- memdebug_addr = addr;
- if (count)
- {
- /* Get size */
- rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
- size = simple_strtoul(token, &end, 0);
- if (end && *end)
- {
- printk(KERN_INFO "rm: size <%s> is invalid. end=<%s>\n",
- token, end);
- return buflen;
- }
- memdebug_size = size;
- }
- return buflen;
- }
- if (token[0]=='s')
- {
- /* Display */
- if (!strcmp(token, "sw"))
- size = 4;
- else if (!strcmp(token, "sh"))
- size = 2;
- else if (!strcmp(token, "sb"))
- size = 1;
- else
- {
- printk(KERN_INFO "rm: mem file write op is dw|dh|db|sw|sh|sb\n");
+ __u32 addr, size;
+ char token[15];
+ __u32 value;
+ char *end;
+ int buflen=count;
+
+ /* buffer format is:
+ d{w,h,b} addr[/size]
+ s{w,h,b} addr=value
+ */
+ /* Parse string */
+ rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
+ if (token[0]=='d')
+ {
+ /* Display */
+ if (!strcmp(token, "dw"))
+ memdebug_trans_size = 4;
+ else if (!strcmp(token, "dh"))
+ memdebug_trans_size = 2;
+ else if (!strcmp(token, "db"))
+ memdebug_trans_size = 1;
+ else
+ {
+ printk(KERN_INFO "rm: mem file write op is dw|dh|db|sw|sh|sb\n");
+ return buflen;
+ }
+ /* Get address */
+ rm_get_token(&buffer, &count, token, sizeof(token)-1, '/');
+ addr = simple_strtoul(token, &end, 0);
+ if ((end && *end) /* || !iopa(addr)*/)
+ {
+ printk(KERN_INFO "rm: address <%s> is invalid\n", token);
+ return buflen;
+ }
+ if ((addr & (memdebug_trans_size-1)))
+ {
+ printk(KERN_INFO "rm: warning: address 0x%x is not aligned to size %u\n",
+ addr, memdebug_trans_size);
+ }
+ memdebug_addr = addr;
+ if (count)
+ {
+ /* Get size */
+ rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
+ size = simple_strtoul(token, &end, 0);
+ if (end && *end)
+ {
+ printk(KERN_INFO "rm: size <%s> is invalid. end=<%s>\n",
+ token, end);
return buflen;
- }
- /* Get address */
- rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
- addr = simple_strtoul(token, &end, 0);
- if ((end && *end) /*|| !iopa(addr)*/)
- {
- printk(KERN_INFO "rm: address <%s> is invalid\n", token);
+ }
+ memdebug_size = size;
+ }
+ return buflen;
+ }
+ if (token[0]=='s')
+ {
+ /* Display */
+ if (!strcmp(token, "sw"))
+ size = 4;
+ else if (!strcmp(token, "sh"))
+ size = 2;
+ else if (!strcmp(token, "sb"))
+ size = 1;
+ else
+ {
+ printk(KERN_INFO "rm: mem file write op is dw|dh|db|sw|sh|sb\n");
+ return buflen;
+ }
+ /* Get address */
+ rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
+ addr = simple_strtoul(token, &end, 0);
+ if ((end && *end) /*|| !iopa(addr)*/)
+ {
+ printk(KERN_INFO "rm: address <%s> is invalid\n", token);
+ return buflen;
+ }
+ if ((addr & (size-1)))
+ {
+ printk(KERN_INFO "rm: warning: address 0x%x is not aligned to size %u\n",
+ addr, size);
+ }
+
+ /* Get value */
+ rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
+ value = simple_strtoul(token, &end, 0);
+ if (end && *end)
+ {
+ printk(KERN_INFO "rm: value <%s> is invalid. end <%s>\n",
+ token, end);
+ return buflen;
+ }
+ if (size==4)
+ *(__u32 *)addr = value;
+ else if (size==2)
+ {
+ if (value > 0xffff)
+ {
+ printk(KERN_INFO "rm: value <%s> is out of range\n", token);
return buflen;
- }
- if ((addr & (size-1)))
- {
- printk(KERN_INFO "rm: warning: address 0x%x is not aligned to size %u\n",
- addr, size);
- }
-
- /* Get value */
- rm_get_token(&buffer, &count, token, sizeof(token)-1, ' ');
- value = simple_strtoul(token, &end, 0);
- if (end && *end)
- {
- printk(KERN_INFO "rm: value <%s> is invalid. end <%s>\n",
- token, end);
+ }
+ *(__u16 *)addr = value;
+ }
+ else
+ {
+ if (value > 0xff)
+ {
+ printk(KERN_INFO "rm: value <%s> is out of range\n", token);
return buflen;
- }
- if (size==4)
- *(__u32 *)addr = value;
- else if (size==2)
- {
- if (value > 0xffff)
- {
- printk(KERN_INFO "rm: value <%s> is out of range\n", token);
- return buflen;
- }
- *(__u16 *)addr = value;
- }
- else
- {
- if (value > 0xff)
- {
- printk(KERN_INFO "rm: value <%s> is out of range\n", token);
- return buflen;
- }
- *(__u8 *)addr = value;
- }
- memdebug_addr = addr;
- memdebug_size = 1;
- memdebug_trans_size = size;
- }
- else
- printk(KERN_INFO "rm: operation <%s> is not supported\n", token);
- return buflen;
-}
-
-#ifdef TIWLAN_MSM7000
-#define WIFI_NVS_LEN_OFFSET 0x0C
-#define WIFI_NVS_DATA_OFFSET 0x40
-#define WIFI_NVS_MAX_SIZE 0x800UL
-
-static unsigned long tiwlan_get_nvs_size( void )
-{
- unsigned char *ptr;
- unsigned long len;
-
- ptr = get_wifi_nvs_ram();
- if( ptr == NULL ) {
- return 0;
- }
- /* Size in format LE assumed */
- memcpy( (void *)&len, (void *)(ptr + WIFI_NVS_LEN_OFFSET), sizeof(len) );
- len = min( len, (WIFI_NVS_MAX_SIZE-WIFI_NVS_DATA_OFFSET) );
- return len;
-}
-
-static int tiwlan_calibration_read_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- unsigned char *ptr;
- unsigned long len;
-
- ptr = get_wifi_nvs_ram();
- if( ptr == NULL ) {
- return 0;
- }
- len = tiwlan_get_nvs_size();
- /* i += sprintf(page+i, "WiFi Calibration Size = %lu %x bytes\n", len); */
- memcpy( (void *)page, (void *)(ptr + WIFI_NVS_DATA_OFFSET), len );
- return len;
+ }
+ *(__u8 *)addr = value;
+ }
+ memdebug_addr = addr;
+ memdebug_size = 1;
+ memdebug_trans_size = size;
+ }
+ else
+ printk(KERN_INFO "rm: operation <%s> is not supported\n", token);
+ return buflen;
}
-static int tiwlan_calibration_write_proc(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- return 0;
-}
-#endif
/*********************************************************************************************/
/* Impelementation */
static int tiwlan_drv_net_open(struct net_device * dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev);
ti_nodprintf(TIWLAN_LOG_INFO, "tiwlan_drv_net_open()\n");
{
struct sk_buff *skb = (struct sk_buff *) pSkb;
- /* print_deb("^^^ free %p %d bytes (%s)\n", skb->data, skb->len, (status==OK) ? "OK" : "ERROR" ); */
+/* print_deb("^^^ free %p %d bytes (%s)\n", skb->data, skb->len, (status==OK) ? "OK" : "ERROR" ); */
dev_kfree_skb(skb);
}
-#ifdef DM_USE_WORKQUEUE
-void tiwlan_add_msdu(tiwlan_net_dev_t *drv, mem_MSDU_T *pMsdu)
-{
- if( pMsdu == NULL )
- return;
- pMsdu->msdu_next = NULL;
- if( drv->txmit_msdu_next != NULL ) {
- drv->txmit_msdu_last->msdu_next = pMsdu;
- }
- else {
- drv->txmit_msdu_next = pMsdu;
- }
- drv->txmit_msdu_last = pMsdu;
-}
-
-mem_MSDU_T *tiwlan_del_msdu(tiwlan_net_dev_t *drv)
-{
- mem_MSDU_T *pMsdu = NULL;
-
- if( drv->txmit_msdu_next != NULL ) {
- pMsdu = drv->txmit_msdu_next;
- drv->txmit_msdu_next = pMsdu->msdu_next;
- if( drv->txmit_msdu_next == NULL ) { /* Last MSDU */
- drv->txmit_msdu_last = NULL;
- }
- }
- return( pMsdu );
-}
-
-static void tiwlan_xmit_handler( struct work_struct *work )
-{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)container_of( work, struct tiwlan_net_dev, txmit );
- mem_MSDU_T *pMsdu;
- unsigned long flags;
-
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
- do {
- spin_lock_irqsave(&drv->lock, flags);
- pMsdu = tiwlan_del_msdu(drv);
- spin_unlock_irqrestore(&drv->lock, flags);
- if( pMsdu ) {
- configMgr_sendMsdu(drv->adapter.CoreHalCtx, pMsdu, 0);
- }
- } while( pMsdu != NULL );
-#ifdef CONFIG_ANDROID_POWER
- android_unlock_suspend( &drv->xmit_wake_lock );
-#endif
-}
-#endif
/* send packet from Linux TCP/IP stack to WLAN
*/
static int tiwlan_drv_net_xmit(struct sk_buff *skb, struct net_device *dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev);
int status;
- mem_MSDU_T *pMsdu;
+ mem_MSDU_T* pMsdu;
UINT32 packetHeaderLength;
#ifndef NO_COPY_SKB
mem_BD_T *pCurBd=0;
#endif
-#ifdef DRIVER_PROFILE
os_profile (drv, 0, 0);
-#endif
bm_trace(20, skb->len, 0);
#ifdef NO_COPY_SKB
++drv->alloc_msdu_failures;
return -ENOMEM;
}
- /* print_deb("$$$ configMgr_allocMSDUBufferOnly()=OK pMsdu=%p\n", pMsdu ); */
+/* print_deb("$$$ configMgr_allocMSDUBufferOnly()=OK pMsdu=%p\n", pMsdu ); */
status = configMgr_allocBDs(drv->adapter.CoreHalCtx, 1, &pCurBd);
configMgr_memMngrFreeMSDU(drv->adapter.CoreHalCtx, pMsdu->handle);
return -ENOMEM;
}
- /* print_deb("$$$ configMgr_allocBDs()=OK pCurBd=%p first=%p\n", pCurBd, pMsdu->firstBDPtr ); */
+/* print_deb("$$$ configMgr_allocBDs()=OK pCurBd=%p first=%p\n", pCurBd, pMsdu->firstBDPtr ); */
pMsdu->freeFunc = sendFreeFunc;
pMsdu->freeArgs[0] = (UINT32) skb;
* Allocate enough place also for 802.11 header (24 bytes or 26 for QoS) and LLC (8 bytes)
* to replace the Ethernet header (14 bytes)
*/
- status = configMgr_allocMSDU(drv->adapter.CoreHalCtx, &pMsdu,
+ status = configMgr_allocMSDU(drv->adapter.CoreHalCtx, &pMsdu,
skb->len + packetHeaderLength, OS_ABS_TX_MODULE);
- if(status != OK)
- {
- /*ti_dprintf(TIWLAN_LOG_ERROR, " configMgr_allocMSDU failed !!!\n");*/
- ++drv->alloc_msdu_failures;
- return -ENOMEM;
- }
+ if(status != OK)
+ {
+ /*ti_dprintf(TIWLAN_LOG_ERROR, " configMgr_allocMSDU failed !!!\n");*/
+ ++drv->alloc_msdu_failures;
+ return -ENOMEM;
+ }
/*
* case 1: only legacy wlan header
pMsdu->dataLen = skb->len;
pMsdu->firstBDPtr->length = pMsdu->dataLen + pMsdu->firstBDPtr->dataOffset;
- drv->stats.tx_packets++;
- drv->stats.tx_bytes += skb->len;
- dev_kfree_skb(skb);
+ drv->stats.tx_packets++;
+ drv->stats.tx_bytes += skb->len;
+ dev_kfree_skb(skb);
#endif /* NO_COPY_SKB */
- pMsdu->txFlags |= TX_DATA_FROM_OS;
- pMsdu->qosTag = 0;
- status = OK;
+ pMsdu->txFlags |= TX_DATA_FROM_OS;
+ pMsdu->qosTag = 0;
+ status = OK;
-#ifdef TI_DBG
+ #ifdef TI_DBG
/* Set packet-os-in time stamp */
/* TODO: the skb time stamp is not good */
/* printk ("\n### sec=%u, usec=%u", skb->stamp.tv_sec, skb->stamp.tv_usec);*/
/* pMsdu->timeStamp[0] = skb->stamp.tv_sec * 1000000 + skb->stamp.tv_usec; */
/* pMsdu->timeStampNum = 1; */
-#endif
+ #endif
- bm_trace(21, 0, 0);
+ bm_trace(21, 0, 0);
/*
* Propagate Msdu through Config Manager.
* Set DTag to zero
* (note that classification is further handled in the Core)
*/
- if (status == OK) {
-#ifdef DM_USE_WORKQUEUE
- unsigned long flags;
-
- spin_lock_irqsave(&drv->lock, flags);
- tiwlan_add_msdu(drv, pMsdu);
- spin_unlock_irqrestore(&drv->lock, flags);
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
- if( queue_work( drv->tiwlan_wq, &drv->txmit ) != 0 ) {
-#ifdef CONFIG_ANDROID_POWER
- android_lock_suspend( &drv->xmit_wake_lock );
-#endif
- }
-#else
- status = configMgr_sendMsdu(drv->adapter.CoreHalCtx, pMsdu, 0);
-#endif
- }
- else
- configMgr_memMngrFreeMSDU (drv->adapter.CoreHalCtx, (UINT32) pMsdu); /* If status != OK , we won't send the MSDU, so we need to free it */
+ if (status == OK)
+ status = configMgr_sendMsdu(drv->adapter.CoreHalCtx, pMsdu, 0);
+ else
+ configMgr_memMngrFreeMSDU (drv->adapter.CoreHalCtx, (UINT32) pMsdu); /* If status != OK , we won't send the MSDU, so we need to free it */
- if(unlikely(status != OK))
- {
- drv->stats.tx_errors++;
+ if(unlikely(status != OK))
+ {
+ drv->stats.tx_errors++;
#ifdef NO_COPY_SKB
- dev_kfree_skb(skb);
+ dev_kfree_skb(skb);
#endif
- }
+ }
- bm_trace(22, 0, 0);
-#ifdef DRIVER_PROFILE
+ bm_trace(22, 0, 0);
os_profile (drv, 1, 0);
-#endif
- return 0;
+ return 0;
}
+
struct net_device_stats * tiwlan_drv_net_get_stats(struct net_device * dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
- ti_dprintf(TIWLAN_LOG_OTHER, "tiwlan_drv_net_get_stats()\n");
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev);
+ ti_dprintf(TIWLAN_LOG_OTHER, "tiwlan_drv_net_get_stats()\n");
- return &drv->stats;
+ return &drv->stats;
}
static int setup_netif(tiwlan_net_dev_t *drv)
{
- struct net_device *dev;
- int res;
+ struct net_device *dev;
+ int res;
- dev = alloc_etherdev(0);
- if (dev == NULL)
- {
- ti_dprintf(TIWLAN_LOG_ERROR, "alloc_etherdev() failed\n");
- return -ENOMEM;
- }
- ether_setup(dev);
- dev->priv = drv;
- drv->netdev = dev;
- strcpy(dev->name, TIWLAN_DRV_IF_NAME);
- netif_carrier_off(dev);
- dev->open = tiwlan_drv_net_open;
- dev->stop = tiwlan_drv_net_stop;
- dev->hard_start_xmit = tiwlan_drv_dummy_net_xmit;
- dev->get_stats = tiwlan_drv_net_get_stats;
- dev->tx_queue_len = 100;
-
- res = tiwlan_ioctl_init(dev);
- if( res < 0 )
- {
- ti_dprintf(TIWLAN_LOG_ERROR, "tiwlan_ioctl_init() failed : %d\n", res);
- kfree(dev);
- return res;
- }
+ dev = alloc_etherdev(0);
+ if (dev == NULL)
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "alloc_etherdev() failed\n");
+ return -ENOMEM;
+ }
+ ether_setup(dev);
+ NETDEV_SET_PRIVATE(dev, drv);
+ drv->netdev = dev;
+ strcpy(dev->name, TIWLAN_DRV_IF_NAME);
+ netif_carrier_off(dev);
+#ifndef mike
+ tiwlan_iwhandler_init(dev);
+#endif
+ dev->open = tiwlan_drv_net_open;
+ dev->stop = tiwlan_drv_net_stop;
+ dev->hard_start_xmit = tiwlan_drv_dummy_net_xmit;
+ dev->get_stats = tiwlan_drv_net_get_stats;
+ dev->tx_queue_len = 100;
+
+ res = tiwlan_ioctl_init(dev);
+ if( res < 0 )
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "tiwlan_ioctl_init() failed : %d\n", res);
+ kfree(dev);
+ return res;
+ }
- res = register_netdev(dev);
- if (res != 0)
- {
- ti_dprintf(TIWLAN_LOG_ERROR, "register_netdev() failed : %d\n", res);
- kfree(dev);
- return res;
- }
+ res = register_netdev(dev);
+ if (res != 0)
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "register_netdev() failed : %d\n", res);
+ kfree(dev);
+ return res;
+ }
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
- SET_MODULE_OWNER(dev);
+ SET_MODULE_OWNER(dev);
#endif
- return 0;
+ return 0;
}
}
else
{
-#if DEBUG_UNKNOWN_INTERRUPT
+ #if DEBUG_UNKNOWN_INTERRUPT
ti_dprintf (TIWLAN_LOG_ERROR,
"%s - ERROR - interrupt isn't TNET interrupt! interrupt vector = 0x%08X\n",
__FUNCTION__, interruptVector);
-#endif
+ #endif
}
}
+
return IRQ_HANDLED;
}
#else
+
static irqreturn_t tiwlan_interrupt (int irq, void *netdrv, struct pt_regs *cpu_regs)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)netdrv;
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)netdrv;
drv->interrupt_pending = 1;
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
-#ifdef DM_USE_WORKQUEUE
- if( queue_work( drv->tiwlan_wq, &drv->tirq ) != 0 ) {
-#ifdef CONFIG_ANDROID_POWER
- android_lock_suspend( &drv->irq_wake_lock );
-#endif
- }
- /* disable_irq( drv->irq ); Dm: No need, we can loose IRQ */
-#else
- tasklet_schedule( &drv->tl );
-#endif
+ tasklet_schedule (&drv->tl);
+
return IRQ_HANDLED;
}
#endif
static void tiwlan_poll_irq_handler(unsigned long parm)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)parm;
- bm_trace(2, 0, 0);
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)parm;
+ bm_trace(2, 0, 0);
- tiwlan_interrupt(0, drv, NULL);
- mod_timer(&drv->poll_timer, jiffies + TIWLAN_IRQ_POLL_INTERVAL);
+ tiwlan_interrupt(0, drv, NULL);
+ mod_timer(&drv->poll_timer, jiffies + TIWLAN_IRQ_POLL_INTERVAL);
}
-static void tiwlan_handle_control_requests( tiwlan_net_dev_t *drv )
+
+/* tiwlan_tasklet_handler
+ WLAN protocol tasklet. Most of work happens in the
+ context of this tasklet.
+*/
+static void tiwlan_tasklet_handler(unsigned long netdrv)
{
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)netdrv;
+
+ #ifdef STACK_PROFILE
+ unsigned int curr1,base1;
+ unsigned int curr2,base2;
+ static unsigned int maximum_stack = 0;
+ #endif
+
+ /* if the driver was unloaded by that time we need to ignore all the timers */
+ if (drv->unload_driver)
+ return;
+ #if 0
+ ti_dprintf(TIWLAN_LOG_INFO, "%s in\n" , __FUNCTION__);
+ #endif
+
+ os_profile (drv, 0, 0);
+ bm_trace(3, 0, 0);
+
+ #ifdef STACK_PROFILE
+ curr1 = check_stack_start(&base1);
+ #endif
+
+ /* Handle bus transaction interrupts */
+ if (drv->dma_done)
+ {
+ drv->dma_done = 0;
+ configMgr_HandleBusTxn_Complete(drv->adapter.CoreHalCtx);
+ }
+
+ /* don't call for "Handle interrupts, timers, ioctls" while recovery process */
+ if (configMgr_areInputsFromOsDisabled(drv->adapter.CoreHalCtx) == TRUE)
+ {
+ return;
+ }
+
+ /* Handle firmware interrupts */
+ if (drv->interrupt_pending)
+ {
+ drv->interrupt_pending = 0;
+ configMgr_handleInterrupts(drv->adapter.CoreHalCtx);
+ }
+
bm_trace(4, 0, 0);
/* Handle control requests (timers, ioctls) */
bm_trace(5, 0, 0);
/* DbgCB_Insert(0, DBG_MODULE_OS, DBG_TYPE_TASKLET, 1)*/
-}
-
-#ifdef DM_USE_WORKQUEUE
-static void tiwlan_irq_handler( struct work_struct *work )
-{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)container_of( work, struct tiwlan_net_dev, tirq );
-
- /* if the driver was unloaded by that time we need to ignore all the timers */
- if (drv->unload_driver) {
-#ifdef CONFIG_ANDROID_POWER
- android_unlock_suspend( &drv->irq_wake_lock );
-#endif
- /* enable_irq( drv->irq ); */
- return;
- }
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
- configMgr_handleInterrupts( drv->adapter.CoreHalCtx );
- tiwlan_handle_control_requests( drv );
-#ifdef CONFIG_ANDROID_POWER
- if( drv->receive_packet ) {
- drv->receive_packet = 0;
- /* Keep awake for 500 ms to give a chance to network stack */
- android_lock_suspend_auto_expire( &drv->rx_wake_lock, (HZ >> 1) );
- }
- android_unlock_suspend( &drv->irq_wake_lock );
-#endif
- /* enable_irq( drv->irq ); */
-}
-#endif
-
-/* tiwlan_tasklet_handler
- WLAN protocol tasklet. Most of work happens in the
- context of this tasklet.
-*/
-#ifdef DM_USE_WORKQUEUE
-static void tiwlan_work_handler( struct work_struct *work )
-#else
-static void tiwlan_tasklet_handler( unsigned long netdrv )
-#endif
-{
-#ifdef DM_USE_WORKQUEUE
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)container_of( work, struct tiwlan_net_dev, tw );
-#else
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)netdrv;
-#endif
-#ifdef STACK_PROFILE
- unsigned int curr1, base1;
- unsigned int curr2, base2;
- static unsigned int maximum_stack = 0;
-#endif
- /* if the driver was unloaded by that time we need to ignore all the timers */
- if (drv->unload_driver) {
-#ifdef CONFIG_ANDROID_POWER
- android_unlock_suspend( &drv->timer_wake_lock );
-#endif
- return;
- }
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
-#if 0
- ti_dprintf(TIWLAN_LOG_INFO, "%s in\n" , __FUNCTION__);
-#endif
-
-#ifdef DRIVER_PROFILE
- os_profile (drv, 0, 0);
-#endif
- bm_trace(3, 0, 0);
-
-#ifdef STACK_PROFILE
- curr1 = check_stack_start(&base1);
-#endif
-
- /* Handle bus transaction interrupts */
- if (drv->dma_done)
- {
- drv->dma_done = 0;
- configMgr_HandleBusTxn_Complete(drv->adapter.CoreHalCtx);
- }
-
- /* don't call for "Handle interrupts, timers, ioctls" while recovery process */
- if (configMgr_areInputsFromOsDisabled(drv->adapter.CoreHalCtx) == TRUE) {
-#ifdef CONFIG_ANDROID_POWER
- android_unlock_suspend( &drv->timer_wake_lock );
-#endif
- return;
- }
-
- /* Handle firmware interrupts */
-#ifndef DM_USE_WORKQUEUE
- if (drv->interrupt_pending)
- {
- drv->interrupt_pending = 0;
- configMgr_handleInterrupts(drv->adapter.CoreHalCtx);
- }
-#endif
-
- tiwlan_handle_control_requests( drv );
-
-#ifdef STACK_PROFILE
+ #ifdef STACK_PROFILE
curr2 = check_stack_stop(&base2);
if (base2 == base1)
maximum_stack = curr1 - curr2;
}
}
-#endif
+ #endif
-#ifdef DRIVER_PROFILE
os_profile (drv, 1, 0);
-#endif
-#if 0
+ #if 0
ti_dprintf(TIWLAN_LOG_INFO, "%s out\n" , __FUNCTION__);
-#endif
-#ifdef CONFIG_ANDROID_POWER
- android_unlock_suspend( &drv->timer_wake_lock );
-#endif
+ #endif
}
-#ifdef CONFIG_TROUT_PWRSINK
-static void tiwlan_rx_watchdog(struct work_struct *work)
-{
- struct delayed_work *dwork = (struct delayed_work *) container_of(work, struct delayed_work, work);
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)container_of( dwork, struct tiwlan_net_dev, trxw );
-
- unsigned long num_rx_pkts = num_rx_pkt_new - num_rx_pkt_last;
- /* Contribute 10mA (200mA x 5%) for 1 pkt/sec, and plus 8mA base. */
- unsigned percent = (num_rx_pkts / (2 * RX_RATE_INTERVAL_SEC)) * 10 + PWRSINK_WIFI_PERCENT_BASE;
-
- if (drv->unload_driver)
- return;
-
- percent = (percent > 100) ? 100 : percent;
- /* printk(KERN_INFO "num_rx_pkts=%ld, percent=%d\n", num_rx_pkts, percent); */
- trout_pwrsink_set(PWRSINK_WIFI, percent);
-
- num_rx_pkt_last = num_rx_pkt_new;
-
- if (drv && drv->tiwlan_wq)
- queue_delayed_work(drv->tiwlan_wq, &drv->trxw, msecs_to_jiffies(MSEC_PER_SEC * RX_RATE_INTERVAL_SEC));
-}
-#endif
-
/* tiwlan_send_wait_reply
This internal interface function creates request and sends
it to the control tasklet for processing.
unsigned long p3,
unsigned long p4)
{
- tiwlan_req_t req;
- unsigned long flags;
-
- /* Send request to tiwlan_tasklet and wait for reply */
-
- req.drv = drv;
- req.u.req.f = f;
- req.u.req.p1 = p1;
- req.u.req.p2 = p2;
- req.u.req.p3 = p3;
- req.u.req.p4 = p4;
- req.u.req.reply_expected = 1;
- init_completion(&req.u.req.comp);
-
- spin_lock_irqsave(&drv->lock, flags);
- list_add_tail(&req.list, &drv->request_q);
- spin_unlock_irqrestore(&drv->lock, flags);
-
-#ifdef DM_USE_WORKQUEUE
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
- if( queue_work( drv->tiwlan_wq, &drv->tw ) != 0 ) {
-#ifdef CONFIG_ANDROID_POWER
- android_lock_suspend( &drv->timer_wake_lock );
-#endif
+ tiwlan_req_t req;
+ unsigned long flags;
+
+ /* Send request to tiwlan_tasklet and wait for reply */
+ if (!drv->adapter.CoreHalCtx) {
+ printk("STATION_IS_NOT_RUNNING\n");
+ return STATION_IS_NOT_RUNNING;
}
-#else
- tasklet_schedule( &drv->tl );
-#endif
- wait_for_completion(&req.u.req.comp);
- return req.u.reply;
+ req.drv = drv;
+ req.u.req.f = f;
+ req.u.req.p1 = p1;
+ req.u.req.p2 = p2;
+ req.u.req.p3 = p3;
+ req.u.req.p4 = p4;
+ req.u.req.reply_expected = 1;
+ init_completion(&req.u.req.comp);
+
+ spin_lock_irqsave(&drv->lock, flags);
+ list_add_tail(&req.list, &drv->request_q);
+ spin_unlock_irqrestore(&drv->lock, flags);
+
+ tasklet_schedule(&drv->tl);
+
+ wait_for_completion(&req.u.req.comp);
+
+ return req.u.reply;
}
#define WLAN_PCMCIA_CFG_REG 0x0524
-/* tiwlan_set_hw_access */
+/* tiwlan_set_hw_access
+*/
static int tiwlan_set_hw_access(tiwlan_net_dev_t *drv)
{
-#ifdef TIWLAN_OMAP1610
- OS_WRITE_REG(drv, HI_CFG, 0x00000a00);
-
-#if ! ((defined(HW_ACCESS_SDIO)||defined(HW_ACCESS_WSPI)) && defined(TNETW1150))
- OS_WRITE_REG(drv, WLAN_PCMCIA_CFG_REG, 0xC6880000);
- OS_WRITE_REG(drv, PCI_ARB_CFG, 0x2);
-#endif
-
-#endif
- return 0;
+ return 0;
}
*/
static void tiwlan_free_drv(tiwlan_net_dev_t *drv)
{
-#ifdef TIWLAN_OMAP1610
- if (drv->acx_mem.pa && drv->acx_mem.va)
- iounmap(drv->acx_mem.va);
- if (drv->acx_reg.pa && drv->acx_reg.va && drv->acx_reg.va != drv->acx_reg.va)
- iounmap(drv->acx_reg.va);
-#endif
- kfree(drv);
+ if (drv->acx_mem.pa && drv->acx_mem.va)
+ iounmap(drv->acx_mem.va);
+ if (drv->acx_reg.pa && drv->acx_reg.va && drv->acx_reg.va != drv->acx_reg.va)
+ iounmap(drv->acx_reg.va);
+ kfree(drv);
}
unsigned long mem_start, unsigned long mem_size,
int map_io, int irq)
{
- static tiwlan_net_dev_t *drv;
- drv = kmalloc(sizeof(tiwlan_net_dev_t), GFP_KERNEL);
+ static tiwlan_net_dev_t *drv;
+ drv = kmalloc(sizeof(tiwlan_net_dev_t), GFP_KERNEL);
#ifdef TI_MEM_ALLOC_TRACE
- os_printf("MTT:%s:%d ::kmalloc(%lu, %x) : %lu\n", __FUNCTION__, __LINE__, sizeof(tiwlan_net_dev_t), GFP_KERNEL, sizeof(tiwlan_net_dev_t));
+ os_printf("MTT:%s:%d ::kmalloc(%lu, %x) : %lu\n", __FUNCTION__, __LINE__, sizeof(tiwlan_net_dev_t), GFP_KERNEL, sizeof(tiwlan_net_dev_t));
#endif/*I_MEM_ALLOC_TRACE*/
- if (!drv)
- return NULL;
- memset(drv, 0, sizeof(tiwlan_net_dev_t));
- drv->acx_mem.size = mem_size;
- drv->acx_reg.size = reg_size;
-#ifdef TIWLAN_OMAP1610
- if (map_io)
- {
- drv->acx_mem.pa = mem_start;
- drv->acx_reg.pa = reg_start;
- drv->acx_mem.va = ioremap(drv->acx_mem.pa, drv->acx_mem.size);
- if (drv->acx_mem.pa!=drv->acx_reg.pa || drv->acx_mem.size!=drv->acx_reg.size)
- drv->acx_reg.va = ioremap(drv->acx_reg.pa, drv->acx_reg.size);
- else
- drv->acx_reg.va = drv->acx_mem.va;
- }
- else
- {
- /* Memory is already mapped */
- drv->acx_mem.va = (void *)mem_start;
- drv->acx_reg.va = (void *)reg_start;
- }
-#endif /* Dm: */
- drv->irq = irq;
- return drv;
+
+ if (!drv)
+ return NULL;
+ memset(drv, 0, sizeof(tiwlan_net_dev_t));
+ drv->acx_mem.size = mem_size;
+ drv->acx_reg.size = reg_size;
+ if (map_io)
+ {
+ drv->acx_mem.pa = mem_start;
+ drv->acx_reg.pa = reg_start;
+ drv->acx_mem.va = ioremap(drv->acx_mem.pa, drv->acx_mem.size);
+ if (drv->acx_mem.pa!=drv->acx_reg.pa || drv->acx_mem.size!=drv->acx_reg.size)
+ drv->acx_reg.va = ioremap(drv->acx_reg.pa, drv->acx_reg.size);
+ else
+ drv->acx_reg.va = drv->acx_mem.va;
+ }
+ else
+ {
+ /* Memory is already mapped */
+ drv->acx_mem.va = (void *)mem_start;
+ drv->acx_reg.va = (void *)reg_start;
+ }
+ drv->irq = irq;
+ return drv;
}
int rc;
void *pWLAN_Images[4];
- /* printk("%s\n", __FUNCTION__); */
/* It is OK if already initialized */
if (drv->adapter.CoreHalCtx)
return 0;
-
+
init_table = os_memoryAlloc (drv, sizeof(initTable_t));
#ifdef TI_MEM_ALLOC_TRACE
#ifdef TI_MEM_ALLOC_TRACE
osPrintf ("MTT:%s:%d ::kmalloc(%lu, %x) : %lu\n", __FUNCTION__, __LINE__, drv->eeprom_image.size, GFP_KERNEL, drv->eeprom_image.size);
-#endif
+ #endif
if (!drv->eeprom_image.va)
{
ti_dprintf (TIWLAN_LOG_ERROR, "Cannot allocate buffer for eeprom image\n");
drv->firmware_image.va = os_memoryAlloc (drv,drv->firmware_image.size);
#ifdef TI_MEM_ALLOC_TRACE
osPrintf ("MTT:%s:%d ::kmalloc(%lu, %x) : %lu\n", __FUNCTION__, __LINE__, drv->firmware_image.size, GFP_KERNEL, drv->firmware_image.size);
-#endif
+ #endif
if (!drv->firmware_image.va)
{
ti_dprintf(TIWLAN_LOG_ERROR, "Cannot allocate buffer for firmware image\n");
&init_info->data[init_info->eeprom_image_length],
drv->firmware_image.size);
#else
- extern unsigned char tiwlan_fwimage[];
- extern unsigned int sizeof_tiwlan_fwimage;
+ extern unsigned char tiwlan_fwimage[];
+ extern unsigned int sizeof_tiwlan_fwimage;
drv->firmware_image.size = sizeof_tiwlan_fwimage;
drv->firmware_image.va = tiwlan_fwimage;
#ifdef TI_MEM_ALLOC_TRACE
os_printf("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, sizeof(initTable_t), -sizeof(initTable_t));
-#endif
+ #endif
return rc;
}
init_table,
(macAddress_t *) &drv->adapter.CurrentAddr);
- drv->interrupt_pending = 0;
+ drv->interrupt_pending = 0;
drv->dma_done = 0;
- if (drv->irq)
- {
+ if (drv->irq)
+ {
#ifndef PRIODIC_INTERRUPT
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+ int rc;
unsigned long flags;
/*
* Disable all interrupts for not to catch the tiwlan irq
* between request_irq and disable_irq
*/
spin_lock_irqsave (&(drv->lock), flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
if ((rc = request_irq (drv->irq, tiwlan_interrupt, SA_SHIRQ, drv->netdev->name, drv)))
#else
- if ((rc = request_irq (drv->irq, (irq_handler_t)tiwlan_interrupt, IRQF_SHARED | IRQF_TRIGGER_FALLING /*Dm:*/, drv->netdev->name, drv)))
-#endif
+ if ((rc = request_irq (drv->irq, (irq_handler_t)tiwlan_interrupt, IRQF_SHARED/*Dm:*/, drv->netdev->name, drv)))
+#endif
{
print_err ("TIWLAN: Failed to register interrupt handler\n");
configMgr_stop (drv->adapter.CoreHalCtx);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
spin_unlock_irqrestore (&drv->lock, flags);
-#endif
return rc;
}
-#ifdef CONFIG_ANDROID_POWER
- set_irq_wake(drv->irq, 1);
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
- set_irq_type (drv->irq, IRQT_FALLING);
+ set_irq_type (drv->irq, IRQT_FALLING);
#else
- set_irq_type (drv->irq, IRQ_TYPE_EDGE_FALLING);
+ set_irq_type (drv->irq, IRQ_TYPE_EDGE_FALLING);
#endif
disable_irq (drv->irq);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
spin_unlock_irqrestore (&drv->lock, flags);
-#endif
-#else
+ #else
printk (" tiwlan_init_drv :PRIODIC_INTERRUPT drv->irq %x\n",drv->irq);
#endif
- }
- else
- {
- /* Debug mode: polling */
+ }
+ else
+ {
+ /* Debug mode: polling */
mod_timer (&drv->poll_timer, jiffies + TIWLAN_IRQ_POLL_INTERVAL);
- }
+ }
/*
* Now that all parts of the driver have been created and handles linked
* proceed to download the FW code
*/
configMgr_init (drv,
- drv->adapter.CoreHalCtx,
- pWLAN_Images,
- init_table,
- (macAddress_t *) &drv->adapter.CurrentAddr);
+ drv->adapter.CoreHalCtx,
+ pWLAN_Images,
+ init_table,
+ (macAddress_t *) &drv->adapter.CurrentAddr);
/* Wait for the download to complete */
os_WaitComplete ((void *)drv);
if (rc == OK)
{
- proc_stat_init (drv->adapter.CoreHalCtx);
-#ifdef TI_MEM_ALLOC_TRACE
- osPrintf ("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, sizeof(initTable_t), -sizeof(initTable_t));
-#endif/*I_MEM_ALLOC_TRACE*/
+ proc_stat_init (drv->adapter.CoreHalCtx);
+ #ifdef TI_MEM_ALLOC_TRACE
+ osPrintf ("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, sizeof(initTable_t), -sizeof(initTable_t));
+ #endif/*I_MEM_ALLOC_TRACE*/
- if (drv->adapter.CoreHalCtx == NULL)
- {
- ti_dprintf (TIWLAN_LOG_ERROR, "configMgr_create failed\n");
- return -ENODEV;
- }
+ if (drv->adapter.CoreHalCtx == NULL)
+ {
+ ti_dprintf (TIWLAN_LOG_ERROR, "configMgr_create failed\n");
+ return -ENODEV;
+ }
- /* eeprom buffer is going to be deallocated by the caller. It is no longer needed anyway */
-#if 0
- drv->eeprom_image.va = NULL;
- drv->eeprom_image.size = 0;
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ /* eeprom buffer is going to be deallocated by the caller. It is no longer needed anyway */
+ #if 0
+ drv->eeprom_image.va = NULL;
+ drv->eeprom_image.size = 0;
+ #endif
+ //drv->wl_sock = netlink_kernel_create( NETLINK_USERSOCK, 0, NULL, THIS_MODULE );
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
- drv->wl_sock = netlink_kernel_create(NETLINK_USERSOCK, 0, NULL, THIS_MODULE); /* Dm: */
+ drv->wl_sock = netlink_kernel_create( NETLINK_USERSOCK, 0, NULL, NULL,THIS_MODULE );
#else
- drv->wl_sock = netlink_kernel_create(NETLINK_USERSOCK, 0, NULL, NULL, THIS_MODULE); /* Dm: */
+ drv->wl_sock = netlink_kernel_create(&init_net, NETLINK_USERSOCK, 0, NULL, NULL, THIS_MODULE); /* Dm: */
#endif
-#else
- drv->wl_sock = netlink_kernel_create(&init_net, NETLINK_USERSOCK, 0, NULL, NULL, THIS_MODULE); /* Dm: */
-#endif
- if (drv->wl_sock == NULL)
- {
- ti_dprintf(TIWLAN_LOG_ERROR, "netlink_kernel_create() failed !\n");
- /* TODO: free in destroy */
- return -EINVAL;
- }
+ if (drv->wl_sock == NULL)
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "netlink_kernel_create() failed !\n");
+ /* TODO: free in destroy */
+ return -EINVAL;
+ }
- /* Finalize network interface setup */
- drv->netdev->hard_start_xmit = tiwlan_drv_net_xmit;
- memcpy (drv->netdev->dev_addr, drv->adapter.CurrentAddr, MAC_ADDR_LEN);
- drv->netdev->addr_len = MAC_ADDR_LEN;
+ /* Finalize network interface setup */
+ drv->netdev->hard_start_xmit = tiwlan_drv_net_xmit;
+ memcpy (drv->netdev->dev_addr, drv->adapter.CurrentAddr, MAC_ADDR_LEN);
+ drv->netdev->addr_len = MAC_ADDR_LEN;
- /* Register the relevant events with the event handler */
- tiwlan_register_events (drv);
+ /* Register the relevant events with the event handler */
+ tiwlan_register_events (drv);
/* Mark that init stage has succeded */
drv->initialized = 1;
*/
int tiwlan_start_drv(tiwlan_net_dev_t *drv)
{
- /* printk("%s\n", __FUNCTION__); */
- if (!drv->initialized)
- {
- ti_dprintf(TIWLAN_LOG_ERROR, "Attempt to start driver before initilization has succeeded\n");
- return -ENODEV;
- }
- if (!drv->adapter.CoreHalCtx)
- {
- ti_dprintf(TIWLAN_LOG_ERROR, "Attempt to start driver before creating config_manager\n");
- return -ENODEV;
- }
- if (drv->started)
- {
- /*ti_dprintf(TIWLAN_LOG_ERROR, "Attempt to start driver that has already started\n");*/
- return -EALREADY;
- }
- if (configMgr_start(drv->adapter.CoreHalCtx) != OK)
- {
- print_err("TIWLAN: Failed to start config manager\n");
- return -EINVAL;
- }
- drv->started = 1;
+ if (!drv->initialized)
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "Attempt to start driver before initilization has succeeded\n");
+ return -ENODEV;
+ }
+ if (!drv->adapter.CoreHalCtx)
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "Attempt to start driver before creating config_manager\n");
+ return -ENODEV;
+ }
+ if (drv->started)
+ {
+ /*ti_dprintf(TIWLAN_LOG_ERROR, "Attempt to start driver that has already started\n");*/
+ return -EALREADY;
+ }
+ if (configMgr_start(drv->adapter.CoreHalCtx) != OK)
+ {
+ print_err("TIWLAN: Failed to start config manager\n");
+ return -EINVAL;
+ }
+ drv->started = 1;
#ifdef SDIO_INTERRUPT_HANDLING_ON
- configMgr_SlaveAckMaskNotification(drv->adapter.CoreHalCtx);
+ configMgr_SlaveAckMaskNotification(drv->adapter.CoreHalCtx);
#endif
- if (drv->netdev)
- netif_start_queue(drv->netdev);
-#ifdef CONFIG_TROUT_PWRSINK
- trout_pwrsink_set(PWRSINK_WIFI, PWRSINK_WIFI_PERCENT_BASE);
-#endif
- return 0;
+ if (drv->netdev)
+ netif_start_queue(drv->netdev);
+
+ return 0;
}
*/
static void tiwlan_destroy_drv(tiwlan_net_dev_t *drv)
{
- int waitShutdownCounter;
+ int waitShutdownCounter;
- /* close the ipc_kernel socket*/
- if (drv && drv->wl_sock) {
- sock_release(drv->wl_sock->sk_socket);
- }
+ /* close the ipc_kernel socket*/
+ if (drv && drv->wl_sock) {
+ sock_release(drv->wl_sock->sk_socket);
+ }
- bm_destroy();
+ bm_destroy();
- tiwlan_stop_and_destroy_drv(drv);
-#ifdef DM_USE_WORKQUEUE
- while( tiwlan_del_msdu(drv) != NULL );
-#endif
- if (drv->adapter.CoreHalCtx)
- {
- /* Delay return to OS until all driver components (HAL/SME) are shutdown */
- for (waitShutdownCounter=1; waitShutdownCounter<=DRV_SHUTDOWN_TEST_MAX_COUNTER; waitShutdownCounter++)
- {
- /* Check if HAL/SME are stopped - If so - exit loop and return to OS */
- if (configMgr_DriverShutdownStatus(drv->adapter.CoreHalCtx) == DRIVER_SHUTDOWN_COMPLETE)
- {
- break;
- }
- /* Delay of 100ms between shutdown test */
- mdelay ( DRV_SHUTDOWN_TEST_DELAY_INTERVAL );
- }
+ tiwlan_stop_and_destroy_drv(drv);
+ list_del(&drv->list);
- /* If driver was not shutdown properly - destroy all timers "manually" and exit*/
- if ( waitShutdownCounter == DRV_SHUTDOWN_TEST_MAX_COUNTER+1 )
- {
- os_printf("Timeout while waiting for driver to shutdown...Shutdown status flag=0x%x\n",configMgr_DriverShutdownStatus(drv->adapter.CoreHalCtx));
- }
+ if (drv->adapter.CoreHalCtx)
+ {
+ /* Delay return to OS until all driver components (HAL/SME) are shutdown */
+ for (waitShutdownCounter=1; waitShutdownCounter<=DRV_SHUTDOWN_TEST_MAX_COUNTER; waitShutdownCounter++)
+ {
+ /* Check if HAL/SME are stopped - If so - exit loop and return to OS */
+ if (configMgr_DriverShutdownStatus(drv->adapter.CoreHalCtx) == DRIVER_SHUTDOWN_COMPLETE)
+ {
+ break;
+ }
+ /* Delay of 100ms between shutdown test */
+ mdelay ( DRV_SHUTDOWN_TEST_DELAY_INTERVAL );
+ }
+
+ /* If driver was not shutdown properly - destroy all timers "manually" and exit*/
+ if ( waitShutdownCounter == DRV_SHUTDOWN_TEST_MAX_COUNTER+1 )
+ {
+ os_printf("Timeout while waiting for driver to shutdown...Shutdown status flag=0x%x\n",configMgr_DriverShutdownStatus(drv->adapter.CoreHalCtx));
+ }
- drv->unload_driver = 1;
+ drv->unload_driver = 1;
- proc_stat_destroy();
- if (drv->irq) {
-#ifdef CONFIG_ANDROID_POWER
- set_irq_wake(drv->irq, 0);
-#endif
- free_irq(drv->irq, drv);
- }
- else
- del_timer_sync(&drv->poll_timer);
+ proc_stat_destroy();
+ if (drv->irq)
+ free_irq(drv->irq, drv);
+ else
+ del_timer_sync(&drv->poll_timer);
- /* Unload all modules (free memory) & destroy timers */
- configMgr_UnloadModules (drv->adapter.CoreHalCtx);
+ /* Unload all modules (free memory) & destroy timers */
+ configMgr_UnloadModules (drv->adapter.CoreHalCtx);
#ifdef FIRMWARE_DYNAMIC_LOAD
- if( drv->firmware_image.va ) {
- os_memoryFree(drv,drv->firmware_image.va, drv->firmware_image.size);
+ if( drv->firmware_image.va ){
+ os_memoryFree(drv,drv->firmware_image.va, drv->firmware_image.size);
#ifdef TI_MEM_ALLOC_TRACE
- os_printf("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, drv->firmware_image.size, -drv->firmware_image.size);
-#endif /*I_MEM_ALLOC_TRACE*/
- }
+ os_printf("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, drv->firmware_image.size, -drv->firmware_image.size);
+#endif/*I_MEM_ALLOC_TRACE*/
+
+ }
if( drv->eeprom_image.va )
{
os_memoryFree (drv, drv->eeprom_image.va, drv->eeprom_image.size);
#ifdef TI_MEM_ALLOC_TRACE
- os_printf("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, drv->eeprom_image.size, -drv->eeprom_image.size);
-#endif /*I_MEM_ALLOC_TRACE*/
- }
-#endif /*FIRMWARE_DYNAMIC_LOAD*/
- }
-#ifdef DM_USE_WORKQUEUE
-#ifdef CONFIG_TROUT_PWRSINK
- cancel_delayed_work_sync(&drv->trxw);
-#endif
- destroy_workqueue(drv->tiwlan_wq);
-#endif
-#ifdef CONFIG_ANDROID_POWER
- android_uninit_suspend_lock(&drv->irq_wake_lock);
- android_uninit_suspend_lock(&drv->xmit_wake_lock);
- android_uninit_suspend_lock(&drv->timer_wake_lock);
- android_uninit_suspend_lock(&drv->rx_wake_lock);
-#endif
- unregister_netdev(drv->netdev);
- tiwlan_free_drv(drv);
+ os_printf("MTT:%s:%d ::kfree(0x%p) : %d\n", __FUNCTION__, __LINE__, drv->eeprom_image.size, -drv->eeprom_image.size);
+#endif/*I_MEM_ALLOC_TRACE*/
+ }
+
+#endif/*FIRMWARE_DYNAMIC_LOAD*/
+ }
+ unregister_netdev(drv->netdev);
+ tiwlan_free_drv(drv);
}
int map_io, int irq,
void *priv, tiwlan_net_dev_t **p_drv)
{
- tiwlan_net_dev_t *drv;
- int rc;
+ tiwlan_net_dev_t *drv;
+ int rc;
- /* printk("%s\n", __FUNCTION__); */
- /* Allocate device and map h/w regions */
- drv = tiwlan_alloc_drv(reg_start, reg_size, mem_start, mem_size, map_io, irq);
- if (!drv)
- return -ENOMEM;
+ /* Allocate device and map h/w regions */
+ drv = tiwlan_alloc_drv(reg_start, reg_size, mem_start, mem_size, map_io, irq);
+ if (!drv)
+ return -ENOMEM;
- /* Check h/w access */
- if (tiwlan_set_hw_access(drv))
- {
- tiwlan_free_drv(drv);
- return -ENODEV;
- }
+ /* Check h/w access */
+ if (tiwlan_set_hw_access(drv))
+ {
+ tiwlan_free_drv(drv);
+ return -ENODEV;
+ }
-#ifdef DM_USE_WORKQUEUE
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
- drv->tiwlan_wq = create_singlethread_workqueue("tiwlan_wifi_wq");
-#else
- drv->tiwlan_wq = create_freezeable_workqueue("tiwlan_wifi_wq");
-#endif
- if( !(drv->tiwlan_wq) ) {
- tiwlan_free_drv(drv);
- printk(KERN_ERR "Failed to create workqueue\n");
- return -EINVAL;
- }
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
- INIT_WORK( &drv->tw, tiwlan_work_handler, &drv->tw );
- INIT_WORK( &drv->txmit, tiwlan_xmit_handler, &drv->txmit );
- INIT_WORK( &drv->tirq, tiwlan_irq_handler, &drv->tirq );
-#else
- INIT_WORK( &drv->tw, tiwlan_work_handler );
- INIT_WORK( &drv->txmit, tiwlan_xmit_handler );
- INIT_WORK( &drv->tirq, tiwlan_irq_handler );
-#endif
- drv->txmit_msdu_next = drv->txmit_msdu_last = NULL;
-#else
- tasklet_init( &drv->tl, tiwlan_tasklet_handler, (unsigned long)drv );
-#endif
+ tasklet_init(&drv->tl, tiwlan_tasklet_handler, (unsigned long)drv);
+ spin_lock_init(&drv->lock);
+ INIT_LIST_HEAD(&drv->request_q);
+ init_timer(&drv->poll_timer);
+ drv->poll_timer.function = tiwlan_poll_irq_handler;
+ drv->poll_timer.data = (unsigned long)drv;
-#ifdef CONFIG_TROUT_PWRSINK
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
- INIT_DELAYED_WORK( &drv->trxw, tiwlan_rx_watchdog, &drv->trxw );
-#else
- INIT_DELAYED_WORK( &drv->trxw, tiwlan_rx_watchdog );
-#endif
-#endif
+ /* Init the completion obhect needed for init async purpose */
+ init_completion(&drv->comp);
-#ifdef CONFIG_ANDROID_POWER
- drv->receive_packet = 0;
- drv->irq_wake_lock.name = "tiwlan_irq_wake";
- android_init_suspend_lock(&drv->irq_wake_lock);
- drv->xmit_wake_lock.name = "tiwlan_xmit_wake";
- android_init_suspend_lock(&drv->xmit_wake_lock);
- drv->timer_wake_lock.name = "tiwlan_timer_wake";
- android_init_suspend_lock(&drv->timer_wake_lock);
- drv->rx_wake_lock.name = "tiwlan_rx_wake";
- android_init_suspend_lock(&drv->rx_wake_lock);
-#endif
- spin_lock_init(&drv->lock);
- INIT_LIST_HEAD(&drv->request_q);
- init_timer(&drv->poll_timer);
- drv->poll_timer.function = tiwlan_poll_irq_handler;
- drv->poll_timer.data = (unsigned long)drv;
-
- /* Init the completion obhect needed for init async purpose */
- init_completion(&drv->comp);
-
- /* Register network device */
- rc = setup_netif(drv);
- if (rc)
- {
- tiwlan_free_drv(drv);
- return rc;
- }
- drv->priv = priv;
+ /* Register network device */
+ rc = setup_netif(drv);
+ if (rc)
+ {
+ tiwlan_free_drv(drv);
+ return rc;
+ }
+ drv->priv = priv;
- list_add(&drv->list, &tiwlan_drv_list);
- if (p_drv)
- *p_drv = drv;
+ list_add(&drv->list, &tiwlan_drv_list);
+ if (p_drv)
+ *p_drv = drv;
- drv->initialized = 0;
+ drv->initialized = 0;
- /* Profiler */
+ /* Profiler */
#ifdef DRIVER_PROFILING
tiwlan_profile_create (drv);
#endif
- bm_init(drv);
+ bm_init(drv);
#ifdef NO_USERMODE_WORKAROUND
- rc = tiwlan_init_drv(drv, NULL);
- rc = rc ? rc : tiwlan_start_drv(drv);
+ rc = tiwlan_init_drv(drv, NULL);
+ rc = rc ? rc : tiwlan_start_drv(drv);
#endif
- return 0;
+ return 0;
}
/* tiwlan_stop_driver
*/
int tiwlan_stop_drv(tiwlan_net_dev_t *drv)
{
- if (!drv->adapter.CoreHalCtx)
- return 0;
+ if (!drv->adapter.CoreHalCtx)
+ return 0;
- if (drv->netdev)
- netif_stop_queue(drv->netdev);
+ if (drv->netdev)
+ netif_stop_queue(drv->netdev);
- configMgr_stop(drv->adapter.CoreHalCtx);
+ configMgr_stop(drv->adapter.CoreHalCtx);
- drv->started = 0;
-#ifdef CONFIG_TROUT_PWRSINK
- trout_pwrsink_set(PWRSINK_WIFI, 0);
-#endif
- return 0;
+ drv->started = 0;
+ return 0;
}
/* tiwlan_stop__and_destroy_driver
*/
int tiwlan_stop_and_destroy_drv(tiwlan_net_dev_t *drv)
{
- if (!drv->adapter.CoreHalCtx)
- return 0;
+ if (!drv->adapter.CoreHalCtx)
+ return 0;
+
+ if (drv->netdev)
+ netif_stop_queue(drv->netdev);
- if (drv->netdev)
- netif_stop_queue(drv->netdev);
+ /* Start unload process by calling smeSm_stop, and halting the HAL */
+ /* SmeSm_stop finish notification will be one by setting flags */
+ configMgr_InitiateUnload(drv->adapter.CoreHalCtx);
- /* Start unload process by calling smeSm_stop, and halting the HAL */
- /* SmeSm_stop finish notification will be one by setting flags */
- configMgr_InitiateUnload(drv->adapter.CoreHalCtx);
- drv->started = 0;
- return 0;
+ drv->started = 0;
+ return 0;
}
static struct pci_device_id tnetw1130_pci_tbl[] __devinitdata =
{
- { VENDOR_ID_TI, DEVICE_ID_TI_WLAN, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- { 0, }
+ { VENDOR_ID_TI, DEVICE_ID_TI_WLAN, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { 0, }
};
static int __devinit
tnetw1130_pci_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
{
- tiwlan_net_dev_t *drv;
- int rc;
+ tiwlan_net_dev_t *drv;
+ int rc;
- print_info("tnetw1130_pci_init_one:\n");
- /* IT: for some reason interrupt doesn't work.
- use poling mode for now (comments around
- pcidev->irq below)
- */
- rc = tiwlan_create_drv(pcidev->resource[0].start,
- pcidev->resource[0].end - pcidev->resource[0].start,
- pcidev->resource[1].start,
- pcidev->resource[1].end - pcidev->resource[1].start,
- 1,
- 0/*pcidev->irq*/, pcidev, &drv);
- if (!rc)
- pcidev->driver_data = drv;
- return rc;
+ print_info("tnetw1130_pci_init_one:\n");
+ /* IT: for some reason interrupt doesn't work.
+ use poling mode for now (comments around
+ pcidev->irq below)
+ */
+ rc = tiwlan_create_drv(pcidev->resource[0].start,
+ pcidev->resource[0].end - pcidev->resource[0].start,
+ pcidev->resource[1].start,
+ pcidev->resource[1].end - pcidev->resource[1].start,
+ 1,
+ 0/*pcidev->irq*/, pcidev, &drv);
+ if (!rc)
+ pcidev->driver_data = drv;
+ return rc;
}
void tnetw1130_pci_remove(struct pci_dev *dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->driver_data;
- if (drv)
- {
- dev->driver_data = NULL;
- tiwlan_destroy_drv(drv);
- }
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->driver_data;
+ if (drv)
+ {
+ dev->driver_data = NULL;
+ tiwlan_destroy_drv(drv);
+ }
}
static struct pci_driver tnetw1130_pci_driver = {
- .name = "tnetw1130",
- .id_table = tnetw1130_pci_tbl,
- .probe = tnetw1130_pci_init_one,
- .remove = tnetw1130_pci_remove
+ .name = "tnetw1130",
+ .id_table = tnetw1130_pci_tbl,
+ .probe = tnetw1130_pci_init_one,
+ .remove = tnetw1130_pci_remove
};
#endif /* #ifdef TIWLAN_CARDBUS */
#ifdef TIWLAN_OMAP1610
int omap1610_drv_create(void)
{
- omap_memif_init();
- return tiwlan_create_drv(TIWLAN_OMAP1610_REGBASE, TIWLAN_OMAP1610_REGSIZE,
- TIWLAN_OMAP1610_MEMBASE, TIWLAN_OMAP1610_MEMSIZE,
- 0, TIWLAN_OMAP1610_IRQ, NULL, NULL);
-}
-#endif /* #ifdef TIWLAN_OMAP1610 */
-
-#ifdef TIWLAN_MSM7000
-
-#define TROUT_IRQ MSM_GPIO_TO_INT(29)
-
-static void tiwlan_sdio_irq(struct sdio_func *func)
-{
- printk("%s:\n", __FUNCTION__);
-}
-
-static const struct sdio_device_id tiwlan_sdio_ids[] = {
- { SDIO_DEVICE_CLASS(SDIO_CLASS_WLAN) },
- { },
-};
-
-MODULE_DEVICE_TABLE(sdio, tiwlan_sdio_ids);
-
-int tiwlan_sdio_init(struct sdio_func *func)
-{
- int rc;
-
- rc = sdio_enable_func(func);
- if (rc)
- return rc;
-
- rc = sdio_set_block_size(func, 512);
- if( rc ) {
- sdio_disable_func(func);
- }
- return rc;
-}
-
-static int tiwlan_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
-{
- int rc;
-
- SDIO_SetFunc( NULL );
- if (func->vendor != VENDOR_ID_TI || func->device != DEVICE_ID_TI_WLAN)
- return -ENODEV;
-
- printk(KERN_INFO
- "TIWLAN: Found SDIO controller (vendor 0x%x, device 0x%x)\n",
- func->vendor, func->device);
-
-#ifdef CONFIG_TROUT_PWRSINK
- trout_pwrsink_set(PWRSINK_WIFI, PWRSINK_WIFI_PERCENT_BASE);
-#endif
-
- sdio_claim_host(func);
-
- rc = tiwlan_sdio_init(func);
- if (rc)
- goto err2;
-
- rc = sdio_claim_irq(func, tiwlan_sdio_irq);
- if (rc)
- goto err1;
+ omap_memif_init();
- SDIO_SetFunc( func );
+ return tiwlan_create_drv(TIWLAN_OMAP1610_REGBASE, TIWLAN_OMAP1610_REGSIZE,
+ TIWLAN_OMAP1610_MEMBASE, TIWLAN_OMAP1610_MEMSIZE,
+ 0, TIWLAN_OMAP1610_IRQ, NULL, NULL);
- rc = tiwlan_create_drv(0, 0, 0, 0, 0, TROUT_IRQ, NULL, NULL);
-
- printk(KERN_INFO "TIWLAN: Driver initialized (rc %d)\n", rc);
- complete(&sdio_wait);
- return rc;
-err1:
- sdio_disable_func(func);
-err2:
- sdio_release_host(func);
- complete(&sdio_wait);
- printk(KERN_ERR "TIWLAN: SDIO failure (err %d)\n", rc);
- return rc;
-}
-
-static void tiwlan_sdio_remove(struct sdio_func *func)
-{
- printk(KERN_DEBUG "TIWLAN: Releasing SDIO resources\n");
- sdio_release_irq(func);
- sdio_disable_func(func);
- sdio_release_host(func);
- printk(KERN_DEBUG "TIWLAN: SDIO resources released\n");
}
+#endif /* #ifdef TIWLAN_OMAP1610 */
-static struct sdio_driver tiwlan_sdio_drv = {
- .probe = tiwlan_sdio_probe,
- .remove = tiwlan_sdio_remove,
- .name = "sdio_tiwlan",
- .id_table = tiwlan_sdio_ids,
-};
-#endif /* TIWLAN_MSM7000 */
static int __init tiwlan_module_init(void)
{
- int rc = 0;
-
- printk(KERN_INFO "TIWLAN: Driver loading\n");
/* Check sizes of basic structures to ensure that compilation
options are OK
*/
- if (packed_struct_tst())
- ;/*IT: return -EINVAL; */
+ if (packed_struct_tst())
+ ;/*IT: return -EINVAL; */
+
+ tiwlan_deb_entry=create_proc_entry("mem", 0644, NULL);
+ if (tiwlan_deb_entry == NULL)
+ return -EINVAL;
+ tiwlan_deb_entry->read_proc=tiwlan_deb_read_proc;
+ tiwlan_deb_entry->write_proc=tiwlan_deb_write_proc;
- tiwlan_deb_entry = create_proc_entry("mem", 0644, NULL);
- if (tiwlan_deb_entry == NULL)
- return -EINVAL;
- tiwlan_deb_entry->read_proc = tiwlan_deb_read_proc;
- tiwlan_deb_entry->write_proc = tiwlan_deb_write_proc;
-#ifdef TIWLAN_MSM7000
- init_completion(&sdio_wait);
-#endif
#ifdef TIWLAN_CARDBUS
- if ((rc=pci_register_driver(&tnetw1130_pci_driver)) < 0)
- print_err("TIWLAN: PCMCIA driver failed to register\n");
- return rc;
- }
- return 0;
+ {
+ int rc = 0;
+ if ((rc=pci_register_driver(&tnetw1130_pci_driver)) < 0)
+ {
+ print_err("TIWLAN: PCMCIA driver failed to register\n");
+ return rc;
+ }
+ }
+ return 0;
#elif defined(TIWLAN_OMAP1610)
- rc = omap1610_drv_create();
- return rc;
-
-#elif defined(TIWLAN_MSM7000)
- trout_wifi_power(1); /* Power On */
- trout_wifi_reset(0); /* Reset clear */
- trout_wifi_set_carddetect(1); /* CardDetect (0->1) */
-
- /* Register ourselves as an SDIO driver */
- rc = sdio_register_driver(&tiwlan_sdio_drv);
- if (rc < 0) {
- printk(KERN_ERR "sdio register failed (%d)\n", rc);
- return rc;
- }
- /* rc = tiwlan_create_drv(0, 0, 0, 0, 0, TROUT_IRQ, NULL, NULL); -- Called in probe */
-
- tiwlan_calibration = create_proc_entry("calibration", 0644, NULL);
- if (tiwlan_calibration == NULL)
- return -EINVAL;
- tiwlan_calibration->size = tiwlan_get_nvs_size();
- tiwlan_calibration->read_proc = tiwlan_calibration_read_proc;
- tiwlan_calibration->write_proc = tiwlan_calibration_write_proc;
-
- if (!wait_for_completion_timeout(&sdio_wait, msecs_to_jiffies(10000))) {
- printk(KERN_ERR "%s: Timed out waiting for device detect\n", __func__);
- remove_proc_entry("calibration", NULL);
- sdio_unregister_driver(&tiwlan_sdio_drv);
- trout_wifi_set_carddetect(0); /* CardDetect (1->0) */
- trout_wifi_reset(1); /* Reset active */
- trout_wifi_power(0); /* Power Off */
- return -ENODEV;
- }
- printk(KERN_INFO "TIWLAN: Driver loaded\n");
- return 0;
+
+ return omap1610_drv_create();
#else
-#error Either TIWLAN_CARDBUS, TIWLAN_OMAP1610 or TIWLAN_MSM7000 must be defined
+#error Either TIWLAN_CARDBUS or TIWLAN_OMAP1610 must be defined
#endif
}
static void __exit tiwlan_module_cleanup(void)
{
- struct list_head *l;
- struct list_head *tmp;
+ struct list_head *l;
+ struct list_head *tmp;
- printk(KERN_INFO "TIWLAN: Driver unloading\n");
#ifdef TIWLAN_CARDBUS
- pci_unregister_driver(&tnetw1130_pci_driver);
+ pci_unregister_driver(&tnetw1130_pci_driver);
#endif
- list_for_each_safe(l, tmp, &tiwlan_drv_list)
- {
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)list_entry(l, tiwlan_net_dev_t, list);
- list_del(l);
- tiwlan_destroy_drv(drv);
- }
- remove_proc_entry("mem", NULL);
-#ifdef TIWLAN_MSM7000
- remove_proc_entry("calibration", NULL);
- sdio_unregister_driver(&tiwlan_sdio_drv);
- trout_wifi_set_carddetect(0); /* CardDetect (1->0) */
- trout_wifi_reset(1); /* Reset active */
- trout_wifi_power(0); /* Power Off */
-#endif
- printk(KERN_INFO "TIWLAN: Driver unloaded\n");
+ list_for_each_safe(l, tmp, &tiwlan_drv_list)
+ {
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)list_entry(l, tiwlan_net_dev_t, list);
+ tiwlan_destroy_drv(drv);
+ }
+ remove_proc_entry("mem", NULL);
+ printk(KERN_INFO "TI WLAN: driver unloaded\n");
}
module_init(tiwlan_module_init);
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#include "arch_ti.h"
#include <asm/uaccess.h> /* copy_to_user() */
+#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/ioctl.h>
#include <linux/completion.h>
print_deb("priv_ioctl_proc(): cmd=%ld, data=%p (user_data=%lx), lenght=%ld\n",
req->cmd, data, req->user_data_pointer, req->length);
- if( !drv_started && (req->cmd != TIWLN_DRIVER_STATUS_SET)) { /* Dm: Fix */
- return res;
- }
-
switch( req->cmd ) {
case TIWLN_DRIVER_STATUS_SET:
if(*data)
- res = tiwlan_start_drv( (tiwlan_net_dev_t *)dev->priv );
+ res = tiwlan_start_drv( (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev));
else
- res = tiwlan_stop_drv( (tiwlan_net_dev_t *)dev->priv );
+ res = tiwlan_stop_drv( (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev));
if( res == OK )
drv_started = !drv_started;
req->user_data_pointer, req->length, aval_data_size );
/* driver is already initialized */
- if ((req->cmd == TIWLN_SET_INIT_INFO) && (((tiwlan_net_dev_t *)dev->priv)->adapter.CoreHalCtx))
+ if ((req->cmd == TIWLN_SET_INIT_INFO) && (((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev))->adapter.CoreHalCtx))
{
return 0;
}
os_printf("MTT:%s:%d ::kmalloc(%lu, %x) : %lu\n", __FUNCTION__, __LINE__, req->length, GFP_KERNEL, req->length);
#endif/*I_MEM_ALLOC_TRACE*/
- if( !extra )
+if( !extra )
return -ENOBUFS;
if( req->cmd_type & IOCTL_SET )
{
- if( copy_from_user(extra, (void *) req->user_data_pointer, req->length) )
- return -EFAULT;
+ copy_from_user(extra, (void *) req->user_data_pointer, req->length);
}
else {
os_memoryZero( NULL, extra, req->length );
init_info?init_info->eeprom_image_length:0,
init_info?init_info->init_file_length:0,
init_info?init_info->firmware_image_length:0 );
- res = tiwlan_init_drv((tiwlan_net_dev_t *)dev->priv, init_info);
+ res = tiwlan_init_drv((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev), init_info);
}
#ifdef DRIVER_PROFILING
else if (req->cmd == TIWLAN_PROFILING_REPORT)
{
- res = tiwlan_profile_report((tiwlan_net_dev_t *)dev->priv);
+ res = tiwlan_profile_report((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev));
}
else if (req->cmd == TIWLAN_PROFILING_CPU_ESTIMATOR_CMD) {
/* get the command cpu estimator command parameter */
switch (command_type)
{
case TIWLAN_PROFILING_CPU_ESTIMATOR_CMD_START:
- res = tiwlan_profile_cpu_usage_estimator_start((tiwlan_net_dev_t *)dev->priv,
+ res = tiwlan_profile_cpu_usage_estimator_start((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev),
/* the data in this case is the estimator
resolution in milliseconds */
command_data * 1000);
break;
case TIWLAN_PROFILING_CPU_ESTIMATOR_CMD_STOP:
- res = tiwlan_profile_cpu_usage_estimator_stop((tiwlan_net_dev_t *)dev->priv);
+ res = tiwlan_profile_cpu_usage_estimator_stop((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev));
break;
case TIWLAN_PROFILING_CPU_ESTIMATOR_CMD_RESET:
- res =tiwlan_profile_cpu_usage_estimator_reset((tiwlan_net_dev_t *)dev->priv);
+ res =tiwlan_profile_cpu_usage_estimator_reset((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev));
break;
default:
res = 0;
else
{
- res = tiwlan_send_wait_reply((tiwlan_net_dev_t *)dev->priv, ti1610_ioctl_priv_proc_tl,
+ res = tiwlan_send_wait_reply((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev), ti1610_ioctl_priv_proc_tl,
(unsigned long)req, (unsigned long)extra, 0, 0);
}
{
print_deb("ti1610_do_ioctl(): ...copy from %p to %p %ld bytes\n\n", extra, (void *) req->user_data_pointer, req->length );
print_memory_dump(extra, min(32,(int) req->length) );
- if( copy_to_user( (void *) req->user_data_pointer, extra, req->length ) )
- return -EFAULT;
+ copy_to_user( (void *) req->user_data_pointer, extra, req->length );
}
}
print_deb("ti1610_do_ioctl() = %d (req = %p, user_data_pointer=0x%lx, extra=%p)\n\n", res, req, req->user_data_pointer, extra );
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#endif /* DEBUG_MESSAGES */
}
-#ifdef TI_DBG
-#ifndef TIWLAN_MSM7000
-TI_STATUS debugFunction(TI_HANDLE hConfigMgr,
- UINT32 functionNumber,
- void *pParam);
-#endif
-#endif
int util_hal_debug_print(struct net_device *dev, ULONG *data)
{
hal_print_param_t *p = (hal_print_param_t *) data;
if( p->optional_param )
{
- if( copy_from_user(&opt_data, p->optional_param, sizeof(opt_data) ) )
- return -EFAULT;
+ copy_from_user(&opt_data, p->optional_param, sizeof(opt_data) );
}
print_deb("HAL_DEBUG_PRINT: func_id=%d, param=%x\n", p->func_id, opt_data );
-#ifdef TI_DBG
- debugFunction(CONFIG_MGR(dev), p->func_id, &opt_data );
-#endif
return 0;
}
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
memcpy(msg,pEvData,msgSize);
NETLINK_CB(skb).pid = 0; /* from kernel */
- NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
- NETLINK_CB(skb).dst_pid = (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID; /* Dm: */
-#endif
+ NETLINK_CB(skb).dst_group = RTNLGRP_LINK; // 2.6
+ //jorjin NETLINK_CB(skb).dst_pid = (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID;
/* send the message*/
res = netlink_unicast(drv->wl_sock, skb, (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID, MSG_DONTWAIT);
nlmsg_failure:
ti_dprintf(TIWLAN_LOG_INFO,"IPC kernel: did not send the netlink message\n");
return -1;
+
}
+
+
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#include <linux/timer.h>
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/vmalloc.h>
#include <linux/time.h>
#include <linux/list.h>
#include <asm/io.h>
-#ifdef CONFIG_TROUT_PWRSINK
-#include <asm/arch/trout_pwrsink.h>
-#endif
#include "debug_module.h"
#include "esta_drv.h"
static void os_timerHandlr(unsigned long parm);
static void send_frag(char* msg, int message_len, int level, int module);
+/* linux/irq.h declerations */
+extern void disable_irq(unsigned int);
+extern void enable_irq(unsigned int);
+
BOOL use_debug_module = FALSE;
+#define debug_module_enqueue_message
/****************************************************************************************
* *
static int from_new_line = 1; /* Used to save the last message EOL */
static UINT8 module = 0; /* Used to save the last message module */
static UINT8 level = 0; /* Used to save the last message level */
- va_list ap;
+ va_list ap;
static char msg[500];
char *p_msg = msg; /* Pointer to the message */
UINT16 message_len;
- UINT32 sec = 0;
- UINT32 uSec = 0;
+ UINT32 sec = 0;
+ UINT32 uSec = 0;
/* Format the message and keep the message length */
- va_start(ap,format);
+ va_start(ap,format);
message_len = vsnprintf(&msg[1], sizeof(msg) - 1, format, ap);
static void send_frag(char* msg, int message_len, int level, int module)
{
-#ifdef TIWLAN_OMAP1610 /* Dm: */
- int return_value;
+ int return_value;
int offset = 1;
int TmpLen;
char* FragMsg;
}
offset += TmpLen;
}while (offset < message_len);
-
-#endif
+
}
/****************************************************************************************
*****************************************************************************************/
void os_TNETWIF_BusTxn_Complete(TI_HANDLE OsContext,int status)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
- drv->dma_done = 1;
-#ifdef DM_USE_WORKQUEUE
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
- if( queue_work( drv->tiwlan_wq, &drv->tw ) != 0 ) {
-#ifdef CONFIG_ANDROID_POWER
- android_lock_suspend( &drv->timer_wake_lock );
-#endif
- }
-#else
+ drv->dma_done = 1;
tasklet_schedule(&drv->tl);
-#endif
}
/****************************************************************************************
TI_HANDLE OsContext
)
{
- struct timeval tv;
- do_gettimeofday(&tv);
- return tv.tv_sec*1000 + tv.tv_usec/1000;
+ struct timeval tv;
+ do_gettimeofday(&tv);
+ return tv.tv_sec*1000 + tv.tv_usec/1000;
}
/****************************************************************************************
TI_HANDLE OsContext
)
{
- struct timeval tv;
- do_gettimeofday(&tv);
- return tv.tv_sec*1000000 + tv.tv_usec;
+ struct timeval tv;
+ do_gettimeofday(&tv);
+ return tv.tv_sec*1000000 + tv.tv_usec;
}
/****************************************************************************************
UINT32 uSec
)
{
- /*UINT32 usec_now = os_timeStampUs(OsContext);
- while(os_timeStampUs(OsContext) - usec_now < uSec)
+ /*UINT32 usec_now = os_timeStampUs(OsContext);
+ while(os_timeStampUs(OsContext) - usec_now < uSec)
;
- */
- udelay(uSec);
+ */
+ udelay(uSec);
}
/****************************************************************************************
os_clearWlanReady(
void)
{
-#ifdef TIWLAN_OMAP1610
- omap_writel(4,GPIO1_IRQSTATUS1);
-#endif
+ omap_writel(4,GPIO1_IRQSTATUS1);
}
TI_HANDLE OsContext
)
{
-#ifdef TIWLAN_OMAP1610
- return (omap_readl(GPIO1_DATAIN) & 0x4);
-#else
- return 0;
-#endif
+ return (omap_readl(GPIO1_DATAIN) & 0x4);
}
TI_HANDLE OsContext
)
{
- return (TI_HANDLE)OS_PROTECT_HANDLE;
+ return (TI_HANDLE)OS_PROTECT_HANDLE;
}
TI_HANDLE ProtectCtx
)
{
- return;
+ return;
}
TI_HANDLE ProtectContext
)
{
-#if 1 /* uncomment for work in INDIRECT mode (HwACXAccessMethod=0) */
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
- spin_lock_irqsave(&drv->lock, drv->flags);
+#if 0 /* uncomment for work in INDIRECT mode (HwACXAccessMethod=0) */
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
+ spin_lock_irqsave(&drv->lock, drv->flags);
#endif
}
TI_HANDLE ProtectContext
)
{
-#if 1 /* uncomment for work in INDIRECT mode (HwACXAccessMethod=0) */
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
- spin_unlock_irqrestore(&drv->lock, drv->flags);
+#if 0 /* uncomment for work in INDIRECT mode (HwACXAccessMethod=0) */
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
+ spin_unlock_irqrestore(&drv->lock, drv->flags);
#endif
}
* GPIO 16 to the Y1 pinout.
*/
/* direction out */
-#ifdef TIWLAN_OMAP1610
+#if 0
omap_set_gpio_direction(GPIO_16, GPIO_16_DIRECTION_OUTPUT);
/* clear reset WLAN chip */
/* wait for 50msec */
mdelay(50);
-#endif /* Dm: */
-#ifdef TIWLAN_MSM7000
- trout_wifi_reset(1); /* Reset active */
- trout_wifi_power(0); /* Power disable */
- trout_wifi_power(1); /* Power enable */
- trout_wifi_reset(0); /* Reset clear */
#endif
}
+
#ifndef GWSI_DRIVER
/****************************************************************************************
TI_HANDLE OsContext
)
{
-#ifdef TIWLAN_OMAP1610
/*
Clear ELP_REQ by GPIO_CLEAR_DATAOUT
*/
Rising edge on ELP_REQ by GPIO_SET_DATAOUT
*/
omap_writel(0x00000200, 0xFFFBBCF0);
-#endif
}
/****************************************************************************************
/*
Clear ELP_REQ by GPIO_CLEAR_DATAOUT
*/
-#ifdef TIWLAN_OMAP1610
omap_writel(0x00000200, 0xFFFBBCB0);
-#endif
}
+
+
+
+
/****************************************************************************************
* _os_memorySharedFree()
****************************************************************************************
OS_PHYSICAL_ADDRESS pPhysical
)
{
- ti_dprintf(TIWLAN_LOG_ERROR, "\n\n\n %s is not implemented\n\n\n", __FUNCTION__);
+ ti_dprintf(TIWLAN_LOG_ERROR, "\n\n\n %s is not implemented\n\n\n", __FUNCTION__);
}
/****************************************************************************************
OS_PHYSICAL_ADDRESS *pPhysical
)
{
- ti_dprintf(TIWLAN_LOG_ERROR, "\n\n\n %s is not implemented\n\n\n", __FUNCTION__);
- return NULL;
+ ti_dprintf(TIWLAN_LOG_ERROR, "\n\n\n %s is not implemented\n\n\n", __FUNCTION__);
+ return NULL;
}
/****************************************************************************************
UINT32 Size
)
{
- memmove(pDestination, pSource, Size);
+ memmove(pDestination, pSource, Size);
}
UINT32 Size
)
{
- print_info("\nos_memoryMoveToHw pTarget 0x%08x pSource 0x%08x Size 0x%08x",(int)pTarget, (int)pSource,(int)Size);
- print_info("\n-------------------------> Not Implemented <--------------------------------------------------- ");
+ print_info("\nos_memoryMoveToHw pTarget 0x%08x pSource 0x%08x Size 0x%08x",(int)pTarget, (int)pSource,(int)Size);
+ print_info("\n-------------------------> Not Implemented <--------------------------------------------------- ");
}
/****************************************************************************************
UINT32 Size
)
{
- print_info("\nos_memoryMoveFromHw pTarget 0x%08x pSource 0x%08x Size 0x%08x",(int)pTarget, (int)pSource,(int)Size);
- print_info("\n-------------------------> Not Implemented <--------------------------------------------------- ");
+ print_info("\nos_memoryMoveFromHw pTarget 0x%08x pSource 0x%08x Size 0x%08x",(int)pTarget, (int)pSource,(int)Size);
+ print_info("\n-------------------------> Not Implemented <--------------------------------------------------- ");
}
/****************************************************************************************
PUINT8 Data
)
{
- *Data = *Register;
- PRINT_REG("R8: %p=0x%x\n", Register, *Data);
- return;
+ *Data = *Register;
+ PRINT_REG("R8: %p=0x%x\n", Register, *Data);
+ return;
}
/****************************************************************************************
UINT16 Data
)
{
- PRINT_REG("W16: %p=0x%x\n", Register, Data);
- *Register = Data;
- return;
+ PRINT_REG("W16: %p=0x%x\n", Register, Data);
+ *Register = Data;
+ return;
}
/****************************************************************************************
PUINT16 Data
)
{
- *Data = *Register;
- PRINT_REG("R16: %p=0x%x\n", Register, *Data);
- return;
+ *Data = *Register;
+ PRINT_REG("R16: %p=0x%x\n", Register, *Data);
+ return;
}
/****************************************************************************************
UINT32 Data
)
{
- PRINT_REG("W32: %p=0x%x\n", Register, Data);
- *Register = Data;
- return;
+ PRINT_REG("W32: %p=0x%x\n", Register, Data);
+ *Register = Data;
+ return;
}
PUINT32 Data
)
{
- *Data = *Register;
- PRINT_REG("R32: %p=0x%x\n", Register, *Data);
- return;
+ *Data = *Register;
+ PRINT_REG("R32: %p=0x%x\n", Register, *Data);
+ return;
}
UINT16 Length
)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
- struct sk_buff *skb;
- mem_MSDU_T* pMsdu = (mem_MSDU_T*)pPacket;
- mem_BD_T *pCurBd;
- ti_nodprintf(TIWLAN_LOG_INFO, "os_receivePacket - Received EAPOL len-%d\n", pMsdu->firstBDPtr->length );
-
- bm_trace(10, Length, 0);
-
- if (pMsdu->firstBDPtr->length > Length) { /* Dm: Security fix */
- ti_dprintf(TIWLAN_LOG_ERROR, " TI: %s - Security Error\n", __FUNCTION__);
- return FALSE;
- }
-
- skb = dev_alloc_skb(Length+2);
- if(!skb) {
- print_deb(" os_receivePacket() : dev_alloc_skb failed!\n");
- configMgr_memMngrFreeMSDU(drv->adapter.CoreHalCtx, memMgr_MsduHandle(pPacket));
- drv->stats.rx_dropped++;
- return FALSE;
- }
- skb_reserve(skb, 2);
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)OsContext;
+ struct sk_buff *skb;
+ mem_MSDU_T* pMsdu = (mem_MSDU_T*)pPacket;
+ mem_BD_T *pCurBd;
+ ti_nodprintf(TIWLAN_LOG_INFO, "os_receivePacket - Received EAPOL len-%d\n", pMsdu->firstBDPtr->length );
+
+ bm_trace(10, Length, 0);
+
+ skb = dev_alloc_skb(Length+2);
+ if(!skb) {
+ print_deb(" os_receivePacket() : dev_alloc_skb failed!\n");
+ configMgr_memMngrFreeMSDU(drv->adapter.CoreHalCtx, memMgr_MsduHandle(pPacket));
+ drv->stats.rx_dropped++;
+ return FALSE;
+ }
+ skb_reserve(skb, 2);
- pCurBd = pMsdu->firstBDPtr;
- while (pCurBd) {
- memcpy(skb_put(skb,pCurBd->length),pCurBd->data+pCurBd->dataOffset,pCurBd->length);
- pCurBd = pCurBd->nextBDPtr;
- }
+ pCurBd = pMsdu->firstBDPtr;
+ while (pCurBd) {
+ memcpy(skb_put(skb,pCurBd->length),pCurBd->data+pCurBd->dataOffset,pCurBd->length);
+ pCurBd = pCurBd->nextBDPtr;
+ }
- skb->dev = drv->netdev;
- skb->protocol = eth_type_trans(skb, drv->netdev);
- skb->ip_summed = CHECKSUM_NONE;
+ skb->dev = drv->netdev;
+ skb->protocol = eth_type_trans(skb, drv->netdev);
+ skb->ip_summed = CHECKSUM_NONE;
- drv->stats.rx_packets++;
- drv->stats.rx_bytes += skb->len;
+ drv->stats.rx_packets++;
+ drv->stats.rx_bytes += skb->len;
- bm_trace(11, Length, 0);
-#ifdef CONFIG_ANDROID_POWER
- drv->receive_packet = 1; /* Remember to stay awake */
-#endif
- netif_rx(skb);
+ bm_trace(11, Length, 0);
+ netif_rx(skb);
- configMgr_memMngrFreeMSDU(drv->adapter.CoreHalCtx, memMgr_MsduHandle(pPacket));
+ configMgr_memMngrFreeMSDU(drv->adapter.CoreHalCtx, memMgr_MsduHandle(pPacket));
- bm_trace(12, Length, 0);
+ bm_trace(12, Length, 0);
- return TRUE;
+ return TRUE;
}
/****************************************************************************************
UINT16 Length
)
{
- struct net_device *dev = (struct net_device *)OsContext;
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
+ struct net_device *dev = (struct net_device *)OsContext;
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev);
- INT32 status;
- mem_MSDU_T* pMsdu;
- char *pMsduData;
- UINT32 packetHeaderLength;
+ INT32 status;
+ mem_MSDU_T* pMsdu;
+ char *pMsduData;
+ UINT32 packetHeaderLength;
ti_nodprintf(TIWLAN_LOG_INFO, "os_sendPacket - Transmit EAPOL len-%x\n",Length );
pMsdu->freeArgs[0] = 0;
pMsdu->freeArgs[1] = 0;
+
/*
* Propagate Msdu through Config Manager.
* Set DTag to 0
status = configMgr_sendMsdu(drv->adapter.CoreHalCtx, pMsdu, 0);
return status;
+
}
+
#endif /* NDEF GWSI_DRIVER*/
-----------------------------------------------------------------------------*/
static inline void os_timer_dec_use_count(timer_obj_t *tmr)
{
- if (unlikely(!tmr->use_count)) {
- ti_dprintf(TIWLAN_LOG_ERROR, "\n\n\n %s: attempt to delete a deleted timer %p\n\n\n", __FUNCTION__, tmr);
- tmr->use_count = 1;
- }
- if (!(--tmr->use_count))
- os_memoryFree(tmr->req.drv, tmr, sizeof(timer_obj_t));
+ if (unlikely(!tmr->use_count))
+ {
+ ti_dprintf(TIWLAN_LOG_ERROR, "\n\n\n %s: attempt to delete a deleted timer %p\n\n\n", __FUNCTION__, tmr);
+ tmr->use_count = 1;
+ }
+ if (!(--tmr->use_count))
+ os_memoryFree(tmr->req.drv, tmr, sizeof(timer_obj_t));
}
-----------------------------------------------------------------------------*/
static int os_tl_timerHandlr(struct tiwlan_req *req)
{
- timer_obj_t *tmr= (timer_obj_t *)req;
- PTIMER_FUNCTION f = (PTIMER_FUNCTION)req->u.req.p1;
- TI_HANDLE parm = (TI_HANDLE)req->u.req.p2;
-
- esta_timer_log("%s: req=0x%x f=0x%p parm=0x%p\n", __FUNCTION__, req, f, parm);
- ++tmr->use_count;
- f(parm);
- if (req->u.req.p3) /* Periodic ? */
- mod_timer(&tmr->timer, jiffies + req->u.req.p4);
- os_timer_dec_use_count(tmr);
-
- return 0;
+ timer_obj_t *tmr= (timer_obj_t *)req;
+ PTIMER_FUNCTION f = (PTIMER_FUNCTION)req->u.req.p1;
+ TI_HANDLE parm = (TI_HANDLE)req->u.req.p2;
+
+ esta_timer_log("%s: req=0x%x f=0x%p parm=0x%p\n", __FUNCTION__, req, f, parm);
+ ++tmr->use_count;
+ f(parm);
+ if (req->u.req.p3) /* Periodic ? */
+ mod_timer(&tmr->timer, jiffies + req->u.req.p4);
+ os_timer_dec_use_count(tmr);
+
+ return 0;
}
-----------------------------------------------------------------------------*/
static void os_timerHandlr(unsigned long parm)
{
- timer_obj_t *tmr= (timer_obj_t *)parm;
- tiwlan_net_dev_t *drv = tmr->req.drv;
- unsigned long flags;
+ timer_obj_t *tmr= (timer_obj_t *)parm;
+ tiwlan_net_dev_t *drv = tmr->req.drv;
+ unsigned long flags;
- esta_timer_log("%s: drv=%p f=0x%x ctx=0x%x\n",
+ esta_timer_log("%s: drv=%p f=0x%x ctx=0x%x\n",
__FUNCTION__, tmr->req.drv, tmr->req.u.req.p1, tmr->req.u.req.p2);
- spin_lock_irqsave(&drv->lock, flags);
- list_del(&tmr->req.list);
- list_add_tail(&tmr->req.list, &drv->request_q);
- spin_unlock_irqrestore(&drv->lock, flags);
-#ifdef DM_USE_WORKQUEUE
- /* printk("TI: %s:\t%lu\n", __FUNCTION__, jiffies); */
- if( queue_work( drv->tiwlan_wq, &drv->tw ) != 0 ) {
-#ifdef CONFIG_ANDROID_POWER
- android_lock_suspend( &drv->timer_wake_lock );
-#endif
- }
-#else
- tasklet_schedule(&drv->tl);
-#endif
+ spin_lock_irqsave(&drv->lock, flags);
+ list_del(&tmr->req.list);
+ list_add_tail(&tmr->req.list, &drv->request_q);
+ spin_unlock_irqrestore(&drv->lock, flags);
+ tasklet_schedule(&drv->tl);
}
switch(pInParam->uEventType)
{
case IPC_EVENT_ASSOCIATED:
- if (drv->netdev != NULL) {
+ if (drv->netdev != NULL)
netif_carrier_on(drv->netdev);
-#ifdef CONFIG_TROUT_PWRSINK
- queue_delayed_work(drv->tiwlan_wq, &drv->trxw, 0);
-#endif
- }
break;
case IPC_EVENT_DISASSOCIATED:
- if (drv->netdev != NULL) {
-#ifdef CONFIG_TROUT_PWRSINK
- cancel_delayed_work_sync(&drv->trxw);
- trout_pwrsink_set(PWRSINK_WIFI, PWRSINK_WIFI_PERCENT_BASE);
-#endif
- netif_carrier_off(drv->netdev);
- }
+ if (drv->netdev != NULL)
+ netif_carrier_off(drv->netdev);
break;
case IPC_EVENT_LINK_SPEED:
void os_ToggleDebugGPIO(int count)
{
-#if 0
- int i,j;
+ int i,j;
- omap_writel(0x00000200, 0xFFFBBCB0 );/* 0 */
+ omap_writel(0x00000200, 0xFFFBBCB0 );/* 0*/
for(i=0;i<count;i++)
{
- omap_writel(0x00000200, 0xFFFBBCF0 );/* 1 */
+ omap_writel(0x00000200, 0xFFFBBCF0 );/* 1 */
for(j=0;j<100;j++);
- omap_writel(0x00000200, 0xFFFBBCB0 );/* 0 */
+ omap_writel(0x00000200, 0xFFFBBCB0 );/* 0*/
for(j=0;j<100;j++);
}
-#endif
}
#ifdef TIWLAN_OMAP1610_CRTWIPP_GPIO_DEBUG
VOID
{
return;
}
+
+
+
/****************************************************************************
**+-----------------------------------------------------------------------+**
-**| |**
+**| |**
**| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
**| All rights reserved. |**
-**| |**
+**| |**
**| Redistribution and use in source and binary forms, with or without |**
**| modification, are permitted provided that the following conditions |**
**| are met: |**
-**| |**
+**| |**
**| * Redistributions of source code must retain the above copyright |**
**| notice, this list of conditions and the following disclaimer. |**
**| * Redistributions in binary form must reproduce the above copyright |**
**| * Neither the name Texas Instruments nor the names of its |**
**| contributors may be used to endorse or promote products derived |**
**| from this software without specific prior written permission. |**
-**| |**
+**| |**
**| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
**| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
**| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
**| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
**| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
**| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
-**| |**
+**| |**
**+-----------------------------------------------------------------------+**
****************************************************************************/
#ifdef TI_MEM_ALLOC_TRACE
os_printf("MTT:%s:%d ::os_memoryAlloc(0x%p, %lu) : %lu\n",__FUNCTION__, __LINE__,OsContext,Size,total_size);
#endif
- if( total_size < Size ) { /* Dm: Security fix */
- return NULL;
- }
/*
memory optimization issue. Allocate 8 kB and less from the SLAB allocator (2^n)
otherwise allocate from virtual pool.
#endif
MemSize = Number * Size;
- if( (Number > 0) && (Size >= (0xFFFFFFFFUL / Number)) ) { /* Dm: Security fix */
- return NULL;
- }
-
pAllocatedMem = os_memoryAlloc(OsContext, MemSize);
if(!pAllocatedMem)