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

staging: vt6656: s_vGenerateTxParameter pvRrvTime should never be NULL

If pvRrvTime is NULL the whole structure is NULL, so
remove if statements and consolidate to single return.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6c416ce
...@@ -860,6 +860,9 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -860,6 +860,9 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
byFBOption = AUTO_FB_1; byFBOption = AUTO_FB_1;
} }
if (!pvRrvTime)
return;
if (pDevice->bLongHeader) if (pDevice->bLongHeader)
cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6; cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6;
...@@ -867,7 +870,6 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -867,7 +870,6 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
if (pvRTS != NULL) { //RTS_need if (pvRTS != NULL) { //RTS_need
//Fill RsvTime //Fill RsvTime
if (pvRrvTime) {
struct vnt_rrv_time_rts *pBuf = struct vnt_rrv_time_rts *pBuf =
(struct vnt_rrv_time_rts *)pvRrvTime; (struct vnt_rrv_time_rts *)pvRrvTime;
pBuf->wRTSTxRrvTime_aa = s_uGetRTSCTSRsvTime(pDevice, 2, pBuf->wRTSTxRrvTime_aa = s_uGetRTSCTSRsvTime(pDevice, 2,
...@@ -881,15 +883,12 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -881,15 +883,12 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
pBuf->wTxRrvTime_b = vnt_rxtx_rsvtime_le16(pDevice, pBuf->wTxRrvTime_b = vnt_rxtx_rsvtime_le16(pDevice,
PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate,
bNeedACK); bNeedACK);
}
//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 {//RTS_needless, PCF mode else {//RTS_needless, PCF mode
//Fill RsvTime //Fill RsvTime
if (pvRrvTime) {
struct vnt_rrv_time_cts *pBuf = struct vnt_rrv_time_cts *pBuf =
(struct vnt_rrv_time_cts *)pvRrvTime; (struct vnt_rrv_time_cts *)pvRrvTime;
pBuf->wTxRrvTime_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, pBuf->wTxRrvTime_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType,
...@@ -899,7 +898,6 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -899,7 +898,6 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
pDevice->byTopCCKBasicRate, bNeedACK); pDevice->byTopCCKBasicRate, bNeedACK);
pBuf->wCTSTxRrvTime_ba = s_uGetRTSCTSRsvTime(pDevice, 3, pBuf->wCTSTxRrvTime_ba = s_uGetRTSCTSRsvTime(pDevice, 3,
byPktType, cbFrameSize, wCurrentRate); byPktType, cbFrameSize, wCurrentRate);
}
//Fill CTS //Fill CTS
s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize,
bNeedACK, wCurrentRate, byFBOption); bNeedACK, wCurrentRate, byFBOption);
...@@ -909,54 +907,46 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -909,54 +907,46 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
if (pvRTS != NULL) {//RTS_need, non PCF mode if (pvRTS != NULL) {//RTS_need, non PCF mode
//Fill RsvTime //Fill RsvTime
if (pvRrvTime) {
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wRTSTxRrvTime = s_uGetRTSCTSRsvTime(pDevice, 2, pBuf->wRTSTxRrvTime = s_uGetRTSCTSRsvTime(pDevice, 2,
byPktType, cbFrameSize, wCurrentRate); byPktType, cbFrameSize, wCurrentRate);
pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, byPktType, pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, byPktType,
cbFrameSize, wCurrentRate, bNeedACK); cbFrameSize, wCurrentRate, bNeedACK);
}
//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 if (pvRTS == NULL) {//RTS_needless, non PCF mode else if (pvRTS == NULL) {//RTS_needless, non PCF mode
//Fill RsvTime //Fill RsvTime
if (pvRrvTime) {
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A,
cbFrameSize, wCurrentRate, bNeedACK); cbFrameSize, wCurrentRate, bNeedACK);
} }
} }
}
else if (byPktType == PK_TYPE_11B) { else if (byPktType == PK_TYPE_11B) {
if ((pvRTS != NULL)) {//RTS_need, non PCF mode if ((pvRTS != NULL)) {//RTS_need, non PCF mode
//Fill RsvTime //Fill RsvTime
if (pvRrvTime) {
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wRTSTxRrvTime = s_uGetRTSCTSRsvTime(pDevice, 0, pBuf->wRTSTxRrvTime = s_uGetRTSCTSRsvTime(pDevice, 0,
byPktType, cbFrameSize, wCurrentRate); byPktType, cbFrameSize, wCurrentRate);
pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B,
cbFrameSize, wCurrentRate, bNeedACK); cbFrameSize, wCurrentRate, bNeedACK);
}
//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 { //RTS_needless, non PCF mode else { //RTS_needless, non PCF mode
//Fill RsvTime //Fill RsvTime
if (pvRrvTime) {
struct vnt_rrv_time_ab *pBuf = struct vnt_rrv_time_ab *pBuf =
(struct vnt_rrv_time_ab *)pvRrvTime; (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B,
cbFrameSize, wCurrentRate, bNeedACK); cbFrameSize, wCurrentRate, bNeedACK);
} }
} }
}
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vGenerateTxParameter END.\n"); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vGenerateTxParameter END.\n");
} }
/* /*
......
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