linux/drivers/net/ethernet/atheros/atl1e/atl1e.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright(c) 2007 Atheros Corporation. All rights reserved.
 * Copyright(c) 2007 xiong huang <[email protected]>
 *
 * Derived from Intel e1000 driver
 * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
 */

#ifndef _ATL1E_H_
#define _ATL1E_H_

#include <linux/interrupt.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/udp.h>
#include <linux/mii.h>
#include <linux/io.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/tcp.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/workqueue.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>

#include "atl1e_hw.h"

#define PCI_REG_COMMAND
#define CMD_IO_SPACE
#define CMD_MEMORY_SPACE
#define CMD_BUS_MASTER

#define BAR_0
#define BAR_1
#define BAR_5

/* Wake Up Filter Control */
#define AT_WUFC_LNKC
#define AT_WUFC_MAG
#define AT_WUFC_EX
#define AT_WUFC_MC
#define AT_WUFC_BC

#define SPEED_0
#define HALF_DUPLEX
#define FULL_DUPLEX

/* Error Codes */
#define AT_ERR_EEPROM
#define AT_ERR_PHY
#define AT_ERR_CONFIG
#define AT_ERR_PARAM
#define AT_ERR_MAC_TYPE
#define AT_ERR_PHY_TYPE
#define AT_ERR_PHY_SPEED
#define AT_ERR_PHY_RES
#define AT_ERR_TIMEOUT

#define MAX_JUMBO_FRAME_SIZE

#define AT_VLAN_TAG_TO_TPD_TAG(_vlan, _tpd)

#define AT_TPD_TAG_TO_VLAN_TAG(_tpd, _vlan)

#define AT_MAX_RECEIVE_QUEUE
#define AT_PAGE_NUM_PER_QUEUE

#define AT_DMA_HI_ADDR_MASK
#define AT_DMA_LO_ADDR_MASK

#define AT_TX_WATCHDOG
#define AT_MAX_INT_WORK
#define AT_TWSI_EEPROM_TIMEOUT
#define AT_HW_MAX_IDLE_DELAY
#define AT_SUSPEND_LINK_TIMEOUT

#define AT_REGS_LEN
#define AT_EEPROM_LEN
#define AT_ADV_MASK

/* tpd word 2 */
#define TPD_BUFLEN_MASK
#define TPD_BUFLEN_SHIFT
#define TPD_DMAINT_MASK
#define TPD_DMAINT_SHIFT
#define TPD_PKTNT_MASK
#define TPD_PKTINT_SHIFT
#define TPD_VLANTAG_MASK
#define TPD_VLAN_SHIFT

/* tpd word 3 bits 0:4 */
#define TPD_EOP_MASK
#define TPD_EOP_SHIFT
#define TPD_IP_VERSION_MASK
#define TPD_IP_VERSION_SHIFT
#define TPD_INS_VL_TAG_MASK
#define TPD_INS_VL_TAG_SHIFT
#define TPD_CC_SEGMENT_EN_MASK
#define TPD_CC_SEGMENT_EN_SHIFT
#define TPD_SEGMENT_EN_MASK
#define TPD_SEGMENT_EN_SHIFT

/* tdp word 3 bits 5:7 if ip version is 0 */
#define TPD_IP_CSUM_MASK
#define TPD_IP_CSUM_SHIFT
#define TPD_TCP_CSUM_MASK
#define TPD_TCP_CSUM_SHIFT
#define TPD_UDP_CSUM_MASK
#define TPD_UDP_CSUM_SHIFT

/* tdp word 3 bits 5:7 if ip version is 1 */
#define TPD_V6_IPHLLO_MASK
#define TPD_V6_IPHLLO_SHIFT

/* tpd word 3 bits 8:9 bit */
#define TPD_VL_TAGGED_MASK
#define TPD_VL_TAGGED_SHIFT
#define TPD_ETHTYPE_MASK
#define TPD_ETHTYPE_SHIFT

/* tdp word 3 bits 10:13 if ip version is 0 */
#define TDP_V4_IPHL_MASK
#define TPD_V4_IPHL_SHIFT

