slave.c (eef50d466a47bb6a57f2e55a9415c716c463255b) | slave.c (b8d866ac6aa45147b84f3f67b124b82bee675e9f) |
---|---|
1/* 2 * net/dsa/slave.c - Slave device handling 3 * Copyright (c) 2008-2009 Marvell Semiconductor 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 439 unchanged lines hidden (view full) --- 448 449 return ret; 450} 451 452static int dsa_slave_port_attr_set(struct net_device *dev, 453 struct switchdev_attr *attr, 454 struct switchdev_trans *trans) 455{ | 1/* 2 * net/dsa/slave.c - Slave device handling 3 * Copyright (c) 2008-2009 Marvell Semiconductor 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 439 unchanged lines hidden (view full) --- 448 449 return ret; 450} 451 452static int dsa_slave_port_attr_set(struct net_device *dev, 453 struct switchdev_attr *attr, 454 struct switchdev_trans *trans) 455{ |
456 int ret = 0; | 456 struct dsa_slave_priv *p = netdev_priv(dev); 457 struct dsa_switch *ds = p->parent; 458 int ret; |
457 458 switch (attr->id) { 459 case SWITCHDEV_ATTR_PORT_STP_STATE: | 459 460 switch (attr->id) { 461 case SWITCHDEV_ATTR_PORT_STP_STATE: |
460 if (switchdev_trans_ph_commit(trans)) 461 ret = dsa_slave_stp_update(dev, attr->u.stp_state); | 462 if (switchdev_trans_ph_prepare(trans)) 463 ret = ds->drv->port_stp_update ? 0 : -EOPNOTSUPP; 464 else 465 ret = ds->drv->port_stp_update(ds, p->port, 466 attr->u.stp_state); |
462 break; 463 default: 464 ret = -EOPNOTSUPP; 465 break; 466 } 467 468 return ret; 469} --- 792 unchanged lines hidden --- | 467 break; 468 default: 469 ret = -EOPNOTSUPP; 470 break; 471 } 472 473 return ret; 474} --- 792 unchanged lines hidden --- |