Subject: kern/22530: [PATCH] atw(4) country code handling bug
To: None <gnats-bugs@gnats.netbsd.org>
From: None <naoki@fukaumi.org>
List: netbsd-bugs
Date: 08/18/2003 23:13:01
>Number:         22530
>Category:       kern
>Synopsis:       [PATCH] atw(4) country code handling bug
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 18 14:14:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     FUKAUMI Naoki
>Release:        NetBSD 1.6W
>Organization:
	FUKAUMI Naoki
>Environment:
>Description:
	The code doesn't match the comment in the source.

	XXX I have an atw(4) device which is sold in japan. But it does
	XXX not match any COUNTRY_* case. (fallback to default: case)
	XXX Why? ;)
>How-To-Repeat:
	See src/sys/dev/ic/atw.c.
>Fix:
Index: atw.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/atw.c,v
retrieving revision 1.1
diff -u -r1.1 atw.c
--- atw.c	2003/07/06 22:58:08	1.1
+++ atw.c	2003/08/18 14:02:55
@@ -646,7 +646,8 @@
 	/* Find available channels */
 	switch (country_code) {
 	case COUNTRY_MMK2:	/* 1-14 */
-		setbit(ic->ic_chan_avail, 14);
+		for (i = 1; i <= 14; i++)
+			setbit(ic->ic_chan_avail, i);
 		break;
 	case COUNTRY_ETSI:	/* 1-13 */
 		for (i = 1; i <= 13; i++)
>Release-Note:
>Audit-Trail:
>Unformatted: