Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/dev Pull up revisions 1.7-1.8 (requested by ad in t...
details: https://anonhg.NetBSD.org/src/rev/e5f3e0655368
branches: netbsd-1-6
changeset: 530521:e5f3e0655368
user: he <he%NetBSD.org@localhost>
date: Mon Jul 28 18:05:52 2003 +0000
description:
Pull up revisions 1.7-1.8 (requested by ad in ticket #1128):
Improve stability of the mlx driver.
o Better handling of old firmware
o Use correct mailbox length, fixes PR#14266
diffstat:
sys/dev/eisa/mlx_eisa.c | 44 ++++++++++++++++++++++++++------------------
sys/dev/pci/mlx_pci.c | 20 ++++++++++----------
2 files changed, 36 insertions(+), 28 deletions(-)
diffs (176 lines):
diff -r 88c7fcbf6f01 -r e5f3e0655368 sys/dev/eisa/mlx_eisa.c
--- a/sys/dev/eisa/mlx_eisa.c Mon Jul 28 17:43:14 2003 +0000
+++ b/sys/dev/eisa/mlx_eisa.c Mon Jul 28 18:05:52 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mlx_eisa.c,v 1.6 2001/12/18 13:38:48 ad Exp $ */
+/* $NetBSD: mlx_eisa.c,v 1.6.10.1 2003/07/28 18:06:19 he Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mlx_eisa.c,v 1.6 2001/12/18 13:38:48 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mlx_eisa.c,v 1.6.10.1 2003/07/28 18:06:19 he Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -77,15 +77,18 @@
sizeof(struct mlx_softc), mlx_eisa_match, mlx_eisa_attach
};
-static const char * const mlx_eisa_prod[] = {
- "MLX0070",
- "MLX0071",
- "MLX0072",
- "MLX0073",
- "MLX0074",
- "MLX0075",
- "MLX0076",
- "MLX0077",
+struct mlx_eisa_prod {
+ const char *mp_idstr;
+ int mp_nchan;
+} static const mlx_eisa_prod[] = {
+ { "MLX0070", 1 },
+ { "MLX0071", 3 },
+ { "MLX0072", 3 },
+ { "MLX0073", 2 },
+ { "MLX0074", 1 },
+ { "MLX0075", 3 },
+ { "MLX0076", 2 },
+ { "MLX0077", 1 },
};
static int
@@ -97,7 +100,7 @@
ea = aux;
for (i = 0; i < sizeof(mlx_eisa_prod) / sizeof(mlx_eisa_prod[0]); i++)
- if (strcmp(ea->ea_idstring, mlx_eisa_prod[i]) == 0)
+ if (strcmp(ea->ea_idstring, mlx_eisa_prod[i].mp_idstr) == 0)
return (1);
return (0);
@@ -113,7 +116,7 @@
struct mlx_softc *mlx;
bus_space_tag_t iot;
const char *intrstr;
- int irq, le;
+ int irq, le, i;
ea = aux;
mlx = (struct mlx_softc *)self;
@@ -171,7 +174,12 @@
return;
}
- mlx->mlx_flags = MLXF_EISA;
+ for (i = 0; i < sizeof(mlx_eisa_prod) / sizeof(mlx_eisa_prod[0]); i++)
+ if (strcmp(ea->ea_idstring, mlx_eisa_prod[i].mp_idstr) == 0) {
+ mlx->mlx_ci.ci_nchan = mlx_eisa_prod[i].mp_nchan;
+ break;
+ }
+ mlx->mlx_ci.ci_iftype = 1;
mlx->mlx_submit = mlx_v1_submit;
mlx->mlx_findcomplete = mlx_v1_findcomplete;
@@ -203,13 +211,13 @@
if ((mlx_inb(mlx, MLX_V1REG_IDB) & MLX_V1_IDB_FULL) == 0) {
/* Copy mailbox data to window. */
bus_space_write_region_1(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V1REG_MAILBOX, mc->mc_mbox, MLX_V1_MAILBOX_LEN);
+ MLX_V1REG_MAILBOX, mc->mc_mbox, 13);
bus_space_barrier(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V1REG_MAILBOX, MLX_V1_MAILBOX_LEN,
+ MLX_V1REG_MAILBOX, 13,
BUS_SPACE_BARRIER_WRITE);
/* Post command. */
- mlx_outb(mlx, MLX_V1REG_IDB, MLX_V3_IDB_FULL);
+ mlx_outb(mlx, MLX_V1REG_IDB, MLX_V1_IDB_FULL);
return (1);
}
@@ -227,7 +235,7 @@
{
/* Status available? */
- if ((mlx_inb(mlx, MLX_V3REG_ODB) & MLX_V3_ODB_SAVAIL) != 0) {
+ if ((mlx_inb(mlx, MLX_V1REG_ODB) & MLX_V1_ODB_SAVAIL) != 0) {
*slot = mlx_inb(mlx, MLX_V1REG_MAILBOX + 0x0d);
*status = mlx_inw(mlx, MLX_V1REG_MAILBOX + 0x0e);
diff -r 88c7fcbf6f01 -r e5f3e0655368 sys/dev/pci/mlx_pci.c
--- a/sys/dev/pci/mlx_pci.c Mon Jul 28 17:43:14 2003 +0000
+++ b/sys/dev/pci/mlx_pci.c Mon Jul 28 18:05:52 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mlx_pci.c,v 1.6 2001/11/13 07:48:46 lukem Exp $ */
+/* $NetBSD: mlx_pci.c,v 1.6.10.1 2003/07/28 18:05:52 he Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mlx_pci.c,v 1.6 2001/11/13 07:48:46 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mlx_pci.c,v 1.6.10.1 2003/07/28 18:05:52 he Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -215,7 +215,7 @@
mpi = mlx_pci_findmpi(aux);
mlx->mlx_dmat = pa->pa_dmat;
- mlx->mlx_iftype = mpi->mpi_iftype;
+ mlx->mlx_ci.ci_iftype = mpi->mpi_iftype;
printf(": Mylex RAID (v%d interface)\n", mpi->mpi_iftype);
@@ -278,7 +278,7 @@
}
/* Select linkage based on controller interface type. */
- switch (mlx->mlx_iftype) {
+ switch (mlx->mlx_ci.ci_iftype) {
case 2:
case 3:
mlx->mlx_submit = mlx_v3_submit;
@@ -326,9 +326,9 @@
if ((mlx_inb(mlx, MLX_V3REG_IDB) & MLX_V3_IDB_FULL) == 0) {
/* Copy mailbox data to window. */
bus_space_write_region_1(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V3REG_MAILBOX, mc->mc_mbox, MLX_V3_MAILBOX_LEN);
+ MLX_V3REG_MAILBOX, mc->mc_mbox, 13);
bus_space_barrier(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V3REG_MAILBOX, MLX_V3_MAILBOX_LEN,
+ MLX_V3REG_MAILBOX, 13,
BUS_SPACE_BARRIER_WRITE);
/* Post command. */
@@ -474,9 +474,9 @@
if ((mlx_inl(mlx, MLX_V4REG_IDB) & MLX_V4_IDB_FULL) == 0) {
/* Copy mailbox data to window. */
bus_space_write_region_1(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V4REG_MAILBOX, mc->mc_mbox, MLX_V4_MAILBOX_LEN);
+ MLX_V4REG_MAILBOX, mc->mc_mbox, 13);
bus_space_barrier(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V4REG_MAILBOX, MLX_V4_MAILBOX_LEN,
+ MLX_V4REG_MAILBOX, 13,
BUS_SPACE_BARRIER_WRITE);
/* Post command. */
@@ -585,9 +585,9 @@
if ((mlx_inb(mlx, MLX_V5REG_IDB) & MLX_V5_IDB_EMPTY) != 0) {
/* Copy mailbox data to window. */
bus_space_write_region_1(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V5REG_MAILBOX, mc->mc_mbox, MLX_V5_MAILBOX_LEN);
+ MLX_V5REG_MAILBOX, mc->mc_mbox, 13);
bus_space_barrier(mlx->mlx_iot, mlx->mlx_ioh,
- MLX_V5REG_MAILBOX, MLX_V5_MAILBOX_LEN,
+ MLX_V5REG_MAILBOX, 13,
BUS_SPACE_BARRIER_WRITE);
/* Post command */
Home |
Main Index |
Thread Index |
Old Index