From owner-svn-src-user@FreeBSD.ORG Sun Jan 11 03:19:13 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD26106566B; Sun, 11 Jan 2009 03:19:13 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C94D18FC18; Sun, 11 Jan 2009 03:19:13 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B3JDpL015887; Sun, 11 Jan 2009 03:19:13 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B3JDAA015885; Sun, 11 Jan 2009 03:19:13 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200901110319.n0B3JDAA015885@svn.freebsd.org> From: Kip Macy Date: Sun, 11 Jan 2009 03:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187040 - user/kmacy/HEAD_fast_net/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 03:19:14 -0000 Author: kmacy Date: Sun Jan 11 03:19:13 2009 New Revision: 187040 URL: http://svn.freebsd.org/changeset/base/187040 Log: - reduce default timeouts in the flowtable - remove references to shutdown (redundant with zero weight route) - simplify weight checking Modified: user/kmacy/HEAD_fast_net/sys/net/flowtable.c user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c Modified: user/kmacy/HEAD_fast_net/sys/net/flowtable.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/flowtable.c Sat Jan 10 23:50:23 2009 (r187039) +++ user/kmacy/HEAD_fast_net/sys/net/flowtable.c Sun Jan 11 03:19:13 2009 (r187040) @@ -231,13 +231,10 @@ struct flentry_v6 { #define fl_rt fl_entry.fl_rt #define fl_lle fl_entry.fl_lle -#define SECS_PER_HOUR 3600 -#define SECS_PER_DAY (24*SECS_PER_HOUR) - -#define SYN_IDLE 300 -#define UDP_IDLE 300 -#define FIN_WAIT_IDLE 600 -#define TCP_IDLE SECS_PER_DAY +#define SYN_IDLE 120 +#define UDP_IDLE 60 +#define FIN_WAIT_IDLE 300 +#define TCP_IDLE 1200 typedef void fl_lock_t(struct flowtable *, uint32_t); Modified: user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c Sat Jan 10 23:50:23 2009 (r187039) +++ user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c Sun Jan 11 03:19:13 2009 (r187040) @@ -260,17 +260,14 @@ different: return 0; } -static int n_prev; -static int lookup_count; - void rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum) { struct radix_node *rn0, *rn; u_int32_t n; struct rtentry *rt; - uint64_t total_weight = 0; - + int64_t weight; + /* * XXX we don't attempt to lookup cached route again; what should * be done for sendto(3) case? @@ -291,48 +288,34 @@ rtalloc_mpath_fib(struct route *ro, uint rn0 = rn = (struct radix_node *)ro->ro_rt; n = rn_mpath_count(rn0); - if (n != n_prev) { - printf("rn_mpath_count=%d\n", n); - n_prev = n; - } - - /* gw selection by Modulo-N Hash (RFC2991) XXX need improvement? */ hash += hashjitter; - if ((lookup_count % 50000) == 0) - printf("hash=%u n=%d ", hash, n); hash %= n; - while (total_weight < hash && rn) { - rt = (struct rtentry *)rn; - if (rt->rt_flags & RTF_SHUTDOWN) - continue; - - total_weight += rt->rt_rmx.rmx_weight; - if ((lookup_count % 50000) == 0) - printf("rmx_weight=%ld ", - rt->rt_rmx.rmx_weight); + for (weight = abs((int32_t)hash), rt = ro->ro_rt; + weight >= rt->rt_rmx.rmx_weight && rn; + weight -= rt->rt_rmx.rmx_weight) { /* stay within the multipath routes */ if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) break; rn = rn->rn_dupedkey; + rt = (struct rtentry *)rn; } - if ((lookup_count % 50000) == 0) - printf("\n"); - lookup_count++; - /* XXX try filling rt_gwroute and avoid unreachable gw */ /* if gw selection fails, use the first match (default) */ if (!rn) { RT_UNLOCK(ro->ro_rt); + ro->ro_rt = NULL; return; } - - RTFREE_LOCKED(ro->ro_rt); - ro->ro_rt = (struct rtentry *)rn; - RT_LOCK(ro->ro_rt); - RT_ADDREF(ro->ro_rt); + if (ro->ro_rt != rt) { + RTFREE_LOCKED(ro->ro_rt); + ro->ro_rt = (struct rtentry *)rn; + RT_LOCK(ro->ro_rt); + RT_ADDREF(ro->ro_rt); + + } RT_UNLOCK(ro->ro_rt); } From owner-svn-src-user@FreeBSD.ORG Sun Jan 11 04:18:14 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1641065672; Sun, 11 Jan 2009 04:18:14 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 122A78FC1A; Sun, 11 Jan 2009 04:18:14 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B4IDws016980; Sun, 11 Jan 2009 04:18:13 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B4IDBP016977; Sun, 11 Jan 2009 04:18:13 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200901110418.n0B4IDBP016977@svn.freebsd.org> From: Kip Macy Date: Sun, 11 Jan 2009 04:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187041 - user/kmacy/HEAD_fast_net/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 04:18:15 -0000 Author: kmacy Date: Sun Jan 11 04:18:13 2009 New Revision: 187041 URL: http://svn.freebsd.org/changeset/base/187041 Log: - fix radix_mpath comment - remove shutdown flag and message Modified: user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c user/kmacy/HEAD_fast_net/sys/net/route.c user/kmacy/HEAD_fast_net/sys/net/route.h Modified: user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c Sun Jan 11 03:19:13 2009 (r187040) +++ user/kmacy/HEAD_fast_net/sys/net/radix_mpath.c Sun Jan 11 04:18:13 2009 (r187041) @@ -77,17 +77,15 @@ rn_mpath_next(struct radix_node *rn) return NULL; } -u_int32_t +uint32_t rn_mpath_count(struct radix_node *rn) { uint32_t i = 0; struct rtentry *rt; while (rn != NULL) { - rt = (struct rtentry *)rn; - if ((rt->rt_flags & RTF_SHUTDOWN) == 0) - i += rt->rt_rmx.rmx_weight; + i += rt->rt_rmx.rmx_weight; rn = rn_mpath_next(rn); } return (i); @@ -303,7 +301,7 @@ rtalloc_mpath_fib(struct route *ro, uint } /* XXX try filling rt_gwroute and avoid unreachable gw */ - /* if gw selection fails, use the first match (default) */ + /* gw selection has failed - there must be only zero weight routes */ if (!rn) { RT_UNLOCK(ro->ro_rt); ro->ro_rt = NULL; Modified: user/kmacy/HEAD_fast_net/sys/net/route.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/route.c Sun Jan 11 03:19:13 2009 (r187040) +++ user/kmacy/HEAD_fast_net/sys/net/route.c Sun Jan 11 04:18:13 2009 (r187041) @@ -881,9 +881,7 @@ rn_mpath_update(int req, struct rt_addri } nondelete: - if (req == RTM_SHUTDOWN) - rt->rt_flags |= RTF_SHUTDOWN; - else if (req != RTM_DELETE) + if (req != RTM_DELETE) panic("unrecognized request %d", req); @@ -940,7 +938,6 @@ rtrequest1_fib(int req, struct rt_addrin switch (req) { case RTM_DELETE: #ifdef RADIX_MPATH - case RTM_SHUTDOWN: if (rn_mpath_capable(rnh)) { error = rn_mpath_update(req, info, rnh, ret_nrt); /* Modified: user/kmacy/HEAD_fast_net/sys/net/route.h ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/route.h Sun Jan 11 03:19:13 2009 (r187040) +++ user/kmacy/HEAD_fast_net/sys/net/route.h Sun Jan 11 04:18:13 2009 (r187041) @@ -198,13 +198,13 @@ struct ortentry { #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ /* 0x8000000 and up unassigned */ #define RTF_STICKY 0x10000000 /* always route dst->src */ -#define RTF_SHUTDOWN 0x20000000 /* no new connections */ -#define RTF_RNH_LOCKED 0x40000000 + +#define RTF_RNH_LOCKED 0x40000000 /* radix node head is locked */ /* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */ #define RTF_FMASK \ (RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \ - RTF_REJECT | RTF_STATIC | RTF_SHUTDOWN | RTF_STICKY) + RTF_REJECT | RTF_STATIC | RTF_STICKY) /* * Routing statistics. @@ -257,7 +257,6 @@ struct rt_msghdr { #define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ #define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */ #define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */ -#define RTM_SHUTDOWN 0x13 /* don't use for new connections */ /* * Bitmask values for rtm_inits and rmx_locks. From owner-svn-src-user@FreeBSD.ORG Sun Jan 11 05:56:57 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28BC7106566B; Sun, 11 Jan 2009 05:56:57 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17F068FC13; Sun, 11 Jan 2009 05:56:57 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B5uu8q018712; Sun, 11 Jan 2009 05:56:56 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B5uuQB018711; Sun, 11 Jan 2009 05:56:56 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200901110556.n0B5uuQB018711@svn.freebsd.org> From: Kip Macy Date: Sun, 11 Jan 2009 05:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187042 - user/kmacy/HEAD_fast_net/sys/dev/hwpmc X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 05:56:57 -0000 Author: kmacy Date: Sun Jan 11 05:56:56 2009 New Revision: 187042 URL: http://svn.freebsd.org/changeset/base/187042 Log: don't profile userland Modified: user/kmacy/HEAD_fast_net/sys/dev/hwpmc/hwpmc_mod.c Modified: user/kmacy/HEAD_fast_net/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 11 04:18:13 2009 (r187041) +++ user/kmacy/HEAD_fast_net/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 11 05:56:56 2009 (r187042) @@ -3846,6 +3846,9 @@ pmc_process_interrupt(int cpu, struct pm error = 0; + if (inuserspace) + return (0); + /* * Allocate space for a sample buffer. */ From owner-svn-src-user@FreeBSD.ORG Mon Jan 12 04:12:47 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54C451065695; Mon, 12 Jan 2009 04:12:47 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 433A68FC1B; Mon, 12 Jan 2009 04:12:47 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4Clqc049947; Mon, 12 Jan 2009 04:12:47 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4ClsC049946; Mon, 12 Jan 2009 04:12:47 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200901120412.n0C4ClsC049946@svn.freebsd.org> From: Kip Macy Date: Mon, 12 Jan 2009 04:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187084 - user/kmacy/HEAD_fast_net/sys/dev/mxge X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:12:48 -0000 Author: kmacy Date: Mon Jan 12 04:12:46 2009 New Revision: 187084 URL: http://svn.freebsd.org/changeset/base/187084 Log: reduce the cost of mxge_intr by adding prefetches Modified: user/kmacy/HEAD_fast_net/sys/dev/mxge/if_mxge.c Modified: user/kmacy/HEAD_fast_net/sys/dev/mxge/if_mxge.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/dev/mxge/if_mxge.c Mon Jan 12 04:10:40 2009 (r187083) +++ user/kmacy/HEAD_fast_net/sys/dev/mxge/if_mxge.c Mon Jan 12 04:12:46 2009 (r187084) @@ -144,6 +144,16 @@ static int mxge_close(mxge_softc_t *sc); static int mxge_open(mxge_softc_t *sc); static void mxge_tick(void *arg); +#if defined(__i386__) || defined(__amd64__) +static __inline +void prefetch(void *x) +{ + __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); +} +#else +#define prefetch(x) +#endif + static int mxge_probe(device_t dev) { @@ -2471,6 +2481,8 @@ mxge_rx_done_big(struct mxge_slice_state old_map = rx->info[idx].map; bus_dmamap_sync(rx->dmat, old_map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(rx->dmat, old_map); + prefetch(rx->info[(idx + 2) & rx->mask].m); + prefetch(rx->info[(idx + 3) & rx->mask].m); /* swap the bus_dmamap_t's */ rx->info[idx].map = rx->extra_map; @@ -2520,6 +2532,9 @@ mxge_rx_done_small(struct mxge_slice_sta rx = &ss->rx_small; idx = rx->cnt & rx->mask; rx->cnt++; + prefetch(rx->info[(idx + 2) & rx->mask].m); + prefetch(rx->info[(idx + 3) & rx->mask].m); + /* save a pointer to the received mbuf */ m = rx->info[idx].m; /* try to replace the received mbuf */ @@ -2613,6 +2628,9 @@ mxge_tx_done(struct mxge_slice_state *ss while (tx->pkt_done != mcp_idx) { idx = tx->done & tx->mask; tx->done++; + prefetch(tx->info[(idx + 2) & tx->mask].m); + prefetch(tx->info[(idx + 3) & tx->mask].m); + m = tx->info[idx].m; /* mbuf and DMA map only attached to the first segment per-mbuf */ From owner-svn-src-user@FreeBSD.ORG Mon Jan 12 23:17:12 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC541065697; Mon, 12 Jan 2009 23:17:12 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A048FC13; Mon, 12 Jan 2009 23:17:12 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CNHC5L079236; Mon, 12 Jan 2009 23:17:12 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CNHC1L079235; Mon, 12 Jan 2009 23:17:12 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200901122317.n0CNHC1L079235@svn.freebsd.org> From: Paolo Pisati Date: Mon, 12 Jan 2009 23:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187122 - user/piso/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 23:17:12 -0000 Author: piso Date: Mon Jan 12 23:17:12 2009 New Revision: 187122 URL: http://svn.freebsd.org/changeset/base/187122 Log: In case of fragments, reassemble the packet before passing it to libalias. Modified: user/piso/sys/netinet/ip_fw_nat.c Modified: user/piso/sys/netinet/ip_fw_nat.c ============================================================================== --- user/piso/sys/netinet/ip_fw_nat.c Mon Jan 12 22:53:26 2009 (r187121) +++ user/piso/sys/netinet/ip_fw_nat.c Mon Jan 12 23:17:12 2009 (r187122) @@ -252,7 +252,7 @@ ipfw_nat(struct ip_fw_args *args, struct struct mbuf *mcl; struct ip *ip; /* XXX - libalias duct tape */ - int ldt, retval; + int ldt, retval, off; char *c; ldt = 0; @@ -261,7 +261,51 @@ ipfw_nat(struct ip_fw_args *args, struct NULL) goto badnat; ip = mtod(mcl, struct ip *); - if (args->eh == NULL) { + /* + * In case of fragments, reassemble the packet + * before passing it to libalias. + */ + off = (args->eh == NULL) ? ip->ip_off : ntohs(ip->ip_off); + if (off & (IP_MF | IP_OFFMASK)) { + struct mbuf *reass; + + /* + * Ip_reass() expects len & off in host byte order: + * fix them in case we come from layer2. + */ + if (args->eh != NULL) { + ip->ip_len = ntohs(ip->ip_len); + ip->ip_off = ntohs(ip->ip_off); + } + + /* Reassemble packet. */ + reass = ip_reass(mcl); + + /* + * IP header checksum fixup after reassembly and leave header + * in network byte order. + */ + if (reass != NULL) { + int hlen; + + ip = mtod(reass, struct ip *); + hlen = ip->ip_hl << 2; + ip->ip_len = htons(ip->ip_len); + ip->ip_off = htons(ip->ip_off); + ip->ip_sum = 0; + if (hlen == sizeof(struct ip)) + ip->ip_sum = in_cksum_hdr(ip); + else + ip->ip_sum = in_cksum(reass, hlen); + if ((mcl = m_megapullup(reass, reass->m_pkthdr.len)) == + NULL) + goto badnat; + ip = mtod(mcl, struct ip *); + } else { + mcl = NULL; + goto badnat; + } + } else if (args->eh == NULL) { ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); } From owner-svn-src-user@FreeBSD.ORG Tue Jan 13 04:09:23 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C2DF106566B; Tue, 13 Jan 2009 04:09:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 116E28FC0A; Tue, 13 Jan 2009 04:09:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D49MpM089156; Tue, 13 Jan 2009 04:09:22 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D49M2G089155; Tue, 13 Jan 2009 04:09:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901130409.n0D49M2G089155@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 04:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187125 - user/thompsa/usb X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 04:09:23 -0000 Author: thompsa Date: Tue Jan 13 04:09:22 2009 New Revision: 187125 URL: http://svn.freebsd.org/changeset/base/187125 Log: Add usb playground. Added: user/thompsa/usb/ (props changed) - copied from r187124, head/ From owner-svn-src-user@FreeBSD.ORG Tue Jan 13 20:42:07 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5614410656D8; Tue, 13 Jan 2009 20:42:07 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401F18FC13; Tue, 13 Jan 2009 20:42:07 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DKg79P015349; Tue, 13 Jan 2009 20:42:07 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DKg6KY015323; Tue, 13 Jan 2009 20:42:06 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901132042.n0DKg6KY015323@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 20:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187189 - in user/thompsa/usb: . bin/kenv bin/ln lib/libarchive lib/libc/string lib/libusb20 lib/msun/src sbin/mount share/examples/cvsup sys/amd64/conf sys/arm/arm sys/boot/forth sys/c... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 20:42:07 -0000 Author: thompsa Date: Tue Jan 13 20:42:05 2009 New Revision: 187189 URL: http://svn.freebsd.org/changeset/base/187189 Log: MFH r187125-187188 Added: user/thompsa/usb/sys/dev/usb2/controller/atmegadci.c - copied unchanged from r187188, head/sys/dev/usb2/controller/atmegadci.c user/thompsa/usb/sys/dev/usb2/controller/atmegadci.h - copied unchanged from r187188, head/sys/dev/usb2/controller/atmegadci.h user/thompsa/usb/sys/dev/usb2/controller/atmegadci_atmelarm.c - copied unchanged from r187188, head/sys/dev/usb2/controller/atmegadci_atmelarm.c user/thompsa/usb/sys/modules/usb2/controller_atmegadci/ - copied from r187188, head/sys/modules/usb2/controller_atmegadci/ Deleted: user/thompsa/usb/sys/powerpc/booke/support.S Modified: user/thompsa/usb/ (props changed) user/thompsa/usb/bin/kenv/kenv.1 user/thompsa/usb/bin/ln/ln.1 user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c user/thompsa/usb/lib/libc/string/ffs.3 user/thompsa/usb/lib/libusb20/libusb20.c user/thompsa/usb/lib/msun/src/e_rem_pio2.c user/thompsa/usb/lib/msun/src/e_rem_pio2f.c user/thompsa/usb/lib/msun/src/k_cosf.c user/thompsa/usb/lib/msun/src/k_sinf.c user/thompsa/usb/lib/msun/src/k_tanf.c user/thompsa/usb/sbin/mount/mount.c user/thompsa/usb/share/examples/cvsup/refuse.README user/thompsa/usb/sys/amd64/conf/GENERIC user/thompsa/usb/sys/amd64/conf/USB2 user/thompsa/usb/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) user/thompsa/usb/sys/boot/forth/support.4th user/thompsa/usb/sys/conf/files user/thompsa/usb/sys/conf/files.powerpc user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c user/thompsa/usb/sys/dev/bce/if_bce.c user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c user/thompsa/usb/sys/dev/usb/usbdevs user/thompsa/usb/sys/dev/usb2/controller/at91dci.c user/thompsa/usb/sys/dev/usb2/controller/at91dci.h user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c user/thompsa/usb/sys/dev/usb2/controller/ehci2.c user/thompsa/usb/sys/dev/usb2/controller/ehci2.h user/thompsa/usb/sys/dev/usb2/controller/ehci2_pci.c user/thompsa/usb/sys/dev/usb2/controller/musb2_otg.c user/thompsa/usb/sys/dev/usb2/controller/musb2_otg.h user/thompsa/usb/sys/dev/usb2/controller/musb2_otg_atmelarm.c user/thompsa/usb/sys/dev/usb2/controller/ohci2.c user/thompsa/usb/sys/dev/usb2/controller/ohci2.h user/thompsa/usb/sys/dev/usb2/controller/ohci2_atmelarm.c user/thompsa/usb/sys/dev/usb2/controller/ohci2_pci.c user/thompsa/usb/sys/dev/usb2/controller/uhci2.c user/thompsa/usb/sys/dev/usb2/controller/uhci2.h user/thompsa/usb/sys/dev/usb2/controller/uhci2_pci.c user/thompsa/usb/sys/dev/usb2/controller/usb2_bus.h user/thompsa/usb/sys/dev/usb2/controller/usb2_controller.c user/thompsa/usb/sys/dev/usb2/controller/usb2_controller.h user/thompsa/usb/sys/dev/usb2/controller/uss820dci.c user/thompsa/usb/sys/dev/usb2/controller/uss820dci.h user/thompsa/usb/sys/dev/usb2/controller/uss820dci_atmelarm.c user/thompsa/usb/sys/dev/usb2/core/usb2_busdma.c user/thompsa/usb/sys/dev/usb2/core/usb2_compat_linux.c user/thompsa/usb/sys/dev/usb2/core/usb2_core.h user/thompsa/usb/sys/dev/usb2/core/usb2_debug.c user/thompsa/usb/sys/dev/usb2/core/usb2_device.c user/thompsa/usb/sys/dev/usb2/core/usb2_generic.c user/thompsa/usb/sys/dev/usb2/core/usb2_handle_request.c user/thompsa/usb/sys/dev/usb2/core/usb2_hub.c user/thompsa/usb/sys/dev/usb2/core/usb2_mbuf.h user/thompsa/usb/sys/dev/usb2/core/usb2_parse.c user/thompsa/usb/sys/dev/usb2/core/usb2_request.c user/thompsa/usb/sys/dev/usb2/core/usb2_sw_transfer.c user/thompsa/usb/sys/dev/usb2/core/usb2_transfer.c user/thompsa/usb/sys/dev/usb2/core/usb2_transfer.h user/thompsa/usb/sys/dev/usb2/include/usb2_defs.h user/thompsa/usb/sys/dev/usb2/include/usb2_devid.h user/thompsa/usb/sys/dev/usb2/include/usb2_devtable.h user/thompsa/usb/sys/dev/usb2/include/usb2_standard.h user/thompsa/usb/sys/dev/usb2/serial/u3g2.c user/thompsa/usb/sys/dev/usb2/serial/uark2.c user/thompsa/usb/sys/dev/usb2/serial/ubsa2.c user/thompsa/usb/sys/dev/usb2/serial/ubser2.c user/thompsa/usb/sys/dev/usb2/serial/uchcom2.c user/thompsa/usb/sys/dev/usb2/serial/ucycom2.c user/thompsa/usb/sys/dev/usb2/serial/ufoma2.c user/thompsa/usb/sys/dev/usb2/serial/uftdi2.c user/thompsa/usb/sys/dev/usb2/serial/ugensa2.c user/thompsa/usb/sys/dev/usb2/serial/uipaq2.c user/thompsa/usb/sys/dev/usb2/serial/ulpt2.c user/thompsa/usb/sys/dev/usb2/serial/umct2.c user/thompsa/usb/sys/dev/usb2/serial/umodem2.c user/thompsa/usb/sys/dev/usb2/serial/umoscom2.c user/thompsa/usb/sys/dev/usb2/serial/uplcom2.c user/thompsa/usb/sys/dev/usb2/serial/usb2_serial.c user/thompsa/usb/sys/dev/usb2/serial/usb2_serial.h user/thompsa/usb/sys/dev/usb2/serial/uvisor2.c user/thompsa/usb/sys/dev/usb2/serial/uvscom2.c user/thompsa/usb/sys/dev/usb2/sound/uaudio2.c user/thompsa/usb/sys/dev/usb2/storage/ata-usb2.c user/thompsa/usb/sys/dev/usb2/storage/umass2.c user/thompsa/usb/sys/i386/conf/GENERIC user/thompsa/usb/sys/i386/conf/USB2 user/thompsa/usb/sys/i386/i386/msi.c user/thompsa/usb/sys/kern/kern_timeout.c user/thompsa/usb/sys/powerpc/booke/locore.S user/thompsa/usb/sys/powerpc/booke/machdep.c user/thompsa/usb/sys/powerpc/booke/pmap.c user/thompsa/usb/sys/powerpc/booke/trap_subr.S user/thompsa/usb/sys/powerpc/include/pcpu.h user/thompsa/usb/sys/powerpc/include/pmap.h user/thompsa/usb/sys/powerpc/include/pte.h user/thompsa/usb/sys/powerpc/include/tlb.h user/thompsa/usb/sys/powerpc/powerpc/genassym.c user/thompsa/usb/tools/sched/schedgraph.py user/thompsa/usb/usr.bin/make/job.c user/thompsa/usb/usr.bin/make/main.c user/thompsa/usb/usr.bin/netstat/inet6.c user/thompsa/usb/usr.sbin/crunch/crunchgen/crunchgen.c user/thompsa/usb/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) user/thompsa/usb/usr.sbin/makefs/ffs/ffs_subr.c (props changed) user/thompsa/usb/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) user/thompsa/usb/usr.sbin/makefs/getid.c (props changed) user/thompsa/usb/usr.sbin/usbconfig/usbconfig.c Modified: user/thompsa/usb/bin/kenv/kenv.1 ============================================================================== --- user/thompsa/usb/bin/kenv/kenv.1 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/bin/kenv/kenv.1 Tue Jan 13 20:42:05 2009 (r187189) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2005 +.Dd January 13, 2009 .Dt KENV 1 .Os .Sh NAME @@ -67,8 +67,28 @@ If the .Fl q option is set, warnings normally printed as a result of being unable to perform the requested operation will be suppressed. +.Pp +Variables can be added to the kernel environment using the +.Xr /boot/loader.conf +file, or also statically compiled into the kernel using the statement +.Pp +.Dl Ic env Ar filename +.Pp +in the kernel config file. +The file can contain lines of the form +.Pp +.Dl name = "value" # this is a comment +.Pp +where whitespace around name and '=', and +everything after a '#' character, are ignored. Almost any printable +character except '=' is acceptable as part of a name. Quotes +are optional and necessary only if the value contains +whitespace. +.Pp .Sh SEE ALSO .Xr kenv 2 , +.Xr config 5 , +.Xr loader.conf 5 , .Xr loader 8 .Sh HISTORY The Modified: user/thompsa/usb/bin/ln/ln.1 ============================================================================== --- user/thompsa/usb/bin/ln/ln.1 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/bin/ln/ln.1 Tue Jan 13 20:42:05 2009 (r187189) @@ -38,7 +38,7 @@ .Sh NAME .Nm ln , .Nm link -.Nd make links +.Nd link files .Sh SYNOPSIS .Nm .Op Fl s Op Fl F @@ -57,8 +57,13 @@ .Sh DESCRIPTION The .Nm -utility creates a new directory entry (linked file) which has the -same modes as the original file. +utility creates a new directory entry (linked file) for the file name +specified by +.Ar target_file . +The +.Ar target_file +will be created with the same file modes as the +.Ar source_file . It is useful for maintaining multiple copies of a file in many places at once without using up storage for the .Dq copies ; @@ -148,7 +153,7 @@ links. A hard link to a file is indistinguishable from the original directory entry; any changes to a file are effectively independent of the name used to reference the file. -Hard links may not normally refer to directories and may not span file systems. +Directories may not be hardlinked, and hard links may not span file systems. .Pp A symbolic link contains the name of the file to which it is linked. Modified: user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c Tue Jan 13 20:42:05 2009 (r187189) @@ -466,7 +466,10 @@ archive_read_format_iso9660_read_header( * seek backwards to extract it, so issue a warning. */ if (file->offset < iso9660->current_position) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Ignoring out-of-order file"); + "Ignoring out-of-order file @%x (%s) %jd < %jd", + file, + iso9660->pathname.s, + file->offset, iso9660->current_position); iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; release_file(iso9660, file); @@ -607,7 +610,7 @@ parse_file_info(struct iso9660 *iso9660, file->parent = parent; if (parent != NULL) parent->refcount++; - file->offset = toi(isodirrec + DR_extent_offset, DR_extent_size) + file->offset = (uint64_t)toi(isodirrec + DR_extent_offset, DR_extent_size) * iso9660->logical_block_size; file->size = toi(isodirrec + DR_size_offset, DR_size_size); file->mtime = isodate7(isodirrec + DR_date_offset); Modified: user/thompsa/usb/lib/libc/string/ffs.3 ============================================================================== --- user/thompsa/usb/lib/libc/string/ffs.3 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/libc/string/ffs.3 Tue Jan 13 20:42:05 2009 (r187189) @@ -108,4 +108,4 @@ The and .Fn flsll functions appeared in -.Fx 8.0 . +.Fx 7.1 . Modified: user/thompsa/usb/lib/libusb20/libusb20.c ============================================================================== --- user/thompsa/usb/lib/libusb20/libusb20.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/libusb20/libusb20.c Tue Jan 13 20:42:05 2009 (r187189) @@ -486,6 +486,8 @@ libusb20_dev_close(struct libusb20_devic pdev->is_opened = 0; + pdev->claimed_interfaces = 0; + return (error); } Modified: user/thompsa/usb/lib/msun/src/e_rem_pio2.c ============================================================================== --- user/thompsa/usb/lib/msun/src/e_rem_pio2.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/e_rem_pio2.c Tue Jan 13 20:42:05 2009 (r187189) @@ -49,7 +49,7 @@ pio2_3 = 2.02226624871116645580e-21, / pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ #ifdef INLINE_REM_PIO2 -extern inline +extern __gnu89_inline #endif int __ieee754_rem_pio2(double x, double *y) Modified: user/thompsa/usb/lib/msun/src/e_rem_pio2f.c ============================================================================== --- user/thompsa/usb/lib/msun/src/e_rem_pio2f.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/e_rem_pio2f.c Tue Jan 13 20:42:05 2009 (r187189) @@ -41,7 +41,7 @@ pio2_1 = 1.57079631090164184570e+00, / pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ #ifdef INLINE_REM_PIO2F -extern inline +extern __gnu89_inline #endif int __ieee754_rem_pio2f(float x, double *y) Modified: user/thompsa/usb/lib/msun/src/k_cosf.c ============================================================================== --- user/thompsa/usb/lib/msun/src/k_cosf.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/k_cosf.c Tue Jan 13 20:42:05 2009 (r187189) @@ -31,7 +31,7 @@ C2 = -0x16c087e80f1e27.0p-62, /* -0.001 C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ #ifdef INLINE_KERNEL_COSDF -extern inline +extern __gnu89_inline #endif float __kernel_cosdf(double x) Modified: user/thompsa/usb/lib/msun/src/k_sinf.c ============================================================================== --- user/thompsa/usb/lib/msun/src/k_sinf.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/k_sinf.c Tue Jan 13 20:42:05 2009 (r187189) @@ -30,7 +30,7 @@ S3 = -0x1a00f9e2cae774.0p-65, /* -0.0001 S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ #ifdef INLINE_KERNEL_SINDF -extern inline +extern __gnu89_inline #endif float __kernel_sindf(double x) Modified: user/thompsa/usb/lib/msun/src/k_tanf.c ============================================================================== --- user/thompsa/usb/lib/msun/src/k_tanf.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/k_tanf.c Tue Jan 13 20:42:05 2009 (r187189) @@ -33,7 +33,7 @@ T[] = { }; #ifdef INLINE_KERNEL_TANDF -extern inline +extern __gnu89_inline #endif float __kernel_tandf(double x, int iy) Modified: user/thompsa/usb/sbin/mount/mount.c ============================================================================== --- user/thompsa/usb/sbin/mount/mount.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sbin/mount/mount.c Tue Jan 13 20:42:05 2009 (r187189) @@ -70,6 +70,7 @@ int debug, fstab_style, verbose; struct cpa { char **a; + ssize_t sz; int c; }; @@ -503,11 +504,9 @@ hasopt(const char *mntopts, const char * static void append_arg(struct cpa *sa, char *arg) { - static int a_sz; - - if (sa->c + 1 == a_sz) { - a_sz = a_sz == 0 ? 8 : a_sz * 2; - sa->a = realloc(sa->a, sizeof(sa->a) * a_sz); + if (sa->c + 1 == sa->sz) { + sa->sz = sa->sz == 0 ? 8 : sa->sz * 2; + sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz); if (sa->a == NULL) errx(1, "realloc failed"); } @@ -518,11 +517,10 @@ int mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - struct cpa mnt_argv; struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; - static int mnt_argv_inited; + static struct cpa mnt_argv; /* resolve the mountpoint with realpath(3) */ (void)checkpath(name, mntpath); @@ -557,10 +555,6 @@ mountfs(const char *vfstype, const char /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - if (!mnt_argv_inited) { - mnt_argv_inited++; - mnt_argv.a = NULL; - } mnt_argv.c = -1; append_arg(&mnt_argv, execname); mangle(optbuf, &mnt_argv); Modified: user/thompsa/usb/share/examples/cvsup/refuse.README ============================================================================== --- user/thompsa/usb/share/examples/cvsup/refuse.README Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/share/examples/cvsup/refuse.README Tue Jan 13 20:42:05 2009 (r187189) @@ -12,8 +12,8 @@ everything beneath that directory will b You can copy "refuse" to your sup directory and add or remove whatever you like. The example supfiles in this directory set -CVSup's base directory to "/usr". The sup directory is in the base -directory; i.e., it is "/usr/sup". If you have changed your base +CVSup's base directory to "/var/db". The sup directory is in the base +directory; i.e., it is "/var/db/sup". If you have changed your base directory, your sup directory is /path/to/base/sup. This file used to contain /usr/src/etc/sendmail/freebsd.mc in case @@ -62,4 +62,4 @@ depend on files in completely different For more information about refuse files see cvsup(1), which is installed by the "cvsup" and "cvsup-bin" ports. See also the CVSup -FAQ at . +FAQ at . Modified: user/thompsa/usb/sys/amd64/conf/GENERIC ============================================================================== --- user/thompsa/usb/sys/amd64/conf/GENERIC Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/amd64/conf/GENERIC Tue Jan 13 20:42:05 2009 (r187189) @@ -1,8 +1,8 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/amd64 # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -24,6 +24,12 @@ ident GENERIC # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. +# Use the following to compile in values accessible to the kernel +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value', see kenv(1) +# +# env "GENERIC.env" + makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_ULE # ULE scheduler Modified: user/thompsa/usb/sys/amd64/conf/USB2 ============================================================================== --- user/thompsa/usb/sys/amd64/conf/USB2 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/amd64/conf/USB2 Tue Jan 13 20:42:05 2009 (r187189) @@ -108,3 +108,7 @@ device usb2_input_ms # USB sound and MIDI device support #device usb2_sound + +# USB scanner support +device usb2_image +device usb2_scanner Modified: user/thompsa/usb/sys/boot/forth/support.4th ============================================================================== --- user/thompsa/usb/sys/boot/forth/support.4th Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/boot/forth/support.4th Tue Jan 13 20:42:05 2009 (r187189) @@ -820,7 +820,7 @@ only forth also support-functions defini \ Interface to loading conf files : load_conf ( addr len -- ) - ." ----- Trying conf " 2dup type cr + \ ." ----- Trying conf " 2dup type cr \ debugging 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -912,7 +912,7 @@ string current_file_name_ref \ used to p \ loader_conf_files processing support functions : get_conf_files ( -- addr len ) \ put addr/len on stack, reset var - ." -- starting on <" conf_files strtype ." >" cr + \ ." -- starting on <" conf_files strtype ." >" cr \ debugging conf_files strget 0 0 conf_files strset ; @@ -939,8 +939,7 @@ string current_file_name_ref \ used to p pos char+ to pos repeat addr len pos addr r@ + pos r> - - 2dup - ." get_file_name has " type cr + \ 2dup ." get_file_name has " type cr \ debugging ; : get_next_file ( addr len ptr -- addr len ptr' addr' len' | 0 ) Modified: user/thompsa/usb/sys/conf/files ============================================================================== --- user/thompsa/usb/sys/conf/files Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/conf/files Tue Jan 13 20:42:05 2009 (r187189) @@ -1609,6 +1609,7 @@ dev/usb2/wlan/usb2_wlan.c optional usb2_ # # USB2 serial and parallel port drivers # +dev/usb2/serial/u3g2.c optional usb2_core usb2_serial usb2_serial_3g dev/usb2/serial/uark2.c optional usb2_core usb2_serial usb2_serial_ark dev/usb2/serial/ubsa2.c optional usb2_core usb2_serial usb2_serial_bsa dev/usb2/serial/ubser2.c optional usb2_core usb2_serial usb2_serial_bser Modified: user/thompsa/usb/sys/conf/files.powerpc ============================================================================== --- user/thompsa/usb/sys/conf/files.powerpc Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/conf/files.powerpc Tue Jan 13 20:42:05 2009 (r187189) @@ -84,7 +84,6 @@ powerpc/booke/interrupt.c optional e500 powerpc/booke/locore.S optional e500 no-obj powerpc/booke/machdep.c optional e500 powerpc/booke/pmap.c optional e500 -powerpc/booke/support.S optional e500 powerpc/booke/swtch.S optional e500 powerpc/booke/trap.c optional e500 powerpc/booke/uio_machdep.c optional e500 Modified: user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c ============================================================================== --- user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 20:42:05 2009 (r187189) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_rfgain.c,v 1.2 2008/11/19 21:23:01 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -280,7 +280,8 @@ ar5212GetRfgain(struct ath_hal *ah) GAIN_VALUES *gv = &ahp->ah_gainValues; uint32_t rddata, probeType; - if (!gv->active) + /* NB: beware of touching the BB when PHY is powered down */ + if (!gv->active || !ahp->ah_phyPowerOn) return HAL_RFGAIN_INACTIVE; if (ahp->ah_rfgainState == HAL_RFGAIN_READ_REQUESTED) { Modified: user/thompsa/usb/sys/dev/bce/if_bce.c ============================================================================== --- user/thompsa/usb/sys/dev/bce/if_bce.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/bce/if_bce.c Tue Jan 13 20:42:05 2009 (r187189) @@ -106,6 +106,8 @@ static struct bce_type bce_devs[] = { "HP NC370T Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3106, "HP NC370i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3070, + "HP NC380T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5706 1000Base-T" }, @@ -116,18 +118,38 @@ static struct bce_type bce_devs[] = { "Broadcom NetXtreme II BCM5706 1000Base-SX" }, /* BCM5708C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, + "HP NC373T PCI Express Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7038, + "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, + "HP NC373m Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x7038, + "HP NC373i PCI Express Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703b, + "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, + "HP NC373F PCI Express Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, + "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, + "HP NC382T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, + "HP NC382m Dual Port 1GbE Multifunction BL-c Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, + "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-SX" }, Modified: user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 20:42:05 2009 (r187189) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090110_0123" +#define HDA_DRV_TEST_REV "20090113_0124" SND_DECLARE_FILE("$FreeBSD$"); @@ -6111,6 +6111,29 @@ hdac_audio_prepare_pin_ctrl(struct hdac_ } static void +hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) +{ + struct hdac_audio_ctl *ctl; + int i, z; + + i = 0; + while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0 || ctl->ossmask != 0) { + /* Mute disabled and mixer controllable controls. + * Last will be initialized by mixer_init(). + * This expected to reduce click on startup. */ + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); + continue; + } + /* Init fixed controls to 0dB amplification. */ + z = ctl->offset; + if (z > ctl->step) + z = ctl->step; + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); + } +} + +static void hdac_audio_commit(struct hdac_devinfo *devinfo) { struct hdac_softc *sc = devinfo->codec->sc; @@ -6126,11 +6149,41 @@ hdac_audio_commit(struct hdac_devinfo *d hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + /* Commit controls. */ + hdac_audio_ctl_commit(devinfo); + + /* Commit selectors, pins and EAPD. */ + for (i = 0; i < devinfo->nodecnt; i++) { + w = &devinfo->widget[i]; + if (w == NULL) + continue; + if (w->selconn == -1) + w->selconn = 0; + if (w->nconns > 0) + hdac_widget_connection_select(w, w->selconn); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + hdac_command(sc, + HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, + w->wclass.pin.ctrl), cad); + } + if (w->param.eapdbtl != HDAC_INVALID) { + uint32_t val; + + val = w->param.eapdbtl; + if (devinfo->function.audio.quirks & + HDA_QUIRK_EAPDINV) + val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; + hdac_command(sc, + HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, + val), cad); + } + } + + /* Commit GPIOs. */ gdata = 0; gmask = 0; gdir = 0; commitgpio = 0; - numgpio = HDA_PARAM_GPIO_COUNT_NUM_GPIO( devinfo->function.audio.gpio); @@ -6185,54 +6238,6 @@ hdac_audio_commit(struct hdac_devinfo *d HDA_CMD_SET_GPIO_DATA(cad, devinfo->nid, gdata), cad); } - - for (i = 0; i < devinfo->nodecnt; i++) { - w = &devinfo->widget[i]; - if (w == NULL) - continue; - if (w->selconn == -1) - w->selconn = 0; - if (w->nconns > 0) - hdac_widget_connection_select(w, w->selconn); - if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - hdac_command(sc, - HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, - w->wclass.pin.ctrl), cad); - } - if (w->param.eapdbtl != HDAC_INVALID) { - uint32_t val; - - val = w->param.eapdbtl; - if (devinfo->function.audio.quirks & - HDA_QUIRK_EAPDINV) - val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; - hdac_command(sc, - HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, - val), cad); - - } - } -} - -static void -hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) -{ - struct hdac_audio_ctl *ctl; - int i, z; - - i = 0; - while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) { - /* Mute disabled controls. */ - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); - continue; - } - /* Init controls to 0dB amplification. */ - z = ctl->offset; - if (z > ctl->step) - z = ctl->step; - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); - } } static void @@ -7477,10 +7482,6 @@ hdac_attach2(void *arg) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); @@ -7730,10 +7731,6 @@ hdac_resume(device_t dev) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); Modified: user/thompsa/usb/sys/dev/usb/usbdevs ============================================================================== --- user/thompsa/usb/sys/dev/usb/usbdevs Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb/usbdevs Tue Jan 13 20:42:05 2009 (r187189) @@ -151,6 +151,7 @@ vendor PLANTRONICS 0x047f Plantronics vendor KYOCERA 0x0482 Kyocera Wireless Corp. vendor STMICRO 0x0483 STMicroelectronics vendor FOXCONN 0x0489 Foxconn +vendor MEIZU 0x0492 Meizu Electronics vendor YAMAHA 0x0499 YAMAHA vendor COMPAQ 0x049f Compaq vendor HITACHI 0x04a4 Hitachi @@ -1657,6 +1658,9 @@ product MCT DU_H3SP_USB232 0x0200 D-Link product MCT USB232 0x0210 USB-232 Interface product MCT SITECOM_USB232 0x0230 Sitecom USB-232 Products +/* Meizu Electronics */ +product MEIZU M6_SL 0x0140 MiniPlayer M6 (SL) + /* Melco, Inc products */ product MELCO LUATX1 0x0001 LUA-TX Ethernet product MELCO LUATX5 0x0005 LUA-TX Ethernet Modified: user/thompsa/usb/sys/dev/usb2/controller/at91dci.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb2/controller/at91dci.c Tue Jan 13 20:42:05 2009 (r187189) @@ -50,14 +50,11 @@ __FBSDID("$FreeBSD$"); #include #define USB_DEBUG_VAR at91dcidebug -#define usb2_config_td_cc at91dci_config_copy -#define usb2_config_td_softc at91dci_softc #include #include #include #include -#include #include #include #include @@ -106,7 +103,6 @@ static void at91dci_standard_done(struct static usb2_sw_transfer_func_t at91dci_root_intr_done; static usb2_sw_transfer_func_t at91dci_root_ctrl_done; -static usb2_config_td_command_t at91dci_root_ctrl_task; /* * NOTE: Some of the bits in the CSR register have inverse meaning so @@ -263,13 +259,13 @@ at91dci_pull_down(struct at91dci_softc * static void at91dci_wakeup_peer(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, AT91_UDP_GSTATE_ESR); @@ -702,7 +698,7 @@ at91dci_xfer_do_fifo(struct usb2_xfer *x return (1); /* not complete */ done: - sc = xfer->usb2_sc; + sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); temp = (xfer->endpoint & UE_ADDR); /* update FIFO bank flag and multi buffer */ @@ -733,11 +729,9 @@ repeat: } } -static void -at91dci_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) +void +at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); - DPRINTFN(5, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -764,7 +758,6 @@ at91dci_vbus_interrupt(struct usb2_bus * &at91dci_root_intr_done); } } - USB_BUS_UNLOCK(&sc->sc_bus); } @@ -890,7 +883,7 @@ at91dci_setup_standard_chain(struct usb2 DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -905,7 +898,7 @@ at91dci_setup_standard_chain(struct usb2 temp.setup_alt_next = xfer->flags_int.short_frames_ok; temp.offset = 0; - sc = xfer->usb2_sc; + sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpoint & UE_ADDR); /* check if we should prepend a setup message */ @@ -1032,7 +1025,7 @@ at91dci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ at91dci_device_done(xfer, USB_ERR_TIMEOUT); @@ -1046,7 +1039,7 @@ at91dci_start_standard_chain(struct usb2 /* poll one time */ if (at91dci_xfer_do_fifo(xfer)) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no = xfer->endpoint & UE_ADDR; /* @@ -1059,7 +1052,7 @@ at91dci_start_standard_chain(struct usb2 DPRINTFN(15, "enable interrupts on endpoint %d\n", ep_no); /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1073,7 +1066,7 @@ static void at91dci_root_intr_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); DPRINTFN(9, "\n"); @@ -1213,7 +1206,7 @@ done: static void at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1627,7 +1620,7 @@ at91dci_device_isoc_fs_close(struct usb2 static void at91dci_device_isoc_fs_enter(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint32_t temp; uint32_t nframes; @@ -1709,7 +1702,7 @@ at91dci_root_ctrl_open(struct usb2_xfer static void at91dci_root_ctrl_close(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_ctrl.xfer == xfer) { sc->sc_root_ctrl.xfer = NULL; @@ -1783,7 +1776,7 @@ static const struct usb2_hub_descriptor_ .wHubCharacteristics[0] = (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ @@ -1813,26 +1806,24 @@ at91dci_root_ctrl_enter(struct usb2_xfer static void at91dci_root_ctrl_start(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command( - &sc->sc_config_td, NULL, &at91dci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->xroot->bus); } static void -at91dci_root_ctrl_task(struct at91dci_softc *sc, - struct at91dci_config_copy *cc, uint16_t refcount) +at91dci_root_ctrl_task(struct usb2_bus *bus) { - at91dci_root_ctrl_poll(sc); + at91dci_root_ctrl_poll(AT9100_DCI_BUS2SC(bus)); } static void at91dci_root_ctrl_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; uint8_t use_polling; @@ -1853,7 +1844,7 @@ at91dci_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; /* demultiplex the control request */ @@ -2258,7 +2249,7 @@ at91dci_root_intr_open(struct usb2_xfer static void at91dci_root_intr_close(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_intr.xfer == xfer) { sc->sc_root_intr.xfer = NULL; @@ -2275,7 +2266,7 @@ at91dci_root_intr_enter(struct usb2_xfer static void at91dci_root_intr_start(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); sc->sc_root_intr.xfer = xfer; } @@ -2305,11 +2296,6 @@ at91dci_xfer_setup(struct usb2_setup_par xfer = parm->curr_xfer; /* - * setup xfer - */ - xfer->usb2_sc = sc; - - /* * NOTE: This driver does not use any of the parameters that * are computed from the following values. Just set some * reasonable dummies: @@ -2477,5 +2463,5 @@ struct usb2_bus_methods at91dci_bus_meth .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, - .vbus_interrupt = &at91dci_vbus_interrupt, + .roothub_exec = &at91dci_root_ctrl_task, }; Modified: user/thompsa/usb/sys/dev/usb2/controller/at91dci.h ============================================================================== --- user/thompsa/usb/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb2/controller/at91dci.h Tue Jan 13 20:42:05 2009 (r187189) @@ -34,6 +34,8 @@ #ifndef _AT9100_DCI_H_ #define _AT9100_DCI_H_ +#define AT91_MAX_DEVICES (USB_MIN_DEVICES + 1) + #define AT91_UDP_FRM 0x00 /* Frame number register */ #define AT91_UDP_FRM_MASK (0x7FF << 0) /* Frame Number as Defined in * the Packet Field Formats */ @@ -204,8 +206,8 @@ struct at91dci_softc { LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; - struct usb2_config_td sc_config_td; + struct usb2_device *sc_devices[AT91_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; void *sc_intr_hdl; @@ -238,5 +240,6 @@ void at91dci_uninit(struct at91dci_softc void at91dci_suspend(struct at91dci_softc *sc); void at91dci_resume(struct at91dci_softc *sc); void at91dci_interrupt(struct at91dci_softc *sc); +void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on); #endif /* _AT9100_DCI_H_ */ Modified: user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 20:42:05 2009 (r187189) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -73,7 +72,7 @@ struct at91_udp_softc { }; static void -at91_vbus_interrupt(struct at91_udp_softc *sc) +at91_vbus_poll(struct at91_udp_softc *sc) { uint32_t temp; uint8_t vbus_val; @@ -85,8 +84,7 @@ at91_vbus_interrupt(struct at91_udp_soft /* just forward it */ vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); - (sc->sc_dci.sc_bus.methods->vbus_interrupt) - (&sc->sc_dci.sc_bus, vbus_val); + at91dci_vbus_interrupt(&sc->sc_dci, vbus_val); } static void @@ -145,9 +143,12 @@ at91_udp_attach(device_t dev) sc->sc_dci.sc_pull_down = &at91_udp_pull_down; sc->sc_dci.sc_pull_arg = sc; - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_dci.sc_bus.parent = dev; + sc->sc_dci.sc_bus.devices = sc->sc_dci.sc_devices; + sc->sc_dci.sc_bus.devices_max = AT91_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_dci.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); @@ -205,12 +206,6 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); - err = usb2_config_td_setup(&sc->sc_dci.sc_config_td, sc, - &sc->sc_dci.sc_bus.bus_mtx, NULL, 0, 4); - if (err) { - device_printf(dev, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); @@ -224,10 +219,10 @@ at91_udp_attach(device_t dev) } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + NULL, (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #else err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #endif if (err) { sc->sc_vbus_intr_hdl = NULL; @@ -241,7 +236,7 @@ at91_udp_attach(device_t dev) goto error; } else { /* poll VBUS one time */ - at91_vbus_interrupt(sc); + at91_vbus_poll(sc); } return (0); @@ -305,8 +300,6 @@ at91_udp_detach(device_t dev) sc->sc_dci.sc_io_res); sc->sc_dci.sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_dci.sc_config_td); - usb2_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); /* disable clocks */ Copied: user/thompsa/usb/sys/dev/usb2/controller/atmegadci.c (from r187188, head/sys/dev/usb2/controller/atmegadci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/controller/atmegadci.c Tue Jan 13 20:42:05 2009 (r187189, copy of r187188, head/sys/dev/usb2/controller/atmegadci.c) @@ -0,0 +1,2327 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This file contains the driver for the ATMEGA series USB Device + * Controller + */ + +/* + * NOTE: When the chip detects BUS-reset it will also reset the + * endpoints, Function-address and more. + */ + +#include +#include +#include +#include + +#define USB_DEBUG_VAR atmegadci_debug + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define ATMEGA_BUS2SC(bus) \ + ((struct atmegadci_softc *)(((uint8_t *)(bus)) - \ + USB_P2U(&(((struct atmegadci_softc *)0)->sc_bus)))) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Tue Jan 13 21:08:44 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CE161065675; Tue, 13 Jan 2009 21:08:44 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48E368FC2C; Tue, 13 Jan 2009 21:08:44 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DL8iqw016041; Tue, 13 Jan 2009 21:08:44 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DL8ha6016030; Tue, 13 Jan 2009 21:08:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901132108.n0DL8ha6016030@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 21:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187190 - in user/thompsa/usb/sys/dev/usb2: ethernet wlan X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:08:44 -0000 Author: thompsa Date: Tue Jan 13 21:08:43 2009 New Revision: 187190 URL: http://svn.freebsd.org/changeset/base/187190 Log: Restore the if_*var.h and if_*reg.h to their original names, they dont need to be different. Added: user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_kuefw.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2_fw.h user/thompsa/usb/sys/dev/usb2/ethernet/if_kuereg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_ruereg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_rue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_udavreg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_udav2_reg.h user/thompsa/usb/sys/dev/usb2/wlan/if_rumfw.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_rum2_fw.h user/thompsa/usb/sys/dev/usb2/wlan/if_rumreg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_rum2_reg.h user/thompsa/usb/sys/dev/usb2/wlan/if_rumvar.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_rum2_var.h user/thompsa/usb/sys/dev/usb2/wlan/if_uralreg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_ural2_reg.h user/thompsa/usb/sys/dev/usb2/wlan/if_uralvar.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_ural2_var.h user/thompsa/usb/sys/dev/usb2/wlan/if_zydfw.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2_fw.h user/thompsa/usb/sys/dev/usb2/wlan/if_zydreg.h (props changed) - copied unchanged from r187125, user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2_reg.h Deleted: user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2_fw.h user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_rue2_reg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_udav2_reg.h user/thompsa/usb/sys/dev/usb2/wlan/if_rum2_fw.h user/thompsa/usb/sys/dev/usb2/wlan/if_rum2_reg.h user/thompsa/usb/sys/dev/usb2/wlan/if_rum2_var.h user/thompsa/usb/sys/dev/usb2/wlan/if_ural2_reg.h user/thompsa/usb/sys/dev/usb2/wlan/if_ural2_var.h user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2_fw.h user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2_reg.h Modified: user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_rue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_udav2.c user/thompsa/usb/sys/dev/usb2/wlan/if_rum2.c user/thompsa/usb/sys/dev/usb2/wlan/if_ural2.c user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2.c Modified: user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2.c Tue Jan 13 20:42:05 2009 (r187189) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2.c Tue Jan 13 21:08:43 2009 (r187190) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include MODULE_DEPEND(aue, usb2_ethernet, 1, 1, 1); MODULE_DEPEND(aue, usb2_core, 1, 1, 1); Copied: user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h (from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h Tue Jan 13 21:08:43 2009 (r187190, copy of r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2_reg.h) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 1997, 1998, 1999 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Register definitions for ADMtek Pegasus AN986 USB to Ethernet + * chip. The Pegasus uses a total of four USB endpoints: the control + * endpoint (0), a bulk read endpoint for receiving packets (1), + * a bulk write endpoint for sending packets (2) and an interrupt + * endpoint for passing RX and TX status (3). Endpoint 0 is used + * to read and write the ethernet module's registers. All registers + * are 8 bits wide. + * + * Packet transfer is done in 64 byte chunks. The last chunk in a + * transfer is denoted by having a length less that 64 bytes. For + * the RX case, the data includes an optional RX status word. + */ + +#define AUE_UR_READREG 0xF0 +#define AUE_UR_WRITEREG 0xF1 + +#define AUE_CONFIG_INDEX 0 /* config number 1 */ +#define AUE_IFACE_IDX 0 + +/* + * Note that while the ADMtek technically has four endpoints, the control + * endpoint (endpoint 0) is regarded as special by the USB code and drivers + * don't have direct access to it (we access it using usb2_do_request() + * when reading/writing registers. Consequently, our endpoint indexes + * don't match those in the ADMtek Pegasus manual: we consider the RX data + * endpoint to be index 0 and work up from there. + */ +#define AUE_ENDPT_MAX 6 + +#define AUE_INTR_PKTLEN 0x8 + +#define AUE_CTL0 0x00 +#define AUE_CTL1 0x01 +#define AUE_CTL2 0x02 +#define AUE_MAR0 0x08 +#define AUE_MAR1 0x09 +#define AUE_MAR2 0x0A +#define AUE_MAR3 0x0B +#define AUE_MAR4 0x0C +#define AUE_MAR5 0x0D +#define AUE_MAR6 0x0E +#define AUE_MAR7 0x0F +#define AUE_MAR AUE_MAR0 +#define AUE_PAR0 0x10 +#define AUE_PAR1 0x11 +#define AUE_PAR2 0x12 +#define AUE_PAR3 0x13 +#define AUE_PAR4 0x14 +#define AUE_PAR5 0x15 +#define AUE_PAR AUE_PAR0 +#define AUE_PAUSE0 0x18 +#define AUE_PAUSE1 0x19 +#define AUE_PAUSE AUE_PAUSE0 +#define AUE_RX_FLOWCTL_CNT 0x1A +#define AUE_RX_FLOWCTL_FIFO 0x1B +#define AUE_REG_1D 0x1D +#define AUE_EE_REG 0x20 +#define AUE_EE_DATA0 0x21 +#define AUE_EE_DATA1 0x22 +#define AUE_EE_DATA AUE_EE_DATA0 +#define AUE_EE_CTL 0x23 +#define AUE_PHY_ADDR 0x25 +#define AUE_PHY_DATA0 0x26 +#define AUE_PHY_DATA1 0x27 +#define AUE_PHY_DATA AUE_PHY_DATA0 +#define AUE_PHY_CTL 0x28 +#define AUE_USB_STS 0x2A +#define AUE_TXSTAT0 0x2B +#define AUE_TXSTAT1 0x2C +#define AUE_TXSTAT AUE_TXSTAT0 +#define AUE_RXSTAT 0x2D +#define AUE_PKTLOST0 0x2E +#define AUE_PKTLOST1 0x2F +#define AUE_PKTLOST AUE_PKTLOST0 + +#define AUE_REG_7B 0x7B +#define AUE_GPIO0 0x7E +#define AUE_GPIO1 0x7F +#define AUE_REG_81 0x81 + +#define AUE_CTL0_INCLUDE_RXCRC 0x01 +#define AUE_CTL0_ALLMULTI 0x02 +#define AUE_CTL0_STOP_BACKOFF 0x04 +#define AUE_CTL0_RXSTAT_APPEND 0x08 +#define AUE_CTL0_WAKEON_ENB 0x10 +#define AUE_CTL0_RXPAUSE_ENB 0x20 +#define AUE_CTL0_RX_ENB 0x40 +#define AUE_CTL0_TX_ENB 0x80 + +#define AUE_CTL1_HOMELAN 0x04 +#define AUE_CTL1_RESETMAC 0x08 +#define AUE_CTL1_SPEEDSEL 0x10 /* 0 = 10mbps, 1 = 100mbps */ +#define AUE_CTL1_DUPLEX 0x20 /* 0 = half, 1 = full */ +#define AUE_CTL1_DELAYHOME 0x40 + +#define AUE_CTL2_EP3_CLR 0x01 /* reading EP3 clrs status regs */ +#define AUE_CTL2_RX_BADFRAMES 0x02 +#define AUE_CTL2_RX_PROMISC 0x04 +#define AUE_CTL2_LOOPBACK 0x08 +#define AUE_CTL2_EEPROMWR_ENB 0x10 +#define AUE_CTL2_EEPROM_LOAD 0x20 + +#define AUE_EECTL_WRITE 0x01 +#define AUE_EECTL_READ 0x02 +#define AUE_EECTL_DONE 0x04 + +#define AUE_PHYCTL_PHYREG 0x1F +#define AUE_PHYCTL_WRITE 0x20 +#define AUE_PHYCTL_READ 0x40 +#define AUE_PHYCTL_DONE 0x80 + +#define AUE_USBSTS_SUSPEND 0x01 +#define AUE_USBSTS_RESUME 0x02 + +#define AUE_TXSTAT0_JABTIMO 0x04 +#define AUE_TXSTAT0_CARLOSS 0x08 +#define AUE_TXSTAT0_NOCARRIER 0x10 +#define AUE_TXSTAT0_LATECOLL 0x20 +#define AUE_TXSTAT0_EXCESSCOLL 0x40 +#define AUE_TXSTAT0_UNDERRUN 0x80 + +#define AUE_TXSTAT1_PKTCNT 0x0F +#define AUE_TXSTAT1_FIFO_EMPTY 0x40 +#define AUE_TXSTAT1_FIFO_FULL 0x80 + +#define AUE_RXSTAT_OVERRUN 0x01 +#define AUE_RXSTAT_PAUSE 0x02 + +#define AUE_GPIO_IN0 0x01 +#define AUE_GPIO_OUT0 0x02 +#define AUE_GPIO_SEL0 0x04 +#define AUE_GPIO_IN1 0x08 +#define AUE_GPIO_OUT1 0x10 +#define AUE_GPIO_SEL1 0x20 + +#define AUE_TIMEOUT 100 /* 10*ms */ +#define AUE_MIN_FRAMELEN 60 + +#define AUE_RXSTAT_MCAST 0x01 +#define AUE_RXSTAT_GIANT 0x02 +#define AUE_RXSTAT_RUNT 0x04 +#define AUE_RXSTAT_CRCERR 0x08 +#define AUE_RXSTAT_DRIBBLE 0x10 +#define AUE_RXSTAT_MASK 0x1E + +#define GET_MII(sc) ((sc)->sc_miibus ? \ + device_get_softc((sc)->sc_miibus) : NULL) + +struct aue_intrpkt { + uint8_t aue_txstat0; + uint8_t aue_txstat1; + uint8_t aue_rxstat; + uint8_t aue_rxlostpkt0; + uint8_t aue_rxlostpkt1; + uint8_t aue_wakeupstat; + uint8_t aue_rsvd; +} __packed; + +struct aue_rxpkt { + uint16_t aue_pktlen; + uint8_t aue_rxstat; +} __packed; + + +struct aue_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + struct usb2_config_td sc_config_td; + struct usb2_callout sc_watchdog; + struct mtx sc_mtx; + struct aue_rxpkt sc_rxpkt; + + struct ifnet *sc_ifp; + struct usb2_device *sc_udev; + struct usb2_xfer *sc_xfer[AUE_ENDPT_MAX]; + device_t sc_miibus; + device_t sc_dev; + + uint32_t sc_unit; + uint32_t sc_media_active; + uint32_t sc_media_status; + + uint16_t sc_flags; +#define AUE_FLAG_LSYS 0x0001 /* use Linksys reset */ +#define AUE_FLAG_PNA 0x0002 /* has Home PNA */ +#define AUE_FLAG_PII 0x0004 /* Pegasus II chip */ +#define AUE_FLAG_WAIT_LINK 0x0008 /* wait for link to come up */ +#define AUE_FLAG_READ_STALL 0x0010 /* wait for clearing of stall */ +#define AUE_FLAG_WRITE_STALL 0x0020 /* wait for clearing of stall */ +#define AUE_FLAG_LL_READY 0x0040 /* Lower Layer Ready */ +#define AUE_FLAG_HL_READY 0x0080 /* Higher Layer Ready */ +#define AUE_FLAG_INTR_STALL 0x0100 /* wait for clearing of stall */ +#define AUE_FLAG_VER_2 0x0200 /* chip is version 2 */ +#define AUE_FLAG_DUAL_PHY 0x0400 /* chip has two transcivers */ + + uint8_t sc_name[16]; +}; Modified: user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2.c Tue Jan 13 20:42:05 2009 (r187189) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2.c Tue Jan 13 21:08:43 2009 (r187190) @@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include MODULE_DEPEND(axe, usb2_ethernet, 1, 1, 1); MODULE_DEPEND(axe, usb2_core, 1, 1, 1); Copied: user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h (from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h Tue Jan 13 21:08:43 2009 (r187190, copy of r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2_reg.h) @@ -0,0 +1,208 @@ +/*- + * Copyright (c) 1997, 1998, 1999, 2000-2003 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Definitions for the ASIX Electronics AX88172, AX88178 + * and AX88772 to ethernet controllers. + */ + +/* + * Vendor specific commands. ASIX conveniently doesn't document the 'set + * NODEID' command in their datasheet (thanks a lot guys). + * To make handling these commands easier, I added some extra data which is + * decided by the axe_cmd() routine. Commands are encoded in 16 bits, with + * the format: LDCC. L and D are both nibbles in the high byte. L represents + * the data length (0 to 15) and D represents the direction (0 for vendor read, + * 1 for vendor write). CC is the command byte, as specified in the manual. + */ + +#define AXE_CMD_IS_WRITE(x) (((x) & 0x0F00) >> 8) +#define AXE_CMD_LEN(x) (((x) & 0xF000) >> 12) +#define AXE_CMD_CMD(x) ((x) & 0x00FF) + +#define AXE_172_CMD_READ_RXTX_SRAM 0x2002 +#define AXE_182_CMD_READ_RXTX_SRAM 0x8002 +#define AXE_172_CMD_WRITE_RX_SRAM 0x0103 +#define AXE_182_CMD_WRITE_RXTX_SRAM 0x8103 +#define AXE_172_CMD_WRITE_TX_SRAM 0x0104 +#define AXE_CMD_MII_OPMODE_SW 0x0106 +#define AXE_CMD_MII_READ_REG 0x2007 +#define AXE_CMD_MII_WRITE_REG 0x2108 +#define AXE_CMD_MII_READ_OPMODE 0x1009 +#define AXE_CMD_MII_OPMODE_HW 0x010A +#define AXE_CMD_SROM_READ 0x200B +#define AXE_CMD_SROM_WRITE 0x010C +#define AXE_CMD_SROM_WR_ENABLE 0x010D +#define AXE_CMD_SROM_WR_DISABLE 0x010E +#define AXE_CMD_RXCTL_READ 0x200F +#define AXE_CMD_RXCTL_WRITE 0x0110 +#define AXE_CMD_READ_IPG012 0x3011 +#define AXE_172_CMD_WRITE_IPG0 0x0112 +#define AXE_178_CMD_WRITE_IPG012 0x0112 +#define AXE_172_CMD_WRITE_IPG1 0x0113 +#define AXE_178_CMD_READ_NODEID 0x6013 +#define AXE_172_CMD_WRITE_IPG2 0x0114 +#define AXE_178_CMD_WRITE_NODEID 0x6114 +#define AXE_CMD_READ_MCAST 0x8015 +#define AXE_CMD_WRITE_MCAST 0x8116 +#define AXE_172_CMD_READ_NODEID 0x6017 +#define AXE_172_CMD_WRITE_NODEID 0x6118 + +#define AXE_CMD_READ_PHYID 0x2019 +#define AXE_172_CMD_READ_MEDIA 0x101A +#define AXE_178_CMD_READ_MEDIA 0x201A +#define AXE_CMD_WRITE_MEDIA 0x011B +#define AXE_CMD_READ_MONITOR_MODE 0x101C +#define AXE_CMD_WRITE_MONITOR_MODE 0x011D +#define AXE_CMD_READ_GPIO 0x101E +#define AXE_CMD_WRITE_GPIO 0x011F + +#define AXE_CMD_SW_RESET_REG 0x0120 +#define AXE_CMD_SW_PHY_STATUS 0x0021 +#define AXE_CMD_SW_PHY_SELECT 0x0122 + +#define AXE_SW_RESET_CLEAR 0x00 +#define AXE_SW_RESET_RR 0x01 +#define AXE_SW_RESET_RT 0x02 +#define AXE_SW_RESET_PRTE 0x04 +#define AXE_SW_RESET_PRL 0x08 +#define AXE_SW_RESET_BZ 0x10 +#define AXE_SW_RESET_IPRL 0x20 +#define AXE_SW_RESET_IPPD 0x40 + +/* AX88178 documentation says to always write this bit... */ +#define AXE_178_RESET_MAGIC 0x40 + +#define AXE_178_MEDIA_GMII 0x0001 +#define AXE_MEDIA_FULL_DUPLEX 0x0002 +#define AXE_172_MEDIA_TX_ABORT_ALLOW 0x0004 + +/* AX88178/88772 documentation says to always write 1 to bit 2 */ +#define AXE_178_MEDIA_MAGIC 0x0004 +/* AX88772 documentation says to always write 0 to bit 3 */ +#define AXE_178_MEDIA_ENCK 0x0008 +#define AXE_172_MEDIA_FLOW_CONTROL_EN 0x0010 +#define AXE_178_MEDIA_RXFLOW_CONTROL_EN 0x0010 +#define AXE_178_MEDIA_TXFLOW_CONTROL_EN 0x0020 +#define AXE_178_MEDIA_JUMBO_EN 0x0040 +#define AXE_178_MEDIA_LTPF_ONLY 0x0080 +#define AXE_178_MEDIA_RX_EN 0x0100 +#define AXE_178_MEDIA_100TX 0x0200 +#define AXE_178_MEDIA_SBP 0x0800 +#define AXE_178_MEDIA_SUPERMAC 0x1000 + +#define AXE_RXCMD_PROMISC 0x0001 +#define AXE_RXCMD_ALLMULTI 0x0002 +#define AXE_172_RXCMD_UNICAST 0x0004 +#define AXE_178_RXCMD_KEEP_INVALID_CRC 0x0004 +#define AXE_RXCMD_BROADCAST 0x0008 +#define AXE_RXCMD_MULTICAST 0x0010 +#define AXE_RXCMD_ENABLE 0x0080 +#define AXE_178_RXCMD_MFB_MASK 0x0300 +#define AXE_178_RXCMD_MFB_2048 0x0000 +#define AXE_178_RXCMD_MFB_4096 0x0100 +#define AXE_178_RXCMD_MFB_8192 0x0200 +#define AXE_178_RXCMD_MFB_16384 0x0300 + +#define AXE_PHY_SEL_PRI 1 +#define AXE_PHY_SEL_SEC 0 +#define AXE_PHY_TYPE_MASK 0xE0 +#define AXE_PHY_TYPE_SHIFT 5 +#define AXE_PHY_TYPE(x) \ + (((x) & AXE_PHY_TYPE_MASK) >> AXE_PHY_TYPE_SHIFT) + +#define PHY_TYPE_100_HOME 0 /* 10/100 or 1M HOME PHY */ +#define PHY_TYPE_GIG 1 /* Gigabit PHY */ +#define PHY_TYPE_SPECIAL 4 /* Special case */ +#define PHY_TYPE_RSVD 5 /* Reserved */ +#define PHY_TYPE_NON_SUP 7 /* Non-supported PHY */ + +#define AXE_PHY_NO_MASK 0x1F +#define AXE_PHY_NO(x) ((x) & AXE_PHY_NO_MASK) + +#define AXE_772_PHY_NO_EPHY 0x10 /* Embedded 10/100 PHY of AX88772 */ + +#define AXE_BULK_BUF_SIZE 16384 /* bytes */ + +#define AXE_CTL_READ 0x01 +#define AXE_CTL_WRITE 0x02 + +#define AXE_CONFIG_IDX 0 /* config number 1 */ +#define AXE_IFACE_IDX 0 + +/* The interrupt endpoint is currently unused by the ASIX part. */ +#define AXE_ENDPT_MAX 6 + +struct axe_sframe_hdr { + uint16_t len; + uint16_t ilen; +} __packed; + +#define GET_MII(sc) ((sc)->sc_miibus ? \ + device_get_softc((sc)->sc_miibus) : NULL) + +struct axe_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + struct usb2_config_td sc_config_td; + struct usb2_callout sc_watchdog; + struct mtx sc_mtx; + + struct ifnet *sc_ifp; + struct usb2_device *sc_udev; + struct usb2_xfer *sc_xfer[AXE_ENDPT_MAX]; + device_t sc_miibus; + device_t sc_dev; + + int sc_phyno; + + uint32_t sc_unit; + uint32_t sc_media_active; + uint32_t sc_media_status; + + uint16_t sc_flags; +#define AXE_FLAG_LINK 0x0001 +#define AXE_FLAG_INTR_STALL 0x0002 +#define AXE_FLAG_READ_STALL 0x0004 +#define AXE_FLAG_WRITE_STALL 0x0008 +#define AXE_FLAG_LL_READY 0x0010 +#define AXE_FLAG_HL_READY 0x0020 +#define AXE_FLAG_772 0x0040 /* AX88772 */ +#define AXE_FLAG_178 0x0080 /* AX88178 */ + + uint8_t sc_ipgs[3]; + uint8_t sc_phyaddrs[2]; + + uint8_t sc_name[16]; +}; Modified: user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2.c Tue Jan 13 20:42:05 2009 (r187189) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2.c Tue Jan 13 21:08:43 2009 (r187190) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static device_probe_t cdce_probe; static device_attach_t cdce_attach; Copied: user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h (from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h Tue Jan 13 21:08:43 2009 (r187190, copy of r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2_reg.h) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2003-2005 Craig Boston + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul, THE VOICES IN HIS HEAD OR + * THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _USB_IF_CDCEREG_H_ +#define _USB_IF_CDCEREG_H_ + +#define CDCE_N_TRANSFER 3 /* units */ +#define CDCE_IND_SIZE_MAX 32 /* bytes */ +#define CDCE_512X4_IFQ_MAXLEN MAX((2*CDCE_512X4_FRAMES_MAX), IFQ_MAXLEN) + +union cdce_eth_rx { /* multiframe header */ + struct usb2_cdc_mf_eth_512x4_header hdr; + uint8_t data[MCLBYTES]; +} __aligned(USB_HOST_ALIGN); + +union cdce_eth_tx { /* multiframe header */ + struct usb2_cdc_mf_eth_512x4_header hdr; +} __aligned(USB_HOST_ALIGN); + +struct cdce_mq { /* mini-queue */ + struct mbuf *ifq_head; + struct mbuf *ifq_tail; + uint16_t ifq_len; +}; + +struct cdce_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + union cdce_eth_tx sc_tx; + union cdce_eth_rx sc_rx; + struct ifmedia sc_ifmedia; + struct mtx sc_mtx; + struct cdce_mq sc_rx_mq; + struct cdce_mq sc_tx_mq; + + struct ifnet *sc_ifp; + struct usb2_xfer *sc_xfer[CDCE_N_TRANSFER]; + struct usb2_device *sc_udev; + device_t sc_dev; + + uint32_t sc_unit; + + uint16_t sc_flags; +#define CDCE_FLAG_ZAURUS 0x0001 +#define CDCE_FLAG_NO_UNION 0x0002 +#define CDCE_FLAG_LL_READY 0x0004 +#define CDCE_FLAG_HL_READY 0x0008 +#define CDCE_FLAG_RX_DATA 0x0010 + + uint8_t sc_name[16]; + uint8_t sc_data_iface_no; + uint8_t sc_ifaces_index[2]; + uint8_t sc_iface_protocol; +}; + +#endif /* _USB_IF_CDCEREG_H_ */ Modified: user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2.c Tue Jan 13 20:42:05 2009 (r187189) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2.c Tue Jan 13 21:08:43 2009 (r187190) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* * Various supported device vendors/products. Copied: user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h (from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h Tue Jan 13 21:08:43 2009 (r187190, copy of r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2_reg.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 1997, 1998, 1999, 2000 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Definitions for the CATC Netmate II USB to ethernet controller. + */ + +/* Vendor specific control commands. */ +#define CUE_CMD_RESET 0xF4 +#define CUE_CMD_GET_MACADDR 0xF2 +#define CUE_CMD_WRITEREG 0xFA +#define CUE_CMD_READREG 0xFB +#define CUE_CMD_READSRAM 0xF1 +#define CUE_CMD_WRITESRAM 0xFC +/* Internal registers. */ +#define CUE_TX_BUFCNT 0x20 +#define CUE_RX_BUFCNT 0x21 +#define CUE_ADVANCED_OPMODES 0x22 +#define CUE_TX_BUFPKTS 0x23 +#define CUE_RX_BUFPKTS 0x24 +#define CUE_RX_MAXCHAIN 0x25 +#define CUE_ETHCTL 0x60 +#define CUE_ETHSTS 0x61 +#define CUE_PAR5 0x62 +#define CUE_PAR4 0x63 +#define CUE_PAR3 0x64 +#define CUE_PAR2 0x65 +#define CUE_PAR1 0x66 +#define CUE_PAR0 0x67 +/* Error counters, all 16 bits wide. */ +#define CUE_TX_SINGLECOLL 0x69 +#define CUE_TX_MULTICOLL 0x6B +#define CUE_TX_EXCESSCOLL 0x6D +#define CUE_RX_FRAMEERR 0x6F +#define CUE_LEDCTL 0x81 +/* Advenced operating mode register. */ +#define CUE_AOP_SRAMWAITS 0x03 +#define CUE_AOP_EMBED_RXLEN 0x08 +#define CUE_AOP_RXCOMBINE 0x10 +#define CUE_AOP_TXCOMBINE 0x20 +#define CUE_AOP_EVEN_PKT_READS 0x40 +#define CUE_AOP_LOOPBK 0x80 +/* Ethernet control register. */ +#define CUE_ETHCTL_RX_ON 0x01 +#define CUE_ETHCTL_LINK_POLARITY 0x02 +#define CUE_ETHCTL_LINK_FORCE_OK 0x04 +#define CUE_ETHCTL_MCAST_ON 0x08 +#define CUE_ETHCTL_PROMISC 0x10 +/* Ethernet status register. */ +#define CUE_ETHSTS_NO_CARRIER 0x01 +#define CUE_ETHSTS_LATECOLL 0x02 +#define CUE_ETHSTS_EXCESSCOLL 0x04 +#define CUE_ETHSTS_TXBUF_AVAIL 0x08 +#define CUE_ETHSTS_BAD_POLARITY 0x10 +#define CUE_ETHSTS_LINK_OK 0x20 +/* LED control register. */ +#define CUE_LEDCTL_BLINK_1X 0x00 +#define CUE_LEDCTL_BLINK_2X 0x01 +#define CUE_LEDCTL_BLINK_QUARTER_ON 0x02 +#define CUE_LEDCTL_BLINK_QUARTER_OFF 0x03 +#define CUE_LEDCTL_OFF 0x04 +#define CUE_LEDCTL_FOLLOW_LINK 0x08 + +/* + * Address in ASIC's internal SRAM where the multicast hash table lives. + * The table is 64 bytes long, giving us a 512-bit table. We have to set + * the bit that corresponds to the broadcast address in order to enable + * reception of broadcast frames. + */ +#define CUE_MCAST_TABLE_ADDR 0xFA80 +#define CUE_MCAST_TABLE_LEN 64 + +#define CUE_TIMEOUT 1000 +#define CUE_MIN_FRAMELEN 60 +#define CUE_RX_FRAMES 1 +#define CUE_TX_FRAMES 1 + +#define CUE_CTL_READ 0x01 +#define CUE_CTL_WRITE 0x02 + +#define CUE_CONFIG_IDX 0 /* config number 1 */ +#define CUE_IFACE_IDX 0 + +/* The interrupt endpoint is currently unused by the KLSI part. */ +#define CUE_ENDPT_MAX 4 + +struct cue_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + struct usb2_config_td sc_config_td; + struct usb2_callout sc_watchdog; + struct mtx sc_mtx; + + struct ifnet *sc_ifp; + device_t sc_dev; + struct usb2_device *sc_udev; + struct usb2_xfer *sc_xfer[CUE_ENDPT_MAX]; + + uint32_t sc_unit; + + uint16_t sc_flags; +#define CUE_FLAG_READ_STALL 0x0010 /* wait for clearing of stall */ +#define CUE_FLAG_WRITE_STALL 0x0020 /* wait for clearing of stall */ +#define CUE_FLAG_LL_READY 0x0040 /* Lower Layer Ready */ +#define CUE_FLAG_HL_READY 0x0080 /* Higher Layer Ready */ +#define CUE_FLAG_INTR_STALL 0x0100 /* wait for clearing of stall */ +}; Modified: user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2.c Tue Jan 13 20:42:05 2009 (r187189) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2.c Tue Jan 13 21:08:43 2009 (r187190) @@ -90,8 +90,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include /* * Various supported device vendors/products. Copied: user/thompsa/usb/sys/dev/usb2/ethernet/if_kuefw.h (from r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2_fw.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/ethernet/if_kuefw.h Tue Jan 13 21:08:43 2009 (r187190, copy of r187125, user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2_fw.h) @@ -0,0 +1,685 @@ +/*- + * Copyright (c) 1997, 1998, 1999, 2000 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This file contains the firmware needed to make the KLSI chip work, + * along with a few constants related to the QT Engine microcontroller + * embedded in the KLSI part. + * + * Firmware is loaded using the vendor-specific 'send scan data' + * command (0xFF). The basic operation is that we must load the + * firmware, then issue some trigger commands to fix it up and start + * it running. There are three transfers: load the binary code, + * load the 'fixup' (data segment?), then issue a command to + * start the code firmware running. The data itself is prefixed by + * a 16-bit signature word, a 16-bit length value, a type byte + * and an interrupt (command) byte. The code segment is of type + * 0x02 (replacement interrupt vector data) and the fixup segment + * is of type 0x03 (replacement interrupt fixup data). The interrupt + * code is 0x64 (load new code). The length word is the total length + * of the segment minus 7. I precomputed the values and stuck them + * into the appropriate locations within the segments to save some + * work in the driver. + */ + +/* QT controller data block types. */ +/* Write data into specific memory location. */ +#define KUE_QTBTYPE_WRITE_DATA 0x00 +/* Write data into interrupt vector location */ +#define KUE_QTBTYPE_WRITE_INTVEC 0x01 +/* Replace interrupt vector with this data */ +#define KUE_QTBTYPE_REPL_INTVEC 0x02 +/* Fixup interrupt vector code with this data */ +#define KUE_QTBTYPE_FIXUP_INTVEC 0x03 +/* Force jump to location */ +#define KUE_QTBTYPE_JUMP 0x04 +/* Force call to location */ +#define KUE_QTBTYPE_CALL 0x05 +/* Force interrupt call */ +#define KUE_QTBTYPE_CALLINTR 0x06 +/* + * Cause data to be written using the specified QT engine + * interrupt, from starting location in memory for a specified + * number of bytes. + */ +#define KUE_QTBTYPE_WRITE_WITH_INTR 0x07 +/* Cause data from stream to be written using specified QT interrupt. */ +#define KUE_QTBTYPE_WRITE_STR_WITH_INTR 0x08 +/* Cause data to be written to config locations. */ +/* Addresses assume 0xc000 offset. */ +#define KUE_QTBTYPE_WRITE_CONFIG 0x09 + +#define KUE_QTINTR_LOAD_CODE 0x64 +#define KUE_QTINTR_TRIGGER_CODE 0x3B +#define KUE_QTINTR_LOAD_CODE_HIGH 0x9C + +/* Firmware code segment */ +static unsigned char kue_code_seg[] = +{ + /******************************************/ + /* NOTE: B6/C3 is data header signature */ + /* 0xAA/0xBB is data length = total */ + /* bytes - 7, 0xCC is type, 0xDD is */ + /* interrupt to use. */ + /******************************************/ + 0xB6, 0xC3, 0xf7, 0x0e, 0x02, 0x64, + 0x9f, 0xcf, 0xbc, 0x08, 0xe7, 0x57, 0x00, 0x00, + 0x9a, 0x08, 0x97, 0xc1, 0xe7, 0x67, 0xff, 0x1f, + 0x28, 0xc0, 0xe7, 0x87, 0x00, 0x04, 0x24, 0xc0, + 0xe7, 0x67, 0xff, 0xf9, 0x22, 0xc0, 0x97, 0xcf, + 0xe7, 0x09, 0xa2, 0xc0, 0x94, 0x08, 0xd7, 0x09, + 0x00, 0xc0, 0xe7, 0x59, 0xba, 0x08, 0x94, 0x08, + 0x03, 0xc1, 0xe7, 0x67, 0xff, 0xf7, 0x24, 0xc0, + 0xe7, 0x05, 0x00, 0xc0, 0xa7, 0xcf, 0x92, 0x08, + 0xe7, 0x57, 0x00, 0x00, 0x8e, 0x08, 0xa7, 0xa1, + 0x8e, 0x08, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00, + 0xf2, 0x09, 0x0a, 0xc0, 0xe7, 0x57, 0x00, 0x00, + 0xa4, 0xc0, 0xa7, 0xc0, 0x56, 0x08, 0x9f, 0xaf, + 0x70, 0x09, 0xe7, 0x07, 0x00, 0x00, 0xf2, 0x09, + 0xe7, 0x57, 0xff, 0xff, 0x90, 0x08, 0x9f, 0xa0, + 0x40, 0x00, 0xe7, 0x59, 0x90, 0x08, 0x94, 0x08, + 0x9f, 0xa0, 0x40, 0x00, 0xc8, 0x09, 0xa2, 0x08, + 0x08, 0x62, 0x9f, 0xa1, 0x14, 0x0a, 0xe7, 0x57, + 0x00, 0x00, 0x52, 0x08, 0xa7, 0xc0, 0x56, 0x08, + 0x9f, 0xaf, 0x04, 0x00, 0xe7, 0x57, 0x00, 0x00, + 0x8e, 0x08, 0xa7, 0xc1, 0x56, 0x08, 0xc0, 0x09, + 0xa8, 0x08, 0x00, 0x60, 0x05, 0xc4, 0xc0, 0x59, + 0x94, 0x08, 0x02, 0xc0, 0x9f, 0xaf, 0xee, 0x00, + 0xe7, 0x59, 0xae, 0x08, 0x94, 0x08, 0x02, 0xc1, + 0x9f, 0xaf, 0xf6, 0x00, 0x9f, 0xaf, 0x9e, 0x03, + 0xef, 0x57, 0x00, 0x00, 0xf0, 0x09, 0x9f, 0xa1, + 0xde, 0x01, 0xe7, 0x57, 0x00, 0x00, 0x78, 0x08, + 0x9f, 0xa0, 0xe4, 0x03, 0x9f, 0xaf, 0x2c, 0x04, + 0xa7, 0xcf, 0x56, 0x08, 0x48, 0x02, 0xe7, 0x09, + 0x94, 0x08, 0xa8, 0x08, 0xc8, 0x37, 0x04, 0x00, + 0x9f, 0xaf, 0x68, 0x04, 0x97, 0xcf, 0xe7, 0x57, + 0x00, 0x00, 0xa6, 0x08, 0x97, 0xc0, 0xd7, 0x09, + 0x00, 0xc0, 0xc1, 0xdf, 0xc8, 0x09, 0x9c, 0x08, + 0x08, 0x62, 0x1d, 0xc0, 0x27, 0x04, 0x9c, 0x08, + 0x10, 0x94, 0xf0, 0x07, 0xee, 0x09, 0x02, 0x00, + 0xc1, 0x07, 0x01, 0x00, 0x70, 0x00, 0x04, 0x00, + 0xf0, 0x07, 0x44, 0x01, 0x06, 0x00, 0x50, 0xaf, + 0xe7, 0x09, 0x94, 0x08, 0xae, 0x08, 0xe7, 0x17, + 0x14, 0x00, 0xae, 0x08, 0xe7, 0x67, 0xff, 0x07, + 0xae, 0x08, 0xe7, 0x07, 0xff, 0xff, 0xa8, 0x08, + 0xe7, 0x07, 0x00, 0x00, 0xa6, 0x08, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0, + 0xc1, 0xdf, 0x48, 0x02, 0xd0, 0x09, 0x9c, 0x08, + 0x27, 0x02, 0x9c, 0x08, 0xe7, 0x09, 0x20, 0xc0, + 0xee, 0x09, 0xe7, 0xd0, 0xee, 0x09, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0x48, 0x02, 0xc8, 0x37, + 0x04, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x60, + 0x21, 0xc0, 0xc0, 0x37, 0x3e, 0x00, 0x23, 0xc9, + 0xc0, 0x57, 0xb4, 0x05, 0x1b, 0xc8, 0xc0, 0x17, + 0x3f, 0x00, 0xc0, 0x67, 0xc0, 0xff, 0x30, 0x00, + 0x08, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x02, 0xc0, 0x17, 0x4c, 0x00, 0x30, 0x00, + 0x06, 0x00, 0xf0, 0x07, 0xbe, 0x01, 0x0a, 0x00, + 0x48, 0x02, 0xc1, 0x07, 0x02, 0x00, 0xd7, 0x09, + 0x00, 0xc0, 0xc1, 0xdf, 0x51, 0xaf, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0x9f, 0xaf, 0x68, 0x04, + 0x9f, 0xaf, 0xe4, 0x03, 0x97, 0xcf, 0x9f, 0xaf, + 0xe4, 0x03, 0xc9, 0x37, 0x04, 0x00, 0xc1, 0xdf, + 0xc8, 0x09, 0x70, 0x08, 0x50, 0x02, 0x67, 0x02, + 0x70, 0x08, 0xd1, 0x07, 0x00, 0x00, 0xc0, 0xdf, + 0x9f, 0xaf, 0xde, 0x01, 0x97, 0xcf, 0xe7, 0x57, + 0x00, 0x00, 0xaa, 0x08, 0x97, 0xc1, 0xe7, 0x57, + 0x01, 0x00, 0x7a, 0x08, 0x97, 0xc0, 0xc8, 0x09, + 0x6e, 0x08, 0x08, 0x62, 0x97, 0xc0, 0x00, 0x02, + 0xc0, 0x17, 0x0e, 0x00, 0x27, 0x00, 0x34, 0x01, + 0x27, 0x0c, 0x0c, 0x00, 0x36, 0x01, 0xef, 0x57, + 0x00, 0x00, 0xf0, 0x09, 0x9f, 0xc0, 0xbe, 0x02, + 0xe7, 0x57, 0x00, 0x00, 0xb0, 0x08, 0x97, 0xc1, + 0xe7, 0x07, 0x09, 0x00, 0x12, 0xc0, 0xe7, 0x77, + 0x00, 0x08, 0x20, 0xc0, 0x9f, 0xc1, 0xb6, 0x02, + 0xe7, 0x57, 0x09, 0x00, 0x12, 0xc0, 0x77, 0xc9, + 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0xe7, 0x77, + 0x00, 0x08, 0x20, 0xc0, 0x2f, 0xc1, 0xe7, 0x07, + 0x00, 0x00, 0x42, 0xc0, 0xe7, 0x07, 0x05, 0x00, + 0x90, 0xc0, 0xc8, 0x07, 0x0a, 0x00, 0xe7, 0x77, + 0x04, 0x00, 0x20, 0xc0, 0x09, 0xc1, 0x08, 0xda, + 0x7a, 0xc1, 0xe7, 0x07, 0x00, 0x01, 0x42, 0xc0, + 0xe7, 0x07, 0x04, 0x00, 0x90, 0xc0, 0x1a, 0xcf, + 0xe7, 0x07, 0x01, 0x00, 0x7a, 0x08, 0x00, 0xd8, + 0x27, 0x50, 0x34, 0x01, 0x17, 0xc1, 0xe7, 0x77, + 0x02, 0x00, 0x20, 0xc0, 0x79, 0xc1, 0x27, 0x50, + 0x34, 0x01, 0x10, 0xc1, 0xe7, 0x77, 0x02, 0x00, + 0x20, 0xc0, 0x79, 0xc0, 0x9f, 0xaf, 0xd8, 0x02, + 0xe7, 0x05, 0x00, 0xc0, 0x00, 0x60, 0x9f, 0xc0, + 0xde, 0x01, 0x97, 0xcf, 0xe7, 0x07, 0x01, 0x00, + 0xb8, 0x08, 0x06, 0xcf, 0xe7, 0x07, 0x30, 0x0e, + 0x02, 0x00, 0xe7, 0x07, 0x50, 0xc3, 0x12, 0xc0, + 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, 0xe7, 0x07, + 0x01, 0x00, 0xb8, 0x08, 0x97, 0xcf, 0xe7, 0x07, + 0x50, 0xc3, 0x12, 0xc0, 0xe7, 0x07, 0x30, 0x0e, + 0x02, 0x00, 0xe7, 0x07, 0x01, 0x00, 0x7a, 0x08, + 0xe7, 0x07, 0x05, 0x00, 0x90, 0xc0, 0x97, 0xcf, + 0xe7, 0x07, 0x00, 0x01, 0x42, 0xc0, 0xe7, 0x07, + 0x04, 0x00, 0x90, 0xc0, 0xe7, 0x07, 0x00, 0x00, + 0x7a, 0x08, 0xe7, 0x57, 0x0f, 0x00, 0xb2, 0x08, + 0x13, 0xc1, 0x9f, 0xaf, 0x2e, 0x08, 0xca, 0x09, + 0xac, 0x08, 0xf2, 0x17, 0x01, 0x00, 0x5c, 0x00, + 0xf2, 0x27, 0x00, 0x00, 0x5e, 0x00, 0xe7, 0x07, + 0x00, 0x00, 0xb2, 0x08, 0xe7, 0x07, 0x01, 0x00, + 0xb4, 0x08, 0xc0, 0x07, 0xff, 0xff, 0x97, 0xcf, + 0x9f, 0xaf, 0x4c, 0x03, 0xc0, 0x69, 0xb4, 0x08, + 0x57, 0x00, 0x9f, 0xde, 0x33, 0x00, 0xc1, 0x05, + 0x27, 0xd8, 0xb2, 0x08, 0x27, 0xd2, 0xb4, 0x08, + 0xe7, 0x87, 0x01, 0x00, 0xb4, 0x08, 0xe7, 0x67, + 0xff, 0x03, 0xb4, 0x08, 0x00, 0x60, 0x97, 0xc0, + 0xe7, 0x07, 0x01, 0x00, 0xb0, 0x08, 0x27, 0x00, + 0x12, 0xc0, 0x97, 0xcf, 0xc0, 0x09, 0xb6, 0x08, + 0x00, 0xd2, 0x02, 0xc3, 0xc0, 0x97, 0x05, 0x80, + 0x27, 0x00, 0xb6, 0x08, 0xc0, 0x99, 0x82, 0x08, + 0xc0, 0x99, 0xa2, 0xc0, 0x97, 0xcf, 0xe7, 0x07, + 0x00, 0x00, 0xb0, 0x08, 0xc0, 0xdf, 0x97, 0xcf, + 0xc8, 0x09, 0x72, 0x08, 0x08, 0x62, 0x02, 0xc0, + 0x10, 0x64, 0x07, 0xc1, 0xe7, 0x07, 0x00, 0x00, + 0x64, 0x08, 0xe7, 0x07, 0xc8, 0x05, 0x24, 0x00, + 0x97, 0xcf, 0x27, 0x04, 0x72, 0x08, 0xc8, 0x17, + 0x0e, 0x00, 0x27, 0x02, 0x64, 0x08, 0xe7, 0x07, + 0xd6, 0x05, 0x24, 0x00, 0x97, 0xcf, 0xd7, 0x09, + 0x00, 0xc0, 0xc1, 0xdf, 0xe7, 0x57, 0x00, 0x00, + 0x62, 0x08, 0x13, 0xc1, 0x9f, 0xaf, 0x70, 0x03, + 0xe7, 0x57, 0x00, 0x00, 0x64, 0x08, 0x13, 0xc0, + 0xe7, 0x09, 0x64, 0x08, 0x30, 0x01, 0xe7, 0x07, + 0xf2, 0x05, 0x32, 0x01, 0xe7, 0x07, 0x10, 0x00, + 0x96, 0xc0, 0xe7, 0x09, 0x64, 0x08, 0x62, 0x08, + 0x04, 0xcf, 0xe7, 0x57, 0x00, 0x00, 0x64, 0x08, + 0x02, 0xc1, 0x9f, 0xaf, 0x70, 0x03, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0, + 0xc1, 0xdf, 0xc8, 0x09, 0x72, 0x08, 0x27, 0x02, + 0x78, 0x08, 0x08, 0x62, 0x03, 0xc1, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0x27, 0x04, 0x72, 0x08, + 0xe7, 0x05, 0x00, 0xc0, 0xf0, 0x07, 0x40, 0x00, + 0x08, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x02, 0xc0, 0x17, 0x0c, 0x00, 0x30, 0x00, + 0x06, 0x00, 0xf0, 0x07, 0x64, 0x01, 0x0a, 0x00, + 0xc8, 0x17, 0x04, 0x00, 0xc1, 0x07, 0x02, 0x00, + 0x51, 0xaf, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00, + 0x6a, 0x08, 0x97, 0xc0, 0xc1, 0xdf, 0xc8, 0x09, + 0x6a, 0x08, 0x27, 0x04, 0x6a, 0x08, 0x27, 0x52, + 0x6c, 0x08, 0x03, 0xc1, 0xe7, 0x07, 0x6a, 0x08, + 0x6c, 0x08, 0xc0, 0xdf, 0x17, 0x02, 0xc8, 0x17, + 0x0e, 0x00, 0x9f, 0xaf, 0x16, 0x05, 0xc8, 0x05, + 0x00, 0x60, 0x03, 0xc0, 0x9f, 0xaf, 0x80, 0x04, + 0x97, 0xcf, 0x9f, 0xaf, 0x68, 0x04, 0x97, 0xcf, + 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x08, 0x62, + 0x1c, 0xc0, 0xd0, 0x09, 0x72, 0x08, 0x27, 0x02, + 0x72, 0x08, 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, + 0x97, 0x02, 0xca, 0x09, 0xac, 0x08, 0xf2, 0x17, + 0x01, 0x00, 0x04, 0x00, 0xf2, 0x27, 0x00, 0x00, + 0x06, 0x00, 0xca, 0x17, 0x2c, 0x00, 0xf8, 0x77, + 0x01, 0x00, 0x0e, 0x00, 0x06, 0xc0, 0xca, 0xd9, + 0xf8, 0x57, 0xff, 0x00, 0x0e, 0x00, 0x01, 0xc1, + 0xca, 0xd9, 0x22, 0x1c, 0x0c, 0x00, 0xe2, 0x27, + 0x00, 0x00, 0xe2, 0x17, 0x01, 0x00, 0xe2, 0x27, + 0x00, 0x00, 0xca, 0x05, 0x00, 0x0c, 0x0c, 0x00, + 0xc0, 0x17, 0x41, 0x00, 0xc0, 0x67, 0xc0, 0xff, + 0x30, 0x00, 0x08, 0x00, 0x00, 0x02, 0xc0, 0x17, + 0x0c, 0x00, 0x30, 0x00, 0x06, 0x00, 0xf0, 0x07, + 0xdc, 0x00, 0x0a, 0x00, 0xf0, 0x07, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x0c, 0x08, 0x00, 0x40, 0xd1, + 0x01, 0x00, 0xc0, 0x19, 0xa6, 0x08, 0xc0, 0x59, + 0x98, 0x08, 0x04, 0xc9, 0x49, 0xaf, 0x9f, 0xaf, + 0xee, 0x00, 0x4a, 0xaf, 0x67, 0x10, 0xa6, 0x08, + 0xc8, 0x17, 0x04, 0x00, 0xc1, 0x07, 0x01, 0x00, + 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x50, 0xaf, + 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, 0xc0, 0x07, + 0x01, 0x00, 0xc1, 0x09, 0x7c, 0x08, 0xc1, 0x77, + 0x01, 0x00, 0x97, 0xc1, 0xd8, 0x77, 0x01, 0x00, + 0x12, 0xc0, 0xc9, 0x07, 0x4c, 0x08, 0x9f, 0xaf, + 0x64, 0x05, 0x04, 0xc1, 0xc1, 0x77, 0x08, 0x00, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 01:35:08 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3D841065670; Wed, 14 Jan 2009 01:35:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0C8D8FC1E; Wed, 14 Jan 2009 01:35:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E1Z8PB022053; Wed, 14 Jan 2009 01:35:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E1Z8ST022052; Wed, 14 Jan 2009 01:35:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200901140135.n0E1Z8ST022052@svn.freebsd.org> From: Kip Macy Date: Wed, 14 Jan 2009 01:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187206 - user/kmacy/HEAD_fast_net/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 01:35:09 -0000 Author: kmacy Date: Wed Jan 14 01:35:08 2009 New Revision: 187206 URL: http://svn.freebsd.org/changeset/base/187206 Log: - include opt_mpath.h so that RADIX_MPATH will be pulled in - remove locking overhead to forwarding workloads by making forwarding table pcpu Modified: user/kmacy/HEAD_fast_net/sys/netinet/ip_input.c Modified: user/kmacy/HEAD_fast_net/sys/netinet/ip_input.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/netinet/ip_input.c Tue Jan 13 23:57:15 2009 (r187205) +++ user/kmacy/HEAD_fast_net/sys/netinet/ip_input.c Wed Jan 14 01:35:08 2009 (r187206) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_mac.h" #include "opt_carp.h" +#include "opt_mpath.h" #include #include @@ -339,7 +340,7 @@ ip_init(void) netisr_register(NETISR_IP, ip_input, &ipintrq, 0); ipv4_ft = flowtable_alloc(ip_pcpu_flowtable_size, FL_PCPU); - ipv4_forward_ft = flowtable_alloc(ip_global_flowtable_size, FL_HASH_PORTS); + ipv4_forward_ft = flowtable_alloc(ip_global_flowtable_size, FL_HASH_PORTS|FL_PCPU); } void From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 12:50:20 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A0AF10656E9; Wed, 14 Jan 2009 12:50:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC88D8FC26; Wed, 14 Jan 2009 12:50:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ECoJLD043680; Wed, 14 Jan 2009 12:50:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ECoJne043679; Wed, 14 Jan 2009 12:50:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141250.n0ECoJne043679@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 12:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187216 - user/luigi/geom_sched/sys/i386/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 12:50:21 -0000 Author: luigi Date: Wed Jan 14 12:50:19 2009 New Revision: 187216 URL: http://svn.freebsd.org/changeset/base/187216 Log: enable some tracing Modified: user/luigi/geom_sched/sys/i386/conf/DISKLESS Modified: user/luigi/geom_sched/sys/i386/conf/DISKLESS ============================================================================== --- user/luigi/geom_sched/sys/i386/conf/DISKLESS Wed Jan 14 12:16:14 2009 (r187215) +++ user/luigi/geom_sched/sys/i386/conf/DISKLESS Wed Jan 14 12:50:19 2009 (r187216) @@ -16,6 +16,10 @@ options IPFIREWALL_DEFAULT_TO_AC options IPDIVERT options DUMMYNET +options KTR +options KTR_ENTRIES 65536 +options ALQ +options KTR_ALQ # added against GENERIC options BOOTP options BOOTP_NFSROOT From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 12:55:33 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C76BA106564A; Wed, 14 Jan 2009 12:55:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC6488FC0C; Wed, 14 Jan 2009 12:55:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ECtXvR043825; Wed, 14 Jan 2009 12:55:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ECtX7L043823; Wed, 14 Jan 2009 12:55:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141255.n0ECtX7L043823@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 12:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187217 - in user/luigi/geom_sched/sys: geom sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 12:55:34 -0000 Author: luigi Date: Wed Jan 14 12:55:33 2009 New Revision: 187217 URL: http://svn.freebsd.org/changeset/base/187217 Log: reduce diffs against RELENG_7 Modified: user/luigi/geom_sched/sys/geom/geom_io.c user/luigi/geom_sched/sys/sys/bio.h Modified: user/luigi/geom_sched/sys/geom/geom_io.c ============================================================================== --- user/luigi/geom_sched/sys/geom/geom_io.c Wed Jan 14 12:50:19 2009 (r187216) +++ user/luigi/geom_sched/sys/geom/geom_io.c Wed Jan 14 12:55:33 2009 (r187217) @@ -169,6 +169,9 @@ g_clone_bio(struct bio *bp) bp2->bio_parent = bp; bp2->bio_cmd = bp->bio_cmd; bp2->bio_length = bp->bio_length; +#ifdef BIO_HAS_CLASSIFY_FIELD + bp2->bio_classify = bp->bio_classify; +#endif bp2->bio_offset = bp->bio_offset; bp2->bio_data = bp->bio_data; bp2->bio_attribute = bp->bio_attribute; @@ -369,14 +372,21 @@ g_io_request(struct bio *bp, struct g_co bp->bio_error = 0; bp->bio_completed = 0; -#if 0 + { /* - * Scheduler support: if this is the first element in the geom - * chain (we know from bp->bio_parent == NULL), store - * the thread that originated the request in bp->bio_caller1, - * which should be unused in this particular entry (at least - * with the code in 7.1/8.0). + * Scheduler support: add classification info to the bio + * (in linux this is called an 'iocontext', we do not have + * it in FreeBSD yet. + * If there is no dedicated field in the bio, use the + * bp->bio_caller1 field in the root of the bio chain, + * which should be unused (at least in 7.x/8.0). + * If we do not do it here, expect someone else to do it, + * e.g. a wrapper function around g_io_requests. */ +#ifdef BIO_HAS_CLASSIFY_FIELD + if (bio->bio_classify == NULL) + bio->bio_classify = (void *)curthread->td_tid; +#elif defined(USE_PATCHED_KERNEL) { struct bio *top = bp; while (top->bio_parent) @@ -384,26 +394,8 @@ g_io_request(struct bio *bp, struct g_co if (top->bio_caller1 == NULL) top->bio_caller1 = (void *)curthread->td_tid; } -#if 0 -{ - struct bio *top = bp; - static int good = 0, req = 0; - static int last = 0; - - req++; - if (top->bio_caller1 == NULL) { - top->bio_caller1 = (void *)curthread->td_tid; - if (0) printf("new label %p (thr %p) size %d\n", - top->bio_caller1, curthread, (int)top->bio_length); - good++; - } - if (ticks > last) { - last = last + hz; - printf("at %d total %d good %d\n", ticks, req, good); - } -} -#endif -#endif +#endif /* no classification set up here */ + } KASSERT(!(bp->bio_flags & BIO_ONQUEUE), ("Bio already on queue bp=%p", bp)); Modified: user/luigi/geom_sched/sys/sys/bio.h ============================================================================== --- user/luigi/geom_sched/sys/sys/bio.h Wed Jan 14 12:50:19 2009 (r187216) +++ user/luigi/geom_sched/sys/sys/bio.h Wed Jan 14 12:55:33 2009 (r187217) @@ -86,6 +86,9 @@ struct bio { /* XXX: these go away when bio chaining is introduced */ daddr_t bio_pblkno; /* physical block number */ +#ifdef BIO_HAS_CLASSIFY_FIELD + void *bio_classify; +#endif }; /* bio_cmd */ From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 13:41:07 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5DF0106564A; Wed, 14 Jan 2009 13:41:07 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B447F8FC08; Wed, 14 Jan 2009 13:41:07 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EDf71X044622; Wed, 14 Jan 2009 13:41:07 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EDf7X7044620; Wed, 14 Jan 2009 13:41:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141341.n0EDf7X7044620@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 13:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187218 - user/luigi/geom_sched/sbin/geom/class/sched X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 13:41:08 -0000 Author: luigi Date: Wed Jan 14 13:41:07 2009 New Revision: 187218 URL: http://svn.freebsd.org/changeset/base/187218 Log: sync with the code in the private tree Modified: user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 Modified: user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c ============================================================================== --- user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c Wed Jan 14 12:55:33 2009 (r187217) +++ user/luigi/geom_sched/sbin/geom/class/sched/geom_sched.c Wed Jan 14 13:41:07 2009 (r187218) @@ -37,31 +37,46 @@ uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_SCHED_VERSION; -static char sched[] = "as"; +/* + * storage for parameters used by this geom class. + * Right now only the scheduler name is used. + */ +static char sched[] = "rr"; /* default scheduler */ + +/* + * Adapt to differences in geom library. + * in V1 struct g_command misses gc_argname, eld, and G_BOOL is undefined + */ +#if G_LIB_VERSION == 1 +#define G_ARGNAME +#define G_TYPE_BOOL G_TYPE_NUMBER +#else +#define G_ARGNAME NULL, +#endif struct g_command class_commands[] = { { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { - { 's', "sched", sched, G_TYPE_STRING }, + { 'a', "sched", sched, G_TYPE_STRING }, G_OPT_SENTINEL }, - NULL, "[-v] [-s sched] dev ..." + G_ARGNAME "[-v] [-a sched_name] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { G_OPT_SENTINEL }, - NULL, "[-v] prov ..." + G_ARGNAME "[-v] prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] prov ..." + G_ARGNAME "[-fv] prov ..." }, - { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, - "[-v] prov ..." + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + G_ARGNAME "[-v] prov ..." }, G_CMD_SENTINEL }; Modified: user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 ============================================================================== --- user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 Wed Jan 14 12:55:33 2009 (r187217) +++ user/luigi/geom_sched/sbin/geom/class/sched/gsched.8 Wed Jan 14 13:41:07 2009 (r187218) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 20, 2007 +.Dd January 10, 2009 .Dt GSCHED 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Nm .Cm create .Op Fl v +.Op Fl a Ar algorithm .Ar dev ... .Nm .Cm configure @@ -50,7 +51,9 @@ .Sh DESCRIPTION The .Nm -utility changes the scheduling policy of the requests going to its providers. +utility (also callable as +.Nm geom sched ... ) +changes the scheduling policy of the requests going to its providers. By now it just uses a C-LOOK policy with a little anticipation. .Pp The first argument to @@ -59,8 +62,18 @@ indicates an action to be performed: .Bl -tag -width ".Cm configure" .It Cm create Set up a scheduling provider on the given devices. +.Ar algorithm +is the name of the scheduling algorithm used for the provider. +At the moment there are two algorithms, +.Ar as +which implements a simple form of anticipatory scheduling, +and +.Ar rr +which implements anticipatory scheduling with round robin service +among clients. +.Pp If the operation succeeds, the new provider should appear with name -.Pa /dev/ Ns Ao Ar dev Ac Ns Pa .sched . +.Pa /dev/ Ns Ao Ar dev Ac Ns Pa -sched- . The kernel module .Pa geom_sched.ko will be loaded if it is not loaded already. @@ -71,16 +84,7 @@ At the moment it is not used at all. Turn off the given scheduling providers. .It Cm reset Do nothing. -.It Cm list -See -.Xr geom 8 . -.It Cm status -See -.Xr geom 8 . -.It Cm load -See -.Xr geom 8 . -.It Cm unload +.It Cm list | status | load | unload See .Xr geom 8 . .El @@ -115,17 +119,23 @@ The following example shows how to creat .Pa /dev/da0 , and how to destroy it. .Bd -literal -offset indent -gsched create -v da0 -gsched destroy -v da0.nop +# load the geom_sched module +kldload geom_sched +# load some scheduler classes used by geom_sched +kldload gsched_rr gsched_as +# configure device ad0 to use scheduler 'rr' +geom sched create -s rr ad0 +# at this point you will have ad0-sched- +# remove the scheduler on the device +geom sched destroy -v ad0-sched- .Ed .Pp -.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 .Sh HISTORY The .Nm -utility still has to appear, and hopefully it will never do. +utility appeared in January 2009. .Sh AUTHORS .An Fabio Checconi Aq fabio@FreeBSD.org From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 13:45:00 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4038C1065674; Wed, 14 Jan 2009 13:45:00 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DC678FC22; Wed, 14 Jan 2009 13:45:00 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EDj0U4044735; Wed, 14 Jan 2009 13:45:00 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EDj0wj044734; Wed, 14 Jan 2009 13:45:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141345.n0EDj0wj044734@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 13:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187219 - user/luigi/geom_sched/sys/i386/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 13:45:00 -0000 Author: luigi Date: Wed Jan 14 13:44:59 2009 New Revision: 187219 URL: http://svn.freebsd.org/changeset/base/187219 Log: fix a typo Modified: user/luigi/geom_sched/sys/i386/conf/DISKLESS Modified: user/luigi/geom_sched/sys/i386/conf/DISKLESS ============================================================================== --- user/luigi/geom_sched/sys/i386/conf/DISKLESS Wed Jan 14 13:41:07 2009 (r187218) +++ user/luigi/geom_sched/sys/i386/conf/DISKLESS Wed Jan 14 13:44:59 2009 (r187219) @@ -17,7 +17,7 @@ options IPDIVERT options DUMMYNET options KTR -options KTR_ENTRIES 65536 +options KTR_ENTRIES=65536 options ALQ options KTR_ALQ # added against GENERIC From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 13:46:01 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C663106567B; Wed, 14 Jan 2009 13:46:01 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69E188FC26; Wed, 14 Jan 2009 13:46:01 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EDk1sS044797; Wed, 14 Jan 2009 13:46:01 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EDk1R0044792; Wed, 14 Jan 2009 13:46:01 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141346.n0EDk1R0044792@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 13:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187220 - user/luigi/geom_sched/sys/geom/sched X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 13:46:02 -0000 Author: luigi Date: Wed Jan 14 13:46:01 2009 New Revision: 187220 URL: http://svn.freebsd.org/changeset/base/187220 Log: sync with private tree Added: user/luigi/geom_sched/sys/geom/sched/gs_scheduler.h (contents, props changed) - copied, changed from r186940, user/luigi/geom_sched/sys/geom/sched/g_gsched.h Deleted: user/luigi/geom_sched/sys/geom/sched/g_gsched.h Modified: user/luigi/geom_sched/sys/geom/sched/g_sched.c user/luigi/geom_sched/sys/geom/sched/g_sched.h user/luigi/geom_sched/sys/geom/sched/gs_as.c user/luigi/geom_sched/sys/geom/sched/gs_rr.c Modified: user/luigi/geom_sched/sys/geom/sched/g_sched.c ============================================================================== --- user/luigi/geom_sched/sys/geom/sched/g_sched.c Wed Jan 14 13:44:59 2009 (r187219) +++ user/luigi/geom_sched/sys/geom/sched/g_sched.c Wed Jan 14 13:46:01 2009 (r187220) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Fabio Checconi + * Copyright (c) 2009 Fabio Checconi * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +/* + * The main control module for geom-based disk schedulers + */ #include #include @@ -37,20 +40,16 @@ #include #include /* we access curthread */ #include -#include "g_gsched.h" -#include "g_sched.h" - -SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, sched, CTLFLAG_RW, 0, "GEOM_SCHED stuff"); -static u_int g_sched_debug = 0; -SYSCTL_UINT(_kern_geom_sched, OID_AUTO, debug, CTLFLAG_RW, &g_sched_debug, 0, - "Debug level"); +#include "gs_scheduler.h" +#include "g_sched.h" /* geom hooks */ static int g_sched_destroy(struct g_geom *gp, boolean_t force); -static int g_sched_destroy_geom(struct gctl_req *req, struct g_class *mp, - struct g_geom *gp); +static int g_sched_destroy_geom(struct gctl_req *req, + struct g_class *mp, struct g_geom *gp); static void g_sched_config(struct gctl_req *req, struct g_class *mp, const char *verb); +static struct g_geom * +g_sched_taste(struct g_class *mp, struct g_provider *pp, int flags __unused); static void g_sched_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); static void g_sched_init(struct g_class *mp); @@ -60,15 +59,44 @@ struct g_class g_sched_class = { .name = G_SCHED_CLASS_NAME, .version = G_VERSION, .ctlreq = g_sched_config, + .taste = g_sched_taste, .destroy_geom = g_sched_destroy_geom, .init = g_sched_init, .fini = g_sched_fini }; -static struct mtx g_gsched_mtx; -LIST_HEAD(gsched_list, g_gsched); -static struct gsched_list gsched_list; +MALLOC_DEFINE(M_GEOM_SCHED, "GEOM_SCHED", "Geom schedulers data structures"); + +/* + * Global variables describing the state of the geom_sched module. + */ +LIST_HEAD(gs_list, g_gsched); /* type, link field */ +struct geom_sched_vars { + struct mtx gs_mtx; + struct gs_list gs_scheds; /* list of schedulers */ + int gs_sched_count; /* how many schedulers ? */ + u_int gs_debug; + int gs_patched; /* g_io_request was patched */ + char gs_names[256]; /* names of schedulers */ +}; + +static struct geom_sched_vars me; + +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, sched, CTLFLAG_RW, 0, + "GEOM_SCHED stuff"); +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, debug, CTLFLAG_RW, + &me.gs_debug, 0, "Debug level"); +SYSCTL_UINT(_kern_geom_sched, OID_AUTO, sched_count, CTLFLAG_RD, + &me.gs_sched_count, 0, "Number of schedulers"); +SYSCTL_STRING(_kern_geom_sched, OID_AUTO, schedulers, CTLFLAG_RD, + &me.gs_names, 0, "Scheduler names"); +/* + * This module calls the scheduler algorithms with this lock held. + * The functions are exposed so the scheduler algorithms can also + * protect themselves e.g. when running a callout handler. + */ void g_sched_lock(struct g_geom *gp) { @@ -85,6 +113,10 @@ g_sched_unlock(struct g_geom *gp) mtx_unlock(&sc->sc_mtx); } +/* + * Handle references to the module, which are coming from devices + * using this scheduler. + */ static inline void g_gsched_ref(struct g_gsched *gsp) { @@ -96,51 +128,85 @@ static inline void g_gsched_unref(struct g_gsched *gsp) { - /* - * The last reference to a gsp before releasing it is the one - * of the gsched_list. Elements are not released nor removed - * from the list until there is an external reference to them. - */ atomic_add_int(&gsp->gs_refs, -1); } +void +g_sched_dispatch(struct g_geom *gp) +{ + struct g_sched_softc *sc = gp->softc; + struct g_gsched *gsp = sc->sc_gsched; + struct bio *bp; + + mtx_assert(&sc->sc_mtx, MTX_OWNED); + while ((bp = gsp->gs_next(sc->sc_data)) != NULL) + g_io_request(bp, LIST_FIRST(&gp->consumer)); +} + static struct g_gsched * g_gsched_find(const char *name) { struct g_gsched *gsp = NULL; - mtx_lock(&g_gsched_mtx); - LIST_FOREACH(gsp, &gsched_list, glist) + mtx_lock(&me.gs_mtx); + LIST_FOREACH(gsp, &me.gs_scheds, glist) if (strcmp(name, gsp->gs_name) == 0) { g_gsched_ref(gsp); break; } - mtx_unlock(&g_gsched_mtx); + mtx_unlock(&me.gs_mtx); return gsp; } -static int -g_gsched_register(struct g_gsched *gsp) +/* + * rebuild the list of scheduler names. + * To be called with lock held. + */ +static void +g_gsched_build_names(struct g_gsched *gsp) { - struct g_gsched *tmp; - int error; + int pos, l; + struct g_gsched *cur; - error = 0; - mtx_lock(&g_gsched_mtx); - LIST_FOREACH(tmp, &gsched_list, glist) - if (strcmp(gsp->gs_name, tmp->gs_name) == 0) { - G_SCHED_DEBUG(0, "A scheduler named %s already" - "exists.", gsp->gs_name); - error = EEXIST; - goto out; + pos = 0; + LIST_FOREACH(cur, &me.gs_scheds, glist) { + l = strlen(cur->gs_name); + if (l + pos + 1 + 1 < sizeof(me.gs_names)) { + if (pos != 0) + me.gs_names[pos++] = ' '; + strcpy(me.gs_names + pos, cur->gs_name); + pos += l; } + } + me.gs_names[pos] = '\0'; +} - LIST_INSERT_HEAD(&gsched_list, gsp, glist); - gsp->gs_refs = 1; +/* + * Register or unregister individual scheduling algorithms. + */ +static int +g_gsched_register(struct g_gsched *gsp) +{ + struct g_gsched *cur; + int error = 0; -out: - mtx_unlock(&g_gsched_mtx); + mtx_lock(&me.gs_mtx); + LIST_FOREACH(cur, &me.gs_scheds, glist) { + if (strcmp(gsp->gs_name, cur->gs_name) == 0) + break; + } + if (cur != NULL) { + G_SCHED_DEBUG(0, "A scheduler named %s already" + "exists.", gsp->gs_name); + error = EEXIST; + } else { + LIST_INSERT_HEAD(&me.gs_scheds, gsp, glist); + gsp->gs_refs = 1; + me.gs_sched_count++; + g_gsched_build_names(gsp); + } + mtx_unlock(&me.gs_mtx); return (error); } @@ -149,29 +215,46 @@ static int g_gsched_unregister(struct g_gsched *gsp) { struct g_gsched *cur, *tmp; - int error; + int error = 0; + struct g_geom *gp, *gp_tmp; error = 0; - mtx_lock(&g_gsched_mtx); - LIST_FOREACH_SAFE(cur, &gsched_list, glist, tmp) { - if (cur == gsp && gsp->gs_refs != 1) { + mtx_lock(&me.gs_mtx); + + /* scan stuff attached here ? */ + printf("%s, scan attached providers\n", __FUNCTION__); + LIST_FOREACH_SAFE(gp, &g_sched_class.geom, geom, gp_tmp) { + if (gp->class != &g_sched_class) + continue; /* should not happen */ + g_sched_destroy(gp, 0); + } + + + LIST_FOREACH_SAFE(cur, &me.gs_scheds, glist, tmp) { + if (cur != gsp) + continue; + if (gsp->gs_refs != 1) { G_SCHED_DEBUG(0, "%s still in use.", gsp->gs_name); error = EBUSY; - goto out; - } else if (cur == gsp && gsp->gs_refs == 1) { + } else { LIST_REMOVE(gsp, glist); - goto out; + me.gs_sched_count--; + g_gsched_build_names(gsp); } + break; } + if (cur == NULL) + G_SCHED_DEBUG(0, "%s not registered.", gsp->gs_name); - G_SCHED_DEBUG(0, "%s not registered.", gsp->gs_name); - -out: - mtx_unlock(&g_gsched_mtx); + mtx_unlock(&me.gs_mtx); return (error); } +/* + * Module event called when a scheduling algorithm module is loaded or + * unloaded. + */ int g_gsched_modevent(module_t mod, int cmd, void *arg) { @@ -182,23 +265,44 @@ g_gsched_modevent(module_t mod, int cmd, switch (cmd) { case MOD_LOAD: error = g_gsched_register(gsp); + printf("loaded module %s error %d\n", gsp->gs_name, error); + if (error == 0) + g_retaste(&g_sched_class); break; case MOD_UNLOAD: error = g_gsched_unregister(gsp); + printf("unloading for scheduler %s error %d\n", + gsp->gs_name, error); break; }; return (error); } -static void -g_sched_orphan(struct g_consumer *cp) +/* + * Lookup the identity of the issuer of the original request. + * In the current implementation we use the curthread of the + * issuer, but different mechanisms may be implemented later + * so we do not make assumptions on the return value which for + * us is just an opaque identifier. + */ +u_long +g_sched_classify(struct bio *bp) { - g_topology_assert(); - g_sched_destroy(cp->geom, 1); + if (bp == NULL) { + printf("g_sched_classify: NULL bio\n"); + return (0); /* as good as anything */ + } + while (bp->bio_parent != NULL) + bp = bp->bio_parent; + return ((u_long)(bp->bio_caller1)); } +/* + * g_sched_done() and g_sched_start() dispatch the geom requests to + * the scheduling algorithm in use. + */ static void g_sched_done(struct bio *bio) { @@ -238,10 +342,29 @@ g_sched_start(struct bio *bp) cbp->bio_to = pp; G_SCHED_LOGREQ(cbp, "Sending request."); gsp = sc->sc_gsched; - gsp->gs_start(sc->sc_data, cbp); + /* + * Call the algorithm's gs_start to queue the request in the + * scheduler. If gs_start fails then pass the request down, + * otherwise call g_sched_dispatch() which tries to push + * one or more requests down. + */ + if (gsp->gs_start(sc->sc_data, cbp)) + g_io_request(cbp, LIST_FIRST(&gp->consumer)); + g_sched_dispatch(gp); g_sched_unlock(gp); } +/* + * The next few functions are the geom glue + */ +static void +g_sched_orphan(struct g_consumer *cp) +{ + + g_topology_assert(); + g_sched_destroy(cp->geom, 1); +} + static int g_sched_access(struct g_provider *pp, int dr, int dw, int de) { @@ -256,23 +379,23 @@ g_sched_access(struct g_provider *pp, in return (error); } +/* + * Create a geom node for the device passed as *pp. + * If successful, add a reference to this gsp. + */ static int g_sched_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, struct g_gsched *gsp) { struct g_sched_softc *sc; struct g_geom *gp; - struct g_provider *newpp; - struct g_consumer *cp; + struct g_provider *newpp = NULL; + struct g_consumer *cp = NULL; char name[64]; int error; g_topology_assert(); - gp = NULL; - newpp = NULL; - cp = NULL; - snprintf(name, sizeof(name), "%s%s", pp->name, G_SCHED_SUFFIX); LIST_FOREACH(gp, &mp->geom, geom) { if (strcmp(gp->name, name) == 0) { @@ -284,7 +407,8 @@ g_sched_create(struct gctl_req *req, str gp = g_new_geomf(mp, name); if (gp == NULL) { gctl_error(req, "Cannot create geom %s.", name); - return (ENOMEM); + error = ENOMEM; + goto fail; } sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); @@ -365,14 +489,14 @@ g_sched_destroy(struct g_geom *gp, boole return (ENXIO); pp = LIST_FIRST(&gp->provider); if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { - if (force) { - G_SCHED_DEBUG(0, "Device %s is still open, so it " - "can't be definitely removed.", pp->name); - } else { - G_SCHED_DEBUG(1, "Device %s is still open (r%dw%de%d).", - pp->name, pp->acr, pp->acw, pp->ace); + const char *msg = force ? + "but we force removal" : "cannot remove"; + + G_SCHED_DEBUG( (force ? 0 : 1) , + "Device %s is still open (r%dw%de%d), %s.", + pp->name, pp->acr, pp->acw, pp->ace, msg); + if (!force) return (EBUSY); - } } else { G_SCHED_DEBUG(0, "Device %s removed.", gp->name); } @@ -398,23 +522,44 @@ g_sched_destroy_geom(struct gctl_req *re } /* - * The code below patches g_io_request() to call g_new_io_request() first. + * Functions related to the classification of requests. + * In principle, we need to store in the 'struct bio' a reference + * to the issuer of the request and all info that can be useful for + * classification, accounting and so on. + * In the final version this should be done by adding some extra + * field(s) to struct bio, and marking the bio as soon as it is + * posted to the geom queue (but not later, as requests are managed + * by the g_down thread afterwards). + * + * XXX TEMPORARY SOLUTION: + * The 'struct bio' in 7.x and 6.x does not have a field for storing + * the classification info, so we abuse the caller1 field in the + * root element of the bio tree. The marking is done at the beginning + * of g_io_request() and only if we find that the field is NULL. + * + * To avoid rebuilding the kernel, this module will patch the + * initial part of g_io_request() so it jumps to a trampoline code + * that calls the marking function ( g_new_io_request() ) and then + * executes the original body of g_io_request(). + * THIS IS A HACK THAT WILL GO AWAY IN THE FINAL VERSION. + * * We must be careful with the compiler, as it may clobber the * parameters on the stack so they are not preserved for the * continuation of the original function. * Ideally we should write everything in assembler: - mov 0x8(%esp), %edx // load bp + mov 0x8(%esp), %eax // load bp + 2: mov %eax, %edx mov 0x64(%edx),%eax // load bp->bio_parent test %eax,%eax - jne 1f - mov 0x30(%edx),%eax // load bp->bio_caller1 + jne 2b // follow the pointer + mov 0x30(%edx),%eax // load bp->bio_caller1 test %eax,%eax - jne 1f + jne 1f // already set, never mind mov %fs:0x0,%eax // pcpu pointer mov 0x34(%eax),%eax // curthread mov %eax,0x30(%edx) // store in bp->bio_caller1 - 1: // old function + 1: // header of the old function push %ebp mov %esp, %ebp push %edi @@ -423,6 +568,11 @@ g_sched_destroy_geom(struct gctl_req *re */ +#if !defined(__i386__) +#error please add the code in g_new_io_request() to the beginning of \ + /sys/geom/geom_io.c::g_io_request(), and remove this line. +#else +/* i386-only code, trampoline + patching support */ static unsigned char g_io_trampoline[] = { 0xe8, 0x00, 0x00, 0x00, 0x00, /* call foo */ @@ -438,11 +588,12 @@ g_new_io_request(const char *ret, struct { /* - * Scheduler support: if this is the first element in the geom - * chain (we know from bp->bio_parent == NULL), store - * the thread that originated the request in bp->bio_caller1, - * which should be unused in this particular entry (at least - * with the code in 7.1/8.0). + * bio classification: if bio_caller1 is available in the + * root of the 'struct bio' tree, store there the thread id + * of the thread that originated the request. + * More sophisticated classification schemes can be used. + * XXX do not change this code without making sure that + * the compiler does not clobber the arguments. */ struct bio *top = bp; if (top) { @@ -451,19 +602,19 @@ g_new_io_request(const char *ret, struct if (top->bio_caller1 == NULL) top->bio_caller1 = (void *)curthread->td_tid; } - return (bp != top); /* prevent compiler from clobbering bp */ + return (bp != top); /* prevent compiler from clobbering bp */ } -static int g_io_patched = 0; static int g_io_patch(void *f, void *p, void *new_f) { int found = bcmp(f, (const char *)p + 5, 5); + printf("match result %d\n", found); if (found == 0) { int ofs; - printf("patching function\n"); + printf("patching g_io_request\n"); /* link the trampoline to the new function */ ofs = (int)new_f - ((int)p + 5); bcopy(&ofs, (char *)p + 1, 4); @@ -474,34 +625,141 @@ g_io_patch(void *f, void *p, void *new_f *(unsigned char *)f = 0xe9; /* jump opcode */ ofs = (int)p - ((int)f + 5); bcopy(&ofs, (char *)f + 1, 4); - g_io_patched = 1; + me.gs_patched = 1; } return 0; } +#endif /* __i386__ */ static void g_sched_init(struct g_class *mp) { - mtx_init(&g_gsched_mtx, "gsched", NULL, MTX_DEF); - LIST_INIT(&gsched_list); + mtx_init(&me.gs_mtx, "gsched", NULL, MTX_DEF); + LIST_INIT(&me.gs_scheds); printf("%s loading...\n", __FUNCTION__); +#if defined(__i386__) /* patch g_io_request to set the thread */ g_io_patch(g_io_request, g_io_trampoline, g_new_io_request); +#endif } static void g_sched_fini(struct g_class *mp) { - if (g_io_patched) { - /* restore the original g_io_request */ +#if defined(__i386__) + if (me.gs_patched) { + printf("/* restore the original g_io_request */\n"); bcopy(g_io_trampoline + 5, (char *)g_io_request, 5); } +#endif printf("%s unloading...\n", __FUNCTION__); - KASSERT(LIST_EMPTY(&gsched_list), ("still registered schedulers")); - mtx_destroy(&g_gsched_mtx); + KASSERT(LIST_EMPTY(&gs_scheds), ("still registered schedulers")); + mtx_destroy(&me.gs_mtx); +} + +/* + * We accept a "/dev/" prefix on device names, we want the + * provider name that is after that. + */ +static const char *dev_prefix = "/dev/"; + +/* + * read the i-th argument for a request + */ +static const char * +g_sched_argi(struct gctl_req *req, int i) +{ + const char *name; + char param[16]; + int l = strlen(dev_prefix); + + snprintf(param, sizeof(param), "arg%d", i); + name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%d' argument", i); + return NULL; + } + if (strncmp(name, dev_prefix, l) == 0) + name += l; + return name; +} + +/* + * fetch nargs and do appropriate checks. + */ +static int +g_sched_get_nargs(struct gctl_req *req) +{ + int *nargs; + + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No 'nargs' argument"); + return 0; + } + if (*nargs <= 0) + gctl_error(req, "Missing device(s)."); + return *nargs; +} + +/* + * Check whether we should add the class on certain volumes when + * this geom is created. Right now this is under control of a kenv + * variable containing the names of all devices that we care about. + */ +static struct g_geom * +g_sched_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) +{ + struct g_gsched *gsp = NULL; /* the sched. algorithm we want */ + const char *s; /* generic string pointer */ + const char *taste_names; /* devices we like */ + int l; + + g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); + g_topology_assert(); + + G_SCHED_DEBUG(2, "Tasting %s.", pp->name); + + do { + /* do not allow taste on ourselves */ + if (strcmp(pp->geom->class->name, mp->name) == 0) + break; + + taste_names = getenv("geom.sched.taste"); + if (taste_names == NULL) + break; + + l = strlen(pp->name); + for (s = taste_names; *s && + (s = strstr(s, pp->name)); s++) { + /* further checks for an exact match */ + if ( (s == taste_names || s[-1] == ' ') && + (s[l] == '\0' || s[l] == ' ') ) + break; + } + if (s == NULL) + break; + printf("attach device %s match [%s]\n", + pp->name, s); + + /* look up the provider name in the list */ + s = getenv("geom.sched.algo"); + if (s == NULL) + s = "rr"; + + gsp = g_gsched_find(s); /* also get a reference */ + if (gsp == NULL) { + printf("Bad '%s' algorithm\n", s); + break; + } + + g_sched_create(NULL, mp, pp, gsp); + g_gsched_unref(gsp); + } while (0); + return NULL; } static void @@ -510,8 +768,7 @@ g_sched_ctl_create(struct gctl_req *req, struct g_provider *pp; struct g_gsched *gsp; const char *name; - char param[16]; - int i, *nargs; + int i, nargs; g_topology_assert(); @@ -521,43 +778,32 @@ g_sched_ctl_create(struct gctl_req *req, return; } - gsp = g_gsched_find(name); + gsp = g_gsched_find(name); /* also get a reference */ if (gsp == NULL) { gctl_error(req, "Bad '%s' argument", "sched"); return; } - nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); - if (nargs == NULL) { - gctl_error(req, "No '%s' argument", "nargs"); - goto out; - } - - if (*nargs <= 0) { - gctl_error(req, "Missing device(s)."); - goto out; - } + nargs = g_sched_get_nargs(req); - for (i = 0; i < *nargs; i++) { - snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); - goto out; - } - if (strncmp(name, "/dev/", strlen("/dev/")) == 0) - name += strlen("/dev/"); + /* + * Run on the arguments, and break on any error. + * We look for a device name, but skip the /dev/ prefix if any. + */ + for (i = 0; i < nargs; i++) { + name = g_sched_argi(req, i); + if (name == NULL) + break; pp = g_provider_by_name(name); if (pp == NULL) { G_SCHED_DEBUG(1, "Provider %s is invalid.", name); gctl_error(req, "Provider %s is invalid.", name); - goto out; + break; } if (g_sched_create(req, mp, pp, gsp) != 0) break; } -out: g_gsched_unref(gsp); } @@ -567,43 +813,27 @@ g_sched_ctl_configure(struct gctl_req *r struct g_sched_softc *sc; struct g_provider *pp; const char *name; - char param[16]; - int i, *nargs; + int i, nargs; g_topology_assert(); - nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); - if (nargs == NULL) { - gctl_error(req, "No '%s' argument", "nargs"); - return; - } - - if (*nargs <= 0) { - gctl_error(req, "Missing device(s)."); - return; - } - - for (i = 0; i < *nargs; i++) { - snprintf(param, sizeof(param), "arg%d", i); + nargs = g_sched_get_nargs(req); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); - return; - } - - if (strncmp(name, "/dev/", strlen("/dev/")) == 0) - name += strlen("/dev/"); + for (i = 0; i < nargs; i++) { + name = g_sched_argi(req, i); + if (name == NULL) + break; pp = g_provider_by_name(name); if (pp == NULL || pp->geom->class != mp) { G_SCHED_DEBUG(1, "Provider %s is invalid.", name); gctl_error(req, "Provider %s is invalid.", name); - return; + break; } sc = pp->geom->softc; + /* still unimplemented, so we exit! */ gctl_error(req, "Reconfiguration not supported yet."); - return; + break; } } @@ -622,23 +852,13 @@ g_sched_find_geom(struct g_class *mp, co static void g_sched_ctl_destroy(struct gctl_req *req, struct g_class *mp) { - int *nargs, *force, error, i; + int nargs, *force, error, i; struct g_geom *gp; const char *name; - char param[16]; g_topology_assert(); - nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); - if (nargs == NULL) { - gctl_error(req, "No '%s' argument", "nargs"); - return; - } - - if (*nargs <= 0) { - gctl_error(req, "Missing device(s)."); - return; - } + nargs = g_sched_get_nargs(req); force = gctl_get_paraml(req, "force", sizeof(*force)); if (force == NULL) { @@ -646,29 +866,23 @@ g_sched_ctl_destroy(struct gctl_req *req return; } - for (i = 0; i < *nargs; i++) { - snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); - return; - } - - if (strncmp(name, "/dev/", strlen("/dev/")) == 0) - name += strlen("/dev/"); + for (i = 0; i < nargs; i++) { + name = g_sched_argi(req, i); + if (name == NULL) + break; gp = g_sched_find_geom(mp, name); if (gp == NULL) { G_SCHED_DEBUG(1, "Device %s is invalid.", name); gctl_error(req, "Device %s is invalid.", name); - return; + break; } error = g_sched_destroy(gp, *force); if (error != 0) { gctl_error(req, "Cannot destroy device %s (error=%d).", gp->name, error); - return; + break; } } } @@ -713,5 +927,4 @@ g_sched_dumpconf(struct sbuf *sb, const } DECLARE_GEOM_CLASS(g_sched_class, g_sched); -MODULE_VERSION(g_sched, 0); - +MODULE_VERSION(geom_sched, 0); Modified: user/luigi/geom_sched/sys/geom/sched/g_sched.h ============================================================================== --- user/luigi/geom_sched/sys/geom/sched/g_sched.h Wed Jan 14 13:44:59 2009 (r187219) +++ user/luigi/geom_sched/sys/geom/sched/g_sched.h Wed Jan 14 13:46:01 2009 (r187220) @@ -27,15 +27,19 @@ #ifndef _G_SCHED_H_ #define _G_SCHED_H_ +/* + * header for the geom_sched class (userland library and kernel part) + */ + #define G_SCHED_CLASS_NAME "SCHED" #define G_SCHED_VERSION 0 -#define G_SCHED_SUFFIX ".sched." +#define G_SCHED_SUFFIX "-sched-" #ifdef _KERNEL #define G_SCHED_DEBUG(lvl, ...) do { \ - if (g_sched_debug >= (lvl)) { \ + if (me.gs_debug >= (lvl)) { \ printf("GEOM_SCHED"); \ - if (g_sched_debug > 0) \ + if (me.gs_debug > 0) \ printf("[%u]", lvl); \ printf(": "); \ printf(__VA_ARGS__); \ @@ -44,7 +48,7 @@ } while (0) #define G_SCHED_LOGREQ(bp, ...) do { \ - if (g_sched_debug >= 2) { \ + if (me.gs_debug >= 2) { \ printf("GEOM_SCHED[2]: "); \ printf(__VA_ARGS__); \ printf(" "); \ @@ -53,9 +57,6 @@ } \ } while (0) -struct mtx; -struct g_gsched; - struct g_sched_softc { void *sc_data; /* scheduler private data */ struct mtx sc_mtx; Modified: user/luigi/geom_sched/sys/geom/sched/gs_as.c ============================================================================== --- user/luigi/geom_sched/sys/geom/sched/gs_as.c Wed Jan 14 13:44:59 2009 (r187219) +++ user/luigi/geom_sched/sys/geom/sched/gs_as.c Wed Jan 14 13:46:01 2009 (r187220) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008 Fabio Checconi + * Copyright (c) 2009 Fabio Checconi * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,6 +24,13 @@ * SUCH DAMAGE. */ +/* + * This code implements the algorithm for Anticipatory disk Scheduler (AS). + * This version does not track process state or behaviour, and is + * just a proof of concept to show how non work-conserving policies + * can be implemented within this framework. + */ + #include #include @@ -37,168 +44,173 @@ #include #include -#include -#include +#include "gs_scheduler.h" /* * Status values for AS. */ -#define G_AS_NOWAIT 0 /* Not wating at all. */ -#define G_AS_WAITREQ 1 /* Waiting a request to complete. */ -#define G_AS_WAITING 2 /* Waiting a new request. */ - -struct gs_as_softc { - struct disk *sc_disk; +enum g_as_status { + G_AS_NOWAIT = 0, /* Not waiting at all. */ + G_AS_WAITREQ, /* Waiting a request to complete. */ + G_AS_WAITING /* Waiting a new request. */ +}; +struct g_as_softc { + struct g_geom *sc_geom; u_long sc_curkey; - int sc_status; + enum g_as_status sc_status; long sc_batch; + int sc_wait_ticks; + int sc_max_batch; struct callout sc_wait; struct bio_queue_head sc_bioq; }; -#define G_AS_WAIT_EXPIRE (hz/200 > 0 ? hz/200 : 2) -#define G_AS_MAX_BATCH 0x00800000 - /* - * Dispatch the first queued request. Here we also update the status + * Return the first queued request, and update the status * according to the dispatched request. + * This is called as a result of a start, on a timeout, or on + * a completion event, by g_sched_dispatch(). */ static struct bio * -gs_as_next(void *data, int force) +g_as_next(void *data) { - struct gs_as_softc *sc; + struct g_as_softc *sc = data; struct bio *bio; + u_long head_key; - sc = data; - - if (sc->sc_status != G_AS_NOWAIT && force == 0) - return (NULL); + if (sc->sc_status != G_AS_NOWAIT) + return NULL; /* - * Batching means just don't serve too many requests waiting - * for sequential ones, it is not really coupled with the - * threads being served. Its only purpose is to let not the - * scheduler starve other threads while an aggressive one - * is making continuously new requests. + * Serve the requests at the head of the queue, if any, and + * decide whether or not to do anticipatory scheduling for + * the next round. + * We do anticipation if this request is from a new client, + * or if the current client has not yet exhausted its budget. + * Otherwise, we will serve the next request immediately. */ - sc->sc_curkey = NULL; bio = bioq_takefirst(&sc->sc_bioq); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 17:25:28 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66C310656C1; Wed, 14 Jan 2009 17:25:28 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3FCA8FC12; Wed, 14 Jan 2009 17:25:28 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EHPSgX049241; Wed, 14 Jan 2009 17:25:28 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EHPS1I049234; Wed, 14 Jan 2009 17:25:28 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141725.n0EHPS1I049234@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 17:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187227 - in user/luigi/geom_sched/sys: conf dev/ata geom X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 17:25:29 -0000 Author: luigi Date: Wed Jan 14 17:25:28 2009 New Revision: 187227 URL: http://svn.freebsd.org/changeset/base/187227 Log: revert the changes for the in-driver scheduler. They are not used now and interfere with debugging of the other code. Modified: user/luigi/geom_sched/sys/conf/files user/luigi/geom_sched/sys/dev/ata/ata-all.h user/luigi/geom_sched/sys/dev/ata/ata-disk.c user/luigi/geom_sched/sys/dev/ata/ata-queue.c user/luigi/geom_sched/sys/geom/geom_disk.c user/luigi/geom_sched/sys/geom/geom_disk.h user/luigi/geom_sched/sys/geom/geom_io.c Modified: user/luigi/geom_sched/sys/conf/files ============================================================================== --- user/luigi/geom_sched/sys/conf/files Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/conf/files Wed Jan 14 17:25:28 2009 (r187227) @@ -1283,7 +1283,7 @@ geom/geom_mbr_enc.c optional geom_mbr geom/geom_pc98.c optional geom_pc98 geom/geom_pc98_enc.c optional geom_pc98 geom/geom_slice.c standard -geom/geom_sched.c standard +# geom/geom_sched.c standard geom/geom_subr.c standard geom/geom_sunlabel.c optional geom_sunlabel geom/geom_sunlabel_enc.c optional geom_sunlabel Modified: user/luigi/geom_sched/sys/dev/ata/ata-all.h ============================================================================== --- user/luigi/geom_sched/sys/dev/ata/ata-all.h Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/dev/ata/ata-all.h Wed Jan 14 17:25:28 2009 (r187227) @@ -510,7 +510,6 @@ struct ata_channel { TAILQ_HEAD(, ata_request) ata_queue; /* head of ATA queue */ struct ata_request *freezepoint; /* composite freezepoint */ struct ata_request *running; /* currently running request */ - struct disk *disks[2]; /* disks, if any */ }; /* disk bay/enclosure related */ @@ -547,9 +546,6 @@ int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); int ata_limit_mode(device_t dev, int mode, int maxmode); -/* ata-disk.c */ -struct ata_request *ata_create_request(struct bio *bp, int full); - /* ata-queue.c: */ int ata_controlcmd(device_t dev, u_int8_t command, u_int16_t feature, u_int64_t lba, u_int16_t count); int ata_atapicmd(device_t dev, u_int8_t *ccb, caddr_t data, int count, int flags, int timeout); Modified: user/luigi/geom_sched/sys/dev/ata/ata-disk.c ============================================================================== --- user/luigi/geom_sched/sys/dev/ata/ata-disk.c Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/dev/ata/ata-disk.c Wed Jan 14 17:25:28 2009 (r187227) @@ -60,7 +60,6 @@ static void ad_describe(device_t dev); static int ad_version(u_int16_t); static disk_strategy_t ad_strategy; static disk_ioctl_t ad_ioctl; -static disk_kick_t ad_kick; static dumper_t ad_dump; /* @@ -149,7 +148,6 @@ ad_attach(device_t dev) adp->disk = disk_alloc(); adp->disk->d_strategy = ad_strategy; adp->disk->d_ioctl = ad_ioctl; - adp->disk->d_kick = ad_kick; adp->disk->d_dump = ad_dump; adp->disk->d_name = "ad"; adp->disk->d_drv1 = dev; @@ -170,7 +168,6 @@ ad_attach(device_t dev) snprintf(adp->disk->d_ident, sizeof(adp->disk->d_ident), "ad:%s", atadev->param.serial); disk_create(adp->disk, DISK_VERSION); - ch->disks[atadev->unit == ATA_SLAVE] = adp->disk; device_add_child(dev, "subdisk", device_get_unit(dev)); ad_firmware_geom_adjust(dev, adp->disk); bus_generic_attach(dev); @@ -182,7 +179,6 @@ ad_attach(device_t dev) static int ad_detach(device_t dev) { - struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ad_softc *adp = device_get_ivars(dev); struct ata_device *atadev = device_get_softc(dev); device_t *children; @@ -203,8 +199,6 @@ ad_detach(device_t dev) free(children, M_TEMP); } - ch->disks[atadev->unit == ATA_SLAVE] = NULL; - /* detroy disk from the system so we dont get any further requests */ disk_destroy(adp->disk); @@ -272,13 +266,13 @@ ad_spindown(void *priv) ata_queue_request(request); } -struct ata_request * -ata_create_request(struct bio *bp, int full) + +static void +ad_strategy(struct bio *bp) { - device_t dev = bp->bio_disk->d_drv1; + device_t dev = bp->bio_disk->d_drv1; struct ata_device *atadev = device_get_softc(dev); struct ata_request *request; - struct ata_channel *ch; if (atadev->spindown != 0) callout_reset(&atadev->spindown_timer, hz * atadev->spindown, @@ -287,7 +281,7 @@ ata_create_request(struct bio *bp, int f if (!(request = ata_alloc_request())) { device_printf(dev, "FAILURE - out of memory in start\n"); biofinish(bp, NULL, ENOMEM); - return NULL; + return; } /* setup request */ @@ -350,32 +344,10 @@ ata_create_request(struct bio *bp, int f device_printf(dev, "FAILURE - unknown BIO operation\n"); ata_free_request(request); biofinish(bp, NULL, EIO); - return NULL; + return; } request->flags |= ATA_R_ORDERED; - - if (full != 0) { - if ((request->parent = device_get_parent(dev)) == NULL) { - ata_free_request(request); - biofinish(bp, NULL, ENXIO); - return NULL; - } - - ch = device_get_softc(request->parent); - callout_init_mtx(&request->callout, &ch->state_mtx, - CALLOUT_RETURNUNLOCKED); - } - - return request; -} - -static void -ad_strategy(struct bio *bp) -{ - struct ata_request *request; - - if ((request = ata_create_request(bp, 0)) != NULL) - ata_queue_request(request); + ata_queue_request(request); } static void @@ -397,18 +369,6 @@ ad_ioctl(struct disk *disk, u_long cmd, return ata_device_ioctl(disk->d_drv1, cmd, data); } -static void -ad_kick(struct disk *disk) -{ - device_t dev; - struct ata_channel *ch; - - dev = disk->d_drv1; - ch = device_get_softc(device_get_parent(dev)); - if (ch != NULL) - ata_start(ch->dev); -} - static int ad_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length) Modified: user/luigi/geom_sched/sys/dev/ata/ata-queue.c ============================================================================== --- user/luigi/geom_sched/sys/dev/ata/ata-queue.c Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/dev/ata/ata-queue.c Wed Jan 14 17:25:28 2009 (r187227) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* prototypes */ static void ata_completed(void *, int); @@ -172,25 +171,10 @@ ata_start(device_t dev) struct ata_channel *ch = device_get_softc(dev); struct ata_request *request; struct ata_composite *cptr; - struct disk *dp; - struct bio *bp; - int dependencies = 0, i; - - mtx_lock(&ch->queue_mtx); - if (TAILQ_FIRST(&ch->ata_queue) == NULL) { - for (i = 0; i < 2; i++) { - dp = ch->disks[i]; - while (dp != NULL && (bp = g_sched_next(dp)) != NULL) { - request = ata_create_request(bp, 1); - if (request != NULL) { - ata_sort_queue(ch, request); - break; - } - } - } - } + int dependencies = 0; /* if we have a request on the queue try to get it running */ + mtx_lock(&ch->queue_mtx); if ((request = TAILQ_FIRST(&ch->ata_queue))) { /* we need the locking function to get the lock for this channel */ Modified: user/luigi/geom_sched/sys/geom/geom_disk.c ============================================================================== --- user/luigi/geom_sched/sys/geom/geom_disk.c Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/geom/geom_disk.c Wed Jan 14 17:25:28 2009 (r187227) @@ -55,11 +55,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include static struct mtx g_disk_done_mtx; -static g_ctl_req_t g_disk_ctlreq; static g_access_t g_disk_access; static g_init_t g_disk_init; static g_fini_t g_disk_fini; @@ -70,7 +68,6 @@ static g_dumpconf_t g_disk_dumpconf; static struct g_class g_disk_class = { .name = "DISK", .version = G_VERSION, - .ctlreq = g_disk_ctlreq, .init = g_disk_init, .fini = g_disk_fini, .start = g_disk_start, @@ -84,19 +81,16 @@ g_disk_init(struct g_class *mp __unused) { mtx_init(&g_disk_done_mtx, "g_disk_done", NULL, MTX_DEF); - g_sched_init(); } static void g_disk_fini(struct g_class *mp __unused) { - g_sched_fini(); mtx_destroy(&g_disk_done_mtx); } DECLARE_GEOM_CLASS(g_disk_class, g_disk); -MODULE_VERSION(g_disk, 0); static void __inline g_disk_lock_giant(struct disk *dp) @@ -112,83 +106,6 @@ g_disk_unlock_giant(struct disk *dp) mtx_unlock(&Giant); } -static void -g_disk_configure(struct gctl_req *req, struct g_class *mp) -{ - struct disk *dp; - struct g_provider *pp; - const char *sched, *name; - char param[16]; - int i, *nargs; - - g_topology_assert(); - - nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); - if (nargs == NULL) { - gctl_error(req, "No '%s' argument.", "nargs"); - return; - } - - if (*nargs <= 0) { - gctl_error(req, "Missing devices."); - return; - } - - sched = gctl_get_asciiparam(req, "iosched"); - if (sched == NULL) { - gctl_error(req, "No '%s' argument.", "iosched"); - return; - } - - for (i = 0; i < *nargs; i++) { - snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No '%s' argument.", param); - return; - } - - if (strncmp(name, "/dev/", strlen("/dev/")) == 0) - name += strlen("/dev/"); - - pp = g_provider_by_name(name); - if (pp == NULL || pp->geom->class != mp) { - gctl_error(req, "Provider %s is invalid.", name); - return; - } - - dp = pp->geom->softc; - if (g_sched_configure(dp, sched) != 0) { - gctl_error(req, "Could not set scheduler %s.", sched); - return; - } - } -} - -static void -g_disk_ctlreq(struct gctl_req *req, struct g_class *mp, const char *verb) -{ - uint32_t *version; - - g_topology_assert(); - - version = gctl_get_paraml(req, "version", sizeof(*version)); - if (version == NULL) { - gctl_error(req, "No '%s' argument.", "version"); - return; - } - - if (*version != G_VERSION) { - gctl_error(req, "Userland and kernel parts are out of sync."); - return; - } - - if (strcmp(verb, "configure") == 0) - g_disk_configure(req, mp); - else - gctl_error(req, "Unknown verb."); -} - static int g_disk_access(struct g_provider *pp, int r, int w, int e) { @@ -281,8 +198,6 @@ g_disk_done(struct bio *bp) mtx_lock(&g_disk_done_mtx); bp->bio_completed = bp->bio_length - bp->bio_resid; - g_sched_done(bp); - bp2 = bp->bio_parent; if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; @@ -373,7 +288,7 @@ g_disk_start(struct bio *bp) bp2->bio_disk = dp; devstat_start_transaction_bio(dp->d_devstat, bp2); g_disk_lock_giant(dp); - g_sched_start(dp, bp2); + dp->d_strategy(bp2); g_disk_unlock_giant(dp); bp2 = bp3; bp3 = NULL; @@ -551,7 +466,6 @@ disk_create(struct disk *dp, int version dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; - g_sched_disk_init(dp); g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); } @@ -562,7 +476,6 @@ disk_destroy(struct disk *dp) g_cancel_event(dp); dp->d_destroyed = 1; - g_sched_disk_fini(dp); if (dp->d_devstat != NULL) devstat_remove_entry(dp->d_devstat); g_post_event(g_disk_destroy, dp, M_WAITOK, NULL); @@ -574,8 +487,6 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; - g_sched_disk_gone(dp); - gp = dp->d_geom; if (gp != NULL) LIST_FOREACH(pp, &gp->provider, provider) Modified: user/luigi/geom_sched/sys/geom/geom_disk.h ============================================================================== --- user/luigi/geom_sched/sys/geom/geom_disk.h Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/geom/geom_disk.h Wed Jan 14 17:25:28 2009 (r187227) @@ -53,10 +53,7 @@ typedef int disk_ioctl_t(struct disk *, int fflag, struct thread *td); /* NB: disk_ioctl_t SHALL be cast'able to d_ioctl_t */ -typedef void disk_kick_t(struct disk *); - struct g_geom; -struct g_sched; struct devstat; struct disk { @@ -77,7 +74,6 @@ struct disk { disk_close_t *d_close; disk_strategy_t *d_strategy; disk_ioctl_t *d_ioctl; - disk_kick_t *d_kick; dumper_t *d_dump; /* Info fields from driver to geom_disk.c. Valid when open */ @@ -90,13 +86,6 @@ struct disk { u_int d_stripesize; char d_ident[DISK_IDENT_SIZE]; - /* Scheduler fields */ - struct mtx d_sched_lock; - u_int d_sched_flags; - u_int d_nr_sorted; - struct g_sched *d_sched; - void *d_sched_data; - /* Fields private to the driver */ void *d_drv1; }; Modified: user/luigi/geom_sched/sys/geom/geom_io.c ============================================================================== --- user/luigi/geom_sched/sys/geom/geom_io.c Wed Jan 14 16:27:04 2009 (r187226) +++ user/luigi/geom_sched/sys/geom/geom_io.c Wed Jan 14 17:25:28 2009 (r187227) @@ -562,8 +562,8 @@ g_io_schedule_down(struct thread *tp __u break; } THREAD_NO_SLEEPING(); - CTR4(KTR_GEOM, "g_down starting bp %p provider %s off %ld " - "len %ld", bp, bp->bio_to->name, bp->bio_offset, + CTR4(KTR_GEOM, "g_down starting bp %p provider %s off %lld " + "len %lld", bp, bp->bio_to->name, bp->bio_offset, bp->bio_length); bp->bio_to->geom->start(bp); THREAD_SLEEPING_OK(); @@ -610,7 +610,7 @@ g_io_schedule_up(struct thread *tp __unu g_bioq_unlock(&g_bio_run_up); THREAD_NO_SLEEPING(); CTR4(KTR_GEOM, "g_up biodone bp %p provider %s off " - "%ld len %ld", bp, bp->bio_to->name, + "%lld len %lld", bp, bp->bio_to->name, bp->bio_offset, bp->bio_length); biodone(bp); THREAD_SLEEPING_OK(); From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 18:19:07 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8EBA10658E2; Wed, 14 Jan 2009 18:19:07 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0C6C8FC30; Wed, 14 Jan 2009 18:19:07 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EIJ7gx050261; Wed, 14 Jan 2009 18:19:07 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EIJ7fB050246; Wed, 14 Jan 2009 18:19:07 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141819.n0EIJ7fB050246@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 18:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187228 - in user/sam/wifi/sys: . amd64/amd64 amd64/conf amd64/include arm/arm arm/include arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion boot/common boot/forth boot/i386/libi386 ... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 18:19:10 -0000 Author: sam Date: Wed Jan 14 18:19:06 2009 New Revision: 187228 URL: http://svn.freebsd.org/changeset/base/187228 Log: sync w/ HEAD Added: user/sam/wifi/sys/arm/arm/cpufunc_asm_sheeva.S - copied unchanged from r187227, head/sys/arm/arm/cpufunc_asm_sheeva.S user/sam/wifi/sys/bsm/audit_domain.h - copied unchanged from r187227, head/sys/bsm/audit_domain.h user/sam/wifi/sys/bsm/audit_socket_type.h - copied unchanged from r187227, head/sys/bsm/audit_socket_type.h user/sam/wifi/sys/dev/usb2/controller/atmegadci.c - copied unchanged from r187227, head/sys/dev/usb2/controller/atmegadci.c user/sam/wifi/sys/dev/usb2/controller/atmegadci.h - copied unchanged from r187227, head/sys/dev/usb2/controller/atmegadci.h user/sam/wifi/sys/dev/usb2/controller/atmegadci_atmelarm.c - copied unchanged from r187227, head/sys/dev/usb2/controller/atmegadci_atmelarm.c user/sam/wifi/sys/dev/usb2/ethernet/if_auereg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_auereg.h user/sam/wifi/sys/dev/usb2/ethernet/if_axereg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_axereg.h user/sam/wifi/sys/dev/usb2/ethernet/if_cdcereg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_cdcereg.h user/sam/wifi/sys/dev/usb2/ethernet/if_cuereg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_cuereg.h user/sam/wifi/sys/dev/usb2/ethernet/if_kuefw.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_kuefw.h user/sam/wifi/sys/dev/usb2/ethernet/if_kuereg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_kuereg.h user/sam/wifi/sys/dev/usb2/ethernet/if_ruereg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_ruereg.h user/sam/wifi/sys/dev/usb2/ethernet/if_udavreg.h - copied unchanged from r187227, head/sys/dev/usb2/ethernet/if_udavreg.h user/sam/wifi/sys/dev/usb2/wlan/if_rumfw.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_rumfw.h user/sam/wifi/sys/dev/usb2/wlan/if_rumreg.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_rumreg.h user/sam/wifi/sys/dev/usb2/wlan/if_rumvar.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_rumvar.h user/sam/wifi/sys/dev/usb2/wlan/if_uralreg.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_uralreg.h user/sam/wifi/sys/dev/usb2/wlan/if_uralvar.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_uralvar.h user/sam/wifi/sys/dev/usb2/wlan/if_zydfw.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_zydfw.h user/sam/wifi/sys/dev/usb2/wlan/if_zydreg.h - copied unchanged from r187227, head/sys/dev/usb2/wlan/if_zydreg.h user/sam/wifi/sys/modules/usb2/controller_atmegadci/ - copied from r187227, head/sys/modules/usb2/controller_atmegadci/ user/sam/wifi/sys/security/audit/audit_bsm_domain.c - copied unchanged from r187227, head/sys/security/audit/audit_bsm_domain.c user/sam/wifi/sys/security/audit/audit_bsm_socket_type.c - copied unchanged from r187227, head/sys/security/audit/audit_bsm_socket_type.c Deleted: user/sam/wifi/sys/arm/arm/cpufunc_asm_feroceon.S user/sam/wifi/sys/boot/common/load.c user/sam/wifi/sys/dev/usb2/ethernet/if_aue2_reg.h user/sam/wifi/sys/dev/usb2/ethernet/if_axe2_reg.h user/sam/wifi/sys/dev/usb2/ethernet/if_cdce2_reg.h user/sam/wifi/sys/dev/usb2/ethernet/if_cue2_reg.h user/sam/wifi/sys/dev/usb2/ethernet/if_kue2_fw.h user/sam/wifi/sys/dev/usb2/ethernet/if_kue2_reg.h user/sam/wifi/sys/dev/usb2/ethernet/if_rue2_reg.h user/sam/wifi/sys/dev/usb2/ethernet/if_udav2_reg.h user/sam/wifi/sys/dev/usb2/wlan/if_rum2_fw.h user/sam/wifi/sys/dev/usb2/wlan/if_rum2_reg.h user/sam/wifi/sys/dev/usb2/wlan/if_rum2_var.h user/sam/wifi/sys/dev/usb2/wlan/if_ural2_reg.h user/sam/wifi/sys/dev/usb2/wlan/if_ural2_var.h user/sam/wifi/sys/dev/usb2/wlan/if_zyd2_fw.h user/sam/wifi/sys/dev/usb2/wlan/if_zyd2_reg.h user/sam/wifi/sys/powerpc/booke/support.S Modified: user/sam/wifi/sys/ (props changed) user/sam/wifi/sys/amd64/amd64/amd64_mem.c user/sam/wifi/sys/amd64/amd64/exception.S user/sam/wifi/sys/amd64/amd64/identcpu.c user/sam/wifi/sys/amd64/amd64/initcpu.c user/sam/wifi/sys/amd64/amd64/msi.c user/sam/wifi/sys/amd64/conf/GENERIC user/sam/wifi/sys/amd64/conf/USB2 user/sam/wifi/sys/amd64/include/md_var.h user/sam/wifi/sys/amd64/include/specialreg.h user/sam/wifi/sys/arm/arm/cpufunc.c user/sam/wifi/sys/arm/arm/elf_trampoline.c user/sam/wifi/sys/arm/include/cpufunc.h user/sam/wifi/sys/arm/mv/common.c user/sam/wifi/sys/arm/mv/discovery/db78xxx.c user/sam/wifi/sys/arm/mv/discovery/discovery.c user/sam/wifi/sys/arm/mv/files.mv user/sam/wifi/sys/arm/mv/gpio.c user/sam/wifi/sys/arm/mv/kirkwood/db88f6xxx.c user/sam/wifi/sys/arm/mv/kirkwood/kirkwood.c user/sam/wifi/sys/arm/mv/mv_machdep.c user/sam/wifi/sys/arm/mv/mv_pci.c user/sam/wifi/sys/arm/mv/mvreg.h user/sam/wifi/sys/arm/mv/mvvar.h user/sam/wifi/sys/arm/mv/obio.c user/sam/wifi/sys/arm/mv/orion/db88f5xxx.c user/sam/wifi/sys/arm/mv/orion/orion.c user/sam/wifi/sys/boot/forth/support.4th user/sam/wifi/sys/boot/i386/libi386/bootinfo64.c user/sam/wifi/sys/bsm/audit.h user/sam/wifi/sys/bsm/audit_errno.h user/sam/wifi/sys/bsm/audit_internal.h user/sam/wifi/sys/bsm/audit_kevents.h user/sam/wifi/sys/bsm/audit_record.h user/sam/wifi/sys/cam/cam_xpt.c user/sam/wifi/sys/cam/cam_xpt_sim.h user/sam/wifi/sys/cam/scsi/scsi_cd.c user/sam/wifi/sys/cam/scsi/scsi_ch.c user/sam/wifi/sys/cam/scsi/scsi_pass.c user/sam/wifi/sys/cam/scsi/scsi_pt.c user/sam/wifi/sys/cam/scsi/scsi_sa.c user/sam/wifi/sys/cam/scsi/scsi_ses.c user/sam/wifi/sys/cam/scsi/scsi_sg.c user/sam/wifi/sys/conf/Makefile.arm user/sam/wifi/sys/conf/NOTES user/sam/wifi/sys/conf/files user/sam/wifi/sys/conf/files.amd64 user/sam/wifi/sys/conf/files.powerpc user/sam/wifi/sys/conf/kern.pre.mk user/sam/wifi/sys/conf/options user/sam/wifi/sys/contrib/pf/ (props changed) user/sam/wifi/sys/crypto/via/padlock.c user/sam/wifi/sys/crypto/via/padlock_hash.c user/sam/wifi/sys/dev/adb/adb_kbd.c user/sam/wifi/sys/dev/agp/agp_amd64.c user/sam/wifi/sys/dev/ata/ata-queue.c user/sam/wifi/sys/dev/ata/atapi-cam.c user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c user/sam/wifi/sys/dev/ath/if_ath.c user/sam/wifi/sys/dev/ath/if_athioctl.h user/sam/wifi/sys/dev/ath/if_athvar.h user/sam/wifi/sys/dev/bce/if_bce.c user/sam/wifi/sys/dev/e1000/if_igb.c user/sam/wifi/sys/dev/fxp/if_fxp.c user/sam/wifi/sys/dev/if_ndis/if_ndis.c user/sam/wifi/sys/dev/md/md.c user/sam/wifi/sys/dev/mge/if_mge.c user/sam/wifi/sys/dev/mge/if_mgevar.h user/sam/wifi/sys/dev/msk/if_msk.c user/sam/wifi/sys/dev/msk/if_mskreg.h user/sam/wifi/sys/dev/sound/pci/hda/hdac.c user/sam/wifi/sys/dev/sound/pcm/dsp.c user/sam/wifi/sys/dev/sound/pcm/mixer.c user/sam/wifi/sys/dev/sound/pcm/sound.c user/sam/wifi/sys/dev/sound/pcm/sound.h user/sam/wifi/sys/dev/syscons/teken/ (props changed) user/sam/wifi/sys/dev/uart/uart_cpu_mv.c user/sam/wifi/sys/dev/usb/ehci_ixp4xx.c (props changed) user/sam/wifi/sys/dev/usb/ehci_mbus.c user/sam/wifi/sys/dev/usb/usbdevs user/sam/wifi/sys/dev/usb2/controller/at91dci.c user/sam/wifi/sys/dev/usb2/controller/at91dci.h user/sam/wifi/sys/dev/usb2/controller/at91dci_atmelarm.c user/sam/wifi/sys/dev/usb2/controller/ehci2.c user/sam/wifi/sys/dev/usb2/controller/ehci2.h user/sam/wifi/sys/dev/usb2/controller/ehci2_pci.c user/sam/wifi/sys/dev/usb2/controller/musb2_otg.c user/sam/wifi/sys/dev/usb2/controller/musb2_otg.h user/sam/wifi/sys/dev/usb2/controller/musb2_otg_atmelarm.c user/sam/wifi/sys/dev/usb2/controller/ohci2.c user/sam/wifi/sys/dev/usb2/controller/ohci2.h user/sam/wifi/sys/dev/usb2/controller/ohci2_atmelarm.c user/sam/wifi/sys/dev/usb2/controller/ohci2_pci.c user/sam/wifi/sys/dev/usb2/controller/uhci2.c user/sam/wifi/sys/dev/usb2/controller/uhci2.h user/sam/wifi/sys/dev/usb2/controller/uhci2_pci.c user/sam/wifi/sys/dev/usb2/controller/usb2_bus.h user/sam/wifi/sys/dev/usb2/controller/usb2_controller.c user/sam/wifi/sys/dev/usb2/controller/usb2_controller.h user/sam/wifi/sys/dev/usb2/controller/uss820dci.c user/sam/wifi/sys/dev/usb2/controller/uss820dci.h user/sam/wifi/sys/dev/usb2/controller/uss820dci_atmelarm.c user/sam/wifi/sys/dev/usb2/core/usb2_busdma.c user/sam/wifi/sys/dev/usb2/core/usb2_compat_linux.c user/sam/wifi/sys/dev/usb2/core/usb2_core.h user/sam/wifi/sys/dev/usb2/core/usb2_debug.c user/sam/wifi/sys/dev/usb2/core/usb2_device.c user/sam/wifi/sys/dev/usb2/core/usb2_generic.c user/sam/wifi/sys/dev/usb2/core/usb2_handle_request.c user/sam/wifi/sys/dev/usb2/core/usb2_hub.c user/sam/wifi/sys/dev/usb2/core/usb2_mbuf.h user/sam/wifi/sys/dev/usb2/core/usb2_parse.c user/sam/wifi/sys/dev/usb2/core/usb2_request.c user/sam/wifi/sys/dev/usb2/core/usb2_sw_transfer.c user/sam/wifi/sys/dev/usb2/core/usb2_transfer.c user/sam/wifi/sys/dev/usb2/core/usb2_transfer.h user/sam/wifi/sys/dev/usb2/ethernet/if_aue2.c user/sam/wifi/sys/dev/usb2/ethernet/if_axe2.c user/sam/wifi/sys/dev/usb2/ethernet/if_cdce2.c user/sam/wifi/sys/dev/usb2/ethernet/if_cue2.c user/sam/wifi/sys/dev/usb2/ethernet/if_kue2.c user/sam/wifi/sys/dev/usb2/ethernet/if_rue2.c user/sam/wifi/sys/dev/usb2/ethernet/if_udav2.c user/sam/wifi/sys/dev/usb2/image/uscanner2.c user/sam/wifi/sys/dev/usb2/include/usb2_defs.h user/sam/wifi/sys/dev/usb2/include/usb2_devid.h user/sam/wifi/sys/dev/usb2/include/usb2_devtable.h user/sam/wifi/sys/dev/usb2/include/usb2_standard.h user/sam/wifi/sys/dev/usb2/misc/ufm2.c user/sam/wifi/sys/dev/usb2/serial/u3g2.c user/sam/wifi/sys/dev/usb2/serial/uark2.c user/sam/wifi/sys/dev/usb2/serial/ubsa2.c user/sam/wifi/sys/dev/usb2/serial/ubser2.c user/sam/wifi/sys/dev/usb2/serial/uchcom2.c user/sam/wifi/sys/dev/usb2/serial/ucycom2.c user/sam/wifi/sys/dev/usb2/serial/ufoma2.c user/sam/wifi/sys/dev/usb2/serial/uftdi2.c user/sam/wifi/sys/dev/usb2/serial/ugensa2.c user/sam/wifi/sys/dev/usb2/serial/uipaq2.c user/sam/wifi/sys/dev/usb2/serial/ulpt2.c user/sam/wifi/sys/dev/usb2/serial/umct2.c user/sam/wifi/sys/dev/usb2/serial/umodem2.c user/sam/wifi/sys/dev/usb2/serial/umoscom2.c user/sam/wifi/sys/dev/usb2/serial/uplcom2.c user/sam/wifi/sys/dev/usb2/serial/usb2_serial.c user/sam/wifi/sys/dev/usb2/serial/usb2_serial.h user/sam/wifi/sys/dev/usb2/serial/uvisor2.c user/sam/wifi/sys/dev/usb2/serial/uvscom2.c user/sam/wifi/sys/dev/usb2/sound/uaudio2.c user/sam/wifi/sys/dev/usb2/storage/ata-usb2.c user/sam/wifi/sys/dev/usb2/storage/umass2.c user/sam/wifi/sys/dev/usb2/storage/urio2.c user/sam/wifi/sys/dev/usb2/wlan/if_rum2.c user/sam/wifi/sys/dev/usb2/wlan/if_ural2.c user/sam/wifi/sys/dev/usb2/wlan/if_zyd2.c user/sam/wifi/sys/fs/devfs/devfs_vnops.c user/sam/wifi/sys/fs/msdosfs/msdosfs_conv.c user/sam/wifi/sys/fs/msdosfs/msdosfs_denode.c user/sam/wifi/sys/fs/pseudofs/pseudofs_vncache.c user/sam/wifi/sys/geom/geom_vfs.c user/sam/wifi/sys/i386/conf/GENERIC user/sam/wifi/sys/i386/conf/USB2 user/sam/wifi/sys/i386/i386/i686_mem.c user/sam/wifi/sys/i386/i386/identcpu.c user/sam/wifi/sys/i386/i386/initcpu.c user/sam/wifi/sys/i386/i386/msi.c user/sam/wifi/sys/kern/kern_timeout.c user/sam/wifi/sys/kern/sysv_sem.c user/sam/wifi/sys/kern/vfs_extattr.c user/sam/wifi/sys/mips/mips/elf64_machdep.c (props changed) user/sam/wifi/sys/modules/Makefile user/sam/wifi/sys/modules/iwnfw/Makefile user/sam/wifi/sys/modules/usb2/serial_3g/ (props changed) user/sam/wifi/sys/net/if_loop.c user/sam/wifi/sys/net/route.h user/sam/wifi/sys/net/rtsock.c user/sam/wifi/sys/net80211/ieee80211.c user/sam/wifi/sys/net80211/ieee80211.h user/sam/wifi/sys/net80211/ieee80211_adhoc.c user/sam/wifi/sys/net80211/ieee80211_ddb.c user/sam/wifi/sys/net80211/ieee80211_freebsd.c user/sam/wifi/sys/net80211/ieee80211_input.c user/sam/wifi/sys/net80211/ieee80211_input.h user/sam/wifi/sys/net80211/ieee80211_ioctl.c user/sam/wifi/sys/net80211/ieee80211_ioctl.h user/sam/wifi/sys/net80211/ieee80211_node.c user/sam/wifi/sys/net80211/ieee80211_node.h user/sam/wifi/sys/net80211/ieee80211_output.c user/sam/wifi/sys/net80211/ieee80211_proto.h user/sam/wifi/sys/net80211/ieee80211_scan.h user/sam/wifi/sys/net80211/ieee80211_scan_sta.c user/sam/wifi/sys/net80211/ieee80211_var.h user/sam/wifi/sys/netgraph/ng_vjc.c user/sam/wifi/sys/netinet/in.c user/sam/wifi/sys/netinet/in.h user/sam/wifi/sys/netinet/in_pcb.c user/sam/wifi/sys/netinet/in_pcb.h user/sam/wifi/sys/netinet/ip_output.c user/sam/wifi/sys/netinet/tcp_syncache.c user/sam/wifi/sys/netinet6/in6.c user/sam/wifi/sys/powerpc/booke/locore.S user/sam/wifi/sys/powerpc/booke/machdep.c user/sam/wifi/sys/powerpc/booke/pmap.c user/sam/wifi/sys/powerpc/booke/trap_subr.S user/sam/wifi/sys/powerpc/include/pcpu.h user/sam/wifi/sys/powerpc/include/pmap.h user/sam/wifi/sys/powerpc/include/pte.h user/sam/wifi/sys/powerpc/include/tlb.h user/sam/wifi/sys/powerpc/powermac/macgpio.c user/sam/wifi/sys/powerpc/powerpc/genassym.c user/sam/wifi/sys/security/audit/audit_bsm_errno.c user/sam/wifi/sys/security/audit/audit_bsm_token.c user/sam/wifi/sys/security/mac/mac_framework.c user/sam/wifi/sys/security/mac/mac_inet6.c user/sam/wifi/sys/security/mac/mac_internal.h user/sam/wifi/sys/security/mac/mac_policy.h user/sam/wifi/sys/security/mac_biba/mac_biba.c user/sam/wifi/sys/security/mac_bsdextended/mac_bsdextended.c user/sam/wifi/sys/security/mac_ifoff/mac_ifoff.c user/sam/wifi/sys/security/mac_lomac/mac_lomac.c user/sam/wifi/sys/security/mac_mls/mac_mls.c user/sam/wifi/sys/security/mac_none/mac_none.c user/sam/wifi/sys/security/mac_partition/mac_partition.c user/sam/wifi/sys/security/mac_portacl/mac_portacl.c user/sam/wifi/sys/security/mac_seeotheruids/mac_seeotheruids.c user/sam/wifi/sys/security/mac_stub/mac_stub.c user/sam/wifi/sys/security/mac_test/mac_test.c user/sam/wifi/sys/sys/soundcard.h user/sam/wifi/sys/ufs/ffs/ffs_vfsops.c user/sam/wifi/sys/ufs/ufs/ufs_extattr.c Modified: user/sam/wifi/sys/amd64/amd64/amd64_mem.c ============================================================================== --- user/sam/wifi/sys/amd64/amd64/amd64_mem.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/amd64/amd64_mem.c Wed Jan 14 18:19:06 2009 (r187228) @@ -678,9 +678,17 @@ amd64_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if (cpu_vendor_id != CPU_VENDOR_INTEL && - cpu_vendor_id != CPU_VENDOR_AMD) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (cpu_exthigh >= 0x80000008) + break; + /* FALLTHROUGH */ + default: return; + } mem_range_softc.mr_op = &amd64_mrops; } SYSINIT(amd64memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, amd64_mem_drvinit, NULL); Modified: user/sam/wifi/sys/amd64/amd64/exception.S ============================================================================== --- user/sam/wifi/sys/amd64/amd64/exception.S Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/amd64/exception.S Wed Jan 14 18:19:06 2009 (r187228) @@ -494,6 +494,7 @@ outofnmi: movq %rsp,%rdx /* frame */ sti call *%rax + cli nocallchain: #endif testl %ebx,%ebx Modified: user/sam/wifi/sys/amd64/amd64/identcpu.c ============================================================================== --- user/sam/wifi/sys/amd64/amd64/identcpu.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/amd64/identcpu.c Wed Jan 14 18:19:06 2009 (r187228) @@ -72,6 +72,7 @@ void panicifcpuunsupported(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_AMD_assoc(int i); +static void print_via_padlock_info(void); int cpu_class; char machine[] = "amd64"; @@ -132,24 +133,33 @@ printcpuinfo(void) } } - if (cpu_vendor_id == CPU_VENDOR_INTEL) { + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: /* Please make up your mind folks! */ strcat(cpu_model, "EM64T"); - } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + break; + case CPU_VENDOR_AMD: /* * Values taken from AMD Processor Recognition * http://www.amd.com/K6/k6docs/pdf/20734g.pdf * (also describes ``Features'' encodings. */ strcpy(cpu_model, "AMD "); - switch (cpu_id & 0xF00) { - case 0xf00: + if ((cpu_id & 0xf00) == 0xf00) strcat(cpu_model, "AMD64 Processor"); - break; - default: + else strcat(cpu_model, "Unknown"); - break; - } + break; + case CPU_VENDOR_CENTAUR: + strcpy(cpu_model, "VIA "); + if ((cpu_id & 0xff0) == 0x6f0) + strcat(cpu_model, "Nano Processor"); + else + strcat(cpu_model, "Unknown"); + break; + default: + strcat(cpu_model, "Unknown"); + break; } /* @@ -181,7 +191,8 @@ printcpuinfo(void) printf(" Id = 0x%x", cpu_id); if (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) { + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_CENTAUR) { printf(" Stepping = %u", cpu_id & 0xf); if (cpu_high > 0) { u_int cmp = 1, htt = 1; @@ -353,6 +364,9 @@ printcpuinfo(void) ); } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR) + print_via_padlock_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -376,6 +390,11 @@ printcpuinfo(void) AMD64_CPU_MODEL(cpu_id) >= 0x3)) tsc_is_invariant = 1; break; + case CPU_VENDOR_CENTAUR: + if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + tsc_is_invariant = 1; + break; } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); @@ -457,7 +476,7 @@ EVENTHANDLER_DEFINE(cpufreq_post_change, EVENTHANDLER_PRI_ANY); /* - * Final stage of CPU identification. -- Should I check TI? + * Final stage of CPU identification. */ void identify_cpu(void) @@ -479,7 +498,8 @@ identify_cpu(void) cpu_feature2 = regs[2]; if (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) { + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_CENTAUR) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; } @@ -600,3 +620,37 @@ print_AMD_info(void) print_AMD_l2_assoc((regs[2] >> 12) & 0x0f); } } + +static void +print_via_padlock_info(void) +{ + u_int regs[4]; + + /* Check for supported models. */ + switch (cpu_id & 0xff0) { + case 0x690: + if ((cpu_id & 0xf) < 3) + return; + case 0x6a0: + case 0x6d0: + case 0x6f0: + break; + default: + return; + } + + do_cpuid(0xc0000000, regs); + if (regs[0] >= 0xc0000001) + do_cpuid(0xc0000001, regs); + else + return; + + printf("\n VIA Padlock Features=0x%b", regs[3], + "\020" + "\003RNG" /* RNG */ + "\007AES" /* ACE */ + "\011AES-CTR" /* ACE2 */ + "\013SHA1,SHA256" /* PHE */ + "\015RSA" /* PMM */ + ); +} Modified: user/sam/wifi/sys/amd64/amd64/initcpu.c ============================================================================== --- user/sam/wifi/sys/amd64/amd64/initcpu.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/amd64/initcpu.c Wed Jan 14 18:19:06 2009 (r187228) @@ -54,6 +54,8 @@ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ u_int amd_pminfo; /* AMD advanced power management info */ +u_int via_feature_rng; /* VIA RNG features */ +u_int via_feature_xcrypt; /* VIA ACE features */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ @@ -64,6 +66,75 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ +SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, + &via_feature_rng, 0, "VIA C3/C7 RNG feature available in CPU"); +SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, + &via_feature_xcrypt, 0, "VIA C3/C7 xcrypt feature available in CPU"); + +/* + * Initialize special VIA C3/C7 features + */ +static void +init_via(void) +{ + u_int regs[4], val; + u_int64_t msreg; + + do_cpuid(0xc0000000, regs); + val = regs[0]; + if (val >= 0xc0000001) { + do_cpuid(0xc0000001, regs); + val = regs[3]; + } else + val = 0; + + /* Enable RNG if present and disabled */ + if (val & VIA_CPUID_HAS_RNG) { + if (!(val & VIA_CPUID_DO_RNG)) { + msreg = rdmsr(0x110B); + msreg |= 0x40; + wrmsr(0x110B, msreg); + } + via_feature_rng = VIA_HAS_RNG; + } + /* Enable AES engine if present and disabled */ + if (val & VIA_CPUID_HAS_ACE) { + if (!(val & VIA_CPUID_DO_ACE)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_AES; + } + /* Enable ACE2 engine if present and disabled */ + if (val & VIA_CPUID_HAS_ACE2) { + if (!(val & VIA_CPUID_DO_ACE2)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_AESCTR; + } + /* Enable SHA engine if present and disabled */ + if (val & VIA_CPUID_HAS_PHE) { + if (!(val & VIA_CPUID_DO_PHE)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28/**/); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_SHA; + } + /* Enable MM engine if present and disabled */ + if (val & VIA_CPUID_HAS_PMM) { + if (!(val & VIA_CPUID_DO_PMM)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28/**/); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_MM; + } +} + /* * Initialize CPU control registers */ @@ -81,4 +152,8 @@ initializecpu(void) wrmsr(MSR_EFER, msr); pg_nx = PG_NX; } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR && + AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + init_via(); } Modified: user/sam/wifi/sys/amd64/amd64/msi.c ============================================================================== --- user/sam/wifi/sys/amd64/amd64/msi.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/amd64/msi.c Wed Jan 14 18:19:06 2009 (r187228) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Fields in address for Intel MSI messages. */ @@ -212,9 +213,18 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD)) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: return; + } msi_enabled = 1; intr_register_pic(&msi_pic); Modified: user/sam/wifi/sys/amd64/conf/GENERIC ============================================================================== --- user/sam/wifi/sys/amd64/conf/GENERIC Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/conf/GENERIC Wed Jan 14 18:19:06 2009 (r187228) @@ -1,8 +1,8 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/amd64 # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -24,6 +24,12 @@ ident GENERIC # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. +# Use the following to compile in values accessible to the kernel +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value', see kenv(1) +# +# env "GENERIC.env" + makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_ULE # ULE scheduler Modified: user/sam/wifi/sys/amd64/conf/USB2 ============================================================================== --- user/sam/wifi/sys/amd64/conf/USB2 Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/conf/USB2 Wed Jan 14 18:19:06 2009 (r187228) @@ -108,3 +108,7 @@ device usb2_input_ms # USB sound and MIDI device support #device usb2_sound + +# USB scanner support +device usb2_image +device usb2_scanner Modified: user/sam/wifi/sys/amd64/include/md_var.h ============================================================================== --- user/sam/wifi/sys/amd64/include/md_var.h Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/include/md_var.h Wed Jan 14 18:19:06 2009 (r187228) @@ -45,6 +45,8 @@ extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; extern u_int amd_pminfo; +extern u_int via_feature_rng; +extern u_int via_feature_xcrypt; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: user/sam/wifi/sys/amd64/include/specialreg.h ============================================================================== --- user/sam/wifi/sys/amd64/include/specialreg.h Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/amd64/include/specialreg.h Wed Jan 14 18:19:06 2009 (r187228) @@ -459,4 +459,40 @@ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ +/* VIA ACE crypto featureset: for via_feature_rng */ +#define VIA_HAS_RNG 1 /* cpu has RNG */ + +/* VIA ACE crypto featureset: for via_feature_xcrypt */ +#define VIA_HAS_AES 1 /* cpu has AES */ +#define VIA_HAS_SHA 2 /* cpu has SHA1 & SHA256 */ +#define VIA_HAS_MM 4 /* cpu has RSA instructions */ +#define VIA_HAS_AESCTR 8 /* cpu has AES-CTR instructions */ + +/* Centaur Extended Feature flags */ +#define VIA_CPUID_HAS_RNG 0x000004 +#define VIA_CPUID_DO_RNG 0x000008 +#define VIA_CPUID_HAS_ACE 0x000040 +#define VIA_CPUID_DO_ACE 0x000080 +#define VIA_CPUID_HAS_ACE2 0x000100 +#define VIA_CPUID_DO_ACE2 0x000200 +#define VIA_CPUID_HAS_PHE 0x000400 +#define VIA_CPUID_DO_PHE 0x000800 +#define VIA_CPUID_HAS_PMM 0x001000 +#define VIA_CPUID_DO_PMM 0x002000 + +/* VIA ACE xcrypt-* instruction context control options */ +#define VIA_CRYPT_CWLO_ROUND_M 0x0000000f +#define VIA_CRYPT_CWLO_ALG_M 0x00000070 +#define VIA_CRYPT_CWLO_ALG_AES 0x00000000 +#define VIA_CRYPT_CWLO_KEYGEN_M 0x00000080 +#define VIA_CRYPT_CWLO_KEYGEN_HW 0x00000000 +#define VIA_CRYPT_CWLO_KEYGEN_SW 0x00000080 +#define VIA_CRYPT_CWLO_NORMAL 0x00000000 +#define VIA_CRYPT_CWLO_INTERMEDIATE 0x00000100 +#define VIA_CRYPT_CWLO_ENCRYPT 0x00000000 +#define VIA_CRYPT_CWLO_DECRYPT 0x00000200 +#define VIA_CRYPT_CWLO_KEY128 0x0000000a /* 128bit, 10 rds */ +#define VIA_CRYPT_CWLO_KEY192 0x0000040c /* 192bit, 12 rds */ +#define VIA_CRYPT_CWLO_KEY256 0x0000080e /* 256bit, 15 rds */ + #endif /* !_MACHINE_SPECIALREG_H_ */ Modified: user/sam/wifi/sys/arm/arm/cpufunc.c ============================================================================== --- user/sam/wifi/sys/arm/arm/cpufunc.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/arm/arm/cpufunc.c Wed Jan 14 18:19:06 2009 (r187228) @@ -358,7 +358,7 @@ struct cpu_functions armv5_ec_cpufuncs = }; -struct cpu_functions feroceon_cpufuncs = { +struct cpu_functions sheeva_cpufuncs = { /* CPU functions */ cpufunc_id, /* id */ @@ -368,7 +368,7 @@ struct cpu_functions feroceon_cpufuncs = cpufunc_control, /* control */ cpufunc_domains, /* Domain */ - feroceon_setttb, /* Setttb */ + sheeva_setttb, /* Setttb */ cpufunc_faultstatus, /* Faultstatus */ cpufunc_faultaddress, /* Faultaddress */ @@ -387,17 +387,17 @@ struct cpu_functions feroceon_cpufuncs = armv5_ec_icache_sync_range, /* icache_sync_range */ armv5_ec_dcache_wbinv_all, /* dcache_wbinv_all */ - feroceon_dcache_wbinv_range, /* dcache_wbinv_range */ - feroceon_dcache_inv_range, /* dcache_inv_range */ - feroceon_dcache_wb_range, /* dcache_wb_range */ + sheeva_dcache_wbinv_range, /* dcache_wbinv_range */ + sheeva_dcache_inv_range, /* dcache_inv_range */ + sheeva_dcache_wb_range, /* dcache_wb_range */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */ - feroceon_idcache_wbinv_range, /* idcache_wbinv_all */ + sheeva_idcache_wbinv_range, /* idcache_wbinv_all */ - feroceon_l2cache_wbinv_all, /* l2cache_wbinv_all */ - feroceon_l2cache_wbinv_range, /* l2cache_wbinv_range */ - feroceon_l2cache_inv_range, /* l2cache_inv_range */ - feroceon_l2cache_wb_range, /* l2cache_wb_range */ + sheeva_l2cache_wbinv_all, /* l2cache_wbinv_all */ + sheeva_l2cache_wbinv_range, /* l2cache_wbinv_range */ + sheeva_l2cache_inv_range, /* l2cache_inv_range */ + sheeva_l2cache_wb_range, /* l2cache_wb_range */ /* Other functions */ @@ -1000,7 +1000,7 @@ set_cpufuncs() cputype == CPU_ID_MV88FR571_VD || cputype == CPU_ID_MV88FR571_41) { - cpufuncs = feroceon_cpufuncs; + cpufuncs = sheeva_cpufuncs; /* * Workaround for Marvell MV78100 CPU: Cache prefetch * mechanism may affect the cache coherency validity, @@ -1011,12 +1011,12 @@ set_cpufuncs() */ if (cputype == CPU_ID_MV88FR571_VD || cputype == CPU_ID_MV88FR571_41) { - feroceon_control_ext(0xffffffff, + sheeva_control_ext(0xffffffff, FC_DCACHE_STREAM_EN | FC_WR_ALLOC_EN | FC_BRANCH_TARG_BUF_DIS | FC_L2CACHE_EN | FC_L2_PREF_DIS); } else { - feroceon_control_ext(0xffffffff, + sheeva_control_ext(0xffffffff, FC_DCACHE_STREAM_EN | FC_WR_ALLOC_EN | FC_BRANCH_TARG_BUF_DIS | FC_L2CACHE_EN); } Copied: user/sam/wifi/sys/arm/arm/cpufunc_asm_sheeva.S (from r187227, head/sys/arm/arm/cpufunc_asm_sheeva.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/sam/wifi/sys/arm/arm/cpufunc_asm_sheeva.S Wed Jan 14 18:19:06 2009 (r187228, copy of r187227, head/sys/arm/arm/cpufunc_asm_sheeva.S) @@ -0,0 +1,386 @@ +/*- + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +.Lsheeva_cache_line_size: + .word _C_LABEL(arm_pdcache_line_size) +.Lsheeva_asm_page_mask: + .word _C_LABEL(PAGE_MASK) + +ENTRY(sheeva_setttb) + /* Disable irqs */ + mrs r2, cpsr + orr r3, r2, #I32_bit | F32_bit + msr cpsr_c, r3 + + mov r1, #0 + mcr p15, 0, r1, c7, c5, 0 /* Invalidate ICache */ +1: mrc p15, 0, r15, c7, c14, 3 /* Test, clean and invalidate DCache */ + bne 1b /* More to do? */ + + mcr p15, 1, r1, c15, c9, 0 /* Clean L2 */ + mcr p15, 1, r1, c15, c11, 0 /* Invalidate L2 */ + + /* Reenable irqs */ + msr cpsr_c, r2 + + mcr p15, 0, r1, c7, c10, 4 /* drain the write buffer */ + + mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ + + mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ + RET + +ENTRY(sheeva_dcache_wbinv_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 5, r0, c15, c15, 0 /* Clean and inv zone start address */ + mcr p15, 5, r2, c15, c15, 1 /* Clean and inv zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + add r0, r0, ip + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_idcache_wbinv_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 5, r0, c15, c15, 0 /* Clean and inv zone start address */ + mcr p15, 5, r2, c15, c15, 1 /* Clean and inv zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + /* Invalidate and clean icache line by line */ + ldr r3, .Lsheeva_cache_line_size + ldr r3, [r3] +2: + mcr p15, 0, r0, c7, c5, 1 + add r0, r0, r3 + cmp r2, r0 + bhi 2b + + add r0, r2, #1 + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_dcache_inv_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 5, r0, c15, c14, 0 /* Inv zone start address */ + mcr p15, 5, r2, c15, c14, 1 /* Inv zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + add r0, r0, ip + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_dcache_wb_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 5, r0, c15, c13, 0 /* Clean zone start address */ + mcr p15, 5, r2, c15, c13, 1 /* Clean zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + add r0, r0, ip + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_l2cache_wbinv_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 1, r0, c15, c9, 4 /* Clean L2 zone start address */ + mcr p15, 1, r2, c15, c9, 5 /* Clean L2 zone end address */ + mcr p15, 1, r0, c15, c11, 4 /* Inv L2 zone start address */ + mcr p15, 1, r2, c15, c11, 5 /* Inv L2 zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + add r0, r0, ip + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_l2cache_inv_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 1, r0, c15, c11, 4 /* Inv L2 zone start address */ + mcr p15, 1, r2, c15, c11, 5 /* Inv L2 zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + add r0, r0, ip + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_l2cache_wb_range) + str lr, [sp, #-4]! + mrs lr, cpsr + /* Start with cache line aligned address */ + ldr ip, .Lsheeva_cache_line_size + ldr ip, [ip] + sub ip, ip, #1 + and r2, r0, ip + add r1, r1, r2 + add r1, r1, ip + bics r1, r1, ip + bics r0, r0, ip + + ldr ip, .Lsheeva_asm_page_mask + and r2, r0, ip + rsb r2, r2, #PAGE_SIZE + cmp r1, r2 + movcc ip, r1 + movcs ip, r2 +1: + add r3, r0, ip + sub r2, r3, #1 + /* Disable irqs */ + orr r3, lr, #I32_bit | F32_bit + msr cpsr_c, r3 + mcr p15, 1, r0, c15, c9, 4 /* Clean L2 zone start address */ + mcr p15, 1, r2, c15, c9, 5 /* Clean L2 zone end address */ + /* Enable irqs */ + msr cpsr_c, lr + + add r0, r0, ip + sub r1, r1, ip + cmp r1, #PAGE_SIZE + movcc ip, r1 + movcs ip, #PAGE_SIZE + cmp r1, #0 + bne 1b + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + ldr lr, [sp], #4 + RET + +ENTRY(sheeva_l2cache_wbinv_all) + mov r0, #0 + mcr p15, 1, r0, c15, c9, 0 /* Clean L2 */ + mcr p15, 1, r0, c15, c11, 0 /* Invalidate L2 */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +ENTRY(sheeva_control_ext) + mrc p15, 1, r3, c15, c1, 0 /* Read the control register */ + bic r2, r3, r0 /* Clear bits */ + eor r2, r2, r1 /* XOR bits */ + + teq r2, r3 /* Only write if there is a change */ + mcrne p15, 1, r2, c15, c1, 0 /* Write new control register */ + mov r0, r3 /* Return old value */ + RET Modified: user/sam/wifi/sys/arm/arm/elf_trampoline.c ============================================================================== --- user/sam/wifi/sys/arm/arm/elf_trampoline.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/arm/arm/elf_trampoline.c Wed Jan 14 18:19:06 2009 (r187228) @@ -74,7 +74,7 @@ void __startC(void); #ifdef CPU_XSCALE_81342 #define cpu_l2cache_wbinv_all xscalec3_l2cache_purge #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) -#define cpu_l2cache_wbinv_all feroceon_l2cache_wbinv_all +#define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all #else #define cpu_l2cache_wbinv_all() #endif Modified: user/sam/wifi/sys/arm/include/cpufunc.h ============================================================================== --- user/sam/wifi/sys/arm/include/cpufunc.h Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/arm/include/cpufunc.h Wed Jan 14 18:19:06 2009 (r187228) @@ -377,17 +377,17 @@ extern unsigned arm10_dcache_sets_inc; extern unsigned arm10_dcache_index_max; extern unsigned arm10_dcache_index_inc; -u_int feroceon_control_ext (u_int, u_int); -void feroceon_setttb (u_int); -void feroceon_dcache_wbinv_range (vm_offset_t, vm_size_t); -void feroceon_dcache_inv_range (vm_offset_t, vm_size_t); -void feroceon_dcache_wb_range (vm_offset_t, vm_size_t); -void feroceon_idcache_wbinv_range (vm_offset_t, vm_size_t); - -void feroceon_l2cache_wbinv_range (vm_offset_t, vm_size_t); -void feroceon_l2cache_inv_range (vm_offset_t, vm_size_t); -void feroceon_l2cache_wb_range (vm_offset_t, vm_size_t); -void feroceon_l2cache_wbinv_all (void); +u_int sheeva_control_ext (u_int, u_int); +void sheeva_setttb (u_int); +void sheeva_dcache_wbinv_range (vm_offset_t, vm_size_t); +void sheeva_dcache_inv_range (vm_offset_t, vm_size_t); +void sheeva_dcache_wb_range (vm_offset_t, vm_size_t); +void sheeva_idcache_wbinv_range (vm_offset_t, vm_size_t); + +void sheeva_l2cache_wbinv_range (vm_offset_t, vm_size_t); +void sheeva_l2cache_inv_range (vm_offset_t, vm_size_t); +void sheeva_l2cache_wb_range (vm_offset_t, vm_size_t); +void sheeva_l2cache_wbinv_all (void); #endif #ifdef CPU_ARM11 Modified: user/sam/wifi/sys/arm/mv/common.c ============================================================================== --- user/sam/wifi/sys/arm/mv/common.c Wed Jan 14 17:25:28 2009 (r187227) +++ user/sam/wifi/sys/arm/mv/common.c Wed Jan 14 18:19:06 2009 (r187228) @@ -46,13 +46,19 @@ static int decode_win_cpu_valid(void); static int decode_win_usb_valid(void); static int decode_win_eth_valid(void); static int decode_win_pcie_valid(void); +static int decode_win_sata_valid(void); +static int decode_win_cesa_valid(void); static void decode_win_cpu_setup(void); -static void decode_win_usb_setup(uint32_t ctrl); +static void decode_win_usb_setup(void); static void decode_win_eth_setup(uint32_t base); static void decode_win_pcie_setup(uint32_t base); +static void decode_win_sata_setup(void); +static void decode_win_cesa_setup(void); + +static void decode_win_cesa_dump(void); +static void decode_win_usb_dump(void); -static uint32_t dev, rev; static uint32_t used_cpu_wins; uint32_t @@ -81,6 +87,7 @@ cpu_reset(void) uint32_t cpu_extra_feat(void) { + uint32_t dev, rev; uint32_t ef = 0; soc_id(&dev, &rev); @@ -104,17 +111,6 @@ soc_power_ctrl_get(uint32_t mask) return (mask); } -uint32_t -get_tclk(void) -{ - -#if defined(SOC_MV_DISCOVERY) - return (TCLK_200MHZ); -#else - return (TCLK_166MHZ); -#endif -} - void soc_id(uint32_t *dev, uint32_t *rev) { @@ -165,6 +161,10 @@ soc_identify(void) break; case MV_DEV_88F6281: dev = "Marvell 88F6281"; + if (r == 0) + rev = "Z0"; + else if (r == 2) + rev = "A0"; break; case MV_DEV_MV78100: dev = "Marvell MV78100"; @@ -185,22 +185,27 @@ soc_identify(void) int soc_decode_win(void) { + uint32_t dev, rev; /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); if (decode_win_cpu_valid() != 1 || decode_win_usb_valid() != 1 || decode_win_eth_valid() != 1 || decode_win_idma_valid() != 1 || - decode_win_pcie_valid() != 1) + decode_win_pcie_valid() != 1 || decode_win_sata_valid() != 1 || + decode_win_cesa_valid() != 1) return(-1); decode_win_cpu_setup(); - decode_win_usb_setup(MV_USB0_BASE); + decode_win_usb_setup(); decode_win_eth_setup(MV_ETH0_BASE); if (dev == MV_DEV_MV78100) decode_win_eth_setup(MV_ETH1_BASE); + if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100) + decode_win_cesa_setup(); decode_win_idma_setup(); + decode_win_xor_setup(); if (dev == MV_DEV_MV78100) { decode_win_pcie_setup(MV_PCIE00_BASE); @@ -214,7 +219,8 @@ soc_decode_win(void) } else decode_win_pcie_setup(MV_PCIE_BASE); - /* TODO set up decode wins for SATA */ + if (dev != MV_DEV_88F5281) + decode_win_sata_setup(); return (0); } @@ -234,10 +240,15 @@ WIN_REG_IDX_WR(win_cpu, remap_h, MV_WIN_ WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) -WIN_REG_IDX_RD(win_usb, cr, MV_WIN_USB_CTRL, MV_USB_AWR_BASE) -WIN_REG_IDX_RD(win_usb, br, MV_WIN_USB_BASE, MV_USB_AWR_BASE) -WIN_REG_IDX_WR(win_usb, cr, MV_WIN_USB_CTRL, MV_USB_AWR_BASE) -WIN_REG_IDX_WR(win_usb, br, MV_WIN_USB_BASE, MV_USB_AWR_BASE) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 18:54:54 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20F0C1065677; Wed, 14 Jan 2009 18:54:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101B58FC0C; Wed, 14 Jan 2009 18:54:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EIsrxa051054; Wed, 14 Jan 2009 18:54:53 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EIsr4N051053; Wed, 14 Jan 2009 18:54:53 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141854.n0EIsr4N051053@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 18:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187230 - user/sam/wifi/sys/dev/ath/ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 18:54:55 -0000 Author: sam Date: Wed Jan 14 18:54:53 2009 New Revision: 187230 URL: http://svn.freebsd.org/changeset/base/187230 Log: Start cleaning up internal channel data structure: o purge unused bssSendHere o store iqCalValid's HAL_BOOL value in an uint8_t so it packs well o shuffle some members to improve struct packing; we still have a big hole at the end but it'll go away shortly Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Wed Jan 14 18:23:13 2009 (r187229) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Wed Jan 14 18:54:53 2009 (r187230) @@ -120,18 +120,16 @@ typedef struct { int8_t maxTxPower; int8_t minTxPower; /* as above... */ - HAL_BOOL bssSendHere; - uint8_t gainI; - HAL_BOOL iqCalValid; - uint8_t calValid; /* bitmask of cal types */ + uint8_t iqCalValid; /* NB: really HAL_BOOL */ + uint8_t calValid; /* bitmask of cal types */ int8_t iCoff; int8_t qCoff; int16_t rawNoiseFloor; int16_t noiseFloorAdjust; - int8_t antennaMax; - uint32_t regDmnFlags; /* Flags for channel use in reg */ + uint16_t mainSpur; /* cached spur value for this cahnnel */ + uint32_t regDmnFlags; /* Flags for channel use in reg */ uint32_t conformanceTestLimit; /* conformance test limit from reg domain */ - uint16_t mainSpur; /* cached spur value for this cahnnel */ + int8_t antennaMax; } HAL_CHANNEL_INTERNAL; typedef struct { From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 19:07:21 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EE3C106566B; Wed, 14 Jan 2009 19:07:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D9DF8FC20; Wed, 14 Jan 2009 19:07:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EJ7LLR051364; Wed, 14 Jan 2009 19:07:21 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EJ7LKI051360; Wed, 14 Jan 2009 19:07:21 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141907.n0EJ7LKI051360@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 19:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187231 - in user/sam/wifi/sys/dev/ath/ath_hal: . ar5211 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 19:07:22 -0000 Author: sam Date: Wed Jan 14 19:07:20 2009 New Revision: 187231 URL: http://svn.freebsd.org/changeset/base/187231 Log: Eliminate regDmnFlags from the internal channel structure; it was used only to hold the "need noise floor check" attribute for 5211 parts operating in MKK regdomains. Store this information in the privFlags field instead (usurp CHANNEL_DFS_CLEAR which was part of the old dfs code that's long gone) With this change ath_hal_getnfcheckrequired is not needed; remove it. Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 18:54:53 2009 (r187230) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 19:07:20 2009 (r187231) @@ -396,7 +396,7 @@ typedef struct { interference detection */ #define CHANNEL_DFS 0x02 /* DFS required on channel */ #define CHANNEL_4MS_LIMIT 0x04 /* 4msec packet limit on this channel */ -#define CHANNEL_DFS_CLEAR 0x08 /* if channel has been checked for DFS */ +#define CHANNEL_NFCREQUIRED 0x08 /* channel requires noise floor check */ #define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM) #define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK) Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Wed Jan 14 18:54:53 2009 (r187230) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Wed Jan 14 19:07:20 2009 (r187231) @@ -127,7 +127,6 @@ typedef struct { int16_t rawNoiseFloor; int16_t noiseFloorAdjust; uint16_t mainSpur; /* cached spur value for this cahnnel */ - uint32_t regDmnFlags; /* Flags for channel use in reg */ uint32_t conformanceTestLimit; /* conformance test limit from reg domain */ int8_t antennaMax; } HAL_CHANNEL_INTERNAL; @@ -499,12 +498,6 @@ extern u_int ath_hal_getantennareduction * the current regulator domain. */ extern u_int ath_hal_getctl(struct ath_hal *, HAL_CHANNEL *); -/* - * Return whether or not a noise floor check is required - * based on the current regulatory domain for the specified - * channel. - */ -extern u_int ath_hal_getnfcheckrequired(struct ath_hal *, HAL_CHANNEL *); /* * Map a public channel definition to the corresponding Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Wed Jan 14 18:54:53 2009 (r187230) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Wed Jan 14 19:07:20 2009 (r187231) @@ -2623,7 +2623,6 @@ ath_hal_init_channels(struct ath_hal *ah icv.channelFlags = cm->flags; icv.maxRegTxPower = fband->powerDfs; icv.antennaMax = fband->antennaMax; - icv.regDmnFlags = rd->flags; icv.conformanceTestLimit = ctl; if (fband->usePassScan & rd->pscan) icv.channelFlags |= CHANNEL_PASSIVE; @@ -2640,6 +2639,8 @@ ath_hal_init_channels(struct ath_hal *ah icv.privFlags = 0; if (rd->flags & LIMIT_FRAME_4MS) icv.privFlags |= CHANNEL_4MS_LIMIT; + if (rd->flags & NEED_NFC) + icv.privFlags |= CHANNEL_NFCREQUIRED; ichans[next++] = icv; } @@ -2818,20 +2819,6 @@ ath_hal_getctl(struct ath_hal *ah, HAL_C } /* - * Return whether or not a noise floor check is required in - * the current regulatory domain for the specified channel. - */ -HAL_BOOL -ath_hal_getnfcheckrequired(struct ath_hal *ah, HAL_CHANNEL *chan) -{ - HAL_CHANNEL_INTERNAL *ichan; - - if ((ichan = ath_hal_checkchannel(ah, chan)) != AH_NULL) - return ((ichan->regDmnFlags & NEED_NFC) ? AH_TRUE : AH_FALSE); - return AH_FALSE; -} - -/* * Insertion sort. */ #define swap(_a, _b, _size) { \ Modified: user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Wed Jan 14 18:54:53 2009 (r187230) +++ user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Wed Jan 14 19:07:20 2009 (r187231) @@ -985,7 +985,7 @@ ar5211CalNoiseFloor(struct ath_hal *ah, #define N(a) (sizeof (a) / sizeof (a[0])) /* Check for Carrier Wave interference in MKK regulatory zone */ if (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_OAHU && - ath_hal_getnfcheckrequired(ah, (HAL_CHANNEL *) chan)) { + (chan->privFlags & CHANNEL_NFCREQUIRED)) { static const uint8_t runtime[3] = { 0, 2, 7 }; int16_t nf, nfThresh; int i; From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 19:22:07 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7877710656D0; Wed, 14 Jan 2009 19:22:07 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB788FC20; Wed, 14 Jan 2009 19:22:07 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EJM7bd051660; Wed, 14 Jan 2009 19:22:07 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EJM7PR051657; Wed, 14 Jan 2009 19:22:07 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141922.n0EJM7PR051657@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 19:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187232 - in user/sam/wifi/sys/dev/ath/ath_hal: . ar5212 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 19:22:08 -0000 Author: sam Date: Wed Jan 14 19:22:06 2009 New Revision: 187232 URL: http://svn.freebsd.org/changeset/base/187232 Log: Move iqCalValid from an internal channel member to a flag in privFlags. This allows us to move antennaMax up and fully pack the structure. Need to revisit IQ calibration for 5212 parts; looks like we only ever do it once for a channel; may want to reset state using a long-term mechanism as done for 5416-class parts. Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 19:07:20 2009 (r187231) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 19:22:06 2009 (r187232) @@ -397,6 +397,7 @@ typedef struct { #define CHANNEL_DFS 0x02 /* DFS required on channel */ #define CHANNEL_4MS_LIMIT 0x04 /* 4msec packet limit on this channel */ #define CHANNEL_NFCREQUIRED 0x08 /* channel requires noise floor check */ +#define CHANNEL_IQVALID 0x10 /* IQ calibration valid */ #define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM) #define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK) Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Wed Jan 14 19:07:20 2009 (r187231) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Wed Jan 14 19:22:06 2009 (r187232) @@ -120,15 +120,14 @@ typedef struct { int8_t maxTxPower; int8_t minTxPower; /* as above... */ - uint8_t iqCalValid; /* NB: really HAL_BOOL */ uint8_t calValid; /* bitmask of cal types */ int8_t iCoff; int8_t qCoff; + int8_t antennaMax; int16_t rawNoiseFloor; int16_t noiseFloorAdjust; uint16_t mainSpur; /* cached spur value for this cahnnel */ uint32_t conformanceTestLimit; /* conformance test limit from reg domain */ - int8_t antennaMax; } HAL_CHANNEL_INTERNAL; typedef struct { Modified: user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Wed Jan 14 19:07:20 2009 (r187231) +++ user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Wed Jan 14 19:22:06 2009 (r187232) @@ -1073,12 +1073,12 @@ ar5212PerCalibrationN(struct ath_hal *ah AR_PHY_TIMING_CTRL4_IQCORR_ENABLE); ahp->ah_bIQCalibration = IQ_CAL_DONE; - ichan->iqCalValid = AH_TRUE; + ichan->privFlags |= CHANNEL_IQVALID; ichan->iCoff = iCoff; ichan->qCoff = qCoff; } } else if (!IS_CHAN_B(chan) && ahp->ah_bIQCalibration == IQ_CAL_DONE && - !ichan->iqCalValid) { + (ichan->privFlags & CHANNEL_IQVALID) == 0) { /* * Start IQ calibration if configured channel has changed. * Use a magic number of 15 based on default value. @@ -1574,7 +1574,7 @@ ar5212SetBoardValues(struct ath_hal *ah, } AR_PHY_BIS(ah, 73, 0xFFFFFF01, (falseDectectBackoff << 1) & 0xFE); - if (chan->iqCalValid) { + if (chan->privFlags & CHANNEL_IQVALID) { iCoff = chan->iCoff; qCoff = chan->qCoff; } else { From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 19:43:30 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA18110656DA; Wed, 14 Jan 2009 19:43:30 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB1168FC2D; Wed, 14 Jan 2009 19:43:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EJhT50052036; Wed, 14 Jan 2009 19:43:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EJhTR0052033; Wed, 14 Jan 2009 19:43:29 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141943.n0EJhTR0052033@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 19:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187233 - in user/sam/wifi/sys/dev/ath: . ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 19:43:32 -0000 Author: sam Date: Wed Jan 14 19:43:28 2009 New Revision: 187233 URL: http://svn.freebsd.org/changeset/base/187233 Log: Remove code to map frequency to IEEE channel numbers as it was used solely to setup state for net80211 according to SKU but with net80211 having proper channel attributes this is no longer needed; the driver can just check SKU info and set the needed flags so net80211's routine can do the right thing. Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.c user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/if_ath.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.c Wed Jan 14 19:22:06 2009 (r187232) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.c Wed Jan 14 19:43:28 2009 (r187233) @@ -252,71 +252,6 @@ ath_hal_computetxtime(struct ath_hal *ah return txTime; } -static __inline int -mapgsm(u_int freq, u_int flags) -{ - freq *= 10; - if (flags & CHANNEL_QUARTER) - freq += 5; - else if (flags & CHANNEL_HALF) - freq += 10; - else - freq += 20; - return (freq - 24220) / 5; -} - -static __inline int -mappsb(u_int freq, u_int flags) -{ - return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; -} - -/* - * Convert GHz frequency to IEEE channel number. - */ -int -ath_hal_mhz2ieee(struct ath_hal *ah, u_int freq, u_int flags) -{ - if (flags & CHANNEL_2GHZ) { /* 2GHz band */ - if (freq == 2484) - return 14; - if (freq < 2484) { - if (ath_hal_isgsmsku(ah)) - return mapgsm(freq, flags); - return ((int)freq - 2407) / 5; - } else - return 15 + ((freq - 2512) / 20); - } else if (flags & CHANNEL_5GHZ) {/* 5Ghz band */ - if (ath_hal_ispublicsafetysku(ah) && - IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq)) { - return mappsb(freq, flags); - } else if ((flags & CHANNEL_A) && (freq <= 5000)) { - return (freq - 4000) / 5; - } else { - return (freq - 5000) / 5; - } - } else { /* either, guess */ - if (freq == 2484) - return 14; - if (freq < 2484) { - if (ath_hal_isgsmsku(ah)) - return mapgsm(freq, flags); - return ((int)freq - 2407) / 5; - } - if (freq < 5000) { - if (ath_hal_ispublicsafetysku(ah) && - IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq)) { - return mappsb(freq, flags); - } else if (freq > 4900) { - return (freq - 4000) / 5; - } else { - return 15 + ((freq - 2512) / 20); - } - } - return (freq - 5000) / 5; - } -} - typedef enum { WIRELESS_MODE_11a = 0, WIRELESS_MODE_TURBO = 1, Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 19:22:06 2009 (r187232) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 19:43:28 2009 (r187233) @@ -891,10 +891,4 @@ extern HAL_BOOL __ahdecl ath_hal_ispubli * Return if device is operating in 900 MHz band. */ extern HAL_BOOL ath_hal_isgsmsku(struct ath_hal *); - -/* - * Convert between IEEE channel number and channel frequency - * using the specified channel flags; e.g. CHANNEL_2GHZ. - */ -extern int __ahdecl ath_hal_mhz2ieee(struct ath_hal *, u_int mhz, u_int flags); #endif /* _ATH_AH_H_ */ Modified: user/sam/wifi/sys/dev/ath/if_ath.c ============================================================================== --- user/sam/wifi/sys/dev/ath/if_ath.c Wed Jan 14 19:22:06 2009 (r187232) +++ user/sam/wifi/sys/dev/ath/if_ath.c Wed Jan 14 19:43:28 2009 (r187233) @@ -5729,12 +5729,10 @@ ath_chan_set(struct ath_softc *sc, struc ath_mapchan(ic, &hchan, chan); DPRINTF(sc, ATH_DEBUG_RESET, - "%s: %u (%u MHz, hal flags 0x%x) -> %u (%u MHz, hal flags 0x%x)\n", + "%s: %u (%u MHz, hal flags 0x%x) -> (%u MHz, hal flags 0x%x)\n", __func__, - ath_hal_mhz2ieee(ah, sc->sc_curchan.channel, - sc->sc_curchan.channelFlags), + ieee80211_mhz2ieee(chan->ic_freq, chan->ic_flags), sc->sc_curchan.channel, sc->sc_curchan.channelFlags, - ath_hal_mhz2ieee(ah, hchan.channel, hchan.channelFlags), hchan.channel, hchan.channelFlags); if (hchan.channel != sc->sc_curchan.channel || hchan.channelFlags != sc->sc_curchan.channelFlags) { @@ -6221,18 +6219,10 @@ getchannels(struct ath_softc *sc, int *n * Convert HAL channels to ieee80211 ones. */ for (i = 0; i < nhalchans; i++) { - HAL_CHANNEL *c = &halchans[i]; + const HAL_CHANNEL *c = &halchans[i]; struct ieee80211_channel *ichan = &chans[i]; - ichan->ic_ieee = ath_hal_mhz2ieee(ah, c->channel, - c->channelFlags); - if (bootverbose) - device_printf(sc->sc_dev, "hal channel %u/%x -> %u " - "maxpow %d minpow %d maxreg %d\n", - c->channel, c->channelFlags, ichan->ic_ieee, - c->maxTxPower, c->minTxPower, c->maxRegTxPower); ichan->ic_freq = c->channel; - if ((c->channelFlags & CHANNEL_PUREG) == CHANNEL_PUREG) { /* * Except for AR5211, HAL's PUREG means mixed @@ -6257,9 +6247,16 @@ getchannels(struct ath_softc *sc, int *n else ichan->ic_freq = 3344 - ichan->ic_freq; ichan->ic_flags |= IEEE80211_CHAN_GSM; - ichan->ic_ieee = ieee80211_mhz2ieee(ichan->ic_freq, - ichan->ic_flags); } + + ichan->ic_ieee = ieee80211_mhz2ieee(ichan->ic_freq, + ichan->ic_flags); + if (bootverbose) + device_printf(sc->sc_dev, "hal channel %u/%x -> %u " + "maxpow %d minpow %d maxreg %d\n", + c->channel, c->channelFlags, ichan->ic_ieee, + c->maxTxPower, c->minTxPower, c->maxRegTxPower); + ichan->ic_maxregpower = c->maxRegTxPower; /* dBm */ /* XXX: old hal's don't provide maxTxPower for some parts */ ichan->ic_maxpower = (c->maxTxPower != 0) ? From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 20:00:59 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ABAD106564A; Wed, 14 Jan 2009 20:00:59 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAD748FC16; Wed, 14 Jan 2009 20:00:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EK0wWU052409; Wed, 14 Jan 2009 20:00:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EK0wEW052407; Wed, 14 Jan 2009 20:00:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901142000.n0EK0wEW052407@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 20:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187234 - in user/sam/wifi/sys/dev/ath/ath_hal: ar5211 ar5212 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 20:00:59 -0000 Author: sam Date: Wed Jan 14 20:00:58 2009 New Revision: 187234 URL: http://svn.freebsd.org/changeset/base/187234 Log: oops, forgot about 5111 usage of ath_hal_mhz2ieee; add private versions of this code stripped down to meet local needs Modified: user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5111.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Wed Jan 14 19:43:28 2009 (r187233) +++ user/sam/wifi/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Wed Jan 14 20:00:58 2009 (r187234) @@ -803,6 +803,38 @@ ar5211SetResetReg(struct ath_hal *ah, ui return rt; } +static __inline int +mappsb(u_int freq, u_int flags) +{ + return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; +} + +/* + * Convert MHz frequency to IEEE channel number. + */ +static int +mhz2ieee(u_int freq, u_int flags) +{ + HALASSERT((flags & (CHANNEL_2GHZ|CHANNEL_5GHZ)) != 0); + + if (flags & CHANNEL_2GHZ) { + if (freq == 2484) { + return 14; + } else if (freq < 2484) { + return ((int)freq - 2407) / 5; + } else + return 15 + ((freq - 2512) / 20); + } else { + if (IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq)) { + return mappsb(freq, flags); + } else if ((flags & CHANNEL_A) && freq <= 5000) { + return (freq - 4000) / 5; + } else { + return (freq - 5000) / 5; + } + } +} + /* * Takes the MHz channel value and sets the Channel value * @@ -815,7 +847,7 @@ ar5211SetChannel(struct ath_hal *ah, HA uint32_t refClk, reg32, data2111; int16_t chan5111, chanIEEE; - chanIEEE = ath_hal_mhz2ieee(ah, chan->channel, chan->channelFlags); + chanIEEE = mhz2ieee(chan->channel, chan->channelFlags); if (IS_CHAN_2GHZ(chan)) { const CHAN_INFO_2GHZ* ci = &chan2GHzData[chanIEEE + CI_2GHZ_INDEX_CORRECTION]; Modified: user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5111.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5111.c Wed Jan 14 19:43:28 2009 (r187233) +++ user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5111.c Wed Jan 14 20:00:58 2009 (r187234) @@ -68,6 +68,38 @@ ar5111WriteRegs(struct ath_hal *ah, u_in HAL_INI_WRITE_ARRAY(ah, ar5212BB_RfGain_5111, freqIndex, writes); } +static __inline int +mappsb(u_int freq, u_int flags) +{ + return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; +} + +/* + * Convert MHz frequency to IEEE channel number. + */ +static int +mhz2ieee(u_int freq, u_int flags) +{ + HALASSERT((flags & (CHANNEL_2GHZ|CHANNEL_5GHZ)) != 0); + + if (flags & CHANNEL_2GHZ) { + if (freq == 2484) { + return 14; + } else if (freq < 2484) { + return ((int)freq - 2407) / 5; + } else + return 15 + ((freq - 2512) / 20); + } else { + if (IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq)) { + return mappsb(freq, flags); + } else if ((flags & CHANNEL_A) && freq <= 5000) { + return (freq - 4000) / 5; + } else { + return (freq - 5000) / 5; + } + } +} + /* * Take the MHz channel value and set the Channel value * @@ -142,7 +174,7 @@ ar5111SetChannel(struct ath_hal *ah, HA OS_MARK(ah, AH_MARK_SETCHANNEL, chan->channel); - chanIEEE = ath_hal_mhz2ieee(ah, chan->channel, chan->channelFlags); + chanIEEE = mhz2ieee(chan->channel, chan->channelFlags); if (IS_CHAN_2GHZ(chan)) { const CHAN_INFO_2GHZ* ci = &chan2GHzData[chanIEEE + CI_2GHZ_INDEX_CORRECTION]; From owner-svn-src-user@FreeBSD.ORG Wed Jan 14 20:03:51 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A13010656C4; Wed, 14 Jan 2009 20:03:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49D948FC08; Wed, 14 Jan 2009 20:03:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EK3pE8052493; Wed, 14 Jan 2009 20:03:51 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EK3pY3052491; Wed, 14 Jan 2009 20:03:51 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901142003.n0EK3pY3052491@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 20:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187235 - user/sam/wifi/sys/dev/ath/ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 20:03:51 -0000 Author: sam Date: Wed Jan 14 20:03:50 2009 New Revision: 187235 URL: http://svn.freebsd.org/changeset/base/187235 Log: nuke ath_hal_ispublicsafetysku; now unused (and in general should never have existed) Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 20:00:58 2009 (r187234) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Wed Jan 14 20:03:50 2009 (r187235) @@ -883,11 +883,6 @@ extern uint16_t __ahdecl ath_hal_compute uint16_t rateix, HAL_BOOL shortPreamble); /* - * Return if device is public safety. - */ -extern HAL_BOOL __ahdecl ath_hal_ispublicsafetysku(struct ath_hal *); - -/* * Return if device is operating in 900 MHz band. */ extern HAL_BOOL ath_hal_isgsmsku(struct ath_hal *); Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Wed Jan 14 20:00:58 2009 (r187234) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Wed Jan 14 20:03:50 2009 (r187235) @@ -2146,27 +2146,6 @@ ath_hal_getwirelessmodes(struct ath_hal } /* - * Return if device is public safety. - */ -HAL_BOOL -ath_hal_ispublicsafetysku(struct ath_hal *ah) -{ - uint16_t rd = getEepromRD(ah); - - switch (rd) { - case FCC4_FCCA: - case CTRY_UNITED_STATES_FCC49 | COUNTRY_ERD_FLAG: - return AH_TRUE; - case DEBUG_REG_DMN: - case NO_ENUMRD: - if (AH_PRIVATE(ah)->ah_countryCode == CTRY_UNITED_STATES_FCC49) - return AH_TRUE; - break; - } - return AH_FALSE; -} - -/* * Return if device is actually operating in 900 MHz band. */ HAL_BOOL From owner-svn-src-user@FreeBSD.ORG Thu Jan 15 15:46:17 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE0E5106567E; Thu, 15 Jan 2009 15:46:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7FAAA8FC1D; Thu, 15 Jan 2009 15:46:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 2DD0646B23; Thu, 15 Jan 2009 10:46:17 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk56w001666; Thu, 15 Jan 2009 10:46:11 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Kip Macy Date: Thu, 15 Jan 2009 09:59:52 -0500 User-Agent: KMail/1.9.7 References: <200812312321.mBVNL75E037897@svn.freebsd.org> In-Reply-To: <200812312321.mBVNL75E037897@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901150959.53050.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:11 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r186661 - user/kmacy/HEAD_fast_net/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:18 -0000 On Wednesday 31 December 2008 6:21:07 pm Kip Macy wrote: > Author: kmacy > Date: Wed Dec 31 23:21:07 2008 > New Revision: 186661 > URL: http://svn.freebsd.org/changeset/base/186661 > > Log: > make it possible to profile normal mutex acquisition by not calling > knlist_mtx_lock Alternatively, you could pass LOCK_FILE and LOCK_LINE (sys/lock.h) to kl_lock, etc. and have knlist_mtx_lock use the private version that takes file and line. This would also make it work for all lock types. -- John Baldwin From owner-svn-src-user@FreeBSD.ORG Thu Jan 15 15:46:23 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E15F10656BA; Thu, 15 Jan 2009 15:46:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E435F8FC1C; Thu, 15 Jan 2009 15:46:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 92EAC46B43; Thu, 15 Jan 2009 10:46:22 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk56x001666; Thu, 15 Jan 2009 10:46:16 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Kip Macy Date: Thu, 15 Jan 2009 10:03:27 -0500 User-Agent: KMail/1.9.7 References: <200901030200.n0320Arr013245@svn.freebsd.org> In-Reply-To: <200901030200.n0320Arr013245@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901151003.27545.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:16 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r186710 - user/kmacy/HEAD_fast_net/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:23 -0000 On Friday 02 January 2009 9:00:10 pm Kip Macy wrote: > Author: kmacy > Date: Sat Jan 3 02:00:10 2009 > New Revision: 186710 > URL: http://svn.freebsd.org/changeset/base/186710 > > Log: > convert name cache lock to rwlock for lookups I think you need to restart the lookup if you fail an upgrade. I've had a patch to do that for years (literally) but it didn't help performance in earlier tests by kris@. You can find one that does the restarts at www.freebsd.org/~jhb/namei_rwlock.patch. -- John Baldwin From owner-svn-src-user@FreeBSD.ORG Thu Jan 15 19:26:23 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BBE51065674; Thu, 15 Jan 2009 19:26:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76F258FC27; Thu, 15 Jan 2009 19:26:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FJQNmx085147; Thu, 15 Jan 2009 19:26:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FJQMWL085123; Thu, 15 Jan 2009 19:26:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901151926.n0FJQMWL085123@svn.freebsd.org> From: Andrew Thompson Date: Thu, 15 Jan 2009 19:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187303 - in user/thompsa/usb: . contrib/ntp/ntpd contrib/openbsm contrib/openbsm/bin/auditd contrib/openbsm/bin/auditreduce contrib/openbsm/bsm contrib/openbsm/libauditd contrib/openbs... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 19:26:23 -0000 Author: thompsa Date: Thu Jan 15 19:26:21 2009 New Revision: 187303 URL: http://svn.freebsd.org/changeset/base/187303 Log: Sync to r187302 Deleted: user/thompsa/usb/sys/boot/common/load.c Modified: user/thompsa/usb/ (props changed) user/thompsa/usb/Makefile.inc1 user/thompsa/usb/UPDATING user/thompsa/usb/contrib/ntp/ntpd/ntp_crypto.c user/thompsa/usb/contrib/openbsm/ (props changed) user/thompsa/usb/contrib/openbsm/INSTALL user/thompsa/usb/contrib/openbsm/NEWS user/thompsa/usb/contrib/openbsm/VERSION user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.8 user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.c user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_darwin.c user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_fbsd.c user/thompsa/usb/contrib/openbsm/bin/auditreduce/auditreduce.c user/thompsa/usb/contrib/openbsm/bsm/auditd_lib.h user/thompsa/usb/contrib/openbsm/bsm/libbsm.h user/thompsa/usb/contrib/openbsm/configure user/thompsa/usb/contrib/openbsm/configure.ac user/thompsa/usb/contrib/openbsm/libauditd/Makefile.am user/thompsa/usb/contrib/openbsm/libauditd/Makefile.in user/thompsa/usb/contrib/openbsm/libauditd/auditd_lib.c user/thompsa/usb/contrib/openbsm/libbsm/Makefile.am user/thompsa/usb/contrib/openbsm/libbsm/Makefile.in user/thompsa/usb/contrib/openbsm/libbsm/au_token.3 user/thompsa/usb/contrib/openbsm/libbsm/bsm_audit.c user/thompsa/usb/contrib/openbsm/libbsm/bsm_errno.c user/thompsa/usb/contrib/openbsm/libbsm/bsm_io.c user/thompsa/usb/contrib/openbsm/libbsm/bsm_token.c user/thompsa/usb/contrib/openbsm/libbsm/libbsm.3 user/thompsa/usb/contrib/openbsm/man/audit_user.5 user/thompsa/usb/contrib/openbsm/sys/bsm/Makefile.am user/thompsa/usb/contrib/openbsm/sys/bsm/Makefile.in user/thompsa/usb/contrib/openbsm/sys/bsm/audit.h user/thompsa/usb/contrib/openbsm/sys/bsm/audit_errno.h user/thompsa/usb/contrib/openbsm/sys/bsm/audit_record.h user/thompsa/usb/contrib/openbsm/test/bsm/generate.c user/thompsa/usb/contrib/openbsm/test/reference/E2BIG_record user/thompsa/usb/contrib/openbsm/test/reference/EACCES_record user/thompsa/usb/contrib/openbsm/test/reference/EBADF_record user/thompsa/usb/contrib/openbsm/test/reference/EBUSY_record user/thompsa/usb/contrib/openbsm/test/reference/ECHILD_record user/thompsa/usb/contrib/openbsm/test/reference/EDEADLK_record user/thompsa/usb/contrib/openbsm/test/reference/EEXIST_record user/thompsa/usb/contrib/openbsm/test/reference/EFAULT_record user/thompsa/usb/contrib/openbsm/test/reference/EFBIG_record user/thompsa/usb/contrib/openbsm/test/reference/EINTR_record user/thompsa/usb/contrib/openbsm/test/reference/EINVAL_record user/thompsa/usb/contrib/openbsm/test/reference/EIO_record user/thompsa/usb/contrib/openbsm/test/reference/EISDIR_record user/thompsa/usb/contrib/openbsm/test/reference/EMFILE_record user/thompsa/usb/contrib/openbsm/test/reference/EMLINK_record user/thompsa/usb/contrib/openbsm/test/reference/ENFILE_record user/thompsa/usb/contrib/openbsm/test/reference/ENODEV_record user/thompsa/usb/contrib/openbsm/test/reference/ENOENT_record user/thompsa/usb/contrib/openbsm/test/reference/ENOEXEC_record user/thompsa/usb/contrib/openbsm/test/reference/ENOMEM_record user/thompsa/usb/contrib/openbsm/test/reference/ENOSPC_record user/thompsa/usb/contrib/openbsm/test/reference/ENOTBLK_record user/thompsa/usb/contrib/openbsm/test/reference/ENOTDIR_record user/thompsa/usb/contrib/openbsm/test/reference/ENOTTY_record user/thompsa/usb/contrib/openbsm/test/reference/ENXIO_record user/thompsa/usb/contrib/openbsm/test/reference/EPERM_record user/thompsa/usb/contrib/openbsm/test/reference/EPIPE_record user/thompsa/usb/contrib/openbsm/test/reference/EROFS_record user/thompsa/usb/contrib/openbsm/test/reference/ESPIPE_record user/thompsa/usb/contrib/openbsm/test/reference/ESRCH_record user/thompsa/usb/contrib/openbsm/test/reference/ETXTBSY_record user/thompsa/usb/contrib/openbsm/test/reference/EXDEV_record user/thompsa/usb/contrib/openbsm/test/reference/arg32_record user/thompsa/usb/contrib/openbsm/test/reference/data_record user/thompsa/usb/contrib/openbsm/test/reference/data_token user/thompsa/usb/contrib/openbsm/test/reference/file_record user/thompsa/usb/contrib/openbsm/test/reference/in_addr_record user/thompsa/usb/contrib/openbsm/test/reference/ip_record user/thompsa/usb/contrib/openbsm/test/reference/ipc_record user/thompsa/usb/contrib/openbsm/test/reference/iport_record user/thompsa/usb/contrib/openbsm/test/reference/opaque_record user/thompsa/usb/contrib/openbsm/test/reference/path_record user/thompsa/usb/contrib/openbsm/test/reference/process32_record user/thompsa/usb/contrib/openbsm/test/reference/process32ex_record-IPv4 user/thompsa/usb/contrib/openbsm/test/reference/process32ex_record-IPv6 user/thompsa/usb/contrib/openbsm/test/reference/process64_record user/thompsa/usb/contrib/openbsm/test/reference/process64ex_record-IPv4 user/thompsa/usb/contrib/openbsm/test/reference/process64ex_record-IPv6 user/thompsa/usb/contrib/openbsm/test/reference/return32_record user/thompsa/usb/contrib/openbsm/test/reference/seq_record user/thompsa/usb/contrib/openbsm/test/reference/socketex_record user/thompsa/usb/contrib/openbsm/test/reference/socketex_token user/thompsa/usb/contrib/openbsm/test/reference/subject32_record user/thompsa/usb/contrib/openbsm/test/reference/subject32ex_record user/thompsa/usb/contrib/openbsm/test/reference/text_record user/thompsa/usb/contrib/openbsm/test/reference/zonename_record user/thompsa/usb/contrib/wpa_supplicant/ (props changed) user/thompsa/usb/etc/periodic/weekly/Makefile user/thompsa/usb/lib/libbsm/Makefile user/thompsa/usb/lib/libc/locale/mbstowcs.c user/thompsa/usb/lib/libc/locale/wcsftime.c user/thompsa/usb/lib/libc/locale/wcstombs.c user/thompsa/usb/lib/libc/stdio/fputws.c user/thompsa/usb/lib/libc/stdio/vfprintf.c user/thompsa/usb/lib/libc/stdio/vfwprintf.c user/thompsa/usb/lib/libc/stdio/vswscanf.c user/thompsa/usb/sbin/fdisk/fdisk.c user/thompsa/usb/sbin/ifconfig/ifconfig.c user/thompsa/usb/share/man/man4/ath.4 user/thompsa/usb/sys/ (props changed) user/thompsa/usb/sys/amd64/amd64/exception.S user/thompsa/usb/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) user/thompsa/usb/sys/bsm/audit.h user/thompsa/usb/sys/bsm/audit_errno.h user/thompsa/usb/sys/bsm/audit_internal.h user/thompsa/usb/sys/bsm/audit_kevents.h user/thompsa/usb/sys/bsm/audit_record.h user/thompsa/usb/sys/cam/cam_xpt.c user/thompsa/usb/sys/cam/scsi/scsi_all.c user/thompsa/usb/sys/cam/scsi/scsi_da.c user/thompsa/usb/sys/cam/scsi/scsi_sg.c user/thompsa/usb/sys/conf/files user/thompsa/usb/sys/conf/files.powerpc user/thompsa/usb/sys/contrib/pf/ (props changed) user/thompsa/usb/sys/dev/bce/if_bce.c user/thompsa/usb/sys/dev/iicbus/iicbus.c user/thompsa/usb/sys/dev/msk/if_msk.c user/thompsa/usb/sys/dev/msk/if_mskreg.h user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c user/thompsa/usb/sys/dev/usb/ehci.c user/thompsa/usb/sys/dev/usb/ehci_ixp4xx.c (props changed) user/thompsa/usb/sys/dev/usb2/bluetooth/ubtbcmfw2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_aue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_axe2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_cdce2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_cue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_kue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_kuereg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_rue2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_ruereg.h user/thompsa/usb/sys/dev/usb2/ethernet/if_udav2.c user/thompsa/usb/sys/dev/usb2/ethernet/if_udavreg.h user/thompsa/usb/sys/dev/usb2/image/uscanner2.c user/thompsa/usb/sys/dev/usb2/input/uhid2.c user/thompsa/usb/sys/dev/usb2/input/ukbd2.c user/thompsa/usb/sys/dev/usb2/input/ums2.c user/thompsa/usb/sys/dev/usb2/serial/u3g2.c user/thompsa/usb/sys/dev/usb2/serial/uark2.c user/thompsa/usb/sys/dev/usb2/serial/ubsa2.c user/thompsa/usb/sys/dev/usb2/serial/ubser2.c user/thompsa/usb/sys/dev/usb2/serial/uchcom2.c user/thompsa/usb/sys/dev/usb2/serial/ucycom2.c user/thompsa/usb/sys/dev/usb2/serial/ufoma2.c user/thompsa/usb/sys/dev/usb2/serial/uftdi2.c user/thompsa/usb/sys/dev/usb2/serial/ugensa2.c user/thompsa/usb/sys/dev/usb2/serial/uipaq2.c user/thompsa/usb/sys/dev/usb2/serial/ulpt2.c user/thompsa/usb/sys/dev/usb2/serial/umct2.c user/thompsa/usb/sys/dev/usb2/serial/umoscom2.c user/thompsa/usb/sys/dev/usb2/serial/uplcom2.c user/thompsa/usb/sys/dev/usb2/serial/uvisor2.c user/thompsa/usb/sys/dev/usb2/serial/uvscom2.c user/thompsa/usb/sys/dev/usb2/wlan/if_rum2.c user/thompsa/usb/sys/dev/usb2/wlan/if_rumvar.h user/thompsa/usb/sys/dev/usb2/wlan/if_ural2.c user/thompsa/usb/sys/dev/usb2/wlan/if_uralvar.h user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2.c user/thompsa/usb/sys/dev/usb2/wlan/if_zydreg.h user/thompsa/usb/sys/fs/msdosfs/msdosfs_conv.c user/thompsa/usb/sys/kern/sysv_sem.c user/thompsa/usb/sys/mips/idt/idtpci.c user/thompsa/usb/sys/mips/include/pmap.h user/thompsa/usb/sys/mips/malta/gt_pci.c user/thompsa/usb/sys/mips/mips/busdma_machdep.c user/thompsa/usb/sys/mips/mips/cpu.c user/thompsa/usb/sys/mips/mips/elf64_machdep.c (props changed) user/thompsa/usb/sys/mips/mips/machdep.c user/thompsa/usb/sys/mips/mips/nexus.c user/thompsa/usb/sys/mips/mips/pmap.c user/thompsa/usb/sys/modules/usb2/controller_atmegadci/ (props changed) user/thompsa/usb/sys/netinet/tcp_input.c user/thompsa/usb/sys/netinet/tcp_subr.c user/thompsa/usb/sys/netinet/tcp_timer.c user/thompsa/usb/sys/netinet/tcp_var.h user/thompsa/usb/sys/netinet/vinet.h user/thompsa/usb/sys/pc98/conf/GENERIC user/thompsa/usb/sys/powerpc/conf/NOTES user/thompsa/usb/sys/security/audit/audit_bsm_errno.c user/thompsa/usb/sys/security/audit/audit_bsm_token.c user/thompsa/usb/sys/sys/param.h user/thompsa/usb/usr.sbin/boot0cfg/boot0cfg.8 user/thompsa/usb/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) user/thompsa/usb/usr.sbin/makefs/ffs/ffs_subr.c (props changed) user/thompsa/usb/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) user/thompsa/usb/usr.sbin/makefs/getid.c (props changed) Modified: user/thompsa/usb/Makefile.inc1 ============================================================================== --- user/thompsa/usb/Makefile.inc1 Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/Makefile.inc1 Thu Jan 15 19:26:21 2009 (r187303) @@ -5,6 +5,7 @@ # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir # -DNO_CLEAN do not clean at all # -DNO_SHARE do not go into share subdir +# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELCONFIG # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel @@ -697,6 +698,11 @@ distrib-dirs distribution: # be set to cross-build, we have to make sure TARGET is set # properly. +.if defined(KERNFAST) +NO_KERNELCLEAN= t +NO_KERNELCONFIG= t +NO_KERNELDEPEND= t +.endif .if !defined(KERNCONF) && defined(KERNEL) KERNCONF= ${KERNEL} KERNWARN= Modified: user/thompsa/usb/UPDATING ============================================================================== --- user/thompsa/usb/UPDATING Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/UPDATING Thu Jan 15 19:26:21 2009 (r187303) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090115: + TCP Appropriate Byte Counting (RFC 3465) support added to kernel. + New field in struct tcpcb breaks ABI, so bump __FreeBSD_version to + 800061. User space tools that rely on the size of struct tcpcb in + tcp_var.h (e.g. sockstat) need to be recompiled. + 20081225: ng_tty(4) module updated to match the new TTY subsystem. Due to API change, user-level applications must be updated. Modified: user/thompsa/usb/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- user/thompsa/usb/contrib/ntp/ntpd/ntp_crypto.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/ntp/ntpd/ntp_crypto.c Thu Jan 15 19:26:21 2009 (r187303) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { Modified: user/thompsa/usb/contrib/openbsm/INSTALL ============================================================================== --- user/thompsa/usb/contrib/openbsm/INSTALL Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/INSTALL Thu Jan 15 19:26:21 2009 (r187303) @@ -9,6 +9,12 @@ support are built conditionally. Typica ./configure make +If doing development work on OpenBSM with gcc, the following invocation of +configure may be preferred in order to generate full compiler warnings and +force the compile to fail if a warning is found: + + CFLAGS="-Wall -Werror" ./configure + To install, use: make install Modified: user/thompsa/usb/contrib/openbsm/NEWS ============================================================================== --- user/thompsa/usb/contrib/openbsm/NEWS Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/NEWS Thu Jan 15 19:26:21 2009 (r187303) @@ -1,5 +1,24 @@ OpenBSM Version History +OpenBSM 1.1 alpha 5 + +- Stub libauditd(3) man page added. +- All BSM error number constants with BSM_ERRNO_. +- Interfaces to convert between local and BSM socket types and protocol + families have been added: au_bsm_to_domain(3), au_bsm_to_socket_type(3), + au_domain_to_bsm(3), and au_socket_type_to_bsm(3), along with definitions + of constants in audit_domain.h and audit_socket_type.h. This improves + interoperability by converting local constant spaces, which vary by OS, to + and from Solaris constants (where available) or OpenBSM constants for + protocol domains not present in Solaris (a fair number). These routines + should be used when generating and interpreting extended socket tokens. +- Fix build warnings with full gcc warnings enabled on most supported + platforms. +- Don't compile error strings into bsm_errno.c when building it in the kernel + environment. +- When started by launchd, use the label com.apple.auditd rather than + org.trustedbsd.auditd. + OpenBSM 1.1 alpha 4 - With the addition of BSM error number mapping, we also need to map the @@ -393,4 +412,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#21 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#27 $ Modified: user/thompsa/usb/contrib/openbsm/VERSION ============================================================================== --- user/thompsa/usb/contrib/openbsm/VERSION Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/VERSION Thu Jan 15 19:26:21 2009 (r187303) @@ -1 +1 @@ -OPENBSM_1_1_ALPHA_4 +OPENBSM_1_1_ALPHA_5 Modified: user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.8 ============================================================================== --- user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.8 Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.8 Thu Jan 15 19:26:21 2009 (r187303) @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#16 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#17 $ .\" .Dd December 11, 2008 .Dt AUDITD 8 @@ -115,6 +115,7 @@ and are no longer available as arguments .Nm . .Sh SEE ALSO .Xr asl 3 , +.Xr libauditd 3 , .Xr audit 4 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bin/auditd/auditd.c Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#40 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#41 $ */ #include @@ -252,7 +252,7 @@ do_trail_file(void) */ err = auditd_read_dirs(audit_warn_soft, audit_warn_hard); if (err) { - auditd_log_err("auditd_read_dirs() %s: %m", + auditd_log_err("auditd_read_dirs(): %s", auditd_strerror(err)); if (err == ADE_HARDLIM) audit_warn_allhard(); Modified: user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_darwin.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_darwin.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_darwin.c Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#3 $ */ #include @@ -83,7 +83,7 @@ static int max_idletime = 0; #endif /* __BSM_INTERNAL_NOTIFY_KEY */ #ifndef __AUDIT_LAUNCHD_LABEL -#define __AUDIT_LAUNCHD_LABEL "org.trustedbsd.auditd" +#define __AUDIT_LAUNCHD_LABEL "com.apple.auditd" #endif /* __AUDIT_LAUNCHD_LABEL */ #define MAX_MSG_SIZE 4096 @@ -100,7 +100,7 @@ auditd_openlog(int debug, gid_t gid) if (debug) opt = ASL_OPT_STDERR; - au_aslclient = asl_open("auditd", "org.trustedbsd.auditd", opt); + au_aslclient = asl_open("auditd", "com.apple.auditd", opt); au_aslmsg = asl_new(ASL_TYPE_MSG); #ifdef ASL_KEY_READ_UID Modified: user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_fbsd.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bin/auditd/auditd_fbsd.c Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#2 $ */ #include @@ -35,9 +35,11 @@ #include #include +#include #include +#include #include -#include +#include #include #include Modified: user/thompsa/usb/contrib/openbsm/bin/auditreduce/auditreduce.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/bin/auditreduce/auditreduce.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bin/auditreduce/auditreduce.c Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#29 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#31 $ */ /* @@ -41,6 +41,9 @@ */ #include + +#define _GNU_SOURCE /* Required for strptime() on glibc2. */ + #ifdef HAVE_FULL_QUEUE_H #include #else Modified: user/thompsa/usb/contrib/openbsm/bsm/auditd_lib.h ============================================================================== --- user/thompsa/usb/contrib/openbsm/bsm/auditd_lib.h Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bsm/auditd_lib.h Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/auditd_lib.h#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/auditd_lib.h#3 $ */ #ifndef _BSM_AUDITD_LIB_H_ @@ -57,7 +57,7 @@ * Path of auditd plist file for launchd. */ #define AUDITD_PLIST_FILE \ - "/System/Library/LaunchDaemons/org.trustedbsd.auditd.plist" + "/System/Library/LaunchDaemons/com.apple.auditd.plist" /* * Error return codes for auditd_lib functions. Modified: user/thompsa/usb/contrib/openbsm/bsm/libbsm.h ============================================================================== --- user/thompsa/usb/contrib/openbsm/bsm/libbsm.h Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/bsm/libbsm.h Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#40 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#41 $ */ #ifndef _LIBBSM_H_ @@ -821,14 +821,22 @@ void au_print_tok_xml(FILE *outfp, to */ void au_print_xml_header(FILE *outfp); void au_print_xml_footer(FILE *outfp); -__END_DECLS /* - * Functions relating to BSM<->errno conversion. - */ -int au_bsm_to_errno(u_char bsm_error, int *errorp); -u_char au_errno_to_bsm(int error); -const char *au_strerror(u_char bsm_error); + * BSM library routines for converting between local and BSM constant spaces. + * (Note: some of these are replicated in audit_record.h for the benefit of + * the FreeBSD and Mac OS X kernels) + */ +int au_bsm_to_domain(u_short bsm_domain, int *local_domainp); +int au_bsm_to_errno(u_char bsm_error, int *errorp); +int au_bsm_to_socket_type(u_short bsm_socket_type, + int *local_socket_typep); +u_short au_domain_to_bsm(int local_domain); +u_char au_errno_to_bsm(int local_errno); +u_short au_socket_type_to_bsm(int local_socket_type); + +const char *au_strerror(u_char bsm_error); +__END_DECLS /* * The remaining APIs are associated with Apple's BSM implementation, in Modified: user/thompsa/usb/contrib/openbsm/configure ============================================================================== --- user/thompsa/usb/contrib/openbsm/configure Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/configure Thu Jan 15 19:26:21 2009 (r187303) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#47 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#49 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha4. +# Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha5. # # Report bugs to . # @@ -729,8 +729,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='OpenBSM' PACKAGE_TARNAME='openbsm' -PACKAGE_VERSION='1.1alpha4' -PACKAGE_STRING='OpenBSM 1.1alpha4' +PACKAGE_VERSION='1.1alpha5' +PACKAGE_STRING='OpenBSM 1.1alpha5' PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org' ac_unique_file="bin/auditreduce/auditreduce.c" @@ -1404,7 +1404,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenBSM 1.1alpha4 to adapt to many kinds of systems. +\`configure' configures OpenBSM 1.1alpha5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1474,7 +1474,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenBSM 1.1alpha4:";; + short | recursive ) echo "Configuration of OpenBSM 1.1alpha5:";; esac cat <<\_ACEOF @@ -1580,7 +1580,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenBSM configure 1.1alpha4 +OpenBSM configure 1.1alpha5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1594,7 +1594,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenBSM $as_me 1.1alpha4, which was +It was created by OpenBSM $as_me 1.1alpha5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -19076,7 +19076,7 @@ fi # Define the identity of the package. PACKAGE=OpenBSM - VERSION=1.1alpha4 + VERSION=1.1alpha5 cat >>confdefs.h <<_ACEOF @@ -23584,7 +23584,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenBSM $as_me 1.1alpha4, which was +This file was extended by OpenBSM $as_me 1.1alpha5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23637,7 +23637,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -OpenBSM config.status 1.1alpha4 +OpenBSM config.status 1.1alpha5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: user/thompsa/usb/contrib/openbsm/configure.ac ============================================================================== --- user/thompsa/usb/contrib/openbsm/configure.ac Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/configure.ac Thu Jan 15 19:26:21 2009 (r187303) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([OpenBSM], [1.1alpha4], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#48 $]) +AC_INIT([OpenBSM], [1.1alpha5], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#49 $]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config/config.h]) Modified: user/thompsa/usb/contrib/openbsm/libauditd/Makefile.am ============================================================================== --- user/thompsa/usb/contrib/openbsm/libauditd/Makefile.am Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libauditd/Makefile.am Thu Jan 15 19:26:21 2009 (r187303) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.am#1 $ +# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.am#2 $ # if USE_NATIVE_INCLUDES @@ -13,5 +13,5 @@ lib_LTLIBRARIES = libauditd.la libauditd_la_SOURCES = \ auditd_lib.c -#man3_MANS = \ -# libauditd.3 +man3_MANS = \ + libauditd.3 Modified: user/thompsa/usb/contrib/openbsm/libauditd/Makefile.in ============================================================================== --- user/thompsa/usb/contrib/openbsm/libauditd/Makefile.in Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libauditd/Makefile.in Thu Jan 15 19:26:21 2009 (r187303) @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.in#1 $ +# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.in#2 $ # VPATH = @srcdir@ @@ -51,7 +51,7 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libauditd_la_LIBADD = @@ -71,6 +71,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLF $(LDFLAGS) -o $@ SOURCES = $(libauditd_la_SOURCES) DIST_SOURCES = $(libauditd_la_SOURCES) +man3dir = $(mandir)/man3 +NROFF = nroff +MANS = $(man3_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -188,6 +191,9 @@ lib_LTLIBRARIES = libauditd.la libauditd_la_SOURCES = \ auditd_lib.c +man3_MANS = \ + libauditd.3 + all: all-am .SUFFIXES: @@ -285,6 +291,51 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-man3: $(man3_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ + done +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -362,9 +413,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -412,7 +463,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-man install-dvi: install-dvi-am @@ -422,7 +473,7 @@ install-html: install-html-am install-info: install-info-am -install-man: +install-man: install-man3 install-pdf: install-pdf-am @@ -448,7 +499,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES +uninstall-am: uninstall-libLTLIBRARIES uninstall-man + +uninstall-man: uninstall-man3 .MAKE: install-am install-strip @@ -459,16 +512,14 @@ uninstall-am: uninstall-libLTLIBRARIES install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-libLTLIBRARIES install-man install-man3 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-libLTLIBRARIES - + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man3 -#man3_MANS = \ -# libauditd.3 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Modified: user/thompsa/usb/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/libauditd/auditd_lib.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libauditd/auditd_lib.c Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#2 $ */ #include @@ -823,7 +823,7 @@ audit_quick_stop(void) */ if (auditon(A_GETCOND, &cond, sizeof(cond)) < 0) return (-1); - if (cond == AUC_DISABLED) + if (cond == AUC_NOAUDIT) return (0); /* Modified: user/thompsa/usb/contrib/openbsm/libbsm/Makefile.am ============================================================================== --- user/thompsa/usb/contrib/openbsm/libbsm/Makefile.am Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libbsm/Makefile.am Thu Jan 15 19:26:21 2009 (r187303) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#7 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#8 $ # if USE_NATIVE_INCLUDES @@ -14,11 +14,13 @@ libbsm_la_SOURCES = \ bsm_audit.c \ bsm_class.c \ bsm_control.c \ + bsm_domain.c \ bsm_errno.c \ bsm_event.c \ bsm_flags.c \ bsm_io.c \ bsm_mask.c \ + bsm_socket_type.c \ bsm_token.c \ bsm_user.c @@ -31,12 +33,14 @@ endif man3_MANS = \ au_class.3 \ au_control.3 \ + au_domain.3 \ au_errno.3 \ au_event.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ au_open.3 \ + au_socket_type.3 \ au_token.3 \ au_user.3 \ libbsm.3 Modified: user/thompsa/usb/contrib/openbsm/libbsm/Makefile.in ============================================================================== --- user/thompsa/usb/contrib/openbsm/libbsm/Makefile.in Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libbsm/Makefile.in Thu Jan 15 19:26:21 2009 (r187303) @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#12 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#13 $ # VPATH = @srcdir@ @@ -60,13 +60,15 @@ libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libbsm_la_LIBADD = am__libbsm_la_SOURCES_DIST = bsm_audit.c bsm_class.c bsm_control.c \ - bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c \ - bsm_token.c bsm_user.c bsm_notify.c bsm_wrappers.c + bsm_domain.c bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c \ + bsm_mask.c bsm_socket_type.c bsm_token.c bsm_user.c \ + bsm_notify.c bsm_wrappers.c @HAVE_AUDIT_SYSCALLS_TRUE@am__objects_1 = bsm_notify.lo \ @HAVE_AUDIT_SYSCALLS_TRUE@ bsm_wrappers.lo am_libbsm_la_OBJECTS = bsm_audit.lo bsm_class.lo bsm_control.lo \ - bsm_errno.lo bsm_event.lo bsm_flags.lo bsm_io.lo bsm_mask.lo \ - bsm_token.lo bsm_user.lo $(am__objects_1) + bsm_domain.lo bsm_errno.lo bsm_event.lo bsm_flags.lo bsm_io.lo \ + bsm_mask.lo bsm_socket_type.lo bsm_token.lo bsm_user.lo \ + $(am__objects_1) libbsm_la_OBJECTS = $(am_libbsm_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp @@ -199,18 +201,20 @@ top_srcdir = @top_srcdir@ @USE_NATIVE_INCLUDES_FALSE@INCLUDES = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/sys @USE_NATIVE_INCLUDES_TRUE@INCLUDES = -I$(top_builddir) -I$(top_srcdir) lib_LTLIBRARIES = libbsm.la -libbsm_la_SOURCES = bsm_audit.c bsm_class.c bsm_control.c bsm_errno.c \ - bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c bsm_token.c \ - bsm_user.c $(am__append_1) +libbsm_la_SOURCES = bsm_audit.c bsm_class.c bsm_control.c bsm_domain.c \ + bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c \ + bsm_socket_type.c bsm_token.c bsm_user.c $(am__append_1) man3_MANS = \ au_class.3 \ au_control.3 \ + au_domain.3 \ au_errno.3 \ au_event.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ au_open.3 \ + au_socket_type.3 \ au_token.3 \ au_user.3 \ libbsm.3 @@ -287,12 +291,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_audit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_control.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_domain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_errno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_flags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_mask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_notify.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_socket_type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_user.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_wrappers.Plo@am__quote@ Modified: user/thompsa/usb/contrib/openbsm/libbsm/au_token.3 ============================================================================== --- user/thompsa/usb/contrib/openbsm/libbsm/au_token.3 Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libbsm/au_token.3 Thu Jan 15 19:26:21 2009 (r187303) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#16 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#17 $ .\" .Dd April 19, 2005 .Dt AU_TOKEN 3 @@ -60,6 +60,7 @@ .Nm au_to_sock_inet32 , .Nm au_to_sock_inet128 , .Nm au_to_sock_inet , +.Nm au_to_socket_ex , .Nm au_to_subject32 , .Nm au_to_subject64 , .Nm au_to_subject , @@ -156,6 +157,8 @@ .Ft "token_t *" .Fn au_to_sock_int "struct sockaddr_in *so" .Ft "token_t *" +.Fn au_to_socket_ex "u_short so_domain" "u_short so_type" "struct sockaddr *sa_local" "struct sockaddr *sa_remote" +.Ft "token_t *" .Fo au_to_subject32 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid" .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid" Modified: user/thompsa/usb/contrib/openbsm/libbsm/bsm_audit.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/libbsm/bsm_audit.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libbsm/bsm_audit.c Thu Jan 15 19:26:21 2009 (r187303) @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#34 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#35 $ */ #include @@ -219,13 +219,16 @@ au_write(int d, token_t *tok) static int au_assemble(au_record_t *rec, short event) { - token_t *header, *tok, *trailer; - size_t tot_rec_size, hdrsize; - u_char *dptr; +#ifdef HAVE_AUDIT_SYSCALLS struct in6_addr *aptr; - int error; struct auditinfo_addr aia; struct timeval tm; + size_t hdrsize; +#endif /* HAVE_AUDIT_SYSCALLS */ + token_t *header, *tok, *trailer; + size_t tot_rec_size; + u_char *dptr; + int error; #ifdef HAVE_AUDIT_SYSCALLS /* Modified: user/thompsa/usb/contrib/openbsm/libbsm/bsm_errno.c ============================================================================== --- user/thompsa/usb/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 15 18:53:52 2009 (r187302) +++ user/thompsa/usb/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 15 19:26:21 2009 (r187303) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#12 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#16 $ */ #include @@ -45,16 +45,25 @@ * operating system. These routines convert between BSM and local error * number spaces, subject to the above realities. BSM error numbers are * stored in a single 8-bit character, so don't have a byte order. + * + * Don't include string definitions when this code is compiled into a kernel. */ - -struct bsm_errors { - int be_bsm_error; - int be_os_error; +struct bsm_errno { + int be_bsm_errno; + int be_local_errno; +#if !defined(KERNEL) && !defined(_KERNEL) const char *be_strerror; +#endif }; #define ERRNO_NO_LOCAL_MAPPING -600 +#if !defined(KERNEL) && !defined(_KERNEL) +#define ES(x) x +#else +#define ES(x) +#endif + /* * Mapping table -- please maintain in numeric sorted order with respect to * the BSM constant. Today we do a linear lookup, but could switch to a @@ -70,523 +79,551 @@ struct bsm_errors { * support catalogues; these are only used if the OS doesn't have an error * string using strerror(3). */ -static const struct bsm_errors bsm_errors[] = { - { BSM_ESUCCESS, 0, "Success" }, - { BSM_EPERM, EPERM, "Operation not permitted" }, - { BSM_ENOENT, ENOENT, "No such file or directory" }, - { BSM_ESRCH, ESRCH, "No such process" }, - { BSM_EINTR, EINTR, "Interrupted system call" }, - { BSM_EIO, EIO, "Input/output error" }, - { BSM_ENXIO, ENXIO, "Device not configured" }, - { BSM_E2BIG, E2BIG, "Argument list too long" }, - { BSM_ENOEXEC, ENOEXEC, "Exec format error" }, - { BSM_EBADF, EBADF, "BAd file descriptor" }, - { BSM_ECHILD, ECHILD, "No child processes" }, - { BSM_EAGAIN, EAGAIN, "Resource temporarily unavailable" }, - { BSM_ENOMEM, ENOMEM, "Cannot allocate memory" }, - { BSM_EACCES, EACCES, "Permission denied" }, - { BSM_EFAULT, EFAULT, "Bad address" }, - { BSM_ENOTBLK, ENOTBLK, "Block device required" }, - { BSM_EBUSY, EBUSY, "Device busy" }, - { BSM_EEXIST, EEXIST, "File exists" }, - { BSM_EXDEV, EXDEV, "Cross-device link" }, - { BSM_ENODEV, ENODEV, "Operation not supported by device" }, - { BSM_ENOTDIR, ENOTDIR, "Not a directory" }, - { BSM_EISDIR, EISDIR, "Is a directory" }, - { BSM_EINVAL, EINVAL, "Invalid argument" }, - { BSM_ENFILE, ENFILE, "Too many open files in system" }, - { BSM_EMFILE, EMFILE, "Too many open files" }, - { BSM_ENOTTY, ENOTTY, "Inappropriate ioctl for device" }, - { BSM_ETXTBSY, ETXTBSY, "Text file busy" }, - { BSM_EFBIG, EFBIG, "File too large" }, - { BSM_ENOSPC, ENOSPC, "No space left on device" }, - { BSM_ESPIPE, ESPIPE, "Illegal seek" }, - { BSM_EROFS, EROFS, "Read-only file system" }, - { BSM_EMLINK, EMLINK, "Too many links" }, - { BSM_EPIPE, EPIPE, "Broken pipe" }, - { BSM_EDOM, EDOM, "Numerical argument out of domain" }, - { BSM_ERANGE, ERANGE, "Result too large" }, - { BSM_ENOMSG, ENOMSG, "No message of desired type" }, - { BSM_EIDRM, EIDRM, "Identifier removed" }, - { BSM_ECHRNG, +static const struct bsm_errno bsm_errnos[] = { + { BSM_ERRNO_ESUCCESS, 0, ES("Success") }, + { BSM_ERRNO_EPERM, EPERM, ES("Operation not permitted") }, + { BSM_ERRNO_ENOENT, ENOENT, ES("No such file or directory") }, + { BSM_ERRNO_ESRCH, ESRCH, ES("No such process") }, + { BSM_ERRNO_EINTR, EINTR, ES("Interrupted system call") }, + { BSM_ERRNO_EIO, EIO, ES("Input/output error") }, + { BSM_ERRNO_ENXIO, ENXIO, ES("Device not configured") }, + { BSM_ERRNO_E2BIG, E2BIG, ES("Argument list too long") }, + { BSM_ERRNO_ENOEXEC, ENOEXEC, ES("Exec format error") }, + { BSM_ERRNO_EBADF, EBADF, ES("Bad file descriptor") }, + { BSM_ERRNO_ECHILD, ECHILD, ES("No child processes") }, + { BSM_ERRNO_EAGAIN, EAGAIN, ES("Resource temporarily unavailable") }, + { BSM_ERRNO_ENOMEM, ENOMEM, ES("Cannot allocate memory") }, + { BSM_ERRNO_EACCES, EACCES, ES("Permission denied") }, + { BSM_ERRNO_EFAULT, EFAULT, ES("Bad address") }, + { BSM_ERRNO_ENOTBLK, ENOTBLK, ES("Block device required") }, + { BSM_ERRNO_EBUSY, EBUSY, ES("Device busy") }, + { BSM_ERRNO_EEXIST, EEXIST, ES("File exists") }, + { BSM_ERRNO_EXDEV, EXDEV, ES("Cross-device link") }, + { BSM_ERRNO_ENODEV, ENODEV, ES("Operation not supported by device") }, + { BSM_ERRNO_ENOTDIR, ENOTDIR, ES("Not a directory") }, + { BSM_ERRNO_EISDIR, EISDIR, ES("Is a directory") }, + { BSM_ERRNO_EINVAL, EINVAL, ES("Invalid argument") }, + { BSM_ERRNO_ENFILE, ENFILE, ES("Too many open files in system") }, + { BSM_ERRNO_EMFILE, EMFILE, ES("Too many open files") }, + { BSM_ERRNO_ENOTTY, ENOTTY, ES("Inappropriate ioctl for device") }, + { BSM_ERRNO_ETXTBSY, ETXTBSY, ES("Text file busy") }, + { BSM_ERRNO_EFBIG, EFBIG, ES("File too large") }, + { BSM_ERRNO_ENOSPC, ENOSPC, ES("No space left on device") }, + { BSM_ERRNO_ESPIPE, ESPIPE, ES("Illegal seek") }, + { BSM_ERRNO_EROFS, EROFS, ES("Read-only file system") }, + { BSM_ERRNO_EMLINK, EMLINK, ES("Too many links") }, + { BSM_ERRNO_EPIPE, EPIPE, ES("Broken pipe") }, + { BSM_ERRNO_EDOM, EDOM, ES("Numerical argument out of domain") }, + { BSM_ERRNO_ERANGE, ERANGE, ES("Result too large") }, + { BSM_ERRNO_ENOMSG, ENOMSG, ES("No message of desired type") }, + { BSM_ERRNO_EIDRM, EIDRM, ES("Identifier removed") }, + { BSM_ERRNO_ECHRNG, #ifdef ECHRNG ECHRNG, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Channel number out of range" }, - { BSM_EL2NSYNC, + ES("Channel number out of range") }, + { BSM_ERRNO_EL2NSYNC, #ifdef EL2NSYNC EL2NSYNC, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Level 2 not synchronized" }, - { BSM_EL3HLT, + ES("Level 2 not synchronized") }, + { BSM_ERRNO_EL3HLT, #ifdef EL3HLT EL3HLT, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Level 3 halted" }, - { BSM_EL3RST, + ES("Level 3 halted") }, + { BSM_ERRNO_EL3RST, #ifdef EL3RST EL3RST, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Level 3 reset" }, - { BSM_ELNRNG, + ES("Level 3 reset") }, + { BSM_ERRNO_ELNRNG, #ifdef ELNRNG ELNRNG, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Link number out of range" }, - { BSM_EUNATCH, + ES("Link number out of range") }, + { BSM_ERRNO_EUNATCH, #ifdef EUNATCH EUNATCH, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Protocol driver not attached" }, - { BSM_ENOCSI, + ES("Protocol driver not attached") }, + { BSM_ERRNO_ENOCSI, #ifdef ENOCSI ENOCSI, #else ERRNO_NO_LOCAL_MAPPING, #endif - "No CSI structure available" }, - { BSM_EL2HLT, + ES("No CSI structure available") }, + { BSM_ERRNO_EL2HLT, #ifdef EL2HLT EL2HLT, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Level 2 halted" }, - { BSM_EDEADLK, EDEADLK, "Resource deadlock avoided" }, - { BSM_ENOLCK, ENOLCK, "No locks available" }, - { BSM_ECANCELED, ECANCELED, "Operation canceled" }, - { BSM_ENOTSUP, ENOTSUP, "Operation not supported" }, - { BSM_EDQUOT, EDQUOT, "Disc quota exceeded" }, - { BSM_EBADE, + ES("Level 2 halted") }, + { BSM_ERRNO_EDEADLK, EDEADLK, ES("Resource deadlock avoided") }, + { BSM_ERRNO_ENOLCK, ENOLCK, ES("No locks available") }, + { BSM_ERRNO_ECANCELED, ECANCELED, ES("Operation canceled") }, + { BSM_ERRNO_ENOTSUP, ENOTSUP, ES("Operation not supported") }, + { BSM_ERRNO_EDQUOT, EDQUOT, ES("Disc quota exceeded") }, + { BSM_ERRNO_EBADE, #ifdef EBADE EBADE, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Invalid exchange" }, - { BSM_EBADR, + ES("Invalid exchange") }, + { BSM_ERRNO_EBADR, #ifdef EBADR EBADR, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Invalid request descriptor" }, - { BSM_EXFULL, + ES("Invalid request descriptor") }, + { BSM_ERRNO_EXFULL, #ifdef EXFULL EXFULL, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Exchange full" }, - { BSM_ENOANO, + ES("Exchange full") }, + { BSM_ERRNO_ENOANO, #ifdef ENOANO ENOANO, #else ERRNO_NO_LOCAL_MAPPING, #endif - "No anode" }, - { BSM_EBADRQC, + ES("No anode") }, + { BSM_ERRNO_EBADRQC, #ifdef EBADRQC EBADRQC, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Invalid request descriptor" }, - { BSM_EBADSLT, + ES("Invalid request descriptor") }, + { BSM_ERRNO_EBADSLT, #ifdef EBADSLT EBADSLT, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Invalid slot" }, - { BSM_EDEADLOCK, + ES("Invalid slot") }, + { BSM_ERRNO_EDEADLOCK, #ifdef EDEADLOCK EDEADLOCK, #else ERRNO_NO_LOCAL_MAPPING, #endif - "Resource deadlock avoided" }, - { BSM_EBFONT, + ES("Resource deadlock avoided") }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Jan 15 19:42:17 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E97FD1065690; Thu, 15 Jan 2009 19:42:17 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.225]) by mx1.freebsd.org (Postfix) with ESMTP id A80CC8FC1C; Thu, 15 Jan 2009 19:42:17 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1263314rvf.43 for ; Thu, 15 Jan 2009 11:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=lJG1+gSrDeGlR881J4YRECdP0G4a+XZyJEJDkjArIwE=; b=rnEPed/QZ77Voo3+D/KvMoCjC7Pno3jvbsetmvpDMsY5BlvlM3nwN4XD16tygceXh3 +dNiXSGTUgq7SyqXLOo3MFKO2yYjW0MmZfgpPwaBDoEiZ6IqWWT5xEjCLgpMorfoGWwj hwMa/iP/zoqR6h6OpgWp6VhGJgCoBsmU2NzEk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=w7fXf/TTv5zm4cmMSt7/C4A/SLt3h3d8ahTpB/Zc5DT1mPGG8/1531sBwQVgrn6quD FGtJ1z8v0fe+lyJLdm5FfT9sIy4uKNMfuFaNqALBRgJ+kxXqEs8lQLJYfYjMJ8cEXQXX r5uh1rvM3aqofPpYdfLyfFQCcJ1oVWki659i8= Received: by 10.140.208.17 with SMTP id f17mr771562rvg.261.1232048537364; Thu, 15 Jan 2009 11:42:17 -0800 (PST) Received: from ?192.168.1.146? (c-67-161-11-34.hsd1.ca.comcast.net [67.161.11.34]) by mx.google.com with ESMTPS id l31sm635566rvb.2.2009.01.15.11.42.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Jan 2009 11:42:16 -0800 (PST) References: <200812312321.mBVNL75E037897@svn.freebsd.org> <200901150959.53050.jhb@freebsd.org> Message-Id: From: Kip Macy To: John Baldwin In-Reply-To: <200901150959.53050.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5G77) Mime-Version: 1.0 (iPhone Mail 5G77) Date: Thu, 15 Jan 2009 11:42:13 -0800 Cc: "src-committers@freebsd.org" , Kip Macy , "svn-src-user@freebsd.org" Subject: Re: svn commit: r186661 - user/kmacy/HEAD_fast_net/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 19:42:18 -0000 That would require changing all callers - ultimately a better solution, but more than I wanted to do at the time. On Jan 15, 2009, at 6:59, John Baldwin wrote: > On Wednesday 31 December 2008 6:21:07 pm Kip Macy wrote: >> Author: kmacy >> Date: Wed Dec 31 23:21:07 2008 >> New Revision: 186661 >> URL: http://svn.freebsd.org/changeset/base/186661 >> >> Log: >> make it possible to profile normal mutex acquisition by not calling >> knlist_mtx_lock > > Alternatively, you could pass LOCK_FILE and LOCK_LINE (sys/lock.h) > to kl_lock, > etc. and have knlist_mtx_lock use the private version that takes > file and > line. > > This would also make it work for all lock types. > > -- > John Baldwin From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 05:20:38 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F5A31065670; Fri, 16 Jan 2009 05:20:38 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.229]) by mx1.freebsd.org (Postfix) with ESMTP id 212DD8FC12; Fri, 16 Jan 2009 05:20:38 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by rv-out-0506.google.com with SMTP id f9so140729rvb.5 for ; Thu, 15 Jan 2009 21:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=XMFux3ruBEhQ+ZZ/M9xjPk3MYr3tfePkj60BQlitFbg=; b=bFao2Ptgk9LRGp1QA/PkPMxdvp1ibVz1dncyLNMTxm7bZN1eAo5VsMK48DnlLO1mCS NqAOmRBUecp4a5QW5SdvSUDvRy16TqfAduoNggS9WiVwBR/Pmgd/wiQ7hQiNqJNquHiO SCB6CLS0AJAOgbGjqDhFhBXbscPe47Uupbt4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=drmjET8LlEFbccLT/RLSFLh4yMcvQ55aIQYRHmVtzIOk7EDesb0lhbyAGhQyO7tUEQ tG9SNIgfn8RB+dbw7xIeDSg1wXowNzP2RedlDygsnzhKB+BehG3mLuzPyDlmUrgt+Dhy 8+1FJx6mJ4xXPRjLAiHsgefHH3cuOrXpxB3XY= Received: by 10.141.84.17 with SMTP id m17mr1009312rvl.252.1232083237692; Thu, 15 Jan 2009 21:20:37 -0800 (PST) Received: by 10.141.180.7 with HTTP; Thu, 15 Jan 2009 21:20:37 -0800 (PST) Message-ID: <3c1674c90901152120o6c1be5dal785c76eae536b757@mail.gmail.com> Date: Thu, 15 Jan 2009 21:20:37 -0800 From: "Kip Macy" Sender: mat.macy@gmail.com To: "John Baldwin" In-Reply-To: <200901151003.27545.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200901030200.n0320Arr013245@svn.freebsd.org> <200901151003.27545.jhb@freebsd.org> X-Google-Sender-Auth: 82c58b37e46f31e1 Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r186710 - user/kmacy/HEAD_fast_net/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 05:20:38 -0000 404 On Thu, Jan 15, 2009 at 7:03 AM, John Baldwin wrote: > On Friday 02 January 2009 9:00:10 pm Kip Macy wrote: >> Author: kmacy >> Date: Sat Jan 3 02:00:10 2009 >> New Revision: 186710 >> URL: http://svn.freebsd.org/changeset/base/186710 >> >> Log: >> convert name cache lock to rwlock for lookups > > I think you need to restart the lookup if you fail an upgrade. I've had a > patch to do that for years (literally) but it didn't help performance in > earlier tests by kris@. You can find one that does the restarts at > www.freebsd.org/~jhb/namei_rwlock.patch. > > -- > John Baldwin > From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 05:32:57 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04E2A10657A9; Fri, 16 Jan 2009 05:32:57 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCDB98FC22; Fri, 16 Jan 2009 05:32:56 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0G5WuqU097312; Fri, 16 Jan 2009 05:32:56 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0G5WuDk097311; Fri, 16 Jan 2009 05:32:56 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200901160532.n0G5WuDk097311@svn.freebsd.org> From: Kip Macy Date: Fri, 16 Jan 2009 05:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187324 - user/kmacy/HEAD_fast_net/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 05:32:58 -0000 Author: kmacy Date: Fri Jan 16 05:32:56 2009 New Revision: 187324 URL: http://svn.freebsd.org/changeset/base/187324 Log: retry lookup on lock upgrade failure Suggested by: jhb Modified: user/kmacy/HEAD_fast_net/sys/kern/vfs_cache.c Modified: user/kmacy/HEAD_fast_net/sys/kern/vfs_cache.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/kern/vfs_cache.c Thu Jan 15 23:40:02 2009 (r187323) +++ user/kmacy/HEAD_fast_net/sys/kern/vfs_cache.c Fri Jan 16 05:32:56 2009 (r187324) @@ -117,10 +117,10 @@ RW_SYSINIT(vfscache, &cache_lock, "Name #define CACHE_RUNLOCK() rw_runlock(&cache_lock) #define CACHE_WLOCK() rw_wlock(&cache_lock) #define CACHE_WUNLOCK() rw_wunlock(&cache_lock) +#define CACHE_UNLOCK() rw_unlock(&cache_lock) #define CACHE_TRY_UPGRADE() rw_try_upgrade(&cache_lock) #define CACHE_LOCK() CACHE_WLOCK() -#define CACHE_UNLOCK() CACHE_WUNLOCK() /* * UMA zones for the VFS cache. @@ -330,7 +330,8 @@ cache_lookup(dvp, vpp, cnp) struct namecache *ncp; u_int32_t hash; int error, ltype; - + int wlocked = 0; + if (!doingcache) { cnp->cn_flags &= ~MAKEENTRY; return (0); @@ -339,6 +340,7 @@ retry: CACHE_RLOCK(); numcalls++; +retry2: if (cnp->cn_nameptr[0] == '.') { if (cnp->cn_namelen == 1) { *vpp = dvp; @@ -351,7 +353,7 @@ retry: dotdothits++; if (dvp->v_dd == NULL || (cnp->cn_flags & MAKEENTRY) == 0) { - CACHE_RUNLOCK(); + CACHE_UNLOCK(); return (0); } *vpp = dvp->v_dd; @@ -378,15 +380,17 @@ retry: nummiss++; } nchstats.ncs_miss++; - CACHE_RUNLOCK(); + CACHE_UNLOCK(); return (0); } /* We don't want to have an entry, so dump it */ if ((cnp->cn_flags & MAKEENTRY) == 0) { - if (CACHE_TRY_UPGRADE() == 0) { + if (wlocked == 0 && CACHE_TRY_UPGRADE() == 0) { CACHE_RUNLOCK(); CACHE_WLOCK(); + wlocked = 1; + goto retry2; } numposzaps++; nchstats.ncs_badhits++; @@ -405,9 +409,11 @@ retry: goto success; } - if (CACHE_TRY_UPGRADE() == 0) { + if (wlocked == 0 && CACHE_TRY_UPGRADE() == 0) { CACHE_RUNLOCK(); CACHE_WLOCK(); + wlocked = 1; + goto retry2; } /* We found a negative match, and want to create it, so purge */ if (cnp->cn_nameiop == CREATE) { @@ -440,7 +446,7 @@ success: */ if (dvp == *vpp) { /* lookup on "." */ VREF(*vpp); - CACHE_RUNLOCK(); + CACHE_UNLOCK(); /* * When we lookup "." we still can be asked to lock it * differently... @@ -466,7 +472,7 @@ success: VOP_UNLOCK(dvp, 0); } VI_LOCK(*vpp); - CACHE_RUNLOCK(); + CACHE_UNLOCK(); error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, ltype | LK_RETRY); From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 15:28:22 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3841065763; Fri, 16 Jan 2009 15:28:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5818FC1C; Fri, 16 Jan 2009 15:28:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 0CCC546BB2; Fri, 16 Jan 2009 10:28:22 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0GFS4KJ011368; Fri, 16 Jan 2009 10:28:16 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Kip Macy" Date: Fri, 16 Jan 2009 09:28:52 -0500 User-Agent: KMail/1.9.7 References: <200901030200.n0320Arr013245@svn.freebsd.org> <200901151003.27545.jhb@freebsd.org> <3c1674c90901152120o6c1be5dal785c76eae536b757@mail.gmail.com> In-Reply-To: <3c1674c90901152120o6c1be5dal785c76eae536b757@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901160928.52636.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 16 Jan 2009 10:28:16 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8871/Thu Jan 15 23:16:59 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r186710 - user/kmacy/HEAD_fast_net/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 15:28:23 -0000 On Friday 16 January 2009 12:20:37 am Kip Macy wrote: > 404 > > On Thu, Jan 15, 2009 at 7:03 AM, John Baldwin wrote: > > On Friday 02 January 2009 9:00:10 pm Kip Macy wrote: > >> Author: kmacy > >> Date: Sat Jan 3 02:00:10 2009 > >> New Revision: 186710 > >> URL: http://svn.freebsd.org/changeset/base/186710 > >> > >> Log: > >> convert name cache lock to rwlock for lookups > > > > I think you need to restart the lookup if you fail an upgrade. I've had a > > patch to do that for years (literally) but it didn't help performance in > > earlier tests by kris@. You can find one that does the restarts at > > www.freebsd.org/~jhb/namei_rwlock.patch. Sorry, add patches/ like so: www.freebsd.org/~jhb/namei_rwlock.patch You can always find the latest version of it in //depot/user/jhb/lock/kern/vfs_cache.c -- John Baldwin From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 18:49:20 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B9E0106564A; Fri, 16 Jan 2009 18:49:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6CD8FC0A; Fri, 16 Jan 2009 18:49:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GInKgf015582; Fri, 16 Jan 2009 18:49:20 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GInKRG015578; Fri, 16 Jan 2009 18:49:20 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901161849.n0GInKRG015578@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 18:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187335 - in user/sam/wifi/sys/dev/ath: . ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 18:49:20 -0000 Author: sam Date: Fri Jan 16 18:49:19 2009 New Revision: 187335 URL: http://svn.freebsd.org/changeset/base/187335 Log: ath_hal_getwirelessmodes should not involve regulatory; adjust the api to return what the hardware is capable of Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.c user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c user/sam/wifi/sys/dev/ath/if_ath.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.c Fri Jan 16 18:09:49 2009 (r187334) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.c Fri Jan 16 18:49:19 2009 (r187335) @@ -78,6 +78,15 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC return AH_NULL; } +/* + * Return the mask of available modes based on the hardware capabilities. + */ +u_int +ath_hal_getwirelessmodes(struct ath_hal*ah) +{ + return ath_hal_getWirelessModes(ah); +} + /* linker set of registered RF backends */ OS_SET_DECLARE(ah_rfs, struct ath_hal_rf); Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Fri Jan 16 18:09:49 2009 (r187334) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Fri Jan 16 18:49:19 2009 (r187335) @@ -873,7 +873,7 @@ extern void __ahdecl ath_hal_process_noi /* * Return bit mask of wireless modes supported by the hardware. */ -extern u_int __ahdecl ath_hal_getwirelessmodes(struct ath_hal*, HAL_CTRY_CODE); +extern u_int __ahdecl ath_hal_getwirelessmodes(struct ath_hal*); /* * Calculate the transmit duration of a frame. Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 18:09:49 2009 (r187334) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 18:49:19 2009 (r187335) @@ -2126,26 +2126,6 @@ ath_hal_getwmodesnreg(struct ath_hal *ah } /* - * Return the mask of available modes based on the hardware - * capabilities and the specified country code. - */ - -u_int -ath_hal_getwirelessmodes(struct ath_hal *ah, HAL_CTRY_CODE cc) -{ - COUNTRY_CODE_TO_ENUM_RD *country = AH_NULL; - u_int mode = 0; - REG_DOMAIN rd; - - country = findCountry(cc); - if (country != AH_NULL) { - if (getWmRD(ah, country, ~CHANNEL_2GHZ, &rd)) - mode = ath_hal_getwmodesnreg(ah, country, &rd); - } - return mode; -} - -/* * Return if device is actually operating in 900 MHz band. */ HAL_BOOL Modified: user/sam/wifi/sys/dev/ath/if_ath.c ============================================================================== --- user/sam/wifi/sys/dev/ath/if_ath.c Fri Jan 16 18:09:49 2009 (r187334) +++ user/sam/wifi/sys/dev/ath/if_ath.c Fri Jan 16 18:49:19 2009 (r187335) @@ -661,7 +661,7 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hastsfadd = ath_hal_hastsfadjust(ah); if (ath_hal_hasfastframes(ah)) ic->ic_caps |= IEEE80211_C_FF; - wmodes = ath_hal_getwirelessmodes(ah, ic->ic_regdomain.country); + wmodes = ath_hal_getwirelessmodes(ah); if (wmodes & (HAL_MODE_108G|HAL_MODE_TURBO)) ic->ic_caps |= IEEE80211_C_TURBOP; #ifdef ATH_SUPPORT_TDMA @@ -7463,7 +7463,7 @@ ath_announce(struct ath_softc *sc) #define HAL_MODE_DUALBAND (HAL_MODE_11A|HAL_MODE_11B) struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; - u_int modes, cc; + u_int modes; if_printf(ifp, "mac %d.%d phy %d.%d", ah->ah_macVersion, ah->ah_macRev, @@ -7473,8 +7473,7 @@ ath_announce(struct ath_softc *sc) * to avoid falsely printing revs for inoperable parts. * Dual-band radio revs are returned in the 5Ghz rev number. */ - ath_hal_getcountrycode(ah, &cc); - modes = ath_hal_getwirelessmodes(ah, cc); + modes = ath_hal_getwirelessmodes(ah); if ((modes & HAL_MODE_DUALBAND) == HAL_MODE_DUALBAND) { if (ah->ah_analog5GhzRev && ah->ah_analog2GhzRev) printf(" 5ghz radio %d.%d 2ghz radio %d.%d", From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 18:57:31 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E3541065673; Fri, 16 Jan 2009 18:57:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BEB08FC14; Fri, 16 Jan 2009 18:57:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GIvU4q015783; Fri, 16 Jan 2009 18:57:30 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GIvU9M015781; Fri, 16 Jan 2009 18:57:30 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901161857.n0GIvU9M015781@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 18:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187336 - user/sam/wifi/sys/dev/ath/ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 18:57:31 -0000 Author: sam Date: Fri Jan 16 18:57:30 2009 New Revision: 187336 URL: http://svn.freebsd.org/changeset/base/187336 Log: Untangle regulatory code some more: o remove the per-channel CTL setting, this is a per-band value that is constant for all channels in a band; instead record the regdomain state required to find any CTL when crafting a initial channel list o rewrite the regdomain code identification logic so we can record the necessary internal state to find the CTL setting in ath_hal_getctl While here also: o remove AH_SUPPORT_11D ifdefs; we always support 11d o remove pointless check for NO_HOSTAP; ath_hal_init_channels was never called with opmode set appropriately so this was a noop; this check is also done already by net80211 o remove return of regulatory class id's; this isn't used and doesn't belong here; it's part of the regulatory work net80211 is responsible for Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Fri Jan 16 18:49:19 2009 (r187335) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_internal.h Fri Jan 16 18:57:30 2009 (r187336) @@ -126,8 +126,7 @@ typedef struct { int8_t antennaMax; int16_t rawNoiseFloor; int16_t noiseFloorAdjust; - uint16_t mainSpur; /* cached spur value for this cahnnel */ - uint32_t conformanceTestLimit; /* conformance test limit from reg domain */ + uint16_t mainSpur; /* cached spur value for this channel */ } HAL_CHANNEL_INTERNAL; typedef struct { @@ -185,6 +184,9 @@ typedef struct { uint8_t halNumAntCfg5GHz; } HAL_CAPABILITIES; +struct regDomainPair; +struct regDomain; + /* * The ``private area'' follows immediately after the ``public area'' * in the data structure returned by ath_hal_attach. Private data are @@ -268,6 +270,9 @@ struct ath_hal_private { HAL_CHANNEL_INTERNAL ah_channels[256]; /* calculated channel list */ u_int ah_nchan; /* valid channels in list */ HAL_CHANNEL_INTERNAL *ah_curchan; /* current channel */ + const struct regDomainPair *ah_regpair; /* reg state */ + const struct regDomain *ah_reg2G; /* reg state for 2G band */ + const struct regDomain *ah_reg5G; /* reg state for 5G band */ uint8_t ah_coverageClass; /* coverage class */ HAL_BOOL ah_regdomainUpdate; /* regdomain is updated? */ Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 18:49:19 2009 (r187335) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 18:57:30 2009 (r187336) @@ -466,7 +466,7 @@ enum { * THE following table is the mapping of regdomain pairs specified by * an 8 bit regdomain value to the individual unitary reg domains */ -typedef struct { +typedef struct regDomainPair { HAL_REG_DOMAIN regDmnEnum; /* 16 bit reg domain pair */ HAL_REG_DOMAIN regDmn5GHz; /* 5GHz reg domain */ HAL_REG_DOMAIN regDmn2GHz; /* 2GHz reg domain */ @@ -1941,7 +1941,6 @@ chansort(const void *a, const void *b) typedef int ath_hal_cmp_t(const void *, const void *); static void ath_hal_sort(void *a, size_t n, size_t es, ath_hal_cmp_t *cmp); static COUNTRY_CODE_TO_ENUM_RD* findCountry(HAL_CTRY_CODE countryCode); -static HAL_BOOL getWmRD(struct ath_hal *ah, COUNTRY_CODE_TO_ENUM_RD *country, uint16_t channelFlag, REG_DOMAIN *rd); static uint16_t @@ -2167,136 +2166,56 @@ findCountry(HAL_CTRY_CODE countryCode) return AH_NULL; /* Not found */ } -/* - * Calculate a default country based on the EEPROM setting. - */ -static HAL_CTRY_CODE -getDefaultCountry(struct ath_hal *ah) -{ - uint16_t rd; - int i; - - rd = getEepromRD(ah); - if (rd & COUNTRY_ERD_FLAG) { - COUNTRY_CODE_TO_ENUM_RD *country = AH_NULL; - uint16_t cc = rd & ~COUNTRY_ERD_FLAG; - - country = findCountry(cc); - if (country != AH_NULL) - return cc; - } - /* - * Check reg domains that have only one country - */ - for (i = 0; i < N(regDomainPairs); i++) - if (regDomainPairs[i].regDmnEnum == rd) { - if (regDomainPairs[i].singleCC != 0) - return regDomainPairs[i].singleCC; - else - i = N(regDomainPairs); - } - return CTRY_DEFAULT; -} - -static HAL_BOOL -isValidRegDmn(int regDmn, REG_DOMAIN *rd) +static REG_DOMAIN * +findRegDmn(int regDmn) { int i; for (i = 0; i < N(regDomains); i++) { - if (regDomains[i].regDmnEnum == regDmn) { - if (rd != AH_NULL) { - OS_MEMCPY(rd, ®Domains[i], - sizeof(REG_DOMAIN)); - } - return AH_TRUE; - } + if (regDomains[i].regDmnEnum == regDmn) + return ®Domains[i]; } - return AH_FALSE; + return AH_NULL; } -static HAL_BOOL -isValidRegDmnPair(int regDmnPair) +static REG_DMN_PAIR_MAPPING * +findRegDmnPair(int regDmnPair) { int i; - if (regDmnPair == NO_ENUMRD) - return AH_FALSE; - for (i = 0; i < N(regDomainPairs); i++) { - if (regDomainPairs[i].regDmnEnum == regDmnPair) - return AH_TRUE; + if (regDmnPair != NO_ENUMRD) { + for (i = 0; i < N(regDomainPairs); i++) { + if (regDomainPairs[i].regDmnEnum == regDmnPair) + return ®DomainPairs[i]; + } } - return AH_FALSE; + return AH_NULL; } /* - * Return the Wireless Mode Regulatory Domain based - * on the country code and the wireless mode. + * Calculate a default country based on the EEPROM setting. */ -static HAL_BOOL -getWmRD(struct ath_hal *ah, COUNTRY_CODE_TO_ENUM_RD *country, - uint16_t channelFlag, REG_DOMAIN *rd) +static HAL_CTRY_CODE +getDefaultCountry(struct ath_hal *ah) { - int regDmn; - REG_DMN_PAIR_MAPPING *regPair; - uint64_t flags; - - if (country->countryCode == CTRY_DEFAULT) { - uint16_t rdnum = getEepromRD(ah); - - if ((rdnum & COUNTRY_ERD_FLAG) == 0) { - if (isValidRegDmn(rdnum, AH_NULL) || - isValidRegDmnPair(rdnum)) - regDmn = rdnum; - else - regDmn = country->regDmnEnum; - } else - regDmn = country->regDmnEnum; - } else - regDmn = country->regDmnEnum; - regPair = AH_NULL; - flags = NO_REQ; - if ((regDmn & MULTI_DOMAIN_MASK) == 0) { - int i; + REG_DMN_PAIR_MAPPING *regpair; + uint16_t rd; - for (i = 0; i < N(regDomainPairs); i++) { - if (regDomainPairs[i].regDmnEnum == regDmn) { - regPair = ®DomainPairs[i]; - break; - } - } - if (regPair == AH_NULL) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: Failed to find reg domain pair %u\n", - __func__, regDmn); - return AH_FALSE; - } - if (channelFlag & CHANNEL_2GHZ) { - regDmn = regPair->regDmn2GHz; - flags = regPair->flags2GHz; - } else { - regDmn = regPair->regDmn5GHz; - flags = regPair->flags5GHz; - } + rd = getEepromRD(ah); + if (rd & COUNTRY_ERD_FLAG) { + COUNTRY_CODE_TO_ENUM_RD *country; + uint16_t cc = rd & ~COUNTRY_ERD_FLAG; + country = findCountry(cc); + if (country != AH_NULL) + return cc; } - /* - * We either started with a unitary reg domain or we've found the - * unitary reg domain of the pair + * Check reg domains that have only one country */ - if (isValidRegDmn(regDmn, rd)) { - if (regPair != AH_NULL) - rd->pscan &= regPair->pscanMask; - if ((country->regDmnEnum & MULTI_DOMAIN_MASK) == 0 && - flags != NO_REQ) - rd->flags = flags; - return AH_TRUE; - } else { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: Failed to find unitary reg domain %u\n", __func__, - country->regDmnEnum); - return AH_FALSE; - } + regpair = findRegDmnPair(rd); + if (regpair != AH_NULL && regpair->singleCC != 0) + return regpair->singleCC; + return CTRY_DEFAULT; } static HAL_BOOL @@ -2310,28 +2229,6 @@ IS_BIT_SET(int bit, const uint64_t bitma val = ((uint64_t) 1) << bitnum; return (bitmask[byteOffset] & val) != 0; } - -/* Add given regclassid into regclassids array upto max of maxregids */ -static void -ath_add_regclassid(uint8_t *regclassids, u_int maxregids, - u_int *nregids, uint8_t regclassid) -{ - int i; - - /* Is regclassid valid? */ - if (regclassid == 0) - return; - - for (i = 0; i < maxregids; i++) { - if (regclassids[i] == regclassid) /* already present */ - return; - if (regclassids[i] == 0) { /* free slot */ - regclassids[i] = regclassid; - (*nregids)++; - return; - } - } -} /* * Setup the channel list based on the information in the EEPROM and @@ -2339,7 +2236,6 @@ ath_add_regclassid(uint8_t *regclassids, * verification here and setup certain regulatory-related access * control data used later on. */ - HAL_BOOL ath_hal_init_channels(struct ath_hal *ah, HAL_CHANNEL *chans, u_int maxchans, u_int *nchans, @@ -2352,11 +2248,11 @@ ath_hal_init_channels(struct ath_hal *ah u_int modesAvail; uint16_t maxChan; COUNTRY_CODE_TO_ENUM_RD *country = AH_NULL; - REG_DOMAIN rd5GHz, rd2GHz; + REG_DMN_PAIR_MAPPING *regpair; + REG_DOMAIN *rd5GHz, *rd2GHz; const struct cmode *cm; HAL_CHANNEL_INTERNAL *ichans = &AH_PRIVATE(ah)->ah_channels[0]; - int next, b; - uint8_t ctl; + int next, b, regDmn; HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: cc %u mode 0x%x%s%s\n", __func__, cc, modeSelect, enableOutdoor? " Enable outdoor" : " ", @@ -2374,50 +2270,76 @@ ath_hal_init_channels(struct ath_hal *ah "%s: invalid EEPROM contents\n",__func__); return AH_FALSE; } - AH_PRIVATE(ah)->ah_countryCode = getDefaultCountry(ah); - -#ifndef AH_SUPPORT_11D - if (AH_PRIVATE(ah)->ah_countryCode == CTRY_DEFAULT) { -#endif - /* - * We now have enough state to validate any country code - * passed in by the caller. - */ - if (!isCountryCodeValid(ah, cc)) { - /* NB: Atheros silently ignores invalid country codes */ - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: invalid country code %d\n", __func__, cc); - return AH_FALSE; - } - AH_PRIVATE(ah)->ah_countryCode = cc & COUNTRY_CODE_MASK; -#ifndef AH_SUPPORT_11D + if (!isCountryCodeValid(ah, cc)) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: invalid country code %d\n", __func__, cc); + return AH_FALSE; } -#endif + AH_PRIVATE(ah)->ah_countryCode = cc & COUNTRY_CODE_MASK; /* Get pointers to the country element and the reg domain elements */ country = findCountry(AH_PRIVATE(ah)->ah_countryCode); - if (country == AH_NULL) { HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "NULL Country!, cc= %d\n", AH_PRIVATE(ah)->ah_countryCode); return AH_FALSE; } - if (!getWmRD(ah, country, ~CHANNEL_2GHZ, &rd5GHz)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: no unitary 5GHz regdomain for country %u\n", - __func__, AH_PRIVATE(ah)->ah_countryCode); - return AH_FALSE; + regDmn = country->regDmnEnum; + if (country->countryCode == CTRY_DEFAULT) { + /* + * Check EEPROM; SKU may be for a country, single + * domain, or multiple domains (WWR). + */ + uint16_t rdnum = getEepromRD(ah); + if ((rdnum & COUNTRY_ERD_FLAG) == 0 && + (findRegDmn(rdnum) != AH_NULL || findRegDmnPair(rdnum) != AH_NULL)) + regDmn = rdnum; } - if (!getWmRD(ah, country, CHANNEL_2GHZ, &rd2GHz)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: no unitary 2GHz regdomain for country %u\n", - __func__, AH_PRIVATE(ah)->ah_countryCode); - return AH_FALSE; + /* + * Setup per-band state. + */ + if ((regDmn & MULTI_DOMAIN_MASK) == 0) { + regpair = findRegDmnPair(regDmn); + if (regpair == AH_NULL) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: no reg domain pair %u for country %u\n", + __func__, regDmn, AH_PRIVATE(ah)->ah_countryCode); + return AH_FALSE; + } + rd5GHz = findRegDmn(regpair->regDmn5GHz); + if (rd5GHz == AH_NULL) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: no 5GHz reg domain %u for country %u\n", + __func__, regpair->regDmn5GHz, + AH_PRIVATE(ah)->ah_countryCode); + return AH_FALSE; + } + rd2GHz = findRegDmn(regpair->regDmn2GHz); + if (rd2GHz == AH_NULL) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: no 2GHz reg domain %u for country %u\n", + __func__, regpair->regDmn2GHz, + AH_PRIVATE(ah)->ah_countryCode); + return AH_FALSE; + } + } else { + regpair = AH_NULL; + rd5GHz = rd2GHz = findRegDmn(regDmn); + if (rd2GHz == AH_NULL) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: no unitary reg domain %u for country %u\n", + __func__, regDmn, AH_PRIVATE(ah)->ah_countryCode); + return AH_FALSE; + } } + /* NB: save for use in ath_hal_getctl */ + AH_PRIVATE(ah)->ah_regpair = regpair; + AH_PRIVATE(ah)->ah_reg2G = rd2GHz; + AH_PRIVATE(ah)->ah_reg5G = rd5GHz; - modesAvail = ath_hal_getwmodesnreg(ah, country, &rd5GHz); + modesAvail = ath_hal_getwmodesnreg(ah, country, rd5GHz); maxChan = !enableOutdoor ? country->outdoorChanStart : 7000; if (maxchans > N(AH_PRIVATE(ah)->ah_channels)) @@ -2426,9 +2348,11 @@ ath_hal_init_channels(struct ath_hal *ah for (cm = modes; cm < &modes[N(modes)]; cm++) { uint16_t c, c_hi, c_lo; uint64_t *channelBM = AH_NULL; - REG_DOMAIN *rd = AH_NULL; REG_DMN_FREQ_BAND *fband = AH_NULL,*freqs; int low_adj, hi_adj, channelSep, lastc; + uint32_t rdflags; + uint64_t dfsMask; + uint64_t pscan; if ((cm->mode & modeSelect) == 0) { HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, @@ -2451,10 +2375,22 @@ ath_hal_init_channels(struct ath_hal *ah } switch (cm->mode) { case HAL_MODE_TURBO: - rd = &rd5GHz; - channelBM = rd->chan11a_turbo; + case HAL_MODE_11A_TURBO: + rdflags = rd5GHz->flags; + dfsMask = rd5GHz->dfsMask; + pscan = rd5GHz->pscan; + if (cm->mode == HAL_MODE_TURBO) + channelBM = rd5GHz->chan11a_turbo; + else + channelBM = rd5GHz->chan11a_dyn_turbo; freqs = ®Dmn5GhzTurboFreq[0]; - ctl = rd->conformanceTestLimit | CTL_TURBO; + break; + case HAL_MODE_11G_TURBO: + rdflags = rd2GHz->flags; + dfsMask = rd2GHz->dfsMask; + pscan = rd2GHz->pscan; + channelBM = rd2GHz->chan11g_turbo; + freqs = ®Dmn2Ghz11gTurboFreq[0]; break; case HAL_MODE_11A: case HAL_MODE_11A_HALF_RATE: @@ -2462,49 +2398,39 @@ ath_hal_init_channels(struct ath_hal *ah case HAL_MODE_11NA_HT20: case HAL_MODE_11NA_HT40PLUS: case HAL_MODE_11NA_HT40MINUS: - rd = &rd5GHz; + rdflags = rd5GHz->flags; + dfsMask = rd5GHz->dfsMask; + pscan = rd5GHz->pscan; if (cm->mode == HAL_MODE_11A_HALF_RATE) - channelBM = rd->chan11a_half; + channelBM = rd5GHz->chan11a_half; else if (cm->mode == HAL_MODE_11A_QUARTER_RATE) - channelBM = rd->chan11a_quarter; + channelBM = rd5GHz->chan11a_quarter; else - channelBM = rd->chan11a; + channelBM = rd5GHz->chan11a; freqs = ®Dmn5GhzFreq[0]; - ctl = rd->conformanceTestLimit; break; case HAL_MODE_11B: - rd = &rd2GHz; - channelBM = rd->chan11b; - freqs = ®Dmn2GhzFreq[0]; - ctl = rd->conformanceTestLimit | CTL_11B; - break; case HAL_MODE_11G: case HAL_MODE_11G_HALF_RATE: case HAL_MODE_11G_QUARTER_RATE: case HAL_MODE_11NG_HT20: case HAL_MODE_11NG_HT40PLUS: case HAL_MODE_11NG_HT40MINUS: - rd = &rd2GHz; + rdflags = rd2GHz->flags; + dfsMask = rd2GHz->dfsMask; + pscan = rd2GHz->pscan; if (cm->mode == HAL_MODE_11G_HALF_RATE) - channelBM = rd->chan11g_half; + channelBM = rd2GHz->chan11g_half; else if (cm->mode == HAL_MODE_11G_QUARTER_RATE) - channelBM = rd->chan11g_quarter; + channelBM = rd2GHz->chan11g_quarter; + else if (cm->mode == HAL_MODE_11B) + channelBM = rd2GHz->chan11b; else - channelBM = rd->chan11g; - freqs = ®Dmn2Ghz11gFreq[0]; - ctl = rd->conformanceTestLimit | CTL_11G; - break; - case HAL_MODE_11G_TURBO: - rd = &rd2GHz; - channelBM = rd->chan11g_turbo; - freqs = ®Dmn2Ghz11gTurboFreq[0]; - ctl = rd->conformanceTestLimit | CTL_108G; - break; - case HAL_MODE_11A_TURBO: - rd = &rd5GHz; - channelBM = rd->chan11a_dyn_turbo; - freqs = ®Dmn5GhzTurboFreq[0]; - ctl = rd->conformanceTestLimit | CTL_108G; + channelBM = rd2GHz->chan11g; + if (cm->mode == HAL_MODE_11B) + freqs = ®Dmn2GhzFreq[0]; + else + freqs = ®Dmn2Ghz11gFreq[0]; break; default: HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, @@ -2530,9 +2456,6 @@ ath_hal_init_channels(struct ath_hal *ah fband = &freqs[b]; lastc = 0; - ath_add_regclassid(regclassids, maxregids, - nregids, fband->regClassId); - for (c = fband->lowChannel + low_adj; c <= fband->highChannel + hi_adj; c += fband->channelSep) { @@ -2562,13 +2485,6 @@ ath_hal_init_channels(struct ath_hal *ah "Skipping ecm channel\n"); continue; } - /* XXX needs to be in ath_hal_checkchannel */ - if ((rd->flags & NO_HOSTAP) && - (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "Skipping HOSTAP channel\n"); - continue; - } /* * Make sure that channel separation * meets the requirement. @@ -2582,13 +2498,12 @@ ath_hal_init_channels(struct ath_hal *ah icv.channelFlags = cm->flags; icv.maxRegTxPower = fband->powerDfs; icv.antennaMax = fband->antennaMax; - icv.conformanceTestLimit = ctl; - if (fband->usePassScan & rd->pscan) + if (fband->usePassScan & pscan) icv.channelFlags |= CHANNEL_PASSIVE; else icv.channelFlags &= ~CHANNEL_PASSIVE; lastc = c; - if (fband->useDfs & rd->dfsMask) { + if (fband->useDfs & dfsMask) { /* DFS and HT40 don't mix */ if (cm->mode == HAL_MODE_11NA_HT40PLUS || cm->mode == HAL_MODE_11NA_HT40MINUS) @@ -2596,9 +2511,9 @@ ath_hal_init_channels(struct ath_hal *ah icv.privFlags = CHANNEL_DFS; } else icv.privFlags = 0; - if (rd->flags & LIMIT_FRAME_4MS) + if (rdflags & LIMIT_FRAME_4MS) icv.privFlags |= CHANNEL_4MS_LIMIT; - if (rd->flags & NEED_NFC) + if (rdflags & NEED_NFC) icv.privFlags |= CHANNEL_NFCREQUIRED; ichans[next++] = icv; @@ -2675,8 +2590,7 @@ ath_hal_checkchannel(struct ath_hal *ah, if ((cc->privFlags & CHANNEL_INTERFERENCE) && (cc->channelFlags & CHANNEL_DFS)) return AH_NULL; - else - return cc; + return cc; } /* binary search based on known sorting order */ @@ -2691,8 +2605,7 @@ ath_hal_checkchannel(struct ath_hal *ah, if ((cc->privFlags & CHANNEL_INTERFERENCE) && (cc->channelFlags & CHANNEL_DFS)) return AH_NULL; - else - return cc; + return cc; } d = flags - (cc->channelFlags & CHAN_FLAGS); } @@ -2719,61 +2632,50 @@ ath_hal_checkchannel(struct ath_hal *ah, u_int ath_hal_getantennareduction(struct ath_hal *ah, HAL_CHANNEL *chan, u_int twiceGain) { - HAL_CHANNEL_INTERNAL *ichan=AH_NULL; + HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); int8_t antennaMax; - if ((ichan = ath_hal_checkchannel(ah, chan)) != AH_NULL) { - antennaMax = twiceGain - ichan->antennaMax*2; - return (antennaMax < 0) ? 0 : antennaMax; - } else { + if (ichan == AH_NULL) { /* Failed to find the correct index - may be a debug channel */ return 0; } + antennaMax = twiceGain - ichan->antennaMax*2; + return (antennaMax < 0) ? 0 : antennaMax; } - -/* XXX - maybe move ctl decision into channel set area or - into the tables so no decision is needed in the code */ - #define isWwrSKU(_ah) \ ((getEepromRD((_ah)) & WORLD_SKU_MASK) == WORLD_SKU_PREFIX || \ getEepromRD(_ah) == WORLD) - /* - * Return the test group from the specified channel from + * Return the test group for the specified channel from * the regulatory table. - * - * TODO: CTL for 11B CommonMode when regulatory domain is unknown */ u_int ath_hal_getctl(struct ath_hal *ah, HAL_CHANNEL *chan) { - u_int ctl = NO_CTL; - HAL_CHANNEL_INTERNAL *ichan; + u_int ctl; - /* Special CTL to signify WWR SKU without a known country */ - if (AH_PRIVATE(ah)->ah_countryCode == CTRY_DEFAULT && isWwrSKU(ah)) { - if (IS_CHAN_B(chan)) { - ctl = SD_NO_CTL | CTL_11B; - } else if (IS_CHAN_G(chan)) { - ctl = SD_NO_CTL | CTL_11G; - } else if (IS_CHAN_108G(chan)) { - ctl = SD_NO_CTL | CTL_108G; - } else if (IS_CHAN_T(chan)) { - ctl = SD_NO_CTL | CTL_TURBO; - } else { - ctl = SD_NO_CTL | CTL_11A; - } - } else { - if ((ichan = ath_hal_checkchannel(ah, chan)) != AH_NULL) { - ctl = ichan->conformanceTestLimit; - /* limit 11G OFDM power */ - if (IS_CHAN_PUREG(chan) && - (ctl & CTL_MODE_M) == CTL_11B) - ctl = (ctl &~ CTL_MODE_M) | CTL_11G; - } - } + if (AH_PRIVATE(ah)->ah_regpair == AH_NULL || + (AH_PRIVATE(ah)->ah_countryCode == CTRY_DEFAULT && isWwrSKU(ah))) { + /* Special CTL to signify WWR SKU without a known country */ + ctl = SD_NO_CTL; + } else if (IS_CHAN_2GHZ(chan)) + ctl = AH_PRIVATE(ah)->ah_reg2G->conformanceTestLimit; + else + ctl = AH_PRIVATE(ah)->ah_reg5G->conformanceTestLimit; + + if (IS_CHAN_B(chan)) + return ctl | CTL_11B; + if (IS_CHAN_G(chan)) + return ctl | CTL_11G; + if (IS_CHAN_108G(chan)) + return ctl | CTL_108G; + if (IS_CHAN_T(chan)) + return ctl | CTL_TURBO; + if (IS_CHAN_A(chan)) + return ctl | CTL_11A; + HALASSERT(AH_FALSE); return ctl; } From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 19:01:39 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3915F106564A; Fri, 16 Jan 2009 19:01:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E28538FC17; Fri, 16 Jan 2009 19:01:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GJ1cTk015906; Fri, 16 Jan 2009 19:01:38 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GJ1c0L015904; Fri, 16 Jan 2009 19:01:38 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901161901.n0GJ1c0L015904@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 19:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187337 - user/sam/wifi/sys/dev/ath/ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 19:01:39 -0000 Author: sam Date: Fri Jan 16 19:01:38 2009 New Revision: 187337 URL: http://svn.freebsd.org/changeset/base/187337 Log: remove last vestives of AH_SUPPORT_11D (we always support 11d) Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.c user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.c Fri Jan 16 18:57:30 2009 (r187336) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.c Fri Jan 16 19:01:38 2009 (r187337) @@ -449,11 +449,7 @@ ath_hal_getcapability(struct ath_hal *ah } return HAL_ENOTSUPP; case HAL_CAP_11D: -#ifdef AH_SUPPORT_11D return HAL_OK; -#else - return HAL_ENOTSUPP; -#endif case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */ return AH_PRIVATE(ah)->ah_rxornIsFatal ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_HT: Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 18:57:30 2009 (r187336) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 19:01:38 2009 (r187337) @@ -2021,14 +2021,12 @@ isCountryCodeValid(struct ath_hal *ah, H HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: rd %d allowed\n", __func__, rd); return AH_TRUE; -#ifdef AH_SUPPORT_11D } else if ((rd & WORLD_SKU_MASK) == WORLD_SKU_PREFIX) { int i; for (i=0; i < N(allCountries); i++) { if (cc == allCountries[i].countryCode) return AH_TRUE; } -#endif } else { int i; for (i = 0; i < N(allCountries); i++) { From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 19:02:08 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9113F106566B; Fri, 16 Jan 2009 19:02:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 667008FC0A; Fri, 16 Jan 2009 19:02:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GJ28qw015957; Fri, 16 Jan 2009 19:02:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GJ28Cm015956; Fri, 16 Jan 2009 19:02:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901161902.n0GJ28Cm015956@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 19:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187338 - user/sam/wifi/sys/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 19:02:08 -0000 Author: sam Date: Fri Jan 16 19:02:08 2009 New Revision: 187338 URL: http://svn.freebsd.org/changeset/base/187338 Log: remove AH_SUPPORT_11D Modified: user/sam/wifi/sys/conf/options Modified: user/sam/wifi/sys/conf/options ============================================================================== --- user/sam/wifi/sys/conf/options Fri Jan 16 19:01:38 2009 (r187337) +++ user/sam/wifi/sys/conf/options Fri Jan 16 19:02:08 2009 (r187338) @@ -758,7 +758,6 @@ AH_WRITE_EEPROM opt_ah.h AH_PRIVATE_DIAG opt_ah.h AH_NEED_DESC_SWAP opt_ah.h AH_USE_INIPDGAIN opt_ah.h -AH_SUPPORT_11D opt_ah.h # options for the Marvell 8335 wireless driver MALO_DEBUG opt_malo.h From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 22:39:48 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 712051065673; Fri, 16 Jan 2009 22:39:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2408FC08; Fri, 16 Jan 2009 22:39:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GMdm0g020542; Fri, 16 Jan 2009 22:39:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GMdmhc020541; Fri, 16 Jan 2009 22:39:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162239.n0GMdmhc020541@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 22:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187349 - user/sam/wifi/sys/dev/ath/ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 22:39:48 -0000 Author: sam Date: Fri Jan 16 22:39:48 2009 New Revision: 187349 URL: http://svn.freebsd.org/changeset/base/187349 Log: eliminate regulatory class id data; we're not handling it any more Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 22:22:30 2009 (r187348) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 22:39:48 2009 (r187349) @@ -299,9 +299,9 @@ enum { APL2_ETSIC = 0x56, /* Venezuela */ APL5_WORLD = 0x58, /* Chile */ APL6_WORLD = 0x5B, /* Singapore */ - APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ - APL8_WORLD = 0x5D, /* Malaysia 5GHz */ - APL9_WORLD = 0x5E, /* Korea 5GHz */ + APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ + APL8_WORLD = 0x5D, /* Malaysia 5GHz */ + APL9_WORLD = 0x5E, /* Korea 5GHz */ /* * World mode SKUs @@ -800,136 +800,134 @@ typedef struct { if corresponding bit is set */ uint64_t usePassScan; /* Use Passive Scan in the RegDomain if corresponding bit is set */ - uint8_t regClassId; /* Regulatory class id */ } REG_DMN_FREQ_BAND; /* * 5GHz 11A channel tags */ static REG_DMN_FREQ_BAND regDmn5GhzFreq[] = { - { 4915, 4925, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 16 }, + { 4915, 4925, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2 }, #define F1_4915_4925 0 - { 4935, 4945, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 16 }, + { 4935, 4945, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2 }, #define F1_4935_4945 AFTER(F1_4915_4925) - { 4920, 4980, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2, 7 }, + { 4920, 4980, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2 }, #define F1_4920_4980 AFTER(F1_4935_4945) - { 4942, 4987, 27, 6, 5, 5, NO_DFS, PSCAN_FCC, 0 }, + { 4942, 4987, 27, 6, 5, 5, NO_DFS, PSCAN_FCC }, #define F1_4942_4987 AFTER(F1_4920_4980) - { 4945, 4985, 30, 6, 10, 5, NO_DFS, PSCAN_FCC, 0 }, + { 4945, 4985, 30, 6, 10, 5, NO_DFS, PSCAN_FCC }, #define F1_4945_4985 AFTER(F1_4942_4987) - { 4950, 4980, 33, 6, 20, 5, NO_DFS, PSCAN_FCC, 0 }, + { 4950, 4980, 33, 6, 20, 5, NO_DFS, PSCAN_FCC }, #define F1_4950_4980 AFTER(F1_4945_4985) - { 5035, 5040, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12 }, + { 5035, 5040, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2 }, #define F1_5035_5040 AFTER(F1_4950_4980) - { 5040, 5080, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2, 2 }, + { 5040, 5080, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2 }, #define F1_5040_5080 AFTER(F1_5035_5040) - { 5055, 5055, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12 }, + { 5055, 5055, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2 }, #define F1_5055_5055 AFTER(F1_5040_5080) - { 5120, 5240, 5, 6, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5120, 5240, 5, 6, 20, 20, NO_DFS, NO_PSCAN }, #define F1_5120_5240 AFTER(F1_5055_5055) - { 5120, 5240, 5, 6, 10, 10, NO_DFS, NO_PSCAN, 0 }, + { 5120, 5240, 5, 6, 10, 10, NO_DFS, NO_PSCAN }, #define F2_5120_5240 AFTER(F1_5120_5240) - { 5120, 5240, 5, 6, 5, 5, NO_DFS, NO_PSCAN, 0 }, + { 5120, 5240, 5, 6, 5, 5, NO_DFS, NO_PSCAN }, #define F3_5120_5240 AFTER(F2_5120_5240) - { 5170, 5230, 23, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2, 1 }, + { 5170, 5230, 23, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2 }, #define F1_5170_5230 AFTER(F3_5120_5240) - { 5170, 5230, 20, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2, 1 }, + { 5170, 5230, 20, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2 }, #define F2_5170_5230 AFTER(F1_5170_5230) - { 5180, 5240, 15, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 0 }, + { 5180, 5240, 15, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI }, #define F1_5180_5240 AFTER(F2_5170_5230) - { 5180, 5240, 17, 6, 20, 20, NO_DFS, PSCAN_FCC, 1 }, + { 5180, 5240, 17, 6, 20, 20, NO_DFS, PSCAN_FCC }, #define F2_5180_5240 AFTER(F1_5180_5240) - { 5180, 5240, 18, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 0 }, + { 5180, 5240, 18, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI }, #define F3_5180_5240 AFTER(F2_5180_5240) - { 5180, 5240, 20, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 0 }, + { 5180, 5240, 20, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI }, #define F4_5180_5240 AFTER(F3_5180_5240) - { 5180, 5240, 23, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 0 }, + { 5180, 5240, 23, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI }, #define F5_5180_5240 AFTER(F4_5180_5240) - { 5180, 5240, 23, 6, 20, 20, NO_DFS, PSCAN_FCC, 0 }, + { 5180, 5240, 23, 6, 20, 20, NO_DFS, PSCAN_FCC }, #define F6_5180_5240 AFTER(F5_5180_5240) - { 5180, 5240, 17, 6, 20, 10, NO_DFS, PSCAN_FCC, 1 }, + { 5180, 5240, 17, 6, 20, 10, NO_DFS, PSCAN_FCC }, #define F7_5180_5240 AFTER(F6_5180_5240) - { 5180, 5240, 17, 6, 20, 5, NO_DFS, PSCAN_FCC, 1 }, + { 5180, 5240, 17, 6, 20, 5, NO_DFS, PSCAN_FCC }, #define F8_5180_5240 AFTER(F7_5180_5240) + { 5180, 5320, 20, 6, 20, 20, DFS_ETSI, PSCAN_ETSI }, - { 5180, 5320, 20, 6, 20, 20, DFS_ETSI, PSCAN_ETSI, 0 }, #define F1_5180_5320 AFTER(F8_5180_5240) + { 5240, 5280, 23, 0, 20, 20, DFS_FCC3, PSCAN_FCC | PSCAN_ETSI }, - { 5240, 5280, 23, 0, 20, 20, DFS_FCC3, PSCAN_FCC | PSCAN_ETSI, 0 }, #define F1_5240_5280 AFTER(F1_5180_5320) + { 5260, 5280, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI }, - { 5260, 5280, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 0 }, #define F1_5260_5280 AFTER(F1_5240_5280) + { 5260, 5320, 18, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI }, - { 5260, 5320, 18, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 0 }, #define F1_5260_5320 AFTER(F1_5260_5280) - - { 5260, 5320, 20, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_FCC | PSCAN_ETSI | PSCAN_MKK3 , 0 }, + { 5260, 5320, 20, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_FCC | PSCAN_ETSI | PSCAN_MKK3 }, #define F2_5260_5320 AFTER(F1_5260_5320) - { 5260, 5320, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2 }, + { 5260, 5320, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F3_5260_5320 AFTER(F2_5260_5320) - { 5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2 }, + { 5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F4_5260_5320 AFTER(F3_5260_5320) - { 5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 0 }, + { 5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F5_5260_5320 AFTER(F4_5260_5320) - { 5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN }, #define F6_5260_5320 AFTER(F5_5260_5320) - { 5260, 5320, 23, 6, 20, 10, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2 }, + { 5260, 5320, 23, 6, 20, 10, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F7_5260_5320 AFTER(F6_5260_5320) - { 5260, 5320, 23, 6, 20, 5, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2 }, + { 5260, 5320, 23, 6, 20, 5, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F8_5260_5320 AFTER(F7_5260_5320) - { 5260, 5700, 5, 6, 20, 20, DFS_FCC3 | DFS_ETSI, NO_PSCAN, 0 }, + { 5260, 5700, 5, 6, 20, 20, DFS_FCC3 | DFS_ETSI, NO_PSCAN }, #define F1_5260_5700 AFTER(F8_5260_5320) - { 5260, 5700, 5, 6, 10, 10, DFS_FCC3 | DFS_ETSI, NO_PSCAN, 0 }, + { 5260, 5700, 5, 6, 10, 10, DFS_FCC3 | DFS_ETSI, NO_PSCAN }, #define F2_5260_5700 AFTER(F1_5260_5700) - { 5260, 5700, 5, 6, 5, 5, DFS_FCC3 | DFS_ETSI, NO_PSCAN, 0 }, + { 5260, 5700, 5, 6, 5, 5, DFS_FCC3 | DFS_ETSI, NO_PSCAN }, #define F3_5260_5700 AFTER(F2_5260_5700) - { 5280, 5320, 17, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 0 }, + { 5280, 5320, 17, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F1_5280_5320 AFTER(F3_5260_5700) - { 5500, 5620, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI, 0 }, + { 5500, 5620, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI }, #define F1_5500_5620 AFTER(F1_5280_5320) - { 5500, 5700, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 4 }, + { 5500, 5700, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC }, #define F1_5500_5700 AFTER(F1_5500_5620) - { 5500, 5700, 27, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 0 }, + { 5500, 5700, 27, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI }, #define F2_5500_5700 AFTER(F1_5500_5700) - { 5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 0 }, + { 5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI }, #define F3_5500_5700 AFTER(F2_5500_5700) - { 5500, 5700, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_MKK3 | PSCAN_FCC, 0 }, + { 5500, 5700, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_MKK3 | PSCAN_FCC }, #define F4_5500_5700 AFTER(F3_5500_5700) - { 5745, 5805, 23, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5805, 23, 0, 20, 20, NO_DFS, NO_PSCAN }, #define F1_5745_5805 AFTER(F4_5500_5700) - { 5745, 5805, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5805, 30, 6, 20, 20, NO_DFS, NO_PSCAN }, #define F2_5745_5805 AFTER(F1_5745_5805) - { 5745, 5805, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI, 0 }, + { 5745, 5805, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI }, #define F3_5745_5805 AFTER(F2_5745_5805) - { 5745, 5825, 5, 6, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 5, 6, 20, 20, NO_DFS, NO_PSCAN }, #define F1_5745_5825 AFTER(F3_5745_5805) - { 5745, 5825, 17, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 17, 0, 20, 20, NO_DFS, NO_PSCAN }, #define F2_5745_5825 AFTER(F1_5745_5825) - { 5745, 5825, 20, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 20, 0, 20, 20, NO_DFS, NO_PSCAN }, #define F3_5745_5825 AFTER(F2_5745_5825) - { 5745, 5825, 30, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 30, 0, 20, 20, NO_DFS, NO_PSCAN }, #define F4_5745_5825 AFTER(F3_5745_5825) - { 5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 3 }, + { 5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN }, #define F5_5745_5825 AFTER(F4_5745_5825) - { 5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN }, #define F6_5745_5825 AFTER(F5_5745_5825) - { 5745, 5825, 5, 6, 10, 10, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 5, 6, 10, 10, NO_DFS, NO_PSCAN }, #define F7_5745_5825 AFTER(F6_5745_5825) - { 5745, 5825, 5, 6, 5, 5, NO_DFS, NO_PSCAN, 0 }, + { 5745, 5825, 5, 6, 5, 5, NO_DFS, NO_PSCAN }, #define F8_5745_5825 AFTER(F7_5745_5825) - { 5745, 5825, 30, 6, 20, 10, NO_DFS, NO_PSCAN, 3 }, + { 5745, 5825, 30, 6, 20, 10, NO_DFS, NO_PSCAN }, #define F9_5745_5825 AFTER(F8_5745_5825) - { 5745, 5825, 30, 6, 20, 5, NO_DFS, NO_PSCAN, 3 }, + { 5745, 5825, 30, 6, 20, 5, NO_DFS, NO_PSCAN }, #define F10_5745_5825 AFTER(F9_5745_5825) /* @@ -937,25 +935,25 @@ static REG_DMN_FREQ_BAND regDmn5GhzFreq[ * All WWR domains have no power limit, instead use the card's CTL * or max power settings. */ - { 4920, 4980, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0 }, + { 4920, 4980, 30, 0, 20, 20, NO_DFS, PSCAN_WWR }, #define W1_4920_4980 AFTER(F10_5745_5825) - { 5040, 5080, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0 }, + { 5040, 5080, 30, 0, 20, 20, NO_DFS, PSCAN_WWR }, #define W1_5040_5080 AFTER(W1_4920_4980) - { 5170, 5230, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0 }, + { 5170, 5230, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define W1_5170_5230 AFTER(W1_5040_5080) - { 5180, 5240, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0 }, + { 5180, 5240, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define W1_5180_5240 AFTER(W1_5170_5230) - { 5260, 5320, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0 }, + { 5260, 5320, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define W1_5260_5320 AFTER(W1_5180_5240) - { 5745, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0 }, + { 5745, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR }, #define W1_5745_5825 AFTER(W1_5260_5320) - { 5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0 }, + { 5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define W1_5500_5700 AFTER(W1_5745_5825) - { 5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN }, #define W2_5260_5320 AFTER(W1_5500_5700) - { 5180, 5240, 30, 0, 20, 20, NO_DFS, NO_PSCAN, 0 }, + { 5180, 5240, 30, 0, 20, 20, NO_DFS, NO_PSCAN }, #define W2_5180_5240 AFTER(W2_5260_5320) - { 5825, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0 }, + { 5825, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR }, #define W2_5825_5825 AFTER(W2_5180_5240) }; @@ -963,66 +961,66 @@ static REG_DMN_FREQ_BAND regDmn5GhzFreq[ * 5GHz Turbo (dynamic & static) tags */ static REG_DMN_FREQ_BAND regDmn5GhzTurboFreq[] = { - { 5130, 5210, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5130, 5210, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5130_5210 0 - { 5250, 5330, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN, 0}, + { 5250, 5330, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN }, #define T1_5250_5330 AFTER(T1_5130_5210) - { 5370, 5490, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5370, 5490, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5370_5490 AFTER(T1_5250_5330) - { 5530, 5650, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN, 0}, + { 5530, 5650, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN }, #define T1_5530_5650 AFTER(T1_5370_5490) - { 5150, 5190, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5150, 5190, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5150_5190 AFTER(T1_5530_5650) - { 5230, 5310, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN, 0}, + { 5230, 5310, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN }, #define T1_5230_5310 AFTER(T1_5150_5190) - { 5350, 5470, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5350, 5470, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5350_5470 AFTER(T1_5230_5310) - { 5510, 5670, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN, 0}, + { 5510, 5670, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN }, #define T1_5510_5670 AFTER(T1_5350_5470) - { 5200, 5240, 17, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5200, 5240, 17, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5200_5240 AFTER(T1_5510_5670) - { 5200, 5240, 23, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5200, 5240, 23, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T2_5200_5240 AFTER(T1_5200_5240) - { 5210, 5210, 17, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5210, 5210, 17, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5210_5210 AFTER(T2_5200_5240) - { 5210, 5210, 23, 0, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5210, 5210, 23, 0, 40, 40, NO_DFS, NO_PSCAN }, #define T2_5210_5210 AFTER(T1_5210_5210) - { 5280, 5280, 23, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5280, 5280, 23, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T1_5280_5280 AFTER(T2_5210_5210) - { 5280, 5280, 20, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5280, 5280, 20, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T2_5280_5280 AFTER(T1_5280_5280) - { 5250, 5250, 17, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5250, 5250, 17, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T1_5250_5250 AFTER(T2_5280_5280) - { 5290, 5290, 20, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5290, 5290, 20, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T1_5290_5290 AFTER(T1_5250_5250) - { 5250, 5290, 20, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5250, 5290, 20, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T1_5250_5290 AFTER(T1_5290_5290) - { 5250, 5290, 23, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5250, 5290, 23, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T2_5250_5290 AFTER(T1_5250_5290) - { 5540, 5660, 20, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T, 0}, + { 5540, 5660, 20, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T }, #define T1_5540_5660 AFTER(T2_5250_5290) - { 5760, 5800, 20, 0, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5760, 5800, 20, 0, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5760_5800 AFTER(T1_5540_5660) - { 5760, 5800, 30, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5760, 5800, 30, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T2_5760_5800 AFTER(T1_5760_5800) - { 5765, 5805, 30, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 5765, 5805, 30, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_5765_5805 AFTER(T2_5760_5800) /* * Below are the WWR frequencies */ - { 5210, 5250, 15, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0}, + { 5210, 5250, 15, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define WT1_5210_5250 AFTER(T1_5765_5805) - { 5290, 5290, 18, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0}, + { 5290, 5290, 18, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define WT1_5290_5290 AFTER(WT1_5210_5250) - { 5540, 5660, 20, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0}, + { 5540, 5660, 20, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR }, #define WT1_5540_5660 AFTER(WT1_5290_5290) - { 5760, 5800, 20, 0, 40, 40, NO_DFS, PSCAN_WWR, 0}, + { 5760, 5800, 20, 0, 40, 40, NO_DFS, PSCAN_WWR }, #define WT1_5760_5800 AFTER(WT1_5540_5660) }; @@ -1030,67 +1028,67 @@ static REG_DMN_FREQ_BAND regDmn5GhzTurbo * 2GHz 11b channel tags */ static REG_DMN_FREQ_BAND regDmn2GhzFreq[] = { - { 2312, 2372, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2312_2372 0 - { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define F2_2312_2372 AFTER(F1_2312_2372) - { 2412, 2472, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2472, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2412_2472 AFTER(F2_2312_2372) - { 2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA, 0}, + { 2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA }, #define F2_2412_2472 AFTER(F1_2412_2472) - { 2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN }, #define F3_2412_2472 AFTER(F2_2412_2472) - { 2412, 2462, 27, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2462, 27, 6, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2412_2462 AFTER(F3_2412_2472) - { 2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA, 0}, + { 2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA }, #define F2_2412_2462 AFTER(F1_2412_2462) - { 2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2432_2442 AFTER(F2_2412_2462) - { 2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2457_2472 AFTER(F1_2432_2442) - { 2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA, 0}, + { 2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA }, #define F1_2467_2472 AFTER(F1_2457_2472) - { 2484, 2484, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2484, 2484, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2484_2484 AFTER(F1_2467_2472) - { 2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA | PSCAN_MKKA1 | PSCAN_MKKA2, 0}, + { 2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA | PSCAN_MKKA1 | PSCAN_MKKA2 }, #define F2_2484_2484 AFTER(F1_2484_2484) - { 2512, 2732, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2512, 2732, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define F1_2512_2732 AFTER(F2_2484_2484) /* * WWR have powers opened up to 20dBm. * Limits should often come from CTL/Max powers */ - { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define W1_2312_2372 AFTER(F1_2512_2732) - { 2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define W1_2412_2412 AFTER(W1_2312_2372) - { 2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define W1_2417_2432 AFTER(W1_2412_2412) - { 2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define W1_2437_2442 AFTER(W1_2417_2432) - { 2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define W1_2447_2457 AFTER(W1_2437_2442) - { 2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define W1_2462_2462 AFTER(W1_2447_2457) - { 2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, + { 2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN }, #define W1_2467_2467 AFTER(W1_2462_2462) - { 2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0}, + { 2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN }, #define W2_2467_2467 AFTER(W1_2467_2467) - { 2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, + { 2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN }, #define W1_2472_2472 AFTER(W2_2467_2467) - { 2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0}, + { 2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN }, #define W2_2472_2472 AFTER(W1_2472_2472) - { 2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, + { 2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN }, #define W1_2484_2484 AFTER(W2_2472_2472) - { 2484, 2484, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0}, + { 2484, 2484, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN }, #define W2_2484_2484 AFTER(W1_2484_2484) }; @@ -1098,96 +1096,96 @@ static REG_DMN_FREQ_BAND regDmn2GhzFreq[ * 2GHz 11g channel tags */ static REG_DMN_FREQ_BAND regDmn2Ghz11gFreq[] = { - { 2312, 2372, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define G1_2312_2372 0 - { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define G2_2312_2372 AFTER(G1_2312_2372) - { 2312, 2372, 5, 6, 10, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 5, 6, 10, 5, NO_DFS, NO_PSCAN }, #define G3_2312_2372 AFTER(G2_2312_2372) - { 2312, 2372, 5, 6, 5, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 5, 6, 5, 5, NO_DFS, NO_PSCAN }, #define G4_2312_2372 AFTER(G3_2312_2372) - { 2412, 2472, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2472, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define G1_2412_2472 AFTER(G4_2312_2372) - { 2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G, 0}, + { 2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G }, #define G2_2412_2472 AFTER(G1_2412_2472) - { 2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN }, #define G3_2412_2472 AFTER(G2_2412_2472) - { 2412, 2472, 5, 6, 10, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2472, 5, 6, 10, 5, NO_DFS, NO_PSCAN }, #define G4_2412_2472 AFTER(G3_2412_2472) - { 2412, 2472, 5, 6, 5, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2472, 5, 6, 5, 5, NO_DFS, NO_PSCAN }, #define G5_2412_2472 AFTER(G4_2412_2472) - { 2412, 2462, 27, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2462, 27, 6, 20, 5, NO_DFS, NO_PSCAN }, #define G1_2412_2462 AFTER(G5_2412_2472) - { 2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G, 0}, + { 2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G }, #define G2_2412_2462 AFTER(G1_2412_2462) - { 2412, 2462, 27, 6, 10, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2462, 27, 6, 10, 5, NO_DFS, NO_PSCAN }, #define G3_2412_2462 AFTER(G2_2412_2462) - { 2412, 2462, 27, 6, 5, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2462, 27, 6, 5, 5, NO_DFS, NO_PSCAN }, #define G4_2412_2462 AFTER(G3_2412_2462) - { 2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define G1_2432_2442 AFTER(G4_2412_2462) - { 2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define G1_2457_2472 AFTER(G1_2432_2442) - { 2512, 2732, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2512, 2732, 5, 6, 20, 5, NO_DFS, NO_PSCAN }, #define G1_2512_2732 AFTER(G1_2457_2472) - { 2512, 2732, 5, 6, 10, 5, NO_DFS, NO_PSCAN, 0}, + { 2512, 2732, 5, 6, 10, 5, NO_DFS, NO_PSCAN }, #define G2_2512_2732 AFTER(G1_2512_2732) - { 2512, 2732, 5, 6, 5, 5, NO_DFS, NO_PSCAN, 0}, + { 2512, 2732, 5, 6, 5, 5, NO_DFS, NO_PSCAN }, #define G3_2512_2732 AFTER(G2_2512_2732) - { 2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA, 0 }, + { 2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA }, #define G1_2467_2472 AFTER(G3_2512_2732) /* * WWR open up the power to 20dBm */ - { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define WG1_2312_2372 AFTER(G1_2467_2472) - { 2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define WG1_2412_2412 AFTER(WG1_2312_2372) - { 2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define WG1_2417_2432 AFTER(WG1_2412_2412) - { 2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define WG1_2437_2442 AFTER(WG1_2417_2432) - { 2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define WG1_2447_2457 AFTER(WG1_2437_2442) - { 2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0}, + { 2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN }, #define WG1_2462_2462 AFTER(WG1_2447_2457) - { 2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, + { 2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN }, #define WG1_2467_2467 AFTER(WG1_2462_2462) - { 2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0}, + { 2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN }, #define WG2_2467_2467 AFTER(WG1_2467_2467) - { 2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, + { 2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN }, #define WG1_2472_2472 AFTER(WG2_2467_2467) - { 2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0}, + { 2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN }, #define WG2_2472_2472 AFTER(WG1_2472_2472) /* * Mapping for 900MHz cards like Ubiquiti SR9 and XR9 * and ZComax GZ-901. */ - { 2422, 2437, 30, 0, 5, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2422, 2437, 30, 0, 5, 5, NO_DFS, PSCAN_FCC }, #define S1_907_922_5 AFTER(WG2_2472_2472) - { 2422, 2437, 30, 0, 10, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2422, 2437, 30, 0, 10, 5, NO_DFS, PSCAN_FCC }, #define S1_907_922_10 AFTER(S1_907_922_5) - { 2427, 2432, 30, 0, 20, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2427, 2432, 30, 0, 20, 5, NO_DFS, PSCAN_FCC }, #define S1_912_917 AFTER(S1_907_922_10) - { 2427, 2442, 30, 0, 5, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2427, 2442, 30, 0, 5, 5, NO_DFS, PSCAN_FCC }, #define S2_907_922_5 AFTER(S1_912_917) - { 2427, 2442, 30, 0, 10, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2427, 2442, 30, 0, 10, 5, NO_DFS, PSCAN_FCC }, #define S2_907_922_10 AFTER(S2_907_922_5) - { 2432, 2437, 30, 0, 20, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2432, 2437, 30, 0, 20, 5, NO_DFS, PSCAN_FCC }, #define S2_912_917 AFTER(S2_907_922_10) - { 2452, 2467, 30, 0, 5, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2452, 2467, 30, 0, 5, 5, NO_DFS, PSCAN_FCC }, #define S1_908_923_5 AFTER(S2_912_917) - { 2457, 2467, 30, 0, 10, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2457, 2467, 30, 0, 10, 5, NO_DFS, PSCAN_FCC }, #define S1_913_918_10 AFTER(S1_908_923_5) - { 2457, 2467, 30, 0, 20, 5, NO_DFS, PSCAN_FCC, 0 }, + { 2457, 2467, 30, 0, 20, 5, NO_DFS, PSCAN_FCC }, #define S1_913_918 AFTER(S1_913_918_10) }; @@ -1195,15 +1193,15 @@ static REG_DMN_FREQ_BAND regDmn2Ghz11gFr * 2GHz Dynamic turbo tags */ static REG_DMN_FREQ_BAND regDmn2Ghz11gTurboFreq[] = { - { 2312, 2372, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 2312, 2372, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_2312_2372 0 - { 2437, 2437, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 2437, 2437, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_2437_2437 AFTER(T1_2312_2372) - { 2437, 2437, 20, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 2437, 2437, 20, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T2_2437_2437 AFTER(T1_2437_2437) - { 2437, 2437, 18, 6, 40, 40, NO_DFS, PSCAN_WWR, 0}, + { 2437, 2437, 18, 6, 40, 40, NO_DFS, PSCAN_WWR }, #define T3_2437_2437 AFTER(T2_2437_2437) - { 2512, 2732, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0}, + { 2512, 2732, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, #define T1_2512_2732 AFTER(T3_2437_2437) }; From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 22:41:13 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0236A106564A; Fri, 16 Jan 2009 22:41:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA5388FC18; Fri, 16 Jan 2009 22:41:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GMfCBT020611; Fri, 16 Jan 2009 22:41:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GMfCJa020608; Fri, 16 Jan 2009 22:41:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162241.n0GMfCJa020608@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 22:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187350 - in user/sam/wifi/sys/dev/ath: . ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 22:41:13 -0000 Author: sam Date: Fri Jan 16 22:41:12 2009 New Revision: 187350 URL: http://svn.freebsd.org/changeset/base/187350 Log: remove the regulatory class id's from the ath_hal_init_channels api Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c user/sam/wifi/sys/dev/ath/if_ath.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Fri Jan 16 22:39:48 2009 (r187349) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Fri Jan 16 22:41:12 2009 (r187350) @@ -860,7 +860,6 @@ extern struct ath_hal * __ahdecl ath_hal */ extern HAL_BOOL __ahdecl ath_hal_init_channels(struct ath_hal *, HAL_CHANNEL *chans, u_int maxchans, u_int *nchans, - uint8_t *regclassids, u_int maxregids, u_int *nregids, HAL_CTRY_CODE cc, u_int modeSelect, HAL_BOOL enableOutdoor, HAL_BOOL enableExtendedChannels); Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 22:39:48 2009 (r187349) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 22:41:12 2009 (r187350) @@ -2235,7 +2235,6 @@ IS_BIT_SET(int bit, const uint64_t bitma HAL_BOOL ath_hal_init_channels(struct ath_hal *ah, HAL_CHANNEL *chans, u_int maxchans, u_int *nchans, - uint8_t *regclassids, u_int maxregids, u_int *nregids, HAL_CTRY_CODE cc, u_int modeSelect, HAL_BOOL enableOutdoor, HAL_BOOL enableExtendedChannels) { Modified: user/sam/wifi/sys/dev/ath/if_ath.c ============================================================================== --- user/sam/wifi/sys/dev/ath/if_ath.c Fri Jan 16 22:39:48 2009 (r187349) +++ user/sam/wifi/sys/dev/ath/if_ath.c Fri Jan 16 22:41:12 2009 (r187350) @@ -6204,7 +6204,7 @@ getchannels(struct ath_softc *sc, int *n } error = 0; if (!ath_hal_init_channels(ah, halchans, IEEE80211_CHAN_MAX, &nhalchans, - NULL, 0, NULL, cc, HAL_MODE_ALL, outdoor, ecm)) { + cc, HAL_MODE_ALL, outdoor, ecm)) { u_int32_t rd; (void) ath_hal_getregdomain(ah, &rd); device_printf(sc->sc_dev, "ath_hal_init_channels failed, " From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 23:25:50 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 221951065677; Fri, 16 Jan 2009 23:25:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4338FC18; Fri, 16 Jan 2009 23:25:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GNPoNB021488; Fri, 16 Jan 2009 23:25:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GNPnJm021485; Fri, 16 Jan 2009 23:25:49 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162325.n0GNPnJm021485@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 23:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187351 - in user/sam/wifi/sys/dev/ath: . ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 23:25:50 -0000 Author: sam Date: Fri Jan 16 23:25:49 2009 New Revision: 187351 URL: http://svn.freebsd.org/changeset/base/187351 Log: Eliminate the outdoor control in setting up the channel list; the hal never returns a frequency above 5825 so it had no effect. Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c user/sam/wifi/sys/dev/ath/if_ath.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah.h Fri Jan 16 22:41:12 2009 (r187350) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah.h Fri Jan 16 23:25:49 2009 (r187351) @@ -861,7 +861,7 @@ extern struct ath_hal * __ahdecl ath_hal extern HAL_BOOL __ahdecl ath_hal_init_channels(struct ath_hal *, HAL_CHANNEL *chans, u_int maxchans, u_int *nchans, HAL_CTRY_CODE cc, u_int modeSelect, - HAL_BOOL enableOutdoor, HAL_BOOL enableExtendedChannels); + HAL_BOOL enableExtendedChannels); /* * Calibrate noise floor data following a channel scan or similar. Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 22:41:12 2009 (r187350) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 23:25:49 2009 (r187351) @@ -34,10 +34,6 @@ #define HAL_MODE_11A_TURBO HAL_MODE_108A #define HAL_MODE_11G_TURBO HAL_MODE_108G -/* 10MHz is half the 11A bandwidth used to determine upper edge freq - of the outdoor channel */ -#define HALF_MAXCHANBW 10 - /* * BMLEN defines the size of the bitmask used to hold frequency * band specifications. Note this must agree with the BM macro @@ -617,151 +613,150 @@ typedef struct { HAL_BOOL allow11ng40; HAL_BOOL allow11na20; HAL_BOOL allow11na40; - uint16_t outdoorChanStart; } COUNTRY_CODE_TO_ENUM_RD; static COUNTRY_CODE_TO_ENUM_RD allCountries[] = { - {CTRY_DEBUG, NO_ENUMRD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_DEFAULT, DEF_REGDMN, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_ALBANIA, NULL1_WORLD, YES, NO, YES, YES, NO, NO, NO, 7000 }, - {CTRY_ALGERIA, NULL1_WORLD, YES, NO, YES, YES, NO, NO, NO, 7000 }, - {CTRY_ARGENTINA, APL3_WORLD, NO, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_ARMENIA, ETSI4_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_AUSTRALIA, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_AUSTRIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_AZERBAIJAN, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_BAHRAIN, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_BELARUS, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_BELGIUM, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_BELIZE, APL1_ETSIC, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_BOLIVIA, APL1_ETSIC, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_BRAZIL, FCC3_WORLD, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_BRUNEI_DARUSSALAM,APL1_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_BULGARIA, ETSI6_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_CANADA, FCC2_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_CHILE, APL6_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_CHINA, APL1_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_COLOMBIA, FCC1_FCCA, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_COSTA_RICA, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_CROATIA, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_CYPRUS, ETSI1_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_CZECH, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_DENMARK, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_DOMINICAN_REPUBLIC,FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_ECUADOR, NULL1_WORLD, NO, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_EGYPT, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_EL_SALVADOR, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_ESTONIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_FINLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_FRANCE, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_FRANCE2, ETSI3_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_GEORGIA, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_GERMANY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_GREECE, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_GUATEMALA, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_GZ901, GZ901_WORLD, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_HONDURAS, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_HONG_KONG, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_HUNGARY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_ICELAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_INDIA, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_INDONESIA, APL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_IRAN, APL1_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_IRELAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_ISRAEL, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_ITALY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_JAPAN, MKK1_MKKA, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_JAPAN1, MKK1_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN2, MKK1_FCCA, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN3, MKK2_MKKA, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN4, MKK1_MKKA1, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN5, MKK1_MKKA2, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN6, MKK1_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JAPAN7, MKK3_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN8, MKK3_MKKA2, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN9, MKK3_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JAPAN10, MKK4_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN11, MKK4_MKKA2, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN12, MKK4_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JAPAN13, MKK5_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN14, MKK5_MKKA2, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN15, MKK5_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JAPAN16, MKK6_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN17, MKK6_MKKA2, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN18, MKK6_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JAPAN19, MKK7_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN20, MKK7_MKKA2, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_JAPAN21, MKK7_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JAPAN22, MKK8_MKKB, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN23, MKK8_MKKA2, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_JAPAN24, MKK8_MKKC, YES, NO, NO, NO, NO, NO, NO, 7000 }, - - {CTRY_JORDAN, APL4_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_KAZAKHSTAN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_KOREA_NORTH, APL2_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_KOREA_ROC, APL2_WORLD, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_KOREA_ROC2, APL2_WORLD, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_KOREA_ROC3, APL9_WORLD, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_KUWAIT, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_LATVIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_LEBANON, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_LIECHTENSTEIN,ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_LITHUANIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_LUXEMBOURG, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_MACAU, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_MACEDONIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_MALAYSIA, APL8_WORLD, YES, NO, NO, YES, NO, YES, NO, 7000 }, - {CTRY_MALTA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_MEXICO, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_MONACO, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_MOROCCO, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_NETHERLANDS, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_NEW_ZEALAND, FCC2_ETSIC, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_NORWAY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_OMAN, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_PAKISTAN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_PANAMA, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_PERU, APL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_PHILIPPINES, FCC3_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_POLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_PORTUGAL, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_PUERTO_RICO, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_QATAR, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_ROMANIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_RUSSIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_SAUDI_ARABIA,FCC2_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_SINGAPORE, APL6_WORLD, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_SLOVAKIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_SLOVENIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_SOUTH_AFRICA,FCC3_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_SPAIN, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_SR9, SR9_WORLD, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_SWEDEN, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_SWITZERLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES, 7000 }, - {CTRY_SYRIA, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_TAIWAN, APL3_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_THAILAND, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_TRINIDAD_Y_TOBAGO,ETSI4_WORLD,YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_TUNISIA, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_TURKEY, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_UKRAINE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_UAE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_UNITED_KINGDOM, ETSI1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_UNITED_STATES, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES, 5825 }, - {CTRY_UNITED_STATES_FCC49,FCC4_FCCA,YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_URUGUAY, FCC1_WORLD, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_UZBEKISTAN, FCC3_FCCA, YES, YES, YES, YES,YES, YES,YES, 7000 }, - {CTRY_VENEZUELA, APL2_ETSIC, YES, NO, YES, YES,YES, YES, NO, 7000 }, - {CTRY_VIET_NAM, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_XR9, XR9_WORLD, YES, NO, NO, NO, NO, NO, NO, 7000 }, - {CTRY_YEMEN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 }, - {CTRY_ZIMBABWE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO, 7000 } + {CTRY_DEBUG, NO_ENUMRD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_DEFAULT, DEF_REGDMN, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_ALBANIA, NULL1_WORLD, YES, NO, YES, YES, NO, NO, NO }, + {CTRY_ALGERIA, NULL1_WORLD, YES, NO, YES, YES, NO, NO, NO }, + {CTRY_ARGENTINA, APL3_WORLD, NO, NO, NO, NO, NO, NO, NO }, + {CTRY_ARMENIA, ETSI4_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_AUSTRALIA, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_AUSTRIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_AZERBAIJAN, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_BAHRAIN, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_BELARUS, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_BELGIUM, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_BELIZE, APL1_ETSIC, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_BOLIVIA, APL1_ETSIC, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_BRAZIL, FCC3_WORLD, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_BRUNEI_DARUSSALAM,APL1_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_BULGARIA, ETSI6_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_CANADA, FCC2_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_CHILE, APL6_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_CHINA, APL1_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_COLOMBIA, FCC1_FCCA, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_COSTA_RICA, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_CROATIA, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_CYPRUS, ETSI1_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_CZECH, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_DENMARK, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_DOMINICAN_REPUBLIC,FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_ECUADOR, NULL1_WORLD, NO, NO, NO, NO, NO, NO, NO }, + {CTRY_EGYPT, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_EL_SALVADOR, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_ESTONIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_FINLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_FRANCE, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_FRANCE2, ETSI3_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_GEORGIA, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_GERMANY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_GREECE, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_GUATEMALA, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_GZ901, GZ901_WORLD, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_HONDURAS, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_HONG_KONG, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_HUNGARY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_ICELAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_INDIA, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_INDONESIA, APL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_IRAN, APL1_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_IRELAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_ISRAEL, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_ITALY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_JAPAN, MKK1_MKKA, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_JAPAN1, MKK1_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN2, MKK1_FCCA, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN3, MKK2_MKKA, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN4, MKK1_MKKA1, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN5, MKK1_MKKA2, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN6, MKK1_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN7, MKK3_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN8, MKK3_MKKA2, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN9, MKK3_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN10, MKK4_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN11, MKK4_MKKA2, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN12, MKK4_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN13, MKK5_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN14, MKK5_MKKA2, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN15, MKK5_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN16, MKK6_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN17, MKK6_MKKA2, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN18, MKK6_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN19, MKK7_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN20, MKK7_MKKA2, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_JAPAN21, MKK7_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN22, MKK8_MKKB, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN23, MKK8_MKKA2, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN24, MKK8_MKKC, YES, NO, NO, NO, NO, NO, NO }, + + {CTRY_JORDAN, APL4_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_KAZAKHSTAN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_KOREA_NORTH, APL2_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_KOREA_ROC, APL2_WORLD, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_KOREA_ROC2, APL2_WORLD, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_KOREA_ROC3, APL9_WORLD, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_KUWAIT, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_LATVIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_LEBANON, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_LIECHTENSTEIN,ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_LITHUANIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_LUXEMBOURG, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_MACAU, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_MACEDONIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_MALAYSIA, APL8_WORLD, YES, NO, NO, YES, NO, YES, NO }, + {CTRY_MALTA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_MEXICO, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_MONACO, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_MOROCCO, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_NETHERLANDS, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_NEW_ZEALAND, FCC2_ETSIC, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_NORWAY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_OMAN, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_PAKISTAN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_PANAMA, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_PERU, APL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_PHILIPPINES, FCC3_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_POLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_PORTUGAL, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_PUERTO_RICO, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_QATAR, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_ROMANIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_RUSSIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_SAUDI_ARABIA,FCC2_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_SINGAPORE, APL6_WORLD, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_SLOVAKIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_SLOVENIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_SOUTH_AFRICA,FCC3_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_SPAIN, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_SR9, SR9_WORLD, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_SWEDEN, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_SWITZERLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, + {CTRY_SYRIA, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_TAIWAN, APL3_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_THAILAND, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_TRINIDAD_Y_TOBAGO,ETSI4_WORLD,YES, NO, YES, YES,YES, YES, NO }, + {CTRY_TUNISIA, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_TURKEY, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_UKRAINE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_UAE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_UNITED_KINGDOM, ETSI1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_UNITED_STATES, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_UNITED_STATES_FCC49,FCC4_FCCA,YES, YES, YES, YES,YES, YES,YES }, + {CTRY_URUGUAY, FCC1_WORLD, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_UZBEKISTAN, FCC3_FCCA, YES, YES, YES, YES,YES, YES,YES }, + {CTRY_VENEZUELA, APL2_ETSIC, YES, NO, YES, YES,YES, YES, NO }, + {CTRY_VIET_NAM, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_XR9, XR9_WORLD, YES, NO, NO, NO, NO, NO, NO }, + {CTRY_YEMEN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, + {CTRY_ZIMBABWE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO } }; /* Bit masks for DFS per regdomain */ @@ -2236,12 +2231,11 @@ HAL_BOOL ath_hal_init_channels(struct ath_hal *ah, HAL_CHANNEL *chans, u_int maxchans, u_int *nchans, HAL_CTRY_CODE cc, u_int modeSelect, - HAL_BOOL enableOutdoor, HAL_BOOL enableExtendedChannels) + HAL_BOOL enableExtendedChannels) { #define CHANNEL_HALF_BW 10 #define CHANNEL_QUARTER_BW 5 u_int modesAvail; - uint16_t maxChan; COUNTRY_CODE_TO_ENUM_RD *country = AH_NULL; REG_DMN_PAIR_MAPPING *regpair; REG_DOMAIN *rd5GHz, *rd2GHz; @@ -2249,8 +2243,8 @@ ath_hal_init_channels(struct ath_hal *ah HAL_CHANNEL_INTERNAL *ichans = &AH_PRIVATE(ah)->ah_channels[0]; int next, b, regDmn; - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: cc %u mode 0x%x%s%s\n", - __func__, cc, modeSelect, enableOutdoor? " Enable outdoor" : " ", + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: cc %u mode 0x%x%s\n", + __func__, cc, modeSelect, enableExtendedChannels ? " Enable ecm" : ""); /* @@ -2335,7 +2329,6 @@ ath_hal_init_channels(struct ath_hal *ah AH_PRIVATE(ah)->ah_reg5G = rd5GHz; modesAvail = ath_hal_getwmodesnreg(ah, country, rd5GHz); - maxChan = !enableOutdoor ? country->outdoorChanStart : 7000; if (maxchans > N(AH_PRIVATE(ah)->ah_channels)) maxchans = N(AH_PRIVATE(ah)->ah_channels); @@ -2462,12 +2455,6 @@ ath_hal_init_channels(struct ath_hal *ah __func__, c, c_lo, c_hi); continue; } - if (((c+fband->channelSep)/2) > (maxChan+HALF_MAXCHANBW)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: c %u > maxChan %u\n", - __func__, c, maxChan); - continue; - } if (next >= maxchans){ HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: too many channels for channel table\n", Modified: user/sam/wifi/sys/dev/ath/if_ath.c ============================================================================== --- user/sam/wifi/sys/dev/ath/if_ath.c Fri Jan 16 22:41:12 2009 (r187350) +++ user/sam/wifi/sys/dev/ath/if_ath.c Fri Jan 16 23:25:49 2009 (r187351) @@ -6186,14 +6186,14 @@ ath_newassoc(struct ieee80211_node *ni, static int getchannels(struct ath_softc *sc, int *nchans, struct ieee80211_channel chans[], - int cc, int ecm, int outdoor) + int cc, int ecm) { struct ath_hal *ah = sc->sc_ah; HAL_CHANNEL *halchans; int i, nhalchans, error; - DPRINTF(sc, ATH_DEBUG_REGDOMAIN, "%s: cc %u outdoor %u ecm %u\n", - __func__, cc, outdoor, ecm); + DPRINTF(sc, ATH_DEBUG_REGDOMAIN, "%s: cc %u ecm %u\n", + __func__, cc, ecm); halchans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL), M_TEMP, M_NOWAIT | M_ZERO); @@ -6204,11 +6204,11 @@ getchannels(struct ath_softc *sc, int *n } error = 0; if (!ath_hal_init_channels(ah, halchans, IEEE80211_CHAN_MAX, &nhalchans, - cc, HAL_MODE_ALL, outdoor, ecm)) { + cc, HAL_MODE_ALL, ecm)) { u_int32_t rd; (void) ath_hal_getregdomain(ah, &rd); device_printf(sc->sc_dev, "ath_hal_init_channels failed, " - "rd %d cc %u outdoor %u ecm %u\n", rd, cc, outdoor, ecm); + "rd %d cc %u ecm %u\n", rd, cc, ecm); error = EINVAL; goto done; } @@ -6308,16 +6308,14 @@ ath_setregdomain(struct ieee80211com *ic ath_hal_setregdomain(ah, regdomain); error = getchannels(sc, &nchans, chans, cc, - rd->ecm ? AH_TRUE : AH_FALSE, - rd->location != 'I' ? AH_TRUE : AH_FALSE); + rd->ecm ? AH_TRUE : AH_FALSE); if (error != 0) { /* * Restore previous state. */ ath_hal_setregdomain(ah, ord); (void) getchannels(sc, NULL, NULL, ic->ic_regdomain.country, - ic->ic_regdomain.ecm ? AH_TRUE : AH_FALSE, - ic->ic_regdomain.location != 'I' ? AH_TRUE : AH_FALSE); + ic->ic_regdomain.ecm ? AH_TRUE : AH_FALSE); return error; } return 0; @@ -6338,13 +6336,12 @@ ath_getradiocaps(struct ieee80211com *ic ath_hal_setregdomain(ah, 0); /* XXX not quite right but close enough for now */ - getchannels(sc, nchans, chans, CTRY_DEBUG, AH_TRUE, AH_FALSE); + getchannels(sc, nchans, chans, CTRY_DEBUG, AH_TRUE); /* NB: restore previous state */ ath_hal_setregdomain(ah, ord); (void) getchannels(sc, NULL, NULL, ic->ic_regdomain.country, - ic->ic_regdomain.ecm ? AH_TRUE : AH_FALSE, - ic->ic_regdomain.location != 'I' ? AH_TRUE : AH_FALSE); + ic->ic_regdomain.ecm ? AH_TRUE : AH_FALSE); } static void @@ -6380,7 +6377,7 @@ ath_getchannels(struct ath_softc *sc) * Convert HAL channels to ieee80211 ones. */ error = getchannels(sc, &ic->ic_nchans, ic->ic_channels, - CTRY_DEFAULT, AH_TRUE, AH_FALSE); + CTRY_DEFAULT, AH_TRUE); (void) ath_hal_getregdomain(ah, &sc->sc_eerd); ath_hal_getcountrycode(ah, &sc->sc_eecc); /* NB: cannot fail */ if (error) { From owner-svn-src-user@FreeBSD.ORG Fri Jan 16 23:50:22 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07831065670; Fri, 16 Jan 2009 23:50:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DD7D8FC08; Fri, 16 Jan 2009 23:50:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GNoMuD021935; Fri, 16 Jan 2009 23:50:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GNoMdp021934; Fri, 16 Jan 2009 23:50:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162350.n0GNoMdp021934@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 23:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187352 - user/sam/wifi/sys/dev/ath/ath_hal X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 23:50:22 -0000 Author: sam Date: Fri Jan 16 23:50:22 2009 New Revision: 187352 URL: http://svn.freebsd.org/changeset/base/187352 Log: correct 11g regulatory for Argentina, it's allowed; with this there are no countries that disallow 11g operation so remove the special handling Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Modified: user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 23:25:49 2009 (r187351) +++ user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 23:50:22 2009 (r187352) @@ -295,9 +295,9 @@ enum { APL2_ETSIC = 0x56, /* Venezuela */ APL5_WORLD = 0x58, /* Chile */ APL6_WORLD = 0x5B, /* Singapore */ - APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ - APL8_WORLD = 0x5D, /* Malaysia 5GHz */ - APL9_WORLD = 0x5E, /* Korea 5GHz */ + APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ + APL8_WORLD = 0x5D, /* Malaysia 5GHz */ + APL9_WORLD = 0x5E, /* Korea 5GHz */ /* * World mode SKUs @@ -606,7 +606,6 @@ static REG_DMN_PAIR_MAPPING regDomainPai typedef struct { HAL_CTRY_CODE countryCode; HAL_REG_DOMAIN regDmnEnum; - HAL_BOOL allow11g; HAL_BOOL allow11aTurbo; HAL_BOOL allow11gTurbo; HAL_BOOL allow11ng20; @@ -616,147 +615,147 @@ typedef struct { } COUNTRY_CODE_TO_ENUM_RD; static COUNTRY_CODE_TO_ENUM_RD allCountries[] = { - {CTRY_DEBUG, NO_ENUMRD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_DEFAULT, DEF_REGDMN, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_ALBANIA, NULL1_WORLD, YES, NO, YES, YES, NO, NO, NO }, - {CTRY_ALGERIA, NULL1_WORLD, YES, NO, YES, YES, NO, NO, NO }, - {CTRY_ARGENTINA, APL3_WORLD, NO, NO, NO, NO, NO, NO, NO }, - {CTRY_ARMENIA, ETSI4_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_AUSTRALIA, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_AUSTRIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_AZERBAIJAN, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_BAHRAIN, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_BELARUS, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_BELGIUM, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_BELIZE, APL1_ETSIC, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_BOLIVIA, APL1_ETSIC, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_BRAZIL, FCC3_WORLD, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_BRUNEI_DARUSSALAM,APL1_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_BULGARIA, ETSI6_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_CANADA, FCC2_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_CHILE, APL6_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_CHINA, APL1_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_COLOMBIA, FCC1_FCCA, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_COSTA_RICA, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_CROATIA, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_CYPRUS, ETSI1_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_CZECH, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_DENMARK, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_DOMINICAN_REPUBLIC,FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_ECUADOR, NULL1_WORLD, NO, NO, NO, NO, NO, NO, NO }, - {CTRY_EGYPT, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_EL_SALVADOR, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_ESTONIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_FINLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_FRANCE, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_FRANCE2, ETSI3_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_GEORGIA, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_GERMANY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_GREECE, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_GUATEMALA, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_GZ901, GZ901_WORLD, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_HONDURAS, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_HONG_KONG, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_HUNGARY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_ICELAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_INDIA, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_INDONESIA, APL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_IRAN, APL1_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_IRELAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_ISRAEL, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_ITALY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_JAPAN, MKK1_MKKA, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_JAPAN1, MKK1_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN2, MKK1_FCCA, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN3, MKK2_MKKA, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN4, MKK1_MKKA1, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN5, MKK1_MKKA2, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN6, MKK1_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JAPAN7, MKK3_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN8, MKK3_MKKA2, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN9, MKK3_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JAPAN10, MKK4_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN11, MKK4_MKKA2, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN12, MKK4_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JAPAN13, MKK5_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN14, MKK5_MKKA2, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN15, MKK5_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JAPAN16, MKK6_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN17, MKK6_MKKA2, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN18, MKK6_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JAPAN19, MKK7_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN20, MKK7_MKKA2, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_JAPAN21, MKK7_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JAPAN22, MKK8_MKKB, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN23, MKK8_MKKA2, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_JAPAN24, MKK8_MKKC, YES, NO, NO, NO, NO, NO, NO }, - - {CTRY_JORDAN, APL4_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_KAZAKHSTAN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_KOREA_NORTH, APL2_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_KOREA_ROC, APL2_WORLD, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_KOREA_ROC2, APL2_WORLD, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_KOREA_ROC3, APL9_WORLD, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_KUWAIT, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_LATVIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_LEBANON, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_LIECHTENSTEIN,ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_LITHUANIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_LUXEMBOURG, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_MACAU, FCC2_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_MACEDONIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_MALAYSIA, APL8_WORLD, YES, NO, NO, YES, NO, YES, NO }, - {CTRY_MALTA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_MEXICO, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_MONACO, ETSI4_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_MOROCCO, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_NETHERLANDS, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_NEW_ZEALAND, FCC2_ETSIC, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_NORWAY, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_OMAN, APL6_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_PAKISTAN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_PANAMA, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_PERU, APL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_PHILIPPINES, FCC3_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_POLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_PORTUGAL, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_PUERTO_RICO, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_QATAR, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_ROMANIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_RUSSIA, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_SAUDI_ARABIA,FCC2_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_SINGAPORE, APL6_WORLD, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_SLOVAKIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_SLOVENIA, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_SOUTH_AFRICA,FCC3_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_SPAIN, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_SR9, SR9_WORLD, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_SWEDEN, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_SWITZERLAND, ETSI1_WORLD, YES, NO, YES, YES,YES, YES,YES }, - {CTRY_SYRIA, NULL1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_TAIWAN, APL3_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_THAILAND, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_TRINIDAD_Y_TOBAGO,ETSI4_WORLD,YES, NO, YES, YES,YES, YES, NO }, - {CTRY_TUNISIA, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_TURKEY, ETSI3_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_UKRAINE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_UAE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_UNITED_KINGDOM, ETSI1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_UNITED_STATES, FCC1_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_UNITED_STATES_FCC49,FCC4_FCCA,YES, YES, YES, YES,YES, YES,YES }, - {CTRY_URUGUAY, FCC1_WORLD, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_UZBEKISTAN, FCC3_FCCA, YES, YES, YES, YES,YES, YES,YES }, - {CTRY_VENEZUELA, APL2_ETSIC, YES, NO, YES, YES,YES, YES, NO }, - {CTRY_VIET_NAM, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_XR9, XR9_WORLD, YES, NO, NO, NO, NO, NO, NO }, - {CTRY_YEMEN, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO }, - {CTRY_ZIMBABWE, NULL1_WORLD, YES, NO, YES, YES,YES, NO, NO } + {CTRY_DEBUG, NO_ENUMRD, YES, YES, YES,YES, YES,YES }, + {CTRY_DEFAULT, DEF_REGDMN, YES, YES, YES,YES, YES,YES }, + {CTRY_ALBANIA, NULL1_WORLD, NO, YES, YES, NO, NO, NO }, + {CTRY_ALGERIA, NULL1_WORLD, NO, YES, YES, NO, NO, NO }, + {CTRY_ARGENTINA, APL3_WORLD, NO, NO, NO, NO, NO, NO }, + {CTRY_ARMENIA, ETSI4_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_AUSTRALIA, FCC2_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_AUSTRIA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_AZERBAIJAN, ETSI4_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_BAHRAIN, APL6_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_BELARUS, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_BELGIUM, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_BELIZE, APL1_ETSIC, YES, YES, YES,YES, YES,YES }, + {CTRY_BOLIVIA, APL1_ETSIC, YES, YES, YES,YES, YES,YES }, + {CTRY_BRAZIL, FCC3_WORLD, NO, NO, YES, NO, YES, NO }, + {CTRY_BRUNEI_DARUSSALAM,APL1_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_BULGARIA, ETSI6_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_CANADA, FCC2_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_CHILE, APL6_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_CHINA, APL1_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_COLOMBIA, FCC1_FCCA, NO, YES, YES,YES, YES, NO }, + {CTRY_COSTA_RICA, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_CROATIA, ETSI3_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_CYPRUS, ETSI1_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_CZECH, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_DENMARK, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_DOMINICAN_REPUBLIC,FCC1_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_ECUADOR, NULL1_WORLD, NO, NO, NO, NO, NO, NO }, + {CTRY_EGYPT, ETSI3_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_EL_SALVADOR, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_ESTONIA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_FINLAND, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_FRANCE, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_FRANCE2, ETSI3_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_GEORGIA, ETSI4_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_GERMANY, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_GREECE, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_GUATEMALA, FCC1_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_GZ901, GZ901_WORLD, NO, NO, NO, NO, NO, NO }, + {CTRY_HONDURAS, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_HONG_KONG, FCC2_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_HUNGARY, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_ICELAND, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_INDIA, APL6_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_INDONESIA, APL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_IRAN, APL1_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_IRELAND, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_ISRAEL, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_ITALY, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_JAPAN, MKK1_MKKA, NO, NO, YES, NO, YES, NO }, + {CTRY_JAPAN1, MKK1_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN2, MKK1_FCCA, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN3, MKK2_MKKA, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN4, MKK1_MKKA1, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN5, MKK1_MKKA2, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN6, MKK1_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN7, MKK3_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN8, MKK3_MKKA2, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN9, MKK3_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN10, MKK4_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN11, MKK4_MKKA2, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN12, MKK4_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN13, MKK5_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN14, MKK5_MKKA2, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN15, MKK5_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN16, MKK6_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN17, MKK6_MKKA2, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN18, MKK6_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN19, MKK7_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN20, MKK7_MKKA2, NO, NO, YES, NO, YES, NO }, + {CTRY_JAPAN21, MKK7_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JAPAN22, MKK8_MKKB, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN23, MKK8_MKKA2, NO, NO, NO, NO, NO, NO }, + {CTRY_JAPAN24, MKK8_MKKC, NO, NO, NO, NO, NO, NO }, + + {CTRY_JORDAN, APL4_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_KAZAKHSTAN, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_KOREA_NORTH, APL2_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_KOREA_ROC, APL2_WORLD, NO, NO, YES, NO, YES, NO }, + {CTRY_KOREA_ROC2, APL2_WORLD, NO, NO, YES, NO, YES, NO }, + {CTRY_KOREA_ROC3, APL9_WORLD, NO, NO, YES, NO, YES, NO }, + {CTRY_KUWAIT, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_LATVIA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_LEBANON, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_LIECHTENSTEIN,ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_LITHUANIA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_LUXEMBOURG, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_MACAU, FCC2_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_MACEDONIA, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_MALAYSIA, APL8_WORLD, NO, NO, YES, NO, YES, NO }, + {CTRY_MALTA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_MEXICO, FCC1_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_MONACO, ETSI4_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_MOROCCO, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_NETHERLANDS, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_NEW_ZEALAND, FCC2_ETSIC, NO, YES, YES,YES, YES,YES }, + {CTRY_NORWAY, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_OMAN, APL6_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_PAKISTAN, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_PANAMA, FCC1_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_PERU, APL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_PHILIPPINES, FCC3_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_POLAND, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_PORTUGAL, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_PUERTO_RICO, FCC1_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_QATAR, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_ROMANIA, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_RUSSIA, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_SAUDI_ARABIA,FCC2_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_SINGAPORE, APL6_WORLD, YES, YES, YES,YES, YES,YES }, + {CTRY_SLOVAKIA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_SLOVENIA, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_SOUTH_AFRICA,FCC3_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_SPAIN, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_SR9, SR9_WORLD, NO, NO, NO, NO, NO, NO }, + {CTRY_SWEDEN, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_SWITZERLAND, ETSI1_WORLD, NO, YES, YES,YES, YES,YES }, + {CTRY_SYRIA, NULL1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_TAIWAN, APL3_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_THAILAND, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_TRINIDAD_Y_TOBAGO,ETSI4_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_TUNISIA, ETSI3_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_TURKEY, ETSI3_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_UKRAINE, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_UAE, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_UNITED_KINGDOM, ETSI1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_UNITED_STATES, FCC1_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_UNITED_STATES_FCC49,FCC4_FCCA,YES, YES, YES,YES, YES,YES }, + {CTRY_URUGUAY, FCC1_WORLD, NO, YES, YES,YES, YES, NO }, + {CTRY_UZBEKISTAN, FCC3_FCCA, YES, YES, YES,YES, YES,YES }, + {CTRY_VENEZUELA, APL2_ETSIC, NO, YES, YES,YES, YES, NO }, + {CTRY_VIET_NAM, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_XR9, XR9_WORLD, NO, NO, NO, NO, NO, NO }, + {CTRY_YEMEN, NULL1_WORLD, NO, YES, YES,YES, NO, NO }, + {CTRY_ZIMBABWE, NULL1_WORLD, NO, YES, YES,YES, NO, NO } }; /* Bit masks for DFS per regdomain */ @@ -2055,11 +2054,6 @@ ath_hal_getwmodesnreg(struct ath_hal *ah __func__, modesAvail, country->countryCode, country->regDmnEnum); /* Check country regulations for allowed modes */ - if (!country->allow11g && (modesAvail & HAL_MODE_11G_ALL)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: disallow all 11g\n", __func__); - modesAvail &= ~HAL_MODE_11G_ALL; - } if (isChanBitMaskZero(rd5GHz->chan11a) && (modesAvail & HAL_MODE_11A_ALL)) { HALDEBUG(ah, HAL_DEBUG_REGDOMAIN,