svn commit: r238857 - head/sys/dev/ath/ath_hal

2012-07-28 Thread Adrian Chadd
Author: adrian
Date: Sat Jul 28 07:25:00 2012
New Revision: 238857
URL: http://svn.freebsd.org/changeset/base/238857

Log:
  Commit missing #define from a previous check-in.
  
  The AR9300 and later have an 8-deep TX FIFO for each hardware queue.

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

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Sat Jul 28 06:38:44 2012
(r238856)
+++ head/sys/dev/ath/ath_hal/ah.h   Sat Jul 28 07:25:00 2012
(r238857)
@@ -220,6 +220,8 @@ typedef enum {
 
 #defineHAL_NUM_RX_QUEUES   2   /* max possible # of 
queues */
 
+#defineHAL_TXFIFO_DEPTH8   /* transmit fifo depth 
*/
+
 /*
  * Transmit queue subtype.  These map directly to
  * WME Access Categories (except for UPSD).  Refer
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238858 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5416

2012-07-28 Thread Adrian Chadd
Author: adrian
Date: Sat Jul 28 07:28:08 2012
New Revision: 238858
URL: http://svn.freebsd.org/changeset/base/238858

Log:
  Flesh out the multi-rate retry capability.
  
  The existing method for testing for MRR is to call the "SetupXTXDesc"
  HAL method and see if it returns AH_TRUE or AH_FALSE.  This capability
  explicitly lists what number of multi-rate attempts are possible.
  
  "1" means "one rate attempt supported".

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==
--- head/sys/dev/ath/ath_hal/ah.c   Sat Jul 28 07:25:00 2012
(r238857)
+++ head/sys/dev/ath/ath_hal/ah.c   Sat Jul 28 07:28:08 2012
(r238858)
@@ -657,7 +657,8 @@ ath_hal_getcapability(struct ath_hal *ah
}
case HAL_CAP_RXBUFSIZE:
case HAL_CAP_NUM_MR_RETRIES:
-   return HAL_EINVAL;  /* XXX not yet */
+   *result = pCap->halNumMRRetries;
+   return HAL_OK;
case HAL_CAP_BT_COEX:
return pCap->halBtCoexSupport ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_HT20_SGI:

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==
--- head/sys/dev/ath/ath_hal/ah_internal.h  Sat Jul 28 07:25:00 2012
(r238857)
+++ head/sys/dev/ath/ath_hal/ah_internal.h  Sat Jul 28 07:28:08 2012
(r238858)
@@ -252,6 +252,7 @@ typedef struct {
int halRxStatusLen;
int halRxHpFifoDepth;
int halRxLpFifoDepth;
+   int halNumMRRetries;
 } HAL_CAPABILITIES;
 
 struct regDomain;

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Sat Jul 28 07:25:00 
2012(r238857)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Sat Jul 28 07:28:08 
2012(r238858)
@@ -361,6 +361,7 @@ ar5210FillCapabilityInfo(struct ath_hal 
 
pCap->halSleepAfterBeaconBroken = AH_TRUE;
pCap->halPSPollBroken = AH_FALSE;
+   pCap->halNumMRRetries = 1;  /* No hardware MRR support */
 
pCap->halTotalQueues = HAL_NUM_TX_QUEUES;
pCap->halKeyCacheSize = 64;

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Sat Jul 28 07:25:00 
2012(r238857)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Sat Jul 28 07:28:08 
2012(r238858)
@@ -496,6 +496,7 @@ ar5211FillCapabilityInfo(struct ath_hal 
pCap->halSleepAfterBeaconBroken = AH_TRUE;
pCap->halPSPollBroken = AH_TRUE;
pCap->halVEOLSupport = AH_TRUE;
+   pCap->halNumMRRetries = 1;  /* No hardware MRR support */
 
pCap->halTotalQueues = HAL_NUM_TX_QUEUES;
pCap->halKeyCacheSize = 128;

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Sat Jul 28 07:25:00 
2012(r238857)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Sat Jul 28 07:28:08 
2012(r238858)
@@ -824,6 +824,7 @@ ar5212FillCapabilityInfo(struct ath_hal 
pCap->halTurboGSupport = pCap->halWirelessModes & HAL_MODE_108G;
 
pCap->halPSPollBroken = AH_TRUE;/* XXX fixed in later revs? */
+   pCap->halNumMRRetries = 4;  /* Hardware supports 4 MRR */
pCap->halVEOLSupport = AH_TRUE;
pCap->halBssIdMaskSupport = AH_TRUE;
pCap->halMcastKeySrchSupport = AH_TRUE;

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jul 28 07:25:00 
2012(r238857)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jul 28 07:28:08 
2012(r238858)
@@ -892,6 +892,7 @@ ar5416FillCapabilityInfo(struct ath_hal 
pCap->halTurboGSupport = pCap->halWirelessModes & HAL_MODE_108G;
 
pCap->halPSPollBroken = AH_TRUE;/* XXX fixed in later revs? */
+   pCap->halNumMRRetries = 4;  /* Hardware supports 4 MRR */
pCap->halVEOLSupport = AH_TRUE;
pCap->halBssIdMaskSupport = AH_TRUE;
pCap->halMcastKeySrchSupport = AH_TRUE; /* Works on AR5416 and later */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-s

Re: svn commit: r238672 - head/sys/dev/sdhci

2012-07-28 Thread Robert Watson

On Mon, 23 Jul 2012, Warner Losh wrote:


Never heard about this rule. Sorry.


   Actually, English spacing is discouraged in more recent texts; it was 
encouraged during the late 19th century up until the late 20th century 
according to ye great wikipedia [1], but I've read several other articles 
in the past decade that suggest that the English spacing convention be 
completely abolished.
   FWIW, I'd just follow surrounding style like style(9) suggests. No 
reason for fighting over an extra byte per sentence in a source file 
(unless you consider how much added bandwidth / disk space those precious 
bytes can consume :)...). Thanks, -Garrett


Double spacing is the one true way I learned how to type in school.  Since 
the 1980's though, things have changed and many advocate single spaces. 
However, that's for folks with fancy variable pitch font and such.  For 
fixed-witdh fonts, 2 is still preferred in some circles, including ours.


Source code and terminal windows are probably the last bastions of fixed-width 
fonts, and given the overt use of white space in code styling, I think we can 
expect it to remain that way for the forseeable future.  Maintaining the 
two-space separation helps in a number of ways, not least making it more clear 
when a period (full stop) is used for non-sentence ending punctuation, it's 
not ending a sentence -- e.g., in numbers lists, and even the "E.g.," earlier 
in this sentence. :-)  Perhaps we should add a bit more information on comment 
formatting to style(9) and include this point.


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


Re: svn commit: r238118 - head/lib/libc/gen

2012-07-28 Thread Robert Watson

On Tue, 24 Jul 2012, David Schultz wrote:


On Wed, Jul 04, 2012, Doug Barton wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 07/04/2012 13:32, Andrey Chernov wrote:

1) /dev/urandom may not exist in jails/sandboxes


That would be a pretty serious configuration error.


Yes -- but the scary part is that arc4random() is not fail-safe at all.  If 
/dev/random isn't there, you just silently get predictable "randomness". 
If you needed that randomness for cryptographic purposes you're out of luck; 
you might as well have used rot13.  Using the sysctl doesn't fix the failure 
mode (in fact, as I recall the sysctl dubiously never reports failure even 
if there is no entropy), but there's a narrower set of circumstances under 
which the sysctl can fail.


Probably the most important thing for us to do is to make it clear which 
sources of randomness are appropriate for use in cryptography, and then 
propagate information to the downstream APIs as needed.  Given its chequered 
past, it's clear that srandomdev() on FreeBSD is not appropriate for use in 
generating keys -- programmers should prefer the OpenSSL APIs.  Currently, 
programmers are directed to arc4random(3) by random(3), but I'm actually not 
sure that is the right advice.  I'm of the (possibly debateable) view that no 
randomness initialisation routine that can't return a failure is appropriate 
for cryptographic purposes -- if generating a key and /dev/random can't be 
found, or only the kernel arc4random bits are available but they aren't known 
to be good for key generation, then key generation should fail.


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


svn commit: r238861 - head/sys/mips/mips

2012-07-28 Thread Robert Watson
Author: rwatson
Date: Sat Jul 28 11:09:03 2012
New Revision: 238861
URL: http://svn.freebsd.org/changeset/base/238861

Log:
  Merge FreeBSD/beri Perforce change @211945 to head:
  
  Modify MIPS page table entry (PTE) initialisation so that cachability
  bits are set only once, using is_cacheable_mem() to determine what
  caching properties are required, rather than also unconditionally
  setting PTE_C_CACHE in init_pte_prot().  As PTE_C_CACHE |
  PTE_C_UNCACHED == PTE_C_CACHE, this meant that all userspace memory
  mappings of device memory (incorrectly) used caching TLB entries.
  
  This is arguably not quite what we want, even though it is (more)
  consistent with the MIPS pmap design: PTE caching properties should
  be derived from machine-independent page table attributes, but this
  is a substantially more complex change as the MIPS pmap doesn't yet
  know about page attributes, causing it to ignore requests by device
  drivers that want uncached userspace memory mappings as they
  describe memory-mapped FIFOs or shared memory with a device not
  participating in the cache coherence scheme.
  
  This fixes cacheability issues (specifically, undesired and
  unrequested caching) seen in userspace memory mappings of Avalon SoC
  bus device memory on BERI MIPS.
  
  Discussed with:   jmallett, alc
  Sponsored by: DARPA, AFRL
  MFC after:3 days

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Sat Jul 28 07:56:23 2012(r238860)
+++ head/sys/mips/mips/pmap.c   Sat Jul 28 11:09:03 2012(r238861)
@@ -3146,16 +3146,16 @@ init_pte_prot(vm_offset_t va, vm_page_t 
pt_entry_t rw;
 
if (!(prot & VM_PROT_WRITE))
-   rw =  PTE_V | PTE_RO | PTE_C_CACHE;
+   rw =  PTE_V | PTE_RO;
else if ((m->oflags & VPO_UNMANAGED) == 0) {
if ((m->md.pv_flags & PV_TABLE_MOD) != 0)
-   rw =  PTE_V | PTE_D | PTE_C_CACHE;
+   rw =  PTE_V | PTE_D;
else
-   rw = PTE_V | PTE_C_CACHE;
+   rw = PTE_V;
vm_page_aflag_set(m, PGA_WRITEABLE);
} else
/* Needn't emulate a modified bit for unmanaged pages. */
-   rw =  PTE_V | PTE_D | PTE_C_CACHE;
+   rw =  PTE_V | PTE_D;
return (rw);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238863 - head/contrib/llvm/tools/clang/lib/Driver

2012-07-28 Thread Dimitry Andric
Author: dim
Date: Sat Jul 28 12:50:25 2012
New Revision: 238863
URL: http://svn.freebsd.org/changeset/base/238863

Log:
  Similar to r238472, let clang pass --enable-new-dtags to the linker
  invocation by default.  Also make sure --hash-style=both is passed for
  the same arches as gcc, e.g. arm, sparc and x86.
  
  X-MFC-with:   r238472

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Jul 28 11:28:00 
2012(r238862)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Jul 28 12:50:25 
2012(r238863)
@@ -4761,8 +4761,10 @@ void freebsd::Link::ConstructJob(Compila
   CmdArgs.push_back("/libexec/ld-elf.so.1");
 }
 llvm::Triple::ArchType Arch = getToolChain().getArch();
-if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
+if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc ||
+Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
   CmdArgs.push_back("--hash-style=both");
+CmdArgs.push_back("--enable-new-dtags");
   }
 
   // When building 32-bit code on FreeBSD/amd64, we have to explicitly
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238864 - head/contrib/llvm/tools/clang/lib/Driver

2012-07-28 Thread Dimitry Andric
Author: dim
Date: Sat Jul 28 13:12:57 2012
New Revision: 238864
URL: http://svn.freebsd.org/changeset/base/238864

Log:
  Similar to what is already done for Linux, make clang not complain about
  unused -g, -emit-llvm or -w arguments when doing linking.  E.g. invoking
  "clang -g foo.o -o foo" will now be silent.
  
  Reported by:  Jakub Lach 
  MFC after:1 week

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Jul 28 12:50:25 
2012(r238863)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Jul 28 13:12:57 
2012(r238864)
@@ -4745,6 +4745,14 @@ void freebsd::Link::ConstructJob(Compila
   const Driver &D = getToolChain().getDriver();
   ArgStringList CmdArgs;
 
+  // Silence warning for "clang -g foo.o -o foo"
+  Args.ClaimAllArgs(options::OPT_g_Group);
+  // and "clang -emit-llvm foo.o -o foo"
+  Args.ClaimAllArgs(options::OPT_emit_llvm);
+  // and for "clang -w foo.o -o foo". Other warning options are already
+  // handled somewhere else.
+  Args.ClaimAllArgs(options::OPT_w);
+
   if (!D.SysRoot.empty())
 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238865 - head/bin/sh

2012-07-28 Thread Jilles Tjoelker
Author: jilles
Date: Sat Jul 28 14:32:55 2012
New Revision: 238865
URL: http://svn.freebsd.org/changeset/base/238865

Log:
  sh: Track continued jobs (even if not continued by bg or fg).
  
  This uses wait3's WCONTINUED flag.
  
  There is no message for this. The change is visible in "jobs" or if the job
  stops again.

Modified:
  head/bin/sh/jobs.c

Modified: head/bin/sh/jobs.c
==
--- head/bin/sh/jobs.c  Sat Jul 28 13:12:57 2012(r238864)
+++ head/bin/sh/jobs.c  Sat Jul 28 14:32:55 2012(r238865)
@@ -1027,7 +1027,8 @@ dowait(int block, struct job *job)
pid = waitproc(block, &status);
TRACE(("wait returns %d, status=%d\n", (int)pid, status));
} while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) ||
-(pid > 0 && WIFSTOPPED(status) && !iflag));
+(pid > 0 && (WIFSTOPPED(status) || WIFCONTINUED(status)) &&
+ !iflag));
if (pid == -1 && errno == ECHILD && job != NULL)
job->state = JOBDONE;
if (breakwaitcmd != 0) {
@@ -1050,7 +1051,11 @@ dowait(int block, struct job *job)
TRACE(("Changing status of proc %d from 
0x%x to 0x%x\n",
   (int)pid, sp->status,
   status));
-   sp->status = status;
+   if (WIFCONTINUED(status)) {
+   sp->status = -1;
+   jp->state = 0;
+   } else
+   sp->status = status;
thisjob = jp;
}
if (sp->status == -1)
@@ -1118,7 +1123,7 @@ waitproc(int block, int *status)
int flags;
 
 #if JOBS
