// SPDX-License-Identifier: GPL-2.0 /* * manager.c - Resource Management, Conflict Resolution, Activation and Disabling of Devices * * based on isapnp.c resource management (c) Jaroslav Kysela <[email protected]> * Copyright 2003 Adam Belay <[email protected]> * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. * Bjorn Helgaas <[email protected]> */ #include <linux/errno.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/pnp.h> #include <linux/bitmap.h> #include <linux/mutex.h> #include "base.h" DEFINE_MUTEX(…) …; static struct resource *pnp_find_resource(struct pnp_dev *dev, unsigned char rule, unsigned long type, unsigned int bar) { … } static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) { … } static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) { … } static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) { … } #ifdef CONFIG_ISA_DMA_API static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) { … } #endif /* CONFIG_ISA_DMA_API */ void pnp_init_resources(struct pnp_dev *dev) { … } static void pnp_clean_resource_table(struct pnp_dev *dev) { … } /** * pnp_assign_resources - assigns resources to the device based on the specified dependent number * @dev: pointer to the desired device * @set: the dependent function number */ static int pnp_assign_resources(struct pnp_dev *dev, int set) { … } /** * pnp_auto_config_dev - automatically assigns resources to a device * @dev: pointer to the desired device */ int pnp_auto_config_dev(struct pnp_dev *dev) { … } /** * pnp_start_dev - low-level start of the PnP device * @dev: pointer to the desired device * * assumes that resources have already been allocated */ int pnp_start_dev(struct pnp_dev *dev) { … } EXPORT_SYMBOL(…); /** * pnp_stop_dev - low-level disable of the PnP device * @dev: pointer to the desired device * * does not free resources */ int pnp_stop_dev(struct pnp_dev *dev) { … } EXPORT_SYMBOL(…); /** * pnp_activate_dev - activates a PnP device for use * @dev: pointer to the desired device * * does not validate or set resources so be careful. */ int pnp_activate_dev(struct pnp_dev *dev) { … } EXPORT_SYMBOL(…); /** * pnp_disable_dev - disables device * @dev: pointer to the desired device * * inform the correct pnp protocol so that resources can be used by other devices */ int pnp_disable_dev(struct pnp_dev *dev) { … } EXPORT_SYMBOL(…);