From patchwork Fri Mar 21 05:34:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3871231 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 3C1989F370 for ; Fri, 21 Mar 2014 05:35:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4512E20253 for ; Fri, 21 Mar 2014 05:35:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 636B72024F for ; Fri, 21 Mar 2014 05:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753886AbaCUFe6 (ORCPT ); Fri, 21 Mar 2014 01:34:58 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57642 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751462AbaCUFe6 (ORCPT ); Fri, 21 Mar 2014 01:34:58 -0400 Received: by mail-pb0-f45.google.com with SMTP id uo5so1956836pbc.4 for ; Thu, 20 Mar 2014 22:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=H5htEroZI893vnrRVqrdwIZSEvn2TIhFbib2+KeTK4A=; b=sGqEbI88pabUU7mSlovoNthNrT9VkYG/ZHosk9oSNBXaVjEcwpseXvacq/WIX9rlQb iOqR5BpB5amLo+GIsh4ymFqFsfajaZYfkBiyKpXbMeU4Mfym7Eq+piDjobp5Zei6o4Rc gNwo1FcxCDfPK6txlnXd2Age0OxsUa+7ZPYdAI1KbbYa9uz2h9/zgrOwuB6CjwPlJGq/ V4r5qbRDemn5M6OZetqSDhQONjZIfdW2I+mAYxI3VeTG3oL8RNzeIhHXH4nC00ttjABO 0sQXDd54Bw4m/Awc/xz8koLHVoKVH2xkywEOntISxSwldUJ4Sgmqf1VxVkgCZ0LAvFlw Vkjw== X-Received: by 10.67.3.40 with SMTP id bt8mr51482452pad.78.1395380097736; Thu, 20 Mar 2014 22:34:57 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id bz4sm7483578pbb.12.2014.03.20.22.34.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 22:34:57 -0700 (PDT) From: Chun-Yeow Yeoh To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: fix the peer mac address in getting stats Date: Fri, 21 Mar 2014 13:34:36 +0800 Message-Id: <1395380076-4306-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Using the macro to convert the MAC address from WMI word format to char array has lead to the wrong peer mac address printed out while retrieving the peer stats from FW. Fix this. Signed-off-by: Chun-Yeow Yeoh Reviewed-By: Micha? Kazior --- drivers/net/wireless/ath/ath10k/debug.c | 4 ++-- drivers/net/wireless/ath/ath10k/wmi.h | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 6debd28..f95defa 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -252,8 +252,8 @@ void ath10k_debug_read_target_stats(struct ath10k *ar, peer_stats = (struct wmi_peer_stats *)tmp; s = &stats->peer_stat[i]; - WMI_MAC_ADDR_TO_CHAR_ARRAY(&peer_stats->peer_macaddr, - s->peer_macaddr); + memcpy(s->peer_macaddr, &peer_stats->peer_macaddr.addr, + ETH_ALEN); s->peer_rssi = __le32_to_cpu(peer_stats->peer_rssi); s->peer_tx_rate = __le32_to_cpu(peer_stats->peer_tx_rate); diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index e78a7ad..084bcc5 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -198,16 +198,6 @@ struct wmi_mac_addr { } __packed; } __packed; -/* macro to convert MAC address from WMI word format to char array */ -#define WMI_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \ - (c_macaddr)[0] = ((pwmi_mac_addr)->word0) & 0xff; \ - (c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \ - (c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \ - (c_macaddr)[3] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \ - (c_macaddr)[4] = ((pwmi_mac_addr)->word1) & 0xff; \ - (c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \ - } while (0) - struct wmi_cmd_map { u32 init_cmdid; u32 start_scan_cmdid;