diff options
Diffstat (limited to 'drivers/net')
86 files changed, 1210 insertions, 702 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e19ca4bb7510..b2f71f79baaf 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -975,7 +975,7 @@ config ENC28J60_WRITEVERIFY | |||
975 | 975 | ||
976 | config ETHOC | 976 | config ETHOC |
977 | tristate "OpenCores 10/100 Mbps Ethernet MAC support" | 977 | tristate "OpenCores 10/100 Mbps Ethernet MAC support" |
978 | depends on NET_ETHERNET && HAS_IOMEM | 978 | depends on NET_ETHERNET && HAS_IOMEM && HAS_DMA |
979 | select MII | 979 | select MII |
980 | select PHYLIB | 980 | select PHYLIB |
981 | select CRC32 | 981 | select CRC32 |
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index 2be49c817995..b25467ac895c 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
@@ -628,15 +628,6 @@ static int ep93xx_open(struct net_device *dev) | |||
628 | if (ep93xx_alloc_buffers(ep)) | 628 | if (ep93xx_alloc_buffers(ep)) |
629 | return -ENOMEM; | 629 | return -ENOMEM; |
630 | 630 | ||
631 | if (is_zero_ether_addr(dev->dev_addr)) { | ||
632 | random_ether_addr(dev->dev_addr); | ||
633 | printk(KERN_INFO "%s: generated random MAC address " | ||
634 | "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x.\n", dev->name, | ||
635 | dev->dev_addr[0], dev->dev_addr[1], | ||
636 | dev->dev_addr[2], dev->dev_addr[3], | ||
637 | dev->dev_addr[4], dev->dev_addr[5]); | ||
638 | } | ||
639 | |||
640 | napi_enable(&ep->napi); | 631 | napi_enable(&ep->napi); |
641 | 632 | ||
642 | if (ep93xx_start_hw(dev)) { | 633 | if (ep93xx_start_hw(dev)) { |
@@ -877,6 +868,9 @@ static int ep93xx_eth_probe(struct platform_device *pdev) | |||
877 | ep->mii.mdio_write = ep93xx_mdio_write; | 868 | ep->mii.mdio_write = ep93xx_mdio_write; |
878 | ep->mdc_divisor = 40; /* Max HCLK 100 MHz, min MDIO clk 2.5 MHz. */ | 869 | ep->mdc_divisor = 40; /* Max HCLK 100 MHz, min MDIO clk 2.5 MHz. */ |
879 | 870 | ||
871 | if (is_zero_ether_addr(dev->dev_addr)) | ||
872 | random_ether_addr(dev->dev_addr); | ||
873 | |||
880 | err = register_netdev(dev); | 874 | err = register_netdev(dev); |
881 | if (err) { | 875 | if (err) { |
882 | dev_err(&pdev->dev, "Failed to register netdev\n"); | 876 | dev_err(&pdev->dev, "Failed to register netdev\n"); |
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index ce6f1ac25df8..3f4b4300f533 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -1088,7 +1088,14 @@ static struct net_device * au1000_probe(int port_num) | |||
1088 | return NULL; | 1088 | return NULL; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | if ((err = register_netdev(dev)) != 0) { | 1091 | dev->base_addr = base; |
1092 | dev->irq = irq; | ||
1093 | dev->netdev_ops = &au1000_netdev_ops; | ||
1094 | SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops); | ||
1095 | dev->watchdog_timeo = ETH_TX_TIMEOUT; | ||
1096 | |||
1097 | err = register_netdev(dev); | ||
1098 | if (err != 0) { | ||
1092 | printk(KERN_ERR "%s: Cannot register net device, error %d\n", | 1099 | printk(KERN_ERR "%s: Cannot register net device, error %d\n", |
1093 | DRV_NAME, err); | 1100 | DRV_NAME, err); |
1094 | free_netdev(dev); | 1101 | free_netdev(dev); |
@@ -1209,12 +1216,6 @@ static struct net_device * au1000_probe(int port_num) | |||
1209 | aup->tx_db_inuse[i] = pDB; | 1216 | aup->tx_db_inuse[i] = pDB; |
1210 | } | 1217 | } |
1211 | 1218 | ||
1212 | dev->base_addr = base; | ||
1213 | dev->irq = irq; | ||
1214 | dev->netdev_ops = &au1000_netdev_ops; | ||
1215 | SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops); | ||
1216 | dev->watchdog_timeo = ETH_TX_TIMEOUT; | ||
1217 | |||
1218 | /* | 1219 | /* |
1219 | * The boot code uses the ethernet controller, so reset it to start | 1220 | * The boot code uses the ethernet controller, so reset it to start |
1220 | * fresh. au1000_init() expects that the device is in reset state. | 1221 | * fresh. au1000_init() expects that the device is in reset state. |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index e046943ef29d..2a9132343b66 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -912,9 +912,6 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id) | |||
912 | bp->istat = istat; | 912 | bp->istat = istat; |
913 | __b44_disable_ints(bp); | 913 | __b44_disable_ints(bp); |
914 | __napi_schedule(&bp->napi); | 914 | __napi_schedule(&bp->napi); |
915 | } else { | ||
916 | printk(KERN_ERR PFX "%s: Error, poll already scheduled\n", | ||
917 | dev->name); | ||
918 | } | 915 | } |
919 | 916 | ||
920 | irq_ack: | 917 | irq_ack: |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index a80da0e14a52..3b79a225628a 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -259,6 +259,8 @@ struct be_adapter { | |||
259 | u32 port_num; | 259 | u32 port_num; |
260 | bool promiscuous; | 260 | bool promiscuous; |
261 | u32 cap; | 261 | u32 cap; |
262 | u32 rx_fc; /* Rx flow control */ | ||
263 | u32 tx_fc; /* Tx flow control */ | ||
262 | }; | 264 | }; |
263 | 265 | ||
264 | extern const struct ethtool_ops be_ethtool_ops; | 266 | extern const struct ethtool_ops be_ethtool_ops; |
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 49953787e41c..e5f9676cf1bc 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
@@ -68,7 +68,7 @@ enum { | |||
68 | #define CQE_STATUS_COMPL_MASK 0xFFFF | 68 | #define CQE_STATUS_COMPL_MASK 0xFFFF |
69 | #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ | 69 | #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ |
70 | #define CQE_STATUS_EXTD_MASK 0xFFFF | 70 | #define CQE_STATUS_EXTD_MASK 0xFFFF |
71 | #define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */ | 71 | #define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */ |
72 | 72 | ||
73 | struct be_mcc_compl { | 73 | struct be_mcc_compl { |
74 | u32 status; /* dword 0 */ | 74 | u32 status; /* dword 0 */ |
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index cda5bf2fc50a..f0fd95b43c07 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -323,10 +323,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) | |||
323 | 323 | ||
324 | if (ecmd->autoneg != 0) | 324 | if (ecmd->autoneg != 0) |
325 | return -EINVAL; | 325 | return -EINVAL; |
326 | adapter->tx_fc = ecmd->tx_pause; | ||
327 | adapter->rx_fc = ecmd->rx_pause; | ||
326 | 328 | ||
327 | status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, | 329 | status = be_cmd_set_flow_control(adapter, |
328 | ecmd->rx_pause); | 330 | adapter->tx_fc, adapter->rx_fc); |
329 | if (!status) | 331 | if (status) |
330 | dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); | 332 | dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); |
331 | 333 | ||
332 | return status; | 334 | return status; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 1f941f027718..876b357101fa 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1610,11 +1610,21 @@ static int be_open(struct net_device *netdev) | |||
1610 | 1610 | ||
1611 | status = be_cmd_link_status_query(adapter, &link_up); | 1611 | status = be_cmd_link_status_query(adapter, &link_up); |
1612 | if (status) | 1612 | if (status) |
1613 | return status; | 1613 | goto ret_sts; |
1614 | be_link_status_update(adapter, link_up); | 1614 | be_link_status_update(adapter, link_up); |
1615 | 1615 | ||
1616 | status = be_vid_config(adapter); | ||
1617 | if (status) | ||
1618 | goto ret_sts; | ||
1619 | |||
1620 | status = be_cmd_set_flow_control(adapter, | ||
1621 | adapter->tx_fc, adapter->rx_fc); | ||
1622 | if (status) | ||
1623 | goto ret_sts; | ||
1624 | |||
1616 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); | 1625 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); |
1617 | return 0; | 1626 | ret_sts: |
1627 | return status; | ||
1618 | } | 1628 | } |
1619 | 1629 | ||
1620 | static int be_setup(struct be_adapter *adapter) | 1630 | static int be_setup(struct be_adapter *adapter) |
@@ -1648,17 +1658,8 @@ static int be_setup(struct be_adapter *adapter) | |||
1648 | if (status != 0) | 1658 | if (status != 0) |
1649 | goto rx_qs_destroy; | 1659 | goto rx_qs_destroy; |
1650 | 1660 | ||
1651 | status = be_vid_config(adapter); | ||
1652 | if (status != 0) | ||
1653 | goto mccqs_destroy; | ||
1654 | |||
1655 | status = be_cmd_set_flow_control(adapter, true, true); | ||
1656 | if (status != 0) | ||
1657 | goto mccqs_destroy; | ||
1658 | return 0; | 1661 | return 0; |
1659 | 1662 | ||
1660 | mccqs_destroy: | ||
1661 | be_mcc_queues_destroy(adapter); | ||
1662 | rx_qs_destroy: | 1663 | rx_qs_destroy: |
1663 | be_rx_queues_destroy(adapter); | 1664 | be_rx_queues_destroy(adapter); |
1664 | tx_qs_destroy: | 1665 | tx_qs_destroy: |
@@ -1909,6 +1910,10 @@ static void be_netdev_init(struct net_device *netdev) | |||
1909 | 1910 | ||
1910 | adapter->rx_csum = true; | 1911 | adapter->rx_csum = true; |
1911 | 1912 | ||
1913 | /* Default settings for Rx and Tx flow control */ | ||
1914 | adapter->rx_fc = true; | ||
1915 | adapter->tx_fc = true; | ||
1916 | |||
1912 | netif_set_gso_max_size(netdev, 65535); | 1917 | netif_set_gso_max_size(netdev, 65535); |
1913 | 1918 | ||
1914 | BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); | 1919 | BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); |
@@ -2171,6 +2176,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2171 | be_close(netdev); | 2176 | be_close(netdev); |
2172 | rtnl_unlock(); | 2177 | rtnl_unlock(); |
2173 | } | 2178 | } |
2179 | be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc); | ||
2174 | be_clear(adapter); | 2180 | be_clear(adapter); |
2175 | 2181 | ||
2176 | pci_save_state(pdev); | 2182 | pci_save_state(pdev); |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index df32c109b7ac..772f6d2489ce 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -35,66 +35,16 @@ config CAN_CALC_BITTIMING | |||
35 | arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw". | 35 | arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw". |
36 | If unsure, say Y. | 36 | If unsure, say Y. |
37 | 37 | ||
38 | config CAN_SJA1000 | ||
39 | depends on CAN_DEV && HAS_IOMEM | ||
40 | tristate "Philips SJA1000" | ||
41 | ---help--- | ||
42 | Driver for the SJA1000 CAN controllers from Philips or NXP | ||
43 | |||
44 | config CAN_SJA1000_ISA | ||
45 | depends on CAN_SJA1000 && ISA | ||
46 | tristate "ISA Bus based legacy SJA1000 driver" | ||
47 | ---help--- | ||
48 | This driver adds legacy support for SJA1000 chips connected to | ||
49 | the ISA bus using I/O port, memory mapped or indirect access. | ||
50 | |||
51 | config CAN_SJA1000_PLATFORM | ||
52 | depends on CAN_SJA1000 | ||
53 | tristate "Generic Platform Bus based SJA1000 driver" | ||
54 | ---help--- | ||
55 | This driver adds support for the SJA1000 chips connected to | ||
56 | the "platform bus" (Linux abstraction for directly to the | ||
57 | processor attached devices). Which can be found on various | ||
58 | boards from Phytec (http://www.phytec.de) like the PCM027, | ||
59 | PCM038. | ||
60 | |||
61 | config CAN_SJA1000_OF_PLATFORM | ||
62 | depends on CAN_SJA1000 && PPC_OF | ||
63 | tristate "Generic OF Platform Bus based SJA1000 driver" | ||
64 | ---help--- | ||
65 | This driver adds support for the SJA1000 chips connected to | ||
66 | the OpenFirmware "platform bus" found on embedded systems with | ||
67 | OpenFirmware bindings, e.g. if you have a PowerPC based system | ||
68 | you may want to enable this option. | ||
69 | |||
70 | config CAN_EMS_PCI | ||
71 | tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card" | ||
72 | depends on PCI && CAN_SJA1000 | ||
73 | ---help--- | ||
74 | This driver is for the one, two or four channel CPC-PCI, | ||
75 | CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche | ||
76 | (http://www.ems-wuensche.de). | ||
77 | |||
78 | config CAN_EMS_USB | ||
79 | tristate "EMS CPC-USB/ARM7 CAN/USB interface" | ||
80 | depends on USB && CAN_DEV | ||
81 | ---help--- | ||
82 | This driver is for the one channel CPC-USB/ARM7 CAN/USB interface | ||
83 | from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). | ||
84 | |||
85 | config CAN_KVASER_PCI | ||
86 | tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards" | ||
87 | depends on PCI && CAN_SJA1000 | ||
88 | ---help--- | ||
89 | This driver is for the the PCIcanx and PCIcan cards (1, 2 or | ||
90 | 4 channel) from Kvaser (http://www.kvaser.com). | ||
91 | |||
92 | config CAN_AT91 | 38 | config CAN_AT91 |
93 | tristate "Atmel AT91 onchip CAN controller" | 39 | tristate "Atmel AT91 onchip CAN controller" |
94 | depends on CAN && CAN_DEV && ARCH_AT91SAM9263 | 40 | depends on CAN_DEV && ARCH_AT91SAM9263 |
95 | ---help--- | 41 | ---help--- |
96 | This is a driver for the SoC CAN controller in Atmel's AT91SAM9263. | 42 | This is a driver for the SoC CAN controller in Atmel's AT91SAM9263. |
97 | 43 | ||
44 | source "drivers/net/can/sja1000/Kconfig" | ||
45 | |||
46 | source "drivers/net/can/usb/Kconfig" | ||
47 | |||
98 | config CAN_DEBUG_DEVICES | 48 | config CAN_DEBUG_DEVICES |
99 | bool "CAN devices debugging messages" | 49 | bool "CAN devices debugging messages" |
100 | depends on CAN | 50 | depends on CAN |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index f0b9a1e1db46..2868fe842a41 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -589,6 +589,22 @@ static int can_changelink(struct net_device *dev, | |||
589 | return 0; | 589 | return 0; |
590 | } | 590 | } |
591 | 591 | ||
592 | static size_t can_get_size(const struct net_device *dev) | ||
593 | { | ||
594 | struct can_priv *priv = netdev_priv(dev); | ||
595 | size_t size; | ||
596 | |||
597 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | ||
598 | size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */ | ||
599 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | ||
600 | size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ | ||
601 | size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ | ||
602 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ | ||
603 | size += sizeof(struct can_bittiming_const); | ||
604 | |||
605 | return size; | ||
606 | } | ||
607 | |||
592 | static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) | 608 | static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) |
593 | { | 609 | { |
594 | struct can_priv *priv = netdev_priv(dev); | 610 | struct can_priv *priv = netdev_priv(dev); |
@@ -613,6 +629,11 @@ nla_put_failure: | |||
613 | return -EMSGSIZE; | 629 | return -EMSGSIZE; |
614 | } | 630 | } |
615 | 631 | ||
632 | static size_t can_get_xstats_size(const struct net_device *dev) | ||
633 | { | ||
634 | return sizeof(struct can_device_stats); | ||
635 | } | ||
636 | |||
616 | static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev) | 637 | static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev) |
617 | { | 638 | { |
618 | struct can_priv *priv = netdev_priv(dev); | 639 | struct can_priv *priv = netdev_priv(dev); |
@@ -639,7 +660,9 @@ static struct rtnl_link_ops can_link_ops __read_mostly = { | |||
639 | .setup = can_setup, | 660 | .setup = can_setup, |
640 | .newlink = can_newlink, | 661 | .newlink = can_newlink, |
641 | .changelink = can_changelink, | 662 | .changelink = can_changelink, |
663 | .get_size = can_get_size, | ||
642 | .fill_info = can_fill_info, | 664 | .fill_info = can_fill_info, |
665 | .get_xstats_size = can_get_xstats_size, | ||
643 | .fill_xstats = can_fill_xstats, | 666 | .fill_xstats = can_fill_xstats, |
644 | }; | 667 | }; |
645 | 668 | ||
diff --git a/drivers/net/can/sja1000/Kconfig b/drivers/net/can/sja1000/Kconfig new file mode 100644 index 000000000000..4c674927f247 --- /dev/null +++ b/drivers/net/can/sja1000/Kconfig | |||
@@ -0,0 +1,47 @@ | |||
1 | menuconfig CAN_SJA1000 | ||
2 | tristate "Philips/NXP SJA1000 devices" | ||
3 | depends on CAN_DEV && HAS_IOMEM | ||
4 | |||
5 | if CAN_SJA1000 | ||
6 | |||
7 | config CAN_SJA1000_ISA | ||
8 | tristate "ISA Bus based legacy SJA1000 driver" | ||
9 | depends on ISA | ||
10 | ---help--- | ||
11 | This driver adds legacy support for SJA1000 chips connected to | ||
12 | the ISA bus using I/O port, memory mapped or indirect access. | ||
13 | |||
14 | config CAN_SJA1000_PLATFORM | ||
15 | tristate "Generic Platform Bus based SJA1000 driver" | ||
16 | ---help--- | ||
17 | This driver adds support for the SJA1000 chips connected to | ||
18 | the "platform bus" (Linux abstraction for directly to the | ||
19 | processor attached devices). Which can be found on various | ||
20 | boards from Phytec (http://www.phytec.de) like the PCM027, | ||
21 | PCM038. | ||
22 | |||
23 | config CAN_SJA1000_OF_PLATFORM | ||
24 | tristate "Generic OF Platform Bus based SJA1000 driver" | ||
25 | depends on PPC_OF | ||
26 | ---help--- | ||
27 | This driver adds support for the SJA1000 chips connected to | ||
28 | the OpenFirmware "platform bus" found on embedded systems with | ||
29 | OpenFirmware bindings, e.g. if you have a PowerPC based system | ||
30 | you may want to enable this option. | ||
31 | |||
32 | config CAN_EMS_PCI | ||
33 | tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card" | ||
34 | depends on PCI | ||
35 | ---help--- | ||
36 | This driver is for the one, two or four channel CPC-PCI, | ||
37 | CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche | ||
38 | (http://www.ems-wuensche.de). | ||
39 | |||
40 | config CAN_KVASER_PCI | ||
41 | tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards" | ||
42 | depends on PCI | ||
43 | ---help--- | ||
44 | This driver is for the the PCIcanx and PCIcan cards (1, 2 or | ||
45 | 4 channel) from Kvaser (http://www.kvaser.com). | ||
46 | |||
47 | endif | ||
diff --git a/drivers/net/can/usb/Kconfig b/drivers/net/can/usb/Kconfig new file mode 100644 index 000000000000..bbc78e0b8a15 --- /dev/null +++ b/drivers/net/can/usb/Kconfig | |||
@@ -0,0 +1,10 @@ | |||
1 | menu "CAN USB interfaces" | ||
2 | depends on USB && CAN_DEV | ||
3 | |||
4 | config CAN_EMS_USB | ||
5 | tristate "EMS CPC-USB/ARM7 CAN/USB interface" | ||
6 | ---help--- | ||
7 | This driver is for the one channel CPC-USB/ARM7 CAN/USB interface | ||
8 | from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). | ||
9 | |||
10 | endmenu | ||
diff --git a/drivers/net/can/usb/Makefile b/drivers/net/can/usb/Makefile index c3f75ba701b1..0afd51d4c7a5 100644 --- a/drivers/net/can/usb/Makefile +++ b/drivers/net/can/usb/Makefile | |||
@@ -3,3 +3,5 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o | 5 | obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o |
6 | |||
7 | ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG | ||
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index 9012e0abc626..abdbd9c2b788 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -319,7 +319,7 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) | |||
319 | 319 | ||
320 | cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame)); | 320 | cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame)); |
321 | 321 | ||
322 | cf->can_id = msg->msg.can_msg.id; | 322 | cf->can_id = le32_to_cpu(msg->msg.can_msg.id); |
323 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); | 323 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); |
324 | 324 | ||
325 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME | 325 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME |
@@ -813,6 +813,9 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne | |||
813 | msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; | 813 | msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; |
814 | } | 814 | } |
815 | 815 | ||
816 | /* Respect byte order */ | ||
817 | msg->msg.can_msg.id = cpu_to_le32(msg->msg.can_msg.id); | ||
818 | |||
816 | for (i = 0; i < MAX_TX_URBS; i++) { | 819 | for (i = 0; i < MAX_TX_URBS; i++) { |
817 | if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { | 820 | if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { |
818 | context = &dev->tx_contexts[i]; | 821 | context = &dev->tx_contexts[i]; |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 05916aafa4f1..f857afe8e488 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -4342,11 +4342,11 @@ static int cas_open(struct net_device *dev) | |||
4342 | cas_unlock_all_restore(cp, flags); | 4342 | cas_unlock_all_restore(cp, flags); |
4343 | } | 4343 | } |
4344 | 4344 | ||
4345 | err = -ENOMEM; | ||
4345 | if (cas_tx_tiny_alloc(cp) < 0) | 4346 | if (cas_tx_tiny_alloc(cp) < 0) |
4346 | return -ENOMEM; | 4347 | goto err_unlock; |
4347 | 4348 | ||
4348 | /* alloc rx descriptors */ | 4349 | /* alloc rx descriptors */ |
4349 | err = -ENOMEM; | ||
4350 | if (cas_alloc_rxds(cp) < 0) | 4350 | if (cas_alloc_rxds(cp) < 0) |
4351 | goto err_tx_tiny; | 4351 | goto err_tx_tiny; |
4352 | 4352 | ||
@@ -4386,6 +4386,7 @@ err_spare: | |||
4386 | cas_free_rxds(cp); | 4386 | cas_free_rxds(cp); |
4387 | err_tx_tiny: | 4387 | err_tx_tiny: |
4388 | cas_tx_tiny_free(cp); | 4388 | cas_tx_tiny_free(cp); |
4389 | err_unlock: | ||
4389 | mutex_unlock(&cp->pm_mutex); | 4390 | mutex_unlock(&cp->pm_mutex); |
4390 | return err; | 4391 | return err; |
4391 | } | 4392 | } |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index f86612857a73..6366061712f4 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -879,7 +879,7 @@ recycle: | |||
879 | pci_dma_sync_single_for_cpu(adap->pdev, dma_addr, len, | 879 | pci_dma_sync_single_for_cpu(adap->pdev, dma_addr, len, |
880 | PCI_DMA_FROMDEVICE); | 880 | PCI_DMA_FROMDEVICE); |
881 | (*sd->pg_chunk.p_cnt)--; | 881 | (*sd->pg_chunk.p_cnt)--; |
882 | if (!*sd->pg_chunk.p_cnt) | 882 | if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page) |
883 | pci_unmap_page(adap->pdev, | 883 | pci_unmap_page(adap->pdev, |
884 | sd->pg_chunk.mapping, | 884 | sd->pg_chunk.mapping, |
885 | fl->alloc_size, | 885 | fl->alloc_size, |
@@ -2088,7 +2088,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs, | |||
2088 | PCI_DMA_FROMDEVICE); | 2088 | PCI_DMA_FROMDEVICE); |
2089 | 2089 | ||
2090 | (*sd->pg_chunk.p_cnt)--; | 2090 | (*sd->pg_chunk.p_cnt)--; |
2091 | if (!*sd->pg_chunk.p_cnt) | 2091 | if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page) |
2092 | pci_unmap_page(adap->pdev, | 2092 | pci_unmap_page(adap->pdev, |
2093 | sd->pg_chunk.mapping, | 2093 | sd->pg_chunk.mapping, |
2094 | fl->alloc_size, | 2094 | fl->alloc_size, |
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index f72c56dec33c..e3478314c002 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -164,16 +164,14 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; | |||
164 | # define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7) | 164 | # define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7) |
165 | 165 | ||
166 | /* EMAC mac_control register */ | 166 | /* EMAC mac_control register */ |
167 | #define EMAC_MACCONTROL_TXPTYPE (0x200) | 167 | #define EMAC_MACCONTROL_TXPTYPE BIT(9) |
168 | #define EMAC_MACCONTROL_TXPACEEN (0x40) | 168 | #define EMAC_MACCONTROL_TXPACEEN BIT(6) |
169 | #define EMAC_MACCONTROL_MIIEN (0x20) | 169 | #define EMAC_MACCONTROL_GMIIEN BIT(5) |
170 | #define EMAC_MACCONTROL_GIGABITEN (0x80) | 170 | #define EMAC_MACCONTROL_GIGABITEN BIT(7) |
171 | #define EMAC_MACCONTROL_GIGABITEN_SHIFT (7) | 171 | #define EMAC_MACCONTROL_FULLDUPLEXEN BIT(0) |
172 | #define EMAC_MACCONTROL_FULLDUPLEXEN (0x1) | ||
173 | #define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15) | 172 | #define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15) |
174 | 173 | ||
175 | /* GIGABIT MODE related bits */ | 174 | /* GIGABIT MODE related bits */ |
176 | #define EMAC_DM646X_MACCONTORL_GMIIEN BIT(5) | ||
177 | #define EMAC_DM646X_MACCONTORL_GIG BIT(7) | 175 | #define EMAC_DM646X_MACCONTORL_GIG BIT(7) |
178 | #define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17) | 176 | #define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17) |
179 | 177 | ||
@@ -192,10 +190,10 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; | |||
192 | #define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF) | 190 | #define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF) |
193 | 191 | ||
194 | /* MAC_IN_VECTOR (0x180) register bit fields */ | 192 | /* MAC_IN_VECTOR (0x180) register bit fields */ |
195 | #define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT (0x20000) | 193 | #define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT BIT(17) |
196 | #define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT (0x10000) | 194 | #define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT BIT(16) |
197 | #define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC (0x0100) | 195 | #define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC BIT(8) |
198 | #define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC (0x01) | 196 | #define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC BIT(0) |
199 | 197 | ||
200 | /** NOTE:: For DM646x the IN_VECTOR has changed */ | 198 | /** NOTE:: For DM646x the IN_VECTOR has changed */ |
201 | #define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH) | 199 | #define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH) |
@@ -203,7 +201,6 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; | |||
203 | #define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26) | 201 | #define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26) |
204 | #define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27) | 202 | #define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27) |
205 | 203 | ||
206 | |||
207 | /* CPPI bit positions */ | 204 | /* CPPI bit positions */ |
208 | #define EMAC_CPPI_SOP_BIT BIT(31) | 205 | #define EMAC_CPPI_SOP_BIT BIT(31) |
209 | #define EMAC_CPPI_EOP_BIT BIT(30) | 206 | #define EMAC_CPPI_EOP_BIT BIT(30) |
@@ -750,8 +747,7 @@ static void emac_update_phystatus(struct emac_priv *priv) | |||
750 | 747 | ||
751 | if (priv->speed == SPEED_1000 && (priv->version == EMAC_VERSION_2)) { | 748 | if (priv->speed == SPEED_1000 && (priv->version == EMAC_VERSION_2)) { |
752 | mac_control = emac_read(EMAC_MACCONTROL); | 749 | mac_control = emac_read(EMAC_MACCONTROL); |
753 | mac_control |= (EMAC_DM646X_MACCONTORL_GMIIEN | | 750 | mac_control |= (EMAC_DM646X_MACCONTORL_GIG | |
754 | EMAC_DM646X_MACCONTORL_GIG | | ||
755 | EMAC_DM646X_MACCONTORL_GIGFORCE); | 751 | EMAC_DM646X_MACCONTORL_GIGFORCE); |
756 | } else { | 752 | } else { |
757 | /* Clear the GIG bit and GIGFORCE bit */ | 753 | /* Clear the GIG bit and GIGFORCE bit */ |
@@ -2108,7 +2104,7 @@ static int emac_hw_enable(struct emac_priv *priv) | |||
2108 | 2104 | ||
2109 | /* Enable MII */ | 2105 | /* Enable MII */ |
2110 | val = emac_read(EMAC_MACCONTROL); | 2106 | val = emac_read(EMAC_MACCONTROL); |
2111 | val |= (EMAC_MACCONTROL_MIIEN); | 2107 | val |= (EMAC_MACCONTROL_GMIIEN); |
2112 | emac_write(EMAC_MACCONTROL, val); | 2108 | emac_write(EMAC_MACCONTROL, val); |
2113 | 2109 | ||
2114 | /* Enable NAPI and interrupts */ | 2110 | /* Enable NAPI and interrupts */ |
@@ -2140,9 +2136,6 @@ static int emac_poll(struct napi_struct *napi, int budget) | |||
2140 | u32 status = 0; | 2136 | u32 status = 0; |
2141 | u32 num_pkts = 0; | 2137 | u32 num_pkts = 0; |
2142 | 2138 | ||
2143 | if (!netif_running(ndev)) | ||
2144 | return 0; | ||
2145 | |||
2146 | /* Check interrupt vectors and call packet processing */ | 2139 | /* Check interrupt vectors and call packet processing */ |
2147 | status = emac_read(EMAC_MACINVECTOR); | 2140 | status = emac_read(EMAC_MACINVECTOR); |
2148 | 2141 | ||
@@ -2221,7 +2214,7 @@ void emac_poll_controller(struct net_device *ndev) | |||
2221 | struct emac_priv *priv = netdev_priv(ndev); | 2214 | struct emac_priv *priv = netdev_priv(ndev); |
2222 | 2215 | ||
2223 | emac_int_disable(priv); | 2216 | emac_int_disable(priv); |
2224 | emac_irq(ndev->irq, priv); | 2217 | emac_irq(ndev->irq, ndev); |
2225 | emac_int_enable(priv); | 2218 | emac_int_enable(priv); |
2226 | } | 2219 | } |
2227 | #endif | 2220 | #endif |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 5d2f48f02251..d269a68ce354 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -157,6 +157,7 @@ | |||
157 | #include <linux/init.h> | 157 | #include <linux/init.h> |
158 | #include <linux/pci.h> | 158 | #include <linux/pci.h> |
159 | #include <linux/dma-mapping.h> | 159 | #include <linux/dma-mapping.h> |
160 | #include <linux/dmapool.h> | ||
160 | #include <linux/netdevice.h> | 161 | #include <linux/netdevice.h> |
161 | #include <linux/etherdevice.h> | 162 | #include <linux/etherdevice.h> |
162 | #include <linux/mii.h> | 163 | #include <linux/mii.h> |
@@ -602,6 +603,7 @@ struct nic { | |||
602 | struct mem *mem; | 603 | struct mem *mem; |
603 | dma_addr_t dma_addr; | 604 | dma_addr_t dma_addr; |
604 | 605 | ||
606 | struct pci_pool *cbs_pool; | ||
605 | dma_addr_t cbs_dma_addr; | 607 | dma_addr_t cbs_dma_addr; |
606 | u8 adaptive_ifs; | 608 | u8 adaptive_ifs; |
607 | u8 tx_threshold; | 609 | u8 tx_threshold; |
@@ -1427,19 +1429,31 @@ static int e100_phy_init(struct nic *nic) | |||
1427 | } else | 1429 | } else |
1428 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); | 1430 | DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); |
1429 | 1431 | ||
1430 | /* Isolate all the PHY ids */ | ||
1431 | for (addr = 0; addr < 32; addr++) | ||
1432 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); | ||
1433 | /* Select the discovered PHY */ | ||
1434 | bmcr &= ~BMCR_ISOLATE; | ||
1435 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); | ||
1436 | |||
1437 | /* Get phy ID */ | 1432 | /* Get phy ID */ |
1438 | id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); | 1433 | id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); |
1439 | id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); | 1434 | id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); |
1440 | nic->phy = (u32)id_hi << 16 | (u32)id_lo; | 1435 | nic->phy = (u32)id_hi << 16 | (u32)id_lo; |
1441 | DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); | 1436 | DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); |
1442 | 1437 | ||
1438 | /* Select the phy and isolate the rest */ | ||
1439 | for (addr = 0; addr < 32; addr++) { | ||
1440 | if (addr != nic->mii.phy_id) { | ||
1441 | mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); | ||
1442 | } else if (nic->phy != phy_82552_v) { | ||
1443 | bmcr = mdio_read(netdev, addr, MII_BMCR); | ||
1444 | mdio_write(netdev, addr, MII_BMCR, | ||
1445 | bmcr & ~BMCR_ISOLATE); | ||
1446 | } | ||
1447 | } | ||
1448 | /* | ||
1449 | * Workaround for 82552: | ||
1450 | * Clear the ISOLATE bit on selected phy_id last (mirrored on all | ||
1451 | * other phy_id's) using bmcr value from addr discovery loop above. | ||
1452 | */ | ||
1453 | if (nic->phy == phy_82552_v) | ||
1454 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, | ||
1455 | bmcr & ~BMCR_ISOLATE); | ||
1456 | |||
1443 | /* Handle National tx phys */ | 1457 | /* Handle National tx phys */ |
1444 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF | 1458 | #define NCS_PHY_MODEL_MASK 0xFFF0FFFF |
1445 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { | 1459 | if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { |
@@ -1781,9 +1795,7 @@ static void e100_clean_cbs(struct nic *nic) | |||
1781 | nic->cb_to_clean = nic->cb_to_clean->next; | 1795 | nic->cb_to_clean = nic->cb_to_clean->next; |
1782 | nic->cbs_avail++; | 1796 | nic->cbs_avail++; |
1783 | } | 1797 | } |
1784 | pci_free_consistent(nic->pdev, | 1798 | pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr); |
1785 | sizeof(struct cb) * nic->params.cbs.count, | ||
1786 | nic->cbs, nic->cbs_dma_addr); | ||
1787 | nic->cbs = NULL; | 1799 | nic->cbs = NULL; |
1788 | nic->cbs_avail = 0; | 1800 | nic->cbs_avail = 0; |
1789 | } | 1801 | } |
@@ -1801,8 +1813,8 @@ static int e100_alloc_cbs(struct nic *nic) | |||
1801 | nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL; | 1813 | nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL; |
1802 | nic->cbs_avail = 0; | 1814 | nic->cbs_avail = 0; |
1803 | 1815 | ||
1804 | nic->cbs = pci_alloc_consistent(nic->pdev, | 1816 | nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL, |
1805 | sizeof(struct cb) * count, &nic->cbs_dma_addr); | 1817 | &nic->cbs_dma_addr); |
1806 | if (!nic->cbs) | 1818 | if (!nic->cbs) |
1807 | return -ENOMEM; | 1819 | return -ENOMEM; |
1808 | 1820 | ||
@@ -2829,7 +2841,11 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2829 | DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); | 2841 | DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); |
2830 | goto err_out_free; | 2842 | goto err_out_free; |
2831 | } | 2843 | } |
2832 | 2844 | nic->cbs_pool = pci_pool_create(netdev->name, | |
2845 | nic->pdev, | ||
2846 | nic->params.cbs.count * sizeof(struct cb), | ||
2847 | sizeof(u32), | ||
2848 | 0); | ||
2833 | DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n", | 2849 | DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n", |
2834 | (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), | 2850 | (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), |
2835 | pdev->irq, netdev->dev_addr); | 2851 | pdev->irq, netdev->dev_addr); |
@@ -2859,6 +2875,7 @@ static void __devexit e100_remove(struct pci_dev *pdev) | |||
2859 | unregister_netdev(netdev); | 2875 | unregister_netdev(netdev); |
2860 | e100_free(nic); | 2876 | e100_free(nic); |
2861 | pci_iounmap(pdev, nic->csr); | 2877 | pci_iounmap(pdev, nic->csr); |
2878 | pci_pool_destroy(nic->cbs_pool); | ||
2862 | free_netdev(netdev); | 2879 | free_netdev(netdev); |
2863 | pci_release_regions(pdev); | 2880 | pci_release_regions(pdev); |
2864 | pci_disable_device(pdev); | 2881 | pci_disable_device(pdev); |
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h index c0f185beb8bc..1190167a8b3d 100644 --- a/drivers/net/e1000e/defines.h +++ b/drivers/net/e1000e/defines.h | |||
@@ -76,6 +76,7 @@ | |||
76 | /* Extended Device Control */ | 76 | /* Extended Device Control */ |
77 | #define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */ | 77 | #define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */ |
78 | #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ | 78 | #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ |
79 | #define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */ | ||
79 | #define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ | 80 | #define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ |
80 | #define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000 /* DMA Dynamic Clock Gating */ | 81 | #define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000 /* DMA Dynamic Clock Gating */ |
81 | #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 | 82 | #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 |
@@ -347,6 +348,7 @@ | |||
347 | /* Extended Configuration Control and Size */ | 348 | /* Extended Configuration Control and Size */ |
348 | #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 | 349 | #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 |
349 | #define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001 | 350 | #define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001 |
351 | #define E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE 0x00000008 | ||
350 | #define E1000_EXTCNF_CTRL_SWFLAG 0x00000020 | 352 | #define E1000_EXTCNF_CTRL_SWFLAG 0x00000020 |
351 | #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000 | 353 | #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000 |
352 | #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16 | 354 | #define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16 |
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 405a144ebcad..3e187b0e4203 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -141,6 +141,22 @@ struct e1000_info; | |||
141 | #define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */ | 141 | #define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */ |
142 | #define HV_TNCRS_LOWER PHY_REG(778, 30) | 142 | #define HV_TNCRS_LOWER PHY_REG(778, 30) |
143 | 143 | ||
144 | #define E1000_FCRTV_PCH 0x05F40 /* PCH Flow Control Refresh Timer Value */ | ||
145 | |||
146 | /* BM PHY Copper Specific Status */ | ||
147 | #define BM_CS_STATUS 17 | ||
148 | #define BM_CS_STATUS_LINK_UP 0x0400 | ||
149 | #define BM_CS_STATUS_RESOLVED 0x0800 | ||
150 | #define BM_CS_STATUS_SPEED_MASK 0xC000 | ||
151 | #define BM_CS_STATUS_SPEED_1000 0x8000 | ||
152 | |||
153 | /* 82577 Mobile Phy Status Register */ | ||
154 | #define HV_M_STATUS 26 | ||
155 | #define HV_M_STATUS_AUTONEG_COMPLETE 0x1000 | ||
156 | #define HV_M_STATUS_SPEED_MASK 0x0300 | ||
157 | #define HV_M_STATUS_SPEED_1000 0x0200 | ||
158 | #define HV_M_STATUS_LINK_UP 0x0040 | ||
159 | |||
144 | enum e1000_boards { | 160 | enum e1000_boards { |
145 | board_82571, | 161 | board_82571, |
146 | board_82572, | 162 | board_82572, |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 1bf4d2a5d34f..e82638ecae88 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -327,10 +327,18 @@ static int e1000_set_pauseparam(struct net_device *netdev, | |||
327 | 327 | ||
328 | hw->fc.current_mode = hw->fc.requested_mode; | 328 | hw->fc.current_mode = hw->fc.requested_mode; |
329 | 329 | ||
330 | retval = ((hw->phy.media_type == e1000_media_type_fiber) ? | 330 | if (hw->phy.media_type == e1000_media_type_fiber) { |
331 | hw->mac.ops.setup_link(hw) : e1000e_force_mac_fc(hw)); | 331 | retval = hw->mac.ops.setup_link(hw); |
332 | /* implicit goto out */ | ||
333 | } else { | ||
334 | retval = e1000e_force_mac_fc(hw); | ||
335 | if (retval) | ||
336 | goto out; | ||
337 | e1000e_set_fc_watermarks(hw); | ||
338 | } | ||
332 | } | 339 | } |
333 | 340 | ||
341 | out: | ||
334 | clear_bit(__E1000_RESETTING, &adapter->state); | 342 | clear_bit(__E1000_RESETTING, &adapter->state); |
335 | return retval; | 343 | return retval; |
336 | } | 344 | } |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 7b05cf47f7f5..aaea41ef794d 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -903,6 +903,7 @@ struct e1000_shadow_ram { | |||
903 | struct e1000_dev_spec_ich8lan { | 903 | struct e1000_dev_spec_ich8lan { |
904 | bool kmrn_lock_loss_workaround_enabled; | 904 | bool kmrn_lock_loss_workaround_enabled; |
905 | struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; | 905 | struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; |
906 | bool nvm_k1_enabled; | ||
906 | }; | 907 | }; |
907 | 908 | ||
908 | struct e1000_hw { | 909 | struct e1000_hw { |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index b6388b9535fd..eff3f4783655 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -124,11 +124,25 @@ | |||
124 | 124 | ||
125 | #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */ | 125 | #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */ |
126 | 126 | ||
127 | /* SMBus Address Phy Register */ | ||
128 | #define HV_SMB_ADDR PHY_REG(768, 26) | ||
129 | #define HV_SMB_ADDR_PEC_EN 0x0200 | ||
130 | #define HV_SMB_ADDR_VALID 0x0080 | ||
131 | |||
132 | /* Strapping Option Register - RO */ | ||
133 | #define E1000_STRAP 0x0000C | ||
134 | #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000 | ||
135 | #define E1000_STRAP_SMBUS_ADDRESS_SHIFT 17 | ||
136 | |||
127 | /* OEM Bits Phy Register */ | 137 | /* OEM Bits Phy Register */ |
128 | #define HV_OEM_BITS PHY_REG(768, 25) | 138 | #define HV_OEM_BITS PHY_REG(768, 25) |
129 | #define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */ | 139 | #define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */ |
140 | #define HV_OEM_BITS_GBE_DIS 0x0040 /* Gigabit Disable */ | ||
130 | #define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */ | 141 | #define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */ |
131 | 142 | ||
143 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ | ||
144 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ | ||
145 | |||
132 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ | 146 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ |
133 | /* Offset 04h HSFSTS */ | 147 | /* Offset 04h HSFSTS */ |
134 | union ich8_hws_flash_status { | 148 | union ich8_hws_flash_status { |
@@ -208,6 +222,9 @@ static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw); | |||
208 | static s32 e1000_led_on_pchlan(struct e1000_hw *hw); | 222 | static s32 e1000_led_on_pchlan(struct e1000_hw *hw); |
209 | static s32 e1000_led_off_pchlan(struct e1000_hw *hw); | 223 | static s32 e1000_led_off_pchlan(struct e1000_hw *hw); |
210 | static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); | 224 | static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); |
225 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); | ||
226 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | ||
227 | static s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable); | ||
211 | 228 | ||
212 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 229 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
213 | { | 230 | { |
@@ -483,14 +500,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
483 | goto out; | 500 | goto out; |
484 | } | 501 | } |
485 | 502 | ||
486 | if (hw->mac.type == e1000_pchlan) { | ||
487 | ret_val = e1000e_write_kmrn_reg(hw, | ||
488 | E1000_KMRNCTRLSTA_K1_CONFIG, | ||
489 | E1000_KMRNCTRLSTA_K1_ENABLE); | ||
490 | if (ret_val) | ||
491 | goto out; | ||
492 | } | ||
493 | |||
494 | /* | 503 | /* |
495 | * First we want to see if the MII Status Register reports | 504 | * First we want to see if the MII Status Register reports |
496 | * link. If so, then we want to get the current speed/duplex | 505 | * link. If so, then we want to get the current speed/duplex |
@@ -500,6 +509,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
500 | if (ret_val) | 509 | if (ret_val) |
501 | goto out; | 510 | goto out; |
502 | 511 | ||
512 | if (hw->mac.type == e1000_pchlan) { | ||
513 | ret_val = e1000_k1_gig_workaround_hv(hw, link); | ||
514 | if (ret_val) | ||
515 | goto out; | ||
516 | } | ||
517 | |||
503 | if (!link) | 518 | if (!link) |
504 | goto out; /* No link detected */ | 519 | goto out; /* No link detected */ |
505 | 520 | ||
@@ -794,6 +809,327 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw) | |||
794 | } | 809 | } |
795 | 810 | ||
796 | /** | 811 | /** |
812 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration | ||
813 | * @hw: pointer to the HW structure | ||
814 | * | ||
815 | * SW should configure the LCD from the NVM extended configuration region | ||
816 | * as a workaround for certain parts. | ||
817 | **/ | ||
818 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | ||
819 | { | ||
820 | struct e1000_phy_info *phy = &hw->phy; | ||
821 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; | ||
822 | s32 ret_val; | ||
823 | u16 word_addr, reg_data, reg_addr, phy_page = 0; | ||
824 | |||
825 | ret_val = hw->phy.ops.acquire_phy(hw); | ||
826 | if (ret_val) | ||
827 | return ret_val; | ||
828 | |||
829 | /* | ||
830 | * Initialize the PHY from the NVM on ICH platforms. This | ||
831 | * is needed due to an issue where the NVM configuration is | ||
832 | * not properly autoloaded after power transitions. | ||
833 | * Therefore, after each PHY reset, we will load the | ||
834 | * configuration data out of the NVM manually. | ||
835 | */ | ||
836 | if ((hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) || | ||
837 | (hw->mac.type == e1000_pchlan)) { | ||
838 | struct e1000_adapter *adapter = hw->adapter; | ||
839 | |||
840 | /* Check if SW needs to configure the PHY */ | ||
841 | if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) || | ||
842 | (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) || | ||
843 | (hw->mac.type == e1000_pchlan)) | ||
844 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; | ||
845 | else | ||
846 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; | ||
847 | |||
848 | data = er32(FEXTNVM); | ||
849 | if (!(data & sw_cfg_mask)) | ||
850 | goto out; | ||
851 | |||
852 | /* Wait for basic configuration completes before proceeding */ | ||
853 | e1000_lan_init_done_ich8lan(hw); | ||
854 | |||
855 | /* | ||
856 | * Make sure HW does not configure LCD from PHY | ||
857 | * extended configuration before SW configuration | ||
858 | */ | ||
859 | data = er32(EXTCNF_CTRL); | ||
860 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) | ||
861 | goto out; | ||
862 | |||
863 | cnf_size = er32(EXTCNF_SIZE); | ||
864 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; | ||
865 | cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT; | ||
866 | if (!cnf_size) | ||
867 | goto out; | ||
868 | |||
869 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | ||
870 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | ||
871 | |||
872 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | ||
873 | (hw->mac.type == e1000_pchlan)) { | ||
874 | /* | ||
875 | * HW configures the SMBus address and LEDs when the | ||
876 | * OEM and LCD Write Enable bits are set in the NVM. | ||
877 | * When both NVM bits are cleared, SW will configure | ||
878 | * them instead. | ||
879 | */ | ||
880 | data = er32(STRAP); | ||
881 | data &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
882 | reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; | ||
883 | reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
884 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, | ||
885 | reg_data); | ||
886 | if (ret_val) | ||
887 | goto out; | ||
888 | |||
889 | data = er32(LEDCTL); | ||
890 | ret_val = e1000_write_phy_reg_hv_locked(hw, | ||
891 | HV_LED_CONFIG, | ||
892 | (u16)data); | ||
893 | if (ret_val) | ||
894 | goto out; | ||
895 | } | ||
896 | /* Configure LCD from extended configuration region. */ | ||
897 | |||
898 | /* cnf_base_addr is in DWORD */ | ||
899 | word_addr = (u16)(cnf_base_addr << 1); | ||
900 | |||
901 | for (i = 0; i < cnf_size; i++) { | ||
902 | ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1, | ||
903 | ®_data); | ||
904 | if (ret_val) | ||
905 | goto out; | ||
906 | |||
907 | ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1), | ||
908 | 1, ®_addr); | ||
909 | if (ret_val) | ||
910 | goto out; | ||
911 | |||
912 | /* Save off the PHY page for future writes. */ | ||
913 | if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) { | ||
914 | phy_page = reg_data; | ||
915 | continue; | ||
916 | } | ||
917 | |||
918 | reg_addr &= PHY_REG_MASK; | ||
919 | reg_addr |= phy_page; | ||
920 | |||
921 | ret_val = phy->ops.write_phy_reg_locked(hw, | ||
922 | (u32)reg_addr, | ||
923 | reg_data); | ||
924 | if (ret_val) | ||
925 | goto out; | ||
926 | } | ||
927 | } | ||
928 | |||
929 | out: | ||
930 | hw->phy.ops.release_phy(hw); | ||
931 | return ret_val; | ||
932 | } | ||
933 | |||
934 | /** | ||
935 | * e1000_k1_gig_workaround_hv - K1 Si workaround | ||
936 | * @hw: pointer to the HW structure | ||
937 | * @link: link up bool flag | ||
938 | * | ||
939 | * If K1 is enabled for 1Gbps, the MAC might stall when transitioning | ||
940 | * from a lower speed. This workaround disables K1 whenever link is at 1Gig | ||
941 | * If link is down, the function will restore the default K1 setting located | ||
942 | * in the NVM. | ||
943 | **/ | ||
944 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link) | ||
945 | { | ||
946 | s32 ret_val = 0; | ||
947 | u16 status_reg = 0; | ||
948 | bool k1_enable = hw->dev_spec.ich8lan.nvm_k1_enabled; | ||
949 | |||
950 | if (hw->mac.type != e1000_pchlan) | ||
951 | goto out; | ||
952 | |||
953 | /* Wrap the whole flow with the sw flag */ | ||
954 | ret_val = hw->phy.ops.acquire_phy(hw); | ||
955 | if (ret_val) | ||
956 | goto out; | ||
957 | |||
958 | /* Disable K1 when link is 1Gbps, otherwise use the NVM setting */ | ||
959 | if (link) { | ||
960 | if (hw->phy.type == e1000_phy_82578) { | ||
961 | ret_val = hw->phy.ops.read_phy_reg_locked(hw, | ||
962 | BM_CS_STATUS, | ||
963 | &status_reg); | ||
964 | if (ret_val) | ||
965 | goto release; | ||
966 | |||
967 | status_reg &= BM_CS_STATUS_LINK_UP | | ||
968 | BM_CS_STATUS_RESOLVED | | ||
969 | BM_CS_STATUS_SPEED_MASK; | ||
970 | |||
971 | if (status_reg == (BM_CS_STATUS_LINK_UP | | ||
972 | BM_CS_STATUS_RESOLVED | | ||
973 | BM_CS_STATUS_SPEED_1000)) | ||
974 | k1_enable = false; | ||
975 | } | ||
976 | |||
977 | if (hw->phy.type == e1000_phy_82577) { | ||
978 | ret_val = hw->phy.ops.read_phy_reg_locked(hw, | ||
979 | HV_M_STATUS, | ||
980 | &status_reg); | ||
981 | if (ret_val) | ||
982 | goto release; | ||
983 | |||
984 | status_reg &= HV_M_STATUS_LINK_UP | | ||
985 | HV_M_STATUS_AUTONEG_COMPLETE | | ||
986 | HV_M_STATUS_SPEED_MASK; | ||
987 | |||
988 | if (status_reg == (HV_M_STATUS_LINK_UP | | ||
989 | HV_M_STATUS_AUTONEG_COMPLETE | | ||
990 | HV_M_STATUS_SPEED_1000)) | ||
991 | k1_enable = false; | ||
992 | } | ||
993 | |||
994 | /* Link stall fix for link up */ | ||
995 | ret_val = hw->phy.ops.write_phy_reg_locked(hw, PHY_REG(770, 19), | ||
996 | 0x0100); | ||
997 | if (ret_val) | ||
998 | goto release; | ||
999 | |||
1000 | } else { | ||
1001 | /* Link stall fix for link down */ | ||
1002 | ret_val = hw->phy.ops.write_phy_reg_locked(hw, PHY_REG(770, 19), | ||
1003 | 0x4100); | ||
1004 | if (ret_val) | ||
1005 | goto release; | ||
1006 | } | ||
1007 | |||
1008 | ret_val = e1000_configure_k1_ich8lan(hw, k1_enable); | ||
1009 | |||
1010 | release: | ||
1011 | hw->phy.ops.release_phy(hw); | ||
1012 | out: | ||
1013 | return ret_val; | ||
1014 | } | ||
1015 | |||
1016 | /** | ||
1017 | * e1000_configure_k1_ich8lan - Configure K1 power state | ||
1018 | * @hw: pointer to the HW structure | ||
1019 | * @enable: K1 state to configure | ||
1020 | * | ||
1021 | * Configure the K1 power state based on the provided parameter. | ||
1022 | * Assumes semaphore already acquired. | ||
1023 | * | ||
1024 | * Success returns 0, Failure returns -E1000_ERR_PHY (-2) | ||
1025 | **/ | ||
1026 | static s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable) | ||
1027 | { | ||
1028 | s32 ret_val = 0; | ||
1029 | u32 ctrl_reg = 0; | ||
1030 | u32 ctrl_ext = 0; | ||
1031 | u32 reg = 0; | ||
1032 | u16 kmrn_reg = 0; | ||
1033 | |||
1034 | ret_val = e1000e_read_kmrn_reg_locked(hw, | ||
1035 | E1000_KMRNCTRLSTA_K1_CONFIG, | ||
1036 | &kmrn_reg); | ||
1037 | if (ret_val) | ||
1038 | goto out; | ||
1039 | |||
1040 | if (k1_enable) | ||
1041 | kmrn_reg |= E1000_KMRNCTRLSTA_K1_ENABLE; | ||
1042 | else | ||
1043 | kmrn_reg &= ~E1000_KMRNCTRLSTA_K1_ENABLE; | ||
1044 | |||
1045 | ret_val = e1000e_write_kmrn_reg_locked(hw, | ||
1046 | E1000_KMRNCTRLSTA_K1_CONFIG, | ||
1047 | kmrn_reg); | ||
1048 | if (ret_val) | ||
1049 | goto out; | ||
1050 | |||
1051 | udelay(20); | ||
1052 | ctrl_ext = er32(CTRL_EXT); | ||
1053 | ctrl_reg = er32(CTRL); | ||
1054 | |||
1055 | reg = ctrl_reg & ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100); | ||
1056 | reg |= E1000_CTRL_FRCSPD; | ||
1057 | ew32(CTRL, reg); | ||
1058 | |||
1059 | ew32(CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_SPD_BYPS); | ||
1060 | udelay(20); | ||
1061 | ew32(CTRL, ctrl_reg); | ||
1062 | ew32(CTRL_EXT, ctrl_ext); | ||
1063 | udelay(20); | ||
1064 | |||
1065 | out: | ||
1066 | return ret_val; | ||
1067 | } | ||
1068 | |||
1069 | /** | ||
1070 | * e1000_oem_bits_config_ich8lan - SW-based LCD Configuration | ||
1071 | * @hw: pointer to the HW structure | ||
1072 | * @d0_state: boolean if entering d0 or d3 device state | ||
1073 | * | ||
1074 | * SW will configure Gbe Disable and LPLU based on the NVM. The four bits are | ||
1075 | * collectively called OEM bits. The OEM Write Enable bit and SW Config bit | ||
1076 | * in NVM determines whether HW should configure LPLU and Gbe Disable. | ||
1077 | **/ | ||
1078 | static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | ||
1079 | { | ||
1080 | s32 ret_val = 0; | ||
1081 | u32 mac_reg; | ||
1082 | u16 oem_reg; | ||
1083 | |||
1084 | if (hw->mac.type != e1000_pchlan) | ||
1085 | return ret_val; | ||
1086 | |||
1087 | ret_val = hw->phy.ops.acquire_phy(hw); | ||
1088 | if (ret_val) | ||
1089 | return ret_val; | ||
1090 | |||
1091 | mac_reg = er32(EXTCNF_CTRL); | ||
1092 | if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) | ||
1093 | goto out; | ||
1094 | |||
1095 | mac_reg = er32(FEXTNVM); | ||
1096 | if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M)) | ||
1097 | goto out; | ||
1098 | |||
1099 | mac_reg = er32(PHY_CTRL); | ||
1100 | |||
1101 | ret_val = hw->phy.ops.read_phy_reg_locked(hw, HV_OEM_BITS, &oem_reg); | ||
1102 | if (ret_val) | ||
1103 | goto out; | ||
1104 | |||
1105 | oem_reg &= ~(HV_OEM_BITS_GBE_DIS | HV_OEM_BITS_LPLU); | ||
1106 | |||
1107 | if (d0_state) { | ||
1108 | if (mac_reg & E1000_PHY_CTRL_GBE_DISABLE) | ||
1109 | oem_reg |= HV_OEM_BITS_GBE_DIS; | ||
1110 | |||
1111 | if (mac_reg & E1000_PHY_CTRL_D0A_LPLU) | ||
1112 | oem_reg |= HV_OEM_BITS_LPLU; | ||
1113 | } else { | ||
1114 | if (mac_reg & E1000_PHY_CTRL_NOND0A_GBE_DISABLE) | ||
1115 | oem_reg |= HV_OEM_BITS_GBE_DIS; | ||
1116 | |||
1117 | if (mac_reg & E1000_PHY_CTRL_NOND0A_LPLU) | ||
1118 | oem_reg |= HV_OEM_BITS_LPLU; | ||
1119 | } | ||
1120 | /* Restart auto-neg to activate the bits */ | ||
1121 | if (!e1000_check_reset_block(hw)) | ||
1122 | oem_reg |= HV_OEM_BITS_RESTART_AN; | ||
1123 | ret_val = hw->phy.ops.write_phy_reg_locked(hw, HV_OEM_BITS, oem_reg); | ||
1124 | |||
1125 | out: | ||
1126 | hw->phy.ops.release_phy(hw); | ||
1127 | |||
1128 | return ret_val; | ||
1129 | } | ||
1130 | |||
1131 | |||
1132 | /** | ||
797 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be | 1133 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be |
798 | * done after every PHY reset. | 1134 | * done after every PHY reset. |
799 | **/ | 1135 | **/ |
@@ -833,10 +1169,20 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | |||
833 | ret_val = hw->phy.ops.acquire_phy(hw); | 1169 | ret_val = hw->phy.ops.acquire_phy(hw); |
834 | if (ret_val) | 1170 | if (ret_val) |
835 | return ret_val; | 1171 | return ret_val; |
1172 | |||
836 | hw->phy.addr = 1; | 1173 | hw->phy.addr = 1; |
837 | e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); | 1174 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); |
1175 | if (ret_val) | ||
1176 | goto out; | ||
838 | hw->phy.ops.release_phy(hw); | 1177 | hw->phy.ops.release_phy(hw); |
839 | 1178 | ||
1179 | /* | ||
1180 | * Configure the K1 Si workaround during phy reset assuming there is | ||
1181 | * link so that it disables K1 if link is in 1Gbps. | ||
1182 | */ | ||
1183 | ret_val = e1000_k1_gig_workaround_hv(hw, true); | ||
1184 | |||
1185 | out: | ||
840 | return ret_val; | 1186 | return ret_val; |
841 | } | 1187 | } |
842 | 1188 | ||
@@ -882,11 +1228,8 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw) | |||
882 | **/ | 1228 | **/ |
883 | static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | 1229 | static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) |
884 | { | 1230 | { |
885 | struct e1000_phy_info *phy = &hw->phy; | 1231 | s32 ret_val = 0; |
886 | u32 i; | 1232 | u16 reg; |
887 | u32 data, cnf_size, cnf_base_addr, sw_cfg_mask; | ||
888 | s32 ret_val; | ||
889 | u16 reg, word_addr, reg_data, reg_addr, phy_page = 0; | ||
890 | 1233 | ||
891 | ret_val = e1000e_phy_hw_reset_generic(hw); | 1234 | ret_val = e1000e_phy_hw_reset_generic(hw); |
892 | if (ret_val) | 1235 | if (ret_val) |
@@ -905,81 +1248,16 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
905 | if (hw->mac.type == e1000_pchlan) | 1248 | if (hw->mac.type == e1000_pchlan) |
906 | e1e_rphy(hw, BM_WUC, ®); | 1249 | e1e_rphy(hw, BM_WUC, ®); |
907 | 1250 | ||
908 | /* | 1251 | /* Configure the LCD with the extended configuration region in NVM */ |
909 | * Initialize the PHY from the NVM on ICH platforms. This | 1252 | ret_val = e1000_sw_lcd_config_ich8lan(hw); |
910 | * is needed due to an issue where the NVM configuration is | 1253 | if (ret_val) |
911 | * not properly autoloaded after power transitions. | 1254 | goto out; |
912 | * Therefore, after each PHY reset, we will load the | ||
913 | * configuration data out of the NVM manually. | ||
914 | */ | ||
915 | if (hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) { | ||
916 | struct e1000_adapter *adapter = hw->adapter; | ||
917 | |||
918 | /* Check if SW needs configure the PHY */ | ||
919 | if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) || | ||
920 | (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M)) | ||
921 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; | ||
922 | else | ||
923 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; | ||
924 | |||
925 | data = er32(FEXTNVM); | ||
926 | if (!(data & sw_cfg_mask)) | ||
927 | return 0; | ||
928 | |||
929 | /* Wait for basic configuration completes before proceeding */ | ||
930 | e1000_lan_init_done_ich8lan(hw); | ||
931 | |||
932 | /* | ||
933 | * Make sure HW does not configure LCD from PHY | ||
934 | * extended configuration before SW configuration | ||
935 | */ | ||
936 | data = er32(EXTCNF_CTRL); | ||
937 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) | ||
938 | return 0; | ||
939 | |||
940 | cnf_size = er32(EXTCNF_SIZE); | ||
941 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; | ||
942 | cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT; | ||
943 | if (!cnf_size) | ||
944 | return 0; | ||
945 | |||
946 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | ||
947 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | ||
948 | |||
949 | /* Configure LCD from extended configuration region. */ | ||
950 | |||
951 | /* cnf_base_addr is in DWORD */ | ||
952 | word_addr = (u16)(cnf_base_addr << 1); | ||
953 | |||
954 | for (i = 0; i < cnf_size; i++) { | ||
955 | ret_val = e1000_read_nvm(hw, | ||
956 | (word_addr + i * 2), | ||
957 | 1, | ||
958 | ®_data); | ||
959 | if (ret_val) | ||
960 | return ret_val; | ||
961 | |||
962 | ret_val = e1000_read_nvm(hw, | ||
963 | (word_addr + i * 2 + 1), | ||
964 | 1, | ||
965 | ®_addr); | ||
966 | if (ret_val) | ||
967 | return ret_val; | ||
968 | |||
969 | /* Save off the PHY page for future writes. */ | ||
970 | if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) { | ||
971 | phy_page = reg_data; | ||
972 | continue; | ||
973 | } | ||
974 | |||
975 | reg_addr |= phy_page; | ||
976 | 1255 | ||
977 | ret_val = e1e_wphy(hw, (u32)reg_addr, reg_data); | 1256 | /* Configure the LCD with the OEM bits in NVM */ |
978 | if (ret_val) | 1257 | if (hw->mac.type == e1000_pchlan) |
979 | return ret_val; | 1258 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); |
980 | } | ||
981 | } | ||
982 | 1259 | ||
1260 | out: | ||
983 | return 0; | 1261 | return 0; |
984 | } | 1262 | } |
985 | 1263 | ||
@@ -2306,6 +2584,7 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw) | |||
2306 | **/ | 2584 | **/ |
2307 | static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | 2585 | static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) |
2308 | { | 2586 | { |
2587 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | ||
2309 | u16 reg; | 2588 | u16 reg; |
2310 | u32 ctrl, icr, kab; | 2589 | u32 ctrl, icr, kab; |
2311 | s32 ret_val; | 2590 | s32 ret_val; |
@@ -2341,6 +2620,18 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2341 | ew32(PBS, E1000_PBS_16K); | 2620 | ew32(PBS, E1000_PBS_16K); |
2342 | } | 2621 | } |
2343 | 2622 | ||
2623 | if (hw->mac.type == e1000_pchlan) { | ||
2624 | /* Save the NVM K1 bit setting*/ | ||
2625 | ret_val = e1000_read_nvm(hw, E1000_NVM_K1_CONFIG, 1, ®); | ||
2626 | if (ret_val) | ||
2627 | return ret_val; | ||
2628 | |||
2629 | if (reg & E1000_NVM_K1_ENABLE) | ||
2630 | dev_spec->nvm_k1_enabled = true; | ||
2631 | else | ||
2632 | dev_spec->nvm_k1_enabled = false; | ||
2633 | } | ||
2634 | |||
2344 | ctrl = er32(CTRL); | 2635 | ctrl = er32(CTRL); |
2345 | 2636 | ||
2346 | if (!e1000_check_reset_block(hw)) { | 2637 | if (!e1000_check_reset_block(hw)) { |
@@ -2386,6 +2677,15 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2386 | if (hw->mac.type == e1000_pchlan) | 2677 | if (hw->mac.type == e1000_pchlan) |
2387 | e1e_rphy(hw, BM_WUC, ®); | 2678 | e1e_rphy(hw, BM_WUC, ®); |
2388 | 2679 | ||
2680 | ret_val = e1000_sw_lcd_config_ich8lan(hw); | ||
2681 | if (ret_val) | ||
2682 | goto out; | ||
2683 | |||
2684 | if (hw->mac.type == e1000_pchlan) { | ||
2685 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); | ||
2686 | if (ret_val) | ||
2687 | goto out; | ||
2688 | } | ||
2389 | /* | 2689 | /* |
2390 | * For PCH, this write will make sure that any noise | 2690 | * For PCH, this write will make sure that any noise |
2391 | * will be detected as a CRC error and be dropped rather than show up | 2691 | * will be detected as a CRC error and be dropped rather than show up |
@@ -2404,6 +2704,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2404 | if (hw->mac.type == e1000_pchlan) | 2704 | if (hw->mac.type == e1000_pchlan) |
2405 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | 2705 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); |
2406 | 2706 | ||
2707 | out: | ||
2407 | return ret_val; | 2708 | return ret_val; |
2408 | } | 2709 | } |
2409 | 2710 | ||
@@ -2708,14 +3009,6 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed, | |||
2708 | if (ret_val) | 3009 | if (ret_val) |
2709 | return ret_val; | 3010 | return ret_val; |
2710 | 3011 | ||
2711 | if ((hw->mac.type == e1000_pchlan) && (*speed == SPEED_1000)) { | ||
2712 | ret_val = e1000e_write_kmrn_reg(hw, | ||
2713 | E1000_KMRNCTRLSTA_K1_CONFIG, | ||
2714 | E1000_KMRNCTRLSTA_K1_DISABLE); | ||
2715 | if (ret_val) | ||
2716 | return ret_val; | ||
2717 | } | ||
2718 | |||
2719 | if ((hw->mac.type == e1000_ich8lan) && | 3012 | if ((hw->mac.type == e1000_ich8lan) && |
2720 | (hw->phy.type == e1000_phy_igp_3) && | 3013 | (hw->phy.type == e1000_phy_igp_3) && |
2721 | (*speed == SPEED_1000)) { | 3014 | (*speed == SPEED_1000)) { |
@@ -3266,6 +3559,7 @@ struct e1000_info e1000_pch_info = { | |||
3266 | | FLAG_HAS_AMT | 3559 | | FLAG_HAS_AMT |
3267 | | FLAG_HAS_FLASH | 3560 | | FLAG_HAS_FLASH |
3268 | | FLAG_HAS_JUMBO_FRAMES | 3561 | | FLAG_HAS_JUMBO_FRAMES |
3562 | | FLAG_DISABLE_FC_PAUSE_TIME /* errata */ | ||
3269 | | FLAG_APME_IN_WUC, | 3563 | | FLAG_APME_IN_WUC, |
3270 | .pba = 26, | 3564 | .pba = 26, |
3271 | .max_hw_frame_size = 4096, | 3565 | .max_hw_frame_size = 4096, |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 0687c6aa4e46..fad8f9ea0043 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -2769,25 +2769,38 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2769 | /* | 2769 | /* |
2770 | * flow control settings | 2770 | * flow control settings |
2771 | * | 2771 | * |
2772 | * The high water mark must be low enough to fit two full frame | 2772 | * The high water mark must be low enough to fit one full frame |
2773 | * (or the size used for early receive) above it in the Rx FIFO. | 2773 | * (or the size used for early receive) above it in the Rx FIFO. |
2774 | * Set it to the lower of: | 2774 | * Set it to the lower of: |
2775 | * - 90% of the Rx FIFO size, and | 2775 | * - 90% of the Rx FIFO size, and |
2776 | * - the full Rx FIFO size minus the early receive size (for parts | 2776 | * - the full Rx FIFO size minus the early receive size (for parts |
2777 | * with ERT support assuming ERT set to E1000_ERT_2048), or | 2777 | * with ERT support assuming ERT set to E1000_ERT_2048), or |
2778 | * - the full Rx FIFO size minus two full frames | 2778 | * - the full Rx FIFO size minus one full frame |
2779 | */ | 2779 | */ |
2780 | if ((adapter->flags & FLAG_HAS_ERT) && | 2780 | if (hw->mac.type == e1000_pchlan) { |
2781 | (adapter->netdev->mtu > ETH_DATA_LEN)) | 2781 | /* |
2782 | hwm = min(((pba << 10) * 9 / 10), | 2782 | * Workaround PCH LOM adapter hangs with certain network |
2783 | ((pba << 10) - (E1000_ERT_2048 << 3))); | 2783 | * loads. If hangs persist, try disabling Tx flow control. |
2784 | else | 2784 | */ |
2785 | hwm = min(((pba << 10) * 9 / 10), | 2785 | if (adapter->netdev->mtu > ETH_DATA_LEN) { |
2786 | ((pba << 10) - (2 * adapter->max_frame_size))); | 2786 | fc->high_water = 0x3500; |
2787 | fc->low_water = 0x1500; | ||
2788 | } else { | ||
2789 | fc->high_water = 0x5000; | ||
2790 | fc->low_water = 0x3000; | ||
2791 | } | ||
2792 | } else { | ||
2793 | if ((adapter->flags & FLAG_HAS_ERT) && | ||
2794 | (adapter->netdev->mtu > ETH_DATA_LEN)) | ||
2795 | hwm = min(((pba << 10) * 9 / 10), | ||
2796 | ((pba << 10) - (E1000_ERT_2048 << 3))); | ||
2797 | else | ||
2798 | hwm = min(((pba << 10) * 9 / 10), | ||
2799 | ((pba << 10) - adapter->max_frame_size)); | ||
2787 | 2800 | ||
2788 | fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */ | 2801 | fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */ |
2789 | fc->low_water = (fc->high_water - (2 * adapter->max_frame_size)); | 2802 | fc->low_water = fc->high_water - 8; |
2790 | fc->low_water &= E1000_FCRTL_RTL; /* 8-byte granularity */ | 2803 | } |
2791 | 2804 | ||
2792 | if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME) | 2805 | if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME) |
2793 | fc->pause_time = 0xFFFF; | 2806 | fc->pause_time = 0xFFFF; |
@@ -2813,6 +2826,10 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2813 | if (mac->ops.init_hw(hw)) | 2826 | if (mac->ops.init_hw(hw)) |
2814 | e_err("Hardware Error\n"); | 2827 | e_err("Hardware Error\n"); |
2815 | 2828 | ||
2829 | /* additional part of the flow-control workaround above */ | ||
2830 | if (hw->mac.type == e1000_pchlan) | ||
2831 | ew32(FCRTV_PCH, 0x1000); | ||
2832 | |||
2816 | e1000_update_mng_vlan(adapter); | 2833 | e1000_update_mng_vlan(adapter); |
2817 | 2834 | ||
2818 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ | 2835 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ |
@@ -3610,7 +3627,7 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3610 | case SPEED_100: | 3627 | case SPEED_100: |
3611 | txb2b = 0; | 3628 | txb2b = 0; |
3612 | netdev->tx_queue_len = 100; | 3629 | netdev->tx_queue_len = 100; |
3613 | /* maybe add some timeout factor ? */ | 3630 | adapter->tx_timeout_factor = 10; |
3614 | break; | 3631 | break; |
3615 | } | 3632 | } |
3616 | 3633 | ||
@@ -4288,8 +4305,10 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
4288 | 4305 | ||
4289 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) | 4306 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) |
4290 | msleep(1); | 4307 | msleep(1); |
4291 | /* e1000e_down has a dependency on max_frame_size */ | 4308 | /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */ |
4292 | adapter->max_frame_size = max_frame; | 4309 | adapter->max_frame_size = max_frame; |
4310 | e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); | ||
4311 | netdev->mtu = new_mtu; | ||
4293 | if (netif_running(netdev)) | 4312 | if (netif_running(netdev)) |
4294 | e1000e_down(adapter); | 4313 | e1000e_down(adapter); |
4295 | 4314 | ||
@@ -4319,9 +4338,6 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
4319 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN | 4338 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN |
4320 | + ETH_FCS_LEN; | 4339 | + ETH_FCS_LEN; |
4321 | 4340 | ||
4322 | e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); | ||
4323 | netdev->mtu = new_mtu; | ||
4324 | |||
4325 | if (netif_running(netdev)) | 4341 | if (netif_running(netdev)) |
4326 | e1000e_up(adapter); | 4342 | e1000e_up(adapter); |
4327 | else | 4343 | else |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index f9d33ab05e97..85f955f70417 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -71,7 +71,6 @@ static const u16 e1000_igp_2_cable_length_table[] = | |||
71 | #define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15) | 71 | #define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15) |
72 | #define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */ | 72 | #define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */ |
73 | #define I82577_CTRL_REG 23 | 73 | #define I82577_CTRL_REG 23 |
74 | #define I82577_CTRL_DOWNSHIFT_MASK (7 << 10) | ||
75 | 74 | ||
76 | /* 82577 specific PHY registers */ | 75 | /* 82577 specific PHY registers */ |
77 | #define I82577_PHY_CTRL_2 18 | 76 | #define I82577_PHY_CTRL_2 18 |
@@ -95,13 +94,6 @@ static const u16 e1000_igp_2_cable_length_table[] = | |||
95 | /* BM PHY Copper Specific Control 1 */ | 94 | /* BM PHY Copper Specific Control 1 */ |
96 | #define BM_CS_CTRL1 16 | 95 | #define BM_CS_CTRL1 16 |
97 | 96 | ||
98 | /* BM PHY Copper Specific Status */ | ||
99 | #define BM_CS_STATUS 17 | ||
100 | #define BM_CS_STATUS_LINK_UP 0x0400 | ||
101 | #define BM_CS_STATUS_RESOLVED 0x0800 | ||
102 | #define BM_CS_STATUS_SPEED_MASK 0xC000 | ||
103 | #define BM_CS_STATUS_SPEED_1000 0x8000 | ||
104 | |||
105 | #define HV_MUX_DATA_CTRL PHY_REG(776, 16) | 97 | #define HV_MUX_DATA_CTRL PHY_REG(776, 16) |
106 | #define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400 | 98 | #define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400 |
107 | #define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004 | 99 | #define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004 |
@@ -563,7 +555,7 @@ s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data) | |||
563 | } | 555 | } |
564 | 556 | ||
565 | /** | 557 | /** |
566 | * e1000_read_kmrn_reg_locked - Read kumeran register | 558 | * e1000e_read_kmrn_reg_locked - Read kumeran register |
567 | * @hw: pointer to the HW structure | 559 | * @hw: pointer to the HW structure |
568 | * @offset: register offset to be read | 560 | * @offset: register offset to be read |
569 | * @data: pointer to the read data | 561 | * @data: pointer to the read data |
@@ -572,7 +564,7 @@ s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data) | |||
572 | * information retrieved is stored in data. | 564 | * information retrieved is stored in data. |
573 | * Assumes semaphore already acquired. | 565 | * Assumes semaphore already acquired. |
574 | **/ | 566 | **/ |
575 | s32 e1000_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data) | 567 | s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data) |
576 | { | 568 | { |
577 | return __e1000_read_kmrn_reg(hw, offset, data, true); | 569 | return __e1000_read_kmrn_reg(hw, offset, data, true); |
578 | } | 570 | } |
@@ -631,7 +623,7 @@ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data) | |||
631 | } | 623 | } |
632 | 624 | ||
633 | /** | 625 | /** |
634 | * e1000_write_kmrn_reg_locked - Write kumeran register | 626 | * e1000e_write_kmrn_reg_locked - Write kumeran register |
635 | * @hw: pointer to the HW structure | 627 | * @hw: pointer to the HW structure |
636 | * @offset: register offset to write to | 628 | * @offset: register offset to write to |
637 | * @data: data to write at register offset | 629 | * @data: data to write at register offset |
@@ -639,7 +631,7 @@ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data) | |||
639 | * Write the data to PHY register at the offset using the kumeran interface. | 631 | * Write the data to PHY register at the offset using the kumeran interface. |
640 | * Assumes semaphore already acquired. | 632 | * Assumes semaphore already acquired. |
641 | **/ | 633 | **/ |
642 | s32 e1000_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data) | 634 | s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data) |
643 | { | 635 | { |
644 | return __e1000_write_kmrn_reg(hw, offset, data, true); | 636 | return __e1000_write_kmrn_reg(hw, offset, data, true); |
645 | } | 637 | } |
@@ -667,15 +659,6 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw) | |||
667 | phy_data |= I82577_CFG_ENABLE_DOWNSHIFT; | 659 | phy_data |= I82577_CFG_ENABLE_DOWNSHIFT; |
668 | 660 | ||
669 | ret_val = phy->ops.write_phy_reg(hw, I82577_CFG_REG, phy_data); | 661 | ret_val = phy->ops.write_phy_reg(hw, I82577_CFG_REG, phy_data); |
670 | if (ret_val) | ||
671 | goto out; | ||
672 | |||
673 | /* Set number of link attempts before downshift */ | ||
674 | ret_val = phy->ops.read_phy_reg(hw, I82577_CTRL_REG, &phy_data); | ||
675 | if (ret_val) | ||
676 | goto out; | ||
677 | phy_data &= ~I82577_CTRL_DOWNSHIFT_MASK; | ||
678 | ret_val = phy->ops.write_phy_reg(hw, I82577_CTRL_REG, phy_data); | ||
679 | 662 | ||
680 | out: | 663 | out: |
681 | return ret_val; | 664 | return ret_val; |
@@ -2665,19 +2648,18 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2665 | page = 0; | 2648 | page = 0; |
2666 | 2649 | ||
2667 | if (reg > MAX_PHY_MULTI_PAGE_REG) { | 2650 | if (reg > MAX_PHY_MULTI_PAGE_REG) { |
2668 | if ((hw->phy.type != e1000_phy_82578) || | 2651 | u32 phy_addr = hw->phy.addr; |
2669 | ((reg != I82578_ADDR_REG) && | ||
2670 | (reg != I82578_ADDR_REG + 1))) { | ||
2671 | u32 phy_addr = hw->phy.addr; | ||
2672 | 2652 | ||
2673 | hw->phy.addr = 1; | 2653 | hw->phy.addr = 1; |
2674 | 2654 | ||
2675 | /* Page is shifted left, PHY expects (page x 32) */ | 2655 | /* Page is shifted left, PHY expects (page x 32) */ |
2676 | ret_val = e1000e_write_phy_reg_mdic(hw, | 2656 | ret_val = e1000e_write_phy_reg_mdic(hw, |
2677 | IGP01E1000_PHY_PAGE_SELECT, | 2657 | IGP01E1000_PHY_PAGE_SELECT, |
2678 | (page << IGP_PAGE_SHIFT)); | 2658 | (page << IGP_PAGE_SHIFT)); |
2679 | hw->phy.addr = phy_addr; | 2659 | hw->phy.addr = phy_addr; |
2680 | } | 2660 | |
2661 | if (ret_val) | ||
2662 | goto out; | ||
2681 | } | 2663 | } |
2682 | 2664 | ||
2683 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2665 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
@@ -2685,7 +2667,7 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2685 | out: | 2667 | out: |
2686 | /* Revert to MDIO fast mode, if applicable */ | 2668 | /* Revert to MDIO fast mode, if applicable */ |
2687 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | 2669 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) |
2688 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | 2670 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); |
2689 | 2671 | ||
2690 | if (!locked) | 2672 | if (!locked) |
2691 | hw->phy.ops.release_phy(hw); | 2673 | hw->phy.ops.release_phy(hw); |
@@ -2791,19 +2773,18 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2791 | } | 2773 | } |
2792 | 2774 | ||
2793 | if (reg > MAX_PHY_MULTI_PAGE_REG) { | 2775 | if (reg > MAX_PHY_MULTI_PAGE_REG) { |
2794 | if ((hw->phy.type != e1000_phy_82578) || | 2776 | u32 phy_addr = hw->phy.addr; |
2795 | ((reg != I82578_ADDR_REG) && | ||
2796 | (reg != I82578_ADDR_REG + 1))) { | ||
2797 | u32 phy_addr = hw->phy.addr; | ||
2798 | 2777 | ||
2799 | hw->phy.addr = 1; | 2778 | hw->phy.addr = 1; |
2800 | 2779 | ||
2801 | /* Page is shifted left, PHY expects (page x 32) */ | 2780 | /* Page is shifted left, PHY expects (page x 32) */ |
2802 | ret_val = e1000e_write_phy_reg_mdic(hw, | 2781 | ret_val = e1000e_write_phy_reg_mdic(hw, |
2803 | IGP01E1000_PHY_PAGE_SELECT, | 2782 | IGP01E1000_PHY_PAGE_SELECT, |
2804 | (page << IGP_PAGE_SHIFT)); | 2783 | (page << IGP_PAGE_SHIFT)); |
2805 | hw->phy.addr = phy_addr; | 2784 | hw->phy.addr = phy_addr; |
2806 | } | 2785 | |
2786 | if (ret_val) | ||
2787 | goto out; | ||
2807 | } | 2788 | } |
2808 | 2789 | ||
2809 | ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2790 | ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
@@ -2812,7 +2793,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2812 | out: | 2793 | out: |
2813 | /* Revert to MDIO fast mode, if applicable */ | 2794 | /* Revert to MDIO fast mode, if applicable */ |
2814 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | 2795 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) |
2815 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | 2796 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); |
2816 | 2797 | ||
2817 | if (!locked) | 2798 | if (!locked) |
2818 | hw->phy.ops.release_phy(hw); | 2799 | hw->phy.ops.release_phy(hw); |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index e1da4666f204..3116601dbfea 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5821,10 +5821,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5821 | dev->dev_addr); | 5821 | dev->dev_addr); |
5822 | dev_printk(KERN_ERR, &pci_dev->dev, | 5822 | dev_printk(KERN_ERR, &pci_dev->dev, |
5823 | "Please complain to your hardware vendor. Switching to a random MAC.\n"); | 5823 | "Please complain to your hardware vendor. Switching to a random MAC.\n"); |
5824 | dev->dev_addr[0] = 0x00; | 5824 | random_ether_addr(dev->dev_addr); |
5825 | dev->dev_addr[1] = 0x00; | ||
5826 | dev->dev_addr[2] = 0x6c; | ||
5827 | get_random_bytes(&dev->dev_addr[3], 3); | ||
5828 | } | 5825 | } |
5829 | 5826 | ||
5830 | dprintk(KERN_DEBUG "%s: MAC Address %pM\n", | 5827 | dprintk(KERN_DEBUG "%s: MAC Address %pM\n", |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index 6ac464866972..efbf67689eca 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
@@ -427,3 +427,4 @@ void fsl_pq_mdio_exit(void) | |||
427 | of_unregister_platform_driver(&fsl_pq_mdio_driver); | 427 | of_unregister_platform_driver(&fsl_pq_mdio_driver); |
428 | } | 428 | } |
429 | module_exit(fsl_pq_mdio_exit); | 429 | module_exit(fsl_pq_mdio_exit); |
430 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/ibm_newemac/emac.h b/drivers/net/ibm_newemac/emac.h index d34adf99fc6a..8a61b597a169 100644 --- a/drivers/net/ibm_newemac/emac.h +++ b/drivers/net/ibm_newemac/emac.h | |||
@@ -263,8 +263,8 @@ struct emac_regs { | |||
263 | 263 | ||
264 | 264 | ||
265 | /* EMACx_TRTR */ | 265 | /* EMACx_TRTR */ |
266 | #define EMAC_TRTR_SHIFT_EMAC4 27 | 266 | #define EMAC_TRTR_SHIFT_EMAC4 24 |
267 | #define EMAC_TRTR_SHIFT 24 | 267 | #define EMAC_TRTR_SHIFT 27 |
268 | 268 | ||
269 | /* EMAC specific TX descriptor control fields (write access) */ | 269 | /* EMAC specific TX descriptor control fields (write access) */ |
270 | #define EMAC_TX_CTRL_GFCS 0x0200 | 270 | #define EMAC_TX_CTRL_GFCS 0x0200 |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index cbb143ca1eb8..a456578b8578 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #include "ixgbe.h" | 45 | #include "ixgbe.h" |
46 | #include "ixgbe_common.h" | 46 | #include "ixgbe_common.h" |
47 | #include "ixgbe_dcb_82599.h" | ||
47 | 48 | ||
48 | char ixgbe_driver_name[] = "ixgbe"; | 49 | char ixgbe_driver_name[] = "ixgbe"; |
49 | static const char ixgbe_driver_string[] = | 50 | static const char ixgbe_driver_string[] = |
@@ -226,6 +227,56 @@ static void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *adapter, | |||
226 | /* tx_buffer_info must be completely set up in the transmit path */ | 227 | /* tx_buffer_info must be completely set up in the transmit path */ |
227 | } | 228 | } |
228 | 229 | ||
230 | /** | ||
231 | * ixgbe_tx_is_paused - check if the tx ring is paused | ||
232 | * @adapter: the ixgbe adapter | ||
233 | * @tx_ring: the corresponding tx_ring | ||
234 | * | ||
235 | * If not in DCB mode, checks TFCS.TXOFF, otherwise, find out the | ||
236 | * corresponding TC of this tx_ring when checking TFCS. | ||
237 | * | ||
238 | * Returns : true if paused | ||
239 | */ | ||
240 | static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter, | ||
241 | struct ixgbe_ring *tx_ring) | ||
242 | { | ||
243 | u32 txoff = IXGBE_TFCS_TXOFF; | ||
244 | |||
245 | #ifdef CONFIG_IXGBE_DCB | ||
246 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | ||
247 | int tc; | ||
248 | int reg_idx = tx_ring->reg_idx; | ||
249 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; | ||
250 | |||
251 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | ||
252 | tc = reg_idx >> 2; | ||
253 | txoff = IXGBE_TFCS_TXOFF0; | ||
254 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | ||
255 | tc = 0; | ||
256 | txoff = IXGBE_TFCS_TXOFF; | ||
257 | if (dcb_i == 8) { | ||
258 | /* TC0, TC1 */ | ||
259 | tc = reg_idx >> 5; | ||
260 | if (tc == 2) /* TC2, TC3 */ | ||
261 | tc += (reg_idx - 64) >> 4; | ||
262 | else if (tc == 3) /* TC4, TC5, TC6, TC7 */ | ||
263 | tc += 1 + ((reg_idx - 96) >> 3); | ||
264 | } else if (dcb_i == 4) { | ||
265 | /* TC0, TC1 */ | ||
266 | tc = reg_idx >> 6; | ||
267 | if (tc == 1) { | ||
268 | tc += (reg_idx - 64) >> 5; | ||
269 | if (tc == 2) /* TC2, TC3 */ | ||
270 | tc += (reg_idx - 96) >> 4; | ||
271 | } | ||
272 | } | ||
273 | } | ||
274 | txoff <<= tc; | ||
275 | } | ||
276 | #endif | ||
277 | return IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & txoff; | ||
278 | } | ||
279 | |||
229 | static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, | 280 | static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, |
230 | struct ixgbe_ring *tx_ring, | 281 | struct ixgbe_ring *tx_ring, |
231 | unsigned int eop) | 282 | unsigned int eop) |
@@ -237,7 +288,7 @@ static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, | |||
237 | adapter->detect_tx_hung = false; | 288 | adapter->detect_tx_hung = false; |
238 | if (tx_ring->tx_buffer_info[eop].time_stamp && | 289 | if (tx_ring->tx_buffer_info[eop].time_stamp && |
239 | time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) && | 290 | time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) && |
240 | !(IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF)) { | 291 | !ixgbe_tx_is_paused(adapter, tx_ring)) { |
241 | /* detected Tx unit hang */ | 292 | /* detected Tx unit hang */ |
242 | union ixgbe_adv_tx_desc *tx_desc; | 293 | union ixgbe_adv_tx_desc *tx_desc; |
243 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 294 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); |
@@ -412,19 +463,23 @@ static void ixgbe_update_tx_dca(struct ixgbe_adapter *adapter, | |||
412 | u32 txctrl; | 463 | u32 txctrl; |
413 | int cpu = get_cpu(); | 464 | int cpu = get_cpu(); |
414 | int q = tx_ring - adapter->tx_ring; | 465 | int q = tx_ring - adapter->tx_ring; |
466 | struct ixgbe_hw *hw = &adapter->hw; | ||
415 | 467 | ||
416 | if (tx_ring->cpu != cpu) { | 468 | if (tx_ring->cpu != cpu) { |
417 | txctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q)); | ||
418 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | 469 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { |
470 | txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(q)); | ||
419 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK; | 471 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK; |
420 | txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); | 472 | txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); |
473 | txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; | ||
474 | IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(q), txctrl); | ||
421 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | 475 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { |
476 | txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(q)); | ||
422 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599; | 477 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599; |
423 | txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) << | 478 | txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) << |
424 | IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599); | 479 | IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599); |
480 | txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; | ||
481 | IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(q), txctrl); | ||
425 | } | 482 | } |
426 | txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; | ||
427 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q), txctrl); | ||
428 | tx_ring->cpu = cpu; | 483 | tx_ring->cpu = cpu; |
429 | } | 484 | } |
430 | put_cpu(); | 485 | put_cpu(); |
@@ -1913,11 +1968,25 @@ static void ixgbe_configure_tx(struct ixgbe_adapter *adapter) | |||
1913 | break; | 1968 | break; |
1914 | } | 1969 | } |
1915 | } | 1970 | } |
1971 | |||
1916 | if (hw->mac.type == ixgbe_mac_82599EB) { | 1972 | if (hw->mac.type == ixgbe_mac_82599EB) { |
1973 | u32 rttdcs; | ||
1974 | |||
1975 | /* disable the arbiter while setting MTQC */ | ||
1976 | rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); | ||
1977 | rttdcs |= IXGBE_RTTDCS_ARBDIS; | ||
1978 | IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); | ||
1979 | |||
1917 | /* We enable 8 traffic classes, DCB only */ | 1980 | /* We enable 8 traffic classes, DCB only */ |
1918 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) | 1981 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) |
1919 | IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA | | 1982 | IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA | |
1920 | IXGBE_MTQC_8TC_8TQ)); | 1983 | IXGBE_MTQC_8TC_8TQ)); |
1984 | else | ||
1985 | IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); | ||
1986 | |||
1987 | /* re-eable the arbiter */ | ||
1988 | rttdcs &= ~IXGBE_RTTDCS_ARBDIS; | ||
1989 | IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); | ||
1921 | } | 1990 | } |
1922 | } | 1991 | } |
1923 | 1992 | ||
@@ -2471,7 +2540,10 @@ static void ixgbe_configure(struct ixgbe_adapter *adapter) | |||
2471 | ixgbe_restore_vlan(adapter); | 2540 | ixgbe_restore_vlan(adapter); |
2472 | #ifdef CONFIG_IXGBE_DCB | 2541 | #ifdef CONFIG_IXGBE_DCB |
2473 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 2542 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
2474 | netif_set_gso_max_size(netdev, 32768); | 2543 | if (hw->mac.type == ixgbe_mac_82598EB) |
2544 | netif_set_gso_max_size(netdev, 32768); | ||
2545 | else | ||
2546 | netif_set_gso_max_size(netdev, 65536); | ||
2475 | ixgbe_configure_dcb(adapter); | 2547 | ixgbe_configure_dcb(adapter); |
2476 | } else { | 2548 | } else { |
2477 | netif_set_gso_max_size(netdev, 65536); | 2549 | netif_set_gso_max_size(netdev, 65536); |
@@ -5922,6 +5994,7 @@ static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev) | |||
5922 | } else { | 5994 | } else { |
5923 | pci_set_master(pdev); | 5995 | pci_set_master(pdev); |
5924 | pci_restore_state(pdev); | 5996 | pci_restore_state(pdev); |
5997 | pci_save_state(pdev); | ||
5925 | 5998 | ||
5926 | pci_wake_from_d3(pdev, false); | 5999 | pci_wake_from_d3(pdev, false); |
5927 | 6000 | ||
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c index 0be14d702beb..c146304d8d6c 100644 --- a/drivers/net/ks8851_mll.c +++ b/drivers/net/ks8851_mll.c | |||
@@ -568,6 +568,16 @@ static inline void ks_outblk(struct ks_net *ks, u16 *wptr, u32 len) | |||
568 | iowrite16(*wptr++, ks->hw_addr); | 568 | iowrite16(*wptr++, ks->hw_addr); |
569 | } | 569 | } |
570 | 570 | ||
571 | static void ks_disable_int(struct ks_net *ks) | ||
572 | { | ||
573 | ks_wrreg16(ks, KS_IER, 0x0000); | ||
574 | } /* ks_disable_int */ | ||
575 | |||
576 | static void ks_enable_int(struct ks_net *ks) | ||
577 | { | ||
578 | ks_wrreg16(ks, KS_IER, ks->rc_ier); | ||
579 | } /* ks_enable_int */ | ||
580 | |||
571 | /** | 581 | /** |
572 | * ks_tx_fifo_space - return the available hardware buffer size. | 582 | * ks_tx_fifo_space - return the available hardware buffer size. |
573 | * @ks: The chip information | 583 | * @ks: The chip information |
@@ -681,6 +691,47 @@ static void ks_soft_reset(struct ks_net *ks, unsigned op) | |||
681 | } | 691 | } |
682 | 692 | ||
683 | 693 | ||
694 | void ks_enable_qmu(struct ks_net *ks) | ||
695 | { | ||
696 | u16 w; | ||
697 | |||
698 | w = ks_rdreg16(ks, KS_TXCR); | ||
699 | /* Enables QMU Transmit (TXCR). */ | ||
700 | ks_wrreg16(ks, KS_TXCR, w | TXCR_TXE); | ||
701 | |||
702 | /* | ||
703 | * RX Frame Count Threshold Enable and Auto-Dequeue RXQ Frame | ||
704 | * Enable | ||
705 | */ | ||
706 | |||
707 | w = ks_rdreg16(ks, KS_RXQCR); | ||
708 | ks_wrreg16(ks, KS_RXQCR, w | RXQCR_RXFCTE); | ||
709 | |||
710 | /* Enables QMU Receive (RXCR1). */ | ||
711 | w = ks_rdreg16(ks, KS_RXCR1); | ||
712 | ks_wrreg16(ks, KS_RXCR1, w | RXCR1_RXE); | ||
713 | ks->enabled = true; | ||
714 | } /* ks_enable_qmu */ | ||
715 | |||
716 | static void ks_disable_qmu(struct ks_net *ks) | ||
717 | { | ||
718 | u16 w; | ||
719 | |||
720 | w = ks_rdreg16(ks, KS_TXCR); | ||
721 | |||
722 | /* Disables QMU Transmit (TXCR). */ | ||
723 | w &= ~TXCR_TXE; | ||
724 | ks_wrreg16(ks, KS_TXCR, w); | ||
725 | |||
726 | /* Disables QMU Receive (RXCR1). */ | ||
727 | w = ks_rdreg16(ks, KS_RXCR1); | ||
728 | w &= ~RXCR1_RXE ; | ||
729 | ks_wrreg16(ks, KS_RXCR1, w); | ||
730 | |||
731 | ks->enabled = false; | ||
732 | |||
733 | } /* ks_disable_qmu */ | ||
734 | |||
684 | /** | 735 | /** |
685 | * ks_read_qmu - read 1 pkt data from the QMU. | 736 | * ks_read_qmu - read 1 pkt data from the QMU. |
686 | * @ks: The chip information | 737 | * @ks: The chip information |
@@ -752,7 +803,7 @@ static void ks_rcv(struct ks_net *ks, struct net_device *netdev) | |||
752 | (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { | 803 | (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { |
753 | skb_reserve(skb, 2); | 804 | skb_reserve(skb, 2); |
754 | /* read data block including CRC 4 bytes */ | 805 | /* read data block including CRC 4 bytes */ |
755 | ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len + 4); | 806 | ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len); |
756 | skb_put(skb, frame_hdr->len); | 807 | skb_put(skb, frame_hdr->len); |
757 | skb->dev = netdev; | 808 | skb->dev = netdev; |
758 | skb->protocol = eth_type_trans(skb, netdev); | 809 | skb->protocol = eth_type_trans(skb, netdev); |
@@ -861,7 +912,7 @@ static int ks_net_open(struct net_device *netdev) | |||
861 | ks_dbg(ks, "%s - entry\n", __func__); | 912 | ks_dbg(ks, "%s - entry\n", __func__); |
862 | 913 | ||
863 | /* reset the HW */ | 914 | /* reset the HW */ |
864 | err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, ks); | 915 | err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); |
865 | 916 | ||
866 | if (err) { | 917 | if (err) { |
867 | printk(KERN_ERR "Failed to request IRQ: %d: %d\n", | 918 | printk(KERN_ERR "Failed to request IRQ: %d: %d\n", |
@@ -869,6 +920,15 @@ static int ks_net_open(struct net_device *netdev) | |||
869 | return err; | 920 | return err; |
870 | } | 921 | } |
871 | 922 | ||
923 | /* wake up powermode to normal mode */ | ||
924 | ks_set_powermode(ks, PMECR_PM_NORMAL); | ||
925 | mdelay(1); /* wait for normal mode to take effect */ | ||
926 | |||
927 | ks_wrreg16(ks, KS_ISR, 0xffff); | ||
928 | ks_enable_int(ks); | ||
929 | ks_enable_qmu(ks); | ||
930 | netif_start_queue(ks->netdev); | ||
931 | |||
872 | if (netif_msg_ifup(ks)) | 932 | if (netif_msg_ifup(ks)) |
873 | ks_dbg(ks, "network device %s up\n", netdev->name); | 933 | ks_dbg(ks, "network device %s up\n", netdev->name); |
874 | 934 | ||
@@ -892,19 +952,14 @@ static int ks_net_stop(struct net_device *netdev) | |||
892 | 952 | ||
893 | netif_stop_queue(netdev); | 953 | netif_stop_queue(netdev); |
894 | 954 | ||
895 | kfree(ks->frame_head_info); | ||
896 | |||
897 | mutex_lock(&ks->lock); | 955 | mutex_lock(&ks->lock); |
898 | 956 | ||
899 | /* turn off the IRQs and ack any outstanding */ | 957 | /* turn off the IRQs and ack any outstanding */ |
900 | ks_wrreg16(ks, KS_IER, 0x0000); | 958 | ks_wrreg16(ks, KS_IER, 0x0000); |
901 | ks_wrreg16(ks, KS_ISR, 0xffff); | 959 | ks_wrreg16(ks, KS_ISR, 0xffff); |
902 | 960 | ||
903 | /* shutdown RX process */ | 961 | /* shutdown RX/TX QMU */ |
904 | ks_wrreg16(ks, KS_RXCR1, 0x0000); | 962 | ks_disable_qmu(ks); |
905 | |||
906 | /* shutdown TX process */ | ||
907 | ks_wrreg16(ks, KS_TXCR, 0x0000); | ||
908 | 963 | ||
909 | /* set powermode to soft power down to save power */ | 964 | /* set powermode to soft power down to save power */ |
910 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); | 965 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); |
@@ -929,17 +984,8 @@ static int ks_net_stop(struct net_device *netdev) | |||
929 | */ | 984 | */ |
930 | static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) | 985 | static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) |
931 | { | 986 | { |
932 | unsigned fid = ks->fid; | ||
933 | |||
934 | fid = ks->fid; | ||
935 | ks->fid = (ks->fid + 1) & TXFR_TXFID_MASK; | ||
936 | |||
937 | /* reduce the tx interrupt occurrances. */ | ||
938 | if (!fid) | ||
939 | fid |= TXFR_TXIC; /* irq on completion */ | ||
940 | |||
941 | /* start header at txb[0] to align txw entries */ | 987 | /* start header at txb[0] to align txw entries */ |
942 | ks->txh.txw[0] = cpu_to_le16(fid); | 988 | ks->txh.txw[0] = 0; |
943 | ks->txh.txw[1] = cpu_to_le16(len); | 989 | ks->txh.txw[1] = cpu_to_le16(len); |
944 | 990 | ||
945 | /* 1. set sudo-DMA mode */ | 991 | /* 1. set sudo-DMA mode */ |
@@ -957,16 +1003,6 @@ static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) | |||
957 | ; | 1003 | ; |
958 | } | 1004 | } |
959 | 1005 | ||
960 | static void ks_disable_int(struct ks_net *ks) | ||
961 | { | ||
962 | ks_wrreg16(ks, KS_IER, 0x0000); | ||
963 | } /* ks_disable_int */ | ||
964 | |||
965 | static void ks_enable_int(struct ks_net *ks) | ||
966 | { | ||
967 | ks_wrreg16(ks, KS_IER, ks->rc_ier); | ||
968 | } /* ks_enable_int */ | ||
969 | |||
970 | /** | 1006 | /** |
971 | * ks_start_xmit - transmit packet | 1007 | * ks_start_xmit - transmit packet |
972 | * @skb : The buffer to transmit | 1008 | * @skb : The buffer to transmit |
@@ -1410,25 +1446,6 @@ static int ks_read_selftest(struct ks_net *ks) | |||
1410 | return ret; | 1446 | return ret; |
1411 | } | 1447 | } |
1412 | 1448 | ||
1413 | static void ks_disable(struct ks_net *ks) | ||
1414 | { | ||
1415 | u16 w; | ||
1416 | |||
1417 | w = ks_rdreg16(ks, KS_TXCR); | ||
1418 | |||
1419 | /* Disables QMU Transmit (TXCR). */ | ||
1420 | w &= ~TXCR_TXE; | ||
1421 | ks_wrreg16(ks, KS_TXCR, w); | ||
1422 | |||
1423 | /* Disables QMU Receive (RXCR1). */ | ||
1424 | w = ks_rdreg16(ks, KS_RXCR1); | ||
1425 | w &= ~RXCR1_RXE ; | ||
1426 | ks_wrreg16(ks, KS_RXCR1, w); | ||
1427 | |||
1428 | ks->enabled = false; | ||
1429 | |||
1430 | } /* ks_disable */ | ||
1431 | |||
1432 | static void ks_setup(struct ks_net *ks) | 1449 | static void ks_setup(struct ks_net *ks) |
1433 | { | 1450 | { |
1434 | u16 w; | 1451 | u16 w; |
@@ -1463,7 +1480,7 @@ static void ks_setup(struct ks_net *ks) | |||
1463 | w = TXCR_TXFCE | TXCR_TXPE | TXCR_TXCRC | TXCR_TCGIP; | 1480 | w = TXCR_TXFCE | TXCR_TXPE | TXCR_TXCRC | TXCR_TCGIP; |
1464 | ks_wrreg16(ks, KS_TXCR, w); | 1481 | ks_wrreg16(ks, KS_TXCR, w); |
1465 | 1482 | ||
1466 | w = RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXUE; | 1483 | w = RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXUE | RXCR1_RXME | RXCR1_RXIPFCC; |
1467 | 1484 | ||
1468 | if (ks->promiscuous) /* bPromiscuous */ | 1485 | if (ks->promiscuous) /* bPromiscuous */ |
1469 | w |= (RXCR1_RXAE | RXCR1_RXINVF); | 1486 | w |= (RXCR1_RXAE | RXCR1_RXINVF); |
@@ -1486,28 +1503,6 @@ static void ks_setup_int(struct ks_net *ks) | |||
1486 | ks->rc_ier = (IRQ_LCI | IRQ_TXI | IRQ_RXI); | 1503 | ks->rc_ier = (IRQ_LCI | IRQ_TXI | IRQ_RXI); |
1487 | } /* ks_setup_int */ | 1504 | } /* ks_setup_int */ |
1488 | 1505 | ||
1489 | void ks_enable(struct ks_net *ks) | ||
1490 | { | ||
1491 | u16 w; | ||
1492 | |||
1493 | w = ks_rdreg16(ks, KS_TXCR); | ||
1494 | /* Enables QMU Transmit (TXCR). */ | ||
1495 | ks_wrreg16(ks, KS_TXCR, w | TXCR_TXE); | ||
1496 | |||
1497 | /* | ||
1498 | * RX Frame Count Threshold Enable and Auto-Dequeue RXQ Frame | ||
1499 | * Enable | ||
1500 | */ | ||
1501 | |||
1502 | w = ks_rdreg16(ks, KS_RXQCR); | ||
1503 | ks_wrreg16(ks, KS_RXQCR, w | RXQCR_RXFCTE); | ||
1504 | |||
1505 | /* Enables QMU Receive (RXCR1). */ | ||
1506 | w = ks_rdreg16(ks, KS_RXCR1); | ||
1507 | ks_wrreg16(ks, KS_RXCR1, w | RXCR1_RXE); | ||
1508 | ks->enabled = true; | ||
1509 | } /* ks_enable */ | ||
1510 | |||
1511 | static int ks_hw_init(struct ks_net *ks) | 1506 | static int ks_hw_init(struct ks_net *ks) |
1512 | { | 1507 | { |
1513 | #define MHEADER_SIZE (sizeof(struct type_frame_head) * MAX_RECV_FRAMES) | 1508 | #define MHEADER_SIZE (sizeof(struct type_frame_head) * MAX_RECV_FRAMES) |
@@ -1612,11 +1607,9 @@ static int __devinit ks8851_probe(struct platform_device *pdev) | |||
1612 | 1607 | ||
1613 | ks_soft_reset(ks, GRR_GSR); | 1608 | ks_soft_reset(ks, GRR_GSR); |
1614 | ks_hw_init(ks); | 1609 | ks_hw_init(ks); |
1615 | ks_disable(ks); | 1610 | ks_disable_qmu(ks); |
1616 | ks_setup(ks); | 1611 | ks_setup(ks); |
1617 | ks_setup_int(ks); | 1612 | ks_setup_int(ks); |
1618 | ks_enable_int(ks); | ||
1619 | ks_enable(ks); | ||
1620 | memcpy(netdev->dev_addr, ks->mac_addr, 6); | 1613 | memcpy(netdev->dev_addr, ks->mac_addr, 6); |
1621 | 1614 | ||
1622 | data = ks_rdreg16(ks, KS_OBCR); | 1615 | data = ks_rdreg16(ks, KS_OBCR); |
@@ -1658,6 +1651,7 @@ static int __devexit ks8851_remove(struct platform_device *pdev) | |||
1658 | struct ks_net *ks = netdev_priv(netdev); | 1651 | struct ks_net *ks = netdev_priv(netdev); |
1659 | struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1652 | struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1660 | 1653 | ||
1654 | kfree(ks->frame_head_info); | ||
1661 | unregister_netdev(netdev); | 1655 | unregister_netdev(netdev); |
1662 | iounmap(ks->hw_addr); | 1656 | iounmap(ks->hw_addr); |
1663 | free_netdev(netdev); | 1657 | free_netdev(netdev); |
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c index 61eabcac734c..b3d7d8d77f46 100644 --- a/drivers/net/macsonic.c +++ b/drivers/net/macsonic.c | |||
@@ -223,69 +223,73 @@ static int __devinit macsonic_init(struct net_device *dev) | |||
223 | return 0; | 223 | return 0; |
224 | } | 224 | } |
225 | 225 | ||
226 | static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) | 226 | #define INVALID_MAC(mac) (memcmp(mac, "\x08\x00\x07", 3) && \ |
227 | memcmp(mac, "\x00\xA0\x40", 3) && \ | ||
228 | memcmp(mac, "\x00\x80\x19", 3) && \ | ||
229 | memcmp(mac, "\x00\x05\x02", 3)) | ||
230 | |||
231 | static void __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) | ||
227 | { | 232 | { |
228 | struct sonic_local *lp = netdev_priv(dev); | 233 | struct sonic_local *lp = netdev_priv(dev); |
229 | const int prom_addr = ONBOARD_SONIC_PROM_BASE; | 234 | const int prom_addr = ONBOARD_SONIC_PROM_BASE; |
230 | int i; | 235 | unsigned short val; |
231 | 236 | ||
232 | /* On NuBus boards we can sometimes look in the ROM resources. | 237 | /* |
233 | No such luck for comm-slot/onboard. */ | 238 | * On NuBus boards we can sometimes look in the ROM resources. |
234 | for(i = 0; i < 6; i++) | 239 | * No such luck for comm-slot/onboard. |
235 | dev->dev_addr[i] = SONIC_READ_PROM(i); | 240 | * On the PowerBook 520, the PROM base address is a mystery. |
241 | */ | ||
242 | if (hwreg_present((void *)prom_addr)) { | ||
243 | int i; | ||
244 | |||
245 | for (i = 0; i < 6; i++) | ||
246 | dev->dev_addr[i] = SONIC_READ_PROM(i); | ||
247 | if (!INVALID_MAC(dev->dev_addr)) | ||
248 | return; | ||
236 | 249 | ||
237 | /* Most of the time, the address is bit-reversed. The NetBSD | 250 | /* |
238 | source has a rather long and detailed historical account of | 251 | * Most of the time, the address is bit-reversed. The NetBSD |
239 | why this is so. */ | 252 | * source has a rather long and detailed historical account of |
240 | if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && | 253 | * why this is so. |
241 | memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && | 254 | */ |
242 | memcmp(dev->dev_addr, "\x00\x80\x19", 3) && | ||
243 | memcmp(dev->dev_addr, "\x00\x05\x02", 3)) | ||
244 | bit_reverse_addr(dev->dev_addr); | 255 | bit_reverse_addr(dev->dev_addr); |
245 | else | 256 | if (!INVALID_MAC(dev->dev_addr)) |
246 | return 0; | 257 | return; |
247 | 258 | ||
248 | /* If we still have what seems to be a bogus address, we'll | ||
249 | look in the CAM. The top entry should be ours. */ | ||
250 | /* Danger! This only works if MacOS has already initialized | ||
251 | the card... */ | ||
252 | if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && | ||
253 | memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && | ||
254 | memcmp(dev->dev_addr, "\x00\x80\x19", 3) && | ||
255 | memcmp(dev->dev_addr, "\x00\x05\x02", 3)) | ||
256 | { | ||
257 | unsigned short val; | ||
258 | |||
259 | printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n"); | ||
260 | |||
261 | SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); | ||
262 | SONIC_WRITE(SONIC_CEP, 15); | ||
263 | |||
264 | val = SONIC_READ(SONIC_CAP2); | ||
265 | dev->dev_addr[5] = val >> 8; | ||
266 | dev->dev_addr[4] = val & 0xff; | ||
267 | val = SONIC_READ(SONIC_CAP1); | ||
268 | dev->dev_addr[3] = val >> 8; | ||
269 | dev->dev_addr[2] = val & 0xff; | ||
270 | val = SONIC_READ(SONIC_CAP0); | ||
271 | dev->dev_addr[1] = val >> 8; | ||
272 | dev->dev_addr[0] = val & 0xff; | ||
273 | |||
274 | printk(KERN_INFO "HW Address from CAM 15: %pM\n", | ||
275 | dev->dev_addr); | ||
276 | } else return 0; | ||
277 | |||
278 | if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && | ||
279 | memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && | ||
280 | memcmp(dev->dev_addr, "\x00\x80\x19", 3) && | ||
281 | memcmp(dev->dev_addr, "\x00\x05\x02", 3)) | ||
282 | { | ||
283 | /* | 259 | /* |
284 | * Still nonsense ... messed up someplace! | 260 | * If we still have what seems to be a bogus address, we'll |
261 | * look in the CAM. The top entry should be ours. | ||
285 | */ | 262 | */ |
286 | printk(KERN_ERR "macsonic: ERROR (INVALID MAC)\n"); | 263 | printk(KERN_WARNING "macsonic: MAC address in PROM seems " |
287 | return -EIO; | 264 | "to be invalid, trying CAM\n"); |
288 | } else return 0; | 265 | } else { |
266 | printk(KERN_WARNING "macsonic: cannot read MAC address from " | ||
267 | "PROM, trying CAM\n"); | ||
268 | } | ||
269 | |||
270 | /* This only works if MacOS has already initialized the card. */ | ||
271 | |||
272 | SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); | ||
273 | SONIC_WRITE(SONIC_CEP, 15); | ||
274 | |||
275 | val = SONIC_READ(SONIC_CAP2); | ||
276 | dev->dev_addr[5] = val >> 8; | ||
277 | dev->dev_addr[4] = val & 0xff; | ||
278 | val = SONIC_READ(SONIC_CAP1); | ||
279 | dev->dev_addr[3] = val >> 8; | ||
280 | dev->dev_addr[2] = val & 0xff; | ||
281 | val = SONIC_READ(SONIC_CAP0); | ||
282 | dev->dev_addr[1] = val >> 8; | ||
283 | dev->dev_addr[0] = val & 0xff; | ||
284 | |||
285 | if (!INVALID_MAC(dev->dev_addr)) | ||
286 | return; | ||
287 | |||
288 | /* Still nonsense ... messed up someplace! */ | ||
289 | |||
290 | printk(KERN_WARNING "macsonic: MAC address in CAM entry 15 " | ||
291 | "seems invalid, will use a random MAC\n"); | ||
292 | random_ether_addr(dev->dev_addr); | ||
289 | } | 293 | } |
290 | 294 | ||
291 | static int __devinit mac_onboard_sonic_probe(struct net_device *dev) | 295 | static int __devinit mac_onboard_sonic_probe(struct net_device *dev) |
@@ -402,8 +406,7 @@ static int __devinit mac_onboard_sonic_probe(struct net_device *dev) | |||
402 | SONIC_WRITE(SONIC_ISR, 0x7fff); | 406 | SONIC_WRITE(SONIC_ISR, 0x7fff); |
403 | 407 | ||
404 | /* Now look for the MAC address. */ | 408 | /* Now look for the MAC address. */ |
405 | if (mac_onboard_sonic_ethernet_addr(dev) != 0) | 409 | mac_onboard_sonic_ethernet_addr(dev); |
406 | return -ENODEV; | ||
407 | 410 | ||
408 | /* Shared init code */ | 411 | /* Shared init code */ |
409 | return macsonic_init(dev); | 412 | return macsonic_init(dev); |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 3aabfd9dd212..2490aa39804c 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -360,6 +360,7 @@ static int macvlan_init(struct net_device *dev) | |||
360 | dev->state = (dev->state & ~MACVLAN_STATE_MASK) | | 360 | dev->state = (dev->state & ~MACVLAN_STATE_MASK) | |
361 | (lowerdev->state & MACVLAN_STATE_MASK); | 361 | (lowerdev->state & MACVLAN_STATE_MASK); |
362 | dev->features = lowerdev->features & MACVLAN_FEATURES; | 362 | dev->features = lowerdev->features & MACVLAN_FEATURES; |
363 | dev->gso_max_size = lowerdev->gso_max_size; | ||
363 | dev->iflink = lowerdev->ifindex; | 364 | dev->iflink = lowerdev->ifindex; |
364 | dev->hard_header_len = lowerdev->hard_header_len; | 365 | dev->hard_header_len = lowerdev->hard_header_len; |
365 | 366 | ||
@@ -596,6 +597,7 @@ static int macvlan_device_event(struct notifier_block *unused, | |||
596 | case NETDEV_FEAT_CHANGE: | 597 | case NETDEV_FEAT_CHANGE: |
597 | list_for_each_entry(vlan, &port->vlans, list) { | 598 | list_for_each_entry(vlan, &port->vlans, list) { |
598 | vlan->dev->features = dev->features & MACVLAN_FEATURES; | 599 | vlan->dev->features = dev->features & MACVLAN_FEATURES; |
600 | vlan->dev->gso_max_size = dev->gso_max_size; | ||
599 | netdev_features_change(vlan->dev); | 601 | netdev_features_change(vlan->dev); |
600 | } | 602 | } |
601 | break; | 603 | break; |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 7384f59df615..e1237b802872 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1163,6 +1163,8 @@ struct netxen_adapter { | |||
1163 | u32 int_vec_bit; | 1163 | u32 int_vec_bit; |
1164 | u32 heartbit; | 1164 | u32 heartbit; |
1165 | 1165 | ||
1166 | u8 mac_addr[ETH_ALEN]; | ||
1167 | |||
1166 | struct netxen_adapter_stats stats; | 1168 | struct netxen_adapter_stats stats; |
1167 | 1169 | ||
1168 | struct netxen_recv_context recv_ctx; | 1170 | struct netxen_recv_context recv_ctx; |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index 1c46da632125..17bb3818d84e 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -545,6 +545,8 @@ enum { | |||
545 | #define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094) | 545 | #define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094) |
546 | #define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) | 546 | #define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) |
547 | #define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) | 547 | #define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) |
548 | #define NETXEN_NIU_FRAME_COUNT_SELECT (NETXEN_CRB_NIU + 0x000ac) | ||
549 | #define NETXEN_NIU_FRAME_COUNT (NETXEN_CRB_NIU + 0x000b0) | ||
548 | #define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) | 550 | #define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) |
549 | #define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c) | 551 | #define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c) |
550 | 552 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 3185a98b0917..52a3798d8d94 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -383,24 +383,51 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | |||
383 | 383 | ||
384 | int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | 384 | int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) |
385 | { | 385 | { |
386 | __u32 reg; | 386 | u32 mac_cfg; |
387 | u32 cnt = 0; | ||
388 | __u32 reg = 0x0200; | ||
387 | u32 port = adapter->physical_port; | 389 | u32 port = adapter->physical_port; |
390 | u16 board_type = adapter->ahw.board_type; | ||
388 | 391 | ||
389 | if (port > NETXEN_NIU_MAX_XG_PORTS) | 392 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
390 | return -EINVAL; | 393 | return -EINVAL; |
391 | 394 | ||
392 | reg = NXRD32(adapter, NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port)); | 395 | mac_cfg = NXRD32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port)); |
393 | if (mode == NETXEN_NIU_PROMISC_MODE) | 396 | mac_cfg &= ~0x4; |
394 | reg = (reg | 0x2000UL); | 397 | NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), mac_cfg); |
395 | else | ||
396 | reg = (reg & ~0x2000UL); | ||
397 | 398 | ||
398 | if (mode == NETXEN_NIU_ALLMULTI_MODE) | 399 | if ((board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) || |
399 | reg = (reg | 0x1000UL); | 400 | (board_type == NETXEN_BRDTYPE_P2_SB31_10G_HMEZ)) |
400 | else | 401 | reg = (0x20 << port); |
401 | reg = (reg & ~0x1000UL); | 402 | |
403 | NXWR32(adapter, NETXEN_NIU_FRAME_COUNT_SELECT, reg); | ||
404 | |||
405 | mdelay(10); | ||
406 | |||
407 | while (NXRD32(adapter, NETXEN_NIU_FRAME_COUNT) && ++cnt < 20) | ||
408 | mdelay(10); | ||
409 | |||
410 | if (cnt < 20) { | ||
411 | |||
412 | reg = NXRD32(adapter, | ||
413 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port)); | ||
414 | |||
415 | if (mode == NETXEN_NIU_PROMISC_MODE) | ||
416 | reg = (reg | 0x2000UL); | ||
417 | else | ||
418 | reg = (reg & ~0x2000UL); | ||
419 | |||
420 | if (mode == NETXEN_NIU_ALLMULTI_MODE) | ||
421 | reg = (reg | 0x1000UL); | ||
422 | else | ||
423 | reg = (reg & ~0x1000UL); | ||
424 | |||
425 | NXWR32(adapter, | ||
426 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg); | ||
427 | } | ||
402 | 428 | ||
403 | NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg); | 429 | mac_cfg |= 0x4; |
430 | NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), mac_cfg); | ||
404 | 431 | ||
405 | return 0; | 432 | return 0; |
406 | } | 433 | } |
@@ -436,7 +463,7 @@ netxen_nic_enable_mcast_filter(struct netxen_adapter *adapter) | |||
436 | { | 463 | { |
437 | u32 val = 0; | 464 | u32 val = 0; |
438 | u16 port = adapter->physical_port; | 465 | u16 port = adapter->physical_port; |
439 | u8 *addr = adapter->netdev->dev_addr; | 466 | u8 *addr = adapter->mac_addr; |
440 | 467 | ||
441 | if (adapter->mc_enabled) | 468 | if (adapter->mc_enabled) |
442 | return 0; | 469 | return 0; |
@@ -465,7 +492,7 @@ netxen_nic_disable_mcast_filter(struct netxen_adapter *adapter) | |||
465 | { | 492 | { |
466 | u32 val = 0; | 493 | u32 val = 0; |
467 | u16 port = adapter->physical_port; | 494 | u16 port = adapter->physical_port; |
468 | u8 *addr = adapter->netdev->dev_addr; | 495 | u8 *addr = adapter->mac_addr; |
469 | 496 | ||
470 | if (!adapter->mc_enabled) | 497 | if (!adapter->mc_enabled) |
471 | return 0; | 498 | return 0; |
@@ -660,7 +687,7 @@ void netxen_p3_nic_set_multi(struct net_device *netdev) | |||
660 | 687 | ||
661 | list_splice_tail_init(&adapter->mac_list, &del_list); | 688 | list_splice_tail_init(&adapter->mac_list, &del_list); |
662 | 689 | ||
663 | nx_p3_nic_add_mac(adapter, netdev->dev_addr, &del_list); | 690 | nx_p3_nic_add_mac(adapter, adapter->mac_addr, &del_list); |
664 | nx_p3_nic_add_mac(adapter, bcast_addr, &del_list); | 691 | nx_p3_nic_add_mac(adapter, bcast_addr, &del_list); |
665 | 692 | ||
666 | if (netdev->flags & IFF_PROMISC) { | 693 | if (netdev->flags & IFF_PROMISC) { |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index e40b914d6faf..8a0904368e08 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -544,6 +544,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
544 | continue; | 544 | continue; |
545 | if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ | 545 | if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ |
546 | continue; | 546 | continue; |
547 | if ((off & 0x0ff00000) == NETXEN_CRB_DDR_NET) | ||
548 | continue; | ||
547 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) | 549 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) |
548 | buf[i].data = 0x1020; | 550 | buf[i].data = 0x1020; |
549 | /* skip the function enable register */ | 551 | /* skip the function enable register */ |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 0b4a56a8c8d5..3bf78dbfbf0f 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -437,6 +437,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter) | |||
437 | netdev->dev_addr[i] = *(p + 5 - i); | 437 | netdev->dev_addr[i] = *(p + 5 - i); |
438 | 438 | ||
439 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); | 439 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); |
440 | memcpy(adapter->mac_addr, netdev->dev_addr, netdev->addr_len); | ||
440 | 441 | ||
441 | /* set station address */ | 442 | /* set station address */ |
442 | 443 | ||
@@ -459,6 +460,7 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p) | |||
459 | netxen_napi_disable(adapter); | 460 | netxen_napi_disable(adapter); |
460 | } | 461 | } |
461 | 462 | ||
463 | memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len); | ||
462 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 464 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); |
463 | adapter->macaddr_set(adapter, addr->sa_data); | 465 | adapter->macaddr_set(adapter, addr->sa_data); |
464 | 466 | ||
@@ -956,7 +958,7 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev) | |||
956 | return err; | 958 | return err; |
957 | } | 959 | } |
958 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) | 960 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) |
959 | adapter->macaddr_set(adapter, netdev->dev_addr); | 961 | adapter->macaddr_set(adapter, adapter->mac_addr); |
960 | 962 | ||
961 | adapter->set_multi(netdev); | 963 | adapter->set_multi(netdev); |
962 | adapter->set_mtu(adapter, netdev->mtu); | 964 | adapter->set_mtu(adapter, netdev->mtu); |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index bd3447f04902..94c9ad2746bc 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1760,7 +1760,7 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1760 | PCMCIA_DEVICE_CIS_MANF_CARD(0xc00f, 0x0002, "cis/LA-PCM.cis"), | 1760 | PCMCIA_DEVICE_CIS_MANF_CARD(0xc00f, 0x0002, "cis/LA-PCM.cis"), |
1761 | PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "PE520.cis"), | 1761 | PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "PE520.cis"), |
1762 | PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "cis/NE2K.cis"), | 1762 | PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "cis/NE2K.cis"), |
1763 | PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"), | 1763 | PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "cis/PE-200.cis"), |
1764 | PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "cis/tamarack.cis"), | 1764 | PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "cis/tamarack.cis"), |
1765 | PCMCIA_DEVICE_PROD_ID12("Ethernet", "CF Size PC Card", 0x00b2e941, 0x43ac239b), | 1765 | PCMCIA_DEVICE_PROD_ID12("Ethernet", "CF Size PC Card", 0x00b2e941, 0x43ac239b), |
1766 | PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0", | 1766 | PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0", |
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 8659d341e769..35897134a5dd 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
@@ -139,7 +139,7 @@ out: | |||
139 | return NULL; | 139 | return NULL; |
140 | } | 140 | } |
141 | 141 | ||
142 | static void __devinit mdio_gpio_bus_deinit(struct device *dev) | 142 | static void mdio_gpio_bus_deinit(struct device *dev) |
143 | { | 143 | { |
144 | struct mii_bus *bus = dev_get_drvdata(dev); | 144 | struct mii_bus *bus = dev_get_drvdata(dev); |
145 | struct mdio_gpio_info *bitbang = bus->priv; | 145 | struct mdio_gpio_info *bitbang = bus->priv; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 9bf2a6be9031..965adb6174c3 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -1944,8 +1944,15 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | |||
1944 | } | 1944 | } |
1945 | 1945 | ||
1946 | /* Pull completed packets off the queue and receive them. */ | 1946 | /* Pull completed packets off the queue and receive them. */ |
1947 | while ((skb = ppp_mp_reconstruct(ppp))) | 1947 | while ((skb = ppp_mp_reconstruct(ppp))) { |
1948 | ppp_receive_nonmp_frame(ppp, skb); | 1948 | if (pskb_may_pull(skb, 2)) |
1949 | ppp_receive_nonmp_frame(ppp, skb); | ||
1950 | else { | ||
1951 | ++ppp->dev->stats.rx_length_errors; | ||
1952 | kfree_skb(skb); | ||
1953 | ppp_receive_error(ppp); | ||
1954 | } | ||
1955 | } | ||
1949 | 1956 | ||
1950 | return; | 1957 | return; |
1951 | 1958 | ||
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index cea7531f4f40..a2fc70a0d0cc 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -3916,6 +3916,8 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
3916 | goto err_out; | 3916 | goto err_out; |
3917 | } | 3917 | } |
3918 | 3918 | ||
3919 | /* Set PCIe reset type for EEH to fundamental. */ | ||
3920 | pdev->needs_freset = 1; | ||
3919 | pci_save_state(pdev); | 3921 | pci_save_state(pdev); |
3920 | qdev->reg_base = | 3922 | qdev->reg_base = |
3921 | ioremap_nocache(pci_resource_start(pdev, 1), | 3923 | ioremap_nocache(pci_resource_start(pdev, 1), |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index bcf13c96f73f..aec05f266107 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -499,7 +499,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
499 | /* Wait for the interrupt to come in. */ | 499 | /* Wait for the interrupt to come in. */ |
500 | status = ql_wait_mbx_cmd_cmplt(qdev); | 500 | status = ql_wait_mbx_cmd_cmplt(qdev); |
501 | if (status) | 501 | if (status) |
502 | goto end; | 502 | continue; |
503 | 503 | ||
504 | /* Process the event. If it's an AEN, it | 504 | /* Process the event. If it's an AEN, it |
505 | * will be handled in-line or a worker | 505 | * will be handled in-line or a worker |
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index 7dfcb58b0eb4..8b14c6eda7c3 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -1085,7 +1085,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev, | |||
1085 | int bar = 0; | 1085 | int bar = 0; |
1086 | u16 *adrp; | 1086 | u16 *adrp; |
1087 | 1087 | ||
1088 | printk(KERN_INFO "%s\n", version); | 1088 | printk("%s\n", version); |
1089 | 1089 | ||
1090 | err = pci_enable_device(pdev); | 1090 | err = pci_enable_device(pdev); |
1091 | if (err) | 1091 | if (err) |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index f98ef523f525..0fe2fc90f207 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -3235,6 +3235,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
3235 | flush_scheduled_work(); | 3235 | flush_scheduled_work(); |
3236 | 3236 | ||
3237 | unregister_netdev(dev); | 3237 | unregister_netdev(dev); |
3238 | |||
3239 | /* restore original MAC address */ | ||
3240 | rtl_rar_set(tp, dev->perm_addr); | ||
3241 | |||
3238 | rtl_disable_msi(pdev, tp); | 3242 | rtl_disable_msi(pdev, tp); |
3239 | rtl8169_release_board(pdev, dev, tp->mmio_addr); | 3243 | rtl8169_release_board(pdev, dev, tp->mmio_addr); |
3240 | pci_set_drvdata(pdev, NULL); | 3244 | pci_set_drvdata(pdev, NULL); |
@@ -3243,9 +3247,9 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
3243 | static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, | 3247 | static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, |
3244 | struct net_device *dev) | 3248 | struct net_device *dev) |
3245 | { | 3249 | { |
3246 | unsigned int mtu = dev->mtu; | 3250 | unsigned int max_frame = dev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; |
3247 | 3251 | ||
3248 | tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; | 3252 | tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE; |
3249 | } | 3253 | } |
3250 | 3254 | ||
3251 | static int rtl8169_open(struct net_device *dev) | 3255 | static int rtl8169_open(struct net_device *dev) |
@@ -3379,7 +3383,7 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr) | |||
3379 | static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) | 3383 | static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) |
3380 | { | 3384 | { |
3381 | /* Low hurts. Let's disable the filtering. */ | 3385 | /* Low hurts. Let's disable the filtering. */ |
3382 | RTL_W16(RxMaxSize, rx_buf_sz); | 3386 | RTL_W16(RxMaxSize, rx_buf_sz + 1); |
3383 | } | 3387 | } |
3384 | 3388 | ||
3385 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | 3389 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) |
@@ -4881,6 +4885,9 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
4881 | 4885 | ||
4882 | rtl8169_net_suspend(dev); | 4886 | rtl8169_net_suspend(dev); |
4883 | 4887 | ||
4888 | /* restore original MAC address */ | ||
4889 | rtl_rar_set(tp, dev->perm_addr); | ||
4890 | |||
4884 | spin_lock_irq(&tp->lock); | 4891 | spin_lock_irq(&tp->lock); |
4885 | 4892 | ||
4886 | rtl8169_asic_down(ioaddr); | 4893 | rtl8169_asic_down(ioaddr); |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index ddccf5fa56b6..0dd7839322bc 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3494,6 +3494,7 @@ static void s2io_reset(struct s2io_nic *sp) | |||
3494 | 3494 | ||
3495 | /* Restore the PCI state saved during initialization. */ | 3495 | /* Restore the PCI state saved during initialization. */ |
3496 | pci_restore_state(sp->pdev); | 3496 | pci_restore_state(sp->pdev); |
3497 | pci_save_state(sp->pdev); | ||
3497 | pci_read_config_word(sp->pdev, 0x2, &val16); | 3498 | pci_read_config_word(sp->pdev, 0x2, &val16); |
3498 | if (check_pci_device_id(val16) != (u16)PCI_ANY_ID) | 3499 | if (check_pci_device_id(val16) != (u16)PCI_ANY_ID) |
3499 | break; | 3500 | break; |
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c index cee00ad49b57..49eb91b5f50c 100644 --- a/drivers/net/sfc/sfe4001.c +++ b/drivers/net/sfc/sfe4001.c | |||
@@ -188,7 +188,7 @@ static int sfn4111t_reset(struct efx_nic *efx) | |||
188 | efx_oword_t reg; | 188 | efx_oword_t reg; |
189 | 189 | ||
190 | /* GPIO 3 and the GPIO register are shared with I2C, so block that */ | 190 | /* GPIO 3 and the GPIO register are shared with I2C, so block that */ |
191 | mutex_lock(&efx->i2c_adap.bus_lock); | 191 | i2c_lock_adapter(&efx->i2c_adap); |
192 | 192 | ||
193 | /* Pull RST_N (GPIO 2) low then let it up again, setting the | 193 | /* Pull RST_N (GPIO 2) low then let it up again, setting the |
194 | * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the | 194 | * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the |
@@ -204,7 +204,7 @@ static int sfn4111t_reset(struct efx_nic *efx) | |||
204 | falcon_write(efx, ®, GPIO_CTL_REG_KER); | 204 | falcon_write(efx, ®, GPIO_CTL_REG_KER); |
205 | msleep(1); | 205 | msleep(1); |
206 | 206 | ||
207 | mutex_unlock(&efx->i2c_adap.bus_lock); | 207 | i2c_unlock_adapter(&efx->i2c_adap); |
208 | 208 | ||
209 | ssleep(1); | 209 | ssleep(1); |
210 | return 0; | 210 | return 0; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 2ab5c39f33ca..6a10d7ba5877 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -4538,6 +4538,8 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
4538 | goto err_out_free_netdev; | 4538 | goto err_out_free_netdev; |
4539 | } | 4539 | } |
4540 | 4540 | ||
4541 | netif_carrier_off(dev); | ||
4542 | |||
4541 | netif_napi_add(dev, &hw->napi, sky2_poll, NAPI_WEIGHT); | 4543 | netif_napi_add(dev, &hw->napi, sky2_poll, NAPI_WEIGHT); |
4542 | 4544 | ||
4543 | err = request_irq(pdev->irq, sky2_intr, | 4545 | err = request_irq(pdev->irq, sky2_intr, |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 05c91ee6921e..f12206bdbb75 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2283,7 +2283,7 @@ static int __devinit smc_drv_probe(struct platform_device *pdev) | |||
2283 | 2283 | ||
2284 | ndev->irq = ires->start; | 2284 | ndev->irq = ires->start; |
2285 | 2285 | ||
2286 | if (ires->flags & IRQF_TRIGGER_MASK) | 2286 | if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK) |
2287 | irq_flags = ires->flags & IRQF_TRIGGER_MASK; | 2287 | irq_flags = ires->flags & IRQF_TRIGGER_MASK; |
2288 | 2288 | ||
2289 | ret = smc_request_attrib(pdev, ndev); | 2289 | ret = smc_request_attrib(pdev, ndev); |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index ccdd196f5297..f9cdcbcb77d4 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -986,7 +986,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) | |||
986 | struct net_device *dev = pdata->dev; | 986 | struct net_device *dev = pdata->dev; |
987 | int npackets = 0; | 987 | int npackets = 0; |
988 | 988 | ||
989 | while (likely(netif_running(dev)) && (npackets < budget)) { | 989 | while (npackets < budget) { |
990 | unsigned int pktlength; | 990 | unsigned int pktlength; |
991 | unsigned int pktwords; | 991 | unsigned int pktwords; |
992 | struct sk_buff *skb; | 992 | struct sk_buff *skb; |
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c index b4909a2dec66..0f7909276237 100644 --- a/drivers/net/smsc9420.c +++ b/drivers/net/smsc9420.c | |||
@@ -252,6 +252,9 @@ static int smsc9420_ethtool_get_settings(struct net_device *dev, | |||
252 | { | 252 | { |
253 | struct smsc9420_pdata *pd = netdev_priv(dev); | 253 | struct smsc9420_pdata *pd = netdev_priv(dev); |
254 | 254 | ||
255 | if (!pd->phy_dev) | ||
256 | return -ENODEV; | ||
257 | |||
255 | cmd->maxtxpkt = 1; | 258 | cmd->maxtxpkt = 1; |
256 | cmd->maxrxpkt = 1; | 259 | cmd->maxrxpkt = 1; |
257 | return phy_ethtool_gset(pd->phy_dev, cmd); | 260 | return phy_ethtool_gset(pd->phy_dev, cmd); |
@@ -262,6 +265,9 @@ static int smsc9420_ethtool_set_settings(struct net_device *dev, | |||
262 | { | 265 | { |
263 | struct smsc9420_pdata *pd = netdev_priv(dev); | 266 | struct smsc9420_pdata *pd = netdev_priv(dev); |
264 | 267 | ||
268 | if (!pd->phy_dev) | ||
269 | return -ENODEV; | ||
270 | |||
265 | return phy_ethtool_sset(pd->phy_dev, cmd); | 271 | return phy_ethtool_sset(pd->phy_dev, cmd); |
266 | } | 272 | } |
267 | 273 | ||
@@ -290,6 +296,10 @@ static void smsc9420_ethtool_set_msglevel(struct net_device *netdev, u32 data) | |||
290 | static int smsc9420_ethtool_nway_reset(struct net_device *netdev) | 296 | static int smsc9420_ethtool_nway_reset(struct net_device *netdev) |
291 | { | 297 | { |
292 | struct smsc9420_pdata *pd = netdev_priv(netdev); | 298 | struct smsc9420_pdata *pd = netdev_priv(netdev); |
299 | |||
300 | if (!pd->phy_dev) | ||
301 | return -ENODEV; | ||
302 | |||
293 | return phy_start_aneg(pd->phy_dev); | 303 | return phy_start_aneg(pd->phy_dev); |
294 | } | 304 | } |
295 | 305 | ||
@@ -312,6 +322,10 @@ smsc9420_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs, | |||
312 | for (i = 0; i < 0x100; i += (sizeof(u32))) | 322 | for (i = 0; i < 0x100; i += (sizeof(u32))) |
313 | data[j++] = smsc9420_reg_read(pd, i); | 323 | data[j++] = smsc9420_reg_read(pd, i); |
314 | 324 | ||
325 | // cannot read phy registers if the net device is down | ||
326 | if (!phy_dev) | ||
327 | return; | ||
328 | |||
315 | for (i = 0; i <= 31; i++) | 329 | for (i = 0; i <= 31; i++) |
316 | data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i); | 330 | data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i); |
317 | } | 331 | } |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index c2f14dc9ba28..9542995ba667 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -416,13 +416,8 @@ static void init_dma_desc_rings(struct net_device *dev) | |||
416 | unsigned int txsize = priv->dma_tx_size; | 416 | unsigned int txsize = priv->dma_tx_size; |
417 | unsigned int rxsize = priv->dma_rx_size; | 417 | unsigned int rxsize = priv->dma_rx_size; |
418 | unsigned int bfsize = priv->dma_buf_sz; | 418 | unsigned int bfsize = priv->dma_buf_sz; |
419 | int buff2_needed = 0; | 419 | int buff2_needed = 0, dis_ic = 0; |
420 | int dis_ic = 0; | ||
421 | 420 | ||
422 | #ifdef CONFIG_STMMAC_TIMER | ||
423 | /* Using Timers disable interrupts on completion for the reception */ | ||
424 | dis_ic = 1; | ||
425 | #endif | ||
426 | /* Set the Buffer size according to the MTU; | 421 | /* Set the Buffer size according to the MTU; |
427 | * indeed, in case of jumbo we need to bump-up the buffer sizes. | 422 | * indeed, in case of jumbo we need to bump-up the buffer sizes. |
428 | */ | 423 | */ |
@@ -437,6 +432,11 @@ static void init_dma_desc_rings(struct net_device *dev) | |||
437 | else | 432 | else |
438 | bfsize = DMA_BUFFER_SIZE; | 433 | bfsize = DMA_BUFFER_SIZE; |
439 | 434 | ||
435 | #ifdef CONFIG_STMMAC_TIMER | ||
436 | /* Disable interrupts on completion for the reception if timer is on */ | ||
437 | if (likely(priv->tm->enable)) | ||
438 | dis_ic = 1; | ||
439 | #endif | ||
440 | /* If the MTU exceeds 8k so use the second buffer in the chain */ | 440 | /* If the MTU exceeds 8k so use the second buffer in the chain */ |
441 | if (bfsize >= BUF_SIZE_8KiB) | 441 | if (bfsize >= BUF_SIZE_8KiB) |
442 | buff2_needed = 1; | 442 | buff2_needed = 1; |
@@ -809,20 +809,22 @@ static void stmmac_tx(struct stmmac_priv *priv) | |||
809 | 809 | ||
810 | static inline void stmmac_enable_irq(struct stmmac_priv *priv) | 810 | static inline void stmmac_enable_irq(struct stmmac_priv *priv) |
811 | { | 811 | { |
812 | #ifndef CONFIG_STMMAC_TIMER | 812 | #ifdef CONFIG_STMMAC_TIMER |
813 | writel(DMA_INTR_DEFAULT_MASK, priv->dev->base_addr + DMA_INTR_ENA); | 813 | if (likely(priv->tm->enable)) |
814 | #else | 814 | priv->tm->timer_start(tmrate); |
815 | priv->tm->timer_start(tmrate); | 815 | else |
816 | #endif | 816 | #endif |
817 | writel(DMA_INTR_DEFAULT_MASK, priv->dev->base_addr + DMA_INTR_ENA); | ||
817 | } | 818 | } |
818 | 819 | ||
819 | static inline void stmmac_disable_irq(struct stmmac_priv *priv) | 820 | static inline void stmmac_disable_irq(struct stmmac_priv *priv) |
820 | { | 821 | { |
821 | #ifndef CONFIG_STMMAC_TIMER | 822 | #ifdef CONFIG_STMMAC_TIMER |
822 | writel(0, priv->dev->base_addr + DMA_INTR_ENA); | 823 | if (likely(priv->tm->enable)) |
823 | #else | 824 | priv->tm->timer_stop(); |
824 | priv->tm->timer_stop(); | 825 | else |
825 | #endif | 826 | #endif |
827 | writel(0, priv->dev->base_addr + DMA_INTR_ENA); | ||
826 | } | 828 | } |
827 | 829 | ||
828 | static int stmmac_has_work(struct stmmac_priv *priv) | 830 | static int stmmac_has_work(struct stmmac_priv *priv) |
@@ -1031,22 +1033,23 @@ static int stmmac_open(struct net_device *dev) | |||
1031 | } | 1033 | } |
1032 | 1034 | ||
1033 | #ifdef CONFIG_STMMAC_TIMER | 1035 | #ifdef CONFIG_STMMAC_TIMER |
1034 | priv->tm = kmalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); | 1036 | priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); |
1035 | if (unlikely(priv->tm == NULL)) { | 1037 | if (unlikely(priv->tm == NULL)) { |
1036 | pr_err("%s: ERROR: timer memory alloc failed \n", __func__); | 1038 | pr_err("%s: ERROR: timer memory alloc failed \n", __func__); |
1037 | return -ENOMEM; | 1039 | return -ENOMEM; |
1038 | } | 1040 | } |
1039 | priv->tm->freq = tmrate; | 1041 | priv->tm->freq = tmrate; |
1040 | 1042 | ||
1041 | /* Test if the HW timer can be actually used. | 1043 | /* Test if the external timer can be actually used. |
1042 | * In case of failure continue with no timer. */ | 1044 | * In case of failure continue without timer. */ |
1043 | if (unlikely((stmmac_open_ext_timer(dev, priv->tm)) < 0)) { | 1045 | if (unlikely((stmmac_open_ext_timer(dev, priv->tm)) < 0)) { |
1044 | pr_warning("stmmaceth: cannot attach the HW timer\n"); | 1046 | pr_warning("stmmaceth: cannot attach the external timer.\n"); |
1045 | tmrate = 0; | 1047 | tmrate = 0; |
1046 | priv->tm->freq = 0; | 1048 | priv->tm->freq = 0; |
1047 | priv->tm->timer_start = stmmac_no_timer_started; | 1049 | priv->tm->timer_start = stmmac_no_timer_started; |
1048 | priv->tm->timer_stop = stmmac_no_timer_stopped; | 1050 | priv->tm->timer_stop = stmmac_no_timer_stopped; |
1049 | } | 1051 | } else |
1052 | priv->tm->enable = 1; | ||
1050 | #endif | 1053 | #endif |
1051 | 1054 | ||
1052 | /* Create and initialize the TX/RX descriptors chains. */ | 1055 | /* Create and initialize the TX/RX descriptors chains. */ |
@@ -1322,9 +1325,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1322 | 1325 | ||
1323 | /* Interrupt on completition only for the latest segment */ | 1326 | /* Interrupt on completition only for the latest segment */ |
1324 | priv->mac_type->ops->close_tx_desc(desc); | 1327 | priv->mac_type->ops->close_tx_desc(desc); |
1328 | |||
1325 | #ifdef CONFIG_STMMAC_TIMER | 1329 | #ifdef CONFIG_STMMAC_TIMER |
1326 | /* Clean IC while using timers */ | 1330 | /* Clean IC while using timer */ |
1327 | priv->mac_type->ops->clear_tx_ic(desc); | 1331 | if (likely(priv->tm->enable)) |
1332 | priv->mac_type->ops->clear_tx_ic(desc); | ||
1328 | #endif | 1333 | #endif |
1329 | /* To avoid raise condition */ | 1334 | /* To avoid raise condition */ |
1330 | priv->mac_type->ops->set_tx_owner(first); | 1335 | priv->mac_type->ops->set_tx_owner(first); |
@@ -2028,7 +2033,8 @@ static int stmmac_suspend(struct platform_device *pdev, pm_message_t state) | |||
2028 | 2033 | ||
2029 | #ifdef CONFIG_STMMAC_TIMER | 2034 | #ifdef CONFIG_STMMAC_TIMER |
2030 | priv->tm->timer_stop(); | 2035 | priv->tm->timer_stop(); |
2031 | dis_ic = 1; | 2036 | if (likely(priv->tm->enable)) |
2037 | dis_ic = 1; | ||
2032 | #endif | 2038 | #endif |
2033 | napi_disable(&priv->napi); | 2039 | napi_disable(&priv->napi); |
2034 | 2040 | ||
diff --git a/drivers/net/stmmac/stmmac_timer.c b/drivers/net/stmmac/stmmac_timer.c index b838c6582077..679f61ffb1f8 100644 --- a/drivers/net/stmmac/stmmac_timer.c +++ b/drivers/net/stmmac/stmmac_timer.c | |||
@@ -63,7 +63,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) | |||
63 | 63 | ||
64 | stmmac_rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); | 64 | stmmac_rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); |
65 | if (stmmac_rtc == NULL) { | 65 | if (stmmac_rtc == NULL) { |
66 | pr_error("open rtc device failed\n"); | 66 | pr_err("open rtc device failed\n"); |
67 | return -ENODEV; | 67 | return -ENODEV; |
68 | } | 68 | } |
69 | 69 | ||
@@ -71,7 +71,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) | |||
71 | 71 | ||
72 | /* Periodic mode is not supported */ | 72 | /* Periodic mode is not supported */ |
73 | if ((rtc_irq_set_freq(stmmac_rtc, &stmmac_task, tm->freq) < 0)) { | 73 | if ((rtc_irq_set_freq(stmmac_rtc, &stmmac_task, tm->freq) < 0)) { |
74 | pr_error("set periodic failed\n"); | 74 | pr_err("set periodic failed\n"); |
75 | rtc_irq_unregister(stmmac_rtc, &stmmac_task); | 75 | rtc_irq_unregister(stmmac_rtc, &stmmac_task); |
76 | rtc_class_close(stmmac_rtc); | 76 | rtc_class_close(stmmac_rtc); |
77 | return -1; | 77 | return -1; |
diff --git a/drivers/net/stmmac/stmmac_timer.h b/drivers/net/stmmac/stmmac_timer.h index f795cae33725..6863590d184b 100644 --- a/drivers/net/stmmac/stmmac_timer.h +++ b/drivers/net/stmmac/stmmac_timer.h | |||
@@ -26,6 +26,7 @@ struct stmmac_timer { | |||
26 | void (*timer_start) (unsigned int new_freq); | 26 | void (*timer_start) (unsigned int new_freq); |
27 | void (*timer_stop) (void); | 27 | void (*timer_stop) (void); |
28 | unsigned int freq; | 28 | unsigned int freq; |
29 | unsigned int enable; | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | /* Open the HW timer device and return 0 in case of success */ | 32 | /* Open the HW timer device and return 0 in case of success */ |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 7019a0d1a82b..61640b99b705 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -2063,7 +2063,15 @@ static int gem_check_invariants(struct gem *gp) | |||
2063 | mif_cfg &= ~MIF_CFG_PSELECT; | 2063 | mif_cfg &= ~MIF_CFG_PSELECT; |
2064 | writel(mif_cfg, gp->regs + MIF_CFG); | 2064 | writel(mif_cfg, gp->regs + MIF_CFG); |
2065 | } else { | 2065 | } else { |
2066 | gp->phy_type = phy_serialink; | 2066 | #ifdef CONFIG_SPARC |
2067 | const char *p; | ||
2068 | |||
2069 | p = of_get_property(gp->of_node, "shared-pins", NULL); | ||
2070 | if (p && !strcmp(p, "serdes")) | ||
2071 | gp->phy_type = phy_serdes; | ||
2072 | else | ||
2073 | #endif | ||
2074 | gp->phy_type = phy_serialink; | ||
2067 | } | 2075 | } |
2068 | if (gp->phy_type == phy_mii_mdio1 || | 2076 | if (gp->phy_type == phy_mii_mdio1 || |
2069 | gp->phy_type == phy_mii_mdio0) { | 2077 | gp->phy_type == phy_mii_mdio0) { |
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 36cb2423bcf1..75fa32e34fd0 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -1144,9 +1144,16 @@ static void dir_open_adapter (struct net_device *dev) | |||
1144 | } else { | 1144 | } else { |
1145 | char **prphase = printphase; | 1145 | char **prphase = printphase; |
1146 | char **prerror = printerror; | 1146 | char **prerror = printerror; |
1147 | int pnr = err / 16 - 1; | ||
1148 | int enr = err % 16 - 1; | ||
1147 | DPRINTK("TR Adapter misc open failure, error code = "); | 1149 | DPRINTK("TR Adapter misc open failure, error code = "); |
1148 | printk("0x%x, Phase: %s, Error: %s\n", | 1150 | if (pnr < 0 || pnr >= ARRAY_SIZE(printphase) || |
1149 | err, prphase[err/16 -1], prerror[err%16 -1]); | 1151 | enr < 0 || |
1152 | enr >= ARRAY_SIZE(printerror)) | ||
1153 | printk("0x%x, invalid Phase/Error.", err); | ||
1154 | else | ||
1155 | printk("0x%x, Phase: %s, Error: %s\n", err, | ||
1156 | prphase[pnr], prerror[enr]); | ||
1150 | printk(" retrying after %ds delay...\n", | 1157 | printk(" retrying after %ds delay...\n", |
1151 | TR_RETRY_INTERVAL/HZ); | 1158 | TR_RETRY_INTERVAL/HZ); |
1152 | } | 1159 | } |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index c47237c2d638..32d93564a74d 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
@@ -174,7 +174,7 @@ config USB_NET_CDCETHER | |||
174 | * Ericsson Mobile Broadband Module (all variants) | 174 | * Ericsson Mobile Broadband Module (all variants) |
175 | * Motorola (DM100 and SB4100) | 175 | * Motorola (DM100 and SB4100) |
176 | * Broadcom Cable Modem (reference design) | 176 | * Broadcom Cable Modem (reference design) |
177 | * Toshiba (PCX1100U and F3507g) | 177 | * Toshiba (PCX1100U and F3507g/F3607gw) |
178 | * ... | 178 | * ... |
179 | 179 | ||
180 | This driver creates an interface named "ethX", where X depends on | 180 | This driver creates an interface named "ethX", where X depends on |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 4a6aff579403..21e1ba160008 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -544,20 +544,60 @@ static const struct usb_device_id products [] = { | |||
544 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 544 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
545 | .driver_info = (unsigned long) &cdc_info, | 545 | .driver_info = (unsigned long) &cdc_info, |
546 | }, { | 546 | }, { |
547 | /* Ericsson F3307 */ | 547 | /* Ericsson F3607gw ver 2 */ |
548 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1905, USB_CLASS_COMM, | ||
549 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
550 | .driver_info = (unsigned long) &cdc_info, | ||
551 | }, { | ||
552 | /* Ericsson F3607gw ver 3 */ | ||
548 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM, | 553 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM, |
549 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 554 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
550 | .driver_info = (unsigned long) &cdc_info, | 555 | .driver_info = (unsigned long) &cdc_info, |
551 | }, { | 556 | }, { |
557 | /* Ericsson F3307 */ | ||
558 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x190a, USB_CLASS_COMM, | ||
559 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
560 | .driver_info = (unsigned long) &cdc_info, | ||
561 | }, { | ||
562 | /* Ericsson F3307 ver 2 */ | ||
563 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1909, USB_CLASS_COMM, | ||
564 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
565 | .driver_info = (unsigned long) &cdc_info, | ||
566 | }, { | ||
567 | /* Ericsson C3607w */ | ||
568 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1049, USB_CLASS_COMM, | ||
569 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
570 | .driver_info = (unsigned long) &cdc_info, | ||
571 | }, { | ||
552 | /* Toshiba F3507g */ | 572 | /* Toshiba F3507g */ |
553 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM, | 573 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM, |
554 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 574 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
555 | .driver_info = (unsigned long) &cdc_info, | 575 | .driver_info = (unsigned long) &cdc_info, |
556 | }, { | 576 | }, { |
577 | /* Toshiba F3607gw */ | ||
578 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130c, USB_CLASS_COMM, | ||
579 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
580 | .driver_info = (unsigned long) &cdc_info, | ||
581 | }, { | ||
582 | /* Toshiba F3607gw ver 2 */ | ||
583 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x1311, USB_CLASS_COMM, | ||
584 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
585 | .driver_info = (unsigned long) &cdc_info, | ||
586 | }, { | ||
557 | /* Dell F3507g */ | 587 | /* Dell F3507g */ |
558 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM, | 588 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM, |
559 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 589 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
560 | .driver_info = (unsigned long) &cdc_info, | 590 | .driver_info = (unsigned long) &cdc_info, |
591 | }, { | ||
592 | /* Dell F3607gw */ | ||
593 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8183, USB_CLASS_COMM, | ||
594 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
595 | .driver_info = (unsigned long) &cdc_info, | ||
596 | }, { | ||
597 | /* Dell F3607gw ver 2 */ | ||
598 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8184, USB_CLASS_COMM, | ||
599 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
600 | .driver_info = (unsigned long) &cdc_info, | ||
561 | }, | 601 | }, |
562 | { }, // END | 602 | { }, // END |
563 | }; | 603 | }; |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index fa4e58196c21..43bc3fcc0d85 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -378,7 +378,7 @@ static void dbg_dump(int line_count, const char *func_name, unsigned char *buf, | |||
378 | } | 378 | } |
379 | 379 | ||
380 | #define DUMP(buf_, len_) \ | 380 | #define DUMP(buf_, len_) \ |
381 | dbg_dump(__LINE__, __func__, buf_, len_) | 381 | dbg_dump(__LINE__, __func__, (unsigned char *)buf_, len_) |
382 | 382 | ||
383 | #define DUMP1(buf_, len_) \ | 383 | #define DUMP1(buf_, len_) \ |
384 | do { \ | 384 | do { \ |
@@ -1363,7 +1363,7 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) | |||
1363 | /* reset the rts and dtr */ | 1363 | /* reset the rts and dtr */ |
1364 | /* do the actual close */ | 1364 | /* do the actual close */ |
1365 | serial->open_count--; | 1365 | serial->open_count--; |
1366 | kref_put(&serial->parent->ref, hso_serial_ref_free); | 1366 | |
1367 | if (serial->open_count <= 0) { | 1367 | if (serial->open_count <= 0) { |
1368 | serial->open_count = 0; | 1368 | serial->open_count = 0; |
1369 | spin_lock_irq(&serial->serial_lock); | 1369 | spin_lock_irq(&serial->serial_lock); |
@@ -1383,6 +1383,8 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) | |||
1383 | usb_autopm_put_interface(serial->parent->interface); | 1383 | usb_autopm_put_interface(serial->parent->interface); |
1384 | 1384 | ||
1385 | mutex_unlock(&serial->parent->mutex); | 1385 | mutex_unlock(&serial->parent->mutex); |
1386 | |||
1387 | kref_put(&serial->parent->ref, hso_serial_ref_free); | ||
1386 | } | 1388 | } |
1387 | 1389 | ||
1388 | /* close the requested serial port */ | 1390 | /* close the requested serial port */ |
@@ -1527,7 +1529,7 @@ static void tiocmget_intr_callback(struct urb *urb) | |||
1527 | dev_warn(&usb->dev, | 1529 | dev_warn(&usb->dev, |
1528 | "hso received invalid serial state notification\n"); | 1530 | "hso received invalid serial state notification\n"); |
1529 | DUMP(serial_state_notification, | 1531 | DUMP(serial_state_notification, |
1530 | sizeof(hso_serial_state_notifation)) | 1532 | sizeof(struct hso_serial_state_notification)); |
1531 | } else { | 1533 | } else { |
1532 | 1534 | ||
1533 | UART_state_bitmap = le16_to_cpu(serial_state_notification-> | 1535 | UART_state_bitmap = le16_to_cpu(serial_state_notification-> |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index ade5b344f75d..52af5017c46b 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -210,32 +210,29 @@ rx_drop: | |||
210 | static struct net_device_stats *veth_get_stats(struct net_device *dev) | 210 | static struct net_device_stats *veth_get_stats(struct net_device *dev) |
211 | { | 211 | { |
212 | struct veth_priv *priv; | 212 | struct veth_priv *priv; |
213 | struct net_device_stats *dev_stats; | ||
214 | int cpu; | 213 | int cpu; |
215 | struct veth_net_stats *stats; | 214 | struct veth_net_stats *stats, total = {0}; |
216 | 215 | ||
217 | priv = netdev_priv(dev); | 216 | priv = netdev_priv(dev); |
218 | dev_stats = &dev->stats; | ||
219 | |||
220 | dev_stats->rx_packets = 0; | ||
221 | dev_stats->tx_packets = 0; | ||
222 | dev_stats->rx_bytes = 0; | ||
223 | dev_stats->tx_bytes = 0; | ||
224 | dev_stats->tx_dropped = 0; | ||
225 | dev_stats->rx_dropped = 0; | ||
226 | 217 | ||
227 | for_each_online_cpu(cpu) { | 218 | for_each_possible_cpu(cpu) { |
228 | stats = per_cpu_ptr(priv->stats, cpu); | 219 | stats = per_cpu_ptr(priv->stats, cpu); |
229 | 220 | ||
230 | dev_stats->rx_packets += stats->rx_packets; | 221 | total.rx_packets += stats->rx_packets; |
231 | dev_stats->tx_packets += stats->tx_packets; | 222 | total.tx_packets += stats->tx_packets; |
232 | dev_stats->rx_bytes += stats->rx_bytes; | 223 | total.rx_bytes += stats->rx_bytes; |
233 | dev_stats->tx_bytes += stats->tx_bytes; | 224 | total.tx_bytes += stats->tx_bytes; |
234 | dev_stats->tx_dropped += stats->tx_dropped; | 225 | total.tx_dropped += stats->tx_dropped; |
235 | dev_stats->rx_dropped += stats->rx_dropped; | 226 | total.rx_dropped += stats->rx_dropped; |
236 | } | 227 | } |
237 | 228 | dev->stats.rx_packets = total.rx_packets; | |
238 | return dev_stats; | 229 | dev->stats.tx_packets = total.tx_packets; |
230 | dev->stats.rx_bytes = total.rx_bytes; | ||
231 | dev->stats.tx_bytes = total.tx_bytes; | ||
232 | dev->stats.tx_dropped = total.tx_dropped; | ||
233 | dev->stats.rx_dropped = total.rx_dropped; | ||
234 | |||
235 | return &dev->stats; | ||
239 | } | 236 | } |
240 | 237 | ||
241 | static int veth_open(struct net_device *dev) | 238 | static int veth_open(struct net_device *dev) |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 05630f2f6930..b9e002fccbca 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -998,7 +998,7 @@ static unsigned int features[] = { | |||
998 | VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, | 998 | VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, |
999 | }; | 999 | }; |
1000 | 1000 | ||
1001 | static struct virtio_driver virtio_net = { | 1001 | static struct virtio_driver virtio_net_driver = { |
1002 | .feature_table = features, | 1002 | .feature_table = features, |
1003 | .feature_table_size = ARRAY_SIZE(features), | 1003 | .feature_table_size = ARRAY_SIZE(features), |
1004 | .driver.name = KBUILD_MODNAME, | 1004 | .driver.name = KBUILD_MODNAME, |
@@ -1011,12 +1011,12 @@ static struct virtio_driver virtio_net = { | |||
1011 | 1011 | ||
1012 | static int __init init(void) | 1012 | static int __init init(void) |
1013 | { | 1013 | { |
1014 | return register_virtio_driver(&virtio_net); | 1014 | return register_virtio_driver(&virtio_net_driver); |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | static void __exit fini(void) | 1017 | static void __exit fini(void) |
1018 | { | 1018 | { |
1019 | unregister_virtio_driver(&virtio_net); | 1019 | unregister_virtio_driver(&virtio_net_driver); |
1020 | } | 1020 | } |
1021 | module_init(init); | 1021 | module_init(init); |
1022 | module_exit(fini); | 1022 | module_exit(fini); |
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index e2c33c06190b..8e25ca7080c7 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -907,6 +907,7 @@ static ssize_t cosa_write(struct file *file, | |||
907 | current->state = TASK_RUNNING; | 907 | current->state = TASK_RUNNING; |
908 | chan->tx_status = 1; | 908 | chan->tx_status = 1; |
909 | spin_unlock_irqrestore(&cosa->lock, flags); | 909 | spin_unlock_irqrestore(&cosa->lock, flags); |
910 | up(&chan->wsem); | ||
910 | return -ERESTARTSYS; | 911 | return -ERESTARTSYS; |
911 | } | 912 | } |
912 | } | 913 | } |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 9c6ab5378f6e..95a8e232b58f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -1125,7 +1125,6 @@ ath5k_mode_setup(struct ath5k_softc *sc) | |||
1125 | /* configure operational mode */ | 1125 | /* configure operational mode */ |
1126 | ath5k_hw_set_opmode(ah); | 1126 | ath5k_hw_set_opmode(ah); |
1127 | 1127 | ||
1128 | ath5k_hw_set_mcast_filter(ah, 0, 0); | ||
1129 | ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt); | 1128 | ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt); |
1130 | } | 1129 | } |
1131 | 1130 | ||
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c index b767c3b67b24..b548c8eaaae1 100644 --- a/drivers/net/wireless/ath/ath5k/led.c +++ b/drivers/net/wireless/ath/ath5k/led.c | |||
@@ -63,12 +63,16 @@ static const struct pci_device_id ath5k_led_devices[] = { | |||
63 | { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) }, | 63 | { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) }, |
64 | /* E-machines E510 (tuliom@gmail.com) */ | 64 | /* E-machines E510 (tuliom@gmail.com) */ |
65 | { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) }, | 65 | { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) }, |
66 | /* BenQ Joybook R55v (nowymarluk@wp.pl) */ | ||
67 | { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0100), ATH_LED(1, 0) }, | ||
66 | /* Acer Extensa 5620z (nekoreeve@gmail.com) */ | 68 | /* Acer Extensa 5620z (nekoreeve@gmail.com) */ |
67 | { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) }, | 69 | { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) }, |
68 | /* Fukato Datacask Jupiter 1014a (mrb74@gmx.at) */ | 70 | /* Fukato Datacask Jupiter 1014a (mrb74@gmx.at) */ |
69 | { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) }, | 71 | { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) }, |
70 | /* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */ | 72 | /* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */ |
71 | { ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) }, | 73 | { ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) }, |
74 | /* HP Compaq CQ60-206US (ddreggors@jumptv.com) */ | ||
75 | { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) }, | ||
72 | /* HP Compaq C700 (nitrousnrg@gmail.com) */ | 76 | /* HP Compaq C700 (nitrousnrg@gmail.com) */ |
73 | { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) }, | 77 | { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) }, |
74 | /* IBM-specific AR5212 (all others) */ | 78 | /* IBM-specific AR5212 (all others) */ |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 52bed89063d4..43d2be9867fc 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1555,6 +1555,8 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
1555 | BIT(NL80211_IFTYPE_ADHOC) | | 1555 | BIT(NL80211_IFTYPE_ADHOC) | |
1556 | BIT(NL80211_IFTYPE_MESH_POINT); | 1556 | BIT(NL80211_IFTYPE_MESH_POINT); |
1557 | 1557 | ||
1558 | hw->wiphy->ps_default = false; | ||
1559 | |||
1558 | hw->queues = 4; | 1560 | hw->queues = 4; |
1559 | hw->max_rates = 4; | 1561 | hw->max_rates = 4; |
1560 | hw->channel_change_time = 5000; | 1562 | hw->channel_change_time = 5000; |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 16a271787b85..1895d63aad0a 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -679,7 +679,7 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc, | |||
679 | return rate; | 679 | return rate; |
680 | 680 | ||
681 | if (rate_table->info[rate].valid_single_stream && | 681 | if (rate_table->info[rate].valid_single_stream && |
682 | !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)); | 682 | !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)) |
683 | return rate; | 683 | return rate; |
684 | 684 | ||
685 | /* This should not happen */ | 685 | /* This should not happen */ |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 8701034569fa..de4e804bedf0 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct b43_wldev *dev, u16 cookie, int *slot) | |||
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static int dma_tx_fragment(struct b43_dmaring *ring, | 1159 | static int dma_tx_fragment(struct b43_dmaring *ring, |
1160 | struct sk_buff *skb) | 1160 | struct sk_buff **in_skb) |
1161 | { | 1161 | { |
1162 | struct sk_buff *skb = *in_skb; | ||
1162 | const struct b43_dma_ops *ops = ring->ops; | 1163 | const struct b43_dma_ops *ops = ring->ops; |
1163 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1164 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1164 | u8 *header; | 1165 | u8 *header; |
@@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1224 | } | 1225 | } |
1225 | 1226 | ||
1226 | memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); | 1227 | memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); |
1228 | memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb)); | ||
1229 | bounce_skb->dev = skb->dev; | ||
1230 | skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb)); | ||
1231 | info = IEEE80211_SKB_CB(bounce_skb); | ||
1232 | |||
1227 | dev_kfree_skb_any(skb); | 1233 | dev_kfree_skb_any(skb); |
1228 | skb = bounce_skb; | 1234 | skb = bounce_skb; |
1235 | *in_skb = bounce_skb; | ||
1229 | meta->skb = skb; | 1236 | meta->skb = skb; |
1230 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1237 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
1231 | if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { | 1238 | if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
@@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb) | |||
1355 | * static, so we don't need to store it per frame. */ | 1362 | * static, so we don't need to store it per frame. */ |
1356 | ring->queue_prio = skb_get_queue_mapping(skb); | 1363 | ring->queue_prio = skb_get_queue_mapping(skb); |
1357 | 1364 | ||
1358 | err = dma_tx_fragment(ring, skb); | 1365 | /* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing |
1366 | * into the skb data or cb now. */ | ||
1367 | hdr = NULL; | ||
1368 | info = NULL; | ||
1369 | err = dma_tx_fragment(ring, &skb); | ||
1359 | if (unlikely(err == -ENOKEY)) { | 1370 | if (unlikely(err == -ENOKEY)) { |
1360 | /* Drop this packet, as we don't have the encryption key | 1371 | /* Drop this packet, as we don't have the encryption key |
1361 | * anymore and must not transmit it unencrypted. */ | 1372 | * anymore and must not transmit it unencrypted. */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 86f35827f008..098dda1a67c1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -4521,9 +4521,8 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
4521 | { | 4521 | { |
4522 | struct b43_wl *wl = hw_to_b43_wl(hw); | 4522 | struct b43_wl *wl = hw_to_b43_wl(hw); |
4523 | 4523 | ||
4524 | mutex_lock(&wl->mutex); | 4524 | /* FIXME: add locking */ |
4525 | b43_update_templates(wl); | 4525 | b43_update_templates(wl); |
4526 | mutex_unlock(&wl->mutex); | ||
4527 | 4526 | ||
4528 | return 0; | 4527 | return 0; |
4529 | } | 4528 | } |
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 240cff1e6979..6e2fc0cb6f8a 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -6029,7 +6029,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, | |||
6029 | struct ipw2100_priv *priv; | 6029 | struct ipw2100_priv *priv; |
6030 | struct net_device *dev; | 6030 | struct net_device *dev; |
6031 | 6031 | ||
6032 | dev = alloc_ieee80211(sizeof(struct ipw2100_priv), 0); | 6032 | dev = alloc_ieee80211(sizeof(struct ipw2100_priv)); |
6033 | if (!dev) | 6033 | if (!dev) |
6034 | return NULL; | 6034 | return NULL; |
6035 | priv = libipw_priv(dev); | 6035 | priv = libipw_priv(dev); |
@@ -6342,7 +6342,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6342 | sysfs_remove_group(&pci_dev->dev.kobj, | 6342 | sysfs_remove_group(&pci_dev->dev.kobj, |
6343 | &ipw2100_attribute_group); | 6343 | &ipw2100_attribute_group); |
6344 | 6344 | ||
6345 | free_ieee80211(dev, 0); | 6345 | free_ieee80211(dev); |
6346 | pci_set_drvdata(pci_dev, NULL); | 6346 | pci_set_drvdata(pci_dev, NULL); |
6347 | } | 6347 | } |
6348 | 6348 | ||
@@ -6400,7 +6400,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) | |||
6400 | if (dev->base_addr) | 6400 | if (dev->base_addr) |
6401 | iounmap((void __iomem *)dev->base_addr); | 6401 | iounmap((void __iomem *)dev->base_addr); |
6402 | 6402 | ||
6403 | free_ieee80211(dev, 0); | 6403 | free_ieee80211(dev); |
6404 | } | 6404 | } |
6405 | 6405 | ||
6406 | pci_release_regions(pci_dev); | 6406 | pci_release_regions(pci_dev); |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 827824d45de9..a6ca536e44f8 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -104,25 +104,6 @@ static int antenna = CFG_SYS_ANTENNA_BOTH; | |||
104 | static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */ | 104 | static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */ |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | static struct ieee80211_rate ipw2200_rates[] = { | ||
108 | { .bitrate = 10 }, | ||
109 | { .bitrate = 20, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, | ||
110 | { .bitrate = 55, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, | ||
111 | { .bitrate = 110, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, | ||
112 | { .bitrate = 60 }, | ||
113 | { .bitrate = 90 }, | ||
114 | { .bitrate = 120 }, | ||
115 | { .bitrate = 180 }, | ||
116 | { .bitrate = 240 }, | ||
117 | { .bitrate = 360 }, | ||
118 | { .bitrate = 480 }, | ||
119 | { .bitrate = 540 } | ||
120 | }; | ||
121 | |||
122 | #define ipw2200_a_rates (ipw2200_rates + 4) | ||
123 | #define ipw2200_num_a_rates 8 | ||
124 | #define ipw2200_bg_rates (ipw2200_rates + 0) | ||
125 | #define ipw2200_num_bg_rates 12 | ||
126 | 107 | ||
127 | #ifdef CONFIG_IPW2200_QOS | 108 | #ifdef CONFIG_IPW2200_QOS |
128 | static int qos_enable = 0; | 109 | static int qos_enable = 0; |
@@ -8674,6 +8655,24 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option) | |||
8674 | * | 8655 | * |
8675 | */ | 8656 | */ |
8676 | 8657 | ||
8658 | static int ipw_wx_get_name(struct net_device *dev, | ||
8659 | struct iw_request_info *info, | ||
8660 | union iwreq_data *wrqu, char *extra) | ||
8661 | { | ||
8662 | struct ipw_priv *priv = libipw_priv(dev); | ||
8663 | mutex_lock(&priv->mutex); | ||
8664 | if (priv->status & STATUS_RF_KILL_MASK) | ||
8665 | strcpy(wrqu->name, "radio off"); | ||
8666 | else if (!(priv->status & STATUS_ASSOCIATED)) | ||
8667 | strcpy(wrqu->name, "unassociated"); | ||
8668 | else | ||
8669 | snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c", | ||
8670 | ipw_modes[priv->assoc_request.ieee_mode]); | ||
8671 | IPW_DEBUG_WX("Name: %s\n", wrqu->name); | ||
8672 | mutex_unlock(&priv->mutex); | ||
8673 | return 0; | ||
8674 | } | ||
8675 | |||
8677 | static int ipw_set_channel(struct ipw_priv *priv, u8 channel) | 8676 | static int ipw_set_channel(struct ipw_priv *priv, u8 channel) |
8678 | { | 8677 | { |
8679 | if (channel == 0) { | 8678 | if (channel == 0) { |
@@ -9973,7 +9972,7 @@ static int ipw_wx_sw_reset(struct net_device *dev, | |||
9973 | /* Rebase the WE IOCTLs to zero for the handler array */ | 9972 | /* Rebase the WE IOCTLs to zero for the handler array */ |
9974 | #define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] | 9973 | #define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] |
9975 | static iw_handler ipw_wx_handlers[] = { | 9974 | static iw_handler ipw_wx_handlers[] = { |
9976 | IW_IOCTL(SIOCGIWNAME) = (iw_handler) cfg80211_wext_giwname, | 9975 | IW_IOCTL(SIOCGIWNAME) = ipw_wx_get_name, |
9977 | IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq, | 9976 | IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq, |
9978 | IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq, | 9977 | IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq, |
9979 | IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode, | 9978 | IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode, |
@@ -11417,100 +11416,16 @@ static void ipw_bg_down(struct work_struct *work) | |||
11417 | /* Called by register_netdev() */ | 11416 | /* Called by register_netdev() */ |
11418 | static int ipw_net_init(struct net_device *dev) | 11417 | static int ipw_net_init(struct net_device *dev) |
11419 | { | 11418 | { |
11420 | int i, rc = 0; | ||
11421 | struct ipw_priv *priv = libipw_priv(dev); | 11419 | struct ipw_priv *priv = libipw_priv(dev); |
11422 | const struct libipw_geo *geo = libipw_get_geo(priv->ieee); | ||
11423 | struct wireless_dev *wdev = &priv->ieee->wdev; | ||
11424 | mutex_lock(&priv->mutex); | 11420 | mutex_lock(&priv->mutex); |
11425 | 11421 | ||
11426 | if (ipw_up(priv)) { | 11422 | if (ipw_up(priv)) { |
11427 | rc = -EIO; | 11423 | mutex_unlock(&priv->mutex); |
11428 | goto out; | 11424 | return -EIO; |
11429 | } | ||
11430 | |||
11431 | memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN); | ||
11432 | |||
11433 | /* fill-out priv->ieee->bg_band */ | ||
11434 | if (geo->bg_channels) { | ||
11435 | struct ieee80211_supported_band *bg_band = &priv->ieee->bg_band; | ||
11436 | |||
11437 | bg_band->band = IEEE80211_BAND_2GHZ; | ||
11438 | bg_band->n_channels = geo->bg_channels; | ||
11439 | bg_band->channels = | ||
11440 | kzalloc(geo->bg_channels * | ||
11441 | sizeof(struct ieee80211_channel), GFP_KERNEL); | ||
11442 | /* translate geo->bg to bg_band.channels */ | ||
11443 | for (i = 0; i < geo->bg_channels; i++) { | ||
11444 | bg_band->channels[i].band = IEEE80211_BAND_2GHZ; | ||
11445 | bg_band->channels[i].center_freq = geo->bg[i].freq; | ||
11446 | bg_band->channels[i].hw_value = geo->bg[i].channel; | ||
11447 | bg_band->channels[i].max_power = geo->bg[i].max_power; | ||
11448 | if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY) | ||
11449 | bg_band->channels[i].flags |= | ||
11450 | IEEE80211_CHAN_PASSIVE_SCAN; | ||
11451 | if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS) | ||
11452 | bg_band->channels[i].flags |= | ||
11453 | IEEE80211_CHAN_NO_IBSS; | ||
11454 | if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT) | ||
11455 | bg_band->channels[i].flags |= | ||
11456 | IEEE80211_CHAN_RADAR; | ||
11457 | /* No equivalent for LIBIPW_CH_80211H_RULES, | ||
11458 | LIBIPW_CH_UNIFORM_SPREADING, or | ||
11459 | LIBIPW_CH_B_ONLY... */ | ||
11460 | } | ||
11461 | /* point at bitrate info */ | ||
11462 | bg_band->bitrates = ipw2200_bg_rates; | ||
11463 | bg_band->n_bitrates = ipw2200_num_bg_rates; | ||
11464 | |||
11465 | wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = bg_band; | ||
11466 | } | ||
11467 | |||
11468 | /* fill-out priv->ieee->a_band */ | ||
11469 | if (geo->a_channels) { | ||
11470 | struct ieee80211_supported_band *a_band = &priv->ieee->a_band; | ||
11471 | |||
11472 | a_band->band = IEEE80211_BAND_5GHZ; | ||
11473 | a_band->n_channels = geo->a_channels; | ||
11474 | a_band->channels = | ||
11475 | kzalloc(geo->a_channels * | ||
11476 | sizeof(struct ieee80211_channel), GFP_KERNEL); | ||
11477 | /* translate geo->bg to a_band.channels */ | ||
11478 | for (i = 0; i < geo->a_channels; i++) { | ||
11479 | a_band->channels[i].band = IEEE80211_BAND_2GHZ; | ||
11480 | a_band->channels[i].center_freq = geo->a[i].freq; | ||
11481 | a_band->channels[i].hw_value = geo->a[i].channel; | ||
11482 | a_band->channels[i].max_power = geo->a[i].max_power; | ||
11483 | if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY) | ||
11484 | a_band->channels[i].flags |= | ||
11485 | IEEE80211_CHAN_PASSIVE_SCAN; | ||
11486 | if (geo->a[i].flags & LIBIPW_CH_NO_IBSS) | ||
11487 | a_band->channels[i].flags |= | ||
11488 | IEEE80211_CHAN_NO_IBSS; | ||
11489 | if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT) | ||
11490 | a_band->channels[i].flags |= | ||
11491 | IEEE80211_CHAN_RADAR; | ||
11492 | /* No equivalent for LIBIPW_CH_80211H_RULES, | ||
11493 | LIBIPW_CH_UNIFORM_SPREADING, or | ||
11494 | LIBIPW_CH_B_ONLY... */ | ||
11495 | } | ||
11496 | /* point at bitrate info */ | ||
11497 | a_band->bitrates = ipw2200_a_rates; | ||
11498 | a_band->n_bitrates = ipw2200_num_a_rates; | ||
11499 | |||
11500 | wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band; | ||
11501 | } | ||
11502 | |||
11503 | set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); | ||
11504 | |||
11505 | /* With that information in place, we can now register the wiphy... */ | ||
11506 | if (wiphy_register(wdev->wiphy)) { | ||
11507 | rc = -EIO; | ||
11508 | goto out; | ||
11509 | } | 11425 | } |
11510 | 11426 | ||
11511 | out: | ||
11512 | mutex_unlock(&priv->mutex); | 11427 | mutex_unlock(&priv->mutex); |
11513 | return rc; | 11428 | return 0; |
11514 | } | 11429 | } |
11515 | 11430 | ||
11516 | /* PCI driver stuff */ | 11431 | /* PCI driver stuff */ |
@@ -11641,7 +11556,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv) | |||
11641 | if (priv->prom_net_dev) | 11556 | if (priv->prom_net_dev) |
11642 | return -EPERM; | 11557 | return -EPERM; |
11643 | 11558 | ||
11644 | priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv), 1); | 11559 | priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv)); |
11645 | if (priv->prom_net_dev == NULL) | 11560 | if (priv->prom_net_dev == NULL) |
11646 | return -ENOMEM; | 11561 | return -ENOMEM; |
11647 | 11562 | ||
@@ -11660,7 +11575,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv) | |||
11660 | 11575 | ||
11661 | rc = register_netdev(priv->prom_net_dev); | 11576 | rc = register_netdev(priv->prom_net_dev); |
11662 | if (rc) { | 11577 | if (rc) { |
11663 | free_ieee80211(priv->prom_net_dev, 1); | 11578 | free_ieee80211(priv->prom_net_dev); |
11664 | priv->prom_net_dev = NULL; | 11579 | priv->prom_net_dev = NULL; |
11665 | return rc; | 11580 | return rc; |
11666 | } | 11581 | } |
@@ -11674,7 +11589,7 @@ static void ipw_prom_free(struct ipw_priv *priv) | |||
11674 | return; | 11589 | return; |
11675 | 11590 | ||
11676 | unregister_netdev(priv->prom_net_dev); | 11591 | unregister_netdev(priv->prom_net_dev); |
11677 | free_ieee80211(priv->prom_net_dev, 1); | 11592 | free_ieee80211(priv->prom_net_dev); |
11678 | 11593 | ||
11679 | priv->prom_net_dev = NULL; | 11594 | priv->prom_net_dev = NULL; |
11680 | } | 11595 | } |
@@ -11702,7 +11617,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11702 | struct ipw_priv *priv; | 11617 | struct ipw_priv *priv; |
11703 | int i; | 11618 | int i; |
11704 | 11619 | ||
11705 | net_dev = alloc_ieee80211(sizeof(struct ipw_priv), 0); | 11620 | net_dev = alloc_ieee80211(sizeof(struct ipw_priv)); |
11706 | if (net_dev == NULL) { | 11621 | if (net_dev == NULL) { |
11707 | err = -ENOMEM; | 11622 | err = -ENOMEM; |
11708 | goto out; | 11623 | goto out; |
@@ -11850,7 +11765,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11850 | pci_disable_device(pdev); | 11765 | pci_disable_device(pdev); |
11851 | pci_set_drvdata(pdev, NULL); | 11766 | pci_set_drvdata(pdev, NULL); |
11852 | out_free_ieee80211: | 11767 | out_free_ieee80211: |
11853 | free_ieee80211(priv->net_dev, 0); | 11768 | free_ieee80211(priv->net_dev); |
11854 | out: | 11769 | out: |
11855 | return err; | 11770 | return err; |
11856 | } | 11771 | } |
@@ -11917,7 +11832,7 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev) | |||
11917 | pci_release_regions(pdev); | 11832 | pci_release_regions(pdev); |
11918 | pci_disable_device(pdev); | 11833 | pci_disable_device(pdev); |
11919 | pci_set_drvdata(pdev, NULL); | 11834 | pci_set_drvdata(pdev, NULL); |
11920 | free_ieee80211(priv->net_dev, 0); | 11835 | free_ieee80211(priv->net_dev); |
11921 | free_firmware(); | 11836 | free_firmware(); |
11922 | } | 11837 | } |
11923 | 11838 | ||
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h index bf45391172f3..1e334ff6bd52 100644 --- a/drivers/net/wireless/ipw2x00/libipw.h +++ b/drivers/net/wireless/ipw2x00/libipw.h | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/ieee80211.h> | 31 | #include <linux/ieee80211.h> |
32 | 32 | ||
33 | #include <net/lib80211.h> | 33 | #include <net/lib80211.h> |
34 | #include <net/cfg80211.h> | ||
35 | 34 | ||
36 | #define LIBIPW_VERSION "git-1.1.13" | 35 | #define LIBIPW_VERSION "git-1.1.13" |
37 | 36 | ||
@@ -784,15 +783,12 @@ struct libipw_geo { | |||
784 | 783 | ||
785 | struct libipw_device { | 784 | struct libipw_device { |
786 | struct net_device *dev; | 785 | struct net_device *dev; |
787 | struct wireless_dev wdev; | ||
788 | struct libipw_security sec; | 786 | struct libipw_security sec; |
789 | 787 | ||
790 | /* Bookkeeping structures */ | 788 | /* Bookkeeping structures */ |
791 | struct libipw_stats ieee_stats; | 789 | struct libipw_stats ieee_stats; |
792 | 790 | ||
793 | struct libipw_geo geo; | 791 | struct libipw_geo geo; |
794 | struct ieee80211_supported_band bg_band; | ||
795 | struct ieee80211_supported_band a_band; | ||
796 | 792 | ||
797 | /* Probe / Beacon management */ | 793 | /* Probe / Beacon management */ |
798 | struct list_head network_free_list; | 794 | struct list_head network_free_list; |
@@ -1018,8 +1014,8 @@ static inline int libipw_is_cck_rate(u8 rate) | |||
1018 | } | 1014 | } |
1019 | 1015 | ||
1020 | /* ieee80211.c */ | 1016 | /* ieee80211.c */ |
1021 | extern void free_ieee80211(struct net_device *dev, int monitor); | 1017 | extern void free_ieee80211(struct net_device *dev); |
1022 | extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); | 1018 | extern struct net_device *alloc_ieee80211(int sizeof_priv); |
1023 | extern int libipw_change_mtu(struct net_device *dev, int new_mtu); | 1019 | extern int libipw_change_mtu(struct net_device *dev, int new_mtu); |
1024 | 1020 | ||
1025 | extern void libipw_networks_age(struct libipw_device *ieee, | 1021 | extern void libipw_networks_age(struct libipw_device *ieee, |
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c index a0e9f6aed7da..eb2b60834c17 100644 --- a/drivers/net/wireless/ipw2x00/libipw_module.c +++ b/drivers/net/wireless/ipw2x00/libipw_module.c | |||
@@ -62,9 +62,6 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); | |||
62 | MODULE_AUTHOR(DRV_COPYRIGHT); | 62 | MODULE_AUTHOR(DRV_COPYRIGHT); |
63 | MODULE_LICENSE("GPL"); | 63 | MODULE_LICENSE("GPL"); |
64 | 64 | ||
65 | struct cfg80211_ops libipw_config_ops = { }; | ||
66 | void *libipw_wiphy_privid = &libipw_wiphy_privid; | ||
67 | |||
68 | static int libipw_networks_allocate(struct libipw_device *ieee) | 65 | static int libipw_networks_allocate(struct libipw_device *ieee) |
69 | { | 66 | { |
70 | if (ieee->networks) | 67 | if (ieee->networks) |
@@ -143,7 +140,7 @@ int libipw_change_mtu(struct net_device *dev, int new_mtu) | |||
143 | } | 140 | } |
144 | EXPORT_SYMBOL(libipw_change_mtu); | 141 | EXPORT_SYMBOL(libipw_change_mtu); |
145 | 142 | ||
146 | struct net_device *alloc_ieee80211(int sizeof_priv, int monitor) | 143 | struct net_device *alloc_ieee80211(int sizeof_priv) |
147 | { | 144 | { |
148 | struct libipw_device *ieee; | 145 | struct libipw_device *ieee; |
149 | struct net_device *dev; | 146 | struct net_device *dev; |
@@ -160,31 +157,10 @@ struct net_device *alloc_ieee80211(int sizeof_priv, int monitor) | |||
160 | 157 | ||
161 | ieee->dev = dev; | 158 | ieee->dev = dev; |
162 | 159 | ||
163 | if (!monitor) { | ||
164 | ieee->wdev.wiphy = wiphy_new(&libipw_config_ops, 0); | ||
165 | if (!ieee->wdev.wiphy) { | ||
166 | LIBIPW_ERROR("Unable to allocate wiphy.\n"); | ||
167 | goto failed_free_netdev; | ||
168 | } | ||
169 | |||
170 | ieee->dev->ieee80211_ptr = &ieee->wdev; | ||
171 | ieee->wdev.iftype = NL80211_IFTYPE_STATION; | ||
172 | |||
173 | /* Fill-out wiphy structure bits we know... Not enough info | ||
174 | here to call set_wiphy_dev or set MAC address or channel info | ||
175 | -- have to do that in ->ndo_init... */ | ||
176 | ieee->wdev.wiphy->privid = libipw_wiphy_privid; | ||
177 | |||
178 | ieee->wdev.wiphy->max_scan_ssids = 1; | ||
179 | ieee->wdev.wiphy->max_scan_ie_len = 0; | ||
180 | ieee->wdev.wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | ||
181 | | BIT(NL80211_IFTYPE_ADHOC); | ||
182 | } | ||
183 | |||
184 | err = libipw_networks_allocate(ieee); | 160 | err = libipw_networks_allocate(ieee); |
185 | if (err) { | 161 | if (err) { |
186 | LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err); | 162 | LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err); |
187 | goto failed_free_wiphy; | 163 | goto failed_free_netdev; |
188 | } | 164 | } |
189 | libipw_networks_initialize(ieee); | 165 | libipw_networks_initialize(ieee); |
190 | 166 | ||
@@ -217,31 +193,19 @@ struct net_device *alloc_ieee80211(int sizeof_priv, int monitor) | |||
217 | 193 | ||
218 | return dev; | 194 | return dev; |
219 | 195 | ||
220 | failed_free_wiphy: | ||
221 | if (!monitor) | ||
222 | wiphy_free(ieee->wdev.wiphy); | ||
223 | failed_free_netdev: | 196 | failed_free_netdev: |
224 | free_netdev(dev); | 197 | free_netdev(dev); |
225 | failed: | 198 | failed: |
226 | return NULL; | 199 | return NULL; |
227 | } | 200 | } |
228 | 201 | ||
229 | void free_ieee80211(struct net_device *dev, int monitor) | 202 | void free_ieee80211(struct net_device *dev) |
230 | { | 203 | { |
231 | struct libipw_device *ieee = netdev_priv(dev); | 204 | struct libipw_device *ieee = netdev_priv(dev); |
232 | 205 | ||
233 | lib80211_crypt_info_free(&ieee->crypt_info); | 206 | lib80211_crypt_info_free(&ieee->crypt_info); |
234 | 207 | ||
235 | libipw_networks_free(ieee); | 208 | libipw_networks_free(ieee); |
236 | |||
237 | /* free cfg80211 resources */ | ||
238 | if (!monitor) { | ||
239 | wiphy_unregister(ieee->wdev.wiphy); | ||
240 | kfree(ieee->a_band.channels); | ||
241 | kfree(ieee->bg_band.channels); | ||
242 | wiphy_free(ieee->wdev.wiphy); | ||
243 | } | ||
244 | |||
245 | free_netdev(dev); | 209 | free_netdev(dev); |
246 | } | 210 | } |
247 | 211 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 2716b91ba9fa..950267ab556a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -161,5 +161,6 @@ struct iwl_cfg iwl1000_bgn_cfg = { | |||
161 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | 161 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, |
162 | .shadow_ram_support = false, | 162 | .shadow_ram_support = false, |
163 | .ht_greenfield_support = true, | 163 | .ht_greenfield_support = true, |
164 | .use_rts_for_ht = true, /* use rts/cts protection */ | ||
164 | }; | 165 | }; |
165 | 166 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index c295b8ee9228..1473452ba22f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -175,6 +175,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = { | |||
175 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 175 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
176 | .shadow_ram_support = true, | 176 | .shadow_ram_support = true, |
177 | .ht_greenfield_support = true, | 177 | .ht_greenfield_support = true, |
178 | .use_rts_for_ht = true, /* use rts/cts protection */ | ||
178 | }; | 179 | }; |
179 | 180 | ||
180 | /* | 181 | /* |
@@ -198,6 +199,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { | |||
198 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 199 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
199 | .shadow_ram_support = true, | 200 | .shadow_ram_support = true, |
200 | .ht_greenfield_support = true, | 201 | .ht_greenfield_support = true, |
202 | .use_rts_for_ht = true, /* use rts/cts protection */ | ||
201 | }; | 203 | }; |
202 | 204 | ||
203 | struct iwl_cfg iwl6050_2agn_cfg = { | 205 | struct iwl_cfg iwl6050_2agn_cfg = { |
@@ -218,6 +220,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
218 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 220 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
219 | .shadow_ram_support = true, | 221 | .shadow_ram_support = true, |
220 | .ht_greenfield_support = true, | 222 | .ht_greenfield_support = true, |
223 | .use_rts_for_ht = true, /* use rts/cts protection */ | ||
221 | }; | 224 | }; |
222 | 225 | ||
223 | struct iwl_cfg iwl6000_3agn_cfg = { | 226 | struct iwl_cfg iwl6000_3agn_cfg = { |
@@ -238,6 +241,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { | |||
238 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 241 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
239 | .shadow_ram_support = true, | 242 | .shadow_ram_support = true, |
240 | .ht_greenfield_support = true, | 243 | .ht_greenfield_support = true, |
244 | .use_rts_for_ht = true, /* use rts/cts protection */ | ||
241 | }; | 245 | }; |
242 | 246 | ||
243 | struct iwl_cfg iwl6050_3agn_cfg = { | 247 | struct iwl_cfg iwl6050_3agn_cfg = { |
@@ -258,6 +262,7 @@ struct iwl_cfg iwl6050_3agn_cfg = { | |||
258 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 262 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
259 | .shadow_ram_support = true, | 263 | .shadow_ram_support = true, |
260 | .ht_greenfield_support = true, | 264 | .ht_greenfield_support = true, |
265 | .use_rts_for_ht = true, /* use rts/cts protection */ | ||
261 | }; | 266 | }; |
262 | 267 | ||
263 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 268 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 346dc06fa7b7..81726ee32858 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -418,6 +418,15 @@ static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid, | |||
418 | else if (tid == IWL_AGG_ALL_TID) | 418 | else if (tid == IWL_AGG_ALL_TID) |
419 | for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) | 419 | for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) |
420 | rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); | 420 | rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); |
421 | if (priv->cfg->use_rts_for_ht) { | ||
422 | /* | ||
423 | * switch to RTS/CTS if it is the prefer protection method | ||
424 | * for HT traffic | ||
425 | */ | ||
426 | IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n"); | ||
427 | priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; | ||
428 | iwlcore_commit_rxon(priv); | ||
429 | } | ||
421 | } | 430 | } |
422 | 431 | ||
423 | static inline int get_num_of_ant_from_rate(u32 rate_n_flags) | 432 | static inline int get_num_of_ant_from_rate(u32 rate_n_flags) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index eaafae091f5b..921dc4a26fe2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -116,9 +116,6 @@ int iwl_commit_rxon(struct iwl_priv *priv) | |||
116 | 116 | ||
117 | /* always get timestamp with Rx frame */ | 117 | /* always get timestamp with Rx frame */ |
118 | priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK; | 118 | priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK; |
119 | /* allow CTS-to-self if possible. this is relevant only for | ||
120 | * 5000, but will not damage 4965 */ | ||
121 | priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; | ||
122 | 119 | ||
123 | ret = iwl_check_rxon_cmd(priv); | 120 | ret = iwl_check_rxon_cmd(priv); |
124 | if (ret) { | 121 | if (ret) { |
@@ -218,6 +215,13 @@ int iwl_commit_rxon(struct iwl_priv *priv) | |||
218 | "Could not send WEP static key.\n"); | 215 | "Could not send WEP static key.\n"); |
219 | } | 216 | } |
220 | 217 | ||
218 | /* | ||
219 | * allow CTS-to-self if possible for new association. | ||
220 | * this is relevant only for 5000 series and up, | ||
221 | * but will not damage 4965 | ||
222 | */ | ||
223 | priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; | ||
224 | |||
221 | /* Apply the new configuration | 225 | /* Apply the new configuration |
222 | * RXON assoc doesn't clear the station table in uCode, | 226 | * RXON assoc doesn't clear the station table in uCode, |
223 | */ | 227 | */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index e50103a956b1..7754538c2194 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -213,6 +213,7 @@ struct iwl_mod_params { | |||
213 | * @pa_type: used by 6000 series only to identify the type of Power Amplifier | 213 | * @pa_type: used by 6000 series only to identify the type of Power Amplifier |
214 | * @max_ll_items: max number of OTP blocks | 214 | * @max_ll_items: max number of OTP blocks |
215 | * @shadow_ram_support: shadow support for OTP memory | 215 | * @shadow_ram_support: shadow support for OTP memory |
216 | * @use_rts_for_ht: use rts/cts protection for HT traffic | ||
216 | * | 217 | * |
217 | * We enable the driver to be backward compatible wrt API version. The | 218 | * We enable the driver to be backward compatible wrt API version. The |
218 | * driver specifies which APIs it supports (with @ucode_api_max being the | 219 | * driver specifies which APIs it supports (with @ucode_api_max being the |
@@ -255,6 +256,7 @@ struct iwl_cfg { | |||
255 | const bool shadow_ram_support; | 256 | const bool shadow_ram_support; |
256 | const bool ht_greenfield_support; | 257 | const bool ht_greenfield_support; |
257 | const bool broken_powersave; | 258 | const bool broken_powersave; |
259 | bool use_rts_for_ht; | ||
258 | }; | 260 | }; |
259 | 261 | ||
260 | /*************************** | 262 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index fb9bcfa6d947..b7e196e3c8d3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -1277,8 +1277,16 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid) | |||
1277 | return -ENXIO; | 1277 | return -ENXIO; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | if (priv->stations[sta_id].tid[tid].agg.state == | ||
1281 | IWL_EMPTYING_HW_QUEUE_ADDBA) { | ||
1282 | IWL_DEBUG_HT(priv, "AGG stop before setup done\n"); | ||
1283 | ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, ra, tid); | ||
1284 | priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF; | ||
1285 | return 0; | ||
1286 | } | ||
1287 | |||
1280 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_ON) | 1288 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_ON) |
1281 | IWL_WARN(priv, "Stopping AGG while state not IWL_AGG_ON\n"); | 1289 | IWL_WARN(priv, "Stopping AGG while state not ON or starting\n"); |
1282 | 1290 | ||
1283 | tid_data = &priv->stations[sta_id].tid[tid]; | 1291 | tid_data = &priv->stations[sta_id].tid[tid]; |
1284 | ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4; | 1292 | ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4; |
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c index 039b555e4d76..53d56ab83c03 100644 --- a/drivers/net/wireless/libertas/ethtool.c +++ b/drivers/net/wireless/libertas/ethtool.c | |||
@@ -169,16 +169,19 @@ static int lbs_ethtool_set_wol(struct net_device *dev, | |||
169 | struct lbs_private *priv = dev->ml_priv; | 169 | struct lbs_private *priv = dev->ml_priv; |
170 | uint32_t criteria = 0; | 170 | uint32_t criteria = 0; |
171 | 171 | ||
172 | if (priv->wol_criteria == 0xffffffff && wol->wolopts) | ||
173 | return -EOPNOTSUPP; | ||
174 | |||
175 | if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY)) | 172 | if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY)) |
176 | return -EOPNOTSUPP; | 173 | return -EOPNOTSUPP; |
177 | 174 | ||
178 | if (wol->wolopts & WAKE_UCAST) criteria |= EHS_WAKE_ON_UNICAST_DATA; | 175 | if (wol->wolopts & WAKE_UCAST) |
179 | if (wol->wolopts & WAKE_MCAST) criteria |= EHS_WAKE_ON_MULTICAST_DATA; | 176 | criteria |= EHS_WAKE_ON_UNICAST_DATA; |
180 | if (wol->wolopts & WAKE_BCAST) criteria |= EHS_WAKE_ON_BROADCAST_DATA; | 177 | if (wol->wolopts & WAKE_MCAST) |
181 | if (wol->wolopts & WAKE_PHY) criteria |= EHS_WAKE_ON_MAC_EVENT; | 178 | criteria |= EHS_WAKE_ON_MULTICAST_DATA; |
179 | if (wol->wolopts & WAKE_BCAST) | ||
180 | criteria |= EHS_WAKE_ON_BROADCAST_DATA; | ||
181 | if (wol->wolopts & WAKE_PHY) | ||
182 | criteria |= EHS_WAKE_ON_MAC_EVENT; | ||
183 | if (wol->wolopts == 0) | ||
184 | criteria |= EHS_REMOVE_WAKEUP; | ||
182 | 185 | ||
183 | return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL); | 186 | return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL); |
184 | } | 187 | } |
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 92bc8c5f1ca2..3fac4efa5ac8 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -508,7 +508,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp, | |||
508 | /* Fill the receive configuration URB and initialise the Rx call back */ | 508 | /* Fill the receive configuration URB and initialise the Rx call back */ |
509 | usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, | 509 | usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, |
510 | usb_rcvbulkpipe(cardp->udev, cardp->ep_in), | 510 | usb_rcvbulkpipe(cardp->udev, cardp->ep_in), |
511 | (void *) (skb->tail + (size_t) IPFIELD_ALIGN_OFFSET), | 511 | skb->data + IPFIELD_ALIGN_OFFSET, |
512 | MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, | 512 | MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, |
513 | cardp); | 513 | cardp); |
514 | 514 | ||
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 17e199546eeb..92af9b96bb7a 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -426,12 +426,16 @@ static const char p54u_romboot_3887[] = "~~~~"; | |||
426 | static int p54u_firmware_reset_3887(struct ieee80211_hw *dev) | 426 | static int p54u_firmware_reset_3887(struct ieee80211_hw *dev) |
427 | { | 427 | { |
428 | struct p54u_priv *priv = dev->priv; | 428 | struct p54u_priv *priv = dev->priv; |
429 | u8 buf[4]; | 429 | u8 *buf; |
430 | int ret; | 430 | int ret; |
431 | 431 | ||
432 | memcpy(&buf, p54u_romboot_3887, sizeof(buf)); | 432 | buf = kmalloc(4, GFP_KERNEL); |
433 | if (!buf) | ||
434 | return -ENOMEM; | ||
435 | memcpy(buf, p54u_romboot_3887, 4); | ||
433 | ret = p54u_bulk_msg(priv, P54U_PIPE_DATA, | 436 | ret = p54u_bulk_msg(priv, P54U_PIPE_DATA, |
434 | buf, sizeof(buf)); | 437 | buf, 4); |
438 | kfree(buf); | ||
435 | if (ret) | 439 | if (ret) |
436 | dev_err(&priv->udev->dev, "(p54usb) unable to jump to " | 440 | dev_err(&priv->udev->dev, "(p54usb) unable to jump to " |
437 | "boot ROM (%d)!\n", ret); | 441 | "boot ROM (%d)!\n", ret); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 71761b343839..73bbec58341e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -815,6 +815,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
815 | 815 | ||
816 | mutex_init(&rt2x00dev->csr_mutex); | 816 | mutex_init(&rt2x00dev->csr_mutex); |
817 | 817 | ||
818 | set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||
819 | |||
818 | /* | 820 | /* |
819 | * Make room for rt2x00_intf inside the per-interface | 821 | * Make room for rt2x00_intf inside the per-interface |
820 | * structure ieee80211_vif. | 822 | * structure ieee80211_vif. |
@@ -871,8 +873,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
871 | rt2x00leds_register(rt2x00dev); | 873 | rt2x00leds_register(rt2x00dev); |
872 | rt2x00debug_register(rt2x00dev); | 874 | rt2x00debug_register(rt2x00dev); |
873 | 875 | ||
874 | set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||
875 | |||
876 | return 0; | 876 | return 0; |
877 | 877 | ||
878 | exit: | 878 | exit: |
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c index c64db0ba7f40..c708d0be9155 100644 --- a/drivers/net/wireless/rt2x00/rt2x00link.c +++ b/drivers/net/wireless/rt2x00/rt2x00link.c | |||
@@ -362,8 +362,9 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev) | |||
362 | 362 | ||
363 | rt2x00link_reset_tuner(rt2x00dev, false); | 363 | rt2x00link_reset_tuner(rt2x00dev, false); |
364 | 364 | ||
365 | ieee80211_queue_delayed_work(rt2x00dev->hw, | 365 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
366 | &link->work, LINK_TUNE_INTERVAL); | 366 | ieee80211_queue_delayed_work(rt2x00dev->hw, |
367 | &link->work, LINK_TUNE_INTERVAL); | ||
367 | } | 368 | } |
368 | 369 | ||
369 | void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev) | 370 | void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev) |
@@ -469,8 +470,10 @@ static void rt2x00link_tuner(struct work_struct *work) | |||
469 | * Increase tuner counter, and reschedule the next link tuner run. | 470 | * Increase tuner counter, and reschedule the next link tuner run. |
470 | */ | 471 | */ |
471 | link->count++; | 472 | link->count++; |
472 | ieee80211_queue_delayed_work(rt2x00dev->hw, | 473 | |
473 | &link->work, LINK_TUNE_INTERVAL); | 474 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
475 | ieee80211_queue_delayed_work(rt2x00dev->hw, | ||
476 | &link->work, LINK_TUNE_INTERVAL); | ||
474 | } | 477 | } |
475 | 478 | ||
476 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev) | 479 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 501544882c2c..f02b48a90593 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, | |||
47 | (requesttype == USB_VENDOR_REQUEST_IN) ? | 47 | (requesttype == USB_VENDOR_REQUEST_IN) ? |
48 | usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); | 48 | usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); |
49 | 49 | ||
50 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
51 | return -ENODEV; | ||
50 | 52 | ||
51 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | 53 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { |
52 | status = usb_control_msg(usb_dev, pipe, request, requesttype, | 54 | status = usb_control_msg(usb_dev, pipe, request, requesttype, |
@@ -60,8 +62,10 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, | |||
60 | * -ENODEV: Device has disappeared, no point continuing. | 62 | * -ENODEV: Device has disappeared, no point continuing. |
61 | * All other errors: Try again. | 63 | * All other errors: Try again. |
62 | */ | 64 | */ |
63 | else if (status == -ENODEV) | 65 | else if (status == -ENODEV) { |
66 | clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||
64 | break; | 67 | break; |
68 | } | ||
65 | } | 69 | } |
66 | 70 | ||
67 | ERROR(rt2x00dev, | 71 | ERROR(rt2x00dev, |
@@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
161 | { | 165 | { |
162 | unsigned int i; | 166 | unsigned int i; |
163 | 167 | ||
168 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
169 | return -ENODEV; | ||
170 | |||
164 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | 171 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { |
165 | rt2x00usb_register_read_lock(rt2x00dev, offset, reg); | 172 | rt2x00usb_register_read_lock(rt2x00dev, offset, reg); |
166 | if (!rt2x00_get_field32(*reg, field)) | 173 | if (!rt2x00_get_field32(*reg, field)) |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index b8f5ee33445e..14e7bb210075 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2389,10 +2389,13 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2389 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, | 2389 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, |
2390 | { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, | 2390 | { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, |
2391 | /* MSI */ | 2391 | /* MSI */ |
2392 | { USB_DEVICE(0x0db0, 0x4600), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2392 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, | 2393 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, |
2393 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, | 2394 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, |
2394 | { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) }, | 2395 | { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) }, |
2395 | { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) }, | 2396 | { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) }, |
2397 | /* Ovislink */ | ||
2398 | { USB_DEVICE(0x1b75, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2396 | /* Ralink */ | 2399 | /* Ralink */ |
2397 | { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) }, | 2400 | { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) }, |
2398 | { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) }, | 2401 | { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) }, |
@@ -2420,6 +2423,8 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2420 | /* Planex */ | 2423 | /* Planex */ |
2421 | { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) }, | 2424 | { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) }, |
2422 | { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) }, | 2425 | { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) }, |
2426 | /* WideTell */ | ||
2427 | { USB_DEVICE(0x7167, 0x3840), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2423 | /* Zcom */ | 2428 | /* Zcom */ |
2424 | { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) }, | 2429 | { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) }, |
2425 | /* ZyXEL */ | 2430 | /* ZyXEL */ |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c index a1c670fc1552..cf8a4a40fdf6 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_leds.c +++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c | |||
@@ -210,10 +210,10 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev) | |||
210 | 210 | ||
211 | /* turn the LED off before exiting */ | 211 | /* turn the LED off before exiting */ |
212 | ieee80211_queue_delayed_work(dev, &priv->led_off, 0); | 212 | ieee80211_queue_delayed_work(dev, &priv->led_off, 0); |
213 | cancel_delayed_work_sync(&priv->led_off); | ||
214 | cancel_delayed_work_sync(&priv->led_on); | ||
215 | rtl8187_unregister_led(&priv->led_rx); | 213 | rtl8187_unregister_led(&priv->led_rx); |
216 | rtl8187_unregister_led(&priv->led_tx); | 214 | rtl8187_unregister_led(&priv->led_tx); |
215 | cancel_delayed_work_sync(&priv->led_off); | ||
216 | cancel_delayed_work_sync(&priv->led_on); | ||
217 | } | 217 | } |
218 | #endif /* def CONFIG_RTL8187_LED */ | 218 | #endif /* def CONFIG_RTL8187_LED */ |
219 | 219 | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rfkill.c b/drivers/net/wireless/rtl818x/rtl8187_rfkill.c index 9fab13e4004e..cad8037ab2af 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_rfkill.c +++ b/drivers/net/wireless/rtl818x/rtl8187_rfkill.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <net/mac80211.h> | 18 | #include <net/mac80211.h> |
19 | 19 | ||
20 | #include "rtl8187.h" | 20 | #include "rtl8187.h" |
21 | #include "rtl8187_rfkill.h" | ||
21 | 22 | ||
22 | static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv) | 23 | static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv) |
23 | { | 24 | { |