Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp625078lqp; Sun, 9 Jun 2024 11:25:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtpLGghz+tTiClBDx6/pf+qNdmWUV1MQkMmo4VrCqu3rN7m8hbh78lBjwKiv6JuiSjk6Vi+6GwSW5nzfvXcbOlfq0OhW8NfMLk58twtA== X-Google-Smtp-Source: AGHT+IESiZ0x3Vs2JcGprs2za6lup63GrgXAZBRI+y0SzVVKGu3Op62zI316bib4LLJO2MrerB8L X-Received: by 2002:a05:6a20:7350:b0:1ad:6c5:4ea1 with SMTP id adf61e73a8af0-1b2f9c6e31dmr9506715637.41.1717957499970; Sun, 09 Jun 2024 11:24:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717957499; cv=pass; d=google.com; s=arc-20160816; b=OajYnBVfUzOQi9yzHP8ST4jxQbuFPOi3uz/dg/4w8c/1fZm/atzrbJmFe2z1NBSPOL dZS1HpJeRIM/kLmAE+g73hHHopGgRfwaM6AqJVDc2NaYDEKegE7PsHN13e36GcF+u2Ju DZANfD3u5gDlxztgKGh7GebOSJR35+KwxjZWTOLZPelmOPrVVO9VZoKZomSZOFkWgmdG GAw5Noq+QLb0pxwJIhvYmP+k/ANfu6WAISWkpTJ8WBJ3L3z76l2WA1g5ntI+LB150xY6 wFSGc5Vf8H0QTJLpi48XuGK/MJzHfrJd7ZPWFedZbEy+tfQbxxxj5Oom3wzX27yz8Thx ZQOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HYGuuBoePx44We64nuR+IzZWZgaVxiz1hWFxFIVedUA=; fh=JHJVNrTWTEYl60imetPu7nznRrru2uSV/y1JimK7NGc=; b=HKS+tzlRlQBqMNRtHbtnP3ccXxjflWJMhCDyTjYrhNcgB2H70pTNkC8avxF4x10L6S RoZRIxNCu06nW7Ov1JE64anzMKVtgGyNpCkjp/JBjnFTxo5QioRlx5nuQOxLzooZh71D CqJMdfEv11lHy5um4cF9urc798kpKE0m3jWqdOdTGyi3bN3tZJK97Z7DfbrMcEflI1jh 75+vek5Vn8g4uF3GzDguIx1N+bhZ8RI4QfYWY8HyzmiwjGk6VKJ/KC8EksPN6621tG3Y B8PDlkXV8gtP+SvzavUY893EUAyCqE2d1pwkPvOTJytH1cbWdFWWBCQ2ngObcgMHaDeY +nKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SFe0Fq3s; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-wireless+bounces-8724-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e7a299e7b1si2851042a12.128.2024.06.09.11.24.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 11:24:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8724-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SFe0Fq3s; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-wireless+bounces-8724-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2408CB20E1E for ; Sun, 9 Jun 2024 18:24:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CAE750275; Sun, 9 Jun 2024 18:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="SFe0Fq3s" X-Original-To: linux-wireless@vger.kernel.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3B7AE57D; Sun, 9 Jun 2024 18:22:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717957375; cv=none; b=b8+8jMU6GW5Dt+95c1FCzgTkF2Tw2hRl1eO/jDmalCcR9YNF0pbFf1HUb0xMk0lBHd/nOSlnjr1/09PGlquxHQzY0Dv/wSQjTkdYhUkP40ILIrHdACjjMx7FX1MdZCktECsGFqxer4HvO3UiI7y1kjX0AWjxExmtPHZ6PY4qDUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717957375; c=relaxed/simple; bh=5HeIfH04EkxerFQeJZzdfSPNA6luupHO4SUYrAzqReg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bmd+hVgKeT5zgPYiYPCnEdTfuVb069R5N8ZHjzfQ6Hi665UZaXCvb9uL1ns/oUAYq5HBykFuNTiqbiD2utswqkVV34p3XmoslzX6O3JBFfGeUAvL0FOCyyLNC/wzi8rS4KGEA2Mk2kE8JTzv03bb8Afn5JKQy4Fn4Ei8w5d0New= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=SFe0Fq3s; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 459IMXur075084; Sun, 9 Jun 2024 13:22:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717957353; bh=HYGuuBoePx44We64nuR+IzZWZgaVxiz1hWFxFIVedUA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SFe0Fq3s2MZDNLEhudlxYIfcAPD2n1j8UOQGvB3bPk3Fuz5cOgd1wvtauOZlaenoZ uJrS0fOCcvQY+Qk7STXnfkt8wznfabqz3nX1bz1/2sYza6/B8WQuU8CDrxlv7G0wzt oFD3Y/ZHMyzoYI+G1k/pRNifvqxEAlAqofao/2Ro= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 459IMXrg058691 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 9 Jun 2024 13:22:33 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Sun, 9 Jun 2024 13:22:33 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Sun, 9 Jun 2024 13:22:33 -0500 Received: from localhost (uda0389739.dhcp.ti.com [137.167.1.114]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 459IMWrv067565; Sun, 9 Jun 2024 13:22:33 -0500 From: To: Sabeeh Khan , Kalle Valo , Johannes Berg , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , Michael Nemanov Subject: [PATCH v2 02/17] wifi: cc33xx: Add debug.h Date: Sun, 9 Jun 2024 21:20:47 +0300 Message-ID: <20240609182102.2950457-3-michael.nemanov@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240609182102.2950457-1-michael.nemanov@ti.com> References: <20240609182102.2950457-1-michael.nemanov@ti.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 From: Michael Nemanov These are trace macros used throughout the driver. --- drivers/net/wireless/ti/cc33xx/debug.h | 92 ++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 drivers/net/wireless/ti/cc33xx/debug.h diff --git a/drivers/net/wireless/ti/cc33xx/debug.h b/drivers/net/wireless/ti/cc33xx/debug.h new file mode 100644 index 000000000000..53b2168c04c7 --- /dev/null +++ b/drivers/net/wireless/ti/cc33xx/debug.h @@ -0,0 +1,92 @@ +/* SPDX-License-Identifier: GPL-2.0-only + * + * Copyright (C) 2022-2024 Texas Instruments Incorporated - https://www.ti.com/ + */ + +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + +#define DRIVER_NAME "cc33xx" +#define DRIVER_PREFIX DRIVER_NAME ": " + +enum { + DEBUG_NONE = 0, + DEBUG_IRQ = BIT(0), + DEBUG_SPI = BIT(1), + DEBUG_BOOT = BIT(2), + DEBUG_CORE_STATUS = BIT(3), + DEBUG_TESTMODE = BIT(4), + DEBUG_EVENT = BIT(5), + DEBUG_TX = BIT(6), + DEBUG_RX = BIT(7), + DEBUG_SCAN = BIT(8), + DEBUG_CRYPT = BIT(9), + DEBUG_PSM = BIT(10), + DEBUG_MAC80211 = BIT(11), + DEBUG_CMD = BIT(12), + DEBUG_ACX = BIT(13), + DEBUG_SDIO = BIT(14), + DEBUG_FILTERS = BIT(15), + DEBUG_ADHOC = BIT(16), + DEBUG_AP = BIT(17), + DEBUG_PROBE = BIT(18), + DEBUG_IO = BIT(19), + DEBUG_MASTER = (DEBUG_ADHOC | DEBUG_AP), + DEBUG_CC33xx = BIT(20), + DEBUG_ALL = GENMASK(31, 0), + DEBUG_NO_DATAPATH = (DEBUG_ALL & ~DEBUG_IRQ & ~DEBUG_TX & ~DEBUG_RX & ~DEBUG_CORE_STATUS), +}; + +extern u32 cc33xx_debug_level; + +#define DEBUG_DUMP_LIMIT 1024 + +#define cc33xx_error(fmt, arg...) \ + pr_err(DRIVER_PREFIX "ERROR " fmt "\n", ##arg) + +#define cc33xx_warning(fmt, arg...) \ + pr_warn(DRIVER_PREFIX "WARNING " fmt "\n", ##arg) + +#define cc33xx_notice(fmt, arg...) \ + pr_info(DRIVER_PREFIX fmt "\n", ##arg) + +#define cc33xx_info(fmt, arg...) \ + pr_info(DRIVER_PREFIX fmt "\n", ##arg) + +/* define the debug macro differently if dynamic debug is supported */ +#if defined(CONFIG_DYNAMIC_DEBUG) +#define cc33xx_debug(level, fmt, arg...) \ + do { \ + if (unlikely((level) & cc33xx_debug_level)) \ + dynamic_pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \ + } while (0) +#else +#define cc33xx_debug(level, fmt, arg...) \ + do { \ + if (unlikely((level) & cc33xx_debug_level)) \ + pr_debug(pr_fmt(DRIVER_PREFIX fmt "\n"), \ + ##arg); \ + } while (0) +#endif /* CONFIG_DYNAMIC_DEBUG */ + +#define cc33xx_dump(level, prefix, buf, len) \ + do { \ + if ((level) & cc33xx_debug_level) \ + print_hex_dump_debug(DRIVER_PREFIX prefix, \ + DUMP_PREFIX_OFFSET, 16, 1, \ + buf, \ + min_t(size_t, len, DEBUG_DUMP_LIMIT), \ + 0); \ + } while (0) + +#define cc33xx_dump_ascii(level, prefix, buf, len) \ + do { \ + if ((level) & cc33xx_debug_level) \ + print_hex_dump_debug(DRIVER_PREFIX prefix, \ + DUMP_PREFIX_OFFSET, 16, 1, \ + buf, \ + min_t(size_t, len, DEBUG_DUMP_LIMIT), \ + true); \ + } while (0) + +#endif /* __DEBUG_H__ */ -- 2.25.1