static int hclgevf_alloc_cmd_desc(struct hclgevf_cmq_ring *ring)
{
- int size = ring->desc_num * sizeof(struct hclgevf_desc);
+ int size = ring->desc_num * sizeof(struct hclge_desc);
ring->desc = dma_alloc_coherent(cmq_ring_to_dev(ring), size,
&ring->desc_dma_addr, GFP_KERNEL);
static void hclgevf_free_cmd_desc(struct hclgevf_cmq_ring *ring)
{
- int size = ring->desc_num * sizeof(struct hclgevf_desc);
+ int size = ring->desc_num * sizeof(struct hclge_desc);
if (ring->desc) {
dma_free_coherent(cmq_ring_to_dev(ring), size,
return ret;
}
-void hclgevf_cmd_setup_basic_desc(struct hclgevf_desc *desc,
+void hclgevf_cmd_setup_basic_desc(struct hclge_desc *desc,
enum hclgevf_opcode_type opcode, bool is_read)
{
- memset(desc, 0, sizeof(struct hclgevf_desc));
+ memset(desc, 0, sizeof(struct hclge_desc));
desc->opcode = cpu_to_le16(opcode);
desc->flag = cpu_to_le16(HCLGEVF_CMD_FLAG_NO_INTR |
HCLGEVF_CMD_FLAG_IN);
};
static void hclgevf_cmd_copy_desc(struct hclgevf_hw *hw,
- struct hclgevf_desc *desc, int num)
+ struct hclge_desc *desc, int num)
{
- struct hclgevf_desc *desc_to_use;
+ struct hclge_desc *desc_to_use;
int handle = 0;
while (handle < num) {
}
static int hclgevf_cmd_check_retval(struct hclgevf_hw *hw,
- struct hclgevf_desc *desc, int num, int ntc)
+ struct hclge_desc *desc, int num, int ntc)
{
u16 opcode, desc_ret;
int handle;
}
static int hclgevf_cmd_check_result(struct hclgevf_hw *hw,
- struct hclgevf_desc *desc, int num, int ntc)
+ struct hclge_desc *desc, int num, int ntc)
{
struct hclgevf_dev *hdev = (struct hclgevf_dev *)hw->hdev;
bool is_completed = false;
* This is the main send command for command queue, it
* sends the queue, cleans the queue, etc
*/
-int hclgevf_cmd_send(struct hclgevf_hw *hw, struct hclgevf_desc *desc, int num)
+int hclgevf_cmd_send(struct hclgevf_hw *hw, struct hclge_desc *desc, int num)
{
struct hclgevf_dev *hdev = (struct hclgevf_dev *)hw->hdev;
struct hclgevf_cmq_ring *csq = &hw->cmq.csq;
{
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
struct hclgevf_query_version_cmd *resp;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int status;
resp = (struct hclgevf_query_version_cmd *)desc.data;
static int hclgevf_firmware_compat_config(struct hclgevf_dev *hdev, bool en)
{
struct hclgevf_firmware_compat_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
u32 compat = 0;
hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_IMP_COMPAT_CFG, false);
#include <linux/io.h>
#include <linux/types.h>
#include "hnae3.h"
+#include "hclge_comm_cmd.h"
#define HCLGEVF_CMDQ_TX_TIMEOUT 30000
#define HCLGEVF_CMDQ_CLEAR_WAIT_TIME 200
u8 rsv[20];
};
-struct hclgevf_desc {
- __le16 opcode;
- __le16 flag;
- __le16 retval;
- __le16 rsv;
- __le32 data[6];
-};
-
struct hclgevf_desc_cb {
dma_addr_t dma;
void *va;
struct hclgevf_cmq_ring {
dma_addr_t desc_dma_addr;
- struct hclgevf_desc *desc;
+ struct hclge_desc *desc;
struct hclgevf_desc_cb *desc_cb;
struct hclgevf_dev *dev;
u32 head;
void hclgevf_cmd_uninit(struct hclgevf_dev *hdev);
int hclgevf_cmd_queue_init(struct hclgevf_dev *hdev);
-int hclgevf_cmd_send(struct hclgevf_hw *hw, struct hclgevf_desc *desc, int num);
-void hclgevf_cmd_setup_basic_desc(struct hclgevf_desc *desc,
+int hclgevf_cmd_send(struct hclgevf_hw *hw, struct hclge_desc *desc, int num);
+void hclgevf_cmd_setup_basic_desc(struct hclge_desc *desc,
enum hclgevf_opcode_type opcode,
bool is_read);
#endif
{
struct hnae3_knic_private_info *kinfo = &handle->kinfo;
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
struct hclgevf_tqp *tqp;
int status;
int i;
{
struct hclgevf_rss_config_cmd *req;
unsigned int key_offset = 0;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int key_counts;
int key_size;
int ret;
{
const u8 *indir = hdev->rss_cfg.rss_indirection_tbl;
struct hclgevf_rss_indirection_table_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int rss_cfg_tbl_num;
int status;
int i, j;
u16 tc_offset[HCLGEVF_MAX_TC_NUM];
u16 tc_valid[HCLGEVF_MAX_TC_NUM];
u16 tc_size[HCLGEVF_MAX_TC_NUM];
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
u16 roundup_size;
unsigned int i;
int status;
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg;
struct hclgevf_rss_input_tuple_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int ret;
if (hdev->ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2)
struct hclgevf_rss_cfg *rss_cfg)
{
struct hclgevf_rss_input_tuple_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int ret;
hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_RSS_INPUT_TUPLE, false);
u16 stream_id, bool enable)
{
struct hclgevf_cfg_com_tqp_queue_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
req = (struct hclgevf_cfg_com_tqp_queue_cmd *)desc.data;
static int hclgevf_config_gro(struct hclgevf_dev *hdev)
{
struct hclgevf_cfg_gro_status_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int ret;
if (!hnae3_dev_gro_supported(hdev))
static int hclgevf_query_vf_resource(struct hclgevf_dev *hdev)
{
struct hclgevf_query_res_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int ret;
hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_QUERY_VF_RSRC, true);
}
static void hclgevf_parse_dev_specs(struct hclgevf_dev *hdev,
- struct hclgevf_desc *desc)
+ struct hclge_desc *desc)
{
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
struct hclgevf_dev_specs_0_cmd *req0;
static int hclgevf_query_dev_specs(struct hclgevf_dev *hdev)
{
- struct hclgevf_desc desc[HCLGEVF_QUERY_DEV_SPECS_BD_NUM];
+ struct hclge_desc desc[HCLGEVF_QUERY_DEV_SPECS_BD_NUM];
int ret;
int i;
u8 *resp_data, u16 resp_len)
{
struct hclge_mbx_vf_to_pf_cmd *req;
- struct hclgevf_desc desc;
+ struct hclge_desc desc;
int status;
req = (struct hclge_mbx_vf_to_pf_cmd *)desc.data;
{
struct hclge_mbx_pf_to_vf_cmd *req;
struct hclgevf_cmq_ring *crq;
- struct hclgevf_desc *desc;
+ struct hclge_desc *desc;
u16 flag;
crq = &hdev->hw.cmq.crq;