History log of /net/caif/chnl_net.c
Revision Date Author Comments
a74e9426948cce451af0433c69a120178948cb03 15-Jan-2014 Ying Xue <ying.xue@windriver.com> caif: __dev_get_by_index instead of dev_get_by_index to find interface

The following call chains indicate that chnl_net_open() is under
rtnl_lock protection as __dev_open() is protected by rtnl_lock.
So if __dev_get_by_index() instead of dev_get_by_index() is used
to find interface handler in it, this would help us avoid to change
interface reference counter.

__dev_open()
chnl_net_open()

Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
c2cd0a560c129d5f01be1df62bfc412d3aff6953 23-Apr-2013 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Remove bouncing address for Daniel Martensson

cc: Daniel Martensson <Daniel.Martensson@stericsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
26ee65e680f4a2291f6258e11beceae0ad4eeba3 23-Apr-2013 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Remove my bouncing email address.

Remove my soon bouncing email address.
Also remove the "Contact:" line in file header.
The MAINTAINERS file is a better place to find the
contact person anyway.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3bffc475f9995843fa23a4978a4c112d8c8f4a6e 06-Mar-2013 Silviu-Mihai Popescu <silviupopescu1990@gmail.com> CAIF: fix indentation for function arguments

This lines up function arguments on second and subsequent lines at the
first column after the openning parenthesis of the first line.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
d92c7f8aabae913de16eb855b19cd2002c341896 17-Aug-2012 Jesper Juhl <jj@chaosbits.net> caif: Do not dereference NULL in chnl_recv_cb()

In net/caif/chnl_net.c::chnl_recv_cb() we call skb_header_pointer()
which may return NULL, but we do not check for a NULL pointer before
dereferencing it.
This patch adds such a NULL check and properly free's allocated memory
and return an error (-EINVAL) on failure - much better than crashing..

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5c699fb7d88d360023f3b3f5291cbf5b59883a1b 12-Apr-2012 Tomasz Gregorek <tomasz.gregorek@stericsson.com> caif: Fix memory leakage in the chnl_net.c.

Added kfree_skb() calls in the chnk_net.c file on
the error paths.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2809cec5b52b2d02fa0d7dab6e146abfc93c5b86 02-Apr-2012 David S. Miller <davem@davemloft.net> caif: Stop using NLA_PUT*().

These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.

Signed-off-by: David S. Miller <davem@davemloft.net>
e3abcc2a8538f7d5f64dbf85404bdf8a1d1581b3 11-Mar-2012 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: make zero a legal caif connetion id.

Connection ID configured through RTNL must allow zero as
connection id. If connection-id is not given when creating the
interface, configure a loopback interface using ifindex as
connection-id.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
af2ce213f6e6b28497c5c932f43b94026b5a0363 06-Feb-2012 Dan Carpenter <dan.carpenter@oracle.com> caif: remove duplicate initialization

"priv" is initialized twice. I kept the second one, because it is next
to the check for NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
576f3cc7fb94a22df2ced8dcba7d48ff42f8e745 03-Feb-2012 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Add drop count for caif_net device.

Count dropped packets in CAIF Netdevice.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
dec17b74516bb780de75b41e7cfa0072df16bb82 20-Jun-2011 Jesper Juhl <jj@chaosbits.net> Remove redundant linux/version.h includes from net/

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 <jj@chaosbits.net>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
a6b7a407865aab9f849dd99a71072b7cd1175116 06-Jun-2011 Alexey Dobriyan <adobriyan@gmail.com> net: remove interrupt.h inclusion from netdevice.h

* remove interrupt.g inclusion from netdevice.h -- not needed
* fixup fallout, add interrupt.h and hardirq.h back where needed.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
41be5a4a3668810bf3687a76c2b017bd437039e0 01-Jun-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Fix race when conditionally taking rtnl lock

Take the RTNL lock unconditionally when calling dev_close.
Taking the lock conditionally may cause race conditions.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3f874adc4ae80828b79e8aac6891c108c1f6be6d 13-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: remove unesesarry exports

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
bee925db9a77a5736596dcf6f91d0879f5ee915b 13-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: prepare support for namespaces

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 <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
b3ccfbe4098a5542177d0f34e8979f32e7d606e1 13-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Protected in-flight packets using dev or sock refcont.

CAIF Socket Layer and ip-interface registers reference counters
in CAIF service layer. The functions sock_hold, sock_put and
dev_hold, dev_put are used by CAIF Stack to protect from freeing
memory while packets are in-flight.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
b2df5a8446e135f7648736b8bec8179c88ce360d 08-Feb-2011 David S. Miller <davem@davemloft.net> net/caif: Fix dangling list pointer in freed object on error.

rtnl_link_ops->setup(), and the "setup" callback passed to alloc_netdev*(),
cannot make state changes which need to be undone on failure. There is
no cleanup mechanism available at this point.

So we have to add the caif private instance to the global list once we
are sure that register_netdev() has succedded in ->newlink().

Otherwise, if register_netdev() fails, the caller will invoke free_netdev()
and we will have a reference to freed up memory on the chnl_net_list.

Signed-off-by: David S. Miller <davem@davemloft.net>
d7b92affba524e0ca848a5ab60649fb91190d9b5 07-Jan-2011 Kumar Sanghvi <kumar.sanghvi@stericsson.com> CAIF: Fix IPv6 support in receive path for GPRS/3G

Checks version field of IP in the receive path for GPRS/3G data
and appropriately sets the value of skb->protocol.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9c44c9fa78c5a449699491f0355189e2a09c242a 21-Sep-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Remove buggy re-definition of pr_debug

Remove debugging quirk redefining pr_debug to pr_warning.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
b31fa5bad576cd8180a5ad70c648333b44320d44 05-Sep-2010 Joe Perches <joe@perches.com> net/caif: Use pr_fmt

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 <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2aa40aef9debc77d55cc87a50d335b6fe97fbeb0 17-Jun-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Use link layer MTU instead of fixed MTU

Previously CAIF supported maximum transfer size of ~4050.
The transfer size is now calculated dynamically based on the
link layers mtu size.

Signed-off-by: Sjur Braendeland@stericsson.com
Signed-off-by: David S. Miller <davem@davemloft.net>
8391c4aab1aa4f47a9dab2c1ec3ebd2cbf09df1b 28-Apr-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Bugfixes in CAIF netdevice for close and flow control

Changes:
o Bugfix: Flow control was causing the device to be destroyed.
o Bugfix: Handle CAIF channel connect failures.
o If the underlying link layer is gone the net-device is no longer removed,
but closed.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
cc36a070b5901cd54386348b4d79d2daac91ce75 30-Mar-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> net-caif: add CAIF netdevice

Adding GPRS Net Device for PDP Contexts.
The device can be managed by RTNL as defined in if_caif.h.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>