diff options
author | mav <mav@FreeBSD.org> | 2013-10-24 10:33:31 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-10-24 10:33:31 +0000 |
commit | c896ef2cccb7601faf5c79451228435a0717d08b (patch) | |
tree | f73b38176bc5e7759b1a1696805cc8037324e111 /sys/cam/cam_xpt.c | |
parent | 5411f6951ede72a782138783542ebb0cff454b91 (diff) | |
download | FreeBSD-src-c896ef2cccb7601faf5c79451228435a0717d08b.zip FreeBSD-src-c896ef2cccb7601faf5c79451228435a0717d08b.tar.gz |
MFC r256552:
Unify periph invalidation and destruction reporting.
Print message containing device model and serial number on invalidation.
Approved by: re (hrs)
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index c14041f..76ccb62 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -1023,6 +1023,7 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string) struct cam_path *path = periph->path; mtx_assert(periph->sim->mtx, MA_OWNED); + periph->flags |= CAM_PERIPH_ANNOUNCED; printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", periph->periph_name, periph->unit_number, @@ -1071,6 +1072,37 @@ xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string) } } +void +xpt_denounce_periph(struct cam_periph *periph) +{ + struct cam_path *path = periph->path; + + mtx_assert(periph->sim->mtx, MA_OWNED); + printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + periph->periph_name, periph->unit_number, + path->bus->sim->sim_name, + path->bus->sim->unit_number, + path->bus->sim->bus_id, + path->bus->path_id, + path->target->target_id, + path->device->lun_id); + printf("%s%d: ", periph->periph_name, periph->unit_number); + if (path->device->protocol == PROTO_SCSI) + scsi_print_inquiry_short(&path->device->inq_data); + else if (path->device->protocol == PROTO_ATA || + path->device->protocol == PROTO_SATAPM) + ata_print_ident_short(&path->device->ident_data); + else if (path->device->protocol == PROTO_SEMB) + semb_print_ident_short( + (struct sep_identify_data *)&path->device->ident_data); + else + printf("Unknown protocol device"); + if (path->device->serial_num_len > 0) + printf(" s/n %.60s", path->device->serial_num); + printf(" detached\n"); +} + + int xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path) { |