From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 10 07:18:36 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DED81065670; Sun, 10 Jan 2010 07:18:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB748FC12; Sun, 10 Jan 2010 07:18:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0A7IaPL052664; Sun, 10 Jan 2010 07:18:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A7IaE9052662; Sun, 10 Jan 2010 07:18:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001100718.o0A7IaE9052662@svn.freebsd.org> From: Xin LI Date: Sun, 10 Jan 2010 07:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 07:18:36 -0000 Author: delphij Date: Sun Jan 10 07:18:35 2010 New Revision: 201988 URL: http://svn.freebsd.org/changeset/base/201988 Log: MFC r201756: Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD revision 200726 and 200727). Reviewed by: mm@ Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 10 07:08:11 2010 (r201987) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 10 07:18:35 2010 (r201988) @@ -847,6 +847,12 @@ restore_object(struct restorearg *ra, ob if (err != 0 && err != ENOENT) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + if (err == ENOENT) { /* currently free, want to be allocated */ tx = dmu_tx_create(os); @@ -862,7 +868,6 @@ restore_object(struct restorearg *ra, ob dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen); @@ -870,12 +875,6 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); - if (drro->drr_bonuslen) { - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (ra->err) - return (ra->err); - } - tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 10 13:54:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF90106566B for ; Sun, 10 Jan 2010 13:54:20 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id 38D258FC12 for ; Sun, 10 Jan 2010 13:54:20 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 2E00617015; Sun, 10 Jan 2010 16:36:30 +0300 (MSK) Date: Sun, 10 Jan 2010 16:36:30 +0300 From: Maxim Dounin To: Xin LI Message-ID: <20100110133629.GF1063@mdounin.ru> References: <201001100718.o0A7IaE9052662@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001100718.o0A7IaE9052662@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 13:54:20 -0000 Hello! On Sun, Jan 10, 2010 at 07:18:36AM +0000, Xin LI wrote: > Author: delphij > Date: Sun Jan 10 07:18:35 2010 > New Revision: 201988 > URL: http://svn.freebsd.org/changeset/base/201988 > > Log: > MFC r201756: > > Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD > revision 200726 and 200727). For source control onnv-gate uses Mercurial, and this means that revision numbers make sense only for one particular clone. It make sense to record changeset hash instead, which is stable between clones. See here for more details: http://mercurial.selenic.com/wiki/RevisionNumber Just for the record: 7994:7a573dc88b73 8986:45c289aff7c9 Maxim Dounin From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 10 16:36:43 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C03911065679; Sun, 10 Jan 2010 16:36:43 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEC898FC19; Sun, 10 Jan 2010 16:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0AGahuj080266; Sun, 10 Jan 2010 16:36:43 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGahlB080263; Sun, 10 Jan 2010 16:36:43 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101636.o0AGahlB080263@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202014 - in stable/7/sys: dev/hwpmc sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:36:43 -0000 Author: fabient Date: Sun Jan 10 16:36:43 2010 New Revision: 202014 URL: http://svn.freebsd.org/changeset/base/202014 Log: MFC 201021: Log process mappings for existing processes at PMC start time. Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c stable/7/sys/sys/pmc.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:30:54 2010 (r202013) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:36:43 2010 (r202014) @@ -63,6 +63,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include + /* * Types */ @@ -1622,6 +1628,151 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + vm_map_t map; + struct vnode *vp; + struct vmspace *vm; + vm_map_entry_t entry; + vm_offset_t last_end; + u_int last_timestamp; + struct vnode *last_vp; + vm_offset_t start_addr; + vm_object_t obj, lobj, tobj; + char *fullpath, *freepath; + + last_vp = NULL; + last_end = (vm_offset_t) 0; + fullpath = freepath = NULL; + + if ((vm = vmspace_acquire_ref(p)) == NULL) + return; + + map = &vm->vm_map; + vm_map_lock_read(map); + + for (entry = map->header.next; entry != &map->header; entry = entry->next) { + + if (entry == NULL) { + PMCDBG(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly " + "NULL! pid=%d vm_map=%p\n", p->p_pid, map); + break; + } + + /* + * We only care about executable map entries. + */ + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) || + !(entry->protection & VM_PROT_EXECUTE) || + (entry->object.vm_object == NULL)) { + continue; + } + + obj = entry->object.vm_object; + VM_OBJECT_LOCK(obj); + + /* + * Walk the backing_object list to find the base + * (non-shadowed) vm_object. + */ + for (lobj = tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + } + + /* + * At this point lobj is the base vm_object and it is locked. + */ + if (lobj == NULL) { + PMCDBG(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! pid=%d " + "vm_map=%p vm_obj=%p\n", p->p_pid, map, obj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + if (lobj->type != OBJT_VNODE || lobj->handle == NULL) { + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + /* + * Skip contiguous regions that point to the same + * vnode, so we don't emit redundant MAP-IN + * directives. + */ + if (entry->start == last_end && lobj->handle == last_vp) { + last_end = entry->end; + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + /* + * We don't want to keep the proc's vm_map or this + * vm_object locked while we walk the pathname, since + * vn_fullpath() can sleep. However, if we drop the + * lock, it's possible for concurrent activity to + * modify the vm_map list. To protect against this, + * we save the vm_map timestamp before we release the + * lock, and check it after we reacquire the lock + * below. + */ + start_addr = entry->start; + last_end = entry->end; + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + + vp = lobj->handle; + vref(vp); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + + VM_OBJECT_UNLOCK(obj); + + freepath = NULL; + pmc_getfilename(vp, &fullpath, &freepath); + last_vp = vp; + vrele(vp); + vp = NULL; + pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); + if (freepath) + free(freepath, M_TEMP); + + vm_map_lock_read(map); + + /* + * If our saved timestamp doesn't match, this means + * that the vm_map was modified out from under us and + * we can't trust our current "entry" pointer. Do a + * new lookup for this entry. If there is no entry + * for this address range, vm_map_lookup_entry() will + * return the previous one, so we always want to go to + * entry->next on the next loop iteration. + * + * There is an edge condition here that can occur if + * there is no entry at or before this address. In + * this situation, vm_map_lookup_entry returns + * &map->header, which would cause our loop to abort + * without processing the rest of the map. However, + * in practice this will never happen for process + * vm_map. This is because the executable's text + * segment is the first mapping in the proc's address + * space, and this mapping is never removed until the + * process exits, so there will always be a non-header + * entry at or before the requested address for + * vm_map_lookup_entry to return. + */ + if (map->timestamp != last_timestamp) + vm_map_lookup_entry(map, last_end - 1, &entry); + } + + vm_map_unlock_read(map); + vmspace_free(vm); + return; } /* @@ -1900,7 +2051,7 @@ pmc_allocate_owner_descriptor(struct pro /* allocate space for N pointers and one descriptor struct */ po = malloc(sizeof(struct pmc_owner), M_PMC, M_WAITOK|M_ZERO); - po->po_sscount = po->po_error = po->po_flags = 0; + po->po_sscount = po->po_error = po->po_flags = po->po_logprocmaps = 0; po->po_file = NULL; po->po_owner = p; po->po_kthread = NULL; @@ -2523,8 +2674,15 @@ pmc_start(struct pmc *pm) po->po_sscount++; } - /* Log mapping information for all processes in the system. */ - pmc_log_all_process_mappings(po); + /* + * Log mapping information for all existing processes in the + * system. Subsequent mappings are logged as they happen; + * see pmc_process_mmap(). + */ + if (po->po_logprocmaps == 0) { + pmc_log_all_process_mappings(po); + po->po_logprocmaps = 1; + } /* * Move to the CPU associated with this Modified: stable/7/sys/sys/pmc.h ============================================================================== --- stable/7/sys/sys/pmc.h Sun Jan 10 16:30:54 2010 (r202013) +++ stable/7/sys/sys/pmc.h Sun Jan 10 16:36:43 2010 (r202014) @@ -755,7 +755,8 @@ struct pmc_owner { struct pmclog_buffer *po_curbuf; /* current log buffer */ struct file *po_file; /* file reference */ int po_error; /* recorded error */ - int po_sscount; /* # SS PMCs owned */ + short po_sscount; /* # SS PMCs owned */ + short po_logprocmaps; /* global mappings done */ }; #define PMC_PO_OWNS_LOGFILE 0x00000001 /* has a log file */ From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 10 16:40:15 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070031065672; Sun, 10 Jan 2010 16:40:15 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D18088FC15; Sun, 10 Jan 2010 16:40:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0AGeEfE081094; Sun, 10 Jan 2010 16:40:14 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGeE0r081092; Sun, 10 Jan 2010 16:40:14 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101640.o0AGeE0r081092@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202015 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:40:15 -0000 Author: fabient Date: Sun Jan 10 16:40:14 2010 New Revision: 202015 URL: http://svn.freebsd.org/changeset/base/202015 Log: MFC 201023: * Support the L1D_CACHE_LD event on Core2 processors. * Correct a group of typos: for Core2 programmable events, check user supplied umask values against the correct event descriptor field. Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:36:43 2010 (r202014) +++ stable/7/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:40:14 2010 (r202015) @@ -669,7 +669,7 @@ static struct iap_event_descr iap_events IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUS), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUS), - IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC), + IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC | IAP_F_CC2), IAPDESCR(40H_21H, 0x40, 0x21, IAP_F_FM | IAP_F_CA), IAPDESCR(41H, 0x41, IAP_M_MESI, IAP_F_CC | IAP_F_CC2), @@ -1419,17 +1419,17 @@ iap_allocate_pmc(int cpu, int ri, struct mask = 0; - if (ie->iap_flags & IAP_M_CORE) { + if (ie->iap_umask & IAP_M_CORE) { if ((c = (config & IAP_F_CORE)) != IAP_CORE_ALL && c != IAP_CORE_THIS) return (EINVAL); mask |= IAP_F_CORE; } - if (ie->iap_flags & IAP_M_AGENT) + if (ie->iap_umask & IAP_M_AGENT) mask |= IAP_F_AGENT; - if (ie->iap_flags & IAP_M_PREFETCH) { + if (ie->iap_umask & IAP_M_PREFETCH) { if ((c = (config & IAP_F_PREFETCH)) == IAP_PREFETCH_RESERVED) @@ -1438,16 +1438,16 @@ iap_allocate_pmc(int cpu, int ri, struct mask |= IAP_F_PREFETCH; } - if (ie->iap_flags & IAP_M_MESI) + if (ie->iap_umask & IAP_M_MESI) mask |= IAP_F_MESI; - if (ie->iap_flags & IAP_M_SNOOPRESPONSE) + if (ie->iap_umask & IAP_M_SNOOPRESPONSE) mask |= IAP_F_SNOOPRESPONSE; - if (ie->iap_flags & IAP_M_SNOOPTYPE) + if (ie->iap_umask & IAP_M_SNOOPTYPE) mask |= IAP_F_SNOOPTYPE; - if (ie->iap_flags & IAP_M_TRANSITION) + if (ie->iap_umask & IAP_M_TRANSITION) mask |= IAP_F_TRANSITION; /* From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 10 16:43:45 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0A34106566B; Sun, 10 Jan 2010 16:43:45 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 900258FC12; Sun, 10 Jan 2010 16:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0AGhjRX081889; Sun, 10 Jan 2010 16:43:45 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGhjvT081887; Sun, 10 Jan 2010 16:43:45 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101643.o0AGhjvT081887@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202016 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:43:45 -0000 Author: fabient Date: Sun Jan 10 16:43:45 2010 New Revision: 202016 URL: http://svn.freebsd.org/changeset/base/202016 Log: MFC 201151: Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele(). Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:40:14 2010 (r202015) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:43:45 2010 (r202016) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1628,6 +1629,7 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + int locked; vm_map_t map; struct vnode *vp; struct vmspace *vm; @@ -1736,7 +1738,11 @@ pmc_log_process_mappings(struct pmc_owne freepath = NULL; pmc_getfilename(vp, &fullpath, &freepath); last_vp = vp; + + locked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); + VFS_UNLOCK_GIANT(locked); + vp = NULL; pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); if (freepath) From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 10 17:40:15 2010 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D50AA106566B; Sun, 10 Jan 2010 17:40:15 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6466A8FC0A; Sun, 10 Jan 2010 17:40:14 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 712F3A5519A; Mon, 11 Jan 2010 01:40:12 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id 9zRp9o0GzZ6g; Mon, 11 Jan 2010 01:39:59 +0800 (CST) Received: from delta.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id AAC68A550C0; Mon, 11 Jan 2010 01:39:56 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=frLJyAzcuHwxyV79oCRrGU163RsvS+wJrvdJx2ujl+Cu/kK9jdly2hie4scl/U/vF OmCfwwHBe8XA1r3TIeo0g== Message-ID: <4B4A10E8.9050504@delphij.net> Date: Sun, 10 Jan 2010 09:39:52 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091220 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Maxim Dounin References: <201001100718.o0A7IaE9052662@svn.freebsd.org> <20100110133629.GF1063@mdounin.ru> In-Reply-To: <20100110133629.GF1063@mdounin.ru> X-Enigmail-Version: 1.0 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 17:40:15 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010/01/10 05:36, Maxim Dounin wrote: > Hello! > > On Sun, Jan 10, 2010 at 07:18:36AM +0000, Xin LI wrote: > >> Author: delphij >> Date: Sun Jan 10 07:18:35 2010 >> New Revision: 201988 >> URL: http://svn.freebsd.org/changeset/base/201988 >> >> Log: >> MFC r201756: >> >> Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD >> revision 200726 and 200727). > > For source control onnv-gate uses Mercurial, and this means that > revision numbers make sense only for one particular clone. It > make sense to record changeset hash instead, which is stable > between clones. See here for more details: > > http://mercurial.selenic.com/wiki/RevisionNumber > > Just for the record: > > 7994:7a573dc88b73 > 8986:45c289aff7c9 Thanks for the hint, I'll make sure that these information be included next time. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLShDoAAoJEATO+BI/yjfBBQ8H/1YjObGpgT9uV7T6P65DNuSa 7sT279l89dafIYcaeBGiCkeajW9mQFM82Z3o3jJ1m4RLrZltoi7IlSzwUmQvs3oY wXOo/58x17N8XFTd2fB0Yxl/ph80hx3tB8G0jb9kqYlQGW+zsMKYyhemUsHUBexs dUu6Pn3bmVpuC1URNBjRaV+oqaLb8PE06+ZBZNJ4/iLSM569Twl+VepON+AIl0M3 JMq/EDB62Ad2pXR8tYNGRU8KVYfjn6AqsNiIQA/dMmBXdx7INmvIU9IU9SpP9ok6 AgBrh8FQqWBGgkaOuA2Tlt2OSeRHRQmSuJNywYPVP8SaaU+LhqoOYEd2l2lE7qU= =go2M -----END PGP SIGNATURE----- From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 11 05:26:19 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 192DA106568D; Mon, 11 Jan 2010 05:26:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F16408FC16; Mon, 11 Jan 2010 05:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0B5QIHW062288; Mon, 11 Jan 2010 05:26:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B5QI4a062283; Mon, 11 Jan 2010 05:26:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001110526.o0B5QI4a062283@svn.freebsd.org> From: Christian Brueffer Date: Mon, 11 Jan 2010 05:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202069 - in stable/7/share/man: man7 man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 05:26:19 -0000 Author: brueffer Date: Mon Jan 11 05:26:18 2010 New Revision: 202069 URL: http://svn.freebsd.org/changeset/base/202069 Log: MFC: r201538, r201539 Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened almost three years ago in r166794. Add a missing word. Modified: stable/7/share/man/man7/security.7 stable/7/share/man/man9/VFS.9 stable/7/share/man/man9/VFS_CHECKEXP.9 stable/7/share/man/man9/VFS_FHTOVP.9 Directory Properties: stable/7/share/man/man7/ (props changed) stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man7/security.7 ============================================================================== --- stable/7/share/man/man7/security.7 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man7/security.7 Mon Jan 11 05:26:18 2010 (r202069) @@ -88,7 +88,7 @@ incur on the system under adverse condit Brute-force network attacks are harder to deal with. A spoofed-packet attack, for example, is nearly impossible to stop short of cutting your system off from the Internet. -It may not be able to take your machine down, but it can fill up Internet +It may not be able to take your machine down, but it can fill up your Internet pipe. .Pp A user account compromise is even more common than a DoS attack. Modified: stable/7/share/man/man9/VFS.9 ============================================================================== --- stable/7/share/man/man9/VFS.9 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man9/VFS.9 Mon Jan 11 05:26:18 2010 (r202069) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd January 4, 2010 .Os .Dt VFS 9 .Sh NAME @@ -53,7 +53,7 @@ rather than implementing empty functions .Xr VFS_SYNC 9 , .Xr VFS_UNMOUNT 9 , .Xr VFS_VGET 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: stable/7/share/man/man9/VFS_CHECKEXP.9 ============================================================================== --- stable/7/share/man/man9/VFS_CHECKEXP.9 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man9/VFS_CHECKEXP.9 Mon Jan 11 05:26:18 2010 (r202069) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_CHECKEXP 9 .Sh NAME @@ -81,7 +81,7 @@ and .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_FHTOVP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: stable/7/share/man/man9/VFS_FHTOVP.9 ============================================================================== --- stable/7/share/man/man9/VFS_FHTOVP.9 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man9/VFS_FHTOVP.9 Mon Jan 11 05:26:18 2010 (r202069) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_FHTOVP 9 .Sh NAME @@ -76,7 +76,7 @@ The locked vnode for the file will be re .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_CHECKEXP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 11 18:44:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 166E5106568B; Mon, 11 Jan 2010 18:44:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04A658FC1C; Mon, 11 Jan 2010 18:44:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BIif21044074; Mon, 11 Jan 2010 18:44:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BIifA8044072; Mon, 11 Jan 2010 18:44:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001111844.o0BIifA8044072@svn.freebsd.org> From: John Baldwin Date: Mon, 11 Jan 2010 18:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202101 - stable/7/etc/defaults X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 18:44:42 -0000 Author: jhb Date: Mon Jan 11 18:44:41 2010 New Revision: 202101 URL: http://svn.freebsd.org/changeset/base/202101 Log: MFC 201522: Expose the upper 256 ptys in the default devfs rules. I should have updated this when expanding the old pty(4) driver to use 512 ptys by default. This is more important for 7.x. Modified: stable/7/etc/defaults/devfs.rules Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/devfs.rules ============================================================================== --- stable/7/etc/defaults/devfs.rules Mon Jan 11 18:42:29 2010 (r202100) +++ stable/7/etc/defaults/devfs.rules Mon Jan 11 18:44:41 2010 (r202101) @@ -44,6 +44,14 @@ add path 'ptyP*' unhide add path 'ptyQ*' unhide add path 'ptyR*' unhide add path 'ptyS*' unhide +add path 'ptyl*' unhide +add path 'ptym*' unhide +add path 'ptyn*' unhide +add path 'ptyo*' unhide +add path 'ptyL*' unhide +add path 'ptyM*' unhide +add path 'ptyN*' unhide +add path 'ptyO*' unhide add path 'ttyp*' unhide add path 'ttyq*' unhide add path 'ttyr*' unhide @@ -52,6 +60,14 @@ add path 'ttyP*' unhide add path 'ttyQ*' unhide add path 'ttyR*' unhide add path 'ttyS*' unhide +add path 'ttyl*' unhide +add path 'ttym*' unhide +add path 'ttyn*' unhide +add path 'ttyo*' unhide +add path 'ttyL*' unhide +add path 'ttyM*' unhide +add path 'ttyN*' unhide +add path 'ttyO*' unhide add path 'pts/*' unhide add path 'pty/*' unhide add path fd unhide From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 11 21:23:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E92A9106568B; Mon, 11 Jan 2010 21:23:59 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7B268FC16; Mon, 11 Jan 2010 21:23:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BLNx4C080341; Mon, 11 Jan 2010 21:23:59 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BLNxgM080338; Mon, 11 Jan 2010 21:23:59 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112123.o0BLNxgM080338@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 21:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202117 - stable/7/sys/dev/mxge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:24:00 -0000 Author: gallatin Date: Mon Jan 11 21:23:59 2010 New Revision: 202117 URL: http://svn.freebsd.org/changeset/base/202117 Log: MFC: Merge older mxge(4) fixes/improvements from head: r193250: Set an rx jumbo cluster to the correct size for bus_dmamap_load_mbuf_sg() r194836: Initial mtu r195818: Rename hw.mxge.rss_hash_type -> hw.mxge.rss_hashtype r197391: Add support for TX throttling Modified: stable/7/sys/dev/mxge/if_mxge.c stable/7/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Mon Jan 11 21:21:30 2010 (r202116) +++ stable/7/sys/dev/mxge/if_mxge.c Mon Jan 11 21:23:59 2010 (r202117) @@ -99,6 +99,8 @@ static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; +static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = "mxge_ethp_z8e"; static char *mxge_fw_aligned = "mxge_eth_z8e"; static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; @@ -589,10 +591,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc->throttle) + force_firmware = sc->throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1300,10 +1305,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); + if (sc->throttle) { + cmd.data0 = sc->throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + &cmd)) { + device_printf(sc->dev, + "can't enable throttle\n"); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc->throttle; + err = sysctl_handle_int(oidp, &throttle, arg2, req); + if (err != 0) { + return err; + } + + if (throttle == sc->throttle) + return 0; + + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; + + mtx_lock(&sc->driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); + if (err == 0) + sc->throttle = throttle; + mtx_unlock(&sc->driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1495,6 +1538,12 @@ mxge_add_sysctls(mxge_softc_t *sc) "I", "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "throttle", + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + "I", "transmit throttling"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -2206,7 +2255,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m->m_len = rx->cl_size; + m->m_len = rx->mlen; err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3240,6 +3289,8 @@ mxge_slice_open(struct mxge_slice_state } ss->rx_big.nbufs = nbufs; ss->rx_big.cl_size = cl_size; + ss->rx_big.mlen = ss->sc->ifp->if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { map = ss->rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); @@ -3840,6 +3891,9 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt); TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc); TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; @@ -3854,6 +3908,15 @@ mxge_fetch_tunables(mxge_softc_t *sc) || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; } + if (mxge_initial_mtu > ETHERMTU_JUMBO || + mxge_initial_mtu < ETHER_MIN_LEN) + mxge_initial_mtu = ETHERMTU_JUMBO; + + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) + mxge_throttle = MXGE_MAX_THROTTLE; + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) + mxge_throttle = MXGE_MIN_THROTTLE; + sc->throttle = mxge_throttle; } @@ -4414,9 +4477,9 @@ mxge_attach(device_t dev) mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); - /* ether_ifattach sets mtu to 1500 */ - if (ifp->if_capabilities & IFCAP_JUMBO_MTU) - ifp->if_mtu = 9000; + /* ether_ifattach sets mtu to ETHERMTU */ + if (mxge_initial_mtu != ETHERMTU) + mxge_change_mtu(sc, mxge_initial_mtu); mxge_add_sysctls(sc); callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); Modified: stable/7/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/7/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:21:30 2010 (r202116) +++ stable/7/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:23:59 2010 (r202117) @@ -120,6 +120,7 @@ typedef struct int cl_size; int alloc_fail; int mask; /* number of rx slots -1 */ + int mlen; } mxge_rx_ring_t; typedef struct @@ -243,6 +244,7 @@ struct mxge_softc { int fw_multicast_support; int link_width; int max_mtu; + int throttle; int tx_defrag; int media_flags; int need_media_probe; @@ -271,6 +273,8 @@ struct mxge_softc { #define MXGE_PCI_REV_Z8ES 1 #define MXGE_XFP_COMPLIANCE_BYTE 131 #define MXGE_SFP_COMPLIANCE_BYTE 3 +#define MXGE_MIN_THROTTLE 416 +#define MXGE_MAX_THROTTLE 4096 #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 12 06:04:33 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F396A106566C; Tue, 12 Jan 2010 06:04:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E02BA8FC17; Tue, 12 Jan 2010 06:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0C64Wro095957; Tue, 12 Jan 2010 06:04:32 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C64WmX095949; Tue, 12 Jan 2010 06:04:32 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120604.o0C64WmX095949@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 06:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202135 - in stable/7/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 06:04:33 -0000 Author: brooks Date: Tue Jan 12 06:04:32 2010 New Revision: 202135 URL: http://svn.freebsd.org/changeset/base/202135 Log: MFC r201443: Add vlan(4) to all GENERIC kernels. Modified: stable/7/sys/amd64/conf/GENERIC stable/7/sys/i386/conf/GENERIC stable/7/sys/ia64/conf/GENERIC stable/7/sys/pc98/conf/GENERIC stable/7/sys/powerpc/conf/GENERIC stable/7/sys/sparc64/conf/GENERIC stable/7/sys/sun4v/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/amd64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -254,6 +254,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/i386/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -268,6 +268,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/ia64/conf/GENERIC ============================================================================== --- stable/7/sys/ia64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/ia64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -143,6 +143,7 @@ device sbp # SCSI over FireWire (need # Various (pseudo) devices device ether # Ethernet support +device vlan # 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop # Network loopback Modified: stable/7/sys/pc98/conf/GENERIC ============================================================================== --- stable/7/sys/pc98/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/pc98/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -222,6 +222,7 @@ device xe # Xircom pccard Ethernet device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/powerpc/conf/GENERIC ============================================================================== --- stable/7/sys/powerpc/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/powerpc/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -107,6 +107,7 @@ device fxp # Intel EtherExpress PRO/10 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/sparc64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -201,6 +201,7 @@ device ath_rate_sample # SampleRate tx device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/sun4v/conf/GENERIC ============================================================================== --- stable/7/sys/sun4v/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/sun4v/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -156,6 +156,7 @@ device bge # Broadcom BCM570xx Gigabit device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 12 18:47:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9774110656C0; Tue, 12 Jan 2010 18:47:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85ED28FC08; Tue, 12 Jan 2010 18:47:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0CIlq25069548; Tue, 12 Jan 2010 18:47:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CIlqw6069546; Tue, 12 Jan 2010 18:47:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001121847.o0CIlqw6069546@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jan 2010 18:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202165 - stable/7/usr.sbin/arp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 18:47:52 -0000 Author: jhb Date: Tue Jan 12 18:47:52 2010 New Revision: 202165 URL: http://svn.freebsd.org/changeset/base/202165 Log: MFC 201202: Use reallocf() to simplify some logic. Modified: stable/7/usr.sbin/arp/arp.c Directory Properties: stable/7/usr.sbin/arp/ (props changed) Modified: stable/7/usr.sbin/arp/arp.c ============================================================================== --- stable/7/usr.sbin/arp/arp.c Tue Jan 12 18:47:40 2010 (r202164) +++ stable/7/usr.sbin/arp/arp.c Tue Jan 12 18:47:52 2010 (r202165) @@ -472,7 +472,7 @@ search(u_long addr, action_fn *action) { int mib[6]; size_t needed; - char *lim, *buf, *newbuf, *next; + char *lim, *buf, *next; struct rt_msghdr *rtm; struct sockaddr_inarp *sin2; struct sockaddr_dl *sdl; @@ -491,13 +491,9 @@ search(u_long addr, action_fn *action) return 0; buf = NULL; for (;;) { - newbuf = realloc(buf, needed); - if (newbuf == NULL) { - if (buf != NULL) - free(buf); + buf = reallocf(buf, needed); + if (buf == NULL) errx(1, "could not reallocate memory"); - } - buf = newbuf; st = sysctl(mib, 6, buf, &needed, NULL, 0); if (st == 0 || errno != ENOMEM) break; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 12 20:06:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 667DB10656A4; Tue, 12 Jan 2010 20:06:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53E458FC13; Tue, 12 Jan 2010 20:06:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0CK64Ov087060; Tue, 12 Jan 2010 20:06:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CK64Jm087055; Tue, 12 Jan 2010 20:06:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001122006.o0CK64Jm087055@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jan 2010 20:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202169 - in stable/7: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 20:06:04 -0000 Author: jhb Date: Tue Jan 12 20:06:04 2010 New Revision: 202169 URL: http://svn.freebsd.org/changeset/base/202169 Log: MFC 201215: Add support for configuring vlan(4) interfaces as child devices similar to wlan(4) interfaces. vlan(4) interfaces are listed via a new 'vlans_' variable. If a vlan interface is a number, then that number is treated as the vlan tag for the interface and the interface will be named '.'. Otherwise, the vlan tag must be provided via a vlan parameter in a 'create_args_' variable. While I'm here, fix a few nits in rc.conf(5) and mention create_args_ in the description of cloned_interfaces. The changes for 7.x are a bit larger as they introduce childif_create() and childif_destroy() and move ifn_start() and ifn_stop() from rc.d/netif to network.subr. Modified: stable/7/etc/defaults/rc.conf stable/7/etc/network.subr stable/7/etc/rc.d/netif stable/7/share/man/man5/rc.conf.5 (contents, props changed) Directory Properties: stable/7/etc/ (props changed) stable/7/share/man/man5/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/etc/defaults/rc.conf Tue Jan 12 20:06:04 2010 (r202169) @@ -192,6 +192,8 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device +#create_arg_vlan0="vlan 102" # vlan tag for vlan0 device #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. # #autobridge_interfaces="bridge0" # List of bridges to check Modified: stable/7/etc/network.subr ============================================================================== --- stable/7/etc/network.subr Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/etc/network.subr Tue Jan 12 20:06:04 2010 (r202169) @@ -30,6 +30,48 @@ # Requires that rc.conf be loaded first. # +# ifn_start ifn +# Bring up and configure an interface. If some configuration is +# applied print the interface configuration. +# +ifn_start() +{ + local ifn cfg + ifn="$1" + cfg=1 + + [ -z "$ifn" ] && err 1 "ifn_start called without an interface" + + ifscript_up ${ifn} && cfg=0 + ifconfig_up ${ifn} && cfg=0 + ipv4_up ${ifn} && cfg=0 + ipx_up ${ifn} && cfg=0 + childif_create ${ifn} && cfg=0 + + return $cfg +} + +# ifn_stop ifn +# Shutdown and de-configure an interface. If action is taken +# print the interface name. +# +ifn_stop() +{ + local ifn cfg + ifn="$1" + cfg=1 + + [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" + + ipx_down ${ifn} && cfg=0 + ipv4_down ${ifn} && cfg=0 + ifconfig_down ${ifn} && cfg=0 + ifscript_down ${ifn} && cfg=0 + childif_destroy ${ifn} && cfg=0 + + return $cfg +} + # ifconfig_up if # Evaluate ifconfig(8) arguments for interface $if and # run ifconfig(8) with those arguments. It returns 0 if @@ -452,6 +494,70 @@ clone_down() debug "Destroyed clones: ${_list}" } +# childif_create +# Create and configure child interfaces. Return 0 if child +# interfaces are created. +# +childif_create() +{ + local cfg child child_vlans create_args ifn i + cfg=1 + ifn=$1 + + # Create vlan interfaces + child_vlans=`get_if_var $ifn vlans_IF` + + if [ -n "${child_vlans}" ]; then + load_kld if_vlan + fi + + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + create_args=`get_if_var $child create_args_IF` + ifconfig $child create ${create_args} && cfg=0 + else + create_args="vlandev $ifn `get_if_var $child create_args_IF`" + if expr $child : 'vlan[0-9][0-9]*$' >/dev/null 2>&1; then + ifconfig $child create ${create_args} && cfg=0 + else + i=`ifconfig vlan create ${create_args}` + ifconfig $i name $child && cfg=0 + fi + fi + if autoif $child; then + ifn_start $child + fi + done + + return ${cfg} +} + +# childif_destroy +# Destroy child interfaces. +# +childif_destroy() +{ + local cfg child child_vlans ifn + cfg=1 + + child_vlans=`get_if_var $ifn vlans_IF` + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + fi + if ! ifexists $child; then + continue + fi + if autoif $child; then + ifn_stop $child + fi + ifconfig $child destroy && cfg=0 + done + + return ${cfg} +} + # Create netgraph nodes. # ng_mkpeer() { Modified: stable/7/etc/rc.d/netif ============================================================================== --- stable/7/etc/rc.d/netif Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/etc/rc.d/netif Tue Jan 12 20:06:04 2010 (r202169) @@ -149,37 +149,5 @@ network_common() debug "The following interfaces were not configured: $_fail" } -ifn_start() -{ - local ifn cfg - ifn="$1" - cfg=1 - - [ -z "$ifn" ] && return 1 - - ifscript_up ${ifn} && cfg=0 - ifconfig_up ${ifn} && cfg=0 - ipv4_up ${ifn} && cfg=0 - ipx_up ${ifn} && cfg=0 - - return $cfg -} - -ifn_stop() -{ - local ifn cfg - ifn="$1" - cfg=1 - - [ -z "$ifn" ] && return 1 - - ipx_down ${ifn} && cfg=0 - ipv4_down ${ifn} && cfg=0 - ifconfig_down ${ifn} && cfg=0 - ifscript_down ${ifn} && cfg=0 - - return $cfg -} - load_rc_config $name run_rc_command $* Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/share/man/man5/rc.conf.5 Tue Jan 12 20:06:04 2010 (r202169) @@ -1149,6 +1149,45 @@ and .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n variables. .Pp +If a +.Va vlans_ Ns Aq Ar interface +variable is set, +a +.Xr vlan 4 +interface will be created for each item in the list with the +.Ar vlandev +argument set to +.Ar interface . +If a vlan interface's name is a number, +then that number is used as the vlan tag and the new vlan interface is +named +.Ar interface . Ns Ar tag . +Otherwise, +the vlan tag must be specified via a +.Va vlan +parameter in the +.Va create_args_ Ns Aq Ar interface +variable. +.Pp +To create a vlan device named +.Li em0.101 +on +.Li em0 +with the vlan tag 101: +.Bd -literal +vlans_em0="101" +.Ed +.Pp +To create a vlan device named +.Li myvlan +on +.Li em0 +with the vlan tag 102: +.Bd -literal +vlans_em0="myvlan" +create_args_myvlan="vlan 102" +.Ed +.Pp If the .Va ifconfig_ Ns Aq Ar interface contains the keyword @@ -1205,7 +1244,7 @@ This is intended to replace the no longe .Va pccard_ifconfig variable. .Pp -It is also possible to rename interface by doing: +It is also possible to rename an interface by doing: .Bd -literal ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" @@ -1242,6 +1281,12 @@ Now this works only for IPv6 link local .It Va cloned_interfaces .Pq Vt str Set to the list of clonable network interfaces to create on this host. +Further cloning arguments may be passed to the +.Xr ifconfig 8 +.Cm create +command for each interface by setting the +.Va create_args_ Ns Aq Ar interface +variable. Entries in .Va cloned_interfaces are automatically appended to From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 12 22:28:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89CDF1065670; Tue, 12 Jan 2010 22:28:59 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77DE58FC17; Tue, 12 Jan 2010 22:28:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0CMSx18019024; Tue, 12 Jan 2010 22:28:59 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CMSxxe019022; Tue, 12 Jan 2010 22:28:59 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001122228.o0CMSxxe019022@svn.freebsd.org> From: Christian Brueffer Date: Tue, 12 Jan 2010 22:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202179 - stable/7/share/man/man4/man4.i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 22:28:59 -0000 Author: brueffer Date: Tue Jan 12 22:28:59 2010 New Revision: 202179 URL: http://svn.freebsd.org/changeset/base/202179 Log: MFC: r197276 Correct a sysctl name. Modified: stable/7/share/man/man4/man4.i386/acpi_panasonic.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/man4.i386/acpi_panasonic.4 ============================================================================== --- stable/7/share/man/man4/man4.i386/acpi_panasonic.4 Tue Jan 12 22:22:27 2010 (r202178) +++ stable/7/share/man/man4/man4.i386/acpi_panasonic.4 Tue Jan 12 22:28:59 2010 (r202179) @@ -144,7 +144,7 @@ The following MIBs are available: The maximum level of brightness. The value is read only and automatically set according to hardware model. -.It Va hw.acpi.panasonic.lcd_brightness_max +.It Va hw.acpi.panasonic.lcd_brightness_min The minimum level of brightness. The value is read only and automatically set according to hardware model. From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 18:12:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B388310657D5; Wed, 13 Jan 2010 18:12:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1F7C8FC28; Wed, 13 Jan 2010 18:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DICb3N083492; Wed, 13 Jan 2010 18:12:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DICbJi083490; Wed, 13 Jan 2010 18:12:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001131812.o0DICbJi083490@svn.freebsd.org> From: John Baldwin Date: Wed, 13 Jan 2010 18:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202202 - stable/7/lib/libc/stdtime X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:12:37 -0000 Author: jhb Date: Wed Jan 13 18:12:37 2010 New Revision: 202202 URL: http://svn.freebsd.org/changeset/base/202202 Log: MFC 199607, 200797, 201270, 201669: Use pthread_once() to initialize the thread-local storage for localtime() and gmtime() and _once() to initialize gmt state rather than home-rolled versions using pthread mutex locks. Modified: stable/7/lib/libc/stdtime/localtime.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdtime/localtime.c ============================================================================== --- stable/7/lib/libc/stdtime/localtime.c Wed Jan 13 18:12:21 2010 (r202201) +++ stable/7/lib/libc/stdtime/localtime.c Wed Jan 13 18:12:37 2010 (r202202) @@ -235,9 +235,14 @@ static struct state gmtmem; static char lcl_TZname[TZ_STRLEN_MAX + 1]; static int lcl_is_set; -static int gmt_is_set; +static pthread_once_t gmt_once = PTHREAD_ONCE_INIT; static pthread_rwlock_t lcl_rwlock = PTHREAD_RWLOCK_INITIALIZER; -static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_once_t gmtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t gmtime_key; +static int gmtime_key_error; +static pthread_once_t localtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t localtime_key; +static int localtime_key_error; char * tzname[2] = { wildabbr, @@ -1407,26 +1412,25 @@ struct tm * const tmp; return result; } +static void +localtime_key_init(void) +{ + + localtime_key_error = _pthread_key_create(&localtime_key, free); +} + struct tm * localtime(timep) const time_t * const timep; { - static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t localtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - _pthread_mutex_lock(&localtime_mutex); - if (localtime_key < 0) { - if ((r = _pthread_key_create(&localtime_key, free)) - != 0) { - _pthread_mutex_unlock(&localtime_mutex); - errno = r; - return(NULL); - } + _pthread_once(&localtime_once, localtime_key_init); + if (localtime_key_error != 0) { + errno = localtime_key_error; + return(NULL); } - _pthread_mutex_unlock(&localtime_mutex); p_tm = _pthread_getspecific(localtime_key); if (p_tm == NULL) { if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) @@ -1462,6 +1466,17 @@ struct tm * tmp; return tmp; } +static void +gmt_init(void) +{ + +#ifdef ALL_STATE + gmtptr = (struct state *) malloc(sizeof *gmtptr); + if (gmtptr != NULL) +#endif /* defined ALL_STATE */ + gmtload(gmtptr); +} + /* ** gmtsub is to gmtime as localsub is to localtime. */ @@ -1474,16 +1489,7 @@ struct tm * const tmp; { register struct tm * result; - _MUTEX_LOCK(&gmt_mutex); - if (!gmt_is_set) { - gmt_is_set = TRUE; -#ifdef ALL_STATE - gmtptr = (struct state *) malloc(sizeof *gmtptr); - if (gmtptr != NULL) -#endif /* defined ALL_STATE */ - gmtload(gmtptr); - } - _MUTEX_UNLOCK(&gmt_mutex); + _once(&gmt_once, gmt_init); result = timesub(timep, offset, gmtptr, tmp); #ifdef TM_ZONE /* @@ -1507,25 +1513,25 @@ struct tm * const tmp; return result; } +static void +gmtime_key_init(void) +{ + + gmtime_key_error = _pthread_key_create(&gmtime_key, free); +} + struct tm * gmtime(timep) const time_t * const timep; { - static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t gmtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - _pthread_mutex_lock(&gmtime_mutex); - if (gmtime_key < 0) { - if ((r = _pthread_key_create(&gmtime_key, free)) != 0) { - _pthread_mutex_unlock(&gmtime_mutex); - errno = r; - return(NULL); - } + _pthread_once(&gmtime_once, gmtime_key_init); + if (gmtime_key_error != 0) { + errno = gmtime_key_error; + return(NULL); } - _pthread_mutex_unlock(&gmtime_mutex); /* * Changed to follow POSIX.1 threads standard, which * is what BSD currently has. From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 19:56:03 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABBB106576D; Wed, 13 Jan 2010 19:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4E88FC26; Wed, 13 Jan 2010 19:56:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DJu2b2007209; Wed, 13 Jan 2010 19:56:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJu2e7007204; Wed, 13 Jan 2010 19:56:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001131956.o0DJu2e7007204@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202222 - in stable/7/sys/sparc64: pci sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:56:03 -0000 Author: marius Date: Wed Jan 13 19:56:02 2010 New Revision: 202222 URL: http://svn.freebsd.org/changeset/base/202222 Log: MFC: 197164 Factor out the duplicated macro for the device type used in the OFW device tree for PCI bridges and add a new one for PCI Express. While at it, take advantage of the former for the rman(9) work- around in jbusppm(4). Modified: stable/7/sys/sparc64/pci/ofw_pci.h stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/schizo.c stable/7/sys/sparc64/sparc64/jbusppm.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:56:02 2010 (r202222) @@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_PCI_CS_MEM32 0x02 #define OFW_PCI_CS_MEM64 0x03 +/* OFW device types */ +#define OFW_TYPE_PCI "pci" +#define OFW_TYPE_PCIE "pciex" + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/pci/psycho.c Wed Jan 13 19:56:02 2010 (r202222) @@ -225,8 +225,6 @@ struct psycho_dma_sync { * providing two PCI buses. */ -#define OFW_PCI_TYPE "pci" - struct psycho_desc { const char *pd_string; int pd_mode; @@ -276,7 +274,7 @@ psycho_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && psycho_get_desc(dev) != NULL) { device_set_desc(dev, "U2P UPA-PCI bridge"); return (0); Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/pci/schizo.c Wed Jan 13 19:56:02 2010 (r202222) @@ -210,8 +210,6 @@ struct schizo_dma_sync { #define SCHIZO_ICON_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v)) -#define OFW_PCI_TYPE "pci" - struct schizo_desc { const char *sd_string; int sd_mode; @@ -245,7 +243,7 @@ schizo_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && schizo_get_desc(dev) != NULL) { device_set_desc(dev, "Sun Host-PCI bridge"); return (0); Modified: stable/7/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- stable/7/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:56:02 2010 (r202222) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if 1 +#include +#endif + #define JBUSPPM_NREG 2 #define JBUSPPM_DEVID 0 @@ -150,7 +154,7 @@ jbusppm_attach(device_t dev) for (j = 0; j < nchildren; j++) { if (ofw_bus_get_type(children[j]) != NULL && strcmp(ofw_bus_get_type(children[j]), - "pci") == 0 && + OFW_TYPE_PCI) == 0 && ofw_bus_get_compat(children[j]) != NULL && strcmp(ofw_bus_get_compat(children[j]), "pci108e,a801") == 0 && From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 19:59:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F3491065769; Wed, 13 Jan 2010 19:59:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1328FC22; Wed, 13 Jan 2010 19:59:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DJxKFU008058; Wed, 13 Jan 2010 19:59:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJxJba008050; Wed, 13 Jan 2010 19:59:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001131959.o0DJxJba008050@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 19:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202224 - in stable/7/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:59:20 -0000 Author: marius Date: Wed Jan 13 19:59:19 2010 New Revision: 202224 URL: http://svn.freebsd.org/changeset/base/202224 Log: MFC: r200815, r200816 Provide and consume missing module dependency information. Modified: stable/7/sys/dev/auxio/auxio.c stable/7/sys/sparc64/central/central.c stable/7/sys/sparc64/fhc/fhc.c stable/7/sys/sparc64/pci/apb.c stable/7/sys/sparc64/pci/ofw_pcib.c stable/7/sys/sparc64/sbus/sbus.c stable/7/sys/sparc64/sparc64/nexus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/auxio/auxio.c ============================================================================== --- stable/7/sys/dev/auxio/auxio.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/dev/auxio/auxio.c Wed Jan 13 19:59:19 2010 (r202224) @@ -56,7 +56,7 @@ */ /* - * AUXIO registers support on the sbus & ebus2, used for the floppy driver + * AUXIO registers support on the SBus & EBus2, used for the floppy driver * and to control the system LED, for the BLINK option. */ @@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$"); #include /* - * on sun4u, auxio exists with one register (LED) on the sbus, and 5 - * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI + * On sun4u, auxio exists with one register (LED) on the SBus, and 5 + * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI * OSCILLATOR, and TEMP SENSE. */ @@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = { static devclass_t auxio_devclass; DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, sbus, 1, 1, 1); /* EBus */ static device_method_t auxio_ebus_methods[] = { @@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = { }; DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, ebus, 1, 1, 1); MODULE_VERSION(auxio, 1); #define AUXIO_LOCK_INIT(sc) \ Modified: stable/7/sys/sparc64/central/central.c ============================================================================== --- stable/7/sys/sparc64/central/central.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/central/central.c Wed Jan 13 19:59:19 2010 (r202224) @@ -105,6 +105,7 @@ static driver_t central_driver = { static devclass_t central_devclass; DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(central, 1); static int Modified: stable/7/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/7/sys/sparc64/fhc/fhc.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/fhc/fhc.c Wed Jan 13 19:59:19 2010 (r202224) @@ -119,8 +119,9 @@ static driver_t fhc_driver = { static devclass_t fhc_devclass; DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0); -DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); MODULE_DEPEND(fhc, central, 1, 1, 1); +DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(fhc, 1); static const struct intr_controller fhc_ic = { Modified: stable/7/sys/sparc64/pci/apb.c ============================================================================== --- stable/7/sys/sparc64/pci/apb.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/pci/apb.c Wed Jan 13 19:59:19 2010 (r202224) @@ -113,6 +113,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(apb, pci, 1, 1, 1); /* APB specific registers */ #define APBR_IOMAP 0xde Modified: stable/7/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:19 2010 (r202224) @@ -95,6 +95,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) Modified: stable/7/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/7/sys/sparc64/sbus/sbus.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/sbus/sbus.c Wed Jan 13 19:59:19 2010 (r202224) @@ -247,6 +247,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0); +MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); #define OFW_SBUS_TYPE "sbus" Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:59:19 2010 (r202224) @@ -145,6 +145,7 @@ static devclass_t nexus_devclass; DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { "aliases", From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:05:36 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16999106568D; Wed, 13 Jan 2010 20:05:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06098FC13; Wed, 13 Jan 2010 20:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DK5ZS9009656; Wed, 13 Jan 2010 20:05:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK5ZZx009654; Wed, 13 Jan 2010 20:05:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132005.o0DK5ZZx009654@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202227 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:05:36 -0000 Author: marius Date: Wed Jan 13 20:05:35 2010 New Revision: 202227 URL: http://svn.freebsd.org/changeset/base/202227 Log: MFC: r200876 Make these constants unsigned which is more appropriate. Modified: stable/7/sys/sparc64/include/bus_common.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/bus_common.h ============================================================================== --- stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:05:32 2010 (r202226) +++ stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:05:35 2010 (r202227) @@ -39,18 +39,18 @@ #ifndef _MACHINE_BUS_COMMON_H_ #define _MACHINE_BUS_COMMON_H_ -#define INTMAP_V 0x080000000LL /* Interrupt valid (enabled) */ -#define INTMAP_TID_MASK 0x07c000000LL /* UPA target ID */ +#define INTMAP_V 0x080000000ULL /* Interrupt valid (enabled) */ +#define INTMAP_TID_MASK 0x07c000000ULL /* UPA target ID */ #define INTMAP_TID_SHIFT 26 -#define INTMAP_IGN_MASK 0x0000007c0LL /* Interrupt group no. */ +#define INTMAP_IGN_MASK 0x0000007c0ULL /* Interrupt group no. */ #define INTMAP_IGN_SHIFT 6 -#define INTMAP_INO_MASK 0x00000003fLL /* Interrupt number */ +#define INTMAP_INO_MASK 0x00000003fULL /* Interrupt number */ #define INTMAP_INR_MASK (INTMAP_IGN_MASK | INTMAP_INO_MASK) -#define INTMAP_SBUSSLOT_MASK 0x000000018LL /* SBus slot # */ -#define INTMAP_PCIBUS_MASK 0x000000010LL /* PCI bus number (A or B) */ -#define INTMAP_PCISLOT_MASK 0x00000000cLL /* PCI slot # */ -#define INTMAP_PCIINT_MASK 0x000000003LL /* PCI interrupt #A,#B,#C,#D */ -#define INTMAP_OBIO_MASK 0x000000020LL /* Onboard device */ +#define INTMAP_SBUSSLOT_MASK 0x000000018ULL /* SBus slot # */ +#define INTMAP_PCIBUS_MASK 0x000000010ULL /* PCI bus number (A or B) */ +#define INTMAP_PCISLOT_MASK 0x00000000cULL /* PCI slot # */ +#define INTMAP_PCIINT_MASK 0x000000003ULL /* PCI interrupt #A,#B,#C,#D */ +#define INTMAP_OBIO_MASK 0x000000020ULL /* Onboard device */ #define INTIGN(x) (((x) & INTMAP_IGN_MASK) >> INTMAP_IGN_SHIFT) #define INTVEC(x) ((x) & INTMAP_INR_MASK) #define INTSLOT(x) (((x) >> 3) & 0x7) From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:07:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0EBE1065676; Wed, 13 Jan 2010 20:07:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF92F8FC18; Wed, 13 Jan 2010 20:07:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DK7k4Z010216; Wed, 13 Jan 2010 20:07:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK7k8K010214; Wed, 13 Jan 2010 20:07:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132007.o0DK7k8K010214@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202229 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:07:47 -0000 Author: marius Date: Wed Jan 13 20:07:46 2010 New Revision: 202229 URL: http://svn.freebsd.org/changeset/base/202229 Log: MFC: r200878 - Add macros for the states of the interrupt clear registers. - Change INTMAP_VEC() to take an INO as its second argument rather than an INR. The former is what I actually intended with this macro and how it's currently used. Modified: stable/7/sys/sparc64/include/bus_common.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/bus_common.h ============================================================================== --- stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:07:45 2010 (r202228) +++ stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:07:46 2010 (r202229) @@ -39,6 +39,10 @@ #ifndef _MACHINE_BUS_COMMON_H_ #define _MACHINE_BUS_COMMON_H_ +#define INTCLR_PENDING 0x000000003ULL /* Interrupt queued to CPU */ +#define INTCLR_RECEIVED 0x000000001ULL /* Interrupt received */ +#define INTCLR_IDLE 0x000000000ULL /* Interrupt idle */ + #define INTMAP_V 0x080000000ULL /* Interrupt valid (enabled) */ #define INTMAP_TID_MASK 0x07c000000ULL /* UPA target ID */ #define INTMAP_TID_SHIFT 26 @@ -60,9 +64,9 @@ (INTMAP_TID((mr), (mid)) | INTMAP_V) #define INTMAP_TID(mr, mid) \ (((mr) & ~INTMAP_TID_MASK) | ((mid) << INTMAP_TID_SHIFT)) -#define INTMAP_VEC(ign, inr) \ +#define INTMAP_VEC(ign, ino) \ ((((ign) << INTMAP_IGN_SHIFT) & INTMAP_IGN_MASK) | \ - ((inr) & INTMAP_INR_MASK)) + ((ino) & INTMAP_INO_MASK)) /* counter-timer support. */ void sparc64_counter_init(const char *name, bus_space_tag_t tag, From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:33:01 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC7BD1065704; Wed, 13 Jan 2010 20:33:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC5E48FC13; Wed, 13 Jan 2010 20:33:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKX0t5016016; Wed, 13 Jan 2010 20:33:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKX0M8016014; Wed, 13 Jan 2010 20:33:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132033.o0DKX0M8016014@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202233 - stable/7/sys/sparc64/ebus X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:33:01 -0000 Author: marius Date: Wed Jan 13 20:33:00 2010 New Revision: 202233 URL: http://svn.freebsd.org/changeset/base/202233 Log: MFC: r200879 - Add support for the JBus to EBus bridges which hang off of nexus(4) and are found in sun4u and sun4v machines based on the Fire ASIC. - Initialize the configuration space of the PCI to EBus variant the same way as OpenSolaris does. Modified: stable/7/sys/sparc64/ebus/ebus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/7/sys/sparc64/ebus/ebus.c Wed Jan 13 20:32:54 2010 (r202232) +++ stable/7/sys/sparc64/ebus/ebus.c Wed Jan 13 20:33:00 2010 (r202233) @@ -1,6 +1,7 @@ /*- * Copyright (c) 1999, 2000 Matthew R. Green * Copyright (c) 2001 Thomas Moestl + * Copyright (c) 2009 by Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +34,7 @@ __FBSDID("$FreeBSD$"); /* - * UltraSPARC 5 and beyond EBus support + * Driver for JBus to EBus and PCI to EBus bridges */ #include @@ -43,14 +44,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include #include +#include +#ifndef SUN4V +#include +#endif +#include #include #include @@ -60,11 +64,19 @@ __FBSDID("$FreeBSD$"); #include /* - * The register, ranges and interrupt map properties are identical to the ISA - * ones. + * The register, interrupt map and for the PCI variant also the ranges + * properties are identical to the ISA ones. */ #include +struct ebus_nexus_ranges { + uint32_t child_hi; + uint32_t child_lo; + uint32_t phys_hi; + uint32_t phys_lo; + uint32_t size; +}; + struct ebus_devinfo { struct ofw_bus_devinfo edi_obdinfo; struct resource_list edi_rl; @@ -77,32 +89,45 @@ struct ebus_rinfo { }; struct ebus_softc { - struct isa_ranges *sc_range; + void *sc_range; struct ebus_rinfo *sc_rinfo; + u_int sc_flags; +#define EBUS_PCI (1 << 0) + int sc_nrange; struct ofw_bus_iinfo sc_iinfo; + +#ifndef SUN4V + uint32_t sc_ign; +#endif }; -static device_probe_t ebus_probe; -static device_attach_t ebus_attach; +static device_probe_t ebus_nexus_probe; +static device_attach_t ebus_nexus_attach; +static device_probe_t ebus_pci_probe; +static device_attach_t ebus_pci_attach; static bus_print_child_t ebus_print_child; static bus_probe_nomatch_t ebus_probe_nomatch; static bus_alloc_resource_t ebus_alloc_resource; static bus_release_resource_t ebus_release_resource; +static bus_setup_intr_t ebus_setup_intr; static bus_get_resource_list_t ebus_get_resource_list; static ofw_bus_get_devinfo_t ebus_get_devinfo; -static struct ebus_devinfo *ebus_setup_dinfo(device_t, struct ebus_softc *, - phandle_t); -static void ebus_destroy_dinfo(struct ebus_devinfo *); -static int ebus_print_res(struct ebus_devinfo *); +static int ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node); +static struct ebus_devinfo *ebus_setup_dinfo(device_t dev, + struct ebus_softc *sc, phandle_t node); +static void ebus_destroy_dinfo(struct ebus_devinfo *edi); +static int ebus_print_res(struct ebus_devinfo *edi); + +static devclass_t ebus_devclass; -static device_method_t ebus_methods[] = { +static device_method_t ebus_nexus_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ebus_probe), - DEVMETHOD(device_attach, ebus_attach), + DEVMETHOD(device_probe, ebus_nexus_probe), + DEVMETHOD(device_attach, ebus_nexus_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -114,7 +139,7 @@ static device_method_t ebus_methods[] = DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_release_resource, ebus_release_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_setup_intr, ebus_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), @@ -130,20 +155,79 @@ static device_method_t ebus_methods[] = KOBJMETHOD_END }; -static driver_t ebus_driver = { +static driver_t ebus_nexus_driver = { "ebus", - ebus_methods, + ebus_nexus_methods, sizeof(struct ebus_softc), }; -static devclass_t ebus_devclass; +/* + * XXX: we rely on the interrupt controllers of the accompanying PCI-Express + * bridge to be registered as the nexus variant of the EBus bridges doesn't + * employ its own one. However, without multipass probing we have no way to + * specify that fact and thus have to rely on the OFW device tree provding an + * appropriate order. + */ +DRIVER_MODULE(ebus, nexus, ebus_nexus_driver, ebus_devclass, 0, 0); +MODULE_DEPEND(ebus, nexus, 1, 1, 1); + +static device_method_t ebus_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ebus_pci_probe), + DEVMETHOD(device_attach, ebus_pci_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, ebus_print_child), + DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch), + DEVMETHOD(bus_alloc_resource, ebus_alloc_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, ebus_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ebus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), -DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0); + KOBJMETHOD_END +}; + +static driver_t ebus_pci_driver = { + "ebus", + ebus_pci_methods, + sizeof(struct ebus_softc), +}; + +DRIVER_MODULE(ebus, pci, ebus_pci_driver, ebus_devclass, 0, 0); MODULE_DEPEND(ebus, pci, 1, 1, 1); MODULE_VERSION(ebus, 1); static int -ebus_probe(device_t dev) +ebus_nexus_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ebus") == 0 && + strcmp(compat, "jbus-ebus") == 0) { + device_set_desc(dev, "JBus-EBus bridge"); + return (BUS_PROBE_GENERIC); + } + return (ENXIO); +} + +static int +ebus_pci_probe(device_t dev) { if (pci_get_class(dev) != PCIC_BRIDGE || @@ -157,27 +241,58 @@ ebus_probe(device_t dev) device_set_desc(dev, "PCI-EBus3 bridge"); else return (ENXIO); - return (0); + return (BUS_PROBE_GENERIC); } static int -ebus_attach(device_t dev) +ebus_nexus_attach(device_t dev) +{ + struct ebus_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + +#ifndef SUN4V + if (OF_getprop(node, "portid", &sc->sc_ign, + sizeof(sc->sc_ign)) == -1) { + device_printf(dev, "could not determine IGN"); + return (ENXIO); + } +#endif + + sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sizeof(struct ebus_nexus_ranges), &sc->sc_range); + if (sc->sc_nrange == -1) { + printf("%s: could not get ranges property\n", __func__); + return (ENXIO); + } + return (ebus_attach(dev, sc, node)); +} + +static int +ebus_pci_attach(device_t dev) { struct ebus_softc *sc; - struct ebus_devinfo *edi; struct ebus_rinfo *eri; struct resource *res; - device_t cdev; phandle_t node; int i, rnum, rid; sc = device_get_softc(dev); + sc->sc_flags |= EBUS_PCI; + + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_SERRESPEN | + PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN, 2); + pci_write_config(dev, PCIR_CACHELNSZ, 16 /* 64 bytes */, 1); + pci_write_config(dev, PCIR_LATTIMER, 64 /* 64 PCI cycles */, 1); node = ofw_bus_get_node(dev); sc->sc_nrange = OF_getprop_alloc(node, "ranges", - sizeof(*sc->sc_range), (void **)&sc->sc_range); + sizeof(struct isa_ranges), &sc->sc_range); if (sc->sc_nrange == -1) { - printf("ebus_attach: could not get ranges property\n"); + printf("%s: could not get ranges property\n", __func__); return (ENXIO); } @@ -187,29 +302,52 @@ ebus_attach(device_t dev) /* For every range, there must be a matching resource. */ for (rnum = 0; rnum < sc->sc_nrange; rnum++) { eri = &sc->sc_rinfo[rnum]; - eri->eri_rtype = ofw_isa_range_restype(&sc->sc_range[rnum]); + eri->eri_rtype = ofw_isa_range_restype( + &((struct isa_ranges *)sc->sc_range)[rnum]); rid = PCIR_BAR(rnum); res = bus_alloc_resource_any(dev, eri->eri_rtype, &rid, RF_ACTIVE); if (res == NULL) { - printf("ebus_attach: failed to allocate range " - "resource!\n"); + printf("%s: failed to allocate range resource!\n", + __func__); goto fail; } eri->eri_res = res; eri->eri_rman.rm_type = RMAN_ARRAY; eri->eri_rman.rm_descr = "EBus range"; if (rman_init(&eri->eri_rman) != 0) { - printf("ebus_attach: failed to initialize rman!"); + printf("%s: failed to initialize rman!", __func__); goto fail; } if (rman_manage_region(&eri->eri_rman, rman_get_start(res), rman_get_end(res)) != 0) { - printf("ebus_attach: failed to register region!"); + printf("%s: failed to register region!", __func__); rman_fini(&eri->eri_rman); goto fail; } } + return (ebus_attach(dev, sc, node)); + + fail: + for (i = rnum; i >= 0; i--) { + eri = &sc->sc_rinfo[i]; + if (i < rnum) + rman_fini(&eri->eri_rman); + if (eri->eri_res != 0) { + bus_release_resource(dev, eri->eri_rtype, + PCIR_BAR(rnum), eri->eri_res); + } + } + free(sc->sc_rinfo, M_DEVBUF); + free(sc->sc_range, M_OFWPROP); + return (ENXIO); +} + +static int +ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node) +{ + struct ebus_devinfo *edi; + device_t cdev; ofw_bus_setup_iinfo(node, &sc->sc_iinfo, sizeof(ofw_isa_intr_t)); @@ -228,20 +366,6 @@ ebus_attach(device_t dev) device_set_ivars(cdev, edi); } return (bus_generic_attach(dev)); - -fail: - for (i = rnum; i >= 0; i--) { - eri = &sc->sc_rinfo[i]; - if (i < rnum) - rman_fini(&eri->eri_rman); - if (eri->eri_res != 0) { - bus_release_resource(dev, eri->eri_rtype, - PCIR_BAR(rnum), eri->eri_res); - } - } - free(sc->sc_rinfo, M_DEVBUF); - free(sc->sc_range, M_OFWPROP); - return (ENXIO); } static int @@ -273,28 +397,26 @@ ebus_alloc_resource(device_t bus, device struct resource_list_entry *rle = NULL; struct resource *res; struct ebus_rinfo *ri; + struct ebus_nexus_ranges *enr; bus_space_tag_t bt; bus_space_handle_t bh; - int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); - int ridx, rv; + uint64_t cend, cstart, offset; + int i, isdefault, passthrough, ridx, rv; - sc = (struct ebus_softc *)device_get_softc(bus); + isdefault = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != bus); + sc = device_get_softc(bus); rl = BUS_GET_RESOURCE_LIST(bus, child); - /* - * Map EBus ranges to PCI ranges. This may include changing the - * allocation type. - */ switch (type) { case SYS_RES_MEMORY: KASSERT(!(isdefault && passthrough), - ("ebus_alloc_resource: passthrough of default alloc")); + ("%s: passthrough of default allocation", __func__)); if (!passthrough) { rle = resource_list_find(rl, type, *rid); if (rle == NULL) return (NULL); KASSERT(rle->res == NULL, - ("ebus_alloc_resource: resource entry is busy")); + ("%s: resource entry is busy", __func__)); if (isdefault) { start = rle->start; count = ulmax(count, rle->count); @@ -302,25 +424,53 @@ ebus_alloc_resource(device_t bus, device } } - (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, - &start, &end, &ridx); + res = NULL; + if ((sc->sc_flags & EBUS_PCI) != 0) { + /* + * Map EBus ranges to PCI ranges. This may include + * changing the allocation type. + */ + (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, + &start, &end, &ridx); + ri = &sc->sc_rinfo[ridx]; + res = rman_reserve_resource(&ri->eri_rman, start, end, + count, flags, child); + if (res == NULL) + return (NULL); + rman_set_rid(res, *rid); + bt = rman_get_bustag(ri->eri_res); + rman_set_bustag(res, bt); + rv = bus_space_subregion(bt, + rman_get_bushandle(ri->eri_res), + rman_get_start(res) - rman_get_start(ri->eri_res), + count, &bh); + if (rv != 0) { + rman_release_resource(res); + return (NULL); + } + rman_set_bushandle(res, bh); + } else { + /* Map EBus ranges to nexus ranges. */ + for (i = 0; i < sc->sc_nrange; i++) { + enr = &((struct ebus_nexus_ranges *) + sc->sc_range)[i]; + cstart = (((uint64_t)enr->child_hi) << 32) | + enr->child_lo; + cend = cstart + enr->size - 1; + if (start >= cstart && end <= cend) { + offset = + (((uint64_t)enr->phys_hi) << 32) | + enr->phys_lo; + start += offset - cstart; + end += offset - cstart; + res = bus_generic_alloc_resource(bus, + child, type, rid, start, end, + count, flags); + break; + } + } - ri = &sc->sc_rinfo[ridx]; - res = rman_reserve_resource(&ri->eri_rman, start, end, count, - flags, child); - if (res == NULL) - return (NULL); - rman_set_rid(res, *rid); - bt = rman_get_bustag(ri->eri_res); - rman_set_bustag(res, bt); - rv = bus_space_subregion(bt, rman_get_bushandle(ri->eri_res), - rman_get_start(res) - rman_get_start(ri->eri_res), count, - &bh); - if (rv != 0) { - rman_release_resource(res); - return (NULL); } - rman_set_bushandle(res, bh); if (!passthrough) rle->res = res; return (res); @@ -335,34 +485,77 @@ static int ebus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { + struct ebus_softc *sc; struct resource_list *rl; struct resource_list_entry *rle; - int passthrough = (device_get_parent(child) != bus); - int rv; + int passthrough, rv; + passthrough = (device_get_parent(child) != bus); rl = BUS_GET_RESOURCE_LIST(bus, child); switch (type) { case SYS_RES_MEMORY: + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) == 0) + return (resource_list_release(rl, bus, child, type, + rid, res)); if ((rv = rman_release_resource(res)) != 0) return (rv); if (!passthrough) { rle = resource_list_find(rl, type, rid); - KASSERT(rle != NULL, ("ebus_release_resource: " - "resource entry not found!")); - KASSERT(rle->res != NULL, ("ebus_alloc_resource: " - "resource entry is not busy")); + KASSERT(rle != NULL, + ("%s: resource entry not found!", __func__)); + KASSERT(rle->res != NULL, + ("%s: resource entry is not busy", __func__)); rle->res = NULL; } break; case SYS_RES_IRQ: return (resource_list_release(rl, bus, child, type, rid, res)); default: - panic("ebus_release_resource: unsupported resource type %d", - type); + panic("%s: unsupported resource type %d", __func__, type); } return (0); } +static int +ebus_setup_intr(device_t dev, device_t child, struct resource *ires, + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) +{ +#ifndef SUN4V + struct ebus_softc *sc; + u_long vec; + + sc = device_get_softc(dev); + if ((sc->sc_flags & EBUS_PCI) == 0) { + /* + * Make sure the vector is fully specified. This isn't + * necessarily the case with the PCI variant. + */ + vec = rman_get_start(ires); + if (INTIGN(vec) != sc->sc_ign) { + device_printf(dev, + "invalid interrupt vector 0x%lx\n", vec); + return (EINVAL); + } + + /* + * As we rely on the interrupt controllers of the + * accompanying PCI-Express bridge ensure at least + * something is registered for this vector. + */ + if (intr_vectors[vec].iv_ic == NULL) { + device_printf(dev, + "invalid interrupt controller for vector 0x%lx\n", + vec); + return (EINVAL); + } + } +#endif + return (bus_generic_setup_intr(dev, child, ires, flags, filt, intr, + arg, cookiep)); +} + static struct resource_list * ebus_get_resource_list(device_t dev, device_t child) { @@ -384,12 +577,13 @@ ebus_get_devinfo(device_t bus, device_t static struct ebus_devinfo * ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, phandle_t node) { + struct isa_regs reg, *regs; + ofw_isa_intr_t intr, *intrs; struct ebus_devinfo *edi; - struct isa_regs *reg; - ofw_isa_intr_t *intrs; - ofw_pci_intr_t rintr; - u_int64_t start; - int nreg, nintr, i; + uint64_t start; + uint32_t rintr; + int i, nintr, nreg, rv; + uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; edi = malloc(sizeof(*edi), M_DEVBUF, M_ZERO | M_WAITOK); if (ofw_bus_gen_setup_devinfo(&edi->edi_obdinfo, node) != 0) { @@ -397,40 +591,51 @@ ebus_setup_dinfo(device_t dev, struct eb return (NULL); } resource_list_init(&edi->edi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc(node, "reg", sizeof(*regs), (void **)®s); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", edi->edi_obdinfo.obd_name); - goto fail; + ebus_destroy_dinfo(edi); + return (NULL); } for (i = 0; i < nreg; i++) { - start = ISA_REG_PHYS(reg + i); - resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, - start, start + reg[i].size - 1, reg[i].size); + start = ISA_REG_PHYS(regs + i); + (void)resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, + start, start + regs[i].size - 1, regs[i].size); } - free(reg, M_OFWPROP); + free(regs, M_OFWPROP); nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), (void **)&intrs); + if (nintr == -1) + return (edi); for (i = 0; i < nintr; i++) { - rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, intrs[i]); - if (rintr == PCI_INVALID_IRQ) { + rv = 0; + if ((sc->sc_flags & EBUS_PCI) != 0) { + rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, + intrs[i]); + } else { + intr = intrs[i]; + rv = ofw_bus_lookup_imap(node, &sc->sc_iinfo, ®, + sizeof(reg), &intr, sizeof(intr), &rintr, + sizeof(rintr), maskbuf); +#ifndef SUN4V + if (rv != 0) + rintr = INTMAP_VEC(sc->sc_ign, rintr); +#endif + } + if ((sc->sc_flags & EBUS_PCI) == 0 ? rv == 0 : + rintr == PCI_INVALID_IRQ) { device_printf(dev, "<%s>: could not map EBus interrupt %d\n", edi->edi_obdinfo.obd_name, intrs[i]); - free(intrs, M_OFWPROP); - goto fail; + continue; } - resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, - rintr, rintr, 1); + (void)resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, rintr, + rintr, 1); } free(intrs, M_OFWPROP); - return (edi); - -fail: - ebus_destroy_dinfo(edi); - return (NULL); } static void From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:35:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA03010657AE; Wed, 13 Jan 2010 20:35:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8C258FC15; Wed, 13 Jan 2010 20:35:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKZbtH016696; Wed, 13 Jan 2010 20:35:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKZbSf016694; Wed, 13 Jan 2010 20:35:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132035.o0DKZbSf016694@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202235 - stable/7/sys/sparc64/isa X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:35:37 -0000 Author: marius Date: Wed Jan 13 20:35:37 2010 New Revision: 202235 URL: http://svn.freebsd.org/changeset/base/202235 Log: MFC: r200880 - Correct an off-by-one error when calculating the end of a child range. - Spell the PCI TLA in uppercase. Modified: stable/7/sys/sparc64/isa/ofw_isa.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/isa/ofw_isa.c ============================================================================== --- stable/7/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:27 2010 (r202234) +++ stable/7/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:37 2010 (r202235) @@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran for (i = 0; i < nrange; i++) { r = &range[i]; cstart = ISA_RANGE_CHILD(r); - cend = cstart + r->size; + cend = cstart + r->size - 1; if (*start < cstart || *start > cend) continue; if (*end < cstart || *end > cend) { - panic("ofw_isa_map_iorange: iorange crosses pci " + panic("ofw_isa_map_iorange: iorange crosses PCI " "ranges (%#lx not in %#lx - %#lx)", *end, cstart, cend); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:40:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0341E106568B; Wed, 13 Jan 2010 20:40:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC74B8FC0A; Wed, 13 Jan 2010 20:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKepNv018045; Wed, 13 Jan 2010 20:40:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKepS9018043; Wed, 13 Jan 2010 20:40:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132040.o0DKepS9018043@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202238 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:40:52 -0000 Author: marius Date: Wed Jan 13 20:40:51 2010 New Revision: 202238 URL: http://svn.freebsd.org/changeset/base/202238 Log: MFC: r200914 Don't use an out register to hold the vector number across the call of the interrupt handler in intr_fast() as the handler might clobber it (no in-tree handler currently does but an upcoming one will). While at it, tidy the register usage in the interrupt counting code. Modified: stable/7/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/7/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:49 2010 (r202237) +++ stable/7/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:51 2010 (r202238) @@ -176,7 +176,7 @@ ENTRY(intr_fast) 3: ldx [%l0 + IR_FUNC], %o0 ldx [%l0 + IR_ARG], %o1 - lduw [%l0 + IR_VEC], %o2 + lduw [%l0 + IR_VEC], %l2 ldx [PCPU(IRFREE)], %l1 stx %l1, [%l0 + IR_NEXT] @@ -188,17 +188,17 @@ ENTRY(intr_fast) call %o0 mov %o1, %o0 - /* intrcnt[intr_countp[%o2]]++ */ - SET(intrcnt, %l7, %l2) /* %l2 = intrcnt */ - prefetcha [%l2] ASI_N, 1 - SET(intr_countp, %l7, %l3) /* %l3 = intr_countp */ - sllx %o2, 1, %l4 /* %l4 = vec << 1 */ - lduh [%l4 + %l3], %l5 /* %l5 = intr_countp[%o2] */ - sllx %l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */ - add %l6, %l2, %l7 /* %l7 = intrcnt[intr_countp[%o2]] */ - ldx [%l7], %l2 + /* intrcnt[intr_countp[%l2]]++ */ + SET(intrcnt, %l7, %l3) /* %l3 = intrcnt */ + prefetcha [%l3] ASI_N, 1 + SET(intr_countp, %l7, %l4) /* %l4 = intr_countp */ + sllx %l2, 1, %l2 /* %l2 = vec << 1 */ + lduh [%l4 + %l2], %l4 /* %l4 = intr_countp[%l2] */ + sllx %l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */ + add %l4, %l3, %l4 /* %l4 = intrcnt[intr_countp[%l2]] */ + ldx [%l4], %l2 inc %l2 - stx %l2, [%l7] + stx %l2, [%l4] ba,a %xcc, 1b nop From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:51:23 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8427D106566C; Wed, 13 Jan 2010 20:51:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72C248FC0A; Wed, 13 Jan 2010 20:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKpN6N020633; Wed, 13 Jan 2010 20:51:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKpNsq020631; Wed, 13 Jan 2010 20:51:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132051.o0DKpNsq020631@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202242 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:51:23 -0000 Author: marius Date: Wed Jan 13 20:51:23 2010 New Revision: 202242 URL: http://svn.freebsd.org/changeset/base/202242 Log: MFC: r200915 Don't probe the bq4802 variant found in Ultra 25 and 45 for now as this chip isn't MC146818 compatible and requires different handlers (but which I can't test due to lack of such hardware). Modified: stable/7/sys/sparc64/sparc64/rtc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/7/sys/sparc64/sparc64/rtc.c Wed Jan 13 20:51:21 2010 (r202241) +++ stable/7/sys/sparc64/sparc64/rtc.c Wed Jan 13 20:51:23 2010 (r202242) @@ -28,10 +28,11 @@ __FBSDID("$FreeBSD$"); /* - * The `rtc' device is a MC146818 compatible clock found on the ISA - * bus and EBus. The EBus variant actually is the Real-Time Clock - * function of a National Semiconductor PC87317/PC97317 which also - * provides Advanced Power Control functionality. + * The `rtc' device is found on the ISA bus and the EBus. The ISA version + * always is a MC146818 compatible clock while the EBus variant either is the + * MC146818 compatible Real-Time Clock function of a National Semiconductor + * PC87317/PC97317 which also provides Advanced Power Control functionality + * or a Texas Instruments bq4802. */ #include "opt_isa.h" @@ -130,6 +131,10 @@ rtc_ebus_probe(device_t dev) { if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) { + /* The bq4802 is not supported, yet. */ + if (ofw_bus_get_compat(dev) != NULL && + strcmp(ofw_bus_get_compat(dev), "bq4802") == 0) + return (ENXIO); device_set_desc(dev, RTC_DESC); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 20:59:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4B01065757; Wed, 13 Jan 2010 20:59:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971BD8FC0A; Wed, 13 Jan 2010 20:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKxgnp022589; Wed, 13 Jan 2010 20:59:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKxgVt022587; Wed, 13 Jan 2010 20:59:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132059.o0DKxgVt022587@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202245 - stable/7/sys/sun4v/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:59:42 -0000 Author: marius Date: Wed Jan 13 20:59:42 2010 New Revision: 202245 URL: http://svn.freebsd.org/changeset/base/202245 Log: MFC: r200916 Remove devices which are/were only relevant for sun4u. Modified: stable/7/sys/sun4v/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sun4v/conf/NOTES ============================================================================== --- stable/7/sys/sun4v/conf/NOTES Wed Jan 13 20:59:36 2010 (r202244) +++ stable/7/sys/sun4v/conf/NOTES Wed Jan 13 20:59:42 2010 (r202245) @@ -21,9 +21,6 @@ cpu SUN4V device ebus #device isa device pci -device sbus -#device central -device fhc ##################################################################### @@ -34,25 +31,14 @@ device fhc # device genclock # Generic clock interface -#device eeprom # eeprom (really a front-end for the MK48Txx) -device mk48txx # Mostek MK48Txx clocks -#device rtc # rtc (really a front-end for the MC146818) -device mc146818 # Motorola MC146818 and compatible clocks # # Optional devices: # -#device auxio # auxiliary I/O device -#device clkbrd # Clock Board (blinkenlight on Sun Exx00) -#device creator # Creator, Creator3D and Elite3D framebuffers -#device machfb # ATI Mach64 framebuffers - device ofw_console # Open Firmware console device option OFWCONS_POLL_HZ=4 # 20 or more works best on Ultra2 -#device sab # Siemens SAB82532 based serial ports - ##################################################################### # Devices we don't want to deal with From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:03:06 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 749E1106566B; Wed, 13 Jan 2010 21:03:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 633FE8FC0C; Wed, 13 Jan 2010 21:03:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DL36Vo023479; Wed, 13 Jan 2010 21:03:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL36gu023476; Wed, 13 Jan 2010 21:03:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132103.o0DL36gu023476@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202247 - in stable/7/sys: conf sun4v/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:03:06 -0000 Author: marius Date: Wed Jan 13 21:03:06 2010 New Revision: 202247 URL: http://svn.freebsd.org/changeset/base/202247 Log: MFC: r200917 Hook ebus(4) and isa(4) up to the sun4v LINT build in order to ensure that their compilation doesn't break as they are expected to work as-is now (but aren't actually run-time tested). Modified: stable/7/sys/conf/files.sun4v stable/7/sys/sun4v/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.sun4v ============================================================================== --- stable/7/sys/conf/files.sun4v Wed Jan 13 21:03:04 2010 (r202246) +++ stable/7/sys/conf/files.sun4v Wed Jan 13 21:03:06 2010 (r202247) @@ -32,6 +32,10 @@ libkern/ffs.c standard libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard +sparc64/ebus/ebus.c optional ebus +sparc64/isa/isa.c optional isa +sparc64/isa/isa_dma.c optional isa +sparc64/isa/ofw_isa.c optional ebus | isa sparc64/sparc64/autoconf.c standard sun4v/sun4v/bus_machdep.c standard sun4v/sun4v/clock.c standard Modified: stable/7/sys/sun4v/conf/NOTES ============================================================================== --- stable/7/sys/sun4v/conf/NOTES Wed Jan 13 21:03:04 2010 (r202246) +++ stable/7/sys/sun4v/conf/NOTES Wed Jan 13 21:03:06 2010 (r202247) @@ -19,7 +19,7 @@ cpu SUN4V # HARDWARE BUS CONFIGURATION device ebus -#device isa +device isa device pci From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:05:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4DB10656A7; Wed, 13 Jan 2010 21:05:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F5DB8FC1A; Wed, 13 Jan 2010 21:05:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DL52Uv024009; Wed, 13 Jan 2010 21:05:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL52do024007; Wed, 13 Jan 2010 21:05:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132105.o0DL52do024007@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202249 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:05:05 -0000 Author: marius Date: Wed Jan 13 21:05:01 2010 New Revision: 202249 URL: http://svn.freebsd.org/changeset/base/202249 Log: MFC: r200918 Add structures for OFW MSI/MSI-X support. These are identical for both sun4u and sun4v. Modified: stable/7/sys/sparc64/pci/ofw_pci.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 21:04:56 2010 (r202248) +++ stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 21:05:01 2010 (r202249) @@ -48,6 +48,31 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_TYPE_PCI "pci" #define OFW_TYPE_PCIE "pciex" +struct ofw_pci_msi_addr_ranges { + uint32_t addr32_hi; + uint32_t addr32_lo; + uint32_t addr32_sz; + uint32_t addr64_hi; + uint32_t addr64_lo; + uint32_t addr64_sz; +}; + +#define OFW_PCI_MSI_ADDR_RANGE_32(r) \ + (((uint64_t)(r)->addr32_hi << 32) | (uint64_t)(r)->addr32_lo) +#define OFW_PCI_MSI_ADDR_RANGE_64(r) \ + (((uint64_t)(r)->addr64_hi << 32) | (uint64_t)(r)->addr64_lo) + +struct ofw_pci_msi_eq_to_devino { + uint32_t eq_first; + uint32_t eq_count; + uint32_t devino_first; +}; + +struct ofw_pci_msi_ranges { + uint32_t first; + uint32_t count; +}; + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:08:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260BD106566B; Wed, 13 Jan 2010 21:08:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13CBB8FC16; Wed, 13 Jan 2010 21:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DL8v9u024961; Wed, 13 Jan 2010 21:08:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL8vpS024959; Wed, 13 Jan 2010 21:08:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132108.o0DL8vpS024959@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202250 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:08:58 -0000 Author: marius Date: Wed Jan 13 21:08:57 2010 New Revision: 202250 URL: http://svn.freebsd.org/changeset/base/202250 Log: MFC: r200920 - Sort the prototypes. - Add macros to ease the access of device configuration space in ofw_pcibus_setup_device(). Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:05:01 2010 (r202249) +++ stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:08:57 2010 (r202250) @@ -65,10 +65,10 @@ static void ofw_pcibus_setup_device(devi u_int busno, u_int slot, u_int func); /* Methods */ -static device_probe_t ofw_pcibus_probe; static device_attach_t ofw_pcibus_attach; -static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; +static device_probe_t ofw_pcibus_probe; static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo; +static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; static device_method_t ofw_pcibus_methods[] = { /* Device interface */ @@ -122,6 +122,11 @@ static void ofw_pcibus_setup_device(device_t bridge, uint32_t clock, u_int busno, u_int slot, u_int func) { +#define CS_READ(n, w) \ + PCIB_READ_CONFIG(bridge, busno, slot, func, (n), (w)) +#define CS_WRITE(n, v, w) \ + PCIB_WRITE_CONFIG(bridge, busno, slot, func, (n), (v), (w)) + #ifndef SUN4V uint32_t reg; @@ -136,10 +141,9 @@ ofw_pcibus_setup_device(device_t bridge, * For bridges, we additionally set up the bridge control and the * secondary latency registers. */ - if ((PCIB_READ_CONFIG(bridge, busno, slot, func, PCIR_HDRTYPE, 1) & - PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) { - reg = PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_BRIDGECTL_1, 1); + if ((CS_READ(PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) == + PCIM_HDRTYPE_BRIDGE) { + reg = CS_READ(PCIR_BRIDGECTL_1, 1); #if 0 reg |= PCIB_BCR_MASTER_ABORT_MODE | PCIB_BCR_SERR_ENABLE | #else @@ -149,24 +153,19 @@ ofw_pcibus_setup_device(device_t bridge, #ifdef OFW_PCI_DEBUG device_printf(bridge, "bridge %d/%d/%d: control 0x%x -> 0x%x\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, - func, PCIR_BRIDGECTL_1, 1), reg); + busno, slot, func, CS_READ(PCIR_BRIDGECTL_1, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_BRIDGECTL_1, - reg, 1); + CS_WRITE(PCIR_BRIDGECTL_1, reg, 1); reg = OFW_PCI_LATENCY; #ifdef OFW_PCI_DEBUG device_printf(bridge, "bridge %d/%d/%d: latency timer %d -> %d\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, - func, PCIR_SECLAT_1, 1), reg); + busno, slot, func, CS_READ(PCIR_SECLAT_1, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_SECLAT_1, - reg, 1); + CS_WRITE(PCIR_SECLAT_1, reg, 1); } else { - reg = PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_MINGNT, 1); + reg = CS_READ(PCIR_MINGNT, 1); if (reg != 0) { switch (clock) { case 33000000: @@ -182,10 +181,9 @@ ofw_pcibus_setup_device(device_t bridge, } #ifdef OFW_PCI_DEBUG device_printf(bridge, "device %d/%d/%d: latency timer %d -> %d\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_LATTIMER, 1), reg); + busno, slot, func, CS_READ(PCIR_LATTIMER, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_LATTIMER, reg, 1); + CS_WRITE(PCIR_LATTIMER, reg, 1); /* * Compute a value to write into the cache line size register. @@ -194,8 +192,7 @@ ofw_pcibus_setup_device(device_t bridge, * reached. Generally, the cache line size is fixed at 64 bytes * by Fireplane/Safari, JBus and UPA. */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_CACHELNSZ, - STRBUF_LINESZ / sizeof(uint32_t), 1); + CS_WRITE(PCIR_CACHELNSZ, STRBUF_LINESZ / sizeof(uint32_t), 1); #endif /* @@ -203,8 +200,10 @@ ofw_pcibus_setup_device(device_t bridge, * it to 255, so that the PCI code will reroute the interrupt if * needed. */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_INTLINE, - PCI_INVALID_IRQ, 1); + CS_WRITE(PCIR_INTLINE, PCI_INVALID_IRQ, 1); + +#undef CS_READ +#undef CS_WRITE } static int From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:12:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48E111065698; Wed, 13 Jan 2010 21:12:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 372F78FC1F; Wed, 13 Jan 2010 21:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLCVWo025860; Wed, 13 Jan 2010 21:12:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLCVqo025858; Wed, 13 Jan 2010 21:12:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132112.o0DLCVqo025858@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202253 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:12:32 -0000 Author: marius Date: Wed Jan 13 21:12:31 2010 New Revision: 202253 URL: http://svn.freebsd.org/changeset/base/202253 Log: MFC: r200921 - Add quirk handling for ALi M5229, mainly setting the magic "force enable IDE I/O" bit which prevents data access traps with revision 0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN. - Like for sun4v also don't add the PCI side of host-PCIe bridges to the bus on sun4u as they don't have configuration space implement there either. Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:12:27 2010 (r202252) +++ stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:12:31 2010 (r202253) @@ -3,6 +3,7 @@ * Copyright (c) 2000, Michael Smith * Copyright (c) 2000, BSDi * Copyright (c) 2003, Thomas Moestl + * Copyright (c) 2005 - 2009 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -196,6 +197,22 @@ ofw_pcibus_setup_device(device_t bridge, #endif /* + * Ensure that ALi M5229 report the actual content of PCIR_PROGIF + * and that IDE I/O is force enabled. The former is done in order + * to have unique behavior across revisions as some default to + * hiding bits 4-6 for compliance with PCI 2.3. The latter is done + * as at least revision 0xc8 requires the PCIM_CMD_PORTEN bypass + * to be always enabled as otherwise even enabling PCIM_CMD_PORTEN + * results in an instant data access trap on Fire-based machines. + * Thus these quirks have to be handled before pci(4) adds the maps. + * Note that for older revisions bit 0 of register 0x50 enables the + * internal IDE function instead of force enabling IDE I/O. + */ + if ((CS_READ(PCIR_VENDOR, 2) == 0x10b9 && + CS_READ(PCIR_DEVICE, 2) == 0x5229)) + CS_WRITE(0x50, CS_READ(0x50, 1) | 0x3, 1); + + /* * The preset in the intline register is usually wrong. Reset * it to 255, so that the PCI code will reroute the interrupt if * needed. @@ -224,9 +241,14 @@ ofw_pcibus_attach(device_t dev) domain, busno); node = ofw_bus_get_node(dev); -#ifndef SUN4V - /* Add the PCI side of the HOST-PCI bridge itself to the bus. */ + /* + * Add the PCI side of the host-PCI bridge itself to the bus. + * Note that we exclude the host-PCIe bridges here as these + * have no configuration space implemented themselves. + */ if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 && + ofw_bus_get_type(pcib) != NULL && + strcmp(ofw_bus_get_type(pcib), OFW_TYPE_PCIE) != 0 && (dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, domain, busno, 0, 0, sizeof(*dinfo))) != NULL) { if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0) @@ -234,7 +256,6 @@ ofw_pcibus_attach(device_t dev) else pci_add_child(dev, (struct pci_devinfo *)dinfo); } -#endif if (OF_getprop(ofw_bus_get_node(pcib), "clock-frequency", &clock, sizeof(clock)) == -1) From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:13:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7784106566C; Wed, 13 Jan 2010 21:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1DB08FC2E; Wed, 13 Jan 2010 21:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLDppT026256; Wed, 13 Jan 2010 21:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLDpi1026254; Wed, 13 Jan 2010 21:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132113.o0DLDpi1026254@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202255 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:13:52 -0000 Author: marius Date: Wed Jan 13 21:13:51 2010 New Revision: 202255 URL: http://svn.freebsd.org/changeset/base/202255 Log: MFC: r200922 Fix whitespace according to style(9). Modified: stable/7/sys/sparc64/include/iommureg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/iommureg.h ============================================================================== --- stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:50 2010 (r202254) +++ stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:51 2010 (r202255) @@ -37,7 +37,7 @@ */ #ifndef _MACHINE_IOMMUREG_H_ -#define _MACHINE_IOMMUREG_H_ +#define _MACHINE_IOMMUREG_H_ /* * UltraSPARC IOMMU registers, common to both the PCI and SBus @@ -61,9 +61,9 @@ #define ISD_LN_TAG_DIAG 0x0900 /* streaming buffer line tag diag 0..15 */ /* streaming buffer control register */ -#define STRBUF_EN 0x0000000000000001UL -#define STRBUF_D 0x0000000000000002UL -#define STRBUF_RR_DIS 0x0000000000000004UL +#define STRBUF_EN 0x0000000000000001UL +#define STRBUF_D 0x0000000000000002UL +#define STRBUF_RR_DIS 0x0000000000000004UL #define IOMMU_MAXADDR(bits) ((1UL << (bits)) - 1) @@ -72,24 +72,24 @@ */ /* Nummber of entries in IOTSB */ #define IOMMUCR_TSBSZ_SHIFT 16 -#define IOMMUCR_TSB1K 0x0000000000000000UL -#define IOMMUCR_TSB2K 0x0000000000010000UL -#define IOMMUCR_TSB4K 0x0000000000020000UL -#define IOMMUCR_TSB8K 0x0000000000030000UL -#define IOMMUCR_TSB16K 0x0000000000040000UL -#define IOMMUCR_TSB32K 0x0000000000050000UL -#define IOMMUCR_TSB64K 0x0000000000060000UL -#define IOMMUCR_TSB128K 0x0000000000070000UL +#define IOMMUCR_TSB1K 0x0000000000000000UL +#define IOMMUCR_TSB2K 0x0000000000010000UL +#define IOMMUCR_TSB4K 0x0000000000020000UL +#define IOMMUCR_TSB8K 0x0000000000030000UL +#define IOMMUCR_TSB16K 0x0000000000040000UL +#define IOMMUCR_TSB32K 0x0000000000050000UL +#define IOMMUCR_TSB64K 0x0000000000060000UL +#define IOMMUCR_TSB128K 0x0000000000070000UL /* Mask for above */ -#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL +#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL /* 8K iommu page size */ -#define IOMMUCR_8KPG 0x0000000000000000UL +#define IOMMUCR_8KPG 0x0000000000000000UL /* 64K iommu page size */ -#define IOMMUCR_64KPG 0x0000000000000004UL +#define IOMMUCR_64KPG 0x0000000000000004UL /* Diag enable */ -#define IOMMUCR_DE 0x0000000000000002UL +#define IOMMUCR_DE 0x0000000000000002UL /* Enable IOMMU */ -#define IOMMUCR_EN 0x0000000000000001UL +#define IOMMUCR_EN 0x0000000000000001UL /* * Diagnostic register definitions @@ -97,9 +97,9 @@ #define IOMMU_DTAG_VPNBITS 19 #define IOMMU_DTAG_VPNMASK ((1 << IOMMU_DTAG_VPNBITS) - 1) #define IOMMU_DTAG_VPNSHIFT 13 -#define IOMMU_DTAG_ERRBITS 3 +#define IOMMU_DTAG_ERRBITS 3 #define IOMMU_DTAG_ERRSHIFT 22 -#define IOMMU_DTAG_ERRMASK \ +#define IOMMU_DTAG_ERRMASK \ (((1 << IOMMU_DTAG_ERRBITS) - 1) << IOMMU_DTAG_ERRSHIFT) #define IOMMU_DDATA_PGBITS 21 @@ -114,18 +114,18 @@ /* Entry valid */ #define IOTTE_V 0x8000000000000000UL /* 8K or 64K page? */ -#define IOTTE_64K 0x2000000000000000UL -#define IOTTE_8K 0x0000000000000000UL +#define IOTTE_64K 0x2000000000000000UL +#define IOTTE_8K 0x0000000000000000UL /* Is page streamable? */ -#define IOTTE_STREAM 0x1000000000000000UL +#define IOTTE_STREAM 0x1000000000000000UL /* Accesses to same bus segment? */ #define IOTTE_LOCAL 0x0800000000000000UL /* Let's assume this is correct */ -#define IOTTE_PAMASK 0x000007ffffffe000UL +#define IOTTE_PAMASK 0x000007ffffffe000UL /* Accesses to cacheable space */ -#define IOTTE_C 0x0000000000000010UL +#define IOTTE_C 0x0000000000000010UL /* Writeable */ -#define IOTTE_W 0x0000000000000002UL +#define IOTTE_W 0x0000000000000002UL /* log2 of the IOMMU TTE size */ #define IOTTE_SHIFT 3 @@ -167,14 +167,14 @@ */ #define IOTSB_BASESZ (1024 << IOTTE_SHIFT) -#define IOTSB_VEND (~IO_PAGE_MASK) -#define IOTSB_VSTART(sz) (u_int)(IOTSB_VEND << ((sz) + 10)) +#define IOTSB_VEND (~IO_PAGE_MASK) +#define IOTSB_VSTART(sz) (u_int)(IOTSB_VEND << ((sz) + 10)) -#define MAKEIOTTE(pa,w,c,s) \ +#define MAKEIOTTE(pa, w, c, s) \ (((pa) & IOTTE_PAMASK) | ((w) ? IOTTE_W : 0) | \ ((c) ? IOTTE_C : 0) | ((s) ? IOTTE_STREAM : 0) | \ (IOTTE_V | IOTTE_8K)) -#define IOTSBSLOT(va) \ +#define IOTSBSLOT(va) \ ((u_int)(((vm_offset_t)(va)) - (is->is_dvmabase)) >> IO_PAGE_SHIFT) #endif /* !_MACHINE_IOMMUREG_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:16:13 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF794106575C; Wed, 13 Jan 2010 21:16:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB7ED8FC12; Wed, 13 Jan 2010 21:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLGDeL026913; Wed, 13 Jan 2010 21:16:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLGDEa026909; Wed, 13 Jan 2010 21:16:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132116.o0DLGDEa026909@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202257 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:16:14 -0000 Author: marius Date: Wed Jan 13 21:16:13 2010 New Revision: 202257 URL: http://svn.freebsd.org/changeset/base/202257 Log: MFC: r200923 - Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus to PCIe bridges. - Add support for talking the PROM mappings over to the kernel IOTSB just like we do with the kernel TSB in order to allow OFW drivers to continue to work. - Change some members, parameters and variables to unsigned where more appropriate. Modified: stable/7/sys/sparc64/include/iommureg.h stable/7/sys/sparc64/include/iommuvar.h stable/7/sys/sparc64/sparc64/iommu.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/iommureg.h ============================================================================== --- stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:07 2010 (r202256) +++ stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:13 2010 (r202257) @@ -44,10 +44,13 @@ * controllers. */ -/* iommmu registers */ +/* IOMMU registers */ #define IMR_CTL 0x0000 /* IOMMU control register */ #define IMR_TSB 0x0008 /* IOMMU TSB base register */ #define IMR_FLUSH 0x0010 /* IOMMU flush register */ +/* The TTE Cache is Fire and Oberon only. */ +#define IMR_CACHE_FLUSH 0x0100 /* IOMMU TTE cache flush address register */ +#define IMR_CACHE_INVAL 0x0108 /* IOMMU TTE cache invalidate register */ /* streaming buffer registers */ #define ISR_CTL 0x0000 /* streaming buffer control reg */ @@ -70,28 +73,57 @@ /* * control register bits */ -/* Nummber of entries in IOTSB */ +/* Nummber of entries in the IOTSB - pre-Fire only */ +#define IOMMUCR_TSBSZ_MASK 0x0000000000070000UL #define IOMMUCR_TSBSZ_SHIFT 16 -#define IOMMUCR_TSB1K 0x0000000000000000UL -#define IOMMUCR_TSB2K 0x0000000000010000UL -#define IOMMUCR_TSB4K 0x0000000000020000UL -#define IOMMUCR_TSB8K 0x0000000000030000UL -#define IOMMUCR_TSB16K 0x0000000000040000UL -#define IOMMUCR_TSB32K 0x0000000000050000UL -#define IOMMUCR_TSB64K 0x0000000000060000UL -#define IOMMUCR_TSB128K 0x0000000000070000UL -/* Mask for above */ -#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL -/* 8K iommu page size */ +/* TSB cache snoop enable */ +#define IOMMUCR_SE 0x0000000000000400UL +/* Cache modes - Fire and Oberon */ +#define IOMMUCR_CM_NC_TLB_TBW 0x0000000000000000UL +#define IOMMUCR_CM_LC_NTLB_NTBW 0x0000000000000100UL +#define IOMMUCR_CM_LC_TLB_TBW 0x0000000000000200UL +#define IOMMUCR_CM_C_TLB_TBW 0x0000000000000300UL +/* IOMMU page size - pre-Fire only */ #define IOMMUCR_8KPG 0x0000000000000000UL -/* 64K iommu page size */ #define IOMMUCR_64KPG 0x0000000000000004UL -/* Diag enable */ +/* Bypass enable - Fire and Oberon */ +#define IOMMUCR_BE 0x0000000000000002UL +/* Diagnostic mode enable - pre-Fire only */ #define IOMMUCR_DE 0x0000000000000002UL -/* Enable IOMMU */ +/* IOMMU/translation enable */ #define IOMMUCR_EN 0x0000000000000001UL /* + * TSB base register bits + */ + /* TSB base address */ +#define IOMMUTB_TB_MASK 0x000007ffffffe000UL +#define IOMMUTB_TB_SHIFT 13 +/* IOMMU page size - Fire and Oberon */ +#define IOMMUTB_8KPG 0x0000000000000000UL +#define IOMMUTB_64KPG 0x0000000000000100UL +/* Nummber of entries in the IOTSB - Fire and Oberon */ +#define IOMMUTB_TSBSZ_MASK 0x0000000000000004UL +#define IOMMUTB_TSBSZ_SHIFT 0 + +/* + * TSB size definitions for both control and TSB base register */ +#define IOMMU_TSB1K 0 +#define IOMMU_TSB2K 1 +#define IOMMU_TSB4K 2 +#define IOMMU_TSB8K 3 +#define IOMMU_TSB16K 4 +#define IOMMU_TSB32K 5 +#define IOMMU_TSB64K 6 +#define IOMMU_TSB128K 7 +/* Fire and Oberon */ +#define IOMMU_TSB256K 8 +/* Fire and Oberon */ +#define IOMMU_TSB512K 9 +#define IOMMU_TSBENTRIES(tsbsz) \ + ((1 << (tsbsz)) << (IO_PAGE_SHIFT - IOTTE_SHIFT)) + +/* * Diagnostic register definitions */ #define IOMMU_DTAG_VPNBITS 19 @@ -113,16 +145,16 @@ */ /* Entry valid */ #define IOTTE_V 0x8000000000000000UL -/* 8K or 64K page? */ +/* Page size - pre-Fire only */ #define IOTTE_64K 0x2000000000000000UL #define IOTTE_8K 0x0000000000000000UL -/* Is page streamable? */ +/* Streamable page - streaming buffer equipped variants only */ #define IOTTE_STREAM 0x1000000000000000UL -/* Accesses to same bus segment? */ +/* Accesses to the same bus segment - SBus only */ #define IOTTE_LOCAL 0x0800000000000000UL -/* Let's assume this is correct */ -#define IOTTE_PAMASK 0x000007ffffffe000UL -/* Accesses to cacheable space */ +/* Physical address mask (based on Oberon) */ +#define IOTTE_PAMASK 0x00007fffffffe000UL +/* Accesses to cacheable space - pre-Fire only */ #define IOTTE_C 0x0000000000000010UL /* Writeable */ #define IOTTE_W 0x0000000000000002UL Modified: stable/7/sys/sparc64/include/iommuvar.h ============================================================================== --- stable/7/sys/sparc64/include/iommuvar.h Wed Jan 13 21:16:07 2010 (r202256) +++ stable/7/sys/sparc64/include/iommuvar.h Wed Jan 13 21:16:13 2010 (r202257) @@ -66,10 +66,10 @@ struct iommu_state { int is_tsbsize; /* (r) 0 = 8K, ... */ uint64_t is_pmaxaddr; /* (r) max. physical address */ uint64_t is_dvmabase; /* (r) */ - int64_t is_cr; /* (r) Control reg value */ + uint64_t is_cr; /* (r) Control reg value */ vm_paddr_t is_flushpa[2]; /* (r) */ - volatile int64_t *is_flushva[2]; /* (r, *i) */ + volatile uint64_t *is_flushva[2]; /* (r, *i) */ /* * (i) * When a flush is completed, 64 bytes will be stored at the given @@ -99,11 +99,14 @@ struct iommu_state { /* behavior flags */ u_int is_flags; /* (r) */ #define IOMMU_RERUN_DISABLE (1 << 0) +#define IOMMU_FIRE (1 << 1) +#define IOMMU_FLUSH_CACHE (1 << 2) +#define IOMMU_PRESERVE_PROM (1 << 3) }; /* interfaces for PCI/SBus code */ -void iommu_init(const char *name, struct iommu_state *is, int tsbsize, - uint32_t iovabase, int resvpg); +void iommu_init(const char *name, struct iommu_state *is, u_int tsbsize, + uint32_t iovabase, u_int resvpg); void iommu_reset(struct iommu_state *is); void iommu_decode_fault(struct iommu_state *is, vm_offset_t phys); Modified: stable/7/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/iommu.c Wed Jan 13 21:16:07 2010 (r202256) +++ stable/7/sys/sparc64/sparc64/iommu.c Wed Jan 13 21:16:13 2010 (r202257) @@ -138,11 +138,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include @@ -212,6 +214,12 @@ static __inline void iommu_tlb_flush(struct iommu_state *is, bus_addr_t va) { + if ((is->is_flags & IOMMU_FIRE) != 0) + /* + * Direct page flushing is not supported and also not + * necessary due to cache snooping. + */ + return; IOMMU_WRITE8(is, is_iommu, IMR_FLUSH, va); } @@ -282,18 +290,19 @@ iommu_map_remq(struct iommu_state *is, b * - create a private DVMA map. */ void -iommu_init(const char *name, struct iommu_state *is, int tsbsize, - uint32_t iovabase, int resvpg) +iommu_init(const char *name, struct iommu_state *is, u_int tsbsize, + uint32_t iovabase, u_int resvpg) { vm_size_t size; vm_offset_t offs; - uint64_t end; + uint64_t end, obpmap, obpptsb, tte; + u_int maxtsbsize, obptsbentries, obptsbsize, slot, tsbentries; int i; /* - * Setup the iommu. + * Setup the IOMMU. * - * The sun4u iommu is part of the PCI or SBus controller so we + * The sun4u IOMMU is part of the PCI or SBus controller so we * will deal with it here.. * * The IOMMU address space always ends at 0xffffe000, but the starting @@ -301,16 +310,30 @@ iommu_init(const char *name, struct iomm * is->is_tsbsize entries, where each entry is 8 bytes. The start of * the map can be calculated by (0xffffe000 << (8 + is->is_tsbsize)). */ - is->is_cr = (tsbsize << IOMMUCR_TSBSZ_SHIFT) | IOMMUCR_EN; + if ((is->is_flags & IOMMU_FIRE) != 0) { + maxtsbsize = IOMMU_TSB512K; + /* + * We enable bypass in order to be able to use a physical + * address for the event queue base. + */ + is->is_cr = IOMMUCR_SE | IOMMUCR_CM_C_TLB_TBW | IOMMUCR_BE; + } else { + maxtsbsize = IOMMU_TSB128K; + is->is_cr = (tsbsize << IOMMUCR_TSBSZ_SHIFT) | IOMMUCR_DE; + } + if (tsbsize > maxtsbsize) + panic("%s: unsupported TSB size ", __func__); + tsbentries = IOMMU_TSBENTRIES(tsbsize); + is->is_cr |= IOMMUCR_EN; is->is_tsbsize = tsbsize; is->is_dvmabase = iovabase; if (iovabase == -1) is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize); size = IOTSB_BASESZ << is->is_tsbsize; - printf("%s: DVMA map: %#lx to %#lx%s\n", name, + printf("%s: DVMA map: %#lx to %#lx %d entries%s\n", name, is->is_dvmabase, is->is_dvmabase + - (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, + (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, tsbentries, IOMMU_HAS_SB(is) ? ", streaming buffer" : ""); /* @@ -333,12 +356,54 @@ iommu_init(const char *name, struct iomm */ is->is_tsb = contigmalloc(size, M_DEVBUF, M_NOWAIT, 0, ~0UL, PAGE_SIZE, 0); - if (is->is_tsb == 0) + if (is->is_tsb == NULL) panic("%s: contigmalloc failed", __func__); is->is_ptsb = pmap_kextract((vm_offset_t)is->is_tsb); bzero(is->is_tsb, size); /* + * Add the PROM mappings to the kernel IOTSB if desired. + * Note that the firmware of certain Darwin boards doesn't set + * the TSB size correctly. + */ + if ((is->is_flags & IOMMU_FIRE) != 0) + obptsbsize = (IOMMU_READ8(is, is_iommu, IMR_TSB) & + IOMMUTB_TSBSZ_MASK) >> IOMMUTB_TSBSZ_SHIFT; + else + obptsbsize = (IOMMU_READ8(is, is_iommu, IMR_CTL) & + IOMMUCR_TSBSZ_MASK) >> IOMMUCR_TSBSZ_SHIFT; + obptsbentries = IOMMU_TSBENTRIES(obptsbsize); + if (bootverbose) + printf("%s: PROM IOTSB size: %d (%d entries)\n", name, + obptsbsize, obptsbentries); + if ((is->is_flags & IOMMU_PRESERVE_PROM) != 0 && + !(cpu_impl == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { + if (obptsbentries > tsbentries) + panic("%s: PROM IOTSB entries exceed kernel", + __func__); + obpptsb = IOMMU_READ8(is, is_iommu, IMR_TSB) & + IOMMUTB_TB_MASK; + for (i = 0; i < obptsbentries; i++) { + tte = ldxa(obpptsb + i * 8, ASI_PHYS_USE_EC); + if ((tte & IOTTE_V) == 0) + continue; + slot = tsbentries - obptsbentries + i; + if (bootverbose) + printf("%s: adding PROM IOTSB slot %d " + "(kernel slot %d) TTE: %#lx\n", name, + i, slot, tte); + obpmap = (is->is_dvmabase + slot * IO_PAGE_SIZE) >> + IO_PAGE_SHIFT; + if (rman_reserve_resource(&is->is_dvma_rman, obpmap, + obpmap, IO_PAGE_SIZE >> IO_PAGE_SHIFT, RF_ACTIVE, + NULL) == NULL) + panic("%s: could not reserve PROM IOTSB slot " + "%d (kernel slot %d)", __func__, i, slot); + is->is_tsb[slot] = tte; + } + } + + /* * Initialize streaming buffer, if it is there. */ if (IOMMU_HAS_SB(is)) { @@ -349,7 +414,7 @@ iommu_init(const char *name, struct iomm offs = roundup2((vm_offset_t)is->is_flush, STRBUF_FLUSHSYNC_NBYTES); for (i = 0; i < 2; i++, offs += STRBUF_FLUSHSYNC_NBYTES) { - is->is_flushva[i] = (int64_t *)offs; + is->is_flushva[i] = (uint64_t *)offs; is->is_flushpa[i] = pmap_kextract(offs); } } @@ -368,11 +433,16 @@ iommu_init(const char *name, struct iomm void iommu_reset(struct iommu_state *is) { + uint64_t tsb; int i; - IOMMU_WRITE8(is, is_iommu, IMR_TSB, is->is_ptsb); - /* Enable IOMMU in diagnostic mode */ - IOMMU_WRITE8(is, is_iommu, IMR_CTL, is->is_cr | IOMMUCR_DE); + tsb = is->is_ptsb; + if ((is->is_flags & IOMMU_FIRE) != 0) { + tsb |= is->is_tsbsize; + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_INVAL, ~0ULL); + } + IOMMU_WRITE8(is, is_iommu, IMR_TSB, tsb); + IOMMU_WRITE8(is, is_iommu, IMR_CTL, is->is_cr); for (i = 0; i < 2; i++) { if (is->is_sb[i] != 0) { @@ -386,6 +456,8 @@ iommu_reset(struct iommu_state *is) is->is_sb[i] = 0; } } + + (void)IOMMU_READ8(is, is_iommu, IMR_CTL); } /* @@ -396,7 +468,7 @@ static void iommu_enter(struct iommu_state *is, vm_offset_t va, vm_paddr_t pa, int stream, int flags) { - int64_t tte; + uint64_t tte; KASSERT(va >= is->is_dvmabase, ("%s: va %#lx not in DVMA space", __func__, va)); @@ -423,7 +495,7 @@ iommu_enter(struct iommu_state *is, vm_o static int iommu_remove(struct iommu_state *is, vm_offset_t va, vm_size_t len) { - int streamed = 0; + int slot, streamed = 0; #ifdef IOMMU_DIAG iommu_diag(is, va); @@ -443,6 +515,12 @@ iommu_remove(struct iommu_state *is, vm_ len -= ulmin(len, IO_PAGE_SIZE); IOMMU_SET_TTE(is, va, 0); iommu_tlb_flush(is, va); + if ((is->is_flags & IOMMU_FLUSH_CACHE) != 0) { + slot = IOTSBSLOT(va); + if (len <= IO_PAGE_SIZE || slot % 8 == 7) + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_FLUSH, + is->is_ptsb + slot * 8); + } va += IO_PAGE_SIZE; } return (streamed); @@ -829,12 +907,13 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t bus_dmamap_t map, void *buf, bus_size_t buflen, struct thread *td, int flags, bus_dma_segment_t *segs, int *segp, int align) { - bus_addr_t amask, dvmaddr; + bus_addr_t amask, dvmaddr, dvmoffs; bus_size_t sgsize, esize; vm_offset_t vaddr, voffs; vm_paddr_t curaddr; pmap_t pmap = NULL; int error, firstpg, sgcnt; + u_int slot; KASSERT(buflen != 0, ("%s: buflen == 0!", __func__)); if (buflen > dt->dt_maxsize) @@ -877,8 +956,15 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t buflen -= sgsize; vaddr += sgsize; - iommu_enter(is, trunc_io_page(dvmaddr), trunc_io_page(curaddr), + dvmoffs = trunc_io_page(dvmaddr); + iommu_enter(is, dvmoffs, trunc_io_page(curaddr), (map->dm_flags & DMF_STREAMED) != 0, flags); + if ((is->is_flags & IOMMU_FLUSH_CACHE) != 0) { + slot = IOTSBSLOT(dvmoffs); + if (buflen <= 0 || slot % 8 == 7) + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_FLUSH, + is->is_ptsb + slot * 8); + } /* * Chop the chunk up into segments of at most maxsegsz, but try @@ -1183,6 +1269,8 @@ iommu_diag(struct iommu_state *is, vm_of int i; uint64_t data, tag; + if ((is->is_flags & IOMMU_FIRE) != 0) + return; IS_LOCK_ASSERT(is); IOMMU_WRITE8(is, is_dva, 0, trunc_io_page(va)); membar(StoreStore | StoreLoad); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:17:49 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E7E1106566B; Wed, 13 Jan 2010 21:17:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CA2F8FC0A; Wed, 13 Jan 2010 21:17:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLHnCh027355; Wed, 13 Jan 2010 21:17:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLHnb8027353; Wed, 13 Jan 2010 21:17:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132117.o0DLHnb8027353@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202259 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:17:49 -0000 Author: marius Date: Wed Jan 13 21:17:48 2010 New Revision: 202259 URL: http://svn.freebsd.org/changeset/base/202259 Log: MFC: r200924 Style changes. Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:17:45 2010 (r202258) +++ stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:17:48 2010 (r202259) @@ -23,7 +23,7 @@ * 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$"); @@ -65,34 +65,32 @@ OF_getetheraddr(device_t dev, u_char *ad node = OF_peer(0); if (node <= 0 || OF_getprop(node, "idprom", &idp, sizeof(idp)) == -1) - panic("Could not determine the machine ethernet address"); + panic("Could not determine the machine Ethernet address"); bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { - uint32_t space; - space = phys_hi; if (strcmp(bus, "ebus") == 0 || strcmp(bus, "isa") == 0) - space &= 0x1; + phys_hi &= 0x1; else if (strcmp(bus, "pci") == 0) - space &= OFW_PCI_PHYS_HI_SPACEMASK; + phys_hi &= OFW_PCI_PHYS_HI_SPACEMASK; /* The phys.hi cells of the other busses only contain space bits. */ - return (space); + return (phys_hi); } /* * Return the physical address and the bus space to use for a node * referenced by its package handle and the index of the register bank - * to decode. Intended to be used to together with sparc64_fake_bustag() + * to decode. Intended to be used to together with sparc64_fake_bustag() * by console drivers in early boot only. * Works by mapping the address of the node's bank given in the address * space of its parent upward in the device tree at each bridge along the * path. * Currently only really deals with max. 64-bit addresses, i.e. addresses - * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter + * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter * a 3 phys cells address (as with PCI addresses) we assume phys.hi can * be ignored except for the space bits (generally contained in phys.hi) * and treat phys.mid as phys.hi. @@ -110,17 +108,17 @@ OF_decode_addr(phandle_t node, int bank, /* * In general the addresses are contained in the "reg" property - * of a node. The first address in the "reg" property of a PCI + * of a node. The first address in the "reg" property of a PCI * node however is the address of its configuration registers in - * the configuration space of the host bridge. Additional entries - * denote the memory and I/O addresses. For relocatable addresses + * the configuration space of the host bridge. Additional entries + * denote the memory and I/O addresses. For relocatable addresses * the "reg" property contains the BAR, for non-relocatable - * addresses it contains the absolute PCI address. The PCI-only + * addresses it contains the absolute PCI address. The PCI-only * "assigned-addresses" property however always contains the * absolute PCI addresses. * The "assigned-addresses" and "reg" properties are arrays of * address structures consisting of #address-cells 32-bit phys - * cells and #size-cells 32-bit size cells. If a parent lacks + * cells and #size-cells 32-bit size cells. If a parent lacks * the "#address-cells" or "#size-cells" property the default * for #address-cells to use is 2 and for #size-cells 1. */ From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:19:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6C61065672; Wed, 13 Jan 2010 21:19:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9258FC0C; Wed, 13 Jan 2010 21:19:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLJkvC027891; Wed, 13 Jan 2010 21:19:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLJkX3027889; Wed, 13 Jan 2010 21:19:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132119.o0DLJkX3027889@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202261 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:19:47 -0000 Author: marius Date: Wed Jan 13 21:19:46 2010 New Revision: 202261 URL: http://svn.freebsd.org/changeset/base/202261 Log: MFC: r200925 - By re-arranging the code in OF_decode_addr() somewhat and accepting a bit of a detour we can just iterate through the banks array instead of having to calculate every offset. This change is inspired by the powerpc version of this function. - Add support for the JBus to EBus bridges which hang off of nexus(4). Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:19:46 2010 (r202260) +++ stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:19:46 2010 (r202261) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 by Marius Strobl . + * Copyright (c) 2005 - 2009 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,11 +99,11 @@ int OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr) { char name[32]; - uint64_t cend, cstart, end, phys, sz, start; + uint64_t cend, cstart, end, phys, pphys, sz, start; pcell_t addrc, szc, paddrc; phandle_t bus, lbus, pbus; uint32_t banks[10 * 5]; /* 10 PCI banks */ - uint32_t cspace, spc; + uint32_t cspc, pspc, spc; int i, j, nbank; /* @@ -149,17 +149,18 @@ OF_decode_addr(phandle_t node, int bank, nbank /= sizeof(banks[0]) * (addrc + szc); if (bank < 0 || bank > nbank - 1) return (ENXIO); + bank *= addrc + szc; + spc = phys_hi_mask_space(name, banks[bank]); + /* Skip the high cell for 3-cell addresses. */ + bank += addrc - 2; phys = 0; for (i = 0; i < MIN(2, addrc); i++) - phys |= (uint64_t)banks[(addrc + szc) * bank + addrc - 2 + i] << - 32 * (MIN(2, addrc) - i - 1); + phys = ((uint64_t)phys << 32) | banks[bank++]; sz = 0; for (i = 0; i < szc; i++) - sz |= (uint64_t)banks[(addrc + szc) * bank + addrc + i] << - 32 * (szc - i - 1); + sz = ((uint64_t)sz << 32) | banks[bank++]; start = phys; end = phys + sz - 1; - spc = phys_hi_mask_space(name, banks[(addrc + szc) * bank]); /* * Map upward in the device tree at every bridge we encounter @@ -171,7 +172,7 @@ OF_decode_addr(phandle_t node, int bank, * If a bridge doesn't have a "ranges" property no mapping is * necessary at that bridge. */ - cspace = 0; + cspc = 0; lbus = bus; while ((pbus = OF_parent(bus)) != 0) { if (OF_getprop(pbus, "#address-cells", &paddrc, @@ -194,42 +195,40 @@ OF_decode_addr(phandle_t node, int bank, return (ENXIO); } nbank /= sizeof(banks[0]) * (addrc + paddrc + szc); + bank = 0; for (i = 0; i < nbank; i++) { - cspace = phys_hi_mask_space(name, - banks[(addrc + paddrc + szc) * i]); - if (cspace != spc) + cspc = phys_hi_mask_space(name, banks[bank]); + if (cspc != spc) { + bank += addrc + paddrc + szc; continue; + } + /* Skip the high cell for 3-cell addresses. */ + bank += addrc - 2; phys = 0; for (j = 0; j < MIN(2, addrc); j++) - phys |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + - addrc - 2 + j] << - 32 * (MIN(2, addrc) - j - 1); + phys = ((uint64_t)phys << 32) | banks[bank++]; + pspc = banks[bank]; + /* Skip the high cell for 3-cell addresses. */ + bank += paddrc - 2; + pphys = 0; + for (j = 0; j < MIN(2, paddrc); j++) + pphys = + ((uint64_t)pphys << 32) | banks[bank++]; sz = 0; for (j = 0; j < szc; j++) - sz |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + addrc + - paddrc + j] << - 32 * (szc - j - 1); + sz = ((uint64_t)sz << 32) | banks[bank++]; cstart = phys; cend = phys + sz - 1; if (start < cstart || start > cend) continue; if (end < cstart || end > cend) return (ENXIO); - phys = 0; - for (j = 0; j < MIN(2, paddrc); j++) - phys |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + addrc + - paddrc - 2 + j] << - 32 * (MIN(2, paddrc) - j - 1); - start += phys - cstart; - end += phys - cstart; if (OF_getprop(pbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; - spc = phys_hi_mask_space(name, - banks[(addrc + paddrc + szc) * i + addrc]); + spc = phys_hi_mask_space(name, pspc); + start += pphys - cstart; + end += pphys - cstart; break; } if (i == nbank) @@ -240,8 +239,8 @@ OF_decode_addr(phandle_t node, int bank, bus = pbus; } - /* Done with mapping. Return the bus space as used by FreeBSD. */ *addr = start; + /* Determine the bus space based on the last bus we mapped. */ if (OF_parent(lbus) == 0) { *space = NEXUS_BUS_SPACE; return (0); @@ -249,11 +248,12 @@ OF_decode_addr(phandle_t node, int bank, if (OF_getprop(lbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; - if (strcmp(name, "central") == 0 || strcmp(name, "upa") == 0) { + if (strcmp(name, "central") == 0 || strcmp(name, "ebus") == 0 || + strcmp(name, "upa") == 0) { *space = NEXUS_BUS_SPACE; return (0); } else if (strcmp(name, "pci") == 0) { - switch (cspace) { + switch (cspc) { case OFW_PCI_PHYS_HI_SPACE_IO: *space = PCI_IO_BUS_SPACE; return (0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:21:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC7FD106568D; Wed, 13 Jan 2010 21:21:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B1858FC0A; Wed, 13 Jan 2010 21:21:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLLWwZ028406; Wed, 13 Jan 2010 21:21:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLLWxk028403; Wed, 13 Jan 2010 21:21:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132121.o0DLLWxk028403@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202263 - stable/7/sys/dev/uart X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:21:32 -0000 Author: marius Date: Wed Jan 13 21:21:32 2010 New Revision: 202263 URL: http://svn.freebsd.org/changeset/base/202263 Log: MFC: r200926 Recognize the NS16552 found in PCIe-based sun4u machines. Modified: stable/7/sys/dev/uart/uart_bus_ebus.c stable/7/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_ebus.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_ebus.c Wed Jan 13 21:21:29 2010 (r202262) +++ stable/7/sys/dev/uart/uart_bus_ebus.c Wed Jan 13 21:21:32 2010 (r202263) @@ -77,7 +77,7 @@ uart_ebus_probe(device_t dev) if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") || !strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") || !strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") || - !strcmp(cmpt, "su16550")) { + !strcmp(cmpt, "su16550") || !strcmp(cmpt, "su16552")) { /* * On AXi and AXmp boards the NS16550 (used to connect * keyboard/mouse) share their IRQ lines with the i8042. Modified: stable/7/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/7/sys/dev/uart/uart_cpu_sparc64.c Wed Jan 13 21:21:29 2010 (r202262) +++ stable/7/sys/dev/uart/uart_cpu_sparc64.c Wed Jan 13 21:21:32 2010 (r202263) @@ -254,7 +254,8 @@ uart_cpu_getdev(int devtype, struct uart addr += range - range * (di->bas.chan - 1); } else if (!strcmp(buf, "lom-console") || !strcmp(buf, "su") || !strcmp(buf, "su_pnp") || !strcmp(compat, "rsc-console") || - !strcmp(compat, "su") || !strcmp(compat, "su16550")) { + !strcmp(compat, "su") || !strcmp(compat, "su16550") || + !strcmp(compat, "su16552")) { class = &uart_ns8250_class; di->bas.chan = 0; } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 13 21:23:29 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88BDE1065696; Wed, 13 Jan 2010 21:23:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 774588FC0A; Wed, 13 Jan 2010 21:23:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DLNTdj028995; Wed, 13 Jan 2010 21:23:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLNTab028993; Wed, 13 Jan 2010 21:23:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132123.o0DLNTab028993@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202266 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:23:29 -0000 Author: marius Date: Wed Jan 13 21:23:29 2010 New Revision: 202266 URL: http://svn.freebsd.org/changeset/base/202266 Log: MFC: r200938 - Don't check for a valid interrupt controller on every interrupt in intr_execute_handlers(). If we managed to get here without an associated interrupt controller we have way bigger problems. While at it predict stray vector interrupts as false as they are rather unlikely. - Don't blindly call the clear function of an interrupt controller when adding a handler in inthand_add() as interrupt controllers like the one driven by upa(4) are auto-clearing and thus provide NULL instead. Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:27 2010 (r202265) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:29 2010 (r202266) @@ -277,7 +277,7 @@ intr_execute_handlers(void *cookie) struct intr_vector *iv; iv = cookie; - if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0) + if (__predict_false(intr_event_handle(iv->iv_event, NULL) != 0)) intr_stray_vector(iv); } @@ -378,7 +378,8 @@ inthand_add(const char *name, int vec, d #endif ic->ic_enable(iv); /* Ensure the interrupt is cleared, it might have triggered before. */ - ic->ic_clear(iv); + if (ic->ic_clear != NULL) + ic->ic_clear(iv); sx_xunlock(&intr_table_lock); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 20:20:26 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBDE0106566B; Thu, 14 Jan 2010 20:20:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9EF28FC1B; Thu, 14 Jan 2010 20:20:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EKKQSC035270; Thu, 14 Jan 2010 20:20:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKKQGp035267; Thu, 14 Jan 2010 20:20:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142020.o0EKKQGp035267@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 20:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202296 - in stable/7/sys: conf dev/ste modules/ste pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:20:27 -0000 Author: yongari Date: Thu Jan 14 20:20:26 2010 New Revision: 202296 URL: http://svn.freebsd.org/changeset/base/202296 Log: MFC r181739: Move the ste driver from sys/pci to sys/dev/ste. Added: stable/7/sys/dev/ste/ - copied from r181739, head/sys/dev/ste/ Deleted: stable/7/sys/pci/if_ste.c stable/7/sys/pci/if_stereg.h Modified: stable/7/sys/conf/files stable/7/sys/modules/ste/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Thu Jan 14 19:23:41 2010 (r202295) +++ stable/7/sys/conf/files Thu Jan 14 20:20:26 2010 (r202296) @@ -1207,6 +1207,7 @@ dev/spibus/spibus.c optional spibus dev/spibus/spibus_if.m optional spibus dev/sr/if_sr.c optional sr dev/sr/if_sr_pci.c optional sr pci +dev/ste/if_ste.c optional ste pci dev/stg/tmc18c30.c optional stg dev/stg/tmc18c30_isa.c optional stg isa dev/stg/tmc18c30_pccard.c optional stg pccard @@ -2124,7 +2125,6 @@ pci/amdpm.c optional amdpm pci | nfpm pci/amdsmb.c optional amdsmb pci pci/if_mn.c optional mn pci pci/if_rl.c optional rl pci -pci/if_ste.c optional ste pci pci/if_tl.c optional tl pci pci/if_wb.c optional wb pci pci/if_xl.c optional xl pci Modified: stable/7/sys/modules/ste/Makefile ============================================================================== --- stable/7/sys/modules/ste/Makefile Thu Jan 14 19:23:41 2010 (r202295) +++ stable/7/sys/modules/ste/Makefile Thu Jan 14 20:20:26 2010 (r202296) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../pci +.PATH: ${.CURDIR}/../../dev/ste KMOD= if_ste SRCS= if_ste.c device_if.h bus_if.h pci_if.h From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 20:40:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2AF8106566B; Thu, 14 Jan 2010 20:40:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916EF8FC0A; Thu, 14 Jan 2010 20:40:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EKebmZ039952; Thu, 14 Jan 2010 20:40:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKebiG039949; Thu, 14 Jan 2010 20:40:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142040.o0EKebiG039949@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 20:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202298 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:40:37 -0000 Author: yongari Date: Thu Jan 14 20:40:37 2010 New Revision: 202298 URL: http://svn.freebsd.org/changeset/base/202298 Log: Partial merge r199559: - Add a private timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Fix some issues in detach for sn(4), ste(4), and ti(4). Primarily this means calling ether_ifdetach() before anything else. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 20:38:40 2010 (r202297) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 20:40:37 2010 (r202298) @@ -108,7 +108,7 @@ static int ste_ioctl(struct ifnet *, u_l static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); -static void ste_watchdog(struct ifnet *); +static void ste_watchdog(struct ste_softc *); static int ste_shutdown(device_t); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, struct mbuf *); @@ -919,7 +919,7 @@ ste_txeof(sc) sc->ste_cdata.ste_tx_cons = idx; if (idx == sc->ste_cdata.ste_tx_prod) - ifp->if_timer = 0; + sc->ste_timer = 0; } static void @@ -955,6 +955,8 @@ ste_stats_update(xsc) } } + if (sc->ste_timer > 0 && --sc->ste_timer == 0) + ste_watchdog(sc); callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); return; @@ -1089,7 +1091,6 @@ ste_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ste_ioctl; ifp->if_start = ste_start; - ifp->if_watchdog = ste_watchdog; ifp->if_init = ste_init; IFQ_SET_MAXLEN(&ifp->if_snd, STE_TX_LIST_CNT - 1); ifp->if_snd.ifq_drv_maxlen = STE_TX_LIST_CNT - 1; @@ -1154,11 +1155,11 @@ ste_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); STE_LOCK(sc); ste_stop(sc); STE_UNLOCK(sc); callout_drain(&sc->ste_stat_callout); - ether_ifdetach(ifp); } if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); @@ -1703,7 +1704,7 @@ ste_start_locked(ifp) BPF_MTAP(ifp, cur_tx->ste_mbuf); STE_INC(idx, STE_TX_LIST_CNT); - ifp->if_timer = 5; + sc->ste_timer = 5; } sc->ste_cdata.ste_tx_prod = idx; @@ -1711,13 +1712,12 @@ ste_start_locked(ifp) } static void -ste_watchdog(ifp) - struct ifnet *ifp; +ste_watchdog(struct ste_softc *sc) { - struct ste_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - STE_LOCK(sc); + ifp = sc->ste_ifp; + STE_LOCK_ASSERT(sc); ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1731,7 +1731,6 @@ ste_watchdog(ifp) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); - STE_UNLOCK(sc); return; } Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 20:38:40 2010 (r202297) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 20:40:37 2010 (r202298) @@ -517,6 +517,7 @@ struct ste_softc { int ste_tx_thresh; u_int8_t ste_link; int ste_if_flags; + int ste_timer; struct ste_chain *ste_tx_prev; struct ste_list_data *ste_ldata; struct ste_chain_data ste_cdata; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 20:58:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CFE1065676; Thu, 14 Jan 2010 20:58:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11D058FC13; Thu, 14 Jan 2010 20:58:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EKwJBh044102; Thu, 14 Jan 2010 20:58:19 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKwJbX044100; Thu, 14 Jan 2010 20:58:19 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142058.o0EKwJbX044100@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 20:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202300 - stable/7/sys/dev/mxge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:58:20 -0000 Author: gallatin Date: Thu Jan 14 20:58:19 2010 New Revision: 202300 URL: http://svn.freebsd.org/changeset/base/202300 Log: MFC 202119: Fix reporting of 10G Twinax media Modified: stable/7/sys/dev/mxge/if_mxge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 20:47:49 2010 (r202299) +++ stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 20:58:19 2010 (r202300) @@ -2588,6 +2588,7 @@ static struct mxge_media_type mxge_xfp_m }; static struct mxge_media_type mxge_sfp_media_types[] = { + {IFM_10G_TWINAX, 0, "10GBASE-Twinax"}, {0, (1 << 7), "Reserved"}, {IFM_10G_LRM, (1 << 6), "10GBASE-LRM"}, {IFM_10G_LR, (1 << 5), "10GBASE-LR"}, @@ -2722,7 +2723,7 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, IFM_10G_CX4); + mxge_set_media(sc, mxge_media_types[0].flag); return; } for (i = 1; i < mxge_media_type_entries; i++) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 21:10:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C484A1065693; Thu, 14 Jan 2010 21:10:41 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B377C8FC14; Thu, 14 Jan 2010 21:10:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ELAfJM047039; Thu, 14 Jan 2010 21:10:41 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELAffb047037; Thu, 14 Jan 2010 21:10:41 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142110.o0ELAffb047037@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 21:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202304 - in stable/7/sys/dev: mxge ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:10:41 -0000 Author: gallatin Date: Thu Jan 14 21:10:41 2010 New Revision: 202304 URL: http://svn.freebsd.org/changeset/base/202304 Log: MFC r202121: Use better default RSS hash (src + dst, rather than just src port) Modified: stable/7/sys/dev/mxge/if_mxge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ste/if_ste.c (props changed) stable/7/sys/dev/ste/if_stereg.h (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 21:10:36 2010 (r202303) +++ stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 21:10:41 2010 (r202304) @@ -97,7 +97,7 @@ static int mxge_verbose = 0; static int mxge_lro_cnt = 8; static int mxge_ticks; static int mxge_max_slices = 1; -static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; +static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; static int mxge_throttle = 0; @@ -3907,7 +3907,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) sc->pause = mxge_flow_control; if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { - mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; + mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; } if (mxge_initial_mtu > ETHERMTU_JUMBO || mxge_initial_mtu < ETHER_MIN_LEN) From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 21:30:22 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E802210656CA; Thu, 14 Jan 2010 21:30:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62FB8FC14; Thu, 14 Jan 2010 21:30:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ELUMjE051501; Thu, 14 Jan 2010 21:30:22 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELUMr9051498; Thu, 14 Jan 2010 21:30:22 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142130.o0ELUMr9051498@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 21:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202306 - in stable/7/sys/dev: mxge ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:30:23 -0000 Author: gallatin Date: Thu Jan 14 21:30:22 2010 New Revision: 202306 URL: http://svn.freebsd.org/changeset/base/202306 Log: MFC: r194747,r202120: Update mxge(4) firmware to 1.4.48b (latest available) from Myricom. Modified: stable/7/sys/dev/mxge/eth_z8e.h stable/7/sys/dev/mxge/ethp_z8e.h stable/7/sys/dev/mxge/rss_eth_z8e.h stable/7/sys/dev/mxge/rss_ethp_z8e.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ste/if_ste.c (props changed) stable/7/sys/dev/ste/if_stereg.h (props changed) Modified: stable/7/sys/dev/mxge/eth_z8e.h ============================================================================== --- stable/7/sys/dev/mxge/eth_z8e.h Thu Jan 14 21:30:06 2010 (r202305) +++ stable/7/sys/dev/mxge/eth_z8e.h Thu Jan 14 21:30:22 2010 (r202306) @@ -28,6951 +28,7255 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 357812 ; -static unsigned int eth_z8e_length = 111096 ; -static unsigned char eth_z8e[111096 + 1] = - "\x78\x9c\xec\xbd\x7f\x78\x54\xd5\xb5\x37\xbe\x72\x32\xc0\x24\x0d" - "\xcc\x88\x29\x1d\x11\x75\x50\xb4\xd1\xf2\x23\x2a\xb6\x68\x41\xa3" - "\x80\xc5\x5e\x7e\xa4\x8a\x6d\xaa\x68\x82\x26\x34\x68\x84\x08\x11" - "\x07\x08\x99\x61\xc0\x36\x41\x20\x51\x02\x44\x08\x49\x6c\x43\x8b" - "\x14\x24\x56\xda\xd2\xb7\x56\xa7\x25\xbe\x0f\xbd\x0d\x19\x6e\xbf" - "\xd0\x37\x57\xf1\x76\xe4\x46\x9a\x72\x13\x18\xc9\x40\xc6\x64\x66" - "\xf6\xfb\x59\x7b\x9f\x93\xcc\x0c\x13\x94\xdb\xfb\x7c\xdf\x7f\x9a" - "\xe7\x99\x9c\x73\xf6\x8f\xb5\xd7\x5e\x7b\xed\xb5\xd7\xda\x3f\xd6" - "\x26\xfa\x07\xfe\xb4\xbd\xbe\x7f\x24\xfb\x3f\xff\xfe\xf9\xf7\xcf" - "\xbf\x7f\xfe\xfd\xf3\xef\x9f\x7f\xff\xfc\xfb\x7f\xf3\x77\x5e\x33" - "\xd1\x1f\xaa\x88\x7a\xdc\x66\x9b\x8f\xba\xde\xd9\xbe\x45\x84\x10" - "\x9c\xe4\x23\xb3\x8d\x9f\xfa\x8f\x5e\x45\xb8\x56\x45\xe6\x1b\xad" - "\x94\x36\x7d\x17\x51\xf5\x28\xd1\xb9\x65\x9b\xf0\xaf\xdb\x26\x3a" - "\x67\xec\x26\x6a\x1e\x47\xb4\x65\x94\x08\x00\xce\x02\x1f\x7d\x7f" - "\x1c\xc3\x59\x87\x6f\x8e\x5f\x3f\x4a\xf8\x11\x5e\x82\xf0\x5a\x0e" - "\x5f\x3b\x0a\xb0\xd2\x89\xdc\xdb\x44\x30\x0a\xae\x99\xf3\x33\xcc" - "\x19\x63\x25\x3e\x8d\x71\x70\x18\xc6\x21\x1f\x3d\x96\x7e\x19\x18" - "\x69\x06\x5e\x01\x8d\x92\x18\x5e\xb7\x9b\x6c\x01\xb7\xe7\xcb\xc8" - "\x1b\x40\x9d\x32\x38\x6f\x25\xd2\x08\x37\x25\x37\x3b\x42\x64\xbf" - "\x91\x92\x4e\x53\xca\xdf\xf1\xd4\xf0\xfc\x88\xeb\xbb\x4e\xe5\x1b" - "\xc7\x30\x90\x37\xa9\xc7\x9d\x92\xd9\x9f\x17\xb0\xed\x65\x64\x42" - "\xda\xb7\x02\x9a\x47\x53\x69\xad\x29\x7a\x5a\x0d\x69\x17\x18\x69" - "\x55\x9c\xf6\x90\x1e\xf7\x25\xc4\x39\x62\xe3\x4c\xaf\xea\x71\x69" - "\x88\xab\x8e\xc3\xcf\xe4\xed\x0d\x11\xca\x61\x5c\xec\x3e\x3c\x0f" - "\xa3\x65\x74\xdc\x18\xa7\x66\xa4\x77\x71\xfa\x19\x76\x11\x9a\x6f" - "\x27\x89\x0b\xd3\x0e\x69\x67\x1d\x6e\x50\x69\xf1\x3e\x86\xf3\xeb" - "\xef\x76\xbc\xcb\x70\xbd\xdc\xab\x7a\xdc\xa9\x69\xb1\x38\x11\xe9" - "\x71\x23\x11\x97\x11\x1b\xf7\x6e\xa6\x1e\xf7\x15\xc4\xcd\x88\x8d" - "\x4b\x32\xf2\xd9\x10\x97\x67\xc4\x45\xb7\x93\xe2\x38\x13\x7e\x43" - "\xcc\x44\x43\xf1\x1b\x66\x36\xda\x6e\xb9\x4d\x44\x9c\xd7\x90\x49" - "\x6c\xd8\xd2\x11\x71\x0b\xf2\x3a\x82\x64\x1f\x4d\xce\x53\x94\x7a" - "\x0c\x70\x69\xf3\x2a\x32\x3b\x8b\x45\xd0\xeb\xe8\xa4\x56\x7f\x27" - "\x39\xfd\xa2\xc3\x1b\xba\x40\x65\x17\xc8\xec\x0d\x75\x51\xd9\xf3" - "\x64\x6b\x2e\xfd\x84\x12\xf1\x45\x44\x13\xe4\x1c\xc3\x79\xdb\xa9" - "\xb5\xb6\x9d\x9c\xb5\xb1\x79\x9d\xd7\x91\xed\x28\xbe\x41\x73\x0b" - "\xe3\xd1\x6c\x0f\x51\x28\x75\x4b\x47\xe9\x6b\x64\x72\x8e\x25\xed" - "\x68\xbe\x47\xc7\xe5\x4b\x35\x8c\xcb\xfa\x33\x64\xfe\xc9\x22\xb4" - "\xfd\x19\xc6\x77\x67\xc7\x81\x55\x41\xed\xb0\x6d\x36\x1d\xb6\x9d" - "\xa4\x66\xdb\x34\x6a\x76\xcc\xa0\xcd\x67\x28\xed\x70\x70\x2a\x35" - "\x9b\x1e\x44\xdf\x98\x41\xde\x4e\xbc\xdb\xc3\x48\x13\x20\xfb\x0a" - "\x42\xbb\x7e\xa9\xbc\xfa\x19\x32\xfb\x14\x4c\xb4\xe7\x97\xaa\x7f" - "\x5f\x42\xc4\x34\xe3\xef\x44\xf5\x58\x7e\x0d\xd9\x80\x5f\x07\x70" - "\xb9\x1b\xb8\x1c\x1d\x67\xa3\x4c\xe0\x3c\xcc\x5b\x13\x22\x53\x29" - "\xa5\x0c\xd2\x27\xd2\x23\x6e\xd9\x37\x3b\xeb\xb6\x89\x0e\xe6\xad" - "\xee\xd5\x39\xe8\x5f\x69\x26\x94\xdd\xc8\xe5\x6d\x46\x1f\x75\xbe" - "\x4e\xa6\xee\x17\x73\x92\xea\xb7\x89\x76\xc4\xd9\x8d\x38\xf0\x7b" - "\x3b\xe2\x3b\x26\xa5\x93\xd5\x1b\xca\xa2\xf7\x7a\x3b\x4c\x0c\x63" - "\x44\x80\x92\x18\x9e\xc5\x41\xc9\xa8\xcf\x10\xe0\xf3\x69\x3d\xc2" - "\x6f\x42\x3a\xe4\x47\xfb\x57\x04\x38\xbf\xf8\xca\xe3\x9f\x46\xbe" - "\xf2\xb8\x3f\xb2\xfd\xf1\xf3\x62\xfb\xe3\xdd\xe1\xed\x8f\x07\x9c" - "\x2b\xc9\x1c\xfe\xca\xe3\x17\x5a\x8b\x65\x1b\x58\x5b\x8b\xd1\x06" - "\x61\x32\xaf\xe9\x22\xeb\x93\xcf\xa3\xed\x43\x1f\xd1\x9a\xc5\x64" - "\x8b\xa4\xec\x68\xf0\x86\x4e\xd0\x93\xa5\x24\xf0\xde\x94\xa8\x7e" - "\xdd\xa9\xb5\x19\x8a\x67\xcd\x5c\xa7\x36\x9f\xf6\xaa\x8f\xcb\xf5" - "\xa7\x34\x66\xe0\x37\x1e\xbf\x4c\xfc\x26\x8b\xd4\xda\xc9\xa0\x95" - "\x73\xc4\xda\x24\xaa\xeb\x25\x9a\x14\xa1\x24\x34\x51\x00\xf8\x5b" - "\x07\xa1\xdb\x98\xc8\x86\x37\x9b\xbe\xea\xa2\xb2\x9e\x9e\x42\x62" - "\x99\xc2\xf2\x84\xe5\x4b\x8f\x7b\x78\x96\x4f\xdb\x62\x97\xbc\xbf" - "\x4d\x04\x44\xea\x9b\x4d\x08\xef\x08\xac\x2e\x4c\xf2\xaf\x2e\xd4" - "\xba\x53\xdf\x7c\x1b\x69\xf2\x91\x26\x47\xa7\x61\x07\xc3\x42\x3f" - "\xf1\x0f\x0f\x51\x32\x60\x16\xff\xfa\x62\x9b\x69\xd7\x36\x71\x12" - "\xe9\x36\xf6\xc3\x02\x6c\xc0\x01\xfd\x87\x37\x18\x61\xa0\x75\xfb" - "\x26\xa4\xe3\xfc\xde\x60\x16\xcb\x5d\x9f\xb7\xa8\x83\x2c\x21\x4a" - "\x15\x7d\xaa\x3c\xa4\xe9\x60\xf9\x38\x3c\x48\x43\x7b\xdc\x94\xcd" - "\xb0\x39\x9f\xb7\xb3\x83\x90\xef\x6d\xe1\x2c\x84\x5c\xa2\xb9\x3d" - "\xa2\x30\x09\xb2\xb8\xfd\x30\xf2\xab\xb2\x47\x98\x0d\x1c\xb9\x0c" - "\x6e\x6b\x89\x27\xf8\xe1\x70\x51\x90\x86\xd7\x50\x32\xf2\x3d\xc2" - "\xf0\x18\x16\xf8\xc0\x87\xba\xbe\x7d\xb8\xc8\x4f\x11\x11\x03\xd3" - "\xa7\xc3\xcb\x89\x81\x87\x70\x01\x78\xcc\x7f\xcd\xc8\x33\xbc\x41" - "\xc2\x7b\xf8\xd7\x11\x86\x17\x24\x93\x5d\xe2\xfb\x5d\x86\xd1\xc3" - "\x32\x0d\x30\x3d\x2b\x1e\xa0\x4e\x1a\xe1\xf1\x3b\x0b\x93\x5b\x4b" - "\x89\x38\xff\x81\xb2\x8e\x21\xa2\x3b\x27\x99\x79\x8e\xe3\xbd\xa1" - "\xf3\x9c\xe6\x75\xd1\x5d\x98\x3c\xbc\x93\x4c\x8c\x33\xf2\x3b\x18" - "\xcf\xe8\xb6\x7c\x78\xe6\x77\xa7\xd1\x9c\xfb\xa7\x4f\xa3\xec\xef" - "\x3d\x8c\x7f\x73\xa7\xd1\x23\xf8\x65\xde\x3d\x21\xf3\xce\x6f\x4c" - "\xb9\x93\x72\x1e\x7c\x08\xa1\xd3\xa7\xdd\x9e\xf9\xad\x09\xd9\xd3" - "\x1f\x9a\x49\xdf\x99\x7f\x47\xe6\x1d\x77\xd0\xfd\x33\x67\xdf\x9e" - "\x99\xa9\x3f\x6f\xcf\xe4\x24\x8f\x4d\x99\xf9\xc8\x84\xec\x65\x4b" - "\x4b\x96\x4e\x98\xfb\xd0\xf4\xd8\xf1\xd0\x16\x59\x11\xa1\x3a\xf0" - "\x86\xe8\x9e\x45\x02\xf2\x01\xfd\xc0\xcf\x7d\xc1\x53\x76\x1e\xfd" - "\xdc\x7a\x73\x3d\xb7\x8f\x94\x91\x23\x4e\xa2\x6f\x9b\x7a\xdc\x16" - "\x17\xe8\x54\xc3\x74\xc2\xb8\x83\x34\xe9\xaf\x21\xee\x63\x5d\x2e" - "\x73\x7c\x43\x5c\xfc\x1a\xc4\x9f\x8e\x8a\xf7\xc4\xc5\x2f\x44\xfc" - "\x7f\xe9\xf1\xa0\xb1\xc5\x17\x1b\x7f\x15\xe4\xfe\x88\x73\x9b\x11" - "\x3f\xa2\x98\x92\x81\xab\x7f\x9d\x1c\xab\xad\xe6\x7e\x3e\x03\x1f" - "\x37\x97\x66\x91\xf8\xc9\xac\x24\xb4\x4b\x12\xc6\x38\xe4\xb3\x14" - "\x82\xdf\x02\x91\xd4\xc6\x29\xa0\x3f\xa9\x30\xeb\x7c\xc1\xdf\x1b" - "\x1a\xef\x16\x4e\x84\xad\x92\x61\x8f\x72\x18\xda\x20\xb9\xa7\xbb" - "\x90\xc4\x6a\x19\x9e\x8c\xf0\x3f\xd6\x33\x0f\x70\xfa\x3e\x99\x7f" - "\x18\xc2\xde\xc0\xf7\xdd\x80\x79\x8f\x0e\x13\xe3\x6e\xfa\x21\xc0" - "\xfb\x66\x44\xe4\x90\x30\x9f\x6b\xc3\xfb\x54\xcf\xaa\x4e\x3a\x5d" - "\x4c\x9a\x0f\x71\x11\x27\x60\xf6\xf5\x97\xef\xe0\xbc\x28\xcb\xd4" - "\xd3\x57\x88\xb1\xce\x5a\xca\x63\x36\xc2\xee\x8e\xc2\xb1\x90\xcb" - "\xe4\xfe\x86\x7a\x77\x83\x26\x29\xa8\x6b\x20\x8e\x26\x56\xce\x53" - "\x29\x79\xba\xf1\x6e\xc0\xc9\x47\x7f\x82\x0c\x21\x8d\xeb\xe0\x1b" - "\x80\xa1\xd3\xf4\xaa\xc9\x71\xf9\xb3\x01\x9b\xfb\x27\xcb\x90\x64" - "\x1f\x59\x82\x46\x3b\xab\x36\xba\x2a\x3f\x36\xfd\xc8\xf1\xdd\x6e" - "\x4b\x12\xd3\x19\xcf\xe1\x48\x33\x0c\x7d\xd8\xc4\xf2\xf6\x70\x29" - "\xeb\x3b\x57\x55\xc7\xc1\x3f\x88\x74\xe9\x8c\xe3\x00\x4e\x96\xa0" - "\xae\x9f\xb4\x23\xbf\x19\x79\x8e\xc4\xe5\xe9\x40\x9e\x31\x42\xe5" - "\x49\x56\xf4\xb9\x24\x4f\x28\x0e\xaf\x31\x92\x76\x1b\x64\x1e\x13" - "\xfa\x60\x7f\x1e\xd9\x27\x63\xcb\xe5\xba\x41\x8f\x19\x99\x15\xc7" - "\x7f\xd0\x31\x2c\xe3\x98\x16\xa2\x6f\xd6\x97\xd0\x06\x77\x20\x6c" - "\x38\xf0\x98\xc6\xed\xc6\x7c\xe7\xf5\x07\x21\x33\x66\xa5\xa9\xb1" - "\x6f\xe4\xeb\x96\x52\xe2\xf7\x09\xfc\xce\xb0\x45\xdf\x6c\x9d\xe7" - "\x46\xbe\x8e\x27\x87\x97\x73\x38\x68\x8b\xb8\x7f\x89\x28\x98\x23" - "\xdf\x87\x2c\xd1\xf0\x1d\xd6\xcb\x18\x82\xef\x24\xe0\x7e\x0f\xe4" - "\x11\x78\x64\x16\xb7\xff\xe4\xd3\x74\xb5\x1e\x7f\xf5\x05\x4e\x8f" - "\xf7\xdb\xf5\xf7\xa4\x58\xbe\xbb\xba\x4b\x96\x2d\x79\x4f\xe5\x8f" - "\x28\x3e\x9b\x8e\xb8\x7f\xc7\xf3\x21\x3c\xdf\xc7\xf3\x3b\x78\xbe" - "\xee\xbc\x40\x36\x67\x18\xe3\xaf\xfa\xde\x84\xe7\xc3\x78\xae\xc4" - "\xf3\x11\x3c\x0b\x98\x5f\x20\x8f\x89\xdb\x18\x6d\xab\x78\x02\xb2" - "\x34\xa2\xfa\xc6\x30\x45\xcb\xab\xe7\xeb\x65\xaa\xfe\x22\xa2\xc2" - "\x54\x3a\x4d\xb5\x9b\x1e\xd6\x37\x8b\xe9\x92\x0d\xf8\x99\x5c\xbe" - "\x0e\x6b\x48\x02\x58\xa6\x04\xb0\x92\xa2\x61\xe1\x69\x2a\x0b\x08" - "\xe1\xa3\x91\x7e\xa6\x2b\xbe\x03\xa0\x09\xf4\x80\x91\xcd\x4c\xa7" - "\x81\xf4\x23\xf3\xa2\xda\x1b\x7a\x60\x7a\x66\x6c\x7b\x5b\x82\x4c" - "\xb3\x4a\x5d\x36\x30\xff\x4b\xbc\x85\xec\x3f\x43\x0d\x9e\x61\x19" - "\xc8\xb4\x48\x2e\xe5\xfe\x90\x0e\xfd\xff\x27\x7e\x86\xc1\x71\x81" - "\x94\x03\x99\x9c\x3f\xd9\x21\xe3\xaa\xa0\x6f\xb4\x19\x71\x5c\x76" - "\x54\xbe\x7d\x46\xbe\x48\x6a\xb5\x55\xe6\x5d\x5e\x98\xcc\x63\x25" - "\x8f\x79\x18\x7b\x3a\x90\xe6\x98\x8f\x86\x5b\x07\xb3\x0b\xfa\xb4" - "\xf4\xdf\x43\xaf\x3c\xdf\xe7\xcc\x20\x51\x5e\x4d\x13\x88\xb4\xf1" - "\x2e\x4a\xf1\x86\x8e\xd3\xbc\x90\x08\xe3\xd7\x97\xe1\xa2\xab\xbc" - "\xa1\x16\xfa\x2a\xd1\x58\x6f\x68\x23\xc6\x98\x12\x8e\x7b\xef\x26" - "\x4a\x4a\xc2\xd3\x79\x1b\x69\x49\xde\xd0\x64\x84\x37\xd2\x4d\x2e" - "\x53\xd2\x83\x2f\x89\x1e\x6f\x68\x2a\xbe\x8b\x68\xc6\x4b\xe2\xaf" - "\xb9\x61\xb2\xce\x1e\x22\x9c\xde\xd0\x6c\x7a\x70\x48\x44\x78\x43" - "\xcd\x88\xcb\xa7\x79\xe1\xcf\xc4\xbc\x70\x8f\x10\xe6\x6a\xeb\xbc" - "\xf0\x39\xbc\xff\x55\x80\xd6\x78\xbe\x27\x58\x97\x9d\x17\x76\x0a" - "\x51\x51\x4d\xb9\x2b\x35\xea\xc3\x38\x29\x52\xaa\xad\x62\x43\xb5" - "\xbd\x4f\x14\x26\x8b\xd4\xea\x1b\xfa\xfa\xf0\xdc\x50\x7d\xbd\xfc" - "\x2e\xaf\xce\x04\x1c\xfb\x04\x17\x74\x3e\xe0\x1e\x81\x9c\xf1\x86" - "\x4e\xa2\x9c\x4f\x68\xde\x4a\xbf\x60\xfc\x47\xac\x15\x78\x7f\x4f" - "\x60\xac\xb4\xcc\x5b\xe9\x14\xb9\x21\x32\x03\xa6\xdd\x1b\xea\x24" - "\x94\x93\x09\x98\x13\x24\xcc\xf2\xea\x6c\xa4\xf5\x73\x3a\x86\x65" - "\xc0\x61\x18\x9c\x76\x5e\x98\x2c\x48\x9f\xdd\x57\x51\x9d\x85\x5f" - "\x1e\x7e\x55\xc8\xfb\xe3\xbe\xd5\x92\x86\x4d\x78\xf7\x7c\x06\x7e" - "\x91\x34\x0c\xd3\x30\xa4\xe5\x31\x78\x46\x8f\xc2\xd7\x27\xf1\xdd" - "\x50\xfd\xd7\xcf\x54\x3d\xfe\x43\xaf\xc7\x47\x1c\x0e\x9e\x1a\x22" - "\x36\x6c\xa5\x80\x53\xc6\x09\xe4\x9b\x2f\xf3\x95\x6f\x85\xfc\xdf" - "\x6a\x05\x7d\x92\xe7\x85\x85\x8b\x69\x08\xba\xba\x98\x8e\x4c\x2b" - "\x51\x81\xf8\x94\xad\xa0\xcf\xd6\x3b\xfa\x2a\xb6\x82\x46\xc0\x25" - "\x75\x6b\xd6\x67\x12\xf6\xd6\xfb\x00\x67\x41\x0f\x97\x67\xde\x9a" - "\x05\x58\xd9\x9f\x69\x76\xd0\x42\x04\xe7\x85\xd6\x86\x72\x57\x52" - "\x72\x06\xb9\x80\xef\x56\xc0\x2a\x42\x1d\xd7\xe3\x39\x1b\xf1\x74" - "\x35\xca\x7a\x0f\x70\xb3\xb8\x3c\x94\x91\x0d\x98\x73\x00\x2b\x9f" - "\x71\xea\x75\x93\x15\xdf\x79\xbd\x0a\x3f\x57\xa4\x7c\x6b\x43\xc4" - "\xbc\xb5\x2a\x9a\x77\x14\xcd\x98\x67\xf6\x73\x98\xd5\xe0\x93\x70" - "\xf9\xd6\xe2\xaf\x11\x59\xe7\x06\x44\x88\x79\x65\x12\x15\x27\xb5" - "\x06\x5a\x28\x37\x64\xa6\xd6\xe2\x83\x74\x1b\xb1\xfd\x11\xa0\xd6" - "\xc0\x46\x7c\xef\xc2\xb3\x84\x8e\x76\x36\x12\xe3\x38\xb7\x38\xb0" - "\x36\x6c\xde\xea\x3f\xda\x39\x93\x90\xff\x3d\xe0\x18\x79\xb2\xd8" - "\xe4\x6a\x2d\x0e\xf0\xb7\xf3\x68\x27\xf8\x33\x2c\xc2\xa1\xf2\xad" - "\x79\x21\xf3\x36\x9a\x7b\x41\xf8\xe7\x74\xba\x86\x20\xac\xcf\x92" - "\x24\x42\x16\x87\x53\x1c\xed\x5c\x4f\x4f\x5e\xa0\xa4\xa3\x85\x07" - "\x25\x9f\x3e\x59\x5c\x4c\x32\xff\x85\x90\xe5\x89\x4e\x17\x3d\x51" - "\x48\x23\x90\xfe\x1c\xf3\xac\x18\xe1\xa2\x96\xf6\x7c\x9a\xd3\x15" - "\x4a\x9e\x7b\xa1\x4f\xb4\xe4\x6d\xa4\xa3\x85\x1b\x99\x1e\x2e\xd6" - "\xd3\xe7\x74\x75\x8b\xb9\x17\x7a\xc4\xd1\xc2\xfd\xd4\x92\x77\x90" - "\x66\x7f\xe2\xb1\x84\x2b\xb6\x16\x47\x52\xb6\x56\x45\x2a\xb6\x36" - "\x84\x2a\xb6\xe6\x85\x53\xb6\xfa\x43\x29\xdb\xa0\xb3\x6d\x2b\x06" - "\xfd\x52\x64\x5b\xa4\x6e\x5b\x82\x77\xbb\x6c\x5f\xf3\x36\x17\x74" - "\x70\xc9\xff\x5e\xd8\xde\xa2\x7c\x5b\x83\x48\xd9\xe6\xea\xab\xd8" - "\x56\xa5\xf8\x13\xdf\xa9\xdb\x1a\x14\xaf\x6c\x6b\x52\x7d\x60\xdb" - "\x01\x6e\x5f\xa4\xf1\xe0\x77\x0c\x3f\xe8\x94\xdb\x33\x01\xf3\x2a" - "\x86\x1f\x31\x6f\xcf\x8c\x94\x6f\xcf\x12\xe6\xed\xd9\x80\xad\xcd" - "\x7d\x3e\x08\x3a\x82\x86\x0e\xd0\x9f\x6d\x23\x47\x18\xdf\x61\x7a" - "\xf2\x79\x72\x7a\x1d\x27\xf1\x7e\x92\xc4\xbb\x55\x34\xf7\x79\xee" - "\x7f\x61\x3c\x9d\x02\x34\xb2\x44\x52\x00\xa7\x02\x70\x52\x00\x67" - "\xc3\xf6\x62\x5d\x36\x03\x8f\xed\x4b\x15\x1e\xdb\x8b\xfb\xfa\x32" - "\x58\xbf\x33\x21\x8d\x0b\xe1\xe7\xe5\x78\xc2\x3c\x58\xbe\xdd\x3f" - "\xe7\x25\xe1\x17\xe6\x9a\xec\xc8\x50\x92\x7d\x29\xf2\xae\x10\xaa" - "\x3f\x75\x82\x87\x47\xbb\x72\x1d\xd4\x20\x2a\xb6\xfb\x45\x4a\x0d" - "\xe0\xef\x78\x15\x70\x92\x85\x94\x47\x3b\xaa\xfa\x2a\x76\x34\xe1" - "\xd7\x30\xd0\x07\x99\x16\x3b\xaa\x62\x6d\xe7\xc4\x76\x73\x8f\xfb" - "\x9a\x16\x1f\xed\x3f\xc6\xb2\x0f\xef\x6d\x3e\x7a\xb3\x51\x7f\x6f" - "\xf7\x51\xb5\xb4\xc1\x59\xe6\x15\x97\xd1\x97\xcf\xd0\xe8\x1a\xd0" - "\x84\xdf\xd3\xf0\x5e\x3b\xef\xd6\xf7\x44\xa4\xfc\x43\x33\x78\xa0" - "\x87\x65\x90\x70\x4f\x66\xf9\x9d\x05\x7b\xc7\x2c\x7a\x32\xd2\x30" - "\x86\x6c\x16\x7d\x36\xb6\xcd\x2c\xf8\x1e\x01\xfa\x8e\xc3\x73\xe4" - "\xae\x8b\x94\x8e\x9f\x6d\x97\x3b\xe2\x62\x59\x8d\xf7\x4c\xf1\xa2" - "\x2d\x75\xf3\x0a\x1a\x6f\x09\x90\xb9\xde\x1d\xc9\xb1\xac\xb5\xb2" - "\x8d\x92\xce\xef\xc2\x5d\x33\xbb\xfe\x22\x99\x78\xcc\x89\xa4\xa0" - "\x3c\x87\x45\x88\xe5\x19\x54\xbf\x0c\xb2\xc9\x4d\xb6\x7a\xb7\x68" - "\x0a\xf7\x64\x68\x8c\xa7\x81\x0b\xe3\x06\x3c\xaf\x03\x9e\xfb\x1e" - "\x5d\x99\x45\xef\x3b\x28\xa1\x6d\xdf\xe3\x1e\xdd\x5f\xff\x41\xe2" - "\x3b\x0d\x9a\x24\x8e\xbf\x36\xcd\xa0\xd3\x60\xf6\x33\xf7\xfb\xf0" - "\x45\xe1\xaf\x5c\x42\x4c\x0b\x9b\x33\x24\xfe\x13\xb2\xd7\x55\x16" - "\xa6\xeb\xe6\xad\xbc\x41\x78\xfd\xc2\xe3\x75\x74\xc9\xf9\xaf\x7a" - "\xa4\x29\x0b\x89\x08\xdb\x8b\x6c\x2b\x56\xb3\xed\x57\xd1\x58\x2c" - "\x2a\x1a\x8b\xba\x57\x88\x50\x9d\xb4\xef\xae\x75\xf9\x68\x72\x93" - "\x6a\x9b\xad\x2e\xe8\x47\xed\xdd\xe6\xc6\x22\xc0\xbe\x8a\x61\xb7" - "\x16\x0b\x4f\x24\xa5\xb1\x04\xe9\xf6\xf8\xe8\x7f\x99\xa3\xe7\xc0" - "\x30\xde\x75\xae\xdf\xc6\x63\xde\xb5\xcd\x3e\xba\xfe\x92\x7a\xa9" - "\xd9\x3a\x42\xbb\xd8\x07\x26\xf9\x92\xf4\x69\x17\xe3\xcf\x8a\x5f" - "\x56\xe2\x68\xa3\xde\xe8\x9b\xd4\x0d\x5b\xc6\xb9\x86\xc6\xa0\x1d" - "\xae\x3d\x43\x63\xee\x76\x3a\xc4\x69\xe1\xbe\xf6\xd8\x4f\x56\x05" - "\xa1\x2b\x8c\x99\xe1\x23\xd7\x9e\xc1\xe8\x26\x58\x4e\x5e\x14\x1d" - "\x95\x2b\xfa\x69\xf6\xf1\xbc\x95\x11\xc1\xef\xdc\xef\xea\x11\xce" - "\xf4\x00\x9c\x8d\x06\x2d\x06\xa1\xbf\x49\x94\x37\xba\x94\x6e\x38" - "\xa6\x53\xb8\x05\x79\xae\xe7\x79\xb1\x31\x4a\x77\x2b\xdf\x56\xd5" - "\x0d\xb9\xc2\xf3\x07\xd0\xb5\x02\xcb\x6d\x22\x08\x98\x3e\x1f\xdd" - "\x9c\x69\xd8\x35\xde\xd0\x4c\x96\x2d\x55\x83\xcd\x3b\x0e\xc0\xbf" - "\x3e\xad\x75\x0c\x29\xb9\x64\x3e\x50\x52\xa6\xf0\x66\x1d\x2e\xc0" - "\xb6\x5c\x3b\xe2\x97\x07\x44\x87\x28\x3f\x50\xb8\x99\xc3\x56\xf4" - "\x72\xd8\x70\x96\x69\x9e\x65\x8c\xd3\xf5\xc3\x3d\xd7\xf7\xd2\x69" - "\xe8\x43\x6c\x03\x2a\xdb\xe8\xba\xe0\xe1\x12\x35\xe7\xd6\xe3\xbe" - "\xce\xe1\xa3\x5b\x82\x06\x5e\x2c\x07\x41\x5f\xa6\xb5\x8b\xfb\x3c" - "\xcf\x49\x2d\x2f\x15\x41\xe0\xea\x42\xda\x46\xa3\x0e\x5c\x3f\x55" - "\xaf\xeb\x0e\x45\xd7\x0b\x38\xf8\xa1\x47\x4b\x1a\x2c\x5f\x49\x66" - "\xbb\xa2\xb5\x99\xeb\xcb\x75\xe1\x3a\xcb\xba\x68\x90\xb7\x18\x67" - "\xbc\xa1\xbb\xa0\x97\xc9\xf0\x86\x1e\xf7\xf5\xd0\xfb\x6e\xae\x56" - "\x3a\xd7\x75\x0e\xa6\x65\xc2\x76\x34\x6f\xcd\x76\x7e\x46\xd7\x3b" - "\x23\xe2\x14\x60\xbe\x02\x3a\x25\xf3\x53\x8e\xd1\x41\xf0\xaf\x79" - "\xef\x6c\x1e\x9b\xbd\xa5\x17\x78\x6c\xe6\xb4\x57\x23\x6d\x3b\xd2" - "\xac\xd5\xd3\xae\x55\xf3\xa5\xf2\x39\x8c\x9f\x18\xab\xe7\x00\x8f" - "\x1a\xb6\xf1\x41\xe7\x4c\xe3\x5b\xe0\x1b\xcf\x6c\x51\xb1\x77\x76" - "\x62\x5c\x20\x5f\x55\x5f\xec\x44\x39\x5f\x61\x9e\x72\xae\xa4\x6b" - "\xc0\x97\x1f\x97\xad\xa1\xab\x99\x9f\x44\x4a\xe3\x46\x45\xf7\xeb" - "\xdb\x85\xdb\x45\x5e\x48\xce\xe2\x15\x74\x2d\xfa\xdf\xfa\x33\x74" - "\xfd\x67\xb9\xa5\x76\xe0\x4a\x54\x79\x96\x94\xac\x49\x69\x2c\x67" - "\x99\x5b\x7f\x96\x6d\xb0\x1b\x6c\x06\x2f\xe2\x7d\xdc\xe5\xe4\x02" - "\xe8\x7a\x4c\xd9\x10\x37\xbc\xc2\xf3\x4f\xa7\xe8\x86\x52\xae\x2f" - "\x7e\x49\x08\x7b\x4e\x5c\x14\x0b\x04\xeb\x73\x18\xb7\x7c\x74\xc3" - "\x1e\x3c\x8f\xc9\x9f\x9b\xf2\xf4\x6f\x0f\xd2\x2d\x10\x17\x23\x9c" - "\x06\xfa\xeb\x0d\x25\xc2\x9d\xc4\x7d\xe2\x1d\x94\xdd\xe0\xa3\x6f" - "\x1c\x51\x6d\x73\x43\x11\xc3\x1a\x04\x07\x0f\xcf\x37\xa8\x79\x06" - "\x7b\x8a\xbd\x2c\x89\xf1\x90\x73\xd8\x0c\xab\x5e\x53\xf2\x39\x02" - "\x5c\xeb\xdc\x91\x42\xc8\xe2\xc2\xc8\x86\x7d\x0d\xf2\x5d\x8f\x63" - "\x3c\x22\x28\x3f\x31\xfc\x03\x25\x9e\xd1\xcc\xe3\xf6\x7c\x05\xe7" - "\x40\xa1\x67\xf4\x19\xfe\x2e\xe0\xef\x80\x79\x7f\x83\xb7\x26\x0b" - "\xe5\x9f\x41\xb9\xf6\x7c\x65\x1b\xd8\x0b\xba\x51\x46\x8f\xdb\x9e" - "\xef\xa3\x0c\x93\x9a\x8b\xdb\xdf\x30\x48\xdf\xb3\x72\xdf\x39\x5a" - "\x4b\x7a\x9f\xbe\x31\x85\xe7\x1b\x50\xaf\xa6\xb0\x79\xdb\x31\x5d" - "\x6e\xb0\xbd\xf5\xa5\x53\x74\xa3\xb9\xb5\x50\xf2\xb7\x26\x34\x7b" - "\xf3\x9b\x11\xbf\xc6\xf3\xa5\x4a\x7c\xdd\x68\xbe\xf4\x67\x0f\x40" - "\x95\x87\x58\x1b\x6b\x55\xdf\x63\xd1\xb3\xc7\x66\xe2\xe7\x92\x74" - "\xeb\xce\x87\xfd\x73\xa3\x39\x92\x82\x36\x29\xe7\x36\xb2\x87\x44" - "\xf7\x38\x2d\xa2\xbf\xd7\x7d\xca\xb6\xc7\xd8\x0c\xd0\xff\xa0\x6a" - "\x07\x86\x41\x49\xe8\x8b\x4c\x73\xe1\xac\x11\xc1\xe6\xb2\x00\x70" - "\x1e\x9b\xd3\x5c\x13\x20\xfb\x2d\x5c\xf7\xb1\x0b\x96\xd7\x08\x7f" - "\x00\xb4\xe7\x27\xd7\xed\x70\x6d\x88\x78\xce\x16\xb0\x60\xff\x2c" - "\x3c\x2e\x65\x7e\xea\x81\x2a\x86\x27\x52\x24\x3f\x08\xa3\xee\x4a" - "\x9e\xed\x6f\xe0\x76\x04\xac\x37\x50\x6f\xcb\x59\x1a\x2b\xdb\xf3" - "\x30\xea\xbe\x0b\x32\x65\x17\xec\xc9\x7a\x29\xff\xc7\x42\xfe\xdb" - "\xd3\x8d\xf9\xc5\x4d\x88\xdb\x84\xb8\xa3\x85\x41\x62\x18\x61\xc0" - "\x96\xf6\x19\xda\x62\x4d\xa7\x08\xbe\x57\xd6\x61\xc2\x78\x8c\xf6" - "\xde\xdf\xc0\x65\x3a\xa1\x17\x7b\x96\x70\xb9\x63\xab\x20\xab\x02" - "\x09\xdb\xbf\x1f\xb7\x9b\x86\x1f\x1e\x27\xe5\x62\x53\x04\xf5\x8f" - "\x6d\x97\x9b\xd2\x54\x9b\xdc\x98\x13\xdb\x26\x37\xa5\x81\xee\x68" - "\xd9\x1b\x0f\xe2\xd7\xac\xbe\xa3\x7f\x37\x96\x47\xbd\x1f\xef\x71" - "\xdf\x58\x0d\x5a\x67\x2a\x5a\x73\x18\x70\x65\x1e\xf8\x94\xcc\x6c" - "\x93\xf3\x3c\x3d\x87\x33\xbf\x72\x78\x04\x7a\x09\x68\xb8\x07\xf1" - "\x56\xee\x8b\x95\x11\x8a\x89\xf7\xae\x07\x4f\xad\xea\x65\xba\x7e" - "\x26\xe7\x11\xd6\x96\x97\x33\x1f\x22\xcf\x3e\x4b\xa8\xbc\xbc\xc7" - "\x7d\x93\xc9\xa0\x1f\xc2\x3a\x39\x3e\xb1\x7e\x70\xd3\xf8\x7e\x3d" - "\x0a\xba\x26\xcb\x96\x4e\x1a\x37\x05\xf2\x07\x6d\xb5\xaf\x46\x8d" - "\x1b\xe3\xee\xe6\x6f\xc8\xbd\x8f\xf1\x3e\xf9\x28\xe4\x4b\xef\x86" - "\xc6\x8c\x3e\x8d\x86\xf5\x6a\x94\x15\xda\xf0\xe1\xf8\x50\x6a\xed" - "\x64\x6f\xc7\x41\x6a\x0d\xfd\x82\xec\xcf\x48\x18\x13\xbc\xcc\xcf" - "\x2b\x45\xf8\x40\xef\x1e\xd8\x71\xe7\x3c\x18\x67\x6f\x38\x43\xe3" - "\x64\xdd\x5f\x3e\x05\x0e\x7e\x52\xc2\xd6\x69\xf1\xa1\x79\xf3\x22" - "\x11\xda\x7c\x9a\xe7\x58\x6c\xa9\x9b\x7a\x69\xfc\x8e\x55\x94\x59" - "\xdb\x4b\xe3\xea\x7a\x29\x43\xfc\x2d\x43\xab\x85\xae\xf5\xe4\x05" - "\x2b\xa1\x7f\xe7\x8c\x28\x26\x73\xdd\x2a\x92\x6d\x1e\xae\x80\xce" - "\x15\x82\xce\x75\x2e\x83\xe5\x5c\xbf\xce\x05\x7d\x16\x3a\x57\xa3" - "\x5f\xf1\x45\xa3\x7f\x78\x21\x25\xa5\xe5\x91\x15\xf8\x39\xcf\xd2" - "\x4d\xcf\xa5\xb5\x43\xdf\x43\x9d\x7d\x7a\x7d\x41\x5f\x97\xa5\x90" - "\x86\xc9\xba\x42\xf6\x8a\x8a\x7d\x35\x83\x8e\xa9\x1a\xf3\x4e\x80" - "\xd7\x54\xb8\x0e\x2f\xf1\xba\xc0\xc1\xd1\x41\xd3\xf2\x5a\xf0\x1d" - "\xc2\x4b\xc6\x8a\x20\xc2\x8b\xb8\xec\x26\x84\xf7\xb8\xc7\x55\xfb" - "\xb4\x2a\xd3\x60\xf2\xd6\xb2\xd6\x18\xf7\x6f\xfe\xb2\xd0\x5c\xac" - "\x73\x17\xaf\x09\x09\xbf\xf7\x2c\xf7\xc1\x9b\xd3\xe7\x15\x89\x90" - "\x7d\x09\xaf\xd1\xdc\x6c\xe2\xf5\x23\x9e\x37\x7e\x13\x7a\xca\xe7" - "\xad\x19\xb1\xec\x87\x5e\xee\xb2\x14\x01\x26\xf4\x7e\xd6\xc9\xbf" - "\x88\xde\xcd\x6b\x8d\x5b\xe4\xba\xe6\xcd\xb3\x7d\x34\x53\x8e\xa3" - "\xac\xef\xb1\x0c\x84\xde\x74\x35\x70\x2a\x87\x9d\x0b\xdb\xf6\xe6" - "\x22\x1f\x3d\x50\xa8\xeb\x70\x72\xbd\x14\x61\xd0\xff\xa6\xef\xe3" - "\xb0\x92\xb1\x64\x2b\xb1\x8b\x8e\xc1\x74\x1f\xb9\x86\xa9\xd1\x57" - "\x90\xe7\xa0\x01\x07\xe3\xcd\xde\x6e\xed\xd1\x47\x11\x76\xc4\x80" - "\x83\x34\x5f\xc6\x77\x5b\x7f\x1a\x95\xa7\x23\x2a\xcf\xa3\xdd\xda" - "\x6d\x7b\x11\x16\x8a\xcd\x73\x4b\x5a\x6c\x9e\x5b\xc6\x44\xe5\x71" - "\xa9\x72\x6e\xc9\x8c\xcb\x93\x15\x97\x27\xfb\x52\xdc\x6e\xc9\x8f" - "\xcb\x53\x12\x97\x67\xfd\xa5\xb8\xdd\x52\x13\x97\x67\x4f\x5c\x9e" - "\x43\x51\xb4\xe4\xb5\x4a\xd8\x81\xb7\xb4\xc4\xe5\x39\x19\x97\xa7" - "\xd3\xf8\x1e\x6c\xcd\x78\xf9\x2e\xb2\x81\x2f\x3b\xb8\x3d\xa1\xb7" - "\x77\x76\x6f\x7f\xb6\x47\xe5\xfd\x6a\xc6\xa5\xf5\xfa\xea\xd4\xd8" - "\xf2\xbe\x3a\x3b\xb6\xbc\xaf\x2e\xb8\xb4\x5e\x5f\x2d\x8e\xcb\xe3" - "\x8a\xcb\x53\x15\x95\xa7\x41\x2f\xa7\x31\x2e\xcf\xc1\xb8\x3c\xcd" - "\x97\xf2\xd5\x57\xdb\xe2\xf2\x74\xc4\xe5\x09\x7e\x0e\x2d\x78\x3c" - "\x56\x6b\xfb\xa3\x58\xe7\x7d\x00\x63\x7d\xc6\x42\xb6\x65\x30\x96" - "\xf8\x7f\xd2\x1b\x1c\xc2\x63\x0a\x8f\x3f\x87\x1d\x41\xe8\x4b\x19" - "\xb3\x7c\x34\xe1\xa0\x31\x06\xf1\xba\x20\xf7\x67\xa5\x2b\x67\x64" - "\x0c\xa6\x53\x72\x39\xc6\x5a\x3f\x97\x75\x78\x0c\xeb\x5e\x19\xd5" - "\xfd\xba\xad\x5a\xff\x26\x1d\xce\xdf\xe5\x7c\x20\xaf\xa9\xa8\xf5" - "\xc6\x24\xd6\xad\x0f\x3b\x64\x9e\x23\x51\xfa\x30\x97\x1f\x38\xb8" - "\x2a\x68\x8a\xc3\x63\xcf\x65\xf0\x48\x83\x8e\x93\xd3\x8a\x51\xaa" - "\x15\xe6\xd2\xd1\x5a\xe8\x32\xd0\xdf\x19\xb7\x53\x74\x6b\xa6\xd4" - "\xad\x96\xf4\x12\xbf\x7b\x4b\xef\x21\x2f\xd2\x28\xdd\xf2\xd6\xc2" - "\x66\x94\x2f\xd7\x4c\x8a\xcf\x53\xb7\xd4\xff\x59\x07\xbb\x75\xeb" - "\xe1\x52\x3f\xf0\xba\x35\xcf\x58\x87\xf4\xd1\xad\xd5\x52\x6f\x28" - "\x3f\x90\x5d\xa7\xaf\x0b\x1d\x0e\x4c\xe1\x34\xe0\xff\x8c\x22\xa3" - "\xbe\xb0\x01\xfd\x48\x3b\xf5\x72\x34\x53\x6d\x78\xeb\x3b\xb1\x3c" - "\x39\x04\xbc\x72\xeb\xb1\xd8\x76\xbf\xd5\x17\xdb\xee\xb7\xfa\x63" - "\x79\x52\x03\x4f\xde\x66\x8a\xcd\x73\x5b\x7a\x6c\x9e\xdb\xc6\x45" - "\xe5\xa9\x52\xe5\xdc\x36\x25\x2e\xcf\xac\xb8\x3c\x39\x51\xdf\xa8" - "\xe3\x6d\x85\xfd\x36\x8c\x5c\xe3\xbe\xcd\x11\xf5\xad\x55\x4b\xf9" - "\x79\xdb\x46\x23\x8c\xd7\x09\xeb\xb6\xa9\x35\x56\x1d\xde\x9e\xb8" - "\xfe\xce\xe9\xdf\x89\xc3\xa1\x25\x0e\x87\xfe\xfe\x5f\xa9\x6c\xb0" - "\x3f\x9c\xa6\xaf\x1d\xd4\xe7\x94\x3b\x31\x5e\xcf\xe3\x6f\xc0\xaa" - "\x41\x7a\xd0\xe1\x6b\x69\xb1\xf0\xbe\x36\x26\x16\xde\xd7\xc6\x47" - "\x7d\x5b\xf1\x3d\x35\xaa\x0e\xd6\x64\x9b\xdc\x67\x02\x7d\xec\x6b" - "\xf3\x8d\x70\xb6\x0d\x81\x6f\x87\x53\x8e\x33\x59\xbc\x77\x60\xe4" - "\x29\xfa\xda\xfd\x6c\x47\xea\x30\xa3\xfb\x3f\xa9\x7a\x7d\xad\x3a" - "\x0e\x8f\xc6\x38\x3c\x0e\x46\xd5\x2b\x60\x59\x4b\xdf\xb1\x84\x1e" - "\xfe\x3e\xeb\x38\xbc\x27\x45\xae\xe1\xaf\x81\x5e\x76\x81\xac\xbc" - "\x77\xe2\x74\x09\x25\x7b\x1d\x1d\xb0\xc9\x1a\x3b\x07\xe5\xa7\xd4" - "\x03\x79\xfa\x7e\x0f\x7b\x8f\x7b\x7c\xba\xc1\x8f\x78\xb7\x83\x17" - "\x1b\xa4\xce\xb3\x61\xaf\x4f\x38\x73\x6a\x40\x47\xd8\x35\x13\x74" - "\x1d\xf5\x40\x09\xf7\x45\xc8\x9c\x0e\x8c\xeb\x69\x6a\xbd\x6b\xfc" - "\xfc\x28\x7e\x0e\xd8\x57\xdd\x27\x4e\xd1\x84\x2f\xf3\xb8\xcf\xfb" - "\x07\xd8\x66\x3e\x1c\xf0\x43\x8f\x3b\x23\xf5\x32\xc4\xa5\xeb\xf9" - "\x36\x46\xe5\xf3\xeb\x76\x6d\x07\xc7\x4d\x0a\x91\x89\xf3\x00\x46" - "\xba\xd2\xe5\x26\x7c\xf9\x30\xfa\x28\xf2\x78\x8c\x3c\x6c\x03\xcb" - "\xf5\x96\x12\x32\x4d\x2c\x25\x93\x67\xd5\x29\x09\x5b\x6f\xef\x0e" - "\xd6\x89\xbd\xa5\x1d\xe4\x0d\xb4\xf1\x7c\x94\xc9\x53\x76\x8a\xe1" - "\xa4\x27\x07\xc9\xdc\x5d\x71\x00\xe3\xd6\x84\xf4\x70\xc5\x81\x1c" - "\xd8\x36\x90\xd1\xe3\xa7\xf2\x9e\x86\x68\x7a\xcd\x9c\x99\xfd\xf0" - "\xbc\x39\x13\xbe\xf7\xf0\x43\xf3\x67\xde\x63\x9f\xbf\xf8\xb9\x82" - "\xfc\x09\x4b\x5f\x28\xb1\xbf\xb8\x6c\x71\xc9\xe2\x25\x3f\xb0\x67" - "\x3a\x6e\x76\xd8\x17\x96\xa8\x67\x46\xd1\xc2\xe5\x25\xd3\xf8\x75" - "\xbc\xbd\x78\x59\xc1\x0a\xf9\x7a\x6b\x2a\xc5\x02\x59\x5c\x52\xb0" - "\xcc\x7e\x73\xfe\x78\xfb\x83\x0b\x17\x17\xbd\xb0\xac\x20\x21\xac" - "\x7b\xec\xcb\x0a\x96\x15\x2c\xcc\xb7\x4f\xb3\x67\x32\xe4\x68\x70" - "\x51\x6d\x98\x69\x8c\x5d\x3c\x66\x55\xba\xc5\x31\x7d\x0c\xf3\x29" - "\x9e\x99\xd0\x71\xe9\xf8\x35\x21\x6e\xfc\x9f\x18\x37\xfe\x4f\x1c" - "\x73\xe9\xf8\x35\x31\x6e\xfc\x9f\x18\x37\xfe\x4f\xcc\xbe\x74\xfc" - "\x9a\x18\x37\xfe\x4f\x8c\x1b\xff\x27\xf6\x8f\xff\xe0\x23\xdf\x3a" - "\x29\x0b\x26\xc6\x8d\xff\x13\xe3\xc6\xff\x89\x87\xe2\xbe\x8f\x44" - "\x7d\x5f\x8d\xef\xb6\xe8\x31\x11\xdf\x1d\x46\x9f\x1c\x90\x29\x13" - "\x43\x46\x1a\x7d\xad\xbe\x5d\xa5\x9d\x94\x1e\x95\xb6\x43\xa5\x9d" - "\xd4\x3f\xfe\xb3\xec\xe0\x7d\x16\xca\xd6\x9e\xb4\x49\xae\x6d\x21" - "\x2f\x8f\x47\xe8\x1b\x37\x9c\xa5\x49\x43\x18\x16\xf3\xb0\x9c\x33" - "\xdc\xfe\x78\x4f\xfd\x48\x32\x73\x9e\xfa\x57\xc9\x24\xdc\x13\xec" - "\x78\x12\xc2\xd2\xf0\x83\x1c\x99\xb4\x1e\xfa\xee\x71\x35\x46\x4c" - "\x3a\x2e\xfb\x15\xf2\xe8\xf0\x4f\xf0\x37\xef\x2d\x40\x1e\x73\xa5" - "\x1a\x7f\xdb\xf1\x9e\xc6\x3c\x8d\xfc\x26\xa1\x4d\x28\xc0\x93\x10" - "\x66\xc5\x2f\x1d\xf0\x8e\x1b\xf0\x78\x4d\x2c\x51\x9f\x4f\x68\xe3" - "\x69\x64\xa9\x74\x47\xda\xbc\x11\xd6\xa3\x33\x4d\x6a\x4e\xa0\x71" - "\x96\x70\xbf\x97\x53\x8f\xf0\xc4\x36\x51\x26\xda\x7f\x52\x50\xc9" - "\x8a\x4c\xe8\x3f\x0f\x8e\x53\x73\x99\x8d\xb3\x20\x5f\x7b\x01\xe7" - "\x13\x3c\xfb\xf0\xfc\xa3\x01\xdf\x23\x6d\xe5\xcc\x7c\xe1\x4e\x7a" - "\x84\xe1\xc6\x85\x97\x42\x9e\xf5\x5a\x42\xae\x9c\x04\x71\x35\xc2" - "\x9d\xfc\x70\x82\xf0\x26\xe8\x08\xbd\x3e\xca\x6c\x67\x7c\xa3\xc2" - "\x8f\x08\xf7\x88\xf9\x9c\xde\xc7\xe5\x21\xcf\x60\xba\xb5\xb1\x9f" - "\x4a\xed\x5b\xbc\x3d\x3d\xae\x1e\x9f\x9d\xa6\xdb\x5f\x51\xf5\xb8" - "\xbd\x2b\xb6\xec\xdb\xc7\x27\xae\xc7\xed\x33\x50\x8f\xcf\x12\xd7" - "\xe3\x76\xb9\xa6\x2a\x34\xd4\x45\xbb\x24\xae\x14\x75\xf9\x4c\xd2" - "\x3d\x36\xbc\x5a\xd7\x7d\x02\xb0\xb9\xac\x88\x93\x79\x1f\x29\x1d" - "\x68\x37\x3d\xdd\x3b\x96\x1a\xca\x4e\x50\xe6\x71\xe1\x1e\xf6\x88" - "\x8f\xee\x90\x36\x64\x54\x78\xa7\xc2\x05\x74\xd2\x98\x4e\xa8\x0f" - "\xf2\x0d\xd6\xde\x86\x1d\xa2\xe6\x31\xee\xc0\xf8\x97\xe9\x37\xe6" - "\x20\x97\x97\x0a\xbf\x41\x47\xc4\xe5\xc4\xc5\x05\xa3\xe2\x4a\x62" - "\xe2\xd6\xf4\x87\x6f\x34\xc2\xbf\x58\x3b\xdd\xf1\x4e\x5c\x3b\xa1" - "\x7d\xee\x9c\x13\x5b\xef\x3b\x5a\x54\xfd\xd0\x46\x97\xd0\xfa\x8e" - "\x0e\xb4\x51\x5f\xe2\x36\xba\xd3\x94\x98\xd7\xee\x1c\x23\xe1\x8d" - "\xa4\x04\xf0\xee\x9c\x82\xb6\xeb\x93\x3c\xa8\xb7\xd3\xa5\xed\x73" - "\xe7\x02\xa3\x7d\xbe\x58\x1d\xef\x6c\x88\xab\x63\xf8\x34\x4d\xbe" - "\x4e\xd5\x75\xf2\x73\x71\xb0\x0f\x25\xe6\xc5\x3b\x8f\xa1\x9e\xe1" - "\x41\xea\xd9\x39\x38\x2f\x4e\xe6\xf9\x81\xf0\xa5\xbc\x38\xd9\xae" - "\xf2\x50\xa2\x3c\x53\x85\x3b\x51\x39\x93\xe7\x3b\x43\xac\xd7\x4e" - "\xde\xc8\x73\x46\x51\xe1\x45\xb1\xfc\x87\x3a\x70\x3e\xa6\x5f\x48" - "\xc9\x58\x6e\x87\xd3\x76\xd2\x3e\x8f\x27\x7b\xdc\x93\x5b\xe2\x68" - "\x75\xee\x34\xdd\x35\xa7\x5b\x4b\x6a\x54\xf4\xfa\xfa\x55\x71\x38" - "\x75\x24\xa6\xd7\x5d\x10\x14\x74\x2e\x31\xbd\xee\x1a\x33\x38\xbd" - "\xee\xe2\xf6\x3f\x77\x29\xbd\xee\xca\x8e\xa6\x17\x74\x5b\x59\xbf" - "\x9b\x6c\xe0\x8d\xbe\x5c\xc1\x73\x6e\xa0\x89\xd5\x02\x5e\x51\x79" - "\x3a\x39\xcf\x7a\x4b\x50\xf1\x09\x74\x46\xf3\x59\xba\xab\xc8\xe8" - "\xff\x23\x6a\x68\x98\xe8\x7b\x5c\x00\x5e\x12\xe7\xf3\x3a\xce\x79" - "\xbc\xa1\x4c\x62\x7b\x23\xae\xdc\x23\x89\x65\xc1\x5d\x3e\xd0\xf4" - "\xd5\x04\xe1\x41\xb5\x37\xe4\xeb\x99\xb1\x32\xe2\xeb\xd6\xd8\x36" - "\x02\xdd\x90\x2f\x6a\x4f\xf8\x65\x7f\x97\x6f\xb3\xaf\xbb\x2e\x6d" - "\xb3\x6f\x8c\x55\xed\xf5\x8d\xa4\x58\xfc\xbe\x5e\x93\xb8\xbd\xbe" - "\xde\x34\x78\x7b\x7d\xbd\x65\xf0\xf6\xfa\x7a\x07\xb7\x97\x8f\xbe" - "\x61\x8f\x1d\x37\xbe\x41\xb1\xf5\x45\xb9\xc8\x27\xb4\xa1\x57\xf3" - "\xf7\x17\xad\xb7\xf1\x63\x19\xc7\x6d\x55\x5f\x46\xe0\xe5\xa4\xb1" - "\x8c\xe3\x95\xc2\x18\x14\x36\x68\x58\xb5\x2a\xf1\x7a\x28\xdb\xb4" - "\xad\x35\xc4\x6b\xdf\x64\xbf\x9e\x75\xf6\x6f\x5c\x88\x68\xd4\x86" - "\x77\xed\x34\xdd\xfd\xfb\x88\xa6\x95\xee\x02\x6e\x6c\x8b\xd6\xc9" - "\x39\x83\x29\x69\xd1\x6d\xb1\x89\xf5\xef\x51\xca\x9e\x40\x7b\xfc" - "\xf5\x34\x4d\xd9\xaa\xda\xe5\xee\xd7\x63\xe9\x38\x25\x33\x71\xbb" - "\x4c\x99\x85\x76\xf9\x6b\xe2\x76\x99\x92\x3f\x78\xbb\x4c\xe1\xbd" - "\x01\x7f\xbd\xb4\x1f\x4d\xa9\xd1\xfb\xd1\x3a\xce\x63\x5f\xc2\xf6" - "\xf7\xdd\x29\x9c\x06\xef\xe8\x23\x53\x3e\xe5\xf8\x09\x9d\x46\x3f" - "\x92\x79\x5a\x00\x4b\x96\xaf\xa7\x39\xa2\xc3\x88\x86\xeb\xb7\x74" - "\x26\xea\x27\x77\xcb\x79\xfe\x89\xc5\x64\x06\x0d\x73\x76\x31\x8c" - "\x65\x44\x67\xe9\xee\x27\x38\x1d\x87\x4f\x0c\x44\xf7\x93\xbb\xa7" - "\x18\xe9\x58\xd6\xe9\x69\x33\x45\x4f\x21\x71\xba\x38\xd8\x7a\xfd" - "\x87\xc9\x71\x84\xd3\x73\xba\xb8\x34\xe5\xaa\x3f\xde\xdd\x12\xdb" - "\x1f\xef\x6e\x88\xe5\xcf\x29\x3c\x3f\x61\x89\x40\xce\x81\x97\x03" - "\xc0\xe1\x0b\xf3\xd7\xe5\xfb\xe6\x3d\x63\xe2\xfa\x26\x78\xe0\x9e" - "\xdf\x29\x1e\xb8\x67\x57\x2c\xae\xf7\x4c\x4e\xcc\x03\xf7\xcc\x1e" - "\x9c\x07\xee\x29\x1c\x9c\x07\xee\x59\xcf\x3c\xe0\xa3\x7b\xde\x89" - "\xed\x9b\xf7\xd4\xc6\xd6\x1d\xe5\xca\xbe\x49\x57\x5d\x49\xdf\x84" - "\x2e\x74\xf5\x60\xfd\x50\xee\x5d\x74\xa3\xbf\xf6\x1a\xeb\x17\x5f" - "\x88\x66\x66\xf4\x2b\xe0\xf7\xcd\x6c\x9e\x43\x82\x8c\x9f\xc2\x34" - "\xac\x93\x67\x55\xbe\x99\x1f\x4d\xc7\xcd\xea\xdc\x88\x13\x69\xff" - "\xce\xeb\xc1\x8a\x9e\x53\xdf\x8a\xad\xff\x37\xd7\x27\xa6\xe7\x37" - "\x6b\x41\x4f\x67\x62\x7a\x7e\xf3\xd0\xe0\xf4\xfc\xe6\x71\xde\xf3" - "\x7e\x69\x9f\xfa\x66\xa7\x7d\x85\xd4\x51\x64\x9e\xb3\x34\x75\xe6" - "\x17\x1b\x9f\xa6\x8e\x8b\x1d\x9f\xa6\xa6\x5d\xf9\xf8\x34\xb5\x30" - "\xf1\xf8\x34\xd5\x95\x78\x7c\x9a\x5a\xa3\xfa\xc3\xd4\x63\xb1\xfd" - "\x61\x6a\x53\x2c\x4f\x80\x76\xff\x63\xe3\xd3\x34\x7b\x5c\x1f\xa8" - "\x3c\x4d\xd3\x5e\x87\x4e\xe1\x52\xed\x76\x6f\x41\x2c\x8e\xd3\xa6" - "\x26\x6e\xb7\x69\xf3\xd1\x6e\x95\x89\xdb\x6d\x5a\xf1\xe0\xed\x36" - "\x6d\x23\xda\xad\xf2\xd2\x76\x9b\xd6\x78\xe5\x3a\xc5\xb4\xb6\xd8" - "\x36\x9b\xe6\xb9\xf2\x36\xbb\x77\x4c\xe2\x36\xbb\x77\x72\xe2\x36" - "\xbb\x77\xb6\x6a\xb3\x7b\xd7\xc7\xb6\xd9\xbd\xf9\xb1\x6d\x06\xba" - "\xfd\x83\x6d\x86\xf6\x99\xad\xf6\x15\xdc\xfb\x09\x6c\xf6\x61\x3d" - "\xee\x7b\x4f\xfa\xe8\xbe\x46\x65\x57\xdf\xa7\xc6\x0e\xd5\x86\x07" - "\x90\xe6\xd8\xa5\xe3\xc0\xbd\x41\x3d\xec\x7b\x97\xb6\xc3\x7d\xe9" - "\x90\xd1\x9d\xcd\xa5\x72\x1d\x4b\xb5\x21\xd3\x1c\xe9\x3c\xab\x78" - "\x2d\xea\xbe\xc9\x9c\x17\x6d\x2c\xbc\xc1\x10\xb1\x5c\x47\xfa\x00" - "\xc3\xe1\xb3\x3e\x71\xb0\xf2\xae\x64\x8c\xbf\xcc\x5e\x98\xd9\x9e" - "\xb2\x3b\x00\x2f\xeb\x05\xc5\xab\xf7\xc5\xeb\xbf\xf5\x88\x7b\x48" - "\xf1\xe9\x03\x5f\x8e\xc3\xa1\x3d\x31\x9f\xde\x17\x42\x1d\xea\x13" - "\xf3\x69\x96\x6d\x70\x3e\xcd\xe2\x33\x35\xf5\x51\xb6\xcf\xc8\x27" - "\x43\xbe\x38\xdb\x27\x2b\xc7\x12\x50\xbc\x23\x75\xa2\x8a\xc6\xd9" - "\x3d\xee\xac\x78\xfd\x0f\x6d\x93\x15\x56\x38\xdf\x7f\x21\x2e\xff" - "\x20\xfa\x5f\x16\xeb\x7f\x07\x06\xc1\xf9\x32\xfa\x5f\x16\xeb\x7f" - "\x07\x2e\xed\x5b\xf7\xeb\xfa\x5f\x22\x1b\xef\xfe\x31\x89\xdb\xff" - "\xfe\xb8\xf6\xa7\x9c\x12\xd8\xc3\x32\x7f\x6c\xba\x05\xd1\xe9\x78" - "\x4f\x11\xa7\x65\x1e\x49\x90\xb6\x3c\x1e\xe6\x20\xe9\x9a\x2e\xe1" - "\x3d\xde\x03\x95\x90\xf7\xee\x3f\xa9\xfa\xe3\x03\x93\x63\xfb\xe3" - "\xfd\x81\xd8\xfe\x98\x55\x13\x9b\xef\x81\xf4\xd8\x78\xf0\xcf\xff" - "\x98\x8c\x7d\x60\x7d\x1c\x0f\xbc\x77\x9a\xa6\x27\x29\x1e\x98\xfe" - "\xfd\x38\x3c\x6a\x13\xf3\xc0\x03\x07\x51\xff\xf7\x12\xf3\xc0\x03" - "\xc7\x06\xe7\x81\x07\x78\x7d\xe9\xbd\x68\xbe\x7d\xa4\x34\x6b\x58" - "\x6c\x9a\xe9\xd6\xc4\x32\x6f\x7a\x46\xe2\x39\x82\xe9\x59\x8a\xc6" - "\xd3\x1d\xb1\x34\x9e\x9e\x13\x4b\x43\xd4\xe5\x1f\xa7\x61\xff\x59" - "\xd9\x1e\xf7\xf4\xf8\xfe\xef\x3d\x4d\x33\xf4\xfe\x3f\xf3\xfe\x38" - "\x1c\xdb\x15\x2e\x89\xe6\x45\x66\xb0\xfd\xeb\x4d\x4c\xcb\x19\x63" - "\x12\xd7\x79\xc6\x64\x8c\x41\xde\xc8\x25\x7d\x69\xc6\x6c\x84\x3f" - "\xc2\x73\xa1\x3c\x1f\x52\x87\xf0\x47\x42\x64\x96\xe3\x55\xff\xb8" - "\x34\xa3\x98\xf7\x97\x30\xfd\x99\x7f\x2d\x63\x28\x9b\xc7\x20\xc6" - "\x2b\xb7\x54\xee\x51\xb0\xac\x67\x5e\xbf\x91\x79\x7d\x86\xd4\xff" - "\x78\x5d\x85\xf7\xff\x59\x1c\x94\xed\x0d\x84\xc8\xe0\x77\x4e\x1f" - "\x07\xbb\x85\xfb\x05\xa7\x37\xd2\xaa\x79\x33\x57\x9c\x6c\x9a\x11" - "\x48\xdc\xc6\x33\xd3\x06\xe7\x9d\x99\x19\xaa\x9d\x67\x2e\x88\x6d" - "\xe7\x99\x59\x11\xf7\x88\xf9\x5c\x57\xf0\xc0\x15\xf5\x93\x12\xbb" - "\xf0\x0f\x2a\xef\xd7\x3d\xde\x56\x5c\x46\xd7\x9f\xa1\x99\xcd\xb2" - "\x3c\x4d\x04\x2d\x6b\x93\xa8\x59\xca\x80\x07\xaf\x91\x78\x22\x4d" - "\x6e\x88\x34\xb1\xee\xd9\x36\x8e\xab\x77\x8b\x20\xd2\x1d\xe3\xf5" - "\x00\x3e\x2b\x07\x5e\xb8\xfa\x14\xcd\xfc\x28\x26\xbf\x89\xc8\xab" - "\x60\xd8\xea\x65\x7f\x7c\x30\xdd\x98\xd3\x5d\x3f\xc8\x7e\x20\xa4" - "\x99\x62\xec\x75\x50\x7b\xbd\x1e\x1c\x3f\xe8\xb8\x0c\x9c\x78\x7f" - "\x3c\xe3\x74\x79\x39\xf0\xe0\x46\x83\x7f\xd5\x1e\xc9\x07\x6b\x07" - "\xf6\xe0\x3d\xb8\x07\x71\xd9\x97\x99\x1b\x8c\xea\x07\x0f\x1e\x8f" - "\x86\xa3\xce\x8b\x3f\xd8\x61\xec\xa3\xc3\x7b\xe0\x73\x60\xe9\xf8" - "\x7c\x6b\x4c\x2c\x3e\xdf\x1a\x0f\x3d\xc5\xa4\x60\x7c\x6b\xca\xe5" - "\x60\x70\x9b\x2b\x9e\x65\x7e\xf8\x56\xf6\xe5\xe6\xfc\x92\x6d\x94" - "\xbd\xe5\x12\xde\xfa\x96\xd4\x97\x18\xc6\xe7\xe0\xe8\x89\xb1\x2d" - "\xe4\x5a\x3d\xaf\x6b\xcd\xda\xa4\xfa\xfd\xac\xb8\x39\xc2\x6f\x9d" - "\x94\xfb\xa4\xf4\x7e\xff\x64\x28\xbe\x1f\x7c\x2b\x64\x8c\xd1\xb1" - "\xe1\xb3\xd2\x8d\x7e\x0f\xbb\x96\xe1\xc6\xcd\xb3\xce\x9a\xac\xfa" - "\xc2\xac\x8d\x91\x94\x68\x7b\x6d\x96\xd4\xff\x8c\xf9\x52\xc4\x4f" - "\x8e\xcb\x17\x37\xff\xf7\xad\x93\x62\xf0\x79\xfa\x34\xb4\x6f\x80" - "\xd7\xb5\xd4\xd9\xdb\x59\xef\xc4\xcd\x57\xf8\x37\xcb\xb3\x96\x1f" - "\x00\xee\x43\xba\xdc\xfb\xf6\xed\x71\xe5\x9d\x74\x76\x5d\xae\xfe" - "\xb3\x06\xa9\xff\x43\x03\xf5\x5f\x22\xe1\xc6\xcd\x25\x3e\x24\xeb" - "\x1f\xbe\x44\xfe\x3d\x34\x1b\xf2\xcb\xa0\x1b\x74\xee\x87\x76\x1b" - "\xba\x3a\xcf\x1f\x0c\xae\xab\x3f\x34\x30\xff\xa7\xf2\x0d\xcc\xff" - "\xf9\x13\xe9\xea\x3e\x3a\x1c\x8a\xd7\xd5\x1f\x3a\x62\xa9\x4d\x58" - "\x97\x41\xe6\xff\x1e\xd2\xe7\xff\xbe\x9d\x1d\x2b\xcf\xbe\x6d\x8d" - "\x6d\xc3\x87\xe2\xda\xf0\xdb\x99\xb1\x6d\x38\xeb\xe4\x7f\x77\x5c" - "\x63\xc5\x2b\x39\x39\x59\x4b\x4e\xd2\x92\x92\x11\x8d\x2a\xd2\xb0" - "\x64\x53\xf2\x10\xfc\x86\xea\xcf\x61\x5a\xb2\x66\xc2\x6f\x88\xfe" - "\x1c\x1a\xf7\x3d\x8c\xf3\xe2\x67\xd2\x9f\x43\xe2\xbe\x87\x7e\x4e" - "\xfc\x30\xbd\x5c\xa3\x7c\x53\xdc\xf7\x90\xcf\x89\x1f\xfa\x0f\xe6" - "\xa7\x4b\xbe\x63\xf7\x9d\x3d\xb4\x64\xc5\xc2\xa2\xc5\xf9\x72\xad" - "\xb8\xc0\xbe\xf0\xe9\xa7\x0b\x96\x2f\xb7\x97\x2c\xb5\x3f\x70\xff" - "\xc3\x77\xdc\x63\x57\x4b\xce\x45\xd3\x6e\xce\x4f\xa5\x39\x2f\x2e" - "\xe3\x88\x39\x8f\x3c\x94\x63\xcf\x7e\xe0\xfe\xd8\x48\x03\x8c\x5c" - "\x5a\xbe\x1c\x94\xa8\xfe\x97\x55\x31\x8a\x68\xe3\x28\x29\x7b\xda" - "\x8f\x36\x10\xa9\x39\x8f\xec\xd7\x5b\x60\x8d\x8a\x5e\xa7\xf0\xdc" - "\xc8\xeb\xf9\xb3\x1f\xe5\x4a\x4c\x68\x70\x51\xf1\x22\x3e\x5f\x32" - "\xfb\x79\xf1\xae\x9f\xec\xdf\x26\xed\x14\x3d\xfa\x56\xf3\x2c\xa4" - "\xc5\xb7\xb7\x3d\x44\x76\x27\x99\x91\xff\x3b\x88\x4b\x12\xf7\x46" - "\x10\x16\xd0\xf7\x30\xcf\x5b\x28\xc3\xde\x75\x19\xe9\x2c\xa7\x69" - "\xce\x97\xc5\xbb\x42\x7e\x8b\x7b\xab\xf4\x74\xb3\xff\x1e\x71\xff" - "\xcb\x1e\x96\x0d\xb5\xaf\x92\xa9\xee\x55\xa2\xd7\x46\x92\xf9\xb5" - "\x51\x7c\x06\x7d\xf6\x49\x63\x1d\xb4\x02\xdf\x3e\x7a\xb4\x89\xcb" - "\xe6\xb4\x11\xed\x5f\xfe\x2c\xd3\x8f\x8c\x4e\x3f\x27\x6d\x60\x1d" - "\x76\xf6\x49\x0d\xe9\xe6\x7d\x42\x96\x60\x6a\x6d\x86\xb7\xd4\x45" - "\x96\xb0\xf8\x74\xe2\x2c\x4a\x6a\x85\x64\x5e\x19\x12\x21\xcf\xb2" - "\x33\x28\x7f\xce\xf7\x2d\x2b\xc5\xa7\x5e\x68\xcf\x73\x3a\x9d\x62" - "\x73\x17\x99\xd0\xaf\x93\x3c\xcb\x78\x8f\xc2\x9c\xac\xba\xcf\xc8" - "\x04\x1a\x8c\x39\x43\x73\x8b\x4b\xe7\x88\xb0\x73\x0e\x99\xfe\xd5" - "\xc1\xfb\x0b\x1b\x37\x6f\xfe\x33\x99\x7e\xde\xeb\xd2\x7a\x85\x8d" - "\x4a\x4b\x44\x87\x60\xdf\x14\x01\x11\xe4\xfd\xf9\x2d\x79\x61\x4e" - "\x53\xd6\xe3\xb4\x51\x6b\x49\x80\xd6\x9c\x14\xc1\xf2\x3f\xab\x7d" - "\xfd\x47\x3b\x03\xbc\x5f\xd1\xbc\x66\x0e\x25\x9f\xce\x21\xed\x68" - "\x61\x0d\x79\x17\x04\xa8\xf4\xa4\xe8\x68\xc9\xfb\x84\x5a\x0b\x9b" - "\x28\xb7\x8d\xb4\x96\xf6\x8f\x48\xfa\x57\xd8\xf0\xa1\xbd\xec\x02" - "\xd9\xd6\x2c\xe6\xb0\x0b\xb4\x6a\x0d\x0d\x5f\x75\x82\x2c\xde\x8e" - "\x36\x94\xd3\x45\x8f\x1d\xa7\x24\xc0\xd3\x56\x7f\x44\xb6\xd5\xdf" - "\xe7\xfd\xbb\x59\x54\x5b\x46\x36\xe1\xcc\x48\xeb\x75\x66\x58\x7b" - "\x45\xc6\xc8\x1e\x67\x46\x7a\x6b\x31\xd2\xb7\xff\x8e\x46\xb4\x51" - "\xfa\xbb\x67\xda\xb4\x9a\xf3\x34\xc6\x3e\x97\xdb\x7f\x6e\x51\xed" - "\x79\xa4\xdf\xd0\xd4\x10\x41\xde\xe8\x3c\xa1\x94\xa6\x43\xde\x9c" - "\x20\x45\x00\xab\xa6\x97\xc6\xd4\xf6\x92\x2d\x52\xd1\xd4\xc0\xb4" - "\xe8\xdb\xd0\x98\x01\x59\x38\xec\xc0\x53\x87\x4c\xde\x96\x4e\x3a" - "\x1a\xe8\xa5\x56\xfa\x80\xbc\x8e\xbf\x79\x7e\xfe\xd4\xa1\x21\x11" - "\x30\xbf\x67\x55\x3b\xe0\x2b\x9e\x71\x1e\xe5\x33\x8e\x2e\xaa\x2c" - "\xa3\xb4\xe2\x55\x34\xec\x0c\xc2\x95\x4d\xbf\x3d\xd3\x1b\xfa\x9b" - "\x67\x95\xdc\x73\xfb\x68\x53\xd9\x51\x4a\x6e\x0d\xd4\xf0\xde\x4e" - "\x2d\x9c\xfa\xa1\xdd\x1b\x38\x46\xde\xe2\xbf\x7a\x22\xe6\x0f\xcd" - "\x1b\x23\x64\xde\x7f\xf1\x98\xe6\x35\x5d\x24\x6f\x4e\x80\xde\x43" - "\xd9\x62\xc3\x87\xbc\xe6\x99\xd5\x1a\x08\xf2\x39\xa4\x4c\xd1\x6d" - "\x4b\xad\x5c\x46\xe3\xeb\xce\xd3\xb8\x5d\xe7\x29\x43\xf4\x64\x68" - "\xbc\x8f\xf6\x89\x2e\x2b\xed\xc2\x33\xad\x9d\xcc\xa8\xaf\xda\x43" - "\x9d\xa2\xef\xa7\xed\xcb\xa0\xfa\xde\x81\xfd\xb4\xbd\xdd\x03\xfb" - "\x69\xc1\x4b\x3e\xde\x53\x8b\x7e\x51\xc3\xfc\x5c\x79\x96\x4c\xeb" - "\xce\x12\x4d\x74\x69\x64\x7f\x8a\xcf\x43\x64\xcf\xf4\xe6\x77\xc9" - "\xf7\x53\x34\x2f\x84\x67\x1a\x7e\x49\xe8\x03\x72\x3e\xbb\x5d\xe7" - "\x5b\x84\x69\x08\xfb\x04\xcf\x64\x3c\x3f\x72\xd6\x0a\xbf\x28\xdf" - "\x3d\xa3\x5b\xa3\x54\xe6\x5f\xb5\x77\x77\xf7\x8c\x1e\xf7\x3c\xe8" - "\x3f\xf9\xf3\x0d\x3e\x56\x32\x7d\xb6\xef\xbd\xd3\x5d\xec\xef\xc4" - "\x2f\xf1\xe9\x2b\x4c\x62\xdf\x27\x7a\x38\xe3\x30\x8d\xcb\x3d\x45" - "\xd9\x76\x3c\x2d\xf8\xa1\x5f\xce\x3b\x68\xe4\xed\xee\x2b\x44\x99" - "\xd9\x77\x21\x5c\x18\xe1\xa8\xaf\x89\xe3\xde\x3e\xdd\xa5\xa9\x34" - "\x19\x1a\x60\x06\x75\xf8\xe8\xeb\xb3\xd7\x73\x9f\xee\xd6\x2c\xe2" - "\x70\xfe\x64\xaa\x1d\x25\x8e\xed\xda\x26\x9a\x55\x5f\xcb\x76\xf8" - "\xa8\x20\x8f\x71\xc4\xb8\xdd\xbc\x11\x71\x87\xed\x44\x4c\x97\xe6" - "\x3c\xde\x2f\x96\x5d\xe3\xa3\xd4\x93\xd1\x75\x10\xee\x6f\x97\xf3" - "\xd8\xf9\x66\x99\x67\x88\xd0\xfe\xa5\xbc\xd5\xd7\x49\x3f\xef\xed" - "\x18\xe2\xfc\x23\x69\xde\xd0\x29\x9a\x94\x4e\x36\xd6\xff\xea\xb7" - "\x09\x1f\x9e\x1d\xbc\x7f\x13\x7c\x72\xdd\x19\xca\xfe\xe4\x6b\xe9" - "\x94\xfe\x27\x58\x63\x4a\x1e\x65\x87\xa3\xe4\xd1\x4b\x47\xdb\x0f" - "\x45\xc9\xa2\x47\xef\xba\x54\x16\xcd\xbf\x5d\xc9\x22\x11\x52\xb2" - "\x27\xec\xd3\xc3\xaf\x8b\x0b\xd7\xf7\x84\xcc\x4f\x8a\x0b\x0f\xaa" - "\xf0\x47\xba\xe2\xc2\xfd\x7a\xf8\x04\x43\xd6\xb5\x32\x1e\x2f\xb2" - "\xac\x7b\xe4\x2a\x96\x75\xad\xf9\xba\xac\x93\x7b\x0a\x1f\xbe\x20" - "\x7e\xec\x22\x3e\x6b\x84\xf7\xa3\x8c\xbf\x78\x97\x0c\xdc\x53\x10" - "\xb6\x89\xc3\xaa\x3e\x20\x13\x7e\x52\xce\x09\xf7\xbf\x9c\x63\x39" - "\xc7\x32\x8e\xf7\x9c\xec\x1c\x25\xda\x76\x6e\x13\xc7\x6b\xb7\x89" - "\x96\x1e\xf7\x77\x42\x86\xbc\x7b\x19\x61\x1b\x11\xf6\x32\xe2\x59" - "\xee\x31\x4d\x8e\xe6\x1c\xe2\xf3\xfa\xed\xe0\xe3\x8d\x96\x24\x2a" - "\xde\x0c\x9e\xe7\xf3\x7f\xeb\x41\x5f\x2f\x64\x12\x9f\xdd\x92\x7e" - "\x42\xb4\x4c\xc8\xa8\x76\xee\x6f\xa3\xd6\xa1\x7f\x79\x1d\x9f\x50" - "\x59\x40\x9c\xe1\x73\x70\x8c\x43\xee\xca\x6f\xf3\xf9\xe4\xa4\xe6" - "\x42\x22\xde\xf3\xcd\x7b\x55\x20\x77\x4d\x55\xc0\xe9\x70\x11\xb7" - "\xf5\xc3\xb0\xff\x6b\xaa\x54\x5b\x3f\xda\xc4\x7e\x75\x4e\xd1\x77" - "\x8e\xc0\xbe\x0b\x72\xdd\x2c\x61\x17\xf1\x79\x15\xf4\x51\xb6\xf1" - "\x0a\x77\xe2\x57\x65\x9c\x59\x61\xdf\x48\x48\xe3\x6d\x0b\x12\xe3" - "\xec\xa3\x87\xd3\x8f\x96\x1e\xe2\xfc\x87\x98\x36\xc2\xed\x34\x60" - "\x24\xc9\x33\x2f\x6e\x32\xf3\x99\x17\xa4\x93\x7b\x41\x45\x6a\x63" - "\xc6\xd1\x05\x7e\x62\x39\xef\xed\x00\x8c\xd2\x53\x0a\x06\x60\x09" - "\xc8\xfd\x98\x38\x1d\xfe\xf0\x35\xe2\x53\xc0\x5f\xcf\xed\xc5\xe7" - "\x14\x79\x7d\x0d\x74\x49\xe3\x7d\xf0\x4a\xf7\x7c\x78\x78\xfd\x07" - "\x44\xfa\x59\x4b\xf0\xdb\xc3\x69\x7c\xbe\x88\xcf\x57\xca\xb3\x95" - "\xda\x64\x12\x2f\x66\xa4\xf5\x9f\xaf\xfc\xff\xe1\x6c\x25\xe8\x6f" - "\xab\xd3\x44\x13\xf0\x4f\xe3\xf3\x95\xc0\xbf\x88\xf9\x50\xaf\x93" - "\x75\xeb\x63\x92\xe6\xf3\x39\x0c\xb6\xe2\x11\xa3\xfd\xb9\xbe\x5c" - "\x17\xc4\x4d\x51\x3a\xa1\x38\xe6\xa3\xf9\x56\x8e\x47\xd8\x38\x4e" - "\x3f\x09\x72\xcc\x9b\x1f\xa6\x03\xa7\xc3\x5a\xe5\x2a\x32\x29\x99" - "\xf6\xe8\xad\x9c\x5f\xc9\xb4\xf9\xbe\x01\x99\x36\xff\x84\x92\x69" - "\x8a\xc6\x4a\xa6\xcd\xff\xa3\x92\x69\xf3\x7f\x2f\xd7\xc1\x20\xd3" - "\x38\x8e\xe5\x9a\x21\xd3\x76\x8d\x12\x47\x58\x76\xf4\xb8\xe7\x37" - "\x19\xb2\x6d\x13\xc2\x58\x76\x30\x8e\x4a\x4e\x3d\x62\x16\x1f\x66" - "\x90\xda\x67\xc0\xef\x85\x7c\x36\xa1\x43\x7f\xe7\x71\x64\xac\x92" - "\x71\x8f\x9a\x06\x64\xdc\xfc\xf2\x81\xbc\x2c\xe3\x1e\xbd\x46\xc9" - "\x38\x15\x5e\xff\x18\xcb\xb8\x47\xcc\x4c\x03\x1d\xbe\xc6\x73\x76" - "\x7a\x7a\xa6\xa3\x35\x5a\xc6\xc5\xf6\xaf\x47\x17\x18\x32\x8e\x65" - "\x1b\xbe\x8b\x20\xd3\xa4\x9f\x2e\xee\x67\xd5\xa0\xb9\xd1\xef\xb8" - "\x0d\xb8\xce\xec\x3f\x87\xe9\x36\xbd\x8b\x86\xe9\xe7\x7c\xf4\x7a" - "\x3f\xba\xc7\xd8\xe7\x08\xfa\x37\x25\xd2\x9b\x0d\x3d\x0d\xfc\x78" - "\x43\x18\xfd\xcd\xeb\xc2\x58\x5a\x23\x5c\xad\xa1\xe3\xf4\x64\x09" - "\x69\x91\xe4\x67\x3f\xe6\xb6\x85\x9d\x31\x94\x9f\x2c\x7b\x30\x86" - "\x76\xe5\x06\x68\x28\x6c\xf3\x8f\x2b\x35\xc4\x39\xe8\x9b\x03\x71" - "\xdf\x95\x7b\x3c\xa3\xf2\x4d\x88\x8a\xbb\x59\xea\x78\x67\xd9\x77" - "\xd2\xa3\xc7\x06\xb3\xfd\xaf\x0c\x97\xef\xae\xbc\x0c\x2e\x5b\x2f" - "\x83\x8b\xd4\x03\x26\x74\x52\x12\x6c\xb3\xab\xce\xd2\x77\xe5\x7c" - "\x8c\xf4\x61\xb1\x2e\x61\x39\x1f\xeb\xf1\x43\xa2\xe2\xa3\xca\xfa" - "\x5e\x52\x82\xfc\x51\xe5\x7d\x6f\xec\xe5\xe1\x7f\xef\xfe\xcf\x81" - "\xbf\xf0\x73\xe0\xaf\x65\x19\x08\xda\x59\x22\x5a\x6c\xba\x89\x21" - "\xd9\x07\x8f\xf0\x39\x3b\xa4\x7b\x43\x9f\xf3\xf9\xd8\x39\x56\xda" - "\x82\xf2\x2c\xd6\x66\xc4\x7b\x43\xed\x52\x3e\xcf\x58\x49\xa4\xd6" - "\xa8\xfb\xf3\x7c\x14\x8f\xdb\x88\x90\x81\x9b\x8c\x0f\xc7\xe3\x86" - "\xf8\x09\x03\xf1\x39\xd7\x0d\xb4\xfb\xf7\x6a\x2e\x33\x2f\x99\xe6" - "\x45\x2c\xfb\xa0\x3b\x0c\xf3\x85\x7d\x9f\x54\xf7\xcf\xcf\xe4\x94" - "\x40\xce\x7b\xa2\xf6\xec\x76\x42\xb6\xdf\xd0\x1a\xe0\x73\xa9\x01" - "\xaa\x54\xf6\xf0\x57\x30\x9e\x8c\xe4\xb3\x39\x7c\x4e\x27\x37\x9c" - "\xad\x29\xdf\x38\x39\x4d\x46\xde\xc1\xe6\x81\xb8\x5c\xbd\x4c\xde" - "\xff\x1a\x40\x9e\x76\x23\x0f\xc3\xe6\x3d\x94\x18\x07\x6e\x90\x67" - "\x55\x43\x9d\x2c\x77\xbf\x02\x3d\x79\xa4\x2a\x27\x8f\x54\x39\xdf" - "\xb7\xf9\xe8\xbb\xb3\x2f\x77\x56\x64\xf0\xfa\x7d\x7f\xfe\x95\xd7" - "\x8f\xf4\xfa\x7d\xbf\xea\x73\xea\x77\xb9\x72\x5b\xae\xbc\x5c\xab" - "\x5e\xee\x63\xe6\x2b\xa7\xeb\x63\x53\xbf\x38\x5d\x33\x75\xba\x3e" - "\x56\xfc\x39\x74\x4d\x54\x4e\xe3\x17\x2f\xc7\x6e\x94\xd3\x96\xa8" - "\x1c\x92\x7f\x83\x9e\xe3\x32\x1b\xbe\xdd\xd8\xaf\xa2\xf2\x15\xf5" - "\xb8\x3d\xda\xf7\xa4\xf2\xb7\xf8\xf8\x64\xc3\xf7\xa4\xee\x03\x12" - "\x63\xcb\xe3\xdf\xc9\x6d\x60\x7d\x44\x44\x7c\xf4\xf8\x7c\xf6\x1b" - "\x38\x63\x4d\xb4\x8f\xc6\xc7\x0b\x2f\xe7\xf3\x92\xfd\xf6\x08\x91" - "\x43\x87\x6b\xe4\x7e\x00\x8c\x43\x8f\xbf\xce\xe7\x01\xd4\x7a\xe6" - "\xe3\xfb\x54\x9f\x7c\x7c\x1f\xca\x0d\x0e\x0e\xe3\x40\x55\x63\x59" - "\xe6\x90\xc1\xf6\xf8\x23\x7f\xa7\x8f\x7e\x20\xe7\x2f\xc3\x1b\xf6" - "\x37\x89\x73\x36\xdd\x47\xd6\x93\x0f\x45\xf9\xf0\xc2\xd8\xfd\xc4" - "\x4a\xfd\x2c\x02\x68\xe0\x02\x2d\x17\x8c\x33\x68\x60\x84\x23\x6c" - "\x8a\x41\x03\xe8\x2b\x69\xde\x86\x10\x9f\x15\x0a\xa8\xf3\xdd\x0b" - "\x9e\x10\x15\x07\xf4\x73\xf4\x0b\xd4\x3a\x43\xea\xfe\xa6\xc0\x6a" - "\x9b\x66\xe4\x1f\x67\x77\x7e\xc6\x3c\xec\x4f\x39\xe0\x02\xac\xf5" - "\x06\x7c\xc1\x78\x89\x81\x74\xf5\x72\x5f\xd2\x02\xb4\xff\x63\xa5" - "\x92\xaf\x51\x86\xc4\x5d\xa3\xe4\x08\xf0\x47\x1d\x34\x6f\x71\x80" - "\xf5\xd4\xce\x30\xea\xcf\xb2\xee\xe0\x12\x9f\x89\xd3\x48\xdd\xe1" - "\x5c\x86\xa6\xfc\x8f\x2d\x08\x47\xce\xb1\x8f\x0d\x89\x57\x1a\xea" - "\x3c\x8b\x71\xf2\xe1\xe9\x5f\x9d\x41\xf3\x2e\x90\x4e\x8b\x05\x9f" - "\x44\x10\x1e\x59\x3e\x80\x43\x9d\x3c\xd3\xf1\x44\x86\x81\x43\x84" - "\xcb\xef\xb1\x69\xd0\xc5\xb8\xdc\x0e\x79\xae\x12\x65\x4f\x62\xff" - "\x54\xec\xbb\xe2\xc5\x0c\x62\x1c\x90\x67\x81\x41\x6f\x3d\x8f\x5e" - "\xc6\x13\x69\x11\x59\xb6\xa2\x8d\xa2\xf3\x61\xe8\x83\x4f\x6c\xbc" - "\x94\xce\x4f\x34\x44\xd1\x39\x99\xf9\x8a\xe7\x58\x80\xff\x34\xa6" - "\x37\xaf\x6b\xd8\x57\xb0\x5e\xf5\xc4\xbf\x1d\x0e\xc8\x7d\x27\x69" - "\x0c\x37\x02\xfa\x33\x0c\xc0\xfd\x92\xa2\xf1\x13\x1d\xfd\x34\x46" - "\xd9\x02\x6d\xb1\x4e\x9d\x41\x91\x3e\xea\x7a\xdc\x4f\x9a\xfb\xcb" - "\x61\x5c\x9d\x36\x2d\x22\x6c\xc4\x73\xaa\x8c\x6b\x89\x5d\x04\x59" - "\xaf\x94\xfb\x98\x50\xd7\x83\x65\x6d\x26\xe8\x96\x9a\x2c\xab\x3b" - "\x83\xf5\x7b\xb3\x7c\x47\x59\x83\xf0\xf7\xdd\xec\xd3\xcd\xa8\x17" - "\xea\x62\x66\xde\x02\xee\xd0\xff\x72\xe7\x48\x7e\x59\xc1\xed\x94" - "\x7b\x3b\x87\x19\xe9\xf0\x3d\x84\xd3\x19\xdf\x88\x03\x7f\x3d\xf9" - "\x3e\xea\x95\xca\x78\xfa\xd9\x6f\x8a\xac\x73\x6e\x21\xc3\x40\x3d" - "\x8e\xc5\xd4\xb3\x2f\xc7\x64\xf0\x1d\xaf\x11\x35\xdb\x83\x52\x76" - "\x2a\xda\x3e\x19\x32\xfa\x24\xe7\x57\x7d\x2c\xd7\x1a\xcd\x8b\x01" - "\xe7\x00\x1f\x94\x8c\x25\xb3\xc9\xce\x7e\xe8\x9e\xd4\xfd\xd2\xe6" - "\x4e\x8d\x6f\x2f\x8e\x63\x1f\x71\x3a\x0d\xb9\x3f\x59\x4f\x51\x6e" - "\x26\xd7\x0d\x71\xeb\x2f\x37\x5e\x1a\x7e\xeb\xb6\xa8\x7e\x04\xba" - "\xe4\xbd\xb1\x45\x9d\xe7\x09\x28\x5f\x69\xb9\xfb\x85\xf6\xba\x6c" - "\x2f\xde\x97\x27\xfd\x5f\x48\x5f\x13\xb9\xbc\xc7\x4d\x8c\x28\x7e" - "\x9d\x7d\x0f\xfa\xf5\x3d\x7b\xfe\xe6\xe2\x90\xf4\xb7\xe6\x2c\xe1" - "\x73\xaf\x21\xb6\xc9\xe4\x9e\xb4\xc3\x25\x21\x7a\x24\x28\x69\x1b" - "\xe2\xf3\xe9\x01\x49\x8b\x3c\xb3\x71\x26\x3d\xc2\xb2\xa0\x27\x87" - "\x26\x85\x28\x99\x75\x0a\xbb\x93\x7d\x09\xe4\xf9\x58\x27\x51\x34" - "\x05\xdf\x6b\xe2\x98\xe2\xe5\xbc\xef\xd4\xf1\xf9\x07\xb9\xbe\x74" - "\x0a\xfc\x9d\xfc\x37\xa4\x5d\xac\xe6\x65\x8c\xbe\x96\xf7\x31\xaf" - "\x31\xf9\x74\x18\x28\x0b\xe3\xff\xe3\xc7\x2f\xed\x17\x79\xdf\x31" - "\x6c\x0c\x3e\x07\xa7\xd6\xab\x06\xe0\x21\xbf\x9c\x97\x1e\x90\x4d" - "\x7f\x60\x58\x9e\x4b\xfb\x4c\xde\x71\x83\x97\x8b\x6f\xe4\x73\xd4" - "\xb9\x35\x5c\xfe\x60\x32\x53\x38\xbf\xcf\xed\x64\x3e\x6d\xa7\xe4" - "\x2f\x7a\x56\xa2\xc7\xbd\x70\x8a\x51\x07\x83\x26\xaa\x0e\x0b\x5f" - "\xe9\x4e\x6d\xcc\x1e\xa8\xfb\xc2\x57\x24\x2d\x06\xe2\xff\x18\x45" - "\x1b\xfe\x3e\xa2\xf8\x6e\x61\x39\xf8\x43\x9f\xb3\x51\x61\x22\xf5" - "\xc0\x3a\xf6\x9f\xa8\x70\x5c\x4c\x06\xbf\x23\xed\x41\x1f\x7d\xd2" - "\xac\xd6\xa1\x16\xa2\xfe\x0b\xad\x7a\xbe\x05\x8c\x4b\xc2\x7a\xc6" - "\xe0\xf8\x54\x16\x8f\xb1\xca\x4f\xc1\x53\xf7\x33\xbe\xf6\x5b\xb8" - "\x8d\x9f\x1a\xce\xe5\x32\x4f\x88\xbe\xc2\x21\x81\xbe\x0c\xea\xee" - "\x2b\x44\xff\xc9\xd0\x7a\xdc\x4f\x41\xfe\xb5\x37\xa8\x32\x9f\x9a" - "\x6c\xe0\xca\xb8\x41\x57\x34\xf7\x88\xc5\x89\xe9\xcb\xe5\x72\x7f" - "\xef\x2b\x1c\x86\x9f\x19\xbf\xa1\x5f\x74\x3c\x86\x5e\xdb\xe1\xaf" - "\xd8\xbb\x3e\xb2\x42\x1c\x99\x17\x12\x11\xd8\x05\x1d\x95\xe0\xdf" - "\x11\x6b\x3d\x34\x22\xf0\x84\x96\xbb\x92\xb2\x60\xdb\x92\xb8\x28" - "\xa6\xd4\x45\xf0\x5c\x21\x26\xb3\x3f\x57\x7c\x67\xea\xdf\xe3\xf9" - "\xbb\x7b\x85\x58\x00\x9c\x3b\x8c\xb5\x3b\xe5\x6b\xe6\xa9\x60\xbf" - "\xdf\x9d\xe4\xc7\xf9\x8c\x0f\xcd\x73\xa0\x8c\xe4\x67\x3b\xb8\xdc" - "\x5c\x1e\x3b\x50\x5e\x8f\xfb\x69\x8c\xff\x8f\x97\x70\x3a\x7f\xf2" - "\x6d\x23\xf1\xcb\x18\x64\x8d\xb3\x83\xf1\xea\x4e\xd9\xbb\xde\xc0" - "\x75\x44\x20\x4b\xfb\x62\xb8\x3d\xbd\xde\xc0\x0d\xe1\x47\x2a\x55" - "\x78\x88\x7d\x91\xf1\x1e\x44\xc4\x37\x1a\xb8\x1a\x38\x70\x79\x7c" - "\x8e\x52\xa4\x36\xe6\xb1\x2f\x17\x2e\x8f\xfd\x0d\x22\xed\x31\x03" - "\xdf\xcf\xe3\xe5\xc1\xe8\x0e\xfb\x7a\x8c\xe2\xc9\xfc\x31\xc6\xf8" - "\x85\xf7\x8c\xd8\xf5\xde\x7c\x6b\xbc\x2c\x7b\x6a\xe9\xd2\x92\xdc" - "\x65\x05\xfc\xc8\xb8\xf9\x85\x5b\x53\xa3\x6d\x52\x96\x6f\xca\x17" - "\x40\x7e\x16\xcf\xff\x6c\x19\x69\xac\x5f\xe6\xbb\x8c\x39\x28\x7d" - "\x9f\xf4\x7d\xac\xab\xb2\x4e\x87\xb8\xda\xdf\x97\xae\x61\x30\x49" - "\x1f\x9b\x49\x1b\x4c\x76\xb2\xbc\xe8\x4e\xf9\x4b\xb6\xa4\x47\x45" - "\x97\x07\xf9\xfa\xe7\x3f\x07\xd9\x27\x56\x18\xde\xd0\xe4\xb3\x8f" - "\x96\x3e\x8d\xb4\xb7\x57\xb5\x69\x3c\x86\x97\xe1\x9d\x6d\x27\xa9" - "\x37\xe8\x7e\x72\xde\x3d\xdf\x06\x39\x5c\x90\x21\x2a\x1a\xa1\xbf" - "\x15\xd8\x07\xc5\x21\x6a\x8d\x9d\xf7\x64\xb5\x53\x41\xd6\xa0\xeb" - "\xe1\xe5\xfb\x3d\xaa\x1f\x16\x6c\x6d\xb6\x11\x9f\x09\xfd\xd1\x29" - "\x2a\x78\xc5\x64\x83\xac\x1d\x4d\x3f\xc3\xbb\xb4\x75\x39\x2e\xa6" - "\xbd\xae\xeb\x6a\x30\x25\x0b\x4d\x08\x91\x24\xd4\x1f\x99\xf4\x97" - "\x64\xfc\x34\x91\x24\x57\x8b\x92\x41\xa9\x61\x43\x4d\x64\x19\x91" - "\x66\xbe\xe1\xfa\x31\xb6\xfb\xee\x9d\x3a\xc5\x59\x56\x0a\xee\x0e" - "\x05\x2d\x22\xda\xaf\xd3\x09\xff\xa3\xb7\xba\x48\xee\x17\xa8\x38" - "\x91\x70\xdf\xc1\x26\xb7\x28\xe6\xb3\xb8\x91\xd4\xae\x4c\xe7\x0b" - "\xa4\x1d\xe8\xf5\x69\xec\x7b\x97\xc7\x68\xf6\xcd\x7c\x8a\x16\x8d" - "\x7d\x0f\x61\xa8\xbf\x43\x94\x77\x65\xaa\xf5\xc0\x45\x0b\x23\x1b" - "\xba\x32\x07\xe0\x9b\x88\xe1\x3b\x5f\x23\xad\xb1\xac\x43\xf3\x9a" - "\xee\x25\xaf\x3d\x40\xef\xe1\x7d\x90\xf6\x2c\x06\xfd\x89\x61\xd4" - "\xbb\x23\xe5\xce\xcf\x48\xd3\xcf\xd6\x69\x67\x69\xd1\x6b\x4d\x83" - "\xe4\xe3\xf3\xab\xdd\xa9\x7b\xbf\xdd\xe3\x5e\x84\xf6\xff\xe6\x64" - "\x7d\x4c\x80\xec\x5a\x04\xfb\xaf\x40\x7d\xa7\xee\x7d\xa8\x5b\xfa" - "\xb7\x5c\x14\x34\xd2\x24\x1e\x17\x78\xce\x51\x78\xb8\x5d\xc5\xc5" - "\xbf\x77\xf0\xde\xfd\x41\xd6\xf9\x87\x79\x1d\x77\xf0\x3a\xcb\x90" - "\x11\x41\x4a\x73\x5e\x10\x7d\xb0\xdb\xd3\xc1\xb6\x5a\x18\xb6\x57" - "\xe8\xa2\xc8\x39\xda\x79\x9e\x5a\x03\xc7\x79\x6d\x36\xe9\xcd\x45" - "\x7f\xd0\xbc\xc1\x73\x1e\xef\xfa\x08\xb5\x62\x7c\xf6\xd6\x9e\xf3" - "\x1c\xed\x3c\x8e\xf7\x30\x1d\xa5\x0f\xe8\xa8\xe3\xff\xb8\xe4\x5c" - "\x49\xad\x70\x31\x9d\xfb\x2e\x8a\xf9\x5e\xd3\x5f\x88\xfd\xbd\xb3" - "\xac\x00\xdd\xed\x67\xe9\x07\xbf\x7f\x17\x70\x0e\xfc\x07\x60\x49" - "\x5f\x4e\xd3\xe8\x3d\xbc\xf7\xb8\x7f\xd0\x62\xc8\x91\x84\x7e\x33" - "\x92\x3c\x9b\x2c\x8e\x27\xb4\x08\x64\x12\xfb\xdc\x82\x2c\x9a\xcc" - "\xf5\xc2\x77\x26\x7f\xe3\x39\x9e\x9f\x96\xb5\x9e\x5d\x96\xd0\x13" - "\x2c\xa3\x72\x58\xfe\x20\x7c\x7e\xfd\x45\x29\xb3\xb2\xf5\xef\xd9" - "\xfa\xf7\x2c\xfd\x7b\x86\xfe\x9d\xa5\x7f\x4f\xe5\x6f\x25\xdb\x0a" - "\xf3\xfa\xe5\xae\x36\xec\x18\xbe\x8b\x8d\xb6\x00\x3e\xc3\x2d\x8e" - "\x35\x52\x46\xea\x78\x4c\xd6\xf1\xca\xd4\xbf\x0d\x7c\xae\xb3\x84" - "\xd6\xfc\x4f\xe1\xe3\x8f\xc5\x67\x31\x45\xe1\x43\x16\x47\xd6\x17" - "\xc1\xc7\x6a\x09\x65\xfd\x43\xf8\x30\x2e\x1c\x86\xf2\x5d\x71\xf8" - "\x54\x19\xf8\x24\xe4\xb7\x15\xa2\x83\xc7\x87\xe5\xd7\x48\x5f\x95" - "\xc3\x58\xf6\xd7\xf7\x1a\xfe\xd3\x16\xb7\x5c\xce\x7f\x1a\xfa\x82" - "\x0d\x69\x50\xff\xc5\xb5\xfa\x38\xf8\x8e\xd2\x97\x9e\x31\x19\x7b" - "\x63\x50\xd7\x3d\x95\xaa\xae\xfb\xd6\xb3\x0f\xb1\x95\x74\xad\xd3" - "\x21\x3a\xa0\xff\xff\x67\xb3\xdd\x1f\xd3\x07\x8a\x4a\x96\x2f\x7f" - "\xee\x1e\x7b\xd1\xc2\x25\x05\xf6\x9b\xf3\xed\xcb\x0b\x17\x2f\x2a" - "\x29\x88\x5d\x2f\xb6\xea\xfe\xe6\xe5\x3e\x78\xd6\x49\xb9\x0f\x30" - "\xff\xb3\x1d\xaf\xf6\x2e\x3e\xf3\xbe\x70\x3f\x93\xc9\x63\x43\xdd" - "\xab\x64\xe2\x35\x0a\xe0\x53\x6d\x8c\x09\xca\x6f\x33\x25\x69\x56" - "\xd6\xb9\x9e\x81\xfd\xfb\x83\xf1\x51\xe1\x9c\xd6\x63\x84\x31\x7c" - "\x5d\x36\x0d\x3b\x45\xcf\x2c\xe4\x32\x13\xd2\xf0\xa2\x68\x80\xad" - "\x9b\x04\x7b\x84\x6d\x43\xc1\xfe\x82\xf8\x7c\x19\xf2\x89\xd3\xf4" - "\xec\x55\x2c\x7b\xf9\x0e\x05\xa5\xfb\x0a\xe0\xf8\xec\xcd\xc8\xd3" - "\x88\x30\xd3\x66\xa4\x85\x3e\xdd\xc1\xf9\x10\x3e\x8d\xcf\xf5\x23" - "\xdc\xac\xfb\x40\xe2\xb0\xef\xf0\xb9\x7b\x84\x59\xa3\xc2\x0a\xd8" - "\x5f\x2f\xc2\xec\x3a\xbc\x17\x98\xce\xf8\xce\xd2\x6d\x6e\x4e\x53" - "\xa1\x97\x1b\x63\x3f\xb1\x2f\xf2\x3b\x26\x66\xda\xe7\x3f\xf2\xf5" - "\x69\xf7\x3e\xbd\x74\xc9\xa2\x54\x92\x64\xcf\xc8\x74\xdc\x9c\x79" - "\x87\xe3\xd6\x7b\xec\xc5\x05\x05\xcb\xec\x2f\x16\x2c\x29\xb1\x2f" - "\x7c\x71\xe1\xca\x54\x5a\xb4\x74\xd9\xd3\x7c\x82\x9c\x9b\x65\x79" - "\xee\xd3\x8b\x7e\xc0\x8b\xfa\x2a\x75\x6a\xcc\x78\x3c\x9f\x65\x9b" - "\xee\x67\xe1\x08\x64\x6e\x50\xa4\xbc\xe9\xc2\x3b\xfb\x1e\xb2\xe1" - "\xd9\x8c\xdf\x3b\xf8\x1d\xc2\xef\x38\x7e\xc7\xce\xd0\xf3\xf3\xf1" - "\x3c\xd8\xe3\x2e\x9a\x6c\xe8\x05\x03\x3c\x54\x34\xcb\xe0\x21\x8c" - "\xe3\x07\xd5\xf8\x56\xe4\x68\x0d\xc9\xfe\xd3\xcf\x53\x95\x17\x07" - "\x78\x4a\xfa\x37\xe4\x3d\x2b\x2b\x10\x0f\x1e\x66\x3b\x16\x34\x4f" - "\x61\xba\x9d\xa6\xa5\xcf\xc1\xf6\x67\xbb\x86\xe7\x81\x9a\xc1\x2f" - "\x2d\xca\xdf\x46\x11\xdb\x42\x63\x51\xc6\x3b\x7a\x19\xea\x7b\x94" - "\x38\xc2\x76\xfe\x29\xfd\x5b\xd9\xc4\x4b\x87\xf0\x3b\x3f\xf5\xb5" - "\x22\x0b\xef\xff\x53\xb6\x95\x11\xf7\xdc\x2e\xbd\x0c\x0f\x68\xe1" - "\xaa\x73\x8b\xa0\x61\x83\xf0\x1c\x93\x25\xe9\x3e\x01\x7c\xce\x45" - "\x92\x1f\x6f\x93\x7e\xf9\x5c\xbd\x90\x11\x77\xde\xe9\x75\xc8\xf4" - "\x49\x3c\x07\x35\xb7\x58\x44\xd8\x2f\x6a\x24\xf9\xd9\x36\xce\x27" - "\xcc\x6f\xba\x22\x9b\x87\x67\x29\x5d\x80\xfd\xa1\x3d\xa7\xef\x03" - "\x15\x41\xa6\xed\x19\x2a\xba\x55\xd9\x33\xcf\xcf\x57\x7a\xd6\x73" - "\xeb\x8d\xbd\x64\xe8\xa3\x19\xf8\xae\x36\x64\x80\x8f\x9e\xcb\xd3" - "\xf7\xfd\x78\x54\xfd\x9f\x6b\xd1\xbf\x0f\xe9\x38\x26\xb1\x6f\x07" - "\xe0\x7f\x8c\xdb\x0e\xb6\xe1\x21\xbc\x1f\x07\x7d\x5a\x14\x7d\x9e" - "\x93\x73\x0c\xd0\x6b\x38\xfe\x38\xf2\x1d\x43\xdc\x71\xe5\x43\xe1" - "\x39\x13\xd7\x79\x60\x6f\x60\x6d\x16\x70\x1d\xc2\x6b\x6a\xe8\x4b" - "\x87\xbc\x17\xb9\x7f\x3e\xc7\xb0\x9b\x0c\xb9\xc3\x72\x26\x37\x8c" - "\x7e\x2a\xf5\xd2\x25\x53\x0d\x79\x33\xc0\x07\x4b\xb2\x13\xc9\x92" - "\x44\xed\xae\xe8\xbf\xe4\x37\xc2\xfd\x6c\x35\x70\x6a\x92\x6d\xc0" - "\x7e\x22\x2f\xf6\xeb\xbf\x7d\x4a\x46\x2e\xe9\xd7\x7f\x0d\x3c\xd8" - "\xdf\xad\x8f\x71\xeb\x95\xeb\x9c\xba\xdc\x58\xd2\x62\xc8\x0d\x03" - "\x8e\x25\x49\x44\x2c\x0e\xfc\x2b\xdf\x6d\xe2\x39\x56\x1e\x2f\xa5" - "\x3e\x02\x38\x23\x2e\xa8\x33\x3e\x91\x8a\xdd\x90\x7f\x4b\xd6\x43" - "\xc6\x98\xa4\x8e\xea\x7e\xf6\x67\x03\xb2\x68\xa9\x3d\x1a\xa6\x30" - "\xef\x36\x31\x5c\x96\x47\xac\x93\xe4\x86\x01\x2b\x65\xb7\x49\x1f" - "\x5f\x20\x83\x97\x66\x1b\xb8\x82\x86\x47\x0c\x7c\xf5\x3b\x32\x8e" - "\xa0\x9c\xa6\x79\xe1\x3e\xde\xeb\xda\xac\xda\xf3\x79\x29\x6f\x10" - "\xb7\x0f\x79\x37\xfa\xe8\x19\x9f\xde\x87\x5a\x90\x7f\xdf\xe1\xb2" - "\x19\x48\xb3\x74\x8f\xbe\x5f\xf3\x18\xda\xf7\x78\x14\xef\xef\x8a" - "\xb2\x97\x8f\xab\x36\xbc\xd7\x75\x8a\x96\x76\x44\x85\xeb\x6d\x7b" - "\x38\xfb\x14\x15\xef\x52\xb6\x67\x63\xb3\xca\x5f\x2c\xf7\x6c\x1a" - "\x38\xb2\x2c\xe0\xf3\x48\xdc\xc7\x25\xed\x65\x1b\x17\xdb\x8d\xf1" - "\x02\xb0\x0e\x4a\x9a\x8f\x12\xef\x30\x9d\x94\x2f\x83\x67\xff\xb7" - "\xa2\x53\xf1\xac\x18\xda\xf3\xb8\x89\x72\x98\x4e\x23\xd6\x8a\xc8" - "\x88\x40\x92\xc8\x5d\x69\x92\xbe\x9b\xb9\x8f\xf3\xda\x04\xf8\x43" - "\xea\x55\x8a\x6e\xc5\xe5\x06\xdd\x8c\xb6\x63\x3a\xf9\x68\x69\x90" - "\x69\x1b\x5b\xc7\x61\xc7\x4e\x19\x75\x07\x4d\x79\xbe\x14\xdf\xb5" - "\x7a\xbf\x68\xf1\x8c\xe6\xb5\xf2\xa2\xd7\x0f\x9b\xbe\x4e\x87\x1d" - "\x93\x49\xd1\xb6\x18\xf6\xdf\x33\xb3\x64\x3d\x14\xac\x23\x4c\x5f" - "\xee\x2b\xa2\x7c\x37\xe9\xbe\x84\x8e\xa8\xfd\x1a\x45\xb5\xa2\x62" - "\xb7\x2c\x93\x69\xd3\xad\x49\x7f\xa2\xc7\x98\x46\x2c\x17\xb9\x2f" - "\x71\x1f\xe0\xfe\xa4\x68\xf4\xfc\x8c\x28\x1a\x35\x33\x7d\x74\x3a" - "\x1d\x8c\x93\xe5\x05\xf6\xa2\x69\x4a\x16\xdb\x33\x6e\xce\x9f\x24" - "\x9d\x78\xd8\x1f\x9c\x7e\x8f\x3d\x7b\xda\xcd\x8e\xc2\xf1\x73\xd5" - "\x63\x7a\xf6\x6c\x7e\xa6\xc6\xda\x4f\x76\x94\xb3\x2f\xd6\x06\x7b" - "\x71\xbc\x92\x1f\xcf\x37\xfb\xa8\x57\xf2\x0d\x6c\xe5\xce\xca\xf3" - "\x44\x61\xa6\xe1\x12\xb4\x69\x79\x63\xc3\x3c\xc8\xe0\x79\x2b\xc5" - "\x67\xf5\x08\x67\x9f\xb4\xcc\x8b\x91\x8a\xc6\x06\xb6\x79\xfd\x29" - "\x27\xfc\xf8\x35\xf9\x53\xf6\x2e\x98\x79\xab\x53\xf4\xb8\x97\x59" - "\x8d\xba\xb0\x5d\x2c\x38\xbf\x43\x84\x99\x2e\xb9\x0e\xb4\x37\xf2" - "\xb1\x8d\x8c\x74\x53\x7c\xb4\xc8\xa5\x6c\xc3\x65\xa8\xff\xb3\xed" - "\xba\xfc\xca\xc6\xf7\x7c\x1f\x4d\x92\xdf\x11\xb7\x8d\xe7\xe7\x4c" - "\x91\x75\xb7\x3d\x0c\x1b\xa0\xc9\x80\x09\x58\x43\x75\x5f\x73\x12" - "\xde\x17\xdd\x2b\x18\xd9\xb0\xbb\xc6\x92\xa4\xfc\xda\xa1\x5f\xbb" - "\xea\xb5\x48\x4e\xff\x5e\x00\xc4\x8d\x58\x6b\xe5\xbd\x02\x39\xe0" - "\x37\x17\xa7\x31\xe2\x2a\xdd\x11\x5f\xa5\x16\x09\xa2\xed\xac\x4a" - "\x67\xee\x64\xb9\x06\xfb\x73\x39\x19\x63\x99\x1c\x03\x35\x72\x29" - "\x1b\x66\xb9\x5c\xe3\x3b\xef\x36\x21\xfe\xf9\xda\x1b\xd3\xa5\x5d" - "\x12\x8c\xb8\x93\x48\xed\xcf\x5c\x76\xc1\x90\xab\xbc\xc6\x62\x59" - "\x2b\xfc\x3c\xbf\x66\x09\x09\x3f\xaf\xb7\xc8\xf1\x82\xce\x90\xb7" - "\xb4\xc7\xc5\x7e\x47\xa5\xde\x83\x72\xd5\x58\x11\x56\x63\x05\xca" - "\x87\x2d\x9f\x87\x31\x21\xe9\x0c\x2d\x6b\x66\xfc\x99\x36\x3c\x87" - "\x1b\x01\xad\xbc\x3c\x36\x32\x7d\x52\x7f\x66\xe3\x75\x7e\xae\xab" - "\x25\x84\x3a\x47\xd7\x4b\x8b\xf8\x36\xbb\x51\x2f\x0d\xf5\x72\x74" - "\x31\xcf\x06\x79\xff\x05\xfa\xd8\x28\xe9\x5b\x57\xda\xd8\xcb\xdb" - "\xa3\xeb\xc8\x32\x5f\xd5\xa1\x64\x48\xa2\x3a\x0a\x8d\xeb\x28\x69" - "\xf0\xef\x7a\x1f\x93\x78\xb2\xcc\xe8\xa4\xe5\xa0\x31\xef\x7b\x68" - "\x6c\x00\x1f\x4d\xe7\x36\xc4\x98\x59\xc5\x78\x26\x6a\x2f\x86\xa7" - "\x60\x95\x34\x5a\xd6\xba\xf2\x7a\xdc\x25\xc5\x89\xe9\x5d\xf2\xca" - "\xe5\xe9\x5d\x52\xc0\xf9\x19\x0f\xde\x07\x62\x09\xc1\x40\x07\xdf" - "\xc2\x46\x2b\x4f\x54\xee\x88\xb5\x0d\x8c\x57\xc2\x38\xc8\x9d\xce" - "\x4a\x5d\xee\x80\x0f\xc5\x3c\xfc\x58\x0e\xf5\xb8\x5f\x48\x33\x64" - "\x90\x25\xc9\x9e\x2c\x65\x82\x26\xaa\x12\xc1\xb0\xac\xad\xe2\x7d" - "\x17\xd3\x51\x7e\xc2\x78\xd0\xd8\x0e\x1a\x55\x45\xd6\x7d\xed\x46" - "\x4b\x12\xdd\xe7\x4f\xfe\x5a\xaa\xc5\x11\x1a\xc7\x34\x04\x4c\x07" - "\xfa\xee\x35\x6c\x9b\x2a\x5f\x58\x2f\x60\xfc\x7f\x49\xfa\x96\xf1" - "\xa7\x34\x56\x29\x7f\x59\x2f\xd4\xf8\x68\x63\x86\x31\xaf\x89\xef" - "\x3d\x3e\xfa\x20\x4d\xf5\xcb\x6b\x77\x88\x0d\x7b\x33\x22\x6e\x8b" - "\xb0\xaf\xb2\x40\x77\x5c\x71\x7f\x44\x64\x68\x22\x75\x6f\xc6\x00" - "\x9f\xa8\x3d\x21\x06\x9f\x20\x7f\x47\x62\x1e\x58\x91\x72\x79\x1e" - "\x78\x41\xae\x17\x33\xdd\x95\x7d\xb2\x22\xd3\xd0\x4d\xc4\xba\x6b" - "\x77\xd8\xcb\xb8\xfc\x17\x9a\x55\xd9\x4c\x93\x2c\x9e\xab\x9f\x0d" - "\xba\xb8\x90\x76\x81\x21\x07\x98\x5f\x2c\x61\x4a\x62\x59\xc4\xbc" - "\x82\x38\x07\xe4\x4c\x9b\x9a\x43\xdc\xeb\x93\x77\x2c\xb9\x9f\xcf" - "\xf3\x3b\x0b\x77\xf2\x1e\xce\x40\xca\x6e\xe8\xfb\x2b\x6a\x7d\xf4" - "\x4b\x25\x8b\xcc\xbb\xc1\x73\xbb\x4d\xd5\x23\x31\x2e\xab\xbd\x4c" - "\x69\xdc\xa7\xd9\xe7\x0d\xf7\x6b\x84\xa5\x03\x6f\xf6\x7f\x03\x1b" - "\x67\x45\xbf\xff\x9b\x88\x3b\x0b\xb2\x42\xc8\xf1\x13\x63\xd1\x98" - "\x6e\xd0\x6e\xab\x16\xd9\x73\x71\x92\x8d\xb8\xce\x17\xd7\x8d\xde" - "\xf3\xa3\x89\x64\xfa\xdf\xb6\xa7\xa8\xf8\x0e\x4a\x5f\xfb\x75\x13" - "\xfd\xd7\x14\xd2\x98\x0e\x3e\x5a\xd1\xae\x68\xf7\xe2\x38\xa3\x7d" - "\x7c\xf4\xc2\x46\x6e\x0f\x9e\x7f\x9b\x17\x12\x9f\xa9\x39\xc2\x17" - "\x21\xff\xf2\x49\xc5\x3f\x7f\x28\x7e\xde\x87\x75\x78\xfb\xe2\xe5" - "\xf6\xfc\xa5\x2f\x2e\x19\x3b\x36\xc6\x3e\x32\xc9\x73\x1d\xee\x17" - "\x73\xd4\x18\xfa\xe2\x46\x03\x6f\xd6\x45\xf0\x8d\xfa\x3f\x5f\x1d" - "\x6f\xcf\xcd\xce\xd5\xb7\xee\xe6\x66\xd2\xc0\xfb\xed\x34\xfb\xf6" - "\xa8\xcf\x3b\x69\xf6\x1d\x77\xe6\x3e\x5c\xb0\x30\x7f\x65\x54\xe8" - "\x5d\xd1\x73\x72\x95\x3b\x50\x76\xf2\xe8\x07\x20\x2b\x92\xe6\xae" - "\xe6\xf1\xc4\xb1\xb6\x2c\x24\xfe\x06\x79\x3d\x05\x7d\x2c\xf7\x68" - "\x49\x88\x8e\x42\x96\x89\x6b\x59\x86\x0f\x53\xe7\xd5\xa0\x43\x81" - "\xb7\x2c\xa8\xbb\x1f\xba\xdc\x05\x9e\x93\x41\xbe\xdd\xad\x35\xec" - "\x6b\x76\x6f\xbe\xd2\x2b\x1c\x79\x08\xbf\x0a\xcf\x0a\x3c\x87\xe2" - "\xb9\xc9\xbe\x04\xb6\x0e\xef\x0f\x5e\xc1\xfb\x83\x1d\x2f\x30\x8d" - "\x26\x06\x5c\x34\x71\x19\xeb\xe9\x0e\x1b\xeb\x1d\x3e\x72\x1c\xe1" - "\xf5\x01\x4e\x8b\xb0\x85\xf6\x67\x28\x93\x9f\x42\xae\xab\x38\xf2" - "\x44\xc5\xde\x7c\xb1\x33\x87\xef\x70\x19\x87\xf0\xf7\x93\x93\x3e" - "\xa6\x64\xdb\xb0\xfb\x7b\xdc\x0e\x8c\x7f\xf9\xb2\xdf\x0e\x76\x5f" - "\x1a\xeb\x1a\xdc\xe7\x07\x74\x11\xe8\x82\xd0\x45\x72\x1d\x1b\x08" - "\xef\xa6\x01\x3d\x64\xa5\xb5\x5f\xa7\xd5\x28\x15\xdf\x76\x83\xdf" - "\xf1\x3e\xde\xe0\xc7\x18\xbf\x60\x4b\x4a\x0a\x96\x15\xe4\xdb\x6f" - "\x5e\x9e\x4a\x51\x5e\xc1\x0a\x0b\x96\xd8\x97\x15\x3c\xff\x42\xc1" - "\x72\xe9\xd1\x8b\x63\x63\xc6\xf3\x74\x91\xba\xa7\xc6\x38\xb3\x62" - "\x1f\xcd\x74\x5c\xf9\x0a\xfb\x92\x12\x1b\xde\xb0\xf1\xba\xa7\xb2" - "\x25\xba\x66\xc5\xda\x12\xab\xc7\x29\x1d\x6e\xef\x7c\x65\xc7\xac" - "\xfa\x0d\x7f\x9f\xa2\x55\x53\x07\x7c\x4e\xaf\xec\xe2\xfb\x0f\x74" - "\xfa\xfc\x19\x78\xb7\x1b\xf4\xf1\xd1\x6a\xe3\x1c\x41\xa7\x94\x13" - "\x18\x4b\x21\xe7\x62\xc6\x51\x75\x1f\xda\x4a\xde\x3b\x90\x2c\xe7" - "\x64\x53\xf6\xe6\x70\x59\x0c\xf3\x34\xf2\xa3\x1d\xe6\x43\x3e\xb2" - "\x1c\x2b\x37\xe0\xa1\xcc\xe3\x5c\x9e\x6e\xe3\x7c\xe5\x0c\xad\x92" - "\x6b\xd6\x91\xf2\xbd\x39\x2c\x3b\x26\x4a\x9d\x03\x70\xe4\x3a\xd6" - "\xea\x22\xd6\x1f\xa5\xdf\x73\xc0\xe2\x39\x58\xc8\x80\x42\xbe\x3b" - "\x8f\xc3\x94\x4f\xab\x95\x53\x78\x9e\x18\x65\x41\x9f\x58\xd5\x38" - "\xb0\x2f\x7b\x75\x11\xeb\x94\x0c\xd7\x47\xab\x0a\x19\x9e\xf2\xd9" - "\xb5\x0a\xba\xf5\x8b\x1d\x03\xba\xd1\xea\xb4\x28\x9b\x0b\xf8\x28" - "\x3c\x03\xc0\x45\xfa\x84\x54\xfb\xe6\x64\xbd\x59\x4e\x56\xeb\x75" - "\x37\xea\xd3\xe3\x5e\x6d\x03\xcf\x1d\x37\xd6\x5d\x7d\x7a\xbd\x19" - "\x3f\xc6\x3d\x1a\x67\x1d\xdf\x19\x8c\x2f\xf2\x65\x47\xf5\x61\x9e" - "\x73\x19\x82\xb0\xfc\x81\xfd\xb8\x2b\xf7\xc5\xcb\x87\x07\x16\x3e" - "\xfd\x2c\x1b\xe9\xb3\x33\xc7\xdb\x59\x56\xe4\x3e\x3c\x73\xfa\x77" - "\x73\xa7\xcf\x7b\x74\xee\x7c\xb9\xff\xbe\x3f\x7e\xc6\x92\xc4\x09" - "\x62\xf9\xca\x0a\xde\xc8\x46\x7b\x0d\x39\x45\x65\x76\xe5\x8f\x79" - "\x75\x47\xac\x3f\x66\xbe\x26\xab\x74\x0c\x7e\x53\x88\xd6\xd8\xf1" - "\x83\x1e\x59\x96\xae\xf3\xcb\xe9\x1e\x77\x69\xfa\x00\xbf\x94\xc9" - "\x39\x6f\xde\x97\xa0\xe6\x52\x4b\x21\xff\x57\xe6\x47\xc7\x0d\xd8" - "\x7e\xa5\xb3\xfb\x6d\xbf\x7e\x59\x50\xea\x30\xec\x40\x84\x2d\x80" - "\x0d\x98\xc2\x36\xa0\x9a\xfb\x29\x93\x3a\x56\xbc\xad\x36\x60\xa7" - "\x99\xc9\xb0\x01\xd9\x17\x24\xaf\x7b\xaa\x3e\x5a\x7a\x30\xca\xc6" - "\x0a\x48\x5f\x81\x17\x95\x4d\xc8\xf9\xe4\x5c\x9b\xb9\x6b\x32\xcf" - "\x3f\x43\xaf\xcd\xc6\x18\x8f\x71\xa7\x47\x88\x94\xae\xc9\x3a\x4e" - "\x01\x9e\x8f\x66\x7d\x57\xd9\x7b\xab\x1d\x2c\x7f\xc5\xba\xd1\x0f" - "\xcc\x0b\x4b\x3f\x6a\x90\xbd\x6b\x6c\x03\x3c\x57\x66\xe7\xb6\x64" - "\x1a\xf8\xa8\x74\x1c\xe8\x60\x1a\xa8\xf3\x9a\xac\xfe\x3a\xeb\xf3" - "\x18\xc6\x1c\x86\x2a\xab\x6c\xec\x60\xf5\x4b\x5c\xb7\x35\x55\x9f" - "\x5b\x37\x37\x0d\xe1\x7e\x61\xd4\xf1\xd2\xfa\xad\x39\x1e\x57\xbf" - "\x9a\x04\xf5\x0b\xf6\xaf\xbb\xf4\xcf\x4b\x94\x8d\xe5\x7a\x32\x1f" - "\xa0\x9e\xe6\x64\x9b\xd9\x1e\xf5\x7e\x4b\x22\xb9\x3a\x62\xad\xa6" - "\x9f\x01\x29\x7b\xa1\x79\x8c\xb4\xd3\x82\x5b\xb4\x48\xe1\x16\x37" - "\x7e\x78\xb2\x9e\x3d\xa0\xab\x8a\xa0\x4e\x93\x92\x66\xc8\x5e\x9e" - "\x6b\x19\xec\x6c\x1b\x68\x76\xd2\x98\x07\xc0\x7b\x1b\xdb\x93\xf3" - "\xc2\xf7\x09\x0e\x67\x1a\xc0\x26\xf1\x83\xaf\xda\x94\xde\x56\xd6" - "\xdc\x2f\xb3\x6f\x99\xea\x4a\x5e\x4b\xf6\xc3\xb5\x77\x70\xf8\x49" - "\xb4\x9d\x9c\x1b\x94\x77\xd7\x0d\x02\x33\x37\x9c\x45\x89\xe1\x3a" - "\xc7\x18\x70\x07\x3b\x07\x19\x1d\xb6\x74\x89\xbd\x70\xe1\x92\xfc" - "\xa5\x8b\x16\x8d\xb7\xbf\xb0\xe4\xa9\xa2\xa5\x4f\x3f\xcb\x82\x7f" - "\x79\xc9\x0b\xe8\xbf\xb2\xdf\xce\x98\x3d\x3b\xf7\x81\x47\x1f\xf9" - "\x7e\x8c\x0e\x60\xae\x72\x47\xca\xe5\x5d\x59\xeb\x9e\x59\x85\x32" - "\xd1\xfe\x8b\x0e\xa9\xf1\xc6\x89\xf1\xff\xa9\xd9\x4a\xd7\x7a\xbc" - "\x43\x9d\xfd\x74\x06\xa3\xe4\xda\x88\x33\xe4\x82\xfe\xe0\xcc\x1a" - "\x98\x03\x71\x1e\x8b\xd6\x21\xba\xe5\x7d\x75\xce\x76\xc3\x0f\x42" - "\xc9\x58\xd2\x4c\x63\xab\xa8\x5a\x13\x2e\x1f\xb9\xcc\xb0\x17\x4f" - "\xf6\xb8\x5d\x26\xe8\x86\x6d\xba\xfd\x78\x92\xd7\x58\xd9\x7e\x0c" - "\xc3\x96\x9c\xb7\xd2\x73\x5f\xee\xca\x24\xde\x43\x2c\xef\x49\x08" - "\x5d\x14\xed\xbc\xce\xc9\x6b\x46\x7c\x4f\x42\xe5\x33\xd2\x9e\x4c" - "\x96\x69\xf0\x5e\x79\x9a\xd4\x3d\x37\x21\xb2\xd7\xe3\xbd\x4e\xda" - "\x1f\xae\x7c\x43\xf7\xb4\xac\xb5\xcb\x33\xa9\x9b\x55\x7b\xb4\x71" - "\x5b\x70\x79\xb9\x2b\x3d\xaa\x0c\xb4\x01\xf2\x5a\xd4\xbc\x8f\xab" - "\xf6\xb2\xf3\xd9\x29\x27\x06\x3b\x1b\x09\x9e\x77\x0d\xdb\xa2\xfc" - "\x13\xf3\x3e\x38\xbf\xb1\x0f\x8b\xf7\x64\x01\x6e\x20\x7e\x4f\x97" - "\xda\x97\xb0\x36\xcd\xd8\x0f\x82\x77\x5b\xbf\xbe\xcc\x77\x6b\xc0" - "\xce\xb1\x97\xad\x1d\x7a\x96\x5c\xff\x5e\x3f\xc8\xbc\xb2\x71\x06" - "\x55\xdf\x37\x35\x0c\x30\xfa\xef\x3f\x16\xf8\xae\x1f\x35\x80\x07" - "\xe2\x1c\xc6\x7e\x22\xb9\x87\x0c\x63\x16\xdf\xdf\x71\x9a\xd6\xbe" - "\x26\xef\x0b\xb9\x91\xe7\x84\xd7\x1e\x6a\x96\x7b\xd9\xd6\x36\x46" - "\xe3\xa2\xf0\x58\x5b\xc0\xf3\x96\x1c\x1f\x8d\x8b\x63\xe1\x0b\x8b" - "\x27\x39\x16\x2d\xb6\x3f\x5d\xb8\xb8\x38\x77\xb1\xf4\x19\x2a\xdd" - "\x91\x96\xac\x2c\xe6\x59\xfa\x5b\x53\xe3\xc6\x0a\x7d\xdf\x59\xff" - "\xfe\x1a\xb9\xf7\xcc\x7d\x1d\xe8\xa1\xa9\xbd\x67\xeb\xac\x6a\x3c" - "\x74\x67\x5c\xba\xcf\xc2\x3d\xd5\xd8\x67\x01\xbe\xb2\x56\x2b\xff" - "\xe4\xfa\xde\x0c\xe6\x3b\xf7\x82\x04\x79\x8a\xfb\xf7\x19\xf1\x7e" - "\x97\xbe\x1c\x79\x46\x40\xfa\x92\x7e\x95\xdb\x6d\x6d\xb3\xd7\x31" - "\x93\x7d\x63\xea\xfc\xec\x6e\x30\xf8\xd9\xd8\xa3\xc6\xb0\xf8\x8c" - "\xc2\xa4\x60\xf4\xfe\x94\x75\x43\x30\xb6\xd8\xfa\xeb\xb1\x5a\x23" - "\xc6\x3d\xa0\x79\x18\x8f\xf6\x78\x3c\x80\xdf\x58\x84\x47\xed\xff" - "\x31\xea\xb9\x0e\xfa\xdf\xba\xfc\x78\x9e\xbb\x7f\xe6\x6c\x28\x73" - "\xcb\x0b\x4a\x52\x69\xfa\xc2\xa2\x22\xee\xd7\x0b\x0b\x8a\x5e\x58" - "\xb6\x74\x79\xee\xe2\x25\x8b\x11\x7a\xff\x22\x76\xe5\x2a\x93\xdc" - "\xa3\xc7\xd8\x97\x14\x14\xe4\xab\x20\xbd\x19\x62\xd7\x46\xd4\xfa" - "\xf7\x3a\xf4\xc3\xb5\x53\x06\xf4\x96\x75\x6d\x42\x5b\x37\x06\xbf" - "\xaf\xca\x3e\x2d\x75\x8a\x75\x8d\xb1\x76\xc1\xba\x83\x06\x3f\xc8" - "\xf6\x73\xf2\x1e\x91\xc6\xbb\xbb\x85\x5c\x4b\x40\x9b\xbd\xc4\x77" - "\x50\x0f\x81\xcd\x62\x66\x7d\x38\x0a\x4e\x67\x3f\x2d\xd7\x3d\xde" - "\xc6\xbc\xc8\xf0\xd0\xdf\x4c\x7c\x36\xbb\xc7\xbd\x1e\xfc\xef\xf2" - "\x28\xfe\x5f\xdf\xcf\xff\xdd\x5a\x32\x6c\x9c\xf5\x19\x86\x1e\x1c" - "\xdb\x67\xd6\x67\x5d\xda\x97\x78\xcf\xe0\xfa\x1c\x83\xb6\x46\x3b" - "\x2b\xde\x5a\x7f\xc1\x98\x9b\xac\xd7\x7d\x89\xf3\x3b\xe7\x65\x1d" - "\x57\x8c\x18\x7e\x1f\xef\x81\x3e\x45\xeb\x9b\x15\xbf\xac\x6f\x88" - "\xda\xcb\x63\x3d\x43\xeb\x3d\xaa\x9d\xd6\x1f\x32\xf0\xf3\xd1\x7a" - "\xd6\x6c\xe4\x1d\x85\xaa\xef\xaf\x9b\xa6\x78\x67\xfd\x49\x83\xb6" - "\x6c\x37\xe2\xbb\x73\x60\x4c\x5f\xb7\x91\xc7\x3a\xfd\x6c\x7a\x1f" - "\xd7\x1f\x70\x8a\x0c\x38\x3d\xee\x97\x50\x7f\x73\xb3\x41\x2b\x23" - "\x4d\x34\x4f\x4c\x5f\x58\x0c\xa3\x6e\xf1\xa2\x45\x05\xcb\x96\x1b" - "\xbe\x7a\x33\x96\x16\xe5\x2b\xdf\xbc\xf7\xa0\xf9\x5f\x44\x0f\x9c" - "\xc6\xee\x7d\x11\xaa\x5e\xe3\x6c\x80\xf1\x6c\x87\xcb\xfd\x5e\x52" - "\xff\xaf\x58\x5b\xa7\xdb\x02\xa7\xe8\x87\x2e\x3c\x21\x0f\x7e\x78" - "\x97\xd2\xcb\x52\xfe\x0b\x38\xed\x33\xf4\xb2\xee\xa1\x53\x60\x5f" - "\xbf\xf4\x8e\x71\xef\x92\xa1\x2b\xf0\x59\x14\xcf\x12\xf6\x75\x5e" - "\xf1\x49\xa4\xa2\xd1\x25\x52\xb7\xf0\xdc\x6e\x1a\xf3\xfd\xf0\x4e" - "\xf6\x83\xce\xfe\x62\x7e\x28\x75\x19\x96\x25\xec\xd3\xbc\x9d\x5e" - "\x6a\xe3\xbb\x8f\x7d\x54\xd1\xe1\x4f\x69\x74\xad\x5f\x45\xe6\x5d" - "\xdb\x44\x3b\xdf\xd7\xda\xdc\xc0\x74\xfc\xe1\xb8\xdf\x97\xaa\xfb" - "\xa8\xf9\x1e\xdf\x4d\x88\x03\x6f\xf9\xf5\xb9\xe4\x6a\x7d\x1e\xaf" - "\x1a\xe9\xa0\xff\xa5\x1d\x52\x7c\xb9\x35\xf7\xab\x2e\x72\xc8\x7b" - "\xd3\xdc\xbc\x0f\x68\x8b\x9f\xcf\xc8\x89\xf2\xad\x79\x8c\x2b\xf4" - "\x19\x3f\xf4\x20\xe4\xdb\x9a\x07\x58\xfb\x22\x15\xfb\x3d\xca\x57" - "\x34\xf3\xc8\x4b\xb5\x5c\x67\x99\x8f\xe7\x0c\xcb\x1b\x6b\xe5\xfd" - "\x6a\x15\x8d\x0e\xbd\xac\x5a\xe8\x75\xb3\x59\xb7\x13\x17\xbb\x1a" - "\xa0\x5b\xf2\x38\xe6\x1f\xb1\xd6\xc7\x3e\xae\x4b\x79\xfe\x73\x44" - "\xe0\x06\x01\x79\x30\x3c\x37\x64\x25\xe3\x3e\x25\x9e\xff\x54\x3a" - "\xd6\x0f\x03\x03\x73\xcd\xc8\x7f\x91\xd2\xc0\x9b\xae\x76\xfa\x91" - "\xdc\xff\xc4\x7c\xc9\x74\xec\x05\xed\x24\xde\x17\xbb\x9a\x60\x93" - "\x0e\x3f\x4d\x3f\xba\x9d\x69\xc8\x6b\x80\xbc\x77\x07\x61\x16\xf6" - "\x23\x7d\x8a\x7e\x74\x1d\xd3\x8f\x61\x89\xf2\x6a\x4f\xa8\x27\xe7" - "\x5b\x7c\x9e\x90\x65\xd3\x9a\x52\xe8\x81\x8b\xb8\x5f\x97\xbf\xce" - "\xb6\x1d\xdf\xf7\xc1\xef\xce\x7c\x11\x91\xf4\x5f\xc5\xf4\x2f\x7f" - "\x7d\x4d\x87\x88\x7c\xe6\x26\x71\x24\x40\xf4\x99\x46\xa1\xa0\x96" - "\xc4\xeb\x25\x9a\xb3\x8b\xcf\x3c\x36\x90\xd7\x51\x4e\x28\xd7\xbc" - "\x79\x15\x59\xf9\x8c\x28\xdf\x65\xd1\x1a\xa8\xa5\xd6\xe2\x5a\xfa" - "\xd7\x50\x35\x79\x56\xf0\x99\xff\x8a\x59\x7f\x72\x54\xf3\xba\x4a" - "\x0a\xde\x53\xec\xdf\xe5\xb2\x7e\xe4\xfb\xd3\xf1\x3f\xd3\x9f\x3c" - "\x7f\x26\xfb\x63\xf2\xdb\xdf\x92\xf3\xaf\xd4\x92\xf5\xaf\xe4\x6c" - "\x17\x11\xb6\x0f\xca\x9e\xe3\x32\xca\x01\xab\x81\xcf\x56\x5a\x23" - "\xdd\xb6\x54\xd4\xdf\x34\xcf\x41\xd4\x1a\xf0\x83\x9f\xfe\x17\xe3" - "\xf8\x7c\xdd\x79\x32\x7b\x96\xfc\x41\xbe\x2b\xbd\xbd\xab\xc1\x9b" - "\xdf\xc6\x3a\x53\x88\xcf\x92\xf2\x3a\x14\xf4\xde\x48\x25\xe3\x18" - "\x56\x78\xf3\x9d\xcc\x46\x7e\xe8\x54\x46\x7e\x79\x56\x7e\x17\xd3" - "\x03\x38\x1d\x9d\xaf\x68\xd2\xd2\x06\x9a\x7e\x57\xa7\x4f\x4e\x34" - "\x7d\x7e\x54\xc5\xf4\x61\x3f\x84\x91\x15\x5d\x0d\xc0\x2d\x0b\x34" - "\x88\x18\x65\x70\xfb\xeb\x73\x78\xe6\xcd\xe7\x29\xcd\xb3\x84\xef" - "\x25\x2a\xbf\x60\xc9\x36\x99\x23\x17\xcf\x36\x55\x5e\x20\x13\xb7" - "\x1b\xcf\xd5\x57\xca\x78\x49\x73\xc9\xf3\xd1\x77\x83\x33\x1f\xf2" - "\xfd\xe0\x68\xaf\x72\xe0\x50\x8c\xb6\x6a\xe0\xa7\xe2\xf3\xad\x79" - "\x7c\xd6\x5e\xd7\xeb\x07\xc2\xc1\xe7\x21\xbe\x7b\x50\xce\x51\x94" - "\x17\x33\x1f\x4b\xdb\x5e\x7b\x29\x73\x17\x64\x4e\xed\xab\x72\x5d" - "\x3b\xad\x6e\x24\x59\x59\x06\xef\x90\x7b\x89\x2b\x4a\x0c\x39\xb4" - "\x61\x14\x9f\x4f\x2a\x6f\xd0\xe4\xdd\x72\x8d\x35\x3a\x7f\xd7\x20" - "\x4d\x8d\x8f\xd2\x4f\x2a\x59\x5c\xd1\x68\xf4\x2b\xe8\x4c\x7e\x83" - "\xf7\x81\xab\xc3\xcf\xfc\x2e\xf7\x24\xf8\x60\xcf\x5a\xe4\x5d\x8a" - "\x03\xf7\xa9\x55\x9c\x34\xf8\x1c\x75\x6b\x62\x99\xc1\xfd\x7b\x30" - "\x9d\x1b\xfa\x5e\x8b\xd8\x99\xc3\xf7\xd5\x53\xda\x5a\xe1\x4f\x6b" - "\xb7\x08\xbe\xa3\x92\xcf\xb6\xf1\xbd\x89\x75\x08\x47\x7c\xd2\xdc" - "\x80\xdf\x02\xfd\x90\xef\x64\x32\x19\xe1\xbc\xd6\xc0\x73\x33\x73" - "\x03\xc2\x3f\x6f\xa5\x85\xef\x76\x1b\x23\xe7\x9f\xf5\xf0\x56\x1b" - "\xaf\x41\xf8\x2d\xa0\x5f\xa8\x1f\x56\x77\x4e\x32\xe3\x89\xb4\xe9" - "\xfd\x69\xbb\x73\x4c\x5e\x87\x2a\x33\x2a\x6c\xc8\x3c\x07\xf2\x72" - "\x7b\xeb\x61\x4a\xaf\xdc\xf0\x4e\xbf\xad\xc4\x3e\xfb\xba\x31\x0e" - "\x2e\xcf\x49\x8a\x74\xe7\x68\x61\xc0\x46\xff\xb1\xca\x3b\xe6\x42" - "\x7e\xfd\x9e\x97\x0e\xc8\x81\x36\x12\x15\x5d\xd9\x48\x67\x62\xb8" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 21:37:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F62A106566C; Thu, 14 Jan 2010 21:37:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2ED8FC14; Thu, 14 Jan 2010 21:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ELbfOo053193; Thu, 14 Jan 2010 21:37:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELbfir053190; Thu, 14 Jan 2010 21:37:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142137.o0ELbfir053190@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 21:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202308 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:37:41 -0000 Author: yongari Date: Thu Jan 14 21:37:40 2010 New Revision: 202308 URL: http://svn.freebsd.org/changeset/base/202308 Log: MFC r200798,200801,200803-200804,200808,200810 r200798: Use ANSI function definations. r200801: o Remove unnecessary return statement. o Remove register keyword. r200803: s/u_intXX_t/uintXX_t/g r200804: Remove trailing white spaces. r200808: style(9) r200810: Sort function prototyes. Also remove mergeinfo recorded in if_ste.c/if_stereg.h. Modified: stable/7/sys/dev/ste/if_ste.c (contents, props changed) stable/7/sys/dev/ste/if_stereg.h (contents, props changed) Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:34:12 2010 (r202307) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:37:40 2010 (r202308) @@ -91,45 +91,44 @@ static struct ste_type ste_devs[] = { { 0, 0, NULL } }; -static int ste_probe(device_t); -static int ste_attach(device_t); -static int ste_detach(device_t); -static void ste_init(void *); -static void ste_init_locked(struct ste_softc *); -static void ste_intr(void *); -static void ste_rxeoc(struct ste_softc *); -static void ste_rxeof(struct ste_softc *); -static void ste_txeoc(struct ste_softc *); -static void ste_txeof(struct ste_softc *); -static void ste_stats_update(void *); -static void ste_stop(struct ste_softc *); -static void ste_reset(struct ste_softc *); -static int ste_ioctl(struct ifnet *, u_long, caddr_t); -static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); -static void ste_start(struct ifnet *); -static void ste_start_locked(struct ifnet *); -static void ste_watchdog(struct ste_softc *); -static int ste_shutdown(device_t); -static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, - struct mbuf *); -static int ste_ifmedia_upd(struct ifnet *); -static void ste_ifmedia_upd_locked(struct ifnet *); -static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); - -static void ste_mii_sync(struct ste_softc *); -static void ste_mii_send(struct ste_softc *, u_int32_t, int); -static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *); -static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *); -static int ste_miibus_readreg(device_t, int, int); -static int ste_miibus_writereg(device_t, int, int, int); -static void ste_miibus_statchg(device_t); - -static int ste_eeprom_wait(struct ste_softc *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); -static void ste_wait(struct ste_softc *); -static void ste_setmulti(struct ste_softc *); -static int ste_init_rx_list(struct ste_softc *); -static void ste_init_tx_list(struct ste_softc *); +static int ste_attach(device_t); +static int ste_detach(device_t); +static int ste_probe(device_t); +static int ste_shutdown(device_t); + +static int ste_eeprom_wait(struct ste_softc *); +static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); +static int ste_ifmedia_upd(struct ifnet *); +static void ste_ifmedia_upd_locked(struct ifnet *); +static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void ste_init(void *); +static void ste_init_locked(struct ste_softc *); +static int ste_init_rx_list(struct ste_softc *); +static void ste_init_tx_list(struct ste_softc *); +static void ste_intr(void *); +static int ste_ioctl(struct ifnet *, u_long, caddr_t); +static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *); +static void ste_mii_send(struct ste_softc *, uint32_t, int); +static void ste_mii_sync(struct ste_softc *); +static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *); +static int ste_miibus_readreg(device_t, int, int); +static void ste_miibus_statchg(device_t); +static int ste_miibus_writereg(device_t, int, int, int); +static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, + struct mbuf *); +static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static void ste_reset(struct ste_softc *); +static void ste_rxeoc(struct ste_softc *); +static void ste_rxeof(struct ste_softc *); +static void ste_setmulti(struct ste_softc *); +static void ste_start(struct ifnet *); +static void ste_start_locked(struct ifnet *); +static void ste_stats_update(void *); +static void ste_stop(struct ste_softc *); +static void ste_txeoc(struct ste_softc *); +static void ste_txeof(struct ste_softc *); +static void ste_wait(struct ste_softc *); +static void ste_watchdog(struct ste_softc *); #ifdef STE_USEIOSPACE #define STE_RES SYS_RES_IOPORT @@ -194,16 +193,15 @@ SYSCTL_INT(_hw_ste, OID_AUTO, rxsyncs, C #define MII_SET(x) STE_SETBIT1(sc, STE_PHYCTL, x) -#define MII_CLR(x) STE_CLRBIT1(sc, STE_PHYCTL, x) +#define MII_CLR(x) STE_CLRBIT1(sc, STE_PHYCTL, x) /* * Sync the PHYs by setting data bit and strobing the clock 32 times. */ static void -ste_mii_sync(sc) - struct ste_softc *sc; +ste_mii_sync(struct ste_softc *sc) { - register int i; + int i; MII_SET(STE_PHYCTL_MDIR|STE_PHYCTL_MDATA); @@ -213,20 +211,15 @@ ste_mii_sync(sc) MII_CLR(STE_PHYCTL_MCLK); DELAY(1); } - - return; } /* * Clock a series of bits through the MII. */ static void -ste_mii_send(sc, bits, cnt) - struct ste_softc *sc; - u_int32_t bits; - int cnt; +ste_mii_send(struct ste_softc *sc, uint32_t bits, int cnt) { - int i; + int i; MII_CLR(STE_PHYCTL_MCLK); @@ -247,12 +240,9 @@ ste_mii_send(sc, bits, cnt) * Read an PHY register through the MII. */ static int -ste_mii_readreg(sc, frame) - struct ste_softc *sc; - struct ste_mii_frame *frame; - +ste_mii_readreg(struct ste_softc *sc, struct ste_mii_frame *frame) { - int i, ack; + int i, ack; /* * Set up frame for RX. @@ -261,7 +251,7 @@ ste_mii_readreg(sc, frame) frame->mii_opcode = STE_MII_READOP; frame->mii_turnaround = 0; frame->mii_data = 0; - + CSR_WRITE_2(sc, STE_PHYCTL, 0); /* * Turn on data xmit. @@ -299,7 +289,7 @@ ste_mii_readreg(sc, frame) * need to clock through 16 cycles to keep the PHY(s) in sync. */ if (ack) { - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { MII_CLR(STE_PHYCTL_MCLK); DELAY(1); MII_SET(STE_PHYCTL_MCLK); @@ -328,18 +318,15 @@ fail: DELAY(1); if (ack) - return(1); - return(0); + return (1); + return (0); } /* * Write to a PHY register through the MII. */ static int -ste_mii_writereg(sc, frame) - struct ste_softc *sc; - struct ste_mii_frame *frame; - +ste_mii_writereg(struct ste_softc *sc, struct ste_mii_frame *frame) { /* @@ -349,7 +336,7 @@ ste_mii_writereg(sc, frame) frame->mii_stdelim = STE_MII_STARTDELIM; frame->mii_opcode = STE_MII_WRITEOP; frame->mii_turnaround = STE_MII_TURNAROUND; - + /* * Turn on data output. */ @@ -375,16 +362,14 @@ ste_mii_writereg(sc, frame) */ MII_CLR(STE_PHYCTL_MDIR); - return(0); + return (0); } static int -ste_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +ste_miibus_readreg(device_t dev, int phy, int reg) { - struct ste_softc *sc; - struct ste_mii_frame frame; + struct ste_softc *sc; + struct ste_mii_frame frame; sc = device_get_softc(dev); @@ -397,16 +382,14 @@ ste_miibus_readreg(dev, phy, reg) frame.mii_regaddr = reg; ste_mii_readreg(sc, &frame); - return(frame.mii_data); + return (frame.mii_data); } static int -ste_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +ste_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct ste_softc *sc; - struct ste_mii_frame frame; + struct ste_softc *sc; + struct ste_mii_frame frame; sc = device_get_softc(dev); bzero((char *)&frame, sizeof(frame)); @@ -417,15 +400,14 @@ ste_miibus_writereg(dev, phy, reg, data) ste_mii_writereg(sc, &frame); - return(0); + return (0); } static void -ste_miibus_statchg(dev) - device_t dev; +ste_miibus_statchg(device_t dev) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = device_get_softc(dev); @@ -436,30 +418,26 @@ ste_miibus_statchg(dev) } else { STE_CLRBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); } - - return; } - + static int -ste_ifmedia_upd(ifp) - struct ifnet *ifp; +ste_ifmedia_upd(struct ifnet *ifp) { - struct ste_softc *sc; + struct ste_softc *sc; sc = ifp->if_softc; STE_LOCK(sc); ste_ifmedia_upd_locked(ifp); STE_UNLOCK(sc); - return(0); + return (0); } static void -ste_ifmedia_upd_locked(ifp) - struct ifnet *ifp; +ste_ifmedia_upd_locked(struct ifnet *ifp) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -474,12 +452,10 @@ ste_ifmedia_upd_locked(ifp) } static void -ste_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +ste_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->ste_miibus); @@ -489,15 +465,12 @@ ste_ifmedia_sts(ifp, ifmr) ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; STE_UNLOCK(sc); - - return; } static void -ste_wait(sc) - struct ste_softc *sc; +ste_wait(struct ste_softc *sc) { - register int i; + int i; for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_DMACTL) & STE_DMACTL_DMA_HALTINPROG)) @@ -506,8 +479,6 @@ ste_wait(sc) if (i == STE_TIMEOUT) device_printf(sc->ste_dev, "command never completed!\n"); - - return; } /* @@ -515,10 +486,9 @@ ste_wait(sc) * it a command. */ static int -ste_eeprom_wait(sc) - struct ste_softc *sc; +ste_eeprom_wait(struct ste_softc *sc) { - int i; + int i; DELAY(1000); @@ -531,10 +501,10 @@ ste_eeprom_wait(sc) if (i == 100) { device_printf(sc->ste_dev, "eeprom failed to come ready\n"); - return(1); + return (1); } - return(0); + return (0); } /* @@ -542,18 +512,13 @@ ste_eeprom_wait(sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(sc, dest, off, cnt, swap) - struct ste_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int err = 0, i; - u_int16_t word = 0, *ptr; + uint16_t word, *ptr; + int err = 0, i; if (ste_eeprom_wait(sc)) - return(1); + return (1); for (i = 0; i < cnt; i++) { CSR_WRITE_2(sc, STE_EEPROM_CTL, STE_EEOPCODE_READ | (off + i)); @@ -561,24 +526,23 @@ ste_read_eeprom(sc, dest, off, cnt, swap if (err) break; word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else - *ptr = word; + *ptr = word; } - return(err ? 1 : 0); + return (err ? 1 : 0); } static void -ste_setmulti(sc) - struct ste_softc *sc; +ste_setmulti(struct ste_softc *sc) { - struct ifnet *ifp; - int h = 0; - u_int32_t hashes[2] = { 0, 0 }; - struct ifmultiaddr *ifma; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t hashes[2] = { 0, 0 }; + int h; ifp = sc->ste_ifp; if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { @@ -613,8 +577,6 @@ ste_setmulti(sc) CSR_WRITE_2(sc, STE_MAR3, (hashes[1] >> 16) & 0xFFFF); STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); - - return; } #ifdef DEVICE_POLLING @@ -647,7 +609,7 @@ ste_poll_locked(struct ifnet *ifp, enum ste_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { - u_int16_t status; + uint16_t status; status = CSR_READ_2(sc, STE_ISR_ACK); @@ -671,12 +633,11 @@ ste_poll_locked(struct ifnet *ifp, enum #endif /* DEVICE_POLLING */ static void -ste_intr(xsc) - void *xsc; +ste_intr(void *xsc) { - struct ste_softc *sc; - struct ifnet *ifp; - u_int16_t status; + struct ste_softc *sc; + struct ifnet *ifp; + uint16_t status; sc = xsc; STE_LOCK(sc); @@ -734,8 +695,6 @@ ste_intr(xsc) ste_start_locked(ifp); STE_UNLOCK(sc); - - return; } static void @@ -766,20 +725,19 @@ ste_rxeoc(struct ste_softc *sc) * the higher level protocols. */ static void -ste_rxeof(sc) - struct ste_softc *sc; +ste_rxeof(struct ste_softc *sc) { - struct mbuf *m; - struct ifnet *ifp; - struct ste_chain_onefrag *cur_rx; - int total_len = 0, count=0; - u_int32_t rxstat; + struct mbuf *m; + struct ifnet *ifp; + struct ste_chain_onefrag *cur_rx; + uint32_t rxstat; + int total_len = 0, count = 0; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - while((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) + while ((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) & STE_RXSTAT_DMADONE) { #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { @@ -820,7 +778,7 @@ ste_rxeof(sc) continue; } - /* No errors; receive the packet. */ + /* No errors; receive the packet. */ m = cur_rx->ste_mbuf; total_len = cur_rx->ste_ptr->ste_status & STE_RXSTAT_FRAMELEN; @@ -853,11 +811,10 @@ ste_rxeof(sc) } static void -ste_txeoc(sc) - struct ste_softc *sc; +ste_txeoc(struct ste_softc *sc) { - u_int8_t txstat; - struct ifnet *ifp; + struct ifnet *ifp; + uint8_t txstat; ifp = sc->ste_ifp; @@ -888,22 +845,19 @@ ste_txeoc(sc) ste_init_locked(sc); CSR_WRITE_2(sc, STE_TX_STATUS, txstat); } - - return; } static void -ste_txeof(sc) - struct ste_softc *sc; +ste_txeof(struct ste_softc *sc) { - struct ste_chain *cur_tx; - struct ifnet *ifp; - int idx; + struct ifnet *ifp; + struct ste_chain *cur_tx; + int idx; ifp = sc->ste_ifp; idx = sc->ste_cdata.ste_tx_cons; - while(idx != sc->ste_cdata.ste_tx_prod) { + while (idx != sc->ste_cdata.ste_tx_prod) { cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; if (!(cur_tx->ste_ptr->ste_ctl & STE_TXCTL_DMADONE)) @@ -923,12 +877,11 @@ ste_txeof(sc) } static void -ste_stats_update(xsc) - void *xsc; +ste_stats_update(void *xsc) { - struct ste_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct ste_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; STE_LOCK_ASSERT(sc); @@ -958,8 +911,6 @@ ste_stats_update(xsc) if (sc->ste_timer > 0 && --sc->ste_timer == 0) ste_watchdog(sc); callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); - - return; } @@ -968,14 +919,13 @@ ste_stats_update(xsc) * IDs against our list and return a device name if we find a match. */ static int -ste_probe(dev) - device_t dev; +ste_probe(device_t dev) { - struct ste_type *t; + struct ste_type *t; t = ste_devs; - while(t->ste_name != NULL) { + while (t->ste_name != NULL) { if ((pci_get_vendor(dev) == t->ste_vid) && (pci_get_device(dev) == t->ste_did)) { device_set_desc(dev, t->ste_name); @@ -984,7 +934,7 @@ ste_probe(dev) t++; } - return(ENXIO); + return (ENXIO); } /* @@ -992,13 +942,12 @@ ste_probe(dev) * setup and ethernet/BPF attach. */ static int -ste_attach(dev) - device_t dev; +ste_attach(device_t dev) { - struct ste_softc *sc; - struct ifnet *ifp; - int error = 0, rid; - u_char eaddr[6]; + struct ste_softc *sc; + struct ifnet *ifp; + u_char eaddr[6]; + int error = 0, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1127,7 +1076,7 @@ fail: if (error) ste_detach(dev); - return(error); + return (error); } /* @@ -1138,11 +1087,10 @@ fail: * allocated. */ static int -ste_detach(dev) - device_t dev; +ste_detach(device_t dev) { - struct ste_softc *sc; - struct ifnet *ifp; + struct ste_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->ste_mtx), ("ste mutex not initialized")); @@ -1182,25 +1130,22 @@ ste_detach(dev) mtx_destroy(&sc->ste_mtx); - return(0); + return (0); } static int -ste_newbuf(sc, c, m) - struct ste_softc *sc; - struct ste_chain_onefrag *c; - struct mbuf *m; +ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *c, struct mbuf *m) { - struct mbuf *m_new = NULL; + struct mbuf *m_new = NULL; if (m == NULL) { MGETHDR(m_new, M_DONTWAIT, MT_DATA); if (m_new == NULL) - return(ENOBUFS); + return (ENOBUFS); MCLGET(m_new, M_DONTWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); - return(ENOBUFS); + return (ENOBUFS); } m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; } else { @@ -1216,16 +1161,15 @@ ste_newbuf(sc, c, m) c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t)); c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST; - return(0); + return (0); } static int -ste_init_rx_list(sc) - struct ste_softc *sc; +ste_init_rx_list(struct ste_softc *sc) { - struct ste_chain_data *cd; - struct ste_list_data *ld; - int i; + struct ste_chain_data *cd; + struct ste_list_data *ld; + int i; cd = &sc->ste_cdata; ld = sc->ste_ldata; @@ -1233,7 +1177,7 @@ ste_init_rx_list(sc) for (i = 0; i < STE_RX_LIST_CNT; i++) { cd->ste_rx_chain[i].ste_ptr = &ld->ste_rx_list[i]; if (ste_newbuf(sc, &cd->ste_rx_chain[i], NULL) == ENOBUFS) - return(ENOBUFS); + return (ENOBUFS); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; @@ -1250,16 +1194,15 @@ ste_init_rx_list(sc) cd->ste_rx_head = &cd->ste_rx_chain[0]; - return(0); + return (0); } static void -ste_init_tx_list(sc) - struct ste_softc *sc; +ste_init_tx_list(struct ste_softc *sc) { - struct ste_chain_data *cd; - struct ste_list_data *ld; - int i; + struct ste_chain_data *cd; + struct ste_list_data *ld; + int i; cd = &sc->ste_cdata; ld = sc->ste_ldata; @@ -1278,15 +1221,12 @@ ste_init_tx_list(sc) cd->ste_tx_prod = 0; cd->ste_tx_cons = 0; - - return; } static void -ste_init(xsc) - void *xsc; +ste_init(void *xsc) { - struct ste_softc *sc; + struct ste_softc *sc; sc = xsc; STE_LOCK(sc); @@ -1295,11 +1235,10 @@ ste_init(xsc) } static void -ste_init_locked(sc) - struct ste_softc *sc; +ste_init_locked(struct ste_softc *sc) { - int i; - struct ifnet *ifp; + struct ifnet *ifp; + int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; @@ -1389,7 +1328,7 @@ ste_init_locked(sc) /* Disable interrupts if we are polling. */ if (ifp->if_capenable & IFCAP_POLLING) CSR_WRITE_2(sc, STE_IMR, 0); - else + else #endif /* Enable interrupts. */ CSR_WRITE_2(sc, STE_IMR, STE_INTRS); @@ -1403,16 +1342,13 @@ ste_init_locked(sc) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); - - return; } static void -ste_stop(sc) - struct ste_softc *sc; +ste_stop(struct ste_softc *sc) { - int i; - struct ifnet *ifp; + struct ifnet *ifp; + int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; @@ -1427,8 +1363,8 @@ ste_stop(sc) STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); ste_wait(sc); - /* - * Try really hard to stop the RX engine or under heavy RX + /* + * Try really hard to stop the RX engine or under heavy RX * data chip will write into de-allocated memory. */ ste_reset(sc); @@ -1450,15 +1386,12 @@ ste_stop(sc) } bzero(sc->ste_ldata, sizeof(struct ste_list_data)); - - return; } static void -ste_reset(sc) - struct ste_softc *sc; +ste_reset(struct ste_softc *sc) { - int i; + int i; STE_SETBIT4(sc, STE_ASICCTL, STE_ASICCTL_GLOBAL_RESET|STE_ASICCTL_RX_RESET| @@ -1476,25 +1409,20 @@ ste_reset(sc) if (i == STE_TIMEOUT) device_printf(sc->ste_dev, "global reset never completed\n"); - - return; } static int -ste_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; -{ - struct ste_softc *sc; - struct ifreq *ifr; - struct mii_data *mii; - int error = 0; +ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct ste_softc *sc; + struct ifreq *ifr; + struct mii_data *mii; + int error = 0; sc = ifp->if_softc; ifr = (struct ifreq *)data; - switch(command) { + switch (command) { case SIOCSIFFLAGS: STE_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -1508,7 +1436,7 @@ ste_ioctl(ifp, command, data) sc->ste_if_flags & IFF_PROMISC) { STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } + } if (ifp->if_drv_flags & IFF_DRV_RUNNING && (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) ste_setmulti(sc); @@ -1542,14 +1470,14 @@ ste_ioctl(ifp, command, data) !(ifp->if_capenable & IFCAP_POLLING)) { error = ether_poll_register(ste_poll, ifp); if (error) - return(error); + return (error); STE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_2(sc, STE_IMR, 0); ifp->if_capenable |= IFCAP_POLLING; STE_UNLOCK(sc); return (error); - + } if (!(ifr->ifr_reqcap & IFCAP_POLLING) && ifp->if_capenable & IFCAP_POLLING) { @@ -1568,19 +1496,16 @@ ste_ioctl(ifp, command, data) break; } - return(error); + return (error); } static int -ste_encap(sc, c, m_head) - struct ste_softc *sc; - struct ste_chain *c; - struct mbuf *m_head; -{ - int frag = 0; - struct ste_frag *f = NULL; - struct mbuf *m; - struct ste_desc *d; +ste_encap(struct ste_softc *sc, struct ste_chain *c, struct mbuf *m_head) +{ + struct mbuf *m; + struct ste_desc *d; + struct ste_frag *f = NULL; + int frag = 0; d = c->ste_ptr; d->ste_ctl = 0; @@ -1618,14 +1543,13 @@ encap_retry: d->ste_frags[frag - 1].ste_len |= STE_FRAG_LAST; d->ste_ctl = 1; - return(0); + return (0); } static void -ste_start(ifp) - struct ifnet *ifp; +ste_start(struct ifnet *ifp) { - struct ste_softc *sc; + struct ste_softc *sc; sc = ifp->if_softc; STE_LOCK(sc); @@ -1634,13 +1558,12 @@ ste_start(ifp) } static void -ste_start_locked(ifp) - struct ifnet *ifp; +ste_start_locked(struct ifnet *ifp) { - struct ste_softc *sc; - struct mbuf *m_head = NULL; - struct ste_chain *cur_tx; - int idx; + struct ste_softc *sc; + struct ste_chain *cur_tx; + struct mbuf *m_head = NULL; + int idx; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -1653,7 +1576,7 @@ ste_start_locked(ifp) idx = sc->ste_cdata.ste_tx_prod; - while(sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { + while (sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { /* * We cannot re-use the last (free) descriptor; * the chip may not have read its ste_next yet. @@ -1686,7 +1609,7 @@ ste_start_locked(ifp) /* Set TX polling interval to start TX engine */ CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 64); - + STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); }else{ @@ -1707,14 +1630,12 @@ ste_start_locked(ifp) sc->ste_timer = 5; } sc->ste_cdata.ste_tx_prod = idx; - - return; } static void ste_watchdog(struct ste_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; ifp = sc->ste_ifp; STE_LOCK_ASSERT(sc); @@ -1731,15 +1652,12 @@ ste_watchdog(struct ste_softc *sc) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); - - return; } static int -ste_shutdown(dev) - device_t dev; +ste_shutdown(device_t dev) { - struct ste_softc *sc; + struct ste_softc *sc; sc = device_get_softc(dev); Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 21:34:12 2010 (r202307) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 21:37:40 2010 (r202308) @@ -96,7 +96,7 @@ #define STE_LATE_COLLS 0x75 #define STE_MULTI_COLLS 0x76 -#define STE_SINGLE_COLLS 0x77 +#define STE_SINGLE_COLLS 0x77 #define STE_DMACTL_RXDMA_STOPPED 0x00000001 #define STE_DMACTL_TXDMA_CMPREQ 0x00000002 @@ -386,27 +386,27 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 21:54:21 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8541065670; Thu, 14 Jan 2010 21:54:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A1D18FC15; Thu, 14 Jan 2010 21:54:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ELsLxD056964; Thu, 14 Jan 2010 21:54:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELsLLg056961; Thu, 14 Jan 2010 21:54:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142154.o0ELsLLg056961@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 21:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202310 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:54:21 -0000 Author: yongari Date: Thu Jan 14 21:54:20 2010 New Revision: 202310 URL: http://svn.freebsd.org/changeset/base/202310 Log: MFC r200853: Add bus_dma(9) and endianness support to ste(4). o Sorted includes and added missing header files. o Added basic endianness support. In theory ste(4) should work on any architectures. o Remove the use of contigmalloc(9), contigfree(9) and vtophys(9). o Added 8 byte alignment limitation of TX/RX descriptor. o Added 1 byte alignment requirement for TX/RX buffers. o ste(4) controllers does not support DAC. Limit DMA address space to be within 32bit address. o Added spare DMA map to gracefully recover from DMA map failure. o Removed dead code for checking STE_RXSTAT_DMADONE bit. The bit was already checked in each iteration of loop so it can't be true. o Added second argument count to ste_rxeof(). It is used to limit number of iterations done in RX handler. ATM polling is the only consumer. o Removed ste_rxeoc() which was added to address RX stuck issue (cvs rev 1.66). Unlike TX descriptors, ST201 supports chaining descriptors to form a ring for RX descriptors. If RX descriptor chaining is not supported it's possible for controller to stop receiving incoming frames once controller pass the end of RX descriptor which in turn requires driver post new RX descriptors to receive more frames. For TX descriptors which does not support chaning, we exactly do manual chaining in driver by concatenating new descriptors to the end of previous TX chain. Maybe the workaround was borrowed from other drivers that does not support RX descriptor chaining, which is not valid for ST201 controllers. I still have no idea how this address RX stuck issue and I can't reproduce the RX stuck issue on DFE-550TX controller. o Removed hw.ste_rxsyncs sysctl as the workaround was removed. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Reimplemented optimized ste_encap(). o Simplified TX logic of ste_start_locked(). o Added comments for TFD/RFD requirements. o Increased number of RX descriptors to 128 from 64. 128 gave much better performance than 64 under high network loads. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:45:39 2010 (r202309) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:54:20 2010 (r202310) @@ -39,14 +39,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include +#include #include +#include #include +#include #include #include #include @@ -55,14 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#include /* for vtophys */ -#include /* for vtophys */ #include #include -#include -#include #include #include @@ -70,13 +69,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" #define STE_USEIOSPACE -#include - MODULE_DEPEND(ste, pci, 1, 1, 1); MODULE_DEPEND(ste, ether, 1, 1, 1); MODULE_DEPEND(ste, miibus, 1, 1, 1); @@ -96,8 +95,12 @@ static int ste_detach(device_t); static int ste_probe(device_t); static int ste_shutdown(device_t); +static int ste_dma_alloc(struct ste_softc *); +static void ste_dma_free(struct ste_softc *); +static void ste_dmamap_cb(void *, bus_dma_segment_t *, int, int); static int ste_eeprom_wait(struct ste_softc *); -static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); +static int ste_encap(struct ste_softc *, struct mbuf **, + struct ste_chain *); static int ste_ifmedia_upd(struct ifnet *); static void ste_ifmedia_upd_locked(struct ifnet *); static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -114,12 +117,10 @@ static int ste_mii_writereg(struct ste_s static int ste_miibus_readreg(device_t, int, int); static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); -static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, - struct mbuf *); +static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); static void ste_reset(struct ste_softc *); -static void ste_rxeoc(struct ste_softc *); -static void ste_rxeof(struct ste_softc *); +static void ste_rxeof(struct ste_softc *, int); static void ste_setmulti(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); @@ -168,11 +169,6 @@ static devclass_t ste_devclass; DRIVER_MODULE(ste, pci, ste_driver, ste_devclass, 0, 0); DRIVER_MODULE(miibus, ste, miibus_driver, miibus_devclass, 0, 0); -SYSCTL_NODE(_hw, OID_AUTO, ste, CTLFLAG_RD, 0, "if_ste parameters"); - -static int ste_rxsyncs; -SYSCTL_INT(_hw_ste, OID_AUTO, rxsyncs, CTLFLAG_RW, &ste_rxsyncs, 0, ""); - #define STE_SETBIT4(sc, reg, x) \ CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (x)) @@ -600,10 +596,7 @@ ste_poll_locked(struct ifnet *ifp, enum STE_LOCK_ASSERT(sc); - sc->rxcycles = count; - if (cmd == POLL_AND_CHECK_STATUS) - ste_rxeoc(sc); - ste_rxeof(sc); + ste_rxeof(sc, count); ste_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); @@ -662,10 +655,8 @@ ste_intr(void *xsc) if (!(status & STE_INTRS)) break; - if (status & STE_ISR_RX_DMADONE) { - ste_rxeoc(sc); - ste_rxeof(sc); - } + if (status & STE_ISR_RX_DMADONE) + ste_rxeof(sc, -1); if (status & STE_ISR_TX_DMADONE) ste_txeof(sc); @@ -697,62 +688,40 @@ ste_intr(void *xsc) STE_UNLOCK(sc); } -static void -ste_rxeoc(struct ste_softc *sc) -{ - struct ste_chain_onefrag *cur_rx; - - STE_LOCK_ASSERT(sc); - - if (sc->ste_cdata.ste_rx_head->ste_ptr->ste_status == 0) { - cur_rx = sc->ste_cdata.ste_rx_head; - do { - cur_rx = cur_rx->ste_next; - /* If the ring is empty, just return. */ - if (cur_rx == sc->ste_cdata.ste_rx_head) - return; - } while (cur_rx->ste_ptr->ste_status == 0); - if (sc->ste_cdata.ste_rx_head->ste_ptr->ste_status == 0) { - /* We've fallen behind the chip: catch it. */ - sc->ste_cdata.ste_rx_head = cur_rx; - ++ste_rxsyncs; - } - } -} - /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. */ static void -ste_rxeof(struct ste_softc *sc) +ste_rxeof(struct ste_softc *sc, int count) { struct mbuf *m; struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; uint32_t rxstat; - int total_len = 0, count = 0; - - STE_LOCK_ASSERT(sc); + int total_len, rx_npkts; ifp = sc->ste_ifp; - while ((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) - & STE_RXSTAT_DMADONE) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + cur_rx = sc->ste_cdata.ste_rx_head; + for (rx_npkts = 0; rx_npkts < STE_RX_LIST_CNT; rx_npkts++, + cur_rx = cur_rx->ste_next) { + rxstat = le32toh(cur_rx->ste_ptr->ste_status); + if ((rxstat & STE_RXSTAT_DMADONE) == 0) + break; #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) + if (count == 0) break; - sc->rxcycles--; + count--; } #endif - if ((STE_RX_LIST_CNT - count) < 3) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - } - - cur_rx = sc->ste_cdata.ste_rx_head; - sc->ste_cdata.ste_rx_head = cur_rx->ste_next; - /* * If an error occurs, update stats, clear the * status word and leave the mbuf cluster in place: @@ -765,22 +734,9 @@ ste_rxeof(struct ste_softc *sc) continue; } - /* - * If there error bit was not set, the upload complete - * bit should be set which means we have a valid packet. - * If not, something truly strange has happened. - */ - if (!(rxstat & STE_RXSTAT_DMADONE)) { - device_printf(sc->ste_dev, - "bad receive status -- packet dropped\n"); - ifp->if_ierrors++; - cur_rx->ste_ptr->ste_status = 0; - continue; - } - /* No errors; receive the packet. */ m = cur_rx->ste_mbuf; - total_len = cur_rx->ste_ptr->ste_status & STE_RXSTAT_FRAMELEN; + total_len = STE_RX_BYTES(rxstat); /* * Try to conjure up a new mbuf cluster. If that @@ -789,7 +745,7 @@ ste_rxeof(struct ste_softc *sc) * result in a lost packet, but there's little else we * can do in this situation. */ - if (ste_newbuf(sc, cur_rx, NULL) == ENOBUFS) { + if (ste_newbuf(sc, cur_rx) != 0) { ifp->if_ierrors++; cur_rx->ste_ptr->ste_status = 0; continue; @@ -802,12 +758,14 @@ ste_rxeof(struct ste_softc *sc) STE_UNLOCK(sc); (*ifp->if_input)(ifp, m); STE_LOCK(sc); - - cur_rx->ste_ptr->ste_status = 0; - count++; } - return; + if (rx_npkts > 0) { + sc->ste_cdata.ste_rx_head = cur_rx; + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } } static void @@ -852,27 +810,40 @@ ste_txeof(struct ste_softc *sc) { struct ifnet *ifp; struct ste_chain *cur_tx; + uint32_t txstat; int idx; - ifp = sc->ste_ifp; + STE_LOCK_ASSERT(sc); + ifp = sc->ste_ifp; idx = sc->ste_cdata.ste_tx_cons; + if (idx == sc->ste_cdata.ste_tx_prod) + return; + + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + while (idx != sc->ste_cdata.ste_tx_prod) { cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; - - if (!(cur_tx->ste_ptr->ste_ctl & STE_TXCTL_DMADONE)) + txstat = le32toh(cur_tx->ste_ptr->ste_ctl); + if ((txstat & STE_TXCTL_DMADONE) == 0) break; - + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, cur_tx->ste_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->ste_cdata.ste_tx_tag, cur_tx->ste_map); + KASSERT(cur_tx->ste_mbuf != NULL, + ("%s: freeing NULL mbuf!\n", __func__)); m_freem(cur_tx->ste_mbuf); cur_tx->ste_mbuf = NULL; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_opackets++; - + sc->ste_cdata.ste_tx_cnt--; STE_INC(idx, STE_TX_LIST_CNT); } sc->ste_cdata.ste_tx_cons = idx; - if (idx == sc->ste_cdata.ste_tx_prod) + if (sc->ste_cdata.ste_tx_cnt == 0) sc->ste_timer = 0; } @@ -1007,17 +978,8 @@ ste_attach(device_t dev) goto fail; } - /* Allocate the descriptor queues. */ - sc->ste_ldata = contigmalloc(sizeof(struct ste_list_data), M_DEVBUF, - M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); - - if (sc->ste_ldata == NULL) { - device_printf(dev, "no memory for list buffers!\n"); - error = ENXIO; + if ((error = ste_dma_alloc(sc)) != 0) goto fail; - } - - bzero(sc->ste_ldata, sizeof(struct ste_list_data)); ifp = sc->ste_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1123,44 +1085,325 @@ ste_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->ste_ldata) { - contigfree(sc->ste_ldata, sizeof(struct ste_list_data), - M_DEVBUF); - } - + ste_dma_free(sc); mtx_destroy(&sc->ste_mtx); return (0); } +struct ste_dmamap_arg { + bus_addr_t ste_busaddr; +}; + +static void +ste_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct ste_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct ste_dmamap_arg *)arg; + ctx->ste_busaddr = segs[0].ds_addr; +} + static int -ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *c, struct mbuf *m) +ste_dma_alloc(struct ste_softc *sc) { - struct mbuf *m_new = NULL; + struct ste_chain *txc; + struct ste_chain_onefrag *rxc; + struct ste_dmamap_arg ctx; + int error, i; + + /* Create parent DMA tag. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->ste_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_parent_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create parent DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Tx descriptor list. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + STE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + STE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_tx_list_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Tx list DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Rx descriptor list. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + STE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + STE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_rx_list_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Rx list DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Tx buffers. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * STE_MAXFRAGS, /* maxsize */ + STE_MAXFRAGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_tx_tag); + if (error != 0) { + device_printf(sc->ste_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); - MCLGET(m_new, M_DONTWAIT); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - return (ENOBUFS); + /* Create DMA tag for Rx buffers. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_rx_tag); + if (error != 0) { + device_printf(sc->ste_dev, "could not create Rx DMA tag.\n"); + goto fail; + } + + /* Allocate DMA'able memory and load the DMA map for Tx list. */ + error = bus_dmamem_alloc(sc->ste_cdata.ste_tx_list_tag, + (void **)&sc->ste_ldata.ste_tx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->ste_cdata.ste_tx_list_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not allocate DMA'able memory for Tx list.\n"); + goto fail; + } + ctx.ste_busaddr = 0; + error = bus_dmamap_load(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, sc->ste_ldata.ste_tx_list, + STE_TX_LIST_SZ, ste_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.ste_busaddr == 0) { + device_printf(sc->ste_dev, + "could not load DMA'able memory for Tx list.\n"); + goto fail; + } + sc->ste_ldata.ste_tx_list_paddr = ctx.ste_busaddr; + + /* Allocate DMA'able memory and load the DMA map for Rx list. */ + error = bus_dmamem_alloc(sc->ste_cdata.ste_rx_list_tag, + (void **)&sc->ste_ldata.ste_rx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->ste_cdata.ste_rx_list_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not allocate DMA'able memory for Rx list.\n"); + goto fail; + } + ctx.ste_busaddr = 0; + error = bus_dmamap_load(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, sc->ste_ldata.ste_rx_list, + STE_RX_LIST_SZ, ste_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.ste_busaddr == 0) { + device_printf(sc->ste_dev, + "could not load DMA'able memory for Rx list.\n"); + goto fail; + } + sc->ste_ldata.ste_rx_list_paddr = ctx.ste_busaddr; + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < STE_TX_LIST_CNT; i++) { + txc = &sc->ste_cdata.ste_tx_chain[i]; + txc->ste_ptr = NULL; + txc->ste_mbuf = NULL; + txc->ste_next = NULL; + txc->ste_phys = 0; + txc->ste_map = NULL; + error = bus_dmamap_create(sc->ste_cdata.ste_tx_tag, 0, + &txc->ste_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->ste_cdata.ste_rx_tag, 0, + &sc->ste_cdata.ste_rx_sparemap)) != 0) { + device_printf(sc->ste_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < STE_RX_LIST_CNT; i++) { + rxc = &sc->ste_cdata.ste_rx_chain[i]; + rxc->ste_ptr = NULL; + rxc->ste_mbuf = NULL; + rxc->ste_next = NULL; + rxc->ste_map = NULL; + error = bus_dmamap_create(sc->ste_cdata.ste_rx_tag, 0, + &rxc->ste_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Rx dmamap.\n"); + goto fail; } - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_new->m_data = m_new->m_ext.ext_buf; } - m_adj(m_new, ETHER_ALIGN); +fail: + return (error); +} - c->ste_mbuf = m_new; - c->ste_ptr->ste_status = 0; - c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t)); - c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST; +static void +ste_dma_free(struct ste_softc *sc) +{ + struct ste_chain *txc; + struct ste_chain_onefrag *rxc; + int i; + /* Tx buffers. */ + if (sc->ste_cdata.ste_tx_tag != NULL) { + for (i = 0; i < STE_TX_LIST_CNT; i++) { + txc = &sc->ste_cdata.ste_tx_chain[i]; + if (txc->ste_map != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_tx_tag, + txc->ste_map); + txc->ste_map = NULL; + } + } + bus_dma_tag_destroy(sc->ste_cdata.ste_tx_tag); + sc->ste_cdata.ste_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->ste_cdata.ste_rx_tag != NULL) { + for (i = 0; i < STE_RX_LIST_CNT; i++) { + rxc = &sc->ste_cdata.ste_rx_chain[i]; + if (rxc->ste_map != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_rx_tag, + rxc->ste_map); + rxc->ste_map = NULL; + } + } + if (sc->ste_cdata.ste_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_rx_tag, + sc->ste_cdata.ste_rx_sparemap); + sc->ste_cdata.ste_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->ste_cdata.ste_rx_tag); + sc->ste_cdata.ste_rx_tag = NULL; + } + /* Tx descriptor list. */ + if (sc->ste_cdata.ste_tx_list_tag != NULL) { + if (sc->ste_cdata.ste_tx_list_map != NULL) + bus_dmamap_unload(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map); + if (sc->ste_cdata.ste_tx_list_map != NULL && + sc->ste_ldata.ste_tx_list != NULL) + bus_dmamem_free(sc->ste_cdata.ste_tx_list_tag, + sc->ste_ldata.ste_tx_list, + sc->ste_cdata.ste_tx_list_map); + sc->ste_ldata.ste_tx_list = NULL; + sc->ste_cdata.ste_tx_list_map = NULL; + bus_dma_tag_destroy(sc->ste_cdata.ste_tx_list_tag); + sc->ste_cdata.ste_tx_list_tag = NULL; + } + /* Rx descriptor list. */ + if (sc->ste_cdata.ste_rx_list_tag != NULL) { + if (sc->ste_cdata.ste_rx_list_map != NULL) + bus_dmamap_unload(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map); + if (sc->ste_cdata.ste_rx_list_map != NULL && + sc->ste_ldata.ste_rx_list != NULL) + bus_dmamem_free(sc->ste_cdata.ste_rx_list_tag, + sc->ste_ldata.ste_rx_list, + sc->ste_cdata.ste_rx_list_map); + sc->ste_ldata.ste_rx_list = NULL; + sc->ste_cdata.ste_rx_list_map = NULL; + bus_dma_tag_destroy(sc->ste_cdata.ste_rx_list_tag); + sc->ste_cdata.ste_rx_list_tag = NULL; + } + if (sc->ste_cdata.ste_parent_tag != NULL) { + bus_dma_tag_destroy(sc->ste_cdata.ste_parent_tag); + sc->ste_cdata.ste_parent_tag = NULL; + } +} + +static int +ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *rxc) +{ + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int error, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); + + if ((error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_rx_tag, + sc->ste_cdata.ste_rx_sparemap, m, segs, &nsegs, 0)) != 0) { + m_freem(m); + return (error); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + if (rxc->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, rxc->ste_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ste_cdata.ste_rx_tag, rxc->ste_map); + } + map = rxc->ste_map; + rxc->ste_map = sc->ste_cdata.ste_rx_sparemap; + sc->ste_cdata.ste_rx_sparemap = map; + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, rxc->ste_map, + BUS_DMASYNC_PREREAD); + rxc->ste_mbuf = m; + rxc->ste_ptr->ste_status = 0; + rxc->ste_ptr->ste_frag.ste_addr = htole32(segs[0].ds_addr); + rxc->ste_ptr->ste_frag.ste_len = htole32(segs[0].ds_len | + STE_FRAG_LAST); return (0); } @@ -1169,30 +1412,31 @@ ste_init_rx_list(struct ste_softc *sc) { struct ste_chain_data *cd; struct ste_list_data *ld; - int i; + int error, i; cd = &sc->ste_cdata; - ld = sc->ste_ldata; - + ld = &sc->ste_ldata; + bzero(ld->ste_rx_list, STE_RX_LIST_SZ); for (i = 0; i < STE_RX_LIST_CNT; i++) { cd->ste_rx_chain[i].ste_ptr = &ld->ste_rx_list[i]; - if (ste_newbuf(sc, &cd->ste_rx_chain[i], NULL) == ENOBUFS) - return (ENOBUFS); + error = ste_newbuf(sc, &cd->ste_rx_chain[i]); + if (error != 0) + return (error); if (i == (STE_RX_LIST_CNT - 1)) { - cd->ste_rx_chain[i].ste_next = - &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = - vtophys(&ld->ste_rx_list[0]); + cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; + ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0); } else { - cd->ste_rx_chain[i].ste_next = - &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = - vtophys(&ld->ste_rx_list[i + 1]); + cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; + ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1)); } - ld->ste_rx_list[i].ste_status = 0; } cd->ste_rx_head = &cd->ste_rx_chain[0]; + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -1205,22 +1449,32 @@ ste_init_tx_list(struct ste_softc *sc) int i; cd = &sc->ste_cdata; - ld = sc->ste_ldata; + ld = &sc->ste_ldata; + bzero(ld->ste_tx_list, STE_TX_LIST_SZ); for (i = 0; i < STE_TX_LIST_CNT; i++) { cd->ste_tx_chain[i].ste_ptr = &ld->ste_tx_list[i]; - cd->ste_tx_chain[i].ste_ptr->ste_next = 0; - cd->ste_tx_chain[i].ste_ptr->ste_ctl = 0; - cd->ste_tx_chain[i].ste_phys = vtophys(&ld->ste_tx_list[i]); - if (i == (STE_TX_LIST_CNT - 1)) - cd->ste_tx_chain[i].ste_next = - &cd->ste_tx_chain[0]; - else - cd->ste_tx_chain[i].ste_next = - &cd->ste_tx_chain[i + 1]; + cd->ste_tx_chain[i].ste_mbuf = NULL; + if (i == (STE_TX_LIST_CNT - 1)) { + cd->ste_tx_chain[i].ste_next = &cd->ste_tx_chain[0]; + cd->ste_tx_chain[i].ste_phys = htole32(STE_ADDR_LO( + ld->ste_tx_list_paddr + + (sizeof(struct ste_desc) * 0))); + } else { + cd->ste_tx_chain[i].ste_next = &cd->ste_tx_chain[i + 1]; + cd->ste_tx_chain[i].ste_phys = htole32(STE_ADDR_LO( + ld->ste_tx_list_paddr + + (sizeof(struct ste_desc) * (i + 1)))); + } } + cd->ste_last_tx = NULL; cd->ste_tx_prod = 0; cd->ste_tx_cons = 0; + cd->ste_tx_cnt = 0; + + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } static void @@ -1253,7 +1507,7 @@ ste_init_locked(struct ste_softc *sc) } /* Init RX list */ - if (ste_init_rx_list(sc) == ENOBUFS) { + if (ste_init_rx_list(sc) != 0) { device_printf(sc->ste_dev, "initialization failed: no memory for RX buffers\n"); ste_stop(sc); @@ -1298,11 +1552,11 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); ste_wait(sc); CSR_WRITE_4(sc, STE_RX_DMALIST_PTR, - vtophys(&sc->ste_ldata->ste_rx_list[0])); + STE_ADDR_LO(sc->ste_ldata.ste_rx_list_paddr)); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_UNSTALL); - /* Set TX polling interval (defer until we TX first packet */ + /* Set TX polling interval(defer until we TX first packet). */ CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 0); /* Load address of the TX list */ @@ -1312,7 +1566,6 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); - sc->ste_tx_prev = NULL; /* Enable receiver and transmitter */ CSR_WRITE_2(sc, STE_MACCTL0, 0); @@ -1348,6 +1601,8 @@ static void ste_stop(struct ste_softc *sc) { struct ifnet *ifp; + struct ste_chain_onefrag *cur_rx; + struct ste_chain *cur_tx; int i; STE_LOCK_ASSERT(sc); @@ -1372,20 +1627,28 @@ ste_stop(struct ste_softc *sc) sc->ste_link = 0; for (i = 0; i < STE_RX_LIST_CNT; i++) { - if (sc->ste_cdata.ste_rx_chain[i].ste_mbuf != NULL) { - m_freem(sc->ste_cdata.ste_rx_chain[i].ste_mbuf); - sc->ste_cdata.ste_rx_chain[i].ste_mbuf = NULL; + cur_rx = &sc->ste_cdata.ste_rx_chain[i]; + if (cur_rx->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, + cur_rx->ste_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ste_cdata.ste_rx_tag, + cur_rx->ste_map); + m_freem(cur_rx->ste_mbuf); + cur_rx->ste_mbuf = NULL; } } for (i = 0; i < STE_TX_LIST_CNT; i++) { - if (sc->ste_cdata.ste_tx_chain[i].ste_mbuf != NULL) { - m_freem(sc->ste_cdata.ste_tx_chain[i].ste_mbuf); - sc->ste_cdata.ste_tx_chain[i].ste_mbuf = NULL; + cur_tx = &sc->ste_cdata.ste_tx_chain[i]; + if (cur_tx->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, + cur_tx->ste_map, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->ste_cdata.ste_tx_tag, + cur_tx->ste_map); + m_freem(cur_tx->ste_mbuf); + cur_tx->ste_mbuf = NULL; } } - - bzero(sc->ste_ldata, sizeof(struct ste_list_data)); } static void @@ -1500,48 +1763,60 @@ ste_ioctl(struct ifnet *ifp, u_long comm } static int -ste_encap(struct ste_softc *sc, struct ste_chain *c, struct mbuf *m_head) +ste_encap(struct ste_softc *sc, struct mbuf **m_head, struct ste_chain *txc) { + struct ste_frag *frag; struct mbuf *m; - struct ste_desc *d; - struct ste_frag *f = NULL; - int frag = 0; - - d = c->ste_ptr; - d->ste_ctl = 0; - -encap_retry: - for (m = m_head, frag = 0; m != NULL; m = m->m_next) { - if (m->m_len != 0) { - if (frag == STE_MAXFRAGS) - break; - f = &d->ste_frags[frag]; - f->ste_addr = vtophys(mtod(m, vm_offset_t)); - f->ste_len = m->m_len; - frag++; - } - } + struct ste_desc *desc; + bus_dma_segment_t txsegs[STE_MAXFRAGS]; + int error, i, nsegs; - if (m != NULL) { - struct mbuf *mn; + STE_LOCK_ASSERT(sc); + M_ASSERTPKTHDR((*m_head)); - /* - * We ran out of segments. We have to recopy this - * mbuf chain first. Bail out if we can't get the - * new buffers. - */ - mn = m_defrag(m_head, M_DONTWAIT); - if (mn == NULL) { - m_freem(m_head); - return ENOMEM; - } - m_head = mn; - goto encap_retry; + error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, + txc->ste_map, *m_head, txsegs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, STE_MAXFRAGS); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOMEM); + } + *m_head = m; + error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, + txc->ste_map, *m_head, txsegs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); + } + } else if (error != 0) + return (error); + if (nsegs == 0) { + m_freem(*m_head); + *m_head = NULL; + return (EIO); + } + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, txc->ste_map, + BUS_DMASYNC_PREWRITE); + + desc = txc->ste_ptr; + for (i = 0; i < nsegs; i++) { + frag = &desc->ste_frags[i]; + frag->ste_addr = htole32(STE_ADDR_LO(txsegs[i].ds_addr)); + frag->ste_len = htole32(txsegs[i].ds_len); } - - c->ste_mbuf = m_head; - d->ste_frags[frag - 1].ste_len |= STE_FRAG_LAST; - d->ste_ctl = 1; + desc->ste_frags[i - 1].ste_len |= htole32(STE_FRAG_LAST); + /* + * Because we use Tx polling we can't chain multiple + * Tx descriptors here. Otherwise we race with controller. + */ + desc->ste_next = 0; + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR); + txc->ste_mbuf = *m_head; + STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT); + sc->ste_cdata.ste_tx_cnt++; return (0); } @@ -1563,7 +1838,7 @@ ste_start_locked(struct ifnet *ifp) struct ste_softc *sc; struct ste_chain *cur_tx; struct mbuf *m_head = NULL; - int idx; + int enq; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -1574,62 +1849,56 @@ ste_start_locked(struct ifnet *ifp) if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - idx = sc->ste_cdata.ste_tx_prod; - - while (sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { - /* - * We cannot re-use the last (free) descriptor; - * the chip may not have read its ste_next yet. - */ - if (STE_NEXT(idx, STE_TX_LIST_CNT) == - sc->ste_cdata.ste_tx_cons) { + for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { + if (sc->ste_cdata.ste_tx_cnt == STE_TX_LIST_CNT - 1) { + /* + * Controller may have cached copy of the last used + * next ptr so we have to reserve one TFD to avoid + * TFD overruns. + */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; - - cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; - - if (ste_encap(sc, cur_tx, m_head) != 0) + cur_tx = &sc->ste_cdata.ste_tx_chain[sc->ste_cdata.ste_tx_prod]; + if (ste_encap(sc, &m_head, cur_tx) != 0) { + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); break; - - cur_tx->ste_ptr->ste_next = 0; - - if (sc->ste_tx_prev == NULL) { - cur_tx->ste_ptr->ste_ctl = STE_TXCTL_DMAINTR | 1; - /* Load address of the TX list */ + } + if (sc->ste_cdata.ste_last_tx == NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); ste_wait(sc); - CSR_WRITE_4(sc, STE_TX_DMALIST_PTR, - vtophys(&sc->ste_ldata->ste_tx_list[0])); - - /* Set TX polling interval to start TX engine */ + STE_ADDR_LO(sc->ste_ldata.ste_tx_list_paddr)); CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 64); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 22:04:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD92E106566B; Thu, 14 Jan 2010 22:04:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD8E8FC0C; Thu, 14 Jan 2010 22:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EM4WVU059527; Thu, 14 Jan 2010 22:04:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EM4WIr059524; Thu, 14 Jan 2010 22:04:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142204.o0EM4WIr059524@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202313 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:04:32 -0000 Author: yongari Date: Thu Jan 14 22:04:32 2010 New Revision: 202313 URL: http://svn.freebsd.org/changeset/base/202313 Log: MFC r200854,200856,200865,200873,200875,200877,200884 r200854: Add minimal dealy while ste(4) is waiting for the end of active DMA cycle. r200856: Introduce sc_flags member variable and use it to keep track of link state and PHY related information. Remove ste_link and ste_one_phy variable of softc as it's not used anymore. While I'm here add IFF_DRV_RUNNING check in ste_start_locked(). r200865: Reimplement miibus_statchg method. Don't rely on link state change interrupt. If we want to use link state change interrupt ste(4) should also implement auto-negotiation complete handler as well as various PHY access handling. Now link state change is handled by mii(4) polling so it will automatically update link state UP/DOWN events which in turn make ste(4) usable with lagg(4). r199559 added a private timer to drive watchdog and the timer also used to drive MAC statistics update. Because the MAC statistics update is called whenever statistics counter reaches near-full, it drove watchdog timer too fast such that it caused false watchdog timeouts under heavy TX traffic conditions. Fix the regression by separating ste_stats_update() from driving watchdog timer and introduce a new function ste_tick() that handles periodic job such as driving watchdog, MAC statistics update and link state check etc. While I'm here clear armed watchdog timer in ste_stop(). r200873: Instead of relying on hard resetting of controller to stop receiving incoming traffics, try harder to gracefully stop active DMA cycles and then stop MACs. This is the way what datasheet recommends and seems to work reliably. Resetting controller while active DMAs are in progress is bad thing as we can't predict how DMAs touche allocated TX/RX buffers. This change ensures controller stop state before attempting to release allocated TX/RX buffers. Also update MAC statistics which could have been updated during the wait time of MAC stop. While I'm here remove unnecessary controller resets in various location. ste(4) no longer relies on hard controller reset to stop controller and resetting controller also clears all configured settings which makes it hard to implement WOL in near future. Now resetting a controller is performed in ste_init_locked(). r200875: Prefer memory space register mapping over io space. If memory space mapping fails fall back to old io space mapping. While I'm here use PCIR_BAR macro. r200877: Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to bus_space_write_{1,2,4}/bus_space_read_{1,2,4}. Remove unused ste_bhandle and ste_btag in softc. r200884: Reimplement Tx status error handler as recommended by datasheet. If ste(4) encounter TX underrun or excessive collisions the TX MAC of controller is stalled so driver should wake it up again. TX underrun requires increasing TX threshold value to minimize further TX underruns. Previously ste(4) used to reset controller to recover from TX underrun, excessive collision and reclaiming error. However datasheet says only TX underrun requires resetting entire controller. So implement ste_restart_tx() that restarts TX MAC and do not perform full reset except TX underrun case. Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read STE_TX_STATUS register. This way ste(4) will also read frame id value and we can write the same value back to STE_TX_FRAMEID register instead of overwriting it to 0. The datasheet was wrong in write back of STE_TX_STATUS so add some comments why we do so. Also always invoke ste_txeoc() after ste_txeof() in ste_poll as without reading TX status register can stall TX MAC. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:04:08 2010 (r202312) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:04:32 2010 (r202313) @@ -74,12 +74,13 @@ __FBSDID("$FreeBSD$"); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#define STE_USEIOSPACE - MODULE_DEPEND(ste, pci, 1, 1, 1); MODULE_DEPEND(ste, ether, 1, 1, 1); MODULE_DEPEND(ste, miibus, 1, 1, 1); +/* Define to show Tx error status. */ +#define STE_SHOW_TXERRORS + /* * Various supported device vendors/types and their names. */ @@ -120,25 +121,19 @@ static int ste_miibus_writereg(device_t, static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); static void ste_reset(struct ste_softc *); +static void ste_restart_tx(struct ste_softc *); static void ste_rxeof(struct ste_softc *, int); static void ste_setmulti(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); -static void ste_stats_update(void *); +static void ste_stats_update(struct ste_softc *); static void ste_stop(struct ste_softc *); +static void ste_tick(void *); static void ste_txeoc(struct ste_softc *); static void ste_txeof(struct ste_softc *); static void ste_wait(struct ste_softc *); static void ste_watchdog(struct ste_softc *); -#ifdef STE_USEIOSPACE -#define STE_RES SYS_RES_IOPORT -#define STE_RID STE_PCI_LOIO -#else -#define STE_RES SYS_RES_MEMORY -#define STE_RID STE_PCI_LOMEM -#endif - static device_method_t ste_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ste_probe), @@ -369,7 +364,7 @@ ste_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if ( sc->ste_one_phy && phy != 0 ) + if ((sc->ste_flags & STE_FLAG_ONE_PHY) != 0 && phy != 0) return (0); bzero((char *)&frame, sizeof(frame)); @@ -404,15 +399,49 @@ ste_miibus_statchg(device_t dev) { struct ste_softc *sc; struct mii_data *mii; + struct ifnet *ifp; + uint16_t cfg; sc = device_get_softc(dev); mii = device_get_softc(sc->ste_miibus); + ifp = sc->ste_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { - STE_SETBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); - } else { - STE_CLRBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); + sc->ste_flags &= ~STE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_100_FX: + case IFM_100_T4: + sc->ste_flags |= STE_FLAG_LINK; + default: + break; + } + } + + /* Program MACs with resolved speed/duplex/flow-control. */ + if ((sc->ste_flags & STE_FLAG_LINK) != 0) { + cfg = CSR_READ_2(sc, STE_MACCTL0); + cfg &= ~(STE_MACCTL0_FLOWCTL_ENABLE | STE_MACCTL0_FULLDUPLEX); + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + /* + * ST201 data sheet says driver should enable receiving + * MAC control frames bit of receive mode register to + * receive flow-control frames but the register has no + * such bits. In addition the controller has no ability + * to send pause frames so it should be handled in + * driver. Implementing pause timer handling in driver + * layer is not trivial, so don't enable flow-control + * here. + */ + cfg |= STE_MACCTL0_FULLDUPLEX; + } + CSR_WRITE_2(sc, STE_MACCTL0, cfg); } } @@ -438,7 +467,7 @@ ste_ifmedia_upd_locked(struct ifnet *ifp sc = ifp->if_softc; STE_LOCK_ASSERT(sc); mii = device_get_softc(sc->ste_miibus); - sc->ste_link = 0; + sc->ste_flags &= ~STE_FLAG_LINK; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) @@ -471,6 +500,7 @@ ste_wait(struct ste_softc *sc) for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_DMACTL) & STE_DMACTL_DMA_HALTINPROG)) break; + DELAY(1); } if (i == STE_TIMEOUT) @@ -598,6 +628,7 @@ ste_poll_locked(struct ifnet *ifp, enum ste_rxeof(sc, count); ste_txeof(sc); + ste_txeoc(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); @@ -606,21 +637,11 @@ ste_poll_locked(struct ifnet *ifp, enum status = CSR_READ_2(sc, STE_ISR_ACK); - if (status & STE_ISR_TX_DONE) - ste_txeoc(sc); - - if (status & STE_ISR_STATS_OFLOW) { - callout_stop(&sc->ste_stat_callout); + if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - } - - if (status & STE_ISR_LINKEVENT) - mii_pollstat(device_get_softc(sc->ste_miibus)); - if (status & STE_ISR_HOSTERR) { - ste_reset(sc); + if (status & STE_ISR_HOSTERR) ste_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -664,19 +685,11 @@ ste_intr(void *xsc) if (status & STE_ISR_TX_DONE) ste_txeoc(sc); - if (status & STE_ISR_STATS_OFLOW) { - callout_stop(&sc->ste_stat_callout); + if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - } - - if (status & STE_ISR_LINKEVENT) - mii_pollstat(device_get_softc(sc->ste_miibus)); - - if (status & STE_ISR_HOSTERR) { - ste_reset(sc); + if (status & STE_ISR_HOSTERR) ste_init_locked(sc); - } } /* Re-enable interrupts */ @@ -771,41 +784,92 @@ ste_rxeof(struct ste_softc *sc, int coun static void ste_txeoc(struct ste_softc *sc) { + uint16_t txstat; struct ifnet *ifp; - uint8_t txstat; + + STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - while ((txstat = CSR_READ_1(sc, STE_TX_STATUS)) & - STE_TXSTATUS_TXDONE) { - if (txstat & STE_TXSTATUS_UNDERRUN || - txstat & STE_TXSTATUS_EXCESSCOLLS || - txstat & STE_TXSTATUS_RECLAIMERR) { + /* + * STE_TX_STATUS register implements a queue of up to 31 + * transmit status byte. Writing an arbitrary value to the + * register will advance the queue to the next transmit + * status byte. This means if driver does not read + * STE_TX_STATUS register after completing sending more + * than 31 frames the controller would be stalled so driver + * should re-wake the Tx MAC. This is the most severe + * limitation of ST201 based controller. + */ + for (;;) { + txstat = CSR_READ_2(sc, STE_TX_STATUS); + if ((txstat & STE_TXSTATUS_TXDONE) == 0) + break; + if ((txstat & (STE_TXSTATUS_UNDERRUN | + STE_TXSTATUS_EXCESSCOLLS | STE_TXSTATUS_RECLAIMERR | + STE_TXSTATUS_STATSOFLOW)) != 0) { ifp->if_oerrors++; - device_printf(sc->ste_dev, - "transmission error: %x\n", txstat); - - ste_reset(sc); - ste_init_locked(sc); - - if (txstat & STE_TXSTATUS_UNDERRUN && +#ifdef STE_SHOW_TXERRORS + device_printf(sc->ste_dev, "TX error : 0x%b\n", + txstat & 0xFF, STE_ERR_BITS); +#endif + if ((txstat & STE_TXSTATUS_UNDERRUN) != 0 && sc->ste_tx_thresh < STE_PACKET_SIZE) { sc->ste_tx_thresh += STE_MIN_FRAMELEN; + if (sc->ste_tx_thresh > STE_PACKET_SIZE) + sc->ste_tx_thresh = STE_PACKET_SIZE; device_printf(sc->ste_dev, - "tx underrun, increasing tx" + "TX underrun, increasing TX" " start threshold to %d bytes\n", sc->ste_tx_thresh); + /* Make sure to disable active DMA cycles. */ + STE_SETBIT4(sc, STE_DMACTL, + STE_DMACTL_TXDMA_STALL); + ste_wait(sc); + ste_init_locked(sc); + break; } - CSR_WRITE_2(sc, STE_TX_STARTTHRESH, sc->ste_tx_thresh); - CSR_WRITE_2(sc, STE_TX_RECLAIM_THRESH, - (STE_PACKET_SIZE >> 4)); + /* Restart Tx. */ + ste_restart_tx(sc); } - ste_init_locked(sc); + /* + * Advance to next status and ACK TxComplete + * interrupt. ST201 data sheet was wrong here, to + * get next Tx status, we have to write both + * STE_TX_STATUS and STE_TX_FRAMEID register. + * Otherwise controller returns the same status + * as well as not acknowledge Tx completion + * interrupt. + */ CSR_WRITE_2(sc, STE_TX_STATUS, txstat); } } static void +ste_tick(void *arg) +{ + struct ste_softc *sc; + struct mii_data *mii; + + sc = (struct ste_softc *)arg; + + STE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->ste_miibus); + mii_tick(mii); + /* + * ukphy(4) does not seem to generate CB that reports + * resolved link state so if we know we lost a link, + * explicitly check the link state. + */ + if ((sc->ste_flags & STE_FLAG_LINK) == 0) + ste_miibus_statchg(sc->ste_dev); + ste_stats_update(sc); + ste_watchdog(sc); + callout_reset(&sc->ste_callout, hz, ste_tick, sc); +} + +static void ste_txeof(struct ste_softc *sc) { struct ifnet *ifp; @@ -848,43 +912,18 @@ ste_txeof(struct ste_softc *sc) } static void -ste_stats_update(void *xsc) +ste_stats_update(struct ste_softc *sc) { - struct ste_softc *sc; struct ifnet *ifp; - struct mii_data *mii; - sc = xsc; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - mii = device_get_softc(sc->ste_miibus); - ifp->if_collisions += CSR_READ_1(sc, STE_LATE_COLLS) + CSR_READ_1(sc, STE_MULTI_COLLS) + CSR_READ_1(sc, STE_SINGLE_COLLS); - - if (!sc->ste_link) { - mii_pollstat(mii); - if (mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->ste_link++; - /* - * we don't get a call-back on re-init so do it - * otherwise we get stuck in the wrong link state - */ - ste_miibus_statchg(sc->ste_dev); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - ste_start_locked(ifp); - } - } - - if (sc->ste_timer > 0 && --sc->ste_timer == 0) - ste_watchdog(sc); - callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); } - /* * Probe for a Sundance ST201 chip. Check the PCI vendor and device * IDs against our list and return a device name if we find a match. @@ -931,7 +970,7 @@ ste_attach(device_t dev) if (pci_get_vendor(dev) == DL_VENDORID && pci_get_device(dev) == DL_DEVICEID_DL10050 && pci_get_revid(dev) == 0x12 ) - sc->ste_one_phy = 1; + sc->ste_flags |= STE_FLAG_ONE_PHY; mtx_init(&sc->ste_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -940,18 +979,23 @@ ste_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = STE_RID; - sc->ste_res = bus_alloc_resource_any(dev, STE_RES, &rid, RF_ACTIVE); - + /* Prefer memory space register mapping over IO space. */ + sc->ste_res_id = PCIR_BAR(1); + sc->ste_res_type = SYS_RES_MEMORY; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + if (sc->ste_res == NULL) { + sc->ste_res_id = PCIR_BAR(0); + sc->ste_res_type = SYS_RES_IOPORT; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + } if (sc->ste_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } - sc->ste_btag = rman_get_bustag(sc->ste_res); - sc->ste_bhandle = rman_get_bushandle(sc->ste_res); - /* Allocate interrupt */ rid = 0; sc->ste_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -963,7 +1007,7 @@ ste_attach(device_t dev) goto fail; } - callout_init_mtx(&sc->ste_stat_callout, &sc->ste_mtx, 0); + callout_init_mtx(&sc->ste_callout, &sc->ste_mtx, 0); /* Reset the adapter. */ ste_reset(sc); @@ -1069,7 +1113,7 @@ ste_detach(device_t dev) STE_LOCK(sc); ste_stop(sc); STE_UNLOCK(sc); - callout_drain(&sc->ste_stat_callout); + callout_drain(&sc->ste_callout); } if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); @@ -1080,7 +1124,8 @@ ste_detach(device_t dev) if (sc->ste_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ste_irq); if (sc->ste_res) - bus_release_resource(dev, STE_RES, STE_RID, sc->ste_res); + bus_release_resource(dev, sc->ste_res_type, sc->ste_res_id, + sc->ste_res); if (ifp) if_free(ifp); @@ -1498,6 +1543,8 @@ ste_init_locked(struct ste_softc *sc) ifp = sc->ste_ifp; ste_stop(sc); + /* Reset the chip to a known state. */ + ste_reset(sc); /* Init our MAC address */ for (i = 0; i < ETHER_ADDR_LEN; i += 2) { @@ -1594,7 +1641,7 @@ ste_init_locked(struct ste_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); + callout_reset(&sc->ste_callout, hz, ste_tick, sc); } static void @@ -1603,28 +1650,44 @@ ste_stop(struct ste_softc *sc) struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; struct ste_chain *cur_tx; + uint32_t val; int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - callout_stop(&sc->ste_stat_callout); + callout_stop(&sc->ste_callout); + sc->ste_timer = 0; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); CSR_WRITE_2(sc, STE_IMR, 0); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_TX_DISABLE); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_RX_DISABLE); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_STATS_DISABLE); - STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); - STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); + /* Stop pending DMA. */ + val = CSR_READ_4(sc, STE_DMACTL); + val |= STE_DMACTL_TXDMA_STALL | STE_DMACTL_RXDMA_STALL; + CSR_WRITE_4(sc, STE_DMACTL, val); ste_wait(sc); - /* - * Try really hard to stop the RX engine or under heavy RX - * data chip will write into de-allocated memory. - */ - ste_reset(sc); - - sc->ste_link = 0; + /* Disable auto-polling. */ + CSR_WRITE_1(sc, STE_RX_DMAPOLL_PERIOD, 0); + CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 0); + /* Nullify DMA address to stop any further DMA. */ + CSR_WRITE_4(sc, STE_RX_DMALIST_PTR, 0); + CSR_WRITE_4(sc, STE_TX_DMALIST_PTR, 0); + /* Stop TX/RX MAC. */ + val = CSR_READ_2(sc, STE_MACCTL1); + val |= STE_MACCTL1_TX_DISABLE | STE_MACCTL1_RX_DISABLE | + STE_MACCTL1_STATS_DISABLE; + CSR_WRITE_2(sc, STE_MACCTL1, val); + for (i = 0; i < STE_TIMEOUT; i++) { + DELAY(10); + if ((CSR_READ_2(sc, STE_MACCTL1) & (STE_MACCTL1_TX_DISABLE | + STE_MACCTL1_RX_DISABLE | STE_MACCTL1_STATS_DISABLE)) == 0) + break; + } + if (i == STE_TIMEOUT) + device_printf(sc->ste_dev, "Stopping MAC timed out\n"); + /* Acknowledge any pending interrupts. */ + CSR_READ_2(sc, STE_ISR_ACK); + ste_stats_update(sc); for (i = 0; i < STE_RX_LIST_CNT; i++) { cur_rx = &sc->ste_cdata.ste_rx_chain[i]; @@ -1674,6 +1737,26 @@ ste_reset(struct ste_softc *sc) device_printf(sc->ste_dev, "global reset never completed\n"); } +static void +ste_restart_tx(struct ste_softc *sc) +{ + uint16_t mac; + int i; + + for (i = 0; i < STE_TIMEOUT; i++) { + mac = CSR_READ_2(sc, STE_MACCTL1); + mac |= STE_MACCTL1_TX_ENABLE; + CSR_WRITE_2(sc, STE_MACCTL1, mac); + mac = CSR_READ_2(sc, STE_MACCTL1); + if ((mac & STE_MACCTL1_TX_ENABLED) != 0) + break; + DELAY(10); + } + + if (i == STE_TIMEOUT) + device_printf(sc->ste_dev, "starting Tx failed"); +} + static int ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { @@ -1843,10 +1926,8 @@ ste_start_locked(struct ifnet *ifp) sc = ifp->if_softc; STE_LOCK_ASSERT(sc); - if (!sc->ste_link) - return; - - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->ste_flags & STE_FLAG_LINK) == 0) return; for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { @@ -1909,13 +1990,15 @@ ste_watchdog(struct ste_softc *sc) ifp = sc->ste_ifp; STE_LOCK_ASSERT(sc); + if (sc->ste_timer == 0 || --sc->ste_timer) + return; + ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); - ste_txeoc(sc); ste_txeof(sc); + ste_txeoc(sc); ste_rxeof(sc, -1); - ste_reset(sc); ste_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:04:08 2010 (r202312) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:04:32 2010 (r202313) @@ -253,6 +253,11 @@ #define STE_TXSTATUS_TXINTR_REQ 0x40 #define STE_TXSTATUS_TXDONE 0x80 +#define STE_ERR_BITS "\20" \ + "\2RECLAIM\3STSOFLOW" \ + "\4EXCESSCOLLS\5UNDERRUN" \ + "\6INTREQ\7DONE" + #define STE_ISRACK_INTLATCH 0x0001 #define STE_ISRACK_HOSTERR 0x0002 #define STE_ISRACK_TX_DONE 0x0004 @@ -276,10 +281,9 @@ #define STE_IMR_TX_DMADONE 0x0200 #define STE_IMR_RX_DMADONE 0x0400 -#define STE_INTRS \ +#define STE_INTRS \ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \ - STE_IMR_TX_DONE|STE_IMR_HOSTERR| \ - STE_IMR_LINKEVENT) + STE_IMR_TX_DONE|STE_IMR_HOSTERR) #define STE_ISR_INTLATCH 0x0001 #define STE_ISR_HOSTERR 0x0002 @@ -466,18 +470,18 @@ struct ste_desc_onefrag { * register space access macros */ #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_4((sc)->ste_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_2((sc)->ste_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_1((sc)->ste_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_4((sc)->ste_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_2((sc)->ste_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_1((sc)->ste_res, reg) #define STE_DESC_ALIGN 8 #define STE_RX_LIST_CNT 128 @@ -545,23 +549,24 @@ struct ste_chain_data { struct ste_softc { struct ifnet *ste_ifp; - bus_space_tag_t ste_btag; - bus_space_handle_t ste_bhandle; struct resource *ste_res; + int ste_res_id; + int ste_res_type; struct resource *ste_irq; void *ste_intrhand; struct ste_type *ste_info; device_t ste_miibus; device_t ste_dev; int ste_tx_thresh; - uint8_t ste_link; + int ste_flags; +#define STE_FLAG_ONE_PHY 0x0001 +#define STE_FLAG_LINK 0x8000 int ste_if_flags; int ste_timer; struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; - struct callout ste_stat_callout; + struct callout ste_callout; struct mtx ste_mtx; - uint8_t ste_one_phy; }; #define STE_LOCK(_sc) mtx_lock(&(_sc)->ste_mtx) From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 22:18:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F419D106566C; Thu, 14 Jan 2010 22:18:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1D3C8FC1A; Thu, 14 Jan 2010 22:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EMItwF062988; Thu, 14 Jan 2010 22:18:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMItSo062985; Thu, 14 Jan 2010 22:18:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142218.o0EMItSo062985@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202315 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:18:56 -0000 Author: yongari Date: Thu Jan 14 22:18:55 2010 New Revision: 202315 URL: http://svn.freebsd.org/changeset/base/202315 Log: MFC r200904-200908,200910-200913 r200904: Don't reinitialize controller if driver is already running. This reduces number of link state UP/DOWN changes. r200905: Reimplement controller reset. Datasheet says full reset takes about 1ms. Since we switched to memory register mapping make sure to flush PCI posted write by reading the register again. While I'm here add additional delays in loop while driver waits the completion of the reset. r200906: Overhaul RX filter programming. o Let RX filter handler program promiscuous/multicast filter as well as broadcasting. o Remove unnecessary register access. o Simplify ioctl handler and have set_rxfilter to handle IFF_PROMISC and IFF_ALLMULTI change instead of directly programming the controller. o Removed unnecessary error variable reinitialization in ioctl handler. o Add IFF_DRV_RUNNING check before programming multicast filter. o Configure maximum allowed frame length before enabling MAC. Datasheet didn't say the exact ordering of programming sequence but it looks more natural to set maximum allowed frame length first prior to enabling controller. r200907: Don't report link status if driver is not running. r200908: Report the correct result of mii_mediachg(). Previously it always used to return success without respect to the result. While I'm here use mii_mediachg() in ste_init_locked which allows driver to use currently configured media. ste_ifmedia_upd() is supposed to be called whenever user changes current media settings. r200910: Implement hardware MAC statistics counter support. The counters could be accessed with dev.ste.0.stats sysctl node. r200911: Remove unused duplicated register definition. It seems the definition was made to access STE_ASICCTL register as 16bits but ste(4) always access the register as 32bits so it was never used before. r200912: Correct STE_COUNTDOWN register offset. The datasheet was wrong. r200913: We don't need to generate DMA complete interrupt for every transmitted frames. So request interrupt for every 16th frames. Due to the limitation of hardware we can't suppress the interrupt as driver should have to check TX status register. The TX status register can store up to 31 TX status so driver can't send more than 31 frames without reading TX status register. With this change controller would not generate TX completion interrupt for every frame, so reclaim transmitted frames in ste_tick(). Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:15:51 2010 (r202314) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:18:55 2010 (r202315) @@ -103,7 +103,6 @@ static int ste_eeprom_wait(struct ste_s static int ste_encap(struct ste_softc *, struct mbuf **, struct ste_chain *); static int ste_ifmedia_upd(struct ifnet *); -static void ste_ifmedia_upd_locked(struct ifnet *); static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); static void ste_init(void *); static void ste_init_locked(struct ste_softc *); @@ -123,11 +122,13 @@ static int ste_read_eeprom(struct ste_so static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static void ste_rxeof(struct ste_softc *, int); -static void ste_setmulti(struct ste_softc *); +static void ste_rxfilter(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); +static void ste_stats_clear(struct ste_softc *); static void ste_stats_update(struct ste_softc *); static void ste_stop(struct ste_softc *); +static void ste_sysctl_node(struct ste_softc *); static void ste_tick(void *); static void ste_txeoc(struct ste_softc *); static void ste_txeof(struct ste_softc *); @@ -449,31 +450,21 @@ static int ste_ifmedia_upd(struct ifnet *ifp) { struct ste_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; sc = ifp->if_softc; STE_LOCK(sc); - ste_ifmedia_upd_locked(ifp); - STE_UNLOCK(sc); - - return (0); -} - -static void -ste_ifmedia_upd_locked(struct ifnet *ifp) -{ - struct ste_softc *sc; - struct mii_data *mii; - - sc = ifp->if_softc; - STE_LOCK_ASSERT(sc); mii = device_get_softc(sc->ste_miibus); - sc->ste_flags &= ~STE_FLAG_LINK; if (mii->mii_instance) { - struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); + STE_UNLOCK(sc); + + return (error); } static void @@ -486,6 +477,10 @@ ste_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->ste_miibus); STE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + STE_UNLOCK(sc); + return; + } mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; @@ -563,27 +558,33 @@ ste_read_eeprom(struct ste_softc *sc, ca } static void -ste_setmulti(struct ste_softc *sc) +ste_rxfilter(struct ste_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; uint32_t hashes[2] = { 0, 0 }; + uint8_t rxcfg; int h; + STE_LOCK_ASSERT(sc); + ifp = sc->ste_ifp; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); - return; + rxcfg = CSR_READ_1(sc, STE_RX_MODE); + rxcfg |= STE_RXMODE_UNICAST; + rxcfg &= ~(STE_RXMODE_ALLMULTI | STE_RXMODE_MULTIHASH | + STE_RXMODE_BROADCAST | STE_RXMODE_PROMISC); + if (ifp->if_flags & IFF_BROADCAST) + rxcfg |= STE_RXMODE_BROADCAST; + if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) { + if ((ifp->if_flags & IFF_ALLMULTI) != 0) + rxcfg |= STE_RXMODE_ALLMULTI; + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= STE_RXMODE_PROMISC; + goto chipit; } - /* first, zot all the existing hash bits */ - CSR_WRITE_2(sc, STE_MAR0, 0); - CSR_WRITE_2(sc, STE_MAR1, 0); - CSR_WRITE_2(sc, STE_MAR2, 0); - CSR_WRITE_2(sc, STE_MAR3, 0); - - /* now program new ones */ + rxcfg |= STE_RXMODE_MULTIHASH; + /* Now program new ones. */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -597,12 +598,13 @@ ste_setmulti(struct ste_softc *sc) } IF_ADDR_UNLOCK(ifp); +chipit: CSR_WRITE_2(sc, STE_MAR0, hashes[0] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR1, (hashes[0] >> 16) & 0xFFFF); CSR_WRITE_2(sc, STE_MAR2, hashes[1] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR3, (hashes[1] >> 16) & 0xFFFF); - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); + CSR_WRITE_1(sc, STE_RX_MODE, rxcfg); + CSR_READ_1(sc, STE_RX_MODE); } #ifdef DEVICE_POLLING @@ -640,8 +642,10 @@ ste_poll_locked(struct ifnet *ifp, enum if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - if (status & STE_ISR_HOSTERR) + if (status & STE_ISR_HOSTERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); + } } } #endif /* DEVICE_POLLING */ @@ -688,8 +692,10 @@ ste_intr(void *xsc) if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - if (status & STE_ISR_HOSTERR) + if (status & STE_ISR_HOSTERR) { ste_init_locked(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + } } /* Re-enable interrupts */ @@ -826,6 +832,7 @@ ste_txeoc(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); ste_wait(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); break; } @@ -864,6 +871,13 @@ ste_tick(void *arg) */ if ((sc->ste_flags & STE_FLAG_LINK) == 0) ste_miibus_statchg(sc->ste_dev); + /* + * Because we are not generating Tx completion + * interrupt for every frame, reclaim transmitted + * buffers here. + */ + ste_txeof(sc); + ste_txeoc(sc); ste_stats_update(sc); ste_watchdog(sc); callout_reset(&sc->ste_callout, hz, ste_tick, sc); @@ -912,16 +926,74 @@ ste_txeof(struct ste_softc *sc) } static void +ste_stats_clear(struct ste_softc *sc) +{ + + STE_LOCK_ASSERT(sc); + + /* Rx stats. */ + CSR_READ_2(sc, STE_STAT_RX_OCTETS_LO); + CSR_READ_2(sc, STE_STAT_RX_OCTETS_HI); + CSR_READ_2(sc, STE_STAT_RX_FRAMES); + CSR_READ_1(sc, STE_STAT_RX_BCAST); + CSR_READ_1(sc, STE_STAT_RX_MCAST); + CSR_READ_1(sc, STE_STAT_RX_LOST); + /* Tx stats. */ + CSR_READ_2(sc, STE_STAT_TX_OCTETS_LO); + CSR_READ_2(sc, STE_STAT_TX_OCTETS_HI); + CSR_READ_2(sc, STE_STAT_TX_FRAMES); + CSR_READ_1(sc, STE_STAT_TX_BCAST); + CSR_READ_1(sc, STE_STAT_TX_MCAST); + CSR_READ_1(sc, STE_STAT_CARRIER_ERR); + CSR_READ_1(sc, STE_STAT_SINGLE_COLLS); + CSR_READ_1(sc, STE_STAT_MULTI_COLLS); + CSR_READ_1(sc, STE_STAT_LATE_COLLS); + CSR_READ_1(sc, STE_STAT_TX_DEFER); + CSR_READ_1(sc, STE_STAT_TX_EXDEFER); + CSR_READ_1(sc, STE_STAT_TX_ABORT); +} + +static void ste_stats_update(struct ste_softc *sc) { struct ifnet *ifp; + struct ste_hw_stats *stats; + uint32_t val; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - ifp->if_collisions += CSR_READ_1(sc, STE_LATE_COLLS) - + CSR_READ_1(sc, STE_MULTI_COLLS) - + CSR_READ_1(sc, STE_SINGLE_COLLS); + stats = &sc->ste_stats; + /* Rx stats. */ + val = (uint32_t)CSR_READ_2(sc, STE_STAT_RX_OCTETS_LO) | + ((uint32_t)CSR_READ_2(sc, STE_STAT_RX_OCTETS_HI)) << 16; + val &= 0x000FFFFF; + stats->rx_bytes += val; + stats->rx_frames += CSR_READ_2(sc, STE_STAT_RX_FRAMES); + stats->rx_bcast_frames += CSR_READ_1(sc, STE_STAT_RX_BCAST); + stats->rx_mcast_frames += CSR_READ_1(sc, STE_STAT_RX_MCAST); + stats->rx_lost_frames += CSR_READ_1(sc, STE_STAT_RX_LOST); + /* Tx stats. */ + val = (uint32_t)CSR_READ_2(sc, STE_STAT_TX_OCTETS_LO) | + ((uint32_t)CSR_READ_2(sc, STE_STAT_TX_OCTETS_HI)) << 16; + val &= 0x000FFFFF; + stats->tx_bytes += val; + stats->tx_frames += CSR_READ_2(sc, STE_STAT_TX_FRAMES); + stats->tx_bcast_frames += CSR_READ_1(sc, STE_STAT_TX_BCAST); + stats->tx_mcast_frames += CSR_READ_1(sc, STE_STAT_TX_MCAST); + stats->tx_carrsense_errs += CSR_READ_1(sc, STE_STAT_CARRIER_ERR); + val = CSR_READ_1(sc, STE_STAT_SINGLE_COLLS); + stats->tx_single_colls += val; + ifp->if_collisions += val; + val = CSR_READ_1(sc, STE_STAT_MULTI_COLLS); + stats->tx_multi_colls += val; + ifp->if_collisions += val; + val += CSR_READ_1(sc, STE_STAT_LATE_COLLS); + stats->tx_late_colls += val; + ifp->if_collisions += val; + stats->tx_frames_defered += CSR_READ_1(sc, STE_STAT_TX_DEFER); + stats->tx_excess_defers += CSR_READ_1(sc, STE_STAT_TX_EXDEFER); + stats->tx_abort += CSR_READ_1(sc, STE_STAT_TX_ABORT); } /* @@ -1021,6 +1093,7 @@ ste_attach(device_t dev) error = ENXIO;; goto fail; } + ste_sysctl_node(sc); if ((error = ste_dma_alloc(sc)) != 0) goto fail; @@ -1537,10 +1610,15 @@ static void ste_init_locked(struct ste_softc *sc) { struct ifnet *ifp; + struct mii_data *mii; int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; + mii = device_get_softc(sc->ste_miibus); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; ste_stop(sc); /* Reset the chip to a known state. */ @@ -1576,24 +1654,11 @@ ste_init_locked(struct ste_softc *sc) /* Set the TX reclaim threshold. */ CSR_WRITE_1(sc, STE_TX_RECLAIM_THRESH, (STE_PACKET_SIZE >> 4)); - /* Set up the RX filter. */ - CSR_WRITE_1(sc, STE_RX_MODE, STE_RXMODE_UNICAST); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } else { - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } - - /* Set capture broadcast bit to accept broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_BROADCAST); - } else { - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_BROADCAST); - } + /* Accept VLAN length packets */ + CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); - ste_setmulti(sc); + /* Set up the RX filter. */ + ste_rxfilter(sc); /* Load the address of the RX list. */ STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); @@ -1622,6 +1687,8 @@ ste_init_locked(struct ste_softc *sc) /* Enable stats counters. */ STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_STATS_ENABLE); + /* Clear stats counters. */ + ste_stats_clear(sc); CSR_WRITE_2(sc, STE_ISR, 0xFFFF); #ifdef DEVICE_POLLING @@ -1633,10 +1700,9 @@ ste_init_locked(struct ste_softc *sc) /* Enable interrupts. */ CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - /* Accept VLAN length packets */ - CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); - - ste_ifmedia_upd_locked(ifp); + sc->ste_flags &= ~STE_FLAG_LINK; + /* Switch to the current media. */ + mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1717,20 +1783,27 @@ ste_stop(struct ste_softc *sc) static void ste_reset(struct ste_softc *sc) { + uint32_t ctl; int i; - STE_SETBIT4(sc, STE_ASICCTL, - STE_ASICCTL_GLOBAL_RESET|STE_ASICCTL_RX_RESET| - STE_ASICCTL_TX_RESET|STE_ASICCTL_DMA_RESET| - STE_ASICCTL_FIFO_RESET|STE_ASICCTL_NETWORK_RESET| - STE_ASICCTL_AUTOINIT_RESET|STE_ASICCTL_HOST_RESET| - STE_ASICCTL_EXTRESET_RESET); - - DELAY(100000); + ctl = CSR_READ_4(sc, STE_ASICCTL); + ctl |= STE_ASICCTL_GLOBAL_RESET | STE_ASICCTL_RX_RESET | + STE_ASICCTL_TX_RESET | STE_ASICCTL_DMA_RESET | + STE_ASICCTL_FIFO_RESET | STE_ASICCTL_NETWORK_RESET | + STE_ASICCTL_AUTOINIT_RESET |STE_ASICCTL_HOST_RESET | + STE_ASICCTL_EXTRESET_RESET; + CSR_WRITE_4(sc, STE_ASICCTL, ctl); + CSR_READ_4(sc, STE_ASICCTL); + /* + * Due to the need of accessing EEPROM controller can take + * up to 1ms to complete the global reset. + */ + DELAY(1000); for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_ASICCTL) & STE_ASICCTL_RESET_BUSY)) break; + DELAY(10); } if (i == STE_TIMEOUT) @@ -1771,39 +1844,24 @@ ste_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFFLAGS: STE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->ste_if_flags & IFF_PROMISC)) { - STE_SETBIT1(sc, STE_RX_MODE, - STE_RXMODE_PROMISC); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->ste_if_flags & IFF_PROMISC) { - STE_CLRBIT1(sc, STE_RX_MODE, - STE_RXMODE_PROMISC); - } - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) - ste_setmulti(sc); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - sc->ste_tx_thresh = STE_TXSTART_THRESH; + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->ste_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + ste_rxfilter(sc); + else ste_init_locked(sc); - } - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - ste_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ste_stop(sc); sc->ste_if_flags = ifp->if_flags; STE_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: STE_LOCK(sc); - ste_setmulti(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ste_rxfilter(sc); STE_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: @@ -1896,7 +1954,11 @@ ste_encap(struct ste_softc *sc, struct m * Tx descriptors here. Otherwise we race with controller. */ desc->ste_next = 0; - desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR); + if ((sc->ste_cdata.ste_tx_prod % STE_TX_INTR_FRAMES) == 0) + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | + STE_TXCTL_DMAINTR); + else + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS); txc->ste_mbuf = *m_head; STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT); sc->ste_cdata.ste_tx_cnt++; @@ -1999,6 +2061,7 @@ ste_watchdog(struct ste_softc *sc) ste_txeof(sc); ste_txeoc(sc); ste_rxeof(sc, -1); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2018,3 +2081,70 @@ ste_shutdown(device_t dev) return (0); } + +#define STE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) +#define STE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) + +static void +ste_sysctl_node(struct ste_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct ste_hw_stats *stats; + + stats = &sc->ste_stats; + ctx = device_get_sysctl_ctx(sc->ste_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ste_dev)); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "STE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->rx_bytes, "Good octets"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_frames, "Good frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->rx_bcast_frames, "Good broadcast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->rx_mcast_frames, "Good multicast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "lost_frames", + &stats->rx_lost_frames, "Lost frames"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->tx_bytes, "Good octets"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_frames, "Good frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->tx_bcast_frames, "Good broadcast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->tx_mcast_frames, "Good multicast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "carrier_errs", + &stats->tx_carrsense_errs, "Carrier sense errors"); + STE_SYSCTL_STAT_ADD32(ctx, child, "single_colls", + &stats->tx_single_colls, "Single collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "multi_colls", + &stats->tx_multi_colls, "Multiple collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_late_colls, "Late collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "defers", + &stats->tx_frames_defered, "Frames with deferrals"); + STE_SYSCTL_STAT_ADD32(ctx, child, "excess_defers", + &stats->tx_excess_defers, "Frames with excessive derferrals"); + STE_SYSCTL_STAT_ADD32(ctx, child, "abort", + &stats->tx_abort, "Aborted frames due to Excessive collisions"); +} + +#undef STE_SYSCTL_STAT_ADD32 +#undef STE_SYSCTL_STAT_ADD64 Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:15:51 2010 (r202314) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:18:55 2010 (r202315) @@ -63,6 +63,7 @@ #define STE_RX_DMABURST_THRESH 0x14 #define STE_RX_DMAURG_THRESH 0x15 #define STE_RX_DMAPOLL_PERIOD 0x16 +#define STE_COUNTDOWN 0x18 #define STE_DEBUGCTL 0x1A #define STE_ASICCTL 0x30 #define STE_EEPROM_DATA 0x34 @@ -75,7 +76,6 @@ #define STE_WAKE_EVENT 0x45 #define STE_TX_STATUS 0x46 #define STE_TX_FRAMEID 0x47 -#define STE_COUNTDOWN 0x48 #define STE_ISR_ACK 0x4A #define STE_IMR 0x4C #define STE_ISR 0x4E @@ -92,11 +92,25 @@ #define STE_MAR1 0x62 #define STE_MAR2 0x64 #define STE_MAR3 0x66 -#define STE_STATS 0x68 -#define STE_LATE_COLLS 0x75 -#define STE_MULTI_COLLS 0x76 -#define STE_SINGLE_COLLS 0x77 +#define STE_STAT_RX_OCTETS_LO 0x68 +#define STE_STAT_RX_OCTETS_HI 0x6A +#define STE_STAT_TX_OCTETS_LO 0x6C +#define STE_STAT_TX_OCTETS_HI 0x6E +#define STE_STAT_TX_FRAMES 0x70 +#define STE_STAT_RX_FRAMES 0x72 +#define STE_STAT_CARRIER_ERR 0x74 +#define STE_STAT_LATE_COLLS 0x75 +#define STE_STAT_MULTI_COLLS 0x76 +#define STE_STAT_SINGLE_COLLS 0x77 +#define STE_STAT_TX_DEFER 0x78 +#define STE_STAT_RX_LOST 0x79 +#define STE_STAT_TX_EXDEFER 0x7A +#define STE_STAT_TX_ABORT 0x7B +#define STE_STAT_TX_BCAST 0x7C +#define STE_STAT_RX_BCAST 0x7D +#define STE_STAT_TX_MCAST 0x7E +#define STE_STAT_RX_MCAST 0x7F #define STE_DMACTL_RXDMA_STOPPED 0x00000001 #define STE_DMACTL_TXDMA_CMPREQ 0x00000002 @@ -199,18 +213,6 @@ #define STE_ASICCTL_SOFTINTR 0x02000000 #define STE_ASICCTL_RESET_BUSY 0x04000000 -#define STE_ASICCTL1_GLOBAL_RESET 0x0001 -#define STE_ASICCTL1_RX_RESET 0x0002 -#define STE_ASICCTL1_TX_RESET 0x0004 -#define STE_ASICCTL1_DMA_RESET 0x0008 -#define STE_ASICCTL1_FIFO_RESET 0x0010 -#define STE_ASICCTL1_NETWORK_RESET 0x0020 -#define STE_ASICCTL1_HOST_RESET 0x0040 -#define STE_ASICCTL1_AUTOINIT_RESET 0x0080 -#define STE_ASICCTL1_EXTRESET_RESET 0x0100 -#define STE_ASICCTL1_SOFTINTR 0x0200 -#define STE_ASICCTL1_RESET_BUSY 0x0400 - #define STE_EECTL_ADDR 0x00FF #define STE_EECTL_OPCODE 0x0300 #define STE_EECTL_BUSY 0x1000 @@ -388,24 +390,23 @@ #define STE_PME_EN 0x0010 #define STE_PME_STATUS 0x8000 - -struct ste_stats { - uint32_t ste_rx_bytes; - uint32_t ste_tx_bytes; - uint16_t ste_tx_frames; - uint16_t ste_rx_frames; - uint8_t ste_carrsense_errs; - uint8_t ste_late_colls; - uint8_t ste_multi_colls; - uint8_t ste_single_colls; - uint8_t ste_tx_frames_defered; - uint8_t ste_rx_lost_frames; - uint8_t ste_tx_excess_defers; - uint8_t ste_tx_abort_excess_colls; - uint8_t ste_tx_bcast_frames; - uint8_t ste_rx_bcast_frames; - uint8_t ste_tx_mcast_frames; - uint8_t ste_rx_mcast_frames; +struct ste_hw_stats { + uint64_t rx_bytes; + uint32_t rx_frames; + uint32_t rx_bcast_frames; + uint32_t rx_mcast_frames; + uint32_t rx_lost_frames; + uint64_t tx_bytes; + uint32_t tx_frames; + uint32_t tx_bcast_frames; + uint32_t tx_mcast_frames; + uint32_t tx_carrsense_errs; + uint32_t tx_single_colls; + uint32_t tx_multi_colls; + uint32_t tx_late_colls; + uint32_t tx_frames_defered; + uint32_t tx_excess_defers; + uint32_t tx_abort; }; struct ste_frag { @@ -493,6 +494,12 @@ struct ste_desc_onefrag { #define STE_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF) #define STE_ADDR_HI(x) ((uint64_t)(x) >> 32) +/* + * Since Tx status can hold up to 31 status bytes we should + * check Tx status before controller fills it up. Otherwise + * Tx MAC stalls. + */ +#define STE_TX_INTR_FRAMES 16 #define STE_TX_TIMEOUT 5 #define STE_TIMEOUT 1000 #define STE_MIN_FRAMELEN 60 @@ -566,6 +573,7 @@ struct ste_softc { struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; struct callout ste_callout; + struct ste_hw_stats ste_stats; struct mtx ste_mtx; }; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 22:29:29 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6A01065679; Thu, 14 Jan 2010 22:29:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 695D18FC0C; Thu, 14 Jan 2010 22:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EMTTRZ065667; Thu, 14 Jan 2010 22:29:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMTTPD065664; Thu, 14 Jan 2010 22:29:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142229.o0EMTTPD065664@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202319 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:29:29 -0000 Author: yongari Date: Thu Jan 14 22:29:29 2010 New Revision: 202319 URL: http://svn.freebsd.org/changeset/base/202319 Log: MFC r200950,200955,200965-200966,201767-201768 r200950: Implement RX interrupt moderation using one-shot timer interrupt. Unlike TX interrupt, ST201 does not provide any mechanism to suppress RX interrupts. ste(4) can generate more than 70k RX interrupts under heavy RX traffics such that these excessive interrupts make system useless to process other useful things. Maybe this was the major reason why polling support code was introduced to ste(4). The STE_COUNTDOWN register provides a programmable counter that will generate an interrupt upon its expiration. We program STE_DMACTL register to use 3.2us clock rate to drive the counter register. Whenever ste(4) serves RX interrupt, the driver rearm the timer to expire after STE_IM_RX_TIMER_DEFAULT time and disables further generation of RX interrupts. This trick seems to work well and ste(4) generates less than 8k RX interrupts even under 64 bytes UDP torture test. Combined with TX interrupts, the total number of interrupts are less than 10k which looks reasonable on heavily loaded controller. The default RX interrupt moderation time is 150us. Users can change the value at any time with dev.ste.%d.int_rx_mod sysctl node. Setting it 0 effectively disables the RX interrupt moderation feature. Now we have both TX/RX interrupt moderation code so remove loop of interrupt handler which resulted in sub-optimal performance as well as more register accesses. r200955: Add suspend/resume support as well as basic WOL. While I'm here simplify SIOCSIFCAP handler. r200965: Update if_iqdrops in case of RX buffer allocation failure. r200966: ether_ifattach sets if_mtu, remove unnecessary code. r201767: Fix EEPROM access code to return data in host byte order. EEPROM on ST201 always returns 16bits data with little endian format so conversion to host order is required. This change fixes inversed ethernet address on sparc64. r201768: Make sure to store dma address of RX buffer in little endian form. This fixes the last bug which keeps ste(4) from working on sparc64. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:26:52 2010 (r202318) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:29:29 2010 (r202319) @@ -94,7 +94,9 @@ static struct ste_type ste_devs[] = { static int ste_attach(device_t); static int ste_detach(device_t); static int ste_probe(device_t); +static int ste_resume(device_t); static int ste_shutdown(device_t); +static int ste_suspend(device_t); static int ste_dma_alloc(struct ste_softc *); static void ste_dma_free(struct ste_softc *); @@ -118,11 +120,12 @@ static int ste_miibus_readreg(device_t, static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static int ste_read_eeprom(struct ste_softc *, uint16_t *, int, int); static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static void ste_rxeof(struct ste_softc *, int); static void ste_rxfilter(struct ste_softc *); +static void ste_setwol(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); static void ste_stats_clear(struct ste_softc *); @@ -141,6 +144,8 @@ static device_method_t ste_methods[] = { DEVMETHOD(device_attach, ste_attach), DEVMETHOD(device_detach, ste_detach), DEVMETHOD(device_shutdown, ste_shutdown), + DEVMETHOD(device_suspend, ste_suspend), + DEVMETHOD(device_resume, ste_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -533,9 +538,8 @@ ste_eeprom_wait(struct ste_softc *sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) +ste_read_eeprom(struct ste_softc *sc, uint16_t *dest, int off, int cnt) { - uint16_t word, *ptr; int err = 0, i; if (ste_eeprom_wait(sc)) @@ -546,12 +550,8 @@ ste_read_eeprom(struct ste_softc *sc, ca err = ste_eeprom_wait(sc); if (err) break; - word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (uint16_t *)(dest + (i * 2)); - if (swap) - *ptr = ntohs(word); - else - *ptr = word; + *dest = le16toh(CSR_READ_2(sc, STE_EEPROM_DATA)); + dest++; } return (err ? 1 : 0); @@ -655,7 +655,7 @@ ste_intr(void *xsc) { struct ste_softc *sc; struct ifnet *ifp; - uint16_t status; + uint16_t intrs, status; sc = xsc; STE_LOCK(sc); @@ -667,43 +667,67 @@ ste_intr(void *xsc) return; } #endif - - /* See if this is really our interrupt. */ - if (!(CSR_READ_2(sc, STE_ISR) & STE_ISR_INTLATCH)) { + /* Reading STE_ISR_ACK clears STE_IMR register. */ + status = CSR_READ_2(sc, STE_ISR_ACK); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { STE_UNLOCK(sc); return; } - for (;;) { - status = CSR_READ_2(sc, STE_ISR_ACK); + intrs = STE_INTRS; + if (status == 0xFFFF || (status & intrs) == 0) + goto done; - if (!(status & STE_INTRS)) - break; - - if (status & STE_ISR_RX_DMADONE) - ste_rxeof(sc, -1); + if (sc->ste_int_rx_act > 0) { + status &= ~STE_ISR_RX_DMADONE; + intrs &= ~STE_IMR_RX_DMADONE; + } - if (status & STE_ISR_TX_DMADONE) + if ((status & (STE_ISR_SOFTINTR | STE_ISR_RX_DMADONE)) != 0) { + ste_rxeof(sc, -1); + /* + * The controller has no ability to Rx interrupt + * moderation feature. Receiving 64 bytes frames + * from wire generates too many interrupts which in + * turn make system useless to process other useful + * things. Fortunately ST201 supports single shot + * timer so use the timer to implement Rx interrupt + * moderation in driver. This adds more register + * access but it greatly reduces number of Rx + * interrupts under high network load. + */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + (sc->ste_int_rx_mod != 0)) { + if ((status & STE_ISR_RX_DMADONE) != 0) { + CSR_WRITE_2(sc, STE_COUNTDOWN, + STE_TIMER_USECS(sc->ste_int_rx_mod)); + intrs &= ~STE_IMR_RX_DMADONE; + sc->ste_int_rx_act = 1; + } else { + intrs |= STE_IMR_RX_DMADONE; + sc->ste_int_rx_act = 0; + } + } + } + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if ((status & STE_ISR_TX_DMADONE) != 0) ste_txeof(sc); - - if (status & STE_ISR_TX_DONE) + if ((status & STE_ISR_TX_DONE) != 0) ste_txeoc(sc); - - if (status & STE_ISR_STATS_OFLOW) + if ((status & STE_ISR_STATS_OFLOW) != 0) ste_stats_update(sc); - - if (status & STE_ISR_HOSTERR) { - ste_init_locked(sc); + if ((status & STE_ISR_HOSTERR) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ste_init_locked(sc); + STE_UNLOCK(sc); + return; } + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + ste_start_locked(ifp); +done: + /* Re-enable interrupts */ + CSR_WRITE_2(sc, STE_IMR, intrs); } - - /* Re-enable interrupts */ - CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - ste_start_locked(ifp); - STE_UNLOCK(sc); } @@ -765,7 +789,7 @@ ste_rxeof(struct ste_softc *sc, int coun * can do in this situation. */ if (ste_newbuf(sc, cur_rx) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; cur_rx->ste_ptr->ste_status = 0; continue; } @@ -1028,8 +1052,8 @@ ste_attach(device_t dev) { struct ste_softc *sc; struct ifnet *ifp; - u_char eaddr[6]; - int error = 0, rid; + uint16_t eaddr[ETHER_ADDR_LEN / 2]; + int error = 0, pmc, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1087,8 +1111,7 @@ ste_attach(device_t dev) /* * Get station address from the EEPROM. */ - if (ste_read_eeprom(sc, eaddr, - STE_EEADDR_NODE0, 3, 0)) { + if (ste_read_eeprom(sc, eaddr, STE_EEADDR_NODE0, ETHER_ADDR_LEN / 2)) { device_printf(dev, "failed to read station address\n"); error = ENXIO;; goto fail; @@ -1115,7 +1138,6 @@ ste_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ste_ioctl; ifp->if_start = ste_start; @@ -1129,13 +1151,15 @@ ste_attach(device_t dev) /* * Call MI attach routine. */ - ether_ifattach(ifp, eaddr); + ether_ifattach(ifp, (uint8_t *)eaddr); /* * Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_MTU; + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1532,6 +1556,7 @@ ste_init_rx_list(struct ste_softc *sc) struct ste_list_data *ld; int error, i; + sc->ste_int_rx_act = 0; cd = &sc->ste_cdata; ld = &sc->ste_ldata; bzero(ld->ste_rx_list, STE_RX_LIST_SZ); @@ -1542,12 +1567,14 @@ ste_init_rx_list(struct ste_softc *sc) return (error); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * 0); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0)); } else { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * (i + 1)); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1))); } } @@ -1611,6 +1638,7 @@ ste_init_locked(struct ste_softc *sc) { struct ifnet *ifp; struct mii_data *mii; + uint8_t val; int i; STE_LOCK_ASSERT(sc); @@ -1645,6 +1673,12 @@ ste_init_locked(struct ste_softc *sc) /* Init TX descriptors */ ste_init_tx_list(sc); + /* Clear and disable WOL. */ + val = CSR_READ_1(sc, STE_WAKE_EVENT); + val &= ~(STE_WAKEEVENT_WAKEPKT_ENB | STE_WAKEEVENT_MAGICPKT_ENB | + STE_WAKEEVENT_LINKEVT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB); + CSR_WRITE_1(sc, STE_WAKE_EVENT, val); + /* Set the TX freethresh value */ CSR_WRITE_1(sc, STE_TX_DMABURST_THRESH, STE_PACKET_SIZE >> 8); @@ -1678,6 +1712,9 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); + /* Select 3.2us timer. */ + STE_CLRBIT4(sc, STE_DMACTL, STE_DMACTL_COUNTDOWN_SPEED | + STE_DMACTL_COUNTDOWN_MODE); /* Enable receiver and transmitter */ CSR_WRITE_2(sc, STE_MACCTL0, 0); @@ -1690,6 +1727,7 @@ ste_init_locked(struct ste_softc *sc) /* Clear stats counters. */ ste_stats_clear(sc); + CSR_WRITE_2(sc, STE_COUNTDOWN, 0); CSR_WRITE_2(sc, STE_ISR, 0xFFFF); #ifdef DEVICE_POLLING /* Disable interrupts if we are polling. */ @@ -1727,6 +1765,7 @@ ste_stop(struct ste_softc *sc) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); CSR_WRITE_2(sc, STE_IMR, 0); + CSR_WRITE_2(sc, STE_COUNTDOWN, 0); /* Stop pending DMA. */ val = CSR_READ_4(sc, STE_DMACTL); val |= STE_DMACTL_TXDMA_STALL | STE_DMACTL_RXDMA_STALL; @@ -1836,7 +1875,7 @@ ste_ioctl(struct ifnet *ifp, u_long comm struct ste_softc *sc; struct ifreq *ifr; struct mii_data *mii; - int error = 0; + int error = 0, mask; sc = ifp->if_softc; ifr = (struct ifreq *)data; @@ -1869,31 +1908,31 @@ ste_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + STE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(ifp->if_capenable & IFCAP_POLLING)) { - error = ether_poll_register(ste_poll, ifp); - if (error) - return (error); - STE_LOCK(sc); - /* Disable interrupts */ - CSR_WRITE_2(sc, STE_IMR, 0); - ifp->if_capenable |= IFCAP_POLLING; - STE_UNLOCK(sc); - return (error); - - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - ifp->if_capenable & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - STE_LOCK(sc); - CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - ifp->if_capenable &= ~IFCAP_POLLING; - STE_UNLOCK(sc); - return (error); + if ((mask & IFCAP_POLLING) != 0 && + (IFCAP_POLLING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((IFCAP_POLLING & ifp->if_capenable) != 0) { + error = ether_poll_register(ste_poll, ifp); + if (error != 0) { + STE_UNLOCK(sc); + break; + } + /* Disable interrupts. */ + CSR_WRITE_2(sc, STE_IMR, 0); + } else { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + CSR_WRITE_2(sc, STE_IMR, STE_INTRS); + } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + STE_UNLOCK(sc); break; default: error = ether_ioctl(ifp, command, data); @@ -2071,12 +2110,50 @@ ste_watchdog(struct ste_softc *sc) static int ste_shutdown(device_t dev) { + + return (ste_suspend(dev)); +} + +static int +ste_suspend(device_t dev) +{ struct ste_softc *sc; sc = device_get_softc(dev); STE_LOCK(sc); ste_stop(sc); + ste_setwol(sc); + STE_UNLOCK(sc); + + return (0); +} + +static int +ste_resume(device_t dev) +{ + struct ste_softc *sc; + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + + sc = device_get_softc(dev); + STE_LOCK(sc); + if (pci_find_extcap(sc->ste_dev, PCIY_PMG, &pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->ste_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->ste_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + } + ifp = sc->ste_ifp; + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ste_init_locked(sc); + } STE_UNLOCK(sc); return (0); @@ -2099,6 +2176,13 @@ ste_sysctl_node(struct ste_softc *sc) ctx = device_get_sysctl_ctx(sc->ste_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ste_dev)); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_rx_mod", + CTLFLAG_RW, &sc->ste_int_rx_mod, 0, "ste RX interrupt moderation"); + /* Pull in device tunables. */ + sc->ste_int_rx_mod = STE_IM_RX_TIMER_DEFAULT; + resource_int_value(device_get_name(sc->ste_dev), + device_get_unit(sc->ste_dev), "int_rx_mod", &sc->ste_int_rx_mod); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "STE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2148,3 +2232,35 @@ ste_sysctl_node(struct ste_softc *sc) #undef STE_SYSCTL_STAT_ADD32 #undef STE_SYSCTL_STAT_ADD64 + +static void +ste_setwol(struct ste_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + int pmc; + + STE_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->ste_dev, PCIY_PMG, &pmc) != 0) { + /* Disable WOL. */ + CSR_READ_1(sc, STE_WAKE_EVENT); + CSR_WRITE_1(sc, STE_WAKE_EVENT, 0); + return; + } + + ifp = sc->ste_ifp; + val = CSR_READ_1(sc, STE_WAKE_EVENT); + val &= ~(STE_WAKEEVENT_WAKEPKT_ENB | STE_WAKEEVENT_MAGICPKT_ENB | + STE_WAKEEVENT_LINKEVT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= STE_WAKEEVENT_MAGICPKT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB; + CSR_WRITE_1(sc, STE_WAKE_EVENT, val); + /* Request PME. */ + pmstat = pci_read_config(sc->ste_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->ste_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:26:52 2010 (r202318) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:29:29 2010 (r202319) @@ -285,7 +285,8 @@ #define STE_INTRS \ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \ - STE_IMR_TX_DONE|STE_IMR_HOSTERR) + STE_IMR_TX_DONE|STE_IMR_SOFTINTR| \ + STE_IMR_HOSTERR) #define STE_ISR_INTLATCH 0x0001 #define STE_ISR_HOSTERR 0x0002 @@ -349,6 +350,13 @@ #define STE_PHYCTL_SPEEDSTAT 0x40 #define STE_PHYCTL_LINKSTAT 0x80 +#define STE_TIMER_TICKS 32 +#define STE_TIMER_USECS(x) ((x * 10) / STE_TIMER_TICKS) + +#define STE_IM_RX_TIMER_MIN 0 +#define STE_IM_RX_TIMER_MAX 209712 +#define STE_IM_RX_TIMER_DEFAULT 150 + /* * EEPROM offsets. */ @@ -570,6 +578,8 @@ struct ste_softc { #define STE_FLAG_LINK 0x8000 int ste_if_flags; int ste_timer; + int ste_int_rx_act; + int ste_int_rx_mod; struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; struct callout ste_callout; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 22:34:26 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83852106568F; Thu, 14 Jan 2010 22:34:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9A48FC1F; Thu, 14 Jan 2010 22:34:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EMYO7E066857; Thu, 14 Jan 2010 22:34:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMYOBr066855; Thu, 14 Jan 2010 22:34:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142234.o0EMYOBr066855@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202321 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:34:26 -0000 Author: yongari Date: Thu Jan 14 22:34:24 2010 New Revision: 202321 URL: http://svn.freebsd.org/changeset/base/202321 Log: MFC r200958: Document newly added loader tunable/sysctl variable dev.ste.%d.int_rx_mod. While I'm here add .Xr vlan as ste(4) supports long frames. Modified: stable/7/share/man/man4/ste.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/ste.4 ============================================================================== --- stable/7/share/man/man4/ste.4 Thu Jan 14 22:33:46 2010 (r202320) +++ stable/7/share/man/man4/ste.4 Thu Jan 14 22:34:24 2010 (r202321) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd December 24, 2009 .Dt STE 4 .Os .Sh NAME @@ -126,6 +126,23 @@ D-Link DFE-550TX .It D-Link DFE-580TX .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.ste.%d.int_rx_mod +Maximum number of time to delay RX interrupts. +The valid range is 0 to 209712 in units of 1us, the default is +150 (150us). +The value 0 effectively disables the RX interrupt moderation. +The resolution of of timer is about 3.2us so finer tuning than +3.2us wouldn't be available. +The interface does not need to be brought down and up again before +a change takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "ste%d: couldn't map ports/memory" @@ -171,6 +188,7 @@ the card should be configured correctly. .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 14 22:37:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AE5B106566B; Thu, 14 Jan 2010 22:37:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79F9B8FC1F; Thu, 14 Jan 2010 22:37:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0EMb7mj067553; Thu, 14 Jan 2010 22:37:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMb7tp067551; Thu, 14 Jan 2010 22:37:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142237.o0EMb7tp067551@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202323 - stable/7/sys/sparc64/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:37:07 -0000 Author: yongari Date: Thu Jan 14 22:37:06 2010 New Revision: 202323 URL: http://svn.freebsd.org/changeset/base/202323 Log: MFC r201769: Enable ste(4). ste(4) should work on all architectures. Modified: stable/7/sys/sparc64/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Thu Jan 14 22:36:06 2010 (r202322) +++ stable/7/sys/sparc64/conf/GENERIC Thu Jan 14 22:37:06 2010 (r202323) @@ -176,7 +176,7 @@ device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') #device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -#device ste # Sundance ST201 (D-Link DFE-550TX) +device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet device ti # Alteon Networks Tigon I/II gigabit Ethernet #device tl # Texas Instruments ThunderLAN From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 02:21:55 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F081065670; Fri, 15 Jan 2010 02:21:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF04B8FC17; Fri, 15 Jan 2010 02:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F2LtkE017214; Fri, 15 Jan 2010 02:21:55 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F2Lsto017211; Fri, 15 Jan 2010 02:21:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150221.o0F2Lsto017211@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 02:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202328 - stable/7/games/fortune/datfiles X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:21:55 -0000 Author: dougb Date: Fri Jan 15 02:21:54 2010 New Revision: 202328 URL: http://svn.freebsd.org/changeset/base/202328 Log: MFC r201601: Remove more duplicates Minor reformatting on a few Modified: stable/7/games/fortune/datfiles/fortunes Directory Properties: stable/7/games/fortune/ (props changed) stable/7/games/fortune/datfiles/ (props changed) stable/7/games/fortune/datfiles/freebsd-tips (props changed) stable/7/games/fortune/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes ============================================================================== --- stable/7/games/fortune/datfiles/fortunes Fri Jan 15 02:18:07 2010 (r202327) +++ stable/7/games/fortune/datfiles/fortunes Fri Jan 15 02:21:54 2010 (r202328) @@ -1696,14 +1696,6 @@ the Cat. "Then it doesn't matter which way you go," said the Cat. -- Lewis Carroll % - COMMENT - -Oh, life is a glorious cycle of song, -A medley of extemporanea; -And love is thing that can never go wrong; -And I am Marie of Roumania. - -- Dorothy Parker -% Concerning the war in Vietnam, Senator George Aiken of Vermont noted in January, 1966, "I'm not very keen for doves or hawks. I think we need more owls." @@ -1923,22 +1915,6 @@ Christmas tree. The piano is missing. you rent your home and own Firearms, in which case you can go to level 4. The best way to get to level 3 is egg-nog. % - FIGHTING WORDS - -Say my love is easy had, - Say I'm bitten raw with pride, -Say I am too often sad -- - Still behold me at your side. - -Say I'm neither brave nor young, - Say I woo and coddle care, -Say the devil touched my tongue -- - Still you have my heart to wear. - -But say my verses do not scan, - And I get me another man! - -- Dorothy Parker -% "For I perceive that behind this seemingly unrelated sequence of events, there lurks a singular, sinister attitude of mind." @@ -2210,20 +2186,6 @@ full of money before." "Didn't you see it?" "Damn kid had it under his coat." % - Hug O' War - -I will not play at tug o' war. -I'd rather play at hug o' war, -Where everyone hugs -Instead of tugs, -Where everyone giggles -And rolls on the rug, -Where everyone kisses, -And everyone grins, -And everyone cuddles, -And everyone wins. - -- Shel Silverstein -% Human thinking can skip over a great deal, leap over small misunderstandings, can contain ifs and buts in untroubled corners of the mind. But the machine has no corners. Despite all the attempts to @@ -2677,33 +2639,6 @@ right any day." life-style otherwise." -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % - Insofar as I may be heard by anything, which may or may not care -what I say, I ask, if it matters, that you be forgiven for anything you -may have done or failed to do which requires forgiveness. Conversely, if -not forgiveness but something else may be required to insure any possible -benefit for which you may be eligible after the destruction of your body, -I ask this, whatever it may be, be granted or withheld, as the case may be, -in such a manner as to insure your receiving said benefit. I ask this in my -capacity as your elected intermediary between yourself and that which may -not be yourself, but which may have an interest in the matter of your -receiving as much as it is possible for you to receive of this thing, and -which may in some way be influenced by this ceremony. - Amen. - -- Roger Zelazny, "Creatures of Light and Darkness", 1969 -% - INVENTORY -Four be the things I am wiser to know: -Idleness, sorrow, a friend, and a foe. - -Four be the things I'd been better without: -Love, curiosity, freckles, and doubt. - -Three be the things I shall never attain: -Envy, content, and sufficient champagne. - -Three be the things I shall have till I die: -Laughter and hope and a sock in the eye. -% "Is there any point to which you would wish to draw my attention?" "To the curious incident of the dog in the night-time." "The dog did nothing in the night-time." @@ -3983,28 +3918,6 @@ almost succeeded in getting a VAX to thi organization say that each time the machine fails to think it ceases to exist. % - THE LESSER-KNOWN PROGRAMMING LANGUAGES #5: VALGOL -From its modest beginnings in Southern California's San Fernando Valley, -VALGOL is enjoying a dramatic surge of popularity across the industry. - -Here is a sample program: - LIKE, Y*KNOW(I MEAN)START - IF PIZZA = LIKE BITCHEN AND GUY = LIKE TUBULAR AND - VALLEY GIRL = LIKE GRODY**MAX(FERSURE)**2 THEN - FOR I = LIKE 1 TO OH*MAYBE 100 - DO*WAH - (DITTY**2) - BARF(I)=TOTALLY GROSS(OUT) - SURE - LIKE BAG THIS PROGRAM - REALLY - LIKE TOTALLY (Y*KNOW) - IM*SURE - GOTO THE MALL - -When the user makes a syntax error, the interpreter displays the message: - - GAG ME WITH A SPOON!! -% THE LESSER-KNOWN PROGRAMMING LANGUAGES #8: LAIDBACK This language was developed at the Marin County Center for T'ai Chi, @@ -5335,9 +5248,6 @@ that he didn't force you down on the ask -- A plethora of individuals wither expertise in culinary techniques vitiated the potable concoction produced by steeping certain coupestibles. -- Eleemosynary deeds have their initial incidence intramurally. --- Male cadavers are incapable of yielding testimony. --- Individuals who make their abode in vitreous edifices would be well - advised to refrain from catapulting projectiles. % =============== ALL FRESHMEN PLEASE NOTE =============== @@ -11076,9 +10986,6 @@ Armstrong's Collection Law: If the check is truly in the mail, it is surely made out to someone else. % -Arnold's Addendum: - Anything not fitting into these categories causes cancer in rats. -% Arnold's Laws of Documentation: 1.) If it should exist, it doesn't. 2.) If it does exist, it's out of date. @@ -12654,7 +12561,7 @@ Boren's Laws: (2) When in trouble, delegate. (3) When in doubt, mumble. % -boss, n: +Boss, n: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an @@ -12935,7 +12842,7 @@ wrote the program. Fortunately, the second-to-last bug has just been fixed. -- Ray Simard % -bug, n: +Bug, n: An elusive creature living in a program that makes it incorrect. The activity of "debugging", or removing bugs from a program, ends when people get tired of doing it, not when the bugs are removed. @@ -13524,14 +13431,14 @@ only robust persons doing this thing is others who have tried it. -- Ambrose Bierce, "The Devil's Dictionary" % - -Certain passages in several laws have always defied interpretation and the -most inexplicable must be a matter of opinion. A judge of the Court of -Session of Scotland has sent the editors of this book his candidate which -reads, "In the Nuts (unground), (other than ground nuts) Order, the expression -nuts shall have reference to such nuts, other than ground nuts, as would -but for this amending Order not qualify as nuts (unground) (other than ground -nuts) by reason of their being nuts (unground)." +Certain passages in several laws have always defied interpretation and +the most inexplicable must be a matter of opinion. A judge of the Court +of Session of Scotland has sent the editors of this book his candidate +which reads, "In the Nuts (unground), (other than ground nuts) Order, +the expression nuts shall have reference to such nuts, other than ground +nuts, as would but for this amending Order not qualify as nuts +(unground) (other than ground nuts) by reason of their being nuts +(unground)." -- Guinness Book of World Records, 1973 % Certainly the game is rigged. @@ -15057,17 +14964,6 @@ letter, or even 25 cents on a stamp! so post it as many places as you can. -- Emily Postnews Answers Your Questions on Netiquette % -Dear Sir, - I am firmly opposed to the spread of microchips either to the home or -to the office. We have more than enough of them foisted upon us in public -places. They are a disgusting Americanism, and can only result in the farmers -being forced to grow smaller potatoes, which in turn will cause massive un- -employment in the already severely depressed agricultural industry. - Yours faithfully, - Capt. Quinton D'Arcy, J.P. - Sevenoaks - -- Letters To The Editor, The Times of London -% Death before dishonor. But neither before breakfast. % @@ -17838,9 +17734,6 @@ Finagle's Eleventh Law: it happened according to his pet theory. % Finagle's First Law: - If an experiment works, something has gone wrong. -% -Finagle's First Law: To study a subject best, understand it thoroughly before you start. Finagle's Second Law: @@ -18173,9 +18066,6 @@ For children with short attention spans: For courage mounteth with occasion. -- William Shakespeare, "King John" % -For every action, there is an equal and opposite criticism. - -- Harrison -% For every bloke who makes his mark, there's half a dozen waiting to rub it out. -- Andy Capp @@ -19520,17 +19410,6 @@ Your butt is on the menu And the check is in the mail. -- The Piranha Club Anthem, to the tune of "De Camptown Races" % -From the "Guinness Book of World Records", 1973: - -Certain passages in several laws have always defied interpretation and -the most inexplicable must be a matter of opinion. A judge of the -Court of Session of Scotland has sent the editors of this book his -candidate which reads, "In the Nuts (unground), (other than ground -nuts) Order, the expression nuts shall have reference to such nuts, -other than ground nuts, as would but for this amending Order not -qualify as nuts (unground)(other than ground nuts) by reason of their -being nuts (unground)." -% From the moment I picked your book up until I put it down I was convulsed with laughter. Some day I intend reading it. -- Groucho Marx, from "The Book of Insults" @@ -24035,21 +23914,6 @@ I may not be totally perfect, but parts I met a wonderful new man. He's fictional, but you can't have everything. -- Cecelia, "The Purple Rose of Cairo" % -I met him in a swamp down in Dagobah -Where it bubbles all the time like a giant cabinet soda - S-O-D-A soda -I saw the little runt sitting there on a log -I asked him his name and in a raspy voice he said Yoda - Y-O-D-A Yoda, Yo-Yo-Yo-Yo Yoda - -Well I've been around but I ain't never seen -A guy who looks like a Muppet but he's wrinkled and green - Oh my Yoda, Yo-Yo-Yo-Yo Yoda -Well I'm not dumb but I can't understand -How he can raise me in the air just by raising his hand - Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda - -- The STAR WARS Song, to "Lola", by the Kinks -% I met my latest girl friend in a department store. She was looking at clothes, and I was putting Slinkys on the escalators. -- Steven Wright @@ -24524,10 +24388,6 @@ are worth considering, to wit: "When paying tolls, remember that it is necessary to release the quarter a full 3 seconds before passing the basket if you are traveling more than 60 MPH." - -[110.13]: - "When traveling on a one-way street, stay to the right, so as not - to interfere with oncoming traffic." % I suppose some of the variation between Boston drivers and the rest of the country is due to the progressive Massachusetts Driver Education Manual which @@ -24621,12 +24481,6 @@ I think that I shall never see A billboard lovely as a tree. Indeed, unless the billboards fall I'll never see a tree at all. - -- Nash -% -I think that I shall never see -A billboard lovely as a tree. -Perhaps, unless the billboards fall -I'll never see a tree at all. -- Ogden Nash % I think that I shall never see @@ -25892,21 +25746,6 @@ this is the case, then programmers stand software engineers dig each other's graves. -- Unknown % -If I have seen farther than others, it is because I was standing on the -shoulders of giants. - -- Isaac Newton - -In the sciences, we are now uniquely privileged to sit side by side -with the giants on whose shoulders we stand. - -- Gerald Holton - -If I have not seen as far as others, it is because giants were standing -on my shoulders. - -- Hal Abelson - -In computer science, we stand on each other's feet. - -- Brian K. Reid -% If I have to lay an egg for my country, I'll do it. -- Bob Hope % @@ -37634,7 +37473,7 @@ Pardo's First Postulate: fattening. Arnold's Addendum: - Everything else causes cancer in rats. + Anything not fitting into these categories causes cancer in rats. % Parents often talk about the younger generation as if they didn't have much of anything to do with it. @@ -39431,10 +39270,6 @@ A: A dope ring. Q: Why do blondes put their hair in ponytails? A: To cover up the valve stem. - -Q: Why did the blonde get so excited after she finished her jigsaw - puzzle in only 6 months? -A: Because on the box it said "From 2-4 years". % Q: What do you call a blind pre-historic animal? A: Diyathinkhesaurus. @@ -41467,25 +41302,6 @@ Spock: Affirmative. Kirk: Mr. Sulu, go to pass two. Sulu: Aye aye, sir, going to pass two. % -Scratch the disks, dump the core, Shut it down, pull the plug -Roll the tapes across the floor, Give the core an extra tug -And the system is going to crash. And the system is going to crash. -Teletypes smashed to bits. Mem'ry cards, one and all, -Give the scopes some nasty hits Toss out halfway down the hall -And the system is going to crash. And the system is going to crash. -And we've also found Just flip one switch -When you turn the power down, And the lights will cease to twitch -You turn the disk readers into trash. And the tape drives will crumble -Oh, it's so much fun, in a flash. -Now the CPU won't run When the CPU -And the system is going to crash. Can print nothing out but "foo," - The system is going to crash. - -- To The Caissons Go Rolling Along -% -Scratch the disks! -Drop the core! -Roll the tapes across the floor! -% Screw up your courage! You've screwed up everything else. % Scribline, n.: @@ -46662,7 +46478,8 @@ often turn to a related (but infinitely % THE LESSER-KNOWN PROGRAMMING LANGUAGES #14 -- VALGOL - VALGOL is enjoying a dramatic surge of popularity across the + From its modest beginnings in Southern California's San Fernando +Valley VALGOL is enjoying a dramatic surge of popularity across the industry. VALGOL commands include REALLY, LIKE, WELL, and Y*KNOW. Variables are assigned with the =LIKE and =TOTALLY operators. Other operators include the "California booleans", AX and NOWAY. Loops are @@ -48369,9 +48186,6 @@ and peculiar sort of voluntary thinking. The solution of this problem is trivial and is left as an exercise for the reader. % -The solution to a problem changes the nature of the problem. - -- Peer -% The somewhat old and crusty vicar was taking a well-earned retirement from his rather old and crusty parish. As is usual in these cases, a locum was sent to cover the transition period. This particular man was young and @@ -52040,7 +51854,7 @@ yourself and that which may have an inte as much as it is possible for you to receive of this thing, and which may in some way be influenced by this ceremony. Amen. - -- Roger Zelazny, "Creatures of Light and Darkness" + -- Roger Zelazny, "Creatures of Light and Darkness", 1969 % To understand a program you must become both the machine and the program. % @@ -56789,22 +56603,6 @@ I'd LOVE to, but... -- I'm teaching my ferret to yodel. -- My crayons all melted together. % -Why I Can't Go Out With You: - -I'd LOVE to, but ... - -- I have to floss my cat. - -- I've dedicated my life to linguini. - -- I need to spend more time with my blender. - -- it wouldn't be fair to the other Beautiful People. - -- it's my night to pet the dog/ferret/goldfish. - -- I'm going downtown to try on some gloves. - -- I have to check the freshness dates on my dairy products. - -- I'm going down to the bakery to watch the buns rise. - -- I have an appointment with a cuticle specialist. - -- I have some really hard words to look up. - -- I've got a Friends of the Lowly Rutabaga meeting. - -- I promised to help a friend fold road maps. -% Why is it called a funny bone when it hurts so much? % Why is it taking so long for her to bring out all the good in you? @@ -57859,9 +57657,6 @@ a private eye. Yeah, there are more important things in life than money, but they won't go out with you if you don't have any. % -YEAR: - A period of three hundred and sixty-five disappointments. -% Year Name James Bond Book ---- -------------------------------- -------------- ---- 50's James Bond TV Series Barry Nelson From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 02:58:23 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B8B1065695; Fri, 15 Jan 2010 02:58:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8E2B8FC1A; Fri, 15 Jan 2010 02:58:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F2wME3025441; Fri, 15 Jan 2010 02:58:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F2wMBO025439; Fri, 15 Jan 2010 02:58:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150258.o0F2wMBO025439@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 02:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202330 - stable/7/games/fortune/datfiles X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:58:23 -0000 Author: dougb Date: Fri Jan 15 02:58:22 2010 New Revision: 202330 URL: http://svn.freebsd.org/changeset/base/202330 Log: MFC r201626: - Move potentially offensive quotes I committed recently to fortunes-o. - Reference date. - Be more clear on context. MFC r201764: For the now-infamous Rumsfeld quote: Change "there're" to "there are" which is consistent with the vast majority of on line references. Remove a spurious trailing " Update the citation text with a suggestion from des. Modified: stable/7/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/7/games/fortune/ (props changed) stable/7/games/fortune/datfiles/ (props changed) stable/7/games/fortune/datfiles/freebsd-tips (props changed) stable/7/games/fortune/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/7/games/fortune/datfiles/fortunes-o.real Fri Jan 15 02:55:19 2010 (r202329) +++ stable/7/games/fortune/datfiles/fortunes-o.real Fri Jan 15 02:58:22 2010 (r202330) @@ -663,6 +663,13 @@ posh hotel. "Why, yes, young man," said the gentleman. "Would you bring me a postcard?" % + As we know, there are known knowns. There are things we know we +know. We also know there are known unknowns. That is to say, we know +there are some things we do not know. But there are also unknown +unknowns; the ones we don't know we don't know. + -- United States Secretary of Defense Donald Rumsfeld + 12 February 2002, Regarding the US invasion of Iraq +% "Are pirates an ethnic group? Or are they just people who burn illegal cds?" "Arrrr! We prefer to be called Buccaneer-Americans." @@ -12873,6 +12880,14 @@ Contraception", has been withdrawn after pull it out at the last minute. -- Not the Nine O'Clock News % +The investment community feels very putupon. They feel there is no +reason why they shouldn't earn $1 million to $200 million a year, +and they don't want to be held responsible for the global financial +meltdown. + -- Daniel Fass, Chairman of United States President + Barack Obama's financial-industry fundraising party + 20 October 2009 +% The king arranged a regal marriage for his daughter -- a bond that would unite two great kingdoms. Yet, because the young couple seemed so formal to each other, he posted a spy outside the royal wedding chamber and demanded a full From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 03:05:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BF4810656BF; Fri, 15 Jan 2010 03:05:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 597078FC25; Fri, 15 Jan 2010 03:05:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F35kbE027374; Fri, 15 Jan 2010 03:05:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F35kdE027372; Fri, 15 Jan 2010 03:05:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150305.o0F35kdE027372@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202333 - stable/7/etc/rc.d X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:05:46 -0000 Author: dougb Date: Fri Jan 15 03:05:46 2010 New Revision: 202333 URL: http://svn.freebsd.org/changeset/base/202333 Log: MFC r201367, r201370: Virtualize the location of "the configuration directory" instead of hard-coding it to be /etc/namedb Modified: stable/7/etc/rc.d/named Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc.d/named ============================================================================== --- stable/7/etc/rc.d/named Fri Jan 15 03:04:43 2010 (r202332) +++ stable/7/etc/rc.d/named Fri Jan 15 03:05:46 2010 (r202333) @@ -43,19 +43,19 @@ chroot_autoupdate() warn "chroot directory structure not updated" fi - # Create /etc/namedb symlink + # Create (or update) the configuration directory symlink # - if [ ! -L /etc/namedb ]; then - if [ -d /etc/namedb ]; then - warn "named chroot: /etc/namedb is a directory!" - elif [ -e /etc/namedb ]; then - warn "named chroot: /etc/namedb exists!" + if [ ! -L "${named_conf%/*}" ]; then + if [ -d "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} is a directory!" + elif [ -e "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} exists!" else - ln -s ${named_chrootdir}/etc/namedb /etc/namedb + ln -s ${named_confdir} ${named_conf%/*} fi else # Make sure it points to the right place. - ln -shf ${named_chrootdir}/etc/namedb /etc/namedb + ln -shf ${named_confdir} ${named_conf%/*} fi # Mount a devfs in the chroot directory if needed @@ -179,12 +179,12 @@ named_prestart() # Create an rndc.key file for the user if none exists # confgen_command="${command%/named}/rndc-confgen -a -b256 -u $named_uid \ - -c ${named_chrootdir}/etc/namedb/rndc.key" - if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then + -c ${named_confdir}/rndc.key" + if [ -s "${named_confdir}/rndc.conf" ]; then unset confgen_command fi - if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then - case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in + if [ -s "${named_confdir}/rndc.key" ]; then + case `stat -f%Su ${named_confdir}/rndc.key` in root|$named_uid) ;; *) $confgen_command ;; esac @@ -198,8 +198,8 @@ named_prestart() warn "named_auto_forward enabled, but no /etc/resolv.conf" # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf ${command%/named}/named-checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' @@ -248,19 +248,19 @@ named_prestart() mv /var/run/naf-resolv.conf /etc/resolv.conf fi - if cmp -s ${named_chrootdir}/etc/namedb/auto_forward.conf \ + if cmp -s ${named_confdir}/auto_forward.conf \ /var/run/auto_forward.conf; then unlink /var/run/auto_forward.conf else - [ -e "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - unlink ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -e "${named_confdir}/auto_forward.conf" ] && + unlink ${named_confdir}/auto_forward.conf mv /var/run/auto_forward.conf \ - ${named_chrootdir}/etc/namedb/auto_forward.conf + ${named_confdir}/auto_forward.conf fi else # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf fi ${command%/named}/named-checkconf $named_conf || @@ -274,5 +274,6 @@ load_rc_config $name required_dirs="$named_chrootdir" # if it is set, it must exist required_files="${named_conf:=/etc/namedb/named.conf}" pidfile="${named_pidfile:-/var/run/named/pid}" +named_confdir="${named_chrootdir}${named_conf%/*}" run_rc_command "$1" From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 03:06:39 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9AD106568B; Fri, 15 Jan 2010 03:06:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B5538FC19; Fri, 15 Jan 2010 03:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F36duN027617; Fri, 15 Jan 2010 03:06:39 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F36d0t027615; Fri, 15 Jan 2010 03:06:39 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150306.o0F36d0t027615@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202334 - stable/7/etc/defaults X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:06:39 -0000 Author: dougb Date: Fri Jan 15 03:06:39 2010 New Revision: 202334 URL: http://svn.freebsd.org/changeset/base/202334 Log: MFC r201368: Update named_flags comment regarding not using it for -u and -c Modified: stable/7/etc/defaults/rc.conf Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Fri Jan 15 03:05:46 2010 (r202333) +++ stable/7/etc/defaults/rc.conf Fri Jan 15 03:06:39 2010 (r202334) @@ -244,7 +244,7 @@ inetd_flags="-wW -C 60" # Optional flag named_enable="NO" # Run named, the DNS server (or NO). named_program="/usr/sbin/named" # Path to named, if you want a different one. named_conf="/etc/namedb/named.conf" # Path to the configuration file -#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin +#named_flags="" # Use this for flags OTHER than -u and -c named_pidfile="/var/run/named/pid" # Must set this in named.conf as well named_uid="bind" # User to run named as named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 03:39:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E30D1065670; Fri, 15 Jan 2010 03:39:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE9998FC15; Fri, 15 Jan 2010 03:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F3d3R4035299; Fri, 15 Jan 2010 03:39:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F3d3V4035296; Fri, 15 Jan 2010 03:39:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150339.o0F3d3V4035296@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202338 - stable/7/usr.sbin/mergemaster X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:39:04 -0000 Author: dougb Date: Fri Jan 15 03:39:03 2010 New Revision: 202338 URL: http://svn.freebsd.org/changeset/base/202338 Log: MFC r200416: Simplify handling of MTREEFILE relative to DESTDIR Make the message about a missing MTREEFILE combined with -U more informative MFC r200425: Over time things that used to be files/directories/links can change to something else. So add code to detect when things don't match and give the user choices about how to fix it. If we're using -P and something in the above check needs to be moved we need to have the directory there for it, so create it at the beginning and delete empty versions of it at the end. The case where something used to be a file or link and now is supposed to be a directory (e.g., /etc/security) is especially dangerous, so make failure to install a necessary directory in $DESTDIR a fatal error. MFC r200700: In the places where find is used that the user may see the results, first pipe it to sort so that order of processing will be deterministic and like things will be grouped together. MFC r200701: Fix an indentation issue, no functional changes MFC r200708: Fix a problem with how mergemaster handles the hard links for /.cshrc and /.profile. The problem is that install(1) will unlink the old file before it installs the new one, which means that in the best case we have to compare the changes for the old file twice. So, change the logic to first test to see if the link exists, then install the file. Then if the link was there and we're using -i, just create the link in /root and be done with it. Otherwise display the message to the user and give them the option. Because we are now sorting things before doing the comparison we can know conclusively that the files in / should be the sources, and the files in /root will be the targets, so adjust the paths accordingly. While I'm here, split a too-long error message into two lines and just return at the end of handling these files instead of setting the variable that says "do nothing" and then returning at the end of the function anyway. MFC r201291: Add some patches contributed by jhb: 1. Don't prompt the user for "-U but no db" error if we're using -a 2. Add an option to delete stale rc.d files automatically if the user has DELETE_STALE_RC_FILES in their rc file. Lack of command line option for this is not an oversight. 3. Add []'s around the terminal $ for the $FreeBSD$ test for -F For one bug raised by jhb I did a more thorough solution: There were a lot of things that "snuck in" between the end of the test for -r and the start of the comparison. One of them is the creation of the mtree db, as pointed out by jhb. Fix this problem more thoroughly by moving the end of the test down to where it should/used to be, right before the comparison. As a result, indent the interloping code to match. MFC r201292: Document the DELETE_STALE_RC_FILES option introduced in r201291. This is an "rc file only" option by design. While I'm here, update the comments in the example rc file to indicate which command line options they relate to, and correct the defaults for a couple of options. MFC r201293: It's not necessary to include both Op and Fl for command line options included in the text, so use only the latter. Clarify that using -U doesn't make sense in combination with -a MFC r201323: If we are using -p it does not make any sense to even create the MTREENEW file since it will never be used. MFC r201765: Update copyright date Update delete_temproot() to include the error message if it fails, and clean up the places where it's called. If there are no files left in temproot when the comparison is done delete it without prompting. This should make "automated" runs of mergemaster without -a a little easier. Document the new behavior in the man page. Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 stable/7/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/7/usr.sbin/mergemaster/ (props changed) Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 03:28:46 2010 (r202337) +++ stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 03:39:03 2010 (r202338) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2009 Douglas Barton +.\" Copyright (c) 1998-2010 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2009 +.Dd January 7, 2010 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -61,10 +61,10 @@ down, populating that environment with t files. You can specify a different source directory with the -.Op Fl m +.Fl m command line option, or specify the destination directory with the -.Op Fl D +.Fl D option. It then compares each file in that environment to its installed counterpart. @@ -91,10 +91,10 @@ compares the files themselves. You can also specify that the script ignore the Id strings and compare every file with the -.Op Fl s +.Fl s option. Using the -.Op Fl F +.Fl F option .Nm will install the new file for you if they differ only by @@ -126,7 +126,7 @@ installing an updated version of this fi probably run .Xr pwd_mkdb 8 with the -.Op Fl p +.Fl p option to rebuild your password databases and recreate .Pa /etc/passwd . @@ -165,6 +165,14 @@ which will be read before Options specified on the command line are updated last, and therefore can override both files. .Pp +When the comparison is done if there are any files remaining +in the temproot directory they will be listed, and if the +.Fl a +option is not in use the user will be given the option of +deleting the temproot directory. +If there are no files remaining in the temproot directory +it will be deleted. +.Pp The options are as follows: .Bl -tag -width Fl .It Fl s @@ -198,11 +206,13 @@ If the directory exists, it creates a new one in a previously non-existent directory. This option unsets the verbose flag, -but is compatible with all other options. +but other than +.Fl U +it is compatible with all other options. Setting -.Op Fl a +.Fl a makes -.Op Fl w +.Fl w superfluous. .It Fl h Display usage and help information. @@ -253,7 +263,7 @@ instead of the default Add the date and time to the name of the temporary root directory. If -.Op Fl t +.Fl t is specified, this option must follow it if you want the date added too. .It Fl u Ar N @@ -320,44 +330,44 @@ with all values commented out: # These are options for mergemaster, with their default values listed # The following options have command line overrides # -# The target architecture (unset by default) +# The target architecture (-A, unset by default) #ARCHSTRING='TARGET_ARCH=' # -# Sourcedir is the directory to do the 'make' in (where the new files are) +# Sourcedir is the directory to do the 'make' in (-m) #SOURCEDIR='/usr/src' # -# Directory to install the temporary root environment into +# Directory to install the temporary root environment into (-t) #TEMPROOT='/var/tmp/temproot' # -# Specify the destination directory for the installed files +# Specify the destination directory for the installed files (-D) #DESTDIR= # -# Strict comparison skips the VCS Id test and compares every file +# Strict comparison skips the VCS Id test and compares every file (-s) #STRICT=no # -# Type of diff, such as unified, context, etc. +# Type of diff, such as unified, context, etc. (-c) #DIFF_FLAG='-u' # -# Install the new file if it differs only by VCS Id ($FreeBSD) +# Install the new file if it differs only by VCS Id ($FreeBSD, -F) #FREEBSD_ID= # -# Verbose mode includes more details and additional checks +# Verbose mode includes more details and additional checks (-v) #VERBOSE= # -# Automatically install files that do not exist on the system already +# Automatically install files that do not exist on the system already (-i) #AUTO_INSTALL= # -# Automatically upgrade files that have not been user modified +# Automatically upgrade files that have not been user modified (-U) #AUTO_UPGRADE= # -# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf -#COMP_CONFS=yes +# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) +#COMP_CONFS= # -# Preserve files that you replace -#PRESERVE_FILES=yes +# Preserve files that you replace (-P) +#PRESERVE_FILES= #PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` # -# The umask for mergemaster to compare the default file's modes to +# The umask for mergemaster to compare the default file's modes to (-u) #NEW_UMASK=022 # # The following options have no command line overrides @@ -377,6 +387,9 @@ with all values commented out: # If you set 'yes' above, make sure to include the PATH to your pager #PATH=/bin:/usr/bin:/usr/sbin # +# Delete stale files in /etc/rc.d without prompting +#DELETE_STALE_RC_FILES= +# # Specify the path to scripts to run before the comparison starts, # and/or after the script has finished its work #MM_PRE_COMPARE_SCRIPT= Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:28:46 2010 (r202337) +++ stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:39:03 2010 (r202338) @@ -5,7 +5,7 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2009 Douglas Barton +# Copyright 1998-2010 Douglas Barton # DougB@FreeBSD.org # $FreeBSD$ @@ -263,7 +263,7 @@ fi # Assign the location of the mtree database # -MTREEDB=${MTREEDB:-/var/db} +MTREEDB=${MTREEDB:-${DESTDIR}/var/db} MTREEFILE="${MTREEDB}/mergemaster.mtree" # Check the command line options @@ -345,18 +345,24 @@ done # Don't force the user to set this in the mergemaster rc file if [ -n "${PRESERVE_FILES}" -a -z "${PRESERVE_FILES_DIR}" ]; then PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` + mkdir -p ${PRESERVE_FILES_DIR} fi # Check for the mtree database in DESTDIR case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${MTREEFILE}" ]; then echo '' - echo "*** Unable to find mtree database. Skipping auto-upgrade on this run." + echo "*** Unable to find mtree database (${MTREEFILE})." + echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' - press_to_continue + case "${AUTO_RUN}" in + '') + press_to_continue + ;; + esac unset AUTO_UPGRADE fi ;; @@ -463,9 +469,9 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then +if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then CHANGED=: - for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ + for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" @@ -505,7 +511,7 @@ CVS_ID_TAG=FreeBSD delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null chflags -R 0 "${TEMPROOT}" 2>/dev/null - rm -rf "${TEMPROOT}" || exit 1 + rm -rf "${TEMPROOT}" || { echo "*** Unable to delete ${TEMPROOT}"; exit 1; } } case "${RERUN}" in @@ -536,7 +542,7 @@ case "${RERUN}" in echo '' echo " *** Deleting the old ${TEMPROOT}" echo '' - delete_temproot || exit 1 + delete_temproot unset TEST_TEMP_ROOT ;; [tT]) @@ -663,31 +669,32 @@ case "${RERUN}" in for file in ${IGNORE_FILES}; do test -e ${TEMPROOT}/${file} && unlink ${TEMPROOT}/${file} done - ;; # End of the "RERUN" test -esac -# We really don't want to have to deal with files like login.conf.db, pwd.db, -# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. -# Prompt the user to do so below, as needed. -# -rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd + # We really don't want to have to deal with files like login.conf.db, pwd.db, + # or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. + # Prompt the user to do so below, as needed. + # + rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd -# We only need to compare things like freebsd.cf once -find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null + # We only need to compare things like freebsd.cf once + find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null -# Delete stuff we do not need to keep the mtree database small, -# and to make the actual comparison faster. -find ${TEMPROOT}/usr -type l -delete 2>/dev/null -find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null -find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + # Delete stuff we do not need to keep the mtree database small, + # and to make the actual comparison faster. + find ${TEMPROOT}/usr -type l -delete 2>/dev/null + find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null + find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null -# Build the mtree database in a temporary location. -MTREENEW=`mktemp -t mergemaster.mtree` -case "${PRE_WORLD}" in -'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null - ;; -*) # We don't want to mess with the mtree database on a pre-world run. - ;; + # Build the mtree database in a temporary location. + case "${PRE_WORLD}" in + '') MTREENEW=`mktemp -t mergemaster.mtree` + mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null + ;; + *) # We don't want to mess with the mtree database on a pre-world run or + # when re-scanning a previously-built tree. + ;; + esac + ;; # End of the "RERUN" test esac # Get ready to start comparing files @@ -818,7 +825,8 @@ mm_install () { if [ -n "${DESTDIR}${INSTALL_DIR}" -a ! -d "${DESTDIR}${INSTALL_DIR}" ]; then DIR_MODE=`find_mode "${TEMPROOT}/${INSTALL_DIR}"` - install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" + install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" || + install_error $1 ${DESTDIR}${INSTALL_DIR} fi FILE_MODE=`find_mode "${1}"` @@ -837,32 +845,39 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') - case "${LINK_EXPLAINED}" in - '') - echo " *** Historically BSD derived systems have had a" - echo " hard link from /.cshrc and /.profile to" - echo " their namesakes in /root. Please indicate" - echo " your preference below for bringing your" - echo " installed files up to date." - echo '' - LINK_EXPLAINED=yes - ;; - esac + local st_nlink - echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" - echo '' - echo " Default is to leave the temporary file to deal with by hand" - echo '' - echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " - read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac + # install will unlink the file before it installs the new one, + # so we have to restore/create the link afterwards. + # + st_nlink=0 # In case the file does not yet exist + eval $(stat -s ${DESTDIR}${COMPFILE#.} 2>/dev/null) + + do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + + if [ -n "${AUTO_INSTALL}" -a $st_nlink -gt 1 ]; then + HANDLE_LINK=l + else + case "${LINK_EXPLAINED}" in + '') + echo " *** Historically BSD derived systems have had a" + echo " hard link from /.cshrc and /.profile to" + echo " their namesakes in /root. Please indicate" + echo " your preference below for bringing your" + echo " installed files up to date." + echo '' + LINK_EXPLAINED=yes + ;; + esac + + echo " Use 'd' to delete the temporary ${COMPFILE}" + echo " Use 'l' to delete the existing ${DESTDIR}/root/${COMPFILE##*/} and create the link" + echo '' + echo " Default is to leave the temporary file to deal with by hand" + echo '' + echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " + read HANDLE_LINK + fi case "${HANDLE_LINK}" in [dD]*) @@ -872,19 +887,19 @@ mm_install () { ;; [lL]*) echo '' - rm -f "${DESTDIR}${COMPFILE#.}" - if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then + unlink ${DESTDIR}/root/${COMPFILE##*/} + if ln ${DESTDIR}${COMPFILE#.} ${DESTDIR}/root/${COMPFILE##*/}; then echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully" - rm "${COMPFILE}" else - echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand" + echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}" + echo " *** ${COMPFILE} will remain for your consideration" fi ;; *) echo " *** ${COMPFILE} will remain for your consideration" ;; esac - DONT_INSTALL=yes + return ;; esac @@ -955,6 +970,12 @@ if [ -z "${PRE_WORLD}" -a -z "${RERUN}" esac sleep 2 ;; + *) + if [ -n "${DELETE_STALE_RC_FILES}" ]; then + echo ' *** Deleting ... ' + rm ${STALE_RC_FILES} + echo ' done.' + fi esac ;; esac @@ -967,7 +988,58 @@ if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; th . "${MM_PRE_COMPARE_SCRIPT}" fi -for COMPFILE in `find . -type f`; do +# Things that were files/directories/links in one version can sometimes +# change to something else in a newer version. So we need to explicitly +# test for this, and warn the user if what we find does not match. +# +for COMPFILE in `find . | sort` ; do + if [ -e "${DESTDIR}${COMPFILE#.}" ]; then + INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` + else + continue + fi + TEMPROOT_TYPE=`stat -f '%HT' $COMPFILE` + + if [ ! "$TEMPROOT_TYPE" = "$INSTALLED_TYPE" ]; then + [ "$COMPFILE" = '.' ] && continue + TEMPROOT_TYPE=`echo $TEMPROOT_TYPE | tr [:upper:] [:lower:]` + INSTALLED_TYPE=`echo $INSTALLED_TYPE | tr [:upper:] [:lower:]` + + echo "*** The installed file ${DESTDIR}${COMPFILE#.} has the type \"$INSTALLED_TYPE\"" + echo " but the new version has the type \"$TEMPROOT_TYPE\"" + echo '' + echo " How would you like to handle this?" + echo '' + echo " Use 'r' to remove ${DESTDIR}${COMPFILE#.}" + case "$TEMPROOT_TYPE" in + 'symbolic link') + TARGET=`readlink $COMPFILE` + echo " and create a link to $TARGET in its place" ;; + *) echo " You will be able to install it as a \"$TEMPROOT_TYPE\"" ;; + esac + echo '' + echo " Use 'i' to ignore this" + echo '' + echo -n " How to proceed? [i] " + read ANSWER + case "$ANSWER" in + [rR]) case "${PRESERVE_FILES}" in + [Yy][Ee][Ss]) + mv ${DESTDIR}${COMPFILE#.} ${PRESERVE_FILES_DIR}/ || exit 1 ;; + *) rm -rf ${DESTDIR}${COMPFILE#.} ;; + esac + case "$TEMPROOT_TYPE" in + 'symbolic link') ln -sf $TARGET ${DESTDIR}${COMPFILE#.} ;; + esac ;; + *) echo '' + echo "*** See the man page about adding ${COMPFILE#.} to the list of IGNORE_FILES" + press_to_continue ;; + esac + echo '' + fi +done + +for COMPFILE in `find . -type f | sort`; do # First, check to see if the file exists in DESTDIR. If not, the # diff_loop function knows how to handle it. @@ -1032,7 +1104,7 @@ for COMPFILE in `find . -type f`; do # If the user chose the -F option, test for that before proceeding # if [ -n "$FREEBSD_ID" ]; then - if diff -q -I'[$]FreeBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ + if diff -q -I'[$]FreeBSD.*[$]' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ /dev/null 2>&1; then if mm_install "${COMPFILE}"; then echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}" @@ -1061,8 +1133,8 @@ echo "*** Comparison complete" if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" - test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} - mv ${MTREENEW} ${DESTDIR}${MTREEFILE} + test -e "${MTREEFILE}" && unlink ${MTREEFILE} + mv ${MTREENEW} ${MTREEFILE} fi echo '' @@ -1070,30 +1142,28 @@ echo '' TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null` if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" - find "${TEMPROOT}" -type f -size +0 + find "${TEMPROOT}" -type f -size +0 | sort echo '' -fi - -case "${AUTO_RUN}" in -'') - echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " - read DEL_TEMPROOT - case "${DEL_TEMPROOT}" in - [yY]*) - if delete_temproot; then - echo " *** ${TEMPROOT} has been deleted" - else - echo " *** Unable to delete ${TEMPROOT}" - fi - ;; - *) - echo " *** ${TEMPROOT} will remain" + case "${AUTO_RUN}" in + '') + echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " + read DEL_TEMPROOT + case "${DEL_TEMPROOT}" in + [yY]*) + delete_temproot + ;; + *) + echo " *** ${TEMPROOT} will remain" + ;; + esac ;; + *) ;; esac - ;; -*) ;; -esac +else + echo "*** ${TEMPROOT} is empty, deleting" + delete_temproot +fi case "${AUTO_INSTALLED_FILES}" in '') ;; @@ -1268,5 +1338,9 @@ case "${PRE_WORLD}" in ;; esac -exit 0 +if [ -n "${PRESERVE_FILES}" ]; then + find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null + rmdir $PRESERVE_FILES_DIR 2>/dev/null +fi +exit 0 From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 11:28:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 086C61065692; Fri, 15 Jan 2010 11:28:37 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8EC68FC13; Fri, 15 Jan 2010 11:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FBSa3n057343; Fri, 15 Jan 2010 11:28:36 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FBSa2X057336; Fri, 15 Jan 2010 11:28:36 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151128.o0FBSa2X057336@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 11:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202344 - in stable/7/sys/boot: common pc98 pc98/libpc98 pc98/loader X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 11:28:37 -0000 Author: nyan Date: Fri Jan 15 11:28:36 2010 New Revision: 202344 URL: http://svn.freebsd.org/changeset/base/202344 Log: MFC: revision 201339 and 201340 - Add setting machine type support to the loader. - Don't use 15M-16M area on pc98. It's reserved for some devices. Added: stable/7/sys/boot/pc98/libpc98/libpc98.h - copied unchanged from r201339, head/sys/boot/pc98/libpc98/libpc98.h stable/7/sys/boot/pc98/libpc98/pc98_sys.c - copied unchanged from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c Modified: stable/7/sys/boot/common/module.c stable/7/sys/boot/pc98/Makefile.inc stable/7/sys/boot/pc98/libpc98/Makefile stable/7/sys/boot/pc98/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/module.c ============================================================================== --- stable/7/sys/boot/common/module.c Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/common/module.c Fri Jan 15 11:28:36 2010 (r202344) @@ -313,6 +313,9 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; +#ifdef PC98 + struct stat st; +#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -334,6 +337,14 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + if (loadaddr < 0x1000000 && + fstat(fd, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -439,6 +450,14 @@ mod_loadkld(const char *kldname, int arg ; do { +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + struct stat st; + if (loadaddr < 0x1000000 && + stat(filename, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: stable/7/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/7/sys/boot/pc98/Makefile.inc Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/pc98/Makefile.inc Fri Jan 15 11:28:36 2010 (r202344) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os + -Os -DPC98 LDFLAGS+= -nostdlib # BTX components Modified: stable/7/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/7/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:28:36 2010 (r202344) @@ -7,7 +7,7 @@ INTERNALLIB= SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \ bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c BOOT_COMCONSOLE_PORT?= 0x238 Copied: stable/7/sys/boot/pc98/libpc98/libpc98.h (from r201339, head/sys/boot/pc98/libpc98/libpc98.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/libpc98/libpc98.h Fri Jan 15 11:28:36 2010 (r202344, copy of r201339, head/sys/boot/pc98/libpc98/libpc98.h) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * 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. + * + * $FreeBSD$ + */ + +void set_machine_type(void); Copied: stable/7/sys/boot/pc98/libpc98/pc98_sys.c (from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/libpc98/pc98_sys.c Fri Jan 15 11:28:36 2010 (r202344, copy of r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#define _KERNEL +#include + +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +void +set_machine_type(void) +{ + int i; + u_long ret, data; + + /* PC98_SYSTEM_PARAMETER (0x501) */ + ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3; + + /* Wait V-SYNC */ + while (inb(0x60) & 0x20) {} + while (!(inb(0x60) & 0x20)) {} + + /* ANK 'A' font */ + outb(0xa1, 0x00); + outb(0xa3, 0x41); + + /* M_NORMAL, use CG window (all NEC OK) */ + for (i = data = 0; i < 4; i++) + data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */ + if (data == 0x6efc58fc) /* DA data */ + ret |= M_NEC_PC98; + else + ret |= M_EPSON_PC98; + ret |= (inb(0x42) & 0x20) ? M_8M : 0; + + /* PC98_SYSTEM_PARAMETER(0x400) */ + if ((*(u_char *)PTOV(0xA1400)) & 0x80) + ret |= M_NOTE; + if (ret & M_NEC_PC98) { + /* PC98_SYSTEM_PARAMETER(0x458) */ + if ((*(u_char *)PTOV(0xA1458)) & 0x80) + ret |= M_H98; + else + ret |= M_NOT_H98; + } else + ret |= M_NOT_H98; + + (*(u_long *)PTOV(0xA1620)) = ret; +} Modified: stable/7/sys/boot/pc98/loader/main.c ============================================================================== --- stable/7/sys/boot/pc98/loader/main.c Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/pc98/loader/main.c Fri Jan 15 11:28:36 2010 (r202344) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386/libi386.h" +#include "libpc98/libpc98.h" #include "btxv86.h" #define KARGS_FLAGS_CD 0x1 @@ -81,6 +82,9 @@ main(void) { int i; + /* Set machine type to PC98_SYSTEM_PARAMETER. */ + set_machine_type(); + /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 12:07:00 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BDC11065670; Fri, 15 Jan 2010 12:07:00 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 489078FC12; Fri, 15 Jan 2010 12:07:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FC70DV066166; Fri, 15 Jan 2010 12:07:00 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FC704B066164; Fri, 15 Jan 2010 12:07:00 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201001151207.o0FC704B066164@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 15 Jan 2010 12:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202349 - stable/7/usr.sbin/ypserv X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:07:00 -0000 Author: marck (doc committer) Date: Fri Jan 15 12:07:00 2010 New Revision: 202349 URL: http://svn.freebsd.org/changeset/base/202349 Log: MFH r201051: To remove a server, one should use double backslash, and half of them are eaten by shell. Fix this. Modified: stable/7/usr.sbin/ypserv/ypinit.sh Directory Properties: stable/7/usr.sbin/ypserv/ (props changed) Modified: stable/7/usr.sbin/ypserv/ypinit.sh ============================================================================== --- stable/7/usr.sbin/ypserv/ypinit.sh Fri Jan 15 12:02:22 2010 (r202348) +++ stable/7/usr.sbin/ypserv/ypinit.sh Fri Jan 15 12:07:00 2010 (r202349) @@ -298,7 +298,7 @@ do echo "Update the list of hosts running YP servers in domain ${DOMAIN}." echo "Master for this domain is ${MASTER_NAME}." echo "" - echo "First verify old servers, type \\ to remove a server." + echo "First verify old servers, type \\\\ to remove a server." echo "Then add new servers, one per line. When done type a ." echo "" echo " master server : ${HOST}" From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 12:45:23 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE793106566B; Fri, 15 Jan 2010 12:45:23 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 981278FC14; Fri, 15 Jan 2010 12:45:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FCjNxn075140; Fri, 15 Jan 2010 12:45:23 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCjNqq075136; Fri, 15 Jan 2010 12:45:23 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151245.o0FCjNqq075136@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 12:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202355 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:45:23 -0000 Author: nyan Date: Fri Jan 15 12:45:23 2010 New Revision: 202355 URL: http://svn.freebsd.org/changeset/base/202355 Log: MFC: revision 201342 Reimplement the boot2 for pc98 completely. It's based on the newest i386's one and has the advantage of: - ELF binary support. - UFS2 filesystem support. - Many FreeBSD slices support on a disk. Added: stable/7/sys/boot/pc98/boot2/boot1.S - copied unchanged from r201342, head/sys/boot/pc98/boot2/boot1.S stable/7/sys/boot/pc98/boot2/boot2.c - copied unchanged from r201342, head/sys/boot/pc98/boot2/boot2.c Deleted: stable/7/sys/boot/pc98/boot2/asm.S stable/7/sys/boot/pc98/boot2/asm.h stable/7/sys/boot/pc98/boot2/bios.S stable/7/sys/boot/pc98/boot2/boot.c stable/7/sys/boot/pc98/boot2/boot.h stable/7/sys/boot/pc98/boot2/boot2.S stable/7/sys/boot/pc98/boot2/dinode.h stable/7/sys/boot/pc98/boot2/disk.c stable/7/sys/boot/pc98/boot2/fs.h stable/7/sys/boot/pc98/boot2/inode.h stable/7/sys/boot/pc98/boot2/io.c stable/7/sys/boot/pc98/boot2/probe_keyboard.c stable/7/sys/boot/pc98/boot2/quota.h stable/7/sys/boot/pc98/boot2/serial.S stable/7/sys/boot/pc98/boot2/serial_16550.S stable/7/sys/boot/pc98/boot2/serial_8251.S stable/7/sys/boot/pc98/boot2/start.S stable/7/sys/boot/pc98/boot2/sys.c stable/7/sys/boot/pc98/boot2/table.c Modified: stable/7/sys/boot/pc98/boot2/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/7/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:42:35 2010 (r202354) +++ stable/7/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:45:23 2010 (r202355) @@ -1,114 +1,104 @@ # $FreeBSD$ -# -PROG= boot -# Order is very important on the SRCS line for this prog -SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S -SRCS+= probe_keyboard.c io.c disk.c sys.c - -BINMODE= 444 -CFLAGS= -Os -mrtd \ - -fno-guess-branch-probability \ - -fno-unit-at-a-time \ - -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT} -CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK} -CFLAGS+= ${CWARNFLAGS} -CFLAGS+= -I${.CURDIR}/../../.. -I. - -# By default, if a serial port is going to be used as console, use COM1 -# (aka /dev/ttyd0). -#BOOT_COMCONSOLE_PORT?=0x30 -BOOT_COMCONSOLE_PORT?=0x238 -BOOT_COMCONSOLE_CLK?=16 -BOOT_COMCONSOLE_MODE=0x0c -CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \ - -DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \ - -DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE} - -# feature not implemented -BOOT_COMCONSOLE_SPEED?=9600 -CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} - -# Enable code to take the default boot string from a fixed location on the -# disk. See nextboot(8) and README.386BSD for more info. -#CFLAGS+= -DNAMEBLOCK -#CFLAGS+= -DNAMEBLOCK_WRITEBACK - -# Bias the conversion from the BIOS drive number to the FreeBSD unit number -# for hard disks. This may be useful for people booting in a mixed IDE/SCSI -# environment (set BOOT_HD_BIAS to the number of IDE drives). -#CFLAGS+= -DBOOT_HD_BIAS=1 -# -# Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number -# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to -# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of -# 1:wd(1,a). If `da' is given explicitly, then the drive is assumed to be -# SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a). - -CLEANFILES+= boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest -LDFLAGS+= -N -Ttext 0 -e start -NO_SHARED= YES -NO_MAN= -STRIP= - -# tunable timeout parameter, waiting for keypress, calibrated in ms -BOOTWAIT?= 5000 -# tunable timeout during string input, calibrated in ms -#TIMEOUT?= 30000 - -# Location that boot2 is loaded at -BOOTSEG= 0x1000 - -# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned -BOOTSTACK= 0xFFF0 - -boot.nohdr: boot - objcopy -S -O binary boot boot.nohdr - ls -l boot.nohdr - -boot.ldr: boot.nohdr - dd if=boot.nohdr of=boot.ldr bs=8192 count=1 conv=sync - -boot1: boot.nohdr - dd if=boot.nohdr of=boot1 bs=512 count=1 - -boot2: boot.nohdr - dd if=boot.nohdr of=boot2 bs=512 skip=1 - @dd if=boot2 skip=14 of=sizetest 2> /dev/null - @if [ -s sizetest ] ; then \ - echo "boot2 is too big" >&2 ; \ - rm boot2 ; \ - exit 2 ; \ - fi - -all: boot.ldr boot1 boot2 - -install: - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot.ldr ${DESTDIR}${BINDIR}/boot - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot1 boot2 ${DESTDIR}${BINDIR} - -# If it's not there, don't consider it a target -.if exists(${.CURDIR}/../../../pc98/include) -beforedepend ${OBJS}: machine - -machine: - ln -sf ${.CURDIR}/../../../pc98/include machine - -.endif - -.if exists(${.CURDIR}/../../../i386/include) -beforedepend ${OBJS}: i386 +FILES= boot boot1 boot2 -i386: - ln -sf ${.CURDIR}/../../../i386/include i386 +NM?= nm -.endif +BOOT_COMCONSOLE_PORT?= 0x238 +BOOT_COMCONSOLE_SPEED?= 9600 +B2SIOFMT?= 0x3 + +REL1= 0x700 +ORG1= 0 +ORG2= 0x2000 + +# Decide level of UFS support. +BOOT2_UFS?= UFS1_AND_UFS2 +#BOOT2_UFS?= UFS2_ONLY +#BOOT2_UFS?= UFS1_ONLY + +CFLAGS= -Os \ + -fno-guess-branch-probability \ + -fomit-frame-pointer \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + -mrtd \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -D${BOOT2_UFS} \ + -DFLAGS=${BOOT_BOOT1_FLAGS} \ + -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../.. \ + -I${.CURDIR}/../../i386/boot2 \ + -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib -I. \ + -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -Winline --param max-inline-insns-single=100 + +# Set machine type to PC98_SYSTEM_PARAMETER +#CFLAGS+= -DSET_MACHINE_TYPE + +# Initialize the bi_bios_geom using the BIOS geometry +#CFLAGS+= -DGET_BIOSGEOM + +LDFLAGS=-static -N --gc-sections + +# Pick up ../Makefile.inc early. +.include + +.PATH: ${.CURDIR}/../../i386/boot2 + +CLEANFILES= boot + +boot: boot1 boot2 + cat boot1 boot2 > boot + +CLEANFILES+= boot1 boot1.out boot1.o + +boot1: boot1.out + objcopy -S -O binary boot1.out ${.TARGET} + +boot1.out: boot1.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o + +CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ + boot2.s boot2.s.tmp boot2.h sio.o + +boot2: boot2.ld + @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 + dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + +boot2.ld: boot2.ldr boot2.bin ${BTXKERN} + btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ + -o ${.TARGET} -P 1 boot2.bin + +boot2.ldr: + dd if=/dev/zero of=${.TARGET} bs=276 count=1 + +boot2.bin: boot2.out + objcopy -S -O binary boot2.out ${.TARGET} + +boot2.out: ${BTXCRT} boot2.o sio.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + +boot2.o: boot2.s + +SRCS= boot2.c boot2.h + +boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c + ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c + sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s + rm -f boot2.s.tmp + +boot2.h: boot1.out + ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T (read|putc)/ \ + { x = $$1 - ORG1; \ + printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \ + ORG1=`printf "%d" ${ORG1}` \ + REL1=`printf "%d" ${REL1}` > ${.TARGET} -CLEANFILES+= machine i386 - -.include "${.CURDIR}/../../../conf/kern.mk" .include Copied: stable/7/sys/boot/pc98/boot2/boot1.S (from r201342, head/sys/boot/pc98/boot2/boot1.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/boot2/boot1.S Fri Jan 15 12:45:23 2010 (r202355, copy of r201342, head/sys/boot/pc98/boot2/boot1.S) @@ -0,0 +1,395 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * 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. + * + * $FreeBSD$ + */ + +/* Memory Locations */ + .set STACK_OFF,0x6000 # Stack offset + .set LOAD_SIZE,8192 # Load size + .set DAUA,0x0584 # DA/UA + .set MEM_REL,0x700 # Relocation address + .set MEM_ARG,0x900 # Arguments + .set MEM_BUF,0x8cec # Load area + .set MEM_BTX,0x9000 # BTX start + .set MEM_JMP,0x9010 # BTX entry point + .set MEM_USR,0xa000 # Client start + +/* PC98 machine type from sys/pc98/pc98/pc98_machdep.h */ + .set MEM_SYS, 0xa100 # System common area segment + .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type + .set EPSON_ID, 0x0624 # EPSON machine id + + .set M_NEC_PC98, 0x0001 + .set M_EPSON_PC98, 0x0002 + .set M_NOT_H98, 0x0010 + .set M_H98, 0x0020 + .set M_NOTE, 0x0040 + .set M_NORMAL, 0x1000 + .set M_8M, 0x8000 + +/* Partition Constants */ + .set PRT_OFF,0x1be # Partition offset + +/* Misc. Constants */ + .set SIZ_PAG,0x1000 # Page size + .set SIZ_SEC,0x200 # Sector size + + .set NSECT,0x10 + + .globl start + .globl read + .globl putc + .code16 + +start: jmp main + +boot_cyl: .org 4 + .ascii "IPL1 " + +main: cld + + /* Setup the stack */ + xor %si,%si + mov %si,%ss + mov $STACK_OFF,%sp + + push %cx + + /* Relocate ourself to MEM_REL */ + push %cs + pop %ds + mov %si,%es + mov $MEM_REL,%di + mov $SIZ_SEC,%cx + rep + movsb + + /* Transfer PC-9801 system common area */ + xor %ax,%ax + mov %ax,%si + mov %ax,%ds + mov %ax,%di + mov $MEM_SYS,%ax + mov %ax,%es + mov $0x0600,%cx + rep + movsb + + /* Transfer EPSON machine type */ + mov $0xfd00,%ax + mov %ax,%ds + mov (0x804),%eax + and $0x00ffffff,%eax + mov %eax,%es:(EPSON_ID) + + /* Set machine type to PC98_SYSTEM_PARAMETER */ +#ifdef SET_MACHINE_TYPE + call set_machine_type +#else + mov $M_NEC_PC98+M_NOT_H98,%eax + mov %eax,%es:(PC98_MACHINE_TYPE) +#endif + + /* Setup graphic screen */ + mov $0x42,%ah /* 640x400 */ + mov $0xc0,%ch + int $0x18 + mov $0x40,%ah /* graph on */ + int $0x18 + + /* Setup text screen */ + mov $0x0a00,%ax /* 80x25 */ + int $0x18 + mov $0x0c,%ah /* text on */ + int $0x18 + mov $0x13,%ah /* cursor home */ + xor %dx,%dx + int $0x18 + mov $0x11,%ah /* cursor on */ + int $0x18 + + /* Setup keyboard */ + mov $0x03,%ah + int $0x18 + + pop %cx + + /* bootstrap passes */ + xor %edi,%edi + mov %di,%ds + mov %di,%es + mov %cs,%bx + cmp $0x1fe0,%bx + jz boot_fd + cmp $0x1fc0,%bx + jnz boot_hd + xor %cx,%cx + mov (DAUA),%al + and $0xf0,%al + cmp $0x30,%al + jz boot_fd + cmp $0x90,%al + jnz boot_hd +boot_fd: xor %cx,%cx + jmp boot_load +boot_hd: test %cx,%cx + jnz boot_load + mov %cs:(boot_cyl),%cx +boot_load: mov %cx,MEM_ARG /* Save cylinder number */ + mov %cx,%di + xor %dx,%dx + mov $LOAD_SIZE,%bx + mov $MEM_BUF,%bp + push %cs + callw read + jc error + + /* Transfer boot2.bin */ + mov $MEM_BTX,%bx + mov 0xa(%bx),%si /* BTX size */ + add %bx,%si /* start of boot2.bin */ + mov $MEM_USR+SIZ_PAG*2,%di + mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx + sub %si,%cx + rep + movsb + + /* Enable A20 */ + xor %ax,%ax + outb %al,$0xf2 + mov $0x02,%al + outb %al,$0xf6 + + /* Start BTX */ + ljmp $0x0000,$MEM_JMP + +/* + * Reads sectors from the disk. + * Call with: + * + * %bx - bytes to read + * %cx - cylinder + * %dh - head + * %dl - sector + * %edi - lba + * %es:(%bp) - buffer to read data into + */ +read: xor %ax,%ax + mov %ax,%ds + mov $0x06,%ah + mov (DAUA),%al + mov %ax,%si + and $0xf0,%al + cmp $0x30,%al /* 1.44MB FDD */ + jz read_fd + cmp $0x90,%al /* 1MB FDD */ + jz read_fd + cmp $0xa0,%al /* Is SCSI device? */ + jnz read_load + push %cx + mov %si,%cx + and $0x0f,%cl + inc %cl + mov (0x482),%ah + shr %cl,%ah /* Is SCSI HDD? */ + pop %cx + jc read_load + and $0xff7f,%si /* SCSI MO */ + mov %di,%cx + shr $16,%di + mov %di,%dx + jmp read_load +read_fd: or $0xd000,%si + or $0x0200,%cx + inc %dx +read_load: mov %si,%ax + int $0x1b + lret + +/* + * Print out the error message, wait for a keypress, and then reboot + * the machine. + */ +error: push %cs + pop %ds + mov $msg_eread,%si + call putstr + xor %ax,%ax /* Get keypress */ + int $0x18 + xor %ax,%ax /* CPU reset */ + outb %al,$0xf0 +halt: hlt + jmp halt /* Spin */ + +/* + * Display a null-terminated string. + */ +putstr.0: push %cs + callw putc +putstr: lodsb + test %al,%al + jne putstr.0 + ret + +/* + * Display a single char. + */ +putc: pusha + xor %dx,%dx + mov %dx,%ds + mov MEM_REL+cursor-start,%di + mov $0xa000,%bx + mov %bx,%es + mov $(80*2),%cx + + cmp $0x08,%al + je putc.bs + cmp $0x0d,%al + je putc.cr + cmp $0x0a,%al + je putc.lf + cmp $0x5c,%al /* \ */ + jne 1f + mov $0xfc,%al +1: movb $0xe1,%es:0x2000(%di) + stosw + jmp putc.scr +putc.bs: test %di,%di + jz putc.move + dec %di + dec %di + movb $0xe1,%es:0x2000(%di) + movw $0x20,%es:(%di) + jmp putc.move +putc.cr: mov %di,%ax + div %cx + sub %dx,%di + jmp putc.move +putc.lf: add %cx,%di +putc.scr: cmp $(80*2*25),%di /* Scroll screen */ + jb putc.move + push %ds + mov %bx,%ds + mov $(80*2),%si + xor %di,%di + mov $(80*24/2),%cx + rep + movsl + xor %ax,%ax + mov $0x20,%al + mov $80,%cl + rep + stosw + pop %ds + mov $(80*24*2),%di +putc.move: mov %di,MEM_REL+cursor-start /* Move cursor */ + mov $0x13,%ah + mov %di,%dx + int $0x18 + popa + lret + +cursor: .word 0 + +#ifdef SET_MACHINE_TYPE +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +set_machine_type: + xor %edx,%edx + mov %dx,%ds +// mov $MEM_SYS,%ax +// mov %ax,%es + + /* Wait V-SYNC */ +vsync.1: inb $0x60,%al + test $0x20,%al + jnz vsync.1 +vsync.2: inb $0x60,%al + test $0x20,%al + jz vsync.2 + + /* ANK 'A' font */ + xor %al,%al + outb %al,$0xa1 + mov $0x41,%al + outb %al,$0xa3 + + /* Get 'A' font from CG window */ + push %ds + mov $0xa400,%ax + mov %ax,%ds + xor %eax,%eax + xor %bx,%bx + mov $4,%cx +font.1: add (%bx),%eax + add $4,%bx + loop font.1 + pop %ds + cmp $0x6efc58fc,%eax + jnz m_epson + +m_pc98: or $M_NEC_PC98,%edx + mov $0x0458,%bx + mov (%bx),%al + test $0x80,%al + jz m_not_h98 + or $M_H98,%edx + jmp 1f +m_epson: or $M_EPSON_PC98,%edx +m_not_h98: or $M_NOT_H98,%edx + +1: inb $0x42,%al + test $0x20,%al + jz 1f + or $M_8M,%edx + +1: mov $0x0400,%bx + mov (%bx),%al + test $0x80,%al + jz 1f + or $M_NOTE,%edx + +1: mov $PC98_MACHINE_TYPE,%bx + mov %edx,%es:(%bx) + ret +#endif + +/* Messages */ + +msg_eread: .asciz "Error\r\n" + + .org PRT_OFF,0x90 + +/* Partition table */ + + .fill 0x30,0x1,0x0 + .byte 0x80, 0x00, 0x01, 0x00 + .byte 0xa5, 0xff, 0xff, 0xff + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x50, 0xc3, 0x00, 0x00 + + .word 0xaa55 # Magic number Copied: stable/7/sys/boot/pc98/boot2/boot2.c (from r201342, head/sys/boot/pc98/boot2/boot2.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/boot2/boot2.c Fri Jan 15 12:45:23 2010 (r202355, copy of r201342, head/sys/boot/pc98/boot2/boot2.c) @@ -0,0 +1,842 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "boot2.h" +#include "lib.h" + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +#define SECOND 1 /* Circa that many ticks in a second. */ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define PATH_CONFIG "/boot.config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_KERNEL "/boot/kernel/kernel" + +#define ARGS 0x900 +#define NOPT 14 +#define NDEV 3 +#define V86_CY(x) ((x) & PSL_C) +#define V86_ZR(x) ((x) & PSL_Z) + +#define DRV_DISK 0xf0 +#define DRV_UNIT 0x0f + +#define TYPE_AD 0 +#define TYPE_DA 1 +#define TYPE_FD 2 + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t _end; + +static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ +static const unsigned char flags[NOPT] = { + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE +}; + +static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; +static const unsigned char dev_maj[NDEV] = {30, 4, 2}; +static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90}; + +static struct dsk { + unsigned daua; + unsigned type; + unsigned disk; + unsigned unit; + unsigned head; + unsigned sec; + unsigned slice; + unsigned part; + unsigned start; +} dsk; +static char cmd[512], cmddup[512]; +static char kname[1024]; +static uint32_t opts; +static int comspeed = SIOSPD; +static struct bootinfo bootinfo; +static uint8_t ioctrl = IO_KEYBOARD; + +void exit(int); +static void load(void); +static int parse(void); +static int xfsread(ino_t, void *, size_t); +static int dskread(void *, unsigned, unsigned); +static void printf(const char *,...); +static void putchar(int); +static uint32_t memsize(void); +static int drvread(void *, unsigned); +static int keyhit(unsigned); +static int xputc(int); +static int xgetc(int); +static int getc(int); + +static void memcpy(void *, const void *, int); +static void +memcpy(void *dst, const void *src, int len) +{ + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; +} + +static inline int +strcmp(const char *s1, const char *s2) +{ + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; +} + +#define UFS_SMALL_CGBASE +#include "ufsread.c" + +static inline int +xfsread(ino_t inode, void *buf, size_t nbyte) +{ + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; +} + +static inline uint32_t +memsize(void) +{ + u_char *p = (u_char *)PTOV(0); + + return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; +} + +static inline void +getstr(void) +{ + char *s; + int c; + + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } + } +} + +static inline void +putc(int c) +{ + + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = PUTCORG; /* call to putc in boot1 */ + v86.eax = c; + v86int(); + v86.ctl = V86_FLAGS; +} + +static inline int +is_scsi_hd(void) +{ + + if ((*(u_char *)PTOV(0x482) >> dsk.unit) & 0x01) + return 1; + + return 0; +} + +static inline void +fix_sector_size(void) +{ + u_char *p; + + p = (u_char *)PTOV(0x460 + dsk.unit * 4); /* SCSI equipment parameter */ + + if ((p[0] & 0x1f) == 7) { /* SCSI MO */ + if (!(p[3] & 0x30)) { /* 256B / sector */ + p[3] |= 0x10; /* forced set 512B / sector */ + p[3 + 0xa1000] |= 0x10; + } + } +} + +static inline uint32_t +get_diskinfo(void) +{ + + if (dsk.disk == 0x30) { /* 1440KB FD */ + /* 80 cylinders, 2 heads, 18 sectors */ + return (80 << 16) | (2 << 8) | 18; + } else if (dsk.disk == 0x90) { /* 1200KB FD */ + /* 80 cylinders, 2 heads, 15 sectors */ + return (80 << 16) | (2 << 8) | 15; + } else if (dsk.disk == 0x80 || is_scsi_hd()) { /* IDE or SCSI HDD */ + v86.addr = 0x1b; + v86.eax = 0x8400 | dsk.daua; + v86int(); + return (v86.ecx << 16) | v86.edx; + } + + /* SCSI MO or CD */ + fix_sector_size(); /* SCSI MO */ + + /* other SCSI devices */ + return (65535 << 16) | (8 << 8) | 32; +} + +static void +set_dsk(void) +{ + uint32_t di; + + di = get_diskinfo(); + + dsk.head = (di >> 8) & 0xff; + dsk.sec = di & 0xff; + dsk.start = 0; +} + +#ifdef GET_BIOSGEOM +static uint32_t +bd_getbigeom(int bunit) +{ + int hds = 0; + int unit = 0x80; /* IDE HDD */ + u_int addr = 0x55d; + + while (unit < 0xa7) { + if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f))) + if (hds++ == bunit) + break; + + if (unit >= 0xA0) { + int media = ((unsigned *)PTOV(0x460))[unit & 0x0F] & 0x1F; + + if (media == 7 && hds++ == bunit) /* SCSI MO */ + return(0xFFFE0820); /* C:65535 H:8 S:32 */ + } + if (++unit == 0x84) { + unit = 0xA0; /* SCSI HDD */ + addr = 0x482; + } + } + if (unit == 0xa7) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + v86.addr = 0x1b; + v86.eax = 0x8400 | unit; + v86int(); + if (v86.efl & 0x1) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); +} +#endif + +static int +check_slice(void) +{ + struct pc98_partition *dp; + char *sec; + unsigned i, cyl; + + sec = dmadat->secbuf; + cyl = *(uint16_t *)PTOV(ARGS); + set_dsk(); + + if (dsk.type == TYPE_FD) + return (WHOLE_DISK_SLICE); + if (drvread(sec, DOSBBSECTOR + 1)) + return (WHOLE_DISK_SLICE); /* Read error */ + dp = (void *)(sec + DOSPARTOFF); + for (i = 0; i < NDOSPART; i++) { + if (dp[i].dp_mid == DOSMID_386BSD) { + if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl) + return (BASE_SLICE + i); + } + } + + return (WHOLE_DISK_SLICE); +} + +int +main(void) +{ +#ifdef GET_BIOSGEOM + int i; +#endif + int autoboot; + ino_t ino; + + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.daua = *(uint8_t *)PTOV(0x584); + dsk.disk = dsk.daua & DRV_DISK; + dsk.unit = dsk.daua & DRV_UNIT; + if (dsk.disk == 0x80) + dsk.type = TYPE_AD; + else if (dsk.disk == 0xa0) + dsk.type = TYPE_DA; + else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */ + dsk.type = TYPE_FD; + dsk.slice = check_slice(); +#ifdef GET_BIOSGEOM + for (i = 0; i < N_BIOS_GEOM; i++) + bootinfo.bi_bios_geom[i] = bd_getbigeom(i); +#endif + bootinfo.bi_version = BOOTINFO_VERSION; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 14:30:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A781065670; Fri, 15 Jan 2010 14:30:20 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A68EB8FC28; Fri, 15 Jan 2010 14:30:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FEUKuT098783; Fri, 15 Jan 2010 14:30:20 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FEUKpR098780; Fri, 15 Jan 2010 14:30:20 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001151430.o0FEUKpR098780@svn.freebsd.org> From: Antoine Brodin Date: Fri, 15 Jan 2010 14:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202362 - in stable/7: etc/mtree share/examples X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 14:30:20 -0000 Author: antoine Date: Fri Jan 15 14:30:20 2010 New Revision: 202362 URL: http://svn.freebsd.org/changeset/base/202362 Log: MFC r200440 to stable/7: Install firmware(9) examples. Modified: stable/7/etc/mtree/BSD.usr.dist stable/7/share/examples/Makefile Directory Properties: stable/7/etc/ (props changed) stable/7/share/examples/ (props changed) Modified: stable/7/etc/mtree/BSD.usr.dist ============================================================================== --- stable/7/etc/mtree/BSD.usr.dist Fri Jan 15 14:24:32 2010 (r202361) +++ stable/7/etc/mtree/BSD.usr.dist Fri Jan 15 14:30:20 2010 (r202362) @@ -238,6 +238,12 @@ .. dyn_sysctl .. + firmware + fwconsumer + .. + fwimage + .. + .. syscall module .. Modified: stable/7/share/examples/Makefile ============================================================================== --- stable/7/share/examples/Makefile Fri Jan 15 14:24:32 2010 (r202361) +++ stable/7/share/examples/Makefile Fri Jan 15 14:30:20 2010 (r202362) @@ -118,6 +118,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/dyn_sysctl/Makefile \ kld/dyn_sysctl/README \ kld/dyn_sysctl/dyn_sysctl.c \ + kld/firmware/Makefile \ + kld/firmware/README \ + kld/firmware/fwconsumer/Makefile \ + kld/firmware/fwconsumer/fw_consumer.c \ + kld/firmware/fwimage/Makefile \ + kld/firmware/fwimage/firmware.img \ kld/syscall/Makefile \ kld/syscall/module/Makefile \ kld/syscall/module/syscall.c \ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:16:50 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 639751065676; Fri, 15 Jan 2010 15:16:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3732A8FC12; Fri, 15 Jan 2010 15:16:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFGoJC009340; Fri, 15 Jan 2010 15:16:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFGod0009338; Fri, 15 Jan 2010 15:16:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151516.o0FFGod0009338@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202367 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:16:50 -0000 Author: marius Date: Fri Jan 15 15:16:49 2010 New Revision: 202367 URL: http://svn.freebsd.org/changeset/base/202367 Log: MFC: r177108 (partial) Suppress excessive output while netbooting via loader, unless debugging. Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:10:29 2010 (r202366) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:16:49 2010 (r202367) @@ -245,7 +245,8 @@ net_getparams(sock) printf("net_open: bootparam/whoami RPC failed\n"); return (EIO); } - printf("net_open: client name: %s\n", hostname); + if (debug) + printf("net_open: client name: %s\n", hostname); /* * Ignore the gateway from whoami (unreliable). @@ -259,10 +260,11 @@ net_getparams(sock) } if (smask) { netmask = smask; - printf("net_open: subnet mask: %s\n", intoa(netmask)); + if (debug) + printf("net_open: subnet mask: %s\n", intoa(netmask)); } - if (gateip.s_addr) - printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); + if (gateip.s_addr && debug) + printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -270,7 +272,7 @@ net_getparams(sock) return (EIO); } exit: - /* + /* * If present, strip the server's address off of the rootpath * before passing it along. This allows us to be compatible with * the kernel's diskless (BOOTP_NFSROOT) booting conventions @@ -285,8 +287,10 @@ net_getparams(sock) bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } - printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - printf("net_open: server path: %s\n", rootpath); + if (debug) { + printf("net_open: server addr: %s\n", inet_ntoa(rootip)); + printf("net_open: server path: %s\n", rootpath); + } d = socktodesc(sock); sprintf(temp, "%6D", d->myea, ":"); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:23:39 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2374106568B; Fri, 15 Jan 2010 15:23:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE2038FC1F; Fri, 15 Jan 2010 15:23:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFNcp2010889; Fri, 15 Jan 2010 15:23:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFNcZJ010886; Fri, 15 Jan 2010 15:23:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151523.o0FFNcZJ010886@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202368 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:23:39 -0000 Author: marius Date: Fri Jan 15 15:23:38 2010 New Revision: 202368 URL: http://svn.freebsd.org/changeset/base/202368 Log: MFC: r182731 Show info about net devices in loader's 'lsdev' command. While there fix style. Modified: stable/7/sys/boot/common/dev_net.c stable/7/sys/boot/common/devopen.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:16:49 2010 (r202367) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:23:38 2010 (r202368) @@ -1,4 +1,4 @@ -/* +/* * $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ */ @@ -90,20 +90,21 @@ static void net_print(int); static int net_getparams(int sock); struct devsw netdev = { - "net", - DEVT_NET, - net_init, - net_strategy, - net_open, - net_close, - noioctl, - net_print + "net", + DEVT_NET, + net_init, + net_strategy, + net_open, + net_close, + noioctl, + net_print }; int net_init(void) { - return 0; + + return (0); } /* @@ -114,76 +115,75 @@ net_init(void) int net_open(struct open_file *f, ...) { - va_list args; - char *devname; /* Device part of file name (or NULL). */ - int error = 0; - - va_start(args, f); - devname = va_arg(args, char*); - va_end(args); - - /* On first open, do netif open, mount, etc. */ - if (netdev_opens == 0) { - /* Find network interface. */ - if (netdev_sock < 0) { - netdev_sock = netif_open(devname); - if (netdev_sock < 0) { - printf("net_open: netif_open() failed\n"); - return (ENXIO); - } - if (debug) - printf("net_open: netif_open() succeeded\n"); - } - if (rootip.s_addr == 0) { - /* Get root IP address, and path, etc. */ - error = net_getparams(netdev_sock); - if (error) { + va_list args; + char *devname; /* Device part of file name (or NULL). */ + int error = 0; + + va_start(args, f); + devname = va_arg(args, char*); + va_end(args); + + /* On first open, do netif open, mount, etc. */ + if (netdev_opens == 0) { + /* Find network interface. */ + if (netdev_sock < 0) { + netdev_sock = netif_open(devname); + if (netdev_sock < 0) { + printf("net_open: netif_open() failed\n"); + return (ENXIO); + } + if (debug) + printf("net_open: netif_open() succeeded\n"); + } + if (rootip.s_addr == 0) { + /* Get root IP address, and path, etc. */ + error = net_getparams(netdev_sock); + if (error) { /* getparams makes its own noise */ - netif_close(netdev_sock); - netdev_sock = -1; - return (error); - } + netif_close(netdev_sock); + netdev_sock = -1; + return (error); + } + } + netdev_opens++; } netdev_opens++; - } - netdev_opens++; - f->f_devdata = &netdev_sock; - return (error); + f->f_devdata = &netdev_sock; + return (error); } int -net_close(f) - struct open_file *f; +net_close(struct open_file *f) { - #ifdef NETIF_DEBUG - if (debug) - printf("net_close: opens=%d\n", netdev_opens); + if (debug) + printf("net_close: opens=%d\n", netdev_opens); #endif - /* On last close, do netif close, etc. */ - f->f_devdata = NULL; - /* Extra close call? */ - if (netdev_opens <= 0) + /* On last close, do netif close, etc. */ + f->f_devdata = NULL; + /* Extra close call? */ + if (netdev_opens <= 0) + return (0); + netdev_opens--; + /* Not last close? */ + if (netdev_opens > 0) + return(0); + rootip.s_addr = 0; + if (netdev_sock >= 0) { + if (debug) + printf("net_close: calling netif_close()\n"); + netif_close(netdev_sock); + netdev_sock = -1; + } return (0); - netdev_opens--; - /* Not last close? */ - if (netdev_opens > 0) - return(0); - rootip.s_addr = 0; - if (netdev_sock >= 0) { - if (debug) - printf("net_close: calling netif_close()\n"); - netif_close(netdev_sock); - netdev_sock = -1; - } - return (0); } int net_strategy() { - return EIO; + + return (EIO); } #define SUPPORT_BOOTP @@ -206,106 +206,118 @@ int try_bootp = 1; extern n_long ip_convertaddr(char *p); static int -net_getparams(sock) - int sock; +net_getparams(int sock) { - char buf[MAXHOSTNAMELEN]; - char temp[FNAME_SIZE]; - struct iodesc *d; - int i; - n_long smask; + char buf[MAXHOSTNAMELEN]; + char temp[FNAME_SIZE]; + struct iodesc *d; + int i; + n_long smask; #ifdef SUPPORT_BOOTP - /* - * Try to get boot info using BOOTP. If we succeed, then - * the server IP address, gateway, and root path will all - * be initialized. If any remain uninitialized, we will - * use RARP and RPC/bootparam (the Sun way) to get them. - */ - if (try_bootp) - bootp(sock, BOOTP_NONE); - if (myip.s_addr != 0) - goto exit; - if (debug) - printf("net_open: BOOTP failed, trying RARP/RPC...\n"); + /* + * Try to get boot info using BOOTP. If we succeed, then + * the server IP address, gateway, and root path will all + * be initialized. If any remain uninitialized, we will + * use RARP and RPC/bootparam (the Sun way) to get them. + */ + if (try_bootp) + bootp(sock, BOOTP_NONE); + if (myip.s_addr != 0) + goto exit; + if (debug) + printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif - /* - * Use RARP to get our IP address. This also sets our - * netmask to the "natural" default for our address. - */ - if (rarp_getipaddress(sock)) { - printf("net_open: RARP failed\n"); - return (EIO); - } - printf("net_open: client addr: %s\n", inet_ntoa(myip)); + /* + * Use RARP to get our IP address. This also sets our + * netmask to the "natural" default for our address. + */ + if (rarp_getipaddress(sock)) { + printf("net_open: RARP failed\n"); + return (EIO); + } + printf("net_open: client addr: %s\n", inet_ntoa(myip)); - /* Get our hostname, server IP address, gateway. */ - if (bp_whoami(sock)) { - printf("net_open: bootparam/whoami RPC failed\n"); - return (EIO); - } - if (debug) - printf("net_open: client name: %s\n", hostname); - - /* - * Ignore the gateway from whoami (unreliable). - * Use the "gateway" parameter instead. - */ - smask = 0; - gateip.s_addr = 0; - if (bp_getfile(sock, "gateway", &gateip, buf) == 0) { - /* Got it! Parse the netmask. */ - smask = ip_convertaddr(buf); - } - if (smask) { - netmask = smask; - if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); - } - if (gateip.s_addr && debug) - printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); - - /* Get the root server and pathname. */ - if (bp_getfile(sock, "root", &rootip, rootpath)) { - printf("net_open: bootparam/getfile RPC failed\n"); - return (EIO); - } - exit: - /* - * If present, strip the server's address off of the rootpath - * before passing it along. This allows us to be compatible with - * the kernel's diskless (BOOTP_NFSROOT) booting conventions - */ - for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) - if (rootpath[i] == ':') - break; - if (i && i != FNAME_SIZE && rootpath[i] == ':') { - rootpath[i++] = '\0'; - if (inet_addr(&rootpath[0]) != INADDR_NONE) - rootip.s_addr = inet_addr(&rootpath[0]); - bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); - bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); - } - if (debug) { - printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - printf("net_open: server path: %s\n", rootpath); - } - - d = socktodesc(sock); - sprintf(temp, "%6D", d->myea, ":"); - setenv("boot.netif.ip", inet_ntoa(myip), 1); - setenv("boot.netif.netmask", intoa(netmask), 1); - setenv("boot.netif.gateway", inet_ntoa(gateip), 1); - setenv("boot.netif.hwaddr", temp, 1); - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); + /* Get our hostname, server IP address, gateway. */ + if (bp_whoami(sock)) { + printf("net_open: bootparam/whoami RPC failed\n"); + return (EIO); + } + if (debug) + printf("net_open: client name: %s\n", hostname); + + /* + * Ignore the gateway from whoami (unreliable). + * Use the "gateway" parameter instead. + */ + smask = 0; + gateip.s_addr = 0; + if (bp_getfile(sock, "gateway", &gateip, buf) == 0) { + /* Got it! Parse the netmask. */ + smask = ip_convertaddr(buf); + } + if (smask) { + netmask = smask; + if (debug) + printf("net_open: subnet mask: %s\n", intoa(netmask)); + } + if (gateip.s_addr && debug) + printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); - return (0); + /* Get the root server and pathname. */ + if (bp_getfile(sock, "root", &rootip, rootpath)) { + printf("net_open: bootparam/getfile RPC failed\n"); + return (EIO); + } +exit: + /* + * If present, strip the server's address off of the rootpath + * before passing it along. This allows us to be compatible with + * the kernel's diskless (BOOTP_NFSROOT) booting conventions + */ + for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) + if (rootpath[i] == ':') + break; + if (i && i != FNAME_SIZE && rootpath[i] == ':') { + rootpath[i++] = '\0'; + if (inet_addr(&rootpath[0]) != INADDR_NONE) + rootip.s_addr = inet_addr(&rootpath[0]); + bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); + bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); + } + if (debug) { + printf("net_open: server addr: %s\n", inet_ntoa(rootip)); + printf("net_open: server path: %s\n", rootpath); + } + + d = socktodesc(sock); + sprintf(temp, "%6D", d->myea, ":"); + setenv("boot.netif.ip", inet_ntoa(myip), 1); + setenv("boot.netif.netmask", intoa(netmask), 1); + setenv("boot.netif.gateway", inet_ntoa(gateip), 1); + setenv("boot.netif.hwaddr", temp, 1); + setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); + setenv("boot.nfsroot.path", rootpath, 1); + + return (0); } static void net_print(int verbose) { - return; + struct netif_driver *drv; + int i, d, cnt; + + cnt = 0; + for (d = 0; netif_drivers[d]; d++) { + drv = netif_drivers[d]; + for (i = 0; i < drv->netif_nifs; i++) { + printf("\t%s%d:", "net", cnt++); + if (verbose) + printf(" (%s%d)", drv->netif_bname, + drv->netif_ifs[i].dif_unit); + } + } + printf("\n"); } Modified: stable/7/sys/boot/common/devopen.c ============================================================================== --- stable/7/sys/boot/common/devopen.c Fri Jan 15 15:16:49 2010 (r202367) +++ stable/7/sys/boot/common/devopen.c Fri Jan 15 15:23:38 2010 (r202368) @@ -35,32 +35,33 @@ __FBSDID("$FreeBSD$"); int devopen(struct open_file *f, const char *fname, const char **file) { - struct devdesc *dev; - int result; + struct devdesc *dev; + int result; - result = archsw.arch_getdev((void **)&dev, fname, file); - if (result) - return (result); + result = archsw.arch_getdev((void **)&dev, fname, file); + if (result) + return (result); - /* point to device-specific data so that device open can use it */ - f->f_devdata = dev; - result = dev->d_dev->dv_open(f, dev); - if (result != 0) { - f->f_devdata = NULL; - free(dev); - return (result); - } + /* point to device-specific data so that device open can use it */ + f->f_devdata = dev; + result = dev->d_dev->dv_open(f, dev); + if (result != 0) { + f->f_devdata = NULL; + free(dev); + return (result); + } - /* reference the devsw entry from the open_file structure */ - f->f_dev = dev->d_dev; - return (0); + /* reference the devsw entry from the open_file structure */ + f->f_dev = dev->d_dev; + return (0); } int devclose(struct open_file *f) { - if (f->f_devdata != NULL) { - free(f->f_devdata); - } - return(0); + + if (f->f_devdata != NULL) { + free(f->f_devdata); + } + return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:26:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB091065782; Fri, 15 Jan 2010 15:26:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0ECC8FC14; Fri, 15 Jan 2010 15:26:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFQ32O011481; Fri, 15 Jan 2010 15:26:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFQ3ig011479; Fri, 15 Jan 2010 15:26:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151526.o0FFQ3ig011479@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202369 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:26:04 -0000 Author: marius Date: Fri Jan 15 15:26:03 2010 New Revision: 202369 URL: http://svn.freebsd.org/changeset/base/202369 Log: MFC: r200945 - Consistently wrap debugging in NETIF_DEBUG. This basically merges NetBSD rev 1.19. - Make the functions match their prototypes regarding static. Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:23:38 2010 (r202368) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:26:03 2010 (r202369) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #include "bootstrap.h" +#ifdef NETIF_DEBUG int debug = 0; +#endif static int netdev_sock = -1; static int netdev_opens; @@ -100,7 +102,7 @@ struct devsw netdev = { net_print }; -int +static int net_init(void) { @@ -112,7 +114,7 @@ net_init(void) * This opens the low-level device and sets f->f_devdata. * This is declared with variable arguments... */ -int +static int net_open(struct open_file *f, ...) { va_list args; @@ -132,8 +134,10 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } +#ifdef NETIF_DEBUG if (debug) - printf("net_open: netif_open() succeeded\n"); + printf("net_open: netif_open() succeeded\n"); +#endif } if (rootip.s_addr == 0) { /* Get root IP address, and path, etc. */ @@ -152,7 +156,7 @@ net_open(struct open_file *f, ...) return (error); } -int +static int net_close(struct open_file *f) { #ifdef NETIF_DEBUG @@ -171,15 +175,17 @@ net_close(struct open_file *f) return(0); rootip.s_addr = 0; if (netdev_sock >= 0) { +#ifdef NETIF_DEBUG if (debug) printf("net_close: calling netif_close()\n"); +#endif netif_close(netdev_sock); netdev_sock = -1; } return (0); } -int +static int net_strategy() { @@ -225,9 +231,11 @@ net_getparams(int sock) bootp(sock, BOOTP_NONE); if (myip.s_addr != 0) goto exit; +#ifdef NETIF_DEBUG if (debug) printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif +#endif /* * Use RARP to get our IP address. This also sets our @@ -244,8 +252,10 @@ net_getparams(int sock) printf("net_open: bootparam/whoami RPC failed\n"); return (EIO); } +#ifdef NETIF_DEBUG if (debug) printf("net_open: client name: %s\n", hostname); +#endif /* * Ignore the gateway from whoami (unreliable). @@ -259,11 +269,15 @@ net_getparams(int sock) } if (smask) { netmask = smask; +#ifdef NETIF_DEBUG if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); + printf("net_open: subnet mask: %s\n", intoa(netmask)); +#endif } +#ifdef NETIF_DEBUG if (gateip.s_addr && debug) printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); +#endif /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -286,10 +300,12 @@ exit: bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } +#ifdef NETIF_DEBUG if (debug) { printf("net_open: server addr: %s\n", inet_ntoa(rootip)); printf("net_open: server path: %s\n", rootpath); } +#endif d = socktodesc(sock); sprintf(temp, "%6D", d->myea, ":"); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:28:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73D6310656B3; Fri, 15 Jan 2010 15:28:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613CB8FC16; Fri, 15 Jan 2010 15:28:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFSwM5012279; Fri, 15 Jan 2010 15:28:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFSw86012277; Fri, 15 Jan 2010 15:28:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151528.o0FFSw86012277@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202372 - stable/7/sys/boot/sparc64/loader X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:28:58 -0000 Author: marius Date: Fri Jan 15 15:28:58 2010 New Revision: 202372 URL: http://svn.freebsd.org/changeset/base/202372 Log: MFC: r200946 Execute the cleanup handlers before jumping to the kernel just like the other architectures do. Modified: stable/7/sys/boot/sparc64/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Fri Jan 15 15:28:57 2010 (r202371) +++ stable/7/sys/boot/sparc64/loader/main.c Fri Jan 15 15:28:58 2010 (r202372) @@ -387,6 +387,8 @@ __elfN(exec)(struct preloaded_file *fp) pmap_print_tlb_sun4u(); #endif + dev_cleanup(); + entry = e->e_entry; OF_release((void *)heapva, HEAPSZ); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:36:24 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87F4D1065695; Fri, 15 Jan 2010 15:36:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 758B38FC31; Fri, 15 Jan 2010 15:36:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFaOGx013993; Fri, 15 Jan 2010 15:36:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFaO2v013991; Fri, 15 Jan 2010 15:36:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151536.o0FFaO2v013991@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202374 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:36:24 -0000 Author: marius Date: Fri Jan 15 15:36:24 2010 New Revision: 202374 URL: http://svn.freebsd.org/changeset/base/202374 Log: MFC: r200947 Add missing locking in intr_bind(). Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Fri Jan 15 15:36:12 2010 (r202373) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Fri Jan 15 15:36:24 2010 (r202374) @@ -451,13 +451,19 @@ int intr_bind(int vec, u_char cpu) { struct intr_vector *iv; + int error; if (vec < 0 || vec >= IV_MAX) return (EINVAL); + sx_xlock(&intr_table_lock); iv = &intr_vectors[vec]; - if (iv == NULL) + if (iv == NULL) { + sx_xunlock(&intr_table_lock); return (EINVAL); - return (intr_event_bind(iv->iv_event, cpu)); + } + error = intr_event_bind(iv->iv_event, cpu); + sx_xunlock(&intr_table_lock); + return (error); } /* From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:38:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C6941065676; Fri, 15 Jan 2010 15:38:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39B778FC31; Fri, 15 Jan 2010 15:38:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFcshA014765; Fri, 15 Jan 2010 15:38:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFcseu014763; Fri, 15 Jan 2010 15:38:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151538.o0FFcseu014763@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202378 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:38:54 -0000 Author: marius Date: Fri Jan 15 15:38:53 2010 New Revision: 202378 URL: http://svn.freebsd.org/changeset/base/202378 Log: - Hook up the default implementations of the MSI/MSI-X pcib_if methods so requests may bubble up to a host-PCI bridge driver. - Distinguish between PCI and PCIe bridges in the device description so it's a bit easier to follow what hangs off of what in the dmesg. Unfortunately we can't also tell PCI and PCI-X apart based on the information provided in the OFW device tree. - Add quirk handling for the ALi M5249 found in Fire-based machines which are used as a PCIe-PCIe bridge there. These are obviously subtractive decoding as as they have a PCI-ISA bridge on their secondary side (and likewise don't include the ISA I/O range in their bridge decode) but don't indicate this via the class code. Given that this quirk isn't likely to apply to all ALi M5249 and I have no datasheet for these chips so I could implement a check using the chip specific bits enabling subtractive decoding this quirk handling is added to the MD code rather than the MI one. Modified: stable/7/sys/sparc64/pci/ofw_pcib.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcib.c Fri Jan 15 15:38:49 2010 (r202377) +++ stable/7/sys/sparc64/pci/ofw_pcib.c Fri Jan 15 15:38:53 2010 (r202378) @@ -3,6 +3,7 @@ * Copyright (c) 2000 Michael Smith * Copyright (c) 2000 BSDi * Copyright (c) 2001 - 2003 Thomas Moestl + * Copyright (c) 2009 by Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include "opt_ofw_pci.h" #include -#include #include +#include +#include #include #include @@ -83,6 +85,11 @@ static device_method_t ofw_pcib_methods[ DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), @@ -100,19 +107,49 @@ MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) { + char desc[sizeof("OFW PCIe-PCIe bridge")]; + const char *dtype, *pbdtype; + +#define ISDTYPE(dtype, type) \ + (((dtype) != NULL) && strcmp((dtype), (type)) == 0) if ((pci_get_class(dev) == PCIC_BRIDGE) && (pci_get_subclass(dev) == PCIS_BRIDGE_PCI) && ofw_bus_get_node(dev) != 0) { - device_set_desc(dev, "OFW PCI-PCI bridge"); + dtype = ofw_bus_get_type(dev); + pbdtype = ofw_bus_get_type(device_get_parent( + device_get_parent(dev))); + snprintf(desc, sizeof(desc), "OFW PCI%s-PCI%s bridge", + ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "", + ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : ""); + device_set_desc_copy(dev, desc); return (0); } + +#undef ISDTYPE + return (ENXIO); } static int ofw_pcib_attach(device_t dev) { + struct ofw_pcib_gen_softc *sc; + + sc = device_get_softc(dev); + + /* Quirk handling */ + switch (pci_get_devid(dev)) { + /* + * The ALi M5249 found in Fire-based machines by definition must me + * subtractive as they have a ISA bridge on their secondary side but + * don't indicate this in the class code although the ISA I/O range + * isn't included in their bridge decode. + */ + case 0x524910b9: + sc->ops_pcib_sc.flags |= PCIB_SUBTRACTIVE; + break; + } ofw_pcib_gen_setup(dev); pcib_attach_common(dev); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:41:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E9F106568B; Fri, 15 Jan 2010 15:41:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31CBD8FC30; Fri, 15 Jan 2010 15:41:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFf5A3015387; Fri, 15 Jan 2010 15:41:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFf51t015383; Fri, 15 Jan 2010 15:41:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151541.o0FFf51t015383@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202381 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:41:05 -0000 Author: marius Date: Fri Jan 15 15:41:04 2010 New Revision: 202381 URL: http://svn.freebsd.org/changeset/base/202381 Log: MFC: r201003 Style changes Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h stable/7/sys/dev/mk48txx/mk48txxvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:40:44 2010 (r202380) +++ stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:41:04 2010 (r202381) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines. + * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines */ #include @@ -59,17 +59,17 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" -static uint8_t mk48txx_def_nvrd(device_t, int); -static void mk48txx_def_nvwr(device_t, int, uint8_t); -static void mk48txx_watchdog(void *, u_int, int *); +static uint8_t mk48txx_def_nvrd(device_t dev, int off); +static void mk48txx_def_nvwr(device_t dev, int off, uint8_t v); +static void mk48txx_watchdog(void *arg, u_int cmd, int *error); -struct { +static const struct { const char *name; bus_size_t nvramsz; bus_size_t clkoff; - int flags; -#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set */ -} mk48txx_models[] = { + u_int flags; +#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set. */ +} const mk48txx_models[] = { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, @@ -112,7 +112,7 @@ mk48txx_attach(device_t dev) if (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS) { mtx_lock(&sc->sc_mtx); - if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & + if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & MK48TXX_FLAGS_BL) { mtx_unlock(&sc->sc_mtx); device_printf(dev, "%s: battery low\n", __func__); @@ -140,7 +140,7 @@ mk48txx_attach(device_t dev) } } - clock_register(dev, 1000000); /* 1 second resolution. */ + clock_register(dev, 1000000); /* 1 second resolution */ if ((sc->sc_flag & MK48TXX_WDOG_REGISTER) && (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS)) { Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:40:44 2010 (r202380) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:41:04 2010 (r202381) @@ -59,23 +59,23 @@ * The first bank of eight registers at offset (nvramsz - 16) is * available only on recenter (which?) MK48Txx models. */ -#define MK48TXX_FLAGS 0 /* flags register */ -#define MK48TXX_UNUSED 1 /* unused */ -#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ -#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ -#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ -#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ -#define MK48TXX_INTR 6 /* interrupts register */ -#define MK48TXX_WDOG 7 /* watchdog register */ - -#define MK48TXX_ICSR 8 /* control register */ -#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ -#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ -#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ -#define MK48TXX_IWDAY 12 /* weekday (1..7) */ -#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ -#define MK48TXX_IMON 14 /* month (1..12; BCD) */ -#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ +#define MK48TXX_FLAGS 0 /* flags register */ +#define MK48TXX_UNUSED 1 /* unused */ +#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ +#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ +#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ +#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ +#define MK48TXX_INTR 6 /* interrupts register */ +#define MK48TXX_WDOG 7 /* watchdog register */ + +#define MK48TXX_ICSR 8 /* control register */ +#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ +#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ +#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ +#define MK48TXX_IWDAY 12 /* weekday (1..7) */ +#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ +#define MK48TXX_IMON 14 /* month (1..12; BCD) */ +#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ /* * Note that some of the bits below that are not in the first eight @@ -84,80 +84,80 @@ */ /* Bits in the flags register (extended only) */ -#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ -#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ -#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ +#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ +#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ +#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ /* Bits in the alarm seconds register (extended only) */ -#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ -#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ +#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ +#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ /* Bits in the alarm minutes register (extended only) */ -#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ -#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ +#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ +#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ /* Bits in the alarm hours register (extended only) */ -#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ -#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ +#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ +#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ /* Bits in the alarm day in month register (extended only) */ -#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ -#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ +#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ +#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ /* Bits in the interrupts register (extended only) */ -#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ -#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ +#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ +#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ /* Bits in the watchdog register (extended only) */ -#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ -#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ -#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ -#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ -#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ -#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ -#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ +#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ +#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ +#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ +#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ +#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ +#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ +#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ /* Bits in the control register */ -#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ -#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ -#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ -#define MK48TXX_CSR_WRITE 0x80 /* want to write */ +#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ +#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ +#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ +#define MK48TXX_CSR_WRITE 0x80 /* want to write */ /* Bits in the seconds register */ -#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ -#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ +#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ +#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ /* Bits in the minutes register */ -#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ +#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ /* Bits in the hours register */ -#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ +#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ /* Bits in the century/weekday register */ -#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ -#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ -#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ -#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ -#define MK48TXX_WDAY_FT 0x40 /* frequency test */ +#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ +#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ +#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ +#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ +#define MK48TXX_WDAY_FT 0x40 /* frequency test */ /* Bits in the day in month register */ -#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ +#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ /* Bits in the month register */ -#define MK48TXX_MON_MASK 0x1f /* mask for month */ +#define MK48TXX_MON_MASK 0x1f /* mask for month */ /* Bits in the year register */ -#define MK48TXX_YEAR_MASK 0xff /* mask for year */ +#define MK48TXX_YEAR_MASK 0xff /* mask for year */ /* Model specific NVRAM sizes and clock offsets */ -#define MK48T02_CLKSZ 2048 -#define MK48T02_CLKOFF 0x7f0 +#define MK48T02_CLKSZ 2048 +#define MK48T02_CLKOFF 0x7f0 -#define MK48T08_CLKSZ 8192 -#define MK48T08_CLKOFF 0x1ff0 +#define MK48T08_CLKSZ 8192 +#define MK48T08_CLKOFF 0x1ff0 -#define MK48T18_CLKSZ 8192 -#define MK48T18_CLKOFF 0x1ff0 +#define MK48T18_CLKSZ 8192 +#define MK48T18_CLKOFF 0x1ff0 -#define MK48T59_CLKSZ 8192 -#define MK48T59_CLKOFF 0x1ff0 +#define MK48T59_CLKSZ 8192 +#define MK48T59_CLKOFF 0x1ff0 Modified: stable/7/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:40:44 2010 (r202380) +++ stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:41:04 2010 (r202381) @@ -38,8 +38,8 @@ * $FreeBSD$ */ -typedef uint8_t (*mk48txx_nvrd_t)(device_t, int); -typedef void (*mk48txx_nvwr_t)(device_t, int, uint8_t); +typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); +typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); struct mk48txx_softc { bus_space_tag_t sc_bst; /* bus space tag */ @@ -53,17 +53,17 @@ struct mk48txx_softc { bus_size_t sc_clkoffset; /* Offset in NVRAM to clock bits */ u_int sc_year0; /* year counter offset */ u_int sc_flag; /* MD flags */ -#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ -#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ -#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ +#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ +#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ +#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ mk48txx_nvrd_t sc_nvrd; /* NVRAM/RTC read function */ mk48txx_nvwr_t sc_nvwr; /* NVRAM/RTC write function */ }; /* Chip attach function */ -int mk48txx_attach(device_t); +int mk48txx_attach(device_t dev); /* Methods for the clock interface */ -int mk48txx_gettime(device_t, struct timespec *); -int mk48txx_settime(device_t, struct timespec *); +int mk48txx_gettime(device_t dev, struct timespec *ts); +int mk48txx_settime(device_t dev, struct timespec *ts); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:42:17 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0382910656A5; Fri, 15 Jan 2010 15:42:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45CC8FC14; Fri, 15 Jan 2010 15:42:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFgG16015760; Fri, 15 Jan 2010 15:42:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFgG8U015756; Fri, 15 Jan 2010 15:42:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151542.o0FFgG8U015756@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202383 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:42:17 -0000 Author: marius Date: Fri Jan 15 15:42:16 2010 New Revision: 202383 URL: http://svn.freebsd.org/changeset/base/202383 Log: MFC: r201004 Remove clause 3 and 4 from TNF licenses. Obtained from: NetBSD Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h stable/7/sys/dev/mk48txx/mk48txxvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:42:14 2010 (r202382) +++ stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:42:16 2010 (r202383) @@ -13,13 +13,6 @@ * 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 the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txx.c,v 1.15 2004/07/05 09:24:31 pk Exp + * $NetBSD: mk48txx.c,v 1.25 2008/04/28 20:23:50 martin Exp $ */ #include Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:42:14 2010 (r202382) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:42:16 2010 (r202383) @@ -13,13 +13,6 @@ * 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 the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txxreg.h,v 1.7 2003/11/01 22:41:42 tsutsui Exp + * $NetBSD: mk48txxreg.h,v 1.10 2008/04/28 20:23:50 martin Exp $ * * $FreeBSD$ */ Modified: stable/7/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:42:14 2010 (r202382) +++ stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:42:16 2010 (r202383) @@ -13,13 +13,6 @@ * 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 the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txxvar.h,v 1.1 2003/11/01 22:41:42 tsutsui Exp + * $NetBSD: mk48txxvar.h,v 1.6 2008/04/28 20:23:50 martin Exp $ * * $FreeBSD$ */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:47:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5387A1065672; Fri, 15 Jan 2010 15:47:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401988FC1D; Fri, 15 Jan 2010 15:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFlWh1017059; Fri, 15 Jan 2010 15:47:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFlWFx017053; Fri, 15 Jan 2010 15:47:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151547.o0FFlWFx017053@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202385 - in stable/7/sys: dev/mk48txx sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:47:32 -0000 Author: marius Date: Fri Jan 15 15:47:31 2010 New Revision: 202385 URL: http://svn.freebsd.org/changeset/base/202385 Log: MFC: r201005, r201371 - Take advantage of bus_{read,write}_*(9). - Set dow = -1 in mk48txx_gettime() because some drivers (for example the NetBSD and OpenBSD mk48txx(4)) don't set it correctly. Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxvar.h stable/7/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:47:31 2010 (r202384) +++ stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:47:31 2010 (r202385) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -175,8 +176,16 @@ mk48txx_gettime(device_t dev, struct tim ct.min = FROMBCD(FROMREG(MK48TXX_IMIN, MK48TXX_MIN_MASK)); ct.hour = FROMBCD(FROMREG(MK48TXX_IHOUR, MK48TXX_HOUR_MASK)); ct.day = FROMBCD(FROMREG(MK48TXX_IDAY, MK48TXX_DAY_MASK)); +#if 0 /* Map dow from 1 - 7 to 0 - 6; FROMBCD() isn't necessary here. */ ct.dow = FROMREG(MK48TXX_IWDAY, MK48TXX_WDAY_MASK) - 1; +#else + /* + * Set dow = -1 because some drivers (for example the NetBSD and + * OpenBSD mk48txx(4)) don't set it correctly. + */ + ct.dow = -1; +#endif ct.mon = FROMBCD(FROMREG(MK48TXX_IMON, MK48TXX_MON_MASK)); year = FROMBCD(FROMREG(MK48TXX_IYEAR, MK48TXX_YEAR_MASK)); year += sc->sc_year0; @@ -266,7 +275,7 @@ mk48txx_def_nvrd(device_t dev, int off) struct mk48txx_softc *sc; sc = device_get_softc(dev); - return (bus_space_read_1(sc->sc_bst, sc->sc_bsh, off)); + return (bus_read_1(sc->sc_res, off)); } static void @@ -275,7 +284,7 @@ mk48txx_def_nvwr(device_t dev, int off, struct mk48txx_softc *sc; sc = device_get_softc(dev); - bus_space_write_1(sc->sc_bst, sc->sc_bsh, off, v); + bus_write_1(sc->sc_res, off, v); } static void Modified: stable/7/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:47:31 2010 (r202384) +++ stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:47:31 2010 (r202385) @@ -35,8 +35,7 @@ typedef uint8_t (*mk48txx_nvrd_t)(device typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); struct mk48txx_softc { - bus_space_tag_t sc_bst; /* bus space tag */ - bus_space_handle_t sc_bsh; /* bus space handle */ + struct resource *sc_res;/* bus resource */ struct mtx sc_mtx; /* hardware mutex */ eventhandler_tag sc_wet; /* watchdog event handler tag */ Modified: stable/7/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/7/sys/sparc64/sparc64/eeprom.c Fri Jan 15 15:47:31 2010 (r202384) +++ stable/7/sys/sparc64/sparc64/eeprom.c Fri Jan 15 15:47:31 2010 (r202385) @@ -107,7 +107,7 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { - + if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); @@ -119,7 +119,6 @@ static int eeprom_attach(device_t dev) { struct mk48txx_softc *sc; - struct resource *res; struct timespec ts; int error, rid; @@ -128,14 +127,13 @@ eeprom_attach(device_t dev) mtx_init(&sc->sc_mtx, "eeprom_mtx", NULL, MTX_DEF); rid = 0; - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) { + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_res == NULL) { device_printf(dev, "cannot allocate resources\n"); error = ENXIO; goto fail_mtx; } - sc->sc_bst = rman_get_bustag(res); - sc->sc_bsh = rman_get_bushandle(res); if ((sc->sc_model = ofw_bus_get_model(dev)) == NULL) { device_printf(dev, "cannot determine model\n"); @@ -180,7 +178,7 @@ eeprom_attach(device_t dev) return (0); fail_res: - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_res); fail_mtx: mtx_destroy(&sc->sc_mtx); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:21:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97AC31065676; Fri, 15 Jan 2010 16:21:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845D78FC17; Fri, 15 Jan 2010 16:21:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGLWHl025017; Fri, 15 Jan 2010 16:21:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGLWhG025014; Fri, 15 Jan 2010 16:21:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151621.o0FGLWhG025014@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202388 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:21:32 -0000 Author: marius Date: Fri Jan 15 16:21:32 2010 New Revision: 202388 URL: http://svn.freebsd.org/changeset/base/202388 Log: MFC: r201007 Add a man page for mk48txx(4). Requested by: n_hibma Obtained from: NetBSD (original version) Added: stable/7/share/man/man4/mk48txx.4 - copied unchanged from r201006, head/share/man/man4/mk48txx.4 Modified: stable/7/share/man/man4/Makefile Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Fri Jan 15 16:04:30 2010 (r202387) +++ stable/7/share/man/man4/Makefile Fri Jan 15 16:21:32 2010 (r202388) @@ -180,6 +180,7 @@ MAN= aac.4 \ meteor.4 \ mfi.4 \ miibus.4 \ + mk48txx.4 \ mlx.4 \ mly.4 \ mmc.4 \ Copied: stable/7/share/man/man4/mk48txx.4 (from r201006, head/share/man/man4/mk48txx.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/mk48txx.4 Fri Jan 15 16:21:32 2010 (r202388, copy of r201006, head/share/man/man4/mk48txx.4) @@ -0,0 +1,230 @@ +.\" $NetBSD: mk48txx.4,v 1.16 2009/04/10 17:14:07 joerg Exp $ +.\" +.\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Paul Kranenburg. +.\" +.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +.\" +.\" $FreeBSD$ +.\" +.Dd December 25, 2009 +.Dt MK48TXX 4 +.Os +.Sh NAME +.Nm mk48txx +.Nd +.Tn Mostek +time-of-day clock driver +.Sh SYNOPSIS +.In sys/eventhandler.h +.In sys/lock.h +.In sys/mutex.h +.In dev/mk48txx/mk48txxvar.h +.Pp +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mk48txx" +.Ed +.Sh DESCRIPTION +The +.Nm +driver is a back-end for several models of +.Tn Mostek +time-of-day clock chips. +It provides access methods to retrieve and set date and time for use with the +.Dq Li clock +KOBJ interface. +.Pp +To tie an instance of this device to the system, use the +.Fn mk48txx_attach +function and the mk48txx_softc structure defined as follows: +.Pp +.Ft "int" +.Fn mk48txx_attach "device_t dev" +.Pp +.Bd -literal +typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); +typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); +.Ed +.Bd -literal +struct mk48txx_softc { + struct resource sc_res; + struct mtx sc_mtx; + eventhandler_tag sc_wet; + const char *sc_model; + bus_size_t sc_nvramsz; + bus_size_t sc_clkoffset; + u_int sc_year0; + u_int sc_flag; + mk48txx_nvrd_t sc_nvrd; + mk48txx_nvwr_t sc_nvwr; +}; +.Ed +.Pp +.Bl -tag -width indent +.It Fa sc_res +The bus resource used for accessing the chip's non-volatile memory +.Pq including the clock registers , +which must be supplied by the front-end when using the default access methods +.Pq see below . +Otherwise this member is optional. +.It Fa sc_mtx +The hardware mutex used when accessing the chip's non-volatile memory +.Pq including the clock registers , +which must be initialized with +.Dv MTX_DEF +by the front-end. +.It Fa sc_wet +The event handler tag for the watchdog functionality, +which is registered by the +.Fn mk48txx_attach +function if supported by the chip and specified as part of the +machine-dependent features +.Pq see below . +.It Fa sc_model +The chip model which this instance should serve. +This member must be set to one of +.Dq mk48t02 , +.Dq mk48t08 , +.Dq mk48t18 , +or +.Dq mk48t59 +by the front-end. +.It Fa sc_nvramsz +The size of the non-volatile RAM in the +.Tn Mostek +chip, +which is set by the +.Fn mk48txx_attach +function. +.It Fa sc_clkoffset +The offset into the control registers of the +.Tn Mostek +chip, +which is set by the the +.Fn mk48txx_attach +function. +.It Fa sc_year0 +The year offset to be used with the +.Sq year +counter of the clock, +which must be set by the front-end. +This value is generally dependent on the system configuration in which +the clock device is mounted. +For instance, on +.Tn Sun Microsystems +machines the convention is to have clock's two-digit year represent +the year since 1968. +.It Fa sc_flag +This flag is used to specify machine-dependent features. +The following flags are supported: +.Bl -tag -width ".Dv MK48TXX_WDOG_ENABLE_WDS" +.It Dv MK48TXX_NO_CENT_ADJUST +If the resulting date retrieved with the +.Dq Li clock_gettime() method +would be earlier than January 1, 1970, +the driver will assume that the chip's year counter actually represents a +year in the 21st century. +This behavior can be overridden by setting this flag, +which causes the +.Nm +driver to respect the clock's century bit instead. +.It Dv MK48TXX_WDOG_REGISTER +When this flag is set, +the +.Nm +driver will register as a watchdog via the interface defined in +.Xr 9 watchdog +if supported by the specific chip model. +.It Dv MK48TXX_WDOG_ENABLE_WDS +When this flag is set, +the +.Nm +driver will set the watchdog steering +.Pq WDS +bit when enabling the watchdog functionality of the chip. +enabled +.Pq see the chip documentation for further information regarding the WDS bit . +.El +.It Fa sc_nvread +.It Fa sc_nvwrite +These members specify the access methods for reading respectively writing +clock device registers. +The default, +when +.Dv NULL +is passed as an access method, +is to access the chip memory +.Pq and clock registers +as if they were direct-mapped using the specified bus resource. +.Pp +Otherwise, the driver will call the respective function supplied by the +front-end to perform the access, +passing it the offset +.Va off +of the chip memory +.Pq or clock register +location to be read from or written to, respectively. +.El +.Sh HARDWARE +The following models are supported: +.Pp +.Bl -tag -width indent -offset indent -compact +.It Tn Mostek MK48T02 +.It Tn Mostek MK48T08 +.It Tn Mostek MK48T18 +.It Tn Mostek MK48T59 +.El +.Sh SEE ALSO +.Xr intro 4 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm mk48txx +driver appeared in +.Nx 1.5 . +The first +.Fx +version to include it was +.Fx 5.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written for +.Nx +by +.An Paul Kranenburg +.Aq pk@NetBSD.org . +It was ported to +.Fx +by +.An Thomas Moestl +.Aq tmm@FreeBSD.org +and later on improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:25:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEFB1065742; Fri, 15 Jan 2010 16:25:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23738FC1B; Fri, 15 Jan 2010 16:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGPJbd026034; Fri, 15 Jan 2010 16:25:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGPJZ3026032; Fri, 15 Jan 2010 16:25:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151625.o0FGPJZ3026032@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202392 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:25:20 -0000 Author: marius Date: Fri Jan 15 16:25:19 2010 New Revision: 202392 URL: http://svn.freebsd.org/changeset/base/202392 Log: MFC: r201007 Correct my e-mail address. Modified: stable/7/share/man/man4/gem.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/gem.4 ============================================================================== --- stable/7/share/man/man4/gem.4 Fri Jan 15 16:25:17 2010 (r202391) +++ stable/7/share/man/man4/gem.4 Fri Jan 15 16:25:19 2010 (r202392) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd December 25, 2009 .Dt GEM 4 .Os .Sh NAME @@ -150,7 +150,7 @@ by .Aq tmm@FreeBSD.org and later on improved by .An Marius Strobl -.Aq marus@FreeBSD.org . +.Aq marius@FreeBSD.org . The man page was written by .An Thomas Klausner .Aq wiz@NetBSD.org . From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:28:02 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D19771065670; Fri, 15 Jan 2010 16:28:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8198FC12; Fri, 15 Jan 2010 16:28:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGS2gA026739; Fri, 15 Jan 2010 16:28:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGS2lU026734; Fri, 15 Jan 2010 16:28:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151628.o0FGS2lU026734@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202394 - in stable/7/sys: dev/mc146818 sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:28:02 -0000 Author: marius Date: Fri Jan 15 16:28:02 2010 New Revision: 202394 URL: http://svn.freebsd.org/changeset/base/202394 Log: MFC: r201008 Style changes Obtained from: NetBSD (mc146818reg.h) Modified: stable/7/sys/dev/mc146818/mc146818.c stable/7/sys/dev/mc146818/mc146818reg.h stable/7/sys/dev/mc146818/mc146818var.h stable/7/sys/sparc64/sparc64/rtc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mc146818/mc146818.c ============================================================================== --- stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:28:02 2010 (r202394) @@ -94,7 +94,7 @@ mc146818_attach(device_t dev) (*sc->sc_mcwrite)(dev, MC_REGB, sc->sc_regb); mtx_unlock_spin(&sc->sc_mtx); - clock_register(dev, 1000000); /* 1 second resolution. */ + clock_register(dev, 1000000); /* 1 second resolution */ return (0); } @@ -116,7 +116,7 @@ mc146818_gettime(device_t dev, struct ti /* * If MC_REGA_UIP is 0 we have at least 244us before the next - * update. If it's 1 an update is imminent. + * update. If it's 1 an update is imminent. */ for (;;) { mtx_lock_spin(&sc->sc_mtx); @@ -260,6 +260,9 @@ mc146818_def_write(device_t dev, u_int r bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_DATA, val); } +#undef MC_ADDR +#undef MC_DATA + /* * Looks like it's common even across platforms to store the century at * 0x32 in the NVRAM of the mc146818. @@ -283,3 +286,5 @@ mc146818_def_setcent(device_t dev, u_int sc = device_get_softc(dev); (*sc->sc_mcwrite)(dev, MC_CENT, cent); } + +#undef MC_CENT Modified: stable/7/sys/dev/mc146818/mc146818reg.h ============================================================================== --- stable/7/sys/dev/mc146818/mc146818reg.h Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/dev/mc146818/mc146818reg.h Fri Jan 15 16:28:02 2010 (r202394) @@ -1,17 +1,17 @@ /*- * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU @@ -22,7 +22,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * from: NetBSD: mc146818reg.h,v 1.5 2003/11/02 11:07:45 wiz Exp + * $NetBSD: mc146818reg.h,v 1.9 2006/03/08 23:46:25 lukem Exp $ * * $FreeBSD$ */ @@ -122,8 +122,8 @@ * Periodic Interrupt Rate Select constants (Control register A) */ #define MC_RATE_NONE 0x0 /* No periodic interrupt */ -#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ -#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ +#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ +#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ #define MC_RATE_8192_Hz 0x3 /* 122.070 us period */ #define MC_RATE_4096_Hz 0x4 /* 244.141 us period */ #define MC_RATE_2048_Hz 0x5 /* 488.281 us period */ @@ -141,8 +141,8 @@ /* * Time base (divisor select) constants (Control register A) */ -#define MC_BASE_4_MHz 0x00 /* 4MHz crystal */ -#define MC_BASE_1_MHz MC_REGA_DV0 /* 1MHz crystal */ -#define MC_BASE_32_KHz MC_REGA_DV1 /* 32KHz crystal */ +#define MC_BASE_4_MHz 0x00 /* 4 MHz crystal */ +#define MC_BASE_1_MHz MC_REGA_DV0 /* 1 MHz crystal */ +#define MC_BASE_32_KHz MC_REGA_DV1 /* 32 KHz crystal */ #define MC_BASE_NONE (MC_REGA_DV2 | MC_REGA_DV1) /* actually also resets */ #define MC_BASE_RESET (MC_REGA_DV2 | MC_REGA_DV1 | MC_REGA_DV0) Modified: stable/7/sys/dev/mc146818/mc146818var.h ============================================================================== --- stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:28:02 2010 (r202394) @@ -38,29 +38,30 @@ struct mc146818_softc { u_char sc_regb; /* register B */ u_int sc_year0; /* year counter offset */ + u_int sc_flag; /* MD flags */ -#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ -#define MC146818_BCD 0x0002 /* use BCD mode */ -#define MC146818_12HR 0x0004 /* use AM/PM mode */ +#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ +#define MC146818_BCD 0x0002 /* use BCD mode */ +#define MC146818_12HR 0x0004 /* use AM/PM mode */ /* MD chip register read/write functions */ - u_int (*sc_mcread)(device_t, u_int); - void (*sc_mcwrite)(device_t, u_int, u_int); + u_int (*sc_mcread)(device_t dev, u_int reg); + void (*sc_mcwrite)(device_t dev, u_int reg, u_int val); /* MD century get/set functions */ - u_int (*sc_getcent)(device_t); - void (*sc_setcent)(device_t, u_int); + u_int (*sc_getcent)(device_t dev); + void (*sc_setcent)(device_t dev, u_int cent); }; /* Default read/write functions */ -u_int mc146818_def_read(device_t, u_int); -void mc146818_def_write(device_t, u_int, u_int); +u_int mc146818_def_read(device_t dev, u_int reg); +void mc146818_def_write(device_t dev, u_int reg, u_int val); /* Chip attach function */ int mc146818_attach(device_t); /* Methods for the clock interface */ #ifdef notyet -int mc146818_getsecs(device_t, int *); +int mc146818_getsecs(device_t dev, int *secp); #endif -int mc146818_gettime(device_t, struct timespec *); -int mc146818_settime(device_t, struct timespec *); +int mc146818_gettime(device_t dev, struct timespec *ts); +int mc146818_settime(device_t dev, struct timespec *ts); Modified: stable/7/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/7/sys/sparc64/sparc64/rtc.c Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/sparc64/sparc64/rtc.c Fri Jan 15 16:28:02 2010 (r202394) @@ -111,7 +111,7 @@ static device_method_t rtc_isa_methods[] DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - { 0, 0 } + KOBJMETHOD_END }; static driver_t rtc_isa_driver = { @@ -123,8 +123,8 @@ static driver_t rtc_isa_driver = { DRIVER_MODULE(rtc, isa, rtc_isa_driver, rtc_devclass, 0, 0); #endif -static u_int pc87317_getcent(device_t); -static void pc87317_setcent(device_t, u_int); +static u_int pc87317_getcent(device_t dev); +static void pc87317_setcent(device_t dev, u_int cent); static int rtc_ebus_probe(device_t dev) From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:29:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 098281065670; Fri, 15 Jan 2010 16:29:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D24588FC16; Fri, 15 Jan 2010 16:29:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGTfKP027201; Fri, 15 Jan 2010 16:29:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGTfiW027198; Fri, 15 Jan 2010 16:29:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151629.o0FGTfiW027198@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202396 - stable/7/sys/dev/mc146818 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:29:42 -0000 Author: marius Date: Fri Jan 15 16:29:41 2010 New Revision: 202396 URL: http://svn.freebsd.org/changeset/base/202396 Log: MFC: r201009 Remove clause 3 from Izumi Tsutsui's licenses. Obtained from: NetBSD Modified: stable/7/sys/dev/mc146818/mc146818.c stable/7/sys/dev/mc146818/mc146818var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mc146818/mc146818.c ============================================================================== --- stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:29:40 2010 (r202395) +++ stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:29:41 2010 (r202396) @@ -9,8 +9,6 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -23,7 +21,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. * - * from: NetBSD: mc146818.c,v 1.4 2003/11/24 06:20:40 tsutsui Exp + * $NetBSD: mc146818.c,v 1.16 2008/05/14 13:29:28 tsutsui Exp $ */ #include Modified: stable/7/sys/dev/mc146818/mc146818var.h ============================================================================== --- stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:29:40 2010 (r202395) +++ stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:29:41 2010 (r202396) @@ -9,8 +9,6 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -23,7 +21,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. * - * from: NetBSD: mc146818var.h,v 1.3 2003/11/24 06:20:40 tsutsui Exp + * $NetBSD: mc146818var.h,v 1.7 2008/05/14 13:29:29 tsutsui Exp $ * * $FreeBSD$ */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:41:11 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DADB61065676; Fri, 15 Jan 2010 16:41:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEF738FC15; Fri, 15 Jan 2010 16:41:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGfAgF029902; Fri, 15 Jan 2010 16:41:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGfArB029900; Fri, 15 Jan 2010 16:41:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151641.o0FGfArB029900@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202397 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:41:11 -0000 Author: marius Date: Fri Jan 15 16:41:10 2010 New Revision: 202397 URL: http://svn.freebsd.org/changeset/base/202397 Log: MFC: r201126 Account for firmware versions which include the CDMA interrupts in the OFW device tree. Modified: stable/7/sys/sparc64/pci/schizo.c Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:29:41 2010 (r202396) +++ stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:41:10 2010 (r202397) @@ -627,31 +627,44 @@ schizo_attach(device_t dev) /* * According to the Schizo Errata I-13, consistent DMA flushing/ * syncing is FUBAR in version < 5 (i.e. revision < 2.3) bridges, - * so we can't use it and need to live with the consequences. - * With Schizo version >= 5, CDMA flushing/syncing is usable - * but requires the the workaround described in Schizo Errata - * I-23. With Tomatillo and XMITS, CDMA flushing/syncing works - * as expected, Tomatillo version <= 4 (i.e. revision <= 2.3) - * bridges additionally require a block store after a write to - * TOMXMS_PCI_DMA_SYNC_PEND though. + * so we can't use it and need to live with the consequences. With + * Schizo version >= 5, CDMA flushing/syncing is usable but requires + * the workaround described in Schizo Errata I-23. With Tomatillo + * and XMITS, CDMA flushing/syncing works as expected, Tomatillo + * version <= 4 (i.e. revision <= 2.3) bridges additionally require + * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { - n = STX_CDMA_A_INO + sc->sc_half; - if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) - panic("%s: failed to add CDMA interrupt", - __func__); - i = schizo_intr_register(sc, n); - if (i != 0) - panic("%s: could not register interrupt " - "controller for CDMA (%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, - &sc->sc_cdma_clr); sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; - schizo_set_intr(sc, 5, n, schizo_cdma); + /* + * Some firmware versions include the CDMA interrupt + * at RID 4 but most don't. With the latter we add + * it ourselves at the spare RID 5. + */ + n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + 4)); + if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + schizo_set_intr(sc, 4, n, schizo_cdma); + } else { + n = STX_CDMA_A_INO + sc->sc_half; + if (bus_set_resource(dev, SYS_RES_IRQ, 5, + INTMAP_VEC(sc->sc_ign, n), 1) != 0) + panic("%s: failed to add CDMA " + "interrupt", __func__); + i = schizo_intr_register(sc, n); + if (i != 0) + panic("%s: could not register " + "interrupt controller for CDMA " + "(%d)", __func__, i); + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + schizo_set_intr(sc, 5, n, schizo_cdma); + } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) sc->sc_flags |= SCHIZO_FLAGS_BSWAR; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:43:19 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92F7106566B; Fri, 15 Jan 2010 16:43:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1A38FC0C; Fri, 15 Jan 2010 16:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGhJBS030462; Fri, 15 Jan 2010 16:43:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGhJMS030459; Fri, 15 Jan 2010 16:43:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151643.o0FGhJMS030459@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202399 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:43:19 -0000 Author: marius Date: Fri Jan 15 16:43:19 2010 New Revision: 202399 URL: http://svn.freebsd.org/changeset/base/202399 Log: MFC: r201199 - Prefer i and j over i and n for temporary integer variables. - Wrap/shorten too long lines. - Remove a redundant variable and an unnecessary cast in schizo(4). Modified: stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:42:39 2010 (r202398) +++ stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:43:19 2010 (r202399) @@ -182,9 +182,9 @@ struct psycho_dma_sync { void *pds_arg; /* argument for the handler */ void *pds_cookie; /* parent bus int. cookie */ device_t pds_ppb; /* farest PCI-PCI bridge */ - uint8_t pds_bus; /* bus of farest PCI device */ - uint8_t pds_slot; /* slot of farest PCI device */ - uint8_t pds_func; /* func. of farest PCI device */ + uint8_t pds_bus; /* bus of farest PCI dev. */ + uint8_t pds_slot; /* slot of farest PCI dev. */ + uint8_t pds_func; /* func. of farest PCI dev. */ }; #define PSYCHO_READ8(sc, off) \ @@ -206,8 +206,8 @@ struct psycho_dma_sync { * "Hummingbird" is the UltraSPARC IIe onboard UPA to PCI bridge. It's * basically the same as Sabre but without an APB underneath it. * - * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA bus - * and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while + * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA + * bus and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while * "Psycho+" controls both a 64-bit 33Mhz and a 64-bit 66Mhz PCI bus. You * will usually find a "Psycho+" since I don't think the original "Psycho" * ever shipped, and if it did it would be in the U30. @@ -264,7 +264,8 @@ psycho_get_desc(device_t dev) rv = psycho_find_desc(psycho_models, ofw_bus_get_model(dev)); if (rv == NULL) - rv = psycho_find_desc(psycho_compats, ofw_bus_get_compat(dev)); + rv = psycho_find_desc(psycho_compats, + ofw_bus_get_compat(dev)); return (rv); } @@ -296,7 +297,7 @@ psycho_attach(device_t dev) uint32_t dvmabase, prop, prop_array[2]; int32_t rev; u_int rerun, ver; - int i, n; + int i, j; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -462,12 +463,12 @@ psycho_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, PSYCHO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - n = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (n != PSYCHO_NRANGE) + if (i != PSYCHO_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -475,11 +476,12 @@ psycho_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < PSYCHO_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < PSYCHO_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -497,8 +499,8 @@ psycho_attach(device_t dev) * vectors. We do this early in order to be able to catch * stray interrupts. */ - for (n = 0; n <= PSYCHO_MAX_INO; n++) { - if (psycho_find_intrmap(sc, n, &intrmap, &intrclr, + for (i = 0; i <= PSYCHO_MAX_INO; i++) { + if (psycho_find_intrmap(sc, i, &intrmap, &intrclr, NULL) == 0) continue; pica = malloc(sizeof(*pica), M_DEVBUF, M_NOWAIT); @@ -516,21 +518,21 @@ psycho_attach(device_t dev) */ device_printf(dev, "intr map (INO %d, %s) %#lx: %#lx, clr: %#lx\n", - n, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", - (u_long)intrmap, (u_long)PSYCHO_READ8(sc, intrmap), - (u_long)intrclr); - PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, n)); + i, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", + (u_long)intrmap, (u_long)PSYCHO_READ8(sc, + intrmap), (u_long)intrclr); + PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, i)); PSYCHO_WRITE8(sc, intrclr, 0); PSYCHO_WRITE8(sc, intrmap, - INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, n), + INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, i), PCPU_GET(mid))); #endif - i = intr_controller_register(INTMAP_VEC(sc->sc_ign, n), - &psycho_ic, pica); - if (i != 0) + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, + i), &psycho_ic, pica); + if (j != 0) device_printf(dev, "could not register " "interrupt controller for INO %d (%d)\n", - n, i); + i, j); } if (sc->sc_mode == PSYCHO_MODE_PSYCHO) @@ -584,12 +586,12 @@ psycho_attach(device_t dev) sc->sc_pci_dmat->dt_cookie = sc->sc_is; sc->sc_pci_dmat->dt_mt = &iommu_dma_methods; - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -658,15 +660,15 @@ psycho_attach(device_t dev) PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, PCIR_LATTIMER, OFW_PCI_LATENCY, 1); - for (n = PCIR_VENDOR; n < PCIR_STATUS; n += sizeof(uint16_t)) - le16enc(&sc->sc_pci_hpbcfg[n], bus_space_read_2( + for (i = PCIR_VENDOR; i < PCIR_STATUS; i += sizeof(uint16_t)) + le16enc(&sc->sc_pci_hpbcfg[i], bus_space_read_2( sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF(sc->sc_pci_secbus, PCS_DEVICE, - PCS_FUNC, n))); - for (n = PCIR_REVID; n <= PCIR_BIST; n += sizeof(uint8_t)) - sc->sc_pci_hpbcfg[n] = bus_space_read_1(sc->sc_pci_cfgt, + PCS_FUNC, i))); + for (i = PCIR_REVID; i <= PCIR_BIST; i += sizeof(uint8_t)) + sc->sc_pci_hpbcfg[i] = bus_space_read_1(sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF( - sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, n)); + sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, i)); ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t)); /* @@ -695,8 +697,8 @@ psycho_set_intr(struct psycho_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL && intrmap >= PSR_POWER_INT_MAP) { /* * These interrupts aren't mandatory and not available @@ -705,7 +707,8 @@ psycho_set_intr(struct psycho_softc *sc, return; } if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || + INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != + sc->sc_ign || INTVEC(PSYCHO_READ8(sc, intrmap)) != vec || intr_vectors[vec].iv_ic != &psycho_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], @@ -715,8 +718,8 @@ psycho_set_intr(struct psycho_softc *sc, } static int -psycho_find_intrmap(struct psycho_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) +psycho_find_intrmap(struct psycho_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) { bus_addr_t intrclr, intrmap; uint64_t diag; @@ -876,7 +879,7 @@ psycho_wakeup(void *arg) { struct psycho_softc *sc = arg; - /* Gee, we don't really have a framework to deal with this properly. */ + /* We don't really have a framework to deal with this properly. */ device_printf(sc->sc_dev, "power management wakeup\n"); return (FILTER_HANDLED); } @@ -993,8 +996,8 @@ psycho_read_config(device_t dev, u_int b } static void -psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct psycho_softc *sc; bus_space_handle_t bh; @@ -1030,8 +1033,9 @@ psycho_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); /* * If this is outside of the range for an intpin, it's likely a full @@ -1053,7 +1057,8 @@ psycho_route_interrupt(device_t bridge, intrmap = PSR_PCIA0_INT_MAP + 8 * (pci_get_slot(dev) - 1 + 3 * sc->sc_half); mintr = INTINO(PSYCHO_READ8(sc, intrmap)) + pin - 1; - device_printf(bridge, "guessing interrupt %d for device %d.%d pin %d\n", + device_printf(bridge, + "guessing interrupt %d for device %d.%d pin %d\n", (int)mintr, pci_get_slot(dev), pci_get_function(dev), pin); return (mintr); } @@ -1272,8 +1277,8 @@ psycho_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1388,7 +1393,8 @@ psycho_alloc_bus_tag(struct psycho_softc { bus_space_tag_t bt; - bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, + M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:42:39 2010 (r202398) +++ stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:43:19 2010 (r202399) @@ -181,9 +181,9 @@ struct schizo_dma_sync { void *sds_cookie; uint64_t sds_syncval; device_t sds_ppb; /* farest PCI-PCI bridge */ - uint8_t sds_bus; /* bus of farest PCI device */ - uint8_t sds_slot; /* slot of farest PCI device */ - uint8_t sds_func; /* func. of farest PCI device */ + uint8_t sds_bus; /* bus of farest PCI dev. */ + uint8_t sds_slot; /* slot of farest PCI dev. */ + uint8_t sds_func; /* func. of farest PCI dev. */ }; #define SCHIZO_PERF_CNT_QLTY 100 @@ -261,7 +261,7 @@ schizo_attach(device_t dev) uint64_t ino_bitmap, reg; phandle_t node; uint32_t prop, prop_array[2]; - int i, mode, n, nrange, rid, tsbsize; + int i, j, mode, rid, tsbsize; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -290,18 +290,18 @@ schizo_attach(device_t dev) */ sc->sc_half = (bus_get_resource_start(dev, SYS_RES_MEMORY, STX_PCI) >> 20) & 1; - for (n = 0; n < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); - n++) { - rid = n; - sc->sc_mem_res[n] = bus_alloc_resource_any(dev, + for (i = 0; i < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); + i++) { + rid = i; + sc->sc_mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, (((mode == SCHIZO_MODE_SCZ && ((sc->sc_half == 1 && - n == STX_PCI) || n == STX_CTRL)) || + i == STX_PCI) || i == STX_CTRL)) || (mode == SCHIZO_MODE_TOM && sc->sc_half == 0 && - n == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); - if (sc->sc_mem_res[n] == NULL) + i == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); + if (sc->sc_mem_res[i] == NULL) panic("%s: could not allocate register bank %d", - __func__, n); + __func__, i); } /* @@ -334,7 +334,8 @@ schizo_attach(device_t dev) if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1) panic("%s: could not determine IGN", __func__); - if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == -1) + if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == + -1) panic("%s: could not determine version", __func__); if (OF_getprop(node, "clock-frequency", &prop, sizeof(prop)) == -1) prop = 33000000; @@ -398,21 +399,21 @@ schizo_attach(device_t dev) * This is complicated by the fact that a pair of Schizo PBMs * shares one IGN. */ - n = OF_getprop(node, "ino-bitmap", (void *)prop_array, + i = OF_getprop(node, "ino-bitmap", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get ino-bitmap", __func__); ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0]; - for (n = 0; n <= STX_MAX_INO; n++) { - if ((ino_bitmap & (1ULL << n)) == 0) + for (i = 0; i <= STX_MAX_INO; i++) { + if ((ino_bitmap & (1ULL << i)) == 0) continue; - if (n == STX_FB0_INO || n == STX_FB1_INO) + if (i == STX_FB0_INO || i == STX_FB1_INO) /* Leave for upa(4). */ continue; - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) device_printf(dev, "could not register interrupt " - "controller for INO %d (%d)\n", n, i); + "controller for INO %d (%d)\n", i, j); } /* @@ -465,9 +466,9 @@ schizo_attach(device_t dev) tsbsize = (x); \ break; \ - n = OF_getprop(node, "virtual-dma", (void *)prop_array, + i = OF_getprop(node, "virtual-dma", (void *)prop_array, sizeof(prop_array)); - if (n == -1 || n != sizeof(prop_array)) + if (i == -1 || i != sizeof(prop_array)) schizo_iommu_init(sc, 7, -1); else { switch (prop_array[1]) { @@ -501,13 +502,12 @@ schizo_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, STX_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != STX_NRANGE) + if (i != STX_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -515,11 +515,12 @@ schizo_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < STX_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < STX_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -542,12 +543,12 @@ schizo_attach(device_t dev) * Get the bus range from the firmware. * NB: Tomatillos don't support PCI bus reenumeration. */ - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -635,7 +636,8 @@ schizo_attach(device_t dev) * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || - sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { + sc->sc_mode == SCHIZO_MODE_TOM || + sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; @@ -644,26 +646,26 @@ schizo_attach(device_t dev) * at RID 4 but most don't. With the latter we add * it ourselves at the spare RID 5. */ - n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); - if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, n, NULL, + if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 4, n, schizo_cdma); + schizo_set_intr(sc, 4, i, schizo_cdma); } else { - n = STX_CDMA_A_INO + sc->sc_half; + i = STX_CDMA_A_INO + sc->sc_half; if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) + INTMAP_VEC(sc->sc_ign, i), 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) panic("%s: could not register " "interrupt controller for CDMA " - "(%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, + "(%d)", __func__, j); + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 5, n, schizo_cdma); + schizo_set_intr(sc, 5, i, schizo_cdma); } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) @@ -691,11 +693,11 @@ schizo_set_intr(struct schizo_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || - INTINO(vec) != ino || + INTINO(vec = rman_get_start(sc->sc_irq_res[index])) != ino || + INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &schizo_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC | INTR_FAST, handler, NULL, sc, @@ -731,8 +733,8 @@ schizo_intr_register(struct schizo_softc } static int -schizo_get_intrmap(struct schizo_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr) +schizo_get_intrmap(struct schizo_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr) { bus_addr_t intrclr, intrmap; uint64_t mr; @@ -966,8 +968,8 @@ schizo_read_config(device_t dev, u_int b } static void -schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct schizo_softc *sc; bus_space_handle_t bh; @@ -1002,8 +1004,9 @@ schizo_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", @@ -1038,8 +1041,8 @@ schizo_dma_sync_stub(void *arg) (void)PCIB_READ_CONFIG(sds->sds_ppb, sds->sds_bus, sds->sds_slot, sds->sds_func, PCIR_VENDOR, 2); - for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE, - SCHIZO_CDMA_STATE_PENDING) == 0;) + for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_DONE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, 1); microuptime(&cur); @@ -1296,8 +1299,8 @@ schizo_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1412,7 +1415,7 @@ schizo_alloc_bus_tag(struct schizo_softc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:46:06 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6AD4106566C; Fri, 15 Jan 2010 16:46:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9474B8FC15; Fri, 15 Jan 2010 16:46:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGk61B031192; Fri, 15 Jan 2010 16:46:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGk6S6031187; Fri, 15 Jan 2010 16:46:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151646.o0FGk6S6031187@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202401 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:46:06 -0000 Author: marius Date: Fri Jan 15 16:46:06 2010 New Revision: 202401 URL: http://svn.freebsd.org/changeset/base/202401 Log: MFC: r201395 - Preserve the PROM IOMMU in order to allow OFW drivers to continue to work. - Sanity check the parameters passed to the implementations of the pcib_{read,write}_config() methods. Using illegal values can cause no real harm but it doesn't hurt to avoid unnecessary data error traps requiring to flush and re-enable the level 1 caches. Modified: stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/psychovar.h stable/7/sys/sparc64/pci/schizo.c stable/7/sys/sparc64/pci/schizovar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:46:06 2010 (r202401) @@ -555,6 +555,7 @@ psycho_attach(device_t dev) M_NOWAIT | M_ZERO); if (sc->sc_is == NULL) panic("%s: malloc iommu_state failed", __func__); + sc->sc_is->is_flags = IOMMU_PRESERVE_PROM; if (sc->sc_mode == PSYCHO_MODE_SABRE) sc->sc_is->is_pmaxaddr = IOMMU_MAXADDR(SABRE_IOMMU_BITS); @@ -592,10 +593,11 @@ psycho_attach(device_t dev) panic("%s: could not get bus-range", __func__); if (i != sizeof(prop_array)) panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", - prop_array[0], prop_array[1], prop_array[0]); - sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, @@ -924,6 +926,10 @@ psycho_read_config(device_t dev, u_int b int i; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (-1); + bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; /* @@ -1004,6 +1010,10 @@ psycho_write_config(device_t dev, u_int u_long offset = 0; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return; + offset = PSYCHO_CONF_OFF(bus, slot, func, reg); bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { Modified: stable/7/sys/sparc64/pci/psychovar.h ============================================================================== --- stable/7/sys/sparc64/pci/psychovar.h Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/psychovar.h Fri Jan 15 16:46:06 2010 (r202401) @@ -75,6 +75,7 @@ struct psycho_softc { struct rman sc_pci_io_rman; uint8_t sc_pci_secbus; + uint8_t sc_pci_subbus; uint8_t sc_pci_hpbcfg[16]; Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:46:06 2010 (r202401) @@ -455,6 +455,7 @@ schizo_attach(device_t dev) * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's * affected by several errata and basically unusable though. */ + sc->sc_is.is_flags = IOMMU_PRESERVE_PROM; sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); sc->sc_is.is_sb[0] = sc->sc_is.is_sb[1] = 0; if (OF_getproplen(node, "no-streaming-cache") < 0 && @@ -549,10 +550,11 @@ schizo_attach(device_t dev) panic("%s: could not get bus-range", __func__); if (i != sizeof(prop_array)) panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", - prop_array[0], prop_array[1], prop_array[0]); - sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, STX_CS_DEVICE, STX_CS_FUNC, @@ -928,6 +930,9 @@ schizo_read_config(device_t dev, u_int b uint8_t byte; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (-1); /* * The Schizo bridges contain a dupe of their header at 0x80. @@ -976,6 +981,10 @@ schizo_write_config(device_t dev, u_int u_long offset = 0; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return; + offset = STX_CONF_OFF(bus, slot, func, reg); bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { Modified: stable/7/sys/sparc64/pci/schizovar.h ============================================================================== --- stable/7/sys/sparc64/pci/schizovar.h Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/schizovar.h Fri Jan 15 16:46:06 2010 (r202401) @@ -71,6 +71,7 @@ struct schizo_softc { bus_dma_tag_t sc_pci_dmat; uint8_t sc_pci_secbus; + uint8_t sc_pci_subbus; struct ofw_bus_iinfo sc_pci_iinfo; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:55:01 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A291065679; Fri, 15 Jan 2010 16:55:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B93278FC0C; Fri, 15 Jan 2010 16:55:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGt06i033339; Fri, 15 Jan 2010 16:55:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGt0dh033336; Fri, 15 Jan 2010 16:55:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151655.o0FGt0dh033336@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202403 - in stable/7/sys/sparc64: conf sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:55:01 -0000 Author: marius Date: Fri Jan 15 16:55:00 2010 New Revision: 202403 URL: http://svn.freebsd.org/changeset/base/202403 Log: MFC: r201396, r201410 - Demapping unused kernel TLB slots has proven to work reliably so move the associated debugging under bootverbose. - Remove freebsd4_sigreturn(); given that FreeBSD 4 didn't supported sparc64 this only ever served as a transition aid prior to FreeBSD 5.0 and is unused by default since COMPAT_FREEBSD4 was removed from GENERIC in r143072 nearly 5 years ago. Modified: stable/7/sys/sparc64/conf/NOTES stable/7/sys/sparc64/sparc64/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/conf/NOTES ============================================================================== --- stable/7/sys/sparc64/conf/NOTES Fri Jan 15 16:54:59 2010 (r202402) +++ stable/7/sys/sparc64/conf/NOTES Fri Jan 15 16:55:00 2010 (r202403) @@ -131,6 +131,7 @@ nodevice ex # Options we don't want to deal with nooption FDC_DEBUG +nooption COMPAT_FREEBSD4 nooption SC_RENDER_DEBUG nooption SC_DEBUG_LEVEL nooption PPC_DEBUG Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Fri Jan 15 16:54:59 2010 (r202402) +++ stable/7/sys/sparc64/sparc64/machdep.c Fri Jan 15 16:55:00 2010 (r202403) @@ -375,8 +375,9 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { - printf("demapping unused kernel TLB slot (va %#lx - %#lx)\n", - va, va + PAGE_SIZE_4M - 1); + if (bootverbose) + printf("demapping unused kernel TLB slot " + "(va %#lx - %#lx)\n", va, va + PAGE_SIZE_4M - 1); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, @@ -663,15 +664,6 @@ sigreturn(struct thread *td, struct sigr return (EJUSTRETURN); } -#ifdef COMPAT_FREEBSD4 -int -freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) -{ - - return sigreturn(td, (struct sigreturn_args *)uap); -} -#endif - /* * Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 16:57:53 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E90D8106566B; Fri, 15 Jan 2010 16:57:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D78CE8FC1E; Fri, 15 Jan 2010 16:57:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FGvr54034076; Fri, 15 Jan 2010 16:57:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGvrLn034074; Fri, 15 Jan 2010 16:57:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151657.o0FGvrLn034074@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202405 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:57:54 -0000 Author: marius Date: Fri Jan 15 16:57:53 2010 New Revision: 202405 URL: http://svn.freebsd.org/changeset/base/202405 Log: MFC: r201901 Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF license FreeBSD had in sys/boot). Obtained from: NetBSD Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 16:57:49 2010 (r202404) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 16:57:53 2010 (r202405) @@ -1,6 +1,4 @@ -/* - * $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ - */ +/* $NetBSD: dev_net.c,v 1.23 2008/04/28 20:24:06 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -17,13 +15,6 @@ * 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 the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 19:06:47 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E8341065672; Fri, 15 Jan 2010 19:06:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C67D8FC12; Fri, 15 Jan 2010 19:06:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FJ6l1e062786; Fri, 15 Jan 2010 19:06:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJ6lJB062783; Fri, 15 Jan 2010 19:06:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151906.o0FJ6lJB062783@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 19:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202409 - in stable/7/sys/boot: common sparc64/loader X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:06:47 -0000 Author: marius Date: Fri Jan 15 19:06:47 2010 New Revision: 202409 URL: http://svn.freebsd.org/changeset/base/202409 Log: MFC: r201932 - Add code allowing a network device to only be open and closed once by keeping it opened after the first open and closing it via the cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined. Note that due to the fact that the part of r177108 which reverts r60506 and causes the open-close-dance on every file access as the remaining problems with powerpc should be sorted out first, in stable/7 the only difference in behavior between when NETIF_OPEN_CLOSE_ONCE is defined and not currently is that with that macro defined the network device is eventually closed before entering the kernel and before rebooting. - Define NETIF_OPEN_CLOSE_ONCE on sparc64 in order to not keep the network device opened forever, as at least with some firmware versions received packets are DMA'ed to stale memory otherwise. Modified: stable/7/sys/boot/common/dev_net.c stable/7/sys/boot/sparc64/loader/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 19:06:33 2010 (r202408) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 19:06:47 2010 (r202409) @@ -71,12 +71,14 @@ __FBSDID("$FreeBSD$"); int debug = 0; #endif +static char *netdev_name; static int netdev_sock = -1; static int netdev_opens; static int net_init(void); static int net_open(struct open_file *, ...); static int net_close(struct open_file *); +static void net_cleanup(void); static int net_strategy(); static void net_print(int); @@ -90,7 +92,8 @@ struct devsw netdev = { net_open, net_close, noioctl, - net_print + net_print, + net_cleanup }; static int @@ -116,6 +119,12 @@ net_open(struct open_file *f, ...) devname = va_arg(args, char*); va_end(args); +#ifdef NETIF_OPEN_CLOSE_ONCE + /* Before opening another interface, close the previous one first. */ + if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) + net_cleanup(); +#endif + /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { /* Find network interface. */ @@ -125,6 +134,7 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } + netdev_name = strdup(devname); #ifdef NETIF_DEBUG if (debug) printf("net_open: netif_open() succeeded\n"); @@ -135,6 +145,7 @@ net_open(struct open_file *f, ...) error = net_getparams(netdev_sock); if (error) { /* getparams makes its own noise */ + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; return (error); @@ -150,30 +161,46 @@ net_open(struct open_file *f, ...) static int net_close(struct open_file *f) { + #ifdef NETIF_DEBUG if (debug) printf("net_close: opens=%d\n", netdev_opens); #endif - /* On last close, do netif close, etc. */ f->f_devdata = NULL; + +#ifndef NETIF_OPEN_CLOSE_ONCE /* Extra close call? */ if (netdev_opens <= 0) return (0); netdev_opens--; /* Not last close? */ if (netdev_opens > 0) - return(0); - rootip.s_addr = 0; + return (0); + /* On last close, do netif close, etc. */ +#ifdef NETIF_DEBUG + if (debug) + printf("net_close: calling net_cleanup()\n"); +#endif + net_cleanup(); +#endif + return (0); +} + +static void +net_cleanup(void) +{ + if (netdev_sock >= 0) { #ifdef NETIF_DEBUG if (debug) - printf("net_close: calling netif_close()\n"); + printf("net_cleanup: calling netif_close()\n"); #endif + rootip.s_addr = 0; + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; } - return (0); } static int Modified: stable/7/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/7/sys/boot/sparc64/loader/Makefile Fri Jan 15 19:06:33 2010 (r202408) +++ stable/7/sys/boot/sparc64/loader/Makefile Fri Jan 15 19:06:47 2010 (r202409) @@ -50,11 +50,15 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE CLEANFILES+= vers.c loader.help From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 19:12:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28CFE1065676; Fri, 15 Jan 2010 19:12:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157FF8FC19; Fri, 15 Jan 2010 19:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FJCYMi064194; Fri, 15 Jan 2010 19:12:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJCYGE064189; Fri, 15 Jan 2010 19:12:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151912.o0FJCYGE064189@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 19:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202411 - in stable/7/sys: conf modules modules/epic sparc64/conf sparc64/ebus X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:12:35 -0000 Author: marius Date: Fri Jan 15 19:12:34 2010 New Revision: 202411 URL: http://svn.freebsd.org/changeset/base/202411 Log: MFC: r202006 Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245. It's named after the driver doing the same job in OpenSolaris. Added: stable/7/sys/modules/epic/ - copied from r202006, head/sys/modules/epic/ stable/7/sys/sparc64/ebus/epic.c - copied unchanged from r202006, head/sys/sparc64/ebus/epic.c Modified: stable/7/sys/conf/files.sparc64 stable/7/sys/modules/Makefile stable/7/sys/sparc64/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Fri Jan 15 19:12:33 2010 (r202410) +++ stable/7/sys/conf/files.sparc64 Fri Jan 15 19:12:34 2010 (r202411) @@ -64,6 +64,7 @@ libkern/fls.c standard libkern/flsl.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus +sparc64/ebus/epic.c optional epic ebus sparc64/fhc/clkbrd.c optional clkbrd fhc sparc64/fhc/fhc.c optional fhc sparc64/isa/isa.c optional isa Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Fri Jan 15 19:12:33 2010 (r202410) +++ stable/7/sys/modules/Makefile Fri Jan 15 19:12:34 2010 (r202411) @@ -86,6 +86,7 @@ SUBDIR= ${_3dfx} \ ${_em} \ en \ ${_ep} \ + ${_epic} \ ${_et} \ ${_ex} \ ${_exca} \ @@ -636,6 +637,7 @@ _smbfs= smbfs .if ${MACHINE_ARCH} == "sparc64" _auxio= auxio _em= em +_epic= epic _i2c= i2c _igb= igb .if ${MK_CDDL} != "no" || defined(ALL_MODULES) Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Fri Jan 15 19:12:33 2010 (r202410) +++ stable/7/sys/sparc64/conf/GENERIC Fri Jan 15 19:12:34 2010 (r202411) @@ -137,6 +137,7 @@ device eeprom # eeprom (really a front device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks +device epic # Sun Fire V215/V245 LEDs # Serial (COM) ports device puc # Multi-channel uarts Copied: stable/7/sys/sparc64/ebus/epic.c (from r202006, head/sys/sparc64/ebus/epic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/ebus/epic.c Fri Jan 15 19:12:34 2010 (r202411, copy of r202006, head/sys/sparc64/ebus/epic.c) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define EPIC_DELAY 10000 + +#define EPIC_NREG 1 +#define EPIC_FW_LED 0 + +#define EPIC_FW_LED_DATA 0x40 +#define EPIC_FW_LED_ADDR 0x41 +#define EPIC_FW_LED_WRITE_MASK 0x80 + +#define EPIC_FW_VERSION 0x05 +#define EPIC_LED_STATE0 0x06 + +#define EPIC_LED_ALERT_MASK 0x0c +#define EPIC_LED_ALERT_OFF 0x00 +#define EPIC_LED_ALERT_ON 0x04 + +#define EPIC_LED_POWER_MASK 0x30 +#define EPIC_LED_POWER_OFF 0x00 +#define EPIC_LED_POWER_ON 0x10 +#define EPIC_LED_POWER_SB_BLINK 0x20 +#define EPIC_LED_POWER_FAST_BLINK 0x30 + +static struct resource_spec epic_res_spec[] = { + { SYS_RES_MEMORY, EPIC_FW_LED, RF_ACTIVE }, + { -1, 0 } +}; + +struct epic_softc { + struct mtx sc_mtx; + struct resource *sc_res[EPIC_NREG]; + struct cdev *sc_led_dev_alert; + struct cdev *sc_led_dev_power; +}; + +#define EPIC_FW_LED_READ(sc, off) ({ \ + uint8_t __val; \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + __val = bus_read_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA);\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ); \ + DELAY(EPIC_DELAY); \ + __val; \ +}) + +#define EPIC_FW_LED_WRITE(sc, off, mask, val) do { \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + (mask)); \ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + 1, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, (val));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ +} while (0) + +#define EPIC_LOCK_INIT(sc) \ + mtx_init(&(sc)->sc_mtx, "epic mtx", NULL, MTX_DEF) +#define EPIC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) +#define EPIC_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define EPIC_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) + +static device_probe_t epic_probe; +static device_attach_t epic_attach; +static device_detach_t epic_detach; + +static void epic_led_alert(void *arg, int onoff); +static void epic_led_power(void *arg, int onoff); + +static device_method_t epic_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, epic_probe), + DEVMETHOD(device_attach, epic_attach), + DEVMETHOD(device_detach, epic_detach), + + KOBJMETHOD_END +}; + +static devclass_t epic_devclass; + +DEFINE_CLASS_0(epic, epic_driver, epic_methods, + sizeof(struct epic_softc)); +DRIVER_MODULE(epic, ebus, epic_driver, epic_devclass, 0, 0); + +static int +epic_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), + "env-monitor") == 0 && strcmp(compat, "epic") == 0) { + device_set_desc(dev, "Sun Fire V215/V245 LEDs"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +epic_attach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + if (bus_alloc_resources(dev, epic_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, epic_res_spec, sc->sc_res); + return (ENXIO); + } + + EPIC_LOCK_INIT(sc); + + if (bootverbose) + device_printf(dev, "version 0x%x\n", + EPIC_FW_LED_READ(sc, EPIC_FW_VERSION)); + + sc->sc_led_dev_alert = led_create(epic_led_alert, sc, "alert"); + sc->sc_led_dev_power = led_create(epic_led_power, sc, "power"); + + return (0); +} + +static int +epic_detach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + + led_destroy(sc->sc_led_dev_alert); + led_destroy(sc->sc_led_dev_power); + + bus_release_resources(dev, epic_res_spec, sc->sc_res); + + EPIC_LOCK_DESTROY(sc); + + return (0); +} + +static void +epic_led_alert(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_ALERT_MASK, + onoff ? EPIC_LED_ALERT_ON : EPIC_LED_ALERT_OFF); + EPIC_UNLOCK(sc); +} + +static void +epic_led_power(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_POWER_MASK, + onoff ? EPIC_LED_POWER_ON : EPIC_LED_POWER_OFF); + EPIC_UNLOCK(sc); +} From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 19:44:40 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B1F7106566C; Fri, 15 Jan 2010 19:44:40 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 897C28FC1B; Fri, 15 Jan 2010 19:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FJie9h071665; Fri, 15 Jan 2010 19:44:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJieSV071663; Fri, 15 Jan 2010 19:44:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151944.o0FJieSV071663@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202414 - stable/7/lib/libc/stdio X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:44:40 -0000 Author: brueffer Date: Fri Jan 15 19:44:40 2010 New Revision: 202414 URL: http://svn.freebsd.org/changeset/base/202414 Log: MFC: r201836 Remove unnecessary quoting and markup, add missing punctuation. Modified: stable/7/lib/libc/stdio/getc.3 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdio/getc.3 ============================================================================== --- stable/7/lib/libc/stdio/getc.3 Fri Jan 15 19:42:09 2010 (r202413) +++ stable/7/lib/libc/stdio/getc.3 Fri Jan 15 19:44:40 2010 (r202414) @@ -56,7 +56,7 @@ .Ft int .Fn getchar void .Ft int -.Fn getchar_unlocked "void" +.Fn getchar_unlocked void .Ft int .Fn getw "FILE *stream" .Sh DESCRIPTION @@ -141,7 +141,7 @@ until the condition is cleared with .Sh STANDARDS The .Fn fgetc , -.Fn getc +.Fn getc , and .Fn getchar functions @@ -167,4 +167,3 @@ The size and byte order of an varies from one machine to another, and .Fn getw is not recommended for portable applications. -.Pp From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 19:54:13 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 498BD1065693; Fri, 15 Jan 2010 19:54:13 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EF88FC32; Fri, 15 Jan 2010 19:54:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FJsDAd073908; Fri, 15 Jan 2010 19:54:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJsDn1073906; Fri, 15 Jan 2010 19:54:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151954.o0FJsDn1073906@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202417 - stable/7/lib/libelf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:54:13 -0000 Author: brueffer Date: Fri Jan 15 19:54:12 2010 New Revision: 202417 URL: http://svn.freebsd.org/changeset/base/202417 Log: MFC: r202159 Remove useless .TE groff macro. Modified: stable/7/lib/libelf/elf.3 Directory Properties: stable/7/lib/libelf/ (props changed) Modified: stable/7/lib/libelf/elf.3 ============================================================================== --- stable/7/lib/libelf/elf.3 Fri Jan 15 19:53:36 2010 (r202416) +++ stable/7/lib/libelf/elf.3 Fri Jan 15 19:54:12 2010 (r202417) @@ -379,7 +379,6 @@ See .It Dv SHT_SUNW_move Ta Dv ELF_T_MOVE Ta ELF move records. .It Dv SHT_SUNW_syminfo Ta Dv ELF_T_SYMINFO Ta Additional symbol flags. .El -.TE .Ss Functional Grouping This section contains a brief overview of the available functionality in the ELF library. From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 21:45:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEE341065766; Fri, 15 Jan 2010 21:45:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2358FC1C; Fri, 15 Jan 2010 21:45:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FLjuBJ098605; Fri, 15 Jan 2010 21:45:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FLjuAc098599; Fri, 15 Jan 2010 21:45:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001152145.o0FLjuAc098599@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 21:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202420 - in stable/7/sys: conf sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 21:45:56 -0000 Author: marius Date: Fri Jan 15 21:45:55 2010 New Revision: 202420 URL: http://svn.freebsd.org/changeset/base/202420 Log: MFC: r201052, r201200, r202003, r202010, r202023 Add a driver for the `Fire' JBus to PCIe bridges found in at least the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also already includes all the code to support the `Oberon' Uranus to PCIe bridges found in the Fujitsu-Siemens based Mx000 machines but due to lack of access to such a system for testing, probing of these bridges is currently disabled. Unfortunately, the event queue mechanism of these bridges for MSIs/ MSI-Xs matches our current MD and MI interrupt frameworks like square pegs fit into round holes so for now we are generous and use one event queue per MSI, which limits us to 35 MSIs/MSI-Xs per Host-PCIe-bridge (we use one event queue for the PCIe error messages). This seems tolerable as long as most devices just use one MSI/MSI-X anyway. Adding knowledge about MSIs/MSI-Xs to the MD interrupt code should allow us to decouple the 1:1 mapping at the cost of no longer being able to bind MSIs/MSI-Xs to specific CPUs as we currently have no reliable way to quiesce a device during the transition of its MSIs/ MSI-Xs to another event queue. This would still require the problem of interrupt storms generated by devices which have no one-shot behavior or can't/don't mask interrupts while the filter/handler is executed (like the older PCIe NICs supported by bge(4)) to be solved though. Added: stable/7/sys/sparc64/pci/fire.c - copied, changed from r201052, head/sys/sparc64/pci/fire.c stable/7/sys/sparc64/pci/firereg.h - copied unchanged from r201052, head/sys/sparc64/pci/firereg.h stable/7/sys/sparc64/pci/firevar.h - copied unchanged from r201052, head/sys/sparc64/pci/firevar.h Modified: stable/7/sys/conf/files.sparc64 stable/7/sys/conf/options.sparc64 Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Fri Jan 15 21:45:46 2010 (r202419) +++ stable/7/sys/conf/files.sparc64 Fri Jan 15 21:45:55 2010 (r202420) @@ -71,6 +71,7 @@ sparc64/isa/isa.c optional isa sparc64/isa/isa_dma.c optional isa sparc64/isa/ofw_isa.c optional ebus | isa sparc64/pci/apb.c optional pci +sparc64/pci/fire.c optional pci sparc64/pci/ofw_pcib.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci Modified: stable/7/sys/conf/options.sparc64 ============================================================================== --- stable/7/sys/conf/options.sparc64 Fri Jan 15 21:45:46 2010 (r202419) +++ stable/7/sys/conf/options.sparc64 Fri Jan 15 21:45:55 2010 (r202420) @@ -8,6 +8,8 @@ SUN4U opt_global.h ATKBD_DFLT_KEYMAP opt_atkbd.h +FIRE_DEBUG opt_fire.h + # Debug IOMMU inserts/removes using diagnostic accesses. This is very loud. IOMMU_DIAG opt_iommu.h Copied and modified: stable/7/sys/sparc64/pci/fire.c (from r201052, head/sys/sparc64/pci/fire.c) ============================================================================== --- head/sys/sparc64/pci/fire.c Sun Dec 27 16:55:44 2009 (r201052, copy source) +++ stable/7/sys/sparc64/pci/fire.c Fri Jan 15 21:45:55 2010 (r202420) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +struct fire_msiqarg; + static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); static const struct fire_desc *fire_get_desc(device_t dev); static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, @@ -94,6 +96,9 @@ static void fire_intr_clear(void *arg); static void fire_intr_disable(void *arg); static void fire_intr_enable(void *arg); static int fire_intr_register(struct fire_softc *sc, u_int ino); +static inline void fire_msiq_common(struct intr_vector *iv, + struct fire_msiqarg *fmqa); +static void fire_msiq_filter(void *cookie); static void fire_msiq_handler(void *cookie); static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, driver_filter_t handler, void *arg); @@ -167,8 +172,7 @@ static device_method_t fire_methods[] = static devclass_t fire_devclass; DEFINE_CLASS_0(pcib, fire_driver, fire_methods, sizeof(struct fire_softc)); -EARLY_DRIVER_MODULE(fire, nexus, fire_driver, fire_devclass, 0, 0, - BUS_PASS_BUS); +DRIVER_MODULE(fire, nexus, fire_driver, fire_devclass, 0, 0); MODULE_DEPEND(fire, nexus, 1, 1, 1); static const struct intr_controller fire_ic = { @@ -184,6 +188,13 @@ struct fire_icarg { bus_addr_t fica_clr; }; +static const struct intr_controller fire_msiqc_filter = { + fire_intr_enable, + fire_intr_disable, + fire_intr_assign, + NULL +}; + struct fire_msiqarg { struct fire_icarg fmqa_fica; struct mtx fmqa_mtx; @@ -290,7 +301,7 @@ fire_attach(device_t dev) uint64_t ino_bitmap, val; phandle_t node; uint32_t prop, prop_array[2]; - int i, j, mode, nrange; + int i, j, mode; u_int lw; uint16_t mps; @@ -725,13 +736,12 @@ fire_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, FO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != FIRE_NRANGE) + if (i != FIRE_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -743,7 +753,7 @@ fire_attach(device_t dev) j = OFW_PCI_RANGE_CS(&range[i]); if (sc->sc_pci_bh[j] != 0) panic("%s: duplicate range for space %d", - __func__, j); + __func__, j); sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -1612,7 +1622,7 @@ fire_intr_clear(void *arg) */ static int -fire_alloc_msi(device_t dev, device_t child, int count, int maxcount, +fire_alloc_msi(device_t dev, device_t child, int count, int maxcount __unused, int *irqs) { struct fire_softc *sc; @@ -1638,16 +1648,11 @@ fire_alloc_msi(device_t dev, device_t ch mtx_unlock(&sc->sc_msi_mtx); return (ENXIO); } - /* - * It's unclear whether we need to actually align the MSIs in the - * mapping table based on the maxcount or just the count. We use - * maxcount to be on the safe side. - */ - for (i = 0; i + maxcount < sc->sc_msi_count; i += maxcount) { - for (j = i; j < i + maxcount; j++) + for (i = 0; i + count < sc->sc_msi_count; i += count) { + for (j = i; j < i + count; j++) if (isclr(sc->sc_msi_bitmap, j) == 0) break; - if (j == i + maxcount) { + if (j == i + count) { for (j = 0; j < count; j++) { setbit(sc->sc_msiq_bitmap, msiqrun + j); setbit(sc->sc_msi_bitmap, i + j); @@ -1766,33 +1771,67 @@ fire_msiq_handler(void *cookie) { struct intr_vector *iv; struct fire_msiqarg *fmqa; - struct fire_softc *sc; - struct fo_msiq_record *qrec; - device_t dev; - uint64_t word0; - u_int head, msi, msiq; iv = cookie; fmqa = iv->iv_icarg; - sc = fmqa->fmqa_fica.fica_sc; - dev = sc->sc_dev; - msiq = fmqa->fmqa_msiq; /* * Note that since fire_intr_clear() will clear the event queue - * interrupt after the filter/handler associated with the MSI [sic] - * has been executed we have to protect the access to the event queue - * as otherwise nested event queue interrupts cause corruption of the + * interrupt after the handler associated with the MSI [sic] has + * been executed we have to protect the access to the event queue as + * otherwise nested event queue interrupts cause corruption of the * event queue on MP machines. Obviously especially when abandoning * the 1:1 mapping it would be better to not clear the event queue - * interrupt after each filter/handler invocation but only once when - * the outstanding MSIs have been processed but unfortunately that + * interrupt after each handler invocation but only once when the + * outstanding MSIs have been processed but unfortunately that * doesn't work well and leads to interrupt storms with controllers/ - * drivers which don't mask interrupts while the filter/handler is - * executed. Maybe delaying clearing the MSI until after the filter/ - * handler has been executed could be used to work around this but - * that's not the intended usage and might in turn cause lost MSIs. + * drivers which don't mask interrupts while the handler is executed. + * Maybe delaying clearing the MSI until after the handler has been + * executed could be used to work around this but that's not the + * intended usage and might in turn cause lost MSIs. */ mtx_lock_spin(&fmqa->fmqa_mtx); + fire_msiq_common(iv, fmqa); + mtx_unlock_spin(&fmqa->fmqa_mtx); +} + +static void +fire_msiq_filter(void *cookie) +{ + struct intr_vector *iv; + struct fire_msiqarg *fmqa; + + iv = cookie; + fmqa = iv->iv_icarg; + /* + * For filters we don't use fire_intr_clear() since it would clear + * the event queue interrupt while we're still processing the event + * queue as filters and associated post-filter handler are executed + * directly, which in turn would lead to lost MSIs. So we clear the + * event queue interrupt only once after processing the event queue. + * Given that this still guarantees the filters to not be executed + * concurrently and no other CPU can clear the event queue interrupt + * while the event queue is still processed, we don't even need to + * interlock the access to the event queue in this case. + */ + critical_enter(); + fire_msiq_common(iv, fmqa); + FIRE_PCI_WRITE_8(fmqa->fmqa_fica.fica_sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + critical_exit(); +} + +static inline void +fire_msiq_common(struct intr_vector *iv, struct fire_msiqarg *fmqa) +{ + struct fire_softc *sc; + struct fo_msiq_record *qrec; + device_t dev; + uint64_t word0; + u_int head, msi, msiq; + + sc = fmqa->fmqa_fica.fica_sc; + dev = sc->sc_dev; + msiq = fmqa->fmqa_msiq; head = (FIRE_PCI_READ_8(sc, fmqa->fmqa_head) & FO_PCI_EQ_HD_MASK) >> FO_PCI_EQ_HD_SHFT; qrec = &fmqa->fmqa_base[head]; @@ -1834,7 +1873,6 @@ fire_msiq_handler(void *cookie) FIRE_PCI_READ_8(sc, FO_PCI_EQ_CTRL_CLR_BASE + msiq) | FO_PCI_EQ_CTRL_CLR_COVERR); } - mtx_unlock_spin(&fmqa->fmqa_mtx); } static int @@ -1843,6 +1881,7 @@ fire_setup_intr(device_t dev, device_t c void **cookiep) { struct fire_softc *sc; + struct fire_msiqarg *fmqa; u_long vec; int error; u_int msi, msiq; @@ -1873,31 +1912,39 @@ fire_setup_intr(device_t dev, device_t c intr, arg, cookiep); rman_set_start(ires, msi); rman_set_end(ires, msi); - if (error == 0) { + if (error != 0) + return (error); + fmqa = intr_vectors[vec].iv_icarg; + /* + * XXX inject our event queue handler. + */ + if (filt != NULL) { + intr_vectors[vec].iv_func = fire_msiq_filter; + intr_vectors[vec].iv_ic = &fire_msiqc_filter; /* - * XXX inject our event queue handler. + * Ensure the event queue interrupt is cleared, it + * might have triggered before. Given we supply NULL + * as ic_clear, inthand_add() won't do this for us. */ + FIRE_PCI_WRITE_8(sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + } else intr_vectors[vec].iv_func = fire_msiq_handler; - /* - * Record the MSI/MSI-X as long as we we use a 1:1 - * mapping. - */ - ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)-> - fmqa_msi = msi; - FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + - (msiq << 3), FO_PCI_EQ_CTRL_SET_EN); - msi <<= 3; - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & - ~FO_PCI_MSI_MAP_EQNUM_MASK) | - ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & - FO_PCI_MSI_MAP_EQNUM_MASK)); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, - FO_PCI_MSI_CLR_EQWR_N); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | - FO_PCI_MSI_MAP_V); - } + /* Record the MSI/MSI-X as long as we we use a 1:1 mapping. */ + fmqa->fmqa_msi = msi; + FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (msiq << 3), + FO_PCI_EQ_CTRL_SET_EN); + msi <<= 3; + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & + ~FO_PCI_MSI_MAP_EQNUM_MASK) | + ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & + FO_PCI_MSI_MAP_EQNUM_MASK)); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, + FO_PCI_MSI_CLR_EQWR_N); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | + FO_PCI_MSI_MAP_V); return (error); } @@ -1946,14 +1993,16 @@ fire_teardown_intr(device_t dev, device_ (0 << FO_PCI_EQ_TL_SHFT) & FO_PCI_EQ_TL_MASK); FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_HD_BASE + msiq, (0 << FO_PCI_EQ_HD_SHFT) & FO_PCI_EQ_HD_MASK); + intr_vectors[vec].iv_ic = &fire_ic; /* * The MD interrupt code needs the vector rather than the MSI. */ rman_set_start(ires, vec); rman_set_end(ires, vec); error = bus_generic_teardown_intr(dev, child, ires, cookie); + msi >>= 3; rman_set_start(ires, msi); - rman_set_end(ires, msi >> 3); + rman_set_end(ires, msi); return (error); } return (bus_generic_teardown_intr(dev, child, ires, cookie)); @@ -2101,7 +2150,7 @@ fire_alloc_bus_tag(struct fire_softc *sc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Copied: stable/7/sys/sparc64/pci/firereg.h (from r201052, head/sys/sparc64/pci/firereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/pci/firereg.h Fri Jan 15 21:45:55 2010 (r202420, copy of r201052, head/sys/sparc64/pci/firereg.h) @@ -0,0 +1,1004 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * 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. + * + * $FreeBSD$ + */ + +#ifndef _SPARC64_PCI_FIREREG_H_ +#define _SPARC64_PCI_FIREREG_H_ + +#define FIRE_NINTR 3 /* 2 OFW + 1 MSIq */ +#define FIRE_NRANGE 4 +#define FIRE_NREG 2 + +#define FIRE_PCI 0 +#define FIRE_CTRL 1 + +/* PCI configuration and status registers */ +#define FO_PCI_INT_MAP_BASE 0x01000 +#define FO_PCI_INT_CLR_BASE 0x01400 +#define FO_PCI_EQ_BASE_ADDR 0x10000 +#define FO_PCI_EQ_CTRL_SET_BASE 0x11000 +#define FO_PCI_EQ_CTRL_CLR_BASE 0x11200 +#define FO_PCI_EQ_TL_BASE 0x11600 +#define FO_PCI_EQ_HD_BASE 0x11800 +#define FO_PCI_MSI_MAP_BASE 0x20000 +#define FO_PCI_MSI_CLR_BASE 0x28000 +#define FO_PCI_ERR_COR 0x30000 +#define FO_PCI_ERR_NONFATAL 0x30008 +#define FO_PCI_ERR_FATAL 0x30010 +#define FO_PCI_PM_PME 0x30018 +#define FO_PCI_PME_TO_ACK 0x30020 +#define FO_PCI_IMU_INT_EN 0x31008 +#define FO_PCI_IMU_INT_STAT 0x31010 +#define FO_PCI_IMU_ERR_STAT_CLR 0x31018 +#define FO_PCI_IMU_RDS_ERR_LOG 0x31028 +#define FO_PCI_IMU_SCS_ERR_LOG 0x31030 +#define FO_PCI_IMU_EQS_ERR_LOG 0x31038 +#define FO_PCI_DMC_CORE_BLOCK_INT_EN 0x31800 +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT 0x31808 +#define FO_PCI_MULTI_CORE_ERR_STAT 0x31810 +#define FO_PCI_MSI_32_BIT_ADDR 0x34000 +#define FO_PCI_MSI_64_BIT_ADDR 0x34008 +#define FO_PCI_MMU 0x40000 +#define FO_PCI_MMU_INT_EN 0x41008 +#define FO_PCI_MMU_INT_STAT 0x41010 +#define FO_PCI_MMU_ERR_STAT_CLR 0x41018 +#define FO_PCI_MMU_TRANS_FAULT_ADDR 0x41028 +#define FO_PCI_MMU_TRANS_FAULT_STAT 0x41030 +#define FO_PCI_ILU_INT_EN 0x51008 +#define FO_PCI_ILU_INT_STAT 0x51010 +#define FO_PCI_ILU_ERR_STAT_CLR 0x51018 +#define FO_PCI_DMC_DBG_SEL_PORTA 0x53000 +#define FO_PCI_DMC_DBG_SEL_PORTB 0x53008 +#define FO_PCI_PEC_CORE_BLOCK_INT_EN 0x51800 +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT 0x51808 +#define FO_PCI_TLU_CTRL 0x80000 +#define FO_PCI_TLU_OEVENT_INT_EN 0x81008 +#define FO_PCI_TLU_OEVENT_INT_STAT 0x81010 +#define FO_PCI_TLU_OEVENT_STAT_CLR 0x81018 +#define FO_PCI_TLU_RX_OEVENT_HDR1_LOG 0x81028 +#define FO_PCI_TLU_RX_OEVENT_HDR2_LOG 0x81030 +#define FO_PCI_TLU_TX_OEVENT_HDR1_LOG 0x81038 +#define FO_PCI_TLU_TX_OEVENT_HDR2_LOG 0x81040 +#define FO_PCI_TLU_DEV_CTRL 0x90008 +#define FO_PCI_TLU_LNK_CTRL 0x90020 +#define FO_PCI_TLU_LNK_STAT 0x90028 +#define FO_PCI_TLU_UERR_INT_EN 0x91008 +#define FO_PCI_TLU_UERR_INT_STAT 0x91010 +#define FO_PCI_TLU_UERR_STAT_CLR 0x91018 +#define FO_PCI_TLU_RX_UERR_HDR1_LOG 0x91028 +#define FO_PCI_TLU_RX_UERR_HDR2_LOG 0x91030 +#define FO_PCI_TLU_TX_UERR_HDR1_LOG 0x91038 +#define FO_PCI_TLU_TX_UERR_HDR2_LOG 0x91040 +#define FO_PCI_TLU_CERR_INT_EN 0xa1008 +#define FO_PCI_TLU_CERR_INT_STAT 0xa1010 +#define FO_PCI_TLU_CERR_STAT_CLR 0xa1018 +#define FO_PCI_LPU_RST 0xe2008 +#define FO_PCI_LPU_INT_STAT 0xe2040 +#define FO_PCI_LPU_INT_MASK 0xe0248 +#define FO_PCI_LPU_LNK_LYR_CFG 0xe2200 +#define FO_PCI_LPU_LNK_LYR_INT_STAT 0xe2210 +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL 0xe2240 +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS 0xe2400 +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS 0xe2410 +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR 0xe2430 +#define FO_PCI_LPU_PHY_LYR_INT_STAT 0xe2610 +#define FO_PCI_LPU_LTSSM_CFG2 0xe2788 +#define FO_PCI_LPU_LTSSM_CFG3 0xe2790 +#define FO_PCI_LPU_LTSSM_CFG4 0xe2798 +#define FO_PCI_LPU_LTSSM_CFG5 0xe27a0 + +/* PCI interrupt mapping registers */ +#define FO_PCI_IMAP_MDO_MODE 0x8000000000000000ULL +#define FO_PCI_IMAP_V 0x0000000080000000ULL +#define FIRE_PCI_IMAP_T_JPID_MASK 0x000000007c000000ULL +#define FIRE_PCI_IMAP_T_JPID_SHFT 26 +#define OBERON_PCI_IMAP_T_DESTID_MASK 0x000000007fe00000ULL +#define OBERON_PCI_IMAP_T_DESTID_SHFT 21 +#define FO_PCI_IMAP_INT_CTRL_NUM_MASK 0x00000000000003c0ULL +#define FO_PCI_IMAP_INT_CTRL_NUM_SHFT 6 + +/* PCI interrupt clear registers - use INTCLR_* from */ + +/* PCI event queue base address register */ +#define FO_PCI_EQ_BASE_ADDR_BYPASS 0xfffc000000000000ULL +#define FO_PCI_EQ_BASE_ADDR_MASK 0xfffffffffff80000ULL +#define FO_PCI_EQ_BASE_ADDR_SHFT 19 + +/* PCI event queue control set registers */ +#define FO_PCI_EQ_CTRL_SET_ENOVERR 0x0200000000000000ULL +#define FO_PCI_EQ_CTRL_SET_EN 0x0000100000000000ULL + +/* PCI event queue control clear registers */ +#define FO_PCI_EQ_CTRL_CLR_COVERR 0x0200000000000000ULL +#define FO_PCI_EQ_CTRL_CLR_E2I 0x0000800000000000ULL +#define FO_PCI_EQ_CTRL_CLR_DIS 0x0000100000000000ULL + +/* PCI event queue tail registers */ +#define FO_PCI_EQ_TL_OVERR 0x0200000000000000ULL +#define FO_PCI_EQ_TL_MASK 0x000000000000007fULL +#define FO_PCI_EQ_TL_SHFT 0 + +/* PCI event queue head registers */ +#define FO_PCI_EQ_HD_MASK 0x000000000000007fULL +#define FO_PCI_EQ_HD_SHFT 0 + +/* PCI MSI mapping registers */ +#define FO_PCI_MSI_MAP_V 0x8000000000000000ULL +#define FO_PCI_MSI_MAP_EQWR_N 0x4000000000000000ULL +#define FO_PCI_MSI_MAP_EQNUM_MASK 0x000000000000003fULL +#define FO_PCI_MSI_MAP_EQNUM_SHFT 0 + +/* PCI MSI clear registers */ +#define FO_PCI_MSI_CLR_EQWR_N 0x4000000000000000ULL + +/* + * PCI IMU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_IMU_ERR_INT_SPARE_S_MASK 0x00007c0000000000ULL +#define FO_PCI_IMU_ERR_INT_SPARE_S_SHFT 42 +#define FO_PCI_IMU_ERR_INT_EQ_OVER_S 0x0000020000000000ULL +#define FO_PCI_IMU_ERR_INT_EQ_NOT_EN_S 0x0000010000000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_S 0x0000008000000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_S 0x0000004000000000ULL +#define FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_S 0x0000002000000000ULL +#define FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_S 0x0000001000000000ULL +#define FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_S 0x0000000800000000ULL +#define FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_S 0x0000000400000000ULL +#define FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_S 0x0000000200000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_NOT_EN_S 0x0000000100000000ULL +#define FO_PCI_IMU_ERR_INT_SPARE_P_MASK 0x0000000000007c00ULL +#define FO_PCI_IMU_ERR_INT_SPARE_P_SHFT 10 +#define FO_PCI_IMU_ERR_INT_EQ_OVER_P 0x0000000000000200ULL +#define FO_PCI_IMU_ERR_INT_EQ_NOT_EN_P 0x0000000000000100ULL +#define FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_P 0x0000000000000080ULL +#define FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_P 0x0000000000000040ULL +#define FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_P 0x0000000000000020ULL +#define FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_P 0x0000000000000010ULL +#define FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_P 0x0000000000000008ULL +#define FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_P 0x0000000000000004ULL +#define FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_P 0x0000000000000002ULL +#define FO_PCI_IMU_ERR_INT_MSI_NOT_EN_P 0x0000000000000001ULL + +/* PCI IMU RDS error log register */ +#define FO_PCI_IMU_RDS_ERR_LOG_TYPE_MASK 0xfc00000000000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_TYPE_SHFT 58 +#define FO_PCI_IMU_RDS_ERR_LOG_LENGTH_MASK 0x03ff000000000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_LENGTH_SHFT 48 +#define FO_PCI_IMU_RDS_ERR_LOG_REQ_ID_MASK 0x0000ffff00000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_REQ_ID_SHFT 32 +#define FO_PCI_IMU_RDS_ERR_LOG_TLP_TAG_MASK 0x00000000ff000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_TLP_TAG_SHFT 24 +#define FO_PCI_IMU_RDS_ERR_LOG_BE_MCODE_MASK 0x0000000000ff0000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_BE_MCODE_SHFT 16 +#define FO_PCI_IMU_RDS_ERR_LOG_MSI_DATA_MASK 0x000000000000ffffULL +#define FO_PCI_IMU_RDS_ERR_LOG_MSI_DATA_SHFT 0 + +/* PCI IMU SCS error log register */ +#define FO_PCI_IMU_SCS_ERR_LOG_TYPE_MASK 0xfc00000000000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_TYPE_SHFT 58 +#define FO_PCI_IMU_SCS_ERR_LOG_LENGTH_MASK 0x03ff000000000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_LENGTH_SHFT 48 +#define FO_PCI_IMU_SCS_ERR_LOG_REQ_ID_MASK 0x0000ffff00000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_REQ_ID_SHFT 32 +#define FO_PCI_IMU_SCS_ERR_LOG_TLP_TAG_MASK 0x00000000ff000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_TLP_TAG_SHFT 24 +#define FO_PCI_IMU_SCS_ERR_LOG_BE_MODE_MASK 0x0000000000ff0000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_BE_MCODE_SHFT 16 +#define FO_PCI_IMU_SCS_ERR_LOG_EQ_NUM_MASK 0x000000000000003fULL +#define FO_PCI_IMU_SCS_ERR_LOG_EQ_NUM_SHFT 0 + +/* PCI IMU EQS error log register */ +#define FO_PCI_IMU_EQS_ERR_LOG_EQ_NUM_MASK 0x000000000000003fULL +#define FO_PCI_IMU_EQS_ERROR_LOG_EQ_NUM_SHFT 0 + +/* + * PCI ERR COR, ERR NONFATAL, ERR FATAL, PM PME and PME To ACK mapping + * registers + */ +#define FO_PCI_ERR_PME_V 0x8000000000000000ULL +#define FO_PCI_ERR_PME_EQNUM_MASK 0x000000000000003fULL +#define FO_PCI_ERR_PME_EQNUM_SHFT 0 + +/* PCI DMC core and block interrupt enable register */ +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_DMC 0x8000000000000000ULL +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_MMU 0x0000000000000002ULL +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_IMU 0x0000000000000001ULL + +/* PCI DMC core and block error status register */ +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT_MMU 0x0000000000000002ULL +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT_IMU 0x0000000000000001ULL + +/* PCI multi core error status register */ +#define FO_PCI_MULTI_CORE_ERR_STAT_PEC 0x0000000000000002ULL +#define FO_PCI_MULTI_CORE_ERR_STAT_DMC 0x0000000000000001ULL + +/* PCI MSI 32-bit address register */ +#define FO_PCI_MSI_32_BIT_ADDR_MASK 0x00000000ffff0000ULL +#define FO_PCI_MSI_32_BIT_ADDR_SHFT 16 + +/* PCI MSI 64-bit address register */ +#define FO_PCI_MSI_64_BIT_ADDR_MASK 0x0000ffffffff0000ULL +#define FO_PCI_MSI_64_BIT_ADDR_SHFT 16 + +/* + * PCI MMU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_MMU_ERR_INT_S_MASK 0x0000ffff00000000ULL +#define FO_PCI_MMU_ERR_INT_S_SHFT 32 +#define FO_PCI_MMU_ERR_INT_TBW_DPE_S 0x0000800000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_ERR_S 0x0000400000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_UDE_S 0x0000200000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_DME_S 0x0000100000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE3_S 0x0000080000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE2_S 0x0000040000000000ULL +#define FO_PCI_MMU_ERR_INT_TTC_CAE_S 0x0000020000000000ULL +#define FIRE_PCI_MMU_ERR_INT_TTC_DPE_S 0x0000010000000000ULL +#define OBERON_PCI_MMU_ERR_INT_TTC_DUE_S 0x0000010000000000ULL +#define FO_PCI_MMU_ERR_INT_TTE_PRT_S 0x0000008000000000ULL +#define FO_PCI_MMU_ERR_INT_TTE_INV_S 0x0000004000000000ULL +#define FO_PCI_MMU_ERR_INT_TRN_OOR_S 0x0000002000000000ULL +#define FO_PCI_MMU_ERR_INT_TRN_ERR_S 0x0000001000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE1_S 0x0000000800000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE0_S 0x0000000400000000ULL +#define FO_PCI_MMU_ERR_INT_BYP_OOR_S 0x0000000200000000ULL +#define FO_PCI_MMU_ERR_INT_BYP_ERR_S 0x0000000100000000ULL +#define FO_PCI_MMU_ERR_INT_P_MASK 0x000000000000ffffULL +#define FO_PCI_MMU_ERR_INT_P_SHFT 0 +#define FO_PCI_MMU_ERR_INT_TBW_DPE_P 0x0000000000008000ULL +#define FO_PCI_MMU_ERR_INT_TBW_ERR_P 0x0000000000004000ULL +#define FO_PCI_MMU_ERR_INT_TBW_UDE_P 0x0000000000002000ULL +#define FO_PCI_MMU_ERR_INT_TBW_DME_P 0x0000000000001000ULL +#define FO_PCI_MMU_ERR_INT_SPARE3_P 0x0000000000000800ULL +#define FO_PCI_MMU_ERR_INT_SPARE2_P 0x0000000000000400ULL +#define FO_PCI_MMU_ERR_INT_TTC_CAE_P 0x0000000000000200ULL +#define FIRE_PCI_MMU_ERR_INT_TTC_DPE_P 0x0000000000000100ULL +#define OBERON_PCI_MMU_ERR_INT_TTC_DUE_P 0x0000000000000100ULL +#define FO_PCI_MMU_ERR_INT_TTE_PRT_P 0x0000000000000080ULL +#define FO_PCI_MMU_ERR_INT_TTE_INV_P 0x0000000000000040ULL +#define FO_PCI_MMU_ERR_INT_TRN_OOR_P 0x0000000000000020ULL +#define FO_PCI_MMU_ERR_INT_TRN_ERR_P 0x0000000000000010ULL +#define FO_PCI_MMU_ERR_INT_SPARE1_P 0x0000000000000008ULL +#define FO_PCI_MMU_ERR_INT_SPARE0_P 0x0000000000000004ULL +#define FO_PCI_MMU_ERR_INT_BYP_OOR_P 0x0000000000000002ULL +#define FO_PCI_MMU_ERR_INT_BYP_ERR_P 0x0000000000000001ULL + +/* PCI MMU translation fault address register */ +#define FO_PCI_MMU_TRANS_FAULT_ADDR_VA_MASK 0xfffffffffffffffcULL +#define FO_PCI_MMU_TRANS_FAULT_ADDR_VA_SHFT 2 + +/* PCI MMU translation fault status register */ +#define FO_PCI_MMU_TRANS_FAULT_STAT_ENTRY_MASK 0x000001ff00000000ULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_ENTRY_SHFT 32 +#define FO_PCI_MMU_TRANS_FAULT_STAT_TYPE_MASK 0x00000000007f0000ULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_TYPE_SHFT 16 +#define FO_PCI_MMU_TRANS_FAULT_STAT_ID_MASK 0x000000000000ffffULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_ID_SHFT 0 + +/* + * PCI ILU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_ILU_ERR_INT_SPARE3_S 0x0000008000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE2_S 0x0000004000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE1_S 0x0000002000000000ULL +#define FIRE_PCI_ILU_ERR_INT_IHB_PE_S 0x0000001000000000ULL +#define OBERON_PCI_ILU_ERR_INT_IHB_UE_S 0x0000001000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE3_P 0x0000000000000080ULL +#define FO_PCI_ILU_ERR_INT_SPARE2_P 0x0000000000000040ULL +#define FO_PCI_ILU_ERR_INT_SPARE1_P 0x0000000000000020ULL +#define FIRE_PCI_ILU_ERR_INT_IHB_PE_P 0x0000000000000010ULL +#define OBERON_PCI_ILU_ERR_INT_IHB_UE_P 0x0000000000000010ULL + +/* PCI DMC debug select registers for port a/b */ +#define FO_PCI_DMC_DBG_SEL_PORT_BLCK_MASK 0x00000000000003c0ULL +#define FO_PCI_DMC_DBG_SEL_PORT_BLCK_SHFT 6 +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_MASK 0x0000000000000038ULL +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SHFT 3 +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SGNL_MASK 0x0000000000000007ULL +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SGNL_SHFT 0 + +/* PCI PEC core and block interrupt enable register */ +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_PEC 0x8000000000000000ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_ILU 0x0000000000000008ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_UERR 0x0000000000000004ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_CERR 0x0000000000000002ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_OEVENT 0x0000000000000001ULL + +/* PCI PEC core and block interrupt status register */ +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_ILU 0x0000000000000008ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_UERR 0x0000000000000004ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_CERR 0x0000000000000002ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_OEVENT 0x0000000000000001ULL + +/* PCI TLU control register */ +#define FO_PCI_TLU_CTRL_L0S_TIM_MASK 0x00000000ff000000ULL +#define FO_PCI_TLU_CTRL_L0S_TIM_SHFT 24 +#define FO_PCI_TLU_CTRL_NWPR_EN 0x0000000000100000ULL +#define FO_PCI_TLU_CTRL_CTO_SEL_MASK 0x0000000000070000ULL +#define FO_PCI_TLU_CTRL_CTO_SEL_SHFT 16 +#define FO_PCI_TLU_CTRL_CFG_MASK 0x000000000000ffffULL +#define FO_PCI_TLU_CTRL_CFG_SHFT 0 +#define FO_PCI_TLU_CTRL_CFG_REMAIN_DETECT_QUIET 0x0000000000000100ULL + +/* + * PCI TLU other event interrupt enable, interrupt status and status clear + * registers + */ +#define FO_PCI_TLU_OEVENT_S_MASK 0x00ffffff00000000ULL +#define FO_PCI_TLU_OEVENT_S_SHFT 32 +#define FO_PCI_TLU_OEVENT_SPARE_S 0x0080000000000000ULL +#define FO_PCI_TLU_OEVENT_MFC_S 0x0040000000000000ULL +#define FO_PCI_TLU_OEVENT_CTO_S 0x0020000000000000ULL +#define FO_PCI_TLU_OEVENT_NFP_S 0x0010000000000000ULL +#define FO_PCI_TLU_OEVENT_LWC_S 0x0008000000000000ULL +#define FO_PCI_TLU_OEVENT_MRC_S 0x0004000000000000ULL +#define FO_PCI_TLU_OEVENT_WUC_S 0x0002000000000000ULL +#define FO_PCI_TLU_OEVENT_RUC_S 0x0001000000000000ULL +#define FO_PCI_TLU_OEVENT_CRS_S 0x0000800000000000ULL +#define FO_PCI_TLU_OEVENT_IIP_S 0x0000400000000000ULL +#define FO_PCI_TLU_OEVENT_EDP_S 0x0000200000000000ULL +#define FIRE_PCI_TLU_OEVENT_EHP_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_OEVENT_EHBUE_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_OEVENT_EDBUE_S 0x0000100000000000ULL +#define FO_PCI_TLU_OEVENT_LIN_S 0x0000080000000000ULL +#define FO_PCI_TLU_OEVENT_LRS_S 0x0000040000000000ULL +#define FO_PCI_TLU_OEVENT_LDN_S 0x0000020000000000ULL +#define FO_PCI_TLU_OEVENT_LUP_S 0x0000010000000000ULL +#define FO_PCI_TLU_OEVENT_LPU_S_MASK 0x000000c000000000ULL +#define FO_PCI_TLU_OEVENT_LPU_S_SHFT 38 +#define OBERON_PCI_TLU_OEVENT_TLUEITMO_S 0x0000008000000000ULL +#define FO_PCI_TLU_OEVENT_ERU_S 0x0000002000000000ULL +#define FO_PCI_TLU_OEVENT_ERO_S 0x0000001000000000ULL +#define FO_PCI_TLU_OEVENT_EMP_S 0x0000000800000000ULL +#define FO_PCI_TLU_OEVENT_EPE_S 0x0000000400000000ULL +#define FIRE_PCI_TLU_OEVENT_ERP_S 0x0000000200000000ULL +#define OBERON_PCI_TLU_OEVENT_ERBU_S 0x0000000200000000ULL +#define FIRE_PCI_TLU_OEVENT_EIP_S 0x0000000100000000ULL +#define OBERON_PCI_TLU_OEVENT_EIUE_S 0x0000000100000000ULL +#define FO_PCI_TLU_OEVENT_P_MASK 0x0000000000ffffffULL +#define FO_PCI_TLU_OEVENT_P_SHFT 0 +#define FO_PCI_TLU_OEVENT_SPARE_P 0x0000000000800000ULL +#define FO_PCI_TLU_OEVENT_MFC_P 0x0000000000400000ULL +#define FO_PCI_TLU_OEVENT_CTO_P 0x0000000000200000ULL +#define FO_PCI_TLU_OEVENT_NFP_P 0x0000000000100000ULL +#define FO_PCI_TLU_OEVENT_LWC_P 0x0000000000080000ULL +#define FO_PCI_TLU_OEVENT_MRC_P 0x0000000000040000ULL +#define FO_PCI_TLU_OEVENT_WUC_P 0x0000000000020000ULL +#define FO_PCI_TLU_OEVENT_RUC_P 0x0000000000010000ULL +#define FO_PCI_TLU_OEVENT_CRS_P 0x0000000000008000ULL +#define FO_PCI_TLU_OEVENT_IIP_P 0x0000000000004000ULL +#define FO_PCI_TLU_OEVENT_EDP_P 0x0000000000002000ULL +#define FIRE_PCI_TLU_OEVENT_EHP_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_OEVENT_EHBUE_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_OEVENT_EDBUE_P 0x0000000000001000ULL +#define FO_PCI_TLU_OEVENT_LIN_P 0x0000000000000800ULL +#define FO_PCI_TLU_OEVENT_LRS_P 0x0000000000000400ULL +#define FO_PCI_TLU_OEVENT_LDN_P 0x0000000000000200ULL +#define FO_PCI_TLU_OEVENT_LUP_P 0x0000000000000100ULL +#define FO_PCI_TLU_OEVENT_LPU_P_MASK 0x00000000000000c0ULL +#define FO_PCI_TLU_OEVENT_LPU_P_SHFT 6 +#define OBERON_PCI_TLU_OEVENT_TLUEITMO_P 0x0000000000000080ULL +#define FO_PCI_TLU_OEVENT_ERU_P 0x0000000000000020ULL +#define FO_PCI_TLU_OEVENT_ERO_P 0x0000000000000010ULL +#define FO_PCI_TLU_OEVENT_EMP_P 0x0000000000000008ULL +#define FO_PCI_TLU_OEVENT_EPE_P 0x0000000000000004ULL +#define FIRE_PCI_TLU_OEVENT_ERP_P 0x0000000000000002ULL +#define OBERON_PCI_TLU_OEVENT_ERBU_P 0x0000000000000002ULL +#define FIRE_PCI_TLU_OEVENT_EIP_P 0x0000000000000001ULL +#define OBERON_PCI_TLU_OEVENT_EIUE_P 0x0000000000000001ULL + +/* PCI receive/transmit DLU/TLU other event header 1/2 log registers */ +#define FO_PCI_TLU_OEVENT_HDR_LOG_MASK 0xffffffffffffffffULL +#define FO_PCI_TLU_OEVENT_HDR_LOG_SHFT 0 + +/* PCI TLU device control register */ +#define FO_PCI_TLU_DEV_CTRL_MRRS_MASK 0x0000000000007000ULL +#define FO_PCI_TLU_DEV_CTRL_MRRS_SHFT 12 +#define FO_PCI_TLU_DEV_CTRL_MPS_MASK 0x00000000000000e0ULL +#define FO_PCI_TLU_DEV_CTRL_MPS_SHFT 5 + +/* + * PCI TLU uncorrectable error interrupt enable, interrupt status and + * status clear registers + */ +#define FO_PCI_TLU_UERR_INT_S_MASK 0x001fffff00000000ULL +#define FO_PCI_TLU_UERR_INT_S_SHFT 32 +#define FO_PCI_TLU_UERR_INT_UR_S 0x0010000000000000ULL +#define OBERON_PCI_TLU_UERR_INT_ECRC_S 0x0008000000000000ULL +#define FO_PCI_TLU_UERR_INT_MFP_S 0x0004000000000000ULL +#define FO_PCI_TLU_UERR_INT_ROF_S 0x0002000000000000ULL +#define FO_PCI_TLU_UERR_INT_UC_S 0x0001000000000000ULL +#define FO_PCI_TLU_UERR_INT_CA_S 0x0000800000000000ULL +#define FO_PCI_TLU_UERR_INT_CTO_S 0x0000400000000000ULL +#define FO_PCI_TLU_UERR_INT_FCP_S 0x0000200000000000ULL +#define FIRE_PCI_TLU_UERR_INT_PP_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_UERR_INT_POIS_S 0x0000100000000000ULL +#define FO_PCI_TLU_UERR_INT_DLP_S 0x0000001000000000ULL +#define FO_PCI_TLU_UERR_INT_TE_S 0x0000000100000000ULL +#define FO_PCI_TLU_UERR_INT_P_MASK 0x00000000001fffffULL +#define FO_PCI_TLU_UERR_INT_P_SHFT 0 +#define FO_PCI_TLU_UERR_INT_UR_P 0x0000000000100000ULL +#define OBERON_PCI_TLU_UERR_INT_ECRC_P 0x0000000000080000ULL +#define FO_PCI_TLU_UERR_INT_MFP_P 0x0000000000040000ULL +#define FO_PCI_TLU_UERR_INT_ROF_P 0x0000000000020000ULL +#define FO_PCI_TLU_UERR_INT_UC_P 0x0000000000010000ULL +#define FO_PCI_TLU_UERR_INT_CA_P 0x0000000000008000ULL +#define FO_PCI_TLU_UERR_INT_CTO_P 0x0000000000004000ULL +#define FO_PCI_TLU_UERR_INT_FCP_P 0x0000000000002000ULL +#define FIRE_PCI_TLU_UERR_INT_PP_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_UERR_INT_POIS_P 0x0000000000001000ULL +#define FO_PCI_TLU_UERR_INT_DLP_P 0x0000000000000010ULL +#define FO_PCI_TLU_UERR_INT_TE_P 0x0000000000000001ULL + +/* + * PCI TLU correctable error interrupt enable, interrupt status and + * status clear registers + */ +#define FO_PCI_TLU_CERR_INT_S_MASK 0x001fffff00000000ULL +#define FO_PCI_TLU_CERR_INT_S_SHFT 32 +#define FO_PCI_TLU_CERR_INT_RTO_S 0x0000100000000000ULL +#define FO_PCI_TLU_CERR_INT_RNR_S 0x0000010000000000ULL +#define FO_PCI_TLU_CERR_INT_BDP_S 0x0000008000000000ULL +#define FO_PCI_TLU_CERR_INT_BTP_S 0x0000004000000000ULL +#define FO_PCI_TLU_CERR_INT_RE_S 0x0000000100000000ULL +#define FO_PCI_TLU_CERR_INT_P_MASK 0x00000000001fffffULL +#define FO_PCI_TLU_CERR_INT_P_SHFT 0 +#define FO_PCI_TLU_CERR_INT_RTO_P 0x0000000000001000ULL +#define FO_PCI_TLU_CERR_INT_RNR_P 0x0000000000000100ULL +#define FO_PCI_TLU_CERR_INT_BDP_P 0x0000000000000080ULL +#define FO_PCI_TLU_CERR_INT_BTP_P 0x0000000000000040ULL +#define FO_PCI_TLU_CERR_INT_RE_P 0x0000000000000001ULL + +/* PCI TLU reset register */ +#define FO_PCI_LPU_RST_WE 0x0000000080000000ULL +#define FO_PCI_LPU_RST_UNUSED_MASK 0x0000000000000e00ULL +#define FO_PCI_LPU_RST_UNUSED_SHFT 9 +#define FO_PCI_LPU_RST_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_RST_TXLINK 0x0000000000000080ULL +#define FO_PCI_LPU_RST_RXLINK 0x0000000000000040ULL +#define FO_PCI_LPU_RST_SMLINK 0x0000000000000020ULL +#define FO_PCI_LPU_RST_LTSSM 0x0000000000000010ULL +#define FO_PCI_LPU_RST_TXPHY 0x0000000000000008ULL +#define FO_PCI_LPU_RST_RXPHY 0x0000000000000004ULL +#define FO_PCI_LPU_RST_TXPCS 0x0000000000000002ULL +#define FO_PCI_LPU_RST_RXPCS 0x0000000000000001ULL + +/* PCI TLU link control register */ +#define FO_PCI_TLU_LNK_CTRL_EXTSYNC 0x0000000000000080ULL +#define FO_PCI_TLU_LNK_CTRL_CLK 0x0000000000000040ULL +#define FO_PCI_TLU_LNK_CTRL_RETRAIN 0x0000000000000020ULL +#define FO_PCI_TLU_LNK_CTRL_DIS 0x0000000000000010ULL +#define FO_PCI_TLU_LNK_CTRL_RCB 0x0000000000000008ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L0S_L1S 0x0000000000000003ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L1S 0x0000000000000002ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L0S 0x0000000000000001ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_DIS 0x0000000000000000ULL + +/* PCI TLU link status register */ +#define FO_PCI_TLU_LNK_STAT_CLK 0x0000000000001000ULL +#define FO_PCI_TLU_LNK_STAT_TRAIN 0x0000000000000800ULL +#define FO_PCI_TLU_LNK_STAT_ERR 0x0000000000000400ULL +#define FO_PCI_TLU_LNK_STAT_WDTH_MASK 0x00000000000003f0ULL +#define FO_PCI_TLU_LNK_STAT_WDTH_SHFT 4 +#define FO_PCI_TLU_LNK_STAT_SPEED_MASK 0x000000000000000fULL +#define FO_PCI_TLU_LNK_STAT_SPEED_SHFT 0 + +/* + * PCI receive/transmit DLU/TLU uncorrectable error header 1/2 log + * registers + */ +#define FO_PCI_TLU_UERR_HDR_LOG_MASK 0xffffffffffffffffULL +#define FO_PCI_TLU_UERR_HDR_LOG_SHFT 0 + +/* PCI DLU/LPU interrupt status and mask registers */ +#define FO_PCI_LPU_INT_INT 0x0000000080000000ULL +#define FIRE_PCI_LPU_INT_PRF_CNT2_OFLW 0x0000000000000080ULL +#define FIRE_PCI_LPU_INT_PRF_CNT1_OFLW 0x0000000000000040ULL +#define FO_PCI_LPU_INT_LNK_LYR 0x0000000000000020ULL +#define FO_PCI_LPU_INT_PHY_ERR 0x0000000000000010ULL +#define FIRE_PCI_LPU_INT_LTSSM 0x0000000000000008ULL +#define FIRE_PCI_LPU_INT_PHY_TX 0x0000000000000004ULL +#define FIRE_PCI_LPU_INT_PHY_RX 0x0000000000000002ULL +#define FIRE_PCI_LPU_INT_PHY_GB 0x0000000000000001ULL + +/* PCI DLU/LPU link layer config register */ +#define FIRE_PCI_LPU_LNK_LYR_CFG_AUTO_UPDT_DIS 0x0000000000080000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_FREQ_NAK_EN 0x0000000000040000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_RPLY_AFTER_REQ 0x0000000000020000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_LAT_THRS_WR_EN 0x0000000000010000ULL +#define FO_PCI_LPU_LNK_LYR_CFG_VC0_EN 0x0000000000000100ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_L0S_ADJ_FAC_EN 0x0000000000000010ULL +#define FIER_PCI_LPU_LNK_LYR_CFG_TLP_XMIT_FC_EN 0x0000000000000008ULL +#define FO_PCI_LPU_LNK_LYR_CFG_FREQ_ACK_EN 0x0000000000000004ULL +#define FO_PCI_LPU_LNK_LYR_CFG_RETRY_DIS 0x0000000000000002ULL + +/* PCI DLU/LPU link layer interrupt and status register */ +#define FO_PCI_LPU_LNK_LYR_INT_STAT_LNK_ERR_ACT 0x0000000080000000ULL +#define OBERON_PCI_LPU_LNK_LYR_INT_STAT_PBUS_PE 0x0000000000800000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_USPRTD_DLLP 0x0000000000400000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_DLLP_RX_ERR 0x0000000000200000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_BAD_DLLP 0x0000000000100000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_TLP_RX_ERR 0x0000000000040000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_SRC_ERR_TLP 0x0000000000020000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_BAD_TLP 0x0000000000010000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_UDF_ERR 0x0000000000000200ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_OVF_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EG_TLPM_ERR 0x0000000000000080ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EG_TFRM_ERR 0x0000000000000040ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_PE 0x0000000000000020ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EGRESS_PE 0x0000000000000010ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RPLY_TMR_TO 0x0000000000000004ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RPLY_NUM_RO 0x0000000000000002ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_DLNK_PES 0x0000000000000001ULL + +/* PCI DLU/LPU flow control update control register */ +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_C_EN 0x0000000000000004ULL +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_NP_EN 0x0000000000000002ULL +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_P_EN 0x0000000000000001ULL + +/* PCI DLU/LPU txlink ACKNAK latency timer threshold register */ +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_MASK 0x000000000000ffffULL +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_SHFT 0 + +/* PCI DLU/LPU txlink replay timer threshold register */ +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_MASK 0x00000000000fffffULL +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_SHFT 0 + +/* PCI DLU/LPU txlink FIFO pointer register */ +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_MASK 0x00000000ffff0000ULL +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_SHFT 16 +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_MASK 0x000000000000ffffULL +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_SHFT 0 + +/* PCI DLU/LPU phy layer interrupt and status register */ +#define FO_PCI_LPU_PHY_LYR_INT_STAT_PHY_LYR_ERR 0x0000000080000000ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_KC_DLLP_ERR 0x0000000000000800ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_END_POS_ERR 0x0000000000000400ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_LNK_ERR 0x0000000000000200ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_TRN_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_EDB_DET 0x0000000000000080ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_SDP_END 0x0000000000000040ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_STP_END_EDB 0x0000000000000020ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_INVC_ERR 0x0000000000000010ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_MULTI_SDP 0x0000000000000008ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_MULTI_STP 0x0000000000000004ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_ILL_SDP_POS 0x0000000000000002ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_ILL_STP_POS 0x0000000000000001ULL + +/* PCI DLU/LPU LTSSM config2 register */ +#define FO_PCI_LPU_LTSSM_CFG2_12_TO_MASK 0x00000000ffffffffULL +#define FO_PCI_LPU_LTSSM_CFG2_12_TO_SHFT 0 + +/* PCI DLU/LPU LTSSM config3 register */ +#define FO_PCI_LPU_LTSSM_CFG3_2_TO_MASK 0x00000000ffffffffULL +#define FO_PCI_LPU_LTSSM_CFG3_2_TO_SHFT 0 + +/* PCI DLU/LPU LTSSM config4 register */ +#define FO_PCI_LPU_LTSSM_CFG4_TRN_CTRL_MASK 0x00000000ff000000ULL +#define FO_PCI_LPU_LTSSM_CFG4_TRN_CTRL_SHFT 24 +#define FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_MASK 0x0000000000ff0000ULL +#define FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_SHFT 16 +#define FO_PCI_LPU_LTSSM_CFG4_N_FTS_MASK 0x000000000000ff00ULL +#define FO_PCI_LPU_LTSSM_CFG4_N_FTS_SHFT 8 +#define FO_PCI_LPU_LTSSM_CFG4_LNK_NUM_MASK 0x00000000000000ffULL +#define FO_PCI_LPU_LTSSM_CFG4_LNK_NUM_SHFT 0 + +/* PCI DLU/LPU LTSSM config5 register */ +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED0_MASK 0x00000000ffffe000ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED0_SHFT 13 +#define FO_PCI_LPU_LTSSM_CFG5_RCV_DET_TST_MODE 0x0000000000001000ULL +#define FO_PCI_LPU_LTSSM_CFG5_POLL_CMPLNC_DIS 0x0000000000000800ULL +#define FO_PCI_LPU_LTSSM_CFG5_TX_IDLE_TX_FTS 0x0000000000000400ULL +#define FO_PCI_LPU_LTSSM_CFG5_RX_FTS_RVR_LK 0x0000000000000200ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED1_MASK 0x0000000000000180ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED1_SHFT 7 +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_NTRY_ACTIVE 0x0000000000000040ULL +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_NTRY_EXIT 0x0000000000000020ULL +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_ACTIVE_EXIT 0x0000000000000010ULL +#define FO_PCI_LPU_LTSSM_CFG5_L1_IDLE_RCVRY_LK 0x0000000000000008ULL +#define FO_PCI_LPU_LTSSM_CFG5_L0_TRN_CNTRL_RST 0x0000000000000004ULL +#define FO_PCI_LPU_LTSSM_CFG5_L0_LPBK 0x0000000000000002ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED2 0x0000000000000001ULL + +/* Controller configuration and status registers */ +#define FIRE_JBUS_PAR_CTRL 0x60010 +#define FO_XBC_ERR_LOG_EN 0x61000 +#define FO_XBC_INT_EN 0x61008 +#define FO_XBC_INT_STAT 0x61010 +#define FO_XBC_ERR_STAT_CLR 0x61018 +#define FIRE_JBC_FATAL_RST_EN 0x61028 +#define FIRE_JBCINT_ITRANS_ERR_LOG 0x61040 +#define FIRE_JBCINT_ITRANS_ERR_LOG2 0x61048 +#define FIRE_JBCINT_OTRANS_ERR_LOG 0x61040 +#define FIRE_JBCINT_OTRANS_ERR_LOG2 0x61048 +#define FIRE_FATAL_ERR_LOG 0x61050 +#define FIRE_FATAL_ERR_LOG2 0x61058 +#define FIRE_MERGE_TRANS_ERR_LOG 0x61060 +#define FIRE_DMCINT_ODCD_ERR_LOG 0x61068 +#define FIRE_DMCINT_IDC_ERR_LOG 0x61070 +#define FIRE_JBC_CSR_ERR_LOG 0x61078 +#define FIRE_JBC_CORE_BLOCK_INT_EN 0x61800 +#define FIRE_JBC_CORE_BLOCK_ERR_STAT 0x61808 +#define FO_XBC_PRF_CNT_SEL 0x62000 +#define FO_XBC_PRF_CNT0 0x62008 +#define FO_XBC_PRF_CNT1 0x62010 + +/* JBus parity control register */ +#define FIRE_JBUS_PAR_CTRL_P_EN 0x8000000000000000ULL +#define FIRE_JBUS_PAR_CTRL_INVRTD_PAR_MASK 0x000000000000003cULL +#define FIRE_JBUS_PAR_CTRL_INVRTD_PAR_SHFT 2 +#define FIRE_JBUS_PAR_CTRL_NEXT_DATA 0x0000000000000002ULL +#define FIRE_JBUS_PAR_CTRL_NEXT_ADDR 0x0000000000000001ULL + +/* JBC error log enable register - may also apply to UBC */ +#define FIRE_JBC_ERR_LOG_EN_SPARE_MASK 0x00000000e0000000ULL +#define FIRE_JBC_ERR_LOG_EN_SPARE_SHFT 29 +#define FIRE_JBC_ERR_LOG_EN_PIO_UNMAP_RD 0x0000000010000000ULL +#define FIRE_JBC_ERR_LOG_EN_ILL_ACC_RD 0x0000000008000000ULL +#define FIRE_JBC_ERR_LOG_EN_EBUS_TO 0x0000000004000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PEA 0x0000000002000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PER 0x0000000001000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PEW 0x0000000000800000ULL +#define FIRE_JBC_ERR_LOG_EN_UE_ASYN 0x0000000000400000ULL +#define FIRE_JBC_ERR_LOG_EN_CE_ASYN 0x0000000000200000ULL +#define FIRE_JBC_ERR_LOG_EN_JTE 0x0000000000100000ULL +#define FIRE_JBC_ERR_LOG_EN_JBE 0x0000000000080000ULL +#define FIRE_JBC_ERR_LOG_EN_JUE 0x0000000000040000ULL +#define FIRE_JBC_ERR_LOG_EN_IJP 0x0000000000020000ULL +#define FIRE_JBC_ERR_LOG_EN_ICISE 0x0000000000010000ULL +#define FIRE_JBC_ERR_LOG_EN_CPE 0x0000000000008000ULL +#define FIRE_JBC_ERR_LOG_EN_APE 0x0000000000004000ULL +#define FIRE_JBC_ERR_LOG_EN_WR_DPE 0x0000000000002000ULL +#define FIRE_JBC_ERR_LOG_EN_RD_DPE 0x0000000000001000ULL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 23:54:14 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB33106566B; Fri, 15 Jan 2010 23:54:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78CF98FC14; Fri, 15 Jan 2010 23:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FNsEwA027211; Fri, 15 Jan 2010 23:54:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FNsEkI027209; Fri, 15 Jan 2010 23:54:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001152354.o0FNsEkI027209@svn.freebsd.org> From: Alexander Motin Date: Fri, 15 Jan 2010 23:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202426 - stable/7/sbin/geom/class/stripe X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 23:54:14 -0000 Author: mav Date: Fri Jan 15 23:54:14 2010 New Revision: 202426 URL: http://svn.freebsd.org/changeset/base/202426 Log: MFC r201658: Increase default block size from 4K to 64K. It was reduces 6 yeard ago, when trees were big and FAST mode was enabled by default. So small block size doesn't benefits linear I/O operations in FAST and significantly slowdowns in ECONOMIC (default) mode. For single stream random I/Os so small block doesn't give much benefits, as access time is usually bigger then transfer time there. Same time it requires all heads to seek together for every single request, reducing performance on parallel load. Modified: stable/7/sbin/geom/class/stripe/geom_stripe.c Directory Properties: stable/7/sbin/geom/class/stripe/ (props changed) Modified: stable/7/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- stable/7/sbin/geom/class/stripe/geom_stripe.c Fri Jan 15 23:52:31 2010 (r202425) +++ stable/7/sbin/geom/class/stripe/geom_stripe.c Fri Jan 15 23:54:14 2010 (r202426) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_STRIPE_VERSION; -static intmax_t default_stripesize = 4096; +static intmax_t default_stripesize = 65536; static void stripe_main(struct gctl_req *req, unsigned flags); static void stripe_clear(struct gctl_req *req); From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 16 09:24:12 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81B25106566C; Sat, 16 Jan 2010 09:24:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF658FC14; Sat, 16 Jan 2010 09:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0G9OCFV052841; Sat, 16 Jan 2010 09:24:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G9OCJM052839; Sat, 16 Jan 2010 09:24:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001160924.o0G9OCJM052839@svn.freebsd.org> From: Christian Brueffer Date: Sat, 16 Jan 2010 09:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202435 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 09:24:12 -0000 Author: brueffer Date: Sat Jan 16 09:24:12 2010 New Revision: 202435 URL: http://svn.freebsd.org/changeset/base/202435 Log: MFC: r201888 bridge(4) acts like a switch, not like a hub. Modified: stable/7/share/man/man4/if_bridge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/if_bridge.4 ============================================================================== --- stable/7/share/man/man4/if_bridge.4 Sat Jan 16 09:17:33 2010 (r202434) +++ stable/7/share/man/man4/if_bridge.4 Sat Jan 16 09:24:12 2010 (r202435) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd January 9, 2010 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -95,7 +95,7 @@ The address can be changed by assigning A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. .Pp -A bridge works like a hub, forwarding traffic from one interface +A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge.