Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315569
b: refs/heads/master
c: 3ce4d85
h: refs/heads/master
i:
  315567: b0c635a
v: v3
  • Loading branch information
Larry Finger authored and John W. Linville committed Jul 12, 2012
1 parent 635b0e2 commit db22347
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a00def4d6e50cbfa7588887fdbe2a97042e42bb
refs/heads/master: 3ce4d85b76010525adedcc2555fa164bf706a2f3
14 changes: 11 additions & 3 deletions trunk/drivers/net/wireless/rtlwifi/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,19 @@ static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len)
u8 request;
u16 wvalue;
u16 index;
__le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
__le32 *data;
unsigned long flags;

spin_lock_irqsave(&rtlpriv->locks.usb_lock, flags);
if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
rtlpriv->usb_data_index = 0;
data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
spin_unlock_irqrestore(&rtlpriv->locks.usb_lock, flags);
request = REALTEK_USB_VENQT_CMD_REQ;
index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */

wvalue = (u16)addr;
_usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len);
if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
rtlpriv->usb_data_index = 0;
return le32_to_cpu(*data);
}

Expand Down Expand Up @@ -951,6 +955,10 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
GFP_KERNEL);
if (!rtlpriv->usb_data)
return -ENOMEM;

/* this spin lock must be initialized early */
spin_lock_init(&rtlpriv->locks.usb_lock);

rtlpriv->usb_data_index = 0;
init_completion(&rtlpriv->firmware_loading_complete);
SET_IEEE80211_DEV(hw, &intf->dev);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/rtlwifi/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@ struct rtl_locks {
spinlock_t rf_ps_lock;
spinlock_t rf_lock;
spinlock_t waitq_lock;
spinlock_t usb_lock;

/*Dual mac*/
spinlock_t cck_and_rw_pagea_lock;
Expand Down

0 comments on commit db22347

Please sign in to comment.