1. 26 1月, 2013 4 次提交
    • O
      can: add private data space for CAN sk_buffs · 156c2bb9
      Oliver Hartkopp 提交于
      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: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      156c2bb9
    • K
      can: rename LED trigger name on netdev renames · a1ef7bd9
      Kurt Van Dijck 提交于
      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: NKurt Van Dijck <kurt.van.dijck@eia.be>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      a1ef7bd9
    • K
      can: export a safe netdev_priv wrapper for candev · bf03a537
      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: NKurt Van Dijck <kurt.van.dijck@eia.be>
      Acked-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      bf03a537
    • F
      can: add tx/rx LED trigger support · 996a953d
      Fabio Baltieri 提交于
      This patch implements the functions to add two LED triggers, named
      <ifname>-tx and <ifname>-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 <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@gmail.com>
      Acked-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      996a953d
  2. 17 10月, 2012 1 次提交
    • D
      UAPI: Remove empty non-UAPI Kbuild files · 64d7155c
      David Howells 提交于
      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: NDavid Howells <dhowells@redhat.com>
      64d7155c
  3. 11 10月, 2012 1 次提交
  4. 20 7月, 2012 1 次提交
  5. 20 6月, 2012 3 次提交
  6. 24 5月, 2012 1 次提交
  7. 03 2月, 2012 1 次提交
  8. 02 12月, 2011 1 次提交
  9. 18 10月, 2011 1 次提交
  10. 17 9月, 2011 1 次提交
  11. 27 8月, 2011 1 次提交
  12. 05 5月, 2011 1 次提交
  13. 07 4月, 2011 1 次提交
  14. 31 3月, 2011 1 次提交
  15. 28 3月, 2011 1 次提交
  16. 18 10月, 2010 1 次提交
    • M
      can: mcp251x: Don't use pdata->model for chip selection anymore · f1f8c6cb
      Marc Kleine-Budde 提交于
      Since commit e446630c, 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: NMarc Kleine-Budde <mkl@pengutronix.de>
      Cc: Christian Pellegrin <chripell@fsfe.org>
      Cc: Marc Zyngier <maz@misterjones.org>
      f1f8c6cb
  17. 23 7月, 2010 1 次提交
  18. 18 5月, 2010 1 次提交
  19. 13 4月, 2010 1 次提交
  20. 31 3月, 2010 1 次提交
  21. 26 2月, 2010 2 次提交
  22. 15 1月, 2010 1 次提交
  23. 12 1月, 2010 1 次提交
  24. 04 1月, 2010 1 次提交
  25. 14 12月, 2009 1 次提交
    • O
      can: Fix data length code handling in rx path · c7cd606f
      Oliver Hartkopp 提交于
      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: NOliver Hartkopp <oliver@hartkopp.net>
      Signed-off-by: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7cd606f
  26. 08 11月, 2009 1 次提交
  27. 06 11月, 2009 1 次提交
  28. 20 10月, 2009 1 次提交
    • W
      can: provide library functions for skb allocation · 7b6856a0
      Wolfgang Grandegger 提交于
      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: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7b6856a0
  29. 13 10月, 2009 1 次提交
  30. 08 10月, 2009 1 次提交
  31. 04 9月, 2009 1 次提交
  32. 01 6月, 2009 1 次提交
    • W
      can: sja1000: generic OF platform bus driver · d1a277c5
      Wolfgang Grandegger 提交于
      This patch adds a generic driver for SJA1000 chips on the OpenFirmware
      platform bus found on embedded PowerPC systems. You need a SJA1000 node
      definition in your flattened device tree source (DTS) file similar to:
      
        can@3,100 {
        	compatible = "nxp,sja1000";
        	reg = <3 0x100 0x80>;
        	interrupts = <2 0>;
        	interrupt-parent = <&mpic>;
        	nxp,external-clock-frequency = <16000000>;
        };
      
      See also Documentation/powerpc/dts-bindings/can/sja1000.txt.
      
      CC: devicetree-discuss@ozlabs.org
      Signed-off-by: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d1a277c5
  33. 19 5月, 2009 2 次提交