Print this page
11490 SRS ring polling disabled for VLANs
11491 Want DLS bypass for VLAN traffic
11492 add VLVF bypass to ixgbe core
2869 duplicate packets with vnics over aggrs
11489 DLS stat delete and aggr kstat can deadlock
Portions contributed by: Theo Schlossnagle <jesus@omniti.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/mac_impl.h
+++ new/usr/src/uts/common/sys/mac_impl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 - * Copyright (c) 2017, Joyent, Inc.
23 + * Copyright (c) 2018, Joyent, Inc.
24 24 */
25 25
26 26 #ifndef _SYS_MAC_IMPL_H
27 27 #define _SYS_MAC_IMPL_H
28 28
29 29 #include <sys/cpupart.h>
30 30 #include <sys/modhash.h>
31 31 #include <sys/mac_client.h>
32 32 #include <sys/mac_provider.h>
33 33 #include <sys/note.h>
34 34 #include <sys/avl.h>
35 35 #include <net/if.h>
36 36 #include <sys/mac_flow_impl.h>
37 37 #include <netinet/ip6.h>
38 38
39 39 #ifdef __cplusplus
40 40 extern "C" {
41 41 #endif
42 42
43 43 /*
44 44 * This is the first minor number available for MAC provider private
45 45 * use. This makes it possible to deliver a driver that is both a MAC
46 46 * provider and a regular character/block device. See PSARC 2009/380
47 47 * for more detail about the construction of such devices. The value
48 48 * chosen leaves half of the 32-bit minor numbers (which are really
49 49 * only 18 bits wide) available for driver private use. Drivers can
50 50 * easily identify their private number by the presence of this value
51 51 * in the bits that make up the minor number, since its just the
52 52 * highest bit available for such minor numbers.
53 53 */
54 54 #define MAC_PRIVATE_MINOR ((MAXMIN32 + 1) / 2)
55 55
56 56 /*
57 57 * The maximum minor number that corresponds to a real instance. This
58 58 * limits the number of physical ports that a mac provider can offer.
59 59 * Note that this macro must be synchronized with DLS_MAX_MINOR in
60 60 * <sys/dls.h>
61 61 */
62 62 #define MAC_MAX_MINOR 1000
63 63
64 64 typedef struct mac_margin_req_s mac_margin_req_t;
65 65
66 66 struct mac_margin_req_s {
67 67 mac_margin_req_t *mmr_nextp;
68 68 uint_t mmr_ref;
69 69 uint32_t mmr_margin;
70 70 };
71 71
72 72 typedef struct mac_mtu_req_s mac_mtu_req_t;
73 73 struct mac_mtu_req_s {
74 74 mac_mtu_req_t *mtr_nextp;
75 75 uint_t mtr_ref;
76 76 uint32_t mtr_mtu;
77 77 };
78 78
79 79 /* Generic linked chain type */
80 80 typedef struct mac_chain_s {
81 81 struct mac_chain_s *next;
82 82 void *item;
83 83 } mac_chain_t;
84 84
85 85 /*
86 86 * Generic mac callback list manipulation structures and macros. The mac_cb_t
87 87 * represents a general callback list element embedded in a particular
88 88 * data structure such as a mac_notify_cb_t or a mac_promisc_impl_t.
89 89 * The mac_cb_info_t represents general information about list walkers.
90 90 * Please see the comments above mac_callback_add for more information.
91 91 */
92 92 /* mcb_flags */
93 93 #define MCB_CONDEMNED 0x1 /* Logically deleted */
94 94 #define MCB_NOTIFY_CB_T 0x2
95 95 #define MCB_TX_NOTIFY_CB_T 0x4
96 96
97 97 extern boolean_t mac_tx_serialize;
98 98
99 99 typedef struct mac_cb_s {
100 100 struct mac_cb_s *mcb_nextp; /* Linked list of callbacks */
101 101 void *mcb_objp; /* Ptr to enclosing object */
102 102 size_t mcb_objsize; /* Sizeof the enclosing obj */
103 103 uint_t mcb_flags;
104 104 } mac_cb_t;
105 105
106 106 typedef struct mac_cb_info_s {
107 107 kmutex_t *mcbi_lockp;
108 108 kcondvar_t mcbi_cv;
109 109 uint_t mcbi_del_cnt; /* Deleted callback cnt */
110 110 uint_t mcbi_walker_cnt; /* List walker count */
111 111 } mac_cb_info_t;
112 112
113 113 typedef struct mac_notify_cb_s {
114 114 mac_cb_t mncb_link; /* Linked list of callbacks */
115 115 mac_notify_t mncb_fn; /* callback function */
116 116 void *mncb_arg; /* callback argument */
117 117 struct mac_impl_s *mncb_mip;
118 118 } mac_notify_cb_t;
119 119
120 120 /*
121 121 * mac_callback_add(listinfo, listhead, listelement)
122 122 * mac_callback_remove(listinfo, listhead, listelement)
123 123 */
124 124 typedef boolean_t (*mcb_func_t)(mac_cb_info_t *, mac_cb_t **, mac_cb_t *);
125 125
126 126 #define MAC_CALLBACK_WALKER_INC(mcbi) { \
127 127 mutex_enter((mcbi)->mcbi_lockp); \
128 128 (mcbi)->mcbi_walker_cnt++; \
129 129 mutex_exit((mcbi)->mcbi_lockp); \
130 130 }
131 131
132 132 #define MAC_CALLBACK_WALKER_INC_HELD(mcbi) (mcbi)->mcbi_walker_cnt++;
133 133
134 134 #define MAC_CALLBACK_WALKER_DCR(mcbi, headp) { \
135 135 mac_cb_t *rmlist; \
136 136 \
137 137 mutex_enter((mcbi)->mcbi_lockp); \
138 138 if (--(mcbi)->mcbi_walker_cnt == 0 && (mcbi)->mcbi_del_cnt != 0) { \
139 139 rmlist = mac_callback_walker_cleanup((mcbi), headp); \
140 140 mac_callback_free(rmlist); \
141 141 cv_broadcast(&(mcbi)->mcbi_cv); \
142 142 } \
143 143 mutex_exit((mcbi)->mcbi_lockp); \
144 144 }
145 145
146 146 #define MAC_PROMISC_WALKER_INC(mip) \
147 147 MAC_CALLBACK_WALKER_INC(&(mip)->mi_promisc_cb_info)
148 148
149 149 #define MAC_PROMISC_WALKER_DCR(mip) { \
150 150 mac_cb_info_t *mcbi; \
151 151 \
152 152 mcbi = &(mip)->mi_promisc_cb_info; \
153 153 mutex_enter(mcbi->mcbi_lockp); \
154 154 if (--mcbi->mcbi_walker_cnt == 0 && mcbi->mcbi_del_cnt != 0) { \
155 155 i_mac_promisc_walker_cleanup(mip); \
156 156 cv_broadcast(&mcbi->mcbi_cv); \
157 157 } \
158 158 mutex_exit(mcbi->mcbi_lockp); \
159 159 }
160 160
161 161 typedef struct mactype_s {
162 162 const char *mt_ident;
163 163 uint32_t mt_ref;
164 164 uint_t mt_type;
165 165 uint_t mt_nativetype;
166 166 size_t mt_addr_length;
167 167 uint8_t *mt_brdcst_addr;
168 168 mactype_ops_t mt_ops;
169 169 mac_stat_info_t *mt_stats; /* array of mac_stat_info_t elements */
170 170 size_t mt_statcount; /* number of elements in mt_stats */
171 171 mac_ndd_mapping_t *mt_mapping;
172 172 size_t mt_mappingcount;
173 173 } mactype_t;
174 174
175 175 /*
176 176 * Multiple rings implementation.
177 177 */
178 178 typedef enum {
179 179 MAC_GROUP_STATE_UNINIT = 0, /* initial state of data structure */
180 180 MAC_GROUP_STATE_REGISTERED, /* hooked with h/w group */
181 181 MAC_GROUP_STATE_RESERVED, /* group is reserved and opened */
182 182 MAC_GROUP_STATE_SHARED /* default group shared among */
183 183 /* multiple mac clients */
184 184 } mac_group_state_t;
185 185
186 186 typedef struct mac_ring_s mac_ring_t;
187 187 typedef struct mac_group_s mac_group_t;
188 188
189 189 /*
190 190 * Ring data structure for ring control and management.
191 191 */
192 192 typedef enum {
193 193 MR_FREE, /* Available for assignment to flows */
194 194 MR_NEWLY_ADDED, /* Just assigned to another group */
195 195 MR_INUSE /* Assigned to an SRS */
196 196 } mac_ring_state_t;
197 197
198 198 /* mr_flag values */
199 199 #define MR_INCIPIENT 0x1
200 200 #define MR_CONDEMNED 0x2
201 201 #define MR_QUIESCE 0x4
202 202
203 203 typedef struct mac_impl_s mac_impl_t;
204 204
205 205 struct mac_ring_s {
206 206 int mr_index; /* index in the original list */
207 207 mac_ring_type_t mr_type; /* ring type */
208 208 mac_ring_t *mr_next; /* next ring in the chain */
209 209 mac_group_handle_t mr_gh; /* reference to group */
210 210
211 211 mac_classify_type_t mr_classify_type; /* HW vs SW */
212 212 struct mac_soft_ring_set_s *mr_srs; /* associated SRS */
213 213 mac_ring_handle_t mr_prh; /* associated pseudo ring hdl */
214 214 uint_t mr_refcnt; /* Ring references */
215 215 /* ring generation no. to guard against drivers using stale rings */
216 216 uint64_t mr_gen_num;
217 217
218 218 kstat_t *mr_ksp; /* ring kstats */
219 219 mac_impl_t *mr_mip; /* pointer to primary's mip */
220 220
221 221 kmutex_t mr_lock;
222 222 kcondvar_t mr_cv; /* mr_lock */
223 223 mac_ring_state_t mr_state; /* mr_lock */
224 224 uint_t mr_flag; /* mr_lock */
225 225
226 226 mac_ring_info_t mr_info; /* driver supplied info */
227 227 };
228 228 #define mr_driver mr_info.mri_driver
229 229 #define mr_start mr_info.mri_start
230 230 #define mr_stop mr_info.mri_stop
231 231 #define mr_stat mr_info.mri_stat
232 232
233 233 #define MAC_RING_MARK(mr, flag) \
234 234 (mr)->mr_flag |= flag;
235 235
236 236 #define MAC_RING_UNMARK(mr, flag) \
↓ open down ↓ |
203 lines elided |
↑ open up ↑ |
237 237 (mr)->mr_flag &= ~flag;
238 238
239 239 /*
240 240 * Reference hold and release on mac_ring_t 'mr'
241 241 */
242 242 #define MR_REFHOLD_LOCKED(mr) { \
243 243 ASSERT(MUTEX_HELD(&mr->mr_lock)); \
244 244 (mr)->mr_refcnt++; \
245 245 }
246 246
247 -#define MR_REFRELE(mr) { \
247 +#define MR_REFRELE(mr) { \
248 248 mutex_enter(&(mr)->mr_lock); \
249 249 ASSERT((mr)->mr_refcnt != 0); \
250 250 (mr)->mr_refcnt--; \
251 251 if ((mr)->mr_refcnt == 0 && \
252 252 ((mr)->mr_flag & (MR_CONDEMNED | MR_QUIESCE))) \
253 253 cv_signal(&(mr)->mr_cv); \
254 254 mutex_exit(&(mr)->mr_lock); \
255 255 }
256 256
257 257 /*
258 - * Per mac client flow information associated with a RX group.
259 - * The entire structure is SL protected.
258 + * Used to attach MAC clients to an Rx group. The members are SL
259 + * protected.
260 260 */
261 261 typedef struct mac_grp_client {
262 262 struct mac_grp_client *mgc_next;
263 263 struct mac_client_impl_s *mgc_client;
264 264 } mac_grp_client_t;
265 265
266 266 #define MAC_GROUP_NO_CLIENT(g) ((g)->mrg_clients == NULL)
267 267
268 268 #define MAC_GROUP_ONLY_CLIENT(g) \
269 269 ((((g)->mrg_clients != NULL) && \
270 270 ((g)->mrg_clients->mgc_next == NULL)) ? \
271 271 (g)->mrg_clients->mgc_client : NULL)
272 272
273 +#define MAC_GROUP_HW_VLAN(g) \
274 + (((g) != NULL) && \
275 + ((g)->mrg_info.mgi_addvlan != NULL) && \
276 + ((g)->mrg_info.mgi_remvlan != NULL))
277 +
273 278 /*
274 279 * Common ring group data structure for ring control and management.
275 - * The entire structure is SL protected
280 + * The entire structure is SL protected.
276 281 */
277 282 struct mac_group_s {
278 283 int mrg_index; /* index in the list */
279 284 mac_ring_type_t mrg_type; /* ring type */
280 285 mac_group_state_t mrg_state; /* state of the group */
281 - mac_group_t *mrg_next; /* next ring in the chain */
286 + mac_group_t *mrg_next; /* next group in the chain */
282 287 mac_handle_t mrg_mh; /* reference to MAC */
283 288 mac_ring_t *mrg_rings; /* grouped rings */
284 289 uint_t mrg_cur_count; /* actual size of group */
285 290
286 291 mac_grp_client_t *mrg_clients; /* clients list */
287 292
288 293 mac_group_info_t mrg_info; /* driver supplied info */
289 294 };
290 295
291 296 #define mrg_driver mrg_info.mgi_driver
292 297 #define mrg_start mrg_info.mgi_start
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
293 298 #define mrg_stop mrg_info.mgi_stop
294 299
295 300 #define GROUP_INTR_HANDLE(g) (g)->mrg_info.mgi_intr.mi_handle
296 301 #define GROUP_INTR_ENABLE_FUNC(g) (g)->mrg_info.mgi_intr.mi_enable
297 302 #define GROUP_INTR_DISABLE_FUNC(g) (g)->mrg_info.mgi_intr.mi_disable
298 303
299 304 #define MAC_RING_TX(mhp, rh, mp, rest) { \
300 305 mac_ring_handle_t mrh = rh; \
301 306 mac_impl_t *mimpl = (mac_impl_t *)mhp; \
302 307 /* \
303 - * Send packets through a selected tx ring, or through the \
308 + * Send packets through a selected tx ring, or through the \
304 309 * default handler if there is no selected ring. \
305 310 */ \
306 311 if (mrh == NULL) \
307 312 mrh = mimpl->mi_default_tx_ring; \
308 313 if (mrh == NULL) { \
309 314 rest = mimpl->mi_tx(mimpl->mi_driver, mp); \
310 315 } else { \
311 316 rest = mac_hwring_tx(mrh, mp); \
312 317 } \
313 318 }
314 319
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
315 320 /*
316 321 * This is the final stop before reaching the underlying driver
317 322 * or aggregation, so this is where the bridging hook is implemented.
318 323 * Packets that are bridged will return through mac_bridge_tx(), with
319 324 * rh nulled out if the bridge chooses to send output on a different
320 325 * link due to forwarding.
321 326 */
322 327 #define MAC_TX(mip, rh, mp, src_mcip) { \
323 328 mac_ring_handle_t rhandle = (rh); \
324 329 /* \
325 - * If there is a bound Hybrid I/O share, send packets through \
330 + * If there is a bound Hybrid I/O share, send packets through \
326 331 * the default tx ring. (When there's a bound Hybrid I/O share, \
327 - * the tx rings of this client are mapped in the guest domain \
332 + * the tx rings of this client are mapped in the guest domain \
328 333 * and not accessible from here.) \
329 334 */ \
330 335 _NOTE(CONSTANTCONDITION) \
331 336 if ((src_mcip)->mci_state_flags & MCIS_SHARE_BOUND) \
332 337 rhandle = (mip)->mi_default_tx_ring; \
333 338 if (mip->mi_promisc_list != NULL) \
334 339 mac_promisc_dispatch(mip, mp, src_mcip); \
335 340 /* \
336 - * Grab the proper transmit pointer and handle. Special \
341 + * Grab the proper transmit pointer and handle. Special \
337 342 * optimization: we can test mi_bridge_link itself atomically, \
338 343 * and if that indicates no bridge send packets through tx ring.\
339 344 */ \
340 345 if (mip->mi_bridge_link == NULL) { \
341 346 MAC_RING_TX(mip, rhandle, mp, mp); \
342 347 } else { \
343 348 mp = mac_bridge_tx(mip, rhandle, mp); \
344 349 } \
345 350 }
346 351
347 352 /* mci_tx_flag */
348 353 #define MCI_TX_QUIESCE 0x1
349 354
350 355 typedef struct mac_factory_addr_s {
351 356 boolean_t mfa_in_use;
352 357 uint8_t mfa_addr[MAXMACADDRLEN];
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
353 358 struct mac_client_impl_s *mfa_client;
354 359 } mac_factory_addr_t;
355 360
356 361 typedef struct mac_mcast_addrs_s {
357 362 struct mac_mcast_addrs_s *mma_next;
358 363 uint8_t mma_addr[MAXMACADDRLEN];
359 364 int mma_ref;
360 365 } mac_mcast_addrs_t;
361 366
362 367 typedef enum {
363 - MAC_ADDRESS_TYPE_UNICAST_CLASSIFIED = 1, /* hardware steering */
368 + MAC_ADDRESS_TYPE_UNICAST_CLASSIFIED = 1, /* HW classification */
364 369 MAC_ADDRESS_TYPE_UNICAST_PROMISC /* promiscuous mode */
365 370 } mac_address_type_t;
366 371
372 +typedef struct mac_vlan_s {
373 + struct mac_vlan_s *mv_next;
374 + uint16_t mv_vid;
375 +} mac_vlan_t;
376 +
367 377 typedef struct mac_address_s {
368 378 mac_address_type_t ma_type; /* address type */
369 - int ma_nusers; /* number of users */
370 - /* of that address */
379 + int ma_nusers; /* num users of addr */
371 380 struct mac_address_s *ma_next; /* next address */
372 381 uint8_t ma_addr[MAXMACADDRLEN]; /* address value */
373 382 size_t ma_len; /* address length */
383 + mac_vlan_t *ma_vlans; /* VLANs on this addr */
384 + boolean_t ma_untagged; /* accept untagged? */
374 385 mac_group_t *ma_group; /* asscociated group */
375 386 mac_impl_t *ma_mip; /* MAC handle */
376 387 } mac_address_t;
377 388
378 389 extern krwlock_t i_mac_impl_lock;
379 390 extern mod_hash_t *i_mac_impl_hash;
380 391 extern kmem_cache_t *i_mac_impl_cachep;
381 392 extern uint_t i_mac_impl_count;
382 393
383 394 /*
384 395 * Each registered MAC is associated with a mac_impl_t structure. The
385 396 * structure represents the undelying hardware, in terms of definition,
386 397 * resources (transmit, receive rings etc.), callback functions etc. It
387 398 * also holds the table of MAC clients that are configured on the device.
388 399 * The table is used for classifying incoming packets in software.
389 400 *
390 401 * The protection scheme uses 2 elements, a coarse serialization mechanism
391 402 * called perimeter and a finer traditional lock based scheme. More details
392 403 * can be found in the big block comment in mac.c.
393 404 *
394 405 * The protection scheme for each member of the mac_impl_t is described below.
395 406 *
396 407 * Write Once Only (WO): Typically these don't change for the lifetime of the
397 408 * data structure. For example something in mac_impl_t that stays the same
398 409 * from mac_register to mac_unregister, or something in a mac_client_impl_t
399 410 * that stays the same from mac_client_open to mac_client_close.
400 411 *
401 412 * Serializer (SL): Protected by the Serializer. All SLOP operations on a
402 413 * mac endpoint go through the serializer. MTOPs don't care about reading
403 414 * these fields atomically.
404 415 *
405 416 * Lock: Traditional mutex/rw lock. Modify operations still go through the
406 417 * mac serializer, the lock helps synchronize readers with writers.
407 418 */
408 419 struct mac_impl_s {
409 420 krwlock_t mi_rw_lock;
410 421 list_node_t mi_node;
411 422 char mi_name[LIFNAMSIZ]; /* WO */
412 423 uint32_t mi_state_flags;
413 424 void *mi_driver; /* Driver private, WO */
414 425 mac_info_t mi_info; /* WO */
415 426 mactype_t *mi_type; /* WO */
416 427 void *mi_pdata; /* WO */
417 428 size_t mi_pdata_size; /* WO */
418 429 mac_callbacks_t *mi_callbacks; /* WO */
419 430 dev_info_t *mi_dip; /* WO */
420 431 uint32_t mi_ref; /* i_mac_impl_lock */
421 432 uint_t mi_active; /* SL */
422 433 link_state_t mi_linkstate; /* none */
423 434 link_state_t mi_lowlinkstate; /* none */
424 435 link_state_t mi_lastlowlinkstate; /* none */
425 436 uint_t mi_devpromisc; /* SL */
426 437 uint8_t mi_addr[MAXMACADDRLEN]; /* mi_rw_lock */
427 438 uint8_t mi_dstaddr[MAXMACADDRLEN]; /* mi_rw_lock */
428 439 boolean_t mi_dstaddr_set;
429 440
430 441 /*
431 442 * The mac perimeter. All client initiated create/modify operations
432 443 * on a mac end point go through this.
433 444 */
434 445 kmutex_t mi_perim_lock;
435 446 kthread_t *mi_perim_owner; /* mi_perim_lock */
436 447 uint_t mi_perim_ocnt; /* mi_perim_lock */
437 448 kcondvar_t mi_perim_cv; /* mi_perim_lock */
438 449
439 450 /* mac notification callbacks */
440 451 kmutex_t mi_notify_lock;
441 452 mac_cb_info_t mi_notify_cb_info; /* mi_notify_lock */
442 453 mac_cb_t *mi_notify_cb_list; /* mi_notify_lock */
443 454 kthread_t *mi_notify_thread; /* mi_notify_lock */
444 455 uint_t mi_notify_bits; /* mi_notify_lock */
445 456
446 457 uint32_t mi_v12n_level; /* Virt'ion readiness */
447 458
448 459 /*
449 460 * RX groups, ring capability
450 461 * Fields of this block are SL protected.
451 462 */
452 463 mac_group_type_t mi_rx_group_type; /* grouping type */
453 464 uint_t mi_rx_group_count;
454 465 mac_group_t *mi_rx_groups;
455 466 mac_group_t *mi_rx_donor_grp;
456 467 uint_t mi_rxrings_rsvd;
457 468 uint_t mi_rxrings_avail;
458 469 uint_t mi_rxhwclnt_avail;
459 470 uint_t mi_rxhwclnt_used;
460 471
461 472 mac_capab_rings_t mi_rx_rings_cap;
462 473
463 474 /*
464 475 * TX groups and ring capability, SL Protected.
465 476 */
466 477 mac_group_type_t mi_tx_group_type; /* grouping type */
467 478 uint_t mi_tx_group_count;
468 479 uint_t mi_tx_group_free;
469 480 mac_group_t *mi_tx_groups;
470 481 mac_capab_rings_t mi_tx_rings_cap;
471 482 uint_t mi_txrings_rsvd;
472 483 uint_t mi_txrings_avail;
473 484 uint_t mi_txhwclnt_avail;
474 485 uint_t mi_txhwclnt_used;
475 486
476 487 mac_ring_handle_t mi_default_tx_ring;
477 488
478 489 /*
479 490 * Transceiver capabilities. SL protected.
↓ open down ↓ |
96 lines elided |
↑ open up ↑ |
480 491 */
481 492 mac_capab_transceiver_t mi_transceiver;
482 493
483 494 /*
484 495 * LED Capability information. SL protected.
485 496 */
486 497 mac_led_mode_t mi_led_modes;
487 498 mac_capab_led_t mi_led;
488 499
489 500 /*
490 - * MAC address list. SL protected.
501 + * MAC address and VLAN lists. SL protected.
491 502 */
492 503 mac_address_t *mi_addresses;
493 504
494 505 /*
495 506 * This MAC's table of sub-flows
496 507 */
497 508 flow_tab_t *mi_flow_tab; /* WO */
498 509
499 510 kstat_t *mi_ksp; /* WO */
500 511 uint_t mi_kstat_count; /* WO */
501 512 uint_t mi_nactiveclients; /* SL */
502 513
503 514 /* for broadcast and multicast support */
504 515 struct mac_mcast_addrs_s *mi_mcast_addrs; /* mi_rw_lock */
505 516 struct mac_bcast_grp_s *mi_bcast_grp; /* mi_rw_lock */
506 517 uint_t mi_bcast_ngrps; /* mi_rw_lock */
507 518
508 519 /* list of MAC clients which opened this MAC */
509 520 struct mac_client_impl_s *mi_clients_list; /* mi_rw_lock */
510 521 uint_t mi_nclients; /* mi_rw_lock */
511 522 struct mac_client_impl_s *mi_single_active_client; /* mi_rw_lock */
512 523
513 524 uint32_t mi_margin; /* mi_rw_lock */
514 525 uint_t mi_sdu_min; /* mi_rw_lock */
515 526 uint_t mi_sdu_max; /* mi_rw_lock */
516 527 uint_t mi_sdu_multicast; /* mi_rw_lock */
517 528
518 529 /*
519 530 * Cache of factory MAC addresses provided by the driver. If
520 531 * the driver doesn't provide multiple factory MAC addresses,
521 532 * the mi_factory_addr is set to NULL, and mi_factory_addr_num
522 533 * is set to zero.
523 534 */
524 535 mac_factory_addr_t *mi_factory_addr; /* mi_rw_lock */
525 536 uint_t mi_factory_addr_num; /* mi_rw_lock */
526 537
527 538 /* for promiscuous mode support */
528 539 kmutex_t mi_promisc_lock;
529 540 mac_cb_t *mi_promisc_list; /* mi_promisc_lock */
530 541 mac_cb_info_t mi_promisc_cb_info; /* mi_promisc_lock */
531 542
532 543 /* cache of rings over this mac_impl */
533 544 kmutex_t mi_ring_lock;
534 545 mac_ring_t *mi_ring_freelist; /* mi_ring_lock */
535 546
536 547 /*
537 548 * These are used for caching the properties, if any, for the
538 549 * primary MAC client. If the MAC client is not yet in place
539 550 * when the properties are set then we cache them here to be
540 551 * applied to the MAC client when it is created.
541 552 */
542 553 mac_resource_props_t mi_resource_props; /* SL */
543 554 uint16_t mi_pvid; /* SL */
544 555
545 556 minor_t mi_minor; /* WO */
546 557 uint32_t mi_oref; /* SL */
547 558 mac_capab_legacy_t mi_capab_legacy; /* WO */
548 559 dev_t mi_phy_dev; /* WO */
549 560
550 561 /*
551 562 * List of margin value requests added by mac clients. This list is
552 563 * sorted: the first one has the greatest value.
553 564 */
554 565 mac_margin_req_t *mi_mmrp;
555 566 mac_mtu_req_t *mi_mtrp;
556 567 char **mi_priv_prop;
557 568 uint_t mi_priv_prop_count;
558 569
559 570 /*
560 571 * Hybrid I/O related definitions.
561 572 */
562 573 mac_capab_share_t mi_share_capab;
563 574
564 575 /*
565 576 * Bridging hooks and limit values. Uses mutex and reference counts
566 577 * (bridging only) for data path. Limits need no synchronization.
567 578 */
568 579 mac_handle_t mi_bridge_link;
569 580 kmutex_t mi_bridge_lock;
570 581 uint32_t mi_llimit;
571 582 uint32_t mi_ldecay;
572 583
573 584 /* This should be the last block in this structure */
574 585 #ifdef DEBUG
575 586 #define MAC_PERIM_STACK_DEPTH 15
576 587 int mi_perim_stack_depth;
577 588 pc_t mi_perim_stack[MAC_PERIM_STACK_DEPTH];
578 589 #endif
579 590 };
580 591
581 592 /*
582 593 * The default TX group is the last one in the list.
583 594 */
584 595 #define MAC_DEFAULT_TX_GROUP(mip) \
585 596 (mip)->mi_tx_groups + (mip)->mi_tx_group_count
586 597
587 598 /*
588 599 * The default RX group is the first one in the list
589 600 */
590 601 #define MAC_DEFAULT_RX_GROUP(mip) (mip)->mi_rx_groups
591 602
592 603 /* Reserved RX rings */
593 604 #define MAC_RX_RING_RESERVED(m, cnt) { \
594 605 ASSERT((m)->mi_rxrings_avail >= (cnt)); \
595 606 (m)->mi_rxrings_rsvd += (cnt); \
596 607 (m)->mi_rxrings_avail -= (cnt); \
597 608 }
598 609
599 610 /* Released RX rings */
600 611 #define MAC_RX_RING_RELEASED(m, cnt) { \
601 612 ASSERT((m)->mi_rxrings_rsvd >= (cnt)); \
602 613 (m)->mi_rxrings_rsvd -= (cnt); \
603 614 (m)->mi_rxrings_avail += (cnt); \
604 615 }
605 616
606 617 /* Reserved a RX group */
607 618 #define MAC_RX_GRP_RESERVED(m) { \
608 619 ASSERT((m)->mi_rxhwclnt_avail > 0); \
609 620 (m)->mi_rxhwclnt_avail--; \
610 621 (m)->mi_rxhwclnt_used++; \
611 622 }
612 623
613 624 /* Released a RX group */
614 625 #define MAC_RX_GRP_RELEASED(m) { \
615 626 ASSERT((m)->mi_rxhwclnt_used > 0); \
616 627 (m)->mi_rxhwclnt_avail++; \
617 628 (m)->mi_rxhwclnt_used--; \
618 629 }
619 630
620 631 /* Reserved TX rings */
621 632 #define MAC_TX_RING_RESERVED(m, cnt) { \
622 633 ASSERT((m)->mi_txrings_avail >= (cnt)); \
623 634 (m)->mi_txrings_rsvd += (cnt); \
624 635 (m)->mi_txrings_avail -= (cnt); \
625 636 }
626 637 /* Released TX rings */
627 638 #define MAC_TX_RING_RELEASED(m, cnt) { \
628 639 ASSERT((m)->mi_txrings_rsvd >= (cnt)); \
629 640 (m)->mi_txrings_rsvd -= (cnt); \
630 641 (m)->mi_txrings_avail += (cnt); \
631 642 }
632 643
633 644 /* Reserved a TX group */
634 645 #define MAC_TX_GRP_RESERVED(m) { \
635 646 ASSERT((m)->mi_txhwclnt_avail > 0); \
636 647 (m)->mi_txhwclnt_avail--; \
637 648 (m)->mi_txhwclnt_used++; \
638 649 }
639 650
640 651 /* Released a TX group */
641 652 #define MAC_TX_GRP_RELEASED(m) { \
642 653 ASSERT((m)->mi_txhwclnt_used > 0); \
643 654 (m)->mi_txhwclnt_avail++; \
644 655 (m)->mi_txhwclnt_used--; \
645 656 }
646 657
647 658 /* for mi_state_flags */
648 659 #define MIS_DISABLED 0x0001
649 660 #define MIS_IS_VNIC 0x0002
650 661 #define MIS_IS_AGGR 0x0004
651 662 #define MIS_NOTIFY_DONE 0x0008
652 663 #define MIS_EXCLUSIVE 0x0010
653 664 #define MIS_EXCLUSIVE_HELD 0x0020
654 665 #define MIS_LEGACY 0x0040
655 666 #define MIS_NO_ACTIVE 0x0080
656 667 #define MIS_POLL_DISABLE 0x0100
657 668
658 669 #define mi_getstat mi_callbacks->mc_getstat
659 670 #define mi_start mi_callbacks->mc_start
660 671 #define mi_stop mi_callbacks->mc_stop
661 672 #define mi_open mi_callbacks->mc_open
662 673 #define mi_close mi_callbacks->mc_close
663 674 #define mi_setpromisc mi_callbacks->mc_setpromisc
664 675 #define mi_multicst mi_callbacks->mc_multicst
665 676 #define mi_unicst mi_callbacks->mc_unicst
666 677 #define mi_tx mi_callbacks->mc_tx
667 678 #define mi_ioctl mi_callbacks->mc_ioctl
668 679 #define mi_getcapab mi_callbacks->mc_getcapab
669 680
670 681 typedef struct mac_notify_task_arg {
671 682 mac_impl_t *mnt_mip;
672 683 mac_notify_type_t mnt_type;
673 684 mac_ring_t *mnt_ring;
674 685 } mac_notify_task_arg_t;
675 686
676 687 /*
677 688 * The mac_perim_handle_t is an opaque type that encodes the 'mip' pointer
678 689 * and whether internally a mac_open was done when acquiring the perimeter.
679 690 */
680 691 #define MAC_ENCODE_MPH(mph, mh, need_close) \
681 692 (mph) = (mac_perim_handle_t)((uintptr_t)(mh) | need_close)
682 693
683 694 #define MAC_DECODE_MPH(mph, mip, need_close) { \
684 695 mip = (mac_impl_t *)(((uintptr_t)mph) & ~0x1); \
685 696 (need_close) = ((uintptr_t)mph & 0x1); \
686 697 }
687 698
688 699 /*
689 700 * Type of property information that can be returned by a driver.
690 701 * Valid flags of the pr_flags of the mac_prop_info_t data structure.
691 702 */
692 703 #define MAC_PROP_INFO_DEFAULT 0x0001
693 704 #define MAC_PROP_INFO_RANGE 0x0002
694 705 #define MAC_PROP_INFO_PERM 0x0004
695 706
696 707 /*
697 708 * Property information. pr_flags is a combination of one of the
698 709 * MAC_PROP_INFO_* flags, it is reset by the framework before invoking
699 710 * the driver's prefix_propinfo() entry point.
700 711 *
701 712 * Drivers should use MAC_PROP_INFO_SET_*() macros to provide
702 713 * information about a property.
703 714 */
704 715 typedef struct mac_prop_info_state_s {
705 716 uint8_t pr_flags;
706 717 uint8_t pr_perm;
707 718 uint8_t pr_errno;
708 719 void *pr_default;
709 720 size_t pr_default_size;
710 721 mac_propval_range_t *pr_range;
711 722 uint_t pr_range_cur_count;
712 723 } mac_prop_info_state_t;
713 724
714 725 #define MAC_PROTECT_ENABLED(mcip, type) \
715 726 (((mcip)->mci_flent-> \
716 727 fe_resource_props.mrp_mask & MRP_PROTECT) != 0 && \
717 728 ((mcip)->mci_flent-> \
718 729 fe_resource_props.mrp_protect.mp_types & (type)) != 0)
719 730
720 731 typedef struct mac_client_impl_s mac_client_impl_t;
721 732
722 733 extern void mac_init(void);
723 734 extern int mac_fini(void);
724 735
725 736 extern void mac_ndd_ioctl(mac_impl_t *, queue_t *, mblk_t *);
726 737 extern boolean_t mac_ip_hdr_length_v6(ip6_t *, uint8_t *, uint16_t *,
727 738 uint8_t *, ip6_frag_t **);
728 739
729 740 extern mblk_t *mac_copymsgchain_cksum(mblk_t *);
730 741 extern mblk_t *mac_fix_cksum(mblk_t *);
731 742 extern void mac_packet_print(mac_handle_t, mblk_t *);
732 743 extern void mac_rx_deliver(void *, mac_resource_handle_t, mblk_t *,
733 744 mac_header_info_t *);
734 745 extern void mac_tx_notify(mac_impl_t *);
735 746
736 747 extern boolean_t mac_callback_find(mac_cb_info_t *, mac_cb_t **, mac_cb_t *);
737 748 extern void mac_callback_add(mac_cb_info_t *, mac_cb_t **, mac_cb_t *);
738 749 extern boolean_t mac_callback_remove(mac_cb_info_t *, mac_cb_t **, mac_cb_t *);
739 750 extern void mac_callback_remove_wait(mac_cb_info_t *);
740 751 extern void mac_callback_free(mac_cb_t *);
741 752 extern mac_cb_t *mac_callback_walker_cleanup(mac_cb_info_t *, mac_cb_t **);
742 753
743 754 /* in mac_bcast.c */
744 755 extern void mac_bcast_init(void);
745 756 extern void mac_bcast_fini(void);
746 757 extern mac_impl_t *mac_bcast_grp_mip(void *);
747 758 extern int mac_bcast_add(mac_client_impl_t *, const uint8_t *, uint16_t,
748 759 mac_addrtype_t);
749 760 extern void mac_bcast_delete(mac_client_impl_t *, const uint8_t *, uint16_t);
750 761 extern void mac_bcast_send(void *, void *, mblk_t *, boolean_t);
751 762 extern void mac_bcast_grp_free(void *);
↓ open down ↓ |
251 lines elided |
↑ open up ↑ |
752 763 extern void mac_bcast_refresh(mac_impl_t *, mac_multicst_t, void *,
753 764 boolean_t);
754 765 extern void mac_client_bcast_refresh(mac_client_impl_t *, mac_multicst_t,
755 766 void *, boolean_t);
756 767
757 768 /*
758 769 * Grouping functions are used internally by MAC layer.
759 770 */
760 771 extern int mac_group_addmac(mac_group_t *, const uint8_t *);
761 772 extern int mac_group_remmac(mac_group_t *, const uint8_t *);
773 +extern int mac_group_addvlan(mac_group_t *, uint16_t);
774 +extern int mac_group_remvlan(mac_group_t *, uint16_t);
762 775 extern int mac_rx_group_add_flow(mac_client_impl_t *, flow_entry_t *,
763 776 mac_group_t *);
764 777 extern mblk_t *mac_hwring_tx(mac_ring_handle_t, mblk_t *);
765 778 extern mblk_t *mac_bridge_tx(mac_impl_t *, mac_ring_handle_t, mblk_t *);
766 779 extern mac_group_t *mac_reserve_rx_group(mac_client_impl_t *, uint8_t *,
767 780 boolean_t);
768 781 extern void mac_release_rx_group(mac_client_impl_t *, mac_group_t *);
769 782 extern int mac_rx_switch_group(mac_client_impl_t *, mac_group_t *,
770 783 mac_group_t *);
771 784 extern mac_ring_t *mac_reserve_tx_ring(mac_impl_t *, mac_ring_t *);
772 785 extern mac_group_t *mac_reserve_tx_group(mac_client_impl_t *, boolean_t);
773 786 extern void mac_release_tx_group(mac_client_impl_t *, mac_group_t *);
774 787 extern void mac_tx_switch_group(mac_client_impl_t *, mac_group_t *,
775 788 mac_group_t *);
776 789 extern void mac_rx_switch_grp_to_sw(mac_group_t *);
777 790
778 791 /*
779 792 * MAC address functions are used internally by MAC layer.
780 793 */
781 794 extern mac_address_t *mac_find_macaddr(mac_impl_t *, uint8_t *);
795 +extern mac_address_t *mac_find_macaddr_vlan(mac_impl_t *, uint8_t *, uint16_t);
782 796 extern boolean_t mac_check_macaddr_shared(mac_address_t *);
783 797 extern int mac_update_macaddr(mac_address_t *, uint8_t *);
784 798 extern void mac_freshen_macaddr(mac_address_t *, uint8_t *);
785 799 extern void mac_retrieve_macaddr(mac_address_t *, uint8_t *);
786 800 extern void mac_init_macaddr(mac_impl_t *);
787 801 extern void mac_fini_macaddr(mac_impl_t *);
788 802
789 803 /*
790 804 * Flow construction/destruction routines.
791 805 * Not meant to be used by mac clients.
792 806 */
793 807 extern int mac_link_flow_init(mac_client_handle_t, flow_entry_t *);
794 808 extern void mac_link_flow_clean(mac_client_handle_t, flow_entry_t *);
795 809
796 810 /*
797 811 * Fanout update routines called when the link speed of the NIC changes
798 812 * or when a MAC client's share is unbound.
799 813 */
800 814 extern void mac_fanout_recompute_client(mac_client_impl_t *, cpupart_t *);
801 815 extern void mac_fanout_recompute(mac_impl_t *);
802 816
803 817 /*
804 818 * The following functions are used internally by the MAC layer to
805 819 * add/remove/update flows associated with a mac_impl_t. They should
806 820 * never be used directly by MAC clients.
807 821 */
808 822 extern int mac_datapath_setup(mac_client_impl_t *, flow_entry_t *, uint32_t);
809 823 extern void mac_datapath_teardown(mac_client_impl_t *, flow_entry_t *,
810 824 uint32_t);
811 825 extern void mac_rx_srs_group_setup(mac_client_impl_t *, flow_entry_t *,
812 826 uint32_t);
813 827 extern void mac_tx_srs_group_setup(mac_client_impl_t *, flow_entry_t *,
814 828 uint32_t);
815 829 extern void mac_rx_srs_group_teardown(flow_entry_t *, boolean_t);
816 830 extern void mac_tx_srs_group_teardown(mac_client_impl_t *, flow_entry_t *,
817 831 uint32_t);
818 832 extern int mac_rx_classify_flow_quiesce(flow_entry_t *, void *);
819 833 extern int mac_rx_classify_flow_restart(flow_entry_t *, void *);
820 834 extern void mac_client_quiesce(mac_client_impl_t *);
821 835 extern void mac_client_restart(mac_client_impl_t *);
822 836
823 837 extern void mac_flow_update_priority(mac_client_impl_t *, flow_entry_t *);
824 838
825 839 extern void mac_flow_rem_subflow(flow_entry_t *);
826 840 extern void mac_rename_flow(flow_entry_t *, const char *);
827 841 extern void mac_flow_set_name(flow_entry_t *, const char *);
828 842
829 843 extern mblk_t *mac_add_vlan_tag(mblk_t *, uint_t, uint16_t);
830 844 extern mblk_t *mac_add_vlan_tag_chain(mblk_t *, uint_t, uint16_t);
831 845 extern mblk_t *mac_strip_vlan_tag_chain(mblk_t *);
832 846 extern void mac_pkt_drop(void *, mac_resource_handle_t, mblk_t *, boolean_t);
833 847 extern mblk_t *mac_rx_flow(mac_handle_t, mac_resource_handle_t, mblk_t *);
834 848
835 849 extern void i_mac_share_alloc(mac_client_impl_t *);
836 850 extern void i_mac_share_free(mac_client_impl_t *);
837 851 extern void i_mac_perim_enter(mac_impl_t *);
838 852 extern void i_mac_perim_exit(mac_impl_t *);
839 853 extern int i_mac_perim_enter_nowait(mac_impl_t *);
840 854 extern void i_mac_tx_srs_notify(mac_impl_t *, mac_ring_handle_t);
841 855 extern int mac_hold(const char *, mac_impl_t **);
842 856 extern void mac_rele(mac_impl_t *);
843 857 extern int i_mac_disable(mac_impl_t *);
844 858 extern void i_mac_notify(mac_impl_t *, mac_notify_type_t);
845 859 extern void i_mac_notify_exit(mac_impl_t *);
846 860 extern void mac_rx_group_unmark(mac_group_t *, uint_t);
847 861 extern void mac_tx_client_flush(mac_client_impl_t *);
848 862 extern void mac_tx_client_block(mac_client_impl_t *);
849 863 extern void mac_tx_client_unblock(mac_client_impl_t *);
850 864 extern void mac_tx_invoke_callbacks(mac_client_impl_t *, mac_tx_cookie_t);
851 865 extern int i_mac_promisc_set(mac_impl_t *, boolean_t);
852 866 extern void i_mac_promisc_walker_cleanup(mac_impl_t *);
853 867 extern mactype_t *mactype_getplugin(const char *);
854 868 extern void mac_addr_factory_init(mac_impl_t *);
855 869 extern void mac_addr_factory_fini(mac_impl_t *);
↓ open down ↓ |
64 lines elided |
↑ open up ↑ |
856 870 extern void mac_register_priv_prop(mac_impl_t *, char **);
857 871 extern void mac_unregister_priv_prop(mac_impl_t *);
858 872 extern int mac_init_rings(mac_impl_t *, mac_ring_type_t);
859 873 extern void mac_free_rings(mac_impl_t *, mac_ring_type_t);
860 874 extern void mac_compare_ddi_handle(mac_group_t *, uint_t, mac_ring_t *);
861 875
862 876 extern int mac_start_group(mac_group_t *);
863 877 extern void mac_stop_group(mac_group_t *);
864 878 extern int mac_start_ring(mac_ring_t *);
865 879 extern void mac_stop_ring(mac_ring_t *);
866 -extern int mac_add_macaddr(mac_impl_t *, mac_group_t *, uint8_t *, boolean_t);
867 -extern int mac_remove_macaddr(mac_address_t *);
880 +extern int mac_add_macaddr_vlan(mac_impl_t *, mac_group_t *, uint8_t *,
881 + uint16_t, boolean_t);
882 +extern int mac_remove_macaddr_vlan(mac_address_t *, uint16_t);
868 883
869 884 extern void mac_set_group_state(mac_group_t *, mac_group_state_t);
870 885 extern void mac_group_add_client(mac_group_t *, mac_client_impl_t *);
871 886 extern void mac_group_remove_client(mac_group_t *, mac_client_impl_t *);
872 887
873 888 extern int i_mac_group_add_ring(mac_group_t *, mac_ring_t *, int);
874 889 extern void i_mac_group_rem_ring(mac_group_t *, mac_ring_t *, boolean_t);
875 890 extern int mac_group_ring_modify(mac_client_impl_t *, mac_group_t *,
876 891 mac_group_t *);
877 892 extern void mac_poll_state_change(mac_handle_t, boolean_t);
878 893
879 894 extern mac_group_state_t mac_group_next_state(mac_group_t *,
880 895 mac_client_impl_t **, mac_group_t *, boolean_t);
881 896
882 897 extern mblk_t *mac_protect_check(mac_client_handle_t, mblk_t *);
883 898 extern int mac_protect_set(mac_client_handle_t, mac_resource_props_t *);
884 899 extern boolean_t mac_protect_enabled(mac_client_handle_t, uint32_t);
885 900 extern int mac_protect_validate(mac_resource_props_t *);
886 901 extern void mac_protect_update(mac_resource_props_t *, mac_resource_props_t *);
887 902 extern void mac_protect_update_mac_token(mac_client_impl_t *);
888 903 extern void mac_protect_intercept_dynamic(mac_client_impl_t *, mblk_t *);
889 904 extern void mac_protect_flush_dynamic(mac_client_impl_t *);
890 905 extern void mac_protect_cancel_timer(mac_client_impl_t *);
891 906 extern void mac_protect_init(mac_client_impl_t *);
892 907 extern void mac_protect_fini(mac_client_impl_t *);
893 908
894 909 extern int mac_set_resources(mac_handle_t, mac_resource_props_t *);
895 910 extern void mac_get_resources(mac_handle_t, mac_resource_props_t *);
896 911 extern void mac_get_effective_resources(mac_handle_t, mac_resource_props_t *);
897 912 extern void mac_set_promisc_filtered(mac_client_handle_t, boolean_t);
898 913 extern boolean_t mac_get_promisc_filtered(mac_client_handle_t);
899 914
900 915 extern cpupart_t *mac_pset_find(mac_resource_props_t *, boolean_t *);
901 916 extern void mac_set_pool_effective(boolean_t, cpupart_t *,
902 917 mac_resource_props_t *, mac_resource_props_t *);
903 918 extern void mac_set_rings_effective(mac_client_impl_t *);
904 919 extern mac_client_impl_t *mac_check_primary_relocation(mac_client_impl_t *,
905 920 boolean_t);
906 921
907 922 /* Global callbacks into the bridging module (when loaded) */
908 923 extern mac_bridge_tx_t mac_bridge_tx_cb;
909 924 extern mac_bridge_rx_t mac_bridge_rx_cb;
910 925 extern mac_bridge_ref_t mac_bridge_ref_cb;
911 926 extern mac_bridge_ls_t mac_bridge_ls_cb;
912 927
913 928 /*
914 929 * MAC Transceiver related functions
915 930 */
916 931 struct mac_transceiver_info {
917 932 boolean_t mti_present;
918 933 boolean_t mti_usable;
919 934 };
920 935
921 936 extern void mac_transceiver_init(mac_impl_t *);
922 937 extern int mac_transceiver_count(mac_handle_t, uint_t *);
923 938 extern int mac_transceiver_info(mac_handle_t, uint_t, boolean_t *, boolean_t *);
924 939 extern int mac_transceiver_read(mac_handle_t, uint_t, uint_t, void *, size_t,
925 940 off_t, size_t *);
926 941
927 942 /*
928 943 * MAC LED related functions
929 944 */
930 945 #define MAC_LED_ALL (MAC_LED_DEFAULT | MAC_LED_OFF | MAC_LED_IDENT | \
931 946 MAC_LED_ON)
932 947 extern void mac_led_init(mac_impl_t *);
933 948 extern int mac_led_get(mac_handle_t, mac_led_mode_t *, mac_led_mode_t *);
934 949 extern int mac_led_set(mac_handle_t, mac_led_mode_t);
935 950
936 951 #ifdef __cplusplus
937 952 }
938 953 #endif
939 954
940 955 #endif /* _SYS_MAC_IMPL_H */
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX