MCPcopy Create free account
hub / github.com/F-Stack/f-stack / aw_sid_sysctl

Function aw_sid_sysctl

freebsd/arm/allwinner/aw_sid.c:364–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364static int
365aw_sid_sysctl(SYSCTL_HANDLER_ARGS)
366{
367 struct aw_sid_softc *sc;
368 device_t dev = arg1;
369 enum aw_sid_fuse_id fuse = arg2;
370 uint8_t data[32];
371 char out[128];
372 uint32_t size;
373 int ret, i;
374
375 sc = device_get_softc(dev);
376
377 /* Get the size of the efuse data */
378 size = 0;
379 aw_sid_get_fuse(fuse, NULL, &size);
380 /* We now have the real size */
381 ret = aw_sid_get_fuse(fuse, data, &size);
382 if (ret != 0) {
383 device_printf(dev, "Cannot get fuse id %d: %d\n", fuse, ret);
384 return (ENOENT);
385 }
386
387 for (i = 0; i < size; i++)
388 snprintf(out + (i * 2), sizeof(out) - (i * 2),
389 "%.2x", data[i]);
390
391 return sysctl_handle_string(oidp, out, sizeof(out), req);
392}
393
394static device_method_t aw_sid_methods[] = {
395 /* Device interface */

Callers

nothing calls this directly

Calls 5

device_get_softcFunction · 0.85
aw_sid_get_fuseFunction · 0.85
device_printfFunction · 0.85
snprintfFunction · 0.85
sysctl_handle_stringFunction · 0.85

Tested by

no test coverage detected