Lines Matching refs:dch
356 struct dchannel *dch; in l1oip_socket_recv() local
376 dch = hc->chan[channel].dch; in l1oip_socket_recv()
378 if (!dch && !bch) { in l1oip_socket_recv()
402 if (dch && len >= 2) { in l1oip_socket_recv()
403 dch->rx_skb = nskb; in l1oip_socket_recv()
404 recv_Dchannel(dch); in l1oip_socket_recv()
453 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_parse() local
586 if (!test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_parse()
590 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_parse()
591 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_parse()
757 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_close() local
769 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_close()
773 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_close()
774 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_close()
835 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_timeout() local
844 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_timeout()
848 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_timeout()
849 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_timeout()
870 struct dchannel *dch = container_of(dev, struct dchannel, dev); in handle_dmsg() local
871 struct l1oip *hc = dch->hw; in handle_dmsg()
898 l1oip_socket_send(hc, 0, dch->slot, 0, in handle_dmsg()
899 hc->chan[dch->slot].tx_counter++, p, ll); in handle_dmsg()
909 , __func__, dch->slot, hc->b_num + 1); in handle_dmsg()
911 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
919 "(1..%d)\n", __func__, dch->slot, in handle_dmsg()
922 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
934 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) in channel_dctrl() argument
937 struct l1oip *hc = dch->hw; in channel_dctrl()
979 open_dchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_dchannel() argument
983 dch->dev.id, __builtin_return_address(0)); in open_dchannel()
986 if ((dch->dev.D.protocol != ISDN_P_NONE) && in open_dchannel()
987 (dch->dev.D.protocol != rq->protocol)) { in open_dchannel()
990 __func__, dch->dev.D.protocol, rq->protocol); in open_dchannel()
992 if (dch->dev.D.protocol != rq->protocol) in open_dchannel()
993 dch->dev.D.protocol = rq->protocol; in open_dchannel()
995 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in open_dchannel()
996 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, in open_dchannel()
999 rq->ch = &dch->dev.D; in open_dchannel()
1006 open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_bchannel() argument
1011 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) in open_bchannel()
1035 struct dchannel *dch = container_of(dev, struct dchannel, dev); in l1oip_dctrl() local
1036 struct l1oip *hc = dch->hw; in l1oip_dctrl()
1040 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1053 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1061 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1064 err = open_bchannel(hc, dch, rq); in l1oip_dctrl()
1070 __func__, dch->dev.id, in l1oip_dctrl()
1075 err = channel_dctrl(dch, arg); in l1oip_dctrl()
1078 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1248 if (hc->registered && hc->chan[hc->d_idx].dch) in release_card()
1249 mISDN_unregister_device(&hc->chan[hc->d_idx].dch->dev); in release_card()
1251 if (hc->chan[ch].dch) { in release_card()
1252 mISDN_freedchannel(hc->chan[ch].dch); in release_card()
1253 kfree(hc->chan[ch].dch); in release_card()
1289 struct dchannel *dch; in init_card() local
1373 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); in init_card()
1374 if (!dch) in init_card()
1376 dch->debug = debug; in init_card()
1377 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, NULL); in init_card()
1378 dch->hw = hc; in init_card()
1380 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1); in init_card()
1382 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0); in init_card()
1383 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in init_card()
1385 dch->dev.D.send = handle_dmsg; in init_card()
1386 dch->dev.D.ctrl = l1oip_dctrl; in init_card()
1387 dch->dev.nrbchan = hc->b_num; in init_card()
1388 dch->slot = hc->d_idx; in init_card()
1389 hc->chan[hc->d_idx].dch = dch; in init_card()
1391 for (ch = 0; ch < dch->dev.nrbchan; ch++) { in init_card()
1408 list_add(&bch->ch.list, &dch->dev.bchannels); in init_card()
1410 set_channelmap(bch->nr, dch->dev.channelmap); in init_card()
1413 ret = mISDN_register_device(&dch->dev, NULL, hc->name); in init_card()