android_kernel_xiaomi_sm8350/drivers/net/wireless/libertas/if_bootcmd.c
Marcelo Tosatti 876c9d3aeb [PATCH] Marvell Libertas 8388 802.11b/g USB driver
Add the Marvell Libertas 8388 802.11 USB driver.

Signed-off-by: Marcelo Tosatti <marcelo@kvack.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:54 -04:00

39 lines
925 B
C

/**
* This file contains functions used in USB Boot command
* and Boot2/FW update
*/
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/netdevice.h>
#include <linux/usb.h>
#include "defs.h"
#include "dev.h"
#include "if_usb.h"
/**
* @brief This function issues Boot command to the Boot2 code
* @param ivalue 1:Boot from FW by USB-Download
* 2:Boot from FW in EEPROM
* @return 0
*/
int if_usb_issue_boot_command(wlan_private *priv, int ivalue)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct bootcmdstr sbootcmd;
int i;
/* Prepare command */
sbootcmd.u32magicnumber = BOOT_CMD_MAGIC_NUMBER;
sbootcmd.u8cmd_tag = ivalue;
for (i=0; i<11; i++)
sbootcmd.au8dumy[i]=0x00;
memcpy(cardp->bulk_out_buffer, &sbootcmd, sizeof(struct bootcmdstr));
/* Issue command */
usb_tx_block(priv, cardp->bulk_out_buffer, sizeof(struct bootcmdstr));
return 0;
}