Commit 96fe9ee2 authored by Charles Clément's avatar Charles Clément Committed by Greg Kroah-Hartman

Staging: vt6655: use ETH_HLEN macro instead of custom one

Replaced custom header length definition U_HEADER_LEN by ETH_HLEN
from <linux/if_ether.h>. Also remove unused U_TYPE_LEN.
Signed-off-by: default avatarCharles Clément <caratorn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 078b078f
...@@ -2152,8 +2152,8 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { ...@@ -2152,8 +2152,8 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) {
pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP);
memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), U_HEADER_LEN); memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN);
cbFrameBodySize = skb->len - U_HEADER_LEN; cbFrameBodySize = skb->len - ETH_HLEN;
// 802.1H // 802.1H
if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) {
...@@ -2356,8 +2356,8 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { ...@@ -2356,8 +2356,8 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP);
memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), U_HEADER_LEN); memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN);
cbFrameBodySize = skb->len - U_HEADER_LEN; cbFrameBodySize = skb->len - ETH_HLEN;
// 802.1H // 802.1H
if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) {
cbFrameBodySize += 8; cbFrameBodySize += 8;
...@@ -2636,10 +2636,10 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); ...@@ -2636,10 +2636,10 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate);
BYTE Descriptor_type; BYTE Descriptor_type;
WORD Key_info; WORD Key_info;
BOOL bTxeapol_key = FALSE; BOOL bTxeapol_key = FALSE;
Protocol_Version = skb->data[U_HEADER_LEN]; Protocol_Version = skb->data[ETH_HLEN];
Packet_Type = skb->data[U_HEADER_LEN+1]; Packet_Type = skb->data[ETH_HLEN+1];
Descriptor_type = skb->data[U_HEADER_LEN+1+1+2]; Descriptor_type = skb->data[ETH_HLEN+1+1+2];
Key_info = (skb->data[U_HEADER_LEN+1+1+2+1] << 8)|(skb->data[U_HEADER_LEN+1+1+2+2]); Key_info = (skb->data[ETH_HLEN+1+1+2+1] << 8)|(skb->data[ETH_HLEN+1+1+2+2]);
if (pDevice->sTxEthHeader.wType == TYPE_PKT_802_1x) { if (pDevice->sTxEthHeader.wType == TYPE_PKT_802_1x) {
if(((Protocol_Version==1) ||(Protocol_Version==2)) && if(((Protocol_Version==1) ||(Protocol_Version==2)) &&
(Packet_Type==3)) { //802.1x OR eapol-key challenge frame transfer (Packet_Type==3)) { //802.1x OR eapol-key challenge frame transfer
......
...@@ -36,19 +36,17 @@ ...@@ -36,19 +36,17 @@
// //
// constants // constants
// //
#define U_TYPE_LEN 2 //
#define U_CRC_LEN 4 // #define U_CRC_LEN 4 //
#define U_HEADER_LEN (ETH_ALEN * 2 + U_TYPE_LEN)
#define U_ETHER_ADDR_STR_LEN (ETH_ALEN * 2 + 1) #define U_ETHER_ADDR_STR_LEN (ETH_ALEN * 2 + 1)
// Ethernet address string length // Ethernet address string length
#define MIN_DATA_LEN 46 // min data length #define MIN_DATA_LEN 46 // min data length
#define MAX_DATA_LEN 1500 // max data length #define MAX_DATA_LEN 1500 // max data length
#define MIN_PACKET_LEN (MIN_DATA_LEN + U_HEADER_LEN) #define MIN_PACKET_LEN (MIN_DATA_LEN + ETH_HLEN)
// 60 // 60
// min total packet length (tx) // min total packet length (tx)
#define MAX_PACKET_LEN (MAX_DATA_LEN + U_HEADER_LEN) #define MAX_PACKET_LEN (MAX_DATA_LEN + ETH_HLEN)
// 1514 // 1514
// max total packet length (tx) // max total packet length (tx)
......
...@@ -91,9 +91,9 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI ...@@ -91,9 +91,9 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI
pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP);
memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)pbySkbData, U_HEADER_LEN); memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)pbySkbData, ETH_HLEN);
cbFrameBodySize = uDataLen - U_HEADER_LEN; cbFrameBodySize = uDataLen - ETH_HLEN;
if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) {
cbFrameBodySize += 8; cbFrameBodySize += 8;
......
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