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: warmcat X-Patchwork-Id: 43277 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9EB40240BA for ; Sun, 18 Jan 2015 05:11:34 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id u56sf14096134wes.3 for ; Sat, 17 Jan 2015 21:11:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=bLAC96Drk5WPiSlLR8z6QIYqp+CUskWkQy5V7qIeqPc=; b=av+cBn0MJznfynPkfamiFEy4k4o93S83xQmJwjazPjO6KZa78GPqO2ZtiUsCxoKhFd 8N6Pzc5llyKTsUzKdc2cu9oWA7B712AlpgHJvn2ImfnIY82IucG4ttbDxLR04pgU3MgR hQlu5FvK+byjeVqHBY6OzKQODgEoTHDqASM3n5PYn/2igGjSgVj4s3Os/HJIF/SVFEmB HFvZciRDHAxaq9a9qhw881wZdkQEPF8LlT4zkYATSOMX6SuwxQMsvb6ErkuTMdlieGzJ E69IOjSvSmzBrP3IUUccyiL7t0+lYPz/HjG529x2qmc7xITCCKGlzuIGdEpQ9YZZ3EcE qWaQ== X-Gm-Message-State: ALoCoQl+o8G24B+h8xEk4bWuSZnxnxowuY4NdUKezGJ7KejGmUVarbIP0bs2a9nndDxPemwdzXS3 X-Received: by 10.180.98.199 with SMTP id ek7mr1338349wib.1.1421557893966; Sat, 17 Jan 2015 21:11:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.202 with SMTP id m10ls434836lah.76.gmail; Sat, 17 Jan 2015 21:11:33 -0800 (PST) X-Received: by 10.152.8.225 with SMTP id u1mr23400739laa.21.1421557893747; Sat, 17 Jan 2015 21:11:33 -0800 (PST) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com. [2a00:1450:4010:c03::22c]) by mx.google.com with ESMTPS id y3si8624771laj.75.2015.01.17.21.11.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 Jan 2015 21:11:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22c as permitted sender) client-ip=2a00:1450:4010:c03::22c; Received: by mail-la0-f44.google.com with SMTP id hz20so1998292lab.3 for ; Sat, 17 Jan 2015 21:11:33 -0800 (PST) X-Received: by 10.152.3.70 with SMTP id a6mr5918196laa.71.1421557893653; Sat, 17 Jan 2015 21:11:33 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp740522lbb; Sat, 17 Jan 2015 21:11:32 -0800 (PST) X-Received: by 10.70.92.100 with SMTP id cl4mr34502670pdb.151.1421557891922; Sat, 17 Jan 2015 21:11:31 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pp4si11239584pbb.0.2015.01.17.21.11.31; Sat, 17 Jan 2015 21:11:31 -0800 (PST) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbbARFL2 (ORCPT + 3 others); 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) 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: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Original-Sender: andy.green@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22c as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 netdev" 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;