AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/31 19:43 flow patch-triage
3m Args:
null

Results:
{
  "EnableConfigs": [
    "WLAN_VENDOR_RSI",
    "RSI_91X",
    "RSI_USB",
    "MAC80211"
  ],
  "FocusSymbols": [
    "rsi_prepare_beacon",
    "rsi_mgmt_pkt_recv"
  ],
  "KMSANReasoning": "The patch adds a bounds check (`skb_tailroom(skb)`) in `rsi_prepare_beacon()` to prevent buffer overflow (out-of-bounds write) when copying beacon data (`mac_bcn-\u003edata`) into the target `skb`. \n\nThis is a classic out-of-bounds prevention fix. Out-of-bounds accesses and buffer overflows are tracked and detected by KASAN (and skb assertions). The patch does not introduce any uninitialized memory reads, uninitialized struct fields, info-leaks to user space, or branching on uninitialized data. Consequently, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch adds missing tailroom bounds checks in rsi_prepare_beacon() before copying beacon data, preventing a potential buffer overflow or crash. The RSI 91x wireless driver is reachable via USB emulation (RSI_USB) and mac80211 in virtualized fuzzing setups.",
  "WorthFuzzing": true
}

1/1 2026/08/31 19:43 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit dd9d1b79298701c4a6b75f9761a6d63e9b7f4260\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Mon Aug 31 19:43:14 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c\nindex 7d26314a3e76a..50f77f3eee92c 100644\n--- a/drivers/net/wireless/rsi/rsi_91x_hal.c\n+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c\n@@ -431,6 +431,7 @@ int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\n \tstruct ieee80211_vif *vif;\n \tstruct sk_buff *mac_bcn;\n \tu8 vap_id = 0, i;\n+\tunsigned int tailroom;\n \tu16 tim_offset = 0;\n \n \tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\n@@ -480,6 +481,13 @@ int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\n \tif (mac_bcn-\u003edata[tim_offset + 2] == 0)\n \t\tbcn_frm-\u003eframe_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);\n \n+\ttailroom = skb_tailroom(skb);\n+\tif (tailroom \u003c FRAME_DESC_SZ ||\n+\t    mac_bcn-\u003elen \u003e tailroom - FRAME_DESC_SZ) {\n+\t\tdev_kfree_skb(mac_bcn);\n+\t\treturn -EMSGSIZE;\n+\t}\n+\n \tmemcpy(\u0026skb-\u003edata[FRAME_DESC_SZ], mac_bcn-\u003edata, mac_bcn-\u003elen);\n \tskb_put(skb, mac_bcn-\u003elen + FRAME_DESC_SZ);\n \n"
}

2/1 2026/08/31 19:43 agent patch-evaluator
2m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "WLAN_VENDOR_RSI",
    "RSI_91X",
    "RSI_USB",
    "MAC80211"
  ],
  "FocusSymbols": [
    "rsi_prepare_beacon",
    "rsi_mgmt_pkt_recv"
  ],
  "Reasoning": "The patch adds missing tailroom bounds checks in rsi_prepare_beacon() before copying beacon data, preventing a potential buffer overflow or crash. The RSI 91x wireless driver is reachable via USB emulation (RSI_USB) and mac80211 in virtualized fuzzing setups.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
  even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).
- Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed,
  ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU.
- Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove)
  that are executed only during PCI hot-unplug or sysfs driver unbind operations.

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
   Prefer non-static, non-inlined API entrypoint functions over internal static helper functions
   (which are inlined by the compiler and do not have distinct symbol addresses).
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs
   needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs
   output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit dd9d1b79298701c4a6b75f9761a6d63e9b7f4260
Author: syz-cluster <triage@syzkaller.com>
Date:   Mon Aug 31 19:43:14 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 7d26314a3e76a..50f77f3eee92c 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -431,6 +431,7 @@ int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)
 	struct ieee80211_vif *vif;
 	struct sk_buff *mac_bcn;
 	u8 vap_id = 0, i;
+	unsigned int tailroom;
 	u16 tim_offset = 0;
 
 	for (i = 0; i < RSI_MAX_VIFS; i++) {
@@ -480,6 +481,13 @@ int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)
 	if (mac_bcn->data[tim_offset + 2] == 0)
 		bcn_frm->frame_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);
 
+	tailroom = skb_tailroom(skb);
+	if (tailroom < FRAME_DESC_SZ ||
+	    mac_bcn->len > tailroom - FRAME_DESC_SZ) {
+		dev_kfree_skb(mac_bcn);
+		return -EMSGSIZE;
+	}
+
 	memcpy(&skb->data[FRAME_DESC_SZ], mac_bcn->data, mac_bcn->len);
 	skb_put(skb, mac_bcn->len + FRAME_DESC_SZ);
 

3/2 2026/08/31 19:43 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 2355
							output: 30
							thoughts: 117
						

Thoughts:
**Analyzing the Potential Impact of a Patch**

Okay, let's dive into this patch. My immediate goal is to understand the scope and implications. The modification is within `rsi_prepare_beacon` in `drivers/net/wireless/rsi/rsi_91x_hal.c`. Right, so this is the Redpine Signals 91x wireless driver. Now, the key question: is this USB or SDIO? And just as importantly, can I fuzz it effectively? If it's USB, we might be able to leverage something like syzkaller's USB raw gadget or some kind of USB emulation to get at it. That’s the ideal scenario for thorough testing. If not, what other attack surfaces are present?

Let's quickly search for other `rsi` driver files and the associated Kconfig to get a broader picture of the driver's dependencies and configuration options. This will help determine its overall architecture and determine how accessible this function is, and what attack vectors might exist.



