From owner-svn-src-all@FreeBSD.ORG Sun Apr 3 03:26:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 810A91065674; Sun, 3 Apr 2011 03:26:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66F358FC18; Sun, 3 Apr 2011 03:26: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 p333QCHC000943; Sun, 3 Apr 2011 03:26:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333QCoV000940; Sun, 3 Apr 2011 03:26:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201104030326.p333QCoV000940@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 3 Apr 2011 03:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220283 - head/sys/boot/ia64/ski X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2011 03:26:12 -0000 Author: marcel Date: Sun Apr 3 03:26:12 2011 New Revision: 220283 URL: http://svn.freebsd.org/changeset/base/220283 Log: Make the ski loader functional again after the previous set of changes. Modified: head/sys/boot/ia64/ski/efi_stub.c head/sys/boot/ia64/ski/skimd.c Modified: head/sys/boot/ia64/ski/efi_stub.c ============================================================================== --- head/sys/boot/ia64/ski/efi_stub.c Sat Apr 2 21:52:58 2011 (r220282) +++ head/sys/boot/ia64/ski/efi_stub.c Sun Apr 3 03:26:12 2011 (r220283) @@ -223,39 +223,37 @@ ResetSystem(enum efi_reset type, efi_sta void efi_stub_init(struct bootinfo *bi) { - struct efi_md *memp; + static struct efi_md memmap[4]; /* Describe the SKI memory map. */ - bi->bi_memmap = (u_int64_t)(bi + 1); - bi->bi_memmap_size = 4 * sizeof(struct efi_md); + bi->bi_memmap = (uintptr_t)(void *)memmap; + bi->bi_memmap_size = sizeof(memmap); bi->bi_memdesc_size = sizeof(struct efi_md); bi->bi_memdesc_version = 1; - memp = (struct efi_md *)bi->bi_memmap; - - memp[0].md_type = EFI_MD_TYPE_PALCODE; - memp[0].md_phys = 0x100000; - memp[0].md_virt = NULL; - memp[0].md_pages = (4L*1024*1024)>>12; - memp[0].md_attr = EFI_MD_ATTR_WB | EFI_MD_ATTR_RT; - - memp[1].md_type = EFI_MD_TYPE_FREE; - memp[1].md_phys = 5L*1024*1024; - memp[1].md_virt = NULL; - memp[1].md_pages = (128L*1024*1024)>>12; - memp[1].md_attr = EFI_MD_ATTR_WB; - - memp[2].md_type = EFI_MD_TYPE_FREE; - memp[2].md_phys = 4L*1024*1024*1024; - memp[2].md_virt = NULL; - memp[2].md_pages = (64L*1024*1024)>>12; - memp[2].md_attr = EFI_MD_ATTR_WB; - - memp[3].md_type = EFI_MD_TYPE_IOPORT; - memp[3].md_phys = 0xffffc000000; - memp[3].md_virt = NULL; - memp[3].md_pages = (64L*1024*1024)>>12; - memp[3].md_attr = EFI_MD_ATTR_UC; + memmap[0].md_type = EFI_MD_TYPE_PALCODE; + memmap[0].md_phys = 0x100000; + memmap[0].md_virt = NULL; + memmap[0].md_pages = (1L*1024*1024)>>12; + memmap[0].md_attr = EFI_MD_ATTR_WB | EFI_MD_ATTR_RT; + + memmap[1].md_type = EFI_MD_TYPE_FREE; + memmap[1].md_phys = 4L*1024*1024; + memmap[1].md_virt = NULL; + memmap[1].md_pages = (128L*1024*1024)>>12; + memmap[1].md_attr = EFI_MD_ATTR_WB; + + memmap[2].md_type = EFI_MD_TYPE_FREE; + memmap[2].md_phys = 4L*1024*1024*1024; + memmap[2].md_virt = NULL; + memmap[2].md_pages = (64L*1024*1024)>>12; + memmap[2].md_attr = EFI_MD_ATTR_WB; + + memmap[3].md_type = EFI_MD_TYPE_IOPORT; + memmap[3].md_phys = 0xffffc000000; + memmap[3].md_virt = NULL; + memmap[3].md_pages = (64L*1024*1024)>>12; + memmap[3].md_attr = EFI_MD_ATTR_UC; bi->bi_systab = (u_int64_t)&efi_systab; } Modified: head/sys/boot/ia64/ski/skimd.c ============================================================================== --- head/sys/boot/ia64/ski/skimd.c Sat Apr 2 21:52:58 2011 (r220282) +++ head/sys/boot/ia64/ski/skimd.c Sun Apr 3 03:26:12 2011 (r220283) @@ -43,9 +43,9 @@ ia64_platform_alloc(vm_offset_t va, vm_s vm_paddr_t pa; if (va == 0) - pa = 1024 * 1024; + pa = 2 * 1024 * 1024; else - pa = (va - IA64_PBVM_BASE) + (64 * 1024 * 1024); + pa = (va - IA64_PBVM_BASE) + (32 * 1024 * 1024); return (pa); } @@ -65,7 +65,9 @@ ia64_platform_bootinfo(struct bootinfo * sal_stub_init(); acpi_stub_init(); - *res = &bootinfo; + if (IS_LEGACY_KERNEL()) + *res = &bootinfo; + return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 3 03:40:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B222106566B; Sun, 3 Apr 2011 03:40:00 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A87C8FC17; Sun, 3 Apr 2011 03:40: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 p333e0d3001233; Sun, 3 Apr 2011 03:40:00 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333e0r3001227; Sun, 3 Apr 2011 03:40:00 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201104030340.p333e0r3001227@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 3 Apr 2011 03:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220284 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2011 03:40:00 -0000 Author: edwin Date: Sun Apr 3 03:39:59 2011 New Revision: 220284 URL: http://svn.freebsd.org/changeset/base/220284 Log: Vendor import of tzdata2011e: Change for Africa/Casablanca: - The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 - The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 Update for SouthAmerica/Chili: - Chile's clocks will go back an hour this year on the 7th of May instead of this Saturday. They will go forward again the 3rd Saturday in August, not in October as they have since 1968. This is a pilot plan which will be reevaluated in 2012. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/africa vendor/tzdata/dist/asia vendor/tzdata/dist/europe vendor/tzdata/dist/southamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Sun Apr 3 03:26:12 2011 (r220283) +++ vendor/tzdata/dist/africa Sun Apr 3 03:39:59 2011 (r220284) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.28
+# @(#)africa	8.30
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -712,6 +712,48 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # 
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# 
+# http://www.anrt.net.ma/fr/
+# 
+# They said that
+# 
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# 
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# 
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# 
+# e.html
+# 
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# 
+# 
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# 
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# 
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# 
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -735,6 +777,8 @@ Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16

Modified: vendor/tzdata/dist/asia
==============================================================================
--- vendor/tzdata/dist/asia	Sun Apr  3 03:26:12 2011	(r220283)
+++ vendor/tzdata/dist/asia	Sun Apr  3 03:39:59 2011	(r220284)
@@ -1,4 +1,4 @@
-# @(#)asia	8.62
+# @(#)asia	8.64
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: vendor/tzdata/dist/europe
==============================================================================
--- vendor/tzdata/dist/europe	Sun Apr  3 03:26:12 2011	(r220283)
+++ vendor/tzdata/dist/europe	Sun Apr  3 03:39:59 2011	(r220284)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.28
+# @(#)europe	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: vendor/tzdata/dist/southamerica
==============================================================================
--- vendor/tzdata/dist/southamerica	Sun Apr  3 03:26:12 2011	(r220283)
+++ vendor/tzdata/dist/southamerica	Sun Apr  3 03:39:59 2011	(r220284)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.45
+# @(#)southamerica	8.47
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1171,6 +1171,19 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# 
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# 
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1200,13 +1213,16 @@ Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.

Modified: vendor/tzdata/dist/zone.tab
==============================================================================
--- vendor/tzdata/dist/zone.tab	Sun Apr  3 03:26:12 2011	(r220283)
+++ vendor/tzdata/dist/zone.tab	Sun Apr  3 03:39:59 2011	(r220284)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.41
+# @(#)zone.tab	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 03:40:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4431B106566C;
	Sun,  3 Apr 2011 03:40:58 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1BA008FC1A;
	Sun,  3 Apr 2011 03:40: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 p333evtN001299;
	Sun, 3 Apr 2011 03:40:57 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333evNr001298;
	Sun, 3 Apr 2011 03:40:57 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201104030340.p333evNr001298@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 3 Apr 2011 03:40:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220285 - vendor/tzdata/tzdata2011e
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 03:40:58 -0000

Author: edwin
Date: Sun Apr  3 03:40:57 2011
New Revision: 220285
URL: http://svn.freebsd.org/changeset/base/220285

Log:
  Tag of tzdata2011e

Added:
  vendor/tzdata/tzdata2011e/
     - copied from r220284, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 03:42:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C16A1065670;
	Sun,  3 Apr 2011 03:42:42 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C4218FC0A;
	Sun,  3 Apr 2011 03:42: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 p333ggcn001400;
	Sun, 3 Apr 2011 03:42:42 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333ggvN001394;
	Sun, 3 Apr 2011 03:42:42 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201104030342.p333ggvN001394@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 3 Apr 2011 03:42:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220286 - head/contrib/tzdata
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 03:42:42 -0000

Author: edwin
Date: Sun Apr  3 03:42:42 2011
New Revision: 220286
URL: http://svn.freebsd.org/changeset/base/220286

Log:
  MFV of tzdata2011e:
  
  Change for Africa/Casablanca:
  - The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
  - The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
  
  Update for SouthAmerica/Chili:
  - Chile's clocks will go back an hour this year on the 7th of May instead
    of this Saturday. They will go forward again the 3rd Saturday in
    August, not in October as they have since 1968. This is a pilot plan
    which will be reevaluated in 2012.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/asia
  head/contrib/tzdata/europe
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==============================================================================
--- head/contrib/tzdata/africa	Sun Apr  3 03:40:57 2011	(r220285)
+++ head/contrib/tzdata/africa	Sun Apr  3 03:42:42 2011	(r220286)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.28
+# @(#)africa	8.30
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -712,6 +712,48 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # 
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# 
+# http://www.anrt.net.ma/fr/
+# 
+# They said that
+# 
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# 
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# 
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# 
+# e.html
+# 
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# 
+# 
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# 
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# 
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# 
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -735,6 +777,8 @@ Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16

Modified: head/contrib/tzdata/asia
==============================================================================
--- head/contrib/tzdata/asia	Sun Apr  3 03:40:57 2011	(r220285)
+++ head/contrib/tzdata/asia	Sun Apr  3 03:42:42 2011	(r220286)
@@ -1,4 +1,4 @@
-# @(#)asia	8.62
+# @(#)asia	8.64
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Sun Apr  3 03:40:57 2011	(r220285)
+++ head/contrib/tzdata/europe	Sun Apr  3 03:42:42 2011	(r220286)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.28
+# @(#)europe	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: head/contrib/tzdata/southamerica
==============================================================================
--- head/contrib/tzdata/southamerica	Sun Apr  3 03:40:57 2011	(r220285)
+++ head/contrib/tzdata/southamerica	Sun Apr  3 03:42:42 2011	(r220286)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.45
+# @(#)southamerica	8.47
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1171,6 +1171,19 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# 
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# 
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1200,13 +1213,16 @@ Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Sun Apr  3 03:40:57 2011	(r220285)
+++ head/contrib/tzdata/zone.tab	Sun Apr  3 03:42:42 2011	(r220286)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.41
+# @(#)zone.tab	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 03:43:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 789DB106566B;
	Sun,  3 Apr 2011 03:43:47 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6835F8FC1A;
	Sun,  3 Apr 2011 03:43: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 p333hlFc001474;
	Sun, 3 Apr 2011 03:43:47 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333hlGt001468;
	Sun, 3 Apr 2011 03:43:47 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201104030343.p333hlGt001468@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 3 Apr 2011 03:43:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220287 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 03:43:47 -0000

Author: edwin
Date: Sun Apr  3 03:43:47 2011
New Revision: 220287
URL: http://svn.freebsd.org/changeset/base/220287

Log:
  MFC of 220286, tzdata2011e:
  
  Change for Africa/Casablanca:
  - The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
  - The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
  
  Update for SouthAmerica/Chili:
  - Chile's clocks will go back an hour this year on the 7th of May instead
    of this Saturday. They will go forward again the 3rd Saturday in
    August, not in October as they have since 1968. This is a pilot plan
    which will be reevaluated in 2012.

Modified:
  stable/8/share/zoneinfo/africa
  stable/8/share/zoneinfo/asia
  stable/8/share/zoneinfo/europe
  stable/8/share/zoneinfo/southamerica
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/africa
==============================================================================
--- stable/8/share/zoneinfo/africa	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/africa	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.28
+# @(#)africa	8.30
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -712,6 +712,48 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # 
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# 
+# http://www.anrt.net.ma/fr/
+# 
+# They said that
+# 
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# 
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# 
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# 
+# e.html
+# 
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# 
+# 
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# 
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# 
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# 
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -735,6 +777,8 @@ Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16

Modified: stable/8/share/zoneinfo/asia
==============================================================================
--- stable/8/share/zoneinfo/asia	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/asia	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,4 +1,4 @@
-# @(#)asia	8.62
+# @(#)asia	8.64
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/8/share/zoneinfo/europe
==============================================================================
--- stable/8/share/zoneinfo/europe	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/europe	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.28
+# @(#)europe	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/southamerica	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.45
+# @(#)southamerica	8.47
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1171,6 +1171,19 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# 
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# 
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1200,13 +1213,16 @@ Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Sun Apr  3 03:42:42 2011	(r220286)
+++ stable/8/share/zoneinfo/zone.tab	Sun Apr  3 03:43:47 2011	(r220287)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.41
+# @(#)zone.tab	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 03:44:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E93C41065676;
	Sun,  3 Apr 2011 03:44:48 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D89EB8FC0C;
	Sun,  3 Apr 2011 03:44:48 +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 p333im1v001572;
	Sun, 3 Apr 2011 03:44:48 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333imQB001566;
	Sun, 3 Apr 2011 03:44:48 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201104030344.p333imQB001566@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 3 Apr 2011 03:44:48 +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: r220288 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 03:44:49 -0000

Author: edwin
Date: Sun Apr  3 03:44:48 2011
New Revision: 220288
URL: http://svn.freebsd.org/changeset/base/220288

Log:
  MFC of 220286, tzdata2011e:
  
  Change for Africa/Casablanca:
  - The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
  - The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
  
  Update for SouthAmerica/Chili:
  - Chile's clocks will go back an hour this year on the 7th of May instead
    of this Saturday. They will go forward again the 3rd Saturday in
    August, not in October as they have since 1968. This is a pilot plan
    which will be reevaluated in 2012.

Modified:
  stable/7/share/zoneinfo/africa
  stable/7/share/zoneinfo/asia
  stable/7/share/zoneinfo/europe
  stable/7/share/zoneinfo/southamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/africa
