1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Cavium, Inc
5 #ifndef _LIO_23XX_VF_H_
6 #define _LIO_23XX_VF_H_
10 #include "lio_struct.h"
12 static const struct lio_config default_cn23xx_conf = {
13 .card_type = LIO_23XX,
14 .card_name = LIO_23XX_NAME,
17 .max_iqs = CN23XX_CFG_IO_QUEUES,
19 (CN23XX_MAX_IQ_DESCRIPTORS * CN23XX_CFG_IO_QUEUES),
20 .instr_type = OCTEON_64BYTE_INSTR,
25 .max_oqs = CN23XX_CFG_IO_QUEUES,
26 .info_ptr = OCTEON_OQ_INFOPTR_MODE,
27 .refill_threshold = CN23XX_OQ_REFIL_THRESHOLD,
30 .num_nic_ports = CN23XX_DEFAULT_NUM_PORTS,
31 .num_def_rx_descs = CN23XX_MAX_OQ_DESCRIPTORS,
32 .num_def_tx_descs = CN23XX_MAX_IQ_DESCRIPTORS,
33 .def_rx_buf_size = CN23XX_OQ_BUF_SIZE,
36 static inline const struct lio_config *
37 lio_get_conf(struct lio_device *lio_dev)
39 const struct lio_config *default_lio_conf = NULL;
41 /* check the LIO Device model & return the corresponding lio
44 default_lio_conf = &default_cn23xx_conf;
46 if (default_lio_conf == NULL) {
47 lio_dev_err(lio_dev, "Configuration verification failed\n");
51 return default_lio_conf;
54 #define CN23XX_VF_BUSY_READING_REG_LOOP_COUNT 100000
56 void cn23xx_vf_ask_pf_to_do_flr(struct lio_device *lio_dev);
58 int cn23xx_pfvf_handshake(struct lio_device *lio_dev);
60 int cn23xx_vf_setup_device(struct lio_device *lio_dev);
62 void cn23xx_vf_handle_mbox(struct lio_device *lio_dev);
63 #endif /* _LIO_23XX_VF_H_ */