Commit Graph

915643 Commits

Author SHA1 Message Date
Andy Shevchenko
df6e71256c iio: pressure: bmp280: Explicitly mark GPIO optional
Show by using a corresponding API call that GPIO is optional.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:19 +01:00
Andy Shevchenko
6085102c49 iio: pressure: bmp280: Convert to use ->read_avail()
Convert to use ->read_avail() instead of open-coded attribute handling.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:19 +01:00
Andy Shevchenko
97b31a6f5f iio: pressure: bmp280: Tolerate IRQ before registering
With DEBUG_SHIRQ enabled we have a kernel crash

[  116.482696] BUG: kernel NULL pointer dereference, address: 0000000000000000

...

[  116.606571] Call Trace:
[  116.609023]  <IRQ>
[  116.611047]  complete+0x34/0x50
[  116.614206]  bmp085_eoc_irq+0x9/0x10 [bmp280]

because DEBUG_SHIRQ mechanism fires an IRQ before registration and drivers
ought to be able to handle an interrupt happening before request_irq() returns.

Fixes: aae9539496 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:18 +01:00
Wolfram Sang
b5fbf0568c iio: imu: inv_mpu6050: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:18 +01:00
Nishant Malpani
9623473cbb iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:18 +01:00
Nishant Malpani
02566b459f iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:18 +01:00
Nishant Malpani
fb3f7ab773 iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:17 +01:00
Nishant Malpani
35c9c8d5ec iio: imu: bmi160_spi: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:17 +01:00
Nishant Malpani
6e924c526a iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:16 +01:00
Nishant Malpani
0e5fd38765 iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:16 +01:00
Nishant Malpani
df91cf5c28 iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:16 +01:00
Nishant Malpani
442140989f iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:15 +01:00
Nishant Malpani
f0bd45fea3 iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:15 +01:00
Alexandru Ardelean
1cfe38fc40 iio: adc: ad7793: use read_avail iio hook for scale available
This change uses the read_avail and '.info_mask_shared_by_type_available'
modifier to set the available scale.
Essentially, nothing changes to the driver's ABI.

The main idea for this patch is to remove the AD7793 driver from
checkpatch's radar. There have been about ~3 attempts to fix/break the
'in_voltage-voltage_scale_available' attribute, because checkpatch assumed
it to be an arithmetic operation and people were trying to change that.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:15 +01:00
Lars-Peter Clausen
b7329249ea iio: buffer: Don't allow buffers without any channels enabled to be activated
Before activating a buffer make sure that at least one channel is enabled.
Activating a buffer with 0 channels enabled doesn't make too much sense and
disallowing this case makes sure that individual driver don't have to add
special case code to handle it.

Currently, without this patch enabling a buffer is possible and no error is
produced. With this patch -EINVAL is returned.

An example of execution with this patch and some instrumented print-code:
   root@analog:~# cd /sys/bus/iio/devices/iio\:device3/buffer
   root@analog:/sys/bus/iio/devices/iio:device3/buffer# echo 1 > enable
   0: iio_verify_update 748 indio_dev->masklength 2 *insert_buffer->scan_mask 00000000
   1: iio_verify_update 753
   2:__iio_update_buffers 1115 ret -22
   3: iio_buffer_store_enable 1241 ret -22
   -bash: echo: write error: Invalid argument
1, 2 & 3 are exit-error paths. 0 the first print in iio_verify_update()
rergardless of error path.

Without this patch (and same instrumented print-code):
   root@analog:~# cd /sys/bus/iio/devices/iio\:device3/buffer
   root@analog:/sys/bus/iio/devices/iio:device3/buffer# echo 1 > enable
   0: iio_verify_update 748 indio_dev->masklength 2 *insert_buffer->scan_mask 00000000
   root@analog:/sys/bus/iio/devices/iio:device3/buffer#
Buffer is enabled with no error.

Note from Jonathan: Probably not suitable for automatic application to stable.
This has been there from the very start.  It tidies up an odd corner
case but won't effect any 'real' users.

