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.c84
1 files changed, 66 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 5d26330b43e..0db9b79a69a 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1483,7 +1483,6 @@ static inline void iwl_synchronize_irq(struct iwl_priv *priv)
1483 tasklet_kill(&priv->irq_tasklet); 1483 tasklet_kill(&priv->irq_tasklet);
1484} 1484}
1485 1485
1486#ifdef CONFIG_IWLWIFI_DEBUG
1487static const char *desc_lookup(int i) 1486static const char *desc_lookup(int i)
1488{ 1487{
1489 switch (i) { 1488 switch (i) {
@@ -1614,10 +1613,42 @@ static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
1614 spin_unlock_irqrestore(&priv->reg_lock, reg_flags); 1613 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
1615} 1614}
1616 1615
1616/**
1617 * iwl3945_print_last_event_logs - Dump the newest # of event log to syslog
1618 */
1619static void iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
1620 u32 num_wraps, u32 next_entry,
1621 u32 size, u32 mode)
1622{
1623 /*
1624 * display the newest DEFAULT_LOG_ENTRIES entries
1625 * i.e the entries just before the next ont that uCode would fill.
1626 */
1627 if (num_wraps) {
1628 if (next_entry < size) {
1629 iwl3945_print_event_log(priv,
1630 capacity - (size - next_entry),
1631 size - next_entry, mode);
1632 iwl3945_print_event_log(priv, 0,
1633 next_entry, mode);
1634 } else
1635 iwl3945_print_event_log(priv, next_entry - size,
1636 size, mode);
1637 } else {
1638 if (next_entry < size)
1639 iwl3945_print_event_log(priv, 0, next_entry, mode);
1640 else
1641 iwl3945_print_event_log(priv, next_entry - size,
1642 size, mode);
1643 }
1644}
1645
1617/* For sanity check only. Actual size is determined by uCode, typ. 512 */ 1646/* For sanity check only. Actual size is determined by uCode, typ. 512 */
1618#define IWL3945_MAX_EVENT_LOG_SIZE (512) 1647#define IWL3945_MAX_EVENT_LOG_SIZE (512)
1619 1648
1620void iwl3945_dump_nic_event_log(struct iwl_priv *priv) 1649#define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20)
1650
1651void iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log)
1621{ 1652{
1622 u32 base; /* SRAM byte address of event log header */ 1653 u32 base; /* SRAM byte address of event log header */
1623 u32 capacity; /* event log capacity in # entries */ 1654 u32 capacity; /* event log capacity in # entries */
@@ -1658,8 +1689,17 @@ void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
1658 return; 1689 return;
1659 } 1690 }
1660 1691
1661 IWL_ERR(priv, "Start IWL Event Log Dump: display count %d, wraps %d\n", 1692#ifdef CONFIG_IWLWIFI_DEBUG
1662 size, num_wraps); 1693 if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS))
1694 size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
1695 ? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
1696#else
1697 size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
1698 ? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
1699#endif
1700
1701 IWL_ERR(priv, "Start IWL Event Log Dump: display last %d count\n",
1702 size);
1663 1703
1664 /* if uCode has wrapped back to top of log, start at the oldest entry, 1704 /* if uCode has wrapped back to top of log, start at the oldest entry,
1665 * i.e the next one that uCode would fill. */ 1705 * i.e the next one that uCode would fill. */
@@ -1670,18 +1710,28 @@ void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
1670 /* (then/else) start at top of log */ 1710 /* (then/else) start at top of log */
1671 iwl3945_print_event_log(priv, 0, next_entry, mode); 1711 iwl3945_print_event_log(priv, 0, next_entry, mode);
1672 1712
1673} 1713#ifdef CONFIG_IWLWIFI_DEBUG
1714 if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) {
1715 /* if uCode has wrapped back to top of log,
1716 * start at the oldest entry,
1717 * i.e the next one that uCode would fill.
1718 */
1719 if (num_wraps)
1720 iwl3945_print_event_log(priv, next_entry,
1721 capacity - next_entry, mode);
1722
1723 /* (then/else) start at top of log */
1724 iwl3945_print_event_log(priv, 0, next_entry, mode);
1725 } else
1726 iwl3945_print_last_event_logs(priv, capacity, num_wraps,
1727 next_entry, size, mode);
1674#else 1728#else
1675void iwl3945_dump_nic_event_log(struct iwl_priv *priv) 1729 iwl3945_print_last_event_logs(priv, capacity, num_wraps,
1676{ 1730 next_entry, size, mode);
1677} 1731#endif
1678 1732
1679void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
1680{
1681} 1733}
1682 1734
1683#endif
1684
1685static void iwl3945_irq_tasklet(struct iwl_priv *priv) 1735static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1686{ 1736{
1687 u32 inta, handled = 0; 1737 u32 inta, handled = 0;
@@ -2494,7 +2544,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
2494 priv->active_rate = priv->rates_mask; 2544 priv->active_rate = priv->rates_mask;
2495 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; 2545 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
2496 2546
2497 iwl_power_update_mode(priv, false); 2547 iwl_power_update_mode(priv, true);
2498 2548
2499 if (iwl_is_associated(priv)) { 2549 if (iwl_is_associated(priv)) {
2500 struct iwl3945_rxon_cmd *active_rxon = 2550 struct iwl3945_rxon_cmd *active_rxon =
@@ -3650,7 +3700,7 @@ static ssize_t show_statistics(struct device *d,
3650 return -EAGAIN; 3700 return -EAGAIN;
3651 3701
3652 mutex_lock(&priv->mutex); 3702 mutex_lock(&priv->mutex);
3653 rc = iwl_send_statistics_request(priv, 0); 3703 rc = iwl_send_statistics_request(priv, CMD_SYNC, false);
3654 mutex_unlock(&priv->mutex); 3704 mutex_unlock(&priv->mutex);
3655 3705
3656 if (rc) { 3706 if (rc) {
@@ -3905,10 +3955,8 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
3905 BIT(NL80211_IFTYPE_STATION) | 3955 BIT(NL80211_IFTYPE_STATION) |
3906 BIT(NL80211_IFTYPE_ADHOC); 3956 BIT(NL80211_IFTYPE_ADHOC);
3907 3957
3908 hw->wiphy->custom_regulatory = true; 3958 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY |
3909 3959 WIPHY_FLAG_DISABLE_BEACON_HINTS;
3910 /* Firmware does not support this */
3911 hw->wiphy->disable_beacon_hints = true;
3912 3960
3913 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945; 3961 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
3914 /* we create the 802.11 header and a zero-length SSID element */ 3962 /* we create the 802.11 header and a zero-length SSID element */