Commit graph

192 commits

Author SHA1 Message Date
Linus Torvalds
3bd14829d3 Staging/IIO fixes for 5.6-rc7
Here are a number of small staging and IIO driver fixes for 5.6-rc7
 
 Nothing major here, just resolutions for some reported problems:
 	- iio bugfixes for a number of different drivers
 	- greybus loopback_test fixes
 	- wfx driver fixes
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCXnTRmQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykkCwCfS8zLibsZtuv655yAK17C/6YghPQAoJ3iSew+
 EkzEDWQ9j2NLE+lpWtKQ
 =fZ2X
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO fixes from Greg KH:
 "Here are a number of small staging and IIO driver fixes for 5.6-rc7

  Nothing major here, just resolutions for some reported problems:
   - iio bugfixes for a number of different drivers
   - greybus loopback_test fixes
   - wfx driver fixes

  All of these have been in linux-next with no reported issues"

* tag 'staging-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: rtl8188eu: Add device id for MERCUSYS MW150US v2
  staging: greybus: loopback_test: fix potential path truncations
  staging: greybus: loopback_test: fix potential path truncation
  staging: greybus: loopback_test: fix poll-mask build breakage
  staging: wfx: fix RCU usage between hif_join() and ieee80211_bss_get_ie()
  staging: wfx: fix RCU usage in wfx_join_finalize()
  staging: wfx: make warning about pending frame less scary
  staging: wfx: fix lines ending with a comma instead of a semicolon
  staging: wfx: fix warning about freeing in-use mutex during device unregister
  staging/speakup: fix get_word non-space look-ahead
  iio: ping: set pa_laser_ping_cfg in of_ping_match
  iio: chemical: sps30: fix missing triggered buffer dependency
  iio: st_sensors: remap SMO8840 to LIS2DH12
  iio: light: vcnl4000: update sampling periods for vcnl4040
  iio: light: vcnl4000: update sampling periods for vcnl4200
  iio: accel: adxl372: Set iio_chan BE
  iio: magnetometer: ak8974: Fix negative raw values in sysfs
  iio: trigger: stm32-timer: disable master mode when stopping
  iio: adc: stm32-dfsdm: fix sleep in atomic context
  iio: adc: at91-sama5d2_adc: fix differential channels in triggered mode
2020-03-20 09:20:38 -07:00
Jérôme Pouiller
ac42c12dd7 staging: wfx: fix RCU usage between hif_join() and ieee80211_bss_get_ie()
Access to result of ieee80211_bss_get_ie() is protected by RCU. In other
hand, function hif_join() can sleep and cannot be called with RCU
locked.

Provide a copy of "ssidie" to hif_join() to solve this behavior.

Fixes: 9ced9b5937 ("staging: wfx: simplify hif_join()")
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200310101356.182818-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:14:16 +01:00
Jérôme Pouiller
046cc2effd staging: wfx: fix RCU usage in wfx_join_finalize()
Access to sta->ht_cap is protected by RCU. However,
hif_set_association_mode() may sleep, so it can't be called in RCU.

This patch fix this behavior by handling sta and its RCU directly from
function hif_set_association_mode().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Fixes: d001490110 ("staging: wfx: fix RCU usage")
Link: https://lore.kernel.org/r/20200310101356.182818-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:14:16 +01:00
Jérôme Pouiller
4bbc6a3e7a staging: wfx: make warning about pending frame less scary
Removing station while some traffic is in progress may happen.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200310101356.182818-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:14:16 +01:00
Jérôme Pouiller
c918c27ac6 staging: wfx: fix lines ending with a comma instead of a semicolon
Obviously introduced by mistake.

