midi problem, an isa device on a pci card

From: Mathew Kanner <mat_at_cnd.mcgill.ca>
Date: Fri, 4 Apr 2003 13:25:57 -0500
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?
Received on Fri Apr 04 2003 - 08:23:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:02 UTC