blob: 53451dbd17c46b3a26a10fa855f85d1a6f9a86a1 [file] [log] [blame]
wdenkcbd8a352004-02-24 02:00:03 +00001/*
2 * (C) Masami Komiya <mkomiya@sonare.it> 2004
3 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
wdenkcbd8a352004-02-24 02:00:03 +00005 */
6
7#ifndef __NFS_H__
8#define __NFS_H__
9
10#define SUNRPC_PORT 111
11
12#define PROG_PORTMAP 100000
13#define PROG_NFS 100003
14#define PROG_MOUNT 100005
15
16#define MSG_CALL 0
17#define MSG_REPLY 1
18
19#define PORTMAP_GETPORT 3
20
21#define MOUNT_ADDENTRY 1
22#define MOUNT_UMOUNTALL 4
23
24#define NFS_LOOKUP 4
25#define NFS_READLINK 5
26#define NFS_READ 6
27
28#define NFS_FHSIZE 32
29
30#define NFSERR_PERM 1
31#define NFSERR_NOENT 2
32#define NFSERR_ACCES 13
33#define NFSERR_ISDIR 21
34#define NFSERR_INVAL 22
35
36/* Block size used for NFS read accesses. A RPC reply packet (including all
37 * headers) must fit within a single Ethernet frame to avoid fragmentation.
Alessandro Rubinibd931ca2009-08-07 13:59:16 +020038 * However, if CONFIG_IP_DEFRAG is set, the config file may want to use a
39 * bigger value. In any case, most NFS servers are optimized for a power of 2.
40 */
41#ifdef CONFIG_NFS_READ_SIZE
42#define NFS_READ_SIZE CONFIG_NFS_READ_SIZE
43#else
44#define NFS_READ_SIZE 1024 /* biggest power of two that fits Ether frame */
45#endif
wdenkcbd8a352004-02-24 02:00:03 +000046
47#define NFS_MAXLINKDEPTH 16
48
49struct rpc_t {
50 union {
51 uint8_t data[2048];
52 struct {
53 uint32_t id;
54 uint32_t type;
55 uint32_t rpcvers;
56 uint32_t prog;
57 uint32_t vers;
58 uint32_t proc;
59 uint32_t data[1];
60 } call;
61 struct {
62 uint32_t id;
63 uint32_t type;
64 uint32_t rstatus;
65 uint32_t verifier;
66 uint32_t v2;
67 uint32_t astatus;
wdenk11dadd542004-02-27 00:07:27 +000068 uint32_t data[19];
wdenkcbd8a352004-02-24 02:00:03 +000069 } reply;
70 } u;
71};
Joe Hershbergerc9f6c912012-05-15 08:59:09 +000072extern void NfsStart(void); /* Begin NFS */
wdenkcbd8a352004-02-24 02:00:03 +000073
74
75/**********************************************************************/
76
77#endif /* __NFS_H__ */