Lines Matching full:llc
2 * af_llc.c - LLC User Interface SAPs
4 * Functions in this module are implementation of socket based llc
5 * communications for the Linux operating system. Support of llc class
31 #include <net/llc.h>
89 * llc_ui_header_len - return length of llc header based on operation
90 * @sk: Socket which contains a valid llc socket type.
93 * Provide the length of the llc header depending on what kind of
95 * Returns the correct llc header length.
105 * since llc_pdu_init_as_xid_cmd() sets 4,5,6 bytes of LLC header in llc_ui_header_len()
129 struct llc_sock* llc = llc_sk(sk); in llc_ui_send_data() local
131 if (unlikely(llc_data_accept_state(llc->state) || in llc_ui_send_data()
132 llc->remote_busy_flag || in llc_ui_send_data()
133 llc->p_flag)) { in llc_ui_send_data()
154 .name = "LLC",
203 struct llc_sock *llc; in llc_ui_release() local
209 llc = llc_sk(sk); in llc_ui_release()
211 llc->laddr.lsap, llc->daddr.lsap); in llc_ui_release()
215 struct llc_sap *sap = llc->sap; in llc_ui_release()
221 llc_sap_remove_socket(llc->sap, sk); in llc_ui_release()
227 netdev_put(llc->dev, &llc->dev_tracker); in llc_ui_release()
279 struct llc_sock *llc = llc_sk(sk); in llc_ui_autobind() local
302 llc->laddr.lsap = llc_ui_autoport(); in llc_ui_autobind()
303 if (!llc->laddr.lsap) in llc_ui_autobind()
306 sap = llc_sap_open(llc->laddr.lsap, NULL); in llc_ui_autobind()
311 llc->dev = dev; in llc_ui_autobind()
312 netdev_tracker_alloc(llc->dev, &llc->dev_tracker, GFP_KERNEL); in llc_ui_autobind()
315 memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN); in llc_ui_autobind()
316 memcpy(&llc->addr, addr, sizeof(llc->addr)); in llc_ui_autobind()
332 * Bind a socket to a specific address. For llc a user is able to bind to
344 struct llc_sock *llc = llc_sk(sk); in llc_ui_bind() local
415 llc->dev = dev; in llc_ui_bind()
416 netdev_tracker_alloc(llc->dev, &llc->dev_tracker, GFP_KERNEL); in llc_ui_bind()
419 llc->laddr.lsap = addr->sllc_sap; in llc_ui_bind()
420 memcpy(llc->laddr.mac, addr->sllc_mac, IFHWADDRLEN); in llc_ui_bind()
421 memcpy(&llc->addr, addr, sizeof(llc->addr)); in llc_ui_bind()
484 struct llc_sock *llc = llc_sk(sk); in llc_ui_connect() local
506 llc->daddr.lsap = addr->sllc_sap; in llc_ui_connect()
507 memcpy(llc->daddr.mac, addr->sllc_mac, IFHWADDRLEN); in llc_ui_connect()
510 llc->link = llc_ui_next_link_no(llc->sap->laddr.lsap); in llc_ui_connect()
511 rc = llc_establish_connection(sk, llc->dev->dev_addr, in llc_ui_connect()
622 struct llc_sock *llc = llc_sk(sk); in llc_ui_wait_for_busy_core() local
630 (!llc_data_accept_state(llc->state) && in llc_ui_wait_for_busy_core()
631 !llc->remote_busy_flag && in llc_ui_wait_for_busy_core()
632 !llc->p_flag), &wait)) in llc_ui_wait_for_busy_core()
674 struct llc_sock *llc = llc_sk(skb->sk); in llc_cmsg_rcv() local
676 if (llc->cmsg_flags & LLC_CMSG_PKTINFO) { in llc_cmsg_rcv()
700 struct llc_sock *llc, *newllc; in llc_ui_accept() local
732 llc = llc_sk(sk); in llc_ui_accept()
734 memcpy(&newllc->addr, &llc->addr, sizeof(newllc->addr)); in llc_ui_accept()
766 struct llc_sock *llc = llc_sk(sk); in llc_ui_recvmsg() local
781 seq = &llc->copied_seq; in llc_ui_recvmsg()
783 peek_seq = llc->copied_seq; in llc_ui_recvmsg()
858 if ((flags & MSG_PEEK) && peek_seq != llc->copied_seq) { in llc_ui_recvmsg()
859 net_dbg_ratelimited("LLC(%s:%d): Application bug, race in MSG_PEEK\n", in llc_ui_recvmsg()
862 peek_seq = llc->copied_seq; in llc_ui_recvmsg()
934 struct llc_sock *llc = llc_sk(sk); in llc_ui_sendmsg() local
943 llc->laddr.lsap, llc->daddr.lsap); in llc_ui_sendmsg()
949 if (llc_ui_addr_null(&llc->addr)) in llc_ui_sendmsg()
951 addr = &llc->addr; in llc_ui_sendmsg()
960 dev = llc->dev; in llc_ui_sendmsg()
975 llc->dev != dev || in llc_ui_sendmsg()
987 llc_build_and_send_ui_pkt(llc->sap, skb, addr->sllc_mac, in llc_ui_sendmsg()
993 llc_build_and_send_test_pkt(llc->sap, skb, addr->sllc_mac, in llc_ui_sendmsg()
999 llc_build_and_send_xid_pkt(llc->sap, skb, addr->sllc_mac, in llc_ui_sendmsg()
1013 __func__, llc->laddr.lsap, llc->daddr.lsap, rc); in llc_ui_sendmsg()
1031 struct llc_sock *llc = llc_sk(sk); in llc_ui_getname() local
1042 if(llc->dev) in llc_ui_getname()
1043 sllc.sllc_arphrd = llc->dev->type; in llc_ui_getname()
1044 sllc.sllc_sap = llc->daddr.lsap; in llc_ui_getname()
1045 memcpy(&sllc.sllc_mac, &llc->daddr.mac, IFHWADDRLEN); in llc_ui_getname()
1048 if (!llc->sap) in llc_ui_getname()
1050 sllc.sllc_sap = llc->sap->laddr.lsap; in llc_ui_getname()
1052 if (llc->dev) { in llc_ui_getname()
1053 sllc.sllc_arphrd = llc->dev->type; in llc_ui_getname()
1054 memcpy(&sllc.sllc_mac, llc->dev->dev_addr, in llc_ui_getname()
1072 * get/set info on llc sockets
1094 struct llc_sock *llc = llc_sk(sk); in llc_ui_setsockopt() local
1109 llc->n2 = opt; in llc_ui_setsockopt()
1114 llc->n1 = opt; in llc_ui_setsockopt()
1119 llc->ack_timer.expire = opt * HZ; in llc_ui_setsockopt()
1124 llc->pf_cycle_timer.expire = opt * HZ; in llc_ui_setsockopt()
1129 llc->rej_sent_timer.expire = opt * HZ; in llc_ui_setsockopt()
1134 llc->busy_state_timer.expire = opt * HZ; in llc_ui_setsockopt()
1139 llc->k = opt; in llc_ui_setsockopt()
1144 llc->rw = opt; in llc_ui_setsockopt()
1148 llc->cmsg_flags |= LLC_CMSG_PKTINFO; in llc_ui_setsockopt()
1150 llc->cmsg_flags &= ~LLC_CMSG_PKTINFO; in llc_ui_setsockopt()
1176 struct llc_sock *llc = llc_sk(sk); in llc_ui_getsockopt() local
1190 val = llc->n2; break; in llc_ui_getsockopt()
1192 val = llc->n1; break; in llc_ui_getsockopt()
1194 val = llc->ack_timer.expire / HZ; break; in llc_ui_getsockopt()
1196 val = llc->pf_cycle_timer.expire / HZ; break; in llc_ui_getsockopt()
1198 val = llc->rej_sent_timer.expire / HZ; break; in llc_ui_getsockopt()
1200 val = llc->busy_state_timer.expire / HZ; break; in llc_ui_getsockopt()
1202 val = llc->k; break; in llc_ui_getsockopt()
1204 val = llc->rw; break; in llc_ui_getsockopt()
1206 val = (llc->cmsg_flags & LLC_CMSG_PKTINFO) != 0; in llc_ui_getsockopt()
1247 KERN_CRIT "LLC: Unable to register the proc_fs entries\n";
1249 KERN_CRIT "LLC: Unable to register the sysctl entries\n";
1251 KERN_CRIT "LLC: Unable to register the network family\n";