Re: SocketCAN Driver
Thank you, I'll study it! Em 17 de out de 2016 10:25 AM, "Daniel." escreveu: > > If you're dealing with network drivers you will want to know about socket buffs: http://www.linuxjournal.com/article/1312 > LDD3 has a chapter for network drivers too: http://www.makelinux.net/ldd3/chp-17 > > > Regards :) > > 2016-10-17 10:22 GMT-02:00 Daniel. : >> >> CAN drivers can be found here; http://lxr.free-electrons.com/source/drivers/net/can/ >> >> The device driver interface is at dev.c >> >> AFAIK the only other files referencing to can outside of drivers/ folder is http://lxr.free-electrons.com/source/include/uapi/linux/if_ether.h#L120 >> You may want to look at docs too: https://www.kernel.org/doc/Documentation/networking/can.txt >> Regards, >> >> 2016-10-17 9:05 GMT-02:00 Augusto Fraga Giachero : >>> >>> I've been reading the source code for the ECI driver and discovered that >>> it only applies to PCI devices, the IXXAT CAN-to-USB Compact (V1.0) is >>> accessed through libusb, so please, ignore the ECI Kernel module that >>> I've attached in the last email. >>> >>> Thanks! >>> >>> On 17-10-2016 08:43, Augusto Fraga Giachero wrote: >>> > Hello! >>> > >>> > >>> > I recently started a project that uses the CAN serial protocol using >>> > microcontrollers. I've got an IXXAT CAN-to-USB Compact (V1.0) adapter to >>> > help debugging the CAN bus. The manufacturer of this adapter provides >>> > the kernel driver and and userspace libraries for Linux, but it uses a >>> > custom API (ECI) instead of SocketCAN (and I really need to use >>> > SocketCAN). The manufacturer also provides a SocketCAN driver but only >>> > for the CAN-to-USB Compact (V2.0), so it doesn't with what I have. >>> > >>> > >>> > I'm thinking in modifying the the SocketCAN driver to support the V1.0 >>> > adapter, but I don't have any experience in kernel driver development. >>> > I've a solid C knowledge and a lot of experience in firmware development >>> > for microcontrollers. Can someone show me where to find relevant >>> > information regarding SocketCAN, USB drivers development? I don't know >>> > if this challenge is above my skills. >>> > >>> > >>> > I've attached both drivers and a patch for the usb-to-can_v2_socketcan >>> > that substitutes the "netdev->trans_start =" deference to >>> > "netif_trans_update(netdev);", so you can compile for kernels newer than >>> > 4.4. >>> > >>> > >>> > >>> > Thanks! >>> > >>> > >>> >>> >>> ___ >>> Kernelnewbies mailing list >>> Kernelnewbies@kernelnewbies.org >>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies <https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies> >> >> >> >> >> -- *>> "Do or do not. There is no try"* *>> ** Yoda Master* > > > > > -- *> "Do or do not. There is no try"* *> ** Yoda Master* ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: SocketCAN Driver
If you're dealing with network drivers you will want to know about socket buffs: http://www.linuxjournal.com/article/1312 LDD3 has a chapter for network drivers too: http://www.makelinux.net/ldd3/chp-17 Regards :) 2016-10-17 10:22 GMT-02:00 Daniel. : > CAN drivers can be found here; http://lxr.free-electrons.com/ > source/drivers/net/can/ > > The device driver interface is at dev.c > > AFAIK the only other files referencing to can outside of drivers/ folder > is http://lxr.free-electrons.com/source/include/uapi/linux/if_ether.h#L120 > You may want to look at docs too: https://www.kernel.org/doc/ > Documentation/networking/can.txt > Regards, > > 2016-10-17 9:05 GMT-02:00 Augusto Fraga Giachero : > >> I've been reading the source code for the ECI driver and discovered that >> it only applies to PCI devices, the IXXAT CAN-to-USB Compact (V1.0) is >> accessed through libusb, so please, ignore the ECI Kernel module that >> I've attached in the last email. >> >> Thanks! >> >> On 17-10-2016 08:43, Augusto Fraga Giachero wrote: >> > Hello! >> > >> > >> > I recently started a project that uses the CAN serial protocol using >> > microcontrollers. I've got an IXXAT CAN-to-USB Compact (V1.0) adapter to >> > help debugging the CAN bus. The manufacturer of this adapter provides >> > the kernel driver and and userspace libraries for Linux, but it uses a >> > custom API (ECI) instead of SocketCAN (and I really need to use >> > SocketCAN). The manufacturer also provides a SocketCAN driver but only >> > for the CAN-to-USB Compact (V2.0), so it doesn't with what I have. >> > >> > >> > I'm thinking in modifying the the SocketCAN driver to support the V1.0 >> > adapter, but I don't have any experience in kernel driver development. >> > I've a solid C knowledge and a lot of experience in firmware development >> > for microcontrollers. Can someone show me where to find relevant >> > information regarding SocketCAN, USB drivers development? I don't know >> > if this challenge is above my skills. >> > >> > >> > I've attached both drivers and a patch for the usb-to-can_v2_socketcan >> > that substitutes the "netdev->trans_start =" deference to >> > "netif_trans_update(netdev);", so you can compile for kernels newer than >> > 4.4. >> > >> > >> > >> > Thanks! >> > >> > >> >> >> ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> > > > > -- > *"Do or do not. There is no try"* > *Yoda Master* > -- *"Do or do not. There is no try"* *Yoda Master* ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: SocketCAN Driver
CAN drivers can be found here; http://lxr.free-electrons.com/source/drivers/net/can/ The device driver interface is at dev.c AFAIK the only other files referencing to can outside of drivers/ folder is http://lxr.free-electrons.com/source/include/uapi/linux/if_ether.h#L120 You may want to look at docs too: https://www.kernel.org/doc/Documentation/networking/can.txt Regards, 2016-10-17 9:05 GMT-02:00 Augusto Fraga Giachero : > I've been reading the source code for the ECI driver and discovered that > it only applies to PCI devices, the IXXAT CAN-to-USB Compact (V1.0) is > accessed through libusb, so please, ignore the ECI Kernel module that > I've attached in the last email. > > Thanks! > > On 17-10-2016 08:43, Augusto Fraga Giachero wrote: > > Hello! > > > > > > I recently started a project that uses the CAN serial protocol using > > microcontrollers. I've got an IXXAT CAN-to-USB Compact (V1.0) adapter to > > help debugging the CAN bus. The manufacturer of this adapter provides > > the kernel driver and and userspace libraries for Linux, but it uses a > > custom API (ECI) instead of SocketCAN (and I really need to use > > SocketCAN). The manufacturer also provides a SocketCAN driver but only > > for the CAN-to-USB Compact (V2.0), so it doesn't with what I have. > > > > > > I'm thinking in modifying the the SocketCAN driver to support the V1.0 > > adapter, but I don't have any experience in kernel driver development. > > I've a solid C knowledge and a lot of experience in firmware development > > for microcontrollers. Can someone show me where to find relevant > > information regarding SocketCAN, USB drivers development? I don't know > > if this challenge is above my skills. > > > > > > I've attached both drivers and a patch for the usb-to-can_v2_socketcan > > that substitutes the "netdev->trans_start =" deference to > > "netif_trans_update(netdev);", so you can compile for kernels newer than > > 4.4. > > > > > > > > Thanks! > > > > > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -- *"Do or do not. There is no try"* *Yoda Master* ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: SocketCAN Driver
I've been reading the source code for the ECI driver and discovered that it only applies to PCI devices, the IXXAT CAN-to-USB Compact (V1.0) is accessed through libusb, so please, ignore the ECI Kernel module that I've attached in the last email. Thanks! On 17-10-2016 08:43, Augusto Fraga Giachero wrote: > Hello! > > > I recently started a project that uses the CAN serial protocol using > microcontrollers. I've got an IXXAT CAN-to-USB Compact (V1.0) adapter to > help debugging the CAN bus. The manufacturer of this adapter provides > the kernel driver and and userspace libraries for Linux, but it uses a > custom API (ECI) instead of SocketCAN (and I really need to use > SocketCAN). The manufacturer also provides a SocketCAN driver but only > for the CAN-to-USB Compact (V2.0), so it doesn't with what I have. > > > I'm thinking in modifying the the SocketCAN driver to support the V1.0 > adapter, but I don't have any experience in kernel driver development. > I've a solid C knowledge and a lot of experience in firmware development > for microcontrollers. Can someone show me where to find relevant > information regarding SocketCAN, USB drivers development? I don't know > if this challenge is above my skills. > > > I've attached both drivers and a patch for the usb-to-can_v2_socketcan > that substitutes the "netdev->trans_start =" deference to > "netif_trans_update(netdev);", so you can compile for kernels newer than > 4.4. > > > > Thanks! > > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
SocketCAN Driver
Hello! I recently started a project that uses the CAN serial protocol using microcontrollers. I've got an IXXAT CAN-to-USB Compact (V1.0) adapter to help debugging the CAN bus. The manufacturer of this adapter provides the kernel driver and and userspace libraries for Linux, but it uses a custom API (ECI) instead of SocketCAN (and I really need to use SocketCAN). The manufacturer also provides a SocketCAN driver but only for the CAN-to-USB Compact (V2.0), so it doesn't with what I have. I'm thinking in modifying the the SocketCAN driver to support the V1.0 adapter, but I don't have any experience in kernel driver development. I've a solid C knowledge and a lot of experience in firmware development for microcontrollers. Can someone show me where to find relevant information regarding SocketCAN, USB drivers development? I don't know if this challenge is above my skills. I've attached both drivers and a patch for the usb-to-can_v2_socketcan that substitutes the "netdev->trans_start =" deference to "netif_trans_update(netdev);", so you can compile for kernels newer than 4.4. Thanks! usb-to-can_v2_socketcan.tar.xz Description: application/xz >From 76059561a984ef92f19e1babdf42614e99f7719e Mon Sep 17 00:00:00 2001 From: Augusto Fraga Giachero Date: Thu, 13 Oct 2016 13:07:14 -0300 Subject: [PATCH 1/1] Patch for newer kernels Solves the compiling errors on 4.6 kernels and newer. --- ixx_usb_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ixx_usb_core.c b/ixx_usb_core.c index 20eb0cf..701f1f0 100644 --- a/ixx_usb_core.c +++ b/ixx_usb_core.c @@ -218,7 +218,7 @@ static void ixxat_usb_write_bulk_callback(struct urb *urb) netdev->stats.tx_bytes += context->dlc; /* prevent tx timeout */ -netdev->trans_start = jiffies; +netif_trans_update(netdev); break; @@ -323,7 +323,7 @@ static netdev_tx_t ixxat_usb_ndo_start_xmit(struct sk_buff *skb, err); } } else { -netdev->trans_start = jiffies; +netif_trans_update(netdev); /* slow down tx path */ if (atomic_read(&dev->active_tx_urbs) >= IXXAT_USB_MAX_TX_URBS) -- 2.10.0 EciDriver.tar.xz Description: application/xz ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies