Further corrections for siisata.

Reset ch_status and ch_error at the beginning of any operation.

The chip only writes the RDH FIS to the SRAM when the error bit is
set in a RDH FIS (per the datasheet).  Thus, satafis_sdb_parse() is
replaced with satafis_rhd_parse().  A valid FIS type field seems to
not be written to the SRAM, so don't bother checking it for the
correct magic.

Additionally, append 2009 to copyright year set, and remove
obsolete CVS Id lines from when this was in my repository.
This commit is contained in:
jakllsch 2009-07-04 20:57:15 +00:00
parent 464a6f95bf
commit 5b75384146
4 changed files with 26 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: satafis_subr.c,v 1.2 2009/06/17 03:55:04 jakllsch Exp $ */
/* $NetBSD: satafis_subr.c,v 1.3 2009/07/04 20:57:15 jakllsch Exp $ */
/*-
* Copyright (c) 2009 Jonathan A. Kollasch.
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.2 2009/06/17 03:55:04 jakllsch Exp $");
__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.3 2009/07/04 20:57:15 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -148,11 +148,14 @@ satafis_rhd_construct_atapi(struct ata_xfer *xfer, uint8_t *fis)
#endif /* NATAPIBUS */
void
satafis_sdb_parse(struct ata_channel *chp, uint8_t *fis)
satafis_rdh_parse(struct ata_channel *chp, uint8_t *fis)
{
KASSERT(fis[fis_type] != SDB_FISTYPE);
chp->ch_status = fis[sdb_status];
chp->ch_error = fis[sdb_error];
#if 0
/* siisata doesn't do enough for this to work */
KASSERT(fis[fis_type] == RDH_FISTYPE);
#endif
chp->ch_status = fis[rdh_status];
chp->ch_error = fis[rdh_error];
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: satafisvar.h,v 1.1 2009/06/17 03:07:51 jakllsch Exp $ */
/* $NetBSD: satafisvar.h,v 1.2 2009/07/04 20:57:15 jakllsch Exp $ */
/*-
* Copyright (c) 2009 Jonathan A. Kollasch.
@ -33,6 +33,6 @@
void satafis_rhd_construct_cmd(struct ata_command *, uint8_t *);
void satafis_rhd_construct_bio(struct ata_xfer *, uint8_t *);
void satafis_rhd_construct_atapi(struct ata_xfer *, uint8_t *);
void satafis_sdb_parse(struct ata_channel *, uint8_t *);
void satafis_rdh_parse(struct ata_channel *, uint8_t *);
#endif /* _DEV_ATA_FISVAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: siisata.c,v 1.6 2009/06/27 21:04:47 jakllsch Exp $ */
/* $NetBSD: siisata.c,v 1.7 2009/07/04 20:57:15 jakllsch Exp $ */
/* from ahcisata_core.c */
@ -64,7 +64,7 @@
*/
/*-
* Copyright (c) 2007, 2008 Jonathan A. Kollasch.
* Copyright (c) 2007, 2008, 2009 Jonathan A. Kollasch.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -479,13 +479,13 @@ siisata_intr_port(struct siisata_channel *schp)
ec = PRREAD(sc, PRX(chp->ch_channel, PRO_PCE));
if (ec <= PR_PCE_DATAFISERROR) {
if (ec != PR_PCE_DATAFISERROR) {
if (ec == PR_PCE_DEVICEERROR) {
/* read in specific information about error */
prbfis = bus_space_read_stream_4(
sc->sc_prt, sc->sc_prh,
PRSX(chp->ch_channel, slot, PRSO_FIS));
/* set ch_status and ch_error */
satafis_sdb_parse(chp, (uint8_t *)&prbfis);
satafis_rdh_parse(chp, (uint8_t *)&prbfis);
}
siisata_reinit_port(chp);
} else {
@ -774,6 +774,9 @@ siisata_cmd_start(struct ata_channel *chp, struct ata_xfer *xfer)
SIISATA_DEBUG_PRINT(("%s: %s port %d, slot %d\n",
SIISATANAME(sc), __func__, chp->ch_channel, slot), DEBUG_FUNCS);
chp->ch_status = 0;
chp->ch_error = 0;
prb = schp->sch_prb[slot];
memset(prb, 0, sizeof(struct siisata_prb));
@ -978,6 +981,9 @@ siisata_bio_start(struct ata_channel *chp, struct ata_xfer *xfer)
SIISATANAME(sc), __func__, chp->ch_channel, slot),
DEBUG_FUNCS);
chp->ch_status = 0;
chp->ch_error = 0;
prb = schp->sch_prb[slot];
memset(prb, 0, sizeof(struct siisata_prb));
@ -1515,6 +1521,9 @@ siisata_atapi_start(struct ata_channel *chp, struct ata_xfer *xfer)
chp->ch_drive[xfer->c_drive].drive, sc_xfer->xs_control),
DEBUG_XFERS);
chp->ch_status = 0;
chp->ch_error = 0;
prbp = schp->sch_prb[slot];
memset(prbp, 0, sizeof(struct siisata_prb));

View File

@ -1,8 +1,7 @@
/* $NetBSD: siisatareg.h,v 1.3 2009/06/17 04:37:57 jakllsch Exp $ */
/* Id: siisatareg.h,v 1.10 2008/05/21 15:51:36 jakllsch Exp */
/* $NetBSD: siisatareg.h,v 1.4 2009/07/04 20:57:15 jakllsch Exp $ */
/*-
* Copyright (c) 2007, 2008 Jonathan A. Kollasch.
* Copyright (c) 2007, 2008, 2009 Jonathan A. Kollasch.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without