platform/kernel/linux-rpi.git
10 years agonet: rfkill: gpio: prepare for DT and ACPI support
Heikki Krogerus [Wed, 16 Oct 2013 10:53:42 +0000 (13:53 +0300)]
net: rfkill: gpio: prepare for DT and ACPI support

This will add the relevant values like the gpios and the
type in rfkill_gpio_platform_data to the rfkill_gpio_data
structure. It will allow those values to be easily picked
from DT and ACPI tables later.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agonet: rfkill: gpio: spinlock-safe GPIO access
Heikki Krogerus [Wed, 16 Oct 2013 10:53:41 +0000 (13:53 +0300)]
net: rfkill: gpio: spinlock-safe GPIO access

This sets the direction of the gpio once when it's requested,
and uses the spinlock-safe gpio_set_state() to change the
state.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agonet: rfkill: gpio: clean up clock handling
Heikki Krogerus [Wed, 16 Oct 2013 10:53:40 +0000 (13:53 +0300)]
net: rfkill: gpio: clean up clock handling

Use a simple flag to see the state of the clock, and make
the clock available even without a name. Also, get rid of
HAVE_CLK dependency.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agonet: rfkill: gpio: convert to resource managed allocation
Heikki Krogerus [Wed, 16 Oct 2013 10:53:39 +0000 (13:53 +0300)]
net: rfkill: gpio: convert to resource managed allocation

And remove now unneeded resource freeing.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: fix docbook references
Johannes Berg [Mon, 14 Oct 2013 14:11:52 +0000 (16:11 +0200)]
cfg80211: fix docbook references

Two functions were changed but their references weren't
updated in the docbook template, propagate the change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: add missing IEEE80211_HW_SUPPORTS_HT_CCK_RATES docs
Johannes Berg [Mon, 14 Oct 2013 08:05:16 +0000 (10:05 +0200)]
mac80211: add missing IEEE80211_HW_SUPPORTS_HT_CCK_RATES docs

Document the IEEE80211_HW_SUPPORTS_HT_CCK_RATES flag.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: enable DFS for IBSS mode
Simon Wunderlich [Mon, 7 Oct 2013 16:41:06 +0000 (18:41 +0200)]
mac80211: enable DFS for IBSS mode

Allow changing to DFS channels if the channel is available for
beaconing and userspace controls DFS operation.

Channel switch announcement from other stations on DFS channels will
be interpreted as radar event. These channels will then be marked as
unvailable.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agonl80211/cfg80211: enable DFS for IBSS mode
Simon Wunderlich [Mon, 7 Oct 2013 16:41:05 +0000 (18:41 +0200)]
nl80211/cfg80211: enable DFS for IBSS mode

To use DFS in IBSS mode, userspace is required to react to radar events.
It can inform nl80211 that it is capable of doing so by adding a
NL80211_ATTR_HANDLE_DFS attribute when joining the IBSS.

