svn commit: r204195 - in head: sbin/atacontrol sbin/camcontrol sys/cam sys/dev/ata

2010-02-22 Thread Alexander Motin
Author: mav
Date: Mon Feb 22 10:45:40 2010
New Revision: 204195
URL: http://svn.freebsd.org/changeset/base/204195

Log:
  Improve output for controllers that doesn't report SATA speed.

Modified:
  head/sbin/atacontrol/atacontrol.c
  head/sbin/camcontrol/camcontrol.c
  head/sys/cam/cam_xpt.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/ata/ata-sata.c

Modified: head/sbin/atacontrol/atacontrol.c
==
--- head/sbin/atacontrol/atacontrol.c   Mon Feb 22 07:50:17 2010
(r204194)
+++ head/sbin/atacontrol/atacontrol.c   Mon Feb 22 10:45:40 2010
(r204195)
@@ -72,6 +72,7 @@ satarev2str(int mode)
case 1: return "SATA 1.5Gb/s";
case 2: return "SATA 3Gb/s";
case 3: return "SATA 6Gb/s";
+   case 0xff: return "SATA";
default: return "???";
}
 }

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Mon Feb 22 07:50:17 2010
(r204194)
+++ head/sbin/camcontrol/camcontrol.c   Mon Feb 22 10:45:40 2010
(r204195)
@@ -1022,6 +1022,8 @@ camxferrate(struct cam_device *device)
printf(" (");
if (sata->valid & CTS_SATA_VALID_REVISION)
printf("SATA %d.x, ", sata->revision);
+   else
+   printf("SATA, ");
if (sata->valid & CTS_SATA_VALID_MODE)
printf("%s, ", ata_mode2string(sata->mode));
if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0)

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Mon Feb 22 07:50:17 2010(r204194)
+++ head/sys/cam/cam_xpt.c  Mon Feb 22 10:45:40 2010(r204195)
@@ -1219,6 +1219,8 @@ xpt_announce_periph(struct cam_periph *p
printf(" (");
if (sata->valid & CTS_SATA_VALID_REVISION)
printf("SATA %d.x, ", sata->revision);
+   else
+   printf("SATA, ");
if (sata->valid & CTS_SATA_VALID_MODE)
printf("%s, ", ata_mode2string(sata->mode));
if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0)

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Mon Feb 22 07:50:17 2010(r204194)
+++ head/sys/dev/ata/ata-all.c  Mon Feb 22 10:45:40 2010(r204195)
@@ -1160,6 +1160,7 @@ ata_satarev2str(int rev)
case 1: return "SATA 1.5Gb/s";
case 2: return "SATA 3Gb/s";
case 3: return "SATA 6Gb/s";
+   case 0xff: return "SATA";
default: return "???";
}
 }
