diff mbox series

[26/28] raw/cnxk_bphy: add support for retrieving device memory

Message ID 20210531214142.30167-27-tduszynski@marvell.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series add support for baseband phy | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tomasz Duszynski May 31, 2021, 9:41 p.m. UTC
Allow user to retrieve bphy memory resources.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 drivers/raw/cnxk_bphy/cnxk_bphy.c     | 6 ++++++
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 8 ++++++++
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 ++
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h  | 4 ++++
 drivers/raw/cnxk_bphy/version.map     | 2 ++
 5 files changed, 22 insertions(+)
diff mbox series

Patch

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index e3a065b30..c3aed3018 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -34,6 +34,12 @@  rte_pmd_bphy_intr_fini(uint16_t dev_id)
 	return cnxk_bphy_intr_fini(dev_id);
 }
 
+struct cnxk_bphy_mem *
+rte_pmd_bphy_intr_mem_get(uint16_t dev_id)
+{
+	return cnxk_bphy_mem_get(dev_id);
+}
+
 static const struct rte_rawdev_ops bphy_rawdev_ops = {
 };
 
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
index 6a68db8a9..5a7698f23 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
@@ -57,3 +57,11 @@  cnxk_bphy_intr_fini(uint16_t dev_id)
 	roc_bphy_intr_fini(irq_chip);
 	bphy_dev->irq_chip = NULL;
 }
+
+struct bphy_mem *
+cnxk_bphy_mem_get(uint16_t dev_id)
+{
+	struct bphy_device *bphy_dev = cnxk_bphy_get_bphy_dev_by_dev_id(dev_id);
+
+	return &bphy_dev->mem;
+}
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
index d18fbd69e..e52106bc8 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
@@ -26,5 +26,7 @@  __rte_internal
 void cnxk_bphy_intr_fini(uint16_t dev_id);
 __rte_internal
 uint64_t cnxk_bphy_irq_max_get(uint16_t dev_id);
+__rte_internal
+struct bphy_mem *cnxk_bphy_mem_get(uint16_t dev_id);
 
 #endif /* _CNXK_BPHY_IRQ_ */
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index edc146685..783b63471 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -103,9 +103,13 @@  struct cnxk_bphy_cgx_msg {
 	void *data;
 };
 
+#define cnxk_bphy_mem  bphy_mem
+
 __rte_experimental
 int rte_pmd_bphy_intr_init(uint16_t dev_id);
 __rte_experimental
+struct cnxk_bphy_mem *rte_pmd_bphy_intr_mem_get(uint16_t dev_id);
+__rte_experimental
 void rte_pmd_bphy_intr_fini(uint16_t dev_id);
 
 #endif /* _CNXK_BPHY_H_ */
diff --git a/drivers/raw/cnxk_bphy/version.map b/drivers/raw/cnxk_bphy/version.map
index 6c5e9639a..c7600a863 100644
--- a/drivers/raw/cnxk_bphy/version.map
+++ b/drivers/raw/cnxk_bphy/version.map
@@ -7,10 +7,12 @@  INTERNAL {
 	cnxk_bphy_intr_init;
 	cnxk_bphy_intr_fini;
 	cnxk_bphy_irq_max_get;
+	cnxk_bphy_mem_get;
 };
 EXPERIMENTAL {
 	global:
 
 	rte_pmd_bphy_intr_fini;
 	rte_pmd_bphy_intr_init;
+	rte_pmd_bphy_intr_mem_get;
 };