diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 07:44:08 (GMT) |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 07:44:08 (GMT) |
commit | 1d2a1959fe534279cf37aba20b08c24c20840e52 (patch) | |
tree | 67c0b9aa7fe22a44bf0b4af88947799203eb8f67 /drivers/staging/usbip/vhci_tx.c | |
parent | 5a79ce76e9bb8f4b2cd8106ee36d15ee05013bcf (diff) | |
parent | 054cfaacf88865bff1dd58d305443d5d6c068a08 (diff) | |
download | linux-1d2a1959fe534279cf37aba20b08c24c20840e52.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
Diffstat (limited to 'drivers/staging/usbip/vhci_tx.c')
-rw-r--r-- | drivers/staging/usbip/vhci_tx.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/staging/usbip/vhci_tx.c b/drivers/staging/usbip/vhci_tx.c index e1c1f71..d9ab49d 100644 --- a/drivers/staging/usbip/vhci_tx.c +++ b/drivers/staging/usbip/vhci_tx.c @@ -18,6 +18,7 @@ */ #include <linux/slab.h> +#include <linux/kthread.h> #include "usbip_common.h" #include "vhci.h" @@ -215,17 +216,12 @@ static int vhci_send_cmd_unlink(struct vhci_device *vdev) /*-------------------------------------------------------------------------*/ -void vhci_tx_loop(struct usbip_task *ut) +int vhci_tx_loop(void *data) { - struct usbip_device *ud = container_of(ut, struct usbip_device, tcp_tx); + struct usbip_device *ud = data; struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); - while (1) { - if (signal_pending(current)) { - usbip_uinfo("vhci_tx signal catched\n"); - break; - } - + while (!kthread_should_stop()) { if (vhci_send_cmd_submit(vdev) < 0) break; @@ -234,8 +230,11 @@ void vhci_tx_loop(struct usbip_task *ut) wait_event_interruptible(vdev->waitq_tx, (!list_empty(&vdev->priv_tx) || - !list_empty(&vdev->unlink_tx))); + !list_empty(&vdev->unlink_tx) || + kthread_should_stop())); usbip_dbg_vhci_tx("pending urbs ?, now wake up\n"); } + + return 0; } |