[PATCH] libertas: pass boot2 version to firmware

Dan Williams dcbw at redhat.com
Thu Jul 5 22:08:54 EDT 2007


On Thu, 2007-07-05 at 13:47 -0700, Luis Carlos Cobo wrote:
> Next to-be-released Marvell 'bleeding edge' firmware (probably 5.110.16.p2)
> version is necessary for this to work.

So what does this actually do?  It's unclear to me; doesn't the boot2
version come from the boot2 code itself?

Dan

> Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
> ---
>  drivers/net/wireless/libertas/cmd.c     |   15 +++++++++++++++
>  drivers/net/wireless/libertas/dev.h     |    1 +
>  drivers/net/wireless/libertas/host.h    |    2 ++
>  drivers/net/wireless/libertas/hostcmd.h |    6 ++++++
>  drivers/net/wireless/libertas/if_usb.c  |    1 +
>  drivers/net/wireless/libertas/main.c    |    4 ++++
>  6 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 8d2f9ba..cb4526d 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -879,6 +879,17 @@ static int wlan_cmd_mesh_access(wlan_private * priv,
>  	return 0;
>  }
>  
> +static int wlan_cmd_set_boot2_ver(wlan_private * priv,
> +				struct cmd_ds_command *cmd,
> +				u16 cmd_action, void *pdata_buf)
> +{
> +	struct cmd_ds_set_boot2_ver *boot2_ver = &cmd->params.boot2_ver;
> +	cmd->command = cpu_to_le16(CMD_SET_BOOT2_VER);
> +	cmd->size = cpu_to_le16(sizeof(struct cmd_ds_set_boot2_ver) + S_DS_GEN);
> +	boot2_ver->version = priv->boot2_version;
> +	return 0;
> +}
> +
>  void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
>  {
>  	unsigned long flags;
> @@ -1368,6 +1379,10 @@ int libertas_prepare_and_send_command(wlan_private * priv,
>  		ret = wlan_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf);
>  		break;
>  
> +	case CMD_SET_BOOT2_VER:
> +		ret = wlan_cmd_set_boot2_ver(priv, cmdptr, cmd_action, pdata_buf);
> +		break;
> +
>  	case CMD_GET_TSF:
>  		cmdptr->command = cpu_to_le16(CMD_GET_TSF);
>  		cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) +
> diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
> index 7c565cb..62926d2 100644
> --- a/drivers/net/wireless/libertas/dev.h
> +++ b/drivers/net/wireless/libertas/dev.h
> @@ -103,6 +103,7 @@ struct _wlan_private {
>  	int open;
>  	int mesh_open;
>  	int infra_open;
> +	__le16 boot2_version;
>  
>  	char name[DEV_NAME_LEN];
>  
> diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
> index c6b44c8..872e660 100644
> --- a/drivers/net/wireless/libertas/host.h
> +++ b/drivers/net/wireless/libertas/host.h
> @@ -112,6 +112,8 @@
>  
>  #define CMD_MESH_ACCESS               0x009b
>  
> +#define CMD_SET_BOOT2_VER                 0x00a5
> +
>  /* For the IEEE Power Save */
>  #define CMD_SUBCMD_ENTER_PS               0x0030
>  #define CMD_SUBCMD_EXIT_PS                0x0031
> diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
> index 44cf39c..8bdf2e3 100644
> --- a/drivers/net/wireless/libertas/hostcmd.h
> +++ b/drivers/net/wireless/libertas/hostcmd.h
> @@ -405,6 +405,11 @@ struct cmd_ds_802_11_rf_antenna {
>  
>  };
>  
> +struct cmd_ds_set_boot2_ver {
> +	u16 action;
> +	u16 version;
> +};
> +
>  struct cmd_ds_802_11_ps_mode {
>  	__le16 action;
>  	__le16 nullpktinterval;
> @@ -654,6 +659,7 @@ struct cmd_ds_command {
>  		struct cmd_ds_bt_access bt;
>  		struct cmd_ds_fwt_access fwt;
>  		struct cmd_ds_mesh_access mesh;
> +		struct cmd_ds_set_boot2_ver boot2_ver;
>  		struct cmd_ds_get_tsf gettsf;
>  		struct cmd_ds_802_11_subscribe_event subscribe_event;
>  	} params;
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index 5efdeac..d2f2126 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -217,6 +217,7 @@ static int if_usb_probe(struct usb_interface *intf,
>  	priv->hw_host_to_card = if_usb_host_to_card;
>  	priv->hw_get_int_status = if_usb_get_int_status;
>  	priv->hw_read_event_cause = if_usb_read_event_cause;
> +	priv->boot2_version = udev->descriptor.bcdDevice;
>  
>  	if (libertas_activate_card(priv))
>  		goto err_activate_card;
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 2713f57..720e75f 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -889,6 +889,10 @@ static int wlan_setup_station_hw(wlan_private * priv)
>  		goto done;
>  	}
>  
> +       /* Set the boot2 version in firmware */
> +       ret = libertas_prepare_and_send_command(priv, CMD_SET_BOOT2_VER,
> +                                   0, CMD_OPTION_WAITFORRSP, 0, NULL);
> +
>  	ret = 0;
>  done:
>  	lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);




More information about the libertas-dev mailing list