Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
i7300_idle.h
Go to the documentation of this file.
1 
2 #ifndef I7300_IDLE_H
3 #define I7300_IDLE_H
4 
5 #include <linux/pci.h>
6 
7 /*
8  * I/O AT controls (PCI bus 0 device 8 function 0)
9  * DIMM controls (PCI bus 0 device 16 function 1)
10  */
11 #define IOAT_BUS 0
12 #define IOAT_DEVFN PCI_DEVFN(8, 0)
13 #define MEMCTL_BUS 0
14 #define MEMCTL_DEVFN PCI_DEVFN(16, 1)
15 
16 struct fbd_ioat {
17  unsigned int vendor;
18  unsigned int ioat_dev;
19  unsigned int enabled;
20 };
21 
22 /*
23  * The i5000 chip-set has the same hooks as the i7300
24  * but it is not enabled by default and must be manually
25  * manually enabled with "forceload=1" because it is
26  * only lightly validated.
27  */
28 
29 static const struct fbd_ioat fbd_ioat_list[] = {
32  {0, 0}
33 };
34 
35 /* table of devices that work with this driver */
36 static const struct pci_device_id pci_tbl[] = {
39  { } /* Terminating entry */
40 };
41 
42 /* Check for known platforms with I/O-AT */
43 static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
44  struct pci_dev **ioat_dev,
45  int enable_all)
46 {
47  int i;
48  struct pci_dev *memdev, *dmadev;
49 
51  if (!memdev)
52  return -ENODEV;
53 
54  for (i = 0; pci_tbl[i].vendor != 0; i++) {
55  if (memdev->vendor == pci_tbl[i].vendor &&
56  memdev->device == pci_tbl[i].device) {
57  break;
58  }
59  }
60  if (pci_tbl[i].vendor == 0)
61  return -ENODEV;
62 
64  if (!dmadev)
65  return -ENODEV;
66 
67  for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
68  if (dmadev->vendor == fbd_ioat_list[i].vendor &&
69  dmadev->device == fbd_ioat_list[i].ioat_dev) {
70  if (!(fbd_ioat_list[i].enabled || enable_all))
71  continue;
72  if (fbd_dev)
73  *fbd_dev = memdev;
74  if (ioat_dev)
75  *ioat_dev = dmadev;
76 
77  return 0;
78  }
79  }
80  return -ENODEV;
81 }
82 
83 #endif