01 May, 2020
1 commit
-
The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix
the ndo function to use the correct type.Signed-off-by: Yunjian Wang
Signed-off-by: David S. Miller
31 May, 2019
1 commit
-
Based on 1 normalized pattern(s):
license terms gnu general public license gpl version 2
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 161 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Allison Randal
Reviewed-by: Alexios Zavras
Reviewed-by: Steve Winslow
Reviewed-by: Richard Fontana
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170027.447718015@linutronix.de
Signed-off-by: Greg Kroah-Hartman
20 Apr, 2018
1 commit
-
Trivial fix to spelling mistake
Signed-off-by: Colin Ian King
Signed-off-by: David S. Miller
09 Jan, 2018
1 commit
-
Preempt counter APIs have been split out, currently, hardirq.h just
includes irq_enter/exit APIs which are not used by caif at all.So, remove the unused hardirq.h.
Signed-off-by: Yang Shi
Cc: Dmitry Tarnyagin
Cc: "David S. Miller"
Signed-off-by: David S. Miller
27 Jun, 2017
2 commits
-
Add support for extended error reporting.
Signed-off-by: Matthias Schiffer
Acked-by: David Ahern
Signed-off-by: David S. Miller -
Add support for extended error reporting.
Signed-off-by: Matthias Schiffer
Acked-by: David Ahern
Signed-off-by: David S. Miller
08 Jun, 2017
1 commit
-
Network devices can allocate reasources and private memory using
netdev_ops->ndo_init(). However, the release of these resources
can occur in one of two different places.Either netdev_ops->ndo_uninit() or netdev->destructor().
The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.netdev_ops->ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.netdev->destructor(), on the other hand, does not run until the
netdev references all go away.Further complicating the situation is that netdev->destructor()
almost universally does also a free_netdev().This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.If netdev_ops->ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops->ndo_uninit(). But
it is not able to invoke netdev->destructor().This is because netdev->destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.However, this means that the resources that would normally be released
by netdev->destructor() will not be.Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.Many drivers do not try to deal with this, and instead we have leaks.
Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev->destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().netdev->priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev->destructor(), except for
free_netdev().netdev->needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().Now, register_netdevice() can sanely release all resources after
ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
and netdev->priv_destructor().And at the end of unregister_netdevice(), we invoke
netdev->priv_destructor() and optionally call free_netdev().Signed-off-by: David S. Miller
20 Jan, 2017
1 commit
-
The stats member of struct chnl_net is used nowhere in the code, so it
might as well be removed.Signed-off-by: Tobias Klauser
Signed-off-by: David S. Miller
28 Jun, 2016
1 commit
-
Drop redundant include of moduleparam.h
The Coccinelle semantic patch used to make this change is as follows:
@ includesmodule @
@@#include
@ depends on includesmodule @
@@- #include
Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: David S. Miller
30 Jan, 2015
1 commit
-
src_net points to the netns where the netlink message has been received. This
netns may be different from the netns where the interface is created (because
the user may add IFLA_NET_NS_[PID|FD]). In this case, src_net is the link netns.It seems wrong to override the netns in the newlink() handler because if it
was not already src_net, it means that the user explicitly asks to create the
netdevice in another netns.CC: Sjur Brændeland
CC: Dmitry Tarnyagin
Fixes: 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")
Fixes: c41254006377 ("caif-hsi: Add rtnl support")
Signed-off-by: Nicolas Dichtel
Signed-off-by: David S. Miller
15 Jan, 2014
1 commit
-
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
Signed-off-by: Ying Xue
Signed-off-by: David S. Miller
24 Apr, 2013
2 commits
-
cc: Daniel Martensson
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
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
Signed-off-by: David S. Miller
08 Mar, 2013
1 commit
-
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
Signed-off-by: David S. Miller
20 Aug, 2012
1 commit
-
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
Acked-by: Sjur Brændeland
Signed-off-by: David S. Miller
13 Apr, 2012
2 commits
-
Pull in the 'net' tree to get CAIF bug fixes upon which
the following set of CAIF feature patches depend.Signed-off-by: David S. Miller
-
Added kfree_skb() calls in the chnk_net.c file on
the error paths.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
02 Apr, 2012
1 commit
-
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.Signed-off-by: David S. Miller
12 Mar, 2012
1 commit
-
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
Signed-off-by: David S. Miller
08 Feb, 2012
1 commit
-
"priv" is initialized twice. I kept the second one, because it is next
to the check for NULL.Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller
05 Feb, 2012
1 commit
-
Count dropped packets in CAIF Netdevice.
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
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
07 Jun, 2011
1 commit
-
* 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
Signed-off-by: David S. Miller
02 Jun, 2011
1 commit
-
Take the RTNL lock unconditionally when calling dev_close.
Taking the lock conditionally may cause race conditions.Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
16 May, 2011
3 commits
-
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller -
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 -
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
Signed-off-by: David S. Miller
09 Feb, 2011
1 commit
-
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
11 Jan, 2011
1 commit
-
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
Signed-off-by: David S. Miller
22 Sep, 2010
1 commit
-
Remove debugging quirk redefining pr_debug to pr_warning.
Signed-off-by: Sjur Brændeland
Signed-off-by: David S. Miller
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_warnThis 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
21 Jun, 2010
1 commit
-
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
29 Apr, 2010
1 commit
-
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
Signed-off-by: David S. Miller
31 Mar, 2010
1 commit
-
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
Signed-off-by: David S. Miller