static void setva(struct PStack *st, unsigned int nr) { struct Layer2 *l2 = &st->l2; int len; u_long flags; spin_lock_irqsave(&l2->lock, flags); while (l2->va != nr) { (l2->va)++; if(test_bit(FLG_MOD128, &l2->flag)) l2->va %= 128; else l2->va %= 8; len = l2->windowar[l2->sow]->len; if (PACKET_NOACK == l2->windowar[l2->sow]->pkt_type) len = -1; dev_kfree_skb(l2->windowar[l2->sow]); l2->windowar[l2->sow] = NULL; l2->sow = (l2->sow + 1) % l2->window; spin_unlock_irqrestore(&l2->lock, flags); if (test_bit(FLG_LLI_L2WAKEUP, &st->lli.flag) && (len >=0)) lli_writewakeup(st, len); spin_lock_irqsave(&l2->lock, flags); } spin_unlock_irqrestore(&l2->lock, flags); }
static void BChannel_proc_ack(struct BCState *bcs) { u_long flags; int ack; spin_lock_irqsave(&bcs->aclock, flags); ack = bcs->ackcnt; bcs->ackcnt = 0; spin_unlock_irqrestore(&bcs->aclock, flags); if (ack) lli_writewakeup(bcs->st, ack); }