Commit 31c21b77 authored by Charles Clément's avatar Charles Clément Committed by Greg Kroah-Hartman

Staging: vt6655: use ETH_DATA_LEN macro instead of custom one

Replace custom maximum data lenght definition MAX_DATA_LEN by
ETH_DATA_LEN from <linux/if_ether.h>.
Signed-off-by: default avatarCharles Clément <caratorn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 855181f5
...@@ -2156,7 +2156,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { ...@@ -2156,7 +2156,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) {
cbFrameBodySize = skb->len - ETH_HLEN; cbFrameBodySize = skb->len - ETH_HLEN;
// 802.1H // 802.1H
if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) {
cbFrameBodySize += 8; cbFrameBodySize += 8;
} }
uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader); uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader);
...@@ -2359,7 +2359,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { ...@@ -2359,7 +2359,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN); memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN);
cbFrameBodySize = skb->len - ETH_HLEN; cbFrameBodySize = skb->len - ETH_HLEN;
// 802.1H // 802.1H
if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) {
cbFrameBodySize += 8; cbFrameBodySize += 8;
} }
......
...@@ -1622,7 +1622,7 @@ s_cbFillTxBufHead ( ...@@ -1622,7 +1622,7 @@ s_cbFillTxBufHead (
// 802.1H // 802.1H
if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) { if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) {
if ((psEthHeader->wType == TYPE_PKT_IPX) || if ((psEthHeader->wType == TYPE_PKT_IPX) ||
(psEthHeader->wType == cpu_to_le16(0xF380))) { (psEthHeader->wType == cpu_to_le16(0xF380))) {
memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6);
...@@ -1986,7 +1986,7 @@ s_cbFillTxBufHead ( ...@@ -1986,7 +1986,7 @@ s_cbFillTxBufHead (
} }
// 802.1H // 802.1H
if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) { if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) {
if ((psEthHeader->wType == TYPE_PKT_IPX) || if ((psEthHeader->wType == TYPE_PKT_IPX) ||
(psEthHeader->wType == cpu_to_le16(0xF380))) { (psEthHeader->wType == cpu_to_le16(0xF380))) {
memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6);
......
...@@ -40,12 +40,11 @@ ...@@ -40,12 +40,11 @@
// 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 MIN_PACKET_LEN (MIN_DATA_LEN + ETH_HLEN) #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 + ETH_HLEN) #define MAX_PACKET_LEN (ETH_DATA_LEN + ETH_HLEN)
// 1514 // 1514
// max total packet length (tx) // max total packet length (tx)
......
...@@ -95,7 +95,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI ...@@ -95,7 +95,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI
cbFrameBodySize = uDataLen - ETH_HLEN; cbFrameBodySize = uDataLen - ETH_HLEN;
if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > ETH_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