/* SPDX-License-Identifier: GPL-2.0 */ /* * Linux Plug and Play Support * Copyright by Adam Belay <ambx1@neo.rr.com> * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. * Bjorn Helgaas <bjorn.helgaas@hp.com>
*/
struct pnp_card { struct device dev; /* Driver Model device interface */ unsignedchar number; /* used as an index, must be unique */ struct list_head global_list; /* node in global list of cards */ struct list_head protocol_list; /* node in protocol's list of cards */ struct list_head devices; /* devices attached to the card */
char name[PNP_NAME_LEN]; /* contains a human-readable name */ unsignedchar pnpver; /* Plug & Play version */ unsignedchar productver; /* product version */ unsignedint serial; /* serial number */ unsignedchar checksum; /* if zero - checksum passed */ struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */
};
struct pnp_dev { struct device dev; /* Driver Model device interface */
u64 dma_mask; unsignedint number; /* used as an index, must be unique */ int status;
struct list_head global_list; /* node in global list of devices */ struct list_head protocol_list; /* node in list of device's protocol */ struct list_head card_list; /* node in card's list of devices */ struct list_head rdev_list; /* node in cards list of requested devices */
struct pnp_protocol *protocol; struct pnp_card *card; /* card the device is attached to, none if NULL */ struct pnp_driver *driver; struct pnp_card_link *card_link;
struct pnp_id *id; /* supported EISA IDs */
int active; int capabilities; unsignedint num_dependent_sets; struct list_head resources; struct list_head options;
char name[PNP_NAME_LEN]; /* contains a human-readable name */ int flags; /* used by protocols */ struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ void *data;
};
/* 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 */
/* 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) */ unsignedchar number; /* protocol number */ struct device dev; /* link to driver model */ struct list_head cards; struct list_head devices;
};
/* 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, constchar *id); int pnp_register_driver(struct pnp_driver *drv); void pnp_unregister_driver(struct pnp_driver *drv);
/** * module_pnp_driver() - Helper macro for registering a PnP driver * @__pnp_driver: pnp_driver struct * * Helper macro for PnP drivers which do not do anything special in module * init/exit. This eliminates a lot of boilerplate. Each module may only * use this macro once, and calling it replaces module_init() and module_exit()
*/ #define module_pnp_driver(__pnp_driver) \
module_driver(__pnp_driver, pnp_register_driver, \
pnp_unregister_driver)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.