aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-09-06 12:31:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-14 13:56:42 -0400
commitff620849110649b5f94989ddfd7a72b2bd43bd42 (patch)
tree5a1754e5057bd82aaf676bb7d6586907062e8984 /drivers/net/wireless/iwlwifi/iwl-trans.c
parent1ad625ce74f5211045aad6450f7382fd3c599f7e (diff)
iwlagn: fix compilation when debug flags is unset
Trivial fixes to allow compilation without warnings when debug compilation flag isn't set. Also fix the compilation when debugfs flag isn't set. Fix a warning: unused priv pointer on the way. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.c260
1 files changed, 130 insertions, 130 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index c495fc302deb..b2e89077c684 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.c
@@ -1505,6 +1505,136 @@ static int iwl_trans_pcie_check_stuck_queue(struct iwl_trans *trans, int cnt)
1505 return 0; 1505 return 0;
1506} 1506}
1507 1507
1508static const char *get_fh_string(int cmd)
1509{
1510 switch (cmd) {
1511 IWL_CMD(FH_RSCSR_CHNL0_STTS_WPTR_REG);
1512 IWL_CMD(FH_RSCSR_CHNL0_RBDCB_BASE_REG);
1513 IWL_CMD(FH_RSCSR_CHNL0_WPTR);
1514 IWL_CMD(FH_MEM_RCSR_CHNL0_CONFIG_REG);
1515 IWL_CMD(FH_MEM_RSSR_SHARED_CTRL_REG);
1516 IWL_CMD(FH_MEM_RSSR_RX_STATUS_REG);
1517 IWL_CMD(FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV);
1518 IWL_CMD(FH_TSSR_TX_STATUS_REG);
1519 IWL_CMD(FH_TSSR_TX_ERROR_REG);
1520 default:
1521 return "UNKNOWN";
1522 }
1523}
1524
1525int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display)
1526{
1527 int i;
1528#ifdef CONFIG_IWLWIFI_DEBUG
1529 int pos = 0;
1530 size_t bufsz = 0;
1531#endif
1532 static const u32 fh_tbl[] = {
1533 FH_RSCSR_CHNL0_STTS_WPTR_REG,
1534 FH_RSCSR_CHNL0_RBDCB_BASE_REG,
1535 FH_RSCSR_CHNL0_WPTR,
1536 FH_MEM_RCSR_CHNL0_CONFIG_REG,
1537 FH_MEM_RSSR_SHARED_CTRL_REG,
1538 FH_MEM_RSSR_RX_STATUS_REG,
1539 FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV,
1540 FH_TSSR_TX_STATUS_REG,
1541 FH_TSSR_TX_ERROR_REG
1542 };
1543#ifdef CONFIG_IWLWIFI_DEBUG
1544 if (display) {
1545 bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40;
1546 *buf = kmalloc(bufsz, GFP_KERNEL);
1547 if (!*buf)
1548 return -ENOMEM;
1549 pos += scnprintf(*buf + pos, bufsz - pos,
1550 "FH register values:\n");
1551 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
1552 pos += scnprintf(*buf + pos, bufsz - pos,
1553 " %34s: 0X%08x\n",
1554 get_fh_string(fh_tbl[i]),
1555 iwl_read_direct32(bus(trans), fh_tbl[i]));
1556 }
1557 return pos;
1558 }
1559#endif
1560 IWL_ERR(trans, "FH register values:\n");
1561 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
1562 IWL_ERR(trans, " %34s: 0X%08x\n",
1563 get_fh_string(fh_tbl[i]),
1564 iwl_read_direct32(bus(trans), fh_tbl[i]));
1565 }
1566 return 0;
1567}
1568
1569static const char *get_csr_string(int cmd)
1570{
1571 switch (cmd) {
1572 IWL_CMD(CSR_HW_IF_CONFIG_REG);
1573 IWL_CMD(CSR_INT_COALESCING);
1574 IWL_CMD(CSR_INT);
1575 IWL_CMD(CSR_INT_MASK);
1576 IWL_CMD(CSR_FH_INT_STATUS);
1577 IWL_CMD(CSR_GPIO_IN);
1578 IWL_CMD(CSR_RESET);
1579 IWL_CMD(CSR_GP_CNTRL);
1580 IWL_CMD(CSR_HW_REV);
1581 IWL_CMD(CSR_EEPROM_REG);
1582 IWL_CMD(CSR_EEPROM_GP);
1583 IWL_CMD(CSR_OTP_GP_REG);
1584 IWL_CMD(CSR_GIO_REG);
1585 IWL_CMD(CSR_GP_UCODE_REG);
1586 IWL_CMD(CSR_GP_DRIVER_REG);
1587 IWL_CMD(CSR_UCODE_DRV_GP1);
1588 IWL_CMD(CSR_UCODE_DRV_GP2);
1589 IWL_CMD(CSR_LED_REG);
1590 IWL_CMD(CSR_DRAM_INT_TBL_REG);
1591 IWL_CMD(CSR_GIO_CHICKEN_BITS);
1592 IWL_CMD(CSR_ANA_PLL_CFG);
1593 IWL_CMD(CSR_HW_REV_WA_REG);
1594 IWL_CMD(CSR_DBG_HPET_MEM_REG);
1595 default:
1596 return "UNKNOWN";
1597 }
1598}
1599
1600void iwl_dump_csr(struct iwl_trans *trans)
1601{
1602 int i;
1603 static const u32 csr_tbl[] = {
1604 CSR_HW_IF_CONFIG_REG,
1605 CSR_INT_COALESCING,
1606 CSR_INT,
1607 CSR_INT_MASK,
1608 CSR_FH_INT_STATUS,
1609 CSR_GPIO_IN,
1610 CSR_RESET,
1611 CSR_GP_CNTRL,
1612 CSR_HW_REV,
1613 CSR_EEPROM_REG,
1614 CSR_EEPROM_GP,
1615 CSR_OTP_GP_REG,
1616 CSR_GIO_REG,
1617 CSR_GP_UCODE_REG,
1618 CSR_GP_DRIVER_REG,
1619 CSR_UCODE_DRV_GP1,
1620 CSR_UCODE_DRV_GP2,
1621 CSR_LED_REG,
1622 CSR_DRAM_INT_TBL_REG,
1623 CSR_GIO_CHICKEN_BITS,
1624 CSR_ANA_PLL_CFG,
1625 CSR_HW_REV_WA_REG,
1626 CSR_DBG_HPET_MEM_REG
1627 };
1628 IWL_ERR(trans, "CSR values:\n");
1629 IWL_ERR(trans, "(2nd byte of CSR_INT_COALESCING is "
1630 "CSR_INT_PERIODIC_REG)\n");
1631 for (i = 0; i < ARRAY_SIZE(csr_tbl); i++) {
1632 IWL_ERR(trans, " %25s: 0X%08x\n",
1633 get_csr_string(csr_tbl[i]),
1634 iwl_read32(bus(trans), csr_tbl[i]));
1635 }
1636}
1637
1508#ifdef CONFIG_IWLWIFI_DEBUGFS 1638#ifdef CONFIG_IWLWIFI_DEBUGFS
1509/* create and remove of files */ 1639/* create and remove of files */
1510#define DEBUGFS_ADD_FILE(name, parent, mode) do { \ 1640#define DEBUGFS_ADD_FILE(name, parent, mode) do { \
@@ -1752,75 +1882,6 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
1752 return count; 1882 return count;
1753} 1883}
1754 1884
1755static const char *get_csr_string(int cmd)
1756{
1757 switch (cmd) {
1758 IWL_CMD(CSR_HW_IF_CONFIG_REG);
1759 IWL_CMD(CSR_INT_COALESCING);
1760 IWL_CMD(CSR_INT);
1761 IWL_CMD(CSR_INT_MASK);
1762 IWL_CMD(CSR_FH_INT_STATUS);
1763 IWL_CMD(CSR_GPIO_IN);
1764 IWL_CMD(CSR_RESET);
1765 IWL_CMD(CSR_GP_CNTRL);
1766 IWL_CMD(CSR_HW_REV);
1767 IWL_CMD(CSR_EEPROM_REG);
1768 IWL_CMD(CSR_EEPROM_GP);
1769 IWL_CMD(CSR_OTP_GP_REG);
1770 IWL_CMD(CSR_GIO_REG);
1771 IWL_CMD(CSR_GP_UCODE_REG);
1772 IWL_CMD(CSR_GP_DRIVER_REG);
1773 IWL_CMD(CSR_UCODE_DRV_GP1);
1774 IWL_CMD(CSR_UCODE_DRV_GP2);
1775 IWL_CMD(CSR_LED_REG);
1776 IWL_CMD(CSR_DRAM_INT_TBL_REG);
1777 IWL_CMD(CSR_GIO_CHICKEN_BITS);
1778 IWL_CMD(CSR_ANA_PLL_CFG);
1779 IWL_CMD(CSR_HW_REV_WA_REG);
1780 IWL_CMD(CSR_DBG_HPET_MEM_REG);
1781 default:
1782 return "UNKNOWN";
1783 }
1784}
1785
1786void iwl_dump_csr(struct iwl_trans *trans)
1787{
1788 int i;
1789 static const u32 csr_tbl[] = {
1790 CSR_HW_IF_CONFIG_REG,
1791 CSR_INT_COALESCING,
1792 CSR_INT,
1793 CSR_INT_MASK,
1794 CSR_FH_INT_STATUS,
1795 CSR_GPIO_IN,
1796 CSR_RESET,
1797 CSR_GP_CNTRL,
1798 CSR_HW_REV,
1799 CSR_EEPROM_REG,
1800 CSR_EEPROM_GP,
1801 CSR_OTP_GP_REG,
1802 CSR_GIO_REG,
1803 CSR_GP_UCODE_REG,
1804 CSR_GP_DRIVER_REG,
1805 CSR_UCODE_DRV_GP1,
1806 CSR_UCODE_DRV_GP2,
1807 CSR_LED_REG,
1808 CSR_DRAM_INT_TBL_REG,
1809 CSR_GIO_CHICKEN_BITS,
1810 CSR_ANA_PLL_CFG,
1811 CSR_HW_REV_WA_REG,
1812 CSR_DBG_HPET_MEM_REG
1813 };
1814 IWL_ERR(trans, "CSR values:\n");
1815 IWL_ERR(trans, "(2nd byte of CSR_INT_COALESCING is "
1816 "CSR_INT_PERIODIC_REG)\n");
1817 for (i = 0; i < ARRAY_SIZE(csr_tbl); i++) {
1818 IWL_ERR(trans, " %25s: 0X%08x\n",
1819 get_csr_string(csr_tbl[i]),
1820 iwl_read32(bus(trans), csr_tbl[i]));
1821 }
1822}
1823
1824static ssize_t iwl_dbgfs_csr_write(struct file *file, 1885static ssize_t iwl_dbgfs_csr_write(struct file *file,
1825 const char __user *user_buf, 1886 const char __user *user_buf,
1826 size_t count, loff_t *ppos) 1887 size_t count, loff_t *ppos)
@@ -1842,67 +1903,6 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
1842 return count; 1903 return count;
1843} 1904}
1844 1905
1845static const char *get_fh_string(int cmd)
1846{
1847 switch (cmd) {
1848 IWL_CMD(FH_RSCSR_CHNL0_STTS_WPTR_REG);
1849 IWL_CMD(FH_RSCSR_CHNL0_RBDCB_BASE_REG);
1850 IWL_CMD(FH_RSCSR_CHNL0_WPTR);
1851 IWL_CMD(FH_MEM_RCSR_CHNL0_CONFIG_REG);
1852 IWL_CMD(FH_MEM_RSSR_SHARED_CTRL_REG);
1853 IWL_CMD(FH_MEM_RSSR_RX_STATUS_REG);
1854 IWL_CMD(FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV);
1855 IWL_CMD(FH_TSSR_TX_STATUS_REG);
1856 IWL_CMD(FH_TSSR_TX_ERROR_REG);
1857 default:
1858 return "UNKNOWN";
1859 }
1860}
1861
1862int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display)
1863{
1864 int i;
1865#ifdef CONFIG_IWLWIFI_DEBUG
1866 int pos = 0;
1867 size_t bufsz = 0;
1868#endif
1869 static const u32 fh_tbl[] = {
1870 FH_RSCSR_CHNL0_STTS_WPTR_REG,
1871 FH_RSCSR_CHNL0_RBDCB_BASE_REG,
1872 FH_RSCSR_CHNL0_WPTR,
1873 FH_MEM_RCSR_CHNL0_CONFIG_REG,
1874 FH_MEM_RSSR_SHARED_CTRL_REG,
1875 FH_MEM_RSSR_RX_STATUS_REG,
1876 FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV,
1877 FH_TSSR_TX_STATUS_REG,
1878 FH_TSSR_TX_ERROR_REG
1879 };
1880#ifdef CONFIG_IWLWIFI_DEBUG
1881 if (display) {
1882 bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40;
1883 *buf = kmalloc(bufsz, GFP_KERNEL);
1884 if (!*buf)
1885 return -ENOMEM;
1886 pos += scnprintf(*buf + pos, bufsz - pos,
1887 "FH register values:\n");
1888 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
1889 pos += scnprintf(*buf + pos, bufsz - pos,
1890 " %34s: 0X%08x\n",
1891 get_fh_string(fh_tbl[i]),
1892 iwl_read_direct32(bus(trans), fh_tbl[i]));
1893 }
1894 return pos;
1895 }
1896#endif
1897 IWL_ERR(trans, "FH register values:\n");
1898 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
1899 IWL_ERR(trans, " %34s: 0X%08x\n",
1900 get_fh_string(fh_tbl[i]),
1901 iwl_read_direct32(bus(trans), fh_tbl[i]));
1902 }
1903 return 0;
1904}
1905
1906static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, 1906static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
1907 char __user *user_buf, 1907 char __user *user_buf,
1908 size_t count, loff_t *ppos) 1908 size_t count, loff_t *ppos)