Skip to content

Commit d83b8aa

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: davinci_emac: Fix incorrect masking of tx and rx error channel
The bit-masks used for the TXERRCH and RXERRCH (tx and rx error channels) are incorrect and always lead to a zero result. The mask values are currently the incorrect post-right shifted values, fix this by setting them to the currect values. (I double checked these against the TMS320TCI6482 data sheet, section 5.30, page 127 to ensure I had the correct mask values for the TXERRCH and RXERRCH fields in the MACSTATUS register). Addresses-Coverity: ("Operands don't affect result") Fixes: a6286ee ("net: Add TI DaVinci EMAC driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3339804 commit d83b8aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/ti/davinci_emac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1";
169169
/* EMAC mac_status register */
170170
#define EMAC_MACSTATUS_TXERRCODE_MASK (0xF00000)
171171
#define EMAC_MACSTATUS_TXERRCODE_SHIFT (20)
172-
#define EMAC_MACSTATUS_TXERRCH_MASK (0x7)
172+
#define EMAC_MACSTATUS_TXERRCH_MASK (0x70000)
173173
#define EMAC_MACSTATUS_TXERRCH_SHIFT (16)
174174
#define EMAC_MACSTATUS_RXERRCODE_MASK (0xF000)
175175
#define EMAC_MACSTATUS_RXERRCODE_SHIFT (12)
176-
#define EMAC_MACSTATUS_RXERRCH_MASK (0x7)
176+
#define EMAC_MACSTATUS_RXERRCH_MASK (0x700)
177177
#define EMAC_MACSTATUS_RXERRCH_SHIFT (8)
178178

179179
/* EMAC RX register masks */

0 commit comments

Comments
 (0)