Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!nadia!softpro!lso From: lso@softpro.stgt.sub.org (Lars Soltau) Newsgroups: comp.unix.aix Subject: Summary: I/O to a micro channel adapter card Summary: To summarize the summary of the summary: people are a problem. Message-ID: <142@linus.stgt.sub.org> Date: 2 May 91 16:36:04 GMT Reply-To: lso@linus.stgt.sub.org (Lars Soltau) Organization: SOFTPRO, Software Professional GmbH, Boeblingen, Germany Lines: 46 I think enough time has passed since I posted my request for information about performing I/O with microchannel adapters from a device driver. First, I want to thank all of you who mailed me a reply. Without your help I would have had to abandon my project. The most important mail I received was from Michael Massa (massa@eniac.seas.upenn.edu), who mailed me the following two pieces of code and an explanation. ------------------------------------------------------------------------------- Sample code to set a POS register: #include #include #include int bus_val; /* Set POS 2 to the correct value */ pos2 = ???; bus_val = IOCC_ATT(IOCC_BID, 0); pptr = bus_val + IO_IOCC + POSREG(2, slot_number); BUSIO_PUTC(pptr, pos2); /* Load the contents into POS2 */ IOCC_DET(bus_val); Sample code for writing to a Micro Channel device #define BUS_ID (0x82000030) /* bus id to gain access to MCA bus */ /* this usually comes from the ODM PdAt entry */ unsigned char *p; ulong bus_val; bus_val = BUSIO_ATT(BUS_ID, 0); p = (unsigned char *) (bus_val + 0x9876); /* 0x9876 is the reg addr */ BUSIO_PUTC(p, 0x12); BUSIO_DET(bus_val); Basically what is happening is that you are attaching the bus I/O address space to your own virtual address space - the BUSIO_ATT macro calls the io_att() kernel call. ------------------------------------------------------------------------------- -- Lars Soltau lso@softpro.stgt.sub.org #include