This patch adds full documentation for seahorse-server-source.c.

Static functions are commented in a non-specific way, the other functions in a GTK-Doc style.

--- pgp/seahorse-server-source.c
+++ pgp/seahorse-server-source.c
@@ -34,6 +34,13 @@
 #include "seahorse-pgp-key.h"

 #include "common/seahorse-registry.h"
+
+/**
+ * SECTION:seahorse-server-source
+ * @short_description: Objects for handling of internet sources of keys (hkp/ldap)
+ * @include:seahorse-server-source.h
+ *
+ **/

 enum {
     PROP_0,
@@ -71,7 +78,13 @@

 static GObjectClass *parent_class = NULL;

-/* Initialize the basic class stuff */
+
+/**
+* klass: Class to initialize
+*
+* Initialize the basic class stuff
+*
+**/
 static void
 seahorse_server_source_class_init (SeahorseServerSourceClass *klass)
 {
@@ -101,22 +114,42 @@
 	seahorse_registry_register_function (NULL, seahorse_pgp_key_canonize_id, "canonize", SEAHORSE_PGP_STR, NULL);
 }

+/**
+* iface: The #SeahorseSourceIface to init
+*
+* Sets the load function in @iface
+*
+* This is the init function of the interface SEAHORSE_TYPE_SOURCE
+*
+**/
 static void
 seahorse_source_iface (SeahorseSourceIface *iface)
 {
 	iface->load = seahorse_server_source_load;
 }

-/* init context, private vars, set prefs, connect signals */
+/**
+* ssrc: A #SeahorseServerSource object
+*
+* init context, private vars, set prefs, connect signals
+*
+**/
 static void
 seahorse_server_source_init (SeahorseServerSource *ssrc)
+
 {
     /* init private vars */
     ssrc->priv = g_new0 (SeahorseServerSourcePrivate, 1);
     ssrc->priv->mop = seahorse_multi_operation_new ();
 }

-/* dispose of all our internal references */
+
+/**
+* gobject: A #SeahorseServerSource object
+*
+* dispose of all our internal references
+*
+**/
 static void
 seahorse_server_source_dispose (GObject *gobject)
 {
@@ -146,7 +179,13 @@
     G_OBJECT_CLASS (parent_class)->dispose (gobject);
 }

-/* free private vars */
+
+/**
+* gobject: A #SeahorseServerSource object
+*
+* free private vars
+*
+**/
 static void
 seahorse_server_source_finalize (GObject *gobject)
 {
@@ -163,6 +202,16 @@
     G_OBJECT_CLASS (parent_class)->finalize (gobject);
 }

+/**
+* object: A SeahorseServerSource object
+* prop_id: The ID of the property to set
+* value: The value to set
+* pspec: ignored
+*
+* Properties that can be set:
+* PROP_KEY_SERVER, PROP_URI
+*
+**/
 static void
 seahorse_server_set_property (GObject *object, guint prop_id,
                               const GValue *value, GParamSpec *pspec)
@@ -185,6 +234,16 @@
     }
 }

+/**
+* object: A #SeahorseServerSource object
+* prop_id: The id of the property
+* value: The value to get
+* pspec: ignored
+*
+* The properties that can be read are:
+* PROP_KEY_SERVER, PROP_URI, PROP_SOURCE_TAG, PROP_SOURCE_LOCATION
+*
+**/
 static void
 seahorse_server_get_property (GObject *object, guint prop_id, GValue *value,
                               GParamSpec *pspec)
@@ -212,6 +271,14 @@
  * HELPERS
  */

+/**
+ * seahorse_server_source_take_operation:
+ * @ssrc: the #SeahorseServerSource to add the @op to
+ * @op: add this to the multioperations stored in @ssrc
+ *
+ *
+ *
+ */
 void
 seahorse_server_source_take_operation (SeahorseServerSource *ssrc, SeahorseOperation *op)
 {
@@ -225,6 +292,13 @@
  * METHODS
  */

+/**
+* src: #SeahorseSource
+*
+* This function is a stub
+*
+* Returns NULL
+**/
 static SeahorseOperation*
 seahorse_server_source_load (SeahorseSource *src)
 {
@@ -237,7 +311,16 @@
     return NULL;
 }

-/* Code adapted from GnuPG (file g10/keyserver.c) */
+/**
+* uri: the uri to parse
+* scheme: the scheme ("http") of this uri
+* host: the host part of the uri
+*
+*
+* Code adapted from GnuPG (file g10/keyserver.c)
+*
+* Returns FALSE if the separation failed
+**/
 static gboolean
 parse_keyserver_uri (char *uri, const char **scheme, const char **host)
 {
@@ -278,6 +361,16 @@
     return TRUE;
 }

+/**
+ * seahorse_server_source_new:
+ * @server: The server uri to create an object for
+ *
+ * Creates a #SeahorseServerSource object out of @server. Depending
+ * on the defines at compilation time other sources are supported
+ * (ldap, hkp)
+ *
+ * Returns: A new SeahorseServerSource or NULL
+ */
 SeahorseServerSource*
 seahorse_server_source_new (const gchar *server)
 {


More styleguide corrections

More styleguide corrections

--- trikControl/src/analogSensor.h
+++ trikControl/src/analogSensor.h
@@ -71,13 +71,16 @@
 	/// Linear approximation coefficient b. Normalized value is calculated as normalizedValue = k * rawValue + b.
 	qreal mB = 0;

-	/// Hyperbolical approximation coefficient l. Normalized value is calculated as normalizedValue = s / (rawValue + l) + n.
+	/// Hyperbolical approximation coefficient l.
+	/// Normalized value is calculated as normalizedValue = s / (rawValue + l) + n.
 	int mL = 0;

-	/// Hyperbolical approximation coefficient n. Normalized value is calculated as normalizedValue = s / (rawValue + l) + n.
+	/// Hyperbolical approximation coefficient n.
+	/// Normalized value is calculated as normalizedValue = s / (rawValue + l) + n.
 	int mN = 0;

-	/// Hyperbolical approximation coefficient s. Normalized value is calculated as normalizedValue = s / (rawValue + l) + n.
+	/// Hyperbolical approximation coefficient s.
+	/// Normalized value is calculated as normalizedValue = s / (rawValue + l) + n.
 	int mS = 0;

 	/// State of a device.


Fixed bug with error on the prepare stage.

--- module/gamepad_control_module.h
+++ module/gamepad_control_module.h
@@ -22,7 +22,7 @@
   colorPrintfModuleVA_t *colorPrintf_p;

  public:
-  GamepadControlModule() : is_error_init(false){};
+  GamepadControlModule() : Gamepad_axis(NULL), COUNT_AXIS(0), is_error_init(false){};

   // init
   const char *getUID();


Added real data to live cprofile; improved handshake format

--- pikos/_internal/_lsprof_rt.c
+++ pikos/_internal/_lsprof_rt.c
@@ -7,15 +7,18 @@
 #include "zmq.h"
 /* #include "nanopb/pb_encode.h" */

-static const int profiler_rt_num_fields = 10;
+static const int profiler_rt_num_fields = 8;
 static const char *profiler_rt_field_names[] = {
     "id", "filename", "line_number", "function_name",
-    "callcount", "cc1?", "total_time", "cumulative_time",
-    "inlinetime", "totaltime"};
+    "callcount", "non-recursive callcount", "total_time", "cumulative_time"};

 /*** cPickle functions ***/

 PyObject *cPickle_loads, *cPickle_dumps;
+
+/*** os functions ***/
+
+PyObject *os_getpid;

 //  Receive 0MQ string from socket and convert into C string
@@ -699,26 +702,45 @@
         return;
     if (profEntry->callcount == 0)
         return;
+
     double factor = profiler_get_factor(pObj);

     PyObject *record;
-    Py_INCREF(Py_None);
-    Py_INCREF(Py_None);
-    Py_INCREF(Py_None);
-    Py_INCREF(Py_None);
-    Py_INCREF(Py_None);
     record = PyTuple_New(profiler_rt_num_fields);
+    if (record == NULL)
+        return;
+
+    PyObject *filename;
+    PyObject *line_number;
+    PyObject *function_name;
+
+    PyObject *code = profEntry->userObj;
+
+    if (PyCode_Check(code)) {
+        filename = PyObject_GetAttrString(code, "co_filename");
+        line_number = PyObject_GetAttrString(code, "co_firstlineno");
+        function_name = PyObject_GetAttrString(code, "co_name");
+    }
+    else if (PyString_CheckExact(code)) {
+        filename = PyString_FromString("~");
+        line_number = PyLong_FromLong(0);
+        Py_INCREF(code);
+        function_name = code;
+    }
+    else {
+        goto rt_profile_send_record_error;
+    }
+
     PyTuple_SetItem(record, 0, PyInt_FromSsize_t((Py_ssize_t)profEntry->userObj)); /* id */
-    PyTuple_SetItem(record, 1, Py_None); /* filename */
-    PyTuple_SetItem(record, 2, Py_None); /* line_number */
-    PyTuple_SetItem(record, 3, Py_None); /* function_name */
+    PyTuple_SetItem(record, 1, filename); /* filename or ~ */
+    PyTuple_SetItem(record, 2, line_number); /* line_number or 0 */
+    PyTuple_SetItem(record, 3, function_name); /* function_name */
     PyTuple_SetItem(record, 4, PyInt_FromLong(profEntry->callcount)); /* callcount */
     PyTuple_SetItem(record, 5, PyInt_FromLong(profEntry->callcount - profEntry->recursivecallcount)); /* cc1? */
-    PyTuple_SetItem(record, 6, PyFloat_FromDouble(factor * profEntry->tt)); /* totaltime */
-    PyTuple_SetItem(record, 7, Py_None); /* cumulative_time */
-    PyTuple_SetItem(record, 8, PyFloat_FromDouble(factor * profEntry->it)); /* inlinetime */
-    PyTuple_SetItem(record, 9, Py_None); /* totaltime */
+    PyTuple_SetItem(record, 6, PyFloat_FromDouble(factor * profEntry->tt)); /* total_time */
+    PyTuple_SetItem(record, 7, PyFloat_FromDouble(factor * profEntry->it)); /* cumulative_time */
     s_send(pObj->data_socket, record);
+ rt_profile_send_record_error:
     Py_XDECREF(record);
 }

@@ -912,18 +934,20 @@

     pObj->context = zmq_init(1);
     if (!pObj->context)
-        return;
+        return -1;
     pObj->data_socket = zmq_socket(pObj->context, ZMQ_PUB);
     if (!pObj->data_socket)
-        return;
+        return -1;
     zmq_bind(pObj->data_socket, "tcp://127.0.0.1:9001");
     pObj->prepare_socket = zmq_socket(pObj->context, ZMQ_REQ);
     if (!pObj->prepare_socket)
-        return;
+        return -1;
     zmq_bind(pObj->prepare_socket, "tcp://127.0.0.1:9002");

     PyObject *fields;
     fields = PyTuple_New(profiler_rt_num_fields);
+    if (fields == NULL)
+        return -1;
     char *string;
     int ix;
     int string_len;
@@ -935,16 +959,23 @@
         PyTuple_SetItem(fields, ix, PyString_FromString(string));
         free(string);
     };
-
-    /* PyObject_Print(fields, stdout, 0); */
-
-    s_send(pObj->prepare_socket, fields);
-
-    /* FIXME: Does this decref the internal elements of the tuple? */
-    Py_XDECREF(fields);
-
+    PyObject *handshake;
+    handshake = PyTuple_New(3);
+    if (handshake == NULL) {
+        Py_XDECREF(fields);
+        return -1;
+    }
+
+    PyObject *my_pid;
+    my_pid = PyObject_CallFunctionObjArgs(os_getpid, NULL);
+
+    PyTuple_SetItem(handshake, 0, my_pid);
+    PyTuple_SetItem(handshake, 1, PyString_FromString("cProfile"));
+    PyTuple_SetItem(handshake, 2, fields);
+
+    s_send(pObj->prepare_socket, handshake);
+    Py_XDECREF(handshake);
     s_recv(pObj->prepare_socket);
-
     return 0;
 }

@@ -1033,6 +1064,13 @@
     cPickle_dumps = PyObject_GetAttrString(cPickle, "dumps");
     Py_XDECREF(cPickle);

+    PyObject *os;
+    os = PyImport_ImportModuleLevel("os", NULL, NULL, NULL, 0);
+    if (!os)
+        return;
+    os_getpid = PyObject_GetAttrString(os, "getpid");
+    Py_XDECREF(os);
+
     d = PyModule_GetDict(module);
     if (PyType_Ready(&PyProfiler_Type) < 0)
         return;


jni: Pass independent character matrices when walking through text.

This avoids altering the matrices previously given to the Text walker.

--- platform/java/mupdf_native.c
+++ platform/java/mupdf_native.c
@@ -3905,10 +3905,6 @@
 	if (text->head == NULL)
 		return; /* text has no spans to walk */

-	/* TODO: We reuse the same Matrix object for each call, but should we? */
-	jtrm = (*env)->NewObject(env, cls_Matrix, mid_Matrix_init, 1, 0, 0, 1, 0, 0);
-	if (!jtrm) return;
-
 	for (span = text->head; span; span = span->next)
 	{
 		if (font != span->font)
@@ -3920,23 +3916,21 @@
 			if (!jfont) return;
 		}

-		(*env)->SetFloatField(env, jtrm, fid_Matrix_a, span->trm.a);
-		(*env)->SetFloatField(env, jtrm, fid_Matrix_b, span->trm.b);
-		(*env)->SetFloatField(env, jtrm, fid_Matrix_c, span->trm.c);
-		(*env)->SetFloatField(env, jtrm, fid_Matrix_d, span->trm.d);
-
 		for (i = 0; i < span->len; ++i)
 		{
-			(*env)->SetFloatField(env, jtrm, fid_Matrix_e, span->items[i].x);
-			(*env)->SetFloatField(env, jtrm, fid_Matrix_f, span->items[i].y);
+			jtrm = (*env)->NewObject(env, cls_Matrix, mid_Matrix_init,
+					span->trm.a, span->trm.b, span->trm.c, span->trm.d,
+					span->items[i].x, span->items[i].y);
+			if (!jtrm) return;

 			(*env)->CallVoidMethod(env, walker, mid_TextWalker_showGlyph,
 					jfont, jtrm,
 					(jint)span->items[i].gid,
 					(jint)span->items[i].ucs,
 					(jint)span->wmode);
-
 			if ((*env)->ExceptionCheck(env)) return;
+
+			(*env)->DeleteLocalRef(env, jtrm);
 		}
 	}
 }


msm8960: Set MMC clk to 144KHz during initialization.

With 400KHz as initial frequecy MMC initialization is getting
failed. Set MMC clock to 144KHz during init.

Change-Id: Ie92cf9790c872822043fb9bcb322e74bb81f9af7