4/2 2026/08/31 19:43 tool grepper
0m Args:
{
  "Expression": "RSI_",
  "PathPrefix": "drivers/net/wireless/rsi"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 1960 lines.\nUse more precise expression if possible.\n\ndrivers/net/wireless/rsi/Kconfig=13=if WLAN_VENDOR_RSI\ndrivers/net/wireless/rsi/Kconfig-14-\ndrivers/net/wireless/rsi/Kconfig:15:config RSI_91X\ndrivers/net/wireless/rsi/Kconfig-16-\ttristate \"Redpine Signals Inc 91x WLAN driver support\"\ndrivers/net/wireless/rsi/Kconfig:17:\tselect BT_HCIRSI if RSI_COEX\ndrivers/net/wireless/rsi/Kconfig-18-\tdepends on MAC80211\n--\ndrivers/net/wireless/rsi/Kconfig-22-\ndrivers/net/wireless/rsi/Kconfig:23:config RSI_DEBUGFS\ndrivers/net/wireless/rsi/Kconfig-24-\tbool \"Redpine Signals Inc debug support\"\ndrivers/net/wireless/rsi/Kconfig:25:\tdepends on RSI_91X\ndrivers/net/wireless/rsi/Kconfig-26-\tdefault y\n--\ndrivers/net/wireless/rsi/Kconfig-30-\ndrivers/net/wireless/rsi/Kconfig:31:config RSI_SDIO\ndrivers/net/wireless/rsi/Kconfig-32-\ttristate \"Redpine Signals SDIO bus support\"\ndrivers/net/wireless/rsi/Kconfig:33:\tdepends on MMC \u0026\u0026 RSI_91X\ndrivers/net/wireless/rsi/Kconfig-34-\tdefault m\n--\ndrivers/net/wireless/rsi/Kconfig-38-\ndrivers/net/wireless/rsi/Kconfig:39:config RSI_USB\ndrivers/net/wireless/rsi/Kconfig-40-\ttristate \"Redpine Signals USB bus support\"\ndrivers/net/wireless/rsi/Kconfig:41:\tdepends on USB \u0026\u0026 RSI_91X\ndrivers/net/wireless/rsi/Kconfig-42-\tdefault m\n--\ndrivers/net/wireless/rsi/Kconfig-46-\ndrivers/net/wireless/rsi/Kconfig:47:config RSI_COEX\ndrivers/net/wireless/rsi/Kconfig-48-\tbool \"Redpine Signals WLAN BT Coexistence support\"\ndrivers/net/wireless/rsi/Kconfig:49:\tdepends on BT \u0026\u0026 RSI_91X\ndrivers/net/wireless/rsi/Kconfig:50:\tdepends on !(BT=m \u0026\u0026 RSI_91X=y)\ndrivers/net/wireless/rsi/Kconfig-51-\tdefault y\n--\ndrivers/net/wireless/rsi/Makefile=7=rsi_91x-y\t\t\t+= rsi_91x_ps.o\ndrivers/net/wireless/rsi/Makefile:8:rsi_91x-$(CONFIG_RSI_COEX)\t+= rsi_91x_coex.o\ndrivers/net/wireless/rsi/Makefile:9:rsi_91x-$(CONFIG_RSI_DEBUGFS)\t+= rsi_91x_debugfs.o\ndrivers/net/wireless/rsi/Makefile-10-\n--\ndrivers/net/wireless/rsi/Makefile=12=rsi_sdio-y\t\t\t+= rsi_91x_sdio.o rsi_91x_sdio_ops.o\ndrivers/net/wireless/rsi/Makefile:13:obj-$(CONFIG_RSI_91X) \t\t+= rsi_91x.o\ndrivers/net/wireless/rsi/Makefile:14:obj-$(CONFIG_RSI_SDIO)\t\t+= rsi_sdio.o\ndrivers/net/wireless/rsi/Makefile:15:obj-$(CONFIG_RSI_USB)\t\t+= rsi_usb.o\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c=22=static enum rsi_coex_queues rsi_coex_determine_coex_q\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c-24-{\ndrivers/net/wireless/rsi/rsi_91x_coex.c:25:\tenum rsi_coex_queues q_num = RSI_COEX_Q_INVALID;\ndrivers/net/wireless/rsi/rsi_91x_coex.c-26-\ndrivers/net/wireless/rsi/rsi_91x_coex.c:27:\tif (skb_queue_len(\u0026coex_cb-\u003ecoex_tx_qs[RSI_COEX_Q_COMMON]) \u003e 0)\ndrivers/net/wireless/rsi/rsi_91x_coex.c:28:\t\tq_num = RSI_COEX_Q_COMMON;\ndrivers/net/wireless/rsi/rsi_91x_coex.c:29:\tif (skb_queue_len(\u0026coex_cb-\u003ecoex_tx_qs[RSI_COEX_Q_BT]) \u003e 0)\ndrivers/net/wireless/rsi/rsi_91x_coex.c:30:\t\tq_num = RSI_COEX_Q_BT;\ndrivers/net/wireless/rsi/rsi_91x_coex.c:31:\tif (skb_queue_len(\u0026coex_cb-\u003ecoex_tx_qs[RSI_COEX_Q_WLAN]) \u003e 0)\ndrivers/net/wireless/rsi/rsi_91x_coex.c:32:\t\tq_num = RSI_COEX_Q_WLAN;\ndrivers/net/wireless/rsi/rsi_91x_coex.c-33-\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c=37=static void rsi_coex_sched_tx_pkts(struct rsi_coex_ctrl_block *coex_cb)\ndrivers/net/wireless/rsi/rsi_91x_coex.c-38-{\ndrivers/net/wireless/rsi/rsi_91x_coex.c:39:\tenum rsi_coex_queues coex_q = RSI_COEX_Q_INVALID;\ndrivers/net/wireless/rsi/rsi_91x_coex.c-40-\tstruct sk_buff *skb;\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c-45-\ndrivers/net/wireless/rsi/rsi_91x_coex.c:46:\t\tif (coex_q == RSI_COEX_Q_BT) {\ndrivers/net/wireless/rsi/rsi_91x_coex.c:47:\t\t\tskb = skb_dequeue(\u0026coex_cb-\u003ecoex_tx_qs[RSI_COEX_Q_BT]);\ndrivers/net/wireless/rsi/rsi_91x_coex.c-48-\t\t\trsi_send_bt_pkt(coex_cb-\u003epriv, skb);\ndrivers/net/wireless/rsi/rsi_91x_coex.c-49-\t\t}\ndrivers/net/wireless/rsi/rsi_91x_coex.c:50:\t} while (coex_q != RSI_COEX_Q_INVALID);\ndrivers/net/wireless/rsi/rsi_91x_coex.c-51-}\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c=68=int rsi_coex_recv_pkt(struct rsi_common *common, u8 *msg)\ndrivers/net/wireless/rsi/rsi_91x_coex.c-69-{\ndrivers/net/wireless/rsi/rsi_91x_coex.c:70:\tu8 msg_type = msg[RSI_RX_DESC_MSG_TYPE_OFFSET];\ndrivers/net/wireless/rsi/rsi_91x_coex.c-71-\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c=87=static inline int rsi_map_coex_q(u8 hal_queue)\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c-89-\tswitch (hal_queue) {\ndrivers/net/wireless/rsi/rsi_91x_coex.c:90:\tcase RSI_COEX_Q:\ndrivers/net/wireless/rsi/rsi_91x_coex.c:91:\t\treturn RSI_COEX_Q_COMMON;\ndrivers/net/wireless/rsi/rsi_91x_coex.c:92:\tcase RSI_WLAN_Q:\ndrivers/net/wireless/rsi/rsi_91x_coex.c:93:\t\treturn RSI_COEX_Q_WLAN;\ndrivers/net/wireless/rsi/rsi_91x_coex.c:94:\tcase RSI_BT_Q:\ndrivers/net/wireless/rsi/rsi_91x_coex.c:95:\t\treturn RSI_COEX_Q_BT;\ndrivers/net/wireless/rsi/rsi_91x_coex.c-96-\t}\ndrivers/net/wireless/rsi/rsi_91x_coex.c:97:\treturn RSI_COEX_Q_INVALID;\ndrivers/net/wireless/rsi/rsi_91x_coex.c-98-}\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c=100=int rsi_coex_send_pkt(void *priv, struct sk_buff *skb, u8 hal_queue)\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c-108-\tcoex_q = rsi_map_coex_q(hal_queue);\ndrivers/net/wireless/rsi/rsi_91x_coex.c:109:\tif (coex_q == RSI_COEX_Q_INVALID) {\ndrivers/net/wireless/rsi/rsi_91x_coex.c-110-\t\trsi_dbg(ERR_ZONE, \"Invalid coex queue\\n\");\n--\ndrivers/net/wireless/rsi/rsi_91x_coex.c-112-\t}\ndrivers/net/wireless/rsi/rsi_91x_coex.c:113:\tif (coex_q != RSI_COEX_Q_COMMON \u0026\u0026\ndrivers/net/wireless/rsi/rsi_91x_coex.c:114:\t    coex_q != RSI_COEX_Q_WLAN) {\ndrivers/net/wireless/rsi/rsi_91x_coex.c-115-\t\tskb_queue_tail(\u0026coex_cb-\u003ecoex_tx_qs[coex_q], skb);\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c=91=static u32 rsi_get_num_pkts_dequeue(struct rsi_common *common, u8 q_num)\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c-101-\ndrivers/net/wireless/rsi/rsi_91x_core.c:102:\trate.bitrate = RSI_RATE_MCS0 * 5 * 10; /* Convert to Kbps */\ndrivers/net/wireless/rsi/rsi_91x_core.c-103-\tif (q_num == VI_Q)\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c=261=void rsi_core_qos_processor(struct rsi_common *common)\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c-307-\t\t} else {\ndrivers/net/wireless/rsi/rsi_91x_core.c:308:#ifdef CONFIG_RSI_COEX\ndrivers/net/wireless/rsi/rsi_91x_core.c-309-\t\t\tif (common-\u003ecoex_mode \u003e 1) {\ndrivers/net/wireless/rsi/rsi_91x_core.c-310-\t\t\t\tstatus = rsi_coex_send_pkt(common, skb,\ndrivers/net/wireless/rsi/rsi_91x_core.c:311:\t\t\t\t\t\t\t   RSI_WLAN_Q);\ndrivers/net/wireless/rsi/rsi_91x_core.c-312-\t\t\t} else {\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c-317-\t\t\t\t\tstatus = rsi_send_data_pkt(common, skb);\ndrivers/net/wireless/rsi/rsi_91x_core.c:318:#ifdef CONFIG_RSI_COEX\ndrivers/net/wireless/rsi/rsi_91x_core.c-319-\t\t\t}\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c=352=struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8 *mac)\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c-356-\ndrivers/net/wireless/rsi/rsi_91x_core.c:357:\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_core.c-358-\t\tvif = adapter-\u003evifs[i];\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c=374=void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c-392-\t}\ndrivers/net/wireless/rsi/rsi_91x_core.c:393:\tif (common-\u003ewow_flags \u0026 RSI_WOW_ENABLED) {\ndrivers/net/wireless/rsi/rsi_91x_core.c-394-\t\trsi_dbg(ERR_ZONE,\n--\ndrivers/net/wireless/rsi/rsi_91x_core.c-420-\t\t\trsi_hal_send_sta_notify_frame(common,\ndrivers/net/wireless/rsi/rsi_91x_core.c:421:\t\t\t\t\t\t      RSI_IFTYPE_STATION,\ndrivers/net/wireless/rsi/rsi_91x_core.c-422-\t\t\t\t\t\t      STA_CONNECTED, bss-\u003ebssid,\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=58=int rsi_prepare_mgmt_desc(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-105-\trsi_set_len_qno(\u0026mgmt_desc-\u003elen_qno, (skb-\u003elen - FRAME_DESC_SZ),\ndrivers/net/wireless/rsi/rsi_91x_hal.c:106:\t\t\tRSI_WIFI_MGMT_Q);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-107-\tmgmt_desc-\u003eframe_type = TX_DOT11_MGMT;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-111-\tif (ieee80211_is_probe_req(wh-\u003eframe_control))\ndrivers/net/wireless/rsi/rsi_91x_hal.c:112:\t\tmgmt_desc-\u003eframe_info = cpu_to_le16(RSI_INSERT_SEQ_IN_FW);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-113-\tmgmt_desc-\u003eframe_info |= cpu_to_le16(RATE_INFO_ENABLE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-114-\tif (is_broadcast_ether_addr(wh-\u003eaddr1))\ndrivers/net/wireless/rsi/rsi_91x_hal.c:115:\t\tmgmt_desc-\u003eframe_info |= cpu_to_le16(RSI_BROADCAST_PKT);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-116-\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-119-\tif ((common-\u003eband == NL80211_BAND_2GHZ) \u0026\u0026 !common-\u003ep2p_enabled)\ndrivers/net/wireless/rsi/rsi_91x_hal.c:120:\t\tmgmt_desc-\u003erate_info = cpu_to_le16(RSI_RATE_1);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-121-\telse\ndrivers/net/wireless/rsi/rsi_91x_hal.c:122:\t\tmgmt_desc-\u003erate_info = cpu_to_le16(RSI_RATE_6);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-123-\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-127-\tif (ieee80211_is_probe_resp(wh-\u003eframe_control)) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c:128:\t\tmgmt_desc-\u003emisc_flags |= (RSI_ADD_DELTA_TSF_VAP_ID |\ndrivers/net/wireless/rsi/rsi_91x_hal.c:129:\t\t\t\t\t  RSI_FETCH_RETRY_CNT_FRM_HST);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-130-#define PROBE_RESP_RETRY_CNT\t3\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-144-\tmgmt_desc-\u003erate_info |=\ndrivers/net/wireless/rsi/rsi_91x_hal.c:145:\t\tcpu_to_le16((tx_params-\u003evap_id \u003c\u003c RSI_DESC_VAP_ID_OFST) \u0026\ndrivers/net/wireless/rsi/rsi_91x_hal.c:146:\t\t\t    RSI_DESC_VAP_ID_MASK);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-147-\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=152=int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-200-\t\tieee80211_size += 2;\ndrivers/net/wireless/rsi/rsi_91x_hal.c:201:\t\tdata_desc-\u003emac_flags |= cpu_to_le16(RSI_QOS_ENABLE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-202-\t}\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-206-\t    (adapter-\u003eps_state == PS_ENABLED))\ndrivers/net/wireless/rsi/rsi_91x_hal.c:207:\t\twh-\u003eframe_control |= cpu_to_le16(RSI_SET_PS_ENABLE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-208-\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-214-\t\t\tieee80211_size += 8;\ndrivers/net/wireless/rsi/rsi_91x_hal.c:215:\t\tdata_desc-\u003emac_flags |= cpu_to_le16(RSI_ENCRYPT_PKT);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-216-\t}\ndrivers/net/wireless/rsi/rsi_91x_hal.c-217-\trsi_set_len_qno(\u0026data_desc-\u003elen_qno, (skb-\u003elen - FRAME_DESC_SZ),\ndrivers/net/wireless/rsi/rsi_91x_hal.c:218:\t\t\tRSI_WIFI_DATA_Q);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-219-\tdata_desc-\u003eheader_len = ieee80211_size;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-242-\t\tif (common-\u003eband == NL80211_BAND_5GHZ)\ndrivers/net/wireless/rsi/rsi_91x_hal.c:243:\t\t\tdata_desc-\u003erate_info = cpu_to_le16(RSI_RATE_6);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-244-\t\telse\ndrivers/net/wireless/rsi/rsi_91x_hal.c:245:\t\t\tdata_desc-\u003erate_info = cpu_to_le16(RSI_RATE_1);\ndrivers/net/wireless/rsi/rsi_91x_hal.c:246:\t\tdata_desc-\u003emac_flags |= cpu_to_le16(RSI_REKEY_PURPOSE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c:247:\t\tdata_desc-\u003emisc_flags |= RSI_FETCH_RETRY_CNT_FRM_HST;\ndrivers/net/wireless/rsi/rsi_91x_hal.c-248-#define EAPOL_RETRY_CNT 15\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-255-\t\t\t\t\t(skb-\u003elen - FRAME_DESC_SZ),\ndrivers/net/wireless/rsi/rsi_91x_hal.c:256:\t\t\t\t\tRSI_WIFI_MGMT_Q);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-257-\t\tif (((skb-\u003elen - header_size) == EAPOL4_PACKET_LEN) ||\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-259-\t\t\tdata_desc-\u003emisc_flags |=\ndrivers/net/wireless/rsi/rsi_91x_hal.c:260:\t\t\t\tRSI_DESC_REQUIRE_CFM_TO_HOST;\ndrivers/net/wireless/rsi/rsi_91x_hal.c-261-\t\t\txtend_desc-\u003econfirm_frame_type = EAPOL4_CONFIRM;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-272-\t\tdata_desc-\u003eframe_info = cpu_to_le16(RATE_INFO_ENABLE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c:273:\t\tdata_desc-\u003eframe_info |= cpu_to_le16(RSI_BROADCAST_PKT);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-274-\t\tdata_desc-\u003esta_id = vap_id;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-278-\t\t\tif (common-\u003eband == NL80211_BAND_5GHZ)\ndrivers/net/wireless/rsi/rsi_91x_hal.c:279:\t\t\t\tdata_desc-\u003erate_info = cpu_to_le16(RSI_RATE_6);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-280-\t\t\telse\ndrivers/net/wireless/rsi/rsi_91x_hal.c:281:\t\t\t\tdata_desc-\u003erate_info = cpu_to_le16(RSI_RATE_1);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-282-\t\t}\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-289-\tdata_desc-\u003erate_info |=\ndrivers/net/wireless/rsi/rsi_91x_hal.c:290:\t\tcpu_to_le16((tx_params-\u003evap_id \u003c\u003c RSI_DESC_VAP_ID_OFST) \u0026\ndrivers/net/wireless/rsi/rsi_91x_hal.c:291:\t\t\t    RSI_DESC_VAP_ID_MASK);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-292-\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=337=int rsi_send_mgmt_pkt(struct rsi_common *common,\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-373-\t\t\t\"%s: blocking mgmt queue\\n\", __func__);\ndrivers/net/wireless/rsi/rsi_91x_hal.c:374:\t\tmgmt_desc-\u003emisc_flags = RSI_DESC_REQUIRE_CFM_TO_HOST;\ndrivers/net/wireless/rsi/rsi_91x_hal.c-375-\t\txtend_desc-\u003econfirm_frame_type = PROBEREQ_CONFIRM;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=388=int rsi_send_bt_pkt(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-394-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:395:\tif (queueno == RSI_BT_MGMT_Q) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c-396-\t\tstatus = rsi_send_pkt_to_bus(common, skb);\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-412-\trsi_set_len_qno(\u0026bt_desc-\u003elen_qno, (skb-\u003elen - FRAME_DESC_SZ),\ndrivers/net/wireless/rsi/rsi_91x_hal.c:413:\t\t\tRSI_BT_DATA_Q);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-414-\tbt_desc-\u003ebt_pkt_type = cpu_to_le16(bt_cb(skb)-\u003epkt_type);\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=425=int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-436-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:437:\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c-438-\t\tvif = adapter-\u003evifs[i];\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-456-\tbcn_frm = (struct rsi_data_desc *)skb-\u003edata;\ndrivers/net/wireless/rsi/rsi_91x_hal.c:457:\trsi_set_len_qno(\u0026bcn_frm-\u003elen_qno, mac_bcn-\u003elen, RSI_WIFI_DATA_Q);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-458-\tbcn_frm-\u003eheader_len = MIN_802_11_HDR_LEN;\ndrivers/net/wireless/rsi/rsi_91x_hal.c:459:\tbcn_frm-\u003eframe_info = cpu_to_le16(RSI_DATA_DESC_MAC_BBP_INFO |\ndrivers/net/wireless/rsi/rsi_91x_hal.c:460:\t\t\t\t\t  RSI_DATA_DESC_NO_ACK_IND |\ndrivers/net/wireless/rsi/rsi_91x_hal.c:461:\t\t\t\t\t  RSI_DATA_DESC_BEACON_FRAME |\ndrivers/net/wireless/rsi/rsi_91x_hal.c:462:\t\t\t\t\t  RSI_DATA_DESC_INSERT_TSF |\ndrivers/net/wireless/rsi/rsi_91x_hal.c:463:\t\t\t\t\t  RSI_DATA_DESC_INSERT_SEQ_NO |\ndrivers/net/wireless/rsi/rsi_91x_hal.c-464-\t\t\t\t\t  RATE_INFO_ENABLE);\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-476-\tif (common-\u003eband == NL80211_BAND_2GHZ)\ndrivers/net/wireless/rsi/rsi_91x_hal.c:477:\t\tbcn_frm-\u003erate_info |= cpu_to_le16(RSI_RATE_1);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-478-\telse\ndrivers/net/wireless/rsi/rsi_91x_hal.c:479:\t\tbcn_frm-\u003erate_info |= cpu_to_le16(RSI_RATE_6);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-480-\ndrivers/net/wireless/rsi/rsi_91x_hal.c-481-\tif (mac_bcn-\u003edata[tim_offset + 2] == 0)\ndrivers/net/wireless/rsi/rsi_91x_hal.c:482:\t\tbcn_frm-\u003eframe_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-483-\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=650=static int bl_write_header(struct rsi_hw *adapter, u8 *flash_content,\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-670-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:671:\tif (adapter-\u003ersi_host_intf == RSI_HOST_INTF_USB) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c-672-\t\twrite_addr = PING_BUFFER_ADDRESS;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-689-\t\t}\ndrivers/net/wireless/rsi/rsi_91x_hal.c:690:\t\twrite_addr = RSI_SD_REQUEST_MASTER |\ndrivers/net/wireless/rsi/rsi_91x_hal.c-691-\t\t\t     (PING_BUFFER_ADDRESS \u0026 0xFFFF);\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=850=static int rsi_hal_prepare_fwload(struct rsi_hw *adapter)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-860-\t\t\t\t\t\t  \u0026regout_val,\ndrivers/net/wireless/rsi/rsi_91x_hal.c:861:\t\t\t\t\t\t  RSI_COMMON_REG_SIZE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-862-\t\tif (status \u003c 0) {\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-885-\t\t\t\t\t    REGOUT_INVALID \u003c\u003c 8),\ndrivers/net/wireless/rsi/rsi_91x_hal.c:886:\t\t\t\t\t   RSI_COMMON_REG_SIZE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-887-\tif (status \u003c 0)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=1011=static int rsi_load_9116_firmware(struct rsi_hw *adapter)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1025-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1026:\tif (adapter-\u003ersi_host_intf == RSI_HOST_INTF_USB) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1027-\t\tstatus = bl_cmd(adapter, POLLING_MODE, CMD_PASS,\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1034-\t\t\t\t\t   RAM_384K_ACCESS_FROM_TA,\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1035:\t\t\t\t\t   RSI_9116_REG_SIZE);\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1036-\tif (status \u003c 0) {\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1071-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1072:\tif (*(u16 *)fw_p == RSI_9116_FW_MAGIC_WORD) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1073-\t\tmemcpy(\u0026bootload_ds, fw_p, sizeof(struct bootload_ds));\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1083-\t\t\tlen = le32_to_cpu(bootload_ds.bl_entry[cnt].control) \u0026\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1084:\t\t\t      RSI_BL_CTRL_LEN_MASK;\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1085-\t\t\trsi_dbg(INFO_ZONE, \"length %d destination %x\\n\",\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1098-\t\t\tif (le32_to_cpu(bootload_ds.bl_entry[cnt].control) \u0026\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1099:\t\t\t    RSI_BL_CTRL_LAST_ENTRY)\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1100-\t\t\t\tbreak;\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1120-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1121:\tif (adapter-\u003ersi_host_intf == RSI_HOST_INTF_SDIO) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1122-\t\tif (hif_ops-\u003eta_reset(adapter))\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c=1140=int rsi_hal_device_init(struct rsi_hw *adapter)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1145-\tswitch (adapter-\u003edevice_model) {\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1146:\tcase RSI_DEV_9113:\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1147-\t\tstatus = rsi_hal_prepare_fwload(adapter);\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1156-\t\tbreak;\ndrivers/net/wireless/rsi/rsi_91x_hal.c:1157:\tcase RSI_DEV_9116:\ndrivers/net/wireless/rsi/rsi_91x_hal.c-1158-\t\tstatus = rsi_hal_prepare_fwload(adapter);\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=106=struct ieee80211_rate rsi_rates[12] = {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:107:\t{ .bitrate = STD_RATE_01  * 5, .hw_value = RSI_RATE_1 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:108:\t{ .bitrate = STD_RATE_02  * 5, .hw_value = RSI_RATE_2 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:109:\t{ .bitrate = STD_RATE_5_5 * 5, .hw_value = RSI_RATE_5_5 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:110:\t{ .bitrate = STD_RATE_11  * 5, .hw_value = RSI_RATE_11 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:111:\t{ .bitrate = STD_RATE_06  * 5, .hw_value = RSI_RATE_6 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:112:\t{ .bitrate = STD_RATE_09  * 5, .hw_value = RSI_RATE_9 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:113:\t{ .bitrate = STD_RATE_12  * 5, .hw_value = RSI_RATE_12 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:114:\t{ .bitrate = STD_RATE_18  * 5, .hw_value = RSI_RATE_18 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:115:\t{ .bitrate = STD_RATE_24  * 5, .hw_value = RSI_RATE_24 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:116:\t{ .bitrate = STD_RATE_36  * 5, .hw_value = RSI_RATE_36 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:117:\t{ .bitrate = STD_RATE_48  * 5, .hw_value = RSI_RATE_48 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:118:\t{ .bitrate = STD_RATE_54  * 5, .hw_value = RSI_RATE_54 },\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-119-};\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=121=const u16 rsi_mcsrates[8] = {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:122:\tRSI_RATE_MCS0, RSI_RATE_MCS1, RSI_RATE_MCS2, RSI_RATE_MCS3,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:123:\tRSI_RATE_MCS4, RSI_RATE_MCS5, RSI_RATE_MCS6, RSI_RATE_MCS7\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-124-};\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=233=static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-246-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:247:\tif ((common-\u003ewow_flags \u0026 RSI_WOW_ENABLED) ||\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-248-\t    scan_req-\u003en_channels == 0)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-262-\tcommon-\u003ehwscan = scan_req;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:263:\tif (!rsi_send_bgscan_params(common, RSI_START_BGSCAN)) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-264-\t\tif (!rsi_send_bgscan_probe_req(common, vif)) {\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=274=static void rsi_mac80211_cancel_hw_scan(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-284-\tif (common-\u003ebgscan_en) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:285:\t\tif (!rsi_send_bgscan_params(common, RSI_STOP_BGSCAN))\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-286-\t\t\tcommon-\u003ebgscan_en = false;\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=302=void rsi_mac80211_detach(struct rsi_hw *adapter)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-320-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:321:#ifdef CONFIG_RSI_DEBUGFS\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-322-\trsi_remove_dbgfs(adapter);\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=433=static int rsi_map_intf_mode(enum nl80211_iftype vif_type)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-436-\tcase NL80211_IFTYPE_STATION:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:437:\t\treturn RSI_OPMODE_STA;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-438-\tcase NL80211_IFTYPE_AP:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:439:\t\treturn RSI_OPMODE_AP;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-440-\tcase NL80211_IFTYPE_P2P_DEVICE:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:441:\t\treturn RSI_OPMODE_P2P_CLIENT;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-442-\tcase NL80211_IFTYPE_P2P_CLIENT:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:443:\t\treturn RSI_OPMODE_P2P_CLIENT;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-444-\tcase NL80211_IFTYPE_P2P_GO:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:445:\t\treturn RSI_OPMODE_P2P_GO;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-446-\tdefault:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:447:\t\treturn RSI_OPMODE_UNSUPPORTED;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-448-\t}\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=459=static int rsi_mac80211_add_interface(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-472-\tintf_mode = rsi_map_intf_mode(vif-\u003etype);\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:473:\tif (intf_mode == RSI_OPMODE_UNSUPPORTED) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-474-\t\trsi_dbg(ERR_ZONE,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-485-\t/* Get free vap index */\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:486:\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-487-\t\tif (!adapter-\u003evifs[i] ||\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=530=static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-547-\topmode = rsi_map_intf_mode(vif-\u003etype);\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:548:\tif (opmode == RSI_OPMODE_UNSUPPORTED) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-549-\t\trsi_dbg(ERR_ZONE, \"Opmode error : %d\\n\", opmode);\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-552-\t}\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:553:\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-554-\t\tif (!adapter-\u003evifs[i])\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=574=static int rsi_channel_change(struct ieee80211_hw *hw)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-589-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:590:\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-591-\t\tvif = adapter-\u003evifs[i];\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=664=static int rsi_mac80211_config(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-690-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:691:\t\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-692-\t\t\tvif = adapter-\u003evifs[i];\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=786=static void rsi_mac80211_bss_info_changed(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-808-\t\trsi_inform_bss_status(common,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:809:\t\t\t\t      RSI_OPMODE_STA,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-810-\t\t\t\t      vif-\u003ecfg.assoc,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-846-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:847:\t\t\t\trsi_set_vap_capabilities(common, RSI_OPMODE_AP,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-848-\t\t\t\t\t\t\t vif-\u003eaddr, vif_info-\u003evap_id,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=880=static void rsi_mac80211_conf_filter(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-885-\t/* Not doing much here as of now */\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:886:\t*total_flags \u0026= RSI_SUPP_FILTERS;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-887-}\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=961=static int rsi_hal_key_config(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-972-\tif (key-\u003eflags \u0026 IEEE80211_KEY_FLAG_PAIRWISE)\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:973:\t\tkey_type = RSI_PAIRWISE_KEY;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-974-\telse\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:975:\t\tkey_type = RSI_GROUP_KEY;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-976-\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-993-\t\t\t\t\t\t  key-\u003ekeylen,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:994:\t\t\t\t\t\t  RSI_PAIRWISE_KEY,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-995-\t\t\t\t\t\t  key-\u003ekeyidx,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1091=static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1107-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1108:\tfor (ii = 0; ii \u003c RSI_MAX_VIFS; ii++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1109-\t\tif (vif == adapter-\u003evifs[ii])\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1112-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1113:\tif (ii \u003e= RSI_MAX_VIFS)\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1114-\t\treturn status;\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1309=static void rsi_fill_rx_status(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1352-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1353:\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1354-\t\tvif = adapter-\u003evifs[i];\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1407=static int rsi_mac80211_sta_add(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1470-\t\t\trsi_dbg(INFO_ZONE, \"Indicate bss status to device\\n\");\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1471:\t\t\trsi_inform_bss_status(common, RSI_OPMODE_AP, 1,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1472-\t\t\t\t\t      sta-\u003eaddr, sta-\u003ewme, sta-\u003eaid,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1482-\t\t\t\t\t\t\t key-\u003ekeylen,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1483:\t\t\t\t\t\t\t RSI_PAIRWISE_KEY,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1484-\t\t\t\t\t\t\t key-\u003ekeyidx,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1523=static int rsi_mac80211_sta_remove(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1547-\t\t\tif (!memcmp(rsta-\u003esta-\u003eaddr, sta-\u003eaddr, ETH_ALEN)) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1548:\t\t\t\trsi_inform_bss_status(common, RSI_OPMODE_AP, 0,\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1549-\t\t\t\t\t\t      sta-\u003eaddr, sta-\u003ewme,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1665=static int rsi_map_region_code(enum nl80211_dfs_regions region_code)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1668-\tcase NL80211_DFS_FCC:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1669:\t\treturn RSI_REGION_FCC;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1670-\tcase NL80211_DFS_ETSI:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1671:\t\treturn RSI_REGION_ETSI;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1672-\tcase NL80211_DFS_JP:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1673:\t\treturn RSI_REGION_TELEC;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1674-\tcase NL80211_DFS_UNSET:\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1675:\t\treturn RSI_REGION_WORLD;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1676-\t}\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1677:\treturn RSI_REGION_WORLD;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1678-}\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1729=static void rsi_resume_conn_channel(struct rsi_common *common)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1734-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1735:\tfor (cnt = 0; cnt \u003c RSI_MAX_VIFS; cnt++) {\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1736-\t\tvif = adapter-\u003evifs[cnt];\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1849=static u16 rsi_wow_map_triggers(struct rsi_common *common,\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1856-\tif (wowlan-\u003eany)\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1857:\t\twow_triggers |= RSI_WOW_ANY;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1858-\tif (wowlan-\u003emagic_pkt)\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1859:\t\twow_triggers |= RSI_WOW_MAGIC_PKT;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1860-\tif (wowlan-\u003edisconnect)\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1861:\t\twow_triggers |= RSI_WOW_DISCONNECT;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1862-\tif (wowlan-\u003egtk_rekey_failure || wowlan-\u003eeap_identity_req ||\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1863-\t    wowlan-\u003efour_way_handshake)\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1864:\t\twow_triggers |= RSI_WOW_GTK_REKEY;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1865-\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=1869=int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan)\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1885-\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1886:\tcommon-\u003ewow_flags |= RSI_WOW_ENABLED;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1887-\ttriggers = rsi_wow_map_triggers(common, wowlan);\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1894-\t\t\t\"Cannot configure WoWLAN (Station not connected)\\n\");\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c:1895:\t\tcommon-\u003ewow_flags |= RSI_WOW_NO_CONNECTION;\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c-1896-\t\treturn 0;\n--\ndrivers/net/wireless/rsi/rsi_91x_mac80211.c=2007=int rsi_mac80211_attach(struct rsi_common *common)\n\n"
}

