svn commit: r242747 - head/sys/kern

2012-11-08 Thread Marius Strobl
Author: marius
Date: Thu Nov  8 08:10:32 2012
New Revision: 242747
URL: http://svnweb.freebsd.org/changeset/base/242747

Log:
  Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_address
  vm_offset_t as they should be.

Modified:
  head/sys/kern/kern_malloc.c

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Thu Nov  8 04:02:36 2012(r242746)
+++ head/sys/kern/kern_malloc.c Thu Nov  8 08:10:32 2012(r242747)
@@ -186,11 +186,13 @@ struct {
  */
 static uma_zone_t mt_zone;
 
-static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
+static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
 SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
 vm_min_kernel_address, 0, Min kernel address);
 
-static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#ifndef __sparc64__
+static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#endif
 SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
 vm_max_kernel_address, 0, Max kernel address);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242747 - head/sys/kern

2012-11-08 Thread Alfred Perlstein
Please define a reasonable value for VM_MAX_KERNEL_ADDRESS on sparc64, 
it's needed for autotuning.


-Alfred

On 11/8/12 12:10 AM, Marius Strobl wrote:

Author: marius
Date: Thu Nov  8 08:10:32 2012
New Revision: 242747
URL: http://svnweb.freebsd.org/changeset/base/242747

Log:
   Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_address
   vm_offset_t as they should be.

Modified:
   head/sys/kern/kern_malloc.c

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Thu Nov  8 04:02:36 2012(r242746)
+++ head/sys/kern/kern_malloc.c Thu Nov  8 08:10:32 2012(r242747)
@@ -186,11 +186,13 @@ struct {
   */
  static uma_zone_t mt_zone;
  
-static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;

+static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
  SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
  vm_min_kernel_address, 0, Min kernel address);
  
-static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;

+#ifndef __sparc64__
+static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#endif
  SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
  vm_max_kernel_address, 0, Max kernel address);
  


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242029 - head/sys/kern

2012-11-08 Thread Alfred Perlstein

Peter,

I agree.

It's certainly not perfect, however it's not nearly as bogus as what was 
there previously.


I know maxusers is wrong, however what it really means, if you think 
about it, is give me a scaling factor that is relative to physical ram, 
BUT capped at some value so as to not exhaust KVA. Yes, I grok that on 
certain architectures that mbufs clusters aren't pulled from KVA, but, 
that seems much less important than how broken it is currently


This fix is good enough for the general case, and a far greater 
improvement than what was there previously which would make FreeBSD blow 
chunks on any sort of 10gigE load.


I think what needs to happen here, is that the people requiring 
perfection think about what mess it was prior and if they themselves do 
not have time to make it 100% perfect, allowing someone to step in and 
move something

a step in the right direction without overly complicating it.

What is there is crap, it's old, crufty and broken, it really is. It 
needs to be fixed, it needs to be given a nice fat band-aid now, and 
when someone interested in perfection comes along, then they can make it 
even more awesome.


I am not saying that my fix is PERFECT or the be all and end all, 
however it serves as a good step in the right direction on our tier 1 
platforms and is easily modifiable (just replace VM_MAX_KERNEL_ADDRESS 
- VM_MIN_KERNEL_ADDRESS with some form of MD magic sauce.)  Would you 
like me to do that?  Replace the hardline calculation with some constant 
that each platform can configure?


I'm thinking this might suffice to make purists a bit more happy:

#if defined(i386) || defined(amd64)
#define MAX_KERNEL_ADDRESS_SPACE (VM_MAX_KERNEL_ADDRESS - 
VM_MIN_KERNEL_ADDRESS)

#else
#define MAX_KERNEL_ADDRESS_SPACE  (1024*1024*1024)
#endif

Given my algorithm this should result in pretty much the same for other 
platforms than amd64 which will then be able to grow maxusers some.


I'm basically running out of time on this and I'm worried that I'll have 
to back it out indefinitely so that FreeBSD can't do 10gigE out of the box.


-Alfred

On 11/7/12 11:46 PM, Peter Wemm wrote:

On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein bri...@mu.org wrote:

[[ + peter ]]

Folks, I spent quite a bit of time trying to figure out how to resolve
maxusers scaling in a happy way for all.

I think I came up with a solution.

This solution should work for i386, and other 32 bit platforms, as well as
scaling well for 64 bit (or higher) platforms that have virtually unlimited
AND 64bit with limited kernel address space.

Here is how it works:

We calculate the maxusers value based on physical memory, and then clamp it
down if physical memory exceeds kernel addressable memory.

The algorithm actually remains the same for all architectures, with the
exception that machines with large kernel address space it is no longer
clamped at 384.

I've attached a test program that lets you play with various values for
VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages.  (argv[1, 2, 3]
respectively.)

Please give me your feedback.

This is still bogus.  VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS
have no bearing on how much space should be allocated for mbuf
clusters on amd64.  If anything, you want dmapbase / dmapend if you
want a practical cap for amd64.  Even then, jumbo clusters are 4K so
they come out of kva rather than direct map.

maxusers is the wrong thing for this.  maxusers should, if anything,
be used to set things like kern.maxproc.  Preferably it should be
deleted entirely and sysctl.conf should be used to change
kern.maxproc.

Setting limits for the mbuf / cluster pool should be a MD parameter.

Trying to scale maxusers based on physical ram in order to get mbuf
cluster limits set as a side effect is just plain wrong.

It makes no more sense than trying to set nmbclusters based on
PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order
to get desirable second and third order side effects.

Scale nmbclusters based on physical ram, with a MD method for capping
it for when there are MD limits (eg: disproportionately small kva on
an i386 PAE machine).  Don't use maxusers.


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242029 - head/sys/kern

2012-11-08 Thread Garrett Cooper
On Nov 8, 2012, at 1:13 AM, Alfred Perlstein wrote:

 Peter,
 
 I agree.
 
 It's certainly not perfect, however it's not nearly as bogus as what was 
 there previously.
 
 I know maxusers is wrong, however what it really means, if you think 
 about it, is give me a scaling factor that is relative to physical ram, BUT 
 capped at some value so as to not exhaust KVA. Yes, I grok that on certain 
 architectures that mbufs clusters aren't pulled from KVA, but, that seems 
 much less important than how broken it is currently
 
 This fix is good enough for the general case, and a far greater improvement 
 than what was there previously which would make FreeBSD blow chunks on any 
 sort of 10gigE load.
 
 I think what needs to happen here, is that the people requiring perfection 
 think about what mess it was prior and if they themselves do not have time to 
 make it 100% perfect, allowing someone to step in and move something
 a step in the right direction without overly complicating it.
 
 What is there is crap, it's old, crufty and broken, it really is. It needs to 
 be fixed, it needs to be given a nice fat band-aid now, and when someone 
 interested in perfection comes along, then they can make it even more awesome.
 
 I am not saying that my fix is PERFECT or the be all and end all, however it 
 serves as a good step in the right direction on our tier 1 platforms and is 
 easily modifiable (just replace VM_MAX_KERNEL_ADDRESS - 
 VM_MIN_KERNEL_ADDRESS with some form of MD magic sauce.)  Would you like me 
 to do that?  Replace the hardline calculation with some constant that each 
 platform can configure?
 
 I'm thinking this might suffice to make purists a bit more happy:
 
 #if defined(i386) || defined(amd64)
 #define MAX_KERNEL_ADDRESS_SPACE (VM_MAX_KERNEL_ADDRESS - 
 VM_MIN_KERNEL_ADDRESS)
 #else
 #define MAX_KERNEL_ADDRESS_SPACE  (1024*1024*1024)

Only 1GB for KVA on 64-bit platforms too...?

 #endif
 
 Given my algorithm this should result in pretty much the same for other 
 platforms than amd64 which will then be able to grow maxusers some.
 
 I'm basically running out of time on this and I'm worried that I'll have to 
 back it out indefinitely so that FreeBSD can't do 10gigE out of the box.

I agree with the philosophy being taken. Perfection shouldn't be the enemy of 
the good as long as it gets close enough that things are more useful than they 
are today.

Thanks for championing this Alfred. The less voodoo required for FreeBSD to 
function on commodity hardware, the better!

-Garrett
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242748 - head/sys/dev/usb

2012-11-08 Thread Kevin Lo
Author: kevlo
Date: Thu Nov  8 09:29:05 2012
New Revision: 242748
URL: http://svnweb.freebsd.org/changeset/base/242748

Log:
  Add new USB device ID.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Nov  8 08:10:32 2012(r242747)
+++ head/sys/dev/usb/usbdevsThu Nov  8 09:29:05 2012(r242748)
@@ -1545,6 +1545,7 @@ product EDIMAX EW7318USG  0x7318  USB Wire
 product EDIMAX RT2870_10x7711  RT2870
 product EDIMAX EW7717  0x7717  EW-7717
 product EDIMAX EW7718  0x7718  EW-7718
+product EDIMAX EW7811UN0x7811  EW-7811Un
 
 /* eGalax Products */
 product EGALAX TPANEL  0x0001  Touch Panel
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242029 - head/sys/kern

2012-11-08 Thread Andre Oppermann

On 08.11.2012 08:46, Peter Wemm wrote:

On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein bri...@mu.org wrote:

[[ + peter ]]

Folks, I spent quite a bit of time trying to figure out how to resolve
maxusers scaling in a happy way for all.

I think I came up with a solution.

This solution should work for i386, and other 32 bit platforms, as well as
scaling well for 64 bit (or higher) platforms that have virtually unlimited
AND 64bit with limited kernel address space.

Here is how it works:

We calculate the maxusers value based on physical memory, and then clamp it
down if physical memory exceeds kernel addressable memory.

The algorithm actually remains the same for all architectures, with the
exception that machines with large kernel address space it is no longer
clamped at 384.

I've attached a test program that lets you play with various values for
VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages.  (argv[1, 2, 3]
respectively.)

Please give me your feedback.


This is still bogus.  VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS
have no bearing on how much space should be allocated for mbuf
clusters on amd64.  If anything, you want dmapbase / dmapend if you
want a practical cap for amd64.  Even then, jumbo clusters are 4K so
they come out of kva rather than direct map.

maxusers is the wrong thing for this.  maxusers should, if anything,
be used to set things like kern.maxproc.  Preferably it should be
deleted entirely and sysctl.conf should be used to change
kern.maxproc.

Setting limits for the mbuf / cluster pool should be a MD parameter.

Trying to scale maxusers based on physical ram in order to get mbuf
cluster limits set as a side effect is just plain wrong.

It makes no more sense than trying to set nmbclusters based on
PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order
to get desirable second and third order side effects.

Scale nmbclusters based on physical ram, with a MD method for capping
it for when there are MD limits (eg: disproportionately small kva on
an i386 PAE machine).  Don't use maxusers.


ACK

--
Andre

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242747 - head/sys/kern

2012-11-08 Thread Bruce Evans

On Thu, 8 Nov 2012, Marius Strobl wrote:


Log:
 Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_address
 vm_offset_t as they should be.


Er, they shouldn't be vm_offset_t.


Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Thu Nov  8 04:02:36 2012(r242746)
+++ head/sys/kern/kern_malloc.c Thu Nov  8 08:10:32 2012(r242747)
@@ -186,11 +186,13 @@ struct {
 */
static uma_zone_t mt_zone;

-static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
+static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
vm_min_kernel_address, 0, Min kernel address);


SYSCTL_ULONG takes a u_long, not a vm_offset_t.  A cast in
SYSCTL_ULONG() prevents possible detection of the type mismatch from
this.

This is most broken on i386's with correctly-sized longs (or almost
any arch with correctly-sized longs).  There, vm_offset_t is 1
register wide and longs are 2 registers wide.

The bugs could be moved using SYSCTL_QUAD().  Correctly-sized quads
would be 4 registers wide, except quad has come to mean just a bad
way of spelling long long or int64_t.


-static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#ifndef __sparc64__
+static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#endif
SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
vm_max_kernel_address, 0, Max kernel address);


Since the value is a compile-time constant, u_long has a chance of
holding its value even if u_long != vm_offset_t, and the old code is
closer to being correct than first appeared, and the correct fix is
relatively easy -- just use a uintmax_t vatiable and SYSCTL_UINTMAX()
(*).  Unfortunately SYSCT_UINTMAX() doesn't exist, and the bogus
SYSCTL_UQUAD() does exist.

(*) Except a temporary variable is just a style bug in the above and
for this.  SYSCTL_UNLONG(), like all integer SYSCTL()'s, has the feature
of supporting either a variable or a constant arg.  The above should 
use a constant arg and not need a variable.  IIRC, the syntax for this is:


SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
NULL, VM_MAX_KERNEL_ADDRESS, Max kernel address);

subr_param.c is careful to use only basic types for all of its variables
so that standard sysctls apply.

Tunables have even more bugs in this area: at least at the input level
kern_environment.c:
- bogus quads are supported, but bogus uquads aren't
- everything goes through getenv_quad(), which uses strtoq(), which is
  for signed values, so unsigned values are mishandled in various ways
- worst sign bugs are on 64-bit arches.  getenv_ulong() uses getenv_quad(),
  with blind casts and no overflow checking, so 64-bit values are silently
  truncated to QUAD_MAX (63 bits).  Before that, getenv_quad() has overflow
  checking in its strtoq() call, but none in its multiplication, and the
  API is broken (strtoq(3) indicatates errors in errno, but there is no
  errno in the kernel).

The bugs in tunables mean that sysctls that report read-only tunables
can safely use SYSCTL_QUAD().

This is hard to fix cleanly without combinatorial explosion in the number
of types, giving uglyness in the implementation.  It is probably best to
have single SYSCTL_INT() that operates on all integral types (signed
and unsigned) according to its the arg type.  E.g.:

static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
vm_min_kernel_address, 0, Min kernel address);

This should expand to an uncast vm_min_kernel_address, with auxilary
data for the size and sign of that.  sysctl_handle_int() should operate
atomically on all integer sizes according to the size and sign info.
Some SYSCTL_FOO()'s already generate size info or take a size arg, but
sysctl_handle_int() only supports plain int and is abused to support
u_int and is sometimes misused on sysctl data that has a size.

After fixing the style bug:

SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
NULL, VM_MIN_KERNEL_ADDRESS, Min kernel address);

The constant can have any integral type, and a the sysctl must generate
size and sign info for it too.

The API can probably be simplified to reduce the 2 parameters to 1.
Hopefully __builtin_constant_p() can be used to decide which case applies.

Bruce
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242029 - head/sys/kern

2012-11-08 Thread Alfred Perlstein

On 11/8/12 1:22 AM, Garrett Cooper wrote:

On Nov 8, 2012, at 1:13 AM, Alfred Perlstein wrote:


Peter,

I agree.

It's certainly not perfect, however it's not nearly as bogus as what was there 
previously.

I know maxusers is wrong, however what it really means, if you think about it, is 
give me a scaling factor that is relative to physical ram, BUT capped at some value so as to not 
exhaust KVA. Yes, I grok that on certain architectures that mbufs clusters aren't pulled from KVA, but, 
that seems much less important than how broken it is currently

This fix is good enough for the general case, and a far greater improvement 
than what was there previously which would make FreeBSD blow chunks on any sort of 10gigE 
load.

