linux/drivers/pci/hotplug/acpiphp.h

/* 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 ([email protected])
 * Copyright (C) 2001 IBM Corp.
 * Copyright (C) 2002 Hiroshi Aono ([email protected])
 * Copyright (C) 2002,2003 Takayoshi Kochi ([email protected])
 * Copyright (C) 2002,2003 NEC Corporation
 * Copyright (C) 2003-2005 Matthew Wilcox ([email protected])
 * Copyright (C) 2003-2005 Hewlett Packard
 *
 * All rights reserved.
 *
 * Send feedback to <[email protected]>,
 *		    <[email protected]>
 *
 */

#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 {};

static inline const char *slot_name(struct slot *slot)
{}

static inline struct slot *to_slot(struct hotplug_slot *hotplug_slot)
{}

/*
 * struct acpiphp_bridge - PCI bridge information
 *
 * for each bridge device in ACPI namespace
 */
struct acpiphp_bridge {};


/*
 * struct acpiphp_slot - PCI slot information
 *
 * PCI slot information for each *physical* PCI slot
 */
struct acpiphp_slot {};


/*
 * 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_context {};

static inline struct acpiphp_context *to_acpiphp_context(struct acpi_hotplug_context *hp)
{}

static inline struct acpiphp_context *func_to_context(struct acpiphp_func *func)
{}

static inline struct acpi_device *func_to_acpi_device(struct acpiphp_func *func)
{}

static inline acpi_handle func_to_handle(struct acpiphp_func *func)
{}

struct acpiphp_root_context {};

static inline struct acpiphp_root_context *to_acpiphp_root_context(struct acpi_hotplug_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 {};

/* ACPI _STA method value (ignore bit 4; battery present) */
#define ACPI_STA_ALL

/* slot flags */

#define SLOT_ENABLED
#define SLOT_IS_GOING_AWAY

/* function flags */

#define FUNC_HAS_STA
#define FUNC_HAS_EJ0

/* 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);

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_latch_status(struct acpiphp_slot *slot);
u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot);

/* variables */
extern bool acpiphp_disabled;

#endif /* _ACPIPHP_H */