platform/kernel/linux-starfive.git
3 years agoiwlwifi: pcie: try to grab NIC access early
Johannes Berg [Sun, 17 Oct 2021 13:59:45 +0000 (16:59 +0300)]
iwlwifi: pcie: try to grab NIC access early

Sometimes some NICs may fail to initialize, but if we have
such a scenario we may only see an alive timeout (i.e. the
firmware doesn't send us the alive message), and that will
only cause us to fail the interface up.

Try to once grab NIC access during device probe to ensure
we can properly talk to the hardware at all, and to do all
the potential workarounds in that function.

Since we now finish NIC init here, we can remove it from
the later potential read of the RF ID.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017165728.604dfc8f43bd.I07b58a5c9238f75413a91198452ba1268ee79425@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: reduce WARN_ON() in TX status path
Johannes Berg [Sun, 17 Oct 2021 13:26:04 +0000 (16:26 +0300)]
iwlwifi: mvm: reduce WARN_ON() in TX status path

Evidently, it's possible to hit this issue, so reduce the
noise from it by just having it print a (rate-limited)
message instead. We don't really know yet why we hit it,
but there's no value in having a WARN_ON() here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.8d503387b523.Id2c82d023df5128e553b28c935d30df4d9411917@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: allow rate-limited error messages
Johannes Berg [Sun, 17 Oct 2021 13:26:03 +0000 (16:26 +0300)]
iwlwifi: allow rate-limited error messages

Sometimes we might want to have an error message for something
related to TX/RX, but if that somehow happens frequently it'll
overwhelm the logs. Add IWL_ERR_LIMIT() to alleviate that by
rate-limiting those messages.

To do this, rework __iwl_err() a bit to have a mode argument
instead of passing yet another (bool) argument to it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.2cb1e6b75672.Iec5b1c1bcc6ebc87c586921a6c5c2a937f49e83c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: remove session protection after auth/assoc
Johannes Berg [Sun, 17 Oct 2021 13:26:02 +0000 (16:26 +0300)]
iwlwifi: mvm: remove session protection after auth/assoc

When auth/assoc completes, we should remove session protection,
except when association is successful, where we need it until a
beacon is received from the AP.

In particular, in the case of assoc comeback, currently the session
protection event just times out, leading to confusing messages:

  wlan0: 42:00:00:00:00:00 rejected association temporarily; comeback duration 1000 TU (1024 ms)
  iwlwifi 0000:00:00.0: Not associated and the session protection is over already...
  wlan0: Connection to AP 42:00:00:00:00:00 lost
  wlan0: associate with 42:00:00:00:00:00 (try 2/3)

mac80211 never does anything on the "Connection ... lost" as it's
not even connected.

Removing the session protection when it's no longer needed removes
those confusing messages and lets the device do other things in the
allocated time.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.95e4bebb069b.I635280e5d26c70414ac6eb5d62b46fe4bd942818@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove redundant iwl_finish_nic_init() argument
Johannes Berg [Sun, 17 Oct 2021 13:26:01 +0000 (16:26 +0300)]
iwlwifi: remove redundant iwl_finish_nic_init() argument

We don't need this argument, since in all cases where the
function is called, trans->trans_cfg is already set (it's
in fact set during allocation). Remove it to avoid any
confusion about it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.cb04580b8521.I7129d4ba3dc689af839761d5807a10f99718893e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Add RTS and CTS flags to iwl_tx_cmd_flags.
Miri Korenblit [Sun, 17 Oct 2021 13:26:00 +0000 (16:26 +0300)]
iwlwifi: mvm: Add RTS and CTS flags to iwl_tx_cmd_flags.

As part of the new rate_n_flags, the RTS and CTS flags
are being removed from it. Instead, we have these flags
in the flags field in the TX command.
Add to new flags to the iwl_tx_cmd_flags enum.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.b5aaabb04432.I999f86ed6a9d9b99e63a33f724963f83f85fbb44@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: remove csi from iwl_mvm_pass_packet_to_mac80211()
Luca Coelho [Sun, 17 Oct 2021 13:25:59 +0000 (16:25 +0300)]
iwlwifi: mvm: remove csi from iwl_mvm_pass_packet_to_mac80211()

Remove the unused csi parameter from
iwl_mvm_pass_packet_to_mac80211().  It is not used anymore, but was
accidentally left in.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20211017132604.480251-2-luca@coelho.fi
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Support new rate_n_flags for REPLY_RX_MPDU_CMD and RX_NO_DATA_NOTIF
Luca Coelho [Sun, 17 Oct 2021 13:25:58 +0000 (16:25 +0300)]
iwlwifi: mvm: Support new rate_n_flags for REPLY_RX_MPDU_CMD and RX_NO_DATA_NOTIF

As part of the new rate_n_flags this two APIs
may use the new rate. Add support for the new rate.
These two APIs were updated in one patch because both of them
are using the same functions which were changed.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.7eb6240b8079.I1e804e70a8ebd23840a9431fc5d2a56ad8d5d1a2@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Support new TX_RSP and COMPRESSED_BA_RES versions
Miri Korenblit [Sun, 17 Oct 2021 13:25:57 +0000 (16:25 +0300)]
iwlwifi: mvm: Support new TX_RSP and COMPRESSED_BA_RES versions

As part of the new rate_n_flags, a new version of this
structures was added in the FW. Add support for this new
version and for the new rate_n_flags in this API.
Both these APIs were updated in one patch since they are
using the same functions.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.a28e7a92f558.I19f72735c674f815c6e7c11cecfad6230b4510ef@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Support new version of BEACON_TEMPLATE_CMD.
Miri Korenblit [Sun, 17 Oct 2021 13:25:56 +0000 (16:25 +0300)]
iwlwifi: mvm: Support new version of BEACON_TEMPLATE_CMD.

As part of the new rate_n_flags, a new version of
BEACON_TEMPLATE_CMD was added in FW in order to support
the new rate_n_flags.
Add support for the new version.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.b42e67f14293.Ic3f1ed8cb3a31cfaa51174497dd993936b00d398@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Add support for new rate_n_flags in tx_cmd.
Miri Korenblit [Sun, 17 Oct 2021 13:25:55 +0000 (16:25 +0300)]
iwlwifi: mvm: Add support for new rate_n_flags in tx_cmd.

As part of the new rate_n_flags, tx_cmd API has changed.
Add support for these changes.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.26efa51624b1.Ic96ae4d81b3ff07fb514df2b5f6a8e470e4d3778@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: BZ Family SW reset support
Roee Goldfiner [Sun, 17 Oct 2021 13:25:54 +0000 (16:25 +0300)]
iwlwifi: BZ Family SW reset support

Previously added BZ reset wasn't taking into account the
call to iwl_trans_pcie_sw_reset which used a pre-BZ logic
to reset the device - enabling iwl_trans_pcie_sw_reset to
support BZ family made this reset redundant.

MAC_ACCESS clear shouldn't be called here but only when calling
_iwl_trans_pcie_stop_device which now support also BZ family.

Signed-off-by: Roee Goldfiner <roee.h.goldfiner@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.648931fe07e2.Ibf30f9b8e70536da93c4a574ace33d325d3f8da4@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: BZ Family BUS_MASTER_DISABLE_REQ code duplication
Roee Goldfiner [Sun, 17 Oct 2021 13:25:53 +0000 (16:25 +0300)]
iwlwifi: BZ Family BUS_MASTER_DISABLE_REQ code duplication

Remove redundant code which occurs anyway in a later stage and add
msleep(100) which is required after disable request.

Signed-off-by: Roee Goldfiner <roee.h.goldfiner@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.46183bcd6549.Ie05161496810d3f28fb9d1fecb5f8593889ed2c6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: yoyo: fw debug config from context info and preset
Mukesh Sisodiya [Sun, 17 Oct 2021 09:40:19 +0000 (12:40 +0300)]
iwlwifi: yoyo: fw debug config from context info and preset

Add new TLV for debug config set to read preset
based on TLV is set in context info.
This is needed to set the preset based on ucode in early
trigger point.
Add DRAM frag allocation info in first fragment of
DBGC1 with all details.
New capability from FW for DBGC frag debug support is
added and BUFFER_ALLOCATION_CMD is disabled in capability
is supported.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.cacf0babc521.If3704b5fda09b344e3e438252360898a3f2e90fa@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Support new version of ranging response notification
Miri Korenblit [Sun, 17 Oct 2021 09:40:18 +0000 (12:40 +0300)]
iwlwifi: mvm: Support new version of ranging response notification

As part of the new rate_n_flags, FW added a new version for
LOCATION_RANGE_RSP_NTFY, and it's internal structure -
LOCATION_RANGE_RSP_AP_ETRY_NTFY. Add support for this.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.c5c6c863631e.I4b493f4eeabbfa1dc965ae012b72fc57de7d5f4f@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Support version 3 of tlc_update_notif.
Miri Korenblit [Sun, 17 Oct 2021 09:40:17 +0000 (12:40 +0300)]
iwlwifi: mvm: Support version 3 of tlc_update_notif.

As part of the new rate_n_flags, a new version of tlc_update_notif
was added in FW in order to support the new rate_n_flags.
Add support for the new version, and move the all API to use the
new rate_n_flags only (if FW supports the old one - convert it).

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.9fc0cb5d5898.I1f88e02317f79f1be7f792c01236d836045a44b3@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: convert old rate & flags to the new format.
Miri Korenblit [Sun, 17 Oct 2021 09:40:16 +0000 (12:40 +0300)]
iwlwifi: mvm: convert old rate & flags to the new format.

As part of the new rate & flags, convert an old format rate to
the new. This is needed if the driver supports the new format
but the FW supports the old one.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.1ea5263dafec.Iadffe7cb26554d4c23c9242eb2ec8326306202a9@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: add definitions for new rate & flags
Miri Korenblit [Sun, 17 Oct 2021 09:40:15 +0000 (12:40 +0300)]
iwlwifi: mvm: add definitions for new rate & flags

As a part of preparing to the new rate & flags,
add new needed definitions.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.41563bea6610.I51a886fa75cca723c81877b386ba41b2a9db1122@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: update definitions due to new rate & flags
Miri Korenblit [Sun, 17 Oct 2021 09:40:14 +0000 (12:40 +0300)]
iwlwifi: mvm: update definitions due to new rate & flags

As a part of preparing to the new rate & flags version
Update the relevant definitions and use them.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.5862bf4f14c4.Ib476b5443faa085539b79d49a0aebd81a213b42f@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: scrub key material in firmware dumps
Johannes Berg [Sun, 17 Oct 2021 09:40:13 +0000 (12:40 +0300)]
iwlwifi: mvm: scrub key material in firmware dumps

Use the previously added infrastructure to scrub key material
in firmware dumps:
 * in the TX FIFO data, just search for each key that we
   know about and override such data
 * scrub various commands that we sent to the firmware if
   they're present
 * in firmware memory, where advertised by firmware TLVs

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.d1514964e6a7.I18f8c2ce8082952af7cfe5f8fe75fe51851b8853@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: parse debug exclude data from firmware file
Johannes Berg [Sun, 17 Oct 2021 09:40:12 +0000 (12:40 +0300)]
iwlwifi: parse debug exclude data from firmware file

Parse the memory dump exclusion TLVs from the firmware file
and save the data to be able to apply them later upon dump.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.ec280bcb32cb.Iac0da0e22d7c3c0e237867c9113a06ddd95c7a51@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: fw dump: add infrastructure for dump scrubbing
Johannes Berg [Sun, 17 Oct 2021 09:40:11 +0000 (12:40 +0300)]
iwlwifi: fw dump: add infrastructure for dump scrubbing

In firmware dumps, currently all kinds of key material may be
included, e.g. in host commands (if firmware crashes during the
processing of a key-related command) or in the TX FIFO(s) if
we have been using in-TX-command key material.

Additionally, some firmware versions will advertise sections
of their internal data to not dump, due to them containing some
sensitive data.

Add some infrastructure to allow scrubbing this data out, as
dependent on the opmode's idea of what will need to be done.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.360cc8fe55b1.Ie3bd3ece38043969f7e116e61a6ec1197a58d78b@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: correct sta-state logic for TDLS
Johannes Berg [Sun, 17 Oct 2021 09:40:10 +0000 (12:40 +0300)]
iwlwifi: mvm: correct sta-state logic for TDLS

For TDLS stations, much of the sta-state logic shouldn't apply,
since they don't affect the link to the AP. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.954001ec079f.I9deb8bc7520ad569a453f72c8d99adc9c99c9be3@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: api: fix struct iwl_wowlan_status_v7 kernel-doc
Johannes Berg [Sun, 17 Oct 2021 09:40:09 +0000 (12:40 +0300)]
iwlwifi: api: fix struct iwl_wowlan_status_v7 kernel-doc

This was mislabeled as struct iwl_wowlan_status, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.f2ff92fcbe4d.Id2b8edd2160d9a703a7a2744e1139017cfd958c0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: fix fw/img.c license statement
Johannes Berg [Sun, 17 Oct 2021 09:40:08 +0000 (12:40 +0300)]
iwlwifi: fix fw/img.c license statement

We still had the entire license statement here, but with BSD,
so the SPDX tag was not matching the actual text. Fix that
and remove all the texts since they're no longer needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.328c2b33081c.Ib3570e8f214538a878204cc2b0b612b5ed0571b3@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove contact information
Johannes Berg [Sun, 17 Oct 2021 08:43:48 +0000 (11:43 +0300)]
iwlwifi: remove contact information

The list address is going away, and the postal address isn't
useful, remove all the contact information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.f73e3b6384cb.I967fd394995461277eafa149bb25cefd1673751e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove MODULE_AUTHOR() statements
Johannes Berg [Sun, 17 Oct 2021 08:43:47 +0000 (11:43 +0300)]
iwlwifi: remove MODULE_AUTHOR() statements

Consensus seems to be emerging that corporations or groups
shouldn't be listed as module authors, and we will not
maintain this email address any longer. Just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.32109514aad0.I91a7d745f4ab50ee8ef918ece00dda8251541595@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: api: remove unused RX status bits
Johannes Berg [Sun, 17 Oct 2021 08:43:46 +0000 (11:43 +0300)]
iwlwifi: api: remove unused RX status bits

These bits are unused and don't actually exist in the firmware
API any longer. Remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.022a9f87fdbd.Iae7b8a0196b6e94f9dc525e92a541a28374b0cac@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: add some missing kernel-doc in struct iwl_fw
Johannes Berg [Sun, 17 Oct 2021 08:43:45 +0000 (11:43 +0300)]
iwlwifi: add some missing kernel-doc in struct iwl_fw

The phy integration string members were missed, add them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.8aa65feeda5f.Idf492c939f7f8856da09c5017c16b8b88438395d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Remove antenna c references
Miri Korenblit [Sun, 17 Oct 2021 08:43:44 +0000 (11:43 +0300)]
iwlwifi: mvm: Remove antenna c references

Since antenna c is not in use and won't be relevant after the new rate &
flags, remove all it's references

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.5e39106ec75b.I4281edc844f734bf9591396a5cc8009ad37ccda8@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: add support for 160Mhz in ranging measurements
Avraham Stern [Sun, 17 Oct 2021 08:43:43 +0000 (11:43 +0300)]
iwlwifi: mvm: add support for 160Mhz in ranging measurements

Add support for 160Mhz bandwidth in ranging measurements for
initiator and responder. Advertise 160Mhz in the supported
bandwidths for ranging.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.32a13ac0f4d4.I883492648518cc5067a2f91b7ecf8bfa55f6876a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: add vendor specific capabilities for some RFs
Johannes Berg [Sun, 17 Oct 2021 08:43:42 +0000 (11:43 +0300)]
iwlwifi: add vendor specific capabilities for some RFs

On some RFs we want to advertise vendor specific capabilities to
indicate support for improved beamforming rates and/or on 160 MHz,
some APs where Intel has collaborated with the vendor will use it
to improve behaviour. Add these elements where relevant, i.e. for
HR and GF RFs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.510f0ef9c2d5.If99bdb9009583ac7cc6cbb708e871a67df836dbe@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: add lmac/umac PC info in case of error
Mordechay Goodstein [Sun, 17 Oct 2021 08:43:41 +0000 (11:43 +0300)]
iwlwifi: mvm: add lmac/umac PC info in case of error

Currently it's only added to 22000 family in this patch we also add
it to 9000 family where it's also relevant.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.e51c61b31037.I118299d9d6eeef211cc8d4ee72193fdddc54d446@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: disable RX-diversity in powersave
Johannes Berg [Sun, 17 Oct 2021 08:43:40 +0000 (11:43 +0300)]
iwlwifi: mvm: disable RX-diversity in powersave

Just like we have default SMPS mode as dynamic in powersave,
we should not enable RX-diversity in powersave, to reduce
power consumption when connected to a non-MIMO AP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.fc896bc5cdaa.I1d11da71b8a5cbe921a37058d5f578f1b14a2023@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: fix ieee80211_get_he_iftype_cap() iftype
Johannes Berg [Sun, 17 Oct 2021 08:43:39 +0000 (11:43 +0300)]
iwlwifi: mvm: fix ieee80211_get_he_iftype_cap() iftype

We should consider the P2P interface type, which isn't in
vif->type due to mac80211's special handling of that. Use
ieee80211_vif_type_p2p() to convert appropriately.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017113927.8e992a3beee2.I4231ac8a7ae8f844e35a1ec221baf3e2b676e765@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: Start scratch debug register for Bz family
Matti Gottlieb [Thu, 26 Aug 2021 19:47:48 +0000 (22:47 +0300)]
iwlwifi: Start scratch debug register for Bz family

Start scratch debug register for Bz family.
This register is used for FW debug, and the driver
should start this register with a fixed value, during
init, and upon an error, should read it, and add it to
the dump.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210826224715.609ad58a49f3.I05c351233601ecc51dddfa5df69ace292216eb95@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: Add support for more BZ HWs
Matti Gottlieb [Thu, 26 Aug 2021 19:47:47 +0000 (22:47 +0300)]
iwlwifi: Add support for more BZ HWs

Add support for GA and for BZ with FM rf.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210826224715.64ab5278fb9f.I4f2a547dc04c3d14cacdbc739da0b056fc04923d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: Add support for getting rf id with blank otp
Matti Gottlieb [Thu, 26 Aug 2021 19:47:46 +0000 (22:47 +0300)]
iwlwifi: Add support for getting rf id with blank otp

When having a blank OTP the only way to get the rf id
and the cdb info is from prph registers.

Currently there is some implementation for this, but it
is located in the wrong place in the code (should be before
trying to understand what HW is connected and not after),
and it has a partial implementation.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210826224715.820c2ae18c2b.Iec9b2e2615ce65e6aff5ce896589227a7030f4cf@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoMerge tag 'mt76-for-kvalo-2021-10-20' of https://github.com/nbd168/wireless
Kalle Valo [Wed, 20 Oct 2021 16:08:25 +0000 (19:08 +0300)]
Merge tag 'mt76-for-kvalo-2021-10-20' of https://github.com/nbd168/wireless

mt76 patches for 5.16

* various bugfixes
* endian fixes
* mt7921 aspm support
* cleanup
* mt7921 testmode support
* rate handling fixes
* tx status fixes/improvements
* mt7921 power management improvements
* mt7915 LED support
* DBDC fixes
* mt7921 6GHz support
* support for eeprom data in DT
* mt7915 TWT support
* mt7915 txbf + MU-MIMO improvements

# gpg: Signature made Wed 20 Oct 2021 12:24:46 PM EEST
# gpg:                using DSA key D77D141D02A76EF5
# gpg: Good signature from "Felix Fietkau <nbd@nbd.name>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 75D1 1A7D 91A7 710F 4900  42EF D77D 141D 02A7 6EF5

3 years agozd1201: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:21 +0000 (16:50 -0700)]
zd1201: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-16-kuba@kernel.org
3 years agowl3501_cs: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:20 +0000 (16:50 -0700)]
wl3501_cs: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-15-kuba@kernel.org
3 years agoray_cs: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:19 +0000 (16:50 -0700)]
ray_cs: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-14-kuba@kernel.org
3 years agowilc1000: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:18 +0000 (16:50 -0700)]
wilc1000: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-13-kuba@kernel.org
3 years agohostap: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:16 +0000 (16:50 -0700)]
hostap: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-11-kuba@kernel.org
3 years agoipw2200: prepare for const netdev->dev_addr
Jakub Kicinski [Mon, 18 Oct 2021 23:50:15 +0000 (16:50 -0700)]
ipw2200: prepare for const netdev->dev_addr

