diff options
74 files changed, 305 insertions, 202 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b0c577256487..ac5337a04639 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1325,11 +1325,12 @@ static int bond_sethwaddr(struct net_device *bond_dev, | |||
1325 | return 0; | 1325 | return 0; |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | static u32 bond_fix_features(struct net_device *dev, u32 features) | 1328 | static netdev_features_t bond_fix_features(struct net_device *dev, |
1329 | netdev_features_t features) | ||
1329 | { | 1330 | { |
1330 | struct slave *slave; | 1331 | struct slave *slave; |
1331 | struct bonding *bond = netdev_priv(dev); | 1332 | struct bonding *bond = netdev_priv(dev); |
1332 | u32 mask; | 1333 | netdev_features_t mask; |
1333 | int i; | 1334 | int i; |
1334 | 1335 | ||
1335 | read_lock(&bond->lock); | 1336 | read_lock(&bond->lock); |
@@ -1363,7 +1364,7 @@ static void bond_compute_features(struct bonding *bond) | |||
1363 | { | 1364 | { |
1364 | struct slave *slave; | 1365 | struct slave *slave; |
1365 | struct net_device *bond_dev = bond->dev; | 1366 | struct net_device *bond_dev = bond->dev; |
1366 | u32 vlan_features = BOND_VLAN_FEATURES; | 1367 | netdev_features_t vlan_features = BOND_VLAN_FEATURES; |
1367 | unsigned short max_hard_header_len = ETH_HLEN; | 1368 | unsigned short max_hard_header_len = ETH_HLEN; |
1368 | int i; | 1369 | int i; |
1369 | 1370 | ||
@@ -1897,7 +1898,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1897 | struct bonding *bond = netdev_priv(bond_dev); | 1898 | struct bonding *bond = netdev_priv(bond_dev); |
1898 | struct slave *slave, *oldcurrent; | 1899 | struct slave *slave, *oldcurrent; |
1899 | struct sockaddr addr; | 1900 | struct sockaddr addr; |
1900 | u32 old_features = bond_dev->features; | 1901 | netdev_features_t old_features = bond_dev->features; |
1901 | 1902 | ||
1902 | /* slave is not a slave or master is not master of this slave */ | 1903 | /* slave is not a slave or master is not master of this slave */ |
1903 | if (!(slave_dev->flags & IFF_SLAVE) || | 1904 | if (!(slave_dev->flags & IFF_SLAVE) || |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 02c7ed8d9eca..b8591246eb4c 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -411,7 +411,7 @@ static void atl1c_set_multi(struct net_device *netdev) | |||
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
414 | static void __atl1c_vlan_mode(u32 features, u32 *mac_ctrl_data) | 414 | static void __atl1c_vlan_mode(netdev_features_t features, u32 *mac_ctrl_data) |
415 | { | 415 | { |
416 | if (features & NETIF_F_HW_VLAN_RX) { | 416 | if (features & NETIF_F_HW_VLAN_RX) { |
417 | /* enable VLAN tag insert/strip */ | 417 | /* enable VLAN tag insert/strip */ |
@@ -422,7 +422,8 @@ static void __atl1c_vlan_mode(u32 features, u32 *mac_ctrl_data) | |||
422 | } | 422 | } |
423 | } | 423 | } |
424 | 424 | ||
425 | static void atl1c_vlan_mode(struct net_device *netdev, u32 features) | 425 | static void atl1c_vlan_mode(struct net_device *netdev, |
426 | netdev_features_t features) | ||
426 | { | 427 | { |
427 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 428 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
428 | struct pci_dev *pdev = adapter->pdev; | 429 | struct pci_dev *pdev = adapter->pdev; |
@@ -482,7 +483,8 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, | |||
482 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; | 483 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; |
483 | } | 484 | } |
484 | 485 | ||
485 | static u32 atl1c_fix_features(struct net_device *netdev, u32 features) | 486 | static netdev_features_t atl1c_fix_features(struct net_device *netdev, |
487 | netdev_features_t features) | ||
486 | { | 488 | { |
487 | /* | 489 | /* |
488 | * Since there is no support for separate rx/tx vlan accel | 490 | * Since there is no support for separate rx/tx vlan accel |
@@ -499,9 +501,10 @@ static u32 atl1c_fix_features(struct net_device *netdev, u32 features) | |||
499 | return features; | 501 | return features; |
500 | } | 502 | } |
501 | 503 | ||
502 | static int atl1c_set_features(struct net_device *netdev, u32 features) | 504 | static int atl1c_set_features(struct net_device *netdev, |
505 | netdev_features_t features) | ||
503 | { | 506 | { |
504 | u32 changed = netdev->features ^ features; | 507 | netdev_features_t changed = netdev->features ^ features; |
505 | 508 | ||
506 | if (changed & NETIF_F_HW_VLAN_RX) | 509 | if (changed & NETIF_F_HW_VLAN_RX) |
507 | atl1c_vlan_mode(netdev, features); | 510 | atl1c_vlan_mode(netdev, features); |
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c index 95483bcac1d0..c915c0873810 100644 --- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c +++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c | |||
@@ -313,7 +313,7 @@ static void atl1e_set_multi(struct net_device *netdev) | |||
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | static void __atl1e_vlan_mode(u32 features, u32 *mac_ctrl_data) | 316 | static void __atl1e_vlan_mode(netdev_features_t features, u32 *mac_ctrl_data) |
317 | { | 317 | { |
318 | if (features & NETIF_F_HW_VLAN_RX) { | 318 | if (features & NETIF_F_HW_VLAN_RX) { |
319 | /* enable VLAN tag insert/strip */ | 319 | /* enable VLAN tag insert/strip */ |
@@ -324,7 +324,8 @@ static void __atl1e_vlan_mode(u32 features, u32 *mac_ctrl_data) | |||
324 | } | 324 | } |
325 | } | 325 | } |
326 | 326 | ||
327 | static void atl1e_vlan_mode(struct net_device *netdev, u32 features) | 327 | static void atl1e_vlan_mode(struct net_device *netdev, |
328 | netdev_features_t features) | ||
328 | { | 329 | { |
329 | struct atl1e_adapter *adapter = netdev_priv(netdev); | 330 | struct atl1e_adapter *adapter = netdev_priv(netdev); |
330 | u32 mac_ctrl_data = 0; | 331 | u32 mac_ctrl_data = 0; |
@@ -370,7 +371,8 @@ static int atl1e_set_mac_addr(struct net_device *netdev, void *p) | |||
370 | return 0; | 371 | return 0; |
371 | } | 372 | } |
372 | 373 | ||
373 | static u32 atl1e_fix_features(struct net_device *netdev, u32 features) | 374 | static netdev_features_t atl1e_fix_features(struct net_device *netdev, |
375 | netdev_features_t features) | ||
374 | { | 376 | { |
375 | /* | 377 | /* |
376 | * Since there is no support for separate rx/tx vlan accel | 378 | * Since there is no support for separate rx/tx vlan accel |
@@ -384,9 +386,10 @@ static u32 atl1e_fix_features(struct net_device *netdev, u32 features) | |||
384 | return features; | 386 | return features; |
385 | } | 387 | } |
386 | 388 | ||
387 | static int atl1e_set_features(struct net_device *netdev, u32 features) | 389 | static int atl1e_set_features(struct net_device *netdev, |
390 | netdev_features_t features) | ||
388 | { | 391 | { |
389 | u32 changed = netdev->features ^ features; | 392 | netdev_features_t changed = netdev->features ^ features; |
390 | 393 | ||
391 | if (changed & NETIF_F_HW_VLAN_RX) | 394 | if (changed & NETIF_F_HW_VLAN_RX) |
392 | atl1e_vlan_mode(netdev, features); | 395 | atl1e_vlan_mode(netdev, features); |
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c index db3f43046d32..071f4c858969 100644 --- a/drivers/net/ethernet/atheros/atlx/atl2.c +++ b/drivers/net/ethernet/atheros/atlx/atl2.c | |||
@@ -361,7 +361,7 @@ static inline void atl2_irq_disable(struct atl2_adapter *adapter) | |||
361 | synchronize_irq(adapter->pdev->irq); | 361 | synchronize_irq(adapter->pdev->irq); |
362 | } | 362 | } |
363 | 363 | ||
364 | static void __atl2_vlan_mode(u32 features, u32 *ctrl) | 364 | static void __atl2_vlan_mode(netdev_features_t features, u32 *ctrl) |
365 | { | 365 | { |
366 | if (features & NETIF_F_HW_VLAN_RX) { | 366 | if (features & NETIF_F_HW_VLAN_RX) { |
367 | /* enable VLAN tag insert/strip */ | 367 | /* enable VLAN tag insert/strip */ |
@@ -372,7 +372,8 @@ static void __atl2_vlan_mode(u32 features, u32 *ctrl) | |||
372 | } | 372 | } |
373 | } | 373 | } |
374 | 374 | ||
375 | static void atl2_vlan_mode(struct net_device *netdev, u32 features) | 375 | static void atl2_vlan_mode(struct net_device *netdev, |
376 | netdev_features_t features) | ||
376 | { | 377 | { |
377 | struct atl2_adapter *adapter = netdev_priv(netdev); | 378 | struct atl2_adapter *adapter = netdev_priv(netdev); |
378 | u32 ctrl; | 379 | u32 ctrl; |
@@ -391,7 +392,8 @@ static void atl2_restore_vlan(struct atl2_adapter *adapter) | |||
391 | atl2_vlan_mode(adapter->netdev, adapter->netdev->features); | 392 | atl2_vlan_mode(adapter->netdev, adapter->netdev->features); |
392 | } | 393 | } |
393 | 394 | ||
394 | static u32 atl2_fix_features(struct net_device *netdev, u32 features) | 395 | static netdev_features_t atl2_fix_features(struct net_device *netdev, |
396 | netdev_features_t features) | ||
395 | { | 397 | { |
396 | /* | 398 | /* |
397 | * Since there is no support for separate rx/tx vlan accel | 399 | * Since there is no support for separate rx/tx vlan accel |
@@ -405,9 +407,10 @@ static u32 atl2_fix_features(struct net_device *netdev, u32 features) | |||
405 | return features; | 407 | return features; |
406 | } | 408 | } |
407 | 409 | ||
408 | static int atl2_set_features(struct net_device *netdev, u32 features) | 410 | static int atl2_set_features(struct net_device *netdev, |
411 | netdev_features_t features) | ||
409 | { | 412 | { |
410 | u32 changed = netdev->features ^ features; | 413 | netdev_features_t changed = netdev->features ^ features; |
411 | 414 | ||
412 | if (changed & NETIF_F_HW_VLAN_RX) | 415 | if (changed & NETIF_F_HW_VLAN_RX) |
413 | atl2_vlan_mode(netdev, features); | 416 | atl2_vlan_mode(netdev, features); |
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c index aabcf4b5745a..8ff7411094d5 100644 --- a/drivers/net/ethernet/atheros/atlx/atlx.c +++ b/drivers/net/ethernet/atheros/atlx/atlx.c | |||
@@ -211,7 +211,7 @@ static void atlx_link_chg_task(struct work_struct *work) | |||
211 | spin_unlock_irqrestore(&adapter->lock, flags); | 211 | spin_unlock_irqrestore(&adapter->lock, flags); |
212 | } | 212 | } |
213 | 213 | ||
214 | static void __atlx_vlan_mode(u32 features, u32 *ctrl) | 214 | static void __atlx_vlan_mode(netdev_features_t features, u32 *ctrl) |
215 | { | 215 | { |
216 | if (features & NETIF_F_HW_VLAN_RX) { | 216 | if (features & NETIF_F_HW_VLAN_RX) { |
217 | /* enable VLAN tag insert/strip */ | 217 | /* enable VLAN tag insert/strip */ |
@@ -222,7 +222,8 @@ static void __atlx_vlan_mode(u32 features, u32 *ctrl) | |||
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | static void atlx_vlan_mode(struct net_device *netdev, u32 features) | 225 | static void atlx_vlan_mode(struct net_device *netdev, |
226 | netdev_features_t features) | ||
226 | { | 227 | { |
227 | struct atlx_adapter *adapter = netdev_priv(netdev); | 228 | struct atlx_adapter *adapter = netdev_priv(netdev); |
228 | unsigned long flags; | 229 | unsigned long flags; |
@@ -242,7 +243,8 @@ static void atlx_restore_vlan(struct atlx_adapter *adapter) | |||
242 | atlx_vlan_mode(adapter->netdev, adapter->netdev->features); | 243 | atlx_vlan_mode(adapter->netdev, adapter->netdev->features); |
243 | } | 244 | } |
244 | 245 | ||
245 | static u32 atlx_fix_features(struct net_device *netdev, u32 features) | 246 | static netdev_features_t atlx_fix_features(struct net_device *netdev, |
247 | netdev_features_t features) | ||
246 | { | 248 | { |
247 | /* | 249 | /* |
248 | * Since there is no support for separate rx/tx vlan accel | 250 | * Since there is no support for separate rx/tx vlan accel |
@@ -256,9 +258,10 @@ static u32 atlx_fix_features(struct net_device *netdev, u32 features) | |||
256 | return features; | 258 | return features; |
257 | } | 259 | } |
258 | 260 | ||
259 | static int atlx_set_features(struct net_device *netdev, u32 features) | 261 | static int atlx_set_features(struct net_device *netdev, |
262 | netdev_features_t features) | ||
260 | { | 263 | { |
261 | u32 changed = netdev->features ^ features; | 264 | netdev_features_t changed = netdev->features ^ features; |
262 | 265 | ||
263 | if (changed & NETIF_F_HW_VLAN_RX) | 266 | if (changed & NETIF_F_HW_VLAN_RX) |
264 | atlx_vlan_mode(netdev, features); | 267 | atlx_vlan_mode(netdev, features); |
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 32d1f92a2479..7203f37d2ef3 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c | |||
@@ -7571,8 +7571,8 @@ bnx2_set_phys_id(struct net_device *dev, enum ethtool_phys_id_state state) | |||
7571 | return 0; | 7571 | return 0; |
7572 | } | 7572 | } |
7573 | 7573 | ||
7574 | static u32 | 7574 | static netdev_features_t |
7575 | bnx2_fix_features(struct net_device *dev, u32 features) | 7575 | bnx2_fix_features(struct net_device *dev, netdev_features_t features) |
7576 | { | 7576 | { |
7577 | struct bnx2 *bp = netdev_priv(dev); | 7577 | struct bnx2 *bp = netdev_priv(dev); |
7578 | 7578 | ||
@@ -7583,7 +7583,7 @@ bnx2_fix_features(struct net_device *dev, u32 features) | |||
7583 | } | 7583 | } |
7584 | 7584 | ||
7585 | static int | 7585 | static int |
7586 | bnx2_set_features(struct net_device *dev, u32 features) | 7586 | bnx2_set_features(struct net_device *dev, netdev_features_t features) |
7587 | { | 7587 | { |
7588 | struct bnx2 *bp = netdev_priv(dev); | 7588 | struct bnx2 *bp = netdev_priv(dev); |
7589 | 7589 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 0d60b9e633ad..8336c784db49 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -3398,7 +3398,8 @@ int bnx2x_change_mtu(struct net_device *dev, int new_mtu) | |||
3398 | return bnx2x_reload_if_running(dev); | 3398 | return bnx2x_reload_if_running(dev); |
3399 | } | 3399 | } |
3400 | 3400 | ||
3401 | u32 bnx2x_fix_features(struct net_device *dev, u32 features) | 3401 | netdev_features_t bnx2x_fix_features(struct net_device *dev, |
3402 | netdev_features_t features) | ||
3402 | { | 3403 | { |
3403 | struct bnx2x *bp = netdev_priv(dev); | 3404 | struct bnx2x *bp = netdev_priv(dev); |
3404 | 3405 | ||
@@ -3409,7 +3410,7 @@ u32 bnx2x_fix_features(struct net_device *dev, u32 features) | |||
3409 | return features; | 3410 | return features; |
3410 | } | 3411 | } |
3411 | 3412 | ||
3412 | int bnx2x_set_features(struct net_device *dev, u32 features) | 3413 | int bnx2x_set_features(struct net_device *dev, netdev_features_t features) |
3413 | { | 3414 | { |
3414 | struct bnx2x *bp = netdev_priv(dev); | 3415 | struct bnx2x *bp = netdev_priv(dev); |
3415 | u32 flags = bp->flags; | 3416 | u32 flags = bp->flags; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index 41eb17e7720f..80c5ed08e419 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -533,8 +533,9 @@ int bnx2x_change_mtu(struct net_device *dev, int new_mtu); | |||
533 | */ | 533 | */ |
534 | int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type); | 534 | int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type); |
535 | #endif | 535 | #endif |
536 | u32 bnx2x_fix_features(struct net_device *dev, u32 features); | 536 | netdev_features_t bnx2x_fix_features(struct net_device *dev, |
537 | int bnx2x_set_features(struct net_device *dev, u32 features); | 537 | netdev_features_t features); |
538 | int bnx2x_set_features(struct net_device *dev, netdev_features_t features); | ||
538 | 539 | ||
539 | /** | 540 | /** |
540 | * bnx2x_tx_timeout - tx timeout netdev callback | 541 | * bnx2x_tx_timeout - tx timeout netdev callback |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index cd3623416a4e..365cd47e2298 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -6968,7 +6968,7 @@ static int tg3_phy_lpbk_set(struct tg3 *tp, u32 speed, bool extlpbk) | |||
6968 | return 0; | 6968 | return 0; |
6969 | } | 6969 | } |
6970 | 6970 | ||
6971 | static void tg3_set_loopback(struct net_device *dev, u32 features) | 6971 | static void tg3_set_loopback(struct net_device *dev, netdev_features_t features) |
6972 | { | 6972 | { |
6973 | struct tg3 *tp = netdev_priv(dev); | 6973 | struct tg3 *tp = netdev_priv(dev); |
6974 | 6974 | ||
@@ -6994,7 +6994,8 @@ static void tg3_set_loopback(struct net_device *dev, u32 features) | |||
6994 | } | 6994 | } |
6995 | } | 6995 | } |
6996 | 6996 | ||
6997 | static u32 tg3_fix_features(struct net_device *dev, u32 features) | 6997 | static netdev_features_t tg3_fix_features(struct net_device *dev, |
6998 | netdev_features_t features) | ||
6998 | { | 6999 | { |
6999 | struct tg3 *tp = netdev_priv(dev); | 7000 | struct tg3 *tp = netdev_priv(dev); |
7000 | 7001 | ||
@@ -7004,9 +7005,9 @@ static u32 tg3_fix_features(struct net_device *dev, u32 features) | |||
7004 | return features; | 7005 | return features; |
7005 | } | 7006 | } |
7006 | 7007 | ||
7007 | static int tg3_set_features(struct net_device *dev, u32 features) | 7008 | static int tg3_set_features(struct net_device *dev, netdev_features_t features) |
7008 | { | 7009 | { |
7009 | u32 changed = dev->features ^ features; | 7010 | netdev_features_t changed = dev->features ^ features; |
7010 | 7011 | ||
7011 | if ((changed & NETIF_F_LOOPBACK) && netif_running(dev)) | 7012 | if ((changed & NETIF_F_LOOPBACK) && netif_running(dev)) |
7012 | tg3_set_loopback(dev, features); | 7013 | tg3_set_loopback(dev, features); |
@@ -15313,7 +15314,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
15313 | u32 sndmbx, rcvmbx, intmbx; | 15314 | u32 sndmbx, rcvmbx, intmbx; |
15314 | char str[40]; | 15315 | char str[40]; |
15315 | u64 dma_mask, persist_dma_mask; | 15316 | u64 dma_mask, persist_dma_mask; |
15316 | u32 features = 0; | 15317 | netdev_features_t features = 0; |
15317 | 15318 | ||
15318 | printk_once(KERN_INFO "%s\n", version); | 15319 | printk_once(KERN_INFO "%s\n", version); |
15319 | 15320 | ||
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, |
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 438f4580bf66..26be1dfc1577 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
@@ -474,10 +474,11 @@ static int dm9000_nway_reset(struct net_device *dev) | |||
474 | return mii_nway_restart(&dm->mii); | 474 | return mii_nway_restart(&dm->mii); |
475 | } | 475 | } |
476 | 476 | ||
477 | static int dm9000_set_features(struct net_device *dev, u32 features) | 477 | static int dm9000_set_features(struct net_device *dev, |
478 | netdev_features_t features) | ||
478 | { | 479 | { |
479 | board_info_t *dm = to_dm9000_board(dev); | 480 | board_info_t *dm = to_dm9000_board(dev); |
480 | u32 changed = dev->features ^ features; | 481 | netdev_features_t changed = dev->features ^ features; |
481 | unsigned long flags; | 482 | unsigned long flags; |
482 | 483 | ||
483 | if (!(changed & NETIF_F_RXCSUM)) | 484 | if (!(changed & NETIF_F_RXCSUM)) |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 83199fd0d62b..ff3e8b0f0da3 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -2306,7 +2306,7 @@ void gfar_check_rx_parser_mode(struct gfar_private *priv) | |||
2306 | } | 2306 | } |
2307 | 2307 | ||
2308 | /* Enables and disables VLAN insertion/extraction */ | 2308 | /* Enables and disables VLAN insertion/extraction */ |
2309 | void gfar_vlan_mode(struct net_device *dev, u32 features) | 2309 | void gfar_vlan_mode(struct net_device *dev, netdev_features_t features) |
2310 | { | 2310 | { |
2311 | struct gfar_private *priv = netdev_priv(dev); | 2311 | struct gfar_private *priv = netdev_priv(dev); |
2312 | struct gfar __iomem *regs = NULL; | 2312 | struct gfar __iomem *regs = NULL; |
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 9aa43773e8e3..cda6cb2eb1d2 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h | |||
@@ -1179,9 +1179,9 @@ extern void gfar_phy_test(struct mii_bus *bus, struct phy_device *phydev, | |||
1179 | extern void gfar_configure_coalescing(struct gfar_private *priv, | 1179 | extern void gfar_configure_coalescing(struct gfar_private *priv, |
1180 | unsigned long tx_mask, unsigned long rx_mask); | 1180 | unsigned long tx_mask, unsigned long rx_mask); |
1181 | void gfar_init_sysfs(struct net_device *dev); | 1181 | void gfar_init_sysfs(struct net_device *dev); |
1182 | int gfar_set_features(struct net_device *dev, u32 features); | 1182 | int gfar_set_features(struct net_device *dev, netdev_features_t features); |
1183 | extern void gfar_check_rx_parser_mode(struct gfar_private *priv); | 1183 | extern void gfar_check_rx_parser_mode(struct gfar_private *priv); |
1184 | extern void gfar_vlan_mode(struct net_device *dev, u32 features); | 1184 | extern void gfar_vlan_mode(struct net_device *dev, netdev_features_t features); |
1185 | 1185 | ||
1186 | extern const struct ethtool_ops gfar_ethtool_ops; | 1186 | extern const struct ethtool_ops gfar_ethtool_ops; |
1187 | 1187 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 212736bab6bb..1ea0eb9ee643 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c | |||
@@ -519,12 +519,12 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva | |||
519 | return err; | 519 | return err; |
520 | } | 520 | } |
521 | 521 | ||
522 | int gfar_set_features(struct net_device *dev, u32 features) | 522 | int gfar_set_features(struct net_device *dev, netdev_features_t features) |
523 | { | 523 | { |
524 | struct gfar_private *priv = netdev_priv(dev); | 524 | struct gfar_private *priv = netdev_priv(dev); |
525 | unsigned long flags; | 525 | unsigned long flags; |
526 | int err = 0, i = 0; | 526 | int err = 0, i = 0; |
527 | u32 changed = dev->features ^ features; | 527 | netdev_features_t changed = dev->features ^ features; |
528 | 528 | ||
529 | if (changed & (NETIF_F_HW_VLAN_TX|NETIF_F_HW_VLAN_RX)) | 529 | if (changed & (NETIF_F_HW_VLAN_TX|NETIF_F_HW_VLAN_RX)) |
530 | gfar_vlan_mode(dev, features); | 530 | gfar_vlan_mode(dev, features); |
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index b1cd41b9c61c..e877371680a9 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
@@ -735,7 +735,8 @@ static void netdev_get_drvinfo(struct net_device *dev, | |||
735 | sizeof(info->version) - 1); | 735 | sizeof(info->version) - 1); |
736 | } | 736 | } |
737 | 737 | ||
738 | static u32 ibmveth_fix_features(struct net_device *dev, u32 features) | 738 | static netdev_features_t ibmveth_fix_features(struct net_device *dev, |
739 | netdev_features_t features) | ||
739 | { | 740 | { |
740 | /* | 741 | /* |
741 | * Since the ibmveth firmware interface does not have the | 742 | * Since the ibmveth firmware interface does not have the |
@@ -838,7 +839,8 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data) | |||
838 | return rc1 ? rc1 : rc2; | 839 | return rc1 ? rc1 : rc2; |
839 | } | 840 | } |
840 | 841 | ||
841 | static int ibmveth_set_features(struct net_device *dev, u32 features) | 842 | static int ibmveth_set_features(struct net_device *dev, |
843 | netdev_features_t features) | ||
842 | { | 844 | { |
843 | struct ibmveth_adapter *adapter = netdev_priv(dev); | 845 | struct ibmveth_adapter *adapter = netdev_priv(dev); |
844 | int rx_csum = !!(features & NETIF_F_RXCSUM); | 846 | int rx_csum = !!(features & NETIF_F_RXCSUM); |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index cf480b554622..82f4ef142259 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -167,7 +167,8 @@ static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, | |||
167 | struct sk_buff *skb); | 167 | struct sk_buff *skb); |
168 | 168 | ||
169 | static bool e1000_vlan_used(struct e1000_adapter *adapter); | 169 | static bool e1000_vlan_used(struct e1000_adapter *adapter); |
170 | static void e1000_vlan_mode(struct net_device *netdev, u32 features); | 170 | static void e1000_vlan_mode(struct net_device *netdev, |
171 | netdev_features_t features); | ||
171 | static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); | 172 | static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); |
172 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); | 173 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); |
173 | static void e1000_restore_vlan(struct e1000_adapter *adapter); | 174 | static void e1000_restore_vlan(struct e1000_adapter *adapter); |
@@ -806,7 +807,8 @@ static int e1000_is_need_ioport(struct pci_dev *pdev) | |||
806 | } | 807 | } |
807 | } | 808 | } |
808 | 809 | ||
809 | static u32 e1000_fix_features(struct net_device *netdev, u32 features) | 810 | static netdev_features_t e1000_fix_features(struct net_device *netdev, |
811 | netdev_features_t features) | ||
810 | { | 812 | { |
811 | /* | 813 | /* |
812 | * Since there is no support for separate rx/tx vlan accel | 814 | * Since there is no support for separate rx/tx vlan accel |
@@ -820,10 +822,11 @@ static u32 e1000_fix_features(struct net_device *netdev, u32 features) | |||
820 | return features; | 822 | return features; |
821 | } | 823 | } |
822 | 824 | ||
823 | static int e1000_set_features(struct net_device *netdev, u32 features) | 825 | static int e1000_set_features(struct net_device *netdev, |
826 | netdev_features_t features) | ||
824 | { | 827 | { |
825 | struct e1000_adapter *adapter = netdev_priv(netdev); | 828 | struct e1000_adapter *adapter = netdev_priv(netdev); |
826 | u32 changed = features ^ netdev->features; | 829 | netdev_features_t changed = features ^ netdev->features; |
827 | 830 | ||
828 | if (changed & NETIF_F_HW_VLAN_RX) | 831 | if (changed & NETIF_F_HW_VLAN_RX) |
829 | e1000_vlan_mode(netdev, features); | 832 | e1000_vlan_mode(netdev, features); |
@@ -4577,7 +4580,8 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, | |||
4577 | e1000_irq_enable(adapter); | 4580 | e1000_irq_enable(adapter); |
4578 | } | 4581 | } |
4579 | 4582 | ||
4580 | static void e1000_vlan_mode(struct net_device *netdev, u32 features) | 4583 | static void e1000_vlan_mode(struct net_device *netdev, |
4584 | netdev_features_t features) | ||
4581 | { | 4585 | { |
4582 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4586 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4583 | struct e1000_hw *hw = &adapter->hw; | 4587 | struct e1000_hw *hw = &adapter->hw; |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index a855db1ad249..d85fac626a80 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -5859,10 +5859,11 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter) | |||
5859 | } | 5859 | } |
5860 | } | 5860 | } |
5861 | 5861 | ||
5862 | static int e1000_set_features(struct net_device *netdev, u32 features) | 5862 | static int e1000_set_features(struct net_device *netdev, |
5863 | netdev_features_t features) | ||
5863 | { | 5864 | { |
5864 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5865 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5865 | u32 changed = features ^ netdev->features; | 5866 | netdev_features_t changed = features ^ netdev->features; |
5866 | 5867 | ||
5867 | if (changed & (NETIF_F_TSO | NETIF_F_TSO6)) | 5868 | if (changed & (NETIF_F_TSO | NETIF_F_TSO6)) |
5868 | adapter->flags |= FLAG_TSO_FORCE; | 5869 | adapter->flags |= FLAG_TSO_FORCE; |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index ced544499f1b..1fcba22c6403 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -145,7 +145,7 @@ static bool igb_clean_rx_irq(struct igb_q_vector *, int); | |||
145 | static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); | 145 | static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); |
146 | static void igb_tx_timeout(struct net_device *); | 146 | static void igb_tx_timeout(struct net_device *); |
147 | static void igb_reset_task(struct work_struct *); | 147 | static void igb_reset_task(struct work_struct *); |
148 | static void igb_vlan_mode(struct net_device *netdev, u32 features); | 148 | static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features); |
149 | static void igb_vlan_rx_add_vid(struct net_device *, u16); | 149 | static void igb_vlan_rx_add_vid(struct net_device *, u16); |
150 | static void igb_vlan_rx_kill_vid(struct net_device *, u16); | 150 | static void igb_vlan_rx_kill_vid(struct net_device *, u16); |
151 | static void igb_restore_vlan(struct igb_adapter *); | 151 | static void igb_restore_vlan(struct igb_adapter *); |
@@ -1742,7 +1742,8 @@ void igb_reset(struct igb_adapter *adapter) | |||
1742 | igb_get_phy_info(hw); | 1742 | igb_get_phy_info(hw); |
1743 | } | 1743 | } |
1744 | 1744 | ||
1745 | static u32 igb_fix_features(struct net_device *netdev, u32 features) | 1745 | static netdev_features_t igb_fix_features(struct net_device *netdev, |
1746 | netdev_features_t features) | ||
1746 | { | 1747 | { |
1747 | /* | 1748 | /* |
1748 | * Since there is no support for separate rx/tx vlan accel | 1749 | * Since there is no support for separate rx/tx vlan accel |
@@ -1756,9 +1757,10 @@ static u32 igb_fix_features(struct net_device *netdev, u32 features) | |||
1756 | return features; | 1757 | return features; |
1757 | } | 1758 | } |
1758 | 1759 | ||
1759 | static int igb_set_features(struct net_device *netdev, u32 features) | 1760 | static int igb_set_features(struct net_device *netdev, |
1761 | netdev_features_t features) | ||
1760 | { | 1762 | { |
1761 | u32 changed = netdev->features ^ features; | 1763 | netdev_features_t changed = netdev->features ^ features; |
1762 | 1764 | ||
1763 | if (changed & NETIF_F_HW_VLAN_RX) | 1765 | if (changed & NETIF_F_HW_VLAN_RX) |
1764 | igb_vlan_mode(netdev, features); | 1766 | igb_vlan_mode(netdev, features); |
@@ -6467,7 +6469,7 @@ s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value) | |||
6467 | return 0; | 6469 | return 0; |
6468 | } | 6470 | } |
6469 | 6471 | ||
6470 | static void igb_vlan_mode(struct net_device *netdev, u32 features) | 6472 | static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features) |
6471 | { | 6473 | { |
6472 | struct igb_adapter *adapter = netdev_priv(netdev); | 6474 | struct igb_adapter *adapter = netdev_priv(netdev); |
6473 | struct e1000_hw *hw = &adapter->hw; | 6475 | struct e1000_hw *hw = &adapter->hw; |
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index cca78124be31..2a05658938bd 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -2532,7 +2532,8 @@ static void igbvf_print_device_info(struct igbvf_adapter *adapter) | |||
2532 | dev_info(&pdev->dev, "Address: %pM\n", netdev->dev_addr); | 2532 | dev_info(&pdev->dev, "Address: %pM\n", netdev->dev_addr); |
2533 | } | 2533 | } |
2534 | 2534 | ||
2535 | static int igbvf_set_features(struct net_device *netdev, u32 features) | 2535 | static int igbvf_set_features(struct net_device *netdev, |
2536 | netdev_features_t features) | ||
2536 | { | 2537 | { |
2537 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 2538 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
2538 | 2539 | ||
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c index e21148f8b160..247cf9219e03 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c | |||
@@ -325,8 +325,8 @@ ixgb_reset(struct ixgb_adapter *adapter) | |||
325 | } | 325 | } |
326 | } | 326 | } |
327 | 327 | ||
328 | static u32 | 328 | static netdev_features_t |
329 | ixgb_fix_features(struct net_device *netdev, u32 features) | 329 | ixgb_fix_features(struct net_device *netdev, netdev_features_t features) |
330 | { | 330 | { |
331 | /* | 331 | /* |
332 | * Tx VLAN insertion does not work per HW design when Rx stripping is | 332 | * Tx VLAN insertion does not work per HW design when Rx stripping is |
@@ -339,10 +339,10 @@ ixgb_fix_features(struct net_device *netdev, u32 features) | |||
339 | } | 339 | } |
340 | 340 | ||
341 | static int | 341 | static int |
342 | ixgb_set_features(struct net_device *netdev, u32 features) | 342 | ixgb_set_features(struct net_device *netdev, netdev_features_t features) |
343 | { | 343 | { |
344 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 344 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
345 | u32 changed = features ^ netdev->features; | 345 | netdev_features_t changed = features ^ netdev->features; |
346 | 346 | ||
347 | if (!(changed & (NETIF_F_RXCSUM|NETIF_F_HW_VLAN_RX))) | 347 | if (!(changed & (NETIF_F_RXCSUM|NETIF_F_HW_VLAN_RX))) |
348 | return 0; | 348 | return 0; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 8ef92d1a6aa1..820fc040c241 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -7174,7 +7174,8 @@ void ixgbe_do_reset(struct net_device *netdev) | |||
7174 | ixgbe_reset(adapter); | 7174 | ixgbe_reset(adapter); |
7175 | } | 7175 | } |
7176 | 7176 | ||
7177 | static u32 ixgbe_fix_features(struct net_device *netdev, u32 data) | 7177 | static netdev_features_t ixgbe_fix_features(struct net_device *netdev, |
7178 | netdev_features_t data) | ||
7178 | { | 7179 | { |
7179 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 7180 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
7180 | 7181 | ||
@@ -7204,7 +7205,8 @@ static u32 ixgbe_fix_features(struct net_device *netdev, u32 data) | |||
7204 | return data; | 7205 | return data; |
7205 | } | 7206 | } |
7206 | 7207 | ||
7207 | static int ixgbe_set_features(struct net_device *netdev, u32 data) | 7208 | static int ixgbe_set_features(struct net_device *netdev, |
7209 | netdev_features_t data) | ||
7208 | { | 7210 | { |
7209 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 7211 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
7210 | bool need_reset = false; | 7212 | bool need_reset = false; |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 4c8e19951d57..3e6ec088c50d 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -3249,7 +3249,8 @@ static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev, | |||
3249 | return stats; | 3249 | return stats; |
3250 | } | 3250 | } |
3251 | 3251 | ||
3252 | static int ixgbevf_set_features(struct net_device *netdev, u32 features) | 3252 | static int ixgbevf_set_features(struct net_device *netdev, |
3253 | netdev_features_t features) | ||
3253 | { | 3254 | { |
3254 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 3255 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
3255 | 3256 | ||
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 7d88c7c28a7c..df3ab831b1ad 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
@@ -1917,7 +1917,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx) | |||
1917 | struct jme_ring *txring = &(jme->txring[0]); | 1917 | struct jme_ring *txring = &(jme->txring[0]); |
1918 | struct txdesc *txdesc = txring->desc, *ctxdesc; | 1918 | struct txdesc *txdesc = txring->desc, *ctxdesc; |
1919 | struct jme_buffer_info *txbi = txring->bufinf, *ctxbi; | 1919 | struct jme_buffer_info *txbi = txring->bufinf, *ctxbi; |
1920 | u8 hidma = jme->dev->features & NETIF_F_HIGHDMA; | 1920 | u8 hidma = !!(jme->dev->features & NETIF_F_HIGHDMA); |
1921 | int i, nr_frags = skb_shinfo(skb)->nr_frags; | 1921 | int i, nr_frags = skb_shinfo(skb)->nr_frags; |
1922 | int mask = jme->tx_ring_mask; | 1922 | int mask = jme->tx_ring_mask; |
1923 | const struct skb_frag_struct *frag; | 1923 | const struct skb_frag_struct *frag; |
@@ -2620,8 +2620,8 @@ jme_set_msglevel(struct net_device *netdev, u32 value) | |||
2620 | jme->msg_enable = value; | 2620 | jme->msg_enable = value; |
2621 | } | 2621 | } |
2622 | 2622 | ||
2623 | static u32 | 2623 | static netdev_features_t |
2624 | jme_fix_features(struct net_device *netdev, u32 features) | 2624 | jme_fix_features(struct net_device *netdev, netdev_features_t features) |
2625 | { | 2625 | { |
2626 | if (netdev->mtu > 1900) | 2626 | if (netdev->mtu > 1900) |
2627 | features &= ~(NETIF_F_ALL_TSO | NETIF_F_ALL_CSUM); | 2627 | features &= ~(NETIF_F_ALL_TSO | NETIF_F_ALL_CSUM); |
@@ -2629,7 +2629,7 @@ jme_fix_features(struct net_device *netdev, u32 features) | |||
2629 | } | 2629 | } |
2630 | 2630 | ||
2631 | static int | 2631 | static int |
2632 | jme_set_features(struct net_device *netdev, u32 features) | 2632 | jme_set_features(struct net_device *netdev, netdev_features_t features) |
2633 | { | 2633 | { |
2634 | struct jme_adapter *jme = netdev_priv(netdev); | 2634 | struct jme_adapter *jme = netdev_priv(netdev); |
2635 | 2635 | ||
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index f6b4304ca459..157c5c17fdcc 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -1579,10 +1579,10 @@ mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er) | |||
1579 | 1579 | ||
1580 | 1580 | ||
1581 | static int | 1581 | static int |
1582 | mv643xx_eth_set_features(struct net_device *dev, u32 features) | 1582 | mv643xx_eth_set_features(struct net_device *dev, netdev_features_t features) |
1583 | { | 1583 | { |
1584 | struct mv643xx_eth_private *mp = netdev_priv(dev); | 1584 | struct mv643xx_eth_private *mp = netdev_priv(dev); |
1585 | u32 rx_csum = features & NETIF_F_RXCSUM; | 1585 | int rx_csum = !!(features & NETIF_F_RXCSUM); |
1586 | 1586 | ||
1587 | wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000); | 1587 | wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000); |
1588 | 1588 | ||
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index 553d1a315b3a..c79dc5447658 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c | |||
@@ -1275,7 +1275,7 @@ static void rx_set_checksum(struct sky2_port *sky2) | |||
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | /* Enable/disable receive hash calculation (RSS) */ | 1277 | /* Enable/disable receive hash calculation (RSS) */ |
1278 | static void rx_set_rss(struct net_device *dev, u32 features) | 1278 | static void rx_set_rss(struct net_device *dev, netdev_features_t features) |
1279 | { | 1279 | { |
1280 | struct sky2_port *sky2 = netdev_priv(dev); | 1280 | struct sky2_port *sky2 = netdev_priv(dev); |
1281 | struct sky2_hw *hw = sky2->hw; | 1281 | struct sky2_hw *hw = sky2->hw; |
@@ -1396,7 +1396,7 @@ static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1396 | 1396 | ||
1397 | #define SKY2_VLAN_OFFLOADS (NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO) | 1397 | #define SKY2_VLAN_OFFLOADS (NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO) |
1398 | 1398 | ||
1399 | static void sky2_vlan_mode(struct net_device *dev, u32 features) | 1399 | static void sky2_vlan_mode(struct net_device *dev, netdev_features_t features) |
1400 | { | 1400 | { |
1401 | struct sky2_port *sky2 = netdev_priv(dev); | 1401 | struct sky2_port *sky2 = netdev_priv(dev); |
1402 | struct sky2_hw *hw = sky2->hw; | 1402 | struct sky2_hw *hw = sky2->hw; |
@@ -4282,7 +4282,8 @@ static int sky2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom | |||
4282 | return sky2_vpd_write(sky2->hw, cap, data, eeprom->offset, eeprom->len); | 4282 | return sky2_vpd_write(sky2->hw, cap, data, eeprom->offset, eeprom->len); |
4283 | } | 4283 | } |
4284 | 4284 | ||
4285 | static u32 sky2_fix_features(struct net_device *dev, u32 features) | 4285 | static netdev_features_t sky2_fix_features(struct net_device *dev, |
4286 | netdev_features_t features) | ||
4286 | { | 4287 | { |
4287 | const struct sky2_port *sky2 = netdev_priv(dev); | 4288 | const struct sky2_port *sky2 = netdev_priv(dev); |
4288 | const struct sky2_hw *hw = sky2->hw; | 4289 | const struct sky2_hw *hw = sky2->hw; |
@@ -4306,13 +4307,13 @@ static u32 sky2_fix_features(struct net_device *dev, u32 features) | |||
4306 | return features; | 4307 | return features; |
4307 | } | 4308 | } |
4308 | 4309 | ||
4309 | static int sky2_set_features(struct net_device *dev, u32 features) | 4310 | static int sky2_set_features(struct net_device *dev, netdev_features_t features) |
4310 | { | 4311 | { |
4311 | struct sky2_port *sky2 = netdev_priv(dev); | 4312 | struct sky2_port *sky2 = netdev_priv(dev); |
4312 | u32 changed = dev->features ^ features; | 4313 | netdev_features_t changed = dev->features ^ features; |
4313 | 4314 | ||
4314 | if (changed & NETIF_F_RXCSUM) { | 4315 | if (changed & NETIF_F_RXCSUM) { |
4315 | u32 on = features & NETIF_F_RXCSUM; | 4316 | int on = !!(features & NETIF_F_RXCSUM); |
4316 | sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), | 4317 | sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), |
4317 | on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); | 4318 | on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); |
4318 | } | 4319 | } |
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index 3b67fe65404a..8d846bd09711 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c | |||
@@ -6588,7 +6588,8 @@ static void netdev_get_ethtool_stats(struct net_device *dev, | |||
6588 | * | 6588 | * |
6589 | * Return 0 if successful; otherwise an error code. | 6589 | * Return 0 if successful; otherwise an error code. |
6590 | */ | 6590 | */ |
6591 | static int netdev_set_features(struct net_device *dev, u32 features) | 6591 | static int netdev_set_features(struct net_device *dev, |
6592 | netdev_features_t features) | ||
6592 | { | 6593 | { |
6593 | struct dev_priv *priv = netdev_priv(dev); | 6594 | struct dev_priv *priv = netdev_priv(dev); |
6594 | struct dev_info *hw_priv = priv->adapter; | 6595 | struct dev_info *hw_priv = priv->adapter; |
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index 0778edcf7b9a..20b72ecb020a 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c | |||
@@ -1491,7 +1491,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget) | |||
1491 | * access to avoid theoretical race condition with functions that | 1491 | * access to avoid theoretical race condition with functions that |
1492 | * change NETIF_F_LRO flag at runtime. | 1492 | * change NETIF_F_LRO flag at runtime. |
1493 | */ | 1493 | */ |
1494 | bool lro_enabled = ACCESS_ONCE(mgp->dev->features) & NETIF_F_LRO; | 1494 | bool lro_enabled = !!(ACCESS_ONCE(mgp->dev->features) & NETIF_F_LRO); |
1495 | 1495 | ||
1496 | while (rx_done->entry[idx].length != 0 && work_done < budget) { | 1496 | while (rx_done->entry[idx].length != 0 && work_done < budget) { |
1497 | length = ntohs(rx_done->entry[idx].length); | 1497 | length = ntohs(rx_done->entry[idx].length); |
@@ -3149,7 +3149,8 @@ static int myri10ge_set_mac_address(struct net_device *dev, void *addr) | |||
3149 | return 0; | 3149 | return 0; |
3150 | } | 3150 | } |
3151 | 3151 | ||
3152 | static u32 myri10ge_fix_features(struct net_device *dev, u32 features) | 3152 | static netdev_features_t myri10ge_fix_features(struct net_device *dev, |
3153 | netdev_features_t features) | ||
3153 | { | 3154 | { |
3154 | if (!(features & NETIF_F_RXCSUM)) | 3155 | if (!(features & NETIF_F_RXCSUM)) |
3155 | features &= ~NETIF_F_LRO; | 3156 | features &= ~NETIF_F_LRO; |
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c index e6c90a5ac5d4..76ae47627200 100644 --- a/drivers/net/ethernet/neterion/s2io.c +++ b/drivers/net/ethernet/neterion/s2io.c | |||
@@ -6616,10 +6616,10 @@ static void s2io_ethtool_get_strings(struct net_device *dev, | |||
6616 | } | 6616 | } |
6617 | } | 6617 | } |
6618 | 6618 | ||
6619 | static int s2io_set_features(struct net_device *dev, u32 features) | 6619 | static int s2io_set_features(struct net_device *dev, netdev_features_t features) |
6620 | { | 6620 | { |
6621 | struct s2io_nic *sp = netdev_priv(dev); | 6621 | struct s2io_nic *sp = netdev_priv(dev); |
6622 | u32 changed = (features ^ dev->features) & NETIF_F_LRO; | 6622 | netdev_features_t changed = (features ^ dev->features) & NETIF_F_LRO; |
6623 | 6623 | ||
6624 | if (changed && netif_running(dev)) { | 6624 | if (changed && netif_running(dev)) { |
6625 | int rc; | 6625 | int rc; |
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index a83197d757c1..16d4d8e913c3 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c | |||
@@ -2662,9 +2662,10 @@ static void vxge_poll_vp_lockup(unsigned long data) | |||
2662 | mod_timer(&vdev->vp_lockup_timer, jiffies + HZ / 1000); | 2662 | mod_timer(&vdev->vp_lockup_timer, jiffies + HZ / 1000); |
2663 | } | 2663 | } |
2664 | 2664 | ||
2665 | static u32 vxge_fix_features(struct net_device *dev, u32 features) | 2665 | static netdev_features_t vxge_fix_features(struct net_device *dev, |
2666 | netdev_features_t features) | ||
2666 | { | 2667 | { |
2667 | u32 changed = dev->features ^ features; | 2668 | netdev_features_t changed = dev->features ^ features; |
2668 | 2669 | ||
2669 | /* Enabling RTH requires some of the logic in vxge_device_register and a | 2670 | /* Enabling RTH requires some of the logic in vxge_device_register and a |
2670 | * vpath reset. Due to these restrictions, only allow modification | 2671 | * vpath reset. Due to these restrictions, only allow modification |
@@ -2676,10 +2677,10 @@ static u32 vxge_fix_features(struct net_device *dev, u32 features) | |||
2676 | return features; | 2677 | return features; |
2677 | } | 2678 | } |
2678 | 2679 | ||
2679 | static int vxge_set_features(struct net_device *dev, u32 features) | 2680 | static int vxge_set_features(struct net_device *dev, netdev_features_t features) |
2680 | { | 2681 | { |
2681 | struct vxgedev *vdev = netdev_priv(dev); | 2682 | struct vxgedev *vdev = netdev_priv(dev); |
2682 | u32 changed = dev->features ^ features; | 2683 | netdev_features_t changed = dev->features ^ features; |
2683 | 2684 | ||
2684 | if (!(changed & NETIF_F_RXHASH)) | 2685 | if (!(changed & NETIF_F_RXHASH)) |
2685 | return 0; | 2686 | return 0; |
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index e8a5ae356407..01bb7bfe14e6 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c | |||
@@ -4536,7 +4536,7 @@ static int nv_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam* | |||
4536 | return 0; | 4536 | return 0; |
4537 | } | 4537 | } |
4538 | 4538 | ||
4539 | static int nv_set_loopback(struct net_device *dev, u32 features) | 4539 | static int nv_set_loopback(struct net_device *dev, netdev_features_t features) |
4540 | { | 4540 | { |
4541 | struct fe_priv *np = netdev_priv(dev); | 4541 | struct fe_priv *np = netdev_priv(dev); |
4542 | unsigned long flags; | 4542 | unsigned long flags; |
@@ -4591,7 +4591,8 @@ static int nv_set_loopback(struct net_device *dev, u32 features) | |||
4591 | return retval; | 4591 | return retval; |
4592 | } | 4592 | } |
4593 | 4593 | ||
4594 | static u32 nv_fix_features(struct net_device *dev, u32 features) | 4594 | static netdev_features_t nv_fix_features(struct net_device *dev, |
4595 | netdev_features_t features) | ||
4595 | { | 4596 | { |
4596 | /* vlan is dependent on rx checksum offload */ | 4597 | /* vlan is dependent on rx checksum offload */ |
4597 | if (features & (NETIF_F_HW_VLAN_TX|NETIF_F_HW_VLAN_RX)) | 4598 | if (features & (NETIF_F_HW_VLAN_TX|NETIF_F_HW_VLAN_RX)) |
@@ -4600,7 +4601,7 @@ static u32 nv_fix_features(struct net_device *dev, u32 features) | |||
4600 | return features; | 4601 | return features; |
4601 | } | 4602 | } |
4602 | 4603 | ||
4603 | static void nv_vlan_mode(struct net_device *dev, u32 features) | 4604 | static void nv_vlan_mode(struct net_device *dev, netdev_features_t features) |
4604 | { | 4605 | { |
4605 | struct fe_priv *np = get_nvpriv(dev); | 4606 | struct fe_priv *np = get_nvpriv(dev); |
4606 | 4607 | ||
@@ -4621,11 +4622,11 @@ static void nv_vlan_mode(struct net_device *dev, u32 features) | |||
4621 | spin_unlock_irq(&np->lock); | 4622 | spin_unlock_irq(&np->lock); |
4622 | } | 4623 | } |
4623 | 4624 | ||
4624 | static int nv_set_features(struct net_device *dev, u32 features) | 4625 | static int nv_set_features(struct net_device *dev, netdev_features_t features) |
4625 | { | 4626 | { |
4626 | struct fe_priv *np = netdev_priv(dev); | 4627 | struct fe_priv *np = netdev_priv(dev); |
4627 | u8 __iomem *base = get_hwbase(dev); | 4628 | u8 __iomem *base = get_hwbase(dev); |
4628 | u32 changed = dev->features ^ features; | 4629 | netdev_features_t changed = dev->features ^ features; |
4629 | int retval; | 4630 | int retval; |
4630 | 4631 | ||
4631 | if ((changed & NETIF_F_LOOPBACK) && netif_running(dev)) { | 4632 | if ((changed & NETIF_F_LOOPBACK) && netif_running(dev)) { |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c index 48406ca382f1..964e9c0948bc 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | |||
@@ -2109,10 +2109,11 @@ static int pch_gbe_change_mtu(struct net_device *netdev, int new_mtu) | |||
2109 | * Returns | 2109 | * Returns |
2110 | * 0: HW state updated successfully | 2110 | * 0: HW state updated successfully |
2111 | */ | 2111 | */ |
2112 | static int pch_gbe_set_features(struct net_device *netdev, u32 features) | 2112 | static int pch_gbe_set_features(struct net_device *netdev, |
2113 | netdev_features_t features) | ||
2113 | { | 2114 | { |
2114 | struct pch_gbe_adapter *adapter = netdev_priv(netdev); | 2115 | struct pch_gbe_adapter *adapter = netdev_priv(netdev); |
2115 | u32 changed = features ^ netdev->features; | 2116 | netdev_features_t changed = features ^ netdev->features; |
2116 | 2117 | ||
2117 | if (!(changed & NETIF_F_RXCSUM)) | 2118 | if (!(changed & NETIF_F_RXCSUM)) |
2118 | return 0; | 2119 | return 0; |
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index 8cf3173ba488..7dd9a4b107e6 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | |||
@@ -544,7 +544,8 @@ static void netxen_set_multicast_list(struct net_device *dev) | |||
544 | adapter->set_multi(dev); | 544 | adapter->set_multi(dev); |
545 | } | 545 | } |
546 | 546 | ||
547 | static u32 netxen_fix_features(struct net_device *dev, u32 features) | 547 | static netdev_features_t netxen_fix_features(struct net_device *dev, |
548 | netdev_features_t features) | ||
548 | { | 549 | { |
549 | if (!(features & NETIF_F_RXCSUM)) { | 550 | if (!(features & NETIF_F_RXCSUM)) { |
550 | netdev_info(dev, "disabling LRO as RXCSUM is off\n"); | 551 | netdev_info(dev, "disabling LRO as RXCSUM is off\n"); |
@@ -555,7 +556,8 @@ static u32 netxen_fix_features(struct net_device *dev, u32 features) | |||
555 | return features; | 556 | return features; |
556 | } | 557 | } |
557 | 558 | ||
558 | static int netxen_set_features(struct net_device *dev, u32 features) | 559 | static int netxen_set_features(struct net_device *dev, |
560 | netdev_features_t features) | ||
559 | { | 561 | { |
560 | struct netxen_adapter *adapter = netdev_priv(dev); | 562 | struct netxen_adapter *adapter = netdev_priv(dev); |
561 | int hw_lro; | 563 | int hw_lro; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index 7ed53dbb8646..60976fc4ccc6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -1466,8 +1466,9 @@ void qlcnic_advert_link_change(struct qlcnic_adapter *adapter, int linkup); | |||
1466 | 1466 | ||
1467 | int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu); | 1467 | int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu); |
1468 | int qlcnic_change_mtu(struct net_device *netdev, int new_mtu); | 1468 | int qlcnic_change_mtu(struct net_device *netdev, int new_mtu); |
1469 | u32 qlcnic_fix_features(struct net_device *netdev, u32 features); | 1469 | netdev_features_t qlcnic_fix_features(struct net_device *netdev, |
1470 | int qlcnic_set_features(struct net_device *netdev, u32 features); | 1470 | netdev_features_t features); |
1471 | int qlcnic_set_features(struct net_device *netdev, netdev_features_t features); | ||
1471 | int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable); | 1472 | int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable); |
1472 | int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable); | 1473 | int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable); |
1473 | int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter); | 1474 | int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index bcb81e47543a..b528e52a8ee1 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -817,12 +817,13 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu) | |||
817 | } | 817 | } |
818 | 818 | ||
819 | 819 | ||
820 | u32 qlcnic_fix_features(struct net_device *netdev, u32 features) | 820 | netdev_features_t qlcnic_fix_features(struct net_device *netdev, |
821 | netdev_features_t features) | ||
821 | { | 822 | { |
822 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 823 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
823 | 824 | ||
824 | if ((adapter->flags & QLCNIC_ESWITCH_ENABLED)) { | 825 | if ((adapter->flags & QLCNIC_ESWITCH_ENABLED)) { |
825 | u32 changed = features ^ netdev->features; | 826 | netdev_features_t changed = features ^ netdev->features; |
826 | features ^= changed & (NETIF_F_ALL_CSUM | NETIF_F_RXCSUM); | 827 | features ^= changed & (NETIF_F_ALL_CSUM | NETIF_F_RXCSUM); |
827 | } | 828 | } |
828 | 829 | ||
@@ -833,10 +834,10 @@ u32 qlcnic_fix_features(struct net_device *netdev, u32 features) | |||
833 | } | 834 | } |
834 | 835 | ||
835 | 836 | ||
836 | int qlcnic_set_features(struct net_device *netdev, u32 features) | 837 | int qlcnic_set_features(struct net_device *netdev, netdev_features_t features) |
837 | { | 838 | { |
838 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 839 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
839 | u32 changed = netdev->features ^ features; | 840 | netdev_features_t changed = netdev->features ^ features; |
840 | int hw_lro = (features & NETIF_F_LRO) ? QLCNIC_LRO_ENABLED : 0; | 841 | int hw_lro = (features & NETIF_F_LRO) ? QLCNIC_LRO_ENABLED : 0; |
841 | 842 | ||
842 | if (!(changed & NETIF_F_LRO)) | 843 | if (!(changed & NETIF_F_LRO)) |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 0bd163828e33..823f845ddc04 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -792,7 +792,7 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter, | |||
792 | struct qlcnic_esw_func_cfg *esw_cfg) | 792 | struct qlcnic_esw_func_cfg *esw_cfg) |
793 | { | 793 | { |
794 | struct net_device *netdev = adapter->netdev; | 794 | struct net_device *netdev = adapter->netdev; |
795 | unsigned long features, vlan_features; | 795 | netdev_features_t features, vlan_features; |
796 | 796 | ||
797 | features = (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | | 797 | features = (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | |
798 | NETIF_F_IPV6_CSUM | NETIF_F_GRO); | 798 | NETIF_F_IPV6_CSUM | NETIF_F_GRO); |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index c92afcd912e2..1ce4e08037b8 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -2307,7 +2307,7 @@ static int ql_napi_poll_msix(struct napi_struct *napi, int budget) | |||
2307 | return work_done; | 2307 | return work_done; |
2308 | } | 2308 | } |
2309 | 2309 | ||
2310 | static void qlge_vlan_mode(struct net_device *ndev, u32 features) | 2310 | static void qlge_vlan_mode(struct net_device *ndev, netdev_features_t features) |
2311 | { | 2311 | { |
2312 | struct ql_adapter *qdev = netdev_priv(ndev); | 2312 | struct ql_adapter *qdev = netdev_priv(ndev); |
2313 | 2313 | ||
@@ -2323,7 +2323,8 @@ static void qlge_vlan_mode(struct net_device *ndev, u32 features) | |||
2323 | } | 2323 | } |
2324 | } | 2324 | } |
2325 | 2325 | ||
2326 | static u32 qlge_fix_features(struct net_device *ndev, u32 features) | 2326 | static netdev_features_t qlge_fix_features(struct net_device *ndev, |
2327 | netdev_features_t features) | ||
2327 | { | 2328 | { |
2328 | /* | 2329 | /* |
2329 | * Since there is no support for separate rx/tx vlan accel | 2330 | * Since there is no support for separate rx/tx vlan accel |
@@ -2337,9 +2338,10 @@ static u32 qlge_fix_features(struct net_device *ndev, u32 features) | |||
2337 | return features; | 2338 | return features; |
2338 | } | 2339 | } |
2339 | 2340 | ||
2340 | static int qlge_set_features(struct net_device *ndev, u32 features) | 2341 | static int qlge_set_features(struct net_device *ndev, |
2342 | netdev_features_t features) | ||
2341 | { | 2343 | { |
2342 | u32 changed = ndev->features ^ features; | 2344 | netdev_features_t changed = ndev->features ^ features; |
2343 | 2345 | ||
2344 | if (changed & NETIF_F_HW_VLAN_RX) | 2346 | if (changed & NETIF_F_HW_VLAN_RX) |
2345 | qlge_vlan_mode(ndev, features); | 2347 | qlge_vlan_mode(ndev, features); |
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index 6cfc5dc0f76e..87cff10f7be7 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -1392,7 +1392,7 @@ static void cp_set_msglevel(struct net_device *dev, u32 value) | |||
1392 | cp->msg_enable = value; | 1392 | cp->msg_enable = value; |
1393 | } | 1393 | } |
1394 | 1394 | ||
1395 | static int cp_set_features(struct net_device *dev, u32 features) | 1395 | static int cp_set_features(struct net_device *dev, netdev_features_t features) |
1396 | { | 1396 | { |
1397 | struct cp_private *cp = netdev_priv(dev); | 1397 | struct cp_private *cp = netdev_priv(dev); |
1398 | unsigned long flags; | 1398 | unsigned long flags; |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index cdf66d68d849..2dfb0c0ea01b 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -1553,7 +1553,8 @@ static int rtl8169_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1553 | return ret; | 1553 | return ret; |
1554 | } | 1554 | } |
1555 | 1555 | ||
1556 | static u32 rtl8169_fix_features(struct net_device *dev, u32 features) | 1556 | static netdev_features_t rtl8169_fix_features(struct net_device *dev, |
1557 | netdev_features_t features) | ||
1557 | { | 1558 | { |
1558 | struct rtl8169_private *tp = netdev_priv(dev); | 1559 | struct rtl8169_private *tp = netdev_priv(dev); |
1559 | 1560 | ||
@@ -1567,7 +1568,8 @@ static u32 rtl8169_fix_features(struct net_device *dev, u32 features) | |||
1567 | return features; | 1568 | return features; |
1568 | } | 1569 | } |
1569 | 1570 | ||
1570 | static int rtl8169_set_features(struct net_device *dev, u32 features) | 1571 | static int rtl8169_set_features(struct net_device *dev, |
1572 | netdev_features_t features) | ||
1571 | { | 1573 | { |
1572 | struct rtl8169_private *tp = netdev_priv(dev); | 1574 | struct rtl8169_private *tp = netdev_priv(dev); |
1573 | void __iomem *ioaddr = tp->mmio_addr; | 1575 | void __iomem *ioaddr = tp->mmio_addr; |
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index d5731f1fe6d6..14e134d3b4d7 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -1900,7 +1900,7 @@ static void efx_set_multicast_list(struct net_device *net_dev) | |||
1900 | /* Otherwise efx_start_port() will do this */ | 1900 | /* Otherwise efx_start_port() will do this */ |
1901 | } | 1901 | } |
1902 | 1902 | ||
1903 | static int efx_set_features(struct net_device *net_dev, u32 data) | 1903 | static int efx_set_features(struct net_device *net_dev, netdev_features_t data) |
1904 | { | 1904 | { |
1905 | struct efx_nic *efx = netdev_priv(net_dev); | 1905 | struct efx_nic *efx = netdev_priv(net_dev); |
1906 | 1906 | ||
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index b8e251a1ee48..c49502bab6a3 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -908,7 +908,7 @@ struct efx_nic_type { | |||
908 | unsigned int phys_addr_channels; | 908 | unsigned int phys_addr_channels; |
909 | unsigned int tx_dc_base; | 909 | unsigned int tx_dc_base; |
910 | unsigned int rx_dc_base; | 910 | unsigned int rx_dc_base; |
911 | u32 offload_features; | 911 | netdev_features_t offload_features; |
912 | }; | 912 | }; |
913 | 913 | ||
914 | /************************************************************************** | 914 | /************************************************************************** |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 20546bbbb8db..643ca97a2d9a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1419,7 +1419,8 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) | |||
1419 | return 0; | 1419 | return 0; |
1420 | } | 1420 | } |
1421 | 1421 | ||
1422 | static u32 stmmac_fix_features(struct net_device *dev, u32 features) | 1422 | static netdev_features_t stmmac_fix_features(struct net_device *dev, |
1423 | netdev_features_t features) | ||
1423 | { | 1424 | { |
1424 | struct stmmac_priv *priv = netdev_priv(dev); | 1425 | struct stmmac_priv *priv = netdev_priv(dev); |
1425 | 1426 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 8592523b0bb5..3dd13d606d00 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -123,7 +123,7 @@ struct tun_struct { | |||
123 | gid_t group; | 123 | gid_t group; |
124 | 124 | ||
125 | struct net_device *dev; | 125 | struct net_device *dev; |
126 | u32 set_features; | 126 | netdev_features_t set_features; |
127 | #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ | 127 | #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ |
128 | NETIF_F_TSO6|NETIF_F_UFO) | 128 | NETIF_F_TSO6|NETIF_F_UFO) |
129 | struct fasync_struct *fasync; | 129 | struct fasync_struct *fasync; |
@@ -454,7 +454,8 @@ tun_net_change_mtu(struct net_device *dev, int new_mtu) | |||
454 | return 0; | 454 | return 0; |
455 | } | 455 | } |
456 | 456 | ||
457 | static u32 tun_net_fix_features(struct net_device *dev, u32 features) | 457 | static netdev_features_t tun_net_fix_features(struct net_device *dev, |
458 | netdev_features_t features) | ||
458 | { | 459 | { |
459 | struct tun_struct *tun = netdev_priv(dev); | 460 | struct tun_struct *tun = netdev_priv(dev); |
460 | 461 | ||
@@ -1196,7 +1197,7 @@ static int tun_get_iff(struct net *net, struct tun_struct *tun, | |||
1196 | * privs required. */ | 1197 | * privs required. */ |
1197 | static int set_offload(struct tun_struct *tun, unsigned long arg) | 1198 | static int set_offload(struct tun_struct *tun, unsigned long arg) |
1198 | { | 1199 | { |
1199 | u32 features = 0; | 1200 | netdev_features_t features = 0; |
1200 | 1201 | ||
1201 | if (arg & TUN_F_CSUM) { | 1202 | if (arg & TUN_F_CSUM) { |
1202 | features |= NETIF_F_HW_CSUM; | 1203 | features |= NETIF_F_HW_CSUM; |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index a5b9b12ef268..7d62c39f65cf 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -728,7 +728,8 @@ static int smsc75xx_change_mtu(struct net_device *netdev, int new_mtu) | |||
728 | } | 728 | } |
729 | 729 | ||
730 | /* Enable or disable Rx checksum offload engine */ | 730 | /* Enable or disable Rx checksum offload engine */ |
731 | static int smsc75xx_set_features(struct net_device *netdev, u32 features) | 731 | static int smsc75xx_set_features(struct net_device *netdev, |
732 | netdev_features_t features) | ||
732 | { | 733 | { |
733 | struct usbnet *dev = netdev_priv(netdev); | 734 | struct usbnet *dev = netdev_priv(netdev); |
734 | struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]); | 735 | struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]); |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index eff67678c5a6..56f3894d701a 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -516,7 +516,8 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) | |||
516 | } | 516 | } |
517 | 517 | ||
518 | /* Enable or disable Tx & Rx checksum offload engines */ | 518 | /* Enable or disable Tx & Rx checksum offload engines */ |
519 | static int smsc95xx_set_features(struct net_device *netdev, u32 features) | 519 | static int smsc95xx_set_features(struct net_device *netdev, |
520 | netdev_features_t features) | ||
520 | { | 521 | { |
521 | struct usbnet *dev = netdev_priv(netdev); | 522 | struct usbnet *dev = netdev_priv(netdev); |
522 | u32 read_buf; | 523 | u32 read_buf; |
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index e662cbc8bfbd..77f723415c9c 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c | |||
@@ -262,11 +262,11 @@ vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) | |||
262 | } | 262 | } |
263 | } | 263 | } |
264 | 264 | ||
265 | int vmxnet3_set_features(struct net_device *netdev, u32 features) | 265 | int vmxnet3_set_features(struct net_device *netdev, netdev_features_t features) |
266 | { | 266 | { |
267 | struct vmxnet3_adapter *adapter = netdev_priv(netdev); | 267 | struct vmxnet3_adapter *adapter = netdev_priv(netdev); |
268 | unsigned long flags; | 268 | unsigned long flags; |
269 | u32 changed = features ^ netdev->features; | 269 | netdev_features_t changed = features ^ netdev->features; |
270 | 270 | ||
271 | if (changed & (NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_RX)) { | 271 | if (changed & (NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_RX)) { |
272 | if (features & NETIF_F_RXCSUM) | 272 | if (features & NETIF_F_RXCSUM) |
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index b18eac1dccaa..ed54797db191 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h +++ b/drivers/net/vmxnet3/vmxnet3_int.h | |||
@@ -401,7 +401,7 @@ void | |||
401 | vmxnet3_rq_destroy_all(struct vmxnet3_adapter *adapter); | 401 | vmxnet3_rq_destroy_all(struct vmxnet3_adapter *adapter); |
402 | 402 | ||
403 | int | 403 | int |
404 | vmxnet3_set_features(struct net_device *netdev, u32 features); | 404 | vmxnet3_set_features(struct net_device *netdev, netdev_features_t features); |
405 | 405 | ||
406 | int | 406 | int |
407 | vmxnet3_create_queues(struct vmxnet3_adapter *adapter, | 407 | vmxnet3_create_queues(struct vmxnet3_adapter *adapter, |
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 182562952c79..0b5c18feb303 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -165,7 +165,8 @@ static int xenvif_change_mtu(struct net_device *dev, int mtu) | |||
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
168 | static u32 xenvif_fix_features(struct net_device *dev, u32 features) | 168 | static netdev_features_t xenvif_fix_features(struct net_device *dev, |
169 | netdev_features_t features) | ||
169 | { | 170 | { |
170 | struct xenvif *vif = netdev_priv(dev); | 171 | struct xenvif *vif = netdev_priv(dev); |
171 | 172 | ||
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 226faab23603..a6e379fbf377 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -203,7 +203,7 @@ static void xennet_sysfs_delif(struct net_device *netdev); | |||
203 | 203 | ||
204 | static int xennet_can_sg(struct net_device *dev) | 204 | static int xennet_can_sg(struct net_device *dev) |
205 | { | 205 | { |
206 | return dev->features & NETIF_F_SG; | 206 | return !!(dev->features & NETIF_F_SG); |
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
@@ -1190,7 +1190,8 @@ static void xennet_uninit(struct net_device *dev) | |||
1190 | gnttab_free_grant_references(np->gref_rx_head); | 1190 | gnttab_free_grant_references(np->gref_rx_head); |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | static u32 xennet_fix_features(struct net_device *dev, u32 features) | 1193 | static netdev_features_t xennet_fix_features(struct net_device *dev, |
1194 | netdev_features_t features) | ||
1194 | { | 1195 | { |
1195 | struct netfront_info *np = netdev_priv(dev); | 1196 | struct netfront_info *np = netdev_priv(dev); |
1196 | int val; | 1197 | int val; |
@@ -1216,7 +1217,8 @@ static u32 xennet_fix_features(struct net_device *dev, u32 features) | |||
1216 | return features; | 1217 | return features; |
1217 | } | 1218 | } |
1218 | 1219 | ||
1219 | static int xennet_set_features(struct net_device *dev, u32 features) | 1220 | static int xennet_set_features(struct net_device *dev, |
1221 | netdev_features_t features) | ||
1220 | { | 1222 | { |
1221 | if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) { | 1223 | if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) { |
1222 | netdev_info(dev, "Reducing MTU because no SG offload"); | 1224 | netdev_info(dev, "Reducing MTU because no SG offload"); |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index e4c1176ee25b..a64f9e789b0a 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -3202,7 +3202,8 @@ static int qeth_l3_stop(struct net_device *dev) | |||
3202 | return 0; | 3202 | return 0; |
3203 | } | 3203 | } |
3204 | 3204 | ||
3205 | static u32 qeth_l3_fix_features(struct net_device *dev, u32 features) | 3205 | static netdev_features_t qeth_l3_fix_features(struct net_device *dev, |
3206 | netdev_features_t features) | ||
3206 | { | 3207 | { |
3207 | struct qeth_card *card = dev->ml_priv; | 3208 | struct qeth_card *card = dev->ml_priv; |
3208 | 3209 | ||
@@ -3216,7 +3217,8 @@ static u32 qeth_l3_fix_features(struct net_device *dev, u32 features) | |||
3216 | return features; | 3217 | return features; |
3217 | } | 3218 | } |
3218 | 3219 | ||
3219 | static int qeth_l3_set_features(struct net_device *dev, u32 features) | 3220 | static int qeth_l3_set_features(struct net_device *dev, |
3221 | netdev_features_t features) | ||
3220 | { | 3222 | { |
3221 | struct qeth_card *card = dev->ml_priv; | 3223 | struct qeth_card *card = dev->ml_priv; |
3222 | u32 changed = dev->features ^ features; | 3224 | u32 changed = dev->features ^ features; |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 32640edf4d78..af5238121826 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
@@ -10,6 +10,10 @@ | |||
10 | #ifndef _LINUX_NETDEV_FEATURES_H | 10 | #ifndef _LINUX_NETDEV_FEATURES_H |
11 | #define _LINUX_NETDEV_FEATURES_H | 11 | #define _LINUX_NETDEV_FEATURES_H |
12 | 12 | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | typedef u32 netdev_features_t; | ||
16 | |||
13 | /* Net device feature bits; if you change something, | 17 | /* Net device feature bits; if you change something, |
14 | * also update netdev_features_strings[] in ethtool.c */ | 18 | * also update netdev_features_strings[] in ethtool.c */ |
15 | 19 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9cf6e90b171d..b35ffd735ecc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -847,12 +847,13 @@ struct netdev_tc_txq { | |||
847 | * Called to release previously enslaved netdev. | 847 | * Called to release previously enslaved netdev. |
848 | * | 848 | * |
849 | * Feature/offload setting functions. | 849 | * Feature/offload setting functions. |
850 | * u32 (*ndo_fix_features)(struct net_device *dev, u32 features); | 850 | * netdev_features_t (*ndo_fix_features)(struct net_device *dev, |
851 | * netdev_features_t features); | ||
851 | * Adjusts the requested feature flags according to device-specific | 852 | * Adjusts the requested feature flags according to device-specific |
852 | * constraints, and returns the resulting flags. Must not modify | 853 | * constraints, and returns the resulting flags. Must not modify |
853 | * the device state. | 854 | * the device state. |
854 | * | 855 | * |
855 | * int (*ndo_set_features)(struct net_device *dev, u32 features); | 856 | * int (*ndo_set_features)(struct net_device *dev, netdev_features_t features); |
856 | * Called to update device configuration to new features. Passed | 857 | * Called to update device configuration to new features. Passed |
857 | * feature set might be less than what was returned by ndo_fix_features()). | 858 | * feature set might be less than what was returned by ndo_fix_features()). |
858 | * Must return >0 or -errno if it changed dev->features itself. | 859 | * Must return >0 or -errno if it changed dev->features itself. |
@@ -946,10 +947,10 @@ struct net_device_ops { | |||
946 | struct net_device *slave_dev); | 947 | struct net_device *slave_dev); |
947 | int (*ndo_del_slave)(struct net_device *dev, | 948 | int (*ndo_del_slave)(struct net_device *dev, |
948 | struct net_device *slave_dev); | 949 | struct net_device *slave_dev); |
949 | u32 (*ndo_fix_features)(struct net_device *dev, | 950 | netdev_features_t (*ndo_fix_features)(struct net_device *dev, |
950 | u32 features); | 951 | netdev_features_t features); |
951 | int (*ndo_set_features)(struct net_device *dev, | 952 | int (*ndo_set_features)(struct net_device *dev, |
952 | u32 features); | 953 | netdev_features_t features); |
953 | }; | 954 | }; |
954 | 955 | ||
955 | /* | 956 | /* |
@@ -999,13 +1000,13 @@ struct net_device { | |||
999 | struct list_head unreg_list; | 1000 | struct list_head unreg_list; |
1000 | 1001 | ||
1001 | /* currently active device features */ | 1002 | /* currently active device features */ |
1002 | u32 features; | 1003 | netdev_features_t features; |
1003 | /* user-changeable features */ | 1004 | /* user-changeable features */ |
1004 | u32 hw_features; | 1005 | netdev_features_t hw_features; |
1005 | /* user-requested features */ | 1006 | /* user-requested features */ |
1006 | u32 wanted_features; | 1007 | netdev_features_t wanted_features; |
1007 | /* mask of features inheritable by VLAN devices */ | 1008 | /* mask of features inheritable by VLAN devices */ |
1008 | u32 vlan_features; | 1009 | netdev_features_t vlan_features; |
1009 | 1010 | ||
1010 | /* Interface index. Unique device identifier */ | 1011 | /* Interface index. Unique device identifier */ |
1011 | int ifindex; | 1012 | int ifindex; |
@@ -1439,7 +1440,7 @@ struct packet_type { | |||
1439 | struct packet_type *, | 1440 | struct packet_type *, |
1440 | struct net_device *); | 1441 | struct net_device *); |
1441 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1442 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
1442 | u32 features); | 1443 | netdev_features_t features); |
1443 | int (*gso_send_check)(struct sk_buff *skb); | 1444 | int (*gso_send_check)(struct sk_buff *skb); |
1444 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1445 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
1445 | struct sk_buff *skb); | 1446 | struct sk_buff *skb); |
@@ -2444,7 +2445,8 @@ extern int netdev_set_master(struct net_device *dev, struct net_device *master) | |||
2444 | extern int netdev_set_bond_master(struct net_device *dev, | 2445 | extern int netdev_set_bond_master(struct net_device *dev, |
2445 | struct net_device *master); | 2446 | struct net_device *master); |
2446 | extern int skb_checksum_help(struct sk_buff *skb); | 2447 | extern int skb_checksum_help(struct sk_buff *skb); |
2447 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features); | 2448 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, |
2449 | netdev_features_t features); | ||
2448 | #ifdef CONFIG_BUG | 2450 | #ifdef CONFIG_BUG |
2449 | extern void netdev_rx_csum_fault(struct net_device *dev); | 2451 | extern void netdev_rx_csum_fault(struct net_device *dev); |
2450 | #else | 2452 | #else |
@@ -2471,11 +2473,13 @@ extern const char *netdev_drivername(const struct net_device *dev); | |||
2471 | 2473 | ||
2472 | extern void linkwatch_run_queue(void); | 2474 | extern void linkwatch_run_queue(void); |
2473 | 2475 | ||
2474 | static inline u32 netdev_get_wanted_features(struct net_device *dev) | 2476 | static inline netdev_features_t netdev_get_wanted_features( |
2477 | struct net_device *dev) | ||
2475 | { | 2478 | { |
2476 | return (dev->features & ~dev->hw_features) | dev->wanted_features; | 2479 | return (dev->features & ~dev->hw_features) | dev->wanted_features; |
2477 | } | 2480 | } |
2478 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); | 2481 | netdev_features_t netdev_increment_features(netdev_features_t all, |
2482 | netdev_features_t one, netdev_features_t mask); | ||
2479 | int __netdev_update_features(struct net_device *dev); | 2483 | int __netdev_update_features(struct net_device *dev); |
2480 | void netdev_update_features(struct net_device *dev); | 2484 | void netdev_update_features(struct net_device *dev); |
2481 | void netdev_change_features(struct net_device *dev); | 2485 | void netdev_change_features(struct net_device *dev); |
@@ -2483,21 +2487,22 @@ void netdev_change_features(struct net_device *dev); | |||
2483 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2487 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
2484 | struct net_device *dev); | 2488 | struct net_device *dev); |
2485 | 2489 | ||
2486 | u32 netif_skb_features(struct sk_buff *skb); | 2490 | netdev_features_t netif_skb_features(struct sk_buff *skb); |
2487 | 2491 | ||
2488 | static inline int net_gso_ok(u32 features, int gso_type) | 2492 | static inline int net_gso_ok(netdev_features_t features, int gso_type) |
2489 | { | 2493 | { |
2490 | int feature = gso_type << NETIF_F_GSO_SHIFT; | 2494 | netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT; |
2491 | return (features & feature) == feature; | 2495 | return (features & feature) == feature; |
2492 | } | 2496 | } |
2493 | 2497 | ||
2494 | static inline int skb_gso_ok(struct sk_buff *skb, u32 features) | 2498 | static inline int skb_gso_ok(struct sk_buff *skb, netdev_features_t features) |
2495 | { | 2499 | { |
2496 | return net_gso_ok(features, skb_shinfo(skb)->gso_type) && | 2500 | return net_gso_ok(features, skb_shinfo(skb)->gso_type) && |
2497 | (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); | 2501 | (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); |
2498 | } | 2502 | } |
2499 | 2503 | ||
2500 | static inline int netif_needs_gso(struct sk_buff *skb, int features) | 2504 | static inline int netif_needs_gso(struct sk_buff *skb, |
2505 | netdev_features_t features) | ||
2501 | { | 2506 | { |
2502 | return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || | 2507 | return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || |
2503 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 2508 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index abad8a0941e8..a10e487c0864 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/dmaengine.h> | 30 | #include <linux/dmaengine.h> |
31 | #include <linux/hrtimer.h> | 31 | #include <linux/hrtimer.h> |
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <linux/netdev_features.h> | ||
33 | 34 | ||
34 | /* Don't change this without changing skb_csum_unnecessary! */ | 35 | /* Don't change this without changing skb_csum_unnecessary! */ |
35 | #define CHECKSUM_NONE 0 | 36 | #define CHECKSUM_NONE 0 |
@@ -2106,7 +2107,8 @@ extern void skb_split(struct sk_buff *skb, | |||
2106 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | 2107 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, |
2107 | int shiftlen); | 2108 | int shiftlen); |
2108 | 2109 | ||
2109 | extern struct sk_buff *skb_segment(struct sk_buff *skb, u32 features); | 2110 | extern struct sk_buff *skb_segment(struct sk_buff *skb, |
2111 | netdev_features_t features); | ||
2110 | 2112 | ||
2111 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 2113 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
2112 | int len, void *buffer) | 2114 | int len, void *buffer) |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 6f7eb800974a..e182e13d6391 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -38,7 +38,7 @@ struct net_protocol { | |||
38 | void (*err_handler)(struct sk_buff *skb, u32 info); | 38 | void (*err_handler)(struct sk_buff *skb, u32 info); |
39 | int (*gso_send_check)(struct sk_buff *skb); | 39 | int (*gso_send_check)(struct sk_buff *skb); |
40 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 40 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
41 | u32 features); | 41 | netdev_features_t features); |
42 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 42 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
43 | struct sk_buff *skb); | 43 | struct sk_buff *skb); |
44 | int (*gro_complete)(struct sk_buff *skb); | 44 | int (*gro_complete)(struct sk_buff *skb); |
@@ -57,7 +57,7 @@ struct inet6_protocol { | |||
57 | 57 | ||
58 | int (*gso_send_check)(struct sk_buff *skb); | 58 | int (*gso_send_check)(struct sk_buff *skb); |
59 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 59 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
60 | u32 features); | 60 | netdev_features_t features); |
61 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 61 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
62 | struct sk_buff *skb); | 62 | struct sk_buff *skb); |
63 | int (*gro_complete)(struct sk_buff *skb); | 63 | int (*gro_complete)(struct sk_buff *skb); |
diff --git a/include/net/sock.h b/include/net/sock.h index 67cd4581b6da..1331008ad885 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -306,8 +306,8 @@ struct sock { | |||
306 | kmemcheck_bitfield_end(flags); | 306 | kmemcheck_bitfield_end(flags); |
307 | int sk_wmem_queued; | 307 | int sk_wmem_queued; |
308 | gfp_t sk_allocation; | 308 | gfp_t sk_allocation; |
309 | int sk_route_caps; | 309 | netdev_features_t sk_route_caps; |
310 | int sk_route_nocaps; | 310 | netdev_features_t sk_route_nocaps; |
311 | int sk_gso_type; | 311 | int sk_gso_type; |
312 | unsigned int sk_gso_max_size; | 312 | unsigned int sk_gso_max_size; |
313 | int sk_rcvlowat; | 313 | int sk_rcvlowat; |
@@ -1393,7 +1393,7 @@ static inline int sk_can_gso(const struct sock *sk) | |||
1393 | 1393 | ||
1394 | extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst); | 1394 | extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst); |
1395 | 1395 | ||
1396 | static inline void sk_nocaps_add(struct sock *sk, int flags) | 1396 | static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) |
1397 | { | 1397 | { |
1398 | sk->sk_route_nocaps |= flags; | 1398 | sk->sk_route_nocaps |= flags; |
1399 | sk->sk_route_caps &= ~flags; | 1399 | sk->sk_route_caps &= ~flags; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index bb18c4d69aba..113160b84588 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1430,7 +1430,8 @@ extern struct request_sock_ops tcp6_request_sock_ops; | |||
1430 | extern void tcp_v4_destroy_sock(struct sock *sk); | 1430 | extern void tcp_v4_destroy_sock(struct sock *sk); |
1431 | 1431 | ||
1432 | extern int tcp_v4_gso_send_check(struct sk_buff *skb); | 1432 | extern int tcp_v4_gso_send_check(struct sk_buff *skb); |
1433 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, u32 features); | 1433 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, |
1434 | netdev_features_t features); | ||
1434 | extern struct sk_buff **tcp_gro_receive(struct sk_buff **head, | 1435 | extern struct sk_buff **tcp_gro_receive(struct sk_buff **head, |
1435 | struct sk_buff *skb); | 1436 | struct sk_buff *skb); |
1436 | extern struct sk_buff **tcp4_gro_receive(struct sk_buff **head, | 1437 | extern struct sk_buff **tcp4_gro_receive(struct sk_buff **head, |
diff --git a/include/net/udp.h b/include/net/udp.h index 3b285f402f48..f54a5156b248 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -258,5 +258,6 @@ extern void udp4_proc_exit(void); | |||
258 | extern void udp_init(void); | 258 | extern void udp_init(void); |
259 | 259 | ||
260 | extern int udp4_ufo_send_check(struct sk_buff *skb); | 260 | extern int udp4_ufo_send_check(struct sk_buff *skb); |
261 | extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, u32 features); | 261 | extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, |
262 | netdev_features_t features); | ||
262 | #endif /* _UDP_H */ | 263 | #endif /* _UDP_H */ |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 993599e66e5a..8e75003d62f6 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -777,6 +777,18 @@ char *uuid_string(char *buf, char *end, const u8 *addr, | |||
777 | return string(buf, end, uuid, spec); | 777 | return string(buf, end, uuid, spec); |
778 | } | 778 | } |
779 | 779 | ||
780 | static | ||
781 | char *netdev_feature_string(char *buf, char *end, const u8 *addr, | ||
782 | struct printf_spec spec) | ||
783 | { | ||
784 | spec.flags |= SPECIAL | SMALL | ZEROPAD; | ||
785 | if (spec.field_width == -1) | ||
786 | spec.field_width = 2 + 2 * sizeof(netdev_features_t); | ||
787 | spec.base = 16; | ||
788 | |||
789 | return number(buf, end, *(const netdev_features_t *)addr, spec); | ||
790 | } | ||
791 | |||
780 | int kptr_restrict __read_mostly; | 792 | int kptr_restrict __read_mostly; |
781 | 793 | ||
782 | /* | 794 | /* |
@@ -824,6 +836,7 @@ int kptr_restrict __read_mostly; | |||
824 | * Do not use this feature without some mechanism to verify the | 836 | * Do not use this feature without some mechanism to verify the |
825 | * correctness of the format string and va_list arguments. | 837 | * correctness of the format string and va_list arguments. |
826 | * - 'K' For a kernel pointer that should be hidden from unprivileged users | 838 | * - 'K' For a kernel pointer that should be hidden from unprivileged users |
839 | * - 'NF' For a netdev_features_t | ||
827 | * | 840 | * |
828 | * Note: The difference between 'S' and 'F' is that on ia64 and ppc64 | 841 | * Note: The difference between 'S' and 'F' is that on ia64 and ppc64 |
829 | * function pointers are really function descriptors, which contain a | 842 | * function pointers are really function descriptors, which contain a |
@@ -896,6 +909,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, | |||
896 | has_capability_noaudit(current, CAP_SYSLOG)))) | 909 | has_capability_noaudit(current, CAP_SYSLOG)))) |
897 | ptr = NULL; | 910 | ptr = NULL; |
898 | break; | 911 | break; |
912 | case 'N': | ||
913 | switch (fmt[1]) { | ||
914 | case 'F': | ||
915 | return netdev_feature_string(buf, end, ptr, spec); | ||
916 | } | ||
917 | break; | ||
899 | } | 918 | } |
900 | spec.flags |= SMALL; | 919 | spec.flags |= SMALL; |
901 | if (spec.field_width == -1) { | 920 | if (spec.field_width == -1) { |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 6a4e0cb897b7..2b5fcde1f629 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -591,7 +591,8 @@ static void vlan_dev_uninit(struct net_device *dev) | |||
591 | } | 591 | } |
592 | } | 592 | } |
593 | 593 | ||
594 | static u32 vlan_dev_fix_features(struct net_device *dev, u32 features) | 594 | static netdev_features_t vlan_dev_fix_features(struct net_device *dev, |
595 | netdev_features_t features) | ||
595 | { | 596 | { |
596 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; | 597 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; |
597 | u32 old_features = features; | 598 | u32 old_features = features; |
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index feb77ea7b58e..772bad34794c 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -186,7 +186,8 @@ static void br_getinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
186 | strcpy(info->bus_info, "N/A"); | 186 | strcpy(info->bus_info, "N/A"); |
187 | } | 187 | } |
188 | 188 | ||
189 | static u32 br_fix_features(struct net_device *dev, u32 features) | 189 | static netdev_features_t br_fix_features(struct net_device *dev, |
190 | netdev_features_t features) | ||
190 | { | 191 | { |
191 | struct net_bridge *br = netdev_priv(dev); | 192 | struct net_bridge *br = netdev_priv(dev); |
192 | 193 | ||
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index f603e5b0b930..0a942fbccc9a 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -296,10 +296,11 @@ int br_min_mtu(const struct net_bridge *br) | |||
296 | /* | 296 | /* |
297 | * Recomputes features using slave's features | 297 | * Recomputes features using slave's features |
298 | */ | 298 | */ |
299 | u32 br_features_recompute(struct net_bridge *br, u32 features) | 299 | netdev_features_t br_features_recompute(struct net_bridge *br, |
300 | netdev_features_t features) | ||
300 | { | 301 | { |
301 | struct net_bridge_port *p; | 302 | struct net_bridge_port *p; |
302 | u32 mask; | 303 | netdev_features_t mask; |
303 | 304 | ||
304 | if (list_empty(&br->port_list)) | 305 | if (list_empty(&br->port_list)) |
305 | return features; | 306 | return features; |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index d7d6fb05411f..4027029aa5e4 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -387,7 +387,8 @@ extern int br_add_if(struct net_bridge *br, | |||
387 | extern int br_del_if(struct net_bridge *br, | 387 | extern int br_del_if(struct net_bridge *br, |
388 | struct net_device *dev); | 388 | struct net_device *dev); |
389 | extern int br_min_mtu(const struct net_bridge *br); | 389 | extern int br_min_mtu(const struct net_bridge *br); |
390 | extern u32 br_features_recompute(struct net_bridge *br, u32 features); | 390 | extern netdev_features_t br_features_recompute(struct net_bridge *br, |
391 | netdev_features_t features); | ||
391 | 392 | ||
392 | /* br_input.c */ | 393 | /* br_input.c */ |
393 | extern int br_handle_frame_finish(struct sk_buff *skb); | 394 | extern int br_handle_frame_finish(struct sk_buff *skb); |
diff --git a/net/core/dev.c b/net/core/dev.c index 185e246d61fd..f1cca59c4638 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1914,7 +1914,8 @@ EXPORT_SYMBOL(skb_checksum_help); | |||
1914 | * It may return NULL if the skb requires no segmentation. This is | 1914 | * It may return NULL if the skb requires no segmentation. This is |
1915 | * only possible when GSO is used for verifying header integrity. | 1915 | * only possible when GSO is used for verifying header integrity. |
1916 | */ | 1916 | */ |
1917 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features) | 1917 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, |
1918 | netdev_features_t features) | ||
1918 | { | 1919 | { |
1919 | struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); | 1920 | struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); |
1920 | struct packet_type *ptype; | 1921 | struct packet_type *ptype; |
@@ -1944,9 +1945,9 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features) | |||
1944 | if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) | 1945 | if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) |
1945 | dev->ethtool_ops->get_drvinfo(dev, &info); | 1946 | dev->ethtool_ops->get_drvinfo(dev, &info); |
1946 | 1947 | ||
1947 | WARN(1, "%s: caps=(0x%lx, 0x%lx) len=%d data_len=%d ip_summed=%d\n", | 1948 | WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n", |
1948 | info.driver, dev ? dev->features : 0L, | 1949 | info.driver, dev ? &dev->features : NULL, |
1949 | skb->sk ? skb->sk->sk_route_caps : 0L, | 1950 | skb->sk ? &skb->sk->sk_route_caps : NULL, |
1950 | skb->len, skb->data_len, skb->ip_summed); | 1951 | skb->len, skb->data_len, skb->ip_summed); |
1951 | 1952 | ||
1952 | if (skb_header_cloned(skb) && | 1953 | if (skb_header_cloned(skb) && |
@@ -2055,7 +2056,7 @@ static void dev_gso_skb_destructor(struct sk_buff *skb) | |||
2055 | * This function segments the given skb and stores the list of segments | 2056 | * This function segments the given skb and stores the list of segments |
2056 | * in skb->next. | 2057 | * in skb->next. |
2057 | */ | 2058 | */ |
2058 | static int dev_gso_segment(struct sk_buff *skb, int features) | 2059 | static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features) |
2059 | { | 2060 | { |
2060 | struct sk_buff *segs; | 2061 | struct sk_buff *segs; |
2061 | 2062 | ||
@@ -2094,7 +2095,7 @@ static inline void skb_orphan_try(struct sk_buff *skb) | |||
2094 | } | 2095 | } |
2095 | } | 2096 | } |
2096 | 2097 | ||
2097 | static bool can_checksum_protocol(unsigned long features, __be16 protocol) | 2098 | static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) |
2098 | { | 2099 | { |
2099 | return ((features & NETIF_F_GEN_CSUM) || | 2100 | return ((features & NETIF_F_GEN_CSUM) || |
2100 | ((features & NETIF_F_V4_CSUM) && | 2101 | ((features & NETIF_F_V4_CSUM) && |
@@ -2105,7 +2106,8 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol) | |||
2105 | protocol == htons(ETH_P_FCOE))); | 2106 | protocol == htons(ETH_P_FCOE))); |
2106 | } | 2107 | } |
2107 | 2108 | ||
2108 | static u32 harmonize_features(struct sk_buff *skb, __be16 protocol, u32 features) | 2109 | static netdev_features_t harmonize_features(struct sk_buff *skb, |
2110 | __be16 protocol, netdev_features_t features) | ||
2109 | { | 2111 | { |
2110 | if (!can_checksum_protocol(features, protocol)) { | 2112 | if (!can_checksum_protocol(features, protocol)) { |
2111 | features &= ~NETIF_F_ALL_CSUM; | 2113 | features &= ~NETIF_F_ALL_CSUM; |
@@ -2117,10 +2119,10 @@ static u32 harmonize_features(struct sk_buff *skb, __be16 protocol, u32 features | |||
2117 | return features; | 2119 | return features; |
2118 | } | 2120 | } |
2119 | 2121 | ||
2120 | u32 netif_skb_features(struct sk_buff *skb) | 2122 | netdev_features_t netif_skb_features(struct sk_buff *skb) |
2121 | { | 2123 | { |
2122 | __be16 protocol = skb->protocol; | 2124 | __be16 protocol = skb->protocol; |
2123 | u32 features = skb->dev->features; | 2125 | netdev_features_t features = skb->dev->features; |
2124 | 2126 | ||
2125 | if (protocol == htons(ETH_P_8021Q)) { | 2127 | if (protocol == htons(ETH_P_8021Q)) { |
2126 | struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; | 2128 | struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; |
@@ -2166,7 +2168,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
2166 | unsigned int skb_len; | 2168 | unsigned int skb_len; |
2167 | 2169 | ||
2168 | if (likely(!skb->next)) { | 2170 | if (likely(!skb->next)) { |
2169 | u32 features; | 2171 | netdev_features_t features; |
2170 | 2172 | ||
2171 | /* | 2173 | /* |
2172 | * If device doesn't need skb->dst, release it right now while | 2174 | * If device doesn't need skb->dst, release it right now while |
@@ -5350,7 +5352,8 @@ static void rollback_registered(struct net_device *dev) | |||
5350 | list_del(&single); | 5352 | list_del(&single); |
5351 | } | 5353 | } |
5352 | 5354 | ||
5353 | static u32 netdev_fix_features(struct net_device *dev, u32 features) | 5355 | static netdev_features_t netdev_fix_features(struct net_device *dev, |
5356 | netdev_features_t features) | ||
5354 | { | 5357 | { |
5355 | /* Fix illegal checksum combinations */ | 5358 | /* Fix illegal checksum combinations */ |
5356 | if ((features & NETIF_F_HW_CSUM) && | 5359 | if ((features & NETIF_F_HW_CSUM) && |
@@ -5412,7 +5415,7 @@ static u32 netdev_fix_features(struct net_device *dev, u32 features) | |||
5412 | 5415 | ||
5413 | int __netdev_update_features(struct net_device *dev) | 5416 | int __netdev_update_features(struct net_device *dev) |
5414 | { | 5417 | { |
5415 | u32 features; | 5418 | netdev_features_t features; |
5416 | int err = 0; | 5419 | int err = 0; |
5417 | 5420 | ||
5418 | ASSERT_RTNL(); | 5421 | ASSERT_RTNL(); |
@@ -5428,16 +5431,16 @@ int __netdev_update_features(struct net_device *dev) | |||
5428 | if (dev->features == features) | 5431 | if (dev->features == features) |
5429 | return 0; | 5432 | return 0; |
5430 | 5433 | ||
5431 | netdev_dbg(dev, "Features changed: 0x%08x -> 0x%08x\n", | 5434 | netdev_dbg(dev, "Features changed: %pNF -> %pNF\n", |
5432 | dev->features, features); | 5435 | &dev->features, &features); |
5433 | 5436 | ||
5434 | if (dev->netdev_ops->ndo_set_features) | 5437 | if (dev->netdev_ops->ndo_set_features) |
5435 | err = dev->netdev_ops->ndo_set_features(dev, features); | 5438 | err = dev->netdev_ops->ndo_set_features(dev, features); |
5436 | 5439 | ||
5437 | if (unlikely(err < 0)) { | 5440 | if (unlikely(err < 0)) { |
5438 | netdev_err(dev, | 5441 | netdev_err(dev, |
5439 | "set_features() failed (%d); wanted 0x%08x, left 0x%08x\n", | 5442 | "set_features() failed (%d); wanted %pNF, left %pNF\n", |
5440 | err, features, dev->features); | 5443 | err, &features, &dev->features); |
5441 | return -1; | 5444 | return -1; |
5442 | } | 5445 | } |
5443 | 5446 | ||
@@ -6361,7 +6364,8 @@ static int dev_cpu_callback(struct notifier_block *nfb, | |||
6361 | * @one to the master device with current feature set @all. Will not | 6364 | * @one to the master device with current feature set @all. Will not |
6362 | * enable anything that is off in @mask. Returns the new feature set. | 6365 | * enable anything that is off in @mask. Returns the new feature set. |
6363 | */ | 6366 | */ |
6364 | u32 netdev_increment_features(u32 all, u32 one, u32 mask) | 6367 | netdev_features_t netdev_increment_features(netdev_features_t all, |
6368 | netdev_features_t one, netdev_features_t mask) | ||
6365 | { | 6369 | { |
6366 | if (mask & NETIF_F_GEN_CSUM) | 6370 | if (mask & NETIF_F_GEN_CSUM) |
6367 | mask |= NETIF_F_ALL_CSUM; | 6371 | mask |= NETIF_F_ALL_CSUM; |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index a354919a32ac..f135f1c92c9d 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -171,7 +171,7 @@ static void __ethtool_get_strings(struct net_device *dev, | |||
171 | ops->get_strings(dev, stringset, data); | 171 | ops->get_strings(dev, stringset, data); |
172 | } | 172 | } |
173 | 173 | ||
174 | static u32 ethtool_get_feature_mask(u32 eth_cmd) | 174 | static netdev_features_t ethtool_get_feature_mask(u32 eth_cmd) |
175 | { | 175 | { |
176 | /* feature masks of legacy discrete ethtool ops */ | 176 | /* feature masks of legacy discrete ethtool ops */ |
177 | 177 | ||
@@ -205,7 +205,7 @@ static u32 ethtool_get_feature_mask(u32 eth_cmd) | |||
205 | static int ethtool_get_one_feature(struct net_device *dev, | 205 | static int ethtool_get_one_feature(struct net_device *dev, |
206 | char __user *useraddr, u32 ethcmd) | 206 | char __user *useraddr, u32 ethcmd) |
207 | { | 207 | { |
208 | u32 mask = ethtool_get_feature_mask(ethcmd); | 208 | netdev_features_t mask = ethtool_get_feature_mask(ethcmd); |
209 | struct ethtool_value edata = { | 209 | struct ethtool_value edata = { |
210 | .cmd = ethcmd, | 210 | .cmd = ethcmd, |
211 | .data = !!(dev->features & mask), | 211 | .data = !!(dev->features & mask), |
@@ -220,7 +220,7 @@ static int ethtool_set_one_feature(struct net_device *dev, | |||
220 | void __user *useraddr, u32 ethcmd) | 220 | void __user *useraddr, u32 ethcmd) |
221 | { | 221 | { |
222 | struct ethtool_value edata; | 222 | struct ethtool_value edata; |
223 | u32 mask; | 223 | netdev_features_t mask; |
224 | 224 | ||
225 | if (copy_from_user(&edata, useraddr, sizeof(edata))) | 225 | if (copy_from_user(&edata, useraddr, sizeof(edata))) |
226 | return -EFAULT; | 226 | return -EFAULT; |
@@ -260,8 +260,7 @@ static u32 __ethtool_get_flags(struct net_device *dev) | |||
260 | 260 | ||
261 | static int __ethtool_set_flags(struct net_device *dev, u32 data) | 261 | static int __ethtool_set_flags(struct net_device *dev, u32 data) |
262 | { | 262 | { |
263 | u32 features = 0; | 263 | netdev_features_t features = 0, changed; |
264 | u32 changed; | ||
265 | 264 | ||
266 | if (data & ~ETH_ALL_FLAGS) | 265 | if (data & ~ETH_ALL_FLAGS) |
267 | return -EINVAL; | 266 | return -EINVAL; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 8d2c5b32f172..cbc003b2914a 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2670,7 +2670,7 @@ EXPORT_SYMBOL_GPL(skb_pull_rcsum); | |||
2670 | * a pointer to the first in a list of new skbs for the segments. | 2670 | * a pointer to the first in a list of new skbs for the segments. |
2671 | * In case of error it returns ERR_PTR(err). | 2671 | * In case of error it returns ERR_PTR(err). |
2672 | */ | 2672 | */ |
2673 | struct sk_buff *skb_segment(struct sk_buff *skb, u32 features) | 2673 | struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features) |
2674 | { | 2674 | { |
2675 | struct sk_buff *segs = NULL; | 2675 | struct sk_buff *segs = NULL; |
2676 | struct sk_buff *tail = NULL; | 2676 | struct sk_buff *tail = NULL; |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index b2bbcd0ebd19..15dc4c4828de 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1250,7 +1250,8 @@ out: | |||
1250 | return err; | 1250 | return err; |
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | static struct sk_buff *inet_gso_segment(struct sk_buff *skb, u32 features) | 1253 | static struct sk_buff *inet_gso_segment(struct sk_buff *skb, |
1254 | netdev_features_t features) | ||
1254 | { | 1255 | { |
1255 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 1256 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
1256 | struct iphdr *iph; | 1257 | struct iphdr *iph; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 34f5db1e1c8b..50c359645665 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2653,7 +2653,8 @@ int compat_tcp_getsockopt(struct sock *sk, int level, int optname, | |||
2653 | EXPORT_SYMBOL(compat_tcp_getsockopt); | 2653 | EXPORT_SYMBOL(compat_tcp_getsockopt); |
2654 | #endif | 2654 | #endif |
2655 | 2655 | ||
2656 | struct sk_buff *tcp_tso_segment(struct sk_buff *skb, u32 features) | 2656 | struct sk_buff *tcp_tso_segment(struct sk_buff *skb, |
2657 | netdev_features_t features) | ||
2657 | { | 2658 | { |
2658 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 2659 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
2659 | struct tcphdr *th; | 2660 | struct tcphdr *th; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 6854f581313f..b867ea23ece9 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -2247,7 +2247,8 @@ int udp4_ufo_send_check(struct sk_buff *skb) | |||
2247 | return 0; | 2247 | return 0; |
2248 | } | 2248 | } |
2249 | 2249 | ||
2250 | struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, u32 features) | 2250 | struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, |
2251 | netdev_features_t features) | ||
2251 | { | 2252 | { |
2252 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 2253 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
2253 | unsigned int mss; | 2254 | unsigned int mss; |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 282dc7a91f32..ee3319487c4f 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -769,7 +769,8 @@ out: | |||
769 | return err; | 769 | return err; |
770 | } | 770 | } |
771 | 771 | ||
772 | static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, u32 features) | 772 | static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, |
773 | netdev_features_t features) | ||
773 | { | 774 | { |
774 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 775 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
775 | struct ipv6hdr *ipv6h; | 776 | struct ipv6hdr *ipv6h; |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index b4a4a15fa96f..ccfb0451b1c3 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1300,7 +1300,8 @@ static int udp6_ufo_send_check(struct sk_buff *skb) | |||
1300 | return 0; | 1300 | return 0; |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features) | 1303 | static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, |
1304 | netdev_features_t features) | ||
1304 | { | 1305 | { |
1305 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 1306 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
1306 | unsigned int mss; | 1307 | unsigned int mss; |