summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of ↵John W. Linville2013-11-084-73/+72Star
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
| * Bluetooth: Remove sk member from struct l2cap_chanGustavo Padovan2013-10-211-2/+0Star
| | | | | | | | | | | | | | | | | | There is no access to chan->sk in L2CAP core now. This change marks the end of the task of splitting L2CAP between Core and Socket, thus sk is now gone from struct l2cap_chan. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add L2CAP channel to skb private dataGustavo Padovan2013-10-211-0/+1
| | | | | | | | | | | | | | | | Adding the channel to the skb private data makes possible to us know which channel the skb we have came from. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add support for setting DUT modeMarcel Holtmann2013-10-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The Device Under Test (DUT) mode is useful for doing certification testing and so expose this as debugfs option. This mode is actually special since you can only enter it. Restoring normal operation means that a HCI Reset is required. The current mode value gets tracked as a new device flag and when disabling it, the correct command to reset the controller is sent. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Expose debugfs settings for LE connection intervalMarcel Holtmann2013-10-191-0/+2
| | | | | | | | | | | | | | | | For testing purposes expose the default LE connection interval values via debugfs. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Add support for setting SSP debug modeMarcel Holtmann2013-10-192-0/+3
| | | | | | | | | | | | | | | | | | | | | | Enabling and disabling SSP debug mode is useful for development. This adds a debugfs entry that allows to configure the SSP debug mode. On purpose this has been implemented as debugfs entry and not a public API since it is really only useful during testing and development. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Remove interval parameter from HCI connectionMarcel Holtmann2013-10-191-1/+0Star
| | | | | | | | | | | | | | | | The conn->interval parameter of HCI connections is not used at all and so just remove it. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Select the own address type during initial setup phaseMarcel Holtmann2013-10-191-0/+1
| | | | | | | | | | | | | | | | | | The own address type is based on the fact if the controller has a public address or not. This means that this detail can be just configured once during setup phase. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Move device_add handling into hci_register_devMarcel Holtmann2013-10-181-2/+0Star
| | | | | | | | | | | | | | | | The device_add handling can be done directly in hci_register_dev and device_remove within hci_unregister_dev. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Add address type to device blacklist tableMarcel Holtmann2013-10-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The device blacklist is not taking care of the address type. Actually store the address type in the list entries and also use them when looking up addresses in the table. This is actually a serious bug. When adding a LE public address to the blacklist, then it would be blocking a device on BR/EDR. And this is not the expected behavior. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Convert idle timer to use delayed workJohan Hedberg2013-10-161-2/+2
| | | | | | | | | | | | | | | | There is no need to use a timer since the entire Bluetooth subsystem runs using workqueues these days. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Convert auto accept timer to use delayed workJohan Hedberg2013-10-161-1/+1
| | | | | | | | | | | | | | | | Since the entire Bluetooth subsystem runs in workqueues these days there is no need to use a timer for deferring work. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Remove enable_hs declarationMarcel Holtmann2013-10-161-2/+0Star
| | | | | | | | | | | | | | | | | | This seems to be a left-over. The module parameter enable_hs has been removed, but its extern declaration is still present. It is not needed anymore, so just remove it. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Remove duplicate definitions for advertising event typesMarcel Holtmann2013-10-161-10/+5Star
| | | | | | | | | | | | | | | | The constants for advertising event types have been defined twice. So remove one copy of it. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Set the scan response data when neededMarcel Holtmann2013-10-161-0/+6
| | | | | | | | | | | | | | | | On controller power on and when enabling LE functionality, make sure that also the scan response data is correctly set. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Store scan response data in HCI deviceMarcel Holtmann2013-10-161-0/+2
| | | | | | | | | | | | | | | | | | The scan response data needs to be stored in HCI device and so add a buffer for it and also ensure to clear it when resetting the controller. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Make mgmt_new_ltk() return voidMarcel Holtmann2013-10-161-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_new_ltk() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_read_local_oob_data_reply_complete() return voidMarcel Holtmann2013-10-161-2/+2
| | | | | | | | | | | | | | | | The return value of mgmt_read_local_oob_data_reply_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_set_local_name_complete() return voidMarcel Holtmann2013-10-161-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_set_local_name_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_set_class_of_dev_complete() return voidMarcel Holtmann2013-10-161-2/+2
| | | | | | | | | | | | | | | | The return value of mgmt_set_class_of_dev_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_ssp_enable_complete() return voidMarcel Holtmann2013-10-161-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_ssp_enable_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_auth_enable_complete() return voidMarcel Holtmann2013-10-161-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_auth_enable_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_auth_failed() return voidMarcel Holtmann2013-10-161-2/+2
| | | | | | | | | | | | | | | | The return value of mgmt_auth_failed() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_pin_code_neg_reply_complete() return voidMarcel Holtmann2013-10-161-2/+2
| | | | | | | | | | | | | | | | The return value of mgmt_pin_code_neg_reply_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_pin_code_reply_complete() return voidMarcel Holtmann2013-10-161-2/+2
| | | | | | | | | | | | | | | | The return value of mgmt_pin_code_reply_complete() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Make mgmt_pin_code_request() return voidMarcel Holtmann2013-10-161-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_pin_code_request() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Add l2cap_chan_no_resume stub for A2MPMarcel Holtmann2013-10-161-0/+4
| | | | | | | | | | | | | | | | The A2MP client for L2CAP channels needs to use l2cap_chan_no_resume empty stub function. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Move l2cap_wait_ack() to l2cap_sock.cGustavo Padovan2013-10-161-1/+0Star
| | | | | | | | | | | | | | | | | | The wait_ack code has a heavy dependency on the socket data structures and, as of now, it won't be worthless change it to use non-socket structures as the only user of such feature is a socket. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add chan->ops->set_shutdown()Gustavo Padovan2013-10-161-0/+5
| | | | | | | | | | | | | | | | | | We need to remove all direct access of struct sock from L2CAP core. This change is pretty simple and just add a new L2CAP channel callback to do the work in the L2CAP socket side. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Access sk_sndtimeo indirectly in l2cap_core.cGustavo Padovan2013-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the work to remove struct sock from l2cap_core.c and make it more generic we remove in this commit the direct access to sk->sk_sndtimeo member. This objective of this change is purely remove sk usage from l2cap_core.c Now we have a new l2cap ops to get the current value of sk->sndtimeo. A l2cap_chan_no_get_sndtimeo was added for users of L2CAP that doesn't need to set a timeout. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Extend state_change() call to report errors tooGustavo Padovan2013-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating an new function pointer to report errors we are just reusing state_change for that and there is a simple reason for this, one place in the l2cap_core.c code needs, in a locked sk, set both the sk_state and sk_err. If we create two different functions for this we would need to release the lock between the two operation putting the socket in non desired state. The change is transparent to the l2cap_core.c code, user that only needs to set the state won't need any modification. This is another step of an ongoing work to make l2cap_core.c totally independent from l2cap's struct sock. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Update class of device on discoverable timeoutMarcel Holtmann2013-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the discoverable timeout triggers and limited discoverable mode was used, then the class of device needs to be updated to remove the limited discoverable bit. To keep the class of device logic in a central place, expose a new function mgmt_discoverable_timeout that can be called from the timeout callback. In case the class of device value needs updating, it will add the HCI command to the transaction. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Move eir_get_length() function into hci_event.cMarcel Holtmann2013-10-151-17/+0Star
| | | | | | | | | | | | | | | | | | The eir_get_length() function is only used from hci_event.c and so instead of having a public function move it to the location where it is used. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Move eir_append_data() function into mgmt.cMarcel Holtmann2013-10-151-11/+0Star
| | | | | | | | | | | | | | | | | | The eir_append_data() function is only used from mgmt.c and so instead of having a public function move it to the location where it is used. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Make mgmt_new_link_key() return voidMarcel Holtmann2013-10-151-2/+2
| | | | | | | | | | | | | | | | The return value of mgmt_new_link_key() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Add HCI command structure for writing current IAC LAPMarcel Holtmann2013-10-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | This patch just adds the HCI command structure for configuring the current IAC LAP setting. The length of the command is variable and supports more than two IAC. However since there is only general discoverable and limited discoverable modes, this can be limited to two possible IACs. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Make mgmt_write_scan_failed() return voidMarcel Holtmann2013-10-151-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_write_scan_failed() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Make mgmt_connectable() return voidMarcel Holtmann2013-10-151-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_connectable() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Make mgmt_discoverable() return voidMarcel Holtmann2013-10-151-1/+1
| | | | | | | | | | | | | | | | The return value of mgmt_discoverable() function is not used and so just change it to return void. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Introduce flag for limited discoverable modeMarcel Holtmann2013-10-151-0/+1
| | | | | | | | | | | | | | | | | | Add a new flag that can be set when in limited discoverable mode. This flag will cause the limited discoverable bit in the class of device value to bet set. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Update advertising data based on management commandsMarcel Holtmann2013-10-151-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Magically updating the advertising data when some random command enables advertising in the controller is not really a good idea. It also caused a bit of complicated code with the exported hci_udpate_ad function that is shared from many places. This patch consolidates the advertising data update into the management core. It also makes sure that when powering on with LE enabled or later on enabling LE the controller has a good default for advertising data. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
* | Merge branch 'master' of ↵John W. Linville2013-11-0410-422/+89Star
|\| | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
| * Bluetooth: Read current IAC LAP on controller setupMarcel Holtmann2013-10-151-0/+2
| | | | | | | | | | | | | | | | | | Read the current IAC LAP values when initializing the controller. The values are not used, but it is good to have them in the trace files for debugging purposes. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Read number of supported IAC on controller setupMarcel Holtmann2013-10-152-0/+7
| | | | | | | | | | | | | | | | | | When initializing a controller make sure to read out the number of supported IAC and store its result. This value is needed to determine if limited discoverable for BR/EDR can be configured or not. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Introduce L2CAP channel callback for resumingMarcel Holtmann2013-10-141-0/+1
| | | | | | | | | | | | | | | | | | Clearing the BT_SK_SUSPEND socket flag from the L2CAP core is causing a dependency on the socket. So intead of doing that, use a channel callback into the socket handling to resume. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Introduce L2CAP channel flag for defer setupMarcel Holtmann2013-10-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The L2CAP core should not look into the socket flags to figure out the setting of defer setup. So introduce a L2CAP channel flag that mirrors the socket flag. Since the defer setup option is only set in one place this becomes a really easy thing to do. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Provide msg_name callback for L2CAP connectionless channelsMarcel Holtmann2013-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The L2CAP connectionless channels use SOCK_DGRAM and recvmsg() and need to receive the remote BD_ADDR and PSM information via msg_name from the recvmsg() system call. So in case the L2CAP socket is for connectionless channels, provide a msg_name callback that can update the data. Also store the remote BD_ADDR and PSM in the skb so it can be extracted later on. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Add support for per socket msg_name callbackMarcel Holtmann2013-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | This allows to add a per socket msg_name callback that can be used for updating the msg_name information for recvmsg() system calls. This feature is used by another patch to support address information on L2CAP connectionless channels. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Remove src and dst fields from bt_sock structureMarcel Holtmann2013-10-131-2/+0Star
| | | | | | | | | | | | | | | | | | Every socket protocol now stores its own address information. So just remove the generic src and dst fields since they are no longer needed. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Store RFCOMM address information in its own socket structureMarcel Holtmann2013-10-131-0/+2
| | | | | | | | | | | | | | | | | | The address information of RFCOMM sockets should be stored in its own socket structure. Trying to generalize them is not helpful since different transports have different address types. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>