netdev->dev_addr will be come const soon, constify the argument
to command send to avoid compiler warnings.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-10-kuba@kernel.org
3 years agoairo: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:14 +0000 (16:50 -0700)]
airo: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Use dev_addr_set() to match the existing logic.
setup_card() is always passed netdev->dev_addr, so pass the netdev
pointer instead and assign the address using a helper there.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-9-kuba@kernel.org
3 years agobrcmfmac: prepare for const netdev->dev_addr
Jakub Kicinski [Mon, 18 Oct 2021 23:50:13 +0000 (16:50 -0700)]
brcmfmac: prepare for const netdev->dev_addr

netdev->dev_addr will become const soon. Make sure local
variables maintain that qualifier.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-8-kuba@kernel.org
3 years agoatmel: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:12 +0000 (16:50 -0700)]
atmel: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Use a buffer on the stack. Note that atmel_get_mib() is a wrapper
around atmel_copy_to_host(). For the to device direction we just
need to make sure functions respect argument being cost.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-7-kuba@kernel.org
3 years agowil6210: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:11 +0000 (16:50 -0700)]
wil6210: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Do the special encoding on the stack, then copy the address.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-6-kuba@kernel.org
3 years agoath6kl: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:10 +0000 (16:50 -0700)]
ath6kl: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Do the special encoding on the stack, then copy the address.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-5-kuba@kernel.org
3 years agowireless: use eth_hw_addr_set() for dev->addr_len cases
Jakub Kicinski [Mon, 18 Oct 2021 23:50:09 +0000 (16:50 -0700)]
wireless: use eth_hw_addr_set() for dev->addr_len cases

