Commit Graph

915432 Commits

Author SHA1 Message Date
Jérôme Pouiller
9a46a0a93b staging: wfx: make hif_ie_table_entry const
In wfx_update_filtering(), filter_ies is never modified. So, make it
constant.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:39 +02:00
Jérôme Pouiller
32f5d47cbf staging: wfx: allow to connect an IBSS with an existing SSID
With current code, chip is not able to join an existing IBSS network.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:38 +02:00
Jérôme Pouiller
9671f1338b staging: wfx: place hif_tx_mib functions into a .c file
Until now, all functions from hif_tx_mib.h are declared "static inline".
However, they are not time critical. So, it does not make so much sense.

We prefer to place them in a .c file as for other hif functions.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:38 +02:00
Jérôme Pouiller
fac592d084 staging: wfx: align members declarations in hif API
Hardware API headers were not uniformly aligned.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:37 +02:00
Jérôme Pouiller
31db18cccc staging: wfx: fix endianness of hif API
The chip expects little endian in all structs it sends/receives. This
patch fixes the hif API to reflect this fact. Sparse should now report
meaningful errors.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:37 +02:00
Jérôme Pouiller
a3d9682886 staging: wfx: remove useless defines
Several values defined in hif API are only here to define length of some
arrays. In most cases, they do not provide any extra information about
the size of the array (ie. "API_FIRMWARE_LABEL_SIZE" is only used to
define the size of member "firmware_label").

Remove these useless definitions.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:36 +02:00
Jérôme Pouiller
29d69a59c4 staging: wfx: remove unused definitions from the hif API
Until now, hif API was directly imported from firmware sources.
However, it does not make sense to keep ton of unused structures in
the driver. Moreover, the hif API is now stable enough to be keep in
sync by importing delta from firmware.

So, drop unused definitions from the hif API.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:36 +02:00
Jérôme Pouiller
a4aac6b889 staging: wfx: relocate TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID to hif API
The definitions TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID are
imposed by the hardware. Therefore, they should be located in the
hardware interface API.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:35 +02:00
Jérôme Pouiller
d7dcf8a54e staging: wfx: relocate LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE to hif API
The definitions LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE are imposed by
the hardware. Therefore, they should be located in the hardware
interface API.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:35 +02:00
Jérôme Pouiller
43aeff2c09 staging: wfx: drop unused WFX_LINK_ID_GC_TIMEOUT
The definition WFX_LINK_ID_GC_TIMEOUT is not used anymore since
commit d6aeba575f ("staging: wfx: simplify the link-id allocation")

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:32:34 +02:00
R Veera Kumar
73a6e90041 staging: rtl8723bs: hal: Correct misspelled symbolic name
Correct misspelled symbolic name.
Misspelling found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/b893adc31b71722df63d0756f0d360e27f896e51.1586187304.git.vkor@vkten.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:39 +02:00
R Veera Kumar
cb514b30a9 staging: rtl8723bs: hal: Correct misspelt enum name
Correct misspelt enum name.
Misspelling found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/d091fa95d537f613c24e55a2dee638d4493534b5.1586187304.git.vkor@vkten.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:38 +02:00
R Veera Kumar
e3a2b0d975 staging: rtl8723bs: Correct misspelt symbolic names
Correct misspelt symbolic names.
Misspelling found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/abe807c11a5fda479ed6079a11d528989fe7b63e.1586187304.git.vkor@vkten.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:38 +02:00
Jérôme Pouiller
3f84adfe1d staging: wfx: remove hack about tx_rate policies
Current code contains a weird hack to avoid switch from 54Mbps CTS to
1Mbps. However, we have not been able to reproduce the problem and
hardware team don't know any defect of this kind. So, it seems this hack
is no more necessary.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-33-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:38 +02:00
Jérôme Pouiller
4fb6036a1b staging: wfx: fix case where AP stop with CAB traffic pending
When driver has Content After DTIM Beacon (CAB) in queue, it wait for an
indication from the firmware. However, when we stop to send beacons,
this indication may never happen.

