Lines Matching refs:rt

378 		ng_btsocket_sco_rtentry_p rt)  in ng_btsocket_sco_process_lp_con_cfm()  argument
392 pcb = ng_btsocket_sco_pcb_by_addrs(&rt->src, &ep->bdaddr); in ng_btsocket_sco_process_lp_con_cfm()
451 ng_btsocket_sco_rtentry_p rt) in ng_btsocket_sco_process_lp_con_ind() argument
467 rt->src.b[5], rt->src.b[4], rt->src.b[3], in ng_btsocket_sco_process_lp_con_ind()
468 rt->src.b[2], rt->src.b[1], rt->src.b[0], in ng_btsocket_sco_process_lp_con_ind()
474 pcb = ng_btsocket_sco_pcb_by_addr(&rt->src); in ng_btsocket_sco_process_lp_con_ind()
505 bcopy(&rt->src, &pcb1->src, sizeof(pcb1->src)); in ng_btsocket_sco_process_lp_con_ind()
510 pcb1->rt = rt; in ng_btsocket_sco_process_lp_con_ind()
516 error = ng_btsocket_sco_send_lp_con_rsp(rt, &ep->bdaddr, status); in ng_btsocket_sco_process_lp_con_ind()
546 ng_btsocket_sco_rtentry_p rt) in ng_btsocket_sco_process_lp_discon_ind() argument
560 pcb = ng_btsocket_sco_pcb_by_handle(&rt->src, ep->con_handle); in ng_btsocket_sco_process_lp_discon_ind()
608 if (pcb->rt == NULL || in ng_btsocket_sco_send_lp_con_req()
609 pcb->rt->hook == NULL || NG_HOOK_NOT_VALID(pcb->rt->hook)) in ng_btsocket_sco_send_lp_con_req()
621 NG_SEND_MSG_HOOK(error, ng_btsocket_sco_node, msg, pcb->rt->hook, 0); in ng_btsocket_sco_send_lp_con_req()
631 ng_btsocket_sco_send_lp_con_rsp(ng_btsocket_sco_rtentry_p rt, bdaddr_p dst, int status) in ng_btsocket_sco_send_lp_con_rsp() argument
637 if (rt == NULL || rt->hook == NULL || NG_HOOK_NOT_VALID(rt->hook)) in ng_btsocket_sco_send_lp_con_rsp()
650 NG_SEND_MSG_HOOK(error, ng_btsocket_sco_node, msg, rt->hook, 0); in ng_btsocket_sco_send_lp_con_rsp()
668 if (pcb->rt == NULL || in ng_btsocket_sco_send_lp_discon_req()
669 pcb->rt->hook == NULL || NG_HOOK_NOT_VALID(pcb->rt->hook)) in ng_btsocket_sco_send_lp_discon_req()
681 NG_SEND_MSG_HOOK(error, ng_btsocket_sco_node, msg, pcb->rt->hook, 0); in ng_btsocket_sco_send_lp_discon_req()
701 ng_btsocket_sco_rtentry_t *rt = NULL; in ng_btsocket_sco_data_input() local
710 rt = (ng_btsocket_sco_rtentry_t *) NG_HOOK_PRIVATE(hook); in ng_btsocket_sco_data_input()
711 if (rt == NULL) { in ng_btsocket_sco_data_input()
750 rt->src.b[5], rt->src.b[4], rt->src.b[3], in ng_btsocket_sco_data_input()
751 rt->src.b[2], rt->src.b[1], rt->src.b[0], in ng_btsocket_sco_data_input()
757 pcb = ng_btsocket_sco_pcb_by_handle(&rt->src, con_handle); in ng_btsocket_sco_data_input()
769 rt->src.b[5], rt->src.b[4], rt->src.b[3], in ng_btsocket_sco_data_input()
770 rt->src.b[2], rt->src.b[1], rt->src.b[0], in ng_btsocket_sco_data_input()
784 rt->src.b[5], rt->src.b[4], rt->src.b[3], in ng_btsocket_sco_data_input()
785 rt->src.b[2], rt->src.b[1], rt->src.b[0], in ng_btsocket_sco_data_input()
813 ng_btsocket_sco_rtentry_t *rt = NULL; in ng_btsocket_sco_default_msg_input() local
818 rt = (ng_btsocket_sco_rtentry_t *) NG_HOOK_PRIVATE(hook); in ng_btsocket_sco_default_msg_input()
831 if (rt == NULL) { in ng_btsocket_sco_default_msg_input()
832 rt = malloc(sizeof(*rt), in ng_btsocket_sco_default_msg_input()
834 if (rt == NULL) in ng_btsocket_sco_default_msg_input()
837 NG_HOOK_SET_PRIVATE(hook, rt); in ng_btsocket_sco_default_msg_input()
841 LIST_INSERT_HEAD(&ng_btsocket_sco_rt, rt, next); in ng_btsocket_sco_default_msg_input()
845 bcopy(&ep->bdaddr, &rt->src, sizeof(rt->src)); in ng_btsocket_sco_default_msg_input()
846 rt->pkt_size = (ep->pkt_size == 0)? 60 : ep->pkt_size; in ng_btsocket_sco_default_msg_input()
847 rt->num_pkts = ep->num_pkts; in ng_btsocket_sco_default_msg_input()
848 rt->hook = hook; in ng_btsocket_sco_default_msg_input()
855 rt->src.b[5], rt->src.b[4], rt->src.b[3], in ng_btsocket_sco_default_msg_input()
856 rt->src.b[2], rt->src.b[1], rt->src.b[0], in ng_btsocket_sco_default_msg_input()
857 rt->pkt_size, rt->num_pkts); in ng_btsocket_sco_default_msg_input()
864 if (rt == NULL || msg->header.arglen != sizeof(*ep)) in ng_btsocket_sco_default_msg_input()
869 rt->pending -= ep->completed; in ng_btsocket_sco_default_msg_input()
870 if (rt->pending < 0) { in ng_btsocket_sco_default_msg_input()
875 rt->src.b[5], rt->src.b[4], rt->src.b[3], in ng_btsocket_sco_default_msg_input()
876 rt->src.b[2], rt->src.b[1], rt->src.b[0], in ng_btsocket_sco_default_msg_input()
877 ep->con_handle, rt->pending, in ng_btsocket_sco_default_msg_input()
880 rt->pending = 0; in ng_btsocket_sco_default_msg_input()
886 pcb = ng_btsocket_sco_pcb_by_handle(&rt->src, ep->con_handle); in ng_btsocket_sco_default_msg_input()
932 ng_btsocket_sco_rtentry_p rt = NULL; in ng_btsocket_sco_lp_msg_input() local
940 rt = (ng_btsocket_sco_rtentry_p) NG_HOOK_PRIVATE(hook); in ng_btsocket_sco_lp_msg_input()
941 if (rt == NULL) { in ng_btsocket_sco_lp_msg_input()
949 ng_btsocket_sco_process_lp_con_cfm(msg, rt); in ng_btsocket_sco_lp_msg_input()
953 ng_btsocket_sco_process_lp_con_ind(msg, rt); in ng_btsocket_sco_lp_msg_input()
957 ng_btsocket_sco_process_lp_discon_ind(msg, rt); in ng_btsocket_sco_lp_msg_input()
1042 ng_btsocket_sco_rtentry_p rt = NULL; in ng_btsocket_sco_rtclean() local
1054 if (pcb->rt != NULL && in ng_btsocket_sco_rtclean()
1055 pcb->rt->hook != NULL && NG_HOOK_NOT_VALID(pcb->rt->hook)) { in ng_btsocket_sco_rtclean()
1059 pcb->rt = NULL; in ng_btsocket_sco_rtclean()
1077 for (rt = LIST_FIRST(&ng_btsocket_sco_rt); rt != NULL; ) { in ng_btsocket_sco_rtclean()
1078 ng_btsocket_sco_rtentry_p rt_next = LIST_NEXT(rt, next); in ng_btsocket_sco_rtclean()
1080 if (rt->hook != NULL && NG_HOOK_NOT_VALID(rt->hook)) { in ng_btsocket_sco_rtclean()
1081 LIST_REMOVE(rt, next); in ng_btsocket_sco_rtclean()
1083 NG_HOOK_SET_PRIVATE(rt->hook, NULL); in ng_btsocket_sco_rtclean()
1084 NG_HOOK_UNREF(rt->hook); /* Remove extra reference */ in ng_btsocket_sco_rtclean()
1086 bzero(rt, sizeof(*rt)); in ng_btsocket_sco_rtclean()
1087 free(rt, M_NETGRAPH_BTSOCKET_SCO); in ng_btsocket_sco_rtclean()
1090 rt = rt_next; in ng_btsocket_sco_rtclean()
1336 ng_btsocket_sco_rtentry_t *rt = NULL; in ng_btsocket_sco_connect() local
1382 pcb->rt = NULL; in ng_btsocket_sco_connect()
1385 LIST_FOREACH(rt, &ng_btsocket_sco_rt, next) { in ng_btsocket_sco_connect()
1386 if (rt->hook == NULL || NG_HOOK_NOT_VALID(rt->hook)) in ng_btsocket_sco_connect()
1391 if (bcmp(&pcb->src, &rt->src, sizeof(rt->src)) == 0) in ng_btsocket_sco_connect()
1394 if (bcmp(&pcb->dst, &rt->src, sizeof(rt->src)) != 0) in ng_btsocket_sco_connect()
1399 if (rt != NULL) { in ng_btsocket_sco_connect()
1400 pcb->rt = rt; in ng_btsocket_sco_connect()
1403 bcopy(&rt->src, &pcb->src, sizeof(pcb->src)); in ng_btsocket_sco_connect()
1468 tmp = pcb->rt->pkt_size; in ng_btsocket_sco_ctloutput()
1670 if (pcb->rt == NULL || in ng_btsocket_sco_send()
1671 pcb->rt->hook == NULL || NG_HOOK_NOT_VALID(pcb->rt->hook)) { in ng_btsocket_sco_send()
1678 if (m->m_pkthdr.len > pcb->rt->pkt_size) { in ng_btsocket_sco_send()
1681 __func__, m->m_pkthdr.len, pcb->rt->pkt_size); in ng_btsocket_sco_send()
1727 while (pcb->rt->pending < pcb->rt->num_pkts && in ng_btsocket_sco_send2()
1754 NG_SEND_DATA_ONLY(error, pcb->rt->hook, m); in ng_btsocket_sco_send2()
1758 pcb->rt->pending ++; in ng_btsocket_sco_send2()
1761 return ((pcb->rt->pending > 0)? 0 : error); in ng_btsocket_sco_send2()