/* Finds out the remanining packets to be sent */
static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len, unsigned int total_packet_count, int maxpacketsize, unsigned int num_trbs_left)
/* Finds out the remanining packets to be sent */
static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len, unsigned int total_packet_count, int maxpacketsize, unsigned int num_trbs_left)
{
	int packets_transferred;
	if (num_trbs_left == 0 || (running_total == 0 && trb_buff_len == 0))
		return 0;
	packets_transferred = (running_total + trb_buff_len) / maxpacketsize;
	if ((total_packet_count - packets_transferred) > 31)
		return 31 << 17;
	return (total_packet_count - packets_transferred) << 17;
}