Solve this issue by simply simulate this indication. Firmware will send
data that probably nobody will heard.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-32-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:38 +02:00
Jérôme Pouiller
a39e761aa4 staging: wfx: fix potential deadlock in wfx_tx_flush()
wfx_tx_flush() wait there are no more frame in device buffer. However,
this event may never happens since wfx_tx_flush() don't forbid to
enqueue new frames.

Note that wfx_tx_flush() should only ensure that all frames currently in
hardware queues are sent. So the current code is more restrictive that
it should.

Note that wfx_tx_flush() release the lock before to return while
wfx_tx_lock_flush() keep the lock.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-31-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:37 +02:00
Jérôme Pouiller
7f573a6fb1 staging: wfx: wfx_flush() did not ensure that frames are processed
wfx_flush() exited once all frames are retrieved from the device.
However, it did not ensure they were processed by driver before to
return. Therefore, some frame may be processed after the interface has
disappear.

Change the place we signal that the queue is empty to fix that.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-30-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:37 +02:00
Jérôme Pouiller
4c6b3837c6 staging: wfx: repair wfx_flush()
Until now, wfx_flush() flushed queue for while device instead of only
the queue of the intended vif. It sometime failed with a timeout, but
this error was not reported.

Moreover, if the device was frozen, wfx_flush didn't do anything and it
results a potential warning (and maybe a resource leak) when the frozen
device was unregistered.

We can also notice that wfx_tx_queues_wait_empty_vif() did only exist to
work around the broken feature of wfx_flush().

This patch repair wfx_flush() and therefore drop
wfx_tx_queues_wait_empty_vif().

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-29-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:37 +02:00
Jérôme Pouiller
7db856797f staging: wfx: relocate wfx_skb_dtor() prior its callers
In a next commit, we would like to mark wfx_skb_dtor as static and stop
to declare it in data_tx.h.

Relocate wfx_skb_dtor() prior its callers to avoid compile error.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-28-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:37 +02:00
Jérôme Pouiller
39dbfa536b staging: wfx: improve interface between data_tx.c and queue.c
Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor()
(from data_tx.c) that forward the tx status to mac80211.

Moreover, there no purpose to retrieve a frame from the pending queue
without dequeuing it. So, the main purpose of wfx_pending_remove() is to
forward the tx status to mac80211.

Let's make the architecture cleaner:
  - merge wfx_pending_remove() into wfx_pending_get()
  - call wfx_skb_dtor() from data_tx.c

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-27-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:37 +02:00
Jérôme Pouiller
cb851c867d staging: wfx: simplify usage of wfx_tx_queues_put()
The queue used for wfx_tx_queue_put() can be deducted from the content
of the skb. So drop this parameter from call to wfx_tx_queues_put().

In add, this change uniformizes usage of functions wfx_tx_queues_*.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-26-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:37 +02:00
Jérôme Pouiller
d32cedbec0 staging: wfx: drop struct wfx_queue_stats
There is no reason to keep the intermediate struct wfx_queue_stats.
Relocate its members to struct wfx_dev.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-25-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:36 +02:00
Jérôme Pouiller
41c5dfcdbc staging: wfx: drop now useless field edca_params
Since we do not rely in QoS parameters to choose which frame to send, it
is no more necessary to keep a copy of EDCA parameters.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-24-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:36 +02:00
Jérôme Pouiller
6bf418c50f staging: wfx: change the way to choose frame to send
The current code computes itself the QoS policy to choose which frame
should be sent. However, firmware already do that job. Firmware would
prefer to have packets in every queues and be able to choose itself
which queue to use.

So, this patch sort the queues from the emptiest to the fulliest (thanks
to the pending frames counter introduced a few commits earlier). It send
frame to the least full queue.

However, we continue to be careful with frames that have to be sent
after a dtim ("cab": Content After (DTIM) Beacon).