==============================================================================
--- stable/7/share/zoneinfo/africa	Sun Apr  3 03:43:47 2011	(r220287)
+++ stable/7/share/zoneinfo/africa	Sun Apr  3 03:44:48 2011	(r220288)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.28
+# @(#)africa	8.30
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -712,6 +712,48 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # 
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# 
+# http://www.anrt.net.ma/fr/
+# 
+# They said that
+# 
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# 
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# 
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# 
+# e.html
+# 
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# 
+# 
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# 
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# 
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# 
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -735,6 +777,8 @@ Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Sun Apr  3 03:43:47 2011	(r220287)
+++ stable/7/share/zoneinfo/asia	Sun Apr  3 03:44:48 2011	(r220288)
@@ -1,4 +1,4 @@
-# @(#)asia	8.62
+# @(#)asia	8.64
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/7/share/zoneinfo/europe
==============================================================================
--- stable/7/share/zoneinfo/europe	Sun Apr  3 03:43:47 2011	(r220287)
+++ stable/7/share/zoneinfo/europe	Sun Apr  3 03:44:48 2011	(r220288)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.28
+# @(#)europe	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Sun Apr  3 03:43:47 2011	(r220287)
+++ stable/7/share/zoneinfo/southamerica	Sun Apr  3 03:44:48 2011	(r220288)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.45
+# @(#)southamerica	8.47
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1171,6 +1171,19 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# 
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# 
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1200,13 +1213,16 @@ Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Sun Apr  3 03:43:47 2011	(r220287)
+++ stable/7/share/zoneinfo/zone.tab	Sun Apr  3 03:44:48 2011	(r220288)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.41
+# @(#)zone.tab	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 03:45:45 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFBAF106566B;
	Sun,  3 Apr 2011 03:45:45 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F56F8FC1B;
	Sun,  3 Apr 2011 03:45: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 p333jjC6001657;
	Sun, 3 Apr 2011 03:45:45 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p333jjHd001651;
	Sun, 3 Apr 2011 03:45:45 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201104030345.p333jjHd001651@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 3 Apr 2011 03:45:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220289 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 03:45:45 -0000

Author: edwin
Date: Sun Apr  3 03:45:45 2011
New Revision: 220289
URL: http://svn.freebsd.org/changeset/base/220289

Log:
  MFC of 220286, tzdata2011e:
  
  Change for Africa/Casablanca:
  - The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
  - The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
  
  Update for SouthAmerica/Chili:
  - Chile's clocks will go back an hour this year on the 7th of May instead
    of this Saturday. They will go forward again the 3rd Saturday in
    August, not in October as they have since 1968. This is a pilot plan
    which will be reevaluated in 2012.

Modified:
  stable/6/share/zoneinfo/africa
  stable/6/share/zoneinfo/asia
  stable/6/share/zoneinfo/europe
  stable/6/share/zoneinfo/southamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/africa
==============================================================================
--- stable/6/share/zoneinfo/africa	Sun Apr  3 03:44:48 2011	(r220288)
+++ stable/6/share/zoneinfo/africa	Sun Apr  3 03:45:45 2011	(r220289)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.28
+# @(#)africa	8.30
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -712,6 +712,48 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # 
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# 
+# http://www.anrt.net.ma/fr/
+# 
+# They said that
+# 
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# 
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# 
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# 
+# e.html
+# 
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# 
+# 
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# 
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# 
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# 
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -735,6 +777,8 @@ Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16

Modified: stable/6/share/zoneinfo/asia
==============================================================================
--- stable/6/share/zoneinfo/asia	Sun Apr  3 03:44:48 2011	(r220288)
+++ stable/6/share/zoneinfo/asia	Sun Apr  3 03:45:45 2011	(r220289)
@@ -1,4 +1,4 @@
-# @(#)asia	8.62
+# @(#)asia	8.64
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/6/share/zoneinfo/europe
==============================================================================
--- stable/6/share/zoneinfo/europe	Sun Apr  3 03:44:48 2011	(r220288)
+++ stable/6/share/zoneinfo/europe	Sun Apr  3 03:45:45 2011	(r220289)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.28
+# @(#)europe	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 

Modified: stable/6/share/zoneinfo/southamerica
==============================================================================
--- stable/6/share/zoneinfo/southamerica	Sun Apr  3 03:44:48 2011	(r220288)
+++ stable/6/share/zoneinfo/southamerica	Sun Apr  3 03:45:45 2011	(r220289)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.45
+# @(#)southamerica	8.47
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1171,6 +1171,19 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# 
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# 
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1200,13 +1213,16 @@ Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.

Modified: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Sun Apr  3 03:44:48 2011	(r220288)
+++ stable/6/share/zoneinfo/zone.tab	Sun Apr  3 03:45:45 2011	(r220289)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.41
+# @(#)zone.tab	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 05:09:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DE2B106566B;
	Sun,  3 Apr 2011 05:09:26 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DA638FC14;
	Sun,  3 Apr 2011 05:09: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 p3359QY9003519;
	Sun, 3 Apr 2011 05:09:26 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3359QZi003516;
	Sun, 3 Apr 2011 05:09:26 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201104030509.p3359QZi003516@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sun, 3 Apr 2011 05:09:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220290 - in head/sys/boot: common sparc64/loader
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 05:09:26 -0000

Author: marcel
Date: Sun Apr  3 05:09:25 2011
New Revision: 220290
URL: http://svn.freebsd.org/changeset/base/220290

Log:
  Revert rev 165325. The arch_maphint interface hasn't been in use for
  more than 4 years.

Modified:
  head/sys/boot/common/bootstrap.h
  head/sys/boot/sparc64/loader/main.c

Modified: head/sys/boot/common/bootstrap.h
==============================================================================
--- head/sys/boot/common/bootstrap.h	Sun Apr  3 03:45:45 2011	(r220289)
+++ head/sys/boot/common/bootstrap.h	Sun Apr  3 05:09:25 2011	(r220290)
@@ -296,8 +296,6 @@ struct arch_switch
     /* Perform ISA byte port I/O (only for systems with ISA) */
     int		(*arch_isainb)(int port);
     void	(*arch_isaoutb)(int port, int value);
-    /* Pass in initial kernel memory size */
-    void        (*arch_maphint)(vm_offset_t va, size_t len);	
 };
 extern struct arch_switch archsw;
 

Modified: head/sys/boot/sparc64/loader/main.c
==============================================================================
--- head/sys/boot/sparc64/loader/main.c	Sun Apr  3 03:45:45 2011	(r220289)
+++ head/sys/boot/sparc64/loader/main.c	Sun Apr  3 05:09:25 2011	(r220290)
@@ -107,7 +107,6 @@ extern vm_offset_t md_load(char *, vm_of
 static int sparc64_autoload(void);
 static ssize_t sparc64_readin(const int, vm_offset_t, const size_t);
 static ssize_t sparc64_copyin(const void *, vm_offset_t, size_t);
-static void sparc64_maphint(vm_offset_t, size_t);
 static vm_offset_t claim_virt(vm_offset_t, size_t, int);
 static vm_offset_t alloc_phys(size_t, int);
 static int map_phys(int, size_t, vm_offset_t, vm_offset_t);
@@ -296,50 +295,6 @@ sparc64_copyin(const void *src, vm_offse
 	return (len);
 }
 
-static void
-sparc64_maphint(vm_offset_t va, size_t len)
-{
-	vm_paddr_t pa;
-	vm_offset_t mva;
-	size_t size;
-	int i, free_excess = 0;
-
-	if (!is_sun4v)
-		return;
-
-	if (tlb_store[va >> 22].te_pa != -1)
-		return;
-
-	/* round up to nearest 4MB page */
-	size = (len + PAGE_MASK_4M) & ~PAGE_MASK_4M;
-#if 0
-	pa = alloc_phys(PAGE_SIZE_256M, PAGE_SIZE_256M);
-
-	if (pa != -1)
-		free_excess = 1;
-	else
-#endif
-		pa = alloc_phys(size, PAGE_SIZE_256M);
-	if (pa == -1)
-		pa = alloc_phys(size, PAGE_SIZE_4M);
-	if (pa == -1)
-		panic("%s: out of memory", __func__);
-
-	for (i = 0; i < size; i += PAGE_SIZE_4M) {
-		mva = claim_virt(va + i, PAGE_SIZE_4M, 0);
-		if (mva != (va + i))
-			panic("%s: can't claim virtual page "
-			    "(wanted %#lx, got %#lx)",
-			    __func__, va, mva);
-
-		tlb_store[mva >> 22].te_pa = pa + i;
-		if (map_phys(-1, PAGE_SIZE_4M, mva, pa + i) != 0)
-			printf("%s: can't map physical page\n", __func__);
-	}
-	if (free_excess)
-		release_phys(pa, PAGE_SIZE_256M);
-}
-
 /*
  * other MD functions
  */
@@ -809,7 +764,6 @@ main(int (*openfirm)(void *))
 	archsw.arch_copyout = ofw_copyout;
 	archsw.arch_readin = sparc64_readin;
 	archsw.arch_autoload = sparc64_autoload;
-	archsw.arch_maphint = sparc64_maphint;
 
 	if (init_heap() == (vm_offset_t)-1)
 		OF_exit();

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 08:44:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6DD01065670;
	Sun,  3 Apr 2011 08:44:57 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B4E378FC14;
	Sun,  3 Apr 2011 08:44:57 +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 p338iv9b007769;
	Sun, 3 Apr 2011 08:44:57 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p338ivvr007767;
	Sun, 3 Apr 2011 08:44:57 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201104030844.p338ivvr007767@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Sun, 3 Apr 2011 08:44:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220291 - stable/8/usr.bin/truss
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 08:44:57 -0000

Author: jh
Date: Sun Apr  3 08:44:57 2011
New Revision: 220291
URL: http://svn.freebsd.org/changeset/base/220291

Log:
  MFC r216224:
  
  Don't write the terminating NUL past end of buffer.
  
  PR:		bin/152345

Modified:
  stable/8/usr.bin/truss/syscalls.c
Directory Properties:
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/usr.bin/truss/syscalls.c
==============================================================================
--- stable/8/usr.bin/truss/syscalls.c	Sun Apr  3 05:09:25 2011	(r220290)
+++ stable/8/usr.bin/truss/syscalls.c	Sun Apr  3 08:44:57 2011	(r220291)
@@ -516,7 +516,7 @@ get_string(pid_t pid, void *offset, int 
 			buf = realloc(buf, totalsize);
 			size = BLOCKSIZE;
 		} else {
-			buf[totalsize] = '\0';
+			buf[totalsize - 1] = '\0';
 			return (buf);
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 11:55:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC05E1065670;
	Sun,  3 Apr 2011 11:55:48 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F1808FC08;
	Sun,  3 Apr 2011 11:55:48 +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 p33BtmEZ020914;
	Sun, 3 Apr 2011 11:55:48 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33BtmCt020911;
	Sun, 3 Apr 2011 11:55:48 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031155.p33BtmCt020911@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 11:55:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220292 - in head/sys: conf dev/nvram2env
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 11:55:48 -0000

Author: adrian
Date: Sun Apr  3 11:55:48 2011
New Revision: 220292
URL: http://svn.freebsd.org/changeset/base/220292

Log:
  Import nvram2env, a device driver which imports various NVRAM-style
  environments into the kernel environment.
  
  The eventual aim is to replace these with specific drivers for
  the various bootloaders (redboot, uboot, etc.) This however will
  work for the time being until it can be properly addressed.
  
  Submitted by: Aleksandr Rybalko 

Added:
  head/sys/dev/nvram2env/
  head/sys/dev/nvram2env/nvram2env.c   (contents, props changed)
Modified:
  head/sys/conf/files.mips

Modified: head/sys/conf/files.mips
==============================================================================
--- head/sys/conf/files.mips	Sun Apr  3 08:44:57 2011	(r220291)
+++ head/sys/conf/files.mips	Sun Apr  3 11:55:48 2011	(r220292)
@@ -105,3 +105,5 @@ dev/siba/siba_pcib.c		optional	siba pci
 
 dev/hwpmc/hwpmc_mips.c		optional hwpmc
 dev/hwpmc/hwpmc_mips24k.c	optional hwpmc
+
+dev/nvram2env/nvram2env.c	optional	nvram2env

Added: head/sys/dev/nvram2env/nvram2env.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/nvram2env/nvram2env.c	Sun Apr  3 11:55:48 2011	(r220292)
@@ -0,0 +1,317 @@
+/*-
+ * Copyright (c) 2010 Aleksandr Rybalko.
+ * 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.
+ */
+
+/*
+ * Pseudo driver to copy the NVRAM settings from various sources
+ * into the kernel environment.
+ *
+ * Drivers (such as ethernet devices) can then use environment
+ * variables to set default parameters.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#define nvram2env_read_1(sc, reg)				\
+	bus_space_read_1((sc)->sc_bt, (sc)->sc_bh,(reg))
+
+#define nvram2env_read_2(sc, reg)				\
+	bus_space_read_2((sc)->sc_bt, (sc)->sc_bh,(reg))
+
+#define nvram2env_read_4(sc, reg)				\
+	bus_space_read_4((sc)->sc_bt, (sc)->sc_bh,(reg))
+
+#define nvram2env_write_1(sc, reg, val)			\
+	bus_space_write_1((sc)->sc_bt, (sc)->sc_bh,	\
+			 (reg), (val))
+
+#define nvram2env_write_2(sc, reg, val)			\
+	bus_space_write_2((sc)->sc_bt, (sc)->sc_bh,	\
+			 (reg), (val))
+
+#define nvram2env_write_4(sc, reg, val)			\
+	bus_space_write_4((sc)->sc_bt, (sc)->sc_bh,	\
+			 (reg), (val))
+
+struct nvram2env_softc {
+	bus_space_tag_t bst;
+	bus_space_handle_t bsh;
+	bus_addr_t addr;
+	int need_swap;
+	uint32_t sig;
+	uint32_t flags;
+#define NVRAM_FLAGS_NOCHECK	0x0001	/* Do not check(CRC or somthing else)*/
+#define NVRAM_FLAGS_GENERIC	0x0002	/* Format Generic, skip 4b and read */
+#define NVRAM_FLAGS_BROADCOM	0x0004	/* Format Broadcom, use struct nvram */
+#define NVRAM_FLAGS_UBOOT	0x0008	/* Format Generic, skip 4b of CRC and read */
+	uint32_t maxsize;
+	uint32_t crc;
+};
+
+static int	nvram2env_attach(device_t);
+static int	nvram2env_probe(device_t);
+
+#define NVRAM_MAX_SIZE 0x10000
+
+static void
+nvram2env_identify(driver_t * drv, device_t parent)
+{
+	int i, ivar;
+
+	for (i = 0; !resource_int_value("nvram", i, "base", &ivar); i++)
+		BUS_ADD_CHILD(parent, 0, "nvram2env", i);
+}
+
+static int
+nvram2env_probe(device_t dev)
+{
+	uint32_t i, ivar, sig;
+	struct nvram2env_softc * sc = device_get_softc(dev);
+	sc->bst = mips_bus_space_generic;
+
+	if (resource_int_value("nvram", device_get_unit(dev), "sig",
+	    &sc->sig) != 0 || sc->sig == 0)
+		sc->sig = 0x48534c46;
+
+	if (resource_int_value("nvram", device_get_unit(dev), "maxsize",
+	    &sc->maxsize) != 0 || sc->maxsize == 0)
+		sc->maxsize = NVRAM_MAX_SIZE;
+
+	if (resource_int_value("nvram", device_get_unit(dev), "flags", 
+	    &sc->flags) != 0 || sc->flags == 0)
+		sc->flags = NVRAM_FLAGS_GENERIC;
+
+
+	for (i = 0; i < 2; i ++)
+	{
+		if (resource_int_value("nvram", device_get_unit(dev), 
+			(!i)?"base":"fallbackbase", &ivar) != 0 ||
+		    ivar == 0)
+			continue;
+
+		sc->addr = MIPS_PHYS_TO_KSEG1(ivar);
+
+		if (bootverbose)
+			device_printf(dev, "base=0x%08x sig=0x%08x "
+			    "maxsize=0x%08x flags=0x%08x\n",
+			    sc->addr, sc->sig, sc->maxsize, sc->flags);
+
+		if (bus_space_map(sc->bst, sc->addr, sc->maxsize, 0,
+		    &sc->bsh) != 0)
+			continue;
+
+		sig = bus_space_read_4(sc->bst, sc->bsh, 0);
+		if ( sig == sc->sig /*FLSH*/)
+		{
+			device_printf(dev, "Found NVRAM at %#x\n", 
+			    (uint32_t)ivar);
+			sc->need_swap = 0;
+			goto unmap_done;
+		}
+		else if ( htole32(sig) == sc->sig /*HSLF*/)
+		{
+			device_printf(dev, "Found NVRAM at %#x\n", 
+			    (uint32_t)ivar);
+			sc->need_swap = 1;
+			goto unmap_done;
+		} else if (sc->flags & NVRAM_FLAGS_UBOOT) {
+			device_printf(dev, "Use NVRAM at %#x\n", 
+			    (uint32_t)ivar);
+			sc->crc = sig;
+			goto unmap_done;
+		}
+		bus_space_unmap(sc->bst, sc->bsh, NVRAM_MAX_SIZE);
+	}
+	sc->bst = 0;
+	sc->bsh = 0;
+	sc->addr = 0;
+	return (ENXIO);
+
+unmap_done:
+	bus_space_unmap(sc->bst, sc->bsh, NVRAM_MAX_SIZE);
+	device_set_desc(dev, "NVRAM to ENV pseudo-device");
+	return (BUS_PROBE_SPECIFIC);
+
+}
+
+struct nvram {
+	u_int32_t sig;
+	u_int32_t size;
+	u_int32_t unknown1;
+	u_int32_t unknown2;
+	u_int32_t unknown3;
+	char data[];
+};
+
+static uint32_t read_4(struct nvram2env_softc * sc, int offset) 
+{
+	if (sc->need_swap) 
+		return (bswap32(bus_space_read_4(sc->bst, sc->bsh, offset)));
+	else
+		return (bus_space_read_4(sc->bst, sc->bsh, offset));
+}
+
+
+static int
+nvram2env_attach(device_t dev)
+{
+	struct nvram2env_softc * sc = device_get_softc(dev);
+	struct nvram * nv;
+	char *pair, *value, *assign;
+	uint32_t sig, size, i;
+
+	if (sc->bst == 0 || sc->addr == 0)
+		return (ENXIO);
+
+	if (bus_space_map(sc->bst, sc->addr, NVRAM_MAX_SIZE, 0,
+		&sc->bsh) != 0)
+		return (ENXIO);
+
+	sig  = read_4(sc, 0);
+	size = read_4(sc, 4);
+#if 1
+	if (bootverbose)
+		device_printf(dev, " size=0x%05x maxsize=0x%05x\n", size, sc->maxsize);
+#endif
+	size = (size > sc->maxsize)?sc->maxsize:size;
+
+
+	if (sig == sc->sig || (sc->flags & NVRAM_FLAGS_UBOOT))
+	{
+
+		/* align and shift size to 32bit size*/
+		size += 3;
+		size >>= 2;
+
+		nv = malloc(size<<2, M_DEVBUF, M_WAITOK | M_ZERO);
+		if (!nv)
+			return (ENOMEM);
+
+		for (i = 0; i < size; i ++)
+			((uint32_t *)nv)[i] = read_4(sc, i<<2);
+
+		if (sc->flags & NVRAM_FLAGS_BROADCOM) {
+			device_printf(dev, "sig = %#x\n",  nv->sig);
+			device_printf(dev, "size = %#x\n", nv->size);
+		}
+
+		if (!(sc->flags & NVRAM_FLAGS_NOCHECK)) {
+			/* TODO: need checksum verification */
+		}
+
+		if (sc->flags & NVRAM_FLAGS_GENERIC)
+			pair = (char*)nv+4;
+		if (sc->flags & NVRAM_FLAGS_UBOOT)
+			pair = (char*)nv+4;
+		else if (sc->flags & NVRAM_FLAGS_BROADCOM)
+			pair = (char*)nv+20;
+		else
+			pair = (char*)nv+4;
+
+		for ( ; 
+		    (u_int32_t)pair < ((u_int32_t)nv + size - 4); 
+		    pair = pair + strlen(pair) + 1 + strlen(value) + 1 ) {
+
+			if (pair && strlen(pair)) {
+
+#if 0
+				printf("ENV: %s\n", pair);
+#endif
+				/* hint.nvram.0. */
+				assign = strchr(pair,'=');
+				assign[0] = '\0';
+				value = assign+1;
+#if 1
+				if (bootverbose)
+					printf("ENV: %s=%s\n", pair, value);
+#endif
+				setenv(pair, value);
+
+				if (strcasecmp(pair, "WAN_MAC_ADDR") == 0) {
+					/* Alias for MAC address of eth0 */
+					if (bootverbose)
+						printf("ENV: aliasing "
+						    "WAN_MAC_ADDR to ethaddr"
+						    " = %s\n",  value);
+					setenv("ethaddr", value);
+				}
+				else if (strcasecmp(pair, "LAN_MAC_ADDR") == 0){
+					/* Alias for MAC address of eth1 */
+					if (bootverbose)
+						printf("ENV: aliasing "
+						    "LAN_MAC_ADDR to eth1addr"
+						    " = %s\n",  value);
+					setenv("eth1addr", value);
+				}
+
+				if (strcmp(pair, "bootverbose") == 0)
+					bootverbose = strtoul(value, 0, 0);
+				if (strcmp(pair, "boothowto"  ) == 0)
+					boothowto   = strtoul(value, 0, 0);
+			}
+			else
+				break;
+		}
+		free(nv, M_DEVBUF);
+	}
+
+	bus_space_unmap(sc->bst, sc->bsh, NVRAM_MAX_SIZE);
+
+	return (0);
+}
+
+static device_method_t nvram2env_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_identify, 	nvram2env_identify),
+	DEVMETHOD(device_probe,		nvram2env_probe),
+	DEVMETHOD(device_attach,	nvram2env_attach),
+	{0, 0},
+};
+
+static driver_t nvram2env_driver = {
+	"nvram2env",
+	nvram2env_methods,
+	sizeof(struct nvram2env_softc),
+};
+static devclass_t nvram2env_devclass;
+
+DRIVER_MODULE(nvram2env, nexus, nvram2env_driver, nvram2env_devclass, 0, 0);
+

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 11:59:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A41CF106564A;
	Sun,  3 Apr 2011 11:59:52 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 953CC8FC12;
	Sun,  3 Apr 2011 11:59: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 p33BxqmA022406;
	Sun, 3 Apr 2011 11:59:52 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33BxqUo022404;
	Sun, 3 Apr 2011 11:59:52 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031159.p33BxqUo022404@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 11:59:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220293 - head/sys/dev/ath/ath_hal/ar9001
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 11:59:52 -0000

