linux/drivers/usb/gadget/udc/net2280.h

// SPDX-License-Identifier: GPL-2.0+
/*
 * NetChip 2280 high/full speed USB device controller.
 * Unlike many such controllers, this one talks PCI.
 */

/*
 * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com)
 * Copyright (C) 2003 David Brownell
 * Copyright (C) 2014 Ricardo Ribalda - Qtechnology/AS
 */

#include <linux/usb/net2280.h>
#include <linux/usb/usb338x.h>

/*-------------------------------------------------------------------------*/

#ifdef	__KERNEL__

/* indexed registers [11.10] are accessed indirectly
 * caller must own the device lock.
 */

static inline u32 get_idx_reg(struct net2280_regs __iomem *regs, u32 index)
{}

static inline void
set_idx_reg(struct net2280_regs __iomem *regs, u32 index, u32 value)
{}

#endif	/* __KERNEL__ */

#define PCI_VENDOR_ID_PLX_LEGACY

#define PLX_LEGACY
#define PLX_2280
#define PLX_SUPERSPEED
#define PLX_PCIE

#define REG_DIAG
#define RETRY_COUNTER
#define FORCE_PCI_SERR
#define FORCE_PCI_INTERRUPT
#define FORCE_USB_INTERRUPT
#define FORCE_CPU_INTERRUPT
#define ILLEGAL_BYTE_ENABLES
#define FAST_TIMES
#define FORCE_RECEIVE_ERROR
#define FORCE_TRANSMIT_CRC_ERROR
#define REG_FRAME
#define REG_CHIPREV
#define REG_HS_NAK_RATE

#define CHIPREV_1
#define CHIPREV_1A

/* DEFECT 7374 */
#define DEFECT_7374_NUMBEROF_MAX_WAIT_LOOPS
#define DEFECT_7374_PROCESSOR_WAIT_TIME

/* ep0 max packet size */
#define EP0_SS_MAX_PACKET_SIZE
#define EP0_HS_MAX_PACKET_SIZE
#ifdef	__KERNEL__

/*-------------------------------------------------------------------------*/

/* [8.3] for scatter/gather i/o
 * use struct net2280_dma_regs bitfields
 */
struct net2280_dma {} __aligned();

/*-------------------------------------------------------------------------*/

/* DRIVER DATA STRUCTURES and UTILITIES */

struct net2280_ep {};

static inline void allow_status(struct net2280_ep *ep)
{}

static inline void allow_status_338x(struct net2280_ep *ep)
{}

struct net2280_request {};

struct net2280 {};

static inline void set_halt(struct net2280_ep *ep)
{}

static inline void clear_halt(struct net2280_ep *ep)
{}

/*
 * FSM value for Defect 7374 (U1U2 Test) is managed in
 * chip's SCRATCH register:
 */
#define DEFECT7374_FSM_FIELD

/* Waiting for Control Read:
 *  - A transition to this state indicates a fresh USB connection,
 *    before the first Setup Packet. The connection speed is not
 *    known. Firmware is waiting for the first Control Read.
 *  - Starting state: This state can be thought of as the FSM's typical
 *    starting state.
 *  - Tip: Upon the first SS Control Read the FSM never
 *    returns to this state.
 */
#define DEFECT7374_FSM_WAITING_FOR_CONTROL_READ

/* Non-SS Control Read:
 *  - A transition to this state indicates detection of the first HS
 *    or FS Control Read.
 *  - Tip: Upon the first SS Control Read the FSM never
 *    returns to this state.
 */
#define DEFECT7374_FSM_NON_SS_CONTROL_READ

/* SS Control Read:
 *  - A transition to this state indicates detection of the
 *    first SS Control Read.
 *  - This state indicates workaround completion. Workarounds no longer
 *    need to be applied (as long as the chip remains powered up).
 *  - Tip: Once in this state the FSM state does not change (until
 *    the chip's power is lost and restored).
 *  - This can be thought of as the final state of the FSM;
 *    the FSM 'locks-up' in this state until the chip loses power.
 */
#define DEFECT7374_FSM_SS_CONTROL_READ

#ifdef USE_RDK_LEDS

static inline void net2280_led_init(struct net2280 *dev)
{}

/* indicate speed with bi-color LED 0/1 */
static inline
void net2280_led_speed(struct net2280 *dev, enum usb_device_speed speed)
{}

/* indicate power with LED 2 */
static inline void net2280_led_active(struct net2280 *dev, int is_active)
{}

static inline void net2280_led_shutdown(struct net2280 *dev)
{}

#else

#define net2280_led_init
#define net2280_led_speed
#define net2280_led_shutdown

#endif

/*-------------------------------------------------------------------------*/

#define ep_dbg(ndev, fmt, args...)

#define ep_vdbg(ndev, fmt, args...)

#define ep_info(ndev, fmt, args...)

#define ep_warn(ndev, fmt, args...)

#define ep_err(ndev, fmt, args...)

/*-------------------------------------------------------------------------*/

static inline void set_fifo_bytecount(struct net2280_ep *ep, unsigned count)
{}

static inline void start_out_naking(struct net2280_ep *ep)
{}

static inline void stop_out_naking(struct net2280_ep *ep)
{}


static inline void set_max_speed(struct net2280_ep *ep, u32 max)
{}

#endif	/* __KERNEL__ */