--- platform/msm8960/acpuclock.c
+++ platform/msm8960/acpuclock.c
@@ -185,7 +185,7 @@
 	switch(freq)
 	{
 	case MMC_CLK_400KHZ:
-		rate = 400000;
+		rate = 144000;
 		break;
 	case MMC_CLK_48MHZ:
 	case MMC_CLK_50MHZ: /* Max supported is 48MHZ */


use all encoding definitions

use all encoding definitions

--- platform/shared/ruby/encdb.h
+++ platform/shared/ruby/encdb.h
@@ -1,8 +1,6 @@
 ENC_DEFINE("ASCII-8BIT");
 ENC_DEFINE("UTF-8");
 ENC_DEFINE("US-ASCII");
-//RHO
-/*
 ENC_DEFINE("Big5");
 ENC_DEFINE("Big5-HKSCS");
 ENC_DEFINE("Big5-UAO");
@@ -14,11 +12,7 @@
 ENC_DEFINE("GB2312");
 ENC_DEFINE("GB18030");
 ENC_DEFINE("GBK");
-*/
-//RHO
 ENC_DEFINE("ISO-8859-1");
-//RHO
-/*
 ENC_DEFINE("ISO-8859-2");
 ENC_DEFINE("ISO-8859-3");
 ENC_DEFINE("ISO-8859-4");
@@ -26,11 +20,7 @@
 ENC_DEFINE("ISO-8859-6");
 ENC_DEFINE("ISO-8859-7");
 ENC_DEFINE("ISO-8859-8");
-*/
-//RHO
 ENC_DEFINE("ISO-8859-9");
-//RHO
-/*
 ENC_DEFINE("ISO-8859-10");
 ENC_DEFINE("ISO-8859-11");
 ENC_DEFINE("ISO-8859-13");
@@ -48,8 +38,6 @@
 ENC_DEFINE("Windows-1250");
 ENC_DEFINE("Windows-1251");
 ENC_DEFINE("Windows-1252");
-*/
-//RHO
 ENC_ALIAS("BINARY", "ASCII-8BIT");
 ENC_REPLICATE("IBM437", "ASCII-8BIT");
 ENC_ALIAS("CP437", "IBM437");
@@ -94,8 +82,6 @@
 ENC_REPLICATE("macThai", "ASCII-8BIT");
 ENC_REPLICATE("macTurkish", "ASCII-8BIT");
 ENC_REPLICATE("macUkraine", "ASCII-8BIT");
-//RHO
-/*
 ENC_REPLICATE("CP950", "Big5");
 ENC_SET_BASE("Big5-HKSCS", "Big5");
 ENC_ALIAS("Big5-HKSCS:2008", "Big5-HKSCS");
@@ -104,12 +90,12 @@
 ENC_DUMMY("IBM037");
 ENC_ALIAS("ebcdic-cp-us", "IBM037");
 ENC_REPLICATE("stateless-ISO-2022-JP", "Emacs-Mule");
-ENC_ALIAS("eucJP", "EUC-JP") ;
-ENC_REPLICATE("eucJP-ms", "EUC-JP") ;
+ENC_ALIAS("eucJP", "EUC-JP") /* UI-OSF Application Platform Profile for Japanese Environment Version 1.1 */;
+ENC_REPLICATE("eucJP-ms", "EUC-JP") /* TOG/JVC CDE/Motif Technical WG */;
 ENC_ALIAS("euc-jp-ms", "eucJP-ms");
 ENC_REPLICATE("CP51932", "EUC-JP");
-ENC_REPLICATE("EUC-JIS-2004", "EUC-JP");
-ENC_ALIAS("EUC-JISX0213", "EUC-JIS-2004");
+ENC_REPLICATE("EUC-JIS-2004", "EUC-JP") /* defined at JIS X 0213:2004 */;
+ENC_ALIAS("EUC-JISX0213", "EUC-JIS-2004") /* defined at JIS X 0213:2000, and obsolete at JIS X 0213:2004 */;
 ENC_ALIAS("eucKR", "EUC-KR");
 ENC_ALIAS("eucTW", "EUC-TW");
 ENC_ALIAS("EUC-CN", "GB2312");
@@ -153,30 +139,22 @@
 ENC_ALIAS("CP878", "KOI8-R");
 ENC_REPLICATE("MacJapanese", "Shift_JIS");
 ENC_ALIAS("MacJapan", "MacJapanese");
-*/
-//RHO
 ENC_ALIAS("ASCII", "US-ASCII");
 ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII");
 ENC_ALIAS("646", "US-ASCII");
-//RHO
-/*
 ENC_DUMMY("UTF-7");
 ENC_ALIAS("CP65000", "UTF-7");
-*/
-//RHO
 ENC_ALIAS("CP65001", "UTF-8");
 ENC_REPLICATE("UTF8-MAC", "UTF-8");
 ENC_ALIAS("UTF-8-MAC", "UTF8-MAC");
 ENC_ALIAS("UTF-8-HFS", "UTF8-MAC") /* Emacs 23.2 */;
 ENC_DUMMY_UNICODE("UTF-16");
 ENC_DUMMY_UNICODE("UTF-32");
-//RHO
-/*
 ENC_ALIAS("UCS-2BE", "UTF-16BE");
 ENC_ALIAS("UCS-4BE", "UTF-32BE");
 ENC_ALIAS("UCS-4LE", "UTF-32LE");
 ENC_ALIAS("CP932", "Windows-31J");
-ENC_ALIAS("csWindows31J", "Windows-31J");
+ENC_ALIAS("csWindows31J", "Windows-31J") /* IANA.  IE6 don't accept Windows-31J but csWindows31J. */;
 ENC_ALIAS("SJIS", "Windows-31J");
 ENC_ALIAS("PCK", "Windows-31J");
 ENC_ALIAS("CP1250", "Windows-1250");
@@ -190,6 +168,5 @@
 ENC_REPLICATE("stateless-ISO-2022-JP-KDDI", "stateless-ISO-2022-JP");
 ENC_REPLICATE("UTF8-SoftBank", "UTF-8");
 ENC_REPLICATE("SJIS-SoftBank", "Windows-31J");
-*/
-//RHO
-#define ENCODING_COUNT 35
+
+#define ENCODING_COUNT 101


bid's no longer use fg

bid's no longer use fg

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@12198 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- mount_slash/bmap_flush.c
+++ mount_slash/bmap_flush.c
@@ -769,8 +769,7 @@
 static __inline void
 bmap_2_bid(const struct bmapc_memb *b, struct srm_bmap_id *bid)
 {
-	bid->fg.fg_fid = fcmh_2_fid(b->bcm_fcmh);
-	bid->fg.fg_gen = fcmh_2_gen(b->bcm_fcmh);
+	bid->fid = fcmh_2_fid(b->bcm_fcmh);
 	bid->seq = bmap_2_msbd(b)->msbd_sbd.sbd_seq;
 	bid->key = bmap_2_msbd(b)->msbd_sbd.sbd_key;
 	bid->bmapno = b->bcm_bmapno;
@@ -812,9 +811,9 @@

  out:
 	for (i = 0; i < rmci->rmci_bmaprls.nbmaps; i++)
-		psc_notify("fid "FIDFMT" bmap=%u key=%"PRId64
+		psc_notify("fid=%"PRId64" bmap=%u key=%"PRId64
 		    " seq=%"PRId64" rc=%d",
-		    FIDFMTARGS(&rmci->rmci_bmaprls.bmaps[i].fg),
+		    rmci->rmci_bmaprls.bmaps[i].fid,
 		    rmci->rmci_bmaprls.bmaps[i].bmapno,
 		    rmci->rmci_bmaprls.bmaps[i].key,
 		    rmci->rmci_bmaprls.bmaps[i].seq,


IR test passes using default robot c driver

error: pathspec 'i_IrSensCmd.c' did not match any file(s) known to git

--- i_IrSensCmd.c
+++ i_IrSensCmd.c
@@ -0,0 +1,121 @@
+#pragma config(Hubs,  S1, MatrxRbtcs, none,     none,     none)
+#pragma config(Sensor, S2,     irSensor,       sensorHiTechnicIRSeeker1200)
+#pragma config(Motor,  mtr_Matrix_S1_1, motorD,        tmotorMatrix, openLoop)
+#pragma config(Motor,  mtr_Matrix_S1_2, motorE,        tmotorMatrix, openLoop)
+#pragma config(Motor,  mtr_Matrix_S1_3, motorF,        tmotorMatrix, openLoop)
+#pragma config(Motor,  mtr_Matrix_S1_4, motorG,        tmotorMatrix, openLoop)
+#pragma config(Servo,  srvo_Matrix_S1_1, servo1,               tServoNone)
+#pragma config(Servo,  srvo_Matrix_S1_2, servo2,               tServoNone)
+#pragma config(Servo,  srvo_Matrix_S1_3, irSvo,                tServoStandard)
+#pragma config(Servo,  srvo_Matrix_S1_4, servo4,               tServoNone)
+//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
+
+#ifndef NO_UNIT_TEST
+#endif
+// As a programmer I want to create a steering command to drive toward the IR beacon so that can score points
+//
+//======================================================//
+// Usage:
+//   #pragma config(Sensor, S1,     irSensor,       sensorHiTechnicIRSeeker1200) // IR sensor must be called irSensor
+//   #define NO_UNIT_TEST // Ignore the unit tests of include files
+//
+//  Notes: Region to the left (top view) 1,2,3,4 Forward 5, region to right 6,7,8,9
+//    Use transtions between regions to set a steering command.
+//          5-4,4-3,3-2,2-1,1-0
+//          5-6,6-7,7-8,8-9,9-0
+#define IR_TRANSITION_1 10 // Transition 5-4 or 5-6
+#define IR_TRANSITION_2 20 // Transition 4-3 or 6-7
+#define IR_TRANSITION_3 30 // Transition 3-2 or 7-8
+#define IR_TRANSITION_4 40 // Transition 2-1 or 8-9
+#define IR_TRANSITION_5 50 // Transition 1-0 or 9-0
+int irSensorOld=0;
+int irSensorCur=0;
+int irSensorSteeringCmd=0;
+
+int IrSensCmd(){
+	irSensorOld = irSensorCur;
+	irSensorCur = SensorValue[irSensor];
+
+	if ((irSensorCur==5&&(irSensorOld==6||irSensorOld==4))||
+			(irSensorOld==5&&(irSensorCur==6||irSensorCur==4)))
+		irSensorSteeringCmd=IR_TRANSITION_1;
+	else if ((irSensorCur==4&&irSensorOld==3)||(irSensorCur==6&&irSensorOld==7)||
+					 (irSensorOld==4&&irSensorCur==3)||(irSensorOld==6&&irSensorCur==7))
+		irSensorSteeringCmd=IR_TRANSITION_2;
+	else if ((irSensorCur==3&&irSensorOld==2)||(irSensorCur==7&&irSensorOld==8)||
+					 (irSensorOld==3&&irSensorCur==2)||(irSensorOld==7&&irSensorCur==8))
+		irSensorSteeringCmd=IR_TRANSITION_3;
+	else if ((irSensorCur==2&&irSensorOld==1)||(irSensorCur==8&&irSensorOld==9)||
+					 (irSensorOld==2&&irSensorCur==1)||(irSensorOld==8&&irSensorCur==9))
+		irSensorSteeringCmd=IR_TRANSITION_4;
+
+	return(irSensorSteeringCmd);
+}
+// ==================UNIT TEST==========================//
+#ifndef NO_UNIT_TEST
+#include "i_debug.c"
+int timeLeft=0; // A global variable used to adjust the time it takes to complet the while loop
+int i=0;
+short sm_cmd=0;
+int irSvoVal=1;
+bool runTest=true;
+#define INC 0
+#define DEC 1
+#define FOREGROUND_MS 50 //The while loop takes 50 MS to run. This means the software runs 20 times per second
+task main(){
+	// Initialize variables here //
+	int myInt=0;
+	int in=0;
+	int out=0;
+	int out2;
+	//Debug2File(); //Send the debug information to the file debug.txt
+	//Debug2NXT();  //Send the debug information to the NXT screen
+	Debug2Stream(); //Send the debug information to the PC Screen
+
+	// End of initialize //
+	while(runTest){
+		clearTimer(T1);
+		hogCPU(); //Prevent other tasks from running when this one is.
+		// ------------- Put Unit Test code here -------------------//
+		// xxxxxxx [] Transition 5-6 or 6-5 or 4-5 or 5-4 sends out IR_TRANSITION_1
+		// xxxxxxx [] Transition 6-7 or 7-6 or 3-4 or 4-3 sends out IR_TRANSITION_2
+		// xxxxxxx [] Transition 7-8 or 8-7 or 2-3 or 3-2 sends out IR_TRANSITION_3
+		// xxxxxxx [] Transition 8-9 or 9-8 or 1-2 or 2-1 sends out IR_TRANSITION_4
+		// xxxxxxx [] Transition 9-0 or 0-9 or 0-1 or 1-0 does not change output
+
+		// ------- Move IR Servo -----//
+		switch (sm_cmd) {
+		case INC:
+			if (irSvoVal>255) sm_cmd=DEC;
+			irSvoVal+=3;
+		break;
+		case DEC:
+			if (irSvoVal<1) runTest=false;
+			irSvoVal-=3;
+		break;
+		}
+		servo[irSvo]=irSvoVal;
+
+
+		// USAGE NOTES:
+		//   The units for a are encoder clicks
+		//   Set #define NO_UNIT_TEST
+		out=IrSensCmd();
+
+		out2=IRGetACDir(irSensor);
+		if (irSensorCur!=irSensorOld){
+			DebugInt("SenOld",irSensorOld);
+			DebugInt("SenCur",irSensorCur);
+			DebugInt("SenCmd",out);
+			DebugInt("Svo",irSvoVal);
+			DebugPrint();
+		}
+
+		i+=1; // Increment the frame counter for unit test
+		// ------------- Unit code test is done here ---------------//
+		timeLeft=FOREGROUND_MS-time1[T1]; // Calculate the time used in the foreground
+		releaseCPU(); // Let other tasks run now.
+		wait1Msec(timeLeft);// The time other tasks have to run before foreground takes control.
+	}// While Loop
+}// Main Task
+#endif


proper manager BO include..

proper manager BO include..

--- A10_BoundingObjectManager/BoundingObjectManager.h
+++ A10_BoundingObjectManager/BoundingObjectManager.h
@@ -14,11 +14,7 @@
 #define _BOUNDINGOBJECTMANAGER_H_

 #include "RE\ReEng.h"
-
-//TODO: Delete this later (forward decl for compilation)
-class MyBoundingObjectClass;
-
-
+#include "MyBoundingObjectClass.h"

 class BoundingObjectManager
 {


Create gotoDatabaseBudget.c

Create gotoDatabaseBudget.c

error: pathspec 'ActionLog/scripts/navigation/gotoDatabaseBudget.c' did not match any file(s) known to git

--- ActionLog/scripts/navigation/gotoDatabaseBudget.c
+++ ActionLog/scripts/navigation/gotoDatabaseBudget.c
@@ -0,0 +1,32 @@
+navigation: gotoDatabaseBudget
+Select Window [ Name: "Budget Research" ]
+If [ Get (LastError) = 112 ]
+Open URL [ Case ( Get ( SystemPlatform ) = - 2 ;
+Substitute (
+Substitute (Left (Get (FilePath) ; Length ( Get (FilePath) ) - ( Length ( Get (FileName) ) + 4 ) ) ; "ﬁle:/" ; "ﬁle:/" )
+& "Budget Research." & Right ( Get ( FilePath ) ; 3 )
+ ; " " ; "%20" ) ;
+Substitute (
+Substitute (Left (Get (FilePath) ; Length ( Get (FilePath) ) - ( Length ( Get (FileName) ) + 4 ) ) ; "ﬁle:/" ; "ﬁle://" )
+& "Budget Research." & Right ( Get ( FilePath ) ; 3 )
+ ; " " ; "%20" ) ) ]
+[ No dialog ]
+If [ Get (LastError) = 5 ]
+Open URL [ Case ( Get ( SystemPlatform ) = - 2 ;
+Substitute (
+Substitute (Left (Get (FilePath) ; Length ( Get (FilePath) ) - ( Length ( Get (FileName) ) + 4 ) ) ; "ﬁle:/" ; "ﬁle:/" )
+& "Budget Research.USR"
+ ; " " ; "%20" ) ;
+Substitute (
+Substitute (Left (Get (FilePath) ; Length ( Get (FilePath) ) - ( Length ( Get (FileName) ) + 4 ) ) ; "ﬁle:/" ; "ﬁle://" )
+& "Budget Research.USR"
+ ; " " ; "%20" ) ) ]
+[ No dialog ]
+End If
+End If
+#
+#Close other apps window if open after selecting an app.
+If [ $$otherApps = 1 ]
+Close Window [ Name: "Other Apps"; Current ﬁle ]
+End If
+January 5, 平成26 14:24:00 ActionLog.fp7 - gotoDatabaseBudget -1-


Added a stanza for 'NC_DOUBLE' into the recently-added endians test.

--- nc_test4/tst_h_endians.c
+++ nc_test4/tst_h_endians.c
@@ -24,6 +24,9 @@
 #define BE_FLOAT_VARNAME "fl_be"
 #define LE_INT_VARNAME "int_le"
 #define BE_INT_VARNAME "int_be"
+#define LE_DBL_VARNAME "dbl_le"
+#define BE_DBL_VARNAME "dbl_be"
+
 int main() {

   int ncid, dimid;
@@ -31,6 +34,8 @@
   int be_float_varid;
   int le_int_varid;
   int be_int_varid;
+  int le_dbl_varid;
+  int be_dbl_varid;
   int ed;
   int failures = 0;
   int retval = 0;
@@ -63,6 +68,14 @@
     retval = nc_def_var(ncid, BE_INT_VARNAME, NC_INT, 1, &dimid, &be_int_varid);
     retval = nc_def_var_endian(ncid, be_int_varid, NC_ENDIAN_BIG);

+    /* Little-Endian Double */
+    retval = nc_def_var(ncid, LE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &le_dbl_varid);
+    retval = nc_def_var_endian(ncid, le_dbl_varid, NC_ENDIAN_LITTLE);
+
+    /* Big-Endian Double */
+    retval = nc_def_var(ncid, BE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &be_dbl_varid);
+    retval = nc_def_var_endian(ncid, be_dbl_varid, NC_ENDIAN_BIG);
+

     retval = nc_close(ncid);
   }
@@ -74,6 +87,13 @@
   printf("** Checking test files.\n");
   {
     ncid = 0;
+    le_float_varid = 0;
+    be_float_varid = 0;
+    le_int_varid = 0;
+    be_int_varid = 0;
+    le_dbl_varid = 0;
+    be_dbl_varid = 0;
+
     printf("*** %s\n",FILE_NAME_NC);
     retval = nc_open(FILE_NAME_NC, NC_NETCDF4 | NC_NOWRITE, &ncid);

@@ -81,6 +101,8 @@
     retval = nc_inq_varid(ncid,BE_FLOAT_VARNAME,&be_float_varid);
     retval = nc_inq_varid(ncid,LE_INT_VARNAME,&le_int_varid);
     retval = nc_inq_varid(ncid,BE_INT_VARNAME,&be_int_varid);
+    retval = nc_inq_varid(ncid,LE_DBL_VARNAME,&le_dbl_varid);
+    retval = nc_inq_varid(ncid,BE_DBL_VARNAME,&be_dbl_varid);

     printf("\tLittle-Endian Float...\t");
     retval = nc_inq_var_endian(ncid,le_float_varid,&ed);
@@ -98,6 +120,14 @@
     retval = nc_inq_var_endian(ncid,be_int_varid,&ed);
     if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}

+    printf("\tLittle-Endian Double...\t");
+    retval = nc_inq_var_endian(ncid,le_dbl_varid,&ed);
+    if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    printf("\tBig-Endian Double...\t");
+    retval = nc_inq_var_endian(ncid,be_dbl_varid,&ed);
+    if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
+
     retval = nc_close(ncid);
   }


ncd: modules: valuemetic: fix description

--- ncd/modules/valuemetic.c
+++ ncd/modules/valuemetic.c
@@ -46,11 +46,11 @@
  *   1. Values of different types have the following order: strings, lists, maps.
  *   2. String values are ordered lexicographically, with respect to the numeric values
  *      of their bytes.
- *   3. List values are ordered lexicographically, where the elements are compared by
+ *   3. List values are ordered lexicographically, where the order of the elements is
+ *      defined by recursive application of these rules.
+ *   4. Map values are ordered lexicographically, as if a map was a list of (key, value)
+ *      pairs ordered by key, where the order of both keys and values is defined by
  *      recursive application of these rules.
- *   4. Map values are ordered lexicographically, as if a map was as list of (key, value)
- *      pairs, where both the keys and values are compared by recursive application of
- *      these rules.
  */

 #include <stdlib.h>


Ensure album art is not retrieved until the code has been tested more thoroughly

git-svn-id: 0a6f2aeebe3a339de06b6162ef5a6b6b6e2abc00@1236 b8d320ad-ce4d-463a-8333-51e6c77ad906

--- jni/metadata/media1_jni.c
+++ jni/metadata/media1_jni.c
@@ -91,7 +91,7 @@

 	metadata = NULL;
 	duration = 0;
-	av_init_packet(&album_art);
+	//av_init_packet(&album_art);
 	found_album_art = 0;

     AVFormatContext *fmt_ctx = NULL;
@@ -119,7 +119,7 @@

     metadata = fmt_ctx->metadata;
     duration = getDuration(fmt_ctx);
-    album_art = getAlbumArt(fmt_ctx);
+    //album_art = getAlbumArt(fmt_ctx);

 	__android_log_write(ANDROID_LOG_INFO, TAG, "Found metadata");
 	/*AVDictionaryEntry *tag = NULL;
@@ -222,7 +222,7 @@
 Java_net_sourceforge_servestream_media_MediaMetadataRetriever_release(JNIEnv *env, jclass obj) {
 	__android_log_write(ANDROID_LOG_INFO, TAG, "release");

-    av_free_packet(&album_art);
+    //av_free_packet(&album_art);

     if (metadata) {
         metadata = NULL;


fix: segfault in KmsIRtpSessionManager

fix: segfault in KmsIRtpSessionManager

Sometimes custom_ssrc_management is NULL which causes segfault.
Should fix https://github.com/Kurento/bugtracker/issues/111 in some cases.

--- src/gst-plugins/commons/kmsirtpsessionmanager.c
+++ src/gst-plugins/commons/kmsirtpsessionmanager.c
@@ -71,7 +71,9 @@
     KmsBaseRtpSession * sess, GstElement * ssrcdemux, guint ssrc, GstPad * pad)
 {
   g_return_val_if_fail (KMS_IS_I_RTP_SESSION_MANAGER (self), FALSE);
-
+  g_return_val_if_fail (KMS_I_RTP_SESSION_MANAGER_GET_INTERFACE (self)->
+      custom_ssrc_management, FALSE);
+
   return
       KMS_I_RTP_SESSION_MANAGER_GET_INTERFACE (self)->custom_ssrc_management
       (self, sess, ssrcdemux, ssrc, pad);


runq_sleep

--- src/kernel/thread/sched_policy/priority_based.c
+++ src/kernel/thread/sched_policy/priority_based.c
@@ -79,7 +79,18 @@
 }

 int runq_sleep(struct runq *rq, struct sleepq *sq) {
-	return 0;
+	struct thread *current;
+	struct prioq_link *current_link;
+
+	assert(rq && sq);
+
+	current = rq->current;
+	current_link = &current->sched.pq_link;
+
+	prioq_remove_link(current_link, thread_prio_comparator);
+	prioq_enqueue_link(current_link, thread_prio_comparator, &sq->pq);
+
+	return 1;
 }

 int runq_priority_changing(struct runq *rq, struct thread *t, int new_priority) {


lib-ssl-iostream: Give better error message if CA settings are missing.

--- src/lib-ssl-iostream/iostream-openssl-context.c
+++ src/lib-ssl-iostream/iostream-openssl-context.c
@@ -349,7 +349,9 @@
 	}

 	if (!have_ca) {
-		*error_r = "Can't verify remote certs without CA";
+		*error_r = !ctx->client_ctx ?
+			"Can't verify remote client certs without CA (ssl_ca setting)" :
+			"Can't verify remote server certs without trusted CAs (ssl_client_ca_* settings)";
 		return -1;
 	}
 	return 0;


Maildir: Added more strict asserts.

Maildir: Added more strict asserts.

--HG--
branch : HEAD

--- src/lib-storage/index/maildir/maildir-uidlist.c
+++ src/lib-storage/index/maildir/maildir-uidlist.c
@@ -346,18 +346,20 @@
 	mhdr->uidlist_size = st->st_size;
 }

-static void
+static unsigned int
 maildir_uidlist_records_array_delete(struct maildir_uidlist *uidlist,
 				     struct maildir_uidlist_rec *rec)
 {
 	struct maildir_uidlist_rec *const *recs, *const *pos;
-	unsigned int count;
+	unsigned int idx, count;

 	recs = array_get(&uidlist->records, &count);
 	pos = bsearch(&rec, recs, count, sizeof(*recs), maildir_uid_cmp);
 	i_assert(pos != NULL);

-	array_delete(&uidlist->records, pos - recs, 1);
+	idx = pos - recs;
+	array_delete(&uidlist->records, idx, 1);
+	return idx;
 }

 static bool
@@ -1462,24 +1464,25 @@
 				 const char *filename)
 {
 	struct maildir_uidlist_rec *rec;
+	unsigned int idx;

 	i_assert(ctx->partial);
-
-	if (ctx->first_unwritten_pos != (unsigned int)-1) {
-		i_assert(ctx->first_unwritten_pos > 0);
-		ctx->first_unwritten_pos--;
-	}
-	if (ctx->first_nouid_pos != (unsigned int)-1) {
-		i_assert(ctx->first_nouid_pos > 0);
-		ctx->first_nouid_pos--;
-	}

 	rec = hash_lookup(ctx->uidlist->files, filename);
 	i_assert(rec != NULL);
 	i_assert(rec->uid != (uint32_t)-1);

 	hash_remove(ctx->uidlist->files, filename);
-	maildir_uidlist_records_array_delete(ctx->uidlist, rec);
+	idx = maildir_uidlist_records_array_delete(ctx->uidlist, rec);
+
+	if (ctx->first_unwritten_pos != (unsigned int)-1) {
+		i_assert(ctx->first_unwritten_pos > idx);
+		ctx->first_unwritten_pos--;
+	}
+	if (ctx->first_nouid_pos != (unsigned int)-1) {
+		i_assert(ctx->first_nouid_pos > idx);
+		ctx->first_nouid_pos--;
+	}

 	ctx->changed = TRUE;
 	ctx->uidlist->recreate = TRUE;


maildir: Added some checks for UIDs reaching 2^31-1. Saving messages when it's reached will be handled by assert-crash for now.

--- src/lib-storage/index/maildir/maildir-uidlist.c
+++ src/lib-storage/index/maildir/maildir-uidlist.c
@@ -468,6 +468,11 @@
 		maildir_uidlist_set_corrupted(uidlist,
 					      "UIDs not ordered (%u >= %u)",
 					      uid, uidlist->prev_read_uid);
+		return FALSE;
+	}
+	if (uid >= (uint32_t)-1) {
+		maildir_uidlist_set_corrupted(uidlist,
+					      "UID too high (%u)", uid);
 		return FALSE;
 	}
 	uidlist->prev_read_uid = uid;
@@ -1113,6 +1118,7 @@
 				  uint32_t next_uid, bool force)
 {
 	if (uidlist->next_uid < next_uid || force) {
+		i_assert(next_uid != 0);
 		uidlist->next_uid = next_uid;
 		uidlist->recreate = TRUE;
 	}
@@ -1776,6 +1782,7 @@

 	for (dest = ctx->first_nouid_pos; dest < count; dest++) {
 		i_assert(recs[dest]->uid == (uint32_t)-1);
+		i_assert(ctx->uidlist->next_uid < (uint32_t)-1);
 		recs[dest]->uid = ctx->uidlist->next_uid++;
 		recs[dest]->flags &= ~MAILDIR_UIDLIST_REC_FLAG_MOVED;
 	}


maildir: Make sure we message's UID isn't tried to be changed unexpectedly.

--HG--
branch : HEAD

--- src/lib-storage/index/maildir/maildir-uidlist.c
+++ src/lib-storage/index/maildir/maildir-uidlist.c
@@ -1644,7 +1644,7 @@
 	return 1;
 }

-static void
+static int
 maildir_uidlist_sync_next_partial(struct maildir_uidlist_sync_ctx *ctx,
 				  const char *filename, uint32_t uid,
 				  enum maildir_uidlist_rec_flag flags)
@@ -1658,7 +1658,7 @@
 		/* doesn't exist in uidlist */
 		if (!ctx->locked) {
 			/* we can't add it, so just ignore it */
-			return;
+			return 1;
 		}
 		if (ctx->first_new_pos == (unsigned int)-1)
 			ctx->first_new_pos = array_count(&uidlist->records);
@@ -1679,6 +1679,12 @@
 		uidlist->change_counter++;
 	}
 	if (uid != 0) {
+		if (rec->uid != uid && rec->uid != (uint32_t)-1) {
+			mail_storage_set_critical(uidlist->mbox->box.storage,
+				"Maildir: %s changed UID %u -> %u",
+				filename, rec->uid, uid);
+			return -1;
+		}
 		rec->uid = uid;
 		if (uidlist->next_uid <= uid)
 			uidlist->next_uid = uid + 1;
@@ -1689,6 +1695,7 @@
 	hash_table_insert(uidlist->files, rec->filename, rec);

 	ctx->finished = FALSE;
+	return 1;
 }

 static unsigned char *ext_dup(pool_t pool, const unsigned char *extensions)
@@ -1740,8 +1747,8 @@
 	}

 	if (ctx->partial) {
-		maildir_uidlist_sync_next_partial(ctx, filename, uid, flags);
-		return 1;
+		return maildir_uidlist_sync_next_partial(ctx, filename,
+							 uid, flags);
 	}

 	rec = hash_table_lookup(ctx->files, filename);


Must wait on I2C controller before checking status

We have to wait until the controller is no longer busy before we announce
that we're done. Just waiting for the first interrupt isn't enough, because
that's often just an error indicator and the controller still has to stop.

BUG=none
TEST=none

Change-Id: I065c049111d7de276bf8f7cd0eed39c3f5cff5f4

--- chip/lm4/i2c.c
+++ chip/lm4/i2c.c
@@ -26,7 +26,7 @@
 	int wait_msg;

 	i = LM4_I2C_MCS(port);
-	if (i & 0x01) {
+	while (i & 0x01) {
 		/* Port is busy, so wait for the interrupt */
 		task_waiting_on_port[port] = task_get_current();
 		LM4_I2C_MIMR(port) = 0x03;


properly mark the relay during GC

properly mark the relay during GC

--- swfdec/swfdec_as_object.c
+++ swfdec/swfdec_as_object.c
@@ -245,6 +245,8 @@
   g_hash_table_foreach (object->properties, swfdec_gc_object_mark_property, NULL);
   if (object->watches)
     g_hash_table_foreach (object->watches, swfdec_gc_object_mark_watch, NULL);
+  if (object->relay)
+    swfdec_gc_object_mark (object->relay);
   g_slist_foreach (object->interfaces, (GFunc) swfdec_gc_object_mark, NULL);
 }


add back some bmap handling bits

add back some bmap handling bits

--- mount_slash/bmap_cli.c
+++ mount_slash/bmap_cli.c
@@ -238,6 +238,7 @@
 		b->bcm_flags |= BMAPF_LOADED;
 	} else {
 		/* ignore all errors for this background operation */
+		msl_bmap_cache_rls(b);
 		BMAP_LOCK(b);
 	}

@@ -374,6 +375,7 @@
 	} else {
 		DEBUG_BMAP(PLL_WARN, b, "unable to retrieve bmap rc=%d",
 		    rc);
+		msl_bmap_cache_rls(b);
 		BMAP_LOCK(b);
 	}

@@ -392,6 +394,8 @@
 	struct slrpc_cservice *csvc = args->pointer_arg[MSL_CBARG_CSVC];
 	struct bmap *b = args->pointer_arg[MSL_CBARG_BMAP];
 	struct srm_leasebmapext_rep *mp;
+	struct bmap_cli_info *bci = bmap_2_bci(b);
+
 	int rc;

 	BMAP_LOCK(b);
@@ -403,6 +407,11 @@
 	if (!rc) {
 		OPSTAT_INCR("msl.extend-success-nonblocking");
 		msl_bmap_stash_lease(b, &mp->sbd, "extend");
+		lc_move2tail(&msl_bmaptimeoutq, bci);
+		OPSTAT_INCR("msl.bmap-extend-cb-ok");
+	} else {
+		msl_bmap_cache_rls(b);
+		OPSTAT_INCR("msl.bmap-extend-cb-err");
 	}

 	/*


comment

comment

--- mount_slash/fidc_cli.c
+++ mount_slash/fidc_cli.c
@@ -220,7 +220,13 @@

 	psc_assert(f->fcmh_flags & FCMH_INITING);

-	/* (gdb) p msl_rmc_resm->resm_res->res_site->site_id */
+	/*
+	 * ESTALE can happen with msctl working on a file in a different
+	 * slash2 file system on the same machine. Make sure you supply
+	 * the right socket to msctl.
+	 *
+	 * (gdb) p msl_rmc_resm->resm_res->res_site->site_id
+	 */
 	if (fcmh_2_fid(f) != SLFID_ROOT &&
 	    siteid != msl_rmc_resm->resm_siteid) {
 		s = libsl_siteid2site(siteid);


MFC r206838:

MFC r206838:

Partially MFp4 #176265 by pjd@:

 - Properly initialize and destroy system_taskq.
 - Add a dummy implementation of taskq_create_proc().

Note: We do not currently use system_taskq in ZFS so this is mostly a
no-op at this time.  Proper system_taskq initialization is required
by newer ZFS code.

Ok'ed by:	pjd

--- sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
+++ sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
@@ -52,9 +52,9 @@
 system_taskq_init(void *arg)
 {

-	system_taskq = (taskq_t *)taskqueue_thread;
 	taskq_zone = uma_zcreate("taskq_zone", sizeof(struct ostask),
 	    NULL, NULL, NULL, NULL, 0, 0);
+	system_taskq = taskq_create("system_taskq", mp_ncpus, 0, 0, 0, 0);
 }
 SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL);

@@ -62,6 +62,7 @@
 system_taskq_fini(void *arg)
 {

+	taskq_destroy(system_taskq);
 	uma_zdestroy(taskq_zone);
 }
 SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL);
