svn commit: r230859 - head/sys/modules

2012-01-31 Thread Justin Hibbits
Author: jhibbits
Date: Wed Feb  1 03:42:14 2012
New Revision: 230859
URL: http://svn.freebsd.org/changeset/base/230859

Log:
  Enable the pccard/cardbus modules for powerpc.
  
  Approved by:  nwhitehorn (mentor)

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Wed Feb  1 03:28:19 2012(r230858)
+++ head/sys/modules/Makefile   Wed Feb  1 03:42:14 2012(r230859)
@@ -707,9 +707,12 @@ _xe=   xe
 _agp=  agp
 _an=   an
 _bm=   bm
+_cardbus=  cardbus
+_cbb=  cbb
 _cfi=  cfi
 _cpufreq=  cpufreq
 _nvram=powermac_nvram
+_pccard=   pccard
 _smbfs=smbfs
 _sound=sound
 .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"


svn commit: r230858 - stable/9/usr.sbin/wpa/wpa_supplicant

2012-01-31 Thread Ed Maste
Author: emaste
Date: Wed Feb  1 03:28:19 2012
New Revision: 230858
URL: http://svn.freebsd.org/changeset/base/230858

Log:
  MFC r230293:
  
Add missing line continuation \.  It did not cause any issue because
the same path is already being included in ../Makefile.inc.
  
PR:   164192
Submitted by: Devin Teske 

Modified:
  stable/9/usr.sbin/wpa/wpa_supplicant/Makefile
Directory Properties:
  stable/9/usr.sbin/wpa/wpa_supplicant/   (props changed)

Modified: stable/9/usr.sbin/wpa/wpa_supplicant/Makefile
==
--- stable/9/usr.sbin/wpa/wpa_supplicant/Makefile   Wed Feb  1 02:53:06 
2012(r230857)
+++ stable/9/usr.sbin/wpa/wpa_supplicant/Makefile   Wed Feb  1 03:28:19 
2012(r230858)
@@ -5,7 +5,7 @@
 .PATH.c:${WPA_SUPPLICANT_DISTDIR} \
${WPA_DISTDIR}/src/drivers \
${WPA_DISTDIR}/src/eap_peer \
-   ${WPA_DISTDIR}/src/rsn_supp
+   ${WPA_DISTDIR}/src/rsn_supp \
${WPA_DISTDIR}/src/crypto
 
 PROG=  wpa_supplicant
___
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: r230857 - in head/sys: kern sys

2012-01-31 Thread David Xu
Author: davidxu
Date: Wed Feb  1 02:53:06 2012
New Revision: 230857
URL: http://svn.freebsd.org/changeset/base/230857

Log:
  If multiple threads call kevent() to get AIO events on same kqueue fd,
  it is possible that a single AIO event will be reported to multiple
  threads, it is not threading friendly, and the existing API can not
  control this behavior.
  Allocate a kevent flags field sigev_notify_kevent_flags for AIO event
  notification in sigevent, and allow user to pass EV_CLEAR, EV_DISPATCH
  or EV_ONESHOT to AIO kernel code, user can control whether the event
  should be cleared once it is retrieved by a thread. This change should
  be comptaible with existing application, because the field should have
  already been zero-filled, and no additional action will be taken by
  kernel.
  
  PR:   kern/156567

Modified:
  head/sys/kern/vfs_aio.c
  head/sys/sys/signal.h

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Wed Feb  1 02:16:15 2012(r230856)
+++ head/sys/kern/vfs_aio.c Wed Feb  1 02:53:06 2012(r230857)
@@ -1524,6 +1524,7 @@ aio_aqueue(struct thread *td, struct aio
int error;
int fd, kqfd;
int jid;
+   u_short evflags;
 
if (p->p_aioinfo == NULL)
aio_init_aioinfo(p);
@@ -1646,10 +1647,15 @@ aio_aqueue(struct thread *td, struct aio
 
if (aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_KEVENT)
goto no_kqueue;
+   evflags = aiocbe->uaiocb.aio_sigevent.sigev_notify_kevent_flags;
+   if ((evflags & ~(EV_CLEAR | EV_DISPATCH | EV_ONESHOT)) != 0) {
+   error = EINVAL;
+   goto aqueue_fail;
+   }
kqfd = aiocbe->uaiocb.aio_sigevent.sigev_notify_kqueue;
kev.ident = (uintptr_t)aiocbe->uuaiocb;
kev.filter = EVFILT_AIO;
-   kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1;
+   kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags;
kev.data = (intptr_t)aiocbe;
kev.udata = aiocbe->uaiocb.aio_sigevent.sigev_value.sival_ptr;
error = kqfd_register(kqfd, &kev, td, 1);

Modified: head/sys/sys/signal.h
==
--- head/sys/sys/signal.h   Wed Feb  1 02:16:15 2012(r230856)
+++ head/sys/sys/signal.h   Wed Feb  1 02:53:06 2012(r230857)
@@ -169,12 +169,14 @@ struct sigevent {
void (*_function)(union sigval);
void *_attribute; /* pthread_attr_t * */
} _sigev_thread;
+   unsigned short _kevent_flags;
long __spare__[8];
} _sigev_un;
 };
 
 #if __BSD_VISIBLE
 #definesigev_notify_kqueue sigev_signo
+#definesigev_notify_kevent_flags   _sigev_un._kevent_flags
 #definesigev_notify_thread_id  _sigev_un._threadid
 #endif
 #definesigev_notify_function   
_sigev_un._sigev_thread._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: r230855 - stable/8/usr.sbin/wpa/wpa_supplicant

2012-01-31 Thread Ed Maste
Author: emaste
Date: Wed Feb  1 01:36:46 2012
New Revision: 230855
URL: http://svn.freebsd.org/changeset/base/230855

Log:
  Revert r230854 as the change does not apply to stable/8.

Modified:
  stable/8/usr.sbin/wpa/wpa_supplicant/Makefile
Directory Properties:
  stable/8/usr.sbin/wpa/wpa_supplicant/   (props changed)

Modified: stable/8/usr.sbin/wpa/wpa_supplicant/Makefile
==
--- stable/8/usr.sbin/wpa/wpa_supplicant/Makefile   Wed Feb  1 01:28:35 
2012(r230854)
+++ stable/8/usr.sbin/wpa/wpa_supplicant/Makefile   Wed Feb  1 01:36:46 
2012(r230855)
@@ -5,7 +5,7 @@
 .PATH.c:${WPA_SUPPLICANT_DISTDIR} \
${WPA_DISTDIR}/src/drivers \
${WPA_DISTDIR}/src/eap_peer \
-   ${WPA_DISTDIR}/src/rsn_supp \
+   ${WPA_DISTDIR}/src/rsn_supp
 
 PROG=  wpa_supplicant
 SRCS=  aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.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: r230854 - stable/8/usr.sbin/wpa/wpa_supplicant

2012-01-31 Thread Ed Maste
Author: emaste
Date: Wed Feb  1 01:28:35 2012
New Revision: 230854
URL: http://svn.freebsd.org/changeset/base/230854

Log:
  MFC r230293:
  
Add missing line continuation \.  It did not cause any issue because
the same path is already being included in ../Makefile.inc.
  
PR:   164192
Submitted by: Devin Teske 

Modified:
  stable/8/usr.sbin/wpa/wpa_supplicant/Makefile
Directory Properties:
  stable/8/usr.sbin/wpa/wpa_supplicant/   (props changed)

Modified: stable/8/usr.sbin/wpa/wpa_supplicant/Makefile
==
--- stable/8/usr.sbin/wpa/wpa_supplicant/Makefile   Tue Jan 31 23:24:46 
2012(r230853)
+++ stable/8/usr.sbin/wpa/wpa_supplicant/Makefile   Wed Feb  1 01:28:35 
2012(r230854)
@@ -5,7 +5,7 @@
 .PATH.c:${WPA_SUPPLICANT_DISTDIR} \
${WPA_DISTDIR}/src/drivers \
${WPA_DISTDIR}/src/eap_peer \
-   ${WPA_DISTDIR}/src/rsn_supp
+   ${WPA_DISTDIR}/src/rsn_supp \
 
 PROG=  wpa_supplicant
 SRCS=  aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.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"


Re: svn commit: r193833 - in head: share/man/man9 sys/kern sys/sys

2012-01-31 Thread Marius Strobl
On Mon, Jan 30, 2012 at 09:32:06AM -0500, John Baldwin wrote:
> On Sunday, January 29, 2012 10:41:24 am Marius Strobl wrote:
> > On Tue, Jun 09, 2009 at 02:26:23PM +, John Baldwin wrote:
> > > Author: jhb
> > > Date: Tue Jun  9 14:26:23 2009
> > > New Revision: 193833
> > > URL: http://svn.freebsd.org/changeset/base/193833
> > > 
> > > Log:
> > >   Add support for multiple passes of the device tree during the boot-time
> > >   probe.  The current device order is unchanged.  This commit just adds 
> > > the
> > >   infrastructure and ABI changes so that it is easier to merge later 
> > > changes
> > >   into 8.x.
> > >   - Driver attachments now have an associated pass level.  Attachments are
> > > not allowed to probe or attach to drivers until the system-wide pass 
> > > level
> > > is >= the attachment's pass level.  By default driver attachments use 
> > > the
> > > "last" pass level (BUS_PASS_DEFAULT).  Driver's that wish to probe 
> > > during
> > > an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() 
> > > which
> > > accepts the pass level as an additional parameter.
> > >   - A new method BUS_NEW_PASS has been added to the bus interface.  This
> > > method is invoked when the system-wide pass level is changed to kick 
> > > off
> > > a rescan of the device tree so that drivers that have just been made
> > > "eligible" can probe and attach.
> > >   - The bus_generic_new_pass() function provides a default implementation 
> > > of
> > > BUS_NEW_PASS().  It first allows drivers that were just made eligible 
> > > for
> > > this pass to identify new child devices.  Then it propogates the 
> > > rescan to
> > > child devices that already have an attached driver by invoking their
> > > BUS_NEW_PASS() method.  It also reprobes devices without a driver.
> > >   - BUS_PROBE_NOMATCH() is only invoked for devices that do not have
> > > an attached driver after being scanned during the final pass.
> > >   - The bus_set_pass() function is used during boot to raise the pass 
> > > level.
> > > Currently it is only called once during root_bus_configure() to raise
> > > the pass level to BUS_PASS_DEFAULT.  This has the effect of probing 
> > > all
> > > devices in a single pass identical to previous behavior.
> > >   
> > >   Reviewed by:imp
> > >   Approved by:re (kib)
> > > 
> > 
> > What would be necessary to finally enable support for multi-pass
> > probing apart from the drivers also needing to set BUS_PASS_n if
> > they want to take part earlier than BUS_PASS_DEFAULT)? My
> > understanding is that this is should be as simple as changing
> > root_bus_configure() to return BUS_PASS_ROOT instead of
> > BUS_PASS_DEFAULT but the comment above that line actually talks
> > about splitting the return value (?) up somehow ...
> 
> It will already work now without needing any changes.  I have some older
> patches to make x86 probe ACPI and PCI busses and bridges early and they
> required no changes to the root bus.  The reason for the comment is that I
> eventually imagine the multiple passes being split up so that we can do other
> actions after various passes are complete.  For example, we might rewrite
> root_bus_configure() so that it looks something like:
> 
> void
> root_bus_configure(void)
> {
> 
>   /* Enumerate the device tree and reserve static resources. */
>   bus_set_pass(BUS_PASS_RESOURCE);
> 
>   /*
>  * Now scan devices to allocate dynamic resources, possibly
>* rewriting BARs, etc.
>*/
>   /* some code that doesn't exist yet */
> 
>   /* Now probe interrupt controllers. */
>   bus_set_pass(BUS_PASS_INTERRUPT);
> 
>   /* Now kick off interrupt routing via some new bus method. */
>   /* not written yet */
> 
>   /* Finish probing everything else. */
>   bus_set_pass(BUS_PASS_DEFAULT);
> }
> 
> This works because bus_set_pass() will do multiple scans of the tree, one
> per configured pass level, to raise the system's pass level up to the
> requested level.
> 

Ah, great, thanks for the explanation!

Marius

___
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: r230853 - in stable/8/sys: conf sun4v/include

2012-01-31 Thread Marius Strobl
Author: marius
Date: Tue Jan 31 23:24:46 2012
New Revision: 230853
URL: http://svn.freebsd.org/changeset/base/230853

Log:
  - Hook up VTOC8 geometry adjustments.
  - Remove some unused externs.
  
  This is a direct commit to stable/8 in order to unbreak the build with
  r230666 in place.

Modified:
  stable/8/sys/conf/files.sun4v
  stable/8/sys/sun4v/include/md_var.h

Modified: stable/8/sys/conf/files.sun4v
==
--- stable/8/sys/conf/files.sun4v   Tue Jan 31 23:20:17 2012
(r230852)
+++ stable/8/sys/conf/files.sun4v   Tue Jan 31 23:24:46 2012
(r230853)
@@ -39,8 +39,10 @@ sparc64/ebus/ebus.c  optionalebus
 sparc64/isa/isa.c  optionalisa
 sparc64/isa/isa_dma.c  optionalisa
 sparc64/isa/ofw_isa.c  optionalebus | isa
+sparc64/sparc64/ata_machdep.c  optionalada | atadisk | da
 sparc64/sparc64/autoconf.c standard
 sun4v/sun4v/bus_machdep.c  standard
+sparc64/sparc64/cam_machdep.c  optionalscbus
 sun4v/sun4v/clock.cstandard
 sparc64/sparc64/db_disasm.coptionalddb
 sun4v/sun4v/db_interface.c optionalddb

Modified: stable/8/sys/sun4v/include/md_var.h
==
--- stable/8/sys/sun4v/include/md_var.h Tue Jan 31 23:20:17 2012
(r230852)
+++ stable/8/sys/sun4v/include/md_var.h Tue Jan 31 23:24:46 2012
(r230853)
@@ -54,10 +54,15 @@ struct md_utrap *utrap_alloc(void);
 void   utrap_free(struct md_utrap *ut);
 struct md_utrap *utrap_hold(struct md_utrap *ut);
 
