From nobody Mon Apr 14 08:56:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Zbh4B3PKmz5sR6D; Mon, 14 Apr 2025 08:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zbh4B2zRLz3pJ7; Mon, 14 Apr 2025 08:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744621018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K3e356Sf047qxGZQnOL2wiSTZbd1Hl6dydNgu5fm/h8=; b=W3KO4v1ZRTP0PDBB+TgO6MegBFgkbfljvuwSMBNsbO/UkXqbISCwIGZlL82t/sj/K2vDND LmDVMS7V30VJKan7xalLApMBqc9jvkIYoxkNnL2GNT0/Rt5cxTp/ZSyH+c95+J7qG8xjDe A+5ukjA+ATrT/q2j8RLdNL9yhUACk3mg9iwUk5rVUj9lz07Mz7qS7aLaddA4f18x/G1lbQ lBfbSDST64PcLZA0VAx6IOaoh9xeZOSlJQEXRBOnb0dg/YXWa6AUdXNcYR1/dy9+wfKr8G EurpUE/o72xXG+irsCdu3eUAMFIZlVJksiqAWx4liCrk9UNds/NRKfKyEp2eSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744621018; a=rsa-sha256; cv=none; b=JEzteoOaIuIMXHwX/gj1Gh12wjlRbCuhbaFzFS1/JxfFh9nxY434b7HJoiPv7xGDahE8SE Pomnie06MH2iXVpR9CjMZZugMLeSmo4mIbQzAuHjd+AwJX0Ztou8X5bsFNLMLd56jacbWO CzXX87ayHqs91LbXFAigYUK4duxD7Itn17Ru82kOhQ3CCMNWhd+a25x7SQG8/WS5c4C+Iz x+XSpgIVo7Q+YPWe+CetWe3p3es03YuGMrtTz/alpfXT8k5WJTKQxkJj9l1oiPXq7eRUZz /1tLeGicJM1W68kP/IWptJZM4wBwzPTrF7x+BK8DBC9Yvjkqpw9Tn9fbeSI3Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744621018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K3e356Sf047qxGZQnOL2wiSTZbd1Hl6dydNgu5fm/h8=; b=pA52DdYHa+0Td6L/27n94KmrBtgj0nCtEz4SVbJAcMamSmR78cZz73U8+CiFcRRhKHqP2T CtVv4hddBvKdLLmJqo1JBGFSC5pvCJcEISej8aRmzXc3IrwoDg4yknmqBxjGxMf9ONqtjw +BEGxeCfnI83d2Cmh4JUt0H4fIvqqoamt0zyT6dERwvsg+jkllxUbUM+ajyO1UJU5vj6ZY jRgxqOcue4GRMmRuezXnYeFVBYYd34K0uz7h6FuagWwUXp3Fw6VEPhpR8y7YlVbhx8IGkB L0tNftCIPq+suBR5Lk4qsT7FFF8YBKt95/Md59PgiLNTRESj19pi6I0+u0eOaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Zbh4B2YbZzhs8; Mon, 14 Apr 2025 08:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53E8uwvH051096; Mon, 14 Apr 2025 08:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53E8uw7L051093; Mon, 14 Apr 2025 08:56:58 GMT (envelope-from git) Date: Mon, 14 Apr 2025 08:56:58 GMT Message-Id: <202504140856.53E8uw7L051093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 71baab405ef6 - main - iwx: Remove debug logging code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71baab405ef6102714f06de50d889509babe7413 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=71baab405ef6102714f06de50d889509babe7413 commit 71baab405ef6102714f06de50d889509babe7413 Author: Tom Jones AuthorDate: 2025-04-11 15:01:28 +0000 Commit: Tom Jones CommitDate: 2025-04-14 08:56:23 +0000 iwx: Remove debug logging code This debugging code was added this log as part of an effort to diagnose firmware crashes in an earlier version of the driver. It hasn't been used for a while and I'm not sure how useful it is for this compared to other methods. While reorganisation move strings for print mappings into if_iwx_debug.c to reduce their scope. Suggested by: bz Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49783 --- sys/dev/iwx/if_iwx.c | 14 +-- sys/dev/iwx/if_iwx_debug.c | 301 ++++++++++++++++++++++++++------------------- sys/dev/iwx/if_iwx_debug.h | 208 +------------------------------ 3 files changed, 177 insertions(+), 346 deletions(-) diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c index 6d3aa1b49c15..03008e4fac93 100644 --- a/sys/dev/iwx/if_iwx.c +++ b/sys/dev/iwx/if_iwx.c @@ -5111,9 +5111,6 @@ iwx_phy_ctxt_cmd(struct iwx_softc *sc, struct iwx_phy_ctxt *ctxt, static int iwx_send_cmd(struct iwx_softc *sc, struct iwx_host_cmd *hcmd) { -#ifdef IWX_DEBUG - iwx_bbl_add_entry(hcmd->id, IWX_BBL_CMD_TX, ticks); -#endif struct iwx_tx_ring *ring = &sc->txq[IWX_DQA_CMD_QUEUE]; struct iwx_tfh_tfd *desc; struct iwx_tx_data *txdata; @@ -5717,9 +5714,6 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni) memcpy(tx->hdr, wh, hdrlen); txcmd_size = sizeof(*tx); } -#if IWX_DEBUG - iwx_bbl_add_entry(totlen, IWX_BBL_PKT_TX, ticks); -#endif /* Trim 802.11 header. */ m_adj(m, hdrlen); @@ -8565,9 +8559,6 @@ iwx_watchdog(void *arg) if (--sc->sc_tx_timer[i] == 0) { printf("%s: device timeout\n", DEVNAME(sc)); - if (sc->sc_debug) - iwx_bbl_print_log(); - iwx_nic_error(sc); iwx_dump_driver_status(sc); ieee80211_restart_all(ic); @@ -8892,9 +8883,7 @@ iwx_rx_pkt(struct iwx_softc *sc, struct iwx_rx_data *data, struct mbuf *ml) if (!iwx_rx_pkt_valid(pkt)) break; -#ifdef IWX_DEBUG - iwx_bbl_add_entry(pkt->hdr.code, IWX_BBL_CMD_RX, ticks); -#endif + /* * XXX Intel inside (tm) * Any commands in the LONG_GROUP could actually be in the @@ -9507,7 +9496,6 @@ iwx_intr_msix(void *arg) (inta_hw & IWX_MSIX_HW_INT_CAUSES_REG_SW_ERR) || (inta_hw & IWX_MSIX_HW_INT_CAUSES_REG_SW_ERR_V2)) { if (sc->sc_debug) { - iwx_bbl_print_log(); iwx_nic_error(sc); iwx_dump_driver_status(sc); } diff --git a/sys/dev/iwx/if_iwx_debug.c b/sys/dev/iwx/if_iwx_debug.c index 6a2bf32ad738..0c6658094282 100644 --- a/sys/dev/iwx/if_iwx_debug.c +++ b/sys/dev/iwx/if_iwx_debug.c @@ -19,30 +19,178 @@ #include #include -static uint16_t bbl_idx = 0; -static uint32_t bbl_seq = 0; -static uint8_t bbl_compress = 1; +static int print_codes[][2] = { +#if 0 + for example: + IWX_LEGACY_GROUP, IWX_ADD_STA_KEY, + IWX_LEGACY_GROUP, IWX_SCD_QUEUE_CONFIG_CMD, + IWX_LEGACY_GROUP, IWX_ADD_STA, + IWX_LEGACY_GROUP, IWX_REMOVE_STA, +#endif +}; -static const char * -iwx_bbl_to_str(int type) -{ - switch(type) { - case IWX_BBL_PKT_TX: - return ("IWX_BBL_PKT_TX"); - case IWX_BBL_PKT_RX: - return ("IWX_BBL_PKT_RX"); - case IWX_BBL_PKT_DUP: - return ("IWX_BBL_PKT_DUP"); - case IWX_BBL_CMD_TX: - return ("IWX_BBL_CMD_TX"); - case IWX_BBL_CMD_RX: - return ("IWX_BBL_CMD_RX"); - case IWX_BBL_ANY: - return ("IWX_BBL_ANY"); - default: - return ("ERROR"); - } -} +struct opcode_label { + uint8_t opcode; + const char *label; +}; + +static struct opcode_label command_group[] = { + { 0x0, "IWX_LEGACY_GROUP"}, + { 0x1, "IWX_LONG_GROUP"}, + { 0x2, "IWX_SYSTEM_GROUP"}, + { 0x3, "IWX_MAC_CONF_GROUP"}, + { 0x4, "IWX_PHY_OPS_GROUP"}, + { 0x5, "IWX_DATA_PATH_GROUP"}, + { 0xb, "IWX_PROT_OFFLOAD_GROUP"}, + { 0xc, "IWX_REGULATORY_AND_NVM_GROUP"}, + { 0, NULL } +}; + +static struct opcode_label legacy_opcodes[] = { + { 0xc0, "IWX_REPLY_RX_PHY_CMD" }, + { 0xc1, "IWX_REPLY_RX_MPDU_CMD" }, + { 0xc2, "IWX_BAR_FRAME_RELEASE" }, + { 0xc3, "IWX_FRAME_RELEASE" }, + { 0xc5, "IWX_BA_NOTIF" }, + { 0x62, "IWX_TEMPERATURE_NOTIFICATION" }, + { 0xc8, "IWX_MCC_UPDATE_CMD" }, + { 0xc9, "IWX_MCC_CHUB_UPDATE_CMD" }, + { 0x65, "IWX_CALIBRATION_CFG_CMD" }, + { 0x66, "IWX_CALIBRATION_RES_NOTIFICATION" }, + { 0x67, "IWX_CALIBRATION_COMPLETE_NOTIFICATION" }, + { 0x68, "IWX_RADIO_VERSION_NOTIFICATION" }, + { 0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE" }, + { 0x01, "IWX_SOC_CONFIGURATION_CMD" }, + { 0x02, "IWX_REPLY_ERROR" }, + { 0x03, "IWX_CTDP_CONFIG_CMD" }, + { 0x04, "IWX_INIT_COMPLETE_NOTIF" }, + { 0x05, "IWX_SESSION_PROTECTION_CMD" }, + { 0x5d, "IWX_BT_COEX_CI" }, + { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" }, + { 0x08, "IWX_RLC_CONFIG_CMD" }, + { 0xd0, "IWX_MCAST_FILTER_CMD" }, + { 0xd1, "IWX_REPLY_SF_CFG_CMD" }, + { 0xd2, "IWX_REPLY_BEACON_FILTERING_CMD" }, + { 0xd3, "IWX_D3_CONFIG_CMD" }, + { 0xd4, "IWX_PROT_OFFLOAD_CONFIG_CMD" }, + { 0xd5, "IWX_OFFLOADS_QUERY_CMD" }, + { 0xd6, "IWX_REMOTE_WAKE_CONFIG_CMD" }, + { 0x77, "IWX_POWER_TABLE_CMD" }, + { 0x78, "IWX_PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION" }, + { 0xcc, "IWX_BT_COEX_PRIO_TABLE" }, + { 0xcd, "IWX_BT_COEX_PROT_ENV" }, + { 0xce, "IWX_BT_PROFILE_NOTIFICATION" }, + { 0x6a, "IWX_PHY_CONFIGURATION_CMD" }, + { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" }, + { 0x17, "IWX_ADD_STA_KEY" }, + { 0x18, "IWX_ADD_STA" }, + { 0x19, "IWX_REMOVE_STA" }, + { 0xe0, "IWX_WOWLAN_PATTERNS" }, + { 0xe1, "IWX_WOWLAN_CONFIGURATION" }, + { 0xe2, "IWX_WOWLAN_TSC_RSC_PARAM" }, + { 0xe3, "IWX_WOWLAN_TKIP_PARAM" }, + { 0xe4, "IWX_WOWLAN_KEK_KCK_MATERIAL" }, + { 0xe5, "IWX_WOWLAN_GET_STATUSES" }, + { 0xe6, "IWX_WOWLAN_TX_POWER_PER_DB" }, + { 0x0f, "IWX_SCAN_COMPLETE_UMAC" }, + { 0x88, "IWX_NVM_ACCESS_CMD" }, + { 0x20, "IWX_WEP_KEY" }, + { 0xdc, "IWX_CMD_DTS_MEASUREMENT_TRIGGER" }, + { 0xdd, "IWX_DTS_MEASUREMENT_NOTIFICATION" }, + { 0x28, "IWX_MAC_CONTEXT_CMD" }, + { 0x29, "IWX_TIME_EVENT_CMD" }, + { 0x01, "IWX_ALIVE" }, + { 0xf0, "IWX_REPLY_DEBUG_CMD" }, + { 0x90, "IWX_BEACON_NOTIFICATION" }, + { 0xf5, "IWX_RX_NO_DATA_NOTIF" }, + { 0x08, "IWX_PHY_CONTEXT_CMD" }, + { 0x91, "IWX_BEACON_TEMPLATE_CMD" }, + { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" }, + { 0x09, "IWX_DBG_CFG" }, + { 0xf7, "IWX_DEBUG_LOG_MSG" }, + { 0x1c, "IWX_TX_CMD" }, + { 0x1d, "IWX_SCD_QUEUE_CFG" }, + { 0x1e, "IWX_TXPATH_FLUSH" }, + { 0x1f, "IWX_MGMT_MCAST_KEY" }, + { 0x98, "IWX_TX_ANT_CONFIGURATION_CMD" }, + { 0xee, "IWX_LTR_CONFIG" }, + { 0x8e, "IWX_SET_CALIB_DEFAULT_CMD" }, + { 0xFE, "IWX_CT_KILL_NOTIFICATION" }, + { 0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE" }, + { 0x2a, "IWX_TIME_EVENT_NOTIFICATION" }, + { 0x2b, "IWX_BINDING_CONTEXT_CMD" }, + { 0x2c, "IWX_TIME_QUOTA_CMD" }, + { 0x2d, "IWX_NON_QOS_TX_COUNTER_CMD" }, + { 0xa0, "IWX_CARD_STATE_CMD" }, + { 0xa1, "IWX_CARD_STATE_NOTIFICATION" }, + { 0xa2, "IWX_MISSED_BEACONS_NOTIFICATION" }, + { 0x0c, "IWX_SCAN_CFG_CMD" }, + { 0x0d, "IWX_SCAN_REQ_UMAC" }, + { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" }, + { 0x0e, "IWX_SCAN_ABORT_UMAC" }, + { 0xfe, "IWX_PNVM_INIT_COMPLETE" }, + { 0xa9, "IWX_MAC_PM_POWER_TABLE" }, + { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" }, + { 0x9b, "IWX_BT_CONFIG" }, + { 0x9c, "IWX_STATISTICS_CMD" }, + { 0x9d, "IWX_STATISTICS_NOTIFICATION" }, + { 0x9f, "IWX_REDUCE_TX_POWER_CMD" }, + { 0xb1, "IWX_MFUART_LOAD_NOTIFICATION" }, + { 0xb5, "IWX_SCAN_ITERATION_COMPLETE_UMAC" }, + { 0x54, "IWX_NET_DETECT_CONFIG_CMD" }, + { 0x56, "IWX_NET_DETECT_PROFILES_QUERY_CMD" }, + { 0x57, "IWX_NET_DETECT_PROFILES_CMD" }, + { 0x58, "IWX_NET_DETECT_HOTSPOTS_CMD" }, + { 0x59, "IWX_NET_DETECT_HOTSPOTS_QUERY_CMD" }, + { 0, NULL } +}; + +/* SYSTEM_GROUP group subcommand IDs */ +static struct opcode_label system_opcodes[] = { + { 0x00, "IWX_SHARED_MEM_CFG_CMD" }, + { 0x01, "IWX_SOC_CONFIGURATION_CMD" }, + { 0x03, "IWX_INIT_EXTENDED_CFG_CMD" }, + { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" }, + { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" }, + { 0, NULL } +}; + +/* MAC_CONF group subcommand IDs */ +static struct opcode_label macconf_opcodes[] = { + { 0x05, "IWX_SESSION_PROTECTION_CMD" }, + { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" }, + { 0, NULL } +}; + +/* DATA_PATH group subcommand IDs */ +static struct opcode_label data_opcodes[] = { + { 0x00, "IWX_DQA_ENABLE_CMD" }, + { 0x08, "IWX_RLC_CONFIG_CMD" }, + { 0x0f, "IWX_TLC_MNG_CONFIG_CMD" }, + { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" }, + { 0x17, "IWX_SCD_QUEUE_CONFIG_CMD" }, + { 0xf5, "IWX_RX_NO_DATA_NOTIF" }, + { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" }, + { 0xf7, "IWX_TLC_MNG_UPDATE_NOTIF" }, + { 0, NULL } +}; + +/* REGULATORY_AND_NVM group subcommand IDs */ +static struct opcode_label reg_opcodes[] = { + { 0x00, "IWX_NVM_ACCESS_COMPLETE" }, + { 0x02, "IWX_NVM_GET_INFO " }, + { 0xfe, "IWX_PNVM_INIT_COMPLETE" }, + { 0, NULL } +}; + +/* PHY_OPS subcommand IDs */ +static struct opcode_label phyops_opcodes[] = { + {0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE"}, + {0x03, "IWX_CTDP_CONFIG_CMD"}, + {0x04, "IWX_TEMP_REPORTING_THRESHOLDS_CMD"}, + {0xFE, "IWX_CT_KILL_NOTIFICATION"}, + {0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE"}, +}; static const char * get_label(struct opcode_label *table, uint8_t opcode) @@ -87,9 +235,9 @@ get_table(uint8_t group) } void -print_opcode(const char *func, int line, int type, uint32_t code) +print_opcode(const char *func, int line, uint32_t code) { - int print = print_mask & type; + int print = 0; uint8_t opcode = iwx_cmd_opcode(code); uint8_t group = iwx_cmd_groupid(code); @@ -104,111 +252,12 @@ print_opcode(const char *func, int line, int type, uint32_t code) print = 1; if (print) { - printf("%s:%d %s\t%s\t%s\t(0x%08x)\n", func, line, - iwx_bbl_to_str(type), get_label(command_group, group), + printf("%s:%d \t%s\t%s\t(0x%08x)\n", func, line, + get_label(command_group, group), get_label(table, opcode), code); } } -void -iwx_dump_cmd(uint32_t id, void *data, uint16_t len, const char *str, int type) -{ - int dump = dump_mask & type; - uint8_t opcode = iwx_cmd_opcode(id); - uint8_t group = iwx_cmd_groupid(id); - - for (int i = 0; i < nitems(dump_codes); i++) - if (dump_codes[i][0] == group && dump_codes[i][1] == opcode) - dump = 1; - - if (dump) - hexdump(data, len, str, 0); -} - -void -iwx_bbl_add_entry(uint32_t code, int type, int ticks) -{ - /* - * Compress together repeated notifications, but increment the sequence - * number so we can track things processing. - */ - if (bbl_compress && (iwx_bb_log[bbl_idx].code == code && - iwx_bb_log[bbl_idx].type == type)) { - iwx_bb_log[bbl_idx].count++; - iwx_bb_log[bbl_idx].seq = bbl_seq++; - iwx_bb_log[bbl_idx].ticks = ticks; - return; - } - - if (bbl_idx++ > IWX_BBL_ENTRIES) { -#if 0 - printf("iwx bbl roll over: type %d (%lu)\n", type, code); -#endif - bbl_idx = 0; - } - iwx_bb_log[bbl_idx].code = code; - iwx_bb_log[bbl_idx].type = type; - iwx_bb_log[bbl_idx].seq = bbl_seq++; - iwx_bb_log[bbl_idx].ticks = ticks; - iwx_bb_log[bbl_idx].count = 1; -} - -static void -iwx_bbl_print_entry(struct iwx_bbl_entry *e) -{ - uint8_t opcode = iwx_cmd_opcode(e->code); - uint8_t group = iwx_cmd_groupid(e->code); - - switch(e->type) { - case IWX_BBL_PKT_TX: - printf("pkt "); - printf("seq %08d\t pkt len %u", - e->seq, e->code); - break; - printf("pkt dup "); - printf("seq %08d\t dup count %u", - e->seq, e->code); - break; - case IWX_BBL_CMD_TX: - printf("tx -> "); - printf("seq %08d\tcode 0x%08x (%s:%s)", - e->seq, e->code, get_label(command_group, group), - get_label(get_table(group), opcode)); - break; - case IWX_BBL_CMD_RX: - printf("rx "); - printf("seq %08d\tcode 0x%08x (%s:%s)", - e->seq, e->code, get_label(command_group, group), - get_label(get_table(group), opcode)); - break; - } - if (e->count > 1) - printf(" (count %d)", e->count); - printf("\n"); -} - -void -iwx_bbl_print_log(void) -{ - int start = -1; - - start = bbl_idx+1; - if (start > IWX_BBL_ENTRIES-1) - start = 0; - - for (int i = start; i < IWX_BBL_ENTRIES; i++) { - struct iwx_bbl_entry *e = &iwx_bb_log[i]; - printf("bbl entry %05d %05d: ", i, e->ticks); - iwx_bbl_print_entry(e); - } - for (int i = 0; i < start; i++) { - struct iwx_bbl_entry *e = &iwx_bb_log[i]; - printf("bbl entry %05d %05d: ", i, e->ticks); - iwx_bbl_print_entry(e); - } - printf("iwx bblog index %d seq %d\n", bbl_idx, bbl_seq); -} - void print_ratenflags(const char *func, int line, uint32_t flags, int ver) { diff --git a/sys/dev/iwx/if_iwx_debug.h b/sys/dev/iwx/if_iwx_debug.h index 80fd3ffa6eed..0079a7e7e753 100644 --- a/sys/dev/iwx/if_iwx_debug.h +++ b/sys/dev/iwx/if_iwx_debug.h @@ -53,213 +53,7 @@ enum { #define IWX_DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0) #endif -void print_opcode(const char *, int, int, uint32_t); +void print_opcode(const char *, int, uint32_t); void print_ratenflags(const char *, int , uint32_t , int ); -void iwx_dump_cmd(uint32_t , void *, uint16_t, const char *, int); -void iwx_bbl_add_entry(uint32_t, int, int); -void iwx_bbl_print_log(void); - -#define IWX_BBL_NONE 0x00 -#define IWX_BBL_PKT_TX 0x01 -#define IWX_BBL_PKT_RX 0x02 -#define IWX_BBL_PKT_DUP 0x04 -#define IWX_BBL_CMD_TX 0x10 -#define IWX_BBL_CMD_RX 0x20 -#define IWX_BBL_ANY 0xFF - -static int print_mask = IWX_BBL_NONE; //IWX_BBL_NONE | IWX_BBL_CMD_TX; -static int print_codes[][2] = { -#if 0 - for example: - IWX_LEGACY_GROUP, IWX_ADD_STA_KEY, - IWX_LEGACY_GROUP, IWX_SCD_QUEUE_CONFIG_CMD, - IWX_LEGACY_GROUP, IWX_ADD_STA, - IWX_LEGACY_GROUP, IWX_REMOVE_STA, -#endif -}; - -static int dump_mask = IWX_BBL_NONE; -static int dump_codes[][2] = { -#if 0 - for example: - IWX_LEGACY_GROUP, IWX_ADD_STA_KEY, - IWX_LEGACY_GROUP, IWX_SCD_QUEUE_CONFIG_CMD, - IWX_LEGACY_GROUP, IWX_ADD_STA, - IWX_LEGACY_GROUP, IWX_REMOVE_STA, -#endif -}; - -struct opcode_label { - uint8_t opcode; - const char *label; -}; - -static struct opcode_label command_group[] = { - { 0x0, "IWX_LEGACY_GROUP"}, - { 0x1, "IWX_LONG_GROUP"}, - { 0x2, "IWX_SYSTEM_GROUP"}, - { 0x3, "IWX_MAC_CONF_GROUP"}, - { 0x4, "IWX_PHY_OPS_GROUP"}, - { 0x5, "IWX_DATA_PATH_GROUP"}, - { 0xb, "IWX_PROT_OFFLOAD_GROUP"}, - { 0xc, "IWX_REGULATORY_AND_NVM_GROUP"}, - { 0, NULL } -}; - -static struct opcode_label legacy_opcodes[] = { - { 0xc0, "IWX_REPLY_RX_PHY_CMD" }, - { 0xc1, "IWX_REPLY_RX_MPDU_CMD" }, - { 0xc2, "IWX_BAR_FRAME_RELEASE" }, - { 0xc3, "IWX_FRAME_RELEASE" }, - { 0xc5, "IWX_BA_NOTIF" }, - { 0x62, "IWX_TEMPERATURE_NOTIFICATION" }, - { 0xc8, "IWX_MCC_UPDATE_CMD" }, - { 0xc9, "IWX_MCC_CHUB_UPDATE_CMD" }, - { 0x65, "IWX_CALIBRATION_CFG_CMD" }, - { 0x66, "IWX_CALIBRATION_RES_NOTIFICATION" }, - { 0x67, "IWX_CALIBRATION_COMPLETE_NOTIFICATION" }, - { 0x68, "IWX_RADIO_VERSION_NOTIFICATION" }, - { 0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE" }, - { 0x01, "IWX_SOC_CONFIGURATION_CMD" }, - { 0x02, "IWX_REPLY_ERROR" }, - { 0x03, "IWX_CTDP_CONFIG_CMD" }, - { 0x04, "IWX_INIT_COMPLETE_NOTIF" }, - { 0x05, "IWX_SESSION_PROTECTION_CMD" }, - { 0x5d, "IWX_BT_COEX_CI" }, - { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" }, - { 0x08, "IWX_RLC_CONFIG_CMD" }, - { 0xd0, "IWX_MCAST_FILTER_CMD" }, - { 0xd1, "IWX_REPLY_SF_CFG_CMD" }, - { 0xd2, "IWX_REPLY_BEACON_FILTERING_CMD" }, - { 0xd3, "IWX_D3_CONFIG_CMD" }, - { 0xd4, "IWX_PROT_OFFLOAD_CONFIG_CMD" }, - { 0xd5, "IWX_OFFLOADS_QUERY_CMD" }, - { 0xd6, "IWX_REMOTE_WAKE_CONFIG_CMD" }, - { 0x77, "IWX_POWER_TABLE_CMD" }, - { 0x78, "IWX_PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION" }, - { 0xcc, "IWX_BT_COEX_PRIO_TABLE" }, - { 0xcd, "IWX_BT_COEX_PROT_ENV" }, - { 0xce, "IWX_BT_PROFILE_NOTIFICATION" }, - { 0x6a, "IWX_PHY_CONFIGURATION_CMD" }, - { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" }, - { 0x17, "IWX_ADD_STA_KEY" }, - { 0x18, "IWX_ADD_STA" }, - { 0x19, "IWX_REMOVE_STA" }, - { 0xe0, "IWX_WOWLAN_PATTERNS" }, - { 0xe1, "IWX_WOWLAN_CONFIGURATION" }, - { 0xe2, "IWX_WOWLAN_TSC_RSC_PARAM" }, - { 0xe3, "IWX_WOWLAN_TKIP_PARAM" }, - { 0xe4, "IWX_WOWLAN_KEK_KCK_MATERIAL" }, - { 0xe5, "IWX_WOWLAN_GET_STATUSES" }, - { 0xe6, "IWX_WOWLAN_TX_POWER_PER_DB" }, - { 0x0f, "IWX_SCAN_COMPLETE_UMAC" }, - { 0x88, "IWX_NVM_ACCESS_CMD" }, - { 0x20, "IWX_WEP_KEY" }, - { 0xdc, "IWX_CMD_DTS_MEASUREMENT_TRIGGER" }, - { 0xdd, "IWX_DTS_MEASUREMENT_NOTIFICATION" }, - { 0x28, "IWX_MAC_CONTEXT_CMD" }, - { 0x29, "IWX_TIME_EVENT_CMD" }, - { 0x01, "IWX_ALIVE" }, - { 0xf0, "IWX_REPLY_DEBUG_CMD" }, - { 0x90, "IWX_BEACON_NOTIFICATION" }, - { 0xf5, "IWX_RX_NO_DATA_NOTIF" }, - { 0x08, "IWX_PHY_CONTEXT_CMD" }, - { 0x91, "IWX_BEACON_TEMPLATE_CMD" }, - { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" }, - { 0x09, "IWX_DBG_CFG" }, - { 0xf7, "IWX_DEBUG_LOG_MSG" }, - { 0x1c, "IWX_TX_CMD" }, - { 0x1d, "IWX_SCD_QUEUE_CFG" }, - { 0x1e, "IWX_TXPATH_FLUSH" }, - { 0x1f, "IWX_MGMT_MCAST_KEY" }, - { 0x98, "IWX_TX_ANT_CONFIGURATION_CMD" }, - { 0xee, "IWX_LTR_CONFIG" }, - { 0x8e, "IWX_SET_CALIB_DEFAULT_CMD" }, - { 0xFE, "IWX_CT_KILL_NOTIFICATION" }, - { 0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE" }, - { 0x2a, "IWX_TIME_EVENT_NOTIFICATION" }, - { 0x2b, "IWX_BINDING_CONTEXT_CMD" }, - { 0x2c, "IWX_TIME_QUOTA_CMD" }, - { 0x2d, "IWX_NON_QOS_TX_COUNTER_CMD" }, - { 0xa0, "IWX_CARD_STATE_CMD" }, - { 0xa1, "IWX_CARD_STATE_NOTIFICATION" }, - { 0xa2, "IWX_MISSED_BEACONS_NOTIFICATION" }, - { 0x0c, "IWX_SCAN_CFG_CMD" }, - { 0x0d, "IWX_SCAN_REQ_UMAC" }, - { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" }, - { 0x0e, "IWX_SCAN_ABORT_UMAC" }, - { 0xfe, "IWX_PNVM_INIT_COMPLETE" }, - { 0xa9, "IWX_MAC_PM_POWER_TABLE" }, - { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" }, - { 0x9b, "IWX_BT_CONFIG" }, - { 0x9c, "IWX_STATISTICS_CMD" }, - { 0x9d, "IWX_STATISTICS_NOTIFICATION" }, - { 0x9f, "IWX_REDUCE_TX_POWER_CMD" }, - { 0xb1, "IWX_MFUART_LOAD_NOTIFICATION" }, - { 0xb5, "IWX_SCAN_ITERATION_COMPLETE_UMAC" }, - { 0x54, "IWX_NET_DETECT_CONFIG_CMD" }, - { 0x56, "IWX_NET_DETECT_PROFILES_QUERY_CMD" }, - { 0x57, "IWX_NET_DETECT_PROFILES_CMD" }, - { 0x58, "IWX_NET_DETECT_HOTSPOTS_CMD" }, - { 0x59, "IWX_NET_DETECT_HOTSPOTS_QUERY_CMD" }, - { 0, NULL } -}; - -/* SYSTEM_GROUP group subcommand IDs */ -static struct opcode_label system_opcodes[] = { - { 0x00, "IWX_SHARED_MEM_CFG_CMD" }, - { 0x01, "IWX_SOC_CONFIGURATION_CMD" }, - { 0x03, "IWX_INIT_EXTENDED_CFG_CMD" }, - { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" }, - { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" }, - { 0, NULL } -}; - -/* MAC_CONF group subcommand IDs */ -static struct opcode_label macconf_opcodes[] = { - { 0x05, "IWX_SESSION_PROTECTION_CMD" }, - { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" }, - { 0, NULL } -}; - -/* DATA_PATH group subcommand IDs */ -static struct opcode_label data_opcodes[] = { - { 0x00, "IWX_DQA_ENABLE_CMD" }, - { 0x08, "IWX_RLC_CONFIG_CMD" }, - { 0x0f, "IWX_TLC_MNG_CONFIG_CMD" }, - { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" }, - { 0x17, "IWX_SCD_QUEUE_CONFIG_CMD" }, - { 0xf5, "IWX_RX_NO_DATA_NOTIF" }, - { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" }, - { 0xf7, "IWX_TLC_MNG_UPDATE_NOTIF" }, - { 0, NULL } -}; - -/* REGULATORY_AND_NVM group subcommand IDs */ -static struct opcode_label reg_opcodes[] = { - { 0x00, "IWX_NVM_ACCESS_COMPLETE" }, - { 0x02, "IWX_NVM_GET_INFO " }, - { 0xfe, "IWX_PNVM_INIT_COMPLETE" }, - { 0, NULL } -}; - -/* PHY_OPS subcommand IDs */ -static struct opcode_label phyops_opcodes[] = { - {0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE"}, - {0x03, "IWX_CTDP_CONFIG_CMD"}, - {0x04, "IWX_TEMP_REPORTING_THRESHOLDS_CMD"}, - {0xFE, "IWX_CT_KILL_NOTIFICATION"}, - {0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE"}, -}; - -struct iwx_bbl_entry { - uint8_t type; - uint32_t code; - uint32_t seq; - uint32_t ticks; - uint32_t count; -}; -#define IWX_BBL_ENTRIES 2000 -static struct iwx_bbl_entry iwx_bb_log[IWX_BBL_ENTRIES]; #endif /* __IF_IWX_DEBUG_H__ */