@@ -72,10 +73,8 @@
 {
 	taskq_t *tq;

-	if ((flags & TASKQ_THREADS_CPU_PCT) != 0) {
-		/* TODO: Calculate number od threads. */
-		printf("%s: TASKQ_THREADS_CPU_PCT\n", __func__);
-	}
+	if ((flags & TASKQ_THREADS_CPU_PCT) != 0)
+		nthreads = MAX((mp_ncpus * nthreads) / 100, 1);

 	tq = kmem_alloc(sizeof(*tq), KM_SLEEP);
 	tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue,
@@ -83,6 +82,14 @@
 	(void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, name);

 	return ((taskq_t *)tq);
+}
+
+taskq_t *
+taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc,
+    int maxalloc, proc_t *proc __unused, uint_t flags)
+{
+
+	return (taskq_create(name, nthreads, pri, minalloc, maxalloc, flags));
 }

 void


ipv6_addr: provide fix for off-by-x error

--- sys/net/network_layer/ipv6/addr/ipv6_addr_from_str.c
+++ sys/net/network_layer/ipv6/addr/ipv6_addr_from_str.c
@@ -96,7 +96,7 @@
                 continue;
             }

-            if (i > sizeof(ipv6_addr_t)) {
+            if ((i + sizeof(uint16_t)) > sizeof(ipv6_addr_t)) {
                 return NULL;
             }

@@ -108,7 +108,7 @@
         }

 #ifdef MODULE_IPV4_ADDR
