Lines Matching refs:ses

114 	if ((tcon->ses) && (tcon->ses->server) &&  in smb2_hdr_assemble()
115 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) in smb2_hdr_assemble()
121 if (tcon->ses) in smb2_hdr_assemble()
122 hdr->SessionId = tcon->ses->Suid; in smb2_hdr_assemble()
137 if (tcon->ses && tcon->ses->server && tcon->ses->server->sign) in smb2_hdr_assemble()
149 struct cifs_ses *ses; in smb2_reconnect() local
177 if ((!tcon->ses) || (tcon->ses->status == CifsExiting) || in smb2_reconnect()
178 (!tcon->ses->server)) in smb2_reconnect()
181 ses = tcon->ses; in smb2_reconnect()
182 server = ses->server; in smb2_reconnect()
222 if (!tcon->ses->need_reconnect && !tcon->need_reconnect) in smb2_reconnect()
231 mutex_lock(&tcon->ses->session_mutex); in smb2_reconnect()
232 rc = cifs_negotiate_protocol(0, tcon->ses); in smb2_reconnect()
233 if (!rc && tcon->ses->need_reconnect) in smb2_reconnect()
234 rc = cifs_setup_session(0, tcon->ses, nls_codepage); in smb2_reconnect()
237 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
242 rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); in smb2_reconnect()
243 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
324 SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) in SMB2_negotiate() argument
331 struct TCP_Server_Info *server = ses->server; in SMB2_negotiate()
349 req->Dialects[0] = cpu_to_le16(ses->server->vals->protocol_id); in SMB2_negotiate()
355 if (ses->sign) in SMB2_negotiate()
362 req->Capabilities = cpu_to_le32(ses->server->vals->req_capabilities); in SMB2_negotiate()
365 if (ses->server->vals->protocol_id == SMB20_PROT_ID) in SMB2_negotiate()
375 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, flags); in SMB2_negotiate()
430 rc = cifs_enable_signing(server, ses->sign); in SMB2_negotiate()
462 if (tcon->ses->server->sign == false) in smb3_validate_negotiate()
466 cpu_to_le32(tcon->ses->server->vals->req_capabilities); in smb3_validate_negotiate()
467 memcpy(vneg_inbuf.Guid, tcon->ses->server->client_guid, in smb3_validate_negotiate()
470 if (tcon->ses->sign) in smb3_validate_negotiate()
481 cpu_to_le16(tcon->ses->server->vals->protocol_id); in smb3_validate_negotiate()
500 cpu_to_le16(tcon->ses->server->vals->protocol_id)) in smb3_validate_negotiate()
503 if (pneg_rsp->SecurityMode != cpu_to_le16(tcon->ses->server->sec_mode)) in smb3_validate_negotiate()
509 SMB2_LARGE_FILES) != tcon->ses->server->capabilities) in smb3_validate_negotiate()
522 SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, in SMB2_sess_setup() argument
531 struct TCP_Server_Info *server = ses->server; in SMB2_sess_setup()
549 kfree(ses->auth_key.response); in SMB2_sess_setup()
550 ses->auth_key.response = NULL; in SMB2_sess_setup()
556 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); in SMB2_sess_setup()
557 if (!ses->ntlmssp) in SMB2_sess_setup()
559 ses->ntlmssp->sesskey_per_smbsess = true; in SMB2_sess_setup()
562 if (ses->sectype != Kerberos && ses->sectype != RawNTLMSSP) in SMB2_sess_setup()
563 ses->sectype = RawNTLMSSP; in SMB2_sess_setup()
593 if (ses->sectype == Kerberos) { in SMB2_sess_setup()
597 spnego_key = cifs_get_spnego_key(ses); in SMB2_sess_setup()
616 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, in SMB2_sess_setup()
618 if (!ses->auth_key.response) { in SMB2_sess_setup()
625 ses->auth_key.len = msg->sesskey_len; in SMB2_sess_setup()
640 build_ntlmssp_negotiate_blob(ntlmssp_blob, ses); in SMB2_sess_setup()
659 req->hdr.SessionId = ses->Suid; in SMB2_sess_setup()
666 rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses, in SMB2_sess_setup()
703 rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, in SMB2_sess_setup()
708 ses->Suid = rsp->hdr.SessionId; in SMB2_sess_setup()
727 le16_to_cpu(rsp->SecurityBufferLength), ses); in SMB2_sess_setup()
741 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_setup()
742 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) in SMB2_sess_setup()
754 rc = server->ops->generate_signingkey(ses); in SMB2_sess_setup()
755 kfree(ses->auth_key.response); in SMB2_sess_setup()
756 ses->auth_key.response = NULL; in SMB2_sess_setup()
772 ses->status = CifsGood; in SMB2_sess_setup()
773 ses->need_reconnect = false; in SMB2_sess_setup()
779 kfree(ses->auth_key.response); in SMB2_sess_setup()
780 ses->auth_key.response = NULL; in SMB2_sess_setup()
786 kfree(ses->ntlmssp); in SMB2_sess_setup()
792 SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) in SMB2_logoff() argument
798 cifs_dbg(FYI, "disconnect session %p\n", ses); in SMB2_logoff()
800 if (ses && (ses->server)) in SMB2_logoff()
801 server = ses->server; in SMB2_logoff()
806 if (ses->need_reconnect) in SMB2_logoff()
814 req->hdr.SessionId = ses->Suid; in SMB2_logoff()
818 rc = SendReceiveNoRsp(xid, ses, (char *) &req->hdr, 0); in SMB2_logoff()
844 SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, in SMB2_tcon() argument
858 if ((ses->server) && tree) in SMB2_tcon()
859 server = ses->server; in SMB2_tcon()
885 req->hdr.SessionId = ses->Suid; in SMB2_tcon()
903 rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, 0); in SMB2_tcon()
915 ses->ipc_tid = rsp->hdr.TreeId; in SMB2_tcon()
945 if (tcon->ses->server->ops->validate_negotiate) in SMB2_tcon()
946 rc = tcon->ses->server->ops->validate_negotiate(xid, tcon); in SMB2_tcon()
967 struct cifs_ses *ses = tcon->ses; in SMB2_tdis() local
971 if (ses && (ses->server)) in SMB2_tdis()
972 server = ses->server; in SMB2_tdis()
976 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) in SMB2_tdis()
983 rc = SendReceiveNoRsp(xid, ses, (char *)&req->hdr, 0); in SMB2_tdis()
1126 struct cifs_ses *ses = tcon->ses; in SMB2_open() local
1139 if (ses && (ses->server)) in SMB2_open()
1140 server = ses->server; in SMB2_open()
1225 rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0); in SMB2_open()
1271 struct cifs_ses *ses; in SMB2_ioctl() local
1287 ses = tcon->ses; in SMB2_ioctl()
1291 if (ses && (ses->server)) in SMB2_ioctl()
1292 server = ses->server; in SMB2_ioctl()
1350 rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0); in SMB2_ioctl()
1433 struct cifs_ses *ses = tcon->ses; in SMB2_close() local
1440 if (ses && (ses->server)) in SMB2_close()
1441 server = ses->server; in SMB2_close()
1456 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, 0); in SMB2_close()
1539 struct cifs_ses *ses = tcon->ses; in query_info() local
1543 if (ses && (ses->server)) in query_info()
1544 server = ses->server; in query_info()
1565 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, 0); in query_info()
1660 struct cifs_ses *ses = tcon->ses; in SMB2_flush() local
1667 if (ses && (ses->server)) in SMB2_flush()
1668 server = ses->server; in SMB2_flush()
1683 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, 0); in SMB2_flush()
1706 if (io_parms->tcon->ses->server == NULL) in smb2_new_read_req()
1755 struct TCP_Server_Info *server = tcon->ses->server; in smb2_readv_callback()
1829 server = io_parms.tcon->ses->server; in smb2_async_readv()
1860 rc = cifs_call_async(io_parms.tcon->ses->server, &rqst, in smb2_async_readv()
1885 rc = SendReceive2(xid, io_parms->tcon->ses, iov, 1, in SMB2_read()
1939 wdata->result = smb2_check_receive(mid, tcon->ses->server, 0); in smb2_writev_callback()
1972 add_credits(tcon->ses->server, credits_received, 0); in smb2_writev_callback()
1983 struct TCP_Server_Info *server = tcon->ses->server; in smb2_async_writev()
2079 if (io_parms->tcon->ses->server == NULL) in SMB2_write()
2103 rc = SendReceive2(xid, io_parms->tcon->ses, iov, n_vec + 1, in SMB2_write()
2173 struct cifs_ses *ses = tcon->ses; in SMB2_query_directory() local
2179 if (ses && (ses->server)) in SMB2_query_directory()
2180 server = ses->server; in SMB2_query_directory()
2232 rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, 0); in SMB2_query_directory()
2296 struct cifs_ses *ses = tcon->ses; in send_set_info() local
2298 if (ses && (ses->server)) in send_set_info()
2299 server = ses->server; in send_set_info()
2343 rc = SendReceive2(xid, ses, iov, num, &resp_buftype, 0); in send_set_info()
2484 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) req, CIFS_OBREAK_OP); in SMB2_oplock_break()
2516 if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) in build_qfs_info_req()
2547 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_info() local
2556 rc = SendReceive2(xid, ses, &iov, 1, &resp_buftype, 0); in SMB2_QFS_info()
2584 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_attr() local
2606 rc = SendReceive2(xid, ses, &iov, 1, &resp_buftype, 0); in SMB2_QFS_attr()
2672 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); in smb2_lockv()
2718 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) req, CIFS_OBREAK_OP); in SMB2_lease_break()