Lines Matching refs:dch
367 struct dchannel *dch; in l1oip_socket_recv() local
387 dch = hc->chan[channel].dch; in l1oip_socket_recv()
389 if (!dch && !bch) { in l1oip_socket_recv()
413 if (dch && len >= 2) { in l1oip_socket_recv()
414 dch->rx_skb = nskb; in l1oip_socket_recv()
415 recv_Dchannel(dch); in l1oip_socket_recv()
470 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_parse() local
603 if (!test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_parse()
607 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_parse()
608 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_parse()
777 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_close() local
789 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_close()
793 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_close()
794 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_close()
854 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_timeout() local
863 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_timeout()
867 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_timeout()
868 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_timeout()
889 struct dchannel *dch = container_of(dev, struct dchannel, dev); in handle_dmsg() local
890 struct l1oip *hc = dch->hw; in handle_dmsg()
913 l1oip_socket_send(hc, 0, dch->slot, 0, in handle_dmsg()
914 hc->chan[dch->slot].tx_counter++, p, ll); in handle_dmsg()
924 , __func__, dch->slot, hc->b_num + 1); in handle_dmsg()
926 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
934 "(1..%d)\n", __func__, dch->slot, in handle_dmsg()
937 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
949 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) in channel_dctrl() argument
952 struct l1oip *hc = dch->hw; in channel_dctrl()
994 open_dchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_dchannel() argument
998 dch->dev.id, __builtin_return_address(0)); in open_dchannel()
1001 if ((dch->dev.D.protocol != ISDN_P_NONE) && in open_dchannel()
1002 (dch->dev.D.protocol != rq->protocol)) { in open_dchannel()
1005 __func__, dch->dev.D.protocol, rq->protocol); in open_dchannel()
1007 if (dch->dev.D.protocol != rq->protocol) in open_dchannel()
1008 dch->dev.D.protocol = rq->protocol; in open_dchannel()
1010 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in open_dchannel()
1011 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, in open_dchannel()
1014 rq->ch = &dch->dev.D; in open_dchannel()
1021 open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_bchannel() argument
1026 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) in open_bchannel()
1050 struct dchannel *dch = container_of(dev, struct dchannel, dev); in l1oip_dctrl() local
1051 struct l1oip *hc = dch->hw; in l1oip_dctrl()
1055 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1068 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1076 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1079 err = open_bchannel(hc, dch, rq); in l1oip_dctrl()
1085 __func__, dch->dev.id, in l1oip_dctrl()
1090 err = channel_dctrl(dch, arg); in l1oip_dctrl()
1093 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1260 if (hc->registered && hc->chan[hc->d_idx].dch) in release_card()
1261 mISDN_unregister_device(&hc->chan[hc->d_idx].dch->dev); in release_card()
1263 if (hc->chan[ch].dch) { in release_card()
1264 mISDN_freedchannel(hc->chan[ch].dch); in release_card()
1265 kfree(hc->chan[ch].dch); in release_card()
1302 struct dchannel *dch; in init_card() local
1386 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); in init_card()
1387 if (!dch) in init_card()
1389 dch->debug = debug; in init_card()
1390 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, NULL); in init_card()
1391 dch->hw = hc; in init_card()
1393 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1); in init_card()
1395 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0); in init_card()
1396 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in init_card()
1398 dch->dev.D.send = handle_dmsg; in init_card()
1399 dch->dev.D.ctrl = l1oip_dctrl; in init_card()
1400 dch->dev.nrbchan = hc->b_num; in init_card()
1401 dch->slot = hc->d_idx; in init_card()
1402 hc->chan[hc->d_idx].dch = dch; in init_card()
1404 for (ch = 0; ch < dch->dev.nrbchan; ch++) { in init_card()
1421 list_add(&bch->ch.list, &dch->dev.bchannels); in init_card()
1423 set_channelmap(bch->nr, dch->dev.channelmap); in init_card()
1426 ret = mISDN_register_device(&dch->dev, NULL, hc->name); in init_card()