/[dynamips]/upstream/dynamips-0.2.7/dev_gt.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.7/dev_gt.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7-RC3/dev_gt.c revision 9 by dpavlin, Sat Oct 6 16:26:06 2007 UTC upstream/dynamips-0.2.7/dev_gt.c revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC
# Line 708  void *dev_gt64120_access(cpu_gen_t *cpu, Line 708  void *dev_gt64120_access(cpu_gen_t *cpu,
708     return NULL;     return NULL;
709  }  }
710    
711    /* Trigger/clear Ethernet interrupt if one or both port have pending events */
712    static void gt_eth_set_int_status(struct gt_data *d)
713    {
714       if ((d->eth_ports[0].icr & GT_ICR_INT_SUM) ||
715           (d->eth_ports[1].icr & GT_ICR_INT_SUM))
716          vm_set_irq(d->vm,d->eth_irq);
717       else
718          vm_clear_irq(d->vm,d->eth_irq);
719    }
720    
721  /* Update the Ethernet port interrupt status */  /* Update the Ethernet port interrupt status */
722  static void gt_eth_update_int_status(struct gt_data *d,struct eth_port *port)  static void gt_eth_update_int_status(struct gt_data *d,struct eth_port *port)
723  {  {
724     if (port->icr & port->imr & GT_ICR_MASK) {     if (port->icr & port->imr & GT_ICR_MASK) {
725        port->icr |= GT_ICR_INT_SUM;        port->icr |= GT_ICR_INT_SUM;
       vm_set_irq(d->vm,d->eth_irq);  
726     } else {     } else {
727        port->icr &= ~GT_ICR_INT_SUM;        port->icr &= ~GT_ICR_INT_SUM;
       vm_clear_irq(d->vm,d->eth_irq);  
728     }     }
729    
730       gt_eth_set_int_status(d);
731  }  }
732    
733  /* Read a MII register */  /* Read a MII register */
# Line 1289  static int gt_eth_handle_txqueue(struct Line 1299  static int gt_eth_handle_txqueue(struct
1299     tx_start = tx_current = port->tx_current[queue];     tx_start = tx_current = port->tx_current[queue];
1300    
1301     if (!tx_start)     if (!tx_start)
1302        goto done;        return(FALSE);
1303    
1304     ptxd = &txd0;     ptxd = &txd0;
1305     gt_eth_desc_read(d,tx_start,ptxd);     gt_eth_desc_read(d,tx_start,ptxd);
1306    
1307     /* If we don't own the first descriptor, we cannot transmit */     /* If we don't own the first descriptor, we cannot transmit */
1308     if (!(txd0.cmd_stat & GT_TXDESC_OWN))     if (!(txd0.cmd_stat & GT_TXDESC_OWN))
1309        goto done;        return(FALSE);
1310    
1311     /* Empty packet for now */     /* Empty packet for now */
1312     pkt_ptr = pkt;     pkt_ptr = pkt;
# Line 1369  static int gt_eth_handle_txqueue(struct Line 1379  static int gt_eth_handle_txqueue(struct
1379     else     else
1380        port->icr |= GT_ICR_TXBUFH;        port->icr |= GT_ICR_TXBUFH;
1381    
  done:  
1382     if (abort) {     if (abort) {
1383        /* TX underrun */        /* TX underrun */
1384        port->icr |= GT_ICR_TXUDR;        port->icr |= GT_ICR_TXUDR;

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26