-        if (ch == '.' && (i <= sizeof(ipv6_addr_t)) &&
+        if (ch == '.' && ((i + sizeof(ipv4_addr_t)) <= sizeof(ipv6_addr_t)) &&
             ipv4_addr_from_str((ipv4_addr_t *)(&(result->u8[i])),
                                curtok) != NULL) {
             i += sizeof(ipv4_addr_t);


Allow the clock lock to recurse.

Allow the clock lock to recurse.

--- sys/alpha/alpha/machdep.c
+++ sys/alpha/alpha/machdep.c
@@ -1002,7 +1002,7 @@
 	mtx_init(&Giant, "Giant", MTX_DEF | MTX_RECURSE);
 	mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_RECURSE);
 	mtx_init(&proc0.p_mtx, "process lock", MTX_DEF);
-	mtx_init(&clock_lock, "clk", MTX_SPIN);
+	mtx_init(&clock_lock, "clk", MTX_SPIN | MTX_RECURSE);
 	mtx_lock(&Giant);

 	/*


Add MOUSE_MSC_MAXBUTTON and MOUSE_IF_USB.

--- sys/alpha/include/mouse.h
+++ sys/alpha/include/mouse.h
@@ -96,6 +96,7 @@
 #define MOUSE_IF_INPORT		2
 #define MOUSE_IF_PS2		3
 #define MOUSE_IF_SYSMOUSE	4
+#define MOUSE_IF_USB		5

 /* type */
 #define MOUSE_UNKNOWN		(-1)	/* should be treated as a mouse */
@@ -203,6 +204,7 @@
 #define MOUSE_MSC_BUTTON1UP	0x04	/* left */
 #define MOUSE_MSC_BUTTON2UP	0x02	/* middle */
 #define MOUSE_MSC_BUTTON3UP	0x01	/* right */
+#define MOUSE_MSC_MAXBUTTON	3

 /* MM series mouse data packet */
 #define MOUSE_MM_PACKETSIZE	3


fix memory leak. thanks Prevent.

fix memory leak. thanks Prevent.

--- data-manager/server/db.c
+++ data-manager/server/db.c
@@ -1900,6 +1900,9 @@
     bdm = find_bdm(bdm_list, bdm_id);
     if (bdm == NULL) {
         g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "db_get_resource_datapoints_callback(): error finding bdm %s", bdm_id);
+	if (event) {
+	    bionet_event_free(event);
+	}
         return -1;
     }

@@ -1908,6 +1911,9 @@
     hab = find_hab(hab_list, hab_type, hab_id);
     if (hab == NULL) {
         g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "db_get_resource_datapoints_callback(): error finding hab %s.%s", hab_type, hab_id);
+	if (event) {
+	    bionet_event_free(event);
+	}
         return -1;
     }
     if(event_class == _DB_GET_HAB_EVENTS) {
@@ -1922,6 +1928,9 @@
             g_log(BDM_LOG_DOMAIN, G_LOG_LEVEL_ERROR,
                   "db_get_resource_datapoints_callback(): error finding node %s.%s.%s",
                   bionet_hab_get_type(hab), bionet_hab_get_id(hab), node_id);
+	    if (event) {
+		bionet_event_free(event);
+	    }
             return -1;
         }
         if(event_class == _DB_GET_NODE_EVENTS
@@ -1942,6 +1951,9 @@
                   bionet_resource_flavor_to_string(flavor),
                   bionet_hab_get_type(hab), bionet_hab_get_id(hab),
                   bionet_node_get_id(node), resource_id);
+	    if (event) {
+		bionet_event_free(event);
+	    }
             return -1;
         }


Kill a compiler warning.

Kill a compiler warning.

--- sys/dev/advansys/advlib.h
+++ sys/dev/advansys/advlib.h
@@ -29,7 +29,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *      $Id: advlib.h,v 1.3 1997/02/22 09:28:47 peter Exp $
+ *      $Id: advlib.h,v 1.4 1998/09/15 07:03:33 gibbs Exp $
  */
 /*
  * Ported from:
@@ -824,6 +824,7 @@
 				    u_int *offset, int tid);

 /* Error recovery */
+union ccb;
 int	  adv_abort_ccb(struct adv_softc *adv, int target, int lun,
 			union ccb *ccb, u_int32_t status, int queued_only);
 int	  adv_reset_bus(struct adv_softc *adv);


These were a placeholder and don't belong here.  Remove them.

--- sys/dev/ed/if_ed_pccard.c
+++ sys/dev/ed/if_ed_pccard.c
@@ -1,3 +1,4 @@
+
 /*-
  * Copyright (c) 2005, M. Warner Losh
  * Copyright (c) 1995, David Greenman
@@ -238,149 +239,6 @@
 };

 /*
-	PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x08a1, 0xc0ab),
-	PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452),
-
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "AnyCom", "Fast Ethernet + 56K COMBO", 0x578ba6e7, 0xb0ac62c4),
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "D-Link", "DME336T", 0x1a424a1c, 0xb23897ff),
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "Grey Cell", "GCS3000", 0x2a151fac, 0x48b932ae),
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "Linksys", "EtherFast 10&100 + 56K PC Card (PCMLM56)", 0x0733cc81, 0xb3765033),
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "LINKSYS", "PCMLM336", 0xf7cb0b07, 0x7a821b58),
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "PCMCIAs", "ComboCard", 0xdcfe12d3, 0xcd8906cc),
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "PCMCIAs", "LanModem", 0xdcfe12d3, 0xc67c648f),
-	PCMCIA_MFC_DEVICE_PROD_ID123(0, "APEX DATA", "MULTICARD", "ETHERNET-MODEM", 0x11c2da09, 0x7289dc5d, 0xaad95e1f),
-	PCMCIA_MFC_DEVICE_PROD_ID2(0, "FAX/Modem/Ethernet Combo Card ", 0x1ed59302),
-	PCMCIA_DEVICE_PROD_ID12("2408LAN", "Ethernet", 0x352fff7f, 0x00b2e941),
-	PCMCIA_DEVICE_PROD_ID1234("Socket", "CF 10/100 Ethernet Card", "Revision B", "05/11/06", 0xb38bcc2e, 0x4de88352, 0xeaca6c8d, 0x7e57c22e),
-	PCMCIA_DEVICE_PROD_ID123("Cardwell", "PCMCIA", "ETHERNET", 0x9533672e, 0x281f1c5d, 0x3ff7175b),
-	PCMCIA_DEVICE_PROD_ID123("CNet  ", "CN30BC", "ETHERNET", 0x9fe55d3d, 0x85601198, 0x3ff7175b),
-	PCMCIA_DEVICE_PROD_ID123("Digital", "Ethernet", "Adapter", 0x9999ab35, 0x00b2e941, 0x4b0d829e),
-	PCMCIA_DEVICE_PROD_ID123("Edimax Technology Inc.", "PCMCIA", "Ethernet Card", 0x738a0019, 0x281f1c5d, 0x5e9d92c0),
-	PCMCIA_DEVICE_PROD_ID123("EFA   ", "EFA207", "ETHERNET", 0x3d294be4, 0xeb9aab6c, 0x3ff7175b),
-	PCMCIA_DEVICE_PROD_ID123("I-O DATA", "PCLA", "ETHERNET", 0x1d55d7ec, 0xe4c64d34, 0x3ff7175b),
-	PCMCIA_DEVICE_PROD_ID123("IO DATA", "PCLATE", "ETHERNET", 0x547e66dc, 0x6b260753, 0x3ff7175b),
-	PCMCIA_DEVICE_PROD_ID123("KingMax Technology Inc.", "EN10-T2", "PCMCIA Ethernet Card", 0x932b7189, 0x699e4436, 0x6f6652e0),
-	PCMCIA_DEVICE_PROD_ID123("PCMCIA", "PCMCIA-ETHERNET-CARD", "UE2216", 0x281f1c5d, 0xd4cd2f20, 0xb87add82),
-	PCMCIA_DEVICE_PROD_ID123("PCMCIA", "PCMCIA-ETHERNET-CARD", "UE2620", 0x281f1c5d, 0xd4cd2f20, 0x7d3d83a8),
-	PCMCIA_DEVICE_PROD_ID1("2412LAN", 0x67f236ab),
-	PCMCIA_DEVICE_PROD_ID12("Allied Telesis, K.K.", "CentreCOM LA100-PCM-T V2 100/10M LAN PC Card", 0xbb7fbdd7, 0xcd91cc68),
-	PCMCIA_DEVICE_PROD_ID12("Allied Telesis K.K.", "LA100-PCM V2", 0x36634a66, 0xc6d05997),
-  	PCMCIA_DEVICE_PROD_ID12("Allied Telesis, K.K.", "CentreCOM LA-PCM_V2", 0xbb7fBdd7, 0x28e299f8),
-	PCMCIA_DEVICE_PROD_ID12("Allied Telesis K.K.", "LA-PCM V3", 0x36634a66, 0x62241d96),
-	PCMCIA_DEVICE_PROD_ID12("AmbiCom", "AMB8010", 0x5070a7f9, 0x82f96e96),
-	PCMCIA_DEVICE_PROD_ID12("AmbiCom", "AMB8610", 0x5070a7f9, 0x86741224),
-	PCMCIA_DEVICE_PROD_ID12("AmbiCom Inc", "AMB8002", 0x93b15570, 0x75ec3efb),
-	PCMCIA_DEVICE_PROD_ID12("AmbiCom Inc", "AMB8002T", 0x93b15570, 0x461c5247),
-	PCMCIA_DEVICE_PROD_ID12("AmbiCom Inc", "AMB8010", 0x93b15570, 0x82f96e96),
-	PCMCIA_DEVICE_PROD_ID12("AnyCom", "ECO Ethernet", 0x578ba6e7, 0x0a9888c1),
-	PCMCIA_DEVICE_PROD_ID12("AnyCom", "ECO Ethernet 10/100", 0x578ba6e7, 0x939fedbd),
-	PCMCIA_DEVICE_PROD_ID12("AROWANA", "PCMCIA Ethernet LAN Card", 0x313adbc8, 0x08d9f190),
-	PCMCIA_DEVICE_PROD_ID12("ASANTE", "FriendlyNet PC Card", 0x3a7ade0f, 0x41c64504),
-	PCMCIA_DEVICE_PROD_ID12("Billionton", "LNT-10TB", 0x552ab682, 0xeeb1ba6a),
-	PCMCIA_DEVICE_PROD_ID12("CF", "10Base-Ethernet", 0x44ebf863, 0x93ae4d79),
-	PCMCIA_DEVICE_PROD_ID12("COMPU-SHACK", "BASEline PCMCIA 10 MBit Ethernetadapter", 0xfa2e424d, 0xe9190d8a),
-	PCMCIA_DEVICE_PROD_ID12("COMPU-SHACK", "FASTline PCMCIA 10/100 Fast-Ethernet", 0xfa2e424d, 0x3953d9b9),
-	PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722),
-	PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2),
-	PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2),
-	PCMCIA_DEVICE_PROD_ID12("CouplerlessPCMCIA", "100BASE", 0xee5af0ad, 0x7c2add04),
-	PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-110E 10/100M LAN Card", 0x77008979, 0xfd184814),
-	PCMCIA_DEVICE_PROD_ID12("DataTrek.", "NetCard ", 0x5cd66d9d, 0x84697ce0),
-	PCMCIA_DEVICE_PROD_ID12("Dayna Communications, Inc.", "CommuniCard E", 0x0c629325, 0xb4e7dbaf),
-	PCMCIA_DEVICE_PROD_ID12("Digicom", "Palladio LAN 10/100", 0x697403d8, 0xe160b995),
-	PCMCIA_DEVICE_PROD_ID12("Digicom", "Palladio LAN 10/100 Dongless", 0x697403d8, 0xa6d3b233),
-	PCMCIA_DEVICE_PROD_ID12("D-Link", "DFE-650", 0x1a424a1c, 0x0f0073f9),
-	PCMCIA_DEVICE_PROD_ID12("Dual Speed", "10/100 PC Card", 0x725b842d, 0xf1efee84),
-	PCMCIA_DEVICE_PROD_ID12("Dual Speed", "10/100 Port Attached PC Card", 0x725b842d, 0x2db1f8e9),
-	PCMCIA_DEVICE_PROD_ID12("Dynalink", "L10BC", 0x55632fd5, 0xdc65f2b1),
-	PCMCIA_DEVICE_PROD_ID12("DYNALINK", "L10BC", 0x6a26d1cf, 0xdc65f2b1),
-	PCMCIA_DEVICE_PROD_ID12("E-CARD", "E-CARD", 0x6701da11, 0x6701da11),
-	PCMCIA_DEVICE_PROD_ID12("EIGER Labs Inc.", "Ethernet 10BaseT card", 0x53c864c6, 0xedd059f6),
-	PCMCIA_DEVICE_PROD_ID12("EIGER Labs Inc.", "Ethernet Combo card", 0x53c864c6, 0x929c486c),
-	PCMCIA_DEVICE_PROD_ID12("Ethernet", "Adapter", 0x00b2e941, 0x4b0d829e),
-	PCMCIA_DEVICE_PROD_ID12("Ethernet Adapter", "E2000 PCMCIA Ethernet", 0x96767301, 0x71fbbc61),
-	PCMCIA_DEVICE_PROD_ID12("Ethernet PCMCIA adapter", "EP-210", 0x8dd86181, 0xf2b52517),
-	PCMCIA_DEVICE_PROD_ID12("Fast Ethernet", "Adapter", 0xb4be14e3, 0x4b0d829e),
-	PCMCIA_DEVICE_PROD_ID12("Grey Cell", "GCS2000", 0x2a151fac, 0xf00555cb),
-	PCMCIA_DEVICE_PROD_ID12("Grey Cell", "GCS2220", 0x2a151fac, 0xc1b7e327),
-	PCMCIA_DEVICE_PROD_ID12("GVC", "NIC-2000p", 0x76e171bd, 0x6eb1c947),
-	PCMCIA_DEVICE_PROD_ID12("IBM Corp.", "Ethernet", 0xe3736c88, 0x00b2e941),
-	PCMCIA_DEVICE_PROD_ID12("IC-CARD", "IC-CARD", 0x60cb09a6, 0x60cb09a6),
-	PCMCIA_DEVICE_PROD_ID12("IC-CARD+", "IC-CARD+", 0x93693494, 0x93693494),
-	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b),
-	PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0),
-	PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956),
-	PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64),
-	PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5),
-	PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3),
-	PCMCIA_DEVICE_PROD_ID12("Kingston Technology Corp.", "EtheRx PC Card Ethernet Adapter", 0x313c7be3, 0x0afb54a2),
-	PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-10/100CD", 0x1b7827b2, 0xcda71d1c),
-	PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-CDF", 0x1b7827b2, 0xfec71e40),
-	PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-CDL/T", 0x1b7827b2, 0x79fba4f7),
-	PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-CDS", 0x1b7827b2, 0x931afaab),
-	PCMCIA_DEVICE_PROD_ID12("LEMEL", "LM-N89TX PRO", 0xbbefb52f, 0xd2897a97),
-	PCMCIA_DEVICE_PROD_ID12("Linksys", "Combo PCMCIA EthernetCard (EC2T)", 0x0733cc81, 0x32ee8c78),
-	PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 Integrated PC Card (PCM100)", 0x0733cc81, 0x453c3f9d),
-	PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100)", 0x0733cc81, 0x66c5a389),
-	PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V2)", 0x0733cc81, 0x3a3b28e9),
-	PCMCIA_DEVICE_PROD_ID12("Linksys", "HomeLink Phoneline + 10/100 Network PC Card (PCM100H1)", 0x733cc81, 0x7a3e5c3a),
-	PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TX", 0x88fcdeda, 0x6d772737),
-	PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TE", 0x88fcdeda, 0x0e714bee),
-	PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN20T", 0x88fcdeda, 0x81090922),
-	PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN10TE", 0x88fcdeda, 0xc1e2521c),
-	PCMCIA_DEVICE_PROD_ID12("LONGSHINE", "PCMCIA Ethernet Card", 0xf866b0b0, 0x6f6652e0),
-	PCMCIA_DEVICE_PROD_ID12("MACNICA", "ME1-JEIDA", 0x20841b68, 0xaf8a3578),
-	PCMCIA_DEVICE_PROD_ID12("Macsense", "MPC-10", 0xd830297f, 0xd265c307),
-	PCMCIA_DEVICE_PROD_ID12("Matsushita Electric Industrial Co.,LTD.", "CF-VEL211", 0x44445376, 0x8ded41d4),
-	PCMCIA_DEVICE_PROD_ID12("MAXTECH", "PCN2000", 0x78d64bc0, 0xca0ca4b8),
-	PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC2-T", 0x481e0094, 0xa2eb0cf3),
-	PCMCIA_DEVICE_PROD_ID12("Microcom C.E.", "Travel Card LAN 10/100", 0x4b91cec7, 0xe70220d6),
-	PCMCIA_DEVICE_PROD_ID12("Microdyne", "NE4200", 0x2e6da59b, 0x0478e472),
-	PCMCIA_DEVICE_PROD_ID12("MIDORI ELEC.", "LT-PCMT", 0x648d55c1, 0xbde526c7),
-	PCMCIA_DEVICE_PROD_ID12("National Semiconductor", "InfoMover 4100", 0x36e1191f, 0x60c229b9),
-	PCMCIA_DEVICE_PROD_ID12("National Semiconductor", "InfoMover NE4100", 0x36e1191f, 0xa6617ec8),
-	PCMCIA_DEVICE_PROD_ID12("Network Everywhere", "Fast Ethernet 10/100 PC Card", 0x820a67b6, 0x31ed1a5f),
-	PCMCIA_DEVICE_PROD_ID12("NextCom K.K.", "Next Hawk", 0xaedaec74, 0xad050ef1),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "10/100Mbps Ethernet Card", 0x281f1c5d, 0x6e41773b),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "ETHERNET", 0x281f1c5d, 0x3ff7175b),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet 10BaseT Card", 0x281f1c5d, 0x4de2f6c8),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet Card", 0x281f1c5d, 0x5e9d92c0),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet Combo card", 0x281f1c5d, 0x929c486c),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "ETHERNET V1.0", 0x281f1c5d, 0x4d8817c8),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "FastEthernet", 0x281f1c5d, 0xfe871eeb),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Fast-Ethernet", 0x281f1c5d, 0x45f1f3b4),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA LAN", "Ethernet", 0x7500e246, 0x00b2e941),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "LNT-10TN", 0x281f1c5d, 0xe707f641),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIAs", "ComboCard", 0xdcfe12d3, 0xcd8906cc),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "UE2212", 0x281f1c5d, 0xbf17199b),
-	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "    Ethernet NE2000 Compatible", 0x281f1c5d, 0x42d5d7e1),
-	PCMCIA_DEVICE_PROD_ID12("PRETEC", "Ethernet CompactLAN 10baseT 3.3V", 0xebf91155, 0x30074c80),
-	PCMCIA_DEVICE_PROD_ID12("PRETEC", "Ethernet CompactLAN 10BaseT 3.3V", 0xebf91155, 0x7f5a4f50),
-	PCMCIA_DEVICE_PROD_ID12("Psion Dacom", "Gold Card Ethernet", 0xf5f025c2, 0x3a30e110),
-	PCMCIA_DEVICE_PROD_ID12("=RELIA==", "Ethernet", 0xcdd0644a, 0x00b2e941),
-	PCMCIA_DEVICE_PROD_ID12("RP", "1625B Ethernet NE2000 Compatible", 0xe3e66e22, 0xb96150df),
-	PCMCIA_DEVICE_PROD_ID12("RPTI", "EP400 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4a7e2ae0),
-	PCMCIA_DEVICE_PROD_ID12("RPTI", "EP401 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4bcbd7fd),
-	PCMCIA_DEVICE_PROD_ID12("RPTI LTD.", "EP400", 0xc53ac515, 0x81e39388),
-	PCMCIA_DEVICE_PROD_ID12("SCM", "Ethernet Combo card", 0xbdc3b102, 0x929c486c),
-	PCMCIA_DEVICE_PROD_ID12("Seiko Epson Corp.", "Ethernet", 0x09928730, 0x00b2e941),
-	PCMCIA_DEVICE_PROD_ID12("SMC", "EZCard-10-PCMCIA", 0xc4f8b18b, 0xfb21d265),
-	PCMCIA_DEVICE_PROD_ID12("Telecom Device K.K.", "SuperSocket RE450T", 0x466b05f0, 0x8b74bc4f),
-	PCMCIA_DEVICE_PROD_ID12("Telecom Device K.K.", "SuperSocket RE550T", 0x466b05f0, 0x33c8db2a),
-	PCMCIA_DEVICE_PROD_ID13("Hypertec",  "EP401", 0x8787bec7, 0xf6e4a31e),
-	PCMCIA_DEVICE_PROD_ID13("KingMax Technology Inc.", "Ethernet Card", 0x932b7189, 0x5e9d92c0),
-	PCMCIA_DEVICE_PROD_ID13("LONGSHINE", "EP401", 0xf866b0b0, 0xf6e4a31e),
-	PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360),
-	PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de),
-	PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f),
-	PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a),
-	PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078),
-
-
-	PCMCIA_PFC_DEVICE_PROD_ID12(0, "MICRO RESEARCH", "COMBO-L/M-336", 0xb2ced065, 0x3ced0555),
- */
-
-/*
  *      PC Card (PCMCIA) specific code.
  */
 static int	ed_pccard_probe(device_t);


