Lines Matching refs:secy
32 static int aq_clear_secy(struct aq_nic_s *nic, const struct macsec_secy *secy,
36 const struct macsec_secy *secy);
50 const struct macsec_secy *secy) in aq_get_txsc_idx_from_secy() argument
54 if (unlikely(!secy)) in aq_get_txsc_idx_from_secy()
58 if (macsec_cfg->aq_txsc[i].sw_secy == secy) in aq_get_txsc_idx_from_secy()
296 ret = aq_apply_secy_cfg(nic, ctx->secy); in aq_mdo_dev_open()
319 const struct macsec_secy *secy = aq_txsc->sw_secy; in aq_set_txsc() local
325 aq_ether_addr_to_mac(tx_class_rec.mac_sa, secy->netdev->dev_addr); in aq_set_txsc()
327 put_unaligned_be64((__force u64)secy->sci, tx_class_rec.sci); in aq_set_txsc()
343 sc_rec.protect = secy->protect_frames; in aq_set_txsc()
344 if (secy->tx_sc.encrypt) in aq_set_txsc()
346 if (secy->tx_sc.scb) in aq_set_txsc()
348 if (secy->tx_sc.send_sci) in aq_set_txsc()
350 if (secy->tx_sc.end_station) in aq_set_txsc()
355 if (!(secy->icv_len == 16 && !secy->tx_sc.encrypt)) in aq_set_txsc()
360 switch (secy->key_len) { in aq_set_txsc()
375 sc_rec.curr_an = secy->tx_sc.encoding_sa; in aq_set_txsc()
444 const struct macsec_secy *secy = ctx->secy; in aq_mdo_add_secy() local
449 if (secy->xpn) in aq_mdo_add_secy()
465 cfg->aq_txsc[txsc_idx].sw_secy = secy; in aq_mdo_add_secy()
467 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_add_secy()
478 const struct macsec_secy *secy = ctx->secy; in aq_mdo_upd_secy() local
482 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); in aq_mdo_upd_secy()
486 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_upd_secy()
537 ret = aq_clear_secy(nic, ctx->secy, AQ_CLEAR_ALL); in aq_mdo_del_secy()
543 const struct macsec_secy *secy, in aq_update_txsa() argument
567 memcpy(&key_rec.key, key, secy->key_len); in aq_update_txsa()
569 aq_rotate_keys(&key_rec.key, secy->key_len); in aq_update_txsa()
581 const struct macsec_secy *secy = ctx->secy; in aq_mdo_add_txsa() local
586 txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy); in aq_mdo_add_txsa()
594 secy->key_len); in aq_mdo_add_txsa()
596 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_add_txsa()
597 ret = aq_update_txsa(nic, aq_txsc->hw_sc_idx, secy, in aq_mdo_add_txsa()
608 const struct macsec_secy *secy = ctx->secy; in aq_mdo_upd_txsa() local
613 txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy); in aq_mdo_upd_txsa()
618 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_upd_txsa()
619 ret = aq_update_txsa(nic, aq_txsc->hw_sc_idx, secy, in aq_mdo_upd_txsa()
660 txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy); in aq_mdo_del_txsa()
692 const struct macsec_secy *secy = aq_rxsc->sw_secy; in aq_set_rxsc() local
730 aq_rxsc_validate_frames(secy->validate_frames); in aq_set_rxsc()
731 if (secy->replay_protect) { in aq_set_rxsc()
733 sc_record.anti_replay_window = secy->replay_window; in aq_set_rxsc()
762 cfg->aq_rxsc[rxsc_idx].sw_secy = ctx->secy; in aq_mdo_add_rxsc()
765 if (netif_carrier_ok(nic->ndev) && netif_running(ctx->secy->netdev)) in aq_mdo_add_rxsc()
786 if (netif_carrier_ok(nic->ndev) && netif_running(ctx->secy->netdev)) in aq_mdo_upd_rxsc()
859 const struct macsec_secy *secy, in aq_update_rxsa() argument
883 memcpy(&sa_key_record.key, key, secy->key_len); in aq_update_rxsa()
885 switch (secy->key_len) { in aq_update_rxsa()
899 aq_rotate_keys(&sa_key_record.key, secy->key_len); in aq_update_rxsa()
911 const struct macsec_secy *secy = ctx->secy; in aq_mdo_add_rxsa() local
924 secy->key_len); in aq_mdo_add_rxsa()
926 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_add_rxsa()
927 ret = aq_update_rxsa(nic, aq_rxsc->hw_sc_idx, secy, in aq_mdo_add_rxsa()
939 const struct macsec_secy *secy = ctx->secy; in aq_mdo_upd_rxsa() local
947 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_upd_rxsa()
949 secy, ctx->sa.rx_sa, NULL, in aq_mdo_upd_rxsa()
1029 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, ctx->secy); in aq_mdo_get_tx_sc_stats()
1051 const struct macsec_secy *secy; in aq_mdo_get_tx_sa_stats() local
1059 txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy); in aq_mdo_get_tx_sa_stats()
1073 secy = aq_txsc->sw_secy; in aq_mdo_get_tx_sa_stats()
1074 tx_sa = rcu_dereference_bh(secy->tx_sc.sa[ctx->sa.assoc_num]); in aq_mdo_get_tx_sa_stats()
1174 const struct macsec_secy *secy = aq_txsc->sw_secy; in apply_txsc_cfg() local
1179 if (!netif_running(secy->netdev)) in apply_txsc_cfg()
1187 tx_sa = rcu_dereference_bh(secy->tx_sc.sa[i]); in apply_txsc_cfg()
1189 ret = aq_update_txsa(nic, aq_txsc->hw_sc_idx, secy, in apply_txsc_cfg()
1202 const struct macsec_secy *secy = aq_rxsc->sw_secy; in apply_rxsc_cfg() local
1207 if (!netif_running(secy->netdev)) in apply_rxsc_cfg()
1217 ret = aq_update_rxsa(nic, aq_rxsc->hw_sc_idx, secy, in apply_rxsc_cfg()
1227 static int aq_clear_secy(struct aq_nic_s *nic, const struct macsec_secy *secy, in aq_clear_secy() argument
1235 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); in aq_clear_secy()
1242 for (rx_sc = rcu_dereference_bh(secy->rx_sc); rx_sc; in aq_clear_secy()
1257 const struct macsec_secy *secy) in aq_apply_secy_cfg() argument
1264 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); in aq_apply_secy_cfg()
1268 for (rx_sc = rcu_dereference_bh(secy->rx_sc); rx_sc && rx_sc->active; in aq_apply_secy_cfg()
1343 const struct macsec_secy *secy; in aq_check_txsa_expiration() local
1375 secy = aq_txsc->sw_secy; in aq_check_txsa_expiration()
1376 if (!netif_running(secy->netdev)) { in aq_check_txsa_expiration()
1388 tx_sa = rcu_dereference_bh(secy->tx_sc.sa[an]); in aq_check_txsa_expiration()
1389 macsec_pn_wrapped((struct macsec_secy *)secy, tx_sa); in aq_check_txsa_expiration()