Date: Thu, 31 Dec 1998 18:00:08 -0500 (EST) From: Bill Paul <wpaul@skynet.ctr.columbia.edu> To: imp@village.org (Warner Losh) Cc: current@FreeBSD.ORG Subject: Re: bus_space_foo and bus_dmamap_foo Message-ID: <199812312300.SAA05644@skynet.ctr.columbia.edu> In-Reply-To: <199812311928.MAA00612@harmony.village.org> from "Warner Losh" at Dec 31, 98 12:28:23 pm
next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the towns in all the world, Warner Losh had to walk into mine and say: > : - There is no bus_dmamap_load_mbuf(). This makes it very hard to use > : the bus_dmamap stuff for network interface drivers. (A good example > : of how to use this stuff in general would be nice too.) > > Hmmm, how does NetBSD do this stuff? It has been a while since I've > looked. The idea behind the bus_dmamap stuff (I think) is that you can use it to obtain buffers for DMA that are properly positioned and/or aligned as required by a given architecture without each driver having to deal with such issues itself. It also deals with bounce buffering in those cases where it's needed. You use call an init routine of some sort and tell it what parent bus you're attached to, and it works out what limitations/requirements are involved. You also allocate special mapping structures. When you have data to DMA, you use bus_dmamap_load() to attach or copy the data to the bus mappings. The problem is that doing this with mbufs is cumbersome because you have may have an mbuf chain to deal with and you have to chase down all the mbufs in the chain and set them up correctly: bus_dmamap_load_mbuf() is supposed to handle most of the gruntwork for you. I don't claim to understand all of how it works, but I can't even begin to experiment with it unless a) everything is implemented and working properly and b) there's proper documentation (e.g. man pages). I think the best thing would be if somebody were to prepare a sample driver skeleton that actually makes proper use of all the new framework(s). -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness" ============================================================================= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812312300.SAA05644>