I think what needs to happen here, is that the people requiring perfection 
think about what mess it was prior and if they themselves do not have time to 
make it 100% perfect, allowing someone to step in and move something
a step in the right direction without overly complicating it.

What is there is crap, it's old, crufty and broken, it really is. It needs to 
be fixed, it needs to be given a nice fat band-aid now, and when someone 
interested in perfection comes along, then they can make it even more awesome.

I am not saying that my fix is PERFECT or the be all and end all, however it serves as a 
good step in the right direction on our tier 1 platforms and is easily modifiable (just 
replace VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS with some form of MD 
magic sauce.)  Would you like me to do that?  Replace the hardline calculation with some 
constant that each platform can configure?

I'm thinking this might suffice to make purists a bit more happy:

#if defined(i386) || defined(amd64)
#define MAX_KERNEL_ADDRESS_SPACE (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS)
#else
#define MAX_KERNEL_ADDRESS_SPACE  (1024*1024*1024)

Only 1GB for KVA on 64-bit platforms too...?
Sure, if there's any people paying attention for these platforms they 
can quickly provide the necessary #define for the platform. (To make it 
MD as Peter suggested.)   I guess I could #error until people catch up?  
That seems rude though.


The way this works is that platforms that aren't listed get the old 384 
cap, if they want more, then they can give me the #defines needed for 
better autotuning.


Truth be told this is basically what Peter said to do, however just 
keeping the name maxusers.


Yes maxusers is gross, but a step forward which unfortunately retains it 
needs to happen now.



#endif

Given my algorithm this should result in pretty much the same for other 
platforms than amd64 which will then be able to grow maxusers some.

I'm basically running out of time on this and I'm worried that I'll have to 
back it out indefinitely so that FreeBSD can't do 10gigE out of the box.

I agree with the philosophy being taken. Perfection shouldn't be the enemy of 
the good as long as it gets close enough that things are more useful than they 
are today.

Thanks for championing this Alfred. The less voodoo required for FreeBSD to 
function on commodity hardware, the better!

The less voodoo required to commit simple patches that take us forward 
the better as well.


One shouldn't be tasked with redesigning rewiring an entire house just 
because they want to change one outlet.


-Alfred
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242747 - head/sys/kern

2012-11-08 Thread Alfred Perlstein
Never mind, I see what you did here. :)

Thank you. 

Sent from my iPhone

On Nov 8, 2012, at 12:54 AM, Alfred Perlstein bri...@mu.org wrote:

 Please define a reasonable value for VM_MAX_KERNEL_ADDRESS on sparc64, it's 
 needed for autotuning.
 
 -Alfred
 
 On 11/8/12 12:10 AM, Marius Strobl wrote:
 Author: marius
 Date: Thu Nov  8 08:10:32 2012
 New Revision: 242747
 URL: http://svnweb.freebsd.org/changeset/base/242747
 
 Log:
   Make r242655 build on sparc64. While at it, make 
 vm_{max,min}_kernel_address
   vm_offset_t as they should be.
 
 Modified:
   head/sys/kern/kern_malloc.c
 
 Modified: head/sys/kern/kern_malloc.c
 ==
 --- head/sys/kern/kern_malloc.cThu Nov  8 04:02:36 2012(r242746)
 +++ head/sys/kern/kern_malloc.cThu Nov  8 08:10:32 2012(r242747)
 @@ -186,11 +186,13 @@ struct {
   */
  static uma_zone_t mt_zone;
  -static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
 +static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
  SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
  vm_min_kernel_address, 0, Min kernel address);
  -static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
 +#ifndef __sparc64__
 +static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
 +#endif
  SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
  vm_max_kernel_address, 0, Max kernel address);
  
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242766 - head/bin/sh

2012-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Thu Nov  8 13:33:48 2012
New Revision: 242766
URL: http://svnweb.freebsd.org/changeset/base/242766

Log:
  sh: Fix two issues when an alias is redefined:
  
   * The last character is not displayed.
   * If the alias ends with itself (as a word), an infinite memory-eating loop
 occurs.
  
  If an alias is defined initially, a space is appended to avoid recursion but
  this did not happen when an alias was later modified.
  
  PR:   bin/173418
  Submitted by: Daniel F.
  MFC after:1 week

Modified:
  head/bin/sh/alias.c

Modified: head/bin/sh/alias.c
==
--- head/bin/sh/alias.c Thu Nov  8 13:06:44 2012(r242765)
+++ head/bin/sh/alias.c Thu Nov  8 13:33:48 2012(r242766)
@@ -68,7 +68,18 @@ setalias(const char *name, const char *v
if (equal(name, ap-name)) {
INTOFF;
ckfree(ap-val);
+   /* See HACK below. */
+#ifdef notyet
ap-val = savestr(val);
+#else
+   {
+   size_t len = strlen(val);
+   ap-val = ckmalloc(len + 2);
+   memcpy(ap-val, val, len);
+   ap-val[len] = ' ';
+   ap-val[len+1] = '\0';
+   }
+#endif
INTON;
return;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242767 - in head/tools/regression/bin/sh: builtins parser

2012-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Thu Nov  8 13:36:19 2012
New Revision: 242767
URL: http://svnweb.freebsd.org/changeset/base/242767

Log:
  sh: Add tests for modifying an alias (r242766).
  
  Note: parser/alias10.0 will eat a lot of memory/cpu time when it fails (with
  the old sh).

Added:
  head/tools/regression/bin/sh/builtins/alias3.0   (contents, props changed)
  head/tools/regression/bin/sh/builtins/alias3.0.stdout   (contents, props 
changed)
  head/tools/regression/bin/sh/parser/alias10.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/alias3.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/alias3.0  Thu Nov  8 13:36:19 
2012(r242767)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+set -e
+
+unalias -a
+alias foo=bar
+alias bar=
+alias quux=1 2 3
+alias foo=bar
+alias bar=
+alias quux=1 2 3
+alias
+alias foo

Added: head/tools/regression/bin/sh/builtins/alias3.0.stdout
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/alias3.0.stdout   Thu Nov  8 
13:36:19 2012(r242767)
@@ -0,0 +1,4 @@
+bar=''
+foo=bar
+quux='1 2 3'
+foo=bar

Added: head/tools/regression/bin/sh/parser/alias10.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/alias10.0   Thu Nov  8 13:36:19 
2012(r242767)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+alias echo='echo'
+alias echo='echo'
+[ `eval echo b` = b ]
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242768 - stable/9/lib/libc/sys

2012-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Thu Nov  8 13:40:46 2012
New Revision: 242768
URL: http://svnweb.freebsd.org/changeset/base/242768

Log:
  MFC r242429: fcntl(2): Fix typos in name of constant F_DUP2FD_CLOEXEC.

Modified:
  stable/9/lib/libc/sys/fcntl.2
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Modified: stable/9/lib/libc/sys/fcntl.2
==
--- stable/9/lib/libc/sys/fcntl.2   Thu Nov  8 13:36:19 2012
(r242767)
+++ stable/9/lib/libc/sys/fcntl.2   Thu Nov  8 13:40:46 2012
(r242768)
@@ -94,7 +94,7 @@ It is functionally equivalent to
 .Bd -literal -offset indent
 dup2(fd, arg)
 .Ed
-.It Dv F_DU2PFD_CLOEXEC
+.It Dv F_DUP2FD_CLOEXEC
 Like
 .Dv F_DUP2FD ,
 but the
@@ -104,7 +104,7 @@ flag associated with the new file descri
 The
 .Dv F_DUP2FD
 and
-.Dv F_DUP2DF_CLOEXEC
+.Dv F_DUP2FD_CLOEXEC
 constants are not portable, so they should not be used if
 portability is needed.
 Use
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242770 - stable/8/lib/libc/sys

2012-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Thu Nov  8 13:43:20 2012
New Revision: 242770
URL: http://svnweb.freebsd.org/changeset/base/242770

Log:
  MFC r242429: fcntl(2): Fix typos in name of constant F_DUP2FD_CLOEXEC.

Modified:
  stable/8/lib/libc/sys/fcntl.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/sys/fcntl.2
==
--- stable/8/lib/libc/sys/fcntl.2   Thu Nov  8 13:41:42 2012
(r242769)
+++ stable/8/lib/libc/sys/fcntl.2   Thu Nov  8 13:43:20 2012
(r242770)
@@ -94,7 +94,7 @@ It is functionally equivalent to
 .Bd -literal -offset indent
 dup2(fd, arg)
 .Ed
-.It Dv F_DU2PFD_CLOEXEC
+.It Dv F_DUP2FD_CLOEXEC
 Like
 .Dv F_DUP2FD ,
 but the
@@ -104,7 +104,7 @@ flag associated with the new file descri
 The
 .Dv F_DUP2FD
 and
-.Dv F_DUP2DF_CLOEXEC
+.Dv F_DUP2FD_CLOEXEC
 constants are not portable, so they should not be used if
 portability is needed.
 Use
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242771 - stable/9/lib/libc/stdio

2012-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Thu Nov  8 13:47:32 2012
New Revision: 242771
URL: http://svnweb.freebsd.org/changeset/base/242771

Log:
  MFC r242460: fopen(3): Mention that the x mode option is from C11.

Modified:
  stable/9/lib/libc/stdio/fopen.3
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/stdio/fopen.3
==
--- stable/9/lib/libc/stdio/fopen.3 Thu Nov  8 13:43:20 2012
(r242770)
+++ stable/9/lib/libc/stdio/fopen.3 Thu Nov  8 13:47:32 2012
(r242771)
@@ -267,7 +267,11 @@ and
 .Fn freopen
 functions
 conform to
-.St -isoC .
+.St -isoC ,
+with the exception of the
+.Dq Li x
+mode option which conforms to
+.St -isoC-2011 .
 The
 .Fn fdopen
 function
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242773 - stable/8/lib/libc/stdio

2012-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Thu Nov  8 13:50:33 2012
New Revision: 242773
URL: http://svnweb.freebsd.org/changeset/base/242773

Log:
  MFC r242460: fopen(3): Mention that the x mode option is from C11.

Modified:
  stable/8/lib/libc/stdio/fopen.3
Directory Properties:
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/stdio/fopen.3
==
--- stable/8/lib/libc/stdio/fopen.3 Thu Nov  8 13:49:20 2012
(r242772)
+++ stable/8/lib/libc/stdio/fopen.3 Thu Nov  8 13:50:33 2012
(r242773)
@@ -267,7 +267,11 @@ and
 .Fn freopen
 functions
 conform to
-.St -isoC .
+.St -isoC ,
+with the exception of the
+.Dq Li x
+mode option which conforms to
+.St -isoC-2011 .
 The
 .Fn fdopen
 function
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242747 - head/sys/kern

2012-11-08 Thread Marius Strobl
On Thu, Nov 08, 2012 at 09:41:29PM +1100, Bruce Evans wrote:
 On Thu, 8 Nov 2012, Marius Strobl wrote:
 
 Log:
  Make r242655 build on sparc64. While at it, make 
  vm_{max,min}_kernel_address
  vm_offset_t as they should be.
 
 Er, they shouldn't be vm_offset_t.
 
 Modified: head/sys/kern/kern_malloc.c
 ==
 --- head/sys/kern/kern_malloc.c  Thu Nov  8 04:02:36 2012 (r242746)
 +++ head/sys/kern/kern_malloc.c  Thu Nov  8 08:10:32 2012 (r242747)
 @@ -186,11 +186,13 @@ struct {
  */
 static uma_zone_t mt_zone;
 
 -static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
 +static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
 SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
 vm_min_kernel_address, 0, Min kernel address);
 
 SYSCTL_ULONG takes a u_long, not a vm_offset_t.  A cast in
 SYSCTL_ULONG() prevents possible detection of the type mismatch from
 this.
 
 This is most broken on i386's with correctly-sized longs (or almost
 any arch with correctly-sized longs).  There, vm_offset_t is 1
 register wide and longs are 2 registers wide.

Eh, FreeBSD/i386 is ILP32, so longs are 32-bit there, as is its
__vm_offset_t.

 
 The bugs could be moved using SYSCTL_QUAD().  Correctly-sized quads
 would be 4 registers wide, except quad has come to mean just a bad
 way of spelling long long or int64_t.
 
 -static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
 +#ifndef __sparc64__
 +static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
 +#endif
 SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
 vm_max_kernel_address, 0, Max kernel address);
 
 Since the value is a compile-time constant, u_long has a chance of
 holding its value even if u_long != vm_offset_t, and the old code is
 closer to being correct than first appeared, and the correct fix is
 relatively easy -- just use a uintmax_t vatiable and SYSCTL_UINTMAX()
 (*).  Unfortunately SYSCT_UINTMAX() doesn't exist, and the bogus
 SYSCTL_UQUAD() does exist.

Right, SYSCTL_UINTMAX() unfortunately doesn't exist. SYSCTL_UQUAD()
seemed inappropriate as it is 64-bit and we want 32-bit for ILP32
for an exact match. Using uintmax_t with SYSCTL_UQUAD() also just
happens to be of the same width.
From the available combinations, using vm_offset_t with SYSCTL_ULONG()
just seemed to suck the least.

 
 (*) Except a temporary variable is just a style bug in the above and
 for this.  SYSCTL_UNLONG(), like all integer SYSCTL()'s, has the feature
 of supporting either a variable or a constant arg.  The above should 
 use a constant arg and not need a variable.  IIRC, the syntax for this is:
 
 SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
 NULL, VM_MAX_KERNEL_ADDRESS, Max kernel address);

Actually, for sparc64 VM_MAX_KERNEL_ADDRESS isn't constant (and can't
be).

 
 subr_param.c is careful to use only basic types for all of its variables
 so that standard sysctls apply.
 
 Tunables have even more bugs in this area: at least at the input level
 kern_environment.c:
 - bogus quads are supported, but bogus uquads aren't
 - everything goes through getenv_quad(), which uses strtoq(), which is
   for signed values, so unsigned values are mishandled in various ways
 - worst sign bugs are on 64-bit arches.  getenv_ulong() uses getenv_quad(),
   with blind casts and no overflow checking, so 64-bit values are silently
   truncated to QUAD_MAX (63 bits).  Before that, getenv_quad() has overflow
   checking in its strtoq() call, but none in its multiplication, and the
   API is broken (strtoq(3) indicatates errors in errno, but there is no
   errno in the kernel).
 
 The bugs in tunables mean that sysctls that report read-only tunables
 can safely use SYSCTL_QUAD().
 
 This is hard to fix cleanly without combinatorial explosion in the number
 of types, giving uglyness in the implementation.  It is probably best to
 have single SYSCTL_INT() that operates on all integral types (signed
 and unsigned) according to its the arg type.  E.g.:
 
 static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
 SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
   vm_min_kernel_address, 0, Min kernel address);
 
 This should expand to an uncast vm_min_kernel_address, with auxilary
 data for the size and sign of that.  sysctl_handle_int() should operate
 atomically on all integer sizes according to the size and sign info.
 Some SYSCTL_FOO()'s already generate size info or take a size arg, but
 sysctl_handle_int() only supports plain int and is abused to support
 u_int and is sometimes misused on sysctl data that has a size.
 
 After fixing the style bug:
 
 SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
   NULL, VM_MIN_KERNEL_ADDRESS, Min kernel address);
 
 The constant can have any integral type, and a the sysctl must generate
 size and sign info for it too.
 
 The API can probably be simplified to reduce 