Fixes: 09779276f1 ("staging: wfx: simplify hif_start() usage")
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200310101356.182818-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:14:16 +01:00
Jérôme Pouiller
bab0a0b034 staging: wfx: fix warning about freeing in-use mutex during device unregister
After hif_shutdown(), communication with the chip is no more possible.
It the only request that never reply. Therefore, hif_cmd.lock is never
unlocked. hif_shutdown() unlock itself hif_cmd.lock to avoid a potential
warning during disposal of device. hif_cmd.key_renew_lock should also
been unlocked for the same reason.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200310101356.182818-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:14:16 +01:00
Mauro Carvalho Chehab
a40df28c56 docs: dt: fix several broken doc references
There are several DT doc references that require manual fixes.
I found 3 cases fixed on this patch:

	- directory named "binding/" instead of "bindings/";
	- .txt to .yaml renames;
	- file renames (still on txt format);

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
2020-02-24 12:27:19 -06:00
Jérôme Pouiller
270f104ba2 staging: wfx: update TODO
Some work has been done :)

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-66-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:54 +01:00
Jérôme Pouiller
240503a6e3 staging: wfx: simplify hif_multi_tx_confirm()
Usage of the "buf_loc" variable does not simplify the function.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-65-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:53 +01:00
Jérôme Pouiller
2f5fd8b077 staging: wfx: simplify wfx_tx_queue_get_num_queued()
wfx_tx_queue_get_num_queued() can take advantage of BIT() instead of
maintaining one variable for a counter and another for a mask.

In add, wfx_tx_queue_get_num_queued() has no real reason to return a
size_t instead of an int.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-64-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:53 +01:00
Jérôme Pouiller
5244357961 staging: wfx: simplify hif_handle_tx_data()
Since enum action has now only two cases, it can be dropped. Then
hif_handle_tx_data() can be simplified.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-63-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:53 +01:00
Jérôme Pouiller
7bc71e80bd staging: wfx: remove check for interface state
Obviously, the value of wvif->state as no reason to be wrong. At least,
if it the case, dropping the frame is probably not the bast thing to do.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-62-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:53 +01:00
Jérôme Pouiller
1b72dee6f8 staging: wfx: remove unused do_probe
The identifier do_probe is unused since "staging: wfx: remove workaround
to send probe requests"

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-61-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:53 +01:00
Jérôme Pouiller
1b38e0d042 staging: wfx: ensure that packet_id is unique
In current code, packet_id is derivated from mac802.11 packet sequence
number, but this number is only unique for a station. It is not
sufficient.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-60-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:53 +01:00
Jérôme Pouiller
ded6ca11af staging: wfx: simplify wfx_ps_notify_sta()
wfx_ps_notify_sta() is too complex compared to the task it do.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-59-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
a3c529a835 staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM
When mac80211 ask for a frame to be sent after a DTIM, driver should:
  1. Update TIM with multicast bit set (using update_ie). This function
     can be called whenever.
  2. Keep buffered all frames marked "after dtim"
  3. When it receive a suspend_resume indication (see
     wfx_suspend_resume_mc()), send all the buffered frames. This
     indication is sent by the firmware 4ms before the dtim.
  4. If one of the frames returns status "REQUEUE", it means that the
     DTIM period was ended before to be able to send the frame.
  5. When all the buffered frames were sent or if DTIM period was ended,
     driver should update the TIM with multicast bit reset.

All the mess with the asynchronous works can be dropped.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-58-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
22c03264e5 staging: wfx: simplify wfx_suspend_resume_mc()
Indeed, it is not necessary to pass whole hif_ind_suspend_resume_tx to
wfx_suspend_resume_mc().

In add, the structure hif_ind_suspend_resume_tx come from hardware API.
It is not intended to be manipulated in upper layers of the driver.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-57-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
b5d4d98ec8 staging: wfx: firmware never return PS status for stations
At the beginning, firmware could send suspend_resume indication to
notify that a station wake up or sleep down. However, mac80211 already
handles power save status of stations and this behavior has been removed
from the firmware. So now, when suspend_resume indication is received,
it is always to notify that a DTIM is about to be sent.

So, it is possible to simply wfx_suspend_resume().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-56-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
6537adc3e3 staging: wfx: sta and dtim
wfx_ps_notify() is called for any changes in the TIM. However,
association ID 0 is a very special case that should be handled
independently.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-55-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
2e57865e79 staging: wfx: pspoll_mask make no sense
pspoll_mask is here to send data buffered in driver. But since station
is marked buffered, TIM for this station is 1 and mac80211 will call
sta_notify when a ps-poll is received. So pspoll_mask is useless and
sta_alseep_mask is sufficient.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-54-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
df3519a328 staging: wfx: replace wfx_tx_get_tid() with ieee80211_get_tid()
wfx_tx_get_tid() was used as a wrapper around ieee80211_get_tid(). It
did sometime return WFX_MAX_TID to ask to upper layers to not include
the frame in "buffered" counter. The objective of this behavior is not
clear, but tests has shown that wfx_tx_get_tid() can be replaced by
ieee80211_get_tid() without any regressions.

