From wb@vestein.arb-phys.uni-dortmund.de  Mon Jan 22 05:47:20 2001
Return-Path: <wb@vestein.arb-phys.uni-dortmund.de>
Received: from vestein.arb-phys.uni-dortmund.de (vestein.arb-phys.uni-dortmund.de [192.109.44.6])
	by hub.freebsd.org (Postfix) with ESMTP id CF99C37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2001 05:47:14 -0800 (PST)
Received: from yorikke.arb-phys.uni-dortmund.de (yorikke [192.109.44.12])
	by vestein.arb-phys.uni-dortmund.de (8.9.2/8.9.3) with ESMTP id OAA62509
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2001 14:47:10 +0100 (MET)
	(envelope-from wb@vestein.arb-phys.uni-dortmund.de)
Received: (from wb@localhost)
	by yorikke.arb-phys.uni-dortmund.de (8.9.3/8.9.3) id OAA36440;
	Mon, 22 Jan 2001 14:45:39 +0100 (MET)
	(envelope-from wb)
Message-Id: <200101221345.OAA36440@yorikke.arb-phys.uni-dortmund.de>
Date: Mon, 22 Jan 2001 14:45:39 +0100 (MET)
From: "Wilhelm B. Kloke" <wb@vestein.arb-phys.uni-dortmund.de>
Reply-To: wb@vestein.arb-phys.uni-dortmund.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: Bad tracking of Modem status
X-Send-Pr-Version: 3.2

>Number:         24528
>Category:       kern
>Synopsis:       Bad tracking of Modem status
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 22 05:50:00 PST 2001
>Closed-Date:    
>Last-Modified:  Mon Feb 19 11:50:48 PST 2001
>Originator:     Wilhelm B. Kloke
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:

	FreeBSD 4.0-STABLE #6: Mon Jul 10 19:48:43 MET DST 2000
	wb@wbk1:/usr/src-4.0/sys/compile/WBK
	Timecounter "i8254"  frequency 1193182 Hz
	CPU: AMD-K6(tm) 3D processor (501.14-MHz 586-class CPU)
	Origin = "AuthenticAMD"  Id = 0x58c  Stepping = 12
	Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>
	AMD Features=0x80000800<SYSCALL,3DNow!>
	real memory  = 67043328 (65472K bytes)
	avail memory = 61763584 (60316K bytes)
	Preloaded elf kernel "kernel" at 0xc0371000.
	md0: Malloc disk
	npx0: <math processor> on motherboard
	npx0: INT 16 interface
	pcib0: <Host to PCI bridge> on motherboard
	pci0: <PCI bus> on pcib0
	pcib2: <VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge> at device 1.0
on pci0
	pci1: <PCI bus> on pcib2
	pci1: <ATI Mach64-GM graphics accelerator> at 0.0
	isab0: <VIA 82C596B PCI-ISA bridge> at device 7.0 on pci0
	isa0: <ISA bus> on isab0
	atapci0: <VIA 82C596 ATA33 controller> port 0xd000-0xd00f at device 7.1
on pci0
	ata0: at 0x1f0 irq 14 on atapci0
	ata1: at 0x170 irq 15 on atapci0
	pci0: <VIA 83C572 USB controller> at 7.2 irq 11
	pcm0: <AudioPCI ES1371> port 0xd800-0xd83f irq 10 at device 8.0 on pci0
	pci0: <unknown card> (vendor=0x109e, dev=0x036e) at 9.0 irq 12
	pci0: <unknown card> (vendor=0x109e, dev=0x0878) at 9.1 irq 12
	amd0: <Tekram DC390(T)/AMD53c974 SCSI Host Adapter> port 0xdc00-0xdc7f i
rq 9 at device 10.0 on pci0
	amd0: driver is using old-style compatability shims
	ed0: <NE2000 PCI Ethernet (RealTek 8029)> port 0xe000-0xe01f irq 9 at de
vice 11.0 on pci0
	ed0: supplying EUI64: 00:48:45:ff:fe:00:96:87
	ed0: address 00:48:45:00:96:87, type NE2000 (16 bit)
	pcib1: <Host to PCI bridge> on motherboard
	pci2: <PCI bus> on pcib1
	fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa
0
	fdc0: FIFO enabled, 8 bytes threshold
	fd0: <1440-KB 3.5" drive> on fdc0 drive 0
	atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
	atkbd0: <AT Keyboard> irq 1 on atkbdc0
	vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa
0
	sc0: <System console> on isa0
	sc0: VGA <16 virtual consoles, flags=0x200>
	sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
	sio0: type 16550A
	sio1 at port 0x2f8-0x2ff irq 3 on isa0
	sio1: type 16550A
	ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
	ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
	ppc0: FIFO with 16/16/16 bytes threshold
	ppi0: <Parallel I/O> on ppbus0


>Description:

	I tried to adapt a Linux application for model railroads
	(Digital Direct for Linux). I got no acceptable acknowledge from
	the NMRA-programmer application. AFAIS this is due to the
	following defect in the handling of Modem status signals:
	The input signal is on RI. After triggering the corresponding
	status bit further reads via TIOCMGET don't reflect the state
	of the line until output occurs.  

>How-To-Repeat:

	Use kermit and 'show modem'. RI goes to off only after output    
	(in connect state e.g.).

>Fix:

	IMHO TIOCMGET should update 
	the internal copy of MSR, at least after reading. Thus the next
	TIOCMGET gets the right info.

	I saw that sio is heavily affected by current development.
	So I just fix it at home, and give you just the information.

	Further comments on the 16550A driver. I feel that there are
	reasons to relieve unnecessary restrictions on the baud rates.
	The hardware is able to produce at least 3 more useful Baud rates:
	1. (and least) NMRA timing needs 58us pulses resulting in ~17000Bd,
	2. The bus of my NMRA-DCC is on 62500 Bd,
	3. (probably the only important) MIDI is on 31250Bd.
	You could just accept any Bd rate not exceeding some upper limit
	for this device.

>Release-Note:
>Audit-Trail:
>Unformatted:
