blob: 53dade7b2e167b3c6a54973f7ef7aa06d0c84a34 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_SCATTERLIST_H
2#define _ASM_SCATTERLIST_H
3
Jean Delvarea9dfd282007-03-06 02:45:12 -08004#include <asm/types.h>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006/*
7 * Drivers must set either ->address or (preferred) ->page and ->offset
8 * to indicate where data must be transferred to/from.
9 *
10 * Using ->page is recommended since it handles highmem data as well as
11 * low mem. ->address is restricted to data which has a virtual mapping, and
12 * it will go away in the future. Updating to ->page can be automated very
13 * easily -- something like
14 *
15 * sg->address = some_ptr;
16 *
17 * can be rewritten as
18 *
19 * sg->page = virt_to_page(some_ptr);
20 * sg->offset = (unsigned long) some_ptr & ~PAGE_MASK;
21 *
22 * and that's it. There's no excuse for not highmem enabling YOUR driver. /jens
23 */
24struct scatterlist {
Jens Axboe18dabf42007-10-22 19:57:20 +020025 unsigned long page_link;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 unsigned int offset; /* for highmem, page offset */
27
28 dma_addr_t dma_address;
29 unsigned int length;
30};
31
32#define ISA_DMA_THRESHOLD (0xffffffffUL)
33
34#endif /* !_ASM_SCATTERLIST_H */