iwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall
authorDaniel C Halperin <daniel.c.halperin@intel.com>
Fri, 28 Aug 2009 16:44:46 +0000 (09:44 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 31 Aug 2009 18:42:09 +0000 (14:42 -0400)
commitb58ef214b7db57cfcbca0e1edae08566cdfd56b7
tree9bc6b75082a19eee04118fd1a23759d772e9e027
parent5027309b5581e9c251a46f0ecbf88996d5e0f1e0
iwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall

Refactor and correct rate selection for outgoing transmitted
packets.

First, note that HT rates in the mac80211 rate table do not provide valid
indices when ieee80211_get_tx_rate is called; the check to see if we could to
abort a transmission early in iwl_tx_skb() would thus occasionally read invalid
memory and occasionally stall transmission (if the erroneous byte was 0xff).
We remove that code; the check wasn't valid anyway.

Second, iwl_tx_cmd_build_rate() also called ieee80211_get_tx_rate to be used
for sending management packets, which do not use the uCode station table.  This
patch refactors that function and adds comments to enhance legibility, replaces
the call to ieee80211_get_tx_rate() with a direct lookup, and adds error
handling in case the table entry is invalid.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-tx.c