svn commit: r241183 - head/sys/net

2012-10-04 Thread Andrew Thompson
Author: thompsa
Date: Thu Oct  4 07:40:55 2012
New Revision: 241183
URL: http://svn.freebsd.org/changeset/base/241183

Log:
  Remove the M_NOWAIT from bridge_rtable_init as it isn't needed. The function
  return value is not even checked and could lead to a panic on a null 
sc_rthash.
  
  MFC after:2 weeks

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cThu Oct  4 06:33:03 2012(r241182)
+++ head/sys/net/if_bridge.cThu Oct  4 07:40:55 2012(r241183)
@@ -270,7 +270,7 @@ static void bridge_rtflush(struct bridge
 static int bridge_rtdaddr(struct bridge_softc *, const uint8_t *,
uint16_t);
 
-static int bridge_rtable_init(struct bridge_softc *);
+static voidbridge_rtable_init(struct bridge_softc *);
 static voidbridge_rtable_fini(struct bridge_softc *);
 
 static int bridge_rtnode_addr_cmp(const uint8_t *, const uint8_t *);
@@ -2736,24 +2736,19 @@ bridge_rtdelete(struct bridge_softc *sc,
  *
  * Initialize the route table for this bridge.
  */
-static int
+static void
 bridge_rtable_init(struct bridge_softc *sc)
 {
int i;
 
sc->sc_rthash = malloc(sizeof(*sc->sc_rthash) * BRIDGE_RTHASH_SIZE,
-   M_DEVBUF, M_NOWAIT);
-   if (sc->sc_rthash == NULL)
-   return (ENOMEM);
+   M_DEVBUF, M_WAITOK);
 
for (i = 0; i < BRIDGE_RTHASH_SIZE; i++)
LIST_INIT(&sc->sc_rthash[i]);
 
sc->sc_rthash_key = arc4random();
-
LIST_INIT(&sc->sc_rtlist);
-
-   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"


svn commit: r241190 - head/sys/sys

2012-10-04 Thread Tijl Coosemans
Author: tijl
Date: Thu Oct  4 08:53:05 2012
New Revision: 241190
URL: http://svn.freebsd.org/changeset/base/241190

Log:
  Define clang feature test macro __has_extension. It's used in stdatomic.h.

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hThu Oct  4 08:49:41 2012(r241189)
+++ head/sys/sys/cdefs.hThu Oct  4 08:53:05 2012(r241190)
@@ -675,6 +675,9 @@
 #endif
 #endif
 
+#ifndef__has_extension
+#define__has_extension  __has_feature
+#endif
 #ifndef__has_feature
 #define__has_feature(x) 0
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-10-04 Thread Adrian Chadd
Author: adrian
Date: Thu Oct  4 15:42:45 2012
New Revision: 241195
URL: http://svn.freebsd.org/changeset/base/241195

Log:
  Implement the quarter rate fractional channel programming for the
  AR5416 and AR9280, but leave it disabled by default.
  
  TL;DR: don't enable this code at all unless you go through the process
  of getting the NIC re-certified.  This is purely to be used as a
  reference and NOT a certified solution by any stretch of the imagination.
  
  The background:
  
  The AR5112 RF synth right up to the AR5133 RF synth (used on the AR5416,
  derivative is used for the AR9130/AR9160) only implement down to 2.5MHz
  channel spacing in 5GHz.  Ie, the RF synth is programmed in steps of 2.5MHz
  (or 5, 10, 20MHz.) So they can't represent the quarter rate channels
  in the 4.9GHz PSB (which end in xxx2MHz and xxx7MHz).  They support
  fractional spacing in 2GHz (1MHz spacing) (or things wouldn't work,
  right?)
  
  So instead of doing this, the RF synth programming for the AR5112 and
  later code will round to the nearest available frequency.
  
  If all NICs were RF5112 or later, they'll inter-operate fine - they all
  program the same. (And for reference, only the latest revision of the
  RF5111 NICs do it, but the driver doesn't yet implement the programming.)
  
  However:
  
  * The AR5416 programming didn't at all implement the fractional synth
work around as above;
  * The AR9280 programming actually programmed the accurate centre frequency
and thus wouldn't inter-operate with the legacy NICs.
  
  So this patch:
  
  * Implements the 4.9GHz PSB fractional synth workaround, exactly as the
RF5112 and later code does;
  * Adds a very dirty workaround from me to calculate the same channel
centre "fudge" to the AR9280 code when operating on fractional frequencies
in 5GHz.
  
  HOWEVER however:
  
  It is disabled by default.  Since the HAL didn't implement this feature,
  it's highly unlikely that the AR5416 and AR928x has been tested in these
  centre frequencies.  There's a lot of regulatory compliance testing required
  before a NIC can have this enabled - checking for centre frequency,
  for drift, for synth spurs, for distortion and spectral mask compliance.
  There's likely a lot of other things that need testing so please don't
  treat this as an exhaustive, authoritative list.  There's a perfectly good
  process out there to get a NIC certified by your regulatory domain, please
  go and engage someone to do that for you and pay the relevant fees.
  
  If a company wishes to grab this work and certify existing 802.11n NICs
  for work in these bands then please be my guest.  The AR9280 works fine
  on the correct fractional synth channels (49x2 and 49x7Mhz) so you don't
  need to get certification for that. But the 500KHz offset hack may have
  the above issues (spur, distortion, accuracy, etc) so you will need to
  get the NIC recertified.
  
  Please note that it's also CARD dependent.  Just because the RF synth
  will behave correctly doesn't at all mean that the card design will also
  behave correctly.  So no, I won't enable this by default if someone
  verifies a specific AR5416/AR9280 NIC works.  Please don't ask.
  
  Tested:
  
  I used the following NICs to do basic interoperability testing at
  half and quarter rates.  However, I only did very minimal spectrum
  analyser testing (mostly "am I about to blow things up" testing;
  not "certification ready" testing):
  
  * AR5212 + AR5112 synth
  * AR5413 + AR5413 synth
  * AR5416 + AR5113 synth
  * AR9280

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar2133.c
  head/sys/dev/ath/ath_hal/ar9002/ar9280.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar2133.cThu Oct  4 12:43:45 2012
(r241194)
+++ head/sys/dev/ath/ath_hal/ar5416/ar2133.cThu Oct  4 15:42:45 2012
(r241195)
@@ -163,6 +163,33 @@ ar2133SetChannel(struct ath_hal *ah, con
OS_REG_WRITE(ah, AR_PHY_CCK_TX_CTRL,
txctl &~ AR_PHY_CCK_TX_CTRL_JAPAN);
}
+   /*
+* Handle programming the RF synth for odd frequencies in the
+* 4.9->5GHz range.  This matches the programming from the
+* later model 802.11abg RF synths.
+*
+* This interoperates on the quarter rate channels with the
+* AR5112 and later RF synths.  Please note that the synthesiser
+* isn't able to completely accurately represent these frequencies
+* (as the resolution in this reference is 2.5MHz) and thus it will
+* be slightly "off centre."  This matches the same slightly
+* incorrect * centre frequency behaviour that the AR5112 and later
+* channel selection code has.
+*
+* This is disabled because it hasn't been tested for regulatory
+* compliance and neither have the NICs which 

svn commit: r241196 - head/usr.sbin/jail

2012-10-04 Thread Jamie Gritton
Author: jamie
Date: Thu Oct  4 18:59:46 2012
New Revision: 241196
URL: http://svn.freebsd.org/changeset/base/241196

Log:
  Move properly to the next parameter when jailparam_init fails
   (i.e. on an unknown parameter), to avoid freeing bogus pointers.

Modified:
  head/usr.sbin/jail/config.c

Modified: head/usr.sbin/jail/config.c
==
--- head/usr.sbin/jail/config.c Thu Oct  4 15:42:45 2012(r241195)
+++ head/usr.sbin/jail/config.c Thu Oct  4 18:59:46 2012(r241196)
@@ -690,6 +690,7 @@ import_params(struct cfjail *j)
if (jailparam_init(jp, p->name) < 0) {
error = -1;
jail_warnx(j, "%s", jail_errmsg);
+   jp++;
continue;
}
if (TAILQ_EMPTY(&p->val))
___
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: r241197 - head/lib/libjail

2012-10-04 Thread Jamie Gritton
Author: jamie
Date: Thu Oct  4 19:07:05 2012
New Revision: 241197
URL: http://svn.freebsd.org/changeset/base/241197

Log:
  Fix some memory allocation errors:
  
  * jail_setv will leak a parameter name if jailparam_import fails.
  * jailparam_all loses the jailparam pointer on realloc error
(a clear freshman mistake).
  * If jailparam_init fails, the caller doesn't need to jailparam_free
the buffer.  That's not really clear, so set things to NULL allowing
jailparam_free to work without error (though it's still not required).

Modified:
  head/lib/libjail/jail.c

Modified: head/lib/libjail/jail.c
==
--- head/lib/libjail/jail.c Thu Oct  4 18:59:46 2012(r241196)
+++ head/lib/libjail/jail.c Thu Oct  4 19:07:05 2012(r241197)
@@ -85,19 +85,22 @@ jail_setv(int flags, ...)
(void)va_arg(tap, char *);
va_end(tap);
jp = alloca(njp * sizeof(struct jailparam));
-   for (njp = 0; (name = va_arg(ap, char *)) != NULL; njp++) {
+   for (njp = 0; (name = va_arg(ap, char *)) != NULL;) {
value = va_arg(ap, char *);
-   if (jailparam_init(jp + njp, name) < 0 ||
-   jailparam_import(jp + njp, value) < 0) {
-   jailparam_free(jp, njp);
-   va_end(ap);
-   return (-1);
-   }
+   if (jailparam_init(jp + njp, name) < 0)
+   goto error;
+   if (jailparam_import(jp + njp++, value) < 0)
+   goto error;
}
va_end(ap);
jid = jailparam_set(jp, njp, flags);
jailparam_free(jp, njp);
return (jid);
+
+ error:
+   jailparam_free(jp, njp);
+   va_end(ap);
+   return (-1);
 }
 
 /*
@@ -195,7 +198,7 @@ jail_getv(int flags, ...)
 int
 jailparam_all(struct jailparam **jpp)
 {
-   struct jailparam *jp;
+   struct jailparam *jp, *tjp;
size_t mlen1, mlen2, buflen;
int njp, nlist;
int mib1[CTL_MAXNAME], mib2[CTL_MAXNAME - 2];
@@ -242,11 +245,10 @@ jailparam_all(struct jailparam **jpp)
/* Add the parameter to the list */
if (njp >= nlist) {
nlist *= 2;
-   jp = realloc(jp, nlist * sizeof(*jp));
-   if (jp == NULL) {
-   jailparam_free(jp, njp);
-   return (-1);
-   }
+   tjp = realloc(jp, nlist * sizeof(*jp));
+   if (tjp == NULL)
+   goto error;
+   jp = tjp;
}
if (jailparam_init(jp + njp, buf + sizeof(SJPARAM)) < 0)
goto error;
@@ -277,6 +279,8 @@ jailparam_init(struct jailparam *jp, con
}
if (jailparam_type(jp) < 0) {
jailparam_free(jp, 1);
+   jp->jp_name = NULL;
+   jp->jp_value = NULL;
return (-1);
}
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"


svn commit: r241198 - head/usr.sbin/acpi/acpidump

2012-10-04 Thread John Baldwin
Author: jhb
Date: Thu Oct  4 20:00:32 2012
New Revision: 241198
URL: http://svn.freebsd.org/changeset/base/241198

Log:
  Display the matrix of inter-domain distances in the SLIT table.  This is
  used to complement the SRAT table on NUMA machines.
  
  MFC after:1 week

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Thu Oct  4 19:07:05 2012
(r241197)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Thu Oct  4 20:00:32 2012
(r241198)
@@ -63,6 +63,7 @@ static void   acpi_handle_madt(ACPI_TABLE_
 static voidacpi_handle_ecdt(ACPI_TABLE_HEADER *sdp);
 static voidacpi_handle_hpet(ACPI_TABLE_HEADER *sdp);
 static voidacpi_handle_mcfg(ACPI_TABLE_HEADER *sdp);
+static voidacpi_handle_slit(ACPI_TABLE_HEADER *sdp);
 static voidacpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
uint32_t flags);
 static voidacpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp);
@@ -519,6 +520,33 @@ acpi_handle_mcfg(ACPI_TABLE_HEADER *sdp)
 }
 
 static void
+acpi_handle_slit(ACPI_TABLE_HEADER *sdp)
+{
+   ACPI_TABLE_SLIT *slit;
+   UINT64 i, j;
+
+   printf(BEGIN_COMMENT);
+   acpi_print_sdt(sdp);
+   slit = (ACPI_TABLE_SLIT *)sdp;
+   printf("\tLocality Count=%jd\n", slit->LocalityCount);
+   printf("\n\t  ");
+   for (i = 0; i < slit->LocalityCount; i++)
+   printf(" %3jd", i);
+   printf("\n\t +");
+   for (i = 0; i < slit->LocalityCount; i++)
+   printf("");
+   printf("\n");
+   for (i = 0; i < slit->LocalityCount; i++) {
+   printf("\t %3jd |", i);
+   for (j = 0; j < slit->LocalityCount; j++)
+   printf(" %3d",
+   slit->Entry[i * slit->LocalityCount + j]);
+   printf("\n");
+   }
+   printf(END_COMMENT);
+}
+
+static void
 acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
 uint32_t flags)
 {
@@ -1092,6 +1120,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp
acpi_handle_ecdt(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_MCFG, 4))
acpi_handle_mcfg(sdp);
+   else if (!memcmp(sdp->Signature, ACPI_SIG_SLIT, 4))
+   acpi_handle_slit(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_SRAT, 4))
acpi_handle_srat(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_TCPA, 4))
___
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: r241198 - head/usr.sbin/acpi/acpidump

