mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
mly: Remove.
We'd said this was going away in 13, but was overlooked. Belatedly remove. Sponsored by: Netflix Relnotes: yes Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D33111
This commit is contained in:
parent
ba83762a62
commit
a9620045a5
|
@ -305,7 +305,6 @@ MAN= aac.4 \
|
|||
mlx.4 \
|
||||
mlx4en.4 \
|
||||
mlx5en.4 \
|
||||
mly.4 \
|
||||
mmc.4 \
|
||||
mmcsd.4 \
|
||||
mod_cc.4 \
|
||||
|
|
|
@ -1,275 +0,0 @@
|
|||
.\"
|
||||
.\" Copyright (c) 2000 Michael Smith
|
||||
.\" Copyright (c) 2000 BSDi
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd August 10, 2004
|
||||
.Dt MLY 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm mly
|
||||
.Nd Mylex AcceleRAID/eXtremeRAID family driver
|
||||
.Sh SYNOPSIS
|
||||
To compile this driver into the kernel,
|
||||
place the following lines in your
|
||||
kernel configuration file:
|
||||
.Bd -ragged -offset indent
|
||||
.Cd "device pci"
|
||||
.Cd "device scbus"
|
||||
.Cd "device da"
|
||||
.Cd "device mly"
|
||||
.Ed
|
||||
.Pp
|
||||
Alternatively, to load the driver as a
|
||||
module at boot time, place the following line in
|
||||
.Xr loader.conf 5 :
|
||||
.Bd -literal -offset indent
|
||||
mly_load="YES"
|
||||
.Ed
|
||||
.Sh DEPRECATION NOTICE
|
||||
The
|
||||
.Nm
|
||||
driver is not present in
|
||||
.Fx 13.0 .
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for Mylex AcceleRAID and eXtremeRAID-family
|
||||
PCI to SCSI RAID controllers with version 6.00 and later
|
||||
firmware.
|
||||
.Pp
|
||||
Logical devices (array drives) attached to the controller are presented
|
||||
to the SCSI subsystem as though they were direct-access devices on a
|
||||
virtual SCSI bus.
|
||||
Physical devices which are not claimed by a logical
|
||||
device are presented on SCSI channels which match the physical channels
|
||||
on the controller.
|
||||
.Sh HARDWARE
|
||||
Controllers supported by the
|
||||
.Nm
|
||||
driver include:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
Mylex AcceleRAID 160
|
||||
.It
|
||||
Mylex AcceleRAID 170
|
||||
.It
|
||||
Mylex AcceleRAID 352
|
||||
.It
|
||||
Mylex eXtremeRAID 2000
|
||||
.It
|
||||
Mylex eXtremeRAID 3000
|
||||
.El
|
||||
.Pp
|
||||
Compatible Mylex controllers not listed should work, but have not been
|
||||
verified.
|
||||
.Sh DIAGNOSTICS
|
||||
.Ss Controller initialisation phase
|
||||
.Bl -diag
|
||||
.It "mly%d: controller initialisation started"
|
||||
.It "mly%d: initialisation complete"
|
||||
.Pp
|
||||
The controller firmware has started initialisation.
|
||||
Normally this process is performed by the controller BIOS,
|
||||
but the driver may need
|
||||
to do this in cases where the BIOS has failed, or is not compatible
|
||||
(e.g.\& on non-x86 systems).
|
||||
.It "mly%d: drive spinup in progress"
|
||||
.Pp
|
||||
Drive startup is in progress; this may take several minutes.
|
||||
.It "mly%d: mirror race recovery failed, one or more drives offline"
|
||||
.It "mly%d: mirror race recovery in progress"
|
||||
.It "mly%d: mirror race recovery on a critical drive"
|
||||
.Pp
|
||||
These error codes are undocumented.
|
||||
.It "mly%d: FATAL MEMORY PARITY ERROR"
|
||||
.Pp
|
||||
Firmware detected a fatal memory error; the driver will not attempt to
|
||||
attach to this controller.
|
||||
.It "mly%d: unknown initialisation code %x"
|
||||
.Pp
|
||||
An unknown error occurred during initialisation; it will be ignored.
|
||||
.El
|
||||
.Ss Driver initialisation/shutdown phase
|
||||
.Bl -diag
|
||||
.It "mly%d: can't enable busmaster feature"
|
||||
.It "mly%d: memory window not available"
|
||||
.It "mly%d: can't allocate register window"
|
||||
.It "mly%d: can't allocate interrupt"
|
||||
.It "mly%d: can't set up interrupt"
|
||||
.Pp
|
||||
The system's PCI BIOS has not correctly configured the controller's
|
||||
PCI interface; initialisation has failed and the driver will not
|
||||
attach to this controller.
|
||||
.It "mly%d: can't allocate parent DMA tag"
|
||||
.It "mly%d: can't allocate buffer DMA tag"
|
||||
.It "mly%d: can't allocate command packet DMA tag"
|
||||
.It "mly%d: can't allocate scatter/gather DMA tag"
|
||||
.It "mly%d: can't allocate s/g table"
|
||||
.It "mly%d: can't allocate memory mailbox DMA tag"
|
||||
.It "mly%d: can't allocate memory mailbox"
|
||||
.Pp
|
||||
A resource allocation error occurred while initialising the driver;
|
||||
initialisation has failed and the driver will not attach to this
|
||||
controller.
|
||||
.It "mly%d: BTL rescan result corrupted"
|
||||
.Pp
|
||||
The results of a scan for an attached device were corrupted.
|
||||
One or more devices may not be correctly reported.
|
||||
.It "mly%d: flushing cache..."
|
||||
.Pp
|
||||
The controller cache is being flushed prior to detach or shutdown.
|
||||
.El
|
||||
.Ss Operational diagnostics
|
||||
.Bl -diag
|
||||
.It "mly%d: physical device %d:%d online"
|
||||
.It "mly%d: physical device %d:%d standby"
|
||||
.It "mly%d: physical device %d:%d automatic rebuild started"
|
||||
.It "mly%d: physical device %d:%d manual rebuild started"
|
||||
.It "mly%d: physical device %d:%d rebuild completed"
|
||||
.It "mly%d: physical device %d:%d rebuild cancelled"
|
||||
.It "mly%d: physical device %d:%d rebuild failed for unknown reasons"
|
||||
.It "mly%d: physical device %d:%d rebuild failed due to new physical device"
|
||||
.It "mly%d: physical device %d:%d rebuild failed due to logical drive failure"
|
||||
.It "mly%d: physical device %d:%d found"
|
||||
.It "mly%d: physical device %d:%d gone"
|
||||
.It "mly%d: physical device %d:%d unconfigured"
|
||||
.It "mly%d: physical device %d:%d expand capacity started"
|
||||
.It "mly%d: physical device %d:%d expand capacity completed"
|
||||
.It "mly%d: physical device %d:%d expand capacity failed"
|
||||
.It "mly%d: physical device %d:%d parity error"
|
||||
.It "mly%d: physical device %d:%d soft error"
|
||||
.It "mly%d: physical device %d:%d miscellaneous error"
|
||||
.It "mly%d: physical device %d:%d reset"
|
||||
.It "mly%d: physical device %d:%d active spare found"
|
||||
.It "mly%d: physical device %d:%d warm spare found"
|
||||
.It "mly%d: physical device %d:%d initialization started"
|
||||
.It "mly%d: physical device %d:%d initialization completed"
|
||||
.It "mly%d: physical device %d:%d initialization failed"
|
||||
.It "mly%d: physical device %d:%d initialization cancelled"
|
||||
.It "mly%d: physical device %d:%d write recovery failed"
|
||||
.It "mly%d: physical device %d:%d scsi bus reset failed"
|
||||
.It "mly%d: physical device %d:%d double check condition"
|
||||
.It "mly%d: physical device %d:%d device cannot be accessed"
|
||||
.It "mly%d: physical device %d:%d gross error on scsi processor"
|
||||
.It "mly%d: physical device %d:%d bad tag from device"
|
||||
.It "mly%d: physical device %d:%d command timeout"
|
||||
.It "mly%d: physical device %d:%d system reset"
|
||||
.It "mly%d: physical device %d:%d busy status or parity error"
|
||||
.It "mly%d: physical device %d:%d host set device to failed state"
|
||||
.It "mly%d: physical device %d:%d selection timeout"
|
||||
.It "mly%d: physical device %d:%d scsi bus phase error"
|
||||
.It "mly%d: physical device %d:%d device returned unknown status"
|
||||
.It "mly%d: physical device %d:%d device not ready"
|
||||
.It "mly%d: physical device %d:%d device not found at startup"
|
||||
.It "mly%d: physical device %d:%d COD write operation failed"
|
||||
.It "mly%d: physical device %d:%d BDT write operation failed"
|
||||
.It "mly%d: physical device %d:%d missing at startup"
|
||||
.It "mly%d: physical device %d:%d start rebuild failed due to physical drive too small"
|
||||
.It "mly%d: physical device %d:%d sense data received"
|
||||
.It "mly%d: sense key %d asc %02x ascq %02x"
|
||||
.It "mly%d: info %4D csi %4D"
|
||||
.It "mly%d: physical device %d:%d offline"
|
||||
.It "mly%d: sense key %d asc %02x ascq %02x"
|
||||
.It "mly%d: info %4D csi %4D"
|
||||
.Pp
|
||||
The reported event refers to the physical device at the given channel:target
|
||||
address.
|
||||
.It "mly%d: logical device %d (%s) consistency check started"
|
||||
.It "mly%d: logical device %d (%s) consistency check completed"
|
||||
.It "mly%d: logical device %d (%s) consistency check cancelled"
|
||||
.It "mly%d: logical device %d (%s) consistency check completed with errors"
|
||||
.It "mly%d: logical device %d (%s) consistency check failed due to logical drive failure"
|
||||
.It "mly%d: logical device %d (%s) consistency check failed due to physical device failure"
|
||||
.It "mly%d: logical device %d (%s) automatic rebuild started"
|
||||
.It "mly%d: logical device %d (%s) manual rebuild started"
|
||||
.It "mly%d: logical device %d (%s) rebuild completed"
|
||||
.It "mly%d: logical device %d (%s) rebuild cancelled"
|
||||
.It "mly%d: logical device %d (%s) rebuild failed for unknown reasons"
|
||||
.It "mly%d: logical device %d (%s) rebuild failed due to new physical device"
|
||||
.It "mly%d: logical device %d (%s) rebuild failed due to logical drive failure"
|
||||
.It "mly%d: logical device %d (%s) offline"
|
||||
.It "mly%d: logical device %d (%s) critical"
|
||||
.It "mly%d: logical device %d (%s) online"
|
||||
.It "mly%d: logical device %d (%s) initialization started"
|
||||
.It "mly%d: logical device %d (%s) initialization completed"
|
||||
.It "mly%d: logical device %d (%s) initialization cancelled"
|
||||
.It "mly%d: logical device %d (%s) initialization failed"
|
||||
.It "mly%d: logical device %d (%s) found"
|
||||
.It "mly%d: logical device %d (%s) gone"
|
||||
.It "mly%d: logical device %d (%s) expand capacity started"
|
||||
.It "mly%d: logical device %d (%s) expand capacity completed"
|
||||
.It "mly%d: logical device %d (%s) expand capacity failed"
|
||||
.It "mly%d: logical device %d (%s) bad block found"
|
||||
.It "mly%d: logical device %d (%s) size changed"
|
||||
.It "mly%d: logical device %d (%s) type changed"
|
||||
.It "mly%d: logical device %d (%s) bad data block found"
|
||||
.It "mly%d: logical device %d (%s) read of data block in bdt"
|
||||
.It "mly%d: logical device %d (%s) write back data for disk block lost"
|
||||
.Pp
|
||||
The event report will include the name of the SCSI device which has
|
||||
attached to the device if possible.
|
||||
.It "mly%d: enclosure %d fan %d failed"
|
||||
.It "mly%d: enclosure %d fan %d ok"
|
||||
.It "mly%d: enclosure %d fan %d not present"
|
||||
.It "mly%d: enclosure %d power supply %d failed"
|
||||
.It "mly%d: enclosure %d power supply %d ok"
|
||||
.It "mly%d: enclosure %d power supply %d not present"
|
||||
.It "mly%d: enclosure %d temperature sensor %d failed"
|
||||
.It "mly%d: enclosure %d temperature sensor %d critical"
|
||||
.It "mly%d: enclosure %d temperature sensor %d ok"
|
||||
.It "mly%d: enclosure %d temperature sensor %d not present"
|
||||
.It "mly%d: enclosure %d unit %d access critical"
|
||||
.It "mly%d: enclosure %d unit %d access ok"
|
||||
.It "mly%d: enclosure %d unit %d access offline"
|
||||
.Pp
|
||||
These events refer to external enclosures by number.
|
||||
The driver does not attempt to name the enclosures.
|
||||
.It "mly%d: controller cache write back error"
|
||||
.It "mly%d: controller battery backup unit found"
|
||||
.It "mly%d: controller battery backup unit charge level low"
|
||||
.It "mly%d: controller battery backup unit charge level ok"
|
||||
.It "mly%d: controller installation aborted"
|
||||
.It "mly%d: controller mirror race recovery in progress"
|
||||
.It "mly%d: controller mirror race on critical drive"
|
||||
.It "mly%d: controller memory soft ecc error"
|
||||
.It "mly%d: controller memory hard ecc error"
|
||||
.It "mly%d: controller battery backup unit failed"
|
||||
.Pp
|
||||
These events report controller status changes.
|
||||
.El
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Michael Smith Aq Mt msmith@FreeBSD.org .
|
||||
.Pp
|
||||
This manual page was written by
|
||||
.An Michael Smith Aq Mt msmith@FreeBSD.org .
|
||||
.Sh BUGS
|
||||
The driver does not yet provide an external management interface.
|
||||
.Pp
|
||||
Enclosures are not named or otherwise identified in event messages.
|
|
@ -185,7 +185,6 @@ device arcmsr # Areca SATA II RAID
|
|||
device ciss # Compaq Smart RAID 5*
|
||||
device iir # Intel Integrated RAID
|
||||
device ips # IBM (Adaptec) ServeRAID
|
||||
device mly # Mylex AcceleRAID/eXtremeRAID
|
||||
device twa # 3ware 9000 series PATA/SATA RAID
|
||||
device smartpqi # Microsemi smartpqi driver
|
||||
device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller
|
||||
|
|
|
@ -1644,13 +1644,6 @@ device ciss
|
|||
#
|
||||
device iir
|
||||
|
||||
#
|
||||
# Mylex AcceleRAID and eXtremeRAID controllers with v6 and later
|
||||
# firmware. These controllers have a SCSI-like interface, and require
|
||||
# the CAM infrastructure.
|
||||
#
|
||||
device mly
|
||||
|
||||
#
|
||||
# Compaq Smart RAID, Mylex DAC960 and AMI MegaRAID controllers. Only
|
||||
# one entry is needed; the code will find and configure all supported
|
||||
|
|
|
@ -2459,7 +2459,6 @@ dev/mlxfw/mlxfw_mfa2_tlv_multi.c optional mlxfw \
|
|||
dev/mlx/mlx.c optional mlx
|
||||
dev/mlx/mlx_disk.c optional mlx
|
||||
dev/mlx/mlx_pci.c optional mlx pci
|
||||
dev/mly/mly.c optional mly
|
||||
dev/mmc/mmc_subr.c optional mmc | mmcsd !mmccam
|
||||
dev/mmc/mmc.c optional mmc !mmccam
|
||||
dev/mmc/mmcbr_if.m standard
|
||||
|
|
3003
sys/dev/mly/mly.c
3003
sys/dev/mly/mly.c
File diff suppressed because it is too large
Load diff
|
@ -1,325 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 2000 Michael Smith
|
||||
* Copyright (c) 2000 BSDi
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Lookup table for code-to-text translations.
|
||||
*/
|
||||
struct mly_code_lookup {
|
||||
char *string;
|
||||
u_int32_t code;
|
||||
};
|
||||
|
||||
static char *mly_describe_code(struct mly_code_lookup *table, u_int32_t code);
|
||||
|
||||
/********************************************************************************
|
||||
* Look up a text description of a numeric code and return a pointer to same.
|
||||
*/
|
||||
static char *
|
||||
mly_describe_code(struct mly_code_lookup *table, u_int32_t code)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; table[i].string != NULL; i++)
|
||||
if (table[i].code == code)
|
||||
return(table[i].string);
|
||||
return(table[i+1].string);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static struct mly_code_lookup mly_table_bustype[] = {
|
||||
{"SCSI", 0x00},
|
||||
{"FC-AL", 0x01},
|
||||
{"PCI", 0x03},
|
||||
{NULL, 0},
|
||||
{"unknown bus", 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct mly_code_lookup mly_table_controllertype[] = {
|
||||
#if 0 /* not supported by this driver */
|
||||
{"DAC960E", 0x01}, /* EISA */
|
||||
{"DAC960M", 0x08}, /* MCA */
|
||||
{"DAC960PD", 0x10}, /* PCI Dual */
|
||||
{"DAC960PL", 0x11}, /* PCU low-cost */
|
||||
{"DAC960PDU", 0x12}, /* PD Ultra */
|
||||
{"DAC960PE", 0x13}, /* Peregrine low-cost */
|
||||
{"DAC960PG", 0x14}, /* Peregrine high-performance */
|
||||
{"DAC960PJ", 0x15}, /* Road Runner */
|
||||
{"DAC960PTL0", 0x16}, /* Jaguar */
|
||||
{"DAC960PR", 0x17}, /* Road Runner (again?) */
|
||||
{"DAC960PRL", 0x18}, /* Tomcat */
|
||||
{"DAC960PT", 0x19}, /* Road Runner (yet again?) */
|
||||
{"DAC1164P", 0x1a}, /* Little Apple */
|
||||
{"DAC960PTL1", 0x1b}, /* Jaguar+ */
|
||||
#endif
|
||||
{"EXR2000P", 0x1c}, /* Big Apple */
|
||||
{"EXR3000P", 0x1d}, /* Fibre Apple */
|
||||
{"AcceleRAID 352", 0x1e}, /* Leopard */
|
||||
{"AcceleRAID 170", 0x1f}, /* Lynx */
|
||||
{"AcceleRAID 160", 0x20}, /* Bobcat */
|
||||
{NULL, 0},
|
||||
{"unknown adapter", 0}
|
||||
};
|
||||
|
||||
static struct mly_code_lookup mly_table_oemname[] = {
|
||||
{"Mylex", MLY_OEM_MYLEX},
|
||||
{"IBM", MLY_OEM_IBM},
|
||||
{"Hewlett-Packard", MLY_OEM_HP},
|
||||
{"DEC/Compaq", MLY_OEM_DEC},
|
||||
{"Siemens", MLY_OEM_SIEMENS},
|
||||
{"Intel", MLY_OEM_INTEL},
|
||||
{NULL, 0},
|
||||
{"unknown OEM", 0}
|
||||
};
|
||||
|
||||
static struct mly_code_lookup mly_table_memorytype[] = {
|
||||
{"DRAM", 0x01},
|
||||
{"EDRAM", 0x02},
|
||||
{"EDO RAM", 0x03},
|
||||
{"SDRAM", 0x04},
|
||||
{NULL, 0},
|
||||
{"unknown memory", 0}
|
||||
};
|
||||
|
||||
static struct mly_code_lookup mly_table_cputype[] = {
|
||||
{"i960CA", 0x01},
|
||||
{"i960RD", 0x02},
|
||||
{"i960RN", 0x03},
|
||||
{"i960RP", 0x04},
|
||||
{"NorthBay(?)", 0x05},
|
||||
{"StrongArm", 0x06},
|
||||
{"i960RM", 0x07},
|
||||
{NULL, 0},
|
||||
{"unknown CPU", 0}
|
||||
};
|
||||
|
||||
/*
|
||||
* This table is directly derived from the corresponding table in the
|
||||
* Linux driver, and uses a derivative encoding for simplicity's sake.
|
||||
*
|
||||
* The first character of the string determines the format of the message.
|
||||
*
|
||||
* p "physical device <channel>:<target> <text>" (physical device status)
|
||||
* s "physical device <channel>:<target> <text>" (scsi message or error)
|
||||
* " sense key <key> asc <asc> ascq <ascq>"
|
||||
* " info <info> csi <csi>"
|
||||
* l "logical drive <unit>: <text>" (logical device status)
|
||||
* m "logical drive <unit>: <text>" (logical device message)
|
||||
*
|
||||
* Messages which are typically suppressed have the first character capitalised.
|
||||
* These messages will only be printed if bootverbose is set.
|
||||
*
|
||||
* The second character in the string indicates an action to be taken as a
|
||||
* result of the event.
|
||||
*
|
||||
* r rescan the device for possible state change
|
||||
*
|
||||
*/
|
||||
static struct mly_code_lookup mly_table_event[] = {
|
||||
/* physical device events (0x0000 - 0x007f) */
|
||||
{"pr online", 0x0001},
|
||||
{"pr standby", 0x0002},
|
||||
{"p automatic rebuild started", 0x0005},
|
||||
{"p manual rebuild started", 0x0006},
|
||||
{"pr rebuild completed", 0x0007},
|
||||
{"pr rebuild cancelled", 0x0008},
|
||||
{"pr rebuild failed for unknown reasons", 0x0009},
|
||||
{"pr rebuild failed due to new physical device", 0x000a},
|
||||
{"pr rebuild failed due to logical drive failure", 0x000b},
|
||||
{"sr offline", 0x000c},
|
||||
{"pr found", 0x000d},
|
||||
{"pr gone", 0x000e},
|
||||
{"p unconfigured", 0x000f},
|
||||
{"p expand capacity started", 0x0010},
|
||||
{"pr expand capacity completed", 0x0011},
|
||||
{"pr expand capacity failed", 0x0012},
|
||||
{"p parity error", 0x0016},
|
||||
{"p soft error", 0x0017},
|
||||
{"p miscellaneous error", 0x0018},
|
||||
{"p reset", 0x0019},
|
||||
{"p active spare found", 0x001a},
|
||||
{"p warm spare found", 0x001b},
|
||||
{"s sense data received", 0x001c},
|
||||
{"p initialization started", 0x001d},
|
||||
{"pr initialization completed", 0x001e},
|
||||
{"pr initialization failed", 0x001f},
|
||||
{"pr initialization cancelled", 0x0020},
|
||||
{"P write recovery failed", 0x0021},
|
||||
{"p scsi bus reset failed", 0x0022},
|
||||
{"p double check condition", 0x0023},
|
||||
{"p device cannot be accessed", 0x0024},
|
||||
{"p gross error on scsi processor", 0x0025},
|
||||
{"p bad tag from device", 0x0026},
|
||||
{"p command timeout", 0x0027},
|
||||
{"pr system reset", 0x0028},
|
||||
{"p busy status or parity error", 0x0029},
|
||||
{"pr host set device to failed state", 0x002a},
|
||||
{"pr selection timeout", 0x002b},
|
||||
{"p scsi bus phase error", 0x002c},
|
||||
{"pr device returned unknown status", 0x002d},
|
||||
{"pr device not ready", 0x002e},
|
||||
{"p device not found at startup", 0x002f},
|
||||
{"p COD write operation failed", 0x0030},
|
||||
{"p BDT write operation failed", 0x0031},
|
||||
{"p missing at startup", 0x0039},
|
||||
{"p start rebuild failed due to physical drive too small", 0x003a},
|
||||
/* logical device events (0x0080 - 0x00ff) */
|
||||
{"m consistency check started", 0x0080},
|
||||
{"mr consistency check completed", 0x0081},
|
||||
{"mr consistency check cancelled", 0x0082},
|
||||
{"mr consistency check completed with errors", 0x0083},
|
||||
{"mr consistency check failed due to logical drive failure", 0x0084},
|
||||
{"mr consistency check failed due to physical device failure", 0x0085},
|
||||
{"lr offline", 0x0086},
|
||||
{"lr critical", 0x0087},
|
||||
{"lr online", 0x0088},
|
||||
{"m automatic rebuild started", 0x0089},
|
||||
{"m manual rebuild started", 0x008a},
|
||||
{"mr rebuild completed", 0x008b},
|
||||
{"mr rebuild cancelled", 0x008c},
|
||||
{"mr rebuild failed for unknown reasons", 0x008d},
|
||||
{"mr rebuild failed due to new physical device", 0x008e},
|
||||
{"mr rebuild failed due to logical drive failure", 0x008f},
|
||||
{"l initialization started", 0x0090},
|
||||
{"lr initialization completed", 0x0091},
|
||||
{"lr initialization cancelled", 0x0092},
|
||||
{"lr initialization failed", 0x0093},
|
||||
{"lr found", 0x0094},
|
||||
{"lr gone", 0x0095},
|
||||
{"l expand capacity started", 0x0096},
|
||||
{"lr expand capacity completed", 0x0097},
|
||||
{"lr expand capacity failed", 0x0098},
|
||||
{"l bad block found", 0x0099},
|
||||
{"lr size changed", 0x009a},
|
||||
{"lr type changed", 0x009b},
|
||||
{"l bad data block found", 0x009c},
|
||||
{"l read of data block in bdt", 0x009e},
|
||||
{"l write back data for disk block lost", 0x009f},
|
||||
/* enclosure management events (0x0100 - 0x017f) */
|
||||
{"e enclosure %d fan %d failed", 0x0140},
|
||||
{"e enclosure %d fan %d ok", 0x0141},
|
||||
{"e enclosure %d fan %d not present", 0x0142},
|
||||
{"e enclosure %d power supply %d failed", 0x0143},
|
||||
{"e enclosure %d power supply %d ok", 0x0144},
|
||||
{"e enclosure %d power supply %d not present", 0x0145},
|
||||
{"e enclosure %d temperature sensor %d failed", 0x0146},
|
||||
{"e enclosure %d temperature sensor %d critical", 0x0147},
|
||||
{"e enclosure %d temperature sensor %d ok", 0x0148},
|
||||
{"e enclosure %d temperature sensor %d not present", 0x0149},
|
||||
{"e enclosure %d unit %d access critical", 0x014a},
|
||||
{"e enclosure %d unit %d access ok", 0x014b},
|
||||
{"e enclosure %d unit %d access offline", 0x014c},
|
||||
/* controller events (0x0180 - 0x01ff) */
|
||||
{"c cache write back error", 0x0181},
|
||||
{"c battery backup unit found", 0x0188},
|
||||
{"c battery backup unit charge level low", 0x0189},
|
||||
{"c battery backup unit charge level ok", 0x018a},
|
||||
{"c installation aborted", 0x0193},
|
||||
{"c mirror race recovery in progress", 0x0195},
|
||||
{"c mirror race on critical drive", 0x0196},
|
||||
{"c memory soft ecc error", 0x019e},
|
||||
{"c memory hard ecc error", 0x019f},
|
||||
{"c battery backup unit failed", 0x01a2},
|
||||
{NULL, 0},
|
||||
{"? unknown event code", 0}
|
||||
};
|
||||
|
||||
/*
|
||||
* Values here must be 16 characters or less, as they are packed into
|
||||
* the 'product' field in the SCSI inquiry data.
|
||||
*/
|
||||
static struct mly_code_lookup mly_table_device_state[] = {
|
||||
{"offline", MLY_DEVICE_STATE_OFFLINE},
|
||||
{"unconfigured", MLY_DEVICE_STATE_UNCONFIGURED},
|
||||
{"online", MLY_DEVICE_STATE_ONLINE},
|
||||
{"critical", MLY_DEVICE_STATE_CRITICAL},
|
||||
{"writeonly", MLY_DEVICE_STATE_WRITEONLY},
|
||||
{"standby", MLY_DEVICE_STATE_STANDBY},
|
||||
{"missing", MLY_DEVICE_STATE_MISSING},
|
||||
{NULL, 0},
|
||||
{"unknown state", 0}
|
||||
};
|
||||
|
||||
/*
|
||||
* Values here must be 8 characters or less, as they are packed into
|
||||
* the 'vendor' field in the SCSI inquiry data.
|
||||
*/
|
||||
static struct mly_code_lookup mly_table_device_type[] = {
|
||||
{"RAID 0", MLY_DEVICE_TYPE_RAID0},
|
||||
{"RAID 1", MLY_DEVICE_TYPE_RAID1},
|
||||
{"RAID 3", MLY_DEVICE_TYPE_RAID3}, /* right asymmetric parity */
|
||||
{"RAID 5", MLY_DEVICE_TYPE_RAID5}, /* right asymmetric parity */
|
||||
{"RAID 6", MLY_DEVICE_TYPE_RAID6}, /* Mylex RAID 6 */
|
||||
{"RAID 7", MLY_DEVICE_TYPE_RAID7}, /* JBOD */
|
||||
{"SPAN", MLY_DEVICE_TYPE_NEWSPAN}, /* New Mylex SPAN */
|
||||
{"RAID 3", MLY_DEVICE_TYPE_RAID3F}, /* fixed parity */
|
||||
{"RAID 3", MLY_DEVICE_TYPE_RAID3L}, /* left symmetric parity */
|
||||
{"SPAN", MLY_DEVICE_TYPE_SPAN}, /* current spanning implementation */
|
||||
{"RAID 5", MLY_DEVICE_TYPE_RAID5L}, /* left symmetric parity */
|
||||
{"RAID E", MLY_DEVICE_TYPE_RAIDE}, /* concatenation */
|
||||
{"PHYSICAL", MLY_DEVICE_TYPE_PHYSICAL}, /* physical device */
|
||||
{NULL, 0},
|
||||
{"UNKNOWN", 0}
|
||||
};
|
||||
|
||||
#if 0
|
||||
static struct mly_code_lookup mly_table_stripe_size[] = {
|
||||
{"NONE", MLY_STRIPE_ZERO},
|
||||
{"512B", MLY_STRIPE_512b},
|
||||
{"1k", MLY_STRIPE_1k},
|
||||
{"2k", MLY_STRIPE_2k},
|
||||
{"4k", MLY_STRIPE_4k},
|
||||
{"8k", MLY_STRIPE_8k},
|
||||
{"16k", MLY_STRIPE_16k},
|
||||
{"32k", MLY_STRIPE_32k},
|
||||
{"64k", MLY_STRIPE_64k},
|
||||
{"128k", MLY_STRIPE_128k},
|
||||
{"256k", MLY_STRIPE_256k},
|
||||
{"512k", MLY_STRIPE_512k},
|
||||
{"1M", MLY_STRIPE_1m},
|
||||
{NULL, 0},
|
||||
{"unknown", 0}
|
||||
};
|
||||
|
||||
static struct mly_code_lookup mly_table_cacheline_size[] = {
|
||||
{"NONE", MLY_CACHELINE_ZERO},
|
||||
{"512B", MLY_CACHELINE_512b},
|
||||
{"1k", MLY_CACHELINE_1k},
|
||||
{"2k", MLY_CACHELINE_2k},
|
||||
{"4k", MLY_CACHELINE_4k},
|
||||
{"8k", MLY_CACHELINE_8k},
|
||||
{"16k", MLY_CACHELINE_16k},
|
||||
{"32k", MLY_CACHELINE_32k},
|
||||
{"64k", MLY_CACHELINE_64k},
|
||||
{NULL, 0},
|
||||
{"unknown", 0}
|
||||
};
|
||||
#endif
|
|
@ -1,72 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 2001 Michael Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/********************************************************************************
|
||||
* Control structures exchanged through the GAM interface with userland
|
||||
* management tools.
|
||||
*
|
||||
* The member naming here is consistent with the Linux driver, with which this
|
||||
* interface is basically compatible.
|
||||
*/
|
||||
struct mly_user_command
|
||||
{
|
||||
unsigned char ControllerNumber;
|
||||
union mly_command_packet CommandMailbox;
|
||||
int DataTransferLength;
|
||||
int RequestSenseLength;
|
||||
void *DataTransferBuffer;
|
||||
void *RequestSenseBuffer;
|
||||
int CommandStatus; /* not in the Linux structure */
|
||||
};
|
||||
|
||||
#define MLYIO_COMMAND _IOWR('M', 200, struct mly_user_command)
|
||||
|
||||
struct mly_user_health
|
||||
{
|
||||
unsigned char ControllerNumber;
|
||||
void *HealthStatusBuffer;
|
||||
};
|
||||
|
||||
#define MLYIO_HEALTH _IOW('M', 201, struct mly_user_health)
|
||||
|
||||
/*
|
||||
* Command queue statistics
|
||||
*/
|
||||
|
||||
#define MLYQ_FREE 0
|
||||
#define MLYQ_BUSY 1
|
||||
#define MLYQ_COMPLETE 2
|
||||
#define MLYQ_COUNT 3
|
||||
|
||||
struct mly_qstat
|
||||
{
|
||||
u_int32_t q_length;
|
||||
u_int32_t q_max;
|
||||
};
|
1272
sys/dev/mly/mlyreg.h
1272
sys/dev/mly/mlyreg.h
File diff suppressed because it is too large
Load diff
|
@ -1,370 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 2000, 2001 Michael Smith
|
||||
* Copyright (c) 2000 BSDi
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/********************************************************************************
|
||||
********************************************************************************
|
||||
Driver Parameter Definitions
|
||||
********************************************************************************
|
||||
********************************************************************************/
|
||||
|
||||
/*
|
||||
* The firmware interface allows for a 16-bit command identifier. A lookup
|
||||
* table this size (256k) would be too expensive, so we cap ourselves at a
|
||||
* reasonable limit.
|
||||
*/
|
||||
#define MLY_MAX_COMMANDS 256 /* max commands per controller */
|
||||
|
||||
/*
|
||||
* The firmware interface allows for a 16-bit s/g list length. We limit
|
||||
* ourselves to a reasonable maximum and ensure alignment.
|
||||
*/
|
||||
#define MLY_MAX_SGENTRIES 64 /* max S/G entries, limit 65535 */
|
||||
|
||||
/*
|
||||
* The interval at which we poke the controller for status updates (in seconds).
|
||||
*/
|
||||
#define MLY_PERIODIC_INTERVAL 1
|
||||
|
||||
/********************************************************************************
|
||||
********************************************************************************
|
||||
Cross-version Compatibility
|
||||
********************************************************************************
|
||||
********************************************************************************/
|
||||
|
||||
# include <sys/taskqueue.h>
|
||||
|
||||
/********************************************************************************
|
||||
********************************************************************************
|
||||
Driver Variable Definitions
|
||||
********************************************************************************
|
||||
********************************************************************************/
|
||||
|
||||
/*
|
||||
* Debugging levels:
|
||||
* 0 - quiet, only emit warnings
|
||||
* 1 - noisy, emit major function points and things done
|
||||
* 2 - extremely noisy, emit trace items in loops, etc.
|
||||
*/
|
||||
#ifdef MLY_DEBUG
|
||||
# define debug(level, fmt, args...) do { if (level <= MLY_DEBUG) printf("%s: " fmt "\n", __func__ , ##args); } while(0)
|
||||
# define debug_called(level) do { if (level <= MLY_DEBUG) printf("%s: called\n", __func__); } while(0)
|
||||
# define debug_struct(s) printf(" SIZE %s: %d\n", #s, sizeof(struct s))
|
||||
# define debug_union(s) printf(" SIZE %s: %d\n", #s, sizeof(union s))
|
||||
# define debug_field(s, f) printf(" OFFSET %s.%s: %d\n", #s, #f, ((int)&(((struct s *)0)->f)))
|
||||
extern void mly_printstate0(void);
|
||||
extern struct mly_softc *mly_softc0;
|
||||
#else
|
||||
# define debug(level, fmt, args...)
|
||||
# define debug_called(level)
|
||||
# define debug_struct(s)
|
||||
#endif
|
||||
|
||||
#define mly_printf(sc, fmt, args...) device_printf(sc->mly_dev, fmt , ##args)
|
||||
|
||||
/*
|
||||
* Per-device structure, used to save persistent state on devices.
|
||||
*
|
||||
* Note that this isn't really Bus/Target/Lun since we don't support
|
||||
* lun != 0 at this time.
|
||||
*/
|
||||
struct mly_btl {
|
||||
int mb_flags;
|
||||
#define MLY_BTL_PHYSICAL (1<<0) /* physical device */
|
||||
#define MLY_BTL_LOGICAL (1<<1) /* logical device */
|
||||
#define MLY_BTL_PROTECTED (1<<2) /* device is protected - I/O not allowed */
|
||||
#define MLY_BTL_RESCAN (1<<3) /* device needs to be rescanned */
|
||||
char mb_name[16]; /* peripheral attached to this device */
|
||||
int mb_state; /* see 8.1 */
|
||||
int mb_type; /* see 8.2 */
|
||||
|
||||
/* physical devices only */
|
||||
int mb_speed; /* interface transfer rate */
|
||||
int mb_width; /* interface width */
|
||||
};
|
||||
|
||||
/*
|
||||
* Per-command control structure.
|
||||
*/
|
||||
struct mly_command {
|
||||
TAILQ_ENTRY(mly_command) mc_link; /* list linkage */
|
||||
|
||||
struct mly_softc *mc_sc; /* controller that owns us */
|
||||
u_int16_t mc_slot; /* command slot we occupy */
|
||||
int mc_flags;
|
||||
#define MLY_CMD_BUSY (1<<0) /* command is being run, or ready to run, or not completed */
|
||||
#define MLY_CMD_COMPLETE (1<<1) /* command has been completed */
|
||||
#define MLY_CMD_MAPPED (1<<3) /* command has had its data mapped */
|
||||
#define MLY_CMD_DATAIN (1<<4) /* data moves controller->system */
|
||||
#define MLY_CMD_DATAOUT (1<<5) /* data moves system->controller */
|
||||
#define MLY_CMD_CCB (1<<6) /* data is ccb. */
|
||||
u_int16_t mc_status; /* command completion status */
|
||||
u_int8_t mc_sense; /* sense data length */
|
||||
int32_t mc_resid; /* I/O residual count */
|
||||
|
||||
union mly_command_packet *mc_packet; /* our controller command */
|
||||
u_int64_t mc_packetphys; /* physical address of the mapped packet */
|
||||
|
||||
void *mc_data; /* data buffer */
|
||||
size_t mc_length; /* data length */
|
||||
bus_dmamap_t mc_datamap; /* DMA map for data */
|
||||
|
||||
void (* mc_complete)(struct mly_command *mc); /* completion handler */
|
||||
void *mc_private; /* caller-private data */
|
||||
|
||||
int mc_timestamp;
|
||||
};
|
||||
|
||||
/*
|
||||
* Command slot regulation.
|
||||
*
|
||||
* We can't use slot 0 due to the memory mailbox implementation.
|
||||
*/
|
||||
#define MLY_SLOT_START 1
|
||||
#define MLY_SLOT_MAX (MLY_SLOT_START + MLY_MAX_COMMANDS)
|
||||
|
||||
/*
|
||||
* Per-controller structure.
|
||||
*/
|
||||
struct mly_softc {
|
||||
/* bus connections */
|
||||
device_t mly_dev;
|
||||
struct cdev *mly_dev_t;
|
||||
struct resource *mly_regs_resource; /* register interface window */
|
||||
int mly_regs_rid; /* resource ID */
|
||||
bus_dma_tag_t mly_parent_dmat; /* parent DMA tag */
|
||||
bus_dma_tag_t mly_buffer_dmat; /* data buffer/command DMA tag */
|
||||
struct resource *mly_irq; /* interrupt */
|
||||
int mly_irq_rid;
|
||||
void *mly_intr; /* interrupt handle */
|
||||
|
||||
/* scatter/gather lists and their controller-visible mappings */
|
||||
struct mly_sg_entry *mly_sg_table; /* s/g lists */
|
||||
u_int32_t mly_sg_busaddr; /* s/g table base address in bus space */
|
||||
bus_dma_tag_t mly_sg_dmat; /* s/g buffer DMA tag */
|
||||
bus_dmamap_t mly_sg_dmamap; /* map for s/g buffers */
|
||||
|
||||
/* controller hardware interface */
|
||||
int mly_hwif;
|
||||
#define MLY_HWIF_I960RX 0
|
||||
#define MLY_HWIF_STRONGARM 1
|
||||
u_int8_t mly_doorbell_true; /* xor map to make hardware doorbell 'true' bits into 1s */
|
||||
u_int8_t mly_command_mailbox; /* register offsets */
|
||||
u_int8_t mly_status_mailbox;
|
||||
u_int8_t mly_idbr;
|
||||
u_int8_t mly_odbr;
|
||||
u_int8_t mly_error_status;
|
||||
u_int8_t mly_interrupt_status;
|
||||
u_int8_t mly_interrupt_mask;
|
||||
struct mly_mmbox *mly_mmbox; /* kernel-space address of memory mailbox */
|
||||
u_int64_t mly_mmbox_busaddr; /* bus-space address of memory mailbox */
|
||||
bus_dma_tag_t mly_mmbox_dmat; /* memory mailbox DMA tag */
|
||||
bus_dmamap_t mly_mmbox_dmamap; /* memory mailbox DMA map */
|
||||
u_int32_t mly_mmbox_command_index; /* next index to use */
|
||||
u_int32_t mly_mmbox_status_index; /* index we next expect status at */
|
||||
|
||||
/* controller features, limits and status */
|
||||
struct mtx mly_lock;
|
||||
int mly_state;
|
||||
#define MLY_STATE_OPEN (1<<1)
|
||||
#define MLY_STATE_INTERRUPTS_ON (1<<2)
|
||||
#define MLY_STATE_MMBOX_ACTIVE (1<<3)
|
||||
#define MLY_STATE_CAM_FROZEN (1<<4)
|
||||
struct mly_ioctl_getcontrollerinfo *mly_controllerinfo;
|
||||
struct mly_param_controller *mly_controllerparam;
|
||||
struct mly_btl mly_btl[MLY_MAX_CHANNELS][MLY_MAX_TARGETS];
|
||||
|
||||
/* command management */
|
||||
struct mly_command mly_command[MLY_MAX_COMMANDS]; /* commands */
|
||||
union mly_command_packet *mly_packet; /* command packets */
|
||||
bus_dma_tag_t mly_packet_dmat; /* packet DMA tag */
|
||||
bus_dmamap_t mly_packetmap; /* packet DMA map */
|
||||
u_int64_t mly_packetphys; /* packet array base address */
|
||||
TAILQ_HEAD(,mly_command) mly_free; /* commands available for reuse */
|
||||
TAILQ_HEAD(,mly_command) mly_busy;
|
||||
TAILQ_HEAD(,mly_command) mly_complete; /* commands which have been returned by the controller */
|
||||
struct mly_qstat mly_qstat[MLYQ_COUNT]; /* queue statistics */
|
||||
|
||||
/* health monitoring */
|
||||
u_int32_t mly_event_change; /* event status change indicator */
|
||||
u_int32_t mly_event_counter; /* next event for which we anticpiate status */
|
||||
u_int32_t mly_event_waiting; /* next event the controller will post status for */
|
||||
struct callout mly_periodic; /* periodic event handling */
|
||||
|
||||
/* CAM connection */
|
||||
struct cam_devq *mly_cam_devq; /* CAM device queue */
|
||||
struct cam_sim *mly_cam_sim[MLY_MAX_CHANNELS]; /* CAM SIMs */
|
||||
struct cam_path *mly_cam_path; /* rescan path */
|
||||
int mly_cam_channels; /* total channel count */
|
||||
|
||||
/* command-completion task */
|
||||
struct task mly_task_complete; /* deferred-completion task */
|
||||
int mly_qfrzn_cnt; /* Track simq freezes */
|
||||
|
||||
#ifdef MLY_DEBUG
|
||||
struct callout mly_timeout;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define MLY_LOCK(sc) mtx_lock(&(sc)->mly_lock)
|
||||
#define MLY_UNLOCK(sc) mtx_unlock(&(sc)->mly_lock)
|
||||
#define MLY_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mly_lock, MA_OWNED)
|
||||
|
||||
/*
|
||||
* Register access helpers.
|
||||
*/
|
||||
#define MLY_SET_REG(sc, reg, val) bus_write_1(sc->mly_regs_resource, reg, val)
|
||||
#define MLY_GET_REG(sc, reg) bus_read_1 (sc->mly_regs_resource, reg)
|
||||
#define MLY_GET_REG2(sc, reg) bus_read_2 (sc->mly_regs_resource, reg)
|
||||
#define MLY_GET_REG4(sc, reg) bus_read_4 (sc->mly_regs_resource, reg)
|
||||
|
||||
#define MLY_SET_MBOX(sc, mbox, ptr) \
|
||||
do { \
|
||||
bus_write_4(sc->mly_regs_resource, mbox, *((u_int32_t *)ptr)); \
|
||||
bus_write_4(sc->mly_regs_resource, mbox + 4, *((u_int32_t *)ptr + 1)); \
|
||||
bus_write_4(sc->mly_regs_resource, mbox + 8, *((u_int32_t *)ptr + 2)); \
|
||||
bus_write_4(sc->mly_regs_resource, mbox + 12, *((u_int32_t *)ptr + 3)); \
|
||||
} while(0);
|
||||
#define MLY_GET_MBOX(sc, mbox, ptr) \
|
||||
do { \
|
||||
*((u_int32_t *)ptr) = bus_read_4(sc->mly_regs_resource, mbox); \
|
||||
*((u_int32_t *)ptr + 1) = bus_read_4(sc->mly_regs_resource, mbox + 4); \
|
||||
*((u_int32_t *)ptr + 2) = bus_read_4(sc->mly_regs_resource, mbox + 8); \
|
||||
*((u_int32_t *)ptr + 3) = bus_read_4(sc->mly_regs_resource, mbox + 12); \
|
||||
} while(0);
|
||||
|
||||
#define MLY_IDBR_TRUE(sc, mask) \
|
||||
((((MLY_GET_REG((sc), (sc)->mly_idbr)) ^ (sc)->mly_doorbell_true) & (mask)) == (mask))
|
||||
#define MLY_ODBR_TRUE(sc, mask) \
|
||||
((MLY_GET_REG((sc), (sc)->mly_odbr) & (mask)) == (mask))
|
||||
#define MLY_ERROR_VALID(sc) \
|
||||
((((MLY_GET_REG((sc), (sc)->mly_error_status)) ^ (sc)->mly_doorbell_true) & (MLY_MSG_EMPTY)) == 0)
|
||||
|
||||
#define MLY_MASK_INTERRUPTS(sc) \
|
||||
do { \
|
||||
MLY_SET_REG((sc), (sc)->mly_interrupt_mask, MLY_INTERRUPT_MASK_DISABLE); \
|
||||
sc->mly_state &= ~MLY_STATE_INTERRUPTS_ON; \
|
||||
} while(0);
|
||||
#define MLY_UNMASK_INTERRUPTS(sc) \
|
||||
do { \
|
||||
MLY_SET_REG((sc), (sc)->mly_interrupt_mask, MLY_INTERRUPT_MASK_ENABLE); \
|
||||
sc->mly_state |= MLY_STATE_INTERRUPTS_ON; \
|
||||
} while(0);
|
||||
|
||||
/*
|
||||
* Bus/target/logical ID-related macros.
|
||||
*/
|
||||
#define MLY_LOGDEV_ID(sc, bus, target) (((bus) - (sc)->mly_controllerinfo->physical_channels_present) * \
|
||||
MLY_MAX_TARGETS + (target))
|
||||
#define MLY_LOGDEV_BUS(sc, logdev) (((logdev) / MLY_MAX_TARGETS) + \
|
||||
(sc)->mly_controllerinfo->physical_channels_present)
|
||||
#define MLY_LOGDEV_TARGET(sc, logdev) ((logdev) % MLY_MAX_TARGETS)
|
||||
#define MLY_BUS_IS_VIRTUAL(sc, bus) ((bus) >= (sc)->mly_controllerinfo->physical_channels_present)
|
||||
#define MLY_BUS_IS_VALID(sc, bus) (((bus) < (sc)->mly_cam_channels) && ((sc)->mly_cam_sim[(bus)] != NULL))
|
||||
|
||||
/********************************************************************************
|
||||
* Queue primitives
|
||||
*/
|
||||
|
||||
#define MLYQ_ADD(sc, qname) \
|
||||
do { \
|
||||
struct mly_qstat *qs = &(sc)->mly_qstat[qname]; \
|
||||
\
|
||||
qs->q_length++; \
|
||||
if (qs->q_length > qs->q_max) \
|
||||
qs->q_max = qs->q_length; \
|
||||
} while(0)
|
||||
|
||||
#define MLYQ_REMOVE(sc, qname) (sc)->mly_qstat[qname].q_length--
|
||||
#define MLYQ_INIT(sc, qname) \
|
||||
do { \
|
||||
sc->mly_qstat[qname].q_length = 0; \
|
||||
sc->mly_qstat[qname].q_max = 0; \
|
||||
} while(0)
|
||||
|
||||
#define MLYQ_COMMAND_QUEUE(name, index) \
|
||||
static __inline void \
|
||||
mly_initq_ ## name (struct mly_softc *sc) \
|
||||
{ \
|
||||
TAILQ_INIT(&sc->mly_ ## name); \
|
||||
MLYQ_INIT(sc, index); \
|
||||
} \
|
||||
static __inline void \
|
||||
mly_enqueue_ ## name (struct mly_command *mc) \
|
||||
{ \
|
||||
\
|
||||
TAILQ_INSERT_TAIL(&mc->mc_sc->mly_ ## name, mc, mc_link); \
|
||||
MLYQ_ADD(mc->mc_sc, index); \
|
||||
} \
|
||||
static __inline void \
|
||||
mly_requeue_ ## name (struct mly_command *mc) \
|
||||
{ \
|
||||
\
|
||||
TAILQ_INSERT_HEAD(&mc->mc_sc->mly_ ## name, mc, mc_link); \
|
||||
MLYQ_ADD(mc->mc_sc, index); \
|
||||
} \
|
||||
static __inline struct mly_command * \
|
||||
mly_dequeue_ ## name (struct mly_softc *sc) \
|
||||
{ \
|
||||
struct mly_command *mc; \
|
||||
\
|
||||
if ((mc = TAILQ_FIRST(&sc->mly_ ## name)) != NULL) { \
|
||||
TAILQ_REMOVE(&sc->mly_ ## name, mc, mc_link); \
|
||||
MLYQ_REMOVE(sc, index); \
|
||||
} \
|
||||
return(mc); \
|
||||
} \
|
||||
static __inline void \
|
||||
mly_remove_ ## name (struct mly_command *mc) \
|
||||
{ \
|
||||
\
|
||||
TAILQ_REMOVE(&mc->mc_sc->mly_ ## name, mc, mc_link); \
|
||||
MLYQ_REMOVE(mc->mc_sc, index); \
|
||||
} \
|
||||
struct hack
|
||||
|
||||
MLYQ_COMMAND_QUEUE(free, MLYQ_FREE);
|
||||
MLYQ_COMMAND_QUEUE(busy, MLYQ_BUSY);
|
||||
MLYQ_COMMAND_QUEUE(complete, MLYQ_COMPLETE);
|
||||
|
||||
/********************************************************************************
|
||||
* space-fill a character string
|
||||
*/
|
||||
static __inline void
|
||||
padstr(char *targ, char *src, int len)
|
||||
{
|
||||
while (len-- > 0) {
|
||||
if (*src != 0) {
|
||||
*targ++ = *src++;
|
||||
} else {
|
||||
*targ++ = ' ';
|
||||
}
|
||||
}
|
||||
}
|
|
@ -159,7 +159,6 @@ device arcmsr # Areca SATA II RAID
|
|||
device ciss # Compaq Smart RAID 5*
|
||||
device iir # Intel Integrated RAID
|
||||
device ips # IBM (Adaptec) ServeRAID
|
||||
device mly # Mylex AcceleRAID/eXtremeRAID
|
||||
device twa # 3ware 9000 series PATA/SATA RAID
|
||||
device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller
|
||||
|
||||
|
|
|
@ -243,7 +243,6 @@ SUBDIR= \
|
|||
${_mlx5} \
|
||||
${_mlx5en} \
|
||||
${_mlx5ib} \
|
||||
${_mly} \
|
||||
mmc \
|
||||
mmcsd \
|
||||
${_mpr} \
|
||||
|
@ -710,7 +709,6 @@ _iwifw= iwifw
|
|||
_iwmfw= iwmfw
|
||||
_iwnfw= iwnfw
|
||||
.endif
|
||||
_mly= mly
|
||||
_nfe= nfe
|
||||
_nvd= nvd
|
||||
_nvme= nvme
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# $FreeBSD$
|
||||
|
||||
.PATH: ${SRCTOP}/sys/dev/mly
|
||||
|
||||
KMOD= mly
|
||||
SRCS= mly.c
|
||||
SRCS+= opt_scsi.h opt_cam.h
|
||||
SRCS+= device_if.h bus_if.h pci_if.h
|
||||
|
||||
#CFLAGS+= -DMLY_DEBUG=1
|
||||
CFLAGS+= -DMLY_MODULE
|
||||
|
||||
.include <bsd.kmod.mk>
|
|
@ -1,21 +0,0 @@
|
|||
# Doxyfile 1.5.2
|
||||
|
||||
# $FreeBSD$
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = "FreeBSD kernel MLY device code"
|
||||
OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_mly/
|
||||
EXTRACT_ALL = YES # for undocumented src, no warnings enabled
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = $(DOXYGEN_SRC_PATH)/dev/mly/ \
|
||||
$(NOTREVIEWED)
|
||||
|
||||
GENERATE_TAGFILE = dev_mly/dev_mly.tag
|
||||
|
||||
@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH)
|
||||
@INCLUDE = common-Doxyfile
|
||||
|
Loading…
Reference in a new issue