Author: adrian
Date: Sun Apr  3 11:59:52 2011
New Revision: 220293
URL: http://svn.freebsd.org/changeset/base/220293

Log:
  Add an explanation of the inivals

Modified:
  head/sys/dev/ath/ath_hal/ar9001/ar9160.ini

Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160.ini
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9001/ar9160.ini	Sun Apr  3 11:55:48 2011	(r220292)
+++ head/sys/dev/ath/ath_hal/ar9001/ar9160.ini	Sun Apr  3 11:59:52 2011	(r220293)
@@ -19,6 +19,7 @@
 /* Auto Generated PCI Register Writes.  Created: 05/22/08 */
 
 static const uint32_t ar9160Modes[][6] = {
+    /* Address      5G-HT20     5G-HT40     2G-HT40     2G-HT20     Turbo   */
     { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
     { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
     { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 12:02:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C839106564A;
	Sun,  3 Apr 2011 12:02:49 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4DAC08FC08;
	Sun,  3 Apr 2011 12:02: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 p33C2nhB023428;
	Sun, 3 Apr 2011 12:02:49 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33C2n4j023426;
	Sun, 3 Apr 2011 12:02:49 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031202.p33C2n4j023426@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 12:02:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220294 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 12:02:49 -0000

Author: adrian
Date: Sun Apr  3 12:02:49 2011
New Revision: 220294
URL: http://svn.freebsd.org/changeset/base/220294

Log:
  Import a fix from the ath9k - reduce the TX FIFO size for Kite (AR9285.)

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sun Apr  3 11:59:52 2011	(r220293)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sun Apr  3 12:02:49 2011	(r220294)
@@ -480,7 +480,15 @@ ar5416InitDMA(struct ath_hal *ah)
 	 * reduce the number of usable entries in PCU TXBUF to avoid
 	 * wrap around.
 	 */
-	OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, AR_PCU_TXBUF_CTRL_USABLE_SIZE);
+	if (AR_SREV_KITE(ah))
+		/*
+		 * For AR9285 the number of Fifos are reduced to half.
+		 * So set the usable tx buf size also to half to
+		 * avoid data/delimiter underruns
+		 */
+		OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE);
+	else
+		OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, AR_PCU_TXBUF_CTRL_USABLE_SIZE);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 13:19:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90E4D106566B;
	Sun,  3 Apr 2011 13:19:59 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8198F8FC08;
	Sun,  3 Apr 2011 13:19: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 p33DJxt5028687;
	Sun, 3 Apr 2011 13:19:59 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33DJxjG028682;
	Sun, 3 Apr 2011 13:19:59 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031319.p33DJxjG028682@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 13:19:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220295 - head/sys/mips/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 13:19:59 -0000

Author: adrian
Date: Sun Apr  3 13:19:58 2011
New Revision: 220295
URL: http://svn.freebsd.org/changeset/base/220295

Log:
  Commit configuration files for the AR913x SoC and the TP-Link WR-1043ND.
  
  The AR91XX_BASE{,.hints} files define all the common parameters for
  the AR913x SoC systems.
  
  The TP-1043ND config file adds local parameters.

Added:
  head/sys/mips/conf/AR91XX_BASE   (contents, props changed)
  head/sys/mips/conf/AR91XX_BASE.hints   (contents, props changed)
  head/sys/mips/conf/TP-WN1043ND   (contents, props changed)
  head/sys/mips/conf/TP-WN1043ND.hints   (contents, props changed)

Added: head/sys/mips/conf/AR91XX_BASE
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/AR91XX_BASE	Sun Apr  3 13:19:58 2011	(r220295)
@@ -0,0 +1,96 @@
+#
+# AR91XX -- Kernel configuration base file for the Atheros AR913x SoC.
+#
+# This file (and the hints file accompanying it) are not designed to be
+# used by themselves. Instead, users of this file should create a kernel
+# config file which includes this file (which gets the basic hints), then
+# override the default options (adding devices as needed) and adding
+# hints as needed (for example, the GPIO and LAN PHY.)
+#
+# $FreeBSD$
+#
+
+machine         mips mipseb
+ident		AR91XX_BASE
+cpu		CPU_MIPS4KC
+options 	ISA_MIPS32
+makeoptions	KERNLOADADDR=0x80050000
+options		HZ=1000
+
+files		"../atheros/files.ar71xx"
+hints		"AR91XX_BASE.hints"
+
+makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
+makeoptions	MODULES_OVERRIDE=""
+
+options		DDB
+options		KDB
+
+options		SCHED_4BSD		#4BSD scheduler
+options		INET			#InterNETworking
+options		INET6			#InterNETworking
+options		NFSCLIENT		#Network Filesystem Client
+options		PSEUDOFS		#Pseudo-filesystem framework
+options		_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+
+# options		NFS_LEGACYRPC
+# Debugging for use in -current
+# options		INVARIANTS
+# options		INVARIANT_SUPPORT
+# options		WITNESS
+# options		WITNESS_SKIPSPIN
+options         FFS                     #Berkeley Fast Filesystem
+options         SOFTUPDATES             #Enable FFS soft updates support
+options         UFS_ACL                 #Support for access control lists
+options         UFS_DIRHASH             #Improve performance on big directories
+
+
+# Wireless NIC cards
+options		IEEE80211_DEBUG
+options		IEEE80211_SUPPORT_MESH
+options		IEEE80211_SUPPORT_TDMA
+#device		wlan            # 802.11 support
+#device		wlan_wep        # 802.11 WEP support
+#device		wlan_ccmp       # 802.11 CCMP support
+#device		wlan_tkip       # 802.11 TKIP support
+#device		wlan_xauth	# 802.11 hostap support
+
+# This will come later -adrian
+#device		ath             # Atheros pci/cardbus NIC's
+options 	ATH_DEBUG
+options		ATH_DIAGAPI
+options		AH_DEBUG
+#device		ath_hal
+option		AH_SUPPORT_AR5416
+option		AH_RXCFG_SDMAMW_4BYTES  # See NOTES for details of this WAR
+option		AH_NEED_DESC_SWAP	# ?
+#device		ath_rate_sample
+#device		ath_ahb
+option		AH_AR5416_INTERRUPT_MITIGATION
+
+device		mii
+device		arge
+
+device		usb
+options		USB_EHCI_BIG_ENDIAN_DESC        # handle big-endian byte order
+options		USB_DEBUG
+options		USB_HOST_ALIGN=32		# AR71XX (MIPS in general?) requires this
+device		ehci
+
+device		scbus
+device		umass
+device		da
+
+device		spibus
+device		ar71xx_spi
+device		mx25l
+device		ar71xx_wdog
+
+device		uart
+
+device		loop
+device		ether
+device		md
+device		bpf
+device		random
+device		if_bridge

Added: head/sys/mips/conf/AR91XX_BASE.hints
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/AR91XX_BASE.hints	Sun Apr  3 13:19:58 2011	(r220295)
@@ -0,0 +1,52 @@
+# This file (and the kernel config file accompanying it) are not designed 
+# to be used by themselves. Instead, users of this file should create a
+# kernel # config file which includes this file (which gets the basic hints),
+# then override the default options (adding devices as needed) and adding
+# hints as needed (for example, the GPIO and LAN PHY.)
+
+# $FreeBSD$
+
+hint.apb.0.at="nexus0"
+hint.apb.0.irq=4
+
+# uart0
+hint.uart.0.at="apb0"
+# see atheros/uart_cpu_ar71xx.c why +3
+hint.uart.0.maddr=0x18020003
+hint.uart.0.msize=0x18
+hint.uart.0.irq=3
+
+#ehci - note the 0x100 offset for the AR913x/AR724x
+hint.ehci.0.at="nexus0"
+hint.ehci.0.maddr=0x1b000100
+hint.ehci.0.msize=0x00ffff00
+hint.ehci.0.irq=1
+
+hint.arge.0.at="nexus0"
+hint.arge.0.maddr=0x19000000
+hint.arge.0.msize=0x1000
+hint.arge.0.irq=2
+
+hint.arge.1.at="nexus0"
+hint.arge.1.maddr=0x1a000000
+hint.arge.1.msize=0x1000
+hint.arge.1.irq=3
+
+hint.ath.0.at="nexus0"
+hint.ath.0.maddr=0x180c0000
+hint.ath.0.msize=0x30000
+hint.ath.0.irq=0
+# Set this to define where the ath calibration data
+# should be fetched from in physical memory.
+# hint.ath.0.eepromaddr=0x1fff1000
+
+# SPI flash
+hint.spi.0.at="nexus0"
+hint.spi.0.maddr=0x1f000000
+hint.spi.0.msize=0x10
+
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
+# Watchdog
+hint.ar71xx_wdog.0.at="nexus0"

Added: head/sys/mips/conf/TP-WN1043ND
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/TP-WN1043ND	Sun Apr  3 13:19:58 2011	(r220295)
@@ -0,0 +1,30 @@
+#
+# TP-1043ND -- Kernel configuration file for the TP-Link WR-1043ND
+#
+# $FreeBSD$
+#
+
+# Include the default AR913x parameters common to all AR913x SoC users.
+include         "AR91XX_BASE"
+
+ident           TP-WN1043ND
+
+# Override hints with board values
+hints           "TP-WN1043ND.hints"
+
+# Force the board memory - 32mb
+options         AR71XX_REALMEM=32*1024*1024
+
+# read MSDOS formatted disks - USB
+options		MSDOSFS
+options		GEOM_PART_BSD
+options		GEOM_PART_MBR
+
+# Just make sure the thing boots off of the first attached SCSI device for now!
+#options		ROOTDEVNAME=\"ufs:da0a\"
+# Or an MDROOT for testing.
+options		MD_ROOT
+options		MD_ROOT_SIZE=5120
+device		geom_uzip
+options		GEOM_UZIP
+options		ROOTDEVNAME=\"ufs:/dev/md0.uzip\"

Added: head/sys/mips/conf/TP-WN1043ND.hints
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/TP-WN1043ND.hints	Sun Apr  3 13:19:58 2011	(r220295)
@@ -0,0 +1,19 @@
+#
+# This file adds to the values in AR91XX_BASE.hints.
+#
+# $FreeBSD$
+
+# Hard-code the PHY for now, until there's switch phy support.
+hint.arge.0.phymask=0x000c
+hint.arge.0.media=1000
+hint.arge.0.fduplex=1
+# Where is the MAC address stored in flash for this particular unit.
+hint.arge.0.eeprommac=0x1f01fc00
+
+# This isn't used, but configure it anyway.
+# This should eventually just not be configured, but the if then
+# needs to be properly disabled or spurious interrupts occur.
+hint.arge.1.phymask=0x0
+
+# Where the ART is
+hint.ath.0.eepromaddr=0x1fff1000

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 14:34:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 867181065672;
	Sun,  3 Apr 2011 14:34:28 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 773F68FC15;
	Sun,  3 Apr 2011 14:34:28 +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 p33EYS1Z030269;
	Sun, 3 Apr 2011 14:34:28 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33EYS6B030267;
	Sun, 3 Apr 2011 14:34:28 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031434.p33EYS6B030267@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 14:34:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220296 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 14:34:28 -0000

Author: adrian
Date: Sun Apr  3 14:34:28 2011
New Revision: 220296
URL: http://svn.freebsd.org/changeset/base/220296

Log:
  Add in some missing flags in the EHCI initialisation code,
  needed to get USB working on the AR913x/AR724x.

Modified:
  head/sys/mips/atheros/ar71xx_ehci.c

Modified: head/sys/mips/atheros/ar71xx_ehci.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_ehci.c	Sun Apr  3 13:19:58 2011	(r220295)
+++ head/sys/mips/atheros/ar71xx_ehci.c	Sun Apr  3 14:34:28 2011	(r220296)
@@ -206,6 +206,13 @@ ar71xx_ehci_attach(device_t self)
 			break;
 	}
 
