aic7xxx.seq (16036) | aic7xxx.seq (16198) |
---|---|
1/*+M*********************************************************************** 2 *Adaptec 274x/284x/294x device driver for Linux and FreeBSD. 3 * 4 *Copyright (c) 1994 John Aycock 5 * The University of Calgary Department of Computer Science. 6 * All rights reserved. 7 * 8 *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing, --- 25 unchanged lines hidden (view full) --- 34 *OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 *HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 *OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 *SUCH DAMAGE. 39 * 40 *-M************************************************************************/ 41 | 1/*+M*********************************************************************** 2 *Adaptec 274x/284x/294x device driver for Linux and FreeBSD. 3 * 4 *Copyright (c) 1994 John Aycock 5 * The University of Calgary Department of Computer Science. 6 * All rights reserved. 7 * 8 *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing, --- 25 unchanged lines hidden (view full) --- 34 *OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 *HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 *OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 *SUCH DAMAGE. 39 * 40 *-M************************************************************************/ 41 |
42VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.39 1996/05/30 14:31:08 gibbs Exp $" | 42VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.40 1996/05/31 06:30:15 gibbs Exp $" |
43 44#if defined(__NetBSD__) 45#include "../../../../dev/ic/aic7xxxreg.h" 46#elif defined(__FreeBSD__) 47#include "../../dev/aic7xxx/aic7xxx_reg.h" 48#endif 49 50/* --- 27 unchanged lines hidden (view full) --- 78 clr DFCNTRL 79 clr SCSISIGO /* De-assert BSY */ 80/* 81 * We jump to start after every bus free. 82 */ 83start: 84 and FLAGS,0x0f /* clear target specific flags */ 85 mvi SCSISEQ,ENRSELI /* Always allow reselection */ | 43 44#if defined(__NetBSD__) 45#include "../../../../dev/ic/aic7xxxreg.h" 46#elif defined(__FreeBSD__) 47#include "../../dev/aic7xxx/aic7xxx_reg.h" 48#endif 49 50/* --- 27 unchanged lines hidden (view full) --- 78 clr DFCNTRL 79 clr SCSISIGO /* De-assert BSY */ 80/* 81 * We jump to start after every bus free. 82 */ 83start: 84 and FLAGS,0x0f /* clear target specific flags */ 85 mvi SCSISEQ,ENRSELI /* Always allow reselection */ |
86 clr SCSIRATE /* 87 * We don't know the target we will 88 * connect to, so default to narrow 89 * transfers to avoid parity problems. 90 */ |
|
86poll_for_work: 87 /* 88 * Are we a twin channel device? 89 * For fairness, we check the other bus first, 90 * since we just finished a transaction on the 91 * current channel. 92 */ 93 test FLAGS,TWIN_BUS jz start2 --- 175 unchanged lines hidden (view full) --- 269 or SINDEX, ULTRAEN jmp set_sxfrctl0 270ultra_b: 271 test ULTRA_ENB_B,A jz set_sxfrctl0 272 or SINDEX, ULTRAEN 273 274set_sxfrctl0: 275 mov SXFRCTL0,SINDEX 276 | 91poll_for_work: 92 /* 93 * Are we a twin channel device? 94 * For fairness, we check the other bus first, 95 * since we just finished a transaction on the 96 * current channel. 97 */ 98 test FLAGS,TWIN_BUS jz start2 --- 175 unchanged lines hidden (view full) --- 274 or SINDEX, ULTRAEN jmp set_sxfrctl0 275ultra_b: 276 test ULTRA_ENB_B,A jz set_sxfrctl0 277 or SINDEX, ULTRAEN 278 279set_sxfrctl0: 280 mov SXFRCTL0,SINDEX 281 |
277 mov SCSISEQ,ALLZEROS /* 278 * Don't allow (re)selections 279 * until after the next busfree. | 282 mvi SCSISEQ,ENAUTOATNP /* 283 * ATN on parity errors 284 * for "in" phases |
280 */ 281 mvi CLRSINT1,CLRBUSFREE 282 mvi CLRSINT0,0x60 /* CLRSELDI|CLRSELDO */ 283/* 284 * Main loop for information transfer phases. If BSY is false, then 285 * we have a bus free condition, expected or not. Otherwise, wait 286 * for the target to assert REQ before checking MSG, C/D and I/O 287 * for the bus phase. --- 206 unchanged lines hidden (view full) --- 494/* 495 * When target asks for a byte, drop ATN if it's the last one in 496 * the message. Otherwise, keep going until the message is exhausted. 497 * 498 * Keep an eye out for a phase change, in case the target issues 499 * a MESSAGE REJECT. 500 */ 501p_mesgout_loop: | 285 */ 286 mvi CLRSINT1,CLRBUSFREE 287 mvi CLRSINT0,0x60 /* CLRSELDI|CLRSELDO */ 288/* 289 * Main loop for information transfer phases. If BSY is false, then 290 * we have a bus free condition, expected or not. Otherwise, wait 291 * for the target to assert REQ before checking MSG, C/D and I/O 292 * for the bus phase. --- 206 unchanged lines hidden (view full) --- 499/* 500 * When target asks for a byte, drop ATN if it's the last one in 501 * the message. Otherwise, keep going until the message is exhausted. 502 * 503 * Keep an eye out for a phase change, in case the target issues 504 * a MESSAGE REJECT. 505 */ 506p_mesgout_loop: |
507 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis |
|
502 test SSTAT0,SPIORDY jz p_mesgout_loop | 508 test SSTAT0,SPIORDY jz p_mesgout_loop |
509 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis |
|
503 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */ 504 mvi CLRSINT1,CLRATNO /* drop ATN */ | 510 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */ 511 mvi CLRSINT1,CLRATNO /* drop ATN */ |
505 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis | |
506p_mesgout_outb: 507 dec DINDEX 508 or CLRSINT0, CLRSPIORDY 509 mov SCSIDATL,SINDIR 510 511p_mesgout4: 512 test DINDEX,0xff jnz p_mesgout_loop 513 --- 347 unchanged lines hidden (view full) --- 861 * and that REQ is already set when inb_first is called. inb_{first,next} 862 * use the same calling convention as inb. 863 */ 864 865inb_next: 866 or CLRSINT0, CLRSPIORDY 867 mov NONE,SCSIDATL /*dummy read from latch to ACK*/ 868inb_next_wait: | 512p_mesgout_outb: 513 dec DINDEX 514 or CLRSINT0, CLRSPIORDY 515 mov SCSIDATL,SINDIR 516 517p_mesgout4: 518 test DINDEX,0xff jnz p_mesgout_loop 519 --- 347 unchanged lines hidden (view full) --- 867 * and that REQ is already set when inb_first is called. inb_{first,next} 868 * use the same calling convention as inb. 869 */ 870 871inb_next: 872 or CLRSINT0, CLRSPIORDY 873 mov NONE,SCSIDATL /*dummy read from latch to ACK*/ 874inb_next_wait: |
875 test SSTAT1,PHASEMIS jnz mesgin_phasemis |
|
869 test SSTAT0,SPIORDY jz inb_next_wait /* wait for next byte */ 870inb_first: 871 mov DINDEX,SINDEX 872 test SSTAT1,PHASEMIS jnz mesgin_phasemis 873 mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/ 874inb_last: 875 mov NONE,SCSIDATL ret /*dummy read from latch to ACK*/ 876 --- 246 unchanged lines hidden --- | 876 test SSTAT0,SPIORDY jz inb_next_wait /* wait for next byte */ 877inb_first: 878 mov DINDEX,SINDEX 879 test SSTAT1,PHASEMIS jnz mesgin_phasemis 880 mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/ 881inb_last: 882 mov NONE,SCSIDATL ret /*dummy read from latch to ACK*/ 883 --- 246 unchanged lines hidden --- |