-
-extern cpu_block_copy_t *cpu_block_copy;
-extern cpu_block_zero_t *cpu_block_zero;
-
-
+/*
+ * Given that the VTOC8 disk label only uses 16-bit fields for cylinders,
+ * heads and sectors we might need to adjust the geometry of large disks.
+ */
+struct ccb_calc_geometry;
+int scsi_da_bios_params(struct ccb_calc_geometry *ccg);
+struct disk;
+void sparc64_ata_disk_firmware_geom_adjust(struct disk *disk);
+#defineata_disk_firmware_geom_adjust(disk) 
\
+   sparc64_ata_disk_firmware_geom_adjust(disk)
 
 #endif /* !_MACHINE_MD_VAR_H_ */
___
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: r230852 - stable/7/sys/sun4v/include

2012-01-31 Thread Marius Strobl
Author: marius
Date: Tue Jan 31 23:20:17 2012
New Revision: 230852
URL: http://svn.freebsd.org/changeset/base/230852

Log:
  Add more sparc64 compatibility macros for the shared loader.
  This is a direct commit to stable/7 in order to unbreak the build with
  224371 in place.

Modified:
  stable/7/sys/sun4v/include/tlb.h

Modified: stable/7/sys/sun4v/include/tlb.h
==
--- stable/7/sys/sun4v/include/tlb.hTue Jan 31 23:20:14 2012
(r230851)
+++ stable/7/sys/sun4v/include/tlb.hTue Jan 31 23:20:17 2012
(r230852)
@@ -43,7 +43,21 @@
(TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK))
 
 #defineTLB_DAR_SLOT_SHIFT  (3)
-#defineTLB_DAR_SLOT(slot)  ((slot) << TLB_DAR_SLOT_SHIFT)
+
+/*
+ * sparc64 compatibility for the loader
+ */
+#defineTLB_DAR_TLB_SHIFT   (16)
+#defineTLB_DAR_SLOT(tlb, slot) 
\
+   ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT)
+#defineTLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} 
*/
+#defineTLB_DAR_T32 (0) /* US-I, II{,e,i} */
+#defineTLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} 
*/
+#defineTLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} 
*/
+#defineTLB_DAR_IT128   (2) /* US-III{,i,+}, IV */
+#defineTLB_DAR_IT512   (2) /* US-IV+ */
+#defineTLB_DAR_FTLB(0) /* SPARC64 V, VI, VII, 
VIIIfx */
+#defineTLB_DAR_STLB(2) /* SPARC64 V, VI, VII, 
VIIIfx */
 
 #defineTAR_VPN_SHIFT   (13)
 #defineTAR_CTX_MASK((1 << TAR_VPN_SHIFT) - 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: r230851 - stable/8/sys/sun4v/include

2012-01-31 Thread Marius Strobl
Author: marius
Date: Tue Jan 31 23:20:14 2012
New Revision: 230851
URL: http://svn.freebsd.org/changeset/base/230851

Log:
  Add more sparc64 compatibility macros for the shared loader.
  This is a direct commit to stable/8 in order to unbreak the build with
  r224370 in place.

Modified:
  stable/8/sys/sun4v/include/tlb.h

Modified: stable/8/sys/sun4v/include/tlb.h
==
--- stable/8/sys/sun4v/include/tlb.hTue Jan 31 23:09:27 2012
(r230850)
+++ stable/8/sys/sun4v/include/tlb.hTue Jan 31 23:20:14 2012
(r230851)
@@ -43,7 +43,20 @@
(TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK))
 
 #defineTLB_DAR_SLOT_SHIFT  (3)
-#defineTLB_DAR_SLOT(slot)  ((slot) << TLB_DAR_SLOT_SHIFT)
+
+/*
+ * sparc64 compatibility for the loader
+ */
+#defineTLB_DAR_TLB_SHIFT   (16)
+#defineTLB_DAR_SLOT(tlb, slot) 
\
+   ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT)
+#defineTLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} 
*/
+#defineTLB_DAR_T32 (0) /* US-I, II{,e,i} */
+#defineTLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} 
*/
+#defineTLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} 
*/
+#defineTLB_DAR_IT128   (2) /* US-III{,i,+}, IV */
+#defineTLB_DAR_IT512   (2) /* US-IV+ */
+#defineTLB_DAR_FTLB(0) /* SPARC64 V, VI, VII, 
VIIIfx */
 
 #defineTAR_VPN_SHIFT   (13)
 #defineTAR_CTX_MASK((1 << TAR_VPN_SHIFT) - 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: r230850 - in stable/8/sys/cam: . scsi

2012-01-31 Thread Kenneth D. Merry
Author: ken
Date: Tue Jan 31 23:09:27 2012
New Revision: 230850
URL: http://svn.freebsd.org/changeset/base/230850

Log:
  MFC: 23, 230544
  
  Fix a race condition in CAM peripheral free handling, locking
  in the CAM XPT bus traversal code, and a number of other periph level
  issues.
  
r230544 | ken | 2012-01-25 10:58:47 -0700 (Wed, 25 Jan 2012) | 9 lines
  
Fix a bug introduced in r23.  We were eliminating all LUNs on a target
in response to CAM_DEV_NOT_THERE, instead of just the LUN in question.
  
This will now just eliminate the specified LUN in response to
CAM_DEV_NOT_THERE.
  
Reported by:Richard Todd 
  
r23 | ken | 2012-01-11 17:41:48 -0700 (Wed, 11 Jan 2012) | 72 lines
  
Fix a race condition in CAM peripheral free handling, locking
in the CAM XPT bus traversal code, and a number of other periph level
issues.
  
cam_periph.h,
cam_periph.c:   Modify cam_periph_acquire() to test the 
CAM_PERIPH_INVALID
flag prior to allowing a reference count to be gained
on a peripheral.  Callers of this function will receive
CAM_REQ_CMP_ERR status in the situation of attempting to
reference an invalidated periph.  This guarantees that
a peripheral scheduled for a deferred free will not
be accessed during its wait for destruction.
  
Panic during attempts to drop a reference count on
a peripheral that already has a zero reference count.
  
In cam_periph_list(), use a local sbuf with SBUF_FIXEDLEN
set so that mallocs do not occur while the xpt topology
lock is held, regardless of the allocation policy of the
passed in sbuf.
  
Add a new routine, cam_periph_release_locked_buses(),
that can be called when the caller already holds
the CAM topology lock.
  
Add some extra debugging for duplicate peripheral
allocations in cam_periph_alloc().
  
Treat CAM_DEV_NOT_THERE much the same as a selection
timeout (AC_LOST_DEVICE is emitted), but forgo retries.
  
cam_xpt.c:  Revamp the way the EDT traversal code does locking
and reference counting.  This was broken, since it
assumed that the EDT would not change during
traversal, but that assumption is no longer valid.
  
So, to prevent devices from going away while we
traverse the EDT, make sure we properly lock
everything and hold references on devices that
we are using.
  
The two peripheral driver traversal routines should
be examined.  xptpdperiphtraverse() holds the
topology lock for the entire time it runs.
xptperiphtraverse() is now locked properly, but
only holds the topology lock while it is traversing
the list, and not while the traversal function is
running.
  
The bus locking code in xptbustraverse() should
also be revisited at a later time, since it is
complex and should probably be simplified.
  
scsi_da.c:  Pay attention to the return value from cam_periph_acquire().
  
Return 0 always from daclose() even if the disk is now gone.
  
Add some rudimentary error injection support.
  
scsi_sg.c:  Fix reference counting in the sg(4) driver.
  
The sg driver was calling cam_periph_release() on close,
but never called cam_periph_acquire() (which increments
the reference count) on open.
  
The periph code correctly complained that the sg(4)
driver was trying to decrement the refcount when it
was already 0.
  
Sponsored by:   Spectra Logic

Modified:
  stable/8/sys/cam/cam_periph.c
  stable/8/sys/cam/cam_periph.h
  stable/8/sys/cam/cam_xpt.c
  stable/8/sys/cam/scsi/scsi_da.c
  stable/8/sys/cam/scsi/scsi_sg.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/cam/cam_periph.c
==
--- stable/8/sys/cam/cam_periph.c   Tue Jan 31 23:04:58 2012
(r230849)
+++ stable/8/sys/cam/cam_periph.c   Tue Jan 31 23:09:27 2012
(r230850)
@@ -170,14 +170,16 @@ cam_periph_alloc(periph_ctor_t *periph_c
return (CAM_REQ_INPROG);
} else {
printf("cam_periph_alloc: attempt to re-allocate "
-  "v

svn commit: r230849 - in stable/9/sys/cam: . scsi

2012-01-31 Thread Kenneth D. Merry
Author: ken
Date: Tue Jan 31 23:04:58 2012
New Revision: 230849
URL: http://svn.freebsd.org/changeset/base/230849

Log:
  MFC: 23, 230544
  
  Fix a race condition in CAM peripheral free handling, locking
  in the CAM XPT bus traversal code, and a number of other periph level
  issues.
  
r230544 | ken | 2012-01-25 10:58:47 -0700 (Wed, 25 Jan 2012) | 9 lines
  
Fix a bug introduced in r23.  We were eliminating all LUNs on a target
in response to CAM_DEV_NOT_THERE, instead of just the LUN in question.
  
This will now just eliminate the specified LUN in response to
CAM_DEV_NOT_THERE.
  
Reported by:Richard Todd 
  
r23 | ken | 2012-01-11 17:41:48 -0700 (Wed, 11 Jan 2012) | 72 lines
  
Fix a race condition in CAM peripheral free handling, locking
in the CAM XPT bus traversal code, and a number of other periph level
issues.
  
cam_periph.h,
cam_periph.c:   Modify cam_periph_acquire() to test the 
CAM_PERIPH_INVALID
flag prior to allowing a reference count to be gained
on a peripheral.  Callers of this function will receive
CAM_REQ_CMP_ERR status in the situation of attempting to
reference an invalidated periph.  This guarantees that
a peripheral scheduled for a deferred free will not
be accessed during its wait for destruction.
  
Panic during attempts to drop a reference count on
a peripheral that already has a zero reference count.
  
In cam_periph_list(), use a local sbuf with SBUF_FIXEDLEN
set so that mallocs do not occur while the xpt topology
lock is held, regardless of the allocation policy of the
passed in sbuf.
  
Add a new routine, cam_periph_release_locked_buses(),
that can be called when the caller already holds
the CAM topology lock.
  
Add some extra debugging for duplicate peripheral
allocations in cam_periph_alloc().
  
Treat CAM_DEV_NOT_THERE much the same as a selection
timeout (AC_LOST_DEVICE is emitted), but forgo retries.
  
cam_xpt.c:  Revamp the way the EDT traversal code does locking
and reference counting.  This was broken, since it
assumed that the EDT would not change during
traversal, but that assumption is no longer valid.
  
So, to prevent devices from going away while we
traverse the EDT, make sure we properly lock
everything and hold references on devices that
we are using.
  
The two peripheral driver traversal routines should
be examined.  xptpdperiphtraverse() holds the
topology lock for the entire time it runs.
xptperiphtraverse() is now locked properly, but
only holds the topology lock while it is traversing
the list, and not while the traversal function is
running.
  
The bus locking code in xptbustraverse() should
also be revisited at a later time, since it is
complex and should probably be simplified.
  
scsi_da.c:  Pay attention to the return value from cam_periph_acquire().
  
Return 0 always from daclose() even if the disk is now gone.
  
Add some rudimentary error injection support.
  
scsi_sg.c:  Fix reference counting in the sg(4) driver.
  
The sg driver was calling cam_periph_release() on close,
but never called cam_periph_acquire() (which increments
the reference count) on open.
  
The periph code correctly complained that the sg(4)
driver was trying to decrement the refcount when it
was already 0.
  
Sponsored by:   Spectra Logic

Modified:
  stable/9/sys/cam/cam_periph.c
  stable/9/sys/cam/cam_periph.h
  stable/9/sys/cam/cam_xpt.c
  stable/9/sys/cam/scsi/scsi_da.c
  stable/9/sys/cam/scsi/scsi_sg.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/cam/cam_periph.c
=

svn commit: r230848 - stable/8/sys/dev/e1000

2012-01-31 Thread Jack F Vogel
Author: jfv
Date: Tue Jan 31 22:47:10 2012
New Revision: 230848
URL: http://svn.freebsd.org/changeset/base/230848

Log:
  MFC of e1000 drivers
  
  The following revs are merged:
  212303,212304,213234,214363,214441,217556,219902,221505,
  223676,226436,227309,228386,228387,228405,228415,228788,
  228803,229606,229767,230023,230024,230742

Modified:
  stable/8/sys/dev/e1000/README
  stable/8/sys/dev/e1000/e1000_80003es2lan.c
  stable/8/sys/dev/e1000/e1000_80003es2lan.h
  stable/8/sys/dev/e1000/e1000_82540.c
  stable/8/sys/dev/e1000/e1000_82541.c
  stable/8/sys/dev/e1000/e1000_82543.c
  stable/8/sys/dev/e1000/e1000_82571.c
  stable/8/sys/dev/e1000/e1000_82575.c
  stable/8/sys/dev/e1000/e1000_82575.h
  stable/8/sys/dev/e1000/e1000_api.c
  stable/8/sys/dev/e1000/e1000_api.h
  stable/8/sys/dev/e1000/e1000_defines.h
  stable/8/sys/dev/e1000/e1000_hw.h
  stable/8/sys/dev/e1000/e1000_ich8lan.c
  stable/8/sys/dev/e1000/e1000_ich8lan.h
  stable/8/sys/dev/e1000/e1000_mac.c
  stable/8/sys/dev/e1000/e1000_nvm.c
  stable/8/sys/dev/e1000/e1000_nvm.h
  stable/8/sys/dev/e1000/e1000_osdep.c
  stable/8/sys/dev/e1000/e1000_phy.c
  stable/8/sys/dev/e1000/e1000_phy.h
  stable/8/sys/dev/e1000/e1000_regs.h
  stable/8/sys/dev/e1000/e1000_vf.c
  stable/8/sys/dev/e1000/if_em.c
  stable/8/sys/dev/e1000/if_em.h
  stable/8/sys/dev/e1000/if_igb.c
  stable/8/sys/dev/e1000/if_igb.h
  stable/8/sys/dev/e1000/if_lem.c
  stable/8/sys/dev/e1000/if_lem.h
Directory Properties:
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/dev/e1000/README
==
--- stable/8/sys/dev/e1000/README   Tue Jan 31 22:31:16 2012
(r230847)
+++ stable/8/sys/dev/e1000/README   Tue Jan 31 22:47:10 2012
(r230848)
@@ -354,6 +354,7 @@ Known Limitations
   include:
 Planex FXG-08TE
 I-O Data ETG-SH8
+Netgear GS105v3
 
   The driver can be compiled with the following changes:
 

Modified: stable/8/sys/dev/e1000/e1000_80003es2lan.c
==
--- stable/8/sys/dev/e1000/e1000_80003es2lan.c  Tue Jan 31 22:31:16 2012
(r230847)
+++ stable/8/sys/dev/e1000/e1000_80003es2lan.c  Tue Jan 31 22:47:10 2012
(r230848)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2001-2010, Intel Corporation 
+  Copyright (c) 2001-2011, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -47,18 +47,18 @@ static void e1000_release_phy_80003es2la
 static s32  e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw);
 static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
-   u32 offset,
-   u16 *data);
+  u32 offset,
+  u16 *data);
 static s32  e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
