diff options
67 files changed, 801 insertions, 464 deletions
diff --git a/Documentation/networking/netconsole.txt b/Documentation/networking/netconsole.txt index 3c2f2b328638..8d022073e3ef 100644 --- a/Documentation/networking/netconsole.txt +++ b/Documentation/networking/netconsole.txt | |||
@@ -51,7 +51,8 @@ Built-in netconsole starts immediately after the TCP stack is | |||
51 | initialized and attempts to bring up the supplied dev at the supplied | 51 | initialized and attempts to bring up the supplied dev at the supplied |
52 | address. | 52 | address. |
53 | 53 | ||
54 | The remote host can run either 'netcat -u -l -p <port>' or syslogd. | 54 | The remote host can run either 'netcat -u -l -p <port>', |
55 | 'nc -l -u <port>' or syslogd. | ||
55 | 56 | ||
56 | Dynamic reconfiguration: | 57 | Dynamic reconfiguration: |
57 | ======================== | 58 | ======================== |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index a3551dd0324d..aa30b5cb3513 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -431,6 +431,7 @@ set_arg(void __user *b, void *val,int len) | |||
431 | return 0; | 431 | return 0; |
432 | } | 432 | } |
433 | 433 | ||
434 | #ifdef CONFIG_IPPP_FILTER | ||
434 | static int get_filter(void __user *arg, struct sock_filter **p) | 435 | static int get_filter(void __user *arg, struct sock_filter **p) |
435 | { | 436 | { |
436 | struct sock_fprog uprog; | 437 | struct sock_fprog uprog; |
@@ -465,6 +466,7 @@ static int get_filter(void __user *arg, struct sock_filter **p) | |||
465 | *p = code; | 466 | *p = code; |
466 | return uprog.len; | 467 | return uprog.len; |
467 | } | 468 | } |
469 | #endif /* CONFIG_IPPP_FILTER */ | ||
468 | 470 | ||
469 | /* | 471 | /* |
470 | * ippp device ioctl | 472 | * ippp device ioctl |
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 6fcccef4cf3d..15a5cf0f676b 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* bnx2x.h: Broadcom Everest network driver. | 1 | /* bnx2x.h: Broadcom Everest network driver. |
2 | * | 2 | * |
3 | * Copyright (c) 2007-2008 Broadcom Corporation | 3 | * Copyright (c) 2007-2009 Broadcom Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -271,14 +271,7 @@ struct bnx2x_fastpath { | |||
271 | 271 | ||
272 | #define bnx2x_fp(bp, nr, var) (bp->fp[nr].var) | 272 | #define bnx2x_fp(bp, nr, var) (bp->fp[nr].var) |
273 | 273 | ||
274 | #define BNX2X_HAS_TX_WORK(fp) \ | 274 | #define BNX2X_HAS_WORK(fp) (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp)) |
275 | ((fp->tx_pkt_prod != le16_to_cpu(*fp->tx_cons_sb)) || \ | ||
276 | (fp->tx_pkt_prod != fp->tx_pkt_cons)) | ||
277 | |||
278 | #define BNX2X_HAS_RX_WORK(fp) \ | ||
279 | (fp->rx_comp_cons != rx_cons_sb) | ||
280 | |||
281 | #define BNX2X_HAS_WORK(fp) (BNX2X_HAS_RX_WORK(fp) || BNX2X_HAS_TX_WORK(fp)) | ||
282 | 275 | ||
283 | 276 | ||
284 | /* MC hsi */ | 277 | /* MC hsi */ |
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c index fefa6ab13064..aea26b4dc453 100644 --- a/drivers/net/bnx2x_link.c +++ b/drivers/net/bnx2x_link.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright 2008 Broadcom Corporation | 1 | /* Copyright 2008-2009 Broadcom Corporation |
2 | * | 2 | * |
3 | * Unless you and Broadcom execute a separate written software license | 3 | * Unless you and Broadcom execute a separate written software license |
4 | * agreement governing use of this software, this software is licensed to you | 4 | * agreement governing use of this software, this software is licensed to you |
@@ -317,6 +317,9 @@ static u8 bnx2x_emac_enable(struct link_params *params, | |||
317 | val &= ~0x810; | 317 | val &= ~0x810; |
318 | EMAC_WR(bp, EMAC_REG_EMAC_MODE, val); | 318 | EMAC_WR(bp, EMAC_REG_EMAC_MODE, val); |
319 | 319 | ||
320 | /* enable emac */ | ||
321 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 1); | ||
322 | |||
320 | /* enable emac for jumbo packets */ | 323 | /* enable emac for jumbo packets */ |
321 | EMAC_WR(bp, EMAC_REG_EMAC_RX_MTU_SIZE, | 324 | EMAC_WR(bp, EMAC_REG_EMAC_RX_MTU_SIZE, |
322 | (EMAC_RX_MTU_SIZE_JUMBO_ENA | | 325 | (EMAC_RX_MTU_SIZE_JUMBO_ENA | |
@@ -1609,7 +1612,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1609 | u32 gp_status) | 1612 | u32 gp_status) |
1610 | { | 1613 | { |
1611 | struct bnx2x *bp = params->bp; | 1614 | struct bnx2x *bp = params->bp; |
1612 | 1615 | u16 new_line_speed; | |
1613 | u8 rc = 0; | 1616 | u8 rc = 0; |
1614 | vars->link_status = 0; | 1617 | vars->link_status = 0; |
1615 | 1618 | ||
@@ -1629,7 +1632,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1629 | 1632 | ||
1630 | switch (gp_status & GP_STATUS_SPEED_MASK) { | 1633 | switch (gp_status & GP_STATUS_SPEED_MASK) { |
1631 | case GP_STATUS_10M: | 1634 | case GP_STATUS_10M: |
1632 | vars->line_speed = SPEED_10; | 1635 | new_line_speed = SPEED_10; |
1633 | if (vars->duplex == DUPLEX_FULL) | 1636 | if (vars->duplex == DUPLEX_FULL) |
1634 | vars->link_status |= LINK_10TFD; | 1637 | vars->link_status |= LINK_10TFD; |
1635 | else | 1638 | else |
@@ -1637,7 +1640,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1637 | break; | 1640 | break; |
1638 | 1641 | ||
1639 | case GP_STATUS_100M: | 1642 | case GP_STATUS_100M: |
1640 | vars->line_speed = SPEED_100; | 1643 | new_line_speed = SPEED_100; |
1641 | if (vars->duplex == DUPLEX_FULL) | 1644 | if (vars->duplex == DUPLEX_FULL) |
1642 | vars->link_status |= LINK_100TXFD; | 1645 | vars->link_status |= LINK_100TXFD; |
1643 | else | 1646 | else |
@@ -1646,7 +1649,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1646 | 1649 | ||
1647 | case GP_STATUS_1G: | 1650 | case GP_STATUS_1G: |
1648 | case GP_STATUS_1G_KX: | 1651 | case GP_STATUS_1G_KX: |
1649 | vars->line_speed = SPEED_1000; | 1652 | new_line_speed = SPEED_1000; |
1650 | if (vars->duplex == DUPLEX_FULL) | 1653 | if (vars->duplex == DUPLEX_FULL) |
1651 | vars->link_status |= LINK_1000TFD; | 1654 | vars->link_status |= LINK_1000TFD; |
1652 | else | 1655 | else |
@@ -1654,7 +1657,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1654 | break; | 1657 | break; |
1655 | 1658 | ||
1656 | case GP_STATUS_2_5G: | 1659 | case GP_STATUS_2_5G: |
1657 | vars->line_speed = SPEED_2500; | 1660 | new_line_speed = SPEED_2500; |
1658 | if (vars->duplex == DUPLEX_FULL) | 1661 | if (vars->duplex == DUPLEX_FULL) |
1659 | vars->link_status |= LINK_2500TFD; | 1662 | vars->link_status |= LINK_2500TFD; |
1660 | else | 1663 | else |
@@ -1671,32 +1674,32 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1671 | case GP_STATUS_10G_KX4: | 1674 | case GP_STATUS_10G_KX4: |
1672 | case GP_STATUS_10G_HIG: | 1675 | case GP_STATUS_10G_HIG: |
1673 | case GP_STATUS_10G_CX4: | 1676 | case GP_STATUS_10G_CX4: |
1674 | vars->line_speed = SPEED_10000; | 1677 | new_line_speed = SPEED_10000; |
1675 | vars->link_status |= LINK_10GTFD; | 1678 | vars->link_status |= LINK_10GTFD; |
1676 | break; | 1679 | break; |
1677 | 1680 | ||
1678 | case GP_STATUS_12G_HIG: | 1681 | case GP_STATUS_12G_HIG: |
1679 | vars->line_speed = SPEED_12000; | 1682 | new_line_speed = SPEED_12000; |
1680 | vars->link_status |= LINK_12GTFD; | 1683 | vars->link_status |= LINK_12GTFD; |
1681 | break; | 1684 | break; |
1682 | 1685 | ||
1683 | case GP_STATUS_12_5G: | 1686 | case GP_STATUS_12_5G: |
1684 | vars->line_speed = SPEED_12500; | 1687 | new_line_speed = SPEED_12500; |
1685 | vars->link_status |= LINK_12_5GTFD; | 1688 | vars->link_status |= LINK_12_5GTFD; |
1686 | break; | 1689 | break; |
1687 | 1690 | ||
1688 | case GP_STATUS_13G: | 1691 | case GP_STATUS_13G: |
1689 | vars->line_speed = SPEED_13000; | 1692 | new_line_speed = SPEED_13000; |
1690 | vars->link_status |= LINK_13GTFD; | 1693 | vars->link_status |= LINK_13GTFD; |
1691 | break; | 1694 | break; |
1692 | 1695 | ||
1693 | case GP_STATUS_15G: | 1696 | case GP_STATUS_15G: |
1694 | vars->line_speed = SPEED_15000; | 1697 | new_line_speed = SPEED_15000; |
1695 | vars->link_status |= LINK_15GTFD; | 1698 | vars->link_status |= LINK_15GTFD; |
1696 | break; | 1699 | break; |
1697 | 1700 | ||
1698 | case GP_STATUS_16G: | 1701 | case GP_STATUS_16G: |
1699 | vars->line_speed = SPEED_16000; | 1702 | new_line_speed = SPEED_16000; |
1700 | vars->link_status |= LINK_16GTFD; | 1703 | vars->link_status |= LINK_16GTFD; |
1701 | break; | 1704 | break; |
1702 | 1705 | ||
@@ -1708,6 +1711,15 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1708 | break; | 1711 | break; |
1709 | } | 1712 | } |
1710 | 1713 | ||
1714 | /* Upon link speed change set the NIG into drain mode. | ||
1715 | Comes to deals with possible FIFO glitch due to clk change | ||
1716 | when speed is decreased without link down indicator */ | ||
1717 | if (new_line_speed != vars->line_speed) { | ||
1718 | REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE | ||
1719 | + params->port*4, 0); | ||
1720 | msleep(1); | ||
1721 | } | ||
1722 | vars->line_speed = new_line_speed; | ||
1711 | vars->link_status |= LINK_STATUS_SERDES_LINK; | 1723 | vars->link_status |= LINK_STATUS_SERDES_LINK; |
1712 | 1724 | ||
1713 | if ((params->req_line_speed == SPEED_AUTO_NEG) && | 1725 | if ((params->req_line_speed == SPEED_AUTO_NEG) && |
@@ -3571,7 +3583,7 @@ static void bnx2x_set_xgxs_loopback(struct link_params *params, | |||
3571 | (MDIO_REG_BANK_CL73_IEEEB0 + | 3583 | (MDIO_REG_BANK_CL73_IEEEB0 + |
3572 | (MDIO_CL73_IEEEB0_CL73_AN_CONTROL & 0xf)), | 3584 | (MDIO_CL73_IEEEB0_CL73_AN_CONTROL & 0xf)), |
3573 | 0x6041); | 3585 | 0x6041); |
3574 | 3586 | msleep(200); | |
3575 | /* set aer mmd back */ | 3587 | /* set aer mmd back */ |
3576 | bnx2x_set_aer_mmd(params, vars); | 3588 | bnx2x_set_aer_mmd(params, vars); |
3577 | 3589 | ||
@@ -3870,9 +3882,15 @@ static u8 bnx2x_link_initialize(struct link_params *params, | |||
3870 | } | 3882 | } |
3871 | 3883 | ||
3872 | if (vars->phy_flags & PHY_XGXS_FLAG) { | 3884 | if (vars->phy_flags & PHY_XGXS_FLAG) { |
3873 | if (params->req_line_speed && | 3885 | if ((params->req_line_speed && |
3874 | ((params->req_line_speed == SPEED_100) || | 3886 | ((params->req_line_speed == SPEED_100) || |
3875 | (params->req_line_speed == SPEED_10))) { | 3887 | (params->req_line_speed == SPEED_10))) || |
3888 | (!params->req_line_speed && | ||
3889 | (params->speed_cap_mask >= | ||
3890 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) && | ||
3891 | (params->speed_cap_mask < | ||
3892 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G) | ||
3893 | )) { | ||
3876 | vars->phy_flags |= PHY_SGMII_FLAG; | 3894 | vars->phy_flags |= PHY_SGMII_FLAG; |
3877 | } else { | 3895 | } else { |
3878 | vars->phy_flags &= ~PHY_SGMII_FLAG; | 3896 | vars->phy_flags &= ~PHY_SGMII_FLAG; |
@@ -4194,6 +4212,11 @@ static u8 bnx2x_update_link_down(struct link_params *params, | |||
4194 | /* activate nig drain */ | 4212 | /* activate nig drain */ |
4195 | REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + port*4, 1); | 4213 | REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + port*4, 1); |
4196 | 4214 | ||
4215 | /* disable emac */ | ||
4216 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0); | ||
4217 | |||
4218 | msleep(10); | ||
4219 | |||
4197 | /* reset BigMac */ | 4220 | /* reset BigMac */ |
4198 | bnx2x_bmac_rx_disable(bp, params->port); | 4221 | bnx2x_bmac_rx_disable(bp, params->port); |
4199 | REG_WR(bp, GRCBASE_MISC + | 4222 | REG_WR(bp, GRCBASE_MISC + |
@@ -4238,6 +4261,7 @@ static u8 bnx2x_update_link_up(struct link_params *params, | |||
4238 | 4261 | ||
4239 | /* update shared memory */ | 4262 | /* update shared memory */ |
4240 | bnx2x_update_mng(params, vars->link_status); | 4263 | bnx2x_update_mng(params, vars->link_status); |
4264 | msleep(20); | ||
4241 | return rc; | 4265 | return rc; |
4242 | } | 4266 | } |
4243 | /* This function should called upon link interrupt */ | 4267 | /* This function should called upon link interrupt */ |
@@ -4276,6 +4300,9 @@ u8 bnx2x_link_update(struct link_params *params, struct link_vars *vars) | |||
4276 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK10G + port*0x68), | 4300 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK10G + port*0x68), |
4277 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK_STATUS + port*0x68)); | 4301 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK_STATUS + port*0x68)); |
4278 | 4302 | ||
4303 | /* disable emac */ | ||
4304 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0); | ||
4305 | |||
4279 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 4306 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
4280 | 4307 | ||
4281 | /* Check external link change only for non-direct */ | 4308 | /* Check external link change only for non-direct */ |
@@ -4377,10 +4404,11 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp, u32 shmem_base) | |||
4377 | ext_phy_addr[port], | 4404 | ext_phy_addr[port], |
4378 | MDIO_PMA_DEVAD, | 4405 | MDIO_PMA_DEVAD, |
4379 | MDIO_PMA_REG_ROM_VER1, &fw_ver1); | 4406 | MDIO_PMA_REG_ROM_VER1, &fw_ver1); |
4380 | if (fw_ver1 == 0) { | 4407 | if (fw_ver1 == 0 || fw_ver1 == 0x4321) { |
4381 | DP(NETIF_MSG_LINK, | 4408 | DP(NETIF_MSG_LINK, |
4382 | "bnx2x_8073_common_init_phy port %x " | 4409 | "bnx2x_8073_common_init_phy port %x:" |
4383 | "fw Download failed\n", port); | 4410 | "Download failed. fw version = 0x%x\n", |
4411 | port, fw_ver1); | ||
4384 | return -EINVAL; | 4412 | return -EINVAL; |
4385 | } | 4413 | } |
4386 | 4414 | ||
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 7c533797c064..d3e7775a9ccf 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* bnx2x_main.c: Broadcom Everest network driver. | 1 | /* bnx2x_main.c: Broadcom Everest network driver. |
2 | * | 2 | * |
3 | * Copyright (c) 2007-2008 Broadcom Corporation | 3 | * Copyright (c) 2007-2009 Broadcom Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -57,8 +57,8 @@ | |||
57 | #include "bnx2x.h" | 57 | #include "bnx2x.h" |
58 | #include "bnx2x_init.h" | 58 | #include "bnx2x_init.h" |
59 | 59 | ||
60 | #define DRV_MODULE_VERSION "1.45.23" | 60 | #define DRV_MODULE_VERSION "1.45.26" |
61 | #define DRV_MODULE_RELDATE "2008/11/03" | 61 | #define DRV_MODULE_RELDATE "2009/01/26" |
62 | #define BNX2X_BC_VER 0x040200 | 62 | #define BNX2X_BC_VER 0x040200 |
63 | 63 | ||
64 | /* Time in jiffies before concluding the transmitter is hung */ | 64 | /* Time in jiffies before concluding the transmitter is hung */ |
@@ -69,7 +69,7 @@ static char version[] __devinitdata = | |||
69 | DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | 69 | DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; |
70 | 70 | ||
71 | MODULE_AUTHOR("Eliezer Tamir"); | 71 | MODULE_AUTHOR("Eliezer Tamir"); |
72 | MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710 Driver"); | 72 | MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver"); |
73 | MODULE_LICENSE("GPL"); | 73 | MODULE_LICENSE("GPL"); |
74 | MODULE_VERSION(DRV_MODULE_VERSION); | 74 | MODULE_VERSION(DRV_MODULE_VERSION); |
75 | 75 | ||
@@ -733,6 +733,24 @@ static u16 bnx2x_ack_int(struct bnx2x *bp) | |||
733 | * fast path service functions | 733 | * fast path service functions |
734 | */ | 734 | */ |
735 | 735 | ||
736 | static inline int bnx2x_has_tx_work(struct bnx2x_fastpath *fp) | ||
737 | { | ||
738 | u16 tx_cons_sb; | ||
739 | |||
740 | /* Tell compiler that status block fields can change */ | ||
741 | barrier(); | ||
742 | tx_cons_sb = le16_to_cpu(*fp->tx_cons_sb); | ||
743 | return (fp->tx_pkt_cons != tx_cons_sb); | ||
744 | } | ||
745 | |||
746 | static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp) | ||
747 | { | ||
748 | /* Tell compiler that consumer and producer can change */ | ||
749 | barrier(); | ||
750 | return (fp->tx_pkt_prod != fp->tx_pkt_cons); | ||
751 | |||
752 | } | ||
753 | |||
736 | /* free skb in the packet ring at pos idx | 754 | /* free skb in the packet ring at pos idx |
737 | * return idx of last bd freed | 755 | * return idx of last bd freed |
738 | */ | 756 | */ |
@@ -5137,12 +5155,21 @@ static void enable_blocks_attention(struct bnx2x *bp) | |||
5137 | } | 5155 | } |
5138 | 5156 | ||
5139 | 5157 | ||
5158 | static void bnx2x_reset_common(struct bnx2x *bp) | ||
5159 | { | ||
5160 | /* reset_common */ | ||
5161 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, | ||
5162 | 0xd3ffff7f); | ||
5163 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403); | ||
5164 | } | ||
5165 | |||
5140 | static int bnx2x_init_common(struct bnx2x *bp) | 5166 | static int bnx2x_init_common(struct bnx2x *bp) |
5141 | { | 5167 | { |
5142 | u32 val, i; | 5168 | u32 val, i; |
5143 | 5169 | ||
5144 | DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp)); | 5170 | DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp)); |
5145 | 5171 | ||
5172 | bnx2x_reset_common(bp); | ||
5146 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); | 5173 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); |
5147 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc); | 5174 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc); |
5148 | 5175 | ||
@@ -6123,8 +6150,8 @@ static void bnx2x_netif_start(struct bnx2x *bp) | |||
6123 | static void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) | 6150 | static void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) |
6124 | { | 6151 | { |
6125 | bnx2x_int_disable_sync(bp, disable_hw); | 6152 | bnx2x_int_disable_sync(bp, disable_hw); |
6153 | bnx2x_napi_disable(bp); | ||
6126 | if (netif_running(bp->dev)) { | 6154 | if (netif_running(bp->dev)) { |
6127 | bnx2x_napi_disable(bp); | ||
6128 | netif_tx_disable(bp->dev); | 6155 | netif_tx_disable(bp->dev); |
6129 | bp->dev->trans_start = jiffies; /* prevent tx timeout */ | 6156 | bp->dev->trans_start = jiffies; /* prevent tx timeout */ |
6130 | } | 6157 | } |
@@ -6144,7 +6171,7 @@ static void bnx2x_set_mac_addr_e1(struct bnx2x *bp, int set) | |||
6144 | * multicast 64-127:port0 128-191:port1 | 6171 | * multicast 64-127:port0 128-191:port1 |
6145 | */ | 6172 | */ |
6146 | config->hdr.length_6b = 2; | 6173 | config->hdr.length_6b = 2; |
6147 | config->hdr.offset = port ? 31 : 0; | 6174 | config->hdr.offset = port ? 32 : 0; |
6148 | config->hdr.client_id = BP_CL_ID(bp); | 6175 | config->hdr.client_id = BP_CL_ID(bp); |
6149 | config->hdr.reserved1 = 0; | 6176 | config->hdr.reserved1 = 0; |
6150 | 6177 | ||
@@ -6308,7 +6335,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev); | |||
6308 | static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | 6335 | static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) |
6309 | { | 6336 | { |
6310 | u32 load_code; | 6337 | u32 load_code; |
6311 | int i, rc; | 6338 | int i, rc = 0; |
6312 | #ifdef BNX2X_STOP_ON_ERROR | 6339 | #ifdef BNX2X_STOP_ON_ERROR |
6313 | if (unlikely(bp->panic)) | 6340 | if (unlikely(bp->panic)) |
6314 | return -EPERM; | 6341 | return -EPERM; |
@@ -6316,48 +6343,6 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6316 | 6343 | ||
6317 | bp->state = BNX2X_STATE_OPENING_WAIT4_LOAD; | 6344 | bp->state = BNX2X_STATE_OPENING_WAIT4_LOAD; |
6318 | 6345 | ||
6319 | /* Send LOAD_REQUEST command to MCP | ||
6320 | Returns the type of LOAD command: | ||
6321 | if it is the first port to be initialized | ||
6322 | common blocks should be initialized, otherwise - not | ||
6323 | */ | ||
6324 | if (!BP_NOMCP(bp)) { | ||
6325 | load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ); | ||
6326 | if (!load_code) { | ||
6327 | BNX2X_ERR("MCP response failure, aborting\n"); | ||
6328 | return -EBUSY; | ||
6329 | } | ||
6330 | if (load_code == FW_MSG_CODE_DRV_LOAD_REFUSED) | ||
6331 | return -EBUSY; /* other port in diagnostic mode */ | ||
6332 | |||
6333 | } else { | ||
6334 | int port = BP_PORT(bp); | ||
6335 | |||
6336 | DP(NETIF_MSG_IFUP, "NO MCP load counts before us %d, %d, %d\n", | ||
6337 | load_count[0], load_count[1], load_count[2]); | ||
6338 | load_count[0]++; | ||
6339 | load_count[1 + port]++; | ||
6340 | DP(NETIF_MSG_IFUP, "NO MCP new load counts %d, %d, %d\n", | ||
6341 | load_count[0], load_count[1], load_count[2]); | ||
6342 | if (load_count[0] == 1) | ||
6343 | load_code = FW_MSG_CODE_DRV_LOAD_COMMON; | ||
6344 | else if (load_count[1 + port] == 1) | ||
6345 | load_code = FW_MSG_CODE_DRV_LOAD_PORT; | ||
6346 | else | ||
6347 | load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION; | ||
6348 | } | ||
6349 | |||
6350 | if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) || | ||
6351 | (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) | ||
6352 | bp->port.pmf = 1; | ||
6353 | else | ||
6354 | bp->port.pmf = 0; | ||
6355 | DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf); | ||
6356 | |||
6357 | /* if we can't use MSI-X we only need one fp, | ||
6358 | * so try to enable MSI-X with the requested number of fp's | ||
6359 | * and fallback to inta with one fp | ||
6360 | */ | ||
6361 | if (use_inta) { | 6346 | if (use_inta) { |
6362 | bp->num_queues = 1; | 6347 | bp->num_queues = 1; |
6363 | 6348 | ||
@@ -6372,7 +6357,15 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6372 | else | 6357 | else |
6373 | bp->num_queues = 1; | 6358 | bp->num_queues = 1; |
6374 | 6359 | ||
6375 | if (bnx2x_enable_msix(bp)) { | 6360 | DP(NETIF_MSG_IFUP, |
6361 | "set number of queues to %d\n", bp->num_queues); | ||
6362 | |||
6363 | /* if we can't use MSI-X we only need one fp, | ||
6364 | * so try to enable MSI-X with the requested number of fp's | ||
6365 | * and fallback to MSI or legacy INTx with one fp | ||
6366 | */ | ||
6367 | rc = bnx2x_enable_msix(bp); | ||
6368 | if (rc) { | ||
6376 | /* failed to enable MSI-X */ | 6369 | /* failed to enable MSI-X */ |
6377 | bp->num_queues = 1; | 6370 | bp->num_queues = 1; |
6378 | if (use_multi) | 6371 | if (use_multi) |
@@ -6380,8 +6373,6 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6380 | " to enable MSI-X\n"); | 6373 | " to enable MSI-X\n"); |
6381 | } | 6374 | } |
6382 | } | 6375 | } |
6383 | DP(NETIF_MSG_IFUP, | ||
6384 | "set number of queues to %d\n", bp->num_queues); | ||
6385 | 6376 | ||
6386 | if (bnx2x_alloc_mem(bp)) | 6377 | if (bnx2x_alloc_mem(bp)) |
6387 | return -ENOMEM; | 6378 | return -ENOMEM; |
@@ -6390,30 +6381,85 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6390 | bnx2x_fp(bp, i, disable_tpa) = | 6381 | bnx2x_fp(bp, i, disable_tpa) = |
6391 | ((bp->flags & TPA_ENABLE_FLAG) == 0); | 6382 | ((bp->flags & TPA_ENABLE_FLAG) == 0); |
6392 | 6383 | ||
6384 | for_each_queue(bp, i) | ||
6385 | netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi), | ||
6386 | bnx2x_poll, 128); | ||
6387 | |||
6388 | #ifdef BNX2X_STOP_ON_ERROR | ||
6389 | for_each_queue(bp, i) { | ||
6390 | struct bnx2x_fastpath *fp = &bp->fp[i]; | ||
6391 | |||
6392 | fp->poll_no_work = 0; | ||
6393 | fp->poll_calls = 0; | ||
6394 | fp->poll_max_calls = 0; | ||
6395 | fp->poll_complete = 0; | ||
6396 | fp->poll_exit = 0; | ||
6397 | } | ||
6398 | #endif | ||
6399 | bnx2x_napi_enable(bp); | ||
6400 | |||
6393 | if (bp->flags & USING_MSIX_FLAG) { | 6401 | if (bp->flags & USING_MSIX_FLAG) { |
6394 | rc = bnx2x_req_msix_irqs(bp); | 6402 | rc = bnx2x_req_msix_irqs(bp); |
6395 | if (rc) { | 6403 | if (rc) { |
6396 | pci_disable_msix(bp->pdev); | 6404 | pci_disable_msix(bp->pdev); |
6397 | goto load_error; | 6405 | goto load_error1; |
6398 | } | 6406 | } |
6407 | printk(KERN_INFO PFX "%s: using MSI-X\n", bp->dev->name); | ||
6399 | } else { | 6408 | } else { |
6400 | bnx2x_ack_int(bp); | 6409 | bnx2x_ack_int(bp); |
6401 | rc = bnx2x_req_irq(bp); | 6410 | rc = bnx2x_req_irq(bp); |
6402 | if (rc) { | 6411 | if (rc) { |
6403 | BNX2X_ERR("IRQ request failed, aborting\n"); | 6412 | BNX2X_ERR("IRQ request failed rc %d, aborting\n", rc); |
6404 | goto load_error; | 6413 | goto load_error1; |
6405 | } | 6414 | } |
6406 | } | 6415 | } |
6407 | 6416 | ||
6408 | for_each_queue(bp, i) | 6417 | /* Send LOAD_REQUEST command to MCP |
6409 | netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi), | 6418 | Returns the type of LOAD command: |
6410 | bnx2x_poll, 128); | 6419 | if it is the first port to be initialized |
6420 | common blocks should be initialized, otherwise - not | ||
6421 | */ | ||
6422 | if (!BP_NOMCP(bp)) { | ||
6423 | load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ); | ||
6424 | if (!load_code) { | ||
6425 | BNX2X_ERR("MCP response failure, aborting\n"); | ||
6426 | rc = -EBUSY; | ||
6427 | goto load_error2; | ||
6428 | } | ||
6429 | if (load_code == FW_MSG_CODE_DRV_LOAD_REFUSED) { | ||
6430 | rc = -EBUSY; /* other port in diagnostic mode */ | ||
6431 | goto load_error2; | ||
6432 | } | ||
6433 | |||
6434 | } else { | ||
6435 | int port = BP_PORT(bp); | ||
6436 | |||
6437 | DP(NETIF_MSG_IFUP, "NO MCP load counts before us %d, %d, %d\n", | ||
6438 | load_count[0], load_count[1], load_count[2]); | ||
6439 | load_count[0]++; | ||
6440 | load_count[1 + port]++; | ||
6441 | DP(NETIF_MSG_IFUP, "NO MCP new load counts %d, %d, %d\n", | ||
6442 | load_count[0], load_count[1], load_count[2]); | ||
6443 | if (load_count[0] == 1) | ||
6444 | load_code = FW_MSG_CODE_DRV_LOAD_COMMON; | ||
6445 | else if (load_count[1 + port] == 1) | ||
6446 | load_code = FW_MSG_CODE_DRV_LOAD_PORT; | ||
6447 | else | ||
6448 | load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION; | ||
6449 | } | ||
6450 | |||
6451 | if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) || | ||
6452 | (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) | ||
6453 | bp->port.pmf = 1; | ||
6454 | else | ||
6455 | bp->port.pmf = 0; | ||
6456 | DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf); | ||
6411 | 6457 | ||
6412 | /* Initialize HW */ | 6458 | /* Initialize HW */ |
6413 | rc = bnx2x_init_hw(bp, load_code); | 6459 | rc = bnx2x_init_hw(bp, load_code); |
6414 | if (rc) { | 6460 | if (rc) { |
6415 | BNX2X_ERR("HW init failed, aborting\n"); | 6461 | BNX2X_ERR("HW init failed, aborting\n"); |
6416 | goto load_int_disable; | 6462 | goto load_error2; |
6417 | } | 6463 | } |
6418 | 6464 | ||
6419 | /* Setup NIC internals and enable interrupts */ | 6465 | /* Setup NIC internals and enable interrupts */ |
@@ -6425,7 +6471,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6425 | if (!load_code) { | 6471 | if (!load_code) { |
6426 | BNX2X_ERR("MCP response failure, aborting\n"); | 6472 | BNX2X_ERR("MCP response failure, aborting\n"); |
6427 | rc = -EBUSY; | 6473 | rc = -EBUSY; |
6428 | goto load_rings_free; | 6474 | goto load_error3; |
6429 | } | 6475 | } |
6430 | } | 6476 | } |
6431 | 6477 | ||
@@ -6434,7 +6480,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6434 | rc = bnx2x_setup_leading(bp); | 6480 | rc = bnx2x_setup_leading(bp); |
6435 | if (rc) { | 6481 | if (rc) { |
6436 | BNX2X_ERR("Setup leading failed!\n"); | 6482 | BNX2X_ERR("Setup leading failed!\n"); |
6437 | goto load_netif_stop; | 6483 | goto load_error3; |
6438 | } | 6484 | } |
6439 | 6485 | ||
6440 | if (CHIP_IS_E1H(bp)) | 6486 | if (CHIP_IS_E1H(bp)) |
@@ -6447,7 +6493,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6447 | for_each_nondefault_queue(bp, i) { | 6493 | for_each_nondefault_queue(bp, i) { |
6448 | rc = bnx2x_setup_multi(bp, i); | 6494 | rc = bnx2x_setup_multi(bp, i); |
6449 | if (rc) | 6495 | if (rc) |
6450 | goto load_netif_stop; | 6496 | goto load_error3; |
6451 | } | 6497 | } |
6452 | 6498 | ||
6453 | if (CHIP_IS_E1(bp)) | 6499 | if (CHIP_IS_E1(bp)) |
@@ -6463,18 +6509,18 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6463 | case LOAD_NORMAL: | 6509 | case LOAD_NORMAL: |
6464 | /* Tx queue should be only reenabled */ | 6510 | /* Tx queue should be only reenabled */ |
6465 | netif_wake_queue(bp->dev); | 6511 | netif_wake_queue(bp->dev); |
6512 | /* Initialize the receive filter. */ | ||
6466 | bnx2x_set_rx_mode(bp->dev); | 6513 | bnx2x_set_rx_mode(bp->dev); |
6467 | break; | 6514 | break; |
6468 | 6515 | ||
6469 | case LOAD_OPEN: | 6516 | case LOAD_OPEN: |
6470 | netif_start_queue(bp->dev); | 6517 | netif_start_queue(bp->dev); |
6518 | /* Initialize the receive filter. */ | ||
6471 | bnx2x_set_rx_mode(bp->dev); | 6519 | bnx2x_set_rx_mode(bp->dev); |
6472 | if (bp->flags & USING_MSIX_FLAG) | ||
6473 | printk(KERN_INFO PFX "%s: using MSI-X\n", | ||
6474 | bp->dev->name); | ||
6475 | break; | 6520 | break; |
6476 | 6521 | ||
6477 | case LOAD_DIAG: | 6522 | case LOAD_DIAG: |
6523 | /* Initialize the receive filter. */ | ||
6478 | bnx2x_set_rx_mode(bp->dev); | 6524 | bnx2x_set_rx_mode(bp->dev); |
6479 | bp->state = BNX2X_STATE_DIAG; | 6525 | bp->state = BNX2X_STATE_DIAG; |
6480 | break; | 6526 | break; |
@@ -6492,20 +6538,25 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6492 | 6538 | ||
6493 | return 0; | 6539 | return 0; |
6494 | 6540 | ||
6495 | load_netif_stop: | 6541 | load_error3: |
6496 | bnx2x_napi_disable(bp); | 6542 | bnx2x_int_disable_sync(bp, 1); |
6497 | load_rings_free: | 6543 | if (!BP_NOMCP(bp)) { |
6544 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP); | ||
6545 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); | ||
6546 | } | ||
6547 | bp->port.pmf = 0; | ||
6498 | /* Free SKBs, SGEs, TPA pool and driver internals */ | 6548 | /* Free SKBs, SGEs, TPA pool and driver internals */ |
6499 | bnx2x_free_skbs(bp); | 6549 | bnx2x_free_skbs(bp); |
6500 | for_each_queue(bp, i) | 6550 | for_each_queue(bp, i) |
6501 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); | 6551 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); |
6502 | load_int_disable: | 6552 | load_error2: |
6503 | bnx2x_int_disable_sync(bp, 1); | ||
6504 | /* Release IRQs */ | 6553 | /* Release IRQs */ |
6505 | bnx2x_free_irq(bp); | 6554 | bnx2x_free_irq(bp); |
6506 | load_error: | 6555 | load_error1: |
6556 | bnx2x_napi_disable(bp); | ||
6557 | for_each_queue(bp, i) | ||
6558 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | ||
6507 | bnx2x_free_mem(bp); | 6559 | bnx2x_free_mem(bp); |
6508 | bp->port.pmf = 0; | ||
6509 | 6560 | ||
6510 | /* TBD we really need to reset the chip | 6561 | /* TBD we really need to reset the chip |
6511 | if we want to recover from this */ | 6562 | if we want to recover from this */ |
@@ -6578,6 +6629,7 @@ static int bnx2x_stop_leading(struct bnx2x *bp) | |||
6578 | } | 6629 | } |
6579 | cnt--; | 6630 | cnt--; |
6580 | msleep(1); | 6631 | msleep(1); |
6632 | rmb(); /* Refresh the dsb_sp_prod */ | ||
6581 | } | 6633 | } |
6582 | bp->state = BNX2X_STATE_CLOSING_WAIT4_UNLOAD; | 6634 | bp->state = BNX2X_STATE_CLOSING_WAIT4_UNLOAD; |
6583 | bp->fp[0].state = BNX2X_FP_STATE_CLOSED; | 6635 | bp->fp[0].state = BNX2X_FP_STATE_CLOSED; |
@@ -6629,14 +6681,6 @@ static void bnx2x_reset_port(struct bnx2x *bp) | |||
6629 | /* TODO: Close Doorbell port? */ | 6681 | /* TODO: Close Doorbell port? */ |
6630 | } | 6682 | } |
6631 | 6683 | ||
6632 | static void bnx2x_reset_common(struct bnx2x *bp) | ||
6633 | { | ||
6634 | /* reset_common */ | ||
6635 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, | ||
6636 | 0xd3ffff7f); | ||
6637 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403); | ||
6638 | } | ||
6639 | |||
6640 | static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code) | 6684 | static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code) |
6641 | { | 6685 | { |
6642 | DP(BNX2X_MSG_MCP, "function %d reset_code %x\n", | 6686 | DP(BNX2X_MSG_MCP, "function %d reset_code %x\n", |
@@ -6677,20 +6721,22 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) | |||
6677 | bnx2x_set_storm_rx_mode(bp); | 6721 | bnx2x_set_storm_rx_mode(bp); |
6678 | 6722 | ||
6679 | bnx2x_netif_stop(bp, 1); | 6723 | bnx2x_netif_stop(bp, 1); |
6680 | if (!netif_running(bp->dev)) | 6724 | |
6681 | bnx2x_napi_disable(bp); | ||
6682 | del_timer_sync(&bp->timer); | 6725 | del_timer_sync(&bp->timer); |
6683 | SHMEM_WR(bp, func_mb[BP_FUNC(bp)].drv_pulse_mb, | 6726 | SHMEM_WR(bp, func_mb[BP_FUNC(bp)].drv_pulse_mb, |
6684 | (DRV_PULSE_ALWAYS_ALIVE | bp->fw_drv_pulse_wr_seq)); | 6727 | (DRV_PULSE_ALWAYS_ALIVE | bp->fw_drv_pulse_wr_seq)); |
6685 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 6728 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
6686 | 6729 | ||
6730 | /* Release IRQs */ | ||
6731 | bnx2x_free_irq(bp); | ||
6732 | |||
6687 | /* Wait until tx fast path tasks complete */ | 6733 | /* Wait until tx fast path tasks complete */ |
6688 | for_each_queue(bp, i) { | 6734 | for_each_queue(bp, i) { |
6689 | struct bnx2x_fastpath *fp = &bp->fp[i]; | 6735 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
6690 | 6736 | ||
6691 | cnt = 1000; | 6737 | cnt = 1000; |
6692 | smp_rmb(); | 6738 | smp_rmb(); |
6693 | while (BNX2X_HAS_TX_WORK(fp)) { | 6739 | while (bnx2x_has_tx_work_unload(fp)) { |
6694 | 6740 | ||
6695 | bnx2x_tx_int(fp, 1000); | 6741 | bnx2x_tx_int(fp, 1000); |
6696 | if (!cnt) { | 6742 | if (!cnt) { |
@@ -6711,9 +6757,6 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) | |||
6711 | /* Give HW time to discard old tx messages */ | 6757 | /* Give HW time to discard old tx messages */ |
6712 | msleep(1); | 6758 | msleep(1); |
6713 | 6759 | ||
6714 | /* Release IRQs */ | ||
6715 | bnx2x_free_irq(bp); | ||
6716 | |||
6717 | if (CHIP_IS_E1(bp)) { | 6760 | if (CHIP_IS_E1(bp)) { |
6718 | struct mac_configuration_cmd *config = | 6761 | struct mac_configuration_cmd *config = |
6719 | bnx2x_sp(bp, mcast_config); | 6762 | bnx2x_sp(bp, mcast_config); |
@@ -6822,6 +6865,8 @@ unload_error: | |||
6822 | bnx2x_free_skbs(bp); | 6865 | bnx2x_free_skbs(bp); |
6823 | for_each_queue(bp, i) | 6866 | for_each_queue(bp, i) |
6824 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); | 6867 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); |
6868 | for_each_queue(bp, i) | ||
6869 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | ||
6825 | bnx2x_free_mem(bp); | 6870 | bnx2x_free_mem(bp); |
6826 | 6871 | ||
6827 | bp->state = BNX2X_STATE_CLOSED; | 6872 | bp->state = BNX2X_STATE_CLOSED; |
@@ -6874,10 +6919,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6874 | */ | 6919 | */ |
6875 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | 6920 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); |
6876 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); | 6921 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); |
6877 | if (val == 0x7) | ||
6878 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
6879 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6880 | |||
6881 | if (val == 0x7) { | 6922 | if (val == 0x7) { |
6882 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; | 6923 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; |
6883 | /* save our func */ | 6924 | /* save our func */ |
@@ -6885,6 +6926,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6885 | u32 swap_en; | 6926 | u32 swap_en; |
6886 | u32 swap_val; | 6927 | u32 swap_val; |
6887 | 6928 | ||
6929 | /* clear the UNDI indication */ | ||
6930 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
6931 | |||
6888 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); | 6932 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); |
6889 | 6933 | ||
6890 | /* try unload UNDI on port 0 */ | 6934 | /* try unload UNDI on port 0 */ |
@@ -6910,6 +6954,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6910 | bnx2x_fw_command(bp, reset_code); | 6954 | bnx2x_fw_command(bp, reset_code); |
6911 | } | 6955 | } |
6912 | 6956 | ||
6957 | /* now it's safe to release the lock */ | ||
6958 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6959 | |||
6913 | REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : | 6960 | REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : |
6914 | HC_REG_CONFIG_0), 0x1000); | 6961 | HC_REG_CONFIG_0), 0x1000); |
6915 | 6962 | ||
@@ -6954,7 +7001,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6954 | bp->fw_seq = | 7001 | bp->fw_seq = |
6955 | (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & | 7002 | (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & |
6956 | DRV_MSG_SEQ_NUMBER_MASK); | 7003 | DRV_MSG_SEQ_NUMBER_MASK); |
6957 | } | 7004 | |
7005 | } else | ||
7006 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6958 | } | 7007 | } |
6959 | } | 7008 | } |
6960 | 7009 | ||
@@ -6971,7 +7020,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) | |||
6971 | id |= ((val & 0xf) << 12); | 7020 | id |= ((val & 0xf) << 12); |
6972 | val = REG_RD(bp, MISC_REG_CHIP_METAL); | 7021 | val = REG_RD(bp, MISC_REG_CHIP_METAL); |
6973 | id |= ((val & 0xff) << 4); | 7022 | id |= ((val & 0xff) << 4); |
6974 | REG_RD(bp, MISC_REG_BOND_ID); | 7023 | val = REG_RD(bp, MISC_REG_BOND_ID); |
6975 | id |= (val & 0xf); | 7024 | id |= (val & 0xf); |
6976 | bp->common.chip_id = id; | 7025 | bp->common.chip_id = id; |
6977 | bp->link_params.chip_id = bp->common.chip_id; | 7026 | bp->link_params.chip_id = bp->common.chip_id; |
@@ -8103,6 +8152,9 @@ static int bnx2x_get_eeprom(struct net_device *dev, | |||
8103 | struct bnx2x *bp = netdev_priv(dev); | 8152 | struct bnx2x *bp = netdev_priv(dev); |
8104 | int rc; | 8153 | int rc; |
8105 | 8154 | ||
8155 | if (!netif_running(dev)) | ||
8156 | return -EAGAIN; | ||
8157 | |||
8106 | DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" | 8158 | DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" |
8107 | DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", | 8159 | DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", |
8108 | eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, | 8160 | eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, |
@@ -8705,18 +8757,17 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) | |||
8705 | 8757 | ||
8706 | if (loopback_mode == BNX2X_MAC_LOOPBACK) { | 8758 | if (loopback_mode == BNX2X_MAC_LOOPBACK) { |
8707 | bp->link_params.loopback_mode = LOOPBACK_BMAC; | 8759 | bp->link_params.loopback_mode = LOOPBACK_BMAC; |
8708 | bnx2x_acquire_phy_lock(bp); | ||
8709 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 8760 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); |
8710 | bnx2x_release_phy_lock(bp); | ||
8711 | 8761 | ||
8712 | } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { | 8762 | } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { |
8763 | u16 cnt = 1000; | ||
8713 | bp->link_params.loopback_mode = LOOPBACK_XGXS_10; | 8764 | bp->link_params.loopback_mode = LOOPBACK_XGXS_10; |
8714 | bnx2x_acquire_phy_lock(bp); | ||
8715 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 8765 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); |
8716 | bnx2x_release_phy_lock(bp); | ||
8717 | /* wait until link state is restored */ | 8766 | /* wait until link state is restored */ |
8718 | bnx2x_wait_for_link(bp, link_up); | 8767 | if (link_up) |
8719 | 8768 | while (cnt-- && bnx2x_test_link(&bp->link_params, | |
8769 | &bp->link_vars)) | ||
8770 | msleep(10); | ||
8720 | } else | 8771 | } else |
8721 | return -EINVAL; | 8772 | return -EINVAL; |
8722 | 8773 | ||
@@ -8822,6 +8873,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up) | |||
8822 | return BNX2X_LOOPBACK_FAILED; | 8873 | return BNX2X_LOOPBACK_FAILED; |
8823 | 8874 | ||
8824 | bnx2x_netif_stop(bp, 1); | 8875 | bnx2x_netif_stop(bp, 1); |
8876 | bnx2x_acquire_phy_lock(bp); | ||
8825 | 8877 | ||
8826 | if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { | 8878 | if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { |
8827 | DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); | 8879 | DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); |
@@ -8833,6 +8885,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up) | |||
8833 | rc |= BNX2X_PHY_LOOPBACK_FAILED; | 8885 | rc |= BNX2X_PHY_LOOPBACK_FAILED; |
8834 | } | 8886 | } |
8835 | 8887 | ||
8888 | bnx2x_release_phy_lock(bp); | ||
8836 | bnx2x_netif_start(bp); | 8889 | bnx2x_netif_start(bp); |
8837 | 8890 | ||
8838 | return rc; | 8891 | return rc; |
@@ -8906,7 +8959,10 @@ static int bnx2x_test_intr(struct bnx2x *bp) | |||
8906 | return -ENODEV; | 8959 | return -ENODEV; |
8907 | 8960 | ||
8908 | config->hdr.length_6b = 0; | 8961 | config->hdr.length_6b = 0; |
8909 | config->hdr.offset = 0; | 8962 | if (CHIP_IS_E1(bp)) |
8963 | config->hdr.offset = (BP_PORT(bp) ? 32 : 0); | ||
8964 | else | ||
8965 | config->hdr.offset = BP_FUNC(bp); | ||
8910 | config->hdr.client_id = BP_CL_ID(bp); | 8966 | config->hdr.client_id = BP_CL_ID(bp); |
8911 | config->hdr.reserved1 = 0; | 8967 | config->hdr.reserved1 = 0; |
8912 | 8968 | ||
@@ -9271,6 +9327,18 @@ static int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state) | |||
9271 | return 0; | 9327 | return 0; |
9272 | } | 9328 | } |
9273 | 9329 | ||
9330 | static inline int bnx2x_has_rx_work(struct bnx2x_fastpath *fp) | ||
9331 | { | ||
9332 | u16 rx_cons_sb; | ||
9333 | |||
9334 | /* Tell compiler that status block fields can change */ | ||
9335 | barrier(); | ||
9336 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | ||
9337 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | ||
9338 | rx_cons_sb++; | ||
9339 | return (fp->rx_comp_cons != rx_cons_sb); | ||
9340 | } | ||
9341 | |||
9274 | /* | 9342 | /* |
9275 | * net_device service functions | 9343 | * net_device service functions |
9276 | */ | 9344 | */ |
@@ -9281,7 +9349,6 @@ static int bnx2x_poll(struct napi_struct *napi, int budget) | |||
9281 | napi); | 9349 | napi); |
9282 | struct bnx2x *bp = fp->bp; | 9350 | struct bnx2x *bp = fp->bp; |
9283 | int work_done = 0; | 9351 | int work_done = 0; |
9284 | u16 rx_cons_sb; | ||
9285 | 9352 | ||
9286 | #ifdef BNX2X_STOP_ON_ERROR | 9353 | #ifdef BNX2X_STOP_ON_ERROR |
9287 | if (unlikely(bp->panic)) | 9354 | if (unlikely(bp->panic)) |
@@ -9294,19 +9361,12 @@ static int bnx2x_poll(struct napi_struct *napi, int budget) | |||
9294 | 9361 | ||
9295 | bnx2x_update_fpsb_idx(fp); | 9362 | bnx2x_update_fpsb_idx(fp); |
9296 | 9363 | ||
9297 | if (BNX2X_HAS_TX_WORK(fp)) | 9364 | if (bnx2x_has_tx_work(fp)) |
9298 | bnx2x_tx_int(fp, budget); | 9365 | bnx2x_tx_int(fp, budget); |
9299 | 9366 | ||
9300 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | 9367 | if (bnx2x_has_rx_work(fp)) |
9301 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | ||
9302 | rx_cons_sb++; | ||
9303 | if (BNX2X_HAS_RX_WORK(fp)) | ||
9304 | work_done = bnx2x_rx_int(fp, budget); | 9368 | work_done = bnx2x_rx_int(fp, budget); |
9305 | |||
9306 | rmb(); /* BNX2X_HAS_WORK() reads the status block */ | 9369 | rmb(); /* BNX2X_HAS_WORK() reads the status block */ |
9307 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | ||
9308 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | ||
9309 | rx_cons_sb++; | ||
9310 | 9370 | ||
9311 | /* must not complete if we consumed full budget */ | 9371 | /* must not complete if we consumed full budget */ |
9312 | if ((work_done < budget) && !BNX2X_HAS_WORK(fp)) { | 9372 | if ((work_done < budget) && !BNX2X_HAS_WORK(fp)) { |
@@ -9417,6 +9477,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) | |||
9417 | return rc; | 9477 | return rc; |
9418 | } | 9478 | } |
9419 | 9479 | ||
9480 | #if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) | ||
9420 | /* check if packet requires linearization (packet is too fragmented) */ | 9481 | /* check if packet requires linearization (packet is too fragmented) */ |
9421 | static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, | 9482 | static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, |
9422 | u32 xmit_type) | 9483 | u32 xmit_type) |
@@ -9494,6 +9555,7 @@ exit_lbl: | |||
9494 | 9555 | ||
9495 | return to_copy; | 9556 | return to_copy; |
9496 | } | 9557 | } |
9558 | #endif | ||
9497 | 9559 | ||
9498 | /* called with netif_tx_lock | 9560 | /* called with netif_tx_lock |
9499 | * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call | 9561 | * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call |
@@ -9534,6 +9596,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9534 | skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr, | 9596 | skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr, |
9535 | ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type); | 9597 | ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type); |
9536 | 9598 | ||
9599 | #if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) | ||
9537 | /* First, check if we need to linearize the skb | 9600 | /* First, check if we need to linearize the skb |
9538 | (due to FW restrictions) */ | 9601 | (due to FW restrictions) */ |
9539 | if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) { | 9602 | if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) { |
@@ -9546,6 +9609,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9546 | return NETDEV_TX_OK; | 9609 | return NETDEV_TX_OK; |
9547 | } | 9610 | } |
9548 | } | 9611 | } |
9612 | #endif | ||
9549 | 9613 | ||
9550 | /* | 9614 | /* |
9551 | Please read carefully. First we use one BD which we mark as start, | 9615 | Please read carefully. First we use one BD which we mark as start, |
@@ -9776,6 +9840,8 @@ static int bnx2x_open(struct net_device *dev) | |||
9776 | { | 9840 | { |
9777 | struct bnx2x *bp = netdev_priv(dev); | 9841 | struct bnx2x *bp = netdev_priv(dev); |
9778 | 9842 | ||
9843 | netif_carrier_off(dev); | ||
9844 | |||
9779 | bnx2x_set_power_state(bp, PCI_D0); | 9845 | bnx2x_set_power_state(bp, PCI_D0); |
9780 | 9846 | ||
9781 | return bnx2x_nic_load(bp, LOAD_OPEN); | 9847 | return bnx2x_nic_load(bp, LOAD_OPEN); |
@@ -9859,7 +9925,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev) | |||
9859 | for (; i < old; i++) { | 9925 | for (; i < old; i++) { |
9860 | if (CAM_IS_INVALID(config-> | 9926 | if (CAM_IS_INVALID(config-> |
9861 | config_table[i])) { | 9927 | config_table[i])) { |
9862 | i--; /* already invalidated */ | 9928 | /* already invalidated */ |
9863 | break; | 9929 | break; |
9864 | } | 9930 | } |
9865 | /* invalidate */ | 9931 | /* invalidate */ |
@@ -10269,22 +10335,18 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
10269 | return rc; | 10335 | return rc; |
10270 | } | 10336 | } |
10271 | 10337 | ||
10272 | rc = register_netdev(dev); | ||
10273 | if (rc) { | ||
10274 | dev_err(&pdev->dev, "Cannot register net device\n"); | ||
10275 | goto init_one_exit; | ||
10276 | } | ||
10277 | |||
10278 | pci_set_drvdata(pdev, dev); | 10338 | pci_set_drvdata(pdev, dev); |
10279 | 10339 | ||
10280 | rc = bnx2x_init_bp(bp); | 10340 | rc = bnx2x_init_bp(bp); |
10341 | if (rc) | ||
10342 | goto init_one_exit; | ||
10343 | |||
10344 | rc = register_netdev(dev); | ||
10281 | if (rc) { | 10345 | if (rc) { |
10282 | unregister_netdev(dev); | 10346 | dev_err(&pdev->dev, "Cannot register net device\n"); |
10283 | goto init_one_exit; | 10347 | goto init_one_exit; |
10284 | } | 10348 | } |
10285 | 10349 | ||
10286 | netif_carrier_off(dev); | ||
10287 | |||
10288 | bp->common.name = board_info[ent->driver_data].name; | 10350 | bp->common.name = board_info[ent->driver_data].name; |
10289 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," | 10351 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," |
10290 | " IRQ %d, ", dev->name, bp->common.name, | 10352 | " IRQ %d, ", dev->name, bp->common.name, |
@@ -10432,6 +10494,8 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) | |||
10432 | bnx2x_free_skbs(bp); | 10494 | bnx2x_free_skbs(bp); |
10433 | for_each_queue(bp, i) | 10495 | for_each_queue(bp, i) |
10434 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); | 10496 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); |
10497 | for_each_queue(bp, i) | ||
10498 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | ||
10435 | bnx2x_free_mem(bp); | 10499 | bnx2x_free_mem(bp); |
10436 | 10500 | ||
10437 | bp->state = BNX2X_STATE_CLOSED; | 10501 | bp->state = BNX2X_STATE_CLOSED; |
diff --git a/drivers/net/bnx2x_reg.h b/drivers/net/bnx2x_reg.h index a67b0c358ae4..d084e5fc4b51 100644 --- a/drivers/net/bnx2x_reg.h +++ b/drivers/net/bnx2x_reg.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* bnx2x_reg.h: Broadcom Everest network driver. | 1 | /* bnx2x_reg.h: Broadcom Everest network driver. |
2 | * | 2 | * |
3 | * Copyright (c) 2007-2008 Broadcom Corporation | 3 | * Copyright (c) 2007-2009 Broadcom Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 14f9fb3e8795..379a1324db4e 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -2104,6 +2104,7 @@ static void init_lro_mgr(struct sge_qset *qs, struct net_lro_mgr *lro_mgr) | |||
2104 | { | 2104 | { |
2105 | lro_mgr->dev = qs->netdev; | 2105 | lro_mgr->dev = qs->netdev; |
2106 | lro_mgr->features = LRO_F_NAPI; | 2106 | lro_mgr->features = LRO_F_NAPI; |
2107 | lro_mgr->frag_align_pad = NET_IP_ALIGN; | ||
2107 | lro_mgr->ip_summed = CHECKSUM_UNNECESSARY; | 2108 | lro_mgr->ip_summed = CHECKSUM_UNNECESSARY; |
2108 | lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY; | 2109 | lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY; |
2109 | lro_mgr->max_desc = T3_MAX_LRO_SES; | 2110 | lro_mgr->max_desc = T3_MAX_LRO_SES; |
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index cf43ee743b3c..0890162953e9 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -981,11 +981,15 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) | |||
981 | ew32(PBA_ECC, reg); | 981 | ew32(PBA_ECC, reg); |
982 | } | 982 | } |
983 | 983 | ||
984 | /* PCI-Ex Control Register */ | 984 | /* PCI-Ex Control Registers */ |
985 | if (hw->mac.type == e1000_82574) { | 985 | if (hw->mac.type == e1000_82574) { |
986 | reg = er32(GCR); | 986 | reg = er32(GCR); |
987 | reg |= (1 << 22); | 987 | reg |= (1 << 22); |
988 | ew32(GCR, reg); | 988 | ew32(GCR, reg); |
989 | |||
990 | reg = er32(GCR2); | ||
991 | reg |= 1; | ||
992 | ew32(GCR2, reg); | ||
989 | } | 993 | } |
990 | 994 | ||
991 | return; | 995 | return; |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index f25e961c6b3b..2d4ce0492df0 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -206,6 +206,7 @@ enum e1e_registers { | |||
206 | E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ | 206 | E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ |
207 | E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ | 207 | E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ |
208 | E1000_GCR = 0x05B00, /* PCI-Ex Control */ | 208 | E1000_GCR = 0x05B00, /* PCI-Ex Control */ |
209 | E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */ | ||
209 | E1000_FACTPS = 0x05B30, /* Function Active and Power State to MNG */ | 210 | E1000_FACTPS = 0x05B30, /* Function Active and Power State to MNG */ |
210 | E1000_SWSM = 0x05B50, /* SW Semaphore */ | 211 | E1000_SWSM = 0x05B50, /* SW Semaphore */ |
211 | E1000_FWSM = 0x05B54, /* FW Semaphore */ | 212 | E1000_FWSM = 0x05B54, /* FW Semaphore */ |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index ea530673236e..3f7eab42aef1 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -1423,15 +1423,11 @@ static void gfar_vlan_rx_register(struct net_device *dev, | |||
1423 | { | 1423 | { |
1424 | struct gfar_private *priv = netdev_priv(dev); | 1424 | struct gfar_private *priv = netdev_priv(dev); |
1425 | unsigned long flags; | 1425 | unsigned long flags; |
1426 | struct vlan_group *old_grp; | ||
1427 | u32 tempval; | 1426 | u32 tempval; |
1428 | 1427 | ||
1429 | spin_lock_irqsave(&priv->rxlock, flags); | 1428 | spin_lock_irqsave(&priv->rxlock, flags); |
1430 | 1429 | ||
1431 | old_grp = priv->vlgrp; | 1430 | priv->vlgrp = grp; |
1432 | |||
1433 | if (old_grp == grp) | ||
1434 | return; | ||
1435 | 1431 | ||
1436 | if (grp) { | 1432 | if (grp) { |
1437 | /* Enable VLAN tag insertion */ | 1433 | /* Enable VLAN tag insertion */ |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index acef3c65cd2c..d2f4d5f508b7 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -318,6 +318,9 @@ static void ixgbe_update_rx_dca(struct ixgbe_adapter *adapter, | |||
318 | rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); | 318 | rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); |
319 | rxctrl |= IXGBE_DCA_RXCTRL_DESC_DCA_EN; | 319 | rxctrl |= IXGBE_DCA_RXCTRL_DESC_DCA_EN; |
320 | rxctrl |= IXGBE_DCA_RXCTRL_HEAD_DCA_EN; | 320 | rxctrl |= IXGBE_DCA_RXCTRL_HEAD_DCA_EN; |
321 | rxctrl &= ~(IXGBE_DCA_RXCTRL_DESC_RRO_EN); | ||
322 | rxctrl &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | | ||
323 | IXGBE_DCA_RXCTRL_DESC_HSRO_EN); | ||
321 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_RXCTRL(q), rxctrl); | 324 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_RXCTRL(q), rxctrl); |
322 | rx_ring->cpu = cpu; | 325 | rx_ring->cpu = cpu; |
323 | } | 326 | } |
@@ -1741,6 +1744,32 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
1741 | IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); | 1744 | IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); |
1742 | } | 1745 | } |
1743 | 1746 | ||
1747 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
1748 | { | ||
1749 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1750 | struct ixgbe_hw *hw = &adapter->hw; | ||
1751 | |||
1752 | /* add VID to filter table */ | ||
1753 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true); | ||
1754 | } | ||
1755 | |||
1756 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
1757 | { | ||
1758 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1759 | struct ixgbe_hw *hw = &adapter->hw; | ||
1760 | |||
1761 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1762 | ixgbe_irq_disable(adapter); | ||
1763 | |||
1764 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | ||
1765 | |||
1766 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1767 | ixgbe_irq_enable(adapter); | ||
1768 | |||
1769 | /* remove VID from filter table */ | ||
1770 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false); | ||
1771 | } | ||
1772 | |||
1744 | static void ixgbe_vlan_rx_register(struct net_device *netdev, | 1773 | static void ixgbe_vlan_rx_register(struct net_device *netdev, |
1745 | struct vlan_group *grp) | 1774 | struct vlan_group *grp) |
1746 | { | 1775 | { |
@@ -1760,6 +1789,7 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, | |||
1760 | ctrl |= IXGBE_VLNCTRL_VME; | 1789 | ctrl |= IXGBE_VLNCTRL_VME; |
1761 | ctrl &= ~IXGBE_VLNCTRL_CFIEN; | 1790 | ctrl &= ~IXGBE_VLNCTRL_CFIEN; |
1762 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl); | 1791 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl); |
1792 | ixgbe_vlan_rx_add_vid(netdev, 0); | ||
1763 | 1793 | ||
1764 | if (grp) { | 1794 | if (grp) { |
1765 | /* enable VLAN tag insert/strip */ | 1795 | /* enable VLAN tag insert/strip */ |
@@ -1773,32 +1803,6 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, | |||
1773 | ixgbe_irq_enable(adapter); | 1803 | ixgbe_irq_enable(adapter); |
1774 | } | 1804 | } |
1775 | 1805 | ||
1776 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
1777 | { | ||
1778 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1779 | struct ixgbe_hw *hw = &adapter->hw; | ||
1780 | |||
1781 | /* add VID to filter table */ | ||
1782 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true); | ||
1783 | } | ||
1784 | |||
1785 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
1786 | { | ||
1787 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1788 | struct ixgbe_hw *hw = &adapter->hw; | ||
1789 | |||
1790 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1791 | ixgbe_irq_disable(adapter); | ||
1792 | |||
1793 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | ||
1794 | |||
1795 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1796 | ixgbe_irq_enable(adapter); | ||
1797 | |||
1798 | /* remove VID from filter table */ | ||
1799 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false); | ||
1800 | } | ||
1801 | |||
1802 | static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) | 1806 | static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) |
1803 | { | 1807 | { |
1804 | ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); | 1808 | ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); |
@@ -2074,6 +2078,9 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
2074 | 2078 | ||
2075 | ixgbe_irq_enable(adapter); | 2079 | ixgbe_irq_enable(adapter); |
2076 | 2080 | ||
2081 | /* enable transmits */ | ||
2082 | netif_tx_start_all_queues(netdev); | ||
2083 | |||
2077 | /* bring the link up in the watchdog, this could race with our first | 2084 | /* bring the link up in the watchdog, this could race with our first |
2078 | * link up interrupt but shouldn't be a problem */ | 2085 | * link up interrupt but shouldn't be a problem */ |
2079 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 2086 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
@@ -3475,7 +3482,6 @@ static void ixgbe_watchdog_task(struct work_struct *work) | |||
3475 | (FLOW_TX ? "TX" : "None")))); | 3482 | (FLOW_TX ? "TX" : "None")))); |
3476 | 3483 | ||
3477 | netif_carrier_on(netdev); | 3484 | netif_carrier_on(netdev); |
3478 | netif_tx_wake_all_queues(netdev); | ||
3479 | } else { | 3485 | } else { |
3480 | /* Force detection of hung controller */ | 3486 | /* Force detection of hung controller */ |
3481 | adapter->detect_tx_hung = true; | 3487 | adapter->detect_tx_hung = true; |
@@ -3487,7 +3493,6 @@ static void ixgbe_watchdog_task(struct work_struct *work) | |||
3487 | printk(KERN_INFO "ixgbe: %s NIC Link is Down\n", | 3493 | printk(KERN_INFO "ixgbe: %s NIC Link is Down\n", |
3488 | netdev->name); | 3494 | netdev->name); |
3489 | netif_carrier_off(netdev); | 3495 | netif_carrier_off(netdev); |
3490 | netif_tx_stop_all_queues(netdev); | ||
3491 | } | 3496 | } |
3492 | } | 3497 | } |
3493 | 3498 | ||
@@ -4218,7 +4223,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
4218 | } | 4223 | } |
4219 | 4224 | ||
4220 | netif_carrier_off(netdev); | 4225 | netif_carrier_off(netdev); |
4221 | netif_tx_stop_all_queues(netdev); | ||
4222 | 4226 | ||
4223 | strcpy(netdev->name, "eth%d"); | 4227 | strcpy(netdev->name, "eth%d"); |
4224 | err = register_netdev(netdev); | 4228 | err = register_netdev(netdev); |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 83a11ff9ffd1..f011c57c9205 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -404,6 +404,9 @@ | |||
404 | #define IXGBE_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */ | 404 | #define IXGBE_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */ |
405 | #define IXGBE_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */ | 405 | #define IXGBE_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */ |
406 | #define IXGBE_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */ | 406 | #define IXGBE_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */ |
407 | #define IXGBE_DCA_RXCTRL_DESC_RRO_EN (1 << 9) /* DCA Rx rd Desc Relax Order */ | ||
408 | #define IXGBE_DCA_RXCTRL_DESC_WRO_EN (1 << 13) /* DCA Rx wr Desc Relax Order */ | ||
409 | #define IXGBE_DCA_RXCTRL_DESC_HSRO_EN (1 << 15) /* DCA Rx Split Header RO */ | ||
407 | 410 | ||
408 | #define IXGBE_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */ | 411 | #define IXGBE_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */ |
409 | #define IXGBE_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */ | 412 | #define IXGBE_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */ |
diff --git a/drivers/net/korina.c b/drivers/net/korina.c index 1d6e48e13366..75010cac76ac 100644 --- a/drivers/net/korina.c +++ b/drivers/net/korina.c | |||
@@ -416,6 +416,9 @@ static int korina_rx(struct net_device *dev, int limit) | |||
416 | if (devcs & ETH_RX_MP) | 416 | if (devcs & ETH_RX_MP) |
417 | dev->stats.multicast++; | 417 | dev->stats.multicast++; |
418 | 418 | ||
419 | /* 16 bit align */ | ||
420 | skb_reserve(skb_new, 2); | ||
421 | |||
419 | lp->rx_skb[lp->rx_next_done] = skb_new; | 422 | lp->rx_skb[lp->rx_next_done] = skb_new; |
420 | } | 423 | } |
421 | 424 | ||
@@ -740,6 +743,7 @@ static struct ethtool_ops netdev_ethtool_ops = { | |||
740 | static void korina_alloc_ring(struct net_device *dev) | 743 | static void korina_alloc_ring(struct net_device *dev) |
741 | { | 744 | { |
742 | struct korina_private *lp = netdev_priv(dev); | 745 | struct korina_private *lp = netdev_priv(dev); |
746 | struct sk_buff *skb; | ||
743 | int i; | 747 | int i; |
744 | 748 | ||
745 | /* Initialize the transmit descriptors */ | 749 | /* Initialize the transmit descriptors */ |
@@ -755,8 +759,6 @@ static void korina_alloc_ring(struct net_device *dev) | |||
755 | 759 | ||
756 | /* Initialize the receive descriptors */ | 760 | /* Initialize the receive descriptors */ |
757 | for (i = 0; i < KORINA_NUM_RDS; i++) { | 761 | for (i = 0; i < KORINA_NUM_RDS; i++) { |
758 | struct sk_buff *skb = lp->rx_skb[i]; | ||
759 | |||
760 | skb = dev_alloc_skb(KORINA_RBSIZE + 2); | 762 | skb = dev_alloc_skb(KORINA_RBSIZE + 2); |
761 | if (!skb) | 763 | if (!skb) |
762 | break; | 764 | break; |
@@ -769,11 +771,12 @@ static void korina_alloc_ring(struct net_device *dev) | |||
769 | lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]); | 771 | lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]); |
770 | } | 772 | } |
771 | 773 | ||
772 | /* loop back */ | 774 | /* loop back receive descriptors, so the last |
773 | lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[0]); | 775 | * descriptor points to the first one */ |
774 | lp->rx_next_done = 0; | 776 | lp->rd_ring[i - 1].link = CPHYSADDR(&lp->rd_ring[0]); |
777 | lp->rd_ring[i - 1].control |= DMA_DESC_COD; | ||
775 | 778 | ||
776 | lp->rd_ring[i].control |= DMA_DESC_COD; | 779 | lp->rx_next_done = 0; |
777 | lp->rx_chain_head = 0; | 780 | lp->rx_chain_head = 0; |
778 | lp->rx_chain_tail = 0; | 781 | lp->rx_chain_tail = 0; |
779 | lp->rx_chain_status = desc_empty; | 782 | lp->rx_chain_status = desc_empty; |
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index a04da4ecaa88..f6c4936e2fa8 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -321,6 +321,10 @@ static void macb_tx(struct macb *bp) | |||
321 | printk(KERN_ERR "%s: TX underrun, resetting buffers\n", | 321 | printk(KERN_ERR "%s: TX underrun, resetting buffers\n", |
322 | bp->dev->name); | 322 | bp->dev->name); |
323 | 323 | ||
324 | /* Transfer ongoing, disable transmitter, to avoid confusion */ | ||
325 | if (status & MACB_BIT(TGO)) | ||
326 | macb_writel(bp, NCR, macb_readl(bp, NCR) & ~MACB_BIT(TE)); | ||
327 | |||
324 | head = bp->tx_head; | 328 | head = bp->tx_head; |
325 | 329 | ||
326 | /*Mark all the buffer as used to avoid sending a lost buffer*/ | 330 | /*Mark all the buffer as used to avoid sending a lost buffer*/ |
@@ -343,6 +347,10 @@ static void macb_tx(struct macb *bp) | |||
343 | } | 347 | } |
344 | 348 | ||
345 | bp->tx_head = bp->tx_tail = 0; | 349 | bp->tx_head = bp->tx_tail = 0; |
350 | |||
351 | /* Enable the transmitter again */ | ||
352 | if (status & MACB_BIT(TGO)) | ||
353 | macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TE)); | ||
346 | } | 354 | } |
347 | 355 | ||
348 | if (!(status & MACB_BIT(COMP))) | 356 | if (!(status & MACB_BIT(COMP))) |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 7253a499d9c8..5f31bbb614af 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -136,21 +136,23 @@ static char mv643xx_eth_driver_version[] = "1.4"; | |||
136 | /* | 136 | /* |
137 | * SDMA configuration register. | 137 | * SDMA configuration register. |
138 | */ | 138 | */ |
139 | #define RX_BURST_SIZE_4_64BIT (2 << 1) | ||
139 | #define RX_BURST_SIZE_16_64BIT (4 << 1) | 140 | #define RX_BURST_SIZE_16_64BIT (4 << 1) |
140 | #define BLM_RX_NO_SWAP (1 << 4) | 141 | #define BLM_RX_NO_SWAP (1 << 4) |
141 | #define BLM_TX_NO_SWAP (1 << 5) | 142 | #define BLM_TX_NO_SWAP (1 << 5) |
143 | #define TX_BURST_SIZE_4_64BIT (2 << 22) | ||
142 | #define TX_BURST_SIZE_16_64BIT (4 << 22) | 144 | #define TX_BURST_SIZE_16_64BIT (4 << 22) |
143 | 145 | ||
144 | #if defined(__BIG_ENDIAN) | 146 | #if defined(__BIG_ENDIAN) |
145 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 147 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
146 | (RX_BURST_SIZE_16_64BIT | \ | 148 | (RX_BURST_SIZE_4_64BIT | \ |
147 | TX_BURST_SIZE_16_64BIT) | 149 | TX_BURST_SIZE_4_64BIT) |
148 | #elif defined(__LITTLE_ENDIAN) | 150 | #elif defined(__LITTLE_ENDIAN) |
149 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 151 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
150 | (RX_BURST_SIZE_16_64BIT | \ | 152 | (RX_BURST_SIZE_4_64BIT | \ |
151 | BLM_RX_NO_SWAP | \ | 153 | BLM_RX_NO_SWAP | \ |
152 | BLM_TX_NO_SWAP | \ | 154 | BLM_TX_NO_SWAP | \ |
153 | TX_BURST_SIZE_16_64BIT) | 155 | TX_BURST_SIZE_4_64BIT) |
154 | #else | 156 | #else |
155 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined | 157 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined |
156 | #endif | 158 | #endif |
@@ -1594,7 +1596,7 @@ oom: | |||
1594 | entry = addr_crc(a); | 1596 | entry = addr_crc(a); |
1595 | } | 1597 | } |
1596 | 1598 | ||
1597 | table[entry >> 2] |= 1 << (entry & 3); | 1599 | table[entry >> 2] |= 1 << (8 * (entry & 3)); |
1598 | } | 1600 | } |
1599 | 1601 | ||
1600 | for (i = 0; i < 0x100; i += 4) { | 1602 | for (i = 0; i < 0x100; i += 4) { |
@@ -2210,6 +2212,7 @@ static int mv643xx_eth_stop(struct net_device *dev) | |||
2210 | struct mv643xx_eth_private *mp = netdev_priv(dev); | 2212 | struct mv643xx_eth_private *mp = netdev_priv(dev); |
2211 | int i; | 2213 | int i; |
2212 | 2214 | ||
2215 | wrlp(mp, INT_MASK_EXT, 0x00000000); | ||
2213 | wrlp(mp, INT_MASK, 0x00000000); | 2216 | wrlp(mp, INT_MASK, 0x00000000); |
2214 | rdlp(mp, INT_MASK); | 2217 | rdlp(mp, INT_MASK); |
2215 | 2218 | ||
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 6bb71b687f7b..e9c1296b267e 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /************************************************************************* | 1 | /************************************************************************* |
2 | * myri10ge.c: Myricom Myri-10G Ethernet driver. | 2 | * myri10ge.c: Myricom Myri-10G Ethernet driver. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 - 2007 Myricom, Inc. | 4 | * Copyright (C) 2005 - 2009 Myricom, Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without |
@@ -75,7 +75,7 @@ | |||
75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
77 | 77 | ||
78 | #define MYRI10GE_VERSION_STR "1.4.4-1.398" | 78 | #define MYRI10GE_VERSION_STR "1.4.4-1.401" |
79 | 79 | ||
80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -3786,7 +3786,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3786 | if (status != 0) { | 3786 | if (status != 0) { |
3787 | dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", | 3787 | dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", |
3788 | status); | 3788 | status); |
3789 | goto abort_with_netdev; | 3789 | goto abort_with_enabled; |
3790 | } | 3790 | } |
3791 | 3791 | ||
3792 | pci_set_master(pdev); | 3792 | pci_set_master(pdev); |
@@ -3801,13 +3801,13 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3801 | } | 3801 | } |
3802 | if (status != 0) { | 3802 | if (status != 0) { |
3803 | dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); | 3803 | dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); |
3804 | goto abort_with_netdev; | 3804 | goto abort_with_enabled; |
3805 | } | 3805 | } |
3806 | (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); | 3806 | (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); |
3807 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), | 3807 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), |
3808 | &mgp->cmd_bus, GFP_KERNEL); | 3808 | &mgp->cmd_bus, GFP_KERNEL); |
3809 | if (mgp->cmd == NULL) | 3809 | if (mgp->cmd == NULL) |
3810 | goto abort_with_netdev; | 3810 | goto abort_with_enabled; |
3811 | 3811 | ||
3812 | mgp->board_span = pci_resource_len(pdev, 0); | 3812 | mgp->board_span = pci_resource_len(pdev, 0); |
3813 | mgp->iomem_base = pci_resource_start(pdev, 0); | 3813 | mgp->iomem_base = pci_resource_start(pdev, 0); |
@@ -3943,8 +3943,10 @@ abort_with_mtrr: | |||
3943 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), | 3943 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), |
3944 | mgp->cmd, mgp->cmd_bus); | 3944 | mgp->cmd, mgp->cmd_bus); |
3945 | 3945 | ||
3946 | abort_with_netdev: | 3946 | abort_with_enabled: |
3947 | pci_disable_device(pdev); | ||
3947 | 3948 | ||
3949 | abort_with_netdev: | ||
3948 | free_netdev(netdev); | 3950 | free_netdev(netdev); |
3949 | return status; | 3951 | return status; |
3950 | } | 3952 | } |
@@ -3990,6 +3992,7 @@ static void myri10ge_remove(struct pci_dev *pdev) | |||
3990 | mgp->cmd, mgp->cmd_bus); | 3992 | mgp->cmd, mgp->cmd_bus); |
3991 | 3993 | ||
3992 | free_netdev(netdev); | 3994 | free_netdev(netdev); |
3995 | pci_disable_device(pdev); | ||
3993 | pci_set_drvdata(pdev, NULL); | 3996 | pci_set_drvdata(pdev, NULL); |
3994 | } | 3997 | } |
3995 | 3998 | ||
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index c11c568fd7db..a75a31005fd3 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -146,7 +146,7 @@ | |||
146 | 146 | ||
147 | #define MAX_RX_BUFFER_LENGTH 1760 | 147 | #define MAX_RX_BUFFER_LENGTH 1760 |
148 | #define MAX_RX_JUMBO_BUFFER_LENGTH 8062 | 148 | #define MAX_RX_JUMBO_BUFFER_LENGTH 8062 |
149 | #define MAX_RX_LRO_BUFFER_LENGTH ((48*1024)-512) | 149 | #define MAX_RX_LRO_BUFFER_LENGTH (8062) |
150 | #define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - 2) | 150 | #define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - 2) |
151 | #define RX_JUMBO_DMA_MAP_LEN \ | 151 | #define RX_JUMBO_DMA_MAP_LEN \ |
152 | (MAX_RX_JUMBO_BUFFER_LENGTH - 2) | 152 | (MAX_RX_JUMBO_BUFFER_LENGTH - 2) |
@@ -207,11 +207,11 @@ | |||
207 | 207 | ||
208 | #define MAX_CMD_DESCRIPTORS 4096 | 208 | #define MAX_CMD_DESCRIPTORS 4096 |
209 | #define MAX_RCV_DESCRIPTORS 16384 | 209 | #define MAX_RCV_DESCRIPTORS 16384 |
210 | #define MAX_CMD_DESCRIPTORS_HOST (MAX_CMD_DESCRIPTORS / 4) | 210 | #define MAX_CMD_DESCRIPTORS_HOST 1024 |
211 | #define MAX_RCV_DESCRIPTORS_1G (MAX_RCV_DESCRIPTORS / 4) | 211 | #define MAX_RCV_DESCRIPTORS_1G 2048 |
212 | #define MAX_RCV_DESCRIPTORS_10G 8192 | 212 | #define MAX_RCV_DESCRIPTORS_10G 4096 |
213 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 | 213 | #define MAX_JUMBO_RCV_DESCRIPTORS 512 |
214 | #define MAX_LRO_RCV_DESCRIPTORS 64 | 214 | #define MAX_LRO_RCV_DESCRIPTORS 8 |
215 | #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS | 215 | #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS |
216 | #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS | 216 | #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS |
217 | #define MAX_RCV_DESC MAX_RCV_DESCRIPTORS | 217 | #define MAX_RCV_DESC MAX_RCV_DESCRIPTORS |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index c0bd40fcf708..0894a7be0225 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -561,7 +561,10 @@ netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) | |||
561 | } | 561 | } |
562 | ring->tx_pending = adapter->max_tx_desc_count; | 562 | ring->tx_pending = adapter->max_tx_desc_count; |
563 | 563 | ||
564 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS; | 564 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) |
565 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_1G; | ||
566 | else | ||
567 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_10G; | ||
565 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST; | 568 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST; |
566 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS; | 569 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS; |
567 | ring->rx_mini_max_pending = 0; | 570 | ring->rx_mini_max_pending = 0; |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index d854f07ef4d3..645d384fe87e 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -735,17 +735,18 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
735 | 735 | ||
736 | SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops); | 736 | SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops); |
737 | 737 | ||
738 | /* ScatterGather support */ | 738 | netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO); |
739 | netdev->features = NETIF_F_SG; | 739 | netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO); |
740 | netdev->features |= NETIF_F_IP_CSUM; | 740 | |
741 | netdev->features |= NETIF_F_TSO; | ||
742 | if (NX_IS_REVISION_P3(revision_id)) { | 741 | if (NX_IS_REVISION_P3(revision_id)) { |
743 | netdev->features |= NETIF_F_IPV6_CSUM; | 742 | netdev->features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6); |
744 | netdev->features |= NETIF_F_TSO6; | 743 | netdev->vlan_features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6); |
745 | } | 744 | } |
746 | 745 | ||
747 | if (adapter->pci_using_dac) | 746 | if (adapter->pci_using_dac) { |
748 | netdev->features |= NETIF_F_HIGHDMA; | 747 | netdev->features |= NETIF_F_HIGHDMA; |
748 | netdev->vlan_features |= NETIF_F_HIGHDMA; | ||
749 | } | ||
749 | 750 | ||
750 | /* | 751 | /* |
751 | * Set the CRB window to invalid. If any register in window 0 is | 752 | * Set the CRB window to invalid. If any register in window 0 is |
@@ -1166,6 +1167,14 @@ static bool netxen_tso_check(struct net_device *netdev, | |||
1166 | { | 1167 | { |
1167 | bool tso = false; | 1168 | bool tso = false; |
1168 | u8 opcode = TX_ETHER_PKT; | 1169 | u8 opcode = TX_ETHER_PKT; |
1170 | __be16 protocol = skb->protocol; | ||
1171 | u16 flags = 0; | ||
1172 | |||
1173 | if (protocol == __constant_htons(ETH_P_8021Q)) { | ||
1174 | struct vlan_ethhdr *vh = (struct vlan_ethhdr *)skb->data; | ||
1175 | protocol = vh->h_vlan_encapsulated_proto; | ||
1176 | flags = FLAGS_VLAN_TAGGED; | ||
1177 | } | ||
1169 | 1178 | ||
1170 | if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && | 1179 | if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && |
1171 | skb_shinfo(skb)->gso_size > 0) { | 1180 | skb_shinfo(skb)->gso_size > 0) { |
@@ -1174,21 +1183,21 @@ static bool netxen_tso_check(struct net_device *netdev, | |||
1174 | desc->total_hdr_length = | 1183 | desc->total_hdr_length = |
1175 | skb_transport_offset(skb) + tcp_hdrlen(skb); | 1184 | skb_transport_offset(skb) + tcp_hdrlen(skb); |
1176 | 1185 | ||
1177 | opcode = (skb->protocol == htons(ETH_P_IPV6)) ? | 1186 | opcode = (protocol == __constant_htons(ETH_P_IPV6)) ? |
1178 | TX_TCP_LSO6 : TX_TCP_LSO; | 1187 | TX_TCP_LSO6 : TX_TCP_LSO; |
1179 | tso = true; | 1188 | tso = true; |
1180 | 1189 | ||
1181 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1190 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1182 | u8 l4proto; | 1191 | u8 l4proto; |
1183 | 1192 | ||
1184 | if (skb->protocol == htons(ETH_P_IP)) { | 1193 | if (protocol == __constant_htons(ETH_P_IP)) { |
1185 | l4proto = ip_hdr(skb)->protocol; | 1194 | l4proto = ip_hdr(skb)->protocol; |
1186 | 1195 | ||
1187 | if (l4proto == IPPROTO_TCP) | 1196 | if (l4proto == IPPROTO_TCP) |
1188 | opcode = TX_TCP_PKT; | 1197 | opcode = TX_TCP_PKT; |
1189 | else if(l4proto == IPPROTO_UDP) | 1198 | else if(l4proto == IPPROTO_UDP) |
1190 | opcode = TX_UDP_PKT; | 1199 | opcode = TX_UDP_PKT; |
1191 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | 1200 | } else if (protocol == __constant_htons(ETH_P_IPV6)) { |
1192 | l4proto = ipv6_hdr(skb)->nexthdr; | 1201 | l4proto = ipv6_hdr(skb)->nexthdr; |
1193 | 1202 | ||
1194 | if (l4proto == IPPROTO_TCP) | 1203 | if (l4proto == IPPROTO_TCP) |
@@ -1199,7 +1208,7 @@ static bool netxen_tso_check(struct net_device *netdev, | |||
1199 | } | 1208 | } |
1200 | desc->tcp_hdr_offset = skb_transport_offset(skb); | 1209 | desc->tcp_hdr_offset = skb_transport_offset(skb); |
1201 | desc->ip_hdr_offset = skb_network_offset(skb); | 1210 | desc->ip_hdr_offset = skb_network_offset(skb); |
1202 | netxen_set_tx_flags_opcode(desc, 0, opcode); | 1211 | netxen_set_tx_flags_opcode(desc, flags, opcode); |
1203 | return tso; | 1212 | return tso; |
1204 | } | 1213 | } |
1205 | 1214 | ||
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 11adf6ed4628..811a637695ca 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -296,9 +296,8 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state) | |||
296 | struct phy_driver *phydrv = to_phy_driver(drv); | 296 | struct phy_driver *phydrv = to_phy_driver(drv); |
297 | struct phy_device *phydev = to_phy_device(dev); | 297 | struct phy_device *phydev = to_phy_device(dev); |
298 | 298 | ||
299 | if ((!device_may_wakeup(phydev->dev.parent)) && | 299 | if (drv && phydrv->suspend && !device_may_wakeup(phydev->dev.parent)) |
300 | (phydrv && phydrv->suspend)) | 300 | ret = phydrv->suspend(phydev); |
301 | ret = phydrv->suspend(phydev); | ||
302 | 301 | ||
303 | return ret; | 302 | return ret; |
304 | } | 303 | } |
@@ -310,8 +309,7 @@ static int mdio_bus_resume(struct device * dev) | |||
310 | struct phy_driver *phydrv = to_phy_driver(drv); | 309 | struct phy_driver *phydrv = to_phy_driver(drv); |
311 | struct phy_device *phydev = to_phy_device(dev); | 310 | struct phy_device *phydev = to_phy_device(dev); |
312 | 311 | ||
313 | if ((!device_may_wakeup(phydev->dev.parent)) && | 312 | if (drv && phydrv->resume && !device_may_wakeup(phydev->dev.parent)) |
314 | (phydrv && phydrv->resume)) | ||
315 | ret = phydrv->resume(phydev); | 313 | ret = phydrv->resume(phydev); |
316 | 314 | ||
317 | return ret; | 315 | return ret; |
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index c05d38d46350..1387187543e4 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c | |||
@@ -81,6 +81,9 @@ static struct phy_driver lan83c185_driver = { | |||
81 | .ack_interrupt = smsc_phy_ack_interrupt, | 81 | .ack_interrupt = smsc_phy_ack_interrupt, |
82 | .config_intr = smsc_phy_config_intr, | 82 | .config_intr = smsc_phy_config_intr, |
83 | 83 | ||
84 | .suspend = genphy_suspend, | ||
85 | .resume = genphy_resume, | ||
86 | |||
84 | .driver = { .owner = THIS_MODULE, } | 87 | .driver = { .owner = THIS_MODULE, } |
85 | }; | 88 | }; |
86 | 89 | ||
@@ -102,6 +105,9 @@ static struct phy_driver lan8187_driver = { | |||
102 | .ack_interrupt = smsc_phy_ack_interrupt, | 105 | .ack_interrupt = smsc_phy_ack_interrupt, |
103 | .config_intr = smsc_phy_config_intr, | 106 | .config_intr = smsc_phy_config_intr, |
104 | 107 | ||
108 | .suspend = genphy_suspend, | ||
109 | .resume = genphy_resume, | ||
110 | |||
105 | .driver = { .owner = THIS_MODULE, } | 111 | .driver = { .owner = THIS_MODULE, } |
106 | }; | 112 | }; |
107 | 113 | ||
@@ -123,6 +129,9 @@ static struct phy_driver lan8700_driver = { | |||
123 | .ack_interrupt = smsc_phy_ack_interrupt, | 129 | .ack_interrupt = smsc_phy_ack_interrupt, |
124 | .config_intr = smsc_phy_config_intr, | 130 | .config_intr = smsc_phy_config_intr, |
125 | 131 | ||
132 | .suspend = genphy_suspend, | ||
133 | .resume = genphy_resume, | ||
134 | |||
126 | .driver = { .owner = THIS_MODULE, } | 135 | .driver = { .owner = THIS_MODULE, } |
127 | }; | 136 | }; |
128 | 137 | ||
@@ -144,6 +153,9 @@ static struct phy_driver lan911x_int_driver = { | |||
144 | .ack_interrupt = smsc_phy_ack_interrupt, | 153 | .ack_interrupt = smsc_phy_ack_interrupt, |
145 | .config_intr = smsc_phy_config_intr, | 154 | .config_intr = smsc_phy_config_intr, |
146 | 155 | ||
156 | .suspend = genphy_suspend, | ||
157 | .resume = genphy_resume, | ||
158 | |||
147 | .driver = { .owner = THIS_MODULE, } | 159 | .driver = { .owner = THIS_MODULE, } |
148 | }; | 160 | }; |
149 | 161 | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 5e2dbaee125b..8b3f84685387 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -7535,11 +7535,58 @@ static int tg3_test_msi(struct tg3 *tp) | |||
7535 | return err; | 7535 | return err; |
7536 | } | 7536 | } |
7537 | 7537 | ||
7538 | static int tg3_request_firmware(struct tg3 *tp) | ||
7539 | { | ||
7540 | const __be32 *fw_data; | ||
7541 | |||
7542 | if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev)) { | ||
7543 | printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n", | ||
7544 | tp->dev->name, tp->fw_needed); | ||
7545 | return -ENOENT; | ||
7546 | } | ||
7547 | |||
7548 | fw_data = (void *)tp->fw->data; | ||
7549 | |||
7550 | /* Firmware blob starts with version numbers, followed by | ||
7551 | * start address and _full_ length including BSS sections | ||
7552 | * (which must be longer than the actual data, of course | ||
7553 | */ | ||
7554 | |||
7555 | tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */ | ||
7556 | if (tp->fw_len < (tp->fw->size - 12)) { | ||
7557 | printk(KERN_ERR "%s: bogus length %d in \"%s\"\n", | ||
7558 | tp->dev->name, tp->fw_len, tp->fw_needed); | ||
7559 | release_firmware(tp->fw); | ||
7560 | tp->fw = NULL; | ||
7561 | return -EINVAL; | ||
7562 | } | ||
7563 | |||
7564 | /* We no longer need firmware; we have it. */ | ||
7565 | tp->fw_needed = NULL; | ||
7566 | return 0; | ||
7567 | } | ||
7568 | |||
7538 | static int tg3_open(struct net_device *dev) | 7569 | static int tg3_open(struct net_device *dev) |
7539 | { | 7570 | { |
7540 | struct tg3 *tp = netdev_priv(dev); | 7571 | struct tg3 *tp = netdev_priv(dev); |
7541 | int err; | 7572 | int err; |
7542 | 7573 | ||
7574 | if (tp->fw_needed) { | ||
7575 | err = tg3_request_firmware(tp); | ||
7576 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) { | ||
7577 | if (err) | ||
7578 | return err; | ||
7579 | } else if (err) { | ||
7580 | printk(KERN_WARNING "%s: TSO capability disabled.\n", | ||
7581 | tp->dev->name); | ||
7582 | tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; | ||
7583 | } else if (!(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { | ||
7584 | printk(KERN_NOTICE "%s: TSO capability restored.\n", | ||
7585 | tp->dev->name); | ||
7586 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; | ||
7587 | } | ||
7588 | } | ||
7589 | |||
7543 | netif_carrier_off(tp->dev); | 7590 | netif_carrier_off(tp->dev); |
7544 | 7591 | ||
7545 | err = tg3_set_power_state(tp, PCI_D0); | 7592 | err = tg3_set_power_state(tp, PCI_D0); |
@@ -12934,7 +12981,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
12934 | struct net_device *dev; | 12981 | struct net_device *dev; |
12935 | struct tg3 *tp; | 12982 | struct tg3 *tp; |
12936 | int err, pm_cap; | 12983 | int err, pm_cap; |
12937 | const char *fw_name = NULL; | ||
12938 | char str[40]; | 12984 | char str[40]; |
12939 | u64 dma_mask, persist_dma_mask; | 12985 | u64 dma_mask, persist_dma_mask; |
12940 | 12986 | ||
@@ -13091,7 +13137,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13091 | tg3_init_bufmgr_config(tp); | 13137 | tg3_init_bufmgr_config(tp); |
13092 | 13138 | ||
13093 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) | 13139 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) |
13094 | fw_name = FIRMWARE_TG3; | 13140 | tp->fw_needed = FIRMWARE_TG3; |
13095 | 13141 | ||
13096 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { | 13142 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { |
13097 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; | 13143 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; |
@@ -13104,37 +13150,10 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13104 | tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; | 13150 | tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; |
13105 | } else { | 13151 | } else { |
13106 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG; | 13152 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG; |
13107 | } | ||
13108 | if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { | ||
13109 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) | 13153 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) |
13110 | fw_name = FIRMWARE_TG3TSO5; | 13154 | tp->fw_needed = FIRMWARE_TG3TSO5; |
13111 | else | 13155 | else |
13112 | fw_name = FIRMWARE_TG3TSO; | 13156 | tp->fw_needed = FIRMWARE_TG3TSO; |
13113 | } | ||
13114 | |||
13115 | if (fw_name) { | ||
13116 | const __be32 *fw_data; | ||
13117 | |||
13118 | err = request_firmware(&tp->fw, fw_name, &tp->pdev->dev); | ||
13119 | if (err) { | ||
13120 | printk(KERN_ERR "tg3: Failed to load firmware \"%s\"\n", | ||
13121 | fw_name); | ||
13122 | goto err_out_iounmap; | ||
13123 | } | ||
13124 | |||
13125 | fw_data = (void *)tp->fw->data; | ||
13126 | |||
13127 | /* Firmware blob starts with version numbers, followed by | ||
13128 | start address and _full_ length including BSS sections | ||
13129 | (which must be longer than the actual data, of course */ | ||
13130 | |||
13131 | tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */ | ||
13132 | if (tp->fw_len < (tp->fw->size - 12)) { | ||
13133 | printk(KERN_ERR "tg3: bogus length %d in \"%s\"\n", | ||
13134 | tp->fw_len, fw_name); | ||
13135 | err = -EINVAL; | ||
13136 | goto err_out_fw; | ||
13137 | } | ||
13138 | } | 13157 | } |
13139 | 13158 | ||
13140 | /* TSO is on by default on chips that support hardware TSO. | 13159 | /* TSO is on by default on chips that support hardware TSO. |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index ae5da603c6af..508def3e077f 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2764,6 +2764,7 @@ struct tg3 { | |||
2764 | struct ethtool_coalesce coal; | 2764 | struct ethtool_coalesce coal; |
2765 | 2765 | ||
2766 | /* firmware info */ | 2766 | /* firmware info */ |
2767 | const char *fw_needed; | ||
2767 | const struct firmware *fw; | 2768 | const struct firmware *fw; |
2768 | u32 fw_len; /* includes BSS */ | 2769 | u32 fw_len; /* includes BSS */ |
2769 | }; | 2770 | }; |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 5385d66b306e..ced8f36ebd01 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -94,10 +94,18 @@ static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
94 | { | 94 | { |
95 | struct usb_device *xdev = dev->udev; | 95 | struct usb_device *xdev = dev->udev; |
96 | int ret; | 96 | int ret; |
97 | void *buffer; | ||
98 | |||
99 | buffer = kmalloc(size, GFP_NOIO); | ||
100 | if (buffer == NULL) | ||
101 | return -ENOMEM; | ||
97 | 102 | ||
98 | ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, | 103 | ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, |
99 | MCS7830_RD_BMREQ, 0x0000, index, data, | 104 | MCS7830_RD_BMREQ, 0x0000, index, buffer, |
100 | size, MCS7830_CTRL_TIMEOUT); | 105 | size, MCS7830_CTRL_TIMEOUT); |
106 | memcpy(data, buffer, size); | ||
107 | kfree(buffer); | ||
108 | |||
101 | return ret; | 109 | return ret; |
102 | } | 110 | } |
103 | 111 | ||
@@ -105,10 +113,18 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
105 | { | 113 | { |
106 | struct usb_device *xdev = dev->udev; | 114 | struct usb_device *xdev = dev->udev; |
107 | int ret; | 115 | int ret; |
116 | void *buffer; | ||
117 | |||
118 | buffer = kmalloc(size, GFP_NOIO); | ||
119 | if (buffer == NULL) | ||
120 | return -ENOMEM; | ||
121 | |||
122 | memcpy(buffer, data, size); | ||
108 | 123 | ||
109 | ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, | 124 | ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, |
110 | MCS7830_WR_BMREQ, 0x0000, index, data, | 125 | MCS7830_WR_BMREQ, 0x0000, index, buffer, |
111 | size, MCS7830_CTRL_TIMEOUT); | 126 | size, MCS7830_CTRL_TIMEOUT); |
127 | kfree(buffer); | ||
112 | return ret; | 128 | return ret; |
113 | } | 129 | } |
114 | 130 | ||
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index a75f91dc3153..c5691fdb7079 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1302,7 +1302,7 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) | |||
1302 | static int velocity_init_td_ring(struct velocity_info *vptr) | 1302 | static int velocity_init_td_ring(struct velocity_info *vptr) |
1303 | { | 1303 | { |
1304 | dma_addr_t curr; | 1304 | dma_addr_t curr; |
1305 | unsigned int j; | 1305 | int j; |
1306 | 1306 | ||
1307 | /* Init the TD ring entries */ | 1307 | /* Init the TD ring entries */ |
1308 | for (j = 0; j < vptr->tx.numq; j++) { | 1308 | for (j = 0; j < vptr->tx.numq; j++) { |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 43f6523c40be..63ef2a8905fb 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/virtio.h> | 24 | #include <linux/virtio.h> |
25 | #include <linux/virtio_net.h> | 25 | #include <linux/virtio_net.h> |
26 | #include <linux/scatterlist.h> | 26 | #include <linux/scatterlist.h> |
27 | #include <linux/if_vlan.h> | ||
27 | 28 | ||
28 | static int napi_weight = 128; | 29 | static int napi_weight = 128; |
29 | module_param(napi_weight, int, 0444); | 30 | module_param(napi_weight, int, 0444); |
@@ -33,7 +34,7 @@ module_param(csum, bool, 0444); | |||
33 | module_param(gso, bool, 0444); | 34 | module_param(gso, bool, 0444); |
34 | 35 | ||
35 | /* FIXME: MTU in config. */ | 36 | /* FIXME: MTU in config. */ |
36 | #define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN) | 37 | #define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) |
37 | #define GOOD_COPY_LEN 128 | 38 | #define GOOD_COPY_LEN 128 |
38 | 39 | ||
39 | struct virtnet_info | 40 | struct virtnet_info |
diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c index d3d37fed6893..15d9f51b292c 100644 --- a/drivers/net/wimax/i2400m/control.c +++ b/drivers/net/wimax/i2400m/control.c | |||
@@ -609,7 +609,7 @@ void i2400m_msg_to_dev_cancel_wait(struct i2400m *i2400m, int code) | |||
609 | spin_lock_irqsave(&i2400m->rx_lock, flags); | 609 | spin_lock_irqsave(&i2400m->rx_lock, flags); |
610 | ack_skb = i2400m->ack_skb; | 610 | ack_skb = i2400m->ack_skb; |
611 | if (ack_skb && !IS_ERR(ack_skb)) | 611 | if (ack_skb && !IS_ERR(ack_skb)) |
612 | kfree(ack_skb); | 612 | kfree_skb(ack_skb); |
613 | i2400m->ack_skb = ERR_PTR(code); | 613 | i2400m->ack_skb = ERR_PTR(code); |
614 | spin_unlock_irqrestore(&i2400m->rx_lock, flags); | 614 | spin_unlock_irqrestore(&i2400m->rx_lock, flags); |
615 | } | 615 | } |
diff --git a/drivers/net/wimax/i2400m/usb-rx.c b/drivers/net/wimax/i2400m/usb-rx.c index 074cc1f89853..a314799967cf 100644 --- a/drivers/net/wimax/i2400m/usb-rx.c +++ b/drivers/net/wimax/i2400m/usb-rx.c | |||
@@ -184,6 +184,8 @@ void i2400mu_rx_size_maybe_shrink(struct i2400mu *i2400mu) | |||
184 | * NOTE: this function might realloc the skb (if it is too small), | 184 | * NOTE: this function might realloc the skb (if it is too small), |
185 | * so always update with the one returned. | 185 | * so always update with the one returned. |
186 | * ERR_PTR() is < 0 on error. | 186 | * ERR_PTR() is < 0 on error. |
187 | * Will return NULL if it cannot reallocate -- this can be | ||
188 | * considered a transient retryable error. | ||
187 | */ | 189 | */ |
188 | static | 190 | static |
189 | struct sk_buff *i2400mu_rx(struct i2400mu *i2400mu, struct sk_buff *rx_skb) | 191 | struct sk_buff *i2400mu_rx(struct i2400mu *i2400mu, struct sk_buff *rx_skb) |
@@ -243,8 +245,8 @@ retry: | |||
243 | if (printk_ratelimit()) | 245 | if (printk_ratelimit()) |
244 | dev_err(dev, "RX: Can't reallocate skb to %d; " | 246 | dev_err(dev, "RX: Can't reallocate skb to %d; " |
245 | "RX dropped\n", rx_size); | 247 | "RX dropped\n", rx_size); |
246 | kfree(rx_skb); | 248 | kfree_skb(rx_skb); |
247 | result = 0; | 249 | rx_skb = NULL; |
248 | goto out; /* drop it...*/ | 250 | goto out; /* drop it...*/ |
249 | } | 251 | } |
250 | kfree_skb(rx_skb); | 252 | kfree_skb(rx_skb); |
@@ -344,7 +346,8 @@ int i2400mu_rxd(void *_i2400mu) | |||
344 | if (IS_ERR(rx_skb)) | 346 | if (IS_ERR(rx_skb)) |
345 | goto out; | 347 | goto out; |
346 | atomic_dec(&i2400mu->rx_pending_count); | 348 | atomic_dec(&i2400mu->rx_pending_count); |
347 | if (rx_skb->len == 0) { /* some ignorable condition */ | 349 | if (rx_skb == NULL || rx_skb->len == 0) { |
350 | /* some "ignorable" condition */ | ||
348 | kfree_skb(rx_skb); | 351 | kfree_skb(rx_skb); |
349 | continue; | 352 | continue; |
350 | } | 353 | } |
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 04ab457a8faa..1b71b934bb5e 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -490,7 +490,7 @@ static inline int ath_rc_get_nextvalid_txrate(struct ath_rate_table *rate_table, | |||
490 | 490 | ||
491 | static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw) | 491 | static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw) |
492 | { | 492 | { |
493 | if (WLAN_RC_PHY_HT(phy) & !(capflag & WLAN_RC_HT_FLAG)) | 493 | if (WLAN_RC_PHY_HT(phy) && !(capflag & WLAN_RC_HT_FLAG)) |
494 | return 0; | 494 | return 0; |
495 | if (WLAN_RC_PHY_DS(phy) && !(capflag & WLAN_RC_DS_FLAG)) | 495 | if (WLAN_RC_PHY_DS(phy) && !(capflag & WLAN_RC_DS_FLAG)) |
496 | return 0; | 496 | return 0; |
diff --git a/drivers/net/wireless/ath9k/regd_common.h b/drivers/net/wireless/ath9k/regd_common.h index 9112c030b1e8..6df1b3b77c25 100644 --- a/drivers/net/wireless/ath9k/regd_common.h +++ b/drivers/net/wireless/ath9k/regd_common.h | |||
@@ -228,7 +228,7 @@ enum { | |||
228 | }; | 228 | }; |
229 | 229 | ||
230 | #define REG_DOMAIN_2GHZ_MASK (REQ_MASK & \ | 230 | #define REG_DOMAIN_2GHZ_MASK (REQ_MASK & \ |
231 | (!(ADHOC_NO_11A | DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB))) | 231 | (~(ADHOC_NO_11A | DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB))) |
232 | #define REG_DOMAIN_5GHZ_MASK REQ_MASK | 232 | #define REG_DOMAIN_5GHZ_MASK REQ_MASK |
233 | 233 | ||
234 | static struct reg_dmn_pair_mapping regDomainPairs[] = { | 234 | static struct reg_dmn_pair_mapping regDomainPairs[] = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index 9b60a0c5de5f..21c841847d88 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -638,12 +638,16 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
638 | s8 scale_action = 0; | 638 | s8 scale_action = 0; |
639 | unsigned long flags; | 639 | unsigned long flags; |
640 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 640 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
641 | u16 fc, rate_mask; | 641 | u16 fc; |
642 | u16 rate_mask = 0; | ||
642 | struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; | 643 | struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; |
643 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 644 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
644 | 645 | ||
645 | IWL_DEBUG_RATE("enter\n"); | 646 | IWL_DEBUG_RATE("enter\n"); |
646 | 647 | ||
648 | if (sta) | ||
649 | rate_mask = sta->supp_rates[sband->band]; | ||
650 | |||
647 | /* Send management frames and broadcast/multicast data using lowest | 651 | /* Send management frames and broadcast/multicast data using lowest |
648 | * rate. */ | 652 | * rate. */ |
649 | fc = le16_to_cpu(hdr->frame_control); | 653 | fc = le16_to_cpu(hdr->frame_control); |
@@ -651,11 +655,15 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
651 | is_multicast_ether_addr(hdr->addr1) || | 655 | is_multicast_ether_addr(hdr->addr1) || |
652 | !sta || !priv_sta) { | 656 | !sta || !priv_sta) { |
653 | IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); | 657 | IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); |
654 | info->control.rates[0].idx = rate_lowest_index(sband, sta); | 658 | if (!rate_mask) |
659 | info->control.rates[0].idx = | ||
660 | rate_lowest_index(sband, NULL); | ||
661 | else | ||
662 | info->control.rates[0].idx = | ||
663 | rate_lowest_index(sband, sta); | ||
655 | return; | 664 | return; |
656 | } | 665 | } |
657 | 666 | ||
658 | rate_mask = sta->supp_rates[sband->band]; | ||
659 | index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); | 667 | index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); |
660 | 668 | ||
661 | if (sband->band == IEEE80211_BAND_5GHZ) | 669 | if (sband->band == IEEE80211_BAND_5GHZ) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index f3f17929ca0b..27f50471aed8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -944,7 +944,8 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, | |||
944 | } | 944 | } |
945 | 945 | ||
946 | /* See if there's a better rate or modulation mode to try. */ | 946 | /* See if there's a better rate or modulation mode to try. */ |
947 | rs_rate_scale_perform(priv, hdr, sta, lq_sta); | 947 | if (sta && sta->supp_rates[sband->band]) |
948 | rs_rate_scale_perform(priv, hdr, sta, lq_sta); | ||
948 | out: | 949 | out: |
949 | return; | 950 | return; |
950 | } | 951 | } |
@@ -2101,14 +2102,23 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta, | |||
2101 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 2102 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
2102 | struct iwl_lq_sta *lq_sta = priv_sta; | 2103 | struct iwl_lq_sta *lq_sta = priv_sta; |
2103 | int rate_idx; | 2104 | int rate_idx; |
2105 | u64 mask_bit = 0; | ||
2104 | 2106 | ||
2105 | IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); | 2107 | IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); |
2106 | 2108 | ||
2109 | if (sta) | ||
2110 | mask_bit = sta->supp_rates[sband->band]; | ||
2111 | |||
2107 | /* Send management frames and broadcast/multicast data using lowest | 2112 | /* Send management frames and broadcast/multicast data using lowest |
2108 | * rate. */ | 2113 | * rate. */ |
2109 | if (!ieee80211_is_data(hdr->frame_control) || | 2114 | if (!ieee80211_is_data(hdr->frame_control) || |
2110 | is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) { | 2115 | is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) { |
2111 | info->control.rates[0].idx = rate_lowest_index(sband, sta); | 2116 | if (!mask_bit) |
2117 | info->control.rates[0].idx = | ||
2118 | rate_lowest_index(sband, NULL); | ||
2119 | else | ||
2120 | info->control.rates[0].idx = | ||
2121 | rate_lowest_index(sband, sta); | ||
2112 | return; | 2122 | return; |
2113 | } | 2123 | } |
2114 | 2124 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 5da6b35cd26d..0dc8eed16404 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2482,7 +2482,7 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2482 | dev_kfree_skb_any(skb); | 2482 | dev_kfree_skb_any(skb); |
2483 | 2483 | ||
2484 | IWL_DEBUG_MACDUMP("leave\n"); | 2484 | IWL_DEBUG_MACDUMP("leave\n"); |
2485 | return 0; | 2485 | return NETDEV_TX_OK; |
2486 | } | 2486 | } |
2487 | 2487 | ||
2488 | static int iwl_mac_add_interface(struct ieee80211_hw *hw, | 2488 | static int iwl_mac_add_interface(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 8c71ad4f88c5..4b35b30e493e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c | |||
@@ -224,7 +224,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
224 | IWL_ERROR("Error: Response NULL in '%s'\n", | 224 | IWL_ERROR("Error: Response NULL in '%s'\n", |
225 | get_cmd_string(cmd->id)); | 225 | get_cmd_string(cmd->id)); |
226 | ret = -EIO; | 226 | ret = -EIO; |
227 | goto out; | 227 | goto cancel; |
228 | } | 228 | } |
229 | 229 | ||
230 | ret = 0; | 230 | ret = 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d64580805d6e..95d01984c80e 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -745,7 +745,7 @@ static int iwl3945_send_cmd_sync(struct iwl3945_priv *priv, struct iwl3945_host_ | |||
745 | IWL_ERROR("Error: Response NULL in '%s'\n", | 745 | IWL_ERROR("Error: Response NULL in '%s'\n", |
746 | get_cmd_string(cmd->id)); | 746 | get_cmd_string(cmd->id)); |
747 | ret = -EIO; | 747 | ret = -EIO; |
748 | goto out; | 748 | goto cancel; |
749 | } | 749 | } |
750 | 750 | ||
751 | ret = 0; | 751 | ret = 0; |
@@ -6538,7 +6538,7 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
6538 | dev_kfree_skb_any(skb); | 6538 | dev_kfree_skb_any(skb); |
6539 | 6539 | ||
6540 | IWL_DEBUG_MAC80211("leave\n"); | 6540 | IWL_DEBUG_MAC80211("leave\n"); |
6541 | return 0; | 6541 | return NETDEV_TX_OK; |
6542 | } | 6542 | } |
6543 | 6543 | ||
6544 | static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, | 6544 | static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h index e173b1b46c23..f6a79a653b7b 100644 --- a/drivers/net/wireless/libertas/hostcmd.h +++ b/drivers/net/wireless/libertas/hostcmd.h | |||
@@ -32,7 +32,7 @@ struct txpd { | |||
32 | u8 pktdelay_2ms; | 32 | u8 pktdelay_2ms; |
33 | /* reserved */ | 33 | /* reserved */ |
34 | u8 reserved1; | 34 | u8 reserved1; |
35 | }; | 35 | } __attribute__ ((packed)); |
36 | 36 | ||
37 | /* RxPD Descriptor */ | 37 | /* RxPD Descriptor */ |
38 | struct rxpd { | 38 | struct rxpd { |
@@ -63,7 +63,7 @@ struct rxpd { | |||
63 | /* Pkt Priority */ | 63 | /* Pkt Priority */ |
64 | u8 priority; | 64 | u8 priority; |
65 | u8 reserved[3]; | 65 | u8 reserved[3]; |
66 | }; | 66 | } __attribute__ ((packed)); |
67 | 67 | ||
68 | struct cmd_header { | 68 | struct cmd_header { |
69 | __le16 command; | 69 | __le16 command; |
@@ -97,7 +97,7 @@ struct enc_key { | |||
97 | struct lbs_offset_value { | 97 | struct lbs_offset_value { |
98 | u32 offset; | 98 | u32 offset; |
99 | u32 value; | 99 | u32 value; |
100 | }; | 100 | } __attribute__ ((packed)); |
101 | 101 | ||
102 | /* Define general data structure */ | 102 | /* Define general data structure */ |
103 | /* cmd_DS_GEN */ | 103 | /* cmd_DS_GEN */ |
@@ -107,7 +107,7 @@ struct cmd_ds_gen { | |||
107 | __le16 seqnum; | 107 | __le16 seqnum; |
108 | __le16 result; | 108 | __le16 result; |
109 | void *cmdresp[0]; | 109 | void *cmdresp[0]; |
110 | }; | 110 | } __attribute__ ((packed)); |
111 | 111 | ||
112 | #define S_DS_GEN sizeof(struct cmd_ds_gen) | 112 | #define S_DS_GEN sizeof(struct cmd_ds_gen) |
113 | 113 | ||
@@ -163,7 +163,7 @@ struct cmd_ds_802_11_subscribe_event { | |||
163 | * bump this up a bit. | 163 | * bump this up a bit. |
164 | */ | 164 | */ |
165 | uint8_t tlv[128]; | 165 | uint8_t tlv[128]; |
166 | }; | 166 | } __attribute__ ((packed)); |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * This scan handle Country Information IE(802.11d compliant) | 169 | * This scan handle Country Information IE(802.11d compliant) |
@@ -180,7 +180,7 @@ struct cmd_ds_802_11_scan { | |||
180 | mrvlietypes_chanlistparamset_t ChanListParamSet; | 180 | mrvlietypes_chanlistparamset_t ChanListParamSet; |
181 | mrvlietypes_ratesparamset_t OpRateSet; | 181 | mrvlietypes_ratesparamset_t OpRateSet; |
182 | #endif | 182 | #endif |
183 | }; | 183 | } __attribute__ ((packed)); |
184 | 184 | ||
185 | struct cmd_ds_802_11_scan_rsp { | 185 | struct cmd_ds_802_11_scan_rsp { |
186 | struct cmd_header hdr; | 186 | struct cmd_header hdr; |
@@ -188,7 +188,7 @@ struct cmd_ds_802_11_scan_rsp { | |||
188 | __le16 bssdescriptsize; | 188 | __le16 bssdescriptsize; |
189 | uint8_t nr_sets; | 189 | uint8_t nr_sets; |
190 | uint8_t bssdesc_and_tlvbuffer[0]; | 190 | uint8_t bssdesc_and_tlvbuffer[0]; |
191 | }; | 191 | } __attribute__ ((packed)); |
192 | 192 | ||
193 | struct cmd_ds_802_11_get_log { | 193 | struct cmd_ds_802_11_get_log { |
194 | struct cmd_header hdr; | 194 | struct cmd_header hdr; |
@@ -206,33 +206,33 @@ struct cmd_ds_802_11_get_log { | |||
206 | __le32 fcserror; | 206 | __le32 fcserror; |
207 | __le32 txframe; | 207 | __le32 txframe; |
208 | __le32 wepundecryptable; | 208 | __le32 wepundecryptable; |
209 | }; | 209 | } __attribute__ ((packed)); |
210 | 210 | ||
211 | struct cmd_ds_mac_control { | 211 | struct cmd_ds_mac_control { |
212 | struct cmd_header hdr; | 212 | struct cmd_header hdr; |
213 | __le16 action; | 213 | __le16 action; |
214 | u16 reserved; | 214 | u16 reserved; |
215 | }; | 215 | } __attribute__ ((packed)); |
216 | 216 | ||
217 | struct cmd_ds_mac_multicast_adr { | 217 | struct cmd_ds_mac_multicast_adr { |
218 | struct cmd_header hdr; | 218 | struct cmd_header hdr; |
219 | __le16 action; | 219 | __le16 action; |
220 | __le16 nr_of_adrs; | 220 | __le16 nr_of_adrs; |
221 | u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; | 221 | u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; |
222 | }; | 222 | } __attribute__ ((packed)); |
223 | 223 | ||
224 | struct cmd_ds_802_11_authenticate { | 224 | struct cmd_ds_802_11_authenticate { |
225 | u8 macaddr[ETH_ALEN]; | 225 | u8 macaddr[ETH_ALEN]; |
226 | u8 authtype; | 226 | u8 authtype; |
227 | u8 reserved[10]; | 227 | u8 reserved[10]; |
228 | }; | 228 | } __attribute__ ((packed)); |
229 | 229 | ||
230 | struct cmd_ds_802_11_deauthenticate { | 230 | struct cmd_ds_802_11_deauthenticate { |
231 | struct cmd_header hdr; | 231 | struct cmd_header hdr; |
232 | 232 | ||
233 | u8 macaddr[ETH_ALEN]; | 233 | u8 macaddr[ETH_ALEN]; |
234 | __le16 reasoncode; | 234 | __le16 reasoncode; |
235 | }; | 235 | } __attribute__ ((packed)); |
236 | 236 | ||
237 | struct cmd_ds_802_11_associate { | 237 | struct cmd_ds_802_11_associate { |
238 | u8 peerstaaddr[6]; | 238 | u8 peerstaaddr[6]; |
@@ -251,7 +251,7 @@ struct cmd_ds_802_11_associate { | |||
251 | 251 | ||
252 | struct cmd_ds_802_11_associate_rsp { | 252 | struct cmd_ds_802_11_associate_rsp { |
253 | struct ieeetypes_assocrsp assocRsp; | 253 | struct ieeetypes_assocrsp assocRsp; |
254 | }; | 254 | } __attribute__ ((packed)); |
255 | 255 | ||
256 | struct cmd_ds_802_11_set_wep { | 256 | struct cmd_ds_802_11_set_wep { |
257 | struct cmd_header hdr; | 257 | struct cmd_header hdr; |
@@ -265,7 +265,7 @@ struct cmd_ds_802_11_set_wep { | |||
265 | /* 40, 128bit or TXWEP */ | 265 | /* 40, 128bit or TXWEP */ |
266 | uint8_t keytype[4]; | 266 | uint8_t keytype[4]; |
267 | uint8_t keymaterial[4][16]; | 267 | uint8_t keymaterial[4][16]; |
268 | }; | 268 | } __attribute__ ((packed)); |
269 | 269 | ||
270 | struct cmd_ds_802_3_get_stat { | 270 | struct cmd_ds_802_3_get_stat { |
271 | __le32 xmitok; | 271 | __le32 xmitok; |
@@ -274,7 +274,7 @@ struct cmd_ds_802_3_get_stat { | |||
274 | __le32 rcverror; | 274 | __le32 rcverror; |
275 | __le32 rcvnobuffer; | 275 | __le32 rcvnobuffer; |
276 | __le32 rcvcrcerror; | 276 | __le32 rcvcrcerror; |
277 | }; | 277 | } __attribute__ ((packed)); |
278 | 278 | ||
279 | struct cmd_ds_802_11_get_stat { | 279 | struct cmd_ds_802_11_get_stat { |
280 | __le32 txfragmentcnt; | 280 | __le32 txfragmentcnt; |
@@ -294,7 +294,7 @@ struct cmd_ds_802_11_get_stat { | |||
294 | __le32 txbeacon; | 294 | __le32 txbeacon; |
295 | __le32 rxbeacon; | 295 | __le32 rxbeacon; |
296 | __le32 wepundecryptable; | 296 | __le32 wepundecryptable; |
297 | }; | 297 | } __attribute__ ((packed)); |
298 | 298 | ||
299 | struct cmd_ds_802_11_snmp_mib { | 299 | struct cmd_ds_802_11_snmp_mib { |
300 | struct cmd_header hdr; | 300 | struct cmd_header hdr; |
@@ -303,58 +303,58 @@ struct cmd_ds_802_11_snmp_mib { | |||
303 | __le16 oid; | 303 | __le16 oid; |
304 | __le16 bufsize; | 304 | __le16 bufsize; |
305 | u8 value[128]; | 305 | u8 value[128]; |
306 | }; | 306 | } __attribute__ ((packed)); |
307 | 307 | ||
308 | struct cmd_ds_mac_reg_map { | 308 | struct cmd_ds_mac_reg_map { |
309 | __le16 buffersize; | 309 | __le16 buffersize; |
310 | u8 regmap[128]; | 310 | u8 regmap[128]; |
311 | __le16 reserved; | 311 | __le16 reserved; |
312 | }; | 312 | } __attribute__ ((packed)); |
313 | 313 | ||
314 | struct cmd_ds_bbp_reg_map { | 314 | struct cmd_ds_bbp_reg_map { |
315 | __le16 buffersize; | 315 | __le16 buffersize; |
316 | u8 regmap[128]; | 316 | u8 regmap[128]; |
317 | __le16 reserved; | 317 | __le16 reserved; |
318 | }; | 318 | } __attribute__ ((packed)); |
319 | 319 | ||
320 | struct cmd_ds_rf_reg_map { | 320 | struct cmd_ds_rf_reg_map { |
321 | __le16 buffersize; | 321 | __le16 buffersize; |
322 | u8 regmap[64]; | 322 | u8 regmap[64]; |
323 | __le16 reserved; | 323 | __le16 reserved; |
324 | }; | 324 | } __attribute__ ((packed)); |
325 | 325 | ||
326 | struct cmd_ds_mac_reg_access { | 326 | struct cmd_ds_mac_reg_access { |
327 | __le16 action; | 327 | __le16 action; |
328 | __le16 offset; | 328 | __le16 offset; |
329 | __le32 value; | 329 | __le32 value; |
330 | }; | 330 | } __attribute__ ((packed)); |
331 | 331 | ||
332 | struct cmd_ds_bbp_reg_access { | 332 | struct cmd_ds_bbp_reg_access { |
333 | __le16 action; | 333 | __le16 action; |
334 | __le16 offset; | 334 | __le16 offset; |
335 | u8 value; | 335 | u8 value; |
336 | u8 reserved[3]; | 336 | u8 reserved[3]; |
337 | }; | 337 | } __attribute__ ((packed)); |
338 | 338 | ||
339 | struct cmd_ds_rf_reg_access { | 339 | struct cmd_ds_rf_reg_access { |
340 | __le16 action; | 340 | __le16 action; |
341 | __le16 offset; | 341 | __le16 offset; |
342 | u8 value; | 342 | u8 value; |
343 | u8 reserved[3]; | 343 | u8 reserved[3]; |
344 | }; | 344 | } __attribute__ ((packed)); |
345 | 345 | ||
346 | struct cmd_ds_802_11_radio_control { | 346 | struct cmd_ds_802_11_radio_control { |
347 | struct cmd_header hdr; | 347 | struct cmd_header hdr; |
348 | 348 | ||
349 | __le16 action; | 349 | __le16 action; |
350 | __le16 control; | 350 | __le16 control; |
351 | }; | 351 | } __attribute__ ((packed)); |
352 | 352 | ||
353 | struct cmd_ds_802_11_beacon_control { | 353 | struct cmd_ds_802_11_beacon_control { |
354 | __le16 action; | 354 | __le16 action; |
355 | __le16 beacon_enable; | 355 | __le16 beacon_enable; |
356 | __le16 beacon_period; | 356 | __le16 beacon_period; |
357 | }; | 357 | } __attribute__ ((packed)); |
358 | 358 | ||
359 | struct cmd_ds_802_11_sleep_params { | 359 | struct cmd_ds_802_11_sleep_params { |
360 | struct cmd_header hdr; | 360 | struct cmd_header hdr; |
@@ -379,7 +379,7 @@ struct cmd_ds_802_11_sleep_params { | |||
379 | 379 | ||
380 | /* reserved field, should be set to zero */ | 380 | /* reserved field, should be set to zero */ |
381 | __le16 reserved; | 381 | __le16 reserved; |
382 | }; | 382 | } __attribute__ ((packed)); |
383 | 383 | ||
384 | struct cmd_ds_802_11_inactivity_timeout { | 384 | struct cmd_ds_802_11_inactivity_timeout { |
385 | struct cmd_header hdr; | 385 | struct cmd_header hdr; |
@@ -389,7 +389,7 @@ struct cmd_ds_802_11_inactivity_timeout { | |||
389 | 389 | ||
390 | /* Inactivity timeout in msec */ | 390 | /* Inactivity timeout in msec */ |
391 | __le16 timeout; | 391 | __le16 timeout; |
392 | }; | 392 | } __attribute__ ((packed)); |
393 | 393 | ||
394 | struct cmd_ds_802_11_rf_channel { | 394 | struct cmd_ds_802_11_rf_channel { |
395 | struct cmd_header hdr; | 395 | struct cmd_header hdr; |
@@ -399,7 +399,7 @@ struct cmd_ds_802_11_rf_channel { | |||
399 | __le16 rftype; /* unused */ | 399 | __le16 rftype; /* unused */ |
400 | __le16 reserved; /* unused */ | 400 | __le16 reserved; /* unused */ |
401 | u8 channellist[32]; /* unused */ | 401 | u8 channellist[32]; /* unused */ |
402 | }; | 402 | } __attribute__ ((packed)); |
403 | 403 | ||
404 | struct cmd_ds_802_11_rssi { | 404 | struct cmd_ds_802_11_rssi { |
405 | /* weighting factor */ | 405 | /* weighting factor */ |
@@ -408,21 +408,21 @@ struct cmd_ds_802_11_rssi { | |||
408 | __le16 reserved_0; | 408 | __le16 reserved_0; |
409 | __le16 reserved_1; | 409 | __le16 reserved_1; |
410 | __le16 reserved_2; | 410 | __le16 reserved_2; |
411 | }; | 411 | } __attribute__ ((packed)); |
412 | 412 | ||
413 | struct cmd_ds_802_11_rssi_rsp { | 413 | struct cmd_ds_802_11_rssi_rsp { |
414 | __le16 SNR; | 414 | __le16 SNR; |
415 | __le16 noisefloor; | 415 | __le16 noisefloor; |
416 | __le16 avgSNR; | 416 | __le16 avgSNR; |
417 | __le16 avgnoisefloor; | 417 | __le16 avgnoisefloor; |
418 | }; | 418 | } __attribute__ ((packed)); |
419 | 419 | ||
420 | struct cmd_ds_802_11_mac_address { | 420 | struct cmd_ds_802_11_mac_address { |
421 | struct cmd_header hdr; | 421 | struct cmd_header hdr; |
422 | 422 | ||
423 | __le16 action; | 423 | __le16 action; |
424 | u8 macadd[ETH_ALEN]; | 424 | u8 macadd[ETH_ALEN]; |
425 | }; | 425 | } __attribute__ ((packed)); |
426 | 426 | ||
427 | struct cmd_ds_802_11_rf_tx_power { | 427 | struct cmd_ds_802_11_rf_tx_power { |
428 | struct cmd_header hdr; | 428 | struct cmd_header hdr; |
@@ -431,7 +431,7 @@ struct cmd_ds_802_11_rf_tx_power { | |||
431 | __le16 curlevel; | 431 | __le16 curlevel; |
432 | s8 maxlevel; | 432 | s8 maxlevel; |
433 | s8 minlevel; | 433 | s8 minlevel; |
434 | }; | 434 | } __attribute__ ((packed)); |
435 | 435 | ||
436 | struct cmd_ds_802_11_rf_antenna { | 436 | struct cmd_ds_802_11_rf_antenna { |
437 | __le16 action; | 437 | __le16 action; |
@@ -439,33 +439,33 @@ struct cmd_ds_802_11_rf_antenna { | |||
439 | /* Number of antennas or 0xffff(diversity) */ | 439 | /* Number of antennas or 0xffff(diversity) */ |
440 | __le16 antennamode; | 440 | __le16 antennamode; |
441 | 441 | ||
442 | }; | 442 | } __attribute__ ((packed)); |
443 | 443 | ||
444 | struct cmd_ds_802_11_monitor_mode { | 444 | struct cmd_ds_802_11_monitor_mode { |
445 | __le16 action; | 445 | __le16 action; |
446 | __le16 mode; | 446 | __le16 mode; |
447 | }; | 447 | } __attribute__ ((packed)); |
448 | 448 | ||
449 | struct cmd_ds_set_boot2_ver { | 449 | struct cmd_ds_set_boot2_ver { |
450 | struct cmd_header hdr; | 450 | struct cmd_header hdr; |
451 | 451 | ||
452 | __le16 action; | 452 | __le16 action; |
453 | __le16 version; | 453 | __le16 version; |
454 | }; | 454 | } __attribute__ ((packed)); |
455 | 455 | ||
456 | struct cmd_ds_802_11_fw_wake_method { | 456 | struct cmd_ds_802_11_fw_wake_method { |
457 | struct cmd_header hdr; | 457 | struct cmd_header hdr; |
458 | 458 | ||
459 | __le16 action; | 459 | __le16 action; |
460 | __le16 method; | 460 | __le16 method; |
461 | }; | 461 | } __attribute__ ((packed)); |
462 | 462 | ||
463 | struct cmd_ds_802_11_sleep_period { | 463 | struct cmd_ds_802_11_sleep_period { |
464 | struct cmd_header hdr; | 464 | struct cmd_header hdr; |
465 | 465 | ||
466 | __le16 action; | 466 | __le16 action; |
467 | __le16 period; | 467 | __le16 period; |
468 | }; | 468 | } __attribute__ ((packed)); |
469 | 469 | ||
470 | struct cmd_ds_802_11_ps_mode { | 470 | struct cmd_ds_802_11_ps_mode { |
471 | __le16 action; | 471 | __le16 action; |
@@ -473,7 +473,7 @@ struct cmd_ds_802_11_ps_mode { | |||
473 | __le16 multipledtim; | 473 | __le16 multipledtim; |
474 | __le16 reserved; | 474 | __le16 reserved; |
475 | __le16 locallisteninterval; | 475 | __le16 locallisteninterval; |
476 | }; | 476 | } __attribute__ ((packed)); |
477 | 477 | ||
478 | struct cmd_confirm_sleep { | 478 | struct cmd_confirm_sleep { |
479 | struct cmd_header hdr; | 479 | struct cmd_header hdr; |
@@ -483,7 +483,7 @@ struct cmd_confirm_sleep { | |||
483 | __le16 multipledtim; | 483 | __le16 multipledtim; |
484 | __le16 reserved; | 484 | __le16 reserved; |
485 | __le16 locallisteninterval; | 485 | __le16 locallisteninterval; |
486 | }; | 486 | } __attribute__ ((packed)); |
487 | 487 | ||
488 | struct cmd_ds_802_11_data_rate { | 488 | struct cmd_ds_802_11_data_rate { |
489 | struct cmd_header hdr; | 489 | struct cmd_header hdr; |
@@ -491,14 +491,14 @@ struct cmd_ds_802_11_data_rate { | |||
491 | __le16 action; | 491 | __le16 action; |
492 | __le16 reserved; | 492 | __le16 reserved; |
493 | u8 rates[MAX_RATES]; | 493 | u8 rates[MAX_RATES]; |
494 | }; | 494 | } __attribute__ ((packed)); |
495 | 495 | ||
496 | struct cmd_ds_802_11_rate_adapt_rateset { | 496 | struct cmd_ds_802_11_rate_adapt_rateset { |
497 | struct cmd_header hdr; | 497 | struct cmd_header hdr; |
498 | __le16 action; | 498 | __le16 action; |
499 | __le16 enablehwauto; | 499 | __le16 enablehwauto; |
500 | __le16 bitmap; | 500 | __le16 bitmap; |
501 | }; | 501 | } __attribute__ ((packed)); |
502 | 502 | ||
503 | struct cmd_ds_802_11_ad_hoc_start { | 503 | struct cmd_ds_802_11_ad_hoc_start { |
504 | struct cmd_header hdr; | 504 | struct cmd_header hdr; |
@@ -520,7 +520,7 @@ struct cmd_ds_802_11_ad_hoc_result { | |||
520 | 520 | ||
521 | u8 pad[3]; | 521 | u8 pad[3]; |
522 | u8 bssid[ETH_ALEN]; | 522 | u8 bssid[ETH_ALEN]; |
523 | }; | 523 | } __attribute__ ((packed)); |
524 | 524 | ||
525 | struct adhoc_bssdesc { | 525 | struct adhoc_bssdesc { |
526 | u8 bssid[ETH_ALEN]; | 526 | u8 bssid[ETH_ALEN]; |
@@ -578,7 +578,7 @@ struct MrvlIEtype_keyParamSet { | |||
578 | 578 | ||
579 | /* key material of size keylen */ | 579 | /* key material of size keylen */ |
580 | u8 key[32]; | 580 | u8 key[32]; |
581 | }; | 581 | } __attribute__ ((packed)); |
582 | 582 | ||
583 | #define MAX_WOL_RULES 16 | 583 | #define MAX_WOL_RULES 16 |
584 | 584 | ||
@@ -590,7 +590,7 @@ struct host_wol_rule { | |||
590 | __le16 reserve; | 590 | __le16 reserve; |
591 | __be32 sig_mask; | 591 | __be32 sig_mask; |
592 | __be32 signature; | 592 | __be32 signature; |
593 | }; | 593 | } __attribute__ ((packed)); |
594 | 594 | ||
595 | struct wol_config { | 595 | struct wol_config { |
596 | uint8_t action; | 596 | uint8_t action; |
@@ -598,8 +598,7 @@ struct wol_config { | |||
598 | uint8_t no_rules_in_cmd; | 598 | uint8_t no_rules_in_cmd; |
599 | uint8_t result; | 599 | uint8_t result; |
600 | struct host_wol_rule rule[MAX_WOL_RULES]; | 600 | struct host_wol_rule rule[MAX_WOL_RULES]; |
601 | }; | 601 | } __attribute__ ((packed)); |
602 | |||
603 | 602 | ||
604 | struct cmd_ds_host_sleep { | 603 | struct cmd_ds_host_sleep { |
605 | struct cmd_header hdr; | 604 | struct cmd_header hdr; |
diff --git a/drivers/net/wireless/orinoco/orinoco.c b/drivers/net/wireless/orinoco/orinoco.c index c3bb85e0251e..45a04faa7818 100644 --- a/drivers/net/wireless/orinoco/orinoco.c +++ b/drivers/net/wireless/orinoco/orinoco.c | |||
@@ -1673,7 +1673,7 @@ static void print_linkstatus(struct net_device *dev, u16 status) | |||
1673 | s = "UNKNOWN"; | 1673 | s = "UNKNOWN"; |
1674 | } | 1674 | } |
1675 | 1675 | ||
1676 | printk(KERN_INFO "%s: New link status: %s (%04x)\n", | 1676 | printk(KERN_DEBUG "%s: New link status: %s (%04x)\n", |
1677 | dev->name, s, status); | 1677 | dev->name, s, status); |
1678 | } | 1678 | } |
1679 | 1679 | ||
@@ -5068,33 +5068,30 @@ static int orinoco_ioctl_set_genie(struct net_device *dev, | |||
5068 | struct orinoco_private *priv = netdev_priv(dev); | 5068 | struct orinoco_private *priv = netdev_priv(dev); |
5069 | u8 *buf; | 5069 | u8 *buf; |
5070 | unsigned long flags; | 5070 | unsigned long flags; |
5071 | int err = 0; | ||
5072 | 5071 | ||
5073 | /* cut off at IEEE80211_MAX_DATA_LEN */ | 5072 | /* cut off at IEEE80211_MAX_DATA_LEN */ |
5074 | if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) || | 5073 | if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) || |
5075 | (wrqu->data.length && (extra == NULL))) | 5074 | (wrqu->data.length && (extra == NULL))) |
5076 | return -EINVAL; | 5075 | return -EINVAL; |
5077 | 5076 | ||
5078 | if (orinoco_lock(priv, &flags) != 0) | ||
5079 | return -EBUSY; | ||
5080 | |||
5081 | if (wrqu->data.length) { | 5077 | if (wrqu->data.length) { |
5082 | buf = kmalloc(wrqu->data.length, GFP_KERNEL); | 5078 | buf = kmalloc(wrqu->data.length, GFP_KERNEL); |
5083 | if (buf == NULL) { | 5079 | if (buf == NULL) |
5084 | err = -ENOMEM; | 5080 | return -ENOMEM; |
5085 | goto out; | ||
5086 | } | ||
5087 | 5081 | ||
5088 | memcpy(buf, extra, wrqu->data.length); | 5082 | memcpy(buf, extra, wrqu->data.length); |
5089 | kfree(priv->wpa_ie); | 5083 | } else |
5090 | priv->wpa_ie = buf; | 5084 | buf = NULL; |
5091 | priv->wpa_ie_len = wrqu->data.length; | 5085 | |
5092 | } else { | 5086 | if (orinoco_lock(priv, &flags) != 0) { |
5093 | kfree(priv->wpa_ie); | 5087 | kfree(buf); |
5094 | priv->wpa_ie = NULL; | 5088 | return -EBUSY; |
5095 | priv->wpa_ie_len = 0; | ||
5096 | } | 5089 | } |
5097 | 5090 | ||
5091 | kfree(priv->wpa_ie); | ||
5092 | priv->wpa_ie = buf; | ||
5093 | priv->wpa_ie_len = wrqu->data.length; | ||
5094 | |||
5098 | if (priv->wpa_ie) { | 5095 | if (priv->wpa_ie) { |
5099 | /* Looks like wl_lkm wants to check the auth alg, and | 5096 | /* Looks like wl_lkm wants to check the auth alg, and |
5100 | * somehow pass it to the firmware. | 5097 | * somehow pass it to the firmware. |
@@ -5103,9 +5100,8 @@ static int orinoco_ioctl_set_genie(struct net_device *dev, | |||
5103 | */ | 5100 | */ |
5104 | } | 5101 | } |
5105 | 5102 | ||
5106 | out: | ||
5107 | orinoco_unlock(priv, &flags); | 5103 | orinoco_unlock(priv, &flags); |
5108 | return err; | 5104 | return 0; |
5109 | } | 5105 | } |
5110 | 5106 | ||
5111 | static int orinoco_ioctl_get_genie(struct net_device *dev, | 5107 | static int orinoco_ioctl_get_genie(struct net_device *dev, |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index c6a370fa9bcb..34561e6e816b 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -451,8 +451,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
451 | } | 451 | } |
452 | if (err) | 452 | if (err) |
453 | goto err; | 453 | goto err; |
454 | 454 | } | |
455 | } | 455 | break; |
456 | case PDR_PRISM_ZIF_TX_IQ_CALIBRATION: | 456 | case PDR_PRISM_ZIF_TX_IQ_CALIBRATION: |
457 | priv->iq_autocal = kmalloc(data_len, GFP_KERNEL); | 457 | priv->iq_autocal = kmalloc(data_len, GFP_KERNEL); |
458 | if (!priv->iq_autocal) { | 458 | if (!priv->iq_autocal) { |
@@ -745,7 +745,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
745 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); | 745 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); |
746 | struct p54_hdr *entry_hdr; | 746 | struct p54_hdr *entry_hdr; |
747 | struct p54_tx_data *entry_data; | 747 | struct p54_tx_data *entry_data; |
748 | int pad = 0; | 748 | unsigned int pad = 0, frame_len; |
749 | 749 | ||
750 | range = (void *)info->rate_driver_data; | 750 | range = (void *)info->rate_driver_data; |
751 | if (range->start_addr != addr) { | 751 | if (range->start_addr != addr) { |
@@ -768,6 +768,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
768 | __skb_unlink(entry, &priv->tx_queue); | 768 | __skb_unlink(entry, &priv->tx_queue); |
769 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | 769 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); |
770 | 770 | ||
771 | frame_len = entry->len; | ||
771 | entry_hdr = (struct p54_hdr *) entry->data; | 772 | entry_hdr = (struct p54_hdr *) entry->data; |
772 | entry_data = (struct p54_tx_data *) entry_hdr->data; | 773 | entry_data = (struct p54_tx_data *) entry_hdr->data; |
773 | priv->tx_stats[entry_data->hw_queue].len--; | 774 | priv->tx_stats[entry_data->hw_queue].len--; |
@@ -814,15 +815,28 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
814 | info->status.ack_signal = p54_rssi_to_dbm(dev, | 815 | info->status.ack_signal = p54_rssi_to_dbm(dev, |
815 | (int)payload->ack_rssi); | 816 | (int)payload->ack_rssi); |
816 | 817 | ||
817 | if (entry_data->key_type == P54_CRYPTO_TKIPMICHAEL) { | 818 | /* Undo all changes to the frame. */ |
819 | switch (entry_data->key_type) { | ||
820 | case P54_CRYPTO_TKIPMICHAEL: { | ||
818 | u8 *iv = (u8 *)(entry_data->align + pad + | 821 | u8 *iv = (u8 *)(entry_data->align + pad + |
819 | entry_data->crypt_offset); | 822 | entry_data->crypt_offset); |
820 | 823 | ||
821 | /* Restore the original TKIP IV. */ | 824 | /* Restore the original TKIP IV. */ |
822 | iv[2] = iv[0]; | 825 | iv[2] = iv[0]; |
823 | iv[0] = iv[1]; | 826 | iv[0] = iv[1]; |
824 | iv[1] = (iv[0] | 0x20) & 0x7f; /* WEPSeed - 8.3.2.2 */ | 827 | iv[1] = (iv[0] | 0x20) & 0x7f; /* WEPSeed - 8.3.2.2 */ |
828 | |||
829 | frame_len -= 12; /* remove TKIP_MMIC + TKIP_ICV */ | ||
830 | break; | ||
831 | } | ||
832 | case P54_CRYPTO_AESCCMP: | ||
833 | frame_len -= 8; /* remove CCMP_MIC */ | ||
834 | break; | ||
835 | case P54_CRYPTO_WEP: | ||
836 | frame_len -= 4; /* remove WEP_ICV */ | ||
837 | break; | ||
825 | } | 838 | } |
839 | skb_trim(entry, frame_len); | ||
826 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); | 840 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); |
827 | ieee80211_tx_status_irqsafe(dev, entry); | 841 | ieee80211_tx_status_irqsafe(dev, entry); |
828 | goto out; | 842 | goto out; |
@@ -1147,7 +1161,7 @@ static int p54_set_tim(struct ieee80211_hw *dev, struct ieee80211_sta *sta, | |||
1147 | 1161 | ||
1148 | skb = p54_alloc_skb(dev, P54_HDR_FLAG_CONTROL_OPSET, | 1162 | skb = p54_alloc_skb(dev, P54_HDR_FLAG_CONTROL_OPSET, |
1149 | sizeof(struct p54_hdr) + sizeof(*tim), | 1163 | sizeof(struct p54_hdr) + sizeof(*tim), |
1150 | P54_CONTROL_TYPE_TIM, GFP_KERNEL); | 1164 | P54_CONTROL_TYPE_TIM, GFP_ATOMIC); |
1151 | if (!skb) | 1165 | if (!skb) |
1152 | return -ENOMEM; | 1166 | return -ENOMEM; |
1153 | 1167 | ||
@@ -1610,7 +1624,7 @@ static int p54_scan(struct ieee80211_hw *dev, u16 mode, u16 dwell) | |||
1610 | 1624 | ||
1611 | err: | 1625 | err: |
1612 | printk(KERN_ERR "%s: frequency change failed\n", wiphy_name(dev->wiphy)); | 1626 | printk(KERN_ERR "%s: frequency change failed\n", wiphy_name(dev->wiphy)); |
1613 | kfree_skb(skb); | 1627 | p54_free_skb(dev, skb); |
1614 | return -EINVAL; | 1628 | return -EINVAL; |
1615 | } | 1629 | } |
1616 | 1630 | ||
@@ -2077,7 +2091,7 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, | |||
2077 | algo = P54_CRYPTO_AESCCMP; | 2091 | algo = P54_CRYPTO_AESCCMP; |
2078 | break; | 2092 | break; |
2079 | default: | 2093 | default: |
2080 | return -EINVAL; | 2094 | return -EOPNOTSUPP; |
2081 | } | 2095 | } |
2082 | } | 2096 | } |
2083 | 2097 | ||
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 6a6a72f6f82c..5de2ebfb28c7 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -144,11 +144,8 @@ static void p54u_tx_cb(struct urb *urb) | |||
144 | struct sk_buff *skb = urb->context; | 144 | struct sk_buff *skb = urb->context; |
145 | struct ieee80211_hw *dev = (struct ieee80211_hw *) | 145 | struct ieee80211_hw *dev = (struct ieee80211_hw *) |
146 | usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); | 146 | usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); |
147 | struct p54u_priv *priv = dev->priv; | ||
148 | 147 | ||
149 | skb_pull(skb, priv->common.tx_hdr_len); | 148 | p54_free_skb(dev, skb); |
150 | if (FREE_AFTER_TX(skb)) | ||
151 | p54_free_skb(dev, skb); | ||
152 | } | 149 | } |
153 | 150 | ||
154 | static void p54u_tx_dummy_cb(struct urb *urb) { } | 151 | static void p54u_tx_dummy_cb(struct urb *urb) { } |
@@ -230,7 +227,10 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
230 | p54u_tx_dummy_cb, dev); | 227 | p54u_tx_dummy_cb, dev); |
231 | usb_fill_bulk_urb(data_urb, priv->udev, | 228 | usb_fill_bulk_urb(data_urb, priv->udev, |
232 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 229 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
233 | skb->data, skb->len, p54u_tx_cb, skb); | 230 | skb->data, skb->len, FREE_AFTER_TX(skb) ? |
231 | p54u_tx_cb : p54u_tx_dummy_cb, skb); | ||
232 | addr_urb->transfer_flags |= URB_ZERO_PACKET; | ||
233 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
234 | 234 | ||
235 | usb_anchor_urb(addr_urb, &priv->submitted); | 235 | usb_anchor_urb(addr_urb, &priv->submitted); |
236 | err = usb_submit_urb(addr_urb, GFP_ATOMIC); | 236 | err = usb_submit_urb(addr_urb, GFP_ATOMIC); |
@@ -239,7 +239,7 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
239 | goto out; | 239 | goto out; |
240 | } | 240 | } |
241 | 241 | ||
242 | usb_anchor_urb(addr_urb, &priv->submitted); | 242 | usb_anchor_urb(data_urb, &priv->submitted); |
243 | err = usb_submit_urb(data_urb, GFP_ATOMIC); | 243 | err = usb_submit_urb(data_urb, GFP_ATOMIC); |
244 | if (err) | 244 | if (err) |
245 | usb_unanchor_urb(data_urb); | 245 | usb_unanchor_urb(data_urb); |
@@ -269,28 +269,24 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
269 | { | 269 | { |
270 | struct p54u_priv *priv = dev->priv; | 270 | struct p54u_priv *priv = dev->priv; |
271 | struct urb *data_urb; | 271 | struct urb *data_urb; |
272 | struct lm87_tx_hdr *hdr; | 272 | struct lm87_tx_hdr *hdr = (void *)skb->data - sizeof(*hdr); |
273 | __le32 checksum; | ||
274 | __le32 addr = ((struct p54_hdr *)skb->data)->req_id; | ||
275 | 273 | ||
276 | data_urb = usb_alloc_urb(0, GFP_ATOMIC); | 274 | data_urb = usb_alloc_urb(0, GFP_ATOMIC); |
277 | if (!data_urb) | 275 | if (!data_urb) |
278 | return; | 276 | return; |
279 | 277 | ||
280 | checksum = p54u_lm87_chksum((__le32 *)skb->data, skb->len); | 278 | hdr->chksum = p54u_lm87_chksum((__le32 *)skb->data, skb->len); |
281 | hdr = (struct lm87_tx_hdr *)skb_push(skb, sizeof(*hdr)); | 279 | hdr->device_addr = ((struct p54_hdr *)skb->data)->req_id; |
282 | hdr->chksum = checksum; | ||
283 | hdr->device_addr = addr; | ||
284 | 280 | ||
285 | usb_fill_bulk_urb(data_urb, priv->udev, | 281 | usb_fill_bulk_urb(data_urb, priv->udev, |
286 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 282 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
287 | skb->data, skb->len, p54u_tx_cb, skb); | 283 | hdr, skb->len + sizeof(*hdr), FREE_AFTER_TX(skb) ? |
284 | p54u_tx_cb : p54u_tx_dummy_cb, skb); | ||
288 | data_urb->transfer_flags |= URB_ZERO_PACKET; | 285 | data_urb->transfer_flags |= URB_ZERO_PACKET; |
289 | 286 | ||
290 | usb_anchor_urb(data_urb, &priv->submitted); | 287 | usb_anchor_urb(data_urb, &priv->submitted); |
291 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { | 288 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { |
292 | usb_unanchor_urb(data_urb); | 289 | usb_unanchor_urb(data_urb); |
293 | skb_pull(skb, sizeof(*hdr)); | ||
294 | p54_free_skb(dev, skb); | 290 | p54_free_skb(dev, skb); |
295 | } | 291 | } |
296 | usb_free_urb(data_urb); | 292 | usb_free_urb(data_urb); |
@@ -300,11 +296,9 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
300 | { | 296 | { |
301 | struct p54u_priv *priv = dev->priv; | 297 | struct p54u_priv *priv = dev->priv; |
302 | struct urb *int_urb, *data_urb; | 298 | struct urb *int_urb, *data_urb; |
303 | struct net2280_tx_hdr *hdr; | 299 | struct net2280_tx_hdr *hdr = (void *)skb->data - sizeof(*hdr); |
304 | struct net2280_reg_write *reg; | 300 | struct net2280_reg_write *reg; |
305 | int err = 0; | 301 | int err = 0; |
306 | __le32 addr = ((struct p54_hdr *) skb->data)->req_id; | ||
307 | __le16 len = cpu_to_le16(skb->len); | ||
308 | 302 | ||
309 | reg = kmalloc(sizeof(*reg), GFP_ATOMIC); | 303 | reg = kmalloc(sizeof(*reg), GFP_ATOMIC); |
310 | if (!reg) | 304 | if (!reg) |
@@ -327,10 +321,9 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
327 | reg->addr = cpu_to_le32(P54U_DEV_BASE); | 321 | reg->addr = cpu_to_le32(P54U_DEV_BASE); |
328 | reg->val = cpu_to_le32(ISL38XX_DEV_INT_DATA); | 322 | reg->val = cpu_to_le32(ISL38XX_DEV_INT_DATA); |
329 | 323 | ||
330 | hdr = (void *)skb_push(skb, sizeof(*hdr)); | ||
331 | memset(hdr, 0, sizeof(*hdr)); | 324 | memset(hdr, 0, sizeof(*hdr)); |
332 | hdr->len = len; | 325 | hdr->len = cpu_to_le16(skb->len); |
333 | hdr->device_addr = addr; | 326 | hdr->device_addr = ((struct p54_hdr *) skb->data)->req_id; |
334 | 327 | ||
335 | usb_fill_bulk_urb(int_urb, priv->udev, | 328 | usb_fill_bulk_urb(int_urb, priv->udev, |
336 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DEV), reg, sizeof(*reg), | 329 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DEV), reg, sizeof(*reg), |
@@ -341,11 +334,13 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
341 | * free what's inside the transfer_buffer after the callback routine | 334 | * free what's inside the transfer_buffer after the callback routine |
342 | * has completed. | 335 | * has completed. |
343 | */ | 336 | */ |
344 | int_urb->transfer_flags |= URB_FREE_BUFFER; | 337 | int_urb->transfer_flags |= URB_FREE_BUFFER | URB_ZERO_PACKET; |
345 | 338 | ||
346 | usb_fill_bulk_urb(data_urb, priv->udev, | 339 | usb_fill_bulk_urb(data_urb, priv->udev, |
347 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 340 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
348 | skb->data, skb->len, p54u_tx_cb, skb); | 341 | hdr, skb->len + sizeof(*hdr), FREE_AFTER_TX(skb) ? |
342 | p54u_tx_cb : p54u_tx_dummy_cb, skb); | ||
343 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
349 | 344 | ||
350 | usb_anchor_urb(int_urb, &priv->submitted); | 345 | usb_anchor_urb(int_urb, &priv->submitted); |
351 | err = usb_submit_urb(int_urb, GFP_ATOMIC); | 346 | err = usb_submit_urb(int_urb, GFP_ATOMIC); |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 607ce9f61b54..ed93ac41297f 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -1649,9 +1649,7 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1649 | char *end_buf, | 1649 | char *end_buf, |
1650 | struct ndis_80211_bssid_ex *bssid) | 1650 | struct ndis_80211_bssid_ex *bssid) |
1651 | { | 1651 | { |
1652 | #ifdef DEBUG | ||
1653 | struct usbnet *usbdev = netdev_priv(dev); | 1652 | struct usbnet *usbdev = netdev_priv(dev); |
1654 | #endif | ||
1655 | u8 *ie; | 1653 | u8 *ie; |
1656 | char *current_val; | 1654 | char *current_val; |
1657 | int bssid_len, ie_len, i; | 1655 | int bssid_len, ie_len, i; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 746a8f36b931..0709decec9c2 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -154,6 +154,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
154 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 154 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
155 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 155 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
156 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | 156 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; |
157 | struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; | ||
157 | struct ieee80211_rate *rate = | 158 | struct ieee80211_rate *rate = |
158 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); | 159 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); |
159 | const struct rt2x00_rate *hwrate; | 160 | const struct rt2x00_rate *hwrate; |
@@ -313,7 +314,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
313 | * When preamble is enabled we should set the | 314 | * When preamble is enabled we should set the |
314 | * preamble bit for the signal. | 315 | * preamble bit for the signal. |
315 | */ | 316 | */ |
316 | if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 317 | if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
317 | txdesc->signal |= 0x08; | 318 | txdesc->signal |= 0x08; |
318 | } | 319 | } |
319 | } | 320 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c b/drivers/net/wireless/rt2x00/rt2x00rfkill.c index c3f53a92180a..3298cae1e12d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c +++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c | |||
@@ -162,7 +162,7 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) | |||
162 | 162 | ||
163 | void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev) | 163 | void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev) |
164 | { | 164 | { |
165 | if (!test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->flags)) | 165 | if (!test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state)) |
166 | return; | 166 | return; |
167 | 167 | ||
168 | cancel_delayed_work_sync(&rt2x00dev->rfkill_work); | 168 | cancel_delayed_work_sync(&rt2x00dev->rfkill_work); |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 6ad6bac37706..22bc07ef2f37 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -273,6 +273,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
273 | 273 | ||
274 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep), | 274 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep), |
275 | buf, skb->len, rtl8187_tx_cb, skb); | 275 | buf, skb->len, rtl8187_tx_cb, skb); |
276 | urb->transfer_flags |= URB_ZERO_PACKET; | ||
276 | usb_anchor_urb(urb, &priv->anchored); | 277 | usb_anchor_urb(urb, &priv->anchored); |
277 | rc = usb_submit_urb(urb, GFP_ATOMIC); | 278 | rc = usb_submit_urb(urb, GFP_ATOMIC); |
278 | if (rc < 0) { | 279 | if (rc < 0) { |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index b5db57d2fcf5..17527f765b39 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -84,6 +84,7 @@ static struct usb_device_id usb_ids[] = { | |||
84 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, | 84 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, |
85 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, | 85 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, |
86 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, | 86 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, |
87 | { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, | ||
87 | /* "Driverless" devices that need ejecting */ | 88 | /* "Driverless" devices that need ejecting */ |
88 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 89 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
89 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | 90 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, |
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index acca6678cb2b..49c3bfa1afd7 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -70,7 +70,9 @@ static char debug_buffer[255]; | |||
70 | static void lcs_tasklet(unsigned long); | 70 | static void lcs_tasklet(unsigned long); |
71 | static void lcs_start_kernel_thread(struct work_struct *); | 71 | static void lcs_start_kernel_thread(struct work_struct *); |
72 | static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); | 72 | static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); |
73 | #ifdef CONFIG_IP_MULTICAST | ||
73 | static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); | 74 | static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); |
75 | #endif /* CONFIG_IP_MULTICAST */ | ||
74 | static int lcs_recovery(void *ptr); | 76 | static int lcs_recovery(void *ptr); |
75 | 77 | ||
76 | /** | 78 | /** |
@@ -1285,6 +1287,8 @@ out: | |||
1285 | lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); | 1287 | lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); |
1286 | return 0; | 1288 | return 0; |
1287 | } | 1289 | } |
1290 | #endif /* CONFIG_IP_MULTICAST */ | ||
1291 | |||
1288 | /** | 1292 | /** |
1289 | * function called by net device to | 1293 | * function called by net device to |
1290 | * handle multicast address relevant things | 1294 | * handle multicast address relevant things |
@@ -1292,6 +1296,7 @@ out: | |||
1292 | static void | 1296 | static void |
1293 | lcs_set_multicast_list(struct net_device *dev) | 1297 | lcs_set_multicast_list(struct net_device *dev) |
1294 | { | 1298 | { |
1299 | #ifdef CONFIG_IP_MULTICAST | ||
1295 | struct lcs_card *card; | 1300 | struct lcs_card *card; |
1296 | 1301 | ||
1297 | LCS_DBF_TEXT(4, trace, "setmulti"); | 1302 | LCS_DBF_TEXT(4, trace, "setmulti"); |
@@ -1299,9 +1304,8 @@ lcs_set_multicast_list(struct net_device *dev) | |||
1299 | 1304 | ||
1300 | if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) | 1305 | if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) |
1301 | schedule_work(&card->kernel_thread_starter); | 1306 | schedule_work(&card->kernel_thread_starter); |
1302 | } | ||
1303 | |||
1304 | #endif /* CONFIG_IP_MULTICAST */ | 1307 | #endif /* CONFIG_IP_MULTICAST */ |
1308 | } | ||
1305 | 1309 | ||
1306 | static long | 1310 | static long |
1307 | lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb) | 1311 | lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb) |
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 5c34240de746..60e16a551dd6 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
@@ -26,8 +26,6 @@ | |||
26 | 26 | ||
27 | #include <linux/if.h> | 27 | #include <linux/if.h> |
28 | 28 | ||
29 | #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) | ||
30 | |||
31 | /* Structures and constants associated with the DLCI device driver */ | 29 | /* Structures and constants associated with the DLCI device driver */ |
32 | 30 | ||
33 | struct dlci_add | 31 | struct dlci_add |
@@ -127,6 +125,8 @@ struct frad_conf | |||
127 | 125 | ||
128 | #ifdef __KERNEL__ | 126 | #ifdef __KERNEL__ |
129 | 127 | ||
128 | #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) | ||
129 | |||
130 | /* these are the fields of an RFC 1490 header */ | 130 | /* these are the fields of an RFC 1490 header */ |
131 | struct frhdr | 131 | struct frhdr |
132 | { | 132 | { |
@@ -190,12 +190,10 @@ struct frad_local | |||
190 | int buffer; /* current buffer for S508 firmware */ | 190 | int buffer; /* current buffer for S508 firmware */ |
191 | }; | 191 | }; |
192 | 192 | ||
193 | #endif /* __KERNEL__ */ | ||
194 | |||
195 | #endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */ | 193 | #endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */ |
196 | 194 | ||
197 | #ifdef __KERNEL__ | ||
198 | extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *)); | 195 | extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *)); |
199 | #endif | 196 | |
197 | #endif /* __KERNEL__ */ | ||
200 | 198 | ||
201 | #endif | 199 | #endif |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index ba09fe88adda..7d3822243074 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -197,7 +197,9 @@ extern int usbnet_nway_reset(struct net_device *net); | |||
197 | #define devdbg(usbnet, fmt, arg...) \ | 197 | #define devdbg(usbnet, fmt, arg...) \ |
198 | printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | 198 | printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg) |
199 | #else | 199 | #else |
200 | #define devdbg(usbnet, fmt, arg...) do {} while(0) | 200 | #define devdbg(usbnet, fmt, arg...) \ |
201 | ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \ | ||
202 | ## arg); 0; }) | ||
201 | #endif | 203 | #endif |
202 | 204 | ||
203 | #define deverr(usbnet, fmt, arg...) \ | 205 | #define deverr(usbnet, fmt, arg...) \ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b3bd00a9d992..559422fc0943 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -322,7 +322,6 @@ struct ieee80211_tx_rate { | |||
322 | * @control: union for control data | 322 | * @control: union for control data |
323 | * @status: union for status data | 323 | * @status: union for status data |
324 | * @driver_data: array of driver_data pointers | 324 | * @driver_data: array of driver_data pointers |
325 | * @retry_count: number of retries | ||
326 | * @ampdu_ack_len: number of aggregated frames. | 325 | * @ampdu_ack_len: number of aggregated frames. |
327 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 326 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
328 | * @ampdu_ack_map: block ack bit map for the aggregation. | 327 | * @ampdu_ack_map: block ack bit map for the aggregation. |
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index b799fb21519a..2fec3c366e81 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
@@ -79,5 +79,5 @@ static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) | |||
79 | 79 | ||
80 | static inline __be32 sctp_end_cksum(__be32 crc32) | 80 | static inline __be32 sctp_end_cksum(__be32 crc32) |
81 | { | 81 | { |
82 | return ~crc32; | 82 | return (__force __be32)~cpu_to_le32((__force u32)crc32); |
83 | } | 83 | } |
diff --git a/init/Kconfig b/init/Kconfig index 3be35f3a001b..b9d1dd222104 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -633,6 +633,14 @@ config PID_NS | |||
633 | Unless you want to work with an experimental feature | 633 | Unless you want to work with an experimental feature |
634 | say N here. | 634 | say N here. |
635 | 635 | ||
636 | config NET_NS | ||
637 | bool "Network namespace" | ||
638 | default n | ||
639 | depends on NAMESPACES && EXPERIMENTAL && NET | ||
640 | help | ||
641 | Allow user space to create what appear to be multiple instances | ||
642 | of the network stack. | ||
643 | |||
636 | config BLK_DEV_INITRD | 644 | config BLK_DEV_INITRD |
637 | bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" | 645 | bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" |
638 | depends on BROKEN || !FRV | 646 | depends on BROKEN || !FRV |
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 6c1323940263..e9db889d6222 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -62,13 +62,13 @@ struct net_device *vlan_dev_real_dev(const struct net_device *dev) | |||
62 | { | 62 | { |
63 | return vlan_dev_info(dev)->real_dev; | 63 | return vlan_dev_info(dev)->real_dev; |
64 | } | 64 | } |
65 | EXPORT_SYMBOL_GPL(vlan_dev_real_dev); | 65 | EXPORT_SYMBOL(vlan_dev_real_dev); |
66 | 66 | ||
67 | u16 vlan_dev_vlan_id(const struct net_device *dev) | 67 | u16 vlan_dev_vlan_id(const struct net_device *dev) |
68 | { | 68 | { |
69 | return vlan_dev_info(dev)->vlan_id; | 69 | return vlan_dev_info(dev)->vlan_id; |
70 | } | 70 | } |
71 | EXPORT_SYMBOL_GPL(vlan_dev_vlan_id); | 71 | EXPORT_SYMBOL(vlan_dev_vlan_id); |
72 | 72 | ||
73 | static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | 73 | static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, |
74 | unsigned int vlan_tci, struct sk_buff *skb) | 74 | unsigned int vlan_tci, struct sk_buff *skb) |
diff --git a/net/9p/client.c b/net/9p/client.c index 821f1ec0b2c3..1eb580c38fbb 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -618,7 +618,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) | |||
618 | return ERR_PTR(-ENOMEM); | 618 | return ERR_PTR(-ENOMEM); |
619 | 619 | ||
620 | ret = p9_idpool_get(clnt->fidpool); | 620 | ret = p9_idpool_get(clnt->fidpool); |
621 | if (fid->fid < 0) { | 621 | if (ret < 0) { |
622 | ret = -ENOSPC; | 622 | ret = -ENOSPC; |
623 | goto error; | 623 | goto error; |
624 | } | 624 | } |
diff --git a/net/Kconfig b/net/Kconfig index bf2776018f71..cdb8fdef6c4a 100644 --- a/net/Kconfig +++ b/net/Kconfig | |||
@@ -24,14 +24,6 @@ if NET | |||
24 | 24 | ||
25 | menu "Networking options" | 25 | menu "Networking options" |
26 | 26 | ||
27 | config NET_NS | ||
28 | bool "Network namespace support" | ||
29 | default n | ||
30 | depends on EXPERIMENTAL && NAMESPACES | ||
31 | help | ||
32 | Allow user space to create what appear to be multiple instances | ||
33 | of the network stack. | ||
34 | |||
35 | config COMPAT_NET_DEV_OPS | 27 | config COMPAT_NET_DEV_OPS |
36 | def_bool y | 28 | def_bool y |
37 | 29 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 8d675975d85b..5379b0c1190a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1534,7 +1534,19 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) | |||
1534 | skb->mac_len = skb->network_header - skb->mac_header; | 1534 | skb->mac_len = skb->network_header - skb->mac_header; |
1535 | __skb_pull(skb, skb->mac_len); | 1535 | __skb_pull(skb, skb->mac_len); |
1536 | 1536 | ||
1537 | if (WARN_ON(skb->ip_summed != CHECKSUM_PARTIAL)) { | 1537 | if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { |
1538 | struct net_device *dev = skb->dev; | ||
1539 | struct ethtool_drvinfo info = {}; | ||
1540 | |||
1541 | if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo) | ||
1542 | dev->ethtool_ops->get_drvinfo(dev, &info); | ||
1543 | |||
1544 | WARN(1, "%s: caps=(0x%lx, 0x%lx) len=%d data_len=%d " | ||
1545 | "ip_summed=%d", | ||
1546 | info.driver, dev ? dev->features : 0L, | ||
1547 | skb->sk ? skb->sk->sk_route_caps : 0L, | ||
1548 | skb->len, skb->data_len, skb->ip_summed); | ||
1549 | |||
1538 | if (skb_header_cloned(skb) && | 1550 | if (skb_header_cloned(skb) && |
1539 | (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) | 1551 | (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) |
1540 | return ERR_PTR(err); | 1552 | return ERR_PTR(err); |
@@ -2524,6 +2536,7 @@ struct sk_buff *napi_fraginfo_skb(struct napi_struct *napi, | |||
2524 | 2536 | ||
2525 | if (!pskb_may_pull(skb, ETH_HLEN)) { | 2537 | if (!pskb_may_pull(skb, ETH_HLEN)) { |
2526 | napi_reuse_skb(napi, skb); | 2538 | napi_reuse_skb(napi, skb); |
2539 | skb = NULL; | ||
2527 | goto out; | 2540 | goto out; |
2528 | } | 2541 | } |
2529 | 2542 | ||
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 55cffad2f328..55151faaf90c 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -341,8 +341,8 @@ again: | |||
341 | rv = register_pernet_operations(first_device, ops); | 341 | rv = register_pernet_operations(first_device, ops); |
342 | if (rv < 0) | 342 | if (rv < 0) |
343 | ida_remove(&net_generic_ids, *id); | 343 | ida_remove(&net_generic_ids, *id); |
344 | mutex_unlock(&net_mutex); | ||
345 | out: | 344 | out: |
345 | mutex_unlock(&net_mutex); | ||
346 | return rv; | 346 | return rv; |
347 | } | 347 | } |
348 | EXPORT_SYMBOL_GPL(register_pernet_gen_subsys); | 348 | EXPORT_SYMBOL_GPL(register_pernet_gen_subsys); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 65eac7739033..2e5f2ca3bdcd 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -73,17 +73,13 @@ static struct kmem_cache *skbuff_fclone_cache __read_mostly; | |||
73 | static void sock_pipe_buf_release(struct pipe_inode_info *pipe, | 73 | static void sock_pipe_buf_release(struct pipe_inode_info *pipe, |
74 | struct pipe_buffer *buf) | 74 | struct pipe_buffer *buf) |
75 | { | 75 | { |
76 | struct sk_buff *skb = (struct sk_buff *) buf->private; | 76 | put_page(buf->page); |
77 | |||
78 | kfree_skb(skb); | ||
79 | } | 77 | } |
80 | 78 | ||
81 | static void sock_pipe_buf_get(struct pipe_inode_info *pipe, | 79 | static void sock_pipe_buf_get(struct pipe_inode_info *pipe, |
82 | struct pipe_buffer *buf) | 80 | struct pipe_buffer *buf) |
83 | { | 81 | { |
84 | struct sk_buff *skb = (struct sk_buff *) buf->private; | 82 | get_page(buf->page); |
85 | |||
86 | skb_get(skb); | ||
87 | } | 83 | } |
88 | 84 | ||
89 | static int sock_pipe_buf_steal(struct pipe_inode_info *pipe, | 85 | static int sock_pipe_buf_steal(struct pipe_inode_info *pipe, |
@@ -1334,9 +1330,19 @@ fault: | |||
1334 | */ | 1330 | */ |
1335 | static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i) | 1331 | static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i) |
1336 | { | 1332 | { |
1337 | struct sk_buff *skb = (struct sk_buff *) spd->partial[i].private; | 1333 | put_page(spd->pages[i]); |
1334 | } | ||
1338 | 1335 | ||
1339 | kfree_skb(skb); | 1336 | static inline struct page *linear_to_page(struct page *page, unsigned int len, |
1337 | unsigned int offset) | ||
1338 | { | ||
1339 | struct page *p = alloc_pages(GFP_KERNEL, 0); | ||
1340 | |||
1341 | if (!p) | ||
1342 | return NULL; | ||
1343 | memcpy(page_address(p) + offset, page_address(page) + offset, len); | ||
1344 | |||
1345 | return p; | ||
1340 | } | 1346 | } |
1341 | 1347 | ||
1342 | /* | 1348 | /* |
@@ -1344,16 +1350,23 @@ static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i) | |||
1344 | */ | 1350 | */ |
1345 | static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, | 1351 | static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, |
1346 | unsigned int len, unsigned int offset, | 1352 | unsigned int len, unsigned int offset, |
1347 | struct sk_buff *skb) | 1353 | struct sk_buff *skb, int linear) |
1348 | { | 1354 | { |
1349 | if (unlikely(spd->nr_pages == PIPE_BUFFERS)) | 1355 | if (unlikely(spd->nr_pages == PIPE_BUFFERS)) |
1350 | return 1; | 1356 | return 1; |
1351 | 1357 | ||
1358 | if (linear) { | ||
1359 | page = linear_to_page(page, len, offset); | ||
1360 | if (!page) | ||
1361 | return 1; | ||
1362 | } else | ||
1363 | get_page(page); | ||
1364 | |||
1352 | spd->pages[spd->nr_pages] = page; | 1365 | spd->pages[spd->nr_pages] = page; |
1353 | spd->partial[spd->nr_pages].len = len; | 1366 | spd->partial[spd->nr_pages].len = len; |
1354 | spd->partial[spd->nr_pages].offset = offset; | 1367 | spd->partial[spd->nr_pages].offset = offset; |
1355 | spd->partial[spd->nr_pages].private = (unsigned long) skb_get(skb); | ||
1356 | spd->nr_pages++; | 1368 | spd->nr_pages++; |
1369 | |||
1357 | return 0; | 1370 | return 0; |
1358 | } | 1371 | } |
1359 | 1372 | ||
@@ -1369,7 +1382,7 @@ static inline void __segment_seek(struct page **page, unsigned int *poff, | |||
1369 | static inline int __splice_segment(struct page *page, unsigned int poff, | 1382 | static inline int __splice_segment(struct page *page, unsigned int poff, |
1370 | unsigned int plen, unsigned int *off, | 1383 | unsigned int plen, unsigned int *off, |
1371 | unsigned int *len, struct sk_buff *skb, | 1384 | unsigned int *len, struct sk_buff *skb, |
1372 | struct splice_pipe_desc *spd) | 1385 | struct splice_pipe_desc *spd, int linear) |
1373 | { | 1386 | { |
1374 | if (!*len) | 1387 | if (!*len) |
1375 | return 1; | 1388 | return 1; |
@@ -1392,7 +1405,7 @@ static inline int __splice_segment(struct page *page, unsigned int poff, | |||
1392 | /* the linear region may spread across several pages */ | 1405 | /* the linear region may spread across several pages */ |
1393 | flen = min_t(unsigned int, flen, PAGE_SIZE - poff); | 1406 | flen = min_t(unsigned int, flen, PAGE_SIZE - poff); |
1394 | 1407 | ||
1395 | if (spd_fill_page(spd, page, flen, poff, skb)) | 1408 | if (spd_fill_page(spd, page, flen, poff, skb, linear)) |
1396 | return 1; | 1409 | return 1; |
1397 | 1410 | ||
1398 | __segment_seek(&page, &poff, &plen, flen); | 1411 | __segment_seek(&page, &poff, &plen, flen); |
@@ -1419,7 +1432,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1419 | if (__splice_segment(virt_to_page(skb->data), | 1432 | if (__splice_segment(virt_to_page(skb->data), |
1420 | (unsigned long) skb->data & (PAGE_SIZE - 1), | 1433 | (unsigned long) skb->data & (PAGE_SIZE - 1), |
1421 | skb_headlen(skb), | 1434 | skb_headlen(skb), |
1422 | offset, len, skb, spd)) | 1435 | offset, len, skb, spd, 1)) |
1423 | return 1; | 1436 | return 1; |
1424 | 1437 | ||
1425 | /* | 1438 | /* |
@@ -1429,7 +1442,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1429 | const skb_frag_t *f = &skb_shinfo(skb)->frags[seg]; | 1442 | const skb_frag_t *f = &skb_shinfo(skb)->frags[seg]; |
1430 | 1443 | ||
1431 | if (__splice_segment(f->page, f->page_offset, f->size, | 1444 | if (__splice_segment(f->page, f->page_offset, f->size, |
1432 | offset, len, skb, spd)) | 1445 | offset, len, skb, spd, 0)) |
1433 | return 1; | 1446 | return 1; |
1434 | } | 1447 | } |
1435 | 1448 | ||
@@ -1442,7 +1455,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1442 | * the frag list, if such a thing exists. We'd probably need to recurse to | 1455 | * the frag list, if such a thing exists. We'd probably need to recurse to |
1443 | * handle that cleanly. | 1456 | * handle that cleanly. |
1444 | */ | 1457 | */ |
1445 | int skb_splice_bits(struct sk_buff *__skb, unsigned int offset, | 1458 | int skb_splice_bits(struct sk_buff *skb, unsigned int offset, |
1446 | struct pipe_inode_info *pipe, unsigned int tlen, | 1459 | struct pipe_inode_info *pipe, unsigned int tlen, |
1447 | unsigned int flags) | 1460 | unsigned int flags) |
1448 | { | 1461 | { |
@@ -1455,16 +1468,6 @@ int skb_splice_bits(struct sk_buff *__skb, unsigned int offset, | |||
1455 | .ops = &sock_pipe_buf_ops, | 1468 | .ops = &sock_pipe_buf_ops, |
1456 | .spd_release = sock_spd_release, | 1469 | .spd_release = sock_spd_release, |
1457 | }; | 1470 | }; |
1458 | struct sk_buff *skb; | ||
1459 | |||
1460 | /* | ||
1461 | * I'd love to avoid the clone here, but tcp_read_sock() | ||
1462 | * ignores reference counts and unconditonally kills the sk_buff | ||
1463 | * on return from the actor. | ||
1464 | */ | ||
1465 | skb = skb_clone(__skb, GFP_KERNEL); | ||
1466 | if (unlikely(!skb)) | ||
1467 | return -ENOMEM; | ||
1468 | 1471 | ||
1469 | /* | 1472 | /* |
1470 | * __skb_splice_bits() only fails if the output has no room left, | 1473 | * __skb_splice_bits() only fails if the output has no room left, |
@@ -1488,15 +1491,9 @@ int skb_splice_bits(struct sk_buff *__skb, unsigned int offset, | |||
1488 | } | 1491 | } |
1489 | 1492 | ||
1490 | done: | 1493 | done: |
1491 | /* | ||
1492 | * drop our reference to the clone, the pipe consumption will | ||
1493 | * drop the rest. | ||
1494 | */ | ||
1495 | kfree_skb(skb); | ||
1496 | |||
1497 | if (spd.nr_pages) { | 1494 | if (spd.nr_pages) { |
1495 | struct sock *sk = skb->sk; | ||
1498 | int ret; | 1496 | int ret; |
1499 | struct sock *sk = __skb->sk; | ||
1500 | 1497 | ||
1501 | /* | 1498 | /* |
1502 | * Drop the socket lock, otherwise we have reverse | 1499 | * Drop the socket lock, otherwise we have reverse |
@@ -2588,8 +2585,9 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2588 | struct sk_buff *nskb; | 2585 | struct sk_buff *nskb; |
2589 | unsigned int headroom; | 2586 | unsigned int headroom; |
2590 | unsigned int hlen = p->data - skb_mac_header(p); | 2587 | unsigned int hlen = p->data - skb_mac_header(p); |
2588 | unsigned int len = skb->len; | ||
2591 | 2589 | ||
2592 | if (hlen + p->len + skb->len >= 65536) | 2590 | if (hlen + p->len + len >= 65536) |
2593 | return -E2BIG; | 2591 | return -E2BIG; |
2594 | 2592 | ||
2595 | if (skb_shinfo(p)->frag_list) | 2593 | if (skb_shinfo(p)->frag_list) |
@@ -2651,9 +2649,9 @@ merge: | |||
2651 | 2649 | ||
2652 | done: | 2650 | done: |
2653 | NAPI_GRO_CB(p)->count++; | 2651 | NAPI_GRO_CB(p)->count++; |
2654 | p->data_len += skb->len; | 2652 | p->data_len += len; |
2655 | p->truesize += skb->len; | 2653 | p->truesize += len; |
2656 | p->len += skb->len; | 2654 | p->len += len; |
2657 | 2655 | ||
2658 | NAPI_GRO_CB(skb)->same_flow = 1; | 2656 | NAPI_GRO_CB(skb)->same_flow = 1; |
2659 | return 0; | 2657 | return 0; |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 94f74f5b0cbf..c802bc1658a8 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -797,6 +797,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, | |||
797 | unsigned int nlen; | 797 | unsigned int nlen; |
798 | int flush = 1; | 798 | int flush = 1; |
799 | int proto; | 799 | int proto; |
800 | __wsum csum; | ||
800 | 801 | ||
801 | if (unlikely(!pskb_may_pull(skb, sizeof(*iph)))) | 802 | if (unlikely(!pskb_may_pull(skb, sizeof(*iph)))) |
802 | goto out; | 803 | goto out; |
@@ -808,6 +809,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, | |||
808 | 809 | ||
809 | rcu_read_lock(); | 810 | rcu_read_lock(); |
810 | proto = ipv6_gso_pull_exthdrs(skb, iph->nexthdr); | 811 | proto = ipv6_gso_pull_exthdrs(skb, iph->nexthdr); |
812 | iph = ipv6_hdr(skb); | ||
811 | IPV6_GRO_CB(skb)->proto = proto; | 813 | IPV6_GRO_CB(skb)->proto = proto; |
812 | ops = rcu_dereference(inet6_protos[proto]); | 814 | ops = rcu_dereference(inet6_protos[proto]); |
813 | if (!ops || !ops->gro_receive) | 815 | if (!ops || !ops->gro_receive) |
@@ -839,8 +841,13 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, | |||
839 | 841 | ||
840 | NAPI_GRO_CB(skb)->flush |= flush; | 842 | NAPI_GRO_CB(skb)->flush |= flush; |
841 | 843 | ||
844 | csum = skb->csum; | ||
845 | skb_postpull_rcsum(skb, iph, skb_network_header_len(skb)); | ||
846 | |||
842 | pp = ops->gro_receive(head, skb); | 847 | pp = ops->gro_receive(head, skb); |
843 | 848 | ||
849 | skb->csum = csum; | ||
850 | |||
844 | out_unlock: | 851 | out_unlock: |
845 | rcu_read_unlock(); | 852 | rcu_read_unlock(); |
846 | 853 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index f8bd8df5e257..7dcbde3ea7d9 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1285,6 +1285,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1285 | ext_hdrs[SADB_X_EXT_NAT_T_DPORT-1]; | 1285 | ext_hdrs[SADB_X_EXT_NAT_T_DPORT-1]; |
1286 | natt->encap_dport = n_port->sadb_x_nat_t_port_port; | 1286 | natt->encap_dport = n_port->sadb_x_nat_t_port_port; |
1287 | } | 1287 | } |
1288 | memset(&natt->encap_oa, 0, sizeof(natt->encap_oa)); | ||
1288 | } | 1289 | } |
1289 | 1290 | ||
1290 | err = xfrm_init_state(x); | 1291 | err = xfrm_init_state(x); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 5ba721b6a399..2b890af01ba4 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -620,8 +620,8 @@ static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, | |||
620 | if (use_short_slot != bss_conf->use_short_slot) { | 620 | if (use_short_slot != bss_conf->use_short_slot) { |
621 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | 621 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
622 | if (net_ratelimit()) { | 622 | if (net_ratelimit()) { |
623 | printk(KERN_DEBUG "%s: switched to %s slot" | 623 | printk(KERN_DEBUG "%s: switched to %s slot time" |
624 | " (BSSID=%s)\n", | 624 | " (BSSID=%pM)\n", |
625 | sdata->dev->name, | 625 | sdata->dev->name, |
626 | use_short_slot ? "short" : "long", | 626 | use_short_slot ? "short" : "long", |
627 | ifsta->bssid); | 627 | ifsta->bssid); |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index dc2606d0ae77..e49a5b99cf10 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -195,7 +195,6 @@ struct sta_ampdu_mlme { | |||
195 | * @tx_packets: number of RX/TX MSDUs | 195 | * @tx_packets: number of RX/TX MSDUs |
196 | * @tx_bytes: number of bytes transmitted to this STA | 196 | * @tx_bytes: number of bytes transmitted to this STA |
197 | * @tx_fragments: number of transmitted MPDUs | 197 | * @tx_fragments: number of transmitted MPDUs |
198 | * @last_txrate: description of the last used transmit rate | ||
199 | * @tid_seq: per-TID sequence numbers for sending to this STA | 198 | * @tid_seq: per-TID sequence numbers for sending to this STA |
200 | * @ampdu_mlme: A-MPDU state machine state | 199 | * @ampdu_mlme: A-MPDU state machine state |
201 | * @timer_to_tid: identity mapping to ID timers | 200 | * @timer_to_tid: identity mapping to ID timers |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a4af3a124cce..4278e545638f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1307,8 +1307,10 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1307 | if (is_multicast_ether_addr(hdr->addr3)) | 1307 | if (is_multicast_ether_addr(hdr->addr3)) |
1308 | memcpy(hdr->addr1, hdr->addr3, ETH_ALEN); | 1308 | memcpy(hdr->addr1, hdr->addr3, ETH_ALEN); |
1309 | else | 1309 | else |
1310 | if (mesh_nexthop_lookup(skb, osdata)) | 1310 | if (mesh_nexthop_lookup(skb, osdata)) { |
1311 | return 0; | 1311 | dev_put(odev); |
1312 | return 0; | ||
1313 | } | ||
1312 | if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0) | 1314 | if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0) |
1313 | IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh, | 1315 | IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh, |
1314 | fwded_frames); | 1316 | fwded_frames); |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 3dddec6d2f7e..c32a7e8e3a1b 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -831,13 +831,16 @@ ctnetlink_parse_nat_setup(struct nf_conn *ct, | |||
831 | if (!parse_nat_setup) { | 831 | if (!parse_nat_setup) { |
832 | #ifdef CONFIG_MODULES | 832 | #ifdef CONFIG_MODULES |
833 | rcu_read_unlock(); | 833 | rcu_read_unlock(); |
834 | spin_unlock_bh(&nf_conntrack_lock); | ||
834 | nfnl_unlock(); | 835 | nfnl_unlock(); |
835 | if (request_module("nf-nat-ipv4") < 0) { | 836 | if (request_module("nf-nat-ipv4") < 0) { |
836 | nfnl_lock(); | 837 | nfnl_lock(); |
838 | spin_lock_bh(&nf_conntrack_lock); | ||
837 | rcu_read_lock(); | 839 | rcu_read_lock(); |
838 | return -EOPNOTSUPP; | 840 | return -EOPNOTSUPP; |
839 | } | 841 | } |
840 | nfnl_lock(); | 842 | nfnl_lock(); |
843 | spin_lock_bh(&nf_conntrack_lock); | ||
841 | rcu_read_lock(); | 844 | rcu_read_lock(); |
842 | if (nfnetlink_parse_nat_setup_hook) | 845 | if (nfnetlink_parse_nat_setup_hook) |
843 | return -EAGAIN; | 846 | return -EAGAIN; |
diff --git a/net/sctp/input.c b/net/sctp/input.c index bf612d954d41..2e4a8646dbc3 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -249,6 +249,19 @@ int sctp_rcv(struct sk_buff *skb) | |||
249 | */ | 249 | */ |
250 | sctp_bh_lock_sock(sk); | 250 | sctp_bh_lock_sock(sk); |
251 | 251 | ||
252 | if (sk != rcvr->sk) { | ||
253 | /* Our cached sk is different from the rcvr->sk. This is | ||
254 | * because migrate()/accept() may have moved the association | ||
255 | * to a new socket and released all the sockets. So now we | ||
256 | * are holding a lock on the old socket while the user may | ||
257 | * be doing something with the new socket. Switch our veiw | ||
258 | * of the current sk. | ||
259 | */ | ||
260 | sctp_bh_unlock_sock(sk); | ||
261 | sk = rcvr->sk; | ||
262 | sctp_bh_lock_sock(sk); | ||
263 | } | ||
264 | |||
252 | if (sock_owned_by_user(sk)) { | 265 | if (sock_owned_by_user(sk)) { |
253 | SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG); | 266 | SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG); |
254 | sctp_add_backlog(sk, skb); | 267 | sctp_add_backlog(sk, skb); |
diff --git a/net/sctp/output.c b/net/sctp/output.c index c3f417f7ec6e..73639355157e 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -324,14 +324,16 @@ append: | |||
324 | switch (chunk->chunk_hdr->type) { | 324 | switch (chunk->chunk_hdr->type) { |
325 | case SCTP_CID_DATA: | 325 | case SCTP_CID_DATA: |
326 | retval = sctp_packet_append_data(packet, chunk); | 326 | retval = sctp_packet_append_data(packet, chunk); |
327 | if (SCTP_XMIT_OK != retval) | ||
328 | goto finish; | ||
327 | /* Disallow SACK bundling after DATA. */ | 329 | /* Disallow SACK bundling after DATA. */ |
328 | packet->has_sack = 1; | 330 | packet->has_sack = 1; |
329 | /* Disallow AUTH bundling after DATA */ | 331 | /* Disallow AUTH bundling after DATA */ |
330 | packet->has_auth = 1; | 332 | packet->has_auth = 1; |
331 | /* Let it be knows that packet has DATA in it */ | 333 | /* Let it be knows that packet has DATA in it */ |
332 | packet->has_data = 1; | 334 | packet->has_data = 1; |
333 | if (SCTP_XMIT_OK != retval) | 335 | /* timestamp the chunk for rtx purposes */ |
334 | goto finish; | 336 | chunk->sent_at = jiffies; |
335 | break; | 337 | break; |
336 | case SCTP_CID_COOKIE_ECHO: | 338 | case SCTP_CID_COOKIE_ECHO: |
337 | packet->has_cookie_echo = 1; | 339 | packet->has_cookie_echo = 1; |
@@ -470,7 +472,6 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
470 | } else | 472 | } else |
471 | chunk->resent = 1; | 473 | chunk->resent = 1; |
472 | 474 | ||
473 | chunk->sent_at = jiffies; | ||
474 | has_data = 1; | 475 | has_data = 1; |
475 | } | 476 | } |
476 | 477 | ||
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 247ebc95c1e5..bc411c896216 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -929,7 +929,6 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
929 | } | 929 | } |
930 | 930 | ||
931 | /* Finally, transmit new packets. */ | 931 | /* Finally, transmit new packets. */ |
932 | start_timer = 0; | ||
933 | while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { | 932 | while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { |
934 | /* RFC 2960 6.5 Every DATA chunk MUST carry a valid | 933 | /* RFC 2960 6.5 Every DATA chunk MUST carry a valid |
935 | * stream identifier. | 934 | * stream identifier. |
@@ -1028,7 +1027,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
1028 | list_add_tail(&chunk->transmitted_list, | 1027 | list_add_tail(&chunk->transmitted_list, |
1029 | &transport->transmitted); | 1028 | &transport->transmitted); |
1030 | 1029 | ||
1031 | sctp_transport_reset_timers(transport, start_timer-1); | 1030 | sctp_transport_reset_timers(transport, 0); |
1032 | 1031 | ||
1033 | q->empty = 0; | 1032 | q->empty = 0; |
1034 | 1033 | ||
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 4f877535e666..bc494cef2102 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -421,6 +421,31 @@ static u32 freq_max_bandwidth(const struct ieee80211_freq_range *freq_range, | |||
421 | return 0; | 421 | return 0; |
422 | } | 422 | } |
423 | 423 | ||
424 | /** | ||
425 | * freq_in_rule_band - tells us if a frequency is in a frequency band | ||
426 | * @freq_range: frequency rule we want to query | ||
427 | * @freq_khz: frequency we are inquiring about | ||
428 | * | ||
429 | * This lets us know if a specific frequency rule is or is not relevant to | ||
430 | * a specific frequency's band. Bands are device specific and artificial | ||
431 | * definitions (the "2.4 GHz band" and the "5 GHz band"), however it is | ||
432 | * safe for now to assume that a frequency rule should not be part of a | ||
433 | * frequency's band if the start freq or end freq are off by more than 2 GHz. | ||
434 | * This resolution can be lowered and should be considered as we add | ||
435 | * regulatory rule support for other "bands". | ||
436 | **/ | ||
437 | static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range, | ||
438 | u32 freq_khz) | ||
439 | { | ||
440 | #define ONE_GHZ_IN_KHZ 1000000 | ||
441 | if (abs(freq_khz - freq_range->start_freq_khz) <= (2 * ONE_GHZ_IN_KHZ)) | ||
442 | return true; | ||
443 | if (abs(freq_khz - freq_range->end_freq_khz) <= (2 * ONE_GHZ_IN_KHZ)) | ||
444 | return true; | ||
445 | return false; | ||
446 | #undef ONE_GHZ_IN_KHZ | ||
447 | } | ||
448 | |||
424 | /* Converts a country IE to a regulatory domain. A regulatory domain | 449 | /* Converts a country IE to a regulatory domain. A regulatory domain |
425 | * structure has a lot of information which the IE doesn't yet have, | 450 | * structure has a lot of information which the IE doesn't yet have, |
426 | * so for the other values we use upper max values as we will intersect | 451 | * so for the other values we use upper max values as we will intersect |
@@ -538,6 +563,7 @@ static struct ieee80211_regdomain *country_ie_2_rd( | |||
538 | 563 | ||
539 | /* This time around we fill in the rd */ | 564 | /* This time around we fill in the rd */ |
540 | while (country_ie_len >= 3) { | 565 | while (country_ie_len >= 3) { |
566 | int end_channel = 0; | ||
541 | struct ieee80211_country_ie_triplet *triplet = | 567 | struct ieee80211_country_ie_triplet *triplet = |
542 | (struct ieee80211_country_ie_triplet *) country_ie; | 568 | (struct ieee80211_country_ie_triplet *) country_ie; |
543 | struct ieee80211_reg_rule *reg_rule = NULL; | 569 | struct ieee80211_reg_rule *reg_rule = NULL; |
@@ -559,6 +585,23 @@ static struct ieee80211_regdomain *country_ie_2_rd( | |||
559 | 585 | ||
560 | reg_rule->flags = flags; | 586 | reg_rule->flags = flags; |
561 | 587 | ||
588 | /* 2 GHz */ | ||
589 | if (triplet->chans.first_channel <= 14) | ||
590 | end_channel = triplet->chans.first_channel + | ||
591 | triplet->chans.num_channels; | ||
592 | else | ||
593 | /* | ||
594 | * 5 GHz -- For example in country IEs if the first | ||
595 | * channel given is 36 and the number of channels is 4 | ||
596 | * then the individual channel numbers defined for the | ||
597 | * 5 GHz PHY by these parameters are: 36, 40, 44, and 48 | ||
598 | * and not 36, 37, 38, 39. | ||
599 | * | ||
600 | * See: http://tinyurl.com/11d-clarification | ||
601 | */ | ||
602 | end_channel = triplet->chans.first_channel + | ||
603 | (4 * (triplet->chans.num_channels - 1)); | ||
604 | |||
562 | /* The +10 is since the regulatory domain expects | 605 | /* The +10 is since the regulatory domain expects |
563 | * the actual band edge, not the center of freq for | 606 | * the actual band edge, not the center of freq for |
564 | * its start and end freqs, assuming 20 MHz bandwidth on | 607 | * its start and end freqs, assuming 20 MHz bandwidth on |
@@ -568,8 +611,7 @@ static struct ieee80211_regdomain *country_ie_2_rd( | |||
568 | triplet->chans.first_channel) - 10); | 611 | triplet->chans.first_channel) - 10); |
569 | freq_range->end_freq_khz = | 612 | freq_range->end_freq_khz = |
570 | MHZ_TO_KHZ(ieee80211_channel_to_frequency( | 613 | MHZ_TO_KHZ(ieee80211_channel_to_frequency( |
571 | triplet->chans.first_channel + | 614 | end_channel) + 10); |
572 | triplet->chans.num_channels) + 10); | ||
573 | 615 | ||
574 | /* Large arbitrary values, we intersect later */ | 616 | /* Large arbitrary values, we intersect later */ |
575 | /* Increment this if we ever support >= 40 MHz channels | 617 | /* Increment this if we ever support >= 40 MHz channels |
@@ -748,12 +790,23 @@ static u32 map_regdom_flags(u32 rd_flags) | |||
748 | * this value to the maximum allowed bandwidth. | 790 | * this value to the maximum allowed bandwidth. |
749 | * @reg_rule: the regulatory rule which we have for this frequency | 791 | * @reg_rule: the regulatory rule which we have for this frequency |
750 | * | 792 | * |
751 | * Use this function to get the regulatory rule for a specific frequency. | 793 | * Use this function to get the regulatory rule for a specific frequency on |
794 | * a given wireless device. If the device has a specific regulatory domain | ||
795 | * it wants to follow we respect that unless a country IE has been received | ||
796 | * and processed already. | ||
797 | * | ||
798 | * Returns 0 if it was able to find a valid regulatory rule which does | ||
799 | * apply to the given center_freq otherwise it returns non-zero. It will | ||
800 | * also return -ERANGE if we determine the given center_freq does not even have | ||
801 | * a regulatory rule for a frequency range in the center_freq's band. See | ||
802 | * freq_in_rule_band() for our current definition of a band -- this is purely | ||
803 | * subjective and right now its 802.11 specific. | ||
752 | */ | 804 | */ |
753 | static int freq_reg_info(u32 center_freq, u32 *bandwidth, | 805 | static int freq_reg_info(u32 center_freq, u32 *bandwidth, |
754 | const struct ieee80211_reg_rule **reg_rule) | 806 | const struct ieee80211_reg_rule **reg_rule) |
755 | { | 807 | { |
756 | int i; | 808 | int i; |
809 | bool band_rule_found = false; | ||
757 | u32 max_bandwidth = 0; | 810 | u32 max_bandwidth = 0; |
758 | 811 | ||
759 | if (!cfg80211_regdomain) | 812 | if (!cfg80211_regdomain) |
@@ -767,7 +820,15 @@ static int freq_reg_info(u32 center_freq, u32 *bandwidth, | |||
767 | rr = &cfg80211_regdomain->reg_rules[i]; | 820 | rr = &cfg80211_regdomain->reg_rules[i]; |
768 | fr = &rr->freq_range; | 821 | fr = &rr->freq_range; |
769 | pr = &rr->power_rule; | 822 | pr = &rr->power_rule; |
823 | |||
824 | /* We only need to know if one frequency rule was | ||
825 | * was in center_freq's band, that's enough, so lets | ||
826 | * not overwrite it once found */ | ||
827 | if (!band_rule_found) | ||
828 | band_rule_found = freq_in_rule_band(fr, center_freq); | ||
829 | |||
770 | max_bandwidth = freq_max_bandwidth(fr, center_freq); | 830 | max_bandwidth = freq_max_bandwidth(fr, center_freq); |
831 | |||
771 | if (max_bandwidth && *bandwidth <= max_bandwidth) { | 832 | if (max_bandwidth && *bandwidth <= max_bandwidth) { |
772 | *reg_rule = rr; | 833 | *reg_rule = rr; |
773 | *bandwidth = max_bandwidth; | 834 | *bandwidth = max_bandwidth; |
@@ -775,23 +836,64 @@ static int freq_reg_info(u32 center_freq, u32 *bandwidth, | |||
775 | } | 836 | } |
776 | } | 837 | } |
777 | 838 | ||
839 | if (!band_rule_found) | ||
840 | return -ERANGE; | ||
841 | |||
778 | return !max_bandwidth; | 842 | return !max_bandwidth; |
779 | } | 843 | } |
780 | 844 | ||
781 | static void handle_channel(struct ieee80211_channel *chan) | 845 | static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, |
846 | unsigned int chan_idx) | ||
782 | { | 847 | { |
783 | int r; | 848 | int r; |
784 | u32 flags = chan->orig_flags; | 849 | u32 flags; |
785 | u32 max_bandwidth = 0; | 850 | u32 max_bandwidth = 0; |
786 | const struct ieee80211_reg_rule *reg_rule = NULL; | 851 | const struct ieee80211_reg_rule *reg_rule = NULL; |
787 | const struct ieee80211_power_rule *power_rule = NULL; | 852 | const struct ieee80211_power_rule *power_rule = NULL; |
853 | struct ieee80211_supported_band *sband; | ||
854 | struct ieee80211_channel *chan; | ||
855 | |||
856 | sband = wiphy->bands[band]; | ||
857 | BUG_ON(chan_idx >= sband->n_channels); | ||
858 | chan = &sband->channels[chan_idx]; | ||
859 | |||
860 | flags = chan->orig_flags; | ||
788 | 861 | ||
789 | r = freq_reg_info(MHZ_TO_KHZ(chan->center_freq), | 862 | r = freq_reg_info(MHZ_TO_KHZ(chan->center_freq), |
790 | &max_bandwidth, ®_rule); | 863 | &max_bandwidth, ®_rule); |
791 | 864 | ||
792 | if (r) { | 865 | if (r) { |
793 | flags |= IEEE80211_CHAN_DISABLED; | 866 | /* This means no regulatory rule was found in the country IE |
794 | chan->flags = flags; | 867 | * with a frequency range on the center_freq's band, since |
868 | * IEEE-802.11 allows for a country IE to have a subset of the | ||
869 | * regulatory information provided in a country we ignore | ||
870 | * disabling the channel unless at least one reg rule was | ||
871 | * found on the center_freq's band. For details see this | ||
872 | * clarification: | ||
873 | * | ||
874 | * http://tinyurl.com/11d-clarification | ||
875 | */ | ||
876 | if (r == -ERANGE && | ||
877 | last_request->initiator == REGDOM_SET_BY_COUNTRY_IE) { | ||
878 | #ifdef CONFIG_CFG80211_REG_DEBUG | ||
879 | printk(KERN_DEBUG "cfg80211: Leaving channel %d MHz " | ||
880 | "intact on %s - no rule found in band on " | ||
881 | "Country IE\n", | ||
882 | chan->center_freq, wiphy_name(wiphy)); | ||
883 | #endif | ||
884 | } else { | ||
885 | /* In this case we know the country IE has at least one reg rule | ||
886 | * for the band so we respect its band definitions */ | ||
887 | #ifdef CONFIG_CFG80211_REG_DEBUG | ||
888 | if (last_request->initiator == REGDOM_SET_BY_COUNTRY_IE) | ||
889 | printk(KERN_DEBUG "cfg80211: Disabling " | ||
890 | "channel %d MHz on %s due to " | ||
891 | "Country IE\n", | ||
892 | chan->center_freq, wiphy_name(wiphy)); | ||
893 | #endif | ||
894 | flags |= IEEE80211_CHAN_DISABLED; | ||
895 | chan->flags = flags; | ||
896 | } | ||
795 | return; | 897 | return; |
796 | } | 898 | } |
797 | 899 | ||
@@ -808,12 +910,16 @@ static void handle_channel(struct ieee80211_channel *chan) | |||
808 | chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp); | 910 | chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp); |
809 | } | 911 | } |
810 | 912 | ||
811 | static void handle_band(struct ieee80211_supported_band *sband) | 913 | static void handle_band(struct wiphy *wiphy, enum ieee80211_band band) |
812 | { | 914 | { |
813 | int i; | 915 | unsigned int i; |
916 | struct ieee80211_supported_band *sband; | ||
917 | |||
918 | BUG_ON(!wiphy->bands[band]); | ||
919 | sband = wiphy->bands[band]; | ||
814 | 920 | ||
815 | for (i = 0; i < sband->n_channels; i++) | 921 | for (i = 0; i < sband->n_channels; i++) |
816 | handle_channel(&sband->channels[i]); | 922 | handle_channel(wiphy, band, i); |
817 | } | 923 | } |
818 | 924 | ||
819 | static bool ignore_reg_update(struct wiphy *wiphy, enum reg_set_by setby) | 925 | static bool ignore_reg_update(struct wiphy *wiphy, enum reg_set_by setby) |
@@ -840,7 +946,7 @@ void wiphy_update_regulatory(struct wiphy *wiphy, enum reg_set_by setby) | |||
840 | enum ieee80211_band band; | 946 | enum ieee80211_band band; |
841 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 947 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
842 | if (wiphy->bands[band]) | 948 | if (wiphy->bands[band]) |
843 | handle_band(wiphy->bands[band]); | 949 | handle_band(wiphy, band); |
844 | if (wiphy->reg_notifier) | 950 | if (wiphy->reg_notifier) |
845 | wiphy->reg_notifier(wiphy, setby); | 951 | wiphy->reg_notifier(wiphy, setby); |
846 | } | 952 | } |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 7877e7975dae..b95a2d64eb59 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1914,17 +1914,10 @@ static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | |||
1914 | } | 1914 | } |
1915 | #endif | 1915 | #endif |
1916 | 1916 | ||
1917 | /* For the xfrm_usersa_info cases we have to work around some 32-bit vs. | ||
1918 | * 64-bit compatability issues. On 32-bit the structure is 220 bytes, but | ||
1919 | * for 64-bit it gets padded out to 224 bytes. Those bytes are just | ||
1920 | * padding and don't have any content we care about. Therefore as long | ||
1921 | * as we have enough bytes for the content we can make both cases work. | ||
1922 | */ | ||
1923 | |||
1924 | #define XMSGSIZE(type) sizeof(struct type) | 1917 | #define XMSGSIZE(type) sizeof(struct type) |
1925 | 1918 | ||
1926 | static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { | 1919 | static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { |
1927 | [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = 220, /* see above */ | 1920 | [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info), |
1928 | [XFRM_MSG_DELSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), | 1921 | [XFRM_MSG_DELSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), |
1929 | [XFRM_MSG_GETSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), | 1922 | [XFRM_MSG_GETSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), |
1930 | [XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), | 1923 | [XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), |
@@ -1934,7 +1927,7 @@ static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { | |||
1934 | [XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire), | 1927 | [XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire), |
1935 | [XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire), | 1928 | [XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire), |
1936 | [XFRM_MSG_UPDPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), | 1929 | [XFRM_MSG_UPDPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), |
1937 | [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = 220, /* see above */ | 1930 | [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info), |
1938 | [XFRM_MSG_POLEXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire), | 1931 | [XFRM_MSG_POLEXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire), |
1939 | [XFRM_MSG_FLUSHSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush), | 1932 | [XFRM_MSG_FLUSHSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush), |
1940 | [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0, | 1933 | [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0, |