Re: svn commit: r242725 - head/bin/ls

2012-11-08 Thread Jaakko Heinonen
On 2012-11-08, Greg Lehey wrote:
 New Revision: 242725

 - return (strcoll(a-fts_name, b-fts_name));
 +if (f_samesort)
 + return (strcoll(b-fts_name, a-fts_name));
 +else
 + return (strcoll(a-fts_name, b-fts_name));

Please use tabs instead of spaces in indentations. Similarly in r242722.

This patch should fix some whitespace problems:

%%%
Index: bin/ls/ls.c
===
--- bin/ls/ls.c (revision 242746)
+++ bin/ls/ls.c (working copy)
@@ -185,7 +185,7 @@ main(int argc, char *argv[])
fts_options = FTS_PHYSICAL;
if (getenv(LS_SAMESORT))
f_samesort = 1;
-   while ((ch = getopt(argc, argv,
+   while ((ch = getopt(argc, argv,
1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,)) != -1) {
switch (ch) {
/*
@@ -241,7 +241,7 @@ main(int argc, char *argv[])
f_timesort = 1;
f_sizesort = 0;
break;
-/* Other flags.  Please keep alphabetic. */
+   /* Other flags.  Please keep alphabetic. */
case ',':
f_thousands = 1;
break;
@@ -250,10 +250,10 @@ main(int argc, char *argv[])
f_octal = 1;
f_octal_escape = 0;
break;
-case 'D':
-f_timeformat = optarg;
-break;
-case 'F':
+   case 'D':
+   f_timeformat = optarg;
+   break;
+   case 'F':
f_type = 1;
f_slash = 0;
break;
@@ -861,7 +861,7 @@ label_out:
d.s_size = sizelen;
d.s_user = maxuser;
}
-if (f_thousands)/* make space for commas */
+   if (f_thousands)/* make space for commas */
d.s_size += (d.s_size - 1) / 3;
printfcn(d);
output = 1;
Index: bin/ls/cmp.c
===
--- bin/ls/cmp.c(revision 242746)
+++ bin/ls/cmp.c(working copy)
@@ -78,9 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b)
if (b-fts_statp-st_mtim.tv_nsec 
a-fts_statp-st_mtim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
@@ -107,9 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b)
if (b-fts_statp-st_atim.tv_nsec 
a-fts_statp-st_atim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
@@ -136,9 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT *
if (b-fts_statp-st_birthtim.tv_nsec 
a-fts_statp-st_birthtim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
@@ -165,9 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b
if (b-fts_statp-st_ctim.tv_nsec 
a-fts_statp-st_ctim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
%%%

-- 
Jaakko
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242715 - head/sys/conf

2012-11-08 Thread Roman Divacky
 - clang fails to optimize division by (integer) 2 into multiplication
by (floating point with the correct type) 0.5 in the case of long
doubles on one supported arch (i386 IIRC).  Both compilers optimize
all other cases, including floats and doubles on all arches.  clang
with -ffast-math optimizes the broken case, but -ffast-math is
generally unsafe and not even fast; it shouldn't be necessary for
this, since this is one of the few floating point strength reductions
that is always safe.  This detail is not documented for either clang
or gcc.  clang doesn't even document the existence of -ffast-math in
its man page.
 
Several uncommitted libm functions use the spelling of (integer) 2
to avoid ifdefs and/or different code to get the type right for 0.5.
The result is that the case of long doubles on i386 is pessimized.
clang has many other efficiency and ABI problems on i386, including
the next one.

This just got fixed upstream

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121105/155388.html

We will get it with the next import of llvm/clang.

Thank you! Roman
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242727 - head/sys/fs/fuse

2012-11-08 Thread Attilio Rao
On 11/8/12, Attilio Rao atti...@freebsd.org wrote:
 Author: attilio
 Date: Thu Nov  8 00:32:49 2012
 New Revision: 242727
 URL: http://svnweb.freebsd.org/changeset/base/242727

 Log:
   - Current caching mode is completely broken because it simply relies
 on timing of the operations and not real lookup, bringing too many
 false positives. Remove the whole mechanism. If it needs to be
 implemented, next time it should really be done in the proper way.
   - Fix VOP_GETATTR() in order to cope with userland bugs that would
 change the type of file and not panic. Instead it gets the entry as
 if it is not existing.

   Reported and tested by: flo

Urgh, forgot to report:
Reported and helped to find by: Alex a...@lightsoft.ru

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242774 - stable/9/sys/dev/usb/controller

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Nov  8 16:04:32 2012
New Revision: 242774
URL: http://svnweb.freebsd.org/changeset/base/242774

Log:
  MFC r238551 and r239617:
  Add support for Intel Panther/Lynx Point XHCI port routing.

Modified:
  stable/9/sys/dev/usb/controller/xhci.c
  stable/9/sys/dev/usb/controller/xhci.h
  stable/9/sys/dev/usb/controller/xhci_pci.c
  stable/9/sys/dev/usb/controller/xhcireg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/controller/xhci.c
==
--- stable/9/sys/dev/usb/controller/xhci.c  Thu Nov  8 13:50:33 2012
(r242773)
+++ stable/9/sys/dev/usb/controller/xhci.c  Thu Nov  8 16:04:32 2012
(r242774)
@@ -84,14 +84,17 @@ __FBSDID($FreeBSD$);
 ((uint8_t *)(((struct xhci_softc *)0)-sc_bus
 
 #ifdef USB_DEBUG
-static int xhcidebug = 0;
+static int xhcidebug;
+static int xhciroute;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, USB XHCI);
 SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW,
 xhcidebug, 0, Debug level);
+SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW,
+xhciroute, 0, Routing bitmap for switching EHCI ports to XHCI 
controller);
 
 TUNABLE_INT(hw.usb.xhci.debug, xhcidebug);
-
+TUNABLE_INT(hw.usb.xhci.xhci_port_route, xhciroute);
 #endif
 
 #defineXHCI_INTR_ENDPT 1
@@ -177,6 +180,16 @@ xhci_dump_device(struct xhci_softc *sc, 
 }
 #endif
 
+uint32_t
+xhci_get_port_route(void)
+{
+#ifdef USB_DEBUG
+   return (0xU ^ ((uint32_t)xhciroute));
+#else
+   return (0xU);
+#endif
+}
+
 static void
 xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
 {

Modified: stable/9/sys/dev/usb/controller/xhci.h
==
--- stable/9/sys/dev/usb/controller/xhci.h  Thu Nov  8 13:50:33 2012
(r242773)
+++ stable/9/sys/dev/usb/controller/xhci.h  Thu Nov  8 16:04:32 2012
(r242774)
@@ -490,6 +490,7 @@ struct xhci_softc {
 
 /* prototypes */
 
+uint32_t   xhci_get_port_route(void);
 usb_error_t xhci_halt_controller(struct xhci_softc *);
 usb_error_t xhci_init(struct xhci_softc *, device_t);
 usb_error_t xhci_start_controller(struct xhci_softc *);

Modified: stable/9/sys/dev/usb/controller/xhci_pci.c
==
--- stable/9/sys/dev/usb/controller/xhci_pci.c  Thu Nov  8 13:50:33 2012
(r242773)
+++ stable/9/sys/dev/usb/controller/xhci_pci.c  Thu Nov  8 16:04:32 2012
(r242774)
@@ -101,6 +101,8 @@ xhci_pci_match(device_t self)
 
case 0x1e318086:
return (Intel Panther Point USB 3.0 controller);
+   case 0x8c318086:
+   return (Intel Lynx Point USB 3.0 controller);
 
default:
break;
@@ -245,6 +247,7 @@ static int
 xhci_pci_take_controller(device_t self)
 {
struct xhci_softc *sc = device_get_softc(self);
+   uint32_t device_id = pci_get_devid(self);
uint32_t cparams;
uint32_t eecp;
uint32_t eec;
@@ -285,5 +288,13 @@ xhci_pci_take_controller(device_t self)
usb_pause_mtx(NULL, hz / 100);  /* wait 10ms */
}
}
+
+   /* On Intel chipsets reroute ports from EHCI to XHCI controller. */
+   if (device_id == 0x1e318086 /* Panther Point */ ||
+   device_id == 0x8c318086 /* Lynx Point */) {
+   uint32_t temp = xhci_get_port_route();
+   pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4);
+   pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4);
+   }
return (0);
 }

Modified: stable/9/sys/dev/usb/controller/xhcireg.h
==
--- stable/9/sys/dev/usb/controller/xhcireg.h   Thu Nov  8 13:50:33 2012
(r242773)
+++ stable/9/sys/dev/usb/controller/xhcireg.h   Thu Nov  8 16:04:32 2012
(r242774)
@@ -34,6 +34,9 @@
 #definePCI_USB_REV_3_0 0x30/* USB 3.0 */
 #definePCI_XHCI_FLADJ  0x61/* RW frame length adjust */
 
+#definePCI_XHCI_INTEL_XUSB2PR  0xD0/* Intel USB2 Port Routing */
+#definePCI_XHCI_INTEL_USB3_PSSEN 0xD8  /* Intel USB3 Port SuperSpeed 
Enable */
+
 /* XHCI capability registers */
 #defineXHCI_CAPLENGTH  0x00/* RO capability */
 #defineXHCI_RESERVED   0x01/* Reserved */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242775 - in stable/9/sys/dev/usb: . controller input serial storage wlan

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Nov  8 16:13:51 2012
New Revision: 242775
URL: http://svnweb.freebsd.org/changeset/base/242775

Log:
  MFC r240750, r241987 and r242126:
  Add missing CTLFLAG_TUN flag to tunable sysctls in the USB stack.
  Adjust timing parameters of FULL/LOW/HIGH speed USB enumeration
  and make these timing parameters tunable. This patch will fix
  enumeration with some USB devices.
  Fix a typo.

Modified:
  stable/9/sys/dev/usb/controller/ehci.c
  stable/9/sys/dev/usb/controller/ohci.c
  stable/9/sys/dev/usb/controller/uhci.c
  stable/9/sys/dev/usb/controller/usb_controller.c
  stable/9/sys/dev/usb/controller/xhci.c
  stable/9/sys/dev/usb/input/ukbd.c
  stable/9/sys/dev/usb/serial/usb_serial.c
  stable/9/sys/dev/usb/storage/umass.c
  stable/9/sys/dev/usb/usb.h
  stable/9/sys/dev/usb/usb_debug.c
  stable/9/sys/dev/usb/usb_debug.h
  stable/9/sys/dev/usb/usb_dev.c
  stable/9/sys/dev/usb/usb_device.c
  stable/9/sys/dev/usb/usb_generic.c
  stable/9/sys/dev/usb/usb_hub.c
  stable/9/sys/dev/usb/usb_process.c
  stable/9/sys/dev/usb/usb_request.c
  stable/9/sys/dev/usb/wlan/if_uath.c
  stable/9/sys/dev/usb/wlan/if_upgt.c
  stable/9/sys/dev/usb/wlan/if_urtw.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/controller/ehci.c
==
--- stable/9/sys/dev/usb/controller/ehci.c  Thu Nov  8 16:04:32 2012
(r242774)
+++ stable/9/sys/dev/usb/controller/ehci.c  Thu Nov  8 16:13:51 2012
(r242775)
@@ -95,20 +95,20 @@ static int ehciiaadbug = 0;
 static int ehcilostintrbug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, USB ehci);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
 ehcidebug, 0, Debug level);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW,
-ehcinohighspeed, 0, Disable High Speed USB);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW,
-ehciiaadbug, 0, Enable doorbell bug workaround);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW,
-ehcilostintrbug, 0, Enable lost interrupt bug workaround);
-
 TUNABLE_INT(hw.usb.ehci.debug, ehcidebug);
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW | CTLFLAG_TUN,
+ehcinohighspeed, 0, Disable High Speed USB);
 TUNABLE_INT(hw.usb.ehci.no_hs, ehcinohighspeed);
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW | CTLFLAG_TUN,
+ehciiaadbug, 0, Enable doorbell bug workaround);
 TUNABLE_INT(hw.usb.ehci.iaadbug, ehciiaadbug);
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW | CTLFLAG_TUN,
+ehcilostintrbug, 0, Enable lost interrupt bug workaround);
 TUNABLE_INT(hw.usb.ehci.lostintrbug, ehcilostintrbug);
 
+
 static void ehci_dump_regs(ehci_softc_t *sc);
 static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh);
 
@@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *ude
 
/* Wait for reset to complete. */
usb_pause_mtx(sc-sc_bus.bus_mtx,
-   USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY));
+   USB_MS_TO_TICKS(usb_port_root_reset_delay));
 
/* Terminate reset sequence. */
if (!(sc-sc_flags  EHCI_SCFLG_NORESTERM))

Modified: stable/9/sys/dev/usb/controller/ohci.c
==
--- stable/9/sys/dev/usb/controller/ohci.c  Thu Nov  8 16:04:32 2012
(r242774)
+++ stable/9/sys/dev/usb/controller/ohci.c  Thu Nov  8 16:13:51 2012
(r242775)
@@ -81,9 +81,8 @@ __FBSDID($FreeBSD$);
 static int ohcidebug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, USB ohci);
-SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
 ohcidebug, 0, ohci debug level);
-
 TUNABLE_INT(hw.usb.ohci.debug, ohcidebug);
 
 static void ohci_dumpregs(ohci_softc_t *);
