From: Ed Vance <EdV@macrolink.com>
To: "'Alan Cox'" <alan@lxorguk.ukuu.org.uk>
Cc: "'linux-serial'" <linux-serial@vger.kernel.org>,
"'linux-kernel'" <linux-kernel@vger.kernel.org>,
"'Russell King'" <rmk@arm.linux.org.uk>
Subject: [PATCH] serial driver procfs
Date: Thu, 14 Mar 2002 17:11:01 -0800 [thread overview]
Message-ID: <11E89240C407D311958800A0C9ACF7D13A7705@EXCHANGE> (raw)
Please pummel this patch into the next 2.4.19-preX.
Serial driver procfs patch
This patch changes text generated by the generic serial driver for the
/proc/tty/driver/serial interface. Now generates correct address and
port statistics fields for memory mapped devices. Displays only ports
claimed by driver. Prevents kudzu crash at pciserial.c:78 when memory
mapped devices are present, due to missing fields in text line and
missing check of string search result in kudzu.
Example - before:
"1: uart:16550A port:02F8 irq:3 tx:0 rx:0 " (I/O space)
"4: uart:16C950/954 port:0 irq:14" (memory space)
"44: uart:unknown port:0 irq:0" (not claimed)
Example - after:
"1: uart:16550A port:02F8 irq:3 tx:0 rx:0 " (I/O port)
"4: uart:16C950/954 port:C4800000 irq:14 tx:0 rx:0 " (memory space)
Created on kernel files rev 2.4.19-pre3
Contributor: Ed Vance [serial24@macrolink.com]
diff -urN -X dontdiff.txt linux-2.4.19-pre3/drivers/char/serial.c
patched/drivers/char/serial.c
--- linux-2.4.19-pre3/drivers/char/serial.c Sat Mar 2 10:38:11 2002
+++ patched/drivers/char/serial.c Thu Mar 14 15:05:52 2002
@@ -3258,14 +3258,17 @@
int ret;
unsigned long flags;
+ /*
+ * Return zero characters for ports not claimed by driver.
+ */
+ if (state->type == PORT_UNKNOWN) {
+ return 0; /* ignore unused ports */
+ }
+
ret = sprintf(buf, "%d: uart:%s port:%lX irq:%d",
state->line, uart_config[state->type].name,
- state->port, state->irq);
-
- if (!state->port || (state->type == PORT_UNKNOWN)) {
- ret += sprintf(buf+ret, "\n");
- return ret;
- }
+ (state->port ? state->port : (long)state->iomem_base),
+ state->irq);
/*
* Figure out the current RS-232 lines
----------------------------------------------------------------
Ed Vance edv@macrolink.com
Software Development Manager
Macrolink, Inc. 1500 N. Kellogg Dr Anaheim, CA 92807
PH 714.777.8800 x335 Fax 714.777.8807 http://www.macrolink.com
----------------------------------------------------------------
reply other threads:[~2002-03-15 1:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11E89240C407D311958800A0C9ACF7D13A7705@EXCHANGE \
--to=edv@macrolink.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®