Commit ceb8c5da authored by Andres More's avatar Andres More Committed by Greg Kroah-Hartman

staging: vt6656: removed usage of custom Ethernet header

Removed struct tagSEthernetHeader, replacing with struct ethhdr.
Not all checkpatch errors and warnings were removed.
Signed-off-by: default avatarAndres More <more.andres@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d7d34a1
...@@ -190,7 +190,7 @@ typedef struct _USB_SEND_CONTEXT { ...@@ -190,7 +190,7 @@ typedef struct _USB_SEND_CONTEXT {
struct urb *pUrb; struct urb *pUrb;
unsigned int uBufLen; unsigned int uBufLen;
CONTEXT_TYPE Type; CONTEXT_TYPE Type;
SEthernetHeader sEthHeader; struct ethhdr sEthHeader;
void *Next; void *Next;
bool bBoolInUse; bool bBoolInUse;
unsigned char Data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS]; unsigned char Data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
...@@ -746,8 +746,8 @@ struct vnt_private { ...@@ -746,8 +746,8 @@ struct vnt_private {
u8 byReAssocCount; u8 byReAssocCount;
u8 byLinkWaitCount; u8 byLinkWaitCount;
SEthernetHeader sTxEthHeader; struct ethhdr sTxEthHeader;
SEthernetHeader sRxEthHeader; struct ethhdr sRxEthHeader;
u8 abyBroadcastAddr[ETH_ALEN]; u8 abyBroadcastAddr[ETH_ALEN];
u8 abySNAP_RFC1042[ETH_ALEN]; u8 abySNAP_RFC1042[ETH_ALEN];
u8 abySNAP_Bridgetunnel[ETH_ALEN]; u8 abySNAP_Bridgetunnel[ETH_ALEN];
......
...@@ -81,7 +81,7 @@ void ...@@ -81,7 +81,7 @@ void
s_vGetDASA( s_vGetDASA(
u8 * pbyRxBufferAddr, u8 * pbyRxBufferAddr,
unsigned int *pcbHeaderSize, unsigned int *pcbHeaderSize,
PSEthernetHeader psEthHeader struct ethhdr *psEthHeader
); );
static void s_vProcessRxMACHeader(struct vnt_private *pDevice, static void s_vProcessRxMACHeader(struct vnt_private *pDevice,
...@@ -190,9 +190,9 @@ static void s_vProcessRxMACHeader(struct vnt_private *pDevice, ...@@ -190,9 +190,9 @@ static void s_vProcessRxMACHeader(struct vnt_private *pDevice,
cbHeaderSize -= (ETH_ALEN * 2); cbHeaderSize -= (ETH_ALEN * 2);
pbyRxBuffer = (u8 *) (pbyRxBufferAddr + cbHeaderSize); pbyRxBuffer = (u8 *) (pbyRxBufferAddr + cbHeaderSize);
for (ii = 0; ii < ETH_ALEN; ii++) for (ii = 0; ii < ETH_ALEN; ii++)
*pbyRxBuffer++ = pDevice->sRxEthHeader.abyDstAddr[ii]; *pbyRxBuffer++ = pDevice->sRxEthHeader.h_dest[ii];
for (ii = 0; ii < ETH_ALEN; ii++) for (ii = 0; ii < ETH_ALEN; ii++)
*pbyRxBuffer++ = pDevice->sRxEthHeader.abySrcAddr[ii]; *pbyRxBuffer++ = pDevice->sRxEthHeader.h_source[ii];
*pcbHeadSize = cbHeaderSize; *pcbHeadSize = cbHeaderSize;
} }
...@@ -217,7 +217,7 @@ void ...@@ -217,7 +217,7 @@ void
s_vGetDASA ( s_vGetDASA (
u8 * pbyRxBufferAddr, u8 * pbyRxBufferAddr,
unsigned int *pcbHeaderSize, unsigned int *pcbHeaderSize,
PSEthernetHeader psEthHeader struct ethhdr *psEthHeader
) )
{ {
unsigned int cbHeaderSize = 0; unsigned int cbHeaderSize = 0;
...@@ -229,17 +229,17 @@ s_vGetDASA ( ...@@ -229,17 +229,17 @@ s_vGetDASA (
if ((pMACHeader->wFrameCtl & FC_TODS) == 0) { if ((pMACHeader->wFrameCtl & FC_TODS) == 0) {
if (pMACHeader->wFrameCtl & FC_FROMDS) { if (pMACHeader->wFrameCtl & FC_FROMDS) {
for (ii = 0; ii < ETH_ALEN; ii++) { for (ii = 0; ii < ETH_ALEN; ii++) {
psEthHeader->abyDstAddr[ii] = psEthHeader->h_dest[ii] =
pMACHeader->abyAddr1[ii]; pMACHeader->abyAddr1[ii];
psEthHeader->abySrcAddr[ii] = psEthHeader->h_source[ii] =
pMACHeader->abyAddr3[ii]; pMACHeader->abyAddr3[ii];
} }
} else { } else {
/* IBSS mode */ /* IBSS mode */
for (ii = 0; ii < ETH_ALEN; ii++) { for (ii = 0; ii < ETH_ALEN; ii++) {
psEthHeader->abyDstAddr[ii] = psEthHeader->h_dest[ii] =
pMACHeader->abyAddr1[ii]; pMACHeader->abyAddr1[ii];
psEthHeader->abySrcAddr[ii] = psEthHeader->h_source[ii] =
pMACHeader->abyAddr2[ii]; pMACHeader->abyAddr2[ii];
} }
} }
...@@ -247,17 +247,17 @@ s_vGetDASA ( ...@@ -247,17 +247,17 @@ s_vGetDASA (
/* Is AP mode.. */ /* Is AP mode.. */
if (pMACHeader->wFrameCtl & FC_FROMDS) { if (pMACHeader->wFrameCtl & FC_FROMDS) {
for (ii = 0; ii < ETH_ALEN; ii++) { for (ii = 0; ii < ETH_ALEN; ii++) {
psEthHeader->abyDstAddr[ii] = psEthHeader->h_dest[ii] =
pMACHeader->abyAddr3[ii]; pMACHeader->abyAddr3[ii];
psEthHeader->abySrcAddr[ii] = psEthHeader->h_source[ii] =
pMACHeader->abyAddr4[ii]; pMACHeader->abyAddr4[ii];
cbHeaderSize += 6; cbHeaderSize += 6;
} }
} else { } else {
for (ii = 0; ii < ETH_ALEN; ii++) { for (ii = 0; ii < ETH_ALEN; ii++) {
psEthHeader->abyDstAddr[ii] = psEthHeader->h_dest[ii] =
pMACHeader->abyAddr3[ii]; pMACHeader->abyAddr3[ii];
psEthHeader->abySrcAddr[ii] = psEthHeader->h_source[ii] =
pMACHeader->abyAddr2[ii]; pMACHeader->abyAddr2[ii];
} }
} }
...@@ -407,7 +407,7 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB, ...@@ -407,7 +407,7 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
// Use for TKIP MIC // Use for TKIP MIC
s_vGetDASA(pbyFrame, &cbHeaderSize, &pDevice->sRxEthHeader); s_vGetDASA(pbyFrame, &cbHeaderSize, &pDevice->sRxEthHeader);
if (!compare_ether_addr((u8 *)&(pDevice->sRxEthHeader.abySrcAddr[0]), if (!compare_ether_addr((u8 *)&(pDevice->sRxEthHeader.h_source[0]),
pDevice->abyCurrentNetAddr)) pDevice->abyCurrentNetAddr))
return false; return false;
...@@ -776,7 +776,7 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB, ...@@ -776,7 +776,7 @@ int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB,
} }
MIC_vInit(dwMICKey0, dwMICKey1); MIC_vInit(dwMICKey0, dwMICKey1);
MIC_vAppend((u8 *)&(pDevice->sRxEthHeader.abyDstAddr[0]), 12); MIC_vAppend((u8 *)&(pDevice->sRxEthHeader.h_dest[0]), 12);
dwMIC_Priority = 0; dwMIC_Priority = 0;
MIC_vAppend((u8 *)&dwMIC_Priority, 4); MIC_vAppend((u8 *)&dwMIC_Priority, 4);
// 4 is Rcv buffer header, 24 is MAC Header, and 8 is IV and Ext IV. // 4 is Rcv buffer header, 24 is MAC Header, and 8 is IV and Ext IV.
......
This diff is collapsed.
...@@ -114,18 +114,6 @@ ...@@ -114,18 +114,6 @@
#define WEP_IV_MASK 0x00FFFFFF #define WEP_IV_MASK 0x00FFFFFF
/*--------------------- Export Types ------------------------------*/
//
// Ethernet packet
//
typedef struct tagSEthernetHeader {
u8 abyDstAddr[ETH_ALEN];
u8 abySrcAddr[ETH_ALEN];
u16 wType;
} __attribute__ ((__packed__))
SEthernetHeader, *PSEthernetHeader;
// //
// 802_3 packet // 802_3 packet
// //
......
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