+	/*
+	 * ehci_reset() needs the correct offset to access the host controller
+	 * registers. The AR724x/AR913x offsets aren't 0.
+	*/
+	sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
+
+
 	(void) ehci_reset(sc);
 
 	err = ehci_init(sc);

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 14:39:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD1A3106566B;
	Sun,  3 Apr 2011 14:39:55 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9BEFF8FC13;
	Sun,  3 Apr 2011 14:39: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 p33EdtmE030444;
	Sun, 3 Apr 2011 14:39:55 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33EdtH4030436;
	Sun, 3 Apr 2011 14:39:55 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031439.p33EdtH4030436@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 14:39:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220297 - in head/sys/mips: conf rt305x
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 14:39:55 -0000

Author: adrian
Date: Sun Apr  3 14:39:55 2011
New Revision: 220297
URL: http://svn.freebsd.org/changeset/base/220297

Log:
  Import the initial CPU support for the MIPS RALink RT305x SoC.
  This is a MIPS4KC CPU with various embedded peripherals, including
  wireless and ethernet support.
  
  This commit includes the platform, UART, ethernet MAC and GPIO support.
  The interrupt-driven GPIO code is disabled for now pending GPIO changes
  from the submitter.
  
  Submitted by:	Aleksandr Rybalko 

Added:
  head/sys/mips/conf/RT305X   (contents, props changed)
  head/sys/mips/conf/RT305X.hints   (contents, props changed)
  head/sys/mips/rt305x/
  head/sys/mips/rt305x/files.rt305x   (contents, props changed)
  head/sys/mips/rt305x/obio.c   (contents, props changed)
  head/sys/mips/rt305x/obiovar.h   (contents, props changed)
  head/sys/mips/rt305x/rt305x_dotg.c   (contents, props changed)
  head/sys/mips/rt305x/rt305x_gpio.c   (contents, props changed)
  head/sys/mips/rt305x/rt305x_gpio.h   (contents, props changed)
  head/sys/mips/rt305x/rt305x_gpiovar.h   (contents, props changed)
  head/sys/mips/rt305x/rt305x_ic.c   (contents, props changed)
  head/sys/mips/rt305x/rt305x_icvar.h   (contents, props changed)
  head/sys/mips/rt305x/rt305x_machdep.c   (contents, props changed)
  head/sys/mips/rt305x/rt305x_sysctl.c   (contents, props changed)
  head/sys/mips/rt305x/rt305x_sysctlvar.h   (contents, props changed)
  head/sys/mips/rt305x/rt305xreg.h   (contents, props changed)
  head/sys/mips/rt305x/rt_swreg.h   (contents, props changed)
  head/sys/mips/rt305x/std.rt305x   (contents, props changed)
  head/sys/mips/rt305x/uart_bus_rt305x.c   (contents, props changed)
  head/sys/mips/rt305x/uart_cpu_rt305x.c   (contents, props changed)
  head/sys/mips/rt305x/uart_dev_rt305x.c   (contents, props changed)
  head/sys/mips/rt305x/uart_dev_rt305x.h   (contents, props changed)

Added: head/sys/mips/conf/RT305X
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/RT305X	Sun Apr  3 14:39:55 2011	(r220297)
@@ -0,0 +1,134 @@
+# RT305X -- Kernel configuration file for FreeBSD/mips for Ralink RT305xF systems
+#
+# For more information on this file, please read the handbook section on
+# Kernel Configuration Files:
+#
+#    http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files. 
+# If you are in doubt as to the purpose or necessity of a line, check first 
+# in NOTES.
+#
+# $FreeBSD$
+
+ident		RT305X
+
+machine		mips mipsel
+makeoptions	MIPS_LITTLE_ENDIAN=defined
+makeoptions	KERNLOADADDR=0x80001000
+
+# Don't build any modules yet.
+makeoptions	MODULES_OVERRIDE="wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt random if_bridge bridgestp msdosfs md ipfw dummynet libalias geom/geom_label ufs usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib"
+makeoptions	RT3052F
+
+include		"../rt305x/std.rt305x"
+
+hints		"RT305X.hints"		#Default places to look for devices.
+
+#makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
+
+# Debugging for use in -current
+#options 	DEADLKRES		#Enable the deadlock resolver
+#options		INVARIANTS		#Enable calls of extra sanity checking
+#options		INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
+#options		WITNESS			#Enable checks to detect deadlocks and cycles
+#options		WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed
+#options         DIAGNOSTIC
+#options     DEBUG_LOCKS
+#options     DEBUG_VFS_LOCKS
+#options 	GDB
+options 	DDB
+options 	KDB
+
+options 	SCHED_ULE
+#options 	SCHED_4BSD		#4BSD scheduler
+#options		COMPAT_43
+options 	INET			#InterNETworking
+options 	NFSCLIENT		#Network Filesystem Client
+options 	NFS_ROOT		#NFS usable as /, requires NFSCLIENT
+options 	PSEUDOFS		#Pseudo-filesystem framework
+#options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+
+options 	BOOTP
+#options 	BOOTP_NFSROOT
+options 	BOOTP_NFSV3
+options 	BOOTP_WIRED_TO=rt0
+options 	BOOTP_COMPAT
+options 	CD9660			# ISO 9660 Filesystem
+options		ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uncompress\"
+options 	TMPFS			# TMP Memory Filesystem
+
+#options 	FFS			#Berkeley Fast Filesystem
+#options 	SOFTUPDATES		#Enable FFS soft updates support
+#options 	UFS_ACL			#Support for access control lists
+#options 	UFS_DIRHASH		#Improve performance on big directories
+#options 	ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\"
+
+# Options for making kernel less hangry
+makeoptions	INLINE_LIMIT=1024
+options		MAXUSERS=3
+options		MAXFILES=512
+options		NSFBUFS=256
+options		SHMALL=128
+options		MSGBUF_SIZE=65536
+
+# Options for making kernel smallest 
+options		NO_SYSCTL_DESCR		# No description string of sysctl
+#options		NO_FFS_SNAPSHOT		# Disable Snapshot supporting
+options		SCSI_NO_SENSE_STRINGS
+options		SCSI_NO_OP_STRINGS
+options		RWLOCK_NOINLINE
+options		SX_NOINLINE
+options		NO_SWAPPING
+options 	ZERO_COPY_SOCKETS
+options         MROUTING                # Multicast routing
+options		IPFIREWALL_DEFAULT_TO_ACCEPT
+
+device		random
+device		loop
+# RT3050F, RT3052F have only pseudo PHYs
+#device		mii
+#device		miibus
+device 		pty			# Pseudo-ttys (telnet etc)
+device		ether
+device 		bpf			# Berkeley packet filter
+device		vlan
+#device		lagg
+#device          if_bridge
+device		uart
+nodevice	uart_ns8250
+device 		tun			# Packet tunnel.
+
+device		wlan
+
+
+device		gpio
+device		gpioled
+
+device		cfi			# Detect Flash memmory
+device		cfid
+
+device		nvram2env
+
+device		usb
+#device		dotg			# DWC like USB OTG Controller driver
+#device		u3g
+#device		umodem
+#device		uplcom
+#device		umass
+#device		da
+#device		pass
+#device		scbus
+options 	SCSI_DELAY=1000		# Delay (in ms) before probing SCSI
+
+#options		USB_EHCI_BIG_ENDIAN_DESC        # handle big-endian byte order
+#options		USB_DEBUG
+#options		USB_REQ_DEBUG
+
+

Added: head/sys/mips/conf/RT305X.hints
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/RT305X.hints	Sun Apr  3 14:39:55 2011	(r220297)
@@ -0,0 +1,136 @@
+# $FreeBSD$
+# device.hints
+hint.obio.0.at="nexus0"
+hint.obio.0.maddr=0x10000000
+hint.obio.0.msize=0x10000000
+
+hint.nvram.0.sig=0xe5e60a74
+hint.nvram.0.base=0x1f030000
+hint.nvram.0.maxsize=0x2000
+hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic
+hint.nvram.1.sig=0x5a045e94
+hint.nvram.1.base=0x1f032000
+hint.nvram.1.maxsize=0x4000
+hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic
+
+# on-board Ralink Frame Engine
+#hint.rt.0.at="nexus0"
+#hint.rt.0.maddr=0x12000000
+#hint.rt.0.msize=0x200000
+#hint.rt.0.irq=9
+hint.rt.0.macaddr="00:18:e7:d5:83:90"
+
+# on-board Ralink 2872 802.11n core
+hint.rt2860.0.at="nexus0"
+hint.rt2860.0.maddr=0x10180000
+hint.rt2860.0.msize=0x40000
+hint.rt2860.0.irq=4
+
+# uart0
+#hint.uart.0.at="obio0"
+#hint.uart.0.maddr=0x10000C00
+#hint.uart.0.msize=0x100
+#hint.uart.0.irq=12
+#hint.uart.0.flags="0x30"
+
+# uart1
+#hint.uart.1.at="obio0"
+#hint.uart.1.maddr=0x10000500
+#hint.uart.1.msize=0x100
+#hint.uart.1.irq=5
+#hint.uart.1.flags="0x30"
+
+
+# gpio
+# GPIO0  - WPS BTN	IN II IO
+hint.gpiobutton.0.at="gpiobus0"
+hint.gpiobutton.0.pins="0x01"
+hint.gpiobutton.0.name="wps"
+hint.gpiobutton.0.flags="0x0581"
+
+# GPIO7  - MODE SW AP	IN II IO
+hint.gpiobutton.1.at="gpiobus0"
+hint.gpiobutton.1.pins="0x80"
+hint.gpiobutton.1.name="mode_ap"
+hint.gpiobutton.1.flags="0x0581"
+
+# GPIO8  - ST LEDRED	OUT	/* 2pin BiDir RED/BLUE LED */
+# GPIO9  - ST LEDBLUE	OUT
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins="0x100"
+hint.gpioled.0.name="status_red"
+hint.gpioled.0.flags="0x0002"
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins="0x200"
+#hint.gpioled.1.name="status_blue"
+hint.gpioled.1.name="status"
+hint.gpioled.1.flags="0x0002"
+
+# GPIO10 - RST BTN	IN II IO
+hint.gpiobutton.2.at="gpiobus0"
+hint.gpiobutton.2.pins="0x400"
+hint.gpiobutton.2.name="reset"
+hint.gpiobutton.2.flags="0x0581"
+
+# GPIO11 - MODE SW CL	IN II IO
+hint.gpiobutton.3.at="gpiobus0"
+hint.gpiobutton.3.pins="0x800"
+hint.gpiobutton.3.name="mode_wlan_client"
+hint.gpiobutton.3.flags="0x0581"
+
+# GPIO14 - WPS LED	OUT II IO
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins="0x4000"
+hint.gpioled.2.name="wps"
+hint.gpioled.2.flags="0x0182"
+
+
+
+#0x00000000-0x00030000 : "Bootloader"
+#0x00030000-0x00040000 : "Factory"
+#0x00040000-0x00070000 : "Config"
+#0x00070000-0x000b0000 : "Language"
+#0x000b0000-0x001a0000 : "Kernel"
+#0x001a0000-0x01000000 : "RootFS"
+
+hint.map.0.at="cfid0"
+hint.map.0.start=0x00000000
+hint.map.0.end=0x00030000
+hint.map.0.name="bootloader"
+hint.map.0.readonly=1
+
+hint.map.1.at="cfid0"
+hint.map.1.start=0x00030000
+hint.map.1.end=0x00040000
+hint.map.1.name="factory"
+
+hint.map.2.at="cfid0"
+hint.map.2.start=0x00040000
+hint.map.2.end=0x00800000
+hint.map.2.name="upgrade"
+
+hint.map.3.at="cfid0"
+hint.map.3.start=0x00040000
+hint.map.3.end=0x00050000
+hint.map.3.name="config"
+
+hint.map.4.at="cfid0"
+hint.map.4.start=0x00000000
+hint.map.4.end=0x00000000
+hint.map.4.name="language"
+
+hint.map.5.at="cfid0"
+hint.map.5.start=0x00050000
+hint.map.5.end=0x00150000
+hint.map.5.name="kernel"
+
+hint.map.6.at="cfid0"
+hint.map.6.start=0x00150000
+hint.map.6.end=0x00800000
+hint.map.6.name="rootfs"
+
+
+hint.rt.0.phymask=0x1f
+hint.rt.0.media=100
+hint.rt.0.fduplex=1
+

