struct rocker_desc_info *desc_info,
void *priv)
{
+ bool learning = *(bool *)priv;
struct rocker_tlv *cmd_info;
if (rocker_tlv_put_u16(desc_info, ROCKER_TLV_CMD_TYPE,
rocker_port->pport))
return -EMSGSIZE;
if (rocker_tlv_put_u8(desc_info, ROCKER_TLV_CMD_PORT_SETTINGS_LEARNING,
- !!(rocker_port->brport_flags & BR_LEARNING)))
+ learning))
return -EMSGSIZE;
rocker_tlv_nest_end(desc_info, cmd_info);
return 0;
}
static int rocker_port_set_learning(struct rocker_port *rocker_port,
- struct switchdev_trans *trans)
+ struct switchdev_trans *trans,
+ bool learning)
{
return rocker_cmd_exec(rocker_port, trans, 0,
rocker_cmd_set_port_learning_prep,
- NULL, NULL, NULL);
+ &learning, NULL, NULL);
}
/**********************
orig_flags = rocker_port->brport_flags;
rocker_port->brport_flags = brport_flags;
if ((orig_flags ^ rocker_port->brport_flags) & BR_LEARNING)
- err = rocker_port_set_learning(rocker_port, trans);
+ err = rocker_port_set_learning(rocker_port, trans,
+ !!(rocker_port->brport_flags & BR_LEARNING));
if (switchdev_trans_ph_prepare(trans))
rocker_port->brport_flags = orig_flags;
switchdev_port_fwd_mark_set(rocker_port->dev, NULL, false);
- rocker_port_set_learning(rocker_port, NULL);
+ rocker_port_set_learning(rocker_port, NULL,
+ !!(rocker_port->brport_flags & BR_LEARNING));
err = rocker_port_ig_tbl(rocker_port, NULL, 0);
if (err) {