Commit Graph

915491 Commits

Author SHA1 Message Date
R Veera Kumar
4a585df368 staging: vc04_services: bcm2835-audio: Make function arguments alignment match open parenthesis
Make function arguments alignment match open parenthesis.
Found using checkpatch.pl.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:43 +02:00
Jérôme Pouiller
ed4a707d26 staging: wfx: ensure that probe requests are filtered when AP
Device is able to automatically reply to probe request (therefore, the
probe requests are not forwarded to host). This feature is enabled by
wfx_start_ap(). However, further calls to wfx_configure_filter() can
disable it.

So, relocate the handling of probe request filtering in
wfx_configure_filter().

Note that wfx_configure_filter() is always called by mac80211 when an AP
start.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:43 +02:00
Jérôme Pouiller
0f55a72e7e staging: wfx: stop changing filtering rule in wfx_hw_scan()
It is not very clear why driver ask to firmware to stop filtering probe
request during scan. It is particularly weird because scan is not
supported in AP mode. In add, it does not restore previous filtering
state after scanning.

It seems to be a mistake and should be dropped.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:43 +02:00
Jérôme Pouiller
349e540a3d staging: wfx: do not use built-in AUTO_ERP feature
Firmware is able to detect detect changes about ERP protection in
beacons and automatically enable/disable ERP protection. However, it not
bring performance improvements and we are more confident in the ERP
handling of mac80211. So, the patch disable this feature.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:42 +02:00
Jérôme Pouiller
eb52d63a6d staging: wfx: disabling beacon filtering after hif_reset() is useless
After hif_reset(), device stop to receive any RF data. So, it is
useless to disable beacon filtering. In add, if necessary, mac80211 will
call wfx_configure_filter().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:42 +02:00
Jérôme Pouiller
1ab6bf4c56 staging: wfx: do not wait for a dtim before associate
The only reason we ask to mac80211 to wait for a dtim before to
associate is to get an accurate DTIM value. However, we can temporary
set the dtim period to 1. Then we can waiting for
BSS_CHANGED_BEACON_INFO for the real value. Thus, the association
process is faster.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:41 +02:00
Jérôme Pouiller
b3919d9bbc staging: wfx: wfx_update_filtering_work() is no more used
Since we had simplified the join process, update_filtering_work is no
more used. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:41 +02:00
Jérôme Pouiller
e269060e79 staging: wfx: simplify handling of beacon filter during join process
When the device joins an AP, beacon are forwarded to the host. Once has
retrieved all necessary parameters, we can start to filter the beacon
(and only beacon with changed/new data will be forwarded).

Currently, the driver detect beacons in data Rx process. It is far more
easier to just wait for the BSS_CHANGED_BEACON_INFO event.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:40 +02:00
Jérôme Pouiller
b460713a5a staging: wfx: rework wfx_configure_filter()
wfx_configure_filter() lacks of coherency. In add, some corner cases
seems to not been handled properly. Rework the whole function().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:40 +02:00
Jérôme Pouiller
e86bc725ba staging: wfx: simplify wfx_update_filtering()
Inline wfx_set_mcast_filter() into wfx_update_filtering() and remove
useless intermediate variables.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:40 +02:00
Jérôme Pouiller
427fd02e16 staging: wfx: update filtering even if not connected
Currently, filtering are not update if the device is not connected.
There is no obvious rationale for that. Updating filtering while it is
not necessary is harmless. On the other hand, it is difficult to ensure
that the filtering rule has been correctly sent to the firmware.

Just drop this useless condition.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:29:39 +02:00
Malcolm Priestley
ce92032666 staging: vt6656: formulate rspinf values into tables
Four tables can be extracted from RSPINF_A_* based on BB_TYPE_11A or
else being GB rates.

Preamble short or long tables from fixed size len of 14 for RSPINF_B rates.

