Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/dev Nuke the II and IIsi code from this file...



details:   https://anonhg.NetBSD.org/src/rev/4a3af12fc84f
branches:  trunk
changeset: 581786:4a3af12fc84f
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Sun Jun 05 18:49:49 2005 +0000

description:
Nuke the II and IIsi code from this file; it's never used on a
macppc. Remove variables and macros no longer used as a result.

This driver *still* needs an enema.

diffstat:

 sys/arch/macppc/dev/adb_direct.c |  497 +--------------------------------------
 1 files changed, 2 insertions(+), 495 deletions(-)

diffs (truncated from 689 to 300 lines):

diff -r eab54cc32a60 -r 4a3af12fc84f sys/arch/macppc/dev/adb_direct.c
--- a/sys/arch/macppc/dev/adb_direct.c  Sun Jun 05 18:26:19 2005 +0000
+++ b/sys/arch/macppc/dev/adb_direct.c  Sun Jun 05 18:49:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adb_direct.c,v 1.30 2005/02/01 03:08:16 briggs Exp $   */
+/*     $NetBSD: adb_direct.c,v 1.31 2005/06/05 18:49:49 nathanw Exp $  */
 
 /* From: adb_direct.c 2.02 4/18/97 jpw */
 
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.30 2005/02/01 03:08:16 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.31 2005/06/05 18:49:49 nathanw Exp $");
 
 #include <sys/param.h>
 #include <sys/cdefs.h>
@@ -116,29 +116,16 @@
  * Shortcuts for setting or testing the VIA bit states.
  * Not all shortcuts are used for every type of ADB hardware.
  */
-#define ADB_SET_STATE_IDLE_II()     via_reg_or(VIA1, vBufB, (vPB4 | vPB5))
-#define ADB_SET_STATE_IDLE_IISI()   via_reg_and(VIA1, vBufB, ~(vPB4 | vPB5))
 #define ADB_SET_STATE_IDLE_CUDA()   via_reg_or(VIA1, vBufB, (vPB4 | vPB5))
-#define ADB_SET_STATE_CMD()         via_reg_and(VIA1, vBufB, ~(vPB4 | vPB5))
-#define ADB_SET_STATE_EVEN()        write_via_reg(VIA1, vBufB, \
-                              (read_via_reg(VIA1, vBufB) | vPB4) & ~vPB5)
-#define ADB_SET_STATE_ODD()         write_via_reg(VIA1, vBufB, \
-                              (read_via_reg(VIA1, vBufB) | vPB5) & ~vPB4 )
-#define ADB_SET_STATE_ACTIVE()             via_reg_or(VIA1, vBufB, vPB5)
-#define ADB_SET_STATE_INACTIVE()    via_reg_and(VIA1, vBufB, ~vPB5)
 #define ADB_SET_STATE_TIP()        via_reg_and(VIA1, vBufB, ~vPB5)
 #define ADB_CLR_STATE_TIP()        via_reg_or(VIA1, vBufB, vPB5)
-#define ADB_SET_STATE_ACKON()      via_reg_or(VIA1, vBufB, vPB4)
-#define ADB_SET_STATE_ACKOFF()     via_reg_and(VIA1, vBufB, ~vPB4)
 #define ADB_TOGGLE_STATE_ACK_CUDA() via_reg_xor(VIA1, vBufB, vPB4)
-#define ADB_SET_STATE_ACKON_CUDA()  via_reg_and(VIA1, vBufB, ~vPB4)
 #define ADB_SET_STATE_ACKOFF_CUDA() via_reg_or(VIA1, vBufB, vPB4)
 #define ADB_SET_SR_INPUT()         via_reg_and(VIA1, vACR, ~vSR_OUT)
 #define ADB_SET_SR_OUTPUT()        via_reg_or(VIA1, vACR, vSR_OUT)
 #define ADB_SR()                   read_via_reg(VIA1, vSR)
 #define ADB_VIA_INTR_ENABLE()      write_via_reg(VIA1, vIER, 0x84)
 #define ADB_VIA_INTR_DISABLE()     write_via_reg(VIA1, vIER, 0x04)
-#define ADB_VIA_CLR_INTR()         write_via_reg(VIA1, vIFR, 0x04)
 #define ADB_INTR_IS_OFF                   (vPB3 == (read_via_reg(VIA1, vBufB) & vPB3))
 #define ADB_INTR_IS_ON            (0 == (read_via_reg(VIA1, vBufB) & vPB3))
 #define ADB_SR_INTR_IS_OFF        (0 == (read_via_reg(VIA1, vIFR) & vSR_INT))