5/2 2026/08/31 19:43 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 17957
							output: 19
							thoughts: 19
						

Thoughts:
Here's a summary of my thought process:

**Beacon Preparation Call Stack Investigation**

Okay, time to dive into this `rsi_prepare_beacon` function. My initial move is to figure out the calling hierarchy – who's invoking this thing, and where are those calls originating from? Understanding the call stack is crucial for figuring out the bigger picture. I need to trace this function's usage throughout the codebase, identify all the callers, and understand the context in which `rsi_prepare_beacon` is being utilized. This will give me insights into its purpose and how it fits into the broader beacon preparation or transmission process. From there, I can start to infer potential problem areas, optimization opportunities, or dependencies. Let's start the hunt and get a clear map of these calls.



6/2 2026/08/31 19:43 tool grepper
0m Args:
{
  "Expression": "rsi_prepare_beacon"
}

Results:
{
  "Output": "drivers/net/wireless/rsi/rsi_91x_hal.c=388=int rsi_send_bt_pkt(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-424-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:425:int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\ndrivers/net/wireless/rsi/rsi_91x_hal.c-426-{\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c=1763=static int rsi_send_beacon(struct rsi_common *common)\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-1776-\t\tskb_pull(skb, (64 - dword_align_bytes));\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c:1777:\tif (rsi_prepare_beacon(common, skb)) {\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-1778-\t\trsi_dbg(ERR_ZONE, \"Failed to prepare beacon\\n\");\n--\ndrivers/net/wireless/rsi/rsi_hal.h=225=int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb);\ndrivers/net/wireless/rsi/rsi_hal.h:226:int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb);\ndrivers/net/wireless/rsi/rsi_hal.h-227-int rsi_send_pkt_to_bus(struct rsi_common *common, struct sk_buff *skb);\n"
}

