History log of /net/caif/cfcnfg.c
Revision Date Author Comments
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>
8a168ca7074b463d0e19a9e9c15946db1afbddc4 28-Dec-2012 Masanari Iida <standby24x7@gmail.com> treewide: Fix typo in various drivers

Correct spelling typo in printk within various drivers.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8a8ee9aff6c3077dd9c2c7a77478e8ed362b96c6 26-Jan-2012 Eric W. Biederman <ebiederm@xmission.com> net caif: Register properly as a pernet subsystem.

caif is a subsystem and as such it needs to register with
register_pernet_subsys instead of register_pernet_device.

Among other problems using register_pernet_device was resulting in
net_generic being called before the caif_net structure was allocated.
Which has been causing net_generic to fail with either BUG_ON's or by
return NULL pointers.

A more ugly problem that could be caused is packets in flight why the
subsystem is shutting down.

To remove confusion also remove the cruft cause by inappropriately
trying to fix this bug.

With the aid of the previous patch I have tested this patch and
confirmed that using register_pernet_subsys makes the failure go away as
it should.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Tested-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7c18d2205ea76eef9674e59e1ecae4f332a53e9e 30-Nov-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Restructure how link caif link layer enroll

Enrolling CAIF link layers are refactored.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5bb20ed863f8573ecd1956f0ebd2c3d36e6e0585 20-Sep-2011 Dan Carpenter <dan.carpenter@oracle.com> caif: add error handling for allocation

The allocation of "phyinfo" wasn't checked, and also the allocation
wasn't freed on error paths. Sjur Brændeland pointed out as well
that "phy_driver" should be freed on the error path too.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7ac2ed0ceeafa130f85aa947b271b571c68b9e75 25-Aug-2011 Joe Perches <joe@perches.com> caif: Remove OOM messages, use kzalloc

Remove per site OOM messages because they duplicate
the generic mm subsystem OOM message.

Use kzalloc instead of kmalloc/memset
when next to the OOM message removals.

Reduces object size (allyesconfig ~2%)

$ size -t drivers/net/caif/built-in.o.old net/caif/built-in.o.old
text data bss dec hex filename
32297 700 8224 41221 a105 drivers/net/caif/built-in.o.old
72159 1317 20552 94028 16f4c net/caif/built-in.o.old
104456 2017 28776 135249 21051 (TOTALS)
$ size -t drivers/net/caif/built-in.o.new net/caif/built-in.o.new
text data bss dec hex filename
31975 700 8184 40859 9f9b drivers/net/caif/built-in.o.new
70748 1317 20152 92217 16839 net/caif/built-in.o.new
102723 2017 28336 133076 207d4 (TOTALS)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
54e90fb5ca8050156d3e748ddc690ed6ea9d71ac 22-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Fixes freeze on Link layer removal.

CAIF Socket layer - caif_socket.c:
- Plug mem-leak at reconnect.
- Always call disconnect to cleanup CAIF stack.
- Disconnect will always report success.

CAIF configuration layer - cfcnfg.c
- Disconnect must dismantle the caif stack correctly
- Protect against faulty removals (check on id zero)

CAIF mux layer - cfmuxl.c
- When inserting new service layer in the MUX remove
any old entries with the same ID.
- When removing CAIF Link layer, remove the associated
service layers before notifying service layers.

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>
c85c2951d4da1236e32f1858db418221e624aba5 13-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Handle dev_queue_xmit errors.

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 <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>
cb3cb423a0f3c627639535e5d87977ae662d779f 13-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Add ref-count to framing layer

Introduce Per-cpu reference for lower part of CAIF Stack.
Before freeing payload is disabled, synchronize_rcu() is called,
and then ref-count verified to be zero.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
f36214408470ecf6a052e76b72d05b2328b60fcf 13-May-2011 sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> caif: Use RCU and lists in cfcnfg.c for managing caif link layers

RCU lists are used for handling the link layers instead of array.
When generating CAIF phy-id, ifindex is used as base. Legal range is 1-6.
Introduced set_phy_state() for managing CAIF Link layer state.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
73d6ac633c6c0ca703f90db0b808d9593e46aef6 11-Apr-2011 Stephen Hemminger <shemminger@vyatta.com> caif: code cleanup

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 <shemminger@vyatta.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
441c793a56502638d45d5da2195056d686147370 13-Jan-2011 Shan Wei <shanwei@cn.fujitsu.com> net: cleanup unused macros in net directory

