ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf, uint8_t sensor,
					uint8_t target, uint8_t lun, uint8_t channel)
{
	struct ipmi_rq req;
	uint8_t rqdata[2];
	struct ipmi_rs *rsp;
	uint8_t  bridged_request = 0;
	uint32_t save_addr;
	uint32_t save_channel;

	if ( BRIDGE_TO_SENSOR(intf, target, channel) ) {
		bridged_request = 1;
		save_addr = intf->target_addr;
		intf->target_addr = target;
		save_channel = intf->target_channel;
		intf->target_channel = channel;
	}

	rqdata[0] = sensor;
	rqdata[1] = 0xff;	/* reserved */

	memset(&req, 0, sizeof (req));
	req.msg.netfn = IPMI_NETFN_SE;
	req.msg.lun = lun;
	req.msg.cmd = GET_SENSOR_HYSTERESIS;
	req.msg.data = rqdata;
	req.msg.data_len = 2;

	rsp = intf->sendrecv(intf, &req);
	if (bridged_request) {
		intf->target_addr = save_addr;
		intf->target_channel = save_channel;
	}
	return rsp;
}
ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf, uint8_t sensor,
					uint8_t target, uint8_t lun, uint8_t channel)
{
	struct ipmi_rq req;
	uint8_t rqdata[2];
	struct ipmi_rs *rsp;
	uint8_t  bridged_request = 0;
	uint32_t save_addr;
	uint32_t save_channel;

	if ( BRIDGE_TO_SENSOR(intf, target, channel) ) {
		bridged_request = 1;
		save_addr = intf->target_addr;
		intf->target_addr = target;
		save_channel = intf->target_channel;
		intf->target_channel = channel;
	}

	rqdata[0] = sensor;
	rqdata[1] = 0xff;	 

	memset(&req, 0, sizeof (req));
	req.msg.netfn = IPMI_NETFN_SE;
	req.msg.lun = lun;
	req.msg.cmd = GET_SENSOR_HYSTERESIS;
	req.msg.data = rqdata;
	req.msg.data_len = 2;

	rsp = intf->sendrecv(intf, &req);
	if (bridged_request) {
		intf->target_addr = save_addr;
		intf->target_channel = save_channel;
	}
	return rsp;
}