Deleted Added
full compact
aac.c (231589) aac.c (247570)
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2001 Scott Long
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Adaptec, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2001 Scott Long
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Adaptec, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/aac/aac.c 231589 2012-02-13 16:48:49Z emaste $");
31__FBSDID("$FreeBSD: head/sys/dev/aac/aac.c 247570 2013-03-01 19:55:10Z marius $");
32
33/*
34 * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
35 */
36#define AAC_DRIVERNAME "aac"
37
38#include "opt_aac.h"
39

--- 72 unchanged lines hidden (view full) ---

112static int aac_sa_get_istatus(struct aac_softc *sc);
113static void aac_sa_clear_istatus(struct aac_softc *sc, int mask);
114static void aac_sa_set_mailbox(struct aac_softc *sc, u_int32_t command,
115 u_int32_t arg0, u_int32_t arg1,
116 u_int32_t arg2, u_int32_t arg3);
117static int aac_sa_get_mailbox(struct aac_softc *sc, int mb);
118static void aac_sa_set_interrupts(struct aac_softc *sc, int enable);
119
32
33/*
34 * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
35 */
36#define AAC_DRIVERNAME "aac"
37
38#include "opt_aac.h"
39

--- 72 unchanged lines hidden (view full) ---

112static int aac_sa_get_istatus(struct aac_softc *sc);
113static void aac_sa_clear_istatus(struct aac_softc *sc, int mask);
114static void aac_sa_set_mailbox(struct aac_softc *sc, u_int32_t command,
115 u_int32_t arg0, u_int32_t arg1,
116 u_int32_t arg2, u_int32_t arg3);
117static int aac_sa_get_mailbox(struct aac_softc *sc, int mb);
118static void aac_sa_set_interrupts(struct aac_softc *sc, int enable);
119
120struct aac_interface aac_sa_interface = {
120const struct aac_interface aac_sa_interface = {
121 aac_sa_get_fwstatus,
122 aac_sa_qnotify,
123 aac_sa_get_istatus,
124 aac_sa_clear_istatus,
125 aac_sa_set_mailbox,
126 aac_sa_get_mailbox,
127 aac_sa_set_interrupts,
128 NULL, NULL, NULL

--- 8 unchanged lines hidden (view full) ---

137 u_int32_t arg0, u_int32_t arg1,
138 u_int32_t arg2, u_int32_t arg3);
139static int aac_rx_get_mailbox(struct aac_softc *sc, int mb);
140static void aac_rx_set_interrupts(struct aac_softc *sc, int enable);
141static int aac_rx_send_command(struct aac_softc *sc, struct aac_command *cm);
142static int aac_rx_get_outb_queue(struct aac_softc *sc);
143static void aac_rx_set_outb_queue(struct aac_softc *sc, int index);
144
121 aac_sa_get_fwstatus,
122 aac_sa_qnotify,
123 aac_sa_get_istatus,
124 aac_sa_clear_istatus,
125 aac_sa_set_mailbox,
126 aac_sa_get_mailbox,
127 aac_sa_set_interrupts,
128 NULL, NULL, NULL

--- 8 unchanged lines hidden (view full) ---

137 u_int32_t arg0, u_int32_t arg1,
138 u_int32_t arg2, u_int32_t arg3);
139static int aac_rx_get_mailbox(struct aac_softc *sc, int mb);
140static void aac_rx_set_interrupts(struct aac_softc *sc, int enable);
141static int aac_rx_send_command(struct aac_softc *sc, struct aac_command *cm);
142static int aac_rx_get_outb_queue(struct aac_softc *sc);
143static void aac_rx_set_outb_queue(struct aac_softc *sc, int index);
144
145struct aac_interface aac_rx_interface = {
145const struct aac_interface aac_rx_interface = {
146 aac_rx_get_fwstatus,
147 aac_rx_qnotify,
148 aac_rx_get_istatus,
149 aac_rx_clear_istatus,
150 aac_rx_set_mailbox,
151 aac_rx_get_mailbox,
152 aac_rx_set_interrupts,
153 aac_rx_send_command,

--- 10 unchanged lines hidden (view full) ---

164 u_int32_t arg0, u_int32_t arg1,
165 u_int32_t arg2, u_int32_t arg3);
166static int aac_rkt_get_mailbox(struct aac_softc *sc, int mb);
167static void aac_rkt_set_interrupts(struct aac_softc *sc, int enable);
168static int aac_rkt_send_command(struct aac_softc *sc, struct aac_command *cm);
169static int aac_rkt_get_outb_queue(struct aac_softc *sc);
170static void aac_rkt_set_outb_queue(struct aac_softc *sc, int index);
171
146 aac_rx_get_fwstatus,
147 aac_rx_qnotify,
148 aac_rx_get_istatus,
149 aac_rx_clear_istatus,
150 aac_rx_set_mailbox,
151 aac_rx_get_mailbox,
152 aac_rx_set_interrupts,
153 aac_rx_send_command,

--- 10 unchanged lines hidden (view full) ---

164 u_int32_t arg0, u_int32_t arg1,
165 u_int32_t arg2, u_int32_t arg3);
166static int aac_rkt_get_mailbox(struct aac_softc *sc, int mb);
167static void aac_rkt_set_interrupts(struct aac_softc *sc, int enable);
168static int aac_rkt_send_command(struct aac_softc *sc, struct aac_command *cm);
169static int aac_rkt_get_outb_queue(struct aac_softc *sc);
170static void aac_rkt_set_outb_queue(struct aac_softc *sc, int index);
171
172struct aac_interface aac_rkt_interface = {
172const struct aac_interface aac_rkt_interface = {
173 aac_rkt_get_fwstatus,
174 aac_rkt_qnotify,
175 aac_rkt_get_istatus,
176 aac_rkt_clear_istatus,
177 aac_rkt_set_mailbox,
178 aac_rkt_get_mailbox,
179 aac_rkt_set_interrupts,
180 aac_rkt_send_command,
181 aac_rkt_get_outb_queue,
182 aac_rkt_set_outb_queue
183};
184
185/* Debugging and Diagnostics */
173 aac_rkt_get_fwstatus,
174 aac_rkt_qnotify,
175 aac_rkt_get_istatus,
176 aac_rkt_clear_istatus,
177 aac_rkt_set_mailbox,
178 aac_rkt_get_mailbox,
179 aac_rkt_set_interrupts,
180 aac_rkt_send_command,
181 aac_rkt_get_outb_queue,
182 aac_rkt_set_outb_queue
183};
184
185/* Debugging and Diagnostics */
186static void aac_describe_controller(struct aac_softc *sc);
187static char *aac_describe_code(struct aac_code_lookup *table,
186static void aac_describe_controller(struct aac_softc *sc);
187static const char *aac_describe_code(const struct aac_code_lookup *table,
188 u_int32_t code);
189
190/* Management Interface */
191static d_open_t aac_open;
192static d_ioctl_t aac_ioctl;
193static d_poll_t aac_poll;
194static void aac_cdevpriv_dtor(void *arg);
195static int aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib);