2012-10-04 Thread John Baldwin
On Thursday, October 04, 2012 4:00:32 pm John Baldwin wrote:
> Author: jhb
> Date: Thu Oct  4 20:00:32 2012
> New Revision: 241198
> URL: http://svn.freebsd.org/changeset/base/241198
> 
> Log:
>   Display the matrix of inter-domain distances in the SLIT table.  This is
>   used to complement the SRAT table on NUMA machines.

A very simplistic example from a dual-socket Sandy-Bridge EP (I don't have a 
quad-socket box handy):

/*
  SLIT: Length=48, Revision=1, Checksum=228,
OEMID=A M I, OEM Table ID=AMI SLIT, OEM Revision=0x0,
Creator ID=AMI., Creator Revision=0x0
Locality Count=2

 0   1
 +
   0 |  10  21
   1 |  21  10
 */

-- 
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"


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

2012-10-04 Thread Garrett Cooper
On Mon, Sep 24, 2012 at 1:35 PM, Adrian Chadd  wrote:
> Author: adrian
> Date: Mon Sep 24 20:35:56 2012
> New Revision: 240899
> URL: http://svn.freebsd.org/changeset/base/240899
>
> Log:
>   Migrate the ath(4) KTR logging to use an ATH_KTR() macro.
>
>   This should eventually be unified with ATH_DEBUG() so I can get both
>   from one macro; that may take some time.
>
>   Add some new probes for TX and TX completion.

