GitHub/mt8127/android_kernel_alcatel_ttab.git
12 years agoBluetooth: Fix hci core device initialization
David Herrmann [Sat, 8 Oct 2011 12:58:47 +0000 (14:58 +0200)]
Bluetooth: Fix hci core device initialization

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>
12 years agoBluetooth: AMP: read local amp info HCI command
Andrei Emeltchenko [Wed, 12 Oct 2011 07:53:57 +0000 (10:53 +0300)]
Bluetooth: AMP: read local amp info HCI command

Implementation of Read Local AMP Info Command

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EFS: add efs option in L2CAP conf req
Andrei Emeltchenko [Thu, 13 Oct 2011 13:18:55 +0000 (16:18 +0300)]
Bluetooth: EFS: add efs option in L2CAP conf req

Add Extended Flow Specification option when building L2CAP
Configuration Request. EFS is added if both the local and
remote L2CAP entities have indicated support for the
Extended Flow Specification for BR/EDR.

...
< ACL data: handle 1 flags 0x00 dlen 10
    L2CAP(s): Info req: type 2
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x01f8
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
        Extended Flow Specification
        Fixed Channels
        Extended Window Size
...
< ACL data: handle 1 flags 0x00 dlen 45
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 33
      RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 0, MTo 0, MPS 498)
      EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff,
          AccLat 0xffffffff, FlushTO 0x0000ffff)
...

Based upon haijun.liu <haijun.liu@atheros.com> series of patches
(sent Sun, 22 Aug 2010)

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EFS: assign default values in chan add
Andrei Emeltchenko [Thu, 13 Oct 2011 13:18:54 +0000 (16:18 +0300)]
Bluetooth: EFS: assign default values in chan add

Assign default EFS values when creating L2CAP channel

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EFS: definitions and headers
Andrei Emeltchenko [Thu, 13 Oct 2011 13:18:53 +0000 (16:18 +0300)]
Bluetooth: EFS: definitions and headers

Define Extended Flow Specification structures and default values.
Based upon haijun.liu <haijun.liu@atheros.com> series of patches
(sent Sun, 22 Aug 2010)

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: define L2CAP header sizes
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:54 +0000 (13:37 +0300)]
Bluetooth: EWS: define L2CAP header sizes

Adds definitins for L2CAP header sizes to be uses when calculating
payload size instead of magic numbers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: recalculate L2CAP header size
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:52 +0000 (13:37 +0300)]
Bluetooth: EWS: recalculate L2CAP header size

Recalculate length of L2CAP header based on Control field length.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite handling POLL (P) bit
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:50 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite handling POLL (P) bit

Handle POLL (P) bit in L2CAP ERTM using information about control field type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite handling FINAL (F) bit
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:49 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite handling FINAL (F) bit

Handle final (F) bit in L2CAP using information about control field type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite check frame type function
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:48 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite check frame type function

Check frame function uses now information about control field type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite L2CAP ERTM txseq calculation
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:47 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite L2CAP ERTM txseq calculation

L2CAP ERTM txseq calculation uses now information about control field type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite reqseq calculation
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:46 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite reqseq calculation

reqseq calculation uses now information about control field type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite handling SAR bits
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:45 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite handling SAR bits

Segmentation and Reassembly (SAR) occupies different windows in standard and
extended control fields. Convert hardcoded masks to relative ones and use shift
to access SAR bits.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: rewrite handling Supervisory (S) bits
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:44 +0000 (13:37 +0300)]
Bluetooth: EWS: rewrite handling Supervisory (S) bits

Supervisory bits occupy different windows in standard / extended control
fields. Convert hardcoded masks to relative ones and use shift to access
S-bit window.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: adds ext control field bit mask
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:43 +0000 (13:37 +0300)]
Bluetooth: EWS: adds ext control field bit mask

Adds extended control field bit masks and rearrange defines to logical
groups: masks, flags and shift groups.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: EWS: extended window size option support
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:42 +0000 (13:37 +0300)]
Bluetooth: EWS: extended window size option support

Adds support for extended window size (EWS) config option. We enable EWS
feature in L2CAP Info RSP when hs enabled. EWS option is included in L2CAP
Config Req if tx_win (which is set via socket) bigger then standard default
value (63) && hs enabled && remote side supports EWS feature.

Using EWS selects extended control field in L2CAP.

