net/bnxt: move PMD specific functions
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 9 Jun 2017 04:24:46 +0000 (23:24 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 12 Jun 2017 09:41:29 +0000 (10:41 +0100)
Move PMD specific functions in the appropriate rte_pmd_bnxt.c file

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/rte_pmd_bnxt.c
drivers/net/bnxt/rte_pmd_bnxt.h

index 54428ba..1538aa5 100644 (file)
@@ -250,32 +250,6 @@ struct bnxt {
        uint8_t                 num_leds;
 };
 
-/*
- * Response sent back to the caller after callback
- */
-enum rte_pmd_bnxt_mb_event_rsp {
-       RTE_PMD_BNXT_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */
-       RTE_PMD_BNXT_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
-       RTE_PMD_BNXT_MB_EVENT_PROCEED,  /**< proceed with mbox request  */
-       RTE_PMD_BNXT_MB_EVENT_MAX       /**< max value of this enum */
-};
-
-/* mailbox message types */
-#define BNXT_VF_RESET                  0x01 /* VF requests reset */
-#define BNXT_VF_SET_MAC_ADDR   0x02 /* VF requests PF to set MAC addr */
-#define BNXT_VF_SET_VLAN               0x03 /* VF requests PF to set VLAN */
-#define BNXT_VF_SET_MTU                        0x04 /* VF requests PF to set MTU */
-#define BNXT_VF_SET_MRU                        0x05 /* VF requests PF to set MRU */
-
-/*
- * Data sent to the caller when the callback is executed.
- */
-struct rte_pmd_bnxt_mb_event_param {
-       uint16_t vf_id; /* Virtual Function number */
-       int     retval; /* return value */
-       void    *msg;   /* pointer to message */
-};
-
 int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete);
 int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg);
 
index f9bedf7..79e800b 100644 (file)
@@ -1899,24 +1899,6 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) {
        return rc;
 }
 
-int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
-{
-       struct rte_pmd_bnxt_mb_event_param cb_param;
-
-       cb_param.retval = RTE_PMD_BNXT_MB_EVENT_PROCEED;
-       cb_param.vf_id = vf_id;
-       cb_param.msg = msg;
-
-       _rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-                       &cb_param);
-
-       /* Default to approve */
-       if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
-               cb_param.retval = RTE_PMD_BNXT_MB_EVENT_NOOP_ACK;
-
-       return cb_param.retval == RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ? true : false;
-}
-
 static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
        struct rte_pci_device *pci_dev)
 {
index 0542034..faeb6f4 100644 (file)
 #include "rte_pmd_bnxt.h"
 #include "hsi_struct_def_dpdk.h"
 
+int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
+{
+       struct rte_pmd_bnxt_mb_event_param cb_param;
+
+       cb_param.retval = RTE_PMD_BNXT_MB_EVENT_PROCEED;
+       cb_param.vf_id = vf_id;
+       cb_param.msg = msg;
+
+       _rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
+                       &cb_param);
+
+       /* Default to approve */
+       if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
+               cb_param.retval = RTE_PMD_BNXT_MB_EVENT_NOOP_ACK;
+
+       return cb_param.retval == RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ? true : false;
+}
+
 int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on)
 {
        struct rte_eth_dev *eth_dev;
index db9ce77..964aa97 100644 (file)
 
 #include <rte_ethdev.h>
 
+/*
+ * Response sent back to the caller after callback
+ */
+enum rte_pmd_bnxt_mb_event_rsp {
+       RTE_PMD_BNXT_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */
+       RTE_PMD_BNXT_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
+       RTE_PMD_BNXT_MB_EVENT_PROCEED,  /**< proceed with mbox request  */
+       RTE_PMD_BNXT_MB_EVENT_MAX       /**< max value of this enum */
+};
+
+/* mailbox message types */
+#define BNXT_VF_RESET                  0x01 /* VF requests reset */
+#define BNXT_VF_SET_MAC_ADDR   0x02 /* VF requests PF to set MAC addr */
+#define BNXT_VF_SET_VLAN               0x03 /* VF requests PF to set VLAN */
+#define BNXT_VF_SET_MTU                        0x04 /* VF requests PF to set MTU */
+#define BNXT_VF_SET_MRU                        0x05 /* VF requests PF to set MRU */
+
+/*
+ * Data sent to the caller when the callback is executed.
+ */
+struct rte_pmd_bnxt_mb_event_param {
+       uint16_t vf_id; /* Virtual Function number */
+       int     retval; /* return value */
+       void    *msg;   /* pointer to message */
+};
+
 /**
  * Enable/Disable VF MAC anti spoof
  *