The branch stable/13 has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fbc8ddde4c66d6e5d2a22c9cd5a1c850ffdbe8a2

commit fbc8ddde4c66d6e5d2a22c9cd5a1c850ffdbe8a2
Author:     Warner Losh <i...@freebsd.org>
AuthorDate: 2021-03-03 01:31:43 +0000
Commit:     Warner Losh <i...@freebsd.org>
CommitDate: 2021-03-07 23:07:57 +0000

    cam: remove redundant scsi_vpd_block_characteristics definition
    
    There were two definitions for the SCSI VPD Block Device Characteristics 
(page
    0xb1): struct scsi_vpd_block_characteristics and struct
    scsi_vpd_block_device_characteristics. The latter is more complete and more
    widely used. Convert uses of the former to the latter by tweaking the da 
driver
    and removing sturct scsi_vpd_block_characteristics.
    
    (cherry picked from commit b3fce46a3eac600935f3aac2b224a83defcf1cb3)
---
 sys/cam/scsi/scsi_all.h | 24 ------------------------
 sys/cam/scsi/scsi_da.c  |  7 +++----
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index ff27388e446c..597d5fd68447 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -2820,30 +2820,6 @@ struct scsi_vpd_sfs
        uint8_t codes[];
 };
 
-/*
- * Block Device Characteristics VPD Page based on
- * T10/1799-D Revision 31
- */
-struct scsi_vpd_block_characteristics
-{
-       u_int8_t device;
-       u_int8_t page_code;
-#define SVPD_BDC                       0xB1
-       u_int8_t page_length[2];
-       u_int8_t medium_rotation_rate[2];
-#define SVPD_BDC_RATE_NOT_REPORTED     0x00
-#define SVPD_BDC_RATE_NON_ROTATING     0x01
-       u_int8_t reserved1;
-       u_int8_t nominal_form_factor;
-#define SVPD_BDC_FORM_NOT_REPORTED     0x00
-#define SVPD_BDC_FORM_5_25INCH         0x01
-#define SVPD_BDC_FORM_3_5INCH          0x02
-#define SVPD_BDC_FORM_2_5INCH          0x03
-#define SVPD_BDC_FORM_1_5INCH          0x04
-#define SVPD_BDC_FORM_LESSTHAN_1_5INCH 0x05
-       u_int8_t reserved2[56];
-};
-
 /*
  * Block Device Characteristics VPD Page
  */
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 490f75336efd..73e5e0c3e14c 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -3649,14 +3649,14 @@ out:
        }
        case DA_STATE_PROBE_BDC:
        {
-               struct scsi_vpd_block_characteristics *bdc;
+               struct scsi_vpd_block_device_characteristics *bdc;
 
                if (!scsi_vpd_supported_page(periph, SVPD_BDC)) {
                        softc->state = DA_STATE_PROBE_ATA;
                        goto skipstate;
                }
 
-               bdc = (struct scsi_vpd_block_characteristics *)
+               bdc = (struct scsi_vpd_block_device_characteristics *)
                        malloc(sizeof(*bdc), M_SCSIDA, M_NOWAIT|M_ZERO);
 
                if (bdc == NULL) {
@@ -5207,8 +5207,7 @@ dadone_probebdc(struct cam_periph *periph, union ccb 
*done_ccb)
                    medium_rotation_rate)) {
                        softc->disk->d_rotation_rate =
                                scsi_2btoul(bdc->medium_rotation_rate);
-                       if (softc->disk->d_rotation_rate ==
-                           SVPD_BDC_RATE_NON_ROTATING) {
+                       if (softc->disk->d_rotation_rate == SVPD_NON_ROTATING) {
                                cam_iosched_set_sort_queue(
                                    softc->cam_iosched, 0);
                                softc->flags &= ~DA_FLAG_ROTATING;
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to