pnpinfo.c (5125c6f5c623eb809db0f0eaf84bf8b53ed7b725) pnpinfo.c (2b46c64c9c1bf1cb194e0f2b7c478f61a0e10cd9)
1/*
2 * Copyright (c) 1996, Sujal M. Patel
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 579 unchanged lines hidden (view full) ---

588{
589 int num_pnp_devs;
590
591#ifdef __i386__
592 /* Hey what about a i386_iopl() call :) */
593 if (open("/dev/io", O_RDONLY) < 0)
594 errx(1, "can't get I/O privilege");
595#endif
1/*
2 * Copyright (c) 1996, Sujal M. Patel
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 579 unchanged lines hidden (view full) ---

588{
589 int num_pnp_devs;
590
591#ifdef __i386__
592 /* Hey what about a i386_iopl() call :) */
593 if (open("/dev/io", O_RDONLY) < 0)
594 errx(1, "can't get I/O privilege");
595#endif
596#ifdef __alpha__
597 ioperm(0x203, 0x400 - 0x203, 1);
598#endif
599
600 printf("Checking for Plug-n-Play devices...\n");
601
602 /* Try various READ_DATA ports from 0x203-0x3ff */
603 for (rd_port = 0x80; (rd_port < 0xff); rd_port += 0x10) {
604 DEB(printf("Trying Read_Port at %x...\n", (rd_port << 2) | 0x3) );
605 num_pnp_devs = isolation_protocol(rd_port);
606 if (num_pnp_devs)
607 break;
608 }
609 if (!num_pnp_devs) {
610 printf("No Plug-n-Play devices were found\n");
611 return (0);
612 }
613 return (0);
614}
596
597 printf("Checking for Plug-n-Play devices...\n");
598
599 /* Try various READ_DATA ports from 0x203-0x3ff */
600 for (rd_port = 0x80; (rd_port < 0xff); rd_port += 0x10) {
601 DEB(printf("Trying Read_Port at %x...\n", (rd_port << 2) | 0x3) );
602 num_pnp_devs = isolation_protocol(rd_port);
603 if (num_pnp_devs)
604 break;
605 }
606 if (!num_pnp_devs) {
607 printf("No Plug-n-Play devices were found\n");
608 return (0);
609 }
610 return (0);
611}