Clean up private storage so that we can use the spriv_field0 to
store a bitmask of whether we've set a value into ccb->ccb_h.status,
whether we're in the watchdog routine for this command now, whether
we've set a grace period for this command and whether this command is
actually done.

See comments of rev 1.45 of isp.c for more complete information.

--- sys/dev/isp/isp_freebsd.h
+++ sys/dev/isp/isp_freebsd.h
@@ -186,20 +186,42 @@
 #define	XS_SNS_IS_VALID(ccb) ((ccb)->ccb_h.status |= CAM_AUTOSNS_VALID)
 #define	XS_IS_SNS_VALID(ccb) (((ccb)->ccb_h.status & CAM_AUTOSNS_VALID) != 0)

-#define	XS_INITERR(ccb)		\
-	(ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \
-	(ccb)->ccb_h.status |= CAM_REQ_INPROG, \
-	(ccb)->ccb_h.spriv_field0 = CAM_REQ_INPROG
-#define	XS_SETERR(ccb, v)	(ccb)->ccb_h.spriv_field0 = v
-#define	XS_ERR(ccb)		(ccb)->ccb_h.spriv_field0
+#define	ISP_SPRIV_ERRSET	0x1
+#define	ISP_SPRIV_INWDOG	0x2
+#define	ISP_SPRIV_GRACE		0x4
+#define	ISP_SPRIV_DONE		0x8
+
+#define	XS_CMD_S_WDOG(sccb)	(sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_INWDOG
+#define	XS_CMD_C_WDOG(sccb)	(sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_INWDOG
+#define	XS_CMD_WDOG_P(sccb)	((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_INWDOG)
+
+#define	XS_CMD_S_GRACE(sccb)	(sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_GRACE
+#define	XS_CMD_C_GRACE(sccb)	(sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_GRACE
+#define	XS_CMD_GRACE_P(sccb)	((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_GRACE)
+
+#define	XS_CMD_S_DONE(sccb)	(sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_DONE
+#define	XS_CMD_C_DONE(sccb)	(sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_DONE
+#define	XS_CMD_DONE_P(sccb)	((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_DONE)
+
+#define	XS_CMD_S_CLEAR(sccb)	(sccb)->ccb_h.spriv_field0 = 0
+
+
+#define	XS_SETERR(ccb, v)	(ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \
+				(ccb)->ccb_h.status |= v, \
+				(ccb)->ccb_h.spriv_field0 |= ISP_SPRIV_ERRSET
+
+#define	XS_INITERR(ccb)		XS_SETERR(ccb, CAM_REQ_INPROG), \
+				XS_CMD_S_CLEAR(ccb)
+
+#define	XS_ERR(ccb)		((ccb)->ccb_h.status & CAM_STATUS_MASK)
+
 #define	XS_NOERR(ccb)		\
-	((ccb)->ccb_h.spriv_field0 == CAM_REQ_INPROG)
+	(((ccb)->ccb_h.spriv_field0 & ISP_SPRIV_ERRSET) == 0 || \
+	 ((ccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG)
+
+#define	XS_CMD_DONE		isp_done

 extern void isp_done(struct ccb_scsiio *);
-#define	XS_CMD_DONE(sccb)	isp_done(sccb)
-
-#define	XS_IS_CMD_DONE(ccb)	\
-	(((ccb)->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG)

 /*
  * Can we tag?
@@ -217,7 +239,6 @@
 #define	CMD_EAGAIN		1
 #define	CMD_QUEUED		2
 #define	CMD_RQLATER		3
-#define	STOP_WATCHDOG(f, s)

 extern void isp_attach(struct ispsoftc *);
 extern void isp_uninit(struct ispsoftc *);


[stage: 3.2/9]

[stage: 3.2/9]

malloc()less feeder_vchan. Informations can be retrieved dynamically
by doing table lookup on static data. Reduce mixing overhead by
doing direct copy on first channel. Mixing process will begin starting
from second channel onwards.

--- sys/dev/sound/pcm/vchan.c
+++ sys/dev/sound/pcm/vchan.c
@@ -43,15 +43,7 @@
 #define VCHAN_DEFAULT_AFMT	(AFMT_S16_LE | AFMT_STEREO)
 #define VCHAN_DEFAULT_STRFMT	"s16le"

-struct feed_vchan_info;
-
-typedef uint32_t (*feed_vchan_mixer)(struct feed_vchan_info *,
-				uint8_t *, uint8_t *, uint32_t);
-
-struct feed_vchan_info {
-	uint32_t bps, channels, zero_sample;
-	feed_vchan_mixer mix;
-};
+typedef uint32_t (*feed_vchan_mixer)(uint8_t *, uint8_t *, uint32_t);

 struct vchinfo {
 	uint32_t spd, fmt, fmts[2], blksz, bps, run;
@@ -107,28 +99,28 @@

 #define FEEDER_VCHAN_MIX(FMTBIT, VCHAN_INTCAST, SIGN, SIGNS, ENDIAN, ENDIANS)	\
 static uint32_t									\
-feed_vchan_mix_##SIGNS##FMTBIT##ENDIANS(struct feed_vchan_info *info,		\
-				uint8_t *to, uint8_t *tmp, uint32_t count)	\
+feed_vchan_mix_##SIGNS##FMTBIT##ENDIANS(uint8_t *to, uint8_t *tmp,		\
+							uint32_t count)		\
 {										\
-	uint32_t bps;								\
 	int32_t x, y;								\
 	VCHAN_INTCAST z;							\
 	int i;									\
 										\
-	bps = info->bps;							\
 	i = count;								\
 	tmp += i;								\
 	to += i;								\
-	while (i > 0) {								\
-		tmp -= bps;							\
-		to -= bps;							\
-		i -= bps;							\
+										\
+	do {									\
+		tmp -= PCM_##FMTBIT##_BPS;					\
+		to -= PCM_##FMTBIT##_BPS;					\
+		i -= PCM_##FMTBIT##_BPS;					\
 		x = PCM_READ_##SIGN##FMTBIT##_##ENDIAN(tmp);			\
 		y = PCM_READ_##SIGN##FMTBIT##_##ENDIAN(to);			\
 		z = (VCHAN_INTCAST)x + y;					\
 		x = PCM_CLAMP_##SIGN##FMTBIT(z);				\
 		VCHAN_PCM_WRITE_##SIGN##FMTBIT##_##ENDIAN(to, x);		\
-	}									\
+	} while (i != 0);							\
+										\
 	return count;								\
 }

@@ -139,7 +131,6 @@
 FEEDER_VCHAN_MIX(16, int32_t, S, s, BE, be)
 FEEDER_VCHAN_MIX(24, int32_t, S, s, BE, be)
 FEEDER_VCHAN_MIX(32, intpcm_t, S, s, BE, be)
-/*  unsigned */
 FEEDER_VCHAN_MIX(8, int32_t, U, u, NE, ne)
 FEEDER_VCHAN_MIX(16, int32_t, U, u, LE, le)
 FEEDER_VCHAN_MIX(24, int32_t, U, u, LE, le)
@@ -148,93 +139,72 @@
 FEEDER_VCHAN_MIX(24, int32_t, U, u, BE, be)
 FEEDER_VCHAN_MIX(32, intpcm_t, U, u, BE, be)

-static int
-feed_vchan_setup(struct pcm_feeder *f)
-{
-	struct feed_vchan_info *info = f->data;
-	static const struct {
-		uint32_t format;	/* pcm / audio format */
-		uint32_t bps;		/* bytes-per-sample, regardless of
-					   total channels */
-		feed_vchan_mixer mix;
-	} vchan_mix_tbl[] = {
-		{ AFMT_S8, PCM_8_BPS, feed_vchan_mix_s8ne },
-		{ AFMT_S16_LE, PCM_16_BPS, feed_vchan_mix_s16le },
-		{ AFMT_S24_LE, PCM_24_BPS, feed_vchan_mix_s24le },
-		{ AFMT_S32_LE, PCM_32_BPS, feed_vchan_mix_s32le },
-		{ AFMT_S16_BE, PCM_16_BPS, feed_vchan_mix_s16be },
-		{ AFMT_S24_BE, PCM_24_BPS, feed_vchan_mix_s24be },
-		{ AFMT_S32_BE, PCM_32_BPS, feed_vchan_mix_s32be },
-		/* unsigned */
-		{ AFMT_U8, PCM_8_BPS, feed_vchan_mix_u8ne },
-		{ AFMT_U16_LE, PCM_16_BPS, feed_vchan_mix_u16le },
-		{ AFMT_U24_LE, PCM_24_BPS, feed_vchan_mix_u24le },
-		{ AFMT_U32_LE, PCM_32_BPS, feed_vchan_mix_u32le },
-		{ AFMT_U16_BE, PCM_16_BPS, feed_vchan_mix_u16be },
-		{ AFMT_U24_BE, PCM_24_BPS, feed_vchan_mix_u24be },
-		{ AFMT_U32_BE, PCM_32_BPS, feed_vchan_mix_u32be },
-		{ 0, 0, NULL },
-	};
-	uint32_t i;
-
-	for (i = 0; i < sizeof(vchan_mix_tbl) / sizeof(*vchan_mix_tbl); i++) {
-		if (vchan_mix_tbl[i].format == 0)
-			return -1;
-		if ((f->desc->out & ~AFMT_STEREO) == vchan_mix_tbl[i].format) {
-			info->bps = vchan_mix_tbl[i].bps;
-			info->mix = vchan_mix_tbl[i].mix;
-			break;
-		}
-	}
-
-	info->channels = (f->desc->out & AFMT_STEREO) ? 2 : 1;
-	info->zero_sample = (f->desc->out & AFMT_SIGNED) ? 0x00 : 0x80;
-
-	return 0;
-}
+struct feed_vchan_info {
+	uint32_t format;
+	int bps;
+	feed_vchan_mixer mix;
+};
+
+static struct feed_vchan_info feed_vchan_info_tbl[] = {
+	{ AFMT_S8,     PCM_8_BPS,  feed_vchan_mix_s8ne },
+	{ AFMT_S16_LE, PCM_16_BPS, feed_vchan_mix_s16le },
+	{ AFMT_S24_LE, PCM_24_BPS, feed_vchan_mix_s24le },
+	{ AFMT_S32_LE, PCM_32_BPS, feed_vchan_mix_s32le },
+	{ AFMT_S16_BE, PCM_16_BPS, feed_vchan_mix_s16be },
+	{ AFMT_S24_BE, PCM_24_BPS, feed_vchan_mix_s24be },
+	{ AFMT_S32_BE, PCM_32_BPS, feed_vchan_mix_s32be },
+	{ AFMT_U8,     PCM_8_BPS,  feed_vchan_mix_u8ne  },
+	{ AFMT_U16_LE, PCM_16_BPS, feed_vchan_mix_u16le },
+	{ AFMT_U24_LE, PCM_24_BPS, feed_vchan_mix_u24le },
+	{ AFMT_U32_LE, PCM_32_BPS, feed_vchan_mix_u32le },
+	{ AFMT_U16_BE, PCM_16_BPS, feed_vchan_mix_u16be },
+	{ AFMT_U24_BE, PCM_24_BPS, feed_vchan_mix_u24be },
+	{ AFMT_U32_BE, PCM_32_BPS, feed_vchan_mix_u32be },
+};
+
+#define FVCHAN_DATA(i, c)	((intptr_t)((((i) & 0x1f) << 4) | ((c) & 0xf)))
+#define FVCHAN_INFOIDX(m)	(((m) >> 4) & 0x1f)
+#define FVCHAN_CHANNELS(m)	((m) & 0xf)

 static int
 feed_vchan_init(struct pcm_feeder *f)
 {
-	struct feed_vchan_info *info;
+	int i, channels;

 	if (f->desc->out != f->desc->in)
 		return EINVAL;

-	info = malloc(sizeof(*info), M_VCHANFEEDER, M_NOWAIT | M_ZERO);
-	if (info == NULL)
-		return ENOMEM;
-	f->data = info;
-	return feed_vchan_setup(f);
-}
-
-static int
-feed_vchan_free(struct pcm_feeder *f)
-{
-	struct feed_vchan_info *info = f->data;
-
-	if (info)
-		free(info, M_VCHANFEEDER);
-	f->data = NULL;
-	return 0;
+	channels = (f->desc->out & AFMT_STEREO) ? 2 : 1;
+
+	for (i = 0; i < sizeof(feed_vchan_info_tbl) /
+	    sizeof(feed_vchan_info_tbl[0]); i++) {
+		if ((f->desc->out & ~AFMT_STEREO) ==
+		    feed_vchan_info_tbl[i].format) {
+		    	f->data = (void *)FVCHAN_DATA(i, channels);
+			return 0;
+		}
+	}
+
+	return -1;
 }

 static int
 feed_vchan(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b,
 						uint32_t count, void *source)
 {
-	struct feed_vchan_info *info = f->data;
+	struct feed_vchan_info *info;
 	struct snd_dbuf *src = source;
 	struct pcmchan_children *cce;
 	struct pcm_channel *ch;
-	uint32_t cnt, rcnt = 0, sz;
+	uint32_t cnt, mcnt, rcnt, sz;
 	uint8_t *tmp;

 	sz = sndbuf_getsize(src);
 	if (sz < count)
 		count = sz;

-	sz = info->bps * info->channels;
+	info = &feed_vchan_info_tbl[FVCHAN_INFOIDX((intptr_t)f->data)];
+	sz = info->bps * FVCHAN_CHANNELS((intptr_t)f->data);
 	count -= count % sz;
 	if (count < sz)
 		return 0;
@@ -242,22 +212,39 @@
 	/*
 	 * we are going to use our source as a temporary buffer since it's
 	 * got no other purpose.  we obtain our data by traversing the channel
-	 * list of children and calling vchan_mix_* to mix count bytes from each
-	 * into our destination buffer, b
+	 * list of children and calling vchan_mix_* to mix count bytes from
+	 * each into our destination buffer, b
 	 */
 	tmp = sndbuf_getbuf(src);
-	memset(b, info->zero_sample, count);
+	rcnt = 0;
+	mcnt = 0;
+
 	SLIST_FOREACH(cce, &c->children, link) {
 		ch = cce->channel;
 		CHN_LOCK(ch);
-		if (ch->flags & CHN_F_TRIGGERED) {
-			if (ch->flags & CHN_F_MAPPED)
-				sndbuf_acquire(ch->bufsoft, NULL, sndbuf_getfree(ch->bufsoft));
-			cnt = FEEDER_FEED(ch->feeder, ch, tmp, count, ch->bufsoft);
+		if (!(ch->flags & CHN_F_TRIGGERED)) {
+			CHN_UNLOCK(ch);
+			continue;
+		}
+		if (ch->flags & CHN_F_MAPPED)
+			sndbuf_acquire(ch->bufsoft, NULL,
+			    sndbuf_getfree(ch->bufsoft));
+		if (rcnt == 0)
+			rcnt = FEEDER_FEED(ch->feeder, ch, b, count,
+			ch->bufsoft);
+		else {
+			cnt = FEEDER_FEED(ch->feeder, ch, tmp, count,
+			    ch->bufsoft);
 			cnt -= cnt % sz;
-			cnt = info->mix(info, b, tmp, cnt);
-			if (cnt > rcnt)
-				rcnt = cnt;
+			if (cnt != 0) {
+				if (mcnt++ == 0 && rcnt < count)
+					memset(b + rcnt,
+					    sndbuf_zerodata(f->desc->out),
+					    count - rcnt);
+				cnt = info->mix(b, tmp, cnt);
+				if (cnt > rcnt)
+					rcnt = cnt;
+			}
 		}
 		CHN_UNLOCK(ch);
 	}
@@ -283,7 +270,6 @@
 	{FEEDER_MIXER, AFMT_S16_BE | AFMT_STEREO, AFMT_S16_BE | AFMT_STEREO, 0},
 	{FEEDER_MIXER, AFMT_S24_BE | AFMT_STEREO, AFMT_S24_BE | AFMT_STEREO, 0},
 	{FEEDER_MIXER, AFMT_S32_BE | AFMT_STEREO, AFMT_S32_BE | AFMT_STEREO, 0},
-	/* unsigned */
 	{FEEDER_MIXER, AFMT_U8, AFMT_U8, 0},
 	{FEEDER_MIXER, AFMT_U16_LE, AFMT_U16_LE, 0},
 	{FEEDER_MIXER, AFMT_U24_LE, AFMT_U24_LE, 0},
@@ -302,7 +288,6 @@
 };
 static kobj_method_t feeder_vchan_methods[] = {
 	KOBJMETHOD(feeder_init,		feed_vchan_init),
-	KOBJMETHOD(feeder_free,		feed_vchan_free),
 	KOBJMETHOD(feeder_feed,		feed_vchan),
 	{0, 0}
 };


In set_mouse_pos(), try to avoid division by zero errors.

--- sys/dev/syscons/scmouse.c
+++ sys/dev/syscons/scmouse.c
@@ -157,7 +157,8 @@
 	    scp->mouse_ypos = (scp->ysize + scp->yoff)*scp->font_size - 1;
     }

-    if (scp->mouse_xpos != scp->mouse_oldxpos || scp->mouse_ypos != scp->mouse_oldypos) {
+    if ((scp->mouse_xpos != scp->mouse_oldxpos || scp->mouse_ypos != scp->mouse_oldypos)
+	&& (scp->font_size != 0 && scp->font_width != 0)) {
 	scp->status |= MOUSE_MOVED;
     	scp->mouse_pos =
 	    (scp->mouse_ypos/scp->font_size - scp->yoff)*scp->xsize


Don't call wakeup() while we are in DDB. The patch was developed by bde. I added the same check in one more place where wakeup() might be called during the DDB session. Submitted by: bde

--- sys/dev/syscons/syscons.c
+++ sys/dev/syscons/syscons.c
@@ -1481,7 +1481,9 @@
 	    && sc_console->sc->cur_scp->smode.mode == VT_AUTO
 	    && sc_console->smode.mode == VT_AUTO) {
 	    sc_console->sc->cur_scp->status |= MOUSE_HIDDEN;
+	    ++debugger;		/* XXX */
 	    sc_switch_scr(sc_console->sc, sc_console->index);
+	    --debugger;		/* XXX */
 	}
     }
     if (on)
@@ -2026,7 +2028,8 @@
     mark_all(sc->cur_scp);
     if (sc->delayed_next_scr)
 	sc_switch_scr(sc, sc->delayed_next_scr - 1);
-    wakeup((caddr_t)&scrn_blanked);
+    if (debugger == 0)
+	wakeup((caddr_t)&scrn_blanked);
 }

 static int
@@ -2223,7 +2226,16 @@
     sc->new_scp = SC_STAT(SC_DEV(sc, next_scr));
     if (sc->new_scp == sc->old_scp) {
 	sc->switch_in_progress = 0;
-	wakeup((caddr_t)&sc->new_scp->smode);
+	/*
+	 * XXX wakeup() calls mtx_lock(&sched_lock) which will hang if
+	 * sched_lock is in an in-between state, e.g., when we stop at
+	 * a breakpoint at fork_exit.  It has always been wrong to call
+	 * wakeup() when the debugger is active.  In RELENG_4, wakeup()
+	 * is supposed to be locked by splhigh(), but the debugger may
+	 * be invoked at splhigh().
+	 */
+	if (debugger == 0)
+	    wakeup((caddr_t)&sc->new_scp->smode);
 	splx(s);
 	DPRINTF(5, ("switch done (new == old)\n"));
 	return 0;
@@ -2245,7 +2257,8 @@
     s = spltty();

     /* wake up processes waiting for this vty */
-    wakeup((caddr_t)&sc->cur_scp->smode);
+    if (debugger == 0)
+	wakeup((caddr_t)&sc->cur_scp->smode);

     /* wait for the controlling process to acknowledge, if necessary */
     if (signal_vt_acq(sc->cur_scp)) {


Load the firmware during init not attach, as a root filesystem might
not yet be available. While here, also print the firmware version.

Submitted by:	PseudoCylon
MFC after:	3 days

--- sys/dev/usb/wlan/if_run.c
+++ sys/dev/usb/wlan/if_run.c
@@ -600,12 +600,6 @@
 	    sc->mac_ver, sc->mac_rev, run_get_rf(sc->rf_rev),
 	    sc->ntxchains, sc->nrxchains, ether_sprintf(sc->sc_bssid));

-	if ((error = run_load_microcode(sc)) != 0) {
-		device_printf(sc->sc_dev, "could not load 8051 microcode\n");
-		RUN_UNLOCK(sc);
-		goto detach;
-	}
-
 	RUN_UNLOCK(sc);

 	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
@@ -1050,8 +1044,9 @@
 		error = ETIMEDOUT;
 		goto fail;
 	}
-	device_printf(sc->sc_dev, "firmware %s loaded\n",
-	    (base == fw->data) ? "RT2870" : "RT3071");
+	device_printf(sc->sc_dev, "firmware %s ver. %u.%u loaded\n",
+	    (base == fw->data) ? "RT2870" : "RT3071",
+	    *(base + 4092), *(base + 4093));

 fail:
 	firmware_put(fw, FIRMWARE_UNLOAD);
@@ -4677,6 +4672,11 @@

 	run_stop(sc);

+	if (run_load_microcode(sc) != 0) {
+		device_printf(sc->sc_dev, "could not load 8051 microcode\n");
+		goto fail;
+	}
+
 	for (ntries = 0; ntries < 100; ntries++) {
 		if (run_read(sc, RT2860_ASIC_VER_ID, &tmp) != 0)
 			goto fail;


Fix build with KDB defined.

Fix build with KDB defined.

Pointy hat to:	jhb
Submitted by:	jkim

--- sys/fs/ext2fs/ext2_subr.c
+++ sys/fs/ext2fs/ext2_subr.c
@@ -52,6 +52,8 @@
 #include <fs/ext2fs/fs.h>

 #ifdef KDB
+#include <fs/ext2fs/ext2_mount.h>
+
 void	ext2_checkoverlap(struct buf *, struct inode *);
 #endif


Back out wrapping the asm ... ; bits in #ifndef lint macros. There
are some good reasons for not doing this, even if the linting of
the code breaks.

1) If lint were ever to understand the stuff inside the macros,
   that would break the checks.

2) There are ways to use __GNUC__ to exclude overly specific
   code.

3) (Not yet practical) Lint(1) needs to properlyu understand
   all of te code we actually run.

Complained about by:	bde
Education by:		jake, jhb, eivind

--- sys/i386/include/endian.h
+++ sys/i386/include/endian.h
@@ -71,9 +71,7 @@
 static __inline unsigned long
 __uint16_swap_uint32(unsigned long __x)
 {
-#ifndef	lint
 	__asm ("rorl $16, %1" : "=r" (__x) : "0" (__x));
-#endif

 	return __x;
 }
@@ -81,13 +79,11 @@
 static __inline unsigned long
 __uint8_swap_uint32(unsigned long __x)
 {
-#ifndef	lint
 #if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)
 	__asm ("bswap %0" : "=r" (__x) : "0" (__x));
 #else
 	__asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1"
 	    : "=q" (__x) : "0" (__x));
-#endif
 #endif
 	return __x;
 }
