Lines Matching refs:dch
355 struct dchannel *dch; in l1oip_socket_recv() local
375 dch = hc->chan[channel].dch; in l1oip_socket_recv()
377 if (!dch && !bch) { in l1oip_socket_recv()
401 if (dch && len >= 2) { in l1oip_socket_recv()
402 dch->rx_skb = nskb; in l1oip_socket_recv()
403 recv_Dchannel(dch); in l1oip_socket_recv()
452 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_parse() local
585 if (!test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_parse()
589 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_parse()
590 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_parse()
754 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_close() local
766 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_close()
770 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_close()
771 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_close()
832 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_timeout() local
841 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_timeout()
845 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_timeout()
846 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_timeout()
867 struct dchannel *dch = container_of(dev, struct dchannel, dev); in handle_dmsg() local
868 struct l1oip *hc = dch->hw; in handle_dmsg()
895 l1oip_socket_send(hc, 0, dch->slot, 0, in handle_dmsg()
896 hc->chan[dch->slot].tx_counter++, p, ll); in handle_dmsg()
906 , __func__, dch->slot, hc->b_num + 1); in handle_dmsg()
908 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
916 "(1..%d)\n", __func__, dch->slot, in handle_dmsg()
919 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
931 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) in channel_dctrl() argument
934 struct l1oip *hc = dch->hw; in channel_dctrl()
976 open_dchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_dchannel() argument
980 dch->dev.id, __builtin_return_address(0)); in open_dchannel()
983 if ((dch->dev.D.protocol != ISDN_P_NONE) && in open_dchannel()
984 (dch->dev.D.protocol != rq->protocol)) { in open_dchannel()
987 __func__, dch->dev.D.protocol, rq->protocol); in open_dchannel()
989 if (dch->dev.D.protocol != rq->protocol) in open_dchannel()
990 dch->dev.D.protocol = rq->protocol; in open_dchannel()
992 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in open_dchannel()
993 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, in open_dchannel()
996 rq->ch = &dch->dev.D; in open_dchannel()
1003 open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_bchannel() argument
1008 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) in open_bchannel()
1032 struct dchannel *dch = container_of(dev, struct dchannel, dev); in l1oip_dctrl() local
1033 struct l1oip *hc = dch->hw; in l1oip_dctrl()
1037 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1050 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1058 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1061 err = open_bchannel(hc, dch, rq); in l1oip_dctrl()
1067 __func__, dch->dev.id, in l1oip_dctrl()
1072 err = channel_dctrl(dch, arg); in l1oip_dctrl()
1075 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1246 if (hc->registered && hc->chan[hc->d_idx].dch) in release_card()
1247 mISDN_unregister_device(&hc->chan[hc->d_idx].dch->dev); in release_card()
1249 if (hc->chan[ch].dch) { in release_card()
1250 mISDN_freedchannel(hc->chan[ch].dch); in release_card()
1251 kfree(hc->chan[ch].dch); in release_card()
1287 struct dchannel *dch; in init_card() local
1371 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); in init_card()
1372 if (!dch) in init_card()
1374 dch->debug = debug; in init_card()
1375 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, NULL); in init_card()
1376 dch->hw = hc; in init_card()
1378 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1); in init_card()
1380 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0); in init_card()
1381 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in init_card()
1383 dch->dev.D.send = handle_dmsg; in init_card()
1384 dch->dev.D.ctrl = l1oip_dctrl; in init_card()
1385 dch->dev.nrbchan = hc->b_num; in init_card()
1386 dch->slot = hc->d_idx; in init_card()
1387 hc->chan[hc->d_idx].dch = dch; in init_card()
1389 for (ch = 0; ch < dch->dev.nrbchan; ch++) { in init_card()
1406 list_add(&bch->ch.list, &dch->dev.bchannels); in init_card()
1408 set_channelmap(bch->nr, dch->dev.channelmap); in init_card()
1411 ret = mISDN_register_device(&dch->dev, NULL, hc->name); in init_card()