-u32 offset,
-u16 data);
+   u32 offset,
+   u16 data);
 static s32  e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
-u16 words, u16 *data);
+   u16 words, u16 *data);
 static s32  e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_get_cable_length_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
-   u16 *duplex);
+  u16 *duplex);
 static s32  e1000_reset_hw_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_init_hw_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
@@ -68,9 +68,9 @@ static s32  e1000_cfg_kmrn_10_100_80003e
 static s32  e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
-u16 *data);
+   u16 *data);
 static s32  e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
- u16 data);
+u16 data);
 static s32  e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw);
 static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
 static void e1000_relea

svn commit: r230847 - in head/sys/dev/ath/ath_hal: ar5416 ar9002

2012-01-31 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 31 22:31:16 2012
New Revision: 230847
URL: http://svn.freebsd.org/changeset/base/230847

Log:
  Support AR9281/AR5B91 - a 1x2 stream device based on the AR9280.
  
  * Override the TX/RX stream count if the EEPROM reports a single RX or
TX stream, rather than assuming the device will always be a 2x2 strea
device.
  
  * For AR9280 devices, don't hard-code 2x2 stream.  Instead, allow the
ar5416FillCapabilityInfo() routine to correctly determine things.
  
  The latter should be done for all 11n chips now that
  ar5416FillCapabilityInfo() will set the TX/RX stream count based on the
  active TX/RX chainmask in the EEPROM.
  
  Thanks to Maciej Milewski for donating some AR9281 NICs to me for
  testing.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 31 22:27:35 
2012(r230846)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 31 22:31:16 
2012(r230847)
@@ -884,6 +884,15 @@ ar5416FillCapabilityInfo(struct ath_hal 
/* AR5416 may have 3 antennas but is a 2x2 stream device */
pCap->halTxStreams = 2;
pCap->halRxStreams = 2;
+   /*
+* If the TX or RX chainmask has less than 2 chains active,
+* mark it as a 1-stream device for the relevant stream.
+*/
+   if (owl_get_ntxchains(pCap->halTxChainMask) == 1)
+   pCap->halTxStreams = 1;
+   /* XXX Eww */
+   if (owl_get_ntxchains(pCap->halRxChainMask) == 1)
+   pCap->halRxStreams = 1;
pCap->halRtsAggrLimit = 8*1024; /* Owl 2.0 limit */
pCap->halMbssidAggrSupport = AH_FALSE;  /* Broken on Owl */
pCap->halForcePpmSupport = AH_TRUE;

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 31 22:27:35 
2012(r230846)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 31 22:31:16 
2012(r230847)
@@ -822,10 +822,6 @@ ar9280FillCapabilityInfo(struct ath_hal 
 #if 0
pCap->halWowMatchPatternDword = AH_TRUE;
 #endif
-   /* AR9280 is a 2x2 stream device */
-   pCap->halTxStreams = 2;
-   pCap->halRxStreams = 2;
-
pCap->halCSTSupport = AH_TRUE;
pCap->halRifsRxSupport = AH_TRUE;
pCap->halRifsTxSupport = AH_TRUE;
___
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: r230846 - head/sys/dev/ath

2012-01-31 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 31 22:27:35 2012
New Revision: 230846
URL: http://svn.freebsd.org/changeset/base/230846

Log:
  Correctly fetch the TX/RX stream count from the HAL.
  
  Pointy hat to: me

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

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Jan 31 21:46:28 2012(r230845)
+++ head/sys/dev/ath/if_ath.c   Tue Jan 31 22:27:35 2012(r230846)
@@ -678,8 +678,8 @@ ath_attach(u_int16_t devid, struct ath_s
 * negotiating which MCS rates it'll receive and
 * what MCS rates are available for TX.
 */
-   (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 0, &rxs);
-   (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 1, &txs);
+   (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 0, &txs);
+   (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 1, &rxs);
 
ath_hal_getrxchainmask(ah, &sc->sc_rxchainmask);
ath_hal_gettxchainmask(ah, &sc->sc_txchainmask);
___
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: r230845 - head/sys/dev/sound/pcm

2012-01-31 Thread Alexander Motin
Author: mav
Date: Tue Jan 31 21:46:28 2012
New Revision: 230845
URL: http://svn.freebsd.org/changeset/base/230845

Log:
  Make sound(4) more flexible in setting soft buffer and block sizes when
  hardware imposes strict limitations on hard buffer and block sizes.
  
  Previous code set soft buffer to be no smaller then hard buffer. On some
  cards with fixed 64K physical buffer that caused up to 800ms play latency.
  New code allows to set soft buffer size down to just two blocks of the hard
  buffer and to not write more then that size ahead to the hardware buffer.
  As result of that change I was able to reduce full practically measured
  record-playback loop delay in those conditions down to only about 115ms
  with theoretical playback latency of only about 50ms.
  
  New code works fine for both vchans and direct cases. In both cases sound(4)
  tries to follow hw.snd.latency_profile and hw.snd.latency values and
  application-requested buffer and block sizes as much as limitation of two
  hardware blocks allows.
  
  Reviewed by:  silence on multimedia@

Modified:
  head/sys/dev/sound/pcm/buffer.c
  head/sys/dev/sound/pcm/buffer.h
  head/sys/dev/sound/pcm/channel.c

Modified: head/sys/dev/sound/pcm/buffer.c
==
--- head/sys/dev/sound/pcm/buffer.c Tue Jan 31 19:45:32 2012
(r230844)
+++ head/sys/dev/sound/pcm/buffer.c Tue Jan 31 21:46:28 2012
(r230845)
@@ -301,6 +301,15 @@ sndbuf_fillsilence(struct snd_dbuf *b)
b->rl = b->bufsize;
 }
 
+void
+sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl)
+{
+   if (b->bufsize > 0)
+   memset(sndbuf_getbuf(b), sndbuf_zerodata(b->fmt), b->bufsize);
+   b->rp = 0;
+   b->rl = min(b->bufsize, rl);
+}
+
 /**
  * @brief Reset buffer w/o flushing statistics
  *

Modified: head/sys/dev/sound/pcm/buffer.h
==
--- head/sys/dev/sound/pcm/buffer.h Tue Jan 31 19:45:32 2012
(r230844)
+++ head/sys/dev/sound/pcm/buffer.h Tue Jan 31 21:46:28 2012
(r230845)
@@ -74,6 +74,7 @@ int sndbuf_remalloc(struct snd_dbuf *b, 
 void sndbuf_reset(struct snd_dbuf *b);
 void sndbuf_clear(struct snd_dbuf *b, unsigned int length);
 void sndbuf_fillsilence(struct snd_dbuf *b);
+void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl);
 void sndbuf_softreset(struct snd_dbuf *b);
 void sndbuf_clearshadow(struct snd_dbuf *b);
 

Modified: head/sys/dev/sound/pcm/channel.c
==
--- head/sys/dev/sound/pcm/channel.cTue Jan 31 19:45:32 2012
(r230844)
+++ head/sys/dev/sound/pcm/channel.cTue Jan 31 21:46:28 2012
(r230845)
@@ -395,24 +395,28 @@ chn_wrfeed(struct pcm_channel *c)
 {
struct snd_dbuf *b = c->bufhard;
struct snd_dbuf *bs = c->bufsoft;
-   unsigned int amt;
+   unsigned int amt, want, wasfree;
 
CHN_LOCKASSERT(c);
 
if ((c->flags & CHN_F_MMAP) && !(c->flags & CHN_F_CLOSING))
sndbuf_acquire(bs, NULL, sndbuf_getfree(bs));
 
-   amt = sndbuf_getfree(b);
+   wasfree = sndbuf_getfree(b);
+   want = min(sndbuf_getsize(b),
+   imax(0, sndbuf_xbytes(sndbuf_getsize(bs), bs, b) -
+sndbuf_getready(b)));
+   amt = min(wasfree, want);
if (amt > 0)
sndbuf_feed(bs, b, c, c->feeder, amt);
 
/*
 * Possible xruns. There should be no empty space left in buffer.
 */
-   if (sndbuf_getfree(b) > 0)
+   if (sndbuf_getready(b) < want)
c->xruns++;
 
-   if (sndbuf_getfree(b) < amt)
+   if (sndbuf_getfree(b) < wasfree)
chn_wakeup(c);
 }
 