This commit broke the non-IEEE80211_SUPPORT_TDMA case. My attached
patch fixes it by better unifying the IEEE80211_SUPPORT_TDMA and
non-IEEE80211_SUPPORT_TDMA cases where it made sense (it could be
further unified, but that might make things more convoluted).
Thanks!
-Garrett


fix-if_ath_tx-non-IEEE80211_SUPPORT_TDMA.patch
Description: Binary data
___
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: r241214 - in head: . lib/clang/include

2012-10-04 Thread Jung-uk Kim
Author: jkim
Date: Fri Oct  5 00:35:13 2012
New Revision: 241214
URL: http://svn.freebsd.org/changeset/base/241214

Log:
  Do not install incomplete unwind.h from clang.  This header file was meant
  to be a wrapper for the canonical system header file.  Unfortunately, we do
  not have one (yet) and some times it is causing weird failures when clang
  is used for building ports.  More complete and correct file will come from
  libcxxrt in the future.
  
  Discussed with:   dim, kib, theraven
  MFC after:1 week

Modified:
  head/ObsoleteFiles.inc
  head/lib/clang/include/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Oct  4 22:56:15 2012(r241213)
+++ head/ObsoleteFiles.inc  Fri Oct  5 00:35:13 2012(r241214)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20121004: remove incomplete unwind.h
+OLD_FILES+=usr/include/clang/3.2/unwind.h
 # 20120908: pf cleanup
 OLD_FILES+=usr/include/net/if_pflow.h
 # 20120816: new clang import which bumps version from 3.1 to 3.2

