/* <status> is (td_status(td) & 0xF60000), a.k.a. uhci_status_bits(td_status(td)). Note: <status> does not include the TD_CTRL_NAK bit. <dir_out> is True for output TDs and False for input TDs.  */
static int uhci_map_status(int status, int dir_out)
/* <status> is (td_status(td) & 0xF60000), a.k.a. uhci_status_bits(td_status(td)). Note: <status> does not include the TD_CTRL_NAK bit. <dir_out> is True for output TDs and False for input TDs.  */
static int uhci_map_status(int status, int dir_out)
{
	if (!status)
		return 0;
	if (status & TD_CTRL_BITSTUFF)
		return -EPROTO;
	if (status & TD_CTRL_CRCTIMEO) {
		if (dir_out)
			return -EPROTO;
		else
			return -EILSEQ;
	}
	if (status & TD_CTRL_BABBLE)
		return -EOVERFLOW;
	if (status & TD_CTRL_DBUFERR)
		return -ENOSR;
	if (status & TD_CTRL_STALLED)
		return -EPIPE;
	return 0;
}