@@ -721,7 +725,8 @@ chn_start(struct pcm_channel *c, int for
}
if (c->parentchannel == NULL) {
if (c->direction == PCMDIR_PLAY)
-   sndbuf_fillsilence(b);
+   sndbuf_fillsilence_rl(b,
+   sndbuf_xbytes(sndbuf_getsize(bs), bs, b));
if (snd_verbose > 3)
device_printf(c->dev,
"%s(): %s starting! (%s/%s) "
@@ -1728,7 +1733,7 @@ chn_resizebuf(struct pcm_channel *c, int
int blkcnt, int blksz)
 {
struct snd_dbuf *b, *bs, *pb;
-   int sblksz, sblkcnt, hblksz, hblkcnt, limit = 1;
+   int sblksz, sblkcnt, hblksz, hblkcnt, limit = 0, nsblksz, nsblkcnt;
int ret;
 
CHN_LOCKASSERT(c);
@@ -1748,7 +1753,6 @@ chn_resizebuf(struct pcm_channel *c, int
return EINVAL;
else {
c->latency = latency;
-   limit = 0;
}
 
bs = c->bufsoft;
@@ -1783,19 +1787,22 @@ chn_resizebuf(struct pcm_channel *c, int
 */
sblksz

svn commit: r230843 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/isci sys/i386/conf sys/modules sys/modules/isci

2012-01-31 Thread Jim Harris
Author: jimharris
Date: Tue Jan 31 19:38:18 2012
New Revision: 230843
URL: http://svn.freebsd.org/changeset/base/230843

Log:
  Add isci(4) driver for amd64 and i386 targets.
  
  The isci driver is for the integrated SAS controller in the Intel C600
  (Patsburg) chipset.  Source files in sys/dev/isci directory are
  FreeBSD-specific, and sys/dev/isci/scil subdirectory contains
  an OS-agnostic library (SCIL) published by Intel to control the SAS
  controller.  This library is used primarily as-is in this driver, with
  some post-processing to better integrate into the kernel build
  environment.
  
  isci.4 and a README in the sys/dev/isci directory contain a few
  additional details.
  
  This driver is only built for amd64 and i386 targets.
  
  Sponsored by: Intel
  Reviewed by: scottl
  Approved by: scottl

Added:
  head/share/man/man4/isci.4
 - copied unchanged from r230794, user/jimharris/isci/share/man/man4/isci.4
  head/sys/dev/isci/
 - copied from r230794, user/jimharris/isci/sys/dev/isci/
  head/sys/modules/isci/
 - copied from r230794, user/jimharris/isci/sys/modules/isci/
Modified:
  head/MAINTAINERS   (contents, props changed)
  head/share/man/man4/Makefile
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/NOTES
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/options.amd64
  head/sys/conf/options.i386
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/NOTES
  head/sys/modules/Makefile
Directory Properties:
  head/share/man/man4/   (props changed)
  head/sys/   (props changed)

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSTue Jan 31 19:07:08 2012(r230842)
+++ head/MAINTAINERSTue Jan 31 19:38:18 2012(r230843)
@@ -124,6 +124,7 @@ usr.sbin/zicedwin   Heads-up appreciat
 lib/libc/stdtime   edwin   Heads-up appreciated, since parts of this code
is maintained by a third party source.
 sbin/routedbms Pre-commit review; notify vendor at rhyolite.com
+isci(4)jimharris   Pre-commit review requested.
 
 Following are the entries from the Makefiles, and a few other sources.
 Please remove stale entries from both their origin, and this file.

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileTue Jan 31 19:07:08 2012
(r230842)
+++ head/share/man/man4/MakefileTue Jan 31 19:38:18 2012
(r230843)
@@ -182,6 +182,7 @@ MAN=aac.4 \
ipsec.4 \
ipw.4 \
ipwfw.4 \
+   isci.4 \
iscsi_initiator.4 \
isp.4 \
ispfw.4 \

Copied: head/share/man/man4/isci.4 (from r230794, 
user/jimharris/isci/share/man/man4/isci.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/isci.4  Tue Jan 31 19:38:18 2012(r230843, copy 
of r230794, user/jimharris/isci/share/man/man4/isci.4)
@@ -0,0 +1,110 @@
+.\" 
+.\" Copyright (c) 2012 Intel Corporation
+.\" 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
+.\"substantially 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 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.
+.\" 
+.\" isci driver man page.
+.\"
+.\" Author: Jim Harris 
+.\"
+.\" $FreeBSD$
+.\"
+.Dd January 23, 2012
+.Dt ISCI 4
+.Os
+.Sh NAME
+.Nm isci
+.Nd Intel C600 Serial Attached SCSI driver
+.Sh SYNOPSIS
+To compile this driver into your kernel,
+place the following lines in your kernel configuration file:
+.

svn commit: r230842 - stable/8/lib/libc/stdtime

2012-01-31 Thread John Baldwin
Author: jhb
Date: Tue Jan 31 19:07:08 2012
New Revision: 230842
URL: http://svn.freebsd.org/changeset/base/230842

Log:
  MFC 226828: Fix a memory leak in tzload().

Modified:
  stable/8/lib/libc/stdtime/localtime.c
Directory Properties:
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/stdtime/localtime.c
==
--- stable/8/lib/libc/stdtime/localtime.c   Tue Jan 31 19:02:33 2012
(r230841)
+++ stable/8/lib/libc/stdtime/localtime.c   Tue Jan 31 19:07:08 2012
(r230842)
@@ -457,6 +457,7 @@ register const int  doextend;
_close(fid);
return -1;
}
+   free(fullname);
}
u = malloc(sizeof(*u));
if (u == NULL)
___
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: r230841 - stable/9/share/man/man9

2012-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 31 19:02:33 2012
New Revision: 230841
URL: http://svn.freebsd.org/changeset/base/230841

Log:
  Merge 228500:
More MLINKS for rtalloc.9

Modified:
  stable/9/share/man/man9/Makefile
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/Makefile
==
--- stable/9/share/man/man9/MakefileTue Jan 31 19:00:01 2012
(r230840)
+++ stable/9/share/man/man9/MakefileTue Jan 31 19:02:33 2012
(r230841)
@@ -1033,8 +1033,12 @@ MLINKS+=rmlock.9 rm_destroy.9 \
rmlock.9 rm_wunlock.9
 MLINKS+=rtalloc.9 rtalloc1.9 \
rtalloc.9 rtalloc_ign.9 \
+   rtalloc.9 RTFREE_LOCKED.9 \
rtalloc.9 RTFREE.9 \
-   rtalloc.9 rtfree.9
+   rtalloc.9 rtfree.9 \
+   rtalloc.9 rtalloc1_fib.9 \
+   rtalloc.9 rtalloc_ign_fib.9 \
+   rtalloc.9 rtalloc_fib.9
 MLINKS+=runqueue.9 choosethread.9 \
runqueue.9 procrunnable.9 \
runqueue.9 remrunqueue.9 \
___
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: r230840 - stable/9/share/man/man9

2012-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 31 19:00:01 2012
New Revision: 230840
URL: http://svn.freebsd.org/changeset/base/230840

Log:
  Merge r228499:
Update this page to describe modern interfaces.

Modified:
  stable/9/share/man/man9/rtalloc.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/rtalloc.9
==
--- stable/9/share/man/man9/rtalloc.9   Tue Jan 31 18:48:54 2012
(r230839)
+++ stable/9/share/man/man9/rtalloc.9   Tue Jan 31 19:00:01 2012
(r230840)
@@ -28,160 +28,163 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 11, 2008
+.Dd December 14, 2011
 .Dt RTALLOC 9
 .Os
 .Sh NAME
-.Nm rtalloc ,
-.Nm rtalloc_ign ,
-.Nm rtalloc1 ,
-.Nm rtfree
+.Nm rtalloc1_fib ,
+.Nm rtalloc_ign_fib ,
+.Nm rtalloc_fib
 .Nd look up a route in the kernel routing table
 .Sh SYNOPSIS
 .In sys/types.h
 .In sys/socket.h
 .In net/route.h
-.Ft void
-.Fn rtalloc "struct route *ro"
-.Ft void
-.Fn rtalloc_ign "struct route *ro" "u_long flags"
 .Ft "struct rtentry *"
-.Fn rtalloc1 "struct sockaddr *sa" "int report" "u_long flags"
+.Fn rtalloc1_fib "struct sockaddr *dst" "int report" "u_long flags" "u_int 
fibnum"
 .Ft void
-.Fn rtfree "struct rt_entry *rt"
+.Fn rtalloc_fib "struct route *ro" "u_int fibnum"
+.Ft void
+.Fn rtalloc_ign_fib "struct route *ro" "u_long flags" "u_int fibnum"
+.Fn RTFREE_LOCKED "struct rt_entry *rt"
 .Fn RTFREE "struct rt_entry *rt"
 .Fn RT_LOCK "struct rt_entry *rt"
 .Fn RT_UNLOCK "struct rt_entry *rt"
 .Fn RT_ADDREF "struct rt_entry *rt"
 .Fn RT_REMREF "struct rt_entry *rt"
+.Ft void
+.Fn rtfree "struct rt_entry *rt"
+.Ft "struct rtentry *"
+.Fn rtalloc1 "struct sockaddr *dst" "int report" "u_long flags"
+.Ft void
+.Fn rtalloc "struct route *ro"
+.Ft void
+.Fn rtalloc_ign "struct route *ro" "u_long flags"
+.Pp
+.Cd options RADIX_MPATH
 .Sh DESCRIPTION
 The kernel uses a radix tree structure to manage routes for the
 networking subsystem.
+If compiled with
+.Cd options RADIX_MPATH
+kernel may maintain several independent forwarding information databases 
(FIBs).
 The
 .Fn rtalloc
-family of routines is used by protocols to query this structure for a
+family of routines is used by protocols to query these structures for a
 route corresponding to a particular end-node address, and to cause
 certain protocol\- and interface-specific actions to take place.
-.\" XXX - -mdoc should contain a standard request for getting em and
-.\" en dashes.
 .Pp
-.Dv RTF_PRCLONING
-flag is obsolete and thus ignored by facility.
-If the
-.Dv RTF_XRESOLVE
-flag is set, then the
-.Dv RTM_RESOLVE
-message is sent instead on the
-.Xr route 4
-socket interface, requesting that an external program resolve the
-address in question and modify the route appropriately.
-.Pp
-The default interface is
-.Fn rtalloc .
-Its only argument is
+The
+.Fn rtalloc1_fib
+function is the most general form of
+.Fn rtalloc ,
+and all of the other forms are implemented as calls to it.
+It takes a
+.Fa "struct sockaddr *"
+directly as the
+.Fa dst
+argument.
+The second argument,
+.Fa report ,
+controls whether the routing sockets are notified when a lookup fails.
+The third argument,
+.Fa flags ,
+is a combination of
+the following values:
+.Bl -item -offset indent
+.It
+.Dv RTF_RNH_LOCKED
+indicates that the radix tree lock is already held
+.El
+.Pp
+The last argument
+.Fa fibnum
+specifies number of forwarding information database (FIB) on which
+the lookup should be performed.
+In case of success the
+.Fn rtalloc1_fib
+function returns a pointer to a locked
+.Vt "struct rtentry"
+with an additional reference.
+.Pp
+The
+.Fn rtalloc_fib
+is the most simple variant.
+Its main argument is
 .Fa ro ,
 a pointer to a
-.Dq Li "struct route" ,
+.Fa "struct route" ,
 which is defined as follows:
 .Bd -literal -offset indent
 struct route {
-   struct sockaddr ro_dst;
struct rtentry *ro_rt;
+   struct llentry *ro_lle;
+   struct sockaddr ro_dst;
 };
 .Ed
 .Pp
 Thus, this function can only be used for address families which are
 smaller than the default
-.Dq Li "struct sockaddr" .
+.Ft "struct sockaddr" .
 Before calling
-.Fn rtalloc
+.Fn rtalloc_fib
 for the first time, callers should ensure that unused bits of the
 structure are set to zero.
+The second argument
+.Fa fibnum
+is FIB number.
+In case of success of the
+.Fn rtalloc_fib
+the
+.Fa ro_rt
+points to a valid and unlocked
+.Xr rtentry 9 ,
+which has an additional reference put on it, freeing which is
+responsibility of the caller.
 On subsequent calls,
-.Fn rtalloc
+.Fn rtalloc_fib
 returns without performing a lookup if
 .Fa ro->ro_rt
 is non-null and the
 .Dv RTF_UP
-flag is set in the route's
-.Li rt_flags
+flag is set in the rtentry's
+.Fa rt_flags
 field.
 .Pp
 The
-.Fn rtalloc_ign
-interface can be used when the caller does not want to receive
-the returned
-.Fa rtentry
-locked.
-The
-.Fa ro
-argument is the same as
-.Fn rtalloc ,
-but there is addi

svn commit: r230838 - vendor/libz/1.2.6

2012-01-31 Thread Xin LI
Author: delphij
Date: Tue Jan 31 18:44:01 2012
New Revision: 230838
URL: http://svn.freebsd.org/changeset/base/230838

Log:
  Tag 1.2.6.

Added:
  vendor/libz/1.2.6/
 - copied from r230837, vendor/libz/dist/
___
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: r230837 - in vendor/libz/dist: . contrib/asm686 doc test

2012-01-31 Thread Xin LI
Author: delphij
Date: Tue Jan 31 18:43:19 2012
New Revision: 230837
URL: http://svn.freebsd.org/changeset/base/230837

Log:
  Vendor import of zlib 1.2.6.

Added:
  vendor/libz/dist/test/
  vendor/libz/dist/test/example.c
  vendor/libz/dist/test/infcover.c
  vendor/libz/dist/test/minigzip.c
Deleted:
  vendor/libz/dist/example.c
  vendor/libz/dist/minigzip.c
Modified:
  vendor/libz/dist/ChangeLog
  vendor/libz/dist/FAQ
  vendor/libz/dist/README
  vendor/libz/dist/adler32.c
  vendor/libz/dist/contrib/asm686/match.S
  vendor/libz/dist/crc32.c
  vendor/libz/dist/crc32.h
  vendor/libz/dist/deflate.c
  vendor/libz/dist/deflate.h
  vendor/libz/dist/doc/algorithm.txt
  vendor/libz/dist/gzguts.h
  vendor/libz/dist/gzlib.c
  vendor/libz/dist/gzread.c
  vendor/libz/dist/gzwrite.c
  vendor/libz/dist/infback.c
  vendor/libz/dist/inffixed.h
  vendor/libz/dist/inflate.c
  vendor/libz/dist/inftrees.c
  vendor/libz/dist/trees.c
  vendor/libz/dist/zconf.h
  vendor/libz/dist/zlib.3
  vendor/libz/dist/zlib.h
  vendor/libz/dist/zutil.c
  vendor/libz/dist/zutil.h

Modified: vendor/libz/dist/ChangeLog
==
--- vendor/libz/dist/ChangeLog  Tue Jan 31 18:42:22 2012(r230836)
+++ vendor/libz/dist/ChangeLog  Tue Jan 31 18:43:19 2012(r230837)
@@ -1,12 +1,151 @@
 
 ChangeLog file for zlib
 
+Changes in 1.2.6 (29 Jan 2012)
+- Update the Pascal interface in contrib/pascal
+- Fix function numbers for gzgetc_ in zlibvc.def files
+- Fix configure.ac for contrib/minizip [Schiffer]
+- Fix large-entry detection in minizip on 64-bit systems [Schiffer]
+- Have ./configure use the compiler return code for error indication
+- Fix CMakeLists.txt for cross compilation [McClure]
+- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]
+- Fix compilation of contrib/minizip on FreeBSD [Marquez]
+- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath]
+- Include io.h for Turbo C / Borland C on all platforms [Truta]
+- Make version explicit in contrib/minizip/configure.ac [Bosmans]
+- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]
+- Minor cleanup up contrib/minizip/unzip.c [Vollant]
+- Fix bug when compiling minizip with C++ [Vollant]
+- Protect for long name and extra fields in contrib/minizip [Vollant]
+- Avoid some warnings in contrib/minizip [Vollant]
+- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip
+- Add missing libs to minizip linker command
+- Add support for VPATH builds in contrib/minizip
+- Add an --enable-demos option to contrib/minizip/configure
+- Add the generation of configure.log by ./configure
+- Exit when required parameters not provided to win32/Makefile.gcc
+- Have gzputc return the character written instead of the argument
+- Use the -m option on ldconfig for BSD systems [Tobias]
+- Correct in zlib.map when deflateResetKeep was added
+
+Changes in 1.2.5.3 (15 Jan 2012)
+- Restore gzgetc function for binary compatibility
+- Do not use _lseeki64 under Borland C++ [Truta]
+- Update win32/Makefile.msc to build test/*.c [Truta]
+- Remove old/visualc6 given CMakefile and other alternatives
+- Update AS400 build files and documentation [Monnerat]
+- Update win32/Makefile.gcc to build test/*.c [Truta]
+- Permit stronger flushes after Z_BLOCK flushes
+- Avoid extraneous empty blocks when doing empty flushes
+- Permit Z_NULL arguments to deflatePending
+- Allow deflatePrime() to insert bits in the middle of a stream
+- Remove second empty static block for Z_PARTIAL_FLUSH
+- Write out all of the available bits when using Z_BLOCK
+- Insert the first two strings in the hash table after a flush
+
+Changes in 1.2.5.2 (17 Dec 2011)
+- fix ld error: unable to find version dependency 'ZLIB_1.2.5'
+- use relative symlinks for shared libs
+- Avoid searching past window for Z_RLE strategy
+- Assure that high-water mark initialization is always applied in deflate
+- Add assertions to fill_window() in deflate.c to match comments
+- Update python link in README
+- Correct spelling error in gzread.c
+- Fix bug in gzgets() for a concatenated empty gzip stream
+- Correct error in comment for gz_make()
+- Change gzread() and related to ignore junk after gzip streams
+- Allow gzread() and related to continue after gzclearerr()
+- Allow gzrewind() and gzseek() after a premature end-of-file
+- Simplify gzseek() now that raw after gzip is ignored
+- Change gzgetc() to a macro for speed (~40% speedup in testing)
+- Fix gzclose() to return the actual error last encountered
+- Always add large file support for windows
+- Include zconf.h for windows large file support
+- Include zconf.h.cmakein for windows large file support
+- Update zconf.h.cmakein on make distclean
+- Merge vestigial vsnprintf determination from zutil.h to gzguts.h
+- Clarify how gzopen() appends in zlib.h comments
+- Correct documentation of gzdirect() since junk at end now ignored
+- Add a transparent write mode to gzopen() when 'T' is in the m

svn commit: r230836 - stable/9/sys/vm

2012-01-31 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 31 18:42:22 2012
New Revision: 230836
URL: http://svn.freebsd.org/changeset/base/230836

Log:
  MFC r228133:
  Hide the internals of vm_page_lock(9) from the loadable modules.

Modified:
  stable/9/sys/vm/vm_page.c
  stable/9/sys/vm/vm_page.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/vm_page.c
==
--- stable/9/sys/vm/vm_page.c   Tue Jan 31 18:37:26 2012(r230835)
+++ stable/9/sys/vm/vm_page.c   Tue Jan 31 18:42:22 2012(r230836)
@@ -2642,6 +2642,36 @@ vm_page_test_dirty(vm_page_t m)
vm_page_dirty(m);
 }
 
+void
+vm_page_lock_KBI(vm_page_t m, const char *file, int line)
+{
+
+   mtx_lock_flags_(vm_page_lockptr(m), 0, file, line);
+}
+
+void
+vm_page_unlock_KBI(vm_page_t m, const char *file, int line)
+{
+
+   mtx_unlock_flags_(vm_page_lockptr(m), 0, file, line);
+}
+
+int
+vm_page_trylock_KBI(vm_page_t m, const char *file, int line)
+{
+
+   return (mtx_trylock_flags_(vm_page_lockptr(m), 0, file, line));
+}
+
+#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
+void
+vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line)
+{
+
+   mtx_assert_(vm_page_lockptr(m), a, file, line);
+}
+#endif
+
 int so_zerocp_fullpage = 0;
 
 /*

Modified: stable/9/sys/vm/vm_page.h
==
--- stable/9/sys/vm/vm_page.h   Tue Jan 31 18:37:26 2012(r230835)
+++ stable/9/sys/vm/vm_page.h   Tue Jan 31 18:42:22 2012(r230836)
@@ -218,11 +218,23 @@ extern struct vpglocks pa_lock[];
 
 #definePA_LOCK_ASSERT(pa, a)   mtx_assert(PA_LOCKPTR(pa), (a))
 
+#ifdef KLD_MODULE
+#definevm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, 
LOCK_LINE)
+#definevm_page_unlock(m)   vm_page_unlock_KBI((m), LOCK_FILE, 
LOCK_LINE)
+#definevm_page_trylock(m)  vm_page_trylock_KBI((m), LOCK_FILE, 
LOCK_LINE)
+#if defined(INVARIANTS)
+#definevm_page_lock_assert(m, a)   \
+vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__)
+#else
+#definevm_page_lock_assert(m, a)
+#endif
+#else  /* !KLD_MODULE */
 #definevm_page_lockptr(m)  (PA_LOCKPTR(VM_PAGE_TO_PHYS((m
 #definevm_page_lock(m) mtx_lock(vm_page_lockptr((m)))
 #definevm_page_unlock(m)   mtx_unlock(vm_page_lockptr((m)))
 #definevm_page_trylock(m)  mtx_trylock(vm_page_lockptr((m)))
 #definevm_page_lock_assert(m, a)   
mtx_assert(vm_page_lockptr((m)), (a))
+#endif
 
 #definevm_page_queue_free_mtx  vm_page_queue_free_lock.data
 /*
@@ -403,6 +415,13 @@ void vm_page_cowfault (vm_page_t);
 int vm_page_cowsetup(vm_page_t);
 void vm_page_cowclear (vm_page_t);
 
+void vm_page_lock_KBI(vm_page_t m, const char *file, int line);
+void vm_page_unlock_KBI(vm_page_t m, const char *file, int line);
+int vm_page_trylock_KBI(vm_page_t m, const char *file, int line);
+#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
+void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line);
+#endif
+
 #ifdef INVARIANTS
 void vm_page_object_lock_assert(vm_page_t m);
 #defineVM_PAGE_OBJECT_LOCK_ASSERT(m)   vm_page_object_lock_assert(m)
___
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: r230835 - vendor/libpcap/1.2.1

2012-01-31 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jan 31 18:37:26 2012
New Revision: 230835
URL: http://svn.freebsd.org/changeset/base/230835

Log:
  Create a new tag for 1.2.1 to clear up the issues with the previously
  botched tag.

Added:
  vendor/libpcap/1.2.1/
 - copied from r230834, vendor/libpcap/dist/
___
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: r230834 - vendor/libpcap/1.2.1

2012-01-31 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jan 31 18:36:42 2012
New Revision: 230834
URL: http://svn.freebsd.org/changeset/base/230834

Log:
  Remove a broken import/tag so we can re do it.

Deleted:
  vendor/libpcap/1.2.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: r230833 - vendor/libpcap/1.2.1/dist

2012-01-31 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jan 31 18:24:51 2012
New Revision: 230833
URL: http://svn.freebsd.org/changeset/base/230833

Log:
  Retag the 1.2.1 import to get the adds/removes correct.

Added:
  vendor/libpcap/1.2.1/dist/
 - copied from r230832, vendor/libpcap/dist/
___
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: r230832 - in vendor/libpcap/dist: . test

2012-01-31 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jan 31 18:24:25 2012
New Revision: 230832
URL: http://svn.freebsd.org/changeset/base/230832

Log:
  Add, remove and move files for the 1.2.1 import of libpcap
  
  Submitted by: wxs

Added:
  vendor/libpcap/dist/pcap-netfilter-linux.c   (contents, props changed)
  vendor/libpcap/dist/pcap-netfilter-linux.h   (contents, props changed)
  vendor/libpcap/dist/pcap-tstamp.manmisc.in   (contents, props changed)
  vendor/libpcap/dist/pcap_list_tstamp_types.3pcap.in   (contents, props 
changed)
  vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in   (contents, props changed)
  vendor/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap
  vendor/libpcap/dist/pcap_tstamp_type_val_to_name.3pcap
  vendor/libpcap/dist/test/
  vendor/libpcap/dist/test/filtertest.c
 - copied unchanged from r230831, vendor/libpcap/dist/filtertest.c
  vendor/libpcap/dist/test/findalldevstest.c
 - copied unchanged from r230831, vendor/libpcap/dist/findalldevstest.c
  vendor/libpcap/dist/test/nonblocktest.c   (contents, props changed)
  vendor/libpcap/dist/test/opentest.c
 - copied unchanged from r230831, vendor/libpcap/dist/opentest.c
  vendor/libpcap/dist/test/reactivatetest.c   (contents, props changed)
  vendor/libpcap/dist/test/selpolltest.c
 - copied unchanged from r230831, vendor/libpcap/dist/selpolltest.c
Deleted:
  vendor/libpcap/dist/filtertest.c
  vendor/libpcap/dist/findalldevstest.c
  vendor/libpcap/dist/opentest.c
  vendor/libpcap/dist/pcap_free_datalinks.3pcap
  vendor/libpcap/dist/pcap_freealldevs.3pcap
  vendor/libpcap/dist/selpolltest.c

Added: vendor/libpcap/dist/pcap-netfilter-linux.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/libpcap/dist/pcap-netfilter-linux.c  Tue Jan 31 18:24:25 2012
(r230832)
@@ -0,0 +1,468 @@
+/*
+ * Copyright (c) 2011 Jakub Zawadzki
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pcap-int.h"
+
+#ifdef NEED_STRERROR_H
+#include "strerror.h"
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "pcap-netfilter-linux.h"
+
+#define HDR_LENGTH (NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg
+
+#define NFLOG_IFACE "nflog"
+
+static int
+nflog_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, 
u_char *user)
+{
+   const unsigned char *buf;
+   int count = 0;
+   int len;
+
+   /* ignore interrupt system call error */
+   do {
+   len = recv(handle->fd, handle->buffer, handle->bufsize, 0);
+   if (handle->break_loop) {
+   handle->break_loop = 0;
+   return -2;
+   }
+   } while ((len == -1) && (errno == EINTR));
+
+   if (len < 0) {
+   snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't receive 
packet %d:%s", errno, pcap_strerror(errno));
+   return -1;
+   }
+
+   buf = handle->buffer;
+   while (len >= NLMSG_SPACE(0)) {
+   const struct nlmsghdr *nlh = (const struct nlmsghdr *) buf;
+   u_int32_t msg_len;
+
+   if (nlh->nlmsg_len < sizeof(struct nlmsghdr) || len < 
nlh->nlmsg_len) {
+   snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Message 
truncated: (got: %d) (nlmsg_len: %u)", len, nlh->nlmsg_len);
+   return 

svn commit: r230831 - stable/8/sys/dev/xen/netfront

2012-01-31 Thread Justin T. Gibbs
Author: gibbs
Date: Tue Jan 31 18:13:49 2012
New Revision: 230831
URL: http://svn.freebsd.org/changeset/base/230831

Log:
  MFC r225708 into stable/8:
  
  Modify the netfront driver so it can successfully attach to
  PV devices with the ioemu attribute set.
  
  sys/dev/xen/netfront/netfront.c:
o If a mac address for the interface cannot be found
  in the front-side XenStore tree, look for an entry
  in the back-side tree.  With ioemu devices, the
  emulator does not populate the front side tree and
  neither does Xend.
o Return an error rather than panic when an attach
  attempt fails.
  
  Reported by:  Janne Snabb (fix inspired by patch provided)
  PR:   kern/154302

Modified:
  stable/8/sys/dev/xen/netfront/netfront.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/dev/xen/netfront/netfront.c
==
--- stable/8/sys/dev/xen/netfront/netfront.cTue Jan 31 17:51:30 2012
(r230830)
+++ stable/8/sys/dev/xen/netfront/netfront.cTue Jan 31 18:13:49 2012
(r230831)
@@ -402,11 +402,33 @@ xen_net_read_mac(device_t dev, uint8_t m
 {
int error, i;
char *s, *e, *macstr;
+   const char *path;
 
-   error = xs_read(XST_NIL, xenbus_get_node(dev), "mac", NULL,
-   (void **) &macstr);
-   if (error)
+   path = xenbus_get_node(dev);
+   error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr);
+   if (error == ENOENT) {
+   /*
+* Deal with missing mac XenStore nodes on devices with
+* HVM emulation (the 'ioemu' configuration attribute)
+* enabled.
+*
+* The HVM emulator may execute in a stub device model
+* domain which lacks the permission, only given to Dom0,
+* to update the guest's XenStore tree.  For this reason,
+* the HVM emulator doesn't even attempt to write the
+* front-side mac node, even when operating in Dom0.
+* However, there should always be a mac listed in the
+* backend tree.  Fallback to this version if our query
+* of the front side XenStore location doesn't find
+* anything.
+*/
+   path = xenbus_get_otherend_path(dev);
+   error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr);
+   }
+   if (error != 0) {
+   xenbus_dev_fatal(dev, error, "parsing %s/mac", path);
return (error);
+   }
 
s = macstr;
for (i = 0; i < ETHER_ADDR_LEN; i++) {
@@ -447,7 +469,7 @@ netfront_attach(device_t dev)
err = create_netdev(dev);
if (err) {
xenbus_dev_fatal(dev, err, "creating netdev");
-   return err;
+   return (err);
}
 
 #if __FreeBSD_version >= 70
@@ -457,7 +479,7 @@ netfront_attach(device_t dev)
&xn_enable_lro, 0, "Large Receive Offload");
 #endif
 
-   return 0;
+   return (0);
 }
 
 
@@ -2020,11 +2042,8 @@ create_netdev(device_t dev)
}

err = xen_net_read_mac(dev, np->mac);
-   if (err) {
-   xenbus_dev_fatal(dev, err, "parsing %s/mac",
-   xenbus_get_node(dev));
+   if (err)
goto out;
-   }

/* Set up ifnet structure */
ifp = np->xn_ifp = if_alloc(IFT_ETHER);
@@ -2066,8 +2085,7 @@ create_netdev(device_t dev)
 exit:
gnttab_free_grant_references(np->gref_tx_head);
 out:
-   panic("do something smart");
-
+   return (err);
 }
 
 /**
___
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: r230830 - head/sys/amd64/acpica

2012-01-31 Thread Jung-uk Kim
Author: jkim
Date: Tue Jan 31 17:51:30 2012
New Revision: 230830
URL: http://svn.freebsd.org/changeset/base/230830

Log:
  - Restore XCR0 before restoring extended FPU states.
  - Update my copyright dates.
  
  Reviewed by:  kib

Modified:
  head/sys/amd64/acpica/acpi_switch.S
  head/sys/amd64/acpica/acpi_wakecode.S
  head/sys/amd64/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_switch.S
==
--- head/sys/amd64/acpica/acpi_switch.S Tue Jan 31 17:24:08 2012
(r230829)
+++ head/sys/amd64/acpica/acpi_switch.S Tue Jan 31 17:51:30 2012
(r230830)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2001 Takanori Watanabe 
  * Copyright (c) 2001 Mitsuru IWASAKI 
- * Copyright (c) 2008-2010 Jung-uk Kim 
+ * Copyright (c) 2008-2012 Jung-uk Kim 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -95,7 +95,6 @@ ENTRY(acpi_restorecpu)
 
/* Restore CR0 except for FPU mode. */
movqPCB_CR0(%rdi), %rax
-   movq%rax, %rcx
andq$~(CR0_EM | CR0_TS), %rax
movq%rax, %cr0
 
