3 * Copyright (C) 2002 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: hal/halx86/mca.c
24 * PURPOSE: Interfaces to the MicroChannel bus
25 * PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
30 * What Adapter ID is read from an empty slot?
33 /* INCLUDES *****************************************************************/
35 #include <ddk/ntddk.h>
39 #include <internal/debug.h>
42 /* FUNCTIONS ****************************************************************/
45 HalpGetMicroChannelData(PBUS_HANDLER BusHandler,
52 PCM_MCA_POS_DATA PosData = (PCM_MCA_POS_DATA)Buffer;
54 DPRINT("HalpGetMicroChannelData() called.\n");
55 DPRINT(" BusNumber %lu\n", BusNumber);
56 DPRINT(" SlotNumber %lu\n", SlotNumber);
57 DPRINT(" Offset 0x%lx\n", Offset);
58 DPRINT(" Length 0x%lx\n", Length);
60 if ((BusNumber != 0) ||
61 (SlotNumber == 0) || (SlotNumber > 8) ||
62 (Length < sizeof(CM_MCA_POS_DATA)))
65 /* Enter Setup-Mode for given slot */
66 WRITE_PORT_UCHAR((PUCHAR)0x96, ((UCHAR)(SlotNumber - 1) & 0x07) | 0x08);
69 PosData->AdapterId = (READ_PORT_UCHAR((PUCHAR)0x101) << 8) +
70 READ_PORT_UCHAR((PUCHAR)0x100);
71 PosData->PosData1 = READ_PORT_UCHAR((PUCHAR)0x102);
72 PosData->PosData2 = READ_PORT_UCHAR((PUCHAR)0x103);
73 PosData->PosData3 = READ_PORT_UCHAR((PUCHAR)0x104);
74 PosData->PosData4 = READ_PORT_UCHAR((PUCHAR)0x105);
76 /* Leave Setup-Mode for given slot */
77 WRITE_PORT_UCHAR((PUCHAR)0x96, (UCHAR)(SlotNumber - 1) & 0x07);
79 return(sizeof(CM_MCA_POS_DATA));