]> git.baikalelectronics.ru Git - kernel.git/commitdiff
smb3: minor update to compression header definitions
authorSteve French <stfrench@microsoft.com>
Sat, 30 May 2020 22:10:16 +0000 (17:10 -0500)
committerSteve French <stfrench@microsoft.com>
Tue, 2 Jun 2020 14:58:17 +0000 (09:58 -0500)
MS-SMB2 specification was updated in March.  Make minor additions
and corrections to compression related definitions in smb2pdu.h

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
fs/cifs/smb2pdu.h

index 10acf90f858d16ff4bdea6b2946c0c59c4a85f09..3b0e6acf9d7d9d4e1995eea37a016aa0d09b3565 100644 (file)
@@ -143,8 +143,17 @@ struct smb2_transform_hdr {
        __u64  SessionId;
 } __packed;
 
+/* See MS-SMB2 2.2.42 */
+struct smb2_compression_transform_hdr {
+       __le32 ProtocolId;      /* 0xFC 'S' 'M' 'B' */
+       __le32 OriginalCompressedSegmentSize;
+       __le16 CompressionAlgorithm;
+       __le16 Flags;
+       __le16 Length; /* if chained it is length, else offset */
+} __packed;
+
 /* See MS-SMB2 2.2.42.1 */
-struct compression_playload_header {
+struct compression_payload_header {
        __le16  AlgorithmId;
        __le16  Reserved;
        __le32  Length;
@@ -333,7 +342,7 @@ struct smb2_encryption_neg_context {
 #define SMB3_COMPRESS_LZ77     cpu_to_le16(0x0002)
 #define SMB3_COMPRESS_LZ77_HUFF        cpu_to_le16(0x0003)
 /* Pattern scanning algorithm See MS-SMB2 3.1.4.4.1 */
-#define SMB3_COMPRESS_PATTERN  cpu_to_le16(0x0004)
+#define SMB3_COMPRESS_PATTERN  cpu_to_le16(0x0004) /* Pattern_V1 */
 
 /* Compression Flags */
 #define SMB2_COMPRESSION_CAPABILITIES_FLAG_NONE                cpu_to_le32(0x00000000)