35#define _COMPONENT ACPI_BUS_COMPONENT
41#define STRUCT_TO_INT(s) (*((int*)&s))
42#define HAS_CHILDREN(d) ((d)->children.next != &((d)->children))
43#define HAS_SIBLINGS(d) (((d)->parent) && ((d)->node.next != &(d)->parent->children))
44#define NODE_TO_DEVICE(n) (list_entry(n, struct acpi_device, node))
99 DPRINT1(
"acpi_bus_data_handler not implemented\n");
121 DPRINT(
"Error getting context for object [%p]\n",
130 unsigned long long *sta)
151 unsigned long long sta;
159 if (
device->status.functional && !
device->status.present) {
161 "functional but not present;\n",
205 unsigned long long psc = 0;
213 if (!
device->flags.power_manageable) {
225 if (
device->power.flags.explicit_get) {
232 else if (
device->power.flags.power_resources) {
241 DPRINT(
"Device [%s] power state is D%d\n",
256 char object_name[5] = {
'_',
'P',
'S',
'0'+
state,
'\0'};
268 if (!
device->flags.power_manageable) {
269 DPRINT1(
"Device is not power manageable\n");
297 if (
device->parent && (state < device->
parent->power.state)) {
298 DPRINT1(
"Cannot set device to a higher-powered state than parent\n");
309 if (state < device->
power.state) {
310 if (
device->power.flags.power_resources) {
315 if (
device->power.states[
state].flags.explicit_set) {
325 if (
device->power.states[
state].flags.explicit_set) {
333 if (
device->power.flags.power_resources) {
342 DPRINT(
"Error transitioning device [%s] to D%d\n",
345 DPRINT(
"Device [%s] transitioned to D%d\n",
385 device->power.flags.explicit_get = 1;
388 device->power.flags.inrush_current = 1;
391 device->flags.wake_capable = 1;
398 char object_name[5] = {
'_',
'P',
'R',
'0'+
i,
'\0'};
404 device->power.flags.power_resources = 1;
409 object_name[2] =
'S';
412 ps->
flags.explicit_set = 1;
474 event->type = (TypeData & 0xFF000000) >> 24;
475 event->data = (TypeData & 0x00FFFFFF);
492 DPRINT(
"acpi_bus_generate_event\n");
505 TypeData |=
type << 24;
522 DPRINT(
"acpi_bus_receive_event\n");
658 old_status =
device->status;
664 if (
device->parent && !
device->parent->status.present) {
681 DPRINT(
"Device insertion detected\n");
684 else if (!(
device->status.present) && (old_status.
present)) {
685 DPRINT(
"Device removal detected\n");
729 DPRINT(
"Received BUS CHECK notification for device [%s]\n",
739 DPRINT(
"Received DEVICE CHECK notification for device [%s]\n",
749 DPRINT(
"Received DEVICE WAKE notification for device [%s]\n",
759 DPRINT1(
"Received EJECT REQUEST notification for device [%s]\n",
765 DPRINT1(
"Received DEVICE CHECK LIGHT notification for device [%s]\n",
771 DPRINT1(
"Received FREQUENCY MISMATCH notification for device [%s]\n",
777 DPRINT1(
"Received BUS MODE MISMATCH notification for device [%s]\n",
783 DPRINT1(
"Received POWER FAULT notification for device [%s]\n",
789 DPRINT1(
"Received unknown/unsupported notification [%08x] for device [%s]\n",
826 if (
device->flags.hardware_id)
830 if (
device->flags.compatible_ids) {
835 for (
i = 0;
i < cid_list->
Count;
i++)
889 DPRINT(
"Driver successfully bound to device\n");
922 if (!
device->status.present)
929 DPRINT(
"Found driver [%s] for device [%s]\n",
1089 device->flags.dynamic_status = 1;
1094 device->flags.compatible_ids = 1;
1104 device->flags.ejectable = 1;
1108 device->flags.ejectable = 1;
1114 device->flags.lockable = 1;
1121 device->flags.power_manageable = 1;
1139 char bus_id[5] = {
'?',0};
1153 DPRINT1(
"Memory allocation error\n");
1180 buffer.Length =
sizeof(bus_id);
1186 for (
i = 3;
i > 1;
i--) {
1187 if (bus_id[
i] ==
'_')
1229 if (!
device->status.present) {
1249 "Error reading device info\n"));
1255 hid =
info->HardwareId.String;
1257 uid =
info->UniqueId.String;
1259 cid_list = &
info->CompatibleIdList;
1261 if (
device->pnp.cid_list) {
1262 char *
p = (
char *)&
device->pnp.cid_list->Ids[cid_list->
Count];
1267 device->pnp.cid_list->Ids[
i].String =
p;
1275 DPRINT(
"Memory allocation error\n");
1279 device->flags.bus_address = 1;
1284 uid = static_uid_buffer;
1289 uid = static_uid_buffer;
1297 uid = static_uid_buffer;
1302 uid = static_uid_buffer;
1307 uid = static_uid_buffer;
1312 uid = static_uid_buffer;
1317 uid = static_uid_buffer;
1335 if (
device->pnp.hardware_id) {
1337 device->flags.hardware_id = 1;
1342 device->flags.unique_id = 1;
1356 if (
device->flags.power_manageable) {
1366 if (
device->flags.performance_manageable) {
1393 "Error attaching device data\n"));
1423 if (
device->flags.bus_address) {
1437 if (
device->flags.hardware_id ||
device->flags.compatible_ids)
1444 if (
device->pnp.cid_list) {
1447 if (
device->pnp.hardware_id) {
1470 if (
device->pnp.cid_list)
1473 if (
device->pnp.hardware_id)
1499 phandle =
start->handle;
1570 if (
child->status.present) {
1645 DPRINT(
"acpi_bus_init\n");
1651 DPRINT1(
"Unable to start the ACPI Interpreter\n");
1666 DPRINT1(
"Unable to initialize ACPI objects\n");
1684 DPRINT1(
"Unable to register for device notifications\n");
1703 DPRINT1(
"acpi_bus_scan_fixed failed\n");
1706 DPRINT1(
"acpi_bus_scan failed\n");
1729 DPRINT1(
"Error removing notify handler\n");
1731#ifdef CONFIG_ACPI_PCI
1732 acpi_pci_root_exit();
1733 acpi_pci_link_exit();
1735#ifdef CONFIG_ACPI_EC
1745 DPRINT1(
"Unable to terminate the ACPI Interpreter\n");
1747 DPRINT1(
"Interpreter disabled\n");
1794#ifdef CONFIG_ACPI_PCI
1795 if (!acpi_pci_disabled) {
1796 acpi_pci_link_init();
1797 acpi_pci_root_init();
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_MODULE_NAME(Name)
#define acpi_driver_data(d)
@ ACPI_BUS_TYPE_SLEEP_BUTTONF
@ ACPI_BUS_TYPE_PROCESSOR
@ ACPI_BUS_TYPE_SLEEP_BUTTON
@ ACPI_BUS_TYPE_POWER_BUTTON
@ ACPI_BUS_TYPE_POWER_BUTTONF
#define ACPI_DRIVER_ALL_NOTIFY_EVENTS
@ ACPI_BUS_REMOVAL_NORMAL
#define ACPI_BUTTON_HID_SLEEPF
#define ACPI_BUTTON_HID_POWERF
#define ACPI_BUTTON_HID_POWER
#define ACPI_PROCESSOR_HID
#define ACPI_BUTTON_HID_SLEEP
#define ACPI_BUS_DEVICE_NAME
#define ACPI_FADT_POWER_BUTTON
#define ACPI_FADT_SLEEP_BUTTON
#define ACPI_TYPE_PROCESSOR
#define ACPI_NOTIFY_FREQUENCY_MISMATCH
#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT
#define ACPI_STA_DEVICE_ENABLED
#define ACPI_NOTIFY_DEVICE_WAKE
#define ACPI_FULL_INITIALIZATION
#define ACPI_SYSTEM_NOTIFY
#define ACPI_STA_DEVICE_UI
#define ACPI_NOTIFY_POWER_FAULT
#define ACPI_NOTIFY_BUS_CHECK
#define ACPI_BITREG_SLEEP_BUTTON_ENABLE
#define ACPI_NOTIFY_EJECT_REQUEST
#define ACPI_BITREG_POWER_BUTTON_ENABLE
#define ACPI_STA_DEVICE_PRESENT
#define ACPI_STA_DEVICE_FUNCTIONING
#define ACPI_STATE_UNKNOWN
#define ACPI_TYPE_LOCAL_SCOPE
#define ACPI_TYPE_THERMAL
#define ACPI_NOTIFY_DEVICE_CHECK
#define ACPI_NOTIFY_BUS_MODE_MISMATCH
#define list_for_each(entry, head)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
int acpi_bus_register_driver(struct acpi_driver *driver)
int acpi_bus_generate_event(struct acpi_device *device, UINT8 type, int data)
static void acpi_bus_notify(ACPI_HANDLE handle, UINT32 type, void *data)
int FixedSleepButtonCount
int acpi_bus_get_power(ACPI_HANDLE handle, int *state)
static int acpi_bus_match(struct acpi_device *device, struct acpi_driver *driver)
void NTAPI acpi_bus_generate_event_dpc(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
int(* acpi_bus_walk_callback)(struct acpi_device *, int, void *)
static void acpi_bus_exit(void)
struct acpi_device * acpi_root
static void acpi_bus_check_scope(ACPI_HANDLE handle)
static int acpi_bus_attach(struct acpi_device *device, int level, void *data)
int acpi_bus_get_device(ACPI_HANDLE handle, struct acpi_device **device)
static int acpi_bus_get_power_flags(struct acpi_device *device)
BOOLEAN acpi_bus_power_manageable(ACPI_HANDLE handle)
ACPI_STATUS acpi_bus_get_status_handle(ACPI_HANDLE handle, unsigned long long *sta)
static int acpi_bus_remove(struct acpi_device *device, int type)
int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, ACPI_HANDLE handle, int type)
static int acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
void acpi_bus_data_handler(ACPI_HANDLE handle, void *context)
int acpi_bus_set_power(ACPI_HANDLE handle, int state)
static int acpi_bus_get_flags(struct acpi_device *device)
void acpi_pic_sci_set_trigger(unsigned int irq, UINT16 trigger)
int acpi_bus_get_status(struct acpi_device *device)
static int acpi_device_unregister(struct acpi_device *device)
static int acpi_device_register(struct acpi_device *device, struct acpi_device *parent)
static int acpi_bus_walk(struct acpi_device *start, acpi_bus_walk_callback callback, int direction, void *data)
static int acpi_bus_find_driver(struct acpi_device *device)
void acpi_bus_private_data_handler(ACPI_HANDLE handle, void *context)
#define NODE_TO_DEVICE(n)
static int acpi_bus_unattach(struct acpi_device *device, int level, void *data)
int acpi_bus_get_private_data(ACPI_HANDLE handle, void **data)
static int acpi_bus_get_perf_flags(struct acpi_device *device)
KSPIN_LOCK acpi_bus_event_lock
void acpi_bus_unregister_driver(struct acpi_driver *driver)
int FixedPowerButtonCount
BOOLEAN acpi_bus_can_wakeup(ACPI_HANDLE handle)
static int acpi_bus_scan_fixed(struct acpi_device *root)
static FAST_MUTEX acpi_bus_drivers_lock
int acpi_bus_receive_event(struct acpi_bus_event *event)
int acpi_bus_scan(struct acpi_device *start)
static void acpi_bus_check_device(ACPI_HANDLE handle)
int acpi_power_get_inferred_state(struct acpi_device *device)
int acpi_power_init(void)
int acpi_power_transition(struct acpi_device *device, int state)
int acpi_system_init(void)
void acpi_system_exit(void)
ACPI_STATUS acpi_evaluate_integer(ACPI_HANDLE handle, ACPI_STRING pathname, ACPI_OBJECT_LIST *arguments, unsigned long long *data)
ACPI_STATUS acpi_evaluate_reference(ACPI_HANDLE handle, ACPI_STRING pathname, ACPI_OBJECT_LIST *arguments, struct acpi_handle_list *list)
#define INIT_LIST_HEAD(ptr)
#define list_entry(ptr, type, member)
static void list_del(struct list_head *entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define KeInitializeSpinLock(sl)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
ACPI_STATUS AcpiRemoveNotifyHandler(ACPI_HANDLE Device, UINT32 HandlerType, ACPI_NOTIFY_HANDLER Handler)
ACPI_STATUS AcpiInstallNotifyHandler(ACPI_HANDLE Device, UINT32 HandlerType, ACPI_NOTIFY_HANDLER Handler, void *Context)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
ACPI_STATUS AcpiWriteBitRegister(UINT32 RegisterId, UINT32 Value)
#define memcpy(s1, s2, n)
#define ExFreePoolWithTag(_P, _T)
#define sprintf(buf, format,...)
static IPrintDialogCallback callback
static SCRIPT_CACHE * psc
struct @1677::@1678 driver
ACPI_STATUS AcpiAttachData(ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, void *Data)
ACPI_STATUS AcpiGetData(ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, void **Data)
ACPI_STATUS AcpiEvaluateObject(ACPI_HANDLE Handle, ACPI_STRING Pathname, ACPI_OBJECT_LIST *ExternalParams, ACPI_BUFFER *ReturnBuffer)
ACPI_STATUS AcpiGetObjectInfo(ACPI_HANDLE Handle, ACPI_DEVICE_INFO **ReturnBuffer)
ACPI_STATUS AcpiGetHandle(ACPI_HANDLE Parent, ACPI_STRING Pathname, ACPI_HANDLE *RetHandle)
ACPI_STATUS AcpiGetName(ACPI_HANDLE Handle, UINT32 NameType, ACPI_BUFFER *Buffer)
ACPI_STATUS AcpiGetParent(ACPI_HANDLE Handle, ACPI_HANDLE *RetHandle)
ACPI_STATUS AcpiGetNextObject(ACPI_OBJECT_TYPE Type, ACPI_HANDLE Parent, ACPI_HANDLE Child, ACPI_HANDLE *RetHandle)
ACPI_STATUS AcpiGetType(ACPI_HANDLE Handle, ACPI_OBJECT_TYPE *RetType)
struct acpi_handle_list resources
struct acpi_device_power_state::@626 flags
struct acpi_device_status status
#define LIST_HEAD(name, type)
ACPI_STATUS ACPI_INIT_FUNCTION AcpiTerminate(void)
ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem(UINT32 Flags)
ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects(UINT32 Flags)
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID DeferredContext
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2