Convert all WiFi drivers from memcpy(... dev->addr_len)
to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - memcpy(dev->dev_addr, np, dev->addr_len)
  + eth_hw_addr_set(dev, np)

Manually checked the netdevs are allocated with alloc_etherdev(),
so dev->addr_len must be equal to ETH_ALEN.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-4-kuba@kernel.org
3 years agowireless: use eth_hw_addr_set() instead of ether_addr_copy()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:08 +0000 (16:50 -0700)]
wireless: use eth_hw_addr_set() instead of ether_addr_copy()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert wireless from ether_addr_copy() to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - ether_addr_copy(dev->dev_addr, np)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-3-kuba@kernel.org
3 years agowireless: use eth_hw_addr_set()
Jakub Kicinski [Mon, 18 Oct 2021 23:50:07 +0000 (16:50 -0700)]
wireless: use eth_hw_addr_set()

Convert all WiFi drivers from memcpy(... ETH_ADDR)
to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - memcpy(dev->dev_addr, np, ETH_ALEN)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-2-kuba@kernel.org
3 years agoiwlwifi: cfg: set low-latency-xtal for some integrated So devices
Johannes Berg [Sat, 16 Oct 2021 08:43:59 +0000 (11:43 +0300)]
iwlwifi: cfg: set low-latency-xtal for some integrated So devices

