diff options
Diffstat (limited to 'usr/src/uts/common/inet/tcp/tcp_socket.c')
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp_socket.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp_socket.c b/usr/src/uts/common/inet/tcp/tcp_socket.c index 7f96a851ef..4b50c65cc6 100644 --- a/usr/src/uts/common/inet/tcp/tcp_socket.c +++ b/usr/src/uts/common/inet/tcp/tcp_socket.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ /* This file contains all TCP kernel socket related functions. */ @@ -156,15 +155,12 @@ tcp_bind(sock_lower_handle_t proto_handle, struct sockaddr *sa, { int error; conn_t *connp = (conn_t *)proto_handle; - squeue_t *sqp = connp->conn_sqp; /* All Solaris components should pass a cred for this operation. */ ASSERT(cr != NULL); - - ASSERT(sqp != NULL); ASSERT(connp->conn_upper_handle != NULL); - error = squeue_synch_enter(sqp, connp, NULL); + error = squeue_synch_enter(connp, NULL); if (error != 0) { /* failed to enter */ return (ENOSR); @@ -180,7 +176,7 @@ tcp_bind(sock_lower_handle_t proto_handle, struct sockaddr *sa, error = tcp_do_bind(connp, sa, len, cr, B_TRUE); } - squeue_synch_exit(sqp, connp); + squeue_synch_exit(connp); if (error < 0) { if (error == -TOUTSTATE) @@ -201,14 +197,13 @@ tcp_listen(sock_lower_handle_t proto_handle, int backlog, cred_t *cr) { conn_t *connp = (conn_t *)proto_handle; int error; - squeue_t *sqp = connp->conn_sqp; ASSERT(connp->conn_upper_handle != NULL); /* All Solaris components should pass a cred for this operation. */ ASSERT(cr != NULL); - error = squeue_synch_enter(sqp, connp, NULL); + error = squeue_synch_enter(connp, NULL); if (error != 0) { /* failed to enter */ return (ENOBUFS); @@ -224,7 +219,7 @@ tcp_listen(sock_lower_handle_t proto_handle, int backlog, cred_t *cr) else error = proto_tlitosyserr(-error); } - squeue_synch_exit(sqp, connp); + squeue_synch_exit(connp); return (error); } @@ -233,7 +228,6 @@ tcp_connect(sock_lower_handle_t proto_handle, const struct sockaddr *sa, socklen_t len, sock_connid_t *id, cred_t *cr) { conn_t *connp = (conn_t *)proto_handle; - squeue_t *sqp = connp->conn_sqp; int error; ASSERT(connp->conn_upper_handle != NULL); @@ -246,7 +240,7 @@ tcp_connect(sock_lower_handle_t proto_handle, const struct sockaddr *sa, return (error); } - error = squeue_synch_enter(sqp, connp, NULL); + error = squeue_synch_enter(connp, NULL); if (error != 0) { /* failed to enter */ return (ENOSR); @@ -289,7 +283,7 @@ tcp_connect(sock_lower_handle_t proto_handle, const struct sockaddr *sa, connp->conn_upper_handle, &sopp); } done: - squeue_synch_exit(sqp, connp); + squeue_synch_exit(connp); return ((error == 0) ? EINPROGRESS : error); } @@ -333,7 +327,6 @@ tcp_getsockopt(sock_lower_handle_t proto_handle, int level, int option_name, void *optvalp, socklen_t *optlen, cred_t *cr) { conn_t *connp = (conn_t *)proto_handle; - squeue_t *sqp = connp->conn_sqp; int error; t_uscalar_t max_optbuf_len; void *optvalp_buf; @@ -354,14 +347,14 @@ tcp_getsockopt(sock_lower_handle_t proto_handle, int level, int option_name, optvalp_buf = kmem_alloc(max_optbuf_len, KM_SLEEP); - error = squeue_synch_enter(sqp, connp, NULL); + error = squeue_synch_enter(connp, NULL); if (error == ENOMEM) { kmem_free(optvalp_buf, max_optbuf_len); return (ENOMEM); } len = tcp_opt_get(connp, level, option_name, optvalp_buf); - squeue_synch_exit(sqp, connp); + squeue_synch_exit(connp); if (len == -1) { kmem_free(optvalp_buf, max_optbuf_len); @@ -385,7 +378,6 @@ tcp_setsockopt(sock_lower_handle_t proto_handle, int level, int option_name, const void *optvalp, socklen_t optlen, cred_t *cr) { conn_t *connp = (conn_t *)proto_handle; - squeue_t *sqp = connp->conn_sqp; int error; ASSERT(connp->conn_upper_handle != NULL); @@ -409,7 +401,7 @@ tcp_setsockopt(sock_lower_handle_t proto_handle, int level, int option_name, } } - error = squeue_synch_enter(sqp, connp, NULL); + error = squeue_synch_enter(connp, NULL); if (error == ENOMEM) { return (ENOMEM); } @@ -423,14 +415,14 @@ tcp_setsockopt(sock_lower_handle_t proto_handle, int level, int option_name, if (error < 0) { error = proto_tlitosyserr(-error); } - squeue_synch_exit(sqp, connp); + squeue_synch_exit(connp); return (error); } error = tcp_opt_set(connp, SETFN_OPTCOM_NEGOTIATE, level, option_name, optlen, (uchar_t *)optvalp, (uint_t *)&optlen, (uchar_t *)optvalp, NULL, cr); - squeue_synch_exit(sqp, connp); + squeue_synch_exit(connp); ASSERT(error >= 0); @@ -581,7 +573,7 @@ tcp_clr_flowctrl(sock_lower_handle_t proto_handle) tcp->tcp_rsrv_mp = NULL; mutex_exit(&tcp->tcp_rsrv_mp_lock); - error = squeue_synch_enter(connp->conn_sqp, connp, mp); + error = squeue_synch_enter(connp, mp); ASSERT(error == 0); mutex_enter(&tcp->tcp_rsrv_mp_lock); @@ -606,7 +598,7 @@ tcp_clr_flowctrl(sock_lower_handle_t proto_handle) } } - squeue_synch_exit(connp->conn_sqp, connp); + squeue_synch_exit(connp); } /* ARGSUSED */ @@ -771,7 +763,7 @@ tcp_fallback(sock_lower_handle_t proto_handle, queue_t *q, /* * Enter the squeue so that no new packets can come in */ - error = squeue_synch_enter(connp->conn_sqp, connp, NULL); + error = squeue_synch_enter(connp, NULL); if (error != 0) { /* failed to enter, free all the pre-allocated messages. */ freeb(stropt_mp); @@ -814,7 +806,7 @@ tcp_fallback(sock_lower_handle_t proto_handle, queue_t *q, * There should be atleast two ref's (IP + TCP) */ ASSERT(connp->conn_ref >= 2); - squeue_synch_exit(connp->conn_sqp, connp); + squeue_synch_exit(connp); return (0); } |