Date: Thu, 8 Aug 2019 00:19:45 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350705 - stable/12/sys/cam/scsi Message-ID: <201908080019.x780JjwG060402@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Aug 8 00:19:45 2019 New Revision: 350705 URL: https://svnweb.freebsd.org/changeset/base/350705 Log: MFC r340452 (by imp): Introduce scsi_ata_setfeatures() as a convenient way to make a passthru ATA SETFEATURES command. Modified: stable/12/sys/cam/scsi/scsi_all.c stable/12/sys/cam/scsi/scsi_all.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 00:18:36 2019 (r350704) +++ stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 00:19:45 2019 (r350705) @@ -8387,6 +8387,38 @@ scsi_ata_read_log(struct ccb_scsiio *csio, uint32_t re return (retval); } +int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t feature, + uint64_t lba, uint32_t count, + uint8_t sense_len, uint32_t timeout) +{ + return (scsi_ata_pass(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_NONE, + tag_action, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_TDIR_FROM_DEV | + AP_FLAG_BYT_BLOK_BYTES | + AP_FLAG_TLEN_SECT_CNT, + /*features*/feature, + /*sector_count*/count, + /*lba*/lba, + /*command*/ATA_SETFEATURES, + /*device*/ 0, + /*icc*/ 0, + /*auxiliary*/0, + /*control*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*cdb_storage*/NULL, + /*cdb_storage_len*/0, + /*minimum_cmd_size*/0, + sense_len, + timeout)); +} + /* * Note! This is an unusual CDB building function because it can return * an error in the event that the command in question requires a variable Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Thu Aug 8 00:18:36 2019 (r350704) +++ stable/12/sys/cam/scsi/scsi_all.h Thu Aug 8 00:19:45 2019 (r350705) @@ -4177,6 +4177,12 @@ int scsi_ata_read_log(struct ccb_scsiio *csio, uint32_ uint8_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint8_t sense_len, uint32_t timeout); +int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t feature, + uint64_t lba, uint32_t count, + uint8_t sense_len, uint32_t timeout); + int scsi_ata_pass(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, uint8_t tag_action,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908080019.x780JjwG060402>