Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Aug 1998 20:19:19 -0400 (EDT)
From:      Chuck Robey <chuckr@glue.umd.edu>
To:        Bill Paul <wpaul@skynet.ctr.columbia.edu>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: PCI devices
Message-ID:  <Pine.BSF.4.00.9808232013370.361-100000@picnic.mat.net>
In-Reply-To: <199808231747.NAA18976@skynet.ctr.columbia.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 23 Aug 1998, Bill Paul wrote:

> Of all the gin joints in all the towns in all the world, Chuck Robey had 
> to walk into mine and say:
> 
> > Does anyone know where I might find a good example of probing and
> > attaching a pci device?  I'm talking about the C code.  I'm looking at a
> > PCI sound card, but I can't find anything on how to do sound stuff using
> > PCI.
> > 
> > Thanks.
> 
> I would start by looking at the device drivers in /sys/pci. That's
> where I started.

[some deletions]
> As for 'PCI sound stuff,' that I don't know about. So far I've only
> written network drivers, but I'd wager that there are a couple of
> similarities. You probably have to provide a way to transfer large
> streams of encoded audio data into and out of the adapter, which is
> probably where DMA comes in. You have to give the card pointers
> to buffers containing audio data to be played, then wait for an
> interrupt from the card telling you the transfer is complete so you
> can free the buffers and transfer more. And you need to be able to
> program mixer levels and things using internal registers. I don't know 
> about things like MIDI or wave tables so I can't imagine how those work.
> I'm assuming you do have the proper documentation for your board;
> if not you're going to be totally lost.

Among other things, the sound code wants to use linker sets for probing
and other things, just like the pci code.  I wondered about this, and
my current best guess is to register both, with the pci routines doing
the real work, and the sound routines merely checking the results and
making sure the probe/attach was successful.  You see, there are
functions automatically registered/called via the sound code stuff that
pci doesn't know about, so I can't completely ignore it.  Does this
sound reasonable (to have the probe + attach work done in two places,
sort of?

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@glue.umd.edu         | communications topic, C programming, and Unix.
213 Lakeside Drive Apt T-1  |
Greenbelt, MD 20770         | I run Journey2 and picnic (FreeBSD-current)
(301) 220-2114              | and jaunt (NetBSD).
----------------------------+-----------------------------------------------





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.00.9808232013370.361-100000>