On 12/7/20 3:57 AM, Christian Gagneraud wrote: > I'm looking at creating a new CAN driver for a USB device [1]. This device > has a custom protocol over bulk endpoints. I was able to create a simple > driver, based on usb-skeleton.c that allows to speak this protocol by opening > a custom har device. Do you already have code available somewhere? > I've been looking at the current implementation in [2], I think my device is > a bit special, you cannot read CAN frames w/o sending a 'read' command, so i > need some sort of polling. AFAIK, the Linux USB stack provides that for me, > except that the device won't read anything unless you send it a command. I don't know if you have to implement the polling yourself or if there is a polling helper. I'll ask my co-workers. Is that a Interrupt Transfer Endpoint or a normal Bulk Endpoint? > I have the feeling that current drivers are for devices that can > return data by just scheduling read transfer. Yes. Current drivers get notified by the device, if there is a CAN frame waiting. > Anyone would have a clue on how these drivers work, and if my device > is really that special? Yes, your device is quite special :) > Any hint, point out or reading pointers are much appreciated. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: OpenPGP digital signature