Commit graph

933830 commits

Author SHA1 Message Date
Linus Walleij 354d6ca9d9 staging: wfx: Get descriptors for GPIOs
The code has the functionality to insert the GPIO lines using
the global GPIO numbers through module parameters.

As we are clearly deprecating the use of global GPIO numbers
look up the GPIO descriptors from the device instead. This
usually falls back to device hardware descriptions using e.g.
device tree or ACPI. This device clearly supports device
tree when used over SPI for example.

For example, this can be supplied in the device tree like so:

  wfx@0x01 {
      compatible = "silabs,wf200";
      reset-gpios = <&gpio0 1>;
      wakeup-gpios = <&gpio0 2>;
  };

Cc: Jérôme Pouiller <jerome.pouiller@silabs.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20200703130756.514868-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10 13:51:22 +02:00
Colin Ian King d4e03146b0 staging: wfx: fix uninitialized variable bytes_done
The variable bytes_done is not initialized and hence the first
FIFO size check on bytes_done may be breaking prematurely from
the loop if bytes_done contains a large bogus uninitialized value.
Fix this by initializing bytes_done to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: a9408ad79f ("staging: wfx: load the firmware faster")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200706132017.487627-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10 13:48:43 +02:00
Jérôme Pouiller 14442181d2 staging: wfx: always enable FastPs in combo with new firmwares
When multiple interface on different channels are in use. It is
necessary to advertise the AP that the device is no more awake before to
switch to the other channel.

Until now, PS-Poll was the preferred mechanism for that. However.  The
new firmwares (>= 3.7) now nicely support FastPS.

FastPS improves bandwidth and compatibility with AP.

