#include <linux/string.h>
#include <linux/types.h>
#include <linux/etherdevice.h>
#include <linux/pci.h>
#include <linux/wait.h>
#include "octep_config.h"
#include "octep_main.h"
#include "octep_ctrl_net.h"
#include "octep_pfvf_mbox.h"
#define OCTEP_CP_VERSION_CURRENT …
static const u32 req_hdr_sz = …;
static const u32 mtu_sz = …;
static const u32 mac_sz = …;
static const u32 state_sz = …;
static const u32 link_info_sz = …;
static const u32 offloads_sz = …;
static atomic_t ctrl_net_msg_id;
static const u32 octep_ctrl_net_h2f_cmd_versions[OCTEP_CTRL_NET_H2F_CMD_MAX] = …;
static const u32 octep_ctrl_net_f2h_cmd_versions[OCTEP_CTRL_NET_F2H_CMD_MAX] = …;
static void init_send_req(struct octep_ctrl_mbox_msg *msg, void *buf,
u16 sz, int vfid)
{ … }
static int octep_send_mbox_req(struct octep_device *oct,
struct octep_ctrl_net_wait_data *d,
bool wait_for_response)
{ … }
int octep_ctrl_net_init(struct octep_device *oct)
{ … }
int octep_ctrl_net_get_link_status(struct octep_device *oct, int vfid)
{ … }
int octep_ctrl_net_set_link_status(struct octep_device *oct, int vfid, bool up,
bool wait_for_response)
{ … }
int octep_ctrl_net_set_rx_state(struct octep_device *oct, int vfid, bool up,
bool wait_for_response)
{ … }
int octep_ctrl_net_get_mac_addr(struct octep_device *oct, int vfid, u8 *addr)
{ … }
int octep_ctrl_net_set_mac_addr(struct octep_device *oct, int vfid, u8 *addr,
bool wait_for_response)
{ … }
int octep_ctrl_net_get_mtu(struct octep_device *oct, int vfid)
{ … }
int octep_ctrl_net_set_mtu(struct octep_device *oct, int vfid, int mtu,
bool wait_for_response)
{ … }
int octep_ctrl_net_get_if_stats(struct octep_device *oct, int vfid,
struct octep_iface_rx_stats *rx_stats,
struct octep_iface_tx_stats *tx_stats)
{ … }
int octep_ctrl_net_get_link_info(struct octep_device *oct, int vfid,
struct octep_iface_link_info *link_info)
{ … }
int octep_ctrl_net_set_link_info(struct octep_device *oct, int vfid,
struct octep_iface_link_info *link_info,
bool wait_for_response)
{ … }
static void process_mbox_resp(struct octep_device *oct,
struct octep_ctrl_mbox_msg *msg)
{ … }
static int process_mbox_notify(struct octep_device *oct,
struct octep_ctrl_mbox_msg *msg)
{ … }
void octep_ctrl_net_recv_fw_messages(struct octep_device *oct)
{ … }
int octep_ctrl_net_get_info(struct octep_device *oct, int vfid,
struct octep_fw_info *info)
{ … }
int octep_ctrl_net_dev_remove(struct octep_device *oct, int vfid)
{ … }
int octep_ctrl_net_set_offloads(struct octep_device *oct, int vfid,
struct octep_ctrl_net_offloads *offloads,
bool wait_for_response)
{ … }
int octep_ctrl_net_uninit(struct octep_device *oct)
{ … }