From owner-freebsd-current@FreeBSD.ORG Fri Apr 4 10:23:44 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E902F37B401 for ; Fri, 4 Apr 2003 10:23:43 -0800 (PST) Received: from hak.cnd.mcgill.ca (hak.cnd.mcgill.ca [132.216.11.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D14543F93 for ; Fri, 4 Apr 2003 10:23:43 -0800 (PST) (envelope-from mat@hak.cnd.mcgill.ca) Received: from hak.cnd.mcgill.ca (localhost.cnd.mcgill.ca [127.0.0.1]) by hak.cnd.mcgill.ca (8.12.3p2/8.12.3) with ESMTP id h34IPvqC031167 for ; Fri, 4 Apr 2003 13:25:57 -0500 (EST) (envelope-from mat@hak.cnd.mcgill.ca) Received: (from mat@localhost) by hak.cnd.mcgill.ca (8.12.3p2/8.12.3/Submit) id h34IPv6B031166 for freebsd-current@freebsd.org; Fri, 4 Apr 2003 13:25:57 -0500 (EST) Date: Fri, 4 Apr 2003 13:25:57 -0500 From: Mathew Kanner To: freebsd-current@freebsd.org Message-ID: <20030404182557.GK17533@cnd.mcgill.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: I speak for myself, operating in Montreal, CANADA User-Agent: Mutt/1.5.3i Subject: midi problem, an isa device on a pci card X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2003 18:23:44 -0000 Hello, I've been fiddling with pci drivers in freebsd for a couple of months and up to now everything has ok, I did a midi driver for es137x which was relatively easy because the io was done on the pci bus. I was very pleased that there were enough resources for a newbie like me to dive into kernel hacking. Now I want to do one for the cmi card, but it seems to offer the midi device on the isa bus, as does a bunch of cards. I'm sure they did this to confuse me. Linux seems to be happy just inb,outb in their pci driver, which seems uncool to me. Also since I can program the mpu to appear to different locations I think the ISA bus driver can help determine the best one to use... Theory of Reality (mostly hand waving, as I've done no code yet) Drivers: cmi(pci), my pci sound, it's on board btw. mpushim(isa), the mpu401 from the tree but hacked to receive from the pci soundcard driver How I think should work: probe cmi, attach cmi, do { enable mpu401 at port region, probe attach mpushim while ( ! mpushim attached ) done Big question mark: How do I create isa devices from a pci device. Do I search up the soundcard tree for the pci bus then search down for the isa bus, then create_child(..."mpushim")? How do I tell the shim before the probe/attach what io region to look at, do I fiddle with ivars (or some internal structure), do I mess with hints via kenv(9) [Is there a kenv(9)? ] I think that these questions equally apply to joysticks. Thanks, --Mat -- Brain: Are you pondering what I'm pondering? Pinky: I think so, Brain, but if the plural of mouse is mice, wouldn't the plural of spouse be spice?