linux/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * QLogic qlcnic NIC Driver
 * Copyright (c) 2009-2013 QLogic Corporation
 */

#include <linux/slab.h>
#include <net/ip.h>
#include <linux/bitops.h>

#include "qlcnic.h"
#include "qlcnic_hdr.h"

#define MASK(n)
#define OCM_WIN_P3P(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

struct qlcnic_ms_reg_ctrl {};

#ifndef readq
static inline u64 readq(void __iomem *addr)
{
	return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
}
#endif

#ifndef writeq
static inline void writeq(u64 val, void __iomem *addr)
{
	writel(((u32) (val)), (addr));
	writel(((u32) (val >> 32)), (addr + 4));
}
#endif

static struct crb_128M_2M_block_map
crb_128M_2M_map[64] __cacheline_aligned_in_smp =;

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

/*  PCI Windowing for DDR regions.  */

#define QLCNIC_PCIE_SEM_TIMEOUT

static void qlcnic_read_window_reg(u32 addr, void __iomem *bar0, u32 *data)
{}

static void qlcnic_write_window_reg(u32 addr, void __iomem *bar0, u32 data)
{}

int
qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg)
{}

void
qlcnic_pcie_sem_unlock(struct qlcnic_adapter *adapter, int sem)
{}

int qlcnic_ind_rd(struct qlcnic_adapter *adapter, u32 addr)
{}

int qlcnic_ind_wr(struct qlcnic_adapter *adapter, u32 addr, u32 data)
{}

static int
qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
		struct cmd_desc_type0 *cmd_desc_arr, int nr_desc)
{}

int qlcnic_82xx_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr,
				   u16 vlan_id, u8 op)
{}

int qlcnic_nic_del_mac(struct qlcnic_adapter *adapter, const u8 *addr)
{}

int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr, u16 vlan,
		       enum qlcnic_mac_type mac_type)
{}

void qlcnic_flush_mcast_mac(struct qlcnic_adapter *adapter)
{}

static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan)
{}

void qlcnic_set_multi(struct net_device *netdev)
{}

int qlcnic_82xx_nic_set_promisc(struct qlcnic_adapter *adapter, u32 mode)
{}

void qlcnic_82xx_free_mac_list(struct qlcnic_adapter *adapter)
{}

void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter)
{}

void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter)
{}

static int qlcnic_set_fw_loopback(struct qlcnic_adapter *adapter, u8 flag)
{}

int qlcnic_82xx_set_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
{}

int qlcnic_82xx_clear_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
{}

int qlcnic_82xx_read_phys_port_id(struct qlcnic_adapter *adapter)
{}

int qlcnic_82xx_set_rx_coalesce(struct qlcnic_adapter *adapter)
{}

/* Send the interrupt coalescing parameter set by ethtool to the card. */
int qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *adapter,
				     struct ethtool_coalesce *ethcoal)
{}

#define QLCNIC_ENABLE_IPV4_LRO
#define QLCNIC_ENABLE_IPV6_LRO

int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
{}

int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable)
{}


#define QLCNIC_RSS_HASHTYPE_IP_TCP
#define QLCNIC_ENABLE_TYPE_C_RSS
#define QLCNIC_RSS_FEATURE_FLAG
#define QLCNIC_RSS_IND_TABLE_MASK

int qlcnic_82xx_config_rss(struct qlcnic_adapter *adapter, int enable)
{}

void qlcnic_82xx_config_ipaddr(struct qlcnic_adapter *adapter,
			       __be32 ip, int cmd)
{}

int qlcnic_82xx_linkevent_request(struct qlcnic_adapter *adapter, int enable)
{}

static int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter)
{}

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

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

static netdev_features_t qlcnic_process_flags(struct qlcnic_adapter *adapter,
					      netdev_features_t features)
{}

netdev_features_t qlcnic_fix_features(struct net_device *netdev,
	netdev_features_t features)
{}


int qlcnic_set_features(struct net_device *netdev, netdev_features_t features)
{}

/*
 * Changes the CRB window to the specified 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 qlcnic_pci_get_crb_addr_2M(struct qlcnic_hardware_context *ahw,
				      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 int
qlcnic_pci_set_crbwindow_2M(struct qlcnic_adapter *adapter, ulong off)
{}

int qlcnic_82xx_hw_write_wx_2M(struct qlcnic_adapter *adapter, ulong off,
			       u32 data)
{}

int qlcnic_82xx_hw_read_wx_2M(struct qlcnic_adapter *adapter, ulong off,
			      int *err)
{}

void __iomem *qlcnic_get_ioaddr(struct qlcnic_hardware_context *ahw,
				u32 offset)
{}

static int qlcnic_pci_mem_access_direct(struct qlcnic_adapter *adapter,
					u32 window, u64 off, u64 *data, int op)
{}

static void
qlcnic_pci_camqm_read_2M(struct qlcnic_adapter *adapter, u64 off, u64 *data)
{}

static void
qlcnic_pci_camqm_write_2M(struct qlcnic_adapter *adapter, u64 off, u64 data)
{}



/* Set MS memory control data for different adapters */
static void qlcnic_set_ms_controls(struct qlcnic_adapter *adapter, u64 off,
				   struct qlcnic_ms_reg_ctrl *ms)
{}

int qlcnic_pci_mem_write_2M(struct qlcnic_adapter *adapter, u64 off, u64 data)
{}

int qlcnic_pci_mem_read_2M(struct qlcnic_adapter *adapter, u64 off, u64 *data)
{}

int qlcnic_82xx_get_board_info(struct qlcnic_adapter *adapter)
{}

static int
qlcnic_wol_supported(struct qlcnic_adapter *adapter)
{}

int qlcnic_82xx_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate)
{}

void qlcnic_82xx_get_beacon_state(struct qlcnic_adapter *adapter)
{}

void qlcnic_82xx_get_func_no(struct qlcnic_adapter *adapter)
{}

void qlcnic_82xx_read_crb(struct qlcnic_adapter *adapter, char *buf,
			  loff_t offset, size_t size)
{}

void qlcnic_82xx_write_crb(struct qlcnic_adapter *adapter, char *buf,
			   loff_t offset, size_t size)
{}

int qlcnic_82xx_api_lock(struct qlcnic_adapter *adapter)
{}

void qlcnic_82xx_api_unlock(struct qlcnic_adapter *adapter)
{}

int qlcnic_82xx_shutdown(struct pci_dev *pdev)
{}

int qlcnic_82xx_resume(struct qlcnic_adapter *adapter)
{}