summaryrefslogtreecommitdiffstats
path: root/contrib/pnpinfo/pnpinfo.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1998-09-13 22:15:44 +0000
committereivind <eivind@FreeBSD.org>1998-09-13 22:15:44 +0000
commit27ef9ec914d81ea0c488146b8253a532ea99c410 (patch)
tree94f52a56aa1d8f7f4c8521e99dfe55bccc26eec3 /contrib/pnpinfo/pnpinfo.c
parent72ee84b6f2c6d6005ad43fe391bec63340e5aca6 (diff)
downloadFreeBSD-src-27ef9ec914d81ea0c488146b8253a532ea99c410.zip
FreeBSD-src-27ef9ec914d81ea0c488146b8253a532ea99c410.tar.gz
Support PnP compatibility IDs. This allow e.g. the ed driver to pick
up any PnP NE2000 compatible card, instead of forcing us to always update ID lists. Submitted by: Ugo Paternostro <paterno@dsi.unifi.it>
Diffstat (limited to 'contrib/pnpinfo/pnpinfo.c')
-rw-r--r--contrib/pnpinfo/pnpinfo.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/contrib/pnpinfo/pnpinfo.c b/contrib/pnpinfo/pnpinfo.c
index 0e811f2..6218fa1 100644
--- a/contrib/pnpinfo/pnpinfo.c
+++ b/contrib/pnpinfo/pnpinfo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pnpinfo.c,v 1.1.1.1 1997/09/19 15:36:00 jmg Exp $
+ * $Id: pnpinfo.c,v 1.2 1997/11/12 08:48:13 jmg Exp $
*/
#include <sys/time.h>
@@ -51,6 +51,7 @@ pnp_write(int d, u_char r)
outb (_PNP_ADDRESS, d);
outb (_PNP_WRITE_DATA, r);
}
+
/* The READ_DATA port that we are using currently */
static int rd_port;
@@ -488,19 +489,14 @@ dump_resdata(u_char *data, int csn)
if (!get_resource_info(&tag, 1))
break;
-#define TYPE (tag >> 7)
-#define S_ITEM (tag >> 3)
-#define S_LEN (tag & 0x7)
-#define L_ITEM (tag & 0x7f)
-
- if (TYPE == 0) {
+ if (PNP_RES_TYPE(tag) == 0) {
/* Handle small resouce data types */
- resinfo = malloc(S_LEN);
- if (!get_resource_info(resinfo, S_LEN))
+ resinfo = malloc(PNP_SRES_LEN(tag));
+ if (!get_resource_info(resinfo, PNP_SRES_LEN(tag)))
break;
- if (handle_small_res(resinfo, S_ITEM, S_LEN) == 1)
+ if (handle_small_res(resinfo, PNP_SRES_NUM(tag), PNP_SRES_LEN(tag)) == 1)
break;
free(resinfo);
} else {
@@ -513,7 +509,7 @@ dump_resdata(u_char *data, int csn)
if (!get_resource_info(resinfo, large_len))
break;
- handle_large_res(resinfo, L_ITEM, large_len);
+ handle_large_res(resinfo, PNP_LRES_NUM(tag), large_len);
free(resinfo);
}
}
OpenPOWER on IntegriCloud