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