aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-28 02:18:41 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-28 19:49:49 -0400
commit8579a67e139b77a6881c405f9272afb9a7891201 (patch)
tree1688e5e775ca29ed9eb89b56b2c1a4e6c5c12b2c
parenta74e344a996406b0617b7f4eb28181bdf77684ac (diff)
net/ncsi: Fix several packet definitions
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ncsi/ncsi-cmd.c10
-rw-r--r--net/ncsi/ncsi-pkt.h2
-rw-r--r--net/ncsi/ncsi-rsp.c3
3 files changed, 8 insertions, 7 deletions
diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c
index 5e03ed190e18..7567ca63aae2 100644
--- a/net/ncsi/ncsi-cmd.c
+++ b/net/ncsi/ncsi-cmd.c
@@ -139,9 +139,9 @@ static int ncsi_cmd_handler_svf(struct sk_buff *skb,
139 struct ncsi_cmd_svf_pkt *cmd; 139 struct ncsi_cmd_svf_pkt *cmd;
140 140
141 cmd = skb_put_zero(skb, sizeof(*cmd)); 141 cmd = skb_put_zero(skb, sizeof(*cmd));
142 cmd->vlan = htons(nca->words[0]); 142 cmd->vlan = htons(nca->words[1]);
143 cmd->index = nca->bytes[2]; 143 cmd->index = nca->bytes[6];
144 cmd->enable = nca->bytes[3]; 144 cmd->enable = nca->bytes[7];
145 ncsi_cmd_build_header(&cmd->cmd.common, nca); 145 ncsi_cmd_build_header(&cmd->cmd.common, nca);
146 146
147 return 0; 147 return 0;
@@ -153,7 +153,7 @@ static int ncsi_cmd_handler_ev(struct sk_buff *skb,
153 struct ncsi_cmd_ev_pkt *cmd; 153 struct ncsi_cmd_ev_pkt *cmd;
154 154
155 cmd = skb_put_zero(skb, sizeof(*cmd)); 155 cmd = skb_put_zero(skb, sizeof(*cmd));
156 cmd->mode = nca->bytes[0]; 156 cmd->mode = nca->bytes[3];
157 ncsi_cmd_build_header(&cmd->cmd.common, nca); 157 ncsi_cmd_build_header(&cmd->cmd.common, nca);
158 158
159 return 0; 159 return 0;
@@ -228,7 +228,7 @@ static struct ncsi_cmd_handler {
228 { NCSI_PKT_CMD_AE, 8, ncsi_cmd_handler_ae }, 228 { NCSI_PKT_CMD_AE, 8, ncsi_cmd_handler_ae },
229 { NCSI_PKT_CMD_SL, 8, ncsi_cmd_handler_sl }, 229 { NCSI_PKT_CMD_SL, 8, ncsi_cmd_handler_sl },
230 { NCSI_PKT_CMD_GLS, 0, ncsi_cmd_handler_default }, 230 { NCSI_PKT_CMD_GLS, 0, ncsi_cmd_handler_default },
231 { NCSI_PKT_CMD_SVF, 4, ncsi_cmd_handler_svf }, 231 { NCSI_PKT_CMD_SVF, 8, ncsi_cmd_handler_svf },
232 { NCSI_PKT_CMD_EV, 4, ncsi_cmd_handler_ev }, 232 { NCSI_PKT_CMD_EV, 4, ncsi_cmd_handler_ev },
233 { NCSI_PKT_CMD_DV, 0, ncsi_cmd_handler_default }, 233 { NCSI_PKT_CMD_DV, 0, ncsi_cmd_handler_default },
234 { NCSI_PKT_CMD_SMA, 8, ncsi_cmd_handler_sma }, 234 { NCSI_PKT_CMD_SMA, 8, ncsi_cmd_handler_sma },
diff --git a/net/ncsi/ncsi-pkt.h b/net/ncsi/ncsi-pkt.h
index 3ea49ed0a935..91b4b66438df 100644
--- a/net/ncsi/ncsi-pkt.h
+++ b/net/ncsi/ncsi-pkt.h
@@ -104,7 +104,7 @@ struct ncsi_cmd_svf_pkt {
104 unsigned char index; /* VLAN table index */ 104 unsigned char index; /* VLAN table index */
105 unsigned char enable; /* Enable or disable */ 105 unsigned char enable; /* Enable or disable */
106 __be32 checksum; /* Checksum */ 106 __be32 checksum; /* Checksum */
107 unsigned char pad[14]; 107 unsigned char pad[18];
108}; 108};
109 109
110/* Enable VLAN */ 110/* Enable VLAN */
diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c
index 087db775b3dc..c1a191d790e2 100644
--- a/net/ncsi/ncsi-rsp.c
+++ b/net/ncsi/ncsi-rsp.c
@@ -354,7 +354,8 @@ static int ncsi_rsp_handler_svf(struct ncsi_request *nr)
354 354
355 /* Add or remove the VLAN filter */ 355 /* Add or remove the VLAN filter */
356 if (!(cmd->enable & 0x1)) { 356 if (!(cmd->enable & 0x1)) {
357 ret = ncsi_remove_filter(nc, NCSI_FILTER_VLAN, cmd->index); 357 /* HW indexes from 1 */
358 ret = ncsi_remove_filter(nc, NCSI_FILTER_VLAN, cmd->index - 1);
358 } else { 359 } else {
359 vlan = ntohs(cmd->vlan); 360 vlan = ntohs(cmd->vlan);
360 ret = ncsi_add_filter(nc, NCSI_FILTER_VLAN, &vlan); 361 ret = ncsi_add_filter(nc, NCSI_FILTER_VLAN, &vlan);