--- 21 unchanged lines hidden (view full) ---

217 .d_ioctl = aac_ioctl,
218 .d_poll = aac_poll,
219 .d_name = "aac",
220};
221
222static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver");
223
224/* sysctl node */
188 u_int32_t code);
189
190/* Management Interface */
191static d_open_t aac_open;
192static d_ioctl_t aac_ioctl;
193static d_poll_t aac_poll;
194static void aac_cdevpriv_dtor(void *arg);
195static int aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib);

--- 21 unchanged lines hidden (view full) ---

217 .d_ioctl = aac_ioctl,
218 .d_poll = aac_poll,
219 .d_name = "aac",
220};
221
222static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver");
223
224/* sysctl node */
225static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters");
225SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters");
226
227/*
228 * Device Interface
229 */
230
231/*
232 * Initialize the controller and softc
233 */

--- 395 unchanged lines hidden (view full) ---

629 }
630 if (sc->aac_common_dmat)
631 bus_dma_tag_destroy(sc->aac_common_dmat);
632
633 /* disconnect the interrupt handler */
634 if (sc->aac_intr)
635 bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr);
636 if (sc->aac_irq != NULL)
226
227/*
228 * Device Interface
229 */
230
231/*
232 * Initialize the controller and softc
233 */

