linux/drivers/net/wireless/broadcom/b43/pio.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef B43_PIO_H_
#define B43_PIO_H_

#include "b43.h"

#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/list.h>
#include <linux/skbuff.h>


/*** Registers for PIO queues up to revision 7. ***/
/* TX queue. */
#define B43_PIO_TXCTL
#define B43_PIO_TXCTL_WRITELO
#define B43_PIO_TXCTL_WRITEHI
#define B43_PIO_TXCTL_EOF
#define B43_PIO_TXCTL_FREADY
#define B43_PIO_TXCTL_FLUSHREQ
#define B43_PIO_TXCTL_FLUSHPEND
#define B43_PIO_TXCTL_SUSPREQ
#define B43_PIO_TXCTL_QSUSP
#define B43_PIO_TXCTL_COMMCNT
#define B43_PIO_TXCTL_COMMCNT_SHIFT
#define B43_PIO_TXDATA
#define B43_PIO_TXQBUFSIZE
/* RX queue. */
#define B43_PIO_RXCTL
#define B43_PIO_RXCTL_FRAMERDY
#define B43_PIO_RXCTL_DATARDY
#define B43_PIO_RXDATA

/*** Registers for PIO queues revision 8 and later. ***/
/* TX queue */
#define B43_PIO8_TXCTL
#define B43_PIO8_TXCTL_0_7
#define B43_PIO8_TXCTL_8_15
#define B43_PIO8_TXCTL_16_23
#define B43_PIO8_TXCTL_24_31
#define B43_PIO8_TXCTL_EOF
#define B43_PIO8_TXCTL_FREADY
#define B43_PIO8_TXCTL_SUSPREQ
#define B43_PIO8_TXCTL_QSUSP
#define B43_PIO8_TXCTL_FLUSHREQ
#define B43_PIO8_TXCTL_FLUSHPEND
#define B43_PIO8_TXDATA
/* RX queue */
#define B43_PIO8_RXCTL
#define B43_PIO8_RXCTL_FRAMERDY
#define B43_PIO8_RXCTL_DATARDY
#define B43_PIO8_RXDATA


/* The maximum number of TX-packets the HW can handle. */
#define B43_PIO_MAX_NR_TXPACKETS


struct b43_pio_txpacket {};

struct b43_pio_txqueue {};

struct b43_pio_rxqueue {};


static inline u16 b43_piotx_read16(struct b43_pio_txqueue *q, u16 offset)
{}

static inline u32 b43_piotx_read32(struct b43_pio_txqueue *q, u16 offset)
{}

static inline void b43_piotx_write16(struct b43_pio_txqueue *q,
				     u16 offset, u16 value)
{}

static inline void b43_piotx_write32(struct b43_pio_txqueue *q,
				     u16 offset, u32 value)
{}


static inline u16 b43_piorx_read16(struct b43_pio_rxqueue *q, u16 offset)
{}

static inline u32 b43_piorx_read32(struct b43_pio_rxqueue *q, u16 offset)
{}

static inline void b43_piorx_write16(struct b43_pio_rxqueue *q,
				     u16 offset, u16 value)
{}

static inline void b43_piorx_write32(struct b43_pio_rxqueue *q,
				     u16 offset, u32 value)
{}


int b43_pio_init(struct b43_wldev *dev);
void b43_pio_free(struct b43_wldev *dev);

int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb);
void b43_pio_handle_txstatus(struct b43_wldev *dev,
			     const struct b43_txstatus *status);
void b43_pio_rx(struct b43_pio_rxqueue *q);

void b43_pio_tx_suspend(struct b43_wldev *dev);
void b43_pio_tx_resume(struct b43_wldev *dev);

#endif /* B43_PIO_H_ */