@@ -204,33 +191,19 @@
  */
 int    adbHardware = ADB_HW_UNKNOWN;
 int    adbActionState = ADB_ACTION_NOTREADY;
-int    adbBusState = ADB_BUS_UNKNOWN;
 int    adbWaiting = 0;         /* waiting for return data from the device */
 int    adbWriteDelay = 0;      /* working on (or waiting to do) a write */
-int    adbOutQueueHasData = 0; /* something in the queue waiting to go out */
-int    adbNextEnd = 0;         /* the next incoming bute is the last (II) */
-int    adbSoftPower = 0;       /* machine supports soft power */
 
 int    adbWaitingCmd = 0;      /* ADB command we are waiting for */
 u_char *adbBuffer = (long)0;   /* pointer to user data area */
 void   *adbCompRout = (long)0; /* pointer to the completion routine */
 void   *adbCompData = (long)0; /* pointer to the completion routine data */
-long   adbFakeInts = 0;        /* keeps track of fake ADB interrupts for
-                                * timeouts (II) */
 int    adbStarting = 1;        /* doing ADBReInit so do polling differently */
-int    adbSendTalk = 0;        /* the intr routine is sending the talk, not
-                                * the user (II) */
-int    adbPolling = 0;         /* we are polling for service request */
-int    adbPollCmd = 0;         /* the last poll command we sent */
 
 u_char adbInputBuffer[ADB_MAX_MSG_LENGTH];     /* data input buffer */
 u_char adbOutputBuffer[ADB_MAX_MSG_LENGTH];    /* data output buffer */
-struct adbCmdHoldEntry adbOutQueue;            /* our 1 entry output queue */
 
 int    adbSentChars = 0;       /* how many characters we have sent */
-int    adbLastDevice = 0;      /* last ADB dev we heard from (II ONLY) */
-int    adbLastDevIndex = 0;    /* last ADB dev loc in dev table (II ONLY) */
-int    adbLastCommand = 0;     /* the last ADB command we sent (II) */
 
 struct ADBDevEntry ADBDevTable[16];    /* our ADB device table */
 int    ADBNumDevices;          /* num. of ADB devices found with ADBReInit */
@@ -265,11 +238,7 @@
 #ifdef ADB_DEBUG
 void   print_single __P((u_char *));
 #endif
-void   adb_intr_II __P((void));
-void   adb_intr_IIsi __P((void));
 void   adb_soft_intr __P((void));
-int    send_adb_II __P((u_char *, u_char *, void *, void *, int));
-int    send_adb_IIsi __P((u_char *, u_char *, void *, void *, int));
 int    send_adb_cuda __P((u_char *, u_char *, void *, void *, int));
 void   adb_intr_cuda_test __P((void));
 void   adb_cuda_tickle __P((void));
@@ -283,14 +252,9 @@
 void   adb_setup_hw_type __P((void));
 int    adb_op __P((Ptr, Ptr, Ptr, short));
 int    adb_op_sync __P((Ptr, Ptr, Ptr, short));
-void   adb_read_II __P((u_char *));
 void   adb_hw_setup __P((void));
-void   adb_hw_setup_IIsi __P((u_char *));
 int    adb_cmd_result __P((u_char *));
 int    adb_cmd_extra __P((u_char *));
-int    adb_guess_next_device __P((void));
-int    adb_prog_switch_enable __P((void));
-int    adb_prog_switch_disable __P((void));
 /* we should create this and it will be the public version */
 int    send_adb __P((u_char *, void *, void *));
 
@@ -684,86 +648,10 @@
        return 0;
 }                              /* send_adb_cuda */
 
