Merge git://www.linux-watchdog.org/linux-watchdog
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / cifs / cifsglob.h
index 2f3a89a..1fdc370 100644 (file)
@@ -125,9 +125,11 @@ struct cifs_secmech {
        struct crypto_shash *hmacmd5; /* hmac-md5 hash function */
        struct crypto_shash *md5; /* md5 hash function */
        struct crypto_shash *hmacsha256; /* hmac-sha256 hash function */
+       struct crypto_shash *cmacaes; /* block-cipher based MAC function */
        struct sdesc *sdeschmacmd5;  /* ctxt to generate ntlmv2 hash, CR1 */
        struct sdesc *sdescmd5; /* ctxt to generate cifs/smb signature */
        struct sdesc *sdeschmacsha256;  /* ctxt to generate smb2 signature */
+       struct sdesc *sdesccmacaes;  /* ctxt to generate smb3 signature */
 };
 
 /* per smb session structure/fields */
@@ -175,6 +177,7 @@ enum smb_version {
        Smb_20,
        Smb_21,
        Smb_30,
+       Smb_302,
 };
 
 struct mid_q_entry;
@@ -191,6 +194,7 @@ struct cifs_writedata;
 struct cifs_io_parms;
 struct cifs_search_info;
 struct cifsInodeInfo;
+struct cifs_open_parms;
 
 struct smb_version_operations {
        int (*send_cancel)(struct TCP_Server_Info *, void *,
@@ -222,6 +226,7 @@ struct smb_version_operations {
        void (*dump_detail)(void *);
        void (*clear_stats)(struct cifs_tcon *);
        void (*print_stats)(struct seq_file *m, struct cifs_tcon *);
+       void (*dump_share_caps)(struct seq_file *, struct cifs_tcon *);
        /* verify the message */
        int (*check_message)(char *, unsigned int);
        bool (*is_oplock_break)(char *, struct TCP_Server_Info *);
@@ -303,9 +308,8 @@ struct smb_version_operations {
                               const char *, const char *,
                               struct cifs_sb_info *);
        /* open a file for non-posix mounts */
-       int (*open)(const unsigned int, struct cifs_tcon *, const char *, int,
-                   int, int, struct cifs_fid *, __u32 *, FILE_ALL_INFO *,
-                   struct cifs_sb_info *);
+       int (*open)(const unsigned int, struct cifs_open_parms *,
+                   __u32 *, FILE_ALL_INFO *);
        /* set fid protocol-specific info */
        void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32);
        /* close a file */
@@ -361,6 +365,8 @@ struct smb_version_operations {
        void (*set_lease_key)(struct inode *, struct cifs_fid *fid);
        /* generate new lease key */
        void (*new_lease_key)(struct cifs_fid *fid);
+       /* The next two functions will need to be changed to per smb session */
+       void (*generate_signingkey)(struct TCP_Server_Info *server);
        int (*calc_signature)(struct smb_rqst *rqst,
                                   struct TCP_Server_Info *server);
 };
@@ -381,6 +387,8 @@ struct smb_version_values {
        unsigned int    cap_nt_find;
        unsigned int    cap_large_files;
        unsigned int    oplock_read;
+       __u16           signing_enabled;
+       __u16           signing_required;
 };
 
 #define HEADER_SIZE(server) (server->vals->header_size)
@@ -401,7 +409,6 @@ struct smb_vol {
        kgid_t backupgid;
        umode_t file_mode;
        umode_t dir_mode;
-       unsigned secFlg;
        enum securityEnum sectype; /* sectype requested via mnt opts */
        bool sign; /* was signing requested via mnt opts? */
        bool retry:1;
@@ -511,6 +518,7 @@ struct TCP_Server_Info {
        struct task_struct *tsk;
        char server_GUID[16];
        __u16 sec_mode;
+       bool sign; /* is signing enabled on this connection? */
        bool session_estab; /* mark when very first sess is established */
 #ifdef CONFIG_CIFS_SMB2
        int echo_credits;  /* echo reserved slots */
@@ -518,7 +526,6 @@ struct TCP_Server_Info {
        bool echoes:1; /* enable echoes */
 #endif
        u16 dialect; /* dialect index that server chose */
-       enum securityEnum secType;
        bool oplocks:1; /* enable oplocks */
        unsigned int maxReq;    /* Clients should submit no more */
        /* than maxReq distinct unanswered SMBs to the server when using  */
@@ -537,6 +544,7 @@ struct TCP_Server_Info {
        int timeAdj;  /* Adjust for difference in server time zone in sec */
        __u64 CurrentMid;         /* multiplex id - rotating counter */
        char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */
+       char smb3signingkey[SMB3_SIGN_KEY_SIZE]; /* for signing smb3 packets */
        /* 16th byte of RFC1001 workstation name is always null */
        char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
        __u32 sequence_number; /* for signing, protected by srv_mutex */
@@ -809,7 +817,7 @@ struct cifs_tcon {
 #ifdef CONFIG_CIFS_SMB2
        bool print:1;           /* set if connection to printer share */
        bool bad_network_name:1; /* set if ret status STATUS_BAD_NETWORK_NAME */
-       __u32 capabilities;
+       __le32 capabilities;
        __u32 share_flags;
        __u32 maximal_access;
        __u32 vol_serial_number;
@@ -904,6 +912,17 @@ struct cifs_search_info {
        bool smallBuf:1; /* so we know which buf_release function to call */
 };
 
+struct cifs_open_parms {
+       struct cifs_tcon *tcon;
+       struct cifs_sb_info *cifs_sb;
+       int disposition;
+       int desired_access;
+       int create_options;
+       const char *path;
+       struct cifs_fid *fid;
+       bool reconnect:1;
+};
+
 struct cifs_fid {
        __u16 netfid;
 #ifdef CONFIG_CIFS_SMB2
@@ -1341,7 +1360,7 @@ require use of the stronger protocol */
 #define   CIFSSEC_MUST_SEAL    0x40040 /* not supported yet */
 #define   CIFSSEC_MUST_NTLMSSP 0x80080 /* raw ntlmssp with ntlmv2 */
 
-#define   CIFSSEC_DEF (CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLMSSP)
+#define   CIFSSEC_DEF (CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLMV2 | CIFSSEC_MAY_NTLMSSP)
 #define   CIFSSEC_MAX (CIFSSEC_MUST_SIGN | CIFSSEC_MUST_NTLMV2)
 #define   CIFSSEC_AUTH_MASK (CIFSSEC_MAY_NTLM | CIFSSEC_MAY_NTLMV2 | CIFSSEC_MAY_LANMAN | CIFSSEC_MAY_PLNTXT | CIFSSEC_MAY_KRB5 | CIFSSEC_MAY_NTLMSSP)
 /*
@@ -1487,4 +1506,7 @@ extern struct smb_version_values smb21_values;
 #define SMB30_VERSION_STRING   "3.0"
 extern struct smb_version_operations smb30_operations;
 extern struct smb_version_values smb30_values;
+#define SMB302_VERSION_STRING  "3.02"
+/*extern struct smb_version_operations smb302_operations;*/ /* not needed yet */
+extern struct smb_version_values smb302_values;
 #endif /* _CIFS_GLOB_H */