- dra->rtimoticks = (data[0] * hz )/10;
- break;
-
- case DRGETRTIMEOUT:
- /* Returns the number of tenths of seconds before
- a no stall read times out. */
- /* The argument is given in tenths of a second. */
- data[0] = ((dra->rtimoticks)*10)/hz;
- break;
-
- case DRSETWSTALL:
- /* Set write stall mode. */
- dra->dr_flags &= (~DR_NOWSTALL);
- break;
-
- case DRSETNOWSTALL:
- /* Set write stall mode. */
- dra->dr_flags |= DR_NOWSTALL;
- break;
-
- case DRGETWSTALL:
- /* Returns true if in write stall mode. */
- data[0] = (dra->dr_flags & DR_NOWSTALL)? 0 : 1;
- break;
-
- case DRSETWTIMEOUT:
- /* Set the number of ticks before a no stall write times out.
- The argument is given in tenths of a second. */
- if (data[0] < 1) {
- u.u_error = EINVAL;
- temp = 1;
- }
- dra->wtimoticks = (data[0] * hz )/10;
- break;
-
- case DRGETWTIMEOUT:
- /* Returns the number of tenths of seconds before
- a no stall write times out. */
- /* The argument is given in tenths of a second. */
- data[0] = ((dra->wtimoticks)*10)/hz;
- break;
-
- case DRWRITEREADY:
- /* Returns a value of 1 if the device can accept
- data, 0 otherwise. Internally this is the
- DR11-W STAT A bit. */
-
- data[0] = (rsaddr->dr_cstat & STTA)? 1 : 0;
- break;
-
- case DRREADREADY:
- /* Returns a value of 1 if the device has data
- for host to be read, 0 otherwise. Internally
- this is the DR11-W STAT B bit. */
- data[0] = (rsaddr->dr_cstat & STTB)? 1 : 0;
- break;
-
- case DRBUSY:
- /* Returns a value of 1 if the device is busy,
- 0 otherwise. Internally this is the DR11-W
- STAT C bit, but there is a bug in the Omega 500/FIFO interface
- board that it cannot drive this signal low for certain DR11-W
- ctlr such as the Ikon. We use the REDY signal of the CSR on
- the Ikon DR11-W instead.
-
- data[0] = (rsaddr->dr_cstat & STTC)? 1 : 0;
- */
-
- data[0] = ((rsaddr->dr_cstat & REDY)? 0 : 1);
- break;
-
- case DRRESET:
- rsaddr->dr_pulse = (MCLR|RDMA|RATN|RPER);/* Reset DMA ATN RPER flag */
- DELAY(0x1f000);
- while (!(rsaddr->dr_cstat & REDY)) {
- sleep((caddr_t)dra, DRPRI); /* Wakeup by drtimo() */
- }
- dra->dr_istat = 0;
- dra->dr_cmd = 0;
- dra->currenttimo = 0;
- break;
-
- case DR11STAT: {
- register struct dr11io *dr = (struct dr11io *)data;
- /* Copy back dr11 status to user */
- dr->arg[0] = dra->dr_flags;
- dr->arg[1] = rsaddr->dr_cstat;
- dr->arg[2] = dra->dr_istat; /* Status reg. at last interrupt */
- dr->arg[3] = rsaddr->dr_data; /* P-i/o input data */
- status = (ushort)((rsaddr->dr_addmod << 8) & 0xff00);
- dr->arg[4] = status | (ushort)(rsaddr->dr_intvect & 0xff);
- dr->arg[5] = rsaddr->dr_range;
- dr->arg[6] = rsaddr->dr_rahi;
- dr->arg[7] = rsaddr->dr_ralo;
- break;
- }
- case DR11LOOP:
- /* Perform loopback test -- MUST HAVE LOOPBACK CABLE ATTACHED --
- Test results are printed on system console */
- if (suser())
- dr11loop(rsaddr,dra,unit);
- break;
-
- default:
- printf("\ndrioctl: Invalid ioctl cmd : %lx",cmd);
- return EINVAL;
- }
-