@@ -146,21 +145,26 @@ ENTRY(acpi_restorecpu)
 
/* Restore FPU state. */
fninit
-   movqWAKEUP_CTX(fpusave),%rdi
-   cmpl$0,use_xsave
-   jne 1f
-   fxrstor (%rdi)
+   movqWAKEUP_CTX(xsmask), %rax
+   testq   %rax, %rax
+   jz  1f
+   movq%rax, %rdx
+   shrq$32, %rdx
+   movl$XCR0, %ecx
+/* xsetbv  */
+   .byte   0x0f, 0x01, 0xd1
+   movqWAKEUP_CTX(fpusave), %rcx
+/* xrstor  (%rcx) */
+   .byte   0x0f, 0xae, 0x29
jmp 2f
-1: movlxsave_mask,%eax
-   movlxsave_mask+4,%edx
-/* xrstor  (%rdi) */
-   .byte   0x0f,0xae,0x2f
+1:
+   movqWAKEUP_CTX(fpusave), %rcx
+   fxrstor (%rcx)
 2:
 
/* Reload CR0. */
-   movq%rcx, %cr0
-
-   movqWAKEUP_CTX(pcb),%rdi
+   movqPCB_CR0(%rdi), %rax
+   movq%rax, %cr0
 
/* Restore return address. */
movqPCB_RIP(%rdi), %rax

