Date: Wed, 17 May 2006 09:11:00 -0600 From: Scott Long <scottl@samsco.org> To: hongz@promisechina.com Cc: freebsd-hackers@freebsd.org Subject: Re: =?gb2312?b?tPC4tDogtPC4tDogaGVscDpIb3cgdG8gbWFwIGEgcGh5c2lj?= =?gb2312?b?YWwgYWRkcmVzcyBpbnRvIGEga2VybmVsIGFkZHJlc3M/?= Message-ID: <446B3D04.2070602@samsco.org> In-Reply-To: <1147856676$63109$94009980@hongz@promisechina.com> References: <1147856676$63109$94009980@hongz@promisechina.com>
next in thread | previous in thread | raw e-mail | index | archive | help
hongz@promisechina.com wrote: > Hi guys: > > The attached file is the sample codes of my HBA driver. I make notes on the > place where the address transfer is needed. Please make comments if > possible. > > Thanks a lot! > > Hong > It looks like the primary question that you are asking in the code is this: How to get the kernel virtual address of csio->data_ptr? Correct? The answer is that csio->data_ptr is a kernel virtual address already if the CAM_DATA_PHYS flag is not set. For prepare_sg_table, you can just ignore the case where it isn't unless you expect to also write software that will use the flag (CAM was originally written for an application that did use this flag, but it's use is no longer common). As for ft_map_sg, the only way that you can be in there is if CAM_DATA_PHYS was not set, so it's safe to say that csio->data_ptr is a kernel virtaul address. One thing to note about your code is that Local_StartIO should be called from within ft_map_sg instead of ft_cam_action. That way the EINPROGRESS status of bus_dmamap_load will be handled correctly. I can' describe this more if you have questions. Scott
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?446B3D04.2070602>