1PCI_CREATE_SLOT(9) Hardware Interfaces PCI_CREATE_SLOT(9)
2
3
4
6 pci_create_slot - create or increment refcount for physical PCI slot
7
9 struct pci_slot * pci_create_slot(struct pci_bus * parent, int slot_nr,
10 const char * name,
11 struct hotplug_slot * hotplug);
12
14 parent
15 struct pci_bus of parent bridge
16
17 slot_nr
18 PCI_SLOT(pci_dev->devfn) or -1 for placeholder
19
20 name
21 user visible string presented in /sys/bus/pci/slots/<name>
22
23 hotplug
24 set if caller is hotplug driver, NULL otherwise
25
27 PCI slots have first class attributes such as address, speed, width,
28 and a struct pci_slot is used to manage them. This interface will
29 either return a new struct pci_slot to the caller, or if the pci_slot
30 already exists, its refcount will be incremented.
31
32 Slots are uniquely identified by a pci_bus, slot_nr tuple.
33
34 There are known platforms with broken firmware that assign the same
35 name to multiple slots. Workaround these broken platforms by renaming
36 the slots on behalf of the caller. If firmware assigns name N to
37
39 The first slot is assigned N The second slot is assigned N-1 The third
40 slot is assigned N-2 etc.
41
43 In most cases, pci_bus, slot_nr will be sufficient to uniquely identify
44 a slot. There is one notable exception - pSeries (rpaphp), where the
45 slot_nr cannot be determined until a device is actually inserted into
46 the slot. In this scenario, the caller may pass -1 for slot_nr.
47
48 The following semantics are imposed when the caller passes slot_nr ==
49 -1. First, we no longer check for an existing struct pci_slot, as there
50 may be many slots with slot_nr of -1. The other change in semantics is
51 user-visible, which is the 'address' parameter presented in sysfs will
52
54 bb tuple, where dddd is the PCI domain of the struct pci_bus and bb is
55 the bus number. In other words, the devfn of the 'placeholder' slot
56 will not be displayed.
57
59Kernel Hackers Manual 3.10 June 2019 PCI_CREATE_SLOT(9)