Fixes: 84b36ce5f7 ("staging:iio: Add support for multiple buffers")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:14 +01:00
Takashi Iwai
3dee042628 iio: tsl2772: Use scnprintf() for avoiding potential buffer overflow
snprintf() is a hard-to-use function, it's especially difficult to use
it for concatenating substrings in a buffer with a limited size.
Since snprintf() returns the would-be-output size, not the actual
size, the subsequent use of snprintf() may go beyond the given limit
easily.  Although the current code doesn't actually overflow the
buffer, it's an incorrect usage.

This patch replaces such snprintf() calls with a safer version,
scnprintf().

Also this fixes the incorrect argument of the buffer limit size passed
to snprintf(), too.  The size has to be decremented for the remaining
length.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:14 +01:00
Rohit Sarkar
bf09cddb2c iio: adc: max1363: replace uses of mlock
Replace usage indio_dev's mlock with either local lock or
iio_device_claim_direct_mode.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:13 +01:00
Rohit Sarkar
bb8759f28e iio: health: max30100: use generic property handler
Instead of of_property_read_xxx use device_property_read_xxx as it is
compatible with ACPI too as opposed to only device tree.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:13 +01:00
Mike Looijmans
1579fc067f iio/gyro/bmg160: Add support for BMI088 chip
The BMI088 is pin-compatible with the BMI055, and provides
both gyro and accel functions. The gyro part is similar to
the BMI055 and this adds the chip to the list of supported
devices for the gyro part.

The accel part of the chip is not compatible with anything
existing already.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:13 +01:00
Alexandru Ardelean
ccd428e42b iio: buffer: re-introduce bitmap_zalloc() for trialmask
Commit 3862828a90 ("iio: buffer: Switch to bitmap_zalloc()") introduced
bitmap_alloc(), but commit 20ea39ef9f ("iio: Fix scan mask selection")
reverted it.

This change adds it back. The only difference is that it's adding
bitmap_zalloc(). There might be some changes later that would require
initializing it to zero. In any case, now it's already zero-ing the
trialmask.

Appears to have been the result of merge conflict resolution rather
than an intentional revert.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:13 +01:00
Syed Nayyar Waris
7d744c8f70 MAINTAINERS: Add Syed Nayyar Waris to ACCES 104-QUAD-8 driver
Add Syed Nayyar Waris as a co-maintainer for the ACCES 104-QUAD-8
counter driver.

Signed-off-by: Syed Nayyar Waris <syednwaris@gmail.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:12 +01:00
Alexandru Ardelean
501d3e5dd5 iio: ad_sigma_delta: remove unused IIO channel macros
Now that all channel SigmaDelta IIO channel macros have been localized,
remove the generic ones.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:11 +01:00
Alexandru Ardelean
aebefb444f iio: adc: ad7793: define/use own IIO channel macros
This driver seems to use most of the AD_SD_*_CHANNEL. This change will move
them in the driver. The intent is that if a new part comes along which
would require tweaks per IIO channel, these should be doable in the driver.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:10 +01:00
Alexandru Ardelean
ab3449943b iio: adc: ad7791: define/use own IIO channel macros
This driver seems to use most of the AD_SD_*_CHANNEL. This change will move
them in the driver. The intent is that if a new part comes along which
would require tweaks per IIO channel, these should be doable in the driver.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:10 +01:00
Alexandru Ardelean
5924dab241 iio: adc: ad7780: define/use own IIO channel macros
This change gets rid of the AD_SD_*_CHANNEL macros in favor of defining
it's own. The ad7780 is quite simpler than it's other Sigma-Delta brothers.

It turned out that centralizing the AD_SD_*_CHANNEL macros doesn't scale
too well, especially with some more complicated drivers. Some of the
variations in the more complicated drivers require new macros, and that way
things can become harder to maintain.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:10 +01:00
Michael Straube
710c451fbc staging: rtl8188eu: make const char array static
Make const char array 'fw_name' static. Clears a checkpatch warning
and reduces object file size by 17 bytes (gcc 9.3.1 x86_64).

