Deleted Added
full compact
32c32
< * $Id: bt.c,v 1.7 1998/10/15 23:46:28 gibbs Exp $
---
> * $Id: bt.c,v 1.8 1998/10/30 02:06:44 gibbs Exp $
184,189c184,189
< { 0x330, 0 },
< { 0x334, 0 },
< { 0x230, 0 },
< { 0x234, 0 },
< { 0x130, 0 },
< { 0x134, 0 }
---
> { 0x130, 0, 4 },
> { 0x134, 0, 5 },
> { 0x230, 0, 2 },
> { 0x234, 0, 3 },
> { 0x330, 0, 0 },
> { 0x334, 0, 1 }
191a192,205
> /*
> * I/O ports listed in the order enumerated by the
> * card for certain op codes.
> */
> u_int16_t bt_board_ports[] =
> {
> 0x330,
> 0x334,
> 0x230,
> 0x234,
> 0x130,
> 0x134
> };
>
817c831
< for (i=0; i < BT_NUM_ISAPORTS; i++) {
---
> for (i = 0; i < BT_NUM_ISAPORTS; i++) {
829,834d842
< u_int
< bt_fetch_isa_iop(isa_compat_io_t port)
< {
< return (bt_isa_ports[port].addr);
< }
<
839c847
< bt_isa_ports[port].probed = 1;
---
> bt_mark_probed_iop(bt_board_ports[port]);
854a863,900
> void
> bt_find_probe_range(int ioport, int *port_index, int *max_port_index)
> {
> if (ioport > 0) {
> int i;
>
> for (i = 0;i < BT_NUM_ISAPORTS; i++)
> if (ioport <= bt_isa_ports[i].addr)
> break;
> if ((i >= BT_NUM_ISAPORTS)
> || (ioport != bt_isa_ports[i].addr)) {
> printf("
> bt_isa_probe: Invalid baseport of 0x%x specified.
> bt_isa_probe: Nearest valid baseport is 0x%x.
> bt_isa_probe: Failing probe.\n",
> ioport,
> (i < BT_NUM_ISAPORTS)
> ? bt_isa_ports[i].addr
> : bt_isa_ports[BT_NUM_ISAPORTS - 1].addr);
> *port_index = *max_port_index = -1;
> return;
> }
> *port_index = *max_port_index = bt_isa_ports[i].bio;
> } else {
> *port_index = 0;
> *max_port_index = BT_NUM_ISAPORTS - 1;
> }
> }
>
> int
> bt_iop_from_bio(isa_compat_io_t bio_index)
> {
> if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS)
> return (bt_board_ports[bio_index]);
> return (-1);
> }
>
>
926a973
> bt->active_ccbs--;
938a986
> bt->active_ccbs++;
944c992
< else
---
> else {
945a994,995
> bt->active_ccbs++;
> }
1350,1351c1400,1420
< if (bt->cur_outbox->action_code != BMBO_FREE)
< panic("%s: Too few mailboxes or to many ccbs???", bt_name(bt));
---
> if (bt->cur_outbox->action_code != BMBO_FREE) {
> /*
> * We should never encounter a busy mailbox.
> * If we do, warn the user, and treat it as
> * a resource shortage. If the controller is
> * hung, one of the pending transactions will
> * timeout causing us to start recovery operations.
> */
> printf("%s: Encountered busy mailbox with %d out of %d "
> "commands active!!!", bt_name(bt), bt->active_ccbs,
> bt->max_ccbs);
> untimeout(bttimeout, bccb, ccb->ccb_h.timeout_ch);
> if (nseg != 0)
> bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap);
> btfreeccb(bt, bccb);
> bt->resource_shortage = TRUE;
> xpt_freeze_simq(bt->sim, /*count*/1);
> ccb->ccb_h.status = CAM_REQUEUE_REQ;
> xpt_done(ccb);
> return;
> }
1472,1475c1541,1544
< #if 0
< printf("bt: ccb %x - error %x occured. btstat = %x, sdstat = %x\n",
< bccb, comp_code, bccb->hccb.btstat, bccb->hccb.sdstat);
< #endif
---
> printf("bt: ccb %p - error %x occured. "
> "btstat = %x, sdstat = %x\n",
> (void *)bccb, comp_code, bccb->hccb.btstat,
> bccb->hccb.sdstat);
1479c1548,1554
< if (bccb->hccb.data_len <= 0) {
---
> if (bccb->hccb.data_len == 0) {
> /*
> * At least firmware 4.22, does this
> * for a QUEUE FULL condition.
> */
> bccb->hccb.sdstat = SCSI_STATUS_QUEUE_FULL;
> } else if (bccb->hccb.data_len < 0) {