Added: head/sys/mips/rt305x/files.rt305x
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/rt305x/files.rt305x	Sun Apr  3 14:39:55 2011	(r220297)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+# RT305X on-board devices
+mips/rt305x/rt305x_machdep.c	standard
+mips/rt305x/obio.c		standard
+mips/rt305x/rt305x_sysctl.c	standard
+mips/rt305x/rt305x_ic.c		standard
+mips/rt305x/rt305x_gpio.c	optional gpio
+mips/rt305x/uart_bus_rt305x.c	optional uart
+mips/rt305x/uart_cpu_rt305x.c	optional uart
+mips/rt305x/uart_dev_rt305x.c	optional uart
+mips/mips/intr_machdep.c        standard
+mips/mips/tick.c		standard

Added: head/sys/mips/rt305x/obio.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/rt305x/obio.c	Sun Apr  3 14:39:55 2011	(r220297)
@@ -0,0 +1,627 @@
+/*	$NetBSD: obio.c,v 1.11 2003/07/15 00:25:05 lukem Exp $	*/
+
+/*-
+ * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * 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 WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * 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 
+
+/* MIPS HW interrupts of IRQ/FIQ respectively */
+#define RT305X_INTR		0
+#define RT305X_FAST_INTR	1
+
+/* Interrupt levels */
+#define INTR_IRQ 0
+#define INTR_FIQ 1
+
+
+int irq_priorities[NIRQS] = {
+	INTR_IRQ,	/* SYSCTL */
+	INTR_FIQ,	/* TIMER0 */
+	INTR_FIQ,	/* WDTIMER */
+	INTR_IRQ,	/* Illegal Access */
+	INTR_IRQ,	/* PCM */
+	INTR_IRQ,	/* UART */
+	INTR_IRQ,	/* GPIO */
+	INTR_FIQ,	/* GDMA */
+	INTR_IRQ,	/* NAND */
+	INTR_IRQ,	/* Perfomance Counter */
+	INTR_IRQ,	/* I2S */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* UARTLITE */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* EtherNet Switch */
+	INTR_FIQ,	/* OTG */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+	INTR_IRQ,	/* unknown */
+};
+
+
+#define REG_READ(o) *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1(INTCTL_BASE + (o)))
+#define REG_WRITE(o,v) (REG_READ(o)) = (v)
+
+static int	obio_activate_resource(device_t, device_t, int, int,
+		    struct resource *);
+static device_t	obio_add_child(device_t, u_int, const char *, int);
+static struct resource *
+		obio_alloc_resource(device_t, device_t, int, int *, u_long,
+		    u_long, u_long, u_int);
+static int	obio_attach(device_t);
+static int	obio_deactivate_resource(device_t, device_t, int, int,
+		    struct resource *);
+static struct resource_list *
+		obio_get_resource_list(device_t, device_t);
+static void	obio_add_res_child(device_t, const char *, int, long, int, int);
+static void	obio_hinted_child(device_t, const char *, int);
+static int	obio_intr(void *);
+static int	obio_probe(device_t);
+static int	obio_release_resource(device_t, device_t, int, int,
+		    struct resource *);
+static int	obio_setup_intr(device_t, device_t, struct resource *, int,
+		    driver_filter_t *, driver_intr_t *, void *, void **);
+static int	obio_teardown_intr(device_t, device_t, struct resource *,
+		    void *);
+
+static void 
+obio_mask_irq(void *source)
+{
+	int irq;
+	uint32_t irqmask;
+
+	irq = (int)source;
+	irqmask = 1 << irq;
+
+	/* disable IRQ */
+	rt305x_ic_set(IC_INT_DIS, irqmask);
+}
+
+static void 
+obio_unmask_irq(void *source)
+{
+	int irq;
+	uint32_t irqmask;
+
+	irq = (int)source;
+	irqmask = 1 << irq;
+
+	/* enable IRQ */
+	rt305x_ic_set(IC_INT_ENA, irqmask);
+
+}
+
+
+static int
+obio_probe(device_t dev)
+{
+
+	return (0);
+}
+
+static int
+obio_attach(device_t dev)
+{
+	struct obio_softc *sc = device_get_softc(dev);
+	int rid;
+
+	sc->oba_mem_rman.rm_type = RMAN_ARRAY;
+	sc->oba_mem_rman.rm_descr = "OBIO memory";
+	if (rman_init(&sc->oba_mem_rman) != 0 ||
+	    rman_manage_region(&sc->oba_mem_rman, OBIO_MEM_START,
+	        OBIO_MEM_END) != 0)
+		panic("obio_attach: failed to set up I/O rman");
+
+	sc->oba_irq_rman.rm_type = RMAN_ARRAY;
+	sc->oba_irq_rman.rm_descr = "OBIO IRQ";
+	if (rman_init(&sc->oba_irq_rman) != 0 ||
+	    rman_manage_region(&sc->oba_irq_rman, 0, NIRQS-1) != 0)
+		panic("obio_attach: failed to set up IRQ rman");
+
+	/* Hook up our interrupt handler. */
+	if ((sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
+	    RT305X_INTR, RT305X_INTR, 1,
+	    RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+		device_printf(dev, "unable to allocate IRQ resource\n");
+		return (ENXIO);
+	}
+
+	if ((bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_MISC, obio_intr, NULL,
+	    sc, &sc->sc_ih))) {
+		device_printf(dev,
+		    "WARNING: unable to register interrupt handler\n");
+		return (ENXIO);
+	}
+
+	/* Hook up our FAST interrupt handler. */
+	if ((sc->sc_fast_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
+	    RT305X_FAST_INTR, RT305X_FAST_INTR, 1,
+	    RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+		device_printf(dev, "unable to allocate IRQ resource\n");
+		return (ENXIO);
+	}
+
+	if ((bus_setup_intr(dev, sc->sc_fast_irq, INTR_TYPE_MISC, obio_intr,
+	    NULL, sc, &sc->sc_fast_ih))) {
+		device_printf(dev,
+		    "WARNING: unable to register interrupt handler\n");
+		return (ENXIO);
+	}
+
+	/* disable all interrupts */
+	rt305x_ic_set(IC_INT_DIS, IC_INT_MASK|IC_LINE_GLOBAL);
+
+	bus_generic_probe(dev);
+
+	obio_add_res_child(dev, "rt305x_sysctl", 0, 
+	    SYSCTL_BASE, (SYSCTL_END - SYSCTL_BASE + 1),
+	    IC_SYSCTL);
+	obio_add_res_child(dev, "rt305x_ic", 0, 
+	    INTCTL_BASE, (INTCTL_END - INTCTL_BASE + 1),
+	    -1);
+#ifdef notyet
+	obio_add_res_child(dev, "timer",0, 
+	    TIMER_BASE, (TIMER_END - TIMER_BASE  + 1),
+	    IC_TIMER0);
+	obio_add_res_child(dev, "rt305x_memc", 0,
+	    MEMCTRL_BASE, (MEMCTRL_END - MEMCTRL_BASE + 1),
+	    -1);
+	obio_add_res_child(dev, "pcm", 	0, 
+	    PCM_BASE, (PCM_END - PCM_BASE  + 1),
+	    IC_PCM);
+	obio_add_res_child(dev, "uart", 0, 
+	    UART_BASE, (UART_END - UART_BASE + 1),
+	    IC_UART);
+#endif
+	obio_add_res_child(dev, "gpio", 0, 
+	    PIO_BASE, (PIO_END - PIO_BASE  + 1),
+	    IC_PIO);
+#ifdef notyet
+	obio_add_res_child(dev, "rt305x_dma", 0,
+	    GDMA_BASE, (GDMA_END - GDMA_BASE + 1),
+	    IC_DMA);
+	obio_add_res_child(dev, "rt305x_nandc", 0,
+	    NANDFC_BASE, (NANDFC_END - NANDFC_BASE  + 1),
+	    IC_NAND);
+	obio_add_res_child(dev, "i2c", 	0,
+	    I2C_BASE, (I2C_END - I2C_BASE  + 1),
+	    -1);
+	obio_add_res_child(dev, "i2s", 0,
+	    I2S_BASE, (I2S_END - I2S_BASE  + 1),
+	    IC_I2S);
+	obio_add_res_child(dev, "spi", 0, 
+	    SPI_BASE, (SPI_END - SPI_BASE  + 1),
+	    -1);
+#endif
+	obio_add_res_child(dev, "uart", 1,
+	    UARTLITE_BASE, (UARTLITE_END - UARTLITE_BASE + 1),
+	    IC_UARTLITE);
+	obio_add_res_child(dev, "cfi", 	0,
+	    FLASH_BASE, (FLASH_END - FLASH_BASE  + 1),
+	    -1);
+	obio_add_res_child(dev, "dotg", 0,
+	    USB_OTG_BASE, (USB_OTG_END - USB_OTG_BASE  + 1),
+	    IC_OTG);
+	obio_add_res_child(dev, "switch", 0,
+	    ETHSW_BASE, (ETHSW_END - ETHSW_BASE  + 1),
+	    IC_ETHSW);
+
+	bus_enumerate_hinted_children(dev);
+	bus_generic_attach(dev);
+
+	/* enable IC */
+	rt305x_ic_set(IC_INT_ENA, IC_LINE_GLOBAL);
+
+	return (0);
+}
+
+static struct resource *
+obio_alloc_resource(device_t bus, device_t child, int type, int *rid,
+    u_long start, u_long end, u_long count, u_int flags)
+{
+	struct obio_softc		*sc = device_get_softc(bus);
+	struct obio_ivar		*ivar = device_get_ivars(child);
+	struct resource			*rv;
+	struct resource_list_entry	*rle;
+	struct rman			*rm;
+	int				 isdefault, needactivate, passthrough;
+
+	isdefault = (start == 0UL && end == ~0UL && count == 1);
+	needactivate = flags & RF_ACTIVE;
+	passthrough = (device_get_parent(child) != bus);
+	rle = NULL;
+
+	if (passthrough)
+		return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type,
+		    rid, start, end, count, flags));
+
+	/*
+	 * If this is an allocation of the "default" range for a given RID,
+	 * and we know what the resources for this device are (ie. they aren't
+	 * maintained by a child bus), then work out the start/end values.
+	 */
+	if (isdefault) {
+		rle = resource_list_find(&ivar->resources, type, *rid);
+		if (rle == NULL)
+			return (NULL);
+		if (rle->res != NULL) {
+			panic("%s: resource entry is busy", __func__);
+		}
+		start = rle->start;
+		end = rle->end;
+		count = rle->count;
+	}
+
+	switch (type) {
+	case SYS_RES_IRQ:
+		rm = &sc->oba_irq_rman;
+		break;
+	case SYS_RES_MEMORY:
+		rm = &sc->oba_mem_rman;
+		break;
+	default:
+		printf("%s: unknown resource type %d\n", __func__, type);
+		return (0);
+	}
+
+	rv = rman_reserve_resource(rm, start, end, count, flags, child);
+	if (rv == 0) {
+		printf("%s: could not reserve resource\n", __func__);
+		return (0);
+	}
+
+	rman_set_rid(rv, *rid);
+
+	if (needactivate) {
+		if (bus_activate_resource(child, type, *rid, rv)) {
+			printf("%s: could not activate resource\n", __func__);
+			rman_release_resource(rv);
+			return (0);
+		}
+	}
+
+	return (rv);
+}
+
+static int
+obio_activate_resource(device_t bus, device_t child, int type, int rid,
+    struct resource *r)
+{
+
+	/*
+	 * If this is a memory resource, track the direct mapping
+	 * in the uncached MIPS KSEG1 segment.
+	 */
+	if (type == SYS_RES_MEMORY) {
+		void *vaddr;
+
+		vaddr = (void *)MIPS_PHYS_TO_KSEG1((intptr_t)rman_get_start(r));
+		rman_set_virtual(r, vaddr);
+		rman_set_bustag(r, mips_bus_space_generic);
+		rman_set_bushandle(r, (bus_space_handle_t)vaddr);
+	}
+
+	return (rman_activate_resource(r));
+}
+
+static int
+obio_deactivate_resource(device_t bus, device_t child, int type, int rid,
+    struct resource *r)
+{
+
+	return (rman_deactivate_resource(r));
+}
+
+static int
+obio_release_resource(device_t dev, device_t child, int type,
+    int rid, struct resource *r)
+{
+	struct resource_list *rl;
+	struct resource_list_entry *rle;
+
+	rl = obio_get_resource_list(dev, child);
+	if (rl == NULL)
+		return (EINVAL);
+	rle = resource_list_find(rl, type, rid);
+	if (rle == NULL)
+		return (EINVAL);
+	rman_release_resource(r);
+	rle->res = NULL;
+
+	return (0);
+}
+
+static int
+obio_setup_intr(device_t dev, device_t child, struct resource *ires,
+		int flags, driver_filter_t *filt, driver_intr_t *handler,
+		void *arg, void **cookiep)
+{
+	struct obio_softc *sc = device_get_softc(dev);
+	struct intr_event *event;
+	int irq, error, priority;
+	uint32_t irqmask;
+
+	irq = rman_get_start(ires);
+
+	if (irq >= NIRQS)
+		panic("%s: bad irq %d", __func__, irq);
+
+	event = sc->sc_eventstab[irq];
+	if (event == NULL) {
+		error = intr_event_create(&event, (void *)irq, 0, irq,
+		    obio_mask_irq, obio_unmask_irq,
+		    NULL, NULL, "obio intr%d:", irq);
+
+		sc->sc_eventstab[irq] = event;
+	}
+	else
+		panic("obio: Can't share IRQs");
+
+	intr_event_add_handler(event, device_get_nameunit(child), filt,
+	    handler, arg, intr_priority(flags), flags, cookiep);
+
+	irqmask = 1 << irq;
+	priority = irq_priorities[irq];
+
+	if (priority == INTR_FIQ)
+		rt305x_ic_set(IC_INTTYPE, rt305x_ic_get(IC_INTTYPE) | irqmask);
+	else
+		rt305x_ic_set(IC_INTTYPE, rt305x_ic_get(IC_INTTYPE) & ~irqmask);
+
+	/* enable */
+	obio_unmask_irq((void*)irq);
+
+	return (0);
+}
+
+static int
+obio_teardown_intr(device_t dev, device_t child, struct resource *ires,
+    void *cookie)
+{
+	struct obio_softc *sc = device_get_softc(dev);
+	int irq, result, priority;
+	uint32_t irqmask;
+
+	irq = rman_get_start(ires);
+	if (irq >= NIRQS)
+		panic("%s: bad irq %d", __func__, irq);
+
+	if (sc->sc_eventstab[irq] == NULL)
+		panic("Trying to teardown unoccupied IRQ");
+
+	irqmask = (1 << irq);
+	priority = irq_priorities[irq];
+
+	if (priority == INTR_FIQ)
+		rt305x_ic_set(IC_INTTYPE, rt305x_ic_get(IC_INTTYPE) & ~irqmask);
+	else
+		rt305x_ic_set(IC_INTTYPE, rt305x_ic_get(IC_INTTYPE) | irqmask);
+
+	/* disable */
+	obio_mask_irq((void*)irq);
+
+	result = intr_event_remove_handler(cookie);
+	if (!result) {
+		sc->sc_eventstab[irq] = NULL;
+	}
+
+	return (result);
+}
+
+static int
+obio_intr(void *arg)
+{
+	struct obio_softc *sc = arg;
+	struct intr_event *event;
+	uint32_t irqstat;
+	int irq;
+
+	irqstat = rt305x_ic_get(IC_IRQ0STAT);
+	irqstat |= rt305x_ic_get(IC_IRQ1STAT);
+
+	irq = 0;
+	while (irqstat != 0) {
+		if ((irqstat & 1) == 1) {
+			event = sc->sc_eventstab[irq];
+			if (!event || TAILQ_EMPTY(&event->ie_handlers))
+				continue;
+
+			/* TODO: pass frame as an argument*/
+			/* TODO: log stray interrupt */
+			intr_event_handle(event, NULL);
+		}
+		irq++;
+		irqstat >>= 1;
+	}
+
+	return (FILTER_HANDLED);
+}
+
+static void
+obio_add_res_child(device_t bus, const char *dname, int dunit, 
+    long maddr, int msize, int irq)
+{
+	device_t		child;
+	int			result;
+
+	child = BUS_ADD_CHILD(bus, 0, dname, dunit);
+
+	result = bus_set_resource(child, SYS_RES_MEMORY, 0,
+	    maddr, msize);
+	if (result != 0)
+		device_printf(bus, "warning: bus_set_resource() failed\n");
+
+	if (irq != -1) {
+		result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
+		if (result != 0)
+			device_printf(bus,
+			    "warning: bus_set_resource() failed\n");
+	}
+}
+
+static void
+obio_hinted_child(device_t bus, const char *dname, int dunit)
+{
+	long			maddr;
+	int			msize;
+	int			irq;
+
+	/*
+	 * Set hard-wired resources for hinted child using
+	 * specific RIDs.
+	 */
+	resource_long_value(dname, dunit, "maddr", &maddr);
+	resource_int_value(dname, dunit, "msize", &msize);
+
+
+	if (resource_int_value(dname, dunit, "irq", &irq) == 0) irq = -1;
+
+	obio_add_res_child(bus, dname, dunit, maddr, msize, irq);
+}
+
+static device_t
+obio_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+	device_t		child;
+	struct obio_ivar	*ivar;
+
+	ivar = malloc(sizeof(struct obio_ivar), M_DEVBUF, M_WAITOK | M_ZERO);
+	if (ivar == NULL) {
+		printf("Failed to allocate ivar\n");
+		return (0);
+	}
+	resource_list_init(&ivar->resources);
+
+	child = device_add_child_ordered(bus, order, name, unit);
+	if (child == NULL) {
+		printf("Can't add child %s%d ordered\n", name, unit);
+		return (0);
+	}
+
+	device_set_ivars(child, ivar);
+
+	return (child);
+}
+
+/*
+ * Helper routine for bus_generic_rl_get_resource/bus_generic_rl_set_resource
+ * Provides pointer to resource_list for these routines
+ */
+static struct resource_list *
+obio_get_resource_list(device_t dev, device_t child)
+{
+	struct obio_ivar *ivar;
+
+	ivar = device_get_ivars(child);
+	return (&(ivar->resources));
+}
+
+static int
+obio_print_all_resources(device_t dev)
+{
+	struct obio_ivar *ivar = device_get_ivars(dev);
+	struct resource_list *rl = &ivar->resources;
+	int retval = 0;
+
+	if (STAILQ_FIRST(rl))
+		retval += printf(" at");
+
+	retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx");
+	retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
+
+	return (retval);
+}
+
+static int
+obio_print_child(device_t bus, device_t child)
+{
+	int retval = 0;
+
+	retval += bus_print_child_header(bus, child);
+	retval += obio_print_all_resources(child);
+	if (device_get_flags(child))
+		retval += printf(" flags %#x", device_get_flags(child));
+	retval += printf(" on %s\n", device_get_nameunit(bus));
+
+	return (retval);
+}
+
+static device_method_t obio_methods[] = {
+	DEVMETHOD(bus_activate_resource,	obio_activate_resource),
+	DEVMETHOD(bus_add_child,		obio_add_child),
+	DEVMETHOD(bus_alloc_resource,		obio_alloc_resource),
+	DEVMETHOD(bus_deactivate_resource,	obio_deactivate_resource),
+	DEVMETHOD(bus_get_resource_list,	obio_get_resource_list),
+	DEVMETHOD(bus_hinted_child,		obio_hinted_child),
+	DEVMETHOD(bus_print_child,		obio_print_child),
+	DEVMETHOD(bus_release_resource,		obio_release_resource),
+	DEVMETHOD(bus_setup_intr,		obio_setup_intr),
+	DEVMETHOD(bus_teardown_intr,		obio_teardown_intr),
+	DEVMETHOD(device_attach,		obio_attach),
+	DEVMETHOD(device_probe,			obio_probe),
+        DEVMETHOD(bus_get_resource,		bus_generic_rl_get_resource),
+        DEVMETHOD(bus_set_resource,		bus_generic_rl_set_resource),
+
+	{0, 0},
+};
+
+static driver_t obio_driver = {
+	"obio",
+	obio_methods,
+	sizeof(struct obio_softc),
+};
+static devclass_t obio_devclass;
+
+DRIVER_MODULE(obio, nexus, obio_driver, obio_devclass, 0, 0);

