[PATCH] ath11k: enable power save in station mode

Kalle Valo kvalo at codeaurora.org
Thu Oct 28 05:19:30 PDT 2021


mpubbise at codeaurora.org writes:

> On 2021-10-12 00:36, Carl Huang wrote:
>> Enable power save in station mode.
>>
>> Run "iw dev wls1 set power_save off",  check there is no NULL Data
>> frame
>> from sniffer. Run "iw dev wls1 set power_save on", check there is NULL
>> Data frame from sniffer.
>>
>> Tested-on: QCA6390 hw2.0 PCI
>> WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
>>
>> Signed-off-by: Carl Huang <cjhuang at codeaurora.org>

[...]

>> +int ath11k_wmi_set_psmode(struct ath11k *ar, u32 vdev_id,
>> +			  enum wmi_sta_ps_mode psmode)
>> +{
>> +	struct ath11k_pdev_wmi *wmi = ar->wmi;
>> +	struct wmi_sta_powersave_mode_cmd *cmd;
>> +	struct sk_buff *skb;
>> +	int ret;
>> +
>> +	skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd));
>> +	if (!skb)
>> +		return -ENOMEM;
>> +
>> +	cmd = (struct wmi_sta_powersave_mode_cmd *)skb->data;
>> +	cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG,
>> +				     WMI_TAG_STA_POWERSAVE_MODE_CMD) |
>> +			  FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
>> +
>> +	cmd->vdev_id = vdev_id;
>> +	cmd->sta_ps_mode = psmode;
>> +
>> +	ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
>> +		   "WMI set sta ps vdev_id %d ps %d\n",
>> +		   vdev_id, psmode);
>> +
>> +	ret = ath11k_wmi_cmd_send(wmi, skb, WMI_STA_POWERSAVE_MODE_CMDID);
>> +	if (ret) {
>> +		ath11k_warn(ar->ab, "failed to send WMI_STA_POWERSAVE_PARAM_CMDID");
>> +		dev_kfree_skb(skb);
>> +	}
>> +
>> +	return ret;
>> +}
>
> An API which does this is already present in ATH11K, you may have to
> take a look at ath11k_wmi_pdev_set_ps_mode() ?

Good catch, I'll fix this in v2.

And please do trim your replies, quotes over 200 lines long make it hard
to read.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



More information about the ath11k mailing list