Commit 5cf6cf81 authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by John W. Linville

zd1211rw: move set_rts_cts_work to bss_info_changed

As bss_info_changed may sleep, we can as well set RTS_CTS register right away.
Keep mac->short_preamble for later use (hw reset).
Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a6fb071b
...@@ -998,20 +998,9 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw, ...@@ -998,20 +998,9 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw,
* time. */ * time. */
} }
static void set_rts_cts_work(struct work_struct *work) static void set_rts_cts(struct zd_mac *mac, unsigned int short_preamble)
{ {
struct zd_mac *mac =
container_of(work, struct zd_mac, set_rts_cts_work);
unsigned long flags;
unsigned int short_preamble;
mutex_lock(&mac->chip.mutex); mutex_lock(&mac->chip.mutex);
spin_lock_irqsave(&mac->lock, flags);
mac->updating_rts_rate = 0;
short_preamble = mac->short_preamble;
spin_unlock_irqrestore(&mac->lock, flags);
zd_chip_set_rts_cts_rate_locked(&mac->chip, short_preamble); zd_chip_set_rts_cts_rate_locked(&mac->chip, short_preamble);
mutex_unlock(&mac->chip.mutex); mutex_unlock(&mac->chip.mutex);
} }
...@@ -1022,7 +1011,6 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1022,7 +1011,6 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
u32 changes) u32 changes)
{ {
struct zd_mac *mac = zd_hw_mac(hw); struct zd_mac *mac = zd_hw_mac(hw);
unsigned long flags;
int associated; int associated;
dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes); dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes);
...@@ -1060,15 +1048,11 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1060,15 +1048,11 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
/* TODO: do hardware bssid filtering */ /* TODO: do hardware bssid filtering */
if (changes & BSS_CHANGED_ERP_PREAMBLE) { if (changes & BSS_CHANGED_ERP_PREAMBLE) {
spin_lock_irqsave(&mac->lock, flags); spin_lock_irq(&mac->lock);
mac->short_preamble = bss_conf->use_short_preamble; mac->short_preamble = bss_conf->use_short_preamble;
if (!mac->updating_rts_rate) { spin_unlock_irq(&mac->lock);
mac->updating_rts_rate = 1;
/* FIXME: should disable TX here, until work has set_rts_cts(mac, bss_conf->use_short_preamble);
* completed and RTS_CTS reg is updated */
queue_work(zd_workqueue, &mac->set_rts_cts_work);
}
spin_unlock_irqrestore(&mac->lock, flags);
} }
} }
...@@ -1142,7 +1126,6 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf) ...@@ -1142,7 +1126,6 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
zd_chip_init(&mac->chip, hw, intf); zd_chip_init(&mac->chip, hw, intf);
housekeeping_init(mac); housekeeping_init(mac);
INIT_WORK(&mac->set_rts_cts_work, set_rts_cts_work);
INIT_WORK(&mac->process_intr, zd_process_intr); INIT_WORK(&mac->process_intr, zd_process_intr);
SET_IEEE80211_DEV(hw, &intf->dev); SET_IEEE80211_DEV(hw, &intf->dev);
......
...@@ -189,9 +189,6 @@ struct zd_mac { ...@@ -189,9 +189,6 @@ struct zd_mac {
/* Short preamble (used for RTS/CTS) */ /* Short preamble (used for RTS/CTS) */
unsigned int short_preamble:1; unsigned int short_preamble:1;
/* flags to indicate update in progress */
unsigned int updating_rts_rate:1;
/* whether to pass frames with CRC errors to stack */ /* whether to pass frames with CRC errors to stack */
unsigned int pass_failed_fcs:1; unsigned int pass_failed_fcs:1;
......
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