Modified: head/sys/amd64/acpica/acpi_wakecode.S
==
--- head/sys/amd64/acpica/acpi_wakecode.S   Tue Jan 31 17:24:08 2012
(r230829)
+++ head/sys/amd64/acpica/acpi_wakecode.S   Tue Jan 31 17:51:30 2012
(r230830)
@@ -2,7 +2,7 @@
  * Copyright (c) 2001 Takanori Watanabe 
  * Copyright (c) 2001 Mitsuru IWASAKI 
  * Copyright (c) 2003 Peter Wemm
- * Copyright (c) 2008-2010 Jung-uk Kim 
+ * Copyright (c) 2008-2012 Jung-uk Kim 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -284,6 +284,8 @@ wakeup_cstar:
.quad   0
 wakeup_sfmask:
.quad   0
+wakeup_xsmask:
+   .quad   0
 wakeup_cpu:
.long   0
 dummy:

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Tue Jan 31 17:24:08 2012
(r230829)
+++ head/sys/amd64/acpica/acpi_wakeup.c Tue Jan 31 17:51:30 2012
(r230830)
@@ -2,7 +2,7 @@
  * Copyright (c) 2001 Takanori Watanabe 
  * Copyright (c) 2001 Mitsuru IWASAKI 
  * Copyright (c) 2003 Peter Wemm
- * Copyright (c) 2008-2010 Jung-uk Kim 
+ * Copyright (c) 2008-2012 Jung-uk Kim 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -386,6 +386,7 @@ acpi_install_wakeup_handler(struct acpi_
WAKECODE_FIXUP(wakeup_lstar, uint64_t, rdmsr(MSR_LSTAR));
WAKECODE_FIXUP(wakeup_cstar, uint64_t, rdmsr(MSR_CSTAR));
WAKECODE_FIXUP(wakeup_sfmask, uint64_t, rdmsr(MSR_SF_MASK));
+   WAKECODE_FIXUP(wakeup_xsmask, uint64_t, xsave_mask);
 
/* Build temporary page tables below realmode code. */
pt4 = wakeaddr;
___
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: r230583 - head/sys/kern

2012-01-31 Thread David Schultz
On Tue, Jan 31, 2012, Konstantin Belousov wrote:
> On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote:
> > On Mon, Jan 30, 2012, Kostik Belousov wrote:
> > > On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote:
> > > > On Sun, Jan 29, 2012, Kostik Belousov wrote:
> > > > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote:
> > > > > > On Sat, Jan 28, 2012, Kostik Belousov wrote:
> > > > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote:
> > > > > > > > The correct limit on the maximum size of a single read/write is
> > > > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX.  It's not safe to raise the
> > > > > > > > limit yet, though, because of bugs in several filesystems.  For
> > > > > > > > example, FFS copies uio_resid into a local variable of type int.
> > > > > > > > I have some old patches that fix some of these issues for FFS 
> > > > > > > > and
> > > > > > > > cd9660, but surely there are more places I didn't notice.
> > > > > > > > 
> > > > > > > Absolutely agree.
> > > > > > > 
> > > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch
> > > > > > 
> > > > > > Nice.  You found a lot more than I've got in my tree, and you even
> > > > > > fixed the return values.  There are at least a few more places to
> > > > > > fix.  For instance, cd9660 and the NFS client pass uio_resid or
> > > > > > iov_len to min(), which operates on ints.  (Incidentally, C11
> > > > > > generics ought to make it possible to write type-generic min()
> > > > > > and max() functions.)
> > > > > 
> > > > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch
> > > > > changed them to MIN().
> > > > 
> > > > This looks good to me.  I tried to think of other places that you
> > > > might have missed, and the only one that occurred to me is the
> > > Might ? I think this is a blatant understate.
> > > 
> > > > pipe code.  sys_pipe.c has an `int orig_resid' and lots of bogus
> > > > casts of iov_len and uio_resid to type u_int.  Some look harmless,
> > > > although it appears that writing a multiple of 2^32 bytes might
> > > > result in pipe_build_write_buffer() allocating a 0-length buffer.
> > > > 
> > > > My only reservation is that raising the limit could unmask a
> > > > kernel buffer overflow if we missed something, but I guess we have
> > > > to cross that bridge some day anyway.
> > > Yes, and it is an obvious reason why I am chicken to commit this for
> > > so long time. One more place, if this is reasonable to count as 'one'
> > > place, are the cdevsw methods. devfs passes uio down to the drivers.
> > 
> > That's why I'm glad I'm not committing it. :)  A more conservative
> > change (also known as "kicking the can down the road") would be to
> > add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems
> > that have been thoroughly reviewed.  The VFS layer could cap the size
> > at INT_MAX for file systems without the flag.
> At least I will get more mail after the commit, I hope.
> 
> I disagree with the VFCF_LONGIO approach. It will cause much head-scratching
> for unsuspecting user who would try to use > 4GB transfers.
> 
> What I can do, is to commit all changes except removals of the checks
> for INT_MAX. After type changes settle, I can try to gather enough
> bravery to flip the checks in HEAD, possibly with temporary sysctl
> to return to old behaviour for emergency (AKA hole).

That sounds like a good plan to me.

As an aside, I wonder if we could convince the clang folks to add
a warning similar to `lint -a', which complains about every long->int
narrowing conversion that doesn't have an explicit cast.  Modern
languages such as Java and C# require casts for narrowing
conversions, and I'd be a lot more confident about this change if
we did the same for the FreeBSD kernel.

> > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
> > > index 9edcb74..332ec37 100644
> > > --- a/sys/kern/sys_pipe.c
> > > +++ b/sys/kern/sys_pipe.c
> > [...]
> > > @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio)
> > >struct pipe *wpipe;
> > >struct uio *uio;
> > >  {
> > > - u_int size;
> > > + size_t size;
> > >   int i;
> > >  
> > >   PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED);
> > >   KASSERT(wpipe->pipe_state & PIPE_DIRECTW,
> > > ("Clone attempt on non-direct write pipe!"));
> > >  
> > > - size = (u_int) uio->uio_iov->iov_len;
> > > + size = uio->uio_iov->iov_len;
> > >   if (size > wpipe->pipe_buffer.size)
> > >  size = wpipe->pipe_buffer.size;
> > 
> > The transfer can't be bigger than the max pipe buffer size (64k),
> > so `size = (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)'
> > should suffice.  The same comment applies elsewhere in the file.
> 
> True. If you much prefer this version, I will change the patch. But I do
> think that my changes are cleaner.

I don't mind either way.  I haven't touched anything remotely
close to that code in years.
__

svn commit: r230829 - vendor/libpcap/1.2.1

2012-01-31 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jan 31 17:24:08 2012
New Revision: 230829
URL: http://svn.freebsd.org/changeset/base/230829

Log:
  Create a tag for version 1.2.1 of libpcap.

Added:
  vendor/libpcap/1.2.1/
 - copied from r230828, vendor/libpcap/dist/
___
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: r230828 - in vendor/libpcap/dist: . Win32/Include Win32/Prj Win32/Src bpf/net packaging pcap

2012-01-31 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jan 31 17:22:07 2012
New Revision: 230828
URL: http://svn.freebsd.org/changeset/base/230828

Log:
  Update sources to 1.2.1
  
  Submitted by: wxs@

Modified:
  vendor/libpcap/dist/CHANGES
  vendor/libpcap/dist/CREDITS
  vendor/libpcap/dist/Makefile.in
  vendor/libpcap/dist/README
  vendor/libpcap/dist/README.linux
  vendor/libpcap/dist/VERSION
  vendor/libpcap/dist/Win32/Include/bittypes.h
  vendor/libpcap/dist/Win32/Prj/libpcap.dsp
  vendor/libpcap/dist/Win32/Src/gai_strerror.c
  vendor/libpcap/dist/Win32/Src/getaddrinfo.c
  vendor/libpcap/dist/aclocal.m4
  vendor/libpcap/dist/bpf/net/bpf_filter.c
  vendor/libpcap/dist/config.h.in
  vendor/libpcap/dist/configure
  vendor/libpcap/dist/configure.in
  vendor/libpcap/dist/ethertype.h
  vendor/libpcap/dist/fad-getad.c
  vendor/libpcap/dist/gencode.c
  vendor/libpcap/dist/gencode.h
  vendor/libpcap/dist/grammar.y
  vendor/libpcap/dist/inet.c
  vendor/libpcap/dist/packaging/pcap.spec.in
  vendor/libpcap/dist/pcap-bpf.c
  vendor/libpcap/dist/pcap-bt-linux.c
  vendor/libpcap/dist/pcap-common.c
  vendor/libpcap/dist/pcap-config.in
  vendor/libpcap/dist/pcap-dag.c
  vendor/libpcap/dist/pcap-dlpi.c
  vendor/libpcap/dist/pcap-filter.manmisc.in
  vendor/libpcap/dist/pcap-int.h
  vendor/libpcap/dist/pcap-libdlpi.c
  vendor/libpcap/dist/pcap-linktype.manmisc.in
  vendor/libpcap/dist/pcap-linux.c
  vendor/libpcap/dist/pcap-stdinc.h
  vendor/libpcap/dist/pcap-usb-linux.c
  vendor/libpcap/dist/pcap-win32.c
  vendor/libpcap/dist/pcap.3pcap.in
  vendor/libpcap/dist/pcap.c
  vendor/libpcap/dist/pcap/bpf.h
  vendor/libpcap/dist/pcap/pcap.h
  vendor/libpcap/dist/pcap_activate.3pcap
  vendor/libpcap/dist/pcap_can_set_rfmon.3pcap
  vendor/libpcap/dist/pcap_compile.3pcap.in
  vendor/libpcap/dist/pcap_datalink.3pcap.in
  vendor/libpcap/dist/pcap_datalink_name_to_val.3pcap
  vendor/libpcap/dist/pcap_datalink_val_to_name.3pcap
  vendor/libpcap/dist/pcap_fileno.3pcap
  vendor/libpcap/dist/pcap_findalldevs.3pcap
  vendor/libpcap/dist/pcap_free_datalinks.3pcap
  vendor/libpcap/dist/pcap_freealldevs.3pcap
  vendor/libpcap/dist/pcap_get_selectable_fd.3pcap
  vendor/libpcap/dist/pcap_list_datalinks.3pcap.in
  vendor/libpcap/dist/pcap_loop.3pcap
  vendor/libpcap/dist/pcap_major_version.3pcap
  vendor/libpcap/dist/pcap_next_ex.3pcap
  vendor/libpcap/dist/pcap_open_live.3pcap
  vendor/libpcap/dist/pcap_set_datalink.3pcap
  vendor/libpcap/dist/savefile.c
  vendor/libpcap/dist/scanner.l
  vendor/libpcap/dist/sf-pcap-ng.c
  vendor/libpcap/dist/sf-pcap.c

Modified: vendor/libpcap/dist/CHANGES
==
--- vendor/libpcap/dist/CHANGES Tue Jan 31 15:53:54 2012(r230827)
+++ vendor/libpcap/dist/CHANGES Tue Jan 31 17:22:07 2012(r230828)
@@ -1,3 +1,77 @@
+Friday  December 9, 2011.  g...@alum.mit.edu.
+Summary for 1.2.1 libpcap release
+   Update README file.
+   Fix typoes in README.linux file.
+   Clean up some compiler warnings.
+   Fix Linux compile problems and tests for ethtool.h.
+   Treat Debian/kFreeBSD and GNU/Hurd as systems with GNU
+toolchains.
+   Support 802.1 QinQ as a form of VLAN in filters.
+   Treat "carp" as equivalent to "vrrp" in filters.
+   Fix code generated for "ip6 protochain".
+   Add some new link-layer header types.
+   Support capturing NetFilter log messages on Linux.
+   Clean up some error messages.
+   Turn off monitor mode on exit for mac80211 interfaces on Linux.
+   Fix problems turning monitor mode on for non-mac80211 interfaces
+on Linux.
+   Properly fail if /sys/class/net or /proc/net/dev exist but can't
+be opened.
+   Fail if pcap_activate() is called on an already-activated
+pcap_t, and add a test program for that.
+   Fix filtering in pcap-ng files.
+   Don't build for PowerPC on Mac OS X Lion.
+   Simplify handling of new DLT_/LINKTYPE_ values.
+   Expand pcap(3PCAP) man page.
+
+Sunday  July 24, 2011.  m...@sandelman.ca.
+Summary for 1.2 libpcap release
+All of the changes listed below for 1.1.1 and 1.1.2.
+Changes to error handling for pcap_findalldevs().
+Fix the calculation of the frame size in memory-mapped captures.
+Add a link-layer header type for STANAG 5066 D_PDUs.
+Add a link-layer type for a variant of 3GPP TS 27.010.
+Noted real nature of LINKTYPE_ARCNET.
+Add a link-layer type for DVB-CI.
+Fix configure-script discovery of VLAN acceleration support.
+ see http://netoptimizer.blogspot.com/2010/09/tcpdump-vs-vlan-tags.html
+Linux, HP-UX, AIX, NetBSD and OpenBSD compilation/conflict fixes.
+Protect against including AIX 5.x's  having been included.
+Add DLT_DBUS, for raw D-Bus messages.
+Treat either EPERM or EACCES as "no soup for you".
+Changes to permissions on DLPI systems.
+Add DLT_IEEE802_15_4_NOFCS for 802.15.

Re: svn commit: r230777 - head/sys/amd64/acpica

2012-01-31 Thread Jung-uk Kim
On Tuesday 31 January 2012 08:13 am, Gavin Atkinson wrote:
> On Mon, 2012-01-30 at 18:28 +, Jung-uk Kim wrote:
> > Author: jkim
> > Date: Mon Jan 30 18:28:56 2012
> > New Revision: 230777
> > URL: http://svn.freebsd.org/changeset/base/230777
> >
> > Log:
> >   Naturally align a newly added wakeup_fpusave.
>
> I hadn't noticed this change when it went in initially.  Out of
> interest, is the save/restore of the FPU state over suspend/resume
> likely to fix the panics some people see over a suspend/resume if
> they have run VirtualBox or similar before suspend?  I've been
> assuming that it was related to some CPU state not being
> saved/restored, but never dug into it myself.

I am actually not sure but FPU state won't be problem.  Probably 
VirtualBox device drivers don't implement suspend/resume methods.

In fact, something broke suspend/resume for my desktop recently but I 
don't have enough free time to dig into it myself. :-(

Jung-uk Kim
___
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: r230808 - in head/sys: dev/ie sys

2012-01-31 Thread Bruce Evans

On Tue, 31 Jan 2012, Sergey Kandaurov wrote:


Log:
 Isolate v_caddr_t in the ie driver.

 Submitted by:  Bruce Evans on net@


Thanks.


...
Modified: head/sys/sys/types.h
==
--- head/sys/sys/types.hTue Jan 31 12:57:21 2012(r230807)
+++ head/sys/sys/types.hTue Jan 31 13:00:40 2012(r230808)
@@ -73,7 +73,6 @@ typedef   quad_t *qaddr_t;

typedef char *  caddr_t;/* core address */
typedef const char *c_caddr_t;  /* core address, pointer to const */
-typedef__volatile char *v_caddr_t; /* core address, pointer to 
volatile */

#ifndef _BLKSIZE_T_DECLARED
typedef __blksize_t blksize_t;


c_caddr_t is a bit harder to fix or isolate.  I removed it, then fixed
the things that broke, but only the ones that were used in my normal
kernel (or perhaps GENERIC).  These are most mchain and its uses:
- mbchain.9, mchain.9 (these also have a bogus include of uio.h)
- nwfs_subr.c (remove the bogus casts to c_caddr_t and also many more
  to caddr_t, after fixing APIs).  This is barely maintained, and might
  go away for other reasons (it needs Giant?).
- subr_mchain.c, and headers: change APIs to use const void * instead of
  c_caddr_t, and void * instead of caddr_t; add casts to const char *
  or char * to access or do pointer arithmetic on these void *.
- subr_mbuf.c: like subr_mchain.c, but only 1 place to unbreak.
- ncp_rq.c: like nwfs_subr.c, but less to change.
- smb_subr.c: change just 1 API to take const void * and void * instead
  of c_caddr_t etc., and add casts.  The casts are now to const char **
  and char **.  That's 1 more star than before, so I don't see how this
  worked or works.
- linker.h: the same bugs affect the "opaque" symbol linker_sym_t.  We
  have to peer inside it to know that it is a pointer and modify it
  to make it a pointer to const.  We use c_linker_sym_t for the latter,
  and since it is bogusly a caddr_t, we used c_caddr_t for the latter.
  I changed the latter to use const char *, but didn't try to fix the
  bogus opaqueness.
- mchain.h: one of the headers affected.  Also add a forward
  declaration of struct uio to it, so that uio.h isn't prerequisite,
  and fix the unsorting of the forward declarations.
- types.h: remove c_caddr_t.

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: r230822 - head/sys/dev/pci

2012-01-31 Thread John Baldwin
Author: jhb
Date: Tue Jan 31 15:48:40 2012
New Revision: 230822
URL: http://svn.freebsd.org/changeset/base/230822

Log:
  Fix a spelling mistake in the surprise link down error constant.
  
  Submitted by: glebius

Modified:
  head/sys/dev/pci/pcireg.h

Modified: head/sys/dev/pci/pcireg.h
==
--- head/sys/dev/pci/pcireg.h   Tue Jan 31 15:48:33 2012(r230821)
+++ head/sys/dev/pci/pcireg.h   Tue Jan 31 15:48:40 2012(r230822)
@@ -697,7 +697,7 @@
 #definePCIR_AER_UC_STATUS  0x04
 #definePCIM_AER_UC_TRAINING_ERROR  0x0001
 #definePCIM_AER_UC_DL_PROTOCOL_ERROR   0x0010
-#definePCIM_AER_UC_SUPRISE_LINK_DOWN   0x0020
+#definePCIM_AER_UC_SURPRISE_LINK_DOWN  0x0020
 #definePCIM_AER_UC_POISONED_TLP0x1000
 #definePCIM_AER_UC_FC_PROTOCOL_ERROR   0x2000
 #definePCIM_AER_UC_COMPLETION_TIMEOUT  0x4000
___
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: r230812 - head/sbin/reboot

2012-01-31 Thread Ed Maste
Author: emaste
Date: Tue Jan 31 15:32:05 2012
New Revision: 230812
URL: http://svn.freebsd.org/changeset/base/230812

Log:
  Add -e to set arbitrary kernel environment variables.
  
  Nextboot(8) can now set any combination of kernel name (-k), kernel
  options (-o), and environment strings (-e).  As a result of this change
  -k also becomes optional.
  
  Reviewed by:  freebsd-current (Ian Lepore, pluknet@, jhb@)

Modified:
  head/sbin/reboot/nextboot.8
  head/sbin/reboot/nextboot.sh

Modified: head/sbin/reboot/nextboot.8
==
--- head/sbin/reboot/nextboot.8 Tue Jan 31 15:25:00 2012(r230811)
+++ head/sbin/reboot/nextboot.8 Tue Jan 31 15:32:05 2012(r230812)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 4, 2002
+.Dd January 31, 2012
 .Dt NEXTBOOT 8
 .Os
 .Sh NAME
@@ -32,15 +32,17 @@
 .Nd "specify an alternate kernel and boot flags for the next reboot"
 .Sh SYNOPSIS
 .Nm
+.Op Fl e Ar variable=value
 .Op Fl f
+.Op Fl k Ar kernel
 .Op Fl o Ar options
-.Fl k Ar kernel
 .Nm
 .Fl D
 .Sh DESCRIPTION
 The
 .Nm
-utility allows specifying an alternate kernel and/or boot flags for the
+utility allows specifying some combination of an alternate kernel, boot flags
+and kernel environment for the
 next time the machine is booted.
 Once the
 .Xr loader 8
@@ -58,6 +60,11 @@ with this
 option removes an existing
 .Nm
 configuration.
+.It Fl e Ar variable=value
+This option adds the provided variable and value to the kernel environment.
+The value is quoted when written to the
+.Nm
+configuration.
 .It Fl f
 This
 option disables the sanity checking which checks if the kernel really exists

Modified: head/sbin/reboot/nextboot.sh
==
--- head/sbin/reboot/nextboot.shTue Jan 31 15:25:00 2012
(r230811)
+++ head/sbin/reboot/nextboot.shTue Jan 31 15:32:05 2012
(r230812)
@@ -2,31 +2,59 @@
 #
 # Copyright 2002. Gordon Tetlow.
 # gor...@freebsd.org
+# Copyright (c) 2012 Sandvine Incorporated. All rights reserved.
 #
 # $FreeBSD$
 
 delete="NO"
+kenv=
 force="NO"
 nextboot_file="/boot/nextboot.conf"
 
+add_kenv()
+{
+   local var value
+
+   var=$1
+   # strip literal quotes if passed in
+   value=${2%\"*}
+   value=${value#*\"}
+
+   if [ -n "${kenv}" ]; then
+   kenv="${kenv}
+"
+   fi
+   kenv="${kenv}${var}=\"${value}\""
+}
+
 display_usage() {
-   echo "Usage: nextboot [-f] [-o options] -k kernel"
+   echo "Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]"
echo "   nextboot -D"
 }
 
-while getopts "Dfk:o:" argument ; do
+while getopts "De:fk:o:" argument ; do
case "${argument}" in
D)
delete="YES"
;;
+   e)
+   var=${OPTARG%%=*}
+   value=${OPTARG#*=}
+   if [ -z "$var" -o -z "$value" ]; then
+   display_usage
+   exit 1
+   fi
+   add_kenv "$var" "$value"
+   ;;
f)
force="YES"
;;
k)
kernel="${OPTARG}"
+   add_kenv kernel "$kernel"
;;
o)
-   kernel_options="${OPTARG}"
+   add_kenv kernel_options "${OPTARG}"
;;
*)
display_usage
@@ -40,12 +68,12 @@ if [ ${delete} = "YES" ]; then
exit 0
 fi
 
-if [ "xxx${kernel}" = "xxx" ]; then
+if [ -z "${kenv}" ]; then
display_usage
exit 1
 fi
 
-if [ ${force} = "NO" -a ! -d /boot/${kernel} ]; then
+if [ -n "${kernel}" -a ${force} = "NO" -a ! -d /boot/${kernel} ]; then
echo "Error: /boot/${kernel} doesn't exist. Use -f to override."
exit 1
 fi
@@ -60,6 +88,5 @@ done
 
 cat > ${nextboot_file} << EOF
 nextboot_enable="YES"
-kernel="${kernel}"
-kernel_options="${kernel_options}"
+$kenv
 EOF
___
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: r230583 - head/sys/kern

2012-01-31 Thread Bruce Evans

On Tue, 31 Jan 2012, Konstantin Belousov wrote:


On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote:

That's why I'm glad I'm not committing it. :)  A more conservative
change (also known as "kicking the can down the road") would be to
add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems
that have been thoroughly reviewed.  The VFS layer could cap the size
at INT_MAX for file systems without the flag.

At least I will get more mail after the commit, I hope.

I disagree with the VFCF_LONGIO approach. It will cause much head-scratching
for unsuspecting user who would try to use > 4GB transfers.


No one cared when this was broken for almost 10 years by 4.4BSD changing
the type of iov_len from int to size_t.  You can almost equally safely
break it again :(.  Previously (in FreeBSD-1 and presumably in Net/2)
iov_len had the same type as uio_resid, and the code in readv(), etc.,
depended on this and also on benign undefined behaviour on overflow
to detect overflow (after it gave undefined behaviour by occurring)
when adding up iov_len's to get uio_resid.  The bug didn't require
passing a buffer of size > INT_MAX to reach -- it just required a
single or multiple iov_len whose total size exceeded INT_MAX.  FreeBSD
fixed this in 2003.

size_t for iov_len is bogus even if the limit is SSIZE max.  It allows
a single iov to have a size that cannot work, and n iov's to have a
size almost 2*n times too large to work.  Unfortunately, POSIX
standardizes the type of iov_len as size_t.  It is interesting that
POSIX says "shall fail" for readv() when the sum of the iov_len values
overflowed [sic] an ssize_t.  For read(), the behaviour when the count
exceeds {SSIZE_MAX} is implementation-defined.  This gives the silly
possibility that read() can work for a size that is almost twice as
large as readv(), using a single count instead of an array of counts.
It is also strange that readv() refers to ssize_t while read() refers
to {SSIZE_MAX}.  POSIX standardizes the bug that {SSIZE_MAX} is the
limit of the type, although that may be unrelated to sizes that can
work.  If these APIs had been correctly designed, then the limit would
be {READ_MAX} and unrelated to any size type (except that the type
must be large enough to represent {READ_MAX}).  It would normally be
INT_MAX or much smaller.  readv() also has the bogus specification
that if iovcnt is <= 0 or > {IOV_MAX}, then failure is optional.
So failure is optional for a hard error like iovcnt > {IOV_MAX},
but is required for a condition that is not required to be an error
for a similar API (count > {SSIZE_MAX}).  I only checked a 2001
draft for this.  Maybe some of these bugs have been fixed.


What I can do, is to commit all changes except removals of the checks
for INT_MAX. After type changes settle, I can try to gather enough
bravery to flip the checks in HEAD, possibly with temporary sysctl
to return to old behaviour for emergency (AKA hole).




diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 9edcb74..332ec37 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c

[...]

@@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio)
   struct pipe *wpipe;
   struct uio *uio;
 {
-   u_int size;
+   size_t size;
int i;

PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED);
KASSERT(wpipe->pipe_state & PIPE_DIRECTW,
  ("Clone attempt on non-direct write pipe!"));

-   size = (u_int) uio->uio_iov->iov_len;
+   size = uio->uio_iov->iov_len;
if (size > wpipe->pipe_buffer.size)
   size = wpipe->pipe_buffer.size;


The transfer can't be bigger than the max pipe buffer size (64k),
so `size = (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)'
should suffice.  The same comment applies elsewhere in the file.