Code partly based on Qualcomm and Atheros patches sent upstream a year ago.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Fix permission of enable_le param
Gustavo F. Padovan [Tue, 11 Oct 2011 18:57:01 +0000 (15:57 -0300)]
Bluetooth: Fix permission of enable_le param

With 0444 it is impossible to change the param, changing it to 0644.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: clean up spaces in L2CAP header
Andrei Emeltchenko [Tue, 11 Oct 2011 10:37:41 +0000 (13:37 +0300)]
Bluetooth: clean up spaces in L2CAP header

Spaces converted to tabs

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: convert role_switch variable to flag in l2cap chan
Andrei Emeltchenko [Tue, 11 Oct 2011 11:04:34 +0000 (14:04 +0300)]
Bluetooth: convert role_switch variable to flag in l2cap chan

role_switch variable inside l2cap_chan is a logical one and can
be easily converted to flag

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: convert force_active variable to flag in l2cap chan
Andrei Emeltchenko [Tue, 11 Oct 2011 11:04:33 +0000 (14:04 +0300)]
Bluetooth: convert force_active variable to flag in l2cap chan

force_active variable inside l2cap_chan is a logical one and can
be easily converted to flag

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: convert force_reliable variable to flag in l2cap chan
Andrei Emeltchenko [Tue, 11 Oct 2011 11:04:32 +0000 (14:04 +0300)]
Bluetooth: convert force_reliable variable to flag in l2cap chan

force_reliable variable inside l2cap_chan is a logical one and can
be easily converted to flag

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: convert flushable variable to flag in l2cap chan
Andrei Emeltchenko [Tue, 11 Oct 2011 11:04:31 +0000 (14:04 +0300)]
Bluetooth: convert flushable variable to flag in l2cap chan

flushable variable inside l2cap_chan is a logical one and can
be easily converted to flag. Added flags in l2cap_chan structure.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: btusb: hide more usb_submit_urb errors
Paul Bolle [Sun, 9 Oct 2011 10:12:22 +0000 (12:12 +0200)]
Bluetooth: btusb: hide more usb_submit_urb errors

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>
12 years agoBluetooth: btusb: also be quiet when suspending
Paul Bolle [Sun, 9 Oct 2011 10:12:16 +0000 (12:12 +0200)]
Bluetooth: btusb: also be quiet when suspending

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>
12 years agoBluetooth: Rename hidp_find_connection()
Gustavo F. Padovan [Fri, 7 Oct 2011 04:29:51 +0000 (01:29 -0300)]
Bluetooth: Rename hidp_find_connection()

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>
12 years agoBluetooth: Delay session allocation in hidp
Gustavo F. Padovan [Fri, 7 Oct 2011 02:32:29 +0000 (23:32 -0300)]
Bluetooth: Delay session allocation in hidp

It gets allocated only when it is really needed.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: hidp: safely acquire hci connection
Peter Hurley [Tue, 30 Aug 2011 15:53:35 +0000 (11:53 -0400)]
Bluetooth: hidp: safely acquire hci connection

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>
12 years agoBluetooth: Uses test_and_clear_bit() when possible
Gustavo F. Padovan [Fri, 7 Oct 2011 01:05:37 +0000 (22:05 -0300)]
Bluetooth: Uses test_and_clear_bit() when possible

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Remove wrong error check
Gustavo F. Padovan [Fri, 7 Oct 2011 00:27:56 +0000 (21:27 -0300)]
Bluetooth: Remove wrong error check

d458a9dfc add this check, but now it proves to be wrong.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Fix input device registration
Gustavo F. Padovan [Fri, 7 Oct 2011 00:17:32 +0000 (21:17 -0300)]
Bluetooth: Fix input device registration

This is a regression fix. It made impossible use input device when hid
fails.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Trasmit interrupt channel messages first
Gustavo F. Padovan [Thu, 6 Oct 2011 23:51:37 +0000 (20:51 -0300)]
Bluetooth: Trasmit interrupt channel messages first

interrupt channel is low latency.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: prioritize the interrupt channel in hidp
Gustavo F. Padovan [Thu, 6 Oct 2011 21:02:13 +0000 (18:02 -0300)]
Bluetooth: prioritize the interrupt channel in hidp

Interrupt channel has low latency requiments, should be processed first.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: use list_for_each_entry() in hidp
Gustavo F. Padovan [Thu, 6 Oct 2011 20:35:31 +0000 (17:35 -0300)]
Bluetooth: use list_for_each_entry() in hidp

