linux/drivers/net/wireless/intel/iwlwifi/mld/tx.h
Miri Korenblit d1e879ec60 wifi: iwlwifi: add iwlmld sub-driver
iwlwifi is the driver of all Intel wifi devices since 2008.
Since then, the hardware has changed a lot, but the firmware
API has changed even more. The need to keep one driver that
supports all those different APIs led us to introduce a new
architecture circa 2012 which allowed us to keep the same
interface to the hardware (DMAs, Tx queues, etc...) with a
new layer to implement the mid-layer between mac80211 and
the firmware. The first component is called the 'transport'
and the latter is called 'operation_mode' a.k.a  op_mode.

In 2013 we took advantage of the new architecture to
introduce iwlmvm which allowed us to implement the, then,
new firmware API. This op_mode supports 7260 and up, those
devices supports support at least VHT.

Since then, wifi evolved and so did the firmware. It became
much bigger and took a lot of functionality from the driver.
It became increasingly hard to keep the same op_mode for the
newest devices and we experienced frequent regressions on
older devices. In order to avoid those regressions and keep
the code maintainable, we decided it was about time to start
a new op_mode.

iwlmld is a new op_mode that supports BE200 or newer if the
firmware being used is 97.ucode or newer. If the user has
an older devices or BE200 with .96.ucode, iwlmvm will be
loaded. Of course, this op_mode selection is seamless.

All the features supported in iwlmvm are supported in
iwlmld besides a few seldom used use cases: injection and
Hotspot 2.0. Those are under work.

A few points about the implementation:
 * iwlmld doesn't have any mutexes, it relies on the
   wiphy_lock
 * iwlmld is more "resource oriented": stations, links and
   interfaces are allocated and freed only after all the
   relevant flows are completed.
 * Firmware notifications' sizes are validated in a more
   structured way.

We would love to see this new op_mode merged in 6.15. The
firmware for this new driver (.97.ucode) is not yet publicly
available but it'll be sent very soon.
People eager to get an early version of this firmware can
contact Emmanuel at:
emmanuel.grumbach@intel.com

I've listed the people who directly contributed
code, but many others from various teams have
contributed in other ways.

Co-developed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Co-developed-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Co-developed-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Co-developed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Co-developed-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Co-developed-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Co-developed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Co-developed-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://lore.kernel.org/linux-wireless/20250216094321.537988-1-miriam.rachel.korenblit@intel.com/
[fix Kconfig, fix api/phy.h includes, SPDX tag and coding
 style issues, duplicated includes per 0-day robot]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2025-03-05 09:42:03 +01:00

77 lines
2.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2024 Intel Corporation
*/
#ifndef __iwl_mld_tx_h__
#define __iwl_mld_tx_h__
#include "mld.h"
#define IWL_MLD_INVALID_QUEUE 0xFFFF
#define IWL_MLD_INVALID_DROP_TX 0xFFFE
/**
* struct iwl_mld_txq - TX Queue data
*
* @fw_id: the fw id of this txq. Only valid when &status.allocated is true.
* @status: bitmap of the txq status
* @status.allocated: Indicates that the queue was allocated.
* @status.stop_full: Indicates that the queue is full and should stop TXing.
* @list: list pointer, for &mld::txqs_to_add
* @tx_request: makes sure that if there are multiple threads that want to tx
* from this txq, only one of them will do all the TXing.
* This is needed to avoid spinning the trans txq lock, which is expensive
*/
struct iwl_mld_txq {
/* Add here fields that need clean up on restart */
struct_group(zeroed_on_hw_restart,
u16 fw_id;
struct {
u8 allocated:1;
u8 stop_full:1;
} status;
);
struct list_head list;
atomic_t tx_request;
/* And here fields that survive a fw restart */
};
static inline void iwl_mld_init_txq(struct iwl_mld_txq *mld_txq)
{
INIT_LIST_HEAD(&mld_txq->list);
atomic_set(&mld_txq->tx_request, 0);
}
static inline struct iwl_mld_txq *
iwl_mld_txq_from_mac80211(struct ieee80211_txq *txq)
{
return (void *)txq->drv_priv;
}
void iwl_mld_add_txqs_wk(struct wiphy *wiphy, struct wiphy_work *wk);
void iwl_mld_remove_txq(struct iwl_mld *mld, struct ieee80211_txq *txq);
void iwl_mld_add_txq_list(struct iwl_mld *mld);
void
iwl_mld_free_txq(struct iwl_mld *mld, u32 fw_sta_mask, u32 tid, u32 queue_id);
void iwl_mld_tx_from_txq(struct iwl_mld *mld, struct ieee80211_txq *txq);
void iwl_mld_handle_tx_resp_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
int iwl_mld_flush_link_sta_txqs(struct iwl_mld *mld, u32 fw_sta_id);
int iwl_mld_ensure_queue(struct iwl_mld *mld, struct ieee80211_txq *txq);
int iwl_mld_update_sta_txqs(struct iwl_mld *mld,
struct ieee80211_sta *sta,
u32 old_sta_mask, u32 new_sta_mask);
void iwl_mld_handle_compressed_ba_notif(struct iwl_mld *mld,
struct iwl_rx_packet *pkt);
void iwl_mld_toggle_tx_ant(struct iwl_mld *mld, u8 *ant);
u8 iwl_mld_get_lowest_rate(struct iwl_mld *mld,
struct ieee80211_tx_info *info,
struct ieee80211_vif *vif);
void iwl_mld_tx_skb(struct iwl_mld *mld, struct sk_buff *skb,
struct ieee80211_txq *txq);
#endif /* __iwl_mld_tx_h__ */