Commit 89cf9be6 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6655: mac80211 conversion: s_uFillDataHead add power saving poll

Replace variable wCurrentRate with is_pspoll.

add current_aid to structure vnt_private which is to be used by
mac80211 operations.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c0496d1
...@@ -324,6 +324,7 @@ struct vnt_private { ...@@ -324,6 +324,7 @@ struct vnt_private {
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct ieee80211_vif *vif; struct ieee80211_vif *vif;
unsigned long key_entry_inuse; unsigned long key_entry_inuse;
u16 current_aid;
/* netdev */ /* netdev */
struct net_device *dev; struct net_device *dev;
......
...@@ -169,7 +169,8 @@ s_uFillDataHead( ...@@ -169,7 +169,8 @@ s_uFillDataHead(
unsigned int cbLastFragmentSize, unsigned int cbLastFragmentSize,
unsigned int uMACfragNum, unsigned int uMACfragNum,
unsigned char byFBOption, unsigned char byFBOption,
unsigned short wCurrentRate unsigned short wCurrentRate,
bool is_pspoll
); );
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
...@@ -674,7 +675,8 @@ s_uFillDataHead( ...@@ -674,7 +675,8 @@ s_uFillDataHead(
unsigned int cbLastFragmentSize, unsigned int cbLastFragmentSize,
unsigned int uMACfragNum, unsigned int uMACfragNum,
unsigned char byFBOption, unsigned char byFBOption,
unsigned short wCurrentRate unsigned short wCurrentRate,
bool is_pspoll
) )
{ {
...@@ -693,15 +695,24 @@ s_uFillDataHead( ...@@ -693,15 +695,24 @@ s_uFillDataHead(
pDevice->byTopCCKBasicRate, pDevice->byTopCCKBasicRate,
PK_TYPE_11B, &buf->b); PK_TYPE_11B, &buf->b);
/* Get Duration and TimeStamp */ if (is_pspoll) {
buf->duration_a = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, __le16 dur = cpu_to_le16(pDevice->current_aid | BIT(14) | BIT(15));
byPktType, wCurrentRate, bNeedAck, uFragIdx,
cbLastFragmentSize, uMACfragNum, buf->duration_a = dur;
byFBOption)); buf->duration_b = dur;
buf->duration_b = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, } else {
PK_TYPE_11B, pDevice->byTopCCKBasicRate, /* Get Duration and TimeStamp */
bNeedAck, uFragIdx, cbLastFragmentSize, buf->duration_a =
uMACfragNum, byFBOption)); cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength,
byPktType, wCurrentRate, bNeedAck, uFragIdx,
cbLastFragmentSize, uMACfragNum,
byFBOption));
buf->duration_b =
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength,
PK_TYPE_11B, pDevice->byTopCCKBasicRate,
bNeedAck, uFragIdx, cbLastFragmentSize,
uMACfragNum, byFBOption));
}
buf->time_stamp_off_a = vnt_time_stamp_off(pDevice, wCurrentRate); buf->time_stamp_off_a = vnt_time_stamp_off(pDevice, wCurrentRate);
buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate); buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate);
...@@ -755,11 +766,18 @@ s_uFillDataHead( ...@@ -755,11 +766,18 @@ s_uFillDataHead(
vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate, vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
byPktType, &buf->ab); byPktType, &buf->ab);
/* Get Duration and TimeStampOff */ if (is_pspoll) {
buf->duration = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, __le16 dur = cpu_to_le16(pDevice->current_aid | BIT(14) | BIT(15));
buf->duration = dur;
} else {
/* Get Duration and TimeStampOff */
buf->duration =
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, uFragIdx, wCurrentRate, bNeedAck, uFragIdx,
cbLastFragmentSize, uMACfragNum, cbLastFragmentSize, uMACfragNum,
byFBOption)); byFBOption));
}
buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate); buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
return buf->duration; return buf->duration;
...@@ -769,17 +787,27 @@ s_uFillDataHead( ...@@ -769,17 +787,27 @@ s_uFillDataHead(
/* Get SignalField, ServiceField & Length */ /* Get SignalField, ServiceField & Length */
vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate, vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
byPktType, &buf->ab); byPktType, &buf->ab);
/* Get Duration and TimeStampOff */
buf->duration = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, byPktType, if (is_pspoll) {
__le16 dur = cpu_to_le16(pDevice->current_aid | BIT(14) | BIT(15));
buf->duration = dur;
} else {
/* Get Duration and TimeStampOff */
buf->duration =
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, uFragIdx, wCurrentRate, bNeedAck, uFragIdx,
cbLastFragmentSize, uMACfragNum, cbLastFragmentSize, uMACfragNum,
byFBOption)); byFBOption));
}
buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate); buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
return buf->duration; return buf->duration;
} }
return 0; return 0;
} }
static static
void void
s_vFillRTSHead( s_vFillRTSHead(
...@@ -1346,7 +1374,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, ...@@ -1346,7 +1374,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
cbFrameSize, bNeedACK, uDMAIdx, hdr, pDevice->wCurrentRate); cbFrameSize, bNeedACK, uDMAIdx, hdr, pDevice->wCurrentRate);
/* Fill DataHead */ /* Fill DataHead */
uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK, uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK,
0, 0, uMACfragNum, byFBOption, pDevice->wCurrentRate); 0, 0, uMACfragNum, byFBOption, pDevice->wCurrentRate, is_pspoll);
hdr->duration_id = uDuration; hdr->duration_id = uDuration;
...@@ -1750,7 +1778,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket) ...@@ -1750,7 +1778,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
//Fill DataHead //Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK, uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK,
0, 0, 1, AUTO_FB_NONE, wCurrentRate); 0, 0, 1, AUTO_FB_NONE, wCurrentRate, false);
pMACHeader = (PS802_11Header) (pbyTxBufferAddr + cbHeaderSize); pMACHeader = (PS802_11Header) (pbyTxBufferAddr + cbHeaderSize);
...@@ -2245,7 +2273,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb, ...@@ -2245,7 +2273,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb,
//Fill DataHead //Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK, uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK,
0, 0, 1, AUTO_FB_NONE, wCurrentRate); 0, 0, 1, AUTO_FB_NONE, wCurrentRate, false);
pMACHeader = (PS802_11Header) (pbyTxBufferAddr + cbHeaderSize); pMACHeader = (PS802_11Header) (pbyTxBufferAddr + cbHeaderSize);
......
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