/* Call after a packet has been received (interrupt context is OK).  */
void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, u16 total_len, u16 cycle, u8 channel, u8 tag, u8 sy)
/* Call after a packet has been received (interrupt context is OK).  */
void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, u16 total_len, u16 cycle, u8 channel, u8 tag, u8 sy)
{
	unsigned long flags;
	spin_lock_irqsave(&iso->lock, flags);
	if (iso->n_ready_packets == iso->buf_packets) {
		atomic_inc(&iso->overflows);
		iso->bytes_discarded += total_len;
	} else {
		struct hpsb_iso_packet_info *info = &iso->infos[iso->pkt_dma];
		info->offset = offset;
		info->len = len;
		info->total_len = total_len;
		info->cycle = cycle;
		info->channel = channel;
		info->tag = tag;
		info->sy = sy;
		iso->pkt_dma = (iso->pkt_dma + 1) % iso->buf_packets;
		iso->n_ready_packets++;
	}
	spin_unlock_irqrestore(&iso->lock, flags);
}