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-02-16 11:42:40 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
|
|
|
/*
|
2025-03-13 00:22:24 +02:00
|
|
|
* Copyright (C) 2024-2025 Intel Corporation
|
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-02-16 11:42:40 +02:00
|
|
|
*/
|
|
|
|
#include "iface.h"
|
|
|
|
#include "sta.h"
|
|
|
|
|
|
|
|
#define MLD_DEBUGFS_OPEN_WRAPPER(name, buflen, argtype) \
|
|
|
|
struct dbgfs_##name##_data { \
|
|
|
|
argtype *arg; \
|
|
|
|
bool read_done; \
|
|
|
|
ssize_t rlen; \
|
|
|
|
char buf[buflen]; \
|
|
|
|
}; \
|
|
|
|
static int _iwl_dbgfs_##name##_open(struct inode *inode, \
|
|
|
|
struct file *file) \
|
|
|
|
{ \
|
|
|
|
struct dbgfs_##name##_data *data; \
|
|
|
|
\
|
|
|
|
if ((file->f_flags & O_ACCMODE) == O_RDWR) \
|
|
|
|
return -EOPNOTSUPP; \
|
|
|
|
\
|
|
|
|
data = kzalloc(sizeof(*data), GFP_KERNEL); \
|
|
|
|
if (!data) \
|
|
|
|
return -ENOMEM; \
|
|
|
|
\
|
|
|
|
data->read_done = false; \
|
|
|
|
data->arg = inode->i_private; \
|
|
|
|
file->private_data = data; \
|
|
|
|
\
|
|
|
|
return 0; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MLD_DEBUGFS_READ_WRAPPER(name) \
|
|
|
|
static ssize_t _iwl_dbgfs_##name##_read(struct file *file, \
|
|
|
|
char __user *user_buf, \
|
|
|
|
size_t count, loff_t *ppos) \
|
|
|
|
{ \
|
|
|
|
struct dbgfs_##name##_data *data = file->private_data; \
|
|
|
|
\
|
|
|
|
if (!data->read_done) { \
|
|
|
|
data->read_done = true; \
|
|
|
|
data->rlen = iwl_dbgfs_##name##_read(data->arg, \
|
|
|
|
sizeof(data->buf),\
|
|
|
|
data->buf); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
if (data->rlen < 0) \
|
|
|
|
return data->rlen; \
|
|
|
|
return simple_read_from_buffer(user_buf, count, ppos, \
|
|
|
|
data->buf, data->rlen); \
|
|
|
|
}
|
|
|
|
|
|
|
|
static int _iwl_dbgfs_release(struct inode *inode, struct file *file)
|
|
|
|
{
|
|
|
|
kfree(file->private_data);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define _MLD_DEBUGFS_READ_FILE_OPS(name, buflen, argtype) \
|
|
|
|
MLD_DEBUGFS_OPEN_WRAPPER(name, buflen, argtype) \
|
|
|
|
MLD_DEBUGFS_READ_WRAPPER(name) \
|
|
|
|
static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
|
|
|
.read = _iwl_dbgfs_##name##_read, \
|
|
|
|
.open = _iwl_dbgfs_##name##_open, \
|
|
|
|
.llseek = generic_file_llseek, \
|
|
|
|
.release = _iwl_dbgfs_release, \
|
|
|
|
}
|
|
|
|
|
2025-03-13 00:22:24 +02:00
|
|
|
#define WIPHY_DEBUGFS_WRITE_HANDLER_WRAPPER(name) \
|
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-02-16 11:42:40 +02:00
|
|
|
static ssize_t iwl_dbgfs_##name##_write_handler(struct wiphy *wiphy, \
|
|
|
|
struct file *file, char *buf, \
|
|
|
|
size_t count, void *data) \
|
|
|
|
{ \
|
|
|
|
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); \
|
|
|
|
struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw); \
|
|
|
|
return iwl_dbgfs_##name##_write(mld, buf, count, data); \
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct iwl_mld *
|
|
|
|
iwl_mld_from_link_sta(struct ieee80211_link_sta *link_sta)
|
|
|
|
{
|
|
|
|
struct ieee80211_vif *vif =
|
|
|
|
iwl_mld_sta_from_mac80211(link_sta->sta)->vif;
|
|
|
|
return iwl_mld_vif_from_mac80211(vif)->mld;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct iwl_mld *
|
|
|
|
iwl_mld_from_bss_conf(struct ieee80211_bss_conf *link)
|
|
|
|
{
|
|
|
|
return iwl_mld_vif_from_mac80211(link->vif)->mld;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct iwl_mld *iwl_mld_from_vif(struct ieee80211_vif *vif)
|
|
|
|
{
|
|
|
|
return iwl_mld_vif_from_mac80211(vif)->mld;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WIPHY_DEBUGFS_WRITE_WRAPPER(name, bufsz, objtype) \
|
2025-03-13 00:22:24 +02:00
|
|
|
WIPHY_DEBUGFS_WRITE_HANDLER_WRAPPER(name) \
|
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-02-16 11:42:40 +02:00
|
|
|
static ssize_t __iwl_dbgfs_##name##_write(struct file *file, \
|
|
|
|
const char __user *user_buf, \
|
|
|
|
size_t count, loff_t *ppos) \
|
|
|
|
{ \
|
|
|
|
struct ieee80211_##objtype *arg = file->private_data; \
|
|
|
|
struct iwl_mld *mld = iwl_mld_from_##objtype(arg); \
|
|
|
|
char buf[bufsz] = {}; \
|
|
|
|
\
|
|
|
|
return wiphy_locked_debugfs_write(mld->wiphy, file, \
|
|
|
|
buf, sizeof(buf), \
|
|
|
|
user_buf, count, \
|
|
|
|
iwl_dbgfs_##name##_write_handler, \
|
|
|
|
arg); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WIPHY_DEBUGFS_WRITE_FILE_OPS(name, bufsz, objtype) \
|
|
|
|
WIPHY_DEBUGFS_WRITE_WRAPPER(name, bufsz, objtype) \
|
|
|
|
static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
|
|
|
.write = __iwl_dbgfs_##name##_write, \
|
|
|
|
.open = simple_open, \
|
|
|
|
.llseek = generic_file_llseek, \
|
|
|
|
}
|
|
|
|
|
2025-03-13 00:22:25 +02:00
|
|
|
#define WIPHY_DEBUGFS_READ_HANDLER_WRAPPER_MLD(name) \
|
|
|
|
static ssize_t iwl_dbgfs_##name##_read_handler(struct wiphy *wiphy, \
|
|
|
|
struct file *file, char *buf, \
|
|
|
|
size_t count, void *data) \
|
|
|
|
{ \
|
|
|
|
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); \
|
|
|
|
struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw); \
|
|
|
|
return iwl_dbgfs_##name##_read(mld, buf, count); \
|
|
|
|
}
|
|
|
|
|
2025-03-13 00:22:24 +02:00
|
|
|
#define WIPHY_DEBUGFS_WRITE_HANDLER_WRAPPER_MLD(name) \
|
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-02-16 11:42:40 +02:00
|
|
|
static ssize_t iwl_dbgfs_##name##_write_handler(struct wiphy *wiphy, \
|
|
|
|
struct file *file, char *buf, \
|
|
|
|
size_t count, void *data) \
|
|
|
|
{ \
|
|
|
|
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); \
|
|
|
|
struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw); \
|
|
|
|
return iwl_dbgfs_##name##_write(mld, buf, count); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WIPHY_DEBUGFS_WRITE_WRAPPER_MLD(name) \
|
2025-03-13 00:22:24 +02:00
|
|
|
WIPHY_DEBUGFS_WRITE_HANDLER_WRAPPER_MLD(name) \
|
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-02-16 11:42:40 +02:00
|
|
|
static ssize_t __iwl_dbgfs_##name##_write(struct file *file, \
|
|
|
|
const char __user *user_buf, \
|
|
|
|
size_t count, loff_t *ppos) \
|
|
|
|
{ \
|
|
|
|
struct dbgfs_##name##_data *data = file->private_data; \
|
|
|
|
struct iwl_mld *mld = data->arg; \
|
|
|
|
\
|
|
|
|
return wiphy_locked_debugfs_write(mld->wiphy, file, \
|
|
|
|
data->buf, sizeof(data->buf), \
|
|
|
|
user_buf, count, \
|
|
|
|
iwl_dbgfs_##name##_write_handler, \
|
|
|
|
NULL); \
|
|
|
|
}
|
|
|
|
|
2025-03-13 00:22:25 +02:00
|
|
|
#define WIPHY_DEBUGFS_READ_WRAPPER_MLD(name) \
|
|
|
|
WIPHY_DEBUGFS_READ_HANDLER_WRAPPER_MLD(name) \
|
|
|
|
static ssize_t __iwl_dbgfs_##name##_read(struct file *file, \
|
|
|
|
char __user *user_buf, \
|
|
|
|
size_t count, loff_t *ppos) \
|
|
|
|
{ \
|
|
|
|
struct dbgfs_##name##_data *data = file->private_data; \
|
|
|
|
struct iwl_mld *mld = data->arg; \
|
|
|
|
\
|
|
|
|
if (!data->read_done) { \
|
|
|
|
data->read_done = true; \
|
|
|
|
data->rlen = wiphy_locked_debugfs_read(mld->wiphy, \
|
|
|
|
file, data->buf, sizeof(data->buf), \
|
|
|
|
user_buf, count, ppos, \
|
|
|
|
iwl_dbgfs_##name##_read_handler, NULL); \
|
|
|
|
return data->rlen; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
if (data->rlen < 0) \
|
|
|
|
return data->rlen; \
|
|
|
|
return simple_read_from_buffer(user_buf, count, ppos, \
|
|
|
|
data->buf, data->rlen); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WIPHY_DEBUGFS_READ_FILE_OPS_MLD(name, bufsz) \
|
|
|
|
MLD_DEBUGFS_OPEN_WRAPPER(name, bufsz, struct iwl_mld) \
|
|
|
|
WIPHY_DEBUGFS_READ_WRAPPER_MLD(name) \
|
|
|
|
static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
|
|
|
.read = __iwl_dbgfs_##name##_read, \
|
|
|
|
.open = _iwl_dbgfs_##name##_open, \
|
|
|
|
.llseek = generic_file_llseek, \
|
|
|
|
.release = _iwl_dbgfs_release, \
|
|
|
|
}
|
|
|
|
|
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-02-16 11:42:40 +02:00
|
|
|
#define WIPHY_DEBUGFS_WRITE_FILE_OPS_MLD(name, bufsz) \
|
|
|
|
MLD_DEBUGFS_OPEN_WRAPPER(name, bufsz, struct iwl_mld) \
|
|
|
|
WIPHY_DEBUGFS_WRITE_WRAPPER_MLD(name) \
|
|
|
|
static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
|
|
|
.write = __iwl_dbgfs_##name##_write, \
|
|
|
|
.open = _iwl_dbgfs_##name##_open, \
|
|
|
|
.llseek = generic_file_llseek, \
|
|
|
|
.release = _iwl_dbgfs_release, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WIPHY_DEBUGFS_READ_WRITE_FILE_OPS_MLD(name, bufsz) \
|
|
|
|
MLD_DEBUGFS_OPEN_WRAPPER(name, bufsz, struct iwl_mld) \
|
|
|
|
WIPHY_DEBUGFS_WRITE_WRAPPER_MLD(name) \
|
2025-03-13 00:22:26 +02:00
|
|
|
WIPHY_DEBUGFS_READ_WRAPPER_MLD(name) \
|
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-02-16 11:42:40 +02:00
|
|
|
static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
|
|
|
.write = __iwl_dbgfs_##name##_write, \
|
2025-03-13 00:22:26 +02:00
|
|
|
.read = __iwl_dbgfs_##name##_read, \
|
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-02-16 11:42:40 +02:00
|
|
|
.open = _iwl_dbgfs_##name##_open, \
|
|
|
|
.llseek = generic_file_llseek, \
|
|
|
|
.release = _iwl_dbgfs_release, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WIPHY_DEBUGFS_WRITE_WRAPPER_IEEE80211(name, bufsz, objtype) \
|
2025-03-13 00:22:24 +02:00
|
|
|
WIPHY_DEBUGFS_WRITE_HANDLER_WRAPPER(name) \
|
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-02-16 11:42:40 +02:00
|
|
|
static ssize_t _iwl_dbgfs_##name##_write(struct file *file, \
|
|
|
|
const char __user *user_buf, \
|
|
|
|
size_t count, loff_t *ppos) \
|
|
|
|
{ \
|
|
|
|
struct dbgfs_##name##_data *data = file->private_data; \
|
|
|
|
struct ieee80211_##objtype *arg = data->arg; \
|
|
|
|
struct iwl_mld *mld = iwl_mld_from_##objtype(arg); \
|
|
|
|
char buf[bufsz] = {}; \
|
|
|
|
\
|
|
|
|
return wiphy_locked_debugfs_write(mld->wiphy, file, \
|
|
|
|
buf, sizeof(buf), \
|
|
|
|
user_buf, count, \
|
|
|
|
iwl_dbgfs_##name##_write_handler, \
|
|
|
|
arg); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define IEEE80211_WIPHY_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, objtype) \
|
|
|
|
MLD_DEBUGFS_OPEN_WRAPPER(name, bufsz, struct ieee80211_##objtype) \
|
|
|
|
WIPHY_DEBUGFS_WRITE_WRAPPER_IEEE80211(name, bufsz, objtype) \
|
|
|
|
MLD_DEBUGFS_READ_WRAPPER(name) \
|
|
|
|
static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
|
|
|
.write = _iwl_dbgfs_##name##_write, \
|
|
|
|
.read = _iwl_dbgfs_##name##_read, \
|
|
|
|
.open = _iwl_dbgfs_##name##_open, \
|
|
|
|
.llseek = generic_file_llseek, \
|
|
|
|
.release = _iwl_dbgfs_release, \
|
|
|
|
}
|