aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-12-02Bluetooth: remove old codeAndrei Emeltchenko1-12/+0
Remove old code not touched for several years. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-02Bluetooth: Add dev_flags to struct hci_devAndre Guedes1-0/+1
This patch adds the dev_flags field to struct hci_dev. This new flags variable should be used to define flags related to BR/EDR and/or LE controller itself. It should be used to define flags which represents states from the controller. The dev_flags is cleared in case the controller sends a Reset Command Complete Event to the host. Also, this patch adds the HCI_LE_SCAN flag which was created to track if the controller is performing LE scan or not. The flag is set/cleared when the controller starts/stops scanning. This is an initial effort to stop using hdev->flags to define internal flags since it is exported to userspace by an ioctl. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-21Bluetooth: Use queue in the device listAndrei Emeltchenko1-1/+1
Use queue instead of stack discipline for device list. When processing dev_list with list_for_each* devices will be prosessed in order they were added (Usually BR/EDR first and AMP later). Also output from hciconfig looks nicer :-) Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-21Bluetooth: making enable_hs independent from L2CAPAndrei Emeltchenko1-0/+5
Fixes bluetooth compiling when CONFIG_BT_L2CAP is not enabled net/built-in.o: In function `hci_dev_open': (.text+0xdce9a): undefined reference to `enable_hs' Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-16Bluetooth: Fix some checkpatch.pl errors and warningsSzymon Janc1-4/+2
Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-16Bluetooth: Do not set HCI_RAW when HS enabledAndrei Emeltchenko1-2/+3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-09Bluetooth: Fix cancel_delayed_work_sync usage with locksJohan Hedberg1-3/+3
The cancel_delayed_work_sync function should not be used if we hold any locks. Luckily all places where this is the case it is also safe to use the non-sync version. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-09Bluetooth: Add missing hci_dev locking when calling mgmt functionsJohan Hedberg1-2/+10
Now that the pending commands are within struct hci_dev we can properly control access to them throught the hci_dev locking mechanism. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-09Bluetooth: Move pending management command list into struct hci_devJohan Hedberg1-0/+6
This patch moves the pending management command list (previously global to mgmt.c) into struct hci_dev. This makes it possible to do proper locking when accessing it (through the existing hci_dev locks) and thereby avoid race conditions. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-09Bluetooth: Pass full hci_dev struct to mgmt callbacksJohan Hedberg1-8/+8
The current global pending command list in mgmt.c is racy. Possibly the simplest way to fix it is to have per-hci dev lists instead of a global one (all commands that need a pending struct are hci_dev specific). This way the list can be protected using the already existing per-hci dev lock. To enable this refactoring the first thing that needs to be done is to ensure that the mgmt functions have access to the hci_dev struct (instead of just the dev id). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-08Bluetooth: Update link key mgmt APIs to match latest spec.Johan Hedberg1-2/+2
BR/EDR link keys have their own commands and events (separate from SMP) and the remove_keys command (previously remove_key) removes keys of any kind for the specified remote address. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-08Bluetooth: Convert power off mechanism to use delayed_workJohan Hedberg1-26/+13
The power off code doesn't need to use its own custom timer since the delayed_work API provides the exact same functionality. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-08Bluetooth: Add timeout field to mgmt_set_discoverableJohan Hedberg1-0/+25
Based on the revised mgmt API set_discoverable has a timeout parameter to specify how long the adapter will remain discoverable. A value of 0 means "indefinitively". Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-08Bluetooth: Create hci_cancel_inquiry()Andre Guedes1-0/+10
This patch adds a function to hci_core to cancel an ongoing inquiry. According to the Bluetooth spec, the inquiry cancel command should only be issued after the inquiry command has been issued, a command status event has been received for the inquiry command, and before the inquiry complete event occurs. As HCI_INQUIRY flag is only set just after an inquiry command status event occurs and it is cleared just after an inquiry complete event occurs, the inquiry cancel command should be issued only if HCI_INQUIRY flag is set. Additionally, cancel inquiry related code from stop_discovery() were replaced by a hci_cancel_inquiry() call. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-08Bluetooth: Create hci_do_inquiry()Andre Guedes1-0/+18
This patch adds a function to hci_core to carry out inquiry. All inquiry code from start_discovery() were replaced by a hci_do_inquiry() call. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-07Bluetooth: Guarantee BR-EDR device will be registered as hci0Mat Martineau1-1/+6
It's convenient to use the HCI device index the AMP controller id, but the spec requires that an AMP controller never has id 0. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-07Bluetooth: recalculate priorities when channels are starvingLuiz Augusto von Dentz1-1/+55
To avoid starvation the priority is recalculated so that the starving channels are promoted to HCI_PRIO_MAX - 1 (6). HCI_PRIO_MAX (7) is considered special, because it requires CAP_NET_ADMIN capability which can be used to provide more guaranties, so it is not used when promoting. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-07Bluetooth: handle priority change within quoteLuiz Augusto von Dentz1-2/+16
The quote is calculated based on the first buffer in the queue so if the priority changes to something lower than the priority of the first skb the quote needs to be recalculated. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-07Bluetooth: prioritizing data over HCILuiz Augusto von Dentz1-23/+120
This implement priority based scheduler using skbuffer priority set via SO_PRIORITY socket option. It introduces hci_chan_hash (list of HCI Channel/hci_chan) per connection, each item in this list refer to a L2CAP connection and it is used to queue the data for transmission. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-07Bluetooth: Increase HCI reset timeout in hci_dev_do_closeSzymon Janc1-1/+1
I've noticed that my CSR usb dongle was not working if it was plugged in when PC was booting. It looks like I get two HCI reset command complete events (see hcidump logs below). The root cause is reset called from off_timer. Timeout for this reset to complete is set to 250ms and my bt dongle requires more time for replying with command complete event. After that, chip seems to reply with reset command complete event for next non-reset command. Attached patch increase mentioned timeout to HCI_INIT_TIMEOUT, this value is already used for timeouting hci_reset_req in hci_dev_reset(). This might also be related to BT not working after suspend that was reported here some time ago. Hcidump log: 2011-09-12 23:13:27.379465 < HCI Command: Reset (0x03|0x0003) plen 0 2011-09-12 23:13:27.380797 > HCI Event: Command Complete (0x0e) plen 4 Reset (0x03|0x0003) ncmd 1 status 0x00 2011-09-12 23:13:27.380859 < HCI Command: Read Local Supported Features (0x04|0x000 3) plen 0 2011-09-12 23:13:27.760789 > HCI Event: Command Complete (0x0e) plen 4 Reset (0x03|0x0003) ncmd 1 status 0x00 2011-09-12 23:13:27.760831 < HCI Command: Read Local Version Information (0x04|0x00 01) plen 0 2011-09-12 23:13:27.764780 > HCI Event: Command Complete (0x0e) plen 12 Read Local Version Information (0x04|0x0001) ncmd 1 status 0x00 HCI Version: 1.1 (0x1) HCI Revision: 0x36f LMP Version: 1.1 (0x1) LMP Subversion: 0x36f Manufacturer: Cambridge Silicon Radio (10) Signed-off-by: Szymon Janc <szymon@janc.net.pl> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-11-07Bluetooth: replace list_for_each with list_for_each_entry whenever possibleLuiz Augusto von Dentz1-34/+12
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>
2011-11-07Bluetooth: Make hci_unregister_dev return voidDavid Herrmann1-3/+1
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>
2011-10-14Bluetooth: Forward errors from hci_register_devDavid Herrmann1-6/+12
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>
2011-10-14Bluetooth: Rename sysfs un/register to add/delDavid Herrmann1-2/+2
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>
2011-10-14Bluetooth: Fix hci core device initializationDavid Herrmann1-0/+1
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>
2011-09-21Bluetooth: Add mgmt events for blacklistingAntti Julku1-26/+8
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: Move SMP fields to a separate structureVinicius Costa Gomes1-8/+0
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: make use of connection number to optimize the schedulerLuiz Augusto von Dentz1-0/+15
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-08-11Bluetooth: Don't use cmd_timer to timeout HCI reset commandSzymon Janc1-2/+4
No command should be send before Command Complete event for HCI reset is received. This fix regression introduced by commit 6bd32326cda(Bluetooth: Use proper timer for hci command timout) for chips whose reset command takes longer to complete (e.g. CSR) resulting in next command being send before HCI reset completed. Signed-off-by: Szymon Janc <szymon@janc.net.pl> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11Bluetooth: unlock if allocation fails in hci_blacklist_add()Dan Carpenter1-1/+1
There was a small typo here so we never actually hit the goto which would call hci_dev_unlock_bh(). Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-07-15Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davemJohn W. Linville1-20/+81
Conflicts: net/bluetooth/l2cap_core.c
2011-07-08Bluetooth: Add support for storing the key sizeVinicius Costa Gomes1-1/+2
In some cases it will be useful having the key size used for encrypting the link. For example, some profiles may restrict some operations depending on the key length. The key size is stored in the key that is passed to userspace using the pin_length field in the key structure. For now this field is only valid for LE controllers. 3.0+HS controllers define the Read Encryption Key Size command, this field is intended for storing the value returned by that command. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-07-08Bluetooth: Add functions to manipulate the link key list for SMPVinicius Costa Gomes1-0/+73
As the LTK (the new type of key being handled now) has more data associated with it, we need to store this extra data and retrieve the keys based on that data. Methods for searching for a key and for adding a new LTK are introduced here. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-07-07Bluetooth: Fix potential deadlock in hci_coreAndre Guedes1-4/+4
Since hdev->lock may be acquired by threads runnning in interrupt context, all threads running in process context should disable local bottom halve before locking hdev->lock. This can be done by using hci_dev_lock_bh macro. This way, we avoid potencial deadlocks like this one reported by CONFIG_PROVE_LOCKING=y. [ 304.788780] ================================= [ 304.789686] [ INFO: inconsistent lock state ] [ 304.789686] 2.6.39+ #1 [ 304.789686] --------------------------------- [ 304.789686] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. [ 304.789686] ksoftirqd/0/3 [HC0[0]:SC1[1]:HE1:SE0] takes: [ 304.789686] (&(&hdev->lock)->rlock){+.?...}, at: [<ffffffffa000bbfe>] hci_conn_check_pending+0x38/0x76 [bluetooth] [ 304.789686] {SOFTIRQ-ON-W} state was registered at: [ 304.789686] [<ffffffff8105188b>] __lock_acquire+0x347/0xd52 [ 304.789686] [<ffffffff810526ac>] lock_acquire+0x8a/0xa7 [ 304.789686] [<ffffffff812b3758>] _raw_spin_lock+0x2c/0x3b [ 304.789686] [<ffffffffa0009cf0>] hci_blacklist_del+0x1f/0x8a [bluetooth] [ 304.789686] [<ffffffffa00139fd>] hci_sock_ioctl+0x2d9/0x314 [bluetooth] [ 304.789686] [<ffffffff812197d8>] sock_ioctl+0x1f2/0x214 [ 304.789686] [<ffffffff810b0fd6>] do_vfs_ioctl+0x46c/0x4ad [ 304.789686] [<ffffffff810b1059>] sys_ioctl+0x42/0x65 [ 304.789686] [<ffffffff812b4892>] system_call_fastpath+0x16/0x1b [ 304.789686] irq event stamp: 9768 [ 304.789686] hardirqs last enabled at (9768): [<ffffffff812b40d4>] restore_args+0x0/0x30 [ 304.789686] hardirqs last disabled at (9767): [<ffffffff812b3f6a>] save_args+0x6a/0x70 [ 304.789686] softirqs last enabled at (9726): [<ffffffff8102fa9b>] __do_softirq+0x129/0x13f [ 304.789686] softirqs last disabled at (9739): [<ffffffff8102fb33>] run_ksoftirqd+0x82/0x133 [ 304.789686] [ 304.789686] other info that might help us debug this: [ 304.789686] Possible unsafe locking scenario: [ 304.789686] [ 304.789686] CPU0 [ 304.789686] ---- [ 304.789686] lock(&(&hdev->lock)->rlock); [ 304.789686] <Interrupt> [ 304.789686] lock(&(&hdev->lock)->rlock); [ 304.789686] [ 304.789686] *** DEADLOCK *** [ 304.789686] [ 304.789686] 1 lock held by ksoftirqd/0/3: [ 304.789686] #0: (hci_task_lock){++.-..}, at: [<ffffffffa0008353>] hci_rx_task+0x49/0x2f3 [bluetooth] [ 304.789686] [ 304.789686] stack backtrace: [ 304.789686] Pid: 3, comm: ksoftirqd/0 Not tainted 2.6.39+ #1 [ 304.789686] Call Trace: [ 304.789686] [<ffffffff812ae901>] print_usage_bug+0x1e7/0x1f8 [ 304.789686] [<ffffffff8100a796>] ? save_stack_trace+0x27/0x44 [ 304.789686] [<ffffffff8104fc3f>] ? print_irq_inversion_bug.part.26+0x19a/0x19a [ 304.789686] [<ffffffff810504bb>] mark_lock+0x106/0x258 [ 304.789686] [<ffffffff812b40d4>] ? retint_restore_args+0x13/0x13 [ 304.789686] [<ffffffff81051817>] __lock_acquire+0x2d3/0xd52 [ 304.789686] [<ffffffff8102be73>] ? vprintk+0x3ab/0x3d7 [ 304.789686] [<ffffffff812ae126>] ? printk+0x3c/0x3e [ 304.789686] [<ffffffff810526ac>] lock_acquire+0x8a/0xa7 [ 304.789686] [<ffffffffa000bbfe>] ? hci_conn_check_pending+0x38/0x76 [bluetooth] [ 304.789686] [<ffffffff811601c6>] ? __dynamic_pr_debug+0x10c/0x11a [ 304.789686] [<ffffffff812b3758>] _raw_spin_lock+0x2c/0x3b [ 304.789686] [<ffffffffa000bbfe>] ? hci_conn_check_pending+0x38/0x76 [bluetooth] [ 304.789686] [<ffffffffa000bbfe>] hci_conn_check_pending+0x38/0x76 [bluetooth] [ 304.789686] [<ffffffffa000c561>] hci_event_packet+0x38e/0x3e12 [bluetooth] [ 304.789686] [<ffffffff81052615>] ? lock_release+0x16c/0x179 [ 304.789686] [<ffffffff812b3b41>] ? _raw_read_unlock+0x23/0x27 [ 304.789686] [<ffffffffa0013e7f>] ? hci_send_to_sock+0x179/0x188 [bluetooth] [ 304.789686] [<ffffffffa00083d2>] hci_rx_task+0xc8/0x2f3 [bluetooth] [ 304.789686] [<ffffffff8102f5a9>] tasklet_action+0x87/0xe6 [ 304.789686] [<ffffffff8102fa11>] __do_softirq+0x9f/0x13f [ 304.789686] [<ffffffff8102fb33>] run_ksoftirqd+0x82/0x133 [ 304.789686] [<ffffffff8102fab1>] ? __do_softirq+0x13f/0x13f [ 304.789686] [<ffffffff81040f0a>] kthread+0x7f/0x87 [ 304.789686] [<ffffffff812b55c4>] kernel_thread_helper+0x4/0x10 [ 304.789686] [<ffffffff812b40d4>] ? retint_restore_args+0x13/0x13 [ 304.789686] [<ffffffff81040e8b>] ? __init_kthread_worker+0x53/0x53 [ 304.789686] [<ffffffff812b55c0>] ? gs_change+0x13/0x13 Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-07-06Bluetooth: Remove enable_smp parameterAndre Guedes1-14/+1
The enable_smp parameter is no longer needed. It can be replaced by checking lmp_host_le_capable. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-07-06Bluetooth: Add lmp_host_le_capable() macroAndre Guedes1-1/+1
Since we have the extended LMP features properly implemented, we should check the LMP_HOST_LE bit to know if the host supports LE. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-30Bluetooth: Rename function bt_err to bt_to_errnoJoe Perches1-1/+1
Make it easier to use more normal logging styles later. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-24Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davemJohn W. Linville1-2/+193
Conflicts: drivers/net/wireless/rtlwifi/pci.c include/linux/netlink.h
2011-06-17Bluetooth: Fix locking in blacklist codeGustavo F. Padovan1-13/+25
There was no unlock call on the errors path Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-16Bluetooth: Move blacklisting functions to hci_coreAntti Julku1-0/+79
Move blacklisting functions to hci_core.c, so that they can be used by both management interface and hci socket interface. Signed-off-by: Antti Julku <antti.julku@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-13Bluetooth: Add support for using the crypto subsystemVinicius Costa Gomes1-0/+22
This will allow using the crypto subsystem for encrypting data. As SMP (Security Manager Protocol) is implemented almost entirely on the host side and the crypto module already implements the needed methods (AES-128), it makes sense to use it. There's now a new module option to enable/disable SMP support. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-08Bluetooth: Add BT_POWER L2CAP socket option.Jaikumar Ganesh1-2/+2
Add BT_POWER socket option used to control the power characteristics of the underlying ACL link. When the remote end has put the link in sniff mode and the host stack wants to send data we need need to explicitly exit sniff mode to work well with certain devices (For example, A2DP on Plantronics Voyager 855). However, this causes problems with HID devices. Hence, moving into active mode when sending data, irrespective of who set the sniff mode has been made as a socket option. By default, we will move into active mode. HID devices can set the L2CAP socket option to prevent this from happening. Currently, this has been implemented for L2CAP sockets. This has been tested with incoming and outgoing L2CAP sockets for HID and A2DP. Based on discussions on linux-bluetooth and patches submitted by Andrei Emeltchenko. Signed-off-by: Jaikumar Ganesh <jaikumar@google.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-08Bluetooth: Advertising entries lifetimeAndre Guedes1-0/+14
This patch adds a timer to clear 'adv_entries' after three minutes. After some amount of time, the advertising entries cached during the last LE scan should be considered expired and they should be removed from the advertising cache. It was chosen a three minutes timeout as an initial attempt. This value might change in future. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-08Bluetooth: LE advertising cacheAndre Guedes1-0/+64
This patch implements the LE advertising cache. It stores sensitive information (bdaddr and bdaddr_type so far) gathered from LE advertising report events. Only advertising entries from connectables devices are added to the cache. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-06-05net: Remove unnecessary semicolonsJoe Perches1-2/+2
Semicolons are not necessary after switch/while/for/if braces so remove them. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-05-05Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davemJohn W. Linville1-9/+66
Conflicts: drivers/net/wireless/libertas/if_cs.c drivers/net/wireless/rtlwifi/pci.c net/bluetooth/l2cap_sock.c
2011-04-29Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next-2.6John W. Linville1-9/+66
2011-04-28Bluetooth: Add store_hint parameter to mgmt_new_keyJohan Hedberg1-9/+12
Even for keys that shouldn't be stored some use cases require the knowledge of a new key having been created so that the conclusion of a successful pairing can be made. Therefore, always send the mgmt_new_key event but add a store_hint parameter to it to indicate to user space whether the key should be stored or not. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-28Bluetooth: Remove old_key_type from mgmt_ev_new_keyJohan Hedberg1-4/+5
User space shouldn't have any need for the old key type so remove it from the corresponding Management interface event. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-28Bluetooth: Fix connection key type updating for buggy controllersJohan Hedberg1-1/+4
If a controller generates a changed combination key as its first key the connection key type will not be correctly set. In these situations make sure the update the connection key type when such a buggy controller is detected. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>