=================
From: From: Mirko Lindner <mlindner@marvell.com>
Bug: The VLAN bit of the MAC RX Status Word is unreliable in several older
supported chips. Sometimes the VLAN bit is not set for valid VLAN packets
and also sometimes the VLAN bit is set for non-VLAN packets that came after
a VLAN packet. This results in a receive length error when VLAN hardware
tagging is enabled.
Fix: The driver uses only VLAN information included in VLAN status list elements,
that signals that the VLAN tag field is valid. It must ignore the VLAN bit in the
MAC RX Status Word. An additional variable set when evaluating the VLAN opcodes
is used to indicate that the received packet is a VLAN packet and a packet length
correction (subtraction of VLAN header length) must be done.
Signed-off-by: Mirko Lindner <mlindner@marvell.com>
@@ -2580,7 +2580,7 @@ static struct sk_buff *sky2_receive(stru
struct sk_buff *skb = NULL;
u16 count = (status & GMR_FS_LEN) >> 16;
- if (status & GMR_FS_VLAN)
+ if (sky2->rx_vlan)
count -= VLAN_HLEN; /* Account for vlan tag */
netif_printk(sky2, rx_status, KERN_DEBUG, dev,
@@ -2646,11 +2646,13 @@ static inline void sky2_tx_done(struct n
}
}
-static inline void sky2_skb_rx(const struct sky2_port *sky2,
- u32 status, struct sk_buff *skb)
+static inline void sky2_skb_rx(struct sky2_port *sky2,
+ struct sk_buff *skb)
{
- if (status & GMR_FS_VLAN)
+ if (sky2->rx_vlan) {
__vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));
+ sky2->rx_vlan = 0;
+ }
if (skb->ip_summed == CHECKSUM_NONE)
netif_receive_skb(skb);
@@ -2242,6 +2242,7 @@ struct sky2_port {
u16 rx_data_size;
u16 rx_nfrags;
u16 rx_tag;
+ u8 rx_vlan;
struct {
unsigned long last;