master/ethernet.c
changeset 712 14f899ac51f0
parent 689 880b556a6efc
child 719 03d5b96632fb
equal deleted inserted replaced
711:a36f48ff2ba0 712:14f899ac51f0
   115     eoe->tx_counter = 0;
   115     eoe->tx_counter = 0;
   116     eoe->rx_rate = 0;
   116     eoe->rx_rate = 0;
   117     eoe->tx_rate = 0;
   117     eoe->tx_rate = 0;
   118     eoe->rate_jiffies = 0;
   118     eoe->rate_jiffies = 0;
   119 
   119 
   120     /* device name eoe<MASTER>s<SLAVE>, because system tools don't like
   120     /* device name eoe<MASTER>[as]<SLAVE>, because networking scripts don't
   121      * hyphens etc. in interface names. */
   121      * like hyphens etc. in interface names. */
   122     sprintf(name, "eoe%us%u", slave->master->index, slave->ring_position);
   122     if (slave->sii_alias) {
       
   123         sprintf(name, "eoe%ua%u", slave->master->index, slave->sii_alias);
       
   124     } else {
       
   125         sprintf(name, "eoe%us%u", slave->master->index, slave->ring_position);
       
   126     }
   123 
   127 
   124     if (!(eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup))) {
   128     if (!(eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup))) {
   125         EC_ERR("Unable to allocate net_device for EoE handler!\n");
   129         EC_ERR("Unable to allocate net_device %s for EoE handler!\n", name);
   126         goto out_return;
   130         goto out_return;
   127     }
   131     }
   128 
   132 
   129     // initialize net_device
   133     // initialize net_device
   130     eoe->dev->open = ec_eoedev_open;
   134     eoe->dev->open = ec_eoedev_open;