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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (C) 2008, cozybit Inc.
 *  Copyright (C) 2003-2006, Marvell International Ltd.
 */
#define DRV_NAME

#define pr_fmt(fmt)

#include "libertas_tf.h"
#include "if_usb.h"

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

#define INSANEDEBUG
#define lbtf_deb_usb2(...)

#define MESSAGE_HEADER_LEN

static char *lbtf_fw_name =;
module_param_named(fw_name, lbtf_fw_name, charp, 0644);

MODULE_FIRMWARE();

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 int if_usb_prog_firmware(struct lbtf_private *priv);
static int if_usb_host_to_card(struct lbtf_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, u8 data);
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 lbtf_private *priv);

/**
 *  if_usb_write_bulk_callback -  call back to handle URB status
 *
 *  @urb:		pointer to urb structure
 */
static void if_usb_write_bulk_callback(struct urb *urb)
{}

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

static void if_usb_setup_firmware(struct lbtf_private *priv)
{}

static void if_usb_fw_timeo(struct timer_list *t)
{}

static const struct lbtf_ops if_usb_ops =;

/**
 *  if_usb_probe - sets the configuration values
 *
 *  @intf:	USB interface structure
 *  @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
 */
static void if_usb_disconnect(struct usb_interface *intf)
{}

/**
 *  if_usb_send_fw_pkt -  This function downloads the FW
 *
 *  @cardp:	pointer if_usb_card
 *
 *  Returns: 0
 */
static int if_usb_send_fw_pkt(struct if_usb_card *cardp)
{}

static int if_usb_reset_device(struct lbtf_private *priv)
{}

/**
 *  usb_tx_block - transfer data to the device
 *
 *  @cardp:	pointer if_usb_card
 *  @payload:	pointer to payload data
 *  @nb:	data length
 *  @data:	non-zero for data, zero for commands
 *
 *  Returns: 0 on success, nonzero otherwise.
 */
static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload,
			uint16_t nb, u8 data)
{}

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 lbtf_private *priv)
{}

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

/**
 *  if_usb_receive - read data received from the device.
 *
 *  @urb:		pointer to struct urb
 */
static void if_usb_receive(struct urb *urb)
{}

/**
 *  if_usb_host_to_card -  Download data to the device
 *
 *  @priv:		pointer to struct lbtf_private structure
 *  @type:		type of data
 *  @payload:		pointer to payload buffer
 *  @nb:		number of bytes
 *
 *  Returns: 0 on success, nonzero otherwise
 */
static int if_usb_host_to_card(struct lbtf_private *priv, uint8_t type,
			       uint8_t *payload, uint16_t nb)
{}

/**
 *  if_usb_issue_boot_command - Issue boot command to Boot2.
 *
 *  @cardp:	pointer if_usb_card
 *  @ivalue:   1 boots from FW by USB-Download, 2 boots from FW in EEPROM.
 *
 *  Returns: 0
 */
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 if the image is valid, nonzero otherwise.
 */
static int check_fwfile_format(const u8 *data, u32 totlen)
{}


static int if_usb_prog_firmware(struct lbtf_private *priv)
{}


#define if_usb_suspend
#define if_usb_resume

static struct usb_driver if_usb_driver =;

module_usb_driver();

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