Deleted Added
sdiff udiff text old ( 39852 ) new ( 39881 )
full compact
1/*
2 * Generic register and struct definitions for the Adaptech 154x/164x
3 * SCSI host adapters. Product specific probe and attach routines can
4 * be found in:
5 * aha 1540/1542B/1542C/1542CF/1542CP aha_isa.c
6 *
7 * Copyright (c) 1998 M. Warner Losh.
8 * All Rights Reserved.

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

50 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
52 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
53 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
54 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
55 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 * SUCH DAMAGE.
57 *
58 * $Id: aha.c,v 1.6 1998/10/01 04:53:55 imp Exp $
59 */
60
61#include <sys/param.h>
62#include <sys/systm.h>
63#include <sys/malloc.h>
64#include <sys/buf.h>
65#include <sys/kernel.h>
66#include <sys/sysctl.h>

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

80#include <vm/vm.h>
81#include <vm/pmap.h>
82
83#include <dev/aha/ahareg.h>
84
85struct aha_softc *aha_softcs[NAHA];
86
87#define MIN(a, b) ((a) < (b) ? (a) : (b))
88#define PRVERB(x) if (bootverbose) printf x
89
90/* Macro to determine that a rev is potentially a new valid one
91 * so that the driver doesn't keep breaking on new revs as it
92 * did for the CF and CP.
93 */
94#define PROBABLY_NEW_BOARD(REV) (REV > 0x43 && REV < 0x56)
95
96/* MailBox Management functions */

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

307 /*
308 * Get the board ID. We use this to see if we're dealing with
309 * a buslogic card or a aha card (or clone).
310 */
311 error = aha_cmd(aha, BOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0,
312 (u_int8_t*)&board_id, sizeof(board_id),
313 DEFAULT_CMD_TIMEOUT);
314 if (error != 0) {
315 PRVERB(("%s: INQUIRE failed %x\n", aha_name(aha), error));
316 return (ENXIO);
317 }
318 aha->fw_major = board_id.firmware_rev_major;
319 aha->fw_minor = board_id.firmware_rev_minor;
320 aha->boardid = board_id.board_type;
321
322 /*
323 * The Buslogic cards have an id of either 0x41 or 0x42. So

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

1364 timeout = 5 * 10000;
1365 while (--timeout) {
1366 status = aha_inb(aha, STATUS_REG);
1367 if ((status & DIAG_ACTIVE) != 0)
1368 break;
1369 DELAY(100);
1370 }
1371 if (timeout == 0) {
1372 PRVERB(("%s: ahareset - Diagnostic Active failed to "
1373 "assert. status = 0x%x\n", aha_name(aha),
1374 status));
1375 return (ETIMEDOUT);
1376 }
1377
1378 /* Wait 10sec. for Diagnostic end */
1379 timeout = 10 * 10000;
1380 while (--timeout) {
1381 status = aha_inb(aha, STATUS_REG);
1382 if ((status & DIAG_ACTIVE) == 0)

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

1558 s = splcam();
1559 aha_intr(aha);
1560 splx(s);
1561
1562 /*
1563 * If the command was rejected by the controller, tell the caller.
1564 */
1565 if ((status & CMD_INVALID) != 0) {
1566 PRVERB(("%s: Invalid Command 0x%x\n", aha_name(aha), opcode));
1567 /*
1568 * Some early adapters may not recover properly from
1569 * an invalid command. If it appears that the controller
1570 * has wedged (i.e. status was not cleared by our interrupt
1571 * reset above), perform a soft reset.
1572 */
1573 DELAY(1000);
1574 status = aha_inb(aha, STATUS_REG);

--- 236 unchanged lines hidden ---