aic7xxx.c (46099) | aic7xxx.c (46581) |
---|---|
1/* 2 * Generic driver for the aic7xxx based adaptec SCSI controllers 3 * Product specific probe and attach routines can be found in: 4 * i386/eisa/ahc_eisa.c 27/284X and aic7770 motherboard controllers 5 * pci/ahc_pci.c 3985, 3980, 3940, 2940, aic7895, aic7890, 6 * aic7880, aic7870, aic7860, and aic7850 controllers 7 * 8 * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999 Justin T. Gibbs. --- 22 unchanged lines hidden (view full) --- 31 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * | 1/* 2 * Generic driver for the aic7xxx based adaptec SCSI controllers 3 * Product specific probe and attach routines can be found in: 4 * i386/eisa/ahc_eisa.c 27/284X and aic7770 motherboard controllers 5 * pci/ahc_pci.c 3985, 3980, 3940, 2940, aic7895, aic7890, 6 * aic7880, aic7870, aic7860, and aic7850 controllers 7 * 8 * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999 Justin T. Gibbs. --- 22 unchanged lines hidden (view full) --- 31 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * |
39 * $Id: aic7xxx.c,v 1.23 1999/04/23 23:27:29 gibbs Exp $ | 39 * $Id: aic7xxx.c,v 1.24 1999/04/26 22:03:44 ken Exp $ |
40 */ 41/* 42 * A few notes on features of the driver. 43 * 44 * SCB paging takes advantage of the fact that devices stay disconnected 45 * from the bus a relatively long time and that while they're disconnected, 46 * having the SCBs for these transactions down on the host adapter is of 47 * little use. Instead of leaving this idle SCB down on the card we copy --- 1044 unchanged lines hidden (view full) --- 1092 struct ahc_initiator_tinfo *tinfo, 1093 int force, int paused) 1094{ 1095 u_int targ_msg_req_orig; 1096 1097 targ_msg_req_orig = ahc->targ_msg_req; 1098 if (tinfo->current.period != tinfo->goal.period 1099 || tinfo->current.width != tinfo->goal.width | 40 */ 41/* 42 * A few notes on features of the driver. 43 * 44 * SCB paging takes advantage of the fact that devices stay disconnected 45 * from the bus a relatively long time and that while they're disconnected, 46 * having the SCBs for these transactions down on the host adapter is of 47 * little use. Instead of leaving this idle SCB down on the card we copy --- 1044 unchanged lines hidden (view full) --- 1092 struct ahc_initiator_tinfo *tinfo, 1093 int force, int paused) 1094{ 1095 u_int targ_msg_req_orig; 1096 1097 targ_msg_req_orig = ahc->targ_msg_req; 1098 if (tinfo->current.period != tinfo->goal.period 1099 || tinfo->current.width != tinfo->goal.width |
1100 || tinfo->current.offset != tinfo->goal.offset |
|
1100 || (force 1101 && (tinfo->goal.period != 0 1102 || tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT))) 1103 ahc->targ_msg_req |= devinfo->target_mask; 1104 else 1105 ahc->targ_msg_req &= ~devinfo->target_mask; 1106 1107 if (ahc->targ_msg_req != targ_msg_req_orig) { --- 3367 unchanged lines hidden (view full) --- 4475 default: 4476 cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT; 4477 break; 4478 } 4479 ahc_set_width(ahc, &devinfo, cts->ccb_h.path, 4480 cts->bus_width, update_type); 4481 } 4482 | 1101 || (force 1102 && (tinfo->goal.period != 0 1103 || tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT))) 1104 ahc->targ_msg_req |= devinfo->target_mask; 1105 else 1106 ahc->targ_msg_req &= ~devinfo->target_mask; 1107 1108 if (ahc->targ_msg_req != targ_msg_req_orig) { --- 3367 unchanged lines hidden (view full) --- 4476 default: 4477 cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT; 4478 break; 4479 } 4480 ahc_set_width(ahc, &devinfo, cts->ccb_h.path, 4481 cts->bus_width, update_type); 4482 } 4483 |
4483 if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) { | 4484 if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) 4485 || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) { |
4484 struct ahc_syncrate *syncrate; 4485 u_int maxsync; 4486 4487 if ((ahc->features & AHC_ULTRA2) != 0) 4488 maxsync = AHC_SYNCRATE_ULTRA2; 4489 else if ((ahc->features & AHC_ULTRA) != 0) 4490 maxsync = AHC_SYNCRATE_ULTRA; 4491 else 4492 maxsync = AHC_SYNCRATE_FAST; 4493 4494 if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0) { 4495 if (update_type & AHC_TRANS_USER) 4496 cts->sync_offset = tinfo->user.offset; 4497 else 4498 cts->sync_offset = tinfo->goal.offset; 4499 } 4500 | 4486 struct ahc_syncrate *syncrate; 4487 u_int maxsync; 4488 4489 if ((ahc->features & AHC_ULTRA2) != 0) 4490 maxsync = AHC_SYNCRATE_ULTRA2; 4491 else if ((ahc->features & AHC_ULTRA) != 0) 4492 maxsync = AHC_SYNCRATE_ULTRA; 4493 else 4494 maxsync = AHC_SYNCRATE_FAST; 4495 4496 if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0) { 4497 if (update_type & AHC_TRANS_USER) 4498 cts->sync_offset = tinfo->user.offset; 4499 else 4500 cts->sync_offset = tinfo->goal.offset; 4501 } 4502 |
4503 if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) == 0) { 4504 if (update_type & AHC_TRANS_USER) 4505 cts->sync_period = tinfo->user.period; 4506 else 4507 cts->sync_period = tinfo->goal.period; 4508 } 4509 |
|
4501 syncrate = ahc_find_syncrate(ahc, &cts->sync_period, 4502 maxsync); 4503 ahc_validate_offset(ahc, syncrate, &cts->sync_offset, 4504 MSG_EXT_WDTR_BUS_8_BIT); 4505 4506 /* We use a period of 0 to represent async */ 4507 if (cts->sync_offset == 0) 4508 cts->sync_period = 0; --- 131 unchanged lines hidden (view full) --- 4640 if ((ahc->flags & AHC_RESET_BUS_B) == 0) 4641 cpi->hba_misc |= PIM_NOBUSRESET; 4642 } else { 4643 cpi->initiator_id = ahc->our_id; 4644 if ((ahc->flags & AHC_RESET_BUS_A) == 0) 4645 cpi->hba_misc |= PIM_NOBUSRESET; 4646 } 4647 cpi->bus_id = cam_sim_bus(sim); | 4510 syncrate = ahc_find_syncrate(ahc, &cts->sync_period, 4511 maxsync); 4512 ahc_validate_offset(ahc, syncrate, &cts->sync_offset, 4513 MSG_EXT_WDTR_BUS_8_BIT); 4514 4515 /* We use a period of 0 to represent async */ 4516 if (cts->sync_offset == 0) 4517 cts->sync_period = 0; --- 131 unchanged lines hidden (view full) --- 4649 if ((ahc->flags & AHC_RESET_BUS_B) == 0) 4650 cpi->hba_misc |= PIM_NOBUSRESET; 4651 } else { 4652 cpi->initiator_id = ahc->our_id; 4653 if ((ahc->flags & AHC_RESET_BUS_A) == 0) 4654 cpi->hba_misc |= PIM_NOBUSRESET; 4655 } 4656 cpi->bus_id = cam_sim_bus(sim); |
4657 cpi->base_transfer_speed = 3300; |
|
4648 strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); 4649 strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN); 4650 strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); 4651 cpi->unit_number = cam_sim_unit(sim); 4652 cpi->ccb_h.status = CAM_REQ_CMP; 4653 xpt_done(ccb); 4654 break; 4655 } --- 1594 unchanged lines hidden --- | 4658 strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); 4659 strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN); 4660 strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); 4661 cpi->unit_number = cam_sim_unit(sim); 4662 cpi->ccb_h.status = CAM_REQ_CMP; 4663 xpt_done(ccb); 4664 break; 4665 } --- 1594 unchanged lines hidden --- |