bool (*need_neg)(struct TCP_Server_Info *);
        /* negotiate to the server */
        int (*negotiate)(const unsigned int, struct cifs_ses *);
+       /* setup smb sessionn */
+       int (*sess_setup)(const unsigned int, struct cifs_ses *,
+                         const struct nls_table *);
+       /* close smb session */
+       int (*logoff)(const unsigned int, struct cifs_ses *);
 };
 
 struct smb_version_values {
 
 extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
                                struct cifs_ses *ses,
                                void **request_buf);
-extern int CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses,
-                            const struct nls_table *nls_cp);
+extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
+                         const struct nls_table *nls_cp);
 extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
 extern u64 cifs_UnixTimeToNT(struct timespec);
 extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
 
 extern int cifs_negotiate_protocol(const unsigned int xid,
                                   struct cifs_ses *ses);
-extern int cifs_setup_session(unsigned int xid, struct cifs_ses *ses,
-                       struct nls_table *nls_info);
+extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
+                             struct nls_table *nls_info);
 extern int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses);
 
 extern int CIFSTCon(unsigned int xid, struct cifs_ses *ses,
                        const bool waitFlag);
 extern int CIFSSMBTDis(const int xid, struct cifs_tcon *tcon);
 extern int CIFSSMBEcho(struct TCP_Server_Info *server);
-extern int CIFSSMBLogoff(const int xid, struct cifs_ses *ses);
+extern int CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses);
 
 extern struct cifs_ses *sesInfoAlloc(void);
 extern void sesInfoFree(struct cifs_ses *);
 
 }
 
 int
-CIFSSMBLogoff(const int xid, struct cifs_ses *ses)
+CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses)
 {
        LOGOFF_ANDX_REQ *pSMB;
        int rc = 0;
 
 static void
 cifs_put_smb_ses(struct cifs_ses *ses)
 {
-       int xid;
+       unsigned int xid;
        struct TCP_Server_Info *server = ses->server;
 
        cFYI(1, "%s: ses_count=%d", __func__, ses->ses_count);
        list_del_init(&ses->smb_ses_list);
        spin_unlock(&cifs_tcp_ses_lock);
 
-       if (ses->status == CifsGood) {
+       if (ses->status == CifsGood && server->ops->logoff) {
                xid = GetXid();
-               CIFSSMBLogoff(xid, ses);
+               server->ops->logoff(xid, ses);
                _FreeXid(xid);
        }
        sesInfoFree(ses);
        return rc;
 }
 
-
-int cifs_setup_session(unsigned int xid, struct cifs_ses *ses,
-                       struct nls_table *nls_info)
+int
+cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
+                  struct nls_table *nls_info)
 {
-       int rc = 0;
+       int rc = -ENOSYS;
        struct TCP_Server_Info *server = ses->server;
 
        ses->flags = 0;
        cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
                 server->sec_mode, server->capabilities, server->timeAdj);
 
-       rc = CIFS_SessSetup(xid, ses, nls_info);
+       if (server->ops->sess_setup)
+               rc = server->ops->sess_setup(xid, ses, nls_info);
+
        if (rc) {
                cERROR(1, "Send error in SessSetup = %d", rc);
        } else {
 
 }
 
 int
-CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses,
+CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
               const struct nls_table *nls_cp)
 {
        int rc = 0;
 
        .check_trans2 = cifs_check_trans2,
        .need_neg = cifs_need_neg,
        .negotiate = cifs_negotiate,
+       .sess_setup = CIFS_SessSetup,
+       .logoff = CIFSSMBLogoff,
 };
 
 struct smb_version_values smb1_values = {