Lines Matching defs:hd

141 	struct scsidevice *hd = hs->sc_spc;
149 hd->scsi_sctl = SCTL_DISABLE | SCTL_CTRLRST;
150 hd->scsi_scmd = 0;
151 hd->scsi_pctl = 0;
152 hd->scsi_temp = 0;
153 hd->scsi_tch = 0;
154 hd->scsi_tcm = 0;
155 hd->scsi_tcl = 0;
156 hd->scsi_ints = 0;
165 hd->scsi_bdid = SCSI_ID;
166 hd->scsi_sctl = SCTL_DISABLE | SCTL_ABRT_ENAB|
172 hd->scsi_sctl &= ~SCTL_DISABLE;
290 issue_select(struct scsidevice *hd, uint8_t target)
293 hd->scsi_pctl = 0;
294 hd->scsi_temp = (1 << SCSI_ID) | (1 << target);
297 hd->scsi_tch = 2;
298 hd->scsi_tcm = 113;
299 hd->scsi_tcl = 3;
301 hd->scsi_scmd = SCMD_SELECT;
319 ixfer_start(struct scsidevice *hd, int len, uint8_t phase, int wait)
322 hd->scsi_tch = ((len & 0xff0000) >> 16);
323 hd->scsi_tcm = ((len & 0x00ff00) >> 8);
324 hd->scsi_tcl = (len & 0x0000ff);
325 hd->scsi_pctl = phase;
326 hd->scsi_scmd = SCMD_XFR | SCMD_PROG_XFR;
330 ixfer_out(struct scsidevice *hd, int len, uint8_t *buf)
334 while (hd->scsi_ssts & SSTS_DREG_FULL) {
337 hd->scsi_dreg = *buf++;
342 ixfer_in(struct scsidevice *hd, int len, uint8_t *buf)
346 while (hd->scsi_ssts & SSTS_DREG_EMPTY) {
349 *buf++ = hd->scsi_dreg;
363 struct scsidevice *hd;
369 hd = hs->sc_spc;
370 if (hd == NULL)
373 if ((hd->scsi_ssts & (SSTS_INITIATOR | SSTS_TARGET | SSTS_BUSY)) != 0)
390 issue_select(hd, hs->sc_target);
420 struct scsidevice *hd = hs->sc_spc;
424 hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, hd->scsi_ints);
426 if (hd->scsi_ints != 0)
428 hd->scsi_ints = hd->scsi_ints;
430 if (hd->scsi_psns == 0 || (hd->scsi_ssts & SSTS_INITIATOR) == 0)
435 len = (hd->scsi_tch << 16) | (hd->scsi_tcm << 8) | hd->scsi_tcl;
439 ((hd->scsi_ssts & SSTS_INITIATOR)) != 0 && --len >= 0;) {
440 hd->scsi_scmd = SCMD_SET_ATN;
442 while ((hd->scsi_psns & PSNS_REQ) == 0) {
443 if ((hd->scsi_ssts & SSTS_INITIATOR) == 0)
448 if ((hd->scsi_psns & PHASE) == MESG_OUT_PHASE)
449 hd->scsi_scmd = SCMD_RST_ATN;
450 hd->scsi_pctl = hs->sc_phase = hd->scsi_psns & PHASE;
452 if (hd->scsi_psns & PHASE_IO) {
454 hd->scsi_scmd = SCMD_SET_ACK;
455 while ((hd->scsi_psns & PSNS_REQ) != 0)
457 (void)hd->scsi_temp;
460 hd->scsi_temp = MSG_ABORT;
461 hd->scsi_scmd = SCMD_SET_ACK;
462 while ((hd->scsi_psns & PSNS_REQ) != 0)
466 hd->scsi_scmd = SCMD_RST_ACK;
476 hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts);
653 struct scsidevice *hd;
661 hd = hs->sc_spc;
662 if ((ints = hd->scsi_ints) != 0)
677 ints, hd->scsi_ssts, hd->scsi_pctl, hd->scsi_psns, hs->sc_phase);
681 temp = hd->scsi_temp & ~(1 << SCSI_ID);
701 hd->scsi_ints = ints;
709 hd->scsi_scmd = SCMD_RST_ACK;
710 hd->scsi_ints = ints;
711 hs->sc_phase = hd->scsi_psns & PHASE;
727 hd->scsi_ints = ints;
732 hd->scsi_temp = 0;
733 hd->scsi_tch = 0;
734 hd->scsi_tcm = 0x06;
735 hd->scsi_tcl = 0x40;
736 hd->scsi_ints = ints;
744 hd->scsi_ints = ints;
750 while ((hd->scsi_psns & PSNS_REQ) == 0) {
754 hs->sc_phase = hd->scsi_psns & PHASE;
771 ixfer_start(hd, len, hs->sc_phase, 0);
773 ixfer_in(hd, len, buf);
775 ixfer_out(hd, len, buf);
785 hd->scsi_ints = ints;