linux/drivers/net/wireless/marvell/libertas/if_usb.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * This file contains functions used in USB interface module.
 */

#define pr_fmt(fmt)

#include <linux/delay.h>
#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/netdevice.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/olpc-ec.h>

#ifdef CONFIG_OLPC
#include <asm/olpc.h>
#endif

#define DRV_NAME

#include "host.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
#include "cmd.h"
#include "if_usb.h"

#define INSANEDEBUG
#define lbs_deb_usb2(...)

#define MESSAGE_HEADER_LEN

MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();

enum {};

/* table of firmware file names */
static const struct lbs_fw_table fw_table[] =;

static const struct usb_device_id if_usb_table[] =;

MODULE_DEVICE_TABLE(usb, if_usb_table);

static void if_usb_receive(struct urb *urb);
static void if_usb_receive_fwload(struct urb *urb);
static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
				 const struct firmware *fw,
				 const struct firmware *unused);
static int if_usb_host_to_card(struct lbs_private *priv, uint8_t type,
			       uint8_t *payload, uint16_t nb);
static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload,
			uint16_t nb);
static void if_usb_free(struct if_usb_card *cardp);
static int if_usb_submit_rx_urb(struct if_usb_card *cardp);
static int if_usb_reset_device(struct if_usb_card *cardp);

/**
 * if_usb_write_bulk_callback - callback function to handle the status
 * of the URB
 * @urb:	pointer to &urb structure
 * returns:	N/A
 */
static void if_usb_write_bulk_callback(struct urb *urb)
{}

/**
 * if_usb_free - free tx/rx urb, skb and rx buffer
 * @cardp:	pointer to &if_usb_card
 * returns:	N/A
 */
static void if_usb_free(struct if_usb_card *cardp)
{}

static void if_usb_setup_firmware(struct lbs_private *priv)
{}

static void if_usb_fw_timeo(struct timer_list *t)
{}

#ifdef CONFIG_OLPC
static void if_usb_reset_olpc_card(struct lbs_private *priv)
{
	printk(KERN_CRIT "Resetting OLPC wireless via EC...\n");
	olpc_ec_cmd(0x25, NULL, 0, NULL, 0);
}
#endif

/**
 * if_usb_probe - sets the configuration values
 * @intf:	&usb_interface pointer
 * @id:	pointer to usb_device_id
 * returns:	0 on success, error code on failure
 */
static int if_usb_probe(struct usb_interface *intf,
			const struct usb_device_id *id)
{}

/**
 * if_usb_disconnect - free resource and cleanup
 * @intf:	USB interface structure
 * returns:	N/A
 */
static void if_usb_disconnect(struct usb_interface *intf)
{}

/**
 * if_usb_send_fw_pkt - download FW
 * @cardp:	pointer to &struct if_usb_card
 * returns:	0
 */
static int if_usb_send_fw_pkt(struct if_usb_card *cardp)
{}

static int if_usb_reset_device(struct if_usb_card *cardp)
{}

/**
 *  usb_tx_block - transfer the data to the device
 *  @cardp: 	pointer to &struct if_usb_card
 *  @payload:	pointer to payload data
 *  @nb:	data length
 *  returns:	0 for success or negative error code
 */
static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb)
{}

static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
				  void (*callbackfn)(struct urb *urb))
{}

static int if_usb_submit_rx_urb_fwload(struct if_usb_card *cardp)
{}

static int if_usb_submit_rx_urb(struct if_usb_card *cardp)
{}

static void if_usb_receive_fwload(struct urb *urb)
{}

#define MRVDRV_MIN_PKT_LEN

static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb,
				       struct if_usb_card *cardp,
				       struct lbs_private *priv)
{}

static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
				      struct sk_buff *skb,
				      struct if_usb_card *cardp,
				      struct lbs_private *priv)
{}

/**
 *  if_usb_receive - read the packet into the upload buffer,
 *  wake up the main thread and initialise the Rx callack
 *
 *  @urb:	pointer to &struct urb
 *  returns:	N/A
 */
static void if_usb_receive(struct urb *urb)
{}

/**
 *  if_usb_host_to_card - downloads data to FW
 *  @priv:	pointer to &struct lbs_private structure
 *  @type:	type of data
 *  @payload:	pointer to data buffer
 *  @nb:	number of bytes
 *  returns:	0 for success or negative error code
 */
static int if_usb_host_to_card(struct lbs_private *priv, uint8_t type,
			       uint8_t *payload, uint16_t nb)
{}

/**
 *  if_usb_issue_boot_command - issues Boot command to the Boot2 code
 *  @cardp:	pointer to &if_usb_card
 *  @ivalue:	1:Boot from FW by USB-Download
 *		2:Boot from FW in EEPROM
 *  returns:	0 for success or negative error code
 */
static int if_usb_issue_boot_command(struct if_usb_card *cardp, int ivalue)
{}


/**
 *  check_fwfile_format - check the validity of Boot2/FW image
 *
 *  @data:	pointer to image
 *  @totlen:	image length
 *  returns:     0 (good) or 1 (failure)
 */
static int check_fwfile_format(const uint8_t *data, uint32_t totlen)
{}

static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
				 const struct firmware *fw,
				 const struct firmware *unused)
{}


#ifdef CONFIG_PM
static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
{}

static int if_usb_resume(struct usb_interface *intf)
{}
#else
#define if_usb_suspend
#define if_usb_resume
#endif

static struct usb_driver if_usb_driver =;

module_usb_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();