21 Aug, 2013

2 commits


27 Jun, 2013

1 commit


29 Jan, 2013

1 commit


26 Jan, 2013

4 commits

  • The struct can_skb_priv is used to transport additional information along
    with the stored struct can(fd)_frame that can not be contained in existing
    struct sk_buff elements.

    can_skb_priv is located in the skb headroom, which does not touch the existing
    CAN sk_buff usage with skb->data and skb->len, so that even out-of-tree
    CAN drivers can be used without changes.

    Btw. out-of-tree CAN drivers without can_skb_priv in the sk_buff headroom
    would not support features based on can_skb_priv.

    The can_skb_priv->ifindex contains the first interface where the CAN frame
    appeared on the local host. Unfortunately skb->skb_iif can not be used as this
    value is overwritten in every netif_receive_skb() call.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     
  • The LED trigger name for CAN devices is based on the initial
    CAN device name, but does never change. The LED trigger name
    is not guaranteed to be unique in case of hotplugging CAN devices.

    This patch tries to address this problem by modifying the
    LED trigger name according to the CAN device name when
    the latter changes.

    v1 - Kurt Van Dijck
    v2 - Fabio Baltieri
    - remove rename blocking if trigger is bound
    - use led-subsystem function for the actual rename (still WiP)
    - call init/exit functions from dev.c
    v3 - Kurt Van Dijck
    - safe operation for non-candev based devices (vcan, slcan)
    based on earlier patch
    v4 - Kurt Van Dijck
    - trivial patch mistakes fixed

    Signed-off-by: Kurt Van Dijck
    Signed-off-by: Fabio Baltieri
    Signed-off-by: Marc Kleine-Budde

    Kurt Van Dijck
     
  • In net_device notifier calls, it was impossible to determine
    if a CAN device is based on candev in a safe way.
    This patch adds such test in order to access candev storage
    from within those notifiers.

    Signed-off-by: Kurt Van Dijck
    Acked-by: Oliver Hartkopp
    Signed-off-by: Fabio Baltieri
    Signed-off-by: Marc Kleine-Budde

    Kurt Van Dijck
     
  • This patch implements the functions to add two LED triggers, named
    -tx and -rx, to a canbus device driver.

    Triggers are called from specific handlers by each CAN device driver and
    can be disabled altogether with a Kconfig option.

    The implementation keeps the LED on when the interface is UP and blinks
    the LED on network activity at a configurable rate.

    This only supports can-dev based drivers, as it uses some support field
    in the can_priv structure.

    Supported drivers should call devm_can_led_init() and can_led_event() as
    needed.

    Cleanup is handled automatically by devres, so no *_exit function is
    needed.

    Supported events are:
    - CAN_LED_EVENT_OPEN: turn on tx/rx LEDs
    - CAN_LED_EVENT_STOP: turn off tx/rx LEDs
    - CAN_LED_EVENT_TX: trigger tx LED blink
    - CAN_LED_EVENT_RX: trigger tx LED blink

    Cc: Wolfgang Grandegger
    Cc: Marc Kleine-Budde
    Signed-off-by: Fabio Baltieri
    Acked-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Fabio Baltieri
     

17 Oct, 2012

1 commit

  • Remove non-UAPI Kbuild files that have become empty as a result of UAPI
    disintegration. They used to have only header-y lines in them and those have
    now moved to the Kbuild files in the corresponding uapi/ directories.

    Possibly these should not be removed but rather have a comment inserted to say
    they are intentionally left blank. This would make it easier to add generated
    header lines in future without having to restore the infrastructure.

    Note that at this point not all the UAPI disintegration parts have been merged,
    so it is likely that more empty Kbuild files will turn up.

    It is probably necessary to make the files non-empty to prevent the patch
    program from automatically deleting them when it reduces them to nothing.

    Signed-off-by: David Howells

    David Howells
     

11 Oct, 2012

1 commit


20 Jul, 2012

1 commit


20 Jun, 2012

3 commits


24 May, 2012

1 commit

  • As Heinz-Juergen Oertel pointed out 'CAN error frames' are a already defined
    term for the CAN protocol violation indication on the wire.

    To avoid confusion with the error messages created by CAN drivers available
    via CAN RAW sockets update the documentation and change the naming from
    'error frames' to 'error messages' or 'error message frames'.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     

03 Feb, 2012

1 commit


02 Dec, 2011

1 commit


18 Oct, 2011

1 commit


17 Sep, 2011

