ethernet: w5500: use bit fielding number for mode

bit field access with WRITE_BIT needs bit number, not the
value after BIT(mr).

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
This commit is contained in:
Parthiban Nallathambi 2020-10-23 15:06:59 +02:00 committed by Anas Nashif
parent 5376d44df7
commit 9a581642d1
2 changed files with 3 additions and 3 deletions

View file

@ -346,14 +346,14 @@ static int w5500_set_config(const struct device *dev,
if (IS_ENABLED(CONFIG_NET_PROMISCUOUS_MODE) &&
type == ETHERNET_CONFIG_TYPE_PROMISC_MODE) {
if (config->promisc_mode) {
if (!(mode & W5500_S0_MR_MF))
if (!(mode & BIT(mr)))
return -EALREADY;
}
/* clear */
WRITE_BIT(mode, mr, 0);
} else {
if (mode & mr) {
if (mode & BIT(mr)) {
return -EALREADY;
}

View file

@ -55,7 +55,7 @@
#define W5500_S0_RX_RD (W5500_S0_REGS + W5500_Sn_RX_RD)
#define W5500_S0_IMR (W5500_S0_REGS + W5500_Sn_IMR)
#define W5500_S0_MR_MF BIT(7) /* MAC Filter for W5500 */
#define W5500_S0_MR_MF 7 /* MAC Filter for W5500 */
#define W5500_Sn_REGS_LEN 0x0040
#define W5500_SIMR 0x0018 /* Socket Interrupt Mask Register */
#define IR_S0 0x01