Modified: head/lib/clang/include/Makefile
==
--- head/lib/clang/include/Makefile Thu Oct  4 22:56:15 2012
(r241213)
+++ head/lib/clang/include/Makefile Fri Oct  5 00:35:13 2012
(r241214)
@@ -25,7 +25,6 @@ INCS= altivec.h \
popcntintrin.h \
smmintrin.h \
tmmintrin.h \
-   unwind.h \
wmmintrin.h \
x86intrin.h \
xmmintrin.h \
___
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: r241215 - head/sys/dev/bge

2012-10-04 Thread Pyun YongHyeon
Author: yongari
Date: Fri Oct  5 03:35:38 2012
New Revision: 241215
URL: http://svn.freebsd.org/changeset/base/241215

Log:
  Don't touch EMAC Mode and TX/RX MAC Mode register when driver is
  not running.

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Fri Oct  5 00:35:13 2012(r241214)
+++ head/sys/dev/bge/if_bge.c   Fri Oct  5 03:35:38 2012(r241215)
@@ -896,7 +896,10 @@ bge_miibus_statchg(device_t dev)
 {
struct bge_softc *sc;
struct mii_data *mii;
+
sc = device_get_softc(dev);
+   if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+   return;
mii = device_get_softc(sc->bge_miibus);
 
if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
@@ -5054,11 +5057,11 @@ bge_init_locked(struct bge_softc *sc)
bge_writembx(sc, BGE_MBX_IRQ0_LO, 0);
}
 
