Commit 2ba5e1fe authored by David S. Miller's avatar David S. Miller
parents 62175c75 47960077
...@@ -6767,12 +6767,12 @@ S: Maintained ...@@ -6767,12 +6767,12 @@ S: Maintained
F: drivers/net/wireless/wl1251/* F: drivers/net/wireless/wl1251/*
WL1271 WIRELESS DRIVER WL1271 WIRELESS DRIVER
M: Luciano Coelho <luciano.coelho@nokia.com> M: Luciano Coelho <coelho@ti.com>
L: linux-wireless@vger.kernel.org L: linux-wireless@vger.kernel.org
W: http://wireless.kernel.org W: http://wireless.kernel.org/en/users/Drivers/wl12xx
T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
S: Maintained S: Maintained
F: drivers/net/wireless/wl12xx/wl1271* F: drivers/net/wireless/wl12xx/
F: include/linux/wl12xx.h F: include/linux/wl12xx.h
WL3501 WIRELESS PCMCIA CARD DRIVER WL3501 WIRELESS PCMCIA CARD DRIVER
......
...@@ -838,9 +838,9 @@ int ath5k_hw_dma_stop(struct ath5k_hw *ah) ...@@ -838,9 +838,9 @@ int ath5k_hw_dma_stop(struct ath5k_hw *ah)
for (i = 0; i < qmax; i++) { for (i = 0; i < qmax; i++) {
err = ath5k_hw_stop_tx_dma(ah, i); err = ath5k_hw_stop_tx_dma(ah, i);
/* -EINVAL -> queue inactive */ /* -EINVAL -> queue inactive */
if (err != -EINVAL) if (err && err != -EINVAL)
return err; return err;
} }
return err; return 0;
} }
...@@ -86,7 +86,7 @@ int ath5k_hw_get_frame_duration(struct ath5k_hw *ah, ...@@ -86,7 +86,7 @@ int ath5k_hw_get_frame_duration(struct ath5k_hw *ah,
if (!ah->ah_bwmode) { if (!ah->ah_bwmode) {
dur = ieee80211_generic_frame_duration(sc->hw, dur = ieee80211_generic_frame_duration(sc->hw,
NULL, len, rate); NULL, len, rate);
return dur; return le16_to_cpu(dur);
} }
bitrate = rate->bitrate; bitrate = rate->bitrate;
...@@ -265,8 +265,6 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah) ...@@ -265,8 +265,6 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah)
* what rate we should choose to TX ACKs. */ * what rate we should choose to TX ACKs. */
tx_time = ath5k_hw_get_frame_duration(ah, 10, rate); tx_time = ath5k_hw_get_frame_duration(ah, 10, rate);
tx_time = le16_to_cpu(tx_time);
ath5k_hw_reg_write(ah, tx_time, reg); ath5k_hw_reg_write(ah, tx_time, reg);
if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE)) if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE))
......
...@@ -426,9 +426,8 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, ...@@ -426,9 +426,8 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
} }
/* WAR for ASPM system hang */ /* WAR for ASPM system hang */
if (AR_SREV_9280(ah) || AR_SREV_9285(ah) || AR_SREV_9287(ah)) { if (AR_SREV_9285(ah) || AR_SREV_9287(ah))
val |= (AR_WA_BIT6 | AR_WA_BIT7); val |= (AR_WA_BIT6 | AR_WA_BIT7);
}
if (AR_SREV_9285E_20(ah)) if (AR_SREV_9285E_20(ah))
val |= AR_WA_BIT23; val |= AR_WA_BIT23;
......
...@@ -142,9 +142,6 @@ static void ath9k_deinit_priv(struct ath9k_htc_priv *priv) ...@@ -142,9 +142,6 @@ static void ath9k_deinit_priv(struct ath9k_htc_priv *priv)
{ {
ath9k_htc_exit_debug(priv->ah); ath9k_htc_exit_debug(priv->ah);
ath9k_hw_deinit(priv->ah); ath9k_hw_deinit(priv->ah);
tasklet_kill(&priv->swba_tasklet);
tasklet_kill(&priv->rx_tasklet);
tasklet_kill(&priv->tx_tasklet);
kfree(priv->ah); kfree(priv->ah);
priv->ah = NULL; priv->ah = NULL;
} }
......
...@@ -1025,12 +1025,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) ...@@ -1025,12 +1025,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
int ret = 0; int ret = 0;
u8 cmd_rsp; u8 cmd_rsp;
/* Cancel all the running timers/work .. */
cancel_work_sync(&priv->fatal_work);
cancel_work_sync(&priv->ps_work);
cancel_delayed_work_sync(&priv->ath9k_led_blink_work);
ath9k_led_stop_brightness(priv);
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
if (priv->op_flags & OP_INVALID) { if (priv->op_flags & OP_INVALID) {
...@@ -1044,8 +1038,23 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) ...@@ -1044,8 +1038,23 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
WMI_CMD(WMI_DISABLE_INTR_CMDID); WMI_CMD(WMI_DISABLE_INTR_CMDID);
WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID);
WMI_CMD(WMI_STOP_RECV_CMDID); WMI_CMD(WMI_STOP_RECV_CMDID);
tasklet_kill(&priv->swba_tasklet);
tasklet_kill(&priv->rx_tasklet);
tasklet_kill(&priv->tx_tasklet);
skb_queue_purge(&priv->tx_queue); skb_queue_purge(&priv->tx_queue);
mutex_unlock(&priv->mutex);
/* Cancel all the running timers/work .. */
cancel_work_sync(&priv->fatal_work);
cancel_work_sync(&priv->ps_work);
cancel_delayed_work_sync(&priv->ath9k_led_blink_work);
ath9k_led_stop_brightness(priv);
mutex_lock(&priv->mutex);
/* Remove monitor interface here */ /* Remove monitor interface here */
if (ah->opmode == NL80211_IFTYPE_MONITOR) { if (ah->opmode == NL80211_IFTYPE_MONITOR) {
if (ath9k_htc_remove_monitor_interface(priv)) if (ath9k_htc_remove_monitor_interface(priv))
......
...@@ -598,8 +598,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, ...@@ -598,8 +598,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
err_queues: err_queues:
ath9k_hw_deinit(ah); ath9k_hw_deinit(ah);
err_hw: err_hw:
tasklet_kill(&sc->intr_tq);
tasklet_kill(&sc->bcon_tasklet);
kfree(ah); kfree(ah);
sc->sc_ah = NULL; sc->sc_ah = NULL;
...@@ -807,9 +805,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc) ...@@ -807,9 +805,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
ath9k_hw_deinit(sc->sc_ah); ath9k_hw_deinit(sc->sc_ah);
tasklet_kill(&sc->intr_tq);
tasklet_kill(&sc->bcon_tasklet);
kfree(sc->sc_ah); kfree(sc->sc_ah);
sc->sc_ah = NULL; sc->sc_ah = NULL;
} }
...@@ -824,6 +819,8 @@ void ath9k_deinit_device(struct ath_softc *sc) ...@@ -824,6 +819,8 @@ void ath9k_deinit_device(struct ath_softc *sc)
wiphy_rfkill_stop_polling(sc->hw->wiphy); wiphy_rfkill_stop_polling(sc->hw->wiphy);
ath_deinit_leds(sc); ath_deinit_leds(sc);
ath9k_ps_restore(sc);
for (i = 0; i < sc->num_sec_wiphy; i++) { for (i = 0; i < sc->num_sec_wiphy; i++) {
struct ath_wiphy *aphy = sc->sec_wiphy[i]; struct ath_wiphy *aphy = sc->sec_wiphy[i];
if (aphy == NULL) if (aphy == NULL)
......
...@@ -325,6 +325,8 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int ...@@ -325,6 +325,8 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
{ {
struct ieee80211_hw *hw = sc->hw; struct ieee80211_hw *hw = sc->hw;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath_tx_control txctl; struct ath_tx_control txctl;
int time_left; int time_left;
...@@ -342,8 +344,12 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int ...@@ -342,8 +344,12 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
init_completion(&sc->paprd_complete); init_completion(&sc->paprd_complete);
sc->paprd_pending = true; sc->paprd_pending = true;
txctl.paprd = BIT(chain); txctl.paprd = BIT(chain);
if (ath_tx_start(hw, skb, &txctl) != 0)
if (ath_tx_start(hw, skb, &txctl) != 0) {
ath_dbg(common, ATH_DBG_XMIT, "PAPRD TX failed\n");
dev_kfree_skb_any(skb);
return false; return false;
}
time_left = wait_for_completion_timeout(&sc->paprd_complete, time_left = wait_for_completion_timeout(&sc->paprd_complete,
msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
...@@ -953,8 +959,6 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw) ...@@ -953,8 +959,6 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
spin_unlock_bh(&sc->sc_pcu_lock); spin_unlock_bh(&sc->sc_pcu_lock);
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
} }
int ath_reset(struct ath_softc *sc, bool retry_tx) int ath_reset(struct ath_softc *sc, bool retry_tx)
...@@ -1309,6 +1313,9 @@ static void ath9k_stop(struct ieee80211_hw *hw) ...@@ -1309,6 +1313,9 @@ static void ath9k_stop(struct ieee80211_hw *hw)
spin_lock_bh(&sc->sc_pcu_lock); spin_lock_bh(&sc->sc_pcu_lock);
/* prevent tasklets to enable interrupts once we disable them */
ah->imask &= ~ATH9K_INT_GLOBAL;
/* make sure h/w will not generate any interrupt /* make sure h/w will not generate any interrupt
* before setting the invalid flag. */ * before setting the invalid flag. */
ath9k_hw_disable_interrupts(ah); ath9k_hw_disable_interrupts(ah);
...@@ -1326,6 +1333,12 @@ static void ath9k_stop(struct ieee80211_hw *hw) ...@@ -1326,6 +1333,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
spin_unlock_bh(&sc->sc_pcu_lock); spin_unlock_bh(&sc->sc_pcu_lock);
/* we can now sync irq and kill any running tasklets, since we already
* disabled interrupts and not holding a spin lock */
synchronize_irq(sc->irq);
tasklet_kill(&sc->intr_tq);
tasklet_kill(&sc->bcon_tasklet);
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
sc->ps_idle = true; sc->ps_idle = true;
......
...@@ -726,9 +726,9 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) ...@@ -726,9 +726,9 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data)
} }
static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
u8 efuse_data, u8 offset, int *bcontinual, u8 efuse_data, u8 offset, int *bcontinual,
u8 *write_state, struct pgpkt_struct target_pkt, u8 *write_state, struct pgpkt_struct *target_pkt,
int *repeat_times, int *bresult, u8 word_en) int *repeat_times, int *bresult, u8 word_en)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct pgpkt_struct tmp_pkt; struct pgpkt_struct tmp_pkt;
...@@ -744,8 +744,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -744,8 +744,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
tmp_pkt.word_en = tmp_header & 0x0F; tmp_pkt.word_en = tmp_header & 0x0F;
tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en);
if (tmp_pkt.offset != target_pkt.offset) { if (tmp_pkt.offset != target_pkt->offset) {
efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
} else { } else {
for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) { for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) {
...@@ -756,23 +756,23 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -756,23 +756,23 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
} }
if (bdataempty == false) { if (bdataempty == false) {
efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
} else { } else {
match_word_en = 0x0F; match_word_en = 0x0F;
if (!((target_pkt.word_en & BIT(0)) | if (!((target_pkt->word_en & BIT(0)) |
(tmp_pkt.word_en & BIT(0)))) (tmp_pkt.word_en & BIT(0))))
match_word_en &= (~BIT(0)); match_word_en &= (~BIT(0));
if (!((target_pkt.word_en & BIT(1)) | if (!((target_pkt->word_en & BIT(1)) |
(tmp_pkt.word_en & BIT(1)))) (tmp_pkt.word_en & BIT(1))))
match_word_en &= (~BIT(1)); match_word_en &= (~BIT(1));
if (!((target_pkt.word_en & BIT(2)) | if (!((target_pkt->word_en & BIT(2)) |
(tmp_pkt.word_en & BIT(2)))) (tmp_pkt.word_en & BIT(2))))
match_word_en &= (~BIT(2)); match_word_en &= (~BIT(2));
if (!((target_pkt.word_en & BIT(3)) | if (!((target_pkt->word_en & BIT(3)) |
(tmp_pkt.word_en & BIT(3)))) (tmp_pkt.word_en & BIT(3))))
match_word_en &= (~BIT(3)); match_word_en &= (~BIT(3));
...@@ -780,7 +780,7 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -780,7 +780,7 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
badworden = efuse_word_enable_data_write( badworden = efuse_word_enable_data_write(
hw, *efuse_addr + 1, hw, *efuse_addr + 1,
tmp_pkt.word_en, tmp_pkt.word_en,
target_pkt.data); target_pkt->data);
if (0x0F != (badworden & 0x0F)) { if (0x0F != (badworden & 0x0F)) {
u8 reorg_offset = offset; u8 reorg_offset = offset;
...@@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
} }
tmp_word_en = 0x0F; tmp_word_en = 0x0F;
if ((target_pkt.word_en & BIT(0)) ^ if ((target_pkt->word_en & BIT(0)) ^
(match_word_en & BIT(0))) (match_word_en & BIT(0)))
tmp_word_en &= (~BIT(0)); tmp_word_en &= (~BIT(0));
if ((target_pkt.word_en & BIT(1)) ^ if ((target_pkt->word_en & BIT(1)) ^
(match_word_en & BIT(1))) (match_word_en & BIT(1)))
tmp_word_en &= (~BIT(1)); tmp_word_en &= (~BIT(1));
if ((target_pkt.word_en & BIT(2)) ^ if ((target_pkt->word_en & BIT(2)) ^
(match_word_en & BIT(2))) (match_word_en & BIT(2)))
tmp_word_en &= (~BIT(2)); tmp_word_en &= (~BIT(2));
if ((target_pkt.word_en & BIT(3)) ^ if ((target_pkt->word_en & BIT(3)) ^
(match_word_en & BIT(3))) (match_word_en & BIT(3)))
tmp_word_en &= (~BIT(3)); tmp_word_en &= (~BIT(3));
if ((tmp_word_en & 0x0F) != 0x0F) { if ((tmp_word_en & 0x0F) != 0x0F) {
*efuse_addr = efuse_get_current_size(hw); *efuse_addr = efuse_get_current_size(hw);
target_pkt.offset = offset; target_pkt->offset = offset;
target_pkt.word_en = tmp_word_en; target_pkt->word_en = tmp_word_en;
} else } else
*bcontinual = false; *bcontinual = false;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
...@@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
} }
} else { } else {
*efuse_addr += (2 * tmp_word_cnts) + 1; *efuse_addr += (2 * tmp_word_cnts) + 1;
target_pkt.offset = offset; target_pkt->offset = offset;
target_pkt.word_en = word_en; target_pkt->word_en = word_en;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
} }
} }
...@@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw, ...@@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
efuse_write_data_case1(hw, &efuse_addr, efuse_write_data_case1(hw, &efuse_addr,
efuse_data, offset, efuse_data, offset,
&bcontinual, &bcontinual,
&write_state, target_pkt, &write_state, &target_pkt,
&repeat_times, &bresult, &repeat_times, &bresult,
word_en); word_en);
else else
......
...@@ -110,9 +110,8 @@ static void wl1271_spi_reset(struct wl1271 *wl) ...@@ -110,9 +110,8 @@ static void wl1271_spi_reset(struct wl1271 *wl)
spi_message_add_tail(&t, &m); spi_message_add_tail(&t, &m);
spi_sync(wl_to_spi(wl), &m); spi_sync(wl_to_spi(wl), &m);
kfree(cmd);
wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
kfree(cmd);
} }
static void wl1271_spi_init(struct wl1271 *wl) static void wl1271_spi_init(struct wl1271 *wl)
......
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