iwlwifi: mvm: fix statistics variables type

When receiving statistics notification there is a field of average energy.
This is defines as signed 8 bit, while FW refers to it as unsigned.
when the energy is higher than 127 this causes in iwl_mvm_stat_iterator
a wrong computation of the signal
     int sig = -stats->general.beacon_filter_average_energy;
resulting in incorrect CQM event (change from low to high).

While at it - update the rest of the fields to the correct type.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
This commit is contained in:
Sara Sharon 2015-08-20 14:12:58 +03:00 committed by Luciano Coelho
parent dbb04b0d29
commit 62e004fe94
3 changed files with 14 additions and 14 deletions

View File

@ -237,10 +237,10 @@ struct mvm_statistics_general_v5 {
__le32 num_of_sos_states;
__le32 beacon_filtered;
__le32 missed_beacons;
__s8 beacon_filter_average_energy;
__s8 beacon_filter_reason;
__s8 beacon_filter_current_energy;
__s8 beacon_filter_reserved;
u8 beacon_filter_average_energy;
u8 beacon_filter_reason;
u8 beacon_filter_current_energy;
u8 beacon_filter_reserved;
__le32 beacon_filter_delta_time;
struct mvm_statistics_bt_activity bt_activity;
} __packed; /* STATISTICS_GENERAL_API_S_VER_5 */
@ -263,10 +263,10 @@ struct mvm_statistics_general_v8 {
__le32 num_of_sos_states;
__le32 beacon_filtered;
__le32 missed_beacons;
__s8 beacon_filter_average_energy;
__s8 beacon_filter_reason;
__s8 beacon_filter_current_energy;
__s8 beacon_filter_reserved;
u8 beacon_filter_average_energy;
u8 beacon_filter_reason;
u8 beacon_filter_current_energy;
u8 beacon_filter_reserved;
__le32 beacon_filter_delta_time;
struct mvm_statistics_bt_activity bt_activity;
__le64 rx_time;

View File

@ -323,11 +323,11 @@ enum iwl_bt_force_ant_mode {
struct iwl_mvm_vif_bf_data {
bool bf_enabled;
bool ba_enabled;
s8 ave_beacon_signal;
s8 last_cqm_event;
s8 bt_coex_min_thold;
s8 bt_coex_max_thold;
s8 last_bt_coex_event;
int ave_beacon_signal;
int last_cqm_event;
int bt_coex_min_thold;
int bt_coex_max_thold;
int last_bt_coex_event;
};
/**

View File

@ -459,7 +459,7 @@ static void iwl_mvm_update_rx_statistics(struct iwl_mvm *mvm,
struct iwl_mvm_stat_data {
struct iwl_mvm *mvm;
__le32 mac_id;
__s8 beacon_filter_average_energy;
u8 beacon_filter_average_energy;
struct mvm_statistics_general_v8 *general;
};