From: Arseniy Lartsev <ars3n@yandex.ru>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>,
USB list <linux-usb@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: USB ACM device does not work
Date: Wed, 1 Jul 2009 13:01:06 +0400 [thread overview]
Message-ID: <200907011301.06574.ars3n@yandex.ru> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0906301656440.5222-100000@iolanthe.rowland.org>
On Wednesday 01 July 2009 01:01:00 Alan Stern wrote:
> This looks like your problem. Low-speed devices are not allowed to
> have bulk endpoints. Linux internally changes them to interrupt
> endpoints with interval = 1 and maxpacket size no larger than 8.
Maybe this device is a little "buggy". But Linux should support buggy devices
as well.
What about something like
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -387,6 +387,7 @@ static void acm_rx_tasklet(unsigned long
struct acm_ru *rcv;
unsigned long flags;
unsigned char throttled;
+ struct usb_host_endpoint *ep;
dbg("Entering acm_rx_tasklet");
@@ -462,11 +463,20 @@ urbs:
rcv->buffer = buf;
- usb_fill_bulk_urb(rcv->urb, acm->dev,
- acm->rx_endpoint,
- buf->base,
- acm->readsize,
- acm_read_bulk, rcv);
+ ep = (usb_pipein(acm->rx_endpoint) ? acm->dev->ep_in : acm->dev->ep_out)
+ [usb_pipeendpoint(acm->rx_endpoint)];
+ if (usb_endpoint_xfer_int(&ep->desc))
+ usb_fill_int_urb(rcv->urb, acm->dev,
+ acm->rx_endpoint,
+ buf->base,
+ acm->readsize,
+ acm_read_bulk, rcv, 0xff);
+ else
+ usb_fill_bulk_urb(rcv->urb, acm->dev,
+ acm->rx_endpoint,
+ buf->base,
+ acm->readsize,
+ acm_read_bulk, rcv);
rcv->urb->transfer_dma = buf->dma;
rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
@@ -1227,9 +1237,14 @@ made_compressed_probe:
goto alloc_fail7;
}
- usb_fill_bulk_urb(snd->urb, usb_dev,
- usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
- NULL, acm->writesize, acm_write_bulk, snd);
+ if (usb_endpoint_xfer_int(epwrite))
+ usb_fill_int_urb(snd->urb, usb_dev,
+ usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
+ NULL, acm->writesize, acm_write_bulk, snd, 0xff);
+ else
+ usb_fill_bulk_urb(snd->urb, usb_dev,
+ usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
+ NULL, acm->writesize, acm_write_bulk, snd);
snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
snd->instance = acm;
}
It should work around devices like mine, but should not affect previously
supported devices.
next prev parent reply other threads:[~2009-07-01 9:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-28 18:29 PROBLEM: USB ACM device does not work Arseniy Lartsev
2009-06-28 20:20 ` Oliver Neukum
2009-06-28 20:37 ` Arseniy Lartsev
2009-06-28 20:58 ` Oliver Neukum
2009-06-29 11:43 ` Arseniy Lartsev
2009-06-29 13:07 ` Oliver Neukum
2009-06-29 13:35 ` Arseniy Lartsev
2009-06-30 7:22 ` Oliver Neukum
2009-06-30 20:09 ` Arseniy Lartsev
2009-06-30 21:01 ` Alan Stern
2009-07-01 9:01 ` Arseniy Lartsev [this message]
2009-07-01 10:56 ` Oliver Neukum
2009-07-01 11:24 ` Arseniy Lartsev
2009-07-01 11:37 ` Oliver Neukum
2009-07-01 12:27 ` [PATCH] cdc-acm: work around some broken devices Arseniy Lartsev
2009-07-01 13:56 ` Greg KH
2009-07-01 14:03 ` Oliver Neukum
2009-07-01 14:34 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907011301.06574.ars3n@yandex.ru \
--to=ars3n@yandex.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.