slave.c (d0006b002208936d36af8e4dce1f6dfeebb2dfba) | slave.c (f8b8b1cd5aadd221742b45eb0ee3c8a80abf036a) |
---|---|
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. --- 1109 unchanged lines hidden (view full) --- 1118 }; 1119 1120 call_dsa_notifiers(val, dev, &rinfo.info); 1121} 1122 1123int dsa_slave_create(struct dsa_port *port, const char *name) 1124{ 1125 struct dsa_port *cpu_dp = port->cpu_dp; | 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. --- 1109 unchanged lines hidden (view full) --- 1118 }; 1119 1120 call_dsa_notifiers(val, dev, &rinfo.info); 1121} 1122 1123int dsa_slave_create(struct dsa_port *port, const char *name) 1124{ 1125 struct dsa_port *cpu_dp = port->cpu_dp; |
1126 struct net_device *master = cpu_dp->netdev; | 1126 struct net_device *master = cpu_dp->master; |
1127 struct dsa_switch *ds = port->ds; 1128 struct net_device *slave_dev; 1129 struct dsa_slave_priv *p; 1130 int ret; 1131 1132 if (!ds->num_tx_queues) 1133 ds->num_tx_queues = 1; 1134 --- 30 unchanged lines hidden (view full) --- 1165 p->dp = port; 1166 INIT_LIST_HEAD(&p->mall_tc_list); 1167 p->xmit = cpu_dp->tag_ops->xmit; 1168 1169 p->old_pause = -1; 1170 p->old_link = -1; 1171 p->old_duplex = -1; 1172 | 1127 struct dsa_switch *ds = port->ds; 1128 struct net_device *slave_dev; 1129 struct dsa_slave_priv *p; 1130 int ret; 1131 1132 if (!ds->num_tx_queues) 1133 ds->num_tx_queues = 1; 1134 --- 30 unchanged lines hidden (view full) --- 1165 p->dp = port; 1166 INIT_LIST_HEAD(&p->mall_tc_list); 1167 p->xmit = cpu_dp->tag_ops->xmit; 1168 1169 p->old_pause = -1; 1170 p->old_link = -1; 1171 p->old_duplex = -1; 1172 |
1173 port->netdev = slave_dev; | 1173 port->slave = slave_dev; |
1174 1175 netif_carrier_off(slave_dev); 1176 1177 ret = dsa_slave_phy_setup(slave_dev); 1178 if (ret) { 1179 netdev_err(master, "error %d setting up slave phy\n", ret); 1180 goto out_free; 1181 } --- 11 unchanged lines hidden (view full) --- 1193 1194out_phy: 1195 phy_disconnect(slave_dev->phydev); 1196 if (of_phy_is_fixed_link(port->dn)) 1197 of_phy_deregister_fixed_link(port->dn); 1198out_free: 1199 free_percpu(p->stats64); 1200 free_netdev(slave_dev); | 1174 1175 netif_carrier_off(slave_dev); 1176 1177 ret = dsa_slave_phy_setup(slave_dev); 1178 if (ret) { 1179 netdev_err(master, "error %d setting up slave phy\n", ret); 1180 goto out_free; 1181 } --- 11 unchanged lines hidden (view full) --- 1193 1194out_phy: 1195 phy_disconnect(slave_dev->phydev); 1196 if (of_phy_is_fixed_link(port->dn)) 1197 of_phy_deregister_fixed_link(port->dn); 1198out_free: 1199 free_percpu(p->stats64); 1200 free_netdev(slave_dev); |
1201 port->netdev = NULL; | 1201 port->slave = NULL; |
1202 return ret; 1203} 1204 1205void dsa_slave_destroy(struct net_device *slave_dev) 1206{ 1207 struct dsa_port *dp = dsa_slave_to_port(slave_dev); 1208 struct dsa_slave_priv *p = netdev_priv(slave_dev); 1209 struct device_node *port_dn = dp->dn; --- 192 unchanged lines hidden --- | 1202 return ret; 1203} 1204 1205void dsa_slave_destroy(struct net_device *slave_dev) 1206{ 1207 struct dsa_port *dp = dsa_slave_to_port(slave_dev); 1208 struct dsa_slave_priv *p = netdev_priv(slave_dev); 1209 struct device_node *port_dn = dp->dn; --- 192 unchanged lines hidden --- |