True. If you much prefer this version, I will change the patch. But I do
think that my changes are cleaner.


size_t is a bogus type for `size', since it must still be a u_int to
work.  For example, when it is assigned to the u_int wpipe->pipe_map.cnt.
This shouldn't be "fixed" by bloating the type to size_t throughout
(any global change should be to int to give suitably undefined behaviour
on overflow).  There must be an implicit or explicit check on it
somewhere that it fits.  This check is provided by the comparison with
wpipe->pipe_buffer.size.  But the above is a bad way to write it --
it should be checked before assignment, to avoid any possibility of
overflow or sign extension of either operand before the check:

u_int size;

if (uio->uio_iov->iov_len > wpipe->pipe_buffer.size)
size = wpipe->pipe_buffer.size;
else
size = uio->uio_iov->iov_len;

This is the same as the MIN() expression (without a bogus cast).  I
think I want to write it out verbosely like this and not use MIN(),
even if MIN() were not a style bug, to make it clear that this is
a correct bounds check.

Bruce
__

Re: svn commit: r230622 - head

2012-01-31 Thread Rafal Jaworowski

On 2012-01-31, at 14:53, Dimitry Andric wrote:

> On 2012-01-31 14:20, Rafal Jaworowski wrote:
>> On 2012-01-30, at 22:56, Dimitry Andric wrote:
> ...
>>> That said, I still don't understand why the generated aicasm_scan.c file
>>> is still defining the input() function.  Rafal, just to be sure, can you
>>> please paste the file that was generated during your buildkernel?
>> 
>> Problem identified: the auto-gen'd aicasm files would not get updated in the 
>> preexisting kernel OBJ subdir. After wiping out the OBJ sub dir entirely 
>> make buildkernel works fine.
>> 
>> Do you know why would the generated aicasm* files not get a refresh in the 
>> kernel OBJ dir?
> 
> Well, in general, incremental building is difficult to get working for
> all corner cases, like this particular one.  The lexer and scanner .c
> files are generated from .l and .y files, so if the latter did not get
> an updated timestamp, the .c files will not be regenerated either.
> 
> The only way to fix this would be to add a dependency on the actual lex
> and yacc executables.  But that is probably overkill: if you wanted to
> be consistent, you would also have to relink every executable if ld gets
> updated, recompile every object file if cc gets updated, and so on.
> 
> It's probably easier to just clean out your object tree, and build from
> scratch. :)

Sure, I was just curious. Thanks for help!

Rafal

___
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: r230622 - head

2012-01-31 Thread Dimitry Andric

On 2012-01-31 14:20, Rafal Jaworowski wrote:

On 2012-01-30, at 22:56, Dimitry Andric wrote:

...

That said, I still don't understand why the generated aicasm_scan.c file
is still defining the input() function.  Rafal, just to be sure, can you
please paste the file that was generated during your buildkernel?


Problem identified: the auto-gen'd aicasm files would not get updated in the 
preexisting kernel OBJ subdir. After wiping out the OBJ sub dir entirely make 
buildkernel works fine.

Do you know why would the generated aicasm* files not get a refresh in the 
kernel OBJ dir?


Well, in general, incremental building is difficult to get working for
all corner cases, like this particular one.  The lexer and scanner .c
files are generated from .l and .y files, so if the latter did not get
an updated timestamp, the .c files will not be regenerated either.

The only way to fix this would be to add a dependency on the actual lex
and yacc executables.  But that is probably overkill: if you wanted to
be consistent, you would also have to relink every executable if ld gets
updated, recompile every object file if cc gets updated, and so on.

It's probably easier to just clean out your object tree, and build from
scratch. :)

___
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: r230777 - head/sys/amd64/acpica

2012-01-31 Thread Gavin Atkinson
On Mon, 2012-01-30 at 18:28 +, Jung-uk Kim wrote:
> Author: jkim
> Date: Mon Jan 30 18:28:56 2012
> New Revision: 230777
> URL: http://svn.freebsd.org/changeset/base/230777
> 
> Log:
>   Naturally align a newly added wakeup_fpusave.

I hadn't noticed this change when it went in initially.  Out of
interest, is the save/restore of the FPU state over suspend/resume
likely to fix the panics some people see over a suspend/resume if they
have run VirtualBox or similar before suspend?  I've been assuming that
it was related to some CPU state not being saved/restored, but never dug
into it myself.

Thanks,

Gavin
___
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: r230622 - head

2012-01-31 Thread Rafal Jaworowski

On 2012-01-30, at 22:56, Dimitry Andric wrote:

> On 2012-01-30 21:48, Ian Lepore wrote:
>> On Mon, 2012-01-30 at 21:08 +0100, Dimitry Andric wrote:
>>> On 2012-01-30 20:27, Rafal Jaworowski wrote:
>>> ...
>   Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the
>   bootstrap tools directories are searched before the regular ones.
 
 Is this supposed to work for cross building as well? I'm still 
 encountering problems on a 7.3 host build:
 
 1. Cross world builds fine
 make -j 8 buildworld TARGET_ARCH=arm
 
 2. Kernel fails w/ the aicasm
 make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG
 [...]
 cc -O2 -pipe -nostdinc -I/usr/include -I. 
 -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99  
 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter 
 -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
 -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter 
 -Wcast-align -Wno-pointer-sign -c aicasm_scan.c
 cc1: warnings being treated as errors
 /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: 
 warning: function declaration isn't a prototype
>>> 
>>> Can you please try doing "make buildenv TARGET_ARCH=arm", then run
>>> "which lex" and "which yacc"?
>> 
>> Shouldn't lex and yacc be listed in the Makefile.inc1 bootstrap-tools
>> target for this to be fully effective?  It looks like neither is in
>> RELENG_7 and lex is only conditionally listed in RELENG_8.
> 
> It is, for head at least (but I think I will MFC this change, if it
> turns out to work correctly).  Look in Makefile.inc1, around line 1030:
> 
> .if ${BOOTSTRAPPING} < 96
> _lex= usr.bin/lex
> _yacc=usr.bin/yacc
> .endif
> 
> I have assumed Rafal is building a head checkout on 7.3 release.  Since
> BOOTSTRAPPING will most likely be 703000, the lex and yacc targets are
> built during the bootstrap-tools stage.
> 
> That said, I still don't understand why the generated aicasm_scan.c file
> is still defining the input() function.  Rafal, just to be sure, can you
> please paste the file that was generated during your buildkernel?

Problem identified: the auto-gen'd aicasm files would not get updated in the 
preexisting kernel OBJ subdir. After wiping out the OBJ sub dir entirely make 
buildkernel works fine.

Do you know why would the generated aicasm* files not get a refresh in the 
kernel OBJ dir?

Rafal

___
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: r230808 - in head/sys: dev/ie sys

2012-01-31 Thread Sergey Kandaurov
On 31 January 2012 17:00, Sergey Kandaurov  wrote:
> Author: pluknet
> Date: Tue Jan 31 13:00:40 2012
> New Revision: 230808
> URL: http://svn.freebsd.org/changeset/base/230808
>
> Log:
>  Isolate v_caddr_t in the ie driver.

ie is the only consumer in the entire tree.
I'm not quite sure if this worth MFC'ing at the cost of breaking
some hypothetical out-of-tree consumers...

-- 
wbr,
pluknet
___
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: r230808 - in head/sys: dev/ie sys

2012-01-31 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Jan 31 13:00:40 2012
New Revision: 230808
URL: http://svn.freebsd.org/changeset/base/230808

Log:
  Isolate v_caddr_t in the ie driver.
  
  Submitted by: Bruce Evans on net@

Modified:
  head/sys/dev/ie/if_ie.c
  head/sys/sys/types.h

Modified: head/sys/dev/ie/if_ie.c
==
--- head/sys/dev/ie/if_ie.c Tue Jan 31 12:57:21 2012(r230807)
+++ head/sys/dev/ie/if_ie.c Tue Jan 31 13:00:40 2012(r230808)
@@ -157,6 +157,9 @@ static int  ie_debug = IED_RNR;
 
 #define IE_BUF_LEN ETHER_MAX_LEN   /* length of transmit buffer */
 
+/* XXX this driver uses `volatile' and `caddr_t' to a fault. */
+typedefvolatile char *v_caddr_t;   /* core address, pointer to 
volatile */
+
 /* Forward declaration */
 struct ie_softc;
 