list_for_each_entry is much more meaningful.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: hidp: Stop I/O on shutdown
David Herrmann [Fri, 26 Aug 2011 12:06:02 +0000 (14:06 +0200)]
Bluetooth: hidp: Stop I/O on shutdown

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>
12 years agoBluetooth: EFS: add enable_hs kernel param
Andrei Emeltchenko [Fri, 16 Sep 2011 13:26:32 +0000 (16:26 +0300)]
Bluetooth: EFS: add enable_hs kernel param

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>
12 years agoBluetooth: EFS: l2cap extended feature mask update
Andrei Emeltchenko [Fri, 16 Sep 2011 13:26:30 +0000 (16:26 +0300)]
Bluetooth: EFS: l2cap extended feature mask update

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>
12 years agobtusb: add device entry for Broadcom SoftSailing
Oliver Neukum [Wed, 21 Sep 2011 09:41:45 +0000 (11:41 +0200)]
btusb: add device entry for Broadcom SoftSailing

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>
12 years agoBluetooth: hci_le_adv_report_evt code refactoring
Andre Guedes [Mon, 26 Sep 2011 23:48:35 +0000 (20:48 -0300)]
Bluetooth: hci_le_adv_report_evt code refactoring

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>
12 years agoBluetooth: Fix possible NULL pointer dereference
Waldemar Rymarkiewicz [Fri, 23 Sep 2011 08:01:30 +0000 (10:01 +0200)]
Bluetooth: Fix possible NULL pointer dereference

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>
12 years agoBluetooth: Mark not declared l2cap_core functions as static
Szymon Janc [Thu, 28 Jul 2011 14:24:33 +0000 (16:24 +0200)]
Bluetooth: Mark not declared l2cap_core functions as static

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: use recommended LE connection parameters
Anderson Lizardo [Wed, 27 Jul 2011 21:40:09 +0000 (18:40 -0300)]
Bluetooth: use recommended LE connection parameters

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>
12 years agoBluetooth: Perform L2CAP SDU reassembly without copying data
Mat Martineau [Fri, 22 Jul 2011 21:54:00 +0000 (14:54 -0700)]
Bluetooth: Perform L2CAP SDU reassembly without copying data

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>
12 years agoBluetooth: Handle fragmented skbs in bt_sock_stream_recvmsg()
Mat Martineau [Fri, 22 Jul 2011 21:53:59 +0000 (14:53 -0700)]
Bluetooth: Handle fragmented skbs in bt_sock_stream_recvmsg()

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>
12 years agoBluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMM
Mat Martineau [Fri, 22 Jul 2011 21:53:58 +0000 (14:53 -0700)]
Bluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMM

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>
12 years agoBluetooth: Allow ACL packets over USB in HCI_RAW mode
Peter Hurley [Thu, 14 Jul 2011 12:48:32 +0000 (08:48 -0400)]
Bluetooth: Allow ACL packets over USB in HCI_RAW mode

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>
12 years agoBluetooth: mark l2cap_create_iframe_pdu as static
Luiz Augusto von Dentz [Mon, 12 Sep 2011 17:00:50 +0000 (20:00 +0300)]
Bluetooth: mark l2cap_create_iframe_pdu as static

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>
12 years agoBluetooth: Check 'dev_class' in mgmt_device_found()
Andre Guedes [Fri, 9 Sep 2011 21:56:26 +0000 (18:56 -0300)]
Bluetooth: Check 'dev_class' in mgmt_device_found()

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>
12 years agoBluetooth: Reduce critical region.
Andre Guedes [Fri, 9 Sep 2011 21:56:24 +0000 (18:56 -0300)]
Bluetooth: Reduce critical region.

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>
12 years agoBluetooth: Fix wrong memcpy size on LE start encryption
Anderson Briglia [Mon, 19 Sep 2011 18:41:09 +0000 (14:41 -0400)]
Bluetooth: Fix wrong memcpy size on LE start encryption

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>
12 years agoBluetooth: Remove support for other SMP keys than the LTK
Vinicius Costa Gomes [Thu, 25 Aug 2011 23:02:37 +0000 (20:02 -0300)]
Bluetooth: Remove support for other SMP keys than the LTK

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>
12 years agoBluetooth: Fix not setting a pending security level
Vinicius Costa Gomes [Thu, 25 Aug 2011 23:02:35 +0000 (20:02 -0300)]
Bluetooth: Fix not setting a pending security level

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>
12 years agoRevert "Bluetooth: Add support for communicating keys with userspace"
Vinicius Costa Gomes [Thu, 25 Aug 2011 23:02:29 +0000 (20:02 -0300)]
Revert "Bluetooth: Add support for communicating keys with userspace"

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>
12 years agoBluetooth: Use the LTK after receiving a LE Security Request
Vinicius Costa Gomes [Thu, 25 Aug 2011 23:02:28 +0000 (20:02 -0300)]
Bluetooth: Use the LTK after receiving a LE Security Request

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>
12 years agoBluetooth: Fix sending wrong authentication requirements
Vinicius Costa Gomes [Thu, 25 Aug 2011 23:02:27 +0000 (20:02 -0300)]
Bluetooth: Fix sending wrong authentication requirements

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>
12 years agoBluetooth: Add mgmt events for blacklisting
Antti Julku [Thu, 25 Aug 2011 13:48:02 +0000 (16:48 +0300)]
Bluetooth: Add mgmt events for blacklisting

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>
12 years agoBluetooth: Use the MEDIUM security level for pairings
Vinicius Costa Gomes [Fri, 2 Sep 2011 17:51:22 +0000 (14:51 -0300)]
Bluetooth: Use the MEDIUM security level for pairings

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>
12 years agoBluetooth: Require authentication if MITM protection is requested
Vinicius Costa Gomes [Fri, 2 Sep 2011 17:51:20 +0000 (14:51 -0300)]
Bluetooth: Require authentication if MITM protection is requested

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>
12 years agoBluetooth: Move SMP crypto functions to a workqueue
Vinicius Costa Gomes [Mon, 5 Sep 2011 17:31:31 +0000 (14:31 -0300)]
Bluetooth: Move SMP crypto functions to a workqueue

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>
12 years agoBluetooth: Move SMP fields to a separate structure
Vinicius Costa Gomes [Mon, 5 Sep 2011 17:31:30 +0000 (14:31 -0300)]
Bluetooth: Move SMP fields to a separate structure

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>
12 years agoBluetooth: hidp: Add support for NO_INIT_REPORTS quirk
David Herrmann [Fri, 26 Aug 2011 11:27:12 +0000 (13:27 +0200)]
Bluetooth: hidp: Add support for NO_INIT_REPORTS quirk

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>
12 years agoBluetooth: Add LE link type for debugfs output
Peter Hurley [Wed, 24 Aug 2011 14:04:56 +0000 (10:04 -0400)]
Bluetooth: Add LE link type for debugfs output

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>
12 years agoBluetooth: Add mgmt command for fast connectable mode
Antti Julku [Wed, 22 Jun 2011 10:11:56 +0000 (13:11 +0300)]
Bluetooth: Add mgmt command for fast connectable mode

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>
12 years agoBluetooth: Add link_type information to the mgmt Connected event
Vinicius Costa Gomes [Sat, 20 Aug 2011 00:06:56 +0000 (21:06 -0300)]
Bluetooth: Add link_type information to the mgmt Connected event

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>
12 years agoBluetooth: Add support for running SMP without a socket
Vinicius Costa Gomes [Sat, 20 Aug 2011 00:06:55 +0000 (21:06 -0300)]
Bluetooth: Add support for running SMP without a socket

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>
12 years agoBluetooth: Add support for pairing via mgmt over LE
Vinicius Costa Gomes [Sat, 20 Aug 2011 00:06:54 +0000 (21:06 -0300)]
Bluetooth: Add support for pairing via mgmt over LE

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>
12 years agoBluetooth: Use the same timeouts for both ACL and LE links
Vinicius Costa Gomes [Sat, 20 Aug 2011 00:06:52 +0000 (21:06 -0300)]
Bluetooth: Use the same timeouts for both ACL and LE links

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Add a flag to indicate that SMP is going on
Vinicius Costa Gomes [Sat, 20 Aug 2011 00:06:51 +0000 (21:06 -0300)]
Bluetooth: Add a flag to indicate that SMP is going on

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>
12 years agoBluetooth: Reset the security timer when a command is queued
Vinicius Costa Gomes [Sat, 20 Aug 2011 00:06:50 +0000 (21:06 -0300)]
Bluetooth: Reset the security timer when a command is queued

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>
12 years agoBluetooth: make use of connection number to optimize the scheduler
Luiz Augusto von Dentz [Wed, 17 Aug 2011 13:23:00 +0000 (16:23 +0300)]
Bluetooth: make use of connection number to optimize the scheduler

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>
12 years agortlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.
Larry Finger [Mon, 19 Sep 2011 19:34:10 +0000 (14:34 -0500)]
rtlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.

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>
12 years agortlwifi: rtl8192de: Change modinfo messages
Larry Finger [Mon, 19 Sep 2011 19:34:09 +0000 (14:34 -0500)]
rtlwifi: rtl8192de: Change modinfo messages

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>
12 years agortlwifi: rtl8192se: Change modinfo messages
Larry Finger [Mon, 19 Sep 2011 19:34:08 +0000 (14:34 -0500)]
rtlwifi: rtl8192se: Change modinfo messages

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>
12 years agortlwifi: rtl8192ce: Change modinfo messages
Larry Finger [Mon, 19 Sep 2011 19:34:07 +0000 (14:34 -0500)]
rtlwifi: rtl8192ce: Change modinfo messages

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>
12 years agoath9k: Store noise immunity values across scanning
Rajkumar Manoharan [Mon, 19 Sep 2011 14:45:48 +0000 (20:15 +0530)]
ath9k: Store noise immunity values across scanning

