svn commit: r192035 - in head/sys: amd64/amd64 i386/i386

2009-05-13 Thread Alan Cox
Author: alc
Date: Wed May 13 07:42:53 2009
New Revision: 192035
URL: http://svn.freebsd.org/changeset/base/192035

Log:
  Correct a rare use-after-free error in pmap_copy().  This error was
  introduced in amd64 revision 1.540 and i386 revision 1.547.  However, it
  had no harmful effects until after a recent change, r189698, on amd64.
  (In other words, the error is harmless in RELENG_7.)
  
  The error is triggered by the failure to allocate a pv entry for the one
  and only mapping in a page table page.  I am addressing the error by
  changing pmap_copy() to abort if either pv entry allocation or page
  table page allocation fails.  This is appropriate because the creation of
  mappings by pmap_copy() is optional.  They are a (possible) optimization,
  and not a requirement.
  
  Correct a nearby whitespace error in the i386 pmap_copy().
  
  Crash reported by: jeff@
  MFC after:6 weeks

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed May 13 05:39:39 2009(r192034)
+++ head/sys/amd64/amd64/pmap.c Wed May 13 07:42:53 2009(r192035)
@@ -3556,7 +3556,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
dstmpte-wire_count++;
else if ((dstmpte = pmap_allocpte(dst_pmap,
addr, M_NOWAIT)) == NULL)
-   break;
+   goto out;
dst_pte = (pt_entry_t *)
PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte));
dst_pte = dst_pte[pmap_pte_index(addr)];
@@ -3579,6 +3579,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
addr);
pmap_free_zero_pages(free);
}
+   goto out;
}
if (dstmpte-wire_count = srcmpte-wire_count)
break;
@@ -3587,6 +3588,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
src_pte++;
}
}
+out:
vm_page_unlock_queues();
PMAP_UNLOCK(src_pmap);
PMAP_UNLOCK(dst_pmap);

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Wed May 13 05:39:39 2009(r192034)
+++ head/sys/i386/i386/pmap.c   Wed May 13 07:42:53 2009(r192035)
@@ -3638,7 +3638,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
dstmpte = pmap_allocpte(dst_pmap, addr,
M_NOWAIT);
if (dstmpte == NULL)
-   break;
+   goto out;
dst_pte = pmap_pte_quick(dst_pmap, addr);
if (*dst_pte == 0 
pmap_try_insert_pv_entry(dst_pmap, addr,
@@ -3653,12 +3653,13 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
dst_pmap-pm_stats.resident_count++;
} else {
free = NULL;
-   if (pmap_unwire_pte_hold( dst_pmap,
+   if (pmap_unwire_pte_hold(dst_pmap,
dstmpte, free)) {
pmap_invalidate_page(dst_pmap,
addr);
pmap_free_zero_pages(free);
}
+   goto out;
}
if (dstmpte-wire_count = srcmpte-wire_count)
break;
@@ -3667,6 +3668,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
src_pte++;
}
}
+out:
sched_unpin();
vm_page_unlock_queues();
PMAP_UNLOCK(src_pmap);
___
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: r192036 - head/sys/compat/ndis

2009-05-13 Thread Christian Brueffer
Author: brueffer
Date: Wed May 13 08:50:13 2009
New Revision: 192036
URL: http://svn.freebsd.org/changeset/base/192036

Log:
  Fix memory leak in an error case.
  
  Found with:   Coverity Prevent(tm)
  CID:  371
  MFC after:2 weeks

Modified:
  head/sys/compat/ndis/kern_windrv.c

Modified: head/sys/compat/ndis/kern_windrv.c
==
--- head/sys/compat/ndis/kern_windrv.c  Wed May 13 07:42:53 2009
(r192035)
+++ head/sys/compat/ndis/kern_windrv.c  Wed May 13 08:50:13 2009
(r192036)
@@ -531,7 +531,10 @@ windrv_bus_attach(drv, name)
 
RtlInitAnsiString(as, name);
if (RtlAnsiStringToUnicodeString(drv-dro_drivername, as, TRUE))
+   {
+   free(new, M_DEVBUF);
return(ENOMEM);
+   }
 
/*
 * Set up a fake image pointer to avoid false matches
___
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: r192040 - head/usr.bin/truss

2009-05-13 Thread Diomidis Spinellis
Author: dds
Date: Wed May 13 12:43:37 2009
New Revision: 192040
URL: http://svn.freebsd.org/changeset/base/192040

Log:
  Fix compilation error introduced in r192025.

Modified:
  head/usr.bin/truss/mips-fbsd.c

Modified: head/usr.bin/truss/mips-fbsd.c
==
--- head/usr.bin/truss/mips-fbsd.c  Wed May 13 12:19:54 2009
(r192039)
+++ head/usr.bin/truss/mips-fbsd.c  Wed May 13 12:43:37 2009
(r192040)
@@ -338,7 +338,8 @@ mips_syscall_exit(struct trussinfo *trus
* but that complicates things considerably.
*/
 
-  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, 
retval);
+  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
+   fsc.sc, retval);
   clear_fsc();
 
   return (retval);
___
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: r192041 - head/usr.bin/truss

2009-05-13 Thread Diomidis Spinellis
Author: dds
Date: Wed May 13 13:00:52 2009
New Revision: 192041
URL: http://svn.freebsd.org/changeset/base/192041

Log:
  Fix print_syscall_ret parameter order.

Modified:
  head/usr.bin/truss/mips-fbsd.c

Modified: head/usr.bin/truss/mips-fbsd.c
==
--- head/usr.bin/truss/mips-fbsd.c  Wed May 13 12:43:37 2009
(r192040)
+++ head/usr.bin/truss/mips-fbsd.c  Wed May 13 13:00:52 2009
(r192041)
@@ -339,7 +339,7 @@ mips_syscall_exit(struct trussinfo *trus
*/
 
   print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
-   fsc.sc, retval);
+   retval, fsc.sc);
   clear_fsc();
 
   return (retval);
___
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: r192042 - head/sys/dev/bwi

2009-05-13 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed May 13 14:25:55 2009
New Revision: 192042
URL: http://svn.freebsd.org/changeset/base/192042

Log:
  Add a short delay after programming PHY registers to give some time for
  the engine to catch up. This prevents a machine check exception from
  illegal memory requests with a BCM4318.

Modified:
  head/sys/dev/bwi/bwiphy.c

