diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-07-08 12:44:25 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-07-22 12:21:12 -0400 |
commit | 473ad712a49f8a7d9d2c5924a964a81a7ebf2e06 (patch) | |
tree | bff01ae09041ef494ea1f9b75efe3694faadc97d /drivers/net/wireless/iwlwifi/pcie | |
parent | 67c65f2cf7105f139909bad79c048e8aec0dc140 (diff) |
iwlwifi: dump CSRs to fw-error-dump
Add the Control Status Registers to the firmware error dump
infrastructure.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 153c3dd88921..06e04aaf61ee 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -1912,6 +1912,27 @@ static u32 iwl_trans_pcie_dump_prph(struct iwl_trans *trans, | |||
1912 | return prph_len; | 1912 | return prph_len; |
1913 | } | 1913 | } |
1914 | 1914 | ||
1915 | #define IWL_CSR_TO_DUMP (0x250) | ||
1916 | |||
1917 | static u32 iwl_trans_pcie_dump_csr(struct iwl_trans *trans, | ||
1918 | struct iwl_fw_error_dump_data **data) | ||
1919 | { | ||
1920 | u32 csr_len = sizeof(**data) + IWL_CSR_TO_DUMP; | ||
1921 | __le32 *val; | ||
1922 | int i; | ||
1923 | |||
1924 | (*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_CSR); | ||
1925 | (*data)->len = cpu_to_le32(IWL_CSR_TO_DUMP); | ||
1926 | val = (void *)(*data)->data; | ||
1927 | |||
1928 | for (i = 0; i < IWL_CSR_TO_DUMP; i += 4) | ||
1929 | *val++ = cpu_to_le32(iwl_trans_pcie_read32(trans, i)); | ||
1930 | |||
1931 | *data = iwl_fw_error_next_data(*data); | ||
1932 | |||
1933 | return csr_len; | ||
1934 | } | ||
1935 | |||
1915 | static | 1936 | static |
1916 | struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) | 1937 | struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) |
1917 | { | 1938 | { |
@@ -1923,9 +1944,17 @@ struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) | |||
1923 | u32 len; | 1944 | u32 len; |
1924 | int i, ptr; | 1945 | int i, ptr; |
1925 | 1946 | ||
1926 | len = sizeof(*dump_data) + sizeof(*data) + | 1947 | /* transport dump header */ |
1948 | len = sizeof(*dump_data); | ||
1949 | |||
1950 | /* host commands */ | ||
1951 | len += sizeof(*data) + | ||
1927 | cmdq->q.n_window * (sizeof(*txcmd) + TFD_MAX_PAYLOAD_SIZE); | 1952 | cmdq->q.n_window * (sizeof(*txcmd) + TFD_MAX_PAYLOAD_SIZE); |
1928 | 1953 | ||
1954 | /* CSR registers */ | ||
1955 | len += sizeof(*data) + IWL_CSR_TO_DUMP; | ||
1956 | |||
1957 | /* PRPH registers */ | ||
1929 | for (i = 0; i < ARRAY_SIZE(iwl_prph_dump_addr); i++) { | 1958 | for (i = 0; i < ARRAY_SIZE(iwl_prph_dump_addr); i++) { |
1930 | /* The range includes both boundaries */ | 1959 | /* The range includes both boundaries */ |
1931 | int num_bytes_in_chunk = iwl_prph_dump_addr[i].end - | 1960 | int num_bytes_in_chunk = iwl_prph_dump_addr[i].end - |
@@ -1935,6 +1964,7 @@ struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) | |||
1935 | num_bytes_in_chunk; | 1964 | num_bytes_in_chunk; |
1936 | } | 1965 | } |
1937 | 1966 | ||
1967 | /* FW monitor */ | ||
1938 | if (trans_pcie->fw_mon_page) | 1968 | if (trans_pcie->fw_mon_page) |
1939 | len += sizeof(*data) + sizeof(struct iwl_fw_error_dump_fw_mon) + | 1969 | len += sizeof(*data) + sizeof(struct iwl_fw_error_dump_fw_mon) + |
1940 | trans_pcie->fw_mon_size; | 1970 | trans_pcie->fw_mon_size; |
@@ -1973,6 +2003,7 @@ struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) | |||
1973 | data = iwl_fw_error_next_data(data); | 2003 | data = iwl_fw_error_next_data(data); |
1974 | 2004 | ||
1975 | len += iwl_trans_pcie_dump_prph(trans, &data); | 2005 | len += iwl_trans_pcie_dump_prph(trans, &data); |
2006 | len += iwl_trans_pcie_dump_csr(trans, &data); | ||
1976 | /* data is already pointing to the next section */ | 2007 | /* data is already pointing to the next section */ |
1977 | 2008 | ||
1978 | if (trans_pcie->fw_mon_page) { | 2009 | if (trans_pcie->fw_mon_page) { |