CCK/OFDM noise immunilty values are always reset to defaults
during bgscan. This could affect the link quality and
performance when the STA is associated in a noisy channel.
So do not override the learned values across the scanning.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoNFC: driver for TI shared transport
Ilan Elias [Sun, 18 Sep 2011 08:19:36 +0000 (11:19 +0300)]
NFC: driver for TI shared transport

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoNFC: basic NCI protocol implementation
Ilan Elias [Sun, 18 Sep 2011 08:19:35 +0000 (11:19 +0300)]
NFC: basic NCI protocol implementation

The NFC Controller Interface (NCI) is a standard
communication protocol between an NFC Controller (NFCC)
and a Device Host (DH), defined by the NFC Forum.

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoNFC: move nfc.h from include/net to include/net/nfc
Ilan Elias [Sun, 18 Sep 2011 08:19:34 +0000 (11:19 +0300)]
NFC: move nfc.h from include/net to include/net/nfc

The file nfc.h was moved from include/net to include/net/nfc,
since new NFC header files will be added to include/net/nfc.

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoNFC: Add dev_up and dev_down control operations
Ilan Elias [Sun, 18 Sep 2011 08:19:33 +0000 (11:19 +0300)]
NFC: Add dev_up and dev_down control operations

Add 2 new nfc control operations:
dev_up to turn on the nfc device
dev_down to turn off the nfc device

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix indentation
Alexander Simon [Sat, 17 Sep 2011 22:16:45 +0000 (00:16 +0200)]
mac80211: fix indentation

Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agowireless: Do not allow disabled channel in scan request
Rajkumar Manoharan [Thu, 15 Sep 2011 12:10:50 +0000 (17:40 +0530)]
wireless: Do not allow disabled channel in scan request

