/[dynamips]/upstream/dynamips-0.2.8-RC1/dev_i8254x.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.8-RC1/dev_i8254x.c

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

upstream/dynamips-0.2.7/dev_i8254x.c revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC upstream/dynamips-0.2.8-RC1/dev_i8254x.c revision 11 by dpavlin, Sat Oct 6 16:33:40 2007 UTC
# Line 247  Line 247 
247  #define I8254X_RXDESC_EOP       0x00000002  /* End Of Packet */  #define I8254X_RXDESC_EOP       0x00000002  /* End Of Packet */
248  #define I8254X_RXDESC_DD        0x00000001  /* Descriptor Done */  #define I8254X_RXDESC_DD        0x00000001  /* Descriptor Done */
249    
   
   
250  /* Intel i8254x private data */  /* Intel i8254x private data */
251  struct i8254x_data {  struct i8254x_data {
252     char *name;     char *name;
# Line 477  static inline void dev_i8254x_update_irq Line 475  static inline void dev_i8254x_update_irq
475  {  {
476     if (d->icr & d->imr)     if (d->icr & d->imr)
477        pci_dev_trigger_irq(d->vm,d->pci_dev);        pci_dev_trigger_irq(d->vm,d->pci_dev);
478     else     else
479        pci_dev_clear_irq(d->vm,d->pci_dev);        pci_dev_clear_irq(d->vm,d->pci_dev);
480  }  }
481    
# Line 551  void *dev_i8254x_access(cpu_gen_t *cpu,s Line 549  void *dev_i8254x_access(cpu_gen_t *cpu,s
549  #if 0 /* TODO */  #if 0 /* TODO */
550        case 0x180:        case 0x180:
551           if (op_type == MTS_READ)           if (op_type == MTS_READ)
552              *data = 0xDC004020; //1 << 31;              *data = 0xFFFFFFFF; //0xDC004020; //1 << 31;
553           break;           break;
554  #endif  #endif
555    
# Line 847  static int dev_i8254x_handle_txring(stru Line 845  static int dev_i8254x_handle_txring(stru
845        return(FALSE);        return(FALSE);
846    
847     LVG_LOCK(d);     LVG_LOCK(d);
848      
849     /* Empty packet for now */     /* Empty packet for now */
850     pkt_ptr = d->tx_buffer;     pkt_ptr = d->tx_buffer;
851     tot_len = 0;     tot_len = 0;
# Line 861  static int dev_i8254x_handle_txring(stru Line 859  static int dev_i8254x_handle_txring(stru
859        buf_addr = ((m_uint64_t)txd.tdes[1] << 32) | txd.tdes[0];        buf_addr = ((m_uint64_t)txd.tdes[1] << 32) | txd.tdes[0];
860        buf_len  = txd.tdes[2] & I8254X_TXDESC_LEN_MASK;        buf_len  = txd.tdes[2] & I8254X_TXDESC_LEN_MASK;
861    
862          //printf("COPYING DATA FROM 0x%8.8llx\n",buf_addr);
863        norm_len = normalize_size(buf_len,4,0);        norm_len = normalize_size(buf_len,4,0);
864        physmem_copy_from_vm(d->vm,pkt_ptr,buf_addr,norm_len);        physmem_copy_from_vm(d->vm,pkt_ptr,buf_addr,norm_len);
865        mem_bswap32(pkt_ptr,norm_len);        mem_bswap32(pkt_ptr,norm_len);
# Line 881  static int dev_i8254x_handle_txring(stru Line 880  static int dev_i8254x_handle_txring(stru
880    
881        /* End of packet ? */        /* End of packet ? */
882        if (txd.tdes[2] & I8254X_TXDESC_EOP) {        if (txd.tdes[2] & I8254X_TXDESC_EOP) {
883    #if DEBUG_TRANSMIT
884             LVG_LOG(d,"sending packet of %u bytes\n",tot_len);
885             mem_dump(log_file,d->tx_buffer,tot_len);
886    #endif
887           netio_send(d->nio,d->tx_buffer,tot_len);           netio_send(d->nio,d->tx_buffer,tot_len);
888           break;           break;
889        }        }
# Line 1012  static int dev_i8254x_handle_rxring(neti Line 1015  static int dev_i8254x_handle_rxring(neti
1015   * Read a PCI register.   * Read a PCI register.
1016   */   */
1017  static m_uint32_t pci_i8254x_read(cpu_gen_t *cpu,struct pci_device *dev,  static m_uint32_t pci_i8254x_read(cpu_gen_t *cpu,struct pci_device *dev,
1018                                      int reg)                                    int reg)
1019  {  {
1020     struct i8254x_data *d = dev->priv_data;     struct i8254x_data *d = dev->priv_data;
1021    
# Line 1038  static m_uint32_t pci_i8254x_read(cpu_ge Line 1041  static m_uint32_t pci_i8254x_read(cpu_ge
1041   * Write a PCI register.   * Write a PCI register.
1042   */   */
1043  static void pci_i8254x_write(cpu_gen_t *cpu,struct pci_device *dev,  static void pci_i8254x_write(cpu_gen_t *cpu,struct pci_device *dev,
1044                                 int reg,m_uint32_t value)                               int reg,m_uint32_t value)
1045  {  {
1046     struct i8254x_data *d = dev->priv_data;     struct i8254x_data *d = dev->priv_data;
1047    

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

  ViewVC Help
Powered by ViewVC 1.1.26