Modified: head/sys/dev/bwi/bwiphy.c
==
--- head/sys/dev/bwi/bwiphy.c   Wed May 13 13:00:52 2009(r192041)
+++ head/sys/dev/bwi/bwiphy.c   Wed May 13 14:25:55 2009(r192042)
@@ -664,6 +664,7 @@ bwi_phy_init_11b_rev6(struct bwi_mac *ma
for (ofs = 0xa8; ofs  0xc8; ++ofs) {
PHY_WRITE(mac, ofs, (val  0x3f3f));
val += 0x202;
+   DELAY(10);
}
 
if (phy-phy_mode == IEEE80211_MODE_11G) {
___
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: r192026 - head/share/man/man9

2009-05-13 Thread John Baldwin
On Tuesday 12 May 2009 5:28:13 pm Marius Strobl wrote:
 On Tue, May 12, 2009 at 04:13:06PM -0500, Robert Noland wrote:
  On Tue, 2009-05-12 at 20:56 +, Marius Strobl wrote:
   Author: marius
   Date: Tue May 12 20:56:34 2009
   New Revision: 192026
   URL: http://svn.freebsd.org/changeset/base/192026
   
   Log:
 Correct r190283 (partially reverting it) as on sparc64 BUS_DMA_NOCACHE
 actually is only valid for bus_dmamap_load().
  
  Ok, this is getting very confusing...  This means that code has to set
  this flag on both alloc and load to allow for somethine resembling
  consistent behavior.
  
 
 Personally I don't understand why amd64 and i386 where decided to
 implement BUS_DMA_NOCACHE for bus_dmamem_alloc(9) only as this
 is less flexible than using it with bus_dmamap_load(9) (which also
 is the older existing implementation). Anyway, sys/bus_dma.h
 documents BUS_DMA_NOCACHE and BUS_DMA_NOWRITE as non-standard or
 specific to only certain architectures so I think it's okay for
 the usage of these flags to differ across them.

Hmm, it might be possible to move it to bus_dmamap_load() instead.

-- 
John Baldwin
___
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: r192043 - head/sys/dev/ed

2009-05-13 Thread Warner Losh
Author: imp
Date: Wed May 13 14:43:26 2009
New Revision: 192043
URL: http://svn.freebsd.org/changeset/base/192043

Log:
  ifp-if_softc is managed entirely by the driver.  We never set it to
  NULL or change it.  We initialize it before we set if_ioctl.  It can
  therefore never be NULL, and most other drivers don't bother with this
  sanity check.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==
--- head/sys/dev/ed/if_ed.c Wed May 13 14:25:55 2009(r192042)
+++ head/sys/dev/ed/if_ed.c Wed May 13 14:43:26 2009(r192043)
@@ -1164,14 +1164,6 @@ ed_ioctl(struct ifnet *ifp, u_long comma
struct ifreq *ifr = (struct ifreq *)data;
int error = 0;
 
-   /*
-* XXX really needed?
-*/
-   if (sc == NULL) {
-   ifp-if_drv_flags = ~IFF_DRV_RUNNING;
-   return (ENXIO);
-   }
-
switch (command) {
case SIOCSIFFLAGS:
/*
___
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: r192046 - head/sys/dev/bwi

2009-05-13 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed May 13 16:19:05 2009
New Revision: 192046
URL: http://svn.freebsd.org/changeset/base/192046

Log:
  Add a comment to motivate my last change.
  
  Suggested by: sam, imp

Modified:
  head/sys/dev/bwi/bwiphy.c

Modified: head/sys/dev/bwi/bwiphy.c
==
--- head/sys/dev/bwi/bwiphy.c   Wed May 13 15:09:01 2009(r192045)
+++ head/sys/dev/bwi/bwiphy.c   Wed May 13 16:19:05 2009(r192046)
@@ -664,6 +664,8 @@ bwi_phy_init_11b_rev6(struct bwi_mac *ma
for (ofs = 0xa8; ofs  0xc8; ++ofs) {
PHY_WRITE(mac, ofs, (val  0x3f3f));
val += 0x202;
+
+   /* XXX: delay 10 us to avoid PCI parity errors with BCM4318 */
DELAY(10);
}
 
___
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: r191983 - in head/sys: dev/usb/wlan modules/usb/upgt

2009-05-13 Thread Robert Watson


On Mon, 11 May 2009, Weongyo Jeong wrote:


Author: weongyo
Date: Mon May 11 02:39:49 2009
New Revision: 191983
URL: http://svn.freebsd.org/changeset/base/191983

Log:
 ports upgt(4) driver for USB2.


Ah, great!  Do you have any similar plans regarding urtw?

Robert N M Watson
Computer Laboratory
University of Cambridge




Added:
 head/sys/dev/usb/wlan/if_upgt.c   (contents, props changed)
 head/sys/dev/usb/wlan/if_upgtvar.h   (contents, props changed)
 head/sys/modules/usb/upgt/
 head/sys/modules/usb/upgt/Makefile   (contents, props changed)

Added: head/sys/dev/usb/wlan/if_upgt.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/usb/wlan/if_upgt.c Mon May 11 02:39:49 2009
(r191983)
@@ -0,0 +1,2404 @@
+/* $OpenBSD: if_upgt.c,v 1.35 2008/04/16 18:32:15 damien Exp $ */
+/* $FreeBSD$ */
+
+/*
+ * Copyright (c) 2007 Marcus Glocker mgloc...@openbsd.org
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/endian.h
+#include sys/firmware.h
+#include sys/linker.h
+#include sys/mbuf.h
+#include sys/malloc.h
+#include sys/module.h
+#include sys/socket.h
+#include sys/sockio.h
+#include sys/sysctl.h
+
+#include net/if.h
+#include net/if_arp.h
+#include net/ethernet.h
+#include net/if_dl.h
+#include net/if_media.h
+#include net/if_types.h
+
+#include sys/bus.h
+#include machine/bus.h
+
+#include net80211/ieee80211_var.h
+#include net80211/ieee80211_phy.h
+#include net80211/ieee80211_radiotap.h
+#include net80211/ieee80211_regdomain.h
+
+#include net/bpf.h
+
+#include dev/usb/usb.h
+#include dev/usb/usb_core.h
+#include dev/usb/usb_busdma.h
+#include dev/usb/usb_debug.h
+#include dev/usb/usb_error.h
+#include dev/usb/usb_lookup.h
+#include dev/usb/usb_util.h
+#include usbdevs.h
+
+#include dev/usb/wlan/if_upgtvar.h
+
+/*
+ * Driver for the USB PrismGT devices.
+ *
+ * For now just USB 2.0 devices with the GW3887 chipset are supported.
+ * The driver has been written based on the firmware version 2.13.1.0_LM87.
+ *
+ * TODO's:
+ * - MONITOR mode test.
+ * - Add HOSTAP mode.
+ * - Add IBSS mode.
+ * - Support the USB 1.0 devices (NET2280, ISL3880, ISL3886 chipsets).
+ *
+ * Parts of this driver has been influenced by reading the p54u driver
+ * written by Jean-Baptiste Note jean-baptiste.n...@m4x.org and
+ * Sebastien Bourdeauducq leker...@prism54.org.
+ */
+
+SYSCTL_NODE(_hw, OID_AUTO, upgt, CTLFLAG_RD, 0,
+USB PrismGT GW3887 driver parameters);
+
+#ifdef UPGT_DEBUG
+int upgt_debug = 0;
+SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW, upgt_debug,
+   0, control debugging printfs);
+TUNABLE_INT(hw.upgt.debug, upgt_debug);
+enum {
+   UPGT_DEBUG_XMIT = 0x0001,   /* basic xmit operation */
+   UPGT_DEBUG_RECV = 0x0002,   /* basic recv operation */
+   UPGT_DEBUG_RESET= 0x0004,   /* reset processing */
+   UPGT_DEBUG_INTR = 0x0008,   /* INTR */
+   UPGT_DEBUG_TX_PROC  = 0x0010,   /* tx ISR proc */
+   UPGT_DEBUG_RX_PROC  = 0x0020,   /* rx ISR proc */
+   UPGT_DEBUG_STATE= 0x0040,   /* 802.11 state transitions */
+   UPGT_DEBUG_STAT = 0x0080,   /* statistic */
+   UPGT_DEBUG_FW   = 0x0100,   /* firmware */
+   UPGT_DEBUG_ANY  = 0x
+};
+#defineDPRINTF(sc, m, fmt, ...) do {   \
+   if (sc-sc_debug  (m))  \
+   printf(fmt, __VA_ARGS__);   \
+} while (0)
+#else
+#defineDPRINTF(sc, m, fmt, ...) do {   \
+   (void) sc;  \
+} while (0)
+#endif
+
+/*
+ * Prototypes.
+ */
+static device_probe_t upgt_match;
+static device_attach_t upgt_attach;
+static device_detach_t upgt_detach;
+static int upgt_alloc_tx(struct upgt_softc *);
+static int upgt_alloc_rx(struct upgt_softc *);
+static int upgt_device_reset(struct upgt_softc *);
+static voidupgt_bulk_tx(struct upgt_softc *, struct upgt_data *);
+static int upgt_fw_verify(struct upgt_softc *);
+static int upgt_mem_init(struct 

Re: svn commit: r192011 - head/sys/netinet

2009-05-13 Thread Andrew Thompson
On Tue, May 12, 2009 at 07:44:28PM +0200, Dimitry Andric wrote:
 On 2009-05-12 09:41, Qing Li wrote:
  Author: qingli
  Date: Tue May 12 07:41:20 2009
  New Revision: 192011
  URL: http://svn.freebsd.org/changeset/base/192011
  
  Log:
This patch adds a host route to an interface address (that is assigned
to a non loopback/ppp link types) through the loopback interface. Prior
to the new L2/L3 rewrite, this host route is implicitly added by the L2
code during RTM_RESOLVE of that interface address. This host route is
deleted when that interface is removed.
 
 This commit breaks dhclient startup, I now get:
 
 [...]
 in_ifinit: insertion failed
 ifconfig: ioctl (SIOCAIFADDR): File exists
 em0: not found
 exiting.
 
 So it seems to hit this part:
 
 + } else if (error != 0)
 + log(LOG_INFO, in_ifinit: insertion failed\n);
 
 Reverting the commit makes dhclient work again.

It also breaks PXE booting, can it be fixed or reverted?

bootpc_init: wired to interface 'npe0'
in_ifinit: insertion failed
panic: bootpc_fakeup_interface: set if addr, error=17


Andrew
___
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: r192051 - head/sys/dev/usb

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 17:58:37 2009
New Revision: 192051
URL: http://svn.freebsd.org/changeset/base/192051

Log:
  The transfer must return USB_ERR_CANCELLED when the device is gone due to the
  way usb drivers work.
  
  Submitted by: Hans Petter Selasky

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

