Lines Matching refs:ctrl

47 static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
65 hycapi_reset_ctr(struct capi_ctr *ctrl)
67 hycapictrl_info *cinfo = ctrl->driverdata;
73 capi_ctr_down(ctrl);
81 hycapi_remove_ctr(struct capi_ctr *ctrl)
89 cinfo = (hycapictrl_info *)(ctrl->driverdata);
95 capi_ctr_suspend_output(ctrl);
97 if (hycapi_applications[i].listen_req[ctrl->cnr - 1]) {
98 kfree_skb(hycapi_applications[i].listen_req[ctrl->cnr - 1]);
99 hycapi_applications[i].listen_req[ctrl->cnr - 1] = NULL;
102 detach_capi_ctr(ctrl);
103 ctrl->driverdata = NULL;
117 hycapi_sendmsg_internal(struct capi_ctr *ctrl, struct sk_buff *skb)
119 hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
134 capi_ctr_suspend_output(ctrl);
151 hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl,
155 hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
184 hycapi_applications[appl - 1].ctrl_mask |= (1 << (ctrl->cnr - 1));
185 hycapi_send_message(ctrl, skb);
196 static void hycapi_restart_internal(struct capi_ctr *ctrl)
204 if (_hycapi_appCheck(i + 1, ctrl->cnr) == 1) {
205 hycapi_register_internal(ctrl, i + 1,
207 if (hycapi_applications[i].listen_req[ctrl->cnr - 1]) {
208 skb = skb_copy(hycapi_applications[i].listen_req[ctrl->cnr - 1], GFP_ATOMIC);
209 hycapi_sendmsg_internal(ctrl, skb);
223 hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl,
227 hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
229 int chk = _hycapi_appCheck(appl, ctrl->cnr);
262 static void hycapi_release_internal(struct capi_ctr *ctrl, __u16 appl)
264 hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
287 hycapi_send_message(ctrl, skb);
288 hycapi_applications[appl - 1].ctrl_mask &= ~(1 << (ctrl->cnr - 1));
299 hycapi_release_appl(struct capi_ctr *ctrl, __u16 appl)
303 chk = _hycapi_appCheck(appl, ctrl->cnr);
305 printk(KERN_ERR "HYCAPI: Releasing invalid appl %d on controller %d\n", appl, ctrl->cnr);
308 if (hycapi_applications[appl - 1].listen_req[ctrl->cnr - 1]) {
309 kfree_skb(hycapi_applications[appl - 1].listen_req[ctrl->cnr - 1]);
310 hycapi_applications[appl - 1].listen_req[ctrl->cnr - 1] = NULL;
314 hycapi_release_internal(ctrl, appl);
326 struct capi_ctr *ctrl;
331 ctrl = &cinfo->capi_ctrl;
332 hycapi_remove_ctr(ctrl);
346 struct capi_ctr *ctrl;
351 ctrl = &cinfo->capi_ctrl;
352 /* ctrl->suspend_output(ctrl); */
353 capi_ctr_down(ctrl);
371 static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
376 hycapictrl_info *cinfo = ctrl->driverdata;
380 switch (_hycapi_appCheck(appl_id, ctrl->cnr))
384 hycapi_register_internal(ctrl,
416 if (hycapi_applications[appl_id - 1].listen_req[ctrl->cnr - 1])
418 kfree_skb(hycapi_applications[appl_id - 1].listen_req[ctrl->cnr - 1]);
419 hycapi_applications[appl_id - 1].listen_req[ctrl->cnr - 1] = NULL;
421 if (!(hycapi_applications[appl_id -1].listen_req[ctrl->cnr - 1] = skb_copy(skb, GFP_ATOMIC)))
431 hycapi_sendmsg_internal(ctrl, skb);
440 struct capi_ctr *ctrl = m->private;
441 hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
491 static int hycapi_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
500 static char *hycapi_procinfo(struct capi_ctr *ctrl)
502 hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
532 struct capi_ctr *ctrl;
543 ctrl = &cinfo->capi_ctrl;
622 capi_ctr_handle_message(ctrl, ApplId, skb);
705 Attach the card with its capi-ctrl.
711 struct capi_ctr *ctrl = NULL;
714 ctrl = &cinfo->capi_ctrl;
715 strcpy(ctrl->manu, "Hypercope");
716 ctrl->version.majorversion = 2;
717 ctrl->version.minorversion = 0;
718 ctrl->version.majormanuversion = 3;
719 ctrl->version.minormanuversion = 2;
720 ctrl->profile.ncontroller = card->myid;
721 ctrl->profile.nbchannel = card->bchans;
722 ctrl->profile.goptions = GLOBAL_OPTION_INTERNAL_CONTROLLER |
724 ctrl->profile.support1 = B1_PROT_64KBIT_HDLC |
727 ctrl->profile.support2 = B2_PROT_ISO7776 |
730 ctrl->profile.support3 = B3_PROT_TRANSPARENT |
741 struct capi_ctr *ctrl = NULL;
752 printk(KERN_WARNING "HYSDN: no memory for capi-ctrl.\n");
769 ctrl = &cinfo->capi_ctrl;
770 ctrl->driver_name = "hycapi";
771 ctrl->driverdata = cinfo;
772 ctrl->register_appl = hycapi_register_appl;
773 ctrl->release_appl = hycapi_release_appl;
774 ctrl->send_message = hycapi_send_message;
775 ctrl->load_firmware = hycapi_load_firmware;
776 ctrl->reset_ctr = hycapi_reset_ctr;
777 ctrl->procinfo = hycapi_procinfo;
778 ctrl->proc_fops = &hycapi_proc_fops;
779 strcpy(ctrl->name, cinfo->cardname);
780 ctrl->owner = THIS_MODULE;
782 retval = attach_capi_ctr(ctrl);
789 capi_ctr_ready(ctrl);
791 /* resume output on stopped ctrl */
792 ctrl = &card->hyctrlinfo->capi_ctrl;
794 capi_ctr_ready(ctrl);
795 hycapi_restart_internal(ctrl);
796 /* ctrl->resume_output(ctrl); */