fix: support Linux 7.2 cfg80211 API

This commit is contained in:
Shen Mintao
2026-08-08 12:22:08 +08:00
parent 35f32c238c
commit 44748e193a
2 changed files with 18 additions and 2 deletions
+11 -1
View File
@@ -4857,7 +4857,17 @@ rwnx_cfg80211_remain_on_channel(struct wiphy *wiphy,
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
enum nl80211_channel_type channel_type, enum nl80211_channel_type channel_type,
#endif #endif
unsigned int duration, u64 *cookie) unsigned int duration, u64 *cookie
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 2, 0)
/*
* 7.2 added an optional receive address filter for the off-channel
* period. cfg80211 refuses a non-NULL one unless the driver sets
* NL80211_EXT_FEATURE_ROC_ADDR_FILTER, which this one does not, so it
* is always NULL here. mac80211 ignores it in the same way.
*/
, const u8 *rx_addr
#endif
)
{ {
return rwnx_cfg80211_remain_on_channel_(wiphy, return rwnx_cfg80211_remain_on_channel_(wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
+7 -1
View File
@@ -4849,7 +4849,13 @@ int rwnx_send_dbg_trigger_req(struct rwnx_hw *rwnx_hw, char *msg)
return -ENOMEM; return -ENOMEM;
/* Set parameters for the MM_DBG_TRIGGER_REQ message */ /* Set parameters for the MM_DBG_TRIGGER_REQ message */
strncpy(req->error, msg, sizeof(req->error)); /*
* strncpy() is gone in 7.2. req->error is a fixed 64-byte field of a
* firmware message that is not NUL-terminated, and the message came
* from kzalloc(), so copying at most the field size is all strncpy()
* did here.
*/
memcpy(req->error, msg, strnlen(msg, sizeof(req->error)));
/* Send the MM_DBG_TRIGGER_REQ message to LMAC FW */ /* Send the MM_DBG_TRIGGER_REQ message to LMAC FW */
return rwnx_send_msg(rwnx_hw, req, 0, -1, NULL); return rwnx_send_msg(rwnx_hw, req, 0, -1, NULL);