summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bluetooth: btusb: hide more usb_submit_urb errorsPaul Bolle2011-10-101-3/+6
| | | | | | | | | | | 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-101-1/+3
| | | | | | | | | | | | | | | 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-071-2/+2
| | | | | | | 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-071-6/+8
| | | | | | 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-071-14/+20
| | | | | | | | | | | | 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-061-6/+3
| | | | Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Remove wrong error checkGustavo F. Padovan2011-10-061-1/+1
| | | | | | d458a9dfc add this check, but now it proves to be wrong. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix input device registrationGustavo F. Padovan2011-10-061-9/+6
| | | | | | | This is a regression fix. It made impossible use input device when hid fails. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Trasmit interrupt channel messages firstGustavo F. Padovan2011-10-061-8/+17
| | | | | | interrupt channel is low latency. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: prioritize the interrupt channel in hidpGustavo F. Padovan2011-10-061-4/+4
| | | | | | Interrupt channel has low latency requiments, should be processed first. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: use list_for_each_entry() in hidpGustavo F. Padovan2011-10-061-8/+3
| | | | | | list_for_each_entry is much more meaningful. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: hidp: Stop I/O on shutdownDavid Herrmann2011-10-061-14/+20
| | | | | | | | | | | | | | | | | | | | | 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>
* Bluetooth: EFS: add enable_hs kernel paramAndrei Emeltchenko2011-10-061-0/+7
| | | | | | | 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>
* Bluetooth: EFS: l2cap extended feature mask updateAndrei Emeltchenko2011-10-061-1/+5
| | | | | | | 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>
* btusb: add device entry for Broadcom SoftSailingOliver Neukum2011-09-291-0/+3
| | | | | | | | | | | | | | 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>
* Bluetooth: hci_le_adv_report_evt code refactoringAndre Guedes2011-09-291-8/+6
| | | | | | | | | 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>
* Bluetooth: Fix possible NULL pointer dereferenceWaldemar Rymarkiewicz2011-09-291-1/+5
| | | | | | | | | | 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>
* Bluetooth: Mark not declared l2cap_core functions as staticSzymon Janc2011-09-271-6/+6
| | | | | Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: use recommended LE connection parametersAnderson Lizardo2011-09-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Bluetooth: Perform L2CAP SDU reassembly without copying dataMat Martineau2011-09-272-165/+81
| | | | | | | | | | | 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>
* Bluetooth: Handle fragmented skbs in bt_sock_stream_recvmsg()Mat Martineau2011-09-271-2/+28
| | | | | | | | | | | | 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>
* Bluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMMMat Martineau2011-09-274-5/+20
| | | | | | | | | 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>
* Bluetooth: Allow ACL packets over USB in HCI_RAW modePeter Hurley2011-09-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Bluetooth: mark l2cap_create_iframe_pdu as staticLuiz Augusto von Dentz2011-09-211-1/+3
| | | | | | | 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>
* Bluetooth: Check 'dev_class' in mgmt_device_found()Andre Guedes2011-09-211-1/+3
| | | | | | | | | | 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>
* Bluetooth: Reduce critical region.Andre Guedes2011-09-211-4/+3
| | | | | | | | | 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>
* Bluetooth: Fix wrong memcpy size on LE start encryptionAnderson Briglia2011-09-211-1/+1
| | | | | | | | | | | | | 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>
* Bluetooth: Remove support for other SMP keys than the LTKVinicius Costa Gomes2011-09-211-1/+1
| | | | | | | | | 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>
* Bluetooth: Fix not setting a pending security levelVinicius Costa Gomes2011-09-211-0/+2
| | | | | | | | 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>
* Revert "Bluetooth: Add support for communicating keys with userspace"Vinicius Costa Gomes2011-09-211-45/+15
| | | | | | | | | | | | | | 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>
* Bluetooth: Use the LTK after receiving a LE Security RequestVinicius Costa Gomes2011-09-211-18/+28
| | | | | | | | | 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>
* Bluetooth: Fix sending wrong authentication requirementsVinicius Costa Gomes2011-09-211-17/+2
| | | | | | | | 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>
* Bluetooth: Add mgmt events for blacklistingAntti Julku2011-09-215-34/+92
| | | | | | | | | | | | | | | | | | | | 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>
* Bluetooth: Use the MEDIUM security level for pairingsVinicius Costa Gomes2011-09-211-5/+3
| | | | | | | | 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>
* Bluetooth: Require authentication if MITM protection is requestedVinicius Costa Gomes2011-09-211-2/+3
| | | | | | | | | | | | 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>
* Bluetooth: Move SMP crypto functions to a workqueueVinicius Costa Gomes2011-09-213-103/+185
| | | | | | | | | 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>
* Bluetooth: Move SMP fields to a separate structureVinicius Costa Gomes2011-09-215-71/+65
| | | | | | | | | 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>
* Bluetooth: hidp: Add support for NO_INIT_REPORTS quirkDavid Herrmann2011-09-211-0/+3
| | | | | | | | | 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>
* Bluetooth: Add LE link type for debugfs outputPeter Hurley2011-09-211-0/+2
| | | | | | | | 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>
* Bluetooth: Add mgmt command for fast connectable modeAntti Julku2011-09-213-0/+75
| | | | | | | | 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>
* Bluetooth: Add link_type information to the mgmt Connected eventVinicius Costa Gomes2011-09-214-4/+6
| | | | | | | | | | 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>
* Bluetooth: Add support for running SMP without a socketVinicius Costa Gomes2011-09-211-2/+8
| | | | | | | | | 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>
* Bluetooth: Add support for pairing via mgmt over LEVinicius Costa Gomes2011-09-211-2/+13
| | | | | | | | | 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>
* Bluetooth: Use the same timeouts for both ACL and LE linksVinicius Costa Gomes2011-09-211-1/+1
| | | | | Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Add a flag to indicate that SMP is going onVinicius Costa Gomes2011-09-213-11/+38
| | | | | | | | | | | | | | | 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>
* Bluetooth: Reset the security timer when a command is queuedVinicius Costa Gomes2011-09-211-12/+3
| | | | | | | | | | | 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>
* Bluetooth: make use of connection number to optimize the schedulerLuiz Augusto von Dentz2011-09-212-0/+31
| | | | | | | | | 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>
* rtlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.Larry Finger2011-09-206-20/+8
| | | | | | | | | | 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>
* rtlwifi: rtl8192de: Change modinfo messagesLarry Finger2011-09-201-4/+8
| | | | | | | 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>
* rtlwifi: rtl8192se: Change modinfo messagesLarry Finger2011-09-201-5/+9
| | | | | | | 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>
OpenPOWER on IntegriCloud