Subject: kern/13723: Duplicate #defines in wireg.h
To: None <gnats-bugs@gnats.netbsd.org>
From: seebs <seebs@ged.plethora.net>
List: netbsd-bugs
Date: 08/15/2001 11:53:14
>Number: 13723
>Category: kern
>Synopsis: wireg.h provides duplicate symbolic names for values
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Aug 15 09:50:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: seebs
>Release: 8/15/01
>Organization:
>Environment:
System: NetBSD ged.plethora.net 1.5X NetBSD 1.5X (GED) #29: Mon Aug 13 21:16:14 CDT 2001 seebs@ged.plethora.net:/usr/src/sys/arch/i386/compile/GED i386
Architecture: i386
Machine: i386
>Description:
The values WI_RID_IDENT and WI_RID_CARDID, defined in wireg.h, are
the same as WI_RID_STATION_IDENTITY and WI_RID_CARD_ID, defined in
wi_ieee.h. These are redundant, and should not exist.
>How-To-Repeat:
Steal code for another OS, notice that the #defined values show up
in two headers.
>Fix:
My fix was to remove them from wireg.h. On the other hand, it might
make just as much sense to remove them from wi_ieee.h, because they
are primarily (only?) used in the context of wi_ltv_ver for
wi_get_id(). I like this better, though, because the other names
are compatible with other versions of the driver. ;)
*** wireg.h.orig Wed Aug 15 11:50:08 2001
--- wireg.h Wed Aug 15 11:50:26 2001
***************
*** 357,365 ****
/*
* NIC Identification (0xFD0B)
*/
- #define WI_RID_CARDID 0xFD0B
- #define WI_RID_IDENT 0xFD20
struct wi_ltv_ver {
u_int16_t wi_len;
u_int16_t wi_type;
--- 357,364 ----
/*
* NIC Identification (0xFD0B)
+ * RID values defined in "wi_ieee.h"
*/
struct wi_ltv_ver {
u_int16_t wi_len;
u_int16_t wi_type;
*** wi.c.orig Wed Aug 15 11:47:24 2001
--- wi.c Wed Aug 15 11:48:49 2001
***************
*** 1667,1673 ****
/* getting chip identity */
memset(&ver, 0, sizeof(ver));
! ver.wi_type = WI_RID_CARDID;
ver.wi_len = 5;
wi_read_record(sc, (struct wi_ltv_gen *)&ver);
printf("%s: using ", sc->sc_dev.dv_xname);
--- 1667,1673 ----
/* getting chip identity */
memset(&ver, 0, sizeof(ver));
! ver.wi_type = WI_RID_CARD_ID;
ver.wi_len = 5;
wi_read_record(sc, (struct wi_ltv_gen *)&ver);
printf("%s: using ", sc->sc_dev.dv_xname);
***************
*** 1713,1719 ****
if (sc->sc_prism2) {
/* try to get prism2 firm version */
memset(&ver, 0, sizeof(ver));
! ver.wi_type = WI_RID_IDENT;
ver.wi_len = 5;
wi_read_record(sc, (struct wi_ltv_gen *)&ver);
LE16TOH(ver.wi_ver[1]);
--- 1713,1719 ----
if (sc->sc_prism2) {
/* try to get prism2 firm version */
memset(&ver, 0, sizeof(ver));
! ver.wi_type = WI_RID_STA_IDENTITY;
ver.wi_len = 5;
wi_read_record(sc, (struct wi_ltv_gen *)&ver);
LE16TOH(ver.wi_ver[1]);
>Release-Note:
>Audit-Trail:
>Unformatted: