• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/isdn/gigaset/

Lines Matching defs:bcs

154 		if (test_timeout(&cs->bcs[channel].at_state))
175 int gigaset_get_channel(struct bc_state *bcs)
179 spin_lock_irqsave(&bcs->cs->lock, flags);
180 if (bcs->use_count) {
182 bcs->channel);
183 spin_unlock_irqrestore(&bcs->cs->lock, flags);
186 ++bcs->use_count;
187 bcs->busy = 1;
188 gig_dbg(DEBUG_ANY, "allocated channel %d", bcs->channel);
189 spin_unlock_irqrestore(&bcs->cs->lock, flags);
193 void gigaset_free_channel(struct bc_state *bcs)
197 spin_lock_irqsave(&bcs->cs->lock, flags);
198 if (!bcs->busy) {
199 gig_dbg(DEBUG_ANY, "could not free channel %d", bcs->channel);
200 spin_unlock_irqrestore(&bcs->cs->lock, flags);
203 --bcs->use_count;
204 bcs->busy = 0;
205 gig_dbg(DEBUG_ANY, "freed channel %d", bcs->channel);
206 spin_unlock_irqrestore(&bcs->cs->lock, flags);
216 if (cs->bcs[i].use_count) {
222 ++cs->bcs[i].use_count;
238 --cs->bcs[i].use_count;
250 ++cs->bcs[i].use_count;
333 static void gigaset_freebcs(struct bc_state *bcs)
337 gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel);
338 if (!bcs->cs->ops->freebcshw(bcs)) {
342 gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel);
343 clear_at_state(&bcs->at_state);
344 gig_dbg(DEBUG_INIT, "freeing bcs[%d]->skb", bcs->channel);
346 if (bcs->skb)
347 dev_kfree_skb(bcs->skb);
349 kfree(bcs->commands[i]);
350 bcs->commands[i] = NULL;
413 if (!cs->bcs)
453 gig_dbg(DEBUG_INIT, "clearing bcs[%d]", i);
454 gigaset_freebcs(cs->bcs + i);
461 f_bcs: gig_dbg(DEBUG_INIT, "freeing bcs[]");
462 kfree(cs->bcs);
469 void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
489 at_state->bcs = bcs;
498 static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct bc_state *bcs,
505 inbuf->bcs = bcs; /*base driver: NULL*/
552 static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
557 bcs->tx_skb = NULL;
559 skb_queue_head_init(&bcs->squeue);
561 bcs->corrupted = 0;
562 bcs->trans_down = 0;
563 bcs->trans_up = 0;
565 gig_dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel);
566 gigaset_at_init(&bcs->at_state, bcs, cs, -1);
568 bcs->rcvbytes = 0;
571 bcs->emptycount = 0;
574 gig_dbg(DEBUG_INIT, "allocating bcs[%d]->skb", channel);
575 bcs->fcs = PPP_INITFCS;
576 bcs->inputstate = 0;
578 bcs->inputstate |= INS_skip_frame;
579 bcs->skb = NULL;
580 } else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
581 skb_reserve(bcs->skb, HW_HDR_LEN);
584 bcs->inputstate |= INS_skip_frame;
587 bcs->channel = channel;
588 bcs->cs = cs;
590 bcs->chstate = 0;
591 bcs->use_count = 1;
592 bcs->busy = 0;
593 bcs->ignore = cs->ignoreframes;
596 bcs->commands[i] = NULL;
598 gig_dbg(DEBUG_INIT, " setting up bcs[%d]->hw", channel);
599 if (cs->ops->initbcshw(bcs))
600 return bcs;
604 gig_dbg(DEBUG_INIT, " freeing bcs[%d]->skb", channel);
605 if (bcs->skb)
606 dev_kfree_skb(bcs->skb);
642 gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1);
643 cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL);
644 if (!cs->bcs) {
691 gig_dbg(DEBUG_INIT, "setting up bcs[%d].read", i);
692 if (!gigaset_initbcs(cs->bcs + i, cs, i)) {
708 gigaset_inbuf_init(cs->inbuf, cs->bcs, cs, INS_command);
761 void gigaset_bcs_reinit(struct bc_state *bcs)
764 struct cardstate *cs = bcs->cs;
767 while ((skb = skb_dequeue(&bcs->squeue)) != NULL)
771 clear_at_state(&bcs->at_state);
772 bcs->at_state.ConState = 0;
773 bcs->at_state.timer_active = 0;
774 bcs->at_state.timer_expires = 0;
775 bcs->at_state.cid = -1; /* No CID defined */
778 bcs->inputstate = 0;
781 bcs->emptycount = 0;
784 bcs->fcs = PPP_INITFCS;
785 bcs->chstate = 0;
787 bcs->ignore = cs->ignoreframes;
788 if (bcs->ignore)
789 bcs->inputstate |= INS_skip_frame;
792 cs->ops->reinitbcshw(bcs);
835 gigaset_freebcs(cs->bcs + i);
836 if (!gigaset_initbcs(cs->bcs + i, cs, i))