diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-11-15 10:29:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-16 17:43:10 -0500 |
commit | c8f44affb7244f2ac3e703cab13d55ede27621bb (patch) | |
tree | 62e7aea2916a8d7cab825fe500670c5113854c0f /drivers/net/ethernet/chelsio | |
parent | a59e2ecb859f2ab03bb2e230709f8039472ad2c3 (diff) |
net: introduce and use netdev_features_t for device features sets
v2: add couple missing conversions in drivers
split unexporting netdev_fix_features()
implemented %pNF
convert sock::sk_route_(no?)caps
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb/sge.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb/sge.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 8 |
6 files changed, 23 insertions, 17 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c index 26d0fd2d9c9d..a971796b2262 100644 --- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c +++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c | |||
@@ -850,7 +850,8 @@ static int t1_set_mac_addr(struct net_device *dev, void *p) | |||
850 | return 0; | 850 | return 0; |
851 | } | 851 | } |
852 | 852 | ||
853 | static u32 t1_fix_features(struct net_device *dev, u32 features) | 853 | static netdev_features_t t1_fix_features(struct net_device *dev, |
854 | netdev_features_t features) | ||
854 | { | 855 | { |
855 | /* | 856 | /* |
856 | * Since there is no support for separate rx/tx vlan accel | 857 | * Since there is no support for separate rx/tx vlan accel |
@@ -864,9 +865,9 @@ static u32 t1_fix_features(struct net_device *dev, u32 features) | |||
864 | return features; | 865 | return features; |
865 | } | 866 | } |
866 | 867 | ||
867 | static int t1_set_features(struct net_device *dev, u32 features) | 868 | static int t1_set_features(struct net_device *dev, netdev_features_t features) |
868 | { | 869 | { |
869 | u32 changed = dev->features ^ features; | 870 | netdev_features_t changed = dev->features ^ features; |
870 | struct adapter *adapter = dev->ml_priv; | 871 | struct adapter *adapter = dev->ml_priv; |
871 | 872 | ||
872 | if (changed & NETIF_F_HW_VLAN_RX) | 873 | if (changed & NETIF_F_HW_VLAN_RX) |
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index f9b602300040..47a84359d4e4 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c | |||
@@ -742,7 +742,7 @@ 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 | */ |
745 | void t1_vlan_mode(struct adapter *adapter, u32 features) | 745 | void t1_vlan_mode(struct adapter *adapter, netdev_features_t features) |
746 | { | 746 | { |
747 | struct sge *sge = adapter->sge; | 747 | struct sge *sge = adapter->sge; |
748 | 748 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.h b/drivers/net/ethernet/chelsio/cxgb/sge.h index e03980bcdd65..b9bf16b385f7 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.h +++ b/drivers/net/ethernet/chelsio/cxgb/sge.h | |||
@@ -79,7 +79,7 @@ irqreturn_t t1_interrupt(int irq, void *cookie); | |||
79 | int t1_poll(struct napi_struct *, int); | 79 | int t1_poll(struct napi_struct *, int); |
80 | 80 | ||
81 | netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev); | 81 | netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev); |
82 | void t1_vlan_mode(struct adapter *adapter, u32 features); | 82 | void t1_vlan_mode(struct adapter *adapter, netdev_features_t features); |
83 | void t1_sge_start(struct sge *); | 83 | void t1_sge_start(struct sge *); |
84 | void t1_sge_stop(struct sge *); | 84 | void t1_sge_stop(struct sge *); |
85 | int t1_sge_intr_error_handler(struct sge *); | 85 | int t1_sge_intr_error_handler(struct sge *); |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 053560da6347..63ffaa7e255f 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | |||
@@ -2532,7 +2532,7 @@ static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p) | |||
2532 | } | 2532 | } |
2533 | } | 2533 | } |
2534 | 2534 | ||
2535 | static void cxgb_vlan_mode(struct net_device *dev, u32 features) | 2535 | static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features) |
2536 | { | 2536 | { |
2537 | struct port_info *pi = netdev_priv(dev); | 2537 | struct port_info *pi = netdev_priv(dev); |
2538 | struct adapter *adapter = pi->adapter; | 2538 | struct adapter *adapter = pi->adapter; |
@@ -2553,7 +2553,8 @@ static void cxgb_vlan_mode(struct net_device *dev, u32 features) | |||
2553 | t3_synchronize_rx(adapter, pi); | 2553 | t3_synchronize_rx(adapter, pi); |
2554 | } | 2554 | } |
2555 | 2555 | ||
2556 | static u32 cxgb_fix_features(struct net_device *dev, u32 features) | 2556 | static netdev_features_t cxgb_fix_features(struct net_device *dev, |
2557 | netdev_features_t features) | ||
2557 | { | 2558 | { |
2558 | /* | 2559 | /* |
2559 | * Since there is no support for separate rx/tx vlan accel | 2560 | * Since there is no support for separate rx/tx vlan accel |
@@ -2567,9 +2568,9 @@ static u32 cxgb_fix_features(struct net_device *dev, u32 features) | |||
2567 | return features; | 2568 | return features; |
2568 | } | 2569 | } |
2569 | 2570 | ||
2570 | static int cxgb_set_features(struct net_device *dev, u32 features) | 2571 | static int cxgb_set_features(struct net_device *dev, netdev_features_t features) |
2571 | { | 2572 | { |
2572 | u32 changed = dev->features ^ features; | 2573 | netdev_features_t changed = dev->features ^ features; |
2573 | 2574 | ||
2574 | if (changed & NETIF_F_HW_VLAN_RX) | 2575 | if (changed & NETIF_F_HW_VLAN_RX) |
2575 | cxgb_vlan_mode(dev, features); | 2576 | cxgb_vlan_mode(dev, features); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 48ffe11d9aa9..fd6d460ea475 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -1856,10 +1856,10 @@ static int set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
1856 | return err; | 1856 | return err; |
1857 | } | 1857 | } |
1858 | 1858 | ||
1859 | static int cxgb_set_features(struct net_device *dev, u32 features) | 1859 | static int cxgb_set_features(struct net_device *dev, netdev_features_t features) |
1860 | { | 1860 | { |
1861 | const struct port_info *pi = netdev_priv(dev); | 1861 | const struct port_info *pi = netdev_priv(dev); |
1862 | u32 changed = dev->features ^ features; | 1862 | netdev_features_t changed = dev->features ^ features; |
1863 | int err; | 1863 | int err; |
1864 | 1864 | ||
1865 | if (!(changed & NETIF_F_HW_VLAN_RX)) | 1865 | if (!(changed & NETIF_F_HW_VLAN_RX)) |
@@ -3538,7 +3538,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3538 | { | 3538 | { |
3539 | int func, i, err; | 3539 | int func, i, err; |
3540 | struct port_info *pi; | 3540 | struct port_info *pi; |
3541 | unsigned int highdma = 0; | 3541 | bool highdma = false; |
3542 | struct adapter *adapter = NULL; | 3542 | struct adapter *adapter = NULL; |
3543 | 3543 | ||
3544 | printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION); | 3544 | printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION); |
@@ -3564,7 +3564,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3564 | } | 3564 | } |
3565 | 3565 | ||
3566 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 3566 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
3567 | highdma = NETIF_F_HIGHDMA; | 3567 | highdma = true; |
3568 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 3568 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
3569 | if (err) { | 3569 | if (err) { |
3570 | dev_err(&pdev->dev, "unable to obtain 64-bit DMA for " | 3570 | dev_err(&pdev->dev, "unable to obtain 64-bit DMA for " |
@@ -3638,7 +3638,9 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3638 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 3638 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
3639 | NETIF_F_RXCSUM | NETIF_F_RXHASH | | 3639 | NETIF_F_RXCSUM | NETIF_F_RXHASH | |
3640 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 3640 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
3641 | netdev->features |= netdev->hw_features | highdma; | 3641 | if (highdma) |
3642 | netdev->hw_features |= NETIF_F_HIGHDMA; | ||
3643 | netdev->features |= netdev->hw_features; | ||
3642 | netdev->vlan_features = netdev->features & VLAN_FEAT; | 3644 | netdev->vlan_features = netdev->features & VLAN_FEAT; |
3643 | 3645 | ||
3644 | netdev->priv_flags |= IFF_UNICAST_FLT; | 3646 | netdev->priv_flags |= IFF_UNICAST_FLT; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index ee81d8e798ea..8155cfecae19 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -1092,7 +1092,8 @@ static int cxgb4vf_change_mtu(struct net_device *dev, int new_mtu) | |||
1092 | return ret; | 1092 | return ret; |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | static u32 cxgb4vf_fix_features(struct net_device *dev, u32 features) | 1095 | static netdev_features_t cxgb4vf_fix_features(struct net_device *dev, |
1096 | netdev_features_t features) | ||
1096 | { | 1097 | { |
1097 | /* | 1098 | /* |
1098 | * Since there is no support for separate rx/tx vlan accel | 1099 | * Since there is no support for separate rx/tx vlan accel |
@@ -1106,10 +1107,11 @@ static u32 cxgb4vf_fix_features(struct net_device *dev, u32 features) | |||
1106 | return features; | 1107 | return features; |
1107 | } | 1108 | } |
1108 | 1109 | ||
1109 | static int cxgb4vf_set_features(struct net_device *dev, u32 features) | 1110 | static int cxgb4vf_set_features(struct net_device *dev, |
1111 | netdev_features_t features) | ||
1110 | { | 1112 | { |
1111 | struct port_info *pi = netdev_priv(dev); | 1113 | struct port_info *pi = netdev_priv(dev); |
1112 | u32 changed = dev->features ^ features; | 1114 | netdev_features_t changed = dev->features ^ features; |
1113 | 1115 | ||
1114 | if (changed & NETIF_F_HW_VLAN_RX) | 1116 | if (changed & NETIF_F_HW_VLAN_RX) |
1115 | t4vf_set_rxmode(pi->adapter, pi->viid, -1, -1, -1, -1, | 1117 | t4vf_set_rxmode(pi->adapter, pi->viid, -1, -1, -1, -1, |