Commit 8b17f75c authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by John W. Linville

zd1211rw: add locking for mac->process_intr

Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d741900d
...@@ -911,9 +911,13 @@ static int zd_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -911,9 +911,13 @@ static int zd_op_config(struct ieee80211_hw *hw, u32 changed)
static void zd_process_intr(struct work_struct *work) static void zd_process_intr(struct work_struct *work)
{ {
u16 int_status; u16 int_status;
unsigned long flags;
struct zd_mac *mac = container_of(work, struct zd_mac, process_intr); struct zd_mac *mac = container_of(work, struct zd_mac, process_intr);
int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer+4)); spin_lock_irqsave(&mac->lock, flags);
int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer + 4));
spin_unlock_irqrestore(&mac->lock, flags);
if (int_status & INT_CFG_NEXT_BCN) if (int_status & INT_CFG_NEXT_BCN)
dev_dbg_f_limit(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n"); dev_dbg_f_limit(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");
else else
......
...@@ -377,8 +377,10 @@ static inline void handle_regs_int(struct urb *urb) ...@@ -377,8 +377,10 @@ static inline void handle_regs_int(struct urb *urb)
int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2)); int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2));
if (int_num == CR_INTERRUPT) { if (int_num == CR_INTERRUPT) {
struct zd_mac *mac = zd_hw_mac(zd_usb_to_hw(urb->context)); struct zd_mac *mac = zd_hw_mac(zd_usb_to_hw(urb->context));
spin_lock(&mac->lock);
memcpy(&mac->intr_buffer, urb->transfer_buffer, memcpy(&mac->intr_buffer, urb->transfer_buffer,
USB_MAX_EP_INT_BUFFER); USB_MAX_EP_INT_BUFFER);
spin_unlock(&mac->lock);
schedule_work(&mac->process_intr); schedule_work(&mac->process_intr);
} else if (intr->read_regs_enabled) { } else if (intr->read_regs_enabled) {
intr->read_regs.length = len = urb->actual_length; intr->read_regs.length = len = urb->actual_length;
......
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