10 Jan, 2012

1 commit


23 Dec, 2011

1 commit

  • We simply say that regular this_cpu use must be safe regardless of
    preemption and interrupt state. That has no material change for x86
    and s390 implementations of this_cpu operations. However, arches that
    do not provide their own implementation for this_cpu operations will
    now get code generated that disables interrupts instead of preemption.

    -tj: This is part of on-going percpu API cleanup. For detailed
    discussion of the subject, please refer to the following thread.

    http://thread.gmane.org/gmane.linux.kernel/1222078

    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo
    LKML-Reference:

    Christoph Lameter
     

07 Dec, 2011

1 commit


06 Dec, 2011

3 commits

  • This patch adds functionality for avoiding orphaning SKB too early.
    The original skb is stashed away and the original destructor is called
    from the hi-jacked flow-on callback. If CAIF interface goes down and a
    hi-jacked SKB exists, the original skb->destructor is restored.

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

    sjur.brandeland@stericsson.com
     
  • Flow control is implemented by inspecting the qdisc queue length
    in order to detect potential overflow on the TX queue. When a threshold
    is reached flow-off is sent upwards in the CAIF stack. At the same time
    the skb->destructor is hi-jacked by orphaning the SKB and the original
    destructor is replaced with a "flow-on" callback. When the "hi-jacked"
    SKB is consumed the queue should be empty, and the "flow-on" callback
    is called and xon is sent upwards in the CAIF stack.

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

    sjur.brandeland@stericsson.com
     
  • 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

2 commits


01 Nov, 2011

1 commit


26 Oct, 2011

1 commit

  • The caif code will register its own pernet_operations, and then register
    a netdevice_notifier. Each time the netdevice_notifier is triggered,
    it'll do some stuff... including a lookup of its own pernet stuff with
    net_generic().

    If the net_generic() call ever returns NULL, the caif code will BUG().
    That doesn't seem *so* unreasonable, I suppose — it does seem like it
    should never happen.

    However, it *does* happen. When we clone a network namespace,
    setup_net() runs through all the pernet_operations one at a time. It
    gets to loopback before it gets to caif. And loopback_net_init()
    registers a netdevice... while caif hasn't been initialised. So the caif
    netdevice notifier triggers, and immediately goes BUG().

    We could imagine a complex and overengineered solution to this generic
    class of problems, but this patch takes the simple approach. It just
    makes caif_device_notify() *not* go looking for its pernet data
    structures if the device it's being notified about isn't a caif device
    in the first place.

    Cc: stable@kernel.org
    Signed-off-by: David Woodhouse
    Acked-by: Sjur Brændeland
    Signed-off-by: David S. Miller

    David Woodhouse
     

17 Sep, 2011

1 commit

  • Commit bd30ce4bc0b7 (caif: Use RCU instead of spin-lock in caif_dev.c)
    added a potential NULL dereference in case alloc_percpu() fails.

    caif_device_alloc() can also use GFP_KERNEL instead of GFP_ATOMIC.

    Signed-off-by: Eric Dumazet
    CC: Sjur Brændeland
    Acked-by: Sjur Brændeland
    Signed-off-by: David S. Miller

    Eric Dumazet
     

22 Jun, 2011

1 commit

  • It was suggested by "make versioncheck" that the follwing includes of
    linux/version.h are redundant:

    /home/jj/src/linux-2.6/net/caif/caif_dev.c: 14 linux/version.h not needed.
    /home/jj/src/linux-2.6/net/caif/chnl_net.c: 10 linux/version.h not needed.
    /home/jj/src/linux-2.6/net/ipv4/gre.c: 19 linux/version.h not needed.
    /home/jj/src/linux-2.6/net/netfilter/ipset/ip_set_core.c: 20 linux/version.h not needed.
    /home/jj/src/linux-2.6/net/netfilter/xt_set.c: 16 linux/version.h not needed.

    and it seems that it is right.

    Beyond manually inspecting the source files I also did a few build
    tests with various configs to confirm that including the header in
    those files is indeed not needed.

    Here's a patch to remove the pointless includes.

    Signed-off-by: Jesper Juhl
    Acked-by: Jozsef Kadlecsik
    Signed-off-by: David S. Miller

    Jesper Juhl
     

23 May, 2011

1 commit


16 May, 2011

3 commits

  • Do proper handling of dev_queue_xmit errors in order to
    avoid double free of skb and leaks in error conditions.
    In cfctrl pending requests are removed when CAIF Link layer goes down.

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

    sjur.brandeland@stericsson.com
     
  • Use struct net to reference CAIF configuration object instead of static variables.
    Refactor functions caif_connect_client, caif_disconnect_client and squach
    files cfcnfg.c and caif_config_utils.

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

    sjur.brandeland@stericsson.com
     
  • RCU read_lock and refcount is used to protect in-flight packets.

    Use RCU and counters to manage freeing lower part of the CAIF stack if
    CAIF-link layer is removed. Old solution based on delaying removal of
    device is removed.

    When CAIF link layer goes down the use of CAIF link layer is disabled
    (by calling caif_set_phy_state()), but removal and freeing of the
    lower part of the CAIF stack is done when Link layer is unregistered.

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

    sjur.brandeland@stericsson.com
     

18 Apr, 2011

1 commit


12 Apr, 2011

2 commits

  • If CAIF Link Layer returns an error, we no longer try to re-build the
    CAIF packet and resend it. Instead, we simply return any transmission
    errors to the socket client.

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

    Sjur Brændeland
     
  • 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
     

04 Nov, 2010

1 commit

  • Changes:
    o Bugfix: SO_PRIORITY for SOL_SOCKET could not be handled
    in caif's setsockopt, using the struct sock attribute priority instead.

    o Bugfix: SO_BINDTODEVICE for SOL_SOCKET could not be handled
    in caif's setsockopt, using the struct sock attribute ifindex instead.

    o Wrong assert statement for RFM layer segmentation.

    o CAIF Debug channels was not working over SPI, caif_payload_info
    containing padding info must be initialized.

    o Check on pointer before dereferencing when unregister dev in caif_dev.c

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    André Carvalho de Matos
     

22 Sep, 2010

1 commit


07 Sep, 2010

2 commits

  • Convert pr_("%s" ..., (struct netdev *)->name ...)
    to netdev_((struct netdev *), ...)

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

    Joe Perches
     
  • 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
     

21 Jun, 2010

1 commit


18 May, 2010

1 commit

  • This patch removes from net/ (but not any netfilter files)
    all the unnecessary return; statements that precede the
    last closing brace of void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

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

    Joe Perches
     

29 Apr, 2010

3 commits


31 Mar, 2010

1 commit