@@ -1536,6 +1537,7 @@ ataaction(struct cam_sim *sim, union ccb
if (ch->flags & ATA_SATA) {
cts->transport = XPORT_SATA;
cts->transport_version = XPORT_VERSION_UNSPECIFIED;
+   cts->xport_specific.sata.valid = 0;
cts->xport_specific.sata.mode = d->mode;
cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE;
cts->xport_specific.sata.bytecount = d->bytecount;
@@ -1543,14 +1545,20 @@ ataaction(struct cam_sim *sim, union ccb
if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
cts->xport_specific.sata.revision =
ATA_GETREV(dev, ccb->ccb_h.target_id);
-   } else
+   if (cts->xport_specific.sata.revision != 0xff) {
+   cts->xport_specific.sata.valid |=
+   CTS_SATA_VALID_REVISION;
+   }
+   } else {
cts->xport_specific.sata.revision = d->revision;
-   cts->xport_specific.sata.valid |= 
CTS_SATA_VALID_REVISION;
+   cts->xport_specific.sata.valid |= 
CTS_SATA_VALID_REVISION;
+   }
cts->xport_specific.sata.atapi = d->atapi;
cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI;
} else {
cts->transport = XPORT_ATA;
cts->transport_version = XPORT_VERSION_UNSPECIFIED;
+   cts->xport_specific.ata.valid = 0;
cts->xport_specific.ata.mode = d->mode;
cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE;
cts->xport_specific.ata.bytecount = d->bytecount;

Modified: head/sys/dev/ata/ata-pci.c

Re: svn commit: r204178 - head/games/fortune/fortune

2010-02-22 Thread Robert Watson


On Sun, 21 Feb 2010, Ulrich Spoerlein wrote:


 Prefer exit(0) from main over return(0).

 Although not explicitly mentioned in style(9), it allows for easier
 grepping of exit points. This reverts part of r203926.


A few people (including me) have tripped up over exit handling and style in 
the past.  It might be nice to formulate some specific sentences about program 
exit paths, functions, and also return values, to put in the style guide.


For example, we have sysexits(3), but my understanding is we prefer not to use 
it.  Likewise, we do like to use err()/warn() in preference to perror() and 
exit(), etc.


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: r204178 - head/games/fortune/fortune

2010-02-22 Thread Bjoern A. Zeeb

On Mon, 22 Feb 2010, Robert Watson wrote:

Hi,



On Sun, 21 Feb 2010, Ulrich Spoerlein wrote:


 Prefer exit(0) from main over return(0).

 Although not explicitly mentioned in style(9), it allows for easier
 grepping of exit points. This reverts part of r203926.


A few people (including me) have tripped up over exit handling and style in 
the past.  It might be nice to formulate some specific sentences about 
program exit paths, functions, and also return values, to put in the style 
guide.


For example, we have sysexits(3), but my understanding is we prefer not to 
use it.  Likewise, we do like to use err()/warn() in preference to perror() 
and exit(), etc.


I know better but still join this thread; the color shall be red
and light blue on white or a light blue on white depending on whether
you believe in the new or the old testament.

While the old testament seems to talk about exit() in 7.7 Error
Handling - Stderr and Exit but treated main() voidish apart from that
mostly, the new testament is a bit more precise in 7.6. with the same
name:

>>Withing main, return expr is equivalent to exit(expr). exit
has the advantage that it can be called from other functions,
and that calls to it can be found with a pattern-searching
program like those in Chapter 5.<<

It still seems to be quite common to use return rather than exit in
main(), and while style.9 may, in the future, possibly suggest that
exit() is the prefered token, we should not start changing all and
everything to exit() and still accept return() without major
bikesheds.

The thing I tripped over in the past were negative s,return,exit, (or
err(3)) values which are not really good(tm).


I agree with Robert that we should try to decide what, of all the
(unused or prefered by some people) possibilities we support, we
would prefer but may not forget portability.

/bz

--
Bjoern A. Zeeb It will not break if you know what you are doing.
PS:Whenever you commit to fortune, you will likely start a bikeshed.
___
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: r204197 - head/sys/powerpc/aim

2010-02-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb 22 14:17:23 2010
New Revision: 204197
URL: http://svn.freebsd.org/changeset/base/204197

Log:
  Allow user programs to execute mfpvr instructions. Linux allows this, and
  some math-related software like GMP expects to be able to use it to pick
  a target appropriately.
  
  MFC after:1 week

Modified:
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/trap.c
==
--- head/sys/powerpc/aim/trap.c Mon Feb 22 14:12:23 2010(r204196)
+++ head/sys/powerpc/aim/trap.c Mon Feb 22 14:17:23 2010(r204197)
@@ -82,6 +82,7 @@ static void   printtrap(u_int vector, stru
int user);
 static int trap_pfault(struct trapframe *frame, int user);
 static int fix_unaligned(struct thread *td, struct trapframe *frame);
+static int ppc_instr_emulate(struct trapframe *frame);
 static int handle_onfault(struct trapframe *frame);
 static voidsyscall(struct trapframe *frame);
 
@@ -209,7 +210,9 @@ trap(struct trapframe *frame)
/* Identify the trap reason */
if (frame->srr1 & EXC_PGM_TRAP)
sig = SIGTRAP;
-   else
+   else if (ppc_instr_emulate(frame) == 0)
+   frame->srr0 += 4;
+   else
sig = SIGILL;
break;
 
@@ -615,3 +618,21 @@ fix_unaligned(struct thread *td, struct 
 
return -1;
 }
+
+static int
+ppc_instr_emulate(struct trapframe *frame)
+{
+   uint32_t instr;
+   int reg;
+
+   instr = fuword32((void *)frame->srr0);
+
+   if ((instr & 0xfc1f) == 0x7c1f42a6) {   /* mfpvr */
+   reg = (instr & ~0xfc1f) >> 21;
+   frame->fixreg[reg] = mfpvr();
+   return (0);
+   }
+
+   return (-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"


svn commit: r204198 - head/sys/arm/xscale/ixp425

2010-02-22 Thread Rui Paulo
Author: rpaulo
Date: Mon Feb 22 14:49:52 2010
New Revision: 204198
URL: http://svn.freebsd.org/changeset/base/204198

Log:
  Fix previous commit: led_func() doesn't exist, it should be fled_cb().
  
  Pointed out by:   bz

Modified:
  head/sys/arm/xscale/ixp425/cambria_fled.c

Modified: head/sys/arm/xscale/ixp425/cambria_fled.c
==
--- head/sys/arm/xscale/ixp425/cambria_fled.c   Mon Feb 22 14:17:23 2010
(r204197)
+++ head/sys/arm/xscale/ixp425/cambria_fled.c   Mon Feb 22 14:49:52 2010
(r204198)
@@ -74,7 +74,7 @@ fled_attach(device_t dev)
 
sc->sc_led = led_create(fled_cb, dev, "front");
 
-   led_func(sc, 1);/* Turn on LED */
+   fled_cb(sc, 1); /* Turn on LED */
 
return 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"


Re: svn commit: r204178 - head/games/fortune/fortune

2010-02-22 Thread Dag-Erling Smørgrav
"Bjoern A. Zeeb"  writes:
> It still seems to be quite common to use return rather than exit in
> main(), and while style.9 may, in the future, possibly suggest that
> exit() is the prefered token, we should not start changing all and
> everything to exit() and still accept return() without major
> bikesheds.

Nobody's talking about changing return to exit() across the board - just
about documenting existing practice and encouraging it in new code.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r204199 - head/sys/net

2010-02-22 Thread Robert Watson
Author: rwatson
Date: Mon Feb 22 15:03:16 2010
New Revision: 204199
URL: http://svn.freebsd.org/changeset/base/204199

Log:
  Export netisr configuration and statistics to userspace via sysctl(9).
  
  MFC after:1 week
  Sponsored by: Juniper Networks

Modified:
  head/sys/net/netisr.c
  head/sys/net/netisr.h

Modified: head/sys/net/netisr.c
==
--- head/sys/net/netisr.c   Mon Feb 22 14:49:52 2010(r204198)
+++ head/sys/net/netisr.c   Mon Feb 22 15:03:16 2010(r204199)
@@ -1,7 +1,11 @@
 /*-
  * Copyright (c) 2007-2009 Robert N. M. Watson
+ * Copyright (c) 2010 Juniper Networks, Inc.
  * All rights reserved.
  *
+ * This software was developed by Robert N. M. Watson under contract
+ * to Juniper Networks, Inc.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -1126,6 +1130,170 @@ netisr_start(void *arg)
 }
 SYSINIT(netisr_start, SI_SUB_SMP, SI_ORDER_MIDDLE, netisr_start, NULL);
 
+/*
+ * Sysctl monitoring for netisr: query a list of registered protocols.
+ */
+static int
+sysctl_netisr_proto(SYSCTL_HANDLER_ARGS)
+{
+   struct rm_priotracker tracker;
+   struct sysctl_netisr_proto *snpp, *snp_array;
+   struct netisr_proto *npp;
+   u_int counter, proto;
+   int error;
+
+   if (req->newptr != NULL)
+   return (EINVAL);
+   snp_array = malloc(sizeof(*snp_array) * NETISR_MAXPROT, M_TEMP,
+   M_ZERO | M_WAITOK);
+   counter = 0;
+   NETISR_RLOCK(&tracker);
+   for (proto = 0; proto < NETISR_MAXPROT; proto++) {
+   npp = &np[proto];
+   if (npp->np_name == NULL)
+   continue;
+   snpp = &snp_array[counter];
+   snpp->snp_version = sizeof(*snpp);
+   strlcpy(snpp->snp_name, npp->np_name, NETISR_NAMEMAXLEN);
+   snpp->snp_proto = proto;
+   snpp->snp_qlimit = npp->np_qlimit;
+   snpp->snp_policy = npp->np_policy;
+   if (npp->np_m2flow != NULL)
+   snpp->snp_flags |= NETISR_SNP_FLAGS_M2FLOW;
+   if (npp->np_m2cpuid != NULL)
+   snpp->snp_flags |= NETISR_SNP_FLAGS_M2CPUID;
+   if (npp->np_drainedcpu != NULL)
+   snpp->snp_flags |= NETISR_SNP_FLAGS_DRAINEDCPU;
+   counter++;
+   }
+   NETISR_RUNLOCK(&tracker);
+   KASSERT(counter < NETISR_MAXPROT,
+   ("sysctl_netisr_proto: counter too big (%d)", counter));
+   error = SYSCTL_OUT(req, snp_array, sizeof(*snp_array) * counter);
+   free(snp_array, M_TEMP);
+   return (error);
+}
+
+SYSCTL_PROC(_net_isr, OID_AUTO, proto,
+CTLFLAG_RD|CTLTYPE_STRUCT|CTLFLAG_MPSAFE, 0, 0, sysctl_netisr_proto,
+"S,sysctl_netisr_proto",
+"Return list of protocols registered with netisr");
+
+/*
+ * Sysctl monitoring for netisr: query a list of workstreams.
+ */
+static int
+sysctl_netisr_workstream(SYSCTL_HANDLER_ARGS)
+{
+   struct rm_priotracker tracker;
+   struct sysctl_netisr_workstream *snwsp, *snws_array;
+   struct netisr_workstream *nwsp;
+   u_int counter, cpuid;
+   int error;
+
+   if (req->newptr != NULL)
+   return (EINVAL);
+   snws_array = malloc(sizeof(*snws_array) * MAXCPU, M_TEMP,
+   M_ZERO | M_WAITOK);
+   counter = 0;
+   NETISR_RLOCK(&tracker);
+   for (cpuid = 0; cpuid < MAXCPU; cpuid++) {
+   if (CPU_ABSENT(cpuid))
+   continue;
+   nwsp = DPCPU_ID_PTR(cpuid, nws);
+   if (nwsp->nws_intr_event == NULL)
+   continue;
+   NWS_LOCK(nwsp);
+   snwsp = &snws_array[counter];
+   snwsp->snws_version = sizeof(*snwsp);
+
+   /*
+* For now, we equate workstream IDs and CPU IDs in the
+* kernel, but expose them independently to userspace in case
+* that assumption changes in the future.
+*/
+   snwsp->snws_wsid = cpuid;
+   snwsp->snws_cpu = cpuid;
+   if (nwsp->nws_intr_event != NULL)
+   snwsp->snws_flags |= NETISR_SNWS_FLAGS_INTR;
+   NWS_UNLOCK(nwsp);
+   counter++;
+   }
+   NETISR_RUNLOCK(&tracker);
+   KASSERT(counter < MAXCPU,
+   ("sysctl_netisr_workstream: counter too big (%d)", counter));
+   error = SYSCTL_OUT(req, snws_array, sizeof(*snws_array) * counter);
+   free(snws_array, M_TEMP);
+   return (error);
+}
+
+SYSCTL_PROC(_net_isr, OID_AUTO, workstream,
+CTLFLAG_RD|CTLTYPE_STRUCT|CTLFLAG_MPSAFE, 0, 0, sysctl_netisr_workstream,
+"S,sysctl_netisr_workstream",
+"Return list of workstreams implemented by netisr");
+
+/*
+ * Sysctl monitoring for netisr: query per-protoc

svn commit: r204202 - head/usr.bin/netstat

2010-02-22 Thread Robert Watson
Author: rwatson
Date: Mon Feb 22 15:57:36 2010
New Revision: 204202
URL: http://svn.freebsd.org/changeset/base/204202

Log:
  Teach netstat(1) to print out netisr statistics when given the -Q argument.
  Currently supports only reporting on live systems via sysctl, kmem support
  needs to be edded.
  
  MFC after:1 week
  Sponsored by: Juniper Networks

Added:
  head/usr.bin/netstat/netisr.c   (contents, props changed)
Modified:
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.1
  head/usr.bin/netstat/netstat.h

Modified: head/usr.bin/netstat/Makefile
==
--- head/usr.bin/netstat/Makefile   Mon Feb 22 15:49:16 2010
(r204201)
+++ head/usr.bin/netstat/Makefile   Mon Feb 22 15:57:36 2010
(r204202)
@@ -4,7 +4,7 @@
 .include 
 
 PROG=  netstat
-SRCS=  if.c inet.c main.c mbuf.c mroute.c route.c \
+SRCS=  if.c inet.c main.c mbuf.c mroute.c netisr.c route.c \
unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c
 
 WARNS?=3

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Mon Feb 22 15:49:16 2010(r204201)
+++ head/usr.bin/netstat/main.c Mon Feb 22 15:57:36 2010(r204202)
@@ -338,6 +338,7 @@ int noutputs = 0;   /* how much outputs be
 intnumeric_addr;   /* show addresses numerically */
 intnumeric_port;   /* show ports numerically */
 static int pflag;  /* show given protocol */
+intQflag;  /* show netisr information */
 intrflag;  /* show routing tables (or routing stats) */
 intsflag;  /* show protocol statistics */
 intWflag;  /* wide display */
@@ -360,7 +361,8 @@ main(int argc, char *argv[])
 
af = AF_UNSPEC;
 
-   while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSsuWw:xz")) 
!= -1)
+   while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSsuWw:xz"))
+   != -1)
switch(ch) {
case 'A':
Aflag = 1;
@@ -446,6 +448,9 @@ main(int argc, char *argv[])
}
pflag = 1;
break;
+   case 'Q':
+   Qflag = 1;
+   break;
case 'q':
noutputs = atoi(optarg);
if (noutputs != 0)
@@ -524,6 +529,12 @@ main(int argc, char *argv[])
mbpr(NULL, 0);
exit(0);
}
+   if (Qflag) {
+   if (!live)
+   usage();
+   netisr_stats();
+   exit(0);
+   }
 #if 0
/*
 * Keep file descriptors open to avoid overhead
@@ -780,7 +791,7 @@ name2protox(const char *name)
 static void
 usage(void)
 {
-   (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
+   (void)fprintf(stderr, 
"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
 "usage: netstat [-AaLnSWx] [-f protocol_family | -p protocol]\n"
 "   [-M core] [-N system]",
 "   netstat -i | -I interface [-abdhnW] [-f address_family]\n"
@@ -795,6 +806,7 @@ usage(void)
 "   netstat -r [-AanW] [-f address_family] [-M core] [-N system]",
 "   netstat -rs [-s] [-M core] [-N system]",
 "   netstat -g [-W] [-f address_family] [-M core] [-N system]",
-"   netstat -gs [-s] [-f address_family] [-M core] [-N system]");
+"   netstat -gs [-s] [-f address_family] [-M core] [-N system]",
+"   netstat -Q");
exit(1);
 }

Added: head/usr.bin/netstat/netisr.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/netstat/netisr.c   Mon Feb 22 15:57:36 2010
(r204202)
@@ -0,0 +1,268 @@
+/*-
+ * Copyright (c) 2010 Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * This software was developed by Robert N. M. Watson under contract
+ * to Juniper Networks, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT,

svn commit: r204205 - head/sys/vm

2010-02-22 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 22 16:00:56 2010
New Revision: 204205
URL: http://svn.freebsd.org/changeset/base/204205

Log:
  Remove write-only variable.
  
  MFC after:3 days

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Mon Feb 22 16:00:55 2010(r204204)
+++ head/sys/vm/vnode_pager.c   Mon Feb 22 16:00:56 2010(r204205)
@@ -1016,7 +1016,6 @@ vnode_pager_putpages(object, m, count, s
 {
int rtval;
struct vnode *vp;
-   struct mount *mp;
int bytes = count * PAGE_SIZE;
 
/*
@@ -1039,8 +1038,6 @@ vnode_pager_putpages(object, m, count, s
 */
