On 13/02/14 09:17, Antonio Quartulli wrote:
On 11/02/14 13:48, Antonio Quartulli wrote:
@@ -297,6 +299,7 @@ void batadv_update_min_mtu(struct net_device *soft_iface) static void batadv_hardif_activate_interface(struct batadv_hard_iface *hard_iface) {
- struct net_device *dev = hard_iface->net_dev; struct batadv_priv *bat_priv; struct batadv_hard_iface *primary_if = NULL;
@@ -315,6 +318,22 @@ batadv_hardif_activate_interface(struct batadv_hard_iface *hard_iface) if (!primary_if) batadv_primary_if_select(bat_priv, hard_iface);
- /* set the default values */
- hard_iface->bat_v.flags &= ~BATADV_FULL_DUPLEX;
- hard_iface->bat_v.eth_throughput = 0;
- if (dev->phydev) {
if (dev->phydev->duplex == DUPLEX_FULL)
hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX;
/* set the speed according to the phydev setting. Store the
* value in Kbps (as done for the other throughput variables)
*/
And of course this is not Kbps but Mbps/10 (like everywhere else)..
if (dev->phydev->speed != SPEED_UNKNOWN) {
hard_iface->bat_v.eth_throughput = dev->phydev->speed;
hard_iface->bat_v.eth_throughput *= 10;
}
- }
For the record: I just moved this chunk into a proper bat_algo_ops->bat_iface_activate() API.
This initialisation is obviously B.A.T.M.A.N. V specific and cannot live in the batadv_hardif_activate_interface() function.
Cheers,