2 * Copyright 2008-2015 Freescale Semiconductor Inc.
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.
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
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.
33 /**************************************************************************//**
36 @Description FM MACSEC ...
37 *//***************************************************************************/
38 #ifndef __FM_MACSEC_EXT_H
39 #define __FM_MACSEC_EXT_H
44 /**************************************************************************//**
45 @Group FM_grp Frame Manager API
47 @Description FM API functions, definitions and enums
50 *//***************************************************************************/
52 /**************************************************************************//**
53 @Group FM_MACSEC_grp FM MACSEC
55 @Description FM MACSEC API functions, definitions and enums
58 *//***************************************************************************/
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;
69 /**************************************************************************//**
70 @Group FM_MACSEC_init_grp FM-MACSEC Initialization Unit
72 @Description FM MACSEC Initialization Unit
75 *//***************************************************************************/
77 /**************************************************************************//**
78 @Function t_FmMacsecExceptionsCallback
80 @Description Exceptions user callback routine, will be called upon an
81 exception passing the exception identification.
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);
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 */
99 uint8_t fmMacId; /**< FM MAC id */
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 */
112 /**************************************************************************//**
113 @Function FM_MACSEC_Config
115 @Description Creates descriptor for the FM MACSEC module;
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;
121 No actual initialization or configuration of FM MACSEC hardware is
122 done by this routine.
124 @Param[in] p_FmMacsecParam Pointer to data structure of parameters.
126 @Retval Handle to FM MACSEC object, or NULL for Failure.
127 *//***************************************************************************/
128 t_Handle FM_MACSEC_Config(t_FmMacsecParams *p_FmMacsecParam);
130 /**************************************************************************//**
131 @Function FM_MACSEC_Init
133 @Description Initializes the FM MACSEC module.
135 @Param[in] h_FmMacsec FM MACSEC module descriptor.
137 @Return E_OK on success; Error code otherwise.
138 *//***************************************************************************/
139 t_Error FM_MACSEC_Init(t_Handle h_FmMacsec);
141 /**************************************************************************//**
142 @Function FM_MACSEC_Free
144 @Description Frees all resources that were assigned to FM MACSEC module;
146 Calling this routine invalidates the descriptor.
148 @Param[in] h_FmMacsec FM MACSEC module descriptor.
150 @Return E_OK on success; Error code otherwise.
151 *//***************************************************************************/
152 t_Error FM_MACSEC_Free(t_Handle h_FmMacsec);
155 /**************************************************************************//**
156 @Group FM_MACSEC_advanced_init_grp FM-MACSEC Advanced Configuration Unit
158 @Description Configuration functions used to change default values.
161 *//***************************************************************************/
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;
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;
185 /**************************************************************************//**
186 @Function FM_MACSEC_ConfigUnknownSciFrameTreatment
188 @Description Change the treatment for received frames with unknown sci from its default
189 configuration [DEFAULT_unknownSciFrameTreatment].
191 @Param[in] h_FmMacsec FM MACSEC module descriptor.
192 @Param[in] treatMode The selected mode.
194 @Return E_OK on success; Error code otherwise.
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);
200 /**************************************************************************//**
201 @Function FM_MACSEC_ConfigInvalidTagsFrameTreatment
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].
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.
212 @Return E_OK on success; Error code otherwise.
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);
218 /**************************************************************************//**
219 @Function FM_MACSEC_ConfigEncryptWithNoChangedTextFrameTreatment
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].
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.
230 @Return E_OK on success; Error code otherwise.
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);
236 /**************************************************************************//**
237 @Function FM_MACSEC_ConfigChangedTextWithNoEncryptFrameTreatment
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].
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.
248 @Return E_OK on success; Error code otherwise.
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);
254 /**************************************************************************//**
255 @Function FM_MACSEC_ConfigUntagFrameTreatment
257 @Description Change the treatment for received frames without the MAC security tag (SecTAG)
258 from its default configuration [DEFAULT_untagFrameTreatment].
260 @Param[in] h_FmMacsec FM MACSEC module descriptor.
261 @Param[in] treatMode The selected mode.
263 @Return E_OK on success; Error code otherwise.
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);
269 /**************************************************************************//**
270 @Function FM_MACSEC_ConfigOnlyScbIsSetFrameTreatment
272 @Description Change the treatment for received frames with only SCB bit set
273 from its default configuration [DEFAULT_onlyScbIsSetFrameTreatment].
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.
280 @Return E_OK on success; Error code otherwise.
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);
286 /**************************************************************************//**
287 @Function FM_MACSEC_ConfigPnExhaustionThreshold
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.
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.
297 @Return E_OK on success; Error code otherwise.
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);
303 /**************************************************************************//**
304 @Function FM_MACSEC_ConfigKeysUnreadable
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.
309 @Param[in] h_FmMacsec FM MACSEC module descriptor.
311 @Return E_OK on success; Error code otherwise.
313 @Cautions Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
314 *//***************************************************************************/
315 t_Error FM_MACSEC_ConfigKeysUnreadable(t_Handle h_FmMacsec);
317 /**************************************************************************//**
318 @Function FM_MACSEC_ConfigSectagWithoutSCI
320 @Description Promise that all generated Sectag will be without SCI included.
322 @Param[in] h_FmMacsec FM MACSEC module descriptor.
324 @Return E_OK on success; Error code otherwise.
326 @Cautions Allowed only following FM_MACSEC_Config() and before FM_MACSEC_Init().
327 *//***************************************************************************/
328 t_Error FM_MACSEC_ConfigSectagWithoutSCI(t_Handle h_FmMacsec);
330 /**************************************************************************//**
331 @Function FM_MACSEC_ConfigException
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.
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.
341 @Return E_OK on success; Error code otherwise.
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);
347 /** @} */ /* end of FM_MACSEC_advanced_init_grp group */
348 /** @} */ /* end of FM_MACSEC_init_grp group */
351 /**************************************************************************//**
352 @Group FM_MACSEC_runtime_control_grp FM-MACSEC Runtime Control Data Unit
354 @Description FM MACSEC runtime control data unit API functions, definitions and enums.
357 *//***************************************************************************/
359 /**************************************************************************//**
360 @Function FM_MACSEC_GetRevision
362 @Description Return MACSEC HW chip revision
364 @Param[in] h_FmMacsec FM MACSEC module descriptor.
365 @Param[out] p_MacsecRevision MACSEC revision as defined by the chip.
367 @Return E_OK on success; Error code otherwise.
369 @Cautions Allowed only after FM_MACSEC_Init().
370 *//***************************************************************************/
371 t_Error FM_MACSEC_GetRevision(t_Handle h_FmMacsec, uint32_t *p_MacsecRevision);
373 /**************************************************************************//**
374 @Function FM_MACSEC_Enable
376 @Description This routine should be called after MACSEC is initialized for enabling all
377 MACSEC engines according to their existing configuration.
379 @Param[in] h_FmMacsec FM MACSEC module descriptor.
381 @Return E_OK on success; Error code otherwise.
383 @Cautions Allowed only following FM_MACSEC_Init() and when MACSEC is disabled.
384 *//***************************************************************************/
385 t_Error FM_MACSEC_Enable(t_Handle h_FmMacsec);
387 /**************************************************************************//**
388 @Function FM_MACSEC_Disable
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.
393 @Param[in] h_FmMacsec FM MACSEC module descriptor.
395 @Return E_OK on success; Error code otherwise.
397 @Cautions Allowed only following FM_MACSEC_Init() and when MACSEC is enabled.
398 *//***************************************************************************/
399 t_Error FM_MACSEC_Disable(t_Handle h_FmMacsec);
401 /**************************************************************************//**
402 @Function FM_MACSEC_SetException
404 @Description Calling this routine enables/disables the specified exception.
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.
410 @Return E_OK on success; Error code otherwise.
412 @Cautions Allowed only following FM_MACSEC_Init().
413 *//***************************************************************************/
414 t_Error FM_MACSEC_SetException(t_Handle h_FmMacsec, e_FmMacsecExceptions exception, bool enable);
416 #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
417 /**************************************************************************//**
418 @Function FM_MACSEC_DumpRegs
420 @Description Dump internal registers.
422 @Param[in] h_FmMacsec - FM MACSEC module descriptor.
424 @Return E_OK on success; Error code otherwise.
426 @Cautions Allowed only after FM_MACSEC_Init().
427 *//***************************************************************************/
428 t_Error FM_MACSEC_DumpRegs(t_Handle h_FmMacsec);
429 #endif /* (defined(DEBUG_ERRORS) && ... */
431 #ifdef VERIFICATION_SUPPORT
432 /********************* VERIFICATION ONLY ********************************/
433 /**************************************************************************//**
434 @Function FM_MACSEC_BackdoorSet
436 @Description Set register of the MACSEC memory map
438 @Param[in] h_FmMacsec FM MACSEC module descriptor.
439 @Param[out] offset Register offset.
440 @Param[out] value Value to write.
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);
449 /**************************************************************************//**
450 @Function FM_MACSEC_BackdoorGet
452 @Description Read from register of the MACSEC memory map.
454 @Param[in] h_FmMacsec FM MACSEC module descriptor.
455 @Param[out] offset Register offset.
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 */
464 /** @} */ /* end of FM_MACSEC_runtime_control_grp group */
467 /**************************************************************************//**
468 @Group FM_MACSEC_SECY_grp FM-MACSEC SecY
470 @Description FM-MACSEC SecY API functions, definitions and enums
473 *//***************************************************************************/
475 typedef uint8_t macsecSAKey_t[32];
476 typedef uint64_t macsecSCI_t;
477 typedef uint8_t macsecAN_t;
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;
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;
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;
503 /**************************************************************************//**
504 @Collection MACSEC SECY Frame Discarded Descriptor error
505 *//***************************************************************************/
506 typedef uint8_t macsecTxScFrameDiscardedErrSelect_t; /**< typedef for defining Frame Discarded Descriptor errors */
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 */
512 /**************************************************************************//**
513 @Function t_FmMacsecSecYExceptionsCallback
515 @Description Exceptions user callback routine, will be called upon an
516 exception passing the exception identification.
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);
525 /**************************************************************************//**
526 @Function t_FmMacsecSecYEventsCallback
528 @Description Events user callback routine, will be called upon an
529 event passing the event identification.
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);
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 :
550 uint64_t ifInErrors; /**< Number of frames received with error:
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
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;
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;
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;
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;
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;
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;
673 /**************************************************************************//**
674 @Group FM_MACSEC_SECY_init_grp FM-MACSEC SecY Initialization Unit
676 @Description FM-MACSEC SecY Initialization Unit
679 *//***************************************************************************/
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;
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;
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;
714 /**************************************************************************//**
715 @Function FM_MACSEC_SECY_Config
717 @Description Creates descriptor for the FM MACSEC SECY module;
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.
725 @Param[in] p_FmMacsecSecYParam Pointer to data structure of parameters.
727 @Return Handle to FM MACSEC SECY object, or NULL for Failure.
728 *//***************************************************************************/
729 t_Handle FM_MACSEC_SECY_Config(t_FmMacsecSecYParams *p_FmMacsecSecYParam);
731 /**************************************************************************//**
732 @Function FM_MACSEC_SECY_Init
734 @Description Initializes the FM MACSEC SECY module.
736 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
738 @Return E_OK on success; Error code otherwise.
739 *//***************************************************************************/
740 t_Error FM_MACSEC_SECY_Init(t_Handle h_FmMacsecSecY);
742 /**************************************************************************//**
743 @Function FM_MACSEC_SECY_Free
745 @Description Frees all resources that were assigned to FM MACSEC SECY module.
747 Calling this routine invalidates the descriptor.
749 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
751 @Return E_OK on success; Error code otherwise.
752 *//***************************************************************************/
753 t_Error FM_MACSEC_SECY_Free(t_Handle h_FmMacsecSecY);
755 /**************************************************************************//**
756 @Group FM_MACSEC_SECY_advanced_init_grp FM-MACSEC SecY Advanced Configuration Unit
758 @Description Configuration functions used to change default values.
761 *//***************************************************************************/
763 /**************************************************************************//**
764 @Function FM_MACSEC_SECY_ConfigSciInsertionMode
766 @Description Calling this routine changes the SCI-insertion-mode in the
767 internal driver data base from its default configuration
768 [DEFAULT_sciInsertionMode]
770 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
771 @Param[in] sciInsertionMode Sci insertion mode
773 @Return E_OK on success; Error code otherwise.
775 @Cautions Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
777 *//***************************************************************************/
778 t_Error FM_MACSEC_SECY_ConfigSciInsertionMode(t_Handle h_FmMacsecSecY, e_FmMacsecSciInsertionMode sciInsertionMode);
780 /**************************************************************************//**
781 @Function FM_MACSEC_SECY_ConfigProtectFrames
783 @Description Calling this routine changes the protect-frame mode in the
784 internal driver data base from its default configuration
785 [DEFAULT_protectFrames]
787 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
788 @Param[in] protectFrames If FALSE, frames are transmitted without modification
790 @Return E_OK on success; Error code otherwise.
792 @Cautions Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
794 *//***************************************************************************/
795 t_Error FM_MACSEC_SECY_ConfigProtectFrames(t_Handle h_FmMacsecSecY, bool protectFrames);
797 /**************************************************************************//**
798 @Function FM_MACSEC_SECY_ConfigReplayWindow
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]
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
808 @Return E_OK on success; Error code otherwise.
810 @Cautions Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
812 *//***************************************************************************/
813 t_Error FM_MACSEC_SECY_ConfigReplayWindow(t_Handle h_FmMacsecSecY, bool replayProtect, uint32_t replayWindow);
815 /**************************************************************************//**
816 @Function FM_MACSEC_SECY_ConfigValidationMode
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]
822 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
823 @Param[in] validateFrames Validation function mode
825 @Return E_OK on success; Error code otherwise.
827 @Cautions Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
829 *//***************************************************************************/
830 t_Error FM_MACSEC_SECY_ConfigValidationMode(t_Handle h_FmMacsecSecY, e_FmMacsecValidFrameBehavior validateFrames);
832 /**************************************************************************//**
833 @Function FM_MACSEC_SECY_ConfigConfidentiality
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]
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
845 @Return E_OK on success; Error code otherwise.
847 @Cautions Allowed only following FM_MACSEC_SECY_Config() and before FM_MACSEC_SECY_Init();
849 *//***************************************************************************/
850 t_Error FM_MACSEC_SECY_ConfigConfidentiality(t_Handle h_FmMacsecSecY, bool confidentialityEnable, uint16_t confidentialityOffset);
852 /**************************************************************************//**
853 @Function FM_MACSEC_SECY_ConfigPointToPoint
855 @Description configure this SecY to work in point-to-point mode, means that
856 it will have only one rx sc;
858 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
860 @Return E_OK on success; Error code otherwise.
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);
868 /**************************************************************************//**
869 @Function FM_MACSEC_SECY_ConfigException
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.
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.
879 @Return E_OK on success; Error code otherwise.
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);
885 /**************************************************************************//**
886 @Function FM_MACSEC_SECY_ConfigEvent
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.
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.
896 @Return E_OK on success; Error code otherwise.
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);
902 /** @} */ /* end of FM_MACSEC_SECY_advanced_init_grp group */
903 /** @} */ /* end of FM_MACSEC_SECY_init_grp group */
906 /**************************************************************************//**
907 @Group FM_MACSEC_SECY_runtime_control_grp FM-MACSEC SecY Runtime Control Unit
909 @Description FM MACSEC SECY Runtime control unit API functions, definitions and enums.
912 *//***************************************************************************/
914 /**************************************************************************//**
915 @Function FM_MACSEC_SECY_CreateRxSc
917 @Description Create a receive secure channel.
919 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
920 @Param[in] scParams secure channel params.
922 @Return E_OK on success; Error code otherwise.
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);
928 /**************************************************************************//**
929 @Function FM_MACSEC_SECY_DeleteRxSc
931 @Description Deleting an initialized secure channel.
933 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
934 @Param[in] h_Sc SC handle as returned by FM_MACSEC_SECY_CreateRxSc.
936 @Return E_OK on success; Error code otherwise.
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);
942 /**************************************************************************//**
943 @Function FM_MACSEC_SECY_CreateRxSa
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.
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.
954 @Return E_OK on success; Error code otherwise.
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);
960 /**************************************************************************//**
961 @Function FM_MACSEC_SECY_DeleteRxSa
963 @Description Deleting an initialized secure association.
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.
969 @Return E_OK on success; Error code otherwise.
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);
975 /**************************************************************************//**
976 @Function FM_MACSEC_SECY_RxSaEnableReceive
978 @Description Enabling the SA to receive frames.
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.
984 @Return E_OK on success; Error code otherwise.
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);
990 /**************************************************************************//**
991 @Function FM_MACSEC_SECY_RxSaDisableReceive
993 @Description Disabling the SA from receive frames.
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.
999 @Return E_OK on success; Error code otherwise.
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);
1005 /**************************************************************************//**
1006 @Function FM_MACSEC_SECY_RxSaUpdateNextPn
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).
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.
1017 @Return E_OK on success; Error code otherwise.
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);
1023 /**************************************************************************//**
1024 @Function FM_MACSEC_SECY_RxSaUpdateLowestPn
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).
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.
1035 @Return E_OK on success; Error code otherwise.
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);
1041 /**************************************************************************//**
1042 @Function FM_MACSEC_SECY_RxSaModifyKey
1044 @Description Modify the current key of the SA with a new one.
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.
1051 @Return E_OK on success; Error code otherwise.
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);
1057 /**************************************************************************//**
1058 @Function FM_MACSEC_SECY_CreateTxSa
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.
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.
1068 @Return E_OK on success; Error code otherwise.
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);
1074 /**************************************************************************//**
1075 @Function FM_MACSEC_SECY_DeleteTxSa
1077 @Description Deleting an initialized secure association.
1079 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
1080 @Param[in] an association number represent the SA.
1082 @Return E_OK on success; Error code otherwise.
1084 @Cautions Allowed only following FM_MACSEC_SECY_Init().
1085 *//***************************************************************************/
1086 t_Error FM_MACSEC_SECY_DeleteTxSa(t_Handle h_FmMacsecSecY, macsecAN_t an);
1088 /**************************************************************************//**
1089 @Function FM_MACSEC_SECY_TxSaModifyKey
1091 @Description Modify the key of the inactive SA with a new one.
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.
1097 @Return E_OK on success; Error code otherwise.
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);
1103 /**************************************************************************//**
1104 @Function FM_MACSEC_SECY_TxSaSetActive
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.
1109 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
1110 @Param[in] an association number represent the SA.
1112 @Return E_OK on success; Error code otherwise.
1114 @Cautions Allowed only following FM_MACSEC_SECY_Init().
1115 *//***************************************************************************/
1116 t_Error FM_MACSEC_SECY_TxSaSetActive(t_Handle h_FmMacsecSecY, macsecAN_t an);
1118 /**************************************************************************//**
1119 @Function FM_MACSEC_SECY_TxSaGetActive
1121 @Description Get the active SA that being used for TX.
1123 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
1124 @Param[out] p_An the active an.
1126 @Return E_OK on success; Error code otherwise.
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);
1132 /**************************************************************************//**
1133 @Function FM_MACSEC_SECY_GetStatistics
1135 @Description get all statistics counters.
1137 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
1138 @Param[in] p_Statistics Structure with statistics.
1140 @Return E_OK on success; Error code otherwise.
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);
1146 /**************************************************************************//**
1147 @Function FM_MACSEC_SECY_RxScGetStatistics
1149 @Description get all statistics counters.
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.
1155 @Return E_OK on success; Error code otherwise.
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);
1161 /**************************************************************************//**
1162 @Function FM_MACSEC_SECY_RxSaGetStatistics
1164 @Description get all statistics counters
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.
1171 @Return E_OK on success; Error code otherwise.
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);
1177 /**************************************************************************//**
1178 @Function FM_MACSEC_SECY_TxScGetStatistics
1180 @Description get all statistics counters.
1182 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
1183 @Param[in] p_Statistics Structure with statistics.
1185 @Return E_OK on success; Error code otherwise.
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);
1191 /**************************************************************************//**
1192 @Function FM_MACSEC_SECY_TxSaGetStatistics
1194 @Description get all statistics counters.
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.
1200 @Return E_OK on success; Error code otherwise.
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);
1206 /**************************************************************************//**
1207 @Function FM_MACSEC_SECY_SetException
1209 @Description Calling this routine enables/disables the specified exception.
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.
1215 @Return E_OK on success; Error code otherwise.
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);
1221 /**************************************************************************//**
1222 @Function FM_MACSEC_SECY_SetEvent
1224 @Description Calling this routine enables/disables the specified event.
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.
1230 @Return E_OK on success; Error code otherwise.
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);
1236 /**************************************************************************//**
1237 @Function FM_MACSEC_SECY_GetRxScPhysId
1239 @Description return the physical id of the Secure Channel.
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.
1245 @Return E_OK on success; Error code otherwise.
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);
1251 /**************************************************************************//**
1252 @Function FM_MACSEC_SECY_GetTxScPhysId
1254 @Description return the physical id of the Secure Channel.
1256 @Param[in] h_FmMacsecSecY FM MACSEC SECY module descriptor.
1257 @Param[out] p_ScPhysId the SC physical id.
1259 @Return E_OK on success; Error code otherwise.
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);
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 */
1271 #endif /* __FM_MACSEC_EXT_H */