cfg80211_conn_scan allows disabled channels at scan request.
Hence probe request was seen at the disabled one. This patch
ensures that disabled channel never be added into the scan
request's channel list.

Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'master' of git://git.infradead.org/users/linville/wireless
John W. Linville [Tue, 20 Sep 2011 18:11:55 +0000 (14:11 -0400)]
Merge branch 'master' of git://git.infradead.org/users/linville/wireless

Conflicts:
drivers/net/wireless/iwlwifi/iwl-pci.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/wl12xx/main.c

12 years agocfg80211/nl80211: Add PMKSA caching candidate event
Jouni Malinen [Fri, 16 Sep 2011 15:56:23 +0000 (18:56 +0300)]
cfg80211/nl80211: Add PMKSA caching candidate event

When the driver (or most likely firmware) decides which AP to use
for roaming based on internal scan result processing, user space
needs to be notified of PMKSA caching candidates to allow RSN
pre-authentication to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: LCN-PHY: finish sense setup
Rafał Miłecki [Fri, 16 Sep 2011 14:36:32 +0000 (16:36 +0200)]
b43: LCN-PHY: finish sense setup

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorfkill: properly assign a boolean type
Mohammed Shafi Shajakhan [Fri, 16 Sep 2011 13:33:40 +0000 (19:03 +0530)]
rfkill: properly assign a boolean type

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: validate IBSS BSSID
Johannes Berg [Fri, 16 Sep 2011 11:45:25 +0000 (13:45 +0200)]
cfg80211: validate IBSS BSSID

The IBSS BSSID is never validated, so an
invalid one might end up being used. Fix
this by rejecting invalid configuration.

