libertas: add two-stage firmware request helper

SDIO, GSPI, and CS all use 2-stage firmware and the loading
process and logic should be the same.  Allow module parameters
to override the automatic firmware choice, otherwise just walk
the bus driver's firmware table and pick out the first firmware
pair that exists for the given model.

Some special care is taken to allow overriding of just the helper
or the main firmware, but let the other of the pair be chosen
automatically.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Dan Williams
2010-08-07 21:14:33 -05:00
committed by John W. Linville
parent 5cddea816e
commit 72f7a6671e
2 changed files with 118 additions and 0 deletions

View File

@@ -8,7 +8,14 @@
#define _LBS_DECL_H_
#include <linux/netdevice.h>
#include <linux/firmware.h>
/* Should be terminated by a NULL entry */
struct lbs_fw_table {
int model;
const char *helper;
const char *fwname;
};
struct lbs_private;
struct sk_buff;
@@ -53,4 +60,10 @@ int lbs_exit_auto_deep_sleep(struct lbs_private *priv);
u32 lbs_fw_index_to_data_rate(u8 index);
u8 lbs_data_rate_to_fw_index(u32 rate);
int lbs_get_firmware(struct device *dev, const char *user_helper,
const char *user_mainfw, u32 card_model,
const struct lbs_fw_table *fw_table,
const struct firmware **helper,
const struct firmware **mainfw);
#endif