Clean up some unused macros in net/*.
1. be left for code change. e.g. PGV_FROM_VMALLOC, PGV_FROM_VMALLOC, KMEM_SAFETYZONE.
2. never be used since introduced to kernel.
e.g. P9_RDMA_MAX_SGE, UTIL_CTRL_PKT_SIZE.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
01a859014b35deb6cc63b1dc2808ca7a0e10a4de 15-Jan-2011 Dan Carpenter <error27@gmail.com> caif: checking the wrong variable

In the original code we check if (servl == NULL) twice. The first time
should print the message that cfmuxl_remove_uplayer() failed and set
"ret" correctly, but instead it just returns success. The second check
should be checking the value of "ret" instead of "servl".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
f2527ec436fd675f08a8e7434f6e940688cb96d0 01-Nov-2010 André Carvalho de Matos <andre.carvalho.matos@stericsson.com> caif: Bugfix for socket priority, bindtodev and dbg channel.

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 <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
b04367df66eb63444d38c43d15f5e39499d85ae6 21-Sep-2010 Sjur Braendeland <sjur.braendeland@stericsson.com> caif: Minor fixes in log prints.

Use pr_debug for flow control printouts, and refine an error printout.

Signed-off-by: Sjur Braendeland <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>
a7da1f55a826c621251874e7684c234972fc3216 17-Jun-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Bugfix - RFM must support segmentation.

CAIF Remote File Manager may send or receive more than 4050 bytes.
Due to this The CAIF RFM service have to support segmentation.

Signed-off-by: Sjur Braendeland@stericsson.com
Signed-off-by: David S. Miller <davem@davemloft.net>
9bfca3c6e5965a01b7c6d8e2f2ea30799c9d43bc 24-May-2010 Dan Carpenter <error27@gmail.com> caif: cleanup: remove duplicate checks

"phyinfo" can never be null here because we assigned it an address, so I
removed both the assert and the second check inside the if statement. I
removed the "phyinfo->phy_layer != NULL" check as well because that was
asserted earlier.

Walter Harms suggested I move the "phyinfo->phy_ref_count++;" outside
the if condition for readability, so I have done that.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
49afa55b5bd792cda4fca15d3238e9b6f370c856 13-May-2010 Julia Lawall <julia@diku.dk> net/caif: Use kzalloc

Use kzalloc rather than the combination of kmalloc and memset.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8d545c8f958f5f433c50a00762ce1f231ed56eee 28-Apr-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Disconnect without waiting for response

Changes:
o Function cfcnfg_disconn_adapt_layer is changed to do asynchronous
disconnect, not waiting for any response from the modem. Due to this
the function cfcnfg_linkdestroy_rsp does nothing anymore.
o Because disconnect may take down a connection before a connect response
is received the function cfcnfg_linkup_rsp is checking if the client is
still waiting for the response, if not a disconnect request is sent to
the modem.
o cfctrl is no longer keeping track of pending disconnect requests.
o Added function cfctrl_cancel_req, which is used for deleting a pending
connect request if disconnect is done before connect response is received.
o Removed unused function cfctrl_insert_req2
o Added better handling of connect reject from modem.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5b2086567503f9b55136642031ec0067319f58e0 28-Apr-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Add reference counting to service layer

Changes:
o Added functions cfsrvl_get and cfsrvl_put.
o Added support release_client to use by socket and net device.
o Increase reference counting for in-flight packets from cfmuxl

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
e539d83cc8a4fa581cbf8ed288fdadb19a692cb0 28-Apr-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> caif: Rename functions in cfcnfg and caif_dev

Changes:
o Renamed cfcnfg_del_adapt_layer to cfcnfg_disconn_adapt_layer
o Fixed typo cfcfg to cfcnfg
o Renamed linkid to channel_id
o Updated documentation in caif_dev.h
o Minor formatting changes

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6c57990696a16ae43ea9fddb131b2784292068ba 01-Apr-2010 Stephen Rothwell <sfr@canb.auug.org.au> net-caif: using kmalloc/kfree requires the include of slab.h

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15c9ac0c80e390df09ce5730a7b08b13e07a8dd5 30-Mar-2010 Sjur Braendeland <sjur.brandeland@stericsson.com> net-caif: add CAIF generic caif support functions

Support functions for the caif protocol stack:
cfcnfg.c - CAIF Configuration Module used for
adding and removing drivers and connection
cfpkt_skbuff.c - CAIF Packet layer (SKB helper functions)

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