-/* $OpenBSD: cd.c,v 1.177 2010/07/22 04:54:24 matthew Exp $ */
+/* $OpenBSD: cd.c,v 1.178 2010/07/22 15:59:46 matthew Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
xs->datalen = len;
xs->timeout = 5000;
+ cmd = (struct scsi_read_subchannel *)xs->cmd;
if (mode == CD_MSF_FORMAT)
cmd->byte2 |= CD_MSF;
cmd->byte3 = SRS_SUBQ;
u_int8_t buf[4 + 4 * 20], *bufp;
int error, i;
- xs = scsi_xs_get(xs->sc_link, SCSI_DATA_IN);
+ xs = scsi_xs_get(sc->sc_link, SCSI_DATA_IN);
if (xs == NULL)
return (ENOMEM);
xs->cmd->opcode = GPCMD_READ_DVD_STRUCTURE;
struct scsi_xfer *xs;
int error;
+ buf = malloc(sizeof(*buf), M_TEMP, M_WAITOK | M_ZERO);
+ if (buf == NULL)
+ return (ENOMEM);
+
xs = scsi_xs_get(sc->sc_link, SCSI_DATA_IN);
- if (xs == NULL)
+ if (xs == NULL) {
+ free(buf, M_TEMP);
return (ENOMEM);
+ }
xs->cmd->opcode = GPCMD_READ_DVD_STRUCTURE;
xs->cmdlen = sizeof(*cmd);
xs->data = (void *)buf;
xs->datalen = sizeof(*buf);
xs->timeout = 30000;
- buf = malloc(sizeof(*buf), M_TEMP, M_WAITOK | M_ZERO);
- if (buf == NULL) {
- scsi_xs_put(xs);
- return (ENOMEM);
- }
-
+ cmd = (struct scsi_read_dvd_structure *)xs->cmd;
cmd->format = s->type;
cmd->agid = s->disckey.agid << 6;
_lto2b(sizeof(*buf), cmd->length);
struct scsi_xfer *xs;
int error;
+ buf = malloc(sizeof(*buf), M_TEMP, M_WAITOK | M_ZERO);
+ if (buf == NULL)
+ return (ENOMEM);
+
xs = scsi_xs_get(sc->sc_link, SCSI_DATA_IN);
- if (xs == NULL)
+ if (xs == NULL) {
+ free(buf, M_TEMP);
return (ENOMEM);
+ }
xs->cmd->opcode = GPCMD_READ_DVD_STRUCTURE;
xs->cmdlen = sizeof(*cmd);
xs->data = (void *)buf;
xs->datalen = sizeof(*buf);
xs->timeout = 30000;
- buf = malloc(sizeof(*buf), M_TEMP, M_WAITOK | M_ZERO);
- if (buf == NULL) {
- scsi_xs_put(xs);
- return (ENOMEM);
- }
-
cmd = (struct scsi_read_dvd_structure *)xs->cmd;
cmd->format = s->type;
_lto2b(sizeof(*buf), cmd->length);
-/* $OpenBSD: ch.c,v 1.41 2010/07/22 00:31:06 krw Exp $ */
+/* $OpenBSD: ch.c,v 1.42 2010/07/22 15:59:47 matthew Exp $ */
/* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */
/*
xs->retries = CHRETRIES;
xs->timeout = 100000;
+ cmd = (struct scsi_move_medium *)xs->cmd;
_lto2b(sc->sc_picker, cmd->tea);
_lto2b(fromelem, cmd->src);
_lto2b(toelem, cmd->dst);
xs->retries = CHRETRIES;
xs->timeout = 100000;
+ cmd = (struct scsi_exchange_medium *)xs->cmd;
_lto2b(sc->sc_picker, cmd->tea);
_lto2b(src, cmd->src);
_lto2b(dst1, cmd->fdst);
xs->retries = CHRETRIES;
xs->timeout = 100000;
+ cmd = (struct scsi_position_to_element *)xs->cmd;
_lto2b(sc->sc_picker, cmd->tea);
_lto2b(dst, cmd->dst);
if (cp->cp_flags & CP_INVERT)
-/* $OpenBSD: safte.c,v 1.43 2010/07/22 05:21:02 matthew Exp $ */
+/* $OpenBSD: safte.c,v 1.44 2010/07/22 15:59:47 matthew Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
xs->retries = 2;
xs->timeout = 30000;
+ cmd = (struct safte_writebuf_cmd *)xs->cmd;
cmd->flags |= SAFTE_WR_MODE;
cmd->length = htobe16(sizeof(struct safte_slotop));