svn commit: r221690 - head/sys/netinet

2011-05-09 Thread Alexander Motin
Author: mav
Date: Mon May  9 07:37:47 2011
New Revision: 221690
URL: http://svn.freebsd.org/changeset/base/221690

Log:
  Refactor TCP ISN increment logic. Instead of firing callout at 100Hz to
  keep constant ISN growth rate, do the same directly inside tcp_new_isn(),
  taking into account how much time (ticks) passed since the last call.
  
  On my test systems this decreases idle interrupt rate from 140Hz to 70Hz.

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Mon May  9 07:15:15 2011(r221689)
+++ head/sys/netinet/tcp_subr.c Mon May  9 07:37:47 2011(r221690)
@@ -224,7 +224,6 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone);
 VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]);
 
 static struct inpcb *tcp_notify(struct inpcb *, int);
-static voidtcp_isn_tick(void *);
 static char *  tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th,
void *ip4hdr, const void *ip6hdr);
 
@@ -255,7 +254,6 @@ static VNET_DEFINE(uma_zone_t, tcpcb_zon
 #defineV_tcpcb_zoneVNET(tcpcb_zone)
 
 MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers");
-struct callout isn_callout;
 static struct mtx isn_mtx;
 
 #defineISN_LOCK_INIT() mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF)
@@ -358,8 +356,6 @@ tcp_init(void)
 #undef TCP_MINPROTOHDR
 
ISN_LOCK_INIT();
-   callout_init(&isn_callout, CALLOUT_MPSAFE);
-   callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL);
EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL,
SHUTDOWN_PRI_DEFAULT);
EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL,
@@ -385,7 +381,6 @@ void
 tcp_fini(void *xtp)
 {
 
-   callout_stop(&isn_callout);
 }
 
 /*
@@ -1571,11 +1566,13 @@ tcp6_ctlinput(int cmd, struct sockaddr *
 #define ISN_RANDOM_INCREMENT (4096 - 1)
 
 static VNET_DEFINE(u_char, isn_secret[32]);
+static VNET_DEFINE(int, isn_last);
 static VNET_DEFINE(int, isn_last_reseed);
 static VNET_DEFINE(u_int32_t, isn_offset);
 static VNET_DEFINE(u_int32_t, isn_offset_old);
 
 #defineV_isn_secretVNET(isn_secret)
+#defineV_isn_last  VNET(isn_last)
 #defineV_isn_last_reseed   VNET(isn_last_reseed)
 #defineV_isn_offsetVNET(isn_offset)
 #defineV_isn_offset_oldVNET(isn_offset_old)
@@ -1586,6 +1583,7 @@ tcp_new_isn(struct tcpcb *tp)
MD5_CTX isn_ctx;
u_int32_t md5_buffer[4];
tcp_seq new_isn;
+   u_int32_t projected_offset;
 
INP_WLOCK_ASSERT(tp->t_inpcb);
 
@@ -1621,38 +1619,17 @@ tcp_new_isn(struct tcpcb *tp)
new_isn = (tcp_seq) md5_buffer[0];
V_isn_offset += ISN_STATIC_INCREMENT +
(arc4random() & ISN_RANDOM_INCREMENT);
-   new_isn += V_isn_offset;
-   ISN_UNLOCK();
-   return (new_isn);
-}
-
-/*
- * Increment the offset to the next ISN_BYTES_PER_SECOND / 100 boundary
- * to keep time flowing at a relatively constant rate.  If the random
- * increments have already pushed us past the projected offset, do nothing.
- */
-static void
-tcp_isn_tick(void *xtp)
-{
-   VNET_ITERATOR_DECL(vnet_iter);
-   u_int32_t projected_offset;
-
-   VNET_LIST_RLOCK_NOSLEEP();
-   ISN_LOCK();
-   VNET_FOREACH(vnet_iter) {
-   CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS */
-   projected_offset =
-   V_isn_offset_old + ISN_BYTES_PER_SECOND / 100;
-
+   if (ticks != V_isn_last) {
+   projected_offset = V_isn_offset_old +
+   ISN_BYTES_PER_SECOND / hz * (ticks - V_isn_last);
if (SEQ_GT(projected_offset, V_isn_offset))
V_isn_offset = projected_offset;
-
V_isn_offset_old = V_isn_offset;
-   CURVNET_RESTORE();
+   V_isn_last = ticks;
}
+   new_isn += V_isn_offset;
ISN_UNLOCK();
-   VNET_LIST_RUNLOCK_NOSLEEP();
-   callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL);
+   return (new_isn);
 }
 
 /*
___
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: r221691 - head/tools/tools/ath/ath_ee_v4k_print

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Mon May  9 10:39:15 2011
New Revision: 221691
URL: http://svn.freebsd.org/changeset/base/221691

Log:
  This is a full 32 bit field for kite.

Modified:
  head/tools/tools/ath/ath_ee_v4k_print/v4k.c

Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c
==
--- head/tools/tools/ath/ath_ee_v4k_print/v4k.c Mon May  9 07:37:47 2011
(r221690)
+++ head/tools/tools/ath/ath_ee_v4k_print/v4k.c Mon May  9 10:39:15 2011
(r221691)
@@ -89,7 +89,7 @@ eeprom_v4k_modal_print(uint16_t *buf)
MODAL_EEP4K_HEADER *mh = &eep->ee_base.modalHeader;
int i;
 
-   printf("| antCtrlCommon: 0x%.4x |\n", mh->antCtrlCommon);
+   printf("| antCtrlCommon: 0x%.8x |\n", mh->antCtrlCommon);
printf("| switchSettling: 0x%.2x |\n", mh->switchSettling);
printf("| adcDesiredSize: %d |\n| pgaDesiredSize: %.2f dBm |\n",
mh->adcDesiredSize, (float) mh->pgaDesiredSize / 2.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: r221692 - head/sys/netipsec

2011-05-09 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Mon May  9 13:16:21 2011
New Revision: 221692
URL: http://svn.freebsd.org/changeset/base/221692

Log:
  Release SP's refcount in key_get_spdbyid().
  
  PR:   156676
  Submitted by: Tobias Brunner (tob...@strongswan.org)
  MFC after:1 week

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Mon May  9 10:39:15 2011(r221691)
+++ head/sys/netipsec/key.c Mon May  9 13:16:21 2011(r221692)
@@ -2283,6 +2283,7 @@ key_spdget(so, m, mhp)
}
 
n = key_setdumpsp(sp, SADB_X_SPDGET, 0, mhp->msg->sadb_msg_pid);
+   KEY_FREESP(&sp);
if (n != NULL) {
m_freem(m);
return key_sendup_mbuf(so, n, KEY_SENDUP_ONE);
___
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: r221550 - head/sys/powerpc/conf

2011-05-09 Thread Andreas Tobler

On 09.05.11 00:15, Attilio Rao wrote:

2011/5/8 Andreas Tobler:

On 08.05.11 00:17, Attilio Rao wrote:


2011/5/6 Attilio Rao:


2011/5/6 Nathan Whitehorn:


Author: nwhitehorn
Date: Fri May  6 20:43:02 2011
New Revision: 221550
URL: http://svn.freebsd.org/changeset/base/221550

Log:
  SMP has worked perfectly for a very long time on 32-bit PowerPC on both
  UP and SMP hardware. Enable it in GENERIC.



While working on largeSMP, I think there is a breakage in atomic.h.
More specifically, atomic_store_rel_long() (and related functions) are
not going to properly work because powerpc defines them as:

atomic_store_rel_long ->atomic_store_rel_32(volatile u_int *p, u_int v)

while this should really follow the long arguments.

This happens because powerpc doesn't follow the other architectures
semantic on defining the "similar" atomic operations.
Other arches define an hardcode version of _type version of the
function and than make a macro the _32 (or whatever) version.
In other words this is what they do:

void
atomic_store_rel_32()
{
...
}

#define atomic_store_rel_int atomic_store_rel_32

which si clearly dangerous for cases as reported above. Maybe that
could be fixed by passing sized types, rather than simply int or long
in numbered version, but I'd really prefer to follow the semantic by
other architectures and then have:

void
atomic_store_rel_int()
{
...
}

#define atomic_store_rel_32 atomic_store_rel_int

I fixed the ATOMIC_STORE_LOAD case in my code, because I needed it,
but the final cleanup is much bigger.
I can make a patch tomorrow if you can test it.



Can you please test and review this patch?:
http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc.diff

Unfortunately I'm having issues with the toolchains in atm, so I can't
really neither test compile it.


I built kernel and world on both, on a 32-bit system and on a 64-bit system
with 32-bit compat support.

The 32-bit world failed due to type punning issues from umtx.h:121ff

Attached my try to workaround these issues. With my try I can build both,
kernel and world. Right now I have a world running with it (32-bit).
I do not know if my try is correct. Even less after reading the comments
from Bruce.
But I think if it is on a somehow correct way, then we need something
similar for the other _long functions on 32-bit where we go from the u_long
to u_int. (e.g, atomic_add_long etc.)

I'm ready for more testing.


So based on your and Bruce's feedbacks I've reworked the patch a bit:
http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc2.diff

This should make type-pun correctly and avoid auto-casting on _ptr functions.

I'm sorry I couldn't even test-compile it, but I'm confident you can
fix edge cases alone.
Let me know.


Both builds ok and booted.

Thanks,
Andreas


___
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: r221693 - head/sys/dev/ath/ath_hal/ar9002

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Mon May  9 14:04:49 2011
New Revision: 221693
URL: http://svn.freebsd.org/changeset/base/221693

Log:
  Remove an un-needed PA cal call here.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.cMon May  9 13:16:21 
2011(r221692)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.cMon May  9 14:04:49 
2011(r221693)
@@ -263,7 +263,5 @@ ar9285InitCalHardware(struct ath_hal *ah
if (! ar9285_hw_clc(ah, chan))
return AH_FALSE;
 
-   ar9285_hw_pa_cal(ah, AH_TRUE);
-
return AH_TRUE;
 }
___
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: r221694 - head/sys/dev/ath/ath_hal/ar9002

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Mon May  9 15:19:49 2011
New Revision: 221694
URL: http://svn.freebsd.org/changeset/base/221694

Log:
  Import some initial Kite fixed diversity code from Atheros.
  
  For now, the diversity settings are controlled by 'txantenna',
  -not- rxantenna. This is because the earlier chipsets had
  controllable TX diversity; the RX antenna setting twiddles
  the default antenna register. I'll try sort that stuff out at
  some point.
  
  Call the antenna switch function from the board setup function
  so scans, channel changes, mode changes, etc don't set the
  diversity back to a default state too far from what's intended.
  
  Things to todo:
  
  * Squirrel away the last antenna diversity/combining parameters
and restore them during board setup if HAL_ANT_VARIABLE is
defined. That way scans, etc don't reset the diversity settings.
  
  * Add some more public facing statistics, rather than what's
simply logged under HAL_DEBUG_DIVERSITY.
  
  For now, the fixed antenna settings behave better than variable
  settings for me. I have some further fiddling to do..
  
  Obtained from:Atheros

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285.h
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285.hMon May  9 14:04:49 2011
(r221693)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285.hMon May  9 15:19:49 2011
(r221694)
@@ -21,10 +21,10 @@
 #include "ar5416/ar5416.h"
 
 enum ar9285_ant_div_comb_lna_conf {
-   ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2,
-   ATH_ANT_DIV_COMB_LNA2,
-   ATH_ANT_DIV_COMB_LNA1,
-   ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2,
+   ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0,
+   ATH_ANT_DIV_COMB_LNA2 = 1,
+   ATH_ANT_DIV_COMB_LNA1 = 2,
+   ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3,
 };
 
 struct ar9285_ant_comb {

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May  9 14:04:49 
2011(r221693)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May  9 15:19:49 
2011(r221694)
@@ -407,15 +407,6 @@ ar9285FillCapabilityInfo(struct ath_hal 
return AH_TRUE;
 }
 
-/*
- * Antenna selection is not (currently) done this way.
- */
-HAL_BOOL
-ar9285SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings)
-{
-   return AH_TRUE;
-}
-
 static const char*
 ar9285Probe(uint16_t vendorid, uint16_t devid)
 {

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c  Mon May  9 14:04:49 
2011(r221693)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c  Mon May  9 15:19:49 
2011(r221694)
@@ -374,11 +374,19 @@ ar9285_ant_comb_scan(struct ath_hal *ah,
if (! ar9285_check_div_comb(ah))
return;
 
+   if (AH5212(ah)->ah_diversity == AH_FALSE)
+   return;
+
rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) &
   ATH_ANT_RX_MASK;
main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) &
 ATH_ANT_RX_MASK;
 
