Lines Matching refs:sock
49 #include <net/sock.h>
75 static void __l2cap_sock_close(struct sock *sk, int reason);
76 static void l2cap_sock_close(struct sock *sk);
77 static void l2cap_sock_kill(struct sock *sk);
79 static int l2cap_build_conf_req(struct sock *sk, void *data);
83 static int l2cap_ertm_data_rcv(struct sock *sk, struct sk_buff *skb);
88 struct sock *sk = (struct sock *) arg;
91 BT_DBG("sock %p state %d", sk, sk->sk_state);
111 static void l2cap_sock_set_timer(struct sock *sk, long timeout)
117 static void l2cap_sock_clear_timer(struct sock *sk)
119 BT_DBG("sock %p state %d", sk, sk->sk_state);
124 static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid)
126 struct sock *s;
134 static struct sock *__l2cap_get_chan_by_scid(struct l2cap_chan_list *l, u16 cid)
136 struct sock *s;
146 static inline struct sock *l2cap_get_chan_by_scid(struct l2cap_chan_list *l, u16 cid)
148 struct sock *s;
157 static struct sock *__l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
159 struct sock *s;
167 static inline struct sock *l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
169 struct sock *s;
190 static inline void __l2cap_chan_link(struct l2cap_chan_list *l, struct sock *sk)
202 static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
204 struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c;
219 static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
253 static void l2cap_chan_del(struct sock *sk, int err)
256 struct sock *parent = bt_sk(sk)->parent;
301 static inline int l2cap_check_security(struct sock *sk)
371 struct sock *sk = (struct sock *)pi;
425 static inline int __l2cap_no_conn_pending(struct sock *sk)
430 static void l2cap_do_start(struct sock *sk)
480 static void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err)
509 struct sock *sk;
564 struct sock *parent = bt_sk(sk)->parent;
611 struct sock *sk;
638 struct sock *sk;
698 struct sock *sk;
722 static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
731 static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
733 struct sock *sk;
746 static struct sock *__l2cap_get_sock_by_psm(int state, __le16 psm, bdaddr_t *src)
748 struct sock *sk = NULL, *sk1 = NULL;
770 static inline struct sock *l2cap_get_sock_by_psm(int state, __le16 psm, bdaddr_t *src)
772 struct sock *s;
781 static void l2cap_sock_destruct(struct sock *sk)
789 static void l2cap_sock_cleanup_listen(struct sock *parent)
791 struct sock *sk;
806 static void l2cap_sock_kill(struct sock *sk)
819 static void __l2cap_sock_close(struct sock *sk, int reason)
874 static void l2cap_sock_close(struct sock *sk)
883 static void l2cap_sock_init(struct sock *sk, struct sock *parent)
935 static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int proto, gfp_t prio)
937 struct sock *sk;
943 sock_init_data(sock, sk);
960 static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol,
963 struct sock *sk;
965 BT_DBG("sock %p", sock);
967 sock->state = SS_UNCONNECTED;
969 if (sock->type != SOCK_SEQPACKET && sock->type != SOCK_STREAM &&
970 sock->type != SOCK_DGRAM && sock->type != SOCK_RAW)
973 if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW))
976 sock->ops = &l2cap_sock_ops;
978 sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC);
986 static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
988 struct sock *sk = sock->sk;
1040 static int l2cap_do_connect(struct sock *sk)
1131 static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags)
1133 struct sock *sk = sock->sk;
1209 static int l2cap_sock_listen(struct socket *sock, int backlog)
1211 struct sock *sk = sock->sk;
1218 if ((sock->type != SOCK_SEQPACKET && sock->type != SOCK_STREAM)
1268 static int l2cap_sock_accept(struct socket *sock, struct socket *newsock, int flags)
1271 struct sock *sk = sock->sk, *nsk;
1324 static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
1327 struct sock *sk = sock->sk;
1329 BT_DBG("sock %p, sk %p", sock, sk);
1347 static int __l2cap_wait_ack(struct sock *sk)
1380 struct sock *sk = (void *) arg;
1400 struct sock *sk = (void *) arg;
1414 static void l2cap_drop_acked_frames(struct sock *sk)
1433 static inline void l2cap_do_send(struct sock *sk, struct sk_buff *skb)
1442 static void l2cap_streaming_send(struct sock *sk)
1464 static void l2cap_retransmit_one_frame(struct sock *sk, u8 tx_seq)
1511 static int l2cap_ertm_send(struct sock *sk)
1571 static int l2cap_retransmit_frames(struct sock *sk)
1586 struct sock *sk = (struct sock *)pi;
1605 static void l2cap_send_srejtail(struct sock *sk)
1619 static inline int l2cap_skbuff_fromiovec(struct sock *sk, struct msghdr *msg, int len, int count, struct sk_buff *skb)
1651 static struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len)
1680 static struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len)
1708 static struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen)
1753 static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len)
1799 static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len)
1801 struct sock *sk = sock->sk;
1807 BT_DBG("sock %p, sk %p", sock, sk);
1901 static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags)
1903 struct sock *sk = sock->sk;
1937 return bt_sock_recvmsg(iocb, sock, msg, len, flags);
1940 static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __user *optval, unsigned int optlen)
1942 struct sock *sk = sock->sk;
2025 static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen)
2027 struct sock *sk = sock->sk;
2035 return l2cap_sock_setsockopt_old(sock, optname, optval, optlen);
2090 static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen)
2092 struct sock *sk = sock->sk;
2174 static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
2176 struct sock *sk = sock->sk;
2183 return l2cap_sock_getsockopt_old(sock, optname, optval, optlen);
2229 static int l2cap_sock_shutdown(struct socket *sock, int how)
2231 struct sock *sk = sock->sk;
2234 BT_DBG("sock %p, sk %p", sock, sk);
2260 static int l2cap_sock_release(struct socket *sock)
2262 struct sock *sk = sock->sk;
2265 BT_DBG("sock %p, sk %p", sock, sk);
2270 err = l2cap_sock_shutdown(sock, 2);
2277 static void l2cap_chan_ready(struct sock *sk)
2279 struct sock *parent = bt_sk(sk)->parent;
2305 struct sock *sk;
2452 struct sock *sk = (void *) arg;
2459 static inline void l2cap_ertm_init(struct sock *sk)
2495 static int l2cap_build_conf_req(struct sock *sk, void *data)
2596 static int l2cap_parse_conf_req(struct sock *sk, void *data)
2750 static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data, u16 *result)
2819 static int l2cap_build_conf_rsp(struct sock *sk, void *data, u16 result, u16 flags)
2833 static void l2cap_conf_rfc_get(struct sock *sk, void *rsp, int len)
2893 struct sock *parent, *sk = NULL;
3018 struct sock *sk;
3084 struct sock *sk;
3167 struct sock *sk;
3247 struct sock *sk;
3275 struct sock *sk;
3486 static inline void l2cap_send_i_or_rr_or_rnr(struct sock *sk)
3513 static int l2cap_add_to_srej_queue(struct sock *sk, struct sk_buff *skb, u8 tx_seq, u8 sar)
3556 static int l2cap_ertm_reassembly_sdu(struct sock *sk, struct sk_buff *skb, u16 control)
3664 static int l2cap_try_push_rx_skb(struct sock *sk)
3709 struct sock *sk = (struct sock *)pi;
3751 static int l2cap_push_rx_skb(struct sock *sk, struct sk_buff *skb, u16 control)
3790 static int l2cap_streaming_reassembly_sdu(struct sock *sk, struct sk_buff *skb, u16 control)
3884 static void l2cap_check_srej_gap(struct sock *sk, u8 tx_seq)
3902 static void l2cap_resend_srejframe(struct sock *sk, u8 tx_seq)
3922 static void l2cap_send_srejframe(struct sock *sk, u8 tx_seq)
3941 static inline int l2cap_data_channel_iframe(struct sock *sk, u16 rx_control, struct sk_buff *skb)
4077 static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control)
4122 static inline void l2cap_data_channel_rejframe(struct sock *sk, u16 rx_control)
4146 static inline void l2cap_data_channel_srejframe(struct sock *sk, u16 rx_control)
4183 static inline void l2cap_data_channel_rnrframe(struct sock *sk, u16 rx_control)
4210 static inline int l2cap_data_channel_sframe(struct sock *sk, u16 rx_control, struct sk_buff *skb)
4244 static int l2cap_ertm_data_rcv(struct sock *sk, struct sk_buff *skb)
4316 struct sock *sk;
4404 struct sock *sk;
4469 register struct sock *sk;
4542 static inline void l2cap_check_encryption(struct sock *sk, u8 encrypt)
4563 struct sock *sk;
4723 struct sock *sk;