vp = object->handle;
VM_OBJECT_UNLOCK(object);
-   if (vp->v_type != VREG)
-   mp = NULL;
rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals, 0);
KASSERT(rtval != EOPNOTSUPP, 
("vnode_pager: stale FS putpages\n"));
___
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: r204206 - head/share/man/man9

2010-02-22 Thread Robert Watson
Author: rwatson
Date: Mon Feb 22 16:02:17 2010
New Revision: 204206
URL: http://svn.freebsd.org/changeset/base/204206

Log:
  Cross-reference netstat(1) from netisr(9) since you can now use it to
  monitor netisr status.
  
  MFC after:1 week
  Sponsored by: Juniper Networks

Modified:
  head/share/man/man9/netisr.9

Modified: head/share/man/man9/netisr.9
==
--- head/share/man/man9/netisr.9Mon Feb 22 16:00:56 2010
(r204205)
+++ head/share/man/man9/netisr.9Mon Feb 22 16:02:17 2010
(r204206)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 26, 2009
+.Dd February 22, 2010
 .Dt NETISR 9
 .Os
 .Sh NAME
@@ -66,6 +66,8 @@ The
 .Nm
 kernel interface suite allows device drivers (and other packet sources) to
 direct packets to protocols for directly dispatched or deferred processing.
+Protocol registration and work stream statistics may be monitored using
+.Xr netstat 1 .
 .Ss Protocol registration
 Protocols register and unregister handlers using
 .Fn netisr_register
@@ -209,6 +211,7 @@ IPv6
 .It Dv NETISR_NATM
 ATM
 .It Dv NETISR_EPAIR
+.Xr netstat 1 ,
 .Xr epair 4
 .El
 .Sh AUTHORS
___
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: r204207 - head/usr.bin/netstat

2010-02-22 Thread Robert Watson
Author: rwatson
Date: Mon Feb 22 16:05:45 2010
New Revision: 204207
URL: http://svn.freebsd.org/changeset/base/204207

Log:
  Update date on netstat(1) for -Q.
  
  Suggested by: bz
  MFC after:1 week

Modified:
  head/usr.bin/netstat/netstat.1

Modified: head/usr.bin/netstat/netstat.1
==
--- head/usr.bin/netstat/netstat.1  Mon Feb 22 16:02:17 2010
(r204206)
+++ head/usr.bin/netstat/netstat.1  Mon Feb 22 16:05:45 2010
(r204207)
@@ -32,7 +32,7 @@
 .\"@(#)netstat.1   8.8 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd January 10, 2010
+.Dd February 22, 2010
 .Dt NETSTAT 1
 .Os
 .Sh NAME
___
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: r204208 - head/sys/net

2010-02-22 Thread Robert Watson
Author: rwatson
Date: Mon Feb 22 16:16:16 2010
New Revision: 204208
URL: http://svn.freebsd.org/changeset/base/204208

Log:
  Fix constant assignment for netisr protocol information sysctl.
  
  MFC after:1 week
  Spotted by:   bz

Modified:
  head/sys/net/netisr.h

Modified: head/sys/net/netisr.h
==
--- head/sys/net/netisr.h   Mon Feb 22 16:05:45 2010(r204207)
+++ head/sys/net/netisr.h   Mon Feb 22 16:16:16 2010(r204208)
@@ -92,7 +92,7 @@ struct sysctl_netisr_proto {
  */
 #defineNETISR_SNP_FLAGS_M2FLOW 0x0001  /* nh_m2flow */
 #defineNETISR_SNP_FLAGS_M2CPUID0x0002  /* nh_m2cpuid */
-#defineNETISR_SNP_FLAGS_DRAINEDCPU 0x0003  /* 
nh_drainedcpu */
+#defineNETISR_SNP_FLAGS_DRAINEDCPU 0x0004  /* 
nh_drainedcpu */
 
 /*
  * Next, a structure per-workstream, with per-protocol data, exported as
___
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: r204210 - head/sys/dev/ata/chipsets

2010-02-22 Thread Alexander Motin
Author: mav
Date: Mon Feb 22 16:27:47 2010
New Revision: 204210
URL: http://svn.freebsd.org/changeset/base/204210

Log:
  Add Intel PCH SATA controller IDs.

Modified:
  head/sys/dev/ata/chipsets/ata-intel.c

Modified: head/sys/dev/ata/chipsets/ata-intel.c
==
--- head/sys/dev/ata/chipsets/ata-intel.c   Mon Feb 22 16:17:37 2010
(r204209)
+++ head/sys/dev/ata/chipsets/ata-intel.c   Mon Feb 22 16:27:47 2010
(r204210)
@@ -140,6 +140,22 @@ ata_intel_probe(device_t dev)
  { ATA_I82801JI_AH,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
  { ATA_I82801JI_R1,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
  { ATA_I82801JI_S2,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
+ { 0x80863a20,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a21,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a22,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a23,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a24,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a25,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a26,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a27,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a28,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a29,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a2a,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a2b,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a2c,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a2d,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a2e,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x80863a2f,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
  { ATA_I31244,   0,  0, 2, ATA_SA150, "31244" },
  { ATA_ISCH, 0,  0, 1, ATA_UDMA5, "SCH" },
  { 0, 0, 0, 0, 0, 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: r204211 - head/libexec/rtld-elf/powerpc

2010-02-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb 22 16:49:45 2010
New Revision: 204211
URL: http://svn.freebsd.org/changeset/base/204211

Log:
  Support the extended PLT format used when objects have more than 8192
  PLT relocations on PPC32.

Modified:
  head/libexec/rtld-elf/powerpc/reloc.c
  head/libexec/rtld-elf/powerpc/rtld_machdep.h
  head/libexec/rtld-elf/powerpc/rtld_start.S

Modified: head/libexec/rtld-elf/powerpc/reloc.c
==
--- head/libexec/rtld-elf/powerpc/reloc.c   Mon Feb 22 16:27:47 2010
(r204210)
+++ head/libexec/rtld-elf/powerpc/reloc.c   Mon Feb 22 16:49:45 2010
(r204211)
@@ -47,6 +47,13 @@
 ((u_int32_t)(x) + 0x1) : (u_int32_t)(x)) >> 16)
 #define _ppc_la(x) ((u_int32_t)(x) & 0x)
 
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+
+#define PLT_EXTENDED_BEGIN (1 << 13)
+#define JMPTAB_BASE(N) (18 + N*2 + ((N > PLT_EXTENDED_BEGIN) ? \
+   (N - PLT_EXTENDED_BEGIN)*2 : 0))
+
 /*
  * Process the R_PPC_COPY relocations
  */
@@ -313,7 +320,6 @@ done:
return (r);
 }
 
-
 /*
  * Initialise a PLT slot to the resolving trampoline
  */
@@ -321,27 +327,43 @@ static int
 reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela)
 {
Elf_Word *where = (Elf_Word *)(obj->relocbase + rela->r_offset);
-   Elf_Addr *pltresolve;
+   Elf_Addr *pltresolve, *pltlongresolve, *jmptab;
Elf_Addr distance;
+   int N = obj->pltrelasize / sizeof(Elf_Rela);
int reloff;
 
reloff = rela - obj->pltrela;
 
-   if ((reloff < 0) || (reloff >= 0x8000)) {
+   if (reloff < 0)
return (-1);
-   }
 
-   pltresolve = obj->pltgot + 8;
+   pltlongresolve = obj->pltgot + 5;
+   pltresolve = pltlongresolve + 5;
 
distance = (Elf_Addr)pltresolve - (Elf_Addr)(where + 1);
 
dbg(" reloc_plt_object: where=%p,pltres=%p,reloff=%x,distance=%x",
(void *)where, (void *)pltresolve, reloff, distance);
 
-   /* li   r11,reloff  */
-   /* bpltresolve  */
-   where[0] = 0x3960 | reloff;
-   where[1] = 0x4800 | (distance & 0x03fc);
+   if (reloff < PLT_EXTENDED_BEGIN) {
+   /* li   r11,reloff  */
+   /* bpltresolve  */
+   where[0] = 0x3960 | reloff;
+   where[1] = 0x4800 | (distance & 0x03fc);
+   } else {
+   jmptab = obj->pltgot + JMPTAB_BASE(N);
+   jmptab[reloff] = (u_int)pltlongresolve;
+
+   /* lis  r11,jmptab[relo...@ha */
+   /* lwzu r12,jmptab[relo...@l(r11) */
+   /* mtctr r12 */
+   /* bctr */
+   where[0] = 0x3d60 | _ppc_ha(&jmptab[reloff]);
+   where[1] = 0x858b | _ppc_la(&jmptab[reloff]);
+   where[2] = 0x7d8903a6;
+   where[3] = 0x4e800420;
+   }
+   
 
/*
 * The icache will be sync'd in init_pltgot, which is called
@@ -453,25 +475,28 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
int N = obj->pltrelasize / sizeof(Elf_Rela);
int reloff = rela - obj->pltrela;
 
-   if ((reloff < 0) || (reloff >= 0x8000)) {
+   if (reloff < 0)
return (-1);
-   }
 
pltcall = obj->pltgot;
 
-   dbg(" reloc_jmpslot: indir, reloff=%d, N=%d\n",
+   dbg(" reloc_jmpslot: indir, reloff=%x, N=%x\n",
reloff, N);
 
-   jmptab = obj->pltgot + 18 + N * 2;
+   jmptab = obj->pltgot + JMPTAB_BASE(N);
jmptab[reloff] = target;
 
-   distance = (Elf_Addr)pltcall - (Elf_Addr)(wherep + 1);
+   if (reloff < PLT_EXTENDED_BEGIN) {
+   /* for extended PLT entries, we keep the old code */
+
+   distance = (Elf_Addr)pltcall - (Elf_Addr)(wherep + 1);
 
-   /* li   r11,reloff */
-   /* bpltcall  # use indirect pltcall routine */
-   wherep[0] = 0x3960 | reloff;
-   wherep[1] = 0x4800 | (distance & 0x03fc);
-   __syncicache(wherep, 8);
+   /* li   r11,reloff */
+   /* bpltcall  # use indirect pltcall routine */
+   wherep[0] = 0x3960 | reloff;
+   wherep[1] = 0x4800 | (distance & 0x03fc);
+   __syncicache(wherep, 8);
+   }
}
 