+#if 0
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main: %d, alt: %d, rx_ant_conf: 
%x, main_ant_conf: %x\n",
+   __func__, main_rssi, alt_rssi, rx_ant_conf, main_ant_conf);
+#endif
+
/* Record packet only when alt_rssi is positive */
if (alt_rssi > 0) {
antcomb->total_pkt_count++;
@@ -587,6 +595,24 @@ div_comb_done:
 
ar9285_antdiv_comb_conf_set(ah, &div_ant_conf);
 
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: total_pkt_count=%d\n",
+  __func__, antcomb->total_pkt_count);
+
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_total_rssi=%d\n",
+  __func__, antcomb->main_total_rssi);
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_total_rssi=%d\n",
+  __func__, antcomb->alt_total_rssi);
+
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_rssi_avg=%d\n",
+  __func__, main_rssi_avg);
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_alt_rssi_avg=%d\n",
+  __func__, alt_rssi_avg);
+
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_recv_cnt=%d\n",
+  __func__, antcomb->main_recv_cnt);
+   HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_recv_cnt=%d\n",
+  __func__, antcomb->alt_recv_cnt);
+
if (curr_alt_set != div_ant_conf.alt_lna_conf)
HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: lna_conf: %x -> %x\n",
__func__, curr_alt_set, div_ant_conf.alt_lna_conf);
@@ -604,3 +630,117 @@ div_comb_done:

svn commit: r221695 - head/sys/dev/sound/usb

2011-05-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon May  9 15:57:04 2011
New Revision: 221695
URL: http://svn.freebsd.org/changeset/base/221695

Log:
  Workaround for broken no-name USB audio devices sold by dealextreme
  called "3D sound" and the alike.
  
  MFC after:14 days

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Mon May  9 15:19:49 2011
(r221694)
+++ head/sys/dev/sound/usb/uaudio.c Mon May  9 15:57:04 2011
(r221695)
@@ -789,6 +789,46 @@ uaudio_chan_dump_ep_desc(const usb_endpo
 
 #endif
 
+/*
+ * The following is a workaround for broken no-name USB audio devices
+ * sold by dealextreme called "3D sound". The problem is that the
+ * manufacturer computed wMaxPacketSize is too small to hold the
+ * actual data sent. In other words the device sometimes sends more
+ * data than it actually reports it can send in a single isochronous
+ * packet.
+ */
+static void
+uaudio_record_fix_fs(usb_endpoint_descriptor_audio_t *ep,
+uint32_t xps, uint32_t add)
+{
+   uint32_t mps;
+
+   mps = UGETW(ep->wMaxPacketSize);
+
+   /*
+* If the device indicates it can send more data than what the
+* sample rate indicates, we apply the workaround.
+*/
+   if (mps > xps) {
+
+   /* allow additional data */
+   xps += add;
+
+   /* check against the maximum USB 1.x length */
+   if (xps > 1023)
+   xps = 1023;
+
+   /* check if we should do an update */
+   if (mps < xps) {
+   /* simply update the wMaxPacketSize field */
+   USETW(ep->wMaxPacketSize, xps);
+   DPRINTF("Workaround: Updated wMaxPacketSize "
+   "from %d to %d bytes.\n",
+   (int)mps, (int)xps);
+   }
+   }
+}
+
 static void
 uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
 uint32_t rate, uint8_t channels, uint8_t bit_resolution)
@@ -797,7 +837,7 @@ uaudio_chan_fill_info_sub(struct uaudio_
const struct usb_audio_streaming_interface_descriptor *asid = NULL;
const struct usb_audio_streaming_type1_descriptor *asf1d = NULL;
const struct usb_audio_streaming_endpoint_descriptor *sed = NULL;
-   const usb_endpoint_descriptor_audio_t *ed1 = NULL;
+   usb_endpoint_descriptor_audio_t *ed1 = NULL;
const usb_endpoint_descriptor_audio_t *ed2 = NULL;
struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev);
struct usb_interface_descriptor *id;
@@ -999,6 +1039,13 @@ uaudio_chan_fill_info_sub(struct uaudio_

UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) *
chan->p_asf1d->bBitResolution) / 8);
 
