summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-10-10Bluetooth: btusb: also be quiet when suspendingPaul Bolle
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>
2011-10-07Bluetooth: Rename hidp_find_connection()Gustavo F. Padovan
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>
2011-10-07Bluetooth: Delay session allocation in hidpGustavo F. Padovan
It gets allocated only when it is really needed. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-07Bluetooth: hidp: safely acquire hci connectionPeter Hurley
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>
2011-10-06Bluetooth: Uses test_and_clear_bit() when possibleGustavo F. Padovan
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: Remove wrong error checkGustavo F. Padovan
d458a9dfc add this check, but now it proves to be wrong. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: Fix input device registrationGustavo F. Padovan
This is a regression fix. It made impossible use input device when hid fails. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: Trasmit interrupt channel messages firstGustavo F. Padovan
interrupt channel is low latency. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: prioritize the interrupt channel in hidpGustavo F. Padovan
Interrupt channel has low latency requiments, should be processed first. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: use list_for_each_entry() in hidpGustavo F. Padovan
list_for_each_entry is much more meaningful. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: hidp: Stop I/O on shutdownDavid Herrmann
Current hidp driver purges the in/out queue on HID shutdown, but does not prevent further I/O. If a driver uses hidp_output_raw_report or hidp_get_raw_report during shutdown, the driver hangs for 5 or 10 seconds per call until it gets a timeout. That is, if the output queue of an HID driver has 10 messages pending, it will take 50s until hid_destroy_device() will return. The hidp_session_sem semaphore is held during shutdown so no other HID device may be added/removed during this time. This patch makes hidp_output_raw_report and hidp_get_raw_report fail if session->terminate is true. Also hidp_session will wakeup all current calls to these functions to cancel the current operations. We already purge the current I/O queues on hidp_stop(), so this data loss does not change the behaviour of the HID drivers. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: EFS: add enable_hs kernel paramAndrei Emeltchenko
Add enable_hs kernel parameter. L2CAP_FEAT_EXT_FLOW depends on it. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-10-06Bluetooth: EFS: l2cap extended feature mask updateAndrei Emeltchenko
Update L2CAP extended feature mask to reflect recent BT spec. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-29btusb: add device entry for Broadcom SoftSailingOliver Neukum
From 0cea73465cd22373c5cd43a3edd25fbd4bb532ef Mon Sep 17 00:00:00 2001 From: Oliver Neukum <oliver@neukum.org> Date: Wed, 21 Sep 2011 11:37:15 +0200 Subject: [PATCH] btusb: add device entry for Broadcom SoftSailing This device declares itself to be vendor specific It therefore needs to be added to the device table to make btusb bind. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-29Bluetooth: hci_le_adv_report_evt code refactoringAndre Guedes
There is no reason to treat the first advertising entry differently from the potential other ones. Besides, the current implementation can easily leads to typos. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-29Bluetooth: Fix possible NULL pointer dereferenceWaldemar Rymarkiewicz
Checking conn->pending_sec_level if there is no connection leads to potential null pointer dereference. Don't process pin_code_request_event at all if no connection exists. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-27Bluetooth: Mark not declared l2cap_core functions as staticSzymon Janc
Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-27Bluetooth: use recommended LE connection parametersAnderson Lizardo
The new connection parameters now match the recommended values for Proximity and Health Thermometer profiles. The previous values were ramdomly chosen, and are either too low or too high for most cases. New values: Scan Interval: 60 ms Scan Window: 30 ms Minimum Connection Interval: 50 ms Maximum Connection Interval: 70 ms Supervision Timeout: 420 ms See "Table 5.2: Recommended Scan Interval and Scan Window Values" and "Table 5.3: Recommended Connection Interval Values" for both profiles for details. Note that the "fast connection" parameters were chosen, because we do not support yet dynamically changing these parameters from initiator side. Additionally, the Proximity profile recommends (section "4.4 Alert on Link Loss"): "It is recommended that the Link Supervision Timeout (LSTO) is set to 6x the connection interval." Minimum_CE_Length and Maximum_CE_Length were also changed from 0x0001 to 0x0000 because they are informational and optional, and old value was not reflecting reality. Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-27Bluetooth: Perform L2CAP SDU reassembly without copying dataMat Martineau
Use sk_buff fragment capabilities to link together incoming skbs instead of allocating a new skb for reassembly and copying. The new reassembly code works equally well for ERTM and streaming mode, so there is now one reassembly function instead of two. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-27Bluetooth: Handle fragmented skbs in bt_sock_stream_recvmsg()Mat Martineau
ERTM reassembly will be more efficient when skbs are linked together rather than copying every incoming data byte. The existing stream recv function assumes skbs are linear, so it needs to know how to handle fragments before reassembly is changed. bt_sock_recvmsg() already handles fragmented skbs. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-27Bluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMMMat Martineau
Fragmented skbs are only encountered when receiving ERTM or streaming mode L2CAP data. BNEP, CMTP, HIDP, and RFCOMM generally use basic mode, but they need to handle fragments without crashing. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-27Bluetooth: Allow ACL packets over USB in HCI_RAW modePeter Hurley
Removed tests which prevent transmission of ACL packets when the device is in HCI_RAW mode. These tests verified that there are ACL or LE links currently tracked by the HCI connection manager. However, a HCI_RAW mode device does not use the connection manager. In these circumstances, the connection counts will be zero, and thus, transmitted ACL packets dropped. The acl_num test is actually a vestige of a previous bulk URB scheme that is no longer used by this driver (bulk URBs were not started until at least one ACL connection was created). This was incompatible with some endpoint implementations and was dropped - see commit 43c2e57f94. The utility of these tests is marginal - currently, the hci tx scheduler cannot send an ACL or LE packet for an untracked connection (except if the device is in HCI_RAW mode). Lastly, no other transport layer driver enforces these same tests. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: mark l2cap_create_iframe_pdu as staticLuiz Augusto von Dentz
l2cap_create_iframe_pdu is only used in l2cap_core.c Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Check 'dev_class' in mgmt_device_found()Andre Guedes
The mgmt_device_found event will be used to report LE devices found during discovery procedure. Since LE advertising reports events doesn't have class of device information, we need to check if 'dev_class' is not NULL before copying it. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Reduce critical region.Andre Guedes
This patch reduces the critial region (protected by hdev->lock) in hci_cc_le_set_scan_enable(). This way, only really required code is synchronized. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Fix wrong memcpy size on LE start encryptionAnderson Briglia
This patch fixes wrong memcpy size when copying rand value to HCI_OP_LE_START_ENC command. The compiler pretends that the array parameter was declared as a pointer and sizeof reports the size of the pointer. [1] [1] http://www.c-faq.com/aryptr/aryparmsize.html Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Remove support for other SMP keys than the LTKVinicius Costa Gomes
For now, only the LTK is properly supported. We are able to receive and generate the other types of keys, but we are not able to use them. So it's better not request them to be distributed. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Fix not setting a pending security levelVinicius Costa Gomes
For slave initiated security, we should set a default security level, for now BT_SECURITY_MEDIUM. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Revert "Bluetooth: Add support for communicating keys with userspace"Vinicius Costa Gomes
This reverts commit 5a0a8b49746771fba79866fb9185ffa051a6a183. If we use separate messages and list for SMP specific keys we can simplify the code. Conflicts: net/bluetooth/mgmt.c Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Use the LTK after receiving a LE Security RequestVinicius Costa Gomes
When receiving a security request from the remote device we should find if there is already a LTK associated with the remote device, if found we should use it to encrypt the link. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Fix sending wrong authentication requirementsVinicius Costa Gomes
Until we support any pairing method (Passkey Entry, OOB) that gives MITM protection we shouldn't send that we have MITM protection. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add mgmt events for blacklistingAntti Julku
Add management interface events for blocking/unblocking a device. Sender of the block device command gets cmd complete and other mgmt sockets get the event. Event is also sent to mgmt sockets when blocking is done with ioctl, e.g when blocking a device with hciconfig. This makes it possible for bluetoothd to track status of blocked devices when a third party block or unblocks a device. Event sending is handled in mgmt_device_blocked function which gets called from hci_blacklist_add in hci_core.c. A pending command is added in mgmt_block_device, so that it can found when sending the event - the event is not sent to the socket from which the pending command came. Locks were moved out from hci_core.c to hci_sock.c and mgmt.c, because locking is needed also for mgmt_pending_add in mgmt.c. Signed-off-by: Antti Julku <antti.julku@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Use the MEDIUM security level for pairingsVinicius Costa Gomes
This lifts the requirement of 16 digits pin codes when pairing with devices that do not support SSP when using the mgmt interface. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Require authentication if MITM protection is requestedVinicius Costa Gomes
The HIGH security level requires a 16 digit pin code for non-SSP bondings. Sometimes this requirement is not acceptable and we still want protection againts MITM attacks (which is something that the MEDIUM security level doesn't provide), for that we should allow another way to request authentication without using the HIGH security level. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Move SMP crypto functions to a workqueueVinicius Costa Gomes
The function crypto_blkcipher_setkey() called by smp_e() can sleep, so all the crypto work has to be moved to hci_dev workqueue. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Move SMP fields to a separate structureVinicius Costa Gomes
The objective is to make the core to have as little as possible information about SMP procedures and logic. Now, all the SMP specific information is hidden from the core. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: hidp: Add support for NO_INIT_REPORTS quirkDavid Herrmann
During setup the host initializes all HID reports. Some devices do not support this. If this quirk is set, we skip the initialization. See also usbhid_init_reports() for this quirk. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add LE link type for debugfs outputPeter Hurley
Add LE link type as known connection type for debugfs stringizing output. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add mgmt command for fast connectable modeAntti Julku
Add command to management interface for enabling/disabling the fast connectable mode. Signed-off-by: Antti Julku <antti.julku@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add link_type information to the mgmt Connected eventVinicius Costa Gomes
One piece of information that was lost when using the mgmt interface, was the type of the connection. Using HCI events we used to know the type of the connection based on the type of the event, e.g. HCI_LE_Connection_Complete for LE links. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add support for running SMP without a socketVinicius Costa Gomes
When doing the pairing procedure we won't have an associated socket, but we still have to do the SMP negotiation. This adds support for encrypting the link and exchanging keys. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add support for pairing via mgmt over LEVinicius Costa Gomes
Using the advertising cache we are able to infer the type of the remote device, and so trigger pairing over the correct link type. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Use the same timeouts for both ACL and LE linksVinicius Costa Gomes
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Add a flag to indicate that SMP is going onVinicius Costa Gomes
Add HCI_CONN_LE_SMP_PEND flag to indicate that SMP is pending for that connection. This allows to have information that an SMP procedure is going on for that connection. We use the HCI_CONN_ENCRYPT_PEND to indicate that encryption (HCI_LE_Start_Encryption) is pending for that connection. While a SMP procedure is going on we hold an reference to the connection, to avoid disconnections. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: Reset the security timer when a command is queuedVinicius Costa Gomes
Each time a SMP command is enqueued, we reset the SMP timer, this way we follow exactly what the spec mandates: "The Security Manager Timer shall be reset when an L2CAP SMP command is queued for transmission." Vol. 3, Part H, Section 3.4 Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-21Bluetooth: make use of connection number to optimize the schedulerLuiz Augusto von Dentz
This checks if there is any existing connection according to its type before start iterating in the list and immediately stop iterating when reaching the number of connections. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-09-20rtlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.Larry Finger
Three drivers, rtl8192ce, rtl8192cu and rtl8192de, use the same macro to check if a particular rate is in the CCK set. This common code is relocated to a common header file. A distinct macro used by rtl8192se with the same name is renamed. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-20rtlwifi: rtl8192de: Change modinfo messagesLarry Finger
The various modparam messages are difficult to understand. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-20rtlwifi: rtl8192se: Change modinfo messagesLarry Finger
The various modparam messages are difficult to understand. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-20rtlwifi: rtl8192ce: Change modinfo messagesLarry Finger
The various modparam messages are difficult to understand. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>