From patchwork Wed Feb 12 19:04:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Krasnikov X-Patchwork-Id: 3640031 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68CBE9F35F for ; Wed, 12 Feb 2014 19:05:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A66F20203 for ; Wed, 12 Feb 2014 19:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A35D120165 for ; Wed, 12 Feb 2014 19:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbaBLTFE (ORCPT ); Wed, 12 Feb 2014 14:05:04 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:60789 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752341AbaBLTFB (ORCPT ); Wed, 12 Feb 2014 14:05:01 -0500 Received: by mail-wi0-f181.google.com with SMTP id hi5so7427463wib.8 for ; Wed, 12 Feb 2014 11:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NTeqaUdrPLT7pYcNJtS+M6jwtcdR/kfIkcqNOIqK0SQ=; b=Hz9hrTWANUMljDxmy2rvs9+nUXBV7VAvbY8AQhQcxN0BfFvLvSk4uz43M9etuQbCD/ wMv+b36bI7apForJWf9uHo3eScTjQCVc2RCPah9TMGJBsaYXvq5QNciSX8AJFw80m4OB CQtOXPXS1yI1WD6UqmOAtmuZmSng6a/Ns6P7ALsuSh/cc79Xd7rB0E0vaSN5gr0qj5v9 p9sXFC000jPqXzlzNOn2fkQzWs9yTi/CHlPPK0bMhbZ6Pj6tprBT2gW4l65XruL0cx9t KFmgJfguMRs7eppBRXmllP2+8+P+XuOIlG/CLSS42d3RcW/P0t+Mzmp26/cPIxL3ONKV dmVA== X-Received: by 10.180.73.173 with SMTP id m13mr3369551wiv.52.1392231900011; Wed, 12 Feb 2014 11:05:00 -0800 (PST) Received: from localhost.localdomain (cpc64773-cmbg15-2-0-cust171.5-4.cable.virginmedia.com. [86.9.84.172]) by mx.google.com with ESMTPSA id fm3sm7876900wib.8.2014.02.12.11.04.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 11:04:59 -0800 (PST) From: Eugene Krasnikov To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Pontus Fuchs Subject: [PATCH 2/9] wcn36xx: Improve feature caps exchange Date: Wed, 12 Feb 2014 19:04:41 +0000 Message-Id: <1392231888-2191-2-git-send-email-k.eugene.e@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1392231888-2191-1-git-send-email-k.eugene.e@gmail.com> References: <1392231888-2191-1-git-send-email-k.eugene.e@gmail.com> 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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: Pontus Fuchs * Response format is not in the canonical format. wcn36xx_smd_rsp_status_check cannot be used. * Save the FW caps in wcn36xx struct for later use. Signed-off-by: Pontus Fuchs --- drivers/net/wireless/ath/wcn36xx/hal.h | 4 +++- drivers/net/wireless/ath/wcn36xx/smd.c | 15 +++++++++------ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 3c2ef0c..a1f1127 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -4384,11 +4384,13 @@ enum place_holder_in_cap_bitmap { MAX_FEATURE_SUPPORTED = 128, }; +#define WCN36XX_HAL_CAPS_SIZE 4 + struct wcn36xx_hal_feat_caps_msg { struct wcn36xx_hal_msg_header header; - u32 feat_caps[4]; + u32 feat_caps[WCN36XX_HAL_CAPS_SIZE]; } __packed; /* status codes to help debug rekey failures */ diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 8a57dfe..425365c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1731,8 +1731,8 @@ static inline void clear_feat_caps(u32 *bitmap, int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) { - struct wcn36xx_hal_feat_caps_msg msg_body; - int ret = 0; + struct wcn36xx_hal_feat_caps_msg msg_body, *rsp; + int ret = 0, i; mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ); @@ -1746,12 +1746,15 @@ int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) wcn36xx_err("Sending hal_feature_caps_exchange failed\n"); goto out; } - ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); - if (ret) { - wcn36xx_err("hal_feature_caps_exchange response failed err=%d\n", - ret); + if (wcn->hal_rsp_len != sizeof(*rsp)) { + wcn36xx_err("Invalid hal_feature_caps_exchange response"); goto out; } + + rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf; + + for (i = 0; i < WCN36XX_HAL_CAPS_SIZE; i++) + wcn->fw_feat_caps[i] = rsp->feat_caps[i]; out: mutex_unlock(&wcn->hal_mutex); return ret; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 8fa5cba..c5bd61c 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -175,6 +175,7 @@ struct wcn36xx { u8 fw_version; u8 fw_minor; u8 fw_major; + u32 fw_feat_caps[WCN36XX_HAL_CAPS_SIZE]; /* extra byte for the NULL termination */ u8 crm_version[WCN36XX_HAL_VERSION_LENGTH + 1];