Skip to content

Commit

Permalink
zd1211rw: move set_rts_cts_work to bss_info_changed
Browse files Browse the repository at this point in the history
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: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Feb 4, 2011
1 parent a6fb071 commit 5cf6cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
27 changes: 5 additions & 22 deletions drivers/net/wireless/zd1211rw/zd_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,20 +998,9 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw,
* 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);

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);
mutex_unlock(&mac->chip.mutex);
}
Expand All @@ -1022,7 +1011,6 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
u32 changes)
{
struct zd_mac *mac = zd_hw_mac(hw);
unsigned long flags;
int associated;

dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes);
Expand Down Expand Up @@ -1060,15 +1048,11 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
/* TODO: do hardware bssid filtering */

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;
if (!mac->updating_rts_rate) {
mac->updating_rts_rate = 1;
/* FIXME: should disable TX here, until work has
* completed and RTS_CTS reg is updated */
queue_work(zd_workqueue, &mac->set_rts_cts_work);
}
spin_unlock_irqrestore(&mac->lock, flags);
spin_unlock_irq(&mac->lock);

set_rts_cts(mac, bss_conf->use_short_preamble);
}
}

Expand Down Expand Up @@ -1142,7 +1126,6 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)

zd_chip_init(&mac->chip, hw, intf);
housekeeping_init(mac);
INIT_WORK(&mac->set_rts_cts_work, set_rts_cts_work);
INIT_WORK(&mac->process_intr, zd_process_intr);

SET_IEEE80211_DEV(hw, &intf->dev);
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/zd1211rw/zd_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ struct zd_mac {
/* Short preamble (used for RTS/CTS) */
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 */
unsigned int pass_failed_fcs:1;

Expand Down

0 comments on commit 5cf6cf8

Please sign in to comment.