7/2 2026/08/31 19:43 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 18621
							output: 46
							thoughts: 42
						

Thoughts:
Okay, let's dive into this.

**Investigating the `rsi_send_beacon` Function Call and Driver Operation**

Alright, I need to understand how `rsi_send_beacon` is being used within the driver. Time to dig into the source code. My gut feeling tells me to start in `rsi_91x_mgmt.c`, especially around line 1763, assuming that's where the core management functionality might reside. That seems like a reasonable starting point to trace the beacon transmission logic. I'm going to carefully review the surrounding code to grasp the context of that function call and how the driver orchestrates the beacon transmission process. Hopefully this will shed light on the beacon's configuration and the overall driver behavior.



8/2 2026/08/31 19:44 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_mgmt.c",
  "FirstLine": 1760,
  "LineCount": 45
}

Results:
{
  "Contents": "1760:\t\treturn rsi_send_internal_mgmt_frame(common, skb);\n1761:\t}\n1762:\t\n1763:\tstatic int rsi_send_beacon(struct rsi_common *common)\n1764:\t{\n1765:\t\tstruct sk_buff *skb = NULL;\n1766:\t\tu8 dword_align_bytes = 0;\n1767:\t\n1768:\t\tskb = dev_alloc_skb(MAX_MGMT_PKT_SIZE);\n1769:\t\tif (!skb)\n1770:\t\t\treturn -ENOMEM;\n1771:\t\n1772:\t\tmemset(skb-\u003edata, 0, MAX_MGMT_PKT_SIZE);\n1773:\t\n1774:\t\tdword_align_bytes = ((unsigned long)skb-\u003edata \u0026 0x3f);\n1775:\t\tif (dword_align_bytes)\n1776:\t\t\tskb_pull(skb, (64 - dword_align_bytes));\n1777:\t\tif (rsi_prepare_beacon(common, skb)) {\n1778:\t\t\trsi_dbg(ERR_ZONE, \"Failed to prepare beacon\\n\");\n1779:\t\t\tdev_kfree_skb(skb);\n1780:\t\t\treturn -EINVAL;\n1781:\t\t}\n1782:\t\tskb_queue_tail(\u0026common-\u003etx_queue[MGMT_BEACON_Q], skb);\n1783:\t\trsi_set_event(\u0026common-\u003etx_thread.event);\n1784:\t\trsi_dbg(DATA_TX_ZONE, \"%s: Added to beacon queue\\n\", __func__);\n1785:\t\n1786:\t\treturn 0;\n1787:\t}\n1788:\t\n1789:\t#ifdef CONFIG_PM\n1790:\tint rsi_send_wowlan_request(struct rsi_common *common, u16 flags,\n1791:\t\t\t\t    u16 sleep_status)\n1792:\t{\n1793:\t\tstruct rsi_wowlan_req *cmd_frame;\n1794:\t\tstruct sk_buff *skb;\n1795:\t\tu8 length;\n1796:\t\n1797:\t\trsi_dbg(ERR_ZONE, \"%s: Sending wowlan request frame\\n\", __func__);\n1798:\t\n1799:\t\tlength = sizeof(*cmd_frame);\n1800:\t\tskb = dev_alloc_skb(length);\n1801:\t\tif (!skb)\n1802:\t\t\treturn -ENOMEM;\n1803:\t\tmemset(skb-\u003edata, 0, length);\n1804:\t\tcmd_frame = (struct rsi_wowlan_req *)skb-\u003edata;\n"
}

9/2 2026/08/31 19:44 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 19609
							output: 32
							thoughts: 15
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating `rsi_send_beacon` Usage**

Alright, let's dive in. I need to understand the call hierarchy for `rsi_send_beacon`. I'm going to start by tracing all the places where that function is invoked. That's the logical starting point for understanding how it fits into the broader system and, more importantly, what contexts and data it operates within. This should quickly give me a sense of its purpose and impact. I'm expecting to see multiple uses, and I'll be looking for patterns in those calls – are they clustered around specific modules, device drivers, or higher-level functionalities? Are there any obvious candidates for where this beacon transmission is occurring? What sort of data is likely being passed to the function in each of the places that calls it? And finally, what's its role?



10/2 2026/08/31 19:44 tool grepper
0m Args:
{
  "Expression": "rsi_send_beacon",
  "PathPrefix": "drivers/net/wireless/rsi"
}

Results:
{
  "Output": "drivers/net/wireless/rsi/rsi_91x_mgmt.c=1738=int rsi_set_antenna(struct rsi_common *common, u8 antenna)\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-1762-\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c:1763:static int rsi_send_beacon(struct rsi_common *common)\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-1764-{\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c=2185=int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-2224-\t\t\treturn -1;\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c:2225:\t\trsi_send_beacon(common);\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-2226-\t\tbreak;\n"
}

11/2 2026/08/31 19:44 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 20136
							output: 45
							thoughts: 23
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving into `rsi_rsi_91x_hal.c` and `rsi_prepare_beacon`**

Okay, so we need to look at the radio configuration here, so let's start with `rsi_rsi_91x_hal.c`. The problem suggests a configuration issue and I have to trace back the beacon preperation to figure out how radio configuration may be going awry. I'm focusing specifically on `rsi_prepare_beacon`. This function is likely a critical point where the beacon frame is assembled before being transmitted, making it the perfect starting point to diagnose any configuration errors. I need to understand how the parameters are set up and how they influence the final beacon content. From there I'll have a better picture of what's happening.



12/2 2026/08/31 19:44 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_hal.c",
  "FirstLine": 425,
  "LineCount": 80
}