-   flags = WUNTRACED;
+   flags = WUNTRACED | WCONTINUED;
 #else
flags = 0;
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238866 - head/bin/sh

2012-07-28 Thread Jilles Tjoelker
Author: jilles
Date: Sat Jul 28 14:56:50 2012
New Revision: 238866
URL: http://svn.freebsd.org/changeset/base/238866

Log:
  sh: Inline waitproc() into its only caller.

Modified:
  head/bin/sh/jobs.c

Modified: head/bin/sh/jobs.c
==
--- head/bin/sh/jobs.c  Sat Jul 28 14:32:55 2012(r238865)
+++ head/bin/sh/jobs.c  Sat Jul 28 14:56:50 2012(r238866)
@@ -94,7 +94,6 @@ static void freejob(struct job *);
 static struct job *getjob(char *);
 pid_t getjobpgrp(char *);
 static pid_t dowait(int, struct job *);
-static pid_t waitproc(int, int *);
 static void checkzombies(void);
 static void cmdtxt(union node *);
 static void cmdputs(const char *);
@@ -1021,10 +1020,18 @@ dowait(int block, struct job *job)
int stopped;
int sig;
int coredump;
+   int wflags;
 
TRACE(("dowait(%d) called\n", block));
do {
-   pid = waitproc(block, &status);
+#if JOBS
+   wflags = WUNTRACED | WCONTINUED;
+#else
+   wflags = 0;
+#endif
+   if (block == 0)
+   wflags |= WNOHANG;
+   pid = wait3(&status, wflags, (struct rusage *)NULL);
TRACE(("wait returns %d, status=%d\n", (int)pid, status));
} while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) ||
 (pid > 0 && (WIFSTOPPED(status) || WIFCONTINUED(status)) &&
@@ -1113,26 +1120,6 @@ dowait(int block, struct job *job)
 
 
 /*
- * Do a wait system call.  If job control is compiled in, we accept
- * stopped processes.  If block is zero, we return a value of zero
- * rather than blocking.
- */
-static pid_t
-waitproc(int block, int *status)
-{
-   int flags;
-
-#if JOBS
-   flags = WUNTRACED | WCONTINUED;
-#else
-   flags = 0;
-#endif
-   if (block == 0)
-   flags |= WNOHANG;
-   return wait3(status, flags, (struct rusage *)NULL);
-}
-
-/*
  * return 1 if there are stopped jobs, otherwise 0
  */
 int job_warning = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238867 - head/bin/sh

2012-07-28 Thread Jilles Tjoelker
Author: jilles
Date: Sat Jul 28 15:13:48 2012
New Revision: 238867
URL: http://svn.freebsd.org/changeset/base/238867

Log:
  sh: Do not ask for stopped/continued processes if we do not need them
  rather than retrying wait3 if they happen.

Modified:
  head/bin/sh/jobs.c

Modified: head/bin/sh/jobs.c
==
--- head/bin/sh/jobs.c  Sat Jul 28 14:56:50 2012(r238866)
+++ head/bin/sh/jobs.c  Sat Jul 28 15:13:48 2012(r238867)
@@ -1025,17 +1025,16 @@ dowait(int block, struct job *job)
TRACE(("dowait(%d) called\n", block));
do {
 #if JOBS
-   wflags = WUNTRACED | WCONTINUED;
-#else
-   wflags = 0;
+   if (iflag)
+   wflags = WUNTRACED | WCONTINUED;
+   else
 #endif
+   wflags = 0;
if (block == 0)
wflags |= WNOHANG;
pid = wait3(&status, wflags, (struct rusage *)NULL);
TRACE(("wait returns %d, status=%d\n", (int)pid, status));
-   } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) ||
-(pid > 0 && (WIFSTOPPED(status) || WIFCONTINUED(status)) &&
- !iflag));
+   } while (pid == -1 && errno == EINTR && breakwaitcmd == 0);
if (pid == -1 && errno == ECHILD && job != NULL)
job->state = JOBDONE;
if (breakwaitcmd != 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238868 - head/sys/geom/gate

2012-07-28 Thread Mikolaj Golub
Author: trociny
Date: Sat Jul 28 16:30:50 2012
New Revision: 238868
URL: http://svn.freebsd.org/changeset/base/238868

Log:
  Reorder things in g_gate_create() so at the moment when g_new_geomf()
  is called name is properly initialized.
  
  Discussed with:   pjd
  MFC after:2 weeks

Modified:
  head/sys/geom/gate/g_gate.c

Modified: head/sys/geom/gate/g_gate.c
==
--- head/sys/geom/gate/g_gate.c Sat Jul 28 15:13:48 2012(r238867)
+++ head/sys/geom/gate/g_gate.c Sat Jul 28 16:30:50 2012(r238868)
@@ -470,6 +470,44 @@ g_gate_create(struct g_gate_ctl_create *
return (EINVAL);
}
 
+   sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO);
+   sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS);
+   strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info));
+   sc->sc_seq = 1;
+   bioq_init(&sc->sc_inqueue);
+   bioq_init(&sc->sc_outqueue);
+   mtx_init(&sc->sc_queue_mtx, "gg:queue", NULL, MTX_DEF);
+   sc->sc_queue_count = 0;
+   sc->sc_queue_size = ggio->gctl_maxcount;
+   if (sc->sc_queue_size > G_GATE_MAX_QUEUE_SIZE)
+   sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE;
+   sc->sc_timeout = ggio->gctl_timeout;
+   callout_init(&sc->sc_callout, CALLOUT_MPSAFE);
+
+   mtx_lock(&g_gate_units_lock);
+   sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error);
+   if (sc->sc_unit < 0)
+   goto fail1;
+   if (ggio->gctl_unit == G_GATE_NAME_GIVEN)
+   snprintf(name, sizeof(name), "%s", ggio->gctl_name);
+   else {
+   snprintf(name, sizeof(name), "%s%d", G_GATE_PROVIDER_NAME,
+   sc->sc_unit);
+   }
+   /* Check for name collision. */
+   for (unit = 0; unit < g_gate_maxunits; unit++) {
+   if (g_gate_units[unit] == NULL)
+   continue;
+   if (strcmp(name, g_gate_units[unit]->sc_name) != 0)
+   continue;
+   error = EEXIST;
+   goto fail1;
+   }
+   sc->sc_name = name;
+   g_gate_units[sc->sc_unit] = sc;
+   g_gate_nunits++;
+   mtx_unlock(&g_gate_units_lock);
+
g_topology_lock();
 