So, this patch splits AC queues in two skb_queues: one for normal frames
and another for cab frames. It cares to send frames from CAB skb_queue
if appropriate.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-23-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:36 +02:00
Jérôme Pouiller
7ba22b0754 staging: wfx: introduce a counter of pending frames
This counter will be useful to know which queue is least full in a
further patch.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-22-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:36 +02:00
Jérôme Pouiller
b6ef154973 staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab()
It is not necessary to return a skb. Just getting the information if
there is traffic to be sent after DTIM is sufficient.

In add, the acronym "cab" (Content After (DTIM) Beacon) is used in
mac80211 to designate this kind of traffic.

So, make wfx_tx_queues_get_after_dtim() return a boolean and rename
accordingly.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-21-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:36 +02:00
Jérôme Pouiller
bf325befc6 staging: wfx: rename wfx_tx_get_raw_link_id()
Since concept of "raw_link_id" does not exist anymore, rename
wfx_tx_get_raw_link_id() in wfx_tx_get_link_id().

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-20-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:36 +02:00
Jérôme Pouiller
9f84c196f5 staging: wfx: drop unused raw_link_id field
raw_link_id can be retrieved by wfx_tx_get_raw_link_id(). So, it is not
necessary to keep it in struct wfx_tx_priv.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-19-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
f4a4fe570b staging: wfx: drop unused link_id field
It is not used anymore.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
9251ad667d staging: wfx: do not rely anymore on link_id to choose packet in queue
link_id was expected to contain identifier of a station. It was also
used to mark frames that has to sent after dtim. We do not use the
further purpose. For the last purpose, we can directly check the flag
value in tx_info.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
9e76ba7744 staging: wfx: drop useless link_map_cache
Driver does not use link_map_cache anymore. So we can drop it. In add,
we do not have to keep this counter in sync with skb_queue item, so we
can drop explicit spin_locks.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
6c262beb41 staging: wfx: do not use link_map_cache to track CAB
Since we do not track power save status of the stations anymore,
link_map_cache is now only used to track "Content After (DTIM) Beacon".
We prefer to rely on flags from tx_info. So we will be able to drop
link_map_cache.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
af72697196 staging: wfx: drop argument tx_allowed_mask since it is constant now
Following the remove of asleep_mask, the tx_allowed_mask argument passed
to various functions is now always the same. Drop this argument and
simplify the code.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
062a6c4102 staging: wfx: drop useless sta_asleep_mask
Currently, the driver tracks power save state of the stations with the
variable sta_asleep_mask. Then, it takes care to not sent data to asleep
stations.

However, this work is already done by mac80211. Normally, there are no
frames for asleep stations in our queues. So, driver do not have to
filter frames in its queues (apart the frames marked "AFTER_DTIM").

Notice that there is a risk of race between state of the station and
data send to the firmware. However, this risk is limited since the
number of frame in queues are small. In add, this race also exists with
the current code. Anyway, the firmware is able to detect the problem and
driver will receive a 'REQUEUE' status (translated in
TX_STAT_TX_FILTERED for mac80211).

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:35 +02:00
Jérôme Pouiller
517b358fdd staging: wfx: simplify wfx_tx_queue_mask_get()
It is far simpler to return a pointer instead of an error. Thus, it is
no more necessary to pass a pointer reference as argument.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:34 +02:00
Jérôme Pouiller
abaef5374e staging: wfx: drop unused argument in wfx_get_prio_queue()
The argument "total" is not used anymore since commit a3c529a835
("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM").

