• Home
  • Raw
  • Download

Lines Matching refs:ctr

66 capi_ctr_get(struct capi_ctr *ctr)  in capi_ctr_get()  argument
68 if (!try_module_get(ctr->owner)) in capi_ctr_get()
70 return ctr; in capi_ctr_get()
74 capi_ctr_put(struct capi_ctr *ctr) in capi_ctr_put() argument
76 module_put(ctr->owner); in capi_ctr_put()
147 register_appl(struct capi_ctr *ctr, u16 applid, capi_register_params *rparam) in register_appl() argument
149 ctr = capi_ctr_get(ctr); in register_appl()
151 if (ctr) in register_appl()
152 ctr->register_appl(ctr, applid, rparam); in register_appl()
159 static void release_appl(struct capi_ctr *ctr, u16 applid) in release_appl() argument
163 ctr->release_appl(ctr, applid); in release_appl()
164 capi_ctr_put(ctr); in release_appl()
170 struct capi_ctr *ctr; in notify_up() local
178 ctr = get_capi_ctr_by_nr(contr); in notify_up()
179 if (ctr) { in notify_up()
180 if (ctr->state == CAPI_CTR_RUNNING) in notify_up()
183 ctr->state = CAPI_CTR_RUNNING; in notify_up()
188 register_appl(ctr, applid, &ap->rparam); in notify_up()
197 static void ctr_down(struct capi_ctr *ctr, int new_state) in ctr_down() argument
202 if (ctr->state == CAPI_CTR_DETECTED || ctr->state == CAPI_CTR_DETACHED) in ctr_down()
205 ctr->state = new_state; in ctr_down()
207 memset(ctr->manu, 0, sizeof(ctr->manu)); in ctr_down()
208 memset(&ctr->version, 0, sizeof(ctr->version)); in ctr_down()
209 memset(&ctr->profile, 0, sizeof(ctr->profile)); in ctr_down()
210 memset(ctr->serial, 0, sizeof(ctr->serial)); in ctr_down()
215 capi_ctr_put(ctr); in ctr_down()
221 struct capi_ctr *ctr; in notify_down() local
228 ctr = get_capi_ctr_by_nr(contr); in notify_down()
229 if (ctr) in notify_down()
230 ctr_down(ctr, CAPI_CTR_DETECTED); in notify_down()
301 void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl, in capi_ctr_handle_message() argument
309 if (ctr->state != CAPI_CTR_RUNNING) { in capi_ctr_handle_message()
313 ctr->cnr, cdb->buf); in capi_ctr_handle_message()
317 ctr->cnr); in capi_ctr_handle_message()
324 ctr->nrecvdatapkt++; in capi_ctr_handle_message()
325 if (ctr->traceflag > 2) in capi_ctr_handle_message()
328 ctr->nrecvctlpkt++; in capi_ctr_handle_message()
329 if (ctr->traceflag) in capi_ctr_handle_message()
332 showctl |= (ctr->traceflag & 1); in capi_ctr_handle_message()
336 ctr->cnr, CAPIMSG_APPID(skb->data), in capi_ctr_handle_message()
343 ctr->cnr, cdb->buf); in capi_ctr_handle_message()
347 ctr->cnr, CAPIMSG_APPID(skb->data), in capi_ctr_handle_message()
388 void capi_ctr_ready(struct capi_ctr *ctr) in capi_ctr_ready() argument
391 ctr->cnr, ctr->name); in capi_ctr_ready()
393 notify_push(CAPICTR_UP, ctr->cnr); in capi_ctr_ready()
406 void capi_ctr_down(struct capi_ctr *ctr) in capi_ctr_down() argument
408 printk(KERN_NOTICE "kcapi: controller [%03d] down.\n", ctr->cnr); in capi_ctr_down()
410 notify_push(CAPICTR_DOWN, ctr->cnr); in capi_ctr_down()
425 int attach_capi_ctr(struct capi_ctr *ctr) in attach_capi_ctr() argument
440 capi_controller[i] = ctr; in attach_capi_ctr()
442 ctr->nrecvctlpkt = 0; in attach_capi_ctr()
443 ctr->nrecvdatapkt = 0; in attach_capi_ctr()
444 ctr->nsentctlpkt = 0; in attach_capi_ctr()
445 ctr->nsentdatapkt = 0; in attach_capi_ctr()
446 ctr->cnr = i + 1; in attach_capi_ctr()
447 ctr->state = CAPI_CTR_DETECTED; in attach_capi_ctr()
448 ctr->blocked = 0; in attach_capi_ctr()
449 ctr->traceflag = showcapimsgs; in attach_capi_ctr()
451 sprintf(ctr->procfn, "capi/controllers/%d", ctr->cnr); in attach_capi_ctr()
452 ctr->procent = proc_create_single_data(ctr->procfn, 0, NULL, in attach_capi_ctr()
453 ctr->proc_show, ctr); in attach_capi_ctr()
460 ctr->cnr, ctr->name); in attach_capi_ctr()
475 int detach_capi_ctr(struct capi_ctr *ctr) in detach_capi_ctr() argument
481 ctr_down(ctr, CAPI_CTR_DETACHED); in detach_capi_ctr()
483 if (ctr->cnr < 1 || ctr->cnr - 1 >= CAPI_MAXCONTR) { in detach_capi_ctr()
488 if (capi_controller[ctr->cnr - 1] != ctr) { in detach_capi_ctr()
492 capi_controller[ctr->cnr - 1] = NULL; in detach_capi_ctr()
495 if (ctr->procent) in detach_capi_ctr()
496 remove_proc_entry(ctr->procfn, NULL); in detach_capi_ctr()
499 ctr->cnr, ctr->name); in detach_capi_ctr()
653 struct capi_ctr *ctr; in capi20_put_message() local
673 ctr = get_capi_ctr_by_nr(CAPIMSG_CONTROLLER(skb->data)); in capi20_put_message()
674 if (!ctr || ctr->state != CAPI_CTR_RUNNING) in capi20_put_message()
676 if (ctr->blocked) in capi20_put_message()
683 ctr->nsentdatapkt++; in capi20_put_message()
685 if (ctr->traceflag > 2) in capi20_put_message()
688 ctr->nsentctlpkt++; in capi20_put_message()
690 if (ctr->traceflag) in capi20_put_message()
693 showctl |= (ctr->traceflag & 1); in capi20_put_message()
716 return ctr->send_message(ctr, skb); in capi20_put_message()
731 struct capi_ctr *ctr; in capi20_get_manufacturer() local
741 ctr = get_capi_ctr_by_nr(contr); in capi20_get_manufacturer()
742 if (ctr && ctr->state == CAPI_CTR_RUNNING) { in capi20_get_manufacturer()
743 strncpy(buf, ctr->manu, CAPI_MANUFACTURER_LEN); in capi20_get_manufacturer()
764 struct capi_ctr *ctr; in capi20_get_version() local
774 ctr = get_capi_ctr_by_nr(contr); in capi20_get_version()
775 if (ctr && ctr->state == CAPI_CTR_RUNNING) { in capi20_get_version()
776 memcpy(verp, &ctr->version, sizeof(capi_version)); in capi20_get_version()
797 struct capi_ctr *ctr; in capi20_get_serial() local
807 ctr = get_capi_ctr_by_nr(contr); in capi20_get_serial()
808 if (ctr && ctr->state == CAPI_CTR_RUNNING) { in capi20_get_serial()
809 strlcpy(serial, ctr->serial, CAPI_SERIAL_LEN); in capi20_get_serial()
830 struct capi_ctr *ctr; in capi20_get_profile() local
840 ctr = get_capi_ctr_by_nr(contr); in capi20_get_profile()
841 if (ctr && ctr->state == CAPI_CTR_RUNNING) { in capi20_get_profile()
842 memcpy(profp, &ctr->profile, sizeof(struct capi_profile)); in capi20_get_profile()
862 struct capi_ctr *ctr; in capi20_manufacturer() local
875 ctr = get_capi_ctr_by_nr(fdef.contr); in capi20_manufacturer()
876 if (ctr) { in capi20_manufacturer()
877 ctr->traceflag = fdef.flag; in capi20_manufacturer()
879 ctr->cnr, ctr->traceflag); in capi20_manufacturer()