linux/drivers/net/wireless/zydas/zd1211rw/zd_usb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* ZD1211 USB-WLAN driver for Linux
 *
 * Copyright (C) 2005-2007 Ulrich Kunitz <[email protected]>
 * Copyright (C) 2006-2007 Daniel Drake <[email protected]>
 * Copyright (C) 2006-2007 Michael Wu <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/firmware.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/usb.h>
#include <linux/workqueue.h>
#include <linux/module.h>
#include <net/mac80211.h>
#include <linux/unaligned.h>

#include "zd_def.h"
#include "zd_mac.h"
#include "zd_usb.h"

static const struct usb_device_id usb_ids[] =;

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_VERSION();
MODULE_DEVICE_TABLE(usb, usb_ids);

#define FW_ZD1211_PREFIX
#define FW_ZD1211B_PREFIX

static bool check_read_regs(struct zd_usb *usb, struct usb_req_read_regs *req,
			    unsigned int count);

/* USB device initialization */
static void int_urb_complete(struct urb *urb);

static int request_fw_file(
	const struct firmware **fw, const char *name, struct device *device)
{}

static inline u16 get_bcdDevice(const struct usb_device *udev)
{}

enum upload_code_flags {};

/* Ensures that MAX_TRANSFER_SIZE is even. */
#define MAX_TRANSFER_SIZE

static int upload_code(struct usb_device *udev,
	const u8 *data, size_t size, u16 code_offset, int flags)
{}

static u16 get_word(const void *data, u16 offset)
{}

static char *get_fw_name(struct zd_usb *usb, char *buffer, size_t size,
	               const char* postfix)
{}

static int handle_version_mismatch(struct zd_usb *usb,
	const struct firmware *ub_fw)
{}

static int upload_firmware(struct zd_usb *usb)
{}

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

/* Read data from device address space using "firmware interface" which does
 * not require firmware to be loaded. */
int zd_usb_read_fw(struct zd_usb *usb, zd_addr_t addr, u8 *data, u16 len)
{}

#define urb_dev(urb)

static inline void handle_regs_int_override(struct urb *urb)
{}

static inline void handle_regs_int(struct urb *urb)
{}

static void int_urb_complete(struct urb *urb)
{}

static inline int int_urb_interval(struct usb_device *udev)
{}

static inline int usb_int_enabled(struct zd_usb *usb)
{}

int zd_usb_enable_int(struct zd_usb *usb)
{}

void zd_usb_disable_int(struct zd_usb *usb)
{}

static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
			     unsigned int length)
{}

static void rx_urb_complete(struct urb *urb)
{}

static struct urb *alloc_rx_urb(struct zd_usb *usb)
{}

static void free_rx_urb(struct urb *urb)
{}

static int __zd_usb_enable_rx(struct zd_usb *usb)
{}

int zd_usb_enable_rx(struct zd_usb *usb)
{}

static void __zd_usb_disable_rx(struct zd_usb *usb)
{}

void zd_usb_disable_rx(struct zd_usb *usb)
{}

static void zd_usb_reset_rx(struct zd_usb *usb)
{}

/**
 * zd_usb_disable_tx - disable transmission
 * @usb: the zd1211rw-private USB structure
 *
 * Frees all URBs in the free list and marks the transmission as disabled.
 */
void zd_usb_disable_tx(struct zd_usb *usb)
{}

/**
 * zd_usb_enable_tx - enables transmission
 * @usb: a &struct zd_usb pointer
 *
 * This function enables transmission and prepares the &zd_usb_tx data
 * structure.
 */
void zd_usb_enable_tx(struct zd_usb *usb)
{}

static void tx_dec_submitted_urbs(struct zd_usb *usb)
{}

static void tx_inc_submitted_urbs(struct zd_usb *usb)
{}

/**
 * tx_urb_complete - completes the execution of an URB
 * @urb: a URB
 *
 * This function is called if the URB has been transferred to a device or an
 * error has happened.
 */
static void tx_urb_complete(struct urb *urb)
{}

/**
 * zd_usb_tx: initiates transfer of a frame of the device
 *
 * @usb: the zd1211rw-private USB structure
 * @skb: a &struct sk_buff pointer
 *
 * This function transmits a frame to the device. It doesn't wait for
 * completion. The frame must contain the control set and have all the
 * control set information available.
 *
 * The function returns 0 if the transfer has been successfully initiated.
 */
int zd_usb_tx(struct zd_usb *usb, struct sk_buff *skb)
{}

static bool zd_tx_timeout(struct zd_usb *usb)
{}

static void zd_tx_watchdog_handler(struct work_struct *work)
{}

void zd_tx_watchdog_enable(struct zd_usb *usb)
{}

void zd_tx_watchdog_disable(struct zd_usb *usb)
{}

static void zd_rx_idle_timer_handler(struct work_struct *work)
{}

static void zd_usb_reset_rx_idle_timer_tasklet(struct tasklet_struct *t)
{}

void zd_usb_reset_rx_idle_timer(struct zd_usb *usb)
{}

static inline void init_usb_interrupt(struct zd_usb *usb)
{}

static inline void init_usb_rx(struct zd_usb *usb)
{}

static inline void init_usb_tx(struct zd_usb *usb)
{}

void zd_usb_init(struct zd_usb *usb, struct ieee80211_hw *hw,
	         struct usb_interface *intf)
{}

void zd_usb_clear(struct zd_usb *usb)
{}

static const char *speed(enum usb_device_speed speed)
{}

static int scnprint_id(struct usb_device *udev, char *buffer, size_t size)
{}

int zd_usb_scnprint_id(struct zd_usb *usb, char *buffer, size_t size)
{}

#ifdef DEBUG
static void print_id(struct usb_device *udev)
{}
#else
#define print_id
#endif

static int eject_installer(struct usb_interface *intf)
{}

int zd_usb_init_hw(struct zd_usb *usb)
{}

static int probe(struct usb_interface *intf, const struct usb_device_id *id)
{}

static void disconnect(struct usb_interface *intf)
{}

static void zd_usb_resume(struct zd_usb *usb)
{}

static void zd_usb_stop(struct zd_usb *usb)
{}

static int pre_reset(struct usb_interface *intf)
{}

static int post_reset(struct usb_interface *intf)
{}

static struct usb_driver driver =;

struct workqueue_struct *zd_workqueue;

static int __init usb_init(void)
{}

static void __exit usb_exit(void)
{}

module_init();
module_exit(usb_exit);

static int zd_ep_regs_out_msg(struct usb_device *udev, void *data, int len,
			      int *actual_length, int timeout)
{}

static void prepare_read_regs_int(struct zd_usb *usb,
				  struct usb_req_read_regs *req,
				  unsigned int count)
{}

static void disable_read_regs_int(struct zd_usb *usb)
{}

static bool check_read_regs(struct zd_usb *usb, struct usb_req_read_regs *req,
			    unsigned int count)
{}

static int get_results(struct zd_usb *usb, u16 *values,
		       struct usb_req_read_regs *req, unsigned int count,
		       bool *retry)
{}

int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
	             const zd_addr_t *addresses, unsigned int count)
{}

static void iowrite16v_urb_complete(struct urb *urb)
{}

static int zd_submit_waiting_urb(struct zd_usb *usb, bool last)
{}

void zd_usb_iowrite16v_async_start(struct zd_usb *usb)
{}

int zd_usb_iowrite16v_async_end(struct zd_usb *usb, unsigned int timeout)
{}

int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
			    unsigned int count)
{}

int zd_usb_iowrite16v(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
			unsigned int count)
{}

int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits)
{}