@@ -2344,7 +2343,7 @@ ohci_roothub_exec(struct usb_device *ude
for (v = 0;; v++) {
if (v  12) {
usb_pause_mtx(sc-sc_bus.bus_mtx,
-   
USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY));
+   
USB_MS_TO_TICKS(usb_port_root_reset_delay));
 
if ((OREAD4(sc, port)  UPS_RESET) == 
0) {
break;

Modified: stable/9/sys/dev/usb/controller/uhci.c
==
--- stable/9/sys/dev/usb/controller/uhci.c  Thu Nov  8 16:04:32 2012
(r242774)
+++ stable/9/sys/dev/usb/controller/uhci.c  Thu Nov  8 16:13:51 2012
(r242775)
@@ -86,12 +86,11 @@ static int uhcidebug = 0;
 static int 

svn commit: r242776 - stable/9/sys/dev/usb/controller

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Nov  8 16:17:52 2012
New Revision: 242776
URL: http://svnweb.freebsd.org/changeset/base/242776

Log:
  MFC r242523:
  Allow using the embedded EHCI host controller in Freescale SoCs
  by adding the missing bits. See ehci_fsl.c for their use.

Modified:
  stable/9/sys/dev/usb/controller/ehci.c
  stable/9/sys/dev/usb/controller/ehci.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/controller/ehci.c
==
--- stable/9/sys/dev/usb/controller/ehci.c  Thu Nov  8 16:13:51 2012
(r242775)
+++ stable/9/sys/dev/usb/controller/ehci.c  Thu Nov  8 16:17:52 2012
(r242776)
@@ -332,14 +332,18 @@ ehci_init(ehci_softc_t *sc)
sc-sc_noport = EHCI_HCS_N_PORTS(sparams);
sc-sc_bus.usbrev = USB_REV_2_0;
 
-   /* Reset the controller */
-   DPRINTF(%s: resetting\n, device_get_nameunit(sc-sc_bus.bdev));
-
-   err = ehci_hcreset(sc);
-   if (err) {
-   device_printf(sc-sc_bus.bdev, reset timeout\n);
-   return (err);
+   if (!(sc-sc_flags  EHCI_SCFLG_DONTRESET)) {
+   /* Reset the controller */
+   DPRINTF(%s: resetting\n,
+   device_get_nameunit(sc-sc_bus.bdev));
+
+   err = ehci_hcreset(sc);
+   if (err) {
+   device_printf(sc-sc_bus.bdev, reset timeout\n);
+   return (err);
+   }
}
+
/*
 * use current frame-list-size selection 0: 1024*4 bytes 1:  512*4
 * bytes 2:  256*4 bytes 3:  unknown

Modified: stable/9/sys/dev/usb/controller/ehci.h
==
--- stable/9/sys/dev/usb/controller/ehci.h  Thu Nov  8 16:13:51 2012
(r242775)
+++ stable/9/sys/dev/usb/controller/ehci.h  Thu Nov  8 16:17:52 2012
(r242776)
@@ -345,6 +345,8 @@ typedef struct ehci_softc {
 #defineEHCI_SCFLG_TT   0x0020  /* transaction translator 
present */
 #defineEHCI_SCFLG_LOSTINTRBUG  0x0040  /* workaround for VIA / ATI 
chipsets */
 #defineEHCI_SCFLG_IAADBUG  0x0080  /* workaround for nVidia 
chipsets */
+#defineEHCI_SCFLG_DONTRESET0x0100  /* don't reset ctrl. in 
ehci_init() */
+#defineEHCI_SCFLG_DONEINIT 0x1000  /* ehci_init() has been called. 
*/
 
uint8_t sc_offs;/* offset to operational registers */
uint8_t sc_doorbell_disable;/* set on doorbell failure */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242777 - head/sys/dev/usb/net

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Nov  8 16:31:13 2012
New Revision: 242777
URL: http://svnweb.freebsd.org/changeset/base/242777

Log:
  Make the USB ethernet methods constant again in if_udav.c,
  so that both adapter variants can be attached at the same
  time.
  
  MFC after:0 days

Modified:
  head/sys/dev/usb/net/if_udav.c

Modified: head/sys/dev/usb/net/if_udav.c
==
--- head/sys/dev/usb/net/if_udav.c  Thu Nov  8 16:17:52 2012
(r242776)
+++ head/sys/dev/usb/net/if_udav.c  Thu Nov  8 16:31:13 2012
(r242777)
@@ -169,7 +169,7 @@ MODULE_DEPEND(udav, ether, 1, 1, 1);
 MODULE_DEPEND(udav, miibus, 1, 1, 1);
 MODULE_VERSION(udav, 1);
 
-static struct usb_ether_methods udav_ue_methods = {
+static const struct usb_ether_methods udav_ue_methods = {
.ue_attach_post = udav_attach_post,
.ue_start = udav_start,
.ue_init = udav_init,
@@ -181,6 +181,15 @@ static struct usb_ether_methods udav_ue_
.ue_mii_sts = udav_ifmedia_status,
 };
 
+static const struct usb_ether_methods udav_ue_methods_nophy = {
+   .ue_attach_post = udav_attach_post,
+   .ue_start = udav_start,
+   .ue_init = udav_init,
+   .ue_stop = udav_stop,
+   .ue_setmulti = udav_setmulti,
+   .ue_setpromisc = udav_setpromisc,
+};
+
 #ifdef USB_DEBUG
 static int udav_debug = 0;
 
@@ -264,17 +273,16 @@ udav_attach(device_t dev)
 * The JP1082 has an unusable PHY and provides no link information.
 */
if (sc-sc_flags  UDAV_FLAG_NO_PHY) {
-   udav_ue_methods.ue_tick = NULL;
-   udav_ue_methods.ue_mii_upd = NULL;
-   udav_ue_methods.ue_mii_sts = NULL;
+   ue-ue_methods = udav_ue_methods_nophy;
sc-sc_flags |= UDAV_FLAG_LINK;
+   } else {
+   ue-ue_methods = udav_ue_methods;
}
 
ue-ue_sc = sc;
ue-ue_dev = dev;
ue-ue_udev = uaa-device;
ue-ue_mtx = sc-sc_mtx;
-   ue-ue_methods = udav_ue_methods;
 
error = uether_ifattach(ue);
if (error) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242747 - head/sys/kern

2012-11-08 Thread Bruce Evans

On Thu, 8 Nov 2012, Marius Strobl wrote:


On Thu, Nov 08, 2012 at 09:41:29PM +1100, Bruce Evans wrote:

On Thu, 8 Nov 2012, Marius Strobl wrote:


Log:
Make r242655 build on sparc64. While at it, make
vm_{max,min}_kernel_address
vm_offset_t as they should be.


Er, they shouldn't be vm_offset_t.


Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Thu Nov  8 04:02:36 2012 (r242746)
+++ head/sys/kern/kern_malloc.c Thu Nov  8 08:10:32 2012 (r242747)
@@ -186,11 +186,13 @@ struct {
*/
static uma_zone_t mt_zone;

-static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
+static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS;
SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
   vm_min_kernel_address, 0, Min kernel address);


SYSCTL_ULONG takes a u_long, not a vm_offset_t.  A cast in
SYSCTL_ULONG() prevents possible detection of the type mismatch from
this.

This is most broken on i386's with correctly-sized longs (or almost
any arch with correctly-sized longs).  There, vm_offset_t is 1
register wide and longs are 2 registers wide.


Eh, FreeBSD/i386 is ILP32, so longs are 32-bit there, as is its
__vm_offset_t.


Yes, it has incorrectly sized longs.  It used to have a _LARGE_LONG
option to give 64-bit longs, and I used this to find and fix some
type errors before there were any 64-bit arches (most things compiled
and parts of userland ran).


The bugs could be moved using SYSCTL_QUAD().  Correctly-sized quads
would be 4 registers wide, except quad has come to mean just a bad
way of spelling long long or int64_t.


-static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#ifndef __sparc64__
+static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS;
+#endif
SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
   vm_max_kernel_address, 0, Max kernel address);


Since the value is a compile-time constant, u_long has a chance of
holding its value even if u_long != vm_offset_t, and the old code is
closer to being correct than first appeared, and the correct fix is
relatively easy -- just use a uintmax_t vatiable and SYSCTL_UINTMAX()
(*).  Unfortunately SYSCT_UINTMAX() doesn't exist, and the bogus
SYSCTL_UQUAD() does exist.


Right, SYSCTL_UINTMAX() unfortunately doesn't exist. SYSCTL_UQUAD()
seemed inappropriate as it is 64-bit and we want 32-bit for ILP32
for an exact match. Using uintmax_t with SYSCTL_UQUAD() also just
happens to be of the same width.
From the available combinations, using vm_offset_t with SYSCTL_ULONG()
just seemed to suck the least.


This is backwards, since it u_long that the API supports, so to use the
API it must be assumed that vm_offset_t can be punned to a u_long, not
vice versa although the difference is only logical.

On sparc64, as on most or all 64-bit arches, vm_offset_t is identical to
u_long, so this doesn't even involve type puns.  On i386's with
incorrectly-sized longs (ILP32), there is a type pun from vm_offset_t =
u_int to u_long.  On i386's with correctly-sized longs (I32L64P32),
there is a type mismatch.  In this case, making the variable u_long to
match the API works correctly (when the type error is not detected),
since the top 32 bits are just always zero because the sysctl is r/o
so no one can can change them from their initial zero values.  The
reverse dosen't work, since it reads 32 bits beyond the end of the
variable, giving garbage results.  The overrun would be a more harmful
for a r/w sysctl.

MD code mostly hard-codes assumptions that vm_offset_t is u_int or u_long
for printing it -- it doesn't laboriously convert vm_offset_t to uintmax_t
as is strictly necessary for printing all MI typedefs.  This corresponds
to punning vm_offset_t to u_long here, except the assumptions are much
larger in MI code.


(*) Except a temporary variable is just a style bug in the above and
for this.  SYSCTL_UNLONG(), like all integer SYSCTL()'s, has the feature
of supporting either a variable or a constant arg.  The above should
use a constant arg and not need a variable.  IIRC, the syntax for this is:

SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD,
NULL, VM_MAX_KERNEL_ADDRESS, Max kernel address);


Actually, for sparc64 VM_MAX_KERNEL_ADDRESS isn't constant (and can't
be).


I didn't notice that when I replied before.  The declaration would have
to be ifdefed, as you did but with the correct type for the MI variable.
The MD variable can't have the correct type for this since it needs to
remain vm_offset_t to match other APIs.  Also, the ifdefs are simpler
if a variable (with the same name) is used for all cases.

Bruce
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242778 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Thu Nov  8 17:32:55 2012
New Revision: 242778
URL: http://svnweb.freebsd.org/changeset/base/242778

Log:
  Convert this to a debug printf; it's working fine now.

Modified:
  head/sys/dev/ath/if_ath_rx_edma.c

