/* reset the XGXS (between serdes and IBC). Slightly less intrusive than resetting the IBC or external link state, and useful in some cases to cause some retraining. To do this right, we reset IBC as well.  */
static void ipath_ht_xgxs_reset(struct ipath_devdata *dd)
/* reset the XGXS (between serdes and IBC). Slightly less intrusive than resetting the IBC or external link state, and useful in some cases to cause some retraining. To do this right, we reset IBC as well.  */
static void ipath_ht_xgxs_reset(struct ipath_devdata *dd)
{
	u64 val, prev_val;
	prev_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_xgxsconfig);
	val = prev_val | INFINIPATH_XGXS_RESET;
	prev_val &= ~INFINIPATH_XGXS_RESET;
	ipath_write_kreg(dd, dd->ipath_kregs->kr_control,
			 dd->ipath_control & ~INFINIPATH_C_LINKENABLE);
	ipath_write_kreg(dd, dd->ipath_kregs->kr_xgxsconfig, val);
	ipath_read_kreg32(dd, dd->ipath_kregs->kr_scratch);
	ipath_write_kreg(dd, dd->ipath_kregs->kr_xgxsconfig, prev_val);
	ipath_write_kreg(dd, dd->ipath_kregs->kr_control,
			 dd->ipath_control);
}