Commit a479ffc38885e52f16d0e28cdf40b2e3893ab6f3
Committed by
Greg Kroah-Hartman
1 parent
9c62c7abf8
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
staging: vt6655: Fix *Duration s_uFillDataHead to return to __le16
All callers should be __le16. Fix vGenerateMACHeader duration to __le16 and reverse the endian conversion. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 9 additions and 9 deletions Side-by-side Diff
drivers/staging/vt6655/rxtx.c
... | ... | @@ -166,7 +166,7 @@ |
166 | 166 | unsigned int uNodeIndex, unsigned int *puMACfragNum); |
167 | 167 | |
168 | 168 | static |
169 | -unsigned int | |
169 | +__le16 | |
170 | 170 | s_uFillDataHead( |
171 | 171 | struct vnt_private *pDevice, |
172 | 172 | unsigned char byPktType, |
... | ... | @@ -671,7 +671,7 @@ |
671 | 671 | } |
672 | 672 | |
673 | 673 | static |
674 | -unsigned int | |
674 | +__le16 | |
675 | 675 | s_uFillDataHead( |
676 | 676 | struct vnt_private *pDevice, |
677 | 677 | unsigned char byPktType, |
... | ... | @@ -1202,7 +1202,7 @@ |
1202 | 1202 | unsigned char *pbyIVHead; |
1203 | 1203 | unsigned char *pbyMacHdr; |
1204 | 1204 | unsigned short wFragType; //00:Non-Frag, 01:Start, 10:Mid, 11:Last |
1205 | - unsigned int uDuration; | |
1205 | + __le16 uDuration; | |
1206 | 1206 | unsigned char *pbyBuffer; |
1207 | 1207 | unsigned int cbIVlen = 0; |
1208 | 1208 | unsigned int cbICVlen = 0; |
... | ... | @@ -1448,7 +1448,7 @@ |
1448 | 1448 | uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFragmentSize, uDMAIdx, bNeedACK, |
1449 | 1449 | uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption, pDevice->wCurrentRate); |
1450 | 1450 | // Generate TX MAC Header |
1451 | - vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, | |
1451 | + vGenerateMACHeader(pDevice, pbyMacHdr, uDuration, psEthHeader, bNeedEncrypt, | |
1452 | 1452 | wFragType, uDMAIdx, uFragIdx); |
1453 | 1453 | |
1454 | 1454 | if (bNeedEncrypt == true) { |
... | ... | @@ -1539,7 +1539,7 @@ |
1539 | 1539 | uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption, pDevice->wCurrentRate); |
1540 | 1540 | |
1541 | 1541 | // Generate TX MAC Header |
1542 | - vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, | |
1542 | + vGenerateMACHeader(pDevice, pbyMacHdr, uDuration, psEthHeader, bNeedEncrypt, | |
1543 | 1543 | wFragType, uDMAIdx, uFragIdx); |
1544 | 1544 | |
1545 | 1545 | if (bNeedEncrypt == true) { |
... | ... | @@ -1657,7 +1657,7 @@ |
1657 | 1657 | uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption, pDevice->wCurrentRate); |
1658 | 1658 | |
1659 | 1659 | // Generate TX MAC Header |
1660 | - vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, | |
1660 | + vGenerateMACHeader(pDevice, pbyMacHdr, uDuration, psEthHeader, bNeedEncrypt, | |
1661 | 1661 | wFragType, uDMAIdx, uFragIdx); |
1662 | 1662 | |
1663 | 1663 | if (bNeedEncrypt == true) { |
... | ... | @@ -1765,7 +1765,7 @@ |
1765 | 1765 | 0, 0, uMACfragNum, byFBOption, pDevice->wCurrentRate); |
1766 | 1766 | |
1767 | 1767 | // Generate TX MAC Header |
1768 | - vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, | |
1768 | + vGenerateMACHeader(pDevice, pbyMacHdr, uDuration, psEthHeader, bNeedEncrypt, | |
1769 | 1769 | wFragType, uDMAIdx, 0); |
1770 | 1770 | |
1771 | 1771 | if (bNeedEncrypt == true) { |
... | ... | @@ -1989,7 +1989,7 @@ |
1989 | 1989 | vGenerateMACHeader( |
1990 | 1990 | struct vnt_private *pDevice, |
1991 | 1991 | unsigned char *pbyBufferAddr, |
1992 | - unsigned short wDuration, | |
1992 | + __le16 wDuration, | |
1993 | 1993 | PSEthernetHeader psEthHeader, |
1994 | 1994 | bool bNeedEncrypt, |
1995 | 1995 | unsigned short wFragType, |
... | ... | @@ -2027,7 +2027,7 @@ |
2027 | 2027 | if (bNeedEncrypt) |
2028 | 2028 | pMACHeader->wFrameCtl |= cpu_to_le16((unsigned short)WLAN_SET_FC_ISWEP(1)); |
2029 | 2029 | |
2030 | - pMACHeader->wDurationID = cpu_to_le16(wDuration); | |
2030 | + pMACHeader->wDurationID = le16_to_cpu(wDuration); | |
2031 | 2031 | |
2032 | 2032 | if (pDevice->bLongHeader) { |
2033 | 2033 | PWLAN_80211HDR_A4 pMACA4Header = (PWLAN_80211HDR_A4) pbyBufferAddr; |