return (target);
@@ -481,13 +506,14 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 /*
  * Setup the plt glue routines.
  */
-#define PLTCALL_SIZE20
-#define PLTRESOLVE_SIZE 24
+#define PLTCALL_SIZE   20
+#define PLTLONGRESOLVE_SIZE20
+#define PLTRESOLVE_SIZE24
 
 void
 init_pltgot(Obj_Entry *obj)
 {
- 

svn commit: r204212 - head/sys/dev/mxge

2010-02-22 Thread Andrew Gallatin
Author: gallatin
Date: Mon Feb 22 16:57:03 2010
New Revision: 204212
URL: http://svn.freebsd.org/changeset/base/204212

Log:
  Update mxge to support IFCAP_VLAN_HWTSO.
  
  Note: If/when FreeBSD supports TSO over IPv6, the minimal mxge fw
  rev to enable IFCAP_VLAN_HWTSO will need to be increased to 1.4.37

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==
--- head/sys/dev/mxge/if_mxge.c Mon Feb 22 16:49:45 2010(r204211)
+++ head/sys/dev/mxge/if_mxge.c Mon Feb 22 16:57:03 2010(r204212)
@@ -4122,6 +4122,13 @@ mxge_ioctl(struct ifnet *ifp, u_long com
}
if (mask & IFCAP_VLAN_HWTAGGING)
ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+   if (mask & IFCAP_VLAN_HWTSO)
+   ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
+
+   if (!(ifp->if_capabilities & IFCAP_VLAN_HWTSO) ||
+   !(ifp->if_capenable & IFCAP_VLAN_HWTAGGING))
+   ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
+
mtx_unlock(&sc->driver_mtx);
VLAN_CAPABILITIES(ifp);
 
@@ -4734,6 +4741,11 @@ mxge_attach(device_t dev)
 
 #ifdef MXGE_NEW_VLAN_API
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
+
+   /* Only FW 1.4.32 and newer can do TSO over vlans */
+   if (sc->fw_ver_major == 1 && sc->fw_ver_minor == 4 &&
+   sc->fw_ver_tiny >= 32)
+   ifp->if_capabilities |= IFCAP_VLAN_HWTSO;
 #endif
 
sc->max_mtu = mxge_max_mtu(sc);
___
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: r204214 - head/sys/amd64/amd64

2010-02-22 Thread Justin T. Gibbs
Author: gibbs
Date: Mon Feb 22 17:03:45 2010
New Revision: 204214
URL: http://svn.freebsd.org/changeset/base/204214

Log:
  Enforce stronger semantics for bus-dma alignment (currently only on amd64).
  Now all contiguous regions returned from bus-dma will be aligned to the
  alignment constraint and all but the last region are guaranteed to be
  a multiple of the alignment in length.  This also means that the relative
  alignment of two adjacent bytes in the I/O stream have a difference of 1
  even if they are not physically contiguous.
  
  The old code, when needing to perform a copy in order to align data, only
  copied the amount of data needed to reach the next page boundary.  This
  often left an unaligned end to the segment.  Drivers such as Xen's blkfront
  can't deal with such segments.
  
  The downside to this approach is that, once an unaligned region is 
encountered,
  the remainder of the I/O will be bounced.  However, bouncing should be rare.
  It is typically caused by non-performance critical userland programs that
  don't bother to align their I/O buffers (e.g. bsdlabel).  In-kernel I/O
  buffers are always aligned to at least a page boundary.
  
  Reviewed by:  scottl
  MFC after:  2 weeks

Modified:
  head/sys/amd64/amd64/busdma_machdep.c

Modified: head/sys/amd64/amd64/busdma_machdep.c
==
--- head/sys/amd64/amd64/busdma_machdep.c   Mon Feb 22 17:03:26 2010
(r204213)
+++ head/sys/amd64/amd64/busdma_machdep.c   Mon Feb 22 17:03:45 2010
(r204214)
@@ -239,8 +239,7 @@ bus_dma_tag_create(bus_dma_tag_t parent,
newtag->alignment = alignment;
newtag->boundary = boundary;
newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
-   newtag->highaddr = trunc_page((vm_paddr_t)highaddr) +
-   (PAGE_SIZE - 1);
+   newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1);
newtag->filter = filter;
newtag->filterarg = filterarg;
newtag->maxsize = maxsize;
@@ -605,13 +604,18 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
vendaddr = (vm_offset_t)buf + buflen;
 
while (vaddr < vendaddr) {
+   bus_size_t sg_len;
+
+   sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK);
if (pmap)
paddr = pmap_extract(pmap, vaddr);
else
paddr = pmap_kextract(vaddr);
-   if (run_filter(dmat, paddr) != 0)
+   if (run_filter(dmat, paddr) != 0) {
+   sg_len = roundup2(sg_len, dmat->alignment);
map->pagesneeded++;
-   vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK));
+   }
+   vaddr += sg_len;
}
CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded);
}
@@ -644,6 +648,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
bmask = ~(dmat->boundary - 1);
 
for (seg = *segp; buflen > 0 ; ) {
+   bus_size_t max_sgsize;
+
/*
 * Get the physical address for this segment.
 */
@@ -655,11 +661,15 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
/*
 * Compute the segment size, and adjust counts.
 */
-   sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK);
-   if (sgsize > dmat->maxsegsz)
-   sgsize = dmat->maxsegsz;
-   if (buflen < sgsize)
-   sgsize = buflen;
+   max_sgsize = MIN(buflen, dmat->maxsegsz);
+   sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK);
+   if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) {
+   sgsize = roundup2(sgsize, dmat->alignment);
+   sgsize = MIN(sgsize, max_sgsize);
+   curaddr = add_bounce_page(dmat, map, vaddr, sgsize);
+   } else {
+   sgsize = MIN(sgsize, max_sgsize);
+   }
 
/*
 * Make sure we don't cross any boundaries.
@@ -670,9 +680,6 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
sgsize = (baddr - curaddr);
}
 
-   if (map->pagesneeded != 0 && run_filter(dmat, curaddr))
-   curaddr = add_bounce_page(dmat, map, vaddr, sgsize);
-
/*
 * Insert chunk into a segment, coalescing with
 * previous segment if possible.
___
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: r204213 - head/share/man/man9

2010-02-22 Thread Bernhard Schmidt
Author: bschmidt
Date: Mon Feb 22 17:03:26 2010
New Revision: 204213
URL: http://svn.freebsd.org/changeset/base/204213

Log:
  Fix some typos.
  
  Approved by:  rpaulo (mentor)
  MFC after:1 week

Modified:
  head/share/man/man9/ieee80211_scan.9

Modified: head/share/man/man9/ieee80211_scan.9
==
--- head/share/man/man9/ieee80211_scan.9Mon Feb 22 16:57:03 2010
(r204212)
+++ head/share/man/man9/ieee80211_scan.9Mon Feb 22 17:03:26 2010
(r204213)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2009
+.Dd February 20, 2010
 .Dt IEEE80211_SCAN 9
 .Os
 .Sh NAME
@@ -177,8 +177,8 @@ Scanning is not tied to the
 state machine that governs vaps except for linkage to the
 .Dv IEEE80211_S_SCAN
 state.
-One one vap at a time may be scanning; this scheduling policy
-is handle in
+Only one vap at a time may be scanning; this scheduling policy
+is handled in
 .Fn ieee80211_new_state
 and is transparent to scanning code.
 .Pp
___
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: r204197 - head/sys/powerpc/aim

2010-02-22 Thread Nathan Whitehorn

Nathan Whitehorn wrote:

Author: nwhitehorn
Date: Mon Feb 22 14:17:23 2010
New Revision: 204197
URL: http://svn.freebsd.org/changeset/base/204197

Log:
  Allow user programs to execute mfpvr instructions. Linux allows this, and
  some math-related software like GMP expects to be able to use it to pick
  a target appropriately.
  
  MFC after:	1 week
  

Reported by: Jakob van Santen 
-Nathan
___
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: r204216 - head/sys/dev/ata/chipsets

2010-02-22 Thread Alexander Motin
Author: mav
Date: Mon Feb 22 17:34:35 2010
New Revision: 204216
URL: http://svn.freebsd.org/changeset/base/204216

Log:
  Oops! Wrong word order. :(

Modified:
  head/sys/dev/ata/chipsets/ata-intel.c

Modified: head/sys/dev/ata/chipsets/ata-intel.c
==
--- head/sys/dev/ata/chipsets/ata-intel.c   Mon Feb 22 17:10:47 2010
(r204215)
+++ head/sys/dev/ata/chipsets/ata-intel.c   Mon Feb 22 17:34:35 2010
(r204216)
@@ -140,22 +140,22 @@ ata_intel_probe(device_t dev)
  { ATA_I82801JI_AH,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
  { ATA_I82801JI_R1,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
  { ATA_I82801JI_S2,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
- { 0x80863a20,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a21,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a22,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a23,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a24,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a25,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a26,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a27,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a28,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a29,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a2a,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a2b,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a2c,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a2d,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a2e,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
- { 0x80863a2f,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a208086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a218086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a228086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a238086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a248086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a258086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a268086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a278086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a288086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a298086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a2a8086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a2b8086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a2c8086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a2d8086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a2e8086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+ { 0x3a2f8086,   0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
  { ATA_I31244,   0,  0, 2, ATA_SA150, "31244" },
  { ATA_ISCH, 0,  0, 1, ATA_UDMA5, "SCH" },
  { 0, 0, 0, 0, 0, 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: r204218 - head/sys/powerpc/powermac

2010-02-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb 22 18:49:43 2010
New Revision: 204218
URL: http://svn.freebsd.org/changeset/base/204218

Log:
  Provide a new useless feature: an led(4) interface for the system's sleep
  LED.

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

Modified: head/sys/powerpc/powermac/smu.c
==
--- head/sys/powerpc/powermac/smu.c Mon Feb 22 18:07:41 2010
(r204217)
+++ head/sys/powerpc/powermac/smu.c Mon Feb 22 18:49:43 2010
(r204218)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -114,6 +115,8 @@ struct smu_softc {
/* Thermal management parameters */
int sc_target_temp; /* Default 55 C */
int sc_critical_temp;   /* Default 90 C */
+
+   struct cdev *sc_leddev;
 };
 
 /* regular bus attachment functions */
