diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-08-22 21:18:56 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:57 -0400 |
commit | cf9830195a3f35b1248425b69a01ee43f5b68221 (patch) | |
tree | a6ecdb00a710318c4807602141a5e55cee0a3f91 /drivers/net | |
parent | d3bb52b0948cf118131c951c5a34a2d4d0246171 (diff) |
fix vlan in 8139cp on big-endian
Layout of opts2 is
: MSB(vlan_tag) : LSB(vlan_tag) : flags : 0 :
regardless of the host endianness. On little-endian
the current code ends up with the right values, but
on big-endian it blows. In r8169.c the same bug
had been fixed in commit d35da12a40426184b1d0844104b1d464753eba19
(r8169: endianness fixes).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/8139cp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index abb2a3471087..a453eda834d5 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -78,7 +78,7 @@ | |||
78 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 78 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
79 | #define CP_VLAN_TAG_USED 1 | 79 | #define CP_VLAN_TAG_USED 1 |
80 | #define CP_VLAN_TX_TAG(tx_desc,vlan_tag_value) \ | 80 | #define CP_VLAN_TX_TAG(tx_desc,vlan_tag_value) \ |
81 | do { (tx_desc)->opts2 = (vlan_tag_value); } while (0) | 81 | do { (tx_desc)->opts2 = cpu_to_le32(vlan_tag_value); } while (0) |
82 | #else | 82 | #else |
83 | #define CP_VLAN_TAG_USED 0 | 83 | #define CP_VLAN_TAG_USED 0 |
84 | #define CP_VLAN_TX_TAG(tx_desc,vlan_tag_value) \ | 84 | #define CP_VLAN_TX_TAG(tx_desc,vlan_tag_value) \ |
@@ -304,7 +304,7 @@ static const unsigned int cp_rx_config = | |||
304 | 304 | ||
305 | struct cp_desc { | 305 | struct cp_desc { |
306 | __le32 opts1; | 306 | __le32 opts1; |
307 | u32 opts2; | 307 | __le32 opts2; |
308 | __le64 addr; | 308 | __le64 addr; |
309 | }; | 309 | }; |
310 | 310 | ||
@@ -462,9 +462,9 @@ static inline void cp_rx_skb (struct cp_private *cp, struct sk_buff *skb, | |||
462 | cp->dev->last_rx = jiffies; | 462 | cp->dev->last_rx = jiffies; |
463 | 463 | ||
464 | #if CP_VLAN_TAG_USED | 464 | #if CP_VLAN_TAG_USED |
465 | if (cp->vlgrp && (desc->opts2 & RxVlanTagged)) { | 465 | if (cp->vlgrp && (desc->opts2 & cpu_to_le32(RxVlanTagged))) { |
466 | vlan_hwaccel_receive_skb(skb, cp->vlgrp, | 466 | vlan_hwaccel_receive_skb(skb, cp->vlgrp, |
467 | be16_to_cpu(desc->opts2 & 0xffff)); | 467 | swab16(le32_to_cpu(desc->opts2) & 0xffff)); |
468 | } else | 468 | } else |
469 | #endif | 469 | #endif |
470 | netif_receive_skb(skb); | 470 | netif_receive_skb(skb); |
@@ -765,7 +765,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
765 | 765 | ||
766 | #if CP_VLAN_TAG_USED | 766 | #if CP_VLAN_TAG_USED |
767 | if (cp->vlgrp && vlan_tx_tag_present(skb)) | 767 | if (cp->vlgrp && vlan_tx_tag_present(skb)) |
768 | vlan_tag = TxVlanTag | cpu_to_be16(vlan_tx_tag_get(skb)); | 768 | vlan_tag = TxVlanTag | swab16(vlan_tx_tag_get(skb)); |
769 | #endif | 769 | #endif |
770 | 770 | ||
771 | entry = cp->tx_head; | 771 | entry = cp->tx_head; |