Results:
{
  "Contents": " 425:\tint rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\n 426:\t{\n 427:\t\tstruct rsi_hw *adapter = common-\u003epriv;\n 428:\t\tstruct rsi_data_desc *bcn_frm;\n 429:\t\tstruct ieee80211_hw *hw = common-\u003epriv-\u003ehw;\n 430:\t\tstruct ieee80211_conf *conf = \u0026hw-\u003econf;\n 431:\t\tstruct ieee80211_vif *vif;\n 432:\t\tstruct sk_buff *mac_bcn;\n 433:\t\tu8 vap_id = 0, i;\n 434:\t\tunsigned int tailroom;\n 435:\t\tu16 tim_offset = 0;\n 436:\t\n 437:\t\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\n 438:\t\t\tvif = adapter-\u003evifs[i];\n 439:\t\t\tif (!vif)\n 440:\t\t\t\tcontinue;\n 441:\t\t\tif ((vif-\u003etype == NL80211_IFTYPE_AP) ||\n 442:\t\t\t    (vif-\u003etype == NL80211_IFTYPE_P2P_GO))\n 443:\t\t\t\tbreak;\n 444:\t\t}\n 445:\t\tif (!vif)\n 446:\t\t\treturn -EINVAL;\n 447:\t\tmac_bcn = ieee80211_beacon_get_tim(adapter-\u003ehw,\n 448:\t\t\t\t\t\t   vif,\n 449:\t\t\t\t\t\t   \u0026tim_offset, NULL, 0);\n 450:\t\tif (!mac_bcn) {\n 451:\t\t\trsi_dbg(ERR_ZONE, \"Failed to get beacon from mac80211\\n\");\n 452:\t\t\treturn -EINVAL;\n 453:\t\t}\n 454:\t\n 455:\t\tcommon-\u003ebeacon_cnt++;\n 456:\t\tbcn_frm = (struct rsi_data_desc *)skb-\u003edata;\n 457:\t\trsi_set_len_qno(\u0026bcn_frm-\u003elen_qno, mac_bcn-\u003elen, RSI_WIFI_DATA_Q);\n 458:\t\tbcn_frm-\u003eheader_len = MIN_802_11_HDR_LEN;\n 459:\t\tbcn_frm-\u003eframe_info = cpu_to_le16(RSI_DATA_DESC_MAC_BBP_INFO |\n 460:\t\t\t\t\t\t  RSI_DATA_DESC_NO_ACK_IND |\n 461:\t\t\t\t\t\t  RSI_DATA_DESC_BEACON_FRAME |\n 462:\t\t\t\t\t\t  RSI_DATA_DESC_INSERT_TSF |\n 463:\t\t\t\t\t\t  RSI_DATA_DESC_INSERT_SEQ_NO |\n 464:\t\t\t\t\t\t  RATE_INFO_ENABLE);\n 465:\t\tbcn_frm-\u003erate_info = cpu_to_le16(vap_id \u003c\u003c 14);\n 466:\t\tbcn_frm-\u003eqid_tid = BEACON_HW_Q;\n 467:\t\n 468:\t\tif (conf_is_ht40_plus(conf)) {\n 469:\t\t\tbcn_frm-\u003ebbp_info = cpu_to_le16(LOWER_20_ENABLE);\n 470:\t\t\tbcn_frm-\u003ebbp_info |= cpu_to_le16(LOWER_20_ENABLE \u003e\u003e 12);\n 471:\t\t} else if (conf_is_ht40_minus(conf)) {\n 472:\t\t\tbcn_frm-\u003ebbp_info = cpu_to_le16(UPPER_20_ENABLE);\n 473:\t\t\tbcn_frm-\u003ebbp_info |= cpu_to_le16(UPPER_20_ENABLE \u003e\u003e 12);\n 474:\t\t}\n 475:\t\n 476:\t\tif (common-\u003eband == NL80211_BAND_2GHZ)\n 477:\t\t\tbcn_frm-\u003erate_info |= cpu_to_le16(RSI_RATE_1);\n 478:\t\telse\n 479:\t\t\tbcn_frm-\u003erate_info |= cpu_to_le16(RSI_RATE_6);\n 480:\t\n 481:\t\tif (mac_bcn-\u003edata[tim_offset + 2] == 0)\n 482:\t\t\tbcn_frm-\u003eframe_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);\n 483:\t\n 484:\t\ttailroom = skb_tailroom(skb);\n 485:\t\tif (tailroom \u003c FRAME_DESC_SZ ||\n 486:\t\t    mac_bcn-\u003elen \u003e tailroom - FRAME_DESC_SZ) {\n 487:\t\t\tdev_kfree_skb(mac_bcn);\n 488:\t\t\treturn -EMSGSIZE;\n 489:\t\t}\n 490:\t\n 491:\t\tmemcpy(\u0026skb-\u003edata[FRAME_DESC_SZ], mac_bcn-\u003edata, mac_bcn-\u003elen);\n 492:\t\tskb_put(skb, mac_bcn-\u003elen + FRAME_DESC_SZ);\n 493:\t\n 494:\t\tdev_kfree_skb(mac_bcn);\n 495:\t\n 496:\t\treturn 0;\n 497:\t}\n 498:\t\n 499:\tstatic void bl_cmd_timeout(struct timer_list *t)\n 500:\t{\n 501:\t\tstruct rsi_hw *adapter = timer_container_of(adapter, t, bl_cmd_timer);\n 502:\t\n 503:\t\tadapter-\u003eblcmd_timer_expired = true;\n 504:\t\ttimer_delete(\u0026adapter-\u003ebl_cmd_timer);\n"
}

13/2 2026/08/31 19:44 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 21928
							output: 43
							thoughts: 75
						

Thoughts:
**Investigating RSI Bus Type Emulation**

Okay, let's dive into this. My initial thought is to determine the supported bus types for the `rsi` driver. Ah, `RSI_SDIO` and `RSI_USB`, got it. Now, the real question is whether we can effectively emulate or fuzz the `RSI_USB` interface within our QEMU/Syzkaller environment. Can we leverage the USB raw gadget functionality or some form of USB emulation? That's the key to making progress here. My next step will be to examine the `drivers/net/wireless/rsi/rsi_91x_usb.c` source file. It should contain the relevant implementation details for the USB interface. That's where the answers are likely hidden. Time to dig in and see how the driver handles USB communications.



14/2 2026/08/31 19:44 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_usb.c",
  "FirstLine": 1,
  "LineCount": 80
}

Results:
{
  "Contents": "   1:\t/*\n   2:\t * Copyright (c) 2014 Redpine Signals Inc.\n   3:\t *\n   4:\t * Permission to use, copy, modify, and/or distribute this software for any\n   5:\t * purpose with or without fee is hereby granted, provided that the above\n   6:\t * copyright notice and this permission notice appear in all copies.\n   7:\t *\n   8:\t * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n   9:\t * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n  10:\t * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n  11:\t * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n  12:\t * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n  13:\t * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n  14:\t * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n  15:\t *\n  16:\t */\n  17:\t\n  18:\t#include \u003clinux/module.h\u003e\n  19:\t#include \u003clinux/types.h\u003e\n  20:\t#include \u003cnet/rsi_91x.h\u003e\n  21:\t#include \"rsi_usb.h\"\n  22:\t#include \"rsi_hal.h\"\n  23:\t#include \"rsi_coex.h\"\n  24:\t\n  25:\t/* Default operating mode is wlan STA + BT */\n  26:\tstatic u16 dev_oper_mode = DEV_OPMODE_STA_BT_DUAL;\n  27:\tmodule_param(dev_oper_mode, ushort, 0444);\n  28:\tMODULE_PARM_DESC(dev_oper_mode, DEV_OPMODE_PARAM_DESC);\n  29:\t\n  30:\tstatic int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num, gfp_t flags);\n  31:\t\n  32:\t/**\n  33:\t * rsi_usb_card_write() - This function writes to the USB Card.\n  34:\t * @adapter: Pointer to the adapter structure.\n  35:\t * @buf: Pointer to the buffer from where the data has to be taken.\n  36:\t * @len: Length to be written.\n  37:\t * @endpoint: Type of endpoint.\n  38:\t *\n  39:\t * Return: status: 0 on success, a negative error code on failure.\n  40:\t */\n  41:\tstatic int rsi_usb_card_write(struct rsi_hw *adapter,\n  42:\t\t\t\t      u8 *buf,\n  43:\t\t\t\t      u16 len,\n  44:\t\t\t\t      u8 endpoint)\n  45:\t{\n  46:\t\tstruct rsi_91x_usbdev *dev = adapter-\u003ersi_dev;\n  47:\t\tint status;\n  48:\t\tu8 *seg = dev-\u003etx_buffer;\n  49:\t\tint transfer;\n  50:\t\tint ep = dev-\u003ebulkout_endpoint_addr[endpoint - 1];\n  51:\t\n  52:\t\tmemset(seg, 0, len + RSI_USB_TX_HEAD_ROOM);\n  53:\t\tmemcpy(seg + RSI_USB_TX_HEAD_ROOM, buf, len);\n  54:\t\tlen += RSI_USB_TX_HEAD_ROOM;\n  55:\t\ttransfer = len;\n  56:\t\tstatus = usb_bulk_msg(dev-\u003eusbdev,\n  57:\t\t\t\t      usb_sndbulkpipe(dev-\u003eusbdev, ep),\n  58:\t\t\t\t      (void *)seg,\n  59:\t\t\t\t      (int)len,\n  60:\t\t\t\t      \u0026transfer,\n  61:\t\t\t\t      USB_CTRL_SET_TIMEOUT);\n  62:\t\n  63:\t\tif (status \u003c 0) {\n  64:\t\t\trsi_dbg(ERR_ZONE,\n  65:\t\t\t\t\"Card write failed with error code :%10d\\n\", status);\n  66:\t\t\tdev-\u003ewrite_fail = 1;\n  67:\t\t}\n  68:\t\treturn status;\n  69:\t}\n  70:\t\n  71:\t/**\n  72:\t * rsi_write_multiple() - This function writes multiple bytes of information\n  73:\t *\t\t\t  to the USB card.\n  74:\t * @adapter: Pointer to the adapter structure.\n  75:\t * @endpoint: Type of endpoint.\n  76:\t * @data: Pointer to the data that has to be written.\n  77:\t * @count: Number of multiple bytes to be written.\n  78:\t *\n  79:\t * Return: 0 on success, a negative error code on failure.\n  80:\t */\n"
}

15/2 2026/08/31 19:44 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 23449
							output: 45
							thoughts: 15
						

Thoughts:
Here's my take on that, given my expertise:

**Diving into the `rsi_probe` Implementation in USB**

Okay, so I need to refresh my memory on how this `rsi_probe` functionality is implemented within the USB protocol. My immediate thought is, what are the specific use cases driving the need for this probe? Is it about initial device identification, capability negotiation, or perhaps something else entirely? Understanding the *why* is crucial to unpacking the *how*.

I'm mentally sifting through my knowledge of USB device enumeration. I'm assuming it involves the standard USB descriptors – device, configuration, interface, endpoint – and how they are handled during initial setup. I bet `rsi_probe` is intricately linked to how the host interacts with those descriptors to gather relevant information. Perhaps it's a specific vendor-defined command, leveraging a control transfer, to elicit a particular set of device characteristics beyond the standard descriptors? I'll need to look for that.

I'm also considering the layers involved. Is this a protocol-level mechanism, handled by the USB host controller and device firmware? Or does it reside higher up, perhaps in the device driver? I suspect it's a more integrated approach, likely involving both hardware and software interactions. I'll need to pinpoint where the critical handoffs and message exchanges occur.

Ultimately, I expect `rsi_probe` is a clever dance of signaling and data exchange. I need to trace the sequence, starting from the host's request, through any device-side processing, and back to the host with the requested information. Now, let's see where to begin digging.



16/2 2026/08/31 19:45 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_usb.c",
  "FirstLine": 700,
  "LineCount": 80
}

Results:
{
  "Contents": " 700:\t\n 701:\t\tmsleep(20);\n 702:\t\n 703:\t\treturn 0;\n 704:\t}\n 705:\t\n 706:\tstatic int rsi_reset_card(struct rsi_hw *adapter)\n 707:\t{\n 708:\t\tint ret;\n 709:\t\n 710:\t\trsi_dbg(INFO_ZONE, \"Resetting Card...\\n\");\n 711:\t\trsi_usb_master_reg_write(adapter, RSI_TA_HOLD_REG, 0xE, 4);\n 712:\t\n 713:\t\t/* This msleep will ensure Thread-Arch processor to go to hold\n 714:\t\t * and any pending dma transfers to rf in device to finish.\n 715:\t\t */\n 716:\t\tmsleep(100);\n 717:\t\n 718:\t\tret = rsi_usb_master_reg_write(adapter, SWBL_REGOUT,\n 719:\t\t\t\t\t       RSI_FW_WDT_DISABLE_REQ,\n 720:\t\t\t\t\t       RSI_COMMON_REG_SIZE);\n 721:\t\tif (ret \u003c 0) {\n 722:\t\t\trsi_dbg(ERR_ZONE, \"Disabling firmware watchdog timer failed\\n\");\n 723:\t\t\tgoto fail;\n 724:\t\t}\n 725:\t\n 726:\t\tif (adapter-\u003edevice_model != RSI_DEV_9116) {\n 727:\t\t\tret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_TIMER_1,\n 728:\t\t\t\t\t\t RSI_ULP_WRITE_2, 32);\n 729:\t\t\tif (ret \u003c 0)\n 730:\t\t\t\tgoto fail;\n 731:\t\t\tret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_TIMER_2,\n 732:\t\t\t\t\t\t RSI_ULP_WRITE_0, 32);\n 733:\t\t\tif (ret \u003c 0)\n 734:\t\t\t\tgoto fail;\n 735:\t\t\tret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_DELAY_TIMER_1,\n 736:\t\t\t\t\t\t RSI_ULP_WRITE_50, 32);\n 737:\t\t\tif (ret \u003c 0)\n 738:\t\t\t\tgoto fail;\n 739:\t\t\tret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_DELAY_TIMER_2,\n 740:\t\t\t\t\t\t RSI_ULP_WRITE_0, 32);\n 741:\t\t\tif (ret \u003c 0)\n 742:\t\t\t\tgoto fail;\n 743:\t\t\tret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_TIMER_ENABLE,\n 744:\t\t\t\t\t\t RSI_ULP_TIMER_ENABLE, 32);\n 745:\t\t\tif (ret \u003c 0)\n 746:\t\t\t\tgoto fail;\n 747:\t\t} else {\n 748:\t\t\tret = rsi_usb_master_reg_write(adapter,\n 749:\t\t\t\t\t\t       NWP_WWD_INTERRUPT_TIMER,\n 750:\t\t\t\t\t\t       NWP_WWD_INT_TIMER_CLKS,\n 751:\t\t\t\t\t\t       RSI_9116_REG_SIZE);\n 752:\t\t\tif (ret \u003c 0)\n 753:\t\t\t\tgoto fail;\n 754:\t\t\tret = rsi_usb_master_reg_write(adapter,\n 755:\t\t\t\t\t\t       NWP_WWD_SYSTEM_RESET_TIMER,\n 756:\t\t\t\t\t\t       NWP_WWD_SYS_RESET_TIMER_CLKS,\n 757:\t\t\t\t\t\t       RSI_9116_REG_SIZE);\n 758:\t\t\tif (ret \u003c 0)\n 759:\t\t\t\tgoto fail;\n 760:\t\t\tret = rsi_usb_master_reg_write(adapter,\n 761:\t\t\t\t\t\t       NWP_WWD_MODE_AND_RSTART,\n 762:\t\t\t\t\t\t       NWP_WWD_TIMER_DISABLE,\n 763:\t\t\t\t\t\t       RSI_9116_REG_SIZE);\n 764:\t\t\tif (ret \u003c 0)\n 765:\t\t\t\tgoto fail;\n 766:\t\t}\n 767:\t\n 768:\t\trsi_dbg(INFO_ZONE, \"Reset card done\\n\");\n 769:\t\treturn ret;\n 770:\t\n 771:\tfail:\n 772:\t\trsi_dbg(ERR_ZONE, \"Reset card failed\\n\");\n 773:\t\treturn ret;\n 774:\t}\n 775:\t\n 776:\t/**\n 777:\t * rsi_probe() - This function is called by kernel when the driver provided\n 778:\t *\t\t Vendor and device IDs are matched. All the initialization\n 779:\t *\t\t work is done here.\n"
}

17/2 2026/08/31 19:45 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 25138
							output: 46
							thoughts: 555
						

Thoughts:
**Analyzing the Vulnerability in `rsi_prepare_beacon`**

Okay, let's dive into this code. My initial thought is to understand what `rsi_prepare_beacon` does and what's changed with this patch. Looking at the code:

```c
+	tailroom = skb_tailroom(skb);
+	if (tailroom < FRAME_DESC_SZ ||
+	    mac_bcn->len > tailroom - FRAME_DESC_SZ) {
+		dev_kfree_skb(mac_bcn);
+		return -EMSGSIZE;
+	}
+
 	memcpy(&skb->data[FRAME_DESC_SZ], mac_bcn->data, mac_bcn->len);
 	skb_put(skb, mac_bcn->len + FRAME_DESC_SZ);
```

Essentially, this is a buffer preparation for a beacon frame. The crucial part here is the tailroom check. Before the patch, it seems like if the allocated `skb` in `rsi_send_beacon` (or elsewhere) didn't have enough tailroom for the frame descriptor size (`FRAME_DESC_SZ`) plus the beacon data length (`mac_bcn->len`), the `skb_put` call would potentially trigger a `BUG_ON` or the `memcpy` could overflow the `skb->data` buffer.  Also, if the tailroom check fails, `mac_bcn` is freed which is good, and it returns an error.

Now, let's think about exploitability. Is this function, or the related `rsi_91x` driver, reachable and fuzzable?  `rsi_91x` is a mac80211 driver for the Redpine Signals 9113/9116 chips, covering USB and SDIO interfaces.  In a fuzzing context like Syzkaller, a USB device can be emulated using the USB raw gadget (vhci/raw-gadget).

When the RSI USB device is probed, a mac80211 wireless interface is registered via `rsi_mac80211_attach`. This is key. From there, userspace, and by extension Syzkaller, can interact using `nl80211` netlink commands to configure the wireless interface, either as an AP or a P2P_GO.

So, when beaconing is triggered, either through the standard beacon process, beacon configuration, firmware beacon requests, or by the mac80211 stack, or if the firmware sends a beacon request management packet (`RSI_BEACON_REQUEST`), `rsi_mgmt_pkt_recv` will be called, which in turn calls `rsi_send_beacon`, which *finally* calls `rsi_prepare_beacon`. This looks like the attack path.

Next, I need to check `rsi_mgmt_pkt_recv` in `drivers/net/wireless/rsi/rsi_91x_mgmt.c` to better understand the inputs.



18/2 2026/08/31 19:45 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_mgmt.c",
  "FirstLine": 2185,
  "LineCount": 50
}

Results:
{
  "Contents": "2185:\tint rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)\n2186:\t{\n2187:\t\ts32 msg_len = (le16_to_cpu(*(__le16 *)\u0026msg[0]) \u0026 0x0fff);\n2188:\t\tu16 msg_type = (msg[2]);\n2189:\t\n2190:\t\trsi_dbg(FSM_ZONE, \"%s: Msg Len: %d, Msg Type: %4x\\n\",\n2191:\t\t\t__func__, msg_len, msg_type);\n2192:\t\n2193:\t\tswitch (msg_type) {\n2194:\t\tcase TA_CONFIRM_TYPE:\n2195:\t\t\treturn rsi_handle_ta_confirm_type(common, msg);\n2196:\t\tcase CARD_READY_IND:\n2197:\t\t\tcommon-\u003ehibernate_resume = false;\n2198:\t\t\trsi_dbg(FSM_ZONE, \"%s: Card ready indication received\\n\",\n2199:\t\t\t\t__func__);\n2200:\t\t\treturn rsi_handle_card_ready(common, msg);\n2201:\t\tcase TX_STATUS_IND:\n2202:\t\t\tswitch (msg[RSI_TX_STATUS_TYPE]) {\n2203:\t\t\tcase PROBEREQ_CONFIRM:\n2204:\t\t\t\tcommon-\u003emgmt_q_block = false;\n2205:\t\t\t\trsi_dbg(FSM_ZONE, \"%s: Probe confirm received\\n\",\n2206:\t\t\t\t\t__func__);\n2207:\t\t\t\tbreak;\n2208:\t\t\tcase EAPOL4_CONFIRM:\n2209:\t\t\t\tif (msg[RSI_TX_STATUS]) {\n2210:\t\t\t\t\tcommon-\u003eeapol4_confirm = true;\n2211:\t\t\t\t\tif (!rsi_send_block_unblock_frame(common,\n2212:\t\t\t\t\t\t\t\t\t  false))\n2213:\t\t\t\t\t\tcommon-\u003ehw_data_qs_blocked = false;\n2214:\t\t\t\t}\n2215:\t\t\t}\n2216:\t\t\tbreak;\n2217:\t\tcase BEACON_EVENT_IND:\n2218:\t\t\trsi_dbg(INFO_ZONE, \"Beacon event\\n\");\n2219:\t\t\tif (common-\u003efsm_state != FSM_MAC_INIT_DONE)\n2220:\t\t\t\treturn -1;\n2221:\t\t\tif (common-\u003eiface_down)\n2222:\t\t\t\treturn -1;\n2223:\t\t\tif (!common-\u003ebeacon_enabled)\n2224:\t\t\t\treturn -1;\n2225:\t\t\trsi_send_beacon(common);\n2226:\t\t\tbreak;\n2227:\t\tcase WOWLAN_WAKEUP_REASON:\n2228:\t\t\trsi_dbg(ERR_ZONE, \"\\n\\nWakeup Type: %x\\n\", msg[15]);\n2229:\t\t\tswitch (msg[15]) {\n2230:\t\t\tcase RSI_UNICAST_MAGIC_PKT:\n2231:\t\t\t\trsi_dbg(ERR_ZONE,\n2232:\t\t\t\t\t\"*** Wakeup for Unicast magic packet ***\\n\");\n2233:\t\t\t\tbreak;\n2234:\t\t\tcase RSI_BROADCAST_MAGICPKT:\n"
}

19/2 2026/08/31 19:45 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 27248
							output: 36
							thoughts: 45
						

Thoughts:
**Checking Kconfig Dependencies**

Okay, time to make sure everything's shipshape. My immediate concern is the dependency situation for `rsi_91x_hal.c` and specifically `rsi_prepare_beacon`. Gotta make sure the Kconfig setup is correct; it's the gatekeeper for these things. Let's start by digging into `drivers/net/wireless/rsi/Kconfig`. This is where the configuration options that govern their inclusion should reside. Need to verify that the configurations are correctly defined in Kconfig, and the necessary dependencies are taken care of, so the compiler knows what to do.



20/2 2026/08/31 19:45 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/Kconfig",
  "FirstLine": 1,
  "LineCount": 55
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\tconfig WLAN_VENDOR_RSI\n   3:\t\tbool \"Redpine Signals Inc devices\"\n   4:\t\tdefault y\n   5:\t\thelp\n   6:\t\t  If you have a wireless card belonging to this class, say Y.\n   7:\t\n   8:\t\t  Note that the answer to this question doesn't directly affect the\n   9:\t\t  kernel: saying N will just cause the configurator to skip all the\n  10:\t\t  questions about these cards. If you say Y, you will be asked for\n  11:\t\t  your specific card in the following questions.\n  12:\t\n  13:\tif WLAN_VENDOR_RSI\n  14:\t\n  15:\tconfig RSI_91X\n  16:\t\ttristate \"Redpine Signals Inc 91x WLAN driver support\"\n  17:\t\tselect BT_HCIRSI if RSI_COEX\n  18:\t\tdepends on MAC80211\n  19:\t\thelp\n  20:\t\t  This option enabes support for RSI 1x1 devices.\n  21:\t\t  Select M (recommended), if you have a RSI 1x1 wireless module.\n  22:\t\n  23:\tconfig RSI_DEBUGFS\n  24:\t\tbool \"Redpine Signals Inc debug support\"\n  25:\t\tdepends on RSI_91X\n  26:\t\tdefault y\n  27:\t\thelp\n  28:\t\t Say Y, if you would like to enable debug support. This option\n  29:\t\t creates debugfs entries\n  30:\t\n  31:\tconfig RSI_SDIO\n  32:\t\ttristate \"Redpine Signals SDIO bus support\"\n  33:\t\tdepends on MMC \u0026\u0026 RSI_91X\n  34:\t\tdefault m\n  35:\t\thelp\n  36:\t\t  This option enables the SDIO bus support in rsi drivers.\n  37:\t\t  Select M (recommended), if you have a RSI 1x1 wireless module.\n  38:\t\n  39:\tconfig RSI_USB\n  40:\t\ttristate \"Redpine Signals USB bus support\"\n  41:\t\tdepends on USB \u0026\u0026 RSI_91X\n  42:\t\tdefault m\n  43:\t\thelp\n  44:\t\t  This option enables the USB bus support in rsi drivers.\n  45:\t\t  Select M (recommended), if you have a RSI 1x1 wireless module.\n  46:\t\n  47:\tconfig RSI_COEX\n  48:\t\tbool \"Redpine Signals WLAN BT Coexistence support\"\n  49:\t\tdepends on BT \u0026\u0026 RSI_91X\n  50:\t\tdepends on !(BT=m \u0026\u0026 RSI_91X=y)\n  51:\t\tdefault y\n  52:\t\thelp\n  53:\t\t  This option enables the WLAN BT coex support in rsi drivers.\n  54:\t\t  Select M (recommended), if you have want to use this feature\n  55:\t\t  and you have RS9113 module.\n"
}

21/2 2026/08/31 19:45 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 28218
							output: 35
							thoughts: 15
						

Thoughts:
Here's my take on the thought process, as if I were the one thinking it:

**Diving into the RSI Wireless Driver Makefile**

Okay, time to get my hands dirty. Let's see what's going on with the RSI wireless driver build process. My instinct is telling me to start with the `drivers/net/wireless/rsi/Makefile`. This is generally where the core compilation rules, dependencies, and ultimately the object files for this driver are defined. I expect to find things like source file lists, include paths, conditional compilation flags based on the kernel configuration, and probably some platform-specific adaptations. I’m hoping to understand how they've organized the driver's build and if there are any obvious areas where customization or potential problems might lie. Let's see if this Makefile provides some clarity.



