/[dynamips]/trunk/dev_dec21140.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 /trunk/dev_dec21140.c

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

upstream/dynamips-0.2.6-RC2/dev_dec21140.c revision 3 by dpavlin, Sat Oct 6 16:05:34 2007 UTC upstream/dynamips-0.2.6-RC3/dev_dec21140.c revision 4 by dpavlin, Sat Oct 6 16:06:49 2007 UTC
# Line 206  static inline int dec21140_handle_mac_ad Line 206  static inline int dec21140_handle_mac_ad
206     n_eth_hdr_t *hdr = (n_eth_hdr_t *)pkt;     n_eth_hdr_t *hdr = (n_eth_hdr_t *)pkt;
207     int i;     int i;
208    
    /* Ignore traffic sent by us */  
    for(i=0;i<d->mac_addr_count;i++)  
       if (!memcmp(&d->mac_addr[i],&hdr->saddr,N_ETH_ALEN))  
          return(FALSE);  
   
209     /* Accept systematically frames if we are running is promiscuous mode */     /* Accept systematically frames if we are running is promiscuous mode */
210     if (d->csr[6] & DEC21140_CSR6_PROMISC)     if (d->csr[6] & DEC21140_CSR6_PROMISC)
211        return(TRUE);        return(TRUE);
# Line 434  void *dev_dec21140_access(cpu_mips_t *cp Line 429  void *dev_dec21140_access(cpu_mips_t *cp
429              break;              break;
430    
431           case 8:           case 8:
432              /* CSR8 is cleared when read */              /* CSR8 is cleared when read (missed frame counter) */
433              d->csr[reg] = 0;              d->csr[reg] = 0;
434                *data = 0;
435              break;              break;
436                            
437           default:           default:
# Line 510  static m_uint32_t rxdesc_get_next(struct Line 506  static m_uint32_t rxdesc_get_next(struct
506     return(nrxd_addr);     return(nrxd_addr);
507  }  }
508    
509  /* Read an RX descriptor */  /* Read a RX descriptor */
510  static void rxdesc_read(struct dec21140_data *d,m_uint32_t rxd_addr,  static void rxdesc_read(struct dec21140_data *d,m_uint32_t rxd_addr,
511                          struct rx_desc *rxd)                          struct rx_desc *rxd)
512  {  {
# Line 729  static int dev_dec21140_handle_txring_si Line 725  static int dev_dec21140_handle_txring_si
725     /* Copy the current txring descriptor */     /* Copy the current txring descriptor */
726     tx_start = d->tx_current;       tx_start = d->tx_current;  
727     ptxd = &txd0;     ptxd = &txd0;
728     txdesc_read(d,d->tx_current,ptxd);     txdesc_read(d,tx_start,ptxd);
729    
730     /* If we don't own the first descriptor, we cannot transmit */     /* If we don't own the first descriptor, we cannot transmit */
731     if (!(txd0.tdes[0] & DEC21140_TXDESC_OWN))     if (!(txd0.tdes[0] & DEC21140_TXDESC_OWN))

Legend:
Removed from v.3  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26