Commit 27418b55 authored by Antoine Tenart's avatar Antoine Tenart Committed by Jakub Kicinski

net: atlantic: macsec: remove checks on the prepare phase

Remove checks on the prepare phase as it is now unused by the MACsec
core implementation.
Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6b701f41
...@@ -292,9 +292,6 @@ static int aq_mdo_dev_open(struct macsec_context *ctx) ...@@ -292,9 +292,6 @@ static int aq_mdo_dev_open(struct macsec_context *ctx)
struct aq_nic_s *nic = netdev_priv(ctx->netdev); struct aq_nic_s *nic = netdev_priv(ctx->netdev);
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
if (netif_carrier_ok(nic->ndev)) if (netif_carrier_ok(nic->ndev))
ret = aq_apply_secy_cfg(nic, ctx->secy); ret = aq_apply_secy_cfg(nic, ctx->secy);
...@@ -306,9 +303,6 @@ static int aq_mdo_dev_stop(struct macsec_context *ctx) ...@@ -306,9 +303,6 @@ static int aq_mdo_dev_stop(struct macsec_context *ctx)
struct aq_nic_s *nic = netdev_priv(ctx->netdev); struct aq_nic_s *nic = netdev_priv(ctx->netdev);
int i; int i;
if (ctx->prepare)
return 0;
for (i = 0; i < AQ_MACSEC_MAX_SC; i++) { for (i = 0; i < AQ_MACSEC_MAX_SC; i++) {
if (nic->macsec_cfg->txsc_idx_busy & BIT(i)) if (nic->macsec_cfg->txsc_idx_busy & BIT(i))
aq_clear_secy(nic, nic->macsec_cfg->aq_txsc[i].sw_secy, aq_clear_secy(nic, nic->macsec_cfg->aq_txsc[i].sw_secy,
...@@ -452,9 +446,6 @@ static int aq_mdo_add_secy(struct macsec_context *ctx) ...@@ -452,9 +446,6 @@ static int aq_mdo_add_secy(struct macsec_context *ctx)
u32 txsc_idx; u32 txsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
if (secy->xpn) if (secy->xpn)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -488,9 +479,6 @@ static int aq_mdo_upd_secy(struct macsec_context *ctx) ...@@ -488,9 +479,6 @@ static int aq_mdo_upd_secy(struct macsec_context *ctx)
int txsc_idx; int txsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy); txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, secy);
if (txsc_idx < 0) if (txsc_idx < 0)
return -ENOENT; return -ENOENT;
...@@ -543,9 +531,6 @@ static int aq_mdo_del_secy(struct macsec_context *ctx) ...@@ -543,9 +531,6 @@ static int aq_mdo_del_secy(struct macsec_context *ctx)
struct aq_nic_s *nic = netdev_priv(ctx->netdev); struct aq_nic_s *nic = netdev_priv(ctx->netdev);
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
if (!nic->macsec_cfg) if (!nic->macsec_cfg)
return 0; return 0;
...@@ -597,9 +582,6 @@ static int aq_mdo_add_txsa(struct macsec_context *ctx) ...@@ -597,9 +582,6 @@ static int aq_mdo_add_txsa(struct macsec_context *ctx)
int txsc_idx; int txsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy); txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy);
if (txsc_idx < 0) if (txsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -627,9 +609,6 @@ static int aq_mdo_upd_txsa(struct macsec_context *ctx) ...@@ -627,9 +609,6 @@ static int aq_mdo_upd_txsa(struct macsec_context *ctx)
int txsc_idx; int txsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy); txsc_idx = aq_get_txsc_idx_from_secy(cfg, secy);
if (txsc_idx < 0) if (txsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -677,9 +656,6 @@ static int aq_mdo_del_txsa(struct macsec_context *ctx) ...@@ -677,9 +656,6 @@ static int aq_mdo_del_txsa(struct macsec_context *ctx)
int txsc_idx; int txsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy); txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy);
if (txsc_idx < 0) if (txsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -773,9 +749,6 @@ static int aq_mdo_add_rxsc(struct macsec_context *ctx) ...@@ -773,9 +749,6 @@ static int aq_mdo_add_rxsc(struct macsec_context *ctx)
u32 rxsc_idx; u32 rxsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
if (hweight32(cfg->rxsc_idx_busy) >= rxsc_idx_max) if (hweight32(cfg->rxsc_idx_busy) >= rxsc_idx_max)
return -ENOSPC; return -ENOSPC;
...@@ -805,9 +778,6 @@ static int aq_mdo_upd_rxsc(struct macsec_context *ctx) ...@@ -805,9 +778,6 @@ static int aq_mdo_upd_rxsc(struct macsec_context *ctx)
int rxsc_idx; int rxsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(nic->macsec_cfg, ctx->rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(nic->macsec_cfg, ctx->rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -ENOENT; return -ENOENT;
...@@ -872,9 +842,6 @@ static int aq_mdo_del_rxsc(struct macsec_context *ctx) ...@@ -872,9 +842,6 @@ static int aq_mdo_del_rxsc(struct macsec_context *ctx)
int rxsc_idx; int rxsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(nic->macsec_cfg, ctx->rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(nic->macsec_cfg, ctx->rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -ENOENT; return -ENOENT;
...@@ -944,9 +911,6 @@ static int aq_mdo_add_rxsa(struct macsec_context *ctx) ...@@ -944,9 +911,6 @@ static int aq_mdo_add_rxsa(struct macsec_context *ctx)
int rxsc_idx; int rxsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(nic->macsec_cfg, rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(nic->macsec_cfg, rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -974,9 +938,6 @@ static int aq_mdo_upd_rxsa(struct macsec_context *ctx) ...@@ -974,9 +938,6 @@ static int aq_mdo_upd_rxsa(struct macsec_context *ctx)
int rxsc_idx; int rxsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -1025,9 +986,6 @@ static int aq_mdo_del_rxsa(struct macsec_context *ctx) ...@@ -1025,9 +986,6 @@ static int aq_mdo_del_rxsa(struct macsec_context *ctx)
int rxsc_idx; int rxsc_idx;
int ret = 0; int ret = 0;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -1044,9 +1002,6 @@ static int aq_mdo_get_dev_stats(struct macsec_context *ctx) ...@@ -1044,9 +1002,6 @@ static int aq_mdo_get_dev_stats(struct macsec_context *ctx)
struct aq_macsec_common_stats *stats = &nic->macsec_cfg->stats; struct aq_macsec_common_stats *stats = &nic->macsec_cfg->stats;
struct aq_hw_s *hw = nic->aq_hw; struct aq_hw_s *hw = nic->aq_hw;
if (ctx->prepare)
return 0;
aq_get_macsec_common_stats(hw, stats); aq_get_macsec_common_stats(hw, stats);
ctx->stats.dev_stats->OutPktsUntagged = stats->out.untagged_pkts; ctx->stats.dev_stats->OutPktsUntagged = stats->out.untagged_pkts;
...@@ -1069,9 +1024,6 @@ static int aq_mdo_get_tx_sc_stats(struct macsec_context *ctx) ...@@ -1069,9 +1024,6 @@ static int aq_mdo_get_tx_sc_stats(struct macsec_context *ctx)
struct aq_macsec_txsc *aq_txsc; struct aq_macsec_txsc *aq_txsc;
int txsc_idx; int txsc_idx;
if (ctx->prepare)
return 0;
txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, ctx->secy); txsc_idx = aq_get_txsc_idx_from_secy(nic->macsec_cfg, ctx->secy);
if (txsc_idx < 0) if (txsc_idx < 0)
return -ENOENT; return -ENOENT;
...@@ -1102,9 +1054,6 @@ static int aq_mdo_get_tx_sa_stats(struct macsec_context *ctx) ...@@ -1102,9 +1054,6 @@ static int aq_mdo_get_tx_sa_stats(struct macsec_context *ctx)
u32 next_pn; u32 next_pn;
int ret; int ret;
if (ctx->prepare)
return 0;
txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy); txsc_idx = aq_get_txsc_idx_from_secy(cfg, ctx->secy);
if (txsc_idx < 0) if (txsc_idx < 0)
return -EINVAL; return -EINVAL;
...@@ -1143,9 +1092,6 @@ static int aq_mdo_get_rx_sc_stats(struct macsec_context *ctx) ...@@ -1143,9 +1092,6 @@ static int aq_mdo_get_rx_sc_stats(struct macsec_context *ctx)
int ret = 0; int ret = 0;
int i; int i;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, ctx->rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, ctx->rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -ENOENT; return -ENOENT;
...@@ -1192,9 +1138,6 @@ static int aq_mdo_get_rx_sa_stats(struct macsec_context *ctx) ...@@ -1192,9 +1138,6 @@ static int aq_mdo_get_rx_sa_stats(struct macsec_context *ctx)
u32 next_pn; u32 next_pn;
int ret; int ret;
if (ctx->prepare)
return 0;
rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, ctx->rx_sc); rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, ctx->rx_sc);
if (rxsc_idx < 0) if (rxsc_idx < 0)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment