net/thunderx: add secondary queue set support in start
[dpdk.git] / drivers / net / qede / base / bcm_osal.c
index 9540c4b..16029b5 100644 (file)
@@ -15,6 +15,9 @@
 #include "ecore.h"
 #include "ecore_hw.h"
 #include "ecore_iov_api.h"
+#include "ecore_mcp_api.h"
+#include "ecore_l2_api.h"
+
 
 unsigned long qede_log2_align(unsigned long n)
 {
@@ -115,7 +118,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
        }
        *phys = mz->phys_addr;
        DP_VERBOSE(p_dev, ECORE_MSG_PROBE,
-                  "size=%zu phys=0x%lx virt=%p on socket=%u\n",
+                  "size=%zu phys=0x%" PRIx64 " virt=%p on socket=%u\n",
                   mz->len, mz->phys_addr, mz->addr, socket_id);
        return mz->addr;
 }
@@ -144,7 +147,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
        }
        *phys = mz->phys_addr;
        DP_VERBOSE(p_dev, ECORE_MSG_PROBE,
-                  "aligned memory size=%zu phys=0x%lx virt=%p core=%d\n",
+                  "aligned memory size=%zu phys=0x%" PRIx64 " virt=%p core=%d\n",
                   mz->len, mz->phys_addr, mz->addr, core_id);
        return mz->addr;
 }
@@ -179,3 +182,21 @@ u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 
        return p_hwfn->stream->total_out / 4;
 }
+
+void
+qede_get_mcp_proto_stats(struct ecore_dev *edev,
+                        enum ecore_mcp_protocol_type type,
+                        union ecore_mcp_protocol_stats *stats)
+{
+       struct ecore_eth_stats lan_stats;
+
+       if (type == ECORE_MCP_LAN_STATS) {
+               ecore_get_vport_stats(edev, &lan_stats);
+               stats->lan_stats.ucast_rx_pkts = lan_stats.rx_ucast_pkts;
+               stats->lan_stats.ucast_tx_pkts = lan_stats.tx_ucast_pkts;
+               stats->lan_stats.fcs_err = -1;
+       } else {
+               DP_INFO(edev, "Statistics request type %d not supported\n",
+                      type);
+       }
+}