-   bge_ifmedia_upd_locked(ifp);
-
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
+   bge_ifmedia_upd_locked(ifp);
+
callout_reset(&sc->bge_stat_ch, hz, bge_tick, 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: r241216 - head/sys/dev/bge

2012-10-04 Thread Pyun YongHyeon
Author: yongari
Date: Fri Oct  5 03:46:25 2012
New Revision: 241216
URL: http://svn.freebsd.org/changeset/base/241216

Log:
  APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep
  the MAC connected to the outside world.  So keep the accesses
  atomic.

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Fri Oct  5 03:35:38 2012(r241215)
+++ head/sys/dev/bge/if_bge.c   Fri Oct  5 03:46:25 2012(r241216)
@@ -896,6 +896,7 @@ bge_miibus_statchg(device_t dev)
 {
struct bge_softc *sc;
struct mii_data *mii;
+   uint32_t mac_mode, rx_mode, tx_mode;
 
sc = device_get_softc(dev);
if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
@@ -925,30 +926,39 @@ bge_miibus_statchg(device_t dev)
sc->bge_link = 0;
if (sc->bge_link == 0)
return;
-   BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE);
+
+   /*
+* APE firmware touches these registers to keep the MAC
+* connected to the outside world.  Try to keep the
+* accesses atomic.
+*/
+
+   /* Set the port mode (MII/GMII) to match the link speed. */
+   mac_mode = CSR_READ_4(sc, BGE_MAC_MODE) &
+   ~(BGE_MACMODE_PORTMODE | BGE_MACMODE_HALF_DUPLEX);
+   tx_mode = CSR_READ_4(sc, BGE_TX_MODE);
+   rx_mode = CSR_READ_4(sc, BGE_RX_MODE);
+
if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T ||
IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX)
-   BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII);
+   mac_mode |= BGE_PORTMODE_GMII;
else
-   BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII);
+   mac_mode |= BGE_PORTMODE_MII;
 
