xref: /freebsd/sys/contrib/ncsw/inc/Peripherals/fm_macsec_ext.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
1 /*
2  * Copyright 2008-2015 Freescale Semiconductor Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above copyright
9  *       notice, this list of conditions and the following disclaimer in the
10  *       documentation and/or other materials provided with the distribution.
11  *     * Neither the name of Freescale Semiconductor nor the
12  *       names of its contributors may be used to endorse or promote products
13  *       derived from this software without specific prior written permission.
14  *
15  *
16  * ALTERNATIVELY, this software may be distributed under the terms of the
17  * GNU General Public License ("GPL") as published by the Free Software
18  * Foundation, either version 2 of that License or (at your option) any
19  * later version.
20  *
21  * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /**************************************************************************//**
34  @File          fm_macsec_ext.h
35 
36  @Description   FM MACSEC ...
37 *//***************************************************************************/
38 #ifndef __FM_MACSEC_EXT_H
39 #define __FM_MACSEC_EXT_H
40 
41 #include "std_ext.h"
42 
43 
44 /**************************************************************************//**
45  @Group         FM_grp Frame Manager API
46 
47  @Description   FM API functions, definitions and enums
48 
49  @{
50 *//***************************************************************************/
51 
52 /**************************************************************************//**
53  @Group         FM_MACSEC_grp FM MACSEC
54 
55  @Description   FM MACSEC API functions, definitions and enums
56 
57  @{
58 *//***************************************************************************/
59 
60 /**************************************************************************//**
61  @Description   MACSEC Exceptions
62 *//***************************************************************************/
63 typedef enum e_FmMacsecExceptions {
64     e_FM_MACSEC_EX_SINGLE_BIT_ECC,          /**< Single bit ECC error */
65     e_FM_MACSEC_EX_MULTI_BIT_ECC            /**< Multi bit ECC error */
66 } e_FmMacsecExceptions;
67 
68 
69 /**************************************************************************//**
70  @Group         FM_MACSEC_init_grp FM-MACSEC Initialization Unit
71 
72  @Description   FM MACSEC Initialization Unit
73 
74  @{
75 *//***************************************************************************/
76 
77 /**************************************************************************//**
78  @Function      t_FmMacsecExceptionsCallback
79 
80  @Description   Exceptions user callback routine, will be called upon an
81                 exception passing the exception identification.
82 
83  @Param[in]     h_App       A handle to an application layer object; This handle
84                             will be passed by the driver upon calling this callback.
85  @Param[in]     exception   The exception.
86 *//***************************************************************************/
87 typedef void (t_FmMacsecExceptionsCallback) ( t_Handle                  h_App,
88                                               e_FmMacsecExceptions      exception);
89 
90 
91 /**************************************************************************//**
92  @Description   FM MACSEC config input
93 *//***************************************************************************/
94 typedef struct t_FmMacsecParams {
95     t_Handle                                h_Fm;               /**< A handle to the FM object related to */
96     bool                                    guestMode;          /**< Partition-id */
97     union {
98         struct {
99             uint8_t                         fmMacId;            /**< FM MAC id */
100         } guestParams;
101 
102         struct {
103             uintptr_t                       baseAddr;           /**< Base of memory mapped FM MACSEC registers */
104             t_Handle                        h_FmMac;            /**< A handle to the FM MAC object  related to */
105             t_FmMacsecExceptionsCallback    *f_Exception;       /**< Exception Callback Routine         */
106             t_Handle                        h_App;              /**< A handle to an application layer object; This handle will
107                                                                      be passed by the driver upon calling the above callbacks */
108         } nonGuestParams;
109     };
110 } t_FmMacsecParams;
111 
112 /**************************************************************************//**
113  @Function      FM_MACSEC_Config
114 
115  @Description   Creates descriptor for the FM MACSEC module;
116 
117                 The routine returns a handle (descriptor) to the FM MACSEC object;
118                 This descriptor must be passed as first parameter to all other
119                 FM MACSEC function calls;
120 
121                 No actual initialization or configuration of FM MACSEC hardware is
122                 done by this routine.
123 
124  @Param[in]     p_FmMacsecParam     Pointer to data structure of parameters.
125 
126  @Retval        Handle to FM MACSEC object, or NULL for Failure.
127 *//***************************************************************************/
128 t_Handle FM_MACSEC_Config(t_FmMacsecParams *p_FmMacsecParam);
129 
130 /**************************************************************************//**
131  @Function      FM_MACSEC_Init
132 
133  @Description   Initializes the FM MACSEC module.
134 
135  @Param[in]     h_FmMacsec      FM MACSEC module descriptor.
136 
137  @Return        E_OK on success; Error code otherwise.
138 *//***************************************************************************/
139 t_Error FM_MACSEC_Init(t_Handle h_FmMacsec);
140 
141 /**************************************************************************//**
142  @Function      FM_MACSEC_Free
143 
144  @Description   Frees all resources that were assigned to FM MACSEC module;
145 
146                 Calling this routine invalidates the descriptor.
147 
148  @Param[in]     h_FmMacsec      FM MACSEC module descriptor.
149 
150  @Return        E_OK on success; Error code otherwise.
151 *//***************************************************************************/
152 t_Error FM_MACSEC_Free(t_Handle h_FmMacsec);
153 
154 
155 /**************************************************************************//**
156  @Group         FM_MACSEC_advanced_init_grp    FM-MACSEC Advanced Configuration Unit
157 
158  @Description   Configuration functions used to change default values.
159 
160  @{
161 *//***************************************************************************/
162 
163 /**************************************************************************//**
164  @Description   enum for unknown sci frame treatment
165 *//***************************************************************************/
166 typedef enum e_FmMacsecUnknownSciFrameTreatment {
167     e_FM_MACSEC_UNKNOWN_SCI_FRAME_TREATMENT_DISCARD_BOTH = 0,                                               /**< Controlled port - Strict mode */
168     e_FM_MACSEC_UNKNOWN_SCI_FRAME_TREATMENT_DISCARD_UNCONTROLLED_DELIVER_OR_DISCARD_CONTROLLED,             /**< If C bit clear deliver on controlled port, else discard
169                                                                                                                  Controlled port - Check or Disable mode */
170     e_FM_MACSEC_UNKNOWN_SCI_FRAME_TREATMENT_DELIVER_UNCONTROLLED_DISCARD_CONTROLLED,                        /**< Controlled port - Strict mode */
171     e_FM_MACSEC_UNKNOWN_SCI_FRAME_TREATMENT_DELIVER_OR_DISCARD_UNCONTROLLED_DELIVER_OR_DISCARD_CONTROLLED   /**< If C bit set deliver on uncontrolled port and discard on controlled port,
172                                                                                                                  else discard on uncontrolled port and deliver on controlled port
173                                                                                                                  Controlled port - Check or Disable mode */
174 } e_FmMacsecUnknownSciFrameTreatment;
175 
176 /**************************************************************************//**
177  @Description   enum for untag frame treatment
178 *//***************************************************************************/
179 typedef enum e_FmMacsecUntagFrameTreatment {
180     e_FM_MACSEC_UNTAG_FRAME_TREATMENT_DELIVER_UNCONTROLLED_DISCARD_CONTROLLED = 0,                    /**< Controlled port - Strict mode */
181     e_FM_MACSEC_UNTAG_FRAME_TREATMENT_DISCARD_BOTH,                                                   /**< Controlled port - Strict mode */
182     e_FM_MACSEC_UNTAG_FRAME_TREATMENT_DISCARD_UNCONTROLLED_DELIVER_CONTROLLED_UNMODIFIED              /**< Controlled port - Strict mode */
183 } e_FmMacsecUntagFrameTreatment;
184 
185 /**************************************************************************//**
186  @Function      FM_MACSEC_ConfigUnknownSciFrameTreatment
187 
188  @Description   Change the treatment for received frames with unknown sci from its default
189                 configuration [DEFAULT_unknownSciFrameTreatment].
190 
191  @Param[in]     h_FmMacsec      FM MACSEC module descriptor.
192  @Param[in]     treatMode       The selected mode.
193 
194  @Return        E_OK on success; Error code otherwise.
195 
196  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
197 *//***************************************************************************/
198 t_Error FM_MACSEC_ConfigUnknownSciFrameTreatment(t_Handle h_FmMacsec, e_FmMacsecUnknownSciFrameTreatment treatMode);
199 
200 /**************************************************************************//**
201  @Function      FM_MACSEC_ConfigInvalidTagsFrameTreatment
202 
203  @Description   Change the treatment for received frames with invalid tags or
204                 a zero value PN or an invalid ICV from its default configuration
205                 [DEFAULT_invalidTagsFrameTreatment].
206 
207  @Param[in]     h_FmMacsec              FM MACSEC module descriptor.
208  @Param[in]     deliverUncontrolled     If True deliver on the uncontrolled port, else discard;
209                                         In both cases discard on the controlled port;
210                                         this provide Strict, Check or Disable mode.
211 
212  @Return        E_OK on success; Error code otherwise.
213 
214  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
215 *//***************************************************************************/
216 t_Error FM_MACSEC_ConfigInvalidTagsFrameTreatment(t_Handle h_FmMacsec, bool deliverUncontrolled);
217 
218 /**************************************************************************//**
219  @Function      FM_MACSEC_ConfigEncryptWithNoChangedTextFrameTreatment
220 
221  @Description   Change the treatment for received frames with the Encryption bit
222                 set and the Changed Text bit clear from its default configuration
223                 [DEFAULT_encryptWithNoChangedTextFrameTreatment].
224 
225  @Param[in]     h_FmMacsec              FM MACSEC module descriptor.
226  @Param[in]     discardUncontrolled     If True discard on the uncontrolled port, else deliver;
227                                         In both cases discard on the controlled port;
228                                         this provide Strict, Check or Disable mode.
229 
230  @Return        E_OK on success; Error code otherwise.
231 
232  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
233 *//***************************************************************************/
234 t_Error FM_MACSEC_ConfigEncryptWithNoChangedTextFrameTreatment(t_Handle h_FmMacsec, bool discardUncontrolled);
235 
236 /**************************************************************************//**
237  @Function      FM_MACSEC_ConfigChangedTextWithNoEncryptFrameTreatment
238 
239  @Description   Change the treatment for received frames with the Encryption bit
240                 clear and the Changed Text bit set from its default configuration
241                 [DEFAULT_changedTextWithNoEncryptFrameTreatment].
242 
243  @Param[in]     h_FmMacsec              FM MACSEC module descriptor.
244  @Param[in]     deliverUncontrolled     If True deliver on the uncontrolled port, else discard;
245                                         In both cases discard on the controlled port;
246                                         this provide Strict, Check or Disable mode.
247 
248  @Return        E_OK on success; Error code otherwise.
249 
250  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
251 *//***************************************************************************/
252 t_Error FM_MACSEC_ConfigChangedTextWithNoEncryptFrameTreatment(t_Handle h_FmMacsec, bool deliverUncontrolled);
253 
254 /**************************************************************************//**
255  @Function      FM_MACSEC_ConfigUntagFrameTreatment
256 
257  @Description   Change the treatment for received frames without the MAC security tag (SecTAG)
258                 from its default configuration [DEFAULT_untagFrameTreatment].
259 
260  @Param[in]     h_FmMacsec     FM MACSEC module descriptor.
261  @Param[in]     treatMode      The selected mode.
262 
263  @Return        E_OK on success; Error code otherwise.
264 
265  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
266 *//***************************************************************************/
267 t_Error FM_MACSEC_ConfigUntagFrameTreatment(t_Handle h_FmMacsec, e_FmMacsecUntagFrameTreatment treatMode);
268 
269 /**************************************************************************//**
270  @Function      FM_MACSEC_ConfigOnlyScbIsSetFrameTreatment
271 
272  @Description   Change the treatment for received frames with only SCB bit set
273                 from its default configuration [DEFAULT_onlyScbIsSetFrameTreatment].
274 
275  @Param[in]     h_FmMacsec              FM MACSEC module descriptor.
276  @Param[in]     deliverUncontrolled     If True deliver on the uncontrolled port, else discard;
277                                         In both cases discard on the controlled port;
278                                         this provide Strict, Check or Disable mode.
279 
280  @Return        E_OK on success; Error code otherwise.
281 
282  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
283 *//***************************************************************************/
284 t_Error FM_MACSEC_ConfigOnlyScbIsSetFrameTreatment(t_Handle h_FmMacsec, bool deliverUncontrolled);
285 
286 /**************************************************************************//**
287  @Function      FM_MACSEC_ConfigPnExhaustionThreshold
288 
289  @Description   It's provide the ability to configure a PN exhaustion threshold;
290                 When the NextPn crosses this value an interrupt event
291                 is asserted to warn that the active SA should re-key.
292 
293  @Param[in]     h_FmMacsec     FM MACSEC module descriptor.
294  @Param[in]     pnExhThr       If the threshold is reached, an interrupt event
295                                is asserted to re-key.
296 
297  @Return        E_OK on success; Error code otherwise.
298 
299  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
300 *//***************************************************************************/
301 t_Error FM_MACSEC_ConfigPnExhaustionThreshold(t_Handle h_FmMacsec, uint32_t pnExhThr);
302 
303 /**************************************************************************//**
304  @Function      FM_MACSEC_ConfigKeysUnreadable
305 
306  @Description   Turn on privacy mode; All the keys and their hash values can't be read any more;
307                 Can not be cleared unless hard reset.
308 
309  @Param[in]     h_FmMacsec         FM MACSEC module descriptor.
310 
311  @Return        E_OK on success; Error code otherwise.
312 
313  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
314 *//***************************************************************************/
315 t_Error FM_MACSEC_ConfigKeysUnreadable(t_Handle h_FmMacsec);
316 
317 /**************************************************************************//**
318  @Function      FM_MACSEC_ConfigSectagWithoutSCI
319 
320  @Description   Promise that all generated Sectag will be without SCI included.
321 
322  @Param[in]     h_FmMacsec         FM MACSEC module descriptor.
323 
324  @Return        E_OK on success; Error code otherwise.
325 
326  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
327 *//***************************************************************************/
328 t_Error FM_MACSEC_ConfigSectagWithoutSCI(t_Handle h_FmMacsec);
329 
330 /**************************************************************************//**
331  @Function      FM_MACSEC_ConfigException
332 
333  @Description   Calling this routine changes the internal driver data base
334                 from its default selection of exceptions enablement;
335                 By default all exceptions are enabled.
336 
337  @Param[in]     h_FmMacsec      FM MACSEC module descriptor.
338  @Param[in]     exception       The exception to be selected.
339  @Param[in]     enable          TRUE to enable interrupt, FALSE to mask it.
340 
341  @Return        E_OK on success; Error code otherwise.
342 
343  @Cautions      Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
344 *//***************************************************************************/
345 t_Error FM_MACSEC_ConfigException(t_Handle h_FmMacsec, e_FmMacsecExceptions exception, bool enable);
346 
347 /** @} */ /* end of FM_MACSEC_advanced_init_grp group */
348 /** @} */ /* end of FM_MACSEC_init_grp group */
349 
350 
351 /**************************************************************************//**
352  @Group         FM_MACSEC_runtime_control_grp FM-MACSEC Runtime Control Data Unit
353 
354  @Description   FM MACSEC runtime control data unit API functions, definitions and enums.
355 
356  @{
357 *//***************************************************************************/
358 
359 /**************************************************************************//**
360  @Function      FM_MACSEC_GetRevision
361 
362  @Description   Return MACSEC HW chip revision
363 
364  @Param[in]     h_FmMacsec         FM MACSEC module descriptor.
365  @Param[out]    p_MacsecRevision   MACSEC revision as defined by the chip.
366 
367  @Return        E_OK on success; Error code otherwise.
368 
369  @Cautions      Allowed only after FM_MACSEC_Init().
370 *//***************************************************************************/
371 t_Error FM_MACSEC_GetRevision(t_Handle h_FmMacsec, uint32_t *p_MacsecRevision);
372 
373 /**************************************************************************//**
374  @Function      FM_MACSEC_Enable
375 
376  @Description   This routine should be called after MACSEC is initialized for enabling all
377                 MACSEC engines according to their existing configuration.
378 
379  @Param[in]     h_FmMacsec         FM MACSEC module descriptor.
380 
381  @Return        E_OK on success; Error code otherwise.
382 
383  @Cautions      Allowed only following FM_MACSEC_Init() and when MACSEC is disabled.
384 *//***************************************************************************/
385 t_Error FM_MACSEC_Enable(t_Handle h_FmMacsec);
386 
387 /**************************************************************************//**
388  @Function      FM_MACSEC_Disable
389 
390  @Description   This routine may be called when MACSEC is enabled in order to
391                 disable all MACSEC engines; The MACSEC is working in bypass mode.
392 
393  @Param[in]     h_FmMacsec         FM MACSEC module descriptor.
394 
395  @Return        E_OK on success; Error code otherwise.
396 
397  @Cautions      Allowed only following FM_MACSEC_Init() and when MACSEC is enabled.
398 *//***************************************************************************/
399 t_Error FM_MACSEC_Disable(t_Handle h_FmMacsec);
400 
401 /**************************************************************************//**
402  @Function      FM_MACSEC_SetException
403 
404  @Description   Calling this routine enables/disables the specified exception.
405 
406  @Param[in]     h_FmMacsec      FM MACSEC module descriptor.
407  @Param[in]     exception       The exception to be selected.
408  @Param[in]     enable          TRUE to enable interrupt, FALSE to mask it.
409 
410  @Return        E_OK on success; Error code otherwise.
411 
412  @Cautions      Allowed only following FM_MACSEC_Init().
413 *//***************************************************************************/
414 t_Error FM_MACSEC_SetException(t_Handle h_FmMacsec, e_FmMacsecExceptions exception, bool enable);
415 
416 #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
417 /**************************************************************************//**
418  @Function      FM_MACSEC_DumpRegs
419 
420  @Description   Dump internal registers.
421 
422  @Param[in]     h_FmMacsec  - FM MACSEC module descriptor.
423 
424  @Return        E_OK on success; Error code otherwise.
425 
426  @Cautions      Allowed only after FM_MACSEC_Init().
427 *//***************************************************************************/
428 t_Error FM_MACSEC_DumpRegs(t_Handle h_FmMacsec);
429 #endif /* (defined(DEBUG_ERRORS) && ... */
430 
431 #ifdef VERIFICATION_SUPPORT
432 /********************* VERIFICATION ONLY ********************************/
433 /**************************************************************************//**
434  @Function      FM_MACSEC_BackdoorSet
435 
436  @Description   Set register of the MACSEC memory map
437 
438  @Param[in]     h_FmMacsec          FM MACSEC module descriptor.
439  @Param[out]    offset              Register offset.
440  @Param[out]    value               Value to write.
441 
442 
443  @Return        None
444 
445  @Cautions      Allowed only following FM_MACSEC_Init().
446 *//***************************************************************************/
447 t_Error FM_MACSEC_BackdoorSet(t_Handle h_FmMacsec, uint32_t offset, uint32_t value);
448 
449 /**************************************************************************//**
450  @Function      FM_MACSEC_BackdoorGet
451 
452  @Description   Read from register of the MACSEC memory map.
453 
454  @Param[in]     h_FmMacsec          FM MACSEC module descriptor.
455  @Param[out]    offset              Register offset.
456 
457  @Return        Value read
458 
459  @Cautions      Allowed only following FM_MACSEC_Init().
460 *//***************************************************************************/
461 uint32_t FM_MACSEC_BackdoorGet(t_Handle h_FmMacsec, uint32_t offset);
462 #endif /* VERIFICATION_SUPPORT */
463 
464 /** @} */ /* end of FM_MACSEC_runtime_control_grp group */
465 
466 
467 /**************************************************************************//**
468  @Group         FM_MACSEC_SECY_grp FM-MACSEC SecY
469 
470  @Description   FM-MACSEC SecY API functions, definitions and enums
471 
472  @{
473 *//***************************************************************************/
474 
475 typedef uint8_t     macsecSAKey_t[32];
476 typedef uint64_t    macsecSCI_t;
477 typedef uint8_t     macsecAN_t;
478 
479 /**************************************************************************//**
480 @Description   MACSEC SECY Cipher Suite
481 *//***************************************************************************/
482 typedef enum e_FmMacsecSecYCipherSuite {
483     e_FM_MACSEC_SECY_GCM_AES_128 = 0,       /**< GCM-AES-128 */
484 #if (DPAA_VERSION >= 11)
485     e_FM_MACSEC_SECY_GCM_AES_256            /**< GCM-AES-256 */
486 #endif /* (DPAA_VERSION >= 11) */
487 } e_FmMacsecSecYCipherSuite;
488 
489 /**************************************************************************//**
490  @Description   MACSEC SECY Exceptions
491 *//***************************************************************************/
492 typedef enum e_FmMacsecSecYExceptions {
493     e_FM_MACSEC_SECY_EX_FRAME_DISCARDED     /**< Frame  Discarded */
494 } e_FmMacsecSecYExceptions;
495 
496 /**************************************************************************//**
497  @Description   MACSEC SECY Events
498 *//***************************************************************************/
499 typedef enum e_FmMacsecSecYEvents {
500     e_FM_MACSEC_SECY_EV_NEXT_PN             /**< Next Packet Number exhaustion threshold reached */
501 } e_FmMacsecSecYEvents;
502 
503 /**************************************************************************//**
504  @Collection   MACSEC SECY Frame Discarded Descriptor error
505 *//***************************************************************************/
506 typedef uint8_t    macsecTxScFrameDiscardedErrSelect_t; /**< typedef for defining Frame Discarded Descriptor errors */
507 
508 #define FM_MACSEC_SECY_TX_SC_FRM_DISCAR_ERR_NEXT_PN_ZERO              0x8000  /**< NextPn == 0 */
509 #define FM_MACSEC_SECY_TX_SC_FRM_DISCAR_ERR_SC_DISBALE                0x4000  /**< SC is disable */
510 /* @} */
511 
512 /**************************************************************************//**
513  @Function      t_FmMacsecSecYExceptionsCallback
514 
515  @Description   Exceptions user callback routine, will be called upon an
516                 exception passing the exception identification.
517 
518  @Param[in]     h_App       A handle to an application layer object; This handle
519                             will be passed by the driver upon calling this callback.
520  @Param[in]     exception   The exception.
521 *//***************************************************************************/
522 typedef void (t_FmMacsecSecYExceptionsCallback) ( t_Handle                  h_App,
523                                                   e_FmMacsecSecYExceptions  exception);
524 
525 /**************************************************************************//**
526  @Function      t_FmMacsecSecYEventsCallback
527 
528  @Description   Events user callback routine, will be called upon an
529                 event passing the event identification.
530 
531  @Param[in]     h_App       A handle to an application layer object; This handle
532                             will be passed by the driver upon calling this callback.
533  @Param[in]     event       The event.
534 *//***************************************************************************/
535 typedef void (t_FmMacsecSecYEventsCallback) ( t_Handle                  h_App,
536                                               e_FmMacsecSecYEvents      event);
537 
538 /**************************************************************************//**
539  @Description   RFC2863 MIB
540 *//***************************************************************************/
541 typedef struct t_MIBStatistics {
542     uint64_t  ifInOctets;              /**< Total number of byte received */
543     uint64_t  ifInPkts;                /**< Total number of packets received */
544     uint64_t  ifInMcastPkts;           /**< Total number of multicast frame received */
545     uint64_t  ifInBcastPkts;           /**< Total number of broadcast frame received */
546     uint64_t  ifInDiscards;            /**< Frames received, but discarded due to problems within the MAC RX :
547                                                - InPktsNoTag,
548                                                - InPktsLate,
549                                                - InPktsOverrun */
550     uint64_t  ifInErrors;              /**< Number of frames received with error:
551                                                - InPktsBadTag,
552                                                - InPktsNoSCI,
553                                                - InPktsNotUsingSA
554                                                - InPktsNotValid */
555     uint64_t  ifOutOctets;             /**< Total number of byte sent */
556     uint64_t  ifOutPkts;               /**< Total number of packets sent */
557     uint64_t  ifOutMcastPkts;          /**< Total number of multicast frame sent */
558     uint64_t  ifOutBcastPkts;          /**< Total number of multicast frame sent */
559     uint64_t  ifOutDiscards;           /**< Frames received, but discarded due to problems within the MAC TX N/A! */
560     uint64_t  ifOutErrors;             /**< Number of frames transmitted with error:
561                                                - FIFO Overflow Error
562                                                - FIFO Underflow Error
563                                                - Other */
564 } t_MIBStatistics;
565 
566 /**************************************************************************//**
567  @Description   MACSEC SecY Rx SA Statistics
568 *//***************************************************************************/
569 typedef struct t_FmMacsecSecYRxSaStatistics {
570     uint32_t            inPktsOK;               /**< The number of frames with resolved SCI, have passed all
571                                                      frame validation frame validation with the validateFrame not set to disable */
572     uint32_t            inPktsInvalid;          /**< The number of frames with resolved SCI, that have failed frame
573                                                      validation with the validateFrame set to check */
574     uint32_t            inPktsNotValid;         /**< The number of frames with resolved SCI, discarded on the controlled port,
575                                                      that have failed frame validation with the validateFrame set to strict or the c bit is set */
576     uint32_t            inPktsNotUsingSA;       /**< The number of frames received with resolved SCI and discarded on disabled or
577                                                      not provisioned SA with validateFrame in the strict mode or the C bit is set */
578     uint32_t            inPktsUnusedSA;         /**< The number of frames received with resolved SCI on disabled or not provisioned SA
579                                                      with validateFrame not in the strict mode and the C bit is cleared */
580 } t_FmMacsecSecYRxSaStatistics;
581 
582 /**************************************************************************//**
583  @Description   MACSEC SecY Tx SA Statistics
584 *//***************************************************************************/
585 typedef struct t_FmMacsecSecYTxSaStatistics {
586     uint64_t            outPktsProtected;       /**< The number of frames, that the user of the controlled port requested to
587                                                      be transmitted, which were integrity protected */
588     uint64_t            outPktsEncrypted;       /**< The number of frames, that the user of the controlled port requested to
589                                                      be transmitted, which were confidentiality protected */
590 } t_FmMacsecSecYTxSaStatistics;
591 
592 /**************************************************************************//**
593  @Description   MACSEC SecY Rx SC Statistics
594 *//***************************************************************************/
595 typedef struct t_FmMacsecSecYRxScStatistics {
596     uint64_t            inPktsUnchecked;        /**< The number of frames with resolved SCI, delivered to the user of a controlled port,
597                                                      that are not validated with the validateFrame set to disable */
598     uint64_t            inPktsDelayed;          /**< The number of frames with resolved SCI, delivered to the user of a controlled port,
599                                                      that have their PN smaller than the lowest_PN with the validateFrame set to
600                                                      disable or replayProtect disabled */
601     uint64_t            inPktsLate;             /**< The number of frames with resolved SCI, discarded on the controlled port,
602                                                      that have their PN smaller than the lowest_PN with the validateFrame set to
603                                                      Check or Strict and replayProtect enabled */
604     uint64_t            inPktsOK;               /**< The number of frames with resolved SCI, have passed all
605                                                      frame validation frame validation with the validateFrame not set to disable */
606     uint64_t            inPktsInvalid;          /**< The number of frames with resolved SCI, that have failed frame
607                                                      validation with the validateFrame set to check */
608     uint64_t            inPktsNotValid;         /**< The number of frames with resolved SCI, discarded on the controlled port,
609                                                      that have failed frame validation with the validateFrame set to strict or the c bit is set */
610     uint64_t            inPktsNotUsingSA;       /**< The number of frames received with resolved SCI and discarded on disabled or
611                                                      not provisioned SA with validateFrame in the strict mode or the C bit is set */
612     uint64_t            inPktsUnusedSA;         /**< The number of frames received with resolved SCI on disabled or not provisioned SA
613                                                      with validateFrame not in the strict mode and the C bit is cleared */
614 } t_FmMacsecSecYRxScStatistics;
615 
616 /**************************************************************************//**
617  @Description   MACSEC SecY Tx SC Statistics
618 *//***************************************************************************/
619 typedef struct t_FmMacsecSecYTxScStatistics {
620     uint64_t            outPktsProtected;       /**< The number of frames, that the user of the controlled port requested to
621                                                      be transmitted, which were integrity protected */
622     uint64_t            outPktsEncrypted;       /**< The number of frames, that the user of the controlled port requested to
623                                                      be transmitted, which were confidentiality protected */
624 } t_FmMacsecSecYTxScStatistics;
625 
626 /**************************************************************************//**
627  @Description   MACSEC SecY Statistics
628 *//***************************************************************************/
629 typedef struct t_FmMacsecSecYStatistics {
630     t_MIBStatistics     mibCtrlStatistics;      /**< Controlled port MIB statistics */
631     t_MIBStatistics     mibNonCtrlStatistics;   /**< Uncontrolled port MIB statistics */
632 /* Frame verification statistics */
633     uint64_t            inPktsUntagged;         /**< The number of received packets without the MAC security tag
634                                                      (SecTAG) with validateFrames which is not in the strict mode */
635     uint64_t            inPktsNoTag;            /**< The number of received packets discarded without the
636                                                      MAC security tag (SecTAG) with validateFrames which is in the strict mode */
637     uint64_t            inPktsBadTag;           /**< The number of received packets discarded with an invalid
638                                                      SecTAG or a zero value PN or an invalid ICV */
639     uint64_t            inPktsUnknownSCI;       /**< The number of received packets with unknown SCI with the
640                                                      condition : validateFrames is not in the strict mode and the
641                                                      C bit in the SecTAG is not set */
642     uint64_t            inPktsNoSCI;            /**< The number of received packets discarded with unknown SCI
643                                                      information with the condition : validateFrames is in the strict mode
644                                                      or the C bit in the SecTAG is set */
645     uint64_t            inPktsOverrun;          /**< The number of packets discarded because the number of
646                                                      received packets exceeded the cryptographic performance capabilities */
647 /* Frame validation statistics */
648     uint64_t            inOctetsValidated;      /**< The number of octets of plaintext recovered from received frames with
649                                                      resolved SCI that were integrity protected but not encrypted */
650     uint64_t            inOctetsDecrypted;      /**< The number of octets of plaintext recovered from received frames with
651                                                      resolved SCI that were integrity protected and encrypted */
652 /* Frame generation statistics */
653     uint64_t            outPktsUntagged;        /**< The number of frames, that the user of the controlled port requested to
654                                                      be transmitted, with protectFrame false */
655     uint64_t            outPktsTooLong;         /**< The number of frames, that the user of the controlled port requested to
656                                                      be transmitted, discarded due to length being larger than Maximum Frame Length (MACSEC_MFL) */
657 /* Frame protection statistics */
658     uint64_t            outOctetsProtected;     /**< The number of octets of User Data in transmitted frames that were
659                                                      integrity protected but not encrypted */
660     uint64_t            outOctetsEncrypted;     /**< The number of octets of User Data in transmitted frames that were
661                                                      both integrity protected and encrypted */
662 } t_FmMacsecSecYStatistics;
663 
664 
665 /**************************************************************************//**
666  @Description   MACSEC SecY SC Params
667 *//***************************************************************************/
668 typedef struct t_FmMacsecSecYSCParams {
669     macsecSCI_t                 sci;            /**< The secure channel identification of the SC */
670     e_FmMacsecSecYCipherSuite   cipherSuite;    /**< Cipher suite to be used for the SC */
671 } t_FmMacsecSecYSCParams;
672 
673 /**************************************************************************//**
674  @Group         FM_MACSEC_SECY_init_grp FM-MACSEC SecY Initialization Unit
675 
676  @Description   FM-MACSEC SecY Initialization Unit
677 
678  @{
679 *//***************************************************************************/
680 
681 /**************************************************************************//**
682  @Description   enum for validate frames
683 *//***************************************************************************/
684 typedef enum e_FmMacsecValidFrameBehavior {
685     e_FM_MACSEC_VALID_FRAME_BEHAVIOR_DISABLE = 0,   /**< disable the validation function */
686     e_FM_MACSEC_VALID_FRAME_BEHAVIOR_CHECK,         /**< enable the validation function but only for checking
687                                                          without filtering out invalid frames */
688     e_FM_MACSEC_VALID_FRAME_BEHAVIOR_STRICT         /**< enable the validation function and also strictly filter
689                                                          out those invalid frames */
690 } e_FmMacsecValidFrameBehavior;
691 
692 /**************************************************************************//**
693  @Description   enum for sci insertion
694 *//***************************************************************************/
695 typedef enum e_FmMacsecSciInsertionMode {
696     e_FM_MACSEC_SCI_INSERTION_MODE_EXPLICIT_SECTAG = 0, /**< explicit sci in the sectag */
697     e_FM_MACSEC_SCI_INSERTION_MODE_EXPLICIT_MAC_SA,     /**< mac sa is overwritten with the sci*/
698     e_FM_MACSEC_SCI_INSERTION_MODE_IMPLICT_PTP          /**< implicit point-to-point sci (pre-shared) */
699 } e_FmMacsecSciInsertionMode;
700 
701 /**************************************************************************//**
702  @Description   FM MACSEC SecY config input
703 *//***************************************************************************/
704 typedef struct t_FmMacsecSecYParams {
705     t_Handle                                    h_FmMacsec;             /**< A handle to the FM MACSEC object */
706     t_FmMacsecSecYSCParams                      txScParams;             /**< Tx SC Params */
707     uint32_t                                    numReceiveChannels;     /**< Number of receive channels dedicated to this SecY */
708     t_FmMacsecSecYExceptionsCallback            *f_Exception;           /**< Callback routine to be called by the driver upon SecY exception */
709     t_FmMacsecSecYEventsCallback                *f_Event;               /**< Callback routine to be called by the driver upon SecY event */
710     t_Handle                                    h_App;                  /**< A handle to an application layer object; This handle will
711                                                                              be passed by the driver upon calling the above callbacks */
712 } t_FmMacsecSecYParams;
713 
714 /**************************************************************************//**
715  @Function      FM_MACSEC_SECY_Config
716 
717  @Description   Creates descriptor for the FM MACSEC SECY module;
718 
719                 The routine returns a handle (descriptor) to the FM MACSEC SECY object;
720                 This descriptor must be passed as first parameter to all other
721                 FM MACSEC SECY function calls;
722                 No actual initialization or configuration of FM MACSEC SecY hardware is
723                 done by this routine.
724 
725  @Param[in]     p_FmMacsecSecYParam     Pointer to data structure of parameters.
726 
727  @Return        Handle to FM MACSEC SECY object, or NULL for Failure.
728 *//***************************************************************************/
729 t_Handle FM_MACSEC_SECY_Config(t_FmMacsecSecYParams *p_FmMacsecSecYParam);
730 
731 /**************************************************************************//**
732  @Function      FM_MACSEC_SECY_Init
733 
734  @Description   Initializes the FM MACSEC SECY module.
735 
736  @Param[in]     h_FmMacsecSecY  FM MACSEC SECY module descriptor.
737 
738  @Return        E_OK on success; Error code otherwise.
739 *//***************************************************************************/
740 t_Error FM_MACSEC_SECY_Init(t_Handle h_FmMacsecSecY);
741 
742 /**************************************************************************//**
743  @Function      FM_MACSEC_SECY_Free
744 
745  @Description   Frees all resources that were assigned to FM MACSEC SECY module.
746 
747                 Calling this routine invalidates the descriptor.
748 
749  @Param[in]     h_FmMacsecSecY  FM MACSEC SECY module descriptor.
750 
751  @Return        E_OK on success; Error code otherwise.
752 *//***************************************************************************/
753 t_Error FM_MACSEC_SECY_Free(t_Handle h_FmMacsecSecY);
754 
755 /**************************************************************************//**
756  @Group         FM_MACSEC_SECY_advanced_init_grp  FM-MACSEC SecY Advanced Configuration Unit
757 
758  @Description   Configuration functions used to change default values.
759 
760  @{
761 *//***************************************************************************/
762 
763 /**************************************************************************//**
764  @Function      FM_MACSEC_SECY_ConfigSciInsertionMode
765 
766  @Description   Calling this routine changes the SCI-insertion-mode in the
767                 internal driver data base from its default configuration
768                 [DEFAULT_sciInsertionMode]
769 
770  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
771  @Param[in]     sciInsertionMode    Sci insertion mode
772 
773  @Return        E_OK on success; Error code otherwise.
774 
775  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
776 
777 *//***************************************************************************/
778 t_Error FM_MACSEC_SECY_ConfigSciInsertionMode(t_Handle h_FmMacsecSecY, e_FmMacsecSciInsertionMode sciInsertionMode);
779 
780 /**************************************************************************//**
781  @Function      FM_MACSEC_SECY_ConfigProtectFrames
782 
783  @Description   Calling this routine changes the protect-frame mode in the
784                 internal driver data base from its default configuration
785                 [DEFAULT_protectFrames]
786 
787  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
788  @Param[in]     protectFrames       If FALSE, frames are transmitted without modification
789 
790  @Return        E_OK on success; Error code otherwise.
791 
792  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
793 
794 *//***************************************************************************/
795 t_Error FM_MACSEC_SECY_ConfigProtectFrames(t_Handle h_FmMacsecSecY, bool protectFrames);
796 
797 /**************************************************************************//**
798  @Function      FM_MACSEC_SECY_ConfigReplayWindow
799 
800  @Description   Calling this routine changes the replay-window settings in the
801                 internal driver data base from its default configuration
802                 [DEFAULT_replayEnable], [DEFAULT_replayWindow]
803 
804  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
805  @Param[in]     replayProtect;      Replay protection function mode
806  @Param[in]     replayWindow;       The size of the replay window
807 
808  @Return        E_OK on success; Error code otherwise.
809 
810  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
811 
812 *//***************************************************************************/
813 t_Error FM_MACSEC_SECY_ConfigReplayWindow(t_Handle h_FmMacsecSecY, bool replayProtect, uint32_t replayWindow);
814 
815 /**************************************************************************//**
816  @Function      FM_MACSEC_SECY_ConfigValidationMode
817 
818  @Description   Calling this routine changes the frame-validation-behavior mode
819                 in the internal driver data base from its default configuration
820                 [DEFAULT_validateFrames]
821 
822  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
823  @Param[in]     validateFrames      Validation function mode
824 
825  @Return        E_OK on success; Error code otherwise.
826 
827  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
828 
829 *//***************************************************************************/
830 t_Error FM_MACSEC_SECY_ConfigValidationMode(t_Handle h_FmMacsecSecY, e_FmMacsecValidFrameBehavior validateFrames);
831 
832 /**************************************************************************//**
833  @Function      FM_MACSEC_SECY_ConfigConfidentiality
834 
835  @Description   Calling this routine changes the confidentiality settings in the
836                 internal driver data base from its default configuration
837                 [DEFAULT_confidentialityEnable], [DEFAULT_confidentialityOffset]
838 
839  @Param[in]     h_FmMacsecSecY          FM MACSEC SECY module descriptor.
840  @Param[in]     confidentialityEnable   TRUE  - confidentiality protection and integrity protection
841                                         FALSE - no confidentiality protection, only integrity protection
842  @Param[in]     confidentialityOffset   The number of initial octets of each MSDU without confidentiality protection
843                                         common values are 0, 30, and 50
844 
845  @Return        E_OK on success; Error code otherwise.
846 
847  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
848 
849 *//***************************************************************************/
850 t_Error FM_MACSEC_SECY_ConfigConfidentiality(t_Handle h_FmMacsecSecY, bool confidentialityEnable, uint16_t confidentialityOffset);
851 
852 /**************************************************************************//**
853  @Function      FM_MACSEC_SECY_ConfigPointToPoint
854 
855  @Description   configure this SecY to work in point-to-point mode, means that
856                 it will have only one rx sc;
857 
858  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
859 
860  @Return        E_OK on success; Error code otherwise.
861 
862  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
863                 Can be called only once in a system; only the first secY that will call this
864                 routine will be able to operate in Point-To-Point mode.
865 *//***************************************************************************/
866 t_Error FM_MACSEC_SECY_ConfigPointToPoint(t_Handle h_FmMacsecSecY);
867 
868 /**************************************************************************//**
869  @Function      FM_MACSEC_SECY_ConfigException
870 
871  @Description   Calling this routine changes the internal driver data base
872                 from its default selection of exceptions enablement;
873                 By default all exceptions are enabled.
874 
875  @Param[in]     h_FmMacsecSecY  FM MACSEC SECY module descriptor.
876  @Param[in]     exception       The exception to be selected.
877  @Param[in]     enable          TRUE to enable interrupt, FALSE to mask it.
878 
879  @Return        E_OK on success; Error code otherwise.
880 
881  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init().
882 *//***************************************************************************/
883 t_Error FM_MACSEC_SECY_ConfigException(t_Handle h_FmMacsecSecY, e_FmMacsecSecYExceptions exception, bool enable);
884 
885 /**************************************************************************//**
886  @Function      FM_MACSEC_SECY_ConfigEvent
887 
888  @Description   Calling this routine changes the internal driver data base
889                 from its default selection of events enablement;
890                 By default all events are enabled.
891 
892  @Param[in]     h_FmMacsecSecY  FM MACSEC SECY module descriptor.
893  @Param[in]     event           The event to be selected.
894  @Param[in]     enable          TRUE to enable interrupt, FALSE to mask it.
895 
896  @Return        E_OK on success; Error code otherwise.
897 
898  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init().
899 *//***************************************************************************/
900 t_Error FM_MACSEC_SECY_ConfigEvent(t_Handle h_FmMacsecSecY, e_FmMacsecSecYEvents event, bool enable);
901 
902 /** @} */ /* end of FM_MACSEC_SECY_advanced_init_grp group */
903 /** @} */ /* end of FM_MACSEC_SECY_init_grp group */
904 
905 
906 /**************************************************************************//**
907  @Group         FM_MACSEC_SECY_runtime_control_grp FM-MACSEC SecY Runtime Control Unit
908 
909  @Description   FM MACSEC SECY Runtime control unit API functions, definitions and enums.
910 
911  @{
912 *//***************************************************************************/
913 
914 /**************************************************************************//**
915  @Function      FM_MACSEC_SECY_CreateRxSc
916 
917  @Description   Create a receive secure channel.
918 
919  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
920  @Param[in]     scParams            secure channel params.
921 
922  @Return        E_OK on success; Error code otherwise.
923 
924  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
925 *//***************************************************************************/
926 t_Handle FM_MACSEC_SECY_CreateRxSc(t_Handle h_FmMacsecSecY, t_FmMacsecSecYSCParams *p_ScParams);
927 
928 /**************************************************************************//**
929  @Function      FM_MACSEC_SECY_DeleteRxSc
930 
931  @Description   Deleting an initialized secure channel.
932 
933  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
934  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
935 
936  @Return        E_OK on success; Error code otherwise.
937 
938  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSc().
939 *//***************************************************************************/
940 t_Error FM_MACSEC_SECY_DeleteRxSc(t_Handle h_FmMacsecSecY, t_Handle h_Sc);
941 
942 /**************************************************************************//**
943  @Function      FM_MACSEC_SECY_CreateRxSa
944 
945  @Description   Create a receive secure association for the secure channel;
946                 the SA cannot be used to receive frames until FM_MACSEC_SECY_RxSaEnableReceive is called.
947 
948  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
949  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
950  @Param[in]     an                  association number represent the SA.
951  @Param[in]     lowestPn            the lowest acceptable PN value for a received frame.
952  @Param[in]     key                 the desired key for this SA.
953 
954  @Return        E_OK on success; Error code otherwise.
955 
956  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSc().
957 *//***************************************************************************/
958 t_Error FM_MACSEC_SECY_CreateRxSa(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an, uint32_t lowestPn, macsecSAKey_t key);
959 
960 /**************************************************************************//**
961  @Function      FM_MACSEC_SECY_DeleteRxSa
962 
963  @Description   Deleting an initialized secure association.
964 
965  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
966  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
967  @Param[in]     an                  association number represent the SA.
968 
969  @Return        E_OK on success; Error code otherwise.
970 
971  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
972 *//***************************************************************************/
973 t_Error FM_MACSEC_SECY_DeleteRxSa(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an);
974 
975 /**************************************************************************//**
976  @Function      FM_MACSEC_SECY_RxSaEnableReceive
977 
978  @Description   Enabling the SA to receive frames.
979 
980  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
981  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
982  @Param[in]     an                  association number represent the SA.
983 
984  @Return        E_OK on success; Error code otherwise.
985 
986  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSa().
987 *//***************************************************************************/
988 t_Error FM_MACSEC_SECY_RxSaEnableReceive(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an);
989 
990 /**************************************************************************//**
991  @Function      FM_MACSEC_SECY_RxSaDisableReceive
992 
993  @Description   Disabling the SA from receive frames.
994 
995  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
996  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
997  @Param[in]     an                  association number represent the SA.
998 
999  @Return        E_OK on success; Error code otherwise.
1000 
1001  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSa().
1002 *//***************************************************************************/
1003 t_Error FM_MACSEC_SECY_RxSaDisableReceive(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an);
1004 
1005 /**************************************************************************//**
1006  @Function      FM_MACSEC_SECY_RxSaUpdateNextPn
1007 
1008  @Description   Update the next packet number expected on RX;
1009                 The value of nextPN shall be set to the greater of its existing value and the
1010                 supplied of updtNextPN (802.1AE-2006 10.7.15).
1011 
1012  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1013  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
1014  @Param[in]     an                  association number represent the SA.
1015  @Param[in]     updtNextPN          the next PN value for a received frame.
1016 
1017  @Return        E_OK on success; Error code otherwise.
1018 
1019  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSa().
1020 *//***************************************************************************/
1021 t_Error FM_MACSEC_SECY_RxSaUpdateNextPn(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an, uint32_t updtNextPN);
1022 
1023 /**************************************************************************//**
1024  @Function      FM_MACSEC_SECY_RxSaUpdateLowestPn
1025 
1026  @Description   Update the lowest packet number expected on RX;
1027                 The value of lowestPN shall be set to the greater of its existing value and the
1028                 supplied of updtLowestPN (802.1AE-2006 10.7.15).
1029 
1030  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1031  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
1032  @Param[in]     an                  association number represent the SA.
1033  @Param[in]     updtLowestPN        the lowest PN acceptable value for a received frame.
1034 
1035  @Return        E_OK on success; Error code otherwise.
1036 
1037  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSa().
1038 *//***************************************************************************/
1039 t_Error FM_MACSEC_SECY_RxSaUpdateLowestPn(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an, uint32_t updtLowestPN);
1040 
1041 /**************************************************************************//**
1042  @Function      FM_MACSEC_SECY_RxSaModifyKey
1043 
1044  @Description   Modify the current key of the SA with a new one.
1045 
1046  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1047  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
1048  @Param[in]     an                  association number represent the SA.
1049  @Param[in]     key                 new key to replace the current key.
1050 
1051  @Return        E_OK on success; Error code otherwise.
1052 
1053  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSa().
1054 *//***************************************************************************/
1055 t_Error FM_MACSEC_SECY_RxSaModifyKey(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an, macsecSAKey_t key);
1056 
1057 /**************************************************************************//**
1058  @Function      FM_MACSEC_SECY_CreateTxSa
1059 
1060  @Description   Create a transmit secure association for the secure channel;
1061                 the SA cannot be used to transmit frames until FM_MACSEC_SECY_TxSaSetActivate is called;
1062                 Only one SA can be active at a time.
1063 
1064  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1065  @Param[in]     an                  association number represent the SA.
1066  @Param[in]     key                 the desired key for this SA.
1067 
1068  @Return        E_OK on success; Error code otherwise.
1069 
1070  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1071 *//***************************************************************************/
1072 t_Error FM_MACSEC_SECY_CreateTxSa(t_Handle h_FmMacsecSecY, macsecAN_t an, macsecSAKey_t key);
1073 
1074 /**************************************************************************//**
1075  @Function      FM_MACSEC_SECY_DeleteTxSa
1076 
1077  @Description   Deleting an initialized secure association.
1078 
1079  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1080  @Param[in]     an                  association number represent the SA.
1081 
1082  @Return        E_OK on success; Error code otherwise.
1083 
1084  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1085 *//***************************************************************************/
1086 t_Error FM_MACSEC_SECY_DeleteTxSa(t_Handle h_FmMacsecSecY, macsecAN_t an);
1087 
1088 /**************************************************************************//**
1089  @Function      FM_MACSEC_SECY_TxSaModifyKey
1090 
1091  @Description   Modify the key of the inactive SA with a new one.
1092 
1093  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1094  @Param[in]     nextActiveAn        association number represent the next SA to be activated.
1095  @Param[in]     key                 new key to replace the current key.
1096 
1097  @Return        E_OK on success; Error code otherwise.
1098 
1099  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1100 *//***************************************************************************/
1101 t_Error FM_MACSEC_SECY_TxSaModifyKey(t_Handle h_FmMacsecSecY, macsecAN_t nextActiveAn, macsecSAKey_t key);
1102 
1103 /**************************************************************************//**
1104  @Function      FM_MACSEC_SECY_TxSaSetActive
1105 
1106  @Description   Set this SA to the active SA to be used on TX for SC;
1107                 only one SA can be active at a time.
1108 
1109  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1110  @Param[in]     an                  association number represent the SA.
1111 
1112  @Return        E_OK on success; Error code otherwise.
1113 
1114  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1115 *//***************************************************************************/
1116 t_Error FM_MACSEC_SECY_TxSaSetActive(t_Handle h_FmMacsecSecY, macsecAN_t an);
1117 
1118 /**************************************************************************//**
1119  @Function      FM_MACSEC_SECY_TxSaGetActive
1120 
1121  @Description   Get the active SA that being used for TX.
1122 
1123  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1124  @Param[out]    p_An                the active an.
1125 
1126  @Return        E_OK on success; Error code otherwise.
1127 
1128  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1129 *//***************************************************************************/
1130 t_Error FM_MACSEC_SECY_TxSaGetActive(t_Handle h_FmMacsecSecY, macsecAN_t *p_An);
1131 
1132 /**************************************************************************//**
1133  @Function      FM_MACSEC_SECY_GetStatistics
1134 
1135  @Description   get all statistics counters.
1136 
1137  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1138  @Param[in]     p_Statistics        Structure with statistics.
1139 
1140  @Return        E_OK on success; Error code otherwise.
1141 
1142  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1143 *//***************************************************************************/
1144 t_Error FM_MACSEC_SECY_GetStatistics(t_Handle h_FmMacsecSecY, t_FmMacsecSecYStatistics *p_Statistics);
1145 
1146 /**************************************************************************//**
1147  @Function      FM_MACSEC_SECY_RxScGetStatistics
1148 
1149  @Description   get all statistics counters.
1150 
1151  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1152  @Param[in]     h_Sc                Rx Sc handle.
1153  @Param[in]     p_Statistics        Structure with statistics.
1154 
1155  @Return        E_OK on success; Error code otherwise.
1156 
1157  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1158 *//***************************************************************************/
1159 t_Error FM_MACSEC_SECY_RxScGetStatistics(t_Handle h_FmMacsecSecY, t_Handle h_Sc, t_FmMacsecSecYRxScStatistics *p_Statistics);
1160 
1161 /**************************************************************************//**
1162  @Function      FM_MACSEC_SECY_RxSaGetStatistics
1163 
1164  @Description   get all statistics counters
1165 
1166  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1167  @Param[in]     h_Sc                Rx Sc handle.
1168  @Param[in]     an                  association number represent the SA.
1169  @Param[in]     p_Statistics        Structure with statistics.
1170 
1171  @Return        E_OK on success; Error code otherwise.
1172 
1173  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1174 *//***************************************************************************/
1175 t_Error FM_MACSEC_SECY_RxSaGetStatistics(t_Handle h_FmMacsecSecY, t_Handle h_Sc, macsecAN_t an, t_FmMacsecSecYRxSaStatistics *p_Statistics);
1176 
1177 /**************************************************************************//**
1178  @Function      FM_MACSEC_SECY_TxScGetStatistics
1179 
1180  @Description   get all statistics counters.
1181 
1182  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1183  @Param[in]     p_Statistics        Structure with statistics.
1184 
1185  @Return        E_OK on success; Error code otherwise.
1186 
1187  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1188 *//***************************************************************************/
1189 t_Error FM_MACSEC_SECY_TxScGetStatistics(t_Handle h_FmMacsecSecY, t_FmMacsecSecYTxScStatistics *p_Statistics);
1190 
1191 /**************************************************************************//**
1192  @Function      FM_MACSEC_SECY_TxSaGetStatistics
1193 
1194  @Description   get all statistics counters.
1195 
1196  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1197  @Param[in]     an                  association number represent the SA.
1198  @Param[in]     p_Statistics        Structure with statistics.
1199 
1200  @Return        E_OK on success; Error code otherwise.
1201 
1202  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1203 *//***************************************************************************/
1204 t_Error FM_MACSEC_SECY_TxSaGetStatistics(t_Handle h_FmMacsecSecY, macsecAN_t an, t_FmMacsecSecYTxSaStatistics *p_Statistics);
1205 
1206 /**************************************************************************//**
1207  @Function      FM_MACSEC_SECY_SetException
1208 
1209  @Description   Calling this routine enables/disables the specified exception.
1210 
1211  @Param[in]     h_FmMacsecSecY  FM MACSEC SECY module descriptor.
1212  @Param[in]     exception       The exception to be selected.
1213  @Param[in]     enable          TRUE to enable interrupt, FALSE to mask it.
1214 
1215  @Return        E_OK on success; Error code otherwise.
1216 
1217  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1218 *//***************************************************************************/
1219 t_Error FM_MACSEC_SECY_SetException(t_Handle h_FmMacsecSecY, e_FmMacsecExceptions exception, bool enable);
1220 
1221 /**************************************************************************//**
1222  @Function      FM_MACSEC_SECY_SetEvent
1223 
1224  @Description   Calling this routine enables/disables the specified event.
1225 
1226  @Param[in]     h_FmMacsecSecY  FM MACSEC SECY module descriptor.
1227  @Param[in]     event           The event to be selected.
1228  @Param[in]     enable          TRUE to enable interrupt, FALSE to mask it.
1229 
1230  @Return        E_OK on success; Error code otherwise.
1231 
1232  @Cautions      Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init().
1233 *//***************************************************************************/
1234 t_Error FM_MACSEC_SECY_SetEvent(t_Handle h_FmMacsecSecY, e_FmMacsecSecYEvents event, bool enable);
1235 
1236 /**************************************************************************//**
1237  @Function      FM_MACSEC_SECY_GetRxScPhysId
1238 
1239  @Description   return the physical id of the Secure Channel.
1240 
1241  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1242  @Param[in]     h_Sc                SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
1243  @Param[out]    p_ScPhysId          the SC physical id.
1244 
1245  @Return        E_OK on success; Error code otherwise.
1246 
1247  @Cautions      Allowed only following FM_MACSEC_SECY_CreateRxSc().
1248 *//***************************************************************************/
1249 t_Error FM_MACSEC_SECY_GetRxScPhysId(t_Handle h_FmMacsecSecY, t_Handle h_Sc, uint32_t *p_ScPhysId);
1250 
1251 /**************************************************************************//**
1252  @Function      FM_MACSEC_SECY_GetTxScPhysId
1253 
1254  @Description   return the physical id of the Secure Channel.
1255 
1256  @Param[in]     h_FmMacsecSecY      FM MACSEC SECY module descriptor.
1257  @Param[out]    p_ScPhysId          the SC physical id.
1258 
1259  @Return        E_OK on success; Error code otherwise.
1260 
1261  @Cautions      Allowed only following FM_MACSEC_SECY_Init().
1262 *//***************************************************************************/
1263 t_Error FM_MACSEC_SECY_GetTxScPhysId(t_Handle h_FmMacsecSecY, uint32_t *p_ScPhysId);
1264 
1265 /** @} */ /* end of FM_MACSEC_SECY_runtime_control_grp group */
1266 /** @} */ /* end of FM_MACSEC_SECY_grp group */
1267 /** @} */ /* end of FM_MACSEC_grp group */
1268 /** @} */ /* end of FM_grp group */
1269 
1270 
1271 #endif /* __FM_MACSEC_EXT_H */
1272