@@ -95,9 +91,7 @@
 static __inline unsigned short
 __uint8_swap_uint16(unsigned short __x)
 {
-#ifndef	lint
 	__asm ("xchgb %h1, %b1" : "=q" (__x) : "0" (__x));
-#endif

 	return __x;
 }


Remove a redundant decalaration of call_desc[] since it's now a fatal error.

--- sys/i4b/layer3/i4b_q931.c
+++ sys/i4b/layer3/i4b_q931.c
@@ -77,8 +77,6 @@

 unsigned int i4b_l3_debug = L3_DEBUG_DEFAULT;

-/* this is declared in layer4/i4b_l4mgmt.c, which is always required */
-extern call_desc_t call_desc[N_CALL_DESC];	/* call descriptor array */
 ctrl_desc_t ctrl_desc[MAX_CONTROLLERS];	/* controller description array */
 int utoc_tab[MAX_CONTROLLERS];		/* unit to controller conversion */


In pci_cfgregread() and pci_cfgregwrite(), multiplex the domain and
bus number into the bus argument. The bus number occupies the least
significant 8 bits. The PCI domain occupies the most significant 24
bits.

On the Altix 350, the PCI domain is a required parameter, but
changing the prototype of the pci_cfgreg*() functions to include a
separate domain argument has wide-spread consequences across the
supported architectures. We'd be changing a known interface.

Multiplexing is an acceptable kluge to give us what we need with
manageable impact. Note that the PCI bus number fits in 8 bits,
so the multiplexing of the domain is a backward compatible change.


