diff options
author | mav <mav@FreeBSD.org> | 2010-05-02 11:36:27 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-05-02 11:36:27 +0000 |
commit | 4e502e1ceb65ddf828e427fe014e2a31cff0307a (patch) | |
tree | 39c1623279847c0fdfee003f5c7fc3f01919bc94 /sbin/camcontrol/camcontrol.c | |
parent | 113965a783486fa0bfab880cc7a2209285511195 (diff) | |
download | FreeBSD-src-4e502e1ceb65ddf828e427fe014e2a31cff0307a.zip FreeBSD-src-4e502e1ceb65ddf828e427fe014e2a31cff0307a.tar.gz |
Add -d and -f arguments to `camcontrol cmd`, to execute DMA ATA commands.
Diffstat (limited to 'sbin/camcontrol/camcontrol.c')
-rw-r--r-- | sbin/camcontrol/camcontrol.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 8e0605f..9136cbe 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -123,7 +123,7 @@ struct camcontrol_opts { }; #ifndef MINIMALISTIC -static const char scsicmd_opts[] = "a:c:i:o:r"; +static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; #endif @@ -2184,6 +2184,8 @@ scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int c, data_bytes = 0; int cdb_len = 0; int atacmd_len = 0; + int dmacmd = 0; + int fpdmacmd = 0; int need_res = 0; char *datastr = NULL, *tstr, *resstr = NULL; int error = 0; @@ -2246,6 +2248,12 @@ scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, */ optind += hook.got; break; + case 'd': + dmacmd = 1; + break; + case 'f': + fpdmacmd = 1; + break; case 'i': if (arglist & CAM_ARG_CMD_OUT) { warnx("command must either be " @@ -2422,6 +2430,10 @@ scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, bcopy(atacmd, &ccb->ataio.cmd.command, atacmd_len); if (need_res) ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; + if (dmacmd) + ccb->ataio.cmd.flags |= CAM_ATAIO_DMA; + if (fpdmacmd) + ccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA; cam_fill_ataio(&ccb->ataio, /*retries*/ retry_count, @@ -4353,7 +4365,7 @@ usage(int verbose) " [-P pagectl][-e | -b][-d]\n" " camcontrol cmd [dev_id][generic args]\n" " <-a cmd [args] | -c cmd [args]>\n" -" [-i len fmt|-o len fmt [args]] [-r fmt]\n" +" [-d] [-f] [-i len fmt|-o len fmt [args]] [-r fmt]\n" " camcontrol debug [-I][-P][-T][-S][-X][-c]\n" " <all|bus[:target[:lun]]|off>\n" " camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n" |