Fixes: a3c529a835 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:34 +02:00
Jérôme Pouiller
f42483f9ef staging: wfx: simplify wfx_tx_queues_empty()
Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the
spin_lock before to check if the queue is empty.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:34 +02:00
Jérôme Pouiller
f5d331ee86 staging: wfx: simplify hif_handle_tx_data()
The last argument of hif_handle_tx_data() was now unused. In add,
hif_handle_tx_data() has nothing to do with HIF layer and should be
renamed. Finally, it not convenient to pass a wfx_vif as parameter. It
is easier to let hif_handle_tx_data() find the interface itself.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:34 +02:00
Jérôme Pouiller
566059cc5f staging: wfx: avoid useless wake_up
__wfx_flush() wait for all queues to be empty. In current code,
wait_link_id_empty is wake up each time there is no more data for a
station. We can simplify the processing and avoid some wake-up by
raising this event only when the queue is empty.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:34 +02:00
Jérôme Pouiller
70b727314f staging: wfx: drop useless queue_id field
The field queue_id is no more used.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:34 +02:00
Jérôme Pouiller
365fdf7e3e staging: wfx: uniformize queue_id retrieval
tx_info->hw_queue contains "vif.hw_queue[skb_get_queue_mapping(skb)]".
For now, it is equivalent of "skb_get_queue_mapping(skb)". However, it
is not the same semantic. In wfx_tx_inner(), we want to get the mac80211
queue index, not the hardware queue index.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:33 +02:00
Jérôme Pouiller
57c5222004 staging: wfx: remove "burst" mechanism
In the old days, the driver tried to reorder frames in order to send
frames from the same queue grouped to the firmware. However, the
firmware is able to do the job internally for a long time. There is no
reasons to keep this mechanism.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:33 +02:00
Jérôme Pouiller
055d20cf72 staging: wfx: take advantage of ieee80211_{stop/start}_queues
Instead of maintaining stop status for each queue, we can just maintain
a global status for all queues.

In add, wfx_tx_queues_{lock/unlock} are only used when no more
tx_policies are available. Therefore, the counter of recursive locks
("tx_locked_cnt") is useless.

So, wfx_tx_queues_{lock/unlock} can be replaced by
ieee80211_{stop/start}_queues.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:33 +02:00
Jérôme Pouiller
af9d2f79dc staging: wfx: do not stop mac80211 queueing during tx_policy upload
When a new tx_policy has to be uploaded, it is necessary to avoid any
race between the frame and the policy. So, the driver stops the tx queue
during tx_policy upload. However, it is not necessary to stop mac80211
queuing.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:33 +02:00
Jérôme Pouiller
a6bdff3f62 staging: wfx: add sanity checks to hif_join()
Add a few check on start of hif_join().

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:33 +02:00
Soumyajit Deb
a920f3be52 staging: rtl8188eu: Line over 80 characters
Break various lines into multiple lines to respect 80 character width
limit.
Reported by checkpatch.pl

Signed-off-by: Soumyajit Deb <debsoumyajit100@gmail.com>
Link: https://lore.kernel.org/r/20200406111706.25957-4-debsoumyajit100@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:33 +02:00
Soumyajit Deb
1003537f08 staging: rtl8188eu: Remove unnecessary extra parentheses
Remove unnecessary extra parentheses to improve code readability.

Signed-off-by: Soumyajit Deb <debsoumyajit100@gmail.com>
Link: https://lore.kernel.org/r/20200406111706.25957-3-debsoumyajit100@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:32 +02:00
Soumyajit Deb
8c8fbdb272 staging: rtl8188eu: Properly structure the multiline comment
Add "*" at the start of each line of the multiline comment to improve
code readability and to adhere to the uniform Kernel coding style.
Reported by checkpatch.pl

Signed-off-by: Soumyajit Deb <debsoumyajit100@gmail.com>
Link: https://lore.kernel.org/r/20200406111706.25957-2-debsoumyajit100@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:32 +02:00
Michael Straube
8d36c8d835 staging: rtl8188eu: remove unnecessary variable
The variable 'bStopBlinking' is used in if tests immediately after its
value is set. Use the conditions for setting 'bStopBlinking' diretly in
the subsequent if tests and remove the variable. Slightly reduces
object file size by 16 bytes (gcc 9.2.1 x86_64).

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200405112230.31975-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:32 +02:00
Michael Straube
2d90027bdd staging: rtl8188eu: remove unnecessary asignment
Remove unnecessary asignment in SwLedBlink1(). The code path with the
asignment 'pLed->BlinkTimes = 0' is only executed when
'pLed->BlinkTimes' is already zero and the value is not changed between
the test 'if (pLed->BlinkTimes == 0)' and the asignment.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200405112230.31975-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:32 +02:00