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

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

#include <linux/netdevice.h>
#include <linux/if_vlan.h>
#include <net/ip.h>
#include <linux/ipv6.h>
#include <net/checksum.h>
#include <linux/printk.h>
#include <linux/jiffies.h>

#include "qlcnic.h"

#define QLCNIC_TX_ETHER_PKT
#define QLCNIC_TX_TCP_PKT
#define QLCNIC_TX_UDP_PKT
#define QLCNIC_TX_IP_PKT
#define QLCNIC_TX_TCP_LSO
#define QLCNIC_TX_TCP_LSO6
#define QLCNIC_TX_ENCAP_PKT
#define QLCNIC_TX_ENCAP_LSO
#define QLCNIC_TX_TCPV6_PKT
#define QLCNIC_TX_UDPV6_PKT

#define QLCNIC_FLAGS_VLAN_TAGGED
#define QLCNIC_FLAGS_VLAN_OOB

#define qlcnic_set_tx_vlan_tci(cmd_desc, v)
#define qlcnic_set_cmd_desc_port(cmd_desc, var)
#define qlcnic_set_cmd_desc_ctxid(cmd_desc, var)

#define qlcnic_set_tx_port(_desc, _port)

#define qlcnic_set_tx_flags_opcode(_desc, _flags, _opcode)

#define qlcnic_set_tx_frags_len(_desc, _frags, _len)

/* owner bits of status_desc */
#define STATUS_OWNER_HOST
#define STATUS_OWNER_PHANTOM

/* Status descriptor:
   0-3 port, 4-7 status, 8-11 type, 12-27 total_length
   28-43 reference_handle, 44-47 protocol, 48-52 pkt_offset
   53-55 desc_cnt, 56-57 owner, 58-63 opcode
 */
#define qlcnic_get_sts_port(sts_data)
#define qlcnic_get_sts_status(sts_data)
#define qlcnic_get_sts_type(sts_data)
#define qlcnic_get_sts_totallength(sts_data)
#define qlcnic_get_sts_refhandle(sts_data)
#define qlcnic_get_sts_prot(sts_data)
#define qlcnic_get_sts_pkt_offset(sts_data)
#define qlcnic_get_sts_desc_cnt(sts_data)
#define qlcnic_get_sts_opcode(sts_data)

#define qlcnic_get_lro_sts_refhandle(sts_data)
#define qlcnic_get_lro_sts_length(sts_data)
#define qlcnic_get_lro_sts_l2_hdr_offset(sts_data)
#define qlcnic_get_lro_sts_l4_hdr_offset(sts_data)
#define qlcnic_get_lro_sts_timestamp(sts_data)
#define qlcnic_get_lro_sts_type(sts_data)
#define qlcnic_get_lro_sts_push_flag(sts_data)
#define qlcnic_get_lro_sts_seq_number(sts_data)
#define qlcnic_get_lro_sts_mss(sts_data1)

#define qlcnic_83xx_get_lro_sts_mss(sts)

/* opcode field in status_desc */
#define QLCNIC_SYN_OFFLOAD
#define QLCNIC_RXPKT_DESC
#define QLCNIC_OLD_RXPKT_DESC
#define QLCNIC_RESPONSE_DESC
#define QLCNIC_LRO_DESC

#define QLCNIC_TCP_HDR_SIZE
#define QLCNIC_TCP_TS_OPTION_SIZE
#define QLCNIC_FETCH_RING_ID(handle)
#define QLCNIC_DESC_OWNER_FW

#define QLCNIC_TCP_TS_HDR_SIZE

/* for status field in status_desc */
#define STATUS_CKSUM_LOOP
#define STATUS_CKSUM_OK

#define qlcnic_83xx_pktln(sts)
#define qlcnic_83xx_hndl(sts)
#define qlcnic_83xx_csum_status(sts)
#define qlcnic_83xx_opcode(sts)
#define qlcnic_83xx_vlan_tag(sts)
#define qlcnic_83xx_lro_pktln(sts)
#define qlcnic_83xx_l2_hdr_off(sts)
#define qlcnic_83xx_l4_hdr_off(sts)
#define qlcnic_83xx_pkt_cnt(sts)
#define qlcnic_83xx_is_tstamp(sts)
#define qlcnic_83xx_is_psh_bit(sts)
#define qlcnic_83xx_is_ip_align(sts)
#define qlcnic_83xx_has_vlan_tag(sts)

static int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring,
				   int max);

static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *,
					    struct qlcnic_host_rds_ring *,
					    u16, u16);

static inline u8 qlcnic_mac_hash(u64 mac, u16 vlan)
{}

static inline u32 qlcnic_get_ref_handle(struct qlcnic_adapter *adapter,
					u16 handle, u8 ring_id)
{}

static inline int qlcnic_82xx_is_lb_pkt(u64 sts_data)
{}

static void qlcnic_delete_rx_list_mac(struct qlcnic_adapter *adapter,
				      struct qlcnic_filter *fil,
				      void *addr, u16 vlan_id)
{}

static struct qlcnic_filter *qlcnic_find_mac_filter(struct hlist_head *head,
						    void *addr, u16 vlan_id)
{}

static void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter,
				 struct sk_buff *skb, int loopback_pkt, u16 vlan_id)
{}

void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter, u64 *uaddr,
			       u16 vlan_id, struct qlcnic_host_tx_ring *tx_ring)
{}

static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
			       struct cmd_desc_type0 *first_desc,
			       struct sk_buff *skb,
			       struct qlcnic_host_tx_ring *tx_ring)
{}

