/* * Same response format for all OCC versions. * Allocate the largest possible response.
*/ struct occ_response {
u8 seq_no;
u8 cmd_type;
u8 return_status;
__be16 data_length;
u8 data[OCC_RESP_DATA_BYTES];
__be16 checksum;
} __packed;
struct occ_sensor {
u8 num_sensors;
u8 version; void *data; /* pointer to sensor data start within response */
};
/* * OCC only provides one sensor data block of each type, but any number of * sensors within that block.
*/ struct occ_sensors { struct occ_sensor temp; struct occ_sensor freq; struct occ_sensor power; struct occ_sensor caps; struct occ_sensor extended;
};
/* * Use our own attribute struct so we can dynamically allocate space for the * name.
*/ struct occ_attribute { char name[32]; struct sensor_device_attribute_2 sensor;
};
int powr_sample_time_us; /* average power sample time */
u8 poll_cmd_data; /* to perform OCC poll command */ int (*send_cmd)(struct occ *occ, u8 *cmd, size_t len, void *resp,
size_t resp_len);
bool active; int error; /* final transfer error after retry */ int last_error; /* latest transfer error */ unsignedint error_count; /* number of xfr errors observed */ unsignedlong last_safe; /* time OCC entered "safe" state */
/* * Store the previous state data for comparison in order to notify * sysfs readers of state changes.
*/ int prev_error;
u8 prev_stat;
u8 prev_ext_stat;
u8 prev_occs_present;
u8 prev_ips_status;
u8 prev_mode;
};
int occ_active(struct occ *occ, bool active); int occ_setup(struct occ *occ); int occ_setup_sysfs(struct occ *occ); void occ_shutdown(struct occ *occ); void occ_shutdown_sysfs(struct occ *occ); void occ_sysfs_poll_done(struct occ *occ); int occ_update_response(struct occ *occ);
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.