Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
dad4f14
Documentation
LICENSES
arch
block
certs
crypto
drivers
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma-buf
dma
edac
eisa
extcon
firewire
firmware
fmc
fpga
fsi
gnss
gpio
gpu
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
ide
idle
iio
infiniband
input
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
oprofile
parisc
parport
pci
controller
endpoint
hotplug
Kconfig
Makefile
TODO
acpi_pcihp.c
acpiphp.h
acpiphp_core.c
acpiphp_glue.c
acpiphp_ibm.c
cpci_hotplug.h
cpci_hotplug_core.c
cpci_hotplug_pci.c
cpcihp_generic.c
cpcihp_zt5550.c
cpcihp_zt5550.h
cpqphp.h
cpqphp_core.c
cpqphp_ctrl.c
cpqphp_nvram.c
cpqphp_nvram.h
cpqphp_pci.c
cpqphp_sysfs.c
ibmphp.h
ibmphp_core.c
ibmphp_ebda.c
ibmphp_hpc.c
ibmphp_pci.c
ibmphp_res.c
pci_hotplug_core.c
pciehp.h
pciehp_core.c
pciehp_ctrl.c
pciehp_hpc.c
pciehp_pci.c
pnv_php.c
rpadlpar.h
rpadlpar_core.c
rpadlpar_sysfs.c
rpaphp.h
rpaphp_core.c
rpaphp_pci.c
rpaphp_slot.c
s390_pci_hpc.c
sgi_hotplug.c
shpchp.h
shpchp_core.c
shpchp_ctrl.c
shpchp_hpc.c
shpchp_pci.c
shpchp_sysfs.c
pcie
switch
Kconfig
Makefile
access.c
ats.c
bus.c
ecam.c
host-bridge.c
iov.c
irq.c
mmap.c
msi.c
of.c
p2pdma.c
pci-acpi.c
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c
pci.c
pci.h
probe.c
proc.c
quirks.c
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
siox
slimbus
sn
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
pci
/
hotplug
/
acpiphp.h
Copy path
Blame
Blame
Latest commit
Linus Torvalds
Merge branch 'xarray' of git://git.infradead.org/users/willy/linux-dax
Oct 28, 2018
dad4f14
·
Oct 28, 2018
History
History
192 lines (154 loc) · 4.75 KB
Breadcrumbs
linux
/
drivers
/
pci
/
hotplug
/
acpiphp.h
Top
File metadata and controls
Code
Blame
192 lines (154 loc) · 4.75 KB
Raw
/* SPDX-License-Identifier: GPL-2.0+ */ /* * ACPI PCI Hot Plug Controller Driver * * Copyright (C) 1995,2001 Compaq Computer Corporation * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) * Copyright (C) 2001 IBM Corp. * Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com) * Copyright (C) 2002,2003 NEC Corporation * Copyright (C) 2003-2005 Matthew Wilcox (willy@infradead.org) * Copyright (C) 2003-2005 Hewlett Packard * * All rights reserved. * * Send feedback to <gregkh@us.ibm.com>, * <t-kochi@bq.jp.nec.com> * */ #ifndef _ACPIPHP_H #define _ACPIPHP_H #include <linux/acpi.h> #include <linux/mutex.h> #include <linux/pci_hotplug.h> struct acpiphp_context; struct acpiphp_bridge; struct acpiphp_slot; /* * struct slot - slot information for each *physical* slot */ struct slot { struct hotplug_slot hotplug_slot; struct acpiphp_slot *acpi_slot; unsigned int sun; /* ACPI _SUN (Slot User Number) value */ }; static inline const char *slot_name(struct slot *slot) { return hotplug_slot_name(&slot->hotplug_slot); } static inline struct slot *to_slot(struct hotplug_slot *hotplug_slot) { return container_of(hotplug_slot, struct slot, hotplug_slot); } /* * struct acpiphp_bridge - PCI bridge information * * for each bridge device in ACPI namespace */ struct acpiphp_bridge { struct list_head list; struct list_head slots; struct kref ref; struct acpiphp_context *context; int nr_slots; /* This bus (host bridge) or Secondary bus (PCI-to-PCI bridge) */ struct pci_bus *pci_bus; /* PCI-to-PCI bridge device */ struct pci_dev *pci_dev; bool is_going_away; }; /* * struct acpiphp_slot - PCI slot information * * PCI slot information for each *physical* PCI slot */ struct acpiphp_slot { struct list_head node; struct pci_bus *bus; struct list_head funcs; /* one slot may have different objects (i.e. for each function) */ struct slot *slot; u8 device; /* pci device# */ u32 flags; /* see below */ }; /* * struct acpiphp_func - PCI function information * * PCI function information for each object in ACPI namespace * typically 8 objects per slot (i.e. for each PCI function) */ struct acpiphp_func { struct acpiphp_bridge *parent; struct acpiphp_slot *slot; struct list_head sibling; u8 function; /* pci function# */ u32 flags; /* see below */ }; struct acpiphp_context { struct acpi_hotplug_context hp; struct acpiphp_func func; struct acpiphp_bridge *bridge; unsigned int refcount; }; static inline struct acpiphp_context *to_acpiphp_context(struct acpi_hotplug_context *hp) { return container_of(hp, struct acpiphp_context, hp); } static inline struct acpiphp_context *func_to_context(struct acpiphp_func *func) { return container_of(func, struct acpiphp_context, func); } static inline struct acpi_device *func_to_acpi_device(struct acpiphp_func *func) { return func_to_context(func)->hp.self; } static inline acpi_handle func_to_handle(struct acpiphp_func *func) { return func_to_acpi_device(func)->handle; } struct acpiphp_root_context { struct acpi_hotplug_context hp; struct acpiphp_bridge *root_bridge; }; static inline struct acpiphp_root_context *to_acpiphp_root_context(struct acpi_hotplug_context *hp) { return container_of(hp, struct acpiphp_root_context, hp); } /* * struct acpiphp_attention_info - device specific attention registration * * ACPI has no generic method of setting/getting attention status * this allows for device specific driver registration */ struct acpiphp_attention_info { int (*set_attn)(struct hotplug_slot *slot, u8 status); int (*get_attn)(struct hotplug_slot *slot, u8 *status); struct module *owner; }; /* ACPI _STA method value (ignore bit 4; battery present) */ #define ACPI_STA_ALL (0x0000000f) /* slot flags */ #define SLOT_ENABLED (0x00000001) #define SLOT_IS_GOING_AWAY (0x00000002) /* function flags */ #define FUNC_HAS_STA (0x00000001) #define FUNC_HAS_EJ0 (0x00000002) /* function prototypes */ /* acpiphp_core.c */ int acpiphp_register_attention(struct acpiphp_attention_info *info); int acpiphp_unregister_attention(struct acpiphp_attention_info *info); int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot, unsigned int sun); void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot); /* acpiphp_glue.c */ typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); int acpiphp_enable_slot(struct acpiphp_slot *slot); int acpiphp_disable_slot(struct acpiphp_slot *slot); u8 acpiphp_get_power_status(struct acpiphp_slot *slot); u8 acpiphp_get_attention_status(struct acpiphp_slot *slot); u8 acpiphp_get_latch_status(struct acpiphp_slot *slot); u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot); /* variables */ extern bool acpiphp_disabled; #endif /* _ACPIPHP_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
You can’t perform that action at this time.