diff options
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 409cf0595903..2f9b50156e0c 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -747,9 +747,16 @@ static void be_rx_compl_process(struct be_adapter *adapter, | |||
747 | struct be_eth_rx_compl *rxcp) | 747 | struct be_eth_rx_compl *rxcp) |
748 | { | 748 | { |
749 | struct sk_buff *skb; | 749 | struct sk_buff *skb; |
750 | u32 vtp, vid; | 750 | u32 vlanf, vid; |
751 | u8 vtm; | ||
751 | 752 | ||
752 | vtp = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); | 753 | vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); |
754 | vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); | ||
755 | |||
756 | /* vlanf could be wrongly set in some cards. | ||
757 | * ignore if vtm is not set */ | ||
758 | if ((adapter->cap == 0x400) && !vtm) | ||
759 | vlanf = 0; | ||
753 | 760 | ||
754 | skb = netdev_alloc_skb(adapter->netdev, BE_HDR_LEN + NET_IP_ALIGN); | 761 | skb = netdev_alloc_skb(adapter->netdev, BE_HDR_LEN + NET_IP_ALIGN); |
755 | if (!skb) { | 762 | if (!skb) { |
@@ -772,7 +779,7 @@ static void be_rx_compl_process(struct be_adapter *adapter, | |||
772 | skb->protocol = eth_type_trans(skb, adapter->netdev); | 779 | skb->protocol = eth_type_trans(skb, adapter->netdev); |
773 | skb->dev = adapter->netdev; | 780 | skb->dev = adapter->netdev; |
774 | 781 | ||
775 | if (vtp) { | 782 | if (vlanf) { |
776 | if (!adapter->vlan_grp || adapter->num_vlans == 0) { | 783 | if (!adapter->vlan_grp || adapter->num_vlans == 0) { |
777 | kfree_skb(skb); | 784 | kfree_skb(skb); |
778 | return; | 785 | return; |
@@ -797,11 +804,18 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
797 | struct be_eq_obj *eq_obj = &adapter->rx_eq; | 804 | struct be_eq_obj *eq_obj = &adapter->rx_eq; |
798 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; | 805 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; |
799 | u16 i, rxq_idx = 0, vid, j; | 806 | u16 i, rxq_idx = 0, vid, j; |
807 | u8 vtm; | ||
800 | 808 | ||
801 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); | 809 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); |
802 | pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); | 810 | pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); |
803 | vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); | 811 | vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); |
804 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); | 812 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); |
813 | vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); | ||
814 | |||
815 | /* vlanf could be wrongly set in some cards. | ||
816 | * ignore if vtm is not set */ | ||
817 | if ((adapter->cap == 0x400) && !vtm) | ||
818 | vlanf = 0; | ||
805 | 819 | ||
806 | skb = napi_get_frags(&eq_obj->napi); | 820 | skb = napi_get_frags(&eq_obj->napi); |
807 | if (!skb) { | 821 | if (!skb) { |
@@ -2045,7 +2059,8 @@ static int be_hw_up(struct be_adapter *adapter) | |||
2045 | if (status) | 2059 | if (status) |
2046 | return status; | 2060 | return status; |
2047 | 2061 | ||
2048 | status = be_cmd_query_fw_cfg(adapter, &adapter->port_num); | 2062 | status = be_cmd_query_fw_cfg(adapter, |
2063 | &adapter->port_num, &adapter->cap); | ||
2049 | return status; | 2064 | return status; |
2050 | } | 2065 | } |
2051 | 2066 | ||