+   if (ep_dir == UE_DIR_IN &&
+   usbd_get_speed(udev) == 
USB_SPEED_FULL) {
+   uaudio_record_fix_fs(ed1,
+   chan->sample_size * (rate / 
1000),
+   chan->sample_size * (rate / 
4000));
+   }
+
if (sc->sc_sndstat_valid) {
sbuf_printf(&sc->sc_sndstat, 
"\n\t"
"mode %d.%d:(%s) %dch, 
%d/%dbit, %s, %dHz",
___
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: r221698 - in head/sys/teken: . demo libteken stress

2011-05-09 Thread Ed Schouten
Author: ed
Date: Mon May  9 16:27:39 2011
New Revision: 221698
URL: http://svn.freebsd.org/changeset/base/221698

Log:
  Add proper build infrastructure for teken.
  
  I'm not sure whether we should install teken as a library on any stock
  FreeBSD installation, but I can imagine people want to tinker around
  with it now and then. Create a /sys/teken/libteken, which holds a
  Makefile to install a shared library version of the terminal emulator,
  complete with a manpage.
  
  Also add Makefiles for the demo/stress applications, to build it against
  the shared library.

Added:
  head/sys/teken/demo/
  head/sys/teken/demo/Makefile   (contents, props changed)
  head/sys/teken/demo/teken_demo.c
 - copied, changed from r221665, head/sys/teken/teken_demo.c
  head/sys/teken/libteken/
  head/sys/teken/libteken/Makefile   (contents, props changed)
  head/sys/teken/libteken/Symbol.map   (contents, props changed)
  head/sys/teken/libteken/teken.3   (contents, props changed)
  head/sys/teken/stress/
  head/sys/teken/stress/Makefile   (contents, props changed)
  head/sys/teken/stress/teken_stress.c
 - copied, changed from r221665, head/sys/teken/teken_stress.c
Deleted:
  head/sys/teken/Makefile
  head/sys/teken/teken_demo.c
  head/sys/teken/teken_stress.c
Modified:
  head/sys/teken/teken.c
  head/sys/teken/teken.h

Added: head/sys/teken/demo/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/teken/demo/MakefileMon May  9 16:27:39 2011
(r221698)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+PROG=  teken_demo
+LDADD= -lncurses -lteken -lutil
+MAN=
+
+WARNS?=6
+
+.include 

Copied and modified: head/sys/teken/demo/teken_demo.c (from r221665, 
head/sys/teken/teken_demo.c)
==
--- head/sys/teken/teken_demo.c Sun May  8 14:57:01 2011(r221665, copy 
source)
+++ head/sys/teken/demo/teken_demo.cMon May  9 16:27:39 2011
(r221698)
@@ -45,7 +45,7 @@
 #include 
 #endif
 
-#include "teken.h"
+#include 
 
 static tf_bell_t   test_bell;
 static tf_cursor_t test_cursor;

Added: head/sys/teken/libteken/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/teken/libteken/MakefileMon May  9 16:27:39 2011
(r221698)
@@ -0,0 +1,39 @@
+# $FreeBSD$
+
+LIB=   teken
+SHLIB_MAJOR= 0
+
+CFLAGS+=-I.
+WARNS?=6
+
+SRCDIR=${.CURDIR}/..
+.PATH: ${SRCDIR}
+
+SRCS=  teken.c teken_state.h
+INCS=  teken.h
+CLEANFILES=teken_state.h
+
+MAN=   teken.3
+MLINKS=teken.3 teken_256to8.3 \
+   teken.3 teken_get_curattr.3 \
+   teken.3 teken_get_cursor.3 \
+   teken.3 teken_get_defattr.3 \
+   teken.3 teken_get_defattr_cons25.3 \
+   teken.3 teken_get_sequence.3 \
+   teken.3 teken_get_winsize.3 \
+   teken.3 teken_init.3 \
+   teken.3 teken_input.3 \
+   teken.3 teken_set_8bit.3 \
+   teken.3 teken_set_cons25.3 \
+   teken.3 teken_set_curattr.3 \
+   teken.3 teken_set_cursor.3 \
+   teken.3 teken_set_defattr.3 \
+   teken.3 teken_set_winsize.3
+
+teken_state.h: ${SRCDIR}/gensequences ${SRCDIR}/sequences
+   awk -f ${SRCDIR}/gensequences ${SRCDIR}/sequences > ${.TARGET}
+
+VERSION_DEF=   ${.CURDIR}/../../../lib/libc/Versions.def
+SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
+
+.include 

Added: head/sys/teken/libteken/Symbol.map
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/teken/libteken/Symbol.map  Mon May  9 16:27:39 2011
(r221698)
@@ -0,0 +1,21 @@
+/*
+ * $FreeBSD$
+ */
+
+FBSD_1.2 {
+   teken_256to8;
+   teken_get_curattr;
+   teken_get_cursor;
+   teken_get_defattr;
+   teken_get_defattr_cons25;
+   teken_get_sequence;
+   teken_get_winsize;
+   teken_init;
+   teken_input;
+   teken_set_8bit;
+   teken_set_cons25;
+   teken_set_curattr;
+   teken_set_cursor;
+   teken_set_defattr;
+   teken_set_winsize;
+};

Added: head/sys/teken/libteken/teken.3
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/teken/libteken/teken.3 Mon May  9 16:27:39 2011
(r221698)
@@ -0,0 +1,220 @@
+.\" Copyright (c) 2011 Ed Schouten 
+.\" 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
+.\"notic

svn commit: r221700 - head/sys/dev/ath/ath_hal/ar9002

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Mon May  9 16:49:40 2011
New Revision: 221700
URL: http://svn.freebsd.org/changeset/base/221700

Log:
  Disable TX STBC - it isn't used for now, but it isn't supported on Kite.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May  9 16:47:13 
2011(r221699)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May  9 16:49:40 
2011(r221700)
@@ -401,8 +401,9 @@ ar9285FillCapabilityInfo(struct ath_hal 
if (AR_SREV_KITE_12_OR_LATER(ah))
pCap->halPSPollBroken = AH_FALSE;
 
+   /* Only RX STBC supported */
pCap->halRxStbcSupport = 1;
-   pCap->halTxStbcSupport = 1;
+   pCap->halTxStbcSupport = 0;
 
return AH_TRUE;
 }
___
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: r221701 - head/sys/dev/ath/ath_hal/ar5416

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Mon May  9 17:10:48 2011
New Revision: 221701
URL: http://svn.freebsd.org/changeset/base/221701

Log:
  Fix a regression I introduced - only swap analog chains if the RX chainmask
  is 0x5.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Mon May  9 16:49:40 
2011(r221700)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Mon May  9 17:10:48 
2011(r221701)
@@ -1296,7 +1296,8 @@ ar5416InitChainMasks(struct ath_hal *ah)
 {
int rx_chainmask = AH5416(ah)->ah_rx_chainmask;
 
-   if (rx_chainmask)
+   /* Flip this for this chainmask regardless of chip */
+   if (rx_chainmask == 0x5)
OS_REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN);
 
/*
___
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: r221702 - head/sys/dev/ath/ath_hal/ar9002

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Mon May  9 17:30:25 2011
New Revision: 221702
URL: http://svn.freebsd.org/changeset/base/221702

Log:
  Disable diversity combining support until I can get a firm answer
  from Atheros as to what/when this is supposed to be enabled.
  
  Using the default RX fast diversity settings seems to help quite
  a bit.
  
  Whilst I'm here, change the prototype to return HAL_BOOL rather than int.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.cMon May  9 17:10:48 
2011(r221701)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.cMon May  9 17:30:25 
2011(r221702)
@@ -75,24 +75,30 @@ ar9285_antdiv_comb_conf_set(struct ath_h
 }
 
 /*
- * Check whether antenna diversity should be enabled
+ * Check whether combined + fast antenna diversity should be enabled.
+ *
+ * This enables software-driven RX antenna diversity based on RX
+ * RSSI + antenna config packet sampling.
  */
-int
+HAL_BOOL
 ar9285_check_div_comb(struct ath_hal *ah)
 {
uint8_t ant_div_ctl1;
HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
 const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader;
 
+   /* For now, simply disable this until it's better debugged. -adrian */
+   return AH_FALSE;
+
if (! AR_SREV_KITE(ah))
-   return 0;
+   return AH_FALSE;
 
if (pModal->version < 3)
-   return 0;
+   return AH_FALSE;
 
ant_div_ctl1 = pModal->antdiv_ctl1;
if ((ant_div_ctl1 & 0x1) && ((ant_div_ctl1 >> 3) & 0x1))
-   return 1;
+   return AH_TRUE;
 
-   return 0;
+   return AH_FALSE;
 }

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.hMon May  9 17:10:48 
2011(r221701)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.hMon May  9 17:30:25 
2011(r221702)
@@ -41,6 +41,6 @@ externvoid ar9285_antdiv_comb_conf_set(
struct ar9285_antcomb_conf *antconf);
 extern void ar9285_antdiv_comb_conf_get(struct ath_hal *ah,
struct ar9285_antcomb_conf *antconf);
-extern int ar9285_check_div_comb(struct ath_hal *ah);
+extern HAL_BOOL ar9285_check_div_comb(struct ath_hal *ah);
 
 #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: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86

2011-05-09 Thread Jung-uk Kim
Author: jkim
Date: Mon May  9 17:34:00 2011
New Revision: 221703
URL: http://svn.freebsd.org/changeset/base/221703

Log:
  Implement boot-time TSC synchronization test for SMP.  This test is executed
  when the user has indicated that the system has synchronized TSCs or it has
  P-state invariant TSCs.  For the former case, we may clear the tunable if it
  fails the test to prevent accidental foot-shooting.  For the latter case, we
  may set it if it passes the test to notify the user that it may be usable.

Modified:
  head/sys/amd64/include/clock.h
  head/sys/i386/include/clock.h
  head/sys/x86/isa/clock.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/include/clock.h
==
--- head/sys/amd64/include/clock.h  Mon May  9 17:30:25 2011
(r221702)
+++ head/sys/amd64/include/clock.h  Mon May  9 17:34:00 2011
(r221703)
@@ -29,7 +29,6 @@ void  i8254_init(void);
 
 void   startrtclock(void);
 void   init_TSC(void);
-void   init_TSC_tc(void);
 
 #defineHAS_TIMER_SPKR 1
 inttimer_spkr_acquire(void);

Modified: head/sys/i386/include/clock.h
==
--- head/sys/i386/include/clock.h   Mon May  9 17:30:25 2011
(r221702)
+++ head/sys/i386/include/clock.h   Mon May  9 17:34:00 2011
(r221703)
@@ -30,7 +30,6 @@ void  i8254_init(void);
 void   startrtclock(void);
 void   timer_restore(void);
 void   init_TSC(void);
-void   init_TSC_tc(void);
 
 #defineHAS_TIMER_SPKR 1
 inttimer_spkr_acquire(void);

Modified: head/sys/x86/isa/clock.c
==
--- head/sys/x86/isa/clock.cMon May  9 17:30:25 2011(r221702)
+++ head/sys/x86/isa/clock.cMon May  9 17:34:00 2011(r221703)
@@ -498,7 +498,6 @@ void
 cpu_initclocks(void)
 {
 
-   init_TSC_tc();
cpu_initclocks_bsp();
 }
 

Modified: head/sys/x86/x86/tsc.c
==
--- head/sys/x86/x86/tsc.c  Mon May  9 17:30:25 2011(r221702)
+++ head/sys/x86/x86/tsc.c  Mon May  9 17:34:00 2011(r221703)
@@ -326,7 +326,73 @@ init_TSC(void)
tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY);
 }
 
