aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c74
1 files changed, 62 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 5b7e80e5bab4..5e3c35314ffe 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1482,7 +1482,6 @@ static inline void iwl_synchronize_irq(struct iwl_priv *priv)
1482 tasklet_kill(&priv->irq_tasklet); 1482 tasklet_kill(&priv->irq_tasklet);
1483} 1483}
1484 1484
1485#ifdef CONFIG_IWLWIFI_DEBUG
1486static const char *desc_lookup(int i) 1485static const char *desc_lookup(int i)
1487{ 1486{
1488 switch (i) { 1487 switch (i) {
@@ -1613,10 +1612,42 @@ static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
1613 spin_unlock_irqrestore(&priv->reg_lock, reg_flags); 1612 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
1614} 1613}
1615 1614
1615/**
1616 * iwl3945_print_last_event_logs - Dump the newest # of event log to syslog
1617 */
1618static void iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
1619 u32 num_wraps, u32 next_entry,
1620 u32 size, u32 mode)
1621{
1622 /*
1623 * display the newest DEFAULT_LOG_ENTRIES entries
1624 * i.e the entries just before the next ont that uCode would fill.
1625 */
1626 if (num_wraps) {
1627 if (next_entry < size) {
1628 iwl3945_print_event_log(priv,
1629 capacity - (size - next_entry),
1630 size - next_entry, mode);
1631 iwl3945_print_event_log(priv, 0,
1632 next_entry, mode);
1633 } else
1634 iwl3945_print_event_log(priv, next_entry - size,
1635 size, mode);
1636 } else {
1637 if (next_entry < size)
1638 iwl3945_print_event_log(priv, 0, next_entry, mode);
1639 else
1640 iwl3945_print_event_log(priv, next_entry - size,
1641 size, mode);
1642 }
1643}
1644
1616/* For sanity check only. Actual size is determined by uCode, typ. 512 */ 1645/* For sanity check only. Actual size is determined by uCode, typ. 512 */
1617#define IWL3945_MAX_EVENT_LOG_SIZE (512) 1646#define IWL3945_MAX_EVENT_LOG_SIZE (512)
1618 1647
1619void iwl3945_dump_nic_event_log(struct iwl_priv *priv) 1648#define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20)
1649
1650void iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log)
1620{ 1651{
1621 u32 base; /* SRAM byte address of event log header */ 1652 u32 base; /* SRAM byte address of event log header */
1622 u32 capacity; /* event log capacity in # entries */ 1653 u32 capacity; /* event log capacity in # entries */
@@ -1657,8 +1688,17 @@ void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
1657 return; 1688 return;
1658 } 1689 }
1659 1690
1660 IWL_ERR(priv, "Start IWL Event Log Dump: display count %d, wraps %d\n", 1691#ifdef CONFIG_IWLWIFI_DEBUG
1661 size, num_wraps); 1692 if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS))
1693 size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
1694 ? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
1695#else
1696 size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
1697 ? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
1698#endif
1699
1700 IWL_ERR(priv, "Start IWL Event Log Dump: display last %d count\n",
1701 size);
1662 1702
1663 /* if uCode has wrapped back to top of log, start at the oldest entry, 1703 /* if uCode has wrapped back to top of log, start at the oldest entry,
1664 * i.e the next one that uCode would fill. */ 1704 * i.e the next one that uCode would fill. */
@@ -1669,18 +1709,28 @@ void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
1669 /* (then/else) start at top of log */ 1709 /* (then/else) start at top of log */
1670 iwl3945_print_event_log(priv, 0, next_entry, mode); 1710 iwl3945_print_event_log(priv, 0, next_entry, mode);
1671 1711
1672} 1712#ifdef CONFIG_IWLWIFI_DEBUG
1713 if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) {
1714 /* if uCode has wrapped back to top of log,
1715 * start at the oldest entry,
1716 * i.e the next one that uCode would fill.
1717 */
1718 if (num_wraps)
1719 iwl3945_print_event_log(priv, next_entry,
1720 capacity - next_entry, mode);
1721
1722 /* (then/else) start at top of log */
1723 iwl3945_print_event_log(priv, 0, next_entry, mode);
1724 } else
1725 iwl3945_print_last_event_logs(priv, capacity, num_wraps,
1726 next_entry, size, mode);
1673#else 1727#else
1674void iwl3945_dump_nic_event_log(struct iwl_priv *priv) 1728 iwl3945_print_last_event_logs(priv, capacity, num_wraps,
1675{ 1729 next_entry, size, mode);
1676} 1730#endif
1677 1731
1678void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
1679{
1680} 1732}
1681 1733
1682#endif
1683
1684static void iwl3945_irq_tasklet(struct iwl_priv *priv) 1734static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1685{ 1735{
1686 u32 inta, handled = 0; 1736 u32 inta, handled = 0;