Fix comments about the cf_flags layout and use macros to test whether

tags, sync, and disconnect/reconnect are to be disabled or not.
This commit is contained in:
rumble 2007-05-21 19:25:54 +00:00
parent 305139637d
commit b1a93d335f
2 changed files with 13 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd33c93.c,v 1.15 2007/05/21 18:56:32 rumble Exp $ */
/* $NetBSD: wd33c93.c,v 1.16 2007/05/21 19:25:54 rumble Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd33c93.c,v 1.15 2007/05/21 18:56:32 rumble Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd33c93.c,v 1.16 2007/05/21 19:25:54 rumble Exp $");
#include "opt_ddb.h"
@ -273,16 +273,16 @@ wd33c93_init(struct wd33c93_softc *dev)
for (i = 0; i < 8; i++) {
struct wd33c93_tinfo *ti = &dev->sc_tinfo[i];
/*
* sc_flags = 0xTTRRSS
* cf_flags = 0xTTSSRR
*
* TT = Bitmask to disable Tagged Queues
* SS = Bitmask to disable Sync negotiation
* RR = Bitmask to disable disconnect/reselect
* SS = Bitmask to diable Sync negotiation
*/
ti->flags = T_NEED_RESET;
if (dev->sc_cfflags & (1<<(i+8)))
if (CFFLAGS_NOSYNC(dev->sc_cfflags, i))
ti->flags |= T_NOSYNC;
if (dev->sc_cfflags & (1<<i) || wd33c93_nodisc)
if (CFFLAGS_NODISC(dev->sc_cfflags, i) || wd33c93_nodisc)
ti->flags |= T_NODISC;
ti->period = dev->sc_minsyncperiod;
ti->offset = 0;
@ -630,7 +630,7 @@ wd33c93_scsi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void
ti = &dev->sc_tinfo[xm->xm_target];
ti->flags &= ~T_WANTSYNC;
if ((dev->sc_cfflags & (1<<(xm->xm_target+16))) == 0 &&
if ((CFFLAGS_NOTAGS(dev->sc_cfflags, xm->xm_target) == 0) &&
(xm->xm_mode & PERIPH_CAP_TQING) && !wd33c93_notags)
ti->flags |= T_TAG;
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd33c93var.h,v 1.6 2007/05/08 00:20:15 rumble Exp $ */
/* $NetBSD: wd33c93var.h,v 1.7 2007/05/21 19:25:55 rumble Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@ -223,6 +223,11 @@ struct wd33c93_softc {
#define SBIC_CHIP_LIST {"UNKNOWN", "WD33C93", "WD33C93A", "WD33C93B"}
/* macros for sc_cfflags */
#define CFFLAGS_NODISC(_cf, _t) ((_cf) & (1 << ( 0 + (_t))))
#define CFFLAGS_NOSYNC(_cf, _t) ((_cf) & (1 << ( 8 + (_t))))
#define CFFLAGS_NOTAGS(_cf, _t) ((_cf) & (1 << (16 + (_t))))
/*
* States returned by our state machine
*/