diff options
Diffstat (limited to 'drivers/net')
28 files changed, 289 insertions, 156 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 459614d2d7bc..94d5f59d5a6f 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -1680,7 +1680,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) | |||
1680 | rc = XMIT_PLAIN; | 1680 | rc = XMIT_PLAIN; |
1681 | 1681 | ||
1682 | else { | 1682 | else { |
1683 | if (skb->protocol == htons(ETH_P_IPV6)) { | 1683 | if (vlan_get_protocol(skb) == htons(ETH_P_IPV6)) { |
1684 | rc = XMIT_CSUM_V6; | 1684 | rc = XMIT_CSUM_V6; |
1685 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | 1685 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) |
1686 | rc |= XMIT_CSUM_TCP; | 1686 | rc |= XMIT_CSUM_TCP; |
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index 6de5e2e448a5..c3449bbc585a 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
@@ -753,7 +753,9 @@ static int cxgb4vf_open(struct net_device *dev) | |||
753 | if (err) | 753 | if (err) |
754 | return err; | 754 | return err; |
755 | set_bit(pi->port_id, &adapter->open_device_map); | 755 | set_bit(pi->port_id, &adapter->open_device_map); |
756 | link_start(dev); | 756 | err = link_start(dev); |
757 | if (err) | ||
758 | return err; | ||
757 | netif_tx_start_all_queues(dev); | 759 | netif_tx_start_all_queues(dev); |
758 | return 0; | 760 | return 0; |
759 | } | 761 | } |
@@ -1103,18 +1105,6 @@ static int cxgb4vf_set_mac_addr(struct net_device *dev, void *_addr) | |||
1103 | return 0; | 1105 | return 0; |
1104 | } | 1106 | } |
1105 | 1107 | ||
1106 | /* | ||
1107 | * Return a TX Queue on which to send the specified skb. | ||
1108 | */ | ||
1109 | static u16 cxgb4vf_select_queue(struct net_device *dev, struct sk_buff *skb) | ||
1110 | { | ||
1111 | /* | ||
1112 | * XXX For now just use the default hash but we probably want to | ||
1113 | * XXX look at other possibilities ... | ||
1114 | */ | ||
1115 | return skb_tx_hash(dev, skb); | ||
1116 | } | ||
1117 | |||
1118 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1108 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1119 | /* | 1109 | /* |
1120 | * Poll all of our receive queues. This is called outside of normal interrupt | 1110 | * Poll all of our receive queues. This is called outside of normal interrupt |
@@ -2075,6 +2065,22 @@ static int adap_init0(struct adapter *adapter) | |||
2075 | } | 2065 | } |
2076 | 2066 | ||
2077 | /* | 2067 | /* |
2068 | * Some environments do not properly handle PCIE FLRs -- e.g. in Linux | ||
2069 | * 2.6.31 and later we can't call pci_reset_function() in order to | ||
2070 | * issue an FLR because of a self- deadlock on the device semaphore. | ||
2071 | * Meanwhile, the OS infrastructure doesn't issue FLRs in all the | ||
2072 | * cases where they're needed -- for instance, some versions of KVM | ||
2073 | * fail to reset "Assigned Devices" when the VM reboots. Therefore we | ||
2074 | * use the firmware based reset in order to reset any per function | ||
2075 | * state. | ||
2076 | */ | ||
2077 | err = t4vf_fw_reset(adapter); | ||
2078 | if (err < 0) { | ||
2079 | dev_err(adapter->pdev_dev, "FW reset failed: err=%d\n", err); | ||
2080 | return err; | ||
2081 | } | ||
2082 | |||
2083 | /* | ||
2078 | * Grab basic operational parameters. These will predominantly have | 2084 | * Grab basic operational parameters. These will predominantly have |
2079 | * been set up by the Physical Function Driver or will be hard coded | 2085 | * been set up by the Physical Function Driver or will be hard coded |
2080 | * into the adapter. We just have to live with them ... Note that | 2086 | * into the adapter. We just have to live with them ... Note that |
@@ -2417,7 +2423,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = { | |||
2417 | .ndo_get_stats = cxgb4vf_get_stats, | 2423 | .ndo_get_stats = cxgb4vf_get_stats, |
2418 | .ndo_set_rx_mode = cxgb4vf_set_rxmode, | 2424 | .ndo_set_rx_mode = cxgb4vf_set_rxmode, |
2419 | .ndo_set_mac_address = cxgb4vf_set_mac_addr, | 2425 | .ndo_set_mac_address = cxgb4vf_set_mac_addr, |
2420 | .ndo_select_queue = cxgb4vf_select_queue, | ||
2421 | .ndo_validate_addr = eth_validate_addr, | 2426 | .ndo_validate_addr = eth_validate_addr, |
2422 | .ndo_do_ioctl = cxgb4vf_do_ioctl, | 2427 | .ndo_do_ioctl = cxgb4vf_do_ioctl, |
2423 | .ndo_change_mtu = cxgb4vf_change_mtu, | 2428 | .ndo_change_mtu = cxgb4vf_change_mtu, |
@@ -2624,7 +2629,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, | |||
2624 | netdev->do_ioctl = cxgb4vf_do_ioctl; | 2629 | netdev->do_ioctl = cxgb4vf_do_ioctl; |
2625 | netdev->change_mtu = cxgb4vf_change_mtu; | 2630 | netdev->change_mtu = cxgb4vf_change_mtu; |
2626 | netdev->set_mac_address = cxgb4vf_set_mac_addr; | 2631 | netdev->set_mac_address = cxgb4vf_set_mac_addr; |
2627 | netdev->select_queue = cxgb4vf_select_queue; | ||
2628 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2632 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2629 | netdev->poll_controller = cxgb4vf_poll_controller; | 2633 | netdev->poll_controller = cxgb4vf_poll_controller; |
2630 | #endif | 2634 | #endif |
@@ -2843,6 +2847,14 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = { | |||
2843 | CH_DEVICE(0x4800, 0), /* T440-dbg */ | 2847 | CH_DEVICE(0x4800, 0), /* T440-dbg */ |
2844 | CH_DEVICE(0x4801, 0), /* T420-cr */ | 2848 | CH_DEVICE(0x4801, 0), /* T420-cr */ |
2845 | CH_DEVICE(0x4802, 0), /* T422-cr */ | 2849 | CH_DEVICE(0x4802, 0), /* T422-cr */ |
2850 | CH_DEVICE(0x4803, 0), /* T440-cr */ | ||
2851 | CH_DEVICE(0x4804, 0), /* T420-bch */ | ||
2852 | CH_DEVICE(0x4805, 0), /* T440-bch */ | ||
2853 | CH_DEVICE(0x4806, 0), /* T460-ch */ | ||
2854 | CH_DEVICE(0x4807, 0), /* T420-so */ | ||
2855 | CH_DEVICE(0x4808, 0), /* T420-cx */ | ||
2856 | CH_DEVICE(0x4809, 0), /* T420-bt */ | ||
2857 | CH_DEVICE(0x480a, 0), /* T404-bt */ | ||
2846 | { 0, } | 2858 | { 0, } |
2847 | }; | 2859 | }; |
2848 | 2860 | ||
diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c index f10864ddafbe..ecf0770bf0ff 100644 --- a/drivers/net/cxgb4vf/sge.c +++ b/drivers/net/cxgb4vf/sge.c | |||
@@ -154,13 +154,14 @@ enum { | |||
154 | */ | 154 | */ |
155 | RX_COPY_THRES = 256, | 155 | RX_COPY_THRES = 256, |
156 | RX_PULL_LEN = 128, | 156 | RX_PULL_LEN = 128, |
157 | }; | ||
158 | 157 | ||
159 | /* | 158 | /* |
160 | * Can't define this in the above enum because PKTSHIFT isn't a constant in | 159 | * Main body length for sk_buffs used for RX Ethernet packets with |
161 | * the VF Driver ... | 160 | * fragments. Should be >= RX_PULL_LEN but possibly bigger to give |
162 | */ | 161 | * pskb_may_pull() some room. |
163 | #define RX_PKT_PULL_LEN (RX_PULL_LEN + PKTSHIFT) | 162 | */ |
163 | RX_SKB_LEN = 512, | ||
164 | }; | ||
164 | 165 | ||
165 | /* | 166 | /* |
166 | * Software state per TX descriptor. | 167 | * Software state per TX descriptor. |
@@ -1355,6 +1356,67 @@ out_free: | |||
1355 | } | 1356 | } |
1356 | 1357 | ||
1357 | /** | 1358 | /** |
1359 | * t4vf_pktgl_to_skb - build an sk_buff from a packet gather list | ||
1360 | * @gl: the gather list | ||
1361 | * @skb_len: size of sk_buff main body if it carries fragments | ||
1362 | * @pull_len: amount of data to move to the sk_buff's main body | ||
1363 | * | ||
1364 | * Builds an sk_buff from the given packet gather list. Returns the | ||
1365 | * sk_buff or %NULL if sk_buff allocation failed. | ||
1366 | */ | ||
1367 | struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl, | ||
1368 | unsigned int skb_len, unsigned int pull_len) | ||
1369 | { | ||
1370 | struct sk_buff *skb; | ||
1371 | struct skb_shared_info *ssi; | ||
1372 | |||
1373 | /* | ||
1374 | * If the ingress packet is small enough, allocate an skb large enough | ||
1375 | * for all of the data and copy it inline. Otherwise, allocate an skb | ||
1376 | * with enough room to pull in the header and reference the rest of | ||
1377 | * the data via the skb fragment list. | ||
1378 | * | ||
1379 | * Below we rely on RX_COPY_THRES being less than the smallest Rx | ||
1380 | * buff! size, which is expected since buffers are at least | ||
1381 | * PAGE_SIZEd. In this case packets up to RX_COPY_THRES have only one | ||
1382 | * fragment. | ||
1383 | */ | ||
1384 | if (gl->tot_len <= RX_COPY_THRES) { | ||
1385 | /* small packets have only one fragment */ | ||
1386 | skb = alloc_skb(gl->tot_len, GFP_ATOMIC); | ||
1387 | if (unlikely(!skb)) | ||
1388 | goto out; | ||
1389 | __skb_put(skb, gl->tot_len); | ||
1390 | skb_copy_to_linear_data(skb, gl->va, gl->tot_len); | ||
1391 | } else { | ||
1392 | skb = alloc_skb(skb_len, GFP_ATOMIC); | ||
1393 | if (unlikely(!skb)) | ||
1394 | goto out; | ||
1395 | __skb_put(skb, pull_len); | ||
1396 | skb_copy_to_linear_data(skb, gl->va, pull_len); | ||
1397 | |||
1398 | ssi = skb_shinfo(skb); | ||
1399 | ssi->frags[0].page = gl->frags[0].page; | ||
1400 | ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len; | ||
1401 | ssi->frags[0].size = gl->frags[0].size - pull_len; | ||
1402 | if (gl->nfrags > 1) | ||
1403 | memcpy(&ssi->frags[1], &gl->frags[1], | ||
1404 | (gl->nfrags-1) * sizeof(skb_frag_t)); | ||
1405 | ssi->nr_frags = gl->nfrags; | ||
1406 | |||
1407 | skb->len = gl->tot_len; | ||
1408 | skb->data_len = skb->len - pull_len; | ||
1409 | skb->truesize += skb->data_len; | ||
1410 | |||
1411 | /* Get a reference for the last page, we don't own it */ | ||
1412 | get_page(gl->frags[gl->nfrags - 1].page); | ||
1413 | } | ||
1414 | |||
1415 | out: | ||
1416 | return skb; | ||
1417 | } | ||
1418 | |||
1419 | /** | ||
1358 | * t4vf_pktgl_free - free a packet gather list | 1420 | * t4vf_pktgl_free - free a packet gather list |
1359 | * @gl: the gather list | 1421 | * @gl: the gather list |
1360 | * | 1422 | * |
@@ -1463,10 +1525,8 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
1463 | { | 1525 | { |
1464 | struct sk_buff *skb; | 1526 | struct sk_buff *skb; |
1465 | struct port_info *pi; | 1527 | struct port_info *pi; |
1466 | struct skb_shared_info *ssi; | ||
1467 | const struct cpl_rx_pkt *pkt = (void *)&rsp[1]; | 1528 | const struct cpl_rx_pkt *pkt = (void *)&rsp[1]; |
1468 | bool csum_ok = pkt->csum_calc && !pkt->err_vec; | 1529 | bool csum_ok = pkt->csum_calc && !pkt->err_vec; |
1469 | unsigned int len = be16_to_cpu(pkt->len); | ||
1470 | struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq); | 1530 | struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq); |
1471 | 1531 | ||
1472 | /* | 1532 | /* |
@@ -1481,42 +1541,14 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
1481 | } | 1541 | } |
1482 | 1542 | ||
1483 | /* | 1543 | /* |
1484 | * If the ingress packet is small enough, allocate an skb large enough | 1544 | * Convert the Packet Gather List into an skb. |
1485 | * for all of the data and copy it inline. Otherwise, allocate an skb | ||
1486 | * with enough room to pull in the header and reference the rest of | ||
1487 | * the data via the skb fragment list. | ||
1488 | */ | 1545 | */ |
1489 | if (len <= RX_COPY_THRES) { | 1546 | skb = t4vf_pktgl_to_skb(gl, RX_SKB_LEN, RX_PULL_LEN); |
1490 | /* small packets have only one fragment */ | 1547 | if (unlikely(!skb)) { |
1491 | skb = alloc_skb(gl->frags[0].size, GFP_ATOMIC); | 1548 | t4vf_pktgl_free(gl); |
1492 | if (!skb) | 1549 | rxq->stats.rx_drops++; |
1493 | goto nomem; | 1550 | return 0; |
1494 | __skb_put(skb, gl->frags[0].size); | ||
1495 | skb_copy_to_linear_data(skb, gl->va, gl->frags[0].size); | ||
1496 | } else { | ||
1497 | skb = alloc_skb(RX_PKT_PULL_LEN, GFP_ATOMIC); | ||
1498 | if (!skb) | ||
1499 | goto nomem; | ||
1500 | __skb_put(skb, RX_PKT_PULL_LEN); | ||
1501 | skb_copy_to_linear_data(skb, gl->va, RX_PKT_PULL_LEN); | ||
1502 | |||
1503 | ssi = skb_shinfo(skb); | ||
1504 | ssi->frags[0].page = gl->frags[0].page; | ||
1505 | ssi->frags[0].page_offset = (gl->frags[0].page_offset + | ||
1506 | RX_PKT_PULL_LEN); | ||
1507 | ssi->frags[0].size = gl->frags[0].size - RX_PKT_PULL_LEN; | ||
1508 | if (gl->nfrags > 1) | ||
1509 | memcpy(&ssi->frags[1], &gl->frags[1], | ||
1510 | (gl->nfrags-1) * sizeof(skb_frag_t)); | ||
1511 | ssi->nr_frags = gl->nfrags; | ||
1512 | skb->len = len + PKTSHIFT; | ||
1513 | skb->data_len = skb->len - RX_PKT_PULL_LEN; | ||
1514 | skb->truesize += skb->data_len; | ||
1515 | |||
1516 | /* Get a reference for the last page, we don't own it */ | ||
1517 | get_page(gl->frags[gl->nfrags - 1].page); | ||
1518 | } | 1551 | } |
1519 | |||
1520 | __skb_pull(skb, PKTSHIFT); | 1552 | __skb_pull(skb, PKTSHIFT); |
1521 | skb->protocol = eth_type_trans(skb, rspq->netdev); | 1553 | skb->protocol = eth_type_trans(skb, rspq->netdev); |
1522 | skb_record_rx_queue(skb, rspq->idx); | 1554 | skb_record_rx_queue(skb, rspq->idx); |
@@ -1549,11 +1581,6 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
1549 | netif_receive_skb(skb); | 1581 | netif_receive_skb(skb); |
1550 | 1582 | ||
1551 | return 0; | 1583 | return 0; |
1552 | |||
1553 | nomem: | ||
1554 | t4vf_pktgl_free(gl); | ||
1555 | rxq->stats.rx_drops++; | ||
1556 | return 0; | ||
1557 | } | 1584 | } |
1558 | 1585 | ||
1559 | /** | 1586 | /** |
@@ -1679,6 +1706,7 @@ int process_responses(struct sge_rspq *rspq, int budget) | |||
1679 | } | 1706 | } |
1680 | len = RSPD_LEN(len); | 1707 | len = RSPD_LEN(len); |
1681 | } | 1708 | } |
1709 | gl.tot_len = len; | ||
1682 | 1710 | ||
1683 | /* | 1711 | /* |
1684 | * Gather packet fragments. | 1712 | * Gather packet fragments. |
diff --git a/drivers/net/cxgb4vf/t4vf_common.h b/drivers/net/cxgb4vf/t4vf_common.h index 873cb7d86c57..a65c80aed1f2 100644 --- a/drivers/net/cxgb4vf/t4vf_common.h +++ b/drivers/net/cxgb4vf/t4vf_common.h | |||
@@ -235,6 +235,7 @@ static inline int t4vf_wr_mbox_ns(struct adapter *adapter, const void *cmd, | |||
235 | int __devinit t4vf_wait_dev_ready(struct adapter *); | 235 | int __devinit t4vf_wait_dev_ready(struct adapter *); |
236 | int __devinit t4vf_port_init(struct adapter *, int); | 236 | int __devinit t4vf_port_init(struct adapter *, int); |
237 | 237 | ||
238 | int t4vf_fw_reset(struct adapter *); | ||
238 | int t4vf_query_params(struct adapter *, unsigned int, const u32 *, u32 *); | 239 | int t4vf_query_params(struct adapter *, unsigned int, const u32 *, u32 *); |
239 | int t4vf_set_params(struct adapter *, unsigned int, const u32 *, const u32 *); | 240 | int t4vf_set_params(struct adapter *, unsigned int, const u32 *, const u32 *); |
240 | 241 | ||
diff --git a/drivers/net/cxgb4vf/t4vf_hw.c b/drivers/net/cxgb4vf/t4vf_hw.c index ea1c123f0cb4..e306c20dfaee 100644 --- a/drivers/net/cxgb4vf/t4vf_hw.c +++ b/drivers/net/cxgb4vf/t4vf_hw.c | |||
@@ -326,6 +326,25 @@ int __devinit t4vf_port_init(struct adapter *adapter, int pidx) | |||
326 | } | 326 | } |
327 | 327 | ||
328 | /** | 328 | /** |
329 | * t4vf_fw_reset - issue a reset to FW | ||
330 | * @adapter: the adapter | ||
331 | * | ||
332 | * Issues a reset command to FW. For a Physical Function this would | ||
333 | * result in the Firmware reseting all of its state. For a Virtual | ||
334 | * Function this just resets the state associated with the VF. | ||
335 | */ | ||
336 | int t4vf_fw_reset(struct adapter *adapter) | ||
337 | { | ||
338 | struct fw_reset_cmd cmd; | ||
339 | |||
340 | memset(&cmd, 0, sizeof(cmd)); | ||
341 | cmd.op_to_write = cpu_to_be32(FW_CMD_OP(FW_RESET_CMD) | | ||
342 | FW_CMD_WRITE); | ||
343 | cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd)); | ||
344 | return t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), NULL); | ||
345 | } | ||
346 | |||
347 | /** | ||
329 | * t4vf_query_params - query FW or device parameters | 348 | * t4vf_query_params - query FW or device parameters |
330 | * @adapter: the adapter | 349 | * @adapter: the adapter |
331 | * @nparams: the number of parameters | 350 | * @nparams: the number of parameters |
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index 5c566ebc54b8..3bc8e276ba4d 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c | |||
@@ -635,9 +635,10 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
635 | if (wol->wolopts & ~WAKE_MAGIC) | 635 | if (wol->wolopts & ~WAKE_MAGIC) |
636 | return -EINVAL; | 636 | return -EINVAL; |
637 | 637 | ||
638 | device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC); | ||
639 | |||
638 | spin_lock_irqsave(&priv->bflock, flags); | 640 | spin_lock_irqsave(&priv->bflock, flags); |
639 | priv->wol_en = wol->wolopts & WAKE_MAGIC ? 1 : 0; | 641 | priv->wol_en = !!device_may_wakeup(&dev->dev); |
640 | device_set_wakeup_enable(&dev->dev, priv->wol_en); | ||
641 | spin_unlock_irqrestore(&priv->bflock, flags); | 642 | spin_unlock_irqrestore(&priv->bflock, flags); |
642 | 643 | ||
643 | return 0; | 644 | return 0; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 2bd3eb4ee5a1..fbad4d819608 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -764,8 +764,9 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
764 | #ifdef IXGBE_FCOE | 764 | #ifdef IXGBE_FCOE |
765 | /* adjust for FCoE Sequence Offload */ | 765 | /* adjust for FCoE Sequence Offload */ |
766 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) | 766 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) |
767 | && (skb->protocol == htons(ETH_P_FCOE)) && | 767 | && skb_is_gso(skb) |
768 | skb_is_gso(skb)) { | 768 | && vlan_get_protocol(skb) == |
769 | htons(ETH_P_FCOE)) { | ||
769 | hlen = skb_transport_offset(skb) + | 770 | hlen = skb_transport_offset(skb) + |
770 | sizeof(struct fc_frame_header) + | 771 | sizeof(struct fc_frame_header) + |
771 | sizeof(struct fcoe_crc_eof); | 772 | sizeof(struct fcoe_crc_eof); |
@@ -5823,7 +5824,7 @@ static void ixgbe_watchdog_task(struct work_struct *work) | |||
5823 | 5824 | ||
5824 | static int ixgbe_tso(struct ixgbe_adapter *adapter, | 5825 | static int ixgbe_tso(struct ixgbe_adapter *adapter, |
5825 | struct ixgbe_ring *tx_ring, struct sk_buff *skb, | 5826 | struct ixgbe_ring *tx_ring, struct sk_buff *skb, |
5826 | u32 tx_flags, u8 *hdr_len) | 5827 | u32 tx_flags, u8 *hdr_len, __be16 protocol) |
5827 | { | 5828 | { |
5828 | struct ixgbe_adv_tx_context_desc *context_desc; | 5829 | struct ixgbe_adv_tx_context_desc *context_desc; |
5829 | unsigned int i; | 5830 | unsigned int i; |
@@ -5841,7 +5842,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5841 | l4len = tcp_hdrlen(skb); | 5842 | l4len = tcp_hdrlen(skb); |
5842 | *hdr_len += l4len; | 5843 | *hdr_len += l4len; |
5843 | 5844 | ||
5844 | if (skb->protocol == htons(ETH_P_IP)) { | 5845 | if (protocol == htons(ETH_P_IP)) { |
5845 | struct iphdr *iph = ip_hdr(skb); | 5846 | struct iphdr *iph = ip_hdr(skb); |
5846 | iph->tot_len = 0; | 5847 | iph->tot_len = 0; |
5847 | iph->check = 0; | 5848 | iph->check = 0; |
@@ -5880,7 +5881,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5880 | type_tucmd_mlhl = (IXGBE_TXD_CMD_DEXT | | 5881 | type_tucmd_mlhl = (IXGBE_TXD_CMD_DEXT | |
5881 | IXGBE_ADVTXD_DTYP_CTXT); | 5882 | IXGBE_ADVTXD_DTYP_CTXT); |
5882 | 5883 | ||
5883 | if (skb->protocol == htons(ETH_P_IP)) | 5884 | if (protocol == htons(ETH_P_IP)) |
5884 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; | 5885 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; |
5885 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; | 5886 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; |
5886 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); | 5887 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); |
@@ -5906,16 +5907,10 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5906 | return false; | 5907 | return false; |
5907 | } | 5908 | } |
5908 | 5909 | ||
5909 | static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb) | 5910 | static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb, |
5911 | __be16 protocol) | ||
5910 | { | 5912 | { |
5911 | u32 rtn = 0; | 5913 | u32 rtn = 0; |
5912 | __be16 protocol; | ||
5913 | |||
5914 | if (skb->protocol == cpu_to_be16(ETH_P_8021Q)) | ||
5915 | protocol = ((const struct vlan_ethhdr *)skb->data)-> | ||
5916 | h_vlan_encapsulated_proto; | ||
5917 | else | ||
5918 | protocol = skb->protocol; | ||
5919 | 5914 | ||
5920 | switch (protocol) { | 5915 | switch (protocol) { |
5921 | case cpu_to_be16(ETH_P_IP): | 5916 | case cpu_to_be16(ETH_P_IP): |
@@ -5943,7 +5938,7 @@ static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb) | |||
5943 | default: | 5938 | default: |
5944 | if (unlikely(net_ratelimit())) | 5939 | if (unlikely(net_ratelimit())) |
5945 | e_warn(probe, "partial checksum but proto=%x!\n", | 5940 | e_warn(probe, "partial checksum but proto=%x!\n", |
5946 | skb->protocol); | 5941 | protocol); |
5947 | break; | 5942 | break; |
5948 | } | 5943 | } |
5949 | 5944 | ||
@@ -5952,7 +5947,8 @@ static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb) | |||
5952 | 5947 | ||
5953 | static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | 5948 | static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, |
5954 | struct ixgbe_ring *tx_ring, | 5949 | struct ixgbe_ring *tx_ring, |
5955 | struct sk_buff *skb, u32 tx_flags) | 5950 | struct sk_buff *skb, u32 tx_flags, |
5951 | __be16 protocol) | ||
5956 | { | 5952 | { |
5957 | struct ixgbe_adv_tx_context_desc *context_desc; | 5953 | struct ixgbe_adv_tx_context_desc *context_desc; |
5958 | unsigned int i; | 5954 | unsigned int i; |
@@ -5981,7 +5977,7 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | |||
5981 | IXGBE_ADVTXD_DTYP_CTXT); | 5977 | IXGBE_ADVTXD_DTYP_CTXT); |
5982 | 5978 | ||
5983 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 5979 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
5984 | type_tucmd_mlhl |= ixgbe_psum(adapter, skb); | 5980 | type_tucmd_mlhl |= ixgbe_psum(adapter, skb, protocol); |
5985 | 5981 | ||
5986 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); | 5982 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); |
5987 | /* use index zero for tx checksum offload */ | 5983 | /* use index zero for tx checksum offload */ |
@@ -6179,7 +6175,7 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | |||
6179 | } | 6175 | } |
6180 | 6176 | ||
6181 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | 6177 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, |
6182 | int queue, u32 tx_flags) | 6178 | int queue, u32 tx_flags, __be16 protocol) |
6183 | { | 6179 | { |
6184 | struct ixgbe_atr_input atr_input; | 6180 | struct ixgbe_atr_input atr_input; |
6185 | struct tcphdr *th; | 6181 | struct tcphdr *th; |
@@ -6190,7 +6186,7 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | |||
6190 | u8 l4type = 0; | 6186 | u8 l4type = 0; |
6191 | 6187 | ||
6192 | /* Right now, we support IPv4 only */ | 6188 | /* Right now, we support IPv4 only */ |
6193 | if (skb->protocol != htons(ETH_P_IP)) | 6189 | if (protocol != htons(ETH_P_IP)) |
6194 | return; | 6190 | return; |
6195 | /* check if we're UDP or TCP */ | 6191 | /* check if we're UDP or TCP */ |
6196 | if (iph->protocol == IPPROTO_TCP) { | 6192 | if (iph->protocol == IPPROTO_TCP) { |
@@ -6257,10 +6253,13 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
6257 | { | 6253 | { |
6258 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 6254 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
6259 | int txq = smp_processor_id(); | 6255 | int txq = smp_processor_id(); |
6260 | |||
6261 | #ifdef IXGBE_FCOE | 6256 | #ifdef IXGBE_FCOE |
6262 | if ((skb->protocol == htons(ETH_P_FCOE)) || | 6257 | __be16 protocol; |
6263 | (skb->protocol == htons(ETH_P_FIP))) { | 6258 | |
6259 | protocol = vlan_get_protocol(skb); | ||
6260 | |||
6261 | if ((protocol == htons(ETH_P_FCOE)) || | ||
6262 | (protocol == htons(ETH_P_FIP))) { | ||
6264 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { | 6263 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { |
6265 | txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1); | 6264 | txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1); |
6266 | txq += adapter->ring_feature[RING_F_FCOE].mask; | 6265 | txq += adapter->ring_feature[RING_F_FCOE].mask; |
@@ -6303,6 +6302,9 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6303 | int tso; | 6302 | int tso; |
6304 | int count = 0; | 6303 | int count = 0; |
6305 | unsigned int f; | 6304 | unsigned int f; |
6305 | __be16 protocol; | ||
6306 | |||
6307 | protocol = vlan_get_protocol(skb); | ||
6306 | 6308 | ||
6307 | if (vlan_tx_tag_present(skb)) { | 6309 | if (vlan_tx_tag_present(skb)) { |
6308 | tx_flags |= vlan_tx_tag_get(skb); | 6310 | tx_flags |= vlan_tx_tag_get(skb); |
@@ -6323,8 +6325,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6323 | /* for FCoE with DCB, we force the priority to what | 6325 | /* for FCoE with DCB, we force the priority to what |
6324 | * was specified by the switch */ | 6326 | * was specified by the switch */ |
6325 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED && | 6327 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED && |
6326 | (skb->protocol == htons(ETH_P_FCOE) || | 6328 | (protocol == htons(ETH_P_FCOE) || |
6327 | skb->protocol == htons(ETH_P_FIP))) { | 6329 | protocol == htons(ETH_P_FIP))) { |
6328 | #ifdef CONFIG_IXGBE_DCB | 6330 | #ifdef CONFIG_IXGBE_DCB |
6329 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 6331 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
6330 | tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK | 6332 | tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK |
@@ -6334,7 +6336,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6334 | } | 6336 | } |
6335 | #endif | 6337 | #endif |
6336 | /* flag for FCoE offloads */ | 6338 | /* flag for FCoE offloads */ |
6337 | if (skb->protocol == htons(ETH_P_FCOE)) | 6339 | if (protocol == htons(ETH_P_FCOE)) |
6338 | tx_flags |= IXGBE_TX_FLAGS_FCOE; | 6340 | tx_flags |= IXGBE_TX_FLAGS_FCOE; |
6339 | } | 6341 | } |
6340 | #endif | 6342 | #endif |
@@ -6368,9 +6370,10 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6368 | tx_flags |= IXGBE_TX_FLAGS_FSO; | 6370 | tx_flags |= IXGBE_TX_FLAGS_FSO; |
6369 | #endif /* IXGBE_FCOE */ | 6371 | #endif /* IXGBE_FCOE */ |
6370 | } else { | 6372 | } else { |
6371 | if (skb->protocol == htons(ETH_P_IP)) | 6373 | if (protocol == htons(ETH_P_IP)) |
6372 | tx_flags |= IXGBE_TX_FLAGS_IPV4; | 6374 | tx_flags |= IXGBE_TX_FLAGS_IPV4; |
6373 | tso = ixgbe_tso(adapter, tx_ring, skb, tx_flags, &hdr_len); | 6375 | tso = ixgbe_tso(adapter, tx_ring, skb, tx_flags, &hdr_len, |
6376 | protocol); | ||
6374 | if (tso < 0) { | 6377 | if (tso < 0) { |
6375 | dev_kfree_skb_any(skb); | 6378 | dev_kfree_skb_any(skb); |
6376 | return NETDEV_TX_OK; | 6379 | return NETDEV_TX_OK; |
@@ -6378,7 +6381,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6378 | 6381 | ||
6379 | if (tso) | 6382 | if (tso) |
6380 | tx_flags |= IXGBE_TX_FLAGS_TSO; | 6383 | tx_flags |= IXGBE_TX_FLAGS_TSO; |
6381 | else if (ixgbe_tx_csum(adapter, tx_ring, skb, tx_flags) && | 6384 | else if (ixgbe_tx_csum(adapter, tx_ring, skb, tx_flags, |
6385 | protocol) && | ||
6382 | (skb->ip_summed == CHECKSUM_PARTIAL)) | 6386 | (skb->ip_summed == CHECKSUM_PARTIAL)) |
6383 | tx_flags |= IXGBE_TX_FLAGS_CSUM; | 6387 | tx_flags |= IXGBE_TX_FLAGS_CSUM; |
6384 | } | 6388 | } |
@@ -6392,7 +6396,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev | |||
6392 | test_bit(__IXGBE_FDIR_INIT_DONE, | 6396 | test_bit(__IXGBE_FDIR_INIT_DONE, |
6393 | &tx_ring->reinit_state)) { | 6397 | &tx_ring->reinit_state)) { |
6394 | ixgbe_atr(adapter, skb, tx_ring->queue_index, | 6398 | ixgbe_atr(adapter, skb, tx_ring->queue_index, |
6395 | tx_flags); | 6399 | tx_flags, protocol); |
6396 | tx_ring->atr_count = 0; | 6400 | tx_ring->atr_count = 0; |
6397 | } | 6401 | } |
6398 | } | 6402 | } |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index d2e166e29dda..8a4d19e5de06 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -111,13 +111,14 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id); | |||
111 | 111 | ||
112 | typedef struct axnet_dev_t { | 112 | typedef struct axnet_dev_t { |
113 | struct pcmcia_device *p_dev; | 113 | struct pcmcia_device *p_dev; |
114 | caddr_t base; | 114 | caddr_t base; |
115 | struct timer_list watchdog; | 115 | struct timer_list watchdog; |
116 | int stale, fast_poll; | 116 | int stale, fast_poll; |
117 | u_short link_status; | 117 | u_short link_status; |
118 | u_char duplex_flag; | 118 | u_char duplex_flag; |
119 | int phy_id; | 119 | int phy_id; |
120 | int flags; | 120 | int flags; |
121 | int active_low; | ||
121 | } axnet_dev_t; | 122 | } axnet_dev_t; |
122 | 123 | ||
123 | static inline axnet_dev_t *PRIV(struct net_device *dev) | 124 | static inline axnet_dev_t *PRIV(struct net_device *dev) |
@@ -322,6 +323,8 @@ static int axnet_config(struct pcmcia_device *link) | |||
322 | if (info->flags & IS_AX88790) | 323 | if (info->flags & IS_AX88790) |
323 | outb(0x10, dev->base_addr + AXNET_GPIO); /* select Internal PHY */ | 324 | outb(0x10, dev->base_addr + AXNET_GPIO); /* select Internal PHY */ |
324 | 325 | ||
326 | info->active_low = 0; | ||
327 | |||
325 | for (i = 0; i < 32; i++) { | 328 | for (i = 0; i < 32; i++) { |
326 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); | 329 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); |
327 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); | 330 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); |
@@ -329,15 +332,18 @@ static int axnet_config(struct pcmcia_device *link) | |||
329 | if ((j != 0) && (j != 0xffff)) break; | 332 | if ((j != 0) && (j != 0xffff)) break; |
330 | } | 333 | } |
331 | 334 | ||
332 | /* Maybe PHY is in power down mode. (PPD_SET = 1) | ||
333 | Bit 2 of CCSR is active low. */ | ||
334 | if (i == 32) { | 335 | if (i == 32) { |
336 | /* Maybe PHY is in power down mode. (PPD_SET = 1) | ||
337 | Bit 2 of CCSR is active low. */ | ||
335 | pcmcia_write_config_byte(link, CISREG_CCSR, 0x04); | 338 | pcmcia_write_config_byte(link, CISREG_CCSR, 0x04); |
336 | for (i = 0; i < 32; i++) { | 339 | for (i = 0; i < 32; i++) { |
337 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); | 340 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); |
338 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); | 341 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); |
339 | if (j == j2) continue; | 342 | if (j == j2) continue; |
340 | if ((j != 0) && (j != 0xffff)) break; | 343 | if ((j != 0) && (j != 0xffff)) { |
344 | info->active_low = 1; | ||
345 | break; | ||
346 | } | ||
341 | } | 347 | } |
342 | } | 348 | } |
343 | 349 | ||
@@ -383,8 +389,12 @@ static int axnet_suspend(struct pcmcia_device *link) | |||
383 | static int axnet_resume(struct pcmcia_device *link) | 389 | static int axnet_resume(struct pcmcia_device *link) |
384 | { | 390 | { |
385 | struct net_device *dev = link->priv; | 391 | struct net_device *dev = link->priv; |
392 | axnet_dev_t *info = PRIV(dev); | ||
386 | 393 | ||
387 | if (link->open) { | 394 | if (link->open) { |
395 | if (info->active_low == 1) | ||
396 | pcmcia_write_config_byte(link, CISREG_CCSR, 0x04); | ||
397 | |||
388 | axnet_reset_8390(dev); | 398 | axnet_reset_8390(dev); |
389 | AX88190_init(dev, 1); | 399 | AX88190_init(dev, 1); |
390 | netif_device_attach(dev); | 400 | netif_device_attach(dev); |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index d88ce9fb1cbd..4c4d16905efb 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -846,10 +846,10 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
846 | else | 846 | else |
847 | tp->features &= ~RTL_FEATURE_WOL; | 847 | tp->features &= ~RTL_FEATURE_WOL; |
848 | __rtl8169_set_wol(tp, wol->wolopts); | 848 | __rtl8169_set_wol(tp, wol->wolopts); |
849 | device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts); | ||
850 | |||
851 | spin_unlock_irq(&tp->lock); | 849 | spin_unlock_irq(&tp->lock); |
852 | 850 | ||
851 | device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts); | ||
852 | |||
853 | return 0; | 853 | return 0; |
854 | } | 854 | } |
855 | 855 | ||
@@ -2931,7 +2931,7 @@ static const struct rtl_cfg_info { | |||
2931 | .hw_start = rtl_hw_start_8168, | 2931 | .hw_start = rtl_hw_start_8168, |
2932 | .region = 2, | 2932 | .region = 2, |
2933 | .align = 8, | 2933 | .align = 8, |
2934 | .intr_event = SYSErr | RxFIFOOver | LinkChg | RxOverflow | | 2934 | .intr_event = SYSErr | LinkChg | RxOverflow | |
2935 | TxErr | TxOK | RxOK | RxErr, | 2935 | TxErr | TxOK | RxOK | RxErr, |
2936 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, | 2936 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, |
2937 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, | 2937 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, |
@@ -4588,7 +4588,8 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4588 | } | 4588 | } |
4589 | 4589 | ||
4590 | /* Work around for rx fifo overflow */ | 4590 | /* Work around for rx fifo overflow */ |
4591 | if (unlikely(status & RxFIFOOver)) { | 4591 | if (unlikely(status & RxFIFOOver) && |
4592 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | ||
4592 | netif_stop_queue(dev); | 4593 | netif_stop_queue(dev); |
4593 | rtl8169_tx_timeout(dev); | 4594 | rtl8169_tx_timeout(dev); |
4594 | break; | 4595 | break; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index bfec2e0f5275..220e0398f1d5 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3858,7 +3858,6 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3858 | 3858 | ||
3859 | /* device is off until link detection */ | 3859 | /* device is off until link detection */ |
3860 | netif_carrier_off(dev); | 3860 | netif_carrier_off(dev); |
3861 | netif_stop_queue(dev); | ||
3862 | 3861 | ||
3863 | return dev; | 3862 | return dev; |
3864 | } | 3863 | } |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index a4c3f5708246..acbdab3d66ca 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -2050,12 +2050,16 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2050 | 2050 | ||
2051 | ugeth_vdbg("%s: IN", __func__); | 2051 | ugeth_vdbg("%s: IN", __func__); |
2052 | 2052 | ||
2053 | /* | ||
2054 | * Tell the kernel the link is down. | ||
2055 | * Must be done before disabling the controller | ||
2056 | * or deadlock may happen. | ||
2057 | */ | ||
2058 | phy_stop(phydev); | ||
2059 | |||
2053 | /* Disable the controller */ | 2060 | /* Disable the controller */ |
2054 | ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); | 2061 | ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); |
2055 | 2062 | ||
2056 | /* Tell the kernel the link is down */ | ||
2057 | phy_stop(phydev); | ||
2058 | |||
2059 | /* Mask all interrupts */ | 2063 | /* Mask all interrupts */ |
2060 | out_be32(ugeth->uccf->p_uccm, 0x00000000); | 2064 | out_be32(ugeth->uccf->p_uccm, 0x00000000); |
2061 | 2065 | ||
@@ -2065,9 +2069,6 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2065 | /* Disable Rx and Tx */ | 2069 | /* Disable Rx and Tx */ |
2066 | clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); | 2070 | clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); |
2067 | 2071 | ||
2068 | phy_disconnect(ugeth->phydev); | ||
2069 | ugeth->phydev = NULL; | ||
2070 | |||
2071 | ucc_geth_memclean(ugeth); | 2072 | ucc_geth_memclean(ugeth); |
2072 | } | 2073 | } |
2073 | 2074 | ||
@@ -3550,7 +3551,10 @@ static int ucc_geth_close(struct net_device *dev) | |||
3550 | 3551 | ||
3551 | napi_disable(&ugeth->napi); | 3552 | napi_disable(&ugeth->napi); |
3552 | 3553 | ||
3554 | cancel_work_sync(&ugeth->timeout_work); | ||
3553 | ucc_geth_stop(ugeth); | 3555 | ucc_geth_stop(ugeth); |
3556 | phy_disconnect(ugeth->phydev); | ||
3557 | ugeth->phydev = NULL; | ||
3554 | 3558 | ||
3555 | free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev); | 3559 | free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev); |
3556 | 3560 | ||
@@ -3579,8 +3583,12 @@ static void ucc_geth_timeout_work(struct work_struct *work) | |||
3579 | * Must reset MAC *and* PHY. This is done by reopening | 3583 | * Must reset MAC *and* PHY. This is done by reopening |
3580 | * the device. | 3584 | * the device. |
3581 | */ | 3585 | */ |
3582 | ucc_geth_close(dev); | 3586 | netif_tx_stop_all_queues(dev); |
3583 | ucc_geth_open(dev); | 3587 | ucc_geth_stop(ugeth); |
3588 | ucc_geth_init_mac(ugeth); | ||
3589 | /* Must start PHY here */ | ||
3590 | phy_start(ugeth->phydev); | ||
3591 | netif_tx_start_all_queues(dev); | ||
3584 | } | 3592 | } |
3585 | 3593 | ||
3586 | netif_tx_schedule_all(dev); | 3594 | netif_tx_schedule_all(dev); |
@@ -3594,7 +3602,6 @@ static void ucc_geth_timeout(struct net_device *dev) | |||
3594 | { | 3602 | { |
3595 | struct ucc_geth_private *ugeth = netdev_priv(dev); | 3603 | struct ucc_geth_private *ugeth = netdev_priv(dev); |
3596 | 3604 | ||
3597 | netif_carrier_off(dev); | ||
3598 | schedule_work(&ugeth->timeout_work); | 3605 | schedule_work(&ugeth->timeout_work); |
3599 | } | 3606 | } |
3600 | 3607 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index bb6b67f6b0cc..b6d402806ae6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
986 | goto unregister; | 986 | goto unregister; |
987 | } | 987 | } |
988 | 988 | ||
989 | vi->status = VIRTIO_NET_S_LINK_UP; | 989 | /* Assume link up if device can't report link status, |
990 | virtnet_update_status(vi); | 990 | otherwise get link status from config. */ |
991 | netif_carrier_on(dev); | 991 | if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) { |
992 | netif_carrier_off(dev); | ||
993 | virtnet_update_status(vi); | ||
994 | } else { | ||
995 | vi->status = VIRTIO_NET_S_LINK_UP; | ||
996 | netif_carrier_on(dev); | ||
997 | } | ||
992 | 998 | ||
993 | pr_debug("virtnet: registered device %s\n", dev->name); | 999 | pr_debug("virtnet: registered device %s\n", dev->name); |
994 | return 0; | 1000 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index a0471f2e1c7a..48261b7252d0 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -410,6 +410,9 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, | |||
410 | val &= ~(AR_WA_BIT6 | AR_WA_BIT7); | 410 | val &= ~(AR_WA_BIT6 | AR_WA_BIT7); |
411 | } | 411 | } |
412 | 412 | ||
413 | if (AR_SREV_9280(ah)) | ||
414 | val |= AR_WA_BIT22; | ||
415 | |||
413 | if (AR_SREV_9285E_20(ah)) | 416 | if (AR_SREV_9285E_20(ah)) |
414 | val |= AR_WA_BIT23; | 417 | val |= AR_WA_BIT23; |
415 | 418 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 9b8e7e3fcebd..170d44a35ccb 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -675,6 +675,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
675 | } | 675 | } |
676 | 676 | ||
677 | extern struct ieee80211_ops ath9k_ops; | 677 | extern struct ieee80211_ops ath9k_ops; |
678 | extern struct pm_qos_request_list ath9k_pm_qos_req; | ||
678 | extern int modparam_nohwcrypt; | 679 | extern int modparam_nohwcrypt; |
679 | extern int led_blink; | 680 | extern int led_blink; |
680 | 681 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 6576f683dba0..f7ec31b4ddd3 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -35,6 +35,7 @@ static struct usb_device_id ath9k_hif_usb_ids[] = { | |||
35 | { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ | 35 | { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ |
36 | { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ | 36 | { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ |
37 | { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ | 37 | { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ |
38 | { USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */ | ||
38 | { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ | 39 | { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ |
39 | { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ | 40 | { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ |
40 | { }, | 41 | { }, |
@@ -540,11 +541,11 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) | |||
540 | return; | 541 | return; |
541 | } | 542 | } |
542 | 543 | ||
543 | usb_fill_int_urb(urb, hif_dev->udev, | 544 | usb_fill_bulk_urb(urb, hif_dev->udev, |
544 | usb_rcvbulkpipe(hif_dev->udev, | 545 | usb_rcvbulkpipe(hif_dev->udev, |
545 | USB_REG_IN_PIPE), | 546 | USB_REG_IN_PIPE), |
546 | nskb->data, MAX_REG_IN_BUF_SIZE, | 547 | nskb->data, MAX_REG_IN_BUF_SIZE, |
547 | ath9k_hif_usb_reg_in_cb, nskb, 1); | 548 | ath9k_hif_usb_reg_in_cb, nskb); |
548 | 549 | ||
549 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 550 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
550 | if (ret) { | 551 | if (ret) { |
@@ -720,11 +721,11 @@ static int ath9k_hif_usb_alloc_reg_in_urb(struct hif_device_usb *hif_dev) | |||
720 | if (!skb) | 721 | if (!skb) |
721 | goto err; | 722 | goto err; |
722 | 723 | ||
723 | usb_fill_int_urb(hif_dev->reg_in_urb, hif_dev->udev, | 724 | usb_fill_bulk_urb(hif_dev->reg_in_urb, hif_dev->udev, |
724 | usb_rcvbulkpipe(hif_dev->udev, | 725 | usb_rcvbulkpipe(hif_dev->udev, |
725 | USB_REG_IN_PIPE), | 726 | USB_REG_IN_PIPE), |
726 | skb->data, MAX_REG_IN_BUF_SIZE, | 727 | skb->data, MAX_REG_IN_BUF_SIZE, |
727 | ath9k_hif_usb_reg_in_cb, skb, 1); | 728 | ath9k_hif_usb_reg_in_cb, skb); |
728 | 729 | ||
729 | if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0) | 730 | if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0) |
730 | goto err; | 731 | goto err; |
@@ -843,14 +844,6 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev) | |||
843 | goto err_fw_req; | 844 | goto err_fw_req; |
844 | } | 845 | } |
845 | 846 | ||
846 | /* Alloc URBs */ | ||
847 | ret = ath9k_hif_usb_alloc_urbs(hif_dev); | ||
848 | if (ret) { | ||
849 | dev_err(&hif_dev->udev->dev, | ||
850 | "ath9k_htc: Unable to allocate URBs\n"); | ||
851 | goto err_urb; | ||
852 | } | ||
853 | |||
854 | /* Download firmware */ | 847 | /* Download firmware */ |
855 | ret = ath9k_hif_usb_download_fw(hif_dev); | 848 | ret = ath9k_hif_usb_download_fw(hif_dev); |
856 | if (ret) { | 849 | if (ret) { |
@@ -866,16 +859,22 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev) | |||
866 | */ | 859 | */ |
867 | for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) { | 860 | for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) { |
868 | endp = &alt->endpoint[idx].desc; | 861 | endp = &alt->endpoint[idx].desc; |
869 | if (((endp->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) | 862 | if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) |
870 | == 0x04) && | 863 | == USB_ENDPOINT_XFER_INT) { |
871 | ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | ||
872 | == USB_ENDPOINT_XFER_INT)) { | ||
873 | endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK; | 864 | endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK; |
874 | endp->bmAttributes |= USB_ENDPOINT_XFER_BULK; | 865 | endp->bmAttributes |= USB_ENDPOINT_XFER_BULK; |
875 | endp->bInterval = 0; | 866 | endp->bInterval = 0; |
876 | } | 867 | } |
877 | } | 868 | } |
878 | 869 | ||
870 | /* Alloc URBs */ | ||
871 | ret = ath9k_hif_usb_alloc_urbs(hif_dev); | ||
872 | if (ret) { | ||
873 | dev_err(&hif_dev->udev->dev, | ||
874 | "ath9k_htc: Unable to allocate URBs\n"); | ||
875 | goto err_urb; | ||
876 | } | ||
877 | |||
879 | return 0; | 878 | return 0; |
880 | 879 | ||
881 | err_fw_download: | 880 | err_fw_download: |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index cc13ee117823..6ebc68bca91f 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -484,6 +484,7 @@ static int ath9k_hw_post_init(struct ath_hw *ah) | |||
484 | ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, | 484 | ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, |
485 | "Failed allocating banks for " | 485 | "Failed allocating banks for " |
486 | "external radio\n"); | 486 | "external radio\n"); |
487 | ath9k_hw_rf_free_ext_banks(ah); | ||
487 | return ecode; | 488 | return ecode; |
488 | } | 489 | } |
489 | 490 | ||
@@ -952,9 +953,12 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode) | |||
952 | REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION); | 953 | REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION); |
953 | break; | 954 | break; |
954 | case NL80211_IFTYPE_STATION: | 955 | case NL80211_IFTYPE_STATION: |
955 | case NL80211_IFTYPE_MONITOR: | ||
956 | REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE); | 956 | REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE); |
957 | break; | 957 | break; |
958 | default: | ||
959 | if (ah->is_monitoring) | ||
960 | REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE); | ||
961 | break; | ||
958 | } | 962 | } |
959 | } | 963 | } |
960 | 964 | ||
@@ -1634,7 +1638,6 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period) | |||
1634 | 1638 | ||
1635 | switch (ah->opmode) { | 1639 | switch (ah->opmode) { |
1636 | case NL80211_IFTYPE_STATION: | 1640 | case NL80211_IFTYPE_STATION: |
1637 | case NL80211_IFTYPE_MONITOR: | ||
1638 | REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon)); | 1641 | REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon)); |
1639 | REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff); | 1642 | REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff); |
1640 | REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff); | 1643 | REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff); |
@@ -1663,6 +1666,14 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period) | |||
1663 | AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; | 1666 | AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; |
1664 | break; | 1667 | break; |
1665 | default: | 1668 | default: |
1669 | if (ah->is_monitoring) { | ||
1670 | REG_WRITE(ah, AR_NEXT_TBTT_TIMER, | ||
1671 | TU_TO_USEC(next_beacon)); | ||
1672 | REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff); | ||
1673 | REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff); | ||
1674 | flags |= AR_TBTT_TIMER_EN; | ||
1675 | break; | ||
1676 | } | ||
1666 | ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON, | 1677 | ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON, |
1667 | "%s: unsupported opmode: %d\n", | 1678 | "%s: unsupported opmode: %d\n", |
1668 | __func__, ah->opmode); | 1679 | __func__, ah->opmode); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index d032939768b0..d47d1b4b6002 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -622,6 +622,7 @@ struct ath_hw { | |||
622 | 622 | ||
623 | bool sw_mgmt_crypto; | 623 | bool sw_mgmt_crypto; |
624 | bool is_pciexpress; | 624 | bool is_pciexpress; |
625 | bool is_monitoring; | ||
625 | bool need_an_top2_fixup; | 626 | bool need_an_top2_fixup; |
626 | u16 tx_trig_level; | 627 | u16 tx_trig_level; |
627 | 628 | ||
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 95b41db0d86b..6a0d99eff404 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/pm_qos_params.h> | ||
18 | 19 | ||
19 | #include "ath9k.h" | 20 | #include "ath9k.h" |
20 | 21 | ||
@@ -179,6 +180,8 @@ static const struct ath_ops ath9k_common_ops = { | |||
179 | .write = ath9k_iowrite32, | 180 | .write = ath9k_iowrite32, |
180 | }; | 181 | }; |
181 | 182 | ||
183 | struct pm_qos_request_list ath9k_pm_qos_req; | ||
184 | |||
182 | /**************************/ | 185 | /**************************/ |
183 | /* Initialization */ | 186 | /* Initialization */ |
184 | /**************************/ | 187 | /**************************/ |
@@ -756,6 +759,9 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
756 | ath_init_leds(sc); | 759 | ath_init_leds(sc); |
757 | ath_start_rfkill_poll(sc); | 760 | ath_start_rfkill_poll(sc); |
758 | 761 | ||
762 | pm_qos_add_request(&ath9k_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | ||
763 | PM_QOS_DEFAULT_VALUE); | ||
764 | |||
759 | return 0; | 765 | return 0; |
760 | 766 | ||
761 | error_world: | 767 | error_world: |
@@ -811,6 +817,8 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
811 | 817 | ||
812 | ath9k_ps_wakeup(sc); | 818 | ath9k_ps_wakeup(sc); |
813 | 819 | ||
820 | pm_qos_remove_request(&ath9k_pm_qos_req); | ||
821 | |||
814 | wiphy_rfkill_stop_polling(sc->hw->wiphy); | 822 | wiphy_rfkill_stop_polling(sc->hw->wiphy); |
815 | ath_deinit_leds(sc); | 823 | ath_deinit_leds(sc); |
816 | 824 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index b52f1cf8a603..25d3ef4c338e 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/nl80211.h> | 17 | #include <linux/nl80211.h> |
18 | #include <linux/pm_qos_params.h> | ||
18 | #include "ath9k.h" | 19 | #include "ath9k.h" |
19 | #include "btcoex.h" | 20 | #include "btcoex.h" |
20 | 21 | ||
@@ -93,11 +94,13 @@ void ath9k_ps_wakeup(struct ath_softc *sc) | |||
93 | { | 94 | { |
94 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 95 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
95 | unsigned long flags; | 96 | unsigned long flags; |
97 | enum ath9k_power_mode power_mode; | ||
96 | 98 | ||
97 | spin_lock_irqsave(&sc->sc_pm_lock, flags); | 99 | spin_lock_irqsave(&sc->sc_pm_lock, flags); |
98 | if (++sc->ps_usecount != 1) | 100 | if (++sc->ps_usecount != 1) |
99 | goto unlock; | 101 | goto unlock; |
100 | 102 | ||
103 | power_mode = sc->sc_ah->power_mode; | ||
101 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); | 104 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); |
102 | 105 | ||
103 | /* | 106 | /* |
@@ -105,10 +108,12 @@ void ath9k_ps_wakeup(struct ath_softc *sc) | |||
105 | * useful data. Better clear them now so that they don't mess up | 108 | * useful data. Better clear them now so that they don't mess up |
106 | * survey data results. | 109 | * survey data results. |
107 | */ | 110 | */ |
108 | spin_lock(&common->cc_lock); | 111 | if (power_mode != ATH9K_PM_AWAKE) { |
109 | ath_hw_cycle_counters_update(common); | 112 | spin_lock(&common->cc_lock); |
110 | memset(&common->cc_survey, 0, sizeof(common->cc_survey)); | 113 | ath_hw_cycle_counters_update(common); |
111 | spin_unlock(&common->cc_lock); | 114 | memset(&common->cc_survey, 0, sizeof(common->cc_survey)); |
115 | spin_unlock(&common->cc_lock); | ||
116 | } | ||
112 | 117 | ||
113 | unlock: | 118 | unlock: |
114 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | 119 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); |
@@ -1217,6 +1222,7 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1217 | ah->imask |= ATH9K_INT_CST; | 1222 | ah->imask |= ATH9K_INT_CST; |
1218 | 1223 | ||
1219 | sc->sc_flags &= ~SC_OP_INVALID; | 1224 | sc->sc_flags &= ~SC_OP_INVALID; |
1225 | sc->sc_ah->is_monitoring = false; | ||
1220 | 1226 | ||
1221 | /* Disable BMISS interrupt when we're not associated */ | 1227 | /* Disable BMISS interrupt when we're not associated */ |
1222 | ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); | 1228 | ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); |
@@ -1238,6 +1244,8 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1238 | ath9k_btcoex_timer_resume(sc); | 1244 | ath9k_btcoex_timer_resume(sc); |
1239 | } | 1245 | } |
1240 | 1246 | ||
1247 | pm_qos_update_request(&ath9k_pm_qos_req, 55); | ||
1248 | |||
1241 | mutex_unlock: | 1249 | mutex_unlock: |
1242 | mutex_unlock(&sc->mutex); | 1250 | mutex_unlock(&sc->mutex); |
1243 | 1251 | ||
@@ -1415,6 +1423,8 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1415 | 1423 | ||
1416 | sc->sc_flags |= SC_OP_INVALID; | 1424 | sc->sc_flags |= SC_OP_INVALID; |
1417 | 1425 | ||
1426 | pm_qos_update_request(&ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE); | ||
1427 | |||
1418 | mutex_unlock(&sc->mutex); | 1428 | mutex_unlock(&sc->mutex); |
1419 | 1429 | ||
1420 | ath_print(common, ATH_DBG_CONFIG, "Driver halt\n"); | 1430 | ath_print(common, ATH_DBG_CONFIG, "Driver halt\n"); |
@@ -1493,8 +1503,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1493 | ath9k_hw_set_interrupts(ah, ah->imask); | 1503 | ath9k_hw_set_interrupts(ah, ah->imask); |
1494 | 1504 | ||
1495 | if (vif->type == NL80211_IFTYPE_AP || | 1505 | if (vif->type == NL80211_IFTYPE_AP || |
1496 | vif->type == NL80211_IFTYPE_ADHOC || | 1506 | vif->type == NL80211_IFTYPE_ADHOC) { |
1497 | vif->type == NL80211_IFTYPE_MONITOR) { | ||
1498 | sc->sc_flags |= SC_OP_ANI_RUN; | 1507 | sc->sc_flags |= SC_OP_ANI_RUN; |
1499 | ath_start_ani(common); | 1508 | ath_start_ani(common); |
1500 | } | 1509 | } |
@@ -1644,8 +1653,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1644 | if (changed & IEEE80211_CONF_CHANGE_MONITOR) { | 1653 | if (changed & IEEE80211_CONF_CHANGE_MONITOR) { |
1645 | if (conf->flags & IEEE80211_CONF_MONITOR) { | 1654 | if (conf->flags & IEEE80211_CONF_MONITOR) { |
1646 | ath_print(common, ATH_DBG_CONFIG, | 1655 | ath_print(common, ATH_DBG_CONFIG, |
1647 | "HW opmode set to Monitor mode\n"); | 1656 | "Monitor mode is enabled\n"); |
1648 | sc->sc_ah->opmode = NL80211_IFTYPE_MONITOR; | 1657 | sc->sc_ah->is_monitoring = true; |
1658 | } else { | ||
1659 | ath_print(common, ATH_DBG_CONFIG, | ||
1660 | "Monitor mode is disabled\n"); | ||
1661 | sc->sc_ah->is_monitoring = false; | ||
1649 | } | 1662 | } |
1650 | } | 1663 | } |
1651 | 1664 | ||
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index fddb0129bb57..c76ea53c20ce 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -441,7 +441,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc) | |||
441 | */ | 441 | */ |
442 | if (((sc->sc_ah->opmode != NL80211_IFTYPE_AP) && | 442 | if (((sc->sc_ah->opmode != NL80211_IFTYPE_AP) && |
443 | (sc->rx.rxfilter & FIF_PROMISC_IN_BSS)) || | 443 | (sc->rx.rxfilter & FIF_PROMISC_IN_BSS)) || |
444 | (sc->sc_ah->opmode == NL80211_IFTYPE_MONITOR)) | 444 | (sc->sc_ah->is_monitoring)) |
445 | rfilt |= ATH9K_RX_FILTER_PROM; | 445 | rfilt |= ATH9K_RX_FILTER_PROM; |
446 | 446 | ||
447 | if (sc->rx.rxfilter & FIF_CONTROL) | 447 | if (sc->rx.rxfilter & FIF_CONTROL) |
@@ -897,7 +897,7 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
897 | * decryption and MIC failures. For monitor mode, | 897 | * decryption and MIC failures. For monitor mode, |
898 | * we also ignore the CRC error. | 898 | * we also ignore the CRC error. |
899 | */ | 899 | */ |
900 | if (ah->opmode == NL80211_IFTYPE_MONITOR) { | 900 | if (ah->is_monitoring) { |
901 | if (rx_stats->rs_status & | 901 | if (rx_stats->rs_status & |
902 | ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC | | 902 | ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC | |
903 | ATH9K_RXERR_CRC)) | 903 | ATH9K_RXERR_CRC)) |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 42976b0a01c1..fa05b711e5cd 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -703,6 +703,7 @@ | |||
703 | #define AR_WA_RESET_EN (1 << 18) /* Sw Control to enable PCI-Reset to POR (bit 15) */ | 703 | #define AR_WA_RESET_EN (1 << 18) /* Sw Control to enable PCI-Reset to POR (bit 15) */ |
704 | #define AR_WA_ANALOG_SHIFT (1 << 20) | 704 | #define AR_WA_ANALOG_SHIFT (1 << 20) |
705 | #define AR_WA_POR_SHORT (1 << 21) /* PCI-E Phy reset control */ | 705 | #define AR_WA_POR_SHORT (1 << 21) /* PCI-E Phy reset control */ |
706 | #define AR_WA_BIT22 (1 << 22) | ||
706 | #define AR9285_WA_DEFAULT 0x004a050b | 707 | #define AR9285_WA_DEFAULT 0x004a050b |
707 | #define AR9280_WA_DEFAULT 0x0040073b | 708 | #define AR9280_WA_DEFAULT 0x0040073b |
708 | #define AR_WA_DEFAULT 0x0000073f | 709 | #define AR_WA_DEFAULT 0x0000073f |
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index d8607f4c144d..3317039cd28f 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c | |||
@@ -82,9 +82,11 @@ static struct usb_device_id carl9170_usb_ids[] = { | |||
82 | { USB_DEVICE(0x07d1, 0x3c10) }, | 82 | { USB_DEVICE(0x07d1, 0x3c10) }, |
83 | /* D-Link DWA 160 A2 */ | 83 | /* D-Link DWA 160 A2 */ |
84 | { USB_DEVICE(0x07d1, 0x3a09) }, | 84 | { USB_DEVICE(0x07d1, 0x3a09) }, |
85 | /* D-Link DWA 130 D */ | ||
86 | { USB_DEVICE(0x07d1, 0x3a0f) }, | ||
85 | /* Netgear WNA1000 */ | 87 | /* Netgear WNA1000 */ |
86 | { USB_DEVICE(0x0846, 0x9040) }, | 88 | { USB_DEVICE(0x0846, 0x9040) }, |
87 | /* Netgear WNDA3100 */ | 89 | /* Netgear WNDA3100 (v1) */ |
88 | { USB_DEVICE(0x0846, 0x9010) }, | 90 | { USB_DEVICE(0x0846, 0x9010) }, |
89 | /* Netgear WN111 v2 */ | 91 | /* Netgear WN111 v2 */ |
90 | { USB_DEVICE(0x0846, 0x9001), .driver_info = CARL9170_ONE_LED }, | 92 | { USB_DEVICE(0x0846, 0x9001), .driver_info = CARL9170_ONE_LED }, |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 8f8c4b73f8b9..7edf8c2fb8c7 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4000,7 +4000,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
4000 | * "the hard way", rather than using device's scan. | 4000 | * "the hard way", rather than using device's scan. |
4001 | */ | 4001 | */ |
4002 | if (iwl3945_mod_params.disable_hw_scan) { | 4002 | if (iwl3945_mod_params.disable_hw_scan) { |
4003 | IWL_ERR(priv, "sw scan support is deprecated\n"); | 4003 | dev_printk(KERN_DEBUG, &(pdev->dev), |
4004 | "sw scan support is deprecated\n"); | ||
4004 | iwl3945_hw_ops.hw_scan = NULL; | 4005 | iwl3945_hw_ops.hw_scan = NULL; |
4005 | } | 4006 | } |
4006 | 4007 | ||
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 5046a0005034..373930afc26b 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -700,8 +700,9 @@ static void lbs_scan_worker(struct work_struct *work) | |||
700 | 700 | ||
701 | if (priv->scan_channel < priv->scan_req->n_channels) { | 701 | if (priv->scan_channel < priv->scan_req->n_channels) { |
702 | cancel_delayed_work(&priv->scan_work); | 702 | cancel_delayed_work(&priv->scan_work); |
703 | queue_delayed_work(priv->work_thread, &priv->scan_work, | 703 | if (!priv->stopping) |
704 | msecs_to_jiffies(300)); | 704 | queue_delayed_work(priv->work_thread, &priv->scan_work, |
705 | msecs_to_jiffies(300)); | ||
705 | } | 706 | } |
706 | 707 | ||
707 | /* This is the final data we are about to send */ | 708 | /* This is the final data we are about to send */ |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index f062ed583901..cb14c38caf3a 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -36,6 +36,7 @@ struct lbs_private { | |||
36 | /* CFG80211 */ | 36 | /* CFG80211 */ |
37 | struct wireless_dev *wdev; | 37 | struct wireless_dev *wdev; |
38 | bool wiphy_registered; | 38 | bool wiphy_registered; |
39 | bool stopping; | ||
39 | struct cfg80211_scan_request *scan_req; | 40 | struct cfg80211_scan_request *scan_req; |
40 | u8 assoc_bss[ETH_ALEN]; | 41 | u8 assoc_bss[ETH_ALEN]; |
41 | u8 disassoc_reason; | 42 | u8 disassoc_reason; |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 47ce5a6ba120..46b88b118c99 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -104,6 +104,7 @@ static int lbs_dev_open(struct net_device *dev) | |||
104 | lbs_deb_enter(LBS_DEB_NET); | 104 | lbs_deb_enter(LBS_DEB_NET); |
105 | 105 | ||
106 | spin_lock_irq(&priv->driver_lock); | 106 | spin_lock_irq(&priv->driver_lock); |
107 | priv->stopping = false; | ||
107 | 108 | ||
108 | if (priv->connect_status == LBS_CONNECTED) | 109 | if (priv->connect_status == LBS_CONNECTED) |
109 | netif_carrier_on(dev); | 110 | netif_carrier_on(dev); |
@@ -131,10 +132,16 @@ static int lbs_eth_stop(struct net_device *dev) | |||
131 | lbs_deb_enter(LBS_DEB_NET); | 132 | lbs_deb_enter(LBS_DEB_NET); |
132 | 133 | ||
133 | spin_lock_irq(&priv->driver_lock); | 134 | spin_lock_irq(&priv->driver_lock); |
135 | priv->stopping = true; | ||
134 | netif_stop_queue(dev); | 136 | netif_stop_queue(dev); |
135 | spin_unlock_irq(&priv->driver_lock); | 137 | spin_unlock_irq(&priv->driver_lock); |
136 | 138 | ||
137 | schedule_work(&priv->mcast_work); | 139 | schedule_work(&priv->mcast_work); |
140 | cancel_delayed_work_sync(&priv->scan_work); | ||
141 | if (priv->scan_req) { | ||
142 | cfg80211_scan_done(priv->scan_req, false); | ||
143 | priv->scan_req = NULL; | ||
144 | } | ||
138 | 145 | ||
139 | lbs_deb_leave(LBS_DEB_NET); | 146 | lbs_deb_leave(LBS_DEB_NET); |
140 | return 0; | 147 | return 0; |
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index a38a7bd25f19..b9aedf18a046 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c | |||
@@ -57,7 +57,6 @@ | |||
57 | #include <linux/fcntl.h> | 57 | #include <linux/fcntl.h> |
58 | #include <linux/spinlock.h> | 58 | #include <linux/spinlock.h> |
59 | #include <linux/list.h> | 59 | #include <linux/list.h> |
60 | #include <linux/smp_lock.h> | ||
61 | #include <linux/usb.h> | 60 | #include <linux/usb.h> |
62 | #include <linux/timer.h> | 61 | #include <linux/timer.h> |
63 | 62 | ||
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index eea1ef2f502b..4396d4b9bfb9 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -221,9 +221,6 @@ config RT2X00_LIB_LEDS | |||
221 | boolean | 221 | boolean |
222 | default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n) | 222 | default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n) |
223 | 223 | ||
224 | comment "rt2x00 leds support disabled due to modularized LEDS_CLASS and built-in rt2x00" | ||
225 | depends on RT2X00_LIB=y && LEDS_CLASS=m | ||
226 | |||
227 | config RT2X00_LIB_DEBUGFS | 224 | config RT2X00_LIB_DEBUGFS |
228 | bool "Ralink debugfs support" | 225 | bool "Ralink debugfs support" |
229 | depends on RT2X00_LIB && MAC80211_DEBUGFS | 226 | depends on RT2X00_LIB && MAC80211_DEBUGFS |