Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block: Add CONFIG_DEBUG_SG sg validation Change table chaining layout Update arch/ to use sg helpers Update swiotlb to use sg helpers Update net/ to use sg helpers Update fs/ to use sg helpers [SG] Update drivers to use sg helpers [SG] Update crypto/ to sg helpers [SG] Update block layer to use sg helpers [SG] Add helpers for manipulating SG entries
This commit is contained in:
@@ -411,8 +411,10 @@ static int calgary_nontranslate_map_sg(struct device* dev,
|
||||
int i;
|
||||
|
||||
for_each_sg(sg, s, nelems, i) {
|
||||
BUG_ON(!s->page);
|
||||
s->dma_address = virt_to_bus(page_address(s->page) +s->offset);
|
||||
struct page *p = sg_page(s);
|
||||
|
||||
BUG_ON(!p);
|
||||
s->dma_address = virt_to_bus(sg_virt(s));
|
||||
s->dma_length = s->length;
|
||||
}
|
||||
return nelems;
|
||||
@@ -432,9 +434,9 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
|
||||
return calgary_nontranslate_map_sg(dev, sg, nelems, direction);
|
||||
|
||||
for_each_sg(sg, s, nelems, i) {
|
||||
BUG_ON(!s->page);
|
||||
BUG_ON(!sg_page(s));
|
||||
|
||||
vaddr = (unsigned long)page_address(s->page) + s->offset;
|
||||
vaddr = (unsigned long) sg_virt(s);
|
||||
npages = num_dma_pages(vaddr, s->length);
|
||||
|
||||
entry = iommu_range_alloc(tbl, npages);
|
||||
|
@@ -302,7 +302,7 @@ static int dma_map_sg_nonforce(struct device *dev, struct scatterlist *sg,
|
||||
#endif
|
||||
|
||||
for_each_sg(sg, s, nents, i) {
|
||||
unsigned long addr = page_to_phys(s->page) + s->offset;
|
||||
unsigned long addr = sg_phys(s);
|
||||
if (nonforced_iommu(dev, addr, s->length)) {
|
||||
addr = dma_map_area(dev, addr, s->length, dir);
|
||||
if (addr == bad_dma_address) {
|
||||
@@ -397,7 +397,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
start_sg = sgmap = sg;
|
||||
ps = NULL; /* shut up gcc */
|
||||
for_each_sg(sg, s, nents, i) {
|
||||
dma_addr_t addr = page_to_phys(s->page) + s->offset;
|
||||
dma_addr_t addr = sg_phys(s);
|
||||
s->dma_address = addr;
|
||||
BUG_ON(s->length == 0);
|
||||
|
||||
|
@@ -62,8 +62,8 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
|
||||
int i;
|
||||
|
||||
for_each_sg(sg, s, nents, i) {
|
||||
BUG_ON(!s->page);
|
||||
s->dma_address = virt_to_bus(page_address(s->page) +s->offset);
|
||||
BUG_ON(!sg_page(s));
|
||||
s->dma_address = virt_to_bus(sg_virt(s));
|
||||
if (!check_addr("map_sg", hwdev, s->dma_address, s->length))
|
||||
return 0;
|
||||
s->dma_length = s->length;
|
||||
|
Reference in New Issue
Block a user