/* Insert a reordering mpdu into sorted linked list by sequence no.  */
BOOLEAN ba_reordering_mpdu_insertsorted(struct reordering_list *list, struct reordering_mpdu *mpdu)
/* Insert a reordering mpdu into sorted linked list by sequence no.  */
BOOLEAN ba_reordering_mpdu_insertsorted(struct reordering_list *list, struct reordering_mpdu *mpdu)
{
	struct reordering_mpdu **ppScan = &list->next;
	while (*ppScan != NULL) {
		if (SEQ_SMALLER((*ppScan)->Sequence, mpdu->Sequence, MAXSEQ)) {
			ppScan = &(*ppScan)->next;
		} else if ((*ppScan)->Sequence == mpdu->Sequence) {
			return (FALSE);
		} else {
			break;
		}
	}
	mpdu->next = *ppScan;
	*ppScan = mpdu;
	list->qlen++;
	return TRUE;
}