| 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__ */ |