diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/wusbcore/wa-hc.c | 14 | ||||
-rw-r--r-- | drivers/usb/wusbcore/wa-hc.h | 4 | ||||
-rw-r--r-- | drivers/usb/wusbcore/wa-xfer.c | 18 |
3 files changed, 18 insertions, 18 deletions
diff --git a/drivers/usb/wusbcore/wa-hc.c b/drivers/usb/wusbcore/wa-hc.c index a09b65ebd9bb..6c09b0e4672b 100644 --- a/drivers/usb/wusbcore/wa-hc.c +++ b/drivers/usb/wusbcore/wa-hc.c | |||
@@ -44,11 +44,11 @@ int wa_create(struct wahc *wa, struct usb_interface *iface) | |||
44 | /* Fill up Data Transfer EP pointers */ | 44 | /* Fill up Data Transfer EP pointers */ |
45 | wa->dti_epd = &iface->cur_altsetting->endpoint[1].desc; | 45 | wa->dti_epd = &iface->cur_altsetting->endpoint[1].desc; |
46 | wa->dto_epd = &iface->cur_altsetting->endpoint[2].desc; | 46 | wa->dto_epd = &iface->cur_altsetting->endpoint[2].desc; |
47 | wa->xfer_result_size = usb_endpoint_maxp(wa->dti_epd); | 47 | wa->dti_buf_size = usb_endpoint_maxp(wa->dti_epd); |
48 | wa->xfer_result = kmalloc(wa->xfer_result_size, GFP_KERNEL); | 48 | wa->dti_buf = kmalloc(wa->dti_buf_size, GFP_KERNEL); |
49 | if (wa->xfer_result == NULL) { | 49 | if (wa->dti_buf == NULL) { |
50 | result = -ENOMEM; | 50 | result = -ENOMEM; |
51 | goto error_xfer_result_alloc; | 51 | goto error_dti_buf_alloc; |
52 | } | 52 | } |
53 | result = wa_nep_create(wa, iface); | 53 | result = wa_nep_create(wa, iface); |
54 | if (result < 0) { | 54 | if (result < 0) { |
@@ -59,8 +59,8 @@ int wa_create(struct wahc *wa, struct usb_interface *iface) | |||
59 | return 0; | 59 | return 0; |
60 | 60 | ||
61 | error_nep_create: | 61 | error_nep_create: |
62 | kfree(wa->xfer_result); | 62 | kfree(wa->dti_buf); |
63 | error_xfer_result_alloc: | 63 | error_dti_buf_alloc: |
64 | wa_rpipes_destroy(wa); | 64 | wa_rpipes_destroy(wa); |
65 | error_rpipes_create: | 65 | error_rpipes_create: |
66 | return result; | 66 | return result; |
@@ -76,7 +76,7 @@ void __wa_destroy(struct wahc *wa) | |||
76 | usb_kill_urb(wa->buf_in_urb); | 76 | usb_kill_urb(wa->buf_in_urb); |
77 | usb_put_urb(wa->buf_in_urb); | 77 | usb_put_urb(wa->buf_in_urb); |
78 | } | 78 | } |
79 | kfree(wa->xfer_result); | 79 | kfree(wa->dti_buf); |
80 | wa_nep_destroy(wa); | 80 | wa_nep_destroy(wa); |
81 | wa_rpipes_destroy(wa); | 81 | wa_rpipes_destroy(wa); |
82 | } | 82 | } |
diff --git a/drivers/usb/wusbcore/wa-hc.h b/drivers/usb/wusbcore/wa-hc.h index cf250c21e946..ab399343757e 100644 --- a/drivers/usb/wusbcore/wa-hc.h +++ b/drivers/usb/wusbcore/wa-hc.h | |||
@@ -184,8 +184,8 @@ struct wahc { | |||
184 | struct urb *dti_urb; /* URB for reading xfer results */ | 184 | struct urb *dti_urb; /* URB for reading xfer results */ |
185 | struct urb *buf_in_urb; /* URB for reading data in */ | 185 | struct urb *buf_in_urb; /* URB for reading data in */ |
186 | struct edc dti_edc; /* DTI error density counter */ | 186 | struct edc dti_edc; /* DTI error density counter */ |
187 | struct wa_xfer_result *xfer_result; /* real size = dti_ep maxpktsize */ | 187 | void *dti_buf; |
188 | size_t xfer_result_size; | 188 | size_t dti_buf_size; |
189 | 189 | ||
190 | s32 status; /* For reading status */ | 190 | s32 status; /* For reading status */ |
191 | 191 | ||
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c index 0b1cb65348ac..47cbfddad159 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c | |||
@@ -1418,7 +1418,8 @@ static int wa_xfer_status_to_errno(u8 status) | |||
1418 | * | 1418 | * |
1419 | * FIXME: this function needs to be broken up in parts | 1419 | * FIXME: this function needs to be broken up in parts |
1420 | */ | 1420 | */ |
1421 | static void wa_xfer_result_chew(struct wahc *wa, struct wa_xfer *xfer) | 1421 | static void wa_xfer_result_chew(struct wahc *wa, struct wa_xfer *xfer, |
1422 | struct wa_xfer_result *xfer_result) | ||
1422 | { | 1423 | { |
1423 | int result; | 1424 | int result; |
1424 | struct device *dev = &wa->usb_iface->dev; | 1425 | struct device *dev = &wa->usb_iface->dev; |
@@ -1426,8 +1427,7 @@ static void wa_xfer_result_chew(struct wahc *wa, struct wa_xfer *xfer) | |||
1426 | u8 seg_idx; | 1427 | u8 seg_idx; |
1427 | struct wa_seg *seg; | 1428 | struct wa_seg *seg; |
1428 | struct wa_rpipe *rpipe; | 1429 | struct wa_rpipe *rpipe; |
1429 | struct wa_xfer_result *xfer_result = wa->xfer_result; | 1430 | unsigned done = 0; |
1430 | u8 done = 0; | ||
1431 | u8 usb_status; | 1431 | u8 usb_status; |
1432 | unsigned rpipe_ready = 0; | 1432 | unsigned rpipe_ready = 0; |
1433 | 1433 | ||
@@ -1687,7 +1687,7 @@ static void wa_buf_in_cb(struct urb *urb) | |||
1687 | * We go back to OFF when we detect a ENOENT or ESHUTDOWN (or too many | 1687 | * We go back to OFF when we detect a ENOENT or ESHUTDOWN (or too many |
1688 | * errors) in the URBs. | 1688 | * errors) in the URBs. |
1689 | */ | 1689 | */ |
1690 | static void wa_xfer_result_cb(struct urb *urb) | 1690 | static void wa_dti_cb(struct urb *urb) |
1691 | { | 1691 | { |
1692 | int result; | 1692 | int result; |
1693 | struct wahc *wa = urb->context; | 1693 | struct wahc *wa = urb->context; |
@@ -1709,7 +1709,7 @@ static void wa_xfer_result_cb(struct urb *urb) | |||
1709 | urb->actual_length, sizeof(*xfer_result)); | 1709 | urb->actual_length, sizeof(*xfer_result)); |
1710 | break; | 1710 | break; |
1711 | } | 1711 | } |
1712 | xfer_result = wa->xfer_result; | 1712 | xfer_result = (struct wa_xfer_result *)(wa->dti_buf); |
1713 | if (xfer_result->hdr.bLength != sizeof(*xfer_result)) { | 1713 | if (xfer_result->hdr.bLength != sizeof(*xfer_result)) { |
1714 | dev_err(dev, "DTI Error: xfer result--" | 1714 | dev_err(dev, "DTI Error: xfer result--" |
1715 | "bad header length %u\n", | 1715 | "bad header length %u\n", |
@@ -1735,7 +1735,7 @@ static void wa_xfer_result_cb(struct urb *urb) | |||
1735 | xfer_id, usb_status); | 1735 | xfer_id, usb_status); |
1736 | break; | 1736 | break; |
1737 | } | 1737 | } |
1738 | wa_xfer_result_chew(wa, xfer); | 1738 | wa_xfer_result_chew(wa, xfer, xfer_result); |
1739 | wa_xfer_put(xfer); | 1739 | wa_xfer_put(xfer); |
1740 | break; | 1740 | break; |
1741 | case -ENOENT: /* (we killed the URB)...so, no broadcast */ | 1741 | case -ENOENT: /* (we killed the URB)...so, no broadcast */ |
@@ -1777,7 +1777,7 @@ out: | |||
1777 | * don't really set it up and start it until the first xfer complete | 1777 | * don't really set it up and start it until the first xfer complete |
1778 | * notification arrives, which is what we do here. | 1778 | * notification arrives, which is what we do here. |
1779 | * | 1779 | * |
1780 | * Follow up in wa_xfer_result_cb(), as that's where the whole state | 1780 | * Follow up in wa_dti_cb(), as that's where the whole state |
1781 | * machine starts. | 1781 | * machine starts. |
1782 | * | 1782 | * |
1783 | * So here we just initialize the DTI URB for reading transfer result | 1783 | * So here we just initialize the DTI URB for reading transfer result |
@@ -1813,8 +1813,8 @@ void wa_handle_notif_xfer(struct wahc *wa, struct wa_notif_hdr *notif_hdr) | |||
1813 | usb_fill_bulk_urb( | 1813 | usb_fill_bulk_urb( |
1814 | wa->dti_urb, wa->usb_dev, | 1814 | wa->dti_urb, wa->usb_dev, |
1815 | usb_rcvbulkpipe(wa->usb_dev, 0x80 | notif_xfer->bEndpoint), | 1815 | usb_rcvbulkpipe(wa->usb_dev, 0x80 | notif_xfer->bEndpoint), |
1816 | wa->xfer_result, wa->xfer_result_size, | 1816 | wa->dti_buf, wa->dti_buf_size, |
1817 | wa_xfer_result_cb, wa); | 1817 | wa_dti_cb, wa); |
1818 | 1818 | ||
1819 | wa->buf_in_urb = usb_alloc_urb(0, GFP_KERNEL); | 1819 | wa->buf_in_urb = usb_alloc_urb(0, GFP_KERNEL); |
1820 | if (wa->buf_in_urb == NULL) { | 1820 | if (wa->buf_in_urb == NULL) { |