/* tdp word 3 bits 10:13 if ip version is 1 */
#define TPD_V6_IPHLHI_MASK
#define TPD_V6_IPHLHI_SHIFT

/* tpd word 3 bit 14:31 if segment enabled */
#define TPD_TCPHDRLEN_MASK
#define TPD_TCPHDRLEN_SHIFT
#define TPD_HDRFLAG_MASK
#define TPD_HDRFLAG_SHIFT
#define TPD_MSS_MASK
#define TPD_MSS_SHIFT

/* tdp word 3 bit 16:31 if custom csum enabled */
#define TPD_PLOADOFFSET_MASK
#define TPD_PLOADOFFSET_SHIFT
#define TPD_CCSUMOFFSET_MASK
#define TPD_CCSUMOFFSET_SHIFT

struct atl1e_tpd_desc {};

/* how about 0x2000 */
#define MAX_TX_BUF_LEN
#define MAX_TX_BUF_SHIFT
#define MAX_TSO_SEG_SIZE

/* rrs word 1 bit 0:31 */
#define RRS_RX_CSUM_MASK
#define RRS_RX_CSUM_SHIFT
#define RRS_PKT_SIZE_MASK
#define RRS_PKT_SIZE_SHIFT
#define RRS_CPU_NUM_MASK
#define RRS_CPU_NUM_SHIFT

#define RRS_IS_RSS_IPV4
#define RRS_IS_RSS_IPV4_TCP
#define RRS_IS_RSS_IPV6
#define RRS_IS_RSS_IPV6_TCP
#define RRS_IS_IPV6
#define RRS_IS_IP_FRAG
#define RRS_IS_IP_DF
#define RRS_IS_802_3
#define RRS_IS_VLAN_TAG
#define RRS_IS_ERR_FRAME
#define RRS_IS_IPV4
#define RRS_IS_UDP
#define RRS_IS_TCP
#define RRS_IS_BCAST
#define RRS_IS_MCAST
#define RRS_IS_PAUSE

#define RRS_ERR_BAD_CRC
#define RRS_ERR_CODE
#define RRS_ERR_DRIBBLE
#define RRS_ERR_RUNT
#define RRS_ERR_RX_OVERFLOW
#define RRS_ERR_TRUNC
#define RRS_ERR_IP_CSUM
#define RRS_ERR_L4_CSUM
#define RRS_ERR_LENGTH
#define RRS_ERR_DES_ADDR

struct atl1e_recv_ret_status {};

enum atl1e_dma_req_block {};

enum atl1e_rrs_type {};

enum atl1e_nic_type {};

struct atl1e_hw_stats {};

struct atl1e_hw {};

/*
 * wrapper around a pointer to a socket buffer,
 * so a DMA handle can be stored along with the buffer
 */
struct atl1e_tx_buffer {};

#define ATL1E_SET_PCIMAP_TYPE(tx_buff, type)

struct atl1e_rx_page {};

struct atl1e_rx_page_desc {};

/* transmit packet descriptor (tpd) ring */
struct atl1e_tx_ring {};

/* receive packet descriptor ring */
struct atl1e_rx_ring {};

/* board specific private data structure */
struct atl1e_adapter {};

#define AT_WRITE_REG(a, reg, value)

#define AT_WRITE_FLUSH(a)

#define AT_READ_REG(a, reg)

#define AT_WRITE_REGB(a, reg, value)

#define AT_READ_REGB(a, reg)

#define AT_WRITE_REGW(a, reg, value)

#define AT_READ_REGW(a, reg)

#define AT_WRITE_REG_ARRAY(a, reg, offset, value)

#define AT_READ_REG_ARRAY(a, reg, offset)

extern char atl1e_driver_name[];

void atl1e_check_options(struct atl1e_adapter *adapter);
int atl1e_up(struct atl1e_adapter *adapter);
void atl1e_down(struct atl1e_adapter *adapter);
void atl1e_reinit_locked(struct atl1e_adapter *adapter);
s32 atl1e_reset_hw(struct atl1e_hw *hw);
void atl1e_set_ethtool_ops(struct net_device *netdev);
#endif /* _ATL1_E_H_ */