aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* Bluetooth: replace list_for_each with list_for_each_entry whenever possibleLuiz Augusto von Dentz2011-11-07
| | | | | | | | When all items in the list have the same type there is no much of a point to use list_for_each except if you want to use the list pointer itself. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: correct debug outputAndrei Emeltchenko2011-11-07
| | | | | | | l2cap_set_timer function prints sk instead of chan pointer. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: remove magic offset and sizeAndrei Emeltchenko2011-11-07
| | | | | | | make code readable by removing magic numbers Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: small styles clean ups to l2cap_core.cGustavo F. Padovan2011-11-07
| | | | Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EFS: implement L2CAP config pending stateAndrei Emeltchenko2011-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add L2CAP Config Pending state for EFS. Currently after receiving Config Response Pending respond with Config Response Success. ... > ACL data: handle 1 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0 Connection successful > ACL data: handle 1 flags 0x02 dlen 45 L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 33 RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 0, MTo 0, MPS 1009) EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff, AccLat 0xffffffff, FlushTO 0x0000ffff) < ACL data: handle 1 flags 0x00 dlen 45 L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 33 RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 0, MTo 0, MPS 498) EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff, AccLat 0xffffffff, FlushTO 0x0000ffff) < ACL data: handle 1 flags 0x00 dlen 47 L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 4 clen 33 Pending MTU 672 RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 2000, MTo 12000, MPS 498) EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff, AccLat 0xffffffff, FlushTO 0x0000ffff) > ACL data: handle 1 flags 0x02 dlen 47 L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 4 clen 33 Pending MTU 672 RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 2000, MTo 12000, MPS 498) EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff, AccLat 0xffffffff, FlushTO 0x0000ffff) > ACL data: handle 1 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0 Success < ACL data: handle 1 flags 0x00 dlen 14 L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0 Success < ACL data: handle 1 flags 0x00 dlen 510 L2CAP(d): cid 0x0040 len 506 ext_ctrl 0x00010000 fcs 0xebe0 [psm 4113] I-frame: Start (len 672) TxSeq 0 ReqSeq 0 ... Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: ath3k: output firmware filename when request_firmware failedPaul Fertser2011-11-07
| | | | | | | | This makes it much easier for the users to understand why the driver refuses to load when the firmware is unavailable. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Make hci_unregister_dev return voidDavid Herrmann2011-11-07
| | | | | | | | | hci_unregister_dev cannot fail and always returns 0. The drivers already ignore the return value so we can safely make it return void. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Ignore hci_unregister_dev return valueDavid Herrmann2011-11-07
| | | | | | | | | | | | Make all bluetooth drivers ignore the return value of hci_unregister_dev as it always returns 0. In the next step, hci_unregister_dev can be modified to return void. Some of the drivers already ignore the return value (including btusb), hence, this will increase consitency in the bluetooth drivers. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Replace rfcomm tty tasklet by workqueueDavid Herrmann2011-11-07
| | | | | | | | Remove old tasklets and replace by workqueue. To avoid reentrancy (which tasklets always avoid) we use the system_nrt_wq. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Return proper error codes on rfcomm tty initDavid Herrmann2011-11-07
| | | | | | | | Forward error codes from tty core to the rfcomm_init caller instead of using generic -1 errors. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EFS: parse L2CAP config requestAndrei Emeltchenko2011-10-17
| | | | | | | | | Add parsing Extended Flow Specification option in L2CAP Config Request Based upon haijun.liu <haijun.liu@atheros.com> series of patches (sent Sun, 22 Aug 2010) Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: fix max_pdu calculationAndrei Emeltchenko2011-10-17
| | | | | | | | Fix max_pdu_size calculationin for RFC. Change magic number to human readable defines. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: remove magic numbers in l2capAndrei Emeltchenko2011-10-17
| | | | | | | | Remove magic numbers for FCS, SDU LEN and PSM LEN when calculating packet payload. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: support extended seq numbersAndrei Emeltchenko2011-10-17
| | | | | | | | Adds support for extended sequence numbers found in extended control fields. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: handling different Control fieldsAndrei Emeltchenko2011-10-17
| | | | | | | | | There are three different Control Field formats: the Standard Control Field, the Enhanced Control Field, and the Extended Control Field. Patch adds function to handle all those fields seamlessly. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix missing cmd_status in mgmtGustavo F. Padovan2011-10-15
| | | | | | set_service_cache() was missing a cmd_status for the error case. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix mgmt interaction with userspaceGustavo F. Padovan2011-10-14
| | | | | | | Partially revert 34918cd7. struct mgmt_key_info needs to have the same size as its version exported to userspace. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Use list_for_each_entry() in mgmtGustavo F. Padovan2011-10-14
| | | | Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Add missing cmd_status() in mgmtGustavo F. Padovan2011-10-14
| | | | | | Improve error handling in mgmt load_keys() Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: return proper error if sock_queue_rcv_skb() failsGustavo F. Padovan2011-10-14
| | | | | | Improve error handling at cmd_status() and cmd_complete() Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Forward errors from hci_register_devDavid Herrmann2011-10-14
| | | | | | | | We need to catch errors when calling hci_add_sysfs() and return them to the caller to avoid kernel oopses on device_add() failure. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Rename sysfs un/register to add/delDavid Herrmann2011-10-14
| | | | | | | | | | As we introduced hci_init_sysfs() we should also rename hci_register_sysfs() and hci_unregister_sysfs() to hci_add_sysfs() and hci_del_sysfs() like we do with hci_conn_add/del_sysfs(). It looks more consistent now. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix hci core device initializationDavid Herrmann2011-10-14
| | | | | | | | | | | | | | | | | We must not call device_del() if we didn't use device_add(). See module.c for comments on that. Therefore, we need to call device_initialize() when allocating the hci device and later device_add() instead of device_register(). This also fixes a bug when hci_register_dev() failed and we call hci_free_dev() without a valid core device. hci_free_dev() segfaults while calling put_device() on invalid memory. We already do this with hci_conn connections (hci_conn_init_sysfs()) so they do not need to be fixed. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: AMP: read local amp info HCI commandAndrei Emeltchenko2011-10-13
| | | | | | | Implementation of Read Local AMP Info Command Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EFS: add efs option in L2CAP conf reqAndrei Emeltchenko2011-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Extended Flow Specification option when building L2CAP Configuration Request. EFS is added if both the local and remote L2CAP entities have indicated support for the Extended Flow Specification for BR/EDR. ... < ACL data: handle 1 flags 0x00 dlen 10 L2CAP(s): Info req: type 2 > ACL data: handle 1 flags 0x02 dlen 16 L2CAP(s): Info rsp: type 2 result 0 Extended feature mask 0x01f8 Enhanced Retransmission mode Streaming mode FCS Option Extended Flow Specification Fixed Channels Extended Window Size ... < ACL data: handle 1 flags 0x00 dlen 45 L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 33 RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 0, MTo 0, MPS 498) EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff, AccLat 0xffffffff, FlushTO 0x0000ffff) ... Based upon haijun.liu <haijun.liu@atheros.com> series of patches (sent Sun, 22 Aug 2010) Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EFS: assign default values in chan addAndrei Emeltchenko2011-10-13
| | | | | | | Assign default EFS values when creating L2CAP channel Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EFS: definitions and headersAndrei Emeltchenko2011-10-13
| | | | | | | | | Define Extended Flow Specification structures and default values. Based upon haijun.liu <haijun.liu@atheros.com> series of patches (sent Sun, 22 Aug 2010) Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: define L2CAP header sizesAndrei Emeltchenko2011-10-13
| | | | | | | | Adds definitins for L2CAP header sizes to be uses when calculating payload size instead of magic numbers. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: recalculate L2CAP header sizeAndrei Emeltchenko2011-10-13
| | | | | | | Recalculate length of L2CAP header based on Control field length. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite handling POLL (P) bitAndrei Emeltchenko2011-10-13
| | | | | | | Handle POLL (P) bit in L2CAP ERTM using information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite handling FINAL (F) bitAndrei Emeltchenko2011-10-13
| | | | | | | Handle final (F) bit in L2CAP using information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite check frame type functionAndrei Emeltchenko2011-10-13
| | | | | | | Check frame function uses now information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite L2CAP ERTM txseq calculationAndrei Emeltchenko2011-10-13
| | | | | | | L2CAP ERTM txseq calculation uses now information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite reqseq calculationAndrei Emeltchenko2011-10-13
| | | | | | | reqseq calculation uses now information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite handling SAR bitsAndrei Emeltchenko2011-10-13
| | | | | | | | | Segmentation and Reassembly (SAR) occupies different windows in standard and extended control fields. Convert hardcoded masks to relative ones and use shift to access SAR bits. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: rewrite handling Supervisory (S) bitsAndrei Emeltchenko2011-10-13
| | | | | | | | | Supervisory bits occupy different windows in standard / extended control fields. Convert hardcoded masks to relative ones and use shift to access S-bit window. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: adds ext control field bit maskAndrei Emeltchenko2011-10-13
| | | | | | | | Adds extended control field bit masks and rearrange defines to logical groups: masks, flags and shift groups. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: EWS: extended window size option supportAndrei Emeltchenko2011-10-13
| | | | | | | | | | | | | | Adds support for extended window size (EWS) config option. We enable EWS feature in L2CAP Info RSP when hs enabled. EWS option is included in L2CAP Config Req if tx_win (which is set via socket) bigger then standard default value (63) && hs enabled && remote side supports EWS feature. Using EWS selects extended control field in L2CAP. Code partly based on Qualcomm and Atheros patches sent upstream a year ago. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix permission of enable_le paramGustavo F. Padovan2011-10-11
| | | | | | With 0444 it is impossible to change the param, changing it to 0644. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: clean up spaces in L2CAP headerAndrei Emeltchenko2011-10-11
| | | | | | | Spaces converted to tabs Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: convert role_switch variable to flag in l2cap chanAndrei Emeltchenko2011-10-11
| | | | | | | | role_switch variable inside l2cap_chan is a logical one and can be easily converted to flag Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: convert force_active variable to flag in l2cap chanAndrei Emeltchenko2011-10-11
| | | | | | | | force_active variable inside l2cap_chan is a logical one and can be easily converted to flag Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: convert force_reliable variable to flag in l2cap chanAndrei Emeltchenko2011-10-11
| | | | | | | | force_reliable variable inside l2cap_chan is a logical one and can be easily converted to flag Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: convert flushable variable to flag in l2cap chanAndrei Emeltchenko2011-10-11
| | | | | | | | flushable variable inside l2cap_chan is a logical one and can be easily converted to flag. Added flags in l2cap_chan structure. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: btusb: hide more usb_submit_urb errorsPaul Bolle2011-10-10
| | | | | | | | | | | There are still three calls of usb_submit_urb() that will print errors if those calls return -EPERM or -ENODEV. I have never triggered these, so I'm not sure when these return values might be seen. It still makes sense to be silent if these occur (since "urb is being killed" and "device got disconnected" aren't things to worry about). Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: btusb: also be quiet when suspendingPaul Bolle2011-10-10
| | | | | | | | | | | | | | | usb_submit_urb() returns -ENODEV when a usb device is disconnected. In commit 4935f1c164ac528dff3538f97953b385ba500710 ("Bluetooth: btusb: be quiet on device disconnect") I stopped treating that return as an error in the three btusb_*_complete() functions. It turns out btusb_send_frame() generates a similar error if the system is suspended while the bluetooth usb device is enabled. The sensible thing to do here seems to be to treat -ENODEV (and -EPERM) just like the btusb_*_complete() functions now do. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Rename hidp_find_connection()Gustavo F. Padovan2011-10-07
| | | | | | | hidp_get_connection() makes more sense because we hold a reference to the connection inside this function. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Delay session allocation in hidpGustavo F. Padovan2011-10-07
| | | | | | It gets allocated only when it is really needed. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: hidp: safely acquire hci connectionPeter Hurley2011-10-07
| | | | | | | | | | | | Claim device lock to safely enumerate hci connection list and bump hci connection proxy device ref count simultaneously. This patch incorporates David Herrmann's fix to prevent adding an HID device when the hci connection no longer exists. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Uses test_and_clear_bit() when possibleGustavo F. Padovan2011-10-06
| | | | Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>