Commit 04bad8bd authored by Samuel Mendoza-Jonas's avatar Samuel Mendoza-Jonas Committed by David S. Miller

net/ncsi: Don't return error on normal response

Several response handlers return EBUSY if the data corresponding to the
command/response pair is already set. There is no reason to return an
error here; the channel is advertising something as enabled because we
told it to enable it, and it's possible that the feature has been
enabled previously.
Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ef8690b
...@@ -146,7 +146,7 @@ static int ncsi_rsp_handler_ec(struct ncsi_request *nr) ...@@ -146,7 +146,7 @@ static int ncsi_rsp_handler_ec(struct ncsi_request *nr)
ncm = &nc->modes[NCSI_MODE_ENABLE]; ncm = &nc->modes[NCSI_MODE_ENABLE];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
ncm->enable = 1; ncm->enable = 1;
return 0; return 0;
...@@ -173,7 +173,7 @@ static int ncsi_rsp_handler_dc(struct ncsi_request *nr) ...@@ -173,7 +173,7 @@ static int ncsi_rsp_handler_dc(struct ncsi_request *nr)
ncm = &nc->modes[NCSI_MODE_ENABLE]; ncm = &nc->modes[NCSI_MODE_ENABLE];
if (!ncm->enable) if (!ncm->enable)
return -EBUSY; return 0;
ncm->enable = 0; ncm->enable = 0;
return 0; return 0;
...@@ -217,7 +217,7 @@ static int ncsi_rsp_handler_ecnt(struct ncsi_request *nr) ...@@ -217,7 +217,7 @@ static int ncsi_rsp_handler_ecnt(struct ncsi_request *nr)
ncm = &nc->modes[NCSI_MODE_TX_ENABLE]; ncm = &nc->modes[NCSI_MODE_TX_ENABLE];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
ncm->enable = 1; ncm->enable = 1;
return 0; return 0;
...@@ -239,7 +239,7 @@ static int ncsi_rsp_handler_dcnt(struct ncsi_request *nr) ...@@ -239,7 +239,7 @@ static int ncsi_rsp_handler_dcnt(struct ncsi_request *nr)
ncm = &nc->modes[NCSI_MODE_TX_ENABLE]; ncm = &nc->modes[NCSI_MODE_TX_ENABLE];
if (!ncm->enable) if (!ncm->enable)
return -EBUSY; return 0;
ncm->enable = 1; ncm->enable = 1;
return 0; return 0;
...@@ -263,7 +263,7 @@ static int ncsi_rsp_handler_ae(struct ncsi_request *nr) ...@@ -263,7 +263,7 @@ static int ncsi_rsp_handler_ae(struct ncsi_request *nr)
/* Check if the AEN has been enabled */ /* Check if the AEN has been enabled */
ncm = &nc->modes[NCSI_MODE_AEN]; ncm = &nc->modes[NCSI_MODE_AEN];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
/* Update to AEN configuration */ /* Update to AEN configuration */
cmd = (struct ncsi_cmd_ae_pkt *)skb_network_header(nr->cmd); cmd = (struct ncsi_cmd_ae_pkt *)skb_network_header(nr->cmd);
...@@ -382,7 +382,7 @@ static int ncsi_rsp_handler_ev(struct ncsi_request *nr) ...@@ -382,7 +382,7 @@ static int ncsi_rsp_handler_ev(struct ncsi_request *nr)
/* Check if VLAN mode has been enabled */ /* Check if VLAN mode has been enabled */
ncm = &nc->modes[NCSI_MODE_VLAN]; ncm = &nc->modes[NCSI_MODE_VLAN];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
/* Update to VLAN mode */ /* Update to VLAN mode */
cmd = (struct ncsi_cmd_ev_pkt *)skb_network_header(nr->cmd); cmd = (struct ncsi_cmd_ev_pkt *)skb_network_header(nr->cmd);
...@@ -409,7 +409,7 @@ static int ncsi_rsp_handler_dv(struct ncsi_request *nr) ...@@ -409,7 +409,7 @@ static int ncsi_rsp_handler_dv(struct ncsi_request *nr)
/* Check if VLAN mode has been enabled */ /* Check if VLAN mode has been enabled */
ncm = &nc->modes[NCSI_MODE_VLAN]; ncm = &nc->modes[NCSI_MODE_VLAN];
if (!ncm->enable) if (!ncm->enable)
return -EBUSY; return 0;
/* Update to VLAN mode */ /* Update to VLAN mode */
ncm->enable = 0; ncm->enable = 0;
...@@ -455,13 +455,10 @@ static int ncsi_rsp_handler_sma(struct ncsi_request *nr) ...@@ -455,13 +455,10 @@ static int ncsi_rsp_handler_sma(struct ncsi_request *nr)
bitmap = &ncf->bitmap; bitmap = &ncf->bitmap;
if (cmd->at_e & 0x1) { if (cmd->at_e & 0x1) {
if (test_and_set_bit(cmd->index, bitmap)) set_bit(cmd->index, bitmap);
return -EBUSY;
memcpy(ncf->data + 6 * cmd->index, cmd->mac, 6); memcpy(ncf->data + 6 * cmd->index, cmd->mac, 6);
} else { } else {
if (!test_and_clear_bit(cmd->index, bitmap)) clear_bit(cmd->index, bitmap);
return -EBUSY;
memset(ncf->data + 6 * cmd->index, 0, 6); memset(ncf->data + 6 * cmd->index, 0, 6);
} }
...@@ -485,7 +482,7 @@ static int ncsi_rsp_handler_ebf(struct ncsi_request *nr) ...@@ -485,7 +482,7 @@ static int ncsi_rsp_handler_ebf(struct ncsi_request *nr)
/* Check if broadcast filter has been enabled */ /* Check if broadcast filter has been enabled */
ncm = &nc->modes[NCSI_MODE_BC]; ncm = &nc->modes[NCSI_MODE_BC];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
/* Update to broadcast filter mode */ /* Update to broadcast filter mode */
cmd = (struct ncsi_cmd_ebf_pkt *)skb_network_header(nr->cmd); cmd = (struct ncsi_cmd_ebf_pkt *)skb_network_header(nr->cmd);
...@@ -511,7 +508,7 @@ static int ncsi_rsp_handler_dbf(struct ncsi_request *nr) ...@@ -511,7 +508,7 @@ static int ncsi_rsp_handler_dbf(struct ncsi_request *nr)
/* Check if broadcast filter isn't enabled */ /* Check if broadcast filter isn't enabled */
ncm = &nc->modes[NCSI_MODE_BC]; ncm = &nc->modes[NCSI_MODE_BC];
if (!ncm->enable) if (!ncm->enable)
return -EBUSY; return 0;
/* Update to broadcast filter mode */ /* Update to broadcast filter mode */
ncm->enable = 0; ncm->enable = 0;
...@@ -538,7 +535,7 @@ static int ncsi_rsp_handler_egmf(struct ncsi_request *nr) ...@@ -538,7 +535,7 @@ static int ncsi_rsp_handler_egmf(struct ncsi_request *nr)
/* Check if multicast filter has been enabled */ /* Check if multicast filter has been enabled */
ncm = &nc->modes[NCSI_MODE_MC]; ncm = &nc->modes[NCSI_MODE_MC];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
/* Update to multicast filter mode */ /* Update to multicast filter mode */
cmd = (struct ncsi_cmd_egmf_pkt *)skb_network_header(nr->cmd); cmd = (struct ncsi_cmd_egmf_pkt *)skb_network_header(nr->cmd);
...@@ -564,7 +561,7 @@ static int ncsi_rsp_handler_dgmf(struct ncsi_request *nr) ...@@ -564,7 +561,7 @@ static int ncsi_rsp_handler_dgmf(struct ncsi_request *nr)
/* Check if multicast filter has been enabled */ /* Check if multicast filter has been enabled */
ncm = &nc->modes[NCSI_MODE_MC]; ncm = &nc->modes[NCSI_MODE_MC];
if (!ncm->enable) if (!ncm->enable)
return -EBUSY; return 0;
/* Update to multicast filter mode */ /* Update to multicast filter mode */
ncm->enable = 0; ncm->enable = 0;
...@@ -591,7 +588,7 @@ static int ncsi_rsp_handler_snfc(struct ncsi_request *nr) ...@@ -591,7 +588,7 @@ static int ncsi_rsp_handler_snfc(struct ncsi_request *nr)
/* Check if flow control has been enabled */ /* Check if flow control has been enabled */
ncm = &nc->modes[NCSI_MODE_FC]; ncm = &nc->modes[NCSI_MODE_FC];
if (ncm->enable) if (ncm->enable)
return -EBUSY; return 0;
/* Update to flow control mode */ /* Update to flow control mode */
cmd = (struct ncsi_cmd_snfc_pkt *)skb_network_header(nr->cmd); cmd = (struct ncsi_cmd_snfc_pkt *)skb_network_header(nr->cmd);
......
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