Lines Matching refs:ns
11 static int nsim_macsec_find_secy(struct netdevsim *ns, sci_t sci) in nsim_macsec_find_secy() argument
16 if (ns->macsec.nsim_secy[i].sci == sci) in nsim_macsec_find_secy()
37 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_add_secy() local
40 if (ns->macsec.nsim_secy_count == NSIM_MACSEC_MAX_SECY_COUNT) in nsim_macsec_add_secy()
44 if (!ns->macsec.nsim_secy[idx].used) in nsim_macsec_add_secy()
56 ns->macsec.nsim_secy[idx].used = true; in nsim_macsec_add_secy()
57 ns->macsec.nsim_secy[idx].nsim_rxsc_count = 0; in nsim_macsec_add_secy()
58 ns->macsec.nsim_secy[idx].sci = ctx->secy->sci; in nsim_macsec_add_secy()
59 ns->macsec.nsim_secy_count++; in nsim_macsec_add_secy()
66 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_upd_secy() local
69 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_upd_secy()
84 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_del_secy() local
87 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_del_secy()
97 ns->macsec.nsim_secy[idx].used = false; in nsim_macsec_del_secy()
98 memset(&ns->macsec.nsim_secy[idx], 0, sizeof(ns->macsec.nsim_secy[idx])); in nsim_macsec_del_secy()
99 ns->macsec.nsim_secy_count--; in nsim_macsec_del_secy()
106 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_add_rxsc() local
110 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_add_rxsc()
116 secy = &ns->macsec.nsim_secy[idx]; in nsim_macsec_add_rxsc()
141 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_upd_rxsc() local
145 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_upd_rxsc()
151 secy = &ns->macsec.nsim_secy[idx]; in nsim_macsec_upd_rxsc()
168 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_del_rxsc() local
172 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_del_rxsc()
178 secy = &ns->macsec.nsim_secy[idx]; in nsim_macsec_del_rxsc()
199 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_add_rxsa() local
203 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_add_rxsa()
209 secy = &ns->macsec.nsim_secy[idx]; in nsim_macsec_add_rxsa()
226 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_upd_rxsa() local
230 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_upd_rxsa()
236 secy = &ns->macsec.nsim_secy[idx]; in nsim_macsec_upd_rxsa()
253 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_del_rxsa() local
257 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_del_rxsa()
263 secy = &ns->macsec.nsim_secy[idx]; in nsim_macsec_del_rxsa()
280 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_add_txsa() local
283 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_add_txsa()
298 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_upd_txsa() local
301 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_upd_txsa()
316 struct netdevsim *ns = netdev_priv(ctx->netdev); in nsim_macsec_del_txsa() local
319 idx = nsim_macsec_find_secy(ns, ctx->secy->sci); in nsim_macsec_del_txsa()
347 void nsim_macsec_init(struct netdevsim *ns) in nsim_macsec_init() argument
349 ns->netdev->macsec_ops = &nsim_macsec_ops; in nsim_macsec_init()
350 ns->netdev->features |= NETIF_F_HW_MACSEC; in nsim_macsec_init()
351 memset(&ns->macsec, 0, sizeof(ns->macsec)); in nsim_macsec_init()
354 void nsim_macsec_teardown(struct netdevsim *ns) in nsim_macsec_teardown() argument