-void
+#ifdef SMP
+
+#defineTSC_READ(x) \
+static void\
+tsc_read_##x(void *arg)\
+{  \
+   uint32_t *tsc = arg;\
+   u_int cpu = PCPU_GET(cpuid);\
+   \
+   tsc[cpu * 3 + x] = rdtsc32();   \
+}
+TSC_READ(0)
+TSC_READ(1)
+TSC_READ(2)
+#undef TSC_READ
+
+#defineN   1000
+
+static void
+comp_smp_tsc(void *arg)
+{
+   uint32_t *tsc;
+   int32_t d1, d2;
+   u_int cpu = PCPU_GET(cpuid);
+   u_int i, j, size;
+
+   size = (mp_maxid + 1) * 3;
+   for (i = 0, tsc = arg; i < N; i++, tsc += size)
+   CPU_FOREACH(j) {
+   if (j == cpu)
+   continue;
+   d1 = tsc[cpu * 3 + 1] - tsc[j * 3];
+   d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1];
+   if (d1 <= 0 || d2 <= 0) {
+   smp_tsc = 0;
+   return;
+   }
+   }
+}
+
+static int
+test_smp_tsc(void)
+{
+   uint32_t *data, *tsc;
+   u_int i, size;
+
+   if (!smp_tsc && !tsc_is_invariant)
+   return (-100);
+   size = (mp_maxid + 1) * 3;
+   data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK);
+   for (i = 0, tsc = data; i < N; i++, tsc += size)
+   smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc);
+   smp_tsc = 1;/* XXX */
+   smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc,
+   smp_no_rendevous_barrier, data);
+   free(data, M_TEMP);
+   if (bootverbose)
+   printf("SMP: %sed TSC synchronization test\n",
+   smp_tsc ? "pass" : "fail");
+   return (smp_tsc ? 800 : -100);
+}
+
+#undef N
+
+#endif /* SMP */
+
+static void
 init_TSC_tc(void)
 {
 
@@ -347,26 +413,25 @@ init_TSC_tc(void)
tsc_timecounter.tc_quality = -1000;
if (bootverbose)
printf("TSC timecounter disabled: APM enabled.\n");
+   goto init;
}
 
 #ifdef SMP
/*
-* We can not use the TSC in SMP mode unless the TSCs on all CPUs
-* are somehow synchronized.  Some hardware configurations do
-* this, but we have no way of determining whether this is the
-* case, so we do not use the TSC in multi-processor systems
-* unless the user indicated (by setting kern.timecounter.smp_tsc
-* to 1) that he believes that his TSCs are synchronized.
+  

Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86

2011-05-09 Thread Jung-uk Kim
On Monday 09 May 2011 01:34 pm, Jung-uk Kim wrote:
> Author: jkim
> Date: Mon May  9 17:34:00 2011
> New Revision: 221703
> URL: http://svn.freebsd.org/changeset/base/221703
>
> Log:
>   Implement boot-time TSC synchronization test for SMP.  This test
> is executed when the user has indicated that the system has
> synchronized TSCs or it has P-state invariant TSCs.  For the former
> case, we may clear the tunable if it fails the test to prevent
> accidental foot-shooting.  For the latter case, we may set it if it
> passes the test to notify the user that it may be usable.

For now, we don't change TSC quality.  However, if it goes well, I am 
planning on committing the attached patch to change that.  If you 
experience any false detections, please report to me privately.

Please also note that we don't test TSC drifts across cores at 
run-time, so we may have to leave SMP TSC quality as is, i.e., 800.  
It is yet to be determined.  Please let me know what you think.

Thanks!

Jung-uk Kim
Index: sys/dev/acpica/acpi_hpet.c
===
--- sys/dev/acpica/acpi_hpet.c  (revision 221701)
+++ sys/dev/acpica/acpi_hpet.c  (working copy)
@@ -476,7 +476,7 @@ hpet_attach(device_t dev)
sc->tc.tc_get_timecount = hpet_get_timecount,
sc->tc.tc_counter_mask = ~0u,
sc->tc.tc_name = "HPET",
-   sc->tc.tc_quality = 900,
+   sc->tc.tc_quality = 950,
sc->tc.tc_frequency = sc->freq;
sc->tc.tc_priv = sc;
tc_init(&sc->tc);
Index: sys/dev/acpica/acpi_timer.c
===
--- sys/dev/acpica/acpi_timer.c (revision 221701)
+++ sys/dev/acpica/acpi_timer.c (working copy)
@@ -203,7 +203,7 @@ acpi_timer_probe(device_t dev)
 if (j == 10) {
acpi_timer_timecounter.tc_name = "ACPI-fast";
acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount;
-   acpi_timer_timecounter.tc_quality = 1000;
+   acpi_timer_timecounter.tc_quality = 900;
 } else {
acpi_timer_timecounter.tc_name = "ACPI-safe";
acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe;
Index: sys/x86/x86/tsc.c
===
--- sys/x86/x86/tsc.c   (revision 221703)
+++ sys/x86/x86/tsc.c   (working copy)
@@ -385,7 +385,7 @@ test_smp_tsc(void)
if (bootverbose)
printf("SMP: %sed TSC synchronization test\n",
smp_tsc ? "pass" : "fail");
-   return (smp_tsc ? 800 : -100);
+   return (smp_tsc ? 1000 : -100);
 }
 
 #undef N
@@ -422,9 +422,13 @@ init_TSC_tc(void)
 * synchronized.  If the user is sure that the system has synchronized
 * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value.
 */
-   if (smp_cpus > 1)
+   if (smp_cpus > 1) {
tsc_timecounter.tc_quality = test_smp_tsc();
+   goto init;
+   }
 #endif
