net/sfc/base: import filters support
[dpdk.git] / drivers / net / sfc / base / efx.h
1 /*
2  * Copyright (c) 2006-2016 Solarflare Communications Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  *    this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  * The views and conclusions contained in the software and documentation are
27  * those of the authors and should not be interpreted as representing official
28  * policies, either expressed or implied, of the FreeBSD Project.
29  */
30
31 #ifndef _SYS_EFX_H
32 #define _SYS_EFX_H
33
34 #include "efsys.h"
35 #include "efx_check.h"
36 #include "efx_phy_ids.h"
37
38 #ifdef  __cplusplus
39 extern "C" {
40 #endif
41
42 #define EFX_STATIC_ASSERT(_cond)                \
43         ((void)sizeof(char[(_cond) ? 1 : -1]))
44
45 #define EFX_ARRAY_SIZE(_array)                  \
46         (sizeof(_array) / sizeof((_array)[0]))
47
48 #define EFX_FIELD_OFFSET(_type, _field)         \
49         ((size_t) &(((_type *)0)->_field))
50
51 /* Return codes */
52
53 typedef __success(return == 0) int efx_rc_t;
54
55
56 /* Chip families */
57
58 typedef enum efx_family_e {
59         EFX_FAMILY_INVALID,
60         EFX_FAMILY_FALCON,      /* Obsolete and not supported */
61         EFX_FAMILY_SIENA,
62         EFX_FAMILY_HUNTINGTON,
63         EFX_FAMILY_MEDFORD,
64         EFX_FAMILY_NTYPES
65 } efx_family_t;
66
67 extern  __checkReturn   efx_rc_t
68 efx_family(
69         __in            uint16_t venid,
70         __in            uint16_t devid,
71         __out           efx_family_t *efp);
72
73
74 #define EFX_PCI_VENID_SFC                       0x1924
75
76 #define EFX_PCI_DEVID_FALCON                    0x0710  /* SFC4000 */
77
78 #define EFX_PCI_DEVID_BETHPAGE                  0x0803  /* SFC9020 */
79 #define EFX_PCI_DEVID_SIENA                     0x0813  /* SFL9021 */
80 #define EFX_PCI_DEVID_SIENA_F1_UNINIT           0x0810
81
82 #define EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT      0x0901
83 #define EFX_PCI_DEVID_FARMINGDALE               0x0903  /* SFC9120 PF */
84 #define EFX_PCI_DEVID_GREENPORT                 0x0923  /* SFC9140 PF */
85
86 #define EFX_PCI_DEVID_FARMINGDALE_VF            0x1903  /* SFC9120 VF */
87 #define EFX_PCI_DEVID_GREENPORT_VF              0x1923  /* SFC9140 VF */
88
89 #define EFX_PCI_DEVID_MEDFORD_PF_UNINIT         0x0913
90 #define EFX_PCI_DEVID_MEDFORD                   0x0A03  /* SFC9240 PF */
91 #define EFX_PCI_DEVID_MEDFORD_VF                0x1A03  /* SFC9240 VF */
92
93 #define EFX_MEM_BAR     2
94
95 /* Error codes */
96
97 enum {
98         EFX_ERR_INVALID,
99         EFX_ERR_SRAM_OOB,
100         EFX_ERR_BUFID_DC_OOB,
101         EFX_ERR_MEM_PERR,
102         EFX_ERR_RBUF_OWN,
103         EFX_ERR_TBUF_OWN,
104         EFX_ERR_RDESQ_OWN,
105         EFX_ERR_TDESQ_OWN,
106         EFX_ERR_EVQ_OWN,
107         EFX_ERR_EVFF_OFLO,
108         EFX_ERR_ILL_ADDR,
109         EFX_ERR_SRAM_PERR,
110         EFX_ERR_NCODES
111 };
112
113 /* Calculate the IEEE 802.3 CRC32 of a MAC addr */
114 extern  __checkReturn           uint32_t
115 efx_crc32_calculate(
116         __in                    uint32_t crc_init,
117         __in_ecount(length)     uint8_t const *input,
118         __in                    int length);
119
120
121 /* Type prototypes */
122
123 typedef struct efx_rxq_s        efx_rxq_t;
124
125 /* NIC */
126
127 typedef struct efx_nic_s        efx_nic_t;
128
129 extern  __checkReturn   efx_rc_t
130 efx_nic_create(
131         __in            efx_family_t family,
132         __in            efsys_identifier_t *esip,
133         __in            efsys_bar_t *esbp,
134         __in            efsys_lock_t *eslp,
135         __deref_out     efx_nic_t **enpp);
136
137 extern  __checkReturn   efx_rc_t
138 efx_nic_probe(
139         __in            efx_nic_t *enp);
140
141 extern  __checkReturn   efx_rc_t
142 efx_nic_init(
143         __in            efx_nic_t *enp);
144
145 extern  __checkReturn   efx_rc_t
146 efx_nic_reset(
147         __in            efx_nic_t *enp);
148
149 extern          void
150 efx_nic_fini(
151         __in            efx_nic_t *enp);
152
153 extern          void
154 efx_nic_unprobe(
155         __in            efx_nic_t *enp);
156
157 extern          void
158 efx_nic_destroy(
159         __in    efx_nic_t *enp);
160
161 #define EFX_PCIE_LINK_SPEED_GEN1                1
162 #define EFX_PCIE_LINK_SPEED_GEN2                2
163 #define EFX_PCIE_LINK_SPEED_GEN3                3
164
165 typedef enum efx_pcie_link_performance_e {
166         EFX_PCIE_LINK_PERFORMANCE_UNKNOWN_BANDWIDTH,
167         EFX_PCIE_LINK_PERFORMANCE_SUBOPTIMAL_BANDWIDTH,
168         EFX_PCIE_LINK_PERFORMANCE_SUBOPTIMAL_LATENCY,
169         EFX_PCIE_LINK_PERFORMANCE_OPTIMAL
170 } efx_pcie_link_performance_t;
171
172 extern  __checkReturn   efx_rc_t
173 efx_nic_calculate_pcie_link_bandwidth(
174         __in            uint32_t pcie_link_width,
175         __in            uint32_t pcie_link_gen,
176         __out           uint32_t *bandwidth_mbpsp);
177
178 extern  __checkReturn   efx_rc_t
179 efx_nic_check_pcie_link_speed(
180         __in            efx_nic_t *enp,
181         __in            uint32_t pcie_link_width,
182         __in            uint32_t pcie_link_gen,
183         __out           efx_pcie_link_performance_t *resultp);
184
185 /* INTR */
186
187 #define EFX_NINTR_SIENA 1024
188
189 typedef enum efx_intr_type_e {
190         EFX_INTR_INVALID = 0,
191         EFX_INTR_LINE,
192         EFX_INTR_MESSAGE,
193         EFX_INTR_NTYPES
194 } efx_intr_type_t;
195
196 #define EFX_INTR_SIZE   (sizeof (efx_oword_t))
197
198 extern  __checkReturn   efx_rc_t
199 efx_intr_init(
200         __in            efx_nic_t *enp,
201         __in            efx_intr_type_t type,
202         __in            efsys_mem_t *esmp);
203
204 extern                  void
205 efx_intr_enable(
206         __in            efx_nic_t *enp);
207
208 extern                  void
209 efx_intr_disable(
210         __in            efx_nic_t *enp);
211
212 extern                  void
213 efx_intr_disable_unlocked(
214         __in            efx_nic_t *enp);
215
216 #define EFX_INTR_NEVQS  32
217
218 extern  __checkReturn   efx_rc_t
219 efx_intr_trigger(
220         __in            efx_nic_t *enp,
221         __in            unsigned int level);
222
223 extern                  void
224 efx_intr_status_line(
225         __in            efx_nic_t *enp,
226         __out           boolean_t *fatalp,
227         __out           uint32_t *maskp);
228
229 extern                  void
230 efx_intr_status_message(
231         __in            efx_nic_t *enp,
232         __in            unsigned int message,
233         __out           boolean_t *fatalp);
234
235 extern                  void
236 efx_intr_fatal(
237         __in            efx_nic_t *enp);
238
239 extern                  void
240 efx_intr_fini(
241         __in            efx_nic_t *enp);
242
243 /* MAC */
244
245 typedef enum efx_link_mode_e {
246         EFX_LINK_UNKNOWN = 0,
247         EFX_LINK_DOWN,
248         EFX_LINK_10HDX,
249         EFX_LINK_10FDX,
250         EFX_LINK_100HDX,
251         EFX_LINK_100FDX,
252         EFX_LINK_1000HDX,
253         EFX_LINK_1000FDX,
254         EFX_LINK_10000FDX,
255         EFX_LINK_40000FDX,
256         EFX_LINK_NMODES
257 } efx_link_mode_t;
258
259 #define EFX_MAC_ADDR_LEN 6
260
261 #define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t *)_address)[0] & 0x01)
262
263 #define EFX_MAC_MULTICAST_LIST_MAX      256
264
265 #define EFX_MAC_SDU_MAX 9202
266
267 #define EFX_MAC_PDU_ADJUSTMENT                                  \
268         (/* EtherII */ 14                                       \
269             + /* VLAN */ 4                                      \
270             + /* CRC */ 4                                       \
271             + /* bug16011 */ 16)                                \
272
273 #define EFX_MAC_PDU(_sdu)                                       \
274         P2ROUNDUP((_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8)
275
276 /*
277  * Due to the P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give
278  * the SDU rounded up slightly.
279  */
280 #define EFX_MAC_SDU_FROM_PDU(_pdu)      ((_pdu) - EFX_MAC_PDU_ADJUSTMENT)
281
282 #define EFX_MAC_PDU_MIN 60
283 #define EFX_MAC_PDU_MAX EFX_MAC_PDU(EFX_MAC_SDU_MAX)
284
285 extern  __checkReturn   efx_rc_t
286 efx_mac_pdu_get(
287         __in            efx_nic_t *enp,
288         __out           size_t *pdu);
289
290 extern  __checkReturn   efx_rc_t
291 efx_mac_pdu_set(
292         __in            efx_nic_t *enp,
293         __in            size_t pdu);
294
295 extern  __checkReturn   efx_rc_t
296 efx_mac_addr_set(
297         __in            efx_nic_t *enp,
298         __in            uint8_t *addr);
299
300 extern  __checkReturn                   efx_rc_t
301 efx_mac_filter_set(
302         __in                            efx_nic_t *enp,
303         __in                            boolean_t all_unicst,
304         __in                            boolean_t mulcst,
305         __in                            boolean_t all_mulcst,
306         __in                            boolean_t brdcst);
307
308 extern  __checkReturn   efx_rc_t
309 efx_mac_multicast_list_set(
310         __in                            efx_nic_t *enp,
311         __in_ecount(6*count)            uint8_t const *addrs,
312         __in                            int count);
313
314 extern  __checkReturn   efx_rc_t
315 efx_mac_filter_default_rxq_set(
316         __in            efx_nic_t *enp,
317         __in            efx_rxq_t *erp,
318         __in            boolean_t using_rss);
319
320 extern                  void
321 efx_mac_filter_default_rxq_clear(
322         __in            efx_nic_t *enp);
323
324 extern  __checkReturn   efx_rc_t
325 efx_mac_drain(
326         __in            efx_nic_t *enp,
327         __in            boolean_t enabled);
328
329 extern  __checkReturn   efx_rc_t
330 efx_mac_up(
331         __in            efx_nic_t *enp,
332         __out           boolean_t *mac_upp);
333
334 #define EFX_FCNTL_RESPOND       0x00000001
335 #define EFX_FCNTL_GENERATE      0x00000002
336
337 extern  __checkReturn   efx_rc_t
338 efx_mac_fcntl_set(
339         __in            efx_nic_t *enp,
340         __in            unsigned int fcntl,
341         __in            boolean_t autoneg);
342
343 extern                  void
344 efx_mac_fcntl_get(
345         __in            efx_nic_t *enp,
346         __out           unsigned int *fcntl_wantedp,
347         __out           unsigned int *fcntl_linkp);
348
349
350 /* MON */
351
352 typedef enum efx_mon_type_e {
353         EFX_MON_INVALID = 0,
354         EFX_MON_SFC90X0,
355         EFX_MON_SFC91X0,
356         EFX_MON_SFC92X0,
357         EFX_MON_NTYPES
358 } efx_mon_type_t;
359
360 #if EFSYS_OPT_NAMES
361
362 extern          const char *
363 efx_mon_name(
364         __in    efx_nic_t *enp);
365
366 #endif  /* EFSYS_OPT_NAMES */
367
368 extern  __checkReturn   efx_rc_t
369 efx_mon_init(
370         __in            efx_nic_t *enp);
371
372 extern          void
373 efx_mon_fini(
374         __in    efx_nic_t *enp);
375
376 /* PHY */
377
378 extern  __checkReturn   efx_rc_t
379 efx_phy_verify(
380         __in            efx_nic_t *enp);
381
382 extern  __checkReturn   efx_rc_t
383 efx_port_init(
384         __in            efx_nic_t *enp);
385
386 extern  __checkReturn   efx_rc_t
387 efx_port_poll(
388         __in            efx_nic_t *enp,
389         __out_opt       efx_link_mode_t *link_modep);
390
391 extern          void
392 efx_port_fini(
393         __in    efx_nic_t *enp);
394
395 typedef enum efx_phy_cap_type_e {
396         EFX_PHY_CAP_INVALID = 0,
397         EFX_PHY_CAP_10HDX,
398         EFX_PHY_CAP_10FDX,
399         EFX_PHY_CAP_100HDX,
400         EFX_PHY_CAP_100FDX,
401         EFX_PHY_CAP_1000HDX,
402         EFX_PHY_CAP_1000FDX,
403         EFX_PHY_CAP_10000FDX,
404         EFX_PHY_CAP_PAUSE,
405         EFX_PHY_CAP_ASYM,
406         EFX_PHY_CAP_AN,
407         EFX_PHY_CAP_40000FDX,
408         EFX_PHY_CAP_NTYPES
409 } efx_phy_cap_type_t;
410
411
412 #define EFX_PHY_CAP_CURRENT     0x00000000
413 #define EFX_PHY_CAP_DEFAULT     0x00000001
414 #define EFX_PHY_CAP_PERM        0x00000002
415
416 extern          void
417 efx_phy_adv_cap_get(
418         __in            efx_nic_t *enp,
419         __in            uint32_t flag,
420         __out           uint32_t *maskp);
421
422 extern  __checkReturn   efx_rc_t
423 efx_phy_adv_cap_set(
424         __in            efx_nic_t *enp,
425         __in            uint32_t mask);
426
427 extern                  void
428 efx_phy_lp_cap_get(
429         __in            efx_nic_t *enp,
430         __out           uint32_t *maskp);
431
432 extern  __checkReturn   efx_rc_t
433 efx_phy_oui_get(
434         __in            efx_nic_t *enp,
435         __out           uint32_t *ouip);
436
437 typedef enum efx_phy_media_type_e {
438         EFX_PHY_MEDIA_INVALID = 0,
439         EFX_PHY_MEDIA_XAUI,
440         EFX_PHY_MEDIA_CX4,
441         EFX_PHY_MEDIA_KX4,
442         EFX_PHY_MEDIA_XFP,
443         EFX_PHY_MEDIA_SFP_PLUS,
444         EFX_PHY_MEDIA_BASE_T,
445         EFX_PHY_MEDIA_QSFP_PLUS,
446         EFX_PHY_MEDIA_NTYPES
447 } efx_phy_media_type_t;
448
449 /* Get the type of medium currently used.  If the board has ports for
450  * modules, a module is present, and we recognise the media type of
451  * the module, then this will be the media type of the module.
452  * Otherwise it will be the media type of the port.
453  */
454 extern                  void
455 efx_phy_media_type_get(
456         __in            efx_nic_t *enp,
457         __out           efx_phy_media_type_t *typep);
458
459 extern                                  efx_rc_t
460 efx_phy_module_get_info(
461         __in                            efx_nic_t *enp,
462         __in                            uint8_t dev_addr,
463         __in                            uint8_t offset,
464         __in                            uint8_t len,
465         __out_bcount(len)               uint8_t *data);
466
467
468 #define EFX_FEATURE_IPV6                0x00000001
469 #define EFX_FEATURE_LFSR_HASH_INSERT    0x00000002
470 #define EFX_FEATURE_LINK_EVENTS         0x00000004
471 #define EFX_FEATURE_PERIODIC_MAC_STATS  0x00000008
472 #define EFX_FEATURE_MCDI                0x00000020
473 #define EFX_FEATURE_LOOKAHEAD_SPLIT     0x00000040
474 #define EFX_FEATURE_MAC_HEADER_FILTERS  0x00000080
475 #define EFX_FEATURE_TURBO               0x00000100
476 #define EFX_FEATURE_MCDI_DMA            0x00000200
477 #define EFX_FEATURE_TX_SRC_FILTERS      0x00000400
478 #define EFX_FEATURE_PIO_BUFFERS         0x00000800
479 #define EFX_FEATURE_FW_ASSISTED_TSO     0x00001000
480 #define EFX_FEATURE_FW_ASSISTED_TSO_V2  0x00002000
481 #define EFX_FEATURE_PACKED_STREAM       0x00004000
482
483 typedef struct efx_nic_cfg_s {
484         uint32_t                enc_board_type;
485         uint32_t                enc_phy_type;
486 #if EFSYS_OPT_NAMES
487         char                    enc_phy_name[21];
488 #endif
489         char                    enc_phy_revision[21];
490         efx_mon_type_t          enc_mon_type;
491         unsigned int            enc_features;
492         uint8_t                 enc_mac_addr[6];
493         uint8_t                 enc_port;       /* PHY port number */
494         uint32_t                enc_intr_vec_base;
495         uint32_t                enc_intr_limit;
496         uint32_t                enc_evq_limit;
497         uint32_t                enc_txq_limit;
498         uint32_t                enc_rxq_limit;
499         uint32_t                enc_txq_max_ndescs;
500         uint32_t                enc_buftbl_limit;
501         uint32_t                enc_piobuf_limit;
502         uint32_t                enc_piobuf_size;
503         uint32_t                enc_piobuf_min_alloc_size;
504         uint32_t                enc_evq_timer_quantum_ns;
505         uint32_t                enc_evq_timer_max_us;
506         uint32_t                enc_clk_mult;
507         uint32_t                enc_rx_prefix_size;
508         uint32_t                enc_rx_buf_align_start;
509         uint32_t                enc_rx_buf_align_end;
510         boolean_t               enc_bug26807_workaround;
511         boolean_t               enc_bug35388_workaround;
512         boolean_t               enc_bug41750_workaround;
513         boolean_t               enc_bug61265_workaround;
514         boolean_t               enc_rx_batching_enabled;
515         /* Maximum number of descriptors completed in an rx event. */
516         uint32_t                enc_rx_batch_max;
517         /* Number of rx descriptors the hardware requires for a push. */
518         uint32_t                enc_rx_push_align;
519         /*
520          * Maximum number of bytes into the packet the TCP header can start for
521          * the hardware to apply TSO packet edits.
522          */
523         uint32_t                enc_tx_tso_tcp_header_offset_limit;
524         boolean_t               enc_fw_assisted_tso_enabled;
525         boolean_t               enc_fw_assisted_tso_v2_enabled;
526         /* Number of TSO contexts on the NIC (FATSOv2) */
527         uint32_t                enc_fw_assisted_tso_v2_n_contexts;
528         boolean_t               enc_hw_tx_insert_vlan_enabled;
529         /* Number of PFs on the NIC */
530         uint32_t                enc_hw_pf_count;
531         /* Datapath firmware vadapter/vport/vswitch support */
532         boolean_t               enc_datapath_cap_evb;
533         boolean_t               enc_rx_disable_scatter_supported;
534         boolean_t               enc_allow_set_mac_with_installed_filters;
535         boolean_t               enc_enhanced_set_mac_supported;
536         boolean_t               enc_init_evq_v2_supported;
537         boolean_t               enc_rx_packed_stream_supported;
538         boolean_t               enc_rx_var_packed_stream_supported;
539         boolean_t               enc_pm_and_rxdp_counters;
540         boolean_t               enc_mac_stats_40g_tx_size_bins;
541         /* External port identifier */
542         uint8_t                 enc_external_port;
543         uint32_t                enc_mcdi_max_payload_length;
544         /* VPD may be per-PF or global */
545         boolean_t               enc_vpd_is_global;
546         /* Minimum unidirectional bandwidth in Mb/s to max out all ports */
547         uint32_t                enc_required_pcie_bandwidth_mbps;
548         uint32_t                enc_max_pcie_link_gen;
549         /* Firmware verifies integrity of NVRAM updates */
550         uint32_t                enc_fw_verified_nvram_update_required;
551 } efx_nic_cfg_t;
552
553 #define EFX_PCI_FUNCTION_IS_PF(_encp)   ((_encp)->enc_vf == 0xffff)
554 #define EFX_PCI_FUNCTION_IS_VF(_encp)   ((_encp)->enc_vf != 0xffff)
555
556 #define EFX_PCI_FUNCTION(_encp) \
557         (EFX_PCI_FUNCTION_IS_PF(_encp) ? (_encp)->enc_pf : (_encp)->enc_vf)
558
559 #define EFX_PCI_VF_PARENT(_encp)        ((_encp)->enc_pf)
560
561 extern                  const efx_nic_cfg_t *
562 efx_nic_cfg_get(
563         __in            efx_nic_t *enp);
564
565 /* Driver resource limits (minimum required/maximum usable). */
566 typedef struct efx_drv_limits_s {
567         uint32_t        edl_min_evq_count;
568         uint32_t        edl_max_evq_count;
569
570         uint32_t        edl_min_rxq_count;
571         uint32_t        edl_max_rxq_count;
572
573         uint32_t        edl_min_txq_count;
574         uint32_t        edl_max_txq_count;
575
576         /* PIO blocks (sub-allocated from piobuf) */
577         uint32_t        edl_min_pio_alloc_size;
578         uint32_t        edl_max_pio_alloc_count;
579 } efx_drv_limits_t;
580
581 extern  __checkReturn   efx_rc_t
582 efx_nic_set_drv_limits(
583         __inout         efx_nic_t *enp,
584         __in            efx_drv_limits_t *edlp);
585
586 typedef enum efx_nic_region_e {
587         EFX_REGION_VI,                  /* Memory BAR UC mapping */
588         EFX_REGION_PIO_WRITE_VI,        /* Memory BAR WC mapping */
589 } efx_nic_region_t;
590
591 extern  __checkReturn   efx_rc_t
592 efx_nic_get_bar_region(
593         __in            efx_nic_t *enp,
594         __in            efx_nic_region_t region,
595         __out           uint32_t *offsetp,
596         __out           size_t *sizep);
597
598 extern  __checkReturn   efx_rc_t
599 efx_nic_get_vi_pool(
600         __in            efx_nic_t *enp,
601         __out           uint32_t *evq_countp,
602         __out           uint32_t *rxq_countp,
603         __out           uint32_t *txq_countp);
604
605
606 /* NVRAM */
607
608 extern  __checkReturn   efx_rc_t
609 efx_sram_buf_tbl_set(
610         __in            efx_nic_t *enp,
611         __in            uint32_t id,
612         __in            efsys_mem_t *esmp,
613         __in            size_t n);
614
615 extern          void
616 efx_sram_buf_tbl_clear(
617         __in    efx_nic_t *enp,
618         __in    uint32_t id,
619         __in    size_t n);
620
621 #define EFX_BUF_TBL_SIZE        0x20000
622
623 #define EFX_BUF_SIZE            4096
624
625 /* EV */
626
627 typedef struct efx_evq_s        efx_evq_t;
628
629 extern  __checkReturn   efx_rc_t
630 efx_ev_init(
631         __in            efx_nic_t *enp);
632
633 extern          void
634 efx_ev_fini(
635         __in            efx_nic_t *enp);
636
637 #define EFX_EVQ_MAXNEVS         32768
638 #define EFX_EVQ_MINNEVS         512
639
640 #define EFX_EVQ_SIZE(_nevs)     ((_nevs) * sizeof (efx_qword_t))
641 #define EFX_EVQ_NBUFS(_nevs)    (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE)
642
643 #define EFX_EVQ_FLAGS_TYPE_MASK         (0x3)
644 #define EFX_EVQ_FLAGS_TYPE_AUTO         (0x0)
645 #define EFX_EVQ_FLAGS_TYPE_THROUGHPUT   (0x1)
646 #define EFX_EVQ_FLAGS_TYPE_LOW_LATENCY  (0x2)
647
648 #define EFX_EVQ_FLAGS_NOTIFY_MASK       (0xC)
649 #define EFX_EVQ_FLAGS_NOTIFY_INTERRUPT  (0x0)   /* Interrupting (default) */
650 #define EFX_EVQ_FLAGS_NOTIFY_DISABLED   (0x4)   /* Non-interrupting */
651
652 extern  __checkReturn   efx_rc_t
653 efx_ev_qcreate(
654         __in            efx_nic_t *enp,
655         __in            unsigned int index,
656         __in            efsys_mem_t *esmp,
657         __in            size_t n,
658         __in            uint32_t id,
659         __in            uint32_t us,
660         __in            uint32_t flags,
661         __deref_out     efx_evq_t **eepp);
662
663 extern          void
664 efx_ev_qpost(
665         __in            efx_evq_t *eep,
666         __in            uint16_t data);
667
668 typedef __checkReturn   boolean_t
669 (*efx_initialized_ev_t)(
670         __in_opt        void *arg);
671
672 #define EFX_PKT_UNICAST         0x0004
673 #define EFX_PKT_START           0x0008
674
675 #define EFX_PKT_VLAN_TAGGED     0x0010
676 #define EFX_CKSUM_TCPUDP        0x0020
677 #define EFX_CKSUM_IPV4          0x0040
678 #define EFX_PKT_CONT            0x0080
679
680 #define EFX_CHECK_VLAN          0x0100
681 #define EFX_PKT_TCP             0x0200
682 #define EFX_PKT_UDP             0x0400
683 #define EFX_PKT_IPV4            0x0800
684
685 #define EFX_PKT_IPV6            0x1000
686 #define EFX_PKT_PREFIX_LEN      0x2000
687 #define EFX_ADDR_MISMATCH       0x4000
688 #define EFX_DISCARD             0x8000
689
690 /*
691  * The following flags are used only for packed stream
692  * mode. The values for the flags are reused to fit into 16 bit,
693  * since EFX_PKT_START and EFX_PKT_CONT are never used in
694  * packed stream mode
695  */
696 #define EFX_PKT_PACKED_STREAM_NEW_BUFFER        EFX_PKT_START
697 #define EFX_PKT_PACKED_STREAM_PARSE_INCOMPLETE  EFX_PKT_CONT
698
699
700 #define EFX_EV_RX_NLABELS       32
701 #define EFX_EV_TX_NLABELS       32
702
703 typedef __checkReturn   boolean_t
704 (*efx_rx_ev_t)(
705         __in_opt        void *arg,
706         __in            uint32_t label,
707         __in            uint32_t id,
708         __in            uint32_t size,
709         __in            uint16_t flags);
710
711 typedef __checkReturn   boolean_t
712 (*efx_tx_ev_t)(
713         __in_opt        void *arg,
714         __in            uint32_t label,
715         __in            uint32_t id);
716
717 #define EFX_EXCEPTION_RX_RECOVERY       0x00000001
718 #define EFX_EXCEPTION_RX_DSC_ERROR      0x00000002
719 #define EFX_EXCEPTION_TX_DSC_ERROR      0x00000003
720 #define EFX_EXCEPTION_UNKNOWN_SENSOREVT 0x00000004
721 #define EFX_EXCEPTION_FWALERT_SRAM      0x00000005
722 #define EFX_EXCEPTION_UNKNOWN_FWALERT   0x00000006
723 #define EFX_EXCEPTION_RX_ERROR          0x00000007
724 #define EFX_EXCEPTION_TX_ERROR          0x00000008
725 #define EFX_EXCEPTION_EV_ERROR          0x00000009
726
727 typedef __checkReturn   boolean_t
728 (*efx_exception_ev_t)(
729         __in_opt        void *arg,
730         __in            uint32_t label,
731         __in            uint32_t data);
732
733 typedef __checkReturn   boolean_t
734 (*efx_rxq_flush_done_ev_t)(
735         __in_opt        void *arg,
736         __in            uint32_t rxq_index);
737
738 typedef __checkReturn   boolean_t
739 (*efx_rxq_flush_failed_ev_t)(
740         __in_opt        void *arg,
741         __in            uint32_t rxq_index);
742
743 typedef __checkReturn   boolean_t
744 (*efx_txq_flush_done_ev_t)(
745         __in_opt        void *arg,
746         __in            uint32_t txq_index);
747
748 typedef __checkReturn   boolean_t
749 (*efx_software_ev_t)(
750         __in_opt        void *arg,
751         __in            uint16_t magic);
752
753 typedef __checkReturn   boolean_t
754 (*efx_sram_ev_t)(
755         __in_opt        void *arg,
756         __in            uint32_t code);
757
758 #define EFX_SRAM_CLEAR          0
759 #define EFX_SRAM_UPDATE         1
760 #define EFX_SRAM_ILLEGAL_CLEAR  2
761
762 typedef __checkReturn   boolean_t
763 (*efx_wake_up_ev_t)(
764         __in_opt        void *arg,
765         __in            uint32_t label);
766
767 typedef __checkReturn   boolean_t
768 (*efx_timer_ev_t)(
769         __in_opt        void *arg,
770         __in            uint32_t label);
771
772 typedef __checkReturn   boolean_t
773 (*efx_link_change_ev_t)(
774         __in_opt        void *arg,
775         __in            efx_link_mode_t link_mode);
776
777 typedef struct efx_ev_callbacks_s {
778         efx_initialized_ev_t            eec_initialized;
779         efx_rx_ev_t                     eec_rx;
780         efx_tx_ev_t                     eec_tx;
781         efx_exception_ev_t              eec_exception;
782         efx_rxq_flush_done_ev_t         eec_rxq_flush_done;
783         efx_rxq_flush_failed_ev_t       eec_rxq_flush_failed;
784         efx_txq_flush_done_ev_t         eec_txq_flush_done;
785         efx_software_ev_t               eec_software;
786         efx_sram_ev_t                   eec_sram;
787         efx_wake_up_ev_t                eec_wake_up;
788         efx_timer_ev_t                  eec_timer;
789         efx_link_change_ev_t            eec_link_change;
790 } efx_ev_callbacks_t;
791
792 extern  __checkReturn   boolean_t
793 efx_ev_qpending(
794         __in            efx_evq_t *eep,
795         __in            unsigned int count);
796
797 extern                  void
798 efx_ev_qpoll(
799         __in            efx_evq_t *eep,
800         __inout         unsigned int *countp,
801         __in            const efx_ev_callbacks_t *eecp,
802         __in_opt        void *arg);
803
804 extern  __checkReturn   efx_rc_t
805 efx_ev_usecs_to_ticks(
806         __in            efx_nic_t *enp,
807         __in            unsigned int usecs,
808         __out           unsigned int *ticksp);
809
810 extern  __checkReturn   efx_rc_t
811 efx_ev_qmoderate(
812         __in            efx_evq_t *eep,
813         __in            unsigned int us);
814
815 extern  __checkReturn   efx_rc_t
816 efx_ev_qprime(
817         __in            efx_evq_t *eep,
818         __in            unsigned int count);
819
820 extern          void
821 efx_ev_qdestroy(
822         __in    efx_evq_t *eep);
823
824 /* RX */
825
826 extern  __checkReturn   efx_rc_t
827 efx_rx_init(
828         __inout         efx_nic_t *enp);
829
830 extern          void
831 efx_rx_fini(
832         __in            efx_nic_t *enp);
833
834 extern  __checkReturn   efx_rc_t
835 efx_pseudo_hdr_pkt_length_get(
836         __in            efx_rxq_t *erp,
837         __in            uint8_t *buffer,
838         __out           uint16_t *pkt_lengthp);
839
840 #define EFX_RXQ_MAXNDESCS               4096
841 #define EFX_RXQ_MINNDESCS               512
842
843 #define EFX_RXQ_SIZE(_ndescs)           ((_ndescs) * sizeof (efx_qword_t))
844 #define EFX_RXQ_NBUFS(_ndescs)          (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
845 #define EFX_RXQ_LIMIT(_ndescs)          ((_ndescs) - 16)
846 #define EFX_RXQ_DC_NDESCS(_dcsize)      (8 << _dcsize)
847
848 typedef enum efx_rxq_type_e {
849         EFX_RXQ_TYPE_DEFAULT,
850         EFX_RXQ_TYPE_SCATTER,
851         EFX_RXQ_TYPE_PACKED_STREAM_1M,
852         EFX_RXQ_TYPE_PACKED_STREAM_512K,
853         EFX_RXQ_TYPE_PACKED_STREAM_256K,
854         EFX_RXQ_TYPE_PACKED_STREAM_128K,
855         EFX_RXQ_TYPE_PACKED_STREAM_64K,
856         EFX_RXQ_NTYPES
857 } efx_rxq_type_t;
858
859 extern  __checkReturn   efx_rc_t
860 efx_rx_qcreate(
861         __in            efx_nic_t *enp,
862         __in            unsigned int index,
863         __in            unsigned int label,
864         __in            efx_rxq_type_t type,
865         __in            efsys_mem_t *esmp,
866         __in            size_t n,
867         __in            uint32_t id,
868         __in            efx_evq_t *eep,
869         __deref_out     efx_rxq_t **erpp);
870
871 typedef struct efx_buffer_s {
872         efsys_dma_addr_t        eb_addr;
873         size_t                  eb_size;
874         boolean_t               eb_eop;
875 } efx_buffer_t;
876
877 typedef struct efx_desc_s {
878         efx_qword_t ed_eq;
879 } efx_desc_t;
880
881 extern                  void
882 efx_rx_qpost(
883         __in            efx_rxq_t *erp,
884         __in_ecount(n)  efsys_dma_addr_t *addrp,
885         __in            size_t size,
886         __in            unsigned int n,
887         __in            unsigned int completed,
888         __in            unsigned int added);
889
890 extern          void
891 efx_rx_qpush(
892         __in    efx_rxq_t *erp,
893         __in    unsigned int added,
894         __inout unsigned int *pushedp);
895
896 extern  __checkReturn   efx_rc_t
897 efx_rx_qflush(
898         __in    efx_rxq_t *erp);
899
900 extern          void
901 efx_rx_qenable(
902         __in    efx_rxq_t *erp);
903
904 extern          void
905 efx_rx_qdestroy(
906         __in    efx_rxq_t *erp);
907
908 /* TX */
909
910 typedef struct efx_txq_s        efx_txq_t;
911
912 extern  __checkReturn   efx_rc_t
913 efx_tx_init(
914         __in            efx_nic_t *enp);
915
916 extern          void
917 efx_tx_fini(
918         __in    efx_nic_t *enp);
919
920 #define EFX_TXQ_MINNDESCS               512
921
922 #define EFX_TXQ_SIZE(_ndescs)           ((_ndescs) * sizeof (efx_qword_t))
923 #define EFX_TXQ_NBUFS(_ndescs)          (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
924 #define EFX_TXQ_LIMIT(_ndescs)          ((_ndescs) - 16)
925 #define EFX_TXQ_DC_NDESCS(_dcsize)      (8 << _dcsize)
926
927 #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */
928
929 #define EFX_TXQ_CKSUM_IPV4      0x0001
930 #define EFX_TXQ_CKSUM_TCPUDP    0x0002
931 #define EFX_TXQ_FATSOV2         0x0004
932
933 extern  __checkReturn   efx_rc_t
934 efx_tx_qcreate(
935         __in            efx_nic_t *enp,
936         __in            unsigned int index,
937         __in            unsigned int label,
938         __in            efsys_mem_t *esmp,
939         __in            size_t n,
940         __in            uint32_t id,
941         __in            uint16_t flags,
942         __in            efx_evq_t *eep,
943         __deref_out     efx_txq_t **etpp,
944         __out           unsigned int *addedp);
945
946 extern  __checkReturn   efx_rc_t
947 efx_tx_qpost(
948         __in            efx_txq_t *etp,
949         __in_ecount(n)  efx_buffer_t *eb,
950         __in            unsigned int n,
951         __in            unsigned int completed,
952         __inout         unsigned int *addedp);
953
954 extern  __checkReturn   efx_rc_t
955 efx_tx_qpace(
956         __in            efx_txq_t *etp,
957         __in            unsigned int ns);
958
959 extern                  void
960 efx_tx_qpush(
961         __in            efx_txq_t *etp,
962         __in            unsigned int added,
963         __in            unsigned int pushed);
964
965 extern  __checkReturn   efx_rc_t
966 efx_tx_qflush(
967         __in            efx_txq_t *etp);
968
969 extern                  void
970 efx_tx_qenable(
971         __in            efx_txq_t *etp);
972
973 extern  __checkReturn   efx_rc_t
974 efx_tx_qpio_enable(
975         __in            efx_txq_t *etp);
976
977 extern                  void
978 efx_tx_qpio_disable(
979         __in            efx_txq_t *etp);
980
981 extern  __checkReturn   efx_rc_t
982 efx_tx_qpio_write(
983         __in                    efx_txq_t *etp,
984         __in_ecount(buf_length) uint8_t *buffer,
985         __in                    size_t buf_length,
986         __in                    size_t pio_buf_offset);
987
988 extern  __checkReturn   efx_rc_t
989 efx_tx_qpio_post(
990         __in                    efx_txq_t *etp,
991         __in                    size_t pkt_length,
992         __in                    unsigned int completed,
993         __inout                 unsigned int *addedp);
994
995 extern  __checkReturn   efx_rc_t
996 efx_tx_qdesc_post(
997         __in            efx_txq_t *etp,
998         __in_ecount(n)  efx_desc_t *ed,
999         __in            unsigned int n,
1000         __in            unsigned int completed,
1001         __inout         unsigned int *addedp);
1002
1003 extern  void
1004 efx_tx_qdesc_dma_create(
1005         __in    efx_txq_t *etp,
1006         __in    efsys_dma_addr_t addr,
1007         __in    size_t size,
1008         __in    boolean_t eop,
1009         __out   efx_desc_t *edp);
1010
1011 extern  void
1012 efx_tx_qdesc_tso_create(
1013         __in    efx_txq_t *etp,
1014         __in    uint16_t ipv4_id,
1015         __in    uint32_t tcp_seq,
1016         __in    uint8_t  tcp_flags,
1017         __out   efx_desc_t *edp);
1018
1019 /* Number of FATSOv2 option descriptors */
1020 #define EFX_TX_FATSOV2_OPT_NDESCS               2
1021
1022 /* Maximum number of DMA segments per TSO packet (not superframe) */
1023 #define EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX     24
1024
1025 extern  void
1026 efx_tx_qdesc_tso2_create(
1027         __in                    efx_txq_t *etp,
1028         __in                    uint16_t ipv4_id,
1029         __in                    uint32_t tcp_seq,
1030         __in                    uint16_t tcp_mss,
1031         __out_ecount(count)     efx_desc_t *edp,
1032         __in                    int count);
1033
1034 extern  void
1035 efx_tx_qdesc_vlantci_create(
1036         __in    efx_txq_t *etp,
1037         __in    uint16_t tci,
1038         __out   efx_desc_t *edp);
1039
1040 extern          void
1041 efx_tx_qdestroy(
1042         __in    efx_txq_t *etp);
1043
1044
1045 /* FILTER */
1046
1047 #if EFSYS_OPT_FILTER
1048
1049 #define EFX_ETHER_TYPE_IPV4 0x0800
1050 #define EFX_ETHER_TYPE_IPV6 0x86DD
1051
1052 #define EFX_IPPROTO_TCP 6
1053 #define EFX_IPPROTO_UDP 17
1054
1055 /* Use RSS to spread across multiple queues */
1056 #define EFX_FILTER_FLAG_RX_RSS          0x01
1057 /* Enable RX scatter */
1058 #define EFX_FILTER_FLAG_RX_SCATTER      0x02
1059 /*
1060  * Override an automatic filter (priority EFX_FILTER_PRI_AUTO).
1061  * May only be set by the filter implementation for each type.
1062  * A removal request will restore the automatic filter in its place.
1063  */
1064 #define EFX_FILTER_FLAG_RX_OVER_AUTO    0x04
1065 /* Filter is for RX */
1066 #define EFX_FILTER_FLAG_RX              0x08
1067 /* Filter is for TX */
1068 #define EFX_FILTER_FLAG_TX              0x10
1069
1070 typedef unsigned int efx_filter_flags_t;
1071
1072 typedef enum efx_filter_match_flags_e {
1073         EFX_FILTER_MATCH_REM_HOST = 0x0001,     /* Match by remote IP host
1074                                                  * address */
1075         EFX_FILTER_MATCH_LOC_HOST = 0x0002,     /* Match by local IP host
1076                                                  * address */
1077         EFX_FILTER_MATCH_REM_MAC = 0x0004,      /* Match by remote MAC address */
1078         EFX_FILTER_MATCH_REM_PORT = 0x0008,     /* Match by remote TCP/UDP port */
1079         EFX_FILTER_MATCH_LOC_MAC = 0x0010,      /* Match by remote TCP/UDP port */
1080         EFX_FILTER_MATCH_LOC_PORT = 0x0020,     /* Match by local TCP/UDP port */
1081         EFX_FILTER_MATCH_ETHER_TYPE = 0x0040,   /* Match by Ether-type */
1082         EFX_FILTER_MATCH_INNER_VID = 0x0080,    /* Match by inner VLAN ID */
1083         EFX_FILTER_MATCH_OUTER_VID = 0x0100,    /* Match by outer VLAN ID */
1084         EFX_FILTER_MATCH_IP_PROTO = 0x0200,     /* Match by IP transport
1085                                                  * protocol */
1086         EFX_FILTER_MATCH_LOC_MAC_IG = 0x0400,   /* Match by local MAC address
1087                                                  * I/G bit. Used for RX default
1088                                                  * unicast and multicast/
1089                                                  * broadcast filters. */
1090 } efx_filter_match_flags_t;
1091
1092 typedef enum efx_filter_priority_s {
1093         EFX_FILTER_PRI_HINT = 0,        /* Performance hint */
1094         EFX_FILTER_PRI_AUTO,            /* Automatic filter based on device
1095                                          * address list or hardware
1096                                          * requirements. This may only be used
1097                                          * by the filter implementation for
1098                                          * each NIC type. */
1099         EFX_FILTER_PRI_MANUAL,          /* Manually configured filter */
1100         EFX_FILTER_PRI_REQUIRED,        /* Required for correct behaviour of the
1101                                          * client (e.g. SR-IOV, HyperV VMQ etc.)
1102                                          */
1103 } efx_filter_priority_t;
1104
1105 /*
1106  * FIXME: All these fields are assumed to be in little-endian byte order.
1107  * It may be better for some to be big-endian. See bug42804.
1108  */
1109
1110 typedef struct efx_filter_spec_s {
1111         uint32_t        efs_match_flags:12;
1112         uint32_t        efs_priority:2;
1113         uint32_t        efs_flags:6;
1114         uint32_t        efs_dmaq_id:12;
1115         uint32_t        efs_rss_context;
1116         uint16_t        efs_outer_vid;
1117         uint16_t        efs_inner_vid;
1118         uint8_t         efs_loc_mac[EFX_MAC_ADDR_LEN];
1119         uint8_t         efs_rem_mac[EFX_MAC_ADDR_LEN];
1120         uint16_t        efs_ether_type;
1121         uint8_t         efs_ip_proto;
1122         uint16_t        efs_loc_port;
1123         uint16_t        efs_rem_port;
1124         efx_oword_t     efs_rem_host;
1125         efx_oword_t     efs_loc_host;
1126 } efx_filter_spec_t;
1127
1128
1129 /* Default values for use in filter specifications */
1130 #define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT     0xffffffff
1131 #define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP         0xfff
1132 #define EFX_FILTER_SPEC_VID_UNSPEC              0xffff
1133
1134 extern  __checkReturn   efx_rc_t
1135 efx_filter_init(
1136         __in            efx_nic_t *enp);
1137
1138 extern                  void
1139 efx_filter_fini(
1140         __in            efx_nic_t *enp);
1141
1142 extern  __checkReturn   efx_rc_t
1143 efx_filter_insert(
1144         __in            efx_nic_t *enp,
1145         __inout         efx_filter_spec_t *spec);
1146
1147 extern  __checkReturn   efx_rc_t
1148 efx_filter_remove(
1149         __in            efx_nic_t *enp,
1150         __inout         efx_filter_spec_t *spec);
1151
1152 extern  __checkReturn   efx_rc_t
1153 efx_filter_restore(
1154         __in            efx_nic_t *enp);
1155
1156 extern  __checkReturn   efx_rc_t
1157 efx_filter_supported_filters(
1158         __in            efx_nic_t *enp,
1159         __out           uint32_t *list,
1160         __out           size_t *length);
1161
1162 extern                  void
1163 efx_filter_spec_init_rx(
1164         __out           efx_filter_spec_t *spec,
1165         __in            efx_filter_priority_t priority,
1166         __in            efx_filter_flags_t flags,
1167         __in            efx_rxq_t *erp);
1168
1169 extern                  void
1170 efx_filter_spec_init_tx(
1171         __out           efx_filter_spec_t *spec,
1172         __in            efx_txq_t *etp);
1173
1174 extern  __checkReturn   efx_rc_t
1175 efx_filter_spec_set_ipv4_local(
1176         __inout         efx_filter_spec_t *spec,
1177         __in            uint8_t proto,
1178         __in            uint32_t host,
1179         __in            uint16_t port);
1180
1181 extern  __checkReturn   efx_rc_t
1182 efx_filter_spec_set_ipv4_full(
1183         __inout         efx_filter_spec_t *spec,
1184         __in            uint8_t proto,
1185         __in            uint32_t lhost,
1186         __in            uint16_t lport,
1187         __in            uint32_t rhost,
1188         __in            uint16_t rport);
1189
1190 extern  __checkReturn   efx_rc_t
1191 efx_filter_spec_set_eth_local(
1192         __inout         efx_filter_spec_t *spec,
1193         __in            uint16_t vid,
1194         __in            const uint8_t *addr);
1195
1196 extern  __checkReturn   efx_rc_t
1197 efx_filter_spec_set_uc_def(
1198         __inout         efx_filter_spec_t *spec);
1199
1200 extern  __checkReturn   efx_rc_t
1201 efx_filter_spec_set_mc_def(
1202         __inout         efx_filter_spec_t *spec);
1203
1204 #endif  /* EFSYS_OPT_FILTER */
1205
1206 /* HASH */
1207
1208 extern  __checkReturn           uint32_t
1209 efx_hash_dwords(
1210         __in_ecount(count)      uint32_t const *input,
1211         __in                    size_t count,
1212         __in                    uint32_t init);
1213
1214 extern  __checkReturn           uint32_t
1215 efx_hash_bytes(
1216         __in_ecount(length)     uint8_t const *input,
1217         __in                    size_t length,
1218         __in                    uint32_t init);
1219
1220
1221
1222 #ifdef  __cplusplus
1223 }
1224 #endif
1225
1226 #endif  /* _SYS_EFX_H */