Home | History | Annotate | Line # | Download | only in mlxctl
cmds.c revision 1.7
      1  1.7  itojun /*	$NetBSD: cmds.c,v 1.7 2003/07/13 12:30:17 itojun Exp $	*/
      2  1.1      ad 
      3  1.1      ad /*-
      4  1.1      ad  * Copyright (c) 2001 The NetBSD Foundation, Inc.
      5  1.1      ad  * All rights reserved.
      6  1.1      ad  *
      7  1.1      ad  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1      ad  * by Andrew Doran.
      9  1.1      ad  *
     10  1.1      ad  * Redistribution and use in source and binary forms, with or without
     11  1.1      ad  * modification, are permitted provided that the following conditions
     12  1.1      ad  * are met:
     13  1.1      ad  * 1. Redistributions of source code must retain the above copyright
     14  1.1      ad  *    notice, this list of conditions and the following disclaimer.
     15  1.1      ad  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1      ad  *    notice, this list of conditions and the following disclaimer in the
     17  1.1      ad  *    documentation and/or other materials provided with the distribution.
     18  1.1      ad  * 3. All advertising materials mentioning features or use of this software
     19  1.1      ad  *    must display the following acknowledgement:
     20  1.1      ad  *        This product includes software developed by the NetBSD
     21  1.1      ad  *        Foundation, Inc. and its contributors.
     22  1.1      ad  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1      ad  *    contributors may be used to endorse or promote products derived
     24  1.1      ad  *    from this software without specific prior written permission.
     25  1.1      ad  *
     26  1.1      ad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1      ad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1      ad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1      ad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1      ad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1      ad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1      ad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1      ad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1      ad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1      ad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1      ad  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1      ad  */
     38  1.1      ad 
     39  1.1      ad /*-
     40  1.1      ad  * Copyright (c) 1999 Michael Smith
     41  1.1      ad  * All rights reserved.
     42  1.1      ad  *
     43  1.1      ad  * Redistribution and use in source and binary forms, with or without
     44  1.1      ad  * modification, are permitted provided that the following conditions
     45  1.1      ad  * are met:
     46  1.1      ad  * 1. Redistributions of source code must retain the above copyright
     47  1.1      ad  *    notice, this list of conditions and the following disclaimer.
     48  1.1      ad  * 2. Redistributions in binary form must reproduce the above copyright
     49  1.1      ad  *    notice, this list of conditions and the following disclaimer in the
     50  1.1      ad  *    documentation and/or other materials provided with the distribution.
     51  1.1      ad  *
     52  1.1      ad  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     53  1.1      ad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     54  1.1      ad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     55  1.1      ad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     56  1.1      ad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     57  1.1      ad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     58  1.1      ad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     59  1.1      ad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     60  1.1      ad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     61  1.1      ad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     62  1.1      ad  * SUCH DAMAGE.
     63  1.1      ad  *
     64  1.1      ad  * from FreeBSD: command.c,v 1.2 2000/04/11 23:04:17 msmith Exp
     65  1.1      ad  */
     66  1.1      ad 
     67  1.1      ad #ifndef lint
     68  1.1      ad #include <sys/cdefs.h>
     69  1.7  itojun __RCSID("$NetBSD: cmds.c,v 1.7 2003/07/13 12:30:17 itojun Exp $");
     70  1.1      ad #endif /* not lint */
     71  1.1      ad 
     72  1.1      ad #include <sys/types.h>
     73  1.1      ad #include <sys/ioctl.h>
     74  1.1      ad #include <sys/queue.h>
     75  1.1      ad #include <sys/endian.h>
     76  1.1      ad 
     77  1.1      ad #include <dev/ic/mlxreg.h>
     78  1.1      ad #include <dev/ic/mlxio.h>
     79  1.1      ad 
     80  1.1      ad #include <err.h>
     81  1.1      ad #include <fcntl.h>
     82  1.1      ad #include <stdio.h>
     83  1.1      ad #include <stdlib.h>
     84  1.1      ad #include <string.h>
     85  1.1      ad #include <ctype.h>
     86  1.1      ad #include <unistd.h>
     87  1.1      ad #include <getopt.h>
     88  1.1      ad 
     89  1.1      ad #include "extern.h"
     90  1.1      ad 
     91  1.1      ad static void	cmd_status0(struct mlx_disk *);
     92  1.1      ad static void	cmd_check0(struct mlx_disk *);
     93  1.1      ad static void	cmd_detach0(struct mlx_disk *);
     94  1.1      ad 
     95  1.1      ad static struct	mlx_rebuild_status rs;
     96  1.1      ad static int	rstatus;
     97  1.1      ad 
     98  1.1      ad struct {
     99  1.1      ad 	int	hwid;
    100  1.1      ad 	const char	*name;
    101  1.1      ad } static const mlx_ctlr_names[] = {
    102  1.6      ad 	{ 0x00, "960E/960M" },
    103  1.1      ad 	{ 0x01,	"960P/PD" },
    104  1.1      ad 	{ 0x02,	"960PL" },
    105  1.1      ad 	{ 0x10,	"960PG" },
    106  1.1      ad 	{ 0x11,	"960PJ" },
    107  1.1      ad 	{ 0x12,	"960PR" },
    108  1.1      ad 	{ 0x13,	"960PT" },
    109  1.1      ad 	{ 0x14,	"960PTL0" },
    110  1.1      ad 	{ 0x15,	"960PRL" } ,
    111  1.1      ad 	{ 0x16,	"960PTL1" },
    112  1.1      ad 	{ 0x20,	"1100PVX" },
    113  1.1      ad 	{ -1,	NULL },
    114  1.1      ad };
    115  1.1      ad 
    116  1.1      ad /*
    117  1.1      ad  * Status output
    118  1.1      ad  */
    119  1.1      ad static void
    120  1.1      ad cmd_status0(struct mlx_disk *md)
    121  1.1      ad {
    122  1.1      ad 	int result;
    123  1.1      ad 
    124  1.1      ad 	result = md->hwunit;
    125  1.1      ad 	if (ioctl(mlxfd, MLXD_STATUS, &result) < 0)
    126  1.1      ad 		err(EXIT_FAILURE, "ioctl(MLXD_STATUS)");
    127  1.1      ad 
    128  1.1      ad 	switch(result) {
    129  1.1      ad 	case MLX_SYSD_ONLINE:
    130  1.3  simonb 		printf("%s: online\n", md->name);
    131  1.1      ad 		break;
    132  1.1      ad 
    133  1.1      ad 	case MLX_SYSD_CRITICAL:
    134  1.3  simonb 		printf("%s: critical\n", md->name);
    135  1.1      ad 		if (!rstatus)
    136  1.1      ad 			rstatus = 1;
    137  1.1      ad 		break;
    138  1.1      ad 
    139  1.1      ad 	case MLX_SYSD_OFFLINE:
    140  1.3  simonb 		printf("%s: offline\n", md->name);
    141  1.1      ad 		rstatus = 2;
    142  1.1      ad 		break;
    143  1.1      ad 
    144  1.1      ad 	default:
    145  1.3  simonb 		printf("%s: unknown status 0x%02x\n", md->name, result);
    146  1.1      ad 		break;
    147  1.1      ad 	}
    148  1.1      ad 
    149  1.1      ad 	/* Rebuild/check in progress on this drive? */
    150  1.1      ad 	if (rs.rs_drive == md->hwunit &&
    151  1.1      ad 	    rs.rs_code != MLX_REBUILDSTAT_IDLE) {
    152  1.1      ad 		switch(rs.rs_code) {
    153  1.1      ad 		case MLX_REBUILDSTAT_REBUILDCHECK:
    154  1.1      ad 			printf(" [consistency check");
    155  1.1      ad 			break;
    156  1.1      ad 
    157  1.1      ad 		case MLX_REBUILDSTAT_ADDCAPACITY:
    158  1.1      ad 			printf(" [add capacity");
    159  1.1      ad 			break;
    160  1.1      ad 
    161  1.1      ad 		case MLX_REBUILDSTAT_ADDCAPACITYINIT:
    162  1.1      ad 			printf(" [add capacity init");
    163  1.1      ad 			break;
    164  1.1      ad 
    165  1.1      ad 		default:
    166  1.1      ad 			printf(" [unknown operation");
    167  1.1      ad 			break;
    168  1.1      ad 		}
    169  1.1      ad 
    170  1.1      ad 		printf(": %d/%d, %d%% complete]\n", rs.rs_remaining, rs.rs_size,
    171  1.1      ad 		   ((rs.rs_size - rs.rs_remaining) / (rs.rs_size / 100)));
    172  1.1      ad 	}
    173  1.1      ad }
    174  1.1      ad 
    175  1.1      ad int
    176  1.1      ad cmd_status(char **argv)
    177  1.1      ad {
    178  1.1      ad 
    179  1.1      ad 	if (ioctl(mlxfd, MLX_REBUILDSTAT, &rs) < 0)
    180  1.1      ad 		err(EXIT_FAILURE, "ioctl(MLX_REBUILDSTAT)");
    181  1.1      ad 
    182  1.1      ad 	mlx_disk_iterate(cmd_status0);
    183  1.1      ad 	return (rstatus);
    184  1.1      ad }
    185  1.1      ad 
    186  1.1      ad /*
    187  1.1      ad  * Display controller status.
    188  1.1      ad  */
    189  1.1      ad int
    190  1.1      ad cmd_cstatus(char **argv)
    191  1.1      ad {
    192  1.1      ad 	struct mlx_enquiry2 enq;
    193  1.1      ad 	struct mlx_phys_drv pd;
    194  1.1      ad 	static char buf[80];
    195  1.1      ad 	const char *model;
    196  1.1      ad 	int i, channel, target;
    197  1.1      ad 
    198  1.1      ad 	for (i = 0; i < sizeof(mlx_ctlr_names) / sizeof(mlx_ctlr_names[0]); i++)
    199  1.6      ad 		if (ci.ci_hardware_id == mlx_ctlr_names[i].hwid) {
    200  1.1      ad 			model = mlx_ctlr_names[i].name;
    201  1.1      ad 			break;
    202  1.1      ad 		}
    203  1.1      ad 
    204  1.1      ad 	if (i == sizeof(mlx_ctlr_names) / sizeof(mlx_ctlr_names[0])) {
    205  1.7  itojun 		snprintf(buf, sizeof(buf), " model 0x%x", ci.ci_hardware_id);
    206  1.1      ad 		model = buf;
    207  1.1      ad 	}
    208  1.1      ad 
    209  1.6      ad 	printf("DAC%s, %d channel%s, firmware %d.%02d-%c-%02d",
    210  1.6      ad 	    model, ci.ci_nchan,
    211  1.6      ad 	    ci.ci_nchan > 1 ? "s" : "",
    212  1.6      ad 	    ci.ci_firmware_id[0], ci.ci_firmware_id[1],
    213  1.6      ad 	    ci.ci_firmware_id[3], ci.ci_firmware_id[2]);
    214  1.6      ad 	if (ci.ci_mem_size != 0)
    215  1.6      ad 		printf(", %dMB RAM", ci.ci_mem_size >> 20);
    216  1.6      ad 	printf("\n");
    217  1.6      ad 
    218  1.6      ad 	if (verbosity > 0 && ci.ci_iftype > 1) {
    219  1.6      ad 		mlx_enquiry(&enq);
    220  1.1      ad 
    221  1.1      ad 		printf("  Hardware ID\t\t\t0x%08x\n",
    222  1.1      ad 		    le32toh(*(u_int32_t *)enq.me_hardware_id));
    223  1.1      ad 		printf("  Firmware ID\t\t\t0x%08x\n",
    224  1.1      ad 		    le32toh(*(u_int32_t *)enq.me_firmware_id));
    225  1.1      ad 		printf("  Configured/Actual channels\t%d/%d\n",
    226  1.1      ad 		    enq.me_configured_channels, enq.me_actual_channels);
    227  1.1      ad 		printf("  Max Targets\t\t\t%d\n", enq.me_max_targets);
    228  1.1      ad 		printf("  Max Tags\t\t\t%d\n", enq.me_max_tags);
    229  1.1      ad 		printf("  Max System Drives\t\t%d\n", enq.me_max_sys_drives);
    230  1.1      ad 		printf("  Max Arms\t\t\t%d\n", enq.me_max_arms);
    231  1.1      ad 		printf("  Max Spans\t\t\t%d\n", enq.me_max_spans);
    232  1.1      ad 		printf("  DRAM/cache/flash/NVRAM size\t%d/%d/%d/%d\n",
    233  1.1      ad 		    le32toh(enq.me_mem_size), le32toh(enq.me_cache_size),
    234  1.1      ad 		    le32toh(enq.me_flash_size), le32toh(enq.me_nvram_size));
    235  1.1      ad 		printf("  DRAM type\t\t\t%d\n", le16toh(enq.me_mem_type));
    236  1.1      ad 		printf("  Clock Speed\t\t\t%dns\n",
    237  1.1      ad 		    le16toh(enq.me_clock_speed));
    238  1.1      ad 		printf("  Hardware Speed\t\t%dns\n",
    239  1.1      ad 		    le16toh(enq.me_hardware_speed));
    240  1.1      ad 		printf("  Max Commands\t\t\t%d\n",
    241  1.1      ad 		    le16toh(enq.me_max_commands));
    242  1.1      ad 		printf("  Max SG Entries\t\t%d\n", le16toh(enq.me_max_sg));
    243  1.1      ad 		printf("  Max DP\t\t\t%d\n", le16toh(enq.me_max_dp));
    244  1.1      ad 		printf("  Max IOD\t\t\t%d\n", le16toh(enq.me_max_iod));
    245  1.1      ad 		printf("  Max Comb\t\t\t%d\n", le16toh(enq.me_max_comb));
    246  1.1      ad 		printf("  Latency\t\t\t%ds\n", enq.me_latency);
    247  1.1      ad 		printf("  SCSI Timeout\t\t\t%ds\n", enq.me_scsi_timeout);
    248  1.1      ad 		printf("  Min Free Lines\t\t%d\n",
    249  1.1      ad 		    le16toh(enq.me_min_freelines));
    250  1.1      ad 		printf("  Rate Constant\t\t\t%d\n", enq.me_rate_const);
    251  1.1      ad 		printf("  MAXBLK\t\t\t%d\n", le16toh(enq.me_maxblk));
    252  1.1      ad 		printf("  Blocking Factor\t\t%d sectors\n",
    253  1.1      ad 		    le16toh(enq.me_blocking_factor));
    254  1.1      ad 		printf("  Cache Line Size\t\t%d blocks\n",
    255  1.1      ad 		    le16toh(enq.me_cacheline));
    256  1.1      ad 		printf("  SCSI Capability\t\t%s%dMHz, %d bit\n",
    257  1.1      ad 		      enq.me_scsi_cap & (1<<4) ? "differential " : "",
    258  1.1      ad 		      (1 << ((enq.me_scsi_cap >> 2) & 3)) * 10,
    259  1.1      ad 		      8 << (enq.me_scsi_cap & 0x3));
    260  1.1      ad 		printf("  Firmware Build Number\t\t%d\n",
    261  1.1      ad 		    le16toh(enq.me_firmware_build));
    262  1.1      ad 		printf("  Fault Management Type\t\t%d\n",
    263  1.1      ad 		    enq.me_fault_mgmt_type);
    264  1.1      ad #if 0
    265  1.1      ad 		printf("  Features\t\t\t%b\n", enq.me_firmware_features,
    266  1.1      ad 		      "\20\4Background Init\3Read Ahead\2MORE\1Cluster\n");
    267  1.1      ad #endif
    268  1.6      ad 	} else if (verbosity > 0 && ci.ci_iftype == 1)
    269  1.6      ad 		warnx("can't be verbose for this firmware level");
    270  1.1      ad 
    271  1.1      ad 	fflush(stdout);
    272  1.1      ad 
    273  1.6      ad 	if (ci.ci_firmware_id[0] < 3) {
    274  1.6      ad 		warnx("can't display physical drives for this firmware level");
    275  1.6      ad 		return (0);
    276  1.6      ad 	}
    277  1.6      ad 
    278  1.1      ad 	/*
    279  1.1      ad 	 * Fetch and print physical drive data.
    280  1.1      ad 	 */
    281  1.1      ad 	for (channel = 0; channel < enq.me_configured_channels; channel++) {
    282  1.1      ad 		for (target = 0; target < enq.me_max_targets; target++)
    283  1.1      ad 			if (mlx_get_device_state(channel, target, &pd) == 0 &&
    284  1.1      ad 			    (pd.pd_flags1 & MLX_PHYS_DRV_PRESENT) != 0)
    285  1.1      ad 				mlx_print_phys_drv(&pd, channel, target, "  ");
    286  1.1      ad 	}
    287  1.1      ad 
    288  1.1      ad 	return (0);
    289  1.1      ad }
    290  1.1      ad 
    291  1.1      ad /*
    292  1.1      ad  * Recscan for new or changed system drives.
    293  1.1      ad  */
    294  1.1      ad int
    295  1.1      ad cmd_rescan(char **argv)
    296  1.1      ad {
    297  1.1      ad 
    298  1.1      ad 	if (ioctl(mlxfd, MLX_RESCAN_DRIVES) < 0)
    299  1.1      ad 		err(EXIT_FAILURE, "rescan failed");
    300  1.1      ad 	return (0);
    301  1.1      ad }
    302  1.1      ad 
    303  1.1      ad /*
    304  1.1      ad  * Detach one or more system drives from a controller.
    305  1.1      ad  */
    306  1.1      ad static void
    307  1.1      ad cmd_detach0(struct mlx_disk *md)
    308  1.1      ad {
    309  1.1      ad 
    310  1.1      ad 	if (ioctl(mlxfd, MLXD_DETACH, &md->hwunit) < 0)
    311  1.1      ad 		warn("can't detach %s", md->name);
    312  1.1      ad }
    313  1.1      ad 
    314  1.1      ad int
    315  1.1      ad cmd_detach(char **argv)
    316  1.1      ad {
    317  1.1      ad 
    318  1.1      ad 	mlx_disk_iterate(cmd_detach0);
    319  1.1      ad 	return (0);
    320  1.1      ad }
    321  1.1      ad 
    322  1.1      ad /*
    323  1.1      ad  * Initiate a consistency check on a system drive.
    324  1.1      ad  */
    325  1.1      ad static void
    326  1.1      ad cmd_check0(struct mlx_disk *md)
    327  1.1      ad {
    328  1.1      ad 	int result;
    329  1.1      ad 
    330  1.1      ad 	if (ioctl(mlxfd, MLXD_CHECKASYNC, &result) == 0)
    331  1.1      ad 		return;
    332  1.1      ad 
    333  1.1      ad 	switch (result) {
    334  1.1      ad 	case 0x0002:
    335  1.1      ad 		warnx("one or more of the SCSI disks on which %s", md->name);
    336  1.2  simonb 		warnx("depends is DEAD.");
    337  1.1      ad 		break;
    338  1.1      ad 
    339  1.1      ad 	case 0x0105:
    340  1.1      ad 		warnx("drive %s is invalid, or not a drive which ", md->name);
    341  1.1      ad 		warnx("can be checked.");
    342  1.1      ad 		break;
    343  1.1      ad 
    344  1.1      ad 	case 0x0106:
    345  1.1      ad 		warnx("drive rebuild or consistency check is already ");
    346  1.1      ad 		warnx("in progress on this controller.");
    347  1.1      ad 		break;
    348  1.1      ad 
    349  1.1      ad 	default:
    350  1.1      ad 		err(EXIT_FAILURE, "ioctl(MLXD_CHECKASYNC)");
    351  1.1      ad 		/* NOTREACHED */
    352  1.1      ad 	}
    353  1.1      ad }
    354  1.1      ad 
    355  1.1      ad int
    356  1.1      ad cmd_check(char **argv)
    357  1.1      ad {
    358  1.1      ad 
    359  1.6      ad 	if (ci.ci_firmware_id[0] < 3) {
    360  1.6      ad 		warnx("action not supported by this firmware version");
    361  1.6      ad 		return (1);
    362  1.6      ad 	}
    363  1.6      ad 
    364  1.1      ad 	mlx_disk_iterate(cmd_check0);
    365  1.1      ad 	return (0);
    366  1.1      ad }
    367  1.1      ad 
    368  1.1      ad /*
    369  1.1      ad  * Initiate a physical drive rebuild.
    370  1.1      ad  */
    371  1.1      ad int
    372  1.1      ad cmd_rebuild(char **argv)
    373  1.1      ad {
    374  1.1      ad 	struct mlx_rebuild_request rb;
    375  1.1      ad 	char *p;
    376  1.6      ad 
    377  1.6      ad 	if (ci.ci_firmware_id[0] < 3) {
    378  1.6      ad 		warnx("action not supported by this firmware version");
    379  1.6      ad 		return (1);
    380  1.6      ad 	}
    381  1.1      ad 
    382  1.1      ad 	if (argv[0] == NULL || argv[1] != NULL)
    383  1.1      ad 		usage();
    384  1.1      ad 
    385  1.4      ad 	rb.rr_channel = (int)strtol(*argv, &p, 0);
    386  1.1      ad 	if (p[0] != ':' || p[1] == '\0')
    387  1.1      ad 		usage();
    388  1.1      ad 
    389  1.4      ad 	rb.rr_target = (int)strtol(*argv, &p, 0);
    390  1.1      ad 	if (p[0] != '\0')
    391  1.1      ad 		usage();
    392  1.1      ad 
    393  1.1      ad 	if (ioctl(mlxfd, MLX_REBUILDASYNC, &rb) == 0)
    394  1.1      ad 		return (0);
    395  1.1      ad 
    396  1.1      ad 	switch (rb.rr_status) {
    397  1.1      ad 	case 0x0002:
    398  1.1      ad 		warnx("the drive at %d:%d is already ONLINE", rb.rr_channel,
    399  1.1      ad 		    rb.rr_target);
    400  1.1      ad 		break;
    401  1.1      ad 
    402  1.1      ad 	case 0x0004:
    403  1.1      ad 		warnx("drive failed during rebuild");
    404  1.1      ad 		break;
    405  1.1      ad 
    406  1.1      ad 	case 0x0105:
    407  1.1      ad 		warnx("there is no drive at %d:%d", rb.rr_channel,
    408  1.1      ad 		    rb.rr_target);
    409  1.1      ad 		break;
    410  1.1      ad 
    411  1.1      ad 	case 0x0106:
    412  1.1      ad 		warnx("drive rebuild or consistency check is already in ");
    413  1.1      ad 		warnx("progress on this controller");
    414  1.1      ad 		break;
    415  1.1      ad 
    416  1.1      ad 	default:
    417  1.1      ad 		err(EXIT_FAILURE, "ioctl(MLXD_CHECKASYNC)");
    418  1.1      ad 		/* NOTREACHED */
    419  1.1      ad 	}
    420  1.1      ad 
    421  1.1      ad 	return(0);
    422  1.1      ad }
    423