Modified: head/sys/dev/ath/if_ath_rx_edma.c
==
--- head/sys/dev/ath/if_ath_rx_edma.c   Thu Nov  8 16:31:13 2012
(r242777)
+++ head/sys/dev/ath/if_ath_rx_edma.c   Thu Nov  8 17:32:55 2012
(r242778)
@@ -282,7 +282,7 @@ static void
 ath_edma_recv_flush(struct ath_softc *sc)
 {
 
-   device_printf(sc-sc_dev, %s: called\n, __func__);
+   DPRINTF(sc, ATH_DEBUG_RECV, %s: called\n, __func__);
 
ATH_PCU_LOCK(sc);
sc-sc_rxproc_cnt++;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242779 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Thu Nov  8 17:43:58 2012
New Revision: 242779
URL: http://svnweb.freebsd.org/changeset/base/242779

Log:
  Implement the ATH_RESET_NOLOSS path for TX stop and start; this is needed
  for 802.11n TX device restarting.
  
  Remove the debug printf()s; they're no longer needed here.

Modified:
  head/sys/dev/ath/if_ath_tx_edma.c

Modified: head/sys/dev/ath/if_ath_tx_edma.c
==
--- head/sys/dev/ath/if_ath_tx_edma.c   Thu Nov  8 17:32:55 2012
(r242778)
+++ head/sys/dev/ath/if_ath_tx_edma.c   Thu Nov  8 17:43:58 2012
(r242779)
@@ -130,6 +130,8 @@ __FBSDID($FreeBSD$);
 
 MALLOC_DECLARE(M_ATHDEV);
 
+static void ath_edma_tx_processq(struct ath_softc *sc, int dosched);
+
 static void
 ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq)
 {
@@ -170,7 +172,7 @@ static void
 ath_edma_dma_restart(struct ath_softc *sc, struct ath_txq *txq)
 {
 
-   device_printf(sc-sc_dev, %s: called: txq=%p, qnum=%d\n,
+   DPRINTF(sc, ATH_DEBUG_RESET, %s: called: txq=%p, qnum=%d\n,
__func__,
txq,
txq-axq_qnum);
@@ -393,7 +395,7 @@ ath_edma_tx_drain(struct ath_softc *sc, 
struct ifnet *ifp = sc-sc_ifp;
int i;
 
-   device_printf(sc-sc_dev, %s: called\n, __func__);
+   DPRINTF(sc, ATH_DEBUG_RESET, %s: called\n, __func__);
 
(void) ath_stoptxdma(sc);
 
@@ -403,17 +405,19 @@ ath_edma_tx_drain(struct ath_softc *sc, 
 *
 * Otherwise, just toss everything in each TX queue.
 */
+if (reset_type == ATH_RESET_NOLOSS) {
+   ath_edma_tx_processq(sc, 0);
+} else {
+for (i = 0; i  HAL_NUM_TX_QUEUES; i++) {
+   if (ATH_TXQ_SETUP(sc, i))
+   ath_tx_draintxq(sc, sc-sc_txq[i]);
+}
+}
 
/* XXX dump out the TX completion FIFO contents */
 
/* XXX dump out the frames */
 
-   /* XXX for now, just drain */
-   for (i = 0; i  HAL_NUM_TX_QUEUES; i++) {
-   if (ATH_TXQ_SETUP(sc, i))
-   ath_tx_draintxq(sc, sc-sc_txq[i]);
-   }
-
IF_LOCK(ifp-if_snd);
ifp-if_drv_flags = ~IFF_DRV_OACTIVE;
IF_UNLOCK(ifp-if_snd);
@@ -421,12 +425,25 @@ ath_edma_tx_drain(struct ath_softc *sc, 
 }
 
 /*
- * Process the TX status queue.
+ * TX completion tasklet.
  */
+
 static void
 ath_edma_tx_proc(void *arg, int npending)
 {
struct ath_softc *sc = (struct ath_softc *) arg;
+
+   DPRINTF(sc, ATH_DEBUG_TX_PROC, %s: called, npending=%d\n,
+   __func__, npending);
+   ath_edma_tx_processq(sc, 1);
+}
+
+/*
+ * Process the TX status queue.
+ */
+static void
+ath_edma_tx_processq(struct ath_softc *sc, int dosched)
+{
struct ath_hal *ah = sc-sc_ah;
HAL_STATUS status;
struct ath_tx_status ts;
@@ -441,17 +458,14 @@ ath_edma_tx_proc(void *arg, int npending
uint32_t txstatus[32];
 #endif
 
-   DPRINTF(sc, ATH_DEBUG_TX_PROC, %s: called, npending=%d\n,
-   __func__, npending);
-
for (idx = 0; ; idx++) {
bzero(ts, sizeof(ts));
 
ATH_TXSTATUS_LOCK(sc);
-   status = ath_hal_txprocdesc(ah, NULL, (void *) ts);
 #ifdef ATH_DEBUG
ath_hal_gettxrawtxdesc(ah, txstatus);
 #endif
+   status = ath_hal_txprocdesc(ah, NULL, (void *) ts);
ATH_TXSTATUS_UNLOCK(sc);
 
 #ifdef ATH_DEBUG
@@ -594,7 +608,7 @@ ath_edma_tx_proc(void *arg, int npending
 * working.
 */
ATH_TXQ_LOCK(txq);
-   if (txq-axq_fifo_depth == 0) {
+   if (dosched  txq-axq_fifo_depth == 0) {
ath_edma_tx_fifo_fill(sc, txq);
}
ATH_TXQ_UNLOCK(txq);
@@ -614,7 +628,8 @@ ath_edma_tx_proc(void *arg, int npending
 * but there's no easy way right now to only populate
 * the txq task for _one_ TXQ.  This should be fixed.
 */
-   taskqueue_enqueue(sc-sc_tq, sc-sc_txqtask);
+   if (dosched)
+   taskqueue_enqueue(sc-sc_tq, sc-sc_txqtask);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242780 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Thu Nov  8 17:46:27 2012
New Revision: 242780
URL: http://svnweb.freebsd.org/changeset/base/242780

Log:
  Oops, fix bogus spacing.

Modified:
  head/sys/dev/ath/if_ath_tx_edma.c

Modified: head/sys/dev/ath/if_ath_tx_edma.c
==
--- head/sys/dev/ath/if_ath_tx_edma.c   Thu Nov  8 17:43:58 2012
(r242779)
+++ head/sys/dev/ath/if_ath_tx_edma.c   Thu Nov  8 17:46:27 2012
(r242780)
@@ -405,14 +405,14 @@ ath_edma_tx_drain(struct ath_softc *sc, 
 *
 * Otherwise, just toss everything in each TX queue.
 */
-if (reset_type == ATH_RESET_NOLOSS) {
-   ath_edma_tx_processq(sc, 0);
-} else {
-for (i = 0; i  HAL_NUM_TX_QUEUES; i++) {
-   if (ATH_TXQ_SETUP(sc, i))
-   ath_tx_draintxq(sc, sc-sc_txq[i]);
-}
-}
+   if (reset_type == ATH_RESET_NOLOSS) {
+   ath_edma_tx_processq(sc, 0);
+   } else {
+   for (i = 0; i  HAL_NUM_TX_QUEUES; i++) {
+   if (ATH_TXQ_SETUP(sc, i))
+   ath_tx_draintxq(sc, sc-sc_txq[i]);
+   }
+   }
 
/* XXX dump out the TX completion FIFO contents */
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242781 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Thu Nov  8 18:07:29 2012
New Revision: 242781
URL: http://svnweb.freebsd.org/changeset/base/242781

Log:
  Add my initial cut at driver-layer ALQ support.
  
  I'm using this to debug EDMA TX and RX descriptors and it's really helpful
  to have a non-printf() way to decode frames.
  
  I won't link this into the build until I've tidied it up a little more.
  
  This will eventually be behind ATH_DEBUG_ALQ.

Added:
  head/sys/dev/ath/if_ath_alq.c   (contents, props changed)
  head/sys/dev/ath/if_ath_alq.h   (contents, props changed)

Added: head/sys/dev/ath/if_ath_alq.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ath/if_ath_alq.c   Thu Nov  8 18:07:29 2012
(r242781)
@@ -0,0 +1,172 @@
+/*-
+ * Copyright (c) 2012 Adrian Chadd
+ * 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,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *similar to the NO WARRANTY disclaimer below (Disclaimer) and any
+ *redistribution must be conditioned upon including a substantially
+ *similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * $FreeBSD$
+ */
+#include opt_ah.h
+#include opt_ath.h
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/module.h
+#include sys/sysctl.h
+#include sys/bus.h
+#include sys/malloc.h
+#include sys/proc.h
+#include sys/pcpu.h
+#include sys/lock.h
+#include sys/mutex.h
+#include sys/alq.h
+
+#include dev/ath/if_ath_alq.h
+
+#ifdef ATH_DEBUG_ALQ
+static struct ale *
+if_ath_alq_get(struct if_ath_alq *alq, int len)
+{
+   struct ale *ale;
+
+   if (alq-sc_alq_isactive == 0)
+   return (NULL);
+
+   ale = alq_getn(alq-sc_alq_alq, len, ALQ_NOWAIT);
+   if (! ale)
+   alq-sc_alq_numlost++;
+   return (ale);
+}
+
+void
+if_ath_alq_init(struct if_ath_alq *alq, const char *devname)
+{
+
+   bzero(alq, sizeof(*alq));
+
+   strncpy(alq-sc_alq_devname, devname, ATH_ALQ_DEVNAME_LEN);
+   printf(%s (%s): detached\n, __func__, alq-sc_alq_devname);
+   snprintf(alq-sc_alq_filename, ATH_ALQ_FILENAME_LEN,
+   /tmp/ath_%s_alq.log, alq-sc_alq_devname);
+
+   /* XXX too conservative, right? */
+   alq-sc_alq_qsize = (64*1024);
+}
+
+void
+if_ath_alq_tidyup(struct if_ath_alq *alq)
+{
+
+   if_ath_alq_stop(alq);
+   printf(%s (%s): detached\n, __func__, alq-sc_alq_devname);
+   bzero(alq, sizeof(*alq));
+}
+
+int
+if_ath_alq_start(struct if_ath_alq *alq)
+{
+   int error;
+
+   if (alq-sc_alq_isactive)
+   return (0);
+
+   /*
+* Create a variable-length ALQ.
+*/
+   error = alq_open(alq-sc_alq_alq, alq-sc_alq_filename,
+   curthread-td_ucred, ALQ_DEFAULT_CMODE,
+   alq-sc_alq_qsize, 0);
+
+   if (error != 0) {
+   printf(%s (%s): failed, err=%d\n, __func__,
+   alq-sc_alq_devname, error);
+   } else {
+   printf(%s (%s): opened\n, __func__, alq-sc_alq_devname);
+   alq-sc_alq_isactive = 1;
+   }
+   return (error);
+}
+
+int
+if_ath_alq_stop(struct if_ath_alq *alq)
+{
+
+   if (alq-sc_alq_isactive == 0)
+   return (0);
+
+   printf(%s (%s): closed\n, __func__, alq-sc_alq_devname);
+
+   alq-sc_alq_isactive = 0;
+   alq_close(alq-sc_alq_alq);
+   alq-sc_alq_alq = NULL;
+
+   return (0);
+}
+
+/*
+ * Post a debug message to the ALQ.
+ *
+ * len is the size of the buf payload in bytes.
+ */
+void
+if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len,
+const char *buf)
+{
+   struct if_ath_alq_hdr *ap;
+   struct ale *ale;
+
+   if (! if_ath_alq_checkdebug(alq, op))
+   return;
+
+   /*
+* Enforce 

svn commit: r242782 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Thu Nov  8 18:11:31 2012
New Revision: 242782
URL: http://svnweb.freebsd.org/changeset/base/242782

Log:
  Add some hooks into the driver to attach, detach and record EDMA descriptor
  events.
  
  This is primarily for the TX EDMA and TX EDMA completion. I haven't yet
  tied it into the EDMA RX path or the legacy TX/RX path.
  
  Things that I don't quite like:
  
  * Make the pointer type 'void' in ath_softc and have if_ath_alq*()
return a malloc'ed buffer.  That would remove the need to include
if_ath_alq.h in if_athvar.h.
  * The sysctl setup needs to be cleaned up.

Modified:
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_ath_rx_edma.c
  head/sys/dev/ath/if_ath_sysctl.c
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx_edma.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath_rx.c
==
--- head/sys/dev/ath/if_ath_rx.cThu Nov  8 18:07:29 2012
(r242781)
+++ head/sys/dev/ath/if_ath_rx.cThu Nov  8 18:11:31 2012
(r242782)
@@ -115,6 +115,10 @@ __FBSDID($FreeBSD$);
 #include dev/ath/ath_tx99/ath_tx99.h
 #endif
 
+#ifdef ATH_DEBUG_ALQ
+#include dev/ath/if_ath_alq.h
+#endif
+
 /*
  * Calculate the receive filter according to the
  * operating mode and state:

Modified: head/sys/dev/ath/if_ath_rx_edma.c
==
--- head/sys/dev/ath/if_ath_rx_edma.c   Thu Nov  8 18:07:29 2012
(r242781)
+++ head/sys/dev/ath/if_ath_rx_edma.c   Thu Nov  8 18:11:31 2012
(r242782)
@@ -117,6 +117,10 @@ __FBSDID($FreeBSD$);
 
 #include dev/ath/if_ath_rx_edma.h
 
+#ifdef ATH_DEBUG_ALQ
+#include dev/ath/if_ath_alq.h
+#endif
+
 /*
  * some general macros
   */
@@ -357,7 +361,12 @@ ath_edma_recv_proc_queue(struct ath_soft
 #ifdef ATH_DEBUG
if (sc-sc_debug  ATH_DEBUG_RECV_DESC)
ath_printrxbuf(sc, bf, 0, bf-bf_rxstatus == HAL_OK);
-#endif
+#endif /* ATH_DEBUG */
+#ifdef ATH_DEBUG_ALQ
+   if (if_ath_alq_checkdebug(sc-sc_alq, ATH_ALQ_EDMA_RXSTATUS))
+   if_ath_alq_post(sc-sc_alq, ATH_ALQ_EDMA_RXSTATUS,
+   sc-sc_rx_statuslen, (char *) ds);
+#endif /* ATH_DEBUG */
if (bf-bf_rxstatus == HAL_EINPROGRESS)
break;
 

Modified: head/sys/dev/ath/if_ath_sysctl.c
==
--- head/sys/dev/ath/if_ath_sysctl.cThu Nov  8 18:07:29 2012
(r242781)
+++ head/sys/dev/ath/if_ath_sysctl.cThu Nov  8 18:11:31 2012
(r242782)
@@ -501,6 +501,57 @@ ath_sysctl_forcebstuck(SYSCTL_HANDLER_AR
return 0;
 }
 
+
+static int
+ath_sysctl_alq_log(SYSCTL_HANDLER_ARGS)
+{
+   struct ath_softc *sc = arg1;
+   int error, enable;
+
+   enable = (sc-sc_alq.sc_alq_isactive);
+
+   error = sysctl_handle_int(oidp, enable, 0, req);
+   if (error || !req-newptr)
+   return (error);
+   else if (enable)
+   error = if_ath_alq_start(sc-sc_alq);
+   else
+   error = if_ath_alq_stop(sc-sc_alq);
+   return (error);
+}
+
+#ifdef ATH_DEBUG
+/*
+ * Attach the ALQ debugging if required.
+ */
+static void
+ath_sysctl_alq_attach(struct ath_softc *sc)
+{
+   struct sysctl_oid *tree = device_get_sysctl_tree(sc-sc_dev);
+   struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc-sc_dev);
+   struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
+
+   tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, alq, CTLFLAG_RD,
+   NULL, Atheros ALQ logging parameters);
+   child = SYSCTL_CHILDREN(tree);
+
+   SYSCTL_ADD_STRING(ctx, child, OID_AUTO, filename,
+   CTLFLAG_RW, sc-sc_alq.sc_alq_filename, 0, ALQ filename);
+
+   SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+   enable, CTLTYPE_INT | CTLFLAG_RW, sc, 0,
+   ath_sysctl_alq_log, I, );
+
+   SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+   debugmask, CTLFLAG_RW, sc-sc_alq.sc_alq_debug, 0,
+   ALQ debug mask);
+
+   SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+   numlost, CTLFLAG_RW, sc-sc_alq.sc_alq_numlost, 0,
+   number lost);
+}
+#endif
+
 void
 ath_sysctlattach(struct ath_softc *sc)
 {
@@ -655,6 +706,10 @@ ath_sysctlattach(struct ath_softc *sc)
ath_sysctl_setcca, I, enable CCA control);
}
 #endif
+
+#ifdef ATH_DEBUG
+   ath_sysctl_alq_attach(sc);
+#endif
 }
 
 static int

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cThu Nov  8 18:07:29 2012
(r242781)
+++ head/sys/dev/ath/if_ath_tx.cThu Nov  8 18:11:31 2012
(r242782)
@@ -101,6 +101,10 @@ __FBSDID($FreeBSD$);
 #include dev/ath/if_ath_tx.h
 

Re: svn commit: r242029 - head/sys/kern

2012-11-08 Thread Alfred Perlstein

Peter, can you let me know what you think?

-Alfred

On 11/7/12 11:46 PM, Peter Wemm wrote:

On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein bri...@mu.org wrote:

[[ + peter ]]

Folks, I spent quite a bit of time trying to figure out how to resolve
maxusers scaling in a happy way for all.

I think I came up with a solution.

This solution should work for i386, and other 32 bit platforms, as well as
scaling well for 64 bit (or higher) platforms that have virtually unlimited
AND 64bit with limited kernel address space.

Here is how it works:

We calculate the maxusers value based on physical memory, and then clamp it
down if physical memory exceeds kernel addressable memory.

The algorithm actually remains the same for all architectures, with the
exception that machines with large kernel address space it is no longer
clamped at 384.

I've attached a test program that lets you play with various values for
VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages.  (argv[1, 2, 3]
respectively.)

Please give me your feedback.

This is still bogus.  VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS
have no bearing on how much space should be allocated for mbuf
clusters on amd64.  If anything, you want dmapbase / dmapend if you
want a practical cap for amd64.  Even then, jumbo clusters are 4K so
they come out of kva rather than direct map.

maxusers is the wrong thing for this.  maxusers should, if anything,
be used to set things like kern.maxproc.  Preferably it should be
deleted entirely and sysctl.conf should be used to change
kern.maxproc.

Setting limits for the mbuf / cluster pool should be a MD parameter.

Trying to scale maxusers based on physical ram in order to get mbuf
cluster limits set as a side effect is just plain wrong.

It makes no more sense than trying to set nmbclusters based on
PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order
to get desirable second and third order side effects.

Scale nmbclusters based on physical ram, with a MD method for capping
it for when there are MD limits (eg: disproportionately small kva on
an i386 PAE machine).  Don't use maxusers.


---BeginMessage---
Author: alfred
Date: Thu Nov  8 20:15:12 2012
New Revision: 242783
URL: http://svnweb.freebsd.org/changeset/base/242783

Log:
  Divorce autotune nmbclusters from maxusers.
  Provide arch specific override maximum.
  
  Suggested by: peter

Modified:
  user/alfred/9-alfred/sys/i386/include/vmparam.h
  user/alfred/9-alfred/sys/kern/kern_mbuf.c

Modified: user/alfred/9-alfred/sys/i386/include/vmparam.h
==
--- user/alfred/9-alfred/sys/i386/include/vmparam.h Thu Nov  8 18:11:31 
2012(r242782)
+++ user/alfred/9-alfred/sys/i386/include/vmparam.h Thu Nov  8 20:15:12 
2012(r242783)
@@ -202,4 +202,9 @@
 
 #defineZERO_REGION_SIZE(64 * 1024) /* 64KB */
 
+#ifndef MAX_AUTOTUNE_NMBCLUSTERS
+/* old maxusers max value. */
+#define MAX_AUTOTUNE_NMBCLUSTERS (1024 + 384 * 64)
+#endif
+
 #endif /* _MACHINE_VMPARAM_H_ */

Modified: user/alfred/9-alfred/sys/kern/kern_mbuf.c
==
--- user/alfred/9-alfred/sys/kern/kern_mbuf.c   Thu Nov  8 18:11:31 2012
(r242782)
+++ user/alfred/9-alfred/sys/kern/kern_mbuf.c   Thu Nov  8 20:15:12 2012
(r242783)
@@ -102,6 +102,30 @@ int nmbjumbo9; /* limits number of 9k 
 int nmbjumbo16;/* limits number of 16k jumbo clusters 
*/
 struct mbstat mbstat;
 
+static int 
+nmbclusters_from_physpages(void)
+{
+   long factor;
+   long rv;
+
+   factor = physmem / (2 * 1024 * 1024 / PAGE_SIZE);
+   if (factor  32)
+   factor = 32;
+   /* after 384, switch scale to 1/4 */
+   if (factor  384)
+   factor = 384 + (factor - 384) / 4;
+   rv = 1024 + factor * 64;
+   /*
+* allow a platform specific override to prevent exhausting
+* kernel memory on large memory + small address space machines.
+*/
+#ifdef MAX_AUTOTUNE_NMBCLUSTERS
+   if (rv  MAX_AUTOTUNE_NMBCLUSTERS)
+   rv = MAX_AUTOTUNE_NMBCLUSTERS
+#endif
+   return (rv);
+}
+
 /*
  * tunable_mbinit() has to be run before init_maxsockets() thus
  * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets()
@@ -114,7 +138,7 @@ tunable_mbinit(void *dummy)
/* This has to be done before VM init. */
TUNABLE_INT_FETCH(kern.ipc.nmbclusters, nmbclusters);
if (nmbclusters == 0)
-   nmbclusters = 1024 + maxusers * 64;
+   nmbclusters = nmbclusters_from_physpages();
 
TUNABLE_INT_FETCH(kern.ipc.nmbjumbop, nmbjumbop);
if (nmbjumbop == 0)
---End Message---
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

svn commit: r242784 - head/etc

2012-11-08 Thread Nick Hibma
Author: n_hibma
Date: Thu Nov  8 20:34:12 2012
New Revision: 242784
URL: http://svnweb.freebsd.org/changeset/base/242784

Log:
  Not only load pccard_ether settings, also load network settings. This
  is only a problem when a /etc/rc.conf.d/network file is being used.
  
  PR:   conf/160373
  Submitted by: n_hibma
  MFC after:1 week

Modified:
  head/etc/pccard_ether

Modified: head/etc/pccard_ether
==
--- head/etc/pccard_ether   Thu Nov  8 20:15:12 2012(r242783)
+++ head/etc/pccard_ether   Thu Nov  8 20:34:12 2012(r242784)
@@ -123,4 +123,5 @@ else
 fi
 
 load_rc_config pccard_ether
+load_rc_config network
 run_rc_command $args
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242803 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Thu Nov  8 23:11:59 2012
New Revision: 242803
URL: http://svnweb.freebsd.org/changeset/base/242803

Log:
  Fix the build - fix up the ath_alq code to not compile by default.

Modified:
  head/sys/dev/ath/if_ath_sysctl.c

Modified: head/sys/dev/ath/if_ath_sysctl.c
==
--- head/sys/dev/ath/if_ath_sysctl.cThu Nov  8 22:40:24 2012
(r242802)
+++ head/sys/dev/ath/if_ath_sysctl.cThu Nov  8 23:11:59 2012
(r242803)
@@ -99,6 +99,10 @@ __FBSDID($FreeBSD$);
 #include dev/ath/ath_tx99/ath_tx99.h
 #endif
 
+#ifdef ATH_DEBUG_ALQ
+#include dev/ath/if_ath_alq.h
+#endif
+
 static int
 ath_sysctl_slottime(SYSCTL_HANDLER_ARGS)
 {
@@ -502,6 +506,7 @@ ath_sysctl_forcebstuck(SYSCTL_HANDLER_AR
 }
 
 
+#ifdef ATH_DEBUG_ALQ
 static int
 ath_sysctl_alq_log(SYSCTL_HANDLER_ARGS)
 {
@@ -520,7 +525,6 @@ ath_sysctl_alq_log(SYSCTL_HANDLER_ARGS)
return (error);
 }
 
-#ifdef ATH_DEBUG
 /*
  * Attach the ALQ debugging if required.
  */
@@ -550,7 +554,7 @@ ath_sysctl_alq_attach(struct ath_softc *
numlost, CTLFLAG_RW, sc-sc_alq.sc_alq_numlost, 0,
number lost);
 }
-#endif
+#endif /* ATH_DEBUG_ALQ */
 
 void
 ath_sysctlattach(struct ath_softc *sc)
@@ -565,14 +569,14 @@ ath_sysctlattach(struct ath_softc *sc)
SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
regdomain, CTLFLAG_RD, sc-sc_eerd, 0,
EEPROM regdomain code);
-#ifdef ATH_DEBUG
+#ifdef ATH_DEBUG_ALQ
SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
debug, CTLFLAG_RW, sc-sc_debug,
control debugging printfs);
SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
ktrdebug, CTLFLAG_RW, sc-sc_ktrdebug,
control debugging KTR);
-#endif
+#endif /* ATH_DEBUG_ALQ */
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
slottime, CTLTYPE_INT | CTLFLAG_RW, sc, 0,
ath_sysctl_slottime, I, 802.11 slot time (us));
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242804 - head/sys/boot/i386/boot2

2012-11-08 Thread Dimitry Andric
Author: dim
Date: Thu Nov  8 23:21:02 2012
New Revision: 242804
URL: http://svnweb.freebsd.org/changeset/base/242804

Log:
  Shrink boot2 by 8 bytes, by eliminating some unneeded instructions in
  sio.S.  This is not particularly needed for head right now, but it is
  intended to merge to stable/9, to fix boot2 build with clang there.
  
  Reviewed by:  avg
  MFC after:3 days

Modified:
  head/sys/boot/i386/boot2/sio.S

Modified: head/sys/boot/i386/boot2/sio.S
==
--- head/sys/boot/i386/boot2/sio.S  Thu Nov  8 23:11:59 2012
(r242803)
+++ head/sys/boot/i386/boot2/sio.S  Thu Nov  8 23:21:02 2012
(r242804)
@@ -40,13 +40,11 @@ sio_init:   pushl %eax
movb $0x3,%al   # Set RTS,
outb %al,(%dx)  #  DTR
incl %edx   # Line status reg
-   call sio_flush
-   ret
+   # Fallthrough
 
 /* int sio_flush(void) */
 
-sio_flush: xorl %eax,%eax  # Return value
-   xorl %ecx,%ecx  # Timeout
+sio_flush: xorl %ecx,%ecx  # Timeout
movb $0x80,%ch  #  counter
 sio_flush.1:   call sio_ischar # Check for character
jz sio_flush.2  # Till none
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242807 - head/bin/ls

2012-11-08 Thread Greg Lehey
Author: grog
Date: Thu Nov  8 23:45:19 2012
New Revision: 242807
URL: http://svnweb.freebsd.org/changeset/base/242807

Log:
  Replace spaces with tabs where appropriate.
  
  Reminded by: jh@

Modified:
  head/bin/ls/cmp.c
  head/bin/ls/extern.h
  head/bin/ls/ls.c
  head/bin/ls/ls.h
  head/bin/ls/print.c
  head/bin/ls/util.c

Modified: head/bin/ls/cmp.c
==
--- head/bin/ls/cmp.c   Thu Nov  8 23:42:22 2012(r242806)
+++ head/bin/ls/cmp.c   Thu Nov  8 23:45:19 2012(r242807)
@@ -78,9 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b)
if (b-fts_statp-st_mtim.tv_nsec 
a-fts_statp-st_mtim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
@@ -107,9 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b)
if (b-fts_statp-st_atim.tv_nsec 
a-fts_statp-st_atim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
@@ -136,9 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT *
if (b-fts_statp-st_birthtim.tv_nsec 
a-fts_statp-st_birthtim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 
@@ -165,9 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b
if (b-fts_statp-st_ctim.tv_nsec 
a-fts_statp-st_ctim.tv_nsec)
return (-1);
-if (f_samesort)
+   if (f_samesort)
return (strcoll(b-fts_name, a-fts_name));
-else
+   else
return (strcoll(a-fts_name, b-fts_name));
 }
 

Modified: head/bin/ls/extern.h
==
--- head/bin/ls/extern.hThu Nov  8 23:42:22 2012(r242806)
+++ head/bin/ls/extern.hThu Nov  8 23:45:19 2012(r242807)
@@ -55,12 +55,12 @@ int  prn_octal(const char *);
 int prn_printable(const char *);
 #ifdef COLORLS
 voidparsecolors(const char *cs);
-void colorquit(int);
+voidcolorquit(int);
 
-extern  char*ansi_fgcol;
-extern  char*ansi_bgcol;
-extern  char*ansi_coloff;
-extern  char*attrs_off;
-extern  char*enter_bold;
+extern char*ansi_fgcol;
+extern char*ansi_bgcol;
+extern char*ansi_coloff;
+extern char*attrs_off;
+extern char*enter_bold;
 #endif
 extern int termwidth;

Modified: head/bin/ls/ls.c
==
--- head/bin/ls/ls.cThu Nov  8 23:42:22 2012(r242806)
+++ head/bin/ls/ls.cThu Nov  8 23:45:19 2012(r242807)
@@ -78,7 +78,7 @@ __FBSDID($FreeBSD$);
 #defineSTRBUF_SIZEOF(t)(1 + CHAR_BIT * sizeof(t) / 3 + 1)
 
 /*
- * MAKENINES(n) turns n into (10**n)-1.  This is useful for converting a width
+ * MAKENINES(n) turns n into (10**n)-1. This is useful for converting 
a width
  * into a number that wide in decimal.
  * XXX: Overflows are not considered.
  */
@@ -133,7 +133,7 @@ static int f_sizesort;
int f_statustime;   /* use time of last mode change */
 static int f_stream;   /* stream the output, separate with commas */
int f_thousands;/* show file sizes with thousands 
separators */
-   char *f_timeformat;  /* user-specified time format */
+   char *f_timeformat; /* user-specified time format */
 static int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */
 static int f_whiteout; /* show whiteout entries */
@@ -185,7 +185,7 @@ main(int argc, char *argv[])
fts_options = FTS_PHYSICAL;
if (getenv(LS_SAMESORT))
f_samesort = 1;
-   while ((ch = getopt(argc, argv,
+   while ((ch = getopt(argc, argv,
1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,)) != -1) {
switch (ch) {
/*
@@ -241,7 +241,7 @@ main(int argc, char *argv[])
f_timesort = 1;
f_sizesort = 0;
break;
-/* Other flags.  Please keep alphabetic. */
+   /* Other flags.  Please keep alphabetic. */
case ',':
f_thousands = 1;
break;
@@ -250,10 +250,10 @@ main(int argc, char *argv[])
f_octal = 1;
f_octal_escape = 0;
break;
-case 'D':
-

svn commit: r242808 - head/usr.bin/locale

2012-11-08 Thread Greg Lehey
Author: grog
Date: Thu Nov  8 23:46:15 2012
New Revision: 242808
URL: http://svnweb.freebsd.org/changeset/base/242808

Log:
  Replace spaces by tabs where appropriate.
  
  Reminded by: jh@

Modified:
  head/usr.bin/locale/locale.c

Modified: head/usr.bin/locale/locale.c
==
--- head/usr.bin/locale/locale.cThu Nov  8 23:45:19 2012
(r242807)
+++ head/usr.bin/locale/locale.cThu Nov  8 23:46:15 2012
(r242808)
@@ -31,7 +31,7 @@
  * nl_langinfo(3) extensions)
  *
  * XXX: correctly handle reserved 'charmap' keyword and '-m' option (require
- *  localedef(1) implementation).  Currently it's handled via
+ * localedef(1) implementation).  Currently it's handled via
  * nl_langinfo(CODESET).
  */
 
@@ -84,27 +84,27 @@ struct _lcinfo {
 /* ids for values not referenced by nl_langinfo() */
 #defineKW_ZERO 1
 #defineKW_GROUPING (KW_ZERO+1)
-#define KW_INT_CURR_SYMBOL (KW_ZERO+2)
-#define KW_CURRENCY_SYMBOL (KW_ZERO+3)
-#define KW_MON_DECIMAL_POINT   (KW_ZERO+4)
-#define KW_MON_THOUSANDS_SEP   (KW_ZERO+5)
-#define KW_MON_GROUPING(KW_ZERO+6)
-#define KW_POSITIVE_SIGN   (KW_ZERO+7)
-#define KW_NEGATIVE_SIGN   (KW_ZERO+8)
-#define KW_INT_FRAC_DIGITS (KW_ZERO+9)
-#define KW_FRAC_DIGITS (KW_ZERO+10)
-#define KW_P_CS_PRECEDES   (KW_ZERO+11)
-#define KW_P_SEP_BY_SPACE  (KW_ZERO+12)
-#define KW_N_CS_PRECEDES   (KW_ZERO+13)
-#define KW_N_SEP_BY_SPACE  (KW_ZERO+14)
-#define KW_P_SIGN_POSN (KW_ZERO+15)
-#define KW_N_SIGN_POSN (KW_ZERO+16)
-#define KW_INT_P_CS_PRECEDES   (KW_ZERO+17)
-#define KW_INT_P_SEP_BY_SPACE  (KW_ZERO+18)
-#define KW_INT_N_CS_PRECEDES   (KW_ZERO+19)
-#define KW_INT_N_SEP_BY_SPACE  (KW_ZERO+20)
-#define KW_INT_P_SIGN_POSN (KW_ZERO+21)
-#define KW_INT_N_SIGN_POSN (KW_ZERO+22)
+#define KW_INT_CURR_SYMBOL (KW_ZERO+2)
+#define KW_CURRENCY_SYMBOL (KW_ZERO+3)
+#define KW_MON_DECIMAL_POINT   (KW_ZERO+4)
+#define KW_MON_THOUSANDS_SEP   (KW_ZERO+5)
+#define KW_MON_GROUPING(KW_ZERO+6)
+#define KW_POSITIVE_SIGN   (KW_ZERO+7)
+#define KW_NEGATIVE_SIGN   (KW_ZERO+8)
+#define KW_INT_FRAC_DIGITS (KW_ZERO+9)
+#define KW_FRAC_DIGITS (KW_ZERO+10)
+#define KW_P_CS_PRECEDES   (KW_ZERO+11)
+#define KW_P_SEP_BY_SPACE  (KW_ZERO+12)
+#define KW_N_CS_PRECEDES   (KW_ZERO+13)
+#define KW_N_SEP_BY_SPACE  (KW_ZERO+14)
+#define KW_P_SIGN_POSN (KW_ZERO+15)
+#define KW_N_SIGN_POSN (KW_ZERO+16)
+#define KW_INT_P_CS_PRECEDES   (KW_ZERO+17)
+#define KW_INT_P_SEP_BY_SPACE  (KW_ZERO+18)
+#define KW_INT_N_CS_PRECEDES   (KW_ZERO+19)
+#define KW_INT_N_SEP_BY_SPACE  (KW_ZERO+20)
+#define KW_INT_P_SIGN_POSN (KW_ZERO+21)
+#define KW_INT_N_SIGN_POSN (KW_ZERO+22)
 
 struct _kwinfo {
const char  *name;
@@ -283,16 +283,16 @@ main(int argc, char *argv[])
if (prt_categories || prt_keywords) {
if (argc  0) {
setlocale(LC_ALL, );
-while (argc  0) {
+   while (argc  0) {
showdetails(*argv);
-argv++;
-argc--;
-}
-} else {
+   argv++;
+   argc--;
+   }
+   } else {
uint i;
-for (i = 0; i  sizeof (kwinfo) / sizeof (struct 
_kwinfo); i++)
+   for (i = 0; i  sizeof (kwinfo) / sizeof (struct 
_kwinfo); i++)
showdetails ((char *)kwinfo [i].name);
-}
+   }
exit(0);
}
 
@@ -306,8 +306,8 @@ void
 usage(void)
 {
printf(Usage: locale [ -a | -m ]\n
-  locale -k list [prefix]\n
-  locale [ -ck ] [keyword ...]\n);
+ locale -k list [prefix]\n
+ locale [ -ck ] [keyword ...]\n);
exit(1);
 }
 
@@ -316,7 +316,7 @@ usage(void)
  *
  * XXX actually output of this function does not guarantee that locale
  * is really available to application, since it can be broken or
- * inconsistent thus setlocale() will fail.  Maybe add '-V' function to
+ * inconsistent thus setlocale() will fail. Maybe add '-V' 
function to
  * also validate these locales?
  */
 void
@@ -427,10 +427,10 @@ init_locales_list(void)
}
closedir(dirp);
 
-/* make sure that 'POSIX' and 'C' locales are present in the list.
+   /* make sure that 'POSIX' and 'C' locales are present in the list.
 * POSIX 1003.1-2001 requires presence of 'POSIX' name only here, but
- * we also list 'C' for constistency
- */
+* we also list 'C' 

svn commit: r242809 - stable/8/etc

2012-11-08 Thread Eitan Adler
Author: eadler
Date: Fri Nov  9 00:35:54 2012
New Revision: 242809
URL: http://svnweb.freebsd.org/changeset/base/242809

Log:
  MFC r242462:
10 years too late add support for 2.88MB 3.5in Extra High Density
floppies.
  
Its unlikely that anyone actually uses these or cares about these
anymore, since we support other floppy types and this change doesn't
hurt - just add it.
  
  PR:   conf/40777
  Arrival-Date: Fri Jul 19 08:50:02 PDT 2002
  Approved by:  cperciva (implicit)

Modified:
  stable/8/etc/disktab
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/disktab
==
--- stable/8/etc/disktabThu Nov  8 23:46:15 2012(r242808)
+++ stable/8/etc/disktabFri Nov  9 00:35:54 2012(r242809)
@@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den
:pa#2880:oa#0:ba#4096:fa#512:\
:pc#2880:oc#0:bc#4096:fc#512:
 
+fd2880|2.88MB 3.5in Extra High Density Floppy:\
+   :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\
+   :pa#5760:oa#0:ba#4096:fa#512:\
+   :pb#5760:ob#0:bb#4096:fa#512:\
+   :pc#5760:oc#0:bb#4096:fa#512:
+
 #
 # Stressed floppy-formats.  No guarantees given.
 #
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242810 - stable/9/etc

2012-11-08 Thread Eitan Adler
Author: eadler
Date: Fri Nov  9 00:35:55 2012
New Revision: 242810
URL: http://svnweb.freebsd.org/changeset/base/242810

Log:
  MFC r242462:
10 years too late add support for 2.88MB 3.5in Extra High Density
floppies.
  
Its unlikely that anyone actually uses these or cares about these
anymore, since we support other floppy types and this change doesn't
hurt - just add it.
  
  PR:   conf/40777
  Arrival-Date: Fri Jul 19 08:50:02 PDT 2002
  Approved by:  cperciva (implicit)

Modified:
  stable/9/etc/disktab
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/disktab
==
--- stable/9/etc/disktabFri Nov  9 00:35:54 2012(r242809)
+++ stable/9/etc/disktabFri Nov  9 00:35:55 2012(r242810)
@@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den
:pa#2880:oa#0:ba#4096:fa#512:\
:pc#2880:oc#0:bc#4096:fc#512:
 
+fd2880|2.88MB 3.5in Extra High Density Floppy:\
+   :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\
+   :pa#5760:oa#0:ba#4096:fa#512:\
+   :pb#5760:ob#0:bb#4096:fa#512:\
+   :pc#5760:oc#0:bb#4096:fa#512:
+
 #
 # Stressed floppy-formats.  No guarantees given.
 #
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242811 - stable/7/etc

2012-11-08 Thread Eitan Adler
Author: eadler
Date: Fri Nov  9 00:35:55 2012
New Revision: 242811
URL: http://svnweb.freebsd.org/changeset/base/242811

Log:
  MFC r242462:
10 years too late add support for 2.88MB 3.5in Extra High Density
floppies.
  
Its unlikely that anyone actually uses these or cares about these
anymore, since we support other floppy types and this change doesn't
hurt - just add it.
  
  PR:   conf/40777
  Arrival-Date: Fri Jul 19 08:50:02 PDT 2002
  Approved by:  cperciva (implicit)

Modified:
  stable/7/etc/disktab
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/disktab
==
--- stable/7/etc/disktabFri Nov  9 00:35:55 2012(r242810)
+++ stable/7/etc/disktabFri Nov  9 00:35:55 2012(r242811)
@@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den
:pa#2880:oa#0:ba#4096:fa#512:\
:pc#2880:oc#0:bc#4096:fc#512:
 
+fd2880|2.88MB 3.5in Extra High Density Floppy:\
+   :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\
+   :pa#5760:oa#0:ba#4096:fa#512:\
+   :pb#5760:ob#0:bb#4096:fa#512:\
+   :pc#5760:oc#0:bb#4096:fa#512:
+
 #
 # Stressed floppy-formats.  No guarantees given.
 #
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242813 - head/sys/dev/ath

2012-11-08 Thread Adrian Chadd
Author: adrian
Date: Fri Nov  9 01:28:11 2012
New Revision: 242813
URL: http://svnweb.freebsd.org/changeset/base/242813

Log:
  Fix a very incorrect description.

Modified:
  head/sys/dev/ath/if_ath_alq.c

Modified: head/sys/dev/ath/if_ath_alq.c
==
--- head/sys/dev/ath/if_ath_alq.c   Fri Nov  9 00:59:49 2012
(r242812)
+++ head/sys/dev/ath/if_ath_alq.c   Fri Nov  9 01:28:11 2012
(r242813)
@@ -68,7 +68,7 @@ if_ath_alq_init(struct if_ath_alq *alq, 
bzero(alq, sizeof(*alq));
 
strncpy(alq-sc_alq_devname, devname, ATH_ALQ_DEVNAME_LEN);
-   printf(%s (%s): detached\n, __func__, alq-sc_alq_devname);
+   printf(%s (%s): attached\n, __func__, alq-sc_alq_devname);
snprintf(alq-sc_alq_filename, ATH_ALQ_FILENAME_LEN,
/tmp/ath_%s_alq.log, alq-sc_alq_devname);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242814 - head/sys/dev/puc

2012-11-08 Thread Eitan Adler
Author: eadler
Date: Fri Nov  9 01:51:06 2012
New Revision: 242814
URL: http://svnweb.freebsd.org/changeset/base/242814

Log:
  Add support for Advantech PCI-1602 RS-485/RS-422 serial card
  
  PR:   kern/169726
  Submitted by: Jan Mikkelsen j...@transactionware.com
  Approved by:  cperciva (implicit)
  MFC after:5 days

Modified:
  head/sys/dev/puc/pucdata.c

Modified: head/sys/dev/puc/pucdata.c
==
--- head/sys/dev/puc/pucdata.c  Fri Nov  9 01:28:11 2012(r242813)
+++ head/sys/dev/puc/pucdata.c  Fri Nov  9 01:51:06 2012(r242814)
@@ -630,6 +630,12 @@ const struct puc_cfg puc_pci_devices[] =
PUC_PORT_8S, 0x10, 0, -1,
},
 
+   {   0x13fe, 0x1600, 0x1602, 0x0002,
+   Advantech PCI-1602,
+   DEFAULT_RCLK * 8,
+   PUC_PORT_2S, 0x10, 0, 8,
+   },
+
{   0x1407, 0x0100, 0x, 0,
Lava Computers Dual Serial,
DEFAULT_RCLK,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242815 - head/sys/ufs/ffs

2012-11-08 Thread Jeff Roberson
Author: jeff
Date: Fri Nov  9 04:04:25 2012
New Revision: 242815
URL: http://svnweb.freebsd.org/changeset/base/242815

Log:
   - Correct rev 242734, segments can sometimes get stuck.  Be a bit more
 defensive with segment state.
  
  Reported by:   b. f. bf1...@googlemail.com

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Fri Nov  9 01:51:06 2012
(r242814)
+++ head/sys/ufs/ffs/ffs_softdep.c  Fri Nov  9 04:04:25 2012
(r242815)
@@ -4291,13 +4291,16 @@ free_jsegs(jblocks)
jblocks-jb_oldestseg = jseg;
return;
}
+   if ((jseg-js_state  ALLCOMPLETE) != ALLCOMPLETE)
+   break;
if (jseg-js_seq  jblocks-jb_oldestwrseq)
break;
/*
 * We can free jsegs that didn't write entries when
 * oldestwrseq == js_seq.
 */
-   if (jseg-js_cnt != 0)
+   if (jseg-js_seq == jblocks-jb_oldestwrseq 
+   jseg-js_cnt != 0)
break;
free_jseg(jseg, jblocks);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242816 - head/release/doc/share/xml

2012-11-08 Thread Glen Barber
Author: gjb (doc,ports committer)
Date: Fri Nov  9 04:52:15 2012
New Revision: 242816
URL: http://svnweb.freebsd.org/changeset/base/242816

Log:
  Belatedly (by many years!) bump the version numbers in the src/-side
  documentation pages.
  
  Saddened by:  this file

Modified:
  head/release/doc/share/xml/release.ent

Modified: head/release/doc/share/xml/release.ent
==
--- head/release/doc/share/xml/release.ent  Fri Nov  9 04:04:25 2012
(r242815)
+++ head/release/doc/share/xml/release.ent  Fri Nov  9 04:52:15 2012
(r242816)
@@ -6,23 +6,23 @@
 
 !-- Version of the OS we're describing.  This needs to be updated
  with each new release. --
-!ENTITY release.current 9.0-CURRENT
+!ENTITY release.current 10.0-CURRENT
 
 !-- The previous version used for comparison in the What's New
  section.  For -CURRENT, we might point back to the last
  branchpoint. --
-!ENTITY release.prev 8.0-RELEASE
+!ENTITY release.prev 9.0-RELEASE
 
 !-- The previous stable release, useful for pointing user's at the
  release they SHOULD be running if they don't want the bleeding
  edge. --
-!ENTITY release.prev.stable 8.0-RELEASE
+!ENTITY release.prev.stable 8.3-RELEASE
 
 !-- The next version to be released, usually used for snapshots. --
-!ENTITY release.next 9.0-RELEASE
+!ENTITY release.next 9.1-RELEASE
 
 !-- The name of this branch. --
-!ENTITY release.branch 9-CURRENT
+!ENTITY release.branch 10-CURRENT
 
 !-- The URL for obtaining this version of FreeBSD. --
 !ENTITY release.url http://www.FreeBSD.org/snapshots/;
@@ -39,7 +39,7 @@
 !ENTITY release.manpath.xorg  7.5.1
 !ENTITY release.manpath.netbsd5.1
 !ENTITY release.manpath.freebsd-ports Ports
-!ENTITY release.manpath.freebsd   9-current
+!ENTITY release.manpath.freebsd   10-current
 
 !-- Text constants which probably don't need to be changed.--
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242819 - stable/9/sys/dev/usb/net

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Nov  9 06:58:23 2012
New Revision: 242819
URL: http://svnweb.freebsd.org/changeset/base/242819

Log:
  MFC r238466 and r242777:
  Implement non-PHY support in the udav driver.

Modified:
  stable/9/sys/dev/usb/net/if_udav.c
  stable/9/sys/dev/usb/net/if_udavreg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/net/if_udav.c
==
--- stable/9/sys/dev/usb/net/if_udav.c  Fri Nov  9 05:44:34 2012
(r242818)
+++ stable/9/sys/dev/usb/net/if_udav.c  Fri Nov  9 06:58:23 2012
(r242819)
@@ -181,6 +181,15 @@ static const struct usb_ether_methods ud
.ue_mii_sts = udav_ifmedia_status,
 };
 
+static const struct usb_ether_methods udav_ue_methods_nophy = {
+   .ue_attach_post = udav_attach_post,
+   .ue_start = udav_start,
+   .ue_init = udav_init,
+   .ue_stop = udav_stop,
+   .ue_setmulti = udav_setmulti,
+   .ue_setpromisc = udav_setpromisc,
+};
+
 #ifdef USB_DEBUG
 static int udav_debug = 0;
 
@@ -206,7 +215,8 @@ static const STRUCT_USB_HOST_ID udav_dev
{USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)},
/* Kontron AG USB Ethernet */
{USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)},
-   {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)},
+   {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082,
+   UDAV_FLAG_NO_PHY)},
 };
 
 static void
