mlx_pci.c (52544) | mlx_pci.c (54419) |
---|---|
1/*- 2 * Copyright (c) 1999 Michael Smith 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Michael Smith 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/mlx/mlx_pci.c 52544 1999-10-26 23:20:43Z msmith $ | 26 * $FreeBSD: head/sys/dev/mlx/mlx_pci.c 54419 1999-12-11 00:00:13Z msmith $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/malloc.h> 32#include <sys/kernel.h> 33 34#include <sys/bus.h> --- 41 unchanged lines hidden (view full) --- 76static driver_t mlx_pci_driver = { 77 "mlx", 78 mlx_methods, 79 sizeof(struct mlx_softc) 80}; 81 82DRIVER_MODULE(mlx, pci, mlx_pci_driver, mlx_devclass, 0, 0); 83 | 27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/malloc.h> 32#include <sys/kernel.h> 33 34#include <sys/bus.h> --- 41 unchanged lines hidden (view full) --- 76static driver_t mlx_pci_driver = { 77 "mlx", 78 mlx_methods, 79 sizeof(struct mlx_softc) 80}; 81 82DRIVER_MODULE(mlx, pci, mlx_pci_driver, mlx_devclass, 0, 0); 83 |
84struct | 84struct mlx_ident |
85{ 86 u_int16_t vendor; 87 u_int16_t device; | 85{ 86 u_int16_t vendor; 87 u_int16_t device; |
88 u_int16_t subvendor; 89 u_int16_t subdevice; |
|
88 int iftype; 89 char *desc; 90} mlx_identifiers[] = { | 90 int iftype; 91 char *desc; 92} mlx_identifiers[] = { |
91 {0x1069, 0x0002, MLX_IFTYPE_3, "Mylex version 3 RAID interface"}, /* Mylex v3 software interface */ 92 {0x1069, 0x0010, MLX_IFTYPE_4, "Mylex version 4 RAID interface"}, /* Mylex v4 software interface */ 93 {0, 0, 0, 0} | 93/* {0x1069, 0x0001, 0x0000, 0x0000, MLX_IFTYPE_2, "Mylex version 2 RAID interface"}, */ 94 {0x1069, 0x0002, 0x0000, 0x0000, MLX_IFTYPE_3, "Mylex version 3 RAID interface"}, 95 {0x1069, 0x0010, 0x0000, 0x0000, MLX_IFTYPE_4, "Mylex version 4 RAID interface"}, 96 {0x1011, 0x1065, 0x1069, 0x0020, MLX_IFTYPE_5, "Mylex version 5 RAID interface"}, 97 {0, 0, 0, 0, 0, 0} |
94}; 95 96static int 97mlx_pci_probe(device_t dev) 98{ | 98}; 99 100static int 101mlx_pci_probe(device_t dev) 102{ |
99 int i; | 103 struct mlx_ident *m; |
100 101 debug("called"); 102 | 104 105 debug("called"); 106 |
103 for (i = 0; mlx_identifiers[i].vendor != 0; i++) { 104 if ((mlx_identifiers[i].vendor == pci_get_vendor(dev)) && 105 (mlx_identifiers[i].device == pci_get_device(dev))) { | 107 for (m = mlx_identifiers; m->vendor != 0; m++) { 108 if ((m->vendor == pci_get_vendor(dev)) && 109 (m->device == pci_get_device(dev)) && 110 ((m->subvendor == 0) || ((m->subvendor == pci_get_subvendor(dev)) && 111 (m->subdevice == pci_get_subdevice(dev))))) { |
106 | 112 |
107 device_set_desc(dev, mlx_identifiers[i].desc); | 113 device_set_desc(dev, m->desc); |
108 return(0); 109 } 110 } 111 return(ENXIO); 112} 113 114static int 115mlx_pci_attach(device_t dev) --- 86 unchanged lines hidden --- | 114 return(0); 115 } 116 } 117 return(ENXIO); 118} 119 120static int 121mlx_pci_attach(device_t dev) --- 86 unchanged lines hidden --- |