-
-void
-adb_intr_II(void)
-{
-       panic("adb_intr_II");
-}
-
-
-/*
- * send_adb version for II series machines
- */
-int
-send_adb_II(u_char * in, u_char * buffer, void *compRout, void *data, int command)
-{
-       panic("send_adb_II");
-}
-
-
-/*
- * This routine is called from the II series interrupt routine
- * to determine what the "next" device is that should be polled.
- */
-int
-adb_guess_next_device(void)
-{
-       int last, i, dummy;
-
-       if (adbStarting) {
-               /*
-                * Start polling EVERY device, since we can't be sure there is
-                * anything in the device table yet
-                */
-               if (adbLastDevice < 1 || adbLastDevice > 15)
-                       adbLastDevice = 1;
-               if (++adbLastDevice > 15)       /* point to next one */
-                       adbLastDevice = 1;
-       } else {
-               /* find the next device using the device table */
-               if (adbLastDevice < 1 || adbLastDevice > 15)    /* let's be parinoid */
-                       adbLastDevice = 2;
-               last = 1;       /* default index location */
-
-               for (i = 1; i < 16; i++)        /* find index entry */
-                       if (ADBDevTable[i].currentAddr == adbLastDevice) {      /* look for device */
-                               last = i;       /* found it */
-                               break;
-                       }
-               dummy = last;   /* index to start at */
-               for (;;) {      /* find next device in index */
-                       if (++dummy > 15)       /* wrap around if needed */
-                               dummy = 1;
-                       if (dummy == last) {    /* didn't find any other
-                                                * device! This can happen if
-                                                * there are no devices on the
-                                                * bus */
-                               dummy = 1;
-                               break;
-                       }
-                       /* found the next device */
-                       if (ADBDevTable[dummy].devType != 0)
-                               break;
-               }
-               adbLastDevice = ADBDevTable[dummy].currentAddr;
-       }
-       return adbLastDevice;
-}
-
-
 int
 adb_intr(void *arg)
 {
        switch (adbHardware) {
-       case ADB_HW_II:
-               adb_intr_II();
-               break;
-
-       case ADB_HW_IISI:
-               adb_intr_IIsi();
-               break;
-
        case ADB_HW_PMU:
                return pm_intr(arg);
                break;
@@ -779,41 +667,6 @@
 }
 
 
-/*
- * called when when an adb interrupt happens
- *
- * IIsi version of adb_intr
- *
- */
-void
-adb_intr_IIsi(void)
-{
-       panic("adb_intr_IIsi");
-}
-
-
-/*****************************************************************************
- * if the device is currently busy, and there is no data waiting to go out, then
- * the data is "queued" in the outgoing buffer. If we are already waiting, then
- * we return.
- * in: if (in == 0) then the command string is built from command and buffer
- *     if (in != 0) then in is used as the command string
- * buffer: additional data to be sent (used only if in == 0)
- *         this is also where return data is stored
- * compRout: the completion routine that is called when then return value
- *          is received (if a return value is expected)
- * data: a data pointer that can be used by the completion routine
- * command: an ADB command to be sent (used only if in == 0)
- *
- */
-int
-send_adb_IIsi(u_char * in, u_char * buffer, void *compRout, void *data, int
-       command)
-{
-       panic("send_adb_IIsi");
-}
-
-
 /* 
  * adb_pass_up is called by the interrupt-time routines.
  * It takes the raw packet data that was received from the
@@ -863,16 +716,6 @@
                start = 0;
        } else {
                switch (adbHardware) {
-               case ADB_HW_II:
-                       cmd = in->data[1];
-                       if (in->data[0] < 2)
-                               len = 0;
-                       else
-                               len = in->data[0]-1;
-                       start = 1;
-                       break;
-
-               case ADB_HW_IISI:
                case ADB_HW_CUDA:
                        /* If it's unsolicited, accept only ADB data for now */
                        if (in->unsol)
@@ -1053,31 +896,6 @@
        int result;
 
        switch (adbHardware) {
-       case ADB_HW_II:
-               result = send_adb_II((u_char *)0, (u_char *)buffer,
-                   (void *)compRout, (void *)data, (int)command);
-               if (result == 0)
-                       return 0;
-               else
-                       return -1;
-               break;
-
-       case ADB_HW_IISI:
-               result = send_adb_IIsi((u_char *)0, (u_char *)buffer,
-                   (void *)compRout, (void *)data, (int)command);
-               /*
-                * I wish I knew why this delay is needed. It usually needs to
-                * be here when several commands are sent in close succession,
-                * especially early in device probes when doing collision
-                * detection. It must be some race condition. Sigh. - jpw
-                */
-               delay(100);
-               if (result == 0)
-                       return 0;
-               else
-                       return -1;
-               break;
-
        case ADB_HW_PMU:
                result = pm_adb_op((u_char *)buffer, (void *)compRout,
                    (void *)data, (int)command);
@@ -1113,56 +931,8 @@
 adb_hw_setup(void)
 {
        volatile int i;
-       u_char send_string[ADB_MAX_MSG_LENGTH];
 
        switch (adbHardware) {
-       case ADB_HW_II:
-               via_reg_or(VIA1, vDirB, 0x30);  /* register B bits 4 and 5:
-                                                * outputs */
-               via_reg_and(VIA1, vDirB, 0xf7); /* register B bit 3: input */
-               via_reg_and(VIA1, vACR, ~vSR_OUT);      /* make sure SR is set
-                                                        * to IN (II, IIsi) */



Home | Main Index | Thread Index | Old Index