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

2010-11-30 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Nov 30 08:25:57 2010
New Revision: 216072
URL: http://svn.freebsd.org/changeset/base/216072

Log:
  We need to define a cdev variable associated with each USB device,
  hence existing applications like webcamd are expecting that.
  This problem was introduced by SVN change 214221 where cdev=
  was replaced by ugen= by accident. Solve this problem by
  redefining cdev= in devd notifications.
  
  MFC after 3 days.
  
  Approved by:  thompsa (mentor)

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==
--- head/sys/dev/usb/usb_device.c   Tue Nov 30 07:14:05 2010
(r216071)
+++ head/sys/dev/usb/usb_device.c   Tue Nov 30 08:25:57 2010
(r216072)
@@ -2475,6 +2475,7 @@ usb_notify_addq(const char *type, struct
sbuf_printf(sb,
 #if USB_HAVE_UGEN
ugen=%s 
+   cdev=%s 
 #endif
vendor=0x%04x 
product=0x%04x 
@@ -2490,6 +2491,7 @@ usb_notify_addq(const char *type, struct
,
 #if USB_HAVE_UGEN
udev-ugen_name,
+   udev-ugen_name,
 #endif
UGETW(udev-ddesc.idVendor),
UGETW(udev-ddesc.idProduct),
@@ -2521,6 +2523,7 @@ usb_notify_addq(const char *type, struct
sbuf_printf(sb,
 #if USB_HAVE_UGEN
ugen=%s 
+   cdev=%s 
 #endif
vendor=0x%04x 
product=0x%04x 
@@ -2536,6 +2539,7 @@ usb_notify_addq(const char *type, struct
intprotocol=0x%02x,
 #if USB_HAVE_UGEN
udev-ugen_name,
+   udev-ugen_name,
 #endif
UGETW(udev-ddesc.idVendor),
UGETW(udev-ddesc.idProduct),
___
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: r216073 - stable/8/sys/crypto/aesni

2010-11-30 Thread Konstantin Belousov
Author: kib
Date: Tue Nov 30 08:39:05 2010
New Revision: 216073
URL: http://svn.freebsd.org/changeset/base/216073

Log:
  MFC r215942:
  Remove DEBUG sections.
  
  Approved by:  re (bz)

Modified:
  stable/8/sys/crypto/aesni/aesni_wrap.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/crypto/aesni/aesni_wrap.c
==
--- stable/8/sys/crypto/aesni/aesni_wrap.c  Tue Nov 30 08:25:57 2010
(r216072)
+++ stable/8/sys/crypto/aesni/aesni_wrap.c  Tue Nov 30 08:39:05 2010
(r216073)
@@ -37,22 +37,6 @@ __FBSDID($FreeBSD$);
 
 MALLOC_DECLARE(M_AESNI);
 
-#ifdef DEBUG
-static void
-ps_len(const char *string, const uint8_t *data, int length)
-{
-   int i;
-
-   printf(%-12s[0x, string);
-   for(i = 0; i  length; i++) {
-   if (i % AES_BLOCK_LEN == 0  i  0)
-   printf(+);
-   printf(%02x, data[i]);
-   }
-   printf(]\n);
-}
-#endif
-
 void
 aesni_encrypt_cbc(int rounds, const void *key_schedule, size_t len,
 const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN])
@@ -60,11 +44,6 @@ aesni_encrypt_cbc(int rounds, const void
const uint8_t *ivp;
size_t i;
 
-#ifdef DEBUG
-   ps_len(AES CBC encrypt iv:, iv, AES_BLOCK_LEN);
-   ps_len(from:, from, len);
-#endif
-
len /= AES_BLOCK_LEN;
ivp = iv;
for (i = 0; i  len; i++) {
@@ -73,9 +52,6 @@ aesni_encrypt_cbc(int rounds, const void
from += AES_BLOCK_LEN;
to += AES_BLOCK_LEN;
}
-#ifdef DEBUG
-   ps_len(to:, to - len * AES_BLOCK_LEN, len * AES_BLOCK_LEN);
-#endif
 }
 
 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: r216074 - head/share/man/man4

2010-11-30 Thread Nick Hibma
Author: n_hibma
Date: Tue Nov 30 09:34:47 2010
New Revision: 216074
URL: http://svn.freebsd.org/changeset/base/216074

Log:
  Fix two errors in the man page
  
  Submitted by: ruslan
  MFC after:1 day

Modified:
  head/share/man/man4/usb_quirk.4

Modified: head/share/man/man4/usb_quirk.4
==
--- head/share/man/man4/usb_quirk.4 Tue Nov 30 08:39:05 2010
(r216073)
+++ head/share/man/man4/usb_quirk.4 Tue Nov 30 09:34:47 2010
(r216074)
@@ -27,7 +27,7 @@ To compile this module into the kernel,
 place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
-.Cd device ucom
+.Cd device usb
 .Ed
 .Pp
 Alternatively, to load the module at boot
@@ -183,7 +183,6 @@ device which appears as a USB device on
 usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
 .Ed
 .Sh SEE ALSO
-.Xr usb_quirk 4 ,
 .Xr usbconfig 5
 .Sh HISTORY
 The
___
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: r216075 - in head: sys/netinet usr.sbin/arp

2010-11-30 Thread Gleb Smirnoff
Author: glebius
Date: Tue Nov 30 15:57:00 2010
New Revision: 216075
URL: http://svn.freebsd.org/changeset/base/216075

Log:
  Use time_uptime instead of non-monotonic time_second to drive ARP
  timeouts.
  
  Suggested by: bde

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/usr.sbin/arp/arp.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Tue Nov 30 09:34:47 2010(r216074)
+++ head/sys/netinet/if_ether.c Tue Nov 30 15:57:00 2010(r216075)
@@ -323,7 +323,7 @@ retry:
} 
 
if ((la-la_flags  LLE_VALID) 
-   ((la-la_flags  LLE_STATIC) || la-la_expire  time_second)) {
+   ((la-la_flags  LLE_STATIC) || la-la_expire  time_uptime)) {
bcopy(la-ll_addr, desten, ifp-if_addrlen);
/*
 * If entry has an expiry time and it is approaching,
@@ -331,7 +331,7 @@ retry:
 * arpt_down interval.
 */
if (!(la-la_flags  LLE_STATIC) 
-   time_second + la-la_preempt  la-la_expire) {
+   time_uptime + la-la_preempt  la-la_expire) {
arprequest(ifp, NULL,
SIN(dst)-sin_addr, IF_LLADDR(ifp));
 
@@ -351,7 +351,7 @@ retry:
goto done;
}
 
-   renew = (la-la_asked == 0 || la-la_expire != time_second);
+   renew = (la-la_asked == 0 || la-la_expire != time_uptime);
if ((renew || m != NULL)  (flags  LLE_EXCLUSIVE) == 0) {
flags |= LLE_EXCLUSIVE;
LLE_RUNLOCK(la);
@@ -403,7 +403,7 @@ retry:
int canceled;
 
LLE_ADDREF(la);
-   la-la_expire = time_second;
+   la-la_expire = time_uptime;
canceled = callout_reset(la-la_timer, hz * V_arpt_down,
arptimer, la);
if (canceled)
@@ -713,7 +713,7 @@ match:
int canceled;
 
LLE_ADDREF(la);
-   la-la_expire = time_second + V_arpt_keep;
+   la-la_expire = time_uptime + V_arpt_keep;
canceled = callout_reset(la-la_timer,
hz * V_arpt_keep, arptimer, la);
if (canceled)

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Tue Nov 30 09:34:47 2010(r216074)
+++ head/sys/netinet/in.c   Tue Nov 30 15:57:00 2010(r216075)
@@ -1333,7 +1333,7 @@ in_lltable_new(const struct sockaddr *l3
 * For IPv4 this will trigger arpresolve to generate
 * an ARP request.
 */
-   lle-base.la_expire = time_second; /* mark expired */
+   lle-base.la_expire = time_uptime; /* mark expired */
lle-l3_addr4 = *(const struct sockaddr_in *)l3addr;
lle-base.lle_refcnt = 1;
LLE_LOCK_INIT(lle-base);

Modified: head/usr.sbin/arp/arp.c
==
--- head/usr.sbin/arp/arp.c Tue Nov 30 09:34:47 2010(r216074)
+++ head/usr.sbin/arp/arp.c Tue Nov 30 15:57:00 2010(r216075)
@@ -602,10 +602,10 @@ print_entry(struct sockaddr_dl *sdl,
if (rtm-rtm_rmx.rmx_expire == 0)
printf( permanent);
else {
-   static struct timeval tv;
-   if (tv.tv_sec == 0)
-   gettimeofday(tv, 0);
-   if ((expire_time = rtm-rtm_rmx.rmx_expire - tv.tv_sec)  0)
+   static struct timespec tp;
+   if (tp.tv_sec == 0)
+   clock_gettime(CLOCK_MONOTONIC, tp);
+   if ((expire_time = rtm-rtm_rmx.rmx_expire - tp.tv_sec)  0)
printf( expires in %d seconds, (int)expire_time);
else
printf( expired);
___
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: r216076 - head/usr.sbin/arp

2010-11-30 Thread Gleb Smirnoff
Author: glebius
Date: Tue Nov 30 16:00:59 2010
New Revision: 216076
URL: http://svn.freebsd.org/changeset/base/216076

Log:
  That should belong to r216075. Pointy hat on me.

Modified:
  head/usr.sbin/arp/arp.c

Modified: head/usr.sbin/arp/arp.c
==
--- head/usr.sbin/arp/arp.c Tue Nov 30 15:57:00 2010(r216075)
+++ head/usr.sbin/arp/arp.c Tue Nov 30 16:00:59 2010(r216076)
@@ -319,9 +319,9 @@ set(int argc, char **argv)
doing_proxy = flags = proxy_only = expire_time = 0;
while (argc--  0) {
if (strncmp(argv[0], temp, 4) == 0) {
-   struct timeval tv;
-   gettimeofday(tv, 0);
-   expire_time = tv.tv_sec + 20 * 60;
+   struct timespec tp;
+   clock_gettime(CLOCK_MONOTONIC, tp);
+   expire_time = tp.tv_sec + 20 * 60;
} else if (strncmp(argv[0], pub, 3) == 0) {
flags |= RTF_ANNOUNCE;
doing_proxy = 1;
___
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: r216077 - head/usr.sbin/crashinfo

2010-11-30 Thread Colin Percival
Author: cperciva
Date: Tue Nov 30 16:04:40 2010
New Revision: 216077
URL: http://svn.freebsd.org/changeset/base/216077

Log:
  Teach crashinfo(8) to look at the currently running kernel (based on the
  kern.bootfile sysctl).  Prior to this commit, crashinfo(8) only looks at
  /boot/*/kernel; this includes the usual places where kernels reside, so
  for most systems this will have no effect.
  
  Approved by:  jhb
  MFC after:3 days

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==
--- head/usr.sbin/crashinfo/crashinfo.shTue Nov 30 16:00:59 2010
(r216076)
+++ head/usr.sbin/crashinfo/crashinfo.shTue Nov 30 16:04:40 2010
(r216077)
@@ -53,7 +53,7 @@ find_kernel()
}' $INFO)
 
# Look for a matching kernel version.
-   for k in /boot/kernel/kernel $(ls -t /boot/*/kernel); do
+   for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do
kvers=$(echo 'printf   Version String: %s, version' | \
gdb -x /dev/stdin -batch $k 2/dev/null)
if [ $ivers = $kvers ]; then
___
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: r216078 - head/usr.sbin/arp

2010-11-30 Thread Gleb Smirnoff
Author: glebius
Date: Tue Nov 30 16:14:19 2010
New Revision: 216078
URL: http://svn.freebsd.org/changeset/base/216078

Log:
  Do not hardcode (20*60), but use current ARP timeout value configured
  in kernel.

Modified:
  head/usr.sbin/arp/arp.c

Modified: head/usr.sbin/arp/arp.c
==
--- head/usr.sbin/arp/arp.c Tue Nov 30 16:04:40 2010(r216077)
+++ head/usr.sbin/arp/arp.c Tue Nov 30 16:14:19 2010(r216078)
@@ -320,8 +320,14 @@ set(int argc, char **argv)
while (argc--  0) {
if (strncmp(argv[0], temp, 4) == 0) {
struct timespec tp;
+   int max_age;
+   size_t len = sizeof(max_age);
+
clock_gettime(CLOCK_MONOTONIC, tp);
-   expire_time = tp.tv_sec + 20 * 60;
+   if (sysctlbyname(net.link.ether.inet.max_age,
+   max_age, len, NULL, 0) != 0)
+   err(1, sysctlbyname);
+   expire_time = tp.tv_sec + max_age;
} else if (strncmp(argv[0], pub, 3) == 0) {
flags |= RTF_ANNOUNCE;
doing_proxy = 1;
___
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: r216079 - head/sys/dev/syscons

2010-11-30 Thread Jung-uk Kim
Author: jkim
Date: Tue Nov 30 16:46:15 2010
New Revision: 216079
URL: http://svn.freebsd.org/changeset/base/216079

Log:
  Clean up code a bit to make it more readable.

Modified:
  head/sys/dev/syscons/scvidctl.c

Modified: head/sys/dev/syscons/scvidctl.c
==
--- head/sys/dev/syscons/scvidctl.c Tue Nov 30 16:14:19 2010
(r216078)
+++ head/sys/dev/syscons/scvidctl.c Tue Nov 30 16:46:15 2010
(r216079)
@@ -150,34 +150,33 @@ sc_set_text_mode(scr_stat *scp, struct t
fontwidth = info.vi_cwidth;
 if (fontsize = 0)
fontsize = info.vi_cheight;
-if (fontsize  14) {
+if (fontsize  14)
fontsize = 8;
-#ifndef SC_NO_FONT_LOADING
-   if (!(scp-sc-fonts_loaded  FONT_8))
-   return EINVAL;
-   font = scp-sc-font_8;
-#else
-   font = NULL;
-#endif
-} else if (fontsize = 16) {
+else if (fontsize = 16)
fontsize = 16;
-#ifndef SC_NO_FONT_LOADING
-   if (!(scp-sc-fonts_loaded  FONT_16))
-   return EINVAL;
-   font = scp-sc-font_16;
-#else
-   font = NULL;
-#endif
-} else {
+else
fontsize = 14;
 #ifndef SC_NO_FONT_LOADING
-   if (!(scp-sc-fonts_loaded  FONT_14))
-   return EINVAL;
+switch (fontsize) {
+case 8:
+   if ((scp-sc-fonts_loaded  FONT_8) == 0)
+   return (EINVAL);
+   font = scp-sc-font_8;
+   break;
+case 14:
+   if ((scp-sc-fonts_loaded  FONT_14) == 0)
+   return (EINVAL);
font = scp-sc-font_14;
+   break;
+case 16:
+   if ((scp-sc-fonts_loaded  FONT_16) == 0)
+   return (EINVAL);
+   font = scp-sc-font_16;
+   break;
+}
 #else
-   font = NULL;
+font = NULL;
 #endif
-}
 if ((xsize = 0) || (xsize  info.vi_width))
xsize = info.vi_width;
 if ((ysize = 0) || (ysize  info.vi_height))
@@ -333,34 +332,33 @@ sc_set_pixel_mode(scr_stat *scp, struct 
 /* adjust argument values */
 if (fontsize = 0)
fontsize = info.vi_cheight;
-if (fontsize  14) {
+if (fontsize  14)
fontsize = 8;
-#ifndef SC_NO_FONT_LOADING
-   if (!(scp-sc-fonts_loaded  FONT_8))
-   return EINVAL;
-   font = scp-sc-font_8;
-#else
-   font = NULL;
-#endif
-} else if (fontsize = 16) {
+else if (fontsize = 16)
fontsize = 16;
-#ifndef SC_NO_FONT_LOADING
-   if (!(scp-sc-fonts_loaded  FONT_16))
-   return EINVAL;
-   font = scp-sc-font_16;
-#else
-   font = NULL;
-#endif
-} else {
+else
fontsize = 14;
 #ifndef SC_NO_FONT_LOADING
-   if (!(scp-sc-fonts_loaded  FONT_14))
-   return EINVAL;
+switch (fontsize) {
+case 8:
+   if ((scp-sc-fonts_loaded  FONT_8) == 0)
+   return (EINVAL);
+   font = scp-sc-font_8;
+   break;
+case 14:
+   if ((scp-sc-fonts_loaded  FONT_14) == 0)
+   return (EINVAL);
font = scp-sc-font_14;
+   break;
+case 16:
+   if ((scp-sc-fonts_loaded  FONT_16) == 0)
+   return (EINVAL);
+   font = scp-sc-font_16;
+   break;
+}
 #else
-   font = NULL;
+font = NULL;
 #endif
-}
 if (xsize = 0)
xsize = info.vi_width/8;
 if (ysize = 0)
___
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: r216080 - head/sys/sparc64/include

2010-11-30 Thread Max Khon
Author: fjoe
Date: Tue Nov 30 16:49:06 2010
New Revision: 216080
URL: http://svn.freebsd.org/changeset/base/216080

Log:
  Change VM_KMEM_SIZE_MAX   to be just (VM_MAX_KERNEL_ADDRESS - 
VM_MIN_KERNEL_ADDRESS)
  
  Suggested by: marius

Modified:
  head/sys/sparc64/include/vmparam.h

Modified: head/sys/sparc64/include/vmparam.h
==
--- head/sys/sparc64/include/vmparam.h  Tue Nov 30 16:46:15 2010
(r216079)
+++ head/sys/sparc64/include/vmparam.h  Tue Nov 30 16:49:06 2010
(r216080)
@@ -240,8 +240,7 @@
  * Ceiling on amount of kmem_map kva space.
  */
 #ifndef VM_KMEM_SIZE_MAX
-#defineVM_KMEM_SIZE_MAX((VM_MAX_KERNEL_ADDRESS - \
-VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
+#defineVM_KMEM_SIZE_MAX(VM_MAX_KERNEL_ADDRESS - 
VM_MIN_KERNEL_ADDRESS)
 #endif
 
 /*
___
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: r216016 - head/sys/sparc64/include

2010-11-30 Thread Max Khon
Marius,

On Tue, Nov 30, 2010 at 1:24 AM, Marius Strobl mar...@alchemy.franken.dewrote:


   On Sun, Nov 28, 2010 at 07:26:20PM +, Max Khon wrote:
 Author: fjoe
 Date: Sun Nov 28 19:26:20 2010
 New Revision: 216016
 URL: http://svn.freebsd.org/changeset/base/216016

 Log:
   Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with
   DEBUG_MEMGUARD panics early in kmeminit() with the message
   kmem_suballoc: bad status return of 1 because of zero size
 argument
   passed to kmem_suballoc() due to vm_kmem_size_max being zero.

   The problem also exists on ia64.

 Modified:
   head/sys/sparc64/include/vmparam.h

 Modified: head/sys/sparc64/include/vmparam.h

   
 ==
 --- head/sys/sparc64/include/vmparam.hSun Nov 28 18:59:52
 2010
 (r216015)
 +++ head/sys/sparc64/include/vmparam.hSun Nov 28 19:26:20
 2010
 (r216016)
 @@ -237,6 +237,14 @@
  #endif

  /*
 + * Ceiling on amount of kmem_map kva space.
 + */
 +#ifndef VM_KMEM_SIZE_MAX
 +#define  VM_KMEM_SIZE_MAX((VM_MAX_KERNEL_ADDRESS - \
 +VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
 +#endif
 +
 +/*
   * Initial pagein size of beginning of executable file.
   */
  #ifndef  VM_INITIAL_PAGEIN
   
How was that value determined?
   
  
   I've just copied it from amd64 to be non-zero for now. Do you have a
 better
   idea of what it should look like?
 
  Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted
  to the maximum appropriate for the specific CPU during the early cycles
  of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS -
  VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what
  the intention of the ceiling provided by that macro actually is though


Ok, this sounds reasonable. I changed it to be just  (VM_MAX_KERNEL_ADDRESS
- VM_MIN_KERNEL_ADDRESS)

 In any case, the commit message of r180210 which changed the amd64
  version to the current one talks about limiting the kmem map to 3.6GB
  and while it also fails to explain where that value comes from it
  looks rather amd64 specific and the formula used by the macro will
  result in a different ceiling on sparc64 and thus inappropriate. I've
  CC'ed alc@ who hopefully can shed some light on this.
  Apart from this the actual bug here seems to be that memguard_fudge()
  can't deal with a km_max being zero or that zero is passed to it as
  kmeminit() allows for VM_KMEM_SIZE_MAX not being defined.


I thought about fixing memguard_fudge() too, but defining VM_KMEM_SIZE_MAX
seemed to be less intrusive change to me.

Max
___
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: r216081 - head/sys/dev/syscons

2010-11-30 Thread Jung-uk Kim
Author: jkim
Date: Tue Nov 30 17:32:28 2010
New Revision: 216081
URL: http://svn.freebsd.org/changeset/base/216081

Log:
  Stop hardcoding default font size.

Modified:
  head/sys/dev/syscons/syscons.c

Modified: head/sys/dev/syscons/syscons.c
==
--- head/sys/dev/syscons/syscons.c  Tue Nov 30 16:49:06 2010
(r216080)
+++ head/sys/dev/syscons/syscons.c  Tue Nov 30 17:32:28 2010
(r216081)
@@ -382,7 +382,7 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc
 #if !defined(SC_NO_FONT_LOADING)  defined(SC_DFLT_FONT)
font_size = info.vi_cheight;
 #else
-   font_size = 16;
+   font_size = scp-font_size;
 #endif
if (font_size  14)
font_size = 8;
___
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: r216082 - head/sys/dev/syscons

2010-11-30 Thread Jung-uk Kim
Author: jkim
Date: Tue Nov 30 17:34:15 2010
New Revision: 216082
URL: http://svn.freebsd.org/changeset/base/216082

Log:
  Rename a variable to match scvidctl.c.

Modified:
  head/sys/dev/syscons/syscons.c

Modified: head/sys/dev/syscons/syscons.c
==
--- head/sys/dev/syscons/syscons.c  Tue Nov 30 17:32:28 2010
(r216081)
+++ head/sys/dev/syscons/syscons.c  Tue Nov 30 17:34:15 2010
(r216082)
@@ -350,7 +350,7 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc
video_info_t info;
u_char *font;
int depth;
-   int font_size;
+   int fontsize;
int i;
int vmode;
 
@@ -380,18 +380,18 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc
}
 
 #if !defined(SC_NO_FONT_LOADING)  defined(SC_DFLT_FONT)
-   font_size = info.vi_cheight;
+   fontsize = info.vi_cheight;
 #else
-   font_size = scp-font_size;
+   fontsize = scp-font_size;
 #endif
-   if (font_size  14)
-   font_size = 8;
-   else if (font_size = 16)
-   font_size = 16;
+   if (fontsize  14)
+   fontsize = 8;
+   else if (fontsize = 16)
+   fontsize = 16;
else
-   font_size = 14;
+   fontsize = 14;
 #ifndef SC_NO_FONT_LOADING
-   switch (font_size) {
+   switch (fontsize) {
case 8:
if ((sc-fonts_loaded  FONT_8) == 0)
return;
@@ -428,12 +428,12 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc
scp-xpixel = info.vi_width;
scp-ypixel = info.vi_height;
scp-xsize = scp-xpixel / 8;
-   scp-ysize = scp-ypixel / font_size;
+   scp-ysize = scp-ypixel / fontsize;
scp-xpos = 0;
scp-ypos = scp-ysize - 1;
scp-xoff = scp-yoff = 0;
scp-font = font;
-   scp-font_size = font_size;
+   scp-font_size = fontsize;
scp-font_width = 8;
scp-start = scp-xsize * scp-ysize - 1;
scp-end = 0;
___
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: r216083 - head/sys/powerpc/powermac

2010-11-30 Thread Marius Strobl
Author: marius
Date: Tue Nov 30 20:54:14 2010
New Revision: 216083
URL: http://svn.freebsd.org/changeset/base/216083

Log:
  Several chipset drivers alter parameters relevant for the DMA tag creation,
  i.e. alignment, max_address, max_iosize and segsize (only max_address is
  thought to have an negative impact regarding this issue though), after
  calling ata_dmainit() either directly or indirectly so these values have
  no effect or at least no effect on the DMA tags and the defaults are used
  for the latter instead. So change the drivers to set these parameters
  up-front and ata_dmainit() to honor them.
  
  This file was missed in r216013.
  
  Submitted by: nwhitehorn

Modified:
  head/sys/powerpc/powermac/ata_dbdma.c

Modified: head/sys/powerpc/powermac/ata_dbdma.c
==
--- head/sys/powerpc/powermac/ata_dbdma.c   Tue Nov 30 17:34:15 2010
(r216082)
+++ head/sys/powerpc/powermac/ata_dbdma.c   Tue Nov 30 20:54:14 2010
(r216083)
@@ -268,7 +268,6 @@ ata_dbdma_dmainit(device_t dev)
dbdma_insert_stop(sc-dbdma,0);
sc-next_dma_slot=1;
 
-   ata_dmainit(dev);
sc-sc_ch.dma.start = ata_dbdma_start;
sc-sc_ch.dma.stop = ata_dbdma_stop;
sc-sc_ch.dma.load = ata_dbdma_load;
@@ -279,9 +278,9 @@ ata_dbdma_dmainit(device_t dev)
 * if we try to do a 64K transfer, so stop short of 64K.
 */
sc-sc_ch.dma.segsize = 126 * DEV_BSIZE;
+   ata_dmainit(dev);
 
sc-sc_ch.hw.status = ata_dbdma_status;
 
mtx_init(sc-dbdma_mtx, ATA DBDMA, NULL, MTX_DEF);
 }
-
___
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: r216084 - head/sys/cddl/compat/opensolaris/kern

2010-11-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Nov 30 21:04:05 2010
New Revision: 216084
URL: http://svn.freebsd.org/changeset/base/216084

Log:
  Don't panic when we read an empty ACL from ZFS.  Apparently this may happen
  with filesystems created under MacOS X ZFS port.  This is kind of filesystem
  corruption (we don't allow for setting empty ACLs), so make acl_get_file(3)
  and related syscalls fail with EINVAL in that case.  In theory, we could
  return empty ACL to userland, but I'm afraid this would break some code.
  
  MFC after:3 days

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Tue Nov 30 
20:54:14 2010(r216083)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Tue Nov 30 
21:04:05 2010(r216084)
@@ -105,7 +105,10 @@ acl_from_aces(struct acl *aclp, const ac
struct acl_entry *entry;
const ace_t *ace;
 
-   KASSERT(nentries = 1, (empty ZFS ACL));
+   if (nentries  1) {
+   printf(acl_from_aces: empty ZFS ACL; returning EINVAL.\n);
+   return (EINVAL);
+   }
 
if (nentries  ACL_MAX_ENTRIES) {
/*
___
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: r216085 - head/sys/dev/bge

2010-11-30 Thread Marius Strobl
Author: marius
Date: Tue Nov 30 21:08:59 2010
New Revision: 216085
URL: http://svn.freebsd.org/changeset/base/216085

Log:
  - Remove the remaining support for older (in this case pre-7.0-RELEASE)
versions of FreeBSD. In fact we are already missing a lot of conditional
code necessary to support older versions of FreeBSD, including alternatives
for vital functionality not yet provided by the respective subsystem back
then (see for example r199663). So this change shouldn't actually break
this driver on versions of FreeBSD that were supported before. Besides,
this driver also isn't maintained as an multi-release version outside of
the main repository, so removing the conditional code shouldn't be a
problem in that regard either.
  - Sprinkle some more const on tables.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Tue Nov 30 21:04:05 2010(r216084)
+++ head/sys/dev/bge/if_bge.c   Tue Nov 30 21:08:59 2010(r216085)
@@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1);
 static const struct bge_type {
uint16_tbge_vid;
uint16_tbge_did;
-} bge_devs[] = {
+} const bge_devs[] = {
{ ALTEON_VENDORID,  ALTEON_DEVICEID_BCM5700 },
{ ALTEON_VENDORID,  ALTEON_DEVICEID_BCM5701 },
 
@@ -232,7 +232,7 @@ static const struct bge_type {
 static const struct bge_vendor {
uint16_tv_id;
const char  *v_name;
-} bge_vendors[] = {
+} const bge_vendors[] = {
{ ALTEON_VENDORID,  Alteon },
{ ALTIMA_VENDORID,  Altima },
{ APPLE_VENDORID,   Apple },
@@ -247,7 +247,7 @@ static const struct bge_vendor {
 static const struct bge_revision {
uint32_tbr_chipid;
const char  *br_name;
-} bge_revisions[] = {
+} const bge_revisions[] = {
{ BGE_CHIPID_BCM5700_A0,BCM5700 A0 },
{ BGE_CHIPID_BCM5700_A1,BCM5700 A1 },
{ BGE_CHIPID_BCM5700_B0,BCM5700 B0 },
@@ -317,7 +317,7 @@ static const struct bge_revision {
  * Some defaults for major revisions, so that newer steppings
  * that we don't know about have a shot at working.
  */
-static const struct bge_revision bge_majorrevs[] = {
+static const struct bge_revision const bge_majorrevs[] = {
{ BGE_ASICREV_BCM5700,  unknown BCM5700 },
{ BGE_ASICREV_BCM5701,  unknown BCM5701 },
{ BGE_ASICREV_BCM5703,  unknown BCM5703 },
@@ -2143,20 +2143,21 @@ bge_lookup_vendor(uint16_t vid)
 static int
 bge_probe(device_t dev)
 {
-   const struct bge_type *t = bge_devs;
+   char buf[96];
+   char model[64];
+   const struct bge_revision *br;
+   const char *pname;
struct bge_softc *sc = device_get_softc(dev);
-   uint16_t vid, did;
+   const struct bge_type *t = bge_devs;
+   const struct bge_vendor *v;
+   uint32_t id;
+   uint16_t did, vid;
 
sc-bge_dev = dev;
vid = pci_get_vendor(dev);
did = pci_get_device(dev);
while(t-bge_vid != 0) {
if ((vid == t-bge_vid)  (did == t-bge_did)) {
-   char model[64], buf[96];
-   const struct bge_revision *br;
-   const struct bge_vendor *v;
-   uint32_t id;
-
id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) 
BGE_PCIMISCCTL_ASICREV_SHIFT;
if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) {
@@ -2177,20 +2178,13 @@ bge_probe(device_t dev)
}
br = bge_lookup_rev(id);
v = bge_lookup_vendor(vid);
-   {
-#if __FreeBSD_version  700024
-   const char *pname;
-
-   if (bge_has_eaddr(sc) 
-   pci_get_vpd_ident(dev, pname) == 0)
-   snprintf(model, 64, %s, pname);
-   else
-#endif
-   snprintf(model, 64, %s %s,
-   v-v_name,
-   br != NULL ? br-br_name :
-   NetXtreme Ethernet Controller);
-   }
+   if (bge_has_eaddr(sc) 
+   pci_get_vpd_ident(dev, pname) == 0)
+   snprintf(model, 64, %s, pname);
+   else
+   snprintf(model, 64, %s %s, v-v_name,
+   br != NULL ? br-br_name :
+   NetXtreme Ethernet Controller);
snprintf(buf, 96, %s, %sASIC rev. %#08x, model,
br != NULL ?  : unknown , 

svn commit: r216086 - head/lib/libc/stdio

2010-11-30 Thread David Schultz
Author: das
Date: Tue Nov 30 21:26:21 2010
New Revision: 216086
URL: http://svn.freebsd.org/changeset/base/216086

Log:
  Update the documentation to reflect changes to the implementation in
  r197752, which is related to handling of null buffer pointers.  Also
  make a few minor wording changes.
  
  Reported by:  jh@

Modified:
  head/lib/libc/stdio/getline.3

Modified: head/lib/libc/stdio/getline.3
==
--- head/lib/libc/stdio/getline.3   Tue Nov 30 21:08:59 2010
(r216085)
+++ head/lib/libc/stdio/getline.3   Tue Nov 30 21:26:21 2010
(r216086)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd March 29, 2009
+.Dd November 30, 2010
 .Dt GETLINE 3
 .Os
 .Sh NAME
@@ -54,23 +54,23 @@ function is equivalent to
 with the newline character as the delimiter.
 The delimiter character is included as part of the line, unless
 the end of the file is reached.
-The caller may provide a pointer to a malloc buffer for the line in
+.Pp
+The caller may provide a pointer to a malloced buffer for the line in
 .Fa *linep ,
 and the capacity of that buffer in
-.Fa *linecapp ;
-if
-.Fa *linecapp
-is 0, then
-.Fa *linep
-is treated as
-.Dv NULL .
-These functions may expand the buffer as needed, as if via
-.Fn realloc ,
-and update
+.Fa *linecapp .
+These functions expand the buffer as needed, as if via
+.Fn realloc .
+If
+.Fa linep
+points to a
+.Dv NULL
+pointer, a new buffer will be allocated.
+In either case,
 .Fa *linep
 and
 .Fa *linecapp
-accordingly.
+will be updated accordingly.
 .Sh RETURN VALUES
 The
 .Fn getdelim
@@ -140,7 +140,7 @@ No delimiter was found in the first
 characters.
 .El
 .Pp
-These functions may also fail for any of the errors specified for
+These functions may also fail due to any of the errors specified for
 .Fn fgets
 and
 .Fn malloc .
___
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: r216087 - stable/8/sys/kern

2010-11-30 Thread Justin T. Gibbs
Author: gibbs
Date: Tue Nov 30 22:25:44 2010
New Revision: 216087
URL: http://svn.freebsd.org/changeset/base/216087

Log:
  Merge revision 211236 form current:
  
  Allow interrupt driven config hooks to be registered from config hook 
callbacks.
  
  Interrupt driven configuration hooks serve two purposes: they are a
  mechanism for registering for a callback that is invoked once interrupt
  services are available, and they hold off root device selection so long
  as any configuration hooks are still active.  Before this change, it was
  not possible to safely register additional hooks from the context of a
  configuration hook callback.  The need for this feature arises when
  interrupts are required to discover new devices (e.g. access to the XenStore
  to find para-virtualized devices) which in turn also require the ability
  to hold off root device selection until some lengthy, interrupt driven,
  configuration task has completed (e.g. Xen front/back device driver
  negotiation).
  
  More specifically, the mutex protecting the list of active configuration
  hooks is never held during a callback, and static information is used
  to ensure proper ordering and only a single callback to each hook even
  when faced with registration or removal of a hook during an active run.
  
  Sponsored by: Spectra Logic Corporation
  Approved by:  re (kib)

Modified:
  stable/8/sys/kern/subr_autoconf.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/kern/subr_autoconf.c
==
--- stable/8/sys/kern/subr_autoconf.c   Tue Nov 30 21:26:21 2010
(r216086)
+++ stable/8/sys/kern/subr_autoconf.c   Tue Nov 30 22:25:44 2010
(r216087)
@@ -55,11 +55,12 @@ __FBSDID($FreeBSD$);
  */
 static TAILQ_HEAD(, intr_config_hook) intr_config_hook_list =
TAILQ_HEAD_INITIALIZER(intr_config_hook_list);
+static struct intr_config_hook *next_to_notify;
 static struct mtx intr_config_hook_lock;
 MTX_SYSINIT(intr_config_hook, intr_config_hook_lock, intr config, MTX_DEF);
 
 /* ARGSUSED */
-static void run_interrupt_driven_config_hooks(void *dummy);
+static void run_interrupt_driven_config_hooks(void);
 
 /*
  * If we wait too long for an interrupt-driven config hook to return, print
@@ -91,19 +92,46 @@ run_interrupt_driven_config_hooks_warnin
 }
 
 static void
-run_interrupt_driven_config_hooks(void *dummy)
+run_interrupt_driven_config_hooks()
 {
-   struct intr_config_hook *hook_entry, *next_entry;
-   int warned;
+   static int running;
+   struct intr_config_hook *hook_entry;
 
mtx_lock(intr_config_hook_lock);
-   TAILQ_FOREACH_SAFE(hook_entry, intr_config_hook_list, ich_links,
-   next_entry) {
+
+   /*
+* If hook processing is already active, any newly
+* registered hooks will eventually be notified.
+* Let the currently running session issue these
+* notifications.
+*/
+   if (running != 0) {
+   mtx_unlock(intr_config_hook_lock);
+   return;
+   }
+   running = 1;
+
+   while (next_to_notify != NULL) {
+   hook_entry = next_to_notify;
+   next_to_notify = TAILQ_NEXT(hook_entry, ich_links);
mtx_unlock(intr_config_hook_lock);
(*hook_entry-ich_func)(hook_entry-ich_arg);
mtx_lock(intr_config_hook_lock);
}
 
+   running = 0;
+   mtx_unlock(intr_config_hook_lock);
+}
+
+static void
+boot_run_interrupt_driven_config_hooks(void *dummy)
+{
+   int warned;
+
+   run_interrupt_driven_config_hooks();
+
+   /* Block boot processing until all hooks are disestablished. */
+   mtx_lock(intr_config_hook_lock);
warned = 0;
while (!TAILQ_EMPTY(intr_config_hook_list)) {
if (msleep(intr_config_hook_list, intr_config_hook_lock,
@@ -117,8 +145,9 @@ run_interrupt_driven_config_hooks(void *
}
mtx_unlock(intr_config_hook_lock);
 }
+
 SYSINIT(intr_config_hooks, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST,
-   run_interrupt_driven_config_hooks, NULL);
+   boot_run_interrupt_driven_config_hooks, NULL);
 
 /*
  * Register a hook that will be called after cold
@@ -141,10 +170,16 @@ config_intrhook_establish(struct intr_co
return (1);
}
TAILQ_INSERT_TAIL(intr_config_hook_list, hook, ich_links);
+   if (next_to_notify == NULL)
+   next_to_notify = hook;
mtx_unlock(intr_config_hook_lock);
if (cold == 0)
+   /*
+* XXX Call from a task since not all drivers expect
+* to be re-entered at the time a hook is established.
+*/
/* XXX Sufficient for modules loaded after initial config??? */
-   run_interrupt_driven_config_hooks(NULL);
+   run_interrupt_driven_config_hooks();
return (0);
 }
 
@@ 

Re: svn commit: r216075 - in head: sys/netinet usr.sbin/arp

2010-11-30 Thread Jilles Tjoelker
On Tue, Nov 30, 2010 at 03:57:00PM +, Gleb Smirnoff wrote:
 Author: glebius
 Date: Tue Nov 30 15:57:00 2010
 New Revision: 216075
 URL: http://svn.freebsd.org/changeset/base/216075

 Log:
   Use time_uptime instead of non-monotonic time_second to drive ARP
   timeouts.

   Suggested by:   bde

 Modified:
   head/sys/netinet/if_ether.c
   head/sys/netinet/in.c
   head/usr.sbin/arp/arp.c

 Modified: head/usr.sbin/arp/arp.c
 ==
 --- head/usr.sbin/arp/arp.c   Tue Nov 30 09:34:47 2010(r216074)
 +++ head/usr.sbin/arp/arp.c   Tue Nov 30 15:57:00 2010(r216075)
 @@ -602,10 +602,10 @@ print_entry(struct sockaddr_dl *sdl,
   if (rtm-rtm_rmx.rmx_expire == 0)
   printf( permanent);
   else {
 - static struct timeval tv;
 - if (tv.tv_sec == 0)
 - gettimeofday(tv, 0);
 - if ((expire_time = rtm-rtm_rmx.rmx_expire - tv.tv_sec)  0)
 + static struct timespec tp;
 + if (tp.tv_sec == 0)
 + clock_gettime(CLOCK_MONOTONIC, tp);
 + if ((expire_time = rtm-rtm_rmx.rmx_expire - tp.tv_sec)  0)
   printf( expires in %d seconds, (int)expire_time);
   else
   printf( expired);

Hmm, doesn't this break the API between arp(8) and the kernel?
Assuming we care, perhaps arp(8) should send/receive realtime, converted
at the time it requests the data. The kernel can then continue to use
monotonic time internally (which I agree is better).

-- 
Jilles Tjoelker
___
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: r216088 - in head: lib/libcam sbin/camcontrol sys/cam sys/cam/scsi sys/conf sys/dev/mps sys/sys

2010-11-30 Thread Kenneth D. Merry
Author: ken
Date: Tue Nov 30 22:39:46 2010
New Revision: 216088
URL: http://svn.freebsd.org/changeset/base/216088

Log:
  Add Serial Management Protocol (SMP) passthrough support to CAM.
  
  This includes support in the kernel, camcontrol(8), libcam and the mps(4)
  driver for SMP passthrough.
  
  The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00
  to determine supported pages, and will now fetch page 0x83 in addition to
  page 0x80 if supported.
  
  Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO.  The SMP CCB is
  intended for SMP requests and responses.  The ADVINFO is currently used to
  fetch cached VPD page 0x83 data from the transport layer, but is intended
  to be extensible to fetch other types of device-specific data.
  
  SMP-only devices are not currently represented in the CAM topology, and so
  the current semantics are that the SIM will route SMP CCBs to either the
  addressed device, if it contains an SMP target, or its parent, if it
  contains an SMP target.  (This is noted in cam_ccb.h, since it will change
  later once we have the ability to have SMP-only devices in CAM's topology.)
  
  smp_all.c,
  smp_all.h:New helper routines for SMP.  This includes
SMP request building routines, response parsing
routines, error decoding routines, and structure
definitions for a number of SMP commands.
  
  libcam/Makefile:  Add smp_all.c to libcam, so that SMP functionality
is available to userland applications.
  
  camcontrol.8,
  camcontrol.c: Add smp passthrough support to camcontrol.  Several
new subcommands are now available:
  
'smpcmd' functions much like 'cmd', except that it
allows the user to send generic SMP commands.
  
'smprg' sends the SMP report general command, and
displays the decoded output.  It will automatically
fetch extended output if it is available.
  
'smppc' sends the SMP phy control command, with any
number of potential options.  Among other things,
this allows the user to reset a phy on a SAS
expander, or disable a phy on an expander.
  
'smpmaninfo' sends the SMP report manufacturer
information and displays the decoded output.
  
'smpphylist' displays a list of phys on an
expander, and the CAM devices attached to those
phys, if any.
  
  cam.h,
  cam.c:Add a status value for SMP errors
(CAM_SMP_STATUS_ERROR).
  
Add a missing description for CAM_SCSI_IT_NEXUS_LOST.
  
Add support for SMP commands to cam_error_string().
  
  cam_ccb.h:Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH.  SMP
commands are by nature bi-directional, and we may
need to support bi-directional SCSI commands later.
  
Add the XPT_SMP_IO CCB.  Since SMP commands are
bi-directional, there are pointers for both the
request and response.
  
Add a fill routine for SMP CCBs.
  
Add the XPT_GDEV_ADVINFO CCB.  This is currently
used to fetch cached page 0x83 data from the
transport later, but is extensible to fetch many
other types of data.
  
  cam_periph.c: Add support in cam_periph_mapmem() for XPT_SMP_IO
and XPT_GDEV_ADVINFO CCBs.
  
  cam_xpt.c:Add support for executing XPT_SMP_IO CCBs.
  
  cam_xpt_internal.h:   Add fields for VPD pages 0x00 and 0x83 in struct
cam_ed.
  
  scsi_all.c:   Add scsi_get_sas_addr(), a function that parses
VPD page 0x83 data and pulls out a SAS address.
  
  scsi_all.h:   Add VPD page 0x00 and 0x83 structures, and a
prototype for scsi_get_sas_addr().
  
  scsi_pass.c:  Add support for mapping buffers in XPT_SMP_IO and
XPT_GDEV_ADVINFO CCBs.
  
  scsi_xpt.c:   In the SCSI probe code, first ask the device for
VPD page 0x00.  If any VPD pages are supported,
that page is required to be implemented.  Based on
the response, we may probe for the serial number
(page 0x80) or device id (page 0x83).
  
Add support for the XPT_GDEV_ADVINFO CCB.
  
  sys/conf/files:   Add smp_all.c.
  
  mps.c:Add support for passing in 

svn commit: r216089 - head/sbin/ifconfig

2010-11-30 Thread Weongyo Jeong
Author: weongyo
Date: Wed Dec  1 03:24:38 2010
New Revision: 216089
URL: http://svn.freebsd.org/changeset/base/216089

Log:
  Don't print usbus[0-9] interfaces that it's not the interesting
  interface type for ifconfig(8).

Modified:
  head/sbin/ifconfig/ifconfig.c

Modified: head/sbin/ifconfig/ifconfig.c
==
--- head/sbin/ifconfig/ifconfig.c   Tue Nov 30 22:39:46 2010
(r216088)
+++ head/sbin/ifconfig/ifconfig.c   Wed Dec  1 03:24:38 2010
(r216089)
@@ -295,6 +295,8 @@ main(int argc, char *argv[])
sdl = (const struct sockaddr_dl *) ifa-ifa_addr;
else
sdl = NULL;
+   if (sdl != NULL  sdl-sdl_type == IFT_USB)
+   continue;
if (cp != NULL  strcmp(cp, ifa-ifa_name) == 0  !namesonly)
continue;
iflen = strlcpy(name, ifa-ifa_name, sizeof(name));
___
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: r216090 - head/sys/vm

2010-11-30 Thread Alan Cox
Author: alc
Date: Wed Dec  1 03:35:19 2010
New Revision: 216090
URL: http://svn.freebsd.org/changeset/base/216090

Log:
  Correct an error in the allocation of the vm_page_dump array in
  vm_page_startup().  Specifically, the dump_avail array should be used
  instead of the phys_avail array to calculate the size of vm_page_dump.  For
  example, the pages for the message buffer are allocated prior to
  vm_page_startup() by subtracting them from the last entry in the phys_avail
  array, but the first thing that vm_page_startup() does after creating the
  vm_page_dump array is to set the bits corresponding to the message buffer
  pages in that array.  However, these bits might not actually exist in the
  array, because the size of the array is determined by the current value in
  the last entry of the phys_avail array.  In general, the only reason why
  this doesn't always result in an out-of-bounds array access is that the size
  of the vm_page_dump array is rounded up to the next page boundary.  This
  change eliminates that dependence on rounding (and luck).
  
  MFC after:6 weeks

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Dec  1 03:24:38 2010(r216089)
+++ head/sys/vm/vm_page.c   Wed Dec  1 03:35:19 2010(r216090)
@@ -282,7 +282,6 @@ vm_page_startup(vm_offset_t vaddr)
vm_paddr_t new_end;
int i;
vm_paddr_t pa;
-   int nblocks;
vm_paddr_t last_pa;
char *list;
 
@@ -294,7 +293,6 @@ vm_page_startup(vm_offset_t vaddr)
 
biggestsize = 0;
biggestone = 0;
-   nblocks = 0;
vaddr = round_page(vaddr);
 
for (i = 0; phys_avail[i + 1]; i += 2) {
@@ -316,7 +314,6 @@ vm_page_startup(vm_offset_t vaddr)
low_water = phys_avail[i];
if (phys_avail[i + 1]  high_water)
high_water = phys_avail[i + 1];
-   ++nblocks;
}
 
 #ifdef XEN
@@ -372,7 +369,11 @@ vm_page_startup(vm_offset_t vaddr)
 * minidump code.  In theory, they are not needed on i386, but are
 * included should the sf_buf code decide to use them.
 */
-   page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE;
+   last_pa = 0;
+   for (i = 0; dump_avail[i + 1] != 0; i += 2)
+   if (dump_avail[i + 1]  last_pa)
+   last_pa = dump_avail[i + 1];
+   page_range = last_pa / PAGE_SIZE;
vm_page_dump_size = round_page(roundup2(page_range, NBBY) / NBBY);
new_end -= vm_page_dump_size;
vm_page_dump = (void *)(uintptr_t)pmap_map(vaddr, new_end,
___
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: r216091 - head/sys/dev/usb

2010-11-30 Thread Weongyo Jeong
Author: weongyo
Date: Wed Dec  1 03:51:06 2010
New Revision: 216091
URL: http://svn.freebsd.org/changeset/base/216091

Log:
  Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
  or detached.  Normally it should be changed through user land ioctl(2)
  system calls but it looks there's no apps for USB and no need.
  
  With this patch, libpcap would detect the usbus interfaces correctly and
  tcpdump(1) could dump the USB packets into PCAP format with -w option.
  However it couldn't print the output to console because there's no
  printer-routine at tcpdump(1).

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Wed Dec  1 03:35:19 2010(r216090)
+++ head/sys/dev/usb/usb_pf.c   Wed Dec  1 03:51:06 2010(r216091)
@@ -65,6 +65,7 @@ usbpf_attach(struct usb_bus *ubus)
ifp = ubus-ifp = if_alloc(IFT_USB);
if_initname(ifp, usbus, device_get_unit(ubus-bdev));
if_attach(ifp);
+   if_up(ifp);
 
KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
(wrong USB pf header length (%zd), sizeof(struct usbpf_pkthdr)));
@@ -86,6 +87,7 @@ usbpf_detach(struct usb_bus *ubus)
 
if (ifp != NULL) {
bpfdetach(ifp);
+   if_down(ifp);
if_detach(ifp);
if_free(ifp);
}
___
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: r216092 - head/sys/mips/cavium

2010-11-30 Thread Juli Mallett
Author: jmallett
Date: Wed Dec  1 05:24:29 2010
New Revision: 216092
URL: http://svn.freebsd.org/changeset/base/216092

Log:
  Add interrupt describing and binding to CIU.

Modified:
  head/sys/mips/cavium/ciu.c

Modified: head/sys/mips/cavium/ciu.c
==
--- head/sys/mips/cavium/ciu.c  Wed Dec  1 03:51:06 2010(r216091)
+++ head/sys/mips/cavium/ciu.c  Wed Dec  1 05:24:29 2010(r216092)
@@ -37,6 +37,7 @@ __FBSDID($FreeBSD$);
 #include sys/module.h
 #include sys/rman.h
 #include sys/malloc.h
+#include sys/smp.h
 
 #include machine/bus.h
 #include machine/intr_machdep.h
@@ -80,13 +81,24 @@ static int  ciu_setup_intr(device_t, dev
   void *, void **);
 static int ciu_teardown_intr(device_t, device_t,
  struct resource *, void *);
+static int ciu_bind_intr(device_t, device_t, struct resource *,
+ int);
+static int ciu_describe_intr(device_t, device_t,
+ struct resource *, void *,
+ const char *);
 static voidciu_hinted_child(device_t, const char *, int);
 
 static voidciu_en0_intr_mask(void *);
 static voidciu_en0_intr_unmask(void *);
+#ifdef SMP
+static int ciu_en0_intr_bind(void *, u_char);
+#endif
 
 static voidciu_en1_intr_mask(void *);
 static voidciu_en1_intr_unmask(void *);
+#ifdef SMP
+static int ciu_en1_intr_bind(void *, u_char);
+#endif
 
 static int ciu_intr(void *);
 
@@ -196,6 +208,7 @@ ciu_setup_intr(device_t bus, device_t ch
struct intr_event *event, **eventp;
void (*mask_func)(void *);
void (*unmask_func)(void *);
+   int (*bind_func)(void *, u_char);
mips_intrcnt_t intrcnt;
int error;
int irq;
@@ -206,16 +219,25 @@ ciu_setup_intr(device_t bus, device_t ch
intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN];
mask_func = ciu_en0_intr_mask;
unmask_func = ciu_en0_intr_unmask;
+#ifdef SMP
+   bind_func = ciu_en0_intr_bind;
+#endif
} else {
eventp = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN];
intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN];
mask_func = ciu_en1_intr_mask;
unmask_func = ciu_en1_intr_unmask;
+#ifdef SMP
+   bind_func = ciu_en1_intr_bind;
+#endif
}
+#if !defined(SMP)
+   bind_func = NULL;
+#endif
 
if ((event = *eventp) == NULL) {
error = intr_event_create(eventp, (void *)(uintptr_t)irq, 0,
-   irq, mask_func, unmask_func, NULL, NULL, int%d, irq);
+   irq, mask_func, unmask_func, NULL, bind_func, int%d, irq);
if (error != 0)
return (error);
 
@@ -245,6 +267,50 @@ ciu_teardown_intr(device_t bus, device_t
return (0);
 }
 
+#ifdef SMP
+static int
+ciu_bind_intr(device_t bus, device_t child, struct resource *res, int cpu)
+{
+   struct intr_event *event;
+   int irq;
+   
+   irq = rman_get_start(res);
+   if (irq = CIU_IRQ_EN0_END)
+   event = ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN];
+   else
+   event = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN];
+
+   return (intr_event_bind(event, cpu));
+}
+#endif
+
+static int
+ciu_describe_intr(device_t bus, device_t child, struct resource *res,
+ void *cookie, const char *descr)
+{
+   struct intr_event *event;
+   mips_intrcnt_t intrcnt;
+   int error;
+   int irq;
+   
+   irq = rman_get_start(res);
+   if (irq = CIU_IRQ_EN0_END) {
+   event = ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN];
+   intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN];
+   } else {
+   event = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN];
+   intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN];
+   }
+
+   error = intr_event_describe_handler(event, cookie, descr);
+   if (error != 0)
+   return (error);
+
+   mips_intrcnt_setname(intrcnt, event-ie_fullname);
+
+   return (0);
+}
+
 static void
 ciu_hinted_child(device_t bus, const char *dname, int dunit)
 {
@@ -275,6 +341,28 @@ ciu_en0_intr_unmask(void *arg)
cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), mask);
 }
 
+#ifdef SMP
+static int
+ciu_en0_intr_bind(void *arg, u_char target)
+{
+   uint64_t mask;
+   int core;
+   int irq;
+
+   irq = (uintptr_t)arg;
+   CPU_FOREACH(core) {
+   mask = cvmx_read_csr(CVMX_CIU_INTX_EN0(core*2));
+   if (core == target)
+   mask |= 1ull  (irq - CIU_IRQ_EN0_BEGIN);
+   else
+   

svn commit: r216093 - head/sys/modules/cam

2010-11-30 Thread Kenneth D. Merry
Author: ken
Date: Wed Dec  1 05:39:02 2010
New Revision: 216093
URL: http://svn.freebsd.org/changeset/base/216093

Log:
  Add smp_all.c to the cam module build to un-break it.
  
  Reported by:  jkim

Modified:
  head/sys/modules/cam/Makefile

Modified: head/sys/modules/cam/Makefile
==
--- head/sys/modules/cam/Makefile   Wed Dec  1 05:24:29 2010
(r216092)
+++ head/sys/modules/cam/Makefile   Wed Dec  1 05:39:02 2010
(r216093)
@@ -25,6 +25,7 @@ SRCS+=scsi_ses.c
 SRCS+= scsi_sg.c
 SRCS+= scsi_targ_bh.c scsi_target.c
 SRCS+= scsi_xpt.c
+SRCS+= smp_all.c
 SRCS+= ata_all.c
 SRCS+= ata_xpt.c
 SRCS+= ata_da.c
___
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: r216094 - head/sys/ia64/include

2010-11-30 Thread Alan Cox
Author: alc
Date: Wed Dec  1 05:52:27 2010
New Revision: 216094
URL: http://svn.freebsd.org/changeset/base/216094

Log:
  phys_avail[] is correctly defined as an array of vm_paddr_t's in
  machdep.c.  Use that same type, and not vm_offset_t, in this include file.

Modified:
  head/sys/ia64/include/pmap.h

Modified: head/sys/ia64/include/pmap.h
==
--- head/sys/ia64/include/pmap.hWed Dec  1 05:39:02 2010
(r216093)
+++ head/sys/ia64/include/pmap.hWed Dec  1 05:52:27 2010
(r216094)
@@ -112,7 +112,7 @@ typedef struct pv_entry {
 
 #ifdef _KERNEL
 
-extern vm_offset_t phys_avail[];
+extern vm_paddr_t phys_avail[];
 extern vm_offset_t virtual_avail;
 extern vm_offset_t virtual_end;
 
___
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: r215237 - head/lib/msun/src

2010-11-30 Thread David Schultz
On Mon, Nov 15, 2010, Bruce Evans wrote:
 On Mon, 15 Nov 2010, Alexander Best wrote:
 
 also it seems one of the regression tests in tools/regression/lib/msun 
 fails
 (assert tripped): test-lrint.

The test is failing due to an actual deficiency in gcc; you need
to disable the built-in versions of lrint and friends for it to
pass.  I considered working around that in the test (as in
test-conj.c) and tricking the compiler into using the library
versions, but that really just hides the problem.

 I get this on amd64, and lots more failures starting with csqrt() on
 i386.

Yes, some work is needed to deal with i386's special precision
issues.  As you know, it's often hard to get gcc to even produce
the right code on i386, and I didn't spend an inordinate amount of
effort trying to get tests for long doubles to pass on that
platform.
___
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