The integrated So devices covered by the iwl_so_long_latency_trans_cfg
configuration should all have low-latency-xtal enabled, so do that.
While at it, remove the TODO, I've checked the other values as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 6f60fb03c8e7 ("iwlwifi: move SnJ and So rules to the new tables")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.8b5480113f53.I80b5b4ebea84e56f3b3143fc1ee7097be8b4ae78@changeid
3 years agoiwlwifi: pnvm: read EFI data only if long enough
Johannes Berg [Sat, 16 Oct 2021 08:43:58 +0000 (11:43 +0300)]
iwlwifi: pnvm: read EFI data only if long enough

If the data we get from EFI is not even long enough for
the package struct we expect then ignore it entirely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: a1a6a4cf49ec ("iwlwifi: pnvm: implement reading PNVM from UEFI")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.33feba783518.I54a5cf33975d0330792b3d208b225d479e168f32@changeid
3 years agoiwlwifi: pnvm: don't kmemdup() more than we have
Johannes Berg [Sat, 16 Oct 2021 08:43:57 +0000 (11:43 +0300)]
iwlwifi: pnvm: don't kmemdup() more than we have

We shouldn't kmemdup() more data than we have, that might
cause the code to crash. Fix that by updating the length
before the kmemdup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.ab0e64c3fba9.Ic6a3295fc384750b51b4270bf0b7d94984a139f2@changeid
3 years agoiwlwifi: change all JnP to NO-160 configuration
Yaara Baruch [Sat, 16 Oct 2021 08:43:56 +0000 (11:43 +0300)]
iwlwifi: change all JnP to NO-160 configuration

