static void closecard(int cardnr) { struct IsdnCardState *csta = cards[cardnr].cs; if (csta->bcs->BC_Close != NULL) { csta->bcs->BC_Close(csta->bcs + 1); csta->bcs->BC_Close(csta->bcs); } discard_queue(&csta->rq); discard_queue(&csta->sq); if (csta->rcvbuf) { kfree(csta->rcvbuf); csta->rcvbuf = NULL; } if (csta->tx_skb) { dev_kfree_skb(csta->tx_skb); csta->tx_skb = NULL; } if (csta->DC_Close != NULL) { csta->DC_Close(csta); } csta->cardmsg(csta, CARD_RELEASE, NULL); if (csta->dbusytimer.function != NULL) del_timer(&csta->dbusytimer); ll_unload(csta); }
void close_2bs0(struct BCState *bcs) { mode_2bs0(bcs, 0, bcs->channel); if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb, FREE_WRITE); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } } }
static void lc_release_ind(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; FsmChangeState(fi, ST_L3_LC_REL); discard_queue(&st->l3.squeue); st->l3.l3l4(st, DL_RELEASE | INDICATION, NULL); }
static void lc_release_cnf(struct FsmInst *fi, int event, void *arg) { layer3_t *l3 = fi->userdata; mISDN_FsmChangeState(fi, ST_L3_LC_REL); discard_queue(&l3->squeue); l3ml3p(l3, DL_RELEASE | CONFIRM); }
static void lc_release_cnf(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; FsmChangeState(fi, ST_L3_LC_REL); discard_queue(&st->l3.squeue); l3ml3p(st, DL_RELEASE | CONFIRM); }
static void lc_release_ind(struct FsmInst *fi, int event, void *arg) { layer3_t *l3 = fi->userdata; mISDN_FsmDelTimer(&l3->l3m_timer, 52); mISDN_FsmChangeState(fi, ST_L3_LC_REL); discard_queue(&l3->squeue); l3ml3p(l3, DL_RELEASE | INDICATION); }
static void lc_release_ind(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; FsmDelTimer(&st->l3.l3m_timer, 52); FsmChangeState(fi, ST_L3_LC_REL); discard_queue(&st->l3.squeue); l3ml3p(st, DL_RELEASE | INDICATION); }
void releasestack_isdnl3(struct PStack *st) { while (st->l3.proc) release_l3_process(st->l3.proc); if (st->l3.global) { StopAllL3Timer(st->l3.global); kfree(st->l3.global); st->l3.global = NULL; } discard_queue(&st->l3.squeue); }
void close_jadestate(struct BCState *bcs) { modejade(bcs, 0, bcs->channel); if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { if (bcs->hw.hscx.rcvbuf) { kfree(bcs->hw.hscx.rcvbuf); bcs->hw.hscx.rcvbuf = NULL; } if (bcs->blog) { kfree(bcs->blog); bcs->blog = NULL; } discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } } }
void release_l3(layer3_t *l3) { l3_process_t *p, *np; if (l3->l3m.debug) printk(KERN_DEBUG "release_l3(%p) plist(%s) global(%p) dummy(%p)\n", l3, list_empty(&l3->plist) ? "no" : "yes", l3->global, l3->dummy); list_for_each_entry_safe(p, np, &l3->plist, list) release_l3_process(p); if (l3->global) { StopAllL3Timer(l3->global); kfree(l3->global); l3->global = NULL; } if (l3->dummy) { StopAllL3Timer(l3->dummy); kfree(l3->dummy); l3->dummy = NULL; } mISDN_FsmDelTimer(&l3->l3m_timer, 54); discard_queue(&l3->squeue); }
static void W6692_l1hw(struct PStack *st, int pr, void *arg) { struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware; struct sk_buff *skb = arg; int val; switch (pr) { case (PH_DATA | REQUEST): if (cs->debug & DEB_DLOG_HEX) LogFrame(cs, skb->data, skb->len); if (cs->debug & DEB_DLOG_VERBOSE) dlogframe(cs, skb, 0); if (cs->tx_skb) { skb_queue_tail(&cs->sq, skb); #ifdef L2FRAME_DEBUG /* psa */ if (cs->debug & L1_DEB_LAPD) Logl2Frame(cs, skb, "PH_DATA Queued", 0); #endif } else { cs->tx_skb = skb; cs->tx_cnt = 0; #ifdef L2FRAME_DEBUG /* psa */ if (cs->debug & L1_DEB_LAPD) Logl2Frame(cs, skb, "PH_DATA", 0); #endif W6692_fill_fifo(cs); } break; case (PH_PULL | INDICATION): if (cs->tx_skb) { if (cs->debug & L1_DEB_WARN) debugl1(cs, " l2l1 tx_skb exist this shouldn't happen"); skb_queue_tail(&cs->sq, skb); break; } if (cs->debug & DEB_DLOG_HEX) LogFrame(cs, skb->data, skb->len); if (cs->debug & DEB_DLOG_VERBOSE) dlogframe(cs, skb, 0); cs->tx_skb = skb; cs->tx_cnt = 0; #ifdef L2FRAME_DEBUG /* psa */ if (cs->debug & L1_DEB_LAPD) Logl2Frame(cs, skb, "PH_DATA_PULLED", 0); #endif W6692_fill_fifo(cs); break; case (PH_PULL | REQUEST): #ifdef L2FRAME_DEBUG /* psa */ if (cs->debug & L1_DEB_LAPD) debugl1(cs, "-> PH_REQUEST_PULL"); #endif if (!cs->tx_skb) { test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags); st->l1.l1l2(st, PH_PULL | CONFIRM, NULL); } else test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags); break; case (HW_RESET | REQUEST): if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) ph_command(cs, W_L1CMD_ECK); else { ph_command(cs, W_L1CMD_RST); cs->dc.w6692.ph_state = W_L1CMD_RST; W6692_new_ph(cs); } break; case (HW_ENABLE | REQUEST): ph_command(cs, W_L1CMD_ECK); break; case (HW_INFO3 | REQUEST): ph_command(cs, W_L1CMD_AR8); break; case (HW_TESTLOOP | REQUEST): val = 0; if (1 & (long) arg) val |= 0x0c; if (2 & (long) arg) val |= 0x3; /* !!! not implemented yet */ break; case (HW_DEACTIVATE | RESPONSE): discard_queue(&cs->rq); discard_queue(&cs->sq); if (cs->tx_skb) { dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; } if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) del_timer(&cs->dbusytimer); if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) W6692_sched_event(cs, D_CLEARBUSY); break; default: if (cs->debug & L1_DEB_WARN) debugl1(cs, "W6692_l1hw unknown %04x", pr); break; } }