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

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

#include <linux/types.h>

#include "qlcnic_sriov.h"
#include "qlcnic.h"
#include "qlcnic_83xx_hw.h"

#define QLC_BC_COMMAND
#define QLC_BC_RESPONSE

#define QLC_MBOX_RESP_TIMEOUT
#define QLC_MBOX_CH_FREE_TIMEOUT

#define QLC_BC_MSG
#define QLC_BC_CFREE
#define QLC_BC_FLR
#define QLC_BC_HDR_SZ
#define QLC_BC_PAYLOAD_SZ

#define QLC_DEFAULT_RCV_DESCRIPTORS_SRIOV_VF
#define QLC_DEFAULT_JUMBO_RCV_DESCRIPTORS_SRIOV_VF

#define QLC_83XX_VF_RESET_FAIL_THRESH
#define QLC_BC_CMD_MAX_RETRY_CNT

static void qlcnic_sriov_handle_async_issue_cmd(struct work_struct *work);
static void qlcnic_sriov_vf_free_mac_list(struct qlcnic_adapter *);
static int qlcnic_sriov_alloc_bc_mbx_args(struct qlcnic_cmd_args *, u32);
static void qlcnic_sriov_vf_poll_dev_state(struct work_struct *);
static void qlcnic_sriov_vf_cancel_fw_work(struct qlcnic_adapter *);
static void qlcnic_sriov_cleanup_transaction(struct qlcnic_bc_trans *);
static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *,
				  struct qlcnic_cmd_args *);
static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *, u8);
static void qlcnic_sriov_process_bc_cmd(struct work_struct *);
static int qlcnic_sriov_vf_shutdown(struct pci_dev *);
static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *);
static int qlcnic_sriov_async_issue_cmd(struct qlcnic_adapter *,
					struct qlcnic_cmd_args *);

static struct qlcnic_hardware_ops qlcnic_sriov_vf_hw_ops =;

static struct qlcnic_nic_template qlcnic_sriov_vf_ops =;

static const struct qlcnic_mailbox_metadata qlcnic_sriov_bc_mbx_tbl[] =;

static inline bool qlcnic_sriov_bc_msg_check(u32 val)
{}

static inline bool qlcnic_sriov_channel_free_check(u32 val)
{}

static inline bool qlcnic_sriov_flr_check(u32 val)
{}

static inline u8 qlcnic_sriov_target_func_id(u32 val)
{}

static int qlcnic_sriov_virtid_fn(struct qlcnic_adapter *adapter, int vf_id)
{}

int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)
{}

void qlcnic_sriov_cleanup_list(struct qlcnic_trans_list *t_list)
{}

void __qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter)
{}

static void qlcnic_sriov_vf_cleanup(struct qlcnic_adapter *adapter)
{}

void qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr,
				    u32 *pay, u8 pci_func, u8 size)
{}

static void qlcnic_sriov_vf_cfg_buff_desc(struct qlcnic_adapter *adapter)
{}

int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *adapter,
				   struct qlcnic_info *npar_info, u16 vport_id)
{}

static int qlcnic_sriov_set_pvid_mode(struct qlcnic_adapter *adapter,
				      struct qlcnic_cmd_args *cmd)
{}

static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
					    struct qlcnic_cmd_args *cmd)
{}

static int qlcnic_sriov_get_vf_acl(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_init_driver(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_setup_vf(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_check_dev_ready(struct qlcnic_adapter *adapter)
{}

int qlcnic_sriov_vf_init(struct qlcnic_adapter *adapter)
{}

void qlcnic_sriov_vf_set_ops(struct qlcnic_adapter *adapter)
{}

void qlcnic_sriov_vf_register_map(struct qlcnic_hardware_context *ahw)
{}

static u32 qlcnic_sriov_get_bc_paysize(u32 real_pay_size, u8 curr_frag)
{}

int qlcnic_sriov_func_to_index(struct qlcnic_adapter *adapter, u8 pci_func)
{}

static inline int qlcnic_sriov_alloc_bc_trans(struct qlcnic_bc_trans **trans)
{}

static inline int qlcnic_sriov_alloc_bc_msg(struct qlcnic_bc_hdr **hdr,
					    u32 size)
{}

static int qlcnic_sriov_alloc_bc_mbx_args(struct qlcnic_cmd_args *mbx, u32 type)
{}

static int qlcnic_sriov_prepare_bc_hdr(struct qlcnic_bc_trans *trans,
				       struct qlcnic_cmd_args *cmd,
				       u16 seq, u8 msg_type)
{}

static void qlcnic_sriov_cleanup_transaction(struct qlcnic_bc_trans *trans)
{}

static int qlcnic_sriov_clear_trans(struct qlcnic_vf_info *vf,
				    struct qlcnic_bc_trans *trans, u8 type)
{}

static void qlcnic_sriov_schedule_bc_cmd(struct qlcnic_sriov *sriov,
					 struct qlcnic_vf_info *vf,
					 work_func_t func)
{}

static inline void qlcnic_sriov_wait_for_resp(struct qlcnic_bc_trans *trans)
{}

static void qlcnic_sriov_handle_multi_frags(struct qlcnic_bc_trans *trans,
					    u8 type)
{}

static void qlcnic_sriov_wait_for_channel_free(struct qlcnic_bc_trans *trans,
					       u8 type)
{}

static void qlcnic_sriov_pull_bc_msg(struct qlcnic_adapter *adapter,
				     u32 *hdr, u32 *pay, u32 size)
{}

static int __qlcnic_sriov_issue_bc_post(struct qlcnic_vf_info *vf)
{}

static int qlcnic_sriov_issue_bc_post(struct qlcnic_bc_trans *trans, u8 type)
{}

static int __qlcnic_sriov_send_bc_msg(struct qlcnic_bc_trans *trans,
				      struct qlcnic_vf_info *vf, u8 type)
{}

static int qlcnic_sriov_send_bc_cmd(struct qlcnic_adapter *adapter,
				    struct qlcnic_bc_trans *trans, int pci_func)
{}

static void __qlcnic_sriov_process_bc_cmd(struct qlcnic_adapter *adapter,
					  struct qlcnic_bc_trans *trans,
					  struct qlcnic_cmd_args *cmd)
{}

static void qlcnic_sriov_process_bc_cmd(struct work_struct *work)
{}

static void qlcnic_sriov_handle_bc_resp(struct qlcnic_bc_hdr *hdr,
					struct qlcnic_vf_info *vf)
{}

int __qlcnic_sriov_add_act_list(struct qlcnic_sriov *sriov,
				struct qlcnic_vf_info *vf,
				struct qlcnic_bc_trans *trans)
{}

static int qlcnic_sriov_add_act_list(struct qlcnic_sriov *sriov,
				     struct qlcnic_vf_info *vf,
				     struct qlcnic_bc_trans *trans)
{}

static void qlcnic_sriov_handle_pending_trans(struct qlcnic_sriov *sriov,
					      struct qlcnic_vf_info *vf,
					      struct qlcnic_bc_hdr *hdr)
{}

static void qlcnic_sriov_handle_bc_cmd(struct qlcnic_sriov *sriov,
				       struct qlcnic_bc_hdr *hdr,
				       struct qlcnic_vf_info *vf)
{}

static void qlcnic_sriov_handle_msg_event(struct qlcnic_sriov *sriov,
					  struct qlcnic_vf_info *vf)
{}

static void qlcnic_sriov_handle_flr_event(struct qlcnic_sriov *sriov,
					  struct qlcnic_vf_info *vf)
{}

void qlcnic_sriov_handle_bc_event(struct qlcnic_adapter *adapter, u32 event)
{}

int qlcnic_sriov_cfg_bc_intr(struct qlcnic_adapter *adapter, u8 enable)
{}

static int qlcnic_sriov_retry_bc_cmd(struct qlcnic_adapter *adapter,
				     struct qlcnic_bc_trans *trans)
{}

static int __qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
				  struct qlcnic_cmd_args *cmd)
{}


static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
				  struct qlcnic_cmd_args *cmd)
{}

static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *adapter, u8 cmd_op)
{}