22/2 2026/08/31 19:45 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/Makefile",
  "FirstLine": 1,
  "LineCount": 25
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0\n   2:\trsi_91x-y\t\t\t+= rsi_91x_main.o\n   3:\trsi_91x-y\t\t\t+= rsi_91x_core.o\n   4:\trsi_91x-y\t\t\t+= rsi_91x_mac80211.o\n   5:\trsi_91x-y\t\t\t+= rsi_91x_mgmt.o\n   6:\trsi_91x-y\t\t\t+= rsi_91x_hal.o\n   7:\trsi_91x-y\t\t\t+= rsi_91x_ps.o\n   8:\trsi_91x-$(CONFIG_RSI_COEX)\t+= rsi_91x_coex.o\n   9:\trsi_91x-$(CONFIG_RSI_DEBUGFS)\t+= rsi_91x_debugfs.o\n  10:\t\n  11:\trsi_usb-y\t\t\t+= rsi_91x_usb.o rsi_91x_usb_ops.o\n  12:\trsi_sdio-y\t\t\t+= rsi_91x_sdio.o rsi_91x_sdio_ops.o\n  13:\tobj-$(CONFIG_RSI_91X) \t\t+= rsi_91x.o\n  14:\tobj-$(CONFIG_RSI_SDIO)\t\t+= rsi_sdio.o\n  15:\tobj-$(CONFIG_RSI_USB)\t\t+= rsi_usb.o\n"
}

23/2 2026/08/31 19:45 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 28842
							output: 21
							thoughts: 32
						

Thoughts:
**Investigating the WLAN_VENDOR_RSI Kconfig Configuration**

Okay, let's dive in. I need to figure out where the `WLAN_VENDOR_RSI` configuration option is defined or, at the very least, included. This means I need to trace its origin within the Kconfig hierarchy. I'll start by checking the parent Kconfig files. This is a common debugging step when navigating the complexities of the build system. I need to understand the dependencies and relationships of this particular option to grasp its role and implications within the larger configuration space. Hopefully, this should quickly lead me to the relevant sections and uncover the specifics of its definition or inclusion. Let's see what we can find.



24/2 2026/08/31 19:45 tool grepper
0m Args:
{
  "Expression": "WLAN_VENDOR_RSI"
}

Results:
{
  "Output": "arch/mips/configs/ath25_defconfig=53=CONFIG_ATH5K=m\n--\narch/mips/configs/ath25_defconfig-62-# CONFIG_WLAN_VENDOR_REALTEK is not set\narch/mips/configs/ath25_defconfig:63:# CONFIG_WLAN_VENDOR_RSI is not set\narch/mips/configs/ath25_defconfig-64-# CONFIG_WLAN_VENDOR_ST is not set\n--\narch/mips/configs/ci20_defconfig=78=CONFIG_BRCMFMAC=m\n--\narch/mips/configs/ci20_defconfig-87-# CONFIG_WLAN_VENDOR_REALTEK is not set\narch/mips/configs/ci20_defconfig:88:# CONFIG_WLAN_VENDOR_RSI is not set\narch/mips/configs/ci20_defconfig-89-# CONFIG_WLAN_VENDOR_SILABS is not set\n--\narch/mips/configs/gcw0_defconfig=38=CONFIG_RTL8192CU=m\narch/mips/configs/gcw0_defconfig-39-# CONFIG_RTLWIFI_DEBUG is not set\narch/mips/configs/gcw0_defconfig:40:# CONFIG_WLAN_VENDOR_RSI is not set\narch/mips/configs/gcw0_defconfig-41-# CONFIG_WLAN_VENDOR_ST is not set\n--\ndrivers/net/wireless/Makefile=18=obj-$(CONFIG_WLAN_VENDOR_REALTEK) += realtek/\ndrivers/net/wireless/Makefile:19:obj-$(CONFIG_WLAN_VENDOR_RSI) += rsi/\ndrivers/net/wireless/Makefile-20-obj-$(CONFIG_WLAN_VENDOR_SILABS) += silabs/\n--\ndrivers/net/wireless/rsi/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/net/wireless/rsi/Kconfig:2:config WLAN_VENDOR_RSI\ndrivers/net/wireless/rsi/Kconfig-3-\tbool \"Redpine Signals Inc devices\"\n--\ndrivers/net/wireless/rsi/Kconfig-12-\ndrivers/net/wireless/rsi/Kconfig:13:if WLAN_VENDOR_RSI\ndrivers/net/wireless/rsi/Kconfig-14-\n--\ndrivers/net/wireless/rsi/Kconfig=47=config RSI_COEX\n--\ndrivers/net/wireless/rsi/Kconfig-56-\ndrivers/net/wireless/rsi/Kconfig:57:endif # WLAN_VENDOR_RSI\n"
}

25/2 2026/08/31 19:45 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 29691
							output: 18
							thoughts: 14
						

Thoughts:
Here's my take on the thought process, as if I were the one thinking it:

**Diving into the Wireless Kconfig**

Alright, time to get to the heart of the matter. I need to understand the configuration options for wireless networking. The first place I'm going to look is `drivers/net/wireless/Kconfig`. This Kconfig file will be the central point for defining the build-time configuration options for all the wireless drivers. I'm expecting to find the standard structure here: top-level choices, dependencies based on hardware or functionality, and help text that describes what each option actually does. This file is going to tell me what variables I can tweak to get the wireless stack behaving as I need it to. Let's see what gems are buried in there.



26/2 2026/08/31 19:45 tool grepper
0m Args:
{
  "Expression": "rsi/Kconfig"
}

Results:
{
  "Output": "drivers/net/wireless/Kconfig=32=source \"drivers/net/wireless/realtek/Kconfig\"\ndrivers/net/wireless/Kconfig:33:source \"drivers/net/wireless/rsi/Kconfig\"\ndrivers/net/wireless/Kconfig-34-source \"drivers/net/wireless/silabs/Kconfig\"\n"
}

27/2 2026/08/31 19:45 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 29981
							output: 144
							thoughts: 644
						

Thoughts:
**Fuzzing Verdict: RSI Wireless Driver Beacon Preparation**

Okay, let's break this down for fuzzing purposes. First, I need to confirm the relevant configurations. Based on the file context and changes, it looks like `WLAN_VENDOR_RSI`, `RSI_91X`, `MAC80211`, and `RSI_USB` are the key configs here. I confirmed that `rsi_prepare_beacon` is a non-static function, declared in `rsi_hal.h` and defined in `rsi_91x_hal.c`. The fact that it's non-static makes it a viable entry point. I also looked at `rsi_send_beacon`, which *is* static, so that's less interesting from a fuzzing perspective. `rsi_mgmt_pkt_recv` is another non-static function that might be relevant.

After reviewing the specific functions modified, only `rsi_prepare_beacon` was modified.

Based on the instructions, the `FocusSymbols` are clearly `rsi_prepare_beacon` and `rsi_mgmt_pkt_recv`. I know `RSI_91X` and `RSI_USB` are tristate, and `WLAN_VENDOR_RSI` is a boolean and defaults to 'y'.

So, is this worth fuzzing? Absolutely. The fix addresses a potential buffer overflow vulnerability in `rsi_prepare_beacon`, which is definitely a functional impact. And given it's reachable via `mac80211` and the RSI wireless USB driver emulation, it's something that can be targeted in a standard fuzzing environment. The non-static nature of these functions means they're accessible entrypoints. It all checks out. This is a solid candidate for fuzzing.



28/2 2026/08/31 19:45 tool set-results
0m Args:
{
  "EnableConfigs": [
    "WLAN_VENDOR_RSI",
    "RSI_91X",
    "RSI_USB",
    "MAC80211"
  ],
  "FocusSymbols": [
    "rsi_prepare_beacon",
    "rsi_mgmt_pkt_recv"
  ],
  "Reasoning": "The patch adds missing tailroom bounds checks in rsi_prepare_beacon() before copying beacon data, preventing a potential buffer overflow or crash. The RSI 91x wireless driver is reachable via USB emulation (RSI_USB) and mac80211 in virtualized fuzzing setups.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "WLAN_VENDOR_RSI",
    "RSI_91X",
    "RSI_USB",
    "MAC80211"
  ],
  "FocusSymbols": [
    "rsi_prepare_beacon",
    "rsi_mgmt_pkt_recv"
  ],
  "Reasoning": "The patch adds missing tailroom bounds checks in rsi_prepare_beacon() before copying beacon data, preventing a potential buffer overflow or crash. The RSI 91x wireless driver is reachable via USB emulation (RSI_USB) and mac80211 in virtualized fuzzing setups.",
  "WorthFuzzing": true
}

29/1 2026/08/31 19:45 action If
0m Args:
{
  "WorthFuzzing": true
}

Results:
null

30/2 2026/08/31 19:45 agent kmsan-evaluator
0m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch adds a bounds check (`skb_tailroom(skb)`) in `rsi_prepare_beacon()` to prevent buffer overflow (out-of-bounds write) when copying beacon data (`mac_bcn-\u003edata`) into the target `skb`. \n\nThis is a classic out-of-bounds prevention fix. Out-of-bounds accesses and buffer overflows are tracked and detected by KASAN (and skb assertions). The patch does not introduce any uninitialized memory reads, uninitialized struct fields, info-leaks to user space, or branching on uninitialized data. Consequently, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit dd9d1b79298701c4a6b75f9761a6d63e9b7f4260
Author: syz-cluster <triage@syzkaller.com>
Date:   Mon Aug 31 19:43:14 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 7d26314a3e76a..50f77f3eee92c 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -431,6 +431,7 @@ int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)
 	struct ieee80211_vif *vif;
 	struct sk_buff *mac_bcn;
 	u8 vap_id = 0, i;
+	unsigned int tailroom;
 	u16 tim_offset = 0;
 
 	for (i = 0; i < RSI_MAX_VIFS; i++) {
@@ -480,6 +481,13 @@ int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)
 	if (mac_bcn->data[tim_offset + 2] == 0)
 		bcn_frm->frame_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);
 
+	tailroom = skb_tailroom(skb);
+	if (tailroom < FRAME_DESC_SZ ||
+	    mac_bcn->len > tailroom - FRAME_DESC_SZ) {
+		dev_kfree_skb(mac_bcn);
+		return -EMSGSIZE;
+	}
+
 	memcpy(&skb->data[FRAME_DESC_SZ], mac_bcn->data, mac_bcn->len);
 	skb_put(skb, mac_bcn->len + FRAME_DESC_SZ);
 

31/3 2026/08/31 19:45 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 2352
							output: 45
							thoughts: 68
						

Thoughts:
Here's my summary, as if I were thinking these things:

**Analyzing the RSI Wireless HAL**

Okay, time to dive into this. First, I need to understand the changes. Let's start by scrutinizing the diff and surrounding code in `drivers/net/wireless/rsi/rsi_91x_hal.c`. That should give me a good handle on what's been altered and why. Now, I suspect the core of this beacon handling might be in `rsi_prepare_beacon`, so I'll use `read-file` to get the source of that function. Seeing the specific implementation is going to give me the information I'm looking for.



32/3 2026/08/31 19:46 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_hal.c",
  "FirstLine": 425,
  "LineCount": 80
}

