Lines Matching defs:sensor
62 * Environmental sensor framework for sysmon, exported to userland
379 sme = sysmon_envsys_find_40(tred->sensor);
383 oidx = tred->sensor;
384 tred->sensor = SME_SENSOR_IDX(sme, tred->sensor);
386 DPRINTFOBJ(("%s: sensor=%d oidx=%d dev=%s nsensors=%d\n",
387 __func__, tred->sensor, oidx, sme->sme_name,
391 if (edata->sensor == tred->sensor) {
403 if (tred->sensor < sme->sme_nsensors) {
413 tred->sensor = edata->sensor;
440 DPRINTFOBJ(("%s: sensor=%s tred->cur.data_s=%d\n",
443 " tred->sensor=%d\n", __func__, tred->validflags,
444 tred->units, tred->sensor));
446 tred->sensor = oidx;
459 sme = sysmon_envsys_find_40(binfo->sensor);
463 oidx = binfo->sensor;
464 binfo->sensor = SME_SENSOR_IDX(sme, binfo->sensor);
467 if (edata->sensor == binfo->sensor) {
481 if (binfo->sensor < sme->sme_nsensors) {
488 * previously, the ACPI sensor names included the
501 DPRINTFOBJ(("%s: binfo->desc=%s binfo->sensor=%d\n",
502 __func__, binfo->desc, binfo->sensor));
504 binfo->sensor = oidx;
566 * + Attaches a sensor into a sysmon_envsys device checking that units
578 * Find the correct units for this sensor.
600 * Ok, the sensor has been added into the device queue.
605 * Give the sensor an index position.
607 edata->sensor = sme->sme_nsensors;
613 __func__, edata->sensor, edata->desc,
622 * + Detachs a sensor
635 * Check the sensor is already on the list.
640 if (oedata->sensor == edata->sensor) {
746 * Iterate over all sensors and create a dictionary per sensor.
757 * Create all objects in sensor's dictionary.
769 * If the array does not contain any object (sensor), there's
830 * Hook the sensor into rnd(4) entropy pool if requested
1190 (void)snprintf(tmp, sizeof(tmp), "sensor%d",
1191 edata->sensor);
1278 * If the sensor is providing entropy data,
1308 /* Finally, if the sensor provides entropy,
1416 * + Adds the sensor objects into the dictionary and returns a pointer
1431 * Add the index sensor string.
1438 (void)snprintf(indexstr, sizeof(indexstr), "sensor%d", edata->sensor);
1514 * the sensor provides entropy for rnd(4).
1535 * The provided callback decides whether a sensor is part of the
1580 * refresh sensor data
1598 * + Update per-sensor dictionaries with new values if there were
1652 * the device is already marked as busy; if a sensor
1657 * refresh sensor data via sme_envsys_refresh_sensor
1664 * retrieve sensor's dictionary.
1666 dict = prop_array_get(array, edata->sensor);
1669 __func__, edata->sensor, sme->sme_name));
1674 * update sensor's state.
1694 printf("sme_update_sensor_dictionary: cannot update sensor %d "
1695 "state %d unknown\n", edata->sensor, edata->state);
1699 DPRINTFOBJ(("%s: sensor #%d type=%d (%s) flags=%d\n", __func__,
1700 edata->sensor, sdt->type, sdt->desc, edata->flags));
1707 * update sensor's type.
1713 DPRINTFOBJ(("%s: sensor #%d units=%d (%s)\n", __func__, edata->sensor,
1722 * update sensor's current value.
1738 * update sensor flags.
1748 * update sensor's {max,min}-value.
1867 * Get sensor's index from userland dictionary.
1881 * the device is already marked as busy; if a sensor
1886 * Get a dictionary and check if it's our sensor by checking
1889 dict = prop_array_get(array, edata->sensor);
1893 * is it our sensor?
1913 if (i == edata->sensor)
1936 DPRINTF(("%s: sensor%d changed desc to: %s\n",
1937 __func__, edata->sensor, blah));
1953 DPRINTF(("%s: sensor%d changed rfact to %d\n",
1954 __func__, edata->sensor, edata->rfact));
2079 * Walk through the devices' sensor lists and execute the callback.
2088 envsys_data_t *sensor;
2094 TAILQ_FOREACH(sensor, &sme->sme_sensors_list, sensors_head) {
2097 sysmon_envsys_refresh_sensor(sme, sensor);
2100 if (!(*func)(sme, sensor, arg))
2109 * Call the sensor's refresh function, and collect/stir entropy