linux/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2003 - 2009 NetXen, Inc.
 * Copyright (C) 2009 - QLogic Corporation.
 * All rights reserved.
 */

#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/slab.h>
#include "netxen_nic.h"
#include "netxen_nic_hw.h"

#include <net/ip.h>

#define MASK(n)
#define MN_WIN(addr)
#define OCM_WIN(addr)
#define MS_WIN(addr)

#define GET_MEM_OFFS_2M(addr)

#define CRB_BLK(off)
#define CRB_SUBBLK(off)
#define CRB_WINDOW_2M
#define CRB_HI(off)
#define CRB_INDIRECT_2M

static void netxen_nic_io_write_128M(struct netxen_adapter *adapter,
		void __iomem *addr, u32 data);
static u32 netxen_nic_io_read_128M(struct netxen_adapter *adapter,
		void __iomem *addr);

#define PCI_OFFSET_FIRST_RANGE(adapter, off)
#define PCI_OFFSET_SECOND_RANGE(adapter, off)
#define PCI_OFFSET_THIRD_RANGE(adapter, off)

static void __iomem *pci_base_offset(struct netxen_adapter *adapter,
					    unsigned long off)
{}

static crb_128M_2M_block_map_t
crb_128M_2M_map[64] __cacheline_aligned_in_smp =;

/*
 * top 12 bits of crb internal address (hub, agent)
 */
static unsigned crb_hub_agt[64] =;

/*  PCI Windowing for DDR regions.  */

#define NETXEN_WINDOW_ONE

#define NETXEN_PCIE_SEM_TIMEOUT

static int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu);

int
netxen_pcie_sem_lock(struct netxen_adapter *adapter, int sem, u32 id_reg)
{}

void
netxen_pcie_sem_unlock(struct netxen_adapter *adapter, int sem)
{}

static int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port)
{}

/* Disable an XG interface */
static int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
{}

#define NETXEN_UNICAST_ADDR(port, index)
#define NETXEN_MCAST_ADDR(port, index)
#define MAC_HI(addr)
#define MAC_LO(addr)

static int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode)
{}

static int netxen_p2_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr)
{}

static int
netxen_nic_enable_mcast_filter(struct netxen_adapter *adapter)
{}

static int
netxen_nic_disable_mcast_filter(struct netxen_adapter *adapter)
{}

static int
netxen_nic_set_mcast_addr(struct netxen_adapter *adapter,
		int index, u8 *addr)
{}

static void netxen_p2_nic_set_multi(struct net_device *netdev)
{}

static int
netxen_send_cmd_descs(struct netxen_adapter *adapter,
		struct cmd_desc_type0 *cmd_desc_arr, int nr_desc)
{}

static int
nx_p3_sre_macaddr_change(struct netxen_adapter *adapter, u8 *addr, unsigned op)
{}

static int nx_p3_nic_add_mac(struct netxen_adapter *adapter,
		const u8 *addr, struct list_head *del_list)
{}

static void netxen_p3_nic_set_multi(struct net_device *netdev)
{}

static int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode)
{}

void netxen_p3_free_mac_list(struct netxen_adapter *adapter)
{}

static int netxen_p3_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr)
{}

#define NETXEN_CONFIG_INTR_COALESCE

/*
 * Send the interrupt coalescing parameter set by ethtool to the card.
 */
int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
{}

int netxen_config_hw_lro(struct netxen_adapter *adapter, int enable)
{}

int netxen_config_bridged_mode(struct netxen_adapter *adapter, int enable)
{}


#define RSS_HASHTYPE_IP_TCP

int netxen_config_rss(struct netxen_adapter *adapter, int enable)
{}

int netxen_config_ipaddr(struct netxen_adapter *adapter, __be32 ip, int cmd)
{}

int netxen_linkevent_request(struct netxen_adapter *adapter, int enable)
{}

int netxen_send_lro_cleanup(struct netxen_adapter *adapter)
{}

/*
 * netxen_nic_change_mtu - Change the Maximum Transfer Unit
 * @returns 0 on success, negative on failure
 */

#define MTU_FUDGE_FACTOR

int netxen_nic_change_mtu(struct net_device *netdev, int mtu)
{}

static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
				  int size, __le32 * buf)
{}

int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 *mac)
{}

int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, u64 *mac)
{}

/*
 * Changes the CRB window to the specified window.
 */
static void
netxen_nic_pci_set_crbwindow_128M(struct netxen_adapter *adapter,
		u32 window)
{}

/*
 * Returns < 0 if off is not valid,
 *	 1 if window access is needed. 'off' is set to offset from
 *	   CRB space in 128M pci map
 *	 0 if no window access is needed. 'off' is set to 2M addr
 * In: 'off' is offset from base in 128M pci map
 */
static int
netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter,
		ulong off, void __iomem **addr)
{}

/*
 * In: 'off' is offset from CRB space in 128M pci map
 * Out: 'off' is 2M pci map addr
 * side effect: lock crb window
 */
