-: ------------ > 1: bd85cab0820e wifi: nl80211: vendor-cmd: add NXP vendor command definitions 1: 8c1582d6688a ! 2: 792480fef7c7 wifi: nxpwifi: add TX power limit host command support @@ Metadata Author: Jeff Chen   ## Commit message ## - wifi: nxpwifi: add TX power limit host command support + wifi: nxpwifi: add firmware TRPC command support  Add support for the firmware channel TRPC configuration command used to retrieve and update TX power limit data.  + Assisted-by: LLM Signed-off-by: Jeff Chen   ## drivers/net/wireless/nxp/nxpwifi/cfg.h ## @@ drivers/net/wireless/nxp/nxpwifi/cfg.h: struct nxpwifi_ds_coalesce_cfg { struct nxpwifi_coalesce_rule rule[NXPWIFI_COALESCE_MAX_RULES]; };  -+/* Host-side helper for the channel TRPC (TX power limit) command. -+ * This is not a firmware wire structure; @len counts the bytes from -+ * @action onwards (action + subband + tlvbuffer). -+ */ ++/* Host-side helper for the channel TRPC command. */  +struct nxpwifi_ds_chan_trpc_cfg {  + u32 len;  + u16 action; @@ drivers/net/wireless/nxp/nxpwifi/fw.h: struct host_cmd_twt_cfg { } __packed;   +struct host_cmd_chan_trpc_cfg { -+ u16 action; -+ u16 subband; ++ __le16 action; ++ __le16 subband;  + u8 tlvbuffer[];  +} __packed;  + @@ drivers/net/wireless/nxp/nxpwifi/sta_cmd.c: nxpwifi_ret_sta_twt_cfg(struct nxpwi  + u32 hdr_len = sizeof(chan_trpc_cfg->action) +  + sizeof(chan_trpc_cfg->subband);  + -+ /* usr_chan_trpc_cfg->len covers action + subband + the TLV table. -+ * Reject a length that cannot hold the fixed fields or that would -+ * grow the command past the TLV buffer bound, so an untrusted @len -+ * can neither underflow the TLV size nor overflow the command body. ++ /* usr_chan_trpc_cfg->len covers action, subband, and TRPC data. ++ * Reject lengths outside the supported command payload range.  + */  + if (usr_chan_trpc_cfg->len < hdr_len ||  + usr_chan_trpc_cfg->len > hdr_len + NXPWIFI_MAX_TRPC_BUF) @@ drivers/net/wireless/nxp/nxpwifi/sta_cmd.c: nxpwifi_ret_sta_twt_cfg(struct nxpwi  + cmd->command = cpu_to_le16(cmd_no);  + cmd->size = cpu_to_le16(S_DS_GEN + usr_chan_trpc_cfg->len);  + -+ /* Copy action + subband + the TLV table verbatim into the firmware -+ * command body. -+ */  + memcpy(chan_trpc_cfg, &usr_chan_trpc_cfg->action,  + usr_chan_trpc_cfg->len);  + @@ drivers/net/wireless/nxp/nxpwifi/sta_cmd.c: nxpwifi_ret_sta_twt_cfg(struct nxpwi  + return -EINVAL;  +  + resp_len = resp_size - S_DS_GEN; -+ /* The firmware response carries action + subband followed by -+ * the TLV table. Reject a response that is too short to hold -+ * those fields or larger than the caller's TLV buffer. ++ /* The firmware response contains action, subband, and TRPC ++ * data. Validate that the payload length is within bounds.  + */  + if (resp_len < sizeof(chan_trpc_cfg->action) +  + sizeof(chan_trpc_cfg->subband) || @@ drivers/net/wireless/nxp/nxpwifi/sta_cmd.c: nxpwifi_ret_sta_twt_cfg(struct nxpwi  + return -EINVAL;  + }  + -+ /* Copy action + subband + the TLV table back to the caller. */  + usr_chan_trpc_cfg->len = resp_len;  + memcpy(&usr_chan_trpc_cfg->action, chan_trpc_cfg, resp_len);  + } 2: d810850b5bd3 < -: ------------ wifi: nxpwifi: add netlink vendor command for TX power limits -: ------------ > 3: 2839ca529dbb wifi: nxpwifi: add netlink vendor command for TX power limits