1 |
/* |
/* |
2 |
* Cisco C3600 (Predator) simulation platform. |
* Cisco router simulation platform. |
3 |
* Copyright (c) 2006 Christophe Fillot (cf@utc.fr) |
* Copyright (c) 2006 Christophe Fillot (cf@utc.fr) |
4 |
* |
* |
5 |
* Serial Network Modules. |
* Serial Network Modules. |
26 |
/* NM-4T */ |
/* NM-4T */ |
27 |
/* ====================================================================== */ |
/* ====================================================================== */ |
28 |
|
|
|
/* NM-4T: 4 Serial Network Module EEPROM */ |
|
|
static m_uint16_t eeprom_c3600_nm_4t_data[64] = { |
|
|
0x0154, 0x0101, 0x009D, 0x2D64, 0x5009, 0x0A02, 0x0000, 0x0000, |
|
|
0x5800, 0x0000, 0x9811, 0x0300, 0x0005, 0xFFFF, 0xFFFF, 0xFFFF, |
|
|
}; |
|
|
|
|
|
static const struct c3600_eeprom eeprom_c3600_nm_4t = { |
|
|
"NM-4T", eeprom_c3600_nm_4t_data, sizeof(eeprom_c3600_nm_4t_data)/2, |
|
|
}; |
|
|
|
|
29 |
/* |
/* |
30 |
* dev_c3600_nm_4t_init() |
* dev_c3600_nm_4t_init() |
31 |
* |
* |
32 |
* Add a PA-4T network module into specified slot. |
* Add a NM-4T network module into specified slot. |
33 |
*/ |
*/ |
34 |
int dev_c3600_nm_4t_init(c3600_t *router,char *name,u_int nm_bay) |
int dev_c3600_nm_4t_init(c3600_t *router,char *name,u_int nm_bay) |
35 |
{ |
{ |
37 |
struct mueslix_data *data; |
struct mueslix_data *data; |
38 |
|
|
39 |
/* Set the EEPROM */ |
/* Set the EEPROM */ |
40 |
c3600_nm_set_eeprom(router,nm_bay,&eeprom_c3600_nm_4t); |
c3600_nm_set_eeprom(router,nm_bay,cisco_eeprom_find_nm("NM-4T")); |
41 |
|
|
42 |
/* Get PCI bus info about this bay */ |
/* Get PCI bus info about this bay */ |
43 |
bay_info = c3600_nm_get_bay_info(c3600_chassis_get_id(router),nm_bay); |
bay_info = c3600_nm_get_bay_info(c3600_chassis_get_id(router),nm_bay); |
44 |
|
|
45 |
if (!bay_info) { |
if (!bay_info) { |
46 |
fprintf(stderr,"%s: unable to get info for PA bay %u\n",name,nm_bay); |
fprintf(stderr,"%s: unable to get info for NM bay %u\n",name,nm_bay); |
47 |
return(-1); |
return(-1); |
48 |
} |
} |
49 |
|
|
51 |
data = dev_mueslix_init(router->vm,name,0, |
data = dev_mueslix_init(router->vm,name,0, |
52 |
router->nm_bay[nm_bay].pci_map, |
router->nm_bay[nm_bay].pci_map, |
53 |
bay_info->pci_device, |
bay_info->pci_device, |
54 |
C3600_NETIO_IRQ); |
c3600_net_irq_for_slot_port(nm_bay,0)); |
55 |
if (!data) return(-1); |
if (!data) return(-1); |
56 |
|
|
57 |
/* Store device info into the router structure */ |
/* Store device info into the router structure */ |
58 |
return(c3600_nm_set_drvinfo(router,nm_bay,data)); |
return(c3600_nm_set_drvinfo(router,nm_bay,data)); |
59 |
} |
} |
60 |
|
|
61 |
/* Remove a PA-4T+ from the specified slot */ |
/* Remove a NM-4T from the specified slot */ |
62 |
int dev_c3600_nm_4t_shutdown(c3600_t *router,u_int nm_bay) |
int dev_c3600_nm_4t_shutdown(c3600_t *router,u_int nm_bay) |
63 |
{ |
{ |
64 |
struct c3600_nm_bay *bay; |
struct c3600_nm_bay *bay; |