svn commit: r220182 - head/share/misc

2011-03-31 Thread Ganael LAPLANCHE
Author: martymac (ports committer)
Date: Thu Mar 31 06:11:49 2011
New Revision: 220182
URL: http://svn.freebsd.org/changeset/base/220182

Log:
  Add relation to my mentor (ehaupt)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Mar 31 04:49:07 2011
(r220181)
+++ head/share/misc/committers-ports.dotThu Mar 31 06:11:49 2011
(r220182)
@@ -231,6 +231,7 @@ edwin - linimon
 edwin - lx
 
 ehaupt - db
+ehaupt - martymac
 
 eik - sem
 eik - trhodes
___
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: r220184 - head/sys/geom/nop

2011-03-31 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar 31 06:30:59 2011
New Revision: 220184
URL: http://svn.freebsd.org/changeset/base/220184

Log:
  Remove unneeded checks, g_new_xxx functions can not return NULL.
  
  Reviewed by:  pjd
  MFC after:1 week

Modified:
  head/sys/geom/nop/g_nop.c

Modified: head/sys/geom/nop/g_nop.c
==
--- head/sys/geom/nop/g_nop.c   Thu Mar 31 06:29:15 2011(r220183)
+++ head/sys/geom/nop/g_nop.c   Thu Mar 31 06:30:59 2011(r220184)
@@ -189,10 +189,6 @@ g_nop_create(struct gctl_req *req, struc
}
}
gp = g_new_geomf(mp, name);
-   if (gp == NULL) {
-   gctl_error(req, Cannot create geom %s., name);
-   return (ENOMEM);
-   }
sc = g_malloc(sizeof(*sc), M_WAITOK);
sc-sc_offset = offset;
sc-sc_error = ioerror;
@@ -209,20 +205,10 @@ g_nop_create(struct gctl_req *req, struc
gp-dumpconf = g_nop_dumpconf;
 
newpp = g_new_providerf(gp, gp-name);
-   if (newpp == NULL) {
-   gctl_error(req, Cannot create provider %s., name);
-   error = ENOMEM;
-   goto fail;
-   }
newpp-mediasize = size;
newpp-sectorsize = secsize;
 
cp = g_new_consumer(gp);
-   if (cp == NULL) {
-   gctl_error(req, Cannot create consumer for %s., gp-name);
-   error = ENOMEM;
-   goto fail;
-   }
error = g_attach(cp, pp);
if (error != 0) {
gctl_error(req, Cannot attach to provider %s., pp-name);
@@ -233,18 +219,12 @@ g_nop_create(struct gctl_req *req, struc
G_NOP_DEBUG(0, Device %s created., gp-name);
return (0);
 fail:
-   if (cp != NULL) {
-   if (cp-provider != NULL)
-   g_detach(cp);
-   g_destroy_consumer(cp);
-   }
-   if (newpp != NULL)
-   g_destroy_provider(newpp);
-   if (gp != NULL) {
-   if (gp-softc != NULL)
-   g_free(gp-softc);
-   g_destroy_geom(gp);
-   }
+   if (cp-provider != NULL)
+   g_detach(cp);
+   g_destroy_consumer(cp);
+   g_destroy_provider(newpp);
+   g_free(gp-softc);
+   g_destroy_geom(gp);
return (error);
 }
 
___
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: r220185 - in head/sys: amd64/conf arm/conf conf dev/ath i386/conf mips/conf modules modules/ath modules/ath_ahb modules/ath_pci pc98/conf sparc64/conf

2011-03-31 Thread John Baldwin
On Thursday, March 31, 2011 4:07:13 am Adrian Chadd wrote:
 Author: adrian
 Date: Thu Mar 31 08:07:13 2011
 New Revision: 220185
 URL: http://svn.freebsd.org/changeset/base/220185
 
 Log:
   Break out the ath PCI logic into a separate device/module.
   
   Introduce the AHB glue for Atheros embedded systems. Right now it's
   hard-coded for the AR9130 chip whose support isn't yet in this HAL;
   it'll be added in a subsequent commit.
   
   Kernel configuration files now need both 'ath' and 'ath_pci' devices; both
   modules need to be loaded for the ath device to work.

Err, there's no need to break the kernel config.  Just have the kernel DTRT if 
both ath and pci are enabled using something like:

sys/dev/ath/if_ath_pci.cath pci

in sys/conf/files.

You can still have an if_ath_pci.ko module with this arrangement.  This is 
what almost all other drivers due that have multiple bus backends.

-- 
John Baldwin
___
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: r220190 - head/sys/modules

2011-03-31 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 31 12:03:30 2011
New Revision: 220190
URL: http://svn.freebsd.org/changeset/base/220190

Log:
  ath_ahb shouldn't be compiled normally; it is atheros chip specific.
  Remove it from here; users can compile it manually if needed.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Mar 31 08:55:00 2011(r220189)
+++ head/sys/modules/Makefile   Thu Mar 31 12:03:30 2011(r220190)
@@ -35,7 +35,6 @@ SUBDIR=   ${_3dfx} \
${_asr} \
ata \
ath \
-   ath_ahb \
ath_pci \
${_auxio} \
bce \
___
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: r220194 - head/sys/netipsec

2011-03-31 Thread Fabien Thomas
Author: fabient
Date: Thu Mar 31 13:14:24 2011
New Revision: 220194
URL: http://svn.freebsd.org/changeset/base/220194

Log:
  Fix two SA refcount:
  - AH does not release the SA like in ESP/IPCOMP when handling EAGAIN
  - ipsec_process_done incorrectly release the SA.
  
  Reviewed by:  vanhu
  MFC after:1 week

Modified:
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/xform_ah.c

Modified: head/sys/netipsec/ipsec_output.c
==
--- head/sys/netipsec/ipsec_output.cThu Mar 31 13:06:51 2011
(r220193)
+++ head/sys/netipsec/ipsec_output.cThu Mar 31 13:14:24 2011
(r220194)
@@ -247,7 +247,6 @@ ipsec_process_done(struct mbuf *m, struc
panic(ipsec_process_done);
 bad:
m_freem(m);
-   KEY_FREESAV(sav);
return (error);
 }
 

Modified: head/sys/netipsec/xform_ah.c
==
--- head/sys/netipsec/xform_ah.cThu Mar 31 13:06:51 2011
(r220193)
+++ head/sys/netipsec/xform_ah.cThu Mar 31 13:14:24 2011
(r220194)
@@ -785,6 +785,7 @@ ah_input_cb(struct cryptop *crp)
sav-tdb_cryptoid = crp-crp_sid;
 
if (crp-crp_etype == EAGAIN) {
+   KEY_FREESAV(sav);
error = crypto_dispatch(crp);
return error;
}
___
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: r220195 - head/sys/dev/pci

2011-03-31 Thread John Baldwin
Author: jhb
Date: Thu Mar 31 13:22:12 2011
New Revision: 220195
URL: http://svn.freebsd.org/changeset/base/220195

Log:
  Explicitly track the state of all known BARs for each PCI device.  The PCI
  bus driver will now remember the size of a BAR obtained during the initial
  bus scan and use that size when doing lazy resource allocation rather than
  resizing the BAR.  The bus driver will now also report unallocated BARs to
  userland for display by 'pciconf -lb'.  Psuedo-resources that are not BARs
  (such as the implicit I/O port resources for master/slave ATA controllers)
  will no longer be listed as BARs in 'pciconf -lb'.  During resume, BARs are
  restored from their new saved state instead of having the raw registers
  saved and restored across resume.  This also fixes restoring BARs at
  unusual loactions if said BAR has been allocated by a driver.
  
  Add a constant for the offset of the ROM BIOS BAR in PCI-PCI bridges and
  properly handle ROM BIOS BARs in PCI-PCI bridges.  The PCI bus now also
  properly handles the lack of a ROM BIOS BAR in a PCI-Cardbus bridge.
  
  Tested by:jkim

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_user.c
  head/sys/dev/pci/pcireg.h
  head/sys/dev/pci/pcivar.h

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Thu Mar 31 13:14:24 2011(r220194)
+++ head/sys/dev/pci/pci.c  Thu Mar 31 13:22:12 2011(r220195)
@@ -69,6 +69,11 @@ __FBSDID($FreeBSD$);
 #include pcib_if.h
 #include pci_if.h
 
+#definePCIR_IS_BIOS(cfg, reg)  
\
+   (((cfg)-hdrtype == PCIM_HDRTYPE_NORMAL  reg == PCIR_BIOS) || \
+((cfg)-hdrtype == PCIM_HDRTYPE_BRIDGE  reg == PCIR_BIOS_1))
+   
+
 static pci_addr_t  pci_mapbase(uint64_t mapreg);
 static const char  *pci_maptype(uint64_t mapreg);
 static int pci_mapsize(uint64_t testval);
@@ -531,6 +536,7 @@ pci_read_device(device_t pcib, int d, in
 
cfg-mfdev  = (cfg-hdrtype  PCIM_MFDEV) != 0;
cfg-hdrtype= ~PCIM_MFDEV;
+   STAILQ_INIT(cfg-maps);
 
pci_fixancient(cfg);
pci_hdrtypedata(pcib, b, s, f, cfg);
@@ -2106,6 +2112,7 @@ int
 pci_freecfg(struct pci_devinfo *dinfo)
 {
struct devlist *devlist_head;
+   struct pci_map *pm, *next;
int i;
 
devlist_head = pci_devq;
@@ -2119,6 +2126,9 @@ pci_freecfg(struct pci_devinfo *dinfo)
free(dinfo-cfg.vpd.vpd_w[i].value, M_DEVBUF);
free(dinfo-cfg.vpd.vpd_w, M_DEVBUF);
}
+   STAILQ_FOREACH_SAFE(pm, dinfo-cfg.maps, pm_link, next) {
+   free(pm, M_DEVBUF);
+   }
STAILQ_REMOVE(devlist_head, dinfo, pci_devinfo, pci_links);
free(dinfo, M_DEVBUF);
 
@@ -2393,6 +2403,7 @@ pci_memen(device_t dev)
 static void
 pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, pci_addr_t *testvalp)
 {
+   struct pci_devinfo *dinfo;
pci_addr_t map, testval;
int ln2range;
uint16_t cmd;
@@ -2402,7 +2413,8 @@ pci_read_bar(device_t dev, int reg, pci_
 * memory BAR.  Bit 0 is special and should not be set when
 * sizing the BAR.
 */
-   if (reg == PCIR_BIOS) {
+   dinfo = device_get_ivars(dev);
+   if (PCIR_IS_BIOS(dinfo-cfg, reg)) {
map = pci_read_config(dev, reg, 4);
pci_write_config(dev, reg, 0xfffe, 4);
testval = pci_read_config(dev, reg, 4);
@@ -2453,20 +2465,99 @@ pci_read_bar(device_t dev, int reg, pci_
 }
 
 static void
-pci_write_bar(device_t dev, int reg, pci_addr_t base)
+pci_write_bar(device_t dev, struct pci_map *pm, pci_addr_t base)
 {
-   pci_addr_t map;
+   struct pci_devinfo *dinfo;
int ln2range;
 
-   map = pci_read_config(dev, reg, 4);
-
-   /* The device ROM BAR is always 32-bits. */
-   if (reg == PCIR_BIOS)
-   return;
-   ln2range = pci_maprange(map);
-   pci_write_config(dev, reg, base, 4);
+   /* The device ROM BAR is always a 32-bit memory BAR. */
+   dinfo = device_get_ivars(dev);
+   if (PCIR_IS_BIOS(dinfo-cfg, pm-pm_reg))
+   ln2range = 32;
+   else
+   ln2range = pci_maprange(pm-pm_value);
+   pci_write_config(dev, pm-pm_reg, base, 4);
+   if (ln2range == 64)
+   pci_write_config(dev, pm-pm_reg + 4, base  32, 4);
+   pm-pm_value = pci_read_config(dev, pm-pm_reg, 4);
if (ln2range == 64)
-   pci_write_config(dev, reg + 4, base  32, 4);
+   pm-pm_value |= (pci_addr_t)pci_read_config(dev, pm-pm_reg + 
4, 4)  32;
+}
+
+struct pci_map *
+pci_find_bar(device_t dev, int reg)
+{
+   struct pci_devinfo *dinfo;
+   struct pci_map *pm;
+
+   dinfo = device_get_ivars(dev);
+   STAILQ_FOREACH(pm, dinfo-cfg.maps, pm_link) {
+   if 

svn commit: r220198 - head/sys/kern

2011-03-31 Thread Fabien Thomas
Author: fabient
Date: Thu Mar 31 13:59:47 2011
New Revision: 220198
URL: http://svn.freebsd.org/changeset/base/220198

Log:
  Clearing the flag when preempting will let the preempted thread run
  too much time. This can finish in a scheduler deadlock with ping-pong
  between two threads.
  
  One sample of this is:
  - device lapic (to have a preemption point on critical_exit())
  - options DEVICE_POLLING with HZ1499 (to have lapic freq = hardclock freq)
  - running a cpu intensive task (that does not enter the kernel)
  - only one CPU on SMP or no SMP.
  
  As requested by jhb@ 4BSD have received the same type of fix instead of
  propagating the flag to the new thread.
  
  Reviewed by:  jhb, jeff
  MFC after:1 month

Modified:
  head/sys/kern/sched_4bsd.c
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_4bsd.c
==
--- head/sys/kern/sched_4bsd.c  Thu Mar 31 13:36:31 2011(r220197)
+++ head/sys/kern/sched_4bsd.c  Thu Mar 31 13:59:47 2011(r220198)
@@ -940,13 +940,9 @@ sched_switch(struct thread *td, struct t
if ((td-td_flags  TDF_NOLOAD) == 0)
sched_load_rem();
 
-   if (newtd) {
-   MPASS(newtd-td_lock == sched_lock);
-   newtd-td_flags |= (td-td_flags  TDF_NEEDRESCHED);
-   }
-
td-td_lastcpu = td-td_oncpu;
-   td-td_flags = ~TDF_NEEDRESCHED;
+   if (!(flags  SW_PREEMPT))
+   td-td_flags = ~TDF_NEEDRESCHED;
td-td_owepreempt = 0;
td-td_oncpu = NOCPU;
 

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Thu Mar 31 13:36:31 2011(r220197)
+++ head/sys/kern/sched_ule.c   Thu Mar 31 13:59:47 2011(r220198)
@@ -1783,7 +1783,8 @@ sched_switch(struct thread *td, struct t
ts-ts_rltick = ticks;
td-td_lastcpu = td-td_oncpu;
td-td_oncpu = NOCPU;
-   td-td_flags = ~TDF_NEEDRESCHED;
+   if (!(flags  SW_PREEMPT))
+   td-td_flags = ~TDF_NEEDRESCHED;
td-td_owepreempt = 0;
tdq-tdq_switchcnt++;
/*
___
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: r220200 - head/usr.sbin/pkg_install

2011-03-31 Thread Ed Maste
Author: emaste
Date: Thu Mar 31 14:33:27 2011
New Revision: 220200
URL: http://svn.freebsd.org/changeset/base/220200

Log:
  Remove $Log$ keyword and associated history, which can cause annoyance in
  diffs in some cases.  Revision control tools have a history command to
  obtain this information.

Modified:
  head/usr.sbin/pkg_install/tkpkg

Modified: head/usr.sbin/pkg_install/tkpkg
==
--- head/usr.sbin/pkg_install/tkpkg Thu Mar 31 14:16:56 2011
(r220199)
+++ head/usr.sbin/pkg_install/tkpkg Thu Mar 31 14:33:27 2011
(r220200)
@@ -1,31 +1,6 @@
 #!/usr/local/bin/wish -f
 #$FreeBSD$
 #
-#$Log: tkpkg,v $
-#Revision 1.2  1994/12/06 00:51:21  jkh
-#Many of John T. Kohl's patches from NetBSD.  Thanks, John!
-#Submitted by: jkohl
-#
-# Revision 1.1  1994/01/06  08:16:20  jkh
-# Cleaning house.
-#
-# Revision 1.1  1993/09/04  17:06:09  jkh
-# Added Rich's wish front-end.
-#
-# Revision 1.6  1993/09/03  23:37:22  rich
-# warn user if no tar archives are found in the current directory.
-# removed the revision string from the lower text frame.
-#
-# Revision 1.5  1993/09/03  15:48:04  rich
-# glob for .tar.gz, .tar.z and .tar.Z looking for archives
-#
-# Revision 1.4  1993/08/28  15:53:59  rich
-# added version and date info to lower text window.
-#
-# Revision 1.3  1993/08/28  15:47:12  rich
-# filtered out ^Ls in pkg_* output.
-#
-#
 set pkgname 
 wm title . Package Installation
 #--
___
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: r220201 - head/usr.bin/compress/doc

2011-03-31 Thread Ed Maste
Author: emaste
Date: Thu Mar 31 14:35:33 2011
New Revision: 220201
URL: http://svn.freebsd.org/changeset/base/220201

Log:
  Remove $Log$ keyword, which can cause annoyance in diffs in some cases.
  Revision control tools have a history command to obtain this information.

Modified:
  head/usr.bin/compress/doc/revision.log

Modified: head/usr.bin/compress/doc/revision.log
==
--- head/usr.bin/compress/doc/revision.log  Thu Mar 31 14:33:27 2011
(r220200)
+++ head/usr.bin/compress/doc/revision.log  Thu Mar 31 14:35:33 2011
(r220201)
@@ -2,7 +2,7 @@
 
 /*
  * $Header: compress.c,v 4.0 85/07/30 12:50:00 joe Release $
- * $Log:   compress.c,v $
+ *
  * Revision 4.0  85/07/30  12:50:00  joe
  * Removed ferror() calls in output routine on every output except first.
  * Prepared for release to the world.
___
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: r220203 - head/sys/netinet/ipfw

2011-03-31 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar 31 15:10:41 2011
New Revision: 220203
URL: http://svn.freebsd.org/changeset/base/220203

Log:
  Fix a memory leak. Memory that is allocated for schedulers hash table
  was not freed.
  
  PR:   kern/156083
  MFC after:1 week

Modified:
  head/sys/netinet/ipfw/ip_dummynet.c

Modified: head/sys/netinet/ipfw/ip_dummynet.c
==
--- head/sys/netinet/ipfw/ip_dummynet.c Thu Mar 31 14:44:00 2011
(r220202)
+++ head/sys/netinet/ipfw/ip_dummynet.c Thu Mar 31 15:10:41 2011
(r220203)
@@ -748,9 +748,10 @@ schk_delete_cb(void *obj, void *arg)
 #endif
fsk_detach_list(s-fsk_list, arg ? DN_DESTROY : 0);
/* no more flowset pointing to us now */
-   if (s-sch.flags  DN_HAVE_MASK)
+   if (s-sch.flags  DN_HAVE_MASK) {
dn_ht_scan(s-siht, si_destroy, NULL);
-   else if (s-siht)
+   dn_ht_free(s-siht, 0);
+   } else if (s-siht)
si_destroy(s-siht, NULL);
if (s-profile) {
free(s-profile, M_DUMMYNET);
___
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: r220204 - head/sys/netinet/ipfw

2011-03-31 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar 31 15:11:12 2011
New Revision: 220204
URL: http://svn.freebsd.org/changeset/base/220204

Log:
  Fix malloc types.
  
  MFC after:1 week

Modified:
  head/sys/netinet/ipfw/ip_dn_glue.c

Modified: head/sys/netinet/ipfw/ip_dn_glue.c
==
--- head/sys/netinet/ipfw/ip_dn_glue.c  Thu Mar 31 15:10:41 2011
(r220203)
+++ head/sys/netinet/ipfw/ip_dn_glue.c  Thu Mar 31 15:11:12 2011
(r220204)
@@ -807,7 +807,7 @@ ip_dummynet_compat(struct sockopt *sopt)
if (error)
break;
error = dn_compat_del(v);
-   free(v, M_DUMMYNET);
+   free(v, M_TEMP);
break;
 
case IP_DUMMYNET_CONFIGURE:
@@ -816,7 +816,7 @@ ip_dummynet_compat(struct sockopt *sopt)
if (error)
break;
error = dn_compat_configure(v);
-   free(v, M_DUMMYNET);
+   free(v, M_TEMP);
break;
 
case IP_DUMMYNET_GET: {
___
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: r220205 - head/share/examples/kld/firmware/fwimage

2011-03-31 Thread Ed Maste
Author: emaste
Date: Thu Mar 31 15:12:40 2011
New Revision: 220205
URL: http://svn.freebsd.org/changeset/base/220205

Log:
  Avoid having a binary file in our source tree and instead create it at
  build time, to avoid possible grief maintaining FreeBSD source in
  alternative version control tools.

Added:
  head/share/examples/kld/firmware/fwimage/firmware.img.in
 - copied, changed from r220153, 
head/share/examples/kld/firmware/fwimage/firmware.img
Deleted:
  head/share/examples/kld/firmware/fwimage/firmware.img
Modified:
  head/share/examples/kld/firmware/fwimage/Makefile

Modified: head/share/examples/kld/firmware/fwimage/Makefile
==
--- head/share/examples/kld/firmware/fwimage/Makefile   Thu Mar 31 15:11:12 
2011(r220204)
+++ head/share/examples/kld/firmware/fwimage/Makefile   Thu Mar 31 15:12:40 
2011(r220205)
@@ -3,4 +3,8 @@
 KMOD=  beastie
 FIRMWS=firmware.img:beastie
 
+firmware.img: firmware.img.in
+   cp ${.ALLSRC} ${.TARGET}
+   printf '\0\0\0\0\0'  ${.TARGET}
+
 .include bsd.kmod.mk

Copied and modified: head/share/examples/kld/firmware/fwimage/firmware.img.in 
(from r220153, head/share/examples/kld/firmware/fwimage/firmware.img)
==
Files head/share/examples/kld/firmware/fwimage/firmware.img Wed Mar 30 
01:19:00 2011(r220153, copy source) and 
head/share/examples/kld/firmware/fwimage/firmware.img.in Thu Mar 31 
15:12:40 2011(r220205) differ
___
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: r220206 - head/sys/netipsec

2011-03-31 Thread Fabien Thomas
Author: fabient
Date: Thu Mar 31 15:23:32 2011
New Revision: 220206
URL: http://svn.freebsd.org/changeset/base/220206

Log:
  Optimisation in IPSEC(4):
  - Remove contention on ISR during the crypto operation by using rwlock(9).
  - Remove a second lookup of the SA in the callback.
  
  Gain on 6 cores CPU with SHA1/AES128 can be up to 30%.
  
  Reviewed by:  vanhu
  MFC after:1 month

Modified:
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/key.c
  head/sys/netipsec/key.h
  head/sys/netipsec/xform.h
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c
  head/sys/netipsec/xform_ipcomp.c

Modified: head/sys/netipsec/ipsec.h
==
--- head/sys/netipsec/ipsec.h   Thu Mar 31 15:12:40 2011(r220205)
+++ head/sys/netipsec/ipsec.h   Thu Mar 31 15:23:32 2011(r220206)
@@ -123,7 +123,7 @@ struct ipsecrequest {
 
struct secasvar *sav;   /* place holder of SA for use */
struct secpolicy *sp;   /* back pointer to SP */
-   struct mtx lock;/* to interlock updates */
+   struct rwlock lock; /* to interlock updates */
 };
 
 /*
@@ -132,11 +132,15 @@ struct ipsecrequest {
  * hard it is to remove this...
  */
 #defineIPSECREQUEST_LOCK_INIT(_isr) \
-   mtx_init((_isr)-lock, ipsec request, NULL, MTX_DEF | MTX_RECURSE)
-#defineIPSECREQUEST_LOCK(_isr) mtx_lock((_isr)-lock)
-#defineIPSECREQUEST_UNLOCK(_isr)   mtx_unlock((_isr)-lock)
-#defineIPSECREQUEST_LOCK_DESTROY(_isr) mtx_destroy((_isr)-lock)
-#defineIPSECREQUEST_LOCK_ASSERT(_isr)  mtx_assert((_isr)-lock, 
MA_OWNED)
+   rw_init_flags((_isr)-lock, ipsec request, RW_RECURSE)
+#defineIPSECREQUEST_LOCK(_isr) rw_rlock((_isr)-lock)
+#defineIPSECREQUEST_UNLOCK(_isr)   rw_runlock((_isr)-lock)
+#defineIPSECREQUEST_WLOCK(_isr)rw_wlock((_isr)-lock)
+#defineIPSECREQUEST_WUNLOCK(_isr)  rw_wunlock((_isr)-lock)
+#defineIPSECREQUEST_UPGRADE(_isr)  rw_try_upgrade((_isr)-lock)
+#defineIPSECREQUEST_DOWNGRADE(_isr)rw_downgrade((_isr)-lock)
+#defineIPSECREQUEST_LOCK_DESTROY(_isr) rw_destroy((_isr)-lock)
+#defineIPSECREQUEST_LOCK_ASSERT(_isr)  rw_assert((_isr)-lock, 
RA_LOCKED)
 
 /* security policy in PCB */
 struct inpcbpolicy {

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Thu Mar 31 15:12:40 2011(r220205)
+++ head/sys/netipsec/key.c Thu Mar 31 15:23:32 2011(r220206)
@@ -809,6 +809,7 @@ key_checkrequest(struct ipsecrequest *is
 {
u_int level;
int error;
+   struct secasvar *sav;
 
IPSEC_ASSERT(isr != NULL, (null isr));
IPSEC_ASSERT(saidx != NULL, (null saidx));
@@ -826,45 +827,31 @@ key_checkrequest(struct ipsecrequest *is
 
/* get current level */
level = ipsec_get_reqlevel(isr);
-#if 0
-   /*
-* We do allocate new SA only if the state of SA in the holder is
-* SADB_SASTATE_DEAD.  The SA for outbound must be the oldest.
-*/
-   if (isr-sav != NULL) {
-   if (isr-sav-sah == NULL)
-   panic(%s: sah is null.\n, __func__);
-   if (isr-sav == (struct secasvar *)LIST_FIRST(
-   isr-sav-sah-savtree[SADB_SASTATE_DEAD])) {
-   KEY_FREESAV(isr-sav);
-   isr-sav = NULL;
-   }
-   }
-#else
+
/*
-* we free any SA stashed in the IPsec request because a different
+* We check new SA in the IPsec request because a different
 * SA may be involved each time this request is checked, either
 * because new SAs are being configured, or this request is
 * associated with an unconnected datagram socket, or this request
 * is associated with a system default policy.
 *
-* The operation may have negative impact to performance.  We may
-* want to check cached SA carefully, rather than picking new SA
-* every time.
-*/
-   if (isr-sav != NULL) {
-   KEY_FREESAV(isr-sav);
-   isr-sav = NULL;
-   }
-#endif
-
-   /*
-* new SA allocation if no SA found.
 * key_allocsa_policy should allocate the oldest SA available.
 * See key_do_allocsa_policy(), and draft-jenkins-ipsec-rekeying-03.txt.
 */
-   if (isr-sav == NULL)
-   isr-sav = key_allocsa_policy(saidx);
+   sav = key_allocsa_policy(saidx);
+   if (sav != isr-sav) {
+   /* SA need to be updated. */
+   if (!IPSECREQUEST_UPGRADE(isr)) {
+   /* Kick everyone off. */
+   IPSECREQUEST_UNLOCK(isr);
+   IPSECREQUEST_WLOCK(isr);
+   }
+   if (isr-sav != NULL)
+  

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

2011-03-31 Thread Randall Stewart
John:

So I caught up with Dave Thaler here at the IETF...

He said that NO UDP socket that has NOT joined a multicast
group should ever receive a packet sent to a multicast address.
He also said this was part of the POSIX API and the way
all Unix machines worked. 

So.. no it is a bug and the fix is correct.

R
On Mar 29, 2011, at 2:01 PM, John Baldwin wrote:

 On Wednesday, January 19, 2011 2:07:16 pm Randall Stewart wrote:
 Author: rrs
 Date: Wed Jan 19 19:07:16 2011
 New Revision: 217592
 URL: http://svn.freebsd.org/changeset/base/217592
 
 Log:
  Fix a bug where Multicast packets sent from a
  udp endpoint may end up echoing back to the sender
  even with OUT joining the multi-cast group.
 
  Reviewed by:gnn, bms, bz?
  Obtained from:  deischen (with help from)
 
 Modified:
  head/sys/netinet/udp_usrreq.c
 
 Modified: head/sys/netinet/udp_usrreq.c
 
 ==
 --- head/sys/netinet/udp_usrreq.cWed Jan 19 18:20:11 2011
 (r217591)
 +++ head/sys/netinet/udp_usrreq.cWed Jan 19 19:07:16 2011
 (r217592)
 @@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off)
   * and source-specific multicast. [RFC3678]
   */
  imo = inp-inp_moptions;
 -if (IN_MULTICAST(ntohl(ip-ip_dst.s_addr)) 
 -imo != NULL) {
 +if (IN_MULTICAST(ntohl(ip-ip_dst.s_addr))) {
  struct sockaddr_in   group;
  int  blocked;
 -
 +if(imo == NULL) {
 +INP_RUNLOCK(inp);
 +continue;
 +}
  bzero(group, sizeof(struct sockaddr_in));
  group.sin_len = sizeof(struct sockaddr_in);
  group.sin_family = AF_INET;
 
 So it turns out that this is a feature, not a bug, and is how multicast has 
 always worked.  Specifically, if you bind a UDP socket with a wildcard 
 address, it should receive all traffic for the bound port, unicast or 
 multicast.  When you join a group, you have switched the socket into a mode 
 where it now has a whitelist of acceptable multicast groups, but if a socket 
 has no joined groups, it should receive all multicast traffic, not none.  
 This 
 change breaks that.
 
 I did not find this behavior intuitive at first, but it does seem to be 
 required.  Note the description of IP_ADD_MEMBERSHIP from RFC 3678 for 
 example:
 
 3.  Overview of APIs
 
   There are a number of different APIs described in this document that
   are appropriate for a number of different application types and IP
   versions.  Before providing detailed descriptions, this section
   provides a taxonomy with a brief description of each.
 
   There are two categories of source-filter APIs, both of which are
   designed to allow multicast receiver applications to designate the
   unicast address(es) of sender(s) along with the multicast group
   (destination address) to receive.
 
  o  Basic (Delta-based): Some applications desire the simplicity of
 a delta-based API in which each function call specifies a
 single source address which should be added to or removed from
 the existing filter for a given multicast group address on
 which to listen.  Such applications typically fall into either
 of two categories:
 
 +  Any-Source Multicast: By default, all sources are accepted.
Individual sources may be turned off and back on as needed
over time.  This is also known as exclude mode, since the
source filter contains a list of excluded sources.
 
 +  Source-Specific Multicast: Only sources in a given list are
allowed.  The list may change over time.  This is also known
as include mode, since the source filter contains a list
of included sources.
 
This API would be used, for example, by single-source
applications such as audio/video broadcasting.  It would
also be used for logical multi-source sessions where each
source independently allocates its own Source-Specific
Multicast group address.
 
 
 .
 
 4.1.1.  IPv4 Any-Source Multicast API
 
   The following socket options are defined in netinet/in.h for
   applications in the Any-Source Multicast category:
 
   Socket option Argument type
   IP_ADD_MEMBERSHIP struct ip_mreq
   IP_BLOCK_SOURCE   struct ip_mreq_source
   IP_UNBLOCK_SOURCE struct ip_mreq_source
   IP_DROP_MEMBERSHIPstruct ip_mreq
 
   IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP are already implemented on
   most operating systems, and are used to join and leave an any-source
   group.
 
   IP_BLOCK_SOURCE can 

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

2011-03-31 Thread Daniel Eischen

On Thu, 31 Mar 2011, Randall Stewart wrote:


John:

So I caught up with Dave Thaler here at the IETF...

He said that NO UDP socket that has NOT joined a multicast
group should ever receive a packet sent to a multicast address.
He also said this was part of the POSIX API and the way
all Unix machines worked.

So.. no it is a bug and the fix is correct.


Randall, thank you for following this up.  If we ever meet,
I owe you a beer (or drink of your choice) :-)

--
DE
___
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: r220209 - head/sys/geom/raid

2011-03-31 Thread Alexander Motin
Author: mav
Date: Thu Mar 31 16:14:35 2011
New Revision: 220209
URL: http://svn.freebsd.org/changeset/base/220209

Log:
  Bunch of small bugfixes and cleanups.
  
  Found with: Coverity Prevent(tm)
  CID:9656, 9658, 9693, 9705, 9706, 9707, 9808, 9809, 9810,
9711, 9712, 9713, 9714

Modified:
  head/sys/geom/raid/md_intel.c
  head/sys/geom/raid/md_jmicron.c
  head/sys/geom/raid/md_nvidia.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/md_sii.c
  head/sys/geom/raid/tr_raid1.c

Modified: head/sys/geom/raid/md_intel.c
==
--- head/sys/geom/raid/md_intel.c   Thu Mar 31 15:52:12 2011
(r220208)
+++ head/sys/geom/raid/md_intel.c   Thu Mar 31 16:14:35 2011
(r220209)
@@ -541,9 +541,9 @@ intel_meta_write_spare(struct g_consumer
 
/* Fill anchor and single disk. */
meta = malloc(INTEL_MAX_MD_SIZE(1), M_MD_INTEL, M_WAITOK | M_ZERO);
-   memcpy(meta-intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC));
+   memcpy(meta-intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1);
memcpy(meta-version[0], INTEL_VERSION_1000,
-   sizeof(INTEL_VERSION_1000));
+   sizeof(INTEL_VERSION_1000) - 1);
meta-config_size = INTEL_MAX_MD_SIZE(1);
meta-config_id = arc4random();
meta-generation = 1;
@@ -1881,10 +1881,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
/* If disk was assigned, just update statuses. */
if (pd-pd_disk_pos = 0) {
g_raid_change_disk_state(disk, 
G_RAID_DISK_S_OFFLINE);
-   if (disk-d_consumer) {
-   g_raid_kill_consumer(sc, 
disk-d_consumer);
-   disk-d_consumer = NULL;
-   }
+   g_raid_kill_consumer(sc, disk-d_consumer);
+   disk-d_consumer = NULL;
TAILQ_FOREACH(sd, disk-d_subdisks, sd_next) {
g_raid_change_subdisk_state(sd,
G_RAID_SUBDISK_S_NONE);
@@ -2049,7 +2047,7 @@ g_raid_md_write_intel(struct g_raid_md_o
/* Fill anchor and disks. */
meta = malloc(INTEL_MAX_MD_SIZE(numdisks),
M_MD_INTEL, M_WAITOK | M_ZERO);
-   memcpy(meta-intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC));
+   memcpy(meta-intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1);
meta-config_size = INTEL_MAX_MD_SIZE(numdisks);
meta-config_id = mdi-mdio_config_id;
meta-generation = mdi-mdio_generation;
@@ -2214,7 +2212,7 @@ g_raid_md_write_intel(struct g_raid_md_o
meta-total_volumes = vi;
if (strcmp(version, INTEL_VERSION_1300) != 0)
meta-attributes = INTEL_ATTR_CHECKSUM;
-   memcpy(meta-version[0], version, sizeof(INTEL_VERSION_1000));
+   memcpy(meta-version[0], version, sizeof(INTEL_VERSION_1000) - 1);
 
/* We are done. Print meta data and store them to disks. */
g_raid_md_intel_print(meta);

Modified: head/sys/geom/raid/md_jmicron.c
==
--- head/sys/geom/raid/md_jmicron.c Thu Mar 31 15:52:12 2011
(r220208)
+++ head/sys/geom/raid/md_jmicron.c Thu Mar 31 16:14:35 2011
(r220209)
@@ -431,7 +431,10 @@ g_raid_md_jmicron_start_disk(struct g_ra
olddisk = NULL;
 
/* Find disk position in metadata by it's serial. */
-   disk_pos = jmicron_meta_find_disk(meta, pd-pd_disk_id);
+   if (pd-pd_meta != NULL)
+   disk_pos = jmicron_meta_find_disk(meta, pd-pd_disk_id);
+   else
+   disk_pos = -1;
if (disk_pos  0) {
G_RAID_DEBUG1(1, sc, Unknown, probably new or stale disk);
/* If we are in the start process, that's all for now. */
@@ -522,7 +525,7 @@ nofit:
 * Different disks may have different sizes/offsets,
 * especially in concat mode. Update.
 */
-   if (pd-pd_meta != NULL  !resurrection) {
+   if (!resurrection) {
sd-sd_offset =
(off_t)pd-pd_meta-offset * 16 * 512; //ZZZ
sd-sd_size =
@@ -1300,10 +1303,8 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o
/* If disk was assigned, just update statuses. */
if (pd-pd_disk_pos = 0) {
g_raid_change_disk_state(disk, 
G_RAID_DISK_S_OFFLINE);
-   if (disk-d_consumer) {
-   g_raid_kill_consumer(sc, 
disk-d_consumer);
-   disk-d_consumer = NULL;
-   }
+   g_raid_kill_consumer(sc, 

svn commit: r220210 - head/sys/geom/raid

2011-03-31 Thread Alexander Motin
Author: mav
Date: Thu Mar 31 16:19:53 2011
New Revision: 220210
URL: http://svn.freebsd.org/changeset/base/220210

Log:
  Bunch of small bugfixes and cleanups.
  
  Found with:   Clang Static Analyzer

Modified:
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/md_intel.c
  head/sys/geom/raid/md_jmicron.c
  head/sys/geom/raid/md_nvidia.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/md_sii.c
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c

Modified: head/sys/geom/raid/g_raid.c
==
--- head/sys/geom/raid/g_raid.c Thu Mar 31 16:14:35 2011(r220209)
+++ head/sys/geom/raid/g_raid.c Thu Mar 31 16:19:53 2011(r220210)
@@ -1608,7 +1608,7 @@ g_raid_access(struct g_provider *pp, int
 {
struct g_raid_volume *vol;
struct g_raid_softc *sc;
-   int dcr, dcw, dce, opens, error = 0;
+   int dcw, opens, error = 0;
 
g_topology_assert();
sc = pp-geom-softc;
@@ -1618,10 +1618,7 @@ g_raid_access(struct g_provider *pp, int
 
G_RAID_DEBUG1(2, sc, Access request for %s: r%dw%de%d., pp-name,
acr, acw, ace);
-
-   dcr = pp-acr + acr;
dcw = pp-acw + acw;
-   dce = pp-ace + ace;
 
g_topology_unlock();
sx_xlock(sc-sc_lock);

Modified: head/sys/geom/raid/md_intel.c
==
--- head/sys/geom/raid/md_intel.c   Thu Mar 31 16:14:35 2011
(r220209)
+++ head/sys/geom/raid/md_intel.c   Thu Mar 31 16:19:53 2011
(r220210)
@@ -1153,7 +1153,6 @@ g_raid_md_taste_intel(struct g_raid_md_o
 
/* Read metadata from device. */
meta = NULL;
-   spare = 0;
vendor = 0x;
disk_pos = 0;
if (g_access(cp, 1, 0, 0) != 0)
@@ -1431,7 +1430,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
gctl_error(req, Can't open disk '%s'.,
diskname);
g_topology_unlock();
-   error = -4;
+   error = -7;
break;
}
pp = cp-provider;
@@ -1481,6 +1480,11 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
if (error != 0)
return (error);
 
+   if (sectorsize = 0) {
+   gctl_error(req, Can't get sector size.);
+   return (-8);
+   }
+
/* Reserve some space for metadata. */
size -= ((4096 + sectorsize - 1) / sectorsize) * sectorsize;
 
@@ -1953,7 +1957,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj
 
disk = g_raid_create_disk(sc);
disk-d_consumer = cp;
-   disk-d_consumer-private = disk;
disk-d_md_data = (void *)pd;
cp-private = disk;
 

Modified: head/sys/geom/raid/md_jmicron.c
==
--- head/sys/geom/raid/md_jmicron.c Thu Mar 31 16:14:35 2011
(r220209)
+++ head/sys/geom/raid/md_jmicron.c Thu Mar 31 16:19:53 2011
(r220210)
@@ -579,14 +579,12 @@ g_raid_md_jmicron_refill(struct g_raid_s
 {
struct g_raid_md_object *md;
struct g_raid_md_jmicron_object *mdi;
-   struct jmicron_raid_conf *meta;
struct g_raid_disk *disk;
struct task *task;
int update, na;
 
md = sc-sc_md;
mdi = (struct g_raid_md_jmicron_object *)md;
-   meta = mdi-mdio_meta;
update = 0;
do {
/* Make sure we miss anything. */
@@ -620,10 +618,8 @@ g_raid_md_jmicron_refill(struct g_raid_s
} while (disk != NULL);
 
/* Write new metadata if we changed something. */
-   if (update) {
+   if (update)
g_raid_md_write_jmicron(md, NULL, NULL, NULL);
-   meta = mdi-mdio_meta;
-   }
 
/* Update status of our need for spare. */
mdi-mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) 
@@ -835,9 +831,7 @@ g_raid_md_taste_jmicron(struct g_raid_md
 
/* Read metadata from device. */
meta = NULL;
-   spare = 0;
vendor = 0x;
-   disk_pos = 0;
if (g_access(cp, 1, 0, 0) != 0)
return (G_RAID_MD_TASTE_FAIL);
g_topology_unlock();
@@ -1133,6 +1127,11 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o
if (error != 0)
return (error);
 
+   if (sectorsize = 0) {
+   gctl_error(req, Can't get sector size.);
+   return (-8);
+   }
+
/* Reserve space for metadata. */
size -= sectorsize;
 
@@ -1364,7 +1363,6 @@ 

svn commit: r220211 - head/sys/netinet/ipfw

2011-03-31 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar 31 16:30:14 2011
New Revision: 220211
URL: http://svn.freebsd.org/changeset/base/220211

Log:
  Fill up src_port and dst_port variables for SCTP over IPv4.
  
  PR:   kern/153415
  MFC after:1 week

Modified:
  head/sys/netinet/ipfw/ip_fw2.c

Modified: head/sys/netinet/ipfw/ip_fw2.c
==
--- head/sys/netinet/ipfw/ip_fw2.c  Thu Mar 31 16:19:53 2011
(r220210)
+++ head/sys/netinet/ipfw/ip_fw2.c  Thu Mar 31 16:30:14 2011
(r220211)
@@ -1123,6 +1123,12 @@ do { 
\
args-f_id._flags = TCP(ulp)-th_flags;
break;
 
+   case IPPROTO_SCTP:
+   PULLUP_TO(hlen, ulp, struct sctphdr);
+   src_port = SCTP(ulp)-src_port;
+   dst_port = SCTP(ulp)-dest_port;
+   break;
+
case IPPROTO_UDP:
PULLUP_TO(hlen, ulp, struct udphdr);
dst_port = UDP(ulp)-uh_dport;
___
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: r220228 - head/sys/dev/bxe

2011-03-31 Thread David Christensen
Author: davidch
Date: Thu Mar 31 22:04:00 2011
New Revision: 220228
URL: http://svn.freebsd.org/changeset/base/220228

Log:
  - Fixed DMA engine errors by increasing timeouts to 200ms for reads/writes.
  - Improved some error reporting calls to include file name/line number.
  - Various style(9) fixes.
  
  MFC after:One week.

Modified:
  head/sys/dev/bxe/if_bxe.c

Modified: head/sys/dev/bxe/if_bxe.c
==
--- head/sys/dev/bxe/if_bxe.c   Thu Mar 31 21:33:33 2011(r220227)
+++ head/sys/dev/bxe/if_bxe.c   Thu Mar 31 22:04:00 2011(r220228)
@@ -458,9 +458,7 @@ SYSCTL_UINT(_hw_bxe, OID_AUTO, tpa_enabl
 
 /*
  * Specifies the number of queues that will be used when a multi-queue
- * RSS mode is selected  using bxe_multi_mode below.  Some RSS modes
- * require additional queue configuration which may conflict with this
- * setting.  In that case this value will be overriden.
+ * RSS mode is selected  using bxe_multi_mode below.
  *
  * Allowable values are 0 (Auto) or 1 to MAX_CONTEXT (fixed queue number).
  */
@@ -1145,7 +1143,7 @@ bxe_interrupt_allocate(struct bxe_softc 
break;
}
} else {
-   /* User has forced INTx mode. */
+   /* User has forced INTx mode. */
sc-multi_mode = ETH_RSS_MODE_DISABLED;
sc-num_queues = 1;
}
@@ -1451,7 +1449,7 @@ bxe_interrupt_attach(struct bxe_softc *s
%s(): Enabling slowpath MSI[0] vector.\n,
__FUNCTION__);
/*
-* Setup the interrupt handler.  Note that we pass the driver
+* Setup the interrupt handler. Note that we pass the driver
 * instance to the interrupt handler for the slowpath.
 */
rc = bus_setup_intr(sc-bxe_dev,sc-bxe_msi_res[0],
@@ -1477,7 +1475,7 @@ bxe_interrupt_attach(struct bxe_softc *s
%s(): Enabling MSI[%d] vector.\n,
__FUNCTION__, i + 1);
/*
-* Setup the interrupt handler.  Note that we pass the
+* Setup the interrupt handler. Note that we pass the
 * fastpath context to the interrupt handler in this
 * case.
 */
@@ -1762,7 +1760,7 @@ bxe_attach(device_t dev)
 
/* Put indirect address registers into a sane state. */
pci_write_config(sc-bxe_dev, PCICFG_GRC_ADDRESS,
-   PCICFG_VENDOR_ID_OFFSET, 4);
+   PCICFG_VENDOR_ID_OFFSET, 4);
REG_WR(sc, PXP2_REG_PGL_ADDR_88_F0 + BP_PORT(sc) * 16, 0);
REG_WR(sc, PXP2_REG_PGL_ADDR_8C_F0 + BP_PORT(sc) * 16, 0);
REG_WR(sc, PXP2_REG_PGL_ADDR_90_F0 + BP_PORT(sc) * 16, 0);
@@ -1829,7 +1827,8 @@ bxe_attach(device_t dev)
/* Set init arrays */
rc = bxe_init_firmware(sc);
if (rc) {
-   BXE_PRINTF(Error loading firmware\n);
+   BXE_PRINTF(%s(%d): Error loading firmware\n,
+   __FILE__, __LINE__);
goto bxe_attach_fail;
}
 
@@ -1846,8 +1845,8 @@ bxe_attach(device_t dev)
 
/* Check that NVRAM contents are valid.*/
if (bxe_nvram_test(sc)) {
-   DBPRINT(sc, BXE_WARN, %s(): Failed NVRAM test!\n,
-   __FUNCTION__);
+   BXE_PRINTF(%s(%d): Failed NVRAM test!\n,
+   __FILE__, __LINE__);
rc = ENODEV;
goto bxe_attach_fail;
}
@@ -1855,7 +1854,7 @@ bxe_attach(device_t dev)
/* Allocate the appropriate interrupts.*/
if (bxe_interrupt_allocate(sc)) {
BXE_PRINTF(%s(%d): Interrupt allocation failed!\n,
-   __FILE__, __LINE__);
+   __FILE__, __LINE__);
rc = ENODEV;
goto bxe_attach_fail;
}
@@ -1902,10 +1901,13 @@ bxe_attach(device_t dev)
/* Disable WoL. */
sc-wol = 0;
 
+   /* Assume a standard 1500 byte MTU size for mbuf allocations. */
+   sc-mbuf_alloc_size  = MCLBYTES;
+
/* Allocate DMA memory resources. */
if (bxe_dma_alloc(sc-bxe_dev)) {
BXE_PRINTF(%s(%d): DMA allocation failed!\n,
-   __FILE__, __LINE__);
+   __FILE__, __LINE__);
rc = ENOMEM;
goto bxe_attach_fail;
}
@@ -1914,7 +1916,7 @@ bxe_attach(device_t dev)
ifp = sc-bxe_ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
BXE_PRINTF(%s(%d): Interface allocation failed!\n,
-   __FILE__, __LINE__);
+   __FILE__, __LINE__);
rc = ENXIO;
goto bxe_attach_fail;
}
@@ -1935,8 +1937,6 @@ bxe_attach(device_t dev)
ifp-if_capenable = ifp-if_capabilities;
  

svn commit: r220229 - head/sys/dev/bxe

2011-03-31 Thread David Christensen
Author: davidch
Date: Thu Mar 31 22:40:44 2011
New Revision: 220229
URL: http://svn.freebsd.org/changeset/base/220229

Log:
  - Freshened debug support code.
  - Renamed several RX variable for more consistent usage.
  - Fixed a potential problem when masking RX CQ producer value.
  
  MFC after:One week.

Modified:
  head/sys/dev/bxe/if_bxe.c
  head/sys/dev/bxe/if_bxe.h

Modified: head/sys/dev/bxe/if_bxe.c
==
--- head/sys/dev/bxe/if_bxe.c   Thu Mar 31 22:04:00 2011(r220228)
+++ head/sys/dev/bxe/if_bxe.c   Thu Mar 31 22:40:44 2011(r220229)
@@ -68,7 +68,8 @@ __FBSDID($FreeBSD$);
 
 /* BXE Debug Options */
 #ifdef BXE_DEBUG
-   uint32_t bxe_debug = BXE_INFO;
+uint32_t bxe_debug = BXE_INFO;
+
 
 /*  0 = Never  */
 /*  1 = 1 in 2,147,483,648 */
@@ -345,8 +346,8 @@ int  bxe_set_gpio_int(struct bxe_softc *
 static int bxe_sysctl_driver_state(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_hw_state(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_dump_fw(SYSCTL_HANDLER_ARGS);
-static int bxe_sysctl_dump_cqe_chain(SYSCTL_HANDLER_ARGS);
-static int bxe_sysctl_dump_rx_chain(SYSCTL_HANDLER_ARGS);
+static int bxe_sysctl_dump_rx_cq_chain(SYSCTL_HANDLER_ARGS);
+static int bxe_sysctl_dump_rx_bd_chain(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_dump_tx_chain(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_reg_read(SYSCTL_HANDLER_ARGS);
 static int bxe_sysctl_breakpoint(SYSCTL_HANDLER_ARGS);
@@ -357,16 +358,16 @@ static void bxe_dump_enet(struct bxe_sof
 static void bxe_dump_mbuf (struct bxe_softc *, struct mbuf *);
 static void bxe_dump_tx_mbuf_chain(struct bxe_softc *, int, int);
 static void bxe_dump_rx_mbuf_chain(struct bxe_softc *, int, int);
-static void bxe_dump_pbd_locked(struct bxe_softc *,int,
+static void bxe_dump_tx_parsing_bd(struct bxe_fastpath *,int,
struct eth_tx_parse_bd *);
-static void bxe_dump_txbd_locked(struct bxe_fastpath *, int,
-   struct eth_tx_bd *);
-static void bxe_dump_rxbd_locked(struct bxe_fastpath *, int,
+static void bxe_dump_txbd(struct bxe_fastpath *, int,
+   union eth_tx_bd_types *);
+static void bxe_dump_rxbd(struct bxe_fastpath *, int,
struct eth_rx_bd *);
-static void bxe_dump_cqe_locked(struct bxe_fastpath *, int, union eth_rx_cqe 
*);
+static void bxe_dump_cqe(struct bxe_fastpath *, int, union eth_rx_cqe *);
 static void bxe_dump_tx_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_cqe_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_rx_chain(struct bxe_fastpath *, int, int);
+static void bxe_dump_rx_cq_chain(struct bxe_fastpath *, int, int);
+static void bxe_dump_rx_bd_chain(struct bxe_fastpath *, int, int);
 static void bxe_dump_status_block(struct bxe_softc *);
 static void bxe_dump_stats_block(struct bxe_softc *);
 static void bxe_dump_fp_state(struct bxe_fastpath *);
@@ -404,6 +405,7 @@ static device_method_t bxe_methods[] = {
KOBJMETHOD_END
 };
 
+
 static driver_t bxe_driver = {
bxe,
bxe_methods,
@@ -1725,11 +1727,11 @@ bxe_attach(device_t dev)
 * processor memory.
 */
rid = PCIR_BAR(0);
-   sc-bxe_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-   rid, RF_ACTIVE);
+   sc-bxe_res = bus_alloc_resource_any(dev,
+   SYS_RES_MEMORY, rid, RF_ACTIVE);
if (sc-bxe_res == NULL) {
BXE_PRINTF(%s(%d):PCI BAR0 memory allocation failed\n,
-   __FILE__, __LINE__);
+   __FILE__, __LINE__);
rc = ENXIO;
goto bxe_attach_fail;
}
@@ -1744,11 +1746,11 @@ bxe_attach(device_t dev)
 * Doorbell (DB) memory.
 */
rid = PCIR_BAR(2);
-   sc-bxe_db_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-   rid, RF_ACTIVE);
+   sc-bxe_db_res = bus_alloc_resource_any(dev,
+   SYS_RES_MEMORY, rid, RF_ACTIVE);
if (sc-bxe_db_res == NULL) {
BXE_PRINTF(%s(%d): PCI BAR2 memory allocation failed\n,
-   __FILE__, __LINE__);
+   __FILE__, __LINE__);
rc = ENXIO;
goto bxe_attach_fail;
}
@@ -1834,7 +1836,6 @@ bxe_attach(device_t dev)
 
 
 #ifdef BXE_DEBUG
-
/* Allocate a memory buffer for grcdump output.*/
sc-grcdump_buffer = malloc(BXE_GRCDUMP_BUF_SIZE, M_TEMP, M_NOWAIT);
if (sc-grcdump_buffer == NULL) {
@@ -3738,8 +3739,8 @@ bxe_init_locked(struct bxe_softc *sc, in
callout_reset(sc-bxe_tick_callout, hz, bxe_tick, sc);
/* Everything went OK, go ahead and exit. */
goto bxe_init_locked_exit;
+
/* Try and gracefully shutdown the device because of a failure. */
-/* Try and gracefully shutdown the device because of a failure. */
 bxe_init_locked_failed4:
 
for (i = 1; i  sc-num_queues; i++)
@@ -4413,6 +4414,7 @@ bxe_write_dmae(struct bxe_softc *sc, bus
 

svn commit: r220230 - head/sys/dev/bxe

2011-03-31 Thread David Christensen
Author: davidch
Date: Thu Mar 31 22:50:55 2011
New Revision: 220230
URL: http://svn.freebsd.org/changeset/base/220230

Log:
  - Fixed build problem when not useing BXE_DEBUG.
  
  MFC after:One week.

Modified:
  head/sys/dev/bxe/if_bxe.c

Modified: head/sys/dev/bxe/if_bxe.c
==
--- head/sys/dev/bxe/if_bxe.c   Thu Mar 31 22:40:44 2011(r220229)
+++ head/sys/dev/bxe/if_bxe.c   Thu Mar 31 22:50:55 2011(r220230)
@@ -15627,13 +15627,6 @@ bxe_add_sysctls(struct bxe_softc *sc)
SYSCTL_CHILDREN(device_get_sysctl_tree(sc-bxe_dev));
struct bxe_eth_stats *estats = sc-eth_stats;
 
-   struct sysctl_oid *queue_node;
-   struct sysctl_oid_list *queue_list;
-
-#define QUEUE_NAME_LEN 32
-   char namebuf[QUEUE_NAME_LEN];
-
-
SYSCTL_ADD_UINT(ctx, children, OID_AUTO,
estats_total_bytes_received_hi,
CTLFLAG_RD, estats-total_bytes_received_hi,
@@ -15747,28 +15740,36 @@ bxe_add_sysctls(struct bxe_softc *sc)
CTLFLAG_RD, sc-mbuf_alloc_failed, 0,
mbuf cluster allocation failures);
 
-   for (int i = 0; i  sc-num_queues; i++) {
-   struct bxe_fastpath *fp = sc-fp[i];
-   snprintf(namebuf, QUEUE_NAME_LEN, fp[%02d], i);
-
-   queue_node = SYSCTL_ADD_NODE(ctx, children, OID_AUTO,
-   namebuf, CTLFLAG_RD, NULL, Queue Name);
-   queue_list = SYSCTL_CHILDREN(queue_node);
-
-   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
-   mbuf_alloc_failed,
-   CTLFLAG_RD, fp-mbuf_alloc_failed,
-   Mbuf allocation failures);
-
-   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
-   mbuf_defrag_attempts,
-   CTLFLAG_RD, fp-mbuf_defrag_attempts,
-   Mbuf defrag attempts);
-
-   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
-   mbuf_defrag_successes,
-   CTLFLAG_RD, fp-mbuf_defrag_successes,
-   Mbuf defrag successes);
+   do() {
+#define QUEUE_NAME_LEN 32
+   char namebuf[QUEUE_NAME_LEN];
+   struct sysctl_oid *queue_node;
+   struct sysctl_oid_list *queue_list;
+
+   for (int i = 0; i  sc-num_queues; i++) {
+   struct bxe_fastpath *fp = sc-fp[i];
+   snprintf(namebuf, QUEUE_NAME_LEN, fp[%02d], i);
+
+   queue_node = SYSCTL_ADD_NODE(ctx, children, OID_AUTO,
+   namebuf, CTLFLAG_RD, NULL, Queue Name);
+   queue_list = SYSCTL_CHILDREN(queue_node);
+
+   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+   mbuf_alloc_failed,
+   CTLFLAG_RD, fp-mbuf_alloc_failed,
+   Mbuf allocation failures);
+
+   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+   mbuf_defrag_attempts,
+   CTLFLAG_RD, fp-mbuf_defrag_attempts,
+   Mbuf defrag attempts);
+
+   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+   mbuf_defrag_successes,
+   CTLFLAG_RD, fp-mbuf_defrag_successes,
+   Mbuf defrag successes);
+   }
+
}
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, driver_state,
___
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: r220231 - in head/sys/modules/cxgbe: . if_cxgbe

2011-03-31 Thread Navdeep Parhar
Author: np
Date: Fri Apr  1 00:25:32 2011
New Revision: 220231
URL: http://svn.freebsd.org/changeset/base/220231

Log:
  Allow multiple modules within sys/modules/cxgbe.  The first one is if_cxgbe.
  
  MFC after:3 days

Added:
  head/sys/modules/cxgbe/if_cxgbe/
  head/sys/modules/cxgbe/if_cxgbe/Makefile
 - copied, changed from r220221, head/sys/modules/cxgbe/Makefile
Replaced:
  head/sys/modules/cxgbe/Makefile   (contents, props changed)

Added: head/sys/modules/cxgbe/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/cxgbe/Makefile Fri Apr  1 00:25:32 2011
(r220231)
@@ -0,0 +1,7 @@
+#
+# $FreeBSD$
+#
+
+SUBDIR = if_cxgbe
+
+.include bsd.subdir.mk

Copied and modified: head/sys/modules/cxgbe/if_cxgbe/Makefile (from r220221, 
head/sys/modules/cxgbe/Makefile)
==
--- head/sys/modules/cxgbe/Makefile Thu Mar 31 18:35:44 2011
(r220221, copy source)
+++ head/sys/modules/cxgbe/if_cxgbe/MakefileFri Apr  1 00:25:32 2011
(r220231)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 #
 
-CXGBE = ${.CURDIR}/../../dev/cxgbe
+CXGBE = ${.CURDIR}/../../../dev/cxgbe
 .PATH: ${CXGBE} ${CXGBE}/common
 
 KMOD = if_cxgbe
@@ -11,6 +11,6 @@ SRCS+= t4_hw.c
 SRCS+= device_if.h bus_if.h pci_if.h
 SRCS+= opt_inet.h
 
-CFLAGS+= -g -I${CXGBE}
+CFLAGS+= -I${CXGBE}
 
 .include bsd.kmod.mk
___
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: r220232 - in head/sys/dev/cxgbe: . common

2011-03-31 Thread Navdeep Parhar
Author: np
Date: Fri Apr  1 00:40:24 2011
New Revision: 220232
URL: http://svn.freebsd.org/changeset/base/220232

Log:
  Update header and related code for firmware 1.3.8
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4fw_interface.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/common/common.h
==
--- head/sys/dev/cxgbe/common/common.h  Fri Apr  1 00:25:32 2011
(r220231)
+++ head/sys/dev/cxgbe/common/common.h  Fri Apr  1 00:40:24 2011
(r220232)
@@ -54,7 +54,7 @@ enum {
 
 #define FW_VERSION_MAJOR 1
 #define FW_VERSION_MINOR 3
-#define FW_VERSION_MICRO 0
+#define FW_VERSION_MICRO 8
 
 struct port_stats {
u64 tx_octets;/* total # of octets in good frames */

Modified: head/sys/dev/cxgbe/common/t4fw_interface.h
==
--- head/sys/dev/cxgbe/common/t4fw_interface.h  Fri Apr  1 00:25:32 2011
(r220231)
+++ head/sys/dev/cxgbe/common/t4fw_interface.h  Fri Apr  1 00:40:24 2011
(r220232)
@@ -47,7 +47,7 @@ enum fw_retval {
FW_ENOSYS   = 38,   /* functionality not implemented */
FW_EPROTO   = 71,   /* protocol error */
FW_ETIMEDOUT= 110,  /* timeout */
-   FW_TIMEDOUT = 110,  /* timeout */
+   FW_EINPROGRESS  = 115,  /* fw internal */
FW_SCSI_ABORT_REQUESTED = 128,  /* */
FW_SCSI_ABORT_TIMEDOUT  = 129,  /* */
FW_SCSI_ABORTED = 130,  /* */
@@ -3934,13 +3934,11 @@ enum fw_port_cap {
FW_PORT_CAP_FC_RX   = 0x0040,
FW_PORT_CAP_FC_TX   = 0x0080,
FW_PORT_CAP_ANEG= 0x0100,
-   FW_PORT_CAP_MDI_0   = 0x0200,
-   FW_PORT_CAP_MDI_1   = 0x0400,
-   FW_PORT_CAP_BEAN= 0x0800,
-   FW_PORT_CAP_PMA_LPBK= 0x1000,
-   FW_PORT_CAP_PCS_LPBK= 0x2000,
-   FW_PORT_CAP_PHYXS_LPBK  = 0x4000,
-   FW_PORT_CAP_FAR_END_LPBK= 0x8000,
+   FW_PORT_CAP_MDIX= 0x0200,
+   FW_PORT_CAP_MDIAUTO = 0x0400,
+   FW_PORT_CAP_FEC = 0x0800,
+   FW_PORT_CAP_TECHKR  = 0x1000,
+   FW_PORT_CAP_TECHKX4 = 0x2000,
 };
 
 #define S_FW_PORT_CAP_SPEED0
@@ -3955,6 +3953,12 @@ enum fw_port_cap {
 #define G_FW_PORT_CAP_FC(x) \
 (((x)  S_FW_PORT_CAP_FC)  M_FW_PORT_CAP_FC)
 
+#define S_FW_PORT_CAP_ANEG 8
+#define M_FW_PORT_CAP_ANEG 0x1
+#define V_FW_PORT_CAP_ANEG(x)  ((x)  S_FW_PORT_CAP_ANEG)
+#define G_FW_PORT_CAP_ANEG(x) \
+(((x)  S_FW_PORT_CAP_ANEG)  M_FW_PORT_CAP_ANEG)
+
 enum fw_port_mdi {
FW_PORT_CAP_MDI_UNCHANGED,
FW_PORT_CAP_MDI_AUTO,
@@ -4253,16 +4257,16 @@ enum fw_port_type {
 /* These are read from module's EEPROM and determined once the
module is inserted. */
 enum fw_port_module_type {
-   FW_PORT_MOD_TYPE_NA,
-   FW_PORT_MOD_TYPE_LR = 0x1,
-   FW_PORT_MOD_TYPE_SR = 0x2,
-   FW_PORT_MOD_TYPE_ER = 0x3,
-   FW_PORT_MOD_TYPE_TWINAX_PASSIVE = 0x4,
-   FW_PORT_MOD_TYPE_TWINAX_ACTIVE = 0x5,
-
-   FW_PORT_MOD_TYPE_LRM = 0x6,
-
-   FW_PORT_MOD_TYPE_NONE = M_FW_PORT_CMD_MODTYPE
+   FW_PORT_MOD_TYPE_NA = 0x0,
+   FW_PORT_MOD_TYPE_LR = 0x1,
+   FW_PORT_MOD_TYPE_SR = 0x2,
+   FW_PORT_MOD_TYPE_ER = 0x3,
+   FW_PORT_MOD_TYPE_TWINAX_PASSIVE = 0x4,
+   FW_PORT_MOD_TYPE_TWINAX_ACTIVE  = 0x5,
+   FW_PORT_MOD_TYPE_LRM= 0x6,
+   FW_PORT_MOD_TYPE_UNKNOWN= M_FW_PORT_CMD_MODTYPE - 2,
+   FW_PORT_MOD_TYPE_NOTSUPPORTED   = M_FW_PORT_CMD_MODTYPE - 1,
+   FW_PORT_MOD_TYPE_NONE   = M_FW_PORT_CMD_MODTYPE
 };
 
 /* used by FW and tools may use this to generate VPD */

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Apr  1 00:25:32 2011
(r220231)
+++ head/sys/dev/cxgbe/t4_main.cFri Apr  1 00:40:24 2011
(r220232)
@@ -2748,11 +2748,15 @@ t4_os_portmod_changed(const struct adapt
 {
struct port_info *pi = sc-port[idx];
static const char *mod_str[] = {
-   NULL, LR, SR, ER, TWINAX, active TWINAX
+   NULL, LR, SR, ER, TWINAX, active TWINAX, LRM
};
 
if (pi-mod_type == FW_PORT_MOD_TYPE_NONE)
if_printf(pi-ifp, transceiver unplugged.\n);
+   else if (pi-mod_type == FW_PORT_MOD_TYPE_UNKNOWN)
+   if_printf(pi-ifp, unknown transceiver inserted.\n);
+   else if (pi-mod_type == FW_PORT_MOD_TYPE_NOTSUPPORTED)
+   if_printf(pi-ifp, unsupported transceiver inserted.\n);
else if (pi-mod_type  0  pi-mod_type  ARRAY_SIZE(mod_str)) {
   

svn commit: r220233 - head/share/examples

2011-03-31 Thread Ed Maste
Author: emaste
Date: Fri Apr  1 01:13:30 2011
New Revision: 220233
URL: http://svn.freebsd.org/changeset/base/220233

Log:
  Unbreak installworld after r220205.
  
  Noticed by:   np
  Pointy hat to:emaste

Modified:
  head/share/examples/Makefile

Modified: head/share/examples/Makefile
==
--- head/share/examples/MakefileFri Apr  1 00:40:24 2011
(r220232)
+++ head/share/examples/MakefileFri Apr  1 01:13:30 2011
(r220233)
@@ -99,7 +99,7 @@ XFILES=   BSD_daemon/FreeBSD.pfa \
kld/firmware/fwconsumer/Makefile \
kld/firmware/fwconsumer/fw_consumer.c \
kld/firmware/fwimage/Makefile \
-   kld/firmware/fwimage/firmware.img \
+   kld/firmware/fwimage/firmware.img.in \
kld/khelp/Makefile \
kld/khelp/README \
kld/khelp/h_example.c \
___
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: r220234 - head/sys/dev/bxe

2011-03-31 Thread Pyun YongHyeon
Author: yongari
Date: Fri Apr  1 01:30:21 2011
New Revision: 220234
URL: http://svn.freebsd.org/changeset/base/220234

Log:
  Make bxe(4) build with BXE_DEBUG.

Modified:
  head/sys/dev/bxe/if_bxe.c

Modified: head/sys/dev/bxe/if_bxe.c
==
--- head/sys/dev/bxe/if_bxe.c   Fri Apr  1 01:13:30 2011(r220233)
+++ head/sys/dev/bxe/if_bxe.c   Fri Apr  1 01:30:21 2011(r220234)
@@ -15740,7 +15740,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
CTLFLAG_RD, sc-mbuf_alloc_failed, 0,
mbuf cluster allocation failures);
 
-   do() {
+   do {
 #define QUEUE_NAME_LEN 32
char namebuf[QUEUE_NAME_LEN];
struct sysctl_oid *queue_node;
@@ -15770,7 +15770,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
Mbuf defrag successes);
}
 
-   }
+   } while (0);
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, driver_state,
CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 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: r220235 - head/sys/dev/usb/wlan

2011-03-31 Thread Kevin Lo
Author: kevlo
Date: Fri Apr  1 03:27:55 2011
New Revision: 220235
URL: http://svn.freebsd.org/changeset/base/220235

Log:
  - Minor style(9) cleanup
  - Make functions static

Modified:
  head/sys/dev/usb/wlan/if_run.c

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Fri Apr  1 01:30:21 2011
(r220234)
+++ head/sys/dev/usb/wlan/if_run.c  Fri Apr  1 03:27:55 2011
(r220235)
@@ -71,8 +71,8 @@ __FBSDID($FreeBSD$);
 #define USB_DEBUG_VAR run_debug
 #include dev/usb/usb_debug.h
 
-#include if_runreg.h
-#include if_runvar.h
+#include dev/usb/wlan/if_runreg.h
+#include dev/usb/wlan/if_runvar.h
 
 #define nitems(_a)  (sizeof((_a)) / sizeof((_a)[0]))
 
@@ -523,7 +523,7 @@ static const struct usb_config run_confi
 }
 };
 
-int
+static int
 run_match(device_t self)
 {
struct usb_attach_arg *uaa = device_get_ivars(self);
@@ -604,7 +604,7 @@ run_attach(device_t self)
RUN_UNLOCK(sc);
 
ifp = sc-sc_ifp = if_alloc(IFT_IEEE80211);
-   if(ifp == NULL){
+   if (ifp == NULL) {
device_printf(sc-sc_dev, can not if_alloc()\n);
goto detach;
}
@@ -958,7 +958,7 @@ run_unsetup_tx_list(struct run_softc *sc
}
 }
 
-int
+static int
 run_load_microcode(struct run_softc *sc)
 {
usb_device_request_t req;
@@ -1018,7 +1018,8 @@ run_load_microcode(struct run_softc *sc)
USETW(req.wValue, 8);
USETW(req.wIndex, 0);
USETW(req.wLength, 0);
-   if ((error = usbd_do_request(sc-sc_udev, sc-sc_mtx, req, NULL)) != 
0) {
+   if ((error = usbd_do_request(sc-sc_udev, sc-sc_mtx, req, NULL))
+   != 0) {
device_printf(sc-sc_dev, firmware reset failed\n);
goto fail;
}
___
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