diff options
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r-- | drivers/net/qlge/qlge.h | 9 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 30 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_mpi.c | 12 |
4 files changed, 23 insertions, 30 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 30d5585beeee..9e53ca9c3b43 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
11 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
12 | #include <linux/rtnetlink.h> | ||
12 | 13 | ||
13 | /* | 14 | /* |
14 | * General definitions... | 15 | * General definitions... |
@@ -135,9 +136,9 @@ enum { | |||
135 | RST_FO_TFO = (1 << 0), | 136 | RST_FO_TFO = (1 << 0), |
136 | RST_FO_RR_MASK = 0x00060000, | 137 | RST_FO_RR_MASK = 0x00060000, |
137 | RST_FO_RR_CQ_CAM = 0x00000000, | 138 | RST_FO_RR_CQ_CAM = 0x00000000, |
138 | RST_FO_RR_DROP = 0x00000001, | 139 | RST_FO_RR_DROP = 0x00000002, |
139 | RST_FO_RR_DQ = 0x00000002, | 140 | RST_FO_RR_DQ = 0x00000004, |
140 | RST_FO_RR_RCV_FUNC_CQ = 0x00000003, | 141 | RST_FO_RR_RCV_FUNC_CQ = 0x00000006, |
141 | RST_FO_FRB = (1 << 12), | 142 | RST_FO_FRB = (1 << 12), |
142 | RST_FO_MOP = (1 << 13), | 143 | RST_FO_MOP = (1 << 13), |
143 | RST_FO_REG = (1 << 14), | 144 | RST_FO_REG = (1 << 14), |
@@ -1477,7 +1478,6 @@ struct ql_adapter { | |||
1477 | u32 mailbox_in; | 1478 | u32 mailbox_in; |
1478 | u32 mailbox_out; | 1479 | u32 mailbox_out; |
1479 | struct mbox_params idc_mbc; | 1480 | struct mbox_params idc_mbc; |
1480 | struct mutex mpi_mutex; | ||
1481 | 1481 | ||
1482 | int tx_ring_size; | 1482 | int tx_ring_size; |
1483 | int rx_ring_size; | 1483 | int rx_ring_size; |
@@ -1516,7 +1516,6 @@ struct ql_adapter { | |||
1516 | 1516 | ||
1517 | union flash_params flash; | 1517 | union flash_params flash; |
1518 | 1518 | ||
1519 | struct net_device_stats stats; | ||
1520 | struct workqueue_struct *workqueue; | 1519 | struct workqueue_struct *workqueue; |
1521 | struct delayed_work asic_reset_work; | 1520 | struct delayed_work asic_reset_work; |
1522 | struct delayed_work mpi_reset_work; | 1521 | struct delayed_work mpi_reset_work; |
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index 68f9bd280f86..52073946bce3 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -45,7 +45,6 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) | |||
45 | if (!netif_running(qdev->ndev)) | 45 | if (!netif_running(qdev->ndev)) |
46 | return status; | 46 | return status; |
47 | 47 | ||
48 | spin_lock(&qdev->hw_lock); | ||
49 | /* Skip the default queue, and update the outbound handler | 48 | /* Skip the default queue, and update the outbound handler |
50 | * queues if they changed. | 49 | * queues if they changed. |
51 | */ | 50 | */ |
@@ -92,7 +91,6 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) | |||
92 | } | 91 | } |
93 | } | 92 | } |
94 | exit: | 93 | exit: |
95 | spin_unlock(&qdev->hw_lock); | ||
96 | return status; | 94 | return status; |
97 | } | 95 | } |
98 | 96 | ||
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 3d0efea32111..fde5af0d5b46 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/etherdevice.h> | 34 | #include <linux/etherdevice.h> |
35 | #include <linux/ethtool.h> | 35 | #include <linux/ethtool.h> |
36 | #include <linux/skbuff.h> | 36 | #include <linux/skbuff.h> |
37 | #include <linux/rtnetlink.h> | ||
38 | #include <linux/if_vlan.h> | 37 | #include <linux/if_vlan.h> |
39 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
40 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
@@ -1645,8 +1644,8 @@ static void ql_process_mac_rx_intr(struct ql_adapter *qdev, | |||
1645 | } | 1644 | } |
1646 | } | 1645 | } |
1647 | 1646 | ||
1648 | qdev->stats.rx_packets++; | 1647 | ndev->stats.rx_packets++; |
1649 | qdev->stats.rx_bytes += skb->len; | 1648 | ndev->stats.rx_bytes += skb->len; |
1650 | skb_record_rx_queue(skb, rx_ring->cq_id); | 1649 | skb_record_rx_queue(skb, rx_ring->cq_id); |
1651 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) { | 1650 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) { |
1652 | if (qdev->vlgrp && | 1651 | if (qdev->vlgrp && |
@@ -1670,6 +1669,7 @@ static void ql_process_mac_rx_intr(struct ql_adapter *qdev, | |||
1670 | static void ql_process_mac_tx_intr(struct ql_adapter *qdev, | 1669 | static void ql_process_mac_tx_intr(struct ql_adapter *qdev, |
1671 | struct ob_mac_iocb_rsp *mac_rsp) | 1670 | struct ob_mac_iocb_rsp *mac_rsp) |
1672 | { | 1671 | { |
1672 | struct net_device *ndev = qdev->ndev; | ||
1673 | struct tx_ring *tx_ring; | 1673 | struct tx_ring *tx_ring; |
1674 | struct tx_ring_desc *tx_ring_desc; | 1674 | struct tx_ring_desc *tx_ring_desc; |
1675 | 1675 | ||
@@ -1677,8 +1677,8 @@ static void ql_process_mac_tx_intr(struct ql_adapter *qdev, | |||
1677 | tx_ring = &qdev->tx_ring[mac_rsp->txq_idx]; | 1677 | tx_ring = &qdev->tx_ring[mac_rsp->txq_idx]; |
1678 | tx_ring_desc = &tx_ring->q[mac_rsp->tid]; | 1678 | tx_ring_desc = &tx_ring->q[mac_rsp->tid]; |
1679 | ql_unmap_send(qdev, tx_ring_desc, tx_ring_desc->map_cnt); | 1679 | ql_unmap_send(qdev, tx_ring_desc, tx_ring_desc->map_cnt); |
1680 | qdev->stats.tx_bytes += (tx_ring_desc->skb)->len; | 1680 | ndev->stats.tx_bytes += (tx_ring_desc->skb)->len; |
1681 | qdev->stats.tx_packets++; | 1681 | ndev->stats.tx_packets++; |
1682 | dev_kfree_skb(tx_ring_desc->skb); | 1682 | dev_kfree_skb(tx_ring_desc->skb); |
1683 | tx_ring_desc->skb = NULL; | 1683 | tx_ring_desc->skb = NULL; |
1684 | 1684 | ||
@@ -1926,12 +1926,10 @@ static void ql_vlan_rx_add_vid(struct net_device *ndev, u16 vid) | |||
1926 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); | 1926 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); |
1927 | if (status) | 1927 | if (status) |
1928 | return; | 1928 | return; |
1929 | spin_lock(&qdev->hw_lock); | ||
1930 | if (ql_set_mac_addr_reg | 1929 | if (ql_set_mac_addr_reg |
1931 | (qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) { | 1930 | (qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) { |
1932 | QPRINTK(qdev, IFUP, ERR, "Failed to init vlan address.\n"); | 1931 | QPRINTK(qdev, IFUP, ERR, "Failed to init vlan address.\n"); |
1933 | } | 1932 | } |
1934 | spin_unlock(&qdev->hw_lock); | ||
1935 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | 1933 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); |
1936 | } | 1934 | } |
1937 | 1935 | ||
@@ -1945,12 +1943,10 @@ static void ql_vlan_rx_kill_vid(struct net_device *ndev, u16 vid) | |||
1945 | if (status) | 1943 | if (status) |
1946 | return; | 1944 | return; |
1947 | 1945 | ||
1948 | spin_lock(&qdev->hw_lock); | ||
1949 | if (ql_set_mac_addr_reg | 1946 | if (ql_set_mac_addr_reg |
1950 | (qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) { | 1947 | (qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) { |
1951 | QPRINTK(qdev, IFUP, ERR, "Failed to clear vlan address.\n"); | 1948 | QPRINTK(qdev, IFUP, ERR, "Failed to clear vlan address.\n"); |
1952 | } | 1949 | } |
1953 | spin_unlock(&qdev->hw_lock); | ||
1954 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | 1950 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); |
1955 | 1951 | ||
1956 | } | 1952 | } |
@@ -2001,15 +1997,17 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
2001 | /* | 1997 | /* |
2002 | * Check MPI processor activity. | 1998 | * Check MPI processor activity. |
2003 | */ | 1999 | */ |
2004 | if (var & STS_PI) { | 2000 | if ((var & STS_PI) && |
2001 | (ql_read32(qdev, INTR_MASK) & INTR_MASK_PI)) { | ||
2005 | /* | 2002 | /* |
2006 | * We've got an async event or mailbox completion. | 2003 | * We've got an async event or mailbox completion. |
2007 | * Handle it and clear the source of the interrupt. | 2004 | * Handle it and clear the source of the interrupt. |
2008 | */ | 2005 | */ |
2009 | QPRINTK(qdev, INTR, ERR, "Got MPI processor interrupt.\n"); | 2006 | QPRINTK(qdev, INTR, ERR, "Got MPI processor interrupt.\n"); |
2010 | ql_disable_completion_interrupt(qdev, intr_context->intr); | 2007 | ql_disable_completion_interrupt(qdev, intr_context->intr); |
2011 | queue_delayed_work_on(smp_processor_id(), qdev->workqueue, | 2008 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); |
2012 | &qdev->mpi_work, 0); | 2009 | queue_delayed_work_on(smp_processor_id(), |
2010 | qdev->workqueue, &qdev->mpi_work, 0); | ||
2013 | work_done++; | 2011 | work_done++; |
2014 | } | 2012 | } |
2015 | 2013 | ||
@@ -3572,8 +3570,7 @@ static int qlge_change_mtu(struct net_device *ndev, int new_mtu) | |||
3572 | static struct net_device_stats *qlge_get_stats(struct net_device | 3570 | static struct net_device_stats *qlge_get_stats(struct net_device |
3573 | *ndev) | 3571 | *ndev) |
3574 | { | 3572 | { |
3575 | struct ql_adapter *qdev = netdev_priv(ndev); | 3573 | return &ndev->stats; |
3576 | return &qdev->stats; | ||
3577 | } | 3574 | } |
3578 | 3575 | ||
3579 | static void qlge_set_multicast_list(struct net_device *ndev) | 3576 | static void qlge_set_multicast_list(struct net_device *ndev) |
@@ -3585,7 +3582,6 @@ static void qlge_set_multicast_list(struct net_device *ndev) | |||
3585 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); | 3582 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); |
3586 | if (status) | 3583 | if (status) |
3587 | return; | 3584 | return; |
3588 | spin_lock(&qdev->hw_lock); | ||
3589 | /* | 3585 | /* |
3590 | * Set or clear promiscuous mode if a | 3586 | * Set or clear promiscuous mode if a |
3591 | * transition is taking place. | 3587 | * transition is taking place. |
@@ -3662,7 +3658,6 @@ static void qlge_set_multicast_list(struct net_device *ndev) | |||
3662 | } | 3658 | } |
3663 | } | 3659 | } |
3664 | exit: | 3660 | exit: |
3665 | spin_unlock(&qdev->hw_lock); | ||
3666 | ql_sem_unlock(qdev, SEM_RT_IDX_MASK); | 3661 | ql_sem_unlock(qdev, SEM_RT_IDX_MASK); |
3667 | } | 3662 | } |
3668 | 3663 | ||
@@ -3682,10 +3677,8 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p) | |||
3682 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); | 3677 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); |
3683 | if (status) | 3678 | if (status) |
3684 | return status; | 3679 | return status; |
3685 | spin_lock(&qdev->hw_lock); | ||
3686 | status = ql_set_mac_addr_reg(qdev, (u8 *) ndev->dev_addr, | 3680 | status = ql_set_mac_addr_reg(qdev, (u8 *) ndev->dev_addr, |
3687 | MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ); | 3681 | MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ); |
3688 | spin_unlock(&qdev->hw_lock); | ||
3689 | if (status) | 3682 | if (status) |
3690 | QPRINTK(qdev, HW, ERR, "Failed to load MAC address.\n"); | 3683 | QPRINTK(qdev, HW, ERR, "Failed to load MAC address.\n"); |
3691 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | 3684 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); |
@@ -3928,7 +3921,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
3928 | INIT_DELAYED_WORK(&qdev->mpi_work, ql_mpi_work); | 3921 | INIT_DELAYED_WORK(&qdev->mpi_work, ql_mpi_work); |
3929 | INIT_DELAYED_WORK(&qdev->mpi_port_cfg_work, ql_mpi_port_cfg_work); | 3922 | INIT_DELAYED_WORK(&qdev->mpi_port_cfg_work, ql_mpi_port_cfg_work); |
3930 | INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); | 3923 | INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); |
3931 | mutex_init(&qdev->mpi_mutex); | ||
3932 | init_completion(&qdev->ide_completion); | 3924 | init_completion(&qdev->ide_completion); |
3933 | 3925 | ||
3934 | if (!cards_found) { | 3926 | if (!cards_found) { |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 6685bd97da91..c2e43073047e 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -472,7 +472,6 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
472 | { | 472 | { |
473 | int status, count; | 473 | int status, count; |
474 | 474 | ||
475 | mutex_lock(&qdev->mpi_mutex); | ||
476 | 475 | ||
477 | /* Begin polled mode for MPI */ | 476 | /* Begin polled mode for MPI */ |
478 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); | 477 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); |
@@ -541,7 +540,6 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
541 | status = -EIO; | 540 | status = -EIO; |
542 | } | 541 | } |
543 | end: | 542 | end: |
544 | mutex_unlock(&qdev->mpi_mutex); | ||
545 | /* End polled mode for MPI */ | 543 | /* End polled mode for MPI */ |
546 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); | 544 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); |
547 | return status; | 545 | return status; |
@@ -776,7 +774,9 @@ static int ql_idc_wait(struct ql_adapter *qdev) | |||
776 | static int ql_set_port_cfg(struct ql_adapter *qdev) | 774 | static int ql_set_port_cfg(struct ql_adapter *qdev) |
777 | { | 775 | { |
778 | int status; | 776 | int status; |
777 | rtnl_lock(); | ||
779 | status = ql_mb_set_port_cfg(qdev); | 778 | status = ql_mb_set_port_cfg(qdev); |
779 | rtnl_unlock(); | ||
780 | if (status) | 780 | if (status) |
781 | return status; | 781 | return status; |
782 | status = ql_idc_wait(qdev); | 782 | status = ql_idc_wait(qdev); |
@@ -797,7 +797,9 @@ void ql_mpi_port_cfg_work(struct work_struct *work) | |||
797 | container_of(work, struct ql_adapter, mpi_port_cfg_work.work); | 797 | container_of(work, struct ql_adapter, mpi_port_cfg_work.work); |
798 | int status; | 798 | int status; |
799 | 799 | ||
800 | rtnl_lock(); | ||
800 | status = ql_mb_get_port_cfg(qdev); | 801 | status = ql_mb_get_port_cfg(qdev); |
802 | rtnl_unlock(); | ||
801 | if (status) { | 803 | if (status) { |
802 | QPRINTK(qdev, DRV, ERR, | 804 | QPRINTK(qdev, DRV, ERR, |
803 | "Bug: Failed to get port config data.\n"); | 805 | "Bug: Failed to get port config data.\n"); |
@@ -855,7 +857,9 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
855 | * needs to be set. | 857 | * needs to be set. |
856 | * */ | 858 | * */ |
857 | set_bit(QL_CAM_RT_SET, &qdev->flags); | 859 | set_bit(QL_CAM_RT_SET, &qdev->flags); |
860 | rtnl_lock(); | ||
858 | status = ql_mb_idc_ack(qdev); | 861 | status = ql_mb_idc_ack(qdev); |
862 | rtnl_unlock(); | ||
859 | if (status) { | 863 | if (status) { |
860 | QPRINTK(qdev, DRV, ERR, | 864 | QPRINTK(qdev, DRV, ERR, |
861 | "Bug: No pending IDC!\n"); | 865 | "Bug: No pending IDC!\n"); |
@@ -871,7 +875,7 @@ void ql_mpi_work(struct work_struct *work) | |||
871 | struct mbox_params *mbcp = &mbc; | 875 | struct mbox_params *mbcp = &mbc; |
872 | int err = 0; | 876 | int err = 0; |
873 | 877 | ||
874 | mutex_lock(&qdev->mpi_mutex); | 878 | rtnl_lock(); |
875 | 879 | ||
876 | while (ql_read32(qdev, STS) & STS_PI) { | 880 | while (ql_read32(qdev, STS) & STS_PI) { |
877 | memset(mbcp, 0, sizeof(struct mbox_params)); | 881 | memset(mbcp, 0, sizeof(struct mbox_params)); |
@@ -884,7 +888,7 @@ void ql_mpi_work(struct work_struct *work) | |||
884 | break; | 888 | break; |
885 | } | 889 | } |
886 | 890 | ||
887 | mutex_unlock(&qdev->mpi_mutex); | 891 | rtnl_unlock(); |
888 | ql_enable_completion_interrupt(qdev, 0); | 892 | ql_enable_completion_interrupt(qdev, 0); |
889 | } | 893 | } |
890 | 894 | ||