This attribute is supplied to let the kernelspace know that the
userspace application can and will handle radar events, e.g. by
intiating channel switches to a valid channel. DFS channels may
only be used if this attribute is supplied and the driver supports
it. Driver support will be checked even if a channel without DFS
will be initially joined, as a DFS channel may be chosen later.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
[fix attribute name in commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: implement SMPS for AP
Emmanuel Grumbach [Tue, 1 Oct 2013 13:45:43 +0000 (16:45 +0300)]
mac80211: implement SMPS for AP

When the driver requests to move to STATIC or DYNAMIC SMPS,
we send an action frame to each associated station and
reconfigure the channel context / driver.
Of course, non-MIMO stations are ignored.

The beacon isn't updated. The association response will
include the original capabilities. Stations that associate
while in non-OFF SMPS mode will get an action frame right
after association to inform them about our current state.
Note that we wait until the end of the EAPOL. Sending an
action frame before the EAPOL is finished can be an issue
for a few clients. Clients aren't likely to send EAPOL
frames in MIMO anyway.

When the SMPS configuration gets more permissive (e.g.
STATIC -> OFF), we don't wake up stations that are asleep
We remember that they don't know about the change and send
the action frame when they wake up.

When the SMPS configuration gets more restrictive (e.g.
OFF -> STATIC), we set the TIM bit for every sleeping STA.
uAPSD stations might send MIMO until they poll the action
frame, but this is for a short period of time.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[fix vht streams loop, initialisation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agowlcore: save last regdom configuration on stop
Eliad Peller [Mon, 9 Sep 2013 09:24:44 +0000 (12:24 +0300)]
wlcore: save last regdom configuration on stop

In order to reconfigure the correct reg domain on
recovery, we have to save the current configuration
before clearing it (wl->reg_ch_conf_pending is
considered before configuring a new regdomain).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: fix started_vifs calculation
Eliad Peller [Mon, 9 Sep 2013 09:24:43 +0000 (12:24 +0300)]
wlcore: fix started_vifs calculation

wlcore configures different dwell times according to number
of active interfaces (in order to prevent hurting VO during
scan).

However, determining active vif only according to
bss_conf->idle is not explicit enough, and might result
in non-started vifs being counted as started as well
(e.g. unassociated sta during sta).

Fix it by checking for explicit conditions according
to the vif type.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: wakeup from ELP before starting recovery
Barak Bercovitz [Mon, 9 Sep 2013 09:24:41 +0000 (12:24 +0300)]
wlcore: wakeup from ELP before starting recovery

Make sure the FW is awake when entering recovery. This is useful for
reading the FW panic log and also some FW registers giving us crash
report stats.

We must do this before interrupts are disabled since we rely on an
interrupt to complete the wakeup.

If the wakeup fails, continue recovery normally. All read/writes will be
blocked and won't do any harm.

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: Allow stopping fw log in recovery
Barak Bercovitz [Mon, 9 Sep 2013 09:24:40 +0000 (12:24 +0300)]
wlcore: Allow stopping fw log in recovery

The FW panic log is read during recovery work.
It has to be stopped properly before reading. otherwise,
inconsistent data might be read which cause the driver
to freeze.

__wlcore_cmd_send has to work for the special case of
CMD_STOP_FWLOGGER, while in recovery, in order to stop
the fw log before it is read.

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: read fw panic log only in host mode
Barak Bercovitz [Mon, 9 Sep 2013 09:24:39 +0000 (12:24 +0300)]
wlcore: read fw panic log only in host mode

Reading FW panic log is only supported in host mode (SDIO)

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore/wl18xx/wl12xx: FW log params per chip arch
Igal Chernobelsky [Mon, 9 Sep 2013 09:24:38 +0000 (12:24 +0300)]
wlcore/wl18xx/wl12xx: FW log params per chip arch

FW memory block size and FW log end marker parameters
are added to wl structure and are initialized per
chip architecture.

convert_hwaddr hw operation is added to convert chip
dependent FW internal address.

Copy from FW log is also simplified to copy the entire
memory block as FW logger utility is repsponsible
for parsing of FW log content.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowl12xx/wl18xx: update default fw logger's settings
Ido Reis [Mon, 9 Sep 2013 09:24:37 +0000 (12:24 +0300)]
wl12xx/wl18xx: update default fw logger's settings

update the fw logger mode to continuous, and output to dbgpins (uart).

Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: fwlog dynamic mem_block control
Ido Reis [Mon, 9 Sep 2013 09:24:36 +0000 (12:24 +0300)]
wlcore: fwlog dynamic mem_block control

number of fwlog mem_blocks can be configured using module param.
this is a fw debug feature: in case a large fw log data is busrted during
a short period of time, the memory get filled and data is lost.
this allows us to dynamicly set the fw log mem_block usage, although
configuring more mem_block for logger comes at the expense of TP.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: fix interrogate command length
Igal Chernobelsky [Mon, 9 Sep 2013 09:24:35 +0000 (12:24 +0300)]
wlcore: fix interrogate command length

Change interrogate command prototype to have command size
and returned buffer length.
This fixes the issue when command parameters are needed to
be passed to FW in addition to acx header as in the case with
get RSSI command, where role_id has to be passed.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: add ap_event_mask
Eliad Peller [Mon, 9 Sep 2013 09:24:34 +0000 (12:24 +0300)]
wlcore: add ap_event_mask

Add new ap_event_mask field, to indicate events that
should be unmasked only when there's an ap interface.

This is done in order to avoid spurious wakeups
when we don't care about the incoming event anyway.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: print active channel in the driver_state
Victor Goldenshtein [Mon, 9 Sep 2013 09:24:33 +0000 (12:24 +0300)]
wlcore: print active channel in the driver_state

Print current active channel/s and a role type for
that channel in the driver_state debugfs.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowl18xx: default config alignment with phy defaults
Igal Chernobelsky [Mon, 9 Sep 2013 09:24:32 +0000 (12:24 +0300)]
wl18xx: default config alignment with phy defaults

Driver default config is aligned with phy default parameters.

Now that RDL1_3 has 2 antennas defined by default we need to explicitly
define ht.mode to HT_MODE_WIDE to have SISO40 as default.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agoBluetooth: Remove sk member from struct l2cap_chan
Gustavo Padovan [Mon, 21 Oct 2013 20:22:26 +0000 (18:22 -0200)]
Bluetooth: Remove sk member from struct l2cap_chan

There is no access to chan->sk in L2CAP core now. This change marks the
end of the task of splitting L2CAP between Core and Socket, thus sk is now
gone from struct l2cap_chan.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Use bt_cb(skb)->chan to send raw data back
Gustavo Padovan [Mon, 21 Oct 2013 20:22:25 +0000 (18:22 -0200)]
Bluetooth: Use bt_cb(skb)->chan to send raw data back

Instead of accessing skb->sk in L2CAP core we now compare the channel
a skb belongs to and not send it back if the channel is same. This change
removes another struct socket usage from L2CAP core.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Add L2CAP channel to skb private data
Gustavo Padovan [Mon, 21 Oct 2013 20:22:24 +0000 (18:22 -0200)]
Bluetooth: Add L2CAP channel to skb private data

Adding the channel to the skb private data makes possible to us know which
channel the skb we have came from.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Remove parent socket usage from l2cap_core.c
Gustavo Padovan [Mon, 21 Oct 2013 16:21:41 +0000 (14:21 -0200)]
Bluetooth: Remove parent socket usage from l2cap_core.c

The parent socket is not used inside the L2CAP core anymore. We only lock
it to indirect access through the new_connection() callback. The hold of
the socket lock was moved to the new_connection() callback.

Inside L2CAP core the channel lock is now used in l2cap_le_conn_ready()
and l2cap_conn_ready() to protect the execution of these two functions
during the handling of new incoming connections.

This change remove the socket lock usage from L2CAP core while keeping
the code safe against race conditions.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Remove socket lock from l2cap_state_change()
Gustavo Padovan [Mon, 21 Oct 2013 16:21:40 +0000 (14:21 -0200)]
Bluetooth: Remove socket lock from l2cap_state_change()

This simplify and make safer the state change handling inside l2cap_core.c.
we got rid of __l2cap_state_change(). And l2cap_state_change() doesn't lock
the socket anymore, instead the socket is locked inside the ops callback for
state change in l2cap_sock.c.

It makes the code safer because in some we were using a unlocked version,
and now we are calls to l2cap_state_change(), when dealing with sockets, use
the locked version.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Hold socket in defer callback in L2CAP socket
Gustavo Padovan [Mon, 21 Oct 2013 16:21:39 +0000 (14:21 -0200)]
Bluetooth: Hold socket in defer callback in L2CAP socket

In both places that we use the defer callback the socket lock is held for
a indirect sk access inside __l2cap_change_state() and chan->ops->defer(),
all the rest of the code between lock_sock() and release_sock() is
already protected by the channel lock and won't be affected by this
change.

We now use l2cap_change_state(), the locked version of the change state
function, and the defer callback does the locking itself now. This does
not affect other uses of the defer callback.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Do not access chan->sk directly
Gustavo Padovan [Mon, 21 Oct 2013 16:21:38 +0000 (14:21 -0200)]
Bluetooth: Do not access chan->sk directly

In the process of removing socket usage from L2CAP we now access the L2CAP
socket from the data member of struct l2cap_chan. For the L2CAP socket
user the data member points to the L2CAP socket.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Remove not used struct sock
Gustavo Padovan [Mon, 21 Oct 2013 16:21:37 +0000 (14:21 -0200)]
Bluetooth: Remove not used struct sock

It is a leftover from the recent effort of remove sk usage from L2CAP
core.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Fix enabling fast connectable on LE-only controllers
Johan Hedberg [Mon, 21 Oct 2013 13:51:53 +0000 (16:51 +0300)]
Bluetooth: Fix enabling fast connectable on LE-only controllers

The current "fast connectable" feature is BR/EDR-only, so add a proper
check for BR/EDR support before proceeding with the associated HCI
commands.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agocfg80211: update dfs_state_entered upon dfs_state change
Michal Kazior [Thu, 17 Oct 2013 18:21:12 +0000 (11:21 -0700)]
cfg80211: update dfs_state_entered upon dfs_state change

The timestamp wasn't updated after transitioning
to the NL80211_DFS_USABLE state after NOP time.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: fix DFS channel recovery timeout
Michal Kazior [Thu, 17 Oct 2013 18:21:11 +0000 (11:21 -0700)]
cfg80211: fix DFS channel recovery timeout

The timeout was not properly converted from msecs
to jiffies. As a result channel transition to
NL80211_DFS_USABLE was delayed depending on
CONFIG_HZ configuration, e.g. HZ=100 would delay
the NOP from 30 minutes to 300 minutes.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: fix scheduled scan pointer access
Johannes Berg [Mon, 21 Oct 2013 09:33:35 +0000 (11:33 +0200)]
cfg80211: fix scheduled scan pointer access

Since rdev->sched_scan_req is dereferenced outside the
lock protecting it, this might be done at the wrong
time, causing crashes. Move the dereference to where
it should be - inside the RTNL locked section.

Cc: stable@vger.kernel.org [3.8+]
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoBluetooth: Update Set Discoverable to support LE
Johan Hedberg [Sun, 20 Oct 2013 16:00:07 +0000 (19:00 +0300)]
Bluetooth: Update Set Discoverable to support LE

This patch updates the Set Discoverable management command to also be
applicable for LE. In particular this affects the advertising flags
where we can say "general discoverable" or "limited discoverable".

Since the device flags may not be up-to-date when the advertising data
is written this patch introduces a get_adv_discov_flags() helper
function which also looks at any pending mgmt commands (a pending
set_discoverable would be the exception when the flags are not yet
correct).

The patch also adds HCI_DISCOVERABLE flag clearing to the
mgmt_discoverable_timeout function, since the code was previously
relying on the mgmt_discoverable callback to handle this, which is only
called for the BR/EDR-only HCI_Write_Scan_Enable command.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Move HCI_LIMITED_DISCOVERABLE changes to a general place
Johan Hedberg [Sat, 19 Oct 2013 20:38:22 +0000 (23:38 +0300)]
Bluetooth: Move HCI_LIMITED_DISCOVERABLE changes to a general place

We'll soon be introducing also LE support for the Set Discoverable
management command, so move the HCI_LIMITED_DISCOVERABLE flag clearing
and setting out from the if-branch that is only used for a BR/EDR
specific HCI command.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Fix sending write_scan_enable when BR/EDR is disabled
Johan Hedberg [Sat, 19 Oct 2013 20:38:21 +0000 (23:38 +0300)]
Bluetooth: Fix sending write_scan_enable when BR/EDR is disabled

We should only send the HCI_Write_Scan_Enable command from
mgmt_set_powered_failed() when BR/EDR support is enabled. This is
particularly important when the discoverable setting is also tied to LE.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Move mgmt_pending_find to avoid forward declarations
Johan Hedberg [Sat, 19 Oct 2013 20:38:20 +0000 (23:38 +0300)]
Bluetooth: Move mgmt_pending_find to avoid forward declarations

We will soon need this function for updating the advertising data, so
move it higher up in mgmt.c to avoid a forward declaration.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Fix updating settings when there are no HCI commands to send
Johan Hedberg [Sat, 19 Oct 2013 20:38:19 +0000 (23:38 +0300)]
Bluetooth: Fix updating settings when there are no HCI commands to send

It is possible that the Set Connectable management command doesn't cause
any HCI commands to send (such as when BR/EDR is disabled). We can't
just send a response to user space in this case but must also update the
necessary device flags and settings. This patch fixes the issue by using
the recently introduced set_connectable_update_settings function.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Refactor set_connectable settings update to separate function
Johan Hedberg [Sat, 19 Oct 2013 20:38:18 +0000 (23:38 +0300)]
Bluetooth: Refactor set_connectable settings update to separate function

We will need to directly update the device flags and notify user space
of the new settings not just when we're powered off but also if it turns
out that there are no HCI commands to send (which can happen in
particular when BR/EDR is disabled). Since this is a considerable amount
of code, refactor it to a separate function so it can be reused for the
"no HCI commands to send" case.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Add missing check for BREDR_ENABLED flag in update_class()
Johan Hedberg [Sat, 19 Oct 2013 20:38:17 +0000 (23:38 +0300)]
Bluetooth: Add missing check for BREDR_ENABLED flag in update_class()

We shouldn't be sending the HCI_Write_Class_Of_Device command when
BR/EDR is disabled since this is a BR/EDR-only command.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Check for flag instead of features in update_adv_data()
Johan Hedberg [Sat, 19 Oct 2013 20:38:16 +0000 (23:38 +0300)]
Bluetooth: Check for flag instead of features in update_adv_data()

It's better to check for the device flag instead of device features so
that we avoid unnecessary HCI commands when the feature is supported but
disabled (i.e. the flag is unset).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Check for flag instead of features in update_scan_rsp_data()
Johan Hedberg [Sat, 19 Oct 2013 20:38:15 +0000 (23:38 +0300)]
Bluetooth: Check for flag instead of features in update_scan_rsp_data()

It's better to check for the device flag instead of device features so
that we avoid unnecessary HCI commands when the feature is supported but
disabled (i.e. the flag is unset).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
10 years agoBluetooth: Fix minor coding style issue in hci_core.c
Marcel Holtmann [Sat, 19 Oct 2013 17:19:15 +0000 (10:19 -0700)]
Bluetooth: Fix minor coding style issue in hci_core.c

A few variable assignments ended up with missing a space between the
variable and equal sign.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Fix UUID values in debugfs file
Marcel Holtmann [Sat, 19 Oct 2013 16:31:59 +0000 (09:31 -0700)]
Bluetooth: Fix UUID values in debugfs file

The uuid entry struct is used for the UUID byte stream. That is
actually the wrong value. The correct value is uuid->uuid.

Besides fixing this up, use the %pUb modifier to print the UUID
string. However since the UUID is stored in big endian with
reversed byte order, change the byte order before printing.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Add support for setting DUT mode
Marcel Holtmann [Sat, 19 Oct 2013 14:09:12 +0000 (07:09 -0700)]
Bluetooth: Add support for setting DUT mode

The Device Under Test (DUT) mode is useful for doing certification
testing and so expose this as debugfs option.

This mode is actually special since you can only enter it. Restoring
normal operation means that a HCI Reset is required. The current mode
value gets tracked as a new device flag and when disabling it, the
correct command to reset the controller is sent.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Expose debugfs settings for LE connection interval
Marcel Holtmann [Sat, 19 Oct 2013 14:09:13 +0000 (07:09 -0700)]
Bluetooth: Expose debugfs settings for LE connection interval

For testing purposes expose the default LE connection interval values
via debugfs.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Add support for setting SSP debug mode
Marcel Holtmann [Sat, 19 Oct 2013 14:09:11 +0000 (07:09 -0700)]
Bluetooth: Add support for setting SSP debug mode

Enabling and disabling SSP debug mode is useful for development. This
adds a debugfs entry that allows to configure the SSP debug mode.

On purpose this has been implemented as debugfs entry and not a public
API since it is really only useful during testing and development.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Remove interval parameter from HCI connection
Marcel Holtmann [Sat, 19 Oct 2013 12:26:57 +0000 (05:26 -0700)]
Bluetooth: Remove interval parameter from HCI connection

The conn->interval parameter of HCI connections is not used at all
and so just remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Add LE features to debugfs if available
Marcel Holtmann [Sat, 19 Oct 2013 09:25:33 +0000 (02:25 -0700)]
Bluetooth: Add LE features to debugfs if available

For LE capable controllers at the special LE features page to the
debugfs list with all the other features pages.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Expose setting if debug keys are used or not
Marcel Holtmann [Sat, 19 Oct 2013 00:14:22 +0000 (17:14 -0700)]
Bluetooth: Expose setting if debug keys are used or not

The system can be figured to accept and use debug keys. Expose this
value in debugfs for debugging purposes.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Expose debugfs entry read/write own address type
Marcel Holtmann [Fri, 18 Oct 2013 23:38:10 +0000 (16:38 -0700)]
Bluetooth: Expose debugfs entry read/write own address type

For some testing it is important to know the current own addres type,
but also be able to change it. The change is lost over powery cycles
and only intended for debugging.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Select the own address type during initial setup phase
Marcel Holtmann [Fri, 18 Oct 2013 23:38:09 +0000 (16:38 -0700)]
Bluetooth: Select the own address type during initial setup phase

The own address type is based on the fact if the controller has
a public address or not. This means that this detail can be just
configured once during setup phase.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Expose current list of long term keys via debugfs
Marcel Holtmann [Fri, 18 Oct 2013 22:56:57 +0000 (15:56 -0700)]
Bluetooth: Expose current list of long term keys via debugfs

For debugging purposes expose the current list of long term keys
via debugfs. This file is read-only and limited to root access.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Expose white list size information in debugfs
Marcel Holtmann [Fri, 18 Oct 2013 22:23:46 +0000 (15:23 -0700)]
Bluetooth: Expose white list size information in debugfs

Knowing the white list size information is important for
debugging. So export it via debugfs.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Remove bus attribute in favor of hierarchy
Marcel Holtmann [Fri, 18 Oct 2013 19:39:27 +0000 (12:39 -0700)]
Bluetooth: Remove bus attribute in favor of hierarchy

The bus information are exposed in the actual hierarchy and should
not be exposed as attribute.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Expose current list of link keys via debugfs
Marcel Holtmann [Fri, 18 Oct 2013 19:04:52 +0000 (12:04 -0700)]
Bluetooth: Expose current list of link keys via debugfs

For debugging purposes expose the current list of link keys via
debugfs. This file is read-only and limited to root access.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Move export of class of device information into hci_core.c
Marcel Holtmann [Fri, 18 Oct 2013 19:04:51 +0000 (12:04 -0700)]
Bluetooth: Move export of class of device information into hci_core.c

The class of device debugfs information should be directly exported
from hci_core.c and so move them over there.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Store local version information only during setup phase
Marcel Holtmann [Fri, 18 Oct 2013 19:04:50 +0000 (12:04 -0700)]
Bluetooth: Store local version information only during setup phase

The local version information from the controller can not change
since they are static. So store them only once during setup
phase and not bother overwriting them every time this command
gets executed.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Move manufacturer, hci_ver and hci_rev into hci_core.c
Marcel Holtmann [Fri, 18 Oct 2013 19:04:49 +0000 (12:04 -0700)]
Bluetooth: Move manufacturer, hci_ver and hci_rev into hci_core.c

Move the debugfs entries for manufacturer, hci_ver and hci_rev into
hci_core.c and use the new helpers for static entries that will not
change at runtime. Once passed the setup procedure, they will stay
fixed.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Remove debug entry for connection features
Marcel Holtmann [Fri, 18 Oct 2013 19:04:48 +0000 (12:04 -0700)]
Bluetooth: Remove debug entry for connection features

The debug entry for connection features is incomplete and also does
not work with AMP controllers and physical links. So just remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Add workaround for buggy max_page features page value
Marcel Holtmann [Fri, 18 Oct 2013 19:04:47 +0000 (12:04 -0700)]
Bluetooth: Add workaround for buggy max_page features page value

Some controllers list the max_page value from the extended features
response as 0 when SSP has not yet been enabled. To workaround this
issue, force the max_page value to 1 when SSP support has been
detected.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agoBluetooth: Move HCI device features into hci_core.c
Marcel Holtmann [Fri, 18 Oct 2013 19:04:46 +0000 (12:04 -0700)]
Bluetooth: Move HCI device features into hci_core.c

Move the handling of HCI device features debugfs into hci_core.c and
also extend it with handling of multiple feature pages.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
10 years agort2x00: rt2800pci: use module_pci_driver macro
Gabor Juhos [Thu, 17 Oct 2013 07:42:35 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use module_pci_driver macro

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move SoC specific code into a separate module
Gabor Juhos [Thu, 17 Oct 2013 07:42:34 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move SoC specific code into a separate module

The PCI and SoC specific drivers are using separate
code now so it is not reasonable to use the same
module for both drivers anymore.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use separate hwcrypt_disabled callback for SoC devices
Gabor Juhos [Thu, 17 Oct 2013 07:42:33 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use separate hwcrypt_disabled callback for SoC devices

The 'rt2800pci_hwcrypt_disabled' function is the
only PCI specific callback which is used by the
SoC driver. Create a clone of that to get rid of
the dependency.

Even though the two functions are using the same
variable, but the SoC specific code will be moved
into a separate module which will have its own
'modparam_nohwcrypt' variable.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move rt2800mmio_enable_radio function to another module
Gabor Juhos [Thu, 17 Oct 2013 07:42:32 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move rt2800mmio_enable_radio function to another module

Move the function into the rt2800mmio module, in order
to make it usable from other modules.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: split rt2800pci_enable_radio function
Gabor Juhos [Thu, 17 Oct 2013 07:42:31 +0000 (09:42 +0200)]
rt2x00: rt2800pci: split rt2800pci_enable_radio function

The function is called for PCI and SoC devices
however the MCU related part of the function
has no effect on SoC devices. Move the common
part of the function into a separate helper and
use that for the SoC devices.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: rename rt2800pci_disable_radio function
Gabor Juhos [Thu, 17 Oct 2013 07:42:30 +0000 (09:42 +0200)]
rt2x00: rt2800pci: rename rt2800pci_disable_radio function

The function contain code for SoC devices only.
Rename the function to 'rt2800soc_disable_radio'
and move it to the SoC specific section. Use
the renamed function in the SoC specific code
only and remove the 'if rt2x00_is_soc(rt2x00dev)'
condition from the function body.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use separate set_state callback for SoC devices
Gabor Juhos [Thu, 17 Oct 2013 07:42:29 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use separate set_state callback for SoC devices

The 'rt2800pci_set_state' function uses MCU commands
to set the device state, however these have no effect
on SoC devices. Use a different set_state callback
which does not use the MCU fcuntions.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use separate firmware callbacks for SoC devices
Gabor Juhos [Thu, 17 Oct 2013 07:42:28 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use separate firmware callbacks for SoC devices

Use empty firmware callbacks for SoC devices because those
don't require firmware.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use separate read_eeprom callback for SoC devices
Gabor Juhos [Thu, 17 Oct 2013 07:42:27 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use separate read_eeprom callback for SoC devices

Rename the 'rt2800pci_read_eeprom_soc function' to
'rt2800soc_read_eeprom' and use that directly in the
SoC specific 'rt2800_ops' structure. Also move the
'rt2800pci_eeprom_read' function into an 'ifdef PCI'
section and remove the 'rt2800pci_read_eeprom_soc'
call from that.

Additionally, remove the dummy inline eeprom functions.
Those are not used anymore.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use separate ops for the SoC driver
Gabor Juhos [Thu, 17 Oct 2013 07:42:26 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use separate ops for the SoC driver

This makes it possible to use different callback
functions for PCI and SoC devices which will allow
to move the SoC driver into a separate module.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move initialization functions to the rt2800mmio module
Gabor Juhos [Thu, 17 Oct 2013 07:42:25 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move initialization functions to the rt2800mmio module

Move the functions into a separate module, in order
to make those usable from other modules.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use rt2800mmio prefix for initialization functions
Gabor Juhos [Thu, 17 Oct 2013 07:42:24 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use rt2800mmio prefix for initialization functions

The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move queue functions to the rt2800mmio module
Gabor Juhos [Thu, 17 Oct 2013 07:42:23 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move queue functions to the rt2800mmio module

Move the functions into a separate module, in order
to make those usable from other modules. Also move
the queue register offset macros from rt2800pci.h
into rt2800mmio.h.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use rt2800mmio prefix for queue functions
Gabor Juhos [Thu, 17 Oct 2013 07:42:22 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use rt2800mmio prefix for queue functions

The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move interrupt functions to the rt2800mmio module
Gabor Juhos [Thu, 17 Oct 2013 07:42:21 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move interrupt functions to the rt2800mmio module

Move the functions into a separate module, in order
to make those usable from other modules.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use rt2800mmio prefix for interrupt functions
Gabor Juhos [Thu, 17 Oct 2013 07:42:20 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use rt2800mmio prefix for interrupt functions

The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move RX control handler functions to the rt2800mmio module
Gabor Juhos [Thu, 17 Oct 2013 07:42:19 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move RX control handler functions to the rt2800mmio module

Move the functions into a separate module, in order
to make those usable from other modules. Also move
the RX descriptor related defines from rt2800pci.h
into rt2800mmio.h

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use rt2800mmio prefix for RX control handler functions
Gabor Juhos [Thu, 17 Oct 2013 07:42:18 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use rt2800mmio prefix for RX control handler functions

The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: move TX descriptor functions to the rt2800mmio module
Gabor Juhos [Thu, 17 Oct 2013 07:42:17 +0000 (09:42 +0200)]
rt2x00: rt2800pci: move TX descriptor functions to the rt2800mmio module

Move the functions into a separate module, in order
to make those usable from other modules. Also move
the TX descriptor related defines from rt2800pci.h
into rt2800mmio.h.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800pci: use rt2800mmio prefix for TX descriptor functions
Gabor Juhos [Thu, 17 Oct 2013 07:42:16 +0000 (09:42 +0200)]
rt2x00: rt2800pci: use rt2800mmio prefix for TX descriptor functions

The functions are used for devices with memory
mapped I/O and contain no PCI specific code at
all. Use rt2800mmio prefix instead of rt2800pci
in the function names to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: create a new module for rt2800 MMIO code
Gabor Juhos [Thu, 17 Oct 2013 07:42:15 +0000 (09:42 +0200)]
rt2x00: create a new module for rt2800 MMIO code

Create a new module for common code which can be used
for rt2800 device with memory mapped I/O. It is an empty
module for now, but it will be populated by subsequent
patches.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agodrivers: net: wireless: Fix wrong check for reassociation request retry counter
Felipe Pena [Wed, 16 Oct 2013 00:07:47 +0000 (21:07 -0300)]
drivers: net: wireless: Fix wrong check for reassociation request retry counter

There is a typo where the checking for priv->ReAssociationRequestRetryCnt must
be, it was checking for priv->AssociationRequestRetryCnt instead.

Signed-off-by: Felipe Pena <felipensp@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support
Arend van Spriel [Tue, 15 Oct 2013 13:44:57 +0000 (15:44 +0200)]
brcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support

If the SDIO host controller does not support scatter-gather the glom
superframe must be transfered from the device and the data for each
packet in the queue must be extracted from it.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: fix brcmf_sdio_txpkt_prep() for host without sg support
Arend van Spriel [Tue, 15 Oct 2013 13:44:56 +0000 (15:44 +0200)]
brcmfmac: fix brcmf_sdio_txpkt_prep() for host without sg support

When running on a host controller that does not support scatter-gather
transfers the function brcmf_sdio_txpkt_prep() should not add tail
padding buffers.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: fix brcmf_sdcard_send_pkt() for host without sg support
Arend van Spriel [Tue, 15 Oct 2013 13:44:55 +0000 (15:44 +0200)]
brcmfmac: fix brcmf_sdcard_send_pkt() for host without sg support

If the host does not support scatter-gather transmit the packets
in the pktq individually using brcmf_sdio_buffrw().

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove stale code from brcmf_sdcard_recv_chain()
Arend van Spriel [Tue, 15 Oct 2013 13:44:54 +0000 (15:44 +0200)]
brcmfmac: remove stale code from brcmf_sdcard_recv_chain()

The function brcmf_sdcard_recv_chain() has been reworked with
commit "brcmfmac: add sdio sg list support", but the incr_fix
variable is only assigned but not used so removing it now.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: verify result of brcmf_sdio_addrprep() calls
Arend van Spriel [Tue, 15 Oct 2013 13:44:53 +0000 (15:44 +0200)]
brcmfmac: verify result of brcmf_sdio_addrprep() calls

Not all calls to the function brcmf_sdio_addrprep() check
the return value, but it may fail so better verify it.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: rework single packet transfers
Arend van Spriel [Tue, 15 Oct 2013 13:44:52 +0000 (15:44 +0200)]
brcmfmac: rework single packet transfers

The function brcmf_sdio_sglist_rw() does a different code path
when packet queue length is 1. Move this to a separate function
reducing overhead in the calling context.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: rename brcmf_sdio_buffrw()
Arend van Spriel [Tue, 15 Oct 2013 13:44:51 +0000 (15:44 +0200)]
brcmfmac: rename brcmf_sdio_buffrw()

The function brcmf_sdio_buffrw() is intended to be used for
transfering list of packets using scatter-gather functionality.
Rename function to brcmf_sdio_sglist_rw() to clarify this.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: rework scatter-gather code in brcmf_sdio_buffrw()
Arend van Spriel [Tue, 15 Oct 2013 13:44:50 +0000 (15:44 +0200)]
brcmfmac: rework scatter-gather code in brcmf_sdio_buffrw()

Moving a number of assignments outside of the loop as they are
the same for each request.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: determine host controller related variables during probe
Arend van Spriel [Tue, 15 Oct 2013 13:44:49 +0000 (15:44 +0200)]
brcmfmac: determine host controller related variables during probe

Instead of determining the limits for scatter-gather MMC transfer
request upon each transmit it is now determined during the probe
of the SDIO function.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: rename variable max_seg_sz to max_seg_cnt for clarity
Arend van Spriel [Tue, 15 Oct 2013 13:44:48 +0000 (15:44 +0200)]
brcmfmac: rename variable max_seg_sz to max_seg_cnt for clarity

The variable max_seg_sz in brcmf_sdio_buffrw() respresents the maximum
number of buffers that can be sent in one MMC transfer request. Rename
it to max_seg_cnt to avoid confusion.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: add tracepoint for capturing the SDPCM header
Arend van Spriel [Tue, 15 Oct 2013 13:44:47 +0000 (15:44 +0200)]
brcmfmac: add tracepoint for capturing the SDPCM header

Having the SDPCM header information in the traces is a valuable
piece of information.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: store address in trace_brcmf_hexdump()
Arend van Spriel [Tue, 15 Oct 2013 13:44:46 +0000 (15:44 +0200)]
brcmfmac: store address in trace_brcmf_hexdump()

The trace function trace_brcmf_hexdump() stores the length, but
having the address of the buffer being dumped helps putting it
in context.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: add TX99 support
Luis R. Rodriguez [Tue, 15 Oct 2013 00:42:11 +0000 (17:42 -0700)]
ath9k: add TX99 support

TX99 support enables Specific Absorption Rate (SAR) testing.
SAR is the unit of measurement for the amount of radio frequency(RF)
absorbed by the body when using a wireless device. The RF
exposure limits used are expressed in the terms of SAR, which is a
measure of the electric and magnetic field strength and power density
for transmitters operating at frequencies from 300 kHz to 100 GHz.

Regulatory bodies around the world require that wireless device
be evaluated to meet the RF exposure limits set forth in the
governmental SAR regulations.

In the examples below, for more bit rate options see the iw TX bitrate
setting documentation:

http://wireless.kernel.org/en/users/Documentation/iw#Modifying_transmit_bitrates

Example usage:

iw phy phy0 interface add moni0 type monitor
ip link set dev moni0 up

iw dev moni0 set channel 36 HT40+
iw set bitrates mcs-5 4

echo 10 > /sys/kernel/debug/ieee80211/phy0/ath9k/tx99_power
echo 1  > /sys/kernel/debug/ieee80211/phy0/ath9k/tx99

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: check for NULL rate when using ieee80211_get_rts_cts_rate()
Luis R. Rodriguez [Tue, 15 Oct 2013 00:42:10 +0000 (17:42 -0700)]
ath9k: check for NULL rate when using ieee80211_get_rts_cts_rate()

ieee80211_get_rts_cts_rate() can return NULL, so don't rely
on its members when it does return NULL.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath: add support for proper dynamic regulatory hints
Luis R. Rodriguez [Tue, 15 Oct 2013 00:42:09 +0000 (17:42 -0700)]
ath: add support for proper dynamic regulatory hints

This enables support for dynamic user regulatory hints.
This is enabled only when CFG80211_CERTIFICATION_ONUS
is selected. For US and JP this is explicitly disabled
unless the systems are being used for strict controlled
testing.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath: split user and driver reguluatory hint parsing
Luis R. Rodriguez [Tue, 15 Oct 2013 00:42:08 +0000 (17:42 -0700)]
ath: split user and driver reguluatory hint parsing

On the regulatory notifier split up the parsing of the
hints coming from drivers or user. We'll treat these
separately.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>