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

/* 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]>
 */

#ifndef _ZD_USB_H
#define _ZD_USB_H

#include <linux/completion.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/usb.h>

#include "zd_def.h"

#define ZD_USB_TX_HIGH
#define ZD_USB_TX_LOW

#define ZD_TX_TIMEOUT
#define ZD_TX_WATCHDOG_INTERVAL
#define ZD_RX_IDLE_INTERVAL

enum devicetype {};

enum endpoints {};

enum {};

enum control_requests {};

struct usb_req_read_regs {} __packed;

struct reg_data {} __packed;

struct usb_req_write_regs {} __packed;

enum {};

struct usb_req_rfwrite {} __packed;

/* USB interrupt */

enum usb_int_id {};

enum usb_int_flags {};

struct usb_int_header {} __packed;

struct usb_int_regs {} __packed;

struct usb_int_retry_fail {} __packed;

struct read_regs_int {};

struct zd_ioreq16 {};

struct zd_ioreq32 {};

struct zd_usb_interrupt {};

static inline struct usb_int_regs *get_read_regs(struct zd_usb_interrupt *intr)
{}

#define RX_URBS_COUNT

struct zd_usb_rx {};

/**
 * struct zd_usb_tx - structure used for transmitting frames
 * @enabled: atomic enabled flag, indicates whether tx is enabled
 * @lock: lock for transmission
 * @submitted: anchor for URBs sent to device
 * @submitted_urbs: atomic integer that counts the URBs having sent to the
 *	device, which haven't been completed
 * @stopped: indicates whether higher level tx queues are stopped
 */
struct zd_usb_tx {};

/* Contains the usb parts. The structure doesn't require a lock because intf
 * will not be changed after initialization.
 */
struct zd_usb {};

#define zd_usb_dev(usb)

static inline struct usb_device *zd_usb_to_usbdev(struct zd_usb *usb)
{}

static inline struct ieee80211_hw *zd_intf_to_hw(struct usb_interface *intf)
{}

static inline struct ieee80211_hw *zd_usb_to_hw(struct zd_usb *usb)
{}

void zd_usb_init(struct zd_usb *usb, struct ieee80211_hw *hw,
	         struct usb_interface *intf);
int zd_usb_init_hw(struct zd_usb *usb);
void zd_usb_clear(struct zd_usb *usb);

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

void zd_tx_watchdog_enable(struct zd_usb *usb);
void zd_tx_watchdog_disable(struct zd_usb *usb);

int zd_usb_enable_int(struct zd_usb *usb);
void zd_usb_disable_int(struct zd_usb *usb);

int zd_usb_enable_rx(struct zd_usb *usb);
void zd_usb_disable_rx(struct zd_usb *usb);

void zd_usb_reset_rx_idle_timer(struct zd_usb *usb);

void zd_usb_enable_tx(struct zd_usb *usb);
void zd_usb_disable_tx(struct zd_usb *usb);

int zd_usb_tx(struct zd_usb *usb, struct sk_buff *skb);

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

static inline int zd_usb_ioread16(struct zd_usb *usb, u16 *value,
	                      const zd_addr_t addr)
{}

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);

int zd_usb_read_fw(struct zd_usb *usb, zd_addr_t addr, u8 *data, u16 len);

extern struct workqueue_struct *zd_workqueue;

#endif /* _ZD_USB_H */