diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 36 |
5 files changed, 75 insertions, 44 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index e3444c4ea1a5..5baa000c7887 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |||
@@ -662,7 +662,8 @@ static u16 rs_get_supported_rates(struct iwl4965_lq_sta *lq_sta, | |||
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||
665 | static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type) | 665 | static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask, |
666 | int rate_type) | ||
666 | { | 667 | { |
667 | u8 high = IWL_RATE_INVALID; | 668 | u8 high = IWL_RATE_INVALID; |
668 | u8 low = IWL_RATE_INVALID; | 669 | u8 low = IWL_RATE_INVALID; |
@@ -763,7 +764,8 @@ static u32 rs_get_lower_rate(struct iwl4965_lq_sta *lq_sta, | |||
763 | goto out; | 764 | goto out; |
764 | } | 765 | } |
765 | 766 | ||
766 | high_low = rs_get_adjacent_rate(scale_index, rate_mask, tbl->lq_type); | 767 | high_low = rs_get_adjacent_rate(lq_sta->drv, scale_index, rate_mask, |
768 | tbl->lq_type); | ||
767 | low = high_low & 0xff; | 769 | low = high_low & 0xff; |
768 | 770 | ||
769 | if (low == IWL_RATE_INVALID) | 771 | if (low == IWL_RATE_INVALID) |
@@ -990,7 +992,7 @@ out: | |||
990 | * These control how long we stay using same modulation mode before | 992 | * These control how long we stay using same modulation mode before |
991 | * searching for a new mode. | 993 | * searching for a new mode. |
992 | */ | 994 | */ |
993 | static void rs_set_stay_in_table(u8 is_legacy, | 995 | static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy, |
994 | struct iwl4965_lq_sta *lq_sta) | 996 | struct iwl4965_lq_sta *lq_sta) |
995 | { | 997 | { |
996 | IWL_DEBUG_RATE("we are staying in the same table\n"); | 998 | IWL_DEBUG_RATE("we are staying in the same table\n"); |
@@ -1079,7 +1081,8 @@ static s32 rs_get_best_rate(struct iwl_priv *priv, | |||
1079 | new_rate = high = low = start_hi = IWL_RATE_INVALID; | 1081 | new_rate = high = low = start_hi = IWL_RATE_INVALID; |
1080 | 1082 | ||
1081 | for (; ;) { | 1083 | for (; ;) { |
1082 | high_low = rs_get_adjacent_rate(rate, rate_mask, tbl->lq_type); | 1084 | high_low = rs_get_adjacent_rate(priv, rate, rate_mask, |
1085 | tbl->lq_type); | ||
1083 | 1086 | ||
1084 | low = high_low & 0xff; | 1087 | low = high_low & 0xff; |
1085 | high = (high_low >> 8) & 0xff; | 1088 | high = (high_low >> 8) & 0xff; |
@@ -1565,7 +1568,9 @@ static void rs_stay_in_table(struct iwl4965_lq_sta *lq_sta) | |||
1565 | int i; | 1568 | int i; |
1566 | int active_tbl; | 1569 | int active_tbl; |
1567 | int flush_interval_passed = 0; | 1570 | int flush_interval_passed = 0; |
1571 | struct iwl_priv *priv; | ||
1568 | 1572 | ||
1573 | priv = lq_sta->drv; | ||
1569 | active_tbl = lq_sta->active_tbl; | 1574 | active_tbl = lq_sta->active_tbl; |
1570 | 1575 | ||
1571 | tbl = &(lq_sta->lq_info[active_tbl]); | 1576 | tbl = &(lq_sta->lq_info[active_tbl]); |
@@ -1838,7 +1843,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1838 | 1843 | ||
1839 | /* (Else) not in search of better modulation mode, try for better | 1844 | /* (Else) not in search of better modulation mode, try for better |
1840 | * starting rate, while staying in this mode. */ | 1845 | * starting rate, while staying in this mode. */ |
1841 | high_low = rs_get_adjacent_rate(index, rate_scale_index_msk, | 1846 | high_low = rs_get_adjacent_rate(priv, index, rate_scale_index_msk, |
1842 | tbl->lq_type); | 1847 | tbl->lq_type); |
1843 | low = high_low & 0xff; | 1848 | low = high_low & 0xff; |
1844 | high = (high_low >> 8) & 0xff; | 1849 | high = (high_low >> 8) & 0xff; |
@@ -1998,7 +2003,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1998 | (lq_sta->action_counter >= 1)) { | 2003 | (lq_sta->action_counter >= 1)) { |
1999 | lq_sta->action_counter = 0; | 2004 | lq_sta->action_counter = 0; |
2000 | IWL_DEBUG_RATE("LQ: STAY in legacy table\n"); | 2005 | IWL_DEBUG_RATE("LQ: STAY in legacy table\n"); |
2001 | rs_set_stay_in_table(1, lq_sta); | 2006 | rs_set_stay_in_table(priv, 1, lq_sta); |
2002 | } | 2007 | } |
2003 | 2008 | ||
2004 | /* If we're in an HT mode, and all 3 mode switch actions | 2009 | /* If we're in an HT mode, and all 3 mode switch actions |
@@ -2015,7 +2020,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
2015 | } | 2020 | } |
2016 | #endif /*CONFIG_IWL4965_HT */ | 2021 | #endif /*CONFIG_IWL4965_HT */ |
2017 | lq_sta->action_counter = 0; | 2022 | lq_sta->action_counter = 0; |
2018 | rs_set_stay_in_table(0, lq_sta); | 2023 | rs_set_stay_in_table(priv, 0, lq_sta); |
2019 | } | 2024 | } |
2020 | 2025 | ||
2021 | /* | 2026 | /* |
@@ -2169,11 +2174,13 @@ out: | |||
2169 | rcu_read_unlock(); | 2174 | rcu_read_unlock(); |
2170 | } | 2175 | } |
2171 | 2176 | ||
2172 | static void *rs_alloc_sta(void *priv, gfp_t gfp) | 2177 | static void *rs_alloc_sta(void *priv_rate, gfp_t gfp) |
2173 | { | 2178 | { |
2174 | struct iwl4965_lq_sta *lq_sta; | 2179 | struct iwl4965_lq_sta *lq_sta; |
2180 | struct iwl_priv *priv; | ||
2175 | int i, j; | 2181 | int i, j; |
2176 | 2182 | ||
2183 | priv = (struct iwl_priv *)priv_rate; | ||
2177 | IWL_DEBUG_RATE("create station rate scale window\n"); | 2184 | IWL_DEBUG_RATE("create station rate scale window\n"); |
2178 | 2185 | ||
2179 | lq_sta = kzalloc(sizeof(struct iwl4965_lq_sta), gfp); | 2186 | lq_sta = kzalloc(sizeof(struct iwl4965_lq_sta), gfp); |
@@ -2443,10 +2450,12 @@ static void rs_clear(void *priv_rate) | |||
2443 | IWL_DEBUG_RATE("leave\n"); | 2450 | IWL_DEBUG_RATE("leave\n"); |
2444 | } | 2451 | } |
2445 | 2452 | ||
2446 | static void rs_free_sta(void *priv, void *priv_sta) | 2453 | static void rs_free_sta(void *priv_rate, void *priv_sta) |
2447 | { | 2454 | { |
2448 | struct iwl4965_lq_sta *lq_sta = priv_sta; | 2455 | struct iwl4965_lq_sta *lq_sta = priv_sta; |
2456 | struct iwl_priv *priv; | ||
2449 | 2457 | ||
2458 | priv = (struct iwl_priv *)priv_rate; | ||
2450 | IWL_DEBUG_RATE("enter\n"); | 2459 | IWL_DEBUG_RATE("enter\n"); |
2451 | kfree(lq_sta); | 2460 | kfree(lq_sta); |
2452 | IWL_DEBUG_RATE("leave\n"); | 2461 | IWL_DEBUG_RATE("leave\n"); |
@@ -2462,6 +2471,9 @@ static int open_file_generic(struct inode *inode, struct file *file) | |||
2462 | static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta, | 2471 | static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta, |
2463 | u32 *rate_n_flags, int index) | 2472 | u32 *rate_n_flags, int index) |
2464 | { | 2473 | { |
2474 | struct iwl_priv *priv; | ||
2475 | |||
2476 | priv = lq_sta->drv; | ||
2465 | if (lq_sta->dbg_fixed_rate) { | 2477 | if (lq_sta->dbg_fixed_rate) { |
2466 | if (index < 12) { | 2478 | if (index < 12) { |
2467 | *rate_n_flags = lq_sta->dbg_fixed_rate; | 2479 | *rate_n_flags = lq_sta->dbg_fixed_rate; |
@@ -2481,10 +2493,12 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, | |||
2481 | const char __user *user_buf, size_t count, loff_t *ppos) | 2493 | const char __user *user_buf, size_t count, loff_t *ppos) |
2482 | { | 2494 | { |
2483 | struct iwl4965_lq_sta *lq_sta = file->private_data; | 2495 | struct iwl4965_lq_sta *lq_sta = file->private_data; |
2496 | struct iwl_priv *priv; | ||
2484 | char buf[64]; | 2497 | char buf[64]; |
2485 | int buf_size; | 2498 | int buf_size; |
2486 | u32 parsed_rate; | 2499 | u32 parsed_rate; |
2487 | 2500 | ||
2501 | priv = lq_sta->drv; | ||
2488 | memset(buf, 0, sizeof(buf)); | 2502 | memset(buf, 0, sizeof(buf)); |
2489 | buf_size = min(count, sizeof(buf) - 1); | 2503 | buf_size = min(count, sizeof(buf) - 1); |
2490 | if (copy_from_user(buf, user_buf, buf_size)) | 2504 | if (copy_from_user(buf, user_buf, buf_size)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 0644e22fe780..b4f2c3c89542 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2743,7 +2743,7 @@ static int iwl4965_set_decrypted_flag(struct iwl_priv *priv, | |||
2743 | return 0; | 2743 | return 0; |
2744 | } | 2744 | } |
2745 | 2745 | ||
2746 | static u32 iwl4965_translate_rx_status(u32 decrypt_in) | 2746 | static u32 iwl4965_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in) |
2747 | { | 2747 | { |
2748 | u32 decrypt_out = 0; | 2748 | u32 decrypt_out = 0; |
2749 | 2749 | ||
@@ -2855,7 +2855,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, | |||
2855 | if (!include_phy) { | 2855 | if (!include_phy) { |
2856 | /* New status scheme, need to translate */ | 2856 | /* New status scheme, need to translate */ |
2857 | ampdu_status_legacy = ampdu_status; | 2857 | ampdu_status_legacy = ampdu_status; |
2858 | ampdu_status = iwl4965_translate_rx_status(ampdu_status); | 2858 | ampdu_status = iwl4965_translate_rx_status(priv, ampdu_status); |
2859 | } | 2859 | } |
2860 | 2860 | ||
2861 | /* start from MAC */ | 2861 | /* start from MAC */ |
@@ -2887,7 +2887,8 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, | |||
2887 | } | 2887 | } |
2888 | 2888 | ||
2889 | /* Calc max signal level (dBm) among 3 possible receivers */ | 2889 | /* Calc max signal level (dBm) among 3 possible receivers */ |
2890 | static int iwl4965_calc_rssi(struct iwl4965_rx_phy_res *rx_resp) | 2890 | static int iwl4965_calc_rssi(struct iwl_priv *priv, |
2891 | struct iwl4965_rx_phy_res *rx_resp) | ||
2891 | { | 2892 | { |
2892 | /* data from PHY/DSP regarding signal strength, etc., | 2893 | /* data from PHY/DSP regarding signal strength, etc., |
2893 | * contents are always there, not configurable by host. */ | 2894 | * contents are always there, not configurable by host. */ |
@@ -2991,7 +2992,7 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv, | |||
2991 | struct iwl4965_rx_frame_end *rx_end = IWL_RX_END(pkt); | 2992 | struct iwl4965_rx_frame_end *rx_end = IWL_RX_END(pkt); |
2992 | u8 *data = IWL_RX_DATA(pkt); | 2993 | u8 *data = IWL_RX_DATA(pkt); |
2993 | 2994 | ||
2994 | if (likely(!(iwl_debug_level & IWL_DL_RX))) | 2995 | if (likely(!(priv->debug_level & IWL_DL_RX))) |
2995 | return; | 2996 | return; |
2996 | 2997 | ||
2997 | /* MAC header */ | 2998 | /* MAC header */ |
@@ -3094,7 +3095,7 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv, | |||
3094 | } | 3095 | } |
3095 | } | 3096 | } |
3096 | if (print_dump) | 3097 | if (print_dump) |
3097 | iwl_print_hex_dump(IWL_DL_RX, data, length); | 3098 | iwl_print_hex_dump(priv, IWL_DL_RX, data, length); |
3098 | } | 3099 | } |
3099 | #else | 3100 | #else |
3100 | static inline void iwl4965_dbg_report_frame(struct iwl_priv *priv, | 3101 | static inline void iwl4965_dbg_report_frame(struct iwl_priv *priv, |
@@ -3187,7 +3188,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv, | |||
3187 | priv->ucode_beacon_time = le32_to_cpu(rx_start->beacon_time_stamp); | 3188 | priv->ucode_beacon_time = le32_to_cpu(rx_start->beacon_time_stamp); |
3188 | 3189 | ||
3189 | /* Find max signal strength (dBm) among 3 antenna/receiver chains */ | 3190 | /* Find max signal strength (dBm) among 3 antenna/receiver chains */ |
3190 | rx_status.ssi = iwl4965_calc_rssi(rx_start); | 3191 | rx_status.ssi = iwl4965_calc_rssi(priv, rx_start); |
3191 | 3192 | ||
3192 | /* Meaningful noise values are available only from beacon statistics, | 3193 | /* Meaningful noise values are available only from beacon statistics, |
3193 | * which are gathered only when associated, and indicate noise | 3194 | * which are gathered only when associated, and indicate noise |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 7e68d24114f8..14d95dd0e14d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -32,24 +32,15 @@ | |||
32 | #ifdef CONFIG_IWLWIFI_DEBUG | 32 | #ifdef CONFIG_IWLWIFI_DEBUG |
33 | extern u32 iwl_debug_level; | 33 | extern u32 iwl_debug_level; |
34 | #define IWL_DEBUG(level, fmt, args...) \ | 34 | #define IWL_DEBUG(level, fmt, args...) \ |
35 | do { if (iwl_debug_level & (level)) \ | 35 | do { if (priv->debug_level & (level)) \ |
36 | printk(KERN_ERR DRV_NAME": %c %s " fmt, \ | 36 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ |
37 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) | 37 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) |
38 | 38 | ||
39 | #define IWL_DEBUG_LIMIT(level, fmt, args...) \ | 39 | #define IWL_DEBUG_LIMIT(level, fmt, args...) \ |
40 | do { if ((iwl_debug_level & (level)) && net_ratelimit()) \ | 40 | do { if ((priv->debug_level & (level)) && net_ratelimit()) \ |
41 | printk(KERN_ERR DRV_NAME": %c %s " fmt, \ | 41 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ |
42 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) | 42 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) |
43 | 43 | ||
44 | static inline void iwl_print_hex_dump(int level, void *p, u32 len) | ||
45 | { | ||
46 | if (!(iwl_debug_level & level)) | ||
47 | return; | ||
48 | |||
49 | print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1, | ||
50 | p, len, 1); | ||
51 | } | ||
52 | |||
53 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 44 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
54 | struct iwl_debugfs { | 45 | struct iwl_debugfs { |
55 | const char *name; | 46 | const char *name; |
@@ -77,9 +68,6 @@ static inline void IWL_DEBUG(int level, const char *fmt, ...) | |||
77 | static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...) | 68 | static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...) |
78 | { | 69 | { |
79 | } | 70 | } |
80 | static inline void iwl_print_hex_dump(int level, void *p, u32 len) | ||
81 | { | ||
82 | } | ||
83 | #endif /* CONFIG_IWLWIFI_DEBUG */ | 71 | #endif /* CONFIG_IWLWIFI_DEBUG */ |
84 | 72 | ||
85 | 73 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 4786194c0454..0a37ff4d98b6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1194,6 +1194,7 @@ struct iwl_priv { | |||
1194 | 1194 | ||
1195 | #ifdef CONFIG_IWLWIFI_DEBUG | 1195 | #ifdef CONFIG_IWLWIFI_DEBUG |
1196 | /* debugging info */ | 1196 | /* debugging info */ |
1197 | u32 debug_level; | ||
1197 | u32 framecnt_to_us; | 1198 | u32 framecnt_to_us; |
1198 | atomic_t restrict_refcnt; | 1199 | atomic_t restrict_refcnt; |
1199 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 1200 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
@@ -1246,6 +1247,23 @@ static inline int is_channel_ibss(const struct iwl_channel_info *ch) | |||
1246 | return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0; | 1247 | return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0; |
1247 | } | 1248 | } |
1248 | 1249 | ||
1250 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1251 | static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level, | ||
1252 | void *p, u32 len) | ||
1253 | { | ||
1254 | if (!(priv->debug_level & level)) | ||
1255 | return; | ||
1256 | |||
1257 | print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1, | ||
1258 | p, len, 1); | ||
1259 | } | ||
1260 | #else | ||
1261 | static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level, | ||
1262 | void *p, u32 len) | ||
1263 | { | ||
1264 | } | ||
1265 | #endif | ||
1266 | |||
1249 | extern const struct iwl_channel_info *iwl_get_channel_info( | 1267 | extern const struct iwl_channel_info *iwl_get_channel_info( |
1250 | const struct iwl_priv *priv, enum ieee80211_band band, u16 channel); | 1268 | const struct iwl_priv *priv, enum ieee80211_band band, u16 channel); |
1251 | 1269 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 8427bc9a9bbc..9f51d3a61f36 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -145,6 +145,7 @@ static const char *iwl4965_escape_essid(const char *essid, u8 essid_len) | |||
145 | return escaped; | 145 | return escaped; |
146 | } | 146 | } |
147 | 147 | ||
148 | |||
148 | /*************** DMA-QUEUE-GENERAL-FUNCTIONS ***** | 149 | /*************** DMA-QUEUE-GENERAL-FUNCTIONS ***** |
149 | * DMA services | 150 | * DMA services |
150 | * | 151 | * |
@@ -1914,7 +1915,7 @@ static int iwl4965_get_sta_id(struct iwl_priv *priv, | |||
1914 | IWL_DEBUG_DROP("Station %s not in station map. " | 1915 | IWL_DEBUG_DROP("Station %s not in station map. " |
1915 | "Defaulting to broadcast...\n", | 1916 | "Defaulting to broadcast...\n", |
1916 | print_mac(mac, hdr->addr1)); | 1917 | print_mac(mac, hdr->addr1)); |
1917 | iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); | 1918 | iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); |
1918 | return priv->hw_params.bcast_sta_id; | 1919 | return priv->hw_params.bcast_sta_id; |
1919 | 1920 | ||
1920 | default: | 1921 | default: |
@@ -2130,10 +2131,10 @@ static int iwl4965_tx_skb(struct iwl_priv *priv, | |||
2130 | txq->need_update = 0; | 2131 | txq->need_update = 0; |
2131 | } | 2132 | } |
2132 | 2133 | ||
2133 | iwl_print_hex_dump(IWL_DL_TX, out_cmd->cmd.payload, | 2134 | iwl_print_hex_dump(priv, IWL_DL_TX, out_cmd->cmd.payload, |
2134 | sizeof(out_cmd->cmd.tx)); | 2135 | sizeof(out_cmd->cmd.tx)); |
2135 | 2136 | ||
2136 | iwl_print_hex_dump(IWL_DL_TX, (u8 *)out_cmd->cmd.tx.hdr, | 2137 | iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)out_cmd->cmd.tx.hdr, |
2137 | ieee80211_get_hdrlen(fc)); | 2138 | ieee80211_get_hdrlen(fc)); |
2138 | 2139 | ||
2139 | /* Set up entry for this TFD in Tx byte-count array */ | 2140 | /* Set up entry for this TFD in Tx byte-count array */ |
@@ -2911,7 +2912,7 @@ static void iwl4965_rx_pm_debug_statistics_notif(struct iwl_priv *priv, | |||
2911 | IWL_DEBUG_RADIO("Dumping %d bytes of unhandled " | 2912 | IWL_DEBUG_RADIO("Dumping %d bytes of unhandled " |
2912 | "notification for %s:\n", | 2913 | "notification for %s:\n", |
2913 | le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd)); | 2914 | le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd)); |
2914 | iwl_print_hex_dump(IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)); | 2915 | iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)); |
2915 | } | 2916 | } |
2916 | 2917 | ||
2917 | static void iwl4965_bg_beacon_update(struct work_struct *work) | 2918 | static void iwl4965_bg_beacon_update(struct work_struct *work) |
@@ -3484,12 +3485,13 @@ static int iwl4965_tx_queue_update_write_ptr(struct iwl_priv *priv, | |||
3484 | } | 3485 | } |
3485 | 3486 | ||
3486 | #ifdef CONFIG_IWLWIFI_DEBUG | 3487 | #ifdef CONFIG_IWLWIFI_DEBUG |
3487 | static void iwl4965_print_rx_config_cmd(struct iwl4965_rxon_cmd *rxon) | 3488 | static void iwl4965_print_rx_config_cmd(struct iwl_priv *priv) |
3488 | { | 3489 | { |
3490 | struct iwl4965_rxon_cmd *rxon = &priv->staging_rxon; | ||
3489 | DECLARE_MAC_BUF(mac); | 3491 | DECLARE_MAC_BUF(mac); |
3490 | 3492 | ||
3491 | IWL_DEBUG_RADIO("RX CONFIG:\n"); | 3493 | IWL_DEBUG_RADIO("RX CONFIG:\n"); |
3492 | iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); | 3494 | iwl_print_hex_dump(priv, IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); |
3493 | IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); | 3495 | IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); |
3494 | IWL_DEBUG_RADIO("u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags)); | 3496 | IWL_DEBUG_RADIO("u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags)); |
3495 | IWL_DEBUG_RADIO("u32 filter_flags: 0x%08x\n", | 3497 | IWL_DEBUG_RADIO("u32 filter_flags: 0x%08x\n", |
@@ -3715,10 +3717,10 @@ static void iwl4965_irq_handle_error(struct iwl_priv *priv) | |||
3715 | clear_bit(STATUS_HCMD_ACTIVE, &priv->status); | 3717 | clear_bit(STATUS_HCMD_ACTIVE, &priv->status); |
3716 | 3718 | ||
3717 | #ifdef CONFIG_IWLWIFI_DEBUG | 3719 | #ifdef CONFIG_IWLWIFI_DEBUG |
3718 | if (iwl_debug_level & IWL_DL_FW_ERRORS) { | 3720 | if (priv->debug_level & IWL_DL_FW_ERRORS) { |
3719 | iwl4965_dump_nic_error_log(priv); | 3721 | iwl4965_dump_nic_error_log(priv); |
3720 | iwl4965_dump_nic_event_log(priv); | 3722 | iwl4965_dump_nic_event_log(priv); |
3721 | iwl4965_print_rx_config_cmd(&priv->staging_rxon); | 3723 | iwl4965_print_rx_config_cmd(priv); |
3722 | } | 3724 | } |
3723 | #endif | 3725 | #endif |
3724 | 3726 | ||
@@ -3782,7 +3784,7 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv) | |||
3782 | iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh); | 3784 | iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh); |
3783 | 3785 | ||
3784 | #ifdef CONFIG_IWLWIFI_DEBUG | 3786 | #ifdef CONFIG_IWLWIFI_DEBUG |
3785 | if (iwl_debug_level & IWL_DL_ISR) { | 3787 | if (priv->debug_level & IWL_DL_ISR) { |
3786 | /* just for debug */ | 3788 | /* just for debug */ |
3787 | inta_mask = iwl_read32(priv, CSR_INT_MASK); | 3789 | inta_mask = iwl_read32(priv, CSR_INT_MASK); |
3788 | IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", | 3790 | IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", |
@@ -3816,7 +3818,7 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv) | |||
3816 | } | 3818 | } |
3817 | 3819 | ||
3818 | #ifdef CONFIG_IWLWIFI_DEBUG | 3820 | #ifdef CONFIG_IWLWIFI_DEBUG |
3819 | if (iwl_debug_level & (IWL_DL_ISR)) { | 3821 | if (priv->debug_level & (IWL_DL_ISR)) { |
3820 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ | 3822 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ |
3821 | if (inta & CSR_INT_BIT_SCD) | 3823 | if (inta & CSR_INT_BIT_SCD) |
3822 | IWL_DEBUG_ISR("Scheduler finished to transmit " | 3824 | IWL_DEBUG_ISR("Scheduler finished to transmit " |
@@ -3909,7 +3911,7 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv) | |||
3909 | iwl4965_enable_interrupts(priv); | 3911 | iwl4965_enable_interrupts(priv); |
3910 | 3912 | ||
3911 | #ifdef CONFIG_IWLWIFI_DEBUG | 3913 | #ifdef CONFIG_IWLWIFI_DEBUG |
3912 | if (iwl_debug_level & (IWL_DL_ISR)) { | 3914 | if (priv->debug_level & (IWL_DL_ISR)) { |
3913 | inta = iwl_read32(priv, CSR_INT); | 3915 | inta = iwl_read32(priv, CSR_INT); |
3914 | inta_mask = iwl_read32(priv, CSR_INT_MASK); | 3916 | inta_mask = iwl_read32(priv, CSR_INT_MASK); |
3915 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); | 3917 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); |
@@ -6049,6 +6051,9 @@ static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw, | |||
6049 | static int iwl4965_mac_get_stats(struct ieee80211_hw *hw, | 6051 | static int iwl4965_mac_get_stats(struct ieee80211_hw *hw, |
6050 | struct ieee80211_low_level_stats *stats) | 6052 | struct ieee80211_low_level_stats *stats) |
6051 | { | 6053 | { |
6054 | struct iwl_priv *priv = hw->priv; | ||
6055 | |||
6056 | priv = hw->priv; | ||
6052 | IWL_DEBUG_MAC80211("enter\n"); | 6057 | IWL_DEBUG_MAC80211("enter\n"); |
6053 | IWL_DEBUG_MAC80211("leave\n"); | 6058 | IWL_DEBUG_MAC80211("leave\n"); |
6054 | 6059 | ||
@@ -6057,6 +6062,9 @@ static int iwl4965_mac_get_stats(struct ieee80211_hw *hw, | |||
6057 | 6062 | ||
6058 | static u64 iwl4965_mac_get_tsf(struct ieee80211_hw *hw) | 6063 | static u64 iwl4965_mac_get_tsf(struct ieee80211_hw *hw) |
6059 | { | 6064 | { |
6065 | struct iwl_priv *priv; | ||
6066 | |||
6067 | priv = hw->priv; | ||
6060 | IWL_DEBUG_MAC80211("enter\n"); | 6068 | IWL_DEBUG_MAC80211("enter\n"); |
6061 | IWL_DEBUG_MAC80211("leave\n"); | 6069 | IWL_DEBUG_MAC80211("leave\n"); |
6062 | 6070 | ||
@@ -6706,7 +6714,9 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
6706 | /* Disabling hardware scan means that mac80211 will perform scans | 6714 | /* Disabling hardware scan means that mac80211 will perform scans |
6707 | * "the hard way", rather than using device's scan. */ | 6715 | * "the hard way", rather than using device's scan. */ |
6708 | if (cfg->mod_params->disable_hw_scan) { | 6716 | if (cfg->mod_params->disable_hw_scan) { |
6709 | IWL_DEBUG_INFO("Disabling hw_scan\n"); | 6717 | if (cfg->mod_params->debug & IWL_DL_INFO) |
6718 | dev_printk(KERN_DEBUG, &(pdev->dev), | ||
6719 | "Disabling hw_scan\n"); | ||
6710 | iwl4965_hw_ops.hw_scan = NULL; | 6720 | iwl4965_hw_ops.hw_scan = NULL; |
6711 | } | 6721 | } |
6712 | 6722 | ||
@@ -6725,7 +6735,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
6725 | priv->pci_dev = pdev; | 6735 | priv->pci_dev = pdev; |
6726 | 6736 | ||
6727 | #ifdef CONFIG_IWLWIFI_DEBUG | 6737 | #ifdef CONFIG_IWLWIFI_DEBUG |
6728 | iwl_debug_level = priv->cfg->mod_params->debug; | 6738 | priv->debug_level = priv->cfg->mod_params->debug; |
6729 | atomic_set(&priv->restrict_refcnt, 0); | 6739 | atomic_set(&priv->restrict_refcnt, 0); |
6730 | #endif | 6740 | #endif |
6731 | 6741 | ||