From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 10/16] iwlwifi: mvm: fix firmware statistics usage
Date: Fri, 18 Jan 2019 20:59:58 +0200 [thread overview]
Message-ID: <20190118190004.22270-11-luca@coelho.fi> (raw)
In-Reply-To: <20190118190004.22270-1-luca@coelho.fi>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
The new (CDB) statistics API is used by non-CDB devices
as well. Look at the right TLV flag to know which version
of the statistics notification to use.
To avoid confusion, remove the _cdb suffix from the
structure name.
While at it, remove a structure that was never used.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fixes: 678d9b6dddea ("iwlwifi: mvm: update rx statistics cmd api")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/fw/api/stats.h | 15 +++++----------
drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 10 +++++-----
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/stats.h b/drivers/net/wireless/intel/iwlwifi/fw/api/stats.h
index 53cb622aa9ab..318843138490 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/stats.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/stats.h
@@ -8,6 +8,7 @@
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
+ * Copyright (C) 2018 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
@@ -29,6 +30,7 @@
*
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
+ * Copyright (C) 2018 Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -363,14 +365,7 @@ struct mvm_statistics_general_v8 {
u8 reserved[4 - (NUM_MAC_INDEX % 4)];
} __packed; /* STATISTICS_GENERAL_API_S_VER_8 */
-struct mvm_statistics_general_cdb_v9 {
- struct mvm_statistics_general_common_v19 common;
- __le32 beacon_counter[NUM_MAC_INDEX_CDB];
- u8 beacon_average_energy[NUM_MAC_INDEX_CDB];
- u8 reserved[4 - (NUM_MAC_INDEX_CDB % 4)];
-} __packed; /* STATISTICS_GENERAL_API_S_VER_9 */
-
-struct mvm_statistics_general_cdb {
+struct mvm_statistics_general {
struct mvm_statistics_general_common common;
__le32 beacon_counter[MAC_INDEX_AUX];
u8 beacon_average_energy[MAC_INDEX_AUX];
@@ -435,11 +430,11 @@ struct iwl_notif_statistics_v11 {
struct mvm_statistics_load_v1 load_stats;
} __packed; /* STATISTICS_NTFY_API_S_VER_11 */
-struct iwl_notif_statistics_cdb {
+struct iwl_notif_statistics {
__le32 flag;
struct mvm_statistics_rx rx;
struct mvm_statistics_tx tx;
- struct mvm_statistics_general_cdb general;
+ struct mvm_statistics_general general;
struct mvm_statistics_load load_stats;
} __packed; /* STATISTICS_NTFY_API_S_VER_13 */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
index 6653a238f32e..235ab26ca429 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
@@ -599,8 +599,8 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac,
* data copied into the "data" struct, but rather the data from
* the notification directly.
*/
- if (iwl_mvm_is_cdb_supported(mvm)) {
- struct mvm_statistics_general_cdb *general =
+ if (iwl_mvm_has_new_rx_stats_api(mvm)) {
+ struct mvm_statistics_general *general =
data->general;
mvmvif->beacon_stats.num_beacons =
@@ -723,7 +723,7 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm,
else
expected_size = sizeof(struct iwl_notif_statistics_v10);
} else {
- expected_size = sizeof(struct iwl_notif_statistics_cdb);
+ expected_size = sizeof(struct iwl_notif_statistics);
}
if (WARN_ONCE(iwl_rx_packet_payload_len(pkt) != expected_size,
@@ -753,7 +753,7 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm,
flags = stats->flag;
} else {
- struct iwl_notif_statistics_cdb *stats = (void *)&pkt->data;
+ struct iwl_notif_statistics *stats = (void *)&pkt->data;
data.mac_id = stats->rx.general.mac_id;
data.beacon_filter_average_energy =
@@ -792,7 +792,7 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm,
bytes = (void *)&v11->load_stats.byte_count;
air_time = (void *)&v11->load_stats.air_time;
} else {
- struct iwl_notif_statistics_cdb *stats = (void *)&pkt->data;
+ struct iwl_notif_statistics *stats = (void *)&pkt->data;
energy = (void *)&stats->load_stats.avg_energy;
bytes = (void *)&stats->load_stats.byte_count;
--
2.20.1
next prev parent reply other threads:[~2019-01-18 19:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 18:59 [PATCH 00/16] iwlwifi: updates intended for v4.21 2019-01-18 Luca Coelho
2019-01-18 18:59 ` [PATCH 01/16] iwlwifi: pcie: make array 'prop' static, shrinks object size Luca Coelho
2019-01-18 18:59 ` [PATCH 02/16] iwlwifi: wrt: add to dump number of lmacs, lmac1 and umac error id Luca Coelho
2019-01-18 18:59 ` [PATCH 03/16] iwlwifi: mvm: advertise support for TWT in the Extended Capability IE Luca Coelho
2019-01-18 18:59 ` [PATCH 04/16] iwlwifi: mvm: rely on mac80211 to configure TWT support Luca Coelho
2019-01-18 18:59 ` [PATCH 05/16] iwlwifi: add PCI IDs for the 22260 device series Luca Coelho
2019-01-18 18:59 ` [PATCH 06/16] iwlwifi: pcie: recognize NICs with hw_rev 0x364 correctly Luca Coelho
2019-01-21 20:46 ` kbuild test robot
2019-01-23 7:02 ` [PATCH v2] " Luca Coelho
2019-01-18 18:59 ` [PATCH 07/16] iwlwifi: mvm: fix wrong DCM TLC config Luca Coelho
2019-01-18 18:59 ` [PATCH 08/16] iwlwifi: correct one of the PCI struct names Luca Coelho
2019-01-18 18:59 ` [PATCH 09/16] iwlwifi: add new cards for 22560, 9260 and killer series Luca Coelho
2019-01-18 18:59 ` Luca Coelho [this message]
2019-01-18 18:59 ` [PATCH 11/16] iwlwifi: remove support for 9000 A-step devices Luca Coelho
2019-01-18 19:00 ` [PATCH 12/16] iwlwifi: pcie: remove unnecessary iwl_pcie_enable_rx_wake() function Luca Coelho
2019-01-18 19:00 ` [PATCH 13/16] iwlwifi: pcie: remove suspend/resume workaround for 9000A devices Luca Coelho
2019-01-18 19:00 ` [PATCH 14/16] iwlwifi: wrt: add 22000 device familiy prph dump support Luca Coelho
2019-01-18 19:00 ` [PATCH 15/16] iwlwifi: mvm: make NVM access actually fail on failures Luca Coelho
2019-01-18 19:00 ` [PATCH 16/16] iwlwifi: mvm: support mac80211 TXQs model Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190118190004.22270-11-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=emmanuel.grumbach@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).