linux/drivers/net/wireless/purelifi/plfxlc/usb.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2021 pureLiFi
 */

#ifndef PLFXLC_USB_H
#define PLFXLC_USB_H

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

#include "intf.h"

#define USB_BULK_MSG_TIMEOUT_MS

#define PURELIFI_X_VENDOR_ID_0
#define PURELIFI_X_PRODUCT_ID_0
#define PURELIFI_XC_VENDOR_ID_0
#define PURELIFI_XC_PRODUCT_ID_0
#define PURELIFI_XL_VENDOR_ID_0
#define PURELIFI_XL_PRODUCT_ID_0

#define PLF_FPGA_STATUS_LEN
#define PLF_FPGA_STATE_LEN
#define PLF_BULK_TLEN
#define PLF_FPGA_MG
#define PLF_XL_BUF_LEN
#define PLF_MSG_STATUS_OFFSET

#define PLF_USB_TIMEOUT
#define PLF_MSLEEP_TIME

#define PURELIFI_URB_RETRY_MAX

#define plfxlc_usb_dev(usb)

/* Tx retry backoff timer (in milliseconds) */
#define TX_RETRY_BACKOFF_MS
#define STA_QUEUE_CLEANUP_MS

/* Tx retry backoff timer (in jiffies) */
#define TX_RETRY_BACKOFF_JIFF
#define STA_QUEUE_CLEANUP_JIFF

/* Ensures that MAX_TRANSFER_SIZE is even. */
#define MAX_TRANSFER_SIZE
#define plfxlc_urb_dev(urb)

#define STATION_FIFO_ALMOST_FULL_MESSAGE
#define STATION_FIFO_ALMOST_FULL_NOT_MESSAGE
#define STATION_CONNECT_MESSAGE
#define STATION_DISCONNECT_MESSAGE

int plfxlc_usb_wreq(struct usb_interface *ez_usb, void *buffer, int buffer_len,
		    enum plf_usb_req_enum usb_req_id);
void plfxlc_tx_urb_complete(struct urb *urb);

enum {};

struct plfxlc_usb_interrupt {};

#define RX_URBS_COUNT

struct plfxlc_usb_rx {};

struct plf_station {};

struct plfxlc_firmware_file {} __packed;

#define STATION_CONNECTED_FLAG
#define STATION_FIFO_FULL_FLAG
#define STATION_HEARTBEAT_FLAG
#define STATION_ACTIVE_FLAG

#define PURELIFI_SERIAL_LEN
#define STA_BROADCAST_INDEX
#define MAX_STA_NUM

struct plfxlc_usb_tx {};

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

enum endpoints {};

enum devicetype {};

enum {};

int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, const u8 *buffer,
			  int buffer_len, enum plf_usb_req_enum usb_req_id,
			  usb_complete_t complete_fn, void *context);

static inline struct usb_device *
plfxlc_usb_to_usbdev(struct plfxlc_usb *usb)
{}

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

static inline struct ieee80211_hw *
plfxlc_usb_to_hw(struct plfxlc_usb *usb)
{}

void plfxlc_usb_init(struct plfxlc_usb *usb, struct ieee80211_hw *hw,
		     struct usb_interface *intf);
void plfxlc_send_packet_from_data_queue(struct plfxlc_usb *usb);
void plfxlc_usb_release(struct plfxlc_usb *usb);
void plfxlc_usb_disable_rx(struct plfxlc_usb *usb);
void plfxlc_usb_enable_tx(struct plfxlc_usb *usb);
void plfxlc_usb_disable_tx(struct plfxlc_usb *usb);
int plfxlc_usb_tx(struct plfxlc_usb *usb, struct sk_buff *skb);
int plfxlc_usb_enable_rx(struct plfxlc_usb *usb);
int plfxlc_usb_init_hw(struct plfxlc_usb *usb);
const char *plfxlc_speed(enum usb_device_speed speed);

/* Firmware declarations */
int plfxlc_download_xl_firmware(struct usb_interface *intf);
int plfxlc_download_fpga(struct usb_interface *intf);

int plfxlc_upload_mac_and_serial(struct usb_interface *intf,
				 unsigned char *hw_address,
				 unsigned char *serial_number);

#endif /* PLFXLC_USB_H */