Modified: head/sys/sys/types.h
==
--- head/sys/sys/types.hTue Jan 31 12:57:21 2012(r230807)
+++ head/sys/sys/types.hTue Jan 31 13:00:40 2012(r230808)
@@ -73,7 +73,6 @@ typedef   quad_t *qaddr_t;
 
 typedefchar *  caddr_t;/* core address */
 typedefconst char *c_caddr_t;  /* core address, pointer to 
const */
-typedef__volatile char *v_caddr_t; /* core address, pointer to 
volatile */
 
 #ifndef _BLKSIZE_T_DECLARED
 typedef__blksize_t blksize_t;
___
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: r230807 - head/sys/dev/sound/pci/hda

2012-01-31 Thread Alexander Motin
Author: mav
Date: Tue Jan 31 12:57:21 2012
New Revision: 230807
URL: http://svn.freebsd.org/changeset/base/230807

Log:
  Just in case, clear stream interrupts before enabling them.

Modified:
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hdac.c
==
--- head/sys/dev/sound/pci/hda/hdac.c   Tue Jan 31 11:00:33 2012
(r230806)
+++ head/sys/dev/sound/pci/hda/hdac.c   Tue Jan 31 12:57:21 2012
(r230807)
@@ -1921,6 +1921,8 @@ hdac_stream_start(device_t dev, device_t
ctl |= 1 << ss;
HDAC_WRITE_4(&sc->mem, HDAC_INTCTL, ctl);
 
+   HDAC_WRITE_1(&sc->mem, off + HDAC_SDSTS,
+   HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | HDAC_SDSTS_BCIS);
ctl = HDAC_READ_1(&sc->mem, off + HDAC_SDCTL0);
ctl |= HDAC_SDCTL_IOCE | HDAC_SDCTL_FEIE | HDAC_SDCTL_DEIE |
HDAC_SDCTL_RUN;
___
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: r230806 - stable/9/share/man/man9

2012-01-31 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 31 11:00:33 2012
New Revision: 230806
URL: http://svn.freebsd.org/changeset/base/230806

Log:
  MFC r227698:
  Update the manpage for r227697.

Modified:
  stable/9/share/man/man9/VOP_VPTOCNP.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/VOP_VPTOCNP.9
==
--- stable/9/share/man/man9/VOP_VPTOCNP.9   Tue Jan 31 10:46:51 2012
(r230805)
+++ stable/9/share/man/man9/VOP_VPTOCNP.9   Tue Jan 31 11:00:33 2012
(r230806)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 7, 2008
+.Dd November 19, 2011
 .Dt VOP_VPTOCNP 9
 .Os
 .Sh NAME
@@ -65,9 +65,9 @@ is not a directory, then
 .Nm
 returns ENOENT.
 .Sh LOCKS
-The vnode should be locked on entry and will still be locked on exit.  The
-parent directory vnode will be unlocked on a successful exit.  However, it
-will have its hold count incremented.
+The vnode should be locked on entry and will still be locked on exit.
+The parent directory vnode will be unlocked on a successful exit.
+However, it will have its use count incremented.
 .Sh RETURN VALUES
 Zero is returned on success, otherwise an error code is returned.
 .Sh ERRORS
___
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: r230583 - head/sys/kern

2012-01-31 Thread Konstantin Belousov
On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote:
> On Mon, Jan 30, 2012, Kostik Belousov wrote:
> > On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote:
> > > On Sun, Jan 29, 2012, Kostik Belousov wrote:
> > > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote:
> > > > > On Sat, Jan 28, 2012, Kostik Belousov wrote:
> > > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote:
> > > > > > > The correct limit on the maximum size of a single read/write is
> > > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX.  It's not safe to raise the
> > > > > > > limit yet, though, because of bugs in several filesystems.  For
> > > > > > > example, FFS copies uio_resid into a local variable of type int.
> > > > > > > I have some old patches that fix some of these issues for FFS and
> > > > > > > cd9660, but surely there are more places I didn't notice.
> > > > > > > 
> > > > > > Absolutely agree.
> > > > > > 
> > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch
> > > > > 
> > > > > Nice.  You found a lot more than I've got in my tree, and you even
> > > > > fixed the return values.  There are at least a few more places to
> > > > > fix.  For instance, cd9660 and the NFS client pass uio_resid or
> > > > > iov_len to min(), which operates on ints.  (Incidentally, C11
> > > > > generics ought to make it possible to write type-generic min()
> > > > > and max() functions.)
> > > > 
> > > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch
> > > > changed them to MIN().
> > > 
> > > This looks good to me.  I tried to think of other places that you
> > > might have missed, and the only one that occurred to me is the
> > Might ? I think this is a blatant understate.
> > 
> > > pipe code.  sys_pipe.c has an `int orig_resid' and lots of bogus
> > > casts of iov_len and uio_resid to type u_int.  Some look harmless,
> > > although it appears that writing a multiple of 2^32 bytes might
> > > result in pipe_build_write_buffer() allocating a 0-length buffer.
> > > 
> > > My only reservation is that raising the limit could unmask a
> > > kernel buffer overflow if we missed something, but I guess we have
> > > to cross that bridge some day anyway.
> > Yes, and it is an obvious reason why I am chicken to commit this for
> > so long time. One more place, if this is reasonable to count as 'one'
> > place, are the cdevsw methods. devfs passes uio down to the drivers.
> 
> That's why I'm glad I'm not committing it. :)  A more conservative
> change (also known as "kicking the can down the road") would be to
> add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems
> that have been thoroughly reviewed.  The VFS layer could cap the size
> at INT_MAX for file systems without the flag.
At least I will get more mail after the commit, I hope.

I disagree with the VFCF_LONGIO approach. It will cause much head-scratching
for unsuspecting user who would try to use > 4GB transfers.

What I can do, is to commit all changes except removals of the checks
for INT_MAX. After type changes settle, I can try to gather enough
bravery to flip the checks in HEAD, possibly with temporary sysctl
to return to old behaviour for emergency (AKA hole).

> 
> > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
> > index 9edcb74..332ec37 100644
> > --- a/sys/kern/sys_pipe.c
> > +++ b/sys/kern/sys_pipe.c
> [...]
> > @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio)
> >struct pipe *wpipe;
> >struct uio *uio;
> >  {
> > -   u_int size;
> > +   size_t size;
> > int i;
> >  
> > PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED);
> > KASSERT(wpipe->pipe_state & PIPE_DIRECTW,
> >   ("Clone attempt on non-direct write pipe!"));
> >  
> > -   size = (u_int) uio->uio_iov->iov_len;
> > +   size = uio->uio_iov->iov_len;
> > if (size > wpipe->pipe_buffer.size)
> >size = wpipe->pipe_buffer.size;
> 
> The transfer can't be bigger than the max pipe buffer size (64k),
> so `size = (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)'
> should suffice.  The same comment applies elsewhere in the file.

True. If you much prefer this version, I will change the patch. But I do
think that my changes are cleaner.


pgpFdFryHH683.pgp
Description: PGP signature


svn commit: r230805 - stable/7/sys/netinet6

2012-01-31 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Jan 31 10:46:51 2012
New Revision: 230805
URL: http://svn.freebsd.org/changeset/base/230805

Log:
  MFC r230531: Remove unused variable.

Modified:
  stable/7/sys/netinet6/nd6.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/netinet6/nd6.c
==
--- stable/7/sys/netinet6/nd6.c Tue Jan 31 05:49:49 2012(r230804)
+++ stable/7/sys/netinet6/nd6.c Tue Jan 31 10:46:51 2012(r230805)
@@ -534,7 +534,6 @@ nd6_timer(void *ignored_arg)
struct nd_defrouter *dr;
struct nd_prefix *pr;
struct in6_ifaddr *ia6, *nia6;
-   struct in6_addrlifetime *lt6;
 
callout_reset(&nd6_timer_ch, nd6_prune * hz,
nd6_timer, NULL);
@@ -563,7 +562,6 @@ nd6_timer(void *ignored_arg)
for (ia6 = in6_ifaddr; ia6; ia6 = nia6) {
nia6 = ia6->ia_next;
/* check address lifetime */
-   lt6 = &ia6->ia6_lifetime;
if (IFA6_IS_INVALID(ia6)) {
int regen = 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"