+   /* Set MAC flow control behavior to match link flow control settings. */
+   tx_mode &= ~BGE_TXMODE_FLOWCTL_ENABLE;
+   rx_mode &= ~BGE_RXMODE_FLOWCTL_ENABLE;
if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) {
-   BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
-   if ((IFM_OPTIONS(mii->mii_media_active) &
-   IFM_ETH_TXPAUSE) != 0)
-   BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
-   else
-   BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
-   if ((IFM_OPTIONS(mii->mii_media_active) &
-   IFM_ETH_RXPAUSE) != 0)
-   BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
-   else
-   BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
-   } else {
-   BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
-   BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
-   BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
-   }
+   if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0)
+   tx_mode |= BGE_TXMODE_FLOWCTL_ENABLE;
+   if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0)
+   rx_mode |= BGE_RXMODE_FLOWCTL_ENABLE;
+   } else
+   mac_mode |= BGE_MACMODE_HALF_DUPLEX;
+
+   CSR_WRITE_4(sc, BGE_MAC_MODE, mac_mode);
+   CSR_WRITE_4(sc, BGE_TX_MODE, tx_mode);
+   CSR_WRITE_4(sc, BGE_RX_MODE, rx_mode);
 }
 
 /*
___
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: r241217 - head/sys/mips/mips

2012-10-04 Thread Alan Cox
Author: alc
Date: Fri Oct  5 04:35:20 2012
New Revision: 241217
URL: http://svn.freebsd.org/changeset/base/241217

Log:
  Eliminate a stale and a duplicated comment.

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

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Fri Oct  5 03:46:25 2012(r241216)
+++ head/sys/mips/mips/pmap.c   Fri Oct  5 04:35:20 2012(r241217)
@@ -1621,13 +1621,6 @@ retry:
return (pv);
 }
 
-/*
- * If it is the first entry on the list, it is actually
- * in the header and we must copy the following entry up
- * to the header.  Otherwise we must search the list for
- * the entry.  In either case we free the now unused entry.
- */
-
 static pv_entry_t
 pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va)
 {
@@ -2945,13 +2938,6 @@ pmap_clear_reference(vm_page_t m)
  * address space. Return a pointer to where it is mapped. This
  * routine is intended to be used for mapping device memory,
  * NOT real memory.
- */
-
-/*
- * Map a set of physical memory pages into the kernel virtual
- * address space. Return a pointer to where it is mapped. This
- * routine is intended to be used for mapping device memory,
- * NOT real memory.
  *
  * Use XKPHYS uncached for 64 bit, and KSEG1 where possible for 32 bit.
  */
___
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: r241218 - head/usr.sbin/mergemaster

2012-10-04 Thread Doug Barton
Author: dougb
Date: Fri Oct  5 05:01:42 2012
New Revision: 241218
URL: http://svn.freebsd.org/changeset/base/241218

Log:
  Remove references to CVS so that people will stop bringing it up
  
  For -p:
The localtime update should have been excluded in the first place
  
The make.conf comparison has been OBE for some time now, and there
is no src.conf equivalent to share/examples/make.conf, so remove
the whole thing.
  
  Update copyright

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==
--- head/usr.sbin/mergemaster/mergemaster.shFri Oct  5 04:35:20 2012
(r241217)
+++ head/usr.sbin/mergemaster/mergemaster.shFri Oct  5 05:01:42 2012
(r241218)
@@ -5,8 +5,8 @@
 # Compare files created by /usr/src/etc/Makefile (or the directory
 # the user specifies) with the currently installed copies.
 
-# Copyright 1998-2011 Douglas Barton
-# do...@freebsd.org
+# Copyright (c) 1998-2012 Douglas Barton, All rights reserved
+# Please see detailed copyright below
 
 # $FreeBSD$
 
@@ -532,9 +532,9 @@ if [ -t 0 ]; then
   esac
 fi
 
-# Define what CVS $Id tag to look for to aid portability.
+# Define what $Id tag to look for to aid portability.
 #
-CVS_ID_TAG=FreeBSD
+ID_TAG=FreeBSD
 
 delete_temproot () {
   rm -rf "${TEMPROOT}" 2>/dev/null
@@ -1095,17 +1095,17 @@ for COMPFILE in `find . -type f | sort`;
 
   case "${STRICT}" in
   '' | [Nn][Oo])
-# Compare CVS $Id's first so if the file hasn't been modified
+# Compare $Id's first so if the file hasn't been modified
 # local changes will be ignored.
 # If the files have the same $Id, delete the one in temproot so the
 # user will have less to wade through if files are left to merge by hand.
 #
-CVSID1=`grep "[$]${CVS_ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null`
-CVSID2=`grep "[$]${CVS_ID_TAG}:" ${COMPFILE} 2>/dev/null` || CVSID2=none
+ID1=`grep "[$]${ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null`
+ID2=`grep "[$]${ID_TAG}:" ${COMPFILE} 2>/dev/null` || ID2=none
 
-case "${CVSID2}" in
-"${CVSID1}")
-  echo " *** Temp ${COMPFILE} and installed have the same CVS Id, deleting"
+case "${ID2}" in
+"${ID1}")
+  echo " *** Temp ${COMPFILE} and installed have the same Id, deleting"
   rm "${COMPFILE}"
   ;;
 esac
