#include <linux/crc16.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/hid.h>
#include <linux/hwmon.h>
#include <linux/jiffies.h>
#include <linux/ktime.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/seq_file.h>
#include <asm/unaligned.h>
#define USB_VENDOR_ID_AQUACOMPUTER …
#define USB_PRODUCT_ID_AQUAERO …
#define USB_PRODUCT_ID_FARBWERK …
#define USB_PRODUCT_ID_QUADRO …
#define USB_PRODUCT_ID_D5NEXT …
#define USB_PRODUCT_ID_FARBWERK360 …
#define USB_PRODUCT_ID_OCTO …
#define USB_PRODUCT_ID_HIGHFLOWNEXT …
#define USB_PRODUCT_ID_LEAKSHIELD …
#define USB_PRODUCT_ID_AQUASTREAMXT …
#define USB_PRODUCT_ID_AQUASTREAMULT …
#define USB_PRODUCT_ID_POWERADJUST3 …
#define USB_PRODUCT_ID_HIGHFLOW …
enum kinds { … };
static const char *const aqc_device_names[] = …;
#define DRIVER_NAME …
#define STATUS_REPORT_ID …
#define STATUS_UPDATE_INTERVAL …
#define SERIAL_PART_OFFSET …
#define CTRL_REPORT_ID …
#define AQUAERO_CTRL_REPORT_ID …
#define CTRL_REPORT_DELAY …
#define SECONDARY_CTRL_REPORT_ID …
#define SECONDARY_CTRL_REPORT_SIZE …
static u8 secondary_ctrl_report[] = …;
#define AQUAERO_SECONDARY_CTRL_REPORT_ID …
#define AQUAERO_SECONDARY_CTRL_REPORT_SIZE …
static u8 aquaero_secondary_ctrl_report[] = …;
#define AQUASTREAMXT_STATUS_REPORT_ID …
#define POWERADJUST3_STATUS_REPORT_ID …
#define HIGHFLOW_STATUS_REPORT_ID …
#define AQC_8 …
#define AQC_BE16 …
#define AQC_SERIAL_START …
#define AQC_FIRMWARE_VERSION …
#define AQC_SENSOR_SIZE …
#define AQC_SENSOR_NA …
#define AQC_FAN_PERCENT_OFFSET …
#define AQC_FAN_VOLTAGE_OFFSET …
#define AQC_FAN_CURRENT_OFFSET …
#define AQC_FAN_POWER_OFFSET …
#define AQC_FAN_SPEED_OFFSET …
#define AQUAERO_SERIAL_START …
#define AQUAERO_FIRMWARE_VERSION …
#define AQUAERO_NUM_FANS …
#define AQUAERO_NUM_SENSORS …
#define AQUAERO_NUM_VIRTUAL_SENSORS …
#define AQUAERO_NUM_CALC_VIRTUAL_SENSORS …
#define AQUAERO_NUM_FLOW_SENSORS …
#define AQUAERO_CTRL_REPORT_SIZE …
#define AQUAERO_CTRL_PRESET_ID …
#define AQUAERO_CTRL_PRESET_SIZE …
#define AQUAERO_CTRL_PRESET_START …
#define AQUAERO_SENSOR_START …
#define AQUAERO_VIRTUAL_SENSOR_START …
#define AQUAERO_CALC_VIRTUAL_SENSOR_START …
#define AQUAERO_FLOW_SENSORS_START …
#define AQUAERO_FAN_VOLTAGE_OFFSET …
#define AQUAERO_FAN_CURRENT_OFFSET …
#define AQUAERO_FAN_POWER_OFFSET …
#define AQUAERO_FAN_SPEED_OFFSET …
static u16 aquaero_sensor_fan_offsets[] = …;
#define AQUAERO_TEMP_CTRL_OFFSET …
#define AQUAERO_FAN_CTRL_MIN_PWR_OFFSET …
#define AQUAERO_FAN_CTRL_MAX_PWR_OFFSET …
#define AQUAERO_FAN_CTRL_SRC_OFFSET …
static u16 aquaero_ctrl_fan_offsets[] = …;
#define D5NEXT_NUM_FANS …
#define D5NEXT_NUM_SENSORS …
#define D5NEXT_NUM_VIRTUAL_SENSORS …
#define D5NEXT_CTRL_REPORT_SIZE …
#define D5NEXT_POWER_CYCLES …
#define D5NEXT_COOLANT_TEMP …
#define D5NEXT_PUMP_OFFSET …
#define D5NEXT_FAN_OFFSET …
#define D5NEXT_5V_VOLTAGE …
#define D5NEXT_12V_VOLTAGE …
#define D5NEXT_VIRTUAL_SENSORS_START …
static u16 d5next_sensor_fan_offsets[] = …;
#define D5NEXT_TEMP_CTRL_OFFSET …
static u16 d5next_ctrl_fan_offsets[] = …;
#define AQUASTREAMULT_NUM_FANS …
#define AQUASTREAMULT_NUM_SENSORS …
#define AQUASTREAMULT_SENSOR_START …
#define AQUASTREAMULT_PUMP_OFFSET …
#define AQUASTREAMULT_PUMP_VOLTAGE …
#define AQUASTREAMULT_PUMP_CURRENT …
#define AQUASTREAMULT_PUMP_POWER …
#define AQUASTREAMULT_FAN_OFFSET …
#define AQUASTREAMULT_PRESSURE_OFFSET …
#define AQUASTREAMULT_FLOW_SENSOR_OFFSET …
#define AQUASTREAMULT_FAN_VOLTAGE_OFFSET …
#define AQUASTREAMULT_FAN_CURRENT_OFFSET …
#define AQUASTREAMULT_FAN_POWER_OFFSET …
#define AQUASTREAMULT_FAN_SPEED_OFFSET …
static u16 aquastreamult_sensor_fan_offsets[] = …;
#define FARBWERK_NUM_SENSORS …
#define FARBWERK_SENSOR_START …
#define FARBWERK360_NUM_SENSORS …
#define FARBWERK360_NUM_VIRTUAL_SENSORS …
#define FARBWERK360_CTRL_REPORT_SIZE …
#define FARBWERK360_SENSOR_START …
#define FARBWERK360_VIRTUAL_SENSORS_START …
#define FARBWERK360_TEMP_CTRL_OFFSET …
#define OCTO_NUM_FANS …
#define OCTO_NUM_SENSORS …
#define OCTO_NUM_VIRTUAL_SENSORS …
#define OCTO_NUM_FLOW_SENSORS …
#define OCTO_CTRL_REPORT_SIZE …
#define OCTO_POWER_CYCLES …
#define OCTO_SENSOR_START …
#define OCTO_VIRTUAL_SENSORS_START …
#define OCTO_FLOW_SENSOR_OFFSET …
static u16 octo_sensor_fan_offsets[] = …;
#define OCTO_TEMP_CTRL_OFFSET …
#define OCTO_FLOW_PULSES_CTRL_OFFSET …
static u16 octo_ctrl_fan_offsets[] = …;
#define QUADRO_NUM_FANS …
#define QUADRO_NUM_SENSORS …
#define QUADRO_NUM_VIRTUAL_SENSORS …
#define QUADRO_NUM_FLOW_SENSORS …
#define QUADRO_CTRL_REPORT_SIZE …
#define QUADRO_POWER_CYCLES …
#define QUADRO_SENSOR_START …
#define QUADRO_VIRTUAL_SENSORS_START …
#define QUADRO_FLOW_SENSOR_OFFSET …
static u16 quadro_sensor_fan_offsets[] = …;
#define QUADRO_TEMP_CTRL_OFFSET …
#define QUADRO_FLOW_PULSES_CTRL_OFFSET …
static u16 quadro_ctrl_fan_offsets[] = …;
#define HIGHFLOWNEXT_NUM_SENSORS …
#define HIGHFLOWNEXT_NUM_FLOW_SENSORS …
#define HIGHFLOWNEXT_SENSOR_START …
#define HIGHFLOWNEXT_FLOW …
#define HIGHFLOWNEXT_WATER_QUALITY …
#define HIGHFLOWNEXT_POWER …
#define HIGHFLOWNEXT_CONDUCTIVITY …
#define HIGHFLOWNEXT_5V_VOLTAGE …
#define HIGHFLOWNEXT_5V_VOLTAGE_USB …
#define LEAKSHIELD_NUM_SENSORS …
#define LEAKSHIELD_PRESSURE_ADJUSTED …
#define LEAKSHIELD_TEMPERATURE_1 …
#define LEAKSHIELD_TEMPERATURE_2 …
#define LEAKSHIELD_PRESSURE_MIN …
#define LEAKSHIELD_PRESSURE_TARGET …
#define LEAKSHIELD_PRESSURE_MAX …
#define LEAKSHIELD_PUMP_RPM_IN …
#define LEAKSHIELD_FLOW_IN …
#define LEAKSHIELD_RESERVOIR_VOLUME …
#define LEAKSHIELD_RESERVOIR_FILLED …
#define AQUASTREAMXT_SERIAL_START …
#define AQUASTREAMXT_FIRMWARE_VERSION …
#define AQUASTREAMXT_NUM_FANS …
#define AQUASTREAMXT_NUM_SENSORS …
#define AQUASTREAMXT_FAN_STOPPED …
#define AQUASTREAMXT_PUMP_CONVERSION_CONST …
#define AQUASTREAMXT_FAN_CONVERSION_CONST …
#define AQUASTREAMXT_SENSOR_REPORT_SIZE …
#define AQUASTREAMXT_SENSOR_START …
#define AQUASTREAMXT_FAN_VOLTAGE_OFFSET …
#define AQUASTREAMXT_FAN_STATUS_OFFSET …
#define AQUASTREAMXT_PUMP_VOLTAGE_OFFSET …
#define AQUASTREAMXT_PUMP_CURR_OFFSET …
static u16 aquastreamxt_sensor_fan_offsets[] = …;
#define POWERADJUST3_NUM_SENSORS …
#define POWERADJUST3_SENSOR_REPORT_SIZE …
#define POWERADJUST3_SENSOR_START …
#define HIGHFLOW_NUM_SENSORS …
#define HIGHFLOW_NUM_FLOW_SENSORS …
#define HIGHFLOW_SENSOR_REPORT_SIZE …
#define HIGHFLOW_FIRMWARE_VERSION …
#define HIGHFLOW_SERIAL_START …
#define HIGHFLOW_FLOW_SENSOR_OFFSET …
#define HIGHFLOW_SENSOR_START …
static const char *const label_d5next_temp[] = …;
static const char *const label_d5next_speeds[] = …;
static const char *const label_d5next_power[] = …;
static const char *const label_d5next_voltages[] = …;
static const char *const label_d5next_current[] = …;
static const char *const label_temp_sensors[] = …;
static const char *const label_virtual_temp_sensors[] = …;
static const char *const label_aquaero_calc_temp_sensors[] = …;
static const char *const label_fan_power[] = …;
static const char *const label_fan_voltage[] = …;
static const char *const label_fan_current[] = …;
static const char *const label_octo_speeds[] = …;
static const char *const label_quadro_speeds[] = …;
static const char *const label_aquaero_speeds[] = …;
static const char *const label_highflownext_temp_sensors[] = …;
static const char *const label_highflownext_fan_speed[] = …;
static const char *const label_highflownext_power[] = …;
static const char *const label_highflownext_voltage[] = …;
static const char *const label_leakshield_temp_sensors[] = …;
static const char *const label_leakshield_fan_speed[] = …;
static const char *const label_aquastreamxt_temp_sensors[] = …;
static const char *const label_aquastreamult_temp[] = …;
static const char *const label_aquastreamult_speeds[] = …;
static const char *const label_aquastreamult_power[] = …;
static const char *const label_aquastreamult_voltages[] = …;
static const char *const label_aquastreamult_current[] = …;
static const char *const label_poweradjust3_temp_sensors[] = …;
static const char *const label_highflow_temp[] = …;
static const char *const label_highflow_speeds[] = …;
struct aqc_fan_structure_offsets { … };
static struct aqc_fan_structure_offsets aqc_aquaero_fan_structure = …;
static struct aqc_fan_structure_offsets aqc_aquastreamult_fan_structure = …;
static struct aqc_fan_structure_offsets aqc_general_fan_structure = …;
struct aqc_data { … };
static int aqc_percent_to_pwm(u16 val)
{ … }
static int aqc_pwm_to_percent(long val)
{ … }
static int aqc_aquastreamxt_convert_pump_rpm(u16 val)
{ … }
static int aqc_aquastreamxt_convert_fan_rpm(u16 val)
{ … }
static void aqc_delay_ctrl_report(struct aqc_data *priv)
{ … }
static int aqc_get_ctrl_data(struct aqc_data *priv)
{ … }
static int aqc_send_ctrl_data(struct aqc_data *priv)
{ … }
static int aqc_get_ctrl_val(struct aqc_data *priv, int offset, long *val, int type)
{ … }
static int aqc_set_ctrl_vals(struct aqc_data *priv, int *offsets, long *vals, int *types, int len)
{ … }
static int aqc_set_ctrl_val(struct aqc_data *priv, int offset, long val, int type)
{ … }
static umode_t aqc_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, int channel)
{ … }
static int aqc_legacy_read(struct aqc_data *priv)
{ … }
static int aqc_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{ … }
static int aqc_read_string(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, const char **str)
{ … }
static int aqc_write(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel,
long val)
{ … }
static const struct hwmon_ops aqc_hwmon_ops = …;
static const struct hwmon_channel_info * const aqc_info[] = …;
static const struct hwmon_chip_info aqc_chip_info = …;
static int aqc_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size)
{ … }
static int serial_number_show(struct seq_file *seqf, void *unused)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int firmware_version_show(struct seq_file *seqf, void *unused)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int power_cycles_show(struct seq_file *seqf, void *unused)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static void aqc_debugfs_init(struct aqc_data *priv)
{ … }
static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ … }
static void aqc_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id aqc_table[] = …;
MODULE_DEVICE_TABLE(hid, aqc_table);
static struct hid_driver aqc_driver = …;
static int __init aqc_init(void)
{ … }
static void __exit aqc_exit(void)
{ … }
late_initcall(aqc_init);
module_exit(aqc_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;