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()
299 ret = aq_apply_secy_cfg(nic, ctx->secy); in aq_mdo_dev_open()
325 const struct macsec_secy *secy = aq_txsc->sw_secy; in aq_set_txsc() local
331 aq_ether_addr_to_mac(tx_class_rec.mac_sa, secy->netdev->dev_addr); in aq_set_txsc()
333 put_unaligned_be64((__force u64)secy->sci, tx_class_rec.sci); in aq_set_txsc()
349 sc_rec.protect = secy->protect_frames; in aq_set_txsc()
350 if (secy->tx_sc.encrypt) in aq_set_txsc()
352 if (secy->tx_sc.scb) in aq_set_txsc()
354 if (secy->tx_sc.send_sci) in aq_set_txsc()
356 if (secy->tx_sc.end_station) in aq_set_txsc()
361 if (!(secy->icv_len == 16 && !secy->tx_sc.encrypt)) in aq_set_txsc()
366 switch (secy->key_len) { in aq_set_txsc()
381 sc_rec.curr_an = secy->tx_sc.encoding_sa; in aq_set_txsc()
450 const struct macsec_secy *secy = ctx->secy; in aq_mdo_add_secy() local
455 if (secy->xpn) in aq_mdo_add_secy()
474 cfg->aq_txsc[txsc_idx].sw_secy = secy; in aq_mdo_add_secy()
476 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_add_secy()
487 const struct macsec_secy *secy = ctx->secy; in aq_mdo_upd_secy() local
491 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); in aq_mdo_upd_secy()
498 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_upd_secy()
552 ret = aq_clear_secy(nic, ctx->secy, AQ_CLEAR_ALL); in aq_mdo_del_secy()
558 const struct macsec_secy *secy, in aq_update_txsa() argument
582 memcpy(&key_rec.key, key, secy->key_len); in aq_update_txsa()
584 aq_rotate_keys(&key_rec.key, secy->key_len); in aq_update_txsa()
595 const struct macsec_secy *secy = ctx->secy; in aq_mdo_add_txsa() local
600 txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy); in aq_mdo_add_txsa()
611 secy->key_len); in aq_mdo_add_txsa()
613 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_add_txsa()
614 ret = aq_update_txsa(nic, aq_txsc->hw_sc_idx, secy, in aq_mdo_add_txsa()
625 const struct macsec_secy *secy = ctx->secy; in aq_mdo_upd_txsa() local
630 txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy); in aq_mdo_upd_txsa()
638 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_upd_txsa()
639 ret = aq_update_txsa(nic, aq_txsc->hw_sc_idx, secy, in aq_mdo_upd_txsa()
680 txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy); in aq_mdo_del_txsa()
715 const struct macsec_secy *secy = aq_rxsc->sw_secy; in aq_set_rxsc() local
753 aq_rxsc_validate_frames(secy->validate_frames); in aq_set_rxsc()
754 if (secy->replay_protect) { in aq_set_rxsc()
756 sc_record.anti_replay_window = secy->replay_window; in aq_set_rxsc()
788 cfg->aq_rxsc[rxsc_idx].sw_secy = ctx->secy; in aq_mdo_add_rxsc()
791 if (netif_carrier_ok(nic->ndev) && netif_running(ctx->secy->netdev)) in aq_mdo_add_rxsc()
815 if (netif_carrier_ok(nic->ndev) && netif_running(ctx->secy->netdev)) in aq_mdo_upd_rxsc()
891 const struct macsec_secy *secy, in aq_update_rxsa() argument
915 memcpy(&sa_key_record.key, key, secy->key_len); in aq_update_rxsa()
917 switch (secy->key_len) { in aq_update_rxsa()
931 aq_rotate_keys(&sa_key_record.key, secy->key_len); in aq_update_rxsa()
942 const struct macsec_secy *secy = ctx->secy; in aq_mdo_add_rxsa() local
958 secy->key_len); in aq_mdo_add_rxsa()
960 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_add_rxsa()
961 ret = aq_update_rxsa(nic, aq_rxsc->hw_sc_idx, secy, in aq_mdo_add_rxsa()
973 const struct macsec_secy *secy = ctx->secy; in aq_mdo_upd_rxsa() local
984 if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev)) in aq_mdo_upd_rxsa()
986 secy, ctx->sa.rx_sa, NULL, in aq_mdo_upd_rxsa()
1072 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, ctx->secy); in aq_mdo_get_tx_sc_stats()
1097 const struct macsec_secy *secy; in aq_mdo_get_tx_sa_stats() local
1105 txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy); in aq_mdo_get_tx_sa_stats()
1122 secy = aq_txsc->sw_secy; in aq_mdo_get_tx_sa_stats()
1123 tx_sa = rcu_dereference_bh(secy->tx_sc.sa[ctx->sa.assoc_num]); in aq_mdo_get_tx_sa_stats()
1229 const struct macsec_secy *secy = aq_txsc->sw_secy; in apply_txsc_cfg() local
1234 if (!netif_running(secy->netdev)) in apply_txsc_cfg()
1242 tx_sa = rcu_dereference_bh(secy->tx_sc.sa[i]); in apply_txsc_cfg()
1244 ret = aq_update_txsa(nic, aq_txsc->hw_sc_idx, secy, in apply_txsc_cfg()
1257 const struct macsec_secy *secy = aq_rxsc->sw_secy; in apply_rxsc_cfg() local
1262 if (!netif_running(secy->netdev)) in apply_rxsc_cfg()
1272 ret = aq_update_rxsa(nic, aq_rxsc->hw_sc_idx, secy, in apply_rxsc_cfg()
1282 static int aq_clear_secy(struct aq_nic_s *nic, const struct macsec_secy *secy, in aq_clear_secy() argument
1290 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); in aq_clear_secy()
1297 for (rx_sc = rcu_dereference_bh(secy->rx_sc); rx_sc; in aq_clear_secy()
1312 const struct macsec_secy *secy) in aq_apply_secy_cfg() argument
1319 txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); in aq_apply_secy_cfg()
1323 for (rx_sc = rcu_dereference_bh(secy->rx_sc); rx_sc && rx_sc->active; in aq_apply_secy_cfg()
1398 const struct macsec_secy *secy; in aq_check_txsa_expiration() local
1430 secy = aq_txsc->sw_secy; in aq_check_txsa_expiration()
1431 if (!netif_running(secy->netdev)) { in aq_check_txsa_expiration()
1443 tx_sa = rcu_dereference_bh(secy->tx_sc.sa[an]); in aq_check_txsa_expiration()
1444 macsec_pn_wrapped((struct macsec_secy *)secy, tx_sa); in aq_check_txsa_expiration()