static void
netxen_nic_pci_set_crbwindow_2M(struct netxen_adapter *adapter, ulong off)
{}

static void __iomem *
netxen_nic_map_indirect_address_128M(struct netxen_adapter *adapter,
		ulong win_off, void __iomem **mem_ptr)
{}

static int
netxen_nic_hw_write_wx_128M(struct netxen_adapter *adapter, ulong off, u32 data)
{}

static u32
netxen_nic_hw_read_wx_128M(struct netxen_adapter *adapter, ulong off)
{}

static int
netxen_nic_hw_write_wx_2M(struct netxen_adapter *adapter, ulong off, u32 data)
{}

static u32
netxen_nic_hw_read_wx_2M(struct netxen_adapter *adapter, ulong off)
{}

/* window 1 registers only */
static void netxen_nic_io_write_128M(struct netxen_adapter *adapter,
		void __iomem *addr, u32 data)
{}

static u32 netxen_nic_io_read_128M(struct netxen_adapter *adapter,
		void __iomem *addr)
{}

static void netxen_nic_io_write_2M(struct netxen_adapter *adapter,
		void __iomem *addr, u32 data)
{}

static u32 netxen_nic_io_read_2M(struct netxen_adapter *adapter,
		void __iomem *addr)
{}

void __iomem *
netxen_get_ioaddr(struct netxen_adapter *adapter, u32 offset)
{}

static int
netxen_nic_pci_set_window_128M(struct netxen_adapter *adapter,
		u64 addr, u32 *start)
{}

static int
netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter,
		u64 addr, u32 *start)
{}

static int
netxen_nic_pci_mem_access_direct(struct netxen_adapter *adapter, u64 off,
		u64 *data, int op)
{}

void
netxen_pci_camqm_read_2M(struct netxen_adapter *adapter, u64 off, u64 *data)
{}

void
netxen_pci_camqm_write_2M(struct netxen_adapter *adapter, u64 off, u64 data)
{}

#define MAX_CTL_CHECK

static int
netxen_nic_pci_mem_write_128M(struct netxen_adapter *adapter,
		u64 off, u64 data)
{}

static int
netxen_nic_pci_mem_read_128M(struct netxen_adapter *adapter,
		u64 off, u64 *data)
{}

static int
netxen_nic_pci_mem_write_2M(struct netxen_adapter *adapter,
		u64 off, u64 data)
{}

static int
netxen_nic_pci_mem_read_2M(struct netxen_adapter *adapter,
		u64 off, u64 *data)
{}

void
netxen_setup_hwops(struct netxen_adapter *adapter)
{}

int netxen_nic_get_board_info(struct netxen_adapter *adapter)
{}

/* NIU access sections */
static int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
{}

void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
{}

int
netxen_nic_wol_supported(struct netxen_adapter *adapter)
{}

static u32 netxen_md_cntrl(struct netxen_adapter *adapter,
			struct netxen_minidump_template_hdr *template_hdr,
			struct netxen_minidump_entry_crb *crtEntry)
{}

/* Read memory or MN */
static u32
netxen_md_rdmem(struct netxen_adapter *adapter,
		struct netxen_minidump_entry_rdmem
			*memEntry, u64 *data_buff)
{}

/* Read CRB operation */
static u32 netxen_md_rd_crb(struct netxen_adapter *adapter,
			struct netxen_minidump_entry_crb
				*crbEntry, u32 *data_buff)
{}

/* Read ROM */
static u32
netxen_md_rdrom(struct netxen_adapter *adapter,
			struct netxen_minidump_entry_rdrom
				*romEntry, __le32 *data_buff)
{}

/* Handle L2 Cache */
static u32
netxen_md_L2Cache(struct netxen_adapter *adapter,
				struct netxen_minidump_entry_cache
					*cacheEntry, u32 *data_buff)
{}


/* Handle L1 Cache */
static u32 netxen_md_L1Cache(struct netxen_adapter *adapter,
				struct netxen_minidump_entry_cache
					*cacheEntry, u32 *data_buff)
{}

/* Reading OCM memory */
static u32
netxen_md_rdocm(struct netxen_adapter *adapter,
				struct netxen_minidump_entry_rdocm
					*ocmEntry, u32 *data_buff)
{}

/* Read MUX data */
static u32
netxen_md_rdmux(struct netxen_adapter *adapter, struct netxen_minidump_entry_mux
					*muxEntry, u32 *data_buff)
{}

/* Handling Queue State Reads */
static u32
netxen_md_rdqueue(struct netxen_adapter *adapter,
				struct netxen_minidump_entry_queue
					*queueEntry, u32 *data_buff)
{}


/*
* We catch an error where driver does not read
* as much data as we expect from the entry.
*/

static int netxen_md_entry_err_chk(struct netxen_adapter *adapter,
				struct netxen_minidump_entry *entry, int esize)
{}

static int netxen_parse_md_template(struct netxen_adapter *adapter)
{}

static int
netxen_collect_minidump(struct netxen_adapter *adapter)
{}


void
netxen_dump_fw(struct netxen_adapter *adapter)
{}