/* If the driver fails to keep up and empty the queue, then the hardware wil run out of room to put incoming packets. This will cause the hardware to skip descrs that are full (instead of halting/retrying). Thus, once the driver runs, it wil need to "catch up" to where the hardware chain pointer is at.  */
static void spider_net_resync_head_ptr(struct spider_net_card *card)
/* If the driver fails to keep up and empty the queue, then the hardware wil run out of room to put incoming packets. This will cause the hardware to skip descrs that are full (instead of halting/retrying). Thus, once the driver runs, it wil need to "catch up" to where the hardware chain pointer is at.  */
static void spider_net_resync_head_ptr(struct spider_net_card *card)
{
	unsigned long flags;
	struct spider_net_descr_chain *chain = &card->rx_chain;
	struct spider_net_descr *descr;
	int i, status;
	descr = chain->head;
	status = spider_net_get_descr_status(descr->hwdescr);
	if (status == SPIDER_NET_DESCR_NOT_IN_USE)
		return;
	spin_lock_irqsave(&chain->lock, flags);
	descr = chain->head;
	status = spider_net_get_descr_status(descr->hwdescr);
	for (i=0; i<chain->num_desc; i++) {
		if (status != SPIDER_NET_DESCR_CARDOWNED) break;
		descr = descr->next;
		status = spider_net_get_descr_status(descr->hwdescr);
	}
	chain->head = descr;
	spin_unlock_irqrestore(&chain->lock, flags);
}