#define QLCNIC_ENCAP_VXLAN_PKT
#define QLCNIC_ENCAP_OUTER_L3_IP6
#define QLCNIC_ENCAP_INNER_L3_IP6
#define QLCNIC_ENCAP_INNER_L4_UDP
#define QLCNIC_ENCAP_DO_L3_CSUM
#define QLCNIC_ENCAP_DO_L4_CSUM

static int qlcnic_tx_encap_pkt(struct qlcnic_adapter *adapter,
			       struct cmd_desc_type0 *first_desc,
			       struct sk_buff *skb,
			       struct qlcnic_host_tx_ring *tx_ring)
{}

static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter,
			 struct cmd_desc_type0 *first_desc, struct sk_buff *skb,
			 struct qlcnic_host_tx_ring *tx_ring)
{}

static int qlcnic_map_tx_skb(struct pci_dev *pdev, struct sk_buff *skb,
			     struct qlcnic_cmd_buffer *pbuf)
{}

static void qlcnic_unmap_buffers(struct pci_dev *pdev, struct sk_buff *skb,
				 struct qlcnic_cmd_buffer *pbuf)
{}

static inline void qlcnic_clear_cmddesc(u64 *desc)
{}

netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{}

void qlcnic_advert_link_change(struct qlcnic_adapter *adapter, int linkup)
{}

static int qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
			       struct qlcnic_host_rds_ring *rds_ring,
			       struct qlcnic_rx_buffer *buffer)
{}

static void qlcnic_post_rx_buffers_nodb(struct qlcnic_adapter *adapter,
					struct qlcnic_host_rds_ring *rds_ring,
					u8 ring_id)
{}

static int qlcnic_process_cmd_ring(struct qlcnic_adapter *adapter,
				   struct qlcnic_host_tx_ring *tx_ring,
				   int budget)
{}

static int qlcnic_poll(struct napi_struct *napi, int budget)
{}

static int qlcnic_tx_poll(struct napi_struct *napi, int budget)
{}

static int qlcnic_rx_poll(struct napi_struct *napi, int budget)
{}

static void qlcnic_handle_linkevent(struct qlcnic_adapter *adapter,
				    struct qlcnic_fw_msg *msg)
{}

static void qlcnic_handle_fw_message(int desc_cnt, int index,
				     struct qlcnic_host_sds_ring *sds_ring)
{}

static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *adapter,
					    struct qlcnic_host_rds_ring *ring,
					    u16 index, u16 cksum)
{}

static inline int qlcnic_check_rx_tagging(struct qlcnic_adapter *adapter,
					  struct sk_buff *skb, u16 *vlan_tag)
{}

static struct qlcnic_rx_buffer *
qlcnic_process_rcv(struct qlcnic_adapter *adapter,
		   struct qlcnic_host_sds_ring *sds_ring, int ring,
		   u64 sts_data0)
{}

#define QLC_TCP_HDR_SIZE
#define QLC_TCP_TS_OPTION_SIZE
#define QLC_TCP_TS_HDR_SIZE

static struct qlcnic_rx_buffer *
qlcnic_process_lro(struct qlcnic_adapter *adapter,
		   int ring, u64 sts_data0, u64 sts_data1)
{}

static int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max)
{}

void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter,
			    struct qlcnic_host_rds_ring *rds_ring, u8 ring_id)
{}

static void dump_skb(struct sk_buff *skb, struct qlcnic_adapter *adapter)
{}

static void qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, int ring,
				    u64 sts_data0)
{}

void qlcnic_82xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
{}

int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
			 struct net_device *netdev)
{}

void qlcnic_82xx_napi_del(struct qlcnic_adapter *adapter)
{}

void qlcnic_82xx_napi_enable(struct qlcnic_adapter *adapter)
{}

void qlcnic_82xx_napi_disable(struct qlcnic_adapter *adapter)
{}

#define QLC_83XX_NORMAL_LB_PKT
#define QLC_83XX_LRO_LB_PKT

static inline int qlcnic_83xx_is_lb_pkt(u64 sts_data, int lro_pkt)
{}

#define QLCNIC_ENCAP_LENGTH_MASK

static inline u8 qlcnic_encap_length(u64 sts_data)
{}

static struct qlcnic_rx_buffer *
qlcnic_83xx_process_rcv(struct qlcnic_adapter *adapter,
			struct qlcnic_host_sds_ring *sds_ring,
			u8 ring, u64 sts_data[])
{}

static struct qlcnic_rx_buffer *
qlcnic_83xx_process_lro(struct qlcnic_adapter *adapter,
			u8 ring, u64 sts_data[])
{}

static int qlcnic_83xx_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring,
					int max)
{}

static int qlcnic_83xx_msix_sriov_vf_poll(struct napi_struct *napi, int budget)
{}

static int qlcnic_83xx_poll(struct napi_struct *napi, int budget)
{}

static int qlcnic_83xx_msix_tx_poll(struct napi_struct *napi, int budget)
{}

static int qlcnic_83xx_rx_poll(struct napi_struct *napi, int budget)
{}

void qlcnic_83xx_napi_enable(struct qlcnic_adapter *adapter)
{}

void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter)
{}

int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
			 struct net_device *netdev)
{}

void qlcnic_83xx_napi_del(struct qlcnic_adapter *adapter)
{}

static void qlcnic_83xx_process_rcv_diag(struct qlcnic_adapter *adapter,
					 int ring, u64 sts_data[])
{}

void qlcnic_83xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
{}