Commit 3dbf8d06 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Greg Kroah-Hartman

iwlwifi: mvm: fix endianity issues with Smart Fifo commands

commit 86974bff upstream.

This code was broken on big endian systems. Sparse didn't
catch the bug since the firmware command was not tagged as
little endian.
Fix the bug for big endian systems and tag the field in the
firmware command to prevent such issues in the future.

Fixes: 1f3b0ff8 ("iwlwifi: mvm: Add Smart FIFO support")
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 91ee0a8e
...@@ -1487,14 +1487,14 @@ enum iwl_sf_scenario { ...@@ -1487,14 +1487,14 @@ enum iwl_sf_scenario {
/** /**
* Smart Fifo configuration command. * Smart Fifo configuration command.
* @state: smart fifo state, types listed in iwl_sf_sate. * @state: smart fifo state, types listed in enum %iwl_sf_sate.
* @watermark: Minimum allowed availabe free space in RXF for transient state. * @watermark: Minimum allowed availabe free space in RXF for transient state.
* @long_delay_timeouts: aging and idle timer values for each scenario * @long_delay_timeouts: aging and idle timer values for each scenario
* in long delay state. * in long delay state.
* @full_on_timeouts: timer values for each scenario in full on state. * @full_on_timeouts: timer values for each scenario in full on state.
*/ */
struct iwl_sf_cfg_cmd { struct iwl_sf_cfg_cmd {
enum iwl_sf_state state; __le32 state;
__le32 watermark[SF_TRANSIENT_STATES_NUMBER]; __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
__le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
__le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
......
...@@ -172,7 +172,7 @@ static int iwl_mvm_sf_config(struct iwl_mvm *mvm, u8 sta_id, ...@@ -172,7 +172,7 @@ static int iwl_mvm_sf_config(struct iwl_mvm *mvm, u8 sta_id,
enum iwl_sf_state new_state) enum iwl_sf_state new_state)
{ {
struct iwl_sf_cfg_cmd sf_cmd = { struct iwl_sf_cfg_cmd sf_cmd = {
.state = new_state, .state = cpu_to_le32(new_state),
}; };
struct ieee80211_sta *sta; struct ieee80211_sta *sta;
int ret = 0; int ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment