From bd24a50fe66ef1f64a84a3d02e0f464bb394bb9b Mon Sep 17 00:00:00 2001 From: Aarthi Thiruvengadam Date: Wed, 9 Nov 2011 10:05:56 -0800 Subject: [PATCH] ath6kl: Fix target minimum length requirement for WMI_SEND_PROBE_RESPONSE_CMDID The firmware expects the minimum length of WMI_SEND_PROBE_RESPONSE_CMDID to be 13. However, when the device is a P2P GO and it needs to send a probe response to a non-P2P client, there are no P2P IEs to be added, and therefore the length of the WMI command is 12. This command gets rejected by the firmware. To fix this, add an extra byte to satisfy the minimum length requirement. Signed-off-by: Aarthi Thiruvengadam Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath6kl/wmi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 922344d3b26..f1d53d089c7 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -3024,8 +3024,12 @@ int ath6kl_wmi_send_probe_response_cmd(struct wmi *wmi, u8 if_idx, u32 freq, { struct sk_buff *skb; struct wmi_p2p_probe_response_cmd *p; + size_t cmd_len = sizeof(*p) + data_len; - skb = ath6kl_wmi_get_new_buf(sizeof(*p) + data_len); + if (data_len == 0) + cmd_len++; /* work around target minimum length requirement */ + + skb = ath6kl_wmi_get_new_buf(cmd_len); if (!skb) return -ENOMEM; -- 2.39.5