diff options
Diffstat (limited to 'drivers/net/ethernet/wangxun/libwx/wx_lib.c')
-rw-r--r-- | drivers/net/ethernet/wangxun/libwx/wx_lib.c | 58 |
1 files changed, 5 insertions, 53 deletions
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c index c87afe5de1..6fae161cbc 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -1257,7 +1257,7 @@ static int wx_tso(struct wx_ring *tx_ring, struct wx_tx_buffer *first, /* compute header lengths */ l4len = enc ? inner_tcp_hdrlen(skb) : tcp_hdrlen(skb); - *hdr_len = enc ? (skb_inner_transport_header(skb) - skb->data) : + *hdr_len = enc ? skb_inner_transport_offset(skb) : skb_transport_offset(skb); *hdr_len += l4len; @@ -2690,63 +2690,15 @@ int wx_set_features(struct net_device *netdev, netdev_features_t features) wx->rss_enabled = false; } - netdev->features = features; - - if (wx->mac.type == wx_mac_sp && changed & NETIF_F_HW_VLAN_CTAG_RX) - wx->do_reset(netdev); - else if (changed & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER)) + if (changed & + (NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_STAG_RX)) wx_set_rx_mode(netdev); - return 0; + return 1; } EXPORT_SYMBOL(wx_set_features); -#define NETIF_VLAN_STRIPPING_FEATURES (NETIF_F_HW_VLAN_CTAG_RX | \ - NETIF_F_HW_VLAN_STAG_RX) - -#define NETIF_VLAN_INSERTION_FEATURES (NETIF_F_HW_VLAN_CTAG_TX | \ - NETIF_F_HW_VLAN_STAG_TX) - -#define NETIF_VLAN_FILTERING_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ - NETIF_F_HW_VLAN_STAG_FILTER) - -netdev_features_t wx_fix_features(struct net_device *netdev, - netdev_features_t features) -{ - netdev_features_t changed = netdev->features ^ features; - struct wx *wx = netdev_priv(netdev); - - if (changed & NETIF_VLAN_STRIPPING_FEATURES) { - if ((features & NETIF_VLAN_STRIPPING_FEATURES) != NETIF_VLAN_STRIPPING_FEATURES && - (features & NETIF_VLAN_STRIPPING_FEATURES) != 0) { - features &= ~NETIF_VLAN_STRIPPING_FEATURES; - features |= netdev->features & NETIF_VLAN_STRIPPING_FEATURES; - wx_err(wx, "802.1Q and 802.1ad VLAN stripping must be either both on or both off."); - } - } - - if (changed & NETIF_VLAN_INSERTION_FEATURES) { - if ((features & NETIF_VLAN_INSERTION_FEATURES) != NETIF_VLAN_INSERTION_FEATURES && - (features & NETIF_VLAN_INSERTION_FEATURES) != 0) { - features &= ~NETIF_VLAN_INSERTION_FEATURES; - features |= netdev->features & NETIF_VLAN_INSERTION_FEATURES; - wx_err(wx, "802.1Q and 802.1ad VLAN insertion must be either both on or both off."); - } - } - - if (changed & NETIF_VLAN_FILTERING_FEATURES) { - if ((features & NETIF_VLAN_FILTERING_FEATURES) != NETIF_VLAN_FILTERING_FEATURES && - (features & NETIF_VLAN_FILTERING_FEATURES) != 0) { - features &= ~NETIF_VLAN_FILTERING_FEATURES; - features |= netdev->features & NETIF_VLAN_FILTERING_FEATURES; - wx_err(wx, "802.1Q and 802.1ad VLAN filtering must be either both on or both off."); - } - } - - return features; -} -EXPORT_SYMBOL(wx_fix_features); - void wx_set_ring(struct wx *wx, u32 new_tx_count, u32 new_rx_count, struct wx_ring *temp_ring) { |