The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=deb465a194b153dd408f508e911a7afb3b57440a

commit deb465a194b153dd408f508e911a7afb3b57440a
Author:     Steve Wise <[email protected]>
AuthorDate: 2018-03-22 19:53:35 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2026-09-15 14:22:39 +0000

    iw_cxgbe: Add ib_device->get_netdev support
    
    Obtained from:  Linux commit f215a3d2448ae77253f0b93dcc37114779f51778
---
 sys/dev/cxgbe/iw_cxgbe/provider.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sys/dev/cxgbe/iw_cxgbe/provider.c 
b/sys/dev/cxgbe/iw_cxgbe/provider.c
index 010ae9d9b426..2a14a8985dc9 100644
--- a/sys/dev/cxgbe/iw_cxgbe/provider.c
+++ b/sys/dev/cxgbe/iw_cxgbe/provider.c
@@ -386,6 +386,25 @@ static int c4iw_port_immutable(struct ib_device *ibdev, u8 
port_num,
        return 0;
 }
 
+static if_t c4iw_get_netdev(struct ib_device *ibdev, u8 port)
+{
+       struct c4iw_dev *dev;
+       struct adapter *sc;
+       struct port_info *pi;
+       if_t ifp;
+
+       dev = to_c4iw_dev(ibdev);
+       sc = dev->rdev.adap;
+       if (!port || port > sc->params.nports)
+               return NULL;
+       pi = sc->port[port - 1];
+       ifp = pi->vi[0].ifp;
+       if (ifp)
+               if_ref(ifp);
+
+       return ifp;
+}
+
 /*
  * Returns -errno on error.
  */
@@ -476,6 +495,7 @@ c4iw_register_device(struct c4iw_dev *dev)
        ibdev->post_recv = c4iw_post_receive;
        ibdev->uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION;
        ibdev->get_port_immutable = c4iw_port_immutable;
+       ibdev->get_netdev = c4iw_get_netdev;
 
        iwcm = kmalloc(sizeof(*iwcm), GFP_KERNEL);
        if (iwcm == NULL)

Reply via email to