JnP should not have the 160 MHz.

Signed-off-by: Yaara Baruch <yaara.baruch@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.ee163f4a7513.I7f87bd969a0b038c7f3a1a962d9695ffd18c5da1@changeid
3 years agoiwlwifi: mvm: reset PM state on unsuccessful resume
Johannes Berg [Sat, 16 Oct 2021 08:43:55 +0000 (11:43 +0300)]
iwlwifi: mvm: reset PM state on unsuccessful resume

If resume fails for some reason, we need to set the PM state
back to normal so we're able to send commands during firmware
reset, rather than failing all of them because we're in D3.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 708a39aaca22 ("iwlwifi: mvm: don't send commands during suspend\resume transition")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.7ceb9eaca9f6.If0cbef38c6d07ec1ddce125878a4bdadcb35d2c9@changeid
3 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 20 Oct 2021 08:56:50 +0000 (11:56 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for v5.16. Major changes:

ath9k

* add option to reset the wifi chip via debugfs

* convert Device Tree bindings to the json-schema

* support Device Tree ieee80211-freq-limit property to limit channels

3 years agomwifiex: Deactive host sleep using HSCFG after it was activated manually
Jonas Dreßler [Sat, 16 Oct 2021 15:32:44 +0000 (17:32 +0200)]
mwifiex: Deactive host sleep using HSCFG after it was activated manually

When powersaving (so either wifi powersaving or deep sleep, depending on
which state the firmware is in) is disabled, the way the firmware goes
into host sleep is different: Usually the firmware implicitely enters
host sleep on the next SLEEP event we get when we configured host sleep
via HSCFG before. When powersaving is disabled though, there are no
SLEEP events, the way we enter host sleep in that case is different: The
firmware will send us a HS_ACT_REQ event and after that we "manually"
make the firmware enter host sleep by sending it another HSCFG command
with the action HS_ACTIVATE.

Now waking up from host sleep appears to be different depending on
whether powersaving is enabled again: When powersaving is enabled, the
firmware implicitely leaves host sleep as soon as it wakes up and sends
us an AWAKE event. When powersaving is disabled though, it apparently
doesn't implicitely leave host sleep, but instead we need to send it a
HSCFG command with the HS_CONFIGURE action and the HS_CFG_CANCEL
condition. We didn't do that so far, which is why waking up from host
sleep was broken when powersaving is disabled.

So add some additional state to mwifiex_adapter where we keep track of
whether host sleep was activated manually via HS_ACTIVATE, and if that
was the case, deactivate it manually again via HS_CFG_CANCEL.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211016153244.24353-6-verdre@v0yd.nl
3 years agomwifiex: Send DELBA requests according to spec
Jonas Dreßler [Sat, 16 Oct 2021 15:32:43 +0000 (17:32 +0200)]
mwifiex: Send DELBA requests according to spec

While looking at on-air packets using Wireshark, I noticed we're never
setting the initiator bit when sending DELBA requests to the AP: While
we set the bit on our del_ba_param_set bitmask, we forget to actually
copy that bitmask over to the command struct, which means we never
actually set the initiator bit.

Fix that and copy the bitmask over to the host_cmd_ds_11n_delba command
struct.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Acked-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211016153244.24353-5-verdre@v0yd.nl
3 years agomwifiex: Fix an incorrect comment
Jonas Dreßler [Sat, 16 Oct 2021 15:32:42 +0000 (17:32 +0200)]
mwifiex: Fix an incorrect comment

We're sending DELBA requests here, not ADDBA requests.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211016153244.24353-4-verdre@v0yd.nl
3 years agomwifiex: Log an error on command failure during key-material upload
Jonas Dreßler [Sat, 16 Oct 2021 15:32:41 +0000 (17:32 +0200)]
mwifiex: Log an error on command failure during key-material upload

Sometimes the KEY_MATERIAL command can fail with the 88W8897 firmware
(when this happens exactly seems pretty random). This appears to prevent
the access point from starting, so it seems like a good idea to log an
error in that case.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211016153244.24353-3-verdre@v0yd.nl
3 years agomwifiex: Don't log error on suspend if wake-on-wlan is disabled
Jonas Dreßler [Sat, 16 Oct 2021 15:32:40 +0000 (17:32 +0200)]
mwifiex: Don't log error on suspend if wake-on-wlan is disabled

It's not an error if someone chooses to put their computer to sleep, not
wanting it to wake up because the person next door has just discovered
what a magic packet is. So change the loglevel of this annoying message
from ERROR to INFO.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211016153244.24353-2-verdre@v0yd.nl
3 years agortw89: remove unneeded semicolon
Yang Li [Tue, 19 Oct 2021 07:54:54 +0000 (15:54 +0800)]
rtw89: remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/net/wireless/realtek/rtw89/pci.c:1348:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1634630094-1156-1-git-send-email-yang.lee@linux.alibaba.com
3 years agortw89: fix return value check in rtw89_cam_send_sec_key_cmd()
Yang Yingliang [Mon, 18 Oct 2021 03:31:02 +0000 (11:31 +0800)]
rtw89: fix return value check in rtw89_cam_send_sec_key_cmd()

Fix the return value check which testing the wrong variable
in rtw89_cam_send_sec_key_cmd().

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018033102.1813058-1-yangyingliang@huawei.com
3 years agomwl8k: Fix use-after-free in mwl8k_fw_state_machine()
Zheyu Ma [Sat, 16 Oct 2021 04:02:59 +0000 (04:02 +0000)]
mwl8k: Fix use-after-free in mwl8k_fw_state_machine()

When the driver fails to request the firmware, it calls its error
handler. In the error handler, the driver detaches device from driver
first before releasing the firmware, which can cause a use-after-free bug.

Fix this by releasing firmware first.

The following log reveals it:

[    9.007301 ] BUG: KASAN: use-after-free in mwl8k_fw_state_machine+0x320/0xba0
[    9.010143 ] Workqueue: events request_firmware_work_func
[    9.010830 ] Call Trace:
[    9.010830 ]  dump_stack_lvl+0xa8/0xd1
[    9.010830 ]  print_address_description+0x87/0x3b0
[    9.010830 ]  kasan_report+0x172/0x1c0
[    9.010830 ]  ? mutex_unlock+0xd/0x10
[    9.010830 ]  ? mwl8k_fw_state_machine+0x320/0xba0
[    9.010830 ]  ? mwl8k_fw_state_machine+0x320/0xba0
[    9.010830 ]  __asan_report_load8_noabort+0x14/0x20
[    9.010830 ]  mwl8k_fw_state_machine+0x320/0xba0
[    9.010830 ]  ? mwl8k_load_firmware+0x5f0/0x5f0
[    9.010830 ]  request_firmware_work_func+0x172/0x250
[    9.010830 ]  ? read_lock_is_recursive+0x20/0x20
[    9.010830 ]  ? process_one_work+0x7a1/0x1100
[    9.010830 ]  ? request_firmware_nowait+0x460/0x460
[    9.010830 ]  ? __this_cpu_preempt_check+0x13/0x20
[    9.010830 ]  process_one_work+0x9bb/0x1100

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1634356979-6211-1-git-send-email-zheyuma97@gmail.com
3 years agorsi: stop thread firstly in rsi_91x_init() error handling
Ziyang Xuan [Fri, 15 Oct 2021 04:03:35 +0000 (12:03 +0800)]
rsi: stop thread firstly in rsi_91x_init() error handling

When fail to init coex module, free 'common' and 'adapter' directly, but
common->tx_thread which will access 'common' and 'adapter' is running at
the same time. That will trigger the UAF bug.

==================================================================
BUG: KASAN: use-after-free in rsi_tx_scheduler_thread+0x50f/0x520 [rsi_91x]
Read of size 8 at addr ffff8880076dc000 by task Tx-Thread/124777
CPU: 0 PID: 124777 Comm: Tx-Thread Not tainted 5.15.0-rc5+ #19
Call Trace:
 dump_stack_lvl+0xe2/0x152
 print_address_description.constprop.0+0x21/0x140
 ? rsi_tx_scheduler_thread+0x50f/0x520
 kasan_report.cold+0x7f/0x11b
 ? rsi_tx_scheduler_thread+0x50f/0x520
 rsi_tx_scheduler_thread+0x50f/0x520
...

Freed by task 111873:
 kasan_save_stack+0x1b/0x40
 kasan_set_track+0x1c/0x30
 kasan_set_free_info+0x20/0x30
 __kasan_slab_free+0x109/0x140
 kfree+0x117/0x4c0
 rsi_91x_init+0x741/0x8a0 [rsi_91x]
 rsi_probe+0x9f/0x1750 [rsi_usb]

Stop thread before free 'common' and 'adapter' to fix it.

Fixes: 2108df3c4b18 ("rsi: add coex support")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211015040335.1021546-1-william.xuanziyang@huawei.com
3 years agomt76: mt7915: change max rx len limit of hw modules
Shayne Chen [Mon, 18 Oct 2021 08:09:41 +0000 (16:09 +0800)]
mt76: mt7915: change max rx len limit of hw modules

Update max rx len of some hw modules, which aligns out vendor SDK.
In normal modes, we exchange MPDU 7991 cap with peers; however, this
won't play a part in sniffer mode.
To prevent packets which exceed the max MPDU size from entering specific
rx path in hw, we need to set a proper limit to filter them out.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: fix missing HE phy cap
Shayne Chen [Mon, 18 Oct 2021 08:09:40 +0000 (16:09 +0800)]
mt76: mt7915: fix missing HE phy cap

Fix missing HE phy cap related to vif and starec setting.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: rework mt7915_mcu_sta_muru_tlv()
Shayne Chen [Mon, 18 Oct 2021 08:09:39 +0000 (16:09 +0800)]
mt76: mt7915: rework mt7915_mcu_sta_muru_tlv()

Re-order and modify conditions for MU DL/UL and ofdma DL fields, and
also clean up some unnecessary zero settings.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: enable HE UL MU-MIMO
Shayne Chen [Mon, 18 Oct 2021 08:09:38 +0000 (16:09 +0800)]
mt76: mt7915: enable HE UL MU-MIMO

Enable HE UL MU-MIMO in sta_rec_muru, which works on both ap and station
mode.

For sending trigger frames, one of the conditions fw uses is to check if
mib rx airtime meets the threshold.
There's a main control of mib rx airtime report register in fw, so we
need to enable the register by mcu cmd instead of directly writing it,
otherwise it will still be disabled by fw.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add per-vif counters in ethtool
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:32 +0000 (12:12 +0200)]
mt76: mt7921: add per-vif counters in ethtool

