include/linux/pnp.h
Source file repositories/reference/linux-study-clean/include/linux/pnp.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/pnp.h- Extension
.h- Size
- 15338 bytes
- Lines
- 520
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/list.hlinux/errno.hlinux/mod_devicetable.hlinux/console.h
Detected Declarations
struct pnp_protocolstruct pnp_devstruct pnp_cardstruct pnp_card_linkstruct pnp_devstruct pnp_fixupstruct pnp_idstruct pnp_driverstruct pnp_card_driverstruct pnp_protocolfunction pnp_resource_validfunction pnp_resource_enabledfunction pnp_resource_lenfunction pnp_port_startfunction pnp_port_endfunction pnp_port_flagsfunction pnp_port_validfunction pnp_port_lenfunction pnp_mem_startfunction pnp_mem_endfunction pnp_mem_flagsfunction pnp_mem_validfunction pnp_mem_lenfunction pnp_irqfunction pnp_irq_flagsfunction pnp_irq_validfunction pnp_dmafunction pnp_dma_flagsfunction pnp_dma_validfunction pnp_set_card_drvdatafunction pnp_set_drvdatafunction pnp_device_attachfunction pnp_device_detachfunction pnp_release_card_devicefunction pnp_unregister_card_driverfunction pnp_auto_config_devfunction pnp_start_devfunction pnp_stop_devfunction pnp_activate_devfunction pnp_disable_devfunction pnp_range_reservedfunction pnp_is_activefunction compare_pnp_idfunction pnp_register_driverfunction pnp_unregister_driver
Annotated Snippet
struct device_driver driver;
};
#define to_pnp_driver(drv) container_of_const(drv, struct pnp_driver, driver)
struct pnp_card_driver {
struct list_head global_list;
char *name;
const struct pnp_card_device_id *id_table;
unsigned int flags;
int (*probe) (struct pnp_card_link *card,
const struct pnp_card_device_id *card_id);
void (*remove) (struct pnp_card_link *card);
int (*suspend) (struct pnp_card_link *card, pm_message_t state);
int (*resume) (struct pnp_card_link *card);
struct pnp_driver link;
};
#define to_pnp_card_driver(drv) container_of(drv, struct pnp_card_driver, link)
/* pnp driver flags */
#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */
#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */
/*
* Protocol Management
*/
struct pnp_protocol {
struct list_head protocol_list;
char *name;
/* resource control functions */
int (*get) (struct pnp_dev *dev);
int (*set) (struct pnp_dev *dev);
int (*disable) (struct pnp_dev *dev);
/* protocol specific suspend/resume */
bool (*can_wakeup) (struct pnp_dev *dev);
int (*suspend) (struct pnp_dev *dev, pm_message_t state);
int (*resume) (struct pnp_dev *dev);
/* used by pnp layer only (look but don't touch) */
unsigned char number; /* protocol number */
struct device dev; /* link to driver model */
struct list_head cards;
struct list_head devices;
};
#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
#define protocol_for_each_card(protocol, card) \
list_for_each_entry(card, &(protocol)->cards, protocol_list)
#define protocol_for_each_dev(protocol, dev) \
list_for_each_entry(dev, &(protocol)->devices, protocol_list)
#if defined(CONFIG_PNP)
/* device management */
int pnp_device_attach(struct pnp_dev *pnp_dev);
void pnp_device_detach(struct pnp_dev *pnp_dev);
extern struct list_head pnp_global;
extern int pnp_platform_devices;
/* multidevice card support */
struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
const char *id, struct pnp_dev *from);
void pnp_release_card_device(struct pnp_dev *dev);
int pnp_register_card_driver(struct pnp_card_driver *drv);
void pnp_unregister_card_driver(struct pnp_card_driver *drv);
extern struct list_head pnp_cards;
/* resource management */
int pnp_possible_config(struct pnp_dev *dev, int type, resource_size_t base,
resource_size_t size);
int pnp_auto_config_dev(struct pnp_dev *dev);
int pnp_start_dev(struct pnp_dev *dev);
int pnp_stop_dev(struct pnp_dev *dev);
int pnp_activate_dev(struct pnp_dev *dev);
int pnp_disable_dev(struct pnp_dev *dev);
int pnp_range_reserved(resource_size_t start, resource_size_t end);
/* protocol helpers */
int pnp_is_active(struct pnp_dev *dev);
int compare_pnp_id(struct pnp_id *pos, const char *id);
int pnp_register_driver(struct pnp_driver *drv);
void pnp_unregister_driver(struct pnp_driver *drv);
bool dev_is_pnp(const struct device *dev);
#else
Annotation
- Immediate include surface: `linux/device.h`, `linux/list.h`, `linux/errno.h`, `linux/mod_devicetable.h`, `linux/console.h`.
- Detected declarations: `struct pnp_protocol`, `struct pnp_dev`, `struct pnp_card`, `struct pnp_card_link`, `struct pnp_dev`, `struct pnp_fixup`, `struct pnp_id`, `struct pnp_driver`, `struct pnp_card_driver`, `struct pnp_protocol`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.