Linux 2.6.31.6
[linux/fpc-iii.git] / arch / mn10300 / include / asm / scatterlist.h
blob67535901b9ffaf34e2ac366017313bf6dbd44da8
1 /* MN10300 Scatterlist definitions
3 * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
4 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
11 #ifndef _ASM_SCATTERLIST_H
12 #define _ASM_SCATTERLIST_H
14 #include <asm/types.h>
17 * Drivers must set either ->address or (preferred) page and ->offset
18 * to indicate where data must be transferred to/from.
20 * Using page is recommended since it handles highmem data as well as
21 * low mem. ->address is restricted to data which has a virtual mapping, and
22 * it will go away in the future. Updating to page can be automated very
23 * easily -- something like
25 * sg->address = some_ptr;
27 * can be rewritten as
29 * sg_set_page(virt_to_page(some_ptr));
30 * sg->offset = (unsigned long) some_ptr & ~PAGE_MASK;
32 * and that's it. There's no excuse for not highmem enabling YOUR driver. /jens
34 struct scatterlist {
35 #ifdef CONFIG_DEBUG_SG
36 unsigned long sg_magic;
37 #endif
38 unsigned long page_link;
39 unsigned int offset; /* for highmem, page offset */
40 dma_addr_t dma_address;
41 unsigned int length;
44 #define ISA_DMA_THRESHOLD (0x00ffffff)
47 * These macros should be used after a pci_map_sg call has been done
48 * to get bus addresses of each of the SG entries and their lengths.
49 * You should only work with the number of sg entries pci_map_sg
50 * returns.
52 #define sg_dma_address(sg) ((sg)->dma_address)
53 #define sg_dma_len(sg) ((sg)->length)
55 #endif /* _ASM_SCATTERLIST_H */