aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/chelsio/common.h2
-rw-r--r--drivers/net/chelsio/cxgb2.c39
-rw-r--r--drivers/net/chelsio/sge.c18
-rw-r--r--drivers/net/chelsio/sge.h2
4 files changed, 34 insertions, 27 deletions
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index c26d863e1697..5ccbed1784d2 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -240,8 +240,6 @@ struct adapter {
240 struct work_struct ext_intr_handler_task; 240 struct work_struct ext_intr_handler_task;
241 struct adapter_params params; 241 struct adapter_params params;
242 242
243 struct vlan_group *vlan_grp;
244
245 /* Terminator modules. */ 243 /* Terminator modules. */
246 struct sge *sge; 244 struct sge *sge;
247 struct peespi *espi; 245 struct peespi *espi;
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index b422d83f5343..3edbbc4c5112 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -263,6 +263,8 @@ static int cxgb_open(struct net_device *dev)
263 if (!other_ports && adapter->params.stats_update_period) 263 if (!other_ports && adapter->params.stats_update_period)
264 schedule_mac_stats_update(adapter, 264 schedule_mac_stats_update(adapter,
265 adapter->params.stats_update_period); 265 adapter->params.stats_update_period);
266
267 t1_vlan_mode(adapter, dev->features);
266 return 0; 268 return 0;
267} 269}
268 270
@@ -849,19 +851,30 @@ static int t1_set_mac_addr(struct net_device *dev, void *p)
849 return 0; 851 return 0;
850} 852}
851 853
852#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 854static u32 t1_fix_features(struct net_device *dev, u32 features)
853static void t1_vlan_rx_register(struct net_device *dev,
854 struct vlan_group *grp)
855{ 855{
856 struct adapter *adapter = dev->ml_priv; 856 /*
857 * Since there is no support for separate rx/tx vlan accel
858 * enable/disable make sure tx flag is always in same state as rx.
859 */
860 if (features & NETIF_F_HW_VLAN_RX)
861 features |= NETIF_F_HW_VLAN_TX;
862 else
863 features &= ~NETIF_F_HW_VLAN_TX;
857 864
858 spin_lock_irq(&adapter->async_lock); 865 return features;
859 adapter->vlan_grp = grp;
860 t1_set_vlan_accel(adapter, grp != NULL);
861 spin_unlock_irq(&adapter->async_lock);
862} 866}
863#endif
864 867
868static int t1_set_features(struct net_device *dev, u32 features)
869{
870 u32 changed = dev->features ^ features;
871 struct adapter *adapter = dev->ml_priv;
872
873 if (changed & NETIF_F_HW_VLAN_RX)
874 t1_vlan_mode(adapter, features);
875
876 return 0;
877}
865#ifdef CONFIG_NET_POLL_CONTROLLER 878#ifdef CONFIG_NET_POLL_CONTROLLER
866static void t1_netpoll(struct net_device *dev) 879static void t1_netpoll(struct net_device *dev)
867{ 880{
@@ -955,9 +968,8 @@ static const struct net_device_ops cxgb_netdev_ops = {
955 .ndo_do_ioctl = t1_ioctl, 968 .ndo_do_ioctl = t1_ioctl,
956 .ndo_change_mtu = t1_change_mtu, 969 .ndo_change_mtu = t1_change_mtu,
957 .ndo_set_mac_address = t1_set_mac_addr, 970 .ndo_set_mac_address = t1_set_mac_addr,
958#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 971 .ndo_fix_features = t1_fix_features,
959 .ndo_vlan_rx_register = t1_vlan_rx_register, 972 .ndo_set_features = t1_set_features,
960#endif
961#ifdef CONFIG_NET_POLL_CONTROLLER 973#ifdef CONFIG_NET_POLL_CONTROLLER
962 .ndo_poll_controller = t1_netpoll, 974 .ndo_poll_controller = t1_netpoll,
963#endif 975#endif
@@ -1080,10 +1092,9 @@ static int __devinit init_one(struct pci_dev *pdev,
1080 if (pci_using_dac) 1092 if (pci_using_dac)
1081 netdev->features |= NETIF_F_HIGHDMA; 1093 netdev->features |= NETIF_F_HIGHDMA;
1082 if (vlan_tso_capable(adapter)) { 1094 if (vlan_tso_capable(adapter)) {
1083#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
1084 netdev->features |= 1095 netdev->features |=
1085 NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1096 NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1086#endif 1097 netdev->hw_features |= NETIF_F_HW_VLAN_RX;
1087 1098
1088 /* T204: disable TSO */ 1099 /* T204: disable TSO */
1089 if (!(is_T2(adapter)) || bi->port_number != 4) { 1100 if (!(is_T2(adapter)) || bi->port_number != 4) {
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 58380d240619..e9a03fffef15 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -742,13 +742,14 @@ static inline void setup_ring_params(struct adapter *adapter, u64 addr,
742/* 742/*
743 * Enable/disable VLAN acceleration. 743 * Enable/disable VLAN acceleration.
744 */ 744 */
745void t1_set_vlan_accel(struct adapter *adapter, int on_off) 745void t1_vlan_mode(struct adapter *adapter, u32 features)
746{ 746{
747 struct sge *sge = adapter->sge; 747 struct sge *sge = adapter->sge;
748 748
749 sge->sge_control &= ~F_VLAN_XTRACT; 749 if (features & NETIF_F_HW_VLAN_RX)
750 if (on_off)
751 sge->sge_control |= F_VLAN_XTRACT; 750 sge->sge_control |= F_VLAN_XTRACT;
751 else
752 sge->sge_control &= ~F_VLAN_XTRACT;
752 if (adapter->open_device_map) { 753 if (adapter->open_device_map) {
753 writel(sge->sge_control, adapter->regs + A_SG_CONTROL); 754 writel(sge->sge_control, adapter->regs + A_SG_CONTROL);
754 readl(adapter->regs + A_SG_CONTROL); /* flush */ 755 readl(adapter->regs + A_SG_CONTROL); /* flush */
@@ -1397,12 +1398,11 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
1397 } else 1398 } else
1398 skb_checksum_none_assert(skb); 1399 skb_checksum_none_assert(skb);
1399 1400
1400 if (unlikely(adapter->vlan_grp && p->vlan_valid)) { 1401 if (p->vlan_valid) {
1401 st->vlan_xtract++; 1402 st->vlan_xtract++;
1402 vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, 1403 __vlan_hwaccel_put_tag(skb, ntohs(p->vlan));
1403 ntohs(p->vlan)); 1404 }
1404 } else 1405 netif_receive_skb(skb);
1405 netif_receive_skb(skb);
1406} 1406}
1407 1407
1408/* 1408/*
@@ -1875,13 +1875,11 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
1875 } 1875 }
1876 cpl->iff = dev->if_port; 1876 cpl->iff = dev->if_port;
1877 1877
1878#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
1879 if (vlan_tx_tag_present(skb)) { 1878 if (vlan_tx_tag_present(skb)) {
1880 cpl->vlan_valid = 1; 1879 cpl->vlan_valid = 1;
1881 cpl->vlan = htons(vlan_tx_tag_get(skb)); 1880 cpl->vlan = htons(vlan_tx_tag_get(skb));
1882 st->vlan_insert++; 1881 st->vlan_insert++;
1883 } else 1882 } else
1884#endif
1885 cpl->vlan_valid = 0; 1883 cpl->vlan_valid = 0;
1886 1884
1887send: 1885send:
diff --git a/drivers/net/chelsio/sge.h b/drivers/net/chelsio/sge.h
index 00cc37fc1f6f..e03980bcdd65 100644
--- a/drivers/net/chelsio/sge.h
+++ b/drivers/net/chelsio/sge.h
@@ -79,7 +79,7 @@ irqreturn_t t1_interrupt(int irq, void *cookie);
79int t1_poll(struct napi_struct *, int); 79int t1_poll(struct napi_struct *, int);
80 80
81netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev); 81netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
82void t1_set_vlan_accel(struct adapter *adapter, int on_off); 82void t1_vlan_mode(struct adapter *adapter, u32 features);
83void t1_sge_start(struct sge *); 83void t1_sge_start(struct sge *);
84void t1_sge_stop(struct sge *); 84void t1_sge_stop(struct sge *);
85int t1_sge_intr_error_handler(struct sge *); 85int t1_sge_intr_error_handler(struct sge *);