This patch drop the complex and rarely used mechanism introduced in the
commit dd5eba1bb5 ("staging: wfx: fix support for AP that do not
support PS-Poll") and use FastPS as soon as it is possible.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:08 +02:00
Jérôme Pouiller 01d2ffa4d9 staging: wfx: add a debugfs entry to force ps_timeout
In some advanced usage or debug scenarios, it could interesting to
change the value of ps_timeout or eventually to force use of PS-Poll
frames.

The wext API (used by iwconfig) provide a way to change ps_timeout.
However, this API is obsolete and it seems a little weird to use (it
seems it does apply the change, so the user have to disable then
re-enable de power save)

On side of nl80211, there is no way to change the ps_timeout.

This patch provides a file in debugfs to change the value of ps_timeout.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:08 +02:00
Jérôme Pouiller e5da5fbd77 staging: wfx: fix CCMP/TKIP replay protection
To enable the TKIP/CCMP replay protection, the frames has to be
processed in the right order. However, the device is not able to
re-order the frames during BlockAck sessions.

Mac80211 is able to reorder the frames, but it need the information
about the BlockAck sessions start and stop. Unfortunately, since the
BlockAck is fully handled by the hardware, these frames were not
forwarded to the host. So, if the driver ask to mac80211 to apply the
replay protection, it drop all misordered frames.

So, until now, the driver explicitly asked to mac80211 to not apply
the CCMP/TKIP replay protection.

The situation has changed with the API 3.4 of the device firmware. The
firmware forward the BlockAck information. Mac80211 is now able to
correctly reorder the frames. There is no more reasons to drop
cryptographic data.

This patch also impact the older firmwares. There will be a performance
impact on these firmware (since the misordered frames will dropped).
However, we can't keep the replay protection disabled.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller bbc409e276 staging: wfx: simplify handling of encrypted frames
We don't want mac80211 try to check MMIC and other security mechanisms.
So, the driver remove all the data related to the encryption (IV, ICV,
MMIC).

However, enabling RX_FLAG_PN_VALIDATED is sufficient for that.

So, drop the useless function wfx_drop_encrypt_data() and enable
RX_FLAG_PN_VALIDATED.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller 6135ad0eea staging: wfx: fix handling of frames without RSSI data
It seems that in the old days, the RSSI information could be missing. In
this case, in order to not pollute the RSSI stats, the frame was
dropped (!).

It is far better to mark the frame with the flag RX_FLAG_NO_SIGNAL_VAL.

In add, the problem seems now fixed in the firmware (at least, it has
not been encountered with recent firmwares).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller b9aa17505f staging: wfx: drop counter of buffered frames
Since the driver does not call ieee80211_sta_set_buffered() anymore, it
is no more necessary to maintain a counter of buffered frames for each
stations.

This change allows to simplify the processing in multiple places in the
driver.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller da0ce56566 staging: wfx: fix unexpected calls to ieee80211_sta_set_buffered()
When a station go to sleep, the driver receive the status REQUEUE and
forward this answer to mac80211. So, neither the driver, neither the
hardware buffer the frames. So the call to ieee80211_sta_set_buffered is
useless.

In add, it seems that mac80211 does not expect to receive
ieee80211_sta_set_buffered(false) after the station is asleep(). When
the device send data to a station, the following sequence can be
observed:

   - Mac80211 call wfx_sta_notify(awake).
   - The driver calls ieee80211_sta_set_buffered(true). Since the
     station is awake, its TIM is not set.
   - Mac80211 receive a power save notification from the station, so it
     calls wfx_sta_notify(asleep).
   - Then, since the driver has declared it has buffered some frames,
     the TIM of the station should be set. This action is delayed by
     mac80211.
   - The device also notice the station go to sleep. It replies the
     REQUEUE status for the buffered frames. The driver forward this
     status to mac80211.
   - There is no more frames in queues, so the driver call
     ieee80211_sta_set_buffered(false).
   - Mac80211 updates the TIM but since there is no frames buffered by
     the driver, it set the TIM for the station to 0.

Anyway, correctly use the ieee80211_sta_set_buffered() API solves the
problem.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller 9b8a9e6c2c staging: wfx: improve protection against malformed HIF messages
As discussed here[1], if a message was smaller than the size of the
message header, it could be incorrectly processed.

[1] https://lore.kernel.org/driverdev-devel/2302785.6C7ODC2LYm@pc-42/

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller a9408ad79f staging: wfx: load the firmware faster
During the loading of the firmware, the WFX_DCA_GET register provide the
number available bytes in the receiving buffer. It is not necessary to
access to the WFX_DCA_GET after sent of each firmware fragment.

This patch allows to send the firmware:
  - in 64ms instead of 130ms using SDIO bus
  - in 78ms instead of 115ms using SPI bus

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller b64d1054bc staging: wfx: add tracepoint "queues_stats"
It is useful to check which queue the driver choose to send to the
hardware.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller 70a37a09db staging: wfx: correctly retrieve vif ID from Tx confirmation
The device is able to send multiple Tx confirmations in the one reply.
In this case, there is only one vif identifier for all the
confirmations.

Unfortunately, to generate this kind of messages the device squashes all
the confirmations whatever their vif ID and use the vif ID of the first
confirmation. So, the driver cannot rely on the vif ID mentioned in the
header. Fortunately, using the packet_id, the driver can retrieve the Tx
request and the associated vif.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:07 +02:00
Jérôme Pouiller df6f08d3fa staging: wfx: check the vif ID of the Tx confirmations
When the driver has sent a frame on a virtual interface (vif), it
expects to receive the confirmation on the same vif.

This patch add a check for that.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:06 +02:00
Jérôme Pouiller 2a30cb1634 staging: wfx: associate tx_queues to vifs
The device handles 4 queues (one per AC) for each virtual interface (and
maximum 4 virtual interfaces). Until now the driver unified the queue of
all interfaces and handled only 4 queues for whole device.

This architecture did not allow to balance the traffic between the vif. So,
this patch relocate the queues into the vif and change the API accordingly.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:33:06 +02:00
Suraj Upadhyay 7566103ea5 staging: qlge: qlge_ethtool.c: Proper indentation.
Remove extra indentations from if-statement.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Link: https://lore.kernel.org/r/20200702084022.GA1586@blackclown
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:32:13 +02:00
Mauro Dreissig 0f6ba59969 staging: rtl8712: base_types: Remove unused macros
Those #define's are not used anywhere, get rid of them.

Signed-off-by: Mauro Dreissig <mukadr@gmail.com>
Link: https://lore.kernel.org/r/20200701214420.5566-3-mukadr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:32:13 +02:00
Mauro Dreissig 2becc421c9 staging: rtl8712: Replace FIELD_OFFSET() with offsetof()
Use the existing offsetof() macro instead of duplicating code.

Signed-off-by: Mauro Dreissig <mukadr@gmail.com>
Link: https://lore.kernel.org/r/20200701214420.5566-2-mukadr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:32:13 +02:00
Michael Straube bd7a168a02 staging: rtl8712: use common ieee80211 constants
Many defined constants in wifi.h are unused and/or available from
<linux/ieee80211.h>, some with slightly different names. Use the
common ones, rename where necessary and remove unused.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200701164213.4205-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:32:13 +02:00
Simon Fong ee53f6dd70 staging: rtl8188eu: Fix WARNINGs of Block comments
Fixed 5 WARNINGs of Block comments use * on subsequent lines.

Signed-off-by: Simon Fong <simon.fodin@gmail.com>
Link: https://lore.kernel.org/r/239f5c7f4761dd2ef0df8ee6966fca8ed2a13a9c.1593703689.git.simon.fodin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:30:19 +02:00
Simon Fong d9ff039a29 staging: rtl8188eu: Fix CHECK of coding style
Fixed a CHECK of Lines should not end with a '('.

Signed-off-by: Simon Fong <simon.fodin@gmail.com>
Link: https://lore.kernel.org/r/9f1f9d7d4723aa8d9bc2d7149fd01aacc1191860.1593703689.git.simon.fodin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:30:19 +02:00
Michael Straube 40c7966716 staging: rtl8188eu: use common ieee80211 constants
Many defined constants in wifi.h are unused and/or available from
<linux/ieee80211.h>, some with slightly different names. Use the
common ones, rename where necessary and remove unused.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200701182957.7932-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:30:19 +02:00
Michael Straube 69b2e08a8b staging: rtl8188eu: remove unused parameter
Remove unused parameter 'padapter' from rtw_os_xmit_resource_alloc().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200701165459.8904-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03 10:30:19 +02:00
Greg Kroah-Hartman 959cc33988 staging: wilc1000: remove obsolete TODO file
The movement of wilc1000 out of staging left an obsolete TODO file.

Remove that as it's no longer needed.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: <Ajay.Kathat@microchip.com>
Cc: <Venkateswara.Kaja@microchip.com>
Cc: <Sripad.Balwadgi@microchip.com>
Cc: <Nicolas.Ferre@microchip.com>
Cc: <johannes@sipsolutions.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-02 09:17:40 +02:00
Greg Kroah-Hartman c90e798c66 Merge branch 'wilc1000-move-out-of-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next into staging-next
This is the movement of the wilc1000 driver out of staging, pulled in
here so that we do not end up doing duplicate work.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

* 'wilc1000-move-out-of-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next:
  wilc1000: move wilc driver out of staging
2020-07-02 09:12:44 +02:00
Puranjay Mohan efa30b82ac staging: rtl8188eu: core: Fix coding style issue
Use %s and  __func__ in place of function names.
This solves following checkpatch.pl warning
WARNING: Prefer using '"%s...", __func__' to using 'rtw_do_join', this function's name, in a string

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Link: https://lore.kernel.org/r/20200701145457.9562-1-puranjay12@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 17:33:08 +02:00
Simon Fong c4199169a5 staging: rtl8188eu: core: Fix WARNING of Block comments
Fixed a WARNING of Block comments use * on subsequent lines.

Signed-off-by: Simon Fong <simon.fodin@gmail.com>
Link: https://lore.kernel.org/r/20200630022228.GA580@simon-pc
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:48:37 +02:00
Nicolas Saenz Julienne 2ad4ba07ef staging: vchiq: Move vchiq.h into include directory
To make the separation clear between vchiq's header files and vchiq.h,
which is to be used by services and is the 'public' API, move it into a
dedicated includes directory.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>

Link: https://lore.kernel.org/r/20200629150945.10720-48-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:08 +02:00
Nicolas Saenz Julienne 5ada309f4a staging: vchiq: Move defines into core header
Those are only used in the core vchiq code, while present in vchiq's
'public' API header. Move them into the right place.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-47-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:08 +02:00
Nicolas Saenz Julienne dcfbf457ae staging: vchiq: Use vchiq.h as the main header file for services
This used to be vchiq_if.h but vchiq.h is more concise for an include
file that will hopefully be in the future in the includes directory.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-46-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:08 +02:00
Nicolas Saenz Julienne 3d212a835c staging: vchiq: Move conditional barrier definition into vchiq_core.h
The barrier is only used by core code. So keep the barrier definition in
the core header.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-45-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:08 +02:00
Nicolas Saenz Julienne 9d52311134 staging: vchiq: Get rid of vchi
All the functions that vchi currently provides are a 1:1 mapping to its
vchiq counterparts. Get rid of vchi altogether and use vchiq's on all
services.

In the process also get rid of the vchi directory, as the only remaining
file was a TODO file, which now lives in the parent directory.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-44-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:08 +02:00
Nicolas Saenz Julienne 5c01fc5c00 staging: vchi: Move vchi_queue_kernel_message() into vchiq
We can't really merge it with vchiq_queue_message() as it has internal
users that will not benefit from the retry mechanism
vchiq_queue_kernel_message() uses. So, for the sake of getting rid of
vchi, move it into vchiq.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-43-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne 0bda14fd49 staging: vchi: Get rid of vchi_bulk_queue_transmit()
Its vchiq counterpart, vchiq_bulk_transmit() is only used by vchi. We
can then merge both functions by moving vchi_bulk_queue_transmit()'s
retry mechanism into vchiq_bulk_transmit() and let services call the
later.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-42-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne b2bbe3dc76 staging: vchi: Get rid of vchi_bulk_queue_receive()
Its vchiq counterpart, vchiq_bulk_receive() is only used by vchi. We can
then merge both functions by moving vchi_bulk_queue_receive()'s retry
mechanism into vchiq_bulk_receive() and let services call the later.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-41-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne 76dbbe7706 staging: vchiq: Move definitions only used by core into core header
vchiq_if.h is used by service consumers and only the exported API should
be present. Move the rest of definitions, which were not exported by the
way, to vchiq_core.h where they belong.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-40-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne 9f10ddbd6f staging: vchiq: Make vchiq_add_service() local
The function is being exported although there is no use for it outside
of vchiq's core code. Keep it local then.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-39-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne af948db021 staging: vchiq: Get rid of unnecessary definitions in vchiq_if.h
Those functions don't actually exist, nor have any use, nor the macros.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-38-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne 67a3f7df21 staging: vchi: Don't include vchiq_core.h
This file is internal to vchiq.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-37-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne 1a883994ef staging: vchi: Get rid of struct vchiq_instance forward declaration
It's already forward declared in vchiq_if.h. So no need to insist

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-36-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:07 +02:00
Nicolas Saenz Julienne b06eba5c52 staging: vchiq: Unify fourcc definition mechanisms
There is already enough duplication with regard to fourcc generation in
the kernel. Let's at least use the same macro all over the vchiq
ecosystem.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-35-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne b1d362f408 staging: vchi: Rework vchi_msg_hold() to match vchiq_msg_hold()
The services have access to struct vchiq_header's internals, so we can
let them get the data pointer. This pretty much makes both functions
exactly the same, which will allow us to make a switch to
vchiq_msg_hold() further down the road.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-34-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne 7c018ed10c staging: vchiq: Pass vchiq's message when holding a message
vchi created an opaque structure to be held by services while they
process callback messages. The contents of this opaque structure are the
service handle, which all services already maintain, and a pointer to
vchiq's message structure, struct vchiq_header.

Let's get rid of this opaque structure and directly pass struct
vchiq_header, which is what ultimately vchiq consumes when handling
callback messages.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-33-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne 3a8895a921 staging: vchi: Get rid of struct vchi_service
The structure only contains a single parameter, which is the underlying
vchiq handle. Get rid of the struct and directly pass the handle around.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-32-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne 65c7536672 staging: vchi: Use struct vchiq_service_params
For initialization, vchi has its own params structure, which is then
translated to vchiq's params structure. They are essentially the same,
so lets directly use vchiq's.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-31-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne 47cc5b16b0 staging: vchiq: Don't use a typedef for vchiq_callback
Linux coding style says to avoid typdefs.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-30-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne 3c5da06f99 staging: vchi: Get rid of vchiq_shim's message callback
As vchiq_shim's callback does nothing aside from pushing messages into
the service's queue, let's bypass it and jump directly to the service's
callbacks, letting them choose whether to use the message queue.

It turns out most services don't need to use the message queue, which
makes for simpler code in the end.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-29-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:06 +02:00
Nicolas Saenz Julienne b79134e9de staging: vchiq: Export vchiq_msg_queue_push
vchiq consumer drivers may need to use this function in order to get the
benefits of vchiq's per service message queueing mechanism.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-28-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:05 +02:00
Nicolas Saenz Julienne 31eeca20b7 staging: vchiq: Export vchiq_get_service_userdata()
This is for service's callbacks to get their private data.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-27-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:05 +02:00
Nicolas Saenz Julienne 823568cf17 staging: vchi: Expose struct vchi_service
This will make further changes easier. The struct will ultimately
disappear.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-26-nsaenzjulienne@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:47:05 +02:00