2 * $Id: internal.h,v 1.2 1999/07/07 11:23:10 mj Exp $
4 * The PCI Library -- Internal Include File
6 * Copyright (c) 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
8 * Can be freely distributed and used under the terms of the GNU GPL.
13 #ifdef HAVE_PM_LINUX_BYTEORDER_H
15 #include <asm/byteorder.h>
16 #define cpu_to_le16 __cpu_to_le16
17 #define cpu_to_le32 __cpu_to_le32
18 #define le16_to_cpu __le16_to_cpu
19 #define le32_to_cpu __le32_to_cpu
24 #if __BYTE_ORDER == __BIG_ENDIAN
25 #define cpu_to_le16 swab16
26 #define cpu_to_le32 swab32
27 #define le16_to_cpu swab16
28 #define le32_to_cpu swab32
30 static inline word
swab16(word w
)
32 return (w
<< 8) | ((w
>> 8) & 0xff);
35 static inline u32
swab32(u32 w
)
37 return ((w
& 0xff000000) >> 24) |
38 ((w
& 0x00ff0000) >> 8) |
39 ((w
& 0x0000ff00) << 8) |
40 ((w
& 0x000000ff) << 24);
43 #define cpu_to_le16(x) (x)
44 #define cpu_to_le32(x) (x)
45 #define le16_to_cpu(x) (x)
46 #define le32_to_cpu(x) (x)
53 void (*config
)(struct pci_access
*);
54 int (*detect
)(struct pci_access
*);
55 void (*init
)(struct pci_access
*);
56 void (*cleanup
)(struct pci_access
*);
57 void (*scan
)(struct pci_access
*);
58 int (*fill_info
)(struct pci_dev
*, int flags
);
59 int (*read
)(struct pci_dev
*, int pos
, byte
*buf
, int len
);
60 int (*write
)(struct pci_dev
*, int pos
, byte
*buf
, int len
);
61 void (*init_dev
)(struct pci_dev
*);
62 void (*cleanup_dev
)(struct pci_dev
*);
65 void pci_generic_scan(struct pci_access
*);
66 int pci_generic_fill_info(struct pci_dev
*, int flags
);
67 int pci_generic_block_read(struct pci_dev
*, int pos
, byte
*buf
, int len
);
68 int pci_generic_block_write(struct pci_dev
*, int pos
, byte
*buf
, int len
);
70 void *pci_malloc(struct pci_access
*, int);
71 void pci_mfree(void *);
73 struct pci_dev
*pci_alloc_dev(struct pci_access
*);
74 int pci_link_dev(struct pci_access
*, struct pci_dev
*);
76 extern struct pci_methods pm_intel_conf1
, pm_intel_conf2
, pm_linux_proc
,
79 #define UNUSED __attribute__((unused))