]> err.no Git - linux-2.6/blob - drivers/net/wireless/libertas/if_bootcmd.c
[PATCH] libertas: debug print spacing fixes in assoc.c
[linux-2.6] / drivers / net / wireless / libertas / if_bootcmd.c
1 /**
2   * This file contains functions used in USB Boot command
3   * and Boot2/FW update
4   */
5
6 #include <linux/delay.h>
7 #include <linux/firmware.h>
8 #include <linux/netdevice.h>
9 #include <linux/usb.h>
10
11 #define DRV_NAME "usb8xxx"
12
13 #include "defs.h"
14 #include "dev.h"
15 #include "if_usb.h"
16
17 /**
18  *  @brief This function issues Boot command to the Boot2 code
19  *  @param ivalue   1:Boot from FW by USB-Download
20  *                  2:Boot from FW in EEPROM
21  *  @return             0
22  */
23 int if_usb_issue_boot_command(wlan_private *priv, int ivalue)
24 {
25         struct usb_card_rec     *cardp = priv->card;
26         struct bootcmdstr       sbootcmd;
27         int i;
28
29         /* Prepare command */
30         sbootcmd.u32magicnumber = BOOT_CMD_MAGIC_NUMBER;
31         sbootcmd.u8cmd_tag = ivalue;
32         for (i=0; i<11; i++)
33                 sbootcmd.au8dumy[i]=0x00;
34         memcpy(cardp->bulk_out_buffer, &sbootcmd, sizeof(struct bootcmdstr));
35
36         /* Issue command */
37         usb_tx_block(priv, cardp->bulk_out_buffer, sizeof(struct bootcmdstr));
38
39         return 0;
40 }