@@ -1334,7 +1334,7 @@ case "${NEED_PWD_MKDB}" in
   ;;
 esac
 
-if [ -e "${DESTDIR}/etc/localtime" ]; then # Ignore if TZ == UTC
+if [ -e "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then# 
Ignore if TZ == UTC
   echo ''
   [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}"
   if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then
@@ -1380,29 +1380,35 @@ case "${COMP_CONFS}" in
   ;;
 esac
 
-case "${PRE_WORLD}" in
-'') ;;
-*)
-  MAKE_CONF="${SOURCEDIR}/share/examples/etc/make.conf"
-
-  (echo ''
-  echo '*** Comparing make variables'
-  echo ''
-  echo "*** From ${DESTDIR}/etc/make.conf"
-  echo "*** From ${MAKE_CONF}"
-
-  for MAKE_VAR in `grep -i ^[a-z] ${DESTDIR}/etc/make.conf | cut -d '=' -f 1`; 
do
-echo ''
-grep -w ^${MAKE_VAR} ${DESTDIR}/etc/make.conf
-grep -w ^#${MAKE_VAR} ${MAKE_CONF} ||
-  echo ' * No example variable with this name'
-  done) | ${PAGER}
-  ;;
-esac
-
 if [ -n "${PRESERVE_FILES}" ]; then
   find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null
   rmdir $PRESERVE_FILES_DIR 2>/dev/null
 fi
 
 exit 0
+
+#~~~
+
+#  Copyright (c) 1998-2012 Douglas Barton
+#  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 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, 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.
___

svn commit: r241219 - head/sys/dev/bge

2012-10-04 Thread Pyun YongHyeon
Author: yongari
Date: Fri Oct  5 06:24:22 2012
New Revision: 241219
URL: http://svn.freebsd.org/changeset/base/241219

Log:
  Add 40 microseconds delay after updating EMAC Mode register as
  recommended by Broadcom data sheet.

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Fri Oct  5 05:01:42 2012(r241218)
+++ head/sys/dev/bge/if_bge.c   Fri Oct  5 06:24:22 2012(r241219)
@@ -957,6 +957,7 @@ bge_miibus_statchg(device_t dev)
mac_mode |= BGE_MACMODE_HALF_DUPLEX;
 
CSR_WRITE_4(sc, BGE_MAC_MODE, mac_mode);
+   DELAY(40);
CSR_WRITE_4(sc, BGE_TX_MODE, tx_mode);
CSR_WRITE_4(sc, BGE_RX_MODE, rx_mode);
 }
@@ -1434,6 +1435,7 @@ bge_chipinit(struct bge_softc *sc)
 
/* Clear the MAC control register */
CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
+   DELAY(40);
 
/*
 * Clear the MAC statistics block in the NIC's
@@ -2046,6 +2048,7 @@ bge_blockinit(struct bge_softc *sc)
 
/* Turn on DMA, clear stats */
CSR_WRITE_4(sc, BGE_MAC_MODE, val);
+   DELAY(40);
 
/* Set misc. local control, enable interrupts on attentions */
CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
@@ -3752,6 +3755,7 @@ bge_reset(struct bge_softc *sc)
BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
 
CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
+   DELAY(40);
 
/*
 * The 5704 in TBI mode apparently needs some special
@@ -5148,6 +5152,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
BGE_SETBIT(sc, BGE_MAC_MODE,
BGE_MACMODE_HALF_DUPLEX);
}
+   DELAY(40);
break;
default:
return (EINVAL);
@@ -5623,9 +5628,11 @@ bge_link_upd(struct bge_softc *sc)
if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) {
if (!sc->bge_link) {
sc->bge_link++;
-   if (sc->bge_asicrev == BGE_ASICREV_BCM5704)
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5704) {
BGE_CLRBIT(sc, BGE_MAC_MODE,
BGE_MACMODE_TBI_SEND_CFGS);
+   DELAY(40);
+   }
CSR_WRITE_4(sc, BGE_MAC_STS, 0x);
if (bootverbose)
if_printf(sc->bge_ifp, "link UP\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"