if (ggio->gctl_readprov[0] == '\0') {
@@ -477,38 +515,24 @@ g_gate_create(struct g_gate_ctl_create *
} else {
ropp = g_provider_by_name(ggio->gctl_readprov);
if (ropp == NULL) {
-   g_topology_unlock();
G_GATE_DEBUG(1, "Provider %s doesn't exist.",
ggio->gctl_readprov);
-   return (EINVAL);
+   error = EINVAL;
+   goto fail2;
}
if ((ggio->gctl_readoffset % ggio->gctl_sectorsize) != 0) {
-   g_topology_unlock();
G_GATE_DEBUG(1, "Invalid read offset.");
-   return (EINVAL);
+   error = EINVAL;
+   goto fail2;
}
if (ggio->gctl_mediasize + ggio->gctl_readoffset >
ropp->mediasize) {
-   g_topology_unlock();
G_GATE_DEBUG(1, "Invalid read offset or media size.");
-   return (EINVAL);
+   error = EINVAL;
+   goto fail2;
}
}
 
-   sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO);
-   sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS);
-   strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info));
-   sc->sc_seq = 1;
-   bioq_init(&sc->sc_inqueue);
-   bioq_init(&sc->sc_outqueue);
-   mtx_init(&sc->sc_queue_mtx, "gg:queue", NULL, MTX_DEF);
-   sc->sc_queue_count = 0;
-   sc->sc_queue_size = ggio->gctl_maxcount;
-   if (sc->sc_queue_size > G_GATE_MAX_QUEUE_SIZE)
-   sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE;
-   sc->sc_timeout = ggio->gctl_timeout;
-   callout_init(&sc->sc_callout, CALLOUT_MPSAFE);
-
gp = g_new_geomf(&g_gate_class, "%s", name);
gp->start = g_gate_start;
gp->access = g_gate_access;
@@ -521,70 +545,18 @@ g_gate_create(struct g_gate_ctl_create *
error = g_attach(cp, ropp);
if (error != 0) {
G_GATE_DEBUG(1, "Unable to attach to %s.", ropp->name);
-   } else {
-   error = g_access(cp, 1, 0, 0);
-   if (error != 0) {
-   G_GATE_DEBUG(1, "Unable to access %s.",
-   ropp->name);
-   g_detach(cp);
-   }
+   goto fail3;
}
+   error = g_access(cp, 1, 0, 0);
if (error != 0) {
-   g_destroy_consumer(cp);
- 

Re: svn commit: r238863 - head/contrib/llvm/tools/clang/lib/Driver

2012-07-28 Thread Roman Divacky
It would be great to stay in sync with upstream.

http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?r1=160103&r2=160231

On Sat, Jul 28, 2012 at 12:50:26PM +, Dimitry Andric wrote:
> Author: dim
> Date: Sat Jul 28 12:50:25 2012
> New Revision: 238863
> URL: http://svn.freebsd.org/changeset/base/238863
> 
> Log:
>   Similar to r238472, let clang pass --enable-new-dtags to the linker
>   invocation by default.  Also make sure --hash-style=both is passed for
>   the same arches as gcc, e.g. arm, sparc and x86.
>   
>   X-MFC-with: r238472
> 
> Modified:
>   head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
> 
> Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
> ==
> --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cppSat Jul 28 
> 11:28:00 2012(r238862)
> +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cppSat Jul 28 
> 12:50:25 2012(r238863)
> @@ -4761,8 +4761,10 @@ void freebsd::Link::ConstructJob(Compila
>CmdArgs.push_back("/libexec/ld-elf.so.1");
>  }
>  llvm::Triple::ArchType Arch = getToolChain().getArch();
> -if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
> +if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc ||
> +Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
>CmdArgs.push_back("--hash-style=both");
> +CmdArgs.push_back("--enable-new-dtags");
>}
>  
>// When building 32-bit code on FreeBSD/amd64, we have to explicitly
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238869 - head/sys/dev/isp

2012-07-28 Thread Matt Jacob
Author: mjacob
Date: Sat Jul 28 20:06:29 2012
New Revision: 238869
URL: http://svn.freebsd.org/changeset/base/238869

Log:
  ---
  MISC CHANGES
  
  Add a new async event- ISP_TARGET_NOTIFY_ACK, that will guarantee
  eventual delivery of a NOTIFY ACK. This is tons better than just
  ignoring the return from isp_notify_ack and hoping for the best.
  
  Clean up the lower level lun enable code to be a bit more sensible.
  
  Fix a botch in isp_endcmd which was messing up the sense data.
  
  Fix notify ack for SRR to use a sensible error code in the case
  of a reject.
  
  Clean up and make clear what kind of firmware we've loaded and
  what capabilities it has.
  ---
  FULL (252 byte) SENSE DATA
  
  In CTIOs for the ISP, there's only a limimted amount of space
  to load SENSE DATA for associated CHECK CONDITIONS (24 or 26
  bytes). This makes it difficult to send full SENSE DATA that can
  be up to 252 bytes.
  
  Implement MODE 2 responses which have us build the FCP Response
  in system memory which the ISP will put onto the wire directly.
  
  On the initiator side, the same problem occurs in that a command
  status response only has a limited amount of space for SENSE DATA.
  This data is supplemented by status continuation responses that
  the ISP pushes onto the response queue after the status response.
  We now pull them all together so that full sense data can be
  returned to the periph driver.
  
  This is supported on 23XX, 24XX and 25XX cards.
  
  This is also preparation for doing >16 byte CDBs.
  
  ---
  FC TAPE
  
  Implement full FC-TAPE on both initiator and target mode side.  This
  capability is driven by firmware loaded, board type, board NVRAM
  settings, or hint configuration options to enable or disable. This
  is supported for 23XX, 24XX and 25XX cards.
  
  On the initiator side, we pretty much just have to generate a command
  reference number for each command we send out. This is FCP-4 compliant
  in that we do this per ITL nexus to generate the allowed 1 thru 255
  CRN.
  
  In order to support the target side of FC-TAPE, we now pay attention
  to more of the PRLI word 3 parameters which will tell us whether
  an initiator wants confirmed responses. While we're at it, we'll
  pay attention to the initiator view too and report it.
  
  On sending back CTIOs, we will notice whether the initiator wants
  confirmed responses and we'll set up flags to do so.
  
  If a response or data frame is lost the initiator sends us an SRR
  (Sequence Retransmit Request) ELS which shows up as an SRR notify
  and all outstanding CTIOs are nuked with SRR Received status. The
  SRR notify contains the offset that the initiator wants us to restart
  the data transfer from or to retransmit the response frame.
  
  If the ISP driver still has the CCB around for which the data segment
  or response applies, it will retransmit.
  
  However, we typically don't know about a lost data frame until we
  send the FCP Response and the initiator totes up counters for data
  moved and notices missing segments. In this case we've already
  completed the data CCBs already and sent themn back up to the periph
  driver.  Because there's no really clean mechanism yet in CAM to
  handle this, a hack has been put into place to complete the CTIO
  CCB with the CAM_MESSAGE_RECV status which will have a MODIFY DATA
  POINTER extended message in it. The internal ISP target groks this
  and ctl(8) will be modified to deal with this as well.
  
  At any rate, the data is retransmitted and an an FCP response is
  sent. The whole point here is to successfully complete a command
  so that you don't have to depend on ULP (SCSI) to have to recover,
  which in the case of tape is not really possible (hence the name
  FC-TAPE).
  
  Sponsored by: Spectralogic
  MFC after:1 month

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/isp_library.h
  head/sys/dev/isp/isp_pci.c
  head/sys/dev/isp/isp_stds.h
  head/sys/dev/isp/isp_target.c
  head/sys/dev/isp/isp_target.h
  head/sys/dev/isp/ispmbox.h
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Sat Jul 28 16:30:50 2012(r238868)
+++ head/sys/dev/isp/isp.c  Sat Jul 28 20:06:29 2012(r238869)
@@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$");
  */
 #defineMBOX_DELAY_COUNT100 / 100
 #defineISP_MARK_PORTDB(a, b, c)\
-isp_prt(isp, ISP_LOGSANCFG,\
+isp_prt(isp, ISP_LOG_SANCFG,   \
"Chan %d ISP_MARK_PORTDB@LINE %d", b, __LINE__);\
 isp_mark_portdb(a, b, c)
 
@@ -670,8 +670,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d
ISP_DELAY(100);
if (-

svn commit: r238870 - head/sys/cam/ctl

2012-07-28 Thread Matt Jacob
Author: mjacob
Date: Sat Jul 28 20:08:14 2012
New Revision: 238870
URL: http://svn.freebsd.org/changeset/base/238870

Log:
  Handle a case where we had an SRR that pushed back the
  data pointer. This is a temp fix that resubmits the
  command, adjusted, so that the backend can fetch the
  data again.
  
  Sponsored by: Spectralogic
  MFC after:1 month

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Sat Jul 28 20:06:29 2012(r238869)
+++ head/sys/cam/ctl/scsi_ctl.c Sat Jul 28 20:08:14 2012(r238870)
@@ -1081,11 +1081,81 @@ ctlfe_free_ccb(struct cam_periph *periph
}
 }
 
+static int
+ctlfe_adjust_cdb(struct ccb_accept_tio *atio, uint32_t offset)
+{
+   uint64_t lba;
+   uint32_t num_blocks, nbc;
+   uint8_t *cmdbyt = (atio->ccb_h.flags & CAM_CDB_POINTER)?
+   atio->cdb_io.cdb_ptr : atio->cdb_io.cdb_bytes;
+
+   nbc = offset >> 9;  /* ASSUMING 512 BYTE BLOCKS */
+
+   switch (cmdbyt[0]) {
+   case READ_6:
+   case WRITE_6:
+   {
+   struct scsi_rw_6 *cdb = (struct scsi_rw_6 *)cmdbyt;
+   lba = scsi_3btoul(cdb->addr);
+   lba &= 0x1f;
+   num_blocks = cdb->length;
+   if (num_blocks == 0)
+   num_blocks = 256;
+   lba += nbc;
+   num_blocks -= nbc;
+   scsi_ulto3b(lba, cdb->addr);
+   cdb->length = num_blocks;
+   break;
+   }
+   case READ_10:
+   case WRITE_10:
+   {
+   struct scsi_rw_10 *cdb = (struct scsi_rw_10 *)cmdbyt;
+   lba = scsi_4btoul(cdb->addr);
+   num_blocks = scsi_2btoul(cdb->length);
+   lba += nbc;
+   num_blocks -= nbc;
+   scsi_ulto4b(lba, cdb->addr);
+   scsi_ulto2b(num_blocks, cdb->length);
+   break;
+   }
+   case READ_12:
+   case WRITE_12:
+   {
+   struct scsi_rw_12 *cdb = (struct scsi_rw_12 *)cmdbyt;
+   lba = scsi_4btoul(cdb->addr);
+   num_blocks = scsi_4btoul(cdb->length);
+   lba += nbc;
+   num_blocks -= nbc;
+   scsi_ulto4b(lba, cdb->addr);
+   scsi_ulto4b(num_blocks, cdb->length);
+   break;
+   }
+   case READ_16:
+   case WRITE_16:
+   {
+   struct scsi_rw_16 *cdb = (struct scsi_rw_16 *)cmdbyt;
+   lba = scsi_8btou64(cdb->addr);
+   num_blocks = scsi_4btoul(cdb->length);
+   lba += nbc;
+   num_blocks -= nbc;
+   scsi_u64to8b(lba, cdb->addr);
+   scsi_ulto4b(num_blocks, cdb->length);
+   break;
+   }
+   default:
+   return -1;
+   }
+   return (0);
+}
+
 static void
 ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
 {
struct ctlfe_lun_softc *softc;
struct ctlfe_softc *bus_softc;
+   struct ccb_accept_tio *atio = NULL;
+   union ctl_io *io = NULL;
 
 #ifdef CTLFE_DEBUG
printf("%s: entered, func_code = %#x, type = %#lx\n", __func__,
@@ -1123,13 +1193,12 @@ ctlfedone(struct cam_periph *periph, uni
}
switch (done_ccb->ccb_h.func_code) {
case XPT_ACCEPT_TARGET_IO: {
-   union ctl_io *io;
-   struct ccb_accept_tio *atio;
 
atio = &done_ccb->atio;
 
softc->atios_returned++;
 
+ resubmit:
/*
 * Allocate a ctl_io, pass it to CTL, and wait for the
 * datamove or done.
@@ -1213,8 +1282,8 @@ ctlfedone(struct cam_periph *periph, uni
break;
}
case XPT_CONT_TARGET_IO: {
-   struct ccb_accept_tio *atio;
-   union ctl_io *io;
+   int srr = 0;
+   uint32_t srr_off = 0;
 
atio = (struct ccb_accept_tio *)done_ccb->ccb_h.ccb_atio;
io = (union ctl_io *)atio->ccb_h.io_ptr;
@@ -1225,6 +1294,57 @@ ctlfedone(struct cam_periph *periph, uni
   __func__, atio->tag_id, done_ccb->ccb_h.flags);
 #endif
/*
+* Handle SRR case were the data pointer is pushed back hack
+*/
+   if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == 
CAM_MESSAGE_RECV
+   && done_ccb->csio.msg_ptr != NULL
+   && done_ccb->csio.msg_ptr[0] == MSG_EXTENDED
+   && done_ccb->csio.msg_ptr[1] == 5
+   && done_ccb->csio.msg_ptr[2] == 0) {
+   srr = 1;
+   srr_off =
+   (done_ccb->csio.msg_ptr[3] << 24)
+   | (done_ccb->csio.msg_ptr[4] << 16)
+   | (done_ccb->csio.msg_ptr[5] << 8)
+

svn commit: r238871 - head/sys/net

2012-07-28 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Jul 28 20:31:39 2012
New Revision: 238871
URL: http://svn.freebsd.org/changeset/base/238871

Log:
  Hardcode the loopback rx/tx checkum options for IPv6 to on without
  checking. This allows the FreeBSD 9.1 release process to move forward.
  Work around the problem that loopback connections to local addresses
  not on loopback interfaces and not on interfaces w/ IPv6 checksum offloading
  enabled would not work.
  A proper fix to allow us to disable the "checksum offload" on loopback
  for testing, measurements, ... as we allow for IPv4 needs to put in
  place later.
  
  Reported by:  tuexen, Matthew Seaman (m.seaman infracaninophile.co.uk)
  Reported by:  Mike Andrews (mandrews bit0.com), kib, ...
  PR:   kern/170070
  MFC after:1 day
  X-MFC after:  re approval

Modified:
  head/sys/net/if_loop.c

Modified: head/sys/net/if_loop.c
==
--- head/sys/net/if_loop.c  Sat Jul 28 20:08:14 2012(r238870)
+++ head/sys/net/if_loop.c  Sat Jul 28 20:31:39 2012(r238871)
@@ -257,10 +257,20 @@ looutput(struct ifnet *ifp, struct mbuf 
m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES;
break;
case AF_INET6:
+#if 0
+   /*
+* XXX-BZ for now always claim the checksum is good despite
+* any interface flags.   This is a workaround for 9.1-R and
+* a proper solution ought to be sought later.
+*/
if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) {
m->m_pkthdr.csum_data = 0x;
m->m_pkthdr.csum_flags = LO_CSUM_SET;
}
+#else
+   m->m_pkthdr.csum_data = 0x;
+   m->m_pkthdr.csum_flags = LO_CSUM_SET;
+#endif
m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES6;
break;
case AF_IPX:
@@ -446,15 +456,29 @@ loioctl(struct ifnet *ifp, u_long cmd, c
ifp->if_capenable ^= IFCAP_RXCSUM;
if ((mask & IFCAP_TXCSUM) != 0)
ifp->if_capenable ^= IFCAP_TXCSUM;
-   if ((mask & IFCAP_RXCSUM_IPV6) != 0)
+   if ((mask & IFCAP_RXCSUM_IPV6) != 0) {
+#if 0
ifp->if_capenable ^= IFCAP_RXCSUM_IPV6;
-   if ((mask & IFCAP_TXCSUM_IPV6) != 0)
+#else
+   error = EOPNOTSUPP;
+   break;
+#endif
+   }
+   if ((mask & IFCAP_TXCSUM_IPV6) != 0) {
+#if 0
ifp->if_capenable ^= IFCAP_TXCSUM_IPV6;
+#else
+   error = EOPNOTSUPP;
+   break;
+#endif
+   }
ifp->if_hwassist = 0;
if (ifp->if_capenable & IFCAP_TXCSUM)
ifp->if_hwassist = LO_CSUM_FEATURES;
+#if 0
if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
ifp->if_hwassist |= LO_CSUM_FEATURES6;
+#endif
break;
 
default:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238873 - in head/sys: arm/mv arm/mv/kirkwood dev/cesa dev/mge dev/mvs

2012-07-28 Thread Hiroki Sato
Author: hrs
Date: Sat Jul 28 21:56:24 2012
New Revision: 238873
URL: http://svn.freebsd.org/changeset/base/238873

Log:
  Add support for Marvell 88F6282.
  
  Sponsored by: Plat'Home, Co.,Ltd.

Modified:
  head/sys/arm/mv/common.c
  head/sys/arm/mv/gpio.c
  head/sys/arm/mv/ic.c
  head/sys/arm/mv/kirkwood/kirkwood.c
  head/sys/arm/mv/mv_sata.c
  head/sys/arm/mv/mvreg.h
  head/sys/dev/cesa/cesa.c
  head/sys/dev/mge/if_mge.c
  head/sys/dev/mvs/mvs_soc.c

Modified: head/sys/arm/mv/common.c
==
--- head/sys/arm/mv/common.cSat Jul 28 21:43:29 2012(r238872)
+++ head/sys/arm/mv/common.cSat Jul 28 21:56:24 2012(r238873)
@@ -251,7 +251,9 @@ cpu_extra_feat(void)
uint32_t ef = 0;
 
soc_id(&dev, &rev);
-   if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 ||
+   if (dev == MV_DEV_88F6281 ||
+   dev == MV_DEV_88F6282 ||
+   dev == MV_DEV_MV78100_Z0 ||
dev == MV_DEV_MV78100)
__asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef));
else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281)
@@ -351,6 +353,13 @@ soc_identify(void)
else if (r == 3)
rev = "A1";
break;
+   case MV_DEV_88F6282:
+   dev = "Marvell 88F6282";
+   if (r == 0)
+   rev = "A0";
+   else if (r == 1)
+   rev = "A1";
+   break;
case MV_DEV_MV78100_Z0:
dev = "Marvell MV78100 Z0";
break;
@@ -536,6 +545,7 @@ win_cpu_can_remap(int i)
if ((dev == MV_DEV_88F5182 && i < 2) ||
(dev == MV_DEV_88F5281 && i < 4) ||
(dev == MV_DEV_88F6281 && i < 4) ||
+   (dev == MV_DEV_88F6282 && i < 4) ||
(dev == MV_DEV_MV78100 && i < 8) ||
(dev == MV_DEV_MV78100_Z0 && i < 8))
return (1);
@@ -1320,7 +1330,8 @@ xor_max_eng(void)
uint32_t dev, rev;
 
soc_id(&dev, &rev);
-   if (dev == MV_DEV_88F6281)
+   if (dev == MV_DEV_88F6281 ||
+   dev == MV_DEV_88F6282)
return (2);
else if ((dev == MV_DEV_MV78100) || (dev == MV_DEV_MV78100_Z0))
return (1);

Modified: head/sys/arm/mv/gpio.c
==
--- head/sys/arm/mv/gpio.c  Sat Jul 28 21:43:29 2012(r238872)
+++ head/sys/arm/mv/gpio.c  Sat Jul 28 21:56:24 2012(r238873)
@@ -155,7 +155,8 @@ mv_gpio_attach(device_t dev)
sc->pin_num = 32;
sc->irq_num = 4;
 
-   } else if (dev_id == MV_DEV_88F6281) {
+   } else if (dev_id == MV_DEV_88F6281 ||
+   dev_id == MV_DEV_88F6282) {
sc->pin_num = 50;
sc->irq_num = 7;
 

Modified: head/sys/arm/mv/ic.c
==
--- head/sys/arm/mv/ic.cSat Jul 28 21:43:29 2012(r238872)
+++ head/sys/arm/mv/ic.cSat Jul 28 21:56:24 2012(r238873)
@@ -105,7 +105,9 @@ mv_ic_attach(device_t dev)
sc->ic_high_regs = 0;
sc->ic_error_regs = 0;
 
-   if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100 ||
+   if (dev_id == MV_DEV_88F6281 ||
+   dev_id == MV_DEV_88F6282 ||
+   dev_id == MV_DEV_MV78100 ||
dev_id == MV_DEV_MV78100_Z0)
sc->ic_high_regs = 1;
 

Modified: head/sys/arm/mv/kirkwood/kirkwood.c
==
--- head/sys/arm/mv/kirkwood/kirkwood.c Sat Jul 28 21:43:29 2012
(r238872)
+++ head/sys/arm/mv/kirkwood/kirkwood.c Sat Jul 28 21:56:24 2012
(r238873)
@@ -74,6 +74,8 @@ get_tclk(void)
soc_id(&dev, &rev);
if (dev == MV_DEV_88F6281 && (rev == 2 || rev == 3))
return (TCLK_200MHZ);
+   if (dev == MV_DEV_88F6282)
+   return (TCLK_200MHZ);
 
return (TCLK_166MHZ);
 }

Modified: head/sys/arm/mv/mv_sata.c
==
--- head/sys/arm/mv/mv_sata.c   Sat Jul 28 21:43:29 2012(r238872)
+++ head/sys/arm/mv/mv_sata.c   Sat Jul 28 21:56:24 2012(r238873)
@@ -197,6 +197,7 @@ sata_probe(device_t dev)
sc->sc_edma_qlen = 128;
break;
case MV_DEV_88F6281:
+   case MV_DEV_88F6282:
case MV_DEV_MV78100:
case MV_DEV_MV78100_Z0:
sc->sc_version = 2;

Modified: head/sys/arm/mv/mvreg.h
==
--- head/sys/arm/mv/mvreg.h Sat Jul 28 21:43:29 2012(r238872)
+++ head/sys/arm/mv/mvreg.h Sat Jul 28 21:56:24 2012(r238873)
@@ -326,6 +326,7 @@
 #define MV_DEV_88F5182 0x5182
 #define MV_DEV_88F5281 0x5281
 #define MV

svn commit: r238874 - head/sys/dev/mii

2012-07-28 Thread Hiroki Sato
Author: hrs
Date: Sat Jul 28 21:59:12 2012
New Revision: 238874
URL: http://svn.freebsd.org/changeset/base/238874

Log:
  Add support for 88E1116R.
  
  Sponsored by: Plat'Home, Co.,Ltd.

Modified:
  head/sys/dev/mii/e1000phy.c

Modified: head/sys/dev/mii/e1000phy.c
==
--- head/sys/dev/mii/e1000phy.c Sat Jul 28 21:56:24 2012(r238873)
+++ head/sys/dev/mii/e1000phy.c Sat Jul 28 21:59:12 2012(r238874)
@@ -106,6 +106,7 @@ static const struct mii_phydesc e1000phy
MII_PHY_DESC(xxMARVELL, E),
MII_PHY_DESC(xxMARVELL, E1116),
MII_PHY_DESC(xxMARVELL, E1116R),
+   MII_PHY_DESC(xxMARVELL, E1116R_29),
MII_PHY_DESC(xxMARVELL, E1118),
MII_PHY_DESC(xxMARVELL, E1149R),
MII_PHY_DESC(xxMARVELL, E3016),
@@ -208,6 +209,7 @@ e1000phy_reset(struct mii_softc *sc)
case MII_MODEL_xxMARVELL_E:
case MII_MODEL_xxMARVELL_E1112:
case MII_MODEL_xxMARVELL_E1116:
+   case MII_MODEL_xxMARVELL_E1116R_29:
case MII_MODEL_xxMARVELL_E1118:
case MII_MODEL_xxMARVELL_E1149:
case MII_MODEL_xxMARVELL_E1149R:
@@ -215,7 +217,8 @@ e1000phy_reset(struct mii_softc *sc)
/* Disable energy detect mode. */
reg &= ~E1000_SCR_EN_DETECT_MASK;
reg |= E1000_SCR_AUTO_X_MODE;
-   if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116)
+   if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116 ||
+   sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116R_29)
reg &= ~E1000_SCR_POWER_DOWN;
reg |= E1000_SCR_ASSERT_CRS_ON_TX;
break;
@@ -243,6 +246,7 @@ e1000phy_reset(struct mii_softc *sc)
PHY_WRITE(sc, E1000_SCR, reg);
 
if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116 ||
+   sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116R_29 ||
sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149 ||
sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149R) {
PHY_WRITE(sc, E1000_EADR, 2);
@@ -259,6 +263,7 @@ e1000phy_reset(struct mii_softc *sc)
case MII_MODEL_xxMARVELL_E1118:
break;
case MII_MODEL_xxMARVELL_E1116:
+   case MII_MODEL_xxMARVELL_E1116R_29:
page = PHY_READ(sc, E1000_EADR);
/* Select page 3, LED control register. */
PHY_WRITE(sc, E1000_EADR, 3);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r238863 - head/contrib/llvm/tools/clang/lib/Driver

2012-07-28 Thread Dimitry Andric
On 2012-07-28 20:01, Roman Divacky wrote:> It would be great to stay in sync 
with upstream.
> 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?r1=160103&r2=160231

Yeah, I have seen that commit, but it's not entirely correct:
--hash-style=both should only be enabled for certain arches, and also
--enable-new-dtags and that option should only be enabled when not
linking statically.  I have already sent a new patch upstream, to
cfe-comm...@cs.uiuc.edu.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238877 - head/sys/netinet6

2012-07-28 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Jul 29 00:44:41 2012
New Revision: 238877
URL: http://svn.freebsd.org/changeset/base/238877

Log:
  Fix a comment that we do not have an SA yet but need to acquire one.
  
  MFC after:3 days

Modified:
  head/sys/netinet6/ip6_ipsec.c

Modified: head/sys/netinet6/ip6_ipsec.c
==
--- head/sys/netinet6/ip6_ipsec.c   Sat Jul 28 23:11:09 2012
(r238876)
+++ head/sys/netinet6/ip6_ipsec.c   Sun Jul 29 00:44:41 2012
(r238877)
@@ -263,7 +263,7 @@ ip6_ipsec_output(struct mbuf **m, struct
mtag->m_tag_id != 
PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED)
continue;
/*
-* Check if policy has an SA associated with it.
+* Check if policy has no SA associated with it.
 * This can happen when an SP has yet to acquire
 * an SA; e.g. on first reference.  If it occurs,
 * then we let ipsec4_process_packet do its thing.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238878 - head/sys/netinet6

2012-07-28 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Jul 29 00:45:24 2012
New Revision: 238878
URL: http://svn.freebsd.org/changeset/base/238878

Log:
  For consistency put the IPsec comment iside the #fidef section.
  
  MFC after:3 days

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Sun Jul 29 00:44:41 2012
(r238877)
+++ head/sys/netinet6/ip6_output.c  Sun Jul 29 00:45:24 2012
(r238878)
@@ -294,11 +294,11 @@ ip6_output(struct mbuf *m0, struct ip6_p
MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2);
}
 
+#ifdef IPSEC
/*
 * IPSec checking which handles several cases.
 * FAST IPSEC: We re-injected the packet.
 */
-#ifdef IPSEC
switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp))
{
case 1: /* Bad packet */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238879 - head/games/fortune/datfiles

2012-07-28 Thread Doug Barton
Author: dougb
Date: Sun Jul 29 01:01:35 2012
New Revision: 238879
URL: http://svn.freebsd.org/changeset/base/238879

Log:
  Add a couple of nice quotes from Edward Everett Hale

Modified:
  head/games/fortune/datfiles/fortunes

Modified: head/games/fortune/datfiles/fortunes
==
--- head/games/fortune/datfiles/fortunesSun Jul 29 00:45:24 2012
(r238878)
+++ head/games/fortune/datfiles/fortunesSun Jul 29 01:01:35 2012
(r238879)
@@ -22100,6 +22100,11 @@ planet. Tuna, chicken, sparrow-brains, e
 world that they like, but catnip is crack from home.
-- Bill Cole
 %
+I am only one, but I am one.  I cannot do everything, but I can do
+something.  And I will not let what I cannot do interfere with what
+I can do.
+   -- Edward Everett Hale, (1822 - 1909)
+%
 I am professionally trained in computer science, which is to say
 (in all seriousness) that I am extremely poorly educated.
-- Joseph Weizenbaum, "Computer Power and Human Reason"
@@ -31413,6 +31418,10 @@ Look ere ye leap.
 %
 Look out!  Behind you!
 %
+Look up and not down, look forward and not back, look out and not in,
+and lend a hand.
+   -- Edward Everett Hale, "Lowell Institute Lectures" (1869)
+%
 Look, we play the Star Spangled Banner before every game.  You want us
 to pay income taxes, too?
-- Bill Veeck, Chicago White Sox
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r238824 - head/sys/dev/ath

2012-07-28 Thread Adrian Chadd
Hi,

This broke -HEAD. Let me go and figure out what I need to do to fix
the descriptor offset math.

It only showed up under heavy iperf testing. Ping wasn't enough to
trigger the crash. :(



Adrian


On 26 July 2012 22:48, Adrian Chadd  wrote:
> Author: adrian
> Date: Fri Jul 27 05:48:42 2012
> New Revision: 238824
> URL: http://svn.freebsd.org/changeset/base/238824
>
> Log:
>   Migrate the descriptor allocation function to not care about the number
>   of buffers, only the number of descriptors.
>
>   This involves:
>
>   * Change the allocation function to not use nbuf at all;
>   * When calling it, pass in "nbuf * ndesc" to correctly update how many
> descriptors are being allocated.
>
>   Whilst here, fix the descriptor allocation code to correctly allocate
>   a larger buffer size if the Merlin 4KB WAR is required.  It overallocates
>   descriptors when allocating a block that doesn't ever have a 4KB boundary
>   being crossed, but that can be fixed at a later stage.
>
> Modified:
>   head/sys/dev/ath/if_ath.c
>   head/sys/dev/ath/if_ath_misc.h
>
> Modified: head/sys/dev/ath/if_ath.c
> ==
> --- head/sys/dev/ath/if_ath.c   Fri Jul 27 05:37:01 2012(r238823)
> +++ head/sys/dev/ath/if_ath.c   Fri Jul 27 05:48:42 2012(r238824)
> @@ -2773,7 +2773,7 @@ ath_load_cb(void *arg, bus_dma_segment_t
>  int
>  ath_descdma_alloc_desc(struct ath_softc *sc,
> struct ath_descdma *dd, ath_bufhead *head,
> -   const char *name, int ds_size, int nbuf, int ndesc)
> +   const char *name, int ds_size, int ndesc)
>  {
>  #defineDS2PHYS(_dd, _ds) \
> ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc))
> @@ -2785,11 +2785,11 @@ ath_descdma_alloc_desc(struct ath_softc
> dd->dd_descsize = ds_size;
>
> DPRINTF(sc, ATH_DEBUG_RESET,
> -   "%s: %s DMA: %u buffers %u desc/buf, %d bytes per descriptor\n",
> -   __func__, name, nbuf, ndesc, dd->dd_descsize);
> +   "%s: %s DMA: %u desc, %d bytes per descriptor\n",
> +   __func__, name, ndesc, dd->dd_descsize);
>
> dd->dd_name = name;
> -   dd->dd_desc_len = dd->dd_descsize * nbuf * ndesc;
> +   dd->dd_desc_len = dd->dd_descsize * ndesc;
>
> /*
>  * Merlin work-around:
> @@ -2797,8 +2797,8 @@ ath_descdma_alloc_desc(struct ath_softc
>  * Assume one skipped descriptor per 4KB page.
>  */
> if (! ath_hal_split4ktrans(sc->sc_ah)) {
> -   int numdescpage = 4096 / (dd->dd_descsize * ndesc);
> -   dd->dd_desc_len = (nbuf / numdescpage + 1) * 4096;
> +   int numpages = dd->dd_desc_len / 4096;
> +   dd->dd_desc_len += ds_size * numpages;
> }
>
> /*
> @@ -2834,7 +2834,7 @@ ath_descdma_alloc_desc(struct ath_softc
>  &dd->dd_dmamap);
> if (error != 0) {
> if_printf(ifp, "unable to alloc memory for %u %s descriptors, 
> "
> -   "error %u\n", nbuf * ndesc, dd->dd_name, error);
> +   "error %u\n", ndesc, dd->dd_name, error);
> goto fail1;
> }
>
> @@ -2883,7 +2883,7 @@ ath_descdma_setup(struct ath_softc *sc,
>
> /* Allocate descriptors */
> error = ath_descdma_alloc_desc(sc, dd, head, name, ds_size,
> -   nbuf, ndesc);
> +   nbuf * ndesc);
>
> /* Assume any errors during allocation were dealt with */
> if (error != 0) {
>
> Modified: head/sys/dev/ath/if_ath_misc.h
> ==
> --- head/sys/dev/ath/if_ath_misc.h  Fri Jul 27 05:37:01 2012
> (r238823)
> +++ head/sys/dev/ath/if_ath_misc.h  Fri Jul 27 05:48:42 2012
> (r238824)
> @@ -86,7 +86,7 @@ extern void ath_setslottime(struct ath_s
>
>  extern int ath_descdma_alloc_desc(struct ath_softc *sc,
> struct ath_descdma *dd, ath_bufhead *head, const char *name,
> -   int ds_size, int nbuf, int ndesc);
> +   int ds_size, int ndesc);
>  extern int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
> ath_bufhead *head, const char *name, int ds_size, int nbuf,
> int ndesc);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238880 - head/sys/arm/conf

