All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org, forest@alittletooquiet.net,
	Malcolm Priestley <tvboxspy@gmail.com>
Subject: [PATCH v2 07/34] staging: vt6655: mac80211 conversion: s_uFillDataHead add power saving poll
Date: Wed, 29 Oct 2014 17:43:42 +0000	[thread overview]
Message-ID: <1414604649-9105-8-git-send-email-tvboxspy@gmail.com> (raw)
In-Reply-To: <1414604649-9105-1-git-send-email-tvboxspy@gmail.com>

Replace variable wCurrentRate with is_pspoll.

add current_aid to structure vnt_private which is to be used by
mac80211 operations.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6655/device.h |  1 +
 drivers/staging/vt6655/rxtx.c   | 64 +++++++++++++++++++++++++++++------------
 2 files changed, 47 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index bc9b81a..7d521c6 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -324,6 +324,7 @@ struct vnt_private {
 	struct ieee80211_hw *hw;
 	struct ieee80211_vif *vif;
 	unsigned long key_entry_inuse;
+	u16 current_aid;
 /* netdev */
 	struct net_device *dev;
 
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index a1a594f..23ee379 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -169,7 +169,8 @@ s_uFillDataHead(
 	unsigned int cbLastFragmentSize,
 	unsigned int uMACfragNum,
 	unsigned char byFBOption,
-	unsigned short wCurrentRate
+	unsigned short wCurrentRate,
+	bool is_pspoll
 );
 
 /*---------------------  Export Variables  --------------------------*/
@@ -674,7 +675,8 @@ s_uFillDataHead(
 	unsigned int cbLastFragmentSize,
 	unsigned int uMACfragNum,
 	unsigned char byFBOption,
-	unsigned short wCurrentRate
+	unsigned short wCurrentRate,
+	bool is_pspoll
 )
 {
 
@@ -693,15 +695,24 @@ s_uFillDataHead(
 					  pDevice->byTopCCKBasicRate,
 					  PK_TYPE_11B, &buf->b);
 
-			/* Get Duration and TimeStamp */
-			buf->duration_a = 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));
+			if (is_pspoll) {
+				__le16 dur = cpu_to_le16(pDevice->current_aid | BIT(14) | BIT(15));
+
+				buf->duration_a = dur;
+				buf->duration_b = dur;
+			} else {
+				/* Get Duration and TimeStamp */
+				buf->duration_a =
+					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_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate);
@@ -755,11 +766,18 @@ s_uFillDataHead(
 			vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
 					  byPktType, &buf->ab);
 
-			/* Get Duration and TimeStampOff */
-			buf->duration = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, 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_A, cbFrameLength, byPktType,
 									    wCurrentRate, bNeedAck, uFragIdx,
 									    cbLastFragmentSize, uMACfragNum,
 									    byFBOption));
+			}
 
 			buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
 			return buf->duration;
@@ -769,17 +787,27 @@ s_uFillDataHead(
 		/* Get SignalField, ServiceField & Length */
 		vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
 				  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,
 								    cbLastFragmentSize, uMACfragNum,
 								    byFBOption));
+		}
+
 		buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
 		return buf->duration;
 	}
 	return 0;
 }
 
+
 static
 void
 s_vFillRTSHead(
@@ -1346,7 +1374,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
 			       cbFrameSize, bNeedACK, uDMAIdx, hdr, pDevice->wCurrentRate);
 	/* Fill DataHead */
 	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;
 
@@ -1750,7 +1778,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
 
 	//Fill DataHead
 	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);
 
@@ -2245,7 +2273,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb,
 
 	//Fill DataHead
 	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);
 
-- 
2.1.0


  parent reply	other threads:[~2014-10-29 17:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 17:43 [PATCH v2 00/34] staging: vt6655: Conversion to mac80211 Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 01/34] staging: vt6655: mac80211 conversion: add new rx functions Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 02/34] staging: vt6655: mac80211 conversion: add new key functions Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 03/34] staging: vt6655: mac8021 conversion: add new tx functions Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 04/34] staging: vt6655: mac80211 conversion: s_cbFillTxBufHead Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 05/34] staging: vt6655: dead code remove s_vFillFragParameter Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 06/34] staging: vt6655: mac80211 conversion: s_vFillRTSHead convert to using struct ieee80211_hdr Malcolm Priestley
2014-10-29 17:43 ` Malcolm Priestley [this message]
2014-10-29 17:43 ` [PATCH v2 08/34] staging: vt6655: mac80211 conversion add main mac80211 functions Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 09/34] staging: vt6655: mac80211 conversion add channel bands Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 10/34] staging: vt6655: mac80211 conversion replace suspend resume functions Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 11/34] staging: vt6655: mac80211 conversion: device_print_info remove netdevice Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 12/34] staging: vt6655: mac80211 conversion: changes to device_intr Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 13/34] staging: vt6655: mac80211 conversion: device_tx_srv tx and add report rates Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 14/34] staging: vt6655: mac80211 conversion: changes to set channel Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 15/34] staging: vt6655: mac80211 conversion: enable power saving Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 16/34] staging: vt6655: mac80211 conversion: changes to CARDbSetPhyParameter Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 17/34] staging: vt6655: mac80211 conversion: card.c use basic_rates Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 18/34] staging: vt6655: CARDbSetPhyParameter replace s_vSetRSPINF with CARDvSetRSPINF Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 19/34] staging: vt6655: mac80211 conversion: device_init_registers remove legacy code Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 20/34] staging: vt6655: mac80211 conversion: device_free_info Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 21/34] staging: vt6655: switch driver over to mac80211 Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 22/34] staging: vt6655: phy type same as bb type Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 23/34] staging: vt6655: mac80211 conversion: device_error remove legacy functions Malcolm Priestley
2014-10-29 17:43 ` [PATCH v2 24/34] staging: vt6655: vt6655_probe remove management pointers Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 25/34] staging: vt6655: mac80211 conversion: PSbIsNextTBTTWakeUp convert to mac80211 Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 26/34] staging: vt6655: MACvSetDefaultKeyEntry replace WLAN_WEP104_KEYLEN Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 27/34] staging: vt6655: baseband.c replace BIT0 with BIT(0) Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 28/34] staging: vt6655: s_vGenerateTxParameter remove unused cbMACHdLen Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 29/34] staging: vt6655: device_init_registers replace spin lock Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 30/34] staging: vt6655: baseband.c timers " Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 31/34] staging: vt6655: fifo & frag control remove big endian values Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 32/34] staging: vt6655: vnt_rx_data: uCurrRSSI should have the value of *rssi Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 33/34] staging: vt6655: don't update bUpdateBBVGA when off channel Malcolm Priestley
2014-10-29 17:44 ` [PATCH v2 34/34] staging: vt6655: reset tsf on dissociation Malcolm Priestley
2014-10-29 20:32 ` [PATCH v2 00/34] staging: vt6655: Conversion to mac80211 Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414604649-9105-8-git-send-email-tvboxspy@gmail.com \
    --to=tvboxspy@gmail.com \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.