1 commit

  • This patch adds a CAN Gateway/Router to route (and modify) CAN frames.

    It is based on the PF_CAN core infrastructure for msg filtering and msg
    sending and can optionally modify routed CAN frames on the fly.
    CAN frames can *only* be routed between CAN network interfaces (one hop).
    They can be modified with AND/OR/XOR/SET operations as configured by the
    netlink configuration interface known e.g. from iptables. From the netlink
    view this can-gw implements RTM_{NEW|DEL|GET}ROUTE for PF_CAN.

    The CAN specific userspace tool to manage CAN routing entries can be found in
    the CAN utils http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/cangw.c
    at the SocketCAN SVN on BerliOS.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

27 Aug, 2011

1 commit


05 May, 2011

1 commit

  • commit 53914b67993c724cec585863755c9ebc8446e83b had the
    same message. That commit did put everything in place but
    did not make can_proto const itself.

    Signed-off-by: Kurt Van Dijck
    Acked-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Kurt Van Dijck
     

11 Apr, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
    net: Add support for SMSC LAN9530, LAN9730 and LAN89530
    mlx4_en: Restoring RX buffer pointer in case of failure
    mlx4: Sensing link type at device initialization
    ipv4: Fix "Set rt->rt_iif more sanely on output routes."
    MAINTAINERS: add entry for Xen network backend
    be2net: Fix suspend/resume operation
    be2net: Rename some struct members for clarity
    pppoe: drop PPPOX_ZOMBIEs in pppoe_flush_dev
    dsa/mv88e6131: add support for mv88e6085 switch
    ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets (v2)
    be2net: Fix a potential crash during shutdown.
    bna: Fix for handling firmware heartbeat failure
    can: mcp251x: Allow pass IRQ flags through platform data.
    smsc911x: fix mac_lock acquision before calling smsc911x_mac_read
    iwlwifi: accept EEPROM version 0x423 for iwl6000
    rt2x00: fix cancelling uninitialized work
    rtlwifi: Fix some warnings/bugs
    p54usb: IDs for two new devices
    wl12xx: fix potential buffer overflow in testmode nvs push
    zd1211rw: reset rx idle timer from tasklet
    ...

    Linus Torvalds
     

07 Apr, 2011

1 commit

  • When an interrupt occurs, the INT pin is driven low by the
    MCP251x controller (falling edge) but in some cases the INT
    pin can be connected to the MPU through a transistor or level
    translator which inverts this signal. In this case interrupt
    should be configured in rising edge.

    This patch adds support to pass the IRQ flags via
    mcp251x_platform_data.

    Signed-off-by: Enric Balletbo i Serra
    Acked-by: Wolfgang Grandegger
    Acked-by: Marc Kleine-Budde
    Signed-off-by: David S. Miller

    Enric Balletbo i Serra
     

31 Mar, 2011

1 commit


28 Mar, 2011

1 commit

  • can_ioctl is the only reason for struct proto to be non-const.
    script/check-patch.pl suggests struct proto be const.

    Setting the reference to the common can_ioctl() in all CAN protocols directly
    removes the need to make the struct proto writable in af_can.c

    Signed-off-by: Kurt Van Dijck
    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

18 Oct, 2010

1 commit

  • Since commit e446630c960946b5c1762e4eadb618becef599e7, i.e. v2.6.35-rc1,
    the mcp251x chip model can be selected via the modalias member in the
    struct spi_board_info. The driver stores the actual model in the
    struct mcp251x_platform_data.

    From the driver point of view the platform_data should be read only.
    Since all in-tree users of the mcp251x have already been converted to
    the modalias method, this patch moves the "model" member from the
    struct mcp251x_platform_data to the driver's private data structure.

    Signed-off-by: Marc Kleine-Budde
    Cc: Christian Pellegrin
    Cc: Marc Zyngier

    Marc Kleine-Budde
     

23 Jul, 2010

1 commit

  • This core is found on some Freescale SoCs and also some Coldfire
    SoCs. Support for Coldfire is missing though at the moment as
    they have an older revision of the core which does not have RX FIFO
    support.

    Signed-off-by: Sascha Hauer
    Signed-off-by: Marc Kleine-Budde
    Acked-by: Wolfgang Grandegger
    Signed-off-by: Marc Kleine-Budde

    Marc Kleine-Budde
     

18 May, 2010

