net/mlx4: remove useless code
[dpdk.git] / drivers / net / bnxt / bnxt.h
index e411704..405d94d 100644 (file)
@@ -38,6 +38,7 @@
 #include <stdbool.h>
 #include <sys/queue.h>
 
+#include <rte_pci.h>
 #include <rte_ethdev.h>
 #include <rte_memory.h>
 #include <rte_lcore.h>
 
 #define BNXT_MAX_MTU           9500
 #define VLAN_TAG_SIZE          4
+#define BNXT_MAX_LED           4
+
+struct bnxt_led_info {
+       uint8_t      led_id;
+       uint8_t      led_type;
+       uint8_t      led_group_id;
+       uint8_t      unused;
+       uint16_t  led_state_caps;
+#define BNXT_LED_ALT_BLINK_CAP(x)       ((x) &  \
+       rte_cpu_to_le_16(HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT))
+
+       uint16_t  led_color_caps;
+};
+
+struct bnxt_led_cfg {
+       uint8_t led_id;
+       uint8_t led_state;
+       uint8_t led_color;
+       uint8_t unused;
+       uint16_t led_blink_on;
+       uint16_t led_blink_off;
+       uint8_t led_group_id;
+       uint8_t rsvd;
+};
+
+#define BNXT_LED_DFLT_ENA                               \
+       (HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID |             \
+        HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE |          \
+        HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON |       \
+        HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF |      \
+        HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID)
+
+#define BNXT_LED_DFLT_ENA_SHIFT                6
+
+#define BNXT_LED_DFLT_ENABLES(x)                        \
+       rte_cpu_to_le_32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
 
 enum bnxt_hw_context {
        HW_CONTEXT_NONE     = 0,
@@ -60,15 +97,27 @@ struct bnxt_vlan_table_entry {
        uint16_t                vid;
 } __attribute__((packed));
 
+struct bnxt_vlan_antispoof_table_entry {
+       uint16_t                tpid;
+       uint16_t                vid;
+       uint16_t                mask;
+} __attribute__((packed));
+
 struct bnxt_child_vf_info {
        void                    *req_buf;
        struct bnxt_vlan_table_entry    *vlan_table;
+       struct bnxt_vlan_antispoof_table_entry  *vlan_as_table;
        STAILQ_HEAD(, bnxt_filter_info) filter;
        uint32_t                func_cfg_flags;
        uint32_t                l2_rx_mask;
        uint16_t                fid;
+       uint16_t                max_tx_rate;
        uint16_t                dflt_vlan;
+       uint16_t                vlan_count;
+       uint8_t                 mac_spoof_en;
+       uint8_t                 vlan_spoof_en;
        bool                    random_mac;
+       bool                    persist_stats;
 };
 
 struct bnxt_pf_info {
@@ -122,6 +171,7 @@ struct bnxt_cos_queue_info {
        uint8_t profile;
 };
 
+#define BNXT_HWRM_SHORT_REQ_LEN                sizeof(struct hwrm_short_input)
 struct bnxt {
        void                            *bar0;
 
@@ -133,6 +183,7 @@ struct bnxt {
 #define BNXT_FLAG_VF           (1 << 1)
 #define BNXT_FLAG_PORT_STATS   (1 << 2)
 #define BNXT_FLAG_JUMBO                (1 << 3)
+#define BNXT_FLAG_SHORT_CMD    (1 << 4)
 #define BNXT_PF(bp)            (!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)            ((bp)->flags & BNXT_FLAG_VF)
 #define BNXT_NPAR_ENABLED(bp)  ((bp)->port_partition_type)
@@ -177,6 +228,8 @@ struct bnxt {
        uint16_t                        hwrm_cmd_seq;
        void                            *hwrm_cmd_resp_addr;
        phys_addr_t                     hwrm_cmd_resp_dma_addr;
+       void                            *hwrm_short_cmd_req_addr;
+       phys_addr_t                     hwrm_short_cmd_req_dma_addr;
        rte_spinlock_t                  hwrm_lock;
        uint16_t                        max_req_len;
        uint16_t                        max_resp_len;
@@ -205,36 +258,15 @@ struct bnxt {
        uint16_t                geneve_fw_dst_port_id;
        uint32_t                fw_ver;
        rte_atomic64_t          rx_mbuf_alloc_fail;
-};
 
-/*
- * 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 */
+       struct bnxt_led_info    leds[BNXT_MAX_LED];
+       uint8_t                 num_leds;
 };
 
 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);
 
 #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG                0x6
+
+bool is_bnxt_supported(struct rte_eth_dev *dev);
 #endif