Similar to mt7915 driver, add per-vif tx counters in ethtool.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: move tx amsdu stats in mib_stats
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:31 +0000 (12:12 +0200)]
mt76: mt7921: move tx amsdu stats in mib_stats

Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add sta stats accounting in mt7921_mac_add_txs_skb
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:30 +0000 (12:12 +0200)]
mt76: mt7921: add sta stats accounting in mt7921_mac_add_txs_skb

This is a preliminary patch to add ethtool stats to mt7921 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: introduce stats reporting through ethtool
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:29 +0000 (12:12 +0200)]
mt76: mt7921: introduce stats reporting through ethtool

Similar to mt7915 driver, add tx/rx statistics reporting through ethtool.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add some more MIB counters
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:28 +0000 (12:12 +0200)]
mt76: mt7921: add some more MIB counters

This is a preliminary patch to introduce ethtool stats support to mt7921
driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: do not reset MIB counters in get_stats callback
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:27 +0000 (12:12 +0200)]
mt76: do not reset MIB counters in get_stats callback

MIB counters are used for ethtool stats as well

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: move tx amsdu stats in mib_stats
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:26 +0000 (12:12 +0200)]
mt76: mt7915: move tx amsdu stats in mib_stats

Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: run mt7915_get_et_stats holding mt76 mutex
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:25 +0000 (12:12 +0200)]
mt76: mt7915: run mt7915_get_et_stats holding mt76 mutex

Since it can run in parallel with mac_work, hold mutex lock in
mt7915_get_et_stats. Moreover update mib counters running
mt7915_get_et_stats.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: move mt76_ethtool_worker_info in mt76 module
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:24 +0000 (12:12 +0200)]
mt76: move mt76_ethtool_worker_info in mt76 module

Move mt76_ethtool_worker_info in common code in order to be reused in
mt7921 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: move mt76_sta_stats in mt76.h
Lorenzo Bianconi [Tue, 19 Oct 2021 10:12:23 +0000 (12:12 +0200)]
mt76: move mt76_sta_stats in mt76.h

This is a preliminary patch to add ethtool stats to mt7921 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt76x0: correct VHT MCS 8/9 tx power eeprom offset
Richard Huynh [Tue, 7 Sep 2021 08:58:24 +0000 (18:58 +1000)]
mt76: mt76x0: correct VHT MCS 8/9 tx power eeprom offset

Appears to have incorrectly offset 0x120 + 0x12 instead of 12 decimal,
leading to bogus power values being used.

Signed-off-by: Richard Huynh <voxlympha@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921s: add reset support
Sean Wang [Mon, 18 Oct 2021 23:11:47 +0000 (07:11 +0800)]
mt76: mt7921s: add reset support

Introduce wifi chip reset support for mt7921 device to recover
mcu hangs or abnormal wifi system.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: introduce mt7921s support
Sean Wang [Mon, 18 Oct 2021 23:11:46 +0000 (07:11 +0800)]
mt76: mt7921: introduce mt7921s support

