From patchwork Sun Jan 18 05:11:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 5652911 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E4DEA9F333 for ; Sun, 18 Jan 2015 05:11:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21F842037E for ; Sun, 18 Jan 2015 05:11:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F73C2035B for ; Sun, 18 Jan 2015 05:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752174AbbARFL2 (ORCPT ); Sun, 18 Jan 2015 00:11:28 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:38430 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbbARFLZ (ORCPT ); Sun, 18 Jan 2015 00:11:25 -0500 Received: by mail-pd0-f174.google.com with SMTP id ft15so1062054pdb.5; Sat, 17 Jan 2015 21:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=rXbv7lKYM1wnk87yXWoHpHxZ4sivunAG16LEpbrvf6Y=; b=JRNdeaRuwgv6/JaPYRYWDhMPhYJmcPuxojq7pfz5q1s12Y0FGHDs4rHLSMzhyRYWEQ gquEUZbB8NbSCVyFXRcwO0Z5/LD4GrE8vz8eJanEYoFKFl/JIHXwrrEAyMKBVQEfrRMb Y/wnQAnYXc0suhDzkq1cIGnfp421gFdIv7aqfDJB1U1X1WUvEBIm9JpEyFcG6DJb2yCS 6Xu4OzPlU9o6lMB1x2QUkN7tKfFk33L5Zt6IG7wB9r0tdOwrqiJyHXDsebNQrtXq94yC qX1BrF6KPL2bCm6RyIqEqo03IRCLNX0wH+GXgYYTJG13eM8MhIf6CE57ffRp/9+JjrtY xoCA== X-Received: by 10.68.239.4 with SMTP id vo4mr1038555pbc.14.1421557884637; Sat, 17 Jan 2015 21:11:24 -0800 (PST) Received: from warmcat.com (114-36-241-182.dynamic.hinet.net. [114.36.241.182]) by mx.google.com with ESMTPSA id rf10sm8071383pdb.21.2015.01.17.21.11.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Jan 2015 21:11:23 -0800 (PST) Subject: [PATCH 7/7] net: wireless: wcn36xx: handle new trigger_ba format From: Andy Green To: Kalle Valo , Eugene Krasnikov Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Date: Sun, 18 Jan 2015 13:11:17 +0800 Message-ID: <20150118051117.31866.68634.stgit@114-36-241-182.dynamic.hinet.net> In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net> References: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP wcn3620 has a new message structure for the reply to trigger_ba We don't know what to do with the candidate list he sends back, but we can at least accept and ignore it nicely instead of dying. Signed-off-by: Andy Green --- drivers/net/wireless/ath/wcn36xx/smd.c | 28 ++++++++++++++++++++++++++-- drivers/net/wireless/ath/wcn36xx/smd.h | 9 +++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 819741c..dc24e1b 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -243,8 +243,31 @@ static int wcn36xx_smd_rsp_status_check(void *buf, size_t len) rsp = (struct wcn36xx_fw_msg_status_rsp *) (buf + sizeof(struct wcn36xx_hal_msg_header)); - if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) + if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) { + pr_err("%s: bad status, len = %d\n", __func__, len); + return rsp->status; + } + + return 0; +} + +static int wcn36xx_smd_rsp_status_check_bav2(struct wcn36xx *wcn, void *buf, + size_t len) +{ + struct wcn36xx_fw_msg_status_rspv2 *rsp; + + if (wcn->chip_version != WCN36XX_CHIP_3620) + return wcn36xx_smd_rsp_status_check(buf, len); + + if (len < sizeof(struct wcn36xx_hal_msg_header) + sizeof(*rsp)) + return -EIO; + + rsp = buf + sizeof(struct wcn36xx_hal_msg_header); + + if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) { + pr_err("%s: bad status, len = %d\n", __func__, len); return rsp->status; + } return 0; } @@ -1884,7 +1907,8 @@ int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) wcn36xx_err("Sending hal_trigger_ba failed\n"); goto out; } - ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + ret = wcn36xx_smd_rsp_status_check_bav2(wcn, wcn->hal_buf, + wcn->hal_rsp_len); if (ret) { wcn36xx_err("hal_trigger_ba response failed err=%d\n", ret); goto out; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 008d034..432d3b8 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -44,6 +44,15 @@ struct wcn36xx_fw_msg_status_rsp { u32 status; } __packed; +/* wcn3620 returns this for tigger_ba */ + +struct wcn36xx_fw_msg_status_rspv2 { + u8 bss_id[6]; + u32 status __packed; + u16 count_following_candidates __packed; + /* candidate list follows */ +}; + struct wcn36xx_hal_ind_msg { struct list_head list; u8 *msg;