aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-04-18Bluetooth: Fix keeping the command timer runningVinicius Costa Gomes1-3/+2
In the teardown path the reset command is sent to the controller, this event causes the command timer to be reactivated. So the timer is removed in two situations, when the adapter isn't marked as UP and when we know that some command has been sent. Reported-by: Keith Packard <keithp@keithp.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-18Bluetooth: Fix refcount balance for hci connectionVille Tervo1-2/+0
hci_io_capa_reply_evt() holds reference for hciconnection. It's useless since hci_io_capa_request_evt()/hci_simple_pair_complete_evt() already protects the connection. In addition it leaves connection open after failed SSP pairing. Signed-off-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-14Bluetooth: Fix lockdep warning in L2CAPGustavo F. Padovan1-2/+0
Fix a regression from the L2CAP "rewrite" patches. Purge the tx_q already happens on l2cap_chan_del() so we don't need it at l2cap_disconnect_req(). Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-14Bluetooth: Fix another locking unbalanceGustavo F. Padovan1-0/+2
l2cap_get_sock_by_scid was changed to not lock the socket anymore, but I forgot to change all the users of this function. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Don't lock sock inside l2cap_get_sock_by_scid()Gustavo F. Padovan1-5/+3
Fix an locking issue with the new l2cap_att_channel(). l2cap_att_channel() was trying to lock a locked socket. Reported-by: Anderson Lizardo <anderson.lizardo@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Fix Out Of Band pairing when mgmt interface is disabledSzymon Janc1-0/+4
Use kernel stored remote Out Of Band data only if management interface is enabled. Otherwise HCI_OP_REMOTE_OOB_DATA_NEG_REPLY was sent to controller even if remote Out Of Band data was present in bluetoothd. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Add proper handling of received LE dataGustavo F. Padovan1-0/+34
Despite it works, handling through l2cap_data_channel() is wrongs. That function should handle only connection oriented data. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Fix wrong comparison in listen()Gustavo F. Padovan1-1/+1
We should check for the pi->scid there. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Move tx queue to struct l2cap_chanGustavo F. Padovan2-25/+22
tx_q is the queue used by ERTM mode. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Remove unneeded uninitialized_vars()Gustavo F. Padovan1-1/+1
That was unnecessary use of it. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Remove some sk references from l2cap_core.cGustavo F. Padovan1-17/+12
Change some BT_DBG messages and consequently remove some struct sock declarations. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-13Bluetooth: Move SREJ list to struct l2cap_chanGustavo F. Padovan2-12/+11
As part of moving all the Channel related operation to struct l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-12Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davemJohn W. Linville15-279/+848
Conflicts: drivers/net/wireless/ath/ar9170/main.c drivers/net/wireless/ath/ar9170/phy.c drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
2011-04-07Bluetooth: Fix lockdep warning with skb list lockGustavo F. Padovan1-0/+5
This is a regression acctually, caused by the first patch series for creating a formal strcut l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move busy workqueue to struct l2cap_chanGustavo F. Padovan1-11/+9
As part of the moving channel stuff to l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move srej and busy queues to struct l2cap_chanGustavo F. Padovan2-24/+20
As part of the moving channel stuff to l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move ERTM timers to struct l2cap_chanGustavo F. Padovan2-44/+43
This also triggered a change in l2cap_send_disconn_req() parameters. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move remote info to struct l2cap_chanGustavo F. Padovan2-18/+18
As part of the moving channel stuff to l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move SDU related vars to struct l2cap_chanGustavo F. Padovan1-37/+37
As part of the moving channel stuff to l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move more ERTM stuff to struct l2cap_chanGustavo F. Padovan1-27/+24
As part of the moving channel stuff to l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move of ERTM *_seq vars to struct l2cap_chanGustavo F. Padovan2-67/+63
As part of the moving channel to stuff to struct l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move conn_state to struct l2cap_chanGustavo F. Padovan2-193/+214
This is part of "moving things to l2cap_chan". As one the first move it triggered a big number of changes in the funcions parameters, basically changing the struct sock param to struct l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: clean up l2cap_sock_recvmsg()Gustavo F. Padovan2-25/+28
Move some channel specific stuff to l2cap_core.c, this will make things more clear. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move conf_{req,rsp} stuff to struct l2cap_chanGustavo F. Padovan2-31/+32
They are also l2cap_chan specific. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Move ident to struct l2cap_chanGustavo F. Padovan2-21/+21
ident is chan property, no need to reside on socket. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Remove struct del_listGustavo F. Padovan1-17/+7
As we use struct list_head to keep L2CAP channels list the workaround with del_list is not needed anymore. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Use struct list_head for L2CAP channels listGustavo F. Padovan1-103/+85
Use a well known Kernel API is always a good idea than implement your own list. In the future we might use RCU on this list. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Bluetooth: Create struct l2cap_chanGustavo F. Padovan2-90/+163
struct l2cap_chan cames to create a clear separation between what properties and data belongs to the L2CAP channel and what belongs to the socket. By now we just fold the struct sock * in struct l2cap_chan as all the channel info is struct l2cap_pinfo today. In the next commits we will see a move of channel stuff to struct l2cap_chan. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-07Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6Linus Torvalds2-2/+2
* 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6: Fix common misspellings
2011-04-05Bluetooth: convert net/bluetooth/ to kstrtoxAlexey Dobriyan1-17/+17
Convert from strict_strto*() interfaces to kstrto*() interfaces. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-05Bluetooth: Use GFP_KERNEL in user contextGustavo F. Padovan1-1/+1
The allocation in mgmt_control() code are in user context and not locked by any spinlock, so it's not recommended the use of GFP_ATOMIC there. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-05Bluetooth: Don't use spin_lock_bh in user contextGustavo F. Padovan1-44/+44
spin_lock() and spin_unlock() are more apropiated for user context. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-05Bluetooth: Use kthread API in cmtpSzymon Janc3-18/+13
kernel_thread() is a low-level implementation detail and EXPORT_SYMBOL(kernel_thread) is scheduled for removal. Use the <linux/kthread.h> API instead. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-05Bluetooth: Use kthread API in bnepSzymon Janc2-14/+9
kernel_thread() is a low-level implementation detail and EXPORT_SYMBOL(kernel_thread) is scheduled for removal. Use the <linux/kthread.h> API instead. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-05Bluetooth: Use kthread API in hidpSzymon Janc2-30/+25
kernel_thread() is a low-level implementation detail and EXPORT_SYMBOL(kernel_thread) is scheduled for removal. Use the <linux/kthread.h> API instead. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-04Bluetooth: Add mgmt_remote_name eventJohan Hedberg2-0/+15
This patch adds a new remote_name event to the Management interface which is sent every time the name of a remote device is resolved (over BR/EDR). Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-04Bluetooth: Add mgmt_device_found eventJohan Hedberg2-8/+31
This patch adds a device_found event to the Management interface. For now the event only maps to BR/EDR inquiry result HCI events, but in the future the plan is to also use it for the LE device discovery process. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-04-04Bluetooth: Remove gfp_mask param from hci_reassembly()Gustavo F. Padovan1-6/+5
It is unnecessary, once we are always in interrupt context. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6Gustavo F. Padovan5-6/+19
2011-03-31Bluetooth: Fix warning with hci_cmd_timerThomas Gleixner1-1/+3
After we made debugobjects working again, we got the following: WARNING: at lib/debugobjects.c:262 debug_print_object+0x8e/0xb0() Hardware name: System Product Name ODEBUG: free active (active state 0) object type: timer_list hint: hci_cmd_timer+0x0/0x60 Pid: 2125, comm: dmsetup Tainted: G W 2.6.38-06707-gc62b389 #110375 Call Trace: [<ffffffff8104700a>] warn_slowpath_common+0x7a/0xb0 [<ffffffff810470b6>] warn_slowpath_fmt+0x46/0x50 [<ffffffff812d3a5e>] debug_print_object+0x8e/0xb0 [<ffffffff81bd8810>] ? hci_cmd_timer+0x0/0x60 [<ffffffff812d4685>] debug_check_no_obj_freed+0x125/0x230 [<ffffffff810f1063>] ? check_object+0xb3/0x2b0 [<ffffffff810f3630>] kfree+0x150/0x190 [<ffffffff81be4d06>] ? bt_host_release+0x16/0x20 [<ffffffff81be4d06>] bt_host_release+0x16/0x20 [<ffffffff813a1907>] device_release+0x27/0xa0 [<ffffffff812c519c>] kobject_release+0x4c/0xa0 [<ffffffff812c5150>] ? kobject_release+0x0/0xa0 [<ffffffff812c61f6>] kref_put+0x36/0x70 [<ffffffff812c4d37>] kobject_put+0x27/0x60 [<ffffffff813a21f7>] put_device+0x17/0x20 [<ffffffff81bda4f9>] hci_free_dev+0x29/0x30 [<ffffffff81928be6>] vhci_release+0x36/0x70 [<ffffffff810fb366>] fput+0xd6/0x1f0 [<ffffffff810f8fe6>] filp_close+0x66/0x90 [<ffffffff810f90a9>] sys_close+0x99/0xf0 [<ffffffff81d4c96b>] system_call_fastpath+0x16/0x1b That timer was introduced with commit 6bd32326cda(Bluetooth: Use proper timer for hci command timout) Timer seems to be running when the thing is closed. Removing the timer unconditionally fixes the problem. And yes, it needs to be fixed before the HCI_UP check. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: delete hanging L2CAP channelAndrei Emeltchenko1-2/+3
Sometimes L2CAP connection remains hanging. Make sure that L2CAP channel is deleted. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Fix missing hci_dev_lock_bh in user_confirm_replyJohan Hedberg1-0/+2
The code was correctly calling _unlock at the end of the function but there was no actual _lock call anywhere. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Fix HCI_RESET command synchronizationGustavo F. Padovan2-2/+8
We can't send new commands before a cmd_complete for the HCI_RESET command shows up. Reported-by: Mikko Vinni <mmvinni@yahoo.com> Reported-by: Justin P. Mattock <justinmattock@gmail.com> Reported-by: Ed Tomlinson <edt@aei.ca> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Tested-by: Justin P. Mattock <justinmattock@gmail.com> Tested-by: Mikko Vinni <mmvinni@yahoo.com> Tested-by: Ed Tomlinson <edt@aei.ca>
2011-03-31Bluetooth: Increment unacked_frames count only the first transmitSuraj Sumangala1-1/+3
This patch lets 'l2cap_pinfo.unacked_frames' be incremented only the first time a frame is transmitted. Previously it was being incremented for retransmitted packets too resulting the value to cross the transmit window size. Signed-off-by: Suraj Sumangala <suraj@atheros.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Add local Extended Inquiry Response (EIR) supportJohan Hedberg1-0/+163
This patch adds automated creation of the local EIR data based on what 16-bit UUIDs are registered and what the device name is. This should cover the majority use cases, however things like 32/128-bit UUIDs, TX power and Device ID will need to be added later to be on par with what bluetoothd is capable of doing (without the Management interface). Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: check L2CAP info_rsp ident and stateAndrei Emeltchenko1-0/+5
Information requests/responses are unbound to L2CAP channel. Patch fixes issue arising when two devices connects at the same time to each other. This way we do not process out of the context messages. We are safe dropping info_rsp since info_timer is left running. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Move bt_accept_enqueue() to outside __l2cap_chan_addGustavo F. Padovan1-9/+10
bt_accept_enqueue() is not really a channel action, so do it outside. This patch is part of a set of patches to create an struct l2cap_chan to have a clear separation between the struct sock and the L2CAP channel stuff. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Enable support for out of band association modelSzymon Janc1-1/+6
If remote side reports oob availability or we are pairing initiator use oob data for pairing if available. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Add add/remove_remote_oob_data management commandsSzymon Janc3-0/+177
This patch adds commands to add and remove remote OOB data to the managment interface. Remote data is stored in kernel and can be used by corresponding HCI commands and events when needed. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-03-31Bluetooth: Add read_local_oob_data management commandSzymon Janc2-0/+98
This patch adds a command to read local OOB data to the managment interface. The command maps directly to the Read Local OOB Data HCI command. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>