static void qlcnic_vf_add_mc_list(struct net_device *netdev, const u8 *mac,
				  enum qlcnic_mac_type mac_type)
{}

void qlcnic_sriov_cleanup_async_list(struct qlcnic_back_channel *bc)
{}

void qlcnic_sriov_vf_set_multi(struct net_device *netdev)
{}

static void qlcnic_sriov_handle_async_issue_cmd(struct work_struct *work)
{}

static struct qlcnic_async_cmd *
qlcnic_sriov_alloc_async_cmd(struct qlcnic_back_channel *bc,
			     struct qlcnic_cmd_args *cmd)
{}

static void qlcnic_sriov_schedule_async_cmd(struct qlcnic_back_channel *bc,
					    struct qlcnic_cmd_args *cmd)
{}

static int qlcnic_sriov_async_issue_cmd(struct qlcnic_adapter *adapter,
					struct qlcnic_cmd_args *cmd)
{}

static int qlcnic_sriov_vf_reinit_driver(struct qlcnic_adapter *adapter)
{}

static void qlcnic_sriov_vf_attach(struct qlcnic_adapter *adapter)
{}

static void qlcnic_sriov_vf_detach(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_handle_dev_ready(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_handle_context_reset(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_idc_ready_state(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_idc_failed_state(struct qlcnic_adapter *adapter)
{}

static int
qlcnic_sriov_vf_idc_need_quiescent_state(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_idc_init_reset_state(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_vf_idc_unknown_state(struct qlcnic_adapter *adapter)
{}

static void qlcnic_sriov_vf_periodic_tasks(struct qlcnic_adapter *adapter)
{}

static void qlcnic_sriov_vf_poll_dev_state(struct work_struct *work)
{}

static void qlcnic_sriov_vf_cancel_fw_work(struct qlcnic_adapter *adapter)
{}

static int qlcnic_sriov_check_vlan_id(struct qlcnic_sriov *sriov,
				      struct qlcnic_vf_info *vf, u16 vlan_id)
{}

static int qlcnic_sriov_validate_num_vlans(struct qlcnic_sriov *sriov,
					   struct qlcnic_vf_info *vf)
{}

static int qlcnic_sriov_validate_vlan_cfg(struct qlcnic_adapter *adapter,
					  u16 vid, u8 enable)
{}

static void qlcnic_sriov_vlan_operation(struct qlcnic_vf_info *vf, u16 vlan_id,
					enum qlcnic_vlan_operations opcode)
{}

int qlcnic_sriov_cfg_vf_guest_vlan(struct qlcnic_adapter *adapter,
				   u16 vid, u8 enable)
{}

static void qlcnic_sriov_vf_free_mac_list(struct qlcnic_adapter *adapter)
{}


static int qlcnic_sriov_vf_shutdown(struct pci_dev *pdev)
{}

static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter)
{}

int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
{}

void qlcnic_sriov_free_vlans(struct qlcnic_adapter *adapter)
{}

void qlcnic_sriov_add_vlan_id(struct qlcnic_sriov *sriov,
			      struct qlcnic_vf_info *vf, u16 vlan_id)
{}

void qlcnic_sriov_del_vlan_id(struct qlcnic_sriov *sriov,
			      struct qlcnic_vf_info *vf, u16 vlan_id)
{}

bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *vf)
{}