--- 395 unchanged lines hidden (view full) ---

629 }
630 if (sc->aac_common_dmat)
631 bus_dma_tag_destroy(sc->aac_common_dmat);
632
633 /* disconnect the interrupt handler */
634 if (sc->aac_intr)
635 bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr);
636 if (sc->aac_irq != NULL)
637 bus_release_resource(sc->aac_dev, SYS_RES_IRQ, sc->aac_irq_rid,
638 sc->aac_irq);
637 bus_release_resource(sc->aac_dev, SYS_RES_IRQ,
638 rman_get_rid(sc->aac_irq), sc->aac_irq);
639
640 /* destroy data-transfer DMA tag */
641 if (sc->aac_buffer_dmat)
642 bus_dma_tag_destroy(sc->aac_buffer_dmat);
643
644 /* destroy the parent DMA tag */
645 if (sc->aac_parent_dmat)
646 bus_dma_tag_destroy(sc->aac_parent_dmat);
647
648 /* release the register window mapping */
649 if (sc->aac_regs_res0 != NULL)
650 bus_release_resource(sc->aac_dev, SYS_RES_MEMORY,
639
640 /* destroy data-transfer DMA tag */
641 if (sc->aac_buffer_dmat)
642 bus_dma_tag_destroy(sc->aac_buffer_dmat);
643
644 /* destroy the parent DMA tag */
645 if (sc->aac_parent_dmat)
646 bus_dma_tag_destroy(sc->aac_parent_dmat);
647
648 /* release the register window mapping */
649 if (sc->aac_regs_res0 != NULL)
650 bus_release_resource(sc->aac_dev, SYS_RES_MEMORY,
651 sc->aac_regs_rid0, sc->aac_regs_res0);
651 rman_get_rid(sc->aac_regs_res0), sc->aac_regs_res0);
652 if (sc->aac_hwif == AAC_HWIF_NARK && sc->aac_regs_res1 != NULL)
653 bus_release_resource(sc->aac_dev, SYS_RES_MEMORY,
652 if (sc->aac_hwif == AAC_HWIF_NARK && sc->aac_regs_res1 != NULL)
653 bus_release_resource(sc->aac_dev, SYS_RES_MEMORY,
654 sc->aac_regs_rid1, sc->aac_regs_res1);
654 rman_get_rid(sc->aac_regs_res1), sc->aac_regs_res1);
655}
656
657/*
658 * Disconnect from the controller completely, in preparation for unload.
659 */
660int
661aac_detach(device_t dev)
662{

--- 665 unchanged lines hidden (view full) ---

1328 aac_release_command(cm);
1329
1330 /* fix up the bio based on status */
1331 if (status == ST_OK) {
1332 bp->bio_resid = 0;
1333 } else {
1334 bp->bio_error = EIO;
1335 bp->bio_flags |= BIO_ERROR;
655}
656
657/*
658 * Disconnect from the controller completely, in preparation for unload.
659 */
660int
661aac_detach(device_t dev)
662{

--- 665 unchanged lines hidden (view full) ---

1328 aac_release_command(cm);
1329
1330 /* fix up the bio based on status */
1331 if (status == ST_OK) {
1332 bp->bio_resid = 0;
1333 } else {
1334 bp->bio_error = EIO;
1335 bp->bio_flags |= BIO_ERROR;
1336 /* pass an error string out to the disk layer */
1337 bp->bio_driver1 = aac_describe_code(aac_command_status_table,
1338 status);
1339 }
1340 aac_biodone(bp);
1341}
1342
1343/*
1344 * Submit a command to the controller, return when it completes.
1345 * XXX This is very dangerous! If the card has gone out to lunch, we could
1346 * be stuck here forever. At the same time, signals are not caught

--- 335 unchanged lines hidden (view full) ---

1682
1683 sc->aac_common_busaddr = segs[0].ds_addr;
1684}
1685
1686static int
1687aac_check_firmware(struct aac_softc *sc)
1688{
1689 u_int32_t code, major, minor, options = 0, atu_size = 0;
1336 }
1337 aac_biodone(bp);
1338}
1339
1340/*
1341 * Submit a command to the controller, return when it completes.
1342 * XXX This is very dangerous! If the card has gone out to lunch, we could
1343 * be stuck here forever. At the same time, signals are not caught

--- 335 unchanged lines hidden (view full) ---

1679
1680 sc->aac_common_busaddr = segs[0].ds_addr;
1681}
1682
1683static int
1684aac_check_firmware(struct aac_softc *sc)
1685{
1686 u_int32_t code, major, minor, options = 0, atu_size = 0;
1690 int status;
1687 int rid, status;
1691 time_t then;
1692
1693 fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
1694 /*
1695 * Wait for the adapter to come ready.
1696 */
1697 then = time_uptime;
1698 do {

--- 61 unchanged lines hidden (view full) ---

1760 sc->flags |= AAC_FLAGS_ENABLE_CAM;
1761 if ((options & AAC_SUPPORTED_SGMAP_HOST64) != 0
1762 && (sizeof(bus_addr_t) > 4)) {
1763 device_printf(sc->aac_dev,
1764 "Enabling 64-bit address support\n");
1765 sc->flags |= AAC_FLAGS_SG_64BIT;
1766 }
1767 if ((options & AAC_SUPPORTED_NEW_COMM)
1688 time_t then;
1689
1690 fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
1691 /*
1692 * Wait for the adapter to come ready.
1693 */
1694 then = time_uptime;
1695 do {

--- 61 unchanged lines hidden (view full) ---

1757 sc->flags |= AAC_FLAGS_ENABLE_CAM;
1758 if ((options & AAC_SUPPORTED_SGMAP_HOST64) != 0
1759 && (sizeof(bus_addr_t) > 4)) {
1760 device_printf(sc->aac_dev,
1761 "Enabling 64-bit address support\n");
1762 sc->flags |= AAC_FLAGS_SG_64BIT;
1763 }
1764 if ((options & AAC_SUPPORTED_NEW_COMM)
1768 && sc->aac_if.aif_send_command)
1765 && sc->aac_if->aif_send_command)
1769 sc->flags |= AAC_FLAGS_NEW_COMM;
1770 if (options & AAC_SUPPORTED_64BIT_ARRAYSIZE)
1771 sc->flags |= AAC_FLAGS_ARRAY_64BIT;
1772 }
1773
1774 /* Check for broken hardware that does a lower number of commands */
1775 sc->aac_max_fibs = (sc->flags & AAC_FLAGS_256FIBS ? 256:512);
1776
1777 /* Remap mem. resource, if required */
1778 if ((sc->flags & AAC_FLAGS_NEW_COMM) &&
1766 sc->flags |= AAC_FLAGS_NEW_COMM;
1767 if (options & AAC_SUPPORTED_64BIT_ARRAYSIZE)
1768 sc->flags |= AAC_FLAGS_ARRAY_64BIT;
1769 }
1770
1771 /* Check for broken hardware that does a lower number of commands */
1772 sc->aac_max_fibs = (sc->flags & AAC_FLAGS_256FIBS ? 256:512);
1773
1774 /* Remap mem. resource, if required */
1775 if ((sc->flags & AAC_FLAGS_NEW_COMM) &&
1779 atu_size > rman_get_size(sc->aac_regs_res1)) {
1780 bus_release_resource(
1781 sc->aac_dev, SYS_RES_MEMORY,
1782 sc->aac_regs_rid1, sc->aac_regs_res1);
1783 sc->aac_regs_res1 = bus_alloc_resource(
1784 sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid1,
1785 0ul, ~0ul, atu_size, RF_ACTIVE);
1776 atu_size > rman_get_size(sc->aac_regs_res1)) {
1777 rid = rman_get_rid(sc->aac_regs_res1);
1778 bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, rid,
1779 sc->aac_regs_res1);
1780 sc->aac_regs_res1 = bus_alloc_resource(sc->aac_dev,
1781 SYS_RES_MEMORY, &rid, 0ul, ~0ul, atu_size, RF_ACTIVE);
1786 if (sc->aac_regs_res1 == NULL) {
1787 sc->aac_regs_res1 = bus_alloc_resource_any(
1782 if (sc->aac_regs_res1 == NULL) {
1783 sc->aac_regs_res1 = bus_alloc_resource_any(
1788 sc->aac_dev, SYS_RES_MEMORY,
1789 &sc->aac_regs_rid1, RF_ACTIVE);
1784 sc->aac_dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
1790 if (sc->aac_regs_res1 == NULL) {
1791 device_printf(sc->aac_dev,
1792 "couldn't allocate register window\n");
1793 return (ENXIO);
1794 }
1795 sc->flags &= ~AAC_FLAGS_NEW_COMM;
1796 }
1797 sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1);
1798 sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1);
1799
1800 if (sc->aac_hwif == AAC_HWIF_NARK) {
1801 sc->aac_regs_res0 = sc->aac_regs_res1;
1785 if (sc->aac_regs_res1 == NULL) {
1786 device_printf(sc->aac_dev,
1787 "couldn't allocate register window\n");
1788 return (ENXIO);
1789 }
1790 sc->flags &= ~AAC_FLAGS_NEW_COMM;
1791 }
1792 sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1);
1793 sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1);
1794
1795 if (sc->aac_hwif == AAC_HWIF_NARK) {
1796 sc->aac_regs_res0 = sc->aac_regs_res1;
1802 sc->aac_regs_rid0 = sc->aac_regs_rid1;
1803 sc->aac_btag0 = sc->aac_btag1;
1804 sc->aac_bhandle0 = sc->aac_bhandle1;
1805 }
1806 }
1807
1808 /* Read preferred settings */
1809 sc->aac_max_fib_size = sizeof(struct aac_fib);
1810 sc->aac_max_sectors = 128; /* 64KB */

