diff options
Diffstat (limited to 'include/net/9p/9p.h')
-rw-r--r-- | include/net/9p/9p.h | 193 |
1 files changed, 15 insertions, 178 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 008711e8e78f..342dcf13d039 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -40,6 +40,7 @@ | |||
40 | * @P9_DEBUG_FID: fid allocation/deallocation tracking | 40 | * @P9_DEBUG_FID: fid allocation/deallocation tracking |
41 | * @P9_DEBUG_PKT: packet marshalling/unmarshalling | 41 | * @P9_DEBUG_PKT: packet marshalling/unmarshalling |
42 | * @P9_DEBUG_FSC: FS-cache tracing | 42 | * @P9_DEBUG_FSC: FS-cache tracing |
43 | * @P9_DEBUG_VPKT: Verbose packet debugging (full packet dump) | ||
43 | * | 44 | * |
44 | * These flags are passed at mount time to turn on various levels of | 45 | * These flags are passed at mount time to turn on various levels of |
45 | * verbosity and tracing which will be output to the system logs. | 46 | * verbosity and tracing which will be output to the system logs. |
@@ -57,6 +58,7 @@ enum p9_debug_flags { | |||
57 | P9_DEBUG_FID = (1<<9), | 58 | P9_DEBUG_FID = (1<<9), |
58 | P9_DEBUG_PKT = (1<<10), | 59 | P9_DEBUG_PKT = (1<<10), |
59 | P9_DEBUG_FSC = (1<<11), | 60 | P9_DEBUG_FSC = (1<<11), |
61 | P9_DEBUG_VPKT = (1<<12), | ||
60 | }; | 62 | }; |
61 | 63 | ||
62 | #ifdef CONFIG_NET_9P_DEBUG | 64 | #ifdef CONFIG_NET_9P_DEBUG |
@@ -74,10 +76,14 @@ do { \ | |||
74 | } \ | 76 | } \ |
75 | } while (0) | 77 | } while (0) |
76 | 78 | ||
79 | #define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu) | ||
80 | |||
77 | #else | 81 | #else |
78 | #define P9_DPRINTK(level, format, arg...) do { } while (0) | 82 | #define P9_DPRINTK(level, format, arg...) do { } while (0) |
83 | #define P9_DUMP_PKT(way, pdu) do { } while (0) | ||
79 | #endif | 84 | #endif |
80 | 85 | ||
86 | |||
81 | #define P9_EPRINTK(level, format, arg...) \ | 87 | #define P9_EPRINTK(level, format, arg...) \ |
82 | do { \ | 88 | do { \ |
83 | printk(level "9p: %s (%d): " \ | 89 | printk(level "9p: %s (%d): " \ |
@@ -175,6 +181,10 @@ enum p9_msg_t { | |||
175 | P9_RLINK, | 181 | P9_RLINK, |
176 | P9_TMKDIR = 72, | 182 | P9_TMKDIR = 72, |
177 | P9_RMKDIR, | 183 | P9_RMKDIR, |
184 | P9_TRENAMEAT = 74, | ||
185 | P9_RRENAMEAT, | ||
186 | P9_TUNLINKAT = 76, | ||
187 | P9_RUNLINKAT, | ||
178 | P9_TVERSION = 100, | 188 | P9_TVERSION = 100, |
179 | P9_RVERSION, | 189 | P9_RVERSION, |
180 | P9_TAUTH = 102, | 190 | P9_TAUTH = 102, |
@@ -321,21 +331,6 @@ enum p9_qid_t { | |||
321 | #define P9_READDIRHDRSZ 24 | 331 | #define P9_READDIRHDRSZ 24 |
322 | 332 | ||
323 | /** | 333 | /** |
324 | * struct p9_str - length prefixed string type | ||
325 | * @len: length of the string | ||
326 | * @str: the string | ||
327 | * | ||
328 | * The protocol uses length prefixed strings for all | ||
329 | * string data, so we replicate that for our internal | ||
330 | * string members. | ||
331 | */ | ||
332 | |||
333 | struct p9_str { | ||
334 | u16 len; | ||
335 | char *str; | ||
336 | }; | ||
337 | |||
338 | /** | ||
339 | * struct p9_qid - file system entity information | 334 | * struct p9_qid - file system entity information |
340 | * @type: 8-bit type &p9_qid_t | 335 | * @type: 8-bit type &p9_qid_t |
341 | * @version: 16-bit monotonically incrementing version number | 336 | * @version: 16-bit monotonically incrementing version number |
@@ -371,11 +366,11 @@ struct p9_qid { | |||
371 | * @atime: Last access/read time | 366 | * @atime: Last access/read time |
372 | * @mtime: Last modify/write time | 367 | * @mtime: Last modify/write time |
373 | * @length: file length | 368 | * @length: file length |
374 | * @name: last element of path (aka filename) in type &p9_str | 369 | * @name: last element of path (aka filename) |
375 | * @uid: owner name in type &p9_str | 370 | * @uid: owner name |
376 | * @gid: group owner in type &p9_str | 371 | * @gid: group owner |
377 | * @muid: last modifier in type &p9_str | 372 | * @muid: last modifier |
378 | * @extension: area used to encode extended UNIX support in type &p9_str | 373 | * @extension: area used to encode extended UNIX support |
379 | * @n_uid: numeric user id of owner (part of 9p2000.u extension) | 374 | * @n_uid: numeric user id of owner (part of 9p2000.u extension) |
380 | * @n_gid: numeric group id (part of 9p2000.u extension) | 375 | * @n_gid: numeric group id (part of 9p2000.u extension) |
381 | * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension) | 376 | * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension) |
@@ -512,11 +507,6 @@ struct p9_getlock { | |||
512 | char *client_id; | 507 | char *client_id; |
513 | }; | 508 | }; |
514 | 509 | ||
515 | /* Structures for Protocol Operations */ | ||
516 | struct p9_tstatfs { | ||
517 | u32 fid; | ||
518 | }; | ||
519 | |||
520 | struct p9_rstatfs { | 510 | struct p9_rstatfs { |
521 | u32 type; | 511 | u32 type; |
522 | u32 bsize; | 512 | u32 bsize; |
@@ -529,159 +519,6 @@ struct p9_rstatfs { | |||
529 | u32 namelen; | 519 | u32 namelen; |
530 | }; | 520 | }; |
531 | 521 | ||
532 | struct p9_trename { | ||
533 | u32 fid; | ||
534 | u32 newdirfid; | ||
535 | struct p9_str name; | ||
536 | }; | ||
537 | |||
538 | struct p9_rrename { | ||
539 | }; | ||
540 | |||
541 | struct p9_tversion { | ||
542 | u32 msize; | ||
543 | struct p9_str version; | ||
544 | }; | ||
545 | |||
546 | struct p9_rversion { | ||
547 | u32 msize; | ||
548 | struct p9_str version; | ||
549 | }; | ||
550 | |||
551 | struct p9_tauth { | ||
552 | u32 afid; | ||
553 | struct p9_str uname; | ||
554 | struct p9_str aname; | ||
555 | u32 n_uname; /* 9P2000.u extensions */ | ||
556 | }; | ||
557 | |||
558 | struct p9_rauth { | ||
559 | struct p9_qid qid; | ||
560 | }; | ||
561 | |||
562 | struct p9_rerror { | ||
563 | struct p9_str error; | ||
564 | u32 errno; /* 9p2000.u extension */ | ||
565 | }; | ||
566 | |||
567 | struct p9_tflush { | ||
568 | u16 oldtag; | ||
569 | }; | ||
570 | |||
571 | struct p9_rflush { | ||
572 | }; | ||
573 | |||
574 | struct p9_tattach { | ||
575 | u32 fid; | ||
576 | u32 afid; | ||
577 | struct p9_str uname; | ||
578 | struct p9_str aname; | ||
579 | u32 n_uname; /* 9P2000.u extensions */ | ||
580 | }; | ||
581 | |||
582 | struct p9_rattach { | ||
583 | struct p9_qid qid; | ||
584 | }; | ||
585 | |||
586 | struct p9_twalk { | ||
587 | u32 fid; | ||
588 | u32 newfid; | ||
589 | u16 nwname; | ||
590 | struct p9_str wnames[16]; | ||
591 | }; | ||
592 | |||
593 | struct p9_rwalk { | ||
594 | u16 nwqid; | ||
595 | struct p9_qid wqids[16]; | ||
596 | }; | ||
597 | |||
598 | struct p9_topen { | ||
599 | u32 fid; | ||
600 | u8 mode; | ||
601 | }; | ||
602 | |||
603 | struct p9_ropen { | ||
604 | struct p9_qid qid; | ||
605 | u32 iounit; | ||
606 | }; | ||
607 | |||
608 | struct p9_tcreate { | ||
609 | u32 fid; | ||
610 | struct p9_str name; | ||
611 | u32 perm; | ||
612 | u8 mode; | ||
613 | struct p9_str extension; | ||
614 | }; | ||
615 | |||
616 | struct p9_rcreate { | ||
617 | struct p9_qid qid; | ||
618 | u32 iounit; | ||
619 | }; | ||
620 | |||
621 | struct p9_tread { | ||
622 | u32 fid; | ||
623 | u64 offset; | ||
624 | u32 count; | ||
625 | }; | ||
626 | |||
627 | struct p9_rread { | ||
628 | u32 count; | ||
629 | u8 *data; | ||
630 | }; | ||
631 | |||
632 | struct p9_twrite { | ||
633 | u32 fid; | ||
634 | u64 offset; | ||
635 | u32 count; | ||
636 | u8 *data; | ||
637 | }; | ||
638 | |||
639 | struct p9_rwrite { | ||
640 | u32 count; | ||
641 | }; | ||
642 | |||
643 | struct p9_treaddir { | ||
644 | u32 fid; | ||
645 | u64 offset; | ||
646 | u32 count; | ||
647 | }; | ||
648 | |||
649 | struct p9_rreaddir { | ||
650 | u32 count; | ||
651 | u8 *data; | ||
652 | }; | ||
653 | |||
654 | |||
655 | struct p9_tclunk { | ||
656 | u32 fid; | ||
657 | }; | ||
658 | |||
659 | struct p9_rclunk { | ||
660 | }; | ||
661 | |||
662 | struct p9_tremove { | ||
663 | u32 fid; | ||
664 | }; | ||
665 | |||
666 | struct p9_rremove { | ||
667 | }; | ||
668 | |||
669 | struct p9_tstat { | ||
670 | u32 fid; | ||
671 | }; | ||
672 | |||
673 | struct p9_rstat { | ||
674 | struct p9_wstat stat; | ||
675 | }; | ||
676 | |||
677 | struct p9_twstat { | ||
678 | u32 fid; | ||
679 | struct p9_wstat stat; | ||
680 | }; | ||
681 | |||
682 | struct p9_rwstat { | ||
683 | }; | ||
684 | |||
685 | /** | 522 | /** |
686 | * struct p9_fcall - primary packet structure | 523 | * struct p9_fcall - primary packet structure |
687 | * @size: prefixed length of the structure | 524 | * @size: prefixed length of the structure |