Commit ff8041bb authored by Daniel Kenji Toyama's avatar Daniel Kenji Toyama Committed by Greg Kroah-Hartman

Staging: vt6656: int.c: Fixed Coding Style issues

Fixed almost all the issues given by checkpatch.pl except for one
warning about an 81 character line, which cannot really be decomposed
(the code is a bit too nested there).
Signed-off-by: default avatarDaniel Kenji Toyama <kenji.toyama@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6dde1c6c
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
#include "usbpipe.h" #include "usbpipe.h"
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
//static int msglevel =MSG_LEVEL_DEBUG; /* static int msglevel = MSG_LEVEL_DEBUG; */
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
...@@ -74,120 +74,152 @@ static int msglevel =MSG_LEVEL_INFO; ...@@ -74,120 +74,152 @@ static int msglevel =MSG_LEVEL_INFO;
* *
* Notes: * Notes:
* *
* USB reads are by nature 'Blocking', and when in a read, the device looks like it's * USB reads are by nature 'Blocking', and when in a read, the device looks
* in a 'stall' condition, so we deliberately time out every second if we've gotten no data * like it's in a 'stall' condition, so we deliberately time out every second
* if we've gotten no data
* *
-*/ -*/
VOID VOID
INTvWorkItem( INTvWorkItem(PVOID Context)
PVOID Context
)
{ {
PSDevice pDevice = (PSDevice) Context; PSDevice pDevice = (PSDevice) Context;
NTSTATUS ntStatus; NTSTATUS ntStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n");
spin_lock_irq(&pDevice->lock);
if (pDevice->fKillEventPollingThread != TRUE) {
ntStatus = PIPEnsInterruptRead(pDevice);
}
spin_unlock_irq(&pDevice->lock);
}
spin_lock_irq(&pDevice->lock);
if (pDevice->fKillEventPollingThread != TRUE)
ntStatus = PIPEnsInterruptRead(pDevice);
spin_unlock_irq(&pDevice->lock);
}
NTSTATUS NTSTATUS
INTnsProcessData( INTnsProcessData(IN PSDevice pDevice)
IN PSDevice pDevice
)
{ {
NTSTATUS status = STATUS_SUCCESS; NTSTATUS status = STATUS_SUCCESS;
PSINTData pINTData; PSINTData pINTData;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct net_device_stats* pStats = &pDevice->stats; struct net_device_stats *pStats = &pDevice->stats;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n");
pINTData = (PSINTData) pDevice->intBuf.pDataBuf;
pINTData = (PSINTData) pDevice->intBuf.pDataBuf; if (pINTData->byTSR0 & TSR_VALID) {
if (pINTData->byTSR0 & TSR_VALID) { STAvUpdateTDStatCounter(&(pDevice->scStatistic),
STAvUpdateTDStatCounter (&(pDevice->scStatistic), (BYTE) (pINTData->byPkt0 & 0x0F), (BYTE) (pINTData->byPkt0>>4), pINTData->byTSR0); (BYTE) (pINTData->byPkt0 & 0x0F),
BSSvUpdateNodeTxCounter (pDevice, &(pDevice->scStatistic), pINTData->byTSR0, pINTData->byPkt0); (BYTE) (pINTData->byPkt0>>4),
//DBG_PRN_GRP01(("TSR0 %02x\n", pINTData->byTSR0)); pINTData->byTSR0);
} BSSvUpdateNodeTxCounter(pDevice,
if (pINTData->byTSR1 & TSR_VALID) { &(pDevice->scStatistic),
STAvUpdateTDStatCounter (&(pDevice->scStatistic), (BYTE) (pINTData->byPkt1 & 0x0F), (BYTE) (pINTData->byPkt1>>4), pINTData->byTSR1); pINTData->byTSR0,
BSSvUpdateNodeTxCounter (pDevice, &(pDevice->scStatistic), pINTData->byTSR1, pINTData->byPkt1); pINTData->byPkt0);
//DBG_PRN_GRP01(("TSR1 %02x\n", pINTData->byTSR1)); /*DBG_PRN_GRP01(("TSR0 %02x\n", pINTData->byTSR0));*/
} }
if (pINTData->byTSR2 & TSR_VALID) { if (pINTData->byTSR1 & TSR_VALID) {
STAvUpdateTDStatCounter (&(pDevice->scStatistic), (BYTE) (pINTData->byPkt2 & 0x0F), (BYTE) (pINTData->byPkt2>>4), pINTData->byTSR2); STAvUpdateTDStatCounter(&(pDevice->scStatistic),
BSSvUpdateNodeTxCounter (pDevice, &(pDevice->scStatistic), pINTData->byTSR2, pINTData->byPkt2); (BYTE) (pINTData->byPkt1 & 0x0F),
//DBG_PRN_GRP01(("TSR2 %02x\n", pINTData->byTSR2)); (BYTE) (pINTData->byPkt1>>4),
} pINTData->byTSR1);
if (pINTData->byTSR3 & TSR_VALID) { BSSvUpdateNodeTxCounter(pDevice,
STAvUpdateTDStatCounter (&(pDevice->scStatistic), (BYTE) (pINTData->byPkt3 & 0x0F), (BYTE) (pINTData->byPkt3>>4), pINTData->byTSR3); &(pDevice->scStatistic),
BSSvUpdateNodeTxCounter (pDevice, &(pDevice->scStatistic), pINTData->byTSR3, pINTData->byPkt3); pINTData->byTSR1,
//DBG_PRN_GRP01(("TSR3 %02x\n", pINTData->byTSR3)); pINTData->byPkt1);
} /*DBG_PRN_GRP01(("TSR1 %02x\n", pINTData->byTSR1));*/
if ( pINTData->byISR0 != 0 ) { }
if (pINTData->byISR0 & ISR_BNTX) { if (pINTData->byTSR2 & TSR_VALID) {
STAvUpdateTDStatCounter(&(pDevice->scStatistic),
if (pDevice->eOPMode == OP_MODE_AP) { (BYTE) (pINTData->byPkt2 & 0x0F),
if(pMgmt->byDTIMCount > 0) { (BYTE) (pINTData->byPkt2>>4),
pMgmt->byDTIMCount --; pINTData->byTSR2);
pMgmt->sNodeDBTable[0].bRxPSPoll = FALSE; BSSvUpdateNodeTxCounter(pDevice,
} else if(pMgmt->byDTIMCount == 0) { &(pDevice->scStatistic),
// check if mutltcast tx bufferring pINTData->byTSR2,
pMgmt->byDTIMCount = pMgmt->byDTIMPeriod - 1; pINTData->byPkt2);
pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE; /*DBG_PRN_GRP01(("TSR2 %02x\n", pINTData->byTSR2));*/
if (pMgmt->sNodeDBTable[0].bPSEnable) { }
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_RX_PSPOLL, NULL); if (pINTData->byTSR3 & TSR_VALID) {
} STAvUpdateTDStatCounter(&(pDevice->scStatistic),
} (BYTE) (pINTData->byPkt3 & 0x0F),
bScheduleCommand((HANDLE)pDevice, WLAN_CMD_BECON_SEND, NULL); (BYTE) (pINTData->byPkt3>>4),
} // if (pDevice->eOPMode == OP_MODE_AP) pINTData->byTSR3);
BSSvUpdateNodeTxCounter(pDevice,
pDevice->bBeaconSent = TRUE; &(pDevice->scStatistic),
} else { pINTData->byTSR3,
pDevice->bBeaconSent = FALSE; pINTData->byPkt3);
} /*DBG_PRN_GRP01(("TSR3 %02x\n", pINTData->byTSR3));*/
if (pINTData->byISR0 & ISR_TBTT) { }
if ( pDevice->bEnablePSMode ) { if (pINTData->byISR0 != 0) {
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_TBTT_WAKEUP, NULL); if (pINTData->byISR0 & ISR_BNTX) {
} if (pDevice->eOPMode == OP_MODE_AP) {
if ( pDevice->bChannelSwitch ) { if (pMgmt->byDTIMCount > 0) {
pDevice->byChannelSwitchCount--; pMgmt->byDTIMCount--;
if ( pDevice->byChannelSwitchCount == 0 ) { pMgmt->sNodeDBTable[0].bRxPSPoll =
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_11H_CHSW, NULL); FALSE;
} } else if (pMgmt->byDTIMCount == 0) {
} /* check if mutltcast tx bufferring */
} pMgmt->byDTIMCount =
LODWORD(pDevice->qwCurrTSF) = pINTData->dwLoTSF; pMgmt->byDTIMPeriod-1;
HIDWORD(pDevice->qwCurrTSF) = pINTData->dwHiTSF; pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE;
//DBG_PRN_GRP01(("ISR0 = %02x ,LoTsf = %08x,HiTsf = %08x\n", pINTData->byISR0, pINTData->dwLoTSF,pINTData->dwHiTSF)); if (pMgmt->sNodeDBTable[0].bPSEnable)
bScheduleCommand((HANDLE)pDevice,
STAvUpdate802_11Counter(&pDevice->s802_11Counter, &pDevice->scStatistic, pINTData->byRTSSuccess, WLAN_CMD_RX_PSPOLL,
pINTData->byRTSFail, pINTData->byACKFail, pINTData->byFCSErr ); NULL);
STAvUpdateIsrStatCounter(&pDevice->scStatistic, pINTData->byISR0, pINTData->byISR1); }
bScheduleCommand((HANDLE)pDevice,
} WLAN_CMD_BECON_SEND,
NULL);
if ( pINTData->byISR1 != 0 ) { } /* if (pDevice->eOPMode == OP_MODE_AP) */
if (pINTData->byISR1 & ISR_GPIO3) { pDevice->bBeaconSent = TRUE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_RADIO, NULL); } else {
} pDevice->bBeaconSent = FALSE;
} }
pDevice->intBuf.uDataLen = 0; if (pINTData->byISR0 & ISR_TBTT) {
pDevice->intBuf.bInUse = FALSE; if (pDevice->bEnablePSMode)
bScheduleCommand((HANDLE) pDevice,
pStats->tx_packets = pDevice->scStatistic.ullTsrOK; WLAN_CMD_TBTT_WAKEUP,
pStats->tx_bytes = pDevice->scStatistic.ullTxDirectedBytes + NULL);
pDevice->scStatistic.ullTxMulticastBytes + if (pDevice->bChannelSwitch) {
pDevice->scStatistic.ullTxBroadcastBytes; pDevice->byChannelSwitchCount--;
pStats->tx_errors = pDevice->scStatistic.dwTsrErr; if (pDevice->byChannelSwitchCount == 0)
pStats->tx_dropped = pDevice->scStatistic.dwTsrErr; bScheduleCommand((HANDLE) pDevice,
WLAN_CMD_11H_CHSW,
return status; NULL);
}
}
LODWORD(pDevice->qwCurrTSF) = pINTData->dwLoTSF;
HIDWORD(pDevice->qwCurrTSF) = pINTData->dwHiTSF;
/*DBG_PRN_GRP01(("ISR0 = %02x ,
LoTsf = %08x,
HiTsf = %08x\n",
pINTData->byISR0,
pINTData->dwLoTSF,
pINTData->dwHiTSF)); */
STAvUpdate802_11Counter(&pDevice->s802_11Counter,
&pDevice->scStatistic,
pINTData->byRTSSuccess,
pINTData->byRTSFail,
pINTData->byACKFail,
pINTData->byFCSErr);
STAvUpdateIsrStatCounter(&pDevice->scStatistic,
pINTData->byISR0,
pINTData->byISR1);
}
if (pINTData->byISR1 != 0)
if (pINTData->byISR1 & ISR_GPIO3)
bScheduleCommand((HANDLE) pDevice,
WLAN_CMD_RADIO,
NULL);
pDevice->intBuf.uDataLen = 0;
pDevice->intBuf.bInUse = FALSE;
pStats->tx_packets = pDevice->scStatistic.ullTsrOK;
pStats->tx_bytes = pDevice->scStatistic.ullTxDirectedBytes +
pDevice->scStatistic.ullTxMulticastBytes +
pDevice->scStatistic.ullTxBroadcastBytes;
pStats->tx_errors = pDevice->scStatistic.dwTsrErr;
pStats->tx_dropped = pDevice->scStatistic.dwTsrErr;
return status;
} }
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