From patchwork Thu Jun 30 17:46:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 71265 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp514415qgy; Thu, 30 Jun 2016 10:46:38 -0700 (PDT) X-Received: by 10.66.240.101 with SMTP id vz5mr23915085pac.16.1467308798464; Thu, 30 Jun 2016 10:46:38 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wu1si5311044pab.81.2016.06.30.10.46.38; Thu, 30 Jun 2016 10:46:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752517AbcF3Rqd (ORCPT + 30 others); Thu, 30 Jun 2016 13:46:33 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34144 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbcF3Rqc (ORCPT ); Thu, 30 Jun 2016 13:46:32 -0400 Received: by mail-pa0-f43.google.com with SMTP id bz2so30336627pad.1 for ; Thu, 30 Jun 2016 10:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=fnySlxEl7H2dGhQTsIEOujxY6iVl+MgDyXHtddSC8u4=; b=cD4JZNZ3mLx1WKf8jzq8xyL55Po97nLduhZNPnznUvg5MVyEOYsXkEDN8mFDrZZOTK PLFSzSaHqxWee0Pn5ujXZDsOiQPOuS7zfOrmsOnhzeAYjjQ3ebGkkTI2CvD6KOdIEs0l IxG2+y/NpiC9UNN39kEG4tFOCLbxI1uFqiVDU= 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; bh=fnySlxEl7H2dGhQTsIEOujxY6iVl+MgDyXHtddSC8u4=; b=MzCOmn8EpO+sIbmvOzpyW4ghYQfcoILvvzpRXPXd+kcrH7KkWwo2dPnGx67YzinOJR 2spY8lM1iH132Y4MqwfSmZeaeRdUFj1+isqFtni3gU+q8TgTL6eLYBnCiullY8Hpapiw 83tb5tYcc8ozYAVKhTCIma3HtG8z3ss1Oc2ms+QgF/H1NIvcSms3LtfvBn3hsAEn19o8 RqK3UYQWnRw93IFAZLHYrzcRt45n4KC5Ed6czmbQq5r/T1rvsRfhDLeZKihoW1oyZQrw Yj9lh9pgzIMwveO83+AbskW4vJ9hMh5nb0KrcZLjBFYMUAci+8M9vU37Lk0p0PF5la3/ /HWQ== X-Gm-Message-State: ALyK8tLGNzjt1LnOW11GpE37BK/e7dqK5uTD9SciHAvCxgwJcHXhmR7g9HMMHejmD4nb6+RB X-Received: by 10.66.33.132 with SMTP id r4mr23575848pai.38.1467308791343; Thu, 30 Jun 2016 10:46:31 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id r143sm7241176pfr.48.2016.06.30.10.46.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 10:46:30 -0700 (PDT) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Dechesne Subject: [PATCH] wcn36xx: Implement print_reg indication Date: Thu, 30 Jun 2016 10:46:29 -0700 Message-Id: <1467308789-23475-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some firmware versions sends a "print register indication", handle this by printing out the content. Cc: Nicolas Dechesne Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/wcn36xx/hal.h | 16 ++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) -- 2.5.0 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 4f87ef1e1eb8..b765c647319d 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -350,6 +350,8 @@ enum wcn36xx_hal_host_msg_type { WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233, + WCN36XX_HAL_PRINT_REG_INFO_IND = 259, + WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE }; @@ -4703,4 +4705,18 @@ struct stats_class_b_ind { u32 rx_time_total; }; +/* WCN36XX_HAL_PRINT_REG_INFO_IND */ +struct wcn36xx_hal_print_reg_info_ind { + struct wcn36xx_hal_msg_header header; + + u32 count; + u32 scenario; + u32 reason; + + struct { + u32 addr; + u32 value; + } regs[]; +} __packed; + #endif /* _HAL_H_ */ diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 87a62eb6228c..28d6ca0ca819 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2109,6 +2109,30 @@ static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn, return -ENOENT; } +static int wcn36xx_smd_print_reg_info_ind(struct wcn36xx *wcn, + void *buf, + size_t len) +{ + struct wcn36xx_hal_print_reg_info_ind *rsp = buf; + int i; + + if (len < sizeof(*rsp)) { + wcn36xx_warn("Corrupted print reg info indication\n"); + return -EIO; + } + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "reginfo indication, scenario: 0x%x reason: 0x%x\n", + rsp->scenario, rsp->reason); + + for (i = 0; i < rsp->count; i++) { + wcn36xx_dbg(WCN36XX_DBG_HAL, "\t0x%x: 0x%x\n", + rsp->regs[i].addr, rsp->regs[i].value); + } + + return 0; +} + int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value) { struct wcn36xx_hal_update_cfg_req_msg msg_body, *body; @@ -2238,6 +2262,7 @@ int wcn36xx_smd_rsp_process(struct qcom_smd_channel *channel, case WCN36XX_HAL_OTA_TX_COMPL_IND: case WCN36XX_HAL_MISSED_BEACON_IND: case WCN36XX_HAL_DELETE_STA_CONTEXT_IND: + case WCN36XX_HAL_PRINT_REG_INFO_IND: msg_ind = kmalloc(sizeof(*msg_ind) + len, GFP_ATOMIC); if (!msg_ind) { /* @@ -2300,6 +2325,11 @@ static void wcn36xx_ind_smd_work(struct work_struct *work) hal_ind_msg->msg, hal_ind_msg->msg_len); break; + case WCN36XX_HAL_PRINT_REG_INFO_IND: + wcn36xx_smd_print_reg_info_ind(wcn, + hal_ind_msg->msg, + hal_ind_msg->msg_len); + break; default: wcn36xx_err("SMD_EVENT (%d) not supported\n", msg_header->msg_type);