libertas: support boot commands to write persistent firmware and bootloader
Add locking and non-locking versions of if_usb_prog_firmware to support programming firmware after and before driver bring-up respectively. Add more suitable error codes for firmware programming process. Add capability checks for persistent features before attempting to use them. Based on patches from Brajesh Dave and Priyank Singh. Signed-off-by: Brian Cavagnolo <brian@cozybit.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
38e3b0d86e
commit
1556c0f22d
@@ -1033,9 +1033,9 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int lbs_mesh_config_send(struct lbs_private *priv,
|
||||
struct cmd_ds_mesh_config *cmd,
|
||||
uint16_t action, uint16_t type)
|
||||
static int __lbs_mesh_config_send(struct lbs_private *priv,
|
||||
struct cmd_ds_mesh_config *cmd,
|
||||
uint16_t action, uint16_t type)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -1054,6 +1054,19 @@ int lbs_mesh_config_send(struct lbs_private *priv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int lbs_mesh_config_send(struct lbs_private *priv,
|
||||
struct cmd_ds_mesh_config *cmd,
|
||||
uint16_t action, uint16_t type)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!(priv->fwcapinfo & FW_CAPINFO_PERSISTENT_CONFIG))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ret = __lbs_mesh_config_send(priv, cmd, action, type);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* This function is the CMD_MESH_CONFIG legacy function. It only handles the
|
||||
* START and STOP actions. The extended actions supported by CMD_MESH_CONFIG
|
||||
* are all handled by preparing a struct cmd_ds_mesh_config and passing it to
|
||||
@@ -1095,7 +1108,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan)
|
||||
action, priv->mesh_tlv, chan,
|
||||
escape_essid(priv->mesh_ssid, priv->mesh_ssid_len));
|
||||
|
||||
return lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
|
||||
return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
|
||||
}
|
||||
|
||||
static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
|
||||
|
Reference in New Issue
Block a user