Remove function vnt_calculate_ofdm_rate and replace with the tables
calling RSPINF_A and RSPINF_B separately.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/addca9e1-9ea2-59ee-dec9-3afb3c731c2e@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:59:17 +02:00
Ivan Safonov
9ed05c15a3 staging: r8188eu: replace rtw_malloc/copy_from_user sequence with memdup_user
memdup_user is shorter and expressively.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200412173716.846469-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:57:51 +02:00
Oscar Carter
823b6a951f staging: vt6656: Remove unnecessary local variable initialization
Don't initialize the ret variable as it is set a few lines later.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200411125104.9625-3-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:57:46 +02:00
Oscar Carter
2661509ffa staging: vt6656: Remove duplicate code in vnt_vt3184_init function
Remove duplicate code in "if" statements because different branches are
almost the same.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200411125104.9625-2-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:57:45 +02:00
Oscar Carter
8d71b5e11d staging: vt6656: Remove unnecessary local variable initialization
Don't initialize the rate variable as it is set a few lines later.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200407163915.7491-3-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:55:33 +02:00
Malcolm Priestley
2da5445be1 staging: vt6656: rxtx remove rate change and current_rate.
There is no longer any need to change power in vnt_tx_packet.

Remove current_rate in vnt_tx_packet and struct vnt_private as
it is no longer used elsewhere.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/3ba896aa-5ab2-affb-9ce5-7df8a9b3190a@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:53:22 +02:00
Malcolm Priestley
463288b981 staging: vt6556: vnt_rf_setpower convert to use ieee80211_channel.
ieee80211_channel contains all the necessary information to change
power according to tx mode required.

vnt_rf_setpower is moved and so that vnt_rf_set_txpower the only
caller becomes static.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/9eab9af8-fde9-1dc6-fced-95c7a36ecc01@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:53:21 +02:00
Jason Yan
a6a002fd89 staging: vc04_services: remove set but not used 'local_entity_uc'
Fix the following gcc warning:

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:2356:16:
warning: variable ‘local_entity_uc’ set but not used
[-Wunused-but-set-variable]
  int local_uc, local_entity_uc;
                ^~~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200409085339.47255-1-yanaijie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:53:21 +02:00
Michael Straube
9485a408ae staging: rtl8188eu: remove 5 GHz if test
Cleanup a line over 80 characters by removing an if test that is valid
only for 5 GHz. According to the TODO 5 GHz code should be removed.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200409080802.16645-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:53:20 +02:00
Sergio Paracuellos
fab6710e4c staging: mt7621-pci: fix PCIe interrupt mapping
MT7621 has three assigned interrupts for the pcie. This
interrupts should properly being mapped taking into account
which devices are finally connected in which bus according
to link status. So the irq mappings should be as follows
according to link status (three bits indicating which devices
are link up):

* For PCIe Bus 1 slot 0:
  - status = 0x2 || status = 0x6 => IRQ = pcie1_irq (24).
  - status = 0x4 => IRQ = pcie2_irq (25).
  - default => IRQ = pcie0_irq (23).
* For PCIe Bus 2 slot 0:
  - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25).
  - default => IRQ = pcie1_irq (24).
* For PCIe Bus 2 slot 1:
  - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25).
  - default => IRQ = pcie1_irq (24).
* For PCIe Bus 3 any slot:
  - default => IRQ = pcie2_irq (25).

Because of this, the function 'of_irq_parse_and_map_pci' cannot
be used and we need to change device tree information from using
the 'interrupt-map' and 'interrupt-map-mask' properties into an
'interrupts' property to be able to get irq information from the
ports using the 'platform_get_irq' and storing an 'irq-map' into
the pcie driver data node to properly map correct irq using a
new 'mt7621_map_irq' function where this map will be read and the
correct irq returned.

Fixes: 46d093124d ("staging: mt7621-pci: improve interrupt mapping")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413055942.2714-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:49:18 +02:00
Sergio Paracuellos
be3d9b6802 staging: mt7621-pci-phy: dt: bindings: remove bindings txt file
Yaml file for bindings has been properly added. Hence, remove
the old txt file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200410091836.13068-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:49:17 +02:00
Sergio Paracuellos
2d60093f8e staging: mt7621-pci-phy: dt: bindings: add mediatek, mt7621-pci-phy.yaml
Add bindings to describe Mediatek MT7621 PCIe PHY.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200410091836.13068-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:49:17 +02:00
Sergio Paracuellos
5fcded5e85 staging: mt7621-pci: properly power off dual-ported pcie phy
Pcie phy for pcie0 and pcie1 is shared using a dual ported
one. Current code was assuming that if nothing is connected
in pcie0 it won't be also nothing connected in pcie1. This
assumtion is wrong for some devices such us 'Mikrotik rbm33g'
and 'ZyXEL LTE3301-PLUS' where only connecting a card to the
second bus on the phy is possible. For such devices kernel
hangs in the same point because of the wrong poweroff of the
phy getting the following trace:

