From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 21 08:35:55 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2117A16A420 for ; Fri, 21 Oct 2005 08:35:55 +0000 (GMT) (envelope-from frank@pinky.sax.de) Received: from pinky.frank-behrens.de (pinky.frank-behrens.de [82.139.199.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63AB843D46 for ; Fri, 21 Oct 2005 08:35:53 +0000 (GMT) (envelope-from frank@pinky.sax.de) Received: from [192.168.20.31] (pulse.behrens [192.168.20.31]) by pinky.frank-behrens.de (8.13.4/8.13.4) with ESMTP/MSA id j9L8Zn2P001846 for ; Fri, 21 Oct 2005 10:35:50 +0200 (CEST) (envelope-from frank@pinky.sax.de) Message-Id: <200510210835.j9L8Zn2P001846@pinky.frank-behrens.de> From: "Frank Behrens" To: freebsd-hackers@freebsd.org Date: Fri, 21 Oct 2005 10:35:43 +0200 MIME-Version: 1.0 Priority: normal X-mailer: Pegasus Mail for Windows (4.30 public beta 1, DE v4.30 PB1 (for PB1)) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Subject: How disable attachment of sio(4) driver to device? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2005 08:35:55 -0000 Hi, I'm writing a device driver for UART with a protocol, that can not be handled by the default sio(4) driver. The driver works fine - the only problem I have is to disable the attachment of sio(4) driver to the device. Example: I'm using FreeBSD 6.0-BETA3 on a new machine with 2 UART interfaces on motherboard. I use the 1st port as console, it is initialialized as sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 sio0: type 16550A, console I want to use the second port with my driver. I had no luck with hint.sio.1.disabled="1", but hint.sio.1.flags="0x40" gave me the desired result: sio1: reserved for low-level i/o It looks fine, but now come my problems. When I load my driver a new ISA probe is executed. Now there is a sio4 or sio5 device, that is probed and because there are no hints to disable this, the sio(4) driver attaches to the port. One partly working workaround I found is to patch the sio driver. If it does in DEVICE_PROBE(9) not return (0), but the value BUS_PROBE_DEFAULT, then my driver has a chance to attach. If my driver does not attach or another driver is loaded, the sio(4) attaches again and I have lost. Then I see only a reboot as solution to try my driver again. Now comes my question: How can I disable permanently, that sio(4) attaches to a specified interface? In FreeBSD-4 it was very easy, I removed the line from kernel configuration file and it worked. I think I did miss some important information, e.g. I could not find how the associations between PCI selectors (pciconf(8)) and device numers are made and what to insert in device.hints to modify this associations. Regards, Frank -- Frank Behrens, Osterwieck, Germany PGP-key 0x5B7C47ED on public servers available.