src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw)
{
	struct txgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data;
	s64 tsv;
	u32 ts_stat;

	DEBUGFUNC("txgbe_get_thermal_sensor_data");

	/* Only support thermal sensors attached to physical port 0 */
	if (hw->bus.lan_id != 0)
		return TXGBE_NOT_IMPLEMENTED;

	ts_stat = rd32(hw, TXGBE_TSSTAT);
	tsv = (s64)TXGBE_TSSTAT_DATA(ts_stat);
	tsv = tsv > 1200 ? tsv : 1200;
	tsv = -(48380 << 8) / 1000
		+ tsv * (31020 << 8) / 100000
		- tsv * tsv * (18201 << 8) / 100000000
		+ tsv * tsv * tsv * (81542 << 8) / 1000000000000
		- tsv * tsv * tsv * tsv * (16743 << 8) / 1000000000000000;
	tsv >>= 8;

	data->sensor[0].temp = (s16)tsv;

	return 0;
}
/**
 *  txgbe_get_thermal_sensor_data - Gathers thermal sensor data
 *  @hw: pointer to hardware structure
 *
 *  Returns the thermal sensor data structure
 **/
Gathers thermal sensor data
@hw: pointer to hardware structure

Returns the thermal sensor data structure
Gathers thermal sensor data @hw : pointer to hardware structure Returns the thermal sensor data structure
s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw)
{
	struct txgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data;
	s64 tsv;
	u32 ts_stat;
	DEBUGFUNC("txgbe_get_thermal_sensor_data");
	if (hw->bus.lan_id != 0)
		return TXGBE_NOT_IMPLEMENTED;
	ts_stat = rd32(hw, TXGBE_TSSTAT);
	tsv = (s64)TXGBE_TSSTAT_DATA(ts_stat);
	tsv = tsv > 1200 ? tsv : 1200;
	tsv = -(48380 << 8) / 1000
		+ tsv * (31020 << 8) / 100000
		- tsv * tsv * (18201 << 8) / 100000000
		+ tsv * tsv * tsv * (81542 << 8) / 1000000000000
		- tsv * tsv * tsv * tsv * (16743 << 8) / 1000000000000000;
	tsv >>= 8;
	data->sensor[0].temp = (s16)tsv;
	return 0;
}
s32 txgbe_get_thermal_sensor_data ( struct txgbe_hw * hw ) { struct txgbe_thermal_sensor_data * data = & hw -> mac . thermal_sensor_data ; s64 tsv ; u32 ts_stat ; DEBUGFUNC ( " " ) ; if ( hw -> bus . lan_id != 0 ) return TXGBE_NOT_IMPLEMENTED ; ts_stat = rd32 ( hw , TXGBE_TSSTAT ) ; tsv = ( s64 ) TXGBE_TSSTAT_DATA ( ts_stat ) ; tsv = tsv > 1200 ? tsv : 1200 ; tsv = - ( 48380 << 8 ) / 1000 + tsv * ( 31020 << 8 ) / 100000 - tsv * tsv * ( 18201 << 8 ) / 100000000 + tsv * tsv * tsv * ( 81542 << 8 ) / 1000000000000 - tsv * tsv * tsv * tsv * ( 16743 << 8 ) / 1000000000000000 ; tsv >>= 8 ; data -> sensor [ 0 ] . temp = ( s16 ) tsv ; return 0 ; }
txgbe_get_thermal_sensor_data - Gathers thermal sensor data
  @hw: pointer to hardware structure
txgbe_get_thermal_sensor_data - Gathers thermal sensor data @hw : pointer to hardware structure
/* Only support thermal sensors attached to physical port 0 */