linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/31] wifi: mwifiex: cleanup driver
@ 2024-08-20 11:55 Sascha Hauer
  2024-08-20 11:55 ` [PATCH 01/31] wifi: mwifiex: remove unnecessary checks for valid priv Sascha Hauer
                   ` (32 more replies)
  0 siblings, 33 replies; 54+ messages in thread
From: Sascha Hauer @ 2024-08-20 11:55 UTC (permalink / raw)
  To: Brian Norris, Francesco Dolcini, Kalle Valo
  Cc: linux-wireless, linux-kernel, kernel, Sascha Hauer

This series has a bunch of cleanup and bugfix patches for the mwifiex
driver.

There's one topic which goes through the whole series: an instance of
the mwifiex driver is referred to as an adapter (struct
mwifiex_adapter).  An adapter has an array of struct mwifiex_private
pointers, each of them belongs to a virtual interface. Many functions
throughout the driver take a struct mwifiex_private * as context, but
are not specific to a virtual interface, but affect the whole adapter.
In many places where a priv * is needed but none is available the code
obtains a priv * by doing a:

	priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);

Depending on where it is used this is either a bug or could at least be
cleaned up. The driver currently has the send command function

int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
                     u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync)

This series introduces a second send command function which takes the
adapter as context:

int mwifiex_adapter_send_cmd(struct mwifiex_adapter *adapter, u16 cmd_no,
                             u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync)

Many places in the driver are converted to use this function instead and
are also converted to take a struct mwifiex_adapter * as context
themselves which makes the code better readable.

Some places use this to obtain a priv *:

	priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);

This will return the first priv that is configured for station mode.
Depending on the driver configuration there can be none or many privs in
station mode, so priv can unexpectedly be NULL or in case there are
multiple privs in station mode we might have to iterate over all of
them. This is cleaned up in this series.

The remaining patches are driveby catches I found when looking through
the code.

One patch worth mentioning here is "wifi: mwifiex: fix MAC address
handling".  Without it the mwifiex driver sets a new MAC address during
a change_virtual_intf operation which is pretty unexpected by userspace
and keeps the driver from working when a virtual interface is altered
from its default mode it is initialized with.

I've already sent "wifi: mwifiex: remove unnecessary priv checks" as a
separate patch, I included here again as this series depends on it, but
it's unchanged to the version I have sent earlier.

Sascha

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (31):
      wifi: mwifiex: remove unnecessary checks for valid priv
      wifi: mwifiex: use adapter as context pointer for mwifiex_hs_activated_event()
      wifi: mwifiex: drop HostCmd_CMD_802_11_MAC_ADDRESS response handling
      wifi: mwifiex: drop unnecessary initialization
      wifi: mwifiex: make region_code_mapping_t const
      wifi: mwifiex: use mwifiex_deauthenticate_all()
      wifi: mwifiex: pass adapter to mwifiex_dnld_cmd_to_fw()
      wifi: mwifiex: simplify mwifiex_setup_ht_caps()
      wifi: mwifiex: deduplicate code in mwifiex_cmd_tx_rate_cfg()
      wifi: mwifiex: fix indention
      wifi: mwifiex: use priv index as bss_num
      wifi: mwifiex: fix MAC address handling
      wifi: mwifiex: drop driver internal AP/STA limit counting
      wifi: mwifiex: iterate over privs in mwifiex_process_assoc_resp()
      wifi: mwifiex: add missing locking
      wifi: mwifiex: make locally used function static
      wifi: mwifiex: fix multiple station handling
      wifi: mwifiex: make mwifiex_enable_hs() safe for multiple station mode
      wifi: mwifiex: add function to send command specific to the adapter
      wifi: mwifiex: pass adapter to host sleep functions
      wifi: mwifiex: associate tx_power to the adapter
      wifi: mwifiex: pass adapter to mwifiex_init_shutdown_fw()
      wifi: mwifiex: pass adapter to mwifiex_disable_auto_ds()
      wifi: mwifiex: make txpwr specific to adapter
      wifi: mwifiex: return error on unexpected bss_num
      wifi: mwifiex: coalesce rules are adapter specific
      wifi: mwifiex: do not use mwifiex_get_priv() in mwifiex_dnld_sleep_confirm_cmd()
      wifi: mwifiex: move rx_ant/tx_ant to adapter
      wifi: mwifiex: pass adapter to mwifiex_fw_dump_event()
      wifi: mwifiex: move common settings out of switch/case
      wifi: mwifiex: allow to set MAC address in add_virtual_intf()

 drivers/net/wireless/marvell/mwifiex/11n.c         |   2 -
 drivers/net/wireless/marvell/mwifiex/11n.h         |   4 +-
 .../net/wireless/marvell/mwifiex/11n_rxreorder.c   |  23 +-
 drivers/net/wireless/marvell/mwifiex/cfg80211.c    | 297 ++++-----------------
 drivers/net/wireless/marvell/mwifiex/cfp.c         |   4 +-
 drivers/net/wireless/marvell/mwifiex/cmdevt.c      | 123 +++++----
 drivers/net/wireless/marvell/mwifiex/debugfs.c     |   8 +-
 drivers/net/wireless/marvell/mwifiex/decl.h        |  10 -
 drivers/net/wireless/marvell/mwifiex/init.c        |  76 ++----
 drivers/net/wireless/marvell/mwifiex/join.c        |   3 +-
 drivers/net/wireless/marvell/mwifiex/main.c        | 120 +++------
 drivers/net/wireless/marvell/mwifiex/main.h        | 112 +++-----
 drivers/net/wireless/marvell/mwifiex/pcie.c        |  10 +-
 drivers/net/wireless/marvell/mwifiex/scan.c        |   2 -
 drivers/net/wireless/marvell/mwifiex/sdio.c        |   9 +-
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c     |  53 ++--
 drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c |  70 ++---
 drivers/net/wireless/marvell/mwifiex/sta_event.c   |   3 +-
 drivers/net/wireless/marvell/mwifiex/sta_ioctl.c   |  60 ++---
 drivers/net/wireless/marvell/mwifiex/txrx.c        |  18 +-
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c     |   2 +-
 drivers/net/wireless/marvell/mwifiex/usb.c         |  18 +-
 drivers/net/wireless/marvell/mwifiex/util.c        |  48 ++--
 drivers/net/wireless/marvell/mwifiex/wmm.c         |  19 +-
 24 files changed, 365 insertions(+), 729 deletions(-)
---
base-commit: daaf0dd0398d5e93b7304f35184ca182ed583681
change-id: 20240820-mwifiex-cleanup-a2559d29e612

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>


^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2024-08-26 22:44 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 11:55 [PATCH 00/31] wifi: mwifiex: cleanup driver Sascha Hauer
2024-08-20 11:55 ` [PATCH 01/31] wifi: mwifiex: remove unnecessary checks for valid priv Sascha Hauer
2024-08-22 17:58   ` Brian Norris
2024-08-20 11:55 ` [PATCH 02/31] wifi: mwifiex: use adapter as context pointer for mwifiex_hs_activated_event() Sascha Hauer
2024-08-20 11:55 ` [PATCH 03/31] wifi: mwifiex: drop HostCmd_CMD_802_11_MAC_ADDRESS response handling Sascha Hauer
2024-08-22 18:07   ` Brian Norris
2024-08-26  9:07     ` Sascha Hauer
2024-08-26 22:44       ` Brian Norris
2024-08-20 11:55 ` [PATCH 04/31] wifi: mwifiex: drop unnecessary initialization Sascha Hauer
2024-08-20 11:55 ` [PATCH 05/31] wifi: mwifiex: make region_code_mapping_t const Sascha Hauer
2024-08-20 11:55 ` [PATCH 06/31] wifi: mwifiex: use mwifiex_deauthenticate_all() Sascha Hauer
2024-08-20 11:55 ` [PATCH 07/31] wifi: mwifiex: pass adapter to mwifiex_dnld_cmd_to_fw() Sascha Hauer
2024-08-20 11:55 ` [PATCH 08/31] wifi: mwifiex: simplify mwifiex_setup_ht_caps() Sascha Hauer
2024-08-20 11:55 ` [PATCH 09/31] wifi: mwifiex: deduplicate code in mwifiex_cmd_tx_rate_cfg() Sascha Hauer
2024-08-20 11:55 ` [PATCH 10/31] wifi: mwifiex: fix indention Sascha Hauer
2024-08-22  9:36   ` [EXT] " David Lin
2024-08-22  9:53     ` Marc Kleine-Budde
2024-08-22 10:44       ` Marc Kleine-Budde
2024-08-22 11:59       ` David Lin
2024-08-22 12:05         ` Marc Kleine-Budde
2024-08-22 12:11           ` David Lin
2024-08-22 12:20             ` Marc Kleine-Budde
2024-08-26  9:37     ` Sascha Hauer
2024-08-26  9:48       ` David Lin
2024-08-26 10:17         ` Sascha Hauer
2024-08-20 11:55 ` [PATCH 11/31] wifi: mwifiex: use priv index as bss_num Sascha Hauer
2024-08-22  5:48   ` Sascha Hauer
2024-08-22 23:38   ` kernel test robot
2024-08-20 11:55 ` [PATCH 12/31] wifi: mwifiex: fix MAC address handling Sascha Hauer
2024-08-20 11:55 ` [PATCH 13/31] wifi: mwifiex: drop driver internal AP/STA limit counting Sascha Hauer
2024-08-20 11:55 ` [PATCH 14/31] wifi: mwifiex: iterate over privs in mwifiex_process_assoc_resp() Sascha Hauer
2024-08-20 11:55 ` [PATCH 15/31] wifi: mwifiex: add missing locking Sascha Hauer
2024-08-20 11:55 ` [PATCH 16/31] wifi: mwifiex: make locally used function static Sascha Hauer
2024-08-20 11:55 ` [PATCH 17/31] wifi: mwifiex: fix multiple station handling Sascha Hauer
2024-08-20 11:55 ` [PATCH 18/31] wifi: mwifiex: make mwifiex_enable_hs() safe for multiple station mode Sascha Hauer
2024-08-20 11:55 ` [PATCH 19/31] wifi: mwifiex: add function to send command specific to the adapter Sascha Hauer
2024-08-20 11:55 ` [PATCH 20/31] wifi: mwifiex: pass adapter to host sleep functions Sascha Hauer
2024-08-20 11:55 ` [PATCH 21/31] wifi: mwifiex: associate tx_power to the adapter Sascha Hauer
2024-08-20 11:55 ` [PATCH 22/31] wifi: mwifiex: pass adapter to mwifiex_init_shutdown_fw() Sascha Hauer
2024-08-20 11:55 ` [PATCH 23/31] wifi: mwifiex: pass adapter to mwifiex_disable_auto_ds() Sascha Hauer
2024-08-20 11:55 ` [PATCH 24/31] wifi: mwifiex: make txpwr specific to adapter Sascha Hauer
2024-08-20 11:55 ` [PATCH 25/31] wifi: mwifiex: return error on unexpected bss_num Sascha Hauer
2024-08-20 11:55 ` [PATCH 26/31] wifi: mwifiex: coalesce rules are adapter specific Sascha Hauer
2024-08-20 11:55 ` [PATCH 27/31] wifi: mwifiex: do not use mwifiex_get_priv() in mwifiex_dnld_sleep_confirm_cmd() Sascha Hauer
2024-08-20 11:55 ` [PATCH 28/31] wifi: mwifiex: move rx_ant/tx_ant to adapter Sascha Hauer
2024-08-20 11:55 ` [PATCH 29/31] wifi: mwifiex: pass adapter to mwifiex_fw_dump_event() Sascha Hauer
2024-08-20 11:55 ` [PATCH 30/31] wifi: mwifiex: move common settings out of switch/case Sascha Hauer
2024-08-20 11:55 ` [PATCH 31/31] wifi: mwifiex: allow to set MAC address in add_virtual_intf() Sascha Hauer
2024-08-20 13:34 ` [PATCH 00/31] wifi: mwifiex: cleanup driver Francesco Dolcini
2024-08-21 11:11   ` Sascha Hauer
2024-08-21 11:33   ` Sascha Hauer
2024-08-20 17:42 ` Kalle Valo
2024-08-21 11:12   ` Sascha Hauer
2024-08-21 14:07     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).