1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Masami Komiya <mkomiya@sonare.it> 2004
9 #define SUNRPC_PORT 111
11 #define PROG_PORTMAP 100000
12 #define PROG_NFS 100003
13 #define PROG_MOUNT 100005
18 #define PORTMAP_GETPORT 3
20 #define MOUNT_ADDENTRY 1
21 #define MOUNT_UMOUNTALL 4
24 #define NFS_READLINK 5
27 #define NFS3PROC_LOOKUP 3
30 #define NFS3_FHSIZE 64
33 #define NFSERR_NOENT 2
34 #define NFSERR_ACCES 13
35 #define NFSERR_ISDIR 21
36 #define NFSERR_INVAL 22
39 * Block size used for NFS read accesses. A RPC reply packet (including all
40 * headers) must fit within a single Ethernet frame to avoid fragmentation.
41 * However, if CONFIG_IP_DEFRAG is set, a bigger value could be used. In any
42 * case, most NFS servers are optimized for a power of 2.
44 #define NFS_READ_SIZE 1024 /* biggest power of two that fits Ether frame */
45 #define NFS_MAX_ATTRS 26
47 /* Values for Accept State flag on RPC answers (See: rfc1831) */
48 enum rpc_accept_stat {
49 NFS_RPC_SUCCESS = 0, /* RPC executed successfully */
50 NFS_RPC_PROG_UNAVAIL = 1, /* remote hasn't exported program */
51 NFS_RPC_PROG_MISMATCH = 2, /* remote can't support version # */
52 NFS_RPC_PROC_UNAVAIL = 3, /* program can't support procedure */
53 NFS_RPC_GARBAGE_ARGS = 4, /* procedure can't decode params */
54 NFS_RPC_SYSTEM_ERR = 5 /* errors like memory allocation failure */
59 uint8_t data[NFS_READ_SIZE + (6 + NFS_MAX_ATTRS) *
77 uint32_t data[NFS_READ_SIZE / sizeof(uint32_t) +
81 } __attribute__((packed));
82 void nfs_start(void); /* Begin NFS */
85 /**********************************************************************/
87 #endif /* __NFS_H__ */