Giter Club home page Giter Club logo

supercan-linux's Introduction

SuperCAN Linux kernel module

This repository contains the Linux kernel driver code for SuperCAN, an open source USB to CAN-FD protocol.

NOTE: the code in this repository requires sources from the SuperCAN repository. It will not build if cloned by itself.

The main branch of this repository aims to stay compatible with the mainline Linux kernel. Branches for older kernels exist and are somewhat maintained.

Building the kernel module

DKMS setup

Install dkms if you haven't already, for instance

sudo apt-get install dkms

Checkout the branch matching your kernel version

You may need to checkout the proper branch to build the driver module.

The command uname -r will tell you what kernel version is currently running. The output will be something like 5.10.0-28-generic which would indicate kernel version 5.10.

Checkout the branch matching your kernel version, e.g. git checkout pre-v5.11. To get a list of the available branches, run git branch -a.

Setup the kernel module sources

<path to supercan>/Linux/dkms-init.sh

Add, build & install the kernel module

sudo dkms add <path to supercan>/Linux/supercan_usb-<version>
sudo dkms build supercan_usb/<version>
sudo dkms install supercan_usb/<version>

Uninstall and remove the kernel module

sudo dkms uninstall supercan_usb/<version>
sudo dkms remove supercan_usb/<version> --all

supercan-linux's People

Contributors

jgressmann avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

supercan-linux's Issues

Build error supercan driver for 5.13.0-35 kernel

Supercan Branch: master
Submodule supercan-linux: pre-v5.13
OS: Ubuntu 21.10 / 5.13.0-35-generic

skb.c

void can_free_echo_skb(struct net_device *dev, unsigned int idx, unsigned int *frame_len_ptr)

Call from supercan_usb.c Line 402

I think "frame_len_ptr" is missing

for (i = 0; i < net_priv->can.echo_skb_max; ++i) {
    can_free_echo_skb(netdev, i);
    usb_priv->tx_echo_skb_available_ptr[i] = i;
}

I use the command from README:

make V=1 KERNELRELEASE=$(uname -r) -C /lib/modules/$(uname -r)/build M=$PWD

Log:

workspace/repos/supercan/Linux/supercan_usb-0.2.5/supercan_usb.c: In function ‘sc_usb_netdev_start_xmit’:
workspace/repos/supercan/Linux/supercan_usb-0.2.5/supercan_usb.c:1334:17: error: too few arguments to function ‘can_put_echo_skb’
 1334 |                 can_put_echo_skb(skb, netdev, echo_skb_index);
      |                 ^~~~~~~~~~~~~~~~
In file included from ./include/linux/can/dev.h:23,
                 from workspace/repos/supercan/Linux/supercan_usb-0.2.5/supercan_usb.c:11:
./include/linux/can/skb.h:20:5: note: declared here
   20 | int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
      |     ^~~~~~~~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.