Added: head/sys/mips/rt305x/obiovar.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/rt305x/obiovar.h	Sun Apr  3 14:39:55 2011	(r220297)
@@ -0,0 +1,58 @@
+/*	$NetBSD: obiovar.h,v 1.4 2003/06/16 17:40:53 thorpej Exp $	*/
+
+/*-
+ * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * 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 WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * 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 _RT305X_OBIOVAR_H_
+#define	_RT305X_OBIOVAR_H_
+
+#include 
+
+/* Number of IRQs */
+#define	NIRQS	32
+
+
+struct obio_softc {
+	struct rman		oba_mem_rman;
+	struct rman		oba_irq_rman;
+	struct rman		oba_gpio_rman;
+	struct intr_event	*sc_eventstab[NIRQS]; /* IRQ events structs */
+	struct resource		*sc_irq;	/* IRQ resource */
+	void			*sc_ih;		/* interrupt cookie */
+	struct resource		*sc_fast_irq;	/* IRQ resource */
+	void			*sc_fast_ih;	/* interrupt cookie */
+};
+
+struct obio_ivar {
+	struct resource_list	resources;
+};
+
+#endif /* _RT305X_OBIOVAR_H_ */

Added: head/sys/mips/rt305x/rt305x_dotg.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/rt305x/rt305x_dotg.c	Sun Apr  3 14:39:55 2011	(r220297)
@@ -0,0 +1,247 @@
+#include 
+__FBSDID("$FreeBSD$");
+
+/*-
+ * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved.
+ * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 14:56:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AF081065670;
	Sun,  3 Apr 2011 14:56:57 +0000 (UTC)
	(envelope-from bzeeb-lists@lists.zabbadoz.net)
Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DB678FC14;
	Sun,  3 Apr 2011 14:56:56 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id 5B1CC25D386F;
	Sun,  3 Apr 2011 14:56:55 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id 7B18D159C2F4;
	Sun,  3 Apr 2011 14:56:54 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id fmjOemQoQvvT; Sun,  3 Apr 2011 14:56:51 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id 2FFD1159C2F3;
	Sun,  3 Apr 2011 14:56:51 +0000 (UTC)
Date: Sun, 3 Apr 2011 14:56:50 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: Ed Maste 
In-Reply-To: <201103300119.p2U1J18L046334@svn.freebsd.org>
Message-ID: 
References: <201103300119.p2U1J18L046334@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r220153 - head/etc/rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 14:56:57 -0000

On Wed, 30 Mar 2011, Ed Maste wrote:

> Author: emaste
> Date: Wed Mar 30 01:19:00 2011
> New Revision: 220153
> URL: http://svn.freebsd.org/changeset/base/220153
>
> Log:
>  Replace ${SYSCTL_W} with ${SYSCTL} in rc.d scripts, as they are identical.
>  This is a further clean up after r202988.
>
>  SYSCTL_W is still initialized in rc.subr as some ports may still use it.

I think this is a lazyness on our side.  Not sure what the official
reference is but for example OSX really requires the -w to alter a
sysctl while we permit without.   I thin kthe correct fix should have
been to add a -w to SYSCTL_W. That way one can grep for a read vs.
write in the startup scrpits a lot more easily, etc.

No this might be completely counter-intuitive to what we decided to do
in the past in which case I'll just shut up:)

> Modified:
>  head/etc/rc.d/faith
>  head/etc/rc.d/hostid
>  head/etc/rc.d/initrandom
>  head/etc/rc.d/ipfw
>  head/etc/rc.d/jail
>  head/etc/rc.d/netoptions
>  head/etc/rc.d/routing
>  head/etc/rc.d/securelevel
>
> Modified: head/etc/rc.d/faith
> ==============================================================================
> --- head/etc/rc.d/faith	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/faith	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -21,7 +21,7 @@ faith_up()
> 	*)
> 		echo "Configuring IPv6-to-IPv4 TCP relay capturing interface:" \
> 		    " faith0."
> -		${SYSCTL_W} net.inet6.ip6.keepfaith=1
> +		${SYSCTL} net.inet6.ip6.keepfaith=1
> 		ifconfig faith0 create >/dev/null 2>&1
> 		ifconfig faith0 up
> 		for prefix in ${ipv6_faith_prefix}; do
> @@ -48,7 +48,7 @@ faith_down()
> {
> 	echo "Removing IPv6-to-IPv4 TCP relay capturing interface: faith0."
> 	ifconfig faith0 destroy
> -	${SYSCTL_W} net.inet6.ip6.keepfaith=0
> +	${SYSCTL} net.inet6.ip6.keepfaith=0
>
> 	case ${ipv6_faith_prefix} in
> 	[Nn][Oo] | '')
>
> Modified: head/etc/rc.d/hostid
> ==============================================================================
> --- head/etc/rc.d/hostid	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/hostid	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -50,9 +50,9 @@ hostid_set()
> 	# Set both kern.hostuuid and kern.hostid.
> 	#
> 	check_startmsgs && echo "Setting hostuuid: ${uuid}."
> -	${SYSCTL_W} kern.hostuuid="${uuid}" >/dev/null
> +	${SYSCTL} kern.hostuuid="${uuid}" >/dev/null
> 	check_startmsgs && echo "Setting hostid: ${id}."
> -	${SYSCTL_W} kern.hostid=${id} >/dev/null
> +	${SYSCTL} kern.hostid=${id} >/dev/null
> }
>
> hostid_hardware()
>
> Modified: head/etc/rc.d/initrandom
> ==============================================================================
> --- head/etc/rc.d/initrandom	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/initrandom	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -31,24 +31,24 @@ initrandom_start()
>
> 		if [ -w /dev/random ]; then
> 			if checkyesno harvest_interrupt; then
> -				${SYSCTL_W} kern.random.sys.harvest.interrupt=1 >/dev/null
> +				${SYSCTL} kern.random.sys.harvest.interrupt=1 >/dev/null
> 				echo -n ' interrupts'
> 			else
> -				${SYSCTL_W} kern.random.sys.harvest.interrupt=0 >/dev/null
> +				${SYSCTL} kern.random.sys.harvest.interrupt=0 >/dev/null
> 			fi
>
> 			if checkyesno harvest_ethernet; then
> -				${SYSCTL_W} kern.random.sys.harvest.ethernet=1 >/dev/null
> +				${SYSCTL} kern.random.sys.harvest.ethernet=1 >/dev/null
> 				echo -n ' ethernet'
> 			else
> -				${SYSCTL_W} kern.random.sys.harvest.ethernet=0 >/dev/null
> +				${SYSCTL} kern.random.sys.harvest.ethernet=0 >/dev/null
> 			fi
>
> 			if checkyesno harvest_p_to_p; then
> -				${SYSCTL_W} kern.random.sys.harvest.point_to_point=1 >/dev/null
> +				${SYSCTL} kern.random.sys.harvest.point_to_point=1 >/dev/null
> 				echo -n ' point_to_point'
> 			else
> -				${SYSCTL_W} kern.random.sys.harvest.point_to_point=0 >/dev/null
> +				${SYSCTL} kern.random.sys.harvest.point_to_point=0 >/dev/null
> 			fi
> 		fi
>
>
> Modified: head/etc/rc.d/ipfw
> ==============================================================================
> --- head/etc/rc.d/ipfw	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/ipfw	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -73,11 +73,11 @@ ipfw_poststart()
>
> 	# Enable the firewall
> 	#
> -	if ! ${SYSCTL_W} net.inet.ip.fw.enable=1 1>/dev/null 2>&1; then
> +	if ! ${SYSCTL} net.inet.ip.fw.enable=1 1>/dev/null 2>&1; then
> 		warn "failed to enable IPv4 firewall"
> 	fi
> 	if afexists inet6; then
> -		if ! ${SYSCTL_W} net.inet6.ip6.fw.enable=1 1>/dev/null 2>&1
> +		if ! ${SYSCTL} net.inet6.ip6.fw.enable=1 1>/dev/null 2>&1
> 		then
> 			warn "failed to enable IPv6 firewall"
> 		fi
> @@ -90,9 +90,9 @@ ipfw_stop()
>
> 	# Disable the firewall
> 	#
> -	${SYSCTL_W} net.inet.ip.fw.enable=0
> +	${SYSCTL} net.inet.ip.fw.enable=0
> 	if afexists inet6; then
> -		${SYSCTL_W} net.inet6.ip6.fw.enable=0
> +		${SYSCTL} net.inet6.ip6.fw.enable=0
> 	fi
>
> 	# Stop firewall coscripts
>
> Modified: head/etc/rc.d/jail
> ==============================================================================
> --- head/etc/rc.d/jail	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/jail	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -219,12 +219,12 @@ set_sysctl()
> 	if checkyesno $_knob ; then
> 		if [ "$_current" -ne 1 ]; then
> 			echo -n " ${_msg}=YES"
> -			${SYSCTL_W} 1>/dev/null ${_mib}=1
> +			${SYSCTL} 1>/dev/null ${_mib}=1
> 		fi
> 	else
> 		if [ "$_current" -ne 0 ]; then
> 			echo -n " ${_msg}=NO"
> -			${SYSCTL_W} 1>/dev/null ${_mib}=0
> +			${SYSCTL} 1>/dev/null ${_mib}=0
> 		fi
> 	fi
> }
>
> Modified: head/etc/rc.d/netoptions
> ==============================================================================
> --- head/etc/rc.d/netoptions	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/netoptions	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -40,44 +40,44 @@ netoptions_inet()
> 	[12])
> 		netoptions_init
> 		echo -n " log_in_vain=${log_in_vain}"
> -		${SYSCTL_W} net.inet.tcp.log_in_vain=${log_in_vain} >/dev/null
> -		${SYSCTL_W} net.inet.udp.log_in_vain=${log_in_vain} >/dev/null
> +		${SYSCTL} net.inet.tcp.log_in_vain=${log_in_vain} >/dev/null
> +		${SYSCTL} net.inet.udp.log_in_vain=${log_in_vain} >/dev/null
> 		;;
> 	*)
> -		${SYSCTL_W} net.inet.tcp.log_in_vain=0 >/dev/null
> -		${SYSCTL_W} net.inet.udp.log_in_vain=0 >/dev/null
> +		${SYSCTL} net.inet.tcp.log_in_vain=0 >/dev/null
> +		${SYSCTL} net.inet.udp.log_in_vain=0 >/dev/null
> 		;;
> 	esac
>
> 	if checkyesno tcp_extensions; then
> -		${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null
> +		${SYSCTL} net.inet.tcp.rfc1323=1 >/dev/null
> 	else
> 		netoptions_init
> 		echo -n " rfc1323 extensions=${tcp_extensions}"
> -		${SYSCTL_W} net.inet.tcp.rfc1323=0 >/dev/null
> +		${SYSCTL} net.inet.tcp.rfc1323=0 >/dev/null
> 	fi
>
> 	if checkyesno tcp_keepalive; then
> -		${SYSCTL_W} net.inet.tcp.always_keepalive=1 >/dev/null
> +		${SYSCTL} net.inet.tcp.always_keepalive=1 >/dev/null
> 	else
> 		netoptions_init
> 		echo -n " TCP keepalive=${tcp_keepalive}"
> -		${SYSCTL_W} net.inet.tcp.always_keepalive=0 >/dev/null
> +		${SYSCTL} net.inet.tcp.always_keepalive=0 >/dev/null
> 	fi
>
> 	if checkyesno tcp_drop_synfin; then
> 		netoptions_init
> 		echo -n " drop SYN+FIN packets=${tcp_drop_synfin}"
> -		${SYSCTL_W} net.inet.tcp.drop_synfin=1 >/dev/null
> +		${SYSCTL} net.inet.tcp.drop_synfin=1 >/dev/null
> 	else
> -		${SYSCTL_W} net.inet.tcp.drop_synfin=0 >/dev/null
> +		${SYSCTL} net.inet.tcp.drop_synfin=0 >/dev/null
> 	fi
>
> 	case ${ip_portrange_first} in
> 	[0-9]*)
> 		netoptions_init
> 		echo -n " ip_portrange_first=$ip_portrange_first"
> -		${SYSCTL_W} net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
> +		${SYSCTL} net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
> 		;;
> 	esac
>
> @@ -85,7 +85,7 @@ netoptions_inet()
> 	[0-9]*)
> 		netoptions_init
> 		echo -n " ip_portrange_last=$ip_portrange_last"
> -		${SYSCTL_W} net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
> +		${SYSCTL} net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
> 		;;
> 	esac
> }
> @@ -95,16 +95,16 @@ netoptions_inet6()
> 	if checkyesno ipv6_ipv4mapping; then
> 		netoptions_init
> 		echo -n " ipv4-mapped-ipv6=${ipv6_ipv4mapping}"
> -		${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
> +		${SYSCTL} net.inet6.ip6.v6only=0 >/dev/null
> 	else
> -		${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
> +		${SYSCTL} net.inet6.ip6.v6only=1 >/dev/null
> 	fi
>
> 	if checkyesno ipv6_privacy; then
> 		netoptions_init
> 		echo -n " IPv6 Privacy Addresses"
> -		${SYSCTL_W} net.inet6.ip6.use_tempaddr=1 >/dev/null
> -		${SYSCTL_W} net.inet6.ip6.prefer_tempaddr=1 >/dev/null
> +		${SYSCTL} net.inet6.ip6.use_tempaddr=1 >/dev/null
> +		${SYSCTL} net.inet6.ip6.prefer_tempaddr=1 >/dev/null
> 	fi
> }
>
>
> Modified: head/etc/rc.d/routing
> ==============================================================================
> --- head/etc/rc.d/routing	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/routing	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -264,57 +264,57 @@ options_inet()
> 	if checkyesno icmp_bmcastecho; then
> 		ropts_init
> 		echo -n ' broadcast ping responses=YES'
> -		${SYSCTL_W} net.inet.icmp.bmcastecho=1 > /dev/null
> +		${SYSCTL} net.inet.icmp.bmcastecho=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet.icmp.bmcastecho=0 > /dev/null
> +		${SYSCTL} net.inet.icmp.bmcastecho=0 > /dev/null
> 	fi
>
> 	if checkyesno icmp_drop_redirect; then
> 		ropts_init
> 		echo -n ' ignore ICMP redirect=YES'
> -		${SYSCTL_W} net.inet.icmp.drop_redirect=1 > /dev/null
> +		${SYSCTL} net.inet.icmp.drop_redirect=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet.icmp.drop_redirect=0 > /dev/null
> +		${SYSCTL} net.inet.icmp.drop_redirect=0 > /dev/null
> 	fi
>
> 	if checkyesno icmp_log_redirect; then
> 		ropts_init
> 		echo -n ' log ICMP redirect=YES'
> -		${SYSCTL_W} net.inet.icmp.log_redirect=1 > /dev/null
> +		${SYSCTL} net.inet.icmp.log_redirect=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet.icmp.log_redirect=0 > /dev/null
> +		${SYSCTL} net.inet.icmp.log_redirect=0 > /dev/null
> 	fi
>
> 	if checkyesno gateway_enable; then
> 		ropts_init
> 		echo -n ' IPv4 gateway=YES'
> -		${SYSCTL_W} net.inet.ip.forwarding=1 > /dev/null
> +		${SYSCTL} net.inet.ip.forwarding=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet.ip.forwarding=0 > /dev/null
> +		${SYSCTL} net.inet.ip.forwarding=0 > /dev/null
> 	fi
>
> 	if checkyesno forward_sourceroute; then
> 		ropts_init
> 		echo -n ' do source routing=YES'
> -		${SYSCTL_W} net.inet.ip.sourceroute=1 > /dev/null
> +		${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet.ip.sourceroute=0 > /dev/null
> +		${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null
> 	fi
>
> 	if checkyesno accept_sourceroute; then
> 		ropts_init
> 		echo -n ' accept source routing=YES'
> -		${SYSCTL_W} net.inet.ip.accept_sourceroute=1 > /dev/null
> +		${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet.ip.accept_sourceroute=0 > /dev/null
> +		${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null
> 	fi
>
> 	if checkyesno arpproxy_all; then
> 		ropts_init
> 		echo -n ' ARP proxyall=YES'
> -		${SYSCTL_W} net.link.ether.inet.proxyall=1 > /dev/null
> +		${SYSCTL} net.link.ether.inet.proxyall=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.link.ether.inet.proxyall=0 > /dev/null
> +		${SYSCTL} net.link.ether.inet.proxyall=0 > /dev/null
> 	fi
> }
>
> @@ -323,9 +323,9 @@ options_inet6()
> 	if checkyesno ipv6_gateway_enable; then
> 		ropts_init
> 		echo -n ' IPv6 gateway=YES'
> -		${SYSCTL_W} net.inet6.ip6.forwarding=1 > /dev/null
> +		${SYSCTL} net.inet6.ip6.forwarding=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.inet6.ip6.forwarding=0 > /dev/null
> +		${SYSCTL} net.inet6.ip6.forwarding=0 > /dev/null
> 	fi
> }
>
> @@ -338,9 +338,9 @@ options_ipx()
> 	if checkyesno ipxgateway_enable; then
> 		ropts_init
> 		echo -n ' IPX gateway=YES'
> -		${SYSCTL_W} net.ipx.ipx.ipxforwarding=1 > /dev/null
> +		${SYSCTL} net.ipx.ipx.ipxforwarding=1 > /dev/null
> 	else
> -		${SYSCTL_W} net.ipx.ipx.ipxforwarding=0 > /dev/null
> +		${SYSCTL} net.ipx.ipx.ipxforwarding=0 > /dev/null
> 	fi
> }
>
>
> Modified: head/etc/rc.d/securelevel
> ==============================================================================
> --- head/etc/rc.d/securelevel	Wed Mar 30 01:10:11 2011	(r220152)
> +++ head/etc/rc.d/securelevel	Wed Mar 30 01:19:00 2011	(r220153)
> @@ -20,7 +20,7 @@ securelevel_start()
> {
> 	if [ ${kern_securelevel} -ge 0 ]; then
> 		echo 'Raising kernel security level: '
> -		${SYSCTL_W} kern.securelevel=${kern_securelevel}
> +		${SYSCTL} kern.securelevel=${kern_securelevel}
> 	fi
> }
>
>

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 16:16:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6ACF4106566B;
	Sun,  3 Apr 2011 16:16:53 +0000 (UTC)
	(envelope-from emaste@freebsd.org)
Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134])
	by mx1.freebsd.org (Postfix) with ESMTP id 210808FC17;
	Sun,  3 Apr 2011 16:16:53 +0000 (UTC)
Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by
	WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id
	14.0.694.0; Sun, 3 Apr 2011 12:06:02 -0400
Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332)	id
	403F633C00; Sun,  3 Apr 2011 12:06:02 -0400 (EDT)
Date: Sun, 3 Apr 2011 12:06:02 -0400
From: Ed Maste 
To: "Bjoern A. Zeeb" 
Message-ID: <20110403160602.GA67576@sandvine.com>
References: <201103300119.p2U1J18L046334@svn.freebsd.org>
	
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Maste 
Subject: Re: svn commit: r220153 - head/etc/rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 16:16:53 -0000

On Sun, Apr 03, 2011 at 02:56:50PM +0000, Bjoern A. Zeeb wrote:

> On Wed, 30 Mar 2011, Ed Maste wrote:

> > Replace ${SYSCTL_W} with ${SYSCTL} in rc.d scripts, as they are identical.
> 
>              ... for example OSX really requires the -w to alter a
> sysctl while we permit without.   I thin kthe correct fix should have
> been to add a -w to SYSCTL_W.

NetBSD also requires -w as far as I know.  However, we've deprecated the
switch -- see sysctl(8):

   The -w option has been deprecated and is silently ignored.

I don't think there's much value in using a deprecated and ignored flag
in our startup scripts.

> That way one can grep for a read vs.
> write in the startup scrpits a lot more easily, etc.

Something along the lines of egrep -ir 'sysctl.*=' can be used to find
places that sysctls are written; this has the benefit of finding the
cases where we're already not using a ${SYSCTL} or ${SYSCTL_W} variable
today.

-Ed

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 17:36:34 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6BAD6106564A;
	Sun,  3 Apr 2011 17:36:34 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DEC98FC0C;
	Sun,  3 Apr 2011 17:36:34 +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 p33HaYbc044814;
	Sun, 3 Apr 2011 17:36:34 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33HaY3Q044812;
	Sun, 3 Apr 2011 17:36:34 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104031736.p33HaY3Q044812@svn.freebsd.org>
From: Adrian Chadd 
Date: Sun, 3 Apr 2011 17:36:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220298 - head/sys/dev/ath/ath_hal
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 17:36:34 -0000

Author: adrian
Date: Sun Apr  3 17:36:32 2011
New Revision: 220298
URL: http://svn.freebsd.org/changeset/base/220298

Log:
  Add in the clock timing calculation when Merlin is using the 5ghz fast clock.
  This is a 44mhz clock, not a 40mhz clock like normal for 5ghz operation.

Modified:
  head/sys/dev/ath/ath_hal/ah.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c	Sun Apr  3 14:39:55 2011	(r220297)
+++ head/sys/dev/ath/ath_hal/ah.c	Sun Apr  3 17:36:32 2011	(r220298)
@@ -21,6 +21,7 @@
 #include "ah.h"
 #include "ah_internal.h"
 #include "ah_devid.h"
+#include "ah_eeprom.h"			/* for 5ghz fast clock flag */
 
 #include "ar5416/ar5416reg.h"		/* NB: includes ar5212reg.h */
 
