Lines Matching defs:device

272 static int getdevlist(struct cam_device *device);
274 static int getdevtype(struct cam_device *device);
281 static int requestsense(struct cam_device *device, int argc, char **argv,
284 static int testunitready(struct cam_device *device, int task_attr,
286 static int scsistart(struct cam_device *device, int startstop, int loadeject,
288 static int scsiinquiry(struct cam_device *device, int task_attr,
290 static int scsiserial(struct cam_device *device, int task_attr,
294 static int reprobe(struct cam_device *device);
299 static int readdefects(struct cam_device *device, int argc, char **argv,
302 static void modepage(struct cam_device *device, int argc, char **argv,
305 static int scsicmd(struct cam_device *device, int argc, char **argv,
308 static int smpcmd(struct cam_device *device, int argc, char **argv,
310 static int mmcsdcmd(struct cam_device *device, int argc, char **argv,
312 static int smpreportgeneral(struct cam_device *device, int argc, char **argv,
314 static int smpphycontrol(struct cam_device *device, int argc, char **argv,
316 static int smpmaninfo(struct cam_device *device, int argc, char **argv,
323 static int smpphylist(struct cam_device *device, int argc, char **argv,
325 static int tagcontrol(struct cam_device *device, int argc, char **argv,
327 static void cts_print(struct cam_device *device,
330 static int get_cpi(struct cam_device *device, struct ccb_pathinq *cpi);
331 static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd);
332 static int get_print_cts(struct cam_device *device, int user_settings,
334 static int ratecontrol(struct cam_device *device, int task_attr,
337 static int scsiformat(struct cam_device *device, int argc, char **argv,
340 static int sanitize(struct cam_device *device, int argc, char **argv,
343 static int scsireportluns(struct cam_device *device, int argc, char **argv,
346 static int scsireadcapacity(struct cam_device *device, int argc, char **argv,
349 static int atapm(struct cam_device *device, int argc, char **argv,
351 static int atasecurity(struct cam_device *device, int retry_count, int timeout,
353 static int atahpa(struct cam_device *device, int retry_count, int timeout,
355 static int ataama(struct cam_device *device, int retry_count, int timeout,
357 static int scsiprintoneopcode(struct cam_device *device, int req_opcode,
360 static int scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf,
362 static int scsiopcodes(struct cam_device *device, int argc, char **argv,
398 getdevlist(struct cam_device *device)
404 ccb = cam_getccb(device);
412 if (cam_send_ccb(device, ccb) < 0) {
413 warn("error getting device list");
669 * Get the device type and report it, request no I/O be done to do this.
843 requestsense(struct cam_device *device, int argc, char **argv,
867 ccb = cam_getccb(device);
899 if (cam_send_ccb(device, ccb) < 0) {
910 * device doesn't support it. So we check the CCB status here to see.
914 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
927 cam_path_string(device, path_str, sizeof(path_str));
936 &device->inq_data, scsiio_cdb_ptr(&ccb->csio),
951 testunitready(struct cam_device *device, int task_attr, int retry_count,
957 ccb = cam_getccb(device);
966 /* Disable freezing the device queue */
972 if (cam_send_ccb(device, ccb) < 0) {
988 cam_error_print(device, ccb, CAM_ESF_ALL,
999 scsistart(struct cam_device *device, int startstop, int loadeject,
1005 ccb = cam_getccb(device);
1010 * the device isn't capable of tagged queueing, or if tagged
1030 /* Disable freezing the device queue */
1036 if (cam_send_ccb(device, ccb) < 0) {
1066 cam_error_print(device, ccb, CAM_ESF_ALL,
1077 scsidoinquiry(struct cam_device *device, int argc, char **argv,
1107 error = scsiinquiry(device, task_attr, retry_count, timeout);
1113 scsiserial(device, task_attr, retry_count, timeout);
1116 error = camxferrate(device);
1122 scsiinquiry(struct cam_device *device, int task_attr, int retry_count,
1129 ccb = cam_getccb(device);
1148 * 256 bytes specified in the SCSI spec, we only tell the device
1166 * standard inquiry is to get the vendor name, device name,
1172 * the additional length passed back from the device how much
1173 * inquiry data the device supports. Once the amount the device
1190 /* Disable freezing the device queue */
1196 if (cam_send_ccb(device, ccb) < 0) {
1206 cam_error_print(device, ccb, CAM_ESF_ALL,
1218 fprintf(stdout, "%s%d: ", device->device_name,
1219 device->dev_unit_num);
1228 scsiserial(struct cam_device *device, int task_attr, int retry_count,
1236 ccb = cam_getccb(device);
1263 /* Disable freezing the device queue */
1269 if (cam_send_ccb(device, ccb) < 0) {
1280 cam_error_print(device, ccb, CAM_ESF_ALL,
1298 device->device_name, device->dev_unit_num);
1308 camxferrate(struct cam_device *device)
1317 if ((retval = get_cpi(device, &cpi)) != 0)
1320 ccb = cam_getccb(device);
1330 if (((retval = cam_send_ccb(device, ccb)) < 0)
1340 cam_error_print(device, ccb, CAM_ESF_ALL,
1391 device->device_name, device->dev_unit_num,
1395 device->device_name, device->dev_unit_num,
1580 printf("device model %.40s\n", parm->model);
1686 printf("device managed\n");
1788 printf("device statistics notification %s %s\n",
1834 scsi_cam_pass_16_send(struct cam_device *device, union ccb *ccb)
1850 /* Disable freezing the device queue */
1856 if (cam_send_ccb(device, ccb) < 0) {
1869 cam_error_print(device, ccb, CAM_ESF_ALL,
1880 ata_cam_send(struct cam_device *device, union ccb *ccb)
1888 /* Disable freezing the device queue */
1894 if (cam_send_ccb(device, ccb) < 0) {
1907 cam_error_print(device, ccb, CAM_ESF_ALL,
1917 ata_do_pass_16(struct cam_device *device, union ccb *ccb, int retries,
1951 return scsi_cam_pass_16_send(device, ccb);
1955 ata_try_pass_16(struct cam_device *device)
1959 if (get_cpi(device, &cpi) != 0) {
1974 ata_do_cmd(struct cam_device *device, union ccb *ccb, int retries,
1982 retval = ata_try_pass_16(device);
1987 return (ata_do_pass_16(device, ccb, retries, flags, protocol,
2011 return ata_cam_send(device, ccb);
2031 atahpa_proc_resp(struct cam_device *device, union ccb *ccb, u_int64_t *hpasize)
2038 retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device,
2042 cam_error_print(device, ccb, CAM_ESF_ALL,
2051 cam_error_print(device, ccb, CAM_ESF_ALL,
2074 ata_read_native_max(struct cam_device *device, int retry_count,
2092 error = ata_do_cmd(device,
2111 return atahpa_proc_resp(device, ccb, hpasize);
2115 atahpa_set_max(struct cam_device *device, int retry_count,
2136 error = ata_do_cmd(device,
2155 return atahpa_proc_resp(device, ccb, NULL);
2159 atahpa_password(struct cam_device *device, int retry_count,
2169 return (ata_do_cmd(device,
2188 atahpa_lock(struct cam_device *device, int retry_count,
2197 return (ata_do_cmd(device,
2215 atahpa_unlock(struct cam_device *device, int retry_count,
2225 return (ata_do_cmd(device,
2244 atahpa_freeze_lock(struct cam_device *device, int retry_count,
2253 return (ata_do_cmd(device,
2271 ata_get_native_max(struct cam_device *device, int retry_count,
2277 error = ata_do_cmd(device,
2296 return atahpa_proc_resp(device, ccb, nativesize);
2300 ataama_set(struct cam_device *device, int retry_count,
2309 error = ata_do_cmd(device,
2328 return atahpa_proc_resp(device, ccb, NULL);
2332 ataama_freeze(struct cam_device *device, int retry_count,
2336 return (ata_do_cmd(device,
2354 ata_do_identify(struct cam_device *device, int retry_count, int timeout,
2364 if (get_cpi(device, &cpi) != 0) {
2371 if (get_cgd(device, &cgd) != 0) {
2392 error = ata_do_cmd(device,
2442 ataidentify(struct cam_device *device, int retry_count, int timeout)
2448 if ((ccb = cam_getccb(device)) == NULL) {
2453 if (ata_do_identify(device, retry_count, timeout, ccb, &ident_buf) != 0) {
2460 device->device_name, device->dev_unit_num);
2465 ata_read_native_max(device, retry_count, timeout, ccb,
2469 ata_get_native_max(device, retry_count, timeout, ccb,
2473 printf("%s%d: ", device->device_name, device->dev_unit_num);
2475 camxferrate(device);
2487 nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __unused)
2491 if (nvme_get_cdata(device, &cdata))
2499 identify(struct cam_device *device, int retry_count, int timeout)
2503 if (get_cpi(device, &cpi) != 0) {
2509 return (nvmeidentify(device, retry_count, timeout));
2511 return (ataidentify(device, retry_count, timeout));
2580 atasecurity_freeze(struct cam_device *device, union ccb *ccb,
2587 return ata_do_cmd(device,
2605 atasecurity_unlock(struct cam_device *device, union ccb *ccb,
2613 return ata_do_cmd(device,
2632 atasecurity_disable(struct cam_device *device, union ccb *ccb,
2639 return ata_do_cmd(device,
2659 atasecurity_erase_confirm(struct cam_device *device,
2664 " device:\n%s%d,%s%d: ", device->device_name,
2665 device->dev_unit_num, device->given_dev_name,
2666 device->given_unit_number);
2690 atasecurity_erase(struct cam_device *device, union ccb *ccb,
2700 error = ata_do_cmd(device,
2722 error = ata_do_cmd(device,
2746 atasecurity_set_password(struct cam_device *device, union ccb *ccb,
2754 return ata_do_cmd(device,
2852 atahpa_set_confirm(struct cam_device *device, struct ata_params* ident_buf,
2856 "sectors to %ju %s on the device:\n%s%d,%s%d: ", maxsize,
2858 device->device_name, device->dev_unit_num,
2859 device->given_dev_name, device->given_unit_number);
2883 atahpa(struct cam_device *device, int retry_count, int timeout,
2962 if (get_cgd(device, &cgd) != 0) {
2967 ccb = cam_getccb(device);
2973 error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf);
2980 printf("%s%d: ", device->device_name, device->dev_unit_num);
2982 camxferrate(device);
2988 ata_read_native_max(device, retry_count, timeout, ccb,
2998 warnx("HPA is not supported by this device");
3005 warnx("HPA Security is not supported by this device");
3021 atahpa_set_confirm(device, ident_buf, maxsize,
3028 error = ata_read_native_max(device, retry_count, timeout,
3031 error = atahpa_set_max(device, retry_count, timeout,
3036 error = ata_do_identify(device,
3041 /* Hint CAM to reprobe the device. */
3042 reprobe(device);
3048 error = atahpa_password(device, retry_count, timeout,
3055 error = atahpa_lock(device, retry_count, timeout,
3062 error = atahpa_unlock(device, retry_count, timeout,
3069 error = atahpa_freeze_lock(device, retry_count, timeout,
3092 ataama(struct cam_device *device, int retry_count, int timeout,
3132 if (get_cgd(device, &cgd) != 0) {
3137 ccb = cam_getccb(device);
3143 error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf);
3150 printf("%s%d: ", device->device_name, device->dev_unit_num);
3152 camxferrate(device);
3158 ata_get_native_max(device, retry_count, timeout, ccb,
3168 warnx("Accessible Max Address is not supported by this device");
3176 error = ata_get_native_max(device, retry_count, timeout, ccb,
3179 error = ataama_set(device, retry_count, timeout,
3184 error = ata_do_identify(device,
3189 /* Hint CAM to reprobe the device. */
3190 reprobe(device);
3196 error = ataama_freeze(device, retry_count, timeout,
3213 atasecurity(struct cam_device *device, int retry_count, int timeout,
3332 if ((ccb = cam_getccb(device)) == NULL) {
3337 error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf);
3344 printf("%s%d: ", device->device_name, device->dev_unit_num);
3346 camxferrate(device);
3374 atasecurity_erase_confirm(device, ident_buf) == 0) {
3387 error = atasecurity_set_password(device, ccb, retry_count,
3399 error = atasecurity_freeze(device, ccb, retry_count,
3406 error = atasecurity_unlock(device, ccb,
3422 error = atasecurity_unlock(device, ccb,
3430 error = atasecurity_disable(device,
3450 error = atasecurity_erase(device, ccb, retry_count,
3467 error = atasecurity_erase(device, ccb,
3510 * Attempt to get the passthrough device. This ioctl will
3511 * fail if the device name is null, if the device doesn't
3519 warn("Unable to find bus:target:lun for device %s%d",
3529 warnx("Unable to find bus:target_lun for device %s%d, "
3539 * need the passthrough device name and unit number since
3655 warnx("error opening transport layer device %s", XPT_DEVICE);
3829 struct cam_device *device;
3832 device = NULL;
3855 warnx("error opening transport layer device %s\n",
3861 device = cam_open_btl(bus, target, lun, O_RDWR, NULL);
3862 if (device == NULL) {
3885 if (cam_send_ccb(device, &ccb) < 0) {
3887 cam_close_device(device);
3895 cam_close_device(device);
3925 readdefects(struct cam_device *device, int argc, char **argv,
4023 ccb = cam_getccb(device);
4076 /* Disable freezing the device queue */
4079 if (cam_send_ccb(device, ccb) < 0) {
4220 cam_error_print(device, ccb, CAM_ESF_ALL,
4303 cam_error_print(device, ccb, CAM_ESF_ALL,
4311 cam_error_print(device, ccb, CAM_ESF_ALL,
4475 reassignblocks(struct cam_device *device, uint32_t *blocks, int num_blocks)
4479 ccb = cam_getccb(device);
4486 mode_sense(struct cam_device *device, int *cdb_len, int dbd, int llbaa, int pc,
4493 ccb = cam_getccb(device);
4500 * device must return error, so we should not get truncated data.
4532 /* Disable freezing the device queue */
4535 if (cam_send_ccb(device, ccb) < 0)
4549 cam_error_print(device, ccb, CAM_ESF_ALL,
4553 cam_close_device(device);
4561 mode_select(struct cam_device *device, int cdb_len, int save_pages,
4567 ccb = cam_getccb(device);
4587 /* Disable freezing the device queue */
4590 if (((retval = cam_send_ccb(device, ccb)) < 0)
4593 cam_error_print(device, ccb, CAM_ESF_ALL,
4597 cam_close_device(device);
4610 modepage(struct cam_device *device, int argc, char **argv, char *combinedopt,
4674 mode_list(device, cdb_len, dbd, pc, list > 1, task_attr,
4677 mode_edit(device, cdb_len, desc, dbd, llbaa, pc, page, subpage,
4683 scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
4703 ccb = cam_getccb(device);
4853 * If fd_data is set, and we're writing to the device, we need to
4876 /* Disable freezing the device queue */
4953 if (((retval = cam_send_ccb(device, ccb)) < 0)
4963 cam_error_print(device, ccb, CAM_ESF_ALL,
4984 ccb->ataio.res.device,
5113 warnx("error opening transport layer device %s", XPT_DEVICE);
5156 tagcontrol(struct cam_device *device, int argc, char **argv,
5166 ccb = cam_getccb(device);
5191 cam_path_string(device, pathstr, sizeof(pathstr));
5200 if (cam_send_ccb(device, ccb) < 0) {
5208 cam_error_print(device, ccb, CAM_ESF_ALL,
5224 if (cam_send_ccb(device, ccb) < 0) {
5232 cam_error_print(device, ccb, CAM_ESF_ALL,
5256 fprintf(stdout, "device openings: ");
5269 cts_print(struct cam_device *device, struct ccb_trans_settings *cts)
5273 cam_path_string(device, pathstr, sizeof(pathstr));
5436 * Get a path inquiry CCB for the specified device.
5439 get_cpi(struct cam_device *device, struct ccb_pathinq *cpi)
5444 ccb = cam_getccb(device);
5450 if (cam_send_ccb(device, ccb) < 0) {
5457 cam_error_print(device, ccb, CAM_ESF_ALL,
5470 * Get a get device CCB for the specified device.
5473 get_cgd(struct cam_device *device, struct ccb_getdev *cgd)
5478 ccb = cam_getccb(device);
5484 if (cam_send_ccb(device, ccb) < 0) {
5491 cam_error_print(device, ccb, CAM_ESF_ALL,
5504 * Returns 1 if the device has the VPD page, 0 if it does not, and -1 on an
5536 /* Disable freezing the device queue */
5571 * devtype is filled in with the type of device.
5627 * ATA device behind a SCSI to ATA translation layer (SATL),
5632 * device.
5700 /*device*/ 0,
5722 uint16_t *count, uint64_t *lba, uint8_t *device, uint8_t *status)
5781 *device = desc->device;
5788 * that the device is supposed to return 28-bit
5812 *device = 0;
5827 *device = (val >> 8) & 0xff;
5856 *device = res->device;
5867 *lba |= (res->device & 0xf) << 24;
6023 fprintf(stdout, "%s HBA device ID: 0x%04x\n",
6043 get_print_cts(struct cam_device *device, int user_settings, int quiet,
6050 ccb = cam_getccb(device);
6064 if (cam_send_ccb(device, ccb) < 0) {
6073 cam_error_print(device, ccb, CAM_ESF_ALL,
6080 cts_print(device, &ccb->cts);
6093 ratecontrol(struct cam_device *device, int task_attr, int retry_count,
6109 ccb = cam_getccb(device);
6197 if ((retval = get_cpi(device, &cpi)) != 0)
6203 retval = get_print_cts(device, user_settings, quiet, &ccb->cts);
6384 if (cam_send_ccb(device, ccb) < 0) {
6392 cam_error_print(device, ccb, CAM_ESF_ALL,
6400 retval = testunitready(device, task_attr, retry_count, timeout,
6415 retval = get_print_cts(device, user_settings, 0, NULL);
6424 scsiformat(struct cam_device *device, int argc, char **argv,
6440 ccb = cam_getccb(device);
6469 "following device:\n");
6471 error = scsidoinquiry(device, argc, argv, combinedopt,
6552 /* Disable freezing the device queue */
6558 if (((retval = cam_send_ccb(device, ccb)) < 0)
6569 cam_error_print(device, ccb, CAM_ESF_ALL,
6598 * loop and wait for the device to finish formatting.
6607 /* Disable freezing the device queue */
6610 retval = cam_send_ccb(device, ccb);
6669 scsi_sense_print(device, &ccb->csio,
6680 cam_error_print(device, ccb, CAM_ESF_ALL,
6689 cam_error_print(device, ccb, CAM_ESF_ALL,
6708 sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet,
6745 retval = cam_send_ccb(device, ccb);
6751 retval = get_ata_status(device, ccb, &error, &count, &lba,
6768 warnx("Unsupported sanitize device command. ");
6801 sanitize_wait_scsi(struct cam_device *device, union ccb *ccb, int task_attr, int quiet)
6813 * loop and wait for the device to finish sanitizing.
6822 /* Disable freezing the device queue */
6825 retval = cam_send_ccb(device, ccb);
6873 scsi_sense_print(device, &ccb->csio,
6884 cam_error_print(device, ccb, CAM_ESF_ALL,
6892 cam_error_print(device, ccb, CAM_ESF_ALL,
6901 sanitize(struct cam_device *device, int argc, char **argv,
6925 * Get the device type, request no I/O be done to do this.
6927 error = get_device_type(device, -1, 0, 0, &dt);
6929 warnx("sanitize: can't get device type");
6933 ccb = cam_getccb(device);
7075 "following device:\n");
7078 error = scsidoinquiry(device, argc, argv, combinedopt,
7082 error = ata_do_identify(device, retry_count, timeout,
7085 printf("%s%d: ", device->device_name,
7086 device->dev_unit_num);
7161 if (cam_send_ccb(device, ccb) < 0) {
7196 error = ata_do_cmd(device,
7227 "this device");
7229 warnx("error sanitizing this device");
7231 warnx("error sanitizing this device");
7234 cam_error_print(device, ccb, CAM_ESF_ALL,
7256 error = sanitize_wait_scsi(device, ccb, task_attr, quiet);
7258 error = sanitize_wait_ata(device, ccb, quiet, dt);
7275 scsireportluns(struct cam_device *device, int argc, char **argv,
7289 ccb = cam_getccb(device);
7358 /* Disable freezing the device queue */
7364 if (cam_send_ccb(device, ccb) < 0) {
7371 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
7510 scsireadcapacity(struct cam_device *device, int argc, char **argv,
7531 ccb = cam_getccb(device);
7607 /* Disable freezing the device queue */
7613 if (cam_send_ccb(device, ccb) < 0) {
7620 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
7649 /* Disable freezing the device queue */
7655 if (cam_send_ccb(device, ccb) < 0) {
7662 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
7714 smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
7731 ccb = cam_getccb(device);
7807 * If fd_data is set, and we're writing to the device, we need to
7849 if (((retval = cam_send_ccb(device, ccb)) < 0)
7859 cam_error_print(device, ccb, CAM_ESF_ALL,
7907 mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
7933 ccb = cam_getccb(device);
8058 if (((retval = cam_send_ccb(device, ccb)) < 0)
8075 if (((retval = cam_send_ccb(device, ccb)) < 0)
8093 if (((retval = cam_send_ccb(device, ccb)) < 0)
8109 if (((retval = cam_send_ccb(device, ccb)) < 0)
8213 if (((retval = cam_send_ccb(device, ccb)) < 0)
8223 cam_error_print(device, ccb, CAM_ESF_ALL,
8265 smpreportgeneral(struct cam_device *device, int argc, char **argv,
8280 ccb = cam_getccb(device);
8322 if (((retval = cam_send_ccb(device, ccb)) < 0)
8332 cam_error_print(device, ccb, CAM_ESF_ALL,
8340 * If the device supports the long response bit, try again and see
8399 smpphycontrol(struct cam_device *device, int argc, char **argv,
8422 ccb = cam_getccb(device);
8586 "required to set device name", __func__);
8626 if (((retval = cam_send_ccb(device, ccb)) < 0)
8640 cam_error_print(device, ccb, CAM_ESF_ALL,
8662 smpmaninfo(struct cam_device *device, int argc, char **argv,
8677 ccb = cam_getccb(device);
8705 if (((retval = cam_send_ccb(device, ccb)) < 0)
8715 cam_error_print(device, ccb, CAM_ESF_ALL,
9033 smpphylist(struct cam_device *device, int argc, char **argv,
9052 ccb = cam_getccb(device);
9101 if (((retval = cam_send_ccb(device, ccb)) < 0)
9111 cam_error_print(device, ccb, CAM_ESF_ALL,
9127 devlist.path_id = device->path_id;
9178 if (((retval = cam_send_ccb(device, ccb)) < 0)
9189 cam_error_print(device, ccb, CAM_ESF_ALL,
9287 atapm_proc_resp(struct cam_device *device, union ccb *ccb)
9294 retval = get_ata_status(device, ccb, &error, &count, &lba, &ata_device,
9298 cam_error_print(device, ccb, CAM_ESF_ALL,
9306 cam_error_print(device, ccb, CAM_ESF_ALL,
9311 printf("%s%d: ", device->device_name, device->dev_unit_num);
9349 atapm(struct cam_device *device, int argc, char **argv,
9359 ccb = cam_getccb(device);
9406 retval = ata_do_cmd(device,
9423 retval = atapm_proc_resp(device, ccb);
9430 ataaxm(struct cam_device *device, int argc, char **argv,
9439 ccb = cam_getccb(device);
9472 retval = ata_do_cmd(device,
9493 scsigetopcodes(struct cam_device *device, int opcode_set, int opcode,
9514 ccb = cam_getccb(device);
9574 if (cam_send_ccb(device, ccb) < 0) {
9582 cam_error_print(device, ccb, CAM_ESF_ALL,
9637 scsiprintoneopcode(struct cam_device *device, int req_opcode, int sa_set,
9661 op_desc = scsi_op_desc(req_opcode, &device->inq_data);
9769 scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf,
9810 op_desc = scsi_op_desc(desc->opcode, &device->inq_data);
9858 scsiopcodes(struct cam_device *device, int argc, char **argv,
9923 retval = scsigetopcodes(device, opcode_set, opcode, show_sa_errors,
9932 retval = scsiprintoneopcode(device, opcode, sa_set,
9935 retval = scsiprintopcodes(device, td_set, buf, valid_len);
9946 reprobe(struct cam_device *device)
9951 ccb = cam_getccb(device);
9960 if (cam_send_ccb(device, ccb) < 0) {
9967 cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
9983 "usage: camcontrol <command> [device id][generic args][command args]\n"
10075 "periphlist list all CAM peripheral drivers attached to a device\n"
10076 "sense send a request sense command to the named device\n"
10077 "tur send a test unit ready to the named device\n"
10078 "inquiry send a SCSI inquiry command to the named device\n"
10079 "identify send a ATA identify command to the named device\n"
10080 "reportluns send a SCSI report luns command to the device\n"
10081 "readcap send a SCSI read capacity command to the device\n"
10082 "start send a Start Unit command to the device\n"
10083 "stop send a Stop Unit command to the device\n"
10084 "load send a Start Unit command to the device with the load bit set\n"
10085 "eject send a Stop Unit command to the device with the eject bit set\n"
10086 "reprobe update capacity information of the given device\n"
10087 "rescan rescan all buses, the given bus, bus:target:lun or device\n"
10088 "reset reset all buses, the given bus, bus:target:lun or device\n"
10089 "defects read the defect list of the specified device\n"
10098 "tags report or set the number of transaction slots for a device\n"
10099 "negotiate report or set device negotiation parameters\n"
10100 "format send the SCSI FORMAT UNIT command to the named device\n"
10101 "sanitize send the SCSI SANITIZE command to the named device\n"
10102 "idle send the ATA IDLE command to the named device\n"
10103 "standby send the ATA STANDBY command to the named device\n"
10104 "sleep send the ATA SLEEP command to the named device\n"
10105 "powermode send the ATA CHECK POWER MODE command to the named device\n"
10106 "fwdownload program firmware of the named device with the given image\n"
10107 "security report or send ATA security commands to the named device\n"
10113 "timestamp report or set the device's timestamp\n"
10114 "devtype report the type of device\n"
10121 "deviceUNIT specify the device name, like \"da4\" or \"cd2\"\n"
10125 "-n dev_name specify device name, e.g. \"da\", \"cd\"\n"
10154 "-h human readable device size, base 2\n"
10155 "-H human readable device size, base 10\n"
10158 "-s only report the last block/device size\n"
10172 "-d name set the attached device name\n"
10191 "-N tags specify the number of tags to use for this device\n"
10227 "-v print info for every firmware segment sent to device\n"
10232 "-e pwd erase the device using the given pwd for the selected user\n"
10233 "-f freeze the security configuration of the specified device\n"
10234 "-h pwd enhanced erase the device using the given pwd for the\n"
10236 "-k pwd unlock the device using the given pwd for the selected\n"
10240 "-s pwd password the device (enable security) using the given\n"
10246 "-f freeze the HPA configuration of the device\n"
10247 "-l lock the HPA configuration of the device\n"
10253 " device\n"
10254 "-U pwd unlock the HPA configuration of the device\n"
10257 "-f freeze the AMA configuration of the device\n"
10260 " device\n"
10318 "-r report the timestamp of the device\n"
10319 "-f format report the timestamp of the device with the given\n"
10321 "-m report the timestamp of the device as milliseconds since\n"
10324 "-s set the timestamp of the device\n"
10327 "-U set the timestamp of the device to UTC time\n"
10353 char *device = NULL;
10446 * For these options we do not parse optional device arguments and
10447 * we do not open a passthrough device.
10462 /* device specified as bus:target[:lun] */
10465 errx(1, "numeric device specification must "
10478 device = strdup(name);
10486 * device name.
10512 device = (char *)strdup(tstr);
10569 * For most commands we'll want to open the passthrough device
10570 * associated with the specified device. In the case of the rescan
10571 * commands, we don't use a passthrough device at all, just the
10572 * transport layer device.
10578 errx(1, "subcommand \"%s\" requires a valid device "
10584 cam_open_spec_device(device,unit,O_RDWR,NULL)))