1
0
Fork 0
Commit Graph

468506 Commits (d953ada493711363d5b7f2151100c242923fc56b)

Author SHA1 Message Date
Mark A. Greer d953ada493 NFC: trf7970a: Document the 'irq-status-read-quirk' DT property
The mechanism for specifying that the trf7970a
being used by the driver has the "IRQ Status Read"
erratum has been changed to a device tree property
('irq-status-read-quirk').

Document the new device tree property.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-09-01 00:06:55 +02:00
Mark A. Greer 772079eb77 NFC: trf7970a: Move IRQ Status Read quirk to device tree
The quirk indicating whether the trf7970a has
the "IRQ Status Read" erratum or not is currently
implemented using the 'driver_data' member of the
'spi_device_id' structure.  That requires the
driver to be modified to turn the quirk off when
a version of the trf7970a that doesn't have the
erratum is being used.  To fix that, create a
new device tree property called
'irq-status-read-quirk' that indicates that the
trf7970a being used has the erratum.

While at it, rename 'TRF7970A_QUIRK_IRQ_STATUS_READ_ERRATA'
to 'TRF7970A_QUIRK_IRQ_STATUS_READ' to make it
less of an eyesore.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-09-01 00:06:55 +02:00
Mark A. Greer c2b33de06d NFC: trf7970a: Document the 'vin-voltage-override' DTS property
The trf7970a driver recently had support for the
'vin-voltage-override' property added to it.  This
property is used to override the value given by
the regulator subsystem for the VIN pin's voltage.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-09-01 00:06:55 +02:00
Mark A. Greer 3bd14233aa NFC: trf7970a: Add VIN voltage override support
The trf7970a driver uses the voltage from the
power/regulator subsystem to determine what the
voltage on the VIN pin is.  Normally, this is
the right thing to do but sometimes the board
that the trf7970a is on may change the voltage.
This is the case for the trf7970atb board from
Texas Instruments where it boosts the VIN voltage
from 3.3V to 5V (see http://www.ti.com/tool/trf7970atb).

To handle this, add support for the 'vin-voltage-override'
device tree property which overrides the voltage value
given by the regulator subsystem.  When the DT property
is not present, the value from the regulator subsystem
is used.

The value of 'vin-voltage-override' is in uVolts.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-09-01 00:06:55 +02:00
Mark A. Greer dddb3da046 NFC: digital: Add Inititor-side PSL support
In order to operate at the fasted bit rate
possible, add initiator-side support for
PSL REQ while in P2P mode.  The PSL REQ
will switch the RF technology to 424F
whenever possible.

Reviewed-by: Thierry Escande <thierry.escande@linux.intel.com>
Tested-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-08-31 22:15:37 +02:00
Andreea-Cristina Bernat 6a5d088a92 carl9170: tx: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
According to RCU_INIT_POINTER()'s block comment 3.a, it can be used if
"3.   The referenced data structure has already been exposed to readers either
at compile time or via rcu_assign_pointer() -and-
 a.   You have not made -any- reader-visible changes to this structure since
then".

This case fulfills the conditions above because between the rcu_dereference()
call (cvif = rcu_dereference(ar->beacon_iter);) and the rcu_assign_pointer()
call there is no update of the "cvif" variable.
Therefore, this patch makes the replacement.

The following Coccinelle semantic patch was used:
@@
identifier v;
@@

v = rcu_dereference(...);
... when != rcu_dereference(...);
    when != v = ...;
    when != (<+...v...+>)++;
    when != \(memcpy\|memset\)(...);
(
- rcu_assign_pointer
+ RCU_INIT_POINTER
  (..., v);
|
 if(...) {
... when != v = ...;
- rcu_assign_pointer
+ RCU_INIT_POINTER
  (..., v);
... when any
 }
)

Because there are cases where between a “rcu_dereference()” call and a
“rcu_assign_pointer()” call might be updates of the value that interests us,
the Coccinelle semantic patch ignores them and replaces with
"RCU_INIT_POINTER()" only when the update is not happening.

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:50:13 -04:00
Sujith Manoharan 1a7c5b7ef0 ath9k: Fix channel context timer
Setup the channel context correctly. Not doing this was
causing beacon loss in a P2P-GO/STA concurrent setup.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:50:13 -04:00
Sujith Manoharan 878066e745 ath9k: Add more debug statements for channel context
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:50:12 -04:00
Sujith Manoharan 9ea3598b22 ath9k: Disable fastcc for channel context mode
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:39 -04:00
Canek Peláez Valdés ac0372abf8 rt2x00: support Ralink 5362.
Signed-off-by: Canek Peláez Valdés <canek@ciencias.unam.mx>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:39 -04:00
Sujith Manoharan 4c7e9aee2d ath9k: Fix channel context creation
If a new context is being added in addition to the current one,
then send the ASSIGN event to abort a running scan since
the addition of a context is usually followed by VIF
assignment and further operations.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:39 -04:00
Sujith Manoharan 86162d497d ath9k: Fix interface limits
There is no reason why managed/p2p interfaces have to
be limited to one. IBSS is the only type that needs
a restriction.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:39 -04:00
Sujith Manoharan 5a8cbec7fb ath9k: Print the event/state in ath_chanctx_event
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:39 -04:00
Sujith Manoharan 02da18b7ec ath9k: Add new chanctx events
This will be useful in handling addition/change of new
channel contexts.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:39 -04:00
Sujith Manoharan 6e47fafbc3 ath9k: Fix ath_chanctx_get()
Move it inside a CONFIG_ATH9K_CHANNEL_CONTEXT ifdef
since it is not needed otherwise.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan 11e39a4e05 ath9k: Move ath9k_beacon_add_noa to channel.c
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan 7d876174e7 ath9k: Remove redundant ifdef
This was introduced in an earlier patch to handle
a compilation warning, but since the channel context
code has been mostly isolated, this is not required now.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan fb02e95c9b ath9k: Fix channel context variables in ath_softc
chanctx_work and next_chan are required only when
CONFIG_ATH9K_CHANNEL_CONTEXT is enabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan 77843167a9 ath9k: Fix 'offchannel' in ath_softc
Finally move the 'offchannel' instance in ath_softc
inside a CONFIG_ATH9K_CHANNEL_CONTEXT cage. The offchannel
usage in ath9k_calculate_iter_data() is closed off with
an ifdef for now, since the state/opmode calculation is
common for both the channel context mode and the normal mode.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan 4b93fd297f ath9k: Fix function argument type
ath9k_vif_iter() was earlier used as an iterator
routine when calling a mac80211 utility. This is no
longer the case and hence we can mention the argument
type explicitly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan a09798f4ab ath9k: Use ath_chanctx_check_active properly
ath_chanctx_check_active() is required only when channel contexts
are used. Make sure that it is not called in normal usage.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:38 -04:00
Sujith Manoharan e90e302a15 ath9k: Add ath9k_offchannel_init
This patch adds a routine to setup the offchannel
instance in ath_softc.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 0e08b5fb81 ath9k: Add ath9k_chanctx_wake_queues
Introduce a function that handles queues in channel
context mode.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 70b06dacfe ath9k: Add wrappers for beacon events
Using these wrappers allows us to move the 'sched'
variable in ath_softc inside CONFIG_ATH9K_CHANNEL_CONTEXT.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 73b5ef0bbf ath9k: Fix function declarations
These routines are required only when
CONFIG_ATH9K_CHANNEL_CONTEXT is enabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 27babf9f47 ath9k: Fix channel context events
Check if channel context usage is enabled before
calling ath_chanctx_event() from various parts of the
driver. Also, make sure that ath_chanctx_event() is
compiled only when CONFIG_ATH9K_CHANNEL_CONTEXT is
enabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 922c943dcc ath9k: Make ath_chanctx_switch static
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 98f411b803 ath9k: Make ath_chanctx_get_oper_chan static
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:37 -04:00
Sujith Manoharan 344ae6abd0 ath9k: Make ath_chanctx_offchan_switch static
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan 22dc0deb1f ath9k: Conditionally compile more functions
Use CONFIG_ATH9K_CHANNEL_CONTEXT to exclude:

ath_scan_complete()
ath_roc_complete()
ath_offchannel_next()
ath_scan_next_channel()
ath_scan_channel_duration()

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan 55254eeaca ath9k: Exclude more functions
Use CONFIG_ATH9K_CHANNEL_CONTEXT to exclude more functions:

ath_offchannel_channel_change()
ath_scan_channel_start()
ath_scan_send_probe()

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan 6d7cbd7790 ath9k: Conditionally compile a few functions
Exclude these functions when CONFIG_ATH9K_CHANNEL_CONTEXT is not
enabled:

ath_chanctx_send_vif_ps_frame()
ath_chanctx_send_ps_frame()
ath_chanctx_defer_switch()
ath_chanctx_set_next()

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan e20a854ed3 ath9k: Cleanup mgd_prepare_tx callback
Rename the callback from ath9k_chanctx_force_active()
to ath9k_mgd_prepare_tx(). Also, move it to main.c and
group it with the other callbacks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan 0e62f8b706 ath9k: Make ath_chanctx_work static
Also compile it conditionally based on
CONFIG_ATH9K_CHANNEL_CONTEXT.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan ea22df29a3 ath9k: Add a routine to tear down channel contexts
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:36 -04:00
Sujith Manoharan 705d0bf83d ath9k: Add a routine for initializing channel contexts
Setup the offchannel/sched timers and the chanctx work
inside the new function.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:35 -04:00
Andreea-Cristina Bernat 69e2a77170 carl9170: Remove redundant protection check
The carl9170_op_ampdu_action() function is used only by the mac80211
framework.
Since the mac80211 already takes care of checks and properly serializing
calls to the driver's function there is no need for the driver to do the same
thing.

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:49:35 -04:00
Sujith Manoharan 499afaccf6 ath9k: Isolate ath9k_use_chanctx module parameter
This patch ensures that the module parameter "use_chanctx" is
visible only when CONFIG_ATH9K_CHANNEL_CONTEXT is selected.
Also register the channel context callbacks with mac80211 only
when it is explicitly enabled and compile them out of the driver
when CONFIG_ATH9K_CHANNEL_CONTEXT is not selected.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:58 -04:00
Sujith Manoharan c7dd40c92a ath9k: Isolate P2P powersave routines
Use CONFIG_ATH9K_CHANNEL_CONTEXT to conditionally
compile P2P-PS code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:58 -04:00
Sujith Manoharan 2471adff1f ath9k: Move P2P functions to channel.c
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:58 -04:00
Sujith Manoharan 0e721bd061 ath9k: Add a config option for channel context
Channel contexts are supported only for P2P right now,
so make sure that the 'normal' path remains unaffected
by using a config option. This will also reduce the size
of the driver.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:57 -04:00
Sujith Manoharan bc81d43ad2 ath9k: Add debug information
Add a few statements to debug channel context operation.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:57 -04:00
Sujith Manoharan dfcbb3e8f4 ath9k: Move channel operations to channel.c
This reduces clutter in main.c

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:57 -04:00
Sujith Manoharan 4f6816913f ath9k: Handle failure to allocate HW timer
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:57 -04:00
Sujith Manoharan 27328a75da ath9k: Add a debug level for channel context
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:57 -04:00
Bob Copeland dcb784050a ath5k: remove redundant null check before kfree()
kfree() null-checks its argument.
Found by smatch.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:57 -04:00
Bob Copeland daf9669bea ath5k: ensure led name is null terminated
Add the missing null termination after strncpy().

This isn't actually a buffer overflow in this case since we use
snprintf() appropriately to fill the buffer passed by the caller,
but in the interest of not turning this into a bug down the road,
go ahead and force termination here.

Found by Coverity.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:56 -04:00
Bob Copeland e6938ea4d5 ath5k: drop useless comparison
rxs->rate_idx is unsigned, so it will always be >= 0.
Found by Coverity.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:56 -04:00
Rasmus Villemoes c94c3c5e5e ray_cs: Add include guards
The files ray_cs.h and rayctl.h both contain two thirds of what
appears to be an include guard using the macro name RAYLINK_H (both
lack the #define). Since RAYLINK_H is not defined anywhere, the
#ifndefs are confusing no-ops. Add proper include guards using
different macro names.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:56 -04:00
Hauke Mehrtens ecf47e9bb7 bcma: only map wrapper if its address is available
The Chipcommon B core does not have a wrap address and it would fail here.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28 14:41:56 -04:00