aic7xxx_osm.c (66800) | aic7xxx_osm.c (66845) |
---|---|
1/* 2 * Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers 3 * 4 * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000 Justin T. Gibbs. 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 --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * $Id$ 32 * | 1/* 2 * Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers 3 * 4 * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000 Justin T. Gibbs. 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 --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * $Id$ 32 * |
33 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx_osm.c 66800 2000-10-08 03:37:52Z gibbs $ | 33 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx_osm.c 66845 2000-10-09 01:46:01Z gibbs $ |
34 */ 35 36#include <dev/aic7xxx/aic7xxx_freebsd.h> 37#include <dev/aic7xxx/aic7xxx_inline.h> 38 39#include <sys/eventhandler.h> 40 41#ifndef AHC_TMODE_ENABLE --- 1495 unchanged lines hidden (view full) --- 1537 1538 /* Will clear us from the bus */ 1539 restart_sequencer(ahc); 1540 ahc_unlock(ahc, &s); 1541 return; 1542 } 1543 1544 ahc_set_recoveryscb(ahc, active_scb); | 34 */ 35 36#include <dev/aic7xxx/aic7xxx_freebsd.h> 37#include <dev/aic7xxx/aic7xxx_inline.h> 38 39#include <sys/eventhandler.h> 40 41#ifndef AHC_TMODE_ENABLE --- 1495 unchanged lines hidden (view full) --- 1537 1538 /* Will clear us from the bus */ 1539 restart_sequencer(ahc); 1540 ahc_unlock(ahc, &s); 1541 return; 1542 } 1543 1544 ahc_set_recoveryscb(ahc, active_scb); |
1545 ahc_outb(ahc, MSG_OUT, MSG_BUS_DEV_RESET); | 1545 ahc_outb(ahc, MSG_OUT, HOST_MSG); |
1546 ahc_outb(ahc, SCSISIGO, last_phase|ATNO); 1547 ahc_print_path(ahc, active_scb); 1548 printf("BDR message in message buffer\n"); 1549 active_scb->flags |= SCB_DEVICE_RESET; 1550 active_scb->io_ctx->ccb_h.timeout_ch = 1551 timeout(ahc_timeout, (caddr_t)active_scb, 2 * hz); 1552 unpause_sequencer(ahc); 1553 } else { --- 22 unchanged lines hidden (view full) --- 1576 disconnected = TRUE; 1577 } 1578 1579 if (disconnected) { 1580 struct scb *prev_scb; 1581 1582 ahc_set_recoveryscb(ahc, scb); 1583 /* | 1546 ahc_outb(ahc, SCSISIGO, last_phase|ATNO); 1547 ahc_print_path(ahc, active_scb); 1548 printf("BDR message in message buffer\n"); 1549 active_scb->flags |= SCB_DEVICE_RESET; 1550 active_scb->io_ctx->ccb_h.timeout_ch = 1551 timeout(ahc_timeout, (caddr_t)active_scb, 2 * hz); 1552 unpause_sequencer(ahc); 1553 } else { --- 22 unchanged lines hidden (view full) --- 1576 disconnected = TRUE; 1577 } 1578 1579 if (disconnected) { 1580 struct scb *prev_scb; 1581 1582 ahc_set_recoveryscb(ahc, scb); 1583 /* |
1584 * Simply set the MK_MESSAGE control bit. 1585 */ 1586 scb->hscb->control |= MK_MESSAGE; 1587 scb->flags |= SCB_QUEUED_MSG 1588 | SCB_DEVICE_RESET; 1589 1590 /* | |
1591 * Actually re-queue this SCB in an attempt 1592 * to select the device before it reconnects. 1593 * In either case (selection or reselection), 1594 * we will now issue a target reset to the 1595 * timed-out device. 1596 * | 1584 * Actually re-queue this SCB in an attempt 1585 * to select the device before it reconnects. 1586 * In either case (selection or reselection), 1587 * we will now issue a target reset to the 1588 * timed-out device. 1589 * |
1590 * Set the MK_MESSAGE control bit indicating 1591 * that we desire to send a message. We 1592 * also set the disconnected flag since 1593 * in the paging case there is no guarantee 1594 * that our SCB control byte matches the 1595 * version on the card. We don't want the 1596 * sequencer to abort the command thinking 1597 * an unsolicited reselection occurred. 1598 */ 1599 scb->hscb->control |= MK_MESSAGE|DISCONNECTED; 1600 scb->flags |= SCB_DEVICE_RESET; 1601 1602 /* |
|
1597 * Remove any cached copy of this SCB in the 1598 * disconnected list in preparation for the 1599 * queuing of our abort SCB. We use the 1600 * same element in the SCB, SCB_NEXT, for 1601 * both the qinfifo and the disconnected list. 1602 */ 1603 ahc_search_disc_list(ahc, target, channel, 1604 lun, scb->hscb->tag, 1605 /*stop_on_first*/TRUE, 1606 /*remove*/TRUE, | 1603 * Remove any cached copy of this SCB in the 1604 * disconnected list in preparation for the 1605 * queuing of our abort SCB. We use the 1606 * same element in the SCB, SCB_NEXT, for 1607 * both the qinfifo and the disconnected list. 1608 */ 1609 ahc_search_disc_list(ahc, target, channel, 1610 lun, scb->hscb->tag, 1611 /*stop_on_first*/TRUE, 1612 /*remove*/TRUE, |
1607 /*save_state*/TRUE); | 1613 /*save_state*/FALSE); |
1608 1609 /* | 1614 1615 /* |
1616 * In the non-paging case, the sequencer will 1617 * never re-reference the in-core SCB. 1618 * To make sure we are notified during 1619 * reslection, set the MK_MESSAGE flag in 1620 * the card's copy of the SCB. 1621 */ 1622 if ((ahc->flags & AHC_PAGESCBS) != 0) { 1623 ahc_outb(ahc, SCBPTR, scb->hscb->tag); 1624 ahc_outb(ahc, SCB_CONTROL, 1625 ahc_inb(ahc, SCB_CONTROL) 1626 | MK_MESSAGE); 1627 } 1628 1629 /* |
|
1610 * Clear out any entries in the QINFIFO first 1611 * so we are the next SCB for this target 1612 * to run. 1613 */ 1614 ahc_search_qinfifo(ahc, 1615 SCB_GET_TARGET(ahc, scb), 1616 channel, SCB_GET_LUN(scb), 1617 SCB_LIST_NULL, --- 7 unchanged lines hidden (view full) --- 1625 u_int prev_tag; 1626 1627 prev_tag = 1628 ahc->qinfifo[ahc->qinfifonext - 1]; 1629 prev_scb = ahc_lookup_scb(ahc, 1630 prev_tag); 1631 } 1632 ahc_qinfifo_requeue(ahc, prev_scb, scb); | 1630 * Clear out any entries in the QINFIFO first 1631 * so we are the next SCB for this target 1632 * to run. 1633 */ 1634 ahc_search_qinfifo(ahc, 1635 SCB_GET_TARGET(ahc, scb), 1636 channel, SCB_GET_LUN(scb), 1637 SCB_LIST_NULL, --- 7 unchanged lines hidden (view full) --- 1645 u_int prev_tag; 1646 1647 prev_tag = 1648 ahc->qinfifo[ahc->qinfifonext - 1]; 1649 prev_scb = ahc_lookup_scb(ahc, 1650 prev_tag); 1651 } 1652 ahc_qinfifo_requeue(ahc, prev_scb, scb); |
1653 ahc_outb(ahc, SCBPTR, active_scb_index); |
|
1633 scb->io_ctx->ccb_h.timeout_ch = 1634 timeout(ahc_timeout, (caddr_t)scb, 2 * hz); 1635 unpause_sequencer(ahc); 1636 } else { 1637 /* Go "immediatly" to the bus reset */ 1638 /* This shouldn't happen */ 1639 ahc_set_recoveryscb(ahc, scb); 1640 ahc_print_path(ahc, scb); --- 201 unchanged lines hidden --- | 1654 scb->io_ctx->ccb_h.timeout_ch = 1655 timeout(ahc_timeout, (caddr_t)scb, 2 * hz); 1656 unpause_sequencer(ahc); 1657 } else { 1658 /* Go "immediatly" to the bus reset */ 1659 /* This shouldn't happen */ 1660 ahc_set_recoveryscb(ahc, scb); 1661 ahc_print_path(ahc, scb); --- 201 unchanged lines hidden --- |