Lines Matching defs:device

56 	iser_err("async event %s (%d) on device %s port %d\n",
58 dev_name(&event->device->dev), event->element.port_num);
63 * Queue (CQ), DMA Memory Region (DMA MR) with the device associated with
68 static int iser_create_device_ib_res(struct iser_device *device)
70 struct ib_device *ib_dev = device->ib_device;
73 iser_err("IB device does not support memory registrations\n");
77 device->pd = ib_alloc_pd(ib_dev,
79 if (IS_ERR(device->pd))
82 INIT_IB_EVENT_HANDLER(&device->event_handler, ib_dev,
84 ib_register_event_handler(&device->event_handler);
94 * CQ and PD created with the device associated with the adaptor.
96 static void iser_free_device_ib_res(struct iser_device *device)
98 ib_unregister_event_handler(&device->event_handler);
99 ib_dealloc_pd(device->pd);
101 device->pd = NULL;
105 iser_create_fastreg_desc(struct iser_device *device,
111 struct ib_device *ib_dev = device->ib_device;
175 struct iser_device *device = ib_conn->device;
185 desc = iser_create_fastreg_desc(device, device->pd,
238 struct iser_device *device;
244 BUG_ON(ib_conn->device == NULL);
246 device = ib_conn->device;
247 ib_dev = device->ib_device;
280 ret = rdma_create_qp(ib_conn->cma_id, device->pd, &init_attr);
299 * based on the resolved device node GUID see if there already allocated
300 * device for this device. If there's no such, create one.
305 struct iser_device *device;
309 list_for_each_entry(device, &ig.device_list, ig_list)
311 if (device->ib_device->node_guid == cma_id->device->node_guid)
314 device = kzalloc(sizeof *device, GFP_KERNEL);
315 if (device == NULL)
318 /* assign this device to the device */
319 device->ib_device = cma_id->device;
320 /* init the device and link it into ig device list */
321 if (iser_create_device_ib_res(device)) {
322 kfree(device);
323 device = NULL;
326 list_add(&device->ig_list, &ig.device_list);
329 device->refcount++;
332 return device;
335 /* if there's no demand for this device, release it */
336 static void iser_device_try_release(struct iser_device *device)
339 device->refcount--;
340 iser_info("device %p refcount %d\n", device, device->refcount);
341 if (!device->refcount) {
342 iser_free_device_ib_res(device);
343 list_del(&device->ig_list);
344 kfree(device);
387 * iser device and memory regoins pool (only iscsi
398 struct iser_device *device = ib_conn->device;
413 if (device != NULL) {
414 iser_device_try_release(device);
415 ib_conn->device = NULL;
511 struct iser_device *device = iser_conn->ib_conn.device;
512 struct ib_device_attr *attr = &device->ib_device->attrs;
518 * FRs without SG_GAPS can only map up to a (device) page per entry,
546 struct iser_device *device;
557 device = iser_device_find_by_ib_device(cma_id);
558 if (!device) {
559 iser_err("device lookup/creation failed\n");
564 ib_conn->device = device;
568 if (!(device->ib_device->attrs.device_cap_flags &
572 dev_name(&ib_conn->device->ib_device->dev));
599 struct ib_device *ib_dev = ib_conn->device->ib_device;
727 * we *must* destroy the device as we cannot rely
781 /* the device is known only --after-- address resolution */
782 ib_conn->device = NULL;
835 desc->sge.lkey = ib_conn->device->pd->local_dma_lkey;
901 ib_dma_sync_single_for_device(ib_conn->device->ib_device,
932 unsigned long sector_size = iser_task->sc->device->sector_size;