master/device.c
changeset 1305 de3fcbb6773e
parent 1040 d2527675cdd5
child 1313 ed15eef57d5c
equal deleted inserted replaced
1304:853c83c72f44 1305:de3fcbb6773e
   168     for (i = 0; i < EC_TX_RING_SIZE; i++) {
   168     for (i = 0; i < EC_TX_RING_SIZE; i++) {
   169         device->tx_skb[i]->dev = net_dev;
   169         device->tx_skb[i]->dev = net_dev;
   170         eth = (struct ethhdr *) (device->tx_skb[i]->data);
   170         eth = (struct ethhdr *) (device->tx_skb[i]->data);
   171         memcpy(eth->h_source, net_dev->dev_addr, ETH_ALEN);
   171         memcpy(eth->h_source, net_dev->dev_addr, ETH_ALEN);
   172     }
   172     }
       
   173 
       
   174 #ifdef EC_DEBUG_IF
       
   175     ec_debug_register(&device->dbg, net_dev);
       
   176 #endif
   173 }
   177 }
   174 
   178 
   175 /*****************************************************************************/
   179 /*****************************************************************************/
   176 
   180 
   177 /** Disconnect from net_device.
   181 /** Disconnect from net_device.
   179 void ec_device_detach(
   183 void ec_device_detach(
   180         ec_device_t *device /**< EtherCAT device */
   184         ec_device_t *device /**< EtherCAT device */
   181         )
   185         )
   182 {
   186 {
   183     unsigned int i;
   187     unsigned int i;
       
   188 
       
   189 #ifdef EC_DEBUG_IF
       
   190     ec_debug_unregister(&device->dbg);
       
   191 #endif
   184 
   192 
   185     device->dev = NULL;
   193     device->dev = NULL;
   186     device->poll = NULL;
   194     device->poll = NULL;
   187     device->module = NULL;
   195     device->module = NULL;
   188     device->open = 0;
   196     device->open = 0;