@@ -133,6 +136,7 @@ static int  smu_get_datablock(device_t de
 static voidsmu_attach_fans(device_t dev, phandle_t fanroot);
 static voidsmu_attach_sensors(device_t dev, phandle_t sensroot);
 static voidsmu_fanmgt_callout(void *xdev);
+static voidsmu_set_sleepled(void *xdev, int onoff);
 
 /* where to find the doorbell GPIO */
 
@@ -292,6 +296,11 @@ smu_attach(device_t dev)
callout_init(&sc->sc_fanmgt_callout, 1);
smu_fanmgt_callout(dev);
 
+   /*
+* Set up LED interface
+*/
+   sc->sc_leddev = led_create(smu_set_sleepled, dev, "sleepled");
+
return (0);
 }
 
@@ -853,3 +862,18 @@ smu_fanmgt_callout(void *xdev) {
ms_to_ticks(SMU_FANMGT_INTERVAL), smu_fanmgt_callout, smu);
 }
 
+static void
+smu_set_sleepled(void *xdev, int onoff)
+{
+   struct smu_cmd cmd;
+   device_t smu = xdev;
+
+   cmd.cmd = SMU_MISC;
+   cmd.len = 3;
+   cmd.data[0] = SMU_MISC_LED_CTRL;
+   cmd.data[1] = 0;
+   cmd.data[2] = onoff; 
+
+   smu_run_cmd(smu, &cmd);
+}
+
___
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: r204219 - head/sys/dev/re

2010-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Mon Feb 22 18:51:14 2010
New Revision: 204219
URL: http://svn.freebsd.org/changeset/base/204219

Log:
  Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo
  frame, make sure to update VLAN capabilities whenever jumbo frame
  is configured.
  While I'm here rearrange interface capabilities configuration. The
  controller requires VLAN hardware tagging to make TSO work on VLANs
  so explicitly check this requirement.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Mon Feb 22 18:49:43 2010(r204218)
+++ head/sys/dev/re/if_re.c Mon Feb 22 18:51:14 2010(r204219)
@@ -1429,7 +1429,7 @@ re_attach(device_t dev)
 */
if ((sc->rl_flags & RL_FLAG_DESCV2) == 0) {
ifp->if_hwassist |= CSUM_TSO;
-   ifp->if_capabilities |= IFCAP_TSO4;
+   ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
}
 
/*
@@ -1451,7 +1451,7 @@ re_attach(device_t dev)
 * packets in TSO size.
 */
ifp->if_hwassist &= ~CSUM_TSO;
-   ifp->if_capenable &= ~IFCAP_TSO4;
+   ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO);
 #ifdef DEVICE_POLLING
ifp->if_capabilities |= IFCAP_POLLING;
 #endif
