From owner-p4-projects@FreeBSD.ORG Tue Oct 21 18:04:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A5A911065682; Tue, 21 Oct 2008 18:04:45 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68A5B1065671 for ; Tue, 21 Oct 2008 18:04:45 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 56C9D8FC23 for ; Tue, 21 Oct 2008 18:04:45 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LI4jBP045133 for ; Tue, 21 Oct 2008 18:04:45 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9LI4iPP045131 for perforce@freebsd.org; Tue, 21 Oct 2008 18:04:44 GMT (envelope-from sam@freebsd.org) Date: Tue, 21 Oct 2008 18:04:44 GMT Message-Id: <200810211804.m9LI4iPP045131@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 151670 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:04:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=151670 Change 151670 by sam@sam_ebb on 2008/10/21 18:04:00 0 is a potential ISO CC; add a #define and set it to 0xffff for now (must be 16 bits as ieee80211_regdomain struct defines sku's and cc's as uint16_t which may need fixing) Affected files ... .. //depot/projects/vap/sbin/ifconfig/ifieee80211.c#31 edit .. //depot/projects/vap/sbin/ifconfig/regdomain.c#11 edit .. //depot/projects/vap/sbin/ifconfig/regdomain.h#3 edit Differences ... ==== //depot/projects/vap/sbin/ifconfig/ifieee80211.c#31 (text+ko) ==== @@ -425,7 +425,7 @@ struct ieee80211_devcaps_req dc; struct regdata *rdp = getregdata(); - if (rd->country != 0) { + if (rd->country != NO_COUNTRY) { const struct country *cc; /* * Check current country seting to make sure it's @@ -456,7 +456,7 @@ errx(1, "country %s (%s) is not usable with " "regdomain %d", cc->isoname, cc->name, rd->regdomain); - else if (rp->cc != 0 && rp->cc != cc) + else if (rp->cc != NULL && rp->cc != cc) errx(1, "country %s (%s) is not usable with " "regdomain %s", cc->isoname, cc->name, rp->name); ==== //depot/projects/vap/sbin/ifconfig/regdomain.c#11 (text+ko) ==== @@ -152,6 +152,7 @@ if (iseq(name, "country") && mt->country == NULL) { mt->country = calloc(1, sizeof(struct country)); mt->country->isoname = strdup(id); + mt->country->code = NO_COUNTRY; mt->nident++; LIST_INSERT_HEAD(&mt->rdp->countries, mt->country, next); return; @@ -339,7 +340,7 @@ } /* */ if (iseq(name, "country") && mt->country != NULL) { - if (mt->country->code == 0) { + if (mt->country->code == NO_COUNTRY) { warnx("no ISO cc for country at line %ld", XML_GetCurrentLineNumber(mt->parser)); } ==== //depot/projects/vap/sbin/ifconfig/regdomain.h#3 (text+ko) ==== @@ -73,6 +73,7 @@ struct country { enum ISOCountryCode code; +#define NO_COUNTRY 0xffff const struct regdomain *rd; const char* isoname; const char* name;