wdenk | cbd8a35 | 2004-02-24 02:00:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Masami Komiya <mkomiya@sonare.it> 2004 |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | cbd8a35 | 2004-02-24 02:00:03 +0000 | [diff] [blame] | 5 | */ |
| 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 Rubini | bd931ca | 2009-08-07 13:59:16 +0200 | [diff] [blame] | 38 | * 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 |
wdenk | cbd8a35 | 2004-02-24 02:00:03 +0000 | [diff] [blame] | 46 | |
| 47 | #define NFS_MAXLINKDEPTH 16 |
| 48 | |
| 49 | struct 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; |
wdenk | 11dadd54 | 2004-02-27 00:07:27 +0000 | [diff] [blame] | 68 | uint32_t data[19]; |
wdenk | cbd8a35 | 2004-02-24 02:00:03 +0000 | [diff] [blame] | 69 | } reply; |
| 70 | } u; |
| 71 | }; |
Joe Hershberger | c9f6c91 | 2012-05-15 08:59:09 +0000 | [diff] [blame] | 72 | extern void NfsStart(void); /* Begin NFS */ |
wdenk | cbd8a35 | 2004-02-24 02:00:03 +0000 | [diff] [blame] | 73 | |
| 74 | |
| 75 | /**********************************************************************/ |
| 76 | |
| 77 | #endif /* __NFS_H__ */ |