Lines Matching refs:device
57 struct cam_device *device,
63 struct cam_device *device);
69 cam_send_ccb(struct cam_device *device, union ccb *ccb) in cam_send_ccb() argument
71 return(ioctl(device->fd, CAMIOCOMMAND, ccb)); in cam_send_ccb()
332 int flags, struct cam_device *device) in cam_open_btl() argument
432 return(cam_real_open_device(dev_path, flags, device, NULL, in cam_open_btl()
452 struct cam_device *device) in cam_open_spec_device() argument
454 return(cam_lookup_pass(dev_name, unit, flags, NULL, device)); in cam_open_spec_device()
458 cam_open_pass(const char *path, int flags, struct cam_device *device) in cam_open_pass() argument
460 return(cam_real_open_device(path, flags, device, path, NULL, 0)); in cam_open_pass()
465 const char *given_path, struct cam_device *device) in cam_lookup_pass() argument
537 return(cam_real_open_device(dev_path, flags, device, NULL, in cam_lookup_pass()
546 cam_real_open_device(const char *path, int flags, struct cam_device *device, in cam_real_open_device() argument
557 if (device == NULL) { in cam_real_open_device()
558 if ((device = (struct cam_device *)malloc( in cam_real_open_device()
565 device->fd = -1; in cam_real_open_device()
573 strlcpy(device->device_path, given_path, in cam_real_open_device()
574 sizeof(device->device_path)); in cam_real_open_device()
576 device->device_path[0] = '\0'; in cam_real_open_device()
583 strlcpy(device->given_dev_name, given_dev_name, in cam_real_open_device()
584 sizeof(device->given_dev_name)); in cam_real_open_device()
586 device->given_dev_name[0] = '\0'; in cam_real_open_device()
587 device->given_unit_number = given_unit_number; in cam_real_open_device()
597 device->fd = fd; in cam_real_open_device()
635 device->dev_unit_num = ccb.cgdl.unit_number; in cam_real_open_device()
636 strlcpy(device->device_name, ccb.cgdl.periph_name, in cam_real_open_device()
637 sizeof(device->device_name)); in cam_real_open_device()
638 device->path_id = ccb.ccb_h.path_id; in cam_real_open_device()
639 device->target_id = ccb.ccb_h.target_id; in cam_real_open_device()
640 device->target_lun = ccb.ccb_h.target_lun; in cam_real_open_device()
648 strlcpy(device->sim_name, ccb.cpi.dev_name, sizeof(device->sim_name)); in cam_real_open_device()
649 device->sim_unit_number = ccb.cpi.unit_number; in cam_real_open_device()
650 device->bus_id = ccb.cpi.bus_id; in cam_real_open_device()
662 device->pd_type = SID_TYPE(&ccb.cgd.inq_data); in cam_real_open_device()
663 bcopy(&ccb.cgd.inq_data, &device->inq_data, in cam_real_open_device()
665 device->serial_num_len = ccb.cgd.serial_num_len; in cam_real_open_device()
666 bcopy(&ccb.cgd.serial_num, &device->serial_num, device->serial_num_len); in cam_real_open_device()
688 device->sync_period = spi->sync_period; in cam_real_open_device()
689 device->sync_offset = spi->sync_offset; in cam_real_open_device()
690 device->bus_width = spi->bus_width; in cam_real_open_device()
692 device->sync_period = 0; in cam_real_open_device()
693 device->sync_offset = 0; in cam_real_open_device()
694 device->bus_width = 0; in cam_real_open_device()
697 return(device); in cam_real_open_device()
705 free(device); in cam_real_open_device()
755 cam_device_dup(struct cam_device *device) in cam_device_dup() argument
760 if (device == NULL) { in cam_device_dup()
772 bcopy(device, newdev, sizeof(struct cam_device)); in cam_device_dup()