2012-07-28 Thread Warner Losh
Author: imp
Date: Sun Jul 29 04:26:24 2012
New Revision: 238880
URL: http://svn.freebsd.org/changeset/base/238880

Log:
  Add usb_template for the gadget support.  Even though this isn't a
  bootable kernel, its config will likely be copied to places that are.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/arm/conf/ATMEL

Modified: head/sys/arm/conf/ATMEL
==
--- head/sys/arm/conf/ATMEL Sun Jul 29 01:01:35 2012(r238879)
+++ head/sys/arm/conf/ATMEL Sun Jul 29 04:26:24 2012(r238880)
@@ -165,6 +165,7 @@ device  umass   # Disks/Mass storage - 
Re
 device at91_dci# Atmel's usb device
 device usfs# emulate a flash
 device cdce# emulate an ethernet
+device usb_template# Control of the gadget
 
 # watchdog
 device at91_wdt# Atmel AT91 Watchdog Timer
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238881 - head/sys/arm/conf

2012-07-28 Thread Warner Losh
Author: imp
Date: Sun Jul 29 04:28:29 2012
New Revision: 238881
URL: http://svn.freebsd.org/changeset/base/238881

Log:
  Commit the dci (gadget) support to the one ATMEL kernel config where
  it might actually work.

Modified:
  head/sys/arm/conf/KB920X

