Commit d4945f09 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging:vt6655:card: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e1c77579
......@@ -61,7 +61,7 @@
/*--------------------- Static Definitions -------------------------*/
//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
static int msglevel = MSG_LEVEL_INFO;
#define C_SIFS_A 16 // micro sec.
#define C_SIFS_BG 10
......@@ -79,13 +79,13 @@ static int msglevel =MSG_LEVEL_INFO;
#define WAIT_BEACON_TX_DOWN_TMO 3 // Times
//1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M
//1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M
static unsigned char abyDefaultSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C};
//6M, 9M, 12M, 48M
//6M, 9M, 12M, 48M
static unsigned char abyDefaultExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60};
//6M, 9M, 12M, 18M, 24M, 36M, 48M, 54M
//6M, 9M, 12M, 18M, 24M, 36M, 48M, 54M
static unsigned char abyDefaultSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C};
//1M, 2M, 5M, 11M,
//1M, 2M, 5M, 11M,
static unsigned char abyDefaultSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16};
......@@ -105,7 +105,7 @@ s_vCalculateOFDMRParameter(
CARD_PHY_TYPE ePHYType,
unsigned char *pbyTxRate,
unsigned char *pbyRsvTime
);
);
/*--------------------- Export Functions --------------------------*/
......@@ -126,15 +126,15 @@ s_vCalculateOFDMRParameter(
*/
static
void
s_vCalculateOFDMRParameter (
s_vCalculateOFDMRParameter(
unsigned char byRate,
CARD_PHY_TYPE ePHYType,
unsigned char *pbyTxRate,
unsigned char *pbyRsvTime
)
)
{
switch (byRate) {
case RATE_6M :
case RATE_6M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9B;
*pbyRsvTime = 44;
......@@ -145,7 +145,7 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_9M :
case RATE_9M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9F;
*pbyRsvTime = 36;
......@@ -156,7 +156,7 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_12M :
case RATE_12M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9A;
*pbyRsvTime = 32;
......@@ -167,7 +167,7 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_18M :
case RATE_18M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9E;
*pbyRsvTime = 28;
......@@ -178,7 +178,7 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_36M :
case RATE_36M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9D;
*pbyRsvTime = 24;
......@@ -189,7 +189,7 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_48M :
case RATE_48M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x98;
*pbyRsvTime = 24;
......@@ -200,7 +200,7 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_54M :
case RATE_54M:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x9C;
*pbyRsvTime = 24;
......@@ -211,8 +211,8 @@ s_vCalculateOFDMRParameter (
}
break;
case RATE_24M :
default :
case RATE_24M:
default:
if (ePHYType == PHY_TYPE_11A) {//5GHZ
*pbyTxRate = 0x99;
*pbyRsvTime = 28;
......@@ -241,7 +241,7 @@ s_vCalculateOFDMRParameter (
*/
static
void
s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs, void *pvExtSupportRateIEs)
s_vSetRSPINF(PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs, void *pvExtSupportRateIEs)
{
unsigned char byServ = 0, bySignal = 0; // For CCK
unsigned short wLen = 0;
......@@ -258,9 +258,9 @@ s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs,
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_1, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_1, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
///RSPINF_b_2
BBvCalculateParameter(pDevice,
14,
......@@ -269,9 +269,9 @@ s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs,
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_2, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_2, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
//RSPINF_b_5
BBvCalculateParameter(pDevice,
14,
......@@ -280,9 +280,9 @@ s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs,
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_5, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_5, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
//RSPINF_b_11
BBvCalculateParameter(pDevice,
14,
......@@ -291,62 +291,62 @@ s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs,
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_11, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_11, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
//RSPINF_a_6
s_vCalculateOFDMRParameter(RATE_6M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_6, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_6, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_9
s_vCalculateOFDMRParameter(RATE_9M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_9, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_9, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_12
s_vCalculateOFDMRParameter(RATE_12M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_12, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_12, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_18
s_vCalculateOFDMRParameter(RATE_18M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_18, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_18, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_24
s_vCalculateOFDMRParameter(RATE_24M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_36
s_vCalculateOFDMRParameter(
VNTWIFIbyGetACKTxRate(RATE_36M, pvSupportRateIEs, pvExtSupportRateIEs),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_48
s_vCalculateOFDMRParameter(
VNTWIFIbyGetACKTxRate(RATE_48M, pvSupportRateIEs, pvExtSupportRateIEs),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_54
s_vCalculateOFDMRParameter(
VNTWIFIbyGetACKTxRate(RATE_54M, pvSupportRateIEs, pvExtSupportRateIEs),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_72
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_72, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_72, MAKEWORD(byTxRate, byRsvTime));
//Set to Page0
MACvSelectPage0(pDevice->PortOffset);
}
......@@ -369,8 +369,8 @@ s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs,
*
*/
/*
bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength)
{
bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
if (ePktType == PKT_TYPE_802_11_MNG) {
return TXbTD0Send(pDevice, pPacket, uLength);
......@@ -381,7 +381,7 @@ bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktTyp
}
return (true);
}
}
*/
......@@ -397,7 +397,7 @@ bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktTyp
* Return Value: true if short preamble; otherwise false
*
*/
bool CARDbIsShortPreamble (void *pDeviceHandler)
bool CARDbIsShortPreamble(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
if (pDevice->byPreambleType == 0) {
......@@ -418,7 +418,7 @@ bool CARDbIsShortPreamble (void *pDeviceHandler)
* Return Value: true if short slot time; otherwise false
*
*/
bool CARDbIsShorSlotTime (void *pDeviceHandler)
bool CARDbIsShorSlotTime(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
return(pDevice->bShortSlotTime);
......@@ -437,7 +437,7 @@ bool CARDbIsShorSlotTime (void *pDeviceHandler)
* Return Value: None.
*
*/
bool CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned short wCapInfo, unsigned char byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs)
bool CARDbSetPhyParameter(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned short wCapInfo, unsigned char byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned char byCWMaxMin = 0;
......@@ -531,7 +531,7 @@ bool CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigne
}
BBbWriteEmbedded(pDevice->PortOffset, 0x88, 0x08);
bySIFS = C_SIFS_BG;
if(VNTWIFIbIsShortSlotTime(wCapInfo)) {
if (VNTWIFIbIsShortSlotTime(wCapInfo)) {
bySlot = C_SLOT_SHORT;
byDIFS = C_SIFS_BG + 2*C_SLOT_SHORT;
} else {
......@@ -624,7 +624,7 @@ bool CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigne
* Return Value: none
*
*/
bool CARDbUpdateTSF (void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF)
bool CARDbUpdateTSF(void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
QWORD qwTSFOffset;
......@@ -659,7 +659,7 @@ bool CARDbUpdateTSF (void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTi
* Return Value: true if succeed; otherwise false
*
*/
bool CARDbSetBeaconPeriod (void *pDeviceHandler, unsigned short wBeaconInterval)
bool CARDbSetBeaconPeriod(void *pDeviceHandler, unsigned short wBeaconInterval)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int uBeaconInterval = 0;
......@@ -672,7 +672,7 @@ bool CARDbSetBeaconPeriod (void *pDeviceHandler, unsigned short wBeaconInterval)
LODWORD(qwNextTBTT) = 0;
CARDbGetCurrentTSF(pDevice->PortOffset, &qwNextTBTT); //Get Local TSF counter
uBeaconInterval = wBeaconInterval * 1024;
// Next TBTT = ((local_current_TSF / beacon_interval) + 1 ) * beacon_interval
// Next TBTT = ((local_current_TSF / beacon_interval) + 1) * beacon_interval
uLowNextTBTT = (LODWORD(qwNextTBTT) >> 10) << 10;
uLowRemain = (uLowNextTBTT) % uBeaconInterval;
// high dword (mod) bcn
......@@ -683,7 +683,7 @@ bool CARDbSetBeaconPeriod (void *pDeviceHandler, unsigned short wBeaconInterval)
// check if carry when add one beacon interval
if ((~uLowNextTBTT) < uLowRemain) {
HIDWORD(qwNextTBTT) ++ ;
HIDWORD(qwNextTBTT)++;
}
LODWORD(qwNextTBTT) = uLowNextTBTT + uLowRemain;
......@@ -713,7 +713,7 @@ bool CARDbSetBeaconPeriod (void *pDeviceHandler, unsigned short wBeaconInterval)
* Return Value: true if all data packet complete; otherwise false.
*
*/
bool CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType)
bool CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -733,7 +733,7 @@ bool CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType)
if (pDevice->bStopBeacon == true) {
if (pDevice->bIsBeaconBufReadySet == true) {
if (pDevice->cbBeaconBufReadySetCnt < WAIT_BEACON_TX_DOWN_TMO) {
pDevice->cbBeaconBufReadySetCnt ++;
pDevice->cbBeaconBufReadySetCnt++;
return(false);
}
}
......@@ -743,13 +743,13 @@ bool CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType)
}
// wait all TD0 complete
if (pDevice->bStopTx0Pkt == true) {
if (pDevice->iTDUsed[TYPE_TXDMA0] != 0){
if (pDevice->iTDUsed[TYPE_TXDMA0] != 0) {
return(false);
}
}
// wait all Data TD complete
if (pDevice->bStopDataPkt == true) {
if (pDevice->iTDUsed[TYPE_AC0DMA] != 0){
if (pDevice->iTDUsed[TYPE_AC0DMA] != 0) {
return(false);
}
}
......@@ -771,7 +771,7 @@ bool CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType)
* Return Value: true if success; false if failed.
*
*/
bool CARDbStartTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType)
bool CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -833,14 +833,14 @@ bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE e
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID);
pDevice->bBSSIDFilter = false;
pDevice->byRxMode &= ~RCR_BSSID;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode );
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode);
} else {
if (is_zero_ether_addr(pDevice->abyBSSID) == false) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID);
pDevice->bBSSIDFilter = true;
pDevice->byRxMode |= RCR_BSSID;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wmgr: rx_mode = %x\n", pDevice->byRxMode );
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wmgr: rx_mode = %x\n", pDevice->byRxMode);
}
// Adopt BSS state in Adapter Device Object
pDevice->eOPMode = eOPMode;
......@@ -885,7 +885,7 @@ bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE e
bool CARDbSetTxDataRate(
void *pDeviceHandler,
unsigned short wDataRate
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -906,11 +906,11 @@ bool CARDbSetTxDataRate(
*
* Return Value: true if power down success; otherwise false
*
-*/
-*/
bool
CARDbPowerDown(
void *pDeviceHandler
)
)
{
PSDevice pDevice = (PSDevice)pDeviceHandler;
unsigned int uIdx;
......@@ -924,13 +924,13 @@ CARDbPowerDown(
// check if all TD are empty,
for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx ++) {
for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx++) {
if (pDevice->iTDUsed[uIdx] != 0)
return false;
}
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_GO2DOZE);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Go to Doze ZZZZZZZZZZZZZZZ\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Go to Doze ZZZZZZZZZZZZZZZ\n");
return true;
}
......@@ -946,9 +946,9 @@ CARDbPowerDown(
* Return Value: true if success; otherwise false
*
*/
bool CARDbRadioPowerOff (void *pDeviceHandler)
bool CARDbRadioPowerOff(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
PSDevice pDevice = (PSDevice)pDeviceHandler;
bool bResult = true;
if (pDevice->bRadioOff == true)
......@@ -977,8 +977,8 @@ bool CARDbRadioPowerOff (void *pDeviceHandler)
pDevice->bRadioOff = true;
//2007-0409-03,<Add> by chester
printk("chester power off\n");
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
printk("chester power off\n");
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
return bResult;
}
......@@ -995,20 +995,20 @@ MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
* Return Value: true if success; otherwise false
*
*/
bool CARDbRadioPowerOn (void *pDeviceHandler)
bool CARDbRadioPowerOn(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
bool bResult = true;
printk("chester power on\n");
if (pDevice->bRadioControlOff == true){
if (pDevice->bHWRadioOff == true) printk("chester bHWRadioOff\n");
if (pDevice->bRadioControlOff == true) printk("chester bRadioControlOff\n");
return false;}
printk("chester power on\n");
if (pDevice->bRadioControlOff == true) {
if (pDevice->bHWRadioOff == true) printk("chester bHWRadioOff\n");
if (pDevice->bRadioControlOff == true) printk("chester bRadioControlOff\n");
return false; }
if (pDevice->bRadioOff == false)
{
printk("chester pbRadioOff\n");
return true;}
printk("chester pbRadioOff\n");
return true; }
BBvExitDeepSleep(pDevice->PortOffset, pDevice->byLocalID);
......@@ -1032,14 +1032,14 @@ return true;}
pDevice->bRadioOff = false;
// 2007-0409-03,<Add> by chester
printk("chester power on\n");
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
printk("chester power on\n");
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
return bResult;
}
bool CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID)
bool CARDbRemoveKey(void *pDeviceHandler, unsigned char *pbyBSSID)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -1063,36 +1063,36 @@ bool CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID)
*
* Return Value: none.
*
-*/
-*/
bool
CARDbAdd_PMKID_Candidate (
CARDbAdd_PMKID_Candidate(
void *pDeviceHandler,
unsigned char *pbyBSSID,
bool bRSNCapExist,
unsigned short wRSNCap
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
PPMKID_CANDIDATE pCandidateList;
unsigned int ii = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"bAdd_PMKID_Candidate START: (%d)\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bAdd_PMKID_Candidate START: (%d)\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFlush_PMKID_Candidate: 3\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "vFlush_PMKID_Candidate: 3\n");
memset(&pDevice->gsPMKIDCandidate, 0, sizeof(SPMKIDCandidateEvent));
}
for (ii = 0; ii < 6; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02X ", *(pbyBSSID + ii));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02X ", *(pbyBSSID + ii));
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
// Update Old Candidate
for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii];
if ( !memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) {
if (!memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) {
if ((bRSNCapExist == true) && (wRSNCap & BIT0)) {
pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
} else {
......@@ -1111,14 +1111,14 @@ CARDbAdd_PMKID_Candidate (
}
memcpy(pCandidateList->BSSID, pbyBSSID, ETH_ALEN);
pDevice->gsPMKIDCandidate.NumCandidates++;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
return true;
}
void *
CARDpGetCurrentAddress (
CARDpGetCurrentAddress(
void *pDeviceHandler
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -1138,13 +1138,13 @@ CARDpGetCurrentAddress (
*
* Return Value: none.
*
-*/
-*/
bool
CARDbStartMeasure (
CARDbStartMeasure(
void *pDeviceHandler,
void *pvMeasureEIDs,
unsigned int uNumOfMeasureEIDs
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
PWLAN_IE_MEASURE_REQ pEID = (PWLAN_IE_MEASURE_REQ) pvMeasureEIDs;
......@@ -1180,9 +1180,9 @@ CARDbStartMeasure (
pDevice->uNumOfMeasureEIDs--;
if (pDevice->byLocalID > REV_ID_VT3253_B1) {
HIDWORD(qwStartTSF) = HIDWORD(*((PQWORD) (pDevice->pCurrMeasureEID->sReq.abyStartTime)));
LODWORD(qwStartTSF) = LODWORD(*((PQWORD) (pDevice->pCurrMeasureEID->sReq.abyStartTime)));
wDuration = *((unsigned short *) (pDevice->pCurrMeasureEID->sReq.abyDuration));
HIDWORD(qwStartTSF) = HIDWORD(*((PQWORD)(pDevice->pCurrMeasureEID->sReq.abyStartTime)));
LODWORD(qwStartTSF) = LODWORD(*((PQWORD)(pDevice->pCurrMeasureEID->sReq.abyStartTime)));
wDuration = *((unsigned short *)(pDevice->pCurrMeasureEID->sReq.abyDuration));
wDuration += 1; // 1 TU for channel switching
if ((LODWORD(qwStartTSF) == 0) && (HIDWORD(qwStartTSF) == 0)) {
......@@ -1205,11 +1205,11 @@ CARDbStartMeasure (
if ((HIDWORD(qwCurrTSF) < HIDWORD(qwStartTSF)) ||
((HIDWORD(qwCurrTSF) == HIDWORD(qwStartTSF)) &&
(LODWORD(qwCurrTSF) < LODWORD(qwStartTSF)))
) {
) {
bExpired = false;
break;
}
VNTWIFIbMeasureReport( pDevice->pMgmt,
VNTWIFIbMeasureReport(pDevice->pMgmt,
false,
pDevice->pCurrMeasureEID,
MEASURE_MODE_LATE,
......@@ -1219,7 +1219,7 @@ CARDbStartMeasure (
);
} else {
// hardware do not support measure
VNTWIFIbMeasureReport( pDevice->pMgmt,
VNTWIFIbMeasureReport(pDevice->pMgmt,
false,
pDevice->pCurrMeasureEID,
MEASURE_MODE_INCAPABLE,
......@@ -1239,7 +1239,7 @@ CARDbStartMeasure (
MACvSelectPage0(pDevice->PortOffset);
} else {
// all measure start time expired we should complete action
VNTWIFIbMeasureReport( pDevice->pMgmt,
VNTWIFIbMeasureReport(pDevice->pMgmt,
true,
NULL,
0,
......@@ -1265,14 +1265,14 @@ CARDbStartMeasure (
*
* Return Value: none.
*
-*/
-*/
bool
CARDbChannelSwitch (
CARDbChannelSwitch(
void *pDeviceHandler,
unsigned char byMode,
unsigned char byNewChannel,
unsigned char byCount
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
bool bResult = true;
......@@ -1289,7 +1289,7 @@ CARDbChannelSwitch (
pDevice->byNewChannel = byNewChannel;
pDevice->bChannelSwitch = true;
if (byMode == 1) {
bResult=CARDbStopTxPacket(pDevice, PKT_TYPE_802_11_ALL);
bResult = CARDbStopTxPacket(pDevice, PKT_TYPE_802_11_ALL);
}
return (bResult);
}
......@@ -1308,23 +1308,23 @@ CARDbChannelSwitch (
*
* Return Value: none.
*
-*/
-*/
bool
CARDbSetQuiet (
CARDbSetQuiet(
void *pDeviceHandler,
bool bResetQuiet,
unsigned char byQuietCount,
unsigned char byQuietPeriod,
unsigned short wQuietDuration,
unsigned short wQuietOffset
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int ii = 0;
if (bResetQuiet == true) {
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN));
for(ii=0;ii<MAX_QUIET_COUNT;ii++) {
for (ii = 0; ii < MAX_QUIET_COUNT; ii++) {
pDevice->sQuiet[ii].bEnable = false;
}
pDevice->uQuietEnqueue = 0;
......@@ -1365,11 +1365,11 @@ CARDbSetQuiet (
*
* Return Value: none.
*
-*/
-*/
bool
CARDbStartQuiet (
CARDbStartQuiet(
void *pDeviceHandler
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int ii = 0;
......@@ -1379,7 +1379,7 @@ CARDbStartQuiet (
unsigned long dwGap = 0;
unsigned long dwDuration = 0;
for(ii=0;ii<MAX_QUIET_COUNT;ii++) {
for (ii = 0; ii < MAX_QUIET_COUNT; ii++) {
if ((pDevice->sQuiet[ii].bEnable == true) &&
(dwStartTime > pDevice->sQuiet[ii].dwStartTime)) {
dwStartTime = pDevice->sQuiet[ii].dwStartTime;
......@@ -1441,7 +1441,7 @@ CARDbStartQuiet (
}
if (pDevice->dwCurrentQuietEndTime > 0x80010000) {
// decreament all time to avoid wrap around
for(ii=0;ii<MAX_QUIET_COUNT;ii++) {
for (ii = 0; ii < MAX_QUIET_COUNT; ii++) {
if (pDevice->sQuiet[ii].bEnable == true) {
pDevice->sQuiet[ii].dwStartTime -= 0x80000000;
}
......@@ -1465,13 +1465,13 @@ CARDbStartQuiet (
*
* Return Value: none.
*
-*/
-*/
void
CARDvSetPowerConstraint (
CARDvSetPowerConstraint(
void *pDeviceHandler,
unsigned char byChannel,
char byPower
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -1500,13 +1500,13 @@ CARDvSetPowerConstraint (
*
* Return Value: none.
*
-*/
-*/
void
CARDvGetPowerCapability (
CARDvGetPowerCapability(
void *pDeviceHandler,
unsigned char *pbyMinPower,
unsigned char *pbyMaxPower
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned char byDec = 0;
......@@ -1537,9 +1537,9 @@ CARDvGetPowerCapability (
*
*/
char
CARDbyGetTransmitPower (
CARDbyGetTransmitPower(
void *pDeviceHandler
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -1548,9 +1548,9 @@ CARDbyGetTransmitPower (
//xxx
void
CARDvSafeResetTx (
CARDvSafeResetTx(
void *pDeviceHandler
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int uu;
......@@ -1560,7 +1560,7 @@ CARDvSafeResetTx (
pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]);
pDevice->apTailTD[1] = pDevice->apCurrTD[1] = &(pDevice->apTD1Rings[0]);
for (uu = 0; uu < TYPE_MAXTD; uu ++)
for (uu = 0; uu < TYPE_MAXTD; uu++)
pDevice->iTDUsed[uu] = 0;
for (uu = 0; uu < pDevice->sOpts.nTxDescs[0]; uu++) {
......@@ -1602,11 +1602,11 @@ CARDvSafeResetTx (
*
* Return Value: none
*
-*/
-*/
void
CARDvSafeResetRx (
CARDvSafeResetRx(
void *pDeviceHandler
)
)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int uu;
......@@ -1615,22 +1615,22 @@ CARDvSafeResetRx (
// initialize RD index
pDevice->pCurrRD[0]=&(pDevice->aRD0Ring[0]);
pDevice->pCurrRD[1]=&(pDevice->aRD1Ring[0]);
pDevice->pCurrRD[0] = &(pDevice->aRD0Ring[0]);
pDevice->pCurrRD[1] = &(pDevice->aRD1Ring[0]);
// init state, all RD is chip's
for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) {
pDesc =&(pDevice->aRD0Ring[uu]);
pDesc = &(pDevice->aRD0Ring[uu]);
pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz);
pDesc->m_rd0RD0.f1Owner=OWNED_BY_NIC;
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz);
}
// init state, all RD is chip's
for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) {
pDesc =&(pDevice->aRD1Ring[uu]);
pDesc = &(pDevice->aRD1Ring[uu]);
pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz);
pDesc->m_rd0RD0.f1Owner=OWNED_BY_NIC;
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz);
}
......@@ -1673,7 +1673,7 @@ unsigned short CARDwGetCCKControlRate(void *pDeviceHandler, unsigned short wRate
if (pDevice->wBasicRate & ((unsigned short)1 << ui)) {
return (unsigned short)ui;
}
ui --;
ui--;
}
return (unsigned short)RATE_1M;
}
......@@ -1691,27 +1691,27 @@ unsigned short CARDwGetCCKControlRate(void *pDeviceHandler, unsigned short wRate
* Return Value: response Control frame rate
*
*/
unsigned short CARDwGetOFDMControlRate (void *pDeviceHandler, unsigned short wRateIdx)
unsigned short CARDwGetOFDMControlRate(void *pDeviceHandler, unsigned short wRateIdx)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int ui = (unsigned int) wRateIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BASIC RATE: %X\n", pDevice->wBasicRate);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BASIC RATE: %X\n", pDevice->wBasicRate);
if (!CARDbIsOFDMinBasicRate((void *)pDevice)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDwGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDwGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
if (wRateIdx > RATE_24M)
wRateIdx = RATE_24M;
return wRateIdx;
}
while (ui > RATE_11M) {
if (pDevice->wBasicRate & ((unsigned short)1 << ui)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDwGetOFDMControlRate : %d\n", ui);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDwGetOFDMControlRate : %d\n", ui);
return (unsigned short)ui;
}
ui --;
ui--;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDwGetOFDMControlRate: 6M\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDwGetOFDMControlRate: 6M\n");
return (unsigned short)RATE_24M;
}
......@@ -1728,7 +1728,7 @@ unsigned short CARDwGetOFDMControlRate (void *pDeviceHandler, unsigned short wRa
* Return Value: None.
*
*/
void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
void CARDvSetRSPINF(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned char byServ = 0x00, bySignal = 0x00; //For CCK
......@@ -1746,9 +1746,9 @@ void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_1, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_1, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
///RSPINF_b_2
BBvCalculateParameter(pDevice,
14,
......@@ -1757,9 +1757,9 @@ void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_2, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_2, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
//RSPINF_b_5
BBvCalculateParameter(pDevice,
14,
......@@ -1768,9 +1768,9 @@ void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_5, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_5, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
//RSPINF_b_11
BBvCalculateParameter(pDevice,
14,
......@@ -1779,64 +1779,64 @@ void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
&wLen,
&byServ,
&bySignal
);
);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_11, MAKEDWORD(wLen,MAKEWORD(bySignal,byServ)));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_11, MAKEDWORD(wLen, MAKEWORD(bySignal, byServ)));
//RSPINF_a_6
s_vCalculateOFDMRParameter(RATE_6M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_6, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_6, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_9
s_vCalculateOFDMRParameter(RATE_9M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_9, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_9, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_12
s_vCalculateOFDMRParameter(RATE_12M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_12, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_12, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_18
s_vCalculateOFDMRParameter(RATE_18M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_18, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_18, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_24
s_vCalculateOFDMRParameter(RATE_24M,
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_36
s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_36M),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_48
s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_48M),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_54
s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_54M),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate, byRsvTime));
//RSPINF_a_72
s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)pDevice, RATE_54M),
ePHYType,
&byTxRate,
&byRsvTime);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_72, MAKEWORD(byTxRate,byRsvTime));
VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_72, MAKEWORD(byTxRate, byRsvTime));
//Set to Page0
MACvSelectPage0(pDevice->PortOffset);
}
......@@ -1853,20 +1853,20 @@ void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
* Return Value: None.
*
*/
void vUpdateIFS (void *pDeviceHandler)
void vUpdateIFS(void *pDeviceHandler)
{
//Set SIFS, DIFS, EIFS, SlotTime, CwMin
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned char byMaxMin = 0;
if (pDevice->byPacketType==PK_TYPE_11A) {//0000 0000 0000 0000,11a
if (pDevice->byPacketType == PK_TYPE_11A) {//0000 0000 0000 0000,11a
pDevice->uSlot = C_SLOT_SHORT;
pDevice->uSIFS = C_SIFS_A;
pDevice->uDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
pDevice->uCwMin = C_CWMIN_A;
byMaxMin = 4;
}
else if (pDevice->byPacketType==PK_TYPE_11B) {//0000 0001 0000 0000,11b
else if (pDevice->byPacketType == PK_TYPE_11B) {//0000 0001 0000 0000,11b
pDevice->uSlot = C_SLOT_LONG;
pDevice->uSIFS = C_SIFS_BG;
pDevice->uDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
......@@ -1907,23 +1907,23 @@ void vUpdateIFS (void *pDeviceHandler)
VNSvOutPortB(pDevice->PortOffset + MAC_REG_CWMAXMIN0, (unsigned char)byMaxMin);
}
void CARDvUpdateBasicTopRate (void *pDeviceHandler)
void CARDvUpdateBasicTopRate(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned char byTopOFDM = RATE_24M, byTopCCK = RATE_1M;
unsigned char ii;
//Determines the highest basic rate.
for (ii = RATE_54M; ii >= RATE_6M; ii --) {
if ( (pDevice->wBasicRate) & ((unsigned short)(1<<ii)) ) {
for (ii = RATE_54M; ii >= RATE_6M; ii--) {
if ((pDevice->wBasicRate) & ((unsigned short)(1<<ii))) {
byTopOFDM = ii;
break;
}
}
pDevice->byTopOFDMBasicRate = byTopOFDM;
for (ii = RATE_11M;; ii --) {
if ( (pDevice->wBasicRate) & ((unsigned short)(1<<ii)) ) {
for (ii = RATE_11M;; ii--) {
if ((pDevice->wBasicRate) & ((unsigned short)(1<<ii))) {
byTopCCK = ii;
break;
}
......@@ -1947,7 +1947,7 @@ void CARDvUpdateBasicTopRate (void *pDeviceHandler)
* Return Value: true if succeeded; false if failed.
*
*/
bool CARDbAddBasicRate (void *pDeviceHandler, unsigned short wRateIdx)
bool CARDbAddBasicRate(void *pDeviceHandler, unsigned short wRateIdx)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned short wRate = (unsigned short)(1<<wRateIdx);
......@@ -1960,19 +1960,19 @@ bool CARDbAddBasicRate (void *pDeviceHandler, unsigned short wRateIdx)
return(true);
}
bool CARDbIsOFDMinBasicRate (void *pDeviceHandler)
bool CARDbIsOFDMinBasicRate(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
PSDevice pDevice = (PSDevice)pDeviceHandler;
int ii;
for (ii = RATE_54M; ii >= RATE_6M; ii --) {
if ((pDevice->wBasicRate) & ((unsigned short)(1<<ii)))
for (ii = RATE_54M; ii >= RATE_6M; ii--) {
if ((pDevice->wBasicRate) & ((unsigned short)(1 << ii)))
return true;
}
return false;
}
unsigned char CARDbyGetPktType (void *pDeviceHandler)
unsigned char CARDbyGetPktType(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -2000,9 +2000,9 @@ unsigned char CARDbyGetPktType (void *pDeviceHandler)
* Return Value: none
*
*/
void CARDvSetLoopbackMode (unsigned long dwIoBase, unsigned short wLoopbackMode)
void CARDvSetLoopbackMode(unsigned long dwIoBase, unsigned short wLoopbackMode)
{
switch(wLoopbackMode) {
switch (wLoopbackMode) {
case CARD_LB_NONE:
case CARD_LB_MAC:
case CARD_LB_PHY:
......@@ -2029,7 +2029,7 @@ void CARDvSetLoopbackMode (unsigned long dwIoBase, unsigned short wLoopbackMode)
* Return Value: none
*
*/
bool CARDbSoftwareReset (void *pDeviceHandler)
bool CARDbSoftwareReset(void *pDeviceHandler)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
......@@ -2056,10 +2056,10 @@ bool CARDbSoftwareReset (void *pDeviceHandler)
* Return Value: TSF Offset value
*
*/
QWORD CARDqGetTSFOffset (unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2)
QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2)
{
QWORD qwTSFOffset;
unsigned short wRxBcnTSFOffst= 0;
unsigned short wRxBcnTSFOffst = 0;
HIDWORD(qwTSFOffset) = 0;
LODWORD(qwTSFOffset) = 0;
......@@ -2071,7 +2071,7 @@ QWORD CARDqGetTSFOffset (unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2)
LODWORD(qwTSFOffset) = LODWORD(qwTSF1) - LODWORD(qwTSF2);
if (LODWORD(qwTSF1) < LODWORD(qwTSF2)) {
// if borrow needed
HIDWORD(qwTSFOffset) = HIDWORD(qwTSF1) - HIDWORD(qwTSF2) - 1 ;
HIDWORD(qwTSFOffset) = HIDWORD(qwTSF1) - HIDWORD(qwTSF2) - 1;
}
else {
HIDWORD(qwTSFOffset) = HIDWORD(qwTSF1) - HIDWORD(qwTSF2);
......@@ -2093,7 +2093,7 @@ QWORD CARDqGetTSFOffset (unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2)
* Return Value: true if success; otherwise false
*
*/
bool CARDbGetCurrentTSF (unsigned long dwIoBase, PQWORD pqwCurrTSF)
bool CARDbGetCurrentTSF(unsigned long dwIoBase, PQWORD pqwCurrTSF)
{
unsigned short ww;
unsigned char byData;
......@@ -2101,7 +2101,7 @@ bool CARDbGetCurrentTSF (unsigned long dwIoBase, PQWORD pqwCurrTSF)
MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TSFCNTRRD);
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortB(dwIoBase + MAC_REG_TFTCTL, &byData);
if ( !(byData & TFTCTL_TSFCNTRRD))
if (!(byData & TFTCTL_TSFCNTRRD))
break;
}
if (ww == W_MAX_TIMEOUT)
......@@ -2127,7 +2127,7 @@ bool CARDbGetCurrentTSF (unsigned long dwIoBase, PQWORD pqwCurrTSF)
* Return Value: TSF value of next Beacon
*
*/
QWORD CARDqGetNextTBTT (QWORD qwTSF, unsigned short wBeaconInterval)
QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval)
{
unsigned int uLowNextTBTT;
......@@ -2135,7 +2135,7 @@ QWORD CARDqGetNextTBTT (QWORD qwTSF, unsigned short wBeaconInterval)
unsigned int uBeaconInterval;
uBeaconInterval = wBeaconInterval * 1024;
// Next TBTT = ((local_current_TSF / beacon_interval) + 1 ) * beacon_interval
// Next TBTT = ((local_current_TSF / beacon_interval) + 1) * beacon_interval
uLowNextTBTT = (LODWORD(qwTSF) >> 10) << 10;
// low dword (mod) bcn
uLowRemain = (uLowNextTBTT) % uBeaconInterval;
......@@ -2149,7 +2149,7 @@ QWORD CARDqGetNextTBTT (QWORD qwTSF, unsigned short wBeaconInterval)
// check if carry when add one beacon interval
if ((~uLowNextTBTT) < uLowRemain)
HIDWORD(qwTSF) ++ ;
HIDWORD(qwTSF)++;
LODWORD(qwTSF) = uLowNextTBTT + uLowRemain;
......@@ -2171,7 +2171,7 @@ QWORD CARDqGetNextTBTT (QWORD qwTSF, unsigned short wBeaconInterval)
* Return Value: none
*
*/
void CARDvSetFirstNextTBTT (unsigned long dwIoBase, unsigned short wBeaconInterval)
void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterval)
{
QWORD qwNextTBTT;
......@@ -2184,7 +2184,7 @@ void CARDvSetFirstNextTBTT (unsigned long dwIoBase, unsigned short wBeaconInterv
VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT, LODWORD(qwNextTBTT));
VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT + 4, HIDWORD(qwNextTBTT));
MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Card:First Next TBTT[%8xh:%8xh] \n", HIDWORD(qwNextTBTT), LODWORD(qwNextTBTT));
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Card:First Next TBTT[%8xh:%8xh] \n", HIDWORD(qwNextTBTT), LODWORD(qwNextTBTT));
return;
}
......@@ -2204,7 +2204,7 @@ void CARDvSetFirstNextTBTT (unsigned long dwIoBase, unsigned short wBeaconInterv
* Return Value: none
*
*/
void CARDvUpdateNextTBTT (unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval)
void CARDvUpdateNextTBTT(unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval)
{
qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval);
......@@ -2212,7 +2212,7 @@ void CARDvUpdateNextTBTT (unsigned long dwIoBase, QWORD qwTSF, unsigned short wB
VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT, LODWORD(qwTSF));
VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT + 4, HIDWORD(qwTSF));
MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Card:Update Next TBTT[%8xh:%8xh] \n",
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Card:Update Next TBTT[%8xh:%8xh] \n",
(unsigned int) HIDWORD(qwTSF), (unsigned int) LODWORD(qwTSF));
return;
......
......@@ -120,77 +120,77 @@ bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE e
bool
CARDbPowerDown(
void *pDeviceHandler
);
);
bool CARDbSetTxDataRate(
void *pDeviceHandler,
unsigned short wDataRate
);
);
bool CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID);
bool CARDbRemoveKey(void *pDeviceHandler, unsigned char *pbyBSSID);
bool
CARDbAdd_PMKID_Candidate (
CARDbAdd_PMKID_Candidate(
void *pDeviceHandler,
unsigned char *pbyBSSID,
bool bRSNCapExist,
unsigned short wRSNCap
);
);
void *
CARDpGetCurrentAddress (
CARDpGetCurrentAddress(
void *pDeviceHandler
);
);
bool
CARDbStartMeasure (
CARDbStartMeasure(
void *pDeviceHandler,
void *pvMeasureEIDs,
unsigned int uNumOfMeasureEIDs
);
);
bool
CARDbChannelSwitch (
CARDbChannelSwitch(
void *pDeviceHandler,
unsigned char byMode,
unsigned char byNewChannel,
unsigned char byCount
);
);
bool
CARDbSetQuiet (
CARDbSetQuiet(
void *pDeviceHandler,
bool bResetQuiet,
unsigned char byQuietCount,
unsigned char byQuietPeriod,
unsigned short wQuietDuration,
unsigned short wQuietOffset
);
);
bool
CARDbStartQuiet (
CARDbStartQuiet(
void *pDeviceHandler
);
);
void
CARDvSetPowerConstraint (
CARDvSetPowerConstraint(
void *pDeviceHandler,
unsigned char byChannel,
char byPower
);
);
void
CARDvGetPowerCapability (
CARDvGetPowerCapability(
void *pDeviceHandler,
unsigned char *pbyMinPower,
unsigned char *pbyMaxPower
);
);
char
CARDbyGetTransmitPower (
CARDbyGetTransmitPower(
void *pDeviceHandler
);
);
#endif // __CARD_H__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment