summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-all.c2
-rw-r--r--sys/dev/ata/ata-all.h2
-rw-r--r--sys/dev/ata/atapi-cd.c28
3 files changed, 17 insertions, 15 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index b807a31..7b9a20a 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -1010,7 +1010,7 @@ ata_wait(struct ata_device *atadev, u_int8_t mask)
int
ata_command(struct ata_device *atadev, u_int8_t command,
- u_int64_t lba, u_int16_t count, u_int8_t feature, int flags)
+ u_int64_t lba, u_int16_t count, u_int16_t feature, int flags)
{
int error = 0;
#ifdef ATA_DEBUG
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h
index 37cbbea..8c65250 100644
--- a/sys/dev/ata/ata-all.h
+++ b/sys/dev/ata/ata-all.h
@@ -258,7 +258,7 @@ void ata_start(struct ata_channel *);
void ata_reset(struct ata_channel *);
int ata_reinit(struct ata_channel *);
int ata_wait(struct ata_device *, u_int8_t);
-int ata_command(struct ata_device *, u_int8_t, u_int64_t, u_int16_t, u_int8_t, int);
+int ata_command(struct ata_device *, u_int8_t, u_int64_t, u_int16_t, u_int16_t, int);
void ata_drawerleds(struct ata_device *, u_int8_t);
int ata_printf(struct ata_channel *, int, const char *, ...) __printflike(3, 4);
int ata_prtdev(struct ata_device *, const char *, ...) __printflike(2, 3);
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index b427d32..6e91ef7 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -1625,6 +1625,7 @@ acd_send_cue(struct acd_softc *cdp, struct cdr_cuesheet *cuesheet)
if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
(caddr_t)&param, sizeof(param))))
return error;
+
param.data_length = 0;
param.page_code = ATAPI_CDROM_WRITE_PARAMETERS_PAGE;
param.page_length = 0x32;
@@ -1638,25 +1639,26 @@ acd_send_cue(struct acd_softc *cdp, struct cdr_cuesheet *cuesheet)
param.session_format = cuesheet->session_format;
if (cdp->cap.burnproof)
param.burnproof = 1;
+
if ((error = acd_mode_select(cdp, (caddr_t)&param, param.page_length + 10)))
return error;
- buffer = malloc(cuesheet->len, M_ACD, M_NOWAIT);
- if (!buffer)
+ if (!(buffer = malloc(cuesheet->len, M_ACD, M_NOWAIT)))
return ENOMEM;
- if ((error = copyin(cuesheet->entries, buffer, cuesheet->len)))
- return error;
+
+ if (!(error = copyin(cuesheet->entries, buffer, cuesheet->len))) {
#ifdef ACD_DEBUG
- printf("acd: cuesheet lenght = %d\n", cuesheet->len);
- for (i=0; i<cuesheet->len; i++)
- if (i%8)
- printf(" %02x", buffer[i]);
- else
- printf("\n%02x", buffer[i]);
- printf("\n");
+ printf("acd: cuesheet lenght = %d\n", cuesheet->len);
+ for (i=0; i<cuesheet->len; i++)
+ if (i%8)
+ printf(" %02x", buffer[i]);
+ else
+ printf("\n%02x", buffer[i]);
+ printf("\n");
#endif
- error = atapi_queue_cmd(cdp->device, ccb, buffer, cuesheet->len, 0,
- 30, NULL, NULL);
+ error = atapi_queue_cmd(cdp->device, ccb, buffer, cuesheet->len, 0,
+ 30, NULL, NULL);
+ }
free(buffer, M_ACD);
return error;
}
OpenPOWER on IntegriCloud