191 */
192 typedef enum {
193 MR_FREE, /* Available for assignment to flows */
194 MR_NEWLY_ADDED, /* Just assigned to another group */
195 MR_INUSE /* Assigned to an SRS */
196 } mac_ring_state_t;
197
198 /* mr_flag values */
199 #define MR_INCIPIENT 0x1
200 #define MR_CONDEMNED 0x2
201 #define MR_QUIESCE 0x4
202
203 typedef struct mac_impl_s mac_impl_t;
204
205 struct mac_ring_s {
206 int mr_index; /* index in the original list */
207 mac_ring_type_t mr_type; /* ring type */
208 mac_ring_t *mr_next; /* next ring in the chain */
209 mac_group_handle_t mr_gh; /* reference to group */
210
211 mac_classify_type_t mr_classify_type; /* HW vs SW */
212 struct mac_soft_ring_set_s *mr_srs; /* associated SRS */
213 mac_ring_handle_t mr_prh; /* associated pseudo ring hdl */
214 uint_t mr_refcnt; /* Ring references */
215 /* ring generation no. to guard against drivers using stale rings */
216 uint64_t mr_gen_num;
217
218 kstat_t *mr_ksp; /* ring kstats */
219 mac_impl_t *mr_mip; /* pointer to primary's mip */
220
221 kmutex_t mr_lock;
222 kcondvar_t mr_cv; /* mr_lock */
223 mac_ring_state_t mr_state; /* mr_lock */
224 uint_t mr_flag; /* mr_lock */
225
226 mac_ring_info_t mr_info; /* driver supplied info */
227 };
228 #define mr_driver mr_info.mri_driver
229 #define mr_start mr_info.mri_start
230 #define mr_stop mr_info.mri_stop
231 #define mr_stat mr_info.mri_stat
232
233 #define MAC_RING_MARK(mr, flag) \
|
191 */
192 typedef enum {
193 MR_FREE, /* Available for assignment to flows */
194 MR_NEWLY_ADDED, /* Just assigned to another group */
195 MR_INUSE /* Assigned to an SRS */
196 } mac_ring_state_t;
197
198 /* mr_flag values */
199 #define MR_INCIPIENT 0x1
200 #define MR_CONDEMNED 0x2
201 #define MR_QUIESCE 0x4
202
203 typedef struct mac_impl_s mac_impl_t;
204
205 struct mac_ring_s {
206 int mr_index; /* index in the original list */
207 mac_ring_type_t mr_type; /* ring type */
208 mac_ring_t *mr_next; /* next ring in the chain */
209 mac_group_handle_t mr_gh; /* reference to group */
210
211 mac_classify_type_t mr_classify_type;
212 struct mac_soft_ring_set_s *mr_srs; /* associated SRS */
213 mac_ring_handle_t mr_prh; /* associated pseudo ring hdl */
214
215 /*
216 * Ring passthru callback and arguments. See the
217 * MAC_PASSTHRU_CLASSIFIER comment in mac_provider.h.
218 */
219 mac_rx_t mr_pt_fn;
220 void *mr_pt_arg1;
221 mac_resource_handle_t mr_pt_arg2;
222
223 uint_t mr_refcnt; /* Ring references */
224 /* ring generation no. to guard against drivers using stale rings */
225 uint64_t mr_gen_num;
226
227 kstat_t *mr_ksp; /* ring kstats */
228 mac_impl_t *mr_mip; /* pointer to primary's mip */
229
230 kmutex_t mr_lock;
231 kcondvar_t mr_cv; /* mr_lock */
232 mac_ring_state_t mr_state; /* mr_lock */
233 uint_t mr_flag; /* mr_lock */
234
235 mac_ring_info_t mr_info; /* driver supplied info */
236 };
237 #define mr_driver mr_info.mri_driver
238 #define mr_start mr_info.mri_start
239 #define mr_stop mr_info.mri_stop
240 #define mr_stat mr_info.mri_stat
241
242 #define MAC_RING_MARK(mr, flag) \
|