Commit af8f7c16 authored by Adam Wujek's avatar Adam Wujek 💬

[Feature:#3] userspace/tools: wrs_dump_shmem dump some monitoring info from the SFP's DOM area

Dump temperature, voltage, bias, TX and RX power from the SFP's DOM area
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 74e16153
......@@ -189,6 +189,19 @@ void dump_one_field(void *addr, struct dump_info *info)
printf("SFP in data base, ");
printf("\n");
break;
case dump_type_sfp_dom_temp:
printf("%.3f C\n", ntohs(*(short *)p)/(float)256);
break;
case dump_type_sfp_dom_voltage:
printf("%.3f V\n", ntohs(*(short *)p)/(float)10000);
break;
case dump_type_sfp_dom_bias_curr:
printf("%.3f mA\n", ntohs(*(short *)p)/(float)500);
break;
case dump_type_sfp_dom_tx_power:
case dump_type_sfp_dom_rx_power:
printf("%.3f mW\n", ntohs(*(short *)p)/(float)10000);
break;
case dump_type_port_mode:
switch (*(uint32_t *)p) {
case HEXP_PORT_MODE_WR_MASTER:
......@@ -365,6 +378,13 @@ struct dump_info hal_port_info [] = {
DUMP_FIELD(int, calib.sfp.rx_wl),
DUMP_FIELD(pointer, calib.sfp.next),
/* Dump some values from the SFP's DOM area of */
DUMP_FIELD(sfp_dom_temp, calib.sfp_dom_raw.temp),
DUMP_FIELD(sfp_dom_voltage, calib.sfp_dom_raw.vcc),
DUMP_FIELD(sfp_dom_bias_curr, calib.sfp_dom_raw.tx_bias),
DUMP_FIELD(sfp_dom_tx_power, calib.sfp_dom_raw.tx_pow),
DUMP_FIELD(sfp_dom_rx_power, calib.sfp_dom_raw.rx_pow),
DUMP_FIELD(uint32_t, phase_val),
DUMP_FIELD(int, phase_val_valid),
DUMP_FIELD(int, tx_cal_pending),
......
......@@ -61,6 +61,11 @@ enum dump_type {
dump_type_time,
dump_type_ip_address,
dump_type_sfp_flags,
dump_type_sfp_dom_temp,
dump_type_sfp_dom_voltage,
dump_type_sfp_dom_bias_curr,
dump_type_sfp_dom_tx_power,
dump_type_sfp_dom_rx_power,
dump_type_port_mode,
dump_type_sensor_temp,
/* SoftPLL's enumerations */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment