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

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

#include "b43legacy.h"

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


#define B43legacy_PIO_TXCTL
#define B43legacy_PIO_TXDATA
#define B43legacy_PIO_TXQBUFSIZE
#define B43legacy_PIO_RXCTL
#define B43legacy_PIO_RXDATA

#define B43legacy_PIO_TXCTL_WRITELO
#define B43legacy_PIO_TXCTL_WRITEHI
#define B43legacy_PIO_TXCTL_COMPLETE
#define B43legacy_PIO_TXCTL_INIT
#define B43legacy_PIO_TXCTL_SUSPEND

#define B43legacy_PIO_RXCTL_DATAAVAILABLE
#define B43legacy_PIO_RXCTL_READY

/* PIO constants */
#define B43legacy_PIO_MAXTXDEVQPACKETS
#define B43legacy_PIO_TXQADJUST

/* PIO tuning knobs */
#define B43legacy_PIO_MAXTXPACKETS



#ifdef CONFIG_B43LEGACY_PIO


struct b43legacy_pioqueue;
struct b43legacy_xmitstatus;

struct b43legacy_pio_txpacket {};

#define pio_txpacket_getindex(packet)

struct b43legacy_pioqueue {};

static inline
u16 b43legacy_pio_read(struct b43legacy_pioqueue *queue,
		     u16 offset)
{}

static inline
void b43legacy_pio_write(struct b43legacy_pioqueue *queue,
		       u16 offset, u16 value)
{}


int b43legacy_pio_init(struct b43legacy_wldev *dev);
void b43legacy_pio_free(struct b43legacy_wldev *dev);

int b43legacy_pio_tx(struct b43legacy_wldev *dev,
		   struct sk_buff *skb);
void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev,
				 const struct b43legacy_txstatus *status);
void b43legacy_pio_rx(struct b43legacy_pioqueue *queue);

/* Suspend TX queue in hardware. */
void b43legacy_pio_tx_suspend(struct b43legacy_pioqueue *queue);
void b43legacy_pio_tx_resume(struct b43legacy_pioqueue *queue);
/* Suspend (freeze) the TX tasklet (software level). */
void b43legacy_pio_freeze_txqueues(struct b43legacy_wldev *dev);
void b43legacy_pio_thaw_txqueues(struct b43legacy_wldev *dev);

#else /* CONFIG_B43LEGACY_PIO */

static inline
int b43legacy_pio_init(struct b43legacy_wldev *dev)
{
	return 0;
}
static inline
void b43legacy_pio_free(struct b43legacy_wldev *dev)
{
}
static inline
int b43legacy_pio_tx(struct b43legacy_wldev *dev,
		   struct sk_buff *skb)
{
	return 0;
}
static inline
void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev,
				 const struct b43legacy_txstatus *status)
{
}
static inline
void b43legacy_pio_rx(struct b43legacy_pioqueue *queue)
{
}
static inline
void b43legacy_pio_tx_suspend(struct b43legacy_pioqueue *queue)
{
}
static inline
void b43legacy_pio_tx_resume(struct b43legacy_pioqueue *queue)
{
}
static inline
void b43legacy_pio_freeze_txqueues(struct b43legacy_wldev *dev)
{
}
static inline
void b43legacy_pio_thaw_txqueues(struct b43legacy_wldev *dev)
{
}

#endif /* CONFIG_B43LEGACY_PIO */
#endif /* B43legacy_PIO_H_ */