summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx/mlx_pci.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-12-11 00:00:13 +0000
committermsmith <msmith@FreeBSD.org>1999-12-11 00:00:13 +0000
commit7f4d10be2c9eee66e10cec38c7bb014cb2a957cc (patch)
tree1e89a5e0931480d2f932d56a1d4607adf70f40ec /sys/dev/mlx/mlx_pci.c
parent73feefc8af6d4a943bff813f0455b846f4d75978 (diff)
downloadFreeBSD-src-7f4d10be2c9eee66e10cec38c7bb014cb2a957cc.zip
FreeBSD-src-7f4d10be2c9eee66e10cec38c7bb014cb2a957cc.tar.gz
Major update to the Mylex DAC960 driver adding new hardware support
and fixing some major bugs. - Add support for the v5 firmware interface, used by the DAC1164P (tested) and AcceleRAID 352 (untested but should work). We now cover all of the Mylex family's protocols except for v2 (used by EISA and Alpha-compatible cards). - Fix an accounting bug which resulted in endless 'poll still busy' messages. In situations of high controller load the count of poll commands could be incremented without actually successfully launching a command. This totally removes the accounting for status poll commnads; it was its own worst enemy. - Add some simple reentry prevention locks to processing of the waiting and completed command queues to prevent races which could result in I/O being done or completed twice (both are fatal). This highlights a need for simple locking primitives in both the UP and SMP kernels. - Streamline the handling of command completion to reduce the amount of redundant work being done. Remove the code which tests for commands that have gone missing in action; nobody has ever seen one of these and it wouldn't have worked properly anyhow. - Handle disconnection of drives from the controller in the detach, not shutdown method. This avoids problems flushing the cache in a panic when a drive is mounted. - Don't call bus_generic_detach when disconnecting drives; it doesn't actually do anything useful. - Increment the log message index regardless of whether we actually retrieved one or not. If we run into a message that we can't fetch, we don't want to spin endlessly complaining about the fact. - Don't assume that interrupts will work when we're flushing the controller. We may think they are enabled, but in eg. a panic situation the controller may not be able to deliver an interrupt.
Diffstat (limited to 'sys/dev/mlx/mlx_pci.c')
-rw-r--r--sys/dev/mlx/mlx_pci.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c
index 673b5eb..6448a52 100644
--- a/sys/dev/mlx/mlx_pci.c
+++ b/sys/dev/mlx/mlx_pci.c
@@ -81,30 +81,36 @@ static driver_t mlx_pci_driver = {
DRIVER_MODULE(mlx, pci, mlx_pci_driver, mlx_devclass, 0, 0);
-struct
+struct mlx_ident
{
u_int16_t vendor;
u_int16_t device;
+ u_int16_t subvendor;
+ u_int16_t subdevice;
int iftype;
char *desc;
} mlx_identifiers[] = {
- {0x1069, 0x0002, MLX_IFTYPE_3, "Mylex version 3 RAID interface"}, /* Mylex v3 software interface */
- {0x1069, 0x0010, MLX_IFTYPE_4, "Mylex version 4 RAID interface"}, /* Mylex v4 software interface */
- {0, 0, 0, 0}
+/* {0x1069, 0x0001, 0x0000, 0x0000, MLX_IFTYPE_2, "Mylex version 2 RAID interface"}, */
+ {0x1069, 0x0002, 0x0000, 0x0000, MLX_IFTYPE_3, "Mylex version 3 RAID interface"},
+ {0x1069, 0x0010, 0x0000, 0x0000, MLX_IFTYPE_4, "Mylex version 4 RAID interface"},
+ {0x1011, 0x1065, 0x1069, 0x0020, MLX_IFTYPE_5, "Mylex version 5 RAID interface"},
+ {0, 0, 0, 0, 0, 0}
};
static int
mlx_pci_probe(device_t dev)
{
- int i;
+ struct mlx_ident *m;
debug("called");
- for (i = 0; mlx_identifiers[i].vendor != 0; i++) {
- if ((mlx_identifiers[i].vendor == pci_get_vendor(dev)) &&
- (mlx_identifiers[i].device == pci_get_device(dev))) {
+ for (m = mlx_identifiers; m->vendor != 0; m++) {
+ if ((m->vendor == pci_get_vendor(dev)) &&
+ (m->device == pci_get_device(dev)) &&
+ ((m->subvendor == 0) || ((m->subvendor == pci_get_subvendor(dev)) &&
+ (m->subdevice == pci_get_subdevice(dev))))) {
- device_set_desc(dev, mlx_identifiers[i].desc);
+ device_set_desc(dev, m->desc);
return(0);
}
}
OpenPOWER on IntegriCloud