From patchwork Thu Jan 5 10:37:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 39473 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp234404wrt; Thu, 5 Jan 2023 02:42:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXtCnM7tBGnHqorqzG24mQZObn3gxKHHmT4dSQ/Jo06uMCnRZOtm/b/fv5qLdXQ82z0RVO+x X-Received: by 2002:a17:90a:af91:b0:219:de9b:f397 with SMTP id w17-20020a17090aaf9100b00219de9bf397mr55464192pjq.3.1672915327771; Thu, 05 Jan 2023 02:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672915327; cv=none; d=google.com; s=arc-20160816; b=wIdeTM5KWGyB0rfizsdzBWt7dqiSi5AjRhQljLTo2+O0ZCLjwB/+a/nsL69snwRoVl 2iV0VLUsU2uX37jZctc1U+p5ELlBb031+cSxrKZ8yfvMGsAoQ3mFyqSIupTjz2f0vU9d eGPgrv1e6qFC+/kYGj9WK4YAy/4sjNc8oin7PCFAszHiAONVekg7TuB7Y8n3iFTnbCUc WbhfoRRki6A95p2+j9qOM09TqqQ8OY1PPOzD0k2kmrSftSg0KMsiqKL/M9ZqerOvG6Vi HKa3b3ffp/DjGYzOxNvAzAuMH3aZqrp43/Lw93JQFelHqWDl4Izp6b5LAyL2ASSHAsqR IWKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=Z+UJBfU/8l7fpxJzETJJj+Hr/lkYjP0wgmBYzutEocw=; b=UNX6iS3+xoSR8BPs6GU7/Gusoqbb7joxZVTz394KqaFDOHGc2+ZhL/jLIje2j4VOAl eVOKckP9lZHNmq5+saOMa9Td5TLNB6Mwg12LA1DYAWmwJiVrudB+F9ncVCmBdYrTE5t3 i128DwE6TJJdp5piq1KxGhg18B0ZabBBsiECHAHq4UFvLuEaZskArBecrhpQKXPQ5Ejl c+Jw7yG/ocZ4S6OgOkiO3cG+aNG+m9Uu9nBR9n/lZ/OcOixc1uTWGmciXKJcidoZaeK4 xrE121no1eJfLMBwpJu4r+NWNrbMnahLSB4NPgeFOmbhCHyos08CL9uq+n34TEYoxaSt I9KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=V9egSrOF; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020a17090acf1300b00225e6117a20si1563809pju.25.2023.01.05.02.41.55; Thu, 05 Jan 2023 02:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=V9egSrOF; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232947AbjAEKiq (ORCPT + 99 others); Thu, 5 Jan 2023 05:38:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233062AbjAEKiS (ORCPT ); Thu, 5 Jan 2023 05:38:18 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841773D9D3 for ; Thu, 5 Jan 2023 02:38:17 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672915096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z+UJBfU/8l7fpxJzETJJj+Hr/lkYjP0wgmBYzutEocw=; b=V9egSrOFJEbDO1+JjPphw36K4ufP/XN2d3lp5A8JMAHXg9jcUdL3dbyQp4feXHjXf3k5MK b8+f3ILzJF1dVYm6dCyRtwbPNJkSxI+apJ+oKp+pk3dVYiEuvZA5PgNIb+c4wc/6xNUxwb I5CZ3gDz03F/gjJxWDW8WY4mHk8P8eM8tFNUk7xaAMRyWK7faBap84DbmJant5mvNQvkTj yPNwVHzLL1zfRNk3AiP6ZQEXwbenpIPPscUCYOkG3vAzzRgXa01FZRtgL3ktCSPz9xNiNo mLZv87YHiFbb+WRImmO0dZVcZMGg4Kt4fGIBQfAkIQdm1vXjPK0uZtGCZpsa1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672915096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z+UJBfU/8l7fpxJzETJJj+Hr/lkYjP0wgmBYzutEocw=; b=tzeP+Qq74Q1FePBoqTmV4oz8bIVL4B7nq1CqqR/2JbsAQsxDO6zja9DhMzb6V0q8MZ/Ryw h63Q3Le6yJtQXLAg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH printk v4 3/8] console: Document struct console Date: Thu, 5 Jan 2023 11:43:30 +0106 Message-Id: <20230105103735.880956-4-john.ogness@linutronix.de> In-Reply-To: <20230105103735.880956-1-john.ogness@linutronix.de> References: <20230105103735.880956-1-john.ogness@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754178862900686320?= X-GMAIL-MSGID: =?utf-8?q?1754178862900686320?= From: Thomas Gleixner Add kerneldoc comments to struct console. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- include/linux/console.h | 54 ++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/include/linux/console.h b/include/linux/console.h index ed804dd7c2e8..1e36958aa656 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -164,24 +164,44 @@ enum cons_flags { CON_EXTENDED = BIT(6), }; +/** + * struct console - The console descriptor structure + * @name: The name of the console driver + * @write: Write callback to output messages (Optional) + * @read: Read callback for console input (Optional) + * @device: The underlying TTY device driver (Optional) + * @unblank: Callback to unblank the console (Optional) + * @setup: Callback for initializing the console (Optional) + * @exit: Callback for teardown of the console (Optional) + * @match: Callback for matching a console (Optional) + * @flags: Console flags. See enum cons_flags + * @index: Console index, e.g. port number + * @cflag: TTY control mode flags + * @ispeed: TTY input speed + * @ospeed: TTY output speed + * @seq: Sequence number of the next ringbuffer record to print + * @dropped: Number of unreported dropped ringbuffer records + * @data: Driver private data + * @node: hlist node for the console list + */ struct console { - char name[16]; - void (*write)(struct console *, const char *, unsigned); - int (*read)(struct console *, char *, unsigned); - struct tty_driver *(*device)(struct console *, int *); - void (*unblank)(void); - int (*setup)(struct console *, char *); - int (*exit)(struct console *); - int (*match)(struct console *, char *name, int idx, char *options); - short flags; - short index; - int cflag; - uint ispeed; - uint ospeed; - u64 seq; - unsigned long dropped; - void *data; - struct hlist_node node; + char name[16]; + void (*write)(struct console *co, const char *s, unsigned int count); + int (*read)(struct console *co, char *s, unsigned int count); + struct tty_driver *(*device)(struct console *co, int *index); + void (*unblank)(void); + int (*setup)(struct console *co, char *options); + int (*exit)(struct console *co); + int (*match)(struct console *co, char *name, int idx, char *options); + short flags; + short index; + int cflag; + uint ispeed; + uint ospeed; + u64 seq; + unsigned long dropped; + void *data; + struct hlist_node node; }; #ifdef CONFIG_LOCKDEP