WARNING: const array should probably be static const

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200413175957.30165-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:41:01 +02:00
Michael Straube
05a72b5616 staging: rtl8188eu: cleanup long line in fw.c
Add line break to avoid line length over 80 characters.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200413175957.30165-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:41:01 +02:00
Michael Straube
8349fa213e staging: rtl8188eu: rename define to upper case
Rename 'FWDL_ChkSum_rpt' to 'FWDL_CHKSUM_RPT' as defines are normaly
named all upper case. Also clears a camel case checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200413175957.30165-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:41:01 +02:00
Colin Ian King
7f3115fbfe staging: vt6656: remove redundant assignment to variable ed_inx
The variable ed_inx is being initialized with a value that is never
read and it is being updated later with a new value. The initialization
is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200414143502.237803-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:41:00 +02:00
Oscar Carter
5a78455625 staging: vt6656: Remove duplicate code for the phy->service assignment
Take out the "phy->service" assignment from the if-else statement due to
it's the same for the two branches.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200414153849.5785-6-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:40:22 +02:00
Oscar Carter
8a29fb1fcf staging: vt6656: Refactor the assignment of the phy->signal variable
Create a constant array with the values of the "phy->signal" for every
rate. Remove all "phy->signal" assignments inside the switch statement
and replace these with a single reading from the new vnt_phy_signal
array.

The constant array can be of one dimension because the OR mask with
BIT(3) or BIT(4) allow obtain a second value according to the rate,
the preamble_type and the pkt_type.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200414153849.5785-5-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:40:22 +02:00
Oscar Carter
8b0eb26ad5 staging: vt6656: Use define instead of magic number for tx_rate
Use the define RATE_11M present in the file "device.h" instead of the
magic number 3. So the code is more clear.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200414153849.5785-4-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:40:21 +02:00
Oscar Carter
91fdbcd909 staging: vt6656: Use BIT() macro instead of bit shift operator
Use the BIT() macro instead of the bit left shift operator. So the code
is more clear.

It's safe to remove the casting to u16 type because the value obtained
never exceeds 16 bits. So the casting is unnecessary.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200414153849.5785-3-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 13:40:20 +02:00
Oscar Carter
f823cce279 staging: vt6656: Return error code in vnt_rf_write_embedded function
Use the error code returned by the vnt_control_out function as the
returned value of the vnt_rf_write_embedded function instead of a
boolean value.

Then, fix all vnt_rf_write_embedded calls removing the "and" operations
and replace with a direct assignment to the ret variable and add a check
condition after every call.

Also replace the boolean values true or false in the vnt_rf_set_txpower
function to 0 or error code EINVAL to follow the coding style guide.

The vnt_rf_set_txpower function is called only in the vnt_rf_setpower
function that already returns error codes. The calls to this function
(vnt_rf_set_txpower) not use the returned values, so they not need to be
fixed.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200414153849.5785-2-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:54:25 +02:00
R Veera Kumar
4a585df368 staging: vc04_services: bcm2835-audio: Make function arguments alignment match open parenthesis
Make function arguments alignment match open parenthesis.
Found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200413165905.6081-1-vkor@vkten.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:33:49 +02:00
R Veera Kumar
2596313a9f staging: sm750fb: Make function arguments alignment match open parenthesis
Make function arguments alignment match open parenthesis.
Found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/20200413160753.3787-1-vkor@vkten.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:33:03 +02:00
Michael Straube
3e63dbd425 staging: rtl8712: correct spelling mistake in comment
Correct a spelling mistake discovered by checkpatch.
attatch -> attach

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200413215109.15749-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:33:03 +02:00
Sergio Paracuellos
8220be592d staging: mt7621-pci: initialize 'n' variable when it is declared
Variable 'n' in 'mt7621_pcie_init_virtual_bridges' function
can be directly initialized when it is declared instead of
doing it before using it first.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413155018.31921-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:33:02 +02:00
Sergio Paracuellos
cddc585ec9 staging: mt7621-pci: add clarification comment in 'mt7621_pcie_init_virtual_bridges'
Add a comment explaining a bit what is going on in this function.
It would be helfulp for other people for a better understanding
of the code.

