master/device.c
changeset 1554 e07a0f8de03d
parent 1521 2180c608e250
child 1851 a56bd34e20a1
equal deleted inserted replaced
1553:4e8d56d6f12a 1554:e07a0f8de03d
   307 
   307 
   308     // set the right length for the data
   308     // set the right length for the data
   309     skb->len = ETH_HLEN + size;
   309     skb->len = ETH_HLEN + size;
   310 
   310 
   311     if (unlikely(device->master->debug_level > 1)) {
   311     if (unlikely(device->master->debug_level > 1)) {
   312         EC_DBG("sending frame:\n");
   312         EC_DBG("Sending frame:\n");
   313         ec_print_data(skb->data + ETH_HLEN, size);
   313         ec_print_data(skb->data, ETH_HLEN + size);
   314     }
   314     }
   315 
   315 
   316     // start sending
   316     // start sending
   317 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
   317 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
   318     if (device->dev->netdev_ops->ndo_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
   318     if (device->dev->netdev_ops->ndo_start_xmit(skb, device->dev) ==
       
   319             NETDEV_TX_OK)
   319 #else
   320 #else
   320     if (device->dev->hard_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
   321     if (device->dev->hard_start_xmit(skb, device->dev) == NETDEV_TX_OK)
   321 #endif
   322 #endif
       
   323     {
   322         device->tx_count++;
   324         device->tx_count++;
   323 #ifdef EC_DEBUG_IF
   325 #ifdef EC_DEBUG_IF
   324         ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);
   326         ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);
   325 #endif
   327 #endif
   326 #ifdef EC_DEBUG_RING
   328 #ifdef EC_DEBUG_RING
   514 
   516 
   515     device->rx_count++;
   517     device->rx_count++;
   516 
   518 
   517     if (unlikely(device->master->debug_level > 1)) {
   519     if (unlikely(device->master->debug_level > 1)) {
   518         EC_DBG("Received frame:\n");
   520         EC_DBG("Received frame:\n");
   519         ec_print_data(ec_data, ec_size);
   521         ec_print_data(data, size);
   520     }
   522     }
   521 
   523 
   522 #ifdef EC_DEBUG_IF
   524 #ifdef EC_DEBUG_IF
   523     ec_debug_send(&device->dbg, data, size);
   525     ec_debug_send(&device->dbg, data, size);
   524 #endif
   526 #endif