Searched refs:sock (Results 1 - 200 of 779) sorted by relevance

1234

/linux-4.1.27/include/net/netns/
H A Ddccp.h4 struct sock;
7 struct sock *v4_ctl_sk;
8 struct sock *v6_ctl_sk;
H A Dipv4.h18 struct sock;
51 struct sock *fibnl;
53 struct sock * __percpu *icmp_sk;
54 struct sock *mc_autojoin_sk;
57 struct sock * __percpu *tcp_sk;
H A Dipv6.h68 struct sock **icmp_sk;
69 struct sock *ndisc_sk;
70 struct sock *tcp_sk;
71 struct sock *igmp_sk;
72 struct sock *mc_autojoin_sk;
/linux-4.1.27/include/net/
H A Drawv6.h10 int rawv6_rcv(struct sock *sk, struct sk_buff *skb);
13 int rawv6_mh_filter_register(int (*filter)(struct sock *sock,
15 int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock,
H A Dllc_c_ev.h15 #include <net/sock.h>
128 typedef int (*llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb);
129 typedef int (*llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb);
131 int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb);
132 int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb);
133 int llc_conn_ev_disc_req(struct sock *sk, struct sk_buff *skb);
134 int llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb);
135 int llc_conn_ev_local_busy_detected(struct sock *sk, struct sk_buff *skb);
136 int llc_conn_ev_local_busy_cleared(struct sock *sk, struct sk_buff *skb);
137 int llc_conn_ev_rx_bad_pdu(struct sock *sk, struct sk_buff *skb);
138 int llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb);
139 int llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
140 int llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
141 int llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk,
143 int llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
144 int llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk,
146 int llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk,
148 int llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
149 int llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb);
150 int llc_conn_ev_rx_ua_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
151 int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb);
152 int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
153 int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk,
155 int llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk,
157 int llc_conn_ev_p_tmr_exp(struct sock *sk, struct sk_buff *skb);
158 int llc_conn_ev_ack_tmr_exp(struct sock *sk, struct sk_buff *skb);
159 int llc_conn_ev_rej_tmr_exp(struct sock *sk, struct sk_buff *skb);
160 int llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb);
161 int llc_conn_ev_sendack_tmr_exp(struct sock *sk, struct sk_buff *skb);
163 int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
164 int llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
165 int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk,
167 int llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk,
169 int llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
170 int llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
171 int llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk,
173 int llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk,
175 int llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
176 int llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
177 int llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
178 int llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
179 int llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
180 int llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
181 int llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
182 int llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
183 int llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
184 int llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
185 int llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
186 int llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
187 int llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
188 int llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
189 int llc_conn_ev_rx_any_frame(struct sock *sk, struct sk_buff *skb);
190 int llc_conn_ev_tx_buffer_full(struct sock *sk, struct sk_buff *skb);
191 int llc_conn_ev_init_p_f_cycle(struct sock *sk, struct sk_buff *skb);
194 int llc_conn_ev_qlfy_data_flag_eq_1(struct sock *sk, struct sk_buff *skb);
195 int llc_conn_ev_qlfy_data_flag_eq_0(struct sock *sk, struct sk_buff *skb);
196 int llc_conn_ev_qlfy_data_flag_eq_2(struct sock *sk, struct sk_buff *skb);
197 int llc_conn_ev_qlfy_p_flag_eq_1(struct sock *sk, struct sk_buff *skb);
198 int llc_conn_ev_qlfy_last_frame_eq_1(struct sock *sk, struct sk_buff *skb);
199 int llc_conn_ev_qlfy_last_frame_eq_0(struct sock *sk, struct sk_buff *skb);
200 int llc_conn_ev_qlfy_p_flag_eq_0(struct sock *sk, struct sk_buff *skb);
201 int llc_conn_ev_qlfy_p_flag_eq_f(struct sock *sk, struct sk_buff *skb);
202 int llc_conn_ev_qlfy_remote_busy_eq_0(struct sock *sk, struct sk_buff *skb);
203 int llc_conn_ev_qlfy_remote_busy_eq_1(struct sock *sk, struct sk_buff *skb);
204 int llc_conn_ev_qlfy_retry_cnt_lt_n2(struct sock *sk, struct sk_buff *skb);
205 int llc_conn_ev_qlfy_retry_cnt_gte_n2(struct sock *sk, struct sk_buff *skb);
206 int llc_conn_ev_qlfy_s_flag_eq_1(struct sock *sk, struct sk_buff *skb);
207 int llc_conn_ev_qlfy_s_flag_eq_0(struct sock *sk, struct sk_buff *skb);
208 int llc_conn_ev_qlfy_cause_flag_eq_1(struct sock *sk, struct sk_buff *skb);
209 int llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, struct sk_buff *skb);
210 int llc_conn_ev_qlfy_set_status_conn(struct sock *sk, struct sk_buff *skb);
211 int llc_conn_ev_qlfy_set_status_disc(struct sock *sk, struct sk_buff *skb);
212 int llc_conn_ev_qlfy_set_status_failed(struct sock *sk, struct sk_buff *skb);
213 int llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk,
215 int llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, struct sk_buff *skb);
216 int llc_conn_ev_qlfy_set_status_conflict(struct sock *sk, struct sk_buff *skb);
217 int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, struct sk_buff *skb);
219 static __inline__ int llc_conn_space(struct sock *sk, struct sk_buff *skb) llc_conn_space()
H A Dllc_c_ac.h90 typedef int (*llc_conn_action_t)(struct sock *sk, struct sk_buff *skb);
92 int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb);
93 int llc_conn_ac_conn_ind(struct sock *sk, struct sk_buff *skb);
94 int llc_conn_ac_conn_confirm(struct sock *sk, struct sk_buff *skb);
95 int llc_conn_ac_data_ind(struct sock *sk, struct sk_buff *skb);
96 int llc_conn_ac_disc_ind(struct sock *sk, struct sk_buff *skb);
97 int llc_conn_ac_rst_ind(struct sock *sk, struct sk_buff *skb);
98 int llc_conn_ac_rst_confirm(struct sock *sk, struct sk_buff *skb);
99 int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock *sk,
101 int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk,
103 int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb);
104 int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb);
105 int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb);
106 int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb);
107 int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb);
108 int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb);
109 int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb);
110 int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
111 int llc_conn_ac_resend_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
112 int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk,
114 int llc_conn_ac_resend_i_rsp_f_set_1(struct sock *sk, struct sk_buff *skb);
115 int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb);
116 int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb);
117 int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
118 int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb);
119 int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb);
120 int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
121 int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb);
122 int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
123 int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb);
124 int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb);
125 int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb);
126 int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
127 int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb);
128 int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb);
129 int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb);
130 int llc_conn_ac_set_s_flag_0(struct sock *sk, struct sk_buff *skb);
131 int llc_conn_ac_set_s_flag_1(struct sock *sk, struct sk_buff *skb);
132 int llc_conn_ac_start_p_timer(struct sock *sk, struct sk_buff *skb);
133 int llc_conn_ac_start_ack_timer(struct sock *sk, struct sk_buff *skb);
134 int llc_conn_ac_start_rej_timer(struct sock *sk, struct sk_buff *skb);
135 int llc_conn_ac_start_ack_tmr_if_not_running(struct sock *sk,
137 int llc_conn_ac_stop_ack_timer(struct sock *sk, struct sk_buff *skb);
138 int llc_conn_ac_stop_p_timer(struct sock *sk, struct sk_buff *skb);
139 int llc_conn_ac_stop_rej_timer(struct sock *sk, struct sk_buff *skb);
140 int llc_conn_ac_stop_all_timers(struct sock *sk, struct sk_buff *skb);
141 int llc_conn_ac_stop_other_timers(struct sock *sk, struct sk_buff *skb);
142 int llc_conn_ac_upd_nr_received(struct sock *sk, struct sk_buff *skb);
143 int llc_conn_ac_inc_tx_win_size(struct sock *sk, struct sk_buff *skb);
144 int llc_conn_ac_dec_tx_win_size(struct sock *sk, struct sk_buff *skb);
145 int llc_conn_ac_upd_p_flag(struct sock *sk, struct sk_buff *skb);
146 int llc_conn_ac_set_data_flag_2(struct sock *sk, struct sk_buff *skb);
147 int llc_conn_ac_set_data_flag_0(struct sock *sk, struct sk_buff *skb);
148 int llc_conn_ac_set_data_flag_1(struct sock *sk, struct sk_buff *skb);
149 int llc_conn_ac_set_data_flag_1_if_data_flag_eq_0(struct sock *sk,
151 int llc_conn_ac_set_p_flag_0(struct sock *sk, struct sk_buff *skb);
152 int llc_conn_ac_set_remote_busy_0(struct sock *sk, struct sk_buff *skb);
153 int llc_conn_ac_set_retry_cnt_0(struct sock *sk, struct sk_buff *skb);
154 int llc_conn_ac_set_cause_flag_0(struct sock *sk, struct sk_buff *skb);
155 int llc_conn_ac_set_cause_flag_1(struct sock *sk, struct sk_buff *skb);
156 int llc_conn_ac_inc_retry_cnt_by_1(struct sock *sk, struct sk_buff *skb);
157 int llc_conn_ac_set_vr_0(struct sock *sk, struct sk_buff *skb);
158 int llc_conn_ac_inc_vr_by_1(struct sock *sk, struct sk_buff *skb);
159 int llc_conn_ac_set_vs_0(struct sock *sk, struct sk_buff *skb);
160 int llc_conn_ac_set_vs_nr(struct sock *sk, struct sk_buff *skb);
161 int llc_conn_ac_rst_vs(struct sock *sk, struct sk_buff *skb);
162 int llc_conn_ac_upd_vs(struct sock *sk, struct sk_buff *skb);
163 int llc_conn_disc(struct sock *sk, struct sk_buff *skb);
164 int llc_conn_reset(struct sock *sk, struct sk_buff *skb);
165 int llc_conn_ac_disc_confirm(struct sock *sk, struct sk_buff *skb);
167 int llc_conn_ac_send_ack_if_needed(struct sock *sk, struct sk_buff *skb);
168 int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb);
169 int llc_conn_ac_adjust_npta_by_rnr(struct sock *sk, struct sk_buff *skb);
170 int llc_conn_ac_rst_sendack_flag(struct sock *sk, struct sk_buff *skb);
171 int llc_conn_ac_send_i_rsp_as_ack(struct sock *sk, struct sk_buff *skb);
172 int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb);
179 void llc_conn_set_p_flag(struct sock *sk, u8 value);
H A Dinet_common.h12 struct sock;
16 int inet_release(struct socket *sock);
17 int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
19 int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
21 int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr,
23 int inet_accept(struct socket *sock, struct socket *newsock, int flags);
24 int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size);
25 ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
27 int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
29 int inet_shutdown(struct socket *sock, int how);
30 int inet_listen(struct socket *sock, int backlog);
31 void inet_sock_destruct(struct sock *sk);
32 int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
33 int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len,
35 int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
36 int inet_ctl_sock_create(struct sock **sk, unsigned short family,
39 int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
42 static inline void inet_ctl_sock_destroy(struct sock *sk) inet_ctl_sock_destroy()
H A Dtimewait_sock.h16 #include <net/sock.h>
22 int (*twsk_unique)(struct sock *sk,
23 struct sock *sktw, void *twp);
24 void (*twsk_destructor)(struct sock *sk);
27 static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) twsk_unique()
34 static inline void twsk_destructor(struct sock *sk) twsk_destructor()
H A Dinet_connection_sock.h39 int (*queue_xmit)(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
40 void (*send_check)(struct sock *sk, struct sk_buff *skb);
41 int (*rebuild_header)(struct sock *sk);
42 void (*sk_rx_dst_set)(struct sock *sk, const struct sk_buff *skb);
43 int (*conn_request)(struct sock *sk, struct sk_buff *skb);
44 struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb,
50 int (*setsockopt)(struct sock *sk, int level, int optname,
52 int (*getsockopt)(struct sock *sk, int level, int optname,
55 int (*compat_setsockopt)(struct sock *sk,
58 int (*compat_getsockopt)(struct sock *sk,
62 void (*addr2sockaddr)(struct sock *sk, struct sockaddr *);
63 int (*bind_conflict)(const struct sock *sk,
65 void (*mtu_reduced)(struct sock *sk);
68 /** inet_connection_sock - INET connection oriented sock
100 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
145 static inline struct inet_connection_sock *inet_csk(const struct sock *sk) inet_csk()
150 static inline void *inet_csk_ca(const struct sock *sk) inet_csk_ca()
155 struct sock *inet_csk_clone_lock(const struct sock *sk,
166 void inet_csk_init_xmit_timers(struct sock *sk,
170 void inet_csk_clear_xmit_timers(struct sock *sk);
172 static inline void inet_csk_schedule_ack(struct sock *sk) inet_csk_schedule_ack()
177 static inline int inet_csk_ack_scheduled(const struct sock *sk) inet_csk_ack_scheduled()
182 static inline void inet_csk_delack_init(struct sock *sk) inet_csk_delack_init()
187 void inet_csk_delete_keepalive_timer(struct sock *sk);
188 void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout);
194 static inline void inet_csk_clear_xmit_timer(struct sock *sk, const int what) inet_csk_clear_xmit_timer()
219 static inline void inet_csk_reset_xmit_timer(struct sock *sk, const int what, inet_csk_reset_xmit_timer()
259 struct sock *inet_csk_accept(struct sock *sk, int flags, int *err);
261 struct request_sock *inet_csk_search_req(struct sock *sk,
265 int inet_csk_bind_conflict(const struct sock *sk,
267 int inet_csk_get_port(struct sock *sk, unsigned short snum);
269 struct dst_entry *inet_csk_route_req(struct sock *sk, struct flowi4 *fl4,
271 struct dst_entry *inet_csk_route_child_sock(struct sock *sk, struct sock *newsk,
274 static inline void inet_csk_reqsk_queue_add(struct sock *sk, inet_csk_reqsk_queue_add()
276 struct sock *child) inet_csk_reqsk_queue_add()
281 void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
284 static inline void inet_csk_reqsk_queue_added(struct sock *sk, inet_csk_reqsk_queue_added()
290 static inline int inet_csk_reqsk_queue_len(const struct sock *sk) inet_csk_reqsk_queue_len()
295 static inline int inet_csk_reqsk_queue_young(const struct sock *sk) inet_csk_reqsk_queue_young()
300 static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk) inet_csk_reqsk_queue_is_full()
305 void inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req);
307 void inet_csk_destroy_sock(struct sock *sk);
308 void inet_csk_prepare_forced_close(struct sock *sk);
313 static inline unsigned int inet_csk_listen_poll(const struct sock *sk) inet_csk_listen_poll()
319 int inet_csk_listen_start(struct sock *sk, const int nr_table_entries);
320 void inet_csk_listen_stop(struct sock *sk);
322 void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
324 int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname,
326 int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname,
329 struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu);
H A Daf_unix.h7 #include <net/sock.h>
13 struct sock *unix_get_socket(struct file *filp);
14 struct sock *unix_peer_get(struct sock *);
53 struct sock sk;
57 struct sock *peer;
69 static inline struct unix_sock *unix_sk(struct sock *sk) unix_sk()
76 long unix_inq_len(struct sock *sk);
77 long unix_outq_len(struct sock *sk);
H A Dcompat.h5 struct sock;
32 int compat_sock_get_timestamp(struct sock *, struct timeval __user *);
33 int compat_sock_get_timestampns(struct sock *, struct timespec __user *);
58 int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *,
61 int compat_mc_setsockopt(struct sock *, int, int, char __user *, unsigned int,
62 int (*)(struct sock *, int, int, char __user *,
64 int compat_mc_getsockopt(struct sock *, int, int, char __user *, int __user *,
65 int (*)(struct sock *, int, int, char __user *,
H A Dinet6_connection_sock.h22 struct sock;
25 int inet6_csk_bind_conflict(const struct sock *sk,
28 struct dst_entry *inet6_csk_route_req(struct sock *sk, struct flowi6 *fl6,
31 struct request_sock *inet6_csk_search_req(struct sock *sk,
37 void inet6_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
40 void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
42 int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
44 struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu);
H A Dscm.h39 int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm);
44 static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm) unix_get_peersec_dgram() argument
46 security_socket_getpeersec_dgram(sock, NULL, &scm->secid); unix_get_peersec_dgram()
49 static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm) unix_get_peersec_dgram() argument
75 static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, scm_send() argument
83 unix_get_peersec_dgram(sock, scm); scm_send()
86 return __scm_send(sock, msg, scm); scm_send()
90 static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) scm_passec() argument
96 if (test_bit(SOCK_PASSSEC, &sock->flags)) { scm_passec()
106 static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) scm_passec() argument
110 static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, scm_recv() argument
114 if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp) scm_recv()
120 if (test_bit(SOCK_PASSCRED, &sock->flags)) { scm_recv()
132 scm_passec(sock, msg, scm); scm_recv()
H A Dnetrom.h13 #include <net/sock.h>
64 struct sock sock; member in struct:nr_sock
187 void nr_destroy_socket(struct sock *);
194 int nr_process_rx_frame(struct sock *, struct sk_buff *);
202 void nr_output(struct sock *, struct sk_buff *);
203 void nr_send_nak_frame(struct sock *);
204 void nr_kick(struct sock *);
205 void nr_transmit_buffer(struct sock *, struct sk_buff *);
206 void nr_establish_data_link(struct sock *);
207 void nr_enquiry_response(struct sock *);
208 void nr_check_iframes_acked(struct sock *, unsigned short);
222 void nr_clear_queues(struct sock *);
223 void nr_frames_acked(struct sock *, unsigned short);
224 void nr_requeue_frames(struct sock *);
225 int nr_validate_nr(struct sock *, unsigned short);
226 int nr_in_rx_window(struct sock *, unsigned short);
227 void nr_write_internal(struct sock *, int);
249 void nr_disconnect(struct sock *, int);
252 void nr_init_timers(struct sock *sk);
253 void nr_start_heartbeat(struct sock *);
254 void nr_start_t1timer(struct sock *);
255 void nr_start_t2timer(struct sock *);
256 void nr_start_t4timer(struct sock *);
257 void nr_start_idletimer(struct sock *);
258 void nr_stop_heartbeat(struct sock *);
259 void nr_stop_t1timer(struct sock *);
260 void nr_stop_t2timer(struct sock *);
261 void nr_stop_t4timer(struct sock *);
262 void nr_stop_idletimer(struct sock *);
263 int nr_t1timer_running(struct sock *);
H A Dping.h34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
36 void (*ip6_datagram_recv_common_ctl)(struct sock *sk,
39 void (*ip6_datagram_recv_specific_ctl)(struct sock *sk,
43 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
67 int ping_get_port(struct sock *sk, unsigned short ident);
68 void ping_hash(struct sock *sk);
69 void ping_unhash(struct sock *sk);
71 int ping_init_sock(struct sock *sk);
72 void ping_close(struct sock *sk, long timeout);
73 int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len);
78 int ping_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
82 int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len);
83 int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
H A Dtransp_v6.h33 int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
36 void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
38 void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
40 void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg,
43 int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
47 void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
55 void inet6_destroy_sock(struct sock *sk);
H A Dx25.h14 #include <net/sock.h>
148 struct sock sk;
177 static inline struct x25_sock *x25_sk(const struct sock *sk) x25_sk()
196 struct sock *x25_find_socket(unsigned int, struct x25_neigh *);
197 void x25_destroy_socket_from_timer(struct sock *);
213 int x25_negotiate_facilities(struct sk_buff *, struct sock *,
226 int x25_process_rx_frame(struct sock *, struct sk_buff *);
227 int x25_backlog_rcv(struct sock *, struct sk_buff *);
255 int x25_output(struct sock *, struct sk_buff *);
256 void x25_kick(struct sock *);
257 void x25_enquiry_response(struct sock *);
278 void x25_clear_queues(struct sock *);
279 void x25_frames_acked(struct sock *, unsigned short);
280 void x25_requeue_frames(struct sock *);
281 int x25_validate_nr(struct sock *, unsigned short);
282 void x25_write_internal(struct sock *, int);
283 int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *,
285 void x25_disconnect(struct sock *, int, unsigned char, unsigned char);
288 void x25_init_timers(struct sock *sk);
289 void x25_start_heartbeat(struct sock *);
290 void x25_start_t2timer(struct sock *);
291 void x25_start_t21timer(struct sock *);
292 void x25_start_t22timer(struct sock *);
293 void x25_start_t23timer(struct sock *);
294 void x25_stop_heartbeat(struct sock *);
295 void x25_stop_timer(struct sock *);
296 unsigned long x25_display_timer(struct sock *);
297 void x25_check_rbuf(struct sock *);
H A Ddn_neigh.h21 int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb);
22 int dn_neigh_endnode_hello(struct sock *sk, struct sk_buff *skb);
25 int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb);
H A Ddn_nsp.h18 void dn_nsp_send_data_ack(struct sock *sk);
19 void dn_nsp_send_oth_ack(struct sock *sk);
20 void dn_nsp_delayed_ack(struct sock *sk);
21 void dn_send_conn_ack(struct sock *sk);
22 void dn_send_conn_conf(struct sock *sk, gfp_t gfp);
23 void dn_nsp_send_disc(struct sock *sk, unsigned char type,
27 void dn_nsp_send_link(struct sock *sk, unsigned char lsflags, char fcval);
28 void dn_nsp_send_conninit(struct sock *sk, unsigned char flags);
30 void dn_nsp_output(struct sock *sk);
31 int dn_nsp_check_xmit_queue(struct sock *sk, struct sk_buff *skb,
33 void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, gfp_t gfp,
35 unsigned long dn_nsp_persist(struct sock *sk);
36 int dn_nsp_xmit_timeout(struct sock *sk);
39 int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
41 struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri);
42 struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int noblock,
197 static __inline__ int dn_congested(struct sock *sk) dn_congested()
H A Dllc_conn.h16 #include <net/sock.h>
33 /* struct sock must be the first member of llc_sock */
34 struct sock sk;
35 struct sockaddr_llc addr; /* address sock is bound to */
83 static inline struct llc_sock *llc_sk(const struct sock *sk) llc_sk()
98 struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority,
100 void llc_sk_free(struct sock *sk);
102 void llc_sk_reset(struct sock *sk);
105 int llc_conn_state_process(struct sock *sk, struct sk_buff *skb);
106 void llc_conn_send_pdu(struct sock *sk, struct sk_buff *skb);
107 void llc_conn_rtn_pdu(struct sock *sk, struct sk_buff *skb);
108 void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, u8 first_p_bit);
109 void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit);
110 int llc_conn_remove_acked_pdus(struct sock *conn, u8 nr, u16 *how_many_unacked);
111 struct sock *llc_lookup_established(struct llc_sap *sap, struct llc_addr *daddr,
113 void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk);
114 void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk);
H A Dtcp.h40 #include <net/sock.h>
53 void tcp_time_wait(struct sock *sk, int state, int timeo);
306 static inline bool tcp_out_of_memory(struct sock *sk) tcp_out_of_memory()
314 static inline bool tcp_too_many_orphans(struct sock *sk, int shift) tcp_too_many_orphans()
327 bool tcp_check_oom(struct sock *sk, int shift);
330 static inline void tcp_synq_overflow(struct sock *sk) tcp_synq_overflow()
336 static inline bool tcp_synq_no_recent_overflow(const struct sock *sk) tcp_synq_no_recent_overflow()
354 void tcp_shutdown(struct sock *sk, int how);
360 int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
361 int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
363 void tcp_release_cb(struct sock *sk);
365 void tcp_write_timer_handler(struct sock *sk);
366 void tcp_delack_timer_handler(struct sock *sk);
367 int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
368 int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
370 void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
372 void tcp_rcv_space_adjust(struct sock *sk);
373 int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
374 void tcp_twsk_destructor(struct sock *sk);
379 static inline void tcp_dec_quickack_mode(struct sock *sk, tcp_dec_quickack_mode()
410 struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
412 int tcp_child_process(struct sock *parent, struct sock *child,
414 void tcp_enter_loss(struct sock *sk);
416 void tcp_update_metrics(struct sock *sk);
417 void tcp_init_metrics(struct sock *sk);
421 bool tcp_remember_stamp(struct sock *sk);
423 void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst);
425 void tcp_close(struct sock *sk, long timeout);
426 void tcp_init_sock(struct sock *sk);
427 unsigned int tcp_poll(struct file *file, struct socket *sock,
429 int tcp_getsockopt(struct sock *sk, int level, int optname,
431 int tcp_setsockopt(struct sock *sk, int level, int optname,
433 int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
435 int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
437 void tcp_set_keepalive(struct sock *sk, int val);
439 int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
450 void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
451 void tcp_v4_mtu_reduced(struct sock *sk);
452 void tcp_req_err(struct sock *sk, u32 seq);
453 int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
454 struct sock *tcp_create_openreq_child(struct sock *sk,
457 void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst);
458 struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
461 int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
462 int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
463 int tcp_connect(struct sock *sk);
464 struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
467 int tcp_disconnect(struct sock *sk, int flags);
469 void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
470 int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size);
471 void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
476 struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb);
498 __u32 cookie_v4_init_sequence(struct sock *sk, const struct sk_buff *skb,
508 struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
512 __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
517 void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
519 bool tcp_may_send_now(struct sock *sk);
520 int __tcp_retransmit_skb(struct sock *, struct sk_buff *);
521 int tcp_retransmit_skb(struct sock *, struct sk_buff *);
522 void tcp_retransmit_timer(struct sock *sk);
523 void tcp_xmit_retransmit_queue(struct sock *);
524 void tcp_simple_retransmit(struct sock *);
525 int tcp_trim_head(struct sock *, struct sk_buff *, u32);
526 int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int, gfp_t);
528 void tcp_send_probe0(struct sock *);
529 void tcp_send_partial(struct sock *);
530 int tcp_write_wakeup(struct sock *);
531 void tcp_send_fin(struct sock *sk);
532 void tcp_send_active_reset(struct sock *sk, gfp_t priority);
533 int tcp_send_synack(struct sock *);
534 void tcp_push_one(struct sock *, unsigned int mss_now);
535 void tcp_send_ack(struct sock *sk);
536 void tcp_send_delayed_ack(struct sock *sk);
537 void tcp_send_loss_probe(struct sock *sk);
538 bool tcp_schedule_loss_probe(struct sock *sk);
541 void tcp_resume_early_retransmit(struct sock *sk);
542 void tcp_rearm_rto(struct sock *sk);
543 void tcp_reset(struct sock *sk);
546 void tcp_init_xmit_timers(struct sock *); tcp_clear_xmit_timers()
547 static inline void tcp_clear_xmit_timers(struct sock *sk) tcp_clear_xmit_timers()
552 unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu);
553 unsigned int tcp_current_mss(struct sock *sk);
579 void tcp_get_info(struct sock *, struct tcp_info *);
584 int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
587 void tcp_initialize_rcv_mss(struct sock *sk);
589 int tcp_mtu_to_mss(struct sock *sk, int pmtu);
590 int tcp_mss_to_mtu(struct sock *sk, int mss);
591 void tcp_mtup_init(struct sock *sk);
592 void tcp_init_buffer_space(struct sock *sk);
594 static inline void tcp_bound_rto(const struct sock *sk) tcp_bound_rto()
617 static inline void tcp_fast_path_check(struct sock *sk) tcp_fast_path_check()
629 static inline u32 tcp_rto_min(struct sock *sk) tcp_rto_min()
639 static inline u32 tcp_rto_min_us(struct sock *sk) tcp_rto_min_us()
666 u32 __tcp_select_window(struct sock *sk);
668 void tcp_send_window_probe(struct sock *sk);
815 void (*init)(struct sock *sk);
817 void (*release)(struct sock *sk);
820 u32 (*ssthresh)(struct sock *sk);
822 void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked);
824 void (*set_state)(struct sock *sk, u8 new_state);
826 void (*cwnd_event)(struct sock *sk, enum tcp_ca_event ev);
828 void (*in_ack_event)(struct sock *sk, u32 flags);
830 u32 (*undo_cwnd)(struct sock *sk);
832 void (*pkts_acked)(struct sock *sk, u32 num_acked, s32 rtt_us);
834 size_t (*get_info)(struct sock *sk, u32 ext, int *attr,
844 void tcp_assign_congestion_control(struct sock *sk);
845 void tcp_init_congestion_control(struct sock *sk);
846 void tcp_cleanup_congestion_control(struct sock *sk);
852 int tcp_set_congestion_control(struct sock *sk, const char *name);
856 u32 tcp_reno_ssthresh(struct sock *sk);
857 void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked);
871 static inline bool tcp_ca_needs_ecn(const struct sock *sk) tcp_ca_needs_ecn()
878 static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) tcp_set_ca_state()
887 static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event) tcp_ca_event()
969 static inline bool tcp_in_cwnd_reduction(const struct sock *sk) tcp_in_cwnd_reduction()
979 static inline __u32 tcp_current_ssthresh(const struct sock *sk) tcp_current_ssthresh()
994 void tcp_enter_cwr(struct sock *sk);
1035 static inline bool tcp_is_cwnd_limited(const struct sock *sk) tcp_is_cwnd_limited()
1046 static inline void tcp_check_probe_timer(struct sock *sk) tcp_check_probe_timer()
1096 bool tcp_prequeue(struct sock *sk, struct sk_buff *skb);
1107 void tcp_set_state(struct sock *sk, int state);
1109 void tcp_done(struct sock *sk);
1132 static inline int tcp_space(const struct sock *sk) tcp_space()
1138 static inline int tcp_full_space(const struct sock *sk) tcp_full_space()
1144 struct sock *sk, struct dst_entry *dst);
1146 void tcp_enter_memory_pressure(struct sock *sk);
1171 static inline int tcp_fin_time(const struct sock *sk) tcp_fin_time()
1266 /* - sock block */
1303 const struct sock *sk, const struct sk_buff *skb);
1304 int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
1306 int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr,
1308 struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1309 const struct sock *addr_sk);
1312 struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
1317 static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, tcp_md5_do_lookup()
1341 void tcp_fastopen_cache_get(struct sock *sk, u16 *mss,
1344 void tcp_fastopen_cache_set(struct sock *sk, u16 mss,
1358 bool tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
1373 static inline void tcp_write_queue_purge(struct sock *sk) tcp_write_queue_purge()
1383 static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk) tcp_write_queue_head()
1388 static inline struct sk_buff *tcp_write_queue_tail(const struct sock *sk) tcp_write_queue_tail()
1393 static inline struct sk_buff *tcp_write_queue_next(const struct sock *sk, tcp_write_queue_next()
1399 static inline struct sk_buff *tcp_write_queue_prev(const struct sock *sk, tcp_write_queue_prev()
1414 static inline struct sk_buff *tcp_send_head(const struct sock *sk) tcp_send_head()
1419 static inline bool tcp_skb_is_last(const struct sock *sk, tcp_skb_is_last()
1425 static inline void tcp_advance_send_head(struct sock *sk, const struct sk_buff *skb) tcp_advance_send_head()
1433 static inline void tcp_check_send_head(struct sock *sk, struct sk_buff *skb_unlinked) tcp_check_send_head()
1439 static inline void tcp_init_send_head(struct sock *sk) tcp_init_send_head()
1444 static inline void __tcp_add_write_queue_tail(struct sock *sk, struct sk_buff *skb) __tcp_add_write_queue_tail()
1449 static inline void tcp_add_write_queue_tail(struct sock *sk, struct sk_buff *skb) tcp_add_write_queue_tail()
1462 static inline void __tcp_add_write_queue_head(struct sock *sk, struct sk_buff *skb) __tcp_add_write_queue_head()
1470 struct sock *sk) tcp_insert_write_queue_after()
1478 struct sock *sk) tcp_insert_write_queue_before()
1486 static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk) tcp_unlink_write_queue()
1491 static inline bool tcp_write_queue_empty(struct sock *sk) tcp_write_queue_empty()
1496 static inline void tcp_push_pending_frames(struct sock *sk) tcp_push_pending_frames()
1520 static inline void tcp_advance_highest_sack(struct sock *sk, struct sk_buff *skb) tcp_advance_highest_sack()
1526 static inline struct sk_buff *tcp_highest_sack(struct sock *sk) tcp_highest_sack()
1531 static inline void tcp_highest_sack_reset(struct sock *sk) tcp_highest_sack_reset()
1537 static inline void tcp_highest_sack_combine(struct sock *sk, tcp_highest_sack_combine()
1573 struct sock *syn_wait_sk;
1585 void tcp_v4_destroy_sock(struct sock *sk);
1599 static inline bool tcp_stream_memory_free(const struct sock *sk) tcp_stream_memory_free()
1612 int tcp_rtx_synack(struct sock *sk, struct request_sock *req);
1615 struct sock *sk, struct sk_buff *skb);
1620 struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk,
1621 const struct sock *addr_sk);
1624 const struct sock *sk,
1626 int (*md5_parse)(struct sock *sk,
1635 struct tcp_md5sig_key *(*req_md5_lookup)(struct sock *sk,
1636 const struct sock *addr_sk);
1639 const struct sock *sk,
1642 void (*init_req)(struct request_sock *req, struct sock *sk,
1645 __u32 (*cookie_init_seq)(struct sock *sk, const struct sk_buff *skb,
1648 struct dst_entry *(*route_req)(struct sock *sk, struct flowi *fl,
1652 int (*send_synack)(struct sock *sk, struct dst_entry *dst,
1655 void (*queue_hash_add)(struct sock *sk, struct request_sock *req,
1661 struct sock *sk, struct sk_buff *skb, cookie_init_sequence()
1668 struct sock *sk, struct sk_buff *skb, cookie_init_sequence()
H A Dsock.h8 * Version: @(#)sock.h 1.0.4 05/13/93
102 void SOCK_DEBUG(const struct sock *sk, const char *msg, ...) SOCK_DEBUG()
126 struct sock;
156 * for struct sock and struct inet_timewait_sock.
222 * struct sock - network layer representation of sockets
228 * @sk_wq: sock wait queue and async head
258 * @sk_prot_creator: sk_prot of original sock creator (see ipv6_setsockopt,
280 * @sk_timer: sock cleanup timer
294 * @sk_state_change: callback to indicate change in the state of the sock
299 * @sk_destruct: called at sock freeing time, i.e. when all refcnt == 0
301 struct sock { struct
435 void (*sk_state_change)(struct sock *sk);
436 void (*sk_data_ready)(struct sock *sk);
437 void (*sk_write_space)(struct sock *sk);
438 void (*sk_error_report)(struct sock *sk);
439 int (*sk_backlog_rcv)(struct sock *sk,
441 void (*sk_destruct)(struct sock *sk);
460 static inline int sk_peek_offset(struct sock *sk, int flags) sk_peek_offset()
468 static inline void sk_peek_offset_bwd(struct sock *sk, int val) sk_peek_offset_bwd()
478 static inline void sk_peek_offset_fwd(struct sock *sk, int val) sk_peek_offset_fwd()
487 static inline struct sock *sk_entry(const struct hlist_node *node) sk_entry()
489 return hlist_entry(node, struct sock, sk_node); sk_entry()
492 static inline struct sock *__sk_head(const struct hlist_head *head) __sk_head()
494 return hlist_entry(head->first, struct sock, sk_node); __sk_head()
497 static inline struct sock *sk_head(const struct hlist_head *head) sk_head()
502 static inline struct sock *__sk_nulls_head(const struct hlist_nulls_head *head) __sk_nulls_head()
504 return hlist_nulls_entry(head->first, struct sock, sk_nulls_node); __sk_nulls_head()
507 static inline struct sock *sk_nulls_head(const struct hlist_nulls_head *head) sk_nulls_head()
512 static inline struct sock *sk_next(const struct sock *sk) sk_next()
515 hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL; sk_next()
518 static inline struct sock *sk_nulls_next(const struct sock *sk) sk_nulls_next()
522 struct sock, sk_nulls_node) : sk_nulls_next()
526 static inline bool sk_unhashed(const struct sock *sk) sk_unhashed()
531 static inline bool sk_hashed(const struct sock *sk) sk_hashed()
546 static inline void __sk_del_node(struct sock *sk) __sk_del_node()
552 static inline bool __sk_del_node_init(struct sock *sk) __sk_del_node_init()
568 static inline void sock_hold(struct sock *sk) sock_hold()
576 static inline void __sock_put(struct sock *sk) __sock_put()
581 static inline bool sk_del_node_init(struct sock *sk) sk_del_node_init()
594 static inline bool __sk_nulls_del_node_init_rcu(struct sock *sk) __sk_nulls_del_node_init_rcu()
603 static inline bool sk_nulls_del_node_init_rcu(struct sock *sk) sk_nulls_del_node_init_rcu()
615 static inline void __sk_add_node(struct sock *sk, struct hlist_head *list) __sk_add_node()
620 static inline void sk_add_node(struct sock *sk, struct hlist_head *list) sk_add_node()
626 static inline void sk_add_node_rcu(struct sock *sk, struct hlist_head *list) sk_add_node_rcu()
632 static inline void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) __sk_nulls_add_node_rcu()
637 static inline void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) sk_nulls_add_node_rcu()
643 static inline void __sk_del_bind_node(struct sock *sk) __sk_del_bind_node()
648 static inline void sk_add_bind_node(struct sock *sk, sk_add_bind_node()
686 static inline struct user_namespace *sk_user_ns(struct sock *sk) sk_user_ns()
728 static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) sock_copy_flags()
733 static inline void sock_set_flag(struct sock *sk, enum sock_flags flag) sock_set_flag()
738 static inline void sock_reset_flag(struct sock *sk, enum sock_flags flag) sock_reset_flag()
743 static inline bool sock_flag(const struct sock *sk, enum sock_flags flag) sock_flag()
763 static inline gfp_t sk_gfp_atomic(struct sock *sk, gfp_t gfp_mask) sk_gfp_atomic()
768 static inline void sk_acceptq_removed(struct sock *sk) sk_acceptq_removed()
773 static inline void sk_acceptq_added(struct sock *sk) sk_acceptq_added()
778 static inline bool sk_acceptq_is_full(const struct sock *sk) sk_acceptq_is_full()
786 static inline int sk_stream_min_wspace(const struct sock *sk) sk_stream_min_wspace()
791 static inline int sk_stream_wspace(const struct sock *sk) sk_stream_wspace()
796 void sk_stream_write_space(struct sock *sk);
799 static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) __sk_add_backlog()
818 static inline bool sk_rcvqueues_full(const struct sock *sk, unsigned int limit) sk_rcvqueues_full()
826 static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb, sk_add_backlog()
845 int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb);
847 static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) sk_backlog_rcv()
855 static inline void sk_incoming_cpu_update(struct sock *sk) sk_incoming_cpu_update()
872 static inline void sock_rps_record_flow(const struct sock *sk) sock_rps_record_flow()
879 static inline void sock_rps_save_rxhash(struct sock *sk, sock_rps_save_rxhash()
888 static inline void sock_rps_reset_rxhash(struct sock *sk) sock_rps_reset_rxhash()
908 int sk_stream_wait_connect(struct sock *sk, long *timeo_p);
909 int sk_stream_wait_memory(struct sock *sk, long *timeo_p);
910 void sk_stream_wait_close(struct sock *sk, long timeo_p);
911 int sk_stream_error(struct sock *sk, int flags, int err);
912 void sk_stream_kill_queues(struct sock *sk);
913 void sk_set_memalloc(struct sock *sk);
914 void sk_clear_memalloc(struct sock *sk);
916 int sk_wait_data(struct sock *sk, long *timeo);
928 static inline void sk_prot_clear_nulls(struct sock *sk, int size) sk_prot_clear_nulls()
930 if (offsetof(struct sock, sk_node.next) != 0) sk_prot_clear_nulls()
931 memset(sk, 0, offsetof(struct sock, sk_node.next)); sk_prot_clear_nulls()
933 size - offsetof(struct sock, sk_node.pprev)); sk_prot_clear_nulls()
941 void (*close)(struct sock *sk,
943 int (*connect)(struct sock *sk,
946 int (*disconnect)(struct sock *sk, int flags);
948 struct sock * (*accept)(struct sock *sk, int flags, int *err);
950 int (*ioctl)(struct sock *sk, int cmd,
952 int (*init)(struct sock *sk);
953 void (*destroy)(struct sock *sk);
954 void (*shutdown)(struct sock *sk, int how);
955 int (*setsockopt)(struct sock *sk, int level,
958 int (*getsockopt)(struct sock *sk, int level,
962 int (*compat_setsockopt)(struct sock *sk,
966 int (*compat_getsockopt)(struct sock *sk,
970 int (*compat_ioctl)(struct sock *sk,
973 int (*sendmsg)(struct sock *sk, struct msghdr *msg,
975 int (*recvmsg)(struct sock *sk, struct msghdr *msg,
978 int (*sendpage)(struct sock *sk, struct page *page,
980 int (*bind)(struct sock *sk,
983 int (*backlog_rcv) (struct sock *sk,
986 void (*release_cb)(struct sock *sk);
989 void (*hash)(struct sock *sk);
990 void (*unhash)(struct sock *sk);
991 void (*rehash)(struct sock *sk);
992 int (*get_port)(struct sock *sk, unsigned short snum);
993 void (*clear_sk)(struct sock *sk, int size);
1000 bool (*stream_memory_free)(const struct sock *sk);
1002 void (*enter_memory_pressure)(struct sock *sk);
1092 static inline void sk_refcnt_debug_inc(struct sock *sk) sk_refcnt_debug_inc()
1097 static inline void sk_refcnt_debug_dec(struct sock *sk) sk_refcnt_debug_dec()
1104 static inline void sk_refcnt_debug_release(const struct sock *sk) sk_refcnt_debug_release()
1133 static inline bool sk_stream_memory_free(const struct sock *sk) sk_stream_memory_free()
1142 static inline bool sk_stream_is_writeable(const struct sock *sk) sk_stream_is_writeable()
1149 static inline bool sk_has_memory_pressure(const struct sock *sk) sk_has_memory_pressure()
1154 static inline bool sk_under_memory_pressure(const struct sock *sk) sk_under_memory_pressure()
1165 static inline void sk_leave_memory_pressure(struct sock *sk) sk_leave_memory_pressure()
1185 static inline void sk_enter_memory_pressure(struct sock *sk) sk_enter_memory_pressure()
1201 static inline long sk_prot_mem_limits(const struct sock *sk, int index) sk_prot_mem_limits()
1227 sk_memory_allocated(const struct sock *sk) sk_memory_allocated()
1238 sk_memory_allocated_add(struct sock *sk, int amt, int *parent_status) sk_memory_allocated_add()
1253 sk_memory_allocated_sub(struct sock *sk, int amt) sk_memory_allocated_sub()
1263 static inline void sk_sockets_allocated_dec(struct sock *sk) sk_sockets_allocated_dec()
1277 static inline void sk_sockets_allocated_inc(struct sock *sk) sk_sockets_allocated_inc()
1292 sk_sockets_allocated_read_positive(struct sock *sk) sk_sockets_allocated_read_positive()
1338 static inline void __sk_prot_rehash(struct sock *sk) __sk_prot_rehash()
1344 void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);
1379 int __sk_mem_schedule(struct sock *sk, int size, int kind);
1380 void __sk_mem_reclaim(struct sock *sk);
1392 static inline bool sk_has_account(struct sock *sk) sk_has_account()
1398 static inline bool sk_wmem_schedule(struct sock *sk, int size) sk_wmem_schedule()
1407 sk_rmem_schedule(struct sock *sk, struct sk_buff *skb, int size) sk_rmem_schedule()
1416 static inline void sk_mem_reclaim(struct sock *sk) sk_mem_reclaim()
1424 static inline void sk_mem_reclaim_partial(struct sock *sk) sk_mem_reclaim_partial()
1432 static inline void sk_mem_charge(struct sock *sk, int size) sk_mem_charge()
1439 static inline void sk_mem_uncharge(struct sock *sk, int size) sk_mem_uncharge()
1446 static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) sk_wmem_free_skb()
1469 static inline void sock_release_ownership(struct sock *sk) sock_release_ownership()
1493 void lock_sock_nested(struct sock *sk, int subclass);
1495 static inline void lock_sock(struct sock *sk) lock_sock()
1500 void release_sock(struct sock *sk);
1509 bool lock_sock_fast(struct sock *sk);
1518 static inline void unlock_sock_fast(struct sock *sk, bool slow) unlock_sock_fast()
1527 struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
1529 void sk_free(struct sock *sk);
1530 void sk_release_kernel(struct sock *sk);
1531 struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
1533 struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
1545 int sock_setsockopt(struct socket *sock, int level, int op,
1548 int sock_getsockopt(struct socket *sock, int level, int op,
1550 struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size,
1552 struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
1555 void *sock_kmalloc(struct sock *sk, int size, gfp_t priority);
1556 void sock_kfree_s(struct sock *sk, void *mem, int size);
1557 void sock_kzfree_s(struct sock *sk, void *mem, int size);
1558 void sk_send_sigurg(struct sock *sk);
1578 int sock_no_mmap(struct file *file, struct socket *sock,
1580 ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset,
1587 int sock_common_getsockopt(struct socket *sock, int level, int optname,
1589 int sock_common_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
1591 int sock_common_setsockopt(struct socket *sock, int level, int optname,
1593 int compat_sock_common_getsockopt(struct socket *sock, int level,
1595 int compat_sock_common_setsockopt(struct socket *sock, int level,
1598 void sk_common_release(struct sock *sk);
1605 void sock_init_data(struct socket *sock, struct sock *sk);
1633 static inline void sock_put(struct sock *sk) sock_put()
1641 void sock_gen_put(struct sock *sk);
1643 int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested);
1645 static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) sk_tx_queue_set()
1650 static inline void sk_tx_queue_clear(struct sock *sk) sk_tx_queue_clear()
1655 static inline int sk_tx_queue_get(const struct sock *sk) sk_tx_queue_get()
1660 static inline void sk_set_socket(struct sock *sk, struct socket *sock) sk_set_socket() argument
1663 sk->sk_socket = sock; sk_set_socket()
1666 static inline wait_queue_head_t *sk_sleep(struct sock *sk) sk_sleep()
1673 * Note that parent inode held reference count on this struct sock,
1678 static inline void sock_orphan(struct sock *sk) sock_orphan()
1687 static inline void sock_graft(struct sock *sk, struct socket *parent) sock_graft()
1697 kuid_t sock_i_uid(struct sock *sk);
1698 unsigned long sock_i_ino(struct sock *sk);
1701 __sk_dst_get(struct sock *sk) __sk_dst_get()
1708 sk_dst_get(struct sock *sk) sk_dst_get()
1720 static inline void dst_negative_advice(struct sock *sk) dst_negative_advice()
1735 __sk_dst_set(struct sock *sk, struct dst_entry *dst) __sk_dst_set()
1750 sk_dst_set(struct sock *sk, struct dst_entry *dst) sk_dst_set()
1760 __sk_dst_reset(struct sock *sk) __sk_dst_reset()
1766 sk_dst_reset(struct sock *sk) sk_dst_reset()
1771 struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
1773 struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
1775 bool sk_mc_loop(struct sock *sk);
1777 static inline bool sk_can_gso(const struct sock *sk) sk_can_gso()
1782 void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
1784 static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) sk_nocaps_add()
1790 static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, skb_do_copy_data_nocache()
1808 static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, skb_add_data_nocache()
1821 static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *from, skb_copy_to_page_nocache()
1847 static inline int sk_wmem_alloc_get(const struct sock *sk) sk_wmem_alloc_get()
1858 static inline int sk_rmem_alloc_get(const struct sock *sk) sk_rmem_alloc_get()
1869 static inline bool sk_has_allocations(const struct sock *sk) sk_has_allocations()
1939 static inline void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk) skb_set_hash_from_sk()
1956 static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) skb_set_owner_w()
1964 * is enough to guarantee sk_free() wont free this sock until skb_set_owner_w()
1970 static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) skb_set_owner_r()
1979 void sk_reset_timer(struct sock *sk, struct timer_list *timer,
1982 void sk_stop_timer(struct sock *sk, struct timer_list *timer);
1984 int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
1986 int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);
1987 struct sk_buff *sock_dequeue_err_skb(struct sock *sk);
1993 static inline int sock_error(struct sock *sk) sock_error()
2002 static inline unsigned long sock_wspace(struct sock *sk) sock_wspace()
2014 static inline void sk_wake_async(struct sock *sk, int how, int band) sk_wake_async()
2030 static inline void sk_stream_moderate_sndbuf(struct sock *sk) sk_stream_moderate_sndbuf()
2038 struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp);
2047 static inline struct page_frag *sk_page_frag(struct sock *sk) sk_page_frag()
2055 bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag);
2060 static inline bool sock_writeable(const struct sock *sk) sock_writeable()
2070 static inline long sock_rcvtimeo(const struct sock *sk, bool noblock) sock_rcvtimeo()
2075 static inline long sock_sndtimeo(const struct sock *sk, bool noblock) sock_sndtimeo()
2080 static inline int sock_rcvlowat(const struct sock *sk, int waitall, int len) sock_rcvlowat()
2111 sock_skb_set_dropcount(const struct sock *sk, struct sk_buff *skb) sock_skb_set_dropcount()
2116 void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
2118 void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
2122 sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) sock_recv_timestamp()
2146 void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
2149 static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, sock_recv_ts_and_drops()
2163 void __sock_tx_timestamp(const struct sock *sk, __u8 *tx_flags);
2172 static inline void sock_tx_timestamp(const struct sock *sk, __u8 *tx_flags) sock_tx_timestamp()
2188 static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) sk_eat_skb()
2195 struct net *sock_net(const struct sock *sk) sock_net()
2201 void sock_net_set(struct sock *sk, struct net *net) sock_net_set()
2212 static inline void sk_change_net(struct sock *sk, struct net *net) sk_change_net()
2222 static inline struct sock *skb_steal_sock(struct sk_buff *skb) skb_steal_sock()
2225 struct sock *sk = skb->sk; skb_steal_sock()
2237 static inline bool sk_fullsock(const struct sock *sk) sk_fullsock()
2242 void sock_enable_timestamp(struct sock *sk, int flag);
2243 int sock_get_timestamp(struct sock *, struct timeval __user *);
2244 int sock_get_timestampns(struct sock *, struct timespec __user *);
2245 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, int level,
2248 bool sk_ns_capable(const struct sock *sk,
2250 bool sk_capable(const struct sock *sk, int cap);
2251 bool sk_net_capable(const struct sock *sk, int cap);
H A Daf_vsock.h32 struct sock sk;
50 struct sock *listener;
74 struct sock *__vsock_create(struct net *net,
75 struct socket *sock,
76 struct sock *parent,
167 void vsock_release_pending(struct sock *pending);
168 void vsock_add_pending(struct sock *listener, struct sock *pending);
169 void vsock_remove_pending(struct sock *listener, struct sock *pending);
170 void vsock_enqueue_accept(struct sock *listener, struct sock *connected);
174 struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
175 struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
177 void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
H A Drose.h11 #include <net/sock.h>
126 struct sock sock; member in struct:rose_sock
167 struct sock *rose_find_socket(unsigned int, struct rose_neigh *);
172 void rose_destroy_socket(struct sock *);
178 int rose_process_rx_frame(struct sock *, struct sk_buff *);
197 void rose_kick(struct sock *);
198 void rose_enquiry_response(struct sock *);
222 void rose_clear_queues(struct sock *);
223 void rose_frames_acked(struct sock *, unsigned short);
224 void rose_requeue_frames(struct sock *);
225 int rose_validate_nr(struct sock *, unsigned short);
226 void rose_write_internal(struct sock *, int);
230 void rose_disconnect(struct sock *, int, int, int);
233 void rose_start_heartbeat(struct sock *);
234 void rose_start_t1timer(struct sock *);
235 void rose_start_t2timer(struct sock *);
236 void rose_start_t3timer(struct sock *);
237 void rose_start_hbtimer(struct sock *);
238 void rose_start_idletimer(struct sock *);
239 void rose_stop_heartbeat(struct sock *);
240 void rose_stop_timer(struct sock *);
241 void rose_stop_idletimer(struct sock *);
H A Dudp_tunnel.h64 typedef int (*udp_tunnel_encap_rcv_t)(struct sock *sk, struct sk_buff *skb);
65 typedef void (*udp_tunnel_encap_destroy_t)(struct sock *sk);
75 /* Setup the given (UDP) sock to receive UDP encapsulated packets */
76 void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
80 int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
86 int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
94 void udp_tunnel_sock_release(struct socket *sock);
113 static inline void udp_tunnel_encap_enable(struct socket *sock) udp_tunnel_encap_enable() argument
116 if (sock->sk->sk_family == PF_INET6) udp_tunnel_encap_enable()
H A Dudp.h28 #include <net/sock.h>
131 static inline __wsum udp_csum_outgoing(struct sock *sk, struct sk_buff *skb) udp_csum_outgoing()
180 static inline void udp_lib_hash(struct sock *sk) udp_lib_hash()
185 void udp_lib_unhash(struct sock *sk);
186 void udp_lib_rehash(struct sock *sk, u16 new_hash);
188 static inline void udp_lib_close(struct sock *sk, long timeout) udp_lib_close()
193 int udp_lib_get_port(struct sock *sk, unsigned short snum,
194 int (*)(const struct sock *, const struct sock *),
237 int udp_get_port(struct sock *sk, unsigned short snum,
238 int (*saddr_cmp)(const struct sock *,
239 const struct sock *));
241 int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len);
242 int udp_push_pending_frames(struct sock *sk);
243 void udp_flush_pending_frames(struct sock *sk);
246 int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
247 int udp_disconnect(struct sock *sk, int flags);
248 unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait);
252 int udp_lib_getsockopt(struct sock *sk, int level, int optname,
254 int udp_lib_setsockopt(struct sock *sk, int level, int optname,
256 int (*push_pending_frames)(struct sock *));
257 struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
259 struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
262 struct sock *udp6_lib_lookup(struct net *net,
266 struct sock *__udp6_lib_lookup(struct net *net,
H A Dcls_cgroup.h19 #include <net/sock.h>
44 static inline void sock_update_classid(struct sock *sk) sock_update_classid()
53 static inline void sock_update_classid(struct sock *sk) sock_update_classid()
H A Dllc_sap.h20 struct sock;
23 void llc_save_primitive(struct sock *sk, struct sk_buff *skb,
25 struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev,
H A Dip6_route.h23 #include <net/sock.h>
67 struct dst_entry *ip6_route_output_flags(struct net *net, const struct sock *sk,
71 const struct sock *sk, ip6_route_output()
120 void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu);
124 void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
144 static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, __ip6_dst_store()
159 static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, ip6_dst_store()
181 int ip6_fragment(struct sock *sk, struct sk_buff *skb,
182 int (*output)(struct sock *, struct sk_buff *));
193 static inline bool ip6_sk_accept_pmtu(const struct sock *sk) ip6_sk_accept_pmtu()
199 static inline bool ip6_sk_ignore_df(const struct sock *sk) ip6_sk_ignore_df()
H A Dip.h36 struct sock;
72 struct sock *sk;
74 void (*destructor)(struct sock *);
75 struct sock *saved_sk;
102 int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
109 int ip_output(struct sock *sk, struct sk_buff *skb);
110 int ip_mc_output(struct sock *sk, struct sk_buff *skb);
111 int ip_fragment(struct sock *sk, struct sk_buff *skb,
112 int (*output)(struct sock *, struct sk_buff *));
116 int ip_local_out_sk(struct sock *sk, struct sk_buff *skb); ip_local_out()
122 int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
124 int ip_append_data(struct sock *sk, struct flowi4 *fl4,
133 ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
135 struct sk_buff *__ip_make_skb(struct sock *sk, struct flowi4 *fl4,
139 int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4);
140 void ip_flush_pending_frames(struct sock *sk);
141 struct sk_buff *ip_make_skb(struct sock *sk, struct flowi4 *fl4,
148 static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) ip_finish_skb()
158 static inline __u8 get_rtconn_flags(struct ipcm_cookie* ipc, struct sock* sk) get_rtconn_flags()
164 int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
165 int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
167 void ip4_datagram_release_cb(struct sock *sk);
186 void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
275 int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) ip_dont_fragment()
282 static inline bool ip_sk_accept_pmtu(const struct sock *sk) ip_sk_accept_pmtu()
288 static inline bool ip_sk_use_pmtu(const struct sock *sk) ip_sk_use_pmtu()
293 static inline bool ip_sk_ignore_df(const struct sock *sk) ip_sk_ignore_df()
326 struct sock *sk, int segs) ip_select_ident_segs()
348 struct sock *sk) ip_select_ident()
359 static inline void inet_set_txhash(struct sock *sk) inet_set_txhash()
445 static __inline__ void inet_reset_saddr(struct sock *sk) inet_reset_saddr()
528 void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb);
532 int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
534 int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
536 int compat_ip_setsockopt(struct sock *sk, int level, int optname,
538 int compat_ip_getsockopt(struct sock *sk, int level, int optname,
540 int ip_ra_control(struct sock *sk, unsigned char on,
541 void (*destructor)(struct sock *));
543 int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len);
544 void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
546 void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
H A Draw.h29 int raw_rcv(struct sock *, struct sk_buff *);
60 void raw_hash_sk(struct sock *sk);
61 void raw_unhash_sk(struct sock *sk);
70 static inline struct raw_sock *raw_sk(const struct sock *sk) raw_sk()
H A Drequest_sock.h23 #include <net/sock.h>
35 int (*rtx_syn_ack)(struct sock *sk,
37 void (*send_ack)(struct sock *sk, struct sk_buff *skb,
39 void (*send_reset)(struct sock *sk,
45 int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req);
47 /* struct request_sock - mini sock to represent a connection request
55 struct sock *rsk_listener;
66 struct sock *sk;
72 reqsk_alloc(const struct request_sock_ops *ops, struct sock *sk_listener) reqsk_alloc()
89 static inline struct request_sock *inet_reqsk(struct sock *sk) inet_reqsk()
94 static inline struct sock *req_to_sk(struct request_sock *req) req_to_sk()
96 return (struct sock *)req; req_to_sk()
174 * lock sock while browsing the listening hash (otherwise it's deadlock prone).
198 void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
217 struct sock *parent, reqsk_queue_add()
218 struct sock *child) reqsk_queue_add()
H A Dinet6_hashtables.h47 struct sock *__inet6_lookup_established(struct net *net,
54 struct sock *inet6_lookup_listener(struct net *net,
61 static inline struct sock *__inet6_lookup(struct net *net, __inet6_lookup()
69 struct sock *sk = __inet6_lookup_established(net, hashinfo, saddr, __inet6_lookup()
78 static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo, __inet6_lookup_skb()
84 struct sock *sk = skb_steal_sock(skb); __inet6_lookup_skb()
95 struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo,
H A Dinet_timewait_sock.h6 * Definitions for a generic INET TIMEWAIT sock
26 #include <net/sock.h>
45 * This is a TIME_WAIT sock. It works around the memory consumption
51 * Now struct sock also uses sock_common, so please just
95 static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) inet_twsk()
108 struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
112 void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
H A Dinet_hashtables.h31 #include <net/sock.h>
230 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
239 static inline int inet_sk_listen_hashfn(const struct sock *sk) inet_sk_listen_hashfn()
245 int __inet_inherit_port(struct sock *sk, struct sock *child);
247 void inet_put_port(struct sock *sk);
251 int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw);
252 int __inet_hash(struct sock *sk, struct inet_timewait_sock *tw);
253 void inet_hash(struct sock *sk);
254 void inet_unhash(struct sock *sk);
256 struct sock *__inet_lookup_listener(struct net *net,
263 static inline struct sock *inet_lookup_listener(struct net *net, inet_lookup_listener()
326 struct sock *__inet_lookup_established(struct net *net,
332 static inline struct sock * inet_lookup_established()
342 static inline struct sock *__inet_lookup(struct net *net, __inet_lookup()
349 struct sock *sk = __inet_lookup_established(net, hashinfo, __inet_lookup()
356 static inline struct sock *inet_lookup(struct net *net, inet_lookup()
362 struct sock *sk; inet_lookup()
371 static inline struct sock *__inet_lookup_skb(struct inet_hashinfo *hashinfo, __inet_lookup_skb()
376 struct sock *sk = skb_steal_sock(skb); __inet_lookup_skb()
387 u32 sk_ehashfn(const struct sock *sk);
392 static inline void sk_daddr_set(struct sock *sk, __be32 addr) sk_daddr_set()
400 static inline void sk_rcv_saddr_set(struct sock *sk, __be32 addr) sk_rcv_saddr_set()
409 struct sock *sk, u32 port_offset,
411 struct sock *, __u16,
415 struct sock *sk);
H A Dinet_sock.h27 #include <net/sock.h>
108 static inline u32 inet_request_mark(const struct sock *sk, struct sk_buff *skb) inet_request_mark()
160 struct sock sk;
212 static inline struct inet_sock *inet_sk(const struct sock *sk) inet_sk()
217 static inline void __inet_sk_copy_descendant(struct sock *sk_to, __inet_sk_copy_descendant()
218 const struct sock *sk_from, __inet_sk_copy_descendant()
225 static inline void inet_sk_copy_descendant(struct sock *sk_to, inet_sk_copy_descendant()
226 const struct sock *sk_from) inet_sk_copy_descendant()
232 int inet_sk_rebuild_header(struct sock *sk);
247 struct sock *sk_listener);
249 static inline __u8 inet_sk_flowi_flags(const struct sock *sk) inet_sk_flowi_flags()
258 static inline void inet_inc_convert_csum(struct sock *sk) inet_inc_convert_csum()
263 static inline void inet_dec_convert_csum(struct sock *sk) inet_dec_convert_csum()
269 static inline bool inet_get_convert_csum(struct sock *sk) inet_get_convert_csum()
H A Ddst_ops.h11 struct sock;
27 void (*update_pmtu)(struct dst_entry *dst, struct sock *sk,
29 void (*redirect)(struct dst_entry *dst, struct sock *sk,
H A Dipv6.h118 #include <net/sock.h>
194 struct sock *sk;
196 void (*destructor)(struct sock *);
272 struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label);
276 void fl6_free_socklist(struct sock *sk);
277 int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen);
278 int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
291 int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
294 int ip6_ra_control(struct sock *sk, int sel);
298 struct ipv6_txoptions *ipv6_dup_options(struct sock *sk,
300 struct ipv6_txoptions *ipv6_renew_options(struct sock *sk,
308 bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb,
713 static inline void ip6_set_txhash(struct sock *sk) ip6_set_txhash()
747 static inline void ip6_set_txhash(struct sock *sk) { } ip6_make_flowlabel()
790 int ip6_rcv_finish(struct sock *sk, struct sk_buff *skb);
795 int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
800 int ip6_append_data(struct sock *sk,
807 int ip6_push_pending_frames(struct sock *sk);
809 void ip6_flush_pending_frames(struct sock *sk);
813 struct sk_buff *__ip6_make_skb(struct sock *sk, struct sk_buff_head *queue,
816 struct sk_buff *ip6_make_skb(struct sock *sk,
824 static inline struct sk_buff *ip6_finish_skb(struct sock *sk) ip6_finish_skb()
830 int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6);
831 struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
833 struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
842 int ip6_output(struct sock *sk, struct sk_buff *skb);
848 int ip6_local_out_sk(struct sock *sk, struct sk_buff *skb);
885 int ipv6_setsockopt(struct sock *sk, int level, int optname,
887 int ipv6_getsockopt(struct sock *sk, int level, int optname,
889 int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
891 int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
894 int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
895 int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
898 int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
900 int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len,
902 void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
904 void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info);
905 void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu);
907 int inet6_release(struct socket *sock);
908 int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
909 int inet6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len,
911 int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
914 struct sock *sk);
925 int ip6_mc_source(int add, int omode, struct sock *sk,
927 int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf);
928 int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
963 int ipv6_sock_mc_join(struct sock *sk, int ifindex,
965 int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
H A Dllc_if.h65 int llc_establish_connection(struct sock *sk, u8 *lmac, u8 *dmac, u8 dsap);
66 int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb);
67 int llc_send_disc(struct sock *sk);
H A Dudplite.h27 static inline int udplite_sk_init(struct sock *sk) udplite_sk_init()
71 static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) udplite_csum_outgoing()
131 int udplite_get_port(struct sock *sk, unsigned short snum,
132 int (*scmp)(const struct sock *, const struct sock *));
/linux-4.1.27/drivers/pcmcia/
H A Ddb1xxx_ss.c69 static int db1300_card_inserted(struct db1x_pcmcia_sock *sock) db1300_card_inserted() argument
75 static int db1200_card_inserted(struct db1x_pcmcia_sock *sock) db1200_card_inserted() argument
80 return sigstat & 1 << (8 + 2 * sock->nr); db1200_card_inserted()
84 static int db1000_card_inserted(struct db1x_pcmcia_sock *sock) db1000_card_inserted() argument
86 return !gpio_get_value(irq_to_gpio(sock->insert_irq)); db1000_card_inserted()
89 static int db1x_card_inserted(struct db1x_pcmcia_sock *sock) db1x_card_inserted() argument
91 switch (sock->board_type) { db1x_card_inserted()
93 return db1200_card_inserted(sock); db1x_card_inserted()
95 return db1300_card_inserted(sock); db1x_card_inserted()
97 return db1000_card_inserted(sock); db1x_card_inserted()
105 static inline void set_stschg(struct db1x_pcmcia_sock *sock, int en) set_stschg() argument
107 if (sock->stschg_irq != -1) { set_stschg()
109 enable_irq(sock->stschg_irq); set_stschg()
111 disable_irq(sock->stschg_irq); set_stschg()
117 struct db1x_pcmcia_sock *sock = data; db1000_pcmcia_cdirq() local
119 pcmcia_parse_events(&sock->socket, SS_DETECT); db1000_pcmcia_cdirq()
126 struct db1x_pcmcia_sock *sock = data; db1000_pcmcia_stschgirq() local
128 pcmcia_parse_events(&sock->socket, SS_STSCHG); db1000_pcmcia_stschgirq()
135 struct db1x_pcmcia_sock *sock = data; db1200_pcmcia_cdirq() local
142 if (irq == sock->insert_irq) { db1200_pcmcia_cdirq()
143 disable_irq_nosync(sock->insert_irq); db1200_pcmcia_cdirq()
144 enable_irq(sock->eject_irq); db1200_pcmcia_cdirq()
146 disable_irq_nosync(sock->eject_irq); db1200_pcmcia_cdirq()
147 enable_irq(sock->insert_irq); db1200_pcmcia_cdirq()
150 pcmcia_parse_events(&sock->socket, SS_DETECT); db1200_pcmcia_cdirq()
155 static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) db1x_pcmcia_setup_irqs() argument
159 if (sock->stschg_irq != -1) { db1x_pcmcia_setup_irqs()
160 ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq, db1x_pcmcia_setup_irqs()
161 0, "pcmcia_stschg", sock); db1x_pcmcia_setup_irqs()
172 if ((sock->board_type == BOARD_TYPE_DB1200) || db1x_pcmcia_setup_irqs()
173 (sock->board_type == BOARD_TYPE_DB1300)) { db1x_pcmcia_setup_irqs()
174 ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, db1x_pcmcia_setup_irqs()
175 0, "pcmcia_insert", sock); db1x_pcmcia_setup_irqs()
179 ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, db1x_pcmcia_setup_irqs()
180 0, "pcmcia_eject", sock); db1x_pcmcia_setup_irqs()
182 free_irq(sock->insert_irq, sock); db1x_pcmcia_setup_irqs()
187 if (db1x_card_inserted(sock)) db1x_pcmcia_setup_irqs()
188 enable_irq(sock->eject_irq); db1x_pcmcia_setup_irqs()
190 enable_irq(sock->insert_irq); db1x_pcmcia_setup_irqs()
195 irq_set_irq_type(sock->insert_irq, IRQ_TYPE_EDGE_BOTH); db1x_pcmcia_setup_irqs()
196 ret = request_irq(sock->insert_irq, db1000_pcmcia_cdirq, db1x_pcmcia_setup_irqs()
197 0, "pcmcia_carddetect", sock); db1x_pcmcia_setup_irqs()
206 if (sock->stschg_irq != -1) db1x_pcmcia_setup_irqs()
207 free_irq(sock->stschg_irq, sock); db1x_pcmcia_setup_irqs()
212 static void db1x_pcmcia_free_irqs(struct db1x_pcmcia_sock *sock) db1x_pcmcia_free_irqs() argument
214 if (sock->stschg_irq != -1) db1x_pcmcia_free_irqs()
215 free_irq(sock->stschg_irq, sock); db1x_pcmcia_free_irqs()
217 free_irq(sock->insert_irq, sock); db1x_pcmcia_free_irqs()
218 if (sock->eject_irq != -1) db1x_pcmcia_free_irqs()
219 free_irq(sock->eject_irq, sock); db1x_pcmcia_free_irqs()
238 struct db1x_pcmcia_sock *sock = to_db1x_socket(skt); db1x_pcmcia_configure() local
244 cr_clr = (0xf << (sock->nr * 8)); /* clear voltage settings */ db1x_pcmcia_configure()
257 sock->nr, state->Vcc); db1x_pcmcia_configure()
270 sock->nr, state->Vpp); db1x_pcmcia_configure()
277 sock->nr, state->Vcc, state->Vpp); db1x_pcmcia_configure()
283 if (sock->board_type != BOARD_TYPE_DB1300) db1x_pcmcia_configure()
284 cr_set |= ((v << 2) | p) << (sock->nr * 8); db1x_pcmcia_configure()
286 changed = state->flags ^ sock->old_flags; db1x_pcmcia_configure()
290 set_stschg(sock, 0); db1x_pcmcia_configure()
292 cr_clr |= (1 << (7 + (sock->nr * 8))); db1x_pcmcia_configure()
293 cr_clr |= (1 << (4 + (sock->nr * 8))); db1x_pcmcia_configure()
296 cr_set |= 1 << (7 + (sock->nr * 8)); db1x_pcmcia_configure()
297 cr_set |= 1 << (4 + (sock->nr * 8)); db1x_pcmcia_configure()
304 sock->old_flags = state->flags; db1x_pcmcia_configure()
309 set_stschg(sock, 1); db1x_pcmcia_configure()
330 struct db1x_pcmcia_sock *sock = to_db1x_socket(skt); db1x_pcmcia_get_status() local
334 status = db1x_card_inserted(sock) ? SS_DETECT : 0; db1x_pcmcia_get_status()
340 if (sock->board_type == BOARD_TYPE_PB1100) db1x_pcmcia_get_status()
344 switch (GET_VS(sr, sock->nr)) { db1x_pcmcia_get_status()
355 status |= GET_VCC(cr, sock->nr) ? SS_POWERON : 0; db1x_pcmcia_get_status()
358 if ((sock->board_type == BOARD_TYPE_DB1300) && (status & SS_DETECT)) db1x_pcmcia_get_status()
362 status |= (GET_RESET(cr, sock->nr)) ? SS_READY : SS_RESET; db1x_pcmcia_get_status()
382 struct db1x_pcmcia_sock *sock = to_db1x_socket(skt); au1x00_pcmcia_set_io_map() local
384 map->start = (u32)sock->virt_io; au1x00_pcmcia_set_io_map()
393 struct db1x_pcmcia_sock *sock = to_db1x_socket(skt); au1x00_pcmcia_set_mem_map() local
396 map->static_start = sock->phys_attr + map->card_start; au1x00_pcmcia_set_mem_map()
398 map->static_start = sock->phys_mem + map->card_start; au1x00_pcmcia_set_mem_map()
414 struct db1x_pcmcia_sock *sock; db1x_pcmcia_socket_probe() local
418 sock = kzalloc(sizeof(struct db1x_pcmcia_sock), GFP_KERNEL); db1x_pcmcia_socket_probe()
419 if (!sock) db1x_pcmcia_socket_probe()
422 sock->nr = pdev->id; db1x_pcmcia_socket_probe()
429 sock->board_type = BOARD_TYPE_PB1100; db1x_pcmcia_socket_probe()
432 sock->board_type = BOARD_TYPE_DEFAULT; db1x_pcmcia_socket_probe()
435 sock->board_type = BOARD_TYPE_DB1200; db1x_pcmcia_socket_probe()
438 sock->board_type = BOARD_TYPE_DB1300; db1x_pcmcia_socket_probe()
458 sock->card_irq = r ? r->start : 0; db1x_pcmcia_socket_probe()
462 sock->insert_irq = r ? r->start : -1; db1x_pcmcia_socket_probe()
466 sock->stschg_irq = r ? r->start : -1; db1x_pcmcia_socket_probe()
470 sock->eject_irq = r ? r->start : -1; db1x_pcmcia_socket_probe()
478 sock->nr); db1x_pcmcia_socket_probe()
481 sock->phys_attr = r->start; db1x_pcmcia_socket_probe()
487 sock->nr); db1x_pcmcia_socket_probe()
490 sock->phys_mem = r->start; db1x_pcmcia_socket_probe()
496 sock->nr); db1x_pcmcia_socket_probe()
499 sock->phys_io = r->start; db1x_pcmcia_socket_probe()
509 sock->virt_io = (void *)(ioremap(sock->phys_io, IO_MAP_SIZE) - db1x_pcmcia_socket_probe()
512 if (!sock->virt_io) { db1x_pcmcia_socket_probe()
514 sock->nr); db1x_pcmcia_socket_probe()
519 sock->socket.ops = &db1x_pcmcia_operations; db1x_pcmcia_socket_probe()
520 sock->socket.owner = THIS_MODULE; db1x_pcmcia_socket_probe()
521 sock->socket.pci_irq = sock->card_irq; db1x_pcmcia_socket_probe()
522 sock->socket.features = SS_CAP_STATIC_MAP | SS_CAP_PCCARD; db1x_pcmcia_socket_probe()
523 sock->socket.map_size = MEM_MAP_SIZE; db1x_pcmcia_socket_probe()
524 sock->socket.io_offset = (unsigned long)sock->virt_io; db1x_pcmcia_socket_probe()
525 sock->socket.dev.parent = &pdev->dev; db1x_pcmcia_socket_probe()
526 sock->socket.resource_ops = &pccard_static_ops; db1x_pcmcia_socket_probe()
528 platform_set_drvdata(pdev, sock); db1x_pcmcia_socket_probe()
530 ret = db1x_pcmcia_setup_irqs(sock); db1x_pcmcia_socket_probe()
533 sock->nr); db1x_pcmcia_socket_probe()
537 set_stschg(sock, 0); db1x_pcmcia_socket_probe()
539 ret = pcmcia_register_socket(&sock->socket); db1x_pcmcia_socket_probe()
541 printk(KERN_ERR "pcmcia%d failed to register\n", sock->nr); db1x_pcmcia_socket_probe()
547 "%d %d %d\n", sock->nr, sock->phys_io, sock->virt_io, db1x_pcmcia_socket_probe()
548 sock->phys_attr, sock->phys_mem, sock->card_irq, db1x_pcmcia_socket_probe()
549 sock->insert_irq, sock->stschg_irq, sock->eject_irq); db1x_pcmcia_socket_probe()
554 db1x_pcmcia_free_irqs(sock); db1x_pcmcia_socket_probe()
556 iounmap((void *)(sock->virt_io + (u32)mips_io_port_base)); db1x_pcmcia_socket_probe()
558 kfree(sock); db1x_pcmcia_socket_probe()
564 struct db1x_pcmcia_sock *sock = platform_get_drvdata(pdev); db1x_pcmcia_socket_remove() local
566 db1x_pcmcia_free_irqs(sock); db1x_pcmcia_socket_remove()
567 pcmcia_unregister_socket(&sock->socket); db1x_pcmcia_socket_remove()
568 iounmap((void *)(sock->virt_io + (u32)mips_io_port_base)); db1x_pcmcia_socket_remove()
569 kfree(sock); db1x_pcmcia_socket_remove()
H A Dxxs1500_ss.c69 struct xxs1500_pcmcia_sock *sock = data; cdirq() local
71 pcmcia_parse_events(&sock->socket, SS_DETECT); cdirq()
79 struct xxs1500_pcmcia_sock *sock = to_xxs_socket(skt); xxs1500_pcmcia_configure() local
95 changed = state->flags ^ sock->old_flags; xxs1500_pcmcia_configure()
108 sock->old_flags = state->flags; xxs1500_pcmcia_configure()
177 struct xxs1500_pcmcia_sock *sock = to_xxs_socket(skt); au1x00_pcmcia_set_io_map() local
179 map->start = (u32)sock->virt_io; au1x00_pcmcia_set_io_map()
188 struct xxs1500_pcmcia_sock *sock = to_xxs_socket(skt); au1x00_pcmcia_set_mem_map() local
191 map->static_start = sock->phys_attr + map->card_start; au1x00_pcmcia_set_mem_map()
193 map->static_start = sock->phys_mem + map->card_start; au1x00_pcmcia_set_mem_map()
209 struct xxs1500_pcmcia_sock *sock; xxs1500_pcmcia_probe() local
213 sock = kzalloc(sizeof(struct xxs1500_pcmcia_sock), GFP_KERNEL); xxs1500_pcmcia_probe()
214 if (!sock) xxs1500_pcmcia_probe()
225 sock->phys_attr = r->start; xxs1500_pcmcia_probe()
233 sock->phys_mem = r->start; xxs1500_pcmcia_probe()
241 sock->phys_io = r->start; xxs1500_pcmcia_probe()
252 sock->virt_io = (void *)(ioremap(sock->phys_io, IO_MAP_SIZE) - xxs1500_pcmcia_probe()
255 if (!sock->virt_io) { xxs1500_pcmcia_probe()
261 sock->socket.ops = &xxs1500_pcmcia_operations; xxs1500_pcmcia_probe()
262 sock->socket.owner = THIS_MODULE; xxs1500_pcmcia_probe()
263 sock->socket.pci_irq = gpio_to_irq(GPIO_CARDIRQ); xxs1500_pcmcia_probe()
264 sock->socket.features = SS_CAP_STATIC_MAP | SS_CAP_PCCARD; xxs1500_pcmcia_probe()
265 sock->socket.map_size = MEM_MAP_SIZE; xxs1500_pcmcia_probe()
266 sock->socket.io_offset = (unsigned long)sock->virt_io; xxs1500_pcmcia_probe()
267 sock->socket.dev.parent = &pdev->dev; xxs1500_pcmcia_probe()
268 sock->socket.resource_ops = &pccard_static_ops; xxs1500_pcmcia_probe()
270 platform_set_drvdata(pdev, sock); xxs1500_pcmcia_probe()
277 ret = request_irq(irq, cdirq, 0, "pcmcia_carddetect", sock); xxs1500_pcmcia_probe()
283 ret = pcmcia_register_socket(&sock->socket); xxs1500_pcmcia_probe()
294 free_irq(gpio_to_irq(GPIO_CDA), sock); xxs1500_pcmcia_probe() local
296 iounmap((void *)(sock->virt_io + (u32)mips_io_port_base)); xxs1500_pcmcia_probe()
298 kfree(sock); xxs1500_pcmcia_probe()
304 struct xxs1500_pcmcia_sock *sock = platform_get_drvdata(pdev); xxs1500_pcmcia_remove() local
306 pcmcia_unregister_socket(&sock->socket); xxs1500_pcmcia_remove()
307 free_irq(gpio_to_irq(GPIO_CDA), sock); xxs1500_pcmcia_remove() local
308 iounmap((void *)(sock->virt_io + (u32)mips_io_port_base)); xxs1500_pcmcia_remove()
309 kfree(sock); xxs1500_pcmcia_remove()
H A Dsa11xx_base.h69 #define MECR_SET(mecr, sock, shift, mask, bs) \
71 ((sock)==0?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT)))|\
72 (((bs)<<(shift))<<((sock)==0?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT)))
74 #define MECR_GET(mecr, sock, shift, mask) \
75 ((((mecr)>>(((sock)==0)?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT))>>\
78 #define MECR_BSIO_SET(mecr, sock, bs) \
79 MECR_SET((mecr), (sock), MECR_BSIO_SHIFT, MECR_BS_MASK, (bs))
81 #define MECR_BSIO_GET(mecr, sock) \
82 MECR_GET((mecr), (sock), MECR_BSIO_SHIFT, MECR_BS_MASK)
84 #define MECR_BSA_SET(mecr, sock, bs) \
85 MECR_SET((mecr), (sock), MECR_BSA_SHIFT, MECR_BS_MASK, (bs))
87 #define MECR_BSA_GET(mecr, sock) \
88 MECR_GET((mecr), (sock), MECR_BSA_SHIFT, MECR_BS_MASK)
90 #define MECR_BSM_SET(mecr, sock, bs) \
91 MECR_SET((mecr), (sock), MECR_BSM_SHIFT, MECR_BS_MASK, (bs))
93 #define MECR_BSM_GET(mecr, sock) \
94 MECR_GET((mecr), (sock), MECR_BSM_SHIFT, MECR_BS_MASK)
96 #define MECR_FAST_SET(mecr, sock, fast) \
97 MECR_SET((mecr), (sock), MECR_FAST_SHIFT, MECR_FAST_MODE_MASK, (fast))
99 #define MECR_FAST_GET(mecr, sock) \
100 MECR_GET((mecr), (sock), MECR_FAST_SHIFT, MECR_FAST_MODE_MASK)
H A Dm32r_pcc.c84 void pcc_iorw(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int wr, int flag) pcc_iorw() argument
92 pcc_socket_t *t = &socket[sock]; pcc_iorw()
124 pcc_set(sock, PCCR, 0); pcc_iorw()
130 pcc_set(sock, PCMOD, PCMOD_AS_IO | cbsz | need_ex); pcc_iorw()
131 pcc_set(sock, PCADR, addr & 0x1ff00000); pcc_iorw()
136 pcc_set(sock, PCCR, 1); pcc_iorw()
214 if ((addr = pcc_get(sock, PCIRC)) & PCIRC_BWERR) { pcc_iorw()
217 pcc_set(sock, PCIRC, addr); pcc_iorw()
233 void pcc_ioread(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int flag) { pcc_ioread() argument
234 pcc_iorw(sock, port, buf, size, nmemb, 0, flag); pcc_ioread()
237 void pcc_iowrite(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int flag) { pcc_iowrite() argument
238 pcc_iorw(sock, port, buf, size, nmemb, 1, flag); pcc_iowrite()
261 static unsigned int pcc_get(u_short sock, unsigned int reg) pcc_get() argument
263 return inl(socket[sock].base + reg); pcc_get()
267 static void pcc_set(u_short sock, unsigned int reg, unsigned int data) pcc_set() argument
269 outl(data, socket[sock].base + reg); pcc_set()
281 static int __init is_alive(u_short sock) is_alive() argument
286 stat = pcc_get(sock, PCIRC); is_alive()
289 printk("m32r_pcc: No Card is detected at socket %d : stat = 0x%08x\n",stat,sock); is_alive()
293 printk("m32r_pcc: Insertion fail (%.8x) at socket %d\n",stat,sock); is_alive()
295 printk("m32r_pcc: Card is Inserted at socket %d(%.8x)\n",sock,stat); is_alive()
393 static int _pcc_get_status(u_short sock, u_int *value) _pcc_get_status() argument
397 status = pcc_get(sock,PCIRC); _pcc_get_status()
401 status = pcc_get(sock,PCCR); _pcc_get_status()
409 status = pcc_get(sock,PCCSIGCR); _pcc_get_status()
412 pr_debug("m32r_pcc: GetStatus(%d) = %#4.4x\n", sock, *value); _pcc_get_status()
418 static int _pcc_set_socket(u_short sock, socket_state_t *state) _pcc_set_socket() argument
423 "io_irq %d, csc_mask %#2.2x)", sock, state->flags, _pcc_set_socket()
448 pcc_set(sock,PCCSIGCR,reg); _pcc_set_socket()
475 static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io) _pcc_set_io_map() argument
480 "%#llx-%#llx)\n", sock, io->map, io->flags, _pcc_set_io_map()
490 static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem) argument
496 pcc_socket_t *t = &socket[sock];
504 "%#llx, %#x)\n", sock, map, mem->flags,
526 pcc_set(sock, PCCR, 0);
538 pcc_set(sock, PCMOD, mode);
544 pcc_set(sock, PCADR, addr);
551 pcc_set(sock, PCCR, 1);
611 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_get_status() local
613 if (socket[sock].flags & IS_ALIVE) { pcc_get_status()
617 LOCKED(_pcc_get_status(sock, value)); pcc_get_status()
622 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_set_socket() local
624 if (socket[sock].flags & IS_ALIVE) pcc_set_socket()
627 LOCKED(_pcc_set_socket(sock, state)); pcc_set_socket()
632 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_set_io_map() local
634 if (socket[sock].flags & IS_ALIVE) pcc_set_io_map()
636 LOCKED(_pcc_set_io_map(sock, io)); pcc_set_io_map()
641 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_set_mem_map() local
643 if (socket[sock].flags & IS_ALIVE) pcc_set_mem_map()
645 LOCKED(_pcc_set_mem_map(sock, mem)); pcc_set_mem_map()
H A Dm32r_cfc.c104 void pcc_ioread_byte(int sock, unsigned long port, void *buf, size_t size, pcc_ioread_byte() argument
111 pr_debug("m32r_cfc: pcc_ioread_byte: sock=%d, port=%#lx, buf=%p, " pcc_ioread_byte()
113 sock, port, buf, size, nmemb, flag); pcc_ioread_byte()
129 void pcc_ioread_word(int sock, unsigned long port, void *buf, size_t size, pcc_ioread_word() argument
136 pr_debug("m32r_cfc: pcc_ioread_word: sock=%d, port=%#lx, " pcc_ioread_word()
138 sock, port, buf, size, nmemb, flag); pcc_ioread_word()
160 void pcc_iowrite_byte(int sock, unsigned long port, void *buf, size_t size, pcc_iowrite_byte() argument
167 pr_debug("m32r_cfc: pcc_iowrite_byte: sock=%d, port=%#lx, " pcc_iowrite_byte()
169 sock, port, buf, size, nmemb, flag); pcc_iowrite_byte()
185 void pcc_iowrite_word(int sock, unsigned long port, void *buf, size_t size, pcc_iowrite_word() argument
192 pr_debug("m32r_cfc: pcc_iowrite_word: sock=%d, port=%#lx, " pcc_iowrite_word()
194 sock, port, buf, size, nmemb, flag); pcc_iowrite_word()
247 static unsigned int pcc_get(u_short sock, unsigned int reg) pcc_get() argument
255 static void pcc_set(u_short sock, unsigned int reg, unsigned int data) pcc_set() argument
270 static int __init is_alive(u_short sock) is_alive() argument
277 stat = pcc_get(sock, (unsigned int)PLD_CFSTS); is_alive()
280 printk("Card is detected at socket %d : stat = 0x%08x\n", sock, stat); is_alive()
281 pr_debug("m32r_cfc: is_alive: sock stat is 0x%04x\n", stat); is_alive()
394 static int _pcc_get_status(u_short sock, u_int *value) _pcc_get_status() argument
399 status = pcc_get(sock, (unsigned int)PLD_CFSTS); _pcc_get_status()
416 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0);/* enable buffer */ _pcc_get_status()
432 status = pcc_get(sock, (unsigned int)PLD_CPCR); _pcc_get_status()
434 pcc_set(sock, (unsigned int)PLD_CPCR, 1); _pcc_get_status()
435 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); /* force buffer off for ZA-36 */ _pcc_get_status()
440 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); _pcc_get_status()
442 pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101); _pcc_get_status()
444 pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100); _pcc_get_status()
451 pcc_set(sock, (unsigned int)PLD_CPCR, 0); _pcc_get_status()
460 sock, *value); _pcc_get_status()
466 static int _pcc_set_socket(u_short sock, socket_state_t *state) _pcc_set_socket() argument
469 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, _pcc_set_socket()
481 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x101); _pcc_set_socket()
483 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x100); _pcc_set_socket()
488 pcc_set(sock,(unsigned int)PLD_CFBUFCR,0); _pcc_set_socket()
490 pcc_set(sock,(unsigned int)PLD_CFBUFCR,1); _pcc_set_socket()
518 static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io) _pcc_set_io_map() argument
523 "%#llx-%#llx)\n", sock, io->map, io->flags, _pcc_set_io_map()
533 static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem) _pcc_set_mem_map() argument
538 pcc_socket_t *t = &socket[sock]; _pcc_set_mem_map()
541 "%#llx, %#x)\n", sock, map, mem->flags, _pcc_set_mem_map()
623 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_get_status() local
625 if (socket[sock].flags & IS_ALIVE) { pcc_get_status()
626 dev_dbg(&s->dev, "pcc_get_status: sock(%d) -EINVAL\n", sock); pcc_get_status()
630 dev_dbg(&s->dev, "pcc_get_status: sock(%d)\n", sock); pcc_get_status()
631 LOCKED(_pcc_get_status(sock, value)); pcc_get_status()
636 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_set_socket() local
638 if (socket[sock].flags & IS_ALIVE) { pcc_set_socket()
639 dev_dbg(&s->dev, "pcc_set_socket: sock(%d) -EINVAL\n", sock); pcc_set_socket()
642 dev_dbg(&s->dev, "pcc_set_socket: sock(%d)\n", sock); pcc_set_socket()
643 LOCKED(_pcc_set_socket(sock, state)); pcc_set_socket()
648 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_set_io_map() local
650 if (socket[sock].flags & IS_ALIVE) { pcc_set_io_map()
651 dev_dbg(&s->dev, "pcc_set_io_map: sock(%d) -EINVAL\n", sock); pcc_set_io_map()
654 dev_dbg(&s->dev, "pcc_set_io_map: sock(%d)\n", sock); pcc_set_io_map()
655 LOCKED(_pcc_set_io_map(sock, io)); pcc_set_io_map()
660 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; pcc_set_mem_map() local
662 if (socket[sock].flags & IS_ALIVE) { pcc_set_mem_map()
663 dev_dbg(&s->dev, "pcc_set_mem_map: sock(%d) -EINVAL\n", sock); pcc_set_mem_map()
666 dev_dbg(&s->dev, "pcc_set_mem_map: sock(%d)\n", sock); pcc_set_mem_map()
667 LOCKED(_pcc_set_mem_map(sock, mem)); pcc_set_mem_map()
H A Di82365.c217 static u_char i365_get(u_short sock, u_short reg) i365_get() argument
222 unsigned int port = socket[sock].ioaddr; i365_get()
224 reg = I365_REG(socket[sock].psock, reg); i365_get()
231 static void i365_set(u_short sock, u_short reg, u_char data) i365_set() argument
236 unsigned int port = socket[sock].ioaddr; i365_set()
237 u_char val = I365_REG(socket[sock].psock, reg); i365_set()
243 static void i365_bset(u_short sock, u_short reg, u_char mask) i365_bset() argument
245 u_char d = i365_get(sock, reg); i365_bset()
247 i365_set(sock, reg, d); i365_bset()
250 static void i365_bclr(u_short sock, u_short reg, u_char mask) i365_bclr() argument
252 u_char d = i365_get(sock, reg); i365_bclr()
254 i365_set(sock, reg, d); i365_bclr()
257 static void i365_bflip(u_short sock, u_short reg, u_char mask, int b) i365_bflip() argument
259 u_char d = i365_get(sock, reg); i365_bflip()
264 i365_set(sock, reg, d); i365_bflip()
267 static u_short i365_get_pair(u_short sock, u_short reg) i365_get_pair() argument
270 a = i365_get(sock, reg); i365_get_pair()
271 b = i365_get(sock, reg+1); i365_get_pair()
275 static void i365_set_pair(u_short sock, u_short reg, u_short data) i365_set_pair() argument
277 i365_set(sock, reg, data & 0xff); i365_set_pair()
278 i365_set(sock, reg+1, data >> 8); i365_set_pair()
489 static u_int __init test_irq(u_short sock, int irq) test_irq() argument
495 irq_hits = 0; irq_sock = sock; test_irq()
504 i365_set(sock, I365_CSCINT, I365_CSC_DETECT | (irq << 4)); test_irq()
505 i365_bset(sock, I365_GENCTL, I365_CTL_SW_IRQ); test_irq()
511 i365_set(sock, I365_CSCINT, 0); test_irq()
517 static u_int __init isa_scan(u_short sock, u_int mask0) isa_scan() argument
529 set_bridge_state(sock); isa_scan()
530 i365_set(sock, I365_CSCINT, 0); isa_scan()
532 if ((mask0 & (1 << i)) && (test_irq(sock, i) == 0)) isa_scan()
535 if ((mask1 & (1 << i)) && (test_irq(sock, i) != 0)) isa_scan()
572 static int __init identify(unsigned int port, u_short sock) identify() argument
579 socket[sockets].psock = sock; identify()
640 static int __init is_alive(u_short sock) is_alive() argument
645 stat = i365_get(sock, I365_STATUS); is_alive()
646 start = i365_get_pair(sock, I365_IO(0)+I365_W_START); is_alive()
647 stop = i365_get_pair(sock, I365_IO(0)+I365_W_STOP); is_alive()
649 (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) && is_alive()
650 (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) && is_alive()
755 int i, j, sock, k, ns, id; isa_probe() local
796 sock = (i & 1) << 1; isa_probe()
797 if (identify(port, sock) == IS_I82365DF) { isa_probe()
798 add_socket(port, sock, IS_VLSI); isa_probe()
807 sock = (i & 3); isa_probe()
808 id = identify(port, sock); isa_probe()
813 if ((ignore == i+j) || (identify(port, sock+j) < 0)) isa_probe()
822 add_socket(port, sock+j, id); ns++; isa_probe()
887 static int i365_get_status(u_short sock, u_int *value) i365_get_status() argument
891 status = i365_get(sock, I365_STATUS); i365_get_status()
895 if (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) i365_get_status()
905 if (socket[sock].type == IS_VG469) { i365_get_status()
906 status = i365_get(sock, VG469_VSENSE); i365_get_status()
907 if (socket[sock].psock & 1) { i365_get_status()
916 pr_debug("GetStatus(%d) = %#4.4x\n", sock, *value); i365_get_status()
922 static int i365_set_socket(u_short sock, socket_state_t *state) i365_set_socket() argument
924 struct i82365_socket *t = &socket[sock]; i365_set_socket()
928 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, i365_set_socket()
932 set_bridge_state(sock); i365_set_socket()
939 i365_set(sock, I365_INTCTL, reg); i365_set_socket()
956 i365_bset(sock, PD67_MISC_CTL_1, PD67_MC1_VCC_3V); i365_set_socket()
958 i365_bclr(sock, PD67_MISC_CTL_1, PD67_MC1_VCC_3V); i365_set_socket()
972 i365_bset(sock, VG469_VSELECT, VG469_VSEL_VCC); i365_set_socket()
974 i365_bclr(sock, VG469_VSELECT, VG469_VSEL_VCC); i365_set_socket()
1004 if (reg != i365_get(sock, I365_POWER)) i365_set_socket()
1005 i365_set(sock, I365_POWER, reg); i365_set_socket()
1010 i365_bflip(sock, PD67_MISC_CTL_1, PD67_MC1_SPKR_ENA, i365_set_socket()
1024 i365_set(sock, I365_CSCINT, reg); i365_set_socket()
1025 i365_get(sock, I365_CSC); i365_set_socket()
1032 static int i365_set_io_map(u_short sock, struct pccard_io_map *io) i365_set_io_map() argument
1037 "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed, i365_set_io_map()
1043 if (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(map)) i365_set_io_map()
1044 i365_bclr(sock, I365_ADDRWIN, I365_ENA_IO(map)); i365_set_io_map()
1045 i365_set_pair(sock, I365_IO(map)+I365_W_START, io->start); i365_set_io_map()
1046 i365_set_pair(sock, I365_IO(map)+I365_W_STOP, io->stop); i365_set_io_map()
1047 ioctl = i365_get(sock, I365_IOCTL) & ~I365_IOCTL_MASK(map); i365_set_io_map()
1052 i365_set(sock, I365_IOCTL, ioctl); i365_set_io_map()
1055 i365_bset(sock, I365_ADDRWIN, I365_ENA_IO(map)); i365_set_io_map()
1061 static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) i365_set_mem_map() argument
1067 "%#x)\n", sock, mem->map, mem->flags, mem->speed, i365_set_mem_map()
1079 if (i365_get(sock, I365_ADDRWIN) & I365_ENA_MEM(map)) i365_set_mem_map()
1080 i365_bclr(sock, I365_ADDRWIN, I365_ENA_MEM(map)); i365_set_mem_map()
1086 i365_set_pair(sock, base+I365_W_START, i); i365_set_mem_map()
1095 i365_set_pair(sock, base+I365_W_STOP, i); i365_set_mem_map()
1100 i365_set_pair(sock, base+I365_W_OFF, i); i365_set_mem_map()
1104 i365_bset(sock, I365_ADDRWIN, I365_ENA_MEM(map)); i365_set_mem_map()
1126 unsigned short sock;
1131 sock = s->number;
1133 ISA_LOCK(sock, flags);
1136 i365_get(sock,i), i365_get(sock,i+1),
1137 i365_get(sock,i+2), i365_get(sock,i+3),
1141 ISA_UNLOCK(sock, flags);
1166 unsigned int sock = container_of(s, struct i82365_socket, socket)->number; pcic_get_status() local
1168 if (socket[sock].flags & IS_ALIVE) { pcic_get_status()
1173 LOCKED(i365_get_status(sock, value)); pcic_get_status()
1178 unsigned int sock = container_of(s, struct i82365_socket, socket)->number; pcic_set_socket() local
1180 if (socket[sock].flags & IS_ALIVE) pcic_set_socket()
1183 LOCKED(i365_set_socket(sock, state)); pcic_set_socket()
1188 unsigned int sock = container_of(s, struct i82365_socket, socket)->number; pcic_set_io_map() local
1189 if (socket[sock].flags & IS_ALIVE) pcic_set_io_map()
1192 LOCKED(i365_set_io_map(sock, io)); pcic_set_io_map()
1197 unsigned int sock = container_of(s, struct i82365_socket, socket)->number; pcic_set_mem_map() local
1198 if (socket[sock].flags & IS_ALIVE) pcic_set_mem_map()
1201 LOCKED(i365_set_mem_map(sock, mem)); pcic_set_mem_map()
H A Di82092.c380 static void set_bridge_state(int sock) set_bridge_state() argument
383 indirect_write(sock, I365_GBLCTL,0x00); set_bridge_state()
384 indirect_write(sock, I365_GENCTL,0x00); set_bridge_state()
386 indirect_setbit(sock, I365_INTCTL,0x08); set_bridge_state()
395 static int i82092aa_init(struct pcmcia_socket *sock) i82092aa_init() argument
406 i82092aa_set_io_map(sock, &io); i82092aa_init()
410 i82092aa_set_mem_map(sock, &mem); i82092aa_init()
419 unsigned int sock = container_of(socket, struct socket_info, socket)->number; i82092aa_get_status() local
424 status = indirect_read(sock,I365_STATUS); /* Interface Status Register */ i82092aa_get_status()
433 if (indirect_read(sock, I365_INTCTL) & I365_PC_IOCARD) { i82092aa_get_status()
462 unsigned int sock = container_of(socket, struct socket_info, socket)->number; i82092aa_set_socket() local
469 set_bridge_state(sock); i82092aa_set_socket()
479 indirect_write(sock,I365_INTCTL,reg); /* IGENC, Interrupt and General Control Register */ i82092aa_set_socket()
498 printk("setting voltage to Vcc to 5V on socket %i\n",sock); i82092aa_set_socket()
510 printk("not setting Vpp on socket %i\n",sock); i82092aa_set_socket()
513 printk("setting Vpp to 5.0 for socket %i\n",sock); i82092aa_set_socket()
526 if (reg != indirect_read(sock,I365_POWER)) /* only write if changed */ i82092aa_set_socket()
527 indirect_write(sock,I365_POWER,reg); i82092aa_set_socket()
550 indirect_write(sock,I365_CSCINT,reg); i82092aa_set_socket()
551 (void)indirect_read(sock,I365_CSC); i82092aa_set_socket()
559 unsigned int sock = container_of(socket, struct socket_info, socket)->number; i82092aa_set_io_map() local
577 if (indirect_read(sock, I365_ADDRWIN) & I365_ENA_IO(map)) i82092aa_set_io_map()
578 indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_IO(map)); i82092aa_set_io_map()
583 indirect_write16(sock,I365_IO(map)+I365_W_START,io->start); i82092aa_set_io_map()
584 indirect_write16(sock,I365_IO(map)+I365_W_STOP,io->stop); i82092aa_set_io_map()
586 ioctl = indirect_read(sock,I365_IOCTL) & ~I365_IOCTL_MASK(map); i82092aa_set_io_map()
591 indirect_write(sock,I365_IOCTL,ioctl); i82092aa_set_io_map()
595 indirect_setbit(sock,I365_ADDRWIN,I365_ENA_IO(map)); i82092aa_set_io_map()
604 unsigned int sock = sock_info->number; i82092aa_set_mem_map() local
625 sock, i82092aa_set_mem_map()
633 if (indirect_read(sock, I365_ADDRWIN) & I365_ENA_MEM(map)) i82092aa_set_mem_map()
634 indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_MEM(map)); i82092aa_set_mem_map()
637 /* printk("set_mem_map: Setting map %i range to %x - %x on socket %i, speed is %i, active = %i \n",map, region.start,region.end,sock,mem->speed,mem->flags & MAP_ACTIVE); */ i82092aa_set_mem_map()
646 indirect_write16(sock,base+I365_W_START,i); i82092aa_set_mem_map()
665 indirect_write16(sock,base+I365_W_STOP,i); i82092aa_set_mem_map()
673 /* printk("requesting attribute memory for socket %i\n",sock);*/ i82092aa_set_mem_map()
676 /* printk("requesting normal memory for socket %i\n",sock);*/ i82092aa_set_mem_map()
678 indirect_write16(sock,base+I365_W_OFF,i); i82092aa_set_mem_map()
682 indirect_setbit(sock, I365_ADDRWIN, I365_ENA_MEM(map)); i82092aa_set_mem_map()
H A Dvrc4171_card.c235 static int pccard_init(struct pcmcia_socket *sock) pccard_init() argument
240 sock->features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS; pccard_init()
241 sock->irq_mask = 0; pccard_init()
242 sock->map_size = 0x1000; pccard_init()
243 sock->pci_irq = vrc4171_irq; pccard_init()
245 slot = sock->sock; pccard_init()
254 static int pccard_get_status(struct pcmcia_socket *sock, u_int *value) pccard_get_status() argument
260 if (sock == NULL || sock->sock >= CARD_MAX_SLOTS || value == NULL) pccard_get_status()
263 slot = sock->sock; pccard_get_status()
318 static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state) pccard_set_socket() argument
324 if (sock == NULL || sock->sock >= CARD_MAX_SLOTS || pccard_set_socket()
329 slot = sock->sock; pccard_set_socket()
380 static int pccard_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) pccard_set_io_map() argument
386 if (sock == NULL || sock->sock >= CARD_MAX_SLOTS || pccard_set_io_map()
391 slot = sock->sock; pccard_set_io_map()
422 static int pccard_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *mem) pccard_set_mem_map() argument
429 if (sock == NULL || sock->sock >= CARD_MAX_SLOTS || pccard_set_mem_map()
438 slot = sock->sock; pccard_set_mem_map()
H A Dbcm63xx_pcmcia.c52 static int bcm63xx_pcmcia_sock_init(struct pcmcia_socket *sock) bcm63xx_pcmcia_sock_init() argument
63 static int bcm63xx_pcmcia_suspend(struct pcmcia_socket *sock) bcm63xx_pcmcia_suspend() argument
75 static int bcm63xx_pcmcia_set_socket(struct pcmcia_socket *sock, bcm63xx_pcmcia_set_socket() argument
82 skt = sock->driver_data; bcm63xx_pcmcia_set_socket()
249 static int bcm63xx_pcmcia_get_status(struct pcmcia_socket *sock, bcm63xx_pcmcia_get_status() argument
254 skt = sock->driver_data; bcm63xx_pcmcia_get_status()
290 static int bcm63xx_pcmcia_set_io_map(struct pcmcia_socket *sock, bcm63xx_pcmcia_set_io_map() argument
298 static int bcm63xx_pcmcia_set_mem_map(struct pcmcia_socket *sock, bcm63xx_pcmcia_set_mem_map() argument
304 skt = sock->driver_data; bcm63xx_pcmcia_set_mem_map()
329 struct pcmcia_socket *sock; bcm63xx_drv_pcmcia_probe() local
339 sock = &skt->socket; bcm63xx_drv_pcmcia_probe()
340 sock->driver_data = skt; bcm63xx_drv_pcmcia_probe()
377 sock->resource_ops = &pccard_static_ops; bcm63xx_drv_pcmcia_probe()
378 sock->ops = &bcm63xx_pcmcia_operations; bcm63xx_drv_pcmcia_probe()
379 sock->owner = THIS_MODULE; bcm63xx_drv_pcmcia_probe()
380 sock->dev.parent = &pdev->dev; bcm63xx_drv_pcmcia_probe()
381 sock->features = SS_CAP_STATIC_MAP | SS_CAP_PCCARD; bcm63xx_drv_pcmcia_probe()
382 sock->io_offset = (unsigned long)skt->io_base; bcm63xx_drv_pcmcia_probe()
383 sock->pci_irq = irq_res->start; bcm63xx_drv_pcmcia_probe()
386 sock->cb_dev = bcm63xx_cb_dev; bcm63xx_drv_pcmcia_probe()
388 sock->features |= SS_CAP_CARDBUS; bcm63xx_drv_pcmcia_probe()
392 sock->map_size = resource_size(skt->common_res); bcm63xx_drv_pcmcia_probe()
417 ret = pcmcia_register_socket(sock); bcm63xx_drv_pcmcia_probe()
H A Dtcic.h102 #define TCIC_PWR_VCC(sock) (0x01<<(sock))
104 #define TCIC_PWR_VPP(sock) (0x08<<(sock))
185 #define TCIC_SCF1(sock) ((sock)<<3)
186 #define TCIC_SCF2(sock) (((sock)<<3)+2)
217 #define TCIC_MWIN(sock,map) (0x100+(((map)+((sock)<<2))<<3))
245 #define TCIC_IWIN(sock,map) (0x200+(((map)+((sock)<<1))<<2))
/linux-4.1.27/net/bluetooth/bnep/
H A DMakefile7 bnep-objs := core.o sock.o netdev.o
H A Dsock.c36 static int bnep_sock_release(struct socket *sock) bnep_sock_release() argument
38 struct sock *sk = sock->sk; bnep_sock_release()
40 BT_DBG("sock %p sk %p", sock, sk); bnep_sock_release()
52 static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) bnep_sock_ioctl() argument
73 nsock = sockfd_lookup(ca.sock, &err); bnep_sock_ioctl()
138 static int bnep_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) bnep_sock_compat_ioctl() argument
162 return bnep_sock_ioctl(sock, cmd, arg); bnep_sock_compat_ioctl()
195 static int bnep_sock_create(struct net *net, struct socket *sock, int protocol, bnep_sock_create() argument
198 struct sock *sk; bnep_sock_create()
200 BT_DBG("sock %p", sock); bnep_sock_create()
202 if (sock->type != SOCK_RAW) bnep_sock_create()
209 sock_init_data(sock, sk); bnep_sock_create()
211 sock->ops = &bnep_sock_ops; bnep_sock_create()
213 sock->state = SS_UNCONNECTED; bnep_sock_create()
/linux-4.1.27/net/bluetooth/cmtp/
H A DMakefile7 cmtp-objs := core.o sock.o capi.o
H A Dsock.c38 #include <net/sock.h>
49 static int cmtp_sock_release(struct socket *sock) cmtp_sock_release() argument
51 struct sock *sk = sock->sk; cmtp_sock_release()
53 BT_DBG("sock %p sk %p", sock, sk); cmtp_sock_release()
66 static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) cmtp_sock_ioctl() argument
86 nsock = sockfd_lookup(ca.sock, &err); cmtp_sock_ioctl()
141 static int cmtp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) cmtp_sock_compat_ioctl() argument
165 return cmtp_sock_ioctl(sock, cmd, arg); cmtp_sock_compat_ioctl()
198 static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol, cmtp_sock_create() argument
201 struct sock *sk; cmtp_sock_create()
203 BT_DBG("sock %p", sock); cmtp_sock_create()
205 if (sock->type != SOCK_RAW) cmtp_sock_create()
212 sock_init_data(sock, sk); cmtp_sock_create()
214 sock->ops = &cmtp_sock_ops; cmtp_sock_create()
216 sock->state = SS_UNCONNECTED; cmtp_sock_create()
H A Dcore.c39 #include <net/sock.h>
196 struct socket *sock = session->sock; cmtp_send_frame() local
207 return kernel_sendmsg(sock, &msg, &iv, 1, len); cmtp_send_frame()
282 struct sock *sk = session->sock->sk; cmtp_session()
320 fput(session->sock->file); cmtp_session()
331 int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) cmtp_add_connection() argument
339 if (!l2cap_is_socket(sock)) cmtp_add_connection()
351 s = __cmtp_get_session(&l2cap_pi(sock->sk)->chan->dst); cmtp_add_connection()
357 bacpy(&session->bdaddr, &l2cap_pi(sock->sk)->chan->dst); cmtp_add_connection()
359 session->mtu = min_t(uint, l2cap_pi(sock->sk)->chan->omtu, cmtp_add_connection()
360 l2cap_pi(sock->sk)->chan->imtu); cmtp_add_connection()
366 session->sock = sock; cmtp_add_connection()
/linux-4.1.27/net/bluetooth/hidp/
H A DMakefile7 hidp-objs := core.o sock.o
H A Dsock.c32 static int hidp_sock_release(struct socket *sock) hidp_sock_release() argument
34 struct sock *sk = sock->sk; hidp_sock_release()
36 BT_DBG("sock %p sk %p", sock, sk); hidp_sock_release()
49 static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) hidp_sock_ioctl() argument
142 static int hidp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) hidp_sock_compat_ioctl() argument
195 return hidp_sock_ioctl(sock, cmd, arg); hidp_sock_compat_ioctl()
228 static int hidp_sock_create(struct net *net, struct socket *sock, int protocol, hidp_sock_create() argument
231 struct sock *sk; hidp_sock_create()
233 BT_DBG("sock %p", sock); hidp_sock_create()
235 if (sock->type != SOCK_RAW) hidp_sock_create()
242 sock_init_data(sock, sk); hidp_sock_create()
244 sock->ops = &hidp_sock_ops; hidp_sock_create()
246 sock->state = SS_UNCONNECTED; hidp_sock_create()
/linux-4.1.27/net/bluetooth/rfcomm/
H A DMakefile7 rfcomm-y := core.o sock.o
H A Dsock.c42 static void rfcomm_sock_close(struct sock *sk);
43 static void rfcomm_sock_kill(struct sock *sk);
51 struct sock *sk = d->owner; rfcomm_sk_data_ready()
65 struct sock *sk = d->owner, *parent; rfcomm_sk_state_change()
108 static struct sock *__rfcomm_get_listen_sock_by_addr(u8 channel, bdaddr_t *src) __rfcomm_get_listen_sock_by_addr()
110 struct sock *sk = NULL; __rfcomm_get_listen_sock_by_addr()
129 static struct sock *rfcomm_get_sock_by_channel(int state, u8 channel, bdaddr_t *src) rfcomm_get_sock_by_channel()
131 struct sock *sk = NULL, *sk1 = NULL; rfcomm_get_sock_by_channel()
155 static void rfcomm_sock_destruct(struct sock *sk) rfcomm_sock_destruct()
175 static void rfcomm_sock_cleanup_listen(struct sock *parent) rfcomm_sock_cleanup_listen()
177 struct sock *sk; rfcomm_sock_cleanup_listen()
194 static void rfcomm_sock_kill(struct sock *sk) rfcomm_sock_kill()
207 static void __rfcomm_sock_close(struct sock *sk) __rfcomm_sock_close()
233 static void rfcomm_sock_close(struct sock *sk) rfcomm_sock_close()
240 static void rfcomm_sock_init(struct sock *sk, struct sock *parent) rfcomm_sock_init()
272 static struct sock *rfcomm_sock_alloc(struct net *net, struct socket *sock, int proto, gfp_t prio) rfcomm_sock_alloc() argument
275 struct sock *sk; rfcomm_sock_alloc()
281 sock_init_data(sock, sk); rfcomm_sock_alloc()
313 static int rfcomm_sock_create(struct net *net, struct socket *sock, rfcomm_sock_create() argument
316 struct sock *sk; rfcomm_sock_create()
318 BT_DBG("sock %p", sock); rfcomm_sock_create()
320 sock->state = SS_UNCONNECTED; rfcomm_sock_create()
322 if (sock->type != SOCK_STREAM && sock->type != SOCK_RAW) rfcomm_sock_create()
325 sock->ops = &rfcomm_sock_ops; rfcomm_sock_create()
327 sk = rfcomm_sock_alloc(net, sock, protocol, GFP_ATOMIC); rfcomm_sock_create()
335 static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) rfcomm_sock_bind() argument
338 struct sock *sk = sock->sk; rfcomm_sock_bind()
377 static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags) rfcomm_sock_connect() argument
380 struct sock *sk = sock->sk; rfcomm_sock_connect()
420 static int rfcomm_sock_listen(struct socket *sock, int backlog) rfcomm_sock_listen() argument
422 struct sock *sk = sock->sk; rfcomm_sock_listen()
469 static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int flags) rfcomm_sock_accept() argument
472 struct sock *sk = sock->sk, *nsk; rfcomm_sock_accept()
529 static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer) rfcomm_sock_getname() argument
532 struct sock *sk = sock->sk; rfcomm_sock_getname()
534 BT_DBG("sock %p, sk %p", sock, sk); rfcomm_sock_getname()
552 static int rfcomm_sock_sendmsg(struct socket *sock, struct msghdr *msg, rfcomm_sock_sendmsg() argument
555 struct sock *sk = sock->sk; rfcomm_sock_sendmsg()
569 BT_DBG("sock %p, sk %p", sock, sk); rfcomm_sock_sendmsg()
618 static int rfcomm_sock_recvmsg(struct socket *sock, struct msghdr *msg, rfcomm_sock_recvmsg() argument
621 struct sock *sk = sock->sk; rfcomm_sock_recvmsg()
630 len = bt_sock_stream_recvmsg(sock, msg, size, flags); rfcomm_sock_recvmsg()
643 static int rfcomm_sock_setsockopt_old(struct socket *sock, int optname, char __user *optval, unsigned int optlen) rfcomm_sock_setsockopt_old() argument
645 struct sock *sk = sock->sk; rfcomm_sock_setsockopt_old()
684 static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) rfcomm_sock_setsockopt() argument
686 struct sock *sk = sock->sk; rfcomm_sock_setsockopt()
695 return rfcomm_sock_setsockopt_old(sock, optname, optval, optlen); rfcomm_sock_setsockopt()
752 static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen) rfcomm_sock_getsockopt_old() argument
754 struct sock *sk = sock->sk; rfcomm_sock_getsockopt_old()
755 struct sock *l2cap_sk; rfcomm_sock_getsockopt_old()
805 l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk; rfcomm_sock_getsockopt_old()
827 static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen) rfcomm_sock_getsockopt() argument
829 struct sock *sk = sock->sk; rfcomm_sock_getsockopt()
836 return rfcomm_sock_getsockopt_old(sock, optname, optval, optlen); rfcomm_sock_getsockopt()
883 static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) rfcomm_sock_ioctl() argument
885 struct sock *sk __maybe_unused = sock->sk; rfcomm_sock_ioctl()
890 err = bt_sock_ioctl(sock, cmd, arg); rfcomm_sock_ioctl()
905 static int rfcomm_sock_shutdown(struct socket *sock, int how) rfcomm_sock_shutdown() argument
907 struct sock *sk = sock->sk; rfcomm_sock_shutdown()
910 BT_DBG("sock %p, sk %p", sock, sk); rfcomm_sock_shutdown()
928 static int rfcomm_sock_release(struct socket *sock) rfcomm_sock_release() argument
930 struct sock *sk = sock->sk; rfcomm_sock_release()
933 BT_DBG("sock %p, sk %p", sock, sk); rfcomm_sock_release()
938 err = rfcomm_sock_shutdown(sock, 2); rfcomm_sock_release()
951 struct sock *sk, *parent; rfcomm_connect_ind()
1001 struct sock *sk; rfcomm_sock_debugfs_show()
/linux-4.1.27/net/ipv4/
H A Dudp_tunnel.c15 struct socket *sock = NULL; udp_sock_create4() local
18 err = sock_create_kern(AF_INET, SOCK_DGRAM, 0, &sock); udp_sock_create4()
22 sk_change_net(sock->sk, net); udp_sock_create4()
27 err = kernel_bind(sock, (struct sockaddr *)&udp_addr, udp_sock_create4()
36 err = kernel_connect(sock, (struct sockaddr *)&udp_addr, udp_sock_create4()
42 sock->sk->sk_no_check_tx = !cfg->use_udp_checksums; udp_sock_create4()
44 *sockp = sock; udp_sock_create4()
48 if (sock) { udp_sock_create4()
49 kernel_sock_shutdown(sock, SHUT_RDWR); udp_sock_create4()
50 sk_release_kernel(sock->sk); udp_sock_create4()
57 void setup_udp_tunnel_sock(struct net *net, struct socket *sock, setup_udp_tunnel_sock() argument
60 struct sock *sk = sock->sk; setup_udp_tunnel_sock()
74 udp_tunnel_encap_enable(sock); setup_udp_tunnel_sock()
78 int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb, udp_tunnel_xmit_skb()
100 void udp_tunnel_sock_release(struct socket *sock) udp_tunnel_sock_release() argument
102 rcu_assign_sk_user_data(sock->sk, NULL); udp_tunnel_sock_release()
103 kernel_sock_shutdown(sock, SHUT_RDWR); udp_tunnel_sock_release()
104 sk_release_kernel(sock->sk); udp_tunnel_sock_release()
H A Dudp_impl.h11 int udp_v4_get_port(struct sock *sk, unsigned short snum);
13 int udp_setsockopt(struct sock *sk, int level, int optname,
15 int udp_getsockopt(struct sock *sk, int level, int optname,
19 int compat_udp_setsockopt(struct sock *sk, int level, int optname,
21 int compat_udp_getsockopt(struct sock *sk, int level, int optname,
24 int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
26 int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
28 int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
29 void udp_destroy_sock(struct sock *sk);
H A Dtcp_vegas.h18 void tcp_vegas_init(struct sock *sk);
19 void tcp_vegas_state(struct sock *sk, u8 ca_state);
20 void tcp_vegas_pkts_acked(struct sock *sk, u32 cnt, s32 rtt_us);
21 void tcp_vegas_cwnd_event(struct sock *sk, enum tcp_ca_event event);
22 size_t tcp_vegas_get_info(struct sock *sk, u32 ext, int *attr,
H A Daf_inet.c13 * Changes (see also sock.c)
22 * Alan Cox : Keep correct socket pointer on sock
111 #include <net/sock.h>
131 void inet_sock_destruct(struct sock *sk) inet_sock_destruct()
172 static int inet_autobind(struct sock *sk) inet_autobind()
192 int inet_listen(struct socket *sock, int backlog) inet_listen() argument
194 struct sock *sk = sock->sk; inet_listen()
201 if (sock->state != SS_UNCONNECTED || sock->type != SOCK_STREAM) inet_listen()
251 static int inet_create(struct net *net, struct socket *sock, int protocol, inet_create() argument
254 struct sock *sk; inet_create()
265 sock->state = SS_UNCONNECTED; inet_create()
271 list_for_each_entry_rcu(answer, &inetsw[sock->type], list) { inet_create()
299 PF_INET, protocol, sock->type); inet_create()
313 if (sock->type == SOCK_RAW && !kern && inet_create()
317 sock->ops = answer->ops; inet_create()
338 if (SOCK_RAW == sock->type) { inet_create()
351 sock_init_data(sock, sk); inet_create()
396 int inet_release(struct socket *sock) inet_release() argument
398 struct sock *sk = sock->sk; inet_release()
417 sock->sk = NULL; inet_release()
424 int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) inet_bind() argument
427 struct sock *sk = sock->sk; inet_bind()
518 int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, inet_dgram_connect() argument
521 struct sock *sk = sock->sk; inet_dgram_connect()
534 static long inet_wait_for_connect(struct sock *sk, long timeo, int writebias) inet_wait_for_connect()
563 int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, __inet_stream_connect() argument
566 struct sock *sk = sock->sk; __inet_stream_connect()
575 sock->state = err ? SS_DISCONNECTING : SS_UNCONNECTED; __inet_stream_connect()
579 switch (sock->state) { __inet_stream_connect()
599 sock->state = SS_CONNECTING; __inet_stream_connect()
636 sock->state = SS_CONNECTED; __inet_stream_connect()
643 sock->state = SS_UNCONNECTED; __inet_stream_connect()
645 sock->state = SS_DISCONNECTING; __inet_stream_connect()
650 int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, inet_stream_connect() argument
655 lock_sock(sock->sk); inet_stream_connect()
656 err = __inet_stream_connect(sock, uaddr, addr_len, flags); inet_stream_connect()
657 release_sock(sock->sk); inet_stream_connect()
666 int inet_accept(struct socket *sock, struct socket *newsock, int flags) inet_accept() argument
668 struct sock *sk1 = sock->sk; inet_accept()
670 struct sock *sk2 = sk1->sk_prot->accept(sk1, flags, &err); inet_accept()
696 int inet_getname(struct socket *sock, struct sockaddr *uaddr, inet_getname() argument
699 struct sock *sk = sock->sk; inet_getname()
724 int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) inet_sendmsg() argument
726 struct sock *sk = sock->sk; inet_sendmsg()
739 ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, inet_sendpage() argument
742 struct sock *sk = sock->sk; inet_sendpage()
753 return sock_no_sendpage(sock, page, offset, size, flags); inet_sendpage()
757 int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, inet_recvmsg() argument
760 struct sock *sk = sock->sk; inet_recvmsg()
774 int inet_shutdown(struct socket *sock, int how) inet_shutdown() argument
776 struct sock *sk = sock->sk; inet_shutdown()
789 if (sock->state == SS_CONNECTING) { inet_shutdown()
792 sock->state = SS_DISCONNECTING; inet_shutdown()
794 sock->state = SS_CONNECTED; inet_shutdown()
818 sock->state = err ? SS_DISCONNECTING : SS_UNCONNECTED; inet_shutdown()
839 int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) inet_ioctl() argument
841 struct sock *sk = sock->sk; inet_ioctl()
887 static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) inet_compat_ioctl() argument
889 struct sock *sk = sock->sk; inet_compat_ioctl()
1105 static int inet_sk_reselect_saddr(struct sock *sk) inet_sk_reselect_saddr()
1154 int inet_sk_rebuild_header(struct sock *sk) inet_sk_rebuild_header()
1391 int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) inet_recv_error()
1433 int inet_ctl_sock_create(struct sock **sk, unsigned short family, inet_ctl_sock_create()
1437 struct socket *sock; inet_ctl_sock_create() local
1438 int rc = sock_create_kern(family, type, protocol, &sock); inet_ctl_sock_create()
1441 *sk = sock->sk; inet_ctl_sock_create()
H A Dgeneve.c75 if (inet_sk(gs->sock->sk)->inet_sport == port && geneve_find_sock()
76 inet_sk(gs->sock->sk)->sk.sk_family == family) geneve_find_sock()
139 return udp_tunnel_xmit_skb(rt, gs->sock->sk, skb, src, dst, geneve_xmit_skb()
242 struct sock *sk = gs->sock->sk; geneve_notify_add_rx_port()
256 struct sock *sk = gs->sock->sk; geneve_notify_del_rx_port()
264 static int geneve_udp_encap_recv(struct sock *sk, struct sk_buff *skb) geneve_udp_encap_recv()
308 struct socket *sock; geneve_create_sock() local
324 err = udp_sock_create(net, &udp_conf, &sock); geneve_create_sock()
328 return sock; geneve_create_sock()
338 struct socket *sock; geneve_socket_create() local
345 sock = geneve_create_sock(net, ipv6, port); geneve_socket_create()
346 if (IS_ERR(sock)) { geneve_socket_create()
348 return ERR_CAST(sock); geneve_socket_create()
351 gs->sock = sock; geneve_socket_create()
367 setup_udp_tunnel_sock(net, sock, &tunnel_cfg); geneve_socket_create()
407 udp_tunnel_sock_release(gs->sock); geneve_sock_release()
H A Dinet_hashtables.c42 u32 sk_ehashfn(const struct sock *sk) sk_ehashfn()
90 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, inet_bind_hash()
104 * Get rid of any references to a local port held by the given sock.
106 static void __inet_put_port(struct sock *sk) __inet_put_port()
126 void inet_put_port(struct sock *sk) inet_put_port()
134 int __inet_inherit_port(struct sock *sk, struct sock *child) __inet_inherit_port()
172 static inline int compute_score(struct sock *sk, struct net *net, compute_score()
199 * BSD API does not allow a listening sock to specify the remote port nor the
205 struct sock *__inet_lookup_listener(struct net *net, __inet_lookup_listener()
211 struct sock *sk, *result; __inet_lookup_listener()
262 void sock_gen_put(struct sock *sk) sock_gen_put()
282 struct sock *__inet_lookup_established(struct net *net, __inet_lookup_established()
290 struct sock *sk; __inet_lookup_established()
333 struct sock *sk, __u16 lport, __inet_check_established()
348 struct sock *sk2; __inet_check_established()
402 static inline u32 inet_sk_port_offset(const struct sock *sk) inet_sk_port_offset()
410 int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw) __inet_hash_nolisten()
437 int __inet_hash(struct sock *sk, struct inet_timewait_sock *tw) __inet_hash()
456 void inet_hash(struct sock *sk) inet_hash()
466 void inet_unhash(struct sock *sk) inet_unhash()
489 struct sock *sk, u32 port_offset, __inet_hash_connect()
491 struct sock *, __u16, struct inet_timewait_sock **)) __inet_hash_connect()
600 struct sock *sk) inet_hash_connect()
H A Dtcp_scalable.c18 static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 acked) tcp_scalable_cong_avoid()
32 static u32 tcp_scalable_ssthresh(struct sock *sk) tcp_scalable_ssthresh()
/linux-4.1.27/drivers/memstick/host/
H A Dtifm_ms.c89 struct tifm_dev *sock = host->dev; tifm_ms_read_data() local
102 while (!(TIFM_MS_STAT_EMP & readl(sock->addr + SOCK_MS_STATUS))) { tifm_ms_read_data()
105 *(unsigned int *)(buf + off) = __raw_readl(sock->addr tifm_ms_read_data()
112 && !(TIFM_MS_STAT_EMP & readl(sock->addr + SOCK_MS_STATUS))) { tifm_ms_read_data()
113 host->io_word = readl(sock->addr + SOCK_MS_DATA); tifm_ms_read_data()
129 struct tifm_dev *sock = host->dev; tifm_ms_write_data() local
141 && !(TIFM_MS_STAT_FUL & readl(sock->addr + SOCK_MS_STATUS))) { tifm_ms_write_data()
142 writel(TIFM_MS_SYS_FDIR | readl(sock->addr + SOCK_MS_SYSTEM), tifm_ms_write_data()
143 sock->addr + SOCK_MS_SYSTEM); tifm_ms_write_data()
144 writel(host->io_word, sock->addr + SOCK_MS_DATA); tifm_ms_write_data()
154 while (!(TIFM_MS_STAT_FUL & readl(sock->addr + SOCK_MS_STATUS))) { tifm_ms_write_data()
157 writel(TIFM_MS_SYS_FDIR | readl(sock->addr + SOCK_MS_SYSTEM), tifm_ms_write_data()
158 sock->addr + SOCK_MS_SYSTEM); tifm_ms_write_data()
160 sock->addr + SOCK_MS_DATA); tifm_ms_write_data()
184 struct tifm_dev *sock = host->dev; tifm_ms_transfer_data() local
199 dev_dbg(&sock->dev, "fifo data transfer, %d, %d\n", length, tifm_ms_transfer_data()
235 dev_dbg(&sock->dev, "fifo data transfer, %d remaining\n", length); tifm_ms_transfer_data()
239 | readl(sock->addr + SOCK_MS_SYSTEM), tifm_ms_transfer_data()
240 sock->addr + SOCK_MS_SYSTEM); tifm_ms_transfer_data()
241 writel(host->io_word, sock->addr + SOCK_MS_DATA); tifm_ms_transfer_data()
244 | readl(sock->addr + SOCK_MS_SYSTEM), tifm_ms_transfer_data()
245 sock->addr + SOCK_MS_SYSTEM); tifm_ms_transfer_data()
246 writel(0, sock->addr + SOCK_MS_DATA); tifm_ms_transfer_data()
248 readl(sock->addr + SOCK_MS_DATA); tifm_ms_transfer_data()
256 struct tifm_dev *sock = host->dev; tifm_ms_issue_cmd() local
280 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); tifm_ms_issue_cmd()
282 sock->addr + SOCK_FIFO_CONTROL); tifm_ms_issue_cmd()
285 if (1 != tifm_map_sg(sock, &host->req->sg, 1, tifm_ms_issue_cmd()
295 sock->addr + SOCK_FIFO_PAGE_SIZE); tifm_ms_issue_cmd()
297 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); tifm_ms_issue_cmd()
303 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); tifm_ms_issue_cmd()
306 sock->addr + SOCK_DMA_ADDRESS); tifm_ms_issue_cmd()
307 writel(sys_param, sock->addr + SOCK_DMA_CONTROL); tifm_ms_issue_cmd()
310 sock->addr + SOCK_MS_SYSTEM); tifm_ms_issue_cmd()
313 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); tifm_ms_issue_cmd()
317 writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), tifm_ms_issue_cmd()
318 sock->addr + SOCK_CONTROL); tifm_ms_issue_cmd()
321 sys_param = readl(sock->addr + SOCK_MS_SYSTEM); tifm_ms_issue_cmd()
329 writel(sys_param, sock->addr + SOCK_MS_SYSTEM); tifm_ms_issue_cmd()
333 writel(cmd, sock->addr + SOCK_MS_COMMAND); tifm_ms_issue_cmd()
335 dev_dbg(&sock->dev, "executing TPC %x, %x\n", cmd, sys_param); tifm_ms_issue_cmd()
341 struct tifm_dev *sock = host->dev; tifm_ms_complete_cmd() local
342 struct memstick_host *msh = tifm_get_drvdata(sock); tifm_ms_complete_cmd()
347 host->req->int_reg = readl(sock->addr + SOCK_MS_STATUS) & 0xff; tifm_ms_complete_cmd()
352 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); tifm_ms_complete_cmd()
353 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); tifm_ms_complete_cmd()
356 tifm_unmap_sg(sock, &host->req->sg, 1, tifm_ms_complete_cmd()
362 writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), tifm_ms_complete_cmd()
363 sock->addr + SOCK_CONTROL); tifm_ms_complete_cmd()
365 dev_dbg(&sock->dev, "TPC complete\n"); tifm_ms_complete_cmd()
386 static void tifm_ms_data_event(struct tifm_dev *sock) tifm_ms_data_event() argument
392 spin_lock(&sock->lock); tifm_ms_data_event()
393 host = memstick_priv((struct memstick_host *)tifm_get_drvdata(sock)); tifm_ms_data_event()
394 fifo_status = readl(sock->addr + SOCK_DMA_FIFO_STATUS); tifm_ms_data_event()
395 host_status = readl(sock->addr + SOCK_MS_STATUS); tifm_ms_data_event()
396 dev_dbg(&sock->dev, tifm_ms_data_event()
413 writel(fifo_status, sock->addr + SOCK_DMA_FIFO_STATUS); tifm_ms_data_event()
417 spin_unlock(&sock->lock); tifm_ms_data_event()
422 static void tifm_ms_card_event(struct tifm_dev *sock) tifm_ms_card_event() argument
428 spin_lock(&sock->lock); tifm_ms_card_event()
429 host = memstick_priv((struct memstick_host *)tifm_get_drvdata(sock)); tifm_ms_card_event()
430 host_status = readl(sock->addr + SOCK_MS_STATUS); tifm_ms_card_event()
431 dev_dbg(&sock->dev, "host event: host_status %x, flags %x\n", tifm_ms_card_event()
450 writel(TIFM_MS_SYS_INTCLR | readl(sock->addr + SOCK_MS_SYSTEM), tifm_ms_card_event()
451 sock->addr + SOCK_MS_SYSTEM); tifm_ms_card_event()
456 spin_unlock(&sock->lock); tifm_ms_card_event()
464 struct tifm_dev *sock = host->dev; tifm_ms_req_tasklet() local
468 spin_lock_irqsave(&sock->lock, flags); tifm_ms_req_tasklet()
476 spin_unlock_irqrestore(&sock->lock, flags); tifm_ms_req_tasklet()
484 spin_unlock_irqrestore(&sock->lock, flags); tifm_ms_req_tasklet()
504 struct tifm_dev *sock = host->dev; tifm_ms_set_param() local
511 writel(TIFM_MS_SYS_RESET, sock->addr + SOCK_MS_SYSTEM); tifm_ms_set_param()
513 sock->addr + SOCK_MS_SYSTEM); tifm_ms_set_param()
514 writel(0xffffffff, sock->addr + SOCK_MS_STATUS); tifm_ms_set_param()
517 sock->addr + SOCK_MS_SYSTEM); tifm_ms_set_param()
518 writel(0xffffffff, sock->addr + SOCK_MS_STATUS); tifm_ms_set_param()
526 & readl(sock->addr + SOCK_CONTROL), tifm_ms_set_param()
527 sock->addr + SOCK_CONTROL); tifm_ms_set_param()
531 | readl(sock->addr + SOCK_CONTROL), tifm_ms_set_param()
532 sock->addr + SOCK_CONTROL); tifm_ms_set_param()
556 static int tifm_ms_probe(struct tifm_dev *sock) tifm_ms_probe() argument
563 & readl(sock->addr + SOCK_PRESENT_STATE))) { tifm_ms_probe()
565 dev_name(&sock->dev)); tifm_ms_probe()
569 msh = memstick_alloc_host(sizeof(struct tifm_ms), &sock->dev); tifm_ms_probe()
574 tifm_set_drvdata(sock, msh); tifm_ms_probe()
575 host->dev = sock; tifm_ms_probe()
583 sock->card_event = tifm_ms_card_event; tifm_ms_probe()
584 sock->data_event = tifm_ms_data_event; tifm_ms_probe()
585 if (tifm_has_ms_pif(sock)) tifm_ms_probe()
596 static void tifm_ms_remove(struct tifm_dev *sock) tifm_ms_remove() argument
598 struct memstick_host *msh = tifm_get_drvdata(sock); tifm_ms_remove()
605 spin_lock_irqsave(&sock->lock, flags); tifm_ms_remove()
610 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); tifm_ms_remove()
611 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); tifm_ms_remove()
613 tifm_unmap_sg(sock, &host->req->sg, 1, tifm_ms_remove()
625 spin_unlock_irqrestore(&sock->lock, flags); tifm_ms_remove()
633 static int tifm_ms_suspend(struct tifm_dev *sock, pm_message_t state) tifm_ms_suspend() argument
635 struct memstick_host *msh = tifm_get_drvdata(sock); tifm_ms_suspend()
641 static int tifm_ms_resume(struct tifm_dev *sock) tifm_ms_resume() argument
643 struct memstick_host *msh = tifm_get_drvdata(sock); tifm_ms_resume()
/linux-4.1.27/net/atm/
H A Dpvc.c15 #include <net/sock.h> /* for sock_no_* */
21 static int pvc_shutdown(struct socket *sock, int how) pvc_shutdown() argument
26 static int pvc_bind(struct socket *sock, struct sockaddr *sockaddr, pvc_bind() argument
29 struct sock *sk = sock->sk; pvc_bind()
40 vcc = ATM_SD(sock); pvc_bind()
51 error = vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi, pvc_bind()
58 static int pvc_connect(struct socket *sock, struct sockaddr *sockaddr, pvc_connect() argument
61 return pvc_bind(sock, sockaddr, sockaddr_len); pvc_connect()
64 static int pvc_setsockopt(struct socket *sock, int level, int optname, pvc_setsockopt() argument
67 struct sock *sk = sock->sk; pvc_setsockopt()
71 error = vcc_setsockopt(sock, level, optname, optval, optlen); pvc_setsockopt()
76 static int pvc_getsockopt(struct socket *sock, int level, int optname, pvc_getsockopt() argument
79 struct sock *sk = sock->sk; pvc_getsockopt()
83 error = vcc_getsockopt(sock, level, optname, optval, optlen); pvc_getsockopt()
88 static int pvc_getname(struct socket *sock, struct sockaddr *sockaddr, pvc_getname() argument
92 struct atm_vcc *vcc = ATM_SD(sock); pvc_getname()
132 static int pvc_create(struct net *net, struct socket *sock, int protocol, pvc_create() argument
138 sock->ops = &pvc_proto_ops; pvc_create()
139 return vcc_create(net, sock, protocol, PF_ATMPVC); pvc_create()
H A Dcommon.h13 int vcc_create(struct net *net, struct socket *sock, int protocol, int family);
14 int vcc_release(struct socket *sock);
15 int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
16 int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
18 int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len);
19 unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
20 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
21 int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
22 int vcc_setsockopt(struct socket *sock, int level, int optname,
24 int vcc_getsockopt(struct socket *sock, int level, int optname,
H A Dsvc.c21 #include <net/sock.h> /* for sock_no_* */
30 static int svc_create(struct net *net, struct socket *sock, int protocol,
40 static int svc_shutdown(struct socket *sock, int how) svc_shutdown() argument
49 struct sock *sk = sk_atm(vcc); svc_disconnect()
74 static int svc_release(struct socket *sock) svc_release() argument
76 struct sock *sk = sock->sk; svc_release()
80 vcc = ATM_SD(sock); svc_release()
89 vcc_release(sock); svc_release()
94 static int svc_bind(struct socket *sock, struct sockaddr *sockaddr, svc_bind() argument
98 struct sock *sk = sock->sk; svc_bind()
106 if (sock->state == SS_CONNECTED) { svc_bind()
110 if (sock->state != SS_UNCONNECTED) { svc_bind()
114 vcc = ATM_SD(sock); svc_bind()
150 static int svc_connect(struct socket *sock, struct sockaddr *sockaddr, svc_connect() argument
154 struct sock *sk = sock->sk; svc_connect()
156 struct atm_vcc *vcc = ATM_SD(sock); svc_connect()
166 switch (sock->state) { svc_connect()
178 sock->state = SS_UNCONNECTED; svc_connect()
208 sock->state = SS_CONNECTING; svc_connect()
271 error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci); svc_connect()
273 sock->state = SS_CONNECTED; svc_connect()
281 static int svc_listen(struct socket *sock, int backlog) svc_listen() argument
284 struct sock *sk = sock->sk; svc_listen()
285 struct atm_vcc *vcc = ATM_SD(sock); svc_listen()
321 static int svc_accept(struct socket *sock, struct socket *newsock, int flags) svc_accept() argument
323 struct sock *sk = sock->sk; svc_accept()
326 struct atm_vcc *old_vcc = ATM_SD(sock); svc_accept()
419 static int svc_getname(struct socket *sock, struct sockaddr *sockaddr, svc_getname() argument
426 memcpy(addr, peer ? &ATM_SD(sock)->remote : &ATM_SD(sock)->local, svc_getname()
433 struct sock *sk = sk_atm(vcc); svc_change_qos()
452 static int svc_setsockopt(struct socket *sock, int level, int optname, svc_setsockopt() argument
455 struct sock *sk = sock->sk; svc_setsockopt()
456 struct atm_vcc *vcc = ATM_SD(sock); svc_setsockopt()
489 error = vcc_setsockopt(sock, level, optname, optval, optlen); svc_setsockopt()
497 static int svc_getsockopt(struct socket *sock, int level, int optname, svc_getsockopt() argument
500 struct sock *sk = sock->sk; svc_getsockopt()
505 error = vcc_getsockopt(sock, level, optname, optval, optlen); svc_getsockopt()
516 if (copy_to_user(optval, &ATM_SD(sock)->sap, sizeof(struct atm_sap))) { svc_getsockopt()
525 static int svc_addparty(struct socket *sock, struct sockaddr *sockaddr, svc_addparty() argument
529 struct sock *sk = sock->sk; svc_addparty()
530 struct atm_vcc *vcc = ATM_SD(sock); svc_addparty()
555 static int svc_dropparty(struct socket *sock, int ep_ref) svc_dropparty() argument
558 struct sock *sk = sock->sk; svc_dropparty()
559 struct atm_vcc *vcc = ATM_SD(sock); svc_dropparty()
582 static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) svc_ioctl() argument
586 struct atm_vcc *vcc = ATM_SD(sock); svc_ioctl()
594 error = svc_addparty(sock, (struct sockaddr *)&sa, sizeof(sa), svc_ioctl()
602 error = svc_dropparty(sock, ep_ref); svc_ioctl()
605 error = vcc_ioctl(sock, cmd, arg); svc_ioctl()
612 static int svc_compat_ioctl(struct socket *sock, unsigned int cmd, svc_compat_ioctl() argument
622 return svc_ioctl(sock, cmd, arg); svc_compat_ioctl()
624 return vcc_compat_ioctl(sock, cmd, arg); svc_compat_ioctl()
654 static int svc_create(struct net *net, struct socket *sock, int protocol, svc_create() argument
662 sock->ops = &svc_proto_ops; svc_create()
663 error = vcc_create(net, sock, protocol, AF_ATMSVC); svc_create()
666 ATM_SD(sock)->local.sas_family = AF_ATMSVC; svc_create()
667 ATM_SD(sock)->remote.sas_family = AF_ATMSVC; svc_create()
H A Dioctl.c50 static int do_vcc_ioctl(struct socket *sock, unsigned int cmd, do_vcc_ioctl() argument
53 struct sock *sk = sock->sk; do_vcc_ioctl()
59 vcc = ATM_SD(sock); do_vcc_ioctl()
62 if (sock->state != SS_CONNECTED || do_vcc_ioctl()
74 if (sock->state != SS_CONNECTED) { do_vcc_ioctl()
132 sock->state = SS_CONNECTED; do_vcc_ioctl()
169 error = ic->ioctl(sock, cmd, arg); do_vcc_ioctl()
186 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) vcc_ioctl() argument
188 return do_vcc_ioctl(sock, cmd, arg, 0); vcc_ioctl()
245 static int do_atm_iobuf(struct socket *sock, unsigned int cmd, do_atm_iobuf() argument
265 err = do_vcc_ioctl(sock, cmd, (unsigned long) iobuf, 0); do_atm_iobuf()
276 static int do_atmif_sioc(struct socket *sock, unsigned int cmd, do_atmif_sioc() argument
295 err = do_vcc_ioctl(sock, cmd, (unsigned long) sioc, 0); do_atmif_sioc()
305 static int do_atm_ioctl(struct socket *sock, unsigned int cmd32, do_atm_ioctl() argument
320 return do_atmif_sioc(sock, cmd32, arg); do_atm_ioctl()
334 return do_atm_iobuf(sock, cmd, arg); do_atm_ioctl()
352 return do_atmif_sioc(sock, cmd, arg); do_atm_ioctl()
358 int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, vcc_compat_ioctl() argument
363 ret = do_vcc_ioctl(sock, cmd, arg, 1); vcc_compat_ioctl()
367 return do_atm_ioctl(sock, cmd, arg); vcc_compat_ioctl()
H A Dcommon.c22 #include <net/sock.h> /* struct sock */
42 static void __vcc_insert_socket(struct sock *sk) __vcc_insert_socket()
50 void vcc_insert_socket(struct sock *sk) vcc_insert_socket()
58 static void vcc_remove_socket(struct sock *sk) vcc_remove_socket()
68 struct sock *sk = sk_atm(vcc); alloc_tx()
82 static void vcc_sock_destruct(struct sock *sk) vcc_sock_destruct()
93 static void vcc_def_wakeup(struct sock *sk) vcc_def_wakeup()
104 static inline int vcc_writable(struct sock *sk) vcc_writable()
112 static void vcc_write_space(struct sock *sk) vcc_write_space()
129 static void vcc_release_cb(struct sock *sk) vcc_release_cb()
144 int vcc_create(struct net *net, struct socket *sock, int protocol, int family) vcc_create() argument
146 struct sock *sk; vcc_create()
149 sock->sk = NULL; vcc_create()
150 if (sock->type == SOCK_STREAM) vcc_create()
155 sock_init_data(sock, sk); vcc_create()
177 static void vcc_destroy_socket(struct sock *sk) vcc_destroy_socket()
203 int vcc_release(struct socket *sock) vcc_release() argument
205 struct sock *sk = sock->sk; vcc_release()
209 vcc_destroy_socket(sock->sk); vcc_release()
219 struct sock *sk = sk_atm(vcc); vcc_release_async()
274 struct sock *s; atm_dev_release_vccs()
320 struct sock *s; check_ci()
389 struct sock *sk = sk_atm(vcc); __vcc_connect()
466 int vcc_connect(struct socket *sock, int itf, short vpi, int vci) vcc_connect() argument
469 struct atm_vcc *vcc = ATM_SD(sock); vcc_connect()
473 if (sock->state == SS_CONNECTED) vcc_connect()
475 if (sock->state != SS_UNCONNECTED) vcc_connect()
521 if (test_bit(ATM_VF_READY, &ATM_SD(sock)->flags)) vcc_connect()
522 sock->state = SS_CONNECTED; vcc_connect()
526 int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, vcc_recvmsg() argument
529 struct sock *sk = sock->sk; vcc_recvmsg()
534 if (sock->state != SS_CONNECTED) vcc_recvmsg()
541 vcc = ATM_SD(sock); vcc_recvmsg()
572 int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size) vcc_sendmsg() argument
574 struct sock *sk = sock->sk; vcc_sendmsg()
581 if (sock->state != SS_CONNECTED) { vcc_sendmsg()
589 vcc = ATM_SD(sock); vcc_sendmsg()
647 unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait) vcc_poll() argument
649 struct sock *sk = sock->sk; vcc_poll()
656 vcc = ATM_SD(sock); vcc_poll()
671 if (sock->state == SS_CONNECTING && vcc_poll()
743 int vcc_setsockopt(struct socket *sock, int level, int optname, vcc_setsockopt() argument
753 vcc = ATM_SD(sock); vcc_setsockopt()
764 if (sock->state == SS_CONNECTED) vcc_setsockopt()
766 if (sock->state != SS_UNCONNECTED) vcc_setsockopt()
790 int vcc_getsockopt(struct socket *sock, int level, int optname, vcc_getsockopt() argument
801 vcc = ATM_SD(sock); vcc_getsockopt()
/linux-4.1.27/drivers/misc/
H A Dtifm_core.c38 static int tifm_dev_match(struct tifm_dev *sock, struct tifm_device_id *id) tifm_dev_match() argument
40 if (sock->type == id->type) tifm_dev_match()
47 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_bus_match() local
54 if (tifm_dev_match(sock, ids)) tifm_bus_match()
64 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_uevent() local
66 if (add_uevent_var(env, "TIFM_CARD_TYPE=%s", tifm_media_type_name(sock->type, 1))) tifm_uevent()
74 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_device_probe() local
81 rc = drv->probe(sock); tifm_device_probe()
89 static void tifm_dummy_event(struct tifm_dev *sock) tifm_dummy_event() argument
96 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_device_remove() local
101 sock->card_event = tifm_dummy_event; tifm_device_remove()
102 sock->data_event = tifm_dummy_event; tifm_device_remove()
103 drv->remove(sock); tifm_device_remove()
104 sock->dev.driver = NULL; tifm_device_remove()
115 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_device_suspend() local
120 return drv->suspend(sock, state); tifm_device_suspend()
126 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_device_resume() local
131 return drv->resume(sock); tifm_device_resume()
145 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); type_show() local
146 return sprintf(buf, "%x", sock->type); type_show()
248 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); tifm_free_device() local
249 kfree(sock); tifm_free_device()
256 struct tifm_dev *sock = NULL; tifm_alloc_device() local
259 return sock; tifm_alloc_device()
261 sock = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL); tifm_alloc_device()
262 if (sock) { tifm_alloc_device()
263 spin_lock_init(&sock->lock); tifm_alloc_device()
264 sock->type = type; tifm_alloc_device()
265 sock->socket_id = id; tifm_alloc_device()
266 sock->card_event = tifm_dummy_event; tifm_alloc_device()
267 sock->data_event = tifm_dummy_event; tifm_alloc_device()
269 sock->dev.parent = fm->dev.parent; tifm_alloc_device()
270 sock->dev.bus = &tifm_bus_type; tifm_alloc_device()
271 sock->dev.dma_mask = fm->dev.parent->dma_mask; tifm_alloc_device()
272 sock->dev.release = tifm_free_device; tifm_alloc_device()
274 dev_set_name(&sock->dev, "tifm_%s%u:%u", tifm_alloc_device()
280 return sock; tifm_alloc_device()
284 void tifm_eject(struct tifm_dev *sock) tifm_eject() argument
286 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); tifm_eject()
287 fm->eject(fm, sock); tifm_eject()
291 int tifm_has_ms_pif(struct tifm_dev *sock) tifm_has_ms_pif() argument
293 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); tifm_has_ms_pif()
294 return fm->has_ms_pif(fm, sock); tifm_has_ms_pif()
298 int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, tifm_map_sg() argument
301 return pci_map_sg(to_pci_dev(sock->dev.parent), sg, nents, direction); tifm_map_sg()
305 void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, tifm_unmap_sg() argument
308 pci_unmap_sg(to_pci_dev(sock->dev.parent), sg, nents, direction); tifm_unmap_sg()
H A Dtifm_7xx1.c26 struct tifm_dev *sock) tifm_7xx1_dummy_eject()
30 static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock) tifm_7xx1_eject() argument
35 fm->socket_change_set |= 1 << sock->socket_id; tifm_7xx1_eject()
43 struct tifm_dev *sock; tifm_7xx1_isr() local
57 sock = fm->sockets[cnt]; tifm_7xx1_isr()
58 if (sock) { tifm_7xx1_isr()
60 sock->data_event(sock); tifm_7xx1_isr()
62 sock->card_event(sock); tifm_7xx1_isr()
143 struct tifm_dev *sock; tifm_7xx1_switch_media() local
164 sock = fm->sockets[cnt]; tifm_7xx1_switch_media()
165 if (sock) { tifm_7xx1_switch_media()
170 sock_addr = sock->addr; tifm_7xx1_switch_media()
172 device_unregister(&sock->dev); tifm_7xx1_switch_media()
184 sock = tifm_alloc_device(fm, cnt, media_id); tifm_7xx1_switch_media()
185 if (sock) { tifm_7xx1_switch_media()
186 sock->addr = tifm_7xx1_sock_addr(fm->addr, cnt); tifm_7xx1_switch_media()
188 if (!device_register(&sock->dev)) { tifm_7xx1_switch_media()
191 fm->sockets[cnt] = sock; tifm_7xx1_switch_media()
192 sock = NULL; tifm_7xx1_switch_media()
196 if (sock) tifm_7xx1_switch_media()
197 tifm_free_device(&sock->dev); tifm_7xx1_switch_media()
308 struct tifm_dev *sock) tifm_7xx1_dummy_has_ms_pif()
313 static int tifm_7xx1_has_ms_pif(struct tifm_adapter *fm, struct tifm_dev *sock) tifm_7xx1_has_ms_pif() argument
315 if (((fm->num_sockets == 4) && (sock->socket_id == 2)) tifm_7xx1_has_ms_pif()
316 || ((fm->num_sockets == 2) && (sock->socket_id == 0))) tifm_7xx1_has_ms_pif()
25 tifm_7xx1_dummy_eject(struct tifm_adapter *fm, struct tifm_dev *sock) tifm_7xx1_dummy_eject() argument
307 tifm_7xx1_dummy_has_ms_pif(struct tifm_adapter *fm, struct tifm_dev *sock) tifm_7xx1_dummy_has_ms_pif() argument
/linux-4.1.27/include/linux/
H A Dsock_diag.h9 struct sock;
22 int sock_diag_check_cookie(struct sock *sk, const __u32 *cookie);
23 void sock_diag_save_cookie(struct sock *sk, __u32 *cookie);
25 int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
26 int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk,
H A Dmroute6.h22 struct sock;
25 extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int);
26 extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
28 extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg);
29 extern int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
34 int ip6_mroute_setsockopt(struct sock *sock, ip6_mroute_setsockopt() argument
41 int ip6_mroute_getsockopt(struct sock *sock, ip6_mroute_getsockopt() argument
48 int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg) ip6mr_ioctl()
121 extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb);
122 extern int ip6mr_sk_done(struct sock *sk);
124 static inline struct sock *mroute6_socket(struct net *net, struct sk_buff *skb) mroute6_socket()
128 static inline int ip6mr_sk_done(struct sock *sk) ip6mr_sk_done()
H A Dnet.h117 struct sock *sk;
130 int (*release) (struct socket *sock);
131 int (*bind) (struct socket *sock,
134 int (*connect) (struct socket *sock,
139 int (*accept) (struct socket *sock,
141 int (*getname) (struct socket *sock,
144 unsigned int (*poll) (struct file *file, struct socket *sock,
146 int (*ioctl) (struct socket *sock, unsigned int cmd,
149 int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
152 int (*listen) (struct socket *sock, int len);
153 int (*shutdown) (struct socket *sock, int flags);
154 int (*setsockopt)(struct socket *sock, int level,
156 int (*getsockopt)(struct socket *sock, int level,
159 int (*compat_setsockopt)(struct socket *sock, int level,
161 int (*compat_getsockopt)(struct socket *sock, int level,
164 int (*sendmsg) (struct socket *sock, struct msghdr *m,
174 int (*recvmsg) (struct socket *sock, struct msghdr *m,
176 int (*mmap) (struct file *file, struct socket *sock,
178 ssize_t (*sendpage) (struct socket *sock, struct page *page,
180 ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
182 int (*set_peek_off)(struct sock *sk, int val);
190 int (*create)(struct net *net, struct socket *sock,
213 void sock_release(struct socket *sock);
214 int sock_sendmsg(struct socket *sock, struct msghdr *msg);
215 int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
217 struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname);
220 #define sockfd_put(sock) fput(sock->file)
263 int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec,
265 int kernel_recvmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec,
268 int kernel_bind(struct socket *sock, struct sockaddr *addr, int addrlen);
269 int kernel_listen(struct socket *sock, int backlog);
270 int kernel_accept(struct socket *sock, struct socket **newsock, int flags);
271 int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen,
273 int kernel_getsockname(struct socket *sock, struct sockaddr *addr,
275 int kernel_getpeername(struct socket *sock, struct sockaddr *addr,
277 int kernel_getsockopt(struct socket *sock, int level, int optname, char *optval,
279 int kernel_setsockopt(struct socket *sock, int level, int optname, char *optval,
281 int kernel_sendpage(struct socket *sock, struct page *page, int offset,
283 int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
284 int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how);
H A Dmroute.h6 #include <net/sock.h>
22 extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int);
23 extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
24 extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
25 extern int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
29 int ip_mroute_setsockopt(struct sock *sock, ip_mroute_setsockopt() argument
36 int ip_mroute_getsockopt(struct sock *sock, ip_mroute_getsockopt() argument
43 int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg) ipmr_ioctl()
H A Dinet_diag.h6 struct sock;
23 void (*idiag_get_info)(struct sock *sk,
30 int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
43 int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
H A Dif_pppox.h46 #include <net/sock.h>
49 /* struct sock must be the first member of pppox_sock */
50 struct sock sk;
64 static inline struct pppox_sock *pppox_sk(struct sock *sk) pppox_sk()
69 static inline struct sock *sk_pppox(struct pppox_sock *po) sk_pppox()
71 return (struct sock *)po; sk_pppox()
77 int (*create)(struct net *net, struct socket *sock);
78 int (*ioctl)(struct socket *sock, unsigned int cmd,
85 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
86 extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
H A Dnetlink.h30 struct sock *sk;
51 bool (*compare)(struct net *net, struct sock *sk);
54 extern struct sock *__netlink_kernel_create(struct net *net, int unit,
57 static inline struct sock * netlink_kernel_create()
63 extern void netlink_kernel_release(struct sock *sk);
64 extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
65 extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
66 extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
68 extern int netlink_has_listeners(struct sock *sk, unsigned int group);
69 extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
71 extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
72 extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
74 extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
76 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
78 extern int netlink_set_err(struct sock *ssk, __u32 portid, __u32 group, int code);
83 struct sock *netlink_getsockbyfilp(struct file *filp);
84 int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
85 long *timeo, struct sock *ssk);
86 void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
87 int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
152 extern int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
155 static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, netlink_dump_start()
H A Dnetfilter.h48 struct sock;
56 struct sock *sk;
57 int (*okfn)(struct sock *, struct sk_buff *);
65 struct sock *sk, nf_hook_state_init()
66 int (*okfn)(struct sock *, struct sk_buff *)) nf_hook_state_init()
102 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
104 int (*compat_set)(struct sock *sk, int optval,
109 int (*get)(struct sock *sk, int optval, void __user *user, int *len);
111 int (*compat_get)(struct sock *sk, int optval,
159 struct sock *sk, nf_hook_thresh()
163 int (*okfn)(struct sock *, struct sk_buff *), nf_hook_thresh()
176 static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sock *sk, nf_hook()
179 int (*okfn)(struct sock *, struct sk_buff *)) nf_hook()
202 NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sock *sk, NF_HOOK_THRESH()
205 int (*okfn)(struct sock *, struct sk_buff *), int thresh) NF_HOOK_THRESH()
214 NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sock *sk, NF_HOOK_COND()
216 int (*okfn)(struct sock *, struct sk_buff *), bool cond) NF_HOOK_COND()
227 NF_HOOK(uint8_t pf, unsigned int hook, struct sock *sk, struct sk_buff *skb, NF_HOOK()
229 int (*okfn)(struct sock *, struct sk_buff *)) NF_HOOK()
235 int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
237 int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
240 int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval,
242 int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
334 struct sock *sk, nf_hook_thresh()
338 int (*okfn)(struct sock *sk, struct sk_buff *), int thresh) nf_hook_thresh()
342 static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sock *sk, nf_hook()
345 int (*okfn)(struct sock *, struct sk_buff *)) nf_hook()
H A Dtifm.h97 void (*card_event)(struct tifm_dev *sock);
98 void (*data_event)(struct tifm_dev *sock);
127 struct tifm_dev *sock);
129 struct tifm_dev *sock);
146 void tifm_eject(struct tifm_dev *sock);
147 int tifm_has_ms_pif(struct tifm_dev *sock);
148 int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents,
150 void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents,
H A Dkobject_ns.h20 struct sock;
36 * @netlink_ns: return namespace to which a sock belongs (right?)
44 const void *(*netlink_ns)(struct sock *sk);
56 const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
H A Dudp.h72 int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
73 void (*encap_destroy)(struct sock *sk);
76 static inline struct udp_sock *udp_sk(const struct sock *sk) udp_sk()
81 static inline void udp_set_no_check6_tx(struct sock *sk, bool val) udp_set_no_check6_tx()
86 static inline void udp_set_no_check6_rx(struct sock *sk, bool val) udp_set_no_check6_rx()
91 static inline bool udp_get_no_check6_tx(struct sock *sk) udp_get_no_check6_tx()
96 static inline bool udp_get_no_check6_rx(struct sock *sk) udp_get_no_check6_rx()
H A Digmp.h114 extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
115 extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr);
116 extern void ip_mc_drop_socket(struct sock *sk);
117 extern int ip_mc_source(int add, int omode, struct sock *sk,
119 extern int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf,int ifindex);
120 extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
122 extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
124 extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif);
H A Dconnector.h30 #include <net/sock.h>
42 struct sock *nls;
65 struct sock *nls;
83 struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *);
/linux-4.1.27/net/nfc/
H A Drawsock.c34 static void nfc_sock_link(struct nfc_sock_list *l, struct sock *sk) nfc_sock_link()
41 static void nfc_sock_unlink(struct nfc_sock_list *l, struct sock *sk) nfc_sock_unlink()
48 static void rawsock_write_queue_purge(struct sock *sk) rawsock_write_queue_purge()
58 static void rawsock_report_error(struct sock *sk, int err) rawsock_report_error()
69 static int rawsock_release(struct socket *sock) rawsock_release() argument
71 struct sock *sk = sock->sk; rawsock_release()
73 pr_debug("sock=%p sk=%p\n", sock, sk); rawsock_release()
78 if (sock->type == SOCK_RAW) rawsock_release()
87 static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, rawsock_connect() argument
90 struct sock *sk = sock->sk; rawsock_connect()
95 pr_debug("sock=%p sk=%p flags=%d\n", sock, sk, flags); rawsock_connect()
106 if (sock->state == SS_CONNECTED) { rawsock_connect()
129 sock->state = SS_CONNECTED; rawsock_connect()
153 struct sock *sk = (struct sock *) context; rawsock_data_exchange_complete()
190 struct sock *sk = to_rawsock_sk(work); rawsock_tx_work()
214 static int rawsock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) rawsock_sendmsg() argument
216 struct sock *sk = sock->sk; rawsock_sendmsg()
221 pr_debug("sock=%p sk=%p len=%zu\n", sock, sk, len); rawsock_sendmsg()
226 if (sock->state != SS_CONNECTED) rawsock_sendmsg()
250 static int rawsock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, rawsock_recvmsg() argument
254 struct sock *sk = sock->sk; rawsock_recvmsg()
259 pr_debug("sock=%p sk=%p len=%zu flags=%d\n", sock, sk, len, flags); rawsock_recvmsg()
318 static void rawsock_destruct(struct sock *sk) rawsock_destruct()
336 static int rawsock_create(struct net *net, struct socket *sock, rawsock_create() argument
339 struct sock *sk; rawsock_create()
341 pr_debug("sock=%p\n", sock); rawsock_create()
343 if ((sock->type != SOCK_SEQPACKET) && (sock->type != SOCK_RAW)) rawsock_create()
346 if (sock->type == SOCK_RAW) rawsock_create()
347 sock->ops = &rawsock_raw_ops; rawsock_create()
349 sock->ops = &rawsock_ops; rawsock_create()
355 sock_init_data(sock, sk); rawsock_create()
358 sock->state = SS_UNCONNECTED; rawsock_create()
359 if (sock->type == SOCK_RAW) rawsock_create()
373 struct sock *sk; nfc_send_to_raw_sock()
H A Dllcp_commands.c249 int nfc_llcp_parse_connection_tlv(struct nfc_llcp_sock *sock, nfc_llcp_parse_connection_tlv() argument
256 if (sock == NULL) nfc_llcp_parse_connection_tlv()
267 sock->remote_miu = llcp_tlv_miux(tlv) + 128; nfc_llcp_parse_connection_tlv()
270 sock->remote_rw = llcp_tlv_rw(tlv); nfc_llcp_parse_connection_tlv()
283 pr_debug("sock %p rw %d miu %d\n", sock, nfc_llcp_parse_connection_tlv()
284 sock->remote_rw, sock->remote_miu); nfc_llcp_parse_connection_tlv()
319 static struct sk_buff *llcp_allocate_pdu(struct nfc_llcp_sock *sock, llcp_allocate_pdu() argument
325 if (sock->ssap == 0) llcp_allocate_pdu()
328 skb = nfc_alloc_send_skb(sock->dev, &sock->sk, MSG_DONTWAIT, llcp_allocate_pdu()
335 skb = llcp_add_header(skb, sock->dsap, sock->ssap, cmd); llcp_allocate_pdu()
340 int nfc_llcp_send_disconnect(struct nfc_llcp_sock *sock) nfc_llcp_send_disconnect() argument
348 local = sock->local; nfc_llcp_send_disconnect()
352 dev = sock->dev; nfc_llcp_send_disconnect()
356 skb = llcp_allocate_pdu(sock, LLCP_PDU_DISC, 0); nfc_llcp_send_disconnect()
396 int nfc_llcp_send_connect(struct nfc_llcp_sock *sock) nfc_llcp_send_connect() argument
409 local = sock->local; nfc_llcp_send_connect()
413 if (sock->service_name != NULL) { nfc_llcp_send_connect()
415 sock->service_name, nfc_llcp_send_connect()
416 sock->service_name_len, nfc_llcp_send_connect()
422 miux = be16_to_cpu(sock->miux) > LLCP_MAX_MIUX ? nfc_llcp_send_connect()
423 local->miux : sock->miux; nfc_llcp_send_connect()
424 rw = sock->rw > LLCP_MAX_RW ? local->rw : sock->rw; nfc_llcp_send_connect()
433 pr_debug("SKB size %d SN length %zu\n", size, sock->service_name_len); nfc_llcp_send_connect()
435 skb = llcp_allocate_pdu(sock, LLCP_PDU_CONNECT, size); nfc_llcp_send_connect()
462 int nfc_llcp_send_cc(struct nfc_llcp_sock *sock) nfc_llcp_send_cc() argument
474 local = sock->local; nfc_llcp_send_cc()
479 miux = be16_to_cpu(sock->miux) > LLCP_MAX_MIUX ? nfc_llcp_send_cc()
480 local->miux : sock->miux; nfc_llcp_send_cc()
481 rw = sock->rw > LLCP_MAX_RW ? local->rw : sock->rw; nfc_llcp_send_cc()
490 skb = llcp_allocate_pdu(sock, LLCP_PDU_CC, size); nfc_llcp_send_cc()
633 int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, nfc_llcp_send_i_frame() argument
637 struct sock *sk = &sock->sk; nfc_llcp_send_i_frame()
645 local = sock->local; nfc_llcp_send_i_frame()
650 if((sock->remote_ready && nfc_llcp_send_i_frame()
651 skb_queue_len(&sock->tx_pending_queue) >= sock->remote_rw && nfc_llcp_send_i_frame()
652 skb_queue_len(&sock->tx_queue) >= 2 * sock->remote_rw)) { nfc_llcp_send_i_frame()
654 skb_queue_len(&sock->tx_pending_queue)); nfc_llcp_send_i_frame()
659 if ((!sock->remote_ready && nfc_llcp_send_i_frame()
660 skb_queue_len(&sock->tx_queue) >= 2 * sock->remote_rw)) { nfc_llcp_send_i_frame()
662 skb_queue_len(&sock->tx_queue)); nfc_llcp_send_i_frame()
679 remote_miu = sock->remote_miu > LLCP_MAX_MIU ? nfc_llcp_send_i_frame()
680 LLCP_DEFAULT_MIU : sock->remote_miu; nfc_llcp_send_i_frame()
687 pdu = llcp_allocate_pdu(sock, LLCP_PDU_I, nfc_llcp_send_i_frame()
699 skb_queue_tail(&sock->tx_queue, pdu); nfc_llcp_send_i_frame()
703 nfc_llcp_queue_i_frames(sock); nfc_llcp_send_i_frame()
716 int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap, nfc_llcp_send_ui_frame() argument
728 local = sock->local; nfc_llcp_send_ui_frame()
745 remote_miu = sock->remote_miu > LLCP_MAX_MIU ? nfc_llcp_send_ui_frame()
746 local->remote_miu : sock->remote_miu; nfc_llcp_send_ui_frame()
753 pdu = nfc_alloc_send_skb(sock->dev, &sock->sk, MSG_DONTWAIT, nfc_llcp_send_ui_frame()
777 int nfc_llcp_send_rr(struct nfc_llcp_sock *sock) nfc_llcp_send_rr() argument
782 pr_debug("Send rr nr %d\n", sock->recv_n); nfc_llcp_send_rr()
784 local = sock->local; nfc_llcp_send_rr()
788 skb = llcp_allocate_pdu(sock, LLCP_PDU_RR, LLCP_SEQUENCE_SIZE); nfc_llcp_send_rr()
794 skb->data[2] = sock->recv_n; nfc_llcp_send_rr()
H A Dllcp_sock.c28 static int sock_wait_state(struct sock *sk, int state, unsigned long timeo) sock_wait_state()
70 static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) llcp_sock_bind() argument
72 struct sock *sk = sock->sk; llcp_sock_bind()
143 static int llcp_raw_sock_bind(struct socket *sock, struct sockaddr *addr, llcp_raw_sock_bind() argument
146 struct sock *sk = sock->sk; llcp_raw_sock_bind()
197 static int llcp_sock_listen(struct socket *sock, int backlog) llcp_sock_listen() argument
199 struct sock *sk = sock->sk; llcp_sock_listen()
206 if ((sock->type != SOCK_SEQPACKET && sock->type != SOCK_STREAM) || llcp_sock_listen()
224 static int nfc_llcp_setsockopt(struct socket *sock, int level, int optname, nfc_llcp_setsockopt() argument
227 struct sock *sk = sock->sk; nfc_llcp_setsockopt()
297 static int nfc_llcp_getsockopt(struct socket *sock, int level, int optname, nfc_llcp_getsockopt() argument
301 struct sock *sk = sock->sk; nfc_llcp_getsockopt()
374 void nfc_llcp_accept_unlink(struct sock *sk) nfc_llcp_accept_unlink()
387 void nfc_llcp_accept_enqueue(struct sock *parent, struct sock *sk) nfc_llcp_accept_enqueue()
401 struct sock *nfc_llcp_accept_dequeue(struct sock *parent, nfc_llcp_accept_dequeue()
405 struct sock *sk; nfc_llcp_accept_dequeue()
442 static int llcp_sock_accept(struct socket *sock, struct socket *newsock, llcp_sock_accept() argument
446 struct sock *sk = sock->sk, *new_sk; llcp_sock_accept()
496 static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr, llcp_sock_getname() argument
499 struct sock *sk = sock->sk; llcp_sock_getname()
525 static inline unsigned int llcp_accept_poll(struct sock *parent) llcp_accept_poll()
528 struct sock *sk; llcp_accept_poll()
543 static unsigned int llcp_sock_poll(struct file *file, struct socket *sock, llcp_sock_poll() argument
546 struct sock *sk = sock->sk; llcp_sock_poll()
582 static int llcp_sock_release(struct socket *sock) llcp_sock_release() argument
584 struct sock *sk = sock->sk; llcp_sock_release()
608 struct sock *accept_sk; llcp_sock_release()
627 /* Keep this sock alive and therefore do not remove it from the sockets llcp_sock_release()
634 if (sock->type == SOCK_RAW) llcp_sock_release()
646 static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr, llcp_sock_connect() argument
649 struct sock *sk = sock->sk; llcp_sock_connect()
656 pr_debug("sock %p sk %p flags 0x%x\n", sock, sk, flags); llcp_sock_connect()
753 static int llcp_sock_sendmsg(struct socket *sock, struct msghdr *msg, llcp_sock_sendmsg() argument
756 struct sock *sk = sock->sk; llcp_sock_sendmsg()
760 pr_debug("sock %p sk %p", sock, sk); llcp_sock_sendmsg()
796 static int llcp_sock_recvmsg(struct socket *sock, struct msghdr *msg, llcp_sock_recvmsg() argument
800 struct sock *sk = sock->sk; llcp_sock_recvmsg()
926 static void llcp_sock_destruct(struct sock *sk) llcp_sock_destruct()
945 struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp) nfc_llcp_sock_alloc() argument
947 struct sock *sk; nfc_llcp_sock_alloc()
956 sock_init_data(sock, sk); nfc_llcp_sock_alloc()
975 if (sock != NULL) nfc_llcp_sock_alloc()
976 sock->state = SS_UNCONNECTED; nfc_llcp_sock_alloc()
981 void nfc_llcp_sock_free(struct nfc_llcp_sock *sock) nfc_llcp_sock_free() argument
983 kfree(sock->service_name); nfc_llcp_sock_free()
985 skb_queue_purge(&sock->tx_queue); nfc_llcp_sock_free()
986 skb_queue_purge(&sock->tx_pending_queue); nfc_llcp_sock_free()
988 list_del_init(&sock->accept_queue); nfc_llcp_sock_free()
990 sock->parent = NULL; nfc_llcp_sock_free()
992 nfc_llcp_local_put(sock->local); nfc_llcp_sock_free()
995 static int llcp_sock_create(struct net *net, struct socket *sock, llcp_sock_create() argument
998 struct sock *sk; llcp_sock_create()
1000 pr_debug("%p\n", sock); llcp_sock_create()
1002 if (sock->type != SOCK_STREAM && llcp_sock_create()
1003 sock->type != SOCK_DGRAM && llcp_sock_create()
1004 sock->type != SOCK_RAW) llcp_sock_create()
1007 if (sock->type == SOCK_RAW) llcp_sock_create()
1008 sock->ops = &llcp_rawsock_ops; llcp_sock_create()
1010 sock->ops = &llcp_sock_ops; llcp_sock_create()
1012 sk = nfc_llcp_sock_alloc(sock, sock->type, GFP_ATOMIC); llcp_sock_create()
H A Dllcp.h116 struct sock sk;
151 struct sock *parent;
213 void nfc_llcp_sock_link(struct llcp_sock_list *l, struct sock *s);
214 void nfc_llcp_sock_unlink(struct llcp_sock_list *l, struct sock *s);
215 void nfc_llcp_socket_remote_param_init(struct nfc_llcp_sock *sock);
220 struct nfc_llcp_sock *sock);
223 int nfc_llcp_queue_i_frames(struct nfc_llcp_sock *sock);
228 struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp);
229 void nfc_llcp_sock_free(struct nfc_llcp_sock *sock);
230 void nfc_llcp_accept_unlink(struct sock *sk);
231 void nfc_llcp_accept_enqueue(struct sock *parent, struct sock *sk);
232 struct sock *nfc_llcp_accept_dequeue(struct sock *sk, struct socket *newsock);
237 int nfc_llcp_parse_connection_tlv(struct nfc_llcp_sock *sock,
250 int nfc_llcp_send_connect(struct nfc_llcp_sock *sock);
251 int nfc_llcp_send_cc(struct nfc_llcp_sock *sock);
257 int nfc_llcp_send_disconnect(struct nfc_llcp_sock *sock);
258 int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
260 int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
262 int nfc_llcp_send_rr(struct nfc_llcp_sock *sock);
H A Dllcp_core.c35 void nfc_llcp_sock_link(struct llcp_sock_list *l, struct sock *sk) nfc_llcp_sock_link()
42 void nfc_llcp_sock_unlink(struct llcp_sock_list *l, struct sock *sk) nfc_llcp_sock_unlink()
49 void nfc_llcp_socket_remote_param_init(struct nfc_llcp_sock *sock) nfc_llcp_socket_remote_param_init() argument
51 sock->remote_rw = LLCP_DEFAULT_RW; nfc_llcp_socket_remote_param_init()
52 sock->remote_miu = LLCP_MAX_MIU + 1; nfc_llcp_socket_remote_param_init()
55 static void nfc_llcp_socket_purge(struct nfc_llcp_sock *sock) nfc_llcp_socket_purge() argument
57 struct nfc_llcp_local *local = sock->local; nfc_llcp_socket_purge()
60 pr_debug("%p\n", &sock->sk); nfc_llcp_socket_purge()
62 skb_queue_purge(&sock->tx_queue); nfc_llcp_socket_purge()
63 skb_queue_purge(&sock->tx_pending_queue); nfc_llcp_socket_purge()
70 if (s->sk != &sock->sk) nfc_llcp_socket_purge()
81 struct sock *sk; nfc_llcp_socket_release()
101 struct sock *accept_sk; nfc_llcp_socket_release()
201 struct sock *sk; nfc_llcp_sock_get()
232 static void nfc_llcp_sock_put(struct nfc_llcp_sock *sock) nfc_llcp_sock_put() argument
234 sock_put(&sock->sk); nfc_llcp_sock_put()
342 struct sock *sk; nfc_llcp_sock_from_sn()
357 pr_debug("llcp sock %p\n", tmp_sock); nfc_llcp_sock_from_sn()
382 pr_debug("Found llcp sock %p\n", llcp_sock); nfc_llcp_sock_from_sn()
388 struct nfc_llcp_sock *sock) nfc_llcp_get_sdp_ssap()
392 if (sock->service_name != NULL && sock->service_name_len > 0) { nfc_llcp_get_sdp_ssap()
393 int ssap = nfc_llcp_wks_sap(sock->service_name, nfc_llcp_get_sdp_ssap()
394 sock->service_name_len); nfc_llcp_get_sdp_ssap()
416 if (nfc_llcp_sock_from_sn(local, sock->service_name, nfc_llcp_get_sdp_ssap()
417 sock->service_name_len) != NULL) { nfc_llcp_get_sdp_ssap()
427 } else if (sock->ssap != 0 && sock->ssap < LLCP_WKS_NUM_SAP) { nfc_llcp_get_sdp_ssap()
428 if (!test_bit(sock->ssap, &local->local_wks)) { nfc_llcp_get_sdp_ssap()
429 set_bit(sock->ssap, &local->local_wks); nfc_llcp_get_sdp_ssap()
432 return sock->ssap; nfc_llcp_get_sdp_ssap()
486 /* Find the listening sock and set it back to UNBOUND */ nfc_llcp_put_ssap()
663 static void nfc_llcp_set_nrns(struct nfc_llcp_sock *sock, struct sk_buff *pdu) nfc_llcp_set_nrns() argument
665 pdu->data[2] = (sock->send_n << 4) | (sock->recv_n); nfc_llcp_set_nrns()
666 sock->send_n = (sock->send_n + 1) % 16; nfc_llcp_set_nrns()
667 sock->recv_ack_n = (sock->recv_n - 1) % 16; nfc_llcp_set_nrns()
674 struct sock *sk; nfc_llcp_send_to_raw_sock()
715 struct sock *sk; nfc_llcp_tx_work()
778 struct sock *sk; nfc_llcp_connecting_sock_get()
877 struct sock *new_sk, *parent; nfc_llcp_recv_connect()
878 struct nfc_llcp_sock *sock, *new_sock; nfc_llcp_recv_connect() local
887 sock = nfc_llcp_sock_get(local, dsap, LLCP_SAP_SDP); nfc_llcp_recv_connect()
888 if (sock == NULL || sock->sk.sk_state != LLCP_LISTEN) { nfc_llcp_recv_connect()
904 sock = nfc_llcp_sock_get_sn(local, sn, sn_len); nfc_llcp_recv_connect()
905 if (sock == NULL) { nfc_llcp_recv_connect()
911 lock_sock(&sock->sk); nfc_llcp_recv_connect()
913 parent = &sock->sk; nfc_llcp_recv_connect()
917 release_sock(&sock->sk); nfc_llcp_recv_connect()
918 sock_put(&sock->sk); nfc_llcp_recv_connect()
922 if (sock->ssap == LLCP_SDP_UNBOUND) { nfc_llcp_recv_connect()
929 release_sock(&sock->sk); nfc_llcp_recv_connect()
930 sock_put(&sock->sk); nfc_llcp_recv_connect()
934 sock->ssap = ssap; nfc_llcp_recv_connect()
940 release_sock(&sock->sk); nfc_llcp_recv_connect()
941 sock_put(&sock->sk); nfc_llcp_recv_connect()
948 new_sock->rw = sock->rw; nfc_llcp_recv_connect()
949 new_sock->miux = sock->miux; nfc_llcp_recv_connect()
950 new_sock->nfc_protocol = sock->nfc_protocol; nfc_llcp_recv_connect()
954 new_sock->ssap = sock->ssap; nfc_llcp_recv_connect()
955 if (sock->ssap < LLCP_LOCAL_NUM_SAP && sock->ssap >= LLCP_WKS_NUM_SAP) { nfc_llcp_recv_connect()
958 pr_debug("reserved_ssap %d for %p\n", sock->ssap, new_sock); nfc_llcp_recv_connect()
961 &local->local_sdp_cnt[sock->ssap - LLCP_WKS_NUM_SAP]; nfc_llcp_recv_connect()
964 new_sock->reserved_ssap = sock->ssap; nfc_llcp_recv_connect()
970 pr_debug("new sock %p sk %p\n", new_sock, &new_sock->sk); nfc_llcp_recv_connect()
974 nfc_llcp_accept_enqueue(&sock->sk, new_sk); nfc_llcp_recv_connect()
986 release_sock(&sock->sk); nfc_llcp_recv_connect()
987 sock_put(&sock->sk); nfc_llcp_recv_connect()
996 int nfc_llcp_queue_i_frames(struct nfc_llcp_sock *sock) nfc_llcp_queue_i_frames() argument
999 struct nfc_llcp_local *local = sock->local; nfc_llcp_queue_i_frames()
1002 sock->remote_ready, skb_queue_len(&sock->tx_pending_queue), nfc_llcp_queue_i_frames()
1003 sock->remote_rw); nfc_llcp_queue_i_frames()
1006 while (sock->remote_ready && nfc_llcp_queue_i_frames()
1007 skb_queue_len(&sock->tx_pending_queue) < sock->remote_rw) { nfc_llcp_queue_i_frames()
1010 pdu = skb_dequeue(&sock->tx_queue); nfc_llcp_queue_i_frames()
1015 nfc_llcp_set_nrns(sock, pdu); nfc_llcp_queue_i_frames()
1028 struct sock *sk; nfc_llcp_recv_hdlc()
1115 struct sock *sk; nfc_llcp_recv_disc()
1158 struct sock *sk; nfc_llcp_recv_cc()
1191 struct sock *sk; nfc_llcp_recv_dm()
387 nfc_llcp_get_sdp_ssap(struct nfc_llcp_local *local, struct nfc_llcp_sock *sock) nfc_llcp_get_sdp_ssap() argument
/linux-4.1.27/net/vmw_vsock/
H A Dvmci_transport_notify.h48 void (*socket_init) (struct sock *sk);
50 int (*poll_in) (struct sock *sk, size_t target,
52 int (*poll_out) (struct sock *sk, size_t target,
54 void (*handle_notify_pkt) (struct sock *sk,
59 int (*recv_init) (struct sock *sk, size_t target,
61 int (*recv_pre_block) (struct sock *sk, size_t target,
63 int (*recv_pre_dequeue) (struct sock *sk, size_t target,
65 int (*recv_post_dequeue) (struct sock *sk, size_t target,
68 int (*send_init) (struct sock *sk,
70 int (*send_pre_block) (struct sock *sk,
72 int (*send_pre_enqueue) (struct sock *sk,
74 int (*send_post_enqueue) (struct sock *sk, ssize_t written,
76 void (*process_request) (struct sock *sk);
77 void (*process_negotiate) (struct sock *sk);
H A Daf_vsock.c98 #include <net/sock.h>
101 static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr);
102 static void vsock_sk_destruct(struct sock *sk);
103 static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
170 struct sock *sk = sk_vsock(vsk); vsock_auto_bind()
216 static struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr) __vsock_find_bound_socket()
227 static struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src, __vsock_find_connected_socket()
287 struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr) vsock_find_bound_socket()
289 struct sock *sk; vsock_find_bound_socket()
302 struct sock *vsock_find_connected_socket(struct sockaddr_vm *src, vsock_find_connected_socket()
305 struct sock *sk; vsock_find_connected_socket()
340 void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)) vsock_for_each_connected_socket()
357 void vsock_add_pending(struct sock *listener, struct sock *pending) vsock_add_pending()
371 void vsock_remove_pending(struct sock *listener, struct sock *pending) vsock_remove_pending()
381 void vsock_enqueue_accept(struct sock *listener, struct sock *connected) vsock_enqueue_accept()
395 static struct sock *vsock_dequeue_accept(struct sock *listener) vsock_dequeue_accept()
417 static bool vsock_is_accept_queue_empty(struct sock *sk) vsock_is_accept_queue_empty()
423 static bool vsock_is_pending(struct sock *sk) vsock_is_pending()
429 static int vsock_send_shutdown(struct sock *sk, int mode) vsock_send_shutdown()
436 struct sock *sk; vsock_pending_work()
437 struct sock *listener; vsock_pending_work()
542 static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr) __vsock_bind()
580 struct sock *__vsock_create(struct net *net, __vsock_create() argument
581 struct socket *sock, __vsock_create()
582 struct sock *parent, __vsock_create()
586 struct sock *sk; __vsock_create()
594 sock_init_data(sock, sk); __vsock_create()
596 /* sk->sk_type is normally set in sock_init_data, but only if sock is __vsock_create()
600 if (!sock) __vsock_create()
638 if (sock) __vsock_create()
645 static void __vsock_release(struct sock *sk) __vsock_release()
649 struct sock *pending; __vsock_release()
681 static void vsock_sk_destruct(struct sock *sk) vsock_sk_destruct()
696 static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) vsock_queue_rcv_skb()
719 static int vsock_release(struct socket *sock) vsock_release() argument
721 __vsock_release(sock->sk); vsock_release()
722 sock->sk = NULL; vsock_release()
723 sock->state = SS_FREE; vsock_release()
729 vsock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) vsock_bind() argument
732 struct sock *sk; vsock_bind()
735 sk = sock->sk; vsock_bind()
747 static int vsock_getname(struct socket *sock, vsock_getname() argument
751 struct sock *sk; vsock_getname()
755 sk = sock->sk; vsock_getname()
762 if (sock->state != SS_CONNECTED) { vsock_getname()
790 static int vsock_shutdown(struct socket *sock, int mode) vsock_shutdown() argument
793 struct sock *sk; vsock_shutdown()
812 sk = sock->sk; vsock_shutdown()
813 if (sock->state == SS_UNCONNECTED) { vsock_shutdown()
818 sock->state = SS_DISCONNECTING; vsock_shutdown()
839 static unsigned int vsock_poll(struct file *file, struct socket *sock, vsock_poll() argument
842 struct sock *sk; vsock_poll()
846 sk = sock->sk; vsock_poll()
870 if (sock->type == SOCK_DGRAM) { vsock_poll()
883 } else if (sock->type == SOCK_STREAM) { vsock_poll()
952 static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg, vsock_dgram_sendmsg() argument
956 struct sock *sk; vsock_dgram_sendmsg()
965 sk = sock->sk; vsock_dgram_sendmsg()
992 } else if (sock->state == SS_CONNECTED) { vsock_dgram_sendmsg()
1023 static int vsock_dgram_connect(struct socket *sock, vsock_dgram_connect() argument
1027 struct sock *sk; vsock_dgram_connect()
1031 sk = sock->sk; vsock_dgram_connect()
1039 sock->state = SS_UNCONNECTED; vsock_dgram_connect()
1058 sock->state = SS_CONNECTED; vsock_dgram_connect()
1065 static int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg, vsock_dgram_recvmsg() argument
1068 return transport->dgram_dequeue(vsock_sk(sock->sk), msg, len, flags); vsock_dgram_recvmsg()
1094 struct sock *sk; vsock_connect_timeout()
1112 static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr, vsock_stream_connect() argument
1116 struct sock *sk; vsock_stream_connect()
1123 sk = sock->sk; vsock_stream_connect()
1129 switch (sock->state) { vsock_stream_connect()
1137 /* This continues on so we can move sock into the SS_CONNECTED vsock_stream_connect()
1175 /* Mark sock as connecting and set the error code to in vsock_stream_connect()
1178 sock->state = SS_CONNECTING; vsock_stream_connect()
1235 sock->state = SS_UNCONNECTED; vsock_stream_connect()
1239 static int vsock_accept(struct socket *sock, struct socket *newsock, int flags) vsock_accept() argument
1241 struct sock *listener; vsock_accept()
1243 struct sock *connected; vsock_accept()
1249 listener = sock->sk; vsock_accept()
1253 if (sock->type != SOCK_STREAM) { vsock_accept()
1322 static int vsock_listen(struct socket *sock, int backlog) vsock_listen() argument
1325 struct sock *sk; vsock_listen()
1328 sk = sock->sk; vsock_listen()
1332 if (sock->type != SOCK_STREAM) { vsock_listen()
1337 if (sock->state != SS_UNCONNECTED) { vsock_listen()
1359 static int vsock_stream_setsockopt(struct socket *sock, vsock_stream_setsockopt() argument
1366 struct sock *sk; vsock_stream_setsockopt()
1386 sk = sock->sk; vsock_stream_setsockopt()
1436 static int vsock_stream_getsockopt(struct socket *sock, vsock_stream_getsockopt() argument
1443 struct sock *sk; vsock_stream_getsockopt()
1466 sk = sock->sk; vsock_stream_getsockopt()
1507 static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg, vsock_stream_sendmsg() argument
1510 struct sock *sk; vsock_stream_sendmsg()
1519 sk = sock->sk; vsock_stream_sendmsg()
1646 vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, vsock_stream_recvmsg() argument
1649 struct sock *sk; vsock_stream_recvmsg()
1659 sk = sock->sk; vsock_stream_recvmsg()
1847 static int vsock_create(struct net *net, struct socket *sock, vsock_create() argument
1850 if (!sock) vsock_create()
1856 switch (sock->type) { vsock_create()
1858 sock->ops = &vsock_dgram_ops; vsock_create()
1861 sock->ops = &vsock_stream_ops; vsock_create()
1867 sock->state = SS_UNCONNECTED; vsock_create()
1869 return __vsock_create(net, sock, NULL, GFP_KERNEL, 0) ? 0 : -ENOMEM; vsock_create()
H A Dvmci_transport_notify_qstate.c19 #include <net/sock.h>
81 vmci_transport_handle_read(struct sock *sk, vmci_transport_handle_read()
90 vmci_transport_handle_wrote(struct sock *sk, vmci_transport_handle_wrote()
98 static void vsock_block_update_write_window(struct sock *sk) vsock_block_update_write_window()
108 static int vmci_transport_send_read_notification(struct sock *sk) vmci_transport_send_read_notification()
148 static void vmci_transport_notify_pkt_socket_init(struct sock *sk) vmci_transport_notify_pkt_socket_init()
167 vmci_transport_notify_pkt_poll_in(struct sock *sk, vmci_transport_notify_pkt_poll_in()
188 vmci_transport_notify_pkt_poll_out(struct sock *sk, vmci_transport_notify_pkt_poll_out()
210 struct sock *sk, vmci_transport_notify_pkt_recv_init()
242 struct sock *sk, vmci_transport_notify_pkt_recv_pre_block()
262 struct sock *sk, vmci_transport_notify_pkt_recv_post_dequeue()
301 struct sock *sk, vmci_transport_notify_pkt_send_init()
312 struct sock *sk, vmci_transport_notify_pkt_send_post_enqueue()
351 struct sock *sk, vmci_transport_notify_pkt_handle_pkt()
374 static void vmci_transport_notify_pkt_process_request(struct sock *sk) vmci_transport_notify_pkt_process_request()
385 static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk) vmci_transport_notify_pkt_process_negotiate()
398 struct sock *sk, vmci_transport_notify_pkt_recv_pre_dequeue()
407 struct sock *sk, vmci_transport_notify_pkt_send_pre_block()
415 struct sock *sk, vmci_transport_notify_pkt_send_pre_enqueue()
H A Dvmci_transport_notify.c19 #include <net/sock.h>
113 vmci_transport_handle_waiting_read(struct sock *sk, vmci_transport_handle_waiting_read()
143 vmci_transport_handle_waiting_write(struct sock *sk, vmci_transport_handle_waiting_write()
173 vmci_transport_handle_read(struct sock *sk, vmci_transport_handle_read()
188 static bool send_waiting_read(struct sock *sk, u64 room_needed) send_waiting_read()
230 static bool send_waiting_write(struct sock *sk, u64 room_needed) send_waiting_write()
267 static int vmci_transport_send_read_notification(struct sock *sk) vmci_transport_send_read_notification()
309 vmci_transport_handle_wrote(struct sock *sk, vmci_transport_handle_wrote()
321 static void vmci_transport_notify_pkt_socket_init(struct sock *sk) vmci_transport_notify_pkt_socket_init()
346 vmci_transport_notify_pkt_poll_in(struct sock *sk, vmci_transport_notify_pkt_poll_in()
370 vmci_transport_notify_pkt_poll_out(struct sock *sk, vmci_transport_notify_pkt_poll_out()
400 struct sock *sk, vmci_transport_notify_pkt_recv_init()
436 struct sock *sk, vmci_transport_notify_pkt_recv_pre_block()
462 struct sock *sk, vmci_transport_notify_pkt_recv_pre_dequeue()
482 struct sock *sk, vmci_transport_notify_pkt_recv_post_dequeue()
515 struct sock *sk, vmci_transport_notify_pkt_send_init()
528 struct sock *sk, vmci_transport_notify_pkt_send_pre_block()
540 struct sock *sk, vmci_transport_notify_pkt_send_pre_enqueue()
556 struct sock *sk, vmci_transport_notify_pkt_send_post_enqueue()
607 struct sock *sk, vmci_transport_notify_pkt_handle_pkt()
641 static void vmci_transport_notify_pkt_process_request(struct sock *sk) vmci_transport_notify_pkt_process_request()
652 static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk) vmci_transport_notify_pkt_process_negotiate()
/linux-4.1.27/net/rds/
H A Dtcp_connect.c40 void rds_tcp_state_change(struct sock *sk) rds_tcp_state_change()
42 void (*state_change)(struct sock *sk); rds_tcp_state_change()
55 rdsdebug("sock %p state_change to %d\n", tc->t_sock, sk->sk_state); rds_tcp_state_change()
78 struct socket *sock = NULL; rds_tcp_conn_connect() local
82 ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); rds_tcp_conn_connect()
86 rds_tcp_tune(sock); rds_tcp_conn_connect()
92 ret = sock->ops->bind(sock, (struct sockaddr *)&src, sizeof(src)); rds_tcp_conn_connect()
107 rds_tcp_set_callbacks(sock, conn); rds_tcp_conn_connect()
108 ret = sock->ops->connect(sock, (struct sockaddr *)&dest, sizeof(dest), rds_tcp_conn_connect()
115 sock = NULL; rds_tcp_conn_connect()
117 rds_tcp_restore_callbacks(sock, conn->c_transport_data); rds_tcp_conn_connect()
120 if (sock) rds_tcp_conn_connect()
121 sock_release(sock); rds_tcp_conn_connect()
130 * TCP calls the callbacks with the sock lock so we hold it while we reset the
132 * hold the sock lock.
137 struct socket *sock = tc->t_sock; rds_tcp_conn_shutdown() local
139 rdsdebug("shutting down conn %p tc %p sock %p\n", conn, tc, sock); rds_tcp_conn_shutdown()
141 if (sock) { rds_tcp_conn_shutdown()
142 sock->ops->shutdown(sock, RCV_SHUTDOWN | SEND_SHUTDOWN); rds_tcp_conn_shutdown()
143 lock_sock(sock->sk); rds_tcp_conn_shutdown()
144 rds_tcp_restore_callbacks(sock, tc); /* tc->tc_sock = NULL */ rds_tcp_conn_shutdown()
146 release_sock(sock->sk); rds_tcp_conn_shutdown()
147 sock_release(sock); rds_tcp_conn_shutdown()
H A Dtcp.c56 void rds_tcp_nonagle(struct socket *sock) rds_tcp_nonagle() argument
62 sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY, (char __user *)&val, rds_tcp_nonagle()
67 void rds_tcp_tune(struct socket *sock) rds_tcp_tune() argument
69 struct sock *sk = sock->sk; rds_tcp_tune()
71 rds_tcp_nonagle(sock); rds_tcp_tune()
94 void rds_tcp_restore_callbacks(struct socket *sock, rds_tcp_restore_callbacks() argument
97 rdsdebug("restoring sock %p callbacks from tc %p\n", sock, tc); rds_tcp_restore_callbacks()
98 write_lock_bh(&sock->sk->sk_callback_lock); rds_tcp_restore_callbacks()
108 sock->sk->sk_write_space = tc->t_orig_write_space; rds_tcp_restore_callbacks()
109 sock->sk->sk_data_ready = tc->t_orig_data_ready; rds_tcp_restore_callbacks()
110 sock->sk->sk_state_change = tc->t_orig_state_change; rds_tcp_restore_callbacks()
111 sock->sk->sk_user_data = NULL; rds_tcp_restore_callbacks()
113 write_unlock_bh(&sock->sk->sk_callback_lock); rds_tcp_restore_callbacks()
121 void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn) rds_tcp_set_callbacks() argument
125 rdsdebug("setting sock %p callbacks to tc %p\n", sock, tc); rds_tcp_set_callbacks()
126 write_lock_bh(&sock->sk->sk_callback_lock); rds_tcp_set_callbacks()
135 if (sock->sk->sk_data_ready == rds_tcp_listen_data_ready) rds_tcp_set_callbacks()
136 sock->sk->sk_data_ready = sock->sk->sk_user_data; rds_tcp_set_callbacks()
138 tc->t_sock = sock; rds_tcp_set_callbacks()
140 tc->t_orig_data_ready = sock->sk->sk_data_ready; rds_tcp_set_callbacks()
141 tc->t_orig_write_space = sock->sk->sk_write_space; rds_tcp_set_callbacks()
142 tc->t_orig_state_change = sock->sk->sk_state_change; rds_tcp_set_callbacks()
144 sock->sk->sk_user_data = conn; rds_tcp_set_callbacks()
145 sock->sk->sk_data_ready = rds_tcp_data_ready; rds_tcp_set_callbacks()
146 sock->sk->sk_write_space = rds_tcp_write_space; rds_tcp_set_callbacks()
147 sock->sk->sk_state_change = rds_tcp_state_change; rds_tcp_set_callbacks()
149 write_unlock_bh(&sock->sk->sk_callback_lock); rds_tcp_set_callbacks()
152 static void rds_tcp_tc_info(struct socket *sock, unsigned int len, rds_tcp_tc_info() argument
169 sock->ops->getname(sock, (struct sockaddr *)&sin, &sinlen, 0); rds_tcp_tc_info()
172 sock->ops->getname(sock, (struct sockaddr *)&sin, &sinlen, 1); rds_tcp_tc_info()
H A Dtcp_listen.c48 static int rds_tcp_keepalive(struct socket *sock) rds_tcp_keepalive() argument
56 ret = kernel_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, rds_tcp_keepalive()
61 ret = kernel_setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, rds_tcp_keepalive()
66 ret = kernel_setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, rds_tcp_keepalive()
74 ret = kernel_setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL, rds_tcp_keepalive()
80 static int rds_tcp_accept_one(struct socket *sock) rds_tcp_accept_one() argument
88 ret = sock_create_lite(sock->sk->sk_family, sock->sk->sk_type, rds_tcp_accept_one()
89 sock->sk->sk_protocol, &new_sock); rds_tcp_accept_one()
93 new_sock->type = sock->type; rds_tcp_accept_one()
94 new_sock->ops = sock->ops; rds_tcp_accept_one()
95 ret = sock->ops->accept(sock, new_sock, O_NONBLOCK); rds_tcp_accept_one()
157 void rds_tcp_listen_data_ready(struct sock *sk) rds_tcp_listen_data_ready()
159 void (*ready)(struct sock *sk); rds_tcp_listen_data_ready()
187 struct socket *sock = NULL; rds_tcp_listen_init() local
190 ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); rds_tcp_listen_init()
194 sock->sk->sk_reuse = SK_CAN_REUSE; rds_tcp_listen_init()
195 rds_tcp_nonagle(sock); rds_tcp_listen_init()
197 write_lock_bh(&sock->sk->sk_callback_lock); rds_tcp_listen_init()
198 sock->sk->sk_user_data = sock->sk->sk_data_ready; rds_tcp_listen_init()
199 sock->sk->sk_data_ready = rds_tcp_listen_data_ready; rds_tcp_listen_init()
200 write_unlock_bh(&sock->sk->sk_callback_lock); rds_tcp_listen_init()
206 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin)); rds_tcp_listen_init()
210 ret = sock->ops->listen(sock, 64); rds_tcp_listen_init()
214 rds_tcp_listen_sock = sock; rds_tcp_listen_init()
215 sock = NULL; rds_tcp_listen_init()
217 if (sock) rds_tcp_listen_init()
218 sock_release(sock); rds_tcp_listen_init()
224 struct socket *sock = rds_tcp_listen_sock; rds_tcp_listen_stop() local
225 struct sock *sk; rds_tcp_listen_stop()
227 if (!sock) rds_tcp_listen_stop()
230 sk = sock->sk; rds_tcp_listen_stop()
244 sock_release(sock); rds_tcp_listen_stop()
H A Dtcp.h46 void rds_tcp_tune(struct socket *sock);
47 void rds_tcp_nonagle(struct socket *sock);
48 void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn);
49 void rds_tcp_restore_callbacks(struct socket *sock,
59 void rds_tcp_state_change(struct sock *sk);
64 void rds_tcp_listen_data_ready(struct sock *sk);
69 void rds_tcp_data_ready(struct sock *sk);
79 void rds_tcp_write_space(struct sock *sk);
H A Daf_rds.c39 #include <net/sock.h>
67 static int rds_release(struct socket *sock) rds_release() argument
69 struct sock *sk = sock->sk; rds_release()
103 sock->sk = NULL; rds_release()
112 * to wake the waitqueue after sk_sleep is clear as we hold a sock ref, but
127 static int rds_getname(struct socket *sock, struct sockaddr *uaddr, rds_getname() argument
131 struct rds_sock *rs = rds_sk_to_rs(sock->sk); rds_getname()
170 static unsigned int rds_poll(struct file *file, struct socket *sock, rds_poll() argument
173 struct sock *sk = sock->sk; rds_poll()
210 static int rds_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) rds_ioctl() argument
273 static int rds_setsockopt(struct socket *sock, int level, int optname, rds_setsockopt() argument
276 struct rds_sock *rs = rds_sk_to_rs(sock->sk); rds_setsockopt()
310 static int rds_getsockopt(struct socket *sock, int level, int optname, rds_getsockopt() argument
313 struct rds_sock *rs = rds_sk_to_rs(sock->sk); rds_getsockopt()
326 ret = rds_info_getsockopt(sock, optname, optval, rds_getsockopt()
349 static int rds_connect(struct socket *sock, struct sockaddr *uaddr, rds_connect() argument
352 struct sock *sk = sock->sk; rds_connect()
409 static int __rds_create(struct socket *sock, struct sock *sk, int protocol) __rds_create() argument
413 sock_init_data(sock, sk); __rds_create()
414 sock->ops = &rds_proto_ops; __rds_create()
435 static int rds_create(struct net *net, struct socket *sock, int protocol, rds_create() argument
438 struct sock *sk; rds_create()
440 if (sock->type != SOCK_SEQPACKET || protocol) rds_create()
447 return __rds_create(sock, sk, protocol); rds_create()
466 static void rds_sock_inc_info(struct socket *sock, unsigned int len, rds_sock_inc_info() argument
498 static void rds_sock_info(struct socket *sock, unsigned int len, rds_sock_info() argument
H A Dinfo.h17 typedef void (*rds_info_func)(struct socket *sock, unsigned int len,
23 int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval,
/linux-4.1.27/net/ipv6/
H A Dudp_impl.h14 int udp_v6_get_port(struct sock *sk, unsigned short snum);
16 int udpv6_getsockopt(struct sock *sk, int level, int optname,
18 int udpv6_setsockopt(struct sock *sk, int level, int optname,
21 int compat_udpv6_setsockopt(struct sock *sk, int level, int optname,
23 int compat_udpv6_getsockopt(struct sock *sk, int level, int optname,
26 int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len);
27 int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
29 int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
30 void udpv6_destroy_sock(struct sock *sk);
32 void udp_v6_clear_sk(struct sock *sk, int size);
H A Dip6_udp_tunnel.c20 struct socket *sock = NULL; udp_sock_create6() local
22 err = sock_create_kern(AF_INET6, SOCK_DGRAM, 0, &sock); udp_sock_create6()
26 sk_change_net(sock->sk, net); udp_sock_create6()
32 err = kernel_bind(sock, (struct sockaddr *)&udp6_addr, udp_sock_create6()
42 err = kernel_connect(sock, udp_sock_create6()
49 udp_set_no_check6_tx(sock->sk, !cfg->use_udp6_tx_checksums); udp_sock_create6()
50 udp_set_no_check6_rx(sock->sk, !cfg->use_udp6_rx_checksums); udp_sock_create6()
52 *sockp = sock; udp_sock_create6()
56 if (sock) { udp_sock_create6()
57 kernel_sock_shutdown(sock, SHUT_RDWR); udp_sock_create6()
58 sk_release_kernel(sock->sk); udp_sock_create6()
65 int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, udp_tunnel6_xmit_skb()
H A Dinet6_connection_sock.c27 #include <net/sock.h>
30 int inet6_csk_bind_conflict(const struct sock *sk, inet6_csk_bind_conflict()
33 const struct sock *sk2; inet6_csk_bind_conflict()
36 kuid_t uid = sock_i_uid((struct sock *)sk); inet6_csk_bind_conflict()
40 * See comment in inet_csk_bind_conflict about sock lookup inet6_csk_bind_conflict()
53 sock_i_uid((struct sock *)sk2))))) { inet6_csk_bind_conflict()
68 struct dst_entry *inet6_csk_route_req(struct sock *sk, inet6_csk_route_req()
117 struct request_sock *inet6_csk_search_req(struct sock *sk, inet6_csk_search_req()
149 void inet6_csk_reqsk_queue_hash_add(struct sock *sk, inet6_csk_reqsk_queue_hash_add()
164 void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr) inet6_csk_addr2sockaddr()
179 void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst, __inet6_csk_dst_store()
187 struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie) __inet6_csk_dst_check()
192 static struct dst_entry *inet6_csk_route_socket(struct sock *sk, inet6_csk_route_socket()
226 int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused) inet6_csk_xmit()
254 struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu) inet6_csk_update_pmtu()
H A Dinet6_hashtables.c51 struct sock *__inet6_lookup_established(struct net *net, __inet6_lookup_established()
59 struct sock *sk; __inet6_lookup_established()
96 static inline int compute_score(struct sock *sk, struct net *net, compute_score()
121 struct sock *inet6_lookup_listener(struct net *net, inet6_lookup_listener()
126 struct sock *sk; inet6_lookup_listener()
128 struct sock *result; inet6_lookup_listener()
177 struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, inet6_lookup()
182 struct sock *sk; inet6_lookup()
193 struct sock *sk, const __u16 lport, __inet6_check_established()
207 struct sock *sk2; __inet6_check_established()
260 static inline u32 inet6_sk_port_offset(const struct sock *sk) inet6_sk_port_offset()
270 struct sock *sk) inet6_hash_connect()
/linux-4.1.27/drivers/mmc/host/
H A Dtifm_sd.c117 struct tifm_dev *sock = host->dev; tifm_sd_read_fifo() local
128 val = readl(sock->addr + SOCK_MMCSD_DATA); tifm_sd_read_fifo()
143 struct tifm_dev *sock = host->dev; tifm_sd_write_fifo() local
150 writel(val, sock->addr + SOCK_MMCSD_DATA); tifm_sd_write_fifo()
162 writel(val, sock->addr + SOCK_MMCSD_DATA); tifm_sd_write_fifo()
265 struct tifm_dev *sock = host->dev; tifm_sd_set_dma_data() local
318 dev_dbg(&sock->dev, "setting dma for %d blocks\n", dma_blk_cnt); tifm_sd_set_dma_data()
319 writel(sg_dma_address(sg) + dma_off, sock->addr + SOCK_DMA_ADDRESS); tifm_sd_set_dma_data()
322 sock->addr + SOCK_DMA_CONTROL); tifm_sd_set_dma_data()
325 sock->addr + SOCK_DMA_CONTROL); tifm_sd_set_dma_data()
374 struct tifm_dev *sock = host->dev; tifm_sd_exec() local
383 dev_dbg(&sock->dev, "executing opcode 0x%x, arg: 0x%x, mask: 0x%x\n", tifm_sd_exec()
386 writel((cmd->arg >> 16) & 0xffff, sock->addr + SOCK_MMCSD_ARG_HIGH); tifm_sd_exec()
387 writel(cmd->arg & 0xffff, sock->addr + SOCK_MMCSD_ARG_LOW); tifm_sd_exec()
388 writel(cmd->opcode | cmd_mask, sock->addr + SOCK_MMCSD_COMMAND); tifm_sd_exec()
391 static void tifm_sd_fetch_resp(struct mmc_command *cmd, struct tifm_dev *sock) tifm_sd_fetch_resp() argument
393 cmd->resp[0] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x1c) << 16) tifm_sd_fetch_resp()
394 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x18); tifm_sd_fetch_resp()
395 cmd->resp[1] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x14) << 16) tifm_sd_fetch_resp()
396 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x10); tifm_sd_fetch_resp()
397 cmd->resp[2] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x0c) << 16) tifm_sd_fetch_resp()
398 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x08); tifm_sd_fetch_resp()
399 cmd->resp[3] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x04) << 16) tifm_sd_fetch_resp()
400 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x00); tifm_sd_fetch_resp()
405 struct tifm_dev *sock = host->dev; tifm_sd_check_status() local
434 | readl(sock->addr tifm_sd_check_status()
436 sock->addr tifm_sd_check_status()
445 & readl(sock->addr tifm_sd_check_status()
447 sock->addr tifm_sd_check_status()
454 & readl(sock->addr tifm_sd_check_status()
456 sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_check_status()
476 static void tifm_sd_data_event(struct tifm_dev *sock) tifm_sd_data_event() argument
482 spin_lock(&sock->lock); tifm_sd_data_event()
483 host = mmc_priv((struct mmc_host*)tifm_get_drvdata(sock)); tifm_sd_data_event()
484 fifo_status = readl(sock->addr + SOCK_DMA_FIFO_STATUS); tifm_sd_data_event()
485 dev_dbg(&sock->dev, "data event: fifo_status %x, flags %x\n", tifm_sd_data_event()
499 writel(fifo_status, sock->addr + SOCK_DMA_FIFO_STATUS); tifm_sd_data_event()
500 spin_unlock(&sock->lock); tifm_sd_data_event()
504 static void tifm_sd_card_event(struct tifm_dev *sock) tifm_sd_card_event() argument
512 spin_lock(&sock->lock); tifm_sd_card_event()
513 host = mmc_priv((struct mmc_host*)tifm_get_drvdata(sock)); tifm_sd_card_event()
514 host_status = readl(sock->addr + SOCK_MMCSD_STATUS); tifm_sd_card_event()
515 dev_dbg(&sock->dev, "host event: host_status %x, flags %x\n", tifm_sd_card_event()
523 sock->addr + SOCK_MMCSD_STATUS); tifm_sd_card_event()
537 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); tifm_sd_card_event()
538 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); tifm_sd_card_event()
556 tifm_sd_fetch_resp(cmd, sock); tifm_sd_card_event()
560 sock); tifm_sd_card_event()
570 sock->addr + SOCK_MMCSD_STATUS); tifm_sd_card_event()
589 writel(host_status, sock->addr + SOCK_MMCSD_STATUS); tifm_sd_card_event()
590 spin_unlock(&sock->lock); tifm_sd_card_event()
596 struct tifm_dev *sock = host->dev; tifm_sd_set_data_timeout() local
606 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO); tifm_sd_set_data_timeout()
608 & readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG), tifm_sd_set_data_timeout()
609 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG); tifm_sd_set_data_timeout()
614 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO); tifm_sd_set_data_timeout()
616 | readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG), tifm_sd_set_data_timeout()
617 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG); tifm_sd_set_data_timeout()
624 struct tifm_dev *sock = host->dev; tifm_sd_request() local
628 spin_lock_irqsave(&sock->lock, flags); tifm_sd_request()
636 dev_name(&sock->dev)); tifm_sd_request()
655 | readl(sock->addr + SOCK_MMCSD_INT_ENABLE), tifm_sd_request()
656 sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_request()
660 | readl(sock->addr + SOCK_MMCSD_INT_ENABLE), tifm_sd_request()
661 sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_request()
664 sock->addr + SOCK_MMCSD_BUFFER_CONFIG); tifm_sd_request()
671 if(1 != tifm_map_sg(sock, &host->bounce_buf, 1, tifm_sd_request()
676 dev_name(&sock->dev)); tifm_sd_request()
680 host->sg_len = tifm_map_sg(sock, r_data->sg, tifm_sd_request()
688 dev_name(&sock->dev)); tifm_sd_request()
689 tifm_unmap_sg(sock, &host->bounce_buf, 1, tifm_sd_request()
698 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); tifm_sd_request()
700 sock->addr + SOCK_FIFO_PAGE_SIZE); tifm_sd_request()
702 sock->addr + SOCK_FIFO_CONTROL); tifm_sd_request()
704 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); tifm_sd_request()
708 sock->addr + SOCK_MMCSD_BUFFER_CONFIG); tifm_sd_request()
711 sock->addr + SOCK_MMCSD_BUFFER_CONFIG); tifm_sd_request()
717 sock->addr + SOCK_MMCSD_NUM_BLOCKS); tifm_sd_request()
719 sock->addr + SOCK_MMCSD_BLOCK_LEN); tifm_sd_request()
724 writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), tifm_sd_request()
725 sock->addr + SOCK_CONTROL); tifm_sd_request()
727 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_request()
731 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_request()
738 struct tifm_dev *sock = host->dev; tifm_sd_end_cmd() local
739 struct mmc_host *mmc = tifm_get_drvdata(sock); tifm_sd_end_cmd()
744 spin_lock_irqsave(&sock->lock, flags); tifm_sd_end_cmd()
752 dev_name(&sock->dev)); tifm_sd_end_cmd()
753 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_end_cmd()
761 & readl(sock->addr + SOCK_MMCSD_INT_ENABLE), tifm_sd_end_cmd()
762 sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_end_cmd()
764 tifm_unmap_sg(sock, &host->bounce_buf, 1, tifm_sd_end_cmd()
767 tifm_unmap_sg(sock, r_data->sg, r_data->sg_len, tifm_sd_end_cmd()
773 - readl(sock->addr + SOCK_MMCSD_NUM_BLOCKS) - 1; tifm_sd_end_cmd()
776 - readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; tifm_sd_end_cmd()
779 writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), tifm_sd_end_cmd()
780 sock->addr + SOCK_CONTROL); tifm_sd_end_cmd()
782 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_end_cmd()
800 struct tifm_dev *sock = host->dev; tifm_sd_ios() local
804 spin_lock_irqsave(&sock->lock, flags); tifm_sd_ios()
806 dev_dbg(&sock->dev, "ios: clock = %u, vdd = %x, bus_mode = %x, " tifm_sd_ios()
812 writel(TIFM_MMCSD_4BBUS | readl(sock->addr + SOCK_MMCSD_CONFIG), tifm_sd_ios()
813 sock->addr + SOCK_MMCSD_CONFIG); tifm_sd_ios()
816 & readl(sock->addr + SOCK_MMCSD_CONFIG), tifm_sd_ios()
817 sock->addr + SOCK_MMCSD_CONFIG); tifm_sd_ios()
837 & readl(sock->addr + SOCK_CONTROL), tifm_sd_ios()
838 sock->addr + SOCK_CONTROL); tifm_sd_ios()
843 | readl(sock->addr + SOCK_CONTROL), tifm_sd_ios()
844 sock->addr + SOCK_CONTROL); tifm_sd_ios()
852 & readl(sock->addr + SOCK_MMCSD_CONFIG)), tifm_sd_ios()
853 sock->addr + SOCK_MMCSD_CONFIG); tifm_sd_ios()
861 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_ios()
868 struct tifm_dev *sock = host->dev; tifm_sd_ro() local
871 spin_lock_irqsave(&sock->lock, flags); tifm_sd_ro()
872 if (TIFM_MMCSD_CARD_RO & readl(sock->addr + SOCK_PRESENT_STATE)) tifm_sd_ro()
874 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_ro()
888 struct tifm_dev *sock = host->dev; tifm_sd_initialize_host() local
890 writel(0, sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_initialize_host()
894 writel(TIFM_MMCSD_RESET, sock->addr + SOCK_MMCSD_SYSTEM_CONTROL); tifm_sd_initialize_host()
896 sock->addr + SOCK_MMCSD_CONFIG); tifm_sd_initialize_host()
900 if (1 & readl(sock->addr + SOCK_MMCSD_SYSTEM_STATUS)) { tifm_sd_initialize_host()
909 dev_name(&sock->dev)); tifm_sd_initialize_host()
913 writel(0, sock->addr + SOCK_MMCSD_NUM_BLOCKS); tifm_sd_initialize_host()
915 sock->addr + SOCK_MMCSD_CONFIG); tifm_sd_initialize_host()
916 writel(TIFM_MMCSD_RXDE, sock->addr + SOCK_MMCSD_BUFFER_CONFIG); tifm_sd_initialize_host()
919 writel(64, sock->addr + SOCK_MMCSD_COMMAND_TO); tifm_sd_initialize_host()
920 writel(TIFM_MMCSD_INAB, sock->addr + SOCK_MMCSD_COMMAND); tifm_sd_initialize_host()
923 host_status = readl(sock->addr + SOCK_MMCSD_STATUS); tifm_sd_initialize_host()
924 writel(host_status, sock->addr + SOCK_MMCSD_STATUS); tifm_sd_initialize_host()
935 dev_name(&sock->dev)); tifm_sd_initialize_host()
941 sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_initialize_host()
947 static int tifm_sd_probe(struct tifm_dev *sock) tifm_sd_probe() argument
954 & readl(sock->addr + SOCK_PRESENT_STATE))) { tifm_sd_probe()
956 dev_name(&sock->dev)); tifm_sd_probe()
960 mmc = mmc_alloc_host(sizeof(struct tifm_sd), &sock->dev); tifm_sd_probe()
965 tifm_set_drvdata(sock, mmc); tifm_sd_probe()
966 host->dev = sock; tifm_sd_probe()
985 sock->card_event = tifm_sd_card_event; tifm_sd_probe()
986 sock->data_event = tifm_sd_data_event; tifm_sd_probe()
998 static void tifm_sd_remove(struct tifm_dev *sock) tifm_sd_remove() argument
1000 struct mmc_host *mmc = tifm_get_drvdata(sock); tifm_sd_remove()
1004 spin_lock_irqsave(&sock->lock, flags); tifm_sd_remove()
1006 writel(0, sock->addr + SOCK_MMCSD_INT_ENABLE); tifm_sd_remove()
1008 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_remove()
1012 spin_lock_irqsave(&sock->lock, flags); tifm_sd_remove()
1015 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); tifm_sd_remove()
1016 writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); tifm_sd_remove()
1022 spin_unlock_irqrestore(&sock->lock, flags); tifm_sd_remove()
1024 dev_dbg(&sock->dev, "after remove\n"); tifm_sd_remove()
1031 static int tifm_sd_suspend(struct tifm_dev *sock, pm_message_t state) tifm_sd_suspend() argument
1036 static int tifm_sd_resume(struct tifm_dev *sock) tifm_sd_resume() argument
1038 struct mmc_host *mmc = tifm_get_drvdata(sock); tifm_sd_resume()
1043 dev_dbg(&sock->dev, "resume initialize %d\n", rc); tifm_sd_resume()
/linux-4.1.27/drivers/staging/gdm724x/
H A Dnetlink_k.h18 #include <net/sock.h>
20 struct sock *netlink_init(int unit,
22 void netlink_exit(struct sock *sock);
23 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);
H A Dnetlink_k.c20 #include <net/sock.h>
90 struct sock *netlink_init(int unit, netlink_init()
93 struct sock *sock; netlink_init() local
102 sock = netlink_kernel_create(&init_net, unit, &cfg); netlink_init()
104 if (sock) netlink_init()
107 return sock; netlink_init()
110 void netlink_exit(struct sock *sock) netlink_exit() argument
112 sock_release(sock->sk_socket); netlink_exit()
115 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) netlink_send() argument
125 if (!netlink_has_listeners(sock, group+1)) netlink_send()
139 ret = netlink_broadcast(sock, skb, 0, group+1, GFP_ATOMIC); netlink_send()
146 else if (netlink_has_listeners(sock, group+1)) netlink_send()
/linux-4.1.27/drivers/staging/gdm72xx/
H A Dnetlink_k.h18 #include <net/sock.h>
20 struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type,
22 void netlink_exit(struct sock *sock);
23 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);
H A Dnetlink_k.c20 #include <net/sock.h>
91 struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type, netlink_init()
94 struct sock *sock; netlink_init() local
103 sock = netlink_kernel_create(&init_net, unit, &cfg); netlink_init()
105 if (sock) netlink_init()
108 return sock; netlink_init()
111 void netlink_exit(struct sock *sock) netlink_exit() argument
113 netlink_kernel_release(sock); netlink_exit()
116 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) netlink_send() argument
146 ret = netlink_broadcast(sock, skb, 0, group+1, GFP_ATOMIC); netlink_send()
/linux-4.1.27/include/net/phonet/
H A Dgprs.h28 struct sock;
31 int pep_writeable(struct sock *sk);
32 int pep_write(struct sock *sk, struct sk_buff *skb);
33 struct sk_buff *pep_read(struct sock *sk);
35 int gprs_attach(struct sock *sk);
36 void gprs_detach(struct sock *sk);
H A Dphonet.h37 struct sock sk;
43 static inline struct pn_sock *pn_sk(struct sock *sk) pn_sk()
51 struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa);
54 void pn_sock_hash(struct sock *sk);
55 void pn_sock_unhash(struct sock *sk);
56 int pn_sock_get_port(struct sock *sk, unsigned short sport);
58 struct sock *pn_find_sock_by_res(struct net *net, u8 res);
59 int pn_sock_bind_res(struct sock *sock, u8 res);
60 int pn_sock_unbind_res(struct sock *sk, u8 res);
61 void pn_sock_unbind_all_res(struct sock *sk);
63 int pn_skb_send(struct sock *sk, struct sk_buff *skb,
/linux-4.1.27/include/linux/sunrpc/
H A Dxprtsock.h26 struct socket * sock; member in struct:sock_xprt
27 struct sock * inet;
59 void (*old_data_ready)(struct sock *);
60 void (*old_state_change)(struct sock *);
61 void (*old_write_space)(struct sock *);
62 void (*old_error_report)(struct sock *);
H A Dsvcsock.h21 struct sock * sk_sk; /* INET layer */
24 void (*sk_ostate)(struct sock *);
25 void (*sk_odata)(struct sock *);
26 void (*sk_owspace)(struct sock *);
/linux-4.1.27/net/netrom/
H A Dnr_timer.c24 #include <net/sock.h>
38 void nr_init_timers(struct sock *sk) nr_init_timers()
52 void nr_start_t1timer(struct sock *sk) nr_start_t1timer()
59 void nr_start_t2timer(struct sock *sk) nr_start_t2timer()
66 void nr_start_t4timer(struct sock *sk) nr_start_t4timer()
73 void nr_start_idletimer(struct sock *sk) nr_start_idletimer()
81 void nr_start_heartbeat(struct sock *sk) nr_start_heartbeat()
86 void nr_stop_t1timer(struct sock *sk) nr_stop_t1timer()
91 void nr_stop_t2timer(struct sock *sk) nr_stop_t2timer()
96 void nr_stop_t4timer(struct sock *sk) nr_stop_t4timer()
101 void nr_stop_idletimer(struct sock *sk) nr_stop_idletimer()
106 void nr_stop_heartbeat(struct sock *sk) nr_stop_heartbeat()
111 int nr_t1timer_running(struct sock *sk) nr_t1timer_running()
118 struct sock *sk = (struct sock *)param; nr_heartbeat_expiry()
157 struct sock *sk = (struct sock *)param; nr_t2timer_expiry()
170 struct sock *sk = (struct sock *)param; nr_t4timer_expiry()
179 struct sock *sk = (struct sock *)param; nr_idletimer_expiry()
207 struct sock *sk = (struct sock *)param; nr_t1timer_expiry()
H A Daf_netrom.c32 #include <net/sock.h>
94 static void nr_remove_socket(struct sock *sk) nr_remove_socket()
106 struct sock *s; nr_kill_by_device()
137 static void nr_insert_socket(struct sock *sk) nr_insert_socket()
148 static struct sock *nr_find_listener(ax25_address *addr) nr_find_listener()
150 struct sock *s; nr_find_listener()
168 static struct sock *nr_find_socket(unsigned char index, unsigned char id) nr_find_socket()
170 struct sock *s; nr_find_socket()
190 static struct sock *nr_find_peer(unsigned char index, unsigned char id, nr_find_peer()
193 struct sock *s; nr_find_peer()
218 struct sock *sk; nr_find_next_circuit()
239 void nr_destroy_socket(struct sock *);
246 struct sock *sk=(struct sock *)data; nr_destroy_timer()
260 void nr_destroy_socket(struct sock *sk) nr_destroy_socket()
299 static int nr_setsockopt(struct socket *sock, int level, int optname, nr_setsockopt() argument
302 struct sock *sk = sock->sk; nr_setsockopt()
351 static int nr_getsockopt(struct socket *sock, int level, int optname, nr_getsockopt() argument
354 struct sock *sk = sock->sk; nr_getsockopt()
401 static int nr_listen(struct socket *sock, int backlog) nr_listen() argument
403 struct sock *sk = sock->sk; nr_listen()
424 static int nr_create(struct net *net, struct socket *sock, int protocol, nr_create() argument
427 struct sock *sk; nr_create()
433 if (sock->type != SOCK_SEQPACKET || protocol != 0) nr_create()
442 sock_init_data(sock, sk); nr_create()
444 sock->ops = &nr_proto_ops; nr_create()
471 static struct sock *nr_make_new(struct sock *osk) nr_make_new()
473 struct sock *sk; nr_make_new()
516 static int nr_release(struct socket *sock) nr_release() argument
518 struct sock *sk = sock->sk; nr_release()
555 sock->sk = NULL; nr_release()
562 static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) nr_bind() argument
564 struct sock *sk = sock->sk; nr_bind()
633 static int nr_connect(struct socket *sock, struct sockaddr *uaddr, nr_connect() argument
636 struct sock *sk = sock->sk; nr_connect()
645 if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { nr_connect()
646 sock->state = SS_CONNECTED; nr_connect()
650 if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) { nr_connect()
651 sock->state = SS_UNCONNECTED; nr_connect()
662 sock->state = SS_UNCONNECTED; nr_connect()
713 sock->state = SS_CONNECTING; nr_connect()
755 sock->state = SS_UNCONNECTED; nr_connect()
760 sock->state = SS_CONNECTED; nr_connect()
768 static int nr_accept(struct socket *sock, struct socket *newsock, int flags) nr_accept() argument
771 struct sock *newsk; nr_accept()
773 struct sock *sk; nr_accept()
776 if ((sk = sock->sk) == NULL) nr_accept()
830 static int nr_getname(struct socket *sock, struct sockaddr *uaddr, nr_getname() argument
834 struct sock *sk = sock->sk; nr_getname()
864 struct sock *sk; nr_rx_frame()
865 struct sock *make; nr_rx_frame()
1026 static int nr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) nr_sendmsg() argument
1028 struct sock *sk = sock->sk; nr_sendmsg()
1135 static int nr_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, nr_recvmsg() argument
1138 struct sock *sk = sock->sk; nr_recvmsg()
1191 static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) nr_ioctl() argument
1193 struct sock *sk = sock->sk; nr_ioctl()
1279 struct sock *s = sk_entry(v); nr_info_show()
/linux-4.1.27/net/dccp/
H A Dqpolicy.c18 static void qpolicy_simple_push(struct sock *sk, struct sk_buff *skb) qpolicy_simple_push()
23 static bool qpolicy_simple_full(struct sock *sk) qpolicy_simple_full()
29 static struct sk_buff *qpolicy_simple_top(struct sock *sk) qpolicy_simple_top()
39 static struct sk_buff *qpolicy_prio_best_skb(struct sock *sk) qpolicy_prio_best_skb()
49 static struct sk_buff *qpolicy_prio_worst_skb(struct sock *sk) qpolicy_prio_worst_skb()
59 static bool qpolicy_prio_full(struct sock *sk) qpolicy_prio_full()
73 void (*push) (struct sock *sk, struct sk_buff *skb);
74 bool (*full) (struct sock *sk);
75 struct sk_buff* (*top) (struct sock *sk);
96 void dccp_qpolicy_push(struct sock *sk, struct sk_buff *skb) dccp_qpolicy_push()
101 bool dccp_qpolicy_full(struct sock *sk) dccp_qpolicy_full()
106 void dccp_qpolicy_drop(struct sock *sk, struct sk_buff *skb) dccp_qpolicy_drop()
114 struct sk_buff *dccp_qpolicy_top(struct sock *sk) dccp_qpolicy_top()
119 struct sk_buff *dccp_qpolicy_pop(struct sock *sk) dccp_qpolicy_pop()
131 bool dccp_qpolicy_param_ok(struct sock *sk, __be32 param) dccp_qpolicy_param_ok()
H A Dccid.h16 #include <net/sock.h>
59 int (*ccid_hc_rx_init)(struct ccid *ccid, struct sock *sk);
60 int (*ccid_hc_tx_init)(struct ccid *ccid, struct sock *sk);
61 void (*ccid_hc_rx_exit)(struct sock *sk);
62 void (*ccid_hc_tx_exit)(struct sock *sk);
63 void (*ccid_hc_rx_packet_recv)(struct sock *sk,
65 int (*ccid_hc_rx_parse_options)(struct sock *sk, u8 pkt,
67 int (*ccid_hc_rx_insert_options)(struct sock *sk,
69 void (*ccid_hc_tx_packet_recv)(struct sock *sk,
71 int (*ccid_hc_tx_parse_options)(struct sock *sk, u8 pkt,
73 int (*ccid_hc_tx_send_packet)(struct sock *sk,
75 void (*ccid_hc_tx_packet_sent)(struct sock *sk,
77 void (*ccid_hc_rx_get_info)(struct sock *sk,
79 void (*ccid_hc_tx_get_info)(struct sock *sk,
81 int (*ccid_hc_rx_getsockopt)(struct sock *sk,
85 int (*ccid_hc_tx_getsockopt)(struct sock *sk,
111 int ccid_getsockopt_builtin_ccids(struct sock *sk, int len,
114 struct ccid *ccid_new(const u8 id, struct sock *sk, bool rx);
134 void ccid_hc_rx_delete(struct ccid *ccid, struct sock *sk);
135 void ccid_hc_tx_delete(struct ccid *ccid, struct sock *sk);
166 static inline int ccid_hc_tx_send_packet(struct ccid *ccid, struct sock *sk, ccid_hc_tx_send_packet()
174 static inline void ccid_hc_tx_packet_sent(struct ccid *ccid, struct sock *sk, ccid_hc_tx_packet_sent()
181 static inline void ccid_hc_rx_packet_recv(struct ccid *ccid, struct sock *sk, ccid_hc_rx_packet_recv()
188 static inline void ccid_hc_tx_packet_recv(struct ccid *ccid, struct sock *sk, ccid_hc_tx_packet_recv()
202 static inline int ccid_hc_tx_parse_options(struct ccid *ccid, struct sock *sk, ccid_hc_tx_parse_options()
214 static inline int ccid_hc_rx_parse_options(struct ccid *ccid, struct sock *sk, ccid_hc_rx_parse_options()
222 static inline int ccid_hc_rx_insert_options(struct ccid *ccid, struct sock *sk, ccid_hc_rx_insert_options()
230 static inline void ccid_hc_rx_get_info(struct ccid *ccid, struct sock *sk, ccid_hc_rx_get_info()
237 static inline void ccid_hc_tx_get_info(struct ccid *ccid, struct sock *sk, ccid_hc_tx_get_info()
244 static inline int ccid_hc_rx_getsockopt(struct ccid *ccid, struct sock *sk, ccid_hc_rx_getsockopt()
255 static inline int ccid_hc_tx_getsockopt(struct ccid *ccid, struct sock *sk, ccid_hc_tx_getsockopt()
H A Ddccp.h18 #include <net/sock.h>
56 void dccp_time_wait(struct sock *sk, int state, int timeo);
227 void dccp_v4_send_check(struct sock *sk, struct sk_buff *skb);
229 int dccp_retransmit_skb(struct sock *sk);
231 void dccp_send_ack(struct sock *sk);
232 void dccp_reqsk_send_ack(struct sock *sk, struct sk_buff *skb,
235 void dccp_send_sync(struct sock *sk, const u64 seq,
241 void dccp_qpolicy_push(struct sock *sk, struct sk_buff *skb);
242 bool dccp_qpolicy_full(struct sock *sk);
243 void dccp_qpolicy_drop(struct sock *sk, struct sk_buff *skb);
244 struct sk_buff *dccp_qpolicy_top(struct sock *sk);
245 struct sk_buff *dccp_qpolicy_pop(struct sock *sk);
246 bool dccp_qpolicy_param_ok(struct sock *sk, __be32 param);
251 void dccp_write_xmit(struct sock *sk);
252 void dccp_write_space(struct sock *sk);
253 void dccp_flush_write_queue(struct sock *sk, long *time_budget);
255 void dccp_init_xmit_timers(struct sock *sk);
256 static inline void dccp_clear_xmit_timers(struct sock *sk)
261 unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu);
265 void dccp_set_state(struct sock *sk, const int state);
266 void dccp_done(struct sock *sk);
271 int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
273 struct sock *dccp_create_openreq_child(struct sock *sk,
277 int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
279 struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
282 struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb,
285 int dccp_child_process(struct sock *parent, struct sock *child,
287 int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
289 int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
292 int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized);
293 void dccp_destroy_sock(struct sock *sk);
295 void dccp_close(struct sock *sk, long timeout);
296 struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
299 int dccp_connect(struct sock *sk);
300 int dccp_disconnect(struct sock *sk, int flags);
301 int dccp_getsockopt(struct sock *sk, int level, int optname,
303 int dccp_setsockopt(struct sock *sk, int level, int optname,
306 int compat_dccp_getsockopt(struct sock *sk, int level, int optname,
308 int compat_dccp_setsockopt(struct sock *sk, int level, int optname,
311 int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg);
312 int dccp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
313 int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
315 void dccp_shutdown(struct sock *sk, int how);
316 int inet_dccp_listen(struct socket *sock, int backlog);
317 unsigned int dccp_poll(struct file *file, struct socket *sock,
319 int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
320 void dccp_req_err(struct sock *sk, u64 seq);
322 struct sk_buff *dccp_ctl_make_reset(struct sock *sk, struct sk_buff *skb);
323 int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code);
324 void dccp_send_close(struct sock *sk, const int active);
326 u32 dccp_sample_rtt(struct sock *sk, long delta);
328 static inline int dccp_bad_service_code(const struct sock *sk,
418 static inline void dccp_update_gsr(struct sock *sk, u64 seq)
446 static inline void dccp_update_gss(struct sock *sk, u64 seq)
459 static inline int dccp_ackvec_pending(const struct sock *sk)
465 static inline int dccp_ack_pending(const struct sock *sk)
470 int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val);
475 int dccp_feat_activate_values(struct sock *sk, struct list_head *fn);
478 int dccp_insert_options(struct sock *sk, struct sk_buff *skb);
H A Dtimer.c24 static void dccp_write_err(struct sock *sk) dccp_write_err()
35 static int dccp_write_timeout(struct sock *sk) dccp_write_timeout()
87 static void dccp_retransmit_timer(struct sock *sk) dccp_retransmit_timer()
93 * sent, no need to retransmit, this sock is dead. dccp_retransmit_timer()
130 struct sock *sk = (struct sock *)data; dccp_write_timer()
166 struct sock *sk = (struct sock *)data; dccp_keepalive_timer()
175 struct sock *sk = (struct sock *)data; dccp_delack_timer()
225 struct sock *sk = (struct sock *)data; dccp_write_xmitlet()
238 sock_put((struct sock *)data); dccp_write_xmit_timer()
241 void dccp_init_xmit_timers(struct sock *sk) dccp_init_xmit_timers()
H A Dminisocks.c19 #include <net/sock.h>
35 void dccp_time_wait(struct sock *sk, int state, int timeo) dccp_time_wait()
75 struct sock *dccp_create_openreq_child(struct sock *sk, dccp_create_openreq_child()
85 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); dccp_create_openreq_child()
141 struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb, dccp_check_req()
144 struct sock *child = NULL; dccp_check_req()
211 int dccp_child_process(struct sock *parent, struct sock *child, dccp_child_process()
239 void dccp_reqsk_send_ack(struct sock *sk, struct sk_buff *skb, dccp_reqsk_send_ack()
/linux-4.1.27/net/x25/
H A Dx25_timer.c25 #include <net/sock.h>
32 void x25_init_timers(struct sock *sk) x25_init_timers()
43 void x25_start_heartbeat(struct sock *sk) x25_start_heartbeat()
48 void x25_stop_heartbeat(struct sock *sk) x25_stop_heartbeat()
53 void x25_start_t2timer(struct sock *sk) x25_start_t2timer()
60 void x25_start_t21timer(struct sock *sk) x25_start_t21timer()
67 void x25_start_t22timer(struct sock *sk) x25_start_t22timer()
74 void x25_start_t23timer(struct sock *sk) x25_start_t23timer()
81 void x25_stop_timer(struct sock *sk) x25_stop_timer()
86 unsigned long x25_display_timer(struct sock *sk) x25_display_timer()
98 struct sock *sk = (struct sock *)param; x25_heartbeat_expiry()
137 static inline void x25_do_timer_expiry(struct sock * sk) x25_do_timer_expiry()
165 struct sock *sk = (struct sock *)param; x25_timer_expiry()
H A Daf_x25.c25 * 2000-09-04 Henner Eisen Set sock->state in x25_accept().
52 #include <net/sock.h>
200 static void x25_remove_socket(struct sock *sk) x25_remove_socket()
212 struct sock *s; x25_kill_by_device()
265 static void x25_insert_socket(struct sock *sk) x25_insert_socket()
279 static struct sock *x25_find_listener(struct x25_address *addr, x25_find_listener()
282 struct sock *s; x25_find_listener()
283 struct sock *next_best; x25_find_listener()
323 static struct sock *__x25_find_socket(unsigned int lci, struct x25_neigh *nb) __x25_find_socket()
325 struct sock *s; __x25_find_socket()
337 struct sock *x25_find_socket(unsigned int lci, struct x25_neigh *nb) x25_find_socket()
339 struct sock *s; x25_find_socket()
353 struct sock *sk; x25_new_lci()
372 static void __x25_destroy_socket(struct sock *);
379 x25_destroy_socket_from_timer((struct sock *)data); x25_destroy_timer()
389 static void __x25_destroy_socket(struct sock *sk) __x25_destroy_socket()
425 void x25_destroy_socket_from_timer(struct sock *sk) x25_destroy_socket_from_timer()
439 static int x25_setsockopt(struct socket *sock, int level, int optname, x25_setsockopt() argument
443 struct sock *sk = sock->sk; x25_setsockopt()
466 static int x25_getsockopt(struct socket *sock, int level, int optname, x25_getsockopt() argument
469 struct sock *sk = sock->sk; x25_getsockopt()
495 static int x25_listen(struct socket *sock, int backlog) x25_listen() argument
497 struct sock *sk = sock->sk; x25_listen()
518 static struct sock *x25_alloc_socket(struct net *net) x25_alloc_socket()
521 struct sock *sk = sk_alloc(net, AF_X25, GFP_ATOMIC, &x25_proto); x25_alloc_socket()
537 static int x25_create(struct net *net, struct socket *sock, int protocol, x25_create() argument
540 struct sock *sk; x25_create()
548 if (sock->type != SOCK_SEQPACKET) x25_create()
561 sock_init_data(sock, sk); x25_create()
565 sock->ops = &x25_proto_ops; x25_create()
597 static struct sock *x25_make_new(struct sock *osk) x25_make_new()
599 struct sock *sk = NULL; x25_make_new()
635 static int x25_release(struct socket *sock) x25_release() argument
637 struct sock *sk = sock->sk; x25_release()
677 static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) x25_bind() argument
679 struct sock *sk = sock->sk; x25_bind()
708 static int x25_wait_for_connection_establishment(struct sock *sk) x25_wait_for_connection_establishment()
737 static int x25_connect(struct socket *sock, struct sockaddr *uaddr, x25_connect() argument
740 struct sock *sk = sock->sk; x25_connect()
747 if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { x25_connect()
748 sock->state = SS_CONNECTED; x25_connect()
753 if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) { x25_connect()
754 sock->state = SS_UNCONNECTED; x25_connect()
763 sock->state = SS_UNCONNECTED; x25_connect()
795 sock->state = SS_CONNECTING; x25_connect()
814 sock->state = SS_CONNECTED; x25_connect()
826 static int x25_wait_for_data(struct sock *sk, long timeout) x25_wait_for_data()
855 static int x25_accept(struct socket *sock, struct socket *newsock, int flags) x25_accept() argument
857 struct sock *sk = sock->sk; x25_accept()
858 struct sock *newsk; x25_accept()
896 static int x25_getname(struct socket *sock, struct sockaddr *uaddr, x25_getname() argument
900 struct sock *sk = sock->sk; x25_getname()
923 struct sock *sk; x25_rx_call_request()
924 struct sock *make; x25_rx_call_request()
1080 static int x25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) x25_sendmsg() argument
1082 struct sock *sk = sock->sk; x25_sendmsg()
1254 static int x25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, x25_recvmsg() argument
1257 struct sock *sk = sock->sk; x25_recvmsg()
1356 static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) x25_ioctl() argument
1358 struct sock *sk = sock->sk; x25_ioctl()
1672 static int compat_x25_ioctl(struct socket *sock, unsigned int cmd, compat_x25_ioctl() argument
1676 struct sock *sk = sock->sk; compat_x25_ioctl()
1683 rc = x25_ioctl(sock, cmd, (unsigned long)argp); compat_x25_ioctl()
1736 rc = x25_ioctl(sock, cmd, (unsigned long)argp); compat_x25_ioctl()
1781 struct sock *s; x25_kill_by_neigh()
/linux-4.1.27/include/crypto/
H A Dif_alg.h21 #include <net/sock.h>
28 /* struct sock must be the first member of struct alg_sock */
29 struct sock sk;
31 struct sock *parent;
55 int (*accept)(void *private, struct sock *sk);
56 int (*accept_nokey)(void *private, struct sock *sk);
74 int af_alg_release(struct socket *sock);
75 void af_alg_release_parent(struct sock *sk);
76 int af_alg_accept(struct sock *sk, struct socket *newsock);
87 static inline struct alg_sock *alg_sk(struct sock *sk) alg_sk()
/linux-4.1.27/net/
H A Dsocket.c100 #include <net/sock.h>
342 * and file struct implicitly stored in sock->file.
354 struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname) sock_alloc_file() argument
363 } else if (sock->sk) { sock_alloc_file()
364 name.name = sock->sk->sk_prot_creator->name; sock_alloc_file()
372 d_instantiate(path.dentry, SOCK_INODE(sock)); sock_alloc_file()
383 sock->file = file; sock_alloc_file()
385 file->private_data = sock; sock_alloc_file()
390 static int sock_map_fd(struct socket *sock, int flags) sock_map_fd() argument
397 newfile = sock_alloc_file(sock, flags, NULL); sock_map_fd()
433 struct socket *sock; sockfd_lookup() local
441 sock = sock_from_file(file, err); sockfd_lookup()
442 if (!sock) sockfd_lookup()
444 return sock; sockfd_lookup()
451 struct socket *sock; sockfd_lookup_light() local
455 sock = sock_from_file(f.file, err); sockfd_lookup_light()
456 if (likely(sock)) { sockfd_lookup_light()
458 return sock; sockfd_lookup_light()
538 struct socket *sock; sock_alloc() local
544 sock = SOCKET_I(inode); sock_alloc()
546 kmemcheck_annotate_bitfield(sock, type); sock_alloc()
554 return sock; sock_alloc()
559 * @sock: socket to close
566 void sock_release(struct socket *sock) sock_release() argument
568 if (sock->ops) { sock_release()
569 struct module *owner = sock->ops->owner; sock_release()
571 sock->ops->release(sock); sock_release()
572 sock->ops = NULL; sock_release()
576 if (rcu_dereference_protected(sock->wq, 1)->fasync_list) sock_release()
579 if (test_bit(SOCK_EXTERNALLY_ALLOCATED, &sock->flags)) sock_release()
583 if (!sock->file) { sock_release()
584 iput(SOCK_INODE(sock)); sock_release()
587 sock->file = NULL; sock_release()
591 void __sock_tx_timestamp(const struct sock *sk, __u8 *tx_flags) __sock_tx_timestamp()
611 static inline int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg) sock_sendmsg_nosec() argument
613 int ret = sock->ops->sendmsg(sock, msg, msg_data_left(msg)); sock_sendmsg_nosec()
618 int sock_sendmsg(struct socket *sock, struct msghdr *msg) sock_sendmsg() argument
620 int err = security_socket_sendmsg(sock, msg, sock_sendmsg()
623 return err ?: sock_sendmsg_nosec(sock, msg); sock_sendmsg()
627 int kernel_sendmsg(struct socket *sock, struct msghdr *msg, kernel_sendmsg() argument
631 return sock_sendmsg(sock, msg); kernel_sendmsg()
638 void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, __sock_recv_timestamp()
680 void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk, __sock_recv_wifi_status()
696 static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk, sock_recv_drops()
704 void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, __sock_recv_ts_and_drops()
712 static inline int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg, sock_recvmsg_nosec() argument
715 return sock->ops->recvmsg(sock, msg, size, flags); sock_recvmsg_nosec()
718 int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, sock_recvmsg() argument
721 int err = security_socket_recvmsg(sock, msg, size, flags); sock_recvmsg()
723 return err ?: sock_recvmsg_nosec(sock, msg, size, flags); sock_recvmsg()
729 * @sock: The socket to receive the message from
742 int kernel_recvmsg(struct socket *sock, struct msghdr *msg, kernel_recvmsg() argument
750 result = sock_recvmsg(sock, msg, size, flags); kernel_recvmsg()
759 struct socket *sock; sock_sendpage() local
762 sock = file->private_data; sock_sendpage()
768 return kernel_sendpage(sock, page, offset, size, flags); sock_sendpage()
775 struct socket *sock = file->private_data; sock_splice_read() local
777 if (unlikely(!sock->ops->splice_read)) sock_splice_read()
780 return sock->ops->splice_read(sock, ppos, pipe, len, flags); sock_splice_read()
786 struct socket *sock = file->private_data; sock_read_iter() local
800 res = sock_recvmsg(sock, &msg, iov_iter_count(to), msg.msg_flags); sock_read_iter()
808 struct socket *sock = file->private_data; sock_write_iter() local
819 if (sock->type == SOCK_SEQPACKET) sock_write_iter()
822 res = sock_sendmsg(sock, &msg); sock_write_iter()
865 static long sock_do_ioctl(struct net *net, struct socket *sock, sock_do_ioctl() argument
871 err = sock->ops->ioctl(sock, cmd, arg); sock_do_ioctl()
890 struct socket *sock; sock_ioctl() local
891 struct sock *sk; sock_ioctl()
896 sock = file->private_data; sock_ioctl()
897 sk = sock->sk; sock_ioctl()
913 f_setown(sock->file, pid, 1); sock_ioctl()
918 err = put_user(f_getown(sock->file), sock_ioctl()
957 err = sock_do_ioctl(net, sock, cmd, arg); sock_ioctl()
966 struct socket *sock = NULL; sock_create_lite() local
972 sock = sock_alloc(); sock_create_lite()
973 if (!sock) { sock_create_lite()
978 sock->type = type; sock_create_lite()
979 err = security_socket_post_create(sock, family, type, protocol, 1); sock_create_lite()
984 *res = sock; sock_create_lite()
987 sock_release(sock); sock_create_lite()
988 sock = NULL; sock_create_lite()
997 struct socket *sock; sock_poll() local
1002 sock = file->private_data; sock_poll()
1004 if (sk_can_busy_loop(sock->sk)) { sock_poll()
1010 sk_busy_loop(sock->sk, 1); sock_poll()
1013 return busy_flag | sock->ops->poll(file, sock, wait); sock_poll()
1018 struct socket *sock = file->private_data; sock_mmap() local
1020 return sock->ops->mmap(file, sock, vma); sock_mmap()
1042 struct socket *sock = filp->private_data; sock_fasync() local
1043 struct sock *sk = sock->sk; sock_fasync()
1050 wq = rcu_dereference_protected(sock->wq, sock_owned_by_user(sk)); sock_fasync()
1064 int sock_wake_async(struct socket *sock, int how, int band) sock_wake_async() argument
1068 if (!sock) sock_wake_async()
1071 wq = rcu_dereference(sock->wq); sock_wake_async()
1078 if (test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) sock_wake_async()
1082 if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags)) sock_wake_async()
1101 struct socket *sock; __sock_create() local
1136 sock = sock_alloc(); __sock_create()
1137 if (!sock) { __sock_create()
1143 sock->type = type; __sock_create()
1172 err = pf->create(net, sock, protocol, kern); __sock_create()
1180 if (!try_module_get(sock->ops->owner)) __sock_create()
1188 err = security_socket_post_create(sock, family, type, protocol, kern); __sock_create()
1191 *res = sock; __sock_create()
1198 sock->ops = NULL; __sock_create()
1201 sock_release(sock); __sock_create()
1225 struct socket *sock; SYSCALL_DEFINE3() local
1242 retval = sock_create(family, type, protocol, &sock); SYSCALL_DEFINE3()
1246 retval = sock_map_fd(sock, flags & (O_CLOEXEC | O_NONBLOCK)); SYSCALL_DEFINE3()
1255 sock_release(sock); SYSCALL_DEFINE3()
1374 struct socket *sock; SYSCALL_DEFINE3() local
1378 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE3()
1379 if (sock) { SYSCALL_DEFINE3()
1382 err = security_socket_bind(sock, SYSCALL_DEFINE3()
1386 err = sock->ops->bind(sock, SYSCALL_DEFINE3()
1390 fput_light(sock->file, fput_needed); SYSCALL_DEFINE3()
1403 struct socket *sock; SYSCALL_DEFINE2() local
1407 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE2()
1408 if (sock) { SYSCALL_DEFINE2()
1409 somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn; SYSCALL_DEFINE2()
1413 err = security_socket_listen(sock, backlog); SYSCALL_DEFINE2()
1415 err = sock->ops->listen(sock, backlog); SYSCALL_DEFINE2()
1417 fput_light(sock->file, fput_needed); SYSCALL_DEFINE2()
1437 struct socket *sock, *newsock; SYSCALL_DEFINE4() local
1448 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE4()
1449 if (!sock) SYSCALL_DEFINE4()
1457 newsock->type = sock->type; SYSCALL_DEFINE4()
1458 newsock->ops = sock->ops; SYSCALL_DEFINE4()
1461 * We don't need try_module_get here, as the listening socket (sock) SYSCALL_DEFINE4()
1462 * has the protocol module (sock->ops->owner) held. SYSCALL_DEFINE4()
1472 newfile = sock_alloc_file(newsock, flags, sock->sk->sk_prot_creator->name); SYSCALL_DEFINE4()
1480 err = security_socket_accept(sock, newsock); SYSCALL_DEFINE4()
1484 err = sock->ops->accept(sock, newsock, sock->file->f_flags); SYSCALL_DEFINE4()
1506 fput_light(sock->file, fput_needed); SYSCALL_DEFINE4()
1536 struct socket *sock; SYSCALL_DEFINE3() local
1540 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE3()
1541 if (!sock) SYSCALL_DEFINE3()
1548 security_socket_connect(sock, (struct sockaddr *)&address, addrlen); SYSCALL_DEFINE3()
1552 err = sock->ops->connect(sock, (struct sockaddr *)&address, addrlen, SYSCALL_DEFINE3()
1553 sock->file->f_flags); SYSCALL_DEFINE3()
1555 fput_light(sock->file, fput_needed); SYSCALL_DEFINE3()
1568 struct socket *sock; SYSCALL_DEFINE3() local
1572 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE3()
1573 if (!sock) SYSCALL_DEFINE3()
1576 err = security_socket_getsockname(sock); SYSCALL_DEFINE3()
1580 err = sock->ops->getname(sock, (struct sockaddr *)&address, &len, 0); SYSCALL_DEFINE3()
1586 fput_light(sock->file, fput_needed); SYSCALL_DEFINE3()
1599 struct socket *sock; SYSCALL_DEFINE3() local
1603 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE3()
1604 if (sock != NULL) { SYSCALL_DEFINE3()
1605 err = security_socket_getpeername(sock); SYSCALL_DEFINE3()
1607 fput_light(sock->file, fput_needed); SYSCALL_DEFINE3()
1612 sock->ops->getname(sock, (struct sockaddr *)&address, &len, SYSCALL_DEFINE3()
1617 fput_light(sock->file, fput_needed); SYSCALL_DEFINE3()
1632 struct socket *sock; SYSCALL_DEFINE6() local
1642 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE6()
1643 if (!sock) SYSCALL_DEFINE6()
1657 if (sock->file->f_flags & O_NONBLOCK) SYSCALL_DEFINE6()
1660 err = sock_sendmsg(sock, &msg); SYSCALL_DEFINE6()
1663 fput_light(sock->file, fput_needed); SYSCALL_DEFINE6()
1688 struct socket *sock; SYSCALL_DEFINE6() local
1698 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE6()
1699 if (!sock) SYSCALL_DEFINE6()
1709 if (sock->file->f_flags & O_NONBLOCK) SYSCALL_DEFINE6()
1711 err = sock_recvmsg(sock, &msg, iov_iter_count(&msg.msg_iter), flags); SYSCALL_DEFINE6()
1720 fput_light(sock->file, fput_needed); SYSCALL_DEFINE6()
1744 struct socket *sock; SYSCALL_DEFINE5() local
1749 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE5()
1750 if (sock != NULL) { SYSCALL_DEFINE5()
1751 err = security_socket_setsockopt(sock, level, optname); SYSCALL_DEFINE5()
1757 sock_setsockopt(sock, level, optname, optval, SYSCALL_DEFINE5()
1761 sock->ops->setsockopt(sock, level, optname, optval, SYSCALL_DEFINE5()
1764 fput_light(sock->file, fput_needed); SYSCALL_DEFINE5()
1778 struct socket *sock; SYSCALL_DEFINE5() local
1780 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE5()
1781 if (sock != NULL) { SYSCALL_DEFINE5()
1782 err = security_socket_getsockopt(sock, level, optname); SYSCALL_DEFINE5()
1788 sock_getsockopt(sock, level, optname, optval, SYSCALL_DEFINE5()
1792 sock->ops->getsockopt(sock, level, optname, optval, SYSCALL_DEFINE5()
1795 fput_light(sock->file, fput_needed); SYSCALL_DEFINE5()
1807 struct socket *sock; SYSCALL_DEFINE2() local
1809 sock = sockfd_lookup_light(fd, &err, &fput_needed); SYSCALL_DEFINE2()
1810 if (sock != NULL) { SYSCALL_DEFINE2()
1811 err = security_socket_shutdown(sock, how); SYSCALL_DEFINE2()
1813 err = sock->ops->shutdown(sock, how); SYSCALL_DEFINE2()
1814 fput_light(sock->file, fput_needed); SYSCALL_DEFINE2()
1884 static int ___sys_sendmsg(struct socket *sock, struct user_msghdr __user *msg, ___sys_sendmsg() argument
1915 cmsghdr_from_user_compat_to_kern(msg_sys, sock->sk, ctl, ___sys_sendmsg()
1923 ctl_buf = sock_kmalloc(sock->sk, ctl_len, GFP_KERNEL); ___sys_sendmsg()
1941 if (sock->file->f_flags & O_NONBLOCK) ___sys_sendmsg()
1953 err = sock_sendmsg_nosec(sock, msg_sys); ___sys_sendmsg()
1956 err = sock_sendmsg(sock, msg_sys); ___sys_sendmsg()
1970 sock_kfree_s(sock->sk, ctl_buf, ctl_len); ___sys_sendmsg()
1984 struct socket *sock; __sys_sendmsg() local
1986 sock = sockfd_lookup_light(fd, &err, &fput_needed); __sys_sendmsg()
1987 if (!sock) __sys_sendmsg()
1990 err = ___sys_sendmsg(sock, msg, &msg_sys, flags, NULL); __sys_sendmsg()
1992 fput_light(sock->file, fput_needed); __sys_sendmsg()
2012 struct socket *sock; __sys_sendmmsg() local
2023 sock = sockfd_lookup_light(fd, &err, &fput_needed); __sys_sendmmsg()
2024 if (!sock) __sys_sendmmsg()
2034 err = ___sys_sendmsg(sock, (struct user_msghdr __user *)compat_entry, __sys_sendmmsg()
2041 err = ___sys_sendmsg(sock, __sys_sendmmsg()
2055 fput_light(sock->file, fput_needed); __sys_sendmmsg()
2072 static int ___sys_recvmsg(struct socket *sock, struct user_msghdr __user *msg, ___sys_recvmsg() argument
2106 if (sock->file->f_flags & O_NONBLOCK) ___sys_recvmsg()
2108 err = (nosec ? sock_recvmsg_nosec : sock_recvmsg)(sock, msg_sys, ___sys_recvmsg()
2148 struct socket *sock; __sys_recvmsg() local
2150 sock = sockfd_lookup_light(fd, &err, &fput_needed); __sys_recvmsg()
2151 if (!sock) __sys_recvmsg()
2154 err = ___sys_recvmsg(sock, msg, &msg_sys, flags, 0); __sys_recvmsg()
2156 fput_light(sock->file, fput_needed); __sys_recvmsg()
2177 struct socket *sock; __sys_recvmmsg() local
2190 sock = sockfd_lookup_light(fd, &err, &fput_needed); __sys_recvmmsg()
2191 if (!sock) __sys_recvmmsg()
2194 err = sock_error(sock->sk); __sys_recvmmsg()
2206 err = ___sys_recvmsg(sock, (struct user_msghdr __user *)compat_entry, __sys_recvmmsg()
2214 err = ___sys_recvmsg(sock, __sys_recvmmsg()
2251 fput_light(sock->file, fput_needed); __sys_recvmmsg()
2259 * sock is non block and there aren't enough datagrams... __sys_recvmmsg()
2268 sock->sk->sk_err = -err; __sys_recvmmsg()
2559 static int do_siocgstamp(struct net *net, struct socket *sock, do_siocgstamp() argument
2567 err = sock_do_ioctl(net, sock, cmd, (unsigned long)&ktv); do_siocgstamp()
2575 static int do_siocgstampns(struct net *net, struct socket *sock, do_siocgstampns() argument
2583 err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts); do_siocgstampns()
2876 static int dev_ifsioc(struct net *net, struct socket *sock, dev_ifsioc() argument
2886 err = sock_do_ioctl(net, sock, cmd, (unsigned long)uifr); dev_ifsioc()
2981 static int routing_ioctl(struct net *net, struct socket *sock, routing_ioctl() argument
2992 if (sock && sock->sk && sock->sk->sk_family == AF_INET6) { /* ipv6 */ routing_ioctl()
3031 ret = sock_do_ioctl(net, sock, cmd, (unsigned long) r); routing_ioctl()
3053 static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, compat_sock_ioctl_trans() argument
3057 struct sock *sk = sock->sk; compat_sock_ioctl_trans()
3085 return routing_ioctl(net, sock, cmd, argp); compat_sock_ioctl_trans()
3087 return do_siocgstamp(net, sock, cmd, argp); compat_sock_ioctl_trans()
3089 return do_siocgstampns(net, sock, cmd, argp); compat_sock_ioctl_trans()
3141 return dev_ifsioc(net, sock, cmd, argp); compat_sock_ioctl_trans()
3147 return sock_do_ioctl(net, sock, cmd, arg); compat_sock_ioctl_trans()
3156 struct socket *sock = file->private_data; compat_sock_ioctl() local
3158 struct sock *sk; compat_sock_ioctl()
3161 sk = sock->sk; compat_sock_ioctl()
3164 if (sock->ops->compat_ioctl) compat_sock_ioctl()
3165 ret = sock->ops->compat_ioctl(sock, cmd, arg); compat_sock_ioctl()
3172 ret = compat_sock_ioctl_trans(file, sock, cmd, arg); compat_sock_ioctl()
3178 int kernel_bind(struct socket *sock, struct sockaddr *addr, int addrlen) kernel_bind() argument
3180 return sock->ops->bind(sock, addr, addrlen); kernel_bind()
3184 int kernel_listen(struct socket *sock, int backlog) kernel_listen() argument
3186 return sock->ops->listen(sock, backlog); kernel_listen()
3190 int kernel_accept(struct socket *sock, struct socket **newsock, int flags) kernel_accept() argument
3192 struct sock *sk = sock->sk; kernel_accept()
3200 err = sock->ops->accept(sock, *newsock, flags); kernel_accept()
3207 (*newsock)->ops = sock->ops; kernel_accept()
3215 int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen, kernel_connect() argument
3218 return sock->ops->connect(sock, addr, addrlen, flags); kernel_connect()
3222 int kernel_getsockname(struct socket *sock, struct sockaddr *addr, kernel_getsockname() argument
3225 return sock->ops->getname(sock, addr, addrlen, 0); kernel_getsockname()
3229 int kernel_getpeername(struct socket *sock, struct sockaddr *addr, kernel_getpeername() argument
3232 return sock->ops->getname(sock, addr, addrlen, 1); kernel_getpeername()
3236 int kernel_getsockopt(struct socket *sock, int level, int optname, kernel_getsockopt() argument
3249 err = sock_getsockopt(sock, level, optname, uoptval, uoptlen); kernel_getsockopt()
3251 err = sock->ops->getsockopt(sock, level, optname, uoptval, kernel_getsockopt()
3258 int kernel_setsockopt(struct socket *sock, int level, int optname, kernel_setsockopt() argument
3269 err = sock_setsockopt(sock, level, optname, uoptval, optlen); kernel_setsockopt()
3271 err = sock->ops->setsockopt(sock, level, optname, uoptval, kernel_setsockopt()
3278 int kernel_sendpage(struct socket *sock, struct page *page, int offset, kernel_sendpage() argument
3281 if (sock->ops->sendpage) kernel_sendpage()
3282 return sock->ops->sendpage(sock, page, offset, size, flags); kernel_sendpage()
3284 return sock_no_sendpage(sock, page, offset, size, flags); kernel_sendpage()
3288 int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg) kernel_sock_ioctl() argument
3294 err = sock->ops->ioctl(sock, cmd, arg); kernel_sock_ioctl()
3301 int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how) kernel_sock_shutdown() argument
3303 return sock->ops->shutdown(sock, how); kernel_sock_shutdown()
H A Dcompat.c28 #include <net/sock.h>
124 int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, cmsghdr_from_user_compat_to_kern()
312 static int do_set_attach_filter(struct socket *sock, int level, int optname, do_set_attach_filter() argument
328 return sock_setsockopt(sock, level, optname, (char __user *)kfprog, do_set_attach_filter()
332 static int do_set_sock_timeout(struct socket *sock, int level, do_set_sock_timeout() argument
348 err = sock_setsockopt(sock, level, optname, (char *)&ktime, sizeof(ktime)); do_set_sock_timeout()
354 static int compat_sock_setsockopt(struct socket *sock, int level, int optname, compat_sock_setsockopt() argument
358 return do_set_attach_filter(sock, level, optname, compat_sock_setsockopt()
361 return do_set_sock_timeout(sock, level, optname, optval, optlen); compat_sock_setsockopt()
363 return sock_setsockopt(sock, level, optname, optval, optlen); compat_sock_setsockopt()
370 struct socket *sock = sockfd_lookup(fd, &err); COMPAT_SYSCALL_DEFINE5() local
372 if (sock) { COMPAT_SYSCALL_DEFINE5()
373 err = security_socket_setsockopt(sock, level, optname); COMPAT_SYSCALL_DEFINE5()
375 sockfd_put(sock); COMPAT_SYSCALL_DEFINE5()
380 err = compat_sock_setsockopt(sock, level, COMPAT_SYSCALL_DEFINE5()
382 else if (sock->ops->compat_setsockopt) COMPAT_SYSCALL_DEFINE5()
383 err = sock->ops->compat_setsockopt(sock, level, COMPAT_SYSCALL_DEFINE5()
386 err = sock->ops->setsockopt(sock, level, COMPAT_SYSCALL_DEFINE5()
388 sockfd_put(sock); COMPAT_SYSCALL_DEFINE5()
393 static int do_get_sock_timeout(struct socket *sock, int level, int optname, do_get_sock_timeout() argument
409 err = sock_getsockopt(sock, level, optname, (char *) &ktime, &len); do_get_sock_timeout()
422 static int compat_sock_getsockopt(struct socket *sock, int level, int optname, compat_sock_getsockopt() argument
426 return do_get_sock_timeout(sock, level, optname, optval, optlen); compat_sock_getsockopt()
427 return sock_getsockopt(sock, level, optname, optval, optlen); compat_sock_getsockopt()
430 int compat_sock_get_timestamp(struct sock *sk, struct timeval __user *userstamp) compat_sock_get_timestamp()
458 int compat_sock_get_timestampns(struct sock *sk, struct timespec __user *userstamp) compat_sock_get_timestampns()
490 struct socket *sock = sockfd_lookup(fd, &err); COMPAT_SYSCALL_DEFINE5() local
492 if (sock) { COMPAT_SYSCALL_DEFINE5()
493 err = security_socket_getsockopt(sock, level, optname); COMPAT_SYSCALL_DEFINE5()
495 sockfd_put(sock); COMPAT_SYSCALL_DEFINE5()
500 err = compat_sock_getsockopt(sock, level, COMPAT_SYSCALL_DEFINE5()
502 else if (sock->ops->compat_getsockopt) COMPAT_SYSCALL_DEFINE5()
503 err = sock->ops->compat_getsockopt(sock, level, COMPAT_SYSCALL_DEFINE5()
506 err = sock->ops->getsockopt(sock, level, COMPAT_SYSCALL_DEFINE5()
508 sockfd_put(sock); COMPAT_SYSCALL_DEFINE5()
541 int compat_mc_setsockopt(struct sock *sock, int level, int optname, compat_mc_setsockopt() argument
543 int (*setsockopt)(struct sock *, int, int, char __user *, unsigned int)) compat_mc_setsockopt()
624 return setsockopt(sock, level, optname, koptval, koptlen); compat_mc_setsockopt()
628 int compat_mc_getsockopt(struct sock *sock, int level, int optname, compat_mc_getsockopt() argument
630 int (*getsockopt)(struct sock *, int, int, char __user *, int __user *)) compat_mc_getsockopt()
639 return getsockopt(sock, level, optname, optval, optlen); compat_mc_getsockopt()
669 err = getsockopt(sock, level, optname, (char __user *)kgf, koptlen); compat_mc_getsockopt()
/linux-4.1.27/net/llc/
H A Dllc_c_ev.c39 #include <net/sock.h>
75 static u16 llc_util_nr_inside_tx_window(struct sock *sk, u8 nr) llc_util_nr_inside_tx_window()
99 int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb) llc_conn_ev_conn_req()
107 int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb) llc_conn_ev_data_req()
115 int llc_conn_ev_disc_req(struct sock *sk, struct sk_buff *skb) llc_conn_ev_disc_req()
123 int llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rst_req()
131 int llc_conn_ev_local_busy_detected(struct sock *sk, struct sk_buff *skb) llc_conn_ev_local_busy_detected()
139 int llc_conn_ev_local_busy_cleared(struct sock *sk, struct sk_buff *skb) llc_conn_ev_local_busy_cleared()
147 int llc_conn_ev_rx_bad_pdu(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_bad_pdu()
152 int llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_disc_cmd_pbit_set_x()
160 int llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_dm_rsp_fbit_set_x()
168 int llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_frmr_rsp_fbit_set_x()
176 int llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_i_cmd_pbit_set_0()
186 int llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_i_cmd_pbit_set_1()
196 int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk, llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns()
208 int llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk, llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns()
220 int llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk, llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns()
235 int llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_i_rsp_fbit_set_0()
245 int llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_i_rsp_fbit_set_1()
254 int llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_i_rsp_fbit_set_x()
263 int llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk, llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns()
275 int llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk, llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns()
287 int llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk, llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns()
298 int llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk, llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns()
313 int llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rej_cmd_pbit_set_0()
322 int llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rej_cmd_pbit_set_1()
331 int llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rej_rsp_fbit_set_0()
340 int llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rej_rsp_fbit_set_1()
349 int llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rej_rsp_fbit_set_x()
357 int llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rnr_cmd_pbit_set_0()
366 int llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rnr_cmd_pbit_set_1()
375 int llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rnr_rsp_fbit_set_0()
384 int llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rnr_rsp_fbit_set_1()
393 int llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rr_cmd_pbit_set_0()
402 int llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rr_cmd_pbit_set_1()
411 int llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rr_rsp_fbit_set_0()
421 int llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_rr_rsp_fbit_set_1()
431 int llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_sabme_cmd_pbit_set_x()
439 int llc_conn_ev_rx_ua_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_ua_rsp_fbit_set_x()
447 int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_xxx_cmd_pbit_set_1()
462 int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_xxx_cmd_pbit_set_x()
481 int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_xxx_rsp_fbit_set_x()
502 int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk, llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr()
520 int llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk, llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr()
538 int llc_conn_ev_rx_any_frame(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rx_any_frame()
543 int llc_conn_ev_p_tmr_exp(struct sock *sk, struct sk_buff *skb) llc_conn_ev_p_tmr_exp()
550 int llc_conn_ev_ack_tmr_exp(struct sock *sk, struct sk_buff *skb) llc_conn_ev_ack_tmr_exp()
557 int llc_conn_ev_rej_tmr_exp(struct sock *sk, struct sk_buff *skb) llc_conn_ev_rej_tmr_exp()
564 int llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb) llc_conn_ev_busy_tmr_exp()
571 int llc_conn_ev_init_p_f_cycle(struct sock *sk, struct sk_buff *skb) llc_conn_ev_init_p_f_cycle()
576 int llc_conn_ev_tx_buffer_full(struct sock *sk, struct sk_buff *skb) llc_conn_ev_tx_buffer_full()
590 int llc_conn_ev_qlfy_data_flag_eq_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_data_flag_eq_1()
595 int llc_conn_ev_qlfy_data_flag_eq_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_data_flag_eq_0()
600 int llc_conn_ev_qlfy_data_flag_eq_2(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_data_flag_eq_2()
605 int llc_conn_ev_qlfy_p_flag_eq_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_p_flag_eq_1()
621 int llc_conn_ev_qlfy_last_frame_eq_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_last_frame_eq_1()
635 int llc_conn_ev_qlfy_last_frame_eq_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_last_frame_eq_0()
640 int llc_conn_ev_qlfy_p_flag_eq_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_p_flag_eq_0()
645 int llc_conn_ev_qlfy_p_flag_eq_f(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_p_flag_eq_f()
653 int llc_conn_ev_qlfy_remote_busy_eq_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_remote_busy_eq_0()
658 int llc_conn_ev_qlfy_remote_busy_eq_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_remote_busy_eq_1()
663 int llc_conn_ev_qlfy_retry_cnt_lt_n2(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_retry_cnt_lt_n2()
668 int llc_conn_ev_qlfy_retry_cnt_gte_n2(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_retry_cnt_gte_n2()
673 int llc_conn_ev_qlfy_s_flag_eq_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_s_flag_eq_1()
678 int llc_conn_ev_qlfy_s_flag_eq_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_s_flag_eq_0()
683 int llc_conn_ev_qlfy_cause_flag_eq_1(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_cause_flag_eq_1()
688 int llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_cause_flag_eq_0()
693 int llc_conn_ev_qlfy_set_status_conn(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_set_status_conn()
701 int llc_conn_ev_qlfy_set_status_disc(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_set_status_disc()
709 int llc_conn_ev_qlfy_set_status_failed(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_set_status_failed()
717 int llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk, llc_conn_ev_qlfy_set_status_remote_busy()
726 int llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_set_status_refuse()
734 int llc_conn_ev_qlfy_set_status_conflict(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_set_status_conflict()
742 int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, struct sk_buff *skb) llc_conn_ev_qlfy_set_status_rst_done()
H A Dllc_c_ac.c24 #include <net/sock.h>
32 static int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb);
33 static void llc_process_tmr_ev(struct sock *sk, struct sk_buff *skb);
34 static int llc_conn_ac_data_confirm(struct sock *sk, struct sk_buff *ev);
36 static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb);
38 static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk,
41 static int llc_conn_ac_set_p_flag_1(struct sock *sk, struct sk_buff *skb);
45 int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb) llc_conn_ac_clear_remote_busy()
61 int llc_conn_ac_conn_ind(struct sock *sk, struct sk_buff *skb) llc_conn_ac_conn_ind()
69 int llc_conn_ac_conn_confirm(struct sock *sk, struct sk_buff *skb) llc_conn_ac_conn_confirm()
77 static int llc_conn_ac_data_confirm(struct sock *sk, struct sk_buff *skb) llc_conn_ac_data_confirm()
85 int llc_conn_ac_data_ind(struct sock *sk, struct sk_buff *skb) llc_conn_ac_data_ind()
91 int llc_conn_ac_disc_ind(struct sock *sk, struct sk_buff *skb) llc_conn_ac_disc_ind()
119 int llc_conn_ac_disc_confirm(struct sock *sk, struct sk_buff *skb) llc_conn_ac_disc_confirm()
128 int llc_conn_ac_rst_ind(struct sock *sk, struct sk_buff *skb) llc_conn_ac_rst_ind()
167 int llc_conn_ac_rst_confirm(struct sock *sk, struct sk_buff *skb) llc_conn_ac_rst_confirm()
176 int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock *sk, llc_conn_ac_clear_remote_busy_if_f_eq_1()
188 int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk, llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2()
198 int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_disc_cmd_p_set_x()
223 int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_dm_rsp_f_set_p()
249 int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_dm_rsp_f_set_1()
273 int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_frmr_rsp_f_set_x()
307 int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_resend_frmr_rsp_f_set_0()
334 int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) llc_conn_ac_resend_frmr_rsp_f_set_p()
364 int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_i_cmd_p_set_1()
381 static int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_i_cmd_p_set_0()
398 int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_i_xxx_x_set_0()
415 int llc_conn_ac_resend_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_resend_i_xxx_x_set_0()
424 int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk, llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr()
453 int llc_conn_ac_resend_i_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_resend_i_rsp_f_set_1()
462 int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rej_cmd_p_set_1()
486 int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rej_rsp_f_set_1()
510 int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rej_xxx_x_set_0()
534 int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rnr_cmd_p_set_1()
558 int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rnr_rsp_f_set_1()
582 int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rnr_xxx_x_set_0()
606 int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_remote_busy()
618 int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_opt_send_rnr_xxx_x_set_0()
642 int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rr_cmd_p_set_1()
666 int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rr_rsp_f_set_1()
691 int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_ack_rsp_f_set_1()
715 int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_rr_xxx_x_set_0()
739 int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_ack_xxx_x_set_0()
763 void llc_conn_set_p_flag(struct sock *sk, u8 value) llc_conn_set_p_flag()
773 int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_sabme_cmd_p_set_x()
801 int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_ua_rsp_f_set_p()
828 int llc_conn_ac_set_s_flag_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_s_flag_0()
834 int llc_conn_ac_set_s_flag_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_s_flag_1()
840 int llc_conn_ac_start_p_timer(struct sock *sk, struct sk_buff *skb) llc_conn_ac_start_p_timer()
860 int llc_conn_ac_send_ack_if_needed(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_ack_if_needed()
891 int llc_conn_ac_rst_sendack_flag(struct sock *sk, struct sk_buff *skb) llc_conn_ac_rst_sendack_flag()
907 static int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock *sk, llc_conn_ac_send_i_rsp_f_set_ackpf()
935 int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb) llc_conn_ac_send_i_as_ack()
958 static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, llc_conn_ac_send_rr_rsp_f_set_ackpf()
993 static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb) llc_conn_ac_inc_npta_value()
1016 int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb) llc_conn_ac_adjust_npta_by_rr()
1042 int llc_conn_ac_adjust_npta_by_rnr(struct sock *sk, struct sk_buff *skb) llc_conn_ac_adjust_npta_by_rnr()
1067 int llc_conn_ac_dec_tx_win_size(struct sock *sk, struct sk_buff *skb) llc_conn_ac_dec_tx_win_size()
1087 int llc_conn_ac_inc_tx_win_size(struct sock *sk, struct sk_buff *skb) llc_conn_ac_inc_tx_win_size()
1097 int llc_conn_ac_stop_all_timers(struct sock *sk, struct sk_buff *skb) llc_conn_ac_stop_all_timers()
1110 int llc_conn_ac_stop_other_timers(struct sock *sk, struct sk_buff *skb) llc_conn_ac_stop_other_timers()
1122 int llc_conn_ac_start_ack_timer(struct sock *sk, struct sk_buff *skb) llc_conn_ac_start_ack_timer()
1130 int llc_conn_ac_start_rej_timer(struct sock *sk, struct sk_buff *skb) llc_conn_ac_start_rej_timer()
1139 int llc_conn_ac_start_ack_tmr_if_not_running(struct sock *sk, llc_conn_ac_start_ack_tmr_if_not_running()
1150 int llc_conn_ac_stop_ack_timer(struct sock *sk, struct sk_buff *skb) llc_conn_ac_stop_ack_timer()
1156 int llc_conn_ac_stop_p_timer(struct sock *sk, struct sk_buff *skb) llc_conn_ac_stop_p_timer()
1165 int llc_conn_ac_stop_rej_timer(struct sock *sk, struct sk_buff *skb) llc_conn_ac_stop_rej_timer()
1171 int llc_conn_ac_upd_nr_received(struct sock *sk, struct sk_buff *skb) llc_conn_ac_upd_nr_received()
1207 int llc_conn_ac_upd_p_flag(struct sock *sk, struct sk_buff *skb) llc_conn_ac_upd_p_flag()
1223 int llc_conn_ac_set_data_flag_2(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_data_flag_2()
1229 int llc_conn_ac_set_data_flag_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_data_flag_0()
1235 int llc_conn_ac_set_data_flag_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_data_flag_1()
1241 int llc_conn_ac_set_data_flag_1_if_data_flag_eq_0(struct sock *sk, llc_conn_ac_set_data_flag_1_if_data_flag_eq_0()
1249 int llc_conn_ac_set_p_flag_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_p_flag_0()
1255 static int llc_conn_ac_set_p_flag_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_p_flag_1()
1261 int llc_conn_ac_set_remote_busy_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_remote_busy_0()
1267 int llc_conn_ac_set_cause_flag_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_cause_flag_0()
1273 int llc_conn_ac_set_cause_flag_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_cause_flag_1()
1279 int llc_conn_ac_set_retry_cnt_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_retry_cnt_0()
1285 int llc_conn_ac_inc_retry_cnt_by_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_inc_retry_cnt_by_1()
1291 int llc_conn_ac_set_vr_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_vr_0()
1297 int llc_conn_ac_inc_vr_by_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_inc_vr_by_1()
1303 int llc_conn_ac_set_vs_0(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_vs_0()
1309 int llc_conn_ac_set_vs_nr(struct sock *sk, struct sk_buff *skb) llc_conn_ac_set_vs_nr()
1315 static int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb) llc_conn_ac_inc_vs_by_1()
1323 struct sock *sk = (struct sock *)timeout_data; llc_conn_tmr_common_cb()
1357 int llc_conn_ac_rst_vs(struct sock *sk, struct sk_buff *skb) llc_conn_ac_rst_vs()
1364 int llc_conn_ac_upd_vs(struct sock *sk, struct sk_buff *skb) llc_conn_ac_upd_vs()
1383 int llc_conn_disc(struct sock *sk, struct sk_buff *skb) llc_conn_disc()
1396 int llc_conn_reset(struct sock *sk, struct sk_buff *skb) llc_conn_reset()
1430 static void llc_process_tmr_ev(struct sock *sk, struct sk_buff *skb) llc_process_tmr_ev()
H A Daf_llc.c41 static int llc_ui_wait_for_conn(struct sock *sk, long timeout);
42 static int llc_ui_wait_for_disc(struct sock *sk, long timeout);
43 static int llc_ui_wait_for_busy_core(struct sock *sk, long timeout);
95 static inline u8 llc_ui_header_len(struct sock *sk, struct sockaddr_llc *addr) llc_ui_header_len()
115 static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock) llc_ui_send_data()
132 static void llc_ui_sk_init(struct socket *sock, struct sock *sk) llc_ui_sk_init() argument
134 sock_graft(sk, sock); llc_ui_sk_init()
135 sk->sk_type = sock->type; llc_ui_sk_init()
136 sock->ops = &llc_ui_ops; llc_ui_sk_init()
149 * @sock: Socket to initialize and attach allocated sk to.
157 static int llc_ui_create(struct net *net, struct socket *sock, int protocol, llc_ui_create() argument
160 struct sock *sk; llc_ui_create()
169 if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) { llc_ui_create()
174 llc_ui_sk_init(sock, sk); llc_ui_create()
182 * @sock: Socket to release.
186 static int llc_ui_release(struct socket *sock) llc_ui_release() argument
188 struct sock *sk = sock->sk; llc_ui_release()
243 * @sock: socket to bind
251 static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) llc_ui_autobind() argument
253 struct sock *sk = sock->sk; llc_ui_autobind()
291 * @sock: Socket to bind an address to.
303 static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) llc_ui_bind() argument
306 struct sock *sk = sock->sk; llc_ui_bind()
356 struct sock *ask; llc_ui_bind()
388 * @sock: Socket to shutdown.
397 static int llc_ui_shutdown(struct socket *sock, int how) llc_ui_shutdown() argument
399 struct sock *sk = sock->sk; llc_ui_shutdown()
420 * @sock: Socket which will be connected to the remote destination.
432 static int llc_ui_connect(struct socket *sock, struct sockaddr *uaddr, llc_ui_connect() argument
435 struct sock *sk = sock->sk; llc_ui_connect()
449 if (unlikely(sock->state == SS_CONNECTING)) llc_ui_connect()
454 rc = llc_ui_autobind(sock, addr); llc_ui_connect()
460 sock->state = SS_CONNECTING; llc_ui_connect()
467 sock->state = SS_UNCONNECTED; llc_ui_connect()
486 sock->state = SS_CONNECTED; llc_ui_connect()
493 sock->state = SS_UNCONNECTED; llc_ui_connect()
499 * @sock: Socket to allow incoming connections on.
505 static int llc_ui_listen(struct socket *sock, int backlog) llc_ui_listen() argument
507 struct sock *sk = sock->sk; llc_ui_listen()
511 if (unlikely(sock->state != SS_UNCONNECTED)) llc_ui_listen()
533 static int llc_ui_wait_for_disc(struct sock *sk, long timeout) llc_ui_wait_for_disc()
554 static int llc_ui_wait_for_conn(struct sock *sk, long timeout) llc_ui_wait_for_conn()
569 static int llc_ui_wait_for_busy_core(struct sock *sk, long timeout) llc_ui_wait_for_busy_core()
595 static int llc_wait_data(struct sock *sk, long timeo) llc_wait_data()
638 * @sock: Socket which connections arrive on.
645 static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags) llc_ui_accept() argument
647 struct sock *sk = sock->sk, *newsk; llc_ui_accept()
658 if (unlikely(sock->state != SS_UNCONNECTED || llc_ui_accept()
699 * @sock: Socket to copy data from.
707 static int llc_ui_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, llc_ui_recvmsg() argument
713 struct sock *sk = sock->sk; llc_ui_recvmsg()
874 * @sock: Socket to transmit data from.
881 static int llc_ui_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) llc_ui_sendmsg() argument
883 struct sock *sk = sock->sk; llc_ui_sendmsg()
906 rc = llc_ui_autobind(sock, addr); llc_ui_sendmsg()
958 * @sock: Socket to get address of.
965 static int llc_ui_getname(struct socket *sock, struct sockaddr *uaddr, llc_ui_getname() argument
969 struct sock *sk = sock->sk; llc_ui_getname()
1008 * @sock: Socket to get/set info
1014 static int llc_ui_ioctl(struct socket *sock, unsigned int cmd, llc_ui_ioctl() argument
1022 * @sock: Socket to set options on.
1030 static int llc_ui_setsockopt(struct socket *sock, int level, int optname, llc_ui_setsockopt() argument
1033 struct sock *sk = sock->sk; llc_ui_setsockopt()
1104 * @sock: Socket to get information from.
1112 static int llc_ui_getsockopt(struct socket *sock, int level, int optname, llc_ui_getsockopt() argument
1115 struct sock *sk = sock->sk; llc_ui_getsockopt()
H A Dllc_conn.c19 #include <net/sock.h>
33 static void llc_conn_send_pdus(struct sock *sk);
34 static int llc_conn_service(struct sock *sk, struct sk_buff *skb);
35 static int llc_exec_conn_trans_actions(struct sock *sk,
38 static struct llc_conn_state_trans *llc_qualify_conn_ev(struct sock *sk,
59 int llc_conn_state_process(struct sock *sk, struct sk_buff *skb) llc_conn_state_process()
106 * skb->sk pointing to the newly created struct sock in llc_conn_state_process()
196 void llc_conn_send_pdu(struct sock *sk, struct sk_buff *skb) llc_conn_send_pdu()
212 void llc_conn_rtn_pdu(struct sock *sk, struct sk_buff *skb) llc_conn_rtn_pdu()
229 void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, u8 first_p_bit) llc_conn_resend_i_pdu_as_cmd()
272 void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit) llc_conn_resend_i_pdu_as_rsp()
312 int llc_conn_remove_acked_pdus(struct sock *sk, u8 nr, u16 *how_many_unacked) llc_conn_remove_acked_pdus()
346 static void llc_conn_send_pdus(struct sock *sk) llc_conn_send_pdus()
375 static int llc_conn_service(struct sock *sk, struct sk_buff *skb) llc_conn_service()
405 static struct llc_conn_state_trans *llc_qualify_conn_ev(struct sock *sk, llc_qualify_conn_ev()
452 static int llc_exec_conn_trans_actions(struct sock *sk, llc_exec_conn_trans_actions()
475 const struct sock *sk) llc_estab_match()
496 static struct sock *__llc_lookup_established(struct llc_sap *sap, __llc_lookup_established()
500 struct sock *rc; __llc_lookup_established()
533 struct sock *llc_lookup_established(struct llc_sap *sap, llc_lookup_established()
537 struct sock *sk; llc_lookup_established()
547 const struct sock *sk) llc_listener_match()
556 static struct sock *__llc_lookup_listener(struct llc_sap *sap, __llc_lookup_listener()
559 struct sock *rc; __llc_lookup_listener()
602 static struct sock *llc_lookup_listener(struct llc_sap *sap, llc_lookup_listener()
606 struct sock *rc = __llc_lookup_listener(sap, laddr); llc_lookup_listener()
614 static struct sock *__llc_lookup(struct llc_sap *sap, __llc_lookup()
618 struct sock *sk = __llc_lookup_established(sap, daddr, laddr); __llc_lookup()
713 void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk) llc_sap_add_socket()
737 void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk) llc_sap_remove_socket()
756 static int llc_conn_rcv(struct sock *sk, struct sk_buff *skb) llc_conn_rcv()
765 static struct sock *llc_create_incoming_sock(struct sock *sk, llc_create_incoming_sock()
770 struct sock *newsk = llc_sk_alloc(sock_net(sk), sk->sk_family, GFP_ATOMIC, llc_create_incoming_sock()
790 struct sock *sk; llc_conn_handler()
808 * in the newly created struct sock private area. -acme llc_conn_handler()
811 struct sock *newsk = llc_create_incoming_sock(sk, skb->dev, llc_conn_handler()
853 * @sk: LLC sock (p8022 connection)
861 static int llc_backlog_rcv(struct sock *sk, struct sk_buff *skb) llc_backlog_rcv()
894 static void llc_sk_init(struct sock *sk) llc_sk_init()
927 * llc_sk_alloc - Allocates LLC sock
931 * Allocates a LLC sock and initializes it. Returns the new LLC sock
934 struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority, struct proto *prot) llc_sk_alloc()
936 struct sock *sk = sk_alloc(net, family, priority, prot); llc_sk_alloc()
957 void llc_sk_free(struct sock *sk) llc_sk_free()
974 printk(KERN_DEBUG "Destruction of LLC sock %p delayed in %s, cnt=%d\n", llc_sk_free()
994 void llc_sk_reset(struct sock *sk) llc_sk_reset()
/linux-4.1.27/samples/bpf/
H A Dsockex1_user.c13 int i, sock; main() local
22 sock = open_raw_sock("lo"); main()
24 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, main()
H A Dsockex2_user.c18 int i, sock; main() local
27 sock = open_raw_sock("lo"); main()
29 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, main()
H A Dlibbpf.c109 int sock; open_raw_sock() local
111 sock = socket(PF_PACKET, SOCK_RAW | SOCK_NONBLOCK | SOCK_CLOEXEC, htons(ETH_P_ALL)); open_raw_sock()
112 if (sock < 0) { open_raw_sock()
121 if (bind(sock, (struct sockaddr *)&sll, sizeof(sll)) < 0) { open_raw_sock()
123 close(sock); open_raw_sock()
127 return sock; open_raw_sock()
/linux-4.1.27/net/phonet/
H A Dsocket.c30 #include <net/sock.h>
39 static int pn_socket_release(struct socket *sock) pn_socket_release() argument
41 struct sock *sk = sock->sk; pn_socket_release()
44 sock->sk = NULL; pn_socket_release()
75 * Also grab sock if it was found. Remember to sock_put it later.
77 struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn) pn_find_sock_by_sa()
79 struct sock *sknode; pn_find_sock_by_sa()
80 struct sock *rval = NULL; pn_find_sock_by_sa()
122 struct sock *sknode; pn_deliver_sock_broadcast()
143 void pn_sock_hash(struct sock *sk) pn_sock_hash()
153 void pn_sock_unhash(struct sock *sk) pn_sock_unhash()
165 static int pn_socket_bind(struct socket *sock, struct sockaddr *addr, int len) pn_socket_bind() argument
167 struct sock *sk = sock->sk; pn_socket_bind()
211 static int pn_socket_autobind(struct socket *sock) pn_socket_autobind() argument
218 err = pn_socket_bind(sock, (struct sockaddr *)&sa, pn_socket_autobind()
222 BUG_ON(!pn_port(pn_sk(sock->sk)->sobject)); pn_socket_autobind()
226 static int pn_socket_connect(struct socket *sock, struct sockaddr *addr, pn_socket_connect() argument
229 struct sock *sk = sock->sk; pn_socket_connect()
236 if (pn_socket_autobind(sock)) pn_socket_connect()
245 switch (sock->state) { pn_socket_connect()
262 sock->state = SS_CONNECTING; pn_socket_connect()
266 sock->state = SS_UNCONNECTED; pn_socket_connect()
297 sock->state = err ? SS_UNCONNECTED : SS_CONNECTED; pn_socket_connect()
303 static int pn_socket_accept(struct socket *sock, struct socket *newsock, pn_socket_accept() argument
306 struct sock *sk = sock->sk; pn_socket_accept()
307 struct sock *newsk; pn_socket_accept()
324 static int pn_socket_getname(struct socket *sock, struct sockaddr *addr, pn_socket_getname() argument
327 struct sock *sk = sock->sk; pn_socket_getname()
340 static unsigned int pn_socket_poll(struct file *file, struct socket *sock, pn_socket_poll() argument
343 struct sock *sk = sock->sk; pn_socket_poll()
366 static int pn_socket_ioctl(struct socket *sock, unsigned int cmd, pn_socket_ioctl() argument
369 struct sock *sk = sock->sk; pn_socket_ioctl()
404 static int pn_socket_listen(struct socket *sock, int backlog) pn_socket_listen() argument
406 struct sock *sk = sock->sk; pn_socket_listen()
409 if (pn_socket_autobind(sock)) pn_socket_listen()
413 if (sock->state != SS_UNCONNECTED) { pn_socket_listen()
428 static int pn_socket_sendmsg(struct socket *sock, struct msghdr *m, pn_socket_sendmsg() argument
431 struct sock *sk = sock->sk; pn_socket_sendmsg()
433 if (pn_socket_autobind(sock)) pn_socket_sendmsg()
491 int pn_sock_get_port(struct sock *sk, unsigned short sport) pn_sock_get_port()
497 struct sock *tmpsk; pn_sock_get_port()
525 /* No sock there! We can use that port... */ pn_sock_get_port()
540 static struct sock *pn_sock_get_idx(struct seq_file *seq, loff_t pos) pn_sock_get_idx()
544 struct sock *sknode; pn_sock_get_idx()
560 static struct sock *pn_sock_get_next(struct seq_file *seq, struct sock *sk) pn_sock_get_next()
580 struct sock *sk; pn_sock_seq_next()
603 struct sock *sk = v; pn_sock_seq_show()
643 struct sock *sk[256];
649 struct sock *pn_find_sock_by_res(struct net *net, u8 res) pn_find_sock_by_res()
651 struct sock *sk; pn_find_sock_by_res()
666 int pn_sock_bind_res(struct sock *sk, u8 res) pn_sock_bind_res()
687 int pn_sock_unbind_res(struct sock *sk, u8 res) pn_sock_unbind_res()
708 void pn_sock_unbind_all_res(struct sock *sk) pn_sock_unbind_all_res()
729 static struct sock **pn_res_get_idx(struct seq_file *seq, loff_t pos) pn_res_get_idx()
747 static struct sock **pn_res_get_next(struct seq_file *seq, struct sock **sk) pn_res_get_next()
769 struct sock **sk; pn_res_seq_next()
791 struct sock **psk = v; pn_res_seq_show()
792 struct sock *sk = *psk; pn_res_seq_show()
H A Ddatagram.c30 #include <net/sock.h>
36 static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb);
39 static void pn_sock_close(struct sock *sk, long timeout) pn_sock_close()
44 static int pn_ioctl(struct sock *sk, int cmd, unsigned long arg) pn_ioctl()
75 static void pn_destruct(struct sock *sk) pn_destruct()
80 static int pn_init(struct sock *sk) pn_init()
86 static int pn_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) pn_sendmsg()
127 static int pn_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, pn_recvmsg()
172 /* Queue an skb for a sock. */ pn_backlog_rcv()
173 static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb) pn_backlog_rcv()
H A Dpep.c28 #include <net/sock.h>
39 * TCP_CLOSE sock not in use yet
46 * - sk_state, hlist: sock lock needed
81 static struct sk_buff *pep_alloc_skb(struct sock *sk, const void *payload, pep_alloc_skb()
97 static int pep_reply(struct sock *sk, struct sk_buff *oskb, u8 code, pep_reply()
119 static int pep_indicate(struct sock *sk, u8 id, u8 code, pep_indicate()
140 static int pipe_handler_request(struct sock *sk, u8 id, u8 code, pipe_handler_request()
159 static int pipe_handler_send_created_ind(struct sock *sk) pipe_handler_send_created_ind()
171 static int pep_accept_conn(struct sock *sk, struct sk_buff *skb) pep_accept_conn()
192 static int pep_reject_conn(struct sock *sk, struct sk_buff *skb, u8 code, pep_reject_conn()
202 static int pep_ctrlreq_error(struct sock *sk, struct sk_buff *oskb, u8 code, pep_ctrlreq_error()
229 static int pipe_snd_status(struct sock *sk, u8 type, u8 status, gfp_t priority) pipe_snd_status()
239 static void pipe_grant_credits(struct sock *sk, gfp_t priority) pipe_grant_credits()
264 static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb) pipe_rcv_status()
316 static int pipe_rcv_created(struct sock *sk, struct sk_buff *skb) pipe_rcv_created()
343 /* Queue an skb to a connected sock.
345 static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb) pipe_do_rcv()
471 /* Destroy connected sock. */ pipe_destruct()
472 static void pipe_destruct(struct sock *sk) pipe_destruct()
494 static int pep_connresp_rcv(struct sock *sk, struct sk_buff *skb) pep_connresp_rcv()
536 static int pep_enableresp_rcv(struct sock *sk, struct sk_buff *skb) pep_enableresp_rcv()
548 static void pipe_start_flow_control(struct sock *sk) pipe_start_flow_control()
559 /* Queue an skb to an actively connected sock.
561 static int pipe_handler_do_rcv(struct sock *sk, struct sk_buff *skb) pipe_handler_do_rcv()
625 /* sock should already be dead, nothing to do */ pipe_handler_do_rcv()
636 /* Listening sock must be locked */ pep_find_pipe()
637 static struct sock *pep_find_pipe(const struct hlist_head *hlist, pep_find_pipe()
641 struct sock *sknode; pep_find_pipe()
662 * Deliver an skb to a listening sock.
664 * We then queue the skb to the right connected sock (if any).
666 static int pep_do_rcv(struct sock *sk, struct sk_buff *skb) pep_do_rcv()
669 struct sock *sknode; pep_do_rcv()
727 static int pipe_do_remove(struct sock *sk) pipe_do_remove()
746 static void pep_sock_close(struct sock *sk, long timeout) pep_sock_close()
774 static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp) pep_sock_accept()
777 struct sock *newsk = NULL; pep_sock_accept()
847 /* Create a new to-be-accepted sock */ pep_sock_accept()
893 static int pep_sock_connect(struct sock *sk, struct sockaddr *addr, int len) pep_sock_connect()
914 static int pep_sock_enable(struct sock *sk, struct sockaddr *addr, int len) pep_sock_enable()
928 static int pep_ioctl(struct sock *sk, int cmd, unsigned long arg) pep_ioctl()
968 static int pep_init(struct sock *sk) pep_init()
987 static int pep_setsockopt(struct sock *sk, int level, int optname, pep_setsockopt()
1049 static int pep_getsockopt(struct sock *sk, int level, int optname, pep_getsockopt()
1091 static int pipe_skb_send(struct sock *sk, struct sk_buff *skb) pipe_skb_send()
1121 static int pep_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) pep_sendmsg()
1201 int pep_writeable(struct sock *sk) pep_writeable()
1208 int pep_write(struct sock *sk, struct sk_buff *skb) pep_write()
1239 struct sk_buff *pep_read(struct sock *sk) pep_read()
1248 static int pep_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, pep_recvmsg()
1305 static void pep_sock_unhash(struct sock *sk) pep_sock_unhash()
1308 struct sock *skparent = NULL; pep_sock_unhash()
1323 /* Unhash a listening sock only when it is closed pep_sock_unhash()
H A Dpep-gprs.c29 #include <net/sock.h>
38 struct sock *sk;
39 void (*old_state_change)(struct sock *);
40 void (*old_data_ready)(struct sock *);
41 void (*old_write_space)(struct sock *);
76 static void gprs_state_change(struct sock *sk) gprs_state_change()
149 static void gprs_data_ready(struct sock *sk) gprs_data_ready()
160 static void gprs_write_space(struct sock *sk) gprs_write_space()
189 struct sock *sk = gp->sk; gprs_xmit()
258 int gprs_attach(struct sock *sk) gprs_attach()
312 void gprs_detach(struct sock *sk) gprs_detach()
/linux-4.1.27/crypto/
H A Dalgif_hash.c22 #include <net/sock.h>
42 static int hash_sendmsg(struct socket *sock, struct msghdr *msg, hash_sendmsg() argument
46 struct sock *sk = sock->sk; hash_sendmsg()
104 static ssize_t hash_sendpage(struct socket *sock, struct page *page, hash_sendpage() argument
107 struct sock *sk = sock->sk; hash_sendpage()
149 static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, hash_recvmsg() argument
152 struct sock *sk = sock->sk; hash_recvmsg()
181 static int hash_accept(struct socket *sock, struct socket *newsock, int flags) hash_accept() argument
183 struct sock *sk = sock->sk; hash_accept()
188 struct sock *sk2; hash_accept()
237 static int hash_check_key(struct socket *sock) hash_check_key() argument
240 struct sock *psk; hash_check_key()
243 struct sock *sk = sock->sk; hash_check_key()
275 static int hash_sendmsg_nokey(struct socket *sock, struct msghdr *msg, hash_sendmsg_nokey() argument
280 err = hash_check_key(sock); hash_sendmsg_nokey()
284 return hash_sendmsg(sock, msg, size); hash_sendmsg_nokey()
287 static ssize_t hash_sendpage_nokey(struct socket *sock, struct page *page, hash_sendpage_nokey() argument
292 err = hash_check_key(sock); hash_sendpage_nokey()
296 return hash_sendpage(sock, page, offset, size, flags); hash_sendpage_nokey()
299 static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg, hash_recvmsg_nokey() argument
304 err = hash_check_key(sock); hash_recvmsg_nokey()
308 return hash_recvmsg(sock, msg, ignored, flags); hash_recvmsg_nokey()
311 static int hash_accept_nokey(struct socket *sock, struct socket *newsock, hash_accept_nokey() argument
316 err = hash_check_key(sock); hash_accept_nokey()
320 return hash_accept(sock, newsock, flags); hash_accept_nokey()
384 static void hash_sock_destruct(struct sock *sk) hash_sock_destruct()
395 static int hash_accept_parent_nokey(void *private, struct sock *sk) hash_accept_parent_nokey()
431 static int hash_accept_parent(void *private, struct sock *sk) hash_accept_parent()
H A Daf_alg.c122 int af_alg_release(struct socket *sock) af_alg_release() argument
124 if (sock->sk) af_alg_release()
125 sock_put(sock->sk); af_alg_release()
130 void af_alg_release_parent(struct sock *sk) af_alg_release_parent()
150 static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) alg_bind() argument
152 struct sock *sk = sock->sk; alg_bind()
159 if (sock->state == SS_CONNECTED) alg_bind()
201 static int alg_setkey(struct sock *sk, char __user *ukey, alg_setkey()
225 static int alg_setsockopt(struct socket *sock, int level, int optname, alg_setsockopt() argument
228 struct sock *sk = sock->sk; alg_setsockopt()
245 if (sock->state == SS_CONNECTED) alg_setsockopt()
253 if (sock->state == SS_CONNECTED) alg_setsockopt()
266 int af_alg_accept(struct sock *sk, struct socket *newsock) af_alg_accept()
270 struct sock *sk2; af_alg_accept()
323 static int alg_accept(struct socket *sock, struct socket *newsock, int flags) alg_accept() argument
325 return af_alg_accept(sock->sk, newsock); alg_accept()
351 static void alg_sock_destruct(struct sock *sk) alg_sock_destruct()
358 static int alg_create(struct net *net, struct socket *sock, int protocol, alg_create() argument
361 struct sock *sk; alg_create()
364 if (sock->type != SOCK_SEQPACKET) alg_create()
374 sock->ops = &alg_proto_ops; alg_create()
375 sock_init_data(sock, sk); alg_create()
H A Dalgif_skcipher.c24 #include <net/sock.h>
105 struct sock *sk = req->data; skcipher_async_cb()
117 static inline int skcipher_sndbuf(struct sock *sk) skcipher_sndbuf()
126 static inline bool skcipher_writable(struct sock *sk) skcipher_writable()
131 static int skcipher_alloc_sgl(struct sock *sk) skcipher_alloc_sgl()
161 static void skcipher_pull_sgl(struct sock *sk, int used, int put) skcipher_pull_sgl()
203 static void skcipher_free_sgl(struct sock *sk) skcipher_free_sgl()
211 static int skcipher_wait_for_wmem(struct sock *sk, unsigned flags) skcipher_wait_for_wmem()
237 static void skcipher_wmem_wakeup(struct sock *sk) skcipher_wmem_wakeup()
254 static int skcipher_wait_for_data(struct sock *sk, unsigned flags) skcipher_wait_for_data()
285 static void skcipher_data_wakeup(struct sock *sk) skcipher_data_wakeup()
304 static int skcipher_sendmsg(struct socket *sock, struct msghdr *msg, skcipher_sendmsg() argument
307 struct sock *sk = sock->sk; skcipher_sendmsg()
439 static ssize_t skcipher_sendpage(struct socket *sock, struct page *page, skcipher_sendpage() argument
442 struct sock *sk = sock->sk; skcipher_sendpage()
507 static int skcipher_recvmsg_async(struct socket *sock, struct msghdr *msg, skcipher_recvmsg_async() argument
510 struct sock *sk = sock->sk; skcipher_recvmsg_async()
635 static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg, skcipher_recvmsg_sync() argument
638 struct sock *sk = sock->sk; skcipher_recvmsg_sync()
708 static int skcipher_recvmsg(struct socket *sock, struct msghdr *msg, skcipher_recvmsg() argument
712 skcipher_recvmsg_async(sock, msg, flags) : skcipher_recvmsg()
713 skcipher_recvmsg_sync(sock, msg, flags); skcipher_recvmsg()
716 static unsigned int skcipher_poll(struct file *file, struct socket *sock, skcipher_poll() argument
719 struct sock *sk = sock->sk; skcipher_poll()
758 static int skcipher_check_key(struct socket *sock) skcipher_check_key() argument
761 struct sock *psk; skcipher_check_key()
764 struct sock *sk = sock->sk; skcipher_check_key()
796 static int skcipher_sendmsg_nokey(struct socket *sock, struct msghdr *msg, skcipher_sendmsg_nokey() argument
801 err = skcipher_check_key(sock); skcipher_sendmsg_nokey()
805 return skcipher_sendmsg(sock, msg, size); skcipher_sendmsg_nokey()
808 static ssize_t skcipher_sendpage_nokey(struct socket *sock, struct page *page, skcipher_sendpage_nokey() argument
813 err = skcipher_check_key(sock); skcipher_sendpage_nokey()
817 return skcipher_sendpage(sock, page, offset, size, flags); skcipher_sendpage_nokey()
820 static int skcipher_recvmsg_nokey(struct socket *sock, struct msghdr *msg, skcipher_recvmsg_nokey() argument
825 err = skcipher_check_key(sock); skcipher_recvmsg_nokey()
829 return skcipher_recvmsg(sock, msg, ignored, flags); skcipher_recvmsg_nokey()
893 static void skcipher_wait(struct sock *sk) skcipher_wait()
903 static void skcipher_sock_destruct(struct sock *sk) skcipher_sock_destruct()
918 static int skcipher_accept_parent_nokey(void *private, struct sock *sk) skcipher_accept_parent_nokey()
959 static int skcipher_accept_parent(void *private, struct sock *sk) skcipher_accept_parent()
H A Dalgif_aead.c24 #include <net/sock.h>
56 static inline int aead_sndbuf(struct sock *sk) aead_sndbuf()
65 static inline bool aead_writable(struct sock *sk) aead_writable()
77 static void aead_put_sgl(struct sock *sk) aead_put_sgl()
98 static void aead_wmem_wakeup(struct sock *sk) aead_wmem_wakeup()
115 static int aead_wait_for_data(struct sock *sk, unsigned flags) aead_wait_for_data()
145 static void aead_data_wakeup(struct sock *sk) aead_data_wakeup()
166 static int aead_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) aead_sendmsg() argument
168 struct sock *sk = sock->sk; aead_sendmsg()
298 static ssize_t aead_sendpage(struct socket *sock, struct page *page, aead_sendpage() argument
301 struct sock *sk = sock->sk; aead_sendpage()
350 static int aead_recvmsg(struct socket *sock, struct msghdr *msg, size_t ignored, int flags) aead_recvmsg() argument
352 struct sock *sk = sock->sk; aead_recvmsg()
522 static unsigned int aead_poll(struct file *file, struct socket *sock, aead_poll() argument
525 struct sock *sk = sock->sk; aead_poll()
584 static void aead_sock_destruct(struct sock *sk) aead_sock_destruct()
597 static int aead_accept_parent(void *private, struct sock *sk) aead_accept_parent()
/linux-4.1.27/drivers/infiniband/hw/usnic/
H A Dusnic_transport.c50 struct socket *sock) usnic_transport_sock_to_str()
58 err = usnic_transport_sock_get_addr(sock, &proto, &addr, &port); usnic_transport_sock_to_str()
132 struct socket *sock; usnic_transport_get_socket() local
137 sock = sockfd_lookup(sock_fd, &err); usnic_transport_get_socket()
138 if (!sock) { usnic_transport_get_socket()
144 usnic_transport_sock_to_str(buf, sizeof(buf), sock); usnic_transport_get_socket()
145 usnic_dbg("Get sock %s\n", buf); usnic_transport_get_socket()
147 return sock; usnic_transport_get_socket()
150 void usnic_transport_put_socket(struct socket *sock) usnic_transport_put_socket() argument
154 usnic_transport_sock_to_str(buf, sizeof(buf), sock); usnic_transport_put_socket()
155 usnic_dbg("Put sock %s\n", buf); usnic_transport_put_socket()
156 sockfd_put(sock); usnic_transport_put_socket()
159 int usnic_transport_sock_get_addr(struct socket *sock, int *proto, usnic_transport_sock_get_addr() argument
166 err = sock->ops->getname(sock, usnic_transport_sock_get_addr()
176 *proto = sock->sk->sk_protocol; usnic_transport_sock_get_addr()
49 usnic_transport_sock_to_str(char *buf, int buf_sz, struct socket *sock) usnic_transport_sock_to_str() argument
H A Dusnic_transport.h30 struct socket *sock);
43 void usnic_transport_put_socket(struct socket *sock);
47 int usnic_transport_sock_get_addr(struct socket *sock, int *proto,
/linux-4.1.27/include/trace/events/
H A Dsock.h2 #define TRACE_SYSTEM sock
7 #include <net/sock.h>
12 TP_PROTO(struct sock *sk, struct sk_buff *skb),
34 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
H A Dudp.h12 TP_PROTO(int rc, struct sock *sk),
/linux-4.1.27/net/rose/
H A Drose_timer.c24 #include <net/sock.h>
35 void rose_start_heartbeat(struct sock *sk) rose_start_heartbeat()
46 void rose_start_t1timer(struct sock *sk) rose_start_t1timer()
59 void rose_start_t2timer(struct sock *sk) rose_start_t2timer()
72 void rose_start_t3timer(struct sock *sk) rose_start_t3timer()
85 void rose_start_hbtimer(struct sock *sk) rose_start_hbtimer()
98 void rose_start_idletimer(struct sock *sk) rose_start_idletimer()
113 void rose_stop_heartbeat(struct sock *sk) rose_stop_heartbeat()
118 void rose_stop_timer(struct sock *sk) rose_stop_timer()
123 void rose_stop_idletimer(struct sock *sk) rose_stop_idletimer()
130 struct sock *sk = (struct sock *)param; rose_heartbeat_expiry()
168 struct sock *sk = (struct sock *)param; rose_timer_expiry()
197 struct sock *sk = (struct sock *)param; rose_idletimer_expiry()
H A Daf_rose.c36 #include <net/sock.h>
154 static void rose_remove_socket(struct sock *sk) rose_remove_socket()
167 struct sock *s; rose_kill_by_neigh()
187 struct sock *s; rose_kill_by_device()
232 static void rose_insert_socket(struct sock *sk) rose_insert_socket()
244 static struct sock *rose_find_listener(rose_address *addr, ax25_address *call) rose_find_listener()
246 struct sock *s; rose_find_listener()
275 struct sock *rose_find_socket(unsigned int lci, struct rose_neigh *neigh) rose_find_socket()
277 struct sock *s; rose_find_socket()
315 void rose_destroy_socket(struct sock *);
322 rose_destroy_socket((struct sock *)data); rose_destroy_timer()
331 void rose_destroy_socket(struct sock *sk) rose_destroy_socket()
368 static int rose_setsockopt(struct socket *sock, int level, int optname, rose_setsockopt() argument
371 struct sock *sk = sock->sk; rose_setsockopt()
428 static int rose_getsockopt(struct socket *sock, int level, int optname, rose_getsockopt() argument
431 struct sock *sk = sock->sk; rose_getsockopt()
486 static int rose_listen(struct socket *sock, int backlog) rose_listen() argument
488 struct sock *sk = sock->sk; rose_listen()
511 static int rose_create(struct net *net, struct socket *sock, int protocol, rose_create() argument
514 struct sock *sk; rose_create()
520 if (sock->type != SOCK_SEQPACKET || protocol != 0) rose_create()
529 sock_init_data(sock, sk); rose_create()
537 sock->ops = &rose_proto_ops; rose_create()
554 static struct sock *rose_make_new(struct sock *osk) rose_make_new()
556 struct sock *sk; rose_make_new()
600 static int rose_release(struct socket *sock) rose_release() argument
602 struct sock *sk = sock->sk; rose_release()
648 sock->sk = NULL; rose_release()
655 static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) rose_bind() argument
657 struct sock *sk = sock->sk; rose_bind()
716 static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags) rose_connect() argument
718 struct sock *sk = sock->sk; rose_connect()
744 if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { rose_connect()
746 sock->state = SS_CONNECTED; rose_connect()
750 if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) { rose_connect()
751 sock->state = SS_UNCONNECTED; rose_connect()
763 sock->state = SS_UNCONNECTED; rose_connect()
815 sock->state = SS_CONNECTING; rose_connect()
860 sock->state = SS_UNCONNECTED; rose_connect()
865 sock->state = SS_CONNECTED; rose_connect()
873 static int rose_accept(struct socket *sock, struct socket *newsock, int flags) rose_accept() argument
876 struct sock *newsk; rose_accept()
878 struct sock *sk; rose_accept()
881 if ((sk = sock->sk) == NULL) rose_accept()
937 static int rose_getname(struct socket *sock, struct sockaddr *uaddr, rose_getname() argument
941 struct sock *sk = sock->sk; rose_getname()
970 struct sock *sk; rose_rx_call_request()
971 struct sock *make; rose_rx_call_request()
1049 static int rose_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) rose_sendmsg() argument
1051 struct sock *sk = sock->sk; rose_sendmsg()
1213 static int rose_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, rose_recvmsg() argument
1216 struct sock *sk = sock->sk; rose_recvmsg()
1275 static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) rose_ioctl() argument
1277 struct sock *sk = sock->sk; rose_ioctl()
1403 struct sock *s = sk_entry(v); rose_info_show()
/linux-4.1.27/net/bluetooth/
H A Dl2cap_sock.c44 static void l2cap_sock_init(struct sock *sk, struct sock *parent);
45 static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
48 bool l2cap_is_socket(struct socket *sock) l2cap_is_socket() argument
50 return sock && sock->ops == &l2cap_sock_ops; l2cap_is_socket()
80 static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) l2cap_sock_bind() argument
82 struct sock *sk = sock->sk; l2cap_sock_bind()
173 static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, l2cap_sock_connect() argument
176 struct sock *sk = sock->sk; l2cap_sock_connect()
251 static int l2cap_sock_listen(struct socket *sock, int backlog) l2cap_sock_listen() argument
253 struct sock *sk = sock->sk; l2cap_sock_listen()
302 static int l2cap_sock_accept(struct socket *sock, struct socket *newsock, l2cap_sock_accept() argument
306 struct sock *sk = sock->sk, *nsk; l2cap_sock_accept()
358 static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, l2cap_sock_getname() argument
362 struct sock *sk = sock->sk; l2cap_sock_getname()
365 BT_DBG("sock %p, sk %p", sock, sk); l2cap_sock_getname()
391 static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, l2cap_sock_getsockopt_old() argument
394 struct sock *sk = sock->sk; l2cap_sock_getsockopt_old()
494 static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, l2cap_sock_getsockopt() argument
497 struct sock *sk = sock->sk; l2cap_sock_getsockopt()
506 return l2cap_sock_getsockopt_old(sock, optname, optval, optlen); l2cap_sock_getsockopt()
630 static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, l2cap_sock_setsockopt_old() argument
633 struct sock *sk = sock->sk; l2cap_sock_setsockopt_old()
742 static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, l2cap_sock_setsockopt() argument
745 struct sock *sk = sock->sk; l2cap_sock_setsockopt()
756 return l2cap_sock_setsockopt_old(sock, optname, optval, optlen); l2cap_sock_setsockopt()
947 static int l2cap_sock_sendmsg(struct socket *sock, struct msghdr *msg, l2cap_sock_sendmsg() argument
950 struct sock *sk = sock->sk; l2cap_sock_sendmsg()
954 BT_DBG("sock %p, sk %p", sock, sk); l2cap_sock_sendmsg()
979 static int l2cap_sock_recvmsg(struct socket *sock, struct msghdr *msg, l2cap_sock_recvmsg() argument
982 struct sock *sk = sock->sk; l2cap_sock_recvmsg()
1006 if (sock->type == SOCK_STREAM) l2cap_sock_recvmsg()
1007 err = bt_sock_stream_recvmsg(sock, msg, len, flags); l2cap_sock_recvmsg()
1009 err = bt_sock_recvmsg(sock, msg, len, flags); l2cap_sock_recvmsg()
1043 static void l2cap_sock_kill(struct sock *sk) l2cap_sock_kill()
1057 static int __l2cap_wait_ack(struct sock *sk) __l2cap_wait_ack()
1089 static int l2cap_sock_shutdown(struct socket *sock, int how) l2cap_sock_shutdown() argument
1091 struct sock *sk = sock->sk; l2cap_sock_shutdown()
1096 BT_DBG("sock %p, sk %p", sock, sk); l2cap_sock_shutdown()
1140 static int l2cap_sock_release(struct socket *sock) l2cap_sock_release() argument
1142 struct sock *sk = sock->sk; l2cap_sock_release()
1145 BT_DBG("sock %p, sk %p", sock, sk); l2cap_sock_release()
1152 err = l2cap_sock_shutdown(sock, 2); l2cap_sock_release()
1159 static void l2cap_sock_cleanup_listen(struct sock *parent) l2cap_sock_cleanup_listen()
1161 struct sock *sk; l2cap_sock_cleanup_listen()
1184 struct sock *sk, *parent = chan->data; l2cap_sock_new_connection_cb()
1215 struct sock *sk = chan->data; l2cap_sock_recv_cb()
1250 struct sock *sk = chan->data; l2cap_sock_close_cb()
1257 struct sock *sk = chan->data; l2cap_sock_teardown_cb()
1258 struct sock *parent; l2cap_sock_teardown_cb()
1308 struct sock *sk = chan->data; l2cap_sock_state_change_cb()
1320 struct sock *sk = chan->data; l2cap_sock_alloc_skb_cb()
1340 struct sock *sk = chan->data; l2cap_sock_ready_cb()
1341 struct sock *parent; l2cap_sock_ready_cb()
1360 struct sock *parent, *sk = chan->data; l2cap_sock_defer_cb()
1373 struct sock *sk = chan->data; l2cap_sock_resume_cb()
1386 struct sock *sk = chan->data; l2cap_sock_set_shutdown_cb()
1395 struct sock *sk = chan->data; l2cap_sock_get_sndtimeo_cb()
1402 struct sock *sk = chan->data; l2cap_sock_suspend_cb()
1424 static void l2cap_sock_destruct(struct sock *sk) l2cap_sock_destruct()
1453 static void l2cap_sock_init(struct sock *sk, struct sock *parent) l2cap_sock_init()
1525 static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, l2cap_sock_alloc() argument
1528 struct sock *sk; l2cap_sock_alloc()
1535 sock_init_data(sock, sk); l2cap_sock_alloc()
1559 static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, l2cap_sock_create() argument
1562 struct sock *sk; l2cap_sock_create()
1564 BT_DBG("sock %p", sock); l2cap_sock_create()
1566 sock->state = SS_UNCONNECTED; l2cap_sock_create()
1568 if (sock->type != SOCK_SEQPACKET && sock->type != SOCK_STREAM && l2cap_sock_create()
1569 sock->type != SOCK_DGRAM && sock->type != SOCK_RAW) l2cap_sock_create()
1572 if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW)) l2cap_sock_create()
1575 sock->ops = &l2cap_sock_ops; l2cap_sock_create()
1577 sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC); l2cap_sock_create()
H A Dsco.c48 struct sock *sk;
56 static void sco_sock_close(struct sock *sk);
57 static void sco_sock_kill(struct sock *sk);
77 struct sock *sk = (struct sock *) arg; sco_sock_timeout()
79 BT_DBG("sock %p state %d", sk, sk->sk_state); sco_sock_timeout()
90 static void sco_sock_set_timer(struct sock *sk, long timeout) sco_sock_set_timer()
92 BT_DBG("sock %p state %d timeout %ld", sk, sk->sk_state, timeout); sco_sock_set_timer()
96 static void sco_sock_clear_timer(struct sock *sk) sco_sock_clear_timer()
98 BT_DBG("sock %p state %d", sk, sk->sk_state); sco_sock_clear_timer()
132 static void sco_chan_del(struct sock *sk, int err) sco_chan_del()
160 struct sock *sk; sco_conn_del()
185 static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent) __sco_chan_add()
196 static int sco_chan_add(struct sco_conn *conn, struct sock *sk, sco_chan_add()
197 struct sock *parent) sco_chan_add()
211 static int sco_connect(struct sock *sk) sco_connect()
272 static int sco_send_frame(struct sock *sk, struct msghdr *msg, int len) sco_send_frame()
300 struct sock *sk; sco_recv_frame()
322 static struct sock *__sco_get_sock_listen_by_addr(bdaddr_t *ba) __sco_get_sock_listen_by_addr()
324 struct sock *sk; __sco_get_sock_listen_by_addr()
340 static struct sock *sco_get_sock_listen(bdaddr_t *src) sco_get_sock_listen()
342 struct sock *sk = NULL, *sk1 = NULL; sco_get_sock_listen()
364 static void sco_sock_destruct(struct sock *sk) sco_sock_destruct()
372 static void sco_sock_cleanup_listen(struct sock *parent) sco_sock_cleanup_listen()
374 struct sock *sk; sco_sock_cleanup_listen()
391 static void sco_sock_kill(struct sock *sk) sco_sock_kill()
404 static void __sco_sock_close(struct sock *sk) __sco_sock_close()
437 static void sco_sock_close(struct sock *sk) sco_sock_close()
446 static void sco_sock_init(struct sock *sk, struct sock *parent) sco_sock_init()
463 static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int proto, gfp_t prio) sco_sock_alloc() argument
465 struct sock *sk; sco_sock_alloc()
471 sock_init_data(sock, sk); sco_sock_alloc()
490 static int sco_sock_create(struct net *net, struct socket *sock, int protocol, sco_sock_create() argument
493 struct sock *sk; sco_sock_create()
495 BT_DBG("sock %p", sock); sco_sock_create()
497 sock->state = SS_UNCONNECTED; sco_sock_create()
499 if (sock->type != SOCK_SEQPACKET) sco_sock_create()
502 sock->ops = &sco_sock_ops; sco_sock_create()
504 sk = sco_sock_alloc(net, sock, protocol, GFP_ATOMIC); sco_sock_create()
512 static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) sco_sock_bind() argument
515 struct sock *sk = sock->sk; sco_sock_bind()
547 static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags) sco_sock_connect() argument
550 struct sock *sk = sock->sk; sco_sock_connect()
582 static int sco_sock_listen(struct socket *sock, int backlog) sco_sock_listen() argument
584 struct sock *sk = sock->sk; sco_sock_listen()
622 static int sco_sock_accept(struct socket *sock, struct socket *newsock, int flags) sco_sock_accept() argument
625 struct sock *sk = sock->sk, *ch; sco_sock_accept()
676 static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer) sco_sock_getname() argument
679 struct sock *sk = sock->sk; sco_sock_getname()
681 BT_DBG("sock %p, sk %p", sock, sk); sco_sock_getname()
694 static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, sco_sock_sendmsg() argument
697 struct sock *sk = sock->sk; sco_sock_sendmsg()
700 BT_DBG("sock %p, sk %p", sock, sk); sco_sock_sendmsg()
764 static int sco_sock_recvmsg(struct socket *sock, struct msghdr *msg, sco_sock_recvmsg() argument
767 struct sock *sk = sock->sk; sco_sock_recvmsg()
783 return bt_sock_recvmsg(sock, msg, len, flags); sco_sock_recvmsg()
786 static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) sco_sock_setsockopt() argument
788 struct sock *sk = sock->sk; sco_sock_setsockopt()
850 static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen) sco_sock_getsockopt_old() argument
852 struct sock *sk = sock->sk; sco_sock_getsockopt_old()
910 static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen) sco_sock_getsockopt() argument
912 struct sock *sk = sock->sk; sco_sock_getsockopt()
919 return sco_sock_getsockopt_old(sock, optname, optval, optlen); sco_sock_getsockopt()
958 static int sco_sock_shutdown(struct socket *sock, int how) sco_sock_shutdown() argument
960 struct sock *sk = sock->sk; sco_sock_shutdown()
963 BT_DBG("sock %p, sk %p", sock, sk); sco_sock_shutdown()
983 static int sco_sock_release(struct socket *sock) sco_sock_release() argument
985 struct sock *sk = sock->sk; sco_sock_release()
988 BT_DBG("sock %p, sk %p", sock, sk); sco_sock_release()
1009 struct sock *parent; sco_conn_ready()
1010 struct sock *sk = conn->sk; sco_conn_ready()
1064 struct sock *sk; sco_connect_ind()
1143 struct sock *sk; sco_debugfs_show()
H A Daf_bluetooth.c67 void bt_sock_reclassify_lock(struct sock *sk, int proto) bt_sock_reclassify_lock()
109 static int bt_sock_create(struct net *net, struct socket *sock, int proto, bt_sock_create() argument
128 err = bt_proto[proto]->create(net, sock, proto, kern); bt_sock_create()
130 bt_sock_reclassify_lock(sock->sk, proto); bt_sock_create()
139 void bt_sock_link(struct bt_sock_list *l, struct sock *sk) bt_sock_link()
147 void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk) bt_sock_unlink()
155 void bt_accept_enqueue(struct sock *parent, struct sock *sk) bt_accept_enqueue()
166 void bt_accept_unlink(struct sock *sk) bt_accept_unlink()
177 struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) bt_accept_dequeue()
180 struct sock *sk; bt_accept_dequeue()
185 sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); bt_accept_dequeue()
213 int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, bt_sock_recvmsg() argument
217 struct sock *sk = sock->sk; bt_sock_recvmsg()
222 BT_DBG("sock %p sk %p len %zu", sock, sk, len); bt_sock_recvmsg()
257 static long bt_sock_data_wait(struct sock *sk, long timeo) bt_sock_data_wait()
286 int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg, bt_sock_stream_recvmsg() argument
289 struct sock *sk = sock->sk; bt_sock_stream_recvmsg()
391 static inline unsigned int bt_accept_poll(struct sock *parent) bt_accept_poll()
394 struct sock *sk; bt_accept_poll()
397 sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); bt_accept_poll()
407 unsigned int bt_sock_poll(struct file *file, struct socket *sock, bt_sock_poll() argument
410 struct sock *sk = sock->sk; bt_sock_poll()
413 BT_DBG("sock %p, sk %p", sock, sk); bt_sock_poll()
450 int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) bt_sock_ioctl() argument
452 struct sock *sk = sock->sk; bt_sock_ioctl()
499 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo) bt_sock_wait_state()
535 int bt_sock_wait_ready(struct sock *sk, unsigned long flags) bt_sock_wait_ready()
621 struct sock *sk = sk_entry(v); bt_seq_show()
H A Dmgmt_util.h29 struct sock *sk;
35 void *data, u16 data_len, int flag, struct sock *skip_sk);
36 int mgmt_cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status);
37 int mgmt_cmd_complete(struct sock *sk, u16 index, u16 cmd, u8 status,
49 struct mgmt_pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
H A Dhci_sock.c56 void hci_sock_set_flag(struct sock *sk, int nr) hci_sock_set_flag()
61 void hci_sock_clear_flag(struct sock *sk, int nr) hci_sock_clear_flag()
66 int hci_sock_test_flag(struct sock *sk, int nr) hci_sock_test_flag()
71 unsigned short hci_sock_get_channel(struct sock *sk) hci_sock_get_channel()
115 static bool is_filtered_packet(struct sock *sk, struct sk_buff *skb) is_filtered_packet()
158 struct sock *sk; hci_send_to_sock()
215 int flag, struct sock *skip_sk) hci_send_to_channel()
217 struct sock *sk; hci_send_to_channel()
346 static void send_monitor_replay(struct sock *sk) send_monitor_replay()
417 struct sock *sk; hci_sock_dev_event()
487 static int hci_sock_release(struct socket *sock) hci_sock_release() argument
489 struct sock *sk = sock->sk; hci_sock_release()
492 BT_DBG("sock %p sk %p", sock, sk); hci_sock_release()
559 static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, hci_sock_bound_ioctl()
602 static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, hci_sock_ioctl() argument
606 struct sock *sk = sock->sk; hci_sock_ioctl()
675 static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, hci_sock_bind() argument
679 struct sock *sk = sock->sk; hci_sock_bind()
683 BT_DBG("sock %p sk %p", sock, sk); hci_sock_bind()
853 static int hci_sock_getname(struct socket *sock, struct sockaddr *addr, hci_sock_getname() argument
857 struct sock *sk = sock->sk; hci_sock_getname()
861 BT_DBG("sock %p sk %p", sock, sk); hci_sock_getname()
884 static void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, hci_sock_cmsg()
921 static int hci_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, hci_sock_recvmsg() argument
925 struct sock *sk = sock->sk; hci_sock_recvmsg()
929 BT_DBG("sock %p, sk %p", sock, sk); hci_sock_recvmsg()
969 static int hci_mgmt_cmd(struct hci_mgmt_chan *chan, struct sock *sk, hci_mgmt_cmd()
1080 static int hci_sock_sendmsg(struct socket *sock, struct msghdr *msg, hci_sock_sendmsg() argument
1083 struct sock *sk = sock->sk; hci_sock_sendmsg()
1089 BT_DBG("sock %p sk %p", sock, sk); hci_sock_sendmsg()
1205 static int hci_sock_setsockopt(struct socket *sock, int level, int optname, hci_sock_setsockopt() argument
1209 struct sock *sk = sock->sk; hci_sock_setsockopt()
1288 static int hci_sock_getsockopt(struct socket *sock, int level, int optname, hci_sock_getsockopt() argument
1292 struct sock *sk = sock->sk; hci_sock_getsockopt()
1380 static int hci_sock_create(struct net *net, struct socket *sock, int protocol, hci_sock_create() argument
1383 struct sock *sk; hci_sock_create()
1385 BT_DBG("sock %p", sock); hci_sock_create()
1387 if (sock->type != SOCK_RAW) hci_sock_create()
1390 sock->ops = &hci_sock_ops; hci_sock_create()
1396 sock_init_data(sock, sk); hci_sock_create()
1402 sock->state = SS_UNCONNECTED; hci_sock_create()
/linux-4.1.27/net/netlink/
H A Daf_netlink.h6 #include <net/sock.h>
26 /* struct sock has to be the first member of netlink_sock */
27 struct sock sk;
58 static inline struct netlink_sock *nlk_sk(struct sock *sk) nlk_sk()
82 bool (*compare)(struct net *net, struct sock *sock);
H A Daf_netlink.c67 #include <net/sock.h>
87 static inline int netlink_is_kernel(struct sock *sk) netlink_is_kernel()
97 static int netlink_dump(struct sock *sk);
197 struct sock *sk = skb->sk; netlink_filter_tap()
221 struct sock *sk = skb->sk; __netlink_deliver_tap_skb()
270 static void netlink_deliver_tap_kernel(struct sock *dst, struct sock *src, netlink_deliver_tap_kernel()
277 static void netlink_overrun(struct sock *sk) netlink_overrun()
290 static void netlink_rcv_wake(struct sock *sk) netlink_rcv_wake()
301 static bool netlink_rx_is_mmaped(struct sock *sk) netlink_rx_is_mmaped()
306 static bool netlink_tx_is_mmaped(struct sock *sk) netlink_tx_is_mmaped()
377 __netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, bool tx_ring, void **pg_vec, __netlink_set_ring()
407 static int netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, netlink_set_ring()
470 struct socket *sock = file->private_data; netlink_mm_open() local
471 struct sock *sk = sock->sk; netlink_mm_open()
480 struct socket *sock = file->private_data; netlink_mm_close() local
481 struct sock *sk = sock->sk; netlink_mm_close()
492 static int netlink_mmap(struct file *file, struct socket *sock, netlink_mmap() argument
495 struct sock *sk = sock->sk; netlink_mmap()
660 static unsigned int netlink_poll(struct file *file, struct socket *sock, netlink_poll() argument
663 struct sock *sk = sock->sk; netlink_poll()
684 mask = datagram_poll(file, sock, wait); netlink_poll()
709 static void netlink_ring_setup_skb(struct sk_buff *skb, struct sock *sk, netlink_ring_setup_skb()
730 static int netlink_mmap_sendmsg(struct sock *sk, struct msghdr *msg, netlink_mmap_sendmsg()
808 static void netlink_queue_mmaped_skb(struct sock *sk, struct sk_buff *skb) netlink_queue_mmaped_skb()
825 static void netlink_ring_set_copied(struct sock *sk, struct sk_buff *skb) netlink_ring_set_copied()
864 struct sock *sk; netlink_skb_destructor()
904 static void netlink_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) netlink_skb_set_owner_r()
913 static void netlink_sock_destruct(struct sock *sk) netlink_sock_destruct()
1032 static struct sock *__netlink_lookup(struct netlink_table *table, u32 portid, __netlink_lookup()
1042 static int __netlink_insert(struct netlink_table *table, struct sock *sk) __netlink_insert()
1052 static struct sock *netlink_lookup(struct net *net, int protocol, u32 portid) netlink_lookup()
1055 struct sock *sk; netlink_lookup()
1069 netlink_update_listeners(struct sock *sk) netlink_update_listeners()
1092 static int netlink_insert(struct sock *sk, u32 portid) netlink_insert()
1133 static void netlink_remove(struct sock *sk) netlink_remove()
1160 static int __netlink_create(struct net *net, struct socket *sock, __netlink_create() argument
1163 struct sock *sk; __netlink_create()
1166 sock->ops = &netlink_ops; __netlink_create()
1172 sock_init_data(sock, sk); __netlink_create()
1191 static int netlink_create(struct net *net, struct socket *sock, int protocol, netlink_create() argument
1201 sock->state = SS_UNCONNECTED; netlink_create()
1203 if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) netlink_create()
1230 err = __netlink_create(net, sock, cb_mutex, protocol); netlink_create()
1238 nlk = nlk_sk(sock->sk); netlink_create()
1257 static int netlink_release(struct socket *sock) netlink_release() argument
1259 struct sock *sk = sock->sk; netlink_release()
1288 sock->sk = NULL; netlink_release()
1333 static int netlink_autobind(struct socket *sock) netlink_autobind() argument
1335 struct sock *sk = sock->sk; netlink_autobind()
1433 static inline int netlink_allowed(const struct socket *sock, unsigned int flag) netlink_allowed() argument
1435 return (nl_table[sock->sk->sk_protocol].flags & flag) || netlink_allowed()
1436 ns_capable(sock_net(sock->sk)->user_ns, CAP_NET_ADMIN); netlink_allowed()
1440 netlink_update_subscriptions(struct sock *sk, unsigned int subscriptions) netlink_update_subscriptions()
1451 static int netlink_realloc_groups(struct sock *sk) netlink_realloc_groups()
1485 struct sock *sk) netlink_undo_bind()
1498 static int netlink_bind(struct socket *sock, struct sockaddr *addr, netlink_bind() argument
1501 struct sock *sk = sock->sk; netlink_bind()
1517 if (!netlink_allowed(sock, NL_CFG_F_NONROOT_RECV)) netlink_bind()
1553 netlink_autobind(sock); netlink_bind()
1574 static int netlink_connect(struct socket *sock, struct sockaddr *addr, netlink_connect() argument
1578 struct sock *sk = sock->sk; netlink_connect()
1595 !netlink_allowed(sock, NL_CFG_F_NONROOT_SEND)) netlink_connect()
1602 err = netlink_autobind(sock); netlink_connect()
1613 static int netlink_getname(struct socket *sock, struct sockaddr *addr, netlink_getname() argument
1616 struct sock *sk = sock->sk; netlink_getname()
1634 static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid) netlink_getsockbyportid()
1636 struct sock *sock; netlink_getsockbyportid() local
1639 sock = netlink_lookup(sock_net(ssk), ssk->sk_protocol, portid); netlink_getsockbyportid()
1640 if (!sock) netlink_getsockbyportid()
1644 nlk = nlk_sk(sock); netlink_getsockbyportid()
1645 if (sock->sk_state == NETLINK_CONNECTED && netlink_getsockbyportid()
1647 sock_put(sock); netlink_getsockbyportid()
1650 return sock; netlink_getsockbyportid()
1653 struct sock *netlink_getsockbyfilp(struct file *filp) netlink_getsockbyfilp()
1656 struct sock *sock; netlink_getsockbyfilp() local
1661 sock = SOCKET_I(inode)->sk; netlink_getsockbyfilp()
1662 if (sock->sk_family != AF_NETLINK) netlink_getsockbyfilp()
1665 sock_hold(sock); netlink_getsockbyfilp()
1666 return sock; netlink_getsockbyfilp()
1700 * < 0: error. skb freed, reference to sock dropped.
1704 int netlink_attachskb(struct sock *sk, struct sk_buff *skb, netlink_attachskb()
1705 long *timeo, struct sock *ssk) netlink_attachskb()
1745 static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb) __netlink_sendskb()
1763 int netlink_sendskb(struct sock *sk, struct sk_buff *skb) netlink_sendskb()
1771 void netlink_detachskb(struct sock *sk, struct sk_buff *skb) netlink_detachskb()
1803 static int netlink_unicast_kernel(struct sock *sk, struct sk_buff *skb, netlink_unicast_kernel()
1804 struct sock *ssk) netlink_unicast_kernel()
1824 int netlink_unicast(struct sock *ssk, struct sk_buff *skb, netlink_unicast()
1827 struct sock *sk; netlink_unicast()
1860 struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size, netlink_alloc_skb()
1864 struct sock *sk = NULL; netlink_alloc_skb()
1927 int netlink_has_listeners(struct sock *sk, unsigned int group) netlink_has_listeners()
1946 static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb) netlink_broadcast_deliver()
1960 struct sock *exclude_sk;
1970 int (*tx_filter)(struct sock *dsk, struct sk_buff *skb, void *data);
1974 static void do_one_broadcast(struct sock *sk, do_one_broadcast()
2032 int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, u32 portid, netlink_broadcast_filtered()
2034 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data), netlink_broadcast_filtered()
2039 struct sock *sk; netlink_broadcast_filtered()
2083 int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 portid, netlink_broadcast()
2092 struct sock *exclude_sk;
2098 static int do_one_set_err(struct sock *sk, struct netlink_set_err_data *p) do_one_set_err()
2134 int netlink_set_err(struct sock *ssk, u32 portid, u32 group, int code) netlink_set_err()
2137 struct sock *sk; netlink_set_err()
2173 static int netlink_setsockopt(struct socket *sock, int level, int optname, netlink_setsockopt() argument
2176 struct sock *sk = sock->sk; netlink_setsockopt()
2199 if (!netlink_allowed(sock, NL_CFG_F_NONROOT_RECV)) netlink_setsockopt()
2263 static int netlink_getsockopt(struct socket *sock, int level, int optname, netlink_getsockopt() argument
2266 struct sock *sk = sock->sk; netlink_getsockopt()
2323 static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) netlink_sendmsg() argument
2325 struct sock *sk = sock->sk; netlink_sendmsg()
2338 err = scm_send(sock, msg, &scm, true); netlink_sendmsg()
2350 !netlink_allowed(sock, NL_CFG_F_NONROOT_SEND)) netlink_sendmsg()
2359 err = netlink_autobind(sock); netlink_sendmsg()
2415 static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, netlink_recvmsg() argument
2419 struct sock *sk = sock->sk; netlink_recvmsg()
2496 scm_recv(sock, msg, &scm, flags); netlink_recvmsg()
2502 static void netlink_data_ready(struct sock *sk) netlink_data_ready()
2513 struct sock * __netlink_kernel_create()
2517 struct socket *sock; __netlink_kernel_create() local
2518 struct sock *sk; __netlink_kernel_create()
2529 if (sock_create_lite(PF_NETLINK, SOCK_DGRAM, unit, &sock)) __netlink_kernel_create()
2538 if (__netlink_create(&init_net, sock, cb_mutex, unit) < 0) __netlink_kernel_create()
2541 sk = sock->sk; __netlink_kernel_create()
2590 sock_release(sock); __netlink_kernel_create()
2596 netlink_kernel_release(struct sock *sk) netlink_kernel_release()
2602 int __netlink_change_ngroups(struct sock *sk, unsigned int groups) __netlink_change_ngroups()
2637 int netlink_change_ngroups(struct sock *sk, unsigned int groups) netlink_change_ngroups()
2648 void __netlink_clear_multicast_users(struct sock *ksk, unsigned int group) __netlink_clear_multicast_users()
2650 struct sock *sk; __netlink_clear_multicast_users()
2680 static int netlink_dump(struct sock *sk) netlink_dump()
2776 int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb, __netlink_dump_start()
2781 struct sock *sk; __netlink_dump_start()
2863 struct sock *sk; netlink_ack()
2936 int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid, nlmsg_notify()
3070 struct sock *s = v; netlink_seq_show()
/linux-4.1.27/net/tipc/
H A Dserver.c39 #include <net/sock.h>
54 * @sock: socket handler associated with connection
68 struct socket *sock; member in struct:tipc_conn
94 struct socket *sock = con->sock; tipc_conn_kref_release() local
95 struct sock *sk; tipc_conn_kref_release()
97 if (sock) { tipc_conn_kref_release()
98 sk = sock->sk; tipc_conn_kref_release()
100 __module_get(sock->ops->owner); tipc_conn_kref_release()
104 kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr)); tipc_conn_kref_release()
105 sock_release(sock); tipc_conn_kref_release()
106 con->sock = NULL; tipc_conn_kref_release()
135 static void sock_data_ready(struct sock *sk) sock_data_ready()
149 static void sock_write_space(struct sock *sk) sock_write_space()
163 static void tipc_register_callbacks(struct socket *sock, struct tipc_conn *con) tipc_register_callbacks() argument
165 struct sock *sk = sock->sk; tipc_register_callbacks()
173 con->sock = sock; tipc_register_callbacks()
180 struct sock *sk = con->sock->sk; tipc_unregister_callbacks()
208 kernel_sock_shutdown(con->sock, SHUT_RDWR); tipc_close_conn()
264 ret = kernel_recvmsg(con->sock, &msg, &iov, 1, iov.iov_len, tipc_receive_from_sock()
271 s->tipc_conn_recvmsg(sock_net(con->sock->sk), con->conid, &addr, tipc_receive_from_sock()
291 struct socket *sock = con->sock; tipc_accept_from_sock() local
296 ret = kernel_accept(sock, &newsock, O_NONBLOCK); tipc_accept_from_sock()
321 struct socket *sock = NULL; tipc_create_listen_sock() local
324 ret = __sock_create(s->net, AF_TIPC, SOCK_SEQPACKET, 0, &sock, 1); tipc_create_listen_sock()
327 ret = kernel_setsockopt(sock, SOL_TIPC, TIPC_IMPORTANCE, tipc_create_listen_sock()
331 ret = kernel_bind(sock, (struct sockaddr *)s->saddr, sizeof(*s->saddr)); tipc_create_listen_sock()
340 ret = kernel_listen(sock, 0); tipc_create_listen_sock()
368 module_put(sock->ops->owner); tipc_create_listen_sock()
369 module_put(sock->sk->sk_prot_creator->owner); tipc_create_listen_sock()
372 return sock; tipc_create_listen_sock()
375 kernel_sock_shutdown(sock, SHUT_RDWR); tipc_create_listen_sock()
376 sock_release(sock); tipc_create_listen_sock()
382 struct socket *sock; tipc_open_listening_sock() local
389 sock = tipc_create_listen_sock(con); tipc_open_listening_sock()
390 if (!sock) { tipc_open_listening_sock()
397 tipc_register_callbacks(sock, con); tipc_open_listening_sock()
507 ret = kernel_sendmsg(con->sock, &msg, &e->iov, 1, tipc_send_to_sock()
H A Dsocket.c81 struct sock sk;
104 static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb);
105 static void tipc_data_ready(struct sock *sk);
106 static void tipc_write_space(struct sock *sk);
107 static int tipc_release(struct socket *sock);
108 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags);
109 static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p);
118 static int __tipc_send_stream(struct socket *sock, struct msghdr *m,
120 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz);
230 static struct tipc_sock *tipc_sk(const struct sock *sk) tipc_sk()
245 static void tsk_advance_rx_queue(struct sock *sk) tsk_advance_rx_queue()
255 static void tsk_rej_rx_queue(struct sock *sk) tsk_rej_rx_queue()
303 * @sock: pre-allocated socket structure
312 static int tipc_sk_create(struct net *net, struct socket *sock, tipc_sk_create() argument
318 struct sock *sk; tipc_sk_create()
326 switch (sock->type) { tipc_sk_create()
358 sock->ops = ops; tipc_sk_create()
359 sock->state = state; tipc_sk_create()
360 sock_init_data(sock, sk); tipc_sk_create()
375 if (sock->state == SS_READY) { tipc_sk_create()
377 if (sock->type == SOCK_DGRAM) tipc_sk_create()
392 * @sock: socket to destroy
406 static int tipc_release(struct socket *sock) tipc_release() argument
408 struct sock *sk = sock->sk; tipc_release()
430 while (sock->state != SS_DISCONNECTING) { tipc_release()
437 if ((sock->state == SS_CONNECTING) || tipc_release()
438 (sock->state == SS_CONNECTED)) { tipc_release()
439 sock->state = SS_DISCONNECTING; tipc_release()
469 sock->state = SS_DISCONNECTING; tipc_release()
473 sock->sk = NULL; tipc_release()
480 * @sock: socket structure
493 static int tipc_bind(struct socket *sock, struct sockaddr *uaddr, tipc_bind() argument
496 struct sock *sk = sock->sk; tipc_bind()
540 * @sock: socket structure
551 static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, tipc_getname() argument
555 struct tipc_sock *tsk = tipc_sk(sock->sk); tipc_getname()
556 struct tipc_net *tn = net_generic(sock_net(sock->sk), tipc_net_id); tipc_getname()
560 if ((sock->state != SS_CONNECTED) && tipc_getname()
561 ((peer != 2) || (sock->state != SS_DISCONNECTING))) tipc_getname()
582 * @sock: socket for which to calculate the poll bits
619 static unsigned int tipc_poll(struct file *file, struct socket *sock, tipc_poll() argument
622 struct sock *sk = sock->sk; tipc_poll()
628 switch ((int)sock->state) { tipc_poll()
653 * @sock: socket structure
662 static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq, tipc_sendmcast() argument
665 struct sock *sk = sock->sk; tipc_sendmcast()
702 rc = tipc_wait_for_sndmsg(sock, &timeo); tipc_sendmcast()
799 static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p) tipc_wait_for_sndmsg() argument
801 struct sock *sk = sock->sk; tipc_wait_for_sndmsg()
810 if (sock->state == SS_DISCONNECTING) tipc_wait_for_sndmsg()
826 * @sock: socket structure
837 static int tipc_sendmsg(struct socket *sock, tipc_sendmsg() argument
840 struct sock *sk = sock->sk; tipc_sendmsg()
844 ret = __tipc_sendmsg(sock, m, dsz); tipc_sendmsg()
850 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz) __tipc_sendmsg() argument
853 struct sock *sk = sock->sk; __tipc_sendmsg()
869 if (tsk->connected && sock->state == SS_READY) __tipc_sendmsg()
877 if (unlikely(sock->state != SS_READY)) { __tipc_sendmsg()
878 if (sock->state == SS_LISTENING) __tipc_sendmsg()
880 if (sock->state != SS_UNCONNECTED) __tipc_sendmsg()
893 return tipc_sendmcast(sock, seq, m, dsz, timeo); __tipc_sendmsg()
931 if (sock->state != SS_READY) __tipc_sendmsg()
932 sock->state = SS_CONNECTING; __tipc_sendmsg()
943 rc = tipc_wait_for_sndmsg(sock, &timeo); __tipc_sendmsg()
951 static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p) tipc_wait_for_sndpkt() argument
953 struct sock *sk = sock->sk; tipc_wait_for_sndpkt()
962 if (sock->state == SS_DISCONNECTING) tipc_wait_for_sndpkt()
964 else if (sock->state != SS_CONNECTED) tipc_wait_for_sndpkt()
983 * @sock: socket structure
992 static int tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz) tipc_send_stream() argument
994 struct sock *sk = sock->sk; tipc_send_stream()
998 ret = __tipc_send_stream(sock, m, dsz); tipc_send_stream()
1004 static int __tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz) __tipc_send_stream() argument
1006 struct sock *sk = sock->sk; __tipc_send_stream()
1021 rc = __tipc_sendmsg(sock, m, dsz); __tipc_send_stream()
1029 if (unlikely(sock->state != SS_CONNECTED)) { __tipc_send_stream()
1030 if (sock->state == SS_DISCONNECTING) __tipc_send_stream()
1066 rc = tipc_wait_for_sndpkt(sock, &timeo); __tipc_send_stream()
1076 * @sock: socket structure
1084 static int tipc_send_packet(struct socket *sock, struct msghdr *m, size_t dsz) tipc_send_packet() argument
1089 return tipc_send_stream(sock, m, dsz); tipc_send_packet()
1097 struct sock *sk = &tsk->sk; tipc_sk_finish_conn()
1229 static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop) tipc_wait_for_rcvmsg() argument
1231 struct sock *sk = sock->sk; tipc_wait_for_rcvmsg()
1239 if (sock->state == SS_DISCONNECTING) { tipc_wait_for_rcvmsg()
1273 static int tipc_recvmsg(struct socket *sock, struct msghdr *m, size_t buf_len, tipc_recvmsg() argument
1276 struct sock *sk = sock->sk; tipc_recvmsg()
1291 if (unlikely(sock->state == SS_UNCONNECTED)) { tipc_recvmsg()
1300 res = tipc_wait_for_rcvmsg(sock, &timeo); tipc_recvmsg()
1335 if ((sock->state == SS_READY) || tipc_recvmsg()
1344 if ((sock->state != SS_READY) && tipc_recvmsg()
1367 static int tipc_recv_stream(struct socket *sock, struct msghdr *m, tipc_recv_stream() argument
1370 struct sock *sk = sock->sk; tipc_recv_stream()
1387 if (unlikely(sock->state == SS_UNCONNECTED)) { tipc_recv_stream()
1397 res = tipc_wait_for_rcvmsg(sock, &timeo); tipc_recv_stream()
1478 static void tipc_write_space(struct sock *sk) tipc_write_space()
1495 static void tipc_data_ready(struct sock *sk) tipc_data_ready()
1516 struct sock *sk = &tsk->sk; filter_connect()
1518 struct socket *sock = sk->sk_socket; filter_connect() local
1525 switch ((int)sock->state) { filter_connect()
1530 sock->state = SS_DISCONNECTING; filter_connect()
1546 sock->state = SS_DISCONNECTING; filter_connect()
1553 sock->state = SS_DISCONNECTING; filter_connect()
1561 sock->state = SS_CONNECTED; filter_connect()
1585 pr_err("Unknown socket state %u\n", sock->state); filter_connect()
1608 static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *buf) rcvbuf_limit()
1631 static int filter_rcv(struct sock *sk, struct sk_buff **skb) filter_rcv()
1633 struct socket *sock = sk->sk_socket; filter_rcv() local
1656 if (sock->state == SS_READY) { filter_rcv()
1688 static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb) tipc_backlog_rcv()
1722 static int tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk, tipc_sk_enqueue()
1771 struct sock *sk; tipc_sk_rcv()
1806 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p) tipc_wait_for_connect() argument
1808 struct sock *sk = sock->sk; tipc_wait_for_connect()
1822 done = sk_wait_event(sk, timeo_p, sock->state != SS_CONNECTING); tipc_wait_for_connect()
1830 * @sock: socket structure
1837 static int tipc_connect(struct socket *sock, struct sockaddr *dest, tipc_connect() argument
1840 struct sock *sk = sock->sk; tipc_connect()
1851 if (sock->state == SS_READY) { tipc_connect()
1875 previous = sock->state; tipc_connect()
1876 switch (sock->state) { tipc_connect()
1888 res = __tipc_sendmsg(sock, &m, 0); tipc_connect()
1904 res = tipc_wait_for_connect(sock, &timeout); tipc_connect()
1920 * @sock: socket structure
1925 static int tipc_listen(struct socket *sock, int len) tipc_listen() argument
1927 struct sock *sk = sock->sk; tipc_listen()
1932 if (sock->state != SS_UNCONNECTED) tipc_listen()
1935 sock->state = SS_LISTENING; tipc_listen()
1943 static int tipc_wait_for_accept(struct socket *sock, long timeo) tipc_wait_for_accept() argument
1945 struct sock *sk = sock->sk; tipc_wait_for_accept()
1966 if (sock->state != SS_LISTENING) tipc_wait_for_accept()
1981 * @sock: listening socket
1987 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags) tipc_accept() argument
1989 struct sock *new_sk, *sk = sock->sk; tipc_accept()
1998 if (sock->state != SS_LISTENING) { tipc_accept()
2003 res = tipc_wait_for_accept(sock, timeo); tipc_accept()
2009 res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, 1); tipc_accept()
2012 security_sk_clone(sock->sk, new_sock->sk); tipc_accept()
2059 * @sock: socket structure
2066 static int tipc_shutdown(struct socket *sock, int how) tipc_shutdown() argument
2068 struct sock *sk = sock->sk; tipc_shutdown()
2080 switch (sock->state) { tipc_shutdown()
2107 sock->state = SS_DISCONNECTING; tipc_shutdown()
2132 struct sock *sk = &tsk->sk; tipc_sk_timeout()
2269 struct sock *sk = &tsk->sk; tipc_sk_insert()
2292 struct sock *sk = &tsk->sk; tipc_sk_remove()
2330 * @sock: socket structure
2341 static int tipc_setsockopt(struct socket *sock, int lvl, int opt, tipc_setsockopt() argument
2344 struct sock *sk = sock->sk; tipc_setsockopt()
2349 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM)) tipc_setsockopt()
2366 if (sock->type != SOCK_STREAM) tipc_setsockopt()
2389 * @sock: socket structure
2400 static int tipc_getsockopt(struct socket *sock, int lvl, int opt, tipc_getsockopt() argument
2403 struct sock *sk = sock->sk; tipc_getsockopt()
2409 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM)) tipc_getsockopt()
2457 static int tipc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) tipc_ioctl() argument
2459 struct sock *sk = sock->sk; tipc_ioctl()
2801 struct nlattr *sock[TIPC_NLA_SOCK_MAX + 1]; tipc_nl_publ_dump() local
2807 err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX, tipc_nl_publ_dump()
2813 if (!sock[TIPC_NLA_SOCK_REF]) tipc_nl_publ_dump()
2816 tsk_portid = nla_get_u32(sock[TIPC_NLA_SOCK_REF]); tipc_nl_publ_dump()
/linux-4.1.27/net/unix/
H A Daf_unix.c107 #include <net/sock.h>
174 static inline int unix_our_peer(struct sock *sk, struct sock *osk) unix_our_peer()
179 static inline int unix_may_send(struct sock *sk, struct sock *osk) unix_may_send()
184 static inline int unix_recvq_full(struct sock const *sk) unix_recvq_full()
189 struct sock *unix_peer_get(struct sock *s) unix_peer_get()
191 struct sock *peer; unix_peer_get()
238 static void __unix_remove_socket(struct sock *sk) __unix_remove_socket()
243 static void __unix_insert_socket(struct hlist_head *list, struct sock *sk) __unix_insert_socket()
249 static inline void unix_remove_socket(struct sock *sk) unix_remove_socket()
256 static inline void unix_insert_socket(struct hlist_head *list, struct sock *sk) unix_insert_socket()
263 static struct sock *__unix_find_socket_byname(struct net *net, __unix_find_socket_byname()
267 struct sock *s; __unix_find_socket_byname()
284 static inline struct sock *unix_find_socket_byname(struct net *net, unix_find_socket_byname()
289 struct sock *s; unix_find_socket_byname()
299 static struct sock *unix_find_socket_byinode(struct inode *i) unix_find_socket_byinode()
301 struct sock *s; unix_find_socket_byinode()
364 static int unix_dgram_peer_wake_connect(struct sock *sk, struct sock *other) unix_dgram_peer_wake_connect()
385 static void unix_dgram_peer_wake_disconnect(struct sock *sk, unix_dgram_peer_wake_disconnect()
386 struct sock *other) unix_dgram_peer_wake_disconnect()
402 static void unix_dgram_peer_wake_disconnect_wakeup(struct sock *sk, unix_dgram_peer_wake_disconnect_wakeup()
403 struct sock *other) unix_dgram_peer_wake_disconnect_wakeup()
416 static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other) unix_dgram_peer_wake_me()
431 static inline int unix_writable(struct sock *sk) unix_writable()
436 static void unix_write_space(struct sock *sk) unix_write_space()
455 static void unix_dgram_disconnected(struct sock *sk, struct sock *other) unix_dgram_disconnected()
472 static void unix_sock_destructor(struct sock *sk) unix_sock_destructor()
499 static void unix_release_sock(struct sock *sk, int embrion) unix_release_sock()
503 struct sock *skpair; unix_release_sock()
563 * Can't we simply set sock->err? unix_release_sock()
572 static void init_peercred(struct sock *sk) init_peercred()
581 static void copy_peercred(struct sock *sk, struct sock *peersk) copy_peercred()
590 static int unix_listen(struct socket *sock, int backlog) unix_listen() argument
593 struct sock *sk = sock->sk; unix_listen()
598 if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET) unix_listen()
643 static int unix_set_peek_off(struct sock *sk, int val) unix_set_peek_off()
737 static struct sock *unix_create1(struct net *net, struct socket *sock) unix_create1() argument
739 struct sock *sk = NULL; unix_create1()
750 sock_init_data(sock, sk); unix_create1()
778 static int unix_create(struct net *net, struct socket *sock, int protocol, unix_create() argument
784 sock->state = SS_UNCONNECTED; unix_create()
786 switch (sock->type) { unix_create()
788 sock->ops = &unix_stream_ops; unix_create()
795 sock->type = SOCK_DGRAM; unix_create()
797 sock->ops = &unix_dgram_ops; unix_create()
800 sock->ops = &unix_seqpacket_ops; unix_create()
806 return unix_create1(net, sock) ? 0 : -ENOMEM; unix_create()
809 static int unix_release(struct socket *sock) unix_release() argument
811 struct sock *sk = sock->sk; unix_release()
817 sock->sk = NULL; unix_release()
822 static int unix_autobind(struct socket *sock) unix_autobind() argument
824 struct sock *sk = sock->sk; unix_autobind()
855 if (__unix_find_socket_byname(net, addr->name, addr->len, sock->type, unix_autobind()
883 static struct sock *unix_find_other(struct net *net, unix_find_other()
887 struct sock *u; unix_find_other()
967 static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) unix_bind() argument
969 struct sock *sk = sock->sk; unix_bind()
984 err = unix_autobind(sock); unix_bind()
1014 (SOCK_INODE(sock)->i_mode & ~current_umask()); unix_bind()
1052 static void unix_state_double_lock(struct sock *sk1, struct sock *sk2) unix_state_double_lock()
1067 static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) unix_state_double_unlock()
1077 static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, unix_dgram_connect() argument
1080 struct sock *sk = sock->sk; unix_dgram_connect()
1083 struct sock *other; unix_dgram_connect()
1093 if (test_bit(SOCK_PASSCRED, &sock->flags) && unix_dgram_connect()
1094 !unix_sk(sk)->addr && (err = unix_autobind(sock)) != 0) unix_dgram_connect()
1098 other = unix_find_other(net, sunaddr, alen, sock->type, hash, &err); unix_dgram_connect()
1131 struct sock *old_peer = unix_peer(sk); unix_dgram_connect()
1153 static long unix_wait_for_peer(struct sock *other, long timeo) unix_wait_for_peer()
1174 static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr, unix_stream_connect() argument
1178 struct sock *sk = sock->sk; unix_stream_connect()
1181 struct sock *newsk = NULL; unix_stream_connect()
1182 struct sock *other = NULL; unix_stream_connect()
1194 if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr && unix_stream_connect()
1195 (err = unix_autobind(sock)) != 0) unix_stream_connect()
1207 /* create new sock for complete connection */ unix_stream_connect()
1212 /* Allocate skb for sending to listening sock */ unix_stream_connect()
1218 /* Find listening sock. */ unix_stream_connect()
1305 /* copy address information from listening to new sock*/ unix_stream_connect()
1318 sock->state = SS_CONNECTED; unix_stream_connect()
1327 /* take ten and and send info to listening sock */ unix_stream_connect()
1351 struct sock *ska = socka->sk, *skb = sockb->sk; unix_socketpair()
1379 static int unix_accept(struct socket *sock, struct socket *newsock, int flags) unix_accept() argument
1381 struct sock *sk = sock->sk; unix_accept()
1382 struct sock *tsk; unix_accept()
1387 if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET) unix_accept()
1410 /* attach accepted sock to socket */ unix_accept()
1413 unix_sock_inherit_flags(sock, newsock); unix_accept()
1423 static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) unix_getname() argument
1425 struct sock *sk = sock->sk; unix_getname()
1511 struct sock *sk = unix_get_socket(scm->fp->fp[i]); unix_attach_fds()
1556 static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock, maybe_add_creds() argument
1557 const struct sock *other) maybe_add_creds()
1561 if (test_bit(SOCK_PASSCRED, &sock->flags) || maybe_add_creds()
1573 static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg, unix_dgram_sendmsg() argument
1576 struct sock *sk = sock->sk; unix_dgram_sendmsg()
1580 struct sock *other = NULL; unix_dgram_sendmsg()
1592 err = scm_send(sock, msg, &scm, false); unix_dgram_sendmsg()
1613 if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr unix_dgram_sendmsg()
1614 && (err = unix_autobind(sock)) != 0) unix_dgram_sendmsg()
1756 maybe_add_creds(skb, sock, other); unix_dgram_sendmsg()
1784 static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, unix_stream_sendmsg() argument
1787 struct sock *sk = sock->sk; unix_stream_sendmsg()
1788 struct sock *other = NULL; unix_stream_sendmsg()
1798 err = scm_send(sock, msg, &scm, false); unix_stream_sendmsg()
1862 maybe_add_creds(skb, sock, other); unix_stream_sendmsg()
1887 static int unix_seqpacket_sendmsg(struct socket *sock, struct msghdr *msg, unix_seqpacket_sendmsg() argument
1891 struct sock *sk = sock->sk; unix_seqpacket_sendmsg()
1903 return unix_dgram_sendmsg(sock, msg, len); unix_seqpacket_sendmsg()
1906 static int unix_seqpacket_recvmsg(struct socket *sock, struct msghdr *msg, unix_seqpacket_recvmsg() argument
1909 struct sock *sk = sock->sk; unix_seqpacket_recvmsg()
1914 return unix_dgram_recvmsg(sock, msg, size, flags); unix_seqpacket_recvmsg()
1917 static void unix_copy_addr(struct msghdr *msg, struct sock *sk) unix_copy_addr()
1927 static int unix_dgram_recvmsg(struct socket *sock, struct msghdr *msg, unix_dgram_recvmsg() argument
1931 struct sock *sk = sock->sk; unix_dgram_recvmsg()
2013 scm_recv(sock, msg, &scm, flags); unix_dgram_recvmsg()
2026 static long unix_stream_data_wait(struct sock *sk, long timeo, unix_stream_data_wait()
2064 static int unix_stream_recvmsg(struct socket *sock, struct msghdr *msg, unix_stream_recvmsg() argument
2068 struct sock *sk = sock->sk; unix_stream_recvmsg()
2166 } else if (test_bit(SOCK_PASSCRED, &sock->flags)) { unix_stream_recvmsg()
2228 scm_recv(sock, msg, &scm, flags); unix_stream_recvmsg()
2233 static int unix_shutdown(struct socket *sock, int mode) unix_shutdown() argument
2235 struct sock *sk = sock->sk; unix_shutdown()
2236 struct sock *other; unix_shutdown()
2279 long unix_inq_len(struct sock *sk) unix_inq_len()
2303 long unix_outq_len(struct sock *sk) unix_outq_len()
2309 static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) unix_ioctl() argument
2311 struct sock *sk = sock->sk; unix_ioctl()
2334 static unsigned int unix_poll(struct file *file, struct socket *sock, poll_table *wait) unix_poll() argument
2336 struct sock *sk = sock->sk; unix_poll()
2369 static unsigned int unix_dgram_poll(struct file *file, struct socket *sock, unix_dgram_poll() argument
2372 struct sock *sk = sock->sk, *other; unix_dgram_poll()
2434 static struct sock *unix_from_bucket(struct seq_file *seq, loff_t *pos) unix_from_bucket()
2438 struct sock *sk; unix_from_bucket()
2451 static struct sock *unix_next_socket(struct seq_file *seq, unix_next_socket()
2452 struct sock *sk, unix_next_socket()
2457 while (sk > (struct sock *)SEQ_START_TOKEN) { unix_next_socket()
2511 struct sock *s = v; unix_seq_show()
H A Ddiag.c11 static int sk_diag_dump_name(struct sock *sk, struct sk_buff *nlskb) sk_diag_dump_name()
22 static int sk_diag_dump_vfs(struct sock *sk, struct sk_buff *nlskb) sk_diag_dump_vfs()
38 static int sk_diag_dump_peer(struct sock *sk, struct sk_buff *nlskb) sk_diag_dump_peer()
40 struct sock *peer; sk_diag_dump_peer()
56 static int sk_diag_dump_icons(struct sock *sk, struct sk_buff *nlskb) sk_diag_dump_icons()
74 struct sock *req, *peer; sk_diag_dump_icons()
97 static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb) sk_diag_show_rqlen()
112 static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req, sk_diag_fill()
166 static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req, sk_diag_dump()
196 struct sock *sk; unix_diag_dump()
223 static struct sock *unix_lookup_by_ino(unsigned int ino) unix_lookup_by_ino()
226 struct sock *sk; unix_lookup_by_ino()
248 struct sock *sk; unix_diag_get_exact()
/linux-4.1.27/drivers/staging/lustre/lustre/libcfs/linux/
H A Dlinux-tcpip.c50 struct socket *sock; libcfs_sock_ioctl() local
54 rc = sock_create (PF_INET, SOCK_STREAM, 0, &sock); libcfs_sock_ioctl()
60 sock_filp = sock_alloc_file(sock, 0, NULL); libcfs_sock_ioctl()
62 sock_release(sock); libcfs_sock_ioctl()
253 libcfs_sock_write (struct socket *sock, void *buffer, int nob, int timeout) libcfs_sock_write() argument
279 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, libcfs_sock_write()
289 rc = kernel_sendmsg(sock, &msg, &iov, 1, nob); libcfs_sock_write()
315 libcfs_sock_read (struct socket *sock, void *buffer, int nob, int timeout) libcfs_sock_read() argument
339 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, libcfs_sock_read()
348 rc = kernel_recvmsg(sock, &msg, &iov, 1, nob, 0); libcfs_sock_read()
375 struct socket *sock; libcfs_sock_create() local
382 rc = sock_create (PF_INET, SOCK_STREAM, 0, &sock); libcfs_sock_create()
383 *sockp = sock; libcfs_sock_create()
390 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, libcfs_sock_create()
404 rc = sock->ops->bind(sock, (struct sockaddr *)&locaddr, libcfs_sock_create()
421 sock_release(sock); libcfs_sock_create()
426 libcfs_sock_setbuf (struct socket *sock, int txbufsize, int rxbufsize) libcfs_sock_setbuf() argument
433 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_SNDBUF, libcfs_sock_setbuf()
444 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUF, libcfs_sock_setbuf()
459 libcfs_sock_getaddr (struct socket *sock, int remote, __u32 *ip, int *port) libcfs_sock_getaddr() argument
465 rc = sock->ops->getname (sock, (struct sockaddr *)&sin, &len, libcfs_sock_getaddr()
468 CERROR ("Error %d getting sock %s IP/port\n", libcfs_sock_getaddr()
485 libcfs_sock_getbuf (struct socket *sock, int *txbufsize, int *rxbufsize) libcfs_sock_getbuf() argument
489 *txbufsize = sock->sk->sk_sndbuf; libcfs_sock_getbuf()
493 *rxbufsize = sock->sk->sk_rcvbuf; libcfs_sock_getbuf()
528 libcfs_sock_accept (struct socket **newsockp, struct socket *sock) libcfs_sock_accept() argument
536 /* XXX this should add a ref to sock->ops->owner, if libcfs_sock_accept()
538 rc = sock_create_lite(PF_PACKET, sock->type, IPPROTO_TCP, &newsock); libcfs_sock_accept()
544 newsock->ops = sock->ops; libcfs_sock_accept()
546 rc = sock->ops->accept(sock, newsock, O_NONBLOCK); libcfs_sock_accept()
550 add_wait_queue(sk_sleep(sock->sk), &wait); libcfs_sock_accept()
552 remove_wait_queue(sk_sleep(sock->sk), &wait); libcfs_sock_accept()
554 rc = sock->ops->accept(sock, newsock, O_NONBLOCK); libcfs_sock_accept()
571 libcfs_sock_abort_accept (struct socket *sock) libcfs_sock_abort_accept() argument
573 wake_up_all(sk_sleep(sock->sk)); libcfs_sock_abort_accept()
618 libcfs_sock_release (struct socket *sock) libcfs_sock_release() argument
620 sock_release(sock); libcfs_sock_release()
/linux-4.1.27/include/net/iucv/
H A Daf_iucv.h108 struct sock sk;
115 struct sock *parent;
155 unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
157 void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
158 void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
159 void iucv_accept_enqueue(struct sock *parent, struct sock *sk);
160 void iucv_accept_unlink(struct sock *sk);
161 struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock);
/linux-4.1.27/security/selinux/include/
H A Dnetlabel.h34 #include <net/sock.h>
57 void selinux_netlbl_inet_csk_clone(struct sock *sk, u16 family);
58 int selinux_netlbl_socket_post_create(struct sock *sk, u16 family);
63 int selinux_netlbl_socket_setsockopt(struct socket *sock,
66 int selinux_netlbl_socket_connect(struct sock *sk, struct sockaddr *addr);
109 static inline int selinux_netlbl_conn_setsid(struct sock *sk, selinux_netlbl_conn_setsid()
120 static inline void selinux_netlbl_inet_csk_clone(struct sock *sk, u16 family) selinux_netlbl_inet_csk_clone()
124 static inline int selinux_netlbl_socket_post_create(struct sock *sk, selinux_netlbl_socket_post_create()
136 static inline int selinux_netlbl_socket_setsockopt(struct socket *sock, selinux_netlbl_socket_setsockopt() argument
142 static inline int selinux_netlbl_socket_connect(struct sock *sk, selinux_netlbl_socket_connect()
/linux-4.1.27/drivers/isdn/mISDN/
H A Dsocket.c55 mISDN_sock_link(struct mISDN_sock_list *l, struct sock *sk) mISDN_sock_link()
62 static void mISDN_sock_unlink(struct mISDN_sock_list *l, struct sock *sk) mISDN_sock_unlink()
104 mISDN_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) mISDN_sock_cmsg()
115 mISDN_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, mISDN_sock_recvmsg() argument
119 struct sock *sk = sock->sk; mISDN_sock_recvmsg()
176 mISDN_sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) mISDN_sock_sendmsg() argument
178 struct sock *sk = sock->sk; mISDN_sock_sendmsg()
246 data_sock_release(struct socket *sock) data_sock_release() argument
248 struct sock *sk = sock->sk; data_sock_release()
251 printk(KERN_DEBUG "%s(%p) sk=%p\n", __func__, sock, sk); data_sock_release()
289 data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) data_sock_ioctl_bound()
360 data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) data_sock_ioctl() argument
363 struct sock *sk = sock->sk; data_sock_ioctl()
413 static int data_sock_setsockopt(struct socket *sock, int level, int optname, data_sock_setsockopt() argument
416 struct sock *sk = sock->sk; data_sock_setsockopt()
420 printk(KERN_DEBUG "%s(%p, %d, %x, %p, %d)\n", __func__, sock, data_sock_setsockopt()
445 static int data_sock_getsockopt(struct socket *sock, int level, int optname, data_sock_getsockopt() argument
448 struct sock *sk = sock->sk; data_sock_getsockopt()
475 data_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) data_sock_bind() argument
478 struct sock *sk = sock->sk; data_sock_bind()
479 struct sock *csk; data_sock_bind()
483 printk(KERN_DEBUG "%s(%p) sk=%p\n", __func__, sock, sk); data_sock_bind()
562 data_sock_getname(struct socket *sock, struct sockaddr *addr, data_sock_getname() argument
566 struct sock *sk = sock->sk; data_sock_getname()
604 data_sock_create(struct net *net, struct socket *sock, int protocol) data_sock_create() argument
606 struct sock *sk; data_sock_create()
608 if (sock->type != SOCK_DGRAM) data_sock_create()
615 sock_init_data(sock, sk); data_sock_create()
617 sock->ops = &data_sock_ops; data_sock_create()
618 sock->state = SS_UNCONNECTED; data_sock_create()
629 base_sock_release(struct socket *sock) base_sock_release() argument
631 struct sock *sk = sock->sk; base_sock_release()
633 printk(KERN_DEBUG "%s(%p) sk=%p\n", __func__, sock, sk); base_sock_release()
645 base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) base_sock_ioctl() argument
709 base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) base_sock_bind() argument
712 struct sock *sk = sock->sk; base_sock_bind()
759 base_sock_create(struct net *net, struct socket *sock, int protocol) base_sock_create() argument
761 struct sock *sk; base_sock_create()
763 if (sock->type != SOCK_RAW) base_sock_create()
770 sock_init_data(sock, sk); base_sock_create()
771 sock->ops = &base_sock_ops; base_sock_create()
772 sock->state = SS_UNCONNECTED; base_sock_create()
782 mISDN_sock_create(struct net *net, struct socket *sock, int proto, int kern) mISDN_sock_create() argument
788 err = base_sock_create(net, sock, proto); mISDN_sock_create()
802 err = data_sock_create(net, sock, proto); mISDN_sock_create()
/linux-4.1.27/net/ieee802154/
H A Dsocket.c30 #include <net/sock.h>
90 static int ieee802154_sock_release(struct socket *sock) ieee802154_sock_release() argument
92 struct sock *sk = sock->sk; ieee802154_sock_release()
95 sock->sk = NULL; ieee802154_sock_release()
101 static int ieee802154_sock_sendmsg(struct socket *sock, struct msghdr *msg, ieee802154_sock_sendmsg() argument
104 struct sock *sk = sock->sk; ieee802154_sock_sendmsg()
109 static int ieee802154_sock_bind(struct socket *sock, struct sockaddr *uaddr, ieee802154_sock_bind() argument
112 struct sock *sk = sock->sk; ieee802154_sock_bind()
117 return sock_no_bind(sock, uaddr, addr_len); ieee802154_sock_bind()
120 static int ieee802154_sock_connect(struct socket *sock, struct sockaddr *uaddr, ieee802154_sock_connect() argument
123 struct sock *sk = sock->sk; ieee802154_sock_connect()
134 static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg, ieee802154_dev_ioctl()
162 static int ieee802154_sock_ioctl(struct socket *sock, unsigned int cmd, ieee802154_sock_ioctl() argument
165 struct sock *sk = sock->sk; ieee802154_sock_ioctl()
187 static void raw_hash(struct sock *sk) raw_hash()
195 static void raw_unhash(struct sock *sk) raw_unhash()
203 static void raw_close(struct sock *sk, long timeout) raw_close()
208 static int raw_bind(struct sock *sk, struct sockaddr *_uaddr, int len) raw_bind()
247 static int raw_connect(struct sock *sk, struct sockaddr *uaddr, raw_connect()
253 static int raw_disconnect(struct sock *sk, int flags) raw_disconnect()
258 static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) raw_sendmsg()
329 static int raw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, raw_recvmsg()
362 static int raw_rcv_skb(struct sock *sk, struct sk_buff *skb) raw_rcv_skb()
378 struct sock *sk; ieee802154_raw_deliver()
396 static int raw_getsockopt(struct sock *sk, int level, int optname, raw_getsockopt()
402 static int raw_setsockopt(struct sock *sk, int level, int optname, raw_setsockopt()
411 .obj_size = sizeof(struct sock),
454 struct sock sk;
468 static inline struct dgram_sock *dgram_sk(const struct sock *sk) dgram_sk()
473 static void dgram_hash(struct sock *sk) dgram_hash()
481 static void dgram_unhash(struct sock *sk) dgram_unhash()
489 static int dgram_init(struct sock *sk) dgram_init()
497 static void dgram_close(struct sock *sk, long timeout) dgram_close()
502 static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len) dgram_bind()
544 static int dgram_ioctl(struct sock *sk, int cmd, unsigned long arg) dgram_ioctl()
578 static int dgram_connect(struct sock *sk, struct sockaddr *uaddr, dgram_connect()
606 static int dgram_disconnect(struct sock *sk, int flags) dgram_disconnect()
617 static int dgram_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) dgram_sendmsg()
716 static int dgram_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, dgram_recvmsg()
763 static int dgram_rcv_skb(struct sock *sk, struct sk_buff *skb) dgram_rcv_skb()
798 struct sock *sk, *prev = NULL; ieee802154_dgram_deliver()
837 static int dgram_getsockopt(struct sock *sk, int level, int optname, dgram_getsockopt()
881 static int dgram_setsockopt(struct sock *sk, int level, int optname, dgram_setsockopt()
997 static int ieee802154_create(struct net *net, struct socket *sock, ieee802154_create() argument
1000 struct sock *sk; ieee802154_create()
1008 switch (sock->type) { ieee802154_create()
1028 sock->ops = ops; ieee802154_create()
1030 sock_init_data(sock, sk); ieee802154_create()
/linux-4.1.27/net/core/
H A Dstream.c20 #include <net/sock.h>
28 void sk_stream_write_space(struct sock *sk) sk_stream_write_space()
30 struct socket *sock = sk->sk_socket; sk_stream_write_space() local
33 if (sk_stream_is_writeable(sk) && sock) { sk_stream_write_space()
34 clear_bit(SOCK_NOSPACE, &sock->flags); sk_stream_write_space()
42 sock_wake_async(sock, SOCK_WAKE_SPACE, POLL_OUT); sk_stream_write_space()
50 * @sk: sock to wait on
55 int sk_stream_wait_connect(struct sock *sk, long *timeo_p) sk_stream_wait_connect()
89 static inline int sk_stream_closing(struct sock *sk) sk_stream_closing()
95 void sk_stream_wait_close(struct sock *sk, long timeout) sk_stream_wait_close()
117 int sk_stream_wait_memory(struct sock *sk, long *timeo_p) sk_stream_wait_memory()
176 int sk_stream_error(struct sock *sk, int flags, int err) sk_stream_error()
186 void sk_stream_kill_queues(struct sock *sk) sk_stream_kill_queues()
H A Dsock.c19 * Alan Cox : sock->protocol is set correctly.
37 * Alan Cox : Fixed TCP ack bug, removed remove sock
128 #include <net/sock.h>
137 #include <trace/events/sock.h>
158 bool sk_ns_capable(const struct sock *sk, sk_ns_capable()
175 bool sk_capable(const struct sock *sk, int cap) sk_capable()
190 bool sk_net_capable(const struct sock *sk, int cap) sk_net_capable()
341 void sk_set_memalloc(struct sock *sk) sk_set_memalloc()
349 void sk_clear_memalloc(struct sock *sk) sk_clear_memalloc()
366 int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) __sk_backlog_rcv()
424 static void sock_disable_timestamp(struct sock *sk, unsigned long flags) sock_disable_timestamp()
434 int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) sock_queue_rcv_skb()
474 int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) sk_receive_skb()
516 struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) __sk_dst_check()
531 struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie) sk_dst_check()
545 static int sock_setbindtodevice(struct sock *sk, char __user *optval, sock_setbindtodevice()
603 static int sock_getbindtodevice(struct sock *sk, char __user *optval, sock_getbindtodevice()
643 static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool) sock_valbool_flag()
651 bool sk_mc_loop(struct sock *sk) sk_mc_loop()
675 int sock_setsockopt(struct socket *sock, int level, int optname, sock_setsockopt() argument
678 struct sock *sk = sock->sk; sock_setsockopt()
834 set_bit(SOCK_PASSCRED, &sock->flags); sock_setsockopt()
836 clear_bit(SOCK_PASSCRED, &sock->flags); sock_setsockopt()
935 set_bit(SOCK_PASSSEC, &sock->flags); sock_setsockopt()
937 clear_bit(SOCK_PASSSEC, &sock->flags); sock_setsockopt()
955 if (sock->ops->set_peek_off) sock_setsockopt()
956 ret = sock->ops->set_peek_off(sk, val); sock_setsockopt()
1012 int sock_getsockopt(struct socket *sock, int level, int optname, sock_getsockopt() argument
1015 struct sock *sk = sock->sk; sock_getsockopt()
1150 v.val = !!test_bit(SOCK_PASSCRED, &sock->flags); sock_getsockopt()
1168 if (sock->ops->getname(sock, (struct sockaddr *)address, &lv, 2)) sock_getsockopt()
1185 v.val = !!test_bit(SOCK_PASSSEC, &sock->flags); sock_getsockopt()
1189 return security_socket_getpeersec_stream(sock, optval, optlen, len); sock_getsockopt()
1204 if (!sock->ops->set_peek_off) sock_getsockopt()
1271 static inline void sock_lock_init(struct sock *sk) sock_lock_init()
1285 static void sock_copy(struct sock *nsk, const struct sock *osk) sock_copy()
1290 memcpy(nsk, osk, offsetof(struct sock, sk_dontcopy_begin)); sock_copy()
1293 osk->sk_prot->obj_size - offsetof(struct sock, sk_dontcopy_end)); sock_copy()
1301 void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) sk_prot_clear_portaddr_nulls()
1305 nulls1 = offsetof(struct sock, __sk_common.skc_node.next); sk_prot_clear_portaddr_nulls()
1306 nulls2 = offsetof(struct sock, __sk_common.skc_portaddr_node.next); sk_prot_clear_portaddr_nulls()
1319 static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, sk_prot_alloc()
1322 struct sock *sk; sk_prot_alloc()
1362 static void sk_prot_free(struct proto *prot, struct sock *sk) sk_prot_free()
1379 void sock_update_netprioidx(struct sock *sk) sock_update_netprioidx()
1394 * @prot: struct proto associated with this new sock instance
1396 struct sock *sk_alloc(struct net *net, int family, gfp_t priority, sk_alloc()
1399 struct sock *sk; sk_alloc()
1405 * See comment in struct sock definition to understand sk_alloc()
1421 static void __sk_free(struct sock *sk) __sk_free()
1448 void sk_free(struct sock *sk) sk_free()
1467 void sk_release_kernel(struct sock *sk) sk_release_kernel()
1479 static void sk_update_clone(const struct sock *sk, struct sock *newsk) sk_update_clone()
1492 struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) sk_clone_lock()
1494 struct sock *newsk; sk_clone_lock()
1537 /* though it's an empty new sock, the charging may fail sk_clone_lock()
1566 * sock (sk_refcnt_debug_inc uses newsk->sk_prot->socks, that sk_clone_lock()
1592 void sk_setup_caps(struct sock *sk, struct dst_entry *dst) sk_setup_caps()
1621 struct sock *sk = skb->sk; sock_wfree()
1666 struct sock *sk = skb->sk; sock_rfree()
1684 kuid_t sock_i_uid(struct sock *sk) sock_i_uid()
1695 unsigned long sock_i_ino(struct sock *sk) sock_i_ino()
1709 struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, sock_wmalloc()
1726 void *sock_kmalloc(struct sock *sk, int size, gfp_t priority) sock_kmalloc()
1748 static inline void __sock_kfree_s(struct sock *sk, void *mem, int size, __sock_kfree_s()
1760 void sock_kfree_s(struct sock *sk, void *mem, int size) sock_kfree_s()
1766 void sock_kzfree_s(struct sock *sk, void *mem, int size) sock_kzfree_s()
1775 static long sock_wait_for_wmem(struct sock *sk, long timeo) sock_wait_for_wmem()
1804 struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, sock_alloc_send_pskb()
1848 struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, sock_alloc_send_skb()
1899 bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag) sk_page_frag_refill()
1910 static void __lock_sock(struct sock *sk)
1928 static void __release_sock(struct sock *sk)
1969 * @sk: sock to wait on
1977 int sk_wait_data(struct sock *sk, long *timeo) sk_wait_data()
2001 int __sk_mem_schedule(struct sock *sk, int size, int kind) __sk_mem_schedule()
2083 void __sk_mem_reclaim(struct sock *sk) __sk_mem_reclaim()
2103 int sock_no_bind(struct socket *sock, struct sockaddr *saddr, int len) sock_no_bind() argument
2109 int sock_no_connect(struct socket *sock, struct sockaddr *saddr, sock_no_connect() argument
2122 int sock_no_accept(struct socket *sock, struct socket *newsock, int flags) sock_no_accept() argument
2128 int sock_no_getname(struct socket *sock, struct sockaddr *saddr, sock_no_getname() argument
2135 unsigned int sock_no_poll(struct file *file, struct socket *sock, poll_table *pt) sock_no_poll() argument
2141 int sock_no_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) sock_no_ioctl() argument
2147 int sock_no_listen(struct socket *sock, int backlog) sock_no_listen() argument
2153 int sock_no_shutdown(struct socket *sock, int how) sock_no_shutdown() argument
2159 int sock_no_setsockopt(struct socket *sock, int level, int optname, sock_no_setsockopt() argument
2166 int sock_no_getsockopt(struct socket *sock, int level, int optname, sock_no_getsockopt() argument
2173 int sock_no_sendmsg(struct socket *sock, struct msghdr *m, size_t len) sock_no_sendmsg() argument
2179 int sock_no_recvmsg(struct socket *sock, struct msghdr *m, size_t len, sock_no_recvmsg() argument
2186 int sock_no_mmap(struct file *file, struct socket *sock, struct vm_area_struct *vma) sock_no_mmap() argument
2193 ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags) sock_no_sendpage() argument
2201 res = kernel_sendmsg(sock, &msg, &iov, 1, size); sock_no_sendpage()
2211 static void sock_def_wakeup(struct sock *sk) sock_def_wakeup()
2222 static void sock_def_error_report(struct sock *sk) sock_def_error_report()
2234 static void sock_def_readable(struct sock *sk) sock_def_readable()
2247 static void sock_def_write_space(struct sock *sk) sock_def_write_space()
2270 static void sock_def_destruct(struct sock *sk) sock_def_destruct()
2275 void sk_send_sigurg(struct sock *sk) sk_send_sigurg()
2283 void sk_reset_timer(struct sock *sk, struct timer_list* timer, sk_reset_timer()
2291 void sk_stop_timer(struct sock *sk, struct timer_list* timer) sk_stop_timer()
2298 void sock_init_data(struct socket *sock, struct sock *sk) sock_init_data() argument
2312 sk_set_socket(sk, sock); sock_init_data()
2316 if (sock) { sock_init_data()
2317 sk->sk_type = sock->type; sock_init_data()
2318 sk->sk_wq = sock->wq; sock_init_data()
2319 sock->sk = sk; sock_init_data()
2365 void lock_sock_nested(struct sock *sk, int subclass) lock_sock_nested()
2381 void release_sock(struct sock *sk) release_sock()
2415 bool lock_sock_fast(struct sock *sk) lock_sock_fast()
2438 int sock_get_timestamp(struct sock *sk, struct timeval __user *userstamp) sock_get_timestamp()
2454 int sock_get_timestampns(struct sock *sk, struct timespec __user *userstamp) sock_get_timestampns()
2470 void sock_enable_timestamp(struct sock *sk, int flag) sock_enable_timestamp()
2486 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, sock_recv_errqueue()
2529 int sock_common_getsockopt(struct socket *sock, int level, int optname, sock_common_getsockopt() argument
2532 struct sock *sk = sock->sk; sock_common_getsockopt()
2539 int compat_sock_common_getsockopt(struct socket *sock, int level, int optname, compat_sock_common_getsockopt() argument
2542 struct sock *sk = sock->sk; compat_sock_common_getsockopt()
2552 int sock_common_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, sock_common_recvmsg() argument
2555 struct sock *sk = sock->sk; sock_common_recvmsg()
2570 int sock_common_setsockopt(struct socket *sock, int level, int optname, sock_common_setsockopt() argument
2573 struct sock *sk = sock->sk; sock_common_setsockopt()
2580 int compat_sock_common_setsockopt(struct socket *sock, int level, int optname, compat_sock_common_setsockopt() argument
2583 struct sock *sk = sock->sk; compat_sock_common_setsockopt()
2593 void sk_common_release(struct sock *sk) sk_common_release()
2765 pr_crit("%s: Can't create request sock SLAB cache!\n", req_prot_init()
2780 pr_crit("%s: Can't create sock SLAB cache!\n", proto_register()
H A DMakefile5 obj-y := sock.o request_sock.o skbuff.o datagram.o stream.o scm.o \
H A Dnetclassid_cgroup.c17 #include <net/sock.h>
61 struct socket *sock = sock_from_file(file, &err); update_classid() local
63 if (sock) update_classid()
64 sock->sk->sk_classid = (u32)(unsigned long)v; update_classid()
/linux-4.1.27/fs/dlm/
H A Dlowcomms.c48 #include <net/sock.h>
104 struct socket *sock; /* NULL if not connected */ member in struct:connection
427 static void lowcomms_data_ready(struct sock *sk) lowcomms_data_ready()
434 static void lowcomms_write_space(struct sock *sk) lowcomms_write_space()
441 clear_bit(SOCK_NOSPACE, &con->sock->flags); lowcomms_write_space()
444 con->sock->sk->sk_write_pending--; lowcomms_write_space()
445 clear_bit(SOCK_ASYNC_NOSPACE, &con->sock->flags); lowcomms_write_space()
460 static void lowcomms_state_change(struct sock *sk) lowcomms_state_change()
485 static void add_sock(struct socket *sock, struct connection *con) add_sock() argument
487 con->sock = sock; add_sock()
490 con->sock->sk->sk_data_ready = lowcomms_data_ready; add_sock()
491 con->sock->sk->sk_write_space = lowcomms_write_space; add_sock()
492 con->sock->sk->sk_state_change = lowcomms_state_change; add_sock()
493 con->sock->sk->sk_user_data = con; add_sock()
494 con->sock->sk->sk_allocation = GFP_NOFS; add_sock()
521 if (con->sock) { close_connection()
522 sock_release(con->sock); close_connection()
523 con->sock = NULL; close_connection()
568 ret = kernel_sendmsg(con->sock, &outmessage, NULL, 0, 0); sctp_send_shutdown()
690 ret = kernel_getsockopt(con->sock, process_sctp_notification()
721 /* Peel off a new sock */ process_sctp_notification()
722 lock_sock(con->sock->sk); process_sctp_notification()
723 ret = sctp_do_peeloff(con->sock->sk, process_sctp_notification()
725 &new_con->sock); process_sctp_notification()
726 release_sock(con->sock->sk); process_sctp_notification()
734 add_sock(new_con->sock, new_con); process_sctp_notification()
738 ret = kernel_setsockopt(new_con->sock, SOL_SOCKET, SO_LINGER, process_sctp_notification()
800 if (con->sock == NULL) { receive_from_sock()
842 r = ret = kernel_recvmsg(con->sock, &msg, iov, nvec, len, receive_from_sock()
932 if (con->sock == NULL) tcp_accept_from_sock()
935 newsock->type = con->sock->type; tcp_accept_from_sock()
936 newsock->ops = con->sock->ops; tcp_accept_from_sock()
938 result = con->sock->ops->accept(con->sock, newsock, O_NONBLOCK); tcp_accept_from_sock()
975 if (newcon->sock) { tcp_accept_from_sock()
993 if (!othercon->sock) { tcp_accept_from_sock()
995 othercon->sock = newsock; tcp_accept_from_sock()
1134 ret = kernel_sendmsg(base_con->sock, &outmessage, iov, 1, len); sctp_init_assoc()
1158 struct socket *sock = NULL; tcp_connect_to_sock() local
1163 log_print("attempt to connect sock 0 foiled"); tcp_connect_to_sock()
1172 if (con->sock) tcp_connect_to_sock()
1177 IPPROTO_TCP, &sock); tcp_connect_to_sock()
1188 sock->sk->sk_user_data = con; tcp_connect_to_sock()
1191 add_sock(sock, con); tcp_connect_to_sock()
1197 result = sock->ops->bind(sock, (struct sockaddr *) &src_addr, tcp_connect_to_sock()
1209 kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one, tcp_connect_to_sock()
1212 result = sock->ops->connect(sock, (struct sockaddr *)&saddr, addr_len, tcp_connect_to_sock()
1220 if (con->sock) { tcp_connect_to_sock()
1221 sock_release(con->sock); tcp_connect_to_sock()
1222 con->sock = NULL; tcp_connect_to_sock()
1223 } else if (sock) { tcp_connect_to_sock()
1224 sock_release(sock); tcp_connect_to_sock()
1250 struct socket *sock = NULL; tcp_create_listen_sock() local
1262 IPPROTO_TCP, &sock); tcp_create_listen_sock()
1269 kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one, tcp_create_listen_sock()
1272 result = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, tcp_create_listen_sock()
1283 result = sock->ops->bind(sock, (struct sockaddr *) saddr, addr_len); tcp_create_listen_sock()
1286 sock_release(sock); tcp_create_listen_sock()
1287 sock = NULL; tcp_create_listen_sock()
1288 con->sock = NULL; tcp_create_listen_sock()
1291 result = kernel_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, tcp_create_listen_sock()
1297 result = sock->ops->listen(sock, 5); tcp_create_listen_sock()
1300 sock_release(sock); tcp_create_listen_sock()
1301 sock = NULL; tcp_create_listen_sock()
1306 return sock; tcp_create_listen_sock()
1337 result = kernel_bind(sctp_con->sock, add_sctp_bind_addr()
1341 result = kernel_setsockopt(sctp_con->sock, SOL_SCTP, add_sctp_bind_addr()
1355 struct socket *sock = NULL; sctp_listen_for_all() local
1369 IPPROTO_SCTP, &sock); sctp_listen_for_all()
1383 result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE, sctp_listen_for_all()
1388 result = kernel_setsockopt(sock, SOL_SCTP, SCTP_EVENTS, sctp_listen_for_all()
1396 result = kernel_setsockopt(sock, SOL_SCTP, SCTP_NODELAY, (char *)&one, sctp_listen_for_all()
1402 sock->sk->sk_user_data = con; sctp_listen_for_all()
1403 con->sock = sock; sctp_listen_for_all()
1404 con->sock->sk->sk_data_ready = lowcomms_data_ready; sctp_listen_for_all()
1419 result = sock->ops->listen(sock, 5); sctp_listen_for_all()
1428 sock_release(sock); sctp_listen_for_all()
1429 con->sock = NULL; sctp_listen_for_all()
1436 struct socket *sock = NULL; tcp_listen_for_all() local
1452 sock = tcp_create_listen_sock(con, dlm_local_addr[0]); tcp_listen_for_all()
1453 if (sock) { tcp_listen_for_all()
1454 add_sock(sock, con); tcp_listen_for_all()
1564 if (con->sock == NULL) send_to_sock()
1581 ret = kernel_sendpage(con->sock, e->page, offset, len, send_to_sock()
1585 test_bit(SOCK_ASYNC_NOSPACE, &con->sock->flags) && send_to_sock()
1590 set_bit(SOCK_NOSPACE, &con->sock->flags); send_to_sock()
1591 con->sock->sk->sk_write_pending++; send_to_sock()
1732 if (con->sock && con->sock->sk) stop_conn()
1733 con->sock->sk->sk_user_data = NULL; stop_conn()
/linux-4.1.27/drivers/net/ppp/
H A Dpppox.c35 #include <net/sock.h>
57 void pppox_unbind_sock(struct sock *sk) pppox_unbind_sock()
71 int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) pppox_ioctl() argument
73 struct sock *sk = sock->sk; pppox_ioctl()
97 pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY; pppox_ioctl()
106 static int pppox_create(struct net *net, struct socket *sock, int protocol, pppox_create() argument
121 rc = pppox_protos[protocol]->create(net, sock); pppox_create()
H A Dpptp.c36 #include <net/sock.h>
95 struct pppox_sock *sock; lookup_chan() local
99 sock = rcu_dereference(callid_sock[call_id]); lookup_chan()
100 if (sock) { lookup_chan()
101 opt = &sock->proto.pptp; lookup_chan()
103 sock = NULL; lookup_chan()
105 sock_hold(sk_pppox(sock)); lookup_chan()
109 return sock; lookup_chan()
114 struct pppox_sock *sock; lookup_chan_dst() local
121 sock = rcu_dereference(callid_sock[i]); for_each_set_bit_from()
122 if (!sock) for_each_set_bit_from()
124 opt = &sock->proto.pptp; for_each_set_bit_from()
134 static int add_chan(struct pppox_sock *sock, add_chan() argument
152 sock->proto.pptp.src_addr = *sa; add_chan()
154 rcu_assign_pointer(callid_sock[sa->call_id], sock); add_chan()
164 static void del_chan(struct pppox_sock *sock) del_chan() argument
167 clear_bit(sock->proto.pptp.src_addr.call_id, callid_bitmap); del_chan()
168 RCU_INIT_POINTER(callid_sock[sock->proto.pptp.src_addr.call_id], NULL); del_chan()
175 struct sock *sk = (struct sock *) chan->private; pptp_xmit()
298 static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb) pptp_rcv_core()
417 static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr, pptp_bind() argument
420 struct sock *sk = sock->sk; pptp_bind()
450 static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr, pptp_connect() argument
453 struct sock *sk = sock->sk; pptp_connect()
523 static int pptp_getname(struct socket *sock, struct sockaddr *uaddr, pptp_getname() argument
533 sp.sa_addr.pptp = pppox_sk(sock->sk)->proto.pptp.src_addr; pptp_getname()
542 static int pptp_release(struct socket *sock) pptp_release() argument
544 struct sock *sk = sock->sk; pptp_release()
567 sock->sk = NULL; pptp_release()
575 static void pptp_sock_destruct(struct sock *sk) pptp_sock_destruct()
584 static int pptp_create(struct net *net, struct socket *sock) pptp_create() argument
587 struct sock *sk; pptp_create()
595 sock_init_data(sock, sk); pptp_create()
597 sock->state = SS_UNCONNECTED; pptp_create()
598 sock->ops = &pptp_ops; pptp_create()
621 struct sock *sk = (struct sock *) chan->private; pptp_ppp_ioctl()
/linux-4.1.27/Documentation/networking/timestamping/
H A Dtimestamping.c137 static void sendpacket(int sock, struct sockaddr *addr, socklen_t addr_len) sendpacket() argument
142 res = sendto(sock, sync, sizeof(sync), 0, sendpacket()
155 int sock, int recvmsg_flags, printpacket()
261 if (ioctl(sock, SIOCGSTAMP, &tv)) printpacket()
269 if (ioctl(sock, SIOCGSTAMPNS, &ts)) printpacket()
278 static void recvpacket(int sock, int recvmsg_flags, recvpacket() argument
301 res = recvmsg(sock, &msg, recvmsg_flags|MSG_DONTWAIT); recvpacket()
309 sock, recvmsg_flags, recvpacket()
325 int sock; main() local
367 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); main()
368 if (sock < 0) main()
373 if (ioctl(sock, SIOCGIFADDR, &device) < 0) main()
387 if (ioctl(sock, SIOCSHWTSTAMP, &hwtstamp) < 0) { main()
403 if (bind(sock, main()
414 if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, main()
419 if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, main()
423 if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_LOOP, main()
430 setsockopt(sock, SOL_SOCKET, SO_TIMESTAMP, main()
435 setsockopt(sock, SOL_SOCKET, SO_TIMESTAMPNS, main()
440 setsockopt(sock, SOL_SOCKET, SO_TIMESTAMPING, main()
446 if (setsockopt(sock, SOL_IP, IP_PKTINFO, main()
452 if (getsockopt(sock, SOL_SOCKET, SO_TIMESTAMP, &val, &len) < 0) main()
457 if (getsockopt(sock, SOL_SOCKET, SO_TIMESTAMPNS, &val, &len) < 0) main()
463 if (getsockopt(sock, SOL_SOCKET, SO_TIMESTAMPING, &val, &len) < 0) { main()
494 FD_SET(sock, &readfs); main()
495 FD_SET(sock, &errorfs); main()
499 res = select(sock + 1, &readfs, 0, &errorfs, &delta); main()
506 if (FD_ISSET(sock, &readfs)) main()
508 if (FD_ISSET(sock, &errorfs)) main()
510 recvpacket(sock, 0, main()
513 recvpacket(sock, MSG_ERRQUEUE, main()
519 sendpacket(sock, main()
153 printpacket(struct msghdr *msg, int res, char *data, int sock, int recvmsg_flags, int siocgstamp, int siocgstampns) printpacket() argument
H A Dhwtstamp_config.c90 int sock; main() local
107 sock = socket(AF_INET, SOCK_DGRAM, 0); main()
108 if (sock < 0) { main()
116 if (ioctl(sock, (argc == 2) ? SIOCGHWTSTAMP : SIOCSHWTSTAMP, &ifr)) { main()
/linux-4.1.27/net/rxrpc/
H A Daf_rxrpc.c21 #include <net/sock.h>
50 static void rxrpc_sock_destructor(struct sock *);
55 static inline int rxrpc_writable(struct sock *sk) rxrpc_writable()
63 static void rxrpc_write_space(struct sock *sk) rxrpc_write_space()
122 static int rxrpc_bind(struct socket *sock, struct sockaddr *saddr, int len) rxrpc_bind() argument
125 struct sock *sk = sock->sk; rxrpc_bind()
188 static int rxrpc_listen(struct socket *sock, int backlog) rxrpc_listen() argument
190 struct sock *sk = sock->sk; rxrpc_listen()
223 static struct rxrpc_transport *rxrpc_name_to_transport(struct socket *sock, rxrpc_name_to_transport() argument
230 struct rxrpc_sock *rx = rxrpc_sk(sock->sk); rxrpc_name_to_transport()
257 * @sock: The socket on which to make the call
269 struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock, rxrpc_kernel_begin_call() argument
278 struct rxrpc_sock *rx = rxrpc_sk(sock->sk); rxrpc_kernel_begin_call()
286 trans = rxrpc_name_to_transport(sock, (struct sockaddr *) srx, rxrpc_kernel_begin_call()
348 * @sock: The socket to intercept received messages on
357 void rxrpc_kernel_intercept_rx_messages(struct socket *sock, rxrpc_kernel_intercept_rx_messages() argument
360 struct rxrpc_sock *rx = rxrpc_sk(sock->sk); rxrpc_kernel_intercept_rx_messages()
373 static int rxrpc_connect(struct socket *sock, struct sockaddr *addr, rxrpc_connect() argument
377 struct sock *sk = sock->sk; rxrpc_connect()
419 trans = rxrpc_name_to_transport(sock, addr, addr_len, flags, rxrpc_connect()
444 static int rxrpc_sendmsg(struct socket *sock, struct msghdr *m, size_t len) rxrpc_sendmsg() argument
447 struct rxrpc_sock *rx = rxrpc_sk(sock->sk); rxrpc_sendmsg()
468 trans = rxrpc_name_to_transport(sock, m->msg_name, rxrpc_sendmsg()
512 static int rxrpc_setsockopt(struct socket *sock, int level, int optname, rxrpc_setsockopt() argument
515 struct rxrpc_sock *rx = rxrpc_sk(sock->sk); rxrpc_setsockopt()
588 static unsigned int rxrpc_poll(struct file *file, struct socket *sock, rxrpc_poll() argument
592 struct sock *sk = sock->sk; rxrpc_poll()
614 static int rxrpc_create(struct net *net, struct socket *sock, int protocol, rxrpc_create() argument
618 struct sock *sk; rxrpc_create()
620 _enter("%p,%d", sock, protocol); rxrpc_create()
629 if (sock->type != SOCK_DGRAM) rxrpc_create()
632 sock->ops = &rxrpc_rpc_ops; rxrpc_create()
633 sock->state = SS_UNCONNECTED; rxrpc_create()
639 sock_init_data(sock, sk); rxrpc_create()
662 static void rxrpc_sock_destructor(struct sock *sk) rxrpc_sock_destructor()
681 static int rxrpc_release_sock(struct sock *sk) rxrpc_release_sock()
739 static int rxrpc_release(struct socket *sock) rxrpc_release() argument
741 struct sock *sk = sock->sk; rxrpc_release()
743 _enter("%p{%p}", sock, sk); rxrpc_release()
748 sock->sk = NULL; rxrpc_release()
/linux-4.1.27/net/iucv/
H A Daf_iucv.c25 #include <net/sock.h>
85 static void iucv_sock_kill(struct sock *sk);
86 static void iucv_sock_close(struct sock *sk);
87 static void iucv_sever_path(struct sock *, int);
91 static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
152 struct sock *sk; afiucv_pm_freeze()
189 struct sock *sk; afiucv_pm_restore_thaw()
266 * @sk: sock structure
272 static int iucv_sock_in_state(struct sock *sk, int state, int state2) iucv_sock_in_state()
279 * @sk: sock structure
285 static inline int iucv_below_msglim(struct sock *sk) iucv_below_msglim()
301 static void iucv_sock_wake_msglim(struct sock *sk) iucv_sock_wake_msglim()
316 static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock, afiucv_hs_send() argument
319 struct iucv_sock *iucv = iucv_sk(sock); afiucv_hs_send()
361 if (sock->sk_type == SOCK_SEQPACKET) afiucv_hs_send()
382 static struct sock *__iucv_get_sock_by_name(char *nm) __iucv_get_sock_by_name()
384 struct sock *sk; __iucv_get_sock_by_name()
393 static void iucv_sock_destruct(struct sock *sk) iucv_sock_destruct()
412 static void iucv_sock_cleanup_listen(struct sock *parent) iucv_sock_cleanup_listen()
414 struct sock *sk; iucv_sock_cleanup_listen()
426 static void iucv_sock_kill(struct sock *sk) iucv_sock_kill()
437 static void iucv_sever_path(struct sock *sk, int with_user_data) iucv_sever_path()
457 static int iucv_send_ctrl(struct sock *sk, u8 flags) iucv_send_ctrl()
473 static void iucv_sock_close(struct sock *sk) iucv_sock_close()
532 static void iucv_sock_init(struct sock *sk, struct sock *parent) iucv_sock_init()
538 static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio) iucv_sock_alloc() argument
540 struct sock *sk; iucv_sock_alloc()
548 sock_init_data(sock, sk); iucv_sock_alloc()
583 static int iucv_sock_create(struct net *net, struct socket *sock, int protocol, iucv_sock_create() argument
586 struct sock *sk; iucv_sock_create()
591 sock->state = SS_UNCONNECTED; iucv_sock_create()
593 switch (sock->type) { iucv_sock_create()
595 sock->ops = &iucv_sock_ops; iucv_sock_create()
599 sock->ops = &iucv_sock_ops; iucv_sock_create()
605 sk = iucv_sock_alloc(sock, protocol, GFP_KERNEL); iucv_sock_create()
614 void iucv_sock_link(struct iucv_sock_list *l, struct sock *sk) iucv_sock_link()
621 void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *sk) iucv_sock_unlink()
628 void iucv_accept_enqueue(struct sock *parent, struct sock *sk) iucv_accept_enqueue()
641 void iucv_accept_unlink(struct sock *sk) iucv_accept_unlink()
654 struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock) iucv_accept_dequeue()
657 struct sock *sk; iucv_accept_dequeue()
660 sk = (struct sock *) isk; iucv_accept_dequeue()
698 static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr, iucv_sock_bind() argument
702 struct sock *sk = sock->sk; iucv_sock_bind()
782 static int iucv_sock_autobind(struct sock *sk) iucv_sock_autobind()
802 static int afiucv_path_connect(struct socket *sock, struct sockaddr *addr) afiucv_path_connect() argument
805 struct sock *sk = sock->sk; afiucv_path_connect()
848 static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr, iucv_sock_connect() argument
852 struct sock *sk = sock->sk; iucv_sock_connect()
882 err = iucv_send_ctrl(sock->sk, AF_IUCV_FLAG_SYN); iucv_sock_connect()
884 err = afiucv_path_connect(sock, addr); iucv_sock_connect()
905 static int iucv_sock_listen(struct socket *sock, int backlog) iucv_sock_listen() argument
907 struct sock *sk = sock->sk; iucv_sock_listen()
916 if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET) iucv_sock_listen()
930 static int iucv_sock_accept(struct socket *sock, struct socket *newsock, iucv_sock_accept() argument
934 struct sock *sk = sock->sk, *nsk; iucv_sock_accept()
984 static int iucv_sock_getname(struct socket *sock, struct sockaddr *addr, iucv_sock_getname() argument
988 struct sock *sk = sock->sk; iucv_sock_getname()
1032 static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg, iucv_sock_sendmsg() argument
1035 struct sock *sk = sock->sk; iucv_sock_sendmsg()
1209 static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len) iucv_fragment_skb()
1247 static void iucv_process_message(struct sock *sk, struct sk_buff *skb, iucv_process_message()
1303 static void iucv_process_message_q(struct sock *sk) iucv_process_message_q()
1321 static int iucv_sock_recvmsg(struct socket *sock, struct msghdr *msg, iucv_sock_recvmsg() argument
1325 struct sock *sk = sock->sk; iucv_sock_recvmsg()
1441 static inline unsigned int iucv_accept_poll(struct sock *parent) iucv_accept_poll()
1444 struct sock *sk; iucv_accept_poll()
1447 sk = (struct sock *) isk; iucv_accept_poll()
1456 unsigned int iucv_sock_poll(struct file *file, struct socket *sock, iucv_sock_poll() argument
1459 struct sock *sk = sock->sk; iucv_sock_poll()
1495 static int iucv_sock_shutdown(struct socket *sock, int how) iucv_sock_shutdown() argument
1497 struct sock *sk = sock->sk; iucv_sock_shutdown()
1562 static int iucv_sock_release(struct socket *sock) iucv_sock_release() argument
1564 struct sock *sk = sock->sk; iucv_sock_release()
1578 static int iucv_sock_setsockopt(struct socket *sock, int level, int optname, iucv_sock_setsockopt() argument
1581 struct sock *sk = sock->sk; iucv_sock_setsockopt()
1628 static int iucv_sock_getsockopt(struct socket *sock, int level, int optname, iucv_sock_getsockopt() argument
1631 struct sock *sk = sock->sk; iucv_sock_getsockopt()
1684 struct sock *sk, *nsk; iucv_callback_connreq()
1775 struct sock *sk = path->private; iucv_callback_connack()
1783 struct sock *sk = path->private; iucv_callback_rx()
1828 struct sock *sk = path->private; iucv_callback_txdone()
1869 struct sock *sk = path->private; iucv_callback_connrej()
1887 struct sock *sk = path->private; iucv_callback_shutdown()
1922 static int afiucv_hs_callback_syn(struct sock *sk, struct sk_buff *skb) afiucv_hs_callback_syn()
1924 struct sock *nsk; afiucv_hs_callback_syn()
1932 /* no sock - connection refused */ afiucv_hs_callback_syn()
1988 static int afiucv_hs_callback_synack(struct sock *sk, struct sk_buff *skb) afiucv_hs_callback_synack()
2011 static int afiucv_hs_callback_synfin(struct sock *sk, struct sk_buff *skb) afiucv_hs_callback_synfin()
2031 static int afiucv_hs_callback_fin(struct sock *sk, struct sk_buff *skb) afiucv_hs_callback_fin()
2052 static int afiucv_hs_callback_win(struct sock *sk, struct sk_buff *skb) afiucv_hs_callback_win()
2072 static int afiucv_hs_callback_rx(struct sock *sk, struct sk_buff *skb) afiucv_hs_callback_rx()
2120 struct sock *sk; afiucv_hs_rcv()
2166 /* no sock afiucv_hs_rcv()
2167 how should we send with no sock afiucv_hs_rcv()
2168 1) send without sock no send rc checking? afiucv_hs_rcv()
2169 2) introduce default sock to handle this cases afiucv_hs_rcv()
2221 struct sock *isk = skb->sk; afiucv_hs_callback_txnotify()
2222 struct sock *sk = NULL; afiucv_hs_callback_txnotify()
2301 struct sock *sk; afiucv_netdev_event()
/linux-4.1.27/include/net/bluetooth/
H A Dbluetooth.h29 #include <net/sock.h>
224 struct sock sk;
226 struct sock *parent;
246 void bt_sock_link(struct bt_sock_list *l, struct sock *s);
247 void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
248 int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
250 int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg,
252 uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait);
253 int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
254 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
255 int bt_sock_wait_ready(struct sock *sk, unsigned long flags);
257 void bt_accept_enqueue(struct sock *parent, struct sock *sk);
258 void bt_accept_unlink(struct sock *sk);
259 struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock);
315 static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, bt_skb_send_alloc()
347 void hci_sock_set_flag(struct sock *sk, int nr);
348 void hci_sock_clear_flag(struct sock *sk, int nr);
349 int hci_sock_test_flag(struct sock *sk, int nr);
350 unsigned short hci_sock_get_channel(struct sock *sk);
374 void bt_sock_reclassify_lock(struct sock *sk, int proto);
/linux-4.1.27/net/l2tp/
H A Dl2tp_ppp.c84 #include <net/sock.h>
125 struct sock *sock; /* Pointer to the session member in struct:pppol2tp_session
127 struct sock *tunnel_sock; /* Pointer to the tunnel UDP
143 static inline struct l2tp_session *pppol2tp_sock_to_session(struct sock *sk) pppol2tp_sock_to_session()
188 static int pppol2tp_recvmsg(struct socket *sock, struct msghdr *msg, pppol2tp_recvmsg() argument
193 struct sock *sk = sock->sk; pppol2tp_recvmsg()
222 struct sock *sk = NULL; pppol2tp_recv()
227 sk = ps->sock; pppol2tp_recv()
277 if (ps->sock) pppol2tp_session_sock_hold()
278 sock_hold(ps->sock); pppol2tp_session_sock_hold()
285 if (ps->sock) pppol2tp_session_sock_put()
286 sock_put(ps->sock); pppol2tp_session_sock_put()
297 static int pppol2tp_sendmsg(struct socket *sock, struct msghdr *m, pppol2tp_sendmsg() argument
301 struct sock *sk = sock->sk; pppol2tp_sendmsg()
388 struct sock *sk = (struct sock *) chan->private; pppol2tp_xmit()
389 struct sock *sk_tun; pppol2tp_xmit()
452 struct sock *sk = ps->sock; pppol2tp_session_close()
453 struct socket *sock = sk->sk_socket; pppol2tp_session_close() local
457 if (sock) { pppol2tp_session_close()
458 inet_shutdown(sock, 2); pppol2tp_session_close()
467 static void pppol2tp_session_destruct(struct sock *sk) pppol2tp_session_destruct()
479 static int pppol2tp_release(struct socket *sock) pppol2tp_release() argument
481 struct sock *sk = sock->sk; pppol2tp_release()
498 sock->sk = NULL; pppol2tp_release()
532 static int pppol2tp_backlog_recv(struct sock *sk, struct sk_buff *skb) pppol2tp_backlog_recv()
543 /* socket() handler. Initialize a new struct sock.
545 static int pppol2tp_create(struct net *net, struct socket *sock) pppol2tp_create() argument
548 struct sock *sk; pppol2tp_create()
554 sock_init_data(sock, sk); pppol2tp_create()
556 sock->state = SS_UNCONNECTED; pppol2tp_create()
557 sock->ops = &pppol2tp_ops; pppol2tp_create()
579 struct pppox_sock *po = pppox_sk(ps->sock); pppol2tp_show()
588 static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr, pppol2tp_connect() argument
591 struct sock *sk = sock->sk; pppol2tp_connect()
693 if (tunnel->sock == NULL) pppol2tp_connect()
727 if (ps->sock != NULL) pppol2tp_connect()
731 if (ps->tunnel_sock != tunnel->sock) pppol2tp_connect()
738 ps->sock = sk; pppol2tp_connect()
739 ps->tunnel_sock = tunnel->sock; pppol2tp_connect()
754 dst = sk_dst_get(tunnel->sock); pppol2tp_connect()
821 if (tunnel->sock == NULL) pppol2tp_session_create()
845 ps->tunnel_sock = tunnel->sock; pppol2tp_session_create()
860 static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr, pppol2tp_getname() argument
867 struct sock *sk = sock->sk; pppol2tp_getname()
889 inet = inet_sk(tunnel->sock); pppol2tp_getname()
890 if ((tunnel->version == 2) && (tunnel->sock->sk_family == AF_INET)) { pppol2tp_getname()
908 (tunnel->sock->sk_family == AF_INET6)) { pppol2tp_getname()
923 memcpy(&sp.pppol2tp.addr.sin6_addr, &tunnel->sock->sk_v6_daddr, pppol2tp_getname()
924 sizeof(tunnel->sock->sk_v6_daddr)); pppol2tp_getname()
927 (tunnel->sock->sk_family == AF_INET6)) { pppol2tp_getname()
942 memcpy(&sp.pppol2tp.addr.sin6_addr, &tunnel->sock->sk_v6_daddr, pppol2tp_getname()
943 sizeof(tunnel->sock->sk_v6_daddr)); pppol2tp_getname()
1006 struct sock *sk; pppol2tp_session_ioctl()
1016 sk = ps->sock; pppol2tp_session_ioctl()
1139 struct sock *sk; pppol2tp_tunnel_ioctl()
1146 sk = tunnel->sock; pppol2tp_tunnel_ioctl()
1196 static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd, pppol2tp_ioctl() argument
1199 struct sock *sk = sock->sk; pppol2tp_ioctl()
1259 static int pppol2tp_tunnel_setsockopt(struct sock *sk, pppol2tp_tunnel_setsockopt()
1282 static int pppol2tp_session_setsockopt(struct sock *sk, pppol2tp_session_setsockopt()
1308 struct sock *ssk = ps->sock; pppol2tp_session_setsockopt()
1356 static int pppol2tp_setsockopt(struct socket *sock, int level, int optname, pppol2tp_setsockopt() argument
1359 struct sock *sk = sock->sk; pppol2tp_setsockopt()
1408 /* Tunnel getsockopt helper. Called with sock locked.
1410 static int pppol2tp_tunnel_getsockopt(struct sock *sk, pppol2tp_tunnel_getsockopt()
1431 /* Session getsockopt helper. Called with sock locked.
1433 static int pppol2tp_session_getsockopt(struct sock *sk, pppol2tp_session_getsockopt()
1482 static int pppol2tp_getsockopt(struct socket *sock, int level, int optname, pppol2tp_getsockopt() argument
1485 struct sock *sk = sock->sk; pppol2tp_getsockopt()
1629 (tunnel == tunnel->sock->sk_user_data) ? 'Y' : 'N', pppol2tp_seq_tunnel_show()
1646 struct pppox_sock *po = pppox_sk(ps->sock); pppol2tp_seq_session_show()
1650 if (tunnel->sock) { pppol2tp_seq_session_show()
1651 struct inet_sock *inet = inet_sk(tunnel->sock); pppol2tp_seq_session_show()
1663 ps->sock->sk_state, pppol2tp_seq_session_show()
1664 (session == ps->sock->sk_user_data) ? pppol2tp_seq_session_show()
H A Dl2tp_ip.c21 #include <net/sock.h>
45 static inline struct l2tp_ip_sock *l2tp_ip_sk(const struct sock *sk) l2tp_ip_sk()
50 static struct sock *__l2tp_ip_bind_lookup(struct net *net, __be32 laddr, int dif, u32 tunnel_id) __l2tp_ip_bind_lookup()
52 struct sock *sk; __l2tp_ip_bind_lookup()
73 static inline struct sock *l2tp_ip_bind_lookup(struct net *net, __be32 laddr, int dif, u32 tunnel_id) l2tp_ip_bind_lookup()
75 struct sock *sk = __l2tp_ip_bind_lookup(net, laddr, dif, tunnel_id); l2tp_ip_bind_lookup()
118 struct sock *sk; l2tp_ip_recv()
178 sk = tunnel->sock; l2tp_ip_recv()
207 static int l2tp_ip_open(struct sock *sk) l2tp_ip_open()
219 static void l2tp_ip_close(struct sock *sk, long timeout) l2tp_ip_close()
228 static void l2tp_ip_destroy_sock(struct sock *sk) l2tp_ip_destroy_sock()
244 static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) l2tp_ip_bind()
303 static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) l2tp_ip_connect()
334 static int l2tp_ip_disconnect(struct sock *sk, int flags) l2tp_ip_disconnect()
342 static int l2tp_ip_getname(struct socket *sock, struct sockaddr *uaddr, l2tp_ip_getname() argument
345 struct sock *sk = sock->sk; l2tp_ip_getname()
368 static int l2tp_ip_backlog_recv(struct sock *sk, struct sk_buff *skb) l2tp_ip_backlog_recv()
388 static int l2tp_ip_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) l2tp_ip_sendmsg()
509 static int l2tp_ip_recvmsg(struct sock *sk, struct msghdr *msg, l2tp_ip_recvmsg()
/linux-4.1.27/drivers/scsi/
H A Discsi_tcp.h39 struct socket *sock; member in struct:iscsi_sw_tcp_conn
43 void (*old_data_ready)(struct sock *);
44 void (*old_state_change)(struct sock *);
45 void (*old_write_space)(struct sock *);
/linux-4.1.27/fs/ncpfs/
H A DMakefile7 ncpfs-y := dir.o file.o inode.o ioctl.o mmap.o ncplib_kernel.o sock.o \
/linux-4.1.27/tools/perf/util/
H A Dcpumap.h25 static inline int cpu_map__socket(struct cpu_map *sock, int s) cpu_map__socket() argument
27 if (!sock || s > sock->nr || s < 0) cpu_map__socket()
29 return sock->map[s]; cpu_map__socket()
/linux-4.1.27/net/decnet/
H A Daf_decnet.c119 #include <net/sock.h>
143 struct sock sk;
147 static void dn_keepalive(struct sock *sk);
160 static int __dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen, int flags);
161 static int __dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen, int flags);
163 static struct hlist_head *dn_find_list(struct sock *sk) dn_find_list()
178 struct sock *sk; check_port()
191 static unsigned short port_alloc(struct sock *sk) port_alloc()
212 static int dn_hash_sock(struct sock *sk) dn_hash_sock()
236 static void dn_unhash_sock(struct sock *sk) dn_unhash_sock()
243 static void dn_unhash_sock_bh(struct sock *sk) dn_unhash_sock_bh()
271 static void dn_rehash_sock(struct sock *sk) dn_rehash_sock()
374 struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr) dn_sklist_find_listener()
377 struct sock *sk; dn_sklist_find_listener()
412 struct sock *dn_find_by_skb(struct sk_buff *skb) dn_find_by_skb()
415 struct sock *sk; dn_find_by_skb()
438 static void dn_destruct(struct sock *sk) dn_destruct()
451 static void dn_enter_memory_pressure(struct sock *sk) dn_enter_memory_pressure()
471 static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gfp) dn_alloc_sock() argument
474 struct sock *sk = sk_alloc(net, PF_DECnet, gfp, &dn_proto); dn_alloc_sock()
479 if (sock) dn_alloc_sock()
480 sock->ops = &dn_proto_ops; dn_alloc_sock()
481 sock_init_data(sock, sk); dn_alloc_sock()
548 static void dn_keepalive(struct sock *sk) dn_keepalive()
569 int dn_destroy_timer(struct sock *sk) dn_destroy_timer()
611 static void dn_destroy_sock(struct sock *sk) dn_destroy_sock()
676 static int dn_create(struct net *net, struct socket *sock, int protocol, dn_create() argument
679 struct sock *sk; dn_create()
687 switch (sock->type) { dn_create()
699 if ((sk = dn_alloc_sock(net, sock, GFP_KERNEL)) == NULL) dn_create()
709 dn_release(struct socket *sock) dn_release() argument
711 struct sock *sk = sock->sk; dn_release()
725 static int dn_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) dn_bind() argument
727 struct sock *sk = sock->sk; dn_bind()
786 static int dn_auto_bind(struct socket *sock) dn_auto_bind() argument
788 struct sock *sk = sock->sk; dn_auto_bind()
823 static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation) dn_confirm_accept()
865 static int dn_wait_run(struct sock *sk, long *timeo) dn_wait_run()
907 static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen, long *timeo, int flags) __dn_connect()
909 struct socket *sock = sk->sk_socket; __dn_connect() local
915 if (sock->state == SS_CONNECTED) __dn_connect()
918 if (sock->state == SS_CONNECTING) { __dn_connect()
921 sock->state = SS_CONNECTED; __dn_connect()
926 sock->state = SS_UNCONNECTED; __dn_connect()
962 sock->state = SS_CONNECTING; __dn_connect()
975 static int dn_connect(struct socket *sock, struct sockaddr *uaddr, int addrlen, int flags) dn_connect() argument
978 struct sock *sk = sock->sk; dn_connect()
989 static inline int dn_check_state(struct sock *sk, struct sockaddr_dn *addr, int addrlen, long *timeo, int flags) dn_check_state()
1040 static struct sk_buff *dn_wait_for_connect(struct sock *sk, long *timeo) dn_wait_for_connect()
1073 static int dn_accept(struct socket *sock, struct socket *newsock, int flags) dn_accept() argument
1075 struct sock *sk = sock->sk, *newsk; dn_accept()
1182 static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int *uaddr_len,int peer) dn_getname() argument
1185 struct sock *sk = sock->sk; dn_getname()
1193 if ((sock->state != SS_CONNECTED && dn_getname()
1194 sock->state != SS_CONNECTING) && dn_getname()
1211 static unsigned int dn_poll(struct file *file, struct socket *sock, poll_table *wait) dn_poll() argument
1213 struct sock *sk = sock->sk; dn_poll()
1215 int mask = datagram_poll(file, sock, wait); dn_poll()
1223 static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) dn_ioctl() argument
1225 struct sock *sk = sock->sk; dn_ioctl()
1274 static int dn_listen(struct socket *sock, int backlog) dn_listen() argument
1276 struct sock *sk = sock->sk; dn_listen()
1300 static int dn_shutdown(struct socket *sock, int how) dn_shutdown() argument
1302 struct sock *sk = sock->sk; dn_shutdown()
1308 if (sock->state == SS_UNCONNECTED) dn_shutdown()
1312 if (sock->state == SS_DISCONNECTING) dn_shutdown()
1332 static int dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) dn_setsockopt() argument
1334 struct sock *sk = sock->sk; dn_setsockopt()
1338 err = __dn_setsockopt(sock, level, optname, optval, optlen, 0); dn_setsockopt()
1344 static int __dn_setsockopt(struct socket *sock, int level,int optname, char __user *optval, unsigned int optlen, int flags) __dn_setsockopt() argument
1346 struct sock *sk = sock->sk; __dn_setsockopt()
1371 if (sock->state == SS_CONNECTED) __dn_setsockopt()
1386 if (sock->state != SS_CONNECTED && __dn_setsockopt()
1400 if (sock->state == SS_CONNECTED) __dn_setsockopt()
1417 if (sock->state == SS_CONNECTED) __dn_setsockopt()
1508 static int dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen) dn_getsockopt() argument
1510 struct sock *sk = sock->sk; dn_getsockopt()
1514 err = __dn_getsockopt(sock, level, optname, optval, optlen, 0); dn_getsockopt()
1520 static int __dn_getsockopt(struct socket *sock, int level,int optname, char __user *optval,int __user *optlen, int flags) __dn_getsockopt() argument
1522 struct sock *sk = sock->sk; __dn_getsockopt()
1563 switch (sock->state) { __dn_getsockopt()
1645 static int dn_data_ready(struct sock *sk, struct sk_buff_head *q, int flags, int target) dn_data_ready()
1675 static int dn_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, dn_recvmsg() argument
1678 struct sock *sk = sock->sk; dn_recvmsg()
1873 static inline unsigned int dn_current_mss(struct sock *sk, int flags) dn_current_mss()
1898 static inline struct sk_buff *dn_alloc_send_pskb(struct sock *sk, dn_alloc_send_pskb()
1911 static int dn_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) dn_sendmsg() argument
1913 struct sock *sk = sock->sk; dn_sendmsg()
1941 if (sock->type == SOCK_STREAM) { dn_sendmsg()
2120 static struct sock *dn_socket_get_first(struct seq_file *seq) dn_socket_get_first()
2123 struct sock *n = NULL; dn_socket_get_first()
2136 static struct sock *dn_socket_get_next(struct seq_file *seq, dn_socket_get_next()
2137 struct sock *n) dn_socket_get_next()
2153 static struct sock *socket_get_idx(struct seq_file *seq, loff_t *pos) socket_get_idx()
2155 struct sock *sk = dn_socket_get_first(seq); socket_get_idx()
2264 static inline void dn_socket_format_entry(struct seq_file *seq, struct sock *sk) dn_socket_format_entry()
H A Ddn_timer.c24 #include <net/sock.h>
38 void dn_start_slow_timer(struct sock *sk) dn_start_slow_timer()
44 void dn_stop_slow_timer(struct sock *sk) dn_stop_slow_timer()
51 struct sock *sk = (struct sock *)arg; dn_slow_timer()
/linux-4.1.27/tools/testing/selftests/net/
H A Dpsock_tpacket.c83 void (*walk)(int sock, struct ring *ring);
113 int ret, sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); pfsocket() local
114 if (sock == -1) { pfsocket()
119 ret = setsockopt(sock, SOL_PACKET, PACKET_VERSION, &ver, sizeof(ver)); pfsocket()
125 return sock; pfsocket()
232 static void walk_v1_v2_rx(int sock, struct ring *ring) walk_v1_v2_rx() argument
242 pair_udp_setfilter(sock); walk_v1_v2_rx()
245 pfd.fd = sock; walk_v1_v2_rx()
339 static void __v1_v2_set_packet_loss_discard(int sock) __v1_v2_set_packet_loss_discard() argument
343 ret = setsockopt(sock, SOL_PACKET, PACKET_LOSS, (void *) &discard, __v1_v2_set_packet_loss_discard()
351 static void walk_v1_v2_tx(int sock, struct ring *ring) walk_v1_v2_tx() argument
383 pfd.fd = sock; walk_v1_v2_tx()
431 ret = sendto(sock, NULL, 0, 0, NULL, 0); walk_v1_v2_tx()
458 static void walk_v1_v2(int sock, struct ring *ring) walk_v1_v2() argument
461 walk_v1_v2_rx(sock, ring); walk_v1_v2()
463 walk_v1_v2_tx(sock, ring); walk_v1_v2()
539 static void walk_v3_rx(int sock, struct ring *ring) walk_v3_rx() argument
549 pair_udp_setfilter(sock); walk_v3_rx()
552 pfd.fd = sock; walk_v3_rx()
581 static void walk_v3(int sock, struct ring *ring) walk_v3() argument
584 walk_v3_rx(sock, ring); walk_v3()
625 static void setup_ring(int sock, struct ring *ring, int version, int type) setup_ring() argument
637 __v1_v2_set_packet_loss_discard(sock); setup_ring()
639 ret = setsockopt(sock, SOL_PACKET, type, &ring->req, setup_ring()
645 ret = setsockopt(sock, SOL_PACKET, type, &ring->req3, setup_ring()
666 static void mmap_ring(int sock, struct ring *ring) mmap_ring() argument
671 MAP_SHARED | MAP_LOCKED | MAP_POPULATE, sock, 0); mmap_ring()
684 static void bind_ring(int sock, struct ring *ring) bind_ring() argument
695 ret = bind(sock, (struct sockaddr *) &ring->ll, sizeof(ring->ll)); bind_ring()
702 static void walk_ring(int sock, struct ring *ring) walk_ring() argument
704 ring->walk(sock, ring); walk_ring()
707 static void unmap_ring(int sock, struct ring *ring) unmap_ring() argument
760 int sock; test_tpacket() local
775 sock = pfsocket(version); test_tpacket()
777 setup_ring(sock, &ring, version, type); test_tpacket()
778 mmap_ring(sock, &ring); test_tpacket()
779 bind_ring(sock, &ring); test_tpacket()
780 walk_ring(sock, &ring); test_tpacket()
781 unmap_ring(sock, &ring); test_tpacket()
782 close(sock); test_tpacket()
/linux-4.1.27/drivers/staging/lustre/lnet/klnds/socklnd/
H A Dsocklnd_lib-linux.c50 CERROR("Error %d getting sock peer IP\n", rc); ksocknal_lib_get_conn_addrs()
57 CERROR("Error %d getting sock local IP\n", rc); ksocknal_lib_get_conn_addrs()
80 struct socket *sock = conn->ksnc_sock; ksocknal_lib_send_iov() local
114 rc = kernel_sendmsg(sock, &msg, scratchiov, niov, nob); ksocknal_lib_send_iov()
122 struct socket *sock = conn->ksnc_sock; ksocknal_lib_send_kiov() local
134 struct sock *sk = sock->sk; ksocknal_lib_send_kiov()
179 rc = kernel_sendmsg(sock, &msg, (struct kvec *)scratchiov, niov, nob); ksocknal_lib_send_kiov()
191 struct socket *sock = conn->ksnc_sock; ksocknal_lib_eager_ack() local
198 kernel_setsockopt(sock, SOL_TCP, TCP_QUICKACK, ksocknal_lib_eager_ack()
428 struct socket *sock = conn->ksnc_sock; ksocknal_lib_get_conn_tunables() local
439 rc = libcfs_sock_getbuf(sock, txmem, rxmem); ksocknal_lib_get_conn_tunables()
442 rc = kernel_getsockopt(sock, SOL_TCP, TCP_NODELAY, ksocknal_lib_get_conn_tunables()
457 ksocknal_lib_setup_sock(struct socket *sock) ksocknal_lib_setup_sock() argument
467 sock->sk->sk_allocation = GFP_NOFS; ksocknal_lib_setup_sock()
475 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_LINGER, ksocknal_lib_setup_sock()
483 rc = kernel_setsockopt(sock, SOL_TCP, TCP_LINGER2, ksocknal_lib_setup_sock()
493 rc = kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, ksocknal_lib_setup_sock()
501 rc = libcfs_sock_setbuf(sock, ksocknal_lib_setup_sock()
521 rc = kernel_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, ksocknal_lib_setup_sock()
531 rc = kernel_setsockopt(sock, SOL_TCP, TCP_KEEPIDLE, ksocknal_lib_setup_sock()
538 rc = kernel_setsockopt(sock, SOL_TCP, TCP_KEEPINTVL, ksocknal_lib_setup_sock()
545 rc = kernel_setsockopt(sock, SOL_TCP, TCP_KEEPCNT, ksocknal_lib_setup_sock()
558 struct sock *sk; ksocknal_lib_push_conn()
593 ksocknal_data_ready(struct sock *sk) ksocknal_data_ready()
612 ksocknal_write_space(struct sock *sk) ksocknal_write_space()
657 ksocknal_lib_save_callback(struct socket *sock, ksock_conn_t *conn) ksocknal_lib_save_callback() argument
659 conn->ksnc_saved_data_ready = sock->sk->sk_data_ready; ksocknal_lib_save_callback()
660 conn->ksnc_saved_write_space = sock->sk->sk_write_space; ksocknal_lib_save_callback()
664 ksocknal_lib_set_callback(struct socket *sock, ksock_conn_t *conn) ksocknal_lib_set_callback() argument
666 sock->sk->sk_user_data = conn; ksocknal_lib_set_callback()
667 sock->sk->sk_data_ready = ksocknal_data_ready; ksocknal_lib_set_callback()
668 sock->sk->sk_write_space = ksocknal_write_space; ksocknal_lib_set_callback()
673 ksocknal_lib_reset_callback(struct socket *sock, ksock_conn_t *conn) ksocknal_lib_reset_callback() argument
678 sock->sk->sk_data_ready = conn->ksnc_saved_data_ready; ksocknal_lib_reset_callback()
679 sock->sk->sk_write_space = conn->ksnc_saved_write_space; ksocknal_lib_reset_callback()
684 sock->sk->sk_user_data = NULL; ksocknal_lib_reset_callback()
/linux-4.1.27/drivers/block/
H A Dnbd.c32 #include <net/sock.h>
45 struct socket * sock; /* If == NULL, device is not ready, yet */ member in struct:nbd_device
120 if (nbd->sock) { sock_shutdown()
122 kernel_sock_shutdown(nbd->sock, SHUT_RDWR); sock_shutdown()
123 nbd->sock = NULL; sock_shutdown()
144 struct socket *sock = nbd->sock; sock_xmit() local
151 if (unlikely(!sock)) { sock_xmit()
165 sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC; sock_xmit()
184 result = kernel_sendmsg(sock, &msg, &iov, 1, size); sock_xmit()
188 result = kernel_recvmsg(sock, &msg, &iov, 1, size, sock_xmit()
398 sk_set_memalloc(nbd->sock->sk); nbd_do_it()
422 * Because we have set nbd->sock to NULL under the tx_lock, all nbd_clear_que()
429 BUG_ON(nbd->sock); nbd_clear_que()
477 if (unlikely(!nbd->sock)) { nbd_handle_req()
559 if (unlikely(!nbd->sock)) {
588 if (!nbd->sock) __nbd_ioctl()
599 if (!nbd->sock) __nbd_ioctl()
609 struct socket *sock = nbd->sock; __nbd_ioctl() local
610 nbd->sock = NULL; __nbd_ioctl()
615 if (sock) __nbd_ioctl()
616 sockfd_put(sock); __nbd_ioctl()
621 struct socket *sock; __nbd_ioctl() local
623 if (nbd->sock) __nbd_ioctl()
625 sock = sockfd_lookup(arg, &err); __nbd_ioctl()
626 if (sock) { __nbd_ioctl()
627 nbd->sock = sock; __nbd_ioctl()
668 struct socket *sock; __nbd_ioctl() local
673 if (!nbd->sock) __nbd_ioctl()
702 sock = nbd->sock; __nbd_ioctl()
703 nbd->sock = NULL; __nbd_ioctl()
709 if (sock) __nbd_ioctl()
710 sockfd_put(sock); __nbd_ioctl()
/linux-4.1.27/net/can/
H A Draw.c55 #include <net/sock.h>
84 struct sock sk;
113 static inline struct raw_sock *raw_sk(const struct sock *sk) raw_sk()
120 struct sock *sk = (struct sock *)data; raw_rcv()
126 /* check the received tx sock reference */ raw_rcv()
184 static int raw_enable_filters(struct net_device *dev, struct sock *sk, raw_enable_filters()
207 static int raw_enable_errfilter(struct net_device *dev, struct sock *sk, raw_enable_errfilter()
219 static void raw_disable_filters(struct net_device *dev, struct sock *sk, raw_disable_filters()
230 struct sock *sk, raw_disable_errfilter()
240 struct sock *sk) raw_disable_allfilters()
248 static int raw_enable_allfilters(struct net_device *dev, struct sock *sk) raw_enable_allfilters()
268 struct sock *sk = &ro->sk; raw_notifier()
310 static int raw_init(struct sock *sk) raw_init()
342 static int raw_release(struct socket *sock) raw_release() argument
344 struct sock *sk = sock->sk; raw_release()
379 sock->sk = NULL; raw_release()
387 static int raw_bind(struct socket *sock, struct sockaddr *uaddr, int len) raw_bind() argument
390 struct sock *sk = sock->sk; raw_bind()
462 static int raw_getname(struct socket *sock, struct sockaddr *uaddr, raw_getname() argument
466 struct sock *sk = sock->sk; raw_getname()
481 static int raw_setsockopt(struct socket *sock, int level, int optname, raw_setsockopt() argument
484 struct sock *sk = sock->sk; raw_setsockopt()
636 static int raw_getsockopt(struct socket *sock, int level, int optname, raw_getsockopt() argument
639 struct sock *sk = sock->sk; raw_getsockopt()
711 static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) raw_sendmsg() argument
713 struct sock *sk = sock->sk; raw_sendmsg()
781 static int raw_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, raw_recvmsg() argument
784 struct sock *sk = sock->sk; raw_recvmsg()
/linux-4.1.27/net/caif/
H A Dcaif_socket.c23 #include <net/sock.h>
47 struct sock sk; /* must be first member */
92 static void caif_read_lock(struct sock *sk) caif_read_lock()
99 static void caif_read_unlock(struct sock *sk) caif_read_unlock()
112 static void caif_flow_ctrl(struct sock *sk, int mode) caif_flow_ctrl()
121 * Copied from sock.c:sock_queue_rcv_skb(), but changed so packets are
124 static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) caif_queue_rcv_skb()
257 static void caif_check_flow_release(struct sock *sk) caif_check_flow_release()
274 static int caif_seqpkt_recvmsg(struct socket *sock, struct msghdr *m, caif_seqpkt_recvmsg() argument
278 struct sock *sk = sock->sk; caif_seqpkt_recvmsg()
312 static long caif_stream_data_wait(struct sock *sk, long timeo) caif_stream_data_wait()
350 static int caif_stream_recvmsg(struct socket *sock, struct msghdr *msg, caif_stream_recvmsg() argument
353 struct sock *sk = sock->sk; caif_stream_recvmsg()
464 * Copied from sock.c:sock_wait_for_wmem, but change to wait for
470 struct sock *sk = &cf_sk->sk; caif_wait_for_flow_on()
521 static int caif_seqpkt_sendmsg(struct socket *sock, struct msghdr *msg, caif_seqpkt_sendmsg() argument
524 struct sock *sk = sock->sk; caif_seqpkt_sendmsg()
596 static int caif_stream_sendmsg(struct socket *sock, struct msghdr *msg, caif_stream_sendmsg() argument
599 struct sock *sk = sock->sk; caif_stream_sendmsg()
675 static int setsockopt(struct socket *sock, setsockopt() argument
678 struct sock *sk = sock->sk; setsockopt()
744 * o sock->state: holds the SS_* socket state and is updated by connect and
747 static int caif_connect(struct socket *sock, struct sockaddr *uaddr, caif_connect() argument
750 struct sock *sk = sock->sk; caif_connect()
764 switch (sock->state) { caif_connect()
772 sock->state = SS_CONNECTED; caif_connect()
803 sock->state = SS_UNCONNECTED; caif_connect()
814 sock->state = SS_CONNECTING; caif_connect()
880 sock->state = SS_UNCONNECTED; caif_connect()
886 sock->state = SS_CONNECTED; caif_connect()
897 static int caif_release(struct socket *sock) caif_release() argument
899 struct sock *sk = sock->sk; caif_release()
910 * this ensures no packets when sock is dead. caif_release()
915 sock->sk = NULL; caif_release()
937 struct socket *sock, poll_table *wait) caif_poll()
939 struct sock *sk = sock->sk; caif_poll()
1012 static void caif_sock_destructor(struct sock *sk) caif_sock_destructor()
1026 static int caif_create(struct net *net, struct socket *sock, int protocol, caif_create() argument
1029 struct sock *sk = NULL; caif_create()
1039 * The sock->type specifies the socket type to use. caif_create()
1044 if (sock->type == SOCK_SEQPACKET) caif_create()
1045 sock->ops = &caif_seqpacket_ops; caif_create()
1046 else if (sock->type == SOCK_STREAM) caif_create()
1047 sock->ops = &caif_stream_ops; caif_create()
1056 * initialization makes sure that sock->state is not uninitialized. caif_create()
1085 /* Initialize the nozero default sock structure data. */ caif_create()
1086 sock_init_data(sock, sk); caif_create()
936 caif_poll(struct file *file, struct socket *sock, poll_table *wait) caif_poll() argument
/linux-4.1.27/drivers/vhost/
H A Dnet.c29 #include <net/sock.h>
228 static bool vhost_sock_zcopy(struct socket *sock) vhost_sock_zcopy() argument
231 sock_flag(sock->sk, SOCK_ZEROCOPY); vhost_sock_zcopy()
309 struct socket *sock; handle_tx() local
314 sock = vq->private_data; handle_tx()
315 if (!sock) handle_tx()
393 err = sock->ops->sendmsg(sock, &msg, len); handle_tx()
421 static int peek_head_len(struct sock *sk) peek_head_len()
540 struct socket *sock; handle_rx() local
545 sock = vq->private_data; handle_rx()
546 if (!sock) handle_rx()
557 while ((sock_len = peek_head_len(sock->sk))) { handle_rx()
569 err = sock->ops->recvmsg(sock, &msg, handle_rx()
595 err = sock->ops->recvmsg(sock, &msg, handle_rx()
735 struct socket *sock; vhost_net_enable_vq() local
737 sock = vq->private_data; vhost_net_enable_vq()
738 if (!sock) vhost_net_enable_vq()
741 return vhost_poll_start(poll, sock->file); vhost_net_enable_vq()
747 struct socket *sock; vhost_net_stop_vq() local
750 sock = vq->private_data; vhost_net_stop_vq()
754 return sock; vhost_net_stop_vq()
819 struct socket *sock = sockfd_lookup(fd, &r); get_raw_socket() local
821 if (!sock) get_raw_socket()
825 if (sock->sk->sk_type != SOCK_RAW) { get_raw_socket()
830 r = sock->ops->getname(sock, (struct sockaddr *)&uaddr.sa, get_raw_socket()
839 return sock; get_raw_socket()
841 sockfd_put(sock); get_raw_socket()
848 struct socket *sock; get_tap_socket() local
852 sock = tun_get_socket(file); get_tap_socket()
853 if (!IS_ERR(sock)) get_tap_socket()
854 return sock; get_tap_socket()
855 sock = macvtap_get_socket(file); get_tap_socket()
856 if (IS_ERR(sock)) get_tap_socket()
858 return sock; get_tap_socket()
863 struct socket *sock; get_socket() local
868 sock = get_raw_socket(fd); get_socket()
869 if (!IS_ERR(sock)) get_socket()
870 return sock; get_socket()
871 sock = get_tap_socket(fd); get_socket()
872 if (!IS_ERR(sock)) get_socket()
873 return sock; get_socket()
879 struct socket *sock, *oldsock; vhost_net_set_backend() local
903 sock = get_socket(fd); vhost_net_set_backend()
904 if (IS_ERR(sock)) { vhost_net_set_backend()
905 r = PTR_ERR(sock); vhost_net_set_backend()
911 if (sock != oldsock) { vhost_net_set_backend()
913 sock && vhost_sock_zcopy(sock)); vhost_net_set_backend()
920 vq->private_data = sock; vhost_net_set_backend()
959 sockfd_put(sock); vhost_net_set_backend()
/linux-4.1.27/net/sunrpc/
H A Dxprtsock.c45 #include <net/sock.h>
219 static inline struct rpc_xprt *xprt_from_sock(struct sock *sk) xprt_from_sock()
326 static int xs_send_kvec(struct socket *sock, struct sockaddr *addr, int addrlen, struct kvec *vec, unsigned int base, int more) xs_send_kvec() argument
339 return kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len); xs_send_kvec()
340 return kernel_sendmsg(sock, &msg, NULL, 0, 0); xs_send_kvec()
343 static int xs_send_pagedata(struct socket *sock, struct xdr_buf *xdr, unsigned int base, int more, bool zerocopy, int *sent_p) xs_send_pagedata() argument
345 ssize_t (*do_sendpage)(struct socket *sock, struct page *page, xs_send_pagedata()
355 do_sendpage = sock->ops->sendpage; xs_send_pagedata()
365 err = do_sendpage(sock, *ppage, base, len, flags); xs_send_pagedata()
381 * @sock: socket to send on
390 static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, struct xdr_buf *xdr, unsigned int base, bool zerocopy, int *sent_p) xs_sendpages() argument
396 if (unlikely(!sock)) xs_sendpages()
399 clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags); xs_sendpages()
408 err = xs_send_kvec(sock, addr, addrlen, &xdr->head[0], base, remainder != 0); xs_sendpages()
419 err = xs_send_pagedata(sock, xdr, base, remainder != 0, zerocopy, &sent); xs_sendpages()
429 err = xs_send_kvec(sock, NULL, 0, &xdr->tail[0], base, 0); xs_sendpages()
443 clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); xs_nospace_callback()
456 struct sock *sk = transport->inet; xs_nospace()
468 if (test_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags)) { xs_nospace()
473 set_bit(SOCK_NOSPACE, &transport->sock->flags); xs_nospace()
479 clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); xs_nospace()
526 status = xs_sendpages(transport->sock, NULL, 0, xdr, req->rq_bytes_sent, xs_local_send_request()
582 status = xs_sendpages(transport->sock, xs_addr(xprt), xprt->addrlen, xs_udp_send_request()
619 clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); xs_udp_send_request()
635 struct socket *sock = transport->sock; xs_tcp_shutdown() local
637 if (sock != NULL) { xs_tcp_shutdown()
638 kernel_sock_shutdown(sock, SHUT_RDWR); xs_tcp_shutdown()
639 trace_rpc_socket_shutdown(xprt, sock); xs_tcp_shutdown()
684 status = xs_sendpages(transport->sock, NULL, 0, xdr, xs_tcp_send_request()
725 clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); xs_tcp_send_request()
760 static void xs_save_old_callbacks(struct sock_xprt *transport, struct sock *sk) xs_save_old_callbacks()
768 static void xs_restore_old_callbacks(struct sock_xprt *transport, struct sock *sk) xs_restore_old_callbacks()
798 static void xs_error_report(struct sock *sk) xs_error_report()
823 struct socket *sock = transport->sock; xs_reset_transport() local
824 struct sock *sk = transport->inet; xs_reset_transport()
832 transport->sock = NULL; xs_reset_transport()
841 trace_rpc_socket_close(xprt, sock); xs_reset_transport()
842 sock_release(sock); xs_reset_transport()
909 static void xs_local_data_ready(struct sock *sk) xs_local_data_ready()
972 static void xs_udp_data_ready(struct sock *sk) xs_udp_data_ready()
1396 static void xs_tcp_data_ready(struct sock *sk) xs_tcp_data_ready()
1434 static void xs_tcp_state_change(struct sock *sk) xs_tcp_state_change()
1509 static void xs_write_space(struct sock *sk) xs_write_space()
1511 struct socket *sock; xs_write_space() local
1514 if (unlikely(!(sock = sk->sk_socket))) xs_write_space()
1516 clear_bit(SOCK_NOSPACE, &sock->flags); xs_write_space()
1520 if (test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags) == 0) xs_write_space()
1536 static void xs_udp_write_space(struct sock *sk) xs_udp_write_space()
1540 /* from net/core/sock.c:sock_def_write_space */ xs_udp_write_space()
1557 static void xs_tcp_write_space(struct sock *sk) xs_tcp_write_space()
1571 struct sock *sk = transport->inet; xs_udp_do_set_buffer_size()
1626 * @sock: socket
1631 static void xs_sock_set_reuseport(struct socket *sock) xs_sock_set_reuseport() argument
1635 kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, xs_sock_set_reuseport()
1639 static unsigned short xs_sock_getport(struct socket *sock) xs_sock_getport() argument
1645 if (kernel_getsockname(sock, (struct sockaddr *)&buf, &buflen) < 0) xs_sock_getport()
1672 static void xs_set_srcport(struct sock_xprt *transport, struct socket *sock) xs_set_srcport() argument
1675 transport->srcport = xs_sock_getport(sock); xs_set_srcport()
1697 static int xs_bind(struct sock_xprt *transport, struct socket *sock) xs_bind() argument
1725 err = kernel_bind(sock, (struct sockaddr *)&myaddr, xs_bind()
1766 static inline void xs_reclassify_socketu(struct socket *sock) xs_reclassify_socketu() argument
1768 struct sock *sk = sock->sk; xs_reclassify_socketu()
1774 static inline void xs_reclassify_socket4(struct socket *sock) xs_reclassify_socket4() argument
1776 struct sock *sk = sock->sk; xs_reclassify_socket4()
1782 static inline void xs_reclassify_socket6(struct socket *sock) xs_reclassify_socket6() argument
1784 struct sock *sk = sock->sk; xs_reclassify_socket6()
1790 static inline void xs_reclassify_socket(int family, struct socket *sock) xs_reclassify_socket() argument
1792 WARN_ON_ONCE(sock_owned_by_user(sock->sk)); xs_reclassify_socket()
1793 if (sock_owned_by_user(sock->sk)) xs_reclassify_socket()
1798 xs_reclassify_socketu(sock); xs_reclassify_socket()
1801 xs_reclassify_socket4(sock); xs_reclassify_socket()
1804 xs_reclassify_socket6(sock); xs_reclassify_socket()
1809 static inline void xs_reclassify_socketu(struct socket *sock) xs_reclassify_socketu() argument
1813 static inline void xs_reclassify_socket4(struct socket *sock) xs_reclassify_socket4() argument
1817 static inline void xs_reclassify_socket6(struct socket *sock) xs_reclassify_socket6() argument
1821 static inline void xs_reclassify_socket(int family, struct socket *sock) xs_reclassify_socket() argument
1834 struct socket *sock; xs_create_sock() local
1837 err = __sock_create(xprt->xprt_net, family, type, protocol, &sock, 1); xs_create_sock()
1843 xs_reclassify_socket(family, sock); xs_create_sock()
1846 xs_sock_set_reuseport(sock); xs_create_sock()
1848 err = xs_bind(transport, sock); xs_create_sock()
1850 sock_release(sock); xs_create_sock()
1854 return sock; xs_create_sock()
1860 struct socket *sock) xs_local_finish_connecting()
1866 struct sock *sk = sock->sk; xs_local_finish_connecting()
1881 transport->sock = sock; xs_local_finish_connecting()
1890 return kernel_connect(sock, xs_addr(xprt), xprt->addrlen, 0); xs_local_finish_connecting()
1902 struct socket *sock; xs_local_setup_socket() local
1906 SOCK_STREAM, 0, &sock, 1); xs_local_setup_socket()
1912 xs_reclassify_socketu(sock); xs_local_setup_socket()
1917 status = xs_local_finish_connecting(xprt, sock); xs_local_setup_socket()
1918 trace_rpc_socket_connect(xprt, sock, status); xs_local_setup_socket()
2008 static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) xs_udp_finish_connecting() argument
2013 struct sock *sk = sock->sk; xs_udp_finish_connecting()
2027 transport->sock = sock; xs_udp_finish_connecting()
2042 struct socket *sock = transport->sock; xs_udp_setup_socket() local
2045 sock = xs_create_sock(xprt, transport, xs_udp_setup_socket()
2048 if (IS_ERR(sock)) xs_udp_setup_socket()
2057 xs_udp_finish_connecting(xprt, sock); xs_udp_setup_socket()
2058 trace_rpc_socket_connect(xprt, sock, 0); xs_udp_setup_socket()
2066 static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) xs_tcp_finish_connecting() argument
2072 struct sock *sk = sock->sk; xs_tcp_finish_connecting()
2078 kernel_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, xs_tcp_finish_connecting()
2080 kernel_setsockopt(sock, SOL_TCP, TCP_KEEPIDLE, xs_tcp_finish_connecting()
2082 kernel_setsockopt(sock, SOL_TCP, TCP_KEEPINTVL, xs_tcp_finish_connecting()
2084 kernel_setsockopt(sock, SOL_TCP, TCP_KEEPCNT, xs_tcp_finish_connecting()
2105 transport->sock = sock; xs_tcp_finish_connecting()
2120 ret = kernel_connect(sock, xs_addr(xprt), xprt->addrlen, O_NONBLOCK); xs_tcp_finish_connecting()
2123 xs_set_srcport(transport, sock); xs_tcp_finish_connecting()
2145 struct socket *sock = transport->sock; xs_tcp_setup_socket() local
2149 if (!sock) { xs_tcp_setup_socket()
2150 sock = xs_create_sock(xprt, transport, xs_tcp_setup_socket()
2153 if (IS_ERR(sock)) { xs_tcp_setup_socket()
2154 status = PTR_ERR(sock); xs_tcp_setup_socket()
2165 status = xs_tcp_finish_connecting(xprt, sock); xs_tcp_setup_socket()
2166 trace_rpc_socket_connect(xprt, sock, status); xs_tcp_setup_socket()
2167 dprintk("RPC: %p connect status %d connected %d sock state %d\n", xs_tcp_setup_socket()
2169 sock->sk->sk_state); xs_tcp_setup_socket()
2225 if (transport->sock != NULL) { xs_connect()
2381 struct socket *sock = transport->sock; bc_sendto() local
2389 len = svc_send_common(sock, xbufp, bc_sendto()
2879 transport->sock = bc_sock->sk_sock; xs_setup_bc_tcp()
1859 xs_local_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) xs_local_finish_connecting() argument
H A Dsvcsock.c38 #include <net/sock.h>
63 static void svc_udp_data_ready(struct sock *);
84 static void svc_reclassify_socket(struct socket *sock) svc_reclassify_socket() argument
86 struct sock *sk = sock->sk; svc_reclassify_socket()
112 static void svc_reclassify_socket(struct socket *sock) svc_reclassify_socket() argument
175 int svc_send_common(struct socket *sock, struct xdr_buf *xdr, svc_send_common() argument
193 len = kernel_sendpage(sock, headpage, headoffset, svc_send_common()
206 result = kernel_sendpage(sock, *ppage, base, size, flags); svc_send_common()
220 result = kernel_sendpage(sock, tailpage, tailoffset, svc_send_common()
238 struct socket *sock = svsk->sk_sock; svc_sendto() local
260 if (sock_sendmsg(sock, &msg) < 0) svc_sendto()
266 len = svc_send_common(sock, xdr, rqstp->rq_respages[0], headoff, svc_sendto()
282 const struct sock *sk = svsk->sk_sk; svc_one_sock_name()
373 static void svc_sock_setbufsize(struct socket *sock, unsigned int snd, svc_sock_setbufsize() argument
379 sock_setsockopt(sock, SOL_SOCKET, SO_SNDBUF, svc_sock_setbufsize()
381 sock_setsockopt(sock, SOL_SOCKET, SO_RCVBUF, svc_sock_setbufsize()
389 lock_sock(sock->sk); svc_sock_setbufsize()
390 sock->sk->sk_sndbuf = snd * 2; svc_sock_setbufsize()
391 sock->sk->sk_rcvbuf = rcv * 2; svc_sock_setbufsize()
392 sock->sk->sk_write_space(sock->sk); svc_sock_setbufsize()
393 release_sock(sock->sk); svc_sock_setbufsize()
405 static void svc_udp_data_ready(struct sock *sk) svc_udp_data_ready()
424 static void svc_write_space(struct sock *sk) svc_write_space()
459 static void svc_tcp_write_space(struct sock *sk) svc_tcp_write_space()
462 struct socket *sock = sk->sk_socket; svc_tcp_write_space() local
464 if (!sk_stream_is_writeable(sk) || !sock) svc_tcp_write_space()
467 clear_bit(SOCK_NOSPACE, &sock->flags); svc_tcp_write_space()
674 * sock space. svc_udp_has_wspace()
763 static void svc_tcp_listen_data_ready(struct sock *sk) svc_tcp_listen_data_ready()
797 static void svc_tcp_state_change(struct sock *sk) svc_tcp_state_change()
815 static void svc_tcp_data_ready(struct sock *sk) svc_tcp_data_ready()
839 struct socket *sock = svsk->sk_sock; svc_tcp_accept() local
845 dprintk("svc: tcp_accept %p sock %p\n", svsk, sock); svc_tcp_accept()
846 if (!sock) svc_tcp_accept()
850 err = kernel_accept(sock, &newsock, O_NONBLOCK); svc_tcp_accept()
1324 struct sock *sk = svsk->sk_sk; svc_tcp_init()
1373 struct socket *sock, svc_setup_socket()
1377 struct sock *inet; svc_setup_socket()
1381 dprintk("svc: svc_setup_socket %p\n", sock); svc_setup_socket()
1386 inet = sock->sk; svc_setup_socket()
1390 err = svc_register(serv, sock_net(sock->sk), inet->sk_family, svc_setup_socket()
1400 svsk->sk_sock = sock; svc_setup_socket()
1407 if (sock->type == SOCK_DGRAM) svc_setup_socket()
1427 struct socket *sock = sockfd_lookup(fd, &err); svc_alien_sock() local
1430 if (!sock) svc_alien_sock()
1432 if (sock_net(sock->sk) != net) svc_alien_sock()
1434 sockfd_put(sock); svc_alien_sock()
1502 struct socket *sock; svc_create_socket() local
1534 error = __sock_create(net, family, type, protocol, &sock, 1); svc_create_socket()
1538 svc_reclassify_socket(sock); svc_create_socket()
1547 kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY, svc_create_socket()
1551 sock->sk->sk_reuse = SK_CAN_REUSE; /* allow address reuse */ svc_create_socket()
1552 error = kernel_bind(sock, sin, len); svc_create_socket()
1557 error = kernel_getsockname(sock, newsin, &newlen); svc_create_socket()
1562 if ((error = kernel_listen(sock, 64)) < 0) svc_create_socket()
1566 svsk = svc_setup_socket(serv, sock, flags); svc_create_socket()
1575 sock_release(sock); svc_create_socket()
1586 struct sock *sk = svsk->sk_sk; svc_sock_detach()
1372 svc_setup_socket(struct svc_serv *serv, struct socket *sock, int flags) svc_setup_socket() argument
/linux-4.1.27/net/netfilter/
H A Dnf_sockopt.c7 #include <net/sock.h>
61 static struct nf_sockopt_ops *nf_sockopt_find(struct sock *sk, u_int8_t pf, nf_sockopt_find()
92 static int nf_sockopt(struct sock *sk, u_int8_t pf, int val, nf_sockopt()
111 int nf_setsockopt(struct sock *sk, u_int8_t pf, int val, char __user *opt, nf_setsockopt()
118 int nf_getsockopt(struct sock *sk, u_int8_t pf, int val, char __user *opt, nf_getsockopt()
126 static int compat_nf_sockopt(struct sock *sk, u_int8_t pf, int val, compat_nf_sockopt()
152 int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, compat_nf_setsockopt()
159 int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, compat_nf_getsockopt()
/linux-4.1.27/include/net/irda/
H A Daf_irda.h36 #include <net/sock.h>
40 /* struct sock has to be the first member of irda_sock */
41 struct sock sk;
82 static inline struct irda_sock *irda_sk(struct sock *sk) irda_sk()
/linux-4.1.27/net/packet/
H A Dinternal.h84 struct sock *arr[PACKET_FANOUT_MAX];
92 /* struct sock has to be the first member of packet_sock */
93 struct sock sk;
120 static struct packet_sock *pkt_sk(struct sock *sk) pkt_sk()
/linux-4.1.27/include/linux/can/
H A Dskb.h16 #include <net/sock.h>
49 static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk) can_skb_set_owner()
59 * returns an unshared skb owned by the original sock to be echo'ed back
/linux-4.1.27/security/
H A Dsecurity.c1108 int security_netlink_send(struct sock *sk, struct sk_buff *skb) security_netlink_send()
1157 int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk) security_unix_stream_connect() argument
1159 return security_ops->unix_stream_connect(sock, other, newsk); security_unix_stream_connect()
1163 int security_unix_may_send(struct socket *sock, struct socket *other) security_unix_may_send() argument
1165 return security_ops->unix_may_send(sock, other); security_unix_may_send()
1174 int security_socket_post_create(struct socket *sock, int family, security_socket_post_create() argument
1177 return security_ops->socket_post_create(sock, family, type, security_socket_post_create()
1181 int security_socket_bind(struct socket *sock, struct sockaddr *address, int addrlen) security_socket_bind() argument
1183 return security_ops->socket_bind(sock, address, addrlen); security_socket_bind()
1186 int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen) security_socket_connect() argument
1188 return security_ops->socket_connect(sock, address, addrlen); security_socket_connect()
1191 int security_socket_listen(struct socket *sock, int backlog) security_socket_listen() argument
1193 return security_ops->socket_listen(sock, backlog); security_socket_listen()
1196 int security_socket_accept(struct socket *sock, struct socket *newsock) security_socket_accept() argument
1198 return security_ops->socket_accept(sock, newsock); security_socket_accept()
1201 int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size) security_socket_sendmsg() argument
1203 return security_ops->socket_sendmsg(sock, msg, size); security_socket_sendmsg()
1206 int security_socket_recvmsg(struct socket *sock, struct msghdr *msg, security_socket_recvmsg() argument
1209 return security_ops->socket_recvmsg(sock, msg, size, flags); security_socket_recvmsg()
1212 int security_socket_getsockname(struct socket *sock) security_socket_getsockname() argument
1214 return security_ops->socket_getsockname(sock); security_socket_getsockname()
1217 int security_socket_getpeername(struct socket *sock) security_socket_getpeername() argument
1219 return security_ops->socket_getpeername(sock); security_socket_getpeername()
1222 int security_socket_getsockopt(struct socket *sock, int level, int optname) security_socket_getsockopt() argument
1224 return security_ops->socket_getsockopt(sock, level, optname); security_socket_getsockopt()
1227 int security_socket_setsockopt(struct socket *sock, int level, int optname) security_socket_setsockopt() argument
1229 return security_ops->socket_setsockopt(sock, level, optname); security_socket_setsockopt()
1232 int security_socket_shutdown(struct socket *sock, int how) security_socket_shutdown() argument
1234 return security_ops->socket_shutdown(sock, how); security_socket_shutdown()
1237 int security_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) security_sock_rcv_skb()
1243 int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, security_socket_getpeersec_stream() argument
1246 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len); security_socket_getpeersec_stream()
1249 int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid) security_socket_getpeersec_dgram() argument
1251 return security_ops->socket_getpeersec_dgram(sock, skb, secid); security_socket_getpeersec_dgram()
1255 int security_sk_alloc(struct sock *sk, int family, gfp_t priority) security_sk_alloc()
1260 void security_sk_free(struct sock *sk) security_sk_free()
1265 void security_sk_clone(const struct sock *sk, struct sock *newsk) security_sk_clone()
1271 void security_sk_classify_flow(struct sock *sk, struct flowi *fl) security_sk_classify_flow()
1283 void security_sock_graft(struct sock *sk, struct socket *parent) security_sock_graft()
1289 int security_inet_conn_request(struct sock *sk, security_inet_conn_request()
1296 void security_inet_csk_clone(struct sock *newsk, security_inet_csk_clone()
1302 void security_inet_conn_established(struct sock *sk, security_inet_conn_established()
1350 int security_tun_dev_attach(struct sock *sk, void *security) security_tun_dev_attach()
H A Dcapability.c599 static int cap_unix_stream_connect(struct sock *sock, struct sock *other, cap_unix_stream_connect() argument
600 struct sock *newsk) cap_unix_stream_connect()
605 static int cap_unix_may_send(struct socket *sock, struct socket *other) cap_unix_may_send() argument
615 static int cap_socket_post_create(struct socket *sock, int family, int type, cap_socket_post_create() argument
621 static int cap_socket_bind(struct socket *sock, struct sockaddr *address, cap_socket_bind() argument
627 static int cap_socket_connect(struct socket *sock, struct sockaddr *address, cap_socket_connect() argument
633 static int cap_socket_listen(struct socket *sock, int backlog) cap_socket_listen() argument
638 static int cap_socket_accept(struct socket *sock, struct socket *newsock) cap_socket_accept() argument
643 static int cap_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size) cap_socket_sendmsg() argument
648 static int cap_socket_recvmsg(struct socket *sock, struct msghdr *msg, cap_socket_recvmsg() argument
654 static int cap_socket_getsockname(struct socket *sock) cap_socket_getsockname() argument
659 static int cap_socket_getpeername(struct socket *sock) cap_socket_getpeername() argument
664 static int cap_socket_setsockopt(struct socket *sock, int level, int optname) cap_socket_setsockopt() argument
669 static int cap_socket_getsockopt(struct socket *sock, int level, int optname) cap_socket_getsockopt() argument
674 static int cap_socket_shutdown(struct socket *sock, int how) cap_socket_shutdown() argument
679 static int cap_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) cap_socket_sock_rcv_skb()
684 static int cap_socket_getpeersec_stream(struct socket *sock, cap_socket_getpeersec_stream() argument
691 static int cap_socket_getpeersec_dgram(struct socket *sock, cap_socket_getpeersec_dgram() argument
697 static int cap_sk_alloc_security(struct sock *sk, int family, gfp_t priority) cap_sk_alloc_security()
702 static void cap_sk_free_security(struct sock *sk) cap_sk_free_security()
706 static void cap_sk_clone_security(const struct sock *sk, struct sock *newsk) cap_sk_clone_security()
710 static void cap_sk_getsecid(struct sock *sk, u32 *secid) cap_sk_getsecid()
714 static void cap_sock_graft(struct sock *sk, struct socket *parent) cap_sock_graft()
718 static int cap_inet_conn_request(struct sock *sk, struct sk_buff *skb, cap_inet_conn_request()
724 static void cap_inet_csk_clone(struct sock *newsk, cap_inet_csk_clone()
729 static void cap_inet_conn_established(struct sock *sk, struct sk_buff *skb) cap_inet_conn_established()
770 static int cap_tun_dev_attach(struct sock *sk, void *security) cap_tun_dev_attach()
/linux-4.1.27/net/ax25/
H A Daf_ax25.c34 #include <net/sock.h>
59 static void ax25_free_sock(struct sock *sk) ax25_free_sock()
156 struct sock *ax25_find_listener(ax25_address *addr, int digi, ax25_find_listener()
183 struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr, ax25_get_socket()
186 struct sock *sk = NULL; ax25_get_socket()
275 struct sock *sk; ax25_destroy_timer()
335 struct sock *sk=ax25->sk; ax25_destroy_socket()
535 static int ax25_setsockopt(struct socket *sock, int level, int optname, ax25_setsockopt() argument
538 struct sock *sk = sock->sk; ax25_setsockopt()
652 (sock->state != SS_UNCONNECTED || ax25_setsockopt()
677 static int ax25_getsockopt(struct socket *sock, int level, int optname, ax25_getsockopt() argument
680 struct sock *sk = sock->sk; ax25_getsockopt()
774 static int ax25_listen(struct socket *sock, int backlog) ax25_listen() argument
776 struct sock *sk = sock->sk; ax25_listen()
800 .obj_size = sizeof(struct sock),
803 static int ax25_create(struct net *net, struct socket *sock, int protocol, ax25_create() argument
806 struct sock *sk; ax25_create()
815 switch (sock->type) { ax25_create()
871 sock_init_data(sock, sk); ax25_create()
874 sock->ops = &ax25_proto_ops; ax25_create()
882 struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev) ax25_make_new()
884 struct sock *sk; ax25_make_new()
952 static int ax25_release(struct socket *sock) ax25_release() argument
954 struct sock *sk = sock->sk; ax25_release()
1025 sock->sk = NULL; ax25_release()
1038 static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ax25_bind() argument
1040 struct sock *sk = sock->sk; ax25_bind()
1116 static int __must_check ax25_connect(struct socket *sock, ax25_connect() argument
1119 struct sock *sk = sock->sk; ax25_connect()
1149 if (sock->state == SS_CONNECTING) { ax25_connect()
1156 sock->state = SS_CONNECTED; ax25_connect()
1160 sock->state = SS_UNCONNECTED; ax25_connect()
1172 sock->state = SS_UNCONNECTED; ax25_connect()
1247 sock->state = SS_CONNECTED; ax25_connect()
1253 sock->state = SS_CONNECTING; ax25_connect()
1309 sock->state = SS_UNCONNECTED; ax25_connect()
1314 sock->state = SS_CONNECTED; ax25_connect()
1323 static int ax25_accept(struct socket *sock, struct socket *newsock, int flags) ax25_accept() argument
1326 struct sock *newsk; ax25_accept()
1328 struct sock *sk; ax25_accept()
1331 if (sock->state != SS_UNCONNECTED) ax25_accept()
1334 if ((sk = sock->sk) == NULL) ax25_accept()
1390 static int ax25_getname(struct socket *sock, struct sockaddr *uaddr, ax25_getname() argument
1394 struct sock *sk = sock->sk; ax25_getname()
1438 static int ax25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) ax25_sendmsg() argument
1441 struct sock *sk = sock->sk; ax25_sendmsg()
1604 static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, ax25_recvmsg() argument
1607 struct sock *sk = sock->sk; ax25_recvmsg()
1682 static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ax25_ioctl() argument
1684 struct sock *sk = sock->sk; ax25_ioctl()
/linux-4.1.27/net/netfilter/ipvs/
H A Dip_vs_sync.c55 #include <net/sock.h>
197 struct socket *sock; member in struct:ip_vs_sync_thread_data
1277 static void set_sock_size(struct sock *sk, int mode, int val) set_sock_size()
1279 /* setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &val, sizeof(val)); */ set_sock_size()
1280 /* setsockopt(sock, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)); */ set_sock_size()
1299 static void set_mcast_loop(struct sock *sk, u_char loop) set_mcast_loop()
1303 /* setsockopt(sock, SOL_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); */ set_mcast_loop()
1312 static void set_mcast_ttl(struct sock *sk, u_char ttl) set_mcast_ttl()
1316 /* setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); */ set_mcast_ttl()
1325 static int set_mcast_if(struct sock *sk, char *ifname) set_mcast_if()
1390 join_mcast_group(struct sock *sk, struct in_addr *addr, char *ifname) join_mcast_group()
1418 static int bind_mcastif_addr(struct socket *sock, char *ifname) bind_mcastif_addr() argument
1420 struct net *net = sock_net(sock->sk); bind_mcastif_addr()
1442 return sock->ops->bind(sock, (struct sockaddr*)&sin, sizeof(sin)); bind_mcastif_addr()
1457 struct socket *sock; make_send_sock() local
1461 result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock); make_send_sock()
1471 sk_change_net(sock->sk, net); make_send_sock()
1472 result = set_mcast_if(sock->sk, ipvs->master_mcast_ifn); make_send_sock()
1478 set_mcast_loop(sock->sk, 0); make_send_sock()
1479 set_mcast_ttl(sock->sk, 1); make_send_sock()
1482 set_sock_size(sock->sk, 1, result); make_send_sock()
1484 result = bind_mcastif_addr(sock, ipvs->master_mcast_ifn); make_send_sock()
1490 result = sock->ops->connect(sock, (struct sockaddr *) &mcast_addr, make_send_sock()
1497 return sock; make_send_sock()
1500 sk_release_kernel(sock->sk); make_send_sock()
1517 struct socket *sock; make_receive_sock() local
1521 result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock); make_receive_sock()
1531 sk_change_net(sock->sk, net); make_receive_sock()
1533 sock->sk->sk_reuse = SK_CAN_REUSE; make_receive_sock()
1536 set_sock_size(sock->sk, 0, result); make_receive_sock()
1538 result = sock->ops->bind(sock, (struct sockaddr *) &mcast_addr, make_receive_sock()
1546 result = join_mcast_group(sock->sk, make_receive_sock()
1554 return sock; make_receive_sock()
1557 sk_release_kernel(sock->sk); make_receive_sock()
1563 ip_vs_send_async(struct socket *sock, const char *buffer, const size_t length) ip_vs_send_async() argument
1573 len = kernel_sendmsg(sock, &msg, &iov, 1, (size_t)(length)); ip_vs_send_async()
1580 ip_vs_send_sync_msg(struct socket *sock, struct ip_vs_sync_mesg *msg) ip_vs_send_sync_msg() argument
1587 ret = ip_vs_send_async(sock, (char *)msg, msize); ip_vs_send_sync_msg()
1595 ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen) ip_vs_receive() argument
1607 len = kernel_recvmsg(sock, &msg, &iov, 1, buflen, MSG_DONTWAIT); ip_vs_receive()
1651 struct sock *sk = tinfo->sock->sk; sync_thread_master()
1666 while (ip_vs_send_sync_msg(tinfo->sock, sb->mesg) < 0) { sync_thread_master()
1695 sk_release_kernel(tinfo->sock->sk); sync_thread_master()
1713 wait_event_interruptible(*sk_sleep(tinfo->sock->sk), sync_thread_backup()
1714 !skb_queue_empty(&tinfo->sock->sk->sk_receive_queue) sync_thread_backup()
1718 while (!skb_queue_empty(&(tinfo->sock->sk->sk_receive_queue))) { sync_thread_backup()
1719 len = ip_vs_receive(tinfo->sock, tinfo->buf, sync_thread_backup()
1732 sk_release_kernel(tinfo->sock->sk); sync_thread_backup()
1744 struct socket *sock; start_sync_thread() local
1809 sock = make_send_sock(net, id); start_sync_thread()
1811 sock = make_receive_sock(net, id); start_sync_thread()
1812 if (IS_ERR(sock)) { start_sync_thread()
1813 result = PTR_ERR(sock); start_sync_thread()
1820 tinfo->sock = sock; start_sync_thread()
1857 sk_release_kernel(sock->sk); start_sync_thread()
1861 sk_release_kernel(tinfo->sock->sk); start_sync_thread()
/linux-4.1.27/fs/ocfs2/cluster/
H A Dtcp.h32 #include <net/sock.h>
69 static inline int o2net_link_down(int err, struct socket *sock) o2net_link_down() argument
71 if (sock) { o2net_link_down()
72 if (sock->sk->sk_state != TCP_ESTABLISHED && o2net_link_down()
73 sock->sk->sk_state != TCP_CLOSE_WAIT) o2net_link_down()

Completed in 5497 milliseconds

1234