BTW, it is not necessary to save the tid in tx_rpiv since it can be
retrieved from the 802.11 header.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-53-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
98511a91b1 staging: wfx: check that no tx is pending before release sta
Just for sanity.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-52-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
d6aeba575f staging: wfx: simplify the link-id allocation
The "link-id" is a slot number provided to the chip. A link-id is
allocated to every station associated with the chip (mainly when the
chip is in AP mode). It is more or less the same thing than the
association ID, but it is limited to 14 values.

Firmware uses the link-id to track the power save status of the
stations.

The current code try to associate a link-id as soon as data are
exchanged with station. It is far easier to rely on sta_add() and
sta_remove().

Until now the value WFX_LINK_ID_NO_ASSOC, was only used when no more
link-id was available. Now, we also use this value for
not-yet-associated stations (that was its primary behavior).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-51-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:52 +01:00
Jérôme Pouiller
36cbb5d2a7 staging: wfx: simplify wfx_set_tim_impl()
Argument provided to wfx_set_tim_impl() is always wvif->aid0_bit_set and
there is no reason to provide another argument.

Also rename wfx_set_tim_impl() into wfx_update_tim() to reflect the new
behavior.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-50-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
d001490110 staging: wfx: fix RCU usage
Indeed, sta was used after call to rcu_unlock()

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-49-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
76b5c2ce46 staging: wfx: fix bss_loss
wfx_tx_confirm_cb()  retrieves the station associated with a frame using
the MAC address from the 802.11 header. In the other side wfx_tx()
retrieves the station using sta field from the ieee80211_tx_control
argument.

In wfx_cqm_bssloss_sm(), wfx_tx() was called directly without valid sta
field, but with a valid MAC address in 802.11 header. So there the
processing of this packet was unbalanced and may produce weird bugs.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-48-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
7d2d2bfdeb staging: wfx: relocate "buffered" information to sta_priv
It simplify the code if field buffered is hosted in the struct sta_priv
instead of in the struct wfx_link_entry. More globally, struct
wfx_link_entry has no real reasons to exist and should be dropped soon.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-47-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
79d5fecc9b staging: wfx: remove handling of "early_data"
It seems that purpose of "early_data" was to prevent sending data to
mac80211 before station was completely associated. It is a useless
precaution.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-46-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
def39be019 staging: wfx: fix possible overflow on jiffies comparaison
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It is recommended to use function time_*() to compare jiffies.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-45-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
4e1514c940 staging: wfx: fix case where RTS threshold is 0
If RTS threshold is 0, it currently disables RTS. It should mean
"enabled for every frames".

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-44-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
9b90910f5b staging: wfx: do not update uapsd if not necessary
wfx_conf_tx() is called for each queue. On every call, the function
updates UAPSD mask and PM mode for all queues. It is a pity since the
UAPSD configuration very rarely changes and it makes exchanges between
the host and the chip more difficult to track.

This patch avoid to update UAPSD and Power Mode in most usual cases.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-43-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
f98138a16f staging: wfx: with multiple vifs, force PS only if channels differs
When multiple vif are in use (the only supported configuration is one
station and one AP), the driver force power save flag on station.
This behavior allows the station to leave the station channel and make
its business on AP channel.

However, this has a big impact on station performances (especially since
only legacy PS is supported).

When both vifs use the same channel, it is not necessary to keep this
restriction. This greatly improve station performances.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-42-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:51 +01:00
Jérôme Pouiller
8d97a12fa4 staging: wfx: update power-save per interface
mac80211 and the device are both able to control power-save per vif.
But, the current code retrieve power-save from wfx_config(). So, it does
not allow to setup power-save independently for each vif. Driver just
has to rely on wfx_bss_info_changed() instead of wfx_config().

wfx_config() has nothing to do anymore, but we keep it since it is
mandatory for mac80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-41-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
7f091d319e staging: wfx: simplify wfx_scan_complete()
wfx_scan_complete() do nothing with argument hif_ind_scan_cmpl. In add,
hif_ind_scan_cmpl come from hardware API and is not expected to be used
with upper layers of the driver.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-40-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
fd5d78bdf7 staging: wfx: simplify wfx_update_filtering()
wfx_update_filtering() has no reason to instantiate a struct
hif_mib_bcn_filter_enable. Drop it and simplify the code.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-39-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
0b58486e15 staging: wfx: simplify wfx_set_mcast_filter()
HIF functions return only serious errors (OOM or device freeze). The
current handling of errors in wfx_set_mcast_filter() does not bring
anything. Finally it may disturb the developer more than it helps.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-38-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
db94907110 staging: wfx: simplify hif_set_config_data_filter()
The structure hif_mib_config_data_filter come from hardware
API. It is not intended to be manipulated in upper layers of the driver.

