/** * lbs_get_firmware_async - Retrieves firmware asynchronously. Can load * either a helper firmware and a main firmware (2-stage), or just the helper. * * @priv: Pointer to lbs_private instance * @device: A pointer to &device structure * @card_model: Bus-specific card model ID used to filter firmware table * elements * @fw_table: Table of firmware file names and device model numbers * terminated by an entry with a NULL helper name * @callback: User callback to invoke when firmware load succeeds or fails.
*/ int lbs_get_firmware_async(struct lbs_private *priv, struct device *device,
u32 card_model, conststruct lbs_fw_table *fw_table,
lbs_fw_cb callback)
{ unsignedlong flags;
spin_lock_irqsave(&priv->driver_lock, flags); if (priv->fw_callback) {
lbs_deb_fw("firmware load already in progress\n");
spin_unlock_irqrestore(&priv->driver_lock, flags); return -EBUSY;
}
/** * lbs_get_firmware - Retrieves two-stage firmware * * @dev: A pointer to &device structure * @card_model: Bus-specific card model ID used to filter firmware table * elements * @fw_table: Table of firmware file names and device model numbers * terminated by an entry with a NULL helper name * @helper: On success, the helper firmware; caller must free * @mainfw: On success, the main firmware; caller must free * * Deprecated: use lbs_get_firmware_async() instead. * * returns: 0 on success, non-zero on failure
*/ int lbs_get_firmware(struct device *dev, u32 card_model, conststruct lbs_fw_table *fw_table, conststruct firmware **helper, conststruct firmware **mainfw)
{ conststruct lbs_fw_table *iter; int ret;
BUG_ON(helper == NULL);
BUG_ON(mainfw == NULL);
/* Search for firmware to use from the table. */
iter = fw_table; while (iter && iter->helper) { if (iter->model != card_model) goto next;
if (*helper == NULL) {
ret = request_firmware(helper, iter->helper, dev); if (ret) goto next;
/* If the device has one-stage firmware (ie cf8305) and * we've got it then we don't need to bother with the * main firmware.
*/ if (iter->fwname == NULL) return 0;
}
if (*mainfw == NULL) {
ret = request_firmware(mainfw, iter->fwname, dev); if (ret) { /* Clear the helper to ensure we don't have * mismatched firmware pairs.
*/
release_firmware(*helper);
*helper = NULL;
}
}
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.