11 Jun, 2017

1 commit

  • The kernel may sleep under a rcu read lock in cfpkt_create_pfx, and the
    function call path is:
    cfcnfg_linkup_rsp (acquire the lock by rcu_read_lock)
    cfctrl_linkdown_req
    cfpkt_create
    cfpkt_create_pfx
    alloc_skb(GFP_KERNEL) --> may sleep
    cfserl_receive (acquire the lock by rcu_read_lock)
    cfpkt_split
    cfpkt_create_pfx
    alloc_skb(GFP_KERNEL) --> may sleep

    There is "in_interrupt" in cfpkt_create_pfx to decide use "GFP_KERNEL" or
    "GFP_ATOMIC". In this situation, "GFP_KERNEL" is used because the function
    is called under a rcu read lock, instead in interrupt.

    To fix it, only "GFP_ATOMIC" is used in cfpkt_create_pfx.

    Signed-off-by: Jia-Ju Bai
    Signed-off-by: David S. Miller

    Jia-Ju Bai
     

15 Mar, 2016

1 commit

  • gcc points out code that is not indented the way it is
    interpreted:

    net/caif/cfpkt_skbuff.c: In function 'cfpkt_setlen':
    net/caif/cfpkt_skbuff.c:289:4: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
    return cfpkt_getlen(pkt);
    ^~~~~~
    net/caif/cfpkt_skbuff.c:286:3: note: ...this 'else' clause, but it is not
    else
    ^~~~

    It is clear from the context that not returning here would be
    a bug, as we'd end up passing a negative length into a function
    that takes a u16 length, so it is not missing curly braces
    here, and I'm assuming that the indentation is the only part
    that's wrong about it.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

21 Feb, 2015

1 commit

  • The cfpkt_iterate() function can return -EPROTO on error, but the
    function is a u16 so the negative value gets truncated to a positive
    unsigned short. This causes a static checker warning.

    The only caller which might care is cffrml_receive(), when it's checking
    the frame checksum. I modified cffrml_receive() so that it never says
    -EPROTO is a valid checksum.

    Also this isn't ever going to be inlined so I removed the "inline".

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     

08 Nov, 2013

1 commit


24 Apr, 2013

1 commit


08 Mar, 2013

1 commit


13 Apr, 2012

1 commit

  • Set traffic class for CAIF packets, based on socket
    priority, CAIF protocol type, or type of message.

    Traffic class mapping for different packet types:
    - control: TC_PRIO_CONTROL;
    - flow control: TC_PRIO_CONTROL;
    - at: TC_PRIO_CONTROL;
    - rfm: TC_PRIO_INTERACTIVE_BULK;
    - other sockets: equals to socket's TC;
    - network data: no change.

    Signed-off-by: Dmitry Tarnyagin
    Signed-off-by: David S. Miller

    Dmitry Tarnyagin
     

06 Dec, 2011

1 commit

  • NCM 1.0 does not support anything but Ethernet framing, hence
    CAIF payload will be put into Ethernet frames.

    Discovery is based on fixed USB vendor 0x04cc (ST-Ericsson),
    product-id 0x230f (NCM). In this variant only CAIF payload is sent over
    the NCM interface.

    The CAIF stack (cfusbl.c) will when USB interface register first check if
    we got a CDC NCM USB interface with the right VID, PID.
    It will then read the device's Ethernet address and create a 'template'
    Ethernet TX header, using a broadcast address as the destination address,
    and EthType 0x88b5 (802.1 Local Experimental - vendor specific).

    A protocol handler for 0x88b5 is setup for reception of CAIF frames from
    the CDC NCM USB interface.

    Signed-off-by: Sjur Brændeland
    Signed-off-by: David S. Miller

    sjur.brandeland@stericsson.com
     

01 Dec, 2011

1 commit


01 Nov, 2011

1 commit


16 May, 2011

1 commit


12 Apr, 2011

1 commit

  • Cleanup of new CAIF code.
    * make local functions static
    * remove code that is never used
    * expand get_caif_conf() since wrapper is no longer needed
    * make args to comparison functions const
    * rename connect_req_to_link_param to keep exported names
    consistent

    Compile tested only.

    Signed-off-by: Stephen Hemminger
    Acked-by: Sjur Brændeland
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

07 Sep, 2010

1 commit

  • This patch standardizes caif message logging prefixes.

    Add #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
    Add missing "\n"s to some logging messages
    Convert pr_warning to pr_warn

    This changes the logging message prefix from CAIF: to caif:
    for all uses but caif_socket.c and chnl_net.c. Those now use
    their filename without extension.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

11 Aug, 2010

1 commit


21 Jun, 2010

2 commits


24 May, 2010

1 commit


31 Mar, 2010

1 commit