Lines Matching refs:ib_dev

185 static void free_netdevs(struct ib_device *ib_dev);
820 pdata->ib_dev = device; in alloc_port_data()
1343 static void prevent_dealloc_device(struct ib_device *ib_dev) in prevent_dealloc_device() argument
1461 static void __ib_unregister_device(struct ib_device *ib_dev) in __ib_unregister_device() argument
1470 mutex_lock(&ib_dev->unregistration_lock); in __ib_unregister_device()
1471 if (!refcount_read(&ib_dev->refcount)) in __ib_unregister_device()
1474 disable_device(ib_dev); in __ib_unregister_device()
1477 free_netdevs(ib_dev); in __ib_unregister_device()
1479 ib_free_port_attrs(&ib_dev->coredev); in __ib_unregister_device()
1480 device_del(&ib_dev->dev); in __ib_unregister_device()
1481 ib_device_unregister_rdmacg(ib_dev); in __ib_unregister_device()
1482 ib_cache_cleanup_one(ib_dev); in __ib_unregister_device()
1488 if (ib_dev->ops.dealloc_driver && in __ib_unregister_device()
1489 ib_dev->ops.dealloc_driver != prevent_dealloc_device) { in __ib_unregister_device()
1490 WARN_ON(kref_read(&ib_dev->dev.kobj.kref) <= 1); in __ib_unregister_device()
1491 ib_dealloc_device(ib_dev); in __ib_unregister_device()
1494 mutex_unlock(&ib_dev->unregistration_lock); in __ib_unregister_device()
1511 void ib_unregister_device(struct ib_device *ib_dev) in ib_unregister_device() argument
1513 get_device(&ib_dev->dev); in ib_unregister_device()
1514 __ib_unregister_device(ib_dev); in ib_unregister_device()
1515 put_device(&ib_dev->dev); in ib_unregister_device()
1533 void ib_unregister_device_and_put(struct ib_device *ib_dev) in ib_unregister_device_and_put() argument
1535 WARN_ON(!ib_dev->ops.dealloc_driver); in ib_unregister_device_and_put()
1536 get_device(&ib_dev->dev); in ib_unregister_device_and_put()
1537 ib_device_put(ib_dev); in ib_unregister_device_and_put()
1538 __ib_unregister_device(ib_dev); in ib_unregister_device_and_put()
1539 put_device(&ib_dev->dev); in ib_unregister_device_and_put()
1559 struct ib_device *ib_dev; in ib_unregister_driver() local
1563 xa_for_each (&devices, index, ib_dev) { in ib_unregister_driver()
1564 if (ib_dev->ops.driver_id != driver_id) in ib_unregister_driver()
1567 get_device(&ib_dev->dev); in ib_unregister_driver()
1570 WARN_ON(!ib_dev->ops.dealloc_driver); in ib_unregister_driver()
1571 __ib_unregister_device(ib_dev); in ib_unregister_driver()
1573 put_device(&ib_dev->dev); in ib_unregister_driver()
1582 struct ib_device *ib_dev = in ib_unregister_work() local
1585 __ib_unregister_device(ib_dev); in ib_unregister_work()
1586 put_device(&ib_dev->dev); in ib_unregister_work()
1600 void ib_unregister_device_queued(struct ib_device *ib_dev) in ib_unregister_device_queued() argument
1602 WARN_ON(!refcount_read(&ib_dev->refcount)); in ib_unregister_device_queued()
1603 WARN_ON(!ib_dev->ops.dealloc_driver); in ib_unregister_device_queued()
1604 get_device(&ib_dev->dev); in ib_unregister_device_queued()
1605 if (!queue_work(system_unbound_wq, &ib_dev->unregistration_work)) in ib_unregister_device_queued()
1606 put_device(&ib_dev->dev); in ib_unregister_device_queued()
2133 int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev, in ib_device_set_netdev() argument
2145 ret = alloc_port_data(ib_dev); in ib_device_set_netdev()
2149 if (!rdma_is_port_valid(ib_dev, port)) in ib_device_set_netdev()
2152 pdata = &ib_dev->port_data[port]; in ib_device_set_netdev()
2174 static void free_netdevs(struct ib_device *ib_dev) in free_netdevs() argument
2179 if (!ib_dev->port_data) in free_netdevs()
2182 rdma_for_each_port (ib_dev, port) { in free_netdevs()
2183 struct ib_port_data *pdata = &ib_dev->port_data[port]; in free_netdevs()
2207 struct net_device *ib_device_get_netdev(struct ib_device *ib_dev, in ib_device_get_netdev() argument
2213 if (!rdma_is_port_valid(ib_dev, port)) in ib_device_get_netdev()
2216 pdata = &ib_dev->port_data[port]; in ib_device_get_netdev()
2222 if (ib_dev->ops.get_netdev) in ib_device_get_netdev()
2223 res = ib_dev->ops.get_netdev(ib_dev, port); in ib_device_get_netdev()
2265 cur->ib_dev->ops.driver_id == driver_id) && in ib_device_get_by_netdev()
2266 ib_device_try_get(cur->ib_dev)) { in ib_device_get_by_netdev()
2267 res = cur->ib_dev; in ib_device_get_by_netdev()
2289 void ib_enum_roce_netdev(struct ib_device *ib_dev, in ib_enum_roce_netdev() argument
2297 rdma_for_each_port (ib_dev, port) in ib_enum_roce_netdev()
2298 if (rdma_protocol_roce(ib_dev, port)) { in ib_enum_roce_netdev()
2300 ib_device_get_netdev(ib_dev, port); in ib_enum_roce_netdev()
2302 if (filter(ib_dev, port, idev, filter_cookie)) in ib_enum_roce_netdev()
2303 cb(ib_dev, port, idev, cookie); in ib_enum_roce_netdev()