Reported-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: LCN-PHY: add more init tweaks
Rafał Miłecki [Fri, 16 Sep 2011 10:34:03 +0000 (12:34 +0200)]
b43: LCN-PHY: add more init tweaks

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: LCN-PHY: init TX power control
Rafał Miłecki [Fri, 16 Sep 2011 10:34:02 +0000 (12:34 +0200)]
b43: LCN-PHY: init TX power control

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: LCN-PHY: implement SPUR avoidance mode
Rafał Miłecki [Fri, 16 Sep 2011 10:34:01 +0000 (12:34 +0200)]
b43: LCN-PHY: implement SPUR avoidance mode

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: LCN-PHY: set TX filters
Rafał Miłecki [Fri, 16 Sep 2011 10:34:00 +0000 (12:34 +0200)]
b43: LCN-PHY: set TX filters

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: LCN-PHY: tweaks for channel switching
Rafał Miłecki [Fri, 16 Sep 2011 10:33:59 +0000 (12:33 +0200)]
b43: LCN-PHY: tweaks for channel switching

They have been taken from brcmsmac, add Broadcom's copyright.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: cc: export more control functions
Rafał Miłecki [Fri, 16 Sep 2011 10:33:58 +0000 (12:33 +0200)]
bcma: cc: export more control functions

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Fix regression on queue stop during 2040 bss change
Rajkumar Manoharan [Fri, 16 Sep 2011 10:02:34 +0000 (15:32 +0530)]
mac80211: Fix regression on queue stop during 2040 bss change

The commit "mac80211: stop tx before doing hw config and
rate update" stops the tx queue and call drv_flush so frequently
whenever a beacon got received with 11n htcap. This leads to
massive "Failed to stop TX DMA" logspam on embedded hw. So the
queue stop and flush should be called if and only if there is a
change in the channel type.

Reported-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: signedness bug
Wey-Yi Guy [Thu, 15 Sep 2011 18:46:54 +0000 (11:46 -0700)]
iwlagn: signedness bug

re-apply the unsigned shorts bug fixed by Dan Carpenter but get lost
after the file move.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: fix stack corruption for temperature offset v2
Wey-Yi Guy [Thu, 15 Sep 2011 18:46:53 +0000 (11:46 -0700)]
iwlagn: fix stack corruption for temperature offset v2

Same stack corruption problem as temperature offset

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: do not use interruptible waits
Johannes Berg [Thu, 15 Sep 2011 18:46:52 +0000 (11:46 -0700)]
iwlagn: do not use interruptible waits

Since the dawn of its time, iwlwifi has used
interruptible waits to wait for synchronous
commands and firmware loading.

This leads to "interesting" bugs, because it
can't actually handle the interruptions; for
example when a command sending is interrupted
it will assume the command completed fully,
and then leave it pending, which leads to all
kinds of trouble when the command finishes
later.

Since there's no easy way to gracefully deal
with interruptions, fix the driver to not use
interruptible waits.

This at least fixes the error
iwlagn 0000:02:00.0: Error: Response NULL in  'REPLY_SCAN_ABORT_CMD'

I have seen in P2P testing, but it is likely
that there are other errors caused by this.

Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: stable@kernel.org [2.6.24+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: use iwl_eeprom_calib_hdr structure
Wey-Yi Guy [Thu, 15 Sep 2011 18:46:51 +0000 (11:46 -0700)]
iwlagn: use iwl_eeprom_calib_hdr structure

For retrieve calibration hdr related information, instead of using structure in
one place and #define in other place, unify the method to use data structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: add support for v2 of temperature offset calibration
Wey-Yi Guy [Thu, 15 Sep 2011 18:46:50 +0000 (11:46 -0700)]
iwlagn: add support for v2 of temperature offset calibration

For 2000 series of NICs, version 2 of temperature offset calibration
should be used.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: remove drvdata support from bus layer
Johannes Berg [Thu, 15 Sep 2011 18:46:49 +0000 (11:46 -0700)]
iwlagn: remove drvdata support from bus layer

Since the removal of the sysfs files, it is no
longer necessary to have upper layers control
the drvdata, so let the PCI driver have it for
itself completely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: move sysfs files to debugfs
Johannes Berg [Thu, 15 Sep 2011 18:46:48 +0000 (11:46 -0700)]
iwlagn: move sysfs files to debugfs

The debug_level and temperature files should be in
debugfs, the txpower file is completely unneeded
since TX power can be set with iw/iwconfig.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: remove unused function declarations
Johannes Berg [Thu, 15 Sep 2011 18:46:47 +0000 (11:46 -0700)]
iwlagn: remove unused function declarations

iwl_suspend and iwl_resume don't exist.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>