Skip to content

Commit f970bec

Browse files
IoanaCiorneigregkh
authored andcommitted
staging: fsl-dpaa2/eth: document nested structs as per kernel-doc
Document nested structs per kernel-doc requirements by moving all comments before the actual struct. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5b91b73 commit f970bec

File tree

2 files changed

+99
-100
lines changed

2 files changed

+99
-100
lines changed

drivers/staging/fsl-dpaa2/ethernet/dpkg.h

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -89,45 +89,41 @@ struct dpkg_mask {
8989
/**
9090
* struct dpkg_extract - A structure for defining a single extraction
9191
* @type: Determines how the union below is interpreted:
92-
* DPKG_EXTRACT_FROM_HDR: selects 'from_hdr';
93-
* DPKG_EXTRACT_FROM_DATA: selects 'from_data';
94-
* DPKG_EXTRACT_FROM_PARSE: selects 'from_parse'
92+
* DPKG_EXTRACT_FROM_HDR: selects 'from_hdr';
93+
* DPKG_EXTRACT_FROM_DATA: selects 'from_data';
94+
* DPKG_EXTRACT_FROM_PARSE: selects 'from_parse'
9595
* @extract: Selects extraction method
96+
* @extract.from_hdr: Used when 'type = DPKG_EXTRACT_FROM_HDR'
97+
* @extract.from_data: Used when 'type = DPKG_EXTRACT_FROM_DATA'
98+
* @extract.from_parse: Used when 'type = DPKG_EXTRACT_FROM_PARSE'
99+
* @extract.from_hdr.prot: Any of the supported headers
100+
* @extract.from_hdr.type: Defines the type of header extraction:
101+
* DPKG_FROM_HDR: use size & offset below;
102+
* DPKG_FROM_FIELD: use field, size and offset below;
103+
* DPKG_FULL_FIELD: use field below
104+
* @extract.from_hdr.field: One of the supported fields (NH_FLD_)
105+
* @extract.from_hdr.size: Size in bytes
106+
* @extract.from_hdr.offset: Byte offset
107+
* @extract.from_hdr.hdr_index: Clear for cases not listed below;
108+
* Used for protocols that may have more than a single
109+
* header, 0 indicates an outer header;
110+
* Supported protocols (possible values):
111+
* NET_PROT_VLAN (0, HDR_INDEX_LAST);
112+
* NET_PROT_MPLS (0, 1, HDR_INDEX_LAST);
113+
* NET_PROT_IP(0, HDR_INDEX_LAST);
114+
* NET_PROT_IPv4(0, HDR_INDEX_LAST);
115+
* NET_PROT_IPv6(0, HDR_INDEX_LAST);
116+
* @extract.from_data.size: Size in bytes
117+
* @extract.from_data.offset: Byte offset
118+
* @extract.from_parse.size: Size in bytes
119+
* @extract.from_parse.offset: Byte offset
96120
* @num_of_byte_masks: Defines the number of valid entries in the array below;
97121
* This is also the number of bytes to be used as masks
98122
* @masks: Masks parameters
99123
*/
100124
struct dpkg_extract {
101125
enum dpkg_extract_type type;
102-
/**
103-
* union extract - Selects extraction method
104-
* @from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR'
105-
* @from_data - Used when 'type = DPKG_EXTRACT_FROM_DATA'
106-
* @from_parse - Used when 'type = DPKG_EXTRACT_FROM_PARSE'
107-
*/
108126
union {
109-
/**
110-
* struct from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR'
111-
* @prot: Any of the supported headers
112-
* @type: Defines the type of header extraction:
113-
* DPKG_FROM_HDR: use size & offset below;
114-
* DPKG_FROM_FIELD: use field, size and offset below;
115-
* DPKG_FULL_FIELD: use field below
116-
* @field: One of the supported fields (NH_FLD_)
117-
*
118-
* @size: Size in bytes
119-
* @offset: Byte offset
120-
* @hdr_index: Clear for cases not listed below;
121-
* Used for protocols that may have more than a single
122-
* header, 0 indicates an outer header;
123-
* Supported protocols (possible values):
124-
* NET_PROT_VLAN (0, HDR_INDEX_LAST);
125-
* NET_PROT_MPLS (0, 1, HDR_INDEX_LAST);
126-
* NET_PROT_IP(0, HDR_INDEX_LAST);
127-
* NET_PROT_IPv4(0, HDR_INDEX_LAST);
128-
* NET_PROT_IPv6(0, HDR_INDEX_LAST);
129-
*/
130-
131127
struct {
132128
enum net_prot prot;
133129
enum dpkg_extract_from_hdr_type type;
@@ -136,22 +132,10 @@ struct dpkg_extract {
136132
u8 offset;
137133
u8 hdr_index;
138134
} from_hdr;
139-
/**
140-
* struct from_data - Used when 'type = DPKG_EXTRACT_FROM_DATA'
141-
* @size: Size in bytes
142-
* @offset: Byte offset
143-
*/
144135
struct {
145136
u8 size;
146137
u8 offset;
147138
} from_data;
148-
149-
/**
150-
* struct from_parse - Used when
151-
* 'type = DPKG_EXTRACT_FROM_PARSE'
152-
* @size: Size in bytes
153-
* @offset: Byte offset
154-
*/
155139
struct {
156140
u8 size;
157141
u8 offset;

drivers/staging/fsl-dpaa2/ethernet/dpni.h

Lines changed: 72 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,12 @@ int dpni_close(struct fsl_mc_io *mc_io,
117117
* @num_dpbp: Number of DPBPs
118118
* @pools: Array of buffer pools parameters; The number of valid entries
119119
* must match 'num_dpbp' value
120+
* @pools.dpbp_id: DPBP object ID
121+
* @pools.buffer_size: Buffer size
122+
* @pools.backup_pool: Backup pool
120123
*/
121124
struct dpni_pools_cfg {
122125
u8 num_dpbp;
123-
/**
124-
* struct pools - Buffer pools parameters
125-
* @dpbp_id: DPBP object ID
126-
* @buffer_size: Buffer size
127-
* @backup_pool: Backup pool
128-
*/
129126
struct {
130127
int dpbp_id;
131128
u16 buffer_size;
@@ -424,16 +421,32 @@ int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
424421

425422
#define DPNI_STATISTICS_CNT 7
426423

424+
/**
425+
* union dpni_statistics - Union describing the DPNI statistics
426+
* @page_0: Page_0 statistics structure
427+
* @page_0.ingress_all_frames: Ingress frame count
428+
* @page_0.ingress_all_bytes: Ingress byte count
429+
* @page_0.ingress_multicast_frames: Ingress multicast frame count
430+
* @page_0.ingress_multicast_bytes: Ingress multicast byte count
431+
* @page_0.ingress_broadcast_frames: Ingress broadcast frame count
432+
* @page_0.ingress_broadcast_bytes: Ingress broadcast byte count
433+
* @page_1: Page_1 statistics structure
434+
* @page_1.egress_all_frames: Egress frame count
435+
* @page_1.egress_all_bytes: Egress byte count
436+
* @page_1.egress_multicast_frames: Egress multicast frame count
437+
* @page_1.egress_multicast_bytes: Egress multicast byte count
438+
* @page_1.egress_broadcast_frames: Egress broadcast frame count
439+
* @page_1.egress_broadcast_bytes: Egress broadcast byte count
440+
* @page_2: Page_2 statistics structure
441+
* @page_2.ingress_filtered_frames: Ingress filtered frame count
442+
* @page_2.ingress_discarded_frames: Ingress discarded frame count
443+
* @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to
444+
* lack of buffers
445+
* @page_2.egress_discarded_frames: Egress discarded frame count
446+
* @page_2.egress_confirmed_frames: Egress confirmed frame count
447+
* @raw: raw statistics structure, used to index counters
448+
*/
427449
union dpni_statistics {
428-
/**
429-
* struct page_0 - Page_0 statistics structure
430-
* @ingress_all_frames: Ingress frame count
431-
* @ingress_all_bytes: Ingress byte count
432-
* @ingress_multicast_frames: Ingress multicast frame count
433-
* @ingress_multicast_bytes: Ingress multicast byte count
434-
* @ingress_broadcast_frames: Ingress broadcast frame count
435-
* @ingress_broadcast_bytes: Ingress broadcast byte count
436-
*/
437450
struct {
438451
u64 ingress_all_frames;
439452
u64 ingress_all_bytes;
@@ -442,15 +455,6 @@ union dpni_statistics {
442455
u64 ingress_broadcast_frames;
443456
u64 ingress_broadcast_bytes;
444457
} page_0;
445-
/**
446-
* struct page_1 - Page_1 statistics structure
447-
* @egress_all_frames: Egress frame count
448-
* @egress_all_bytes: Egress byte count
449-
* @egress_multicast_frames: Egress multicast frame count
450-
* @egress_multicast_bytes: Egress multicast byte count
451-
* @egress_broadcast_frames: Egress broadcast frame count
452-
* @egress_broadcast_bytes: Egress broadcast byte count
453-
*/
454458
struct {
455459
u64 egress_all_frames;
456460
u64 egress_all_bytes;
@@ -459,25 +463,13 @@ union dpni_statistics {
459463
u64 egress_broadcast_frames;
460464
u64 egress_broadcast_bytes;
461465
} page_1;
462-
/**
463-
* struct page_2 - Page_2 statistics structure
464-
* @ingress_filtered_frames: Ingress filtered frame count
465-
* @ingress_discarded_frames: Ingress discarded frame count
466-
* @ingress_nobuffer_discards: Ingress discarded frame count
467-
* due to lack of buffers
468-
* @egress_discarded_frames: Egress discarded frame count
469-
* @egress_confirmed_frames: Egress confirmed frame count
470-
*/
471466
struct {
472467
u64 ingress_filtered_frames;
473468
u64 ingress_discarded_frames;
474469
u64 ingress_nobuffer_discards;
475470
u64 egress_discarded_frames;
476471
u64 egress_confirmed_frames;
477472
} page_2;
478-
/**
479-
* struct raw - raw statistics structure
480-
*/
481473
struct {
482474
u64 counter[DPNI_STATISTICS_CNT];
483475
} raw;
@@ -685,29 +677,52 @@ enum dpni_dest {
685677

686678
/**
687679
* struct dpni_queue - Queue structure
688-
* @user_context: User data, presented to the user along with any frames from
689-
* this queue. Not relevant for Tx queues.
690-
*/
691-
struct dpni_queue {
692-
/**
693-
* struct destination - Destination structure
694-
* @id: ID of the destination, only relevant if DEST_TYPE is > 0.
695-
* Identifies either a DPIO or a DPCON object. Not relevant for
696-
* Tx queues.
697-
* @type: May be one of the following:
698-
* 0 - No destination, queue can be manually queried, but will not
699-
* push traffic or notifications to a DPIO;
700-
* 1 - The destination is a DPIO. When traffic becomes available in
701-
* the queue a FQDAN (FQ data available notification) will be
680+
* @destination - Destination structure
681+
* @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0.
682+
* Identifies either a DPIO or a DPCON object.
683+
* Not relevant for Tx queues.
684+
* @destination.type: May be one of the following:
685+
* 0 - No destination, queue can be manually
686+
* queried, but will not push traffic or
687+
* notifications to a DPIO;
688+
* 1 - The destination is a DPIO. When traffic
689+
* becomes available in the queue a FQDAN
690+
* (FQ data available notification) will be
702691
* generated to selected DPIO;
703-
* 2 - The destination is a DPCON. The queue is associated with a
704-
* DPCON object for the purpose of scheduling between multiple
705-
* queues. The DPCON may be independently configured to
706-
* generate notifications. Not relevant for Tx queues.
707-
* @hold_active: Hold active, maintains a queue scheduled for longer
708-
* in a DPIO during dequeue to reduce spread of traffic.
709-
* Only relevant if queues are not affined to a single DPIO.
692+
* 2 - The destination is a DPCON. The queue is
693+
* associated with a DPCON object for the
694+
* purpose of scheduling between multiple
695+
* queues. The DPCON may be independently
696+
* configured to generate notifications.
697+
* Not relevant for Tx queues.
698+
* @destination.hold_active: Hold active, maintains a queue scheduled for longer
699+
* in a DPIO during dequeue to reduce spread of traffic.
700+
* Only relevant if queues are
701+
* not affined to a single DPIO.
702+
* @user_context: User data, presented to the user along with any frames
703+
* from this queue. Not relevant for Tx queues.
704+
* @flc: FD FLow Context structure
705+
* @flc.value: Default FLC value for traffic dequeued from
706+
* this queue. Please check description of FD
707+
* structure for more information.
708+
* Note that FLC values set using dpni_add_fs_entry,
709+
* if any, take precedence over values per queue.
710+
* @flc.stash_control: Boolean, indicates whether the 6 lowest
711+
* - significant bits are used for stash control.
712+
* significant bits are used for stash control. If set, the 6
713+
* least significant bits in value are interpreted as follows:
714+
* - bits 0-1: indicates the number of 64 byte units of context
715+
* that are stashed. FLC value is interpreted as a memory address
716+
* in this case, excluding the 6 LS bits.
717+
* - bits 2-3: indicates the number of 64 byte units of frame
718+
* annotation to be stashed. Annotation is placed at FD[ADDR].
719+
* - bits 4-5: indicates the number of 64 byte units of frame
720+
* data to be stashed. Frame data is placed at FD[ADDR] +
721+
* FD[OFFSET].
722+
* For more details check the Frame Descriptor section in the
723+
* hardware documentation.
710724
*/
725+
struct dpni_queue {
711726
struct {
712727
u16 id;
713728
enum dpni_dest type;

0 commit comments

Comments
 (0)