1 commit

  • The member "clock" of struct "sja1000_platform_data" is documented as
    "CAN bus oscillator frequency in Hz" but it's actually used as the CAN
    clock frequency, which is half of it. To avoid further confusion, this
    patch fixes it by renaming the member to "osc_freq". That way, also
    non mainline users will notice the change. The platform code for the
    relevant boards is updated accordingly. Furthermore, pre-defined
    values are now used for the members "ocr" and "cdr".

    Signed-off-by: Wolfgang Grandegger
    Acked-by: Marc Kleine-Budde
    Signed-off-by: David S. Miller

    Wolfgang Grandegger
     

13 Apr, 2010

1 commit


31 Mar, 2010

1 commit

  • Chip model can now be selected directly by matching the modalias name
    (instead of filling the .model field in platform_data), and allows the
    module to be auto-loaded. Previous behaviour is of course still supported.

    Convert the two in-tree users to this feature (icontrol & zeus).
    Tested on an Zeus platform (mcp2515).

    Signed-off-by: Marc Zyngier
    Acked-by: Christian Pellegrin
    Cc: Edwin Peer
    Acked-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Marc Zyngier
     

26 Feb, 2010

2 commits


15 Jan, 2010

1 commit


12 Jan, 2010

1 commit

  • To prevent the CAN drivers to operate on invalid socketbuffers the skbs are
    now checked and silently dropped at the xmit-function consistently.

    Also the netdev stats are consistently using the CAN data length code (dlc)
    for [rx|tx]_bytes now.

    Signed-off-by: Oliver Hartkopp
    Acked-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

04 Jan, 2010

1 commit

  • This patch adds the flag CAN_CTRLMODE_ONE_SHOT. It is used as mask
    or flag in the "struct can_ctrlmode".

    It allows userspace via netlink to set a CAN controller into the special
    "one-shot" mode. In this mode, if supported by the CAN controller, it
    tries only once to deliver a CAN frame and aborts it if an error
    (e.g.: arbitration lost) happens.

    Signed-off-by: Marc Kleine-Budde
    Acked-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Marc Kleine-Budde
     

14 Dec, 2009

1 commit

  • A valid CAN dataframe can have a data length code (DLC) of 0 .. 8 data bytes.

    When reading the CAN controllers register the 4-bit value may contain values
    from 0 .. 15 which may exceed the reserved space in the socket buffer!

    The ISO 11898-1 Chapter 8.4.2.3 (DLC field) says that register values > 8
    should be reduced to 8 without any error reporting or frame drop.

    This patch introduces a new helper macro to cast a given 4-bit data length
    code (dlc) to __u8 and ensure the DLC value to be max. 8 bytes.

    The different handlings in the rx path of the CAN netdevice drivers are fixed.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

08 Nov, 2009

1 commit


06 Nov, 2009

1 commit

  • struct can_proto had a capability field which wasn't ever used. It is
    dropped entirely.

    struct inet_protosw had a capability field which can be more clearly
    expressed in the code by just checking if sock->type = SOCK_RAW.

    Signed-off-by: Eric Paris
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Eric Paris
     

20 Oct, 2009

1 commit

  • This patch makes the private functions alloc_can_skb() and
    alloc_can_err_skb() of the at91_can driver public and adapts all
    drivers to use these. While making the patch I realized, that
    the skb's are *not* setup consistently. It's now done as shown
    below:

    skb->protocol = htons(ETH_P_CAN);
    skb->pkt_type = PACKET_BROADCAST;
    skb->ip_summed = CHECKSUM_UNNECESSARY;
    *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
    memset(*cf, 0, sizeof(struct can_frame));

    The frame is zeroed out to avoid uninitialized data to be passed to
    user space. Some drivers or library code did not set "pkt_type" or
    "ip_summed". Also, "__constant_htons()" should not be used for
    runtime invocations, as pointed out by David Miller.

    Signed-off-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Wolfgang Grandegger
     

13 Oct, 2009

1 commit

  • This patch allows the CAN controller driver to define the number of echo
    skb's used for the local loopback (echo), as suggested by Kurt Van
    Dijck, with the function:

    struct net_device *alloc_candev(int sizeof_priv,
    unsigned int echo_skb_max);

    The CAN drivers have been adapted accordingly. For the ems_usb driver,
    as suggested by Sebastian Haas, the number of echo skb's has been
    increased to 10, which improves the transmission performance a lot.

    Signed-off-by: Wolfgang Grandegger
    Signed-off-by: Kurt Van Dijck
    Signed-off-by: David S. Miller

    Wolfgang Grandegger