diff options
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 45421c8b6010..3d1d7b6e55aa 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -641,7 +641,7 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev) | |||
641 | 641 | ||
642 | } | 642 | } |
643 | 643 | ||
644 | static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data) | 644 | static int ql_read_flash_word(struct ql_adapter *qdev, int offset, __le32 *data) |
645 | { | 645 | { |
646 | int status = 0; | 646 | int status = 0; |
647 | /* wait for reg to come ready */ | 647 | /* wait for reg to come ready */ |
@@ -656,8 +656,11 @@ static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data) | |||
656 | FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR); | 656 | FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR); |
657 | if (status) | 657 | if (status) |
658 | goto exit; | 658 | goto exit; |
659 | /* get the data */ | 659 | /* This data is stored on flash as an array of |
660 | *data = ql_read32(qdev, FLASH_DATA); | 660 | * __le32. Since ql_read32() returns cpu endian |
661 | * we need to swap it back. | ||
662 | */ | ||
663 | *data = cpu_to_le32(ql_read32(qdev, FLASH_DATA)); | ||
661 | exit: | 664 | exit: |
662 | return status; | 665 | return status; |
663 | } | 666 | } |
@@ -666,13 +669,20 @@ static int ql_get_flash_params(struct ql_adapter *qdev) | |||
666 | { | 669 | { |
667 | int i; | 670 | int i; |
668 | int status; | 671 | int status; |
669 | u32 *p = (u32 *)&qdev->flash; | 672 | __le32 *p = (__le32 *)&qdev->flash; |
673 | u32 offset = 0; | ||
674 | |||
675 | /* Second function's parameters follow the first | ||
676 | * function's. | ||
677 | */ | ||
678 | if (qdev->func) | ||
679 | offset = sizeof(qdev->flash) / sizeof(u32); | ||
670 | 680 | ||
671 | if (ql_sem_spinlock(qdev, SEM_FLASH_MASK)) | 681 | if (ql_sem_spinlock(qdev, SEM_FLASH_MASK)) |
672 | return -ETIMEDOUT; | 682 | return -ETIMEDOUT; |
673 | 683 | ||
674 | for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) { | 684 | for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) { |
675 | status = ql_read_flash_word(qdev, i, p); | 685 | status = ql_read_flash_word(qdev, i+offset, p); |
676 | if (status) { | 686 | if (status) { |
677 | QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n"); | 687 | QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n"); |
678 | goto exit; | 688 | goto exit; |
@@ -3826,7 +3836,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3826 | { | 3836 | { |
3827 | struct net_device *ndev = pci_get_drvdata(pdev); | 3837 | struct net_device *ndev = pci_get_drvdata(pdev); |
3828 | struct ql_adapter *qdev = netdev_priv(ndev); | 3838 | struct ql_adapter *qdev = netdev_priv(ndev); |
3829 | int err; | 3839 | int err, i; |
3830 | 3840 | ||
3831 | netif_device_detach(ndev); | 3841 | netif_device_detach(ndev); |
3832 | 3842 | ||
@@ -3836,6 +3846,9 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3836 | return err; | 3846 | return err; |
3837 | } | 3847 | } |
3838 | 3848 | ||
3849 | for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++) | ||
3850 | netif_napi_del(&qdev->rx_ring[i].napi); | ||
3851 | |||
3839 | err = pci_save_state(pdev); | 3852 | err = pci_save_state(pdev); |
3840 | if (err) | 3853 | if (err) |
3841 | return err; | 3854 | return err; |