/** * ixgbe_add_hwmon_attr - Create hwmon attr table for a hwmon sysfs file. * @adapter: pointer to the adapter structure * @offset: offset in the eeprom sensor data table * @type: type of sensor data to display * * For each file we want in hwmon's sysfs interface we need a device_attribute * This is included in our hwmon_attr struct that contains the references to * the data structures we need to get the data to display.
*/ staticint ixgbe_add_hwmon_attr(struct ixgbe_adapter *adapter, unsignedint offset, int type) { int rc; unsignedint n_attr; struct hwmon_attr *ixgbe_attr;
/* These always the same regardless of type */
ixgbe_attr->sensor =
&adapter->hw.mac.thermal_sensor_data.sensor[offset];
ixgbe_attr->hw = &adapter->hw;
ixgbe_attr->dev_attr.store = NULL;
ixgbe_attr->dev_attr.attr.mode = 0444;
ixgbe_attr->dev_attr.attr.name = ixgbe_attr->name;
sysfs_attr_init(&ixgbe_attr->dev_attr.attr);
for (i = 0; i < IXGBE_MAX_SENSORS; i++) { /* * Only create hwmon sysfs entries for sensors that have * meaningful data for.
*/ if (adapter->hw.mac.thermal_sensor_data.sensor[i].location == 0) continue;
/* Bail if any hwmon attr struct fails to initialize */
rc = ixgbe_add_hwmon_attr(adapter, i, IXGBE_HWMON_TYPE_CAUTION); if (rc) gotoexit;
rc = ixgbe_add_hwmon_attr(adapter, i, IXGBE_HWMON_TYPE_LOC); if (rc) gotoexit;
rc = ixgbe_add_hwmon_attr(adapter, i, IXGBE_HWMON_TYPE_TEMP); if (rc) gotoexit;
rc = ixgbe_add_hwmon_attr(adapter, i, IXGBE_HWMON_TYPE_MAX); if (rc) gotoexit;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.