1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2017, Microsoft Corporation.
4 * Copyright (C) 2018, LG Electronics.
7 #ifndef __KSMBD_TRANSPORT_RDMA_H__
8 #define __KSMBD_TRANSPORT_RDMA_H__
10 #define SMB_DIRECT_PORT 5445
12 /* SMB DIRECT negotiation request packet [MS-SMBD] 2.2.1 */
13 struct smb_direct_negotiate_req {
17 __le16 credits_requested;
18 __le32 preferred_send_size;
19 __le32 max_receive_size;
20 __le32 max_fragmented_size;
23 /* SMB DIRECT negotiation response packet [MS-SMBD] 2.2.2 */
24 struct smb_direct_negotiate_resp {
27 __le16 negotiated_version;
29 __le16 credits_requested;
30 __le16 credits_granted;
32 __le32 max_readwrite_size;
33 __le32 preferred_send_size;
34 __le32 max_receive_size;
35 __le32 max_fragmented_size;
38 #define SMB_DIRECT_RESPONSE_REQUESTED 0x0001
40 /* SMB DIRECT data transfer packet with payload [MS-SMBD] 2.2.3 */
41 struct smb_direct_data_transfer {
42 __le16 credits_requested;
43 __le16 credits_granted;
46 __le32 remaining_data_length;
53 #ifdef CONFIG_SMB_SERVER_SMBDIRECT
54 int ksmbd_rdma_init(void);
55 int ksmbd_rdma_destroy(void);
56 bool ksmbd_rdma_capable_netdev(struct net_device *netdev);
58 static inline int ksmbd_rdma_init(void) { return 0; }
59 static inline int ksmbd_rdma_destroy(void) { return 0; }
60 static inline bool ksmbd_rdma_capable_netdev(struct net_device *netdev) { return false; }
63 #endif /* __KSMBD_TRANSPORT_RDMA_H__ */