From patchwork Mon Nov 9 10:02:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengwei Yin X-Patchwork-Id: 7581731 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 CC92E9F2E9 for ; Mon, 9 Nov 2015 09:01:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27B9620461 for ; Mon, 9 Nov 2015 09:01:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 362E22077C for ; Mon, 9 Nov 2015 09:01:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbbKIJBh (ORCPT ); Mon, 9 Nov 2015 04:01:37 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:33795 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbbKIJBh (ORCPT ); Mon, 9 Nov 2015 04:01:37 -0500 Received: by padhx2 with SMTP id hx2so184710487pad.1 for ; Mon, 09 Nov 2015 01:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Aon5bTPGzH0yKUw5l1qr7BHBh8fmiFg8ASM6GgQeAaM=; b=SxnG6gZ4aQG8pgEpZ2unloYNdJodZD+Z2YZlZHAO3SupKjB09/kePQLit6ZSUWrDOt LqQgfGCe5R+0lRzWzUD5F8H7o465cIRtNgyeNhWRFlwV/HlNd4mAyYpwUJUwghceuGPq jI2oaeOWNMOdSHXL8Zu6VO+L7/yOv20zJtPYCII1iTLbGNAnLY0hsjnqul05kuBUOjyG JLVBseXrJjKjbtdiCDGMF7qcybdR8nRm+w5zGhKmjDy+INxTHaNEnwexvJjL8wTy9ZwE 9piI761pKaLvhhtquvR4T4Ri+kqquyUMHnUrn7NwH1HL+D0fxzbIVwBcvchnuSFJDRF0 jWig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Aon5bTPGzH0yKUw5l1qr7BHBh8fmiFg8ASM6GgQeAaM=; b=CjAsxb3ILuikf42zQAo1OvLj2oRLXBFeL7dFvkX8VMtqI6zZPtemqzs9V0X1pXgdWi b4volFO2X3Bm9TPRPff1qzipu+y+iWEGDHSXu2p/pQg3A6fPE6YTbKp8nnQmD+/BroH+ 5LRZmKFtVSL3bUnthX0gdc6W7OTQRUW02qG6i63PYaCn5E53Wn4OdChgWywLCiyjjDYN S1WQCWOhkxDtIeKfaV9Tt/SRoosN+yqX4HZyi4Jsn1mXx/tx1Bg29PDJhKJ+FWo2Ymm7 blRqgi4Le06p0zGjIxkUhRtnZHjnIV9tgqI1y6/AzVuKBmD41SoGDCP7KH7zRfdHIDMU Oj2Q== X-Gm-Message-State: ALoCoQkvVUynwi0OShZheE3DfAiL3zT7/hkHcfpJvTPY8eU0k/8OaYN+ch+Eg0wYTQ1lb0s3YHnr X-Received: by 10.67.4.229 with SMTP id ch5mr25164429pad.79.1447059696568; Mon, 09 Nov 2015 01:01:36 -0800 (PST) Received: from localhost.localdomain ([45.116.12.36]) by smtp.googlemail.com with ESMTPSA id ck9sm15005136pad.28.2015.11.09.01.01.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Nov 2015 01:01:33 -0800 (PST) From: "Yin, Fengwei" To: andy.green@linaro.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org, me@bobcopeland.com, k.eugene.e@gmail.com, bjorn.andersson@sonymobile.com Cc: fengwei.yin@linaro.org Subject: [PATCH 3/5] wcn36xx: handle new hal response format Date: Mon, 9 Nov 2015 05:02:40 -0500 Message-Id: <1447063362-27322-4-git-send-email-fengwei.yin@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447063362-27322-1-git-send-email-fengwei.yin@linaro.org> References: <1447063362-27322-1-git-send-email-fengwei.yin@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 From: Andy Green From: Andy Green wcn3620 has a new message structure for the reply to some hal commands. This patch adds the struct and helper routine that uses it if the chip is wcn3620, or falls back to the old helper routine. 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 | 17 +++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index be317f4..a84c2cc 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -302,6 +302,23 @@ static int wcn36xx_smd_rsp_status_check(void *buf, size_t len) return 0; } +static int wcn36xx_smd_rsp_status_check_v2(struct wcn36xx *wcn, void *buf, + size_t len) +{ + struct wcn36xx_fw_msg_status_rsp_v2 *rsp; + + if (wcn->chip_version != WCN36XX_CHIP_3620 || + len < sizeof(struct wcn36xx_hal_msg_header) + sizeof(*rsp)) + return wcn36xx_smd_rsp_status_check(buf, len); + + rsp = buf + sizeof(struct wcn36xx_hal_msg_header); + + if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) + return rsp->status; + + return 0; +} + int wcn36xx_smd_load_nv(struct wcn36xx *wcn) { struct nv_data *nv_d; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 008d034..8361f9e 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_rsp_v2 { + 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;