Lines Matching refs:ctx

30 static int nsim_macsec_add_secy(struct macsec_context *ctx)
32 struct netdevsim *ns = netdev_priv(ctx->netdev);
44 netdev_err(ctx->netdev, "%s: nsim_secy_count not full but all SecYs used\n",
49 netdev_dbg(ctx->netdev, "%s: adding new secy with sci %08llx at index %d\n",
50 __func__, sci_to_cpu(ctx->secy->sci), idx);
53 ns->macsec.nsim_secy[idx].sci = ctx->secy->sci;
59 static int nsim_macsec_upd_secy(struct macsec_context *ctx)
61 struct netdevsim *ns = netdev_priv(ctx->netdev);
64 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
66 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
67 __func__, sci_to_cpu(ctx->secy->sci));
71 netdev_dbg(ctx->netdev, "%s: updating secy with sci %08llx at index %d\n",
72 __func__, sci_to_cpu(ctx->secy->sci), idx);
77 static int nsim_macsec_del_secy(struct macsec_context *ctx)
79 struct netdevsim *ns = netdev_priv(ctx->netdev);
82 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
84 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
85 __func__, sci_to_cpu(ctx->secy->sci));
89 netdev_dbg(ctx->netdev, "%s: removing SecY with SCI %08llx at index %d\n",
90 __func__, sci_to_cpu(ctx->secy->sci), idx);
99 static int nsim_macsec_add_rxsc(struct macsec_context *ctx)
101 struct netdevsim *ns = netdev_priv(ctx->netdev);
105 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
107 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
108 __func__, sci_to_cpu(ctx->secy->sci));
122 netdev_err(ctx->netdev, "%s: nsim_rxsc_count not full but all RXSCs used\n",
125 netdev_dbg(ctx->netdev, "%s: adding new rxsc with sci %08llx at index %d\n",
126 __func__, sci_to_cpu(ctx->rx_sc->sci), idx);
128 secy->nsim_rxsc[idx].sci = ctx->rx_sc->sci;
134 static int nsim_macsec_upd_rxsc(struct macsec_context *ctx)
136 struct netdevsim *ns = netdev_priv(ctx->netdev);
140 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
142 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
143 __func__, sci_to_cpu(ctx->secy->sci));
148 idx = nsim_macsec_find_rxsc(secy, ctx->rx_sc->sci);
150 netdev_err(ctx->netdev, "%s: sci %08llx not found in RXSC table\n",
151 __func__, sci_to_cpu(ctx->rx_sc->sci));
155 netdev_dbg(ctx->netdev, "%s: updating RXSC with sci %08llx at index %d\n",
156 __func__, sci_to_cpu(ctx->rx_sc->sci), idx);
161 static int nsim_macsec_del_rxsc(struct macsec_context *ctx)
163 struct netdevsim *ns = netdev_priv(ctx->netdev);
167 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
169 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
170 __func__, sci_to_cpu(ctx->secy->sci));
175 idx = nsim_macsec_find_rxsc(secy, ctx->rx_sc->sci);
177 netdev_err(ctx->netdev, "%s: sci %08llx not found in RXSC table\n",
178 __func__, sci_to_cpu(ctx->rx_sc->sci));
182 netdev_dbg(ctx->netdev, "%s: removing RXSC with sci %08llx at index %d\n",
183 __func__, sci_to_cpu(ctx->rx_sc->sci), idx);
192 static int nsim_macsec_add_rxsa(struct macsec_context *ctx)
194 struct netdevsim *ns = netdev_priv(ctx->netdev);
198 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
200 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
201 __func__, sci_to_cpu(ctx->secy->sci));
206 idx = nsim_macsec_find_rxsc(secy, ctx->sa.rx_sa->sc->sci);
208 netdev_err(ctx->netdev, "%s: sci %08llx not found in RXSC table\n",
209 __func__, sci_to_cpu(ctx->sa.rx_sa->sc->sci));
213 netdev_dbg(ctx->netdev, "%s: RXSC with sci %08llx, AN %u\n",
214 __func__, sci_to_cpu(ctx->sa.rx_sa->sc->sci), ctx->sa.assoc_num);
219 static int nsim_macsec_upd_rxsa(struct macsec_context *ctx)
221 struct netdevsim *ns = netdev_priv(ctx->netdev);
225 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
227 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
228 __func__, sci_to_cpu(ctx->secy->sci));
233 idx = nsim_macsec_find_rxsc(secy, ctx->sa.rx_sa->sc->sci);
235 netdev_err(ctx->netdev, "%s: sci %08llx not found in RXSC table\n",
236 __func__, sci_to_cpu(ctx->sa.rx_sa->sc->sci));
240 netdev_dbg(ctx->netdev, "%s: RXSC with sci %08llx, AN %u\n",
241 __func__, sci_to_cpu(ctx->sa.rx_sa->sc->sci), ctx->sa.assoc_num);
246 static int nsim_macsec_del_rxsa(struct macsec_context *ctx)
248 struct netdevsim *ns = netdev_priv(ctx->netdev);
252 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
254 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
255 __func__, sci_to_cpu(ctx->secy->sci));
260 idx = nsim_macsec_find_rxsc(secy, ctx->sa.rx_sa->sc->sci);
262 netdev_err(ctx->netdev, "%s: sci %08llx not found in RXSC table\n",
263 __func__, sci_to_cpu(ctx->sa.rx_sa->sc->sci));
267 netdev_dbg(ctx->netdev, "%s: RXSC with sci %08llx, AN %u\n",
268 __func__, sci_to_cpu(ctx->sa.rx_sa->sc->sci), ctx->sa.assoc_num);
273 static int nsim_macsec_add_txsa(struct macsec_context *ctx)
275 struct netdevsim *ns = netdev_priv(ctx->netdev);
278 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
280 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
281 __func__, sci_to_cpu(ctx->secy->sci));
285 netdev_dbg(ctx->netdev, "%s: SECY with sci %08llx, AN %u\n",
286 __func__, sci_to_cpu(ctx->secy->sci), ctx->sa.assoc_num);
291 static int nsim_macsec_upd_txsa(struct macsec_context *ctx)
293 struct netdevsim *ns = netdev_priv(ctx->netdev);
296 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
298 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
299 __func__, sci_to_cpu(ctx->secy->sci));
303 netdev_dbg(ctx->netdev, "%s: SECY with sci %08llx, AN %u\n",
304 __func__, sci_to_cpu(ctx->secy->sci), ctx->sa.assoc_num);
309 static int nsim_macsec_del_txsa(struct macsec_context *ctx)
311 struct netdevsim *ns = netdev_priv(ctx->netdev);
314 idx = nsim_macsec_find_secy(ns, ctx->secy->sci);
316 netdev_err(ctx->netdev, "%s: sci %08llx not found in secy table\n",
317 __func__, sci_to_cpu(ctx->secy->sci));
321 netdev_dbg(ctx->netdev, "%s: SECY with sci %08llx, AN %u\n",
322 __func__, sci_to_cpu(ctx->secy->sci), ctx->sa.assoc_num);