Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194223
b: refs/heads/master
c: 46baa1a
h: refs/heads/master
i:
  194221: b30ab40
  194219: 1648cd8
  194215: 49246ae
  194207: e05edfa
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Apr 8, 2010
1 parent 0d8d4f4 commit a27cee1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62c33447fa720d71b05bbc626b01351a4889c2d7
refs/heads/master: 46baa1a24945b5813097af5a632db721f9c9d03b
8 changes: 8 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hif_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
u16 pkt_len, pkt_tag, pool_index = 0;
u8 *ptr;

spin_lock(&hif_dev->rx_lock);

rx_remain_len = hif_dev->rx_remain_len;
rx_pkt_len = hif_dev->rx_transfer_len;

Expand All @@ -356,6 +358,8 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
}
}

spin_unlock(&hif_dev->rx_lock);

while (index < len) {
ptr = (u8 *) skb->data;

Expand All @@ -373,6 +377,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
index = index + 4 + pkt_len + pad_len;

if (index > MAX_RX_BUF_SIZE) {
spin_lock(&hif_dev->rx_lock);
hif_dev->rx_remain_len = index - MAX_RX_BUF_SIZE;
hif_dev->rx_transfer_len =
MAX_RX_BUF_SIZE - chk_idx - 4;
Expand All @@ -384,6 +389,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
dev_err(&hif_dev->udev->dev,
"ath9k_htc: RX memory allocation"
" error\n");
spin_unlock(&hif_dev->rx_lock);
goto err;
}
skb_reserve(nskb, 32);
Expand All @@ -394,6 +400,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,

/* Record the buffer pointer */
hif_dev->remain_skb = nskb;
spin_unlock(&hif_dev->rx_lock);
} else {
nskb = __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC);
if (!nskb) {
Expand Down Expand Up @@ -612,6 +619,7 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
int i, ret;

init_usb_anchor(&hif_dev->rx_submitted);
spin_lock_init(&hif_dev->rx_lock);

for (i = 0; i < MAX_RX_URB_NUM; i++) {

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hif_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ struct hif_device_usb {
int rx_pkt_len;
int rx_transfer_len;
int rx_pad_len;
spinlock_t rx_lock;
u8 flags; /* HIF_USB_* */
};

Expand Down

0 comments on commit a27cee1

Please sign in to comment.