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

staging: vt6656: rxtx.c s_vGenerateTxParameter create argument bool need rts

Allow conditional statements to be based on true/false instead of
NULL or not pointer pvRTS.

Harmonise all call functions will bool type.

If need_rts is true then rts is needed.

If need_rts is false then
	cts is needed only when byPktType == PK_TYPE_11GB || PK_TYPE_11GA.
	none no rts/cts other byPktTypes.

This allow the joining of pointers pvRTS/pvCTS in to single pointer.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 27df3ebf
...@@ -101,7 +101,7 @@ static void *s_vGetFreeContext(struct vnt_private *pDevice); ...@@ -101,7 +101,7 @@ static void *s_vGetFreeContext(struct vnt_private *pDevice);
static void s_vGenerateTxParameter(struct vnt_private *pDevice, static void s_vGenerateTxParameter(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxBufHead, void *pvRrvTime, u8 byPktType, u16 wCurrentRate, void *pTxBufHead, void *pvRrvTime,
void *pvRTS, void *pvCTS, u32 cbFrameSize, int bNeedACK, u32 uDMAIdx, void *pvRTS, void *pvCTS, u32 cbFrameSize, int bNeedACK, u32 uDMAIdx,
struct ethhdr *psEthHeader); struct ethhdr *psEthHeader, bool need_rts);
static u32 s_uFillDataHead(struct vnt_private *pDevice, static u32 s_uFillDataHead(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength, u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength,
...@@ -829,7 +829,7 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx, ...@@ -829,7 +829,7 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
static void s_vGenerateTxParameter(struct vnt_private *pDevice, static void s_vGenerateTxParameter(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxBufHead, void *pvRrvTime, u8 byPktType, u16 wCurrentRate, void *pTxBufHead, void *pvRrvTime,
void *pvRTS, void *pvCTS, u32 cbFrameSize, int bNeedACK, u32 uDMAIdx, void *pvRTS, void *pvCTS, u32 cbFrameSize, int bNeedACK, u32 uDMAIdx,
struct ethhdr *psEthHeader) struct ethhdr *psEthHeader, bool need_rts)
{ {
u32 cbMACHdLen = WLAN_HDR_ADDR3_LEN; /* 24 */ u32 cbMACHdLen = WLAN_HDR_ADDR3_LEN; /* 24 */
u16 wFifoCtl; u16 wFifoCtl;
...@@ -854,8 +854,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -854,8 +854,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6; cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6;
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) { if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
if (need_rts) {
if (pvRTS != NULL) { //RTS_need
//Fill RsvTime //Fill RsvTime
struct vnt_rrv_time_rts *pBuf = struct vnt_rrv_time_rts *pBuf =
(struct vnt_rrv_time_rts *)pvRrvTime; (struct vnt_rrv_time_rts *)pvRrvTime;
...@@ -891,8 +890,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -891,8 +890,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
} }
} }
else if (byPktType == PK_TYPE_11A) { else if (byPktType == PK_TYPE_11A) {
if (need_rts) {
if (pvRTS != NULL) {//RTS_need, non PCF mode
//Fill RsvTime //Fill RsvTime
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
...@@ -903,8 +901,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -903,8 +901,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
//Fill RTS //Fill RTS
s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK,
psEthHeader, wCurrentRate, byFBOption); psEthHeader, wCurrentRate, byFBOption);
} } else {
else if (pvRTS == NULL) {//RTS_needless, non PCF mode
//Fill RsvTime //Fill RsvTime
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
...@@ -913,8 +910,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -913,8 +910,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
} }
} }
else if (byPktType == PK_TYPE_11B) { else if (byPktType == PK_TYPE_11B) {
if (need_rts) {
if ((pvRTS != NULL)) {//RTS_need, non PCF mode
//Fill RsvTime //Fill RsvTime
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
...@@ -953,7 +949,8 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -953,7 +949,8 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
u32 cb802_1_H_len; u32 cb802_1_H_len;
u32 cbIVlen = 0, cbICVlen = 0, cbMIClen = 0, cbMACHdLen = 0; u32 cbIVlen = 0, cbICVlen = 0, cbMIClen = 0, cbMACHdLen = 0;
u32 cbFCSlen = 4, cbMICHDR = 0; u32 cbFCSlen = 4, cbMICHDR = 0;
int bNeedACK, bRTS; int bNeedACK;
bool bRTS = false;
u8 *pbyType, *pbyMacHdr, *pbyIVHead, *pbyPayloadHead, *pbyTxBufferAddr; u8 *pbyType, *pbyMacHdr, *pbyIVHead, *pbyPayloadHead, *pbyTxBufferAddr;
u8 abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00}; u8 abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
u8 abySNAP_Bridgetunnel[ETH_ALEN] u8 abySNAP_Bridgetunnel[ETH_ALEN]
...@@ -1236,7 +1233,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1236,7 +1233,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
//Fill FIFO,RrvTime,RTS,and CTS //Fill FIFO,RrvTime,RTS,and CTS
s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate,
(void *)pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS, (void *)pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS,
cbFrameSize, bNeedACK, uDMAIdx, psEthHeader); cbFrameSize, bNeedACK, uDMAIdx, psEthHeader, bRTS);
//Fill DataHead //Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK, uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK,
byFBOption); byFBOption);
...@@ -1640,7 +1637,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1640,7 +1637,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
//Fill FIFO,RrvTime,RTS,and CTS //Fill FIFO,RrvTime,RTS,and CTS
s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pCTS, s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pCTS,
cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader); cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader, false);
//Fill DataHead //Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK, uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK,
...@@ -2051,7 +2048,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -2051,7 +2048,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
//Fill FIFO,RrvTime,RTS,and CTS //Fill FIFO,RrvTime,RTS,and CTS
s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS, s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS,
cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader); cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader, false);
//Fill DataHead //Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK, uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK,
......
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