@@ -138,6 +138,11 @@ where
138
138
self . state . avail_idx ( self . mem . deref ( ) , order)
139
139
}
140
140
141
+ /// Read the `idx` field from the used ring.
142
+ pub fn used_idx ( & self , order : Ordering ) -> Result < Wrapping < u16 > , Error > {
143
+ self . state . used_idx ( self . mem . deref ( ) , order)
144
+ }
145
+
141
146
/// Put a used descriptor head into the used ring.
142
147
pub fn add_used ( & mut self , head_index : u16 , len : u32 ) -> Result < ( ) , Error > {
143
148
self . state . add_used ( self . mem . deref ( ) , head_index, len)
@@ -172,11 +177,21 @@ where
172
177
self . state . next_avail ( )
173
178
}
174
179
180
+ /// Return the index of the next entry in the used ring.
181
+ pub fn next_used ( & self ) -> u16 {
182
+ self . state . next_used ( )
183
+ }
184
+
175
185
/// Set the index of the next entry in the available ring.
176
186
pub fn set_next_avail ( & mut self , next_avail : u16 ) {
177
187
self . state . set_next_avail ( next_avail) ;
178
188
}
179
189
190
+ /// Set the index of the next entry in the used ring.
191
+ pub fn set_next_used ( & mut self , next_used : u16 ) {
192
+ self . state . set_next_used ( next_used) ;
193
+ }
194
+
180
195
/// Get a consuming iterator over all available descriptor chain heads offered by the driver.
181
196
pub fn iter ( & mut self ) -> Result < AvailIter < ' _ , M > , Error > {
182
197
self . state . deref_mut ( ) . iter ( self . mem . clone ( ) )
0 commit comments