mt7621-pci-phy 1e149000.pcie-phy: PHY for 0xbe149000 (dual port = 1)
mt7621-pci-phy 1e14a000.pcie-phy: PHY for 0xbe14a000 (dual port = 0)
mt7621-pci-phy 1e149000.pcie-phy: Xtal is 40MHz
mt7621-pci-phy 1e14a000.pcie-phy: Xtal is 40MHz
mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
[hangs]

The wrong assumption is located in the 'mt7621_pcie_init_ports'
function where we are just making a power off of the phy for
slots 0 and 2 if nothing is connected in them. Hence, only
poweroff the phy if nothing is connected in both slot 0 and
slot 1 avoiding the kernel to hang.

Fixes: 5737cfe87a ("staging: mt7621-pci: avoid to poweroff the phy for slot one")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200409111652.30964-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:49:16 +02:00
Jérôme Pouiller
a53f548597 staging: wfx: drop useless update of macaddr
Mac address is set in wfx_add_interface() and removed in
wfx_remove_interface().

Currently, there is also an additional update of mac address in
wfx_do_unjoin(). It has no rationale. Mac address is already present
and nothing has changed it. Therefore, we can drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-20-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:51 +02:00
Jérôme Pouiller
790241e928 staging: wfx: drop unused attribute 'beacon_int'
The field beacon_int is never read. Drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-19-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:51 +02:00
Jérôme Pouiller
239a1d3c64 staging: wfx: check value of beacon_int
Firmware dislike when beacon_int value is 0. This patch add some
warnings in case it would happen.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:50 +02:00
Jérôme Pouiller
ac243a1b6f staging: wfx: re-enable BA after reset
Firmware does not support Block Acks when multiple vif are running.
Thus, wfx_add_interface() and wfx_remove_interface() enable and disable
Block Acks as necessary.

Block Ack policy is also reset after hif_reset(). Driver have to
re-enable it after each call to hif_reset().

This patch reflects this behavior.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:49 +02:00
Jérôme Pouiller
e836ad4e2d staging: wfx: introduce wfx_join_ibss() and wfx_leave_ibss()
Currently, IBSS networks are started by the mean of
wfx_bss_info_changed(). It easier to use use callbacks provided by
mac80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:49 +02:00
Jérôme Pouiller
17c8cc79ef staging: wfx: allow to join IBSS networks
Current code does not permit to join an already existing IBSS network.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:48 +02:00
Jérôme Pouiller
7b063f3bfb staging: wfx: avoid duplicate updating of beacon template
When ERP changes, mac80211 call wfx_bss_info_changed() with
BSS_CHANGED_ERP_* and with BSS_CHANGED_BEACON.

The driver already update beacon template because of
BSS_CHANGED_BEACON. It is not necessary to also update beacon template
because of BSS_CHANGED_ERP_*.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:47 +02:00
Jérôme Pouiller
974dfbf8fe staging: wfx: remove unnecessary conditions in wfx_bss_info_changed()
wfx_bss_info_changed() update ERP and CQM related stuff. Thus, it check
the flags BSS_CHANGED_ERP_* and BSS_CHANGED_CQM.

It also update ERP and CQM on join and leave by checking the flag
BSS_CHANGED_ASSOC. This check is useless. Mac80211 already do that job
and set necessary flags as expected.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:46 +02:00
Jérôme Pouiller
23d57c152c staging: wfx: request to send beacons in IBSS mode
Currently, firmware take in charge of start/stop sending beacons while
in IBSS mode. However, this behavior may change in the further releases.

Currently, asking to firmware to send beacon while in IBSS mode return
an error but is harmless.

Therefore, send this request unconditionally.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:44 +02:00
Jérôme Pouiller
9f9a18e40e staging: wfx: drop unnecessary condition checks in wfx_upload_ap_templates()
In former code, wfx_upload_ap_templates() was called in more cases
than necessary. Therefore, it tried to not update the frame templates
if it was not necessary.

Now, wfx_upload_ap_templates() is called only if mac80211 asked to
update the templates. In add, it does not hurt to upload template if
they are not used. So, remove unnecessary conditions at beginning of
wfx_upload_ap_templates()

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200410133239.438347-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:42:44 +02:00
Jérôme Pouiller
54a9d85cab staging: wfx: disabling keep alive during unjoin is useless
After a call to hif_reset(), the parameters associated with BSS are
reset. So, it useless to explicitly reset the keep alive period.

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