git: 4759b165d598 - stable/13 - ixgbe: Add ixgbe_dev_from_hw() back
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 14 Feb 2025 01:25:23 UTC
The branch stable/13 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=4759b165d5985d6c3b0beb928a1f99efe79b294e
commit 4759b165d5985d6c3b0beb928a1f99efe79b294e
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2025-02-11 03:40:51 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2025-02-14 01:25:09 +0000
ixgbe: Add ixgbe_dev_from_hw() back
This got lost many years ago in 8eb6488ebb0dcd92517625e4833ddf7d26e3b3a3
It is used by the driver's DBG printfs.
(cherry picked from commit bf6f0db8a762966b08430692c92ae34e667948db)
---
sys/dev/ixgbe/ixgbe_osdep.c | 6 ++++++
sys/dev/ixgbe/ixgbe_osdep.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/sys/dev/ixgbe/ixgbe_osdep.c b/sys/dev/ixgbe/ixgbe_osdep.c
index 2fa651df8936..892924712c38 100644
--- a/sys/dev/ixgbe/ixgbe_osdep.c
+++ b/sys/dev/ixgbe/ixgbe_osdep.c
@@ -33,6 +33,12 @@
#include "ixgbe.h"
+inline device_t
+ixgbe_dev_from_hw(struct ixgbe_hw *hw)
+{
+ return ((struct ixgbe_softc *)hw->back)->dev;
+}
+
inline u16
ixgbe_read_pci_cfg(struct ixgbe_hw *hw, u32 reg)
{
diff --git a/sys/dev/ixgbe/ixgbe_osdep.h b/sys/dev/ixgbe/ixgbe_osdep.h
index 7aabfea66484..6dad776eb056 100644
--- a/sys/dev/ixgbe/ixgbe_osdep.h
+++ b/sys/dev/ixgbe/ixgbe_osdep.h
@@ -209,6 +209,7 @@ struct ixgbe_osdep
/* These routines need struct ixgbe_hw declared */
struct ixgbe_hw;
+device_t ixgbe_dev_from_hw(struct ixgbe_hw *hw);
/* These routines are needed by the shared code */
extern u16 ixgbe_read_pci_cfg(struct ixgbe_hw *, u32);