From patchwork Wed Nov 23 23:13:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 25239 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3080662wrr; Wed, 23 Nov 2022 15:17:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf48MgKeMu5DZB05PcqHGti/I3s5sRSmNKimGUrF7eNJ35Ul+x1uejDCOGAGn4SnJ7f/BS4K X-Received: by 2002:a05:6402:3226:b0:461:37c2:e85c with SMTP id g38-20020a056402322600b0046137c2e85cmr18771401eda.74.1669245438047; Wed, 23 Nov 2022 15:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669245438; cv=none; d=google.com; s=arc-20160816; b=tSeba6DhC8S1GZF1tYyTa5eqvvDgxXa+X90NWp7FSyoLaO/mxAQCxOZKJ3fTdNQHAv XrRop2D5+pwJjsp21JZQZwURuVYMnkQfttjH+l+lt5fich6YAbLGdN1uaJIFNBEgJwgL eyqLFOHCK/1bKqA3LH/wh9zCb2cd20npUKmMiJu3Y9KmFJg5Q1HwYBk2k95bzejPvdmK WOCf+7Cn2j4eTQDI8ADTBQLGW3pmPVOrXIvDbHw//vGiRLDYzmFOk9v00S7ZtODK1bC0 C7f4vVUBbnypK2FW9aSb3w6LQHD7arQeD79QuEPwyudR4GClLvVj9pscwDDadU90qSMK e17Q== 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=j15phA1lmvkZMkDgT4Ymay4UivTflRDgylXp+daG2hk=; b=m5m7ZPEgM7E4Hoy7X/xOlPxjjkX6FltrF7Z9EZyFGUsGB+JtmC1hdGoxudKYzeFJCa ZDZylAW4x22udaqLq/j2SVayR+6Tg1oH0FRpNxvAnLzB5+e8ZIIW1U9ix9m39ONlEgVh GPEotROx+9z2gk4gyBiltZkYVHyFE7jSt1AkfcqJ9b0O2RgJ48WWHZspo/5sFKBJPYO/ fyGNkua4kFTfKB8XPdJwWDK7PcjbyrLXPqx6Tv1TepH+G5ztDcND0mtynndBo8xvbsk+ ZDGo8G0f1QDCJvAJ3fGP3TFQ+d8SaO5cFpUWJheFGLZjtkFeEgTIh0xfJLjjkN2TxJZL c75A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tC75imPv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=HjI+6lRU; 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 dp17-20020a170906c15100b00791a41d1b39si16807901ejc.656.2022.11.23.15.16.53; Wed, 23 Nov 2022 15:17:18 -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=tC75imPv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=HjI+6lRU; 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 S229842AbiKWXO1 (ORCPT + 99 others); Wed, 23 Nov 2022 18:14:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbiKWXOP (ORCPT ); Wed, 23 Nov 2022 18:14:15 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 652D9BCDF1 for ; Wed, 23 Nov 2022 15:14:14 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669245252; 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=j15phA1lmvkZMkDgT4Ymay4UivTflRDgylXp+daG2hk=; b=tC75imPv7KTPVlhTdENOrDnePftFnntPZqtOo7lXs8ITaY4oNHRqw1ZsSB5hamb6Bkb0gd 2zixhJ0bY3k88YMItL69goWwRxiL4CESyvF+ZytQQOa1BxxrQC1P5U1/dQ2LW++qbXgy4p htcVDjnh50BOPr4dOSv9hCzNjCIWA1Z5wY/0/tVjfbm+v6rehUDBoOBcrl+XSOypLI7hvU yMygGWWhxw5Do3Nq5gzqNgFZ4WFXwpombaPzhZIQkqo9LWY9lm3zm9gpuvqPRMyOdCwKqV FtLs0esGtSBhJurR5GSasRoXVcUm/o8hXLRTEZFPpJK8Ox/BgbhowIb51C6lVQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669245252; 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=j15phA1lmvkZMkDgT4Ymay4UivTflRDgylXp+daG2hk=; b=HjI+6lRUyAYxQIumILednEjKM+aPeEeewy5p9ga2fhkB5bUNDm/Q2UScBZniOqI6yz1ggy wAec0LLVJTqzfpCQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH printk v2 3/7] console: Document struct console Date: Thu, 24 Nov 2022 00:19:56 +0106 Message-Id: <20221123231400.614679-4-john.ogness@linutronix.de> In-Reply-To: <20221123231400.614679-1-john.ogness@linutronix.de> References: <20221123231400.614679-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?1750330704423085181?= X-GMAIL-MSGID: =?utf-8?q?1750330704423085181?= 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 f7a14ea6bae0..b2cf256c23b6 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -178,24 +178,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 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