aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade/bna/bnad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/brocade/bna/bnad.c')
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index cf64f3d0b60d..4ad1187e82fb 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -707,7 +707,8 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget)
707 else 707 else
708 skb_checksum_none_assert(skb); 708 skb_checksum_none_assert(skb);
709 709
710 if (flags & BNA_CQ_EF_VLAN) 710 if ((flags & BNA_CQ_EF_VLAN) &&
711 (bnad->netdev->features & NETIF_F_HW_VLAN_CTAG_RX))
711 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cmpl->vlan_tag)); 712 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cmpl->vlan_tag));
712 713
713 if (BNAD_RXBUF_IS_SK_BUFF(unmap_q->type)) 714 if (BNAD_RXBUF_IS_SK_BUFF(unmap_q->type))
@@ -2094,7 +2095,9 @@ bnad_init_rx_config(struct bnad *bnad, struct bna_rx_config *rx_config)
2094 rx_config->q1_buf_size = BFI_SMALL_RXBUF_SIZE; 2095 rx_config->q1_buf_size = BFI_SMALL_RXBUF_SIZE;
2095 } 2096 }
2096 2097
2097 rx_config->vlan_strip_status = BNA_STATUS_T_ENABLED; 2098 rx_config->vlan_strip_status =
2099 (bnad->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) ?
2100 BNA_STATUS_T_ENABLED : BNA_STATUS_T_DISABLED;
2098} 2101}
2099 2102
2100static void 2103static void
@@ -3245,11 +3248,6 @@ bnad_set_rx_mode(struct net_device *netdev)
3245 BNA_RXMODE_ALLMULTI; 3248 BNA_RXMODE_ALLMULTI;
3246 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL); 3249 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL);
3247 3250
3248 if (bnad->cfg_flags & BNAD_CF_PROMISC)
3249 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3250 else
3251 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3252
3253 spin_unlock_irqrestore(&bnad->bna_lock, flags); 3251 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3254} 3252}
3255 3253
@@ -3374,6 +3372,27 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
3374 return 0; 3372 return 0;
3375} 3373}
3376 3374
3375static int bnad_set_features(struct net_device *dev, netdev_features_t features)
3376{
3377 struct bnad *bnad = netdev_priv(dev);
3378 netdev_features_t changed = features ^ dev->features;
3379
3380 if ((changed & NETIF_F_HW_VLAN_CTAG_RX) && netif_running(dev)) {
3381 unsigned long flags;
3382
3383 spin_lock_irqsave(&bnad->bna_lock, flags);
3384
3385 if (features & NETIF_F_HW_VLAN_CTAG_RX)
3386 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3387 else
3388 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3389
3390 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3391 }
3392
3393 return 0;
3394}
3395
3377#ifdef CONFIG_NET_POLL_CONTROLLER 3396#ifdef CONFIG_NET_POLL_CONTROLLER
3378static void 3397static void
3379bnad_netpoll(struct net_device *netdev) 3398bnad_netpoll(struct net_device *netdev)
@@ -3421,6 +3440,7 @@ static const struct net_device_ops bnad_netdev_ops = {
3421 .ndo_change_mtu = bnad_change_mtu, 3440 .ndo_change_mtu = bnad_change_mtu,
3422 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid, 3441 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid,
3423 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid, 3442 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid,
3443 .ndo_set_features = bnad_set_features,
3424#ifdef CONFIG_NET_POLL_CONTROLLER 3444#ifdef CONFIG_NET_POLL_CONTROLLER
3425 .ndo_poll_controller = bnad_netpoll 3445 .ndo_poll_controller = bnad_netpoll
3426#endif 3446#endif
@@ -3433,14 +3453,14 @@ bnad_netdev_init(struct bnad *bnad, bool using_dac)
3433 3453
3434 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | 3454 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
3435 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3455 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3436 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX; 3456 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX |
3457 NETIF_F_HW_VLAN_CTAG_RX;
3437 3458
3438 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA | 3459 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA |
3439 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3460 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3440 NETIF_F_TSO | NETIF_F_TSO6; 3461 NETIF_F_TSO | NETIF_F_TSO6;
3441 3462
3442 netdev->features |= netdev->hw_features | 3463 netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
3443 NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
3444 3464
3445 if (using_dac) 3465 if (using_dac)
3446 netdev->features |= NETIF_F_HIGHDMA; 3466 netdev->features |= NETIF_F_HIGHDMA;