Parameter group changes:

- Do FIELD_SET correctly for scalar types.
- Add some basic table ops.
- Push error reporting back into iop.c.
- Add some field index and (yet more) LAN defs to i2o.h.
This commit is contained in:
ad 2001-08-22 09:42:05 +00:00
parent 153449a2b4
commit 1d6329bb04
5 changed files with 281 additions and 84 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: i2o.h,v 1.7 2001/08/06 13:33:49 ad Exp $ */
/* $NetBSD: i2o.h,v 1.8 2001/08/22 09:42:05 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -873,6 +873,18 @@ struct i2o_param_rbs_operation {
u_int32_t atomicwritesize;
} __attribute__ ((__packed__));
#define I2O_PARAM_RBS_OPERATION_autoreass 0
#define I2O_PARAM_RBS_OPERATION_reasstolerance 1
#define I2O_PARAM_RBS_OPERATION_numretries 2
#define I2O_PARAM_RBS_OPERATION_reserved0 3
#define I2O_PARAM_RBS_OPERATION_reasssize 4
#define I2O_PARAM_RBS_OPERATION_expectedtimeout 5
#define I2O_PARAM_RBS_OPERATION_rwvtimeout 6
#define I2O_PARAM_RBS_OPERATION_rwvtimeoutbase 7
#define I2O_PARAM_RBS_OPERATION_timeoutbase 8
#define I2O_PARAM_RBS_OPERATION_orderedreqdepth 9
#define I2O_PARAM_RBS_OPERATION_atomicwritesize 10
#define I2O_PARAM_RBS_CACHE_CONTROL 0x0003
struct i2o_param_rbs_cache_control {
u_int32_t totalcachesize;
@ -1063,6 +1075,19 @@ struct i2o_lan_receive_reply {
u_int32_t bucketsleft;
} __attribute__ ((__packed__));
#define I2O_LAN_RECEIVE_REPLY_PDB 0x80
#define I2O_LAN_PDB_ERROR_NONE 0x00
#define I2O_LAN_PDB_ERROR_BAD_CRC 0x01
#define I2O_LAN_PDB_ERROR_ALIGNMENT 0x02
#define I2O_LAN_PDB_ERROR_TOO_LONG 0x03
#define I2O_LAN_PDB_ERROR_TOO_SHORT 0x04
#define I2O_LAN_PDB_ERROR_RX_OVERRUN 0x05
#define I2O_LAN_PDB_ERROR_L3_CKSUM_BAD 0x40
#define I2O_LAN_PDB_ERROR_L4_CKSUM_BAD 0x80
#define I2O_LAN_PDB_ERROR_CKSUM_MASK 0xc0
#define I2O_LAN_PDB_ERROR_OTHER 0xff
#define I2O_LAN_RESET 0x35
struct i2o_lan_reset {
u_int32_t msgflags;
@ -1132,13 +1157,31 @@ struct i2o_param_lan_mac_address {
u_int8_t activeaddr[8];
u_int8_t localaddr[8];
u_int8_t addrmask[8];
u_int8_t filtermask[4];
u_int8_t hwfiltermask[4];
u_int32_t filtermask;
u_int32_t hwfiltercaps;
u_int32_t maxmcastaddr;
u_int32_t maxfilterperfect;
u_int32_t maxfilterimperfect;
} __attribute__ ((__packed__));
#define I2O_PARAM_LAN_MAC_ADDRESS_activeaddr 0
#define I2O_PARAM_LAN_MAC_ADDRESS_localaddr 1
#define I2O_PARAM_LAN_MAC_ADDRESS_addrmask 2
#define I2O_PARAM_LAN_MAC_ADDRESS_filtermask 3
#define I2O_PARAM_LAN_MAC_ADDRESS_hwfiltercaps 4
#define I2O_PARAM_LAN_MAC_ADDRESS_maxmcastaddr 5
#define I2O_PARAM_LAN_MAC_ADDRESS_maxfilterperfect 6
#define I2O_PARAM_LAN_MAC_ADDRESS_maxfilterimperfect 7
#define I2O_LAN_FILTERMASK_UNICAST_DISABLE 0x0001
#define I2O_LAN_FILTERMASK_PROMISC_ENABLE 0x0002
#define I2O_LAN_FILTERMASK_PROMISC_MCAST_ENABLE 0x0004
#define I2O_LAN_FILTERMASK_BROADCAST_DISABLE 0x0100
#define I2O_LAN_FILTERMASK_MCAST_DISABLE 0x0200
#define I2O_LAN_FILTERMASK_FUNCADDR_DISABLE 0x0400
#define I2O_LAN_FILTERMASK_MACMODE_0 0x0800
#define I2O_LAN_FILTERMASK_MACMODE_1 0x1000
#define I2O_PARAM_LAN_MCAST_MAC_ADDRESS 0x0002
/*
* This one's a table, not a scalar.
@ -1157,6 +1200,16 @@ struct i2o_param_lan_batch_control {
u_int32_t maxtxbatchcount; /* 2.0 only */
} __attribute__ ((__packed__));
#define I2O_PARAM_LAN_BATCH_CONTROL_batchflags 0
#define I2O_PARAM_LAN_BATCH_CONTROL_risingloaddly 1
#define I2O_PARAM_LAN_BATCH_CONTROL_risingloadthresh 2
#define I2O_PARAM_LAN_BATCH_CONTROL_fallingloaddly 3
#define I2O_PARAM_LAN_BATCH_CONTROL_fallingloadthresh 4
#define I2O_PARAM_LAN_BATCH_CONTROL_maxrxbatchcount 5
#define I2O_PARAM_LAN_BATCH_CONTROL_maxrxbatchdelay 6
#define I2O_PARAM_LAN_BATCH_CONTROL_maxtxbatchdelay 7
#define I2O_PARAM_LAN_BATCH_CONTROL_maxtxbatchcount 8
#define I2O_PARAM_LAN_OPERATION 0x0004
struct i2o_param_lan_operation {
u_int32_t pktprepad;
@ -1166,6 +1219,12 @@ struct i2o_param_lan_operation {
u_int32_t rxmodesenable; /* 2.0 only */
} __attribute__ ((__packed__));
#define I2O_PARAM_LAN_OPERATION_pktprepad 0
#define I2O_PARAM_LAN_OPERATION_userflags 1
#define I2O_PARAM_LAN_OPERATION_pktorphanlimit 2
#define I2O_PARAM_LAN_OPERATION_txmodesenable 3
#define I2O_PARAM_LAN_OPERATION_rxmodesenable 4
#define I2O_PARAM_LAN_MEDIA_OPERATION 0x0005
struct i2o_param_lan_media_operation {
u_int32_t connectortype;
@ -1180,6 +1239,17 @@ struct i2o_param_lan_media_operation {
u_int32_t connectiontarget; /* v2.0 only */
} __attribute__ ((__packed__));
#define I2O_PARAM_LAN_MEDIA_OPERATION_connectortype 0
#define I2O_PARAM_LAN_MEDIA_OPERATION_connectiontype 1
#define I2O_PARAM_LAN_MEDIA_OPERATION_curtxbps 2
#define I2O_PARAM_LAN_MEDIA_OPERATION_currxbps 3
#define I2O_PARAM_LAN_MEDIA_OPERATION_fullduplex 4
#define I2O_PARAM_LAN_MEDIA_OPERATION_linkstatus 5
#define I2O_PARAM_LAN_MEDIA_OPERATION_badpkthandling 6
#define I2O_PARAM_LAN_MEDIA_OPERATION_duplextarget 7
#define I2O_PARAM_LAN_MEDIA_OPERATION_connectortarget 8
#define I2O_PARAM_LAN_MEDIA_OPERATION_connectiontarget 9
#define I2O_LAN_CONNECTOR_OTHER 0x00
#define I2O_LAN_CONNECTOR_UNKNOWN 0x01
#define I2O_LAN_CONNECTOR_AUI 0x02
@ -1284,4 +1354,18 @@ struct i2o_param_lan_802_3_stats {
u_int64_t excessivedeferrals;
} __attribute__ ((__packed__));
#define I2O_PARAM_LAN_FDDI_STATS 0x0400
struct i2o_param_lan_fddi_stats {
u_int64_t configstate;
u_int64_t upstreamnode;
u_int64_t downstreamnode;
u_int64_t frameerrors;
u_int64_t frameslost;
u_int64_t ringmgmtstate;
u_int64_t lctfailures;
u_int64_t lemrejects;
u_int64_t lemcount;
u_int64_t lconnectionstate;
} __attribute__ ((__packed__));
#endif /* !defined _I2O_I2O_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: iop.c,v 1.15 2001/08/04 16:54:18 ad Exp $ */
/* $NetBSD: iop.c,v 1.16 2001/08/22 09:42:05 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -1188,13 +1188,13 @@ iop_lct_get(struct iop_softc *sc)
* pointer to the parameter group op in the wrapper's `im_dvcontext' field.
*/
int
iop_param_op(struct iop_softc *sc, int tid, struct iop_initiator *ii,
int write, int group, void *buf, int size)
iop_field_get_all(struct iop_softc *sc, int tid, int group, void *buf,
int size, struct iop_initiator *ii)
{
struct iop_msg *im;
struct i2o_util_params_op *mf;
struct i2o_reply *rf;
int rv, func, op;
int rv;
struct iop_pgop *pgop;
u_int32_t mb[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
@ -1211,24 +1211,16 @@ iop_param_op(struct iop_softc *sc, int tid, struct iop_initiator *ii,
im->im_dvcontext = pgop;
im->im_rb = rf;
if (write) {
func = I2O_UTIL_PARAMS_SET;
op = I2O_PARAMS_OP_FIELD_SET;
} else {
func = I2O_UTIL_PARAMS_GET;
op = I2O_PARAMS_OP_FIELD_GET;
}
mf = (struct i2o_util_params_op *)mb;
mf->msgflags = I2O_MSGFLAGS(i2o_util_params_op);
mf->msgfunc = I2O_MSGFUNC(tid, func);
mf->msgfunc = I2O_MSGFUNC(tid, I2O_UTIL_PARAMS_GET);
mf->msgictx = IOP_ICTX;
mf->msgtctx = im->im_tctx;
mf->flags = 0;
pgop->olh.count = htole16(1);
pgop->olh.reserved = htole16(0);
pgop->oat.operation = htole16(op);
pgop->oat.operation = htole16(I2O_PARAMS_OP_FIELD_GET);
pgop->oat.fieldcount = htole16(0xffff);
pgop->oat.group = htole16(group);
@ -1237,7 +1229,7 @@ iop_param_op(struct iop_softc *sc, int tid, struct iop_initiator *ii,
memset(buf, 0, size);
iop_msg_map(sc, im, mb, pgop, sizeof(*pgop), 1, NULL);
iop_msg_map(sc, im, mb, buf, size, write, NULL);
iop_msg_map(sc, im, mb, buf, size, 0, NULL);
rv = iop_msg_post(sc, im, mb, (ii == NULL ? 30000 : 0));
if (ii == NULL)
@ -1250,6 +1242,10 @@ iop_param_op(struct iop_softc *sc, int tid, struct iop_initiator *ii,
rv = 0;
else
rv = (rf->reqstatus != 0 ? EIO : 0);
if (rv != 0)
printf("%s: FIELD_GET failed for tid %d group %d\n",
sc->sc_dv.dv_xname, tid, group);
}
if (ii == NULL || rv != 0) {
@ -1262,6 +1258,146 @@ iop_param_op(struct iop_softc *sc, int tid, struct iop_initiator *ii,
return (rv);
}
/*
* Set a single field in a scalar parameter group.
*/
int
iop_field_set(struct iop_softc *sc, int tid, int group, void *buf,
int size, int field)
{
struct iop_msg *im;
struct i2o_util_params_op *mf;
struct iop_pgop *pgop;
int rv, totsize;
u_int32_t mb[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
totsize = sizeof(*pgop) + size;
im = iop_msg_alloc(sc, IM_WAIT);
if ((pgop = malloc(totsize, M_DEVBUF, M_WAITOK)) == NULL) {
iop_msg_free(sc, im);
return (ENOMEM);
}
mf = (struct i2o_util_params_op *)mb;
mf->msgflags = I2O_MSGFLAGS(i2o_util_params_op);
mf->msgfunc = I2O_MSGFUNC(tid, I2O_UTIL_PARAMS_SET);
mf->msgictx = IOP_ICTX;
mf->msgtctx = im->im_tctx;
mf->flags = 0;
pgop->olh.count = htole16(1);
pgop->olh.reserved = htole16(0);
pgop->oat.operation = htole16(I2O_PARAMS_OP_FIELD_SET);
pgop->oat.fieldcount = htole16(1);
pgop->oat.group = htole16(group);
pgop->oat.fields[0] = htole16(field);
memcpy(pgop + 1, buf, size);
iop_msg_map(sc, im, mb, pgop, totsize, 1, NULL);
rv = iop_msg_post(sc, im, mb, 30000);
if (rv != 0)
printf("%s: FIELD_SET failed for tid %d group %d\n",
sc->sc_dv.dv_xname, tid, group);
iop_msg_unmap(sc, im);
iop_msg_free(sc, im);
free(pgop, M_DEVBUF);
return (rv);
}
/*
* Delete all rows in a tablular parameter group.
*/
int
iop_table_clear(struct iop_softc *sc, int tid, int group)
{
struct iop_msg *im;
struct i2o_util_params_op *mf;
struct iop_pgop pgop;
u_int32_t mb[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
int rv;
im = iop_msg_alloc(sc, IM_WAIT);
mf = (struct i2o_util_params_op *)mb;
mf->msgflags = I2O_MSGFLAGS(i2o_util_params_op);
mf->msgfunc = I2O_MSGFUNC(tid, I2O_UTIL_PARAMS_SET);
mf->msgictx = IOP_ICTX;
mf->msgtctx = im->im_tctx;
mf->flags = 0;
pgop.olh.count = htole16(1);
pgop.olh.reserved = htole16(0);
pgop.oat.operation = htole16(I2O_PARAMS_OP_TABLE_CLEAR);
pgop.oat.fieldcount = htole16(0);
pgop.oat.group = htole16(group);
pgop.oat.fields[0] = htole16(0);
PHOLD(curproc);
iop_msg_map(sc, im, mb, &pgop, sizeof(pgop), 1, NULL);
rv = iop_msg_post(sc, im, mb, 30000);
if (rv != 0)
printf("%s: TABLE_CLEAR failed for tid %d group %d\n",
sc->sc_dv.dv_xname, tid, group);
iop_msg_unmap(sc, im);
PRELE(curproc);
iop_msg_free(sc, im);
return (rv);
}
/*
* Add a single row to a tabular parameter group. The row can have only one
* field.
*/
int
iop_table_add_row(struct iop_softc *sc, int tid, int group, void *buf,
int size, int row)
{
struct iop_msg *im;
struct i2o_util_params_op *mf;
struct iop_pgop *pgop;
int rv, totsize;
u_int32_t mb[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
totsize = sizeof(*pgop) + sizeof(u_int16_t) * 2 + size;
im = iop_msg_alloc(sc, IM_WAIT);
if ((pgop = malloc(totsize, M_DEVBUF, M_WAITOK)) == NULL) {
iop_msg_free(sc, im);
return (ENOMEM);
}
mf = (struct i2o_util_params_op *)mb;
mf->msgflags = I2O_MSGFLAGS(i2o_util_params_op);
mf->msgfunc = I2O_MSGFUNC(tid, I2O_UTIL_PARAMS_SET);
mf->msgictx = IOP_ICTX;
mf->msgtctx = im->im_tctx;
mf->flags = 0;
pgop->olh.count = htole16(1);
pgop->olh.reserved = htole16(0);
pgop->oat.operation = htole16(I2O_PARAMS_OP_ROW_ADD);
pgop->oat.fieldcount = htole16(1);
pgop->oat.group = htole16(group);
pgop->oat.fields[0] = htole16(0); /* FieldIdx */
pgop->oat.fields[1] = htole16(1); /* RowCount */
pgop->oat.fields[2] = htole16(row); /* KeyValue */
memcpy(&pgop->oat.fields[3], buf, size);
iop_msg_map(sc, im, mb, pgop, totsize, 1, NULL);
rv = iop_msg_post(sc, im, mb, 30000);
if (rv != 0)
printf("%s: ADD_ROW failed for tid %d group %d row %d\n",
sc->sc_dv.dv_xname, tid, group, row);
iop_msg_unmap(sc, im);
iop_msg_free(sc, im);
free(pgop, M_DEVBUF);
return (rv);
}
/*
* Execute a simple command (no parameters).
*/
@ -2193,8 +2329,8 @@ iop_print_ident(struct iop_softc *sc, int tid)
char buf[32];
int rv;
rv = iop_param_op(sc, tid, NULL, 0, I2O_PARAM_DEVICE_IDENTITY, &p,
sizeof(p));
rv = iop_field_get_all(sc, tid, I2O_PARAM_DEVICE_IDENTITY, &p,
sizeof(p), NULL);
if (rv != 0)
return (rv);

View File

@ -1,4 +1,4 @@
/* $NetBSD: iopsp.c,v 1.9 2001/08/04 16:54:18 ad Exp $ */
/* $NetBSD: iopsp.c,v 1.10 2001/08/22 09:42:06 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -102,8 +102,8 @@ iopsp_match(struct device *parent, struct cfdata *match, void *aux)
if (ia->ia_class != I2O_CLASS_BUS_ADAPTER_PORT)
return (0);
if (iop_param_op((struct iop_softc *)parent, ia->ia_tid, NULL, 0,
I2O_PARAM_HBA_CTLR_INFO, &param, sizeof(param)) != 0)
if (iop_field_get_all((struct iop_softc *)parent, ia->ia_tid,
I2O_PARAM_HBA_CTLR_INFO, &param, sizeof(param), NULL) != 0)
return (0);
return (param.ci.bustype == I2O_HBA_BUS_SCSI ||
@ -146,13 +146,10 @@ iopsp_attach(struct device *parent, struct device *self, void *aux)
sc->sc_ii.ii_adjqparam = iopsp_adjqparam;
iop_initiator_register(iop, &sc->sc_ii);
rv = iop_param_op(iop, ia->ia_tid, NULL, 0, I2O_PARAM_HBA_CTLR_INFO,
&param, sizeof(param));
if (rv != 0) {
printf("%s: unable to get parameters (0x%04x; %d)\n",
sc->sc_dv.dv_xname, I2O_PARAM_HBA_CTLR_INFO, rv);
rv = iop_field_get_all(iop, ia->ia_tid, I2O_PARAM_HBA_CTLR_INFO,
&param, sizeof(param), NULL);
if (rv != 0)
goto bad;
}
fc = (param.p.ci.bustype == I2O_HBA_BUS_FCA);
@ -164,13 +161,10 @@ iopsp_attach(struct device *parent, struct device *self, void *aux)
iop_print_ident(iop, ia->ia_tid);
printf("\n");
rv = iop_param_op(iop, ia->ia_tid, NULL, 0,
I2O_PARAM_HBA_SCSI_CTLR_INFO, &param, sizeof(param));
if (rv != 0) {
printf("%s: unable to get parameters (0x%04x; %d)\n",
sc->sc_dv.dv_xname, I2O_PARAM_HBA_SCSI_CTLR_INFO, rv);
rv = iop_field_get_all(iop, ia->ia_tid, I2O_PARAM_HBA_SCSI_CTLR_INFO,
&param, sizeof(param), NULL);
if (rv != 0)
goto bad;
}
#ifdef I2OVERBOSE
printf("%s: ", sc->sc_dv.dv_xname);
@ -290,14 +284,10 @@ iopsp_reconfig(struct device *dv)
continue;
tid = le16toh(le->localtid) & 4095;
rv = iop_param_op(iop, tid, NULL, 0, I2O_PARAM_SCSI_DEVICE_INFO,
&param, sizeof(param));
if (rv != 0) {
printf("%s: unable to get parameters (0x%04x; %d)\n",
sc->sc_dv.dv_xname, I2O_PARAM_SCSI_DEVICE_INFO,
rv);
rv = iop_field_get_all(iop, tid, I2O_PARAM_SCSI_DEVICE_INFO,
&param, sizeof(param), NULL);
if (rv != 0)
continue;
}
targ = le32toh(param.sdi.identifier);
lun = param.sdi.luninfo[1];
#if defined(DIAGNOSTIC) || defined(I2ODEBUG)

View File

@ -1,4 +1,4 @@
/* $NetBSD: iopvar.h,v 1.7 2001/08/04 16:54:18 ad Exp $ */
/* $NetBSD: iopvar.h,v 1.8 2001/08/22 09:42:05 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -163,8 +163,6 @@ struct iop_attach_args {
void iop_init(struct iop_softc *, const char *);
int iop_intr(void *);
int iop_lct_get(struct iop_softc *);
int iop_param_op(struct iop_softc *, int, struct iop_initiator *, int,
int, void *, int);
int iop_print_ident(struct iop_softc *, int);
int iop_simple_cmd(struct iop_softc *, int, int, int, int, int);
void iop_strvis(struct iop_softc *, const char *, int, char *, int);
@ -182,6 +180,14 @@ int iop_msg_map_bio(struct iop_softc *, struct iop_msg *, u_int32_t *,
int iop_msg_post(struct iop_softc *, struct iop_msg *, void *, int);
void iop_msg_unmap(struct iop_softc *, struct iop_msg *);
int iop_field_get_all(struct iop_softc *, int, int, void *, int,
struct iop_initiator *);
int iop_field_set(struct iop_softc *, int, int, void *, int, int);
int iop_table_add_row(struct iop_softc *, int, int, void *, int, int);
int iop_table_clear(struct iop_softc *, int, int);
int iop_table_del_row(struct iop_softc *, int, int, int);
int iop_table_get_row(struct iop_softc *, int, int, void *, int, int);
int iop_util_abort(struct iop_softc *, struct iop_initiator *, int, int,
int);
int iop_util_claim(struct iop_softc *, struct iop_initiator *, int, int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_iop.c,v 1.8 2001/08/04 16:54:18 ad Exp $ */
/* $NetBSD: ld_iop.c,v 1.9 2001/08/22 09:42:06 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -136,13 +136,13 @@ ld_iop_attach(struct device *parent, struct device *self, void *aux)
int rv, evreg, enable;
char *typestr, *fixedstr;
u_int cachesz;
u_int32_t timeoutbase, rwvtimeoutbase, rwvtimeout;
struct {
struct i2o_param_op_results pr;
struct i2o_param_read_results prr;
union {
struct i2o_param_rbs_cache_control cc;
struct i2o_param_rbs_device_info bdi;
struct i2o_param_rbs_operation op;
} p;
} __attribute__ ((__packed__)) param;
@ -204,13 +204,10 @@ ld_iop_attach(struct device *parent, struct device *self, void *aux)
I2O_UTIL_CLAIM_PRIMARY_USER);
sc->sc_flags = rv ? 0 : LD_IOP_CLAIMED;
rv = iop_param_op(iop, ia->ia_tid, NULL, 0, I2O_PARAM_RBS_DEVICE_INFO,
&param, sizeof(param));
if (rv != 0) {
printf("%s: unable to get parameters (0x%04x; %d)\n",
ld->sc_dv.dv_xname, I2O_PARAM_RBS_DEVICE_INFO, rv);
rv = iop_field_get_all(iop, ia->ia_tid, I2O_PARAM_RBS_DEVICE_INFO,
&param, sizeof(param), NULL);
if (rv != 0)
goto bad;
}
ld->sc_secsize = le32toh(param.p.bdi.blocksize);
ld->sc_secperunit = (int)
@ -254,13 +251,10 @@ ld_iop_attach(struct device *parent, struct device *self, void *aux)
* cache size. Even if the device doesn't appear to have a cache,
* we perform a flush at shutdown.
*/
rv = iop_param_op(iop, ia->ia_tid, NULL, 0,
I2O_PARAM_RBS_CACHE_CONTROL, &param, sizeof(param));
if (rv != 0) {
printf("%s: unable to get parameters (0x%04x; %d)\n",
ld->sc_dv.dv_xname, I2O_PARAM_RBS_CACHE_CONTROL, rv);
rv = iop_field_get_all(iop, ia->ia_tid, I2O_PARAM_RBS_CACHE_CONTROL,
&param, sizeof(param), NULL);
if (rv != 0)
goto bad;
}
if ((cachesz = le32toh(param.p.cc.totalcachesize)) != 0)
printf(", %dkB cache", cachesz >> 10);
@ -271,32 +265,19 @@ ld_iop_attach(struct device *parent, struct device *self, void *aux)
* Configure the DDM's timeout functions to time out all commands
* after 30 seconds.
*/
rv = iop_param_op(iop, ia->ia_tid, NULL, 0, I2O_PARAM_RBS_OPERATION,
&param, sizeof(param));
if (rv != 0) {
printf("%s: unable to get parameters (0x%04x; %d)\n",
ld->sc_dv.dv_xname, I2O_PARAM_RBS_OPERATION, rv);
goto bad;
}
timeoutbase = htole32(LD_IOP_TIMEOUT * 1000);
rwvtimeoutbase = htole32(LD_IOP_TIMEOUT * 1000);
rwvtimeout = 0;
param.p.op.timeoutbase = htole32(LD_IOP_TIMEOUT * 1000);
param.p.op.rwvtimeoutbase = htole32(LD_IOP_TIMEOUT * 1000);
param.p.op.rwvtimeout = 0;
rv = iop_param_op(iop, ia->ia_tid, NULL, 1, I2O_PARAM_RBS_OPERATION,
&param, sizeof(param));
#ifdef notdef
/*
* Intel RAID adapters don't like the above, but do post a
* `parameter changed' event. Perhaps we're doing something
* wrong...
*/
if (rv != 0) {
printf("%s: unable to set parameters (0x%04x; %d)\n",
ld->sc_dv.dv_xname, I2O_PARAM_RBS_OPERATION, rv);
goto bad;
}
#endif
iop_field_set(iop, ia->ia_tid, I2O_PARAM_RBS_OPERATION,
&timeoutbase, sizeof(timeoutbase),
I2O_PARAM_RBS_OPERATION_timeoutbase);
iop_field_set(iop, ia->ia_tid, I2O_PARAM_RBS_OPERATION,
&rwvtimeoutbase, sizeof(rwvtimeoutbase),
I2O_PARAM_RBS_OPERATION_rwvtimeoutbase);
iop_field_set(iop, ia->ia_tid, I2O_PARAM_RBS_OPERATION,
&rwvtimeout, sizeof(rwvtimeout),
I2O_PARAM_RBS_OPERATION_rwvtimeoutbase);
if (enable)
ld->sc_flags |= LDF_ENABLED;