Results:
{
  "Contents": " 425:\tint rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\n 426:\t{\n 427:\t\tstruct rsi_hw *adapter = common-\u003epriv;\n 428:\t\tstruct rsi_data_desc *bcn_frm;\n 429:\t\tstruct ieee80211_hw *hw = common-\u003epriv-\u003ehw;\n 430:\t\tstruct ieee80211_conf *conf = \u0026hw-\u003econf;\n 431:\t\tstruct ieee80211_vif *vif;\n 432:\t\tstruct sk_buff *mac_bcn;\n 433:\t\tu8 vap_id = 0, i;\n 434:\t\tunsigned int tailroom;\n 435:\t\tu16 tim_offset = 0;\n 436:\t\n 437:\t\tfor (i = 0; i \u003c RSI_MAX_VIFS; i++) {\n 438:\t\t\tvif = adapter-\u003evifs[i];\n 439:\t\t\tif (!vif)\n 440:\t\t\t\tcontinue;\n 441:\t\t\tif ((vif-\u003etype == NL80211_IFTYPE_AP) ||\n 442:\t\t\t    (vif-\u003etype == NL80211_IFTYPE_P2P_GO))\n 443:\t\t\t\tbreak;\n 444:\t\t}\n 445:\t\tif (!vif)\n 446:\t\t\treturn -EINVAL;\n 447:\t\tmac_bcn = ieee80211_beacon_get_tim(adapter-\u003ehw,\n 448:\t\t\t\t\t\t   vif,\n 449:\t\t\t\t\t\t   \u0026tim_offset, NULL, 0);\n 450:\t\tif (!mac_bcn) {\n 451:\t\t\trsi_dbg(ERR_ZONE, \"Failed to get beacon from mac80211\\n\");\n 452:\t\t\treturn -EINVAL;\n 453:\t\t}\n 454:\t\n 455:\t\tcommon-\u003ebeacon_cnt++;\n 456:\t\tbcn_frm = (struct rsi_data_desc *)skb-\u003edata;\n 457:\t\trsi_set_len_qno(\u0026bcn_frm-\u003elen_qno, mac_bcn-\u003elen, RSI_WIFI_DATA_Q);\n 458:\t\tbcn_frm-\u003eheader_len = MIN_802_11_HDR_LEN;\n 459:\t\tbcn_frm-\u003eframe_info = cpu_to_le16(RSI_DATA_DESC_MAC_BBP_INFO |\n 460:\t\t\t\t\t\t  RSI_DATA_DESC_NO_ACK_IND |\n 461:\t\t\t\t\t\t  RSI_DATA_DESC_BEACON_FRAME |\n 462:\t\t\t\t\t\t  RSI_DATA_DESC_INSERT_TSF |\n 463:\t\t\t\t\t\t  RSI_DATA_DESC_INSERT_SEQ_NO |\n 464:\t\t\t\t\t\t  RATE_INFO_ENABLE);\n 465:\t\tbcn_frm-\u003erate_info = cpu_to_le16(vap_id \u003c\u003c 14);\n 466:\t\tbcn_frm-\u003eqid_tid = BEACON_HW_Q;\n 467:\t\n 468:\t\tif (conf_is_ht40_plus(conf)) {\n 469:\t\t\tbcn_frm-\u003ebbp_info = cpu_to_le16(LOWER_20_ENABLE);\n 470:\t\t\tbcn_frm-\u003ebbp_info |= cpu_to_le16(LOWER_20_ENABLE \u003e\u003e 12);\n 471:\t\t} else if (conf_is_ht40_minus(conf)) {\n 472:\t\t\tbcn_frm-\u003ebbp_info = cpu_to_le16(UPPER_20_ENABLE);\n 473:\t\t\tbcn_frm-\u003ebbp_info |= cpu_to_le16(UPPER_20_ENABLE \u003e\u003e 12);\n 474:\t\t}\n 475:\t\n 476:\t\tif (common-\u003eband == NL80211_BAND_2GHZ)\n 477:\t\t\tbcn_frm-\u003erate_info |= cpu_to_le16(RSI_RATE_1);\n 478:\t\telse\n 479:\t\t\tbcn_frm-\u003erate_info |= cpu_to_le16(RSI_RATE_6);\n 480:\t\n 481:\t\tif (mac_bcn-\u003edata[tim_offset + 2] == 0)\n 482:\t\t\tbcn_frm-\u003eframe_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);\n 483:\t\n 484:\t\ttailroom = skb_tailroom(skb);\n 485:\t\tif (tailroom \u003c FRAME_DESC_SZ ||\n 486:\t\t    mac_bcn-\u003elen \u003e tailroom - FRAME_DESC_SZ) {\n 487:\t\t\tdev_kfree_skb(mac_bcn);\n 488:\t\t\treturn -EMSGSIZE;\n 489:\t\t}\n 490:\t\n 491:\t\tmemcpy(\u0026skb-\u003edata[FRAME_DESC_SZ], mac_bcn-\u003edata, mac_bcn-\u003elen);\n 492:\t\tskb_put(skb, mac_bcn-\u003elen + FRAME_DESC_SZ);\n 493:\t\n 494:\t\tdev_kfree_skb(mac_bcn);\n 495:\t\n 496:\t\treturn 0;\n 497:\t}\n 498:\t\n 499:\tstatic void bl_cmd_timeout(struct timer_list *t)\n 500:\t{\n 501:\t\tstruct rsi_hw *adapter = timer_container_of(adapter, t, bl_cmd_timer);\n 502:\t\n 503:\t\tadapter-\u003eblcmd_timer_expired = true;\n 504:\t\ttimer_delete(\u0026adapter-\u003ebl_cmd_timer);\n"
}

33/3 2026/08/31 19:46 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 4155
							output: 19
							thoughts: 16
						

Thoughts:
Here's my take on those thoughts, tailored for an expert audience:

**Tracing the Beacon's Call Sites**

Okay, so I'm digging into `rsi_prepare_beacon`. My immediate thought is to understand its context. I need to figure out *how* and *why* this beacon preparation function is being triggered. Where's the calling code? What are the potential entry points?

I'm thinking about the control flow. Is this part of an interrupt handler, a scheduled task, or something triggered by an external event? The context will shape how I interpret its purpose and potential side effects. The specific call sites will give me clues about the data it's operating on and the overall system state when the beacon is being set up. I need to trace this quickly. Let's see what the IDE or source code navigation tools can offer. I'm assuming there's some sort of beaconing mechanism in play here, and I need to figure out exactly how this function fits into the bigger picture.



34/3 2026/08/31 19:46 tool grepper
0m Args:
{
  "Expression": "rsi_prepare_beacon"
}

Results:
{
  "Output": "drivers/net/wireless/rsi/rsi_91x_hal.c=388=int rsi_send_bt_pkt(struct rsi_common *common, struct sk_buff *skb)\n--\ndrivers/net/wireless/rsi/rsi_91x_hal.c-424-\ndrivers/net/wireless/rsi/rsi_91x_hal.c:425:int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb)\ndrivers/net/wireless/rsi/rsi_91x_hal.c-426-{\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c=1763=static int rsi_send_beacon(struct rsi_common *common)\n--\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-1776-\t\tskb_pull(skb, (64 - dword_align_bytes));\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c:1777:\tif (rsi_prepare_beacon(common, skb)) {\ndrivers/net/wireless/rsi/rsi_91x_mgmt.c-1778-\t\trsi_dbg(ERR_ZONE, \"Failed to prepare beacon\\n\");\n--\ndrivers/net/wireless/rsi/rsi_hal.h=225=int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb);\ndrivers/net/wireless/rsi/rsi_hal.h:226:int rsi_prepare_beacon(struct rsi_common *common, struct sk_buff *skb);\ndrivers/net/wireless/rsi/rsi_hal.h-227-int rsi_send_pkt_to_bus(struct rsi_common *common, struct sk_buff *skb);\n"
}

35/3 2026/08/31 19:46 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 4865
							output: 46
							thoughts: 31
						

Thoughts:
Here's my summary, as though I'm thinking through this process:

**Diving into the rsi_send_beacon Function**

Okay, time to get my hands dirty. I need to take a look at the `rsi_send_beacon` function. Specifically, I should find it within the `drivers/net/wireless/rsi/rsi_91x_mgmt.c` file. This is where I'd expect to find the beacon transmission logic for the RSI 91x wireless chipset. I want to understand exactly how the driver handles beacon frames. I'll be looking for details like how the frame is constructed, any hardware-specific register interactions, and the overall flow of the beacon sending process. I’ll be paying close attention to any nuances of this function and how it interfaces with the lower layers of the driver and, ultimately, the hardware itself. Let's see what we can learn.



36/3 2026/08/31 19:46 tool read-file
0m Args:
{
  "File": "drivers/net/wireless/rsi/rsi_91x_mgmt.c",
  "FirstLine": 1760,
  "LineCount": 40
}

Results:
{
  "Contents": "1760:\t\treturn rsi_send_internal_mgmt_frame(common, skb);\n1761:\t}\n1762:\t\n1763:\tstatic int rsi_send_beacon(struct rsi_common *common)\n1764:\t{\n1765:\t\tstruct sk_buff *skb = NULL;\n1766:\t\tu8 dword_align_bytes = 0;\n1767:\t\n1768:\t\tskb = dev_alloc_skb(MAX_MGMT_PKT_SIZE);\n1769:\t\tif (!skb)\n1770:\t\t\treturn -ENOMEM;\n1771:\t\n1772:\t\tmemset(skb-\u003edata, 0, MAX_MGMT_PKT_SIZE);\n1773:\t\n1774:\t\tdword_align_bytes = ((unsigned long)skb-\u003edata \u0026 0x3f);\n1775:\t\tif (dword_align_bytes)\n1776:\t\t\tskb_pull(skb, (64 - dword_align_bytes));\n1777:\t\tif (rsi_prepare_beacon(common, skb)) {\n1778:\t\t\trsi_dbg(ERR_ZONE, \"Failed to prepare beacon\\n\");\n1779:\t\t\tdev_kfree_skb(skb);\n1780:\t\t\treturn -EINVAL;\n1781:\t\t}\n1782:\t\tskb_queue_tail(\u0026common-\u003etx_queue[MGMT_BEACON_Q], skb);\n1783:\t\trsi_set_event(\u0026common-\u003etx_thread.event);\n1784:\t\trsi_dbg(DATA_TX_ZONE, \"%s: Added to beacon queue\\n\", __func__);\n1785:\t\n1786:\t\treturn 0;\n1787:\t}\n1788:\t\n1789:\t#ifdef CONFIG_PM\n1790:\tint rsi_send_wowlan_request(struct rsi_common *common, u16 flags,\n1791:\t\t\t\t    u16 sleep_status)\n1792:\t{\n1793:\t\tstruct rsi_wowlan_req *cmd_frame;\n1794:\t\tstruct sk_buff *skb;\n1795:\t\tu8 length;\n1796:\t\n1797:\t\trsi_dbg(ERR_ZONE, \"%s: Sending wowlan request frame\\n\", __func__);\n1798:\t\n1799:\t\tlength = sizeof(*cmd_frame);\n"
}

37/3 2026/08/31 19:46 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 5789
							output: 163
							thoughts: 798
						

Thoughts:
**Analysis of the Beacon Preparation Patch**

Okay, let's break this down. The original code in `rsi_prepare_beacon` was vulnerable: it used `memcpy` and `skb_put` without verifying the `skb` had enough space for the beacon data (`mac_bcn->len`). This, of course, presented a clear buffer overflow risk—an out-of-bounds write.

The patch smartly adds a bounds check: it verifies `skb_tailroom(skb)` is sufficient before proceeding. If there's not enough room, the beacon buffer is freed and an error is returned. That's good defensive programming. In `rsi_send_beacon`, the `skb` itself is already allocated and zeroed, so that's a solid foundation.

Now, the crucial question: does this change expose any uninitialized memory reads, information leaks, or anything KMSAN would be specifically useful for? I don't see it. The primary change is a *restriction* on access, not an introduction of new risks.

Let's run through the KMSAN criteria methodically:

1.  **Kernel structures sent to user space:** Nope. No `copy_to_user`, `put_user`, netlink shenanigans, ioctls, or socket options are touched.
2.  **Conditional logic on uninitialized data:** Nope. The check depends on `skb_tailroom`, a known valid value.
3.  **Complex data structure initialization with potential uninitialized fields:** Nope. The buffer is memset to zero *before* any of this happens.
4.  **Bounds checks that *allow* uninitialized byte access:** Nope. This check *prevents* it. We're explicitly preventing out-of-bounds reads. The initial zeroing makes this bullet-proof.

So, the change *prevents* out-of-bounds memory accesses. KASAN is the relevant sanitizer. The patch doesn't introduce any new risks that KMSAN is designed to catch. This is a KASAN case.

All checks are done. I'm ready to proceed with setting the results: `NeedsKMSAN=false`.



38/3 2026/08/31 19:46 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch adds a bounds check (`skb_tailroom(skb)`) in `rsi_prepare_beacon()` to prevent buffer overflow (out-of-bounds write) when copying beacon data (`mac_bcn-\u003edata`) into the target `skb`. \n\nThis is a classic out-of-bounds prevention fix. Out-of-bounds accesses and buffer overflows are tracked and detected by KASAN (and skb assertions). The patch does not introduce any uninitialized memory reads, uninitialized struct fields, info-leaks to user space, or branching on uninitialized data. Consequently, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch adds a bounds check (`skb_tailroom(skb)`) in `rsi_prepare_beacon()` to prevent buffer overflow (out-of-bounds write) when copying beacon data (`mac_bcn-\u003edata`) into the target `skb`. \n\nThis is a classic out-of-bounds prevention fix. Out-of-bounds accesses and buffer overflows are tracked and detected by KASAN (and skb assertions). The patch does not introduce any uninitialized memory reads, uninitialized struct fields, info-leaks to user space, or branching on uninitialized data. Consequently, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)