Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jul 2007 19:09:21 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Christopher Davis <loafier@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org, multimedia@FreeBSD.org
Subject:   Re: Audio driver template
Message-ID:  <20070710020921.GB1221@funkthat.com>
In-Reply-To: <c44ca55f0707091147n48741250h588a1fcf59d1b74b@mail.gmail.com>
References:  <c44ca55f0707091147n48741250h588a1fcf59d1b74b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Christopher Davis wrote this message on Mon, Jul 09, 2007 at 11:47 -0700:
> http://people.freebsd.org/~cg/template.c
> 
> Thought I would take a look at the audio driver template as
> part of my task to modernize drivers, soc2007. I would simplify
> the read and write functions to avoid using the bus tag and
> handle, but I'm not sure what else to do to bring it up to date.
> 
> How else can it be improved?

Use bus_alloc_resources instead of using bus_alloc_resource...
Maybe use pci_enable_busmaster and friends instead of using
pci_write_config...  (In the future for suspend/resume, I would hope
our pci layer would save the state, which it might not if you write
directly to the config registers.)

You should also use bus_get_dma_tag for getting the parent tag when
creating your own tag w/ bus_dma_tag_create...

Can't think of any others right now...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070710020921.GB1221>