Lines Matching +full:scan +full:- +full:count
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
53 * a generation count is maintained by the kernel. The initial generation
54 * count is obtained (along with the interface version) from the hw.bus
114 * Get the generation count and interface version, verify that we
131 debug("generation count is %d", ubus.ub_generation);
134 * Don't rescan if the generation count hasn't changed.
140 * Generation count changed, rescan
162 debug("scan failed after %d retries", retries);
202 * Scan devices.
218 if (errno != EINVAL) /* gen count skip, restart */
229 dd->dd_dev.dd_handle = udev.dv_handle;
230 dd->dd_dev.dd_parent = udev.dv_parent;
231 dd->dd_dev.dd_devflags = udev.dv_devflags;
232 dd->dd_dev.dd_flags = udev.dv_flags;
233 dd->dd_dev.dd_state = udev.dv_state;
237 dd->dd_name = NULL;
238 dd->dd_desc = NULL;
239 dd->dd_drivername = NULL;
240 dd->dd_pnpinfo = NULL;
241 dd->dd_location = NULL;
243 dd->dd_dev.x = dd->x = strdup(walker); \
244 if (dd->x == NULL) { \
248 if (walker + strnlen(walker, ep - walker) >= ep) { \
304 * Scan resource managers.
315 oid[res_ptr] = -1;
321 if (errno != EINVAL) /* gen count skip, restart */
327 dm->dm_rman.dm_handle = urman.rm_handle;
328 dm->dm_rman.dm_start = urman.rm_start;
329 dm->dm_rman.dm_size = urman.rm_size;
330 snprintf(dm->dm_desc, DEVINFO_STRLEN, "%s", urman.rm_descr);
331 dm->dm_rman.dm_desc = &dm->dm_desc[0];
335 * Scan resources on this resource manager.
350 if (errno != EINVAL) /* gen count skip */
357 dr->dr_res.dr_handle = ures.r_handle;
358 dr->dr_res.dr_rman = ures.r_parent;
359 dr->dr_res.dr_device = ures.r_device;
360 dr->dr_res.dr_start = ures.r_start;
361 dr->dr_res.dr_size = ures.r_size;
376 free(dd->dd_name);
377 free(dd->dd_desc);
378 free(dd->dd_drivername);
379 free(dd->dd_pnpinfo);
380 free(dd->dd_location);
423 if (dd->dd_dev.dd_parent == 0)
424 return(&dd->dd_dev);
429 * Scan for the device
432 if (dd->dd_dev.dd_handle == handle)
433 return(&dd->dd_dev);
446 if (dr->dr_res.dr_handle == handle)
447 return(&dr->dr_res);
460 if (dm->dm_rman.dm_handle == handle)
461 return(&dm->dm_rman);
467 * (fn) returns nonzero, abort the scan and return.
478 if (dd->dd_dev.dd_parent == parent->dd_handle)
479 if ((error = fn(&dd->dd_dev, arg)) != 0)
486 * If (fn) returns nonzero, abort the scan and return.
497 if (dr->dr_res.dr_device == dev->dd_handle)
498 if ((error = fn(dev, &dr->dr_res, arg)) != 0)
505 * on each. If (fn) returns nonzero, abort the scan and return.
516 if (dr->dr_res.dr_rman == rman->dm_handle)
517 if ((error = fn(&dr->dr_res, arg)) != 0)
524 * returns nonzero, abort the scan and return.
534 if ((error = fn(&dm->dm_rman, arg)) != 0)