Introduce support for mt7921s 802.11ax (Wi-Fi 6) 2x2:2SS chipset.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: refactor mt7921_mcu_send_message
Sean Wang [Mon, 18 Oct 2021 23:11:45 +0000 (07:11 +0800)]
mt76: mt7921: refactor mt7921_mcu_send_message

This is a preliminary patch to introduce mt7921s support.

Refactor mt7921_mcu_send_message to be sharable between mt7921s and
mt7921e.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: rely on mcu_get_nic_capability
Sean Wang [Mon, 18 Oct 2021 23:11:44 +0000 (07:11 +0800)]
mt76: mt7921: rely on mcu_get_nic_capability

Rely on mcu_get_nic_capability to obtain Tx quota information
for the SDIO device, get PHY capability, MAC address and then we can
totally drop mt7921/eeprom.c and any unnecessary code.

Noting that mt76_connac_mcu_get_nic_capability should be run before set
flag MT76_STATE_MCU_RUNNING being set to setup the proper parameters
like Tx quota control before the device is started to running.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: extend mcu_get_nic_capability
Sean Wang [Mon, 18 Oct 2021 23:11:43 +0000 (07:11 +0800)]
mt76: connac: extend mcu_get_nic_capability

Extend mcu_get_nic_capability to obtain tx resource for SDIO device,
MAC address, and PHY capability.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: sdio: extend sdio module to support CONNAC2
Sean Wang [Mon, 18 Oct 2021 23:11:42 +0000 (07:11 +0800)]
mt76: sdio: extend sdio module to support CONNAC2

Extend sdio module to support CONNAC2 hw that mt7921s rely on.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: sdio: introduce parse_irq callback
Lorenzo Bianconi [Mon, 18 Oct 2021 23:11:41 +0000 (07:11 +0800)]
mt76: sdio: introduce parse_irq callback

Add parse_irq to handle that interrupt status structure is
different between mt7663s and mt7921s.

This is a preliminary patch to introduce mt7921s driver

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: sdio: move common code in mt76_sdio module
Lorenzo Bianconi [Mon, 18 Oct 2021 23:11:40 +0000 (07:11 +0800)]
mt76: sdio: move common code in mt76_sdio module

Move sdio common code in mt76_sdio module.
This is a preliminary patch to support mt7921s devices.

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: use physical addr to unify register access
Sean Wang [Mon, 18 Oct 2021 23:11:39 +0000 (07:11 +0800)]
mt76: mt7921: use physical addr to unify register access

Use physical address to unify the register access and reorder the
entries in fixed_map table to accelerate the address lookup for
MT7921e. Cosmetics the patch with adding an extra space to make all
entries in the array style consistent.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: make all event parser reusable between mt7921s and mt7921e
Sean Wang [Mon, 18 Oct 2021 23:11:38 +0000 (07:11 +0800)]
mt76: mt7921: make all event parser reusable between mt7921s and mt7921e

The longer event such as the event for mcu_get_nic_capability would hold
the data in paged fragment skb for the SDIO device so we turn the skb to
be linearized skb before accessing it to reuse the same event parser
betweem mt7921s and mt7921e.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7663s: rely on mcu reg access utility
Sean Wang [Mon, 18 Oct 2021 23:11:37 +0000 (07:11 +0800)]
mt76: mt7663s: rely on mcu reg access utility

rely on mcu reg access utility and drop the duplicated code.

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mcu reg access utility routines in mt76_connac_lib module
Sean Wang [Mon, 18 Oct 2021 23:11:36 +0000 (07:11 +0800)]
mt76: connac: move mcu reg access utility routines in mt76_connac_lib module

Move mcu reg access shared between mt7663s and mt7921s in mt76_connac_lib
module.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add MT7921_COMMON module
Sean Wang [Mon, 18 Oct 2021 23:11:35 +0000 (07:11 +0800)]
mt76: mt7921: add MT7921_COMMON module

This is a preliminary patch to introduce mt7921s support.

MT7921_COMMON module grouping bus independent objects the both mt7921e and
mt7921s can share with and have to rely on.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: refactor init.c to be bus independent
Sean Wang [Mon, 18 Oct 2021 23:11:34 +0000 (07:11 +0800)]
mt76: mt7921: refactor init.c to be bus independent

This is a preliminary patch to introduce mt7921s support.

Make init.c reusable between mt7921s and mt7921e

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: refactor mcu.c to be bus independent
Sean Wang [Mon, 18 Oct 2021 23:11:33 +0000 (07:11 +0800)]
mt76: mt7921: refactor mcu.c to be bus independent

This is a preliminary patch to introduce mt7921s support.

Make mcu.c reusable between mt7921s and mt7921e

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: refactor dma.c to be pcie specific
Sean Wang [Mon, 18 Oct 2021 23:11:32 +0000 (07:11 +0800)]
mt76: mt7921: refactor dma.c to be pcie specific

This is a preliminary patch to introduce mt7921s support.

make dma.c be used dedicately for mt7921e.

by moving out mt7921_tx_cleanup from dma.c to mcu.c and then renaming
mt7921_tx_cleanup to refect the exact thing the function actually does.

Finally, dma.c totally become pcie specific one, only needed to
be compiled only when CONFIG_MT7921E is enabled.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: refactor mac.c to be bus independent
Sean Wang [Mon, 18 Oct 2021 23:11:31 +0000 (07:11 +0800)]
mt76: mt7921: refactor mac.c to be bus independent

This is a preliminary patch to introduce mt7921s support.

Split out a new pci_mac.c from mac.c to make mac.c reusable between
mt7921s and mt7921e.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>