@@ -259,11 +269,20 @@ udav_attach(device_t dev)
goto detach;
}
 
+   /*
+* The JP1082 has an unusable PHY and provides no link information.
+*/
+   if (sc-sc_flags  UDAV_FLAG_NO_PHY) {
+   ue-ue_methods = udav_ue_methods_nophy;
+   sc-sc_flags |= UDAV_FLAG_LINK;
+   } else {
+   ue-ue_methods = udav_ue_methods;
+   }
+
ue-ue_sc = sc;
ue-ue_dev = dev;
ue-ue_udev = uaa-device;
ue-ue_mtx = sc-sc_mtx;
-   ue-ue_methods = udav_ue_methods;
 
error = uether_ifattach(ue);
if (error) {
@@ -712,7 +731,8 @@ udav_stop(struct usb_ether *ue)
UDAV_LOCK_ASSERT(sc, MA_OWNED);
 
ifp-if_drv_flags = ~IFF_DRV_RUNNING;
-   sc-sc_flags = ~UDAV_FLAG_LINK;
+   if (!(sc-sc_flags  UDAV_FLAG_NO_PHY))
+   sc-sc_flags = ~UDAV_FLAG_LINK;
 
/*
 * stop all the transfers, if not already stopped:

Modified: stable/9/sys/dev/usb/net/if_udavreg.h
==
--- stable/9/sys/dev/usb/net/if_udavreg.h   Fri Nov  9 05:44:34 2012
(r242818)
+++ stable/9/sys/dev/usb/net/if_udavreg.h   Fri Nov  9 06:58:23 2012
(r242819)
@@ -159,6 +159,7 @@ struct udav_softc {
int sc_flags;
 #defineUDAV_FLAG_LINK  0x0001
 #defineUDAV_FLAG_EXT_PHY   0x0040
+#defineUDAV_FLAG_NO_PHY0x0080
 };
 
 #defineUDAV_LOCK(_sc)  mtx_lock((_sc)-sc_mtx)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242820 - in stable/9/sys/dev: atkbdc isci/scil usb/serial

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Nov  9 07:05:28 2012
New Revision: 242820
URL: http://svnweb.freebsd.org/changeset/base/242820

Log:
  MFC r240743 and r234418:
  Fix some typos.

Modified:
  stable/9/sys/dev/atkbdc/psm.c
  stable/9/sys/dev/isci/scil/scic_sds_phy.c
  stable/9/sys/dev/usb/serial/uftdi_reg.h
  stable/9/sys/dev/usb/serial/umodem.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/atkbdc/psm.c
==
--- stable/9/sys/dev/atkbdc/psm.c   Fri Nov  9 06:58:23 2012
(r242819)
+++ stable/9/sys/dev/atkbdc/psm.c   Fri Nov  9 07:05:28 2012
(r242820)
@@ -2454,7 +2454,7 @@ proc_mmanplus(struct psm_softc *sc, pack
 {
 
/*
-* PS2++ protocl packet
+* PS2++ protocol packet
 *
 *  b7 b6 b5 b4 b3 b2 b1 b0
 * byte 1:  *  1  p3 p2 1  *  *  *
@@ -3738,7 +3738,7 @@ enable_mmanplus(KBDC kbdc, struct psm_so
return (FALSE);
 
/*
-* PS2++ protocl, packet type 0
+* PS2++ protocol, packet type 0
 *
 *  b7 b6 b5 b4 b3 b2 b1 b0
 * byte 1:  *  1  p3 p2 1  *  *  *

Modified: stable/9/sys/dev/isci/scil/scic_sds_phy.c
==
--- stable/9/sys/dev/isci/scil/scic_sds_phy.c   Fri Nov  9 06:58:23 2012
(r242819)
+++ stable/9/sys/dev/isci/scil/scic_sds_phy.c   Fri Nov  9 07:05:28 2012
(r242820)
@@ -2317,7 +2317,7 @@ void scic_sds_phy_stopped_state_enter(
  * entering the SCI_BASE_PHY_STATE_STARTING.
  *- This function sets the state handlers for the phy object base state
  * machine starting state.
- *- The SCU hardware is requested to start OOB/SN on this protocl engine.
+ *- The SCU hardware is requested to start OOB/SN on this protocol engine.
  *- The phy starting substate machine is started.
  *- If the previous state was the ready state then the
  *  SCIC_SDS_CONTROLLER is informed that the phy has gone link down.

Modified: stable/9/sys/dev/usb/serial/uftdi_reg.h
==
--- stable/9/sys/dev/usb/serial/uftdi_reg.h Fri Nov  9 06:58:23 2012
(r242819)
+++ stable/9/sys/dev/usb/serial/uftdi_reg.h Fri Nov  9 07:05:28 2012
(r242820)
@@ -176,7 +176,7 @@ enum {
  *   BmRequestType:  0100 b
  *   bRequest:   FTDI_SIO_SET_FLOW_CTRL
  *   wValue: Xoff/Xon
- *   wIndex: Protocol/Port - hIndex is protocl / lIndex is port
+ *   wIndex: Protocol/Port - hIndex is protocol / lIndex is port
  *   wLength:0
  *   Data:   None
  *

Modified: stable/9/sys/dev/usb/serial/umodem.c
==
--- stable/9/sys/dev/usb/serial/umodem.cFri Nov  9 06:58:23 2012
(r242819)
+++ stable/9/sys/dev/usb/serial/umodem.cFri Nov  9 07:05:28 2012
(r242820)
@@ -139,7 +139,7 @@ static const STRUCT_USB_HOST_ID umodem_d
 };
 
 /*
- * As speeds for umodem deivces increase, these numbers will need to
+ * As speeds for umodem devices increase, these numbers will need to
  * be increased. They should be good for G3 speeds and below.
  *
  * TODO: The TTY buffers should be increased!
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242821 - in stable/9/sys/dev/usb: . quirk storage

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Nov  9 07:12:31 2012
New Revision: 242821
URL: http://svnweb.freebsd.org/changeset/base/242821

Log:
  MFC r241432, r242628 and r242364:
  Remove ancient mass storage gone checks.
  Add some more mass storage related quirks.
  Improve auto-quirk detection for mass storage devices.

Modified:
  stable/9/sys/dev/usb/quirk/usb_quirk.c
  stable/9/sys/dev/usb/quirk/usb_quirk.h
  stable/9/sys/dev/usb/storage/umass.c
  stable/9/sys/dev/usb/usb_msctest.c
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/9/sys/dev/usb/quirk/usb_quirk.c  Fri Nov  9 07:05:28 2012
(r242820)
+++ stable/9/sys/dev/usb/quirk/usb_quirk.c  Fri Nov  9 07:12:31 2012
(r242821)
@@ -390,6 +390,7 @@ static struct usb_quirk_entry usb_quirks
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN),
USB_QUIRK(SONY, PORTABLE_HDD_V2, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI),
+   USB_QUIRK(STMICRO, ST72682, 0x, 0x, UQ_MSC_NO_PREVENT_ALLOW),
USB_QUIRK(SUPERTOP, IDE, 0x, 0x, UQ_MSC_IGNORE_RESIDUE,
UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(TAUGA, CAMERAMATE, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI),
@@ -517,6 +518,7 @@ static const char *usb_quirk_str[USB_QUI
[UQ_MSC_NO_GETMAXLUN]   = UQ_MSC_NO_GETMAXLUN,
[UQ_MSC_NO_INQUIRY] = UQ_MSC_NO_INQUIRY,
[UQ_MSC_NO_INQUIRY_EVPD]= UQ_MSC_NO_INQUIRY_EVPD,
+   [UQ_MSC_NO_PREVENT_ALLOW]   = UQ_MSC_NO_PREVENT_ALLOW,
[UQ_MSC_NO_SYNC_CACHE]  = UQ_MSC_NO_SYNC_CACHE,
[UQ_MSC_SHUTTLE_INIT]   = UQ_MSC_SHUTTLE_INIT,
[UQ_MSC_ALT_IFACE_1]= UQ_MSC_ALT_IFACE_1,

Modified: stable/9/sys/dev/usb/quirk/usb_quirk.h
==
--- stable/9/sys/dev/usb/quirk/usb_quirk.h  Fri Nov  9 07:05:28 2012
(r242820)
+++ stable/9/sys/dev/usb/quirk/usb_quirk.h  Fri Nov  9 07:12:31 2012
(r242821)
@@ -75,6 +75,7 @@ enum {
UQ_MSC_NO_GETMAXLUN,/* does not support get max LUN */
UQ_MSC_NO_INQUIRY,  /* fake generic inq response */
UQ_MSC_NO_INQUIRY_EVPD, /* does not support inq EVPD */
+   UQ_MSC_NO_PREVENT_ALLOW,/* does not support medium removal */ 
UQ_MSC_NO_SYNC_CACHE,   /* does not support sync cache */ 
UQ_MSC_SHUTTLE_INIT,/* requires Shuttle init sequence */
UQ_MSC_ALT_IFACE_1, /* switch to alternate interface 1 */

Modified: stable/9/sys/dev/usb/storage/umass.c
==
--- stable/9/sys/dev/usb/storage/umass.cFri Nov  9 07:05:28 2012
(r242820)
+++ stable/9/sys/dev/usb/storage/umass.cFri Nov  9 07:12:31 2012
(r242821)
@@ -174,8 +174,6 @@ TUNABLE_INT(hw.usb.umass.debug, umass
 #defineDPRINTF(...) do { } while (0)
 #endif
 
-#defineUMASS_GONE ((struct umass_softc *)1)
-
 #defineUMASS_BULK_SIZE (1  17)
 #defineUMASS_CBI_DIAGNOSTIC_CMDLEN 12  /* bytes */
 #defineUMASS_MAX_CMDLEN MAX(12, CAM_MAX_CDBLEN)/* bytes */
@@ -363,6 +361,8 @@ typedef uint8_t (umass_transform_t)(stru
 * result.
 */
 #defineNO_SYNCHRONIZE_CACHE0x4000
+   /* Device does not support 'PREVENT/ALLOW MEDIUM REMOVAL'. */
+#defineNO_PREVENT_ALLOW0x8000
 
 struct umass_softc {
 
@@ -833,6 +833,8 @@ umass_probe_proto(device_t dev, struct u
quirks |= NO_INQUIRY;
if (usb_test_quirk(uaa, UQ_MSC_NO_INQUIRY_EVPD))
quirks |= NO_INQUIRY_EVPD;
+   if (usb_test_quirk(uaa, UQ_MSC_NO_PREVENT_ALLOW))
+   quirks |= NO_PREVENT_ALLOW;
if (usb_test_quirk(uaa, UQ_MSC_NO_SYNC_CACHE))
quirks |= NO_SYNCHRONIZE_CACHE;
if (usb_test_quirk(uaa, UQ_MSC_SHUTTLE_INIT))
@@ -2108,7 +2110,7 @@ umass_cam_detach_sim(struct umass_softc 
if (sc-sc_sim != NULL) {
if (xpt_bus_deregister(cam_sim_path(sc-sc_sim))) {
/* accessing the softc is not possible after this */
-   sc-sc_sim-softc = UMASS_GONE;
+   sc-sc_sim-softc = NULL;
cam_sim_free(sc-sc_sim, /* free_devq */ TRUE);
} else {
panic(%s: CAM layer is busy\n,
@@ -2127,63 +2129,11 @@ umass_cam_action(struct cam_sim *sim, un
 {
struct umass_softc *sc = (struct umass_softc *)sim-softc;
 
-   if (sc == UMASS_GONE ||
-   (sc != NULL  !usbd_device_attached(sc-sc_udev))) {
+   if (sc == NULL) {
ccb-ccb_h.status = CAM_SEL_TIMEOUT;

svn commit: r242822 - in stable/9/sys/dev: sound/usb usb usb/quirk

2012-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Nov  9 07:29:11 2012
New Revision: 242822
URL: http://svnweb.freebsd.org/changeset/base/242822

Log:
  MFC r242127, r240078, r240609, r241988, r242129, r242223, r242438,
  r242453, r242455 and r242458:
  
  Add full support for Fast Track Ultra 8R from M-audio.
  
  Implement support for USB Audio v2.0.
  
  Remove some redundant USB audio v1.0 debug data. Use lsusb instead.
  
  Implement support for the so-called USB feedback endpoint for USB
  audio devices.
  
  Export all mixer nodes into dev.pcm.X.mixer.Y sysctl nodes.
  
  PR:   usb/171254

Modified:
  stable/9/sys/dev/sound/usb/uaudio.c
  stable/9/sys/dev/sound/usb/uaudioreg.h
  stable/9/sys/dev/usb/quirk/usb_quirk.c
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/usb/uaudio.c
==
--- stable/9/sys/dev/sound/usb/uaudio.c Fri Nov  9 07:12:31 2012
(r242821)
+++ stable/9/sys/dev/sound/usb/uaudio.c Fri Nov  9 07:29:11 2012
(r242822)
@@ -71,6 +71,7 @@ __FBSDID($FreeBSD$);
 #include dev/usb/usb.h
 #include dev/usb/usbdi.h
 #include dev/usb/usbdi_util.h
+#include dev/usb/usb_request.h
 
 #defineUSB_DEBUG_VAR uaudio_debug
 #include dev/usb/usb_debug.h
@@ -115,22 +116,39 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def
 #endif
 
 #defineUAUDIO_NFRAMES  64  /* must be factor of 8 due 
HS-USB */
-#defineUAUDIO_NCHANBUFS2   /* number of outstanding 
request */
-#defineUAUDIO_RECURSE_LIMIT   24   /* rounds */
+#defineUAUDIO_NCHANBUFS2   /* number of outstanding 
request */
+#defineUAUDIO_RECURSE_LIMIT255 /* rounds */
 
 #defineMAKE_WORD(h,l) (((h)  8) | (l))
 #defineBIT_TEST(bm,bno) (((bm)[(bno) / 8]  (7 - ((bno) % 8)))  1)
 #defineUAUDIO_MAX_CHAN(x) (x)
 
+union uaudio_asid {
+   const struct usb_audio_streaming_interface_descriptor *v1;
+   const struct usb_audio20_streaming_interface_descriptor *v2;
+};
+
+union uaudio_asf1d {
+   const struct usb_audio_streaming_type1_descriptor *v1;
+   const struct usb_audio20_streaming_type1_descriptor *v2;
+};
+
+union uaudio_sed {
+   const struct usb_audio_streaming_endpoint_descriptor *v1;
+   const struct usb_audio20_streaming_endpoint_descriptor *v2;
+};
+
 struct uaudio_mixer_node {
+   const char *name;
+
int32_t minval;
int32_t maxval;
-#defineMIX_MAX_CHAN 8
+#defineMIX_MAX_CHAN 16
int32_t wValue[MIX_MAX_CHAN];   /* using nchan */
uint32_t mul;
uint32_t ctl;
 
-   uint16_t wData[MIX_MAX_CHAN];   /* using nchan */
+   int wData[MIX_MAX_CHAN];/* using nchan */
uint16_t wIndex;
 
uint8_t update[(MIX_MAX_CHAN + 7) / 8];
@@ -149,6 +167,9 @@ struct uaudio_mixer_node {
 #defineMAX_SELECTOR_INPUT_PIN 256
uint8_t slctrtype[MAX_SELECTOR_INPUT_PIN];
uint8_t class;
+   uint8_t val_default;
+
+   uint8_t desc[64];
 
struct uaudio_mixer_node *next;
 };
@@ -161,12 +182,10 @@ struct uaudio_chan {
struct mtx *pcm_mtx;/* lock protecting this structure */
struct uaudio_softc *priv_sc;
struct pcm_channel *pcm_ch;
-   struct usb_xfer *xfer[UAUDIO_NCHANBUFS];
-   const struct usb_audio_streaming_interface_descriptor *p_asid;
-   const struct usb_audio_streaming_type1_descriptor *p_asf1d;
-   const struct usb_audio_streaming_endpoint_descriptor *p_sed;
+   struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1];
+   union uaudio_asf1d p_asf1d;
+   union uaudio_sed p_sed;
const usb_endpoint_descriptor_audio_t *p_ed1;
-   const usb_endpoint_descriptor_audio_t *p_ed2;
const struct uaudio_format *p_fmt;
 
uint8_t *buf;   /* pointer to buffer */
@@ -192,6 +211,13 @@ struct uaudio_chan {
uint8_t valid;
uint8_t iface_index;
uint8_t iface_alt_index;
+   uint8_t channels;
+
+   uint8_t last_sync_time;
+   uint8_t last_sync_state;
+#defineUAUDIO_SYNC_NONE 0
+#defineUAUDIO_SYNC_MORE 1
+#defineUAUDIO_SYNC_LESS 2
 };
 
 #defineUMIDI_CABLES_MAX   16   /* units */
@@ -242,13 +268,23 @@ struct umidi_chan {
uint8_t single_command;
 };
 
+struct uaudio_search_result {
+   uint8_t bit_input[(256 + 7) / 8];
+   uint8_t bit_output[(256 + 7) / 8];
+   uint8_t recurse_level;
+   uint8_t id_max;
+   uint8_t is_input;
+};
+
 struct uaudio_softc {
struct sbuf sc_sndstat;
struct sndcard_func sc_sndcard_func;
struct uaudio_chan sc_rec_chan;
struct uaudio_chan sc_play_chan;
struct umidi_chan sc_midi_chan;
+   struct uaudio_search_result sc_mixer_clocks;
 
+   struct mtx *sc_mixer_lock;
struct usb_device *sc_udev;