From owner-freebsd-current@FreeBSD.ORG Mon Sep 25 09:36:13 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D461416A47C; Mon, 25 Sep 2006 09:36:13 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mx18.yandex.ru (smtp2.yandex.ru [213.180.200.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD7FF43D78; Mon, 25 Sep 2006 09:35:55 +0000 (GMT) (envelope-from bu7cher@yandex.ru) Received: from ns.kirov.so-cdu.ru ([81.18.142.225]:11535 "EHLO [127.0.0.1]" smtp-auth: "bu7cher" TLS-CIPHER: "DHE-RSA-AES256-SHA keybits 256/256 version TLSv1/SSLv3" TLS-PEER-CN1: ) by mail.yandex.ru with ESMTP id S3376744AbWIYJfj (ORCPT + 2 others); Mon, 25 Sep 2006 13:35:39 +0400 X-Comment: RFC 2476 MSA function at smtp2.yandex.ru logged sender identity as: bu7cher Message-ID: <4517A2E8.2010002@yandex.ru> Date: Mon, 25 Sep 2006 13:35:36 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 References: <4501A921.000002.29363@mfront8.yandex.ru> In-Reply-To: <4501A921.000002.29363@mfront8.yandex.ru> Content-Type: multipart/mixed; boundary="------------030102040200060207040700" To: unlisted-recipients:; (no To-header on input) Cc: freebsd-current@freebsd.org, scottl@freebsd.org, az@freebsd.org Subject: Re: aac(4) update request X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Sep 2006 09:36:14 -0000 This is a multi-part message in MIME format. --------------030102040200060207040700 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Andrey V. Elsukov wrote: > Can you update FreeBSD aac(4) driver to a current > adaptec driver that available on the site? > As i found last driver is b9114. This driver support > IBM ServeRAID 8K, I and L adapters. > But this driver available only for FreeBSD 5.4. :( Thanks to Andrew Jemerya for pointing to new aacu(4) driver for FreeBSD 6.0. http://www.adaptec.com/en-US/downloads/unix/freebsd?productId=AAR-2820SA http://www.adaptec.com/en-US/speed/raid/aac/linux/aacraid_drv_freebsd6_v9179_tar_gz.htm I've merged some changes from this driver to RELENG_6 sources. I've created a custom FreeBSD 6.2-BETA1 ISO image with a my patch to aac(4). Now i've successfully installed FreeBSD to my new IBM x3650 with an IBM ServeRAID-8k controller. I think that this patch can be successfully applied to CURRENT sources. Patch and dmesg.boot is attached. -- WBR, Andrey V. Elsukov --------------030102040200060207040700 Content-Type: text/plain; name="aac-RELENG_6.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="aac-RELENG_6.txt" --- sys/dev/aac.orig/aac.c Mon Jan 30 00:00:00 2006 +++ sys/dev/aac/aac.c Fri Sep 22 12:51:24 2006 @@ -33,7 +33,7 @@ /* * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters. */ -#define AAC_DRIVER_VERSION 0x02000000 +#define AAC_DRIVER_VERSION 0x02000001 #define AAC_DRIVERNAME "aac" #include "opt_aac.h" @@ -1668,14 +1668,12 @@ sc->aac_max_sectors = 128; /* 64KB */ if (sc->flags & AAC_FLAGS_SG_64BIT) sc->aac_sg_tablesize = (AAC_FIB_DATASIZE - - sizeof(struct aac_blockwrite64) - + sizeof(struct aac_sg_table64)) - / sizeof(struct aac_sg_table64); + - sizeof(struct aac_blockwrite64)) + / sizeof(struct aac_sg_entry64); else sc->aac_sg_tablesize = (AAC_FIB_DATASIZE - - sizeof(struct aac_blockwrite) - + sizeof(struct aac_sg_table)) - / sizeof(struct aac_sg_table); + - sizeof(struct aac_blockwrite)) + / sizeof(struct aac_sg_entry); if (!aac_sync_command(sc, AAC_MONKER_GETCOMMPREF, 0, 0, 0, 0, NULL)) { options = AAC_GET_MAILBOX(sc, 1); @@ -3220,7 +3218,7 @@ mtx_lock(&sc->aac_aifq_lock); next = (sc->aac_aifq_head + 1) % AAC_AIFQ_LENGTH; if (next != sc->aac_aifq_tail) { - bcopy(aif, &sc->aac_aifq[next], sizeof(struct aac_aif_command)); + bcopy(fib, &sc->aac_aifq[next], sizeof(struct aac_fib)); sc->aac_aifq_head = next; /* On the off chance that someone is sleeping for an aif... */ @@ -3327,7 +3325,7 @@ next = (sc->aac_aifq_tail + 1) % AAC_AIFQ_LENGTH; error = copyout(&sc->aac_aifq[next], uptr, - sizeof(struct aac_aif_command)); + sizeof(struct aac_fib)); if (error) device_printf(sc->aac_dev, "aac_return_aif: copyout returned %d\n", error); --- sys/dev/aac.orig/aac_pci.c Thu Jun 22 09:01:00 2006 +++ sys/dev/aac/aac_pci.c Fri Sep 22 12:52:45 2006 @@ -126,13 +126,13 @@ {0x9005, 0x0285, 0x9005, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2120S"}, {0x9005, 0x0285, 0x9005, 0x0290, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, - "Adaptec SATA RAID 2410SA"}, + "Adaptec SCSI RAID 2410SA"}, {0x9005, 0x0285, 0x1028, 0x0291, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, "Dell CERC SATA RAID 2"}, {0x9005, 0x0285, 0x9005, 0x0292, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, - "Adaptec SATA RAID 2810SA"}, + "Adaptec SCSI RAID 2810SA"}, {0x9005, 0x0285, 0x9005, 0x0293, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, - "Adaptec SATA RAID 21610SA"}, + "Adaptec SCSI RAID 21610SA"}, {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, "HP ML110 G2 (Adaptec 2610SA)"}, {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0, @@ -161,19 +161,19 @@ {0x9005, 0x0286, 0x9005, 0x029d, AAC_HWIF_RKT, 0, "Adaptec SATA RAID 2420SA"}, {0x9005, 0x0286, 0x9005, 0x029e, AAC_HWIF_RKT, 0, - "ICP ICP9024RO SCSI RAID"}, + "ICP9024RO SATA RAID"}, {0x9005, 0x0286, 0x9005, 0x029f, AAC_HWIF_RKT, 0, - "ICP ICP9014RO SCSI RAID"}, + "ICP9014RO SATA RAID"}, {0x9005, 0x0285, 0x9005, 0x0294, AAC_HWIF_I960RX, 0, "Adaptec SATA RAID 2026ZCR"}, - {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, 0, - "Adaptec SATA RAID 2610SA"}, {0x9005, 0x0285, 0x9005, 0x0296, AAC_HWIF_I960RX, 0, "Adaptec SCSI RAID 2240S"}, {0x9005, 0x0285, 0x9005, 0x0297, AAC_HWIF_I960RX, 0, "Adaptec SAS RAID 4005SAS"}, {0x9005, 0x0285, 0x1014, 0x02f2, AAC_HWIF_I960RX, 0, "IBM ServeRAID 8i"}, + {0x9005, 0x0285, 0x1014, 0x0312, AAC_HWIF_I960RX, 0, + "IBM ServeRAID 8i"}, {0x9005, 0x0285, 0x9005, 0x0298, AAC_HWIF_I960RX, 0, "Adaptec SAS RAID 4000SAS"}, {0x9005, 0x0285, 0x9005, 0x0299, AAC_HWIF_I960RX, 0, @@ -185,45 +185,53 @@ {0x9005, 0x0285, 0x9005, 0x028f, AAC_HWIF_I960RX, 0, "Adaptec SATA RAID 2025SA ZCR"}, {0x9005, 0x0285, 0x9005, 0x02a4, AAC_HWIF_I960RX, 0, - "ICP ICP9085LI SAS RAID"}, + "ICP 9085LI SAS RAID"}, {0x9005, 0x0285, 0x9005, 0x02a5, AAC_HWIF_I960RX, 0, - "ICP ICP5085BR SAS RAID"}, + "ICP 5085BR SAS RAID"}, {0x9005, 0x0286, 0x9005, 0x02a0, AAC_HWIF_RKT, 0, - "ICP ICP9047MA SATA RAID"}, + "ICP9047MA SATA RAID"}, {0x9005, 0x0286, 0x9005, 0x02a1, AAC_HWIF_RKT, 0, - "ICP ICP9087MA SATA RAID"}, + "ICP9087MA SATA RAID"}, + {0x9005, 0x0286, 0x9005, 0x02a2, AAC_HWIF_RKT, 0, + "Adaptec SAS RAID 3800SAS"}, + {0x9005, 0x0286, 0x9005, 0x02a3, AAC_HWIF_RKT, 0, + "ICP5445AU SAS RAID"}, + {0x9005, 0x0286, 0x9005, 0x02a6, AAC_HWIF_RKT, 0, + "ICP9067MA SATA RAID"}, + {0x9005, 0x0286, 0x9005, 0x02a7, AAC_HWIF_RKT, 0, + "Adaptec SAS RAID 3805SAS"}, + {0x9005, 0x0286, 0x9005, 0x02a9, AAC_HWIF_RKT, 0, + "ICP5085AU SAS RAID"}, + {0x9005, 0x0286, 0x9005, 0x02ac, AAC_HWIF_RKT, 0, + "Adaptec SAS RAID 1800SAS"}, + {0x9005, 0x0286, 0x1014, 0x9580, AAC_HWIF_RKT, 0, + "IBM ServeRAID 8k"}, + {0x9005, 0x0286, 0x1014, 0x9540, AAC_HWIF_RKT, 0, + "IBM ServeRAID 8L"}, {0, 0, 0, 0, 0, 0, 0} }; -static struct aac_ident * -aac_find_ident(device_t dev) -{ - struct aac_ident *m; - - for (m = aac_identifiers; m->vendor != 0; m++) { - if ((m->vendor == pci_get_vendor(dev)) && - (m->device == pci_get_device(dev)) && - (m->subvendor == pci_get_subvendor(dev)) && - (m->subdevice == pci_get_subdevice(dev))) - return (m); - } - - return (NULL); -} - /* * Determine whether this is one of our supported adapters. */ static int aac_pci_probe(device_t dev) { - struct aac_ident *id; + struct aac_ident *m; debug_called(1); - if ((id = aac_find_ident(dev)) != NULL) { - device_set_desc(dev, id->desc); - return(BUS_PROBE_DEFAULT); + for (m = aac_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 == 0) || ((m->subdevice == + pci_get_subdevice(dev))))) { + + device_set_desc(dev, m->desc); + return(BUS_PROBE_SPECIFIC); + } } return(ENXIO); } @@ -235,8 +243,7 @@ aac_pci_attach(device_t dev) { struct aac_softc *sc; - struct aac_ident *id; - int error; + int i, error; u_int32_t command; debug_called(1); @@ -310,8 +317,12 @@ * Detect the hardware interface version, set up the bus interface * indirection. */ - id = aac_find_ident(dev); - sc->aac_hwif = id->hwif; + for (i = 0; aac_identifiers[i].vendor != 0; i++) { + if ((aac_identifiers[i].vendor == pci_get_vendor(dev)) && + (aac_identifiers[i].device == pci_get_device(dev)) && + (aac_identifiers[i].subvendor == pci_get_subvendor(dev)) && + (aac_identifiers[i].subdevice == pci_get_subdevice(dev))) { + sc->aac_hwif = aac_identifiers[i].hwif; switch(sc->aac_hwif) { case AAC_HWIF_I960RX: debug(2, "set hardware up for i960Rx"); @@ -331,13 +342,21 @@ break; default: sc->aac_hwif = AAC_HWIF_UNKNOWN; + break; + } + + /* Set up quirks */ + sc->flags = aac_identifiers[i].quirks; + + break; + } + } + if (sc->aac_hwif == AAC_HWIF_UNKNOWN) { device_printf(sc->aac_dev, "unknown hardware type\n"); error = ENXIO; goto out; } - /* Set up quirks */ - sc->flags = id->quirks; /* * Do bus-independent initialisation. --- sys/dev/aac.orig/aacvar.h Sun Oct 9 00:00:00 2005 +++ sys/dev/aac/aacvar.h Fri Sep 22 12:52:56 2006 @@ -356,7 +356,7 @@ /* management interface */ struct cdev *aac_dev_t; struct mtx aac_aifq_lock; - struct aac_aif_command aac_aifq[AAC_AIFQ_LENGTH]; + struct aac_fib aac_aifq[AAC_AIFQ_LENGTH]; int aac_aifq_head; int aac_aifq_tail; struct selinfo rcv_select; --------------030102040200060207040700 Content-Type: text/plain; name="dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dmesg.txt" Copyright (c) 1992-2006 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.2-20060924-SNAP #0: Sat Sep 23 23:29:41 UTC 2006 root@bridge.hostel4.hvn:/usr/obj/usr/src/sys/SMP acpi_alloc_wakeup_handler: can't alloc wake memory Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Xeon(TM) CPU 3.00GHz (3000.13-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf64 Stepping = 4 Features=0xbfebfbff Features2=0xe4bd,> AMD Features=0x20000000 AMD Features2=0x1 Cores per package: 2 Logical CPUs per core: 2 real memory = 3221008384 (3071 MB) avail memory = 3150974976 (3005 MB) ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 cpu2 (AP): APIC ID: 2 cpu3 (AP): APIC ID: 3 cpu4 (AP): APIC ID: 4 cpu5 (AP): APIC ID: 5 cpu6 (AP): APIC ID: 6 cpu7 (AP): APIC ID: 7 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) acpi0: on motherboard acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi0: Power Button (fixed) acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x588-0x58b on acpi0 cpu0: on acpi0 acpi_perf0: on cpu0 acpi_throttle0: on cpu0 cpu1: on acpi0 acpi_throttle1: on cpu1 acpi_throttle1: failed to attach P_CNT device_attach: acpi_throttle1 attach returned 6 cpu2: on acpi0 acpi_throttle2: on cpu2 acpi_throttle2: failed to attach P_CNT device_attach: acpi_throttle2 attach returned 6 cpu3: on acpi0 acpi_throttle3: on cpu3 acpi_throttle3: failed to attach P_CNT device_attach: acpi_throttle3 attach returned 6 cpu4: on acpi0 acpi_throttle4: on cpu4 acpi_throttle4: failed to attach P_CNT device_attach: acpi_throttle4 attach returned 6 cpu5: on acpi0 acpi_throttle5: on cpu5 acpi_throttle5: failed to attach P_CNT device_attach: acpi_throttle5 attach returned 6 cpu6: on acpi0 acpi_throttle6: on cpu6 acpi_throttle6: failed to attach P_CNT device_attach: acpi_throttle6 attach returned 6 cpu7: on acpi0 acpi_throttle7: on cpu7 acpi_throttle7: failed to attach P_CNT device_attach: acpi_throttle7 attach returned 6 pcib0: on acpi0 pci0: on pcib0 pcib1: at device 2.0 on pci0 pci26: on pcib1 pcib2: at device 0.0 on pci26 pci27: on pcib2 pcib3: at device 0.0 on pci27 pci28: on pcib3 pcib4: at device 1.0 on pci27 pci36: on pcib4 pcib5: at device 0.3 on pci26 pci37: on pcib5 pcib6: at device 3.0 on pci0 pci4: on pcib6 aac0: port 0x5000-0x50ff mem 0xc9e00000-0xc9ffffff,0xc7fe0000-0xc7ffffff irq 17 at device 0.0 on pci4 aac0: New comm. interface enabled aac0: Adaptec Raid Controller 2.0.1-1 pcib7: at device 4.0 on pci0 pci16: on pcib7 pcib8: at device 5.0 on pci0 pci69: on pcib8 pcib9: at device 6.0 on pci0 pci7: on pcib9 pcib10: at device 7.0 on pci0 pci68: on pcib10 pci0: at device 8.0 (no driver attached) pcib11: at device 28.0 on pci0 pci2: on pcib11 pcib12: at device 0.0 on pci2 pci3: on pcib12 bce0: mem 0xce000000-0xcfffffff irq 16 at device 0.0 on pci3 bce0: ASIC ID 0x57081010; Revision (B1); PCI-X 64-bit 133MHz miibus0: on bce0 brgphy0: on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto bce0: Ethernet address: 00:14:5e:18:16:72 pcib13: at device 28.1 on pci0 pci5: on pcib13 pcib14: at device 0.0 on pci5 pci6: on pcib14 bce1: mem 0xca000000-0xcbffffff irq 17 at device 0.0 on pci6 bce1: ASIC ID 0x57081010; Revision (B1); PCI-X 64-bit 133MHz miibus1: on bce1 brgphy1: on miibus1 brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto bce1: Ethernet address: 00:14:5e:18:16:74 uhci0: port 0x2200-0x221f irq 23 at device 29.0 on pci0 uhci0: [GIANT-LOCKED] usb0: on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1: port 0x2600-0x261f irq 22 at device 29.1 on pci0 uhci1: [GIANT-LOCKED] usb1: on uhci1 usb1: USB revision 1.0 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2: port 0x2a00-0x2a1f irq 23 at device 29.2 on pci0 uhci2: [GIANT-LOCKED] usb2: on uhci2 usb2: USB revision 1.0 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered uhci3: port 0x2e00-0x2e1f irq 22 at device 29.3 on pci0 uhci3: [GIANT-LOCKED] usb3: on uhci3 usb3: USB revision 1.0 uhub3: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub3: 2 ports with 2 removable, self powered ehci0: mem 0xf9000000-0xf90003ff irq 23 at device 29.7 on pci0 ehci0: [GIANT-LOCKED] usb4: EHCI version 1.0 usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3 usb4: on ehci0 usb4: USB revision 2.0 uhub4: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub4: 8 ports with 8 removable, self powered pcib15: at device 30.0 on pci0 pci1: on pcib15 pci1: at device 6.0 (no driver attached) isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x480-0x48f at device 31.2 on pci0 ata0: on atapci0 ata1: on atapci0 pci0: at device 31.3 (no driver attached) sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 sio0: type 16550A pmtimer0 on isa0 orm0: at iomem 0xc0000-0xcafff,0xcb000-0xcc7ff,0xcc800-0xcdfff,0xce000-0xd2fff on isa0 atkbdc0: at port 0x60,0x64 on isa0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] ppc0: parallel port not found. sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ukbd0: CHICONY HP Basic USB Keyboard, rev 1.10/3.00, addr 2, iclass 3/1 kbd2 at ukbd0 ukbd1: vendor 0x10d5 UKU-M02 1.7, rev 1.10/0.00, addr 2, iclass 3/1 kbd3 at ukbd1 ums0: vendor 0x10d5 UKU-M02 1.7, rev 1.10/0.00, addr 2, iclass 3/1 ums0: 5 buttons and Z dir. Timecounters tick every 1.000 msec acd0: CDRW at ata1-master UDMA33 aacd0: on aac0 aacd0: 69890MB (143134720 sectors) aacd1: on aac0 aacd1: 139788MB (286285824 sectors) SMP: AP CPU #2 Launched! SMP: AP CPU #6 Launched! SMP: AP CPU #3 Launched! SMP: AP CPU #1 Launched! SMP: AP CPU #4 Launched! SMP: AP CPU #7 Launched! SMP: AP CPU #5 Launched! Trying to mount root from ufs:/dev/aacd0s1a --------------030102040200060207040700--