Suggested-by: NeilBrown <neil@brown.name>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413155018.31921-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:33:02 +02:00
Sergio Paracuellos
535bd126d6 staging: mt7621-pci: rename 'PCIE_P2P_MAX' into 'PCIE_P2P_CNT'
Definition 'PCIE_P2P_MAX' is '3'. The value here is not a MAXimum.
It is a count or a number. It is how many masks there are.
The masks are numbered 0, 1, 2 so the maximum is 2. Hence rename
variable into 'PCIE_P2P_CNT' which is a more accurate name.

Suggested-by: NeilBrown <neil@brown.name>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413155018.31921-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:33:01 +02:00
Jérôme Pouiller
4ddf14470b staging: wfx: update TODO
Update the TODO list associated to the wfx driver with the last
progresses and last remarks made by reviewers.

The items about support for P2P and mesh have also been removed. Indeed,
it seems that the device does not fully support them.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-21-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:47 +02:00
Jérôme Pouiller
c801351a9d staging: wfx: drop useless attribute 'filter_mcast'
Currently, wfx_update_filtering() apply the value of wvif->filter_mcast
to the hardware. But an attentive reader will note that
wfx_update_filtering() is always called after set wvif->filter_mcast.
Thus, it not necessary to store filter_mcast in the struct wfx_vif. We
can just pass it as parameter.

Also rename wfx_update_filtering() in wfx_filter_mcast() to reflect this
change.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-20-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:47 +02:00
Jérôme Pouiller
b15973f308 staging: wfx: drop useless filter update when starting AP
mac80211 explicitly call wfx_configure_filters() before/after starting
AP. Thus, it is not necessary to call wfx_update_filtering() from
wfx_start_ap().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-19-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:46 +02:00
Jérôme Pouiller
2c69b2da37 staging: wfx: split out wfx_filter_beacon()
Currently, wfx_update_filtering() is sometime called only to apply the
value of wvif->filter_beacon to the hardware. It is nicer to have a
specific function for beacon filtering.

In add, an attentive reader would note that wfx_update_filtering() is
always called after change of wvif->filter_beacon. Thus, it not
necessary to store filter_beacon in the struct wfx_vif. We can just pass
it as parameter.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:46 +02:00
Jérôme Pouiller
a558395d4c staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid'
It is now useless to store filter_prbreq and filter_bssid in struct
wfx_vif. We can just pass them as parameters to hif_set_rx_filter().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:46 +02:00
Jérôme Pouiller
f41224bd47 staging: wfx: drop useless call to hif_set_rx_filter()
hif_set_rx_filter() apply changes on filter_prbreq and filter_bssid to
the hardware. Each time filter_prbreq and filter_bssid are changed,
hif_set_rx_filter() is called.

Currently, on extra call to hif_set_rx_filter() is made from
wfx_update_filtering(). This call is useless. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:45 +02:00
Jérôme Pouiller
981132aa03 staging: wfx: drop struct wfx_grp_addr_table
The struct wfx_grp_addr_table is only instantiated on one place. There
is no justifiation for this struct. Moreover, it is not consistent with
other fields related to filtering (filter_bssid, etc...).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:45 +02:00
Jérôme Pouiller
6273691fbd staging: wfx: align semantic of probe request filter with other filters
Filters provided by HIF API are sometime inclusive, sometime exclusive.

This patch align the behavior and name of the probe request filter with
the other filters.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:44 +02:00
Jérôme Pouiller
b07357e027 staging: wfx: align semantic of beacon filter with other filters
Filters provided by HIF API are sometime inclusive, sometime exclusive.

This patch align the behavior and name of the beacon filter with the
other filters. Also avoid double negation: "disable filter"

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:44 +02:00
Jérôme Pouiller
824f830fc0 staging: wfx: drop useless wfx_fwd_probe_req()
wfx_fwd_probe_req() is a function of two lines called from only one
place. In order to uniformize all filtering functions, drop
wfx_fwd_probe_req().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:43 +02:00