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()
277 struct llc_sock *llc = llc_sk(sk); in llc_ui_autobind() local
300 llc->laddr.lsap = llc_ui_autoport(); in llc_ui_autobind()
301 if (!llc->laddr.lsap) in llc_ui_autobind()
304 sap = llc_sap_open(llc->laddr.lsap, NULL); in llc_ui_autobind()
309 llc->dev = dev; in llc_ui_autobind()
310 netdev_tracker_alloc(llc->dev, &llc->dev_tracker, GFP_KERNEL); in llc_ui_autobind()
313 memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN); in llc_ui_autobind()
314 memcpy(&llc->addr, addr, sizeof(llc->addr)); in llc_ui_autobind()
330 * Bind a socket to a specific address. For llc a user is able to bind to
342 struct llc_sock *llc = llc_sk(sk); in llc_ui_bind() local
413 llc->dev = dev; in llc_ui_bind()
414 netdev_tracker_alloc(llc->dev, &llc->dev_tracker, GFP_KERNEL); in llc_ui_bind()
417 llc->laddr.lsap = addr->sllc_sap; in llc_ui_bind()
418 memcpy(llc->laddr.mac, addr->sllc_mac, IFHWADDRLEN); in llc_ui_bind()
419 memcpy(&llc->addr, addr, sizeof(llc->addr)); in llc_ui_bind()
482 struct llc_sock *llc = llc_sk(sk); in llc_ui_connect() local
504 llc->daddr.lsap = addr->sllc_sap; in llc_ui_connect()
505 memcpy(llc->daddr.mac, addr->sllc_mac, IFHWADDRLEN); in llc_ui_connect()
508 llc->link = llc_ui_next_link_no(llc->sap->laddr.lsap); in llc_ui_connect()
509 rc = llc_establish_connection(sk, llc->dev->dev_addr, in llc_ui_connect()
618 struct llc_sock *llc = llc_sk(sk); in llc_ui_wait_for_busy_core() local
626 (!llc_data_accept_state(llc->state) && in llc_ui_wait_for_busy_core()
627 !llc->remote_busy_flag && in llc_ui_wait_for_busy_core()
628 !llc->p_flag), &wait)) in llc_ui_wait_for_busy_core()
670 struct llc_sock *llc = llc_sk(skb->sk); in llc_cmsg_rcv() local
672 if (llc->cmsg_flags & LLC_CMSG_PKTINFO) { in llc_cmsg_rcv()
697 struct llc_sock *llc, *newllc; in llc_ui_accept() local
729 llc = llc_sk(sk); in llc_ui_accept()
731 memcpy(&newllc->addr, &llc->addr, sizeof(newllc->addr)); in llc_ui_accept()
763 struct llc_sock *llc = llc_sk(sk); in llc_ui_recvmsg() local
778 seq = &llc->copied_seq; in llc_ui_recvmsg()
780 peek_seq = llc->copied_seq; in llc_ui_recvmsg()
855 if ((flags & MSG_PEEK) && peek_seq != llc->copied_seq) { in llc_ui_recvmsg()
856 net_dbg_ratelimited("LLC(%s:%d): Application bug, race in MSG_PEEK\n", in llc_ui_recvmsg()
859 peek_seq = llc->copied_seq; in llc_ui_recvmsg()
930 struct llc_sock *llc = llc_sk(sk); in llc_ui_sendmsg() local
939 llc->laddr.lsap, llc->daddr.lsap); in llc_ui_sendmsg()
945 if (llc_ui_addr_null(&llc->addr)) in llc_ui_sendmsg()
947 addr = &llc->addr; in llc_ui_sendmsg()
956 hdrlen = llc->dev->hard_header_len + llc_ui_header_len(sk, addr); in llc_ui_sendmsg()
958 if (size > llc->dev->mtu) in llc_ui_sendmsg()
959 size = llc->dev->mtu; in llc_ui_sendmsg()
969 skb->dev = llc->dev; in llc_ui_sendmsg()
976 llc_build_and_send_ui_pkt(llc->sap, skb, addr->sllc_mac, in llc_ui_sendmsg()
982 llc_build_and_send_test_pkt(llc->sap, skb, addr->sllc_mac, in llc_ui_sendmsg()
988 llc_build_and_send_xid_pkt(llc->sap, skb, addr->sllc_mac, in llc_ui_sendmsg()
1002 __func__, llc->laddr.lsap, llc->daddr.lsap, rc); in llc_ui_sendmsg()
1020 struct llc_sock *llc = llc_sk(sk); in llc_ui_getname() local
1031 if(llc->dev) in llc_ui_getname()
1032 sllc.sllc_arphrd = llc->dev->type; in llc_ui_getname()
1033 sllc.sllc_sap = llc->daddr.lsap; in llc_ui_getname()
1034 memcpy(&sllc.sllc_mac, &llc->daddr.mac, IFHWADDRLEN); in llc_ui_getname()
1037 if (!llc->sap) in llc_ui_getname()
1039 sllc.sllc_sap = llc->sap->laddr.lsap; in llc_ui_getname()
1041 if (llc->dev) { in llc_ui_getname()
1042 sllc.sllc_arphrd = llc->dev->type; in llc_ui_getname()
1043 memcpy(&sllc.sllc_mac, llc->dev->dev_addr, in llc_ui_getname()
1061 * get/set info on llc sockets
1083 struct llc_sock *llc = llc_sk(sk); in llc_ui_setsockopt() local
1098 llc->n2 = opt; in llc_ui_setsockopt()
1103 llc->n1 = opt; in llc_ui_setsockopt()
1108 llc->ack_timer.expire = opt * HZ; in llc_ui_setsockopt()
1113 llc->pf_cycle_timer.expire = opt * HZ; in llc_ui_setsockopt()
1118 llc->rej_sent_timer.expire = opt * HZ; in llc_ui_setsockopt()
1123 llc->busy_state_timer.expire = opt * HZ; in llc_ui_setsockopt()
1128 llc->k = opt; in llc_ui_setsockopt()
1133 llc->rw = opt; in llc_ui_setsockopt()
1137 llc->cmsg_flags |= LLC_CMSG_PKTINFO; in llc_ui_setsockopt()
1139 llc->cmsg_flags &= ~LLC_CMSG_PKTINFO; in llc_ui_setsockopt()
1165 struct llc_sock *llc = llc_sk(sk); in llc_ui_getsockopt() local
1179 val = llc->n2; break; in llc_ui_getsockopt()
1181 val = llc->n1; break; in llc_ui_getsockopt()
1183 val = llc->ack_timer.expire / HZ; break; in llc_ui_getsockopt()
1185 val = llc->pf_cycle_timer.expire / HZ; break; in llc_ui_getsockopt()
1187 val = llc->rej_sent_timer.expire / HZ; break; in llc_ui_getsockopt()
1189 val = llc->busy_state_timer.expire / HZ; break; in llc_ui_getsockopt()
1191 val = llc->k; break; in llc_ui_getsockopt()
1193 val = llc->rw; break; in llc_ui_getsockopt()
1195 val = (llc->cmsg_flags & LLC_CMSG_PKTINFO) != 0; in llc_ui_getsockopt()
1237 KERN_CRIT "LLC: Unable to register the proc_fs entries\n";
1239 KERN_CRIT "LLC: Unable to register the sysctl entries\n";
1241 KERN_CRIT "LLC: Unable to register the network family\n";