static void controllercb_appl_released(struct capi_ctr * card, __u16 appl) { struct capi_ncci **pp, **nextpp; for (pp = &APPL(appl)->nccilist; *pp; pp = nextpp) { if (NCCI2CTRL((*pp)->ncci) == card->cnr) { struct capi_ncci *np = *pp; *pp = np->next; printk(KERN_INFO "kcapi: appl %d ncci 0x%x down!\n", appl, np->ncci); kfree(np); APPL(appl)->nncci--; nextpp = pp; } else { nextpp = &(*pp)->next; } } if (APPL(appl)->releasing) { /* only release if the application was marked for release */ printk(KERN_DEBUG "kcapi: appl %d releasing(%d)\n", appl, APPL(appl)->releasing); APPL(appl)->releasing--; if (APPL(appl)->releasing <= 0) { APPL(appl)->signal = 0; APPL_MARK_FREE(appl); printk(KERN_INFO "kcapi: appl %d down\n", appl); } } else printk(KERN_WARNING "kcapi: appl %d card%d released without request\n", appl, card->cnr); }
static __u16 capi_release(__u16 applid) { struct sk_buff *skb; int i; if (ncards == 0) return CAPI_REGNOTINSTALLED; if (!VALID_APPLID(applid) || APPL(applid)->releasing) return CAPI_ILLAPPNR; while ((skb = skb_dequeue(&APPL(applid)->recv_queue)) != 0) kfree_skb(skb); for (i = 0; i < CAPI_MAXCONTR; i++) { if (cards[i].cardstate != CARD_RUNNING) { continue; } APPL(applid)->releasing++; B1_send_release(cards[i].port, applid); } if (APPL(applid)->releasing == 0) { APPL(applid)->signal = 0; APPL_MARK_FREE(applid); printk(KERN_INFO "b1capi: appl %d down\n", applid); } return CAPI_NOERROR; }
void avmb1_handle_free_ncci(avmb1_card * card, __u16 appl, __u32 ncci) { if (!VALID_APPLID(appl)) { printk(KERN_ERR "avmb1_handle_free_ncci: illegal appl %d\n", appl); return; } if (ncci != 0xffffffff) { avmb1_ncci **pp; for (pp = &APPL(appl)->nccilist; *pp; pp = &(*pp)->next) { if ((*pp)->ncci == ncci) { avmb1_ncci *np = *pp; *pp = np->next; kfree(np); printk(KERN_INFO "b1capi: appl %d ncci 0x%x down\n", appl, ncci); return; } } printk(KERN_ERR "avmb1_handle_free_ncci: ncci 0x%x not found\n", ncci); } else { avmb1_ncci **pp, **nextpp; for (pp = &APPL(appl)->nccilist; *pp; pp = nextpp) { if (NCCI2CTRL((*pp)->ncci) == card->cnr) { avmb1_ncci *np = *pp; *pp = np->next; printk(KERN_INFO "b1capi: appl %d ncci 0x%x down!\n", appl, np->ncci); kfree(np); nextpp = pp; } else { nextpp = &(*pp)->next; } } APPL(appl)->releasing--; if (APPL(appl)->releasing == 0) { APPL(appl)->signal = 0; APPL_MARK_FREE(appl); printk(KERN_INFO "b1capi: appl %d down\n", appl); } } }
static __u16 capi_release(__u16 applid) { int i; if (!VALID_APPLID(applid) || APPL(applid)->releasing) return CAPI_ILLAPPNR; APPL(applid)->releasing++; skb_queue_purge(&APPL(applid)->recv_queue); for (i = 0; i < CAPI_MAXCONTR; i++) { if (cards[i].cardstate != CARD_RUNNING) continue; APPL(applid)->releasing++; cards[i].driver->release_appl(&cards[i], applid); } APPL(applid)->releasing--; if (APPL(applid)->releasing <= 0) { APPL(applid)->signal = 0; APPL_MARK_FREE(applid); printk(KERN_INFO "kcapi: appl %d down\n", applid); } return CAPI_NOERROR; }
static void controllercb_appl_released(struct capi_ctr * card, __u16 appl) { struct capi_ncci **pp, **nextpp; for (pp = &APPL(appl)->nccilist; *pp; pp = nextpp) { if (NCCI2CTRL((*pp)->ncci) == card->cnr) { struct capi_ncci *np = *pp; *pp = np->next; printk(KERN_INFO "kcapi: appl %d ncci 0x%x down!\n", appl, np->ncci); kfree(np); APPL(appl)->nncci--; nextpp = pp; } else { nextpp = &(*pp)->next; } } APPL(appl)->releasing--; if (APPL(appl)->releasing <= 0) { APPL(appl)->signal = 0; APPL_MARK_FREE(appl); printk(KERN_INFO "kcapi: appl %d down\n", appl); } }