xref: /openbmc/u-boot/net/nfs.h (revision 849fc424)
1 /*
2  * (C) Masami Komiya <mkomiya@sonare.it> 2004
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2, or (at
7  * your option) any later version.
8  */
9 
10 #ifndef __NFS_H__
11 #define __NFS_H__
12 
13 #define SUNRPC_PORT     111
14 
15 #define PROG_PORTMAP    100000
16 #define PROG_NFS        100003
17 #define PROG_MOUNT      100005
18 
19 #define MSG_CALL        0
20 #define MSG_REPLY       1
21 
22 #define PORTMAP_GETPORT 3
23 
24 #define MOUNT_ADDENTRY  1
25 #define MOUNT_UMOUNTALL 4
26 
27 #define NFS_LOOKUP      4
28 #define NFS_READLINK    5
29 #define NFS_READ        6
30 
31 #define NFS_FHSIZE      32
32 
33 #define NFSERR_PERM     1
34 #define NFSERR_NOENT    2
35 #define NFSERR_ACCES    13
36 #define NFSERR_ISDIR    21
37 #define NFSERR_INVAL    22
38 
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, the config file may want to use a
42  * bigger value. In any case, most NFS servers are optimized for a power of 2.
43  */
44 #ifdef CONFIG_NFS_READ_SIZE
45 #define NFS_READ_SIZE CONFIG_NFS_READ_SIZE
46 #else
47 #define NFS_READ_SIZE 1024 /* biggest power of two that fits Ether frame */
48 #endif
49 
50 #define NFS_MAXLINKDEPTH 16
51 
52 struct rpc_t {
53 	union {
54 		uint8_t data[2048];
55 		struct {
56 			uint32_t id;
57 			uint32_t type;
58 			uint32_t rpcvers;
59 			uint32_t prog;
60 			uint32_t vers;
61 			uint32_t proc;
62 			uint32_t data[1];
63 		} call;
64 		struct {
65 			uint32_t id;
66 			uint32_t type;
67 			uint32_t rstatus;
68 			uint32_t verifier;
69 			uint32_t v2;
70 			uint32_t astatus;
71 			uint32_t data[19];
72 		} reply;
73 	} u;
74 };
75 extern void NfsStart(void);	/* Begin NFS */
76 
77 
78 /**********************************************************************/
79 
80 #endif /* __NFS_H__ */
81