1. 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
  2. 12 12月, 2009 1 次提交
  3. 04 12月, 2009 1 次提交
  4. 19 11月, 2009 1 次提交
  5. 18 11月, 2009 1 次提交
  6. 17 11月, 2009 11 次提交
  7. 14 11月, 2009 3 次提交
  8. 08 11月, 2009 3 次提交
  9. 07 11月, 2009 1 次提交
  10. 27 10月, 2009 1 次提交
  11. 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
  12. 15 10月, 2009 1 次提交
  13. 13 10月, 2009 1 次提交
  14. 08 10月, 2009 1 次提交
  15. 26 9月, 2009 1 次提交
  16. 25 9月, 2009 1 次提交
  17. 23 9月, 2009 1 次提交
  18. 22 9月, 2009 1 次提交
  19. 15 9月, 2009 1 次提交
  20. 04 9月, 2009 3 次提交
    • W
      can: sja1000: legacy SJA1000 ISA bus driver · 2a6ba39a
      Wolfgang Grandegger 提交于
      This patch adds support for legacy SJA1000 CAN controllers on the ISA
      or PC-104 bus. The I/O port or memory address and the IRQ number must
      be specified via module parameters:
      
        insmod sja1000_isa.ko port=0x310,0x380 irq=7,11
      
      for ISA devices using I/O ports or:
      
        insmod sja1000_isa.ko mem=0xd1000,0xd1000 irq=7,11
      
      for memory mapped ISA devices.
      
      Indirect access via address and data port is supported as well:
      
        insmod sja1000_isa.ko port=0x310,0x380 indirect=1 irq=7,11
      
      Here is a full list of the supported module parameters:
      
        port:I/O port number (array of ulong)
        mem:I/O memory address (array of ulong)
        indirect:Indirect access via address and data port (array of byte)
        irq:IRQ number (array of int)
        clk:External oscillator clock frequency (default=16000000 [16 MHz])
            (array of int)
        cdr:Clock divider register (default=0x48 [CDR_CBP | CDR_CLK_OFF])
            (array of byte)
        ocr:Output clock register (default=0x18 [OCR_TX0_PUSHPULL])
            (array of byte)
      
      Note: for clk, cdr, ocr, the first argument re-defines the default
      for all other devices, e.g.:
      
       insmod sja1000_isa.ko mem=0xd1000,0xd1000 irq=7,11 clk=24000000
      
      is equivalent to
      
       insmod sja1000_isa.ko mem=0xd1000,0xd1000 irq=7,11 \
                             clk=24000000,24000000
      Signed-off-by: NWolfgang Grandegger <wg@grandegger.com>
      Tested-by: NOliver Hartkopp <oliver@hartkopp.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a6ba39a
    • W
      can: sja1000: fix network statistics update · 8935f57e
      Wolfgang Grandegger 提交于
      The member "tx_bytes" of "struct net_device_stats" should be
      incremented when the interrupt is done and an "arbitration
      lost error" is a TX error and the statistics should be updated
      accordingly.
      Signed-off-by: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8935f57e
    • W
      can: add can_free_echo_skb() for upcoming drivers · 39e3ab6f
      Wolfgang Grandegger 提交于
      This patch adds the function can_free_echo_skb to the CAN
      device interface to allow upcoming drivers to release echo
      skb's in case of error.
      Signed-off-by: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      39e3ab6f
  21. 03 9月, 2009 1 次提交
  22. 01 9月, 2009 2 次提交
  23. 14 8月, 2009 1 次提交