[EMAIL PROTECTED] 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

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to