diff options
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 2 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 5c89f4e4635b..2ed34cd43e1c 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -960,6 +960,8 @@ struct qlcnic_adapter { | |||
960 | 960 | ||
961 | u8 mac_addr[ETH_ALEN]; | 961 | u8 mac_addr[ETH_ALEN]; |
962 | 962 | ||
963 | u64 dev_rst_time; | ||
964 | |||
963 | struct qlcnic_adapter_stats stats; | 965 | struct qlcnic_adapter_stats stats; |
964 | 966 | ||
965 | struct qlcnic_recv_context recv_ctx; | 967 | struct qlcnic_recv_context recv_ctx; |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 6a7b81388351..f1949c93ab25 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -84,6 +84,7 @@ static void qlcnic_remove_sysfs_entries(struct qlcnic_adapter *adapter); | |||
84 | static void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter); | 84 | static void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter); |
85 | static void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter); | 85 | static void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter); |
86 | 86 | ||
87 | static void qlcnic_idc_debug_info(struct qlcnic_adapter *adapter, u8 encoding); | ||
87 | static void qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter); | 88 | static void qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter); |
88 | static int qlcnic_can_start_firmware(struct qlcnic_adapter *adapter); | 89 | static int qlcnic_can_start_firmware(struct qlcnic_adapter *adapter); |
89 | 90 | ||
@@ -620,6 +621,7 @@ wait_init: | |||
620 | goto err_out; | 621 | goto err_out; |
621 | 622 | ||
622 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_READY); | 623 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_READY); |
624 | qlcnic_idc_debug_info(adapter, 1); | ||
623 | 625 | ||
624 | qlcnic_check_options(adapter); | 626 | qlcnic_check_options(adapter); |
625 | 627 | ||
@@ -1056,6 +1058,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1056 | adapter = netdev_priv(netdev); | 1058 | adapter = netdev_priv(netdev); |
1057 | adapter->netdev = netdev; | 1059 | adapter->netdev = netdev; |
1058 | adapter->pdev = pdev; | 1060 | adapter->pdev = pdev; |
1061 | adapter->dev_rst_time = jiffies; | ||
1059 | adapter->ahw.pci_func = pci_func_id; | 1062 | adapter->ahw.pci_func = pci_func_id; |
1060 | 1063 | ||
1061 | revision_id = pdev->revision; | 1064 | revision_id = pdev->revision; |
@@ -1887,6 +1890,19 @@ static void qlcnic_poll_controller(struct net_device *netdev) | |||
1887 | } | 1890 | } |
1888 | #endif | 1891 | #endif |
1889 | 1892 | ||
1893 | static void | ||
1894 | qlcnic_idc_debug_info(struct qlcnic_adapter *adapter, u8 encoding) | ||
1895 | { | ||
1896 | u32 val; | ||
1897 | |||
1898 | val = adapter->portnum & 0xf; | ||
1899 | val |= encoding << 7; | ||
1900 | val |= (jiffies - adapter->dev_rst_time) << 8; | ||
1901 | |||
1902 | QLCWR32(adapter, QLCNIC_CRB_DRV_SCRATCH, val); | ||
1903 | adapter->dev_rst_time = jiffies; | ||
1904 | } | ||
1905 | |||
1890 | static int | 1906 | static int |
1891 | qlcnic_set_drv_state(struct qlcnic_adapter *adapter, u8 state) | 1907 | qlcnic_set_drv_state(struct qlcnic_adapter *adapter, u8 state) |
1892 | { | 1908 | { |
@@ -2010,6 +2026,7 @@ qlcnic_can_start_firmware(struct qlcnic_adapter *adapter) | |||
2010 | case QLCNIC_DEV_COLD: | 2026 | case QLCNIC_DEV_COLD: |
2011 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITIALIZING); | 2027 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITIALIZING); |
2012 | QLCWR32(adapter, QLCNIC_CRB_DRV_IDC_VER, QLCNIC_DRV_IDC_VER); | 2028 | QLCWR32(adapter, QLCNIC_CRB_DRV_IDC_VER, QLCNIC_DRV_IDC_VER); |
2029 | qlcnic_idc_debug_info(adapter, 0); | ||
2013 | qlcnic_api_unlock(adapter); | 2030 | qlcnic_api_unlock(adapter); |
2014 | return 1; | 2031 | return 1; |
2015 | 2032 | ||
@@ -2102,6 +2119,8 @@ skip_ack_check: | |||
2102 | qlcnic_schedule_work(adapter, qlcnic_fwinit_work, | 2119 | qlcnic_schedule_work(adapter, qlcnic_fwinit_work, |
2103 | FW_POLL_DELAY * 2); | 2120 | FW_POLL_DELAY * 2); |
2104 | QLCDB(adapter, DRV, "Quiscing the driver\n"); | 2121 | QLCDB(adapter, DRV, "Quiscing the driver\n"); |
2122 | qlcnic_idc_debug_info(adapter, 0); | ||
2123 | |||
2105 | qlcnic_api_unlock(adapter); | 2124 | qlcnic_api_unlock(adapter); |
2106 | return; | 2125 | return; |
2107 | } | 2126 | } |
@@ -2111,6 +2130,7 @@ skip_ack_check: | |||
2111 | QLCNIC_DEV_INITIALIZING); | 2130 | QLCNIC_DEV_INITIALIZING); |
2112 | set_bit(__QLCNIC_START_FW, &adapter->state); | 2131 | set_bit(__QLCNIC_START_FW, &adapter->state); |
2113 | QLCDB(adapter, DRV, "Restarting fw\n"); | 2132 | QLCDB(adapter, DRV, "Restarting fw\n"); |
2133 | qlcnic_idc_debug_info(adapter, 0); | ||
2114 | } | 2134 | } |
2115 | 2135 | ||
2116 | qlcnic_api_unlock(adapter); | 2136 | qlcnic_api_unlock(adapter); |
@@ -2206,6 +2226,7 @@ qlcnic_dev_request_reset(struct qlcnic_adapter *adapter) | |||
2206 | if (state == QLCNIC_DEV_READY) { | 2226 | if (state == QLCNIC_DEV_READY) { |
2207 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_NEED_RESET); | 2227 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_NEED_RESET); |
2208 | QLCDB(adapter, DRV, "NEED_RESET state set\n"); | 2228 | QLCDB(adapter, DRV, "NEED_RESET state set\n"); |
2229 | qlcnic_idc_debug_info(adapter, 0); | ||
2209 | } | 2230 | } |
2210 | 2231 | ||
2211 | qlcnic_api_unlock(adapter); | 2232 | qlcnic_api_unlock(adapter); |