diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-07-14 11:07:27 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-07-23 11:40:47 -0400 |
commit | 325322ee34d726bff922853d509e135c8d262e2f (patch) | |
tree | 543f6638b7b2a7b19d4c082e0f9f89fa6094c25f /drivers/net/wireless | |
parent | 7a17a33c0da37f8d24222c967550d19dabf13617 (diff) |
iwlagn: add statistic notification structure for WiFi/BT devices
If its WiFi/BT combo device, the statistics notification sent by
uCode will include the additional BT related statistics counters.
Adding new data structure to support the new layout.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 46 |
6 files changed, 71 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 3a0d0adab1ae..27a776f2f8fa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -1605,8 +1605,8 @@ static int iwl4965_hw_get_temperature(struct iwl_priv *priv) | |||
1605 | if (!test_bit(STATUS_TEMPERATURE, &priv->status)) | 1605 | if (!test_bit(STATUS_TEMPERATURE, &priv->status)) |
1606 | vt = sign_extend(R4, 23); | 1606 | vt = sign_extend(R4, 23); |
1607 | else | 1607 | else |
1608 | vt = sign_extend(le32_to_cpu( | 1608 | vt = sign_extend(le32_to_cpu(priv->_agn.statistics. |
1609 | priv->_agn.statistics.general.temperature), 23); | 1609 | general.common.temperature), 23); |
1610 | 1610 | ||
1611 | IWL_DEBUG_TEMP(priv, "Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt); | 1611 | IWL_DEBUG_TEMP(priv, "Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt); |
1612 | 1612 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 7d89d99ce19c..a7077cd7afee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -265,7 +265,7 @@ static void iwl5150_temperature(struct iwl_priv *priv) | |||
265 | u32 vt = 0; | 265 | u32 vt = 0; |
266 | s32 offset = iwl_temp_calib_to_offset(priv); | 266 | s32 offset = iwl_temp_calib_to_offset(priv); |
267 | 267 | ||
268 | vt = le32_to_cpu(priv->_agn.statistics.general.temperature); | 268 | vt = le32_to_cpu(priv->_agn.statistics.general.common.temperature); |
269 | vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset; | 269 | vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset; |
270 | /* now vt hold the temperature in Kelvin */ | 270 | /* now vt hold the temperature in Kelvin */ |
271 | priv->temperature = KELVIN_TO_CELSIUS(vt); | 271 | priv->temperature = KELVIN_TO_CELSIUS(vt); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c index 5e5c5122fb15..11dd1f736bed 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |||
@@ -759,8 +759,8 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, | |||
759 | char *buf; | 759 | char *buf; |
760 | int bufsz = sizeof(struct statistics_general) * 10 + 300; | 760 | int bufsz = sizeof(struct statistics_general) * 10 + 300; |
761 | ssize_t ret; | 761 | ssize_t ret; |
762 | struct statistics_general *general, *accum_general; | 762 | struct statistics_general_common *general, *accum_general; |
763 | struct statistics_general *delta_general, *max_general; | 763 | struct statistics_general_common *delta_general, *max_general; |
764 | struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg; | 764 | struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg; |
765 | struct statistics_div *div, *accum_div, *delta_div, *max_div; | 765 | struct statistics_div *div, *accum_div, *delta_div, *max_div; |
766 | 766 | ||
@@ -777,18 +777,18 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, | |||
777 | * the last statistics notification from uCode | 777 | * the last statistics notification from uCode |
778 | * might not reflect the current uCode activity | 778 | * might not reflect the current uCode activity |
779 | */ | 779 | */ |
780 | general = &priv->_agn.statistics.general; | 780 | general = &priv->_agn.statistics.general.common; |
781 | dbg = &priv->_agn.statistics.general.dbg; | 781 | dbg = &priv->_agn.statistics.general.common.dbg; |
782 | div = &priv->_agn.statistics.general.div; | 782 | div = &priv->_agn.statistics.general.common.div; |
783 | accum_general = &priv->_agn.accum_statistics.general; | 783 | accum_general = &priv->_agn.accum_statistics.general.common; |
784 | delta_general = &priv->_agn.delta_statistics.general; | 784 | delta_general = &priv->_agn.delta_statistics.general.common; |
785 | max_general = &priv->_agn.max_delta.general; | 785 | max_general = &priv->_agn.max_delta.general.common; |
786 | accum_dbg = &priv->_agn.accum_statistics.general.dbg; | 786 | accum_dbg = &priv->_agn.accum_statistics.general.common.dbg; |
787 | delta_dbg = &priv->_agn.delta_statistics.general.dbg; | 787 | delta_dbg = &priv->_agn.delta_statistics.general.common.dbg; |
788 | max_dbg = &priv->_agn.max_delta.general.dbg; | 788 | max_dbg = &priv->_agn.max_delta.general.common.dbg; |
789 | accum_div = &priv->_agn.accum_statistics.general.div; | 789 | accum_div = &priv->_agn.accum_statistics.general.common.div; |
790 | delta_div = &priv->_agn.delta_statistics.general.div; | 790 | delta_div = &priv->_agn.delta_statistics.general.common.div; |
791 | max_div = &priv->_agn.max_delta.general.div; | 791 | max_div = &priv->_agn.max_delta.general.common.div; |
792 | pos += iwl_statistics_flag(priv, buf, bufsz); | 792 | pos += iwl_statistics_flag(priv, buf, bufsz); |
793 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 793 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
794 | "acumulative delta max\n", | 794 | "acumulative delta max\n", |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 74623e0d535f..dda71cd9aab1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -364,7 +364,7 @@ void iwlagn_temperature(struct iwl_priv *priv) | |||
364 | { | 364 | { |
365 | /* store temperature from statistics (in Celsius) */ | 365 | /* store temperature from statistics (in Celsius) */ |
366 | priv->temperature = | 366 | priv->temperature = |
367 | le32_to_cpu(priv->_agn.statistics.general.temperature); | 367 | le32_to_cpu(priv->_agn.statistics.general.common.temperature); |
368 | iwl_tt_handler(priv); | 368 | iwl_tt_handler(priv); |
369 | } | 369 | } |
370 | 370 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index d54edc326f81..249b77bbf638 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -135,12 +135,12 @@ static void iwl_accumulative_statistics(struct iwl_priv *priv, | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /* reset accumulative statistics for "no-counter" type statistics */ | 137 | /* reset accumulative statistics for "no-counter" type statistics */ |
138 | priv->_agn.accum_statistics.general.temperature = | 138 | priv->_agn.accum_statistics.general.common.temperature = |
139 | priv->_agn.statistics.general.temperature; | 139 | priv->_agn.statistics.general.common.temperature; |
140 | priv->_agn.accum_statistics.general.temperature_m = | 140 | priv->_agn.accum_statistics.general.common.temperature_m = |
141 | priv->_agn.statistics.general.temperature_m; | 141 | priv->_agn.statistics.general.common.temperature_m; |
142 | priv->_agn.accum_statistics.general.ttl_timestamp = | 142 | priv->_agn.accum_statistics.general.common.ttl_timestamp = |
143 | priv->_agn.statistics.general.ttl_timestamp; | 143 | priv->_agn.statistics.general.common.ttl_timestamp; |
144 | priv->_agn.accum_statistics.tx.tx_power.ant_a = | 144 | priv->_agn.accum_statistics.tx.tx_power.ant_a = |
145 | priv->_agn.statistics.tx.tx_power.ant_a; | 145 | priv->_agn.statistics.tx.tx_power.ant_a; |
146 | priv->_agn.accum_statistics.tx.tx_power.ant_b = | 146 | priv->_agn.accum_statistics.tx.tx_power.ant_b = |
@@ -232,8 +232,8 @@ void iwl_rx_statistics(struct iwl_priv *priv, | |||
232 | (int)sizeof(priv->_agn.statistics), | 232 | (int)sizeof(priv->_agn.statistics), |
233 | le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); | 233 | le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); |
234 | 234 | ||
235 | change = ((priv->_agn.statistics.general.temperature != | 235 | change = ((priv->_agn.statistics.general.common.temperature != |
236 | pkt->u.stats.general.temperature) || | 236 | pkt->u.stats.general.common.temperature) || |
237 | ((priv->_agn.statistics.flag & | 237 | ((priv->_agn.statistics.flag & |
238 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != | 238 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != |
239 | (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); | 239 | (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 83247f7e019c..4be90637b568 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -3127,6 +3127,13 @@ struct statistics_rx_non_phy { | |||
3127 | __le32 beacon_energy_c; | 3127 | __le32 beacon_energy_c; |
3128 | } __attribute__ ((packed)); | 3128 | } __attribute__ ((packed)); |
3129 | 3129 | ||
3130 | struct statistics_rx_non_phy_bt { | ||
3131 | struct statistics_rx_non_phy common; | ||
3132 | /* additional stats for bt */ | ||
3133 | __le32 num_bt_kills; | ||
3134 | __le32 reserved[2]; | ||
3135 | } __attribute__ ((packed)); | ||
3136 | |||
3130 | struct statistics_rx { | 3137 | struct statistics_rx { |
3131 | struct statistics_rx_phy ofdm; | 3138 | struct statistics_rx_phy ofdm; |
3132 | struct statistics_rx_phy cck; | 3139 | struct statistics_rx_phy cck; |
@@ -3134,6 +3141,13 @@ struct statistics_rx { | |||
3134 | struct statistics_rx_ht_phy ofdm_ht; | 3141 | struct statistics_rx_ht_phy ofdm_ht; |
3135 | } __attribute__ ((packed)); | 3142 | } __attribute__ ((packed)); |
3136 | 3143 | ||
3144 | struct statistics_rx_bt { | ||
3145 | struct statistics_rx_phy ofdm; | ||
3146 | struct statistics_rx_phy cck; | ||
3147 | struct statistics_rx_non_phy_bt general; | ||
3148 | struct statistics_rx_ht_phy ofdm_ht; | ||
3149 | } __attribute__ ((packed)); | ||
3150 | |||
3137 | /** | 3151 | /** |
3138 | * struct statistics_tx_power - current tx power | 3152 | * struct statistics_tx_power - current tx power |
3139 | * | 3153 | * |
@@ -3196,7 +3210,7 @@ struct statistics_div { | |||
3196 | __le32 reserved2; | 3210 | __le32 reserved2; |
3197 | } __attribute__ ((packed)); | 3211 | } __attribute__ ((packed)); |
3198 | 3212 | ||
3199 | struct statistics_general { | 3213 | struct statistics_general_common { |
3200 | __le32 temperature; /* radio temperature */ | 3214 | __le32 temperature; /* radio temperature */ |
3201 | __le32 temperature_m; /* for 5000 and up, this is radio voltage */ | 3215 | __le32 temperature_m; /* for 5000 and up, this is radio voltage */ |
3202 | struct statistics_dbg dbg; | 3216 | struct statistics_dbg dbg; |
@@ -3212,6 +3226,30 @@ struct statistics_general { | |||
3212 | * in order to get out of bad PHY status | 3226 | * in order to get out of bad PHY status |
3213 | */ | 3227 | */ |
3214 | __le32 num_of_sos_states; | 3228 | __le32 num_of_sos_states; |
3229 | } __attribute__ ((packed)); | ||
3230 | |||
3231 | struct statistics_bt_activity { | ||
3232 | /* Tx statistics */ | ||
3233 | __le32 hi_priority_tx_req_cnt; | ||
3234 | __le32 hi_priority_tx_denied_cnt; | ||
3235 | __le32 lo_priority_tx_req_cnt; | ||
3236 | __le32 lo_priority_tx_denied_cnt; | ||
3237 | /* Rx statistics */ | ||
3238 | __le32 hi_priority_rx_req_cnt; | ||
3239 | __le32 hi_priority_rx_denied_cnt; | ||
3240 | __le32 lo_priority_rx_req_cnt; | ||
3241 | __le32 lo_priority_rx_denied_cnt; | ||
3242 | } __attribute__ ((packed)); | ||
3243 | |||
3244 | struct statistics_general { | ||
3245 | struct statistics_general_common common; | ||
3246 | __le32 reserved2; | ||
3247 | __le32 reserved3; | ||
3248 | } __attribute__ ((packed)); | ||
3249 | |||
3250 | struct statistics_general_bt { | ||
3251 | struct statistics_general_common common; | ||
3252 | struct statistics_bt_activity activity; | ||
3215 | __le32 reserved2; | 3253 | __le32 reserved2; |
3216 | __le32 reserved3; | 3254 | __le32 reserved3; |
3217 | } __attribute__ ((packed)); | 3255 | } __attribute__ ((packed)); |
@@ -3273,6 +3311,12 @@ struct iwl_notif_statistics { | |||
3273 | struct statistics_general general; | 3311 | struct statistics_general general; |
3274 | } __attribute__ ((packed)); | 3312 | } __attribute__ ((packed)); |
3275 | 3313 | ||
3314 | struct iwl_bt_notif_statistics { | ||
3315 | __le32 flag; | ||
3316 | struct statistics_rx_bt rx; | ||
3317 | struct statistics_tx tx; | ||
3318 | struct statistics_general_bt general; | ||
3319 | } __attribute__ ((packed)); | ||
3276 | 3320 | ||
3277 | /* | 3321 | /* |
3278 | * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command) | 3322 | * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command) |