Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236206
b: refs/heads/master
c: 7404eab
h: refs/heads/master
v: v3
  • Loading branch information
Philip Worrall authored and Greg Kroah-Hartman committed Mar 2, 2011
1 parent a42f3b9 commit b9fc09f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9cfbe943c05df341930befb272902230c4087fc
refs/heads/master: 7404eab294f3275233ceaa592e029bf41601ab78
76 changes: 38 additions & 38 deletions trunk/drivers/staging/vt6656/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ static int msglevel = MSG_LEVEL_INFO;

/*--------------------- Export Functions --------------------------*/

/*+
/*
*
* Routine Description:
* Enable hw power saving functions
*
* Return Value:
* None.
*
-*/
*/

void PSvEnablePowerSaving(void *hDeviceContext,
WORD wListenInterval)
Expand All @@ -84,33 +84,33 @@ void PSvEnablePowerSaving(void *hDeviceContext,
/* set AID */
MACvWriteWord(pDevice, MAC_REG_AIDATIM, wAID);
} else {
// set ATIM Window
//MACvWriteATIMW(pDevice->PortOffset, pMgmt->wCurrATIMWindow);
/* set ATIM Window */
/* MACvWriteATIMW(pDevice->PortOffset, pMgmt->wCurrATIMWindow); */
}

//Warren:06-18-2004,the sequence must follow PSEN->AUTOSLEEP->GO2DOZE
// enable power saving hw function
/* Warren:06-18-2004,the sequence must follow PSEN->AUTOSLEEP->GO2DOZE */
/* enable power saving hw function */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_PSEN);

// Set AutoSleep
/* Set AutoSleep */
MACvRegBitsOn(pDevice, MAC_REG_PSCFG, PSCFG_AUTOSLEEP);

//Warren:MUST turn on this once before turn on AUTOSLEEP ,or the AUTOSLEEP doesn't work
/* Warren:MUST turn on this once before turn on AUTOSLEEP ,or the AUTOSLEEP doesn't work */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_GO2DOZE);

if (wListenInterval >= 2) {

// clear always listen beacon
/* clear always listen beacon */
MACvRegBitsOff(pDevice, MAC_REG_PSCTL, PSCTL_ALBCN);

// first time set listen next beacon
/* first time set listen next beacon */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_LNBCN);

pMgmt->wCountToWakeUp = wListenInterval;

} else {

// always listen beacon
/* always listen beacon */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_ALBCN);

pMgmt->wCountToWakeUp = 0;
Expand All @@ -123,7 +123,7 @@ void PSvEnablePowerSaving(void *hDeviceContext,
/* bMgrPrepareBeaconToSend((void *) pDevice, pMgmt); */

}
// We don't send null pkt in ad hoc mode since beacon will handle this.
/* We don't send null pkt in ad hoc mode since beacon will handle this. */
else if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) {
PSbSendNullPacket(pDevice);
}
Expand All @@ -133,29 +133,29 @@ void PSvEnablePowerSaving(void *hDeviceContext,
return;
}

/*+
/*
*
* Routine Description:
* Disable hw power saving functions
*
* Return Value:
* None.
*
-*/
*/

void PSvDisablePowerSaving(void *hDeviceContext)
{
PSDevice pDevice = (PSDevice)hDeviceContext;
//PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
/* PSMgmtObject pMgmt = &(pDevice->sMgmtObj); */

// disable power saving hw function
/* disable power saving hw function */
CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_DISABLE_PS, 0,
0, 0, NULL);

//clear AutoSleep
/* clear AutoSleep */
MACvRegBitsOff(pDevice, MAC_REG_PSCFG, PSCFG_AUTOSLEEP);

// set always listen beacon
/* set always listen beacon */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_ALBCN);
pDevice->bEnablePSMode = FALSE;

Expand All @@ -167,15 +167,15 @@ void PSvDisablePowerSaving(void *hDeviceContext)
return;
}

/*+
/*
*
* Routine Description:
* Consider to power down when no more packets to tx or rx.
*
* Return Value:
* TRUE, if power down success
* FALSE, if fail
-*/
*/

BOOL PSbConsiderPowerDown(void *hDeviceContext,
BOOL bCheckRxDMA,
Expand All @@ -185,28 +185,28 @@ BOOL PSbConsiderPowerDown(void *hDeviceContext,
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
BYTE byData;

// check if already in Doze mode
/* check if already in Doze mode */
ControlvReadByte(pDevice, MESSAGE_REQUEST_MACREG,
MAC_REG_PSCTL, &byData);

if ( (byData & PSCTL_PS) != 0 )
return TRUE;

if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) {
// check if in TIM wake period
/* check if in TIM wake period */
if (pMgmt->bInTIMWake)
return FALSE;
}

// check scan state
/* check scan state */
if (pDevice->bCmdRunning)
return FALSE;

//Tx Burst
/* Tx Burst */
if ( pDevice->bPSModeTxBurst )
return FALSE;

// Froce PSEN on
/* Froce PSEN on */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_PSEN);

if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) {
Expand All @@ -218,21 +218,21 @@ BOOL PSbConsiderPowerDown(void *hDeviceContext,

pDevice->bPSRxBeacon = TRUE;

// no Tx, no Rx isr, now go to Doze
/* no Tx, no Rx isr, now go to Doze */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_GO2DOZE);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Go to Doze ZZZZZZZZZZZZZZZ\n");
return TRUE;
}

/*+
/*
*
* Routine Description:
* Send PS-POLL packet
*
* Return Value:
* None.
*
-*/
*/

void PSvSendPSPOLL(void *hDeviceContext)
{
Expand All @@ -256,24 +256,24 @@ void PSvSendPSPOLL(void *hDeviceContext)
pTxPacket->cbMPDULen = WLAN_HDR_ADDR2_LEN;
pTxPacket->cbPayloadLen = 0;

// send the frame
/* send the frame */
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send PS-Poll packet failed..\n");
} else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send PS-Poll packet success..\n");
/* DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send PS-Poll packet success..\n"); */
};
return;
}

/*+
/*
*
* Routine Description:
* Send NULL packet to AP for notification power state of STA
*
* Return Value:
* None.
*
-*/
*/

BOOL PSbSendNullPacket(void *hDeviceContext)
{
Expand Down Expand Up @@ -319,26 +319,26 @@ BOOL PSbSendNullPacket(void *hDeviceContext)
memcpy(pTxPacket->p80211Header->sA3.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
pTxPacket->cbMPDULen = WLAN_HDR_ADDR3_LEN;
pTxPacket->cbPayloadLen = 0;
// send the frame
/* send the frame */
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet failed !\n");
return FALSE;
} else {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet success....\n");
/* DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet success....\n"); */
}

return TRUE ;
}

/*+
/*
*
* Routine Description:
* Check if Next TBTT must wake up
*
* Return Value:
* None.
*
-*/
*/

BOOL PSbIsNextTBTTWakeUp(void *hDeviceContext)
{
Expand All @@ -354,12 +354,12 @@ BOOL PSbIsNextTBTTWakeUp(void *hDeviceContext)
pMgmt->wCountToWakeUp --;

if (pMgmt->wCountToWakeUp == 1) {
// Turn on wake up to listen next beacon
/* Turn on wake up to listen next beacon */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_LNBCN);
pDevice->bPSRxBeacon = FALSE;
bWakeUp = TRUE;
} else if ( !pDevice->bPSRxBeacon ) {
//Listen until RxBeacon
/* Listen until RxBeacon */
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_LNBCN);
}
}
Expand Down

0 comments on commit b9fc09f

Please sign in to comment.