+   if (tsc_is_invariant)
+   tsc_timecounter.tc_quality = 1000;
 init:
if (tsc_freq != 0) {
tsc_timecounter.tc_frequency = tsc_freq;
___
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: r221708 - in head/sys: dev/syscons isa pc98/cbus

2011-05-09 Thread Jung-uk Kim
Author: jkim
Date: Mon May  9 18:46:49 2011
New Revision: 221708
URL: http://svn.freebsd.org/changeset/base/221708

Log:
  Move VT switching hack for suspend/resume from bus drivers to syscons.c
  using event handlers.  A different version was
  
  Submitted by: Taku YAMAMOTO (taku at tackymt dot homeip dot net)

Modified:
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/syscons.h
  head/sys/isa/syscons_isa.c
  head/sys/pc98/cbus/syscons_cbus.c

Modified: head/sys/dev/syscons/syscons.c
==
--- head/sys/dev/syscons/syscons.c  Mon May  9 18:31:26 2011
(r221707)
+++ head/sys/dev/syscons/syscons.c  Mon May  9 18:46:49 2011
(r221708)
@@ -104,7 +104,8 @@ static  scr_statmain_console;
 static struct tty  *main_devs[MAXCONS];
 
 static  char   init_done = COLD;
-static  char   shutdown_in_progress = FALSE;
+static int shutdown_in_progress = FALSE;
+static int suspend_in_progress = FALSE;
 static charsc_malloc = FALSE;
 
 static int saver_mode = CONS_NO_SAVER; /* LKM/user saver */
@@ -128,6 +129,13 @@ static voidnone_saver(sc_softc_t *sc, 
 static void(*current_saver)(sc_softc_t *, int) = none_saver;
 #endif
 
+#ifdef SC_NO_SUSPEND_VTYSWITCH
+static int sc_no_suspend_vtswitch = 1;
+#else
+static int sc_no_suspend_vtswitch = 0;
+#endif
+static int sc_susp_scr;
+
 SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons");
 SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver");
 SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW,
@@ -142,6 +150,9 @@ SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_re
 SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_debug, CTLFLAG_RW|CTLFLAG_SECURE, 
&enable_kdbkey,
 0, "enable keyboard debug");
 #endif
+TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch);
+SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW,
+&sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend.");
 #if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT)
 #include "font.h"
 #endif
@@ -170,7 +181,9 @@ static kbd_callback_func_t sckbdevent;
 static void scinit(int unit, int flags);
 static scr_stat *sc_get_stat(struct tty *tp);
 static void scterm(int unit, int flags);
-static void scshutdown(void *arg, int howto);
+static void scshutdown(void *, int);
+static void scsuspend(void *);
+static void scresume(void *);
 static u_int scgetc(sc_softc_t *sc, u_int flags);
 #define SCGETC_CN  1
 #define SCGETC_NONBLOCK2
@@ -518,10 +531,15 @@ sc_attach_unit(int unit, int flags)
printf("\n");
 }
 
-/* register a shutdown callback for the kernel console */
-if (sc_console_unit == unit)
-   EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, 
- (void *)(uintptr_t)unit, SHUTDOWN_PRI_DEFAULT);
+/* Register suspend/resume/shutdown callbacks for the kernel console. */
+if (sc_console_unit == unit) {
+   EVENTHANDLER_REGISTER(power_suspend, scsuspend, NULL,
+ EVENTHANDLER_PRI_ANY);
+   EVENTHANDLER_REGISTER(power_resume, scresume, NULL,
+ EVENTHANDLER_PRI_ANY);
+   EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, NULL,
+ SHUTDOWN_PRI_DEFAULT);
+}
 
 for (vc = 0; vc < sc->vtys; vc++) {
if (sc->dev[vc] == NULL) {
@@ -1718,7 +1736,7 @@ sccnupdate(scr_stat *scp)
 {
 /* this is a cut-down version of scrn_timer()... */
 
-if (scp->sc->suspend_in_progress || scp->sc->font_loading_in_progress)
+if (suspend_in_progress || scp->sc->font_loading_in_progress)
return;
 
 if (debugger > 0 || panicstr || shutdown_in_progress) {
@@ -1768,7 +1786,7 @@ scrn_timer(void *arg)
return;
 
 /* don't do anything when we are performing some I/O operations */
-if (sc->suspend_in_progress || sc->font_loading_in_progress) {
+if (suspend_in_progress || sc->font_loading_in_progress) {
if (again)
timeout(scrn_timer, sc, hz / 10);
return;
@@ -3007,16 +3025,64 @@ scterm(int unit, int flags)
 }
 
 static void
-scshutdown(void *arg, int howto)
+scshutdown(__unused void *arg, __unused int howto)
 {
-/* assert(sc_console != NULL) */
 
-sc_touch_scrn_saver();
-if (!cold && sc_console
-   && sc_console->sc->cur_scp->smode.mode == VT_AUTO 
-   && sc_console->smode.mode == VT_AUTO)
-   sc_switch_scr(sc_console->sc, sc_console->index);
-shutdown_in_progress = TRUE;
+   KASSERT(sc_console != NULL, ("sc_console != NULL"));
+   KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL"));
+   KASSERT(sc_console->sc->cur_scp != NULL,
+   ("sc_console->sc->cur_scp != NULL"));
+
+   sc_touch_scrn_saver();
+   if (!cold &&
+   sc_console->sc->cur_scp->index != s

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

2011-05-09 Thread David Christensen
Author: davidch
Date: Mon May  9 18:46:53 2011
New Revision: 221709
URL: http://svn.freebsd.org/changeset/base/221709

Log:
  - Simplify multicast address programming.
  - Fix an incorrect "uint32_t *" cast in bxe_set_rx_mode().
  
  Submitted by:   yongari@
  Approved by:davidch@
  MFC after:  Two weeks

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   Mon May  9 18:46:49 2011(r221708)
+++ head/sys/dev/bxe/if_bxe.c   Mon May  9 18:46:53 2011(r221709)
@@ -3323,7 +3323,7 @@ bxe_stop_locked(struct bxe_softc *sc, in
bxe_set_mac_addr_e1(sc, 0);
 
for (i = 0; i < config->hdr.length; i++)
-   CAM_INVALIDATE(config->config_table[i]);
+   CAM_INVALIDATE(&config->config_table[i]);
 
config->hdr.length = i;
config->hdr.offset = BXE_MAX_MULTICAST * (1 + port);
@@ -14254,6 +14254,8 @@ static void
 bxe_set_mac_addr_e1(struct bxe_softc *sc, int set)
 {
struct mac_configuration_cmd *config;
+   struct mac_configuration_entry *config_table;
+   uint8_t *eaddr;
int port;
 
DBENTER(BXE_VERBOSE_MISC);
@@ -14274,43 +14276,40 @@ bxe_set_mac_addr_e1(struct bxe_softc *sc
config->hdr.reserved1 = 0;
 
/* Program the primary MAC address. */
-   config->config_table[0].cam_entry.msb_mac_addr =
-   ntohs(*(uint16_t *)&sc->link_params.mac_addr[0]);
-   config->config_table[0].cam_entry.middle_mac_addr =
-   ntohs(*(uint16_t *)&sc->link_params.mac_addr[2]);
-   config->config_table[0].cam_entry.lsb_mac_addr =
-   ntohs(*(uint16_t *)&sc->link_params.mac_addr[4]);
-   config->config_table[0].cam_entry.flags = htole16(port);
+   config_table = &config->config_table[0];
+   eaddr = sc->link_params.mac_addr;
+   config_table->cam_entry.msb_mac_addr = eaddr[0] << 8 | eaddr[1];
+   config_table->cam_entry.middle_mac_addr = eaddr[2] << 8 | eaddr[3];
+   config_table->cam_entry.lsb_mac_addr = eaddr[4] << 8 | eaddr[5];
+   config_table->cam_entry.flags = htole16(port);
 
if (set)
-   config->config_table[0].target_table_entry.flags = 0;
+   config_table->target_table_entry.flags = 0;
else
-   CAM_INVALIDATE(config->config_table[0]);
+   CAM_INVALIDATE(config_table);
 
-   /* t48  config->config_table[0].target_table_entry.client_id = 0; */
-   config->config_table[0].target_table_entry.vlan_id = 0;
+   config_table->target_table_entry.vlan_id = 0;
 
DBPRINT(sc, BXE_VERBOSE, "%s(): %s MAC (%04x:%04x:%04x)\n",
   __FUNCTION__, (set ? "Setting" : "Clearing"),
-  config->config_table[0].cam_entry.msb_mac_addr,
-  config->config_table[0].cam_entry.middle_mac_addr,
-  config->config_table[0].cam_entry.lsb_mac_addr);
+  config_table->cam_entry.msb_mac_addr,
+  config_table->cam_entry.middle_mac_addr,
+  config_table->cam_entry.lsb_mac_addr);
 
/* Program the broadcast MAC address. */
-   config->config_table[1].cam_entry.msb_mac_addr = 0x;
-   config->config_table[1].cam_entry.middle_mac_addr = 0x;
-   config->config_table[1].cam_entry.lsb_mac_addr = 0x;
-   config->config_table[1].cam_entry.flags = htole16(port);
+   config_table = &config->config_table[1];
+   config_table->cam_entry.msb_mac_addr = 0x;
+   config_table->cam_entry.middle_mac_addr = 0x;
+   config_table->cam_entry.lsb_mac_addr = 0x;
+   config_table->cam_entry.flags = htole16(port);
 
if (set)
-   config->config_table[1].target_table_entry.flags =
+   config_table->target_table_entry.flags =
TSTORM_CAM_TARGET_TABLE_ENTRY_BROADCAST;
else
-   CAM_INVALIDATE(config->config_table[1]);
-
-   /*t48   config->config_table[1].target_table_entry.client_id = 0; */
-   config->config_table[1].target_table_entry.vlan_id = 0;
+   CAM_INVALIDATE(config_table);
 
+   config_table->target_table_entry.vlan_id = 0;
 
/* Post the command to slow path queue. */
bxe_sp_post(sc, RAMROD_CMD_ID_ETH_SET_MAC, 0,
@@ -14330,6 +14329,8 @@ static void
 bxe_set_mac_addr_e1h(struct bxe_softc *sc, int set)
 {
struct mac_configuration_cmd_e1h *config;
+   struct mac_configuration_entry_e1h *config_table;
+   uint8_t *eaddr;
int func, port;
 
DBENTER(BXE_VERBOSE_MISC);
@@ -14356,30 +14357,27 @@ bxe_set_mac_addr_e1h(struct bxe_softc *s
config->hdr.reserved1 = 0;
 
/* Program the primary MAC address. */
-   config->config_table[0].msb_mac_addr =
-   ntohs(*(uint16_t *)&sc->link_params.mac_addr[0]);
-   config->config_table[0].middle_mac_addr =
-   

Re: svn commit: r221604 - head/usr.sbin/usbdump

2011-05-09 Thread David Schultz
On Sun, May 08, 2011, Bruce Evans wrote:
> #define   bzero(p, n) ({  \
>   if (__builtin_constant_p(n) && (n) <= 32)   \
>   __builtin_memset((p), 0, (n));  \
>   else\
>   (bzero)((p), (n));  \
> })
> 
> This hard-codes the limit of 32 for the builtin since some versions of
> gcc use a worse limit.
> 
> In userland, on at least amd64 and i386, the extern bzero() and memset()
> are unoptimized, but the compiler builtin is used for memset() only.  A
> better implementation of bzero() would use the compiler builtin for it
> too.  The above is not good enough for libc, since it evaluates args more
> than once and has a hard-coded gccism.

__builtin_constant_p(exp) is a special macro that doesn't (or
shouldn't) cause exp to be evaluated, so your defintion shouldn't
cause the argument to be evaluated more than once unless it is, in
fact, a constant expression... and if it's a constant expression,
we don't care.

gcc purportedly has a bzero() builtin, by the way.  I'm not sure
if it's normally enabled, or whether it's any good.  I doubt it's
smart enough to translate memset(p, 0, len) into bzero(p, len).
___
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: r221712 - head/sys/dev/bge

2011-05-09 Thread Pyun YongHyeon
Author: yongari
Date: Mon May  9 20:10:46 2011
New Revision: 221712
URL: http://svn.freebsd.org/changeset/base/221712

Log:
  Since r117657, bge(4) does not enable buffer manager for BCM5705 or
  newer controllers.  However, all data sheet I have access has no
  indication that buffer manager should not be touched on these
  controllers.  It seems the buffer manager always runs on BCM5705 or
  newer controllers. Some controller(e.g. BCM5719) needs other buffer
  manager configuration so driver should enable buffer manager for
  all controllers.  Both Linux and OpenBSD/NetBSD use the same
  approach.
  This change polls enable bit of block to know whether specified
  block was really stopped as well as enabling buffer manager for all
  controllers in driver initialization.
  
  Obtained from:NetBSD

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

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Mon May  9 19:40:36 2011(r221711)
+++ head/sys/dev/bge/if_bge.c   Mon May  9 20:10:46 2011(r221712)
@@ -403,6 +403,7 @@ static void bge_start(struct ifnet *);
 static int bge_ioctl(struct ifnet *, u_long, caddr_t);
 static void bge_init_locked(struct bge_softc *);
 static void bge_init(void *);
+static void bge_stop_block(struct bge_softc *, bus_size_t, uint32_t);
 static void bge_stop(struct bge_softc *);
 static void bge_watchdog(struct bge_softc *);
 static int bge_shutdown(device_t);
@@ -1593,22 +1594,19 @@ bge_blockinit(struct bge_softc *sc)
CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10);
 
/* Enable buffer manager */
-   if (!(BGE_IS_5705_PLUS(sc))) {
-   CSR_WRITE_4(sc, BGE_BMAN_MODE,
-   BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN);
+   CSR_WRITE_4(sc, BGE_BMAN_MODE,
+   BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN);
 
-   /* Poll for buffer manager start indication */
-   for (i = 0; i < BGE_TIMEOUT; i++) {
-   DELAY(10);
-   if (CSR_READ_4(sc, BGE_BMAN_MODE) & BGE_BMANMODE_ENABLE)
-   break;
-   }
+   /* Poll for buffer manager start indication */
+   for (i = 0; i < BGE_TIMEOUT; i++) {
+   DELAY(10);
+   if (CSR_READ_4(sc, BGE_BMAN_MODE) & BGE_BMANMODE_ENABLE)
+   break;
+   }
 
-   if (i == BGE_TIMEOUT) {
-   device_printf(sc->bge_dev,
-   "buffer manager failed to start\n");
-   return (ENXIO);
-   }
+   if (i == BGE_TIMEOUT) {
+   device_printf(sc->bge_dev, "buffer manager failed to start\n");
+   return (ENXIO);
}
 
/* Enable flow-through queues */
@@ -5136,6 +5134,20 @@ bge_watchdog(struct bge_softc *sc)
ifp->if_oerrors++;
 }
 
+static void
+bge_stop_block(struct bge_softc *sc, bus_size_t reg, uint32_t bit)
+{
+   int i;
+
+   BGE_CLRBIT(sc, reg, bit);
+
+   for (i = 0; i < BGE_TIMEOUT; i++) {
+   if ((CSR_READ_4(sc, reg) & bit) == 0)
+   return;
+   DELAY(100);
+}
+}
+
 /*
  * Stop the adapter and free any mbufs allocated to the
  * RX and TX lists.
@@ -5164,35 +5176,36 @@ bge_stop(struct bge_softc *sc)
/*
 * Disable all of the receiver blocks.
 */
-   BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_RBDI_MODE, BGE_RBDIMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_RXLP_MODE, BGE_RXLPMODE_ENABLE);
-   if (!(BGE_IS_5705_PLUS(sc)))
-   BGE_CLRBIT(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_RDBDI_MODE, BGE_RBDIMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_RBDC_MODE, BGE_RBDCMODE_ENABLE);
+   bge_stop_block(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE);
+   bge_stop_block(sc, BGE_RBDI_MODE, BGE_RBDIMODE_ENABLE);
+   bge_stop_block(sc, BGE_RXLP_MODE, BGE_RXLPMODE_ENABLE);
+   if (BGE_IS_5700_FAMILY(sc))
+   bge_stop_block(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE);
+   bge_stop_block(sc, BGE_RDBDI_MODE, BGE_RBDIMODE_ENABLE);
+   bge_stop_block(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
+   bge_stop_block(sc, BGE_RBDC_MODE, BGE_RBDCMODE_ENABLE);
 
/*
 * Disable all of the transmit blocks.
 */
-   BGE_CLRBIT(sc, BGE_SRS_MODE, BGE_SRSMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_SBDI_MODE, BGE_SBDIMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_RDMA_MODE, BGE_RDMAMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE);
-   if (!(BGE_IS_5705_PLUS(sc)))
-   BGE_CLRBIT(sc, BGE_DMAC_MODE, BGE_DMACMODE_ENABLE);
-   BGE_CLRBIT(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE);
+   bge_stop_block(sc, BGE_SRS_MODE, BGE_S

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

2011-05-09 Thread Pyun YongHyeon
Author: yongari
Date: Mon May  9 20:20:43 2011
New Revision: 221713
URL: http://svn.freebsd.org/changeset/base/221713

Log:
  Recognize BCM5719C PHY.
  
  Submitted by: Geans Pin at Broadcom

Modified:
  head/sys/dev/mii/brgphy.c
  head/sys/dev/mii/miidevs

Modified: head/sys/dev/mii/brgphy.c
==
--- head/sys/dev/mii/brgphy.c   Mon May  9 20:10:46 2011(r221712)
+++ head/sys/dev/mii/brgphy.c   Mon May  9 20:20:43 2011(r221713)
@@ -140,6 +140,7 @@ static const struct mii_phydesc brgphys[
MII_PHY_DESC(BROADCOM2, BCM5761),
MII_PHY_DESC(BROADCOM2, BCM5784),
MII_PHY_DESC(BROADCOM3, BCM5717C),
+   MII_PHY_DESC(BROADCOM3, BCM5719C),
MII_PHY_DESC(BROADCOM3, BCM57765),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906),
MII_PHY_END

Modified: head/sys/dev/mii/miidevs
==
--- head/sys/dev/mii/miidevsMon May  9 20:10:46 2011(r221712)
+++ head/sys/dev/mii/miidevsMon May  9 20:20:43 2011(r221713)
@@ -177,6 +177,7 @@ model BROADCOM2 BCM5709C0x003c BCM5709 
 model BROADCOM2 BCM57610x003d BCM5761 10/100/1000baseT PHY
 model BROADCOM2 BCM5709S   0x003f BCM5709S 1000/2500baseSX PHY
 model BROADCOM3 BCM5717C   0x0020 BCM5717C 1000BASE-T media interface
+model BROADCOM3 BCM5719C   0x0022 BCM5719C 1000BASE-T media interface
 model BROADCOM3 BCM57765   0x0024 BCM57765 1000BASE-T media interface
 model xxBROADCOM_ALT1 BCM5906  0x0004 BCM5906 10/100baseTX media interface
 
___
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: r221714 - head/sys/vm

2011-05-09 Thread Max Laier
Author: mlaier
Date: Mon May  9 20:27:49 2011
New Revision: 221714
URL: http://svn.freebsd.org/changeset/base/221714

Log:
  Another long standing vm bug found at Isilon:
   Fix a race between vm_object_collapse and vm_fault.
  
  Reviewed by:  alc@
  MFC after:3 days

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Mon May  9 20:20:43 2011(r221713)
+++ head/sys/vm/vm_object.c Mon May  9 20:27:49 2011(r221714)
@@ -1468,6 +1468,24 @@ vm_object_backing_scan(vm_object_t objec
 
pp = vm_page_lookup(object, new_pindex);
if (
+   (op & OBSC_COLLAPSE_NOWAIT) != 0 &&
+   (pp != NULL && pp->valid == 0)
+   ) {
+   /*
+* The page in the parent is not (yet) valid.
+* We don't know anything about the state of
+* the original page.  It might be mapped,
+* so we must avoid the next if here.
+*
+* This is due to a race in vm_fault() where
+* we must unbusy the original (backing_obj)
+* page before we can (re)lock the parent.
+* Hence we can get here.
+*/
+   p = next;
+   continue;
+   }
+   if (
pp != NULL ||
vm_pager_has_page(object, new_pindex, NULL, 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: r221715 - head/contrib/less

2011-05-09 Thread Xin LI
Author: delphij
Date: Mon May  9 21:51:59 2011
New Revision: 221715
URL: http://svn.freebsd.org/changeset/base/221715

Log:
  MFV: Update to less v443.
  
  MFC after:1 month

Modified:
  head/contrib/less/LICENSE
  head/contrib/less/Makefile.aut
  head/contrib/less/Makefile.wnm
  head/contrib/less/NEWS
  head/contrib/less/README
  head/contrib/less/brac.c
  head/contrib/less/ch.c
  head/contrib/less/charset.c
  head/contrib/less/charset.h
  head/contrib/less/cmd.h
  head/contrib/less/cmdbuf.c
  head/contrib/less/command.c
  head/contrib/less/configure
  head/contrib/less/configure.ac
  head/contrib/less/cvt.c
  head/contrib/less/decode.c
  head/contrib/less/defines.ds
  head/contrib/less/defines.h.in
  head/contrib/less/defines.o2
  head/contrib/less/defines.o9
  head/contrib/less/defines.wn
  head/contrib/less/edit.c
  head/contrib/less/filename.c
  head/contrib/less/forwback.c
  head/contrib/less/funcs.h
  head/contrib/less/help.c
  head/contrib/less/ifile.c
  head/contrib/less/input.c
  head/contrib/less/jump.c
  head/contrib/less/less.h
  head/contrib/less/less.hlp
  head/contrib/less/less.man
  head/contrib/less/less.nro
  head/contrib/less/lessecho.c
  head/contrib/less/lessecho.man
  head/contrib/less/lessecho.nro
  head/contrib/less/lesskey.c
  head/contrib/less/lesskey.h
  head/contrib/less/lesskey.man
  head/contrib/less/lesskey.nro
  head/contrib/less/lglob.h
  head/contrib/less/line.c
  head/contrib/less/linenum.c
  head/contrib/less/lsystem.c
  head/contrib/less/main.c
  head/contrib/less/mark.c
  head/contrib/less/mkhelp.c
  head/contrib/less/optfunc.c
  head/contrib/less/option.c
  head/contrib/less/option.h
  head/contrib/less/opttbl.c
  head/contrib/less/os.c
  head/contrib/less/output.c
  head/contrib/less/pattern.c
  head/contrib/less/pattern.h
  head/contrib/less/pckeys.h
  head/contrib/less/position.c
  head/contrib/less/position.h
  head/contrib/less/prompt.c
  head/contrib/less/screen.c
  head/contrib/less/scrsize.c
  head/contrib/less/search.c
  head/contrib/less/signal.c
  head/contrib/less/tags.c
  head/contrib/less/ttyin.c
  head/contrib/less/version.c
Directory Properties:
  head/contrib/less/   (props changed)

Modified: head/contrib/less/LICENSE
==
--- head/contrib/less/LICENSE   Mon May  9 20:27:49 2011(r221714)
+++ head/contrib/less/LICENSE   Mon May  9 21:51:59 2011(r221715)
@@ -2,7 +2,7 @@
   
 
 Less
-Copyright (C) 1984-2009  Mark Nudelman
+Copyright (C) 1984-2011  Mark Nudelman
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions

Modified: head/contrib/less/Makefile.aut
==
--- head/contrib/less/Makefile.aut  Mon May  9 20:27:49 2011
(r221714)
+++ head/contrib/less/Makefile.aut  Mon May  9 21:51:59 2011
(r221715)
@@ -34,6 +34,14 @@ DISTFILES = \
 
 all: help.c funcs.h ${srcdir}/configure 
 
+release: .FORCE
+   ${MAKE} -f Makefile.aut tagall 
+   ${MAKE} -f Makefile.aut all 
+   ${MAKE} -f Makefile.aut clean 
+   ${MAKE} -f Makefile.aut dist
+
+.FORCE:
+
 help.c: less.hlp mkhelp
-mv -f ${srcdir}/help.c ${srcdir}/help.c.old
rm -rf help.c

Modified: head/contrib/less/Makefile.wnm
==
--- head/contrib/less/Makefile.wnm  Mon May  9 20:27:49 2011
(r221714)
+++ head/contrib/less/Makefile.wnm  Mon May  9 21:51:59 2011
(r221715)
@@ -7,11 +7,11 @@ CC = cl
 
 # Normal flags
 CFLAGS = /nologo /ML /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c
-LDFLAGS = /subsystem:console /incremental:no /machine:I386
+LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
 
 # Debugging flags
 #CFLAGS = /nologo /MDd /W3 /GX /Od /Gm /Zi /I "." /D "WIN32" /D "NDEBUG" /D 
"_CONSOLE" /c
-#LDFLAGS = /subsystem:console /incremental:yes /debug /machine:I386
+#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug /machine:I386
 
 LD = link
 LIBS = user32.lib

Modified: head/contrib/less/NEWS
==
--- head/contrib/less/NEWS  Mon May  9 20:27:49 2011(r221714)
+++ head/contrib/less/NEWS  Mon May  9 21:51:59 2011(r221715)
@@ -12,6 +12,37 @@
 
 ==
 
+   Major changes between "less" versions 436 and 443
+
+* Change search behavior such that when a search is given an explicit 
+  pattern, the entire displayed screen is included in the search and 
+  not just the portion after the target line.
+
+* Add -A option to change search behavior to the old way: only
+  the portion of the screen after the target line is searched.
+
+* Add %F formatting to prompt strings, replaced by t

svn commit: r221718 - head/usr.bin/less

2011-05-09 Thread Xin LI
Author: delphij
Date: Tue May 10 01:05:41 2011
New Revision: 221718
URL: http://svn.freebsd.org/changeset/base/221718

Log:
  Regenerated with latest configure script.
  
  MFC after:1 month

Modified:
  head/usr.bin/less/defines.h

Modified: head/usr.bin/less/defines.h
==
--- head/usr.bin/less/defines.h Mon May  9 22:29:54 2011(r221717)
+++ head/usr.bin/less/defines.h Tue May 10 01:05:41 2011(r221718)
@@ -221,6 +221,9 @@
 /* Define HAVE_FILENO if you have the fileno() macro. */
 #define HAVE_FILENO 1
 
+/* Define HAVE_FLOAT if your compiler supports the "double" type. */
+#define HAVE_FLOAT 1
+
 /* Define to 1 if you have the `fsync' function. */
 #define HAVE_FSYNC 1
 
@@ -388,6 +391,9 @@
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "less"
 
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
 /* Define to the version of this package. */
 #define PACKAGE_VERSION "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: r221719 - head/sbin/devd

2011-05-09 Thread Bruce M Simpson
Author: bms
Date: Tue May 10 02:34:11 2011
New Revision: 221719
URL: http://svn.freebsd.org/changeset/base/221719

Log:
  Typo. For USB devices, 'serial' should be 'sernum'.
  See sys/dev/usb/usb_device.c for what devctl_notify() gets.

Modified:
  head/sbin/devd/devd.conf.5

Modified: head/sbin/devd/devd.conf.5
==
--- head/sbin/devd/devd.conf.5  Tue May 10 01:05:41 2011(r221718)
+++ head/sbin/devd/devd.conf.5  Tue May 10 02:34:11 2011(r221719)
@@ -283,7 +283,7 @@ Hub port number (USB)
 Product ID (pccard/USB).
 .It Li release
 Hardware revision (USB)
-.It Li serial
+.It Li sernum
 Serial Number (USB).
 .It Li slot
 Card slot.
___
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: r221720 - head/sys/dev/usb

2011-05-09 Thread Bruce M Simpson
Author: bms
Date: Tue May 10 02:38:44 2011
New Revision: 221720
URL: http://svn.freebsd.org/changeset/base/221720

Log:
  Add VID for Simtec Electronics.
  Add PID for Simtec Electronics EntropyKey, a hardware random number generator.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue May 10 02:34:11 2011(r221719)
+++ head/sys/dev/usb/usbdevsTue May 10 02:38:44 2011(r221720)
@@ -681,6 +681,7 @@ vendor HAUPPAUGE2   0x2040  Hauppauge Compu
 vendor TLAYTECH0x20b9  Tlay Tech
 vendor ENCORE  0x203d  Encore
 vendor PARA0x20b8  PARA Industrial
+vendor SIMTEC  0x20df  Simtec Electronics
 vendor ERICSSON0x2282  Ericsson
 vendor MOTOROLA2   0x22b8  Motorola
 vendor TRIPPLITE   0x2478  Tripp-Lite
@@ -2513,6 +2514,9 @@ product PANASONIC TYTP50P6S   0x3900  TY-TP
 /* PARA Industrial products */
 product PARA RT30700x  RT3070
 
+/* Simtec Electronics products */
+product SIMTEC ENTROPYKEY  0x0001  Entropy Key
+
 /* Pegatron products */
 product PEGATRON RT28700x0002  RT2870
 product PEGATRON RT30700x000c  RT3070
___
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: r221722 - head/sys/dev/ath/ath_hal/ar9002

2011-05-09 Thread Adrian Chadd
Author: adrian
Date: Tue May 10 04:32:27 2011
New Revision: 221722
URL: http://svn.freebsd.org/changeset/base/221722

Log:
  AR9285 (Kite) fixes.
  
  * Correct some of the silicon revision checks to match what
the Atheros HAL does. (See [1] below.)
  
  * Move the PA cal and init cal method assignment to -after-
the mac version/revision IDs are stored. The AR9285 init
cal was never being called.
  
  * Enable ANI.
  
  Note Kite 1.0 and 1.1 were prototypes that shouldn't be seen
  in the wild. Linux ath9k simply removed the prototype code from
  their codebase. I'm going to leave it in there for now but
  make it conditionally compilable in the future.
  
  Obtained from:Atheros

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue May 10 02:58:08 
2011(r221721)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue May 10 04:32:27 
2011(r221722)
@@ -74,8 +74,33 @@ static void ar9285WriteIni(struct ath_ha
 static void
 ar9285AniSetup(struct ath_hal *ah)
 {
-   /* NB: disable ANI for reliable RIFS rx */
-   ar5416AniAttach(ah, AH_NULL, AH_NULL, AH_FALSE);
+   /*
+* These are the parameters from the AR5416 ANI code;
+* they likely need quite a bit of adjustment for the
+* AR9285.
+*/
+static const struct ar5212AniParams aniparams = {
+.maxNoiseImmunityLevel  = 4,/* levels 0..4 */
+.totalSizeDesired   = { -55, -55, -55, -55, -62 },
+.coarseHigh = { -14, -14, -14, -14, -12 },
+.coarseLow  = { -64, -64, -64, -64, -70 },
+.firpwr = { -78, -78, -78, -78, -80 },
+.maxSpurImmunityLevel   = 2,
+.cycPwrThr1 = { 2, 4, 6 },
+.maxFirstepLevel= 2,/* levels 0..2 */
+.firstep= { 0, 4, 8 },
+.ofdmTrigHigh   = 500,
+.ofdmTrigLow= 200,
+.cckTrigHigh= 200,
+.cckTrigLow = 100,
+.rssiThrHigh= 40,
+.rssiThrLow = 7,
+.period = 100,
+};
+   /* NB: disable ANI noise immmunity for reliable RIFS rx */
+   AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+
+ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
 }
 
 /*
@@ -122,10 +147,6 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9280_adc_init_dc_cal;
AH5416(ah)->ah_cal.suppCals = ADC_GAIN_CAL | ADC_DC_CAL | 
IQ_MISMATCH_CAL;
 
-   if (AR_SREV_KITE_12_OR_LATER(ah))
-   AH5416(ah)->ah_cal_initcal  = ar9285InitCalHardware;
-   AH5416(ah)->ah_cal_pacal= ar9002_hw_pa_cal;
-
AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate;
AH5416(ah)->ah_writeIni = ar9285WriteIni;
AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK;
@@ -173,6 +194,12 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
}
ar5416AttachPCIE(ah);
 
+   /* Attach methods that require MAC version/revision info */
+   if (AR_SREV_KITE_12_OR_LATER(ah))
+   AH5416(ah)->ah_cal_initcal  = ar9285InitCalHardware;
+   if (AR_SREV_KITE_11_OR_LATER(ah))
+   AH5416(ah)->ah_cal_pacal= ar9002_hw_pa_cal;
+
ecode = ath_hal_v4kEepromAttach(ah);
if (ecode != HAL_OK)
goto bad;

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.cTue May 10 02:58:08 
2011(r221721)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.cTue May 10 04:32:27 
2011(r221722)
@@ -60,13 +60,13 @@ ar9285_hw_pa_cal(struct ath_hal *ah, HAL
{ 0x7838, 0 },
};
 
-   HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n");
-
/* PA CAL is not needed for high power solution */
if (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL) ==
AR5416_EEP_TXGAIN_HIGH_POWER)
return;
 
+   HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n");
+
for (i = 0; i < N(regList); i++)
regList[i][1] = OS_REG_READ(ah, regList[i][0]);
 
@@ -151,7 +151,7 @@ ar9285_hw_pa_cal(struct ath_hal *ah, HAL
 void
 ar9002_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset)
 {
-   if (AR_SREV_KITE_12_OR_LATER(ah)) {
+   if (AR_SREV_KITE_11_OR_LATER(ah)) {
if (is_reset || !AH9285(ah)->pacal_info.skipcount)