Deleted Added
sdiff udiff text old ( 140687 ) new ( 140688 )
full compact
1/*-
2 * Copyright (c) 1999,2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * Copyright (c) 2005 Scott Long
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28/*-
29 * Copyright (c) 2002 Eric Moore
30 * Copyright (c) 2002 LSI Logic Corporation
31 * All rights reserved.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright

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

51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE.
56 */
57
58#include <sys/cdefs.h>
59__FBSDID("$FreeBSD: head/sys/dev/amr/amr.c 140687 2005-01-23 23:22:34Z scottl $");
60
61/*
62 * Driver for the AMI MegaRaid family of controllers.
63 */
64
65#include <sys/param.h>
66#include <sys/systm.h>
67#include <sys/malloc.h>

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

458 debug(1, "unknown ioctl 0x%lx", cmd);
459 return(ENOIOCTL);
460 }
461
462 error = 0;
463 dp = NULL;
464 ac = NULL;
465
466 /* handle inbound data buffer */
467 if (au_length != 0) {
468 if ((dp = malloc(au_length, M_DEVBUF, M_WAITOK)) == NULL)
469 return(ENOMEM);
470
471 if ((error = copyin(au_buffer, dp, au_length)) != 0) {
472 free(dp, M_DEVBUF);
473 return (error);
474 }
475 debug(2, "copyin %ld bytes from %p -> %p", au_length, au_buffer, dp);

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

1044 return (error);
1045}
1046
1047static int
1048amr_quartz_poll_command1(struct amr_softc *sc, struct amr_command *ac)
1049{
1050 int count, error;
1051
1052 if ((sc->amr_state & AMR_STATE_CRASHDUMP) == 0) {
1053 count=0;
1054 while (sc->amr_busyslots) {
1055 msleep(sc, &sc->amr_io_lock, PRIBIO | PCATCH, "amrpoll", hz);
1056 if(count++>10) {
1057 break;
1058 }
1059 }
1060

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

1919int
1920amr_dump_blocks(struct amr_softc *sc, int unit, u_int32_t lba, void *data, int blks)
1921{
1922 struct amr_command *ac;
1923 int error = EIO;
1924
1925 debug_called(1);
1926
1927 sc->amr_state |= AMR_STATE_CRASHDUMP;
1928
1929 /* get ourselves a command buffer */
1930 if ((ac = amr_alloccmd(sc)) == NULL)
1931 goto out;
1932 /* set command flags */
1933 ac->ac_flags |= AMR_CMD_PRIORITY | AMR_CMD_DATAOUT;
1934
1935 /* point the command at our data */

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

1946 if (sc->amr_poll_command(ac))
1947 goto out;
1948 error = ac->ac_status;
1949
1950 out:
1951 if (ac != NULL)
1952 amr_releasecmd(ac);
1953
1954 sc->amr_state &= ~AMR_STATE_CRASHDUMP;
1955 return (error);
1956}
1957
1958
1959
1960#ifdef AMR_DEBUG
1961/********************************************************************************
1962 * Print the command (ac) in human-readable format

--- 25 unchanged lines hidden ---