Modified: head/sys/dev/usb/usb_transfer.c
==
--- head/sys/dev/usb/usb_transfer.c Wed May 13 17:53:04 2009
(r192050)
+++ head/sys/dev/usb/usb_transfer.c Wed May 13 17:58:37 2009
(r192051)
@@ -1439,7 +1439,11 @@ usb2_start_hardware(struct usb2_xfer *xf
/* Check if the device is still alive */
if (info-udev-state  USB_STATE_POWERED) {
USB_BUS_LOCK(bus);
-   usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED);
+   /*
+* Must return cancelled error code else
+* device drivers can hang.
+*/
+   usb2_transfer_done(xfer, USB_ERR_CANCELLED);
USB_BUS_UNLOCK(bus);
return;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r192052 - in head/sys/dev/usb: . storage

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 18:03:23 2009
New Revision: 192052
URL: http://svn.freebsd.org/changeset/base/192052

Log:
  Sync to P4
  
  Add umass quirks for Alcor AU6390, Cypress PATA 6830XX and MPMan MPF400.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/storage/umass.c
==
--- head/sys/dev/usb/storage/umass.cWed May 13 17:58:37 2009
(r192051)
+++ head/sys/dev/usb/storage/umass.cWed May 13 18:03:23 2009
(r192052)
@@ -309,6 +309,7 @@ struct umass_devdescr {
 
/* wire and command protocol */
uint16_t proto;
+#defineUMASS_PROTO_DEFAULT 0x  /* use protocol indicated by 
USB descriptors */
 #defineUMASS_PROTO_BBB 0x0001  /* USB wire protocol */
 #defineUMASS_PROTO_CBI 0x0002
 #defineUMASS_PROTO_CBI_I   0x0004
@@ -372,7 +373,7 @@ struct umass_devdescr {
 
 static const struct umass_devdescr umass_devdescr[] = {
{USB_VENDOR_ASAHIOPTICAL, PID_WILDCARD, RID_WILDCARD,
-   UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
+   UMASS_PROTO_DEFAULT,
RS_NO_CLEAR_UA
},
{USB_VENDOR_ADDON, USB_PRODUCT_ADDON_ATTACHE, RID_WILDCARD,
@@ -395,6 +396,10 @@ static const struct umass_devdescr umass
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
NO_QUIRKS
},
+   {USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_AU6390, RID_WILDCARD,
+   UMASS_PROTO_DEFAULT,
+   NO_SYNCHRONIZE_CACHE
+   },
{USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_UMCR_9361, RID_WILDCARD,
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
NO_GETMAXLUN
@@ -427,6 +432,10 @@ static const struct umass_devdescr umass
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
},
+   {USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_XX6830XX, RID_WILDCARD,
+   UMASS_PROTO_DEFAULT,
+   NO_GETMAXLUN | NO_SYNCHRONIZE_CACHE
+   },
{USB_VENDOR_DESKNOTE, USB_PRODUCT_DESKNOTE_UCR_61S2B, RID_WILDCARD,
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
NO_QUIRKS
@@ -600,6 +609,10 @@ static const struct umass_devdescr umass
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
FORCE_SHORT_INQUIRY | NO_INQUIRY_EVPD | NO_GETMAXLUN
},
+   {USB_VENDOR_MPMAN, PID_WILDCARD, RID_WILDCARD,
+   UMASS_PROTO_DEFAULT,
+   NO_SYNCHRONIZE_CACHE
+   },
{USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY, RID_WILDCARD,
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
IGNORE_RESIDUE | NO_GETMAXLUN | RS_NO_CLEAR_UA
@@ -609,11 +622,11 @@ static const struct umass_devdescr umass
NO_QUIRKS
},
{USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN, RID_WILDCARD,
-   UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+   UMASS_PROTO_DEFAULT,
IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE
},
{USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD,
-   UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+   UMASS_PROTO_DEFAULT,
NO_SYNCHRONIZE_CACHE
},
{USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, RID_WILDCARD,
@@ -849,7 +862,7 @@ static const struct umass_devdescr umass
NO_QUIRKS
},
{USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDE, RID_WILDCARD,
-   UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+   UMASS_PROTO_DEFAULT,
IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE
},
{USB_VENDOR_TAUGA, USB_PRODUCT_TAUGA_CAMERAMATE, RID_WILDCARD,
@@ -1281,6 +1294,58 @@ MODULE_DEPEND(umass, cam, 1, 1, 1);
  * USB device probe/attach/detach
  */
 
+static uint16_t
+umass_get_proto(struct usb2_interface *iface)
+{
+   struct usb2_interface_descriptor *id;
+   uint16_t retval;
+
+   retval = 0;
+
+   /* Check for a standards compliant device */
+   id = usb2_get_interface_descriptor(iface);
+   if ((id == NULL) ||
+   (id-bInterfaceClass != UICLASS_MASS)) {
+   goto done;
+   }
+   switch (id-bInterfaceSubClass) {
+   case UISUBCLASS_SCSI:
+   retval |= UMASS_PROTO_SCSI;
+   break;
+   case UISUBCLASS_UFI:
+   retval |= UMASS_PROTO_UFI;
+   break;
+   case UISUBCLASS_RBC:
+   retval |= UMASS_PROTO_RBC;
+   break;
+   case UISUBCLASS_SFF8020I:
+   case UISUBCLASS_SFF8070I:
+   retval |= UMASS_PROTO_ATAPI;
+   break;
+   default:
+   retval = 0;
+   goto done;
+   }
+
+   switch (id-bInterfaceProtocol) {
+   case UIPROTO_MASS_CBI:
+   retval |= UMASS_PROTO_CBI;
+ 

svn commit: r192053 - head/sys/dev/usb/controller

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 18:04:51 2009
New Revision: 192053
URL: http://svn.freebsd.org/changeset/base/192053

Log:
  Add debug lines for fullspeed and highspeed xfer completion.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==
--- head/sys/dev/usb/controller/ehci.c  Wed May 13 18:03:23 2009
(r192052)
+++ head/sys/dev/usb/controller/ehci.c  Wed May 13 18:04:51 2009
(r192053)
@@ -2028,6 +2028,8 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru
 
len = EHCI_SITD_GET_LEN(status);
 
+   DPRINTFN(2, status=0x%08x, rem=%u\n, status, len);
+
if (*plen = len) {
len = *plen - len;
} else {
@@ -2081,6 +2083,8 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru
 
len = EHCI_ITD_GET_LEN(status);
 
+   DPRINTFN(2, status=0x%08x, len=%u\n, status, len);
+
if (*plen = len) {
/*
 * The length is valid. NOTE: The complete
___
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: r192054 - head/sys/dev/usb

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 18:05:40 2009
New Revision: 192054
URL: http://svn.freebsd.org/changeset/base/192054

Log:
  Check the correct variable for IO_NDELAY.
  
  Submitted by: Hans Petter Selasky

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

Modified: head/sys/dev/usb/usb_dev.c
==
--- head/sys/dev/usb/usb_dev.c  Wed May 13 18:04:51 2009(r192053)
+++ head/sys/dev/usb/usb_dev.c  Wed May 13 18:05:40 2009(r192054)
@@ -1203,7 +1203,7 @@ usb2_read(struct cdev *dev, struct uio *
 
(f-methods-f_start_read) (f);
 
-   if (fflags  IO_NDELAY) {
+   if (ioflag  IO_NDELAY) {
if (tr_data) {
/* return length before error */
break;
@@ -1326,7 +1326,7 @@ usb2_write(struct cdev *dev, struct uio 
 
if (m == NULL) {
 
-   if (fflags  IO_NDELAY) {
+   if (ioflag  IO_NDELAY) {
if (tr_data) {
/* return length before error */
break;
___
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: r192055 - head/sys/dev/usb

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 18:06:52 2009
New Revision: 192055
URL: http://svn.freebsd.org/changeset/base/192055

Log:
  Make sure collections have the usage field set.
  
  Submitted by: Hans Petter Selasky

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

Modified: head/sys/dev/usb/usb_hid.c
==
--- head/sys/dev/usb/usb_hid.c  Wed May 13 18:05:40 2009(r192054)
+++ head/sys/dev/usb/usb_hid.c  Wed May 13 18:06:52 2009(r192055)
@@ -309,6 +309,7 @@ hid_get_item(struct hid_data *s, struct 
c-kind = hid_collection;
c-collection = dval;
c-collevel++;
+   c-usage = s-usage_last;
*h = *c;
return (1);
case 11:/* Feature */
@@ -408,6 +409,9 @@ hid_get_item(struct hid_data *s, struct 
if (bSize != 4)
dval = (dval  mask) | c-_usage_page;
 
+   /* set last usage, in case of a collection */
+   s-usage_last = dval;
+
if (s-nusage  MAXUSAGE) {
s-usages_min[s-nusage] = dval;
s-usages_max[s-nusage] = dval;
@@ -630,9 +634,11 @@ hid_is_collection(const void *desc, usb2
if (hd == NULL)
return (0);
 
-   err = hid_get_item(hd, hi) 
-   hi.kind == hid_collection 
-   hi.usage == usage;
+   while ((err = hid_get_item(hd, hi))) {
+if (hi.kind == hid_collection 
+hi.usage == usage)
+   break;
+   }
hid_end_parse(hd);
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: r192056 - head/sys/dev/usb

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 18:25:14 2009
New Revision: 192056
URL: http://svn.freebsd.org/changeset/base/192056

Log:
  Add parenthesis around the xfer macro argument.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_core.h

Modified: head/sys/dev/usb/usb_core.h
==
--- head/sys/dev/usb/usb_core.h Wed May 13 18:06:52 2009(r192055)
+++ head/sys/dev/usb/usb_core.h Wed May 13 18:25:14 2009(r192056)
@@ -233,9 +233,9 @@
  * The following macro will tell if an USB transfer is currently
  * receiving or transferring data.
  */
-#defineUSB_GET_DATA_ISREAD(xfer) (((xfer)-flags_int.usb2_mode == \
-   USB_MODE_DEVICE) ? ((xfer-endpoint  UE_DIR_IN) ? 0 : 1) : \
-   ((xfer-endpoint  UE_DIR_IN) ? 1 : 0))
+#defineUSB_GET_DATA_ISREAD(xfer) ((xfer)-flags_int.usb2_mode == \
+   USB_MODE_DEVICE ? (((xfer)-endpoint  UE_DIR_IN) ? 0 : 1) : \
+   (((xfer)-endpoint  UE_DIR_IN) ? 1 : 0))
 
 /*
  * The following macros are used used to convert milliseconds into
___
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: r192057 - head/sys/dev/usb/storage

2009-05-13 Thread Andrew Thompson
Author: thompsa
Date: Wed May 13 18:26:55 2009
New Revision: 192057
URL: http://svn.freebsd.org/changeset/base/192057

Log:
  Ensure the bmRequestType is the right type for the incoming control request.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/storage/ustorage_fs.c

Modified: head/sys/dev/usb/storage/ustorage_fs.c
==
--- head/sys/dev/usb/storage/ustorage_fs.c  Wed May 13 18:25:14 2009
(r192056)
+++ head/sys/dev/usb/storage/ustorage_fs.c  Wed May 13 18:26:55 2009
(r192057)
@@ -466,7 +466,8 @@ ustorage_fs_handle_request(device_t dev,
const struct usb2_device_request *req = preq;
 
if (!is_complete) {
-   if (req-bRequest == UR_BBB_RESET) {
+   if ((req-bmRequestType == UT_WRITE_CLASS_INTERFACE) 
+   (req-bRequest == UR_BBB_RESET)) {
*plen = 0;
mtx_lock(sc-sc_mtx);
ustorage_fs_transfer_stop(sc);
@@ -475,7 +476,8 @@ ustorage_fs_handle_request(device_t dev,
USTORAGE_FS_T_BBB_COMMAND);
mtx_unlock(sc-sc_mtx);
return (0);
-   } else if (req-bRequest == UR_BBB_GET_MAX_LUN) {
+   } else if ((req-bmRequestType == UT_READ_CLASS_INTERFACE) 
+  (req-bRequest == UR_BBB_GET_MAX_LUN)) {
if (offset == 0) {
*plen = 1;
*pptr = sc-sc_last_lun;
___
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: r192058 - head/sys/dev/flash

2009-05-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed May 13 18:31:28 2009
New Revision: 192058
URL: http://svn.freebsd.org/changeset/base/192058

Log:
  - Remove nonexistent header file from includes list

Modified:
  head/sys/dev/flash/at45d.c

Modified: head/sys/dev/flash/at45d.c
==
--- head/sys/dev/flash/at45d.c  Wed May 13 18:26:55 2009(r192057)
+++ head/sys/dev/flash/at45d.c  Wed May 13 18:31:28 2009(r192058)
@@ -30,7 +30,6 @@ __FBSDID($FreeBSD$);
 #include sys/bio.h
 #include sys/bus.h
 #include sys/conf.h
-#include sys/gpio.h
 #include sys/kernel.h
 #include sys/kthread.h
 #include sys/lock.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: r192059 - in head/sys: arm/at91 dev/spibus

2009-05-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed May 13 18:42:49 2009
New Revision: 192059
URL: http://svn.freebsd.org/changeset/base/192059

Log:
  - Make SPI bus bridge be non-arch dependent by using more generic
  name
  
  Reviewed by:  imp

Modified:
  head/sys/arm/at91/at91_spi.c
  head/sys/dev/spibus/spibus.c

Modified: head/sys/arm/at91/at91_spi.c
==
--- head/sys/arm/at91/at91_spi.cWed May 13 18:31:28 2009
(r192058)
+++ head/sys/arm/at91/at91_spi.cWed May 13 18:42:49 2009
(r192059)
@@ -297,7 +297,7 @@ static device_method_t at91_spi_methods[
 };
 
 static driver_t at91_spi_driver = {
-   at91_spi,
+   spi,
at91_spi_methods,
sizeof(struct at91_spi_softc),
 };

Modified: head/sys/dev/spibus/spibus.c
==
--- head/sys/dev/spibus/spibus.cWed May 13 18:31:28 2009
(r192058)
+++ head/sys/dev/spibus/spibus.cWed May 13 18:42:49 2009
(r192059)
@@ -194,5 +194,5 @@ static driver_t spibus_driver = {
 
 devclass_t spibus_devclass;
 
-DRIVER_MODULE(spibus, at91_spi, spibus_driver, spibus_devclass, 0, 0);
+DRIVER_MODULE(spibus, spi, spibus_driver, spibus_devclass, 0, 0);
 MODULE_VERSION(spibus, 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: r192060 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/isp

2009-05-13 Thread Marius Strobl
Author: marius
Date: Wed May 13 19:26:04 2009
New Revision: 192060
URL: http://svn.freebsd.org/changeset/base/192060

Log:
  MFC: r191979
  
  Change uses of the struct ccb_hdr timeout_ch missed when isp(4) was
  adapted to MPSAFE cam(4) to a isp(4) specific callout structure.
  Thanks to Florian Smeets for providing access to a machine exhibiting
  this problem for debugging.
  
  Approved by:  mjacob

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/isp/isp_freebsd.c

Modified: stable/7/sys/dev/isp/isp_freebsd.c
==
--- stable/7/sys/dev/isp/isp_freebsd.c  Wed May 13 18:42:49 2009
(r192059)
+++ stable/7/sys/dev/isp/isp_freebsd.c  Wed May 13 19:26:04 2009
(r192060)
@@ -1988,7 +1988,8 @@ isp_watchdog_work(ispsoftc_t *isp, XS_T 
isp_done(xs);
} else {
XS_CMD_C_WDOG(xs);
-   xs-ccb_h.timeout_ch = timeout(isp_watchdog, xs, hz);
+   callout_reset(PISP_PCMD((union ccb *)xs)-wdog, hz,
+   isp_watchdog, xs);
XS_CMD_S_GRACE(xs);
isp-isp_sendmarker |= 1  XS_CHANNEL(xs);
}
@@ -3004,7 +3005,7 @@ isp_done(struct ccb_scsiio *sccb)
 
XS_CMD_S_DONE(sccb);
if (XS_CMD_WDOG_P(sccb) == 0) {
-   untimeout(isp_watchdog, sccb, sccb-ccb_h.timeout_ch);
+   callout_stop(PISP_PCMD(sccb)-wdog);
if (XS_CMD_GRACE_P(sccb)) {
isp_prt(isp, ISP_LOGDEBUG2,
finished command on borrowed time);
___
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: r192061 - in stable/6/sys: . contrib/pf dev/cxgb dev/isp

2009-05-13 Thread Marius Strobl
Author: marius
Date: Wed May 13 19:26:19 2009
New Revision: 192061
URL: http://svn.freebsd.org/changeset/base/192061

Log:
  MFC: r191979
  
  Change uses of the struct ccb_hdr timeout_ch missed when isp(4) was
  adapted to MPSAFE cam(4) to a isp(4) specific callout structure.
  Thanks to Florian Smeets for providing access to a machine exhibiting
  this problem for debugging.
  
  Approved by:  mjacob

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)
  stable/6/sys/dev/isp/isp_freebsd.c

Modified: stable/6/sys/dev/isp/isp_freebsd.c
==
--- stable/6/sys/dev/isp/isp_freebsd.c  Wed May 13 19:26:04 2009
(r192060)
+++ stable/6/sys/dev/isp/isp_freebsd.c  Wed May 13 19:26:19 2009
(r192061)
@@ -2075,7 +2075,8 @@ isp_watchdog_work(ispsoftc_t *isp, XS_T 
isp_done(xs);
} else {
XS_CMD_C_WDOG(xs);
-   xs-ccb_h.timeout_ch = timeout(isp_watchdog, xs, hz);
+   callout_reset(PISP_PCMD((union ccb *)xs)-wdog, hz,
+   isp_watchdog, xs);
XS_CMD_S_GRACE(xs);
isp-isp_sendmarker |= 1  XS_CHANNEL(xs);
}
@@ -3091,7 +3092,7 @@ isp_done(struct ccb_scsiio *sccb)
 
XS_CMD_S_DONE(sccb);
if (XS_CMD_WDOG_P(sccb) == 0) {
-   untimeout(isp_watchdog, sccb, sccb-ccb_h.timeout_ch);
+   callout_stop(PISP_PCMD(sccb)-wdog);
if (XS_CMD_GRACE_P(sccb)) {
isp_prt(isp, ISP_LOGDEBUG2,
finished command on borrowed time);
___
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: r192059 - in head/sys: arm/at91 dev/spibus

2009-05-13 Thread Stanislav Sedov
On Wed, 13 May 2009 18:42:49 + (UTC)
Oleksandr Tymoshenko go...@freebsd.org mentioned:

 Author: gonzo
 Date: Wed May 13 18:42:49 2009
 New Revision: 192059
 URL: http://svn.freebsd.org/changeset/base/192059
 
 Log:
   - Make SPI bus bridge be non-arch dependent by using more generic
   name
   
   Reviewed by:imp
 
 Modified:
   head/sys/arm/at91/at91_spi.c
   head/sys/dev/spibus/spibus.c
 
 Modified: head/sys/arm/at91/at91_spi.c
 ==
 --- head/sys/arm/at91/at91_spi.c  Wed May 13 18:31:28 2009
 (r192058)
 +++ head/sys/arm/at91/at91_spi.c  Wed May 13 18:42:49 2009
 (r192059)
 @@ -297,7 +297,7 @@ static device_method_t at91_spi_methods[
  };
  
  static driver_t at91_spi_driver = {
 - at91_spi,
 + spi,
   at91_spi_methods,
   sizeof(struct at91_spi_softc),
  };
 
 Modified: head/sys/dev/spibus/spibus.c
 ==
 --- head/sys/dev/spibus/spibus.c  Wed May 13 18:31:28 2009
 (r192058)
 +++ head/sys/dev/spibus/spibus.c  Wed May 13 18:42:49 2009
 (r192059)
 @@ -194,5 +194,5 @@ static driver_t spibus_driver = {
  
  devclass_t   spibus_devclass;
  
 -DRIVER_MODULE(spibus, at91_spi, spibus_driver, spibus_devclass, 0, 0);
 +DRIVER_MODULE(spibus, spi, spibus_driver, spibus_devclass, 0, 0);
  MODULE_VERSION(spibus, 1);
 

On the other hand this driver appears to be machine-specific. What if one
would like to have a kernel with several SPI bus drivers included for devices
that doesn't support enumeration? In this case it will be impossible to
diffirentiate these drivers in the hints file.

-- 
Stanislav Sedov
ST4096-RIPE

!DSPAM:4a0b2cba994296549215293!


___
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: r192063 - head/sys/arm/at91

2009-05-13 Thread Stanislav Sedov
Author: stas
Date: Wed May 13 20:29:53 2009
New Revision: 192063
URL: http://svn.freebsd.org/changeset/base/192063

Log:
  - Style(9) and consistency nitpicking.
  
  Reviewed by:  imp

Modified:
  head/sys/arm/at91/if_ate.c

Modified: head/sys/arm/at91/if_ate.c
==
--- head/sys/arm/at91/if_ate.c  Wed May 13 19:29:50 2009(r192062)
+++ head/sys/arm/at91/if_ate.c  Wed May 13 20:29:53 2009(r192063)
@@ -69,8 +69,8 @@ __FBSDID($FreeBSD$);
 
 #include miibus_if.h
 
-#define ATE_MAX_TX_BUFFERS 2   /* We have ping-pong tx buffers */
-#define ATE_MAX_RX_BUFFERS 64
+#defineATE_MAX_TX_BUFFERS  2   /* We have ping-pong tx buffers 
*/
+#defineATE_MAX_RX_BUFFERS  64
 
 /*
  * Driver-specific flags.
@@ -80,41 +80,43 @@ __FBSDID($FreeBSD$);
 
 struct ate_softc
 {
-   struct ifnet *ifp;  /* ifnet pointer */
-   struct mtx sc_mtx;  /* basically a perimeter lock */
-   device_t dev;   /* Myself */
-   device_t miibus;/* My child miibus */
-   void *intrhand; /* Interrupt handle */
-   struct resource *irq_res;   /* IRQ resource */
+   struct ifnet*ifp;   /* ifnet pointer */
+   struct mtx  sc_mtx; /* Basically a perimeter lock */
+   device_tdev;/* Myself */
+   device_tmiibus; /* My child miibus */
+   struct resource *irq_res;   /* IRQ resource */
struct resource *mem_res;   /* Memory resource */
-   struct callout tick_ch; /* Tick callout */
-   bus_dma_tag_t mtag; /* bus dma tag for mbufs */
-   bus_dmamap_t tx_map[ATE_MAX_TX_BUFFERS];
-   struct mbuf *sent_mbuf[ATE_MAX_TX_BUFFERS]; /* Sent mbufs */
-   bus_dma_tag_t rxtag;
-   bus_dmamap_t rx_map[ATE_MAX_RX_BUFFERS];
-   void *rx_buf[ATE_MAX_RX_BUFFERS]; /* RX buffer space */
-   int rx_buf_ptr;
-   bus_dma_tag_t rx_desc_tag;
-   bus_dmamap_t rx_desc_map;
-   int txcur;  /* current tx map pointer */
-   bus_addr_t rx_desc_phys;
-   eth_rx_desc_t *rx_descs;
-   int use_rmii;
-   struct  ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */
-   int flags;
-   int if_flags;
+   struct callout  tick_ch;/* Tick callout */
+   struct ifmib_iso_8802_3 mibdata; /* Stuff for network mgmt */
+   struct mbuf *sent_mbuf[ATE_MAX_TX_BUFFERS]; /* Sent mbufs */
+   bus_dma_tag_t   mtag;   /* bus dma tag for mbufs */
+   bus_dma_tag_t   rxtag;
+   bus_dma_tag_t   rx_desc_tag;
+   bus_dmamap_trx_desc_map;
+   bus_dmamap_trx_map[ATE_MAX_RX_BUFFERS];
+   bus_dmamap_ttx_map[ATE_MAX_TX_BUFFERS];
+   bus_addr_t  rx_desc_phys;
+   eth_rx_desc_t   *rx_descs;
+   void*rx_buf[ATE_MAX_RX_BUFFERS]; /* RX buffer space */
+   void*intrhand;  /* Interrupt handle */
+   int flags;
+   int if_flags;
+   int rx_buf_ptr;
+   int txcur;  /* Current TX map pointer */
+   int use_rmii;
 };
 
 static inline uint32_t
 RD4(struct ate_softc *sc, bus_size_t off)
 {
-   return bus_read_4(sc-mem_res, off);
+
+   return (bus_read_4(sc-mem_res, off));
 }
 
 static inline void
 WR4(struct ate_softc *sc, bus_size_t off, uint32_t val)
 {
+
bus_write_4(sc-mem_res, off, val);
 }
 
@@ -125,41 +127,45 @@ BARRIER(struct ate_softc *sc, bus_size_t
bus_barrier(sc-mem_res, off, len, flags);
 }
 
-#define ATE_LOCK(_sc)  mtx_lock((_sc)-sc_mtx)
+#defineATE_LOCK(_sc)   mtx_lock((_sc)-sc_mtx)
 #defineATE_UNLOCK(_sc) mtx_unlock((_sc)-sc_mtx)
-#define ATE_LOCK_INIT(_sc) \
-   mtx_init(_sc-sc_mtx, device_get_nameunit(_sc-dev), \
+#defineATE_LOCK_INIT(_sc)  \
+   mtx_init(_sc-sc_mtx, device_get_nameunit(_sc-dev),   \
MTX_NETWORK_LOCK, MTX_DEF)
-#define ATE_LOCK_DESTROY(_sc)  mtx_destroy(_sc-sc_mtx);
-#define ATE_ASSERT_LOCKED(_sc) mtx_assert(_sc-sc_mtx, MA_OWNED);
-#define ATE_ASSERT_UNLOCKED(_sc) mtx_assert(_sc-sc_mtx, MA_NOTOWNED);
+#defineATE_LOCK_DESTROY(_sc)   mtx_destroy(_sc-sc_mtx);
+#defineATE_ASSERT_LOCKED(_sc)  mtx_assert(_sc-sc_mtx, MA_OWNED);
+#defineATE_ASSERT_UNLOCKED(_sc) mtx_assert(_sc-sc_mtx, MA_NOTOWNED);
 
 static devclass_t ate_devclass;
 
-/* ifnet entry points */
+/*
+ * ifnet entry points.
+ */
+static voidateinit_locked(void *);
+static voidatestart_locked(struct ifnet *);
+
+static voidateinit(void *);
+static voidatestart(struct ifnet *);
+static voidatestop(struct ate_softc *);
+static int ateioctl(struct ifnet * ifp, u_long, caddr_t);
 
-static void ateinit_locked(void *);
-static void 

svn commit: r192065 - head/sys/fs/nfsclient

2009-05-13 Thread Rick Macklem
Author: rmacklem
Date: Wed May 13 21:18:34 2009
New Revision: 192065
URL: http://svn.freebsd.org/changeset/base/192065

Log:
  Apply a one line change to nfs_clbio.c (which is largely a copy
  of sys/nfsclient/nfs_bio.c) to track the change recently committed
  by acl for nfs_bio.c.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clbio.c

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==
--- head/sys/fs/nfsclient/nfs_clbio.c   Wed May 13 21:01:10 2009
(r192064)
+++ head/sys/fs/nfsclient/nfs_clbio.c   Wed May 13 21:18:34 2009
(r192065)
@@ -306,7 +306,8 @@ ncl_getpages(struct vop_getpages_args *a
 * Read operation filled an entire page
 */
m-valid = VM_PAGE_BITS_ALL;
-   vm_page_undirty(m);
+   KASSERT(m-dirty == 0,
+   (nfs_getpages: page %p is dirty, m));
} else if (size  toff) {
/*
 * Read operation filled a partial page.
___
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: r192066 - head/sys/dev/aic

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Wed May 13 22:31:25 2009
New Revision: 192066
URL: http://svn.freebsd.org/changeset/base/192066

Log:
  Snip redundant assignment.
  
  Approved by:  scottl
  MFC after:2 weeks
  Coverity ID:  3863

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

Modified: head/sys/dev/aic/aic.c
==
--- head/sys/dev/aic/aic.c  Wed May 13 21:18:34 2009(r192065)
+++ head/sys/dev/aic/aic.c  Wed May 13 22:31:25 2009(r192066)
@@ -168,7 +168,7 @@ aic_action(struct cam_sim *sim, union cc
}
case XPT_SET_TRAN_SETTINGS:
{
-   struct ccb_trans_settings *cts = cts = ccb-cts;
+   struct ccb_trans_settings *cts = ccb-cts;
struct aic_tinfo *ti = aic-tinfo[ccb-ccb_h.target_id];
struct ccb_trans_settings_scsi *scsi =
cts-proto_specific.scsi;
___
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: r192067 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc

2009-05-13 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu May 14 00:34:26 2009
New Revision: 192067
URL: http://svn.freebsd.org/changeset/base/192067

Log:
  Factor out platform dependent things unrelated to device drivers into a
  new platform module. These are probed in early boot, and have the
  responsibility of determining the layout of physical memory, determining
  the CPU timebase frequency, and handling the zoo of SMP mechanisms
  found on PowerPC.
  
  Reviewed by:  marcel, raj
  Book-E parts by: raj

Added:
  head/sys/powerpc/aim/platform_chrp.c   (contents, props changed)
  head/sys/powerpc/booke/platform_bare.c   (contents, props changed)
  head/sys/powerpc/include/platform.h
 - copied, changed from r192066, head/sys/powerpc/include/powerpc.h
  head/sys/powerpc/include/platformvar.h   (contents, props changed)
  head/sys/powerpc/powerpc/platform.c   (contents, props changed)
  head/sys/powerpc/powerpc/platform_if.m   (contents, props changed)
Deleted:
  head/sys/powerpc/include/powerpc.h
Modified:
  head/sys/conf/files.powerpc
  head/sys/powerpc/aim/clock.c
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/mp_cpudep.c
  head/sys/powerpc/aim/ofw_machdep.c
  head/sys/powerpc/aim/vm_machdep.c
  head/sys/powerpc/booke/clock.c
  head/sys/powerpc/booke/machdep.c
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/booke/vm_machdep.c
  head/sys/powerpc/include/md_var.h
  head/sys/powerpc/include/ofw_machdep.h
  head/sys/powerpc/include/pmap.h
  head/sys/powerpc/include/smp.h
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/powerpc/mp_machdep.c
  head/sys/powerpc/powerpc/pmap_dispatch.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Wed May 13 22:31:25 2009(r192066)
+++ head/sys/conf/files.powerpc Thu May 14 00:34:26 2009(r192067)
@@ -81,6 +81,7 @@ powerpc/aim/mp_cpudep.c   optionalaim sm
 powerpc/aim/nexus.coptionalaim
 powerpc/aim/ofw_machdep.c  optionalaim
 powerpc/aim/ofwmagic.S optionalaim
+powerpc/aim/platform_chrp.coptionalaim
 powerpc/aim/swtch.Soptionalaim
 powerpc/aim/trap.c optionalaim
 powerpc/aim/uma_machdep.c  optionalaim
@@ -90,6 +91,7 @@ powerpc/booke/copyinout.c optionale500
 powerpc/booke/interrupt.c  optionale500
 powerpc/booke/locore.S optionale500 no-obj
 powerpc/booke/machdep.coptionale500
+powerpc/booke/platform_bare.c  optionalmpc85xx
 powerpc/booke/pmap.c   optionale500
 powerpc/booke/swtch.S  optionale500
 powerpc/booke/trap.c   optionale500
@@ -155,6 +157,8 @@ powerpc/powerpc/mp_machdep.coptionalsm
 powerpc/powerpc/openpic.c  standard
 powerpc/powerpc/pic_if.m   standard
 powerpc/powerpc/pmap_dispatch.cstandard
+powerpc/powerpc/platform.c standard
+powerpc/powerpc/platform_if.m  standard
 powerpc/powerpc/sc_machdep.c   optionalsc
 powerpc/powerpc/setjmp.S   standard
 powerpc/powerpc/sigcode.S  standard

Modified: head/sys/powerpc/aim/clock.c
==
--- head/sys/powerpc/aim/clock.cWed May 13 22:31:25 2009
(r192066)
+++ head/sys/powerpc/aim/clock.cThu May 14 00:34:26 2009
(r192067)
@@ -125,44 +125,27 @@ decr_intr(struct trapframe *frame)
 void
 decr_init(void)
 {
-   int qhandle, phandle;
-   char name[32];
-   unsigned int msr;
-
-   phandle = 0;
+   struct cpuref cpu;
+   register_t msr;
 
/*
-* Get this info during autoconf?   XXX
+* Check the BSP's timebase frequency. Sometimes we can't find the BSP, 
so fall
+* back to the first CPU in this case.
 */
-   for (qhandle = OF_peer(0); qhandle; qhandle = phandle) {
-   if (OF_getprop(qhandle, device_type, name, sizeof name) = 0
-!strcmp(name, cpu)
-OF_getprop(qhandle, timebase-frequency,
- ticks_per_sec, sizeof ticks_per_sec) = 0) {
-   /*
-* Should check for correct CPU here?   XXX
-*/
-   msr = mfmsr();
-   mtmsr(msr  ~PSL_EE);
-
-   ns_per_tick = 10 / ticks_per_sec;
-   ticks_per_intr = ticks_per_sec / hz;
-   mtdec(ticks_per_intr);
-
-   mtmsr(msr);
-
-   break;
-   }
-   if ((phandle = OF_child(qhandle)))
-   continue;
-   while (qhandle) {
-   if ((phandle = OF_peer(qhandle)))
-  

svn commit: r192070 - stable/7/libexec/rpc.rquotad

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 01:40:36 2009
New Revision: 192070
URL: http://svn.freebsd.org/changeset/base/192070

Log:
  MFC r184638: style and WARNS cleanup

Modified:
  stable/7/libexec/rpc.rquotad/   (props changed)
  stable/7/libexec/rpc.rquotad/Makefile
  stable/7/libexec/rpc.rquotad/rquotad.c

Modified: stable/7/libexec/rpc.rquotad/Makefile
==
--- stable/7/libexec/rpc.rquotad/Makefile   Thu May 14 01:38:06 2009
(r192069)
+++ stable/7/libexec/rpc.rquotad/Makefile   Thu May 14 01:40:36 2009
(r192070)
@@ -4,6 +4,8 @@ PROG =  rpc.rquotad
 SRCS = rquotad.c
 MAN  = rpc.rquotad.8
 
+WARNS ?= 6
+
 DPADD= ${LIBRPCSVC}
 LDADD= -lrpcsvc
 

Modified: stable/7/libexec/rpc.rquotad/rquotad.c
==
--- stable/7/libexec/rpc.rquotad/rquotad.c  Thu May 14 01:38:06 2009
(r192069)
+++ stable/7/libexec/rpc.rquotad/rquotad.c  Thu May 14 01:40:36 2009
(r192070)
@@ -1,39 +1,35 @@
 /*
  * by Manuel Bouyer (bou...@ensta.fr)
- * 
+ *
  * There is no copyright, you can use it as you want.
  */
 
-#ifndef lint
-static const char rcsid[] =
-  $FreeBSD$;
-#endif /* not lint */
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
 
 #include sys/param.h
-#include sys/types.h
 #include sys/mount.h
 #include sys/file.h
 #include sys/stat.h
 #include sys/socket.h
-#include signal.h
+
+#include ufs/ufs/quota.h
+#include rpc/rpc.h
+#include rpcsvc/rquota.h
+#include arpa/inet.h
+#include netdb.h
 
 #include ctype.h
 #include errno.h
 #include fstab.h
 #include grp.h
 #include pwd.h
+#include signal.h
 #include stdio.h
 #include stdlib.h
 #include string.h
-#include unistd.h
-
 #include syslog.h
-
-#include ufs/ufs/quota.h
-#include rpc/rpc.h
-#include rpcsvc/rquota.h
-#include arpa/inet.h
-#include netdb.h
+#include unistd.h
 
 void rquota_service(struct svc_req *request, SVCXPRT *transp);
 void sendquota(struct svc_req *request, SVCXPRT *transp);
@@ -56,15 +52,17 @@ struct fs_stat *fs_begin = NULL;
 
 int from_inetd = 1;
 
-void 
+static void
 cleanup(int sig)
 {
+
+   (void) sig;
(void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL);
exit(0);
 }
 
 int
-main(int argc, char *argv[])
+main(void)
 {
SVCXPRT *transp;
int ok;
@@ -101,19 +99,22 @@ main(int argc, char *argv[])
ok = svc_create(rquota_service,
RQUOTAPROG, RQUOTAVERS, udp);
if (!ok) {
-   syslog(LOG_ERR, unable to register (RQUOTAPROG, RQUOTAVERS, 
%s), (!from_inetd)?udp:(inetd));
+   syslog(LOG_ERR,
+   unable to register (RQUOTAPROG, RQUOTAVERS, %s),
+   from_inetd ? (inetd) : udp);
exit(1);
}
 
-   initfs();   /* init the fs_stat list */
+   initfs();
svc_run();
syslog(LOG_ERR, svc_run returned);
exit(1);
 }
 
-void 
+void
 rquota_service(struct svc_req *request, SVCXPRT *transp)
 {
+
switch (request-rq_proc) {
case NULLPROC:
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
@@ -133,7 +134,7 @@ rquota_service(struct svc_req *request, 
 }
 
 /* read quota for the specified id, and send it */
-void 
+void
 sendquota(struct svc_req *request, SVCXPRT *transp)
 {
struct getquota_args getq_args;
@@ -183,7 +184,7 @@ sendquota(struct svc_req *request, SVCXP
}
 }
 
-void 
+void
 printerr_reply(SVCXPRT *transp)/* when a reply to a request failed */
 {
char name[INET6_ADDRSTRLEN];
@@ -203,7 +204,7 @@ printerr_reply(SVCXPRT *transp) /* when 
 }
 
 /* initialise the fs_tab list from entries in /etc/fstab */
-void 
+void
 initfs(void)
 {
struct fs_stat *fs_current = NULL;
@@ -222,10 +223,12 @@ initfs(void)
fs_current = (struct fs_stat *) malloc(sizeof(struct fs_stat));
fs_current-fs_next = fs_next;  /* next element */
 
-   fs_current-fs_file = malloc(sizeof(char) * 
(strlen(fs-fs_file) + 1));
+   fs_current-fs_file =
+   malloc(sizeof(char) * (strlen(fs-fs_file) + 1));
strcpy(fs_current-fs_file, fs-fs_file);
 
-   fs_current-qfpathname = malloc(sizeof(char) * 
(strlen(qfpathname) + 1));
+   fs_current-qfpathname =
+   malloc(sizeof(char) * (strlen(qfpathname) + 1));
strcpy(fs_current-qfpathname, qfpathname);
 
stat(fs_current-fs_file, st);
@@ -242,7 +245,7 @@ initfs(void)
  * Return 0 if fail, 1 otherwise
  */
 int
-getfsquota(long id, char   *path, struct dqblk *dqblk)
+getfsquota(long id, char *path, struct dqblk *dqblk)
 {
struct stat st_path;
struct fs_stat *fs;
@@ -301,8 +304,8 @@ hasquota(struct fstab *fs, char  **qfnam
 {
static char initname, usrname[100];
static char buf[BUFSIZ];
-   char*opt, *cp;
-

svn commit: r192071 - stable/7/share/man/man9

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 01:41:54 2009
New Revision: 192071
URL: http://svn.freebsd.org/changeset/base/192071

Log:
  MFC r184690: missing email address

Modified:
  stable/7/share/man/man9/   (props changed)
  stable/7/share/man/man9/pseudofs.9

Modified: stable/7/share/man/man9/pseudofs.9
==
--- stable/7/share/man/man9/pseudofs.9  Thu May 14 01:40:36 2009
(r192070)
+++ stable/7/share/man/man9/pseudofs.9  Thu May 14 01:41:54 2009
(r192071)
@@ -67,4 +67,4 @@ module appeared in
 The
 .Nm
 module and this manual page were written by
-.An Dag-Erling Sm\(/orgrav .
+.An Dag-Erling Sm\(/orgrav Aq d...@freebsd.org .
___
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: r192073 - stable/7/usr.bin/fetch

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 02:07:41 2009
New Revision: 192073
URL: http://svn.freebsd.org/changeset/base/192073

Log:
  MFC 185912: Apply the same defaults to HTTPS as to HTTP.
  MFC 187361: Fix FTP / HTTP timeouts

Modified:
  stable/7/usr.bin/fetch/   (props changed)
  stable/7/usr.bin/fetch/fetch.c

Modified: stable/7/usr.bin/fetch/fetch.c
==
--- stable/7/usr.bin/fetch/fetch.c  Thu May 14 02:00:50 2009
(r192072)
+++ stable/7/usr.bin/fetch/fetch.c  Thu May 14 02:07:41 2009
(r192073)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2000-2004 Dag-Erling Co�dan Sm�rgrav
+ * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,7 @@ __FBSDID($FreeBSD$);
 #include fetch.h
 
 #define MINBUFSIZE 4096
+#define TIMEOUT120
 
 /* Option flags */
 int A_flag;/*-A: do not follow 302 redirects */
@@ -75,7 +76,7 @@ intR_flag;/*-R: don't delete part
 int r_flag;/*-r: restart previously interrupted transfer */
 off_t   S_size;/*-S: require size to match */
 int s_flag;/*-s: show size, don't fetch */
-longT_secs = 120;  /*-T: transfer timeout in seconds */
+longT_secs;/*-T: transfer timeout in seconds */
 int t_flag;/*!   -t: workaround TCP bug */
 int U_flag;/*-U: do not use high ports */
 int v_level = 1;   /*-v: verbosity level */
@@ -88,8 +89,8 @@ intsigalrm;   /* SIGALRM received */
 int siginfo;   /* SIGINFO received */
 int sigint;/* SIGINT received */
 
-longftp_timeout;   /* default timeout for FTP transfers */
-longhttp_timeout;  /* default timeout for HTTP transfers */
+longftp_timeout = TIMEOUT; /* default timeout for FTP transfers */
+longhttp_timeout = TIMEOUT;/* default timeout for HTTP transfers */
 char   *buf;   /* transfer buffer */
 
 
@@ -376,7 +377,8 @@ fetch(char *URL, const char *path)
}
 
/* HTTP specific flags */
-   if (strcmp(url-scheme, SCHEME_HTTP) == 0) {
+   if (strcmp(url-scheme, SCHEME_HTTP) == 0 ||
+   strcmp(url-scheme, SCHEME_HTTPS) == 0) {
if (d_flag)
strcat(flags, d);
if (A_flag)
___
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: r192074 - stable/7/share/man/man9

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 02:09:09 2009
New Revision: 192074
URL: http://svn.freebsd.org/changeset/base/192074

Log:
  MFC r186224: exeunt sysexits.h

Modified:
  stable/7/share/man/man9/   (props changed)
  stable/7/share/man/man9/style.9

Modified: stable/7/share/man/man9/style.9
==
--- stable/7/share/man/man9/style.9 Thu May 14 02:07:41 2009
(r192073)
+++ stable/7/share/man/man9/style.9 Thu May 14 02:09:09 2009
(r192074)
@@ -26,7 +26,7 @@
 .\From: @(#)style 1.14 (Berkeley) 4/28/95
 .\ $FreeBSD$
 .\
-.Dd February 10, 2005
+.Dd December 17, 2008
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -602,11 +602,9 @@ Do YOU understand the following?
k = !(l  FLAGS);
 .Ed
 .Pp
-Exits should be 0 on success, or according to the predefined
-values in
-.Xr sysexits 3 .
+Exits should be 0 on success, or 1 on failure.
 .Bd -literal
-   exit(EX_OK);/*
+   exit(0);/*
 * Avoid obvious comments such as
 * Exit 0 on success.
 */
@@ -806,7 +804,7 @@ placed in a single set of brackets.
 .Ed
 .Bd -literal
(void)fprintf(stderr, usage: f [-ab]\en);
-   exit(EX_USAGE);
+   exit(1);
 }
 .Ed
 .Pp
@@ -840,7 +838,6 @@ and produce minimal warnings.
 .Xr indent 1 ,
 .Xr lint 1 ,
 .Xr err 3 ,
-.Xr sysexits 3 ,
 .Xr warn 3 ,
 .Xr style.Makefile 5
 .Sh HISTORY
___
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: r192075 - stable/7/usr.bin/sockstat

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 02:10:31 2009
New Revision: 192075
URL: http://svn.freebsd.org/changeset/base/192075

Log:
  MFC r187915: make sure columns don't run into each other.
  
  PR:   bin/129318

Modified:
  stable/7/usr.bin/sockstat/   (props changed)
  stable/7/usr.bin/sockstat/sockstat.c

Modified: stable/7/usr.bin/sockstat/sockstat.c
==
--- stable/7/usr.bin/sockstat/sockstat.cThu May 14 02:09:09 2009
(r192074)
+++ stable/7/usr.bin/sockstat/sockstat.cThu May 14 02:10:31 2009
(r192075)
@@ -584,25 +584,25 @@ display(void)
continue;
pos = 0;
if ((pwd = getpwuid(xf-xf_uid)) == NULL)
-   pos += xprintf(%lu, (u_long)xf-xf_uid);
+   pos += xprintf(%lu , (u_long)xf-xf_uid);
else
-   pos += xprintf(%s, pwd-pw_name);
+   pos += xprintf(%s , pwd-pw_name);
while (pos  9)
pos += xprintf( );
pos += xprintf(%.10s, getprocname(xf-xf_pid));
while (pos  20)
pos += xprintf( );
-   pos += xprintf(%lu, (u_long)xf-xf_pid);
+   pos += xprintf(%lu , (u_long)xf-xf_pid);
while (pos  26)
pos += xprintf( );
-   pos += xprintf(%d, xf-xf_fd);
+   pos += xprintf(%d , xf-xf_fd);
while (pos  29)
pos += xprintf( );
pos += xprintf(%s, s-protoname);
if (s-vflag  INP_IPV4)
-   pos += xprintf(4);
+   pos += xprintf(4 );
if (s-vflag  INP_IPV6)
-   pos += xprintf(6);
+   pos += xprintf(6 );
while (pos  36)
pos += xprintf( );
switch (s-family) {
___
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: r192076 - in stable/7/etc: . rc.d

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 02:14:46 2009
New Revision: 192076
URL: http://svn.freebsd.org/changeset/base/192076

Log:
  MFC r190032: add hostid

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/netstart
  stable/7/etc/rc.d/   (props changed)

Modified: stable/7/etc/netstart
==
--- stable/7/etc/netstart   Thu May 14 02:10:31 2009(r192075)
+++ stable/7/etc/netstart   Thu May 14 02:14:46 2009(r192076)
@@ -38,6 +38,7 @@
 
 load_rc_config 'XXX'
 /etc/rc.d/devd start
+/etc/rc.d/hostid start
 /etc/rc.d/hostname start
 /etc/rc.d/ipmon start
 /etc/rc.d/ipfilter start
___
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: r192077 - stable/7/share/timedef

2009-05-13 Thread Dag-Erling Smorgrav
Author: des
Date: Thu May 14 02:20:37 2009
New Revision: 192077
URL: http://svn.freebsd.org/changeset/base/192077

Log:
  MFC r190774: fix ISO8859-15 links for nb_NO / no_NO.

Modified:
  stable/7/share/timedef/   (props changed)
  stable/7/share/timedef/Makefile

Modified: stable/7/share/timedef/Makefile
==
--- stable/7/share/timedef/Makefile Thu May 14 02:14:46 2009
(r192076)
+++ stable/7/share/timedef/Makefile Thu May 14 02:20:37 2009
(r192077)
@@ -126,10 +126,9 @@ GB2312_GBK=zh_CN
 ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
${NL_LINKS} ${NO_LINKS} en_US:af_ZA
 ISO8859-1_ISO8859-15= ca_ES da_DK de_AT de_DE en_GB en_US es_ES eu_ES \
-   fi_FI fr_FR is_IS it_IT la_LN nl_NL nn_NO no_NO pt_PT \
+   fi_FI fr_FR is_IS it_IT la_LN nb_NO nl_NL nn_NO no_NO pt_PT \
sv_SE \
-   ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} \
-   ${NO_LINKS}
+   ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS}
 ISO8859-1_US-ASCII= ${GB_LINKS} en_GB en_US la_LN
 ISO8859-1_ISO8859-2= la_LN
 ISO8859-1_ISO8859-4= la_LN
___
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: r192080 - in head/sys: kern sys

2009-05-13 Thread Jeff Roberson
Author: jeff
Date: Thu May 14 03:24:22 2009
New Revision: 192080
URL: http://svn.freebsd.org/changeset/base/192080

Log:
   - Implement a lockless file descriptor lookup algorithm in
 fget_unlocked().
   - Save old file descriptor tables created on expansion until
 the entire descriptor table is freed so that pointers may be
 followed without regard for expanders.
   - Mark the file zone as NOFREE so we may attempt to reference
 potentially freed files.
   - Convert several fget_locked() users to fget_unlocked().  This
 requires us to manage reference counts explicitly but reduces
 locking overhead in the common case.

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/sys_generic.c
  head/sys/kern/tty.c
  head/sys/kern/uipc_syscalls.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/filedesc.h

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cThu May 14 02:42:29 2009
(r192079)
+++ head/sys/kern/kern_descrip.cThu May 14 03:24:22 2009
(r192080)
@@ -125,12 +125,24 @@ static void   fdused(struct filedesc *fdp,
 #define OFILESIZE (sizeof(struct file *) + sizeof(char))
 
 /*
+ * Storage to hold unused ofiles that need to be reclaimed.
+ */
+struct freetable {
+   struct file **ft_table;
+   SLIST_ENTRY(freetable) ft_next;
+};
+
+/*
  * Basic allocation of descriptors:
  * one of the above, plus arrays for NDFILE descriptors.
  */
 struct filedesc0 {
struct  filedesc fd_fd;
/*
+* ofiles which need to be reclaimed on free.
+*/
+   SLIST_HEAD(,freetable) fd_free;
+   /*
 * These arrays are used when the number of open files is
 * = NDFILE, and are then pointed to by the pointers above.
 */
@@ -1268,7 +1280,10 @@ out:
 static void
 fdgrowtable(struct filedesc *fdp, int nfd)
 {
+   struct filedesc0 *fdp0;
+   struct freetable *fo;
struct file **ntable;
+   struct file **otable;
char *nfileflags;
int nnfiles, onfiles;
NDSLOTTYPE *nmap;
@@ -1287,7 +1302,7 @@ fdgrowtable(struct filedesc *fdp, int nf
 
/* allocate a new table and (if required) new bitmaps */
FILEDESC_XUNLOCK(fdp);
-   ntable = malloc(nnfiles * OFILESIZE,
+   ntable = malloc((nnfiles * OFILESIZE) + sizeof(struct freetable),
M_FILEDESC, M_ZERO | M_WAITOK);
nfileflags = (char *)ntable[nnfiles];
if (NDSLOTS(nnfiles)  NDSLOTS(onfiles))
@@ -1311,10 +1326,20 @@ fdgrowtable(struct filedesc *fdp, int nf
}
bcopy(fdp-fd_ofiles, ntable, onfiles * sizeof(*ntable));
bcopy(fdp-fd_ofileflags, nfileflags, onfiles);
-   if (onfiles  NDFILE)
-   free(fdp-fd_ofiles, M_FILEDESC);
-   fdp-fd_ofiles = ntable;
+   otable = fdp-fd_ofiles;
fdp-fd_ofileflags = nfileflags;
+   fdp-fd_ofiles = ntable;
+   /*
+* We must preserve ofiles until the process exits because we can't
+* be certain that no threads have references to the old table via
+* _fget().
+*/
+   if (onfiles  NDFILE) {
+   fo = (struct freetable *)otable[onfiles];
+   fdp0 = (struct filedesc0 *)fdp;
+   fo-ft_table = otable;
+   SLIST_INSERT_HEAD(fdp0-fd_free, fo, ft_next);
+   }
if (NDSLOTS(nnfiles)  NDSLOTS(onfiles)) {
bcopy(fdp-fd_map, nmap, NDSLOTS(onfiles) * sizeof(*nmap));
if (NDSLOTS(onfiles)  NDSLOTS(NDFILE))
@@ -1512,6 +1537,8 @@ fdhold(struct proc *p)
 static void
 fddrop(struct filedesc *fdp)
 {
+   struct filedesc0 *fdp0;
+   struct freetable *ft;
int i;
 
mtx_lock(fdesc_mtx);
@@ -1521,6 +1548,11 @@ fddrop(struct filedesc *fdp)
return;
 
FILEDESC_LOCK_DESTROY(fdp);
+   fdp0 = (struct filedesc0 *)fdp;
+   while ((ft = SLIST_FIRST(fdp0-fd_free)) != NULL) {
+   SLIST_REMOVE_HEAD(fdp0-fd_free, ft_next);
+   free(ft-ft_table, M_FILEDESC);
+   }
free(fdp, M_FILEDESC);
 }
 
@@ -2022,6 +2054,38 @@ finit(struct file *fp, u_int flag, short
atomic_store_rel_ptr((volatile uintptr_t *)fp-f_ops, (uintptr_t)ops);
 }
 
+struct file *
+fget_unlocked(struct filedesc *fdp, int fd)
+{
+   struct file *fp;
+   u_int count;
+
+   if (fd  0 || fd = fdp-fd_nfiles)
+   return (NULL);
+   /*
+* Fetch the descriptor locklessly.  We avoid fdrop() races by
+* never raising a refcount above 0.  To accomplish this we have
+* to use a cmpset loop rather than an atomic_add.  The descriptor
+* must be re-verified once we acquire a reference to be certain
+* that the identity is still correct and we did not lose a race
+* due to preemption.
+*/
+   for (;;) {
+   fp = fdp-fd_ofiles[fd];
+   if (fp == NULL)
+   

svn commit: r192081 - head/sys/dev/e1000

2009-05-13 Thread Kip Macy
Author: kmacy
Date: Thu May 14 03:33:04 2009
New Revision: 192081
URL: http://svn.freebsd.org/changeset/base/192081

Log:
  Call drbr_stats_update to update ifp stats directly when we bypass the 
buf_ring on transmit

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu May 14 03:24:22 2009(r192080)
+++ head/sys/dev/e1000/if_em.c  Thu May 14 03:33:04 2009(r192081)
@@ -1006,15 +1006,18 @@ em_transmit_locked(struct ifnet *ifp, st
|| (!adapter-link_active)) {
error = drbr_enqueue(ifp, adapter-br, m);
return (error);
-   }
-   
-   if (ADAPTER_RING_EMPTY(adapter) 
+   } else if (ADAPTER_RING_EMPTY(adapter) 
(adapter-num_tx_desc_avail  EM_TX_OP_THRESHOLD)) {
if (em_xmit(adapter, m)) {
if (m  (error = drbr_enqueue(ifp, adapter-br, m)) != 
0)
return (error);
} else {
/*
+* We've bypassed the buf ring so we need to update
+* ifp directly
+*/
+   drbr_stats_update(ifp, m-m_pkthdr.len, m-m_flags);
+   /*
** Send a copy of the frame to the BPF
** listener and set the watchdog on.
*/
___
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: r192085 - head/sys/netinet

2009-05-13 Thread Qing Li
Author: qingli
Date: Thu May 14 05:27:09 2009
New Revision: 192085
URL: http://svn.freebsd.org/changeset/base/192085

Log:
  Ignore the INADDR_ANY address inserted/deleted by DHCP when installing a 
loopback route
  to the interface address.

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Thu May 14 03:54:03 2009(r192084)
+++ head/sys/netinet/in.c   Thu May 14 05:27:09 2009(r192085)
@@ -906,6 +906,9 @@ in_ifinit(struct ifnet *ifp, struct in_i
if ((error = in_addprefix(ia, flags)) != 0)
return (error);
 
+   if (ia-ia_addr.sin_addr.s_addr == INADDR_ANY)
+   return (0);
+
/*
 * add a loopback route to self
 */
@@ -1014,7 +1017,8 @@ in_scrubprefix(struct in_ifaddr *target)
if ((target-ia_flags  IFA_ROUTE) == 0)
return (0);
 
-   if (!(target-ia_ifp-if_flags  (IFF_LOOPBACK | IFF_POINTOPOINT))) {
+   if ((target-ia_addr.sin_addr.s_addr != INADDR_ANY) 
+   !(target-ia_ifp-if_flags  (IFF_LOOPBACK | IFF_POINTOPOINT))) {
bzero(null_sdl, sizeof(null_sdl));
null_sdl.sdl_len = sizeof(null_sdl);
null_sdl.sdl_family = AF_LINK;
___
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