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

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

upstream/dynamips-0.2.7/dev_c3600_iofpga.c revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC upstream/dynamips-0.2.8-RC1/dev_c3600_iofpga.c revision 11 by dpavlin, Sat Oct 6 16:33:40 2007 UTC
# Line 95  static const struct nmc93cX6_eeprom_def Line 95  static const struct nmc93cX6_eeprom_def
95    
96  /* Mainboard EEPROM */  /* Mainboard EEPROM */
97  static const struct nmc93cX6_group eeprom_mb_group = {  static const struct nmc93cX6_group eeprom_mb_group = {
98     EEPROM_TYPE_NMC93C46, 1, 0, "Mainboard EEPROM", 0, { &eeprom_mb_def },     EEPROM_TYPE_NMC93C46, 1, 0,
99       EEPROM_DORD_NORMAL,
100       EEPROM_DOUT_HIGH,
101       EEPROM_DEBUG_DISABLED,
102       "Mainboard EEPROM",
103       { &eeprom_mb_def },
104  };  };
105    
106  /* NM EEPROM definition */  /* NM EEPROM definition */
# Line 106  static const struct nmc93cX6_eeprom_def Line 111  static const struct nmc93cX6_eeprom_def
111    
112  /* NM EEPROM */  /* NM EEPROM */
113  static const struct nmc93cX6_group eeprom_nm_group = {  static const struct nmc93cX6_group eeprom_nm_group = {
114     EEPROM_TYPE_NMC93C46, 1, 0, "NM EEPROM", 0, { &eeprom_nm_def },     EEPROM_TYPE_NMC93C46, 1, 0,
115       EEPROM_DORD_NORMAL,
116       EEPROM_DOUT_HIGH,
117       EEPROM_DEBUG_DISABLED,
118       "NM EEPROM",
119       { &eeprom_nm_def },
120  };  };
121    
122  /* C3660 NM presence masks */  /* C3660 NM presence masks */
# Line 122  static const m_uint16_t c3660_nm_masks[6 Line 132  static const m_uint16_t c3660_nm_masks[6
132  /* Select the current NM EEPROM */  /* Select the current NM EEPROM */
133  static void nm_eeprom_select(struct c3600_iofpga_data *d,u_int slot)  static void nm_eeprom_select(struct c3600_iofpga_data *d,u_int slot)
134  {  {
135     d->router->nm_eeprom_group.eeprom[0] = &d->router->nm_bay[slot].eeprom;     struct cisco_eeprom *eeprom = NULL;
136       struct cisco_card *card;
137    
138       card = vm_slot_get_card_ptr(d->router->vm,slot);
139    
140       if (card != NULL)
141          eeprom = &card->eeprom;
142    
143       d->router->nm_eeprom_group.eeprom[0] = eeprom;
144  }  }
145    
146  /* Return the NM status register given the detected EEPROM (3620/3640) */  /* Return the NM status register given the detected EEPROM (3620/3640) */
# Line 132  static u_int nm_get_status_1(struct c360 Line 150  static u_int nm_get_status_1(struct c360
150     int i;     int i;
151    
152     for(i=0;i<4;i++) {     for(i=0;i<4;i++) {
153        if (c3600_nm_check_eeprom(d->router,i))        if (vm_slot_get_card_ptr(d->router->vm,i))
154           res &= ~(0x1111 << i);           res &= ~(0x1111 << i);
155     }     }
156        
# Line 160  static u_int nm_get_status_2(struct c360 Line 178  static u_int nm_get_status_2(struct c360
178     }     }
179    
180     for(i=start;i<=end;i++) {     for(i=start;i<=end;i++) {
181        if (c3600_nm_check_eeprom(d->router,i))        if (vm_slot_get_card_ptr(d->router->vm,i))
182           res &= c3660_nm_masks[i-1];           res &= c3660_nm_masks[i-1];
183     }     }
184        
# Line 710  void c3600_init_eeprom_groups(c3600_t *r Line 728  void c3600_init_eeprom_groups(c3600_t *r
728     /* Initialize NM EEPROM for 3660 */     /* Initialize NM EEPROM for 3660 */
729     for(i=0;i<C3600_MAX_NM_BAYS;i++) {     for(i=0;i<C3600_MAX_NM_BAYS;i++) {
730        router->c3660_nm_eeprom_group[i] = eeprom_nm_group;        router->c3660_nm_eeprom_group[i] = eeprom_nm_group;
731        router->c3660_nm_eeprom_group[i].eeprom[0] = &router->nm_bay[i].eeprom;        router->c3660_nm_eeprom_group[i].eeprom[0] = NULL;
732     }     }
733  }  }
734    

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

  ViewVC Help
Powered by ViewVC 1.1.26