+static GSList *hw_scan(GSList *options)
+{
+ struct sr_dev_inst *sdi;
+ struct sr_hwopt *opt;
+ GSList *l, *devices;
+ const char *conn, *serialcomm;
+
+ conn = serialcomm = NULL;
+ for (l = options; l; l = l->next) {
+ opt = l->data;
+ switch (opt->hwopt) {
+ case SR_HWOPT_CONN:
+ conn = opt->value;
+ break;
+ case SR_HWOPT_SERIALCOMM:
+ serialcomm = opt->value;
+ break;
+ }
+ }
+ if (!conn)
+ return NULL;
+
+ if (serialcomm) {
+ /* Use the provided comm specs. */
+ devices = fluke_scan(conn, serialcomm);
+ } else {
+ /* Try 115200, as used on 287/289. */
+ devices = fluke_scan(conn, "115200/8n1");
+ if (!devices)
+ /* Fall back to 9600 for 187/189. */
+ devices = fluke_scan(conn, "9600/8n1");
+ }
+
+ return devices;
+}
+