mirror of
git://nv-tegra.nvidia.com/kernel/nvethernetrm.git
synced 2025-12-22 17:34:29 +03:00
osi:macsec: changes to send next PN to supplicant
As part of MKA, supplicant requests for Next PN used by SecY. Added changes to OSI to send to send the Next PN for a given SCI and AN. Bug 3371004 Change-Id: Iaf001ba5e6b5480396e2f774a42927831160a2e5 Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2614365 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-by: Mahesh Patil <maheshp@nvidia.com> Reviewed-by: Ashutosh Jha <ajha@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
15aec6d712
commit
b8e03a8b43
@@ -396,6 +396,9 @@ struct osi_macsec_core_ops {
|
|||||||
/** macsec debug buffer config */
|
/** macsec debug buffer config */
|
||||||
nve32_t (*dbg_events_config)(struct osi_core_priv_data *const osi_core,
|
nve32_t (*dbg_events_config)(struct osi_core_priv_data *const osi_core,
|
||||||
struct osi_macsec_dbg_buf_config *const dbg_buf_config);
|
struct osi_macsec_dbg_buf_config *const dbg_buf_config);
|
||||||
|
/** macsec get Key Index start for a given SCI */
|
||||||
|
nve32_t (*get_sc_lut_key_index)(struct osi_core_priv_data *const osi_core,
|
||||||
|
nveu8_t *sci, nve32_t *key_index, nveu16_t ctlr);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -900,4 +903,43 @@ nve32_t osi_macsec_dbg_events_config(
|
|||||||
struct osi_core_priv_data *const osi_core,
|
struct osi_core_priv_data *const osi_core,
|
||||||
struct osi_macsec_dbg_buf_config *const dbg_buf_config);
|
struct osi_macsec_dbg_buf_config *const dbg_buf_config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief MACSEC Key Index Start for a given SCI
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Algorithm:
|
||||||
|
* - Retrieves the Key_index used for a given SCI in SC.
|
||||||
|
*
|
||||||
|
* @param[in] osi_core: OSI core private data structure.
|
||||||
|
* @param[in] sci: Secure Channel Identifier
|
||||||
|
* @param[out] key_index: Pointer which will be filled with key_index start
|
||||||
|
* @param[in] ctrl: Tx or Rx controller
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @pre
|
||||||
|
* - MACSEC shall be initialized and enalbed
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Traceability Details:
|
||||||
|
* - SWUD_ID:
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Classification:
|
||||||
|
* - Interrupt: No
|
||||||
|
* - Signal handler: No
|
||||||
|
* - Thread safe: No
|
||||||
|
* - Required Privileges: None
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* API Group:
|
||||||
|
* - Initialization: No
|
||||||
|
* - Run time: Yes
|
||||||
|
* - De-initialization: No
|
||||||
|
*
|
||||||
|
* @retval vaid Key Index Start on success
|
||||||
|
* @retval -1 on failure
|
||||||
|
*/
|
||||||
|
nve32_t osi_macsec_get_sc_lut_key_index(
|
||||||
|
struct osi_core_priv_data *const osi_core,
|
||||||
|
nveu8_t *sci, nve32_t *key_index, nveu16_t ctlr);
|
||||||
#endif /* INCLUDED_OSI_MACSEC_H */
|
#endif /* INCLUDED_OSI_MACSEC_H */
|
||||||
|
|||||||
@@ -2672,6 +2672,32 @@ static struct osi_macsec_sc_info *find_existing_sc(
|
|||||||
return OSI_NULL;
|
return OSI_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nve32_t macsec_get_sc_lut_key_index(struct osi_core_priv_data *const osi_core,
|
||||||
|
nveu8_t *sci, nve32_t *key_index, nveu16_t ctlr)
|
||||||
|
{
|
||||||
|
struct osi_macsec_sc_info sc;
|
||||||
|
struct osi_macsec_sc_info *sc_info = OSI_NULL;
|
||||||
|
|
||||||
|
/* Validate inputs */
|
||||||
|
if ((sci == OSI_NULL) || (key_index == OSI_NULL) ||
|
||||||
|
(ctlr > OSI_CTLR_SEL_MAX)) {
|
||||||
|
OSI_CORE_ERR(osi_core->osd, OSI_LOG_ARG_HW_FAIL,
|
||||||
|
"Params validation failed\n", 0ULL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
osi_memcpy(sc.sci, sci, OSI_SCI_LEN);
|
||||||
|
sc_info = find_existing_sc(osi_core, &sc, ctlr);
|
||||||
|
if (sc_info == OSI_NULL) {
|
||||||
|
OSI_CORE_ERR(osi_core->osd, OSI_LOG_ARG_HW_FAIL,
|
||||||
|
"SCI Not found\n", 0ULL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*key_index = (sc_info->sc_idx_start * OSI_MAX_NUM_SA);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static nve32_t del_upd_sc(struct osi_core_priv_data *const osi_core,
|
static nve32_t del_upd_sc(struct osi_core_priv_data *const osi_core,
|
||||||
struct osi_macsec_sc_info *existing_sc,
|
struct osi_macsec_sc_info *existing_sc,
|
||||||
struct osi_macsec_sc_info *const sc,
|
struct osi_macsec_sc_info *const sc,
|
||||||
@@ -3107,6 +3133,7 @@ static struct osi_macsec_core_ops macsec_ops = {
|
|||||||
.read_mmc = macsec_read_mmc,
|
.read_mmc = macsec_read_mmc,
|
||||||
.dbg_buf_config = macsec_dbg_buf_config,
|
.dbg_buf_config = macsec_dbg_buf_config,
|
||||||
.dbg_events_config = macsec_dbg_events_config,
|
.dbg_events_config = macsec_dbg_events_config,
|
||||||
|
.get_sc_lut_key_index = macsec_get_sc_lut_key_index,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3178,6 +3205,19 @@ nve32_t osi_macsec_lut_config(struct osi_core_priv_data *const osi_core,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nve32_t osi_macsec_get_sc_lut_key_index(struct osi_core_priv_data *const osi_core,
|
||||||
|
nveu8_t *sci, nve32_t *key_index,
|
||||||
|
nveu16_t ctlr)
|
||||||
|
{
|
||||||
|
if (osi_core != OSI_NULL && osi_core->macsec_ops != OSI_NULL &&
|
||||||
|
osi_core->macsec_ops->get_sc_lut_key_index != OSI_NULL) {
|
||||||
|
return osi_core->macsec_ops->get_sc_lut_key_index(osi_core, sci, key_index,
|
||||||
|
ctlr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MACSEC_KEY_PROGRAM
|
#ifdef MACSEC_KEY_PROGRAM
|
||||||
nve32_t osi_macsec_kt_config(struct osi_core_priv_data *const osi_core,
|
nve32_t osi_macsec_kt_config(struct osi_core_priv_data *const osi_core,
|
||||||
struct osi_macsec_kt_config *const kt_config)
|
struct osi_macsec_kt_config *const kt_config)
|
||||||
|
|||||||
Reference in New Issue
Block a user