aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-03-05 20:32:02 -0500
committerDavid S. Miller <davem@davemloft.net>2014-03-05 20:32:02 -0500
commit67ddc87f162e2d0e29db2b6b21c5a3fbcb8be206 (patch)
treec83ac73e3d569156d4b7f3dab3e7e27e0054cd0d /drivers/net/ethernet/brocade
parent6092c79fd00ce48ee8698955ea6419cc5cd65641 (diff)
parentc3bebc71c4bcdafa24b506adf0c1de3c1f77e2e0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/wireless/ath/ath9k/recv.c drivers/net/wireless/mwifiex/pcie.c net/ipv6/sit.c The SIT driver conflict consists of a bug fix being done by hand in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper was created (netdev_alloc_pcpu_stats()) which takes care of this. The two wireless conflicts were overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade')
-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 bf436d0a1094..aeec9ccc0b39 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
@@ -3240,11 +3243,6 @@ bnad_set_rx_mode(struct net_device *netdev)
3240 BNA_RXMODE_ALLMULTI; 3243 BNA_RXMODE_ALLMULTI;
3241 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL); 3244 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL);
3242 3245
3243 if (bnad->cfg_flags & BNAD_CF_PROMISC)
3244 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3245 else
3246 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3247
3248 spin_unlock_irqrestore(&bnad->bna_lock, flags); 3246 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3249} 3247}
3250 3248
@@ -3369,6 +3367,27 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
3369 return 0; 3367 return 0;
3370} 3368}
3371 3369
3370static int bnad_set_features(struct net_device *dev, netdev_features_t features)
3371{
3372 struct bnad *bnad = netdev_priv(dev);
3373 netdev_features_t changed = features ^ dev->features;
3374
3375 if ((changed & NETIF_F_HW_VLAN_CTAG_RX) && netif_running(dev)) {
3376 unsigned long flags;
3377
3378 spin_lock_irqsave(&bnad->bna_lock, flags);
3379
3380 if (features & NETIF_F_HW_VLAN_CTAG_RX)
3381 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3382 else
3383 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3384
3385 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3386 }
3387
3388 return 0;
3389}
3390
3372#ifdef CONFIG_NET_POLL_CONTROLLER 3391#ifdef CONFIG_NET_POLL_CONTROLLER
3373static void 3392static void
3374bnad_netpoll(struct net_device *netdev) 3393bnad_netpoll(struct net_device *netdev)
@@ -3416,6 +3435,7 @@ static const struct net_device_ops bnad_netdev_ops = {
3416 .ndo_change_mtu = bnad_change_mtu, 3435 .ndo_change_mtu = bnad_change_mtu,
3417 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid, 3436 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid,
3418 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid, 3437 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid,
3438 .ndo_set_features = bnad_set_features,
3419#ifdef CONFIG_NET_POLL_CONTROLLER 3439#ifdef CONFIG_NET_POLL_CONTROLLER
3420 .ndo_poll_controller = bnad_netpoll 3440 .ndo_poll_controller = bnad_netpoll
3421#endif 3441#endif
@@ -3428,14 +3448,14 @@ bnad_netdev_init(struct bnad *bnad, bool using_dac)
3428 3448
3429 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | 3449 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
3430 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3450 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3431 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX; 3451 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX |
3452 NETIF_F_HW_VLAN_CTAG_RX;
3432 3453
3433 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA | 3454 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA |
3434 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3455 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3435 NETIF_F_TSO | NETIF_F_TSO6; 3456 NETIF_F_TSO | NETIF_F_TSO6;
3436 3457
3437 netdev->features |= netdev->hw_features | 3458 netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
3438 NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
3439 3459
3440 if (using_dac) 3460 if (using_dac)
3441 netdev->features |= NETIF_F_HIGHDMA; 3461 netdev->features |= NETIF_F_HIGHDMA;