aboutsummaryrefslogtreecommitdiff
path: root/include/net/bluetooth
AgeCommit message (Collapse)AuthorFilesLines
2013-10-19Bluetooth: Add support for setting DUT modeMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-19Bluetooth: Expose debugfs settings for LE connection intervalMarcel Holtmann1-0/+2
For testing purposes expose the default LE connection interval values via debugfs. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-19Bluetooth: Add support for setting SSP debug modeMarcel Holtmann2-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-19Bluetooth: Remove interval parameter from HCI connectionMarcel Holtmann1-1/+0
The conn->interval parameter of HCI connections is not used at all and so just remove it. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-19Bluetooth: Select the own address type during initial setup phaseMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-18Bluetooth: Move device_add handling into hci_register_devMarcel Holtmann1-2/+0
The device_add handling can be done directly in hci_register_dev and device_remove within hci_unregister_dev. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-18Bluetooth: Add address type to device blacklist tableMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-16Bluetooth: Convert idle timer to use delayed workJohan Hedberg1-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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2013-10-16Bluetooth: Convert auto accept timer to use delayed workJohan Hedberg1-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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2013-10-16Bluetooth: Remove enable_hs declarationMarcel Holtmann1-2/+0
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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-16Bluetooth: Remove duplicate definitions for advertising event typesMarcel Holtmann1-10/+5
The constants for advertising event types have been defined twice. So remove one copy of it. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-16Bluetooth: Set the scan response data when neededMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-16Bluetooth: Store scan response data in HCI deviceMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Make mgmt_new_ltk() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_read_local_oob_data_reply_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_set_local_name_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_set_class_of_dev_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_ssp_enable_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_auth_enable_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_auth_failed() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_pin_code_neg_reply_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_pin_code_reply_complete() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Make mgmt_pin_code_request() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Add l2cap_chan_no_resume stub for A2MPMarcel Holtmann1-0/+4
The A2MP client for L2CAP channels needs to use l2cap_chan_no_resume empty stub function. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-15Bluetooth: Move l2cap_wait_ack() to l2cap_sock.cGustavo Padovan1-1/+0
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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2013-10-15Bluetooth: Add chan->ops->set_shutdown()Gustavo Padovan1-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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2013-10-15Bluetooth: Access sk_sndtimeo indirectly in l2cap_core.cGustavo Padovan1-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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2013-10-15Bluetooth: Extend state_change() call to report errors tooGustavo Padovan1-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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2013-10-15Bluetooth: Update class of device on discoverable timeoutMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Move eir_get_length() function into hci_event.cMarcel Holtmann1-17/+0
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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Move eir_append_data() function into mgmt.cMarcel Holtmann1-11/+0
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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Make mgmt_new_link_key() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Add HCI command structure for writing current IAC LAPMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Make mgmt_write_scan_failed() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Make mgmt_connectable() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Make mgmt_discoverable() return voidMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Introduce flag for limited discoverable modeMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-15Bluetooth: Update advertising data based on management commandsMarcel Holtmann1-2/+0
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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-14Bluetooth: Read current IAC LAP on controller setupMarcel Holtmann1-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-14Bluetooth: Read number of supported IAC on controller setupMarcel Holtmann2-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 <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2013-10-14treewide: Fix common typo in "identify"Maxime Jayat1-1/+1
Correct common misspelling of "identify" as "indentify" throughout the kernel Signed-off-by: Maxime Jayat <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2013-10-14Bluetooth: Introduce L2CAP channel callback for resumingMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-14Bluetooth: Introduce L2CAP channel flag for defer setupMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Provide msg_name callback for L2CAP connectionless channelsMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Add support for per socket msg_name callbackMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Remove src and dst fields from bt_sock structureMarcel Holtmann1-2/+0
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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Store RFCOMM address information in its own socket structureMarcel Holtmann1-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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Store SCO address information in its own socket structureMarcel Holtmann1-0/+2
The address information of SCO 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 <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Use SCO addresses from HCI connection directlyMarcel Holtmann1-3/+0
Instead of storing a pointer to the addresses for the HCI device and HCI connection, use them directly. With the recent changes to address tracking of HCI connections, this becomes simple. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2013-10-13Bluetooth: Return the correct address type for L2CAP socketsMarcel Holtmann1-2/+3
The L2CAP sockets can use BR/EDR public, LE public and LE random addresses for various combinations of source and destination devices. So make sure that getsockname(), getpeername() and accept() return the correct address type. For this the address type of the source and destination is stored with the L2CAP channel information. The stored address type is not the one specific for the HCI protocol. It is the address type used for the L2CAP sockets and the management interface. The underlying HCI connections store the HCI address type. If needed, it gets converted to the socket address type. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>