Commit 69f5df49 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

switchdev: rename "trans" to "trans_ph".

This is temporary, name "trans" will be used for something else and
"trans_ph" will eventually disappear.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aee2f545
This diff is collapsed.
......@@ -16,7 +16,7 @@
#define SWITCHDEV_F_NO_RECURSE BIT(0)
enum switchdev_trans {
enum switchdev_trans_ph {
SWITCHDEV_TRANS_NONE,
SWITCHDEV_TRANS_PREPARE,
SWITCHDEV_TRANS_ABORT,
......@@ -32,7 +32,7 @@ enum switchdev_attr_id {
struct switchdev_attr {
enum switchdev_attr_id id;
enum switchdev_trans trans;
enum switchdev_trans_ph trans_ph;
u32 flags;
union {
struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */
......@@ -52,7 +52,7 @@ enum switchdev_obj_id {
struct switchdev_obj {
enum switchdev_obj_id id;
enum switchdev_trans trans;
enum switchdev_trans_ph trans_ph;
int (*cb)(struct net_device *dev, struct switchdev_obj *obj);
union {
struct switchdev_obj_vlan { /* PORT_VLAN */
......
......@@ -250,7 +250,7 @@ static int dsa_slave_port_vlan_add(struct net_device *dev,
u16 vid;
int err;
switch (obj->trans) {
switch (obj->trans_ph) {
case SWITCHDEV_TRANS_PREPARE:
if (!ds->drv->port_vlan_add || !ds->drv->port_pvid_set)
return -EOPNOTSUPP;
......@@ -354,9 +354,9 @@ static int dsa_slave_port_fdb_add(struct net_device *dev,
struct dsa_switch *ds = p->parent;
int ret = -EOPNOTSUPP;
if (obj->trans == SWITCHDEV_TRANS_PREPARE)
if (obj->trans_ph == SWITCHDEV_TRANS_PREPARE)
ret = ds->drv->port_fdb_add ? 0 : -EOPNOTSUPP;
else if (obj->trans == SWITCHDEV_TRANS_COMMIT)
else if (obj->trans_ph == SWITCHDEV_TRANS_COMMIT)
ret = ds->drv->port_fdb_add(ds, p->port, fdb->addr, fdb->vid);
return ret;
......@@ -462,7 +462,7 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
switch (attr->id) {
case SWITCHDEV_ATTR_PORT_STP_STATE:
if (attr->trans == SWITCHDEV_TRANS_COMMIT)
if (attr->trans_ph == SWITCHDEV_TRANS_COMMIT)
ret = dsa_slave_stp_update(dev, attr->u.stp_state);
break;
default:
......
......@@ -163,7 +163,7 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
* but should not commit the attr.
*/
attr->trans = SWITCHDEV_TRANS_PREPARE;
attr->trans_ph = SWITCHDEV_TRANS_PREPARE;
err = __switchdev_port_attr_set(dev, attr);
if (err) {
/* Prepare phase failed: abort the transaction. Any
......@@ -172,7 +172,7 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
*/
if (err != -EOPNOTSUPP) {
attr->trans = SWITCHDEV_TRANS_ABORT;
attr->trans_ph = SWITCHDEV_TRANS_ABORT;
__switchdev_port_attr_set(dev, attr);
}
......@@ -184,7 +184,7 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
* because the driver said everythings was OK in phase I.
*/
attr->trans = SWITCHDEV_TRANS_COMMIT;
attr->trans_ph = SWITCHDEV_TRANS_COMMIT;
err = __switchdev_port_attr_set(dev, attr);
WARN(err, "%s: Commit of attribute (id=%d) failed.\n",
dev->name, attr->id);
......@@ -243,7 +243,7 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
* but should not commit the obj.
*/
obj->trans = SWITCHDEV_TRANS_PREPARE;
obj->trans_ph = SWITCHDEV_TRANS_PREPARE;
err = __switchdev_port_obj_add(dev, obj);
if (err) {
/* Prepare phase failed: abort the transaction. Any
......@@ -252,7 +252,7 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
*/
if (err != -EOPNOTSUPP) {
obj->trans = SWITCHDEV_TRANS_ABORT;
obj->trans_ph = SWITCHDEV_TRANS_ABORT;
__switchdev_port_obj_add(dev, obj);
}
......@@ -264,7 +264,7 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
* because the driver said everythings was OK in phase I.
*/
obj->trans = SWITCHDEV_TRANS_COMMIT;
obj->trans_ph = SWITCHDEV_TRANS_COMMIT;
err = __switchdev_port_obj_add(dev, obj);
WARN(err, "%s: Commit of object (id=%d) failed.\n", dev->name, obj->id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment