/** * pnp_add_card_id - adds an EISA id to the specified card * @id: pointer to a pnp_id structure * @card: pointer to the desired card
*/ staticstruct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id)
{ struct pnp_id *dev_id, *ptr;
dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) return NULL;
/** * pnp_add_card - adds a PnP card to the PnP Layer * @card: pointer to the card to add
*/ int pnp_add_card(struct pnp_card *card)
{ int error; struct list_head *pos, *temp;
/* we wait until now to add devices in order to ensure the drivers * will be able to use all of the related devices on the card
* without waiting an unreasonable length of time */
list_for_each(pos, &card->devices) { struct pnp_dev *dev = card_to_pnp_dev(pos);
__pnp_add_device(dev);
}
/** * pnp_add_card_device - adds a device to the specified card * @card: pointer to the card to add to * @dev: pointer to the device to add
*/ int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev)
{
dev->dev.parent = &card->dev;
dev->card_link = NULL;
dev_set_name(&dev->dev, "%02x:%02x.%02x",
dev->protocol->number, card->number, dev->number);
mutex_lock(&pnp_lock);
dev->card = card;
list_add_tail(&dev->card_list, &card->devices);
mutex_unlock(&pnp_lock); return 0;
}
/** * pnp_request_card_device - Searches for a PnP device under the specified card * @clink: pointer to the card link, cannot be NULL * @id: pointer to a PnP ID structure that explains the rules for finding the device * @from: Starting place to search from. If NULL it will start from the beginning.
*/ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, constchar *id, struct pnp_dev *from)
{ struct list_head *pos; struct pnp_dev *dev; struct pnp_card_driver *drv; struct pnp_card *card;
if (!clink || !id) return NULL;
card = clink->card;
drv = clink->driver; if (!from) {
pos = card->devices.next;
} else { if (from->card != card) return NULL;
pos = from->card_list.next;
} while (pos != &card->devices) {
dev = card_to_pnp_dev(pos); if ((!dev->card_link) && compare_pnp_id(dev->id, id)) goto found;
pos = pos->next;
}
return NULL;
found:
dev->card_link = clink;
dev->dev.driver = &drv->link.driver; if (pnp_bus_type.probe(&dev->dev)) goto err_out; if (device_bind_driver(&dev->dev)) goto err_out;
/** * pnp_release_card_device - call this when the driver no longer needs the device * @dev: pointer to the PnP device structure
*/ void pnp_release_card_device(struct pnp_dev *dev)
{ struct pnp_card_driver *drv = dev->card_link->driver;
/** * pnp_register_card_driver - registers a PnP card driver with the PnP Layer * @drv: pointer to the driver to register
*/ int pnp_register_card_driver(struct pnp_card_driver *drv)
{ int error; struct list_head *pos, *temp;
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.