Jes Sorensen [Fri, 9 May 2014 13:03:31 +0000 (15:03 +0200)]
staging: rtl8723au: validate_recv_data_frame() use fctl knowledge to obtain bssid
Use the knowledge we already have from parsing the TODS/FROMDS bits in
hdr->frame_control to obtain the bssid.
Note that get_hdr_bssid() would never return NULL as handling 4
combinations of a 2 bit word leaves little space for falling through
to the 'default' value.
Jes Sorensen [Fri, 9 May 2014 13:03:21 +0000 (15:03 +0200)]
staging: rtl8723au: Eliminate struct qos_priv
Having struct qos_priv containing a single integer, and carrying a
dedicated header file for it, is just plain silly. Move the integer
into struct mlme_priv, which is the only place qos_priv was used
anyway, and get rid of the header file.
Jes Sorensen [Fri, 9 May 2014 13:03:14 +0000 (15:03 +0200)]
staging: rtl8723au: Use workqueue to handle interrupt complete processing
Split the old work handler into a workqueue for processing
usb_read_interrupt_complete() events that require more than ust
clearing the event, and leave the old handler to just handle event
clearing.
This means we can get rid of the hacks with magic pointers to
determine what actions needs to be taken in the work handler, and
as an extra bonus obsoletes the bizarre cbuf code.
Jes Sorensen [Fri, 9 May 2014 13:03:10 +0000 (15:03 +0200)]
staging: rtl8723au: pass the cmd parm buffer directly to the cmd handler
commit 0348dc74f6689825c16db40fbe0ce6ad2da5bab9 ensured that the parm
buffer passed to the cmd handlers is not being over-written. Hence
there is no need to make a copy of the parm buffer just to pass it
into the cmd handler.
Merge tag 'iio-for-3.16b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of IIO new drivers, cleanups and functionality for the 3.16 cycle.
This set contains a change to the ABI for the hid-sensors drivers to bring them
in line with the long published documentation. Unfortunately, rather than
reporting true scale and offset values via sysfs they were reporting
some magic numbers that could only be converted to anything useful using
the HID sensors specification. I missed this entirely through the introduction
of a number of drivers, only picking up on it recently. Srinivas has had
user feedback about this as well. The patch set is too large to go as a fix
at this stage in the cycle and is not a regression fix as this was never
right and so will have to wait for the next merge window. Srinivas assures
me that there are relatively few pieces of hardware out there and he has
had a number of people contact him to point out that the drivers did not
obey the ABI. Hence hopefully the fallout of this, if any will be minor.
If we don't fix it now, it will only get worse going forward. There is no
sensible way of maintaining the incorrect ABI as it is simply returning
the wrong values through the standard interfaces.
Non IIO elements
* Introduce devm_kmemdup. Does what it says on the tin.
New drivers:
* hid-sensors rotation devices (output as quaternion)
* Freescale MPL115A2 presure and temperature sensor.
* Melexis mlx90614 contactless infrared sensor.
* Freescale MMA8452Q 3-axis accelerometer.
New functionality:
* Addition of multiple element callback to allow for sysfs interfaces to access
elements such as quaternions which have no useful meaning if all 4 elements
are not presented together. Other future usecases for this include
rotation matrices.
* Support for multiple element buffer entries for exactly the same uses as
the sysfs related elements described above.
* Quaternion support via the quaternion IIO modifier.
* TEMP_AMBIENT and TEMP_OBJECT modifiers to distinguish cases with thermopile
devices.
* hid-sensors gain sysfs access to the sensor readings. Previously these
drivers used the buffered interface only. This change involves some
additional hid-sensors core support to read poll values back from the devices
to allow the drivers to know roughly how long to wait for a result when
polling the sensor. There is also an associated hid-sensors abi to allow
the devices to be turned off between reads and powered up on demand.
Cleanups and fixes
* Hid sensors fix as described above. Result is to make the _scale and _offset
attributes applicable in the same way as for all other IIO drivers.
* Some additional documentation - mostly covering stuff that graduated from
staging without managing to take it's ABI docs with it.
* A series of little tidy ups to the exynos_adc driver that make the code
nicer to read and improve handling of some corner cases.
* A tidy up to mag3110 (logical fix rather than a real one ;). Also enable
user offset calibration for this device.
* Drop some left over IS_ERR() checks from ad799x that snuck through during
the cleanup in the last IIO patch set.
* Fix a naming issue from clashing patches in ak8975 - note the clash only
occured in the last IIO patch set, hence the fix needs to go through this
tree.
* A format string missmatch fix in ad7280.c. Unlikely to have ever had an
impact so not worth rushing through.
Added an API to allow client drivers to turn ON and OFF sensors for
quick read. Added data_read as counting varaible instead of boolean,
so that sensor is powered off only when last user released it.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Added interface to get poll value in milli-seconds. This value is
changed by changing sampling frequency. This API allows clients
to wait for at least some poll milli seconds before reading a new sample.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
HID sensor hub specify a default unit and alternative units. This
along with unit exponent can be used adjust scale. This change
change HID sensor data units to IIO defined units for each
sensor type. So in this way user space can use a simply use:
"(data + offset) * scale" to get final result.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
navin patidar [Sat, 3 May 2014 11:45:26 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'irp_pending' from struct recv_buf
irp_pending is initialized to false inside rtw_os_recvbuf_resource_alloc()
and value of irq_pending never changed after that, so 'if (!precvbuf->irp_pending)'
inside rtw_os_read_port() function will be always true.
staging/rtl8192e: Erroneous return codes (types and values)
This function returns a bool, that is supposed to be false when something
goes wrong. It's assumed this way by its lone calling function (which is
SetRFPowerState8190(), line 1445 of rtl8192e/rtl8192e/r8192E_phy.c)
Despite of this, this procedure returns non-null enumerations values or
negative codes instead. This patch fixes this.
Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 2 May 2014 12:50:14 +0000 (13:50 +0100)]
staging: comedi: remove async parameter from resize_async_buffer()
The `struct comedi_async *async` parameter of `resize_async_buffer()` is
redundant as its value can be easily derived from the `struct
comedi_subdevice *s` parameter as `s->async`. Remove the parameter.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 2 May 2014 12:50:13 +0000 (13:50 +0100)]
staging: comedi: remove redundant pointer dereference in comedi_poll()
`s->async->subdevice` in `comedi_poll()` points to the same `struct
comedi_subdevice` as `s`, so the double pointer reference is redundant.
Just use `s`.
(`s->async->subdevice` is initialized by
`__comedi_device_postconfig_async()` in
"drivers/staging/comedi/drivers.c" and doesn't change.)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Thu, 1 May 2014 16:38:24 +0000 (17:38 +0100)]
staging: comedi: amplc_dio200_common: correct bound on counter mode
For the mode configured by the `INSN_CONFIG_SET_COUNTER_MODE` comedi
instruction for the counter subdevice channels supported by this module,
the upper bound should be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1)
rather than `I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0). Fix it.
Reported-by: Hartley Sweeten <HartleyS@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Thu, 1 May 2014 16:38:23 +0000 (17:38 +0100)]
staging: comedi: drivers: correct mode check for i8254_set_mode()
The upper bound check on the `mode` parameter of `i8254_set_mode()` and
`i8254_mm_set_mode()` is incorrect. The `mode` parameter value consists
of a mode number in the range 0 to 5 in bits 3..1 {represented by the
constants `I8254_MODE0` (0 << 1) through to `I8254_MODE5` (2 << 1)} ORed
with a BCD/binary flag in bit 0 {represented by the constants
`I8254_BINARY` (0) and `I8254_BCD` (1)}. The maximum allowed value
ought to be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1), but is currently
`I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0). Fix it.
None of the comedi drivers use `I8254_BCD` but some of the low-level
drivers allow user-space to configure the counter mode, so all legal
values ought to be allowed. However, it's pretty unlikely anyone would
want to set the counters to count in BCD (binary coded decimal) so the
bug is not that significant.
Reported-by: Hartley Sweeten <HartleyS@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".
The labpc_counter_load() function in this driver is passed an
I8254_MODE* value so we need to use the i8254_set_mode() and
i8254_write() helpers instead of i8254_load() to program the
timers.
The calls to labpc_counter_load() will not fail so change the
return to void and remove all the unnecessary error handling.
Similarly, change the return type of labpc_counter_set_mode() to
void and remove the unnecessary error handling.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
The das800_set_frequency() function will not fail. For aesthetics
change the return to a void and remove the error handling.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
Also, use the CR_CHAN() macro to make sure the only the channel is
used in the insh->chanspec to specify the counter number.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".
Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.
For aesthetics, factor the timer programming out as a separate
function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This private data member is set when an analog input async command is
started by apci3120_cyclic_ai() and cleared when the command finishes
or is canceled.
Rename the CamelCase member to 'ai_running' and convert it to a
bit-field flag.
Remove the unnecessary clearing of the flag before or after calling
apci3120_cancel().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_common.h: remove 'b_AiContinuous' from private data
This member of the private data can be determined by checking the cmd->stop_src.
Do that instead.
Fix the b_AiContinuous check in apci3120_ai_cmd(). The (*do_cmdtest) validates
that the cmd->stop_arg os >= 1 for TRIG_COUNT and 0 for TRIG_NONE. The correct
test to set this flag is (cmd->stop_src == TRIG_NONE).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_common.h: remove 'ui_AiNbrofScans' from private data
This member of the private data is a copy of the cmd->stop_arg. Use that
instead.
Fix the b_AiContinuous check in apci3120_ai_cmd(). The (*do_cmdtest) validates
that the cmd->stop_arg os >= 1 for TRIG_COUNT and 0 for TRIG_NONE. The correct
test to set this flag is (cmd->stop_src == TRIG_NONE).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_common.h: remove 'ui_AiScanLength' from private data
This member of the private data is a copy of the cmd->scan_end_arg. Use that
instead.
Use a local variable in apci3120_cyclic_ai() for the DMA 'scan_bytes', which
is the cmd->scan_end_arg * 2. Replace the open-coded '2' with sizeof(short).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci9111: tidy up (*do_cmdtest) Step 4
This step in the (*do_cmdtest) fixes the comedi_cmd arguments, usually
for TRIG_TIMER sources.
Tidy up this step to clarify the code and remove the extra local
variables. All the arguments are unsigned long so change the 'tmp'
local variable type and rename it for aesthetics.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: 8253.h: remove the unused i8253_cascade_ns_to_timer_*()
None of the comedi drivers use the i8253_cascade_ns_to_timer_2div_old()
or i8253_cascade_ns_to_timer_power() helpers to calculate the cascaded
divisors. Remove them to avoid any confusion.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>