Modified: head/sys/arm/conf/KB920X
==
--- head/sys/arm/conf/KB920XSun Jul 29 04:26:24 2012(r238880)
+++ head/sys/arm/conf/KB920XSun Jul 29 04:28:29 2012(r238881)
@@ -138,6 +138,12 @@ device wlan_ccmp   # 802.11 CCMP support
 device wlan_tkip   # 802.11 TKIP support
 device wlan_amrr   # AMRR transmit rate control algorithm
 
+# USB device (gadget) support
+device at91_dci# Atmel's usb device
+device usfs# emulate a flash
+device cdce# emulate an ethernet
+device usb_template# Control of the gadget
+
 optionsIEEE80211_SUPPORT_MESH
 
 optionsAH_SUPPORT_AR5416
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238882 - head/contrib/libarchive/libarchive

2012-07-28 Thread Martin Matuska
Author: mm
Date: Sun Jul 29 06:33:27 2012
New Revision: 238882
URL: http://svn.freebsd.org/changeset/base/238882

Log:
  Fix endless loop if reading unsupported ACL type.
  Apply fix from vendor's master branch.
  
  References:
  https://github.com/libarchive/libarchive/commit/d8b9dbd
  
  Reported on:  freebsd-current@
  Obtained from:libarchive

Modified:
  head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c

Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
==
--- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Sun Jul 29 04:28:29 2012(r238881)
+++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Sun Jul 29 06:33:27 2012(r238882)
@@ -485,6 +485,7 @@ setup_acl_posix1e(struct archive_read_di
ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
} else {
/* Skip types that libarchive can't support. */
+   s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
continue;
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r238883 - head/lib/libarchive

2012-07-28 Thread Martin Matuska
Author: mm
Date: Sun Jul 29 06:34:45 2012
New Revision: 238883
URL: http://svn.freebsd.org/changeset/base/238883

Log:
  Catch up config_freebsd.h with libarchive 3.0.4

Modified:
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/config_freebsd.h
==
--- head/lib/libarchive/config_freebsd.hSun Jul 29 06:33:27 2012
(r238882)
+++ head/lib/libarchive/config_freebsd.hSun Jul 29 06:34:45 2012
(r238883)
@@ -129,7 +129,6 @@
 #define HAVE_LSTAT 1
 #define HAVE_LUTIMES 1
 #define HAVE_MBRTOWC 1
-#define HAVE_MBSNRTOWCS 1
 #define HAVE_MEMMOVE 1
 #define HAVE_MEMORY_H 1
 #define HAVE_MEMSET 1
@@ -206,7 +205,6 @@
 #define HAVE_WCSCMP 1
 #define HAVE_WCSCPY 1
 #define HAVE_WCSLEN 1
-#define HAVE_WCSNRTOMBS 1
 #define HAVE_WCTOMB 1
 #define HAVE_WCTYPE_H 1
 #define HAVE_WMEMCMP 1
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"