Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190770
b: refs/heads/master
c: 160b824
h: refs/heads/master
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed May 7, 2010
1 parent 9ed73ee commit 83621d0
Show file tree
Hide file tree
Showing 3 changed files with 13 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: 96ff56419504ac6a610ff1af42330e0423242e16
refs/heads/master: 160b82420ab41f1e67fbf2e56dc587837ef39ce0
11 changes: 11 additions & 0 deletions trunk/drivers/net/wireless/ath/ar9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,16 @@ static void ar9170_usb_firmware_failed(struct ar9170_usb *aru)
{
struct device *parent = aru->udev->dev.parent;

complete(&aru->firmware_loading_complete);

/* unbind anything failed */
if (parent)
down(&parent->sem);
device_release_driver(&aru->udev->dev);
if (parent)
up(&parent->sem);

usb_put_dev(aru->udev);
}

static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
Expand Down Expand Up @@ -760,6 +764,8 @@ static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
if (err)
goto err_unrx;

complete(&aru->firmware_loading_complete);
usb_put_dev(aru->udev);
return;

err_unrx:
Expand Down Expand Up @@ -857,6 +863,7 @@ static int ar9170_usb_probe(struct usb_interface *intf,
init_usb_anchor(&aru->tx_pending);
init_usb_anchor(&aru->tx_submitted);
init_completion(&aru->cmd_wait);
init_completion(&aru->firmware_loading_complete);
spin_lock_init(&aru->tx_urb_lock);

aru->tx_pending_urbs = 0;
Expand All @@ -876,6 +883,7 @@ static int ar9170_usb_probe(struct usb_interface *intf,
if (err)
goto err_freehw;

usb_get_dev(aru->udev);
return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw",
&aru->udev->dev, GFP_KERNEL, aru,
ar9170_usb_firmware_step2);
Expand All @@ -895,6 +903,9 @@ static void ar9170_usb_disconnect(struct usb_interface *intf)
return;

aru->common.state = AR9170_IDLE;

wait_for_completion(&aru->firmware_loading_complete);

ar9170_unregister(&aru->common);
ar9170_usb_cancel_urbs(aru);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ar9170/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct ar9170_usb {
unsigned int tx_pending_urbs;

struct completion cmd_wait;
struct completion firmware_loading_complete;
int readlen;
u8 *readbuf;

Expand Down

0 comments on commit 83621d0

Please sign in to comment.