Commit Graph

18 Commits

Author SHA1 Message Date
Greg Kroah-Hartman 16d7586dcc Revert "staging: wfx: remove unused included header files"
This reverts commit 314fd52f01.

It turns .h files into non-stand-alone when building, which might cause
problems in the long-run.

Reported-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Cc: Muhammad Usama Anjum <musamaanjum@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:23:30 +01:00
Muhammad Usama Anjum 314fd52f01 staging: wfx: remove unused included header files
Many header files have been included, but never used. Those header
files have been removed.

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Link: https://lore.kernel.org/r/20210211143637.GA177425@LEGION
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-12 09:53:57 +01:00
Jérôme Pouiller f9dc9f3750 staging: wfx: update copyrights dates
Most of the files have been modified in 2020, so update the copyright
notices.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-07 12:55:47 +02:00
Jérôme Pouiller c8fb880910 staging: wfx: uniformize naming rules in hif_tx_mib.c
hif_tx_mib.c contains functions that format data to be sent to the
hardware. In this file, sometime the struct to be sent is named 'arg',
sometime 'val'. In some other function 'val' is used for the argument of
the function.

This patch uniformize the things and choose to call all the data in
destination to the hardware 'arg' (note this choice is only dictated by
the number of lines to change in the code)

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-30-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13 09:23:06 +02:00
Jérôme Pouiller 135baf19e5 staging: wfx: drop useless function
Since the code for multicast filtering has been dropped, the function
hif_set_data_filtering() is only called to disable multicast filtering.
In fact, the multicast filtering is already disabled by default. So,
this function is useless and can be dropped.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13 09:23:01 +02:00
Jérôme Pouiller 99cd05d6a0 staging: wfx: drop multicast filtering
The device allows to filter multicast frames. The driver has the
necessary code to take advantage of this feature. However, some bugs
has been reported on this feature. So, it was temporary disabled.

Finally, the things work well as-is for more than one year now. So there
is no plan to enable this feature in near future.

Since we dislike to maintain dead code, drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13 09:23:01 +02:00
Jérôme Pouiller 2a8f726489 staging: wfx: simplify hif_set_association_mode()
The file hif_tx_mib.c expects to contain functions that format messages
for the hardware. It is unexpected to find function that manipulate
RCU and structures from mac80211.

Keep hif_set_association_mode() with the code necessary for message
formatting and relocate the smart part in wfx_join_finalize().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13 09:23:00 +02:00
Gustavo A. R. Silva 3e1f8882a9 staging: wfx: Use flex_array_size() helper in memcpy()
Make use of the flex_array_size() helper to calculate the size of a
flexible array member within an enclosing structure.

This helper offers defense-in-depth against potential integer
overflows, while at the same time makes it explicitly clear that
we are dealing with a flexible array member.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200729233557.GA17693@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-30 08:41:06 +02:00
Jérôme Pouiller 201451cfe4 staging: wfx: check pointers returned by allocations
Until now, the driver did not always check if the allocations success.

The issue was discussed here:
   https://lore.kernel.org/netdev/2026476.QLiXXEGFCf@pc-42/

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200515083325.378539-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15 15:50:39 +02:00
Jérôme Pouiller 9b3bc20d98 staging: wfx: fix wrong bytes order
The field wakeup_period_max from struct hif_mib_beacon_wake_up_period is
a u8. So, assigning it a __le16 produces a nasty bug on big-endian
architectures.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200512150414.267198-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13 13:49:42 +02:00
Jérôme Pouiller 1ff4388a06 staging: wfx: use kernel types instead of c99 ones
The kernel coding style promotes the use of kernel types (u8, u16, u32,
etc...) instead of the C99 ones.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200505123757.39506-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13 13:26:43 +02:00
Jérôme Pouiller 2760220700 staging: wfx: show counters of all interfaces
The device keep up to date three series of stats. One for each
virtual interface and one for the whole device.

Until to now, the stats for the whole device were unavailable. Moreover,
it is interesting to retrieve counters for all interfaces even if they
are not awake.

Change the counters available in debugfs in order to retrieve stats
from all interfaces.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200427134031.323403-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-28 14:14:28 +02:00
Jérôme Pouiller 28502e02e2 staging: wfx: drop useless update of field basic_rate_set
Basic Rates are already set by hif_join(). hif_join() is also able to
manage possible changes after association.

Firmware also allows to change the Basic Rates with
hif_set_association_mode() but it does not bring anything in our case.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200420160311.57323-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23 13:26:04 +02:00
Jérôme Pouiller d4620087d2 staging: wfx: dual CTS is never necessary
Dual CTS is only necessary when sending/receiving STBC data. However,
the chip does not support STBC, so it is never necessary to enable
double CTS.

We can simplify the code.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200420160311.57323-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23 13:26:03 +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 be4692e5e0 staging: wfx: send just necessary bytes
Size of hif_mib_template_frame must be sufficient to contains bytes
declared by frame_length and cannot exceed 700bytes.

Change the API to reflect that.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-12-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 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 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