You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/06/03 05:04:15 UTC
[incubator-nuttx] 01/02: wireless: add Wireless statistics
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 61ee15575265a55a4fa21a5615247b3ac7203497
Author: chao.an <an...@xiaomi.com>
AuthorDate: Thu Jun 2 15:19:31 2022 +0800
wireless: add Wireless statistics
Signed-off-by: chao.an <an...@xiaomi.com>
---
include/nuttx/wireless/wireless.h | 41 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/include/nuttx/wireless/wireless.h b/include/nuttx/wireless/wireless.h
index ed4f5297dd..66628a39e2 100644
--- a/include/nuttx/wireless/wireless.h
+++ b/include/nuttx/wireless/wireless.h
@@ -401,7 +401,6 @@
/* TODO:
*
- * - Add types for statistics (struct iw_statistics and related)
* - Add struct iw_range for use with IOCTL commands that need exchange mode data
* that could not fit in iwreq.
* - Private IOCTL data support (struct iw_priv_arg)
@@ -459,6 +458,31 @@ struct iw_quality
uint8_t updated; /* Flags to know if updated */
};
+/* Packet discarded in the wireless adapter due to
+ * "wireless" specific problems...
+ * Note : the list of counter and statistics in net_device_stats
+ * is already pretty exhaustive, and you should use that first.
+ * This is only additional stats...
+ */
+
+struct iw_discarded
+{
+ uint32_t nwid; /* Rx : Wrong nwid/essid */
+ uint32_t code; /* Rx : Unable to code/decode (WEP) */
+ uint32_t fragment; /* Rx : Can't perform MAC reassembly */
+ uint32_t retries; /* Tx : Max MAC retries num reached */
+ uint32_t misc; /* Others cases */
+};
+
+/* Packet/Time period missed in the wireless adapter due to
+ * "wireless" specific problems...
+ */
+
+struct iw_missed
+{
+ uint32_t beacon; /* Missed beacons/superframe */
+};
+
/* This union defines the data payload of an ioctl, and is used in struct iwreq
* below.
*/
@@ -580,6 +604,21 @@ struct iw_scan_req
struct iw_freq channel_list[IW_MAX_FREQUENCIES];
};
+/* Wireless statistics */
+
+struct iw_statistics
+{
+ uint16_t status; /* Status
+ * - device dependent for now
+ */
+
+ struct iw_quality qual; /* Quality of the link
+ * (instant/mean/max)
+ */
+ struct iw_discarded discard; /* Packet discarded counts */
+ struct iw_missed miss; /* Packet missed counts */
+};
+
/* A Wireless Event. Contains basically the same data as the ioctl...
*/