From 27ef9ec914d81ea0c488146b8253a532ea99c410 Mon Sep 17 00:00:00 2001 From: eivind Date: Sun, 13 Sep 1998 22:15:44 +0000 Subject: 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 --- contrib/pnpinfo/pnpinfo.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'contrib/pnpinfo/pnpinfo.c') 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 @@ -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); } } -- cgit v1.1