--- 187 unchanged lines hidden (view full) ---

1998 error = 0;
1999out:
2000 return(error);
2001}
2002
2003static int
2004aac_setup_intr(struct aac_softc *sc)
2005{
1797 sc->aac_btag0 = sc->aac_btag1;
1798 sc->aac_bhandle0 = sc->aac_bhandle1;
1799 }
1800 }
1801
1802 /* Read preferred settings */
1803 sc->aac_max_fib_size = sizeof(struct aac_fib);
1804 sc->aac_max_sectors = 128; /* 64KB */

--- 187 unchanged lines hidden (view full) ---

1992 error = 0;
1993out:
1994 return(error);
1995}
1996
1997static int
1998aac_setup_intr(struct aac_softc *sc)
1999{
2006 sc->aac_irq_rid = 0;
2007 if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ,
2008 &sc->aac_irq_rid,
2009 RF_SHAREABLE |
2010 RF_ACTIVE)) == NULL) {
2011 device_printf(sc->aac_dev, "can't allocate interrupt\n");
2012 return (EINVAL);
2013 }
2000
2014 if (sc->flags & AAC_FLAGS_NEW_COMM) {
2015 if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
2016 INTR_MPSAFE|INTR_TYPE_BIO, NULL,
2017 aac_new_intr, sc, &sc->aac_intr)) {
2018 device_printf(sc->aac_dev, "can't set up interrupt\n");
2019 return (EINVAL);
2020 }
2021 } else {

--- 92 unchanged lines hidden (view full) ---

2114}
2115
2116/*
2117 * Adapter-space FIB queue manipulation
2118 *
2119 * Note that the queue implementation here is a little funky; neither the PI or
2120 * CI will ever be zero. This behaviour is a controller feature.
2121 */
2001 if (sc->flags & AAC_FLAGS_NEW_COMM) {
2002 if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
2003 INTR_MPSAFE|INTR_TYPE_BIO, NULL,
2004 aac_new_intr, sc, &sc->aac_intr)) {
2005 device_printf(sc->aac_dev, "can't set up interrupt\n");
2006 return (EINVAL);
2007 }
2008 } else {

--- 92 unchanged lines hidden (view full) ---

2101}
2102
2103/*
2104 * Adapter-space FIB queue manipulation
2105 *
2106 * Note that the queue implementation here is a little funky; neither the PI or
2107 * CI will ever be zero. This behaviour is a controller feature.
2108 */
2122static struct {
2109static const struct {
2123 int size;
2124 int notify;
2125} aac_qinfo[] = {
2126 {AAC_HOST_NORM_CMD_ENTRIES, AAC_DB_COMMAND_NOT_FULL},
2127 {AAC_HOST_HIGH_CMD_ENTRIES, 0},
2128 {AAC_ADAP_NORM_CMD_ENTRIES, AAC_DB_COMMAND_READY},
2129 {AAC_ADAP_HIGH_CMD_ENTRIES, 0},
2130 {AAC_HOST_NORM_RESP_ENTRIES, AAC_DB_RESPONSE_NOT_FULL},

--- 650 unchanged lines hidden (view full) ---

2781 aac_release_sync_fib(sc);
2782 mtx_unlock(&sc->aac_io_lock);
2783}
2784
2785/*
2786 * Look up a text description of a numeric error code and return a pointer to
2787 * same.
2788 */
2110 int size;
2111 int notify;
2112} aac_qinfo[] = {
2113 {AAC_HOST_NORM_CMD_ENTRIES, AAC_DB_COMMAND_NOT_FULL},
2114 {AAC_HOST_HIGH_CMD_ENTRIES, 0},
2115 {AAC_ADAP_NORM_CMD_ENTRIES, AAC_DB_COMMAND_READY},
2116 {AAC_ADAP_HIGH_CMD_ENTRIES, 0},
2117 {AAC_HOST_NORM_RESP_ENTRIES, AAC_DB_RESPONSE_NOT_FULL},

--- 650 unchanged lines hidden (view full) ---

2768 aac_release_sync_fib(sc);
2769 mtx_unlock(&sc->aac_io_lock);
2770}
2771
2772/*
2773 * Look up a text description of a numeric error code and return a pointer to
2774 * same.
2775 */
2789static char *
2790aac_describe_code(struct aac_code_lookup *table, u_int32_t code)
2776static const char *
2777aac_describe_code(const struct aac_code_lookup *table, u_int32_t code)
2791{
2792 int i;
2793
2794 for (i = 0; table[i].string != NULL; i++)
2795 if (table[i].code == code)
2796 return(table[i].string);
2797 return(table[i + 1].string);
2798}

--- 1008 unchanged lines hidden ---
2778{
2779 int i;
2780
2781 for (i = 0; table[i].string != NULL; i++)
2782 if (table[i].code == code)
2783 return(table[i].string);
2784 return(table[i + 1].string);
2785}

--- 1008 unchanged lines hidden ---