@@ -2789,6 +2789,7 @@ re_ioctl(struct ifnet *ifp, u_long comma
(ifp->if_capenable & IFCAP_TSO4) != 0) {
ifp->if_capenable &= ~IFCAP_TSO4;
ifp->if_hwassist &= ~CSUM_TSO;
+   VLAN_CAPABILITIES(ifp);
}
RL_UNLOCK(sc);
break;
@@ -2855,14 +2856,10 @@ re_ioctl(struct ifnet *ifp, u_long comma
ifp->if_hwassist &= ~RE_CSUM_FEATURES;
reinit = 1;
}
-   if (mask & IFCAP_VLAN_HWTAGGING) {
-   ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
-   reinit = 1;
-   }
-   if (mask & IFCAP_TSO4) {
+   if ((mask & IFCAP_TSO4) != 0 &&
+   (ifp->if_capabilities & IFCAP_TSO) != 0) {
ifp->if_capenable ^= IFCAP_TSO4;
-   if ((IFCAP_TSO4 & ifp->if_capenable) &&
-   (IFCAP_TSO4 & ifp->if_capabilities))
+   if ((IFCAP_TSO4 & ifp->if_capenable) != 0)
ifp->if_hwassist |= CSUM_TSO;
else
ifp->if_hwassist &= ~CSUM_TSO;
@@ -2872,6 +2869,17 @@ re_ioctl(struct ifnet *ifp, u_long comma
ifp->if_hwassist &= ~CSUM_TSO;
}
}
+   if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
+   (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
+   ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
+   if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
+   (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
+   ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+   /* TSO over VLAN requires VLAN hardware tagging. */
+   if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
+   ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
+   reinit = 1;
+   }
if ((mask & IFCAP_WOL) != 0 &&
(ifp->if_capabilities & IFCAP_WOL) != 0) {
if ((mask & IFCAP_WOL_UCAST) != 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"


Re: svn commit: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate

2010-02-22 Thread Remko Lodder

On Feb 19, 2010, at 12:16 AM, Pawel Jakub Dawidek wrote:

> Author: pjd
> Date: Thu Feb 18 23:16:19 2010
> New Revision: 204076
> URL: http://svn.freebsd.org/changeset/base/204076
> 
> Log:
>  Please welcome HAST - Highly Avalable Storage.
> 
> 

\o/ !!

-- 
/"\   Best regards,| re...@freebsd.org
\ /   Remko Lodder  | re...@efnet
Xhttp://www.evilcoder.org/|
/ \   ASCII Ribbon Campaign| Against HTML Mail and News

___
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: r204220 - in head/sys/cam: . ata scsi

2010-02-22 Thread Alexander Motin
Author: mav
Date: Mon Feb 22 19:17:17 2010
New Revision: 204220
URL: http://svn.freebsd.org/changeset/base/204220

Log:
  Virtualize transport part of periph announcement.

Modified:
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/cam_xpt_internal.h
  head/sys/cam/scsi/scsi_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==
--- head/sys/cam/ata/ata_xpt.c  Mon Feb 22 18:51:14 2010(r204219)
+++ head/sys/cam/ata/ata_xpt.c  Mon Feb 22 19:17:17 2010(r204220)
@@ -178,11 +178,13 @@ static voidata_dev_async(u_int32_t asy
struct cam_ed *device,
void *async_arg);
 static void ata_action(union ccb *start_ccb);
+static void ata_announce_periph(struct cam_periph *periph);
 
 static struct xpt_xport ata_xport = {
.alloc_device = ata_alloc_device,
.action = ata_action,
.async = ata_dev_async,
+   .announce = ata_announce_periph,
 };
 
 struct xpt_xport *
@@ -1641,3 +1643,82 @@ ata_dev_async(u_int32_t async_code, stru
}
 }
 
+static void
+ata_announce_periph(struct cam_periph *periph)
+{
+   struct  ccb_pathinq cpi;
+   struct  ccb_trans_settings cts;
+   struct  cam_path *path = periph->path;
+   u_int   speed;
+   u_int   mb;
+
+   mtx_assert(periph->sim->mtx, MA_OWNED);
+
+   xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
+   cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
+   cts.type = CTS_TYPE_CURRENT_SETTINGS;
+   xpt_action((union ccb*)&cts);
+   if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
+   return;
+   /* Ask the SIM for its base transfer speed */
+   xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
+   cpi.ccb_h.func_code = XPT_PATH_INQ;
+   xpt_action((union ccb *)&cpi);
+   /* Report connection speed */
+   speed = cpi.base_transfer_speed;
+   if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) {
+   struct  ccb_trans_settings_ata *ata =
+   &cts.xport_specific.ata;
+
+   if (ata->valid & CTS_ATA_VALID_MODE)
+   speed = ata_mode2speed(ata->mode);
+   }
+   if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) {
+   struct  ccb_trans_settings_sata *sata =
+   &cts.xport_specific.sata;
+
+   if (sata->valid & CTS_SATA_VALID_REVISION)
+   speed = ata_revision2speed(sata->revision);
+   }
+   mb = speed / 1000;
+   if (mb > 0)
+   printf("%s%d: %d.%03dMB/s transfers",
+  periph->periph_name, periph->unit_number,
+  mb, speed % 1000);
+   else
+   printf("%s%d: %dKB/s transfers", periph->periph_name,
+  periph->unit_number, speed);
+   /* Report additional information about connection */
+   if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) {
+   struct ccb_trans_settings_ata *ata =
+   &cts.xport_specific.ata;
+
+   printf(" (");
+   if (ata->valid & CTS_ATA_VALID_MODE)
+   printf("%s, ", ata_mode2string(ata->mode));
+   if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0)
+   printf("ATAPI %dbytes, ", ata->atapi);
+   if (ata->valid & CTS_ATA_VALID_BYTECOUNT)
+   printf("PIO %dbytes", ata->bytecount);
+   printf(")");
+   }
+   if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) {
+   struct ccb_trans_settings_sata *sata =
+   &cts.xport_specific.sata;
+
+   printf(" (");
+   if (sata->valid & CTS_SATA_VALID_REVISION)
+   printf("SATA %d.x, ", sata->revision);
+   else
+   printf("SATA, ");
+   if (sata->valid & CTS_SATA_VALID_MODE)
+   printf("%s, ", ata_mode2string(sata->mode));
+   if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0)
+   printf("ATAPI %dbytes, ", sata->atapi);
+   if (sata->valid & CTS_SATA_VALID_BYTECOUNT)
+   printf("PIO %dbytes", sata->bytecount);
+   printf(")");
+   }
+   printf("\n");
+}
+

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Mon Feb 22 18:51:14 2010(r204219)
+++ head/sys/cam/cam_xpt.c  Mon Feb 22 19:17:17 2010(r204220)
@@ -1065,20 +1065,10 @@ xpt_remove_periph(struct cam_periph *per
 void
 xpt_announce_periph(struct cam_periph *periph, char *announce_string)
 {
-   struct  ccb_pathinq cpi;
-   struct  ccb_trans_settings cts;
-   struct  cam_path *p

svn commit: r204222 - head/sys/dev/gem

2010-02-22 Thread Marius Strobl
Author: marius
Date: Mon Feb 22 21:01:08 2010
New Revision: 204222
URL: http://svn.freebsd.org/changeset/base/204222

Log:
  According to the Linux sungem driver, in case of Apple (K2) GMACs
  GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered
  down the chip so the internal transceiver has to be hardcoded. This
  is also in line with the AppleGMACEthernet driver, which just doesn't
  distinguish between internal/external transceiver and MDIO/MDI1
  respectively in the first place. Tested by: Andreas Tobler
  
  MFC after:1 week

Modified:
  head/sys/dev/gem/if_gem.c

Modified: head/sys/dev/gem/if_gem.c
==
--- head/sys/dev/gem/if_gem.c   Mon Feb 22 20:42:30 2010(r204221)
+++ head/sys/dev/gem/if_gem.c   Mon Feb 22 21:01:08 2010(r204222)
@@ -297,8 +297,11 @@ gem_attach(struct gem_softc *sc)
 
/*
 * Fall back on an internal PHY if no external PHY was found.
+* Note that with Apple (K2) GMACs GEM_MIF_CONFIG_MDI0 can't be
+* trusted when the firmware has powered down the chip.
 */
-   if (error != 0 && (v & GEM_MIF_CONFIG_MDI0) != 0) {
+   if (error != 0 &&
+   ((v & GEM_MIF_CONFIG_MDI0) != 0 || GEM_IS_APPLE(sc))) {
v &= ~GEM_MIF_CONFIG_PHY_SEL;
GEM_BANK1_WRITE_4(sc, GEM_MIF_CONFIG, v);
switch (sc->sc_variant) {
___
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: r204223 - head/sys/dev/bge

2010-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Mon Feb 22 21:03:15 2010
New Revision: 204223
URL: http://svn.freebsd.org/changeset/base/204223

Log:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
  While I'm here make sure to pullup IP/TCP headers in the first
  buffer.

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Mon Feb 22 21:01:08 2010(r204222)
+++ head/sys/dev/bge/if_bge.c   Mon Feb 22 21:03:15 2010(r204223)
@@ -3835,12 +3835,11 @@ bge_cksum_pad(struct mbuf *m)
 static struct mbuf *
 bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss)
 {
-   struct ether_header *eh;
struct ip *ip;
struct tcphdr *tcp;
struct mbuf *n;
uint16_t hlen;
-   uint32_t ip_off, poff;
+   uint32_t poff;
 
if (M_WRITABLE(m) == 0) {
/* Get a writable copy. */
@@ -3850,28 +3849,16 @@ bge_setup_tso(struct bge_softc *sc, stru
return (NULL);
m = n;
}
-   ip_off = sizeof(struct ether_header);
-   m = m_pullup(m, ip_off);
+   m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct ip));
if (m == NULL)
return (NULL);
-   eh = mtod(m, struct ether_header *);
-   /* Check the existence of VLAN tag. */
-   if (eh->ether_type == htons(ETHERTYPE_VLAN)) {
-   ip_off = sizeof(struct ether_vlan_header);
-   m = m_pullup(m, ip_off);
-   if (m == NULL)
-   return (NULL);
-   }
-   m = m_pullup(m, ip_off + sizeof(struct ip));
-   if (m == NULL)
-   return (NULL);
-   ip = (struct ip *)(mtod(m, char *) + ip_off);
-   poff = ip_off + (ip->ip_hl << 2);
+   ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header));
+   poff = sizeof(struct ether_header) + (ip->ip_hl << 2);
m = m_pullup(m, poff + sizeof(struct tcphdr));
if (m == NULL)
return (NULL);
tcp = (struct tcphdr *)(mtod(m, char *) + poff);
-   m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off);
+   m = m_pullup(m, poff + (tcp->th_off << 2));
if (m == NULL)
return (NULL);
/*
___
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: r204225 - head/sys/dev/jme

2010-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Mon Feb 22 22:05:49 2010
New Revision: 204225
URL: http://svn.freebsd.org/changeset/base/204225

Log:
  Add TSO support on VLANs. jme(4) controllers do not require VLAN
  hardware tagging to make TSO work over VLANs.

Modified:
  head/sys/dev/jme/if_jme.c

Modified: head/sys/dev/jme/if_jme.c
==
--- head/sys/dev/jme/if_jme.c   Mon Feb 22 21:45:20 2010(r204224)
+++ head/sys/dev/jme/if_jme.c   Mon Feb 22 22:05:49 2010(r204225)
@@ -775,7 +775,7 @@ jme_attach(device_t dev)
 
/* VLAN capability setup */
ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING |
-   IFCAP_VLAN_HWCSUM;
+   IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO;
ifp->if_capenable = ifp->if_capabilities;
 
/* Tell the upper layer(s) we support long frames. */
@@ -1992,6 +1992,9 @@ jme_ioctl(struct ifnet *ifp, u_long cmd,
if ((mask & IFCAP_VLAN_HWCSUM) != 0 &&
(ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0)
ifp->if_capenable ^= IFCAP_VLAN_HWCSUM;
+   if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
+   (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
+   ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
(IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) {
ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
___
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: r204227 - in head/gnu/usr.bin: diff diff3 sdiff

2010-02-22 Thread Xin LI
Author: delphij
Date: Mon Feb 22 22:32:24 2010
New Revision: 204227
URL: http://svn.freebsd.org/changeset/base/204227

Log:
  POSIX patch(1) would treat -b as different meaning (the functionality
  is to be provided by --suffix).  Looking at the usage here in diffutils,
  it seems that we can just get rid of the -b .orig stuff.  This resolves
  a problem that can triggered if we move toward to a more permissively
  licensed patch(1) program.

Modified:
  head/gnu/usr.bin/diff/Makefile
  head/gnu/usr.bin/diff3/Makefile
  head/gnu/usr.bin/sdiff/Makefile

Modified: head/gnu/usr.bin/diff/Makefile
==
--- head/gnu/usr.bin/diff/Makefile  Mon Feb 22 22:27:26 2010
(r204226)
+++ head/gnu/usr.bin/diff/Makefile  Mon Feb 22 22:32:24 2010
(r204227)
@@ -29,7 +29,7 @@ LDADD=-lgnuregex
 
 .for f in diff.c context.c
 ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
-   patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
+   patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
 CLEANFILES+= ${f}
 .endfor
 

Modified: head/gnu/usr.bin/diff3/Makefile
==
--- head/gnu/usr.bin/diff3/Makefile Mon Feb 22 22:27:26 2010
(r204226)
+++ head/gnu/usr.bin/diff3/Makefile Mon Feb 22 22:32:24 2010
(r204227)
@@ -20,7 +20,7 @@ CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bi
 
 .for f in diff3.c
 ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
-   patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
+   patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
 CLEANFILES+= ${f}
 .endfor
 

Modified: head/gnu/usr.bin/sdiff/Makefile
==
--- head/gnu/usr.bin/sdiff/Makefile Mon Feb 22 22:27:26 2010
(r204226)
+++ head/gnu/usr.bin/sdiff/Makefile Mon Feb 22 22:32:24 2010
(r204227)
@@ -21,7 +21,7 @@ CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bi
 
 .for f in sdiff.c
 ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
-   patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
+   patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
 CLEANFILES+= ${f}
 .endfor
 
___
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: r204228 - head/sys/dev/alc

2010-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Mon Feb 22 22:41:27 2010
New Revision: 204228
URL: http://svn.freebsd.org/changeset/base/204228

Log:
  Add TSO support on VLANs. Also make sure to update TSO capability
  whenever jumbo frame is configured.
  While I'm here remove unnecessary check of VLAN hardware checksum
  offloading. vlan(4) already takes care of this.

Modified:
  head/sys/dev/alc/if_alc.c

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Mon Feb 22 22:32:24 2010(r204227)
+++ head/sys/dev/alc/if_alc.c   Mon Feb 22 22:41:27 2010(r204228)
@@ -84,9 +84,6 @@ __FBSDID("$FreeBSD$");
 #else
 #defineALC_CSUM_FEATURES   (CSUM_IP | CSUM_TCP | CSUM_UDP)
 #endif
-#ifndefIFCAP_VLAN_HWTSO
-#defineIFCAP_VLAN_HWTSO0
-#endif
 
 MODULE_DEPEND(alc, pci, 1, 1, 1);
 MODULE_DEPEND(alc, ether, 1, 1, 1);
@@ -756,8 +753,8 @@ alc_attach(device_t dev)
ether_ifattach(ifp, sc->alc_eaddr);
 
/* VLAN capability setup. */
-   ifp->if_capabilities |= IFCAP_VLAN_MTU;
-   ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
+   ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING |
+   IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO;
ifp->if_capenable = ifp->if_capabilities;
/*
 * XXX
@@ -2133,6 +2130,7 @@ alc_ioctl(struct ifnet *ifp, u_long cmd,
(ifp->if_capenable & IFCAP_TSO4) != 0) {
ifp->if_capenable &= ~IFCAP_TSO4;
ifp->if_hwassist &= ~CSUM_TSO;
+   VLAN_CAPABILITIES(ifp);
}
ALC_UNLOCK(sc);
}
@@ -2204,14 +2202,6 @@ alc_ioctl(struct ifnet *ifp, u_long cmd,
if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
(ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
-   /*
-* VLAN hardware tagging is required to do checksum
-* offload or TSO on VLAN interface. Checksum offload
-* on VLAN interface also requires hardware checksum
-* offload of parent interface.
-*/
-   if ((ifp->if_capenable & IFCAP_TXCSUM) == 0)
-   ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM;
if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
ifp->if_capenable &=
~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM);
___
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: r204230 - head/sys/dev/alc

2010-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Mon Feb 22 23:35:35 2010
New Revision: 204230
URL: http://svn.freebsd.org/changeset/base/204230

Log:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.

Modified:
  head/sys/dev/alc/if_alc.c

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Mon Feb 22 22:41:36 2010(r204229)
+++ head/sys/dev/alc/if_alc.c   Mon Feb 22 23:35:35 2010(r204230)
@@ -1788,7 +1788,7 @@ alc_encap(struct alc_softc *sc, struct m
struct tcphdr *tcp;
bus_dma_segment_t txsegs[ALC_MAXTXSEGS];
bus_dmamap_t map;
-   uint32_t cflags, hdrlen, ip_off, poff, vtag;
+   uint32_t cflags, hdrlen, poff, vtag;
int error, idx, nsegs, prod;
 
ALC_LOCK_ASSERT(sc);
@@ -1798,7 +1798,7 @@ alc_encap(struct alc_softc *sc, struct m
m = *m_head;
ip = NULL;
tcp = NULL;
-   ip_off = poff = 0;
+   poff = 0;
if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) {
/*
 * AR8131/AR8132 requires offset of TCP/UDP header in its
@@ -1808,7 +1808,6 @@ alc_encap(struct alc_softc *sc, struct m
 * cycles on FreeBSD so fast host CPU is required to get
 * smooth TSO performance.
 */
-   struct ether_header *eh;
 
if (M_WRITABLE(m) == 0) {
/* Get a writable copy. */
@@ -1822,32 +1821,13 @@ alc_encap(struct alc_softc *sc, struct m
*m_head = m;
}
 
-   ip_off = sizeof(struct ether_header);
-   m = m_pullup(m, ip_off);
+   m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct 
ip));
if (m == NULL) {
*m_head = NULL;
return (ENOBUFS);
}
-   eh = mtod(m, struct ether_header *);
-   /*
-* Check if hardware VLAN insertion is off.
-* Additional check for LLC/SNAP frame?
-*/
-   if (eh->ether_type == htons(ETHERTYPE_VLAN)) {
-   ip_off = sizeof(struct ether_vlan_header);
-   m = m_pullup(m, ip_off);
-   if (m == NULL) {
-   *m_head = NULL;
-   return (ENOBUFS);
-   }
-   }
-   m = m_pullup(m, ip_off + sizeof(struct ip));
-   if (m == NULL) {
-   *m_head = NULL;
-   return (ENOBUFS);
-   }
-   ip = (struct ip *)(mtod(m, char *) + ip_off);
-   poff = ip_off + (ip->ip_hl << 2);
+   ip = (struct ip *)(mtod(m, char *) + sizeof(struct 
ether_header));
+   poff = sizeof(struct ether_header) + (ip->ip_hl << 2);
if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
m = m_pullup(m, poff + sizeof(struct tcphdr));
if (m == NULL) {
___
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: r204231 - head/sys/dev/isp

2010-02-22 Thread Matt Jacob
Author: mjacob
Date: Tue Feb 23 00:34:20 2010
New Revision: 204231
URL: http://svn.freebsd.org/changeset/base/204231

Log:
  When we rescan, just scan from logical unit 0. In other words, don't
  specify a wildcard lun here.
  
  This unbreaks disk re-arrival.
  
  MFC after:2 days

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Mon Feb 22 23:35:35 2010
(r204230)
+++ head/sys/dev/isp/isp_freebsd.c  Tue Feb 23 00:34:20 2010
(r204231)
@@ -3892,7 +3892,7 @@ isp_make_here(ispsoftc_t *isp, int chan,
isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for 
rescan", chan);
return;
}
-   if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, 
cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+   if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, 
cam_sim_path(fc->sim), tgt, 0) != CAM_REQ_CMP) {
isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan");
xpt_free_ccb(ccb);
return;
___
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: r204235 - head/sys/dev/fb

2010-02-22 Thread Jung-uk Kim
Author: jkim
Date: Tue Feb 23 01:00:19 2010
New Revision: 204235
URL: http://svn.freebsd.org/changeset/base/204235

Log:
  Fix FBIO_ADPINFO ioctl on amd64.

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

Modified: head/sys/dev/fb/fb.c
==
--- head/sys/dev/fb/fb.cTue Feb 23 01:00:15 2010(r204234)
+++ head/sys/dev/fb/fb.cTue Feb 23 01:00:19 2010(r204235)
@@ -653,7 +653,7 @@ fb_commonioctl(video_adapter_t *adp, u_l
((video_adapter_info_t *)arg)->va_mem_base = adp->va_mem_base;
((video_adapter_info_t *)arg)->va_mem_size = adp->va_mem_size;
((video_adapter_info_t *)arg)->va_window
-#ifdef __i386__
+#if defined(__amd64__) || defined(__i386__)
= vtophys(adp->va_window);
 #else
= adp->va_window;
@@ -665,8 +665,8 @@ fb_commonioctl(video_adapter_t *adp, u_l
((video_adapter_info_t *)arg)->va_window_orig
= adp->va_window_orig;
((video_adapter_info_t *)arg)->va_unused0
-#ifdef __i386__
-   = (adp->va_buffer) ? vtophys(adp->va_buffer) : 0;
+#if defined(__amd64__) || defined(__i386__)
+   = adp->va_buffer != 0 ? vtophys(adp->va_buffer) : 0;
 #else
= adp->va_buffer;
 #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: r204236 - head/sys/dev/fb

2010-02-22 Thread Jung-uk Kim
Author: jkim
Date: Tue Feb 23 01:02:11 2010
New Revision: 204236
URL: http://svn.freebsd.org/changeset/base/204236

Log:
  Re-add accidentally removed pixel format for direct memory model.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Tue Feb 23 01:00:19 2010(r204235)
+++ head/sys/dev/fb/vesa.c  Tue Feb 23 01:02:11 2010(r204236)
@@ -919,9 +919,49 @@ vesa_bios_init(void)
vesa_vmode[modes].vi_buffer_size = bsize;
vesa_vmode[modes].vi_mem_model =
vesa_translate_mmodel(vmode.v_memmodel);
-   if (vesa_vmode[modes].vi_mem_model == V_INFO_MM_PACKED ||
-   vesa_vmode[modes].vi_mem_model == V_INFO_MM_DIRECT)
+   switch (vesa_vmode[modes].vi_mem_model) {
+   case V_INFO_MM_DIRECT:
+   if ((vmode.v_modeattr & V_MODELFB) != 0 &&
+   vers >= 0x0300) {
+   vesa_vmode[modes].vi_pixel_fields[0] =
+   vmode.v_linredfieldpos;
+   vesa_vmode[modes].vi_pixel_fields[1] =
+   vmode.v_lingreenfieldpos;
+   vesa_vmode[modes].vi_pixel_fields[2] =
+   vmode.v_linbluefieldpos;
+   vesa_vmode[modes].vi_pixel_fields[3] =
+   vmode.v_linresfieldpos;
+   vesa_vmode[modes].vi_pixel_fsizes[0] =
+   vmode.v_linredmasksize;
+   vesa_vmode[modes].vi_pixel_fsizes[1] =
+   vmode.v_lingreenmasksize;
+   vesa_vmode[modes].vi_pixel_fsizes[2] =
+   vmode.v_linbluemasksize;
+   vesa_vmode[modes].vi_pixel_fsizes[3] =
+   vmode.v_linresmasksize;
+   } else {
+   vesa_vmode[modes].vi_pixel_fields[0] =
+   vmode.v_redfieldpos;
+   vesa_vmode[modes].vi_pixel_fields[1] =
+   vmode.v_greenfieldpos;
+   vesa_vmode[modes].vi_pixel_fields[2] =
+   vmode.v_bluefieldpos;
+   vesa_vmode[modes].vi_pixel_fields[3] =
+   vmode.v_resfieldpos;
+   vesa_vmode[modes].vi_pixel_fsizes[0] =
+   vmode.v_redmasksize;
+   vesa_vmode[modes].vi_pixel_fsizes[1] =
+   vmode.v_greenmasksize;
+   vesa_vmode[modes].vi_pixel_fsizes[2] =
+   vmode.v_bluemasksize;
+   vesa_vmode[modes].vi_pixel_fsizes[3] =
+   vmode.v_resmasksize;
+   }
+   /* FALLTHROUGH */
+   case V_INFO_MM_PACKED:
vesa_vmode[modes].vi_pixel_size = (vmode.v_bpp + 7) / 8;
+   break;
+   }
vesa_vmode[modes].vi_flags =
vesa_translate_flags(vmode.v_modeattr) | V_INFO_VESA;
 
___
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: r204239 - head/lib/libz

2010-02-22 Thread Xin LI
Author: delphij
Date: Tue Feb 23 01:08:03 2010
New Revision: 204239
URL: http://svn.freebsd.org/changeset/base/204239

Log:
  Bootstrap the merge history for zlib.

Modified:
Directory Properties:
  head/lib/libz/   (props changed)
___
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: r204241 - head/share/man/man4/man4.powerpc

2010-02-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Feb 23 04:56:06 2010
New Revision: 204241
URL: http://svn.freebsd.org/changeset/base/204241

Log:
  Add a manpage for smu(4) now that it does something useful.

Added:
  head/share/man/man4/man4.powerpc/smu.4   (contents, props changed)
Modified:
  head/share/man/man4/man4.powerpc/Makefile

Modified: head/share/man/man4/man4.powerpc/Makefile
==
--- head/share/man/man4/man4.powerpc/Makefile   Tue Feb 23 01:24:01 2010
(r204240)
+++ head/share/man/man4/man4.powerpc/Makefile   Tue Feb 23 04:56:06 2010
(r204241)
@@ -7,6 +7,7 @@ MAN=adb.4 \
cuda.4 \
pmu.4 \
powermac_nvram.4 \
+   smu.4 \
snd_ai2s.4 \
snd_davbus.4 \
tsec.4

Added: head/share/man/man4/man4.powerpc/smu.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/man4.powerpc/smu.4  Tue Feb 23 04:56:06 2010
(r204241)
@@ -0,0 +1,122 @@
+.\"-
+.\" Copyright (c) 2010 Nathan Whitehorn 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 22, 2010
+.Dt SMU 4
+.Os
+.Sh NAME
+.Nm smu
+.Nd Apple System Management Unit Driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device smu"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the System Management Unit (PMU) found in many
+Apple G5 systems.
+This includes most Power Macintosh G5 and all iMac G5 systems.
+.Pp
+The Apple SMU controller provides software power management and thermal
+control functionality, and is responsible for managing system cooling
+devices.
+.Sh HARDWARE
+Chips supported by the
+.Nm
+driver include:
+.Pp
+.Bl -bullet -compact
+.It
+Apple System Management Unit
+.El
+.Sh THERMAL MANAGEMENT
+The
+.Nm
+driver provides basic automatic thermal management. Without a userspace
+daemon providing more advanced control, the driver will attempt to maintain
+system temperatures in a conservative range through coarse-grained control of
+system cooling devices (see below). Automatic kernel-level thermal control
+will take over if more than 3 seconds elapses between userspace cooling
+setting adjustments.
+.Sh SYSCTL VARIABLES
+The
+.Nm
+driver provides power management services and thermal readout through a
+sysctl interface.
+The following sysctls can be used to control the
+power management behavior and to examine current system power and
+thermal conditions.
+.Bl -tag -width indent
+.It Va dev.smu.%d.target_temp
+Target system temperature, in degrees Celsius. The
+.Nm
+driver will attempt to adjust fans to maintain the temperature of the
+warmest component in the system at or below this level.
+.It Va dev.smu.%d.critical_temp
+System critical temperature, in degrees Celsius. If any component in
+the system exceeds this temperature, the machine will be shut down within
+500 ms.
+.It Va dev.smu.%d.fans.%s.minrpm
+Minimum allowed speed for this fan.
+.It Va dev.smu.%d.fans.%s.maxrpm
+Maximum allowed speed for this fan.
+.It Va dev.smu.%d.fans.%s.rpm
+Current speed for this fan. The fan speed can be adjusted by changing this
+sysctl. If more than 3 seconds elapses between fan speed adjustments, the
+kernel will resume automatic control of the fan.
+.It Va dev.smu.%d.sensors.%s
+Current reading from this sensor. Four sensor types are supported. Temperature
+sensors are in units of degrees Celsius, current sensors in milliamps, voltage
+sensors in millivolts, and power sensors in milliwatts.
+.El
+.Sh LED I

svn commit: r204242 - head/sys/dev/bwn

2010-02-22 Thread Warner Losh
Author: imp
Date: Tue Feb 23 05:02:10 2010
New Revision: 204242
URL: http://svn.freebsd.org/changeset/base/204242

Log:
  Fix compilation problems with INVARIANTS.
  
  # also limit RX decryption attempted messages to 50
  
  Reviewed by:  weongyo

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Feb 23 04:56:06 2010(r204241)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 23 05:02:10 2010(r204242)
@@ -1496,6 +1496,7 @@ bwn_pio_select(struct bwn_mac *mac, uint
return (&mac->mac_method.pio.wme[WME_AC_VO]);
}
KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
+   return (NULL);
 }
 
 static int
@@ -1905,10 +1906,9 @@ bwn_setup_channels(struct bwn_mac *mac, 
 static uint32_t
 bwn_shm_read_4(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-   struct bwn_softc *sc = mac->mac_sc;
uint32_t ret;
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac->mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset & 0x0001) == 0,
@@ -1932,10 +1932,9 @@ out:
 static uint16_t
 bwn_shm_read_2(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-   struct bwn_softc *sc = mac->mac_sc;
uint16_t ret;
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac->mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset & 0x0001) == 0,
@@ -1970,9 +1969,7 @@ static void
 bwn_shm_write_4(struct bwn_mac *mac, uint16_t way, uint16_t offset,
 uint32_t value)
 {
-   struct bwn_softc *sc = mac->mac_sc;
-
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac->mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset & 0x0001) == 0,
@@ -1995,9 +1992,7 @@ static void
 bwn_shm_write_2(struct bwn_mac *mac, uint16_t way, uint16_t offset,
 uint16_t value)
 {
-   struct bwn_softc *sc = mac->mac_sc;
-
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac->mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset & 0x0001) == 0,
@@ -3335,10 +3330,9 @@ bwn_core_start(struct bwn_mac *mac)
 static void
 bwn_core_exit(struct bwn_mac *mac)
 {
-   struct bwn_softc *sc = mac->mac_sc;
uint32_t macctl;
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac->mac_sc);
 
KASSERT(mac->mac_status <= BWN_MAC_STATUS_INITED,
("%s:%d: fail", __func__, __LINE__));
@@ -5198,6 +5192,8 @@ bwn_rf_init_bcm2050(struct bwn_mac *mac)
0x0e, 0x0f, 0x0d, 0x0f,
};
 
+   loctl = lomask = reg0 = classctl = crs0 = analogoverval = analogover =
+   rfoverval = rfover = cck3 = 0;
radio0 = BWN_RF_READ(mac, 0x43);
radio1 = BWN_RF_READ(mac, 0x51);
radio2 = BWN_RF_READ(mac, 0x52);
@@ -5891,7 +5887,6 @@ static void
 bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon)
 {
struct bwn_phy *phy = &mac->mac_phy;
-   struct bwn_softc *sc = mac->mac_sc;
unsigned int i, max_loop;
uint16_t value;
uint32_t buffer[5] = {
@@ -5906,7 +5901,7 @@ bwn_dummy_transmission(struct bwn_mac *m
buffer[0] = 0x000b846e;
}
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac->mac_sc);
 
for (i = 0; i < 5; i++)
bwn_ram_write(mac, i * 4, buffer[i]);
@@ -5972,10 +5967,9 @@ bwn_ram_write(struct bwn_mac *mac, uint1
 static void
 bwn_lo_write(struct bwn_mac *mac, struct bwn_loctl *ctl)
 {
-   struct bwn_phy *phy = &mac->mac_phy;
uint16_t value;
 
-   KASSERT(phy->type == BWN_PHYTYPE_G,
+   KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G,
("%s:%d: fail", __func__, __LINE__));
 
value = (uint8_t) (ctl->q);
@@ -6570,7 +6564,7 @@ bwn_lo_calibset(struct bwn_mac *mac,
struct bwn_phy_g *pg = &phy->phy_g;
struct bwn_loctl loctl = { 0, 0 };
struct bwn_lo_calib *cal;
-   struct bwn_lo_g_value sval;
+   struct bwn_lo_g_value sval = { 0 };
int rxgain;
uint16_t pad, reg, value;
 
@@ -8984,9 +8978,7 @@ bwn_noise_gensample(struct bwn_mac *mac)
 static int
 bwn_dma_freeslot(struct bwn_dma_ring *dr)
 {
-   struct bwn_mac *mac = dr->dr_mac;
-
-   BWN_ASSERT_LOCKED(mac->mac_sc);
+   BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
return (dr->dr_numslots - dr->dr_usedslot);
 }
@@ -8994,9 +8986,7 @@ bwn_dma_freeslot(struct bwn_dma_ring *dr
 static int
 bwn_dma_nextslot(struct bwn_dma_ring *dr, int slot)
 {
-   struct bwn_mac *mac = dr->dr_mac;
-
-   BWN_ASSERT_LOCKED(mac->mac_sc);
+   BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc);
 
KASSERT(slot >= -1 && slot <= dr->dr_numslots - 1,
("%s:%d: fail", __func__, __LINE__));
@@ -9393,9 +9383,10 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
struct ifnet *ifp = sc->sc_ifp;
struct ieee80211com *ic = ifp->if_l2com;
uint32_t macst