Gustavo F. Padovan [Thu, 15 Dec 2011 00:58:44 +0000 (22:58 -0200)]
Bluetooth: Don't disable tasklets to call hdev->notify()
It's pointless, we aren't protecting anything since btusb_notify()
schedules a work to run, then all it operation happens without protection.
If protection is really needed here, we will fix it further.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Thu, 15 Dec 2011 00:54:12 +0000 (22:54 -0200)]
Bluetooth: convert conn hash to RCU
Handling hci_conn_hash with RCU make us avoid some locking and disable
tasklets.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 14 Dec 2011 17:08:48 +0000 (15:08 -0200)]
Bluetooth: Use RCU to manipulate chan_list
Instead of using tasklet_disable() to prevent acess to the channel use, we
can use RCU and improve the performance of our code.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 9 Dec 2011 06:45:12 +0000 (04:45 -0200)]
Bluetooth: convert chan_lock to mutex
spin lock doesn't fit ok anymore on the new code based on workqueues.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 9 Dec 2011 06:41:30 +0000 (04:41 -0200)]
Bluetooth: move hci_task_lock to mutex
Now we can sleep in any path inside Bluetooth core, so mutex can make
sense here.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 24 Jun 2011 04:54:50 +0000 (01:54 -0300)]
Bluetooth: Remove sk_backlog usage from L2CAP
We run everything in the same lock now. The backlog queue is useless now
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 24 Jun 2011 04:53:01 +0000 (01:53 -0300)]
Bluetooth: Don't use spin_lock socket lock anymore
We now run everything in process context, so the mutex lock is the best
option. But in some places we still need the bh_lock_sock()
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Thu, 23 Jun 2011 22:29:58 +0000 (19:29 -0300)]
Bluetooth: Move L2CAP timers to workqueue
L2CAP timers also need to run in process context. As the works in l2cap
are small we are using the system worqueue.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 17 Jun 2011 15:58:41 +0000 (12:58 -0300)]
Bluetooth: hci_conn_auto_accept() doesn't need locking
It doesn't really touch any sensitive information about hdev. So no need
to lock here.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 20 Jun 2011 19:39:29 +0000 (16:39 -0300)]
Bluetooth: Use delayed work for advertisiment cache timeout
As HCI rx path is now done in process context it makes sense to do all the
timer in process context as well.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 17 Jun 2011 16:03:21 +0000 (13:03 -0300)]
Bluetooth: Use delayed_work for connection timeout
Bluetooth rx task runs now in a workqueue, so it a good approach run any
timer that share locking with process context code also in a workqueue.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 17 Jun 2011 16:03:21 +0000 (13:03 -0300)]
Bluetooth: Replace spin_lock by mutex in hci_dev
Now we run everything in HCI in process context, so it's a better idea use
mutex instead spin_lock. The macro remains hci_dev_lock() (and I got rid
of hci_dev_lock_bh()), of course.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Marcel Holtmann [Mon, 9 Aug 2010 03:06:53 +0000 (23:06 -0400)]
Bluetooth: Process recv path in a workqueue instead of a tasklet
Run recv process in workqueue helps a lot with our processing as the recv
path will also be in the process context, i.e., now all our tx and rx are
in process context.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 7 Dec 2011 15:24:33 +0000 (13:24 -0200)]
Bluetooth: make hci_conn_enter_sniff_mode static
It isn't used outside hci_conn.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Thu, 15 Dec 2011 00:52:31 +0000 (22:52 -0200)]
Bluetooth: Use list_for_each_entry in hci_conn_hash_flush()
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 9 Dec 2011 06:40:10 +0000 (04:40 -0200)]
Bluetooth: Use chan instead of l2cap_pi macro
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 14 Dec 2011 22:56:12 +0000 (20:56 -0200)]
Bluetooth: Initialize LE connection count
le_num needs to be set to zero.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 14 Dec 2011 17:10:41 +0000 (15:10 -0200)]
Bluetooth: remove lock from struct conn_hash
It isn't used anywhere.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 14 Dec 2011 15:02:51 +0000 (13:02 -0200)]
Bluetooth: remove struct hci_chan_hash
Only the list member of the struct was used, so we now fold it into
hci_conn.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Thu, 1 Dec 2011 12:33:28 +0000 (14:33 +0200)]
Bluetooth: trivial: correct check for LMP version
Make sure that code match exactly what comment says about pre 1.2
bluetooth version. Since this is HCI detail lmp_ver changed to hci_ver.
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>
Andrei Emeltchenko [Thu, 1 Dec 2011 12:33:27 +0000 (14:33 +0200)]
Bluetooth: Remove magic bluetooth version numbers
Use bluetooth names instead of BT SIG assigned numbers
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>
Gustavo F. Padovan [Fri, 2 Dec 2011 23:26:25 +0000 (08:26 +0900)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth
Andrei Emeltchenko [Wed, 23 Nov 2011 09:23:34 +0000 (11:23 +0200)]
Bluetooth: Correct version check in hci_setup
Check for hci_ver instead of lmp_ver
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>
Cong Wang [Tue, 22 Nov 2011 01:32:57 +0000 (09:32 +0800)]
btusb: fix a memory leak in btusb_send_frame()
This patch fixes the following memory leak reported by kmemleak:
unreferenced object 0xffff880060a53840 (size 192):
comm "softirq", pid 0, jiffies
4320571771 (age 1406.569s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<
ffffffff81138a1c>] create_object+0x187/0x28b
[<
ffffffff814be12e>] kmemleak_alloc+0x73/0x98
[<
ffffffff811289d3>] __kmalloc+0xfc/0x123
[<
ffffffff81386546>] usb_alloc_urb+0x1e/0x48
[<
ffffffffa0130274>] btusb_send_frame+0x86/0x385 [btusb]
[<
ffffffffa02d8230>] hci_send_frame+0xa0/0xa5 [bluetooth]
[<
ffffffffa02d8a4e>] hci_cmd_task+0xa0/0xfb [bluetooth]
[<
ffffffff81058548>] tasklet_action+0x8f/0xef
[<
ffffffff81058a4c>] __do_softirq+0xf4/0x1db
[<
ffffffff81058bb7>] run_ksoftirqd+0x84/0x129
[<
ffffffff8106f1c4>] kthread+0xa0/0xa8
[<
ffffffff814dd144>] kernel_thread_helper+0x4/0x10
[<
ffffffffffffffff>] 0xffffffffffffffff
The problem is that when inc_tx() returns non-zero, we forgot
to call usb_free_urb().
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <padovan@profusion.mobi>
Signed-off-by: WANG Cong <amwang@redhat.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Thu, 1 Dec 2011 12:42:08 +0000 (14:42 +0200)]
Bluetooth: remove old code
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>
Andre Guedes [Fri, 2 Dec 2011 12:13:31 +0000 (21:13 +0900)]
Bluetooth: LE Set Scan Parameter Command
This patch adds the parameter struct and the command complete event
handler to the LE Set Scan Parameter HCI command.
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>
Andre Guedes [Fri, 25 Nov 2011 23:53:38 +0000 (20:53 -0300)]
Bluetooth: Add dev_flags to struct hci_dev
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>
Andrei Emeltchenko [Thu, 24 Nov 2011 12:52:02 +0000 (14:52 +0200)]
Bluetooth: Add HCI Read Flow Control Mode function
Upstream Code Aurora function with minor trivial fixes.
Origin: git://codeaurora.org/kernel/msm.git
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>
Brian Gix [Wed, 23 Nov 2011 16:28:36 +0000 (08:28 -0800)]
Bluetooth: Centralize SMP pairing failure handling
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Brian Gix [Wed, 23 Nov 2011 16:28:35 +0000 (08:28 -0800)]
Bluetooth: Cleanup blkcipher on SMP termination
The blkcipher must be freed to avoid memory leak.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Brian Gix [Wed, 23 Nov 2011 16:28:34 +0000 (08:28 -0800)]
Bluetooth: Add HCI User Passkey Req Evt handling
Some MITM scenarios require handling of the User Passkey Request event,
by querying the user, and passing the response back.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Brian Gix [Wed, 23 Nov 2011 16:28:33 +0000 (08:28 -0800)]
Bluetooth: Add User Passkey Response handling
For some MITM protection pairing scenarios, the user is
required to enter or accept a 6 digit passkey.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 23 Nov 2011 22:11:46 +0000 (20:11 -0200)]
Bluetooth: Add user readable debug for state changes
I did this as a part of a testing course at university, but it might be
useful upstream as well.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 16 Nov 2011 15:30:20 +0000 (17:30 +0200)]
Bluetooth: Use queue in the device list
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>
Brian Gix [Wed, 16 Nov 2011 21:53:14 +0000 (13:53 -0800)]
Bluetooth: Differentiate LE User Pairing Responses
Low Energy (LE) pairing responses must be recognized and handled
differently from BR/EDR pairing responses. BR/EDR responses are
handled via HCI commands by the LMP layer, and LE responses are
handled by the Host.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Brian Gix [Wed, 16 Nov 2011 21:53:13 +0000 (13:53 -0800)]
Bluetooth: User Pairing Response restructuring
There are 4 possible User Responses to pairing requests,
and they all share the same checks and handling. This
restructures the handling of the two Confirm responses
in preperation for the second two.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Fri, 18 Nov 2011 11:35:42 +0000 (13:35 +0200)]
Bluetooth: making enable_hs independent from L2CAP
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>
Brian Gix [Wed, 16 Nov 2011 21:53:12 +0000 (13:53 -0800)]
Bluetooth: Add MGMT event for Passkey Entry
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
David Herrmann [Sat, 19 Nov 2011 12:23:33 +0000 (13:23 +0100)]
Bluetooth: bnep: Fix module reference
We cannot call module_put(THIS_MODULE) if this is our last reference. Otherwise,
this call may cleanup our module before it returns.
Gladly, the kthread API provides a simple wrapper for us. So lets use
module_put_and_exit() to avoid a race condition with the module cleanup code.
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>
David Herrmann [Sat, 19 Nov 2011 12:23:32 +0000 (13:23 +0100)]
Bluetooth: cmtp: Fix module reference
We cannot call module_put(THIS_MODULE) if this is our last reference. Otherwise,
this call may cleanup our module before it returns.
Gladly, the kthread API provides a simple wrapper for us. So lets use
module_put_and_exit() to avoid a race condition with the module cleanup code.
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>
Bing Zhao [Thu, 17 Nov 2011 04:40:42 +0000 (20:40 -0800)]
Bluetooth: btmrvl: support Marvell Bluetooth device SD8797
The SD8797 firmware image is shared with mwifiex driver.
Whoever gets loaded first will be responsible for firmware
downloading.
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Szymon Janc [Wed, 16 Nov 2011 08:32:21 +0000 (09:32 +0100)]
Bluetooth: Fix some checkpatch.pl errors and warnings
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Szymon Janc [Wed, 16 Nov 2011 08:32:22 +0000 (09:32 +0100)]
Bluetooth: Simplify __l2cap_global_chan_by_addr
Make __l2cap_global_chan_by_addr similar to other find functions.
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Szymon Janc [Wed, 16 Nov 2011 08:32:20 +0000 (09:32 +0100)]
Bluetooth: Refactor loop in l2cap_retransmit_one_frame
This make it easier to see what is the real reason for loop to exit.
skb_queue_next return valid skb or garbage, not NULL.
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Szymon Janc [Wed, 16 Nov 2011 08:32:19 +0000 (09:32 +0100)]
Bluetooth: Simplify l2cap_add_to_srej_queue
Make it easier to see what is loop break condition.
skb_queue_next return valid skb or garbage, not NULL.
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Szymon Janc [Wed, 16 Nov 2011 08:32:18 +0000 (09:32 +0100)]
Bluetooth: Fix possible NULL pointer derefence in l2cap code
Due to ERTM reliability L2CAP channel needs to be disconnected if
adding to srej list failed.
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Mon, 14 Nov 2011 10:42:48 +0000 (12:42 +0200)]
Bluetooth: Allow to set AMP type for virtual HCI
Type can be changed during re-opening device /dev/vhci.
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>
Andrei Emeltchenko [Fri, 11 Nov 2011 15:02:15 +0000 (17:02 +0200)]
Bluetooth: Do not set HCI_RAW when HS enabled
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>
Andrei Emeltchenko [Fri, 11 Nov 2011 15:02:14 +0000 (17:02 +0200)]
Bluetooth: Move scope of kernel parameter enable_hs
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>
Brian Gix [Sun, 13 Nov 2011 06:01:12 +0000 (22:01 -0800)]
Bluetooth: Add MGMT opcodes for Passkey Entry
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Brian Gix [Sun, 13 Nov 2011 06:01:11 +0000 (22:01 -0800)]
Bluetooth: Add HCI defines for User Passkey entry
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Sat, 12 Nov 2011 09:58:22 +0000 (11:58 +0200)]
Bluetooth: Pass all message parameters to mgmt_start_discovery
The mgmt_start_discovery command contains the type of discovery that
should be started so this should be passed to the start_discovery
function. This patch doesn't yet add any action depending on the type of
the requested discovery.
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>
Johan Hedberg [Fri, 11 Nov 2011 14:18:54 +0000 (16:18 +0200)]
Bluetooth: Add missing cmd_complete for mgmt_load_link_keys
The command complete event was completely missing for this command.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Fri, 11 Nov 2011 16:10:00 +0000 (18:10 +0200)]
Bluetooth: Create a unique mgmt error code hierarchy
The management protocol uses a single byte for error codes (aka command
status). In some places this value is directly copied from HCI and in
other a POSIX error number is used. This makes it impossible for
user-space to uniquily decipher the meaning of an error.
To solve this issue a new mgmt-specific set of error codes is added
along with a conversion table for HCI status values.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Fri, 11 Nov 2011 14:18:52 +0000 (16:18 +0200)]
Bluetooth: Return success instead of EALREADY for mgmt commands
When the adapter state is already what is requested it's more friendly
to user-space to simply report success than to send a EALREADY error
message.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 10 Nov 2011 22:07:35 +0000 (00:07 +0200)]
Bluetooth: Fix mgmt_pair_device imediate error responses
When possible cmd_complete should be returned instead of cmd_status
since it contains the remote address (this helps user-space track what
exactly failed).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 10 Nov 2011 22:07:34 +0000 (00:07 +0200)]
Bluetooth: Add address type to mgmt_pair_device
The kernel needs to know whether it should connect to a device over
BR/EDR or over LE. This is particularly important in the future when
dual-mode device may be connectable also over LE. It is also important
if/when we decide to move the LE advertisement cache from the kernel
into user-space. Adding the type to the mgmt command also ensures
conformance with the latest mgmt API spec.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Wed, 9 Nov 2011 20:14:26 +0000 (17:14 -0300)]
Bluetooth: mgmt_stop_discovery_failed()
This patches creates mgmt_stop_discovery_failed() which removes
pending MGMT_OP_STOP_DISCOVERY commands and sends proper command
status events.
This patch also fixes the MGMT_OP_STOP_DISCOVERY command leak in
case cancel inquiry fails.
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>
Andre Guedes [Wed, 9 Nov 2011 20:14:25 +0000 (17:14 -0300)]
Bluetooth: Rename mgmt_inquiry_failed()
This patch renames the function mgmt_inquiry_failed() to
mgmt_start_discovery_failed(). This function is more related
to MGMT_OP_START_DISCOVERY command handling than to inquiry.
Besides, this functions will be reused by LE based discovery
procedures in case of failure.
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>
Gustavo F. Padovan [Thu, 23 Jun 2011 22:30:48 +0000 (19:30 -0300)]
Bluetooth: Only set ack_timer if we didn't send and ack
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Sat, 5 Nov 2011 21:58:31 +0000 (19:58 -0200)]
Bluetooth: Allow L2CAP to increase the security level
Some incomming connections needs to increase the security level by
requesting encryption for example (HID keyboard case). This change allows
the userspace to change it through setsockopt with defer_setup enabled.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Sat, 5 Nov 2011 21:54:24 +0000 (19:54 -0200)]
Bluetooth: Rename l2cap_check_security()
rename to l2cap_chan_check_security() to make it consistent with other
l2cap_exported functions. This function will be exported in a later
commit.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 10 Nov 2011 13:54:39 +0000 (15:54 +0200)]
Bluetooth: Add status parameter to mgmt_disconnect response
Since disconnecting may fail the status needs to be communicated to user
space. This also updates the implementation to match the latest mgmt API
specification.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 10 Nov 2011 13:54:38 +0000 (15:54 +0200)]
Bluetooth: Add proper response to mgmt_remove_keys command
Since the command can fail we need to have a proper response with the
remote address and a failure status for it. This also updates it to
conform to the latest mgmt API spec.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 10 Nov 2011 13:54:37 +0000 (15:54 +0200)]
Bluetooth: Fix deadlock with mgmt_pair_device
The hci_conn callbacks are called with the hci_dev lock already held so
no locking should be attempted in them.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Wed, 9 Nov 2011 11:58:58 +0000 (13:58 +0200)]
Bluetooth: Add public/random LE address information to mgmt messages
It's necessary to know the distinction between public and random LE
addresses so the mgmt interface also needs to distinguish between them.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Dan Carpenter [Tue, 8 Nov 2011 03:31:47 +0000 (19:31 -0800)]
mwifiex: prevent corruption instead of just warning
Probably we never hit this condition, but in case we do, we may as
well put a return here instead of just printing a warning message and
then corrupting memory. The caller doesn't check the return code.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Tue, 8 Nov 2011 03:31:46 +0000 (19:31 -0800)]
mwifiex: enable SDIO multiport aggregation
By default SDIO multiport aggregation is disabled. It's useful to
get good throughput results. This patch enables it.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Carpenter [Tue, 8 Nov 2011 03:31:45 +0000 (19:31 -0800)]
mwifiex: remove an unneeded NULL check
We dereference adapter in the error handling code so this needed to
be fixed. This function is always called like:
adapter->if_ops.host_to_card(adapter, ...);
so adapter can never be NULL and I've removed the NULL check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Carpenter [Tue, 8 Nov 2011 03:31:44 +0000 (19:31 -0800)]
mwifiex: remove unneeded kfree(NULL);
The previous if statement means this that pointer is NULL so there
is no need to free it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Julia Lawall [Sun, 6 Nov 2011 13:26:49 +0000 (14:26 +0100)]
net/rfkill/core.c: use kstrtoul, etc
Use kstrtoul, etc instead of the now deprecated strict_strtoul, etc.
A semantic patch rule for the kstrtoul case is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression a,b;
{int,long} *c;
@@
-strict_strtoul
+kstrtoul
(a,b,c)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Julia Lawall [Sun, 6 Nov 2011 13:26:48 +0000 (14:26 +0100)]
net/mac80211/debugfs.c: use kstrtoul, etc
Use kstrtoul, etc instead of the now deprecated strict_strtoul, etc.
A semantic patch rule for the kstrtoul case is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression a,b;
{int,long} *c;
@@
-strict_strtoul
+kstrtoul
(a,b,c)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Sun, 6 Nov 2011 13:13:34 +0000 (14:13 +0100)]
mac80211: implement wifi TX status
Implement the socket wifi TX status error
queue reflection in mac80211.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Sun, 6 Nov 2011 13:13:33 +0000 (14:13 +0100)]
nl80211: advertise socket TX status capability
The new wifi socket TX capability should be
supported by wifi drivers, let them advertise
whether they do or not.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Sat, 5 Nov 2011 13:15:24 +0000 (14:15 +0100)]
mac80211: Also report the STA's TDLS flag via nl80211
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:42 +0000 (22:23 +0100)]
brcm80211: fmac: optimize chip core info management
Prepare for adding backplane interconnect type support
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:41 +0000 (22:23 +0100)]
brcm80211: fmac: replace private SB macros with ssb_regs version
Use SSB macros in order to clean up brcmfmac code
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:40 +0000 (22:23 +0100)]
brcm80211: fmac: move chip drive strength related code to sdio_chip.c
This patch is part of the abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:39 +0000 (22:23 +0100)]
brcm80211: fmac: move chip detach function to sdio_chip.c
This patch is part of the abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:38 +0000 (22:23 +0100)]
brcm80211: fmac: move chip reset core function to sdio_chip.c
This patch is part of the abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:37 +0000 (22:23 +0100)]
brcm80211: fmac: abstract chip core revision function
Prepare for adding backplane interconnect type support
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:36 +0000 (22:23 +0100)]
brcm80211: fmac: abstract chip iscoreup function
Prepare for adding backplane interconnect type support
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:35 +0000 (22:23 +0100)]
brcm80211: fmac: chip attach code flow clean up
Merged brcmf_sdbrcm_chip_attach into brcmf_sdio_chip_attach
for better readability.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:34 +0000 (22:23 +0100)]
brcm80211: fmac: remove duplicate regiter set in chip attach path
Same register writes have been done in brcmf_sdbrcm_probe_init
which is earlier in the same code path.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:33 +0000 (22:23 +0100)]
brcm80211: fmac: move dongle gpio reset code to chip attach function
This patch is part of the abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:32 +0000 (22:23 +0100)]
brcm80211: fmac: disable dongle arm core in bus core setup function
This will provide a better code flow that fits the logic
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:31 +0000 (22:23 +0100)]
brcm80211: fmac: move core disable function to sdio_chip.c
This patch is part of the abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:30 +0000 (22:23 +0100)]
brcm80211: fmac: abstract chip buscore setup function
This patch is part of the abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:29 +0000 (22:23 +0100)]
brcm80211: fmac: move bus core prep code to sdio_chip.c
This patch is part of abstracting chip backplane handle code
series.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:28 +0000 (22:23 +0100)]
brcm80211: fmac: move chip recognition function to sdio_chip.c
Currently backplane handle code is scatterd around dhd_sdio.c which
is not good for maintenance and adding new backplane interconnect
type support. This patch and the follow up patches are going to
abstract all chip backplane control code specific for sdio bus
into this new sdio_chip.c
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Fri, 4 Nov 2011 21:23:27 +0000 (22:23 +0100)]
brcm80211: fmac: remove unnecessary 4329 chip specific code
4329 with chiprev 0 can not be found on any product. The code can
be removed.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:21 +0000 (11:18 +0100)]
cfg80211/mac80211: allow management TX to not wait for ACK
For probe responses it can be useful to not wait for ACK to
avoid retransmissions if the station that sent the probe is
already on the next channel, so allow userspace to request
not caring about the ACK with a new nl80211 flag.
Since mac80211 needs to be updated for the new function
prototype anyway implement it right away -- it's just a
few lines of code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:20 +0000 (11:18 +0100)]
mac80211: send unexpected 4addr event
Implement the cfg80211 notification but only send
one event per associated station to avoid having
tons of events if the station thinks it should be
allowed to use 4addr frames but it isn't.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:19 +0000 (11:18 +0100)]
cfg80211: add event for unexpected 4addr frames
The frames are used by AP/STA WDS mode, and hostapd
needs to know when such a frame was received to set
up the VLAN appropriately to allow using it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:18 +0000 (11:18 +0100)]
mac80211: report OBSS beacons
If there's an interface in AP mode, OBSS beacons
are needed by hostapd/wpa_s to implement logic to
enable/disable protection etc. Report the frames
and set the capability flag.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:17 +0000 (11:18 +0100)]
cfg80211: allow registering to beacons
Add the ability to register to received beacon frames
to allow implementing OLBC logic in userspace. The
registration is per wiphy since there's no point in
receiving the same frame multiple times.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:16 +0000 (11:18 +0100)]
mac80211: support client probe
Support probing clients with null data frames
in AP mode.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:15 +0000 (11:18 +0100)]
nl80211: add API to probe a client
When the AP SME in hostapd is used it wants to
probe the clients when they have been idle for
some time. Add explicit API to support this.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 7 Nov 2011 11:39:33 +0000 (12:39 +0100)]
nl80211: advertise device AP SME
Add the ability to advertise that the device
contains the AP SME and what features it can
support. There are currently no features in
the bitmap -- probe response offload will be
advertised by a few patches Arik is working
on now (who took over from Guy Eilam) and a
device with AP SME will typically implement
and require response offload.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 4 Nov 2011 10:18:13 +0000 (11:18 +0100)]
mac80211: support spurious class3 event
Add support for the spurious class3 frame event
to mac80211 to enable AP w/o monitor mode.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>