aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)Author
2011-05-05CAIF: Alignment with internal CAIF development gitErwan Bracq
Code changes from internal git that will / are submitted to kernel upstream. - Dead code cleanup. - Minor bug fix. Change-Id: I15980a277ec9be98fd2404610d023c3fdd091343 Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21535 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: Correct assert condition for rfm packet lengthErwan Bracq
The assert condition is negated. It should not be. Change-Id: Icb15b841bb6e1c7734743a7df1053daa40617456 Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21534 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: Fix crash when transmitting to a dbg channelDaniel Martensson
Minor fixes to rollback. Change-Id: Icc2d45fed70bc29e927b617af12cced07047f7e5 Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21532 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: Socket option BINDTODEV failureSjur Brændeland
Socket option BINDTODEV should fail if not binding to CAIF device. Change-Id: I74e717255a3d7e7762dfeea71f2cf901c5f9b94b Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21531 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: Fixed bindtodevice from set socket optionsAndre Carvalho de Matos
Change-Id: I794783fb03e5514824cdbfebce786aaf50f33a9e Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21530 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: Removed forgotten debug codeAndre Carvalho de Matos
Change-Id: I17a504350ab023bd852d5bc87b6d260020340637 Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21529 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: Bugfix on Priority on socket and net devicesAndre Carvalho de Matos
Found that priority for the caif interface in kernel is different than the caif protocol. Added a fix to convert between the 2. Changed way to set socket options for priority, now it is used the kernel standart. For net devices fixed a bug for defning default values of conn_req. Change-Id: I08da8c1ed89482eef5782e353bee656dc0088f66 Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21528 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-05CAIF: removed netdev_info netdev_warnErwan Bracq
Some of the netdevice structure field are not initialized or unitialized when the macros are used. Result is a segfault on a NULL pointer. Change-Id: Ia0679705aa663252804bd1b7d5727b09288d3931 Signed-off-by: Erwan Bracq <erwan.bracq@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21526 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: Fix set-but-unused variables.David S. Miller
The variable 'caifdef' is set but unused in modemcmd(). Similarly for 'net' in receive(), and 'res' in caif_device_notify() and caif_exit_net(). Just kill them off. Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Ic21ba71221c8a2dc836c076f854a01985885d75a Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21525 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: Add BUG_ON if dev_info is missing in packetSjur Brændeland
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I042b517b59407bcc20ca9cbf070cc0eac064707a Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21524 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: Don't resend if dev_queue_xmit fails.Sjur Brændeland
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 <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I2e78385db334eb24016ad582dcfb6a121bd19b4c Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21523 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: code cleanupStephen Hemminger
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> Change-Id: I6e91241096d3a5958a19a9c5d1522eb06febec27 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21522 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: performance bugfix - allow radio stack to prioritize packets.Sjur Brændeland
In the CAIF Payload message the Packet Type indication must be set to UNCLASSIFIED in order to allow packet prioritization in the modem's network stack. Otherwise TCP-Ack is not prioritized in the modems transmit queue. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I2f8ae1a663a4e84a0e5b789698cd75ed28ae76d1 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21521 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: Bugfix use for_each_safe when removing list nodes.Sjur Brændeland
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I7fec5eb6d17e01a87e89c2e7adec72d2f8babf83 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21520 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26net/caif: Fix dangling list pointer in freed object on error.David S. Miller
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> Change-Id: I9107d9bc35363f215c562bfdbc54724178929b5d Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21519 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-26caif: checking the wrong variableDan Carpenter
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> Change-Id: I2dce1dbdd6e283e135f9fdb395bd0b0b1b5a4591 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21517 Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com> Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com> Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-01net: New iface_stat module to monitor persistent network statsAshish Sharma
Adding a new module that tracks the number of bytes/packets transfered by a network interface, even after the interface has been removed. This is relevant to track the total data usage in mobile devices whose interfaces are added and removed quite frequently (WiFi, Bluetooth, 3G,..). Monitoring is done only for devices that are configured with a valid IP address (check to exclude virtual/loopback/tunnel interfaces). Change-Id: I8ac642af1990433ebd0784e8dbd72bf0714b5bf6 Signed-off-by: Ashish Sharma <ashishsharma@google.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19516 Tested-by: Piotr TOMASZEWSKI <piotr.tomaszewski@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-04-01net: Add UDP stats and pkt count to uid_statAshish Sharma
Change-Id: If95374a6dbde66720a3c74b5b50cc7e774bbbbf8 Signed-off-by: Ashish Sharma <ashishsharma@google.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19498 Tested-by: Piotr TOMASZEWSKI <piotr.tomaszewski@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-03-29WLAN: Add symlinks to compat-wirelessJonas Aaberg
And disable the use of 2.6.35 wlan stuff if compat-wireless is enabled. Depends-On: I7147b541419c684dc337e5d32b021b470dd0f344, Ib489e754a7cf4bd79ce20955be61cae7958043e1, Id8d0913143e58a21dbfebe187a9594a0cb7bea8a, Ieaadb213c53d967ab5dcb293aeee088fd3efbae8, Ie280d1b7e533d7045e4e77c0cab3d69f1180c091, Ia40a0c011f35c3056d02d12b054f93aa86d99b47, Ib3b5524ec3814b00a7e46f591d7715db16eec5fd ST-Ericsson Linux next: - ST-Ericsson ID: CR283174 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I28a1b6b32383e71f9679031bffcefff022eaadde Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/16241 Tested-by: Mariusz CZAPLICKI <mariusz.czaplicki@tieto.com> Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
2011-03-25Bluetooth: Remove race condition l2cap_conn_delJosef Kindberg
Removes race condition, connection is deleted before timer handlers is canceled. Added spinlock and null check beacuse function del_timer_sync doesn't work in softinterupt context. Changed alloc of conn->p_req to be atomic. ST-Ericsson Linux next: Not tested. ST-Ericsson ID: 329716 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I6c3d103120f4b2939093b91dce32347b6b729f91 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18994 Reviewed-by: Josef KINDBERG <josef.kindberg@stericsson.com> Tested-by: Josef KINDBERG <josef.kindberg@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
2011-03-25Bluetooth: fix oops in l2cap_connect_reqJosef Kindberg
In error cases when the ACL is insecure or we fail to allocate a new struct sock, we jump to the "response" label. If so, "sk" will be null and the kernel crashes. ST-Ericsson Linux next: Backport of d793fe8caa3911e6a1e826b45d4ee00d250cdec8 ST-Ericsson ID: 329716 ST-Ericsson FOSS-OUT ID: NA Change-Id: Ib48588657a6135e10ddb6eccd86b7aa2c7c6ecfe Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19016 Reviewed-by: Josef KINDBERG <josef.kindberg@stericsson.com> Tested-by: Josef KINDBERG <josef.kindberg@stericsson.com> Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
2011-03-17[ANDROID] bluetooth: Improve BNEP extension headers handlingAndrzej Kaczmarek
Adds handling of extension headers to BNEP control packets. Adds support for BNEP setup connection request handled in pand. ST-Ericsson Linux next: - ST-Ericsson ID: 328144 ST-Ericsson FOSS-OUT-ID: Trivial Depends-On: Id2cbd106af9b380f63d87ea0b4652ec6cd996fa4 Change-Id: I005e00e2fe934dc19f40533953d5b233676f0d0e Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18117 Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com> Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com>
2011-03-17bluetooth: Option to disable l2cap_info_reqAndrzej Kaczmarek
Adds L2CAP module options to disable automatic l2cap_information_req. ST-Ericsson Linux next: - ST-Ericsson ID: 328144 ST-Ericsson FOSS-OUT-ID: Trivial Change-Id: Id46651871e5a1e948803ac1458db7e73da4a1f12 Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18116 Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com> Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2011-03-07Bluetooth: Send ConfigReq after send a ConnectionRspGustavo F. Padovan
The extended L2CAP features requires that one should initiate a ConfigReq after send the ConnectionRsp. This patch changes the behaviour of the configuration process of our stack. ST-Ericsson Linux next: cherry-picked from linux-next ST-Ericsson ID: 327040 ST-Ericsson FOSS-OUT-ID: Trivial Change-Id: I332571883fde07c723c2ba08cf9b1301b779e8f0 Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/17545 Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Tested-by: Arkadiusz MISIEWICZ <arkadiusz.misiewicz@tieto.com> Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
2011-03-05Bluetooth: Add counter for not acked HCI commandsAndrzej Kaczmarek
Adds counter for HCI commands which were sent but are not yet acked. This is to prevent race conditions in scenarios where HCI commands are sent between complete event and command status event, i.e. last sent HCI command is not accounted in credits number returned by command status event. ST-Ericsson Linux next: not tested, ER? ST-Ericsson ID: 323271 ST-Ericsson FOSS-OUT-ID: Trivial Change-Id: I74d1f31ab79ee07406858451c94273301eee6e64 Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/16344 Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com> Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2011-03-03BT: Force MITM on BT_SECURITY_HIGH level.Lukasz Rymanowski
This patch fixes scenario when it is possible to connect socket which requires MITM, without MITM. ST-Ericsson ID: 326071 ST-Ericcson FOSS-OUT-ID: Trivial ST-Ericsson Linux next: 274079 Depends-On: I8ff3fe6dfb7d9a4e537abb87a10932a0cd209ff9 Change-Id: I9b07e684efbe5c35bccbe7bae39c5b4126f546cf Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/17247 Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Tested-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
2011-01-24bluetooth: New security level for SAP connectionsAndrzej Kaczmarek
New security level is added which enforces proper security settings for SAP connection and allows already existing security levels to be unchanged. ST-Ericsson Linux next: Not tested, 319114 ST-Ericsson ID: 319114 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ide1d8d9145fd9c335bfbdd744c801551aa2edef5 Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/12650 Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
2011-01-24phonet: some signedness bugsDan Carpenter
Dan Rosenberg pointed out that there were some signed comparison bugs in the phonet protocol. http://marc.info/?l=full-disclosure&m=129424528425330&w=2 The problem is that we check for array overflows but "protocol" is signed and we don't check for array underflows. If you have already have CAP_SYS_ADMIN then you could use the bugs to get root, or someone could cause an oops by mistake. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I1016b5b7cd21c12426bc50f0a57fbd22a5c00438 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13166 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Net: phonet: Makefile: Remove deprecated kbuild goal definitionsTracey Dent
Changed Makefile to use <modules>-y instead of <modules>-objs because -objs is deprecated and not mentioned in Documentation/kbuild/makefiles.txt. Signed-off-by: Tracey Dent <tdent48227@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I11691278fd45acd7e00aad576b5e0aa127924962 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13165 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24phonet: remove the unused variable pnChangli Gao
Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I4b04b9023f450b47659b5add1c45042319e6fe9b Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13164 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: 'connect' socket implementation for Pipe controllerKumar Sanghvi
Based on suggestion by Rémi Denis-Courmont to implement 'connect' for Pipe controller logic, this patch implements 'connect' socket call for the Pipe controller logic. The patch does following:- - Removes setsockopts for PNPIPE_CREATE and PNPIPE_DESTROY - Adds setsockopt for setting the Pipe handle value - Implements connect socket call - Updates the Pipe controller logic User-space should now follow below sequence with Pipe controller:- -socket -bind -setsockopt for PNPIPE_PIPE_HANDLE -connect -setsockopt for PNPIPE_ENCAP_IP -setsockopt for PNPIPE_ENABLE GPRS/3G data has been tested working fine with this. Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Icd3f672905df7802445e6e5c18dab864b16762c5 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13163 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: mark the pipe controller as EXPERIMENTALRémi Denis-Courmont
There are a bunch of issues that need to be fixed, including: - GFP_KERNEL allocations from atomic context (and GFP_ATOMIC in process context), - abuse of the setsockopt() call convention, - unprotected/unlocked static variables... IMHO, we will need to alter the userspace ABI when we fix it. So mark the configuration option as EXPERIMENTAL for the time being (or should it be BROKEN instead?). Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I7b204a54e159557839a94843348a177a1e3f4fd4 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13162 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: cleanup pipe enable socket optionRémi Denis-Courmont
The current code works like this: int garbage, status; socklen_t len = sizeof(status); /* enable pipe */ setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &garbage, sizeof(garbage)); /* disable pipe */ setsockopt(fd, SOL_PNPIPE, PNPIPE_DISABLE, &garbage, sizeof(garbage)); /* get status */ getsockopt(fd, SOL_PNPIPE, PNPIPE_INQ, &status, &len); ...which does not follow the usual socket option pattern. This patch merges all three "options" into a single gettable&settable option, before Linux 2.6.37 gets out: int status; socklen_t len = sizeof(status); /* enable pipe */ status = 1; setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status)); /* disable pipe */ status = 0; setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status)); /* get status */ getsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, &len); This also fixes the error code from EFAULT to ENOTCONN. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Cc: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I236b4dad30de4e0d011d9b75fc1fa2da2f7cc7db Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13161 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: advise against enabling the pipe controllerRémi Denis-Courmont
As it currently is, the new code path is not compatible with existing Nokia modems. This would break existing userspace for Nokia modem, such as the existing oFono ISI driver. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Id932c46d7ea215050d3c61ada301b24b80a663d8 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13160 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: restore flow control credits when sending failsRémi Denis-Courmont
This patch restores the below flow control patch submitted by Rémi Denis-Courmont, which accidentaly got lost due to Pipe controller patch on Phonet. commit 1a98214feef2221cd7c24b17cd688a5a9d85b2ea Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Date: Mon Aug 30 12:57:03 2010 +0000 Phonet: restore flow control credits when sending fails Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: If6a5e9749962a74a945bcc39dc325dd861792b50 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13159 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: Correct header retrieval after pskb_may_pullKumar Sanghvi
Retrieve the header after doing pskb_may_pull since, pskb_may_pull could change the buffer structure. This is based on the comment given by Eric Dumazet on Phonet Pipe controller patch for a similar problem. Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I3a3ddfc9ff227c0febdad7ae7e129ce4861861e1 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13158 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: Implement Pipe Controller to support Nokia Slim ModemsKumar Sanghvi
Phonet stack assumes the presence of Pipe Controller, either in Modem or on Application Processing Engine user-space for the Pipe data. Nokia Slim Modems like WG2.5 used in ST-Ericsson U8500 platform do not implement Pipe controller in them. This patch adds Pipe Controller implemenation to Phonet stack to support Pipe data over Phonet stack for Nokia Slim Modems. Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Iaf01a146b2cc0c3869ccfea8378d6f354af1c226 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13157 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24phonet: Fix build warning.David S. Miller
net/phonet/socket.c: In function ‘pn_res_seq_show’: net/phonet/socket.c:726: warning: format ‘%02X’ expects type ‘unsigned int’, but argument 3 has type ‘long int’ Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I98a363b71ce6ee17f27829976b677a1509ddaa4e Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13156 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: list subscribed resources via proc_fsRémi Denis-Courmont
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Id172893a1213652c3de30fc874ed2f818695e0df Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13155 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: look up the resource routing table when forwardingRémi Denis-Courmont
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I5284a227c57449a9ecc8d9e4c934ee2cd1109009 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13154 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: hook resource routing to userspace via ioctl()'sRémi Denis-Courmont
I wish we could use something cleaner, such as bind(). But that would not work since resource subscription is orthogonal/in addition to the normal object ID allocated via bind(). This is similar to multicasting which also uses ioctl()'s. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Ia77be1a96e55ff2db13d9bfbbe653e3171fd6d03 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13153 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: resource routing backendRémi Denis-Courmont
When both destination device and object are nul, Phonet routes the packet according to the resource field. In fact, this is the most common pattern when sending Phonet "request" packets. In this case, the packet is delivered to whichever endpoint (socket) has registered the resource. This adds a new table so that Linux processes can register their Phonet sockets to Phonet resources, if they have adequate privileges. (Namespace support is not implemented at the moment.) Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I75b9488ed7b045f772e658ed7bb94c76ccc3a80f Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13152 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: remove dangling pipe if an endpoint is closed earlyRémi Denis-Courmont
Closing a pipe endpoint is not normally allowed by the Phonet pipe, other than as a side after-effect of removing the pipe between two endpoints. But there is no way to prevent Linux userspace processes from being killed or suffering from bugs, so this can still happen. We might as well forcefully close Phonet pipe endpoints then. The cellular modem supports only a few existing pipes at a time. So we really should not leak them. This change instructs the modem to destroy the pipe if either of the pipe's endpoint (Linux socket) is closed too early. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I4c4e400de8fc228bf2c2e64cfe59fd11842d812a Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13151 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: do not set POLLOUT in case of send buffer overflowRémi Denis-Courmont
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Icb4bfa26a104ed4acc164b1bf3538b199955f08e Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13150 Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: QATOOLS Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Phonet: correct sendmsg() error code from sock_alloc_send_skb()Rémi Denis-Courmont
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I60f9b5d22fe7e8b6acb2f983c1ce9d42031b70c8 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13149 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24phonet: use call_rcu for phonet device freeJiri Pirko
Use call_rcu rather than synchronize_rcu. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: I7b4a0907bcd405810c618151bb54d8148d956b00 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13148 Reviewed-by: QATOOLS Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Revert "Phonet: Insert correct dest addr and port for TCP/IP data on U8500"Arun Murthy
This reverts commit ebbc697c126846cc6e31512b4babbc8148e4315c. Change-Id: Id2c421a65661f141fa5c249f0a924d2b6fa59726 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13147 Reviewed-by: QATOOLS Reviewed-by: Kumar A SANGHVI <kumar.sanghvi@stericsson.com> Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-24Revert "Phonet: Fix bug for Pep Disconnect request"Arun Murthy
This reverts commit f80745aaacb70e220450999ea7392b54c892778b. Conflicts: net/phonet/pep.c Change-Id: Iad4cccd5a53c0689423bd57d6b9d9f3b8a5a19ed Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13146 Reviewed-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Tested-by: B Sampath KUMAR <sampath.kumar@stericsson.com> Reviewed-by: QATOOLS Reviewed-by: Kumar A SANGHVI <kumar.sanghvi@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-01-20bluetooth: Fix for security block issue.Lukasz Rymanowski
It can happen that controller will schedule, ACL data containing L2CAP connect request to host just before encryption change event, even though link is encrypted on LMP level before L2CAP conntect request come. With this fix, L2CAP layer will handle such scenario. ST-Ericsson Linux next: Not tested, ER320222 ST-Ericsson ID: ER319123 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: If436237b65b135df3ec351f9b59f9a8678a4f0db Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/12526 Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Tested-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: QATOOLS Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
2011-01-17CAIF: Fix IPv6 support in receive path for GPRS/3GKumar Sanghvi
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> Change-Id: I8babafdbefa9c92fff261723ac72de908f3c4605 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/12587 Reviewed-by: Kumar A SANGHVI <kumar.sanghvi@stericsson.com> Tested-by: Kumar A SANGHVI <kumar.sanghvi@stericsson.com> Reviewed-by: QATOOLS Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>