ADB(4)               OpenBSD Programmer's Manual (Mac68K)               ADB(4)

NAME
     adb - Apple Desktop Bus event interface

SYNOPSIS
     adb0 at obio?
     option MRG_ADB
     #include <machine/adbsys.h>

DESCRIPTION
     The Apple Desktop Bus (ADB) is the single-master, multiple-slave, low-
     speed serial bus interface used by Macintosh computers to connect input
     devices such as keyboards, mice, trackballs, and graphics tablets to the
     machine.

     The adb device is the sole interface to user input.  It combines both
     keyboard and mouse drivers into one event driver.  All user input is ob-
     tained by doing a read(2) on the adb device.  Since most Macintosh mice
     have only one button, the adb driver will emulate a second and third
     mouse button with the keyboard.  The adb device only supports being
     opened by one process at a time.

     There are two interfaces to the ADB hardware supported by the adb driver.
     The older of the two relies on information in the Macintosh ROM to inter-
     face with the hardware.  This method is only available if the MRG_ADB op-
     tion is defined in the kernel configuration file.  The newer method in-
     terfaces directly with the VIA hardware and with the Power Manager hard-
     ware if it is present (i.e. on the PowerBooks). The default configuration
     currently uses the Macintosh ROM Glue (MRG) method.

     The ioctl(2) call is used to control the ADB event device.  The following
     is a list of available ioctl commands:

     ADBIOC_DEVSINFO   Get ADB Device Info

                       The adb event device will return an array of informa-
                       tion containing an entry for each device connected to
                       the bus.  Each entry contains the current address, de-
                       fault address, and handler ID for the corresponding ADB
                       device.

     ADBIOC_GETREPEAT  Get Keyboard Repeat Info

                       Returns a structure containing the current keyboard re-
                       peat delay and keyboard repeat interval.

     ADBIOC_SETREPEAT  Set Keyboard Repeat Rate

                       Sets the keyboard repeat delay and interval to the val-
                       ues specified by argp.

     ADBIOC_RESET      ADB Reset

                       Perform a reset of the ADB which will reinitialize all
                       of the devices attached to the bus.

     ADBIOC_LISTENCMD  ADB Listen Command

                       Send data to the register of the ADB device specified
                       by argp. This command is not fully implemented at this
                       time.

HARDWARE
     The adb device supports the ADB hardware of most m68k-based Macintosh
     models, including the II-series, Centris- and Quadra-series, PowerBook-
     and Duo-series, LC-series, and Performa-series models.

     Most standard ADB devices are supported by the adb driver, including mice
     which follow Apple's Extended Mouse Protocol.  Many multi-button mice
     which follow a proprietary protocol are not currently supported in multi-
     button mode.  The following is a partial list of supported ADB devices:

           Apple Standard Keyboard
           Apple Extended Keyboard
           Apple Adjustable Keyboard
           Apple Desktop Bus Mouse
           Logitech TrackMan
           Logitech MouseMan
           Microspeed Mouse Deluxe
           Mouse Systems A3 Mouse

DIAGNOSTICS
     adb0 at obio0 (ADB event device).  This is a normal autoconfiguration
     message noting the presence of the adb event device.

     adb: bus subsystem.  A standard autoconfiguration message indicating the
     initialization of the ADB subsystem.

     adb: no devices found.  No ADB devices were found to be connected to the
     bus during autoconfiguration.

     adb: using %s series hardware support.  Indicates the class of ADB hard-
     ware support the machine uses.

     adb: hardware type unknown for this machine.  The ADB hardware in this
     machine is currently unsupported.

     adb: no ROM ADB driver in this kernel for this machine.  The kernel lacks
     the necessary Macintosh ROM Glue (MRG) support for accessing the ADB
     hardware on this machine.

     adb: using serial console.  A serial console will be used for user input
     rather than the ADB event device.

     adb: %s at %d.  An ADB device of the type specified by %s has been found
     at location %d.

ERRORS
     [ENXIO]       No such ADB event device.

     [EBUSY]       Another process has the device open.

     [EINVAL]      Invalid ioctl specification.

     [EMSGSIZE]    The size of the ADB event being read is too large to fit
                   into the buffer allocated to it.

FILES
     /dev/adb  The ADB event device.

HISTORY
     The adb interface first appeared in NetBSD 0.9.  It has been under devel-
     opment ever since.

AUTHORS
     Bradley A. Grantham wrote the original adb driver, including the MRG sup-
     port.  The hardware direct interface was written by John P. Wittkowski.
     The PowerManager interface was written by Takashi Hamada.

BUGS


     o   Not every class of ADB hardware is supported yet.

     o   The talk command is currently unimplemented.

     o   The listen command is not implemented yet.

     o   Not all multi-button mice are currently supported.

     o   Only mapped and relative-position ADB devices (i.e. keyboards and
         mice) are supported.  Thus absolute-position and other exotic devices
         will not work.

OpenBSD 2.9                      July 17, 1997                               3
