diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-04 16:20:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-04 16:20:01 -0500 |
commit | 44f2c5c841da1b1e0864d768197ab1497b5c2cc1 (patch) | |
tree | a9e62ee30dedd31c5aeb9c1a97cb8efec5dc3398 /drivers | |
parent | 78d2978874e4e10e97dfd4fd79db45bdc0748550 (diff) | |
parent | 1e6d93e45b231b3ae87c01902ede2315aacfe976 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (68 commits)
net: can: janz-ican3: world-writable sysfs termination file
net: can: at91_can: world-writable sysfs files
MAINTAINERS: update email ids of the be2net driver maintainers.
bridge: Don't put partly initialized fdb into hash
r8169: prevent RxFIFO induced loops in the irq handler.
r8169: RxFIFO overflow oddities with 8168 chipsets.
r8169: use RxFIFO overflow workaround for 8168c chipset.
include/net/genetlink.h: Allow genlmsg_cancel to accept a NULL argument
net: Provide compat support for SIOCGETMIFCNT_IN6 and SIOCGETSGCNT_IN6.
net: Support compat SIOCGETVIFCNT ioctl in ipv4.
net: Fix bug in compat SIOCGETSGCNT handling.
niu: Fix races between up/down and get_stats.
tcp_ecn is an integer not a boolean
atl1c: Add missing PCI device ID
s390: Fix possibly wrong size in strncmp (smsgiucv)
s390: Fix wrong size in memcmp (netiucv)
qeth: allow OSA CHPARM change in suspend state
qeth: allow HiperSockets framesize change in suspend
qeth: add more strict MTU checking
qeth: show new mac-address if its setting fails
...
Diffstat (limited to 'drivers')
33 files changed, 360 insertions, 246 deletions
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index f2b5bab5e6a1..1f355bb85e54 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c | |||
@@ -1627,7 +1627,7 @@ __setup("icn=", icn_setup); | |||
1627 | static int __init icn_init(void) | 1627 | static int __init icn_init(void) |
1628 | { | 1628 | { |
1629 | char *p; | 1629 | char *p; |
1630 | char rev[20]; | 1630 | char rev[21]; |
1631 | 1631 | ||
1632 | memset(&dev, 0, sizeof(icn_dev)); | 1632 | memset(&dev, 0, sizeof(icn_dev)); |
1633 | dev.memaddr = (membase & 0x0ffc000); | 1633 | dev.memaddr = (membase & 0x0ffc000); |
@@ -1638,6 +1638,7 @@ static int __init icn_init(void) | |||
1638 | 1638 | ||
1639 | if ((p = strchr(revision, ':'))) { | 1639 | if ((p = strchr(revision, ':'))) { |
1640 | strncpy(rev, p + 1, 20); | 1640 | strncpy(rev, p + 1, 20); |
1641 | rev[20] = '\0'; | ||
1641 | p = strchr(rev, '$'); | 1642 | p = strchr(rev, '$'); |
1642 | if (p) | 1643 | if (p) |
1643 | *p = 0; | 1644 | *p = 0; |
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index a699bbf20eb5..3824382faecc 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -48,6 +48,7 @@ static DEFINE_PCI_DEVICE_TABLE(atl1c_pci_tbl) = { | |||
48 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B)}, | 48 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B)}, |
49 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B2)}, | 49 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B2)}, |
50 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D)}, | 50 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D)}, |
51 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D_2_0)}, | ||
51 | /* required last entry */ | 52 | /* required last entry */ |
52 | { 0 } | 53 | { 0 } |
53 | }; | 54 | }; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index de40d3b7152f..28a32a6c8bf1 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -312,11 +312,9 @@ void be_link_status_update(struct be_adapter *adapter, bool link_up) | |||
312 | if (adapter->link_up != link_up) { | 312 | if (adapter->link_up != link_up) { |
313 | adapter->link_speed = -1; | 313 | adapter->link_speed = -1; |
314 | if (link_up) { | 314 | if (link_up) { |
315 | netif_start_queue(netdev); | ||
316 | netif_carrier_on(netdev); | 315 | netif_carrier_on(netdev); |
317 | printk(KERN_INFO "%s: Link up\n", netdev->name); | 316 | printk(KERN_INFO "%s: Link up\n", netdev->name); |
318 | } else { | 317 | } else { |
319 | netif_stop_queue(netdev); | ||
320 | netif_carrier_off(netdev); | 318 | netif_carrier_off(netdev); |
321 | printk(KERN_INFO "%s: Link down\n", netdev->name); | 319 | printk(KERN_INFO "%s: Link down\n", netdev->name); |
322 | } | 320 | } |
@@ -2628,8 +2626,6 @@ static void be_netdev_init(struct net_device *netdev) | |||
2628 | 2626 | ||
2629 | netif_napi_add(netdev, &adapter->tx_eq.napi, be_poll_tx_mcc, | 2627 | netif_napi_add(netdev, &adapter->tx_eq.napi, be_poll_tx_mcc, |
2630 | BE_NAPI_WEIGHT); | 2628 | BE_NAPI_WEIGHT); |
2631 | |||
2632 | netif_stop_queue(netdev); | ||
2633 | } | 2629 | } |
2634 | 2630 | ||
2635 | static void be_unmap_pci_bars(struct be_adapter *adapter) | 2631 | static void be_unmap_pci_bars(struct be_adapter *adapter) |
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 8e4183717d91..653c62475cb6 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * (you will need to reboot afterwards) */ | 22 | * (you will need to reboot afterwards) */ |
23 | /* #define BNX2X_STOP_ON_ERROR */ | 23 | /* #define BNX2X_STOP_ON_ERROR */ |
24 | 24 | ||
25 | #define DRV_MODULE_VERSION "1.62.00-4" | 25 | #define DRV_MODULE_VERSION "1.62.00-5" |
26 | #define DRV_MODULE_RELDATE "2011/01/18" | 26 | #define DRV_MODULE_RELDATE "2011/01/30" |
27 | #define BNX2X_BC_VER 0x040200 | 27 | #define BNX2X_BC_VER 0x040200 |
28 | 28 | ||
29 | #define BNX2X_MULTI_QUEUE | 29 | #define BNX2X_MULTI_QUEUE |
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c index 7160ec51093e..dd1210fddfff 100644 --- a/drivers/net/bnx2x/bnx2x_link.c +++ b/drivers/net/bnx2x/bnx2x_link.c | |||
@@ -3948,48 +3948,6 @@ static u8 bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp, | |||
3948 | return rc; | 3948 | return rc; |
3949 | } | 3949 | } |
3950 | 3950 | ||
3951 | static void bnx2x_8073_set_xaui_low_power_mode(struct bnx2x *bp, | ||
3952 | struct bnx2x_phy *phy) | ||
3953 | { | ||
3954 | u16 val; | ||
3955 | bnx2x_cl45_read(bp, phy, | ||
3956 | MDIO_PMA_DEVAD, MDIO_PMA_REG_8073_CHIP_REV, &val); | ||
3957 | |||
3958 | if (val == 0) { | ||
3959 | /* Mustn't set low power mode in 8073 A0 */ | ||
3960 | return; | ||
3961 | } | ||
3962 | |||
3963 | /* Disable PLL sequencer (use read-modify-write to clear bit 13) */ | ||
3964 | bnx2x_cl45_read(bp, phy, | ||
3965 | MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, &val); | ||
3966 | val &= ~(1<<13); | ||
3967 | bnx2x_cl45_write(bp, phy, | ||
3968 | MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, val); | ||
3969 | |||
3970 | /* PLL controls */ | ||
3971 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805E, 0x1077); | ||
3972 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805D, 0x0000); | ||
3973 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805C, 0x030B); | ||
3974 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805B, 0x1240); | ||
3975 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805A, 0x2490); | ||
3976 | |||
3977 | /* Tx Controls */ | ||
3978 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80A7, 0x0C74); | ||
3979 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80A6, 0x9041); | ||
3980 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80A5, 0x4640); | ||
3981 | |||
3982 | /* Rx Controls */ | ||
3983 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80FE, 0x01C4); | ||
3984 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80FD, 0x9249); | ||
3985 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80FC, 0x2015); | ||
3986 | |||
3987 | /* Enable PLL sequencer (use read-modify-write to set bit 13) */ | ||
3988 | bnx2x_cl45_read(bp, phy, MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, &val); | ||
3989 | val |= (1<<13); | ||
3990 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, val); | ||
3991 | } | ||
3992 | |||
3993 | /******************************************************************/ | 3951 | /******************************************************************/ |
3994 | /* BCM8073 PHY SECTION */ | 3952 | /* BCM8073 PHY SECTION */ |
3995 | /******************************************************************/ | 3953 | /******************************************************************/ |
@@ -4148,8 +4106,6 @@ static u8 bnx2x_8073_config_init(struct bnx2x_phy *phy, | |||
4148 | 4106 | ||
4149 | bnx2x_8073_set_pause_cl37(params, phy, vars); | 4107 | bnx2x_8073_set_pause_cl37(params, phy, vars); |
4150 | 4108 | ||
4151 | bnx2x_8073_set_xaui_low_power_mode(bp, phy); | ||
4152 | |||
4153 | bnx2x_cl45_read(bp, phy, | 4109 | bnx2x_cl45_read(bp, phy, |
4154 | MDIO_PMA_DEVAD, MDIO_PMA_REG_M8051_MSGOUT_REG, &tmp1); | 4110 | MDIO_PMA_DEVAD, MDIO_PMA_REG_M8051_MSGOUT_REG, &tmp1); |
4155 | 4111 | ||
@@ -6519,6 +6475,18 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy, | |||
6519 | MDIO_PMA_DEVAD, | 6475 | MDIO_PMA_DEVAD, |
6520 | MDIO_PMA_REG_8481_LED1_MASK, | 6476 | MDIO_PMA_REG_8481_LED1_MASK, |
6521 | 0x80); | 6477 | 0x80); |
6478 | |||
6479 | /* Tell LED3 to blink on source */ | ||
6480 | bnx2x_cl45_read(bp, phy, | ||
6481 | MDIO_PMA_DEVAD, | ||
6482 | MDIO_PMA_REG_8481_LINK_SIGNAL, | ||
6483 | &val); | ||
6484 | val &= ~(7<<6); | ||
6485 | val |= (1<<6); /* A83B[8:6]= 1 */ | ||
6486 | bnx2x_cl45_write(bp, phy, | ||
6487 | MDIO_PMA_DEVAD, | ||
6488 | MDIO_PMA_REG_8481_LINK_SIGNAL, | ||
6489 | val); | ||
6522 | } | 6490 | } |
6523 | break; | 6491 | break; |
6524 | } | 6492 | } |
@@ -7720,10 +7688,13 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp, | |||
7720 | struct bnx2x_phy phy[PORT_MAX]; | 7688 | struct bnx2x_phy phy[PORT_MAX]; |
7721 | struct bnx2x_phy *phy_blk[PORT_MAX]; | 7689 | struct bnx2x_phy *phy_blk[PORT_MAX]; |
7722 | u16 val; | 7690 | u16 val; |
7723 | s8 port; | 7691 | s8 port = 0; |
7724 | s8 port_of_path = 0; | 7692 | s8 port_of_path = 0; |
7725 | 7693 | u32 swap_val, swap_override; | |
7726 | bnx2x_ext_phy_hw_reset(bp, 0); | 7694 | swap_val = REG_RD(bp, NIG_REG_PORT_SWAP); |
7695 | swap_override = REG_RD(bp, NIG_REG_STRAP_OVERRIDE); | ||
7696 | port ^= (swap_val && swap_override); | ||
7697 | bnx2x_ext_phy_hw_reset(bp, port); | ||
7727 | /* PART1 - Reset both phys */ | 7698 | /* PART1 - Reset both phys */ |
7728 | for (port = PORT_MAX - 1; port >= PORT_0; port--) { | 7699 | for (port = PORT_MAX - 1; port >= PORT_0; port--) { |
7729 | u32 shmem_base, shmem2_base; | 7700 | u32 shmem_base, shmem2_base; |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 8cdcf5b39d1e..f40740e68ea5 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -2301,15 +2301,10 @@ static void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters) | |||
2301 | /* accept matched ucast */ | 2301 | /* accept matched ucast */ |
2302 | drop_all_ucast = 0; | 2302 | drop_all_ucast = 0; |
2303 | } | 2303 | } |
2304 | if (filters & BNX2X_ACCEPT_MULTICAST) { | 2304 | if (filters & BNX2X_ACCEPT_MULTICAST) |
2305 | /* accept matched mcast */ | 2305 | /* accept matched mcast */ |
2306 | drop_all_mcast = 0; | 2306 | drop_all_mcast = 0; |
2307 | if (IS_MF_SI(bp)) | 2307 | |
2308 | /* since mcast addresses won't arrive with ovlan, | ||
2309 | * fw needs to accept all of them in | ||
2310 | * switch-independent mode */ | ||
2311 | accp_all_mcast = 1; | ||
2312 | } | ||
2313 | if (filters & BNX2X_ACCEPT_ALL_UNICAST) { | 2308 | if (filters & BNX2X_ACCEPT_ALL_UNICAST) { |
2314 | /* accept all mcast */ | 2309 | /* accept all mcast */ |
2315 | drop_all_ucast = 0; | 2310 | drop_all_ucast = 0; |
@@ -5296,10 +5291,6 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code) | |||
5296 | } | 5291 | } |
5297 | } | 5292 | } |
5298 | 5293 | ||
5299 | bp->port.need_hw_lock = bnx2x_hw_lock_required(bp, | ||
5300 | bp->common.shmem_base, | ||
5301 | bp->common.shmem2_base); | ||
5302 | |||
5303 | bnx2x_setup_fan_failure_detection(bp); | 5294 | bnx2x_setup_fan_failure_detection(bp); |
5304 | 5295 | ||
5305 | /* clear PXP2 attentions */ | 5296 | /* clear PXP2 attentions */ |
@@ -5503,9 +5494,6 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) | |||
5503 | 5494 | ||
5504 | bnx2x_init_block(bp, MCP_BLOCK, init_stage); | 5495 | bnx2x_init_block(bp, MCP_BLOCK, init_stage); |
5505 | bnx2x_init_block(bp, DMAE_BLOCK, init_stage); | 5496 | bnx2x_init_block(bp, DMAE_BLOCK, init_stage); |
5506 | bp->port.need_hw_lock = bnx2x_hw_lock_required(bp, | ||
5507 | bp->common.shmem_base, | ||
5508 | bp->common.shmem2_base); | ||
5509 | if (bnx2x_fan_failure_det_req(bp, bp->common.shmem_base, | 5497 | if (bnx2x_fan_failure_det_req(bp, bp->common.shmem_base, |
5510 | bp->common.shmem2_base, port)) { | 5498 | bp->common.shmem2_base, port)) { |
5511 | u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 : | 5499 | u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 : |
@@ -8379,6 +8367,17 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) | |||
8379 | (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) | 8367 | (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) |
8380 | bp->mdio.prtad = | 8368 | bp->mdio.prtad = |
8381 | XGXS_EXT_PHY_ADDR(ext_phy_config); | 8369 | XGXS_EXT_PHY_ADDR(ext_phy_config); |
8370 | |||
8371 | /* | ||
8372 | * Check if hw lock is required to access MDC/MDIO bus to the PHY(s) | ||
8373 | * In MF mode, it is set to cover self test cases | ||
8374 | */ | ||
8375 | if (IS_MF(bp)) | ||
8376 | bp->port.need_hw_lock = 1; | ||
8377 | else | ||
8378 | bp->port.need_hw_lock = bnx2x_hw_lock_required(bp, | ||
8379 | bp->common.shmem_base, | ||
8380 | bp->common.shmem2_base); | ||
8382 | } | 8381 | } |
8383 | 8382 | ||
8384 | static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) | 8383 | static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 986195eaa57c..5dec456fd4a4 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -23,7 +23,7 @@ config CAN_SLCAN | |||
23 | 23 | ||
24 | As only the sending and receiving of CAN frames is implemented, this | 24 | As only the sending and receiving of CAN frames is implemented, this |
25 | driver should work with the (serial/USB) CAN hardware from: | 25 | driver should work with the (serial/USB) CAN hardware from: |
26 | www.canusb.com / www.can232.com / www.mictronic.com / www.canhack.de | 26 | www.canusb.com / www.can232.com / www.mictronics.de / www.canhack.de |
27 | 27 | ||
28 | Userspace tools to attach the SLCAN line discipline (slcan_attach, | 28 | Userspace tools to attach the SLCAN line discipline (slcan_attach, |
29 | slcand) can be found in the can-utils at the SocketCAN SVN, see | 29 | slcand) can be found in the can-utils at the SocketCAN SVN, see |
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 2532b9631538..57d2ffbbb433 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -1109,7 +1109,7 @@ static ssize_t at91_sysfs_set_mb0_id(struct device *dev, | |||
1109 | return ret; | 1109 | return ret; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | static DEVICE_ATTR(mb0_id, S_IWUGO | S_IRUGO, | 1112 | static DEVICE_ATTR(mb0_id, S_IWUSR | S_IRUGO, |
1113 | at91_sysfs_show_mb0_id, at91_sysfs_set_mb0_id); | 1113 | at91_sysfs_show_mb0_id, at91_sysfs_set_mb0_id); |
1114 | 1114 | ||
1115 | static struct attribute *at91_sysfs_attrs[] = { | 1115 | static struct attribute *at91_sysfs_attrs[] = { |
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index b9a6d7a5a739..366f5cc050ae 100644 --- a/drivers/net/can/janz-ican3.c +++ b/drivers/net/can/janz-ican3.c | |||
@@ -1618,7 +1618,7 @@ static ssize_t ican3_sysfs_set_term(struct device *dev, | |||
1618 | return count; | 1618 | return count; |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | static DEVICE_ATTR(termination, S_IWUGO | S_IRUGO, ican3_sysfs_show_term, | 1621 | static DEVICE_ATTR(termination, S_IWUSR | S_IRUGO, ican3_sysfs_show_term, |
1622 | ican3_sysfs_set_term); | 1622 | ican3_sysfs_set_term); |
1623 | 1623 | ||
1624 | static struct attribute *ican3_sysfs_attrs[] = { | 1624 | static struct attribute *ican3_sysfs_attrs[] = { |
diff --git a/drivers/net/can/softing/Kconfig b/drivers/net/can/softing/Kconfig index 92bd6bdde5e3..8ba81b3ddd90 100644 --- a/drivers/net/can/softing/Kconfig +++ b/drivers/net/can/softing/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config CAN_SOFTING | 1 | config CAN_SOFTING |
2 | tristate "Softing Gmbh CAN generic support" | 2 | tristate "Softing Gmbh CAN generic support" |
3 | depends on CAN_DEV | 3 | depends on CAN_DEV && HAS_IOMEM |
4 | ---help--- | 4 | ---help--- |
5 | Support for CAN cards from Softing Gmbh & some cards | 5 | Support for CAN cards from Softing Gmbh & some cards |
6 | from Vector Gmbh. | 6 | from Vector Gmbh. |
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 1b48b68ad4fd..8b0084d17c8c 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -1094,7 +1094,7 @@ static int depca_rx(struct net_device *dev) | |||
1094 | } | 1094 | } |
1095 | } | 1095 | } |
1096 | /* Change buffer ownership for this last frame, back to the adapter */ | 1096 | /* Change buffer ownership for this last frame, back to the adapter */ |
1097 | for (; lp->rx_old != entry; lp->rx_old = (++lp->rx_old) & lp->rxRingMask) { | 1097 | for (; lp->rx_old != entry; lp->rx_old = (lp->rx_old + 1) & lp->rxRingMask) { |
1098 | writel(readl(&lp->rx_ring[lp->rx_old].base) | R_OWN, &lp->rx_ring[lp->rx_old].base); | 1098 | writel(readl(&lp->rx_ring[lp->rx_old].base) | R_OWN, &lp->rx_ring[lp->rx_old].base); |
1099 | } | 1099 | } |
1100 | writel(readl(&lp->rx_ring[entry].base) | R_OWN, &lp->rx_ring[entry].base); | 1100 | writel(readl(&lp->rx_ring[entry].base) | R_OWN, &lp->rx_ring[entry].base); |
@@ -1103,7 +1103,7 @@ static int depca_rx(struct net_device *dev) | |||
1103 | /* | 1103 | /* |
1104 | ** Update entry information | 1104 | ** Update entry information |
1105 | */ | 1105 | */ |
1106 | lp->rx_new = (++lp->rx_new) & lp->rxRingMask; | 1106 | lp->rx_new = (lp->rx_new + 1) & lp->rxRingMask; |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | return 0; | 1109 | return 0; |
@@ -1148,7 +1148,7 @@ static int depca_tx(struct net_device *dev) | |||
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | /* Update all the pointers */ | 1150 | /* Update all the pointers */ |
1151 | lp->tx_old = (++lp->tx_old) & lp->txRingMask; | 1151 | lp->tx_old = (lp->tx_old + 1) & lp->txRingMask; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | return 0; | 1154 | return 0; |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index e1a8216ff692..c05db6046050 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -1753,8 +1753,6 @@ rio_close (struct net_device *dev) | |||
1753 | 1753 | ||
1754 | /* Free all the skbuffs in the queue. */ | 1754 | /* Free all the skbuffs in the queue. */ |
1755 | for (i = 0; i < RX_RING_SIZE; i++) { | 1755 | for (i = 0; i < RX_RING_SIZE; i++) { |
1756 | np->rx_ring[i].status = 0; | ||
1757 | np->rx_ring[i].fraginfo = 0; | ||
1758 | skb = np->rx_skbuff[i]; | 1756 | skb = np->rx_skbuff[i]; |
1759 | if (skb) { | 1757 | if (skb) { |
1760 | pci_unmap_single(np->pdev, | 1758 | pci_unmap_single(np->pdev, |
@@ -1763,6 +1761,8 @@ rio_close (struct net_device *dev) | |||
1763 | dev_kfree_skb (skb); | 1761 | dev_kfree_skb (skb); |
1764 | np->rx_skbuff[i] = NULL; | 1762 | np->rx_skbuff[i] = NULL; |
1765 | } | 1763 | } |
1764 | np->rx_ring[i].status = 0; | ||
1765 | np->rx_ring[i].fraginfo = 0; | ||
1766 | } | 1766 | } |
1767 | for (i = 0; i < TX_RING_SIZE; i++) { | 1767 | for (i = 0; i < TX_RING_SIZE; i++) { |
1768 | skb = np->tx_skbuff[i]; | 1768 | skb = np->tx_skbuff[i]; |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 112c5aa9af7f..907b05a1c659 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -812,7 +812,7 @@ static void enc28j60_read_tsv(struct enc28j60_net *priv, u8 tsv[TSV_SIZE]) | |||
812 | if (netif_msg_hw(priv)) | 812 | if (netif_msg_hw(priv)) |
813 | printk(KERN_DEBUG DRV_NAME ": reading TSV at addr:0x%04x\n", | 813 | printk(KERN_DEBUG DRV_NAME ": reading TSV at addr:0x%04x\n", |
814 | endptr + 1); | 814 | endptr + 1); |
815 | enc28j60_mem_read(priv, endptr + 1, sizeof(tsv), tsv); | 815 | enc28j60_mem_read(priv, endptr + 1, TSV_SIZE, tsv); |
816 | } | 816 | } |
817 | 817 | ||
818 | static void enc28j60_dump_tsv(struct enc28j60_net *priv, const char *msg, | 818 | static void enc28j60_dump_tsv(struct enc28j60_net *priv, const char *msg, |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 2541321bad82..9fb59d3f9c92 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -4489,6 +4489,9 @@ static int niu_alloc_channels(struct niu *np) | |||
4489 | { | 4489 | { |
4490 | struct niu_parent *parent = np->parent; | 4490 | struct niu_parent *parent = np->parent; |
4491 | int first_rx_channel, first_tx_channel; | 4491 | int first_rx_channel, first_tx_channel; |
4492 | int num_rx_rings, num_tx_rings; | ||
4493 | struct rx_ring_info *rx_rings; | ||
4494 | struct tx_ring_info *tx_rings; | ||
4492 | int i, port, err; | 4495 | int i, port, err; |
4493 | 4496 | ||
4494 | port = np->port; | 4497 | port = np->port; |
@@ -4498,18 +4501,21 @@ static int niu_alloc_channels(struct niu *np) | |||
4498 | first_tx_channel += parent->txchan_per_port[i]; | 4501 | first_tx_channel += parent->txchan_per_port[i]; |
4499 | } | 4502 | } |
4500 | 4503 | ||
4501 | np->num_rx_rings = parent->rxchan_per_port[port]; | 4504 | num_rx_rings = parent->rxchan_per_port[port]; |
4502 | np->num_tx_rings = parent->txchan_per_port[port]; | 4505 | num_tx_rings = parent->txchan_per_port[port]; |
4503 | 4506 | ||
4504 | netif_set_real_num_rx_queues(np->dev, np->num_rx_rings); | 4507 | rx_rings = kcalloc(num_rx_rings, sizeof(struct rx_ring_info), |
4505 | netif_set_real_num_tx_queues(np->dev, np->num_tx_rings); | 4508 | GFP_KERNEL); |
4506 | |||
4507 | np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info), | ||
4508 | GFP_KERNEL); | ||
4509 | err = -ENOMEM; | 4509 | err = -ENOMEM; |
4510 | if (!np->rx_rings) | 4510 | if (!rx_rings) |
4511 | goto out_err; | 4511 | goto out_err; |
4512 | 4512 | ||
4513 | np->num_rx_rings = num_rx_rings; | ||
4514 | smp_wmb(); | ||
4515 | np->rx_rings = rx_rings; | ||
4516 | |||
4517 | netif_set_real_num_rx_queues(np->dev, num_rx_rings); | ||
4518 | |||
4513 | for (i = 0; i < np->num_rx_rings; i++) { | 4519 | for (i = 0; i < np->num_rx_rings; i++) { |
4514 | struct rx_ring_info *rp = &np->rx_rings[i]; | 4520 | struct rx_ring_info *rp = &np->rx_rings[i]; |
4515 | 4521 | ||
@@ -4538,12 +4544,18 @@ static int niu_alloc_channels(struct niu *np) | |||
4538 | return err; | 4544 | return err; |
4539 | } | 4545 | } |
4540 | 4546 | ||
4541 | np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info), | 4547 | tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info), |
4542 | GFP_KERNEL); | 4548 | GFP_KERNEL); |
4543 | err = -ENOMEM; | 4549 | err = -ENOMEM; |
4544 | if (!np->tx_rings) | 4550 | if (!tx_rings) |
4545 | goto out_err; | 4551 | goto out_err; |
4546 | 4552 | ||
4553 | np->num_tx_rings = num_tx_rings; | ||
4554 | smp_wmb(); | ||
4555 | np->tx_rings = tx_rings; | ||
4556 | |||
4557 | netif_set_real_num_tx_queues(np->dev, num_tx_rings); | ||
4558 | |||
4547 | for (i = 0; i < np->num_tx_rings; i++) { | 4559 | for (i = 0; i < np->num_tx_rings; i++) { |
4548 | struct tx_ring_info *rp = &np->tx_rings[i]; | 4560 | struct tx_ring_info *rp = &np->tx_rings[i]; |
4549 | 4561 | ||
@@ -6246,11 +6258,17 @@ static void niu_sync_mac_stats(struct niu *np) | |||
6246 | static void niu_get_rx_stats(struct niu *np) | 6258 | static void niu_get_rx_stats(struct niu *np) |
6247 | { | 6259 | { |
6248 | unsigned long pkts, dropped, errors, bytes; | 6260 | unsigned long pkts, dropped, errors, bytes; |
6261 | struct rx_ring_info *rx_rings; | ||
6249 | int i; | 6262 | int i; |
6250 | 6263 | ||
6251 | pkts = dropped = errors = bytes = 0; | 6264 | pkts = dropped = errors = bytes = 0; |
6265 | |||
6266 | rx_rings = ACCESS_ONCE(np->rx_rings); | ||
6267 | if (!rx_rings) | ||
6268 | goto no_rings; | ||
6269 | |||
6252 | for (i = 0; i < np->num_rx_rings; i++) { | 6270 | for (i = 0; i < np->num_rx_rings; i++) { |
6253 | struct rx_ring_info *rp = &np->rx_rings[i]; | 6271 | struct rx_ring_info *rp = &rx_rings[i]; |
6254 | 6272 | ||
6255 | niu_sync_rx_discard_stats(np, rp, 0); | 6273 | niu_sync_rx_discard_stats(np, rp, 0); |
6256 | 6274 | ||
@@ -6259,6 +6277,8 @@ static void niu_get_rx_stats(struct niu *np) | |||
6259 | dropped += rp->rx_dropped; | 6277 | dropped += rp->rx_dropped; |
6260 | errors += rp->rx_errors; | 6278 | errors += rp->rx_errors; |
6261 | } | 6279 | } |
6280 | |||
6281 | no_rings: | ||
6262 | np->dev->stats.rx_packets = pkts; | 6282 | np->dev->stats.rx_packets = pkts; |
6263 | np->dev->stats.rx_bytes = bytes; | 6283 | np->dev->stats.rx_bytes = bytes; |
6264 | np->dev->stats.rx_dropped = dropped; | 6284 | np->dev->stats.rx_dropped = dropped; |
@@ -6268,16 +6288,24 @@ static void niu_get_rx_stats(struct niu *np) | |||
6268 | static void niu_get_tx_stats(struct niu *np) | 6288 | static void niu_get_tx_stats(struct niu *np) |
6269 | { | 6289 | { |
6270 | unsigned long pkts, errors, bytes; | 6290 | unsigned long pkts, errors, bytes; |
6291 | struct tx_ring_info *tx_rings; | ||
6271 | int i; | 6292 | int i; |
6272 | 6293 | ||
6273 | pkts = errors = bytes = 0; | 6294 | pkts = errors = bytes = 0; |
6295 | |||
6296 | tx_rings = ACCESS_ONCE(np->tx_rings); | ||
6297 | if (!tx_rings) | ||
6298 | goto no_rings; | ||
6299 | |||
6274 | for (i = 0; i < np->num_tx_rings; i++) { | 6300 | for (i = 0; i < np->num_tx_rings; i++) { |
6275 | struct tx_ring_info *rp = &np->tx_rings[i]; | 6301 | struct tx_ring_info *rp = &tx_rings[i]; |
6276 | 6302 | ||
6277 | pkts += rp->tx_packets; | 6303 | pkts += rp->tx_packets; |
6278 | bytes += rp->tx_bytes; | 6304 | bytes += rp->tx_bytes; |
6279 | errors += rp->tx_errors; | 6305 | errors += rp->tx_errors; |
6280 | } | 6306 | } |
6307 | |||
6308 | no_rings: | ||
6281 | np->dev->stats.tx_packets = pkts; | 6309 | np->dev->stats.tx_packets = pkts; |
6282 | np->dev->stats.tx_bytes = bytes; | 6310 | np->dev->stats.tx_bytes = bytes; |
6283 | np->dev->stats.tx_errors = errors; | 6311 | np->dev->stats.tx_errors = errors; |
@@ -6287,9 +6315,10 @@ static struct net_device_stats *niu_get_stats(struct net_device *dev) | |||
6287 | { | 6315 | { |
6288 | struct niu *np = netdev_priv(dev); | 6316 | struct niu *np = netdev_priv(dev); |
6289 | 6317 | ||
6290 | niu_get_rx_stats(np); | 6318 | if (netif_running(dev)) { |
6291 | niu_get_tx_stats(np); | 6319 | niu_get_rx_stats(np); |
6292 | 6320 | niu_get_tx_stats(np); | |
6321 | } | ||
6293 | return &dev->stats; | 6322 | return &dev->stats; |
6294 | } | 6323 | } |
6295 | 6324 | ||
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 1f42f6ac8551..d3cb77205863 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1488,12 +1488,10 @@ static void ei_rx_overrun(struct net_device *dev) | |||
1488 | 1488 | ||
1489 | /* | 1489 | /* |
1490 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. | 1490 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. |
1491 | * Early datasheets said to poll the reset bit, but now they say that | 1491 | * We wait at least 2ms. |
1492 | * it "is not a reliable indicator and subsequently should be ignored." | ||
1493 | * We wait at least 10ms. | ||
1494 | */ | 1492 | */ |
1495 | 1493 | ||
1496 | mdelay(10); | 1494 | mdelay(2); |
1497 | 1495 | ||
1498 | /* | 1496 | /* |
1499 | * Reset RBCR[01] back to zero as per magic incantation. | 1497 | * Reset RBCR[01] back to zero as per magic incantation. |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index bde7d61f1930..59ccf0c5c610 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -973,7 +973,8 @@ static void __rtl8169_check_link_status(struct net_device *dev, | |||
973 | if (pm) | 973 | if (pm) |
974 | pm_request_resume(&tp->pci_dev->dev); | 974 | pm_request_resume(&tp->pci_dev->dev); |
975 | netif_carrier_on(dev); | 975 | netif_carrier_on(dev); |
976 | netif_info(tp, ifup, dev, "link up\n"); | 976 | if (net_ratelimit()) |
977 | netif_info(tp, ifup, dev, "link up\n"); | ||
977 | } else { | 978 | } else { |
978 | netif_carrier_off(dev); | 979 | netif_carrier_off(dev); |
979 | netif_info(tp, ifdown, dev, "link down\n"); | 980 | netif_info(tp, ifdown, dev, "link down\n"); |
@@ -3757,7 +3758,8 @@ static void rtl_hw_start_8168(struct net_device *dev) | |||
3757 | RTL_W16(IntrMitigate, 0x5151); | 3758 | RTL_W16(IntrMitigate, 0x5151); |
3758 | 3759 | ||
3759 | /* Work around for RxFIFO overflow. */ | 3760 | /* Work around for RxFIFO overflow. */ |
3760 | if (tp->mac_version == RTL_GIGA_MAC_VER_11) { | 3761 | if (tp->mac_version == RTL_GIGA_MAC_VER_11 || |
3762 | tp->mac_version == RTL_GIGA_MAC_VER_22) { | ||
3761 | tp->intr_event |= RxFIFOOver | PCSTimeout; | 3763 | tp->intr_event |= RxFIFOOver | PCSTimeout; |
3762 | tp->intr_event &= ~RxOverflow; | 3764 | tp->intr_event &= ~RxOverflow; |
3763 | } | 3765 | } |
@@ -4639,12 +4641,33 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4639 | break; | 4641 | break; |
4640 | } | 4642 | } |
4641 | 4643 | ||
4642 | /* Work around for rx fifo overflow */ | 4644 | if (unlikely(status & RxFIFOOver)) { |
4643 | if (unlikely(status & RxFIFOOver) && | 4645 | switch (tp->mac_version) { |
4644 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | 4646 | /* Work around for rx fifo overflow */ |
4645 | netif_stop_queue(dev); | 4647 | case RTL_GIGA_MAC_VER_11: |
4646 | rtl8169_tx_timeout(dev); | 4648 | case RTL_GIGA_MAC_VER_22: |
4647 | break; | 4649 | case RTL_GIGA_MAC_VER_26: |
4650 | netif_stop_queue(dev); | ||
4651 | rtl8169_tx_timeout(dev); | ||
4652 | goto done; | ||
4653 | /* Testers needed. */ | ||
4654 | case RTL_GIGA_MAC_VER_17: | ||
4655 | case RTL_GIGA_MAC_VER_19: | ||
4656 | case RTL_GIGA_MAC_VER_20: | ||
4657 | case RTL_GIGA_MAC_VER_21: | ||
4658 | case RTL_GIGA_MAC_VER_23: | ||
4659 | case RTL_GIGA_MAC_VER_24: | ||
4660 | case RTL_GIGA_MAC_VER_27: | ||
4661 | case RTL_GIGA_MAC_VER_28: | ||
4662 | /* Experimental science. Pktgen proof. */ | ||
4663 | case RTL_GIGA_MAC_VER_12: | ||
4664 | case RTL_GIGA_MAC_VER_25: | ||
4665 | if (status == RxFIFOOver) | ||
4666 | goto done; | ||
4667 | break; | ||
4668 | default: | ||
4669 | break; | ||
4670 | } | ||
4648 | } | 4671 | } |
4649 | 4672 | ||
4650 | if (unlikely(status & SYSErr)) { | 4673 | if (unlikely(status & SYSErr)) { |
@@ -4680,7 +4703,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4680 | (status & RxFIFOOver) ? (status | RxOverflow) : status); | 4703 | (status & RxFIFOOver) ? (status | RxOverflow) : status); |
4681 | status = RTL_R16(IntrStatus); | 4704 | status = RTL_R16(IntrStatus); |
4682 | } | 4705 | } |
4683 | 4706 | done: | |
4684 | return IRQ_RETVAL(handled); | 4707 | return IRQ_RETVAL(handled); |
4685 | } | 4708 | } |
4686 | 4709 | ||
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index 01c05f53e2f9..228d4f7a58af 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -3690,7 +3690,7 @@ __vxge_hw_vpath_rts_table_get(struct __vxge_hw_vpath_handle *vp, | |||
3690 | if (status != VXGE_HW_OK) | 3690 | if (status != VXGE_HW_OK) |
3691 | goto exit; | 3691 | goto exit; |
3692 | 3692 | ||
3693 | if ((rts_table != VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_DA) || | 3693 | if ((rts_table != VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_DA) && |
3694 | (rts_table != | 3694 | (rts_table != |
3695 | VXGE_HW_RTS_ACS_STEER_CTRL_DATA_STRUCT_SEL_RTH_MULTI_IT)) | 3695 | VXGE_HW_RTS_ACS_STEER_CTRL_DATA_STRUCT_SEL_RTH_MULTI_IT)) |
3696 | *data1 = 0; | 3696 | *data1 = 0; |
diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c index 0064be7ce5c9..21091c26a9a5 100644 --- a/drivers/net/wireless/ath/ath5k/dma.c +++ b/drivers/net/wireless/ath/ath5k/dma.c | |||
@@ -838,9 +838,9 @@ int ath5k_hw_dma_stop(struct ath5k_hw *ah) | |||
838 | for (i = 0; i < qmax; i++) { | 838 | for (i = 0; i < qmax; i++) { |
839 | err = ath5k_hw_stop_tx_dma(ah, i); | 839 | err = ath5k_hw_stop_tx_dma(ah, i); |
840 | /* -EINVAL -> queue inactive */ | 840 | /* -EINVAL -> queue inactive */ |
841 | if (err != -EINVAL) | 841 | if (err && err != -EINVAL) |
842 | return err; | 842 | return err; |
843 | } | 843 | } |
844 | 844 | ||
845 | return err; | 845 | return 0; |
846 | } | 846 | } |
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c index e5f2b96a4c63..a702817daf72 100644 --- a/drivers/net/wireless/ath/ath5k/pcu.c +++ b/drivers/net/wireless/ath/ath5k/pcu.c | |||
@@ -86,7 +86,7 @@ int ath5k_hw_get_frame_duration(struct ath5k_hw *ah, | |||
86 | if (!ah->ah_bwmode) { | 86 | if (!ah->ah_bwmode) { |
87 | dur = ieee80211_generic_frame_duration(sc->hw, | 87 | dur = ieee80211_generic_frame_duration(sc->hw, |
88 | NULL, len, rate); | 88 | NULL, len, rate); |
89 | return dur; | 89 | return le16_to_cpu(dur); |
90 | } | 90 | } |
91 | 91 | ||
92 | bitrate = rate->bitrate; | 92 | bitrate = rate->bitrate; |
@@ -265,8 +265,6 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah) | |||
265 | * what rate we should choose to TX ACKs. */ | 265 | * what rate we should choose to TX ACKs. */ |
266 | tx_time = ath5k_hw_get_frame_duration(ah, 10, rate); | 266 | tx_time = ath5k_hw_get_frame_duration(ah, 10, rate); |
267 | 267 | ||
268 | tx_time = le16_to_cpu(tx_time); | ||
269 | |||
270 | ath5k_hw_reg_write(ah, tx_time, reg); | 268 | ath5k_hw_reg_write(ah, tx_time, reg); |
271 | 269 | ||
272 | if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE)) | 270 | if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE)) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index f8a7771faee2..f44c84ab5dce 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -426,9 +426,8 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, | |||
426 | } | 426 | } |
427 | 427 | ||
428 | /* WAR for ASPM system hang */ | 428 | /* WAR for ASPM system hang */ |
429 | if (AR_SREV_9280(ah) || AR_SREV_9285(ah) || AR_SREV_9287(ah)) { | 429 | if (AR_SREV_9285(ah) || AR_SREV_9287(ah)) |
430 | val |= (AR_WA_BIT6 | AR_WA_BIT7); | 430 | val |= (AR_WA_BIT6 | AR_WA_BIT7); |
431 | } | ||
432 | 431 | ||
433 | if (AR_SREV_9285E_20(ah)) | 432 | if (AR_SREV_9285E_20(ah)) |
434 | val |= AR_WA_BIT23; | 433 | val |= AR_WA_BIT23; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 38433f9bfe59..0352f0994caa 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -142,9 +142,6 @@ static void ath9k_deinit_priv(struct ath9k_htc_priv *priv) | |||
142 | { | 142 | { |
143 | ath9k_htc_exit_debug(priv->ah); | 143 | ath9k_htc_exit_debug(priv->ah); |
144 | ath9k_hw_deinit(priv->ah); | 144 | ath9k_hw_deinit(priv->ah); |
145 | tasklet_kill(&priv->swba_tasklet); | ||
146 | tasklet_kill(&priv->rx_tasklet); | ||
147 | tasklet_kill(&priv->tx_tasklet); | ||
148 | kfree(priv->ah); | 145 | kfree(priv->ah); |
149 | priv->ah = NULL; | 146 | priv->ah = NULL; |
150 | } | 147 | } |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index f4d576bc3ccd..6bb59958f71e 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1025,12 +1025,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1025 | int ret = 0; | 1025 | int ret = 0; |
1026 | u8 cmd_rsp; | 1026 | u8 cmd_rsp; |
1027 | 1027 | ||
1028 | /* Cancel all the running timers/work .. */ | ||
1029 | cancel_work_sync(&priv->fatal_work); | ||
1030 | cancel_work_sync(&priv->ps_work); | ||
1031 | cancel_delayed_work_sync(&priv->ath9k_led_blink_work); | ||
1032 | ath9k_led_stop_brightness(priv); | ||
1033 | |||
1034 | mutex_lock(&priv->mutex); | 1028 | mutex_lock(&priv->mutex); |
1035 | 1029 | ||
1036 | if (priv->op_flags & OP_INVALID) { | 1030 | if (priv->op_flags & OP_INVALID) { |
@@ -1044,8 +1038,23 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1044 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 1038 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
1045 | WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); | 1039 | WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); |
1046 | WMI_CMD(WMI_STOP_RECV_CMDID); | 1040 | WMI_CMD(WMI_STOP_RECV_CMDID); |
1041 | |||
1042 | tasklet_kill(&priv->swba_tasklet); | ||
1043 | tasklet_kill(&priv->rx_tasklet); | ||
1044 | tasklet_kill(&priv->tx_tasklet); | ||
1045 | |||
1047 | skb_queue_purge(&priv->tx_queue); | 1046 | skb_queue_purge(&priv->tx_queue); |
1048 | 1047 | ||
1048 | mutex_unlock(&priv->mutex); | ||
1049 | |||
1050 | /* Cancel all the running timers/work .. */ | ||
1051 | cancel_work_sync(&priv->fatal_work); | ||
1052 | cancel_work_sync(&priv->ps_work); | ||
1053 | cancel_delayed_work_sync(&priv->ath9k_led_blink_work); | ||
1054 | ath9k_led_stop_brightness(priv); | ||
1055 | |||
1056 | mutex_lock(&priv->mutex); | ||
1057 | |||
1049 | /* Remove monitor interface here */ | 1058 | /* Remove monitor interface here */ |
1050 | if (ah->opmode == NL80211_IFTYPE_MONITOR) { | 1059 | if (ah->opmode == NL80211_IFTYPE_MONITOR) { |
1051 | if (ath9k_htc_remove_monitor_interface(priv)) | 1060 | if (ath9k_htc_remove_monitor_interface(priv)) |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 767d8b86f1e1..087a6a95edd5 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -598,8 +598,6 @@ err_btcoex: | |||
598 | err_queues: | 598 | err_queues: |
599 | ath9k_hw_deinit(ah); | 599 | ath9k_hw_deinit(ah); |
600 | err_hw: | 600 | err_hw: |
601 | tasklet_kill(&sc->intr_tq); | ||
602 | tasklet_kill(&sc->bcon_tasklet); | ||
603 | 601 | ||
604 | kfree(ah); | 602 | kfree(ah); |
605 | sc->sc_ah = NULL; | 603 | sc->sc_ah = NULL; |
@@ -807,9 +805,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc) | |||
807 | 805 | ||
808 | ath9k_hw_deinit(sc->sc_ah); | 806 | ath9k_hw_deinit(sc->sc_ah); |
809 | 807 | ||
810 | tasklet_kill(&sc->intr_tq); | ||
811 | tasklet_kill(&sc->bcon_tasklet); | ||
812 | |||
813 | kfree(sc->sc_ah); | 808 | kfree(sc->sc_ah); |
814 | sc->sc_ah = NULL; | 809 | sc->sc_ah = NULL; |
815 | } | 810 | } |
@@ -824,6 +819,8 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
824 | wiphy_rfkill_stop_polling(sc->hw->wiphy); | 819 | wiphy_rfkill_stop_polling(sc->hw->wiphy); |
825 | ath_deinit_leds(sc); | 820 | ath_deinit_leds(sc); |
826 | 821 | ||
822 | ath9k_ps_restore(sc); | ||
823 | |||
827 | for (i = 0; i < sc->num_sec_wiphy; i++) { | 824 | for (i = 0; i < sc->num_sec_wiphy; i++) { |
828 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; | 825 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; |
829 | if (aphy == NULL) | 826 | if (aphy == NULL) |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index c79c97be6cd4..9040c2ff1909 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -325,6 +325,8 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int | |||
325 | { | 325 | { |
326 | struct ieee80211_hw *hw = sc->hw; | 326 | struct ieee80211_hw *hw = sc->hw; |
327 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 327 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
328 | struct ath_hw *ah = sc->sc_ah; | ||
329 | struct ath_common *common = ath9k_hw_common(ah); | ||
328 | struct ath_tx_control txctl; | 330 | struct ath_tx_control txctl; |
329 | int time_left; | 331 | int time_left; |
330 | 332 | ||
@@ -342,8 +344,12 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int | |||
342 | init_completion(&sc->paprd_complete); | 344 | init_completion(&sc->paprd_complete); |
343 | sc->paprd_pending = true; | 345 | sc->paprd_pending = true; |
344 | txctl.paprd = BIT(chain); | 346 | txctl.paprd = BIT(chain); |
345 | if (ath_tx_start(hw, skb, &txctl) != 0) | 347 | |
348 | if (ath_tx_start(hw, skb, &txctl) != 0) { | ||
349 | ath_dbg(common, ATH_DBG_XMIT, "PAPRD TX failed\n"); | ||
350 | dev_kfree_skb_any(skb); | ||
346 | return false; | 351 | return false; |
352 | } | ||
347 | 353 | ||
348 | time_left = wait_for_completion_timeout(&sc->paprd_complete, | 354 | time_left = wait_for_completion_timeout(&sc->paprd_complete, |
349 | msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); | 355 | msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); |
@@ -953,8 +959,6 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
953 | 959 | ||
954 | spin_unlock_bh(&sc->sc_pcu_lock); | 960 | spin_unlock_bh(&sc->sc_pcu_lock); |
955 | ath9k_ps_restore(sc); | 961 | ath9k_ps_restore(sc); |
956 | |||
957 | ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP); | ||
958 | } | 962 | } |
959 | 963 | ||
960 | int ath_reset(struct ath_softc *sc, bool retry_tx) | 964 | int ath_reset(struct ath_softc *sc, bool retry_tx) |
@@ -1309,6 +1313,9 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1309 | 1313 | ||
1310 | spin_lock_bh(&sc->sc_pcu_lock); | 1314 | spin_lock_bh(&sc->sc_pcu_lock); |
1311 | 1315 | ||
1316 | /* prevent tasklets to enable interrupts once we disable them */ | ||
1317 | ah->imask &= ~ATH9K_INT_GLOBAL; | ||
1318 | |||
1312 | /* make sure h/w will not generate any interrupt | 1319 | /* make sure h/w will not generate any interrupt |
1313 | * before setting the invalid flag. */ | 1320 | * before setting the invalid flag. */ |
1314 | ath9k_hw_disable_interrupts(ah); | 1321 | ath9k_hw_disable_interrupts(ah); |
@@ -1326,6 +1333,12 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1326 | 1333 | ||
1327 | spin_unlock_bh(&sc->sc_pcu_lock); | 1334 | spin_unlock_bh(&sc->sc_pcu_lock); |
1328 | 1335 | ||
1336 | /* we can now sync irq and kill any running tasklets, since we already | ||
1337 | * disabled interrupts and not holding a spin lock */ | ||
1338 | synchronize_irq(sc->irq); | ||
1339 | tasklet_kill(&sc->intr_tq); | ||
1340 | tasklet_kill(&sc->bcon_tasklet); | ||
1341 | |||
1329 | ath9k_ps_restore(sc); | 1342 | ath9k_ps_restore(sc); |
1330 | 1343 | ||
1331 | sc->ps_idle = true; | 1344 | sc->ps_idle = true; |
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index b8433f3a9bc2..62876cd5c41a 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c | |||
@@ -726,9 +726,9 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) | |||
726 | } | 726 | } |
727 | 727 | ||
728 | static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | 728 | static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, |
729 | u8 efuse_data, u8 offset, int *bcontinual, | 729 | u8 efuse_data, u8 offset, int *bcontinual, |
730 | u8 *write_state, struct pgpkt_struct target_pkt, | 730 | u8 *write_state, struct pgpkt_struct *target_pkt, |
731 | int *repeat_times, int *bresult, u8 word_en) | 731 | int *repeat_times, int *bresult, u8 word_en) |
732 | { | 732 | { |
733 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 733 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
734 | struct pgpkt_struct tmp_pkt; | 734 | struct pgpkt_struct tmp_pkt; |
@@ -744,8 +744,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
744 | tmp_pkt.word_en = tmp_header & 0x0F; | 744 | tmp_pkt.word_en = tmp_header & 0x0F; |
745 | tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); | 745 | tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); |
746 | 746 | ||
747 | if (tmp_pkt.offset != target_pkt.offset) { | 747 | if (tmp_pkt.offset != target_pkt->offset) { |
748 | efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; | 748 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1; |
749 | *write_state = PG_STATE_HEADER; | 749 | *write_state = PG_STATE_HEADER; |
750 | } else { | 750 | } else { |
751 | for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) { | 751 | for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) { |
@@ -756,23 +756,23 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
756 | } | 756 | } |
757 | 757 | ||
758 | if (bdataempty == false) { | 758 | if (bdataempty == false) { |
759 | efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; | 759 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1; |
760 | *write_state = PG_STATE_HEADER; | 760 | *write_state = PG_STATE_HEADER; |
761 | } else { | 761 | } else { |
762 | match_word_en = 0x0F; | 762 | match_word_en = 0x0F; |
763 | if (!((target_pkt.word_en & BIT(0)) | | 763 | if (!((target_pkt->word_en & BIT(0)) | |
764 | (tmp_pkt.word_en & BIT(0)))) | 764 | (tmp_pkt.word_en & BIT(0)))) |
765 | match_word_en &= (~BIT(0)); | 765 | match_word_en &= (~BIT(0)); |
766 | 766 | ||
767 | if (!((target_pkt.word_en & BIT(1)) | | 767 | if (!((target_pkt->word_en & BIT(1)) | |
768 | (tmp_pkt.word_en & BIT(1)))) | 768 | (tmp_pkt.word_en & BIT(1)))) |
769 | match_word_en &= (~BIT(1)); | 769 | match_word_en &= (~BIT(1)); |
770 | 770 | ||
771 | if (!((target_pkt.word_en & BIT(2)) | | 771 | if (!((target_pkt->word_en & BIT(2)) | |
772 | (tmp_pkt.word_en & BIT(2)))) | 772 | (tmp_pkt.word_en & BIT(2)))) |
773 | match_word_en &= (~BIT(2)); | 773 | match_word_en &= (~BIT(2)); |
774 | 774 | ||
775 | if (!((target_pkt.word_en & BIT(3)) | | 775 | if (!((target_pkt->word_en & BIT(3)) | |
776 | (tmp_pkt.word_en & BIT(3)))) | 776 | (tmp_pkt.word_en & BIT(3)))) |
777 | match_word_en &= (~BIT(3)); | 777 | match_word_en &= (~BIT(3)); |
778 | 778 | ||
@@ -780,7 +780,7 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
780 | badworden = efuse_word_enable_data_write( | 780 | badworden = efuse_word_enable_data_write( |
781 | hw, *efuse_addr + 1, | 781 | hw, *efuse_addr + 1, |
782 | tmp_pkt.word_en, | 782 | tmp_pkt.word_en, |
783 | target_pkt.data); | 783 | target_pkt->data); |
784 | 784 | ||
785 | if (0x0F != (badworden & 0x0F)) { | 785 | if (0x0F != (badworden & 0x0F)) { |
786 | u8 reorg_offset = offset; | 786 | u8 reorg_offset = offset; |
@@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
791 | } | 791 | } |
792 | 792 | ||
793 | tmp_word_en = 0x0F; | 793 | tmp_word_en = 0x0F; |
794 | if ((target_pkt.word_en & BIT(0)) ^ | 794 | if ((target_pkt->word_en & BIT(0)) ^ |
795 | (match_word_en & BIT(0))) | 795 | (match_word_en & BIT(0))) |
796 | tmp_word_en &= (~BIT(0)); | 796 | tmp_word_en &= (~BIT(0)); |
797 | 797 | ||
798 | if ((target_pkt.word_en & BIT(1)) ^ | 798 | if ((target_pkt->word_en & BIT(1)) ^ |
799 | (match_word_en & BIT(1))) | 799 | (match_word_en & BIT(1))) |
800 | tmp_word_en &= (~BIT(1)); | 800 | tmp_word_en &= (~BIT(1)); |
801 | 801 | ||
802 | if ((target_pkt.word_en & BIT(2)) ^ | 802 | if ((target_pkt->word_en & BIT(2)) ^ |
803 | (match_word_en & BIT(2))) | 803 | (match_word_en & BIT(2))) |
804 | tmp_word_en &= (~BIT(2)); | 804 | tmp_word_en &= (~BIT(2)); |
805 | 805 | ||
806 | if ((target_pkt.word_en & BIT(3)) ^ | 806 | if ((target_pkt->word_en & BIT(3)) ^ |
807 | (match_word_en & BIT(3))) | 807 | (match_word_en & BIT(3))) |
808 | tmp_word_en &= (~BIT(3)); | 808 | tmp_word_en &= (~BIT(3)); |
809 | 809 | ||
810 | if ((tmp_word_en & 0x0F) != 0x0F) { | 810 | if ((tmp_word_en & 0x0F) != 0x0F) { |
811 | *efuse_addr = efuse_get_current_size(hw); | 811 | *efuse_addr = efuse_get_current_size(hw); |
812 | target_pkt.offset = offset; | 812 | target_pkt->offset = offset; |
813 | target_pkt.word_en = tmp_word_en; | 813 | target_pkt->word_en = tmp_word_en; |
814 | } else | 814 | } else |
815 | *bcontinual = false; | 815 | *bcontinual = false; |
816 | *write_state = PG_STATE_HEADER; | 816 | *write_state = PG_STATE_HEADER; |
@@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
821 | } | 821 | } |
822 | } else { | 822 | } else { |
823 | *efuse_addr += (2 * tmp_word_cnts) + 1; | 823 | *efuse_addr += (2 * tmp_word_cnts) + 1; |
824 | target_pkt.offset = offset; | 824 | target_pkt->offset = offset; |
825 | target_pkt.word_en = word_en; | 825 | target_pkt->word_en = word_en; |
826 | *write_state = PG_STATE_HEADER; | 826 | *write_state = PG_STATE_HEADER; |
827 | } | 827 | } |
828 | } | 828 | } |
@@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw, | |||
938 | efuse_write_data_case1(hw, &efuse_addr, | 938 | efuse_write_data_case1(hw, &efuse_addr, |
939 | efuse_data, offset, | 939 | efuse_data, offset, |
940 | &bcontinual, | 940 | &bcontinual, |
941 | &write_state, target_pkt, | 941 | &write_state, &target_pkt, |
942 | &repeat_times, &bresult, | 942 | &repeat_times, &bresult, |
943 | word_en); | 943 | word_en); |
944 | else | 944 | else |
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c index 46714910f98c..7145ea543783 100644 --- a/drivers/net/wireless/wl12xx/spi.c +++ b/drivers/net/wireless/wl12xx/spi.c | |||
@@ -110,9 +110,8 @@ static void wl1271_spi_reset(struct wl1271 *wl) | |||
110 | spi_message_add_tail(&t, &m); | 110 | spi_message_add_tail(&t, &m); |
111 | 111 | ||
112 | spi_sync(wl_to_spi(wl), &m); | 112 | spi_sync(wl_to_spi(wl), &m); |
113 | kfree(cmd); | ||
114 | |||
115 | wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); | 113 | wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); |
114 | kfree(cmd); | ||
116 | } | 115 | } |
117 | 116 | ||
118 | static void wl1271_spi_init(struct wl1271 *wl) | 117 | static void wl1271_spi_init(struct wl1271 *wl) |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 546de5749824..da1f12120346 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -120,6 +120,9 @@ struct netfront_info { | |||
120 | unsigned long rx_pfn_array[NET_RX_RING_SIZE]; | 120 | unsigned long rx_pfn_array[NET_RX_RING_SIZE]; |
121 | struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1]; | 121 | struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1]; |
122 | struct mmu_update rx_mmu[NET_RX_RING_SIZE]; | 122 | struct mmu_update rx_mmu[NET_RX_RING_SIZE]; |
123 | |||
124 | /* Statistics */ | ||
125 | int rx_gso_checksum_fixup; | ||
123 | }; | 126 | }; |
124 | 127 | ||
125 | struct netfront_rx_info { | 128 | struct netfront_rx_info { |
@@ -770,11 +773,29 @@ static RING_IDX xennet_fill_frags(struct netfront_info *np, | |||
770 | return cons; | 773 | return cons; |
771 | } | 774 | } |
772 | 775 | ||
773 | static int skb_checksum_setup(struct sk_buff *skb) | 776 | static int checksum_setup(struct net_device *dev, struct sk_buff *skb) |
774 | { | 777 | { |
775 | struct iphdr *iph; | 778 | struct iphdr *iph; |
776 | unsigned char *th; | 779 | unsigned char *th; |
777 | int err = -EPROTO; | 780 | int err = -EPROTO; |
781 | int recalculate_partial_csum = 0; | ||
782 | |||
783 | /* | ||
784 | * A GSO SKB must be CHECKSUM_PARTIAL. However some buggy | ||
785 | * peers can fail to set NETRXF_csum_blank when sending a GSO | ||
786 | * frame. In this case force the SKB to CHECKSUM_PARTIAL and | ||
787 | * recalculate the partial checksum. | ||
788 | */ | ||
789 | if (skb->ip_summed != CHECKSUM_PARTIAL && skb_is_gso(skb)) { | ||
790 | struct netfront_info *np = netdev_priv(dev); | ||
791 | np->rx_gso_checksum_fixup++; | ||
792 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
793 | recalculate_partial_csum = 1; | ||
794 | } | ||
795 | |||
796 | /* A non-CHECKSUM_PARTIAL SKB does not require setup. */ | ||
797 | if (skb->ip_summed != CHECKSUM_PARTIAL) | ||
798 | return 0; | ||
778 | 799 | ||
779 | if (skb->protocol != htons(ETH_P_IP)) | 800 | if (skb->protocol != htons(ETH_P_IP)) |
780 | goto out; | 801 | goto out; |
@@ -788,9 +809,23 @@ static int skb_checksum_setup(struct sk_buff *skb) | |||
788 | switch (iph->protocol) { | 809 | switch (iph->protocol) { |
789 | case IPPROTO_TCP: | 810 | case IPPROTO_TCP: |
790 | skb->csum_offset = offsetof(struct tcphdr, check); | 811 | skb->csum_offset = offsetof(struct tcphdr, check); |
812 | |||
813 | if (recalculate_partial_csum) { | ||
814 | struct tcphdr *tcph = (struct tcphdr *)th; | ||
815 | tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, | ||
816 | skb->len - iph->ihl*4, | ||
817 | IPPROTO_TCP, 0); | ||
818 | } | ||
791 | break; | 819 | break; |
792 | case IPPROTO_UDP: | 820 | case IPPROTO_UDP: |
793 | skb->csum_offset = offsetof(struct udphdr, check); | 821 | skb->csum_offset = offsetof(struct udphdr, check); |
822 | |||
823 | if (recalculate_partial_csum) { | ||
824 | struct udphdr *udph = (struct udphdr *)th; | ||
825 | udph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, | ||
826 | skb->len - iph->ihl*4, | ||
827 | IPPROTO_UDP, 0); | ||
828 | } | ||
794 | break; | 829 | break; |
795 | default: | 830 | default: |
796 | if (net_ratelimit()) | 831 | if (net_ratelimit()) |
@@ -829,13 +864,11 @@ static int handle_incoming_queue(struct net_device *dev, | |||
829 | /* Ethernet work: Delayed to here as it peeks the header. */ | 864 | /* Ethernet work: Delayed to here as it peeks the header. */ |
830 | skb->protocol = eth_type_trans(skb, dev); | 865 | skb->protocol = eth_type_trans(skb, dev); |
831 | 866 | ||
832 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 867 | if (checksum_setup(dev, skb)) { |
833 | if (skb_checksum_setup(skb)) { | 868 | kfree_skb(skb); |
834 | kfree_skb(skb); | 869 | packets_dropped++; |
835 | packets_dropped++; | 870 | dev->stats.rx_errors++; |
836 | dev->stats.rx_errors++; | 871 | continue; |
837 | continue; | ||
838 | } | ||
839 | } | 872 | } |
840 | 873 | ||
841 | dev->stats.rx_packets++; | 874 | dev->stats.rx_packets++; |
@@ -1632,12 +1665,59 @@ static void netback_changed(struct xenbus_device *dev, | |||
1632 | } | 1665 | } |
1633 | } | 1666 | } |
1634 | 1667 | ||
1668 | static const struct xennet_stat { | ||
1669 | char name[ETH_GSTRING_LEN]; | ||
1670 | u16 offset; | ||
1671 | } xennet_stats[] = { | ||
1672 | { | ||
1673 | "rx_gso_checksum_fixup", | ||
1674 | offsetof(struct netfront_info, rx_gso_checksum_fixup) | ||
1675 | }, | ||
1676 | }; | ||
1677 | |||
1678 | static int xennet_get_sset_count(struct net_device *dev, int string_set) | ||
1679 | { | ||
1680 | switch (string_set) { | ||
1681 | case ETH_SS_STATS: | ||
1682 | return ARRAY_SIZE(xennet_stats); | ||
1683 | default: | ||
1684 | return -EINVAL; | ||
1685 | } | ||
1686 | } | ||
1687 | |||
1688 | static void xennet_get_ethtool_stats(struct net_device *dev, | ||
1689 | struct ethtool_stats *stats, u64 * data) | ||
1690 | { | ||
1691 | void *np = netdev_priv(dev); | ||
1692 | int i; | ||
1693 | |||
1694 | for (i = 0; i < ARRAY_SIZE(xennet_stats); i++) | ||
1695 | data[i] = *(int *)(np + xennet_stats[i].offset); | ||
1696 | } | ||
1697 | |||
1698 | static void xennet_get_strings(struct net_device *dev, u32 stringset, u8 * data) | ||
1699 | { | ||
1700 | int i; | ||
1701 | |||
1702 | switch (stringset) { | ||
1703 | case ETH_SS_STATS: | ||
1704 | for (i = 0; i < ARRAY_SIZE(xennet_stats); i++) | ||
1705 | memcpy(data + i * ETH_GSTRING_LEN, | ||
1706 | xennet_stats[i].name, ETH_GSTRING_LEN); | ||
1707 | break; | ||
1708 | } | ||
1709 | } | ||
1710 | |||
1635 | static const struct ethtool_ops xennet_ethtool_ops = | 1711 | static const struct ethtool_ops xennet_ethtool_ops = |
1636 | { | 1712 | { |
1637 | .set_tx_csum = ethtool_op_set_tx_csum, | 1713 | .set_tx_csum = ethtool_op_set_tx_csum, |
1638 | .set_sg = xennet_set_sg, | 1714 | .set_sg = xennet_set_sg, |
1639 | .set_tso = xennet_set_tso, | 1715 | .set_tso = xennet_set_tso, |
1640 | .get_link = ethtool_op_get_link, | 1716 | .get_link = ethtool_op_get_link, |
1717 | |||
1718 | .get_sset_count = xennet_get_sset_count, | ||
1719 | .get_ethtool_stats = xennet_get_ethtool_stats, | ||
1720 | .get_strings = xennet_get_strings, | ||
1641 | }; | 1721 | }; |
1642 | 1722 | ||
1643 | #ifdef CONFIG_SYSFS | 1723 | #ifdef CONFIG_SYSFS |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 65ebee0a3266..b6a6356d09b3 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -565,7 +565,7 @@ static int netiucv_callback_connreq(struct iucv_path *path, | |||
565 | struct iucv_event ev; | 565 | struct iucv_event ev; |
566 | int rc; | 566 | int rc; |
567 | 567 | ||
568 | if (memcmp(iucvMagic, ipuser, sizeof(ipuser))) | 568 | if (memcmp(iucvMagic, ipuser, 16)) |
569 | /* ipuser must match iucvMagic. */ | 569 | /* ipuser must match iucvMagic. */ |
570 | return -EINVAL; | 570 | return -EINVAL; |
571 | rc = -EINVAL; | 571 | rc = -EINVAL; |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 29f848bfc12f..019ae58ab913 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -988,16 +988,30 @@ static void qeth_get_channel_path_desc(struct qeth_card *card) | |||
988 | chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0); | 988 | chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0); |
989 | if (chp_dsc != NULL) { | 989 | if (chp_dsc != NULL) { |
990 | /* CHPP field bit 6 == 1 -> single queue */ | 990 | /* CHPP field bit 6 == 1 -> single queue */ |
991 | if ((chp_dsc->chpp & 0x02) == 0x02) | 991 | if ((chp_dsc->chpp & 0x02) == 0x02) { |
992 | if ((atomic_read(&card->qdio.state) != | ||
993 | QETH_QDIO_UNINITIALIZED) && | ||
994 | (card->qdio.no_out_queues == 4)) | ||
995 | /* change from 4 to 1 outbound queues */ | ||
996 | qeth_free_qdio_buffers(card); | ||
992 | card->qdio.no_out_queues = 1; | 997 | card->qdio.no_out_queues = 1; |
998 | if (card->qdio.default_out_queue != 0) | ||
999 | dev_info(&card->gdev->dev, | ||
1000 | "Priority Queueing not supported\n"); | ||
1001 | card->qdio.default_out_queue = 0; | ||
1002 | } else { | ||
1003 | if ((atomic_read(&card->qdio.state) != | ||
1004 | QETH_QDIO_UNINITIALIZED) && | ||
1005 | (card->qdio.no_out_queues == 1)) { | ||
1006 | /* change from 1 to 4 outbound queues */ | ||
1007 | qeth_free_qdio_buffers(card); | ||
1008 | card->qdio.default_out_queue = 2; | ||
1009 | } | ||
1010 | card->qdio.no_out_queues = 4; | ||
1011 | } | ||
993 | card->info.func_level = 0x4100 + chp_dsc->desc; | 1012 | card->info.func_level = 0x4100 + chp_dsc->desc; |
994 | kfree(chp_dsc); | 1013 | kfree(chp_dsc); |
995 | } | 1014 | } |
996 | if (card->qdio.no_out_queues == 1) { | ||
997 | card->qdio.default_out_queue = 0; | ||
998 | dev_info(&card->gdev->dev, | ||
999 | "Priority Queueing not supported\n"); | ||
1000 | } | ||
1001 | QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues); | 1015 | QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues); |
1002 | QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level); | 1016 | QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level); |
1003 | return; | 1017 | return; |
@@ -1832,33 +1846,6 @@ static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card) | |||
1832 | } | 1846 | } |
1833 | } | 1847 | } |
1834 | 1848 | ||
1835 | static inline int qeth_get_max_mtu_for_card(int cardtype) | ||
1836 | { | ||
1837 | switch (cardtype) { | ||
1838 | |||
1839 | case QETH_CARD_TYPE_UNKNOWN: | ||
1840 | case QETH_CARD_TYPE_OSD: | ||
1841 | case QETH_CARD_TYPE_OSN: | ||
1842 | case QETH_CARD_TYPE_OSM: | ||
1843 | case QETH_CARD_TYPE_OSX: | ||
1844 | return 61440; | ||
1845 | case QETH_CARD_TYPE_IQD: | ||
1846 | return 57344; | ||
1847 | default: | ||
1848 | return 1500; | ||
1849 | } | ||
1850 | } | ||
1851 | |||
1852 | static inline int qeth_get_mtu_out_of_mpc(int cardtype) | ||
1853 | { | ||
1854 | switch (cardtype) { | ||
1855 | case QETH_CARD_TYPE_IQD: | ||
1856 | return 1; | ||
1857 | default: | ||
1858 | return 0; | ||
1859 | } | ||
1860 | } | ||
1861 | |||
1862 | static inline int qeth_get_mtu_outof_framesize(int framesize) | 1849 | static inline int qeth_get_mtu_outof_framesize(int framesize) |
1863 | { | 1850 | { |
1864 | switch (framesize) { | 1851 | switch (framesize) { |
@@ -1881,10 +1868,9 @@ static inline int qeth_mtu_is_valid(struct qeth_card *card, int mtu) | |||
1881 | case QETH_CARD_TYPE_OSD: | 1868 | case QETH_CARD_TYPE_OSD: |
1882 | case QETH_CARD_TYPE_OSM: | 1869 | case QETH_CARD_TYPE_OSM: |
1883 | case QETH_CARD_TYPE_OSX: | 1870 | case QETH_CARD_TYPE_OSX: |
1884 | return ((mtu >= 576) && (mtu <= 61440)); | ||
1885 | case QETH_CARD_TYPE_IQD: | 1871 | case QETH_CARD_TYPE_IQD: |
1886 | return ((mtu >= 576) && | 1872 | return ((mtu >= 576) && |
1887 | (mtu <= card->info.max_mtu + 4096 - 32)); | 1873 | (mtu <= card->info.max_mtu)); |
1888 | case QETH_CARD_TYPE_OSN: | 1874 | case QETH_CARD_TYPE_OSN: |
1889 | case QETH_CARD_TYPE_UNKNOWN: | 1875 | case QETH_CARD_TYPE_UNKNOWN: |
1890 | default: | 1876 | default: |
@@ -1907,7 +1893,7 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply, | |||
1907 | memcpy(&card->token.ulp_filter_r, | 1893 | memcpy(&card->token.ulp_filter_r, |
1908 | QETH_ULP_ENABLE_RESP_FILTER_TOKEN(iob->data), | 1894 | QETH_ULP_ENABLE_RESP_FILTER_TOKEN(iob->data), |
1909 | QETH_MPC_TOKEN_LENGTH); | 1895 | QETH_MPC_TOKEN_LENGTH); |
1910 | if (qeth_get_mtu_out_of_mpc(card->info.type)) { | 1896 | if (card->info.type == QETH_CARD_TYPE_IQD) { |
1911 | memcpy(&framesize, QETH_ULP_ENABLE_RESP_MAX_MTU(iob->data), 2); | 1897 | memcpy(&framesize, QETH_ULP_ENABLE_RESP_MAX_MTU(iob->data), 2); |
1912 | mtu = qeth_get_mtu_outof_framesize(framesize); | 1898 | mtu = qeth_get_mtu_outof_framesize(framesize); |
1913 | if (!mtu) { | 1899 | if (!mtu) { |
@@ -1915,12 +1901,21 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply, | |||
1915 | QETH_DBF_TEXT_(SETUP, 2, " rc%d", iob->rc); | 1901 | QETH_DBF_TEXT_(SETUP, 2, " rc%d", iob->rc); |
1916 | return 0; | 1902 | return 0; |
1917 | } | 1903 | } |
1918 | card->info.max_mtu = mtu; | 1904 | if (card->info.initial_mtu && (card->info.initial_mtu != mtu)) { |
1905 | /* frame size has changed */ | ||
1906 | if (card->dev && | ||
1907 | ((card->dev->mtu == card->info.initial_mtu) || | ||
1908 | (card->dev->mtu > mtu))) | ||
1909 | card->dev->mtu = mtu; | ||
1910 | qeth_free_qdio_buffers(card); | ||
1911 | } | ||
1919 | card->info.initial_mtu = mtu; | 1912 | card->info.initial_mtu = mtu; |
1913 | card->info.max_mtu = mtu; | ||
1920 | card->qdio.in_buf_size = mtu + 2 * PAGE_SIZE; | 1914 | card->qdio.in_buf_size = mtu + 2 * PAGE_SIZE; |
1921 | } else { | 1915 | } else { |
1922 | card->info.initial_mtu = qeth_get_initial_mtu_for_card(card); | 1916 | card->info.initial_mtu = qeth_get_initial_mtu_for_card(card); |
1923 | card->info.max_mtu = qeth_get_max_mtu_for_card(card->info.type); | 1917 | card->info.max_mtu = *(__u16 *)QETH_ULP_ENABLE_RESP_MAX_MTU( |
1918 | iob->data); | ||
1924 | card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT; | 1919 | card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT; |
1925 | } | 1920 | } |
1926 | 1921 | ||
@@ -3775,6 +3770,47 @@ static inline int qeth_get_qdio_q_format(struct qeth_card *card) | |||
3775 | } | 3770 | } |
3776 | } | 3771 | } |
3777 | 3772 | ||
3773 | static void qeth_determine_capabilities(struct qeth_card *card) | ||
3774 | { | ||
3775 | int rc; | ||
3776 | int length; | ||
3777 | char *prcd; | ||
3778 | struct ccw_device *ddev; | ||
3779 | int ddev_offline = 0; | ||
3780 | |||
3781 | QETH_DBF_TEXT(SETUP, 2, "detcapab"); | ||
3782 | ddev = CARD_DDEV(card); | ||
3783 | if (!ddev->online) { | ||
3784 | ddev_offline = 1; | ||
3785 | rc = ccw_device_set_online(ddev); | ||
3786 | if (rc) { | ||
3787 | QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); | ||
3788 | goto out; | ||
3789 | } | ||
3790 | } | ||
3791 | |||
3792 | rc = qeth_read_conf_data(card, (void **) &prcd, &length); | ||
3793 | if (rc) { | ||
3794 | QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n", | ||
3795 | dev_name(&card->gdev->dev), rc); | ||
3796 | QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc); | ||
3797 | goto out_offline; | ||
3798 | } | ||
3799 | qeth_configure_unitaddr(card, prcd); | ||
3800 | qeth_configure_blkt_default(card, prcd); | ||
3801 | kfree(prcd); | ||
3802 | |||
3803 | rc = qdio_get_ssqd_desc(ddev, &card->ssqd); | ||
3804 | if (rc) | ||
3805 | QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc); | ||
3806 | |||
3807 | out_offline: | ||
3808 | if (ddev_offline == 1) | ||
3809 | ccw_device_set_offline(ddev); | ||
3810 | out: | ||
3811 | return; | ||
3812 | } | ||
3813 | |||
3778 | static int qeth_qdio_establish(struct qeth_card *card) | 3814 | static int qeth_qdio_establish(struct qeth_card *card) |
3779 | { | 3815 | { |
3780 | struct qdio_initialize init_data; | 3816 | struct qdio_initialize init_data; |
@@ -3905,6 +3941,7 @@ int qeth_core_hardsetup_card(struct qeth_card *card) | |||
3905 | 3941 | ||
3906 | QETH_DBF_TEXT(SETUP, 2, "hrdsetup"); | 3942 | QETH_DBF_TEXT(SETUP, 2, "hrdsetup"); |
3907 | atomic_set(&card->force_alloc_skb, 0); | 3943 | atomic_set(&card->force_alloc_skb, 0); |
3944 | qeth_get_channel_path_desc(card); | ||
3908 | retry: | 3945 | retry: |
3909 | if (retries) | 3946 | if (retries) |
3910 | QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", | 3947 | QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", |
@@ -3933,6 +3970,7 @@ retriable: | |||
3933 | else | 3970 | else |
3934 | goto retry; | 3971 | goto retry; |
3935 | } | 3972 | } |
3973 | qeth_determine_capabilities(card); | ||
3936 | qeth_init_tokens(card); | 3974 | qeth_init_tokens(card); |
3937 | qeth_init_func_level(card); | 3975 | qeth_init_func_level(card); |
3938 | rc = qeth_idx_activate_channel(&card->read, qeth_idx_read_cb); | 3976 | rc = qeth_idx_activate_channel(&card->read, qeth_idx_read_cb); |
@@ -4202,41 +4240,6 @@ void qeth_core_free_discipline(struct qeth_card *card) | |||
4202 | card->discipline.ccwgdriver = NULL; | 4240 | card->discipline.ccwgdriver = NULL; |
4203 | } | 4241 | } |
4204 | 4242 | ||
4205 | static void qeth_determine_capabilities(struct qeth_card *card) | ||
4206 | { | ||
4207 | int rc; | ||
4208 | int length; | ||
4209 | char *prcd; | ||
4210 | |||
4211 | QETH_DBF_TEXT(SETUP, 2, "detcapab"); | ||
4212 | rc = ccw_device_set_online(CARD_DDEV(card)); | ||
4213 | if (rc) { | ||
4214 | QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); | ||
4215 | goto out; | ||
4216 | } | ||
4217 | |||
4218 | |||
4219 | rc = qeth_read_conf_data(card, (void **) &prcd, &length); | ||
4220 | if (rc) { | ||
4221 | QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n", | ||
4222 | dev_name(&card->gdev->dev), rc); | ||
4223 | QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc); | ||
4224 | goto out_offline; | ||
4225 | } | ||
4226 | qeth_configure_unitaddr(card, prcd); | ||
4227 | qeth_configure_blkt_default(card, prcd); | ||
4228 | kfree(prcd); | ||
4229 | |||
4230 | rc = qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd); | ||
4231 | if (rc) | ||
4232 | QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc); | ||
4233 | |||
4234 | out_offline: | ||
4235 | ccw_device_set_offline(CARD_DDEV(card)); | ||
4236 | out: | ||
4237 | return; | ||
4238 | } | ||
4239 | |||
4240 | static int qeth_core_probe_device(struct ccwgroup_device *gdev) | 4243 | static int qeth_core_probe_device(struct ccwgroup_device *gdev) |
4241 | { | 4244 | { |
4242 | struct qeth_card *card; | 4245 | struct qeth_card *card; |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 2ac8f6aff5a4..ada0fe782373 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -573,13 +573,13 @@ static int qeth_l2_send_setmac_cb(struct qeth_card *card, | |||
573 | case IPA_RC_L2_DUP_LAYER3_MAC: | 573 | case IPA_RC_L2_DUP_LAYER3_MAC: |
574 | dev_warn(&card->gdev->dev, | 574 | dev_warn(&card->gdev->dev, |
575 | "MAC address %pM already exists\n", | 575 | "MAC address %pM already exists\n", |
576 | card->dev->dev_addr); | 576 | cmd->data.setdelmac.mac); |
577 | break; | 577 | break; |
578 | case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP: | 578 | case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP: |
579 | case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP: | 579 | case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP: |
580 | dev_warn(&card->gdev->dev, | 580 | dev_warn(&card->gdev->dev, |
581 | "MAC address %pM is not authorized\n", | 581 | "MAC address %pM is not authorized\n", |
582 | card->dev->dev_addr); | 582 | cmd->data.setdelmac.mac); |
583 | break; | 583 | break; |
584 | default: | 584 | default: |
585 | break; | 585 | break; |
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 65e1cf104943..207b7d742443 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c | |||
@@ -60,7 +60,7 @@ static struct iucv_handler smsg_handler = { | |||
60 | static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], | 60 | static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], |
61 | u8 ipuser[16]) | 61 | u8 ipuser[16]) |
62 | { | 62 | { |
63 | if (strncmp(ipvmid, "*MSG ", sizeof(ipvmid)) != 0) | 63 | if (strncmp(ipvmid, "*MSG ", 8) != 0) |
64 | return -EINVAL; | 64 | return -EINVAL; |
65 | /* Path pending from *MSG. */ | 65 | /* Path pending from *MSG. */ |
66 | return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL); | 66 | return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL); |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 9b3ca103135f..f616cefc95ba 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -128,8 +128,7 @@ static void handle_tx(struct vhost_net *net) | |||
128 | size_t hdr_size; | 128 | size_t hdr_size; |
129 | struct socket *sock; | 129 | struct socket *sock; |
130 | 130 | ||
131 | /* TODO: check that we are running from vhost_worker? | 131 | /* TODO: check that we are running from vhost_worker? */ |
132 | * Not sure it's worth it, it's straight-forward enough. */ | ||
133 | sock = rcu_dereference_check(vq->private_data, 1); | 132 | sock = rcu_dereference_check(vq->private_data, 1); |
134 | if (!sock) | 133 | if (!sock) |
135 | return; | 134 | return; |
@@ -306,7 +305,8 @@ static void handle_rx_big(struct vhost_net *net) | |||
306 | size_t len, total_len = 0; | 305 | size_t len, total_len = 0; |
307 | int err; | 306 | int err; |
308 | size_t hdr_size; | 307 | size_t hdr_size; |
309 | struct socket *sock = rcu_dereference(vq->private_data); | 308 | /* TODO: check that we are running from vhost_worker? */ |
309 | struct socket *sock = rcu_dereference_check(vq->private_data, 1); | ||
310 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 310 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
311 | return; | 311 | return; |
312 | 312 | ||
@@ -415,7 +415,8 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
415 | int err, headcount; | 415 | int err, headcount; |
416 | size_t vhost_hlen, sock_hlen; | 416 | size_t vhost_hlen, sock_hlen; |
417 | size_t vhost_len, sock_len; | 417 | size_t vhost_len, sock_len; |
418 | struct socket *sock = rcu_dereference(vq->private_data); | 418 | /* TODO: check that we are running from vhost_worker? */ |
419 | struct socket *sock = rcu_dereference_check(vq->private_data, 1); | ||
419 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 420 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
420 | return; | 421 | return; |
421 | 422 | ||
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 2af44b7b1f3f..b3363ae38518 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -173,9 +173,9 @@ static inline int vhost_has_feature(struct vhost_dev *dev, int bit) | |||
173 | { | 173 | { |
174 | unsigned acked_features; | 174 | unsigned acked_features; |
175 | 175 | ||
176 | acked_features = | 176 | /* TODO: check that we are running from vhost_worker or dev mutex is |
177 | rcu_dereference_index_check(dev->acked_features, | 177 | * held? */ |
178 | lockdep_is_held(&dev->mutex)); | 178 | acked_features = rcu_dereference_index_check(dev->acked_features, 1); |
179 | return acked_features & (1 << bit); | 179 | return acked_features & (1 << bit); |
180 | } | 180 | } |
181 | 181 | ||