Fix a broken macro usage.  It had no semicolon.

Noticed by:	eivind

--- sys/net/if_iso88025subr.c
+++ sys/net/if_iso88025subr.c
@@ -230,7 +230,7 @@
 		if (!arpresolve(ac, rt, m, dst, edst, rt0))
 			return (0);	/* if not yet resolved */
 		/* Add LLC and SNAP headers */
-		M_PREPEND(m, 8, M_DONTWAIT)
+		M_PREPEND(m, 8, M_DONTWAIT);
 		if (m == 0)
 			senderr(ENOBUFS);
 		l = mtod(m, struct llc *);


Add some missing DUMMYNET_UNLOCK() in config_pipe().

Noticed by:	Simon Coggins
Approved by:	bms(mentor)


If we detect an IPv6 fragment header and it is not the first fragment,
then terminate the loop as we will not find any further headers and
for short fragments this could otherwise lead to a pullup error
discarding the fragment.

PR:		kern/145733
Submitted by:	Matthew Luckie (mjl luckie.org.nz)
MFC after:	2 weeks
Approved by:	re (kib)


MFC of 202517

MFC of 202517

Again gets rid of some rather strange ifdef's for
APPLE/USERSPACE that drifted in through our scrubber
programs.

--- sys/netinet/sctp_output.c
+++ sys/netinet/sctp_output.c
@@ -3490,11 +3490,7 @@
 			tos_value = inp->ip_inp.inp.inp_ip_tos;
 		}
 		if ((nofragment_flag) && (port == 0)) {
-#if defined(WITH_CONVERT_IP_OFF) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__Userspace__)
 			ip->ip_off = IP_DF;
-#else
-			ip->ip_off = htons(IP_DF);
-#endif
 		} else
 			ip->ip_off = 0;


Fix for BUG#13582.  Theoretically possible to try to overallocate RAM in some fulltext queries.

--- myisam/ft_nlq_search.c
+++ myisam/ft_nlq_search.c
@@ -266,7 +266,8 @@
     so if ndocs == 0, FT_INFO.doc[] must not be accessed.
    */
   dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+
-			     sizeof(FT_DOC)*(aio.dtree.elements_in_tree-1),
+			     sizeof(FT_DOC)*
+			     (int)(aio.dtree.elements_in_tree-1),
 			     MYF(0));
   if (!dlist)
     goto err;


MFC: r200915

MFC: r200915

