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

staging: vt6656: WCTLbIsDuplicate fix PSCacheEntry base types and warnings

Fix wFmSequence and wFrameCtl to __le16

Don't restrict to u8, if packet is a duplicate both bytes of __le16 will be
the same.

Fixes warnings
wctl.c:66:9: warning: restricted __le16 degrades to integer
wctl.c:71:56: warning: restricted __le16 degrades to integer
wctl.c:73:49: warning: cast from restricted __le16
wctl.c:83:30: warning: incorrect type in assignment (different base types)
wctl.c:83:30:    expected unsigned short [unsigned] [usertype] wFmSequence
wctl.c:83:30:    got restricted __le16 [usertype] seq_ctrl
wctl.c:85:28: warning: incorrect type in assignment (different base types)
wctl.c:85:28:    expected unsigned short [unsigned] [usertype] wFrameCtl
wctl.c:85:28:    got restricted __le16 [usertype] frame_control
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8b9c012a
...@@ -340,9 +340,9 @@ typedef struct tagSPMKIDCandidateEvent { ...@@ -340,9 +340,9 @@ typedef struct tagSPMKIDCandidateEvent {
/* The receive duplicate detection cache entry */ /* The receive duplicate detection cache entry */
typedef struct tagSCacheEntry{ typedef struct tagSCacheEntry{
u16 wFmSequence; __le16 wFmSequence;
u8 abyAddr2[ETH_ALEN]; u8 abyAddr2[ETH_ALEN];
u16 wFrameCtl; __le16 wFrameCtl;
} SCacheEntry, *PSCacheEntry; } SCacheEntry, *PSCacheEntry;
typedef struct tagSCache{ typedef struct tagSCache{
......
...@@ -70,7 +70,7 @@ bool WCTLbIsDuplicate (PSCache pCache, struct ieee80211_hdr *pMACHeader) ...@@ -70,7 +70,7 @@ bool WCTLbIsDuplicate (PSCache pCache, struct ieee80211_hdr *pMACHeader)
pCacheEntry = &(pCache->asCacheEntry[uIndex]); pCacheEntry = &(pCache->asCacheEntry[uIndex]);
if ((pCacheEntry->wFmSequence == pMACHeader->seq_ctrl) && if ((pCacheEntry->wFmSequence == pMACHeader->seq_ctrl) &&
ether_addr_equal(pCacheEntry->abyAddr2, pMACHeader->addr2) && ether_addr_equal(pCacheEntry->abyAddr2, pMACHeader->addr2) &&
(LOBYTE(pCacheEntry->wFrameCtl) == LOBYTE(pMACHeader->frame_control)) (pCacheEntry->wFrameCtl == pMACHeader->frame_control)
) { ) {
/* Duplicate match */ /* Duplicate match */
return true; return true;
......
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