master/ethernet.c
branch1.4-foe
changeset 1711 2b017fcc1c6d
parent 1709 63e4bc918640
child 1713 df6cdc79ea56
equal deleted inserted replaced
1710:4522459bb5a4 1711:2b017fcc1c6d
   144     // Usually setting the MTU appropriately makes the upper layers
   144     // Usually setting the MTU appropriately makes the upper layers
   145     // do the frame fragmenting. In some cases this doesn't work
   145     // do the frame fragmenting. In some cases this doesn't work
   146     // so the MTU is left on the Ethernet standard value and fragmenting
   146     // so the MTU is left on the Ethernet standard value and fragmenting
   147     // is done "manually".
   147     // is done "manually".
   148 #if 0
   148 #if 0
   149     eoe->dev->mtu = slave->sii.rx_mailbox_size - ETH_HLEN - 10;
   149     eoe->dev->mtu = slave->configured_rx_mailbox_size - ETH_HLEN - 10;
   150 #endif
   150 #endif
   151 
   151 
   152     // connect the net_device to the kernel
   152     // connect the net_device to the kernel
   153     if ((result = register_netdev(eoe->dev))) {
   153     if ((result = register_netdev(eoe->dev))) {
   154         EC_ERR("Unable to register net_device: error %i\n", result);
   154         EC_ERR("Unable to register net_device: error %i\n", result);
   229     unsigned int i;
   229     unsigned int i;
   230 #endif
   230 #endif
   231 
   231 
   232     remaining_size = eoe->tx_frame->skb->len - eoe->tx_offset;
   232     remaining_size = eoe->tx_frame->skb->len - eoe->tx_offset;
   233 
   233 
   234     if (remaining_size <= eoe->slave->sii.std_tx_mailbox_size - 10) {
   234     if (remaining_size <= eoe->slave->configured_tx_mailbox_size - 10) {
   235         current_size = remaining_size;
   235         current_size = remaining_size;
   236         last_fragment = 1;
   236         last_fragment = 1;
   237     } else {
   237     } else {
   238         current_size = ((eoe->slave->sii.std_tx_mailbox_size - 10) / 32) * 32;
   238         current_size = ((eoe->slave->configured_tx_mailbox_size - 10) / 32) * 32;
   239         last_fragment = 0;
   239         last_fragment = 0;
   240     }
   240     }
   241 
   241 
   242     if (eoe->tx_fragment_number) {
   242     if (eoe->tx_fragment_number) {
   243         complete_offset = eoe->tx_offset / 32;
   243         complete_offset = eoe->tx_offset / 32;
   693 {
   693 {
   694     ec_eoe_t *eoe = *((ec_eoe_t **) netdev_priv(dev));
   694     ec_eoe_t *eoe = *((ec_eoe_t **) netdev_priv(dev));
   695     ec_eoe_frame_t *frame;
   695     ec_eoe_frame_t *frame;
   696 
   696 
   697 #if 0
   697 #if 0
   698     if (skb->len > eoe->slave->sii.tx_mailbox_size - 10) {
   698     if (skb->len > eoe->slave->configured_tx_mailbox_size - 10) {
   699         EC_WARN("EoE TX frame (%u octets) exceeds MTU. dropping.\n", skb->len);
   699         EC_WARN("EoE TX frame (%u octets) exceeds MTU. dropping.\n", skb->len);
   700         dev_kfree_skb(skb);
   700         dev_kfree_skb(skb);
   701         eoe->stats.tx_dropped++;
   701         eoe->stats.tx_dropped++;
   702         return 0;
   702         return 0;
   703     }
   703     }