Lines Matching full:sa

183 	void *sa;  member
415 static struct nxp_c45_sa *nxp_c45_sa_alloc(struct list_head *sa_list, void *sa, in nxp_c45_sa_alloc() argument
443 tmp->sa = sa; in nxp_c45_sa_alloc()
452 static void nxp_c45_sa_free(struct nxp_c45_sa *sa) in nxp_c45_sa_free() argument
454 list_del(&sa->list); in nxp_c45_sa_free()
455 kfree(sa); in nxp_c45_sa_free()
467 struct nxp_c45_sa *sa, u64 pn, in nxp_c45_sa_set_pn() argument
470 const struct nxp_c45_sa_regs *sa_regs = sa->regs; in nxp_c45_sa_set_pn()
476 if (sa->type != RX_SA) in nxp_c45_sa_set_pn()
495 u32 *key_u32 = (u32 *)ctx->sa.key; in nxp_c45_sa_set_key()
521 struct nxp_c45_sa *sa) in nxp_c45_rx_sa_clear_stats() argument
523 nxp_c45_macsec_write(phydev, sa->regs->ipis, 0); in nxp_c45_rx_sa_clear_stats()
524 nxp_c45_macsec_write(phydev, sa->regs->ipnvs, 0); in nxp_c45_rx_sa_clear_stats()
525 nxp_c45_macsec_write(phydev, sa->regs->ipos, 0); in nxp_c45_rx_sa_clear_stats()
527 nxp_c45_macsec_write(phydev, MACSEC_RXAN0INUSS + sa->an * 4, 0); in nxp_c45_rx_sa_clear_stats()
528 nxp_c45_macsec_write(phydev, MACSEC_RXAN0IPUSS + sa->an * 4, 0); in nxp_c45_rx_sa_clear_stats()
532 struct nxp_c45_sa *sa, in nxp_c45_rx_sa_read_stats() argument
535 nxp_c45_macsec_read(phydev, sa->regs->ipis, &stats->InPktsInvalid); in nxp_c45_rx_sa_read_stats()
536 nxp_c45_macsec_read(phydev, sa->regs->ipnvs, &stats->InPktsNotValid); in nxp_c45_rx_sa_read_stats()
537 nxp_c45_macsec_read(phydev, sa->regs->ipos, &stats->InPktsOK); in nxp_c45_rx_sa_read_stats()
541 struct nxp_c45_sa *sa) in nxp_c45_tx_sa_clear_stats() argument
543 nxp_c45_macsec_write(phydev, sa->regs->opps, 0); in nxp_c45_tx_sa_clear_stats()
544 nxp_c45_macsec_write(phydev, sa->regs->opes, 0); in nxp_c45_tx_sa_clear_stats()
548 struct nxp_c45_sa *sa, in nxp_c45_tx_sa_read_stats() argument
551 nxp_c45_macsec_read(phydev, sa->regs->opps, &stats->OutPktsProtected); in nxp_c45_tx_sa_read_stats()
552 nxp_c45_macsec_read(phydev, sa->regs->opes, &stats->OutPktsEncrypted); in nxp_c45_tx_sa_read_stats()
556 struct nxp_c45_sa *sa, bool en) in nxp_c45_rx_sa_update() argument
558 const struct nxp_c45_sa_regs *sa_regs = sa->regs; in nxp_c45_rx_sa_update()
561 cfg = sa->an << MACSEC_RXSA_CS_AN_OFF; in nxp_c45_rx_sa_update()
567 struct nxp_c45_sa *sa, bool en) in nxp_c45_tx_sa_update() argument
574 cfg |= sa->an << MACSEC_TXSC_CFG_AN_OFF; in nxp_c45_tx_sa_update()
576 if (sa->is_key_a) in nxp_c45_tx_sa_update()
1033 struct nxp_c45_sa *sa; in nxp_c45_tx_sa_next() local
1035 sa = nxp_c45_find_sa(&phy_secy->sa_list, TX_SA, encoding_sa); in nxp_c45_tx_sa_next()
1036 if (!IS_ERR(sa)) { in nxp_c45_tx_sa_next()
1037 memcpy(next_sa, sa, sizeof(*sa)); in nxp_c45_tx_sa_next()
1193 struct macsec_rx_sa *rx_sa = ctx->sa.rx_sa; in nxp_c45_mdo_add_rxsa()
1197 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_add_rxsa()
1198 struct nxp_c45_sa *sa; in nxp_c45_mdo_add_rxsa() local
1200 phydev_dbg(phydev, "add RX SA %u %s to RX SC SCI %016llx\n", in nxp_c45_mdo_add_rxsa()
1208 sa = nxp_c45_sa_alloc(&phy_secy->sa_list, rx_sa, RX_SA, an); in nxp_c45_mdo_add_rxsa()
1209 if (IS_ERR(sa)) in nxp_c45_mdo_add_rxsa()
1210 return PTR_ERR(sa); in nxp_c45_mdo_add_rxsa()
1213 nxp_c45_sa_set_pn(phydev, sa, rx_sa->next_pn, in nxp_c45_mdo_add_rxsa()
1215 nxp_c45_sa_set_key(ctx, sa->regs, rx_sa->key.salt.bytes, rx_sa->ssci); in nxp_c45_mdo_add_rxsa()
1216 nxp_c45_rx_sa_update(phydev, sa, rx_sa->active); in nxp_c45_mdo_add_rxsa()
1223 struct macsec_rx_sa *rx_sa = ctx->sa.rx_sa; in nxp_c45_mdo_upd_rxsa()
1227 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_upd_rxsa()
1228 struct nxp_c45_sa *sa; in nxp_c45_mdo_upd_rxsa() local
1230 phydev_dbg(phydev, "update RX SA %u %s to RX SC SCI %016llx\n", in nxp_c45_mdo_upd_rxsa()
1238 sa = nxp_c45_find_sa(&phy_secy->sa_list, RX_SA, an); in nxp_c45_mdo_upd_rxsa()
1239 if (IS_ERR(sa)) in nxp_c45_mdo_upd_rxsa()
1240 return PTR_ERR(sa); in nxp_c45_mdo_upd_rxsa()
1243 if (ctx->sa.update_pn) in nxp_c45_mdo_upd_rxsa()
1244 nxp_c45_sa_set_pn(phydev, sa, rx_sa->next_pn, in nxp_c45_mdo_upd_rxsa()
1246 nxp_c45_rx_sa_update(phydev, sa, rx_sa->active); in nxp_c45_mdo_upd_rxsa()
1253 struct macsec_rx_sa *rx_sa = ctx->sa.rx_sa; in nxp_c45_mdo_del_rxsa()
1257 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_del_rxsa()
1258 struct nxp_c45_sa *sa; in nxp_c45_mdo_del_rxsa() local
1260 phydev_dbg(phydev, "delete RX SA %u %s to RX SC SCI %016llx\n", in nxp_c45_mdo_del_rxsa()
1268 sa = nxp_c45_find_sa(&phy_secy->sa_list, RX_SA, an); in nxp_c45_mdo_del_rxsa()
1269 if (IS_ERR(sa)) in nxp_c45_mdo_del_rxsa()
1270 return PTR_ERR(sa); in nxp_c45_mdo_del_rxsa()
1273 nxp_c45_rx_sa_update(phydev, sa, false); in nxp_c45_mdo_del_rxsa()
1274 nxp_c45_rx_sa_clear_stats(phydev, sa); in nxp_c45_mdo_del_rxsa()
1276 nxp_c45_sa_free(sa); in nxp_c45_mdo_del_rxsa()
1283 struct macsec_tx_sa *tx_sa = ctx->sa.tx_sa; in nxp_c45_mdo_add_txsa()
1287 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_add_txsa()
1288 struct nxp_c45_sa *sa; in nxp_c45_mdo_add_txsa() local
1290 phydev_dbg(phydev, "add TX SA %u %s to TX SC %016llx\n", in nxp_c45_mdo_add_txsa()
1291 an, ctx->sa.tx_sa->active ? "enabled" : "disabled", in nxp_c45_mdo_add_txsa()
1298 sa = nxp_c45_sa_alloc(&phy_secy->sa_list, tx_sa, TX_SA, an); in nxp_c45_mdo_add_txsa()
1299 if (IS_ERR(sa)) in nxp_c45_mdo_add_txsa()
1300 return PTR_ERR(sa); in nxp_c45_mdo_add_txsa()
1303 nxp_c45_sa_set_pn(phydev, sa, tx_sa->next_pn, 0); in nxp_c45_mdo_add_txsa()
1304 nxp_c45_sa_set_key(ctx, sa->regs, tx_sa->key.salt.bytes, tx_sa->ssci); in nxp_c45_mdo_add_txsa()
1305 if (ctx->secy->tx_sc.encoding_sa == sa->an) in nxp_c45_mdo_add_txsa()
1306 nxp_c45_tx_sa_update(phydev, sa, tx_sa->active); in nxp_c45_mdo_add_txsa()
1313 struct macsec_tx_sa *tx_sa = ctx->sa.tx_sa; in nxp_c45_mdo_upd_txsa()
1317 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_upd_txsa()
1318 struct nxp_c45_sa *sa; in nxp_c45_mdo_upd_txsa() local
1320 phydev_dbg(phydev, "update TX SA %u %s to TX SC %016llx\n", in nxp_c45_mdo_upd_txsa()
1321 an, ctx->sa.tx_sa->active ? "enabled" : "disabled", in nxp_c45_mdo_upd_txsa()
1328 sa = nxp_c45_find_sa(&phy_secy->sa_list, TX_SA, an); in nxp_c45_mdo_upd_txsa()
1329 if (IS_ERR(sa)) in nxp_c45_mdo_upd_txsa()
1330 return PTR_ERR(sa); in nxp_c45_mdo_upd_txsa()
1333 if (ctx->sa.update_pn) in nxp_c45_mdo_upd_txsa()
1334 nxp_c45_sa_set_pn(phydev, sa, tx_sa->next_pn, 0); in nxp_c45_mdo_upd_txsa()
1335 if (ctx->secy->tx_sc.encoding_sa == sa->an) in nxp_c45_mdo_upd_txsa()
1336 nxp_c45_tx_sa_update(phydev, sa, tx_sa->active); in nxp_c45_mdo_upd_txsa()
1346 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_del_txsa()
1347 struct nxp_c45_sa *sa; in nxp_c45_mdo_del_txsa() local
1349 phydev_dbg(phydev, "delete TX SA %u %s to TX SC %016llx\n", in nxp_c45_mdo_del_txsa()
1350 an, ctx->sa.tx_sa->active ? "enabled" : "disabled", in nxp_c45_mdo_del_txsa()
1357 sa = nxp_c45_find_sa(&phy_secy->sa_list, TX_SA, an); in nxp_c45_mdo_del_txsa()
1358 if (IS_ERR(sa)) in nxp_c45_mdo_del_txsa()
1359 return PTR_ERR(sa); in nxp_c45_mdo_del_txsa()
1362 if (ctx->secy->tx_sc.encoding_sa == sa->an) in nxp_c45_mdo_del_txsa()
1363 nxp_c45_tx_sa_update(phydev, sa, false); in nxp_c45_mdo_del_txsa()
1364 nxp_c45_tx_sa_clear_stats(phydev, sa); in nxp_c45_mdo_del_txsa()
1366 nxp_c45_sa_free(sa); in nxp_c45_mdo_del_txsa()
1452 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_get_tx_sa_stats()
1453 struct nxp_c45_sa *sa; in nxp_c45_mdo_get_tx_sa_stats() local
1459 sa = nxp_c45_find_sa(&phy_secy->sa_list, TX_SA, an); in nxp_c45_mdo_get_tx_sa_stats()
1460 if (IS_ERR(sa)) in nxp_c45_mdo_get_tx_sa_stats()
1461 return PTR_ERR(sa); in nxp_c45_mdo_get_tx_sa_stats()
1465 nxp_c45_tx_sa_read_stats(phydev, sa, stats); in nxp_c45_mdo_get_tx_sa_stats()
1531 u8 an = ctx->sa.assoc_num; in nxp_c45_mdo_get_rx_sa_stats()
1532 struct nxp_c45_sa *sa; in nxp_c45_mdo_get_rx_sa_stats() local
1538 sa = nxp_c45_find_sa(&phy_secy->sa_list, RX_SA, an); in nxp_c45_mdo_get_rx_sa_stats()
1539 if (IS_ERR(sa)) in nxp_c45_mdo_get_rx_sa_stats()
1540 return PTR_ERR(sa); in nxp_c45_mdo_get_rx_sa_stats()
1545 nxp_c45_rx_sa_read_stats(phydev, sa, stats); in nxp_c45_mdo_get_rx_sa_stats()
1693 struct nxp_c45_sa *sa; in nxp_c45_handle_macsec_interrupt() local
1718 sa = nxp_c45_find_sa(&secy->sa_list, TX_SA, encoding_sa); in nxp_c45_handle_macsec_interrupt()
1719 if (!IS_ERR(sa)) in nxp_c45_handle_macsec_interrupt()
1720 macsec_pn_wrapped(secy->secy, sa->sa); in nxp_c45_handle_macsec_interrupt()