Don't probe the bq4802 variant found in Ultra 25 and 45 for now as
this chip isn't MC146818 compatible and requires different handlers
(but which I can't test due to lack of such hardware).

--- sys/sparc64/sparc64/rtc.c
+++ sys/sparc64/sparc64/rtc.c
@@ -28,10 +28,11 @@
 __FBSDID("$FreeBSD$");

 /*
- * The `rtc' device is a MC146818 compatible clock found on the ISA
- * bus and EBus. The EBus variant actually is the Real-Time Clock
- * function of a National Semiconductor PC87317/PC97317 which also
- * provides Advanced Power Control functionality.
+ * The `rtc' device is found on the ISA bus and the EBus.  The ISA version
+ * always is a MC146818 compatible clock while the EBus variant either is the
+ * MC146818 compatible Real-Time Clock function of a National Semiconductor
+ * PC87317/PC97317 which also provides Advanced Power Control functionality
+ * or a Texas Instruments bq4802.
  */

 #include "opt_isa.h"
@@ -130,6 +131,10 @@
 {

 	if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) {
+		/* The bq4802 is not supported, yet. */
+		if (ofw_bus_get_compat(dev) != NULL &&
+		    strcmp(ofw_bus_get_compat(dev), "bq4802") == 0)
+			return (ENXIO);
 		device_set_desc(dev, RTC_DESC);
 		return (0);
 	}


MFC revision 1.38
  The sparc64/sparc64/pmap.c implementations of pmap_remove(),
  pmap_protect(), and pmap_copy() have optimizations for regions
  larger than PMAP_TSB_THRESH (which works out to 16MB).  This
  caused a panic in tsb_foreach for kernel mappings, since
  pm->pm_tsb is NULL in that case.  This fix teaches tsb_foreach
  to use the kernel's tsb in that case.

Approved by: re (mux)

--- sys/sparc64/sparc64/tsb.c
+++ sys/sparc64/sparc64/tsb.c
@@ -192,9 +192,9 @@
  * Traverse the tsb of a pmap, calling the callback function for any tte entry
  * that has a virtual address between start and end. If this function returns 0,
  * tsb_foreach() terminates.
- * This is used by pmap_remove() and pmap_protect() in the case that the number
- * of pages in the range given to them reaches the dimensions of the tsb size as
- * an optimization.
+ * This is used by pmap_remove(), pmap_protect(), and pmap_copy() in the case
+ * that the number of pages in the range given to them reaches the
+ * dimensions of the tsb size as an optimization.
  */
 void
 tsb_foreach(pmap_t pm1, pmap_t pm2, vm_offset_t start, vm_offset_t end,
@@ -202,11 +202,20 @@
 {
 	vm_offset_t va;
 	struct tte *tp;
-	int i;
+	struct tte *tsbp;
+	uintptr_t i;
+	uintptr_t n;

 	PMAP_STATS_INC(tsb_nforeach);
-	for (i = 0; i < TSB_SIZE; i++) {
-		tp = &pm1->pm_tsb[i];
+	if (pm1 == kernel_pmap) {
+		tsbp = tsb_kernel;
+		n = tsb_kernel_size / sizeof(struct tte);
+	} else {
+		tsbp = pm1->pm_tsb;
+		n = TSB_SIZE;
+	}
+	for (i = 0; i < n; i++) {
+		tp = &tsbp[i];
 		if ((tp->tte_data & TD_V) != 0) {
 			va = TTE_GET_VA(tp);
 			if (va >= start && va < end) {


Added rgb2cmap support

Added rgb2cmap support

--- sys/src/lib/edraw/edraw.c
+++ sys/src/lib/edraw/edraw.c
@@ -12,7 +12,15 @@
 static intBool DeallocateImage(void*, void*);
 static void NewImage(void*, DATA_OBJECT*);

+static int Callrgb2cmap(void* theEnv);
+
 void InitializeDrawRoutines(void* theEnv) {
+   EnvDefineFunction2(theEnv,
+         (char*)"rgb2cmap",
+         'i',
+         PTIEF Callrgb2cmap,
+         (char*)"Callrgb2cmap",
+         (char*)"33iiii");
    /* register the image type */
    struct externalAddressType image = {
       (char*)"Image",
@@ -25,7 +33,31 @@

    imageExternalAddressID = InstallExternalAddressType(theEnv, &image);
 }
-
+int Callrgb2cmap(void* theEnv) {
+   int red, green, blue;
+   red = (int)EnvRtnLong(theEnv, 1);
+   if(red > 255 || red < 0) {
+      PrintErrorID(theEnv, (char*)"CONVERSION", 1, FALSE);
+      EnvPrintRouter(theEnv, WERROR, (char*)"Red value is not between 0 and 255\n");
+      SetEvaluationError(theEnv, TRUE);
+      return -1;
+   }
+   green = (int)EnvRtnLong(theEnv, 2);
+   if(green > 255 || green < 0) {
+      PrintErrorID(theEnv, (char*)"CONVERSION", 1, FALSE);
+      EnvPrintRouter(theEnv, WERROR, (char*)"Green value is not between 0 and 255\n");
+      SetEvaluationError(theEnv, TRUE);
+      return -1;
+   }
+   blue = (int)EnvRtnLong(theEnv, 3);
+   if(blue > 255 || blue < 0) {
+      PrintErrorID(theEnv, (char*)"CONVERSION", 1, FALSE);
+      EnvPrintRouter(theEnv, WERROR, (char*)"Blue value is not between 0 and 255\n");
+      SetEvaluationError(theEnv, TRUE);
+      return -1;
+   }
+   return rgb2cmap(red, green, blue);
+}
 intBool DeallocateImage(void* theEnv, void* theValue) {
    if(theValue != NULL)
       freeimage((Image*)theValue);


Fix the softdep_request_cleanup() function definition for !SOFTUPDATES case.

Submitted by:	Aleksandr Rybalko <ray dlink ua>

--- sys/ufs/ffs/ffs_softdep.c
+++ sys/ufs/ffs/ffs_softdep.c
@@ -514,9 +514,10 @@
 }

 int
-softdep_request_cleanup(fs, vp)
+softdep_request_cleanup(fs, vp, resource)
 	struct fs *fs;
 	struct vnode *vp;
+	int resource;
 {

 	return (0);


Don't assert-crash when listing subscriptions with a >256 chars long mailbox name.

--- src/lib-storage/list/mailbox-list-subscriptions.c
+++ src/lib-storage/list/mailbox-list-subscriptions.c
@@ -20,7 +20,7 @@
 	const char *path, *name, *name2, *full_name;
 	string_t *vname;

-	vname = t_str_new(256);
+	vname = str_new(default_pool, 256);
 	path = t_strconcat(ctx->list->set.control_dir != NULL ?
 			   ctx->list->set.control_dir :
 			   ctx->list->set.root_dir,
@@ -57,6 +57,7 @@
 		name = mail_namespace_get_vname(ns, vname, name);
 		mailbox_list_iter_update(&update_ctx, name);
 	} T_END;
+	str_free(&vname);
 	return subsfile_list_deinit(subsfile_ctx);
 }


https: avoid EBADF on error

https: avoid EBADF on error

--- modules/access/http/transport.c
+++ modules/access/http/transport.c
@@ -97,10 +97,11 @@
     vlc_cleanup_pop();
     freeaddrinfo(res);

+    if (fd != -1)
 #ifndef _WIN32
-    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
+        fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
 #else
-    ioctlsocket(fd, FIONBIO, &(unsigned long){ 1 });
+        ioctlsocket(fd, FIONBIO, &(unsigned long){ 1 });
 #endif
     return fd;
 }


queue2: Fix bugs

queue2: Fix bugs

update_buffering () needs to be called every time we write to the ring
buffer so that applications don't get stuck waiting for a 100% buffered
message while queue2 is waiting for space

_create_write () must only be called for temp file/ring buffer cases

--- plugins/elements/gstqueue2.c
+++ plugins/elements/gstqueue2.c
@@ -1659,6 +1659,9 @@
     }
     update_cur_level (queue, queue->current);

+    /* update the buffering status */
+    update_buffering (queue);
+
     GST_INFO_OBJECT (queue, "cur_level.bytes %u (max %u)",
         queue->cur_level.bytes, QUEUE_MAX_BYTES (queue));

@@ -1719,8 +1722,10 @@
     /* update the byterate stats */
     update_in_rates (queue);

-    /* FIXME - check return value? */
-    gst_queue2_create_write (queue, buffer);
+    if (!QUEUE_IS_USING_QUEUE (queue)) {
+      /* FIXME - check return value? */
+      gst_queue2_create_write (queue, buffer);
+    }
   } else if (GST_IS_EVENT (item)) {
     GstEvent *event;

@@ -1764,13 +1769,14 @@
   }

   if (item) {
-    /* update the buffering status */
-    update_buffering (queue);
-
-    if (QUEUE_IS_USING_QUEUE (queue))
+    if (QUEUE_IS_USING_QUEUE (queue)) {
+      /* update the buffering status */
+      update_buffering (queue);
+
       g_queue_push_tail (queue->queue, item);
-    else
+    } else {
       gst_mini_object_unref (GST_MINI_OBJECT_CAST (item));
+    }

     if (!QUEUE_IS_USING_RING_BUFFER (queue))
       GST_QUEUE2_SIGNAL_ADD (queue);


generators: Make gen::VersionInfo constexpr

Change-Id: Ia19dd5f696accb9680c958b05676d79aaaefb4b8
Reviewed-by: Denis Shienkov <6a9c747bd2ba446682324cf340d3b86f30cf4d55@gmail.com>
Reviewed-by: Christian Kandeler <3aa99dcdd3f0cac61fb81c2a11771c0cc2497607@qt.io>

--- src/lib/corelib/generators/generatorversioninfo.h
+++ src/lib/corelib/generators/generatorversioninfo.h
@@ -53,19 +53,19 @@
 class QBS_EXPORT VersionInfo
 {
 public:
-    VersionInfo(const Version &version, utils::ArchitectureFlags archs)
+    constexpr VersionInfo(const Version &version, utils::ArchitectureFlags archs)
         : m_version(version), m_archs(archs)
     {
     }

-    bool operator<(const VersionInfo &other) const { return m_version < other.m_version; }
-    bool operator==(const VersionInfo &other) const
+    constexpr bool operator<(const VersionInfo &other) const { return m_version < other.m_version; }
+    constexpr bool operator==(const VersionInfo &other) const
     {
         return m_version == other.m_version && m_archs == other.m_archs;
     }

-    Version version() const { return m_version; }
-    bool containsArchitecture(utils::Architecture arch) const { return m_archs & arch; }
+    constexpr Version version() const { return m_version; }
+    constexpr bool containsArchitecture(utils::Architecture arch) const { return m_archs & arch; }

     int marketingVersion() const;


mmdevice: fix volume scale (fixes #12825)

--- modules/audio_output/mmdevice.c
+++ modules/audio_output/mmdevice.c
@@ -975,7 +975,7 @@
         {
             msg_Dbg(aout, "volume from %+f dB to %+f dB with %f dB increments",
                     min, max, inc);
-            base_volume = powf(10.f, max / 20.f + .3f);
+            base_volume = powf(10.f, max / 20.f);
         }
         else
             msg_Err(aout, "cannot get volume range (error 0x%lx)", hr);


build: include stdio.h for FILE

build: include stdio.h for FILE

--- plugins/elements/gstqueue2.h
+++ plugins/elements/gstqueue2.h
@@ -25,6 +25,7 @@
 #define __GST_QUEUE2_H__

 #include <gst/gst.h>
+#include <stdio.h>

 G_BEGIN_DECLS


Fixed #1: include iostream otherwise boost 1.57 complains

--- include/CFG.h
+++ include/CFG.h
@@ -1,6 +1,7 @@
 #ifndef __CFG_H__
 #define __CFG_H__

+#include <iostream>
 #include <stack>
 #include <limits>


Fix preprocessing bug

Fix preprocessing bug

--- include/crv.h
+++ include/crv.h
@@ -15,11 +15,11 @@
 #include <iostream>
 #endif

+#include "nse_sequential.h"
+
 #ifndef _BV_THEORY_
 #define _REAL_TIME_ 1
 #endif
-
-#include "nse_sequential.h"

 namespace crv
 {


changed 'navigationController' property to strong reference in 'NSViewController+CCNNavigationController' category

--- CCNNavigationController/CCNNavigationController.h
+++ CCNNavigationController/CCNNavigationController.h
@@ -226,7 +226,7 @@

 #pragma mark - NSViewController+CCNNavigationController
 @interface NSViewController (CCNNavigationController)
-@property (nonatomic, weak) CCNNavigationController *navigationController;
+@property (nonatomic, strong) CCNNavigationController *navigationController;
 @end

 // Each notification contains the navigation controller as notification object.


bug fix

bug fix

--- nested_sampling/src/cv.c
+++ nested_sampling/src/cv.c
@@ -28,7 +28,7 @@
 double X_imp(int i, double K, double P)
 {
   double X;
-  X = (K - ((i+1)%(int)P) )/( K - ((i+1)%(int)P) + 1);
+  X = (K - (i%(int)P) )/( K - (i%(int)P) + 1);
   return X;
 }

@@ -81,7 +81,7 @@
   double X;
   double Xm = X_imp(0,K,P); //this is X1
   double Xf, Xb;
-  Xb = 2-X_imp(0,K,P); // reflecting boundary condition, this is X0
+  Xb = 2-Xm; // reflecting boundary condition, this is X0
   Xf = Xm * X_imp(1,K,P);
   gl[0] = 0.5 * (Xb - Xf);
   //calculate density of states for stored energies, don't do it because of numerical instability


no-op style change.

no-op style change.

TBR=wtc@chromium.org

Review URL: http://codereview.chromium.org/13703

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@6701 0039d316-1c4b-4281-b951-d872f2087c98

--- net/base/cookie_policy.h
+++ net/base/cookie_policy.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-#ifndef NET_BASE_COOKIE_POLICY_H__
-#define NET_BASE_COOKIE_POLICY_H__
+#ifndef NET_BASE_COOKIE_POLICY_H_
+#define NET_BASE_COOKIE_POLICY_H_

 #include "base/basictypes.h"

@@ -45,10 +45,10 @@
  private:
   Type type_;

-  DISALLOW_EVIL_CONSTRUCTORS(CookiePolicy);
+  DISALLOW_COPY_AND_ASSIGN(CookiePolicy);
 };

 }  // namespace net

-#endif // NET_BASE_COOKIE_POLICY_H__
+#endif // NET_BASE_COOKIE_POLICY_H_


batman-adv: fix skb->data assignment

batman-adv: fix skb->data assignment

skb_linearize(skb) possibly rearranges the skb internal data and then changes
the skb->data pointer value. For this reason any other pointer in the code that
was assigned skb->data before invoking skb_linearise(skb) must be re-assigned.

In the current tt_query message handling code this is not done and therefore, in
case of skb linearization, the pointer used to handle the packet header ends up
in pointing to poisoned memory. The packet is then dropped but the
translation-table mechanism is corrupted.

Signed-off-by: Antonio Quartulli <ed91ce0fd2670d4a98b12fc9ec6b7a497c7ed53f@autistici.org>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org>
Signed-off-by: Sven Eckelmann <dd860110a62b19214c4ee03aec0abffecb4e86b8@narfation.org>

--- net/batman-adv/routing.c
+++ net/batman-adv/routing.c
@@ -617,6 +617,8 @@
 			 * changes */
 			if (skb_linearize(skb) < 0)
 				goto out;
+			/* skb_linearize() possibly changed skb->data */
+			tt_query = (struct tt_query_packet *)skb->data;

 			tt_len = tt_query->tt_data * sizeof(struct tt_change);


formatting

formatting

--- include/exp.h
+++ include/exp.h
@@ -868,9 +868,12 @@
     static Location* regOf(Exp *e) {return new Location(opRegOf, e, NULL);}
     static Location* memOf(Exp *e, UserProc* p = NULL) {
         return new Location(opMemOf, e, p);}
-    static Location* global(const char *nam, UserProc *p) {return new Location(opGlobal, new Const((char*)nam), p);}
-    static Location* local(const char *nam, UserProc *p) {return new Location(opLocal, new Const((char*)nam), p);}
-    static Location* param(const char *nam, UserProc *p = NULL) {return new Location(opParam, new Const((char*)nam), p);}
+    static Location* global(const char *nam, UserProc *p) {
+        return new Location(opGlobal, new Const((char*)nam), p);}
+    static Location* local(const char *nam, UserProc *p) {
+        return new Location(opLocal, new Const((char*)nam), p);}
+    static Location* param(const char *nam, UserProc *p = NULL) {
+        return new Location(opParam, new Const((char*)nam), p);}
     // Clone
     virtual Exp* clone();


Bluetooth: hci_get_cmd_complete() can be static

There are new sparse warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next master
head:   a0b644b0385fa58ca578f6dce4473e8a8e6f6c38
commit: 75e84b7c522c6e07964cd1f5bf28535768a1e9fa Bluetooth: Add __hci_cmd_sync() helper function
date:   13 days ago

>> net/bluetooth/hci_core.c:82:16: sparse: symbol 'hci_get_cmd_complete' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <24f7fe9d205c8a9f6ade0c2894e14303ca16087f@intel.com>
Acked-by: Johan Hedberg <628991c7b0a19c384f9b99c21ec330ce952bb838@intel.com>
Signed-off-by: Gustavo Padovan <029a69b25713d0799b81c0a39685b4c040fa1425@collabora.co.uk>

--- net/bluetooth/hci_core.c
+++ net/bluetooth/hci_core.c
@@ -79,7 +79,8 @@
 	}
 }

-struct sk_buff *hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 event)
+static struct sk_buff *hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode,
+					    u8 event)
 {
 	struct hci_ev_cmd_complete *ev;
 	struct hci_event_hdr *hdr;


Common: LRUCache code clean.

Common: LRUCache code clean.


rssi is signed int

rssi is signed int

--- include/hci.h
+++ include/hci.h
@@ -517,7 +517,7 @@
 typedef struct {
 	uint8_t 	status;
 	uint16_t	handle;
-	uint8_t 	rssi;
+	int8_t  	rssi;
 } __attribute__ ((packed)) read_rssi_rp;
 #define READ_RSSI_RP_SIZE 4


pfsend: add egress rate in pps (#4)

pfsend: add egress rate in pps (#4)

--- userland/examples/pfsend.c
+++ userland/examples/pfsend.c
@@ -332,7 +332,7 @@
   u_int32_t num_to_send = 0;
   int bind_core = -1;
   u_int16_t cpu_percentage = 0;
-  double gbit_s = 0, td, pps;
+  double gbit_s = 0, td, pps = 0;
   ticks tick_start = 0, tick_delta = 0;
   ticks hz = 0;
   struct packet *tosend;
@@ -343,7 +343,7 @@
   char *pidFileName = NULL;
   int send_error_once = 1;

-  while((c = getopt(argc, argv, "b:dhi:n:g:l:af:r:vm:P:w:zx:")) != -1) {
+  while((c = getopt(argc, argv, "b:dhi:n:g:l:af:r:vm:p:P:w:zx:")) != -1) {
     switch(c) {
     case 'b':
       num_balanced_pkts = atoi(optarg);
@@ -378,6 +378,9 @@
       break;
     case 'r':
       sscanf(optarg, "%lf", &gbit_s);
+      break;
+    case 'p':
+      sscanf(optarg, "%lf", &pps);
       break;
     case 'm':
       if(sscanf(optarg, "%02X:%02X:%02X:%02X:%02X:%02X", &mac_a, &mac_b, &mac_c, &mac_d, &mac_e, &mac_f) != 6) {
@@ -454,7 +457,7 @@
   if(send_len < 60)
     send_len = 60;

-  if(gbit_s != 0) {
+  if(gbit_s != 0 || pps != 0) {
     /* computing usleep delay */
     tick_start = getticks();
     usleep(1);
@@ -588,11 +591,19 @@
   if(gbit_s > 0) {
     /* computing max rate */
     pps = ((gbit_s * 1000000000) / 8 /*byte*/) / (8 /*Preamble*/ + send_len + 4 /*CRC*/ + 12 /*IFG*/);
-
-    td = (double)(hz / pps);
+  } else if (gbit_s < 0) {
+    /* capture rate */
+    pps = -1;
+  } /* else use pps */
+
+  if (pps > 0) {
+    td = (double) (hz / pps);
     tick_delta = (ticks)td;

-    printf("Number of %d-byte Packet Per Second at %.2f Gbit/s: %.2f\n", (send_len + 4 /*CRC*/), gbit_s, pps);
+    if (gbit_s > 0)
+      printf("Rate set to %.2f Gbit/s, %d-byte packets, %.2f pps\n", gbit_s, (send_len + 4 /*CRC*/), pps);
+    else
+      printf("Rate set to %.2f pps\n", pps);
   }

   if(bind_core >= 0)
@@ -665,7 +676,7 @@
   if(pfring_get_appl_stats_file_name(pd, path, sizeof(path)) != NULL)
     fprintf(stderr, "Dumping statistics on %s\n", path);

-  if(gbit_s != 0)
+  if(pps != 0)
     tick_start = getticks();

   while((num_to_send == 0)
@@ -685,12 +696,12 @@
       break;

     if (if_index != -1)
-      rc = pfring_send_ifindex(pd, tosend->pkt, tosend->len, gbit_s < 0 ? 1 : 0 /* Don't flush (it does PF_RING automatically) */, if_index);
+      rc = pfring_send_ifindex(pd, tosend->pkt, tosend->len, pps < 0 ? 1 : 0 /* Don't flush (it does PF_RING automatically) */, if_index);
     else if(use_zero_copy_tx)
       /* We pre-filled the TX slots */
-      rc = pfring_send(pd, NULL, tosend->len, gbit_s < 0 ? 1 : 0 /* Don't flush (it does PF_RING automatically) */);
+      rc = pfring_send(pd, NULL, tosend->len, pps < 0 ? 1 : 0 /* Don't flush (it does PF_RING automatically) */);
     else
-      rc = pfring_send(pd, tosend->pkt, tosend->len, gbit_s < 0 ? 1 : 0 /* Don't flush (it does PF_RING automatically) */);
+      rc = pfring_send(pd, tosend->pkt, tosend->len, pps < 0 ? 1 : 0 /* Don't flush (it does PF_RING automatically) */);

     if (unlikely(verbose))
       printf("[%d] pfring_send(%d) returned %d\n", i, tosend->len, rc);
@@ -718,11 +729,11 @@
 	&& (num_pkt_good_sent == num_tx_slots))
       tosend = pkt_head;

-    if(gbit_s > 0) {
+    if(pps > 0) {
       /* rate set */
       while((getticks() - tick_start) < (num_pkt_good_sent * tick_delta))
         if (unlikely(do_shutdown)) break;
-    } else if (gbit_s < 0) {
+    } else if (pps < 0) {
       /* real pcap rate */
       if (tosend->ticks_from_beginning == 0)
         tick_start = getticks(); /* first packet, resetting time */


Add missing splpy_sh.h

Add missing splpy_sh.h

error: pathspec 'com.ibm.streamsx.topology/opt/python/include/splpy_sh.h' did not match any file(s) known to git

--- com.ibm.streamsx.topology/opt/python/include/splpy_sh.h
+++ com.ibm.streamsx.topology/opt/python/include/splpy_sh.h
@@ -0,0 +1,27 @@
+#ifndef SPL_SPLPY_SH_H_
+#define SPL_SPLPY_SH_H_
+
+#include <SPL/Runtime/Operator/State/ConsistentRegionContext.h>
+#include <SPL/Runtime/Operator/State/StateHandler.h>
+#include <SPL/Runtime/Utility/Mutex.h>
+
+// Support for consistent region and checkpointing in python operators
+
+inline void MY_OPERATOR::checkpoint(SPL::Checkpoint & ckpt) {
+  SPLAPPTRC(L_TRACE, "checkpoint: enter", "python");
+  op()->checkpoint(ckpt);
+  SPLAPPTRC(L_TRACE, "checkpoint: exit", "python");
+}
+
+inline void MY_OPERATOR::reset(SPL::Checkpoint & ckpt) {
+  SPLAPPTRC(L_TRACE, "reset: enter", "python");
+  op()->reset(ckpt);
+  SPLAPPTRC(L_TRACE, "reset: exit", "python");
+}
+
+inline void MY_OPERATOR::resetToInitialState() {
+  SPLAPPTRC(L_TRACE, "resetToInitialState: enter", "python");
+  op()->resetToInitialState();
+  SPLAPPTRC(L_TRACE, "resetToInitialState: exit", "python");
+}
+#endif


After a panic, do not fill up the dmesg with splassert messages. They scroll away the important information.  Disable splassert in panic(). OK deraadt@ uebayasi@ sthen@

--- kern/subr_prf.c
+++ kern/subr_prf.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: subr_prf.c,v 1.78 2013/07/03 15:17:24 sf Exp $	*/
+/*	$OpenBSD: subr_prf.c,v 1.79 2013/08/07 22:06:48 bluhm Exp $	*/
 /*	$NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $	*/

 /*-
@@ -184,6 +184,9 @@
 	static char panicbuf[512];
 	int bootopt;
 	va_list ap;
+
+	/* do not trigger assertions, we know that we are inconsistent */
+	splassert_ctl = 0;

 	bootopt = RB_AUTOBOOT | RB_DUMP;
 	va_start(ap, fmt);


Bluetooth: Disable HCI_CONNECTABLE based passive scanning for now

When HCI_CONNECTABLE is set the code has been enabling passive scanning
in order to be consistent with BR/EDR and accept connections from any
device doing directed advertising to us. However, some hardware
(particularly CSR) can get very noisy even when doing duplicates
filtering, making this feature waste resources.

Considering that the feature is for fairly corner-case use (devices
who'd use directed advertising would likely be in the whitelist anyway)
it's better to disable it for now. It may still be brought back later,
possibly with a better implementation (e.g. through improved scan
parameters).

Signed-off-by: Johan Hedberg <628991c7b0a19c384f9b99c21ec330ce952bb838@intel.com>
Signed-off-by: Marcel Holtmann <44592b4eea36663c86b994bb0ea99d15309c1c7d@holtmann.org>


dedupe and cleanup some things

dedupe and cleanup some things

--- src/store/redis/redis_nodeset.c
+++ src/store/redis/redis_nodeset.c
@@ -146,12 +146,12 @@
 #endif

-static char *rcp_cstr(redis_connect_params_t *rcp) {
+static const char *rcp_cstr(redis_connect_params_t *rcp) {
   static char    buf[512];
   ngx_snprintf((u_char *)buf, 512, "%V:%d%Z", &rcp->hostname, rcp->port, &rcp->peername);
     return buf;
 }
-static char *node_cstr(redis_node_t *node) {
+static const char *node_cstr(redis_node_t *node) {
   return rcp_cstr(&node->connect_params);
 }

@@ -929,9 +929,6 @@
   }
 }

-void nodeset_examine_timer_wrapper(void *pd) {
-  nodeset_examine(pd);
-}
 static void redis_nginx_unexpected_disconnect_event_handler(const redisAsyncContext *ac, int status) {
   redis_node_t    *node = ac->data;
   //char            *which_ctx;
@@ -1516,14 +1513,12 @@
 }

 const char *__node_nickname_cstr(redis_node_t *node) {
-  static char str[1024];
   if(node) {
-    ngx_snprintf((u_char *)str, 1024, "%V:%d%Z", &node->connect_params.hostname, node->connect_params.port);
+    return node_cstr(node);
   }
   else {
-    ngx_snprintf((u_char *)str,1024, "???%Z");
-  }
-  return str;
+    return "???";
+  }
 }

 ngx_int_t nodeset_set_status(redis_nodeset_t *nodeset, redis_nodeset_status_t status, const char *msg) {


i2c: change inline functions to static inline

When compiling with optimization level 0 (-O0), the linker complains
about missing references to uart functions. This is due to compiler
treating this functions as extern, since -O0 disables function inlining,
as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653

So change the declaration to static inline.

Change-Id: I5963153dc1efd22083b6b91ae2b70c11d602c6c6
Signed-off-by: Daniel Leung <d94e04d205b5962d7873a139ef298b03c1717f72@intel.com>

--- include/i2c.h
+++ include/i2c.h
@@ -97,7 +97,7 @@
  * @param dev Pointer to the device structure for the driver instance
  * @param config Pointer to the application provided configuration
  */
-inline int i2c_configure(struct device *dev, struct i2c_config *config)
+static inline int i2c_configure(struct device *dev, struct i2c_config *config)
 {
 	struct i2c_driver_api *api;

@@ -111,7 +111,8 @@
  * @param buf Memory pool that data should be transferred from
  * @param len Size of the memory pool available for reading from
  */
-inline int i2c_write(struct device *dev, unsigned char *buf, uint32_t len)
+static inline int i2c_write(struct device *dev, unsigned char *buf,
+			    uint32_t len)
 {
 	struct i2c_driver_api *api;

@@ -125,7 +126,8 @@
  * @param buf Memory pool that data should be transferred to
  * @param len Size of the memory pool available for writing to
  */
-inline int i2c_read(struct device *dev, unsigned char *buf, uint32_t len)
+static inline int i2c_read(struct device *dev, unsigned char *buf,
+			   uint32_t len)
 {
 	struct i2c_driver_api *api;

@@ -137,7 +139,7 @@
  * @brief Suspend an I2C driver
  * @param dev Pointer to the device structure for the driver instance
  */
-inline int i2c_suspend(struct device *dev)
+static inline int i2c_suspend(struct device *dev)
 {
 	struct i2c_driver_api *api;

@@ -149,7 +151,7 @@
  * @brief Resume an I2C driver
  * @param dev Pointer to the device structure for the driver instance
  */
-inline int i2c_resume(struct device *dev)
+static inline int i2c_resume(struct device *dev)
 {
 	struct i2c_driver_api *api;