Skip to content

Commit 15e1ce3

Browse files
Malcolm Priestleymchehab
authored andcommitted
[media] lmedm04: Fix usb_submit_urb BOGUS urb xfer, pipe 1 != type 3 in interrupt urb
A quirk of some older firmwares that report endpoint pipe type as PIPE_BULK but the endpoint otheriwse functions as interrupt. Check if usb_endpoint_type is USB_ENDPOINT_XFER_BULK and set as usb_rcvbulkpipe. Signed-off-by: Malcolm Priestley <[email protected]> Cc: <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent cfcd7b8 commit 15e1ce3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/media/usb/dvb-usb-v2/lmedm04.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)
354354
{
355355
struct dvb_usb_device *d = adap_to_d(adap);
356356
struct lme2510_state *lme_int = adap_to_priv(adap);
357+
struct usb_host_endpoint *ep;
357358

358359
lme_int->lme_urb = usb_alloc_urb(0, GFP_ATOMIC);
359360

@@ -375,6 +376,12 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)
375376
adap,
376377
8);
377378

379+
/* Quirk of pipe reporting PIPE_BULK but behaves as interrupt */
380+
ep = usb_pipe_endpoint(d->udev, lme_int->lme_urb->pipe);
381+
382+
if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK)
383+
lme_int->lme_urb->pipe = usb_rcvbulkpipe(d->udev, 0xa),
384+
378385
lme_int->lme_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
379386

380387
usb_submit_urb(lme_int->lme_urb, GFP_ATOMIC);

0 commit comments

Comments
 (0)