Lines Matching refs:iif

195 get_appl(struct gigaset_capi_ctr *iif, u16 appl)  in get_appl()  argument
199 list_for_each_entry(ap, &iif->appls, ctrlist) in get_appl()
373 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_skb_sent() local
398 send_data_b3_conf(cs, &iif->ctr, ap->id, CAPIMSG_MSGID(req), in gigaset_skb_sent()
418 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_skb_rcvd() local
449 CAPIMSG_SETCONTROLLER(skb->data, iif->ctr.cnr); in gigaset_skb_rcvd()
460 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in gigaset_skb_rcvd()
499 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_isdn_icall() local
517 capi_cmsg_header(&iif->hcmsg, 0, CAPI_CONNECT, CAPI_IND, 0, in gigaset_isdn_icall()
518 iif->ctr.cnr | ((bcs->channel + 1) << 8)); in gigaset_isdn_icall()
526 if (encode_ie(at_state->str_var[STR_ZBC], iif->bc_buf, in gigaset_isdn_icall()
534 iif->hcmsg.CIPValue = 0; /* default if nothing found */ in gigaset_isdn_icall()
540 iif->hcmsg.CIPValue = i; in gigaset_isdn_icall()
545 iif->hcmsg.CIPValue = 1; in gigaset_isdn_icall()
546 encode_ie(cip2bchlc[1].bc, iif->bc_buf, MAX_BC_OCTETS); in gigaset_isdn_icall()
548 iif->hcmsg.BC = iif->bc_buf; in gigaset_isdn_icall()
549 msgsize += iif->hcmsg.BC[0]; in gigaset_isdn_icall()
554 if (encode_ie(at_state->str_var[STR_ZHLC], iif->hlc_buf, in gigaset_isdn_icall()
560 iif->hcmsg.HLC = iif->hlc_buf; in gigaset_isdn_icall()
561 msgsize += iif->hcmsg.HLC[0]; in gigaset_isdn_icall()
572 iif->hcmsg.CIPValue = i; in gigaset_isdn_icall()
585 iif->cdpty_buf[0] = i + 1; in gigaset_isdn_icall()
586 iif->cdpty_buf[1] = 0x80; /* type / numbering plan unknown */ in gigaset_isdn_icall()
587 memcpy(iif->cdpty_buf + 2, at_state->str_var[STR_ZCPN], i); in gigaset_isdn_icall()
588 iif->hcmsg.CalledPartyNumber = iif->cdpty_buf; in gigaset_isdn_icall()
589 msgsize += iif->hcmsg.CalledPartyNumber[0]; in gigaset_isdn_icall()
600 iif->cgpty_buf[0] = i + 2; in gigaset_isdn_icall()
601 iif->cgpty_buf[1] = 0x00; /* type / numbering plan unknown */ in gigaset_isdn_icall()
602 iif->cgpty_buf[2] = 0x80; /* pres. allowed, not screened */ in gigaset_isdn_icall()
603 memcpy(iif->cgpty_buf + 3, at_state->str_var[STR_NMBR], i); in gigaset_isdn_icall()
604 iif->hcmsg.CallingPartyNumber = iif->cgpty_buf; in gigaset_isdn_icall()
605 msgsize += iif->hcmsg.CallingPartyNumber[0]; in gigaset_isdn_icall()
619 iif->hcmsg.adr.adrPLCI, iif->hcmsg.CIPValue, in gigaset_isdn_icall()
620 format_ie(iif->hcmsg.BC)); in gigaset_isdn_icall()
622 format_ie(iif->hcmsg.HLC)); in gigaset_isdn_icall()
624 format_ie(iif->hcmsg.CallingPartyNumber)); in gigaset_isdn_icall()
626 format_ie(iif->hcmsg.CalledPartyNumber)); in gigaset_isdn_icall()
637 actCIPmask = 1 | (1 << iif->hcmsg.CIPValue); in gigaset_isdn_icall()
638 list_for_each_entry(ap, &iif->appls, ctrlist) in gigaset_isdn_icall()
641 iif->hcmsg.ApplId = ap->id; in gigaset_isdn_icall()
642 iif->hcmsg.Messagenumber = ap->nextMessageNumber++; in gigaset_isdn_icall()
650 if (capi_cmsg2message(&iif->hcmsg, in gigaset_isdn_icall()
657 dump_cmsg(DEBUG_CMD, __func__, &iif->hcmsg); in gigaset_isdn_icall()
668 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in gigaset_isdn_icall()
687 struct gigaset_capi_ctr *iif = cs->iif; in send_disconnect_ind() local
693 capi_cmsg_header(&iif->hcmsg, ap->id, CAPI_DISCONNECT, CAPI_IND, in send_disconnect_ind()
695 iif->ctr.cnr | ((bcs->channel + 1) << 8)); in send_disconnect_ind()
696 iif->hcmsg.Reason = reason; in send_disconnect_ind()
702 if (capi_cmsg2message(&iif->hcmsg, in send_disconnect_ind()
708 dump_cmsg(DEBUG_CMD, __func__, &iif->hcmsg); in send_disconnect_ind()
709 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in send_disconnect_ind()
721 struct gigaset_capi_ctr *iif = cs->iif; in send_disconnect_b3_ind() local
729 capi_cmsg_header(&iif->hcmsg, ap->id, CAPI_DISCONNECT_B3, CAPI_IND, in send_disconnect_b3_ind()
731 iif->ctr.cnr | ((bcs->channel + 1) << 8) | (1 << 16)); in send_disconnect_b3_ind()
737 if (capi_cmsg2message(&iif->hcmsg, in send_disconnect_b3_ind()
743 dump_cmsg(DEBUG_CMD, __func__, &iif->hcmsg); in send_disconnect_b3_ind()
744 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in send_disconnect_b3_ind()
757 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_isdn_connD() local
789 capi_cmsg_header(&iif->hcmsg, ap->id, CAPI_CONNECT_ACTIVE, CAPI_IND, in gigaset_isdn_connD()
791 iif->ctr.cnr | ((bcs->channel + 1) << 8)); in gigaset_isdn_connD()
807 if (capi_cmsg2message(&iif->hcmsg, __skb_put(skb, msgsize))) { in gigaset_isdn_connD()
812 dump_cmsg(DEBUG_CMD, __func__, &iif->hcmsg); in gigaset_isdn_connD()
813 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in gigaset_isdn_connD()
856 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_isdn_connB() local
903 capi_cmsg_header(&iif->hcmsg, ap->id, command, CAPI_IND, in gigaset_isdn_connB()
905 iif->ctr.cnr | ((bcs->channel + 1) << 8) | (1 << 16)); in gigaset_isdn_connB()
911 if (capi_cmsg2message(&iif->hcmsg, __skb_put(skb, msgsize))) { in gigaset_isdn_connB()
916 dump_cmsg(DEBUG_CMD, __func__, &iif->hcmsg); in gigaset_isdn_connB()
917 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in gigaset_isdn_connB()
950 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_isdn_start() local
953 strcpy(iif->ctr.manu, "Siemens"); in gigaset_isdn_start()
955 iif->ctr.version.majorversion = 2; /* CAPI 2.0 */ in gigaset_isdn_start()
956 iif->ctr.version.minorversion = 0; in gigaset_isdn_start()
958 iif->ctr.version.majormanuversion = cs->fwver[0]; in gigaset_isdn_start()
959 iif->ctr.version.minormanuversion = cs->fwver[1]; in gigaset_isdn_start()
961 iif->ctr.profile.nbchannel = cs->channels; in gigaset_isdn_start()
963 iif->ctr.profile.goptions = 0x11; in gigaset_isdn_start()
965 iif->ctr.profile.support1 = 0x03; in gigaset_isdn_start()
968 iif->ctr.profile.support2 = 0x02; in gigaset_isdn_start()
970 iif->ctr.profile.support3 = 0x01; in gigaset_isdn_start()
972 strcpy(iif->ctr.serial, "0"); in gigaset_isdn_start()
973 capi_ctr_ready(&iif->ctr); in gigaset_isdn_start()
985 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_isdn_stop() local
986 capi_ctr_down(&iif->ctr); in gigaset_isdn_stop()
1000 struct gigaset_capi_ctr *iif in gigaset_register_appl() local
1008 list_for_each_entry(ap, &iif->appls, ctrlist) in gigaset_register_appl()
1023 list_add(&ap->ctrlist, &iif->appls); in gigaset_register_appl()
1087 struct gigaset_capi_ctr *iif in gigaset_release_appl() local
1089 struct cardstate *cs = iif->ctr.driverdata; in gigaset_release_appl()
1095 list_for_each_entry_safe(ap, tmp, &iif->appls, ctrlist) in gigaset_release_appl()
1117 static void send_conf(struct gigaset_capi_ctr *iif, in send_conf() argument
1122 struct cardstate *cs = iif->ctr.driverdata; in send_conf()
1128 capi_cmsg_answer(&iif->acmsg); in send_conf()
1129 iif->acmsg.Info = info; in send_conf()
1130 if (capi_cmsg2message(&iif->acmsg, skb->data)) { in send_conf()
1136 dump_cmsg(DEBUG_CMD, __func__, &iif->acmsg); in send_conf()
1137 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in send_conf()
1143 static void do_facility_req(struct gigaset_capi_ctr *iif, in do_facility_req() argument
1147 struct cardstate *cs = iif->ctr.driverdata; in do_facility_req()
1148 _cmsg *cmsg = &iif->acmsg; in do_facility_req()
1188 send_conf(iif, ap, skb, CapiIllMessageParmCoding); in do_facility_req()
1206 send_conf(iif, ap, skb, in do_facility_req()
1275 capi_ctr_handle_message(&iif->ctr, ap->id, cskb); in do_facility_req()
1283 static void do_listen_req(struct gigaset_capi_ctr *iif, in do_listen_req() argument
1287 struct cardstate *cs = iif->ctr.driverdata; in do_listen_req()
1290 if (capi_message2cmsg(&iif->acmsg, skb->data)) { in do_listen_req()
1295 dump_cmsg(DEBUG_CMD, __func__, &iif->acmsg); in do_listen_req()
1298 ap->listenInfoMask = iif->acmsg.InfoMask; in do_listen_req()
1299 ap->listenCIPmask = iif->acmsg.CIPmask; in do_listen_req()
1300 send_conf(iif, ap, skb, CapiSuccess); in do_listen_req()
1307 static void do_alert_req(struct gigaset_capi_ctr *iif, in do_alert_req() argument
1311 struct cardstate *cs = iif->ctr.driverdata; in do_alert_req()
1314 if (capi_message2cmsg(&iif->acmsg, skb->data)) { in do_alert_req()
1319 dump_cmsg(DEBUG_CMD, __func__, &iif->acmsg); in do_alert_req()
1320 send_conf(iif, ap, skb, CapiAlertAlreadySent); in do_alert_req()
1328 static void do_connect_req(struct gigaset_capi_ctr *iif, in do_connect_req() argument
1332 struct cardstate *cs = iif->ctr.driverdata; in do_connect_req()
1333 _cmsg *cmsg = &iif->acmsg; in do_connect_req()
1355 send_conf(iif, ap, skb, CapiNoPlciAvailable); in do_connect_req()
1603 send_conf(iif, ap, skb, CapiSuccess); in do_connect_req()
1615 send_conf(iif, ap, skb, info); in do_connect_req()
1622 static void do_connect_resp(struct gigaset_capi_ctr *iif, in do_connect_resp() argument
1626 struct cardstate *cs = iif->ctr.driverdata; in do_connect_resp()
1627 _cmsg *cmsg = &iif->acmsg; in do_connect_resp()
1794 static void do_connect_b3_req(struct gigaset_capi_ctr *iif, in do_connect_b3_req() argument
1798 struct cardstate *cs = iif->ctr.driverdata; in do_connect_b3_req()
1799 _cmsg *cmsg = &iif->acmsg; in do_connect_b3_req()
1816 send_conf(iif, ap, skb, CapiIllContrPlciNcci); in do_connect_b3_req()
1829 send_conf(iif, ap, skb, in do_connect_b3_req()
1841 static void do_connect_b3_resp(struct gigaset_capi_ctr *iif, in do_connect_b3_resp() argument
1845 struct cardstate *cs = iif->ctr.driverdata; in do_connect_b3_resp()
1846 _cmsg *cmsg = &iif->acmsg; in do_connect_b3_resp()
1903 capi_ctr_handle_message(&iif->ctr, ap->id, skb); in do_connect_b3_resp()
1911 static void do_disconnect_req(struct gigaset_capi_ctr *iif, in do_disconnect_req() argument
1915 struct cardstate *cs = iif->ctr.driverdata; in do_disconnect_req()
1916 _cmsg *cmsg = &iif->acmsg; in do_disconnect_req()
1935 send_conf(iif, ap, skb, CapiIllContrPlciNcci); in do_disconnect_req()
1969 send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); in do_disconnect_req()
1979 send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); in do_disconnect_req()
1993 capi_ctr_handle_message(&iif->ctr, ap->id, b3skb); in do_disconnect_req()
1998 send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); in do_disconnect_req()
2004 send_conf(iif, ap, skb, CapiSuccess); in do_disconnect_req()
2011 static void do_disconnect_b3_req(struct gigaset_capi_ctr *iif, in do_disconnect_b3_req() argument
2015 struct cardstate *cs = iif->ctr.driverdata; in do_disconnect_b3_req()
2016 _cmsg *cmsg = &iif->acmsg; in do_disconnect_b3_req()
2034 send_conf(iif, ap, skb, CapiIllContrPlciNcci); in do_disconnect_b3_req()
2041 send_conf(iif, ap, skb, in do_disconnect_b3_req()
2048 send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); in do_disconnect_b3_req()
2056 send_conf(iif, ap, skb, in do_disconnect_b3_req()
2064 static void do_data_b3_req(struct gigaset_capi_ctr *iif, in do_data_b3_req() argument
2068 struct cardstate *cs = iif->ctr.driverdata; in do_data_b3_req()
2085 send_conf(iif, ap, skb, CapiIllContrPlciNcci); in do_data_b3_req()
2097 send_conf(iif, ap, skb, CapiIllMessageParmCoding); /* ? */ in do_data_b3_req()
2103 send_conf(iif, ap, skb, CapiIllMessageParmCoding); in do_data_b3_req()
2109 send_conf(iif, ap, skb, CapiMessageNotSupportedInCurrentState); in do_data_b3_req()
2120 send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); in do_data_b3_req()
2129 send_data_b3_conf(cs, &iif->ctr, ap->id, msgid, channel, handle, in do_data_b3_req()
2138 static void do_reset_b3_req(struct gigaset_capi_ctr *iif, in do_reset_b3_req() argument
2142 struct cardstate *cs = iif->ctr.driverdata; in do_reset_b3_req()
2145 if (capi_message2cmsg(&iif->acmsg, skb->data)) { in do_reset_b3_req()
2150 dump_cmsg(DEBUG_CMD, __func__, &iif->acmsg); in do_reset_b3_req()
2151 send_conf(iif, ap, skb, in do_reset_b3_req()
2158 static void do_unsupported(struct gigaset_capi_ctr *iif, in do_unsupported() argument
2162 struct cardstate *cs = iif->ctr.driverdata; in do_unsupported()
2165 if (capi_message2cmsg(&iif->acmsg, skb->data)) { in do_unsupported()
2170 dump_cmsg(DEBUG_CMD, __func__, &iif->acmsg); in do_unsupported()
2171 send_conf(iif, ap, skb, CapiMessageNotSupportedInCurrentState); in do_unsupported()
2177 static void do_nothing(struct gigaset_capi_ctr *iif, in do_nothing() argument
2181 struct cardstate *cs = iif->ctr.driverdata; in do_nothing()
2184 if (capi_message2cmsg(&iif->acmsg, skb->data)) { in do_nothing()
2189 dump_cmsg(DEBUG_CMD, __func__, &iif->acmsg); in do_nothing()
2193 static void do_data_b3_resp(struct gigaset_capi_ctr *iif, in do_data_b3_resp() argument
2270 struct gigaset_capi_ctr *iif in gigaset_send_message() local
2283 ap = get_appl(iif, CAPIMSG_APPID(skb->data)); in gigaset_send_message()
2301 if (atomic_add_return(1, &iif->sendqlen) > 1) { in gigaset_send_message()
2303 skb_queue_tail(&iif->sendqueue, skb); in gigaset_send_message()
2308 handler(iif, ap, skb); in gigaset_send_message()
2311 while (atomic_sub_return(1, &iif->sendqlen) > 0) { in gigaset_send_message()
2312 skb = skb_dequeue(&iif->sendqueue); in gigaset_send_message()
2318 ap = get_appl(iif, CAPIMSG_APPID(skb->data)); in gigaset_send_message()
2332 handler(iif, ap, skb); in gigaset_send_message()
2449 struct gigaset_capi_ctr *iif; in gigaset_isdn_regdev() local
2452 iif = kzalloc(sizeof(*iif), GFP_KERNEL); in gigaset_isdn_regdev()
2453 if (!iif) { in gigaset_isdn_regdev()
2459 iif->ctr.owner = THIS_MODULE; in gigaset_isdn_regdev()
2460 iif->ctr.driverdata = cs; in gigaset_isdn_regdev()
2461 strncpy(iif->ctr.name, isdnid, sizeof(iif->ctr.name) - 1); in gigaset_isdn_regdev()
2462 iif->ctr.driver_name = "gigaset"; in gigaset_isdn_regdev()
2463 iif->ctr.load_firmware = NULL; in gigaset_isdn_regdev()
2464 iif->ctr.reset_ctr = NULL; in gigaset_isdn_regdev()
2465 iif->ctr.register_appl = gigaset_register_appl; in gigaset_isdn_regdev()
2466 iif->ctr.release_appl = gigaset_release_appl; in gigaset_isdn_regdev()
2467 iif->ctr.send_message = gigaset_send_message; in gigaset_isdn_regdev()
2468 iif->ctr.procinfo = gigaset_procinfo; in gigaset_isdn_regdev()
2469 iif->ctr.proc_show = gigaset_proc_show, in gigaset_isdn_regdev()
2470 INIT_LIST_HEAD(&iif->appls); in gigaset_isdn_regdev()
2471 skb_queue_head_init(&iif->sendqueue); in gigaset_isdn_regdev()
2472 atomic_set(&iif->sendqlen, 0); in gigaset_isdn_regdev()
2475 rc = attach_capi_ctr(&iif->ctr); in gigaset_isdn_regdev()
2478 kfree(iif); in gigaset_isdn_regdev()
2482 cs->iif = iif; in gigaset_isdn_regdev()
2493 struct gigaset_capi_ctr *iif = cs->iif; in gigaset_isdn_unregdev() local
2495 detach_capi_ctr(&iif->ctr); in gigaset_isdn_unregdev()
2496 kfree(iif); in gigaset_isdn_unregdev()
2497 cs->iif = NULL; in gigaset_isdn_unregdev()