@@ -419,6 +420,8 @@ ath_hal_chan2wmode(struct ath_hal *ah, c
                                      /* 11a Turbo  11b  11g  108g */
 static const uint8_t CLOCK_RATE[]  = { 40,  80,   22,  44,   88  };
 
+#define	CLOCK_FAST_RATE_5GHZ_OFDM	44
+
 u_int
 ath_hal_mac_clks(struct ath_hal *ah, u_int usecs)
 {
@@ -426,7 +429,12 @@ ath_hal_mac_clks(struct ath_hal *ah, u_i
 	u_int clks;
 
 	/* NB: ah_curchan may be null when called attach time */
-	if (c != AH_NULL) {
+	/* XXX merlin and later specific workaround - 5ghz fast clock is 44 */
+	if (c != AH_NULL && IS_5GHZ_FAST_CLOCK_EN(ah, c)) {
+		clks = usecs * CLOCK_FAST_RATE_5GHZ_OFDM;
+		if (IEEE80211_IS_CHAN_HT40(c))
+			clks <<= 1;
+	} else if (c != AH_NULL) {
 		clks = usecs * CLOCK_RATE[ath_hal_chan2wmode(ah, c)];
 		if (IEEE80211_IS_CHAN_HT40(c))
 			clks <<= 1;
@@ -442,7 +450,12 @@ ath_hal_mac_usec(struct ath_hal *ah, u_i
 	u_int usec;
 
 	/* NB: ah_curchan may be null when called attach time */
-	if (c != AH_NULL) {
+	/* XXX merlin and later specific workaround - 5ghz fast clock is 44 */
+	if (c != AH_NULL && IS_5GHZ_FAST_CLOCK_EN(ah, c)) {
+		usec = clks / CLOCK_FAST_RATE_5GHZ_OFDM;
+		if (IEEE80211_IS_CHAN_HT40(c))
+			usec >>= 1;
+	} else if (c != AH_NULL) {
 		usec = clks / CLOCK_RATE[ath_hal_chan2wmode(ah, c)];
 		if (IEEE80211_IS_CHAN_HT40(c))
 			usec >>= 1;

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 17:38:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BFA541065674;
	Sun,  3 Apr 2011 17:38:13 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ACD948FC0C;
	Sun,  3 Apr 2011 17:38: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 p33HcDNI044941;
	Sun, 3 Apr 2011 17:38:13 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33HcDXa044940;
	Sun, 3 Apr 2011 17:38:13 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201104031738.p33HcDXa044940@svn.freebsd.org>
From: Mikolaj Golub 
Date: Sun, 3 Apr 2011 17:38:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220299 - head/sys/geom/eli
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 17:38:13 -0000

Author: trociny
Date: Sun Apr  3 17:38:12 2011
New Revision: 220299
URL: http://svn.freebsd.org/changeset/base/220299

Log:
  In g_eli_read_done() and g_eli_write_done(), for a bio with
  bio_children > 1, g_destroy_bio() is never called and the bio
  leaks. Fix this by calling g_destroy_bio() earlier, before the check.
  
  Submitted by:	Victor Balada Diaz  (initial version)
  Approved by:	pjd (mentor)
  MFC after:	1 week

Modified:
  head/sys/geom/eli/g_eli.c

Modified: head/sys/geom/eli/g_eli.c
==============================================================================
--- head/sys/geom/eli/g_eli.c	Sun Apr  3 17:36:32 2011	(r220298)
+++ head/sys/geom/eli/g_eli.c	Sun Apr  3 17:38:12 2011	(r220299)
@@ -161,13 +161,13 @@ g_eli_read_done(struct bio *bp)
 	pbp = bp->bio_parent;
 	if (pbp->bio_error == 0)
 		pbp->bio_error = bp->bio_error;
+	g_destroy_bio(bp);
 	/*
 	 * Do we have all sectors already?
 	 */
 	pbp->bio_inbed++;
 	if (pbp->bio_inbed < pbp->bio_children)
 		return;
-	g_destroy_bio(bp);
 	sc = pbp->bio_to->geom->softc;
 	if (pbp->bio_error != 0) {
 		G_ELI_LOGREQ(0, pbp, "%s() failed", __func__);
@@ -203,6 +203,7 @@ g_eli_write_done(struct bio *bp)
 		if (bp->bio_error != 0)
 			pbp->bio_error = bp->bio_error;
 	}
+	g_destroy_bio(bp);
 	/*
 	 * Do we have all sectors already?
 	 */
@@ -216,7 +217,6 @@ g_eli_write_done(struct bio *bp)
 		    pbp->bio_error);
 		pbp->bio_completed = 0;
 	}
-	g_destroy_bio(bp);
 	/*
 	 * Write is finished, send it up.
 	 */

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 18:56:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D1A9106564A;
	Sun,  3 Apr 2011 18:56:17 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0AD578FC08;
	Sun,  3 Apr 2011 18:56:17 +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 p33IuGCC049223;
	Sun, 3 Apr 2011 18:56:16 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33IuGld049220;
	Sun, 3 Apr 2011 18:56:16 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201104031856.p33IuGld049220@svn.freebsd.org>
From: Mikolaj Golub 
Date: Sun, 3 Apr 2011 18:56:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220300 - stable/8/sys/geom/gate
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 18:56:17 -0000

Author: trociny
Date: Sun Apr  3 18:56:16 2011
New Revision: 220300
URL: http://svn.freebsd.org/changeset/base/220300

Log:
  MFC r220062, r220173:
  
  r220062:
  
  In g_gate_create() there is a window between when g_gate_softc is
  registered in g_gate_units array and when its sc_provider field is
  filled. If during this period g_gate_units is accessed by another
  thread that is checking for provider name collision the crash is
  possible.
  
  Fix this by adding sc_name field to struct g_gate_softc. In
  g_gate_create() when g_gate_softc is created but sc_provider is still
  not sc_name points to provider name stored in the local array.
  
  Reported by:    Freddie Cash 
  
  r220173:
  
  Increase debug level on g_gate device destruction and add message on
  device creation.
  
  Suggested by:   danger
  
  Approved by:	pjd (mentor)

Modified:
  stable/8/sys/geom/gate/g_gate.c
  stable/8/sys/geom/gate/g_gate.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/geom/gate/g_gate.c
==============================================================================
--- stable/8/sys/geom/gate/g_gate.c	Sun Apr  3 17:38:12 2011	(r220299)
+++ stable/8/sys/geom/gate/g_gate.c	Sun Apr  3 18:56:16 2011	(r220300)
@@ -134,7 +134,7 @@ g_gate_destroy(struct g_gate_softc *sc, 
 	mtx_unlock(&g_gate_units_lock);
 	mtx_destroy(&sc->sc_queue_mtx);
 	g_topology_lock();
-	G_GATE_DEBUG(0, "Device %s destroyed.", gp->name);
+	G_GATE_DEBUG(1, "Device %s destroyed.", gp->name);
 	gp->softc = NULL;
 	g_wither_geom(gp, ENXIO);
 	sc->sc_provider = NULL;
@@ -407,13 +407,14 @@ g_gate_create(struct g_gate_ctl_create *
 	for (unit = 0; unit < g_gate_maxunits; unit++) {
 		if (g_gate_units[unit] == NULL)
 			continue;
-		if (strcmp(name, g_gate_units[unit]->sc_provider->name) != 0)
+		if (strcmp(name, g_gate_units[unit]->sc_name) != 0)
 			continue;
 		mtx_unlock(&g_gate_units_lock);
 		mtx_destroy(&sc->sc_queue_mtx);
 		free(sc, M_GATE);
 		return (EEXIST);
 	}
+	sc->sc_name = name;
 	g_gate_units[sc->sc_unit] = sc;
 	g_gate_nunits++;
 	mtx_unlock(&g_gate_units_lock);
@@ -432,6 +433,10 @@ g_gate_create(struct g_gate_ctl_create *
 	sc->sc_provider = pp;
 	g_error_provider(pp, 0);
 	g_topology_unlock();
+	mtx_lock(&g_gate_units_lock);
+	sc->sc_name = sc->sc_provider->name;
+	mtx_unlock(&g_gate_units_lock);
+	G_GATE_DEBUG(1, "Device %s created.", gp->name);
 
 	if (sc->sc_timeout > 0) {
 		callout_reset(&sc->sc_callout, sc->sc_timeout * hz,

Modified: stable/8/sys/geom/gate/g_gate.h
==============================================================================
--- stable/8/sys/geom/gate/g_gate.h	Sun Apr  3 17:38:12 2011	(r220299)
+++ stable/8/sys/geom/gate/g_gate.h	Sun Apr  3 18:56:16 2011	(r220300)
@@ -76,6 +76,7 @@
  * 'P:' means 'Protected by'.
  */
 struct g_gate_softc {
+	char			*sc_name;		/* P: (read-only) */
 	int			 sc_unit;		/* P: (read-only) */
 	int			 sc_ref;		/* P: g_gate_list_mtx */
 	struct g_provider	*sc_provider;		/* P: (read-only) */
@@ -96,7 +97,6 @@ struct g_gate_softc {
 	LIST_ENTRY(g_gate_softc) sc_next;		/* P: g_gate_list_mtx */
 	char			 sc_info[G_GATE_INFOSIZE]; /* P: (read-only) */
 };
-#define	sc_name	sc_provider->geom->name
 
 #define	G_GATE_DEBUG(lvl, ...)	do {					\
 	if (g_gate_debug >= (lvl)) {					\

From owner-svn-src-all@FreeBSD.ORG  Sun Apr  3 20:03:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 30A47106566B;
	Sun,  3 Apr 2011 20:03:46 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F9E38FC13;
	Sun,  3 Apr 2011 20:03: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 p33K3kGh054194;
	Sun, 3 Apr 2011 20:03:46 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p33K3kkw054188;
	Sun, 3 Apr 2011 20:03:46 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201104032003.p33K3kkw054188@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 3 Apr 2011 20:03:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r220301 - in head: sys/dev/usb usr.sbin/usbdump
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 03 Apr 2011 20:03:46 -0000

Author: hselasky
Date: Sun Apr  3 20:03:45 2011
New Revision: 220301
URL: http://svn.freebsd.org/changeset/base/220301

Log:
  - Improvements to USB PF solution
  - Add more fields for USB device and host mode
  - Add more information to USB PF header so that decoding
    can easily be done by software analyzer tools like
    Wireshark.
  - Optimise usbdump to display USB streams in text format
    more efficiently.
  - Software using USB PF must be recompiled after
    this commit, due to structure changes.
  
  MFC after:	7 days
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/usb_pf.c
  head/sys/dev/usb/usb_pf.h
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usbdi.h
  head/usr.sbin/usbdump/usbdump.c

Modified: head/sys/dev/usb/usb_pf.c
==============================================================================
--- head/sys/dev/usb/usb_pf.c	Sun Apr  3 18:56:16 2011	(r220300)
+++ head/sys/dev/usb/usb_pf.c	Sun Apr  3 20:03:45 2011	(r220301)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -57,28 +58,44 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+static int usb_no_pf;
+
+SYSCTL_INT(_hw_usb, OID_AUTO, no_pf, CTLFLAG_RW,
+    &usb_no_pf, 0, "Set to disable USB packet filtering");
+
+TUNABLE_INT("hw.usb.no_pf", &usb_no_pf);
+
 void
 usbpf_attach(struct usb_bus *ubus)
 {
 	struct ifnet *ifp;
 
+	if (usb_no_pf != 0) {
+		ubus->ifp = NULL;
+		return;
+	}
+
 	ifp = ubus->ifp = if_alloc(IFT_USB);
+	if (ifp == NULL) {
+		device_printf(ubus->parent, "usbpf: Could not allocate "
+		    "instance\n");
+		return;
+	}
+
 	if_initname(ifp, "usbus", device_get_unit(ubus->bdev));
 	ifp->if_flags = IFF_CANTCONFIG;
 	if_attach(ifp);
 	if_up(ifp);
 
-	KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
-	    ("wrong USB pf header length (%zd)", sizeof(struct usbpf_pkthdr)));
-
 	/*
-	 * XXX According to the specification of DLT_USB, it indicates packets
-	 * beginning with USB setup header.  But not sure all packets would be.
+	 * XXX According to the specification of DLT_USB, it indicates
+	 * packets beginning with USB setup header. But not sure all
+	 * packets would be.
 	 */
 	bpfattach(ifp, DLT_USB, USBPF_HDR_LEN);
 
 	if (bootverbose)
-		device_printf(ubus->parent, "usbpf attached\n");
+		device_printf(ubus->parent, "usbpf: Attached\n");
 }
 
 void
@@ -172,79 +189,204 @@ usbpf_aggregate_status(struct usb_xfer_f
 	return (val);
 }
 
+static int
+usbpf_xfer_frame_is_read(struct usb_xfer *xfer, uint32_t frame)
+{
+	int isread;
+
+	if ((frame == 0) && (xfer->flags_int.control_xfr != 0) &&
+	    (xfer->flags_int.control_hdr != 0)) {
+		/* special case */
+		if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
+			/* The device controller writes to memory */
+			isread = 1;
+		} else {
+			/* The host controller reads from memory */
+			isread = 0;
+		}
+	} else {
+		isread = USB_GET_DATA_ISREAD(xfer);
+	}
+	return (isread);
+}
+
+static uint32_t
+usbpf_xfer_precompute_size(struct usb_xfer *xfer, int type)
+{
+	uint32_t totlen;
+	uint32_t x;
+	uint32_t nframes;
+
+	if (type == USBPF_XFERTAP_SUBMIT)
+		nframes = xfer->nframes;
+	else
+		nframes = xfer->aframes;
+
+	totlen = USBPF_HDR_LEN + (USBPF_FRAME_HDR_LEN * nframes);
+
+	/* precompute all trace lengths */
+	for (x = 0; x != nframes; x++) {
+		if (usbpf_xfer_frame_is_read(xfer, x)) {
+			if (type != USBPF_XFERTAP_SUBMIT) {
+				totlen += USBPF_FRAME_ALIGN(
+				    xfer->frlengths[x]);
+			}
+		} else {
+			if (type == USBPF_XFERTAP_SUBMIT) {
+				totlen += USBPF_FRAME_ALIGN(
+				    xfer->frlengths[x]);
+			}
+		}
+	}
+	return (totlen);
+}
+
 void
 usbpf_xfertap(struct usb_xfer *xfer, int type)
 {
-	struct usb_endpoint *ep = xfer->endpoint;
-	struct usb_page_search res;
-	struct usb_xfer_root *info = xfer->xroot;
-	struct usb_bus *bus = info->bus;
+	struct usb_bus *bus;
 	struct usbpf_pkthdr *up;
-	usb_frlength_t isoc_offset = 0;
-	int i;
-	char *buf, *ptr, *end;
+	struct usbpf_framehdr *uf;
+	usb_frlength_t offset;
+	uint32_t totlen;
+	uint32_t frame;
+	uint32_t temp;
+	uint32_t nframes;
+	uint32_t x;
+	uint8_t *buf;
+	uint8_t *ptr;
+
+	bus = xfer->xroot->bus;
 
+	/* sanity checks */
+	if (usb_no_pf != 0)
+		return;
+	if (bus->ifp == NULL)
+		return;
 	if (!bpf_peers_present(bus->ifp->if_bpf))
 		return;
 
+	totlen = usbpf_xfer_precompute_size(xfer, type);
+
+	if (type == USBPF_XFERTAP_