diff options
author | Charles Clément <caratorn@gmail.com> | 2010-05-18 14:30:19 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-18 17:58:32 -0400 |
commit | 31c21b779181140e0b7eadadbd5e0f518e131488 (patch) | |
tree | 175687c3fa49867b6f305d894ca93fa89dd6eb6d | |
parent | 855181f51558dca10c8acc27f1f81e0809ddf057 (diff) |
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: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 4 | ||||
-rw-r--r-- | drivers/staging/vt6655/rxtx.c | 4 | ||||
-rw-r--r-- | drivers/staging/vt6655/tether.h | 3 | ||||
-rw-r--r-- | drivers/staging/vt6655/wroute.c | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 25894a201b2b..3005892e807c 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c | |||
@@ -2156,7 +2156,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { | |||
2156 | cbFrameBodySize = skb->len - ETH_HLEN; | 2156 | cbFrameBodySize = skb->len - ETH_HLEN; |
2157 | 2157 | ||
2158 | // 802.1H | 2158 | // 802.1H |
2159 | if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { | 2159 | if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) { |
2160 | cbFrameBodySize += 8; | 2160 | cbFrameBodySize += 8; |
2161 | } | 2161 | } |
2162 | uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader); | 2162 | uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader); |
@@ -2359,7 +2359,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { | |||
2359 | memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN); | 2359 | memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN); |
2360 | cbFrameBodySize = skb->len - ETH_HLEN; | 2360 | cbFrameBodySize = skb->len - ETH_HLEN; |
2361 | // 802.1H | 2361 | // 802.1H |
2362 | if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { | 2362 | if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) { |
2363 | cbFrameBodySize += 8; | 2363 | cbFrameBodySize += 8; |
2364 | } | 2364 | } |
2365 | 2365 | ||
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index e27fa204962e..efd758efc73f 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c | |||
@@ -1622,7 +1622,7 @@ s_cbFillTxBufHead ( | |||
1622 | 1622 | ||
1623 | 1623 | ||
1624 | // 802.1H | 1624 | // 802.1H |
1625 | if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) { | 1625 | if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { |
1626 | if ((psEthHeader->wType == TYPE_PKT_IPX) || | 1626 | if ((psEthHeader->wType == TYPE_PKT_IPX) || |
1627 | (psEthHeader->wType == cpu_to_le16(0xF380))) { | 1627 | (psEthHeader->wType == cpu_to_le16(0xF380))) { |
1628 | memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); | 1628 | memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); |
@@ -1986,7 +1986,7 @@ s_cbFillTxBufHead ( | |||
1986 | } | 1986 | } |
1987 | 1987 | ||
1988 | // 802.1H | 1988 | // 802.1H |
1989 | if (ntohs(psEthHeader->wType) > MAX_DATA_LEN) { | 1989 | if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { |
1990 | if ((psEthHeader->wType == TYPE_PKT_IPX) || | 1990 | if ((psEthHeader->wType == TYPE_PKT_IPX) || |
1991 | (psEthHeader->wType == cpu_to_le16(0xF380))) { | 1991 | (psEthHeader->wType == cpu_to_le16(0xF380))) { |
1992 | memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); | 1992 | memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); |
diff --git a/drivers/staging/vt6655/tether.h b/drivers/staging/vt6655/tether.h index bc82a6b425e9..5ade9b6b51c3 100644 --- a/drivers/staging/vt6655/tether.h +++ b/drivers/staging/vt6655/tether.h | |||
@@ -40,12 +40,11 @@ | |||
40 | // Ethernet address string length | 40 | // Ethernet address string length |
41 | 41 | ||
42 | #define MIN_DATA_LEN 46 // min data length | 42 | #define MIN_DATA_LEN 46 // min data length |
43 | #define MAX_DATA_LEN 1500 // max data length | ||
44 | 43 | ||
45 | #define MIN_PACKET_LEN (MIN_DATA_LEN + ETH_HLEN) | 44 | #define MIN_PACKET_LEN (MIN_DATA_LEN + ETH_HLEN) |
46 | // 60 | 45 | // 60 |
47 | // min total packet length (tx) | 46 | // min total packet length (tx) |
48 | #define MAX_PACKET_LEN (MAX_DATA_LEN + ETH_HLEN) | 47 | #define MAX_PACKET_LEN (ETH_DATA_LEN + ETH_HLEN) |
49 | // 1514 | 48 | // 1514 |
50 | // max total packet length (tx) | 49 | // max total packet length (tx) |
51 | 50 | ||
diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index 485e105b0af7..bf92fb9908fe 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c | |||
@@ -95,7 +95,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI | |||
95 | 95 | ||
96 | cbFrameBodySize = uDataLen - ETH_HLEN; | 96 | cbFrameBodySize = uDataLen - ETH_HLEN; |
97 | 97 | ||
98 | if (ntohs(pDevice->sTxEthHeader.wType) > MAX_DATA_LEN) { | 98 | if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) { |
99 | cbFrameBodySize += 8; | 99 | cbFrameBodySize += 8; |
100 | } | 100 | } |
101 | 101 | ||