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()
756 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_socket_close() local
768 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_socket_close()
772 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_socket_close()
773 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_socket_close()
834 struct dchannel *dch = hc->chan[hc->d_idx].dch; in l1oip_timeout() local
843 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in l1oip_timeout()
847 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in l1oip_timeout()
848 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, MISDN_ID_ANY, 0, in l1oip_timeout()
869 struct dchannel *dch = container_of(dev, struct dchannel, dev); in handle_dmsg() local
870 struct l1oip *hc = dch->hw; in handle_dmsg()
897 l1oip_socket_send(hc, 0, dch->slot, 0, in handle_dmsg()
898 hc->chan[dch->slot].tx_counter++, p, ll); in handle_dmsg()
908 , __func__, dch->slot, hc->b_num + 1); in handle_dmsg()
910 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
918 "(1..%d)\n", __func__, dch->slot, in handle_dmsg()
921 if (test_bit(FLG_ACTIVE, &dch->Flags)) in handle_dmsg()
933 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) in channel_dctrl() argument
936 struct l1oip *hc = dch->hw; in channel_dctrl()
978 open_dchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_dchannel() argument
982 dch->dev.id, __builtin_return_address(0)); in open_dchannel()
985 if ((dch->dev.D.protocol != ISDN_P_NONE) && in open_dchannel()
986 (dch->dev.D.protocol != rq->protocol)) { in open_dchannel()
989 __func__, dch->dev.D.protocol, rq->protocol); in open_dchannel()
991 if (dch->dev.D.protocol != rq->protocol) in open_dchannel()
992 dch->dev.D.protocol = rq->protocol; in open_dchannel()
994 if (test_bit(FLG_ACTIVE, &dch->Flags)) { in open_dchannel()
995 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, in open_dchannel()
998 rq->ch = &dch->dev.D; in open_dchannel()
1005 open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) in open_bchannel() argument
1010 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) in open_bchannel()
1034 struct dchannel *dch = container_of(dev, struct dchannel, dev); in l1oip_dctrl() local
1035 struct l1oip *hc = dch->hw; in l1oip_dctrl()
1039 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1052 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1060 err = open_dchannel(hc, dch, rq); in l1oip_dctrl()
1063 err = open_bchannel(hc, dch, rq); in l1oip_dctrl()
1069 __func__, dch->dev.id, in l1oip_dctrl()
1074 err = channel_dctrl(dch, arg); in l1oip_dctrl()
1077 if (dch->debug & DEBUG_HW) in l1oip_dctrl()
1247 if (hc->registered && hc->chan[hc->d_idx].dch) in release_card()
1248 mISDN_unregister_device(&hc->chan[hc->d_idx].dch->dev); in release_card()
1250 if (hc->chan[ch].dch) { in release_card()
1251 mISDN_freedchannel(hc->chan[ch].dch); in release_card()
1252 kfree(hc->chan[ch].dch); in release_card()
1288 struct dchannel *dch; in init_card() local
1372 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); in init_card()
1373 if (!dch) in init_card()
1375 dch->debug = debug; in init_card()
1376 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, NULL); in init_card()
1377 dch->hw = hc; in init_card()
1379 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1); in init_card()
1381 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0); in init_card()
1382 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in init_card()
1384 dch->dev.D.send = handle_dmsg; in init_card()
1385 dch->dev.D.ctrl = l1oip_dctrl; in init_card()
1386 dch->dev.nrbchan = hc->b_num; in init_card()
1387 dch->slot = hc->d_idx; in init_card()
1388 hc->chan[hc->d_idx].dch = dch; in init_card()
1390 for (ch = 0; ch < dch->dev.nrbchan; ch++) { in init_card()
1407 list_add(&bch->ch.list, &dch->dev.bchannels); in init_card()
1409 set_channelmap(bch->nr, dch->dev.channelmap); in init_card()
1412 ret = mISDN_register_device(&dch->dev, NULL, hc->name); in init_card()