Skip to content

Commit 00fab6c

Browse files
metze-sambasmfrench
authored andcommitted
smb: smbdirect: add smbdirect_pdu.h with protocol definitions
This is just a start moving into a common smbdirect layer. It will be used in the next commits... Cc: Steve French <[email protected]> Cc: Tom Talpey <[email protected]> Cc: Long Li <[email protected]> Cc: Namjae Jeon <[email protected]> Cc: Hyunchul Lee <[email protected]> Cc: Meetakshi Setiya <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Stefan Metzmacher <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 6d9b5f6 commit 00fab6c

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* Copyright (c) 2017 Stefan Metzmacher
4+
*/
5+
6+
#ifndef __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_PDU_H__
7+
#define __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_PDU_H__
8+
9+
#define SMBDIRECT_V1 0x0100
10+
11+
/* SMBD negotiation request packet [MS-SMBD] 2.2.1 */
12+
struct smbdirect_negotiate_req {
13+
__le16 min_version;
14+
__le16 max_version;
15+
__le16 reserved;
16+
__le16 credits_requested;
17+
__le32 preferred_send_size;
18+
__le32 max_receive_size;
19+
__le32 max_fragmented_size;
20+
} __packed;
21+
22+
/* SMBD negotiation response packet [MS-SMBD] 2.2.2 */
23+
struct smbdirect_negotiate_resp {
24+
__le16 min_version;
25+
__le16 max_version;
26+
__le16 negotiated_version;
27+
__le16 reserved;
28+
__le16 credits_requested;
29+
__le16 credits_granted;
30+
__le32 status;
31+
__le32 max_readwrite_size;
32+
__le32 preferred_send_size;
33+
__le32 max_receive_size;
34+
__le32 max_fragmented_size;
35+
} __packed;
36+
37+
#define SMBDIRECT_DATA_MIN_HDR_SIZE 0x14
38+
#define SMBDIRECT_DATA_OFFSET 0x18
39+
40+
#define SMBDIRECT_FLAG_RESPONSE_REQUESTED 0x0001
41+
42+
/* SMBD data transfer packet with payload [MS-SMBD] 2.2.3 */
43+
struct smbdirect_data_transfer {
44+
__le16 credits_requested;
45+
__le16 credits_granted;
46+
__le16 flags;
47+
__le16 reserved;
48+
__le32 remaining_data_length;
49+
__le32 data_offset;
50+
__le32 data_length;
51+
__le32 padding;
52+
__u8 buffer[];
53+
} __packed;
54+
55+
#endif /* __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_PDU_H__ */

0 commit comments

Comments
 (0)