linux/drivers/net/wireless/intersil/p54/p54pci.h

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef P54PCI_H
#define P54PCI_H
#include <linux/interrupt.h>

/*
 * Defines for PCI based mac80211 Prism54 driver
 *
 * Copyright (c) 2006, Michael Wu <[email protected]>
 *
 * Based on the islsm (softmac prism54) driver, which is:
 * Copyright 2004-2006 Jean-Baptiste Note <[email protected]>, et al.
 */

/* Device Interrupt register bits */
#define ISL38XX_DEV_INT_RESET
#define ISL38XX_DEV_INT_UPDATE
#define ISL38XX_DEV_INT_WAKEUP
#define ISL38XX_DEV_INT_SLEEP
#define ISL38XX_DEV_INT_ABORT
/* these two only used in USB */
#define ISL38XX_DEV_INT_DATA
#define ISL38XX_DEV_INT_MGMT

#define ISL38XX_DEV_INT_PCIUART_CTS
#define ISL38XX_DEV_INT_PCIUART_DR

/* Interrupt Identification/Acknowledge/Enable register bits */
#define ISL38XX_INT_IDENT_UPDATE
#define ISL38XX_INT_IDENT_INIT
#define ISL38XX_INT_IDENT_WAKEUP
#define ISL38XX_INT_IDENT_SLEEP
#define ISL38XX_INT_IDENT_PCIUART_CTS
#define ISL38XX_INT_IDENT_PCIUART_DR

/* Control/Status register bits */
#define ISL38XX_CTRL_STAT_SLEEPMODE
#define ISL38XX_CTRL_STAT_CLKRUN
#define ISL38XX_CTRL_STAT_RESET
#define ISL38XX_CTRL_STAT_RAMBOOT
#define ISL38XX_CTRL_STAT_STARTHALTED
#define ISL38XX_CTRL_STAT_HOST_OVERRIDE

struct p54p_csr {} __packed;

/* usb backend only needs the register defines above */
#ifndef P54USB_H
struct p54p_desc {
	__le32 host_addr;
	__le32 device_addr;
	__le16 len;
	__le16 flags;
} __packed;

struct p54p_ring_control {
	__le32 host_idx[4];
	__le32 device_idx[4];
	struct p54p_desc rx_data[8];
	struct p54p_desc tx_data[32];
	struct p54p_desc rx_mgmt[4];
	struct p54p_desc tx_mgmt[4];
} __packed;

#define P54P_READ
#define P54P_WRITE

struct p54p_priv {
	struct p54_common common;
	struct pci_dev *pdev;
	struct p54p_csr __iomem *map;
	struct tasklet_struct tasklet;
	const struct firmware *firmware;
	spinlock_t lock;
	struct p54p_ring_control *ring_control;
	dma_addr_t ring_control_dma;
	u32 rx_idx_data, tx_idx_data;
	u32 rx_idx_mgmt, tx_idx_mgmt;
	struct sk_buff *rx_buf_data[8];
	struct sk_buff *rx_buf_mgmt[4];
	struct sk_buff *tx_buf_data[32];
	struct sk_buff *tx_buf_mgmt[4];
	struct completion boot_comp;
	struct completion fw_loaded;
};

#endif /* P54USB_H */
#endif /* P54PCI_H */