aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/power.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2014-06-24 18:46:07 +1000
committerJames Morris <james.l.morris@oracle.com>2014-06-24 18:46:07 +1000
commitf01387d2693813eb5271a3448e6a082322c7d75d (patch)
treeb591ca73c85276bae53d7db57ff1565be45a29da /drivers/staging/vt6656/power.c
parentMerge branch 'next' of git://git.infradead.org/users/pcmoore/selinux into next (diff)
parentLinux 3.15 (diff)
downloadlinux-dev-f01387d2693813eb5271a3448e6a082322c7d75d.tar.xz
linux-dev-f01387d2693813eb5271a3448e6a082322c7d75d.zip
Merge commit 'v3.15' into next
Diffstat (limited to 'drivers/staging/vt6656/power.c')
-rw-r--r--drivers/staging/vt6656/power.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index e7d5487d1041..43da58927cd2 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -67,22 +67,23 @@ void PSvEnablePowerSaving(struct vnt_private *pDevice, u16 wListenInterval)
/* set period of power up before TBTT */
MACvWriteWord(pDevice, MAC_REG_PWBT, C_PWBT);
- if (pDevice->eOPMode != OP_MODE_ADHOC) {
+ if (pDevice->op_mode != NL80211_IFTYPE_ADHOC) {
/* set AID */
MACvWriteWord(pDevice, MAC_REG_AIDATIM, wAID);
- } else {
- /* set ATIM Window */
- /* MACvWriteATIMW(pDevice->PortOffset, pMgmt->wCurrATIMWindow); */
}
- /* Warren:06-18-2004,the sequence must follow PSEN->AUTOSLEEP->GO2DOZE */
+ /* 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 */
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) {
@@ -105,8 +106,10 @@ void PSvEnablePowerSaving(struct vnt_private *pDevice, u16 wListenInterval)
pDevice->bEnablePSMode = true;
- /* We don't send null pkt in ad hoc mode since beacon will handle this. */
- if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)
+ /* We don't send null pkt in ad hoc mode
+ * since beacon will handle this.
+ */
+ if (pDevice->op_mode == NL80211_IFTYPE_STATION)
PSbSendNullPacket(pDevice);
pDevice->bPWBitOn = true;
@@ -137,7 +140,7 @@ void PSvDisablePowerSaving(struct vnt_private *pDevice)
MACvRegBitsOn(pDevice, MAC_REG_PSCTL, PSCTL_ALBCN);
pDevice->bEnablePSMode = false;
- if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)
+ if (pDevice->op_mode == NL80211_IFTYPE_STATION)
PSbSendNullPacket(pDevice);
pDevice->bPWBitOn = false;
@@ -226,15 +229,19 @@ void PSvSendPSPOLL(struct vnt_private *pDevice)
WLAN_SET_FC_PWRMGT(0)
));
- pTxPacket->p80211Header->sA2.wDurationID = pMgmt->wCurrAID | BIT14 | BIT15;
- memcpy(pTxPacket->p80211Header->sA2.abyAddr1, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN);
- memcpy(pTxPacket->p80211Header->sA2.abyAddr2, pMgmt->abyMACAddr, WLAN_ADDR_LEN);
+ pTxPacket->p80211Header->sA2.wDurationID =
+ pMgmt->wCurrAID | BIT14 | BIT15;
+ memcpy(pTxPacket->p80211Header->sA2.abyAddr1, pMgmt->abyCurrBSSID,
+ WLAN_ADDR_LEN);
+ memcpy(pTxPacket->p80211Header->sA2.abyAddr2, pMgmt->abyMACAddr,
+ WLAN_ADDR_LEN);
pTxPacket->cbMPDULen = WLAN_HDR_ADDR2_LEN;
pTxPacket->cbPayloadLen = 0;
/* log failure if sending failed */
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING)
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send PS-Poll packet failed..\n");
+ DBG_PRT(MSG_LEVEL_DEBUG,
+ KERN_INFO "Send PS-Poll packet failed..\n");
}
/*
@@ -276,16 +283,21 @@ int PSbSendNullPacket(struct vnt_private *pDevice)
pTxPacket->p80211Header->sA3.wFrameCtl = cpu_to_le16(flags);
if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA)
- pTxPacket->p80211Header->sA3.wFrameCtl |= cpu_to_le16((u16)WLAN_SET_FC_TODS(1));
-
- memcpy(pTxPacket->p80211Header->sA3.abyAddr1, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN);
- memcpy(pTxPacket->p80211Header->sA3.abyAddr2, pMgmt->abyMACAddr, WLAN_ADDR_LEN);
- memcpy(pTxPacket->p80211Header->sA3.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
+ pTxPacket->p80211Header->sA3.wFrameCtl |=
+ cpu_to_le16((u16)WLAN_SET_FC_TODS(1));
+
+ memcpy(pTxPacket->p80211Header->sA3.abyAddr1, pMgmt->abyCurrBSSID,
+ WLAN_ADDR_LEN);
+ memcpy(pTxPacket->p80211Header->sA3.abyAddr2, pMgmt->abyMACAddr,
+ WLAN_ADDR_LEN);
+ memcpy(pTxPacket->p80211Header->sA3.abyAddr3, pMgmt->abyCurrBSSID,
+ WLAN_BSSID_LEN);
pTxPacket->cbMPDULen = WLAN_HDR_ADDR3_LEN;
pTxPacket->cbPayloadLen = 0;
/* log error if sending failed */
if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet failed !\n");
+ DBG_PRT(MSG_LEVEL_DEBUG,
+ KERN_INFO "Send Null Packet failed !\n");
return false;
}
return true;