Skip to contentSkip to conversation

Scatter Gather question : 2.6.test4 . page to vaddr

DISCUSSION jd 3 participants 4 messages Sep 22, 2003 SCSI

lore
Share & tools
lore

jd

author
#0 lore raw

Hi,

I see that 2.6 scatterlist.h has eliminated the "address" element and uses page struct only, and that pci_map_sg() is used to populate the dma_address field. I'm not really planning on using DMA .

How can I convert the page * entry
pointed to by SCpnt->request_buffer back to a vaddr ?
I don't see a page-to-vaddr() . function ?
Thanks for any insight.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

author
#1 lore raw
Quoted 8 lines · --- jd

Hi,

I see that 2.6 scatterlist.h has eliminated the "address" element and uses page struct only, and that pci_map_sg() is used to populate the dma_address field. I'm not really planning on using DMA .

Quoted 5 lines

How can I convert the page * entry
pointed to by SCpnt->request_buffer back to a vaddr ?
I don't see a page-to-vaddr() . function ?
Thanks for any insight.

Looks like
cur_ptr = (void *) pfn_to_kaddr( page_to_pfn(sg->page));

Did it ( At least once ;) ) !

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

#2 lore raw
In reply to jd
Quoted 8 lines · jd

I see that 2.6 scatterlist.h has eliminated the "address" element and uses page struct only, and that pci_map_sg() is used to populate the dma_address field. I'm not really planning on using DMA .

How can I convert the page * entry
pointed to by SCpnt->request_buffer back to a vaddr ?
I don't see a page-to-vaddr() . function ?

The trick is that there may not be a vaddr for that struct page. If it's in highmem on x86, then it only ever gets temporary mappings into the kernel's space. You're probably looking for kmap(), kmap_atomic() or, if you really really know it's a lowmem page, page_address().

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#3 lore raw
In reply to jd
Quoted 9 lines · jd

I see that 2.6 scatterlist.h has eliminated the "address" element and uses page struct only, and that pci_map_sg() is used to populate the dma_address field. I'm not really planning on using DMA .

How can I convert the page * entry
pointed to by SCpnt->request_buffer back to a vaddr ?
I don't see a page-to-vaddr() . function ?
Thanks for any insight.

In general, you can't...the page may not be mapped in the kernel's space. You can use kmap/kunmap to look at its contents.

James