Lines Matching defs:fan
130 /* Attach only if there's at least one fan. */
147 aprint_normal(": Apple SMC fan sensors\n");
175 * the names of the fan keys; see the fan_sensor table above.
226 /* Release the keys and free the memory for fan records. */
245 uint8_t fan, sensor;
258 /* Create an array of fan sensor records. */
264 for (fan = 0; fan < sc->sc_nfans; fan++) {
266 /* Format the name of the key for the fan's description. */
268 "F%"PRIu8"ID", fan);
271 /* Look up the key for this fan's description. */
276 "error identifying fan %"PRIu8": %d\n",
277 fan, error);
281 /* Read the description of this fan. */
286 "error identifying fan %"PRIu8": %d\n",
287 fan, error);
292 * XXX Do more with the fan description...
295 /* Make a null-terminated copy of this fan's description. */
299 /* Attach all the sensors for this fan. */
301 apple_smc_fan_attach_sensor(sc, fan, name, sensor);
304 /* Attach sysctl knobs to control this fan. */
305 apple_smc_fan_sysctl_setup_1(sc, fan);
309 /* Fan sensors are all attached. Register with sysmon_envsys now. */
324 apple_smc_fan_attach_sensor(struct apple_smc_fan_softc *sc, uint8_t fan,
332 KASSERT(fan < sc->sc_nfans);
335 /* Format the name of the key for this fan sensor. */
340 /* Look up the key for this fan sensor. */
341 keyp = &sc->sc_fans[fan].sensors[sensor].sensor_key;
347 /* Initialize the envsys_data record for this fan sensor. */
348 edata = &sc->sc_fans[fan].sensors[sensor].sensor_data;
352 (void)snprintf(edata->desc, sizeof(edata->desc), "fan %s %s speed",
355 /* Attach this fan sensor to sysmon_envsys. */
366 "failed to attach fan %s %s speed sensor: %d\n",
374 uint8_t fan, sensor;
388 /* Pick apart the fan number and its sensor number. */
389 fan = (edata->sensor / __arraycount(fan_sensors));
392 KASSERT(fan < sc->sc_nfans);
394 KASSERT(edata == &sc->sc_fans[fan].sensors[sensor].sensor_data);
400 key = sc->sc_fans[fan].sensors[sensor].sensor_key;
403 /* Read the fan sensor value, in rpm. */
407 "failed to read fan %d %s speed: %d\n",
408 fan, fan_sensors[sensor].fs_name, error);
421 uint8_t fan, sensor;
423 for (fan = 0; fan < sc->sc_nfans; fan++) {
428 &sc->sc_fans[fan].sensors[sensor].sensor_key;
445 apple_smc_fan_sysctl_setup_1(struct apple_smc_fan_softc *sc, uint8_t fan)