aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@emulex.com>2011-03-21 16:49:26 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-31 00:39:20 -0400
commit15d721847f56f32fe9fd43d34db1b32b13de78dc (patch)
tree989e8459123a44907e6ac558abc5c22621f44d24 /drivers/net/benet
parentac6a0c4aab16070d7d55f49a52de33f716ae1d3d (diff)
be2net: parse vid and vtm fields of rx-compl only if vlanf bit is set
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 7a5d6a308051..6616300f6070 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1101,8 +1101,12 @@ static void be_parse_rx_compl_v1(struct be_adapter *adapter,
1101 AMAP_GET_BITS(struct amap_eth_rx_compl_v1, numfrags, compl); 1101 AMAP_GET_BITS(struct amap_eth_rx_compl_v1, numfrags, compl);
1102 rxcp->pkt_type = 1102 rxcp->pkt_type =
1103 AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl); 1103 AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl);
1104 rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm, compl); 1104 if (rxcp->vlanf) {
1105 rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vlan_tag, compl); 1105 rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm,
1106 compl);
1107 rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vlan_tag,
1108 compl);
1109 }
1106} 1110}
1107 1111
1108static void be_parse_rx_compl_v0(struct be_adapter *adapter, 1112static void be_parse_rx_compl_v0(struct be_adapter *adapter,
@@ -1127,8 +1131,12 @@ static void be_parse_rx_compl_v0(struct be_adapter *adapter,
1127 AMAP_GET_BITS(struct amap_eth_rx_compl_v0, numfrags, compl); 1131 AMAP_GET_BITS(struct amap_eth_rx_compl_v0, numfrags, compl);
1128 rxcp->pkt_type = 1132 rxcp->pkt_type =
1129 AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl); 1133 AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl);
1130 rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm, compl); 1134 if (rxcp->vlanf) {
1131 rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vlan_tag, compl); 1135 rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm,
1136 compl);
1137 rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vlan_tag,
1138 compl);
1139 }
1132} 1140}
1133 1141
1134static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) 1142static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
@@ -1150,15 +1158,19 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
1150 else 1158 else
1151 be_parse_rx_compl_v0(adapter, compl, rxcp); 1159 be_parse_rx_compl_v0(adapter, compl, rxcp);
1152 1160
1153 /* vlanf could be wrongly set in some cards. ignore if vtm is not set */ 1161 if (rxcp->vlanf) {
1154 if ((adapter->function_mode & 0x400) && !rxcp->vtm) 1162 /* vlanf could be wrongly set in some cards.
1155 rxcp->vlanf = 0; 1163 * ignore if vtm is not set */
1164 if ((adapter->function_mode & 0x400) && !rxcp->vtm)
1165 rxcp->vlanf = 0;
1156 1166
1157 if (!lancer_chip(adapter)) 1167 if (!lancer_chip(adapter))
1158 rxcp->vid = swab16(rxcp->vid); 1168 rxcp->vid = swab16(rxcp->vid);
1159 1169
1160 if ((adapter->pvid == rxcp->vid) && !adapter->vlan_tag[rxcp->vid]) 1170 if ((adapter->pvid == rxcp->vid) &&
1161 rxcp->vlanf = 0; 1171 !adapter->vlan_tag[rxcp->vid])
1172 rxcp->vlanf = 0;
1173 }
1162 1174
1163 /* As the compl has been parsed, reset it; we wont touch it again */ 1175 /* As the compl has been parsed, reset it; we wont touch it again */
1164 compl->dw[offsetof(struct amap_eth_rx_compl_v1, valid) / 32] = 0; 1176 compl->dw[offsetof(struct amap_eth_rx_compl_v1, valid) / 32] = 0;