In add, current code for hif_set_config_data_filter() is too dumb. It
should pack data with hardware representation instead of leaving all
work to the caller.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-37-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
a077126a20 staging: wfx: simplify hif_set_mac_addr_condition()
The structure hif_mib_mac_addr_data_frame_condition come from hardware
API. It is not intended to be manipulated in upper layers of the driver.

In add, current code for hif_set_mac_addr_condition() is too dumb. It
should pack data with hardware representation instead of leaving all
work to the caller.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-36-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
c47b70e2c5 staging: wfx: simplify hif_set_data_filtering()
The structure hif_mib_set_data_filtering come from hardware API. It is
not intended to be manipulated in upper layers of the driver.

In add, current code for hif_set_data_filtering() is too dumb. It should
pack data with hardware representation instead of leaving all work to
the caller.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-35-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
3f5264e75c staging: wfx: simplify hif_mib_set_data_filtering
The field "default_filter" was not obvious.

In add, explicitly declare that fields default_filter and enable are
booleans.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-34-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:50 +01:00
Jérôme Pouiller
f5864a1076 staging: wfx: simplify hif_mib_uc_mc_bc_data_frame_condition
The current API defines bitfields. It is not very convenient. Prefer to
use bitmasks.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-33-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
46f044b965 staging: wfx: simplify hif_set_uc_mc_bc_condition()
The structure hif_mib_uc_mc_bc_data_frame_condition come from hardware
API. It is not intended to be manipulated in upper layers of the driver.

In add, current code for hif_set_uc_mc_bc_condition() is too dumb. It
should pack data with hardware representation instead of leaving all
work to the caller.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-32-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
a8ec12d419 staging: wfx: simplify hif_set_association_mode()
The structure hif_mib_set_association_mode come from hardware API. It is
not intended to be manipulated in upper layers of the driver.

In add, current code for hif_set_association_mode() is too dumb. It
should pack data with hardware representation instead of leaving all
work to the caller.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-31-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
9ced9b5937 staging: wfx: simplify hif_join()
The structure hif_req_join come from hardware API. It is not intended
to be manipulated in upper layers of the driver.

In add, current code for hif_join() is too dumb. It should pack data
with hardware representation instead of leaving all work to the caller.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-30-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
a09343fc35 staging: wfx: simplify hif_update_ie()
hif_update_ie() is only called to change the beacon template. So,
specialize this function and simplify the way to call it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-29-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
d1072b04f5 staging: wfx: SSID should be provided to hif_start() even if hidden
SSID is hidden in beacon but firmware has to know to which probe
requests it has to answer.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-28-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
deb7734ea9 staging: wfx: drop wfx_set_cts_work()
wfx_bss_info_changed() is not called from atomic contexts. So, it is not
necessary to raise an asynchronous work to change ERP. Thus
wfx_set_cts_work() become useless.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-27-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:49 +01:00
Jérôme Pouiller
963aff5728 staging: wfx: drop wvif->setbssparams_done
setbssparams_done was here to ensure that the firmware does not enable
powersave before to get the first beacon. However, mac80211 already
ensures it gets a beacon before to associate to the BSS. And even, if
it won't, the firmware wake up at least on every DTIM, which is
sufficient to finalize the association.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-26-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:48 +01:00
Jérôme Pouiller
ba366b9268 staging: wfx: drop wvif->cqm_rssi_thold
Current code keeps a copy of bss_conf->cqm_rssi_thold in wfx_vif. There
is no sane reason for that.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-25-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:48 +01:00
Jérôme Pouiller
9d443ffc58 staging: wfx: drop wvif->enable_beacon
It seems that current code try to save calls to hif_beacon_transmit() by
keeping a copy of the previous value of bss_conf->enable_beacon.
However, hif_beacon_transmit() does not cost so much and mac80211
already take care to not send useless events.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-24-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:59:48 +01:00