69 |
/* C3600 router */ |
/* C3600 router */ |
70 |
typedef struct c3600_router c3600_t; |
typedef struct c3600_router c3600_t; |
71 |
|
|
|
/* C3600 EEPROM */ |
|
|
struct c3600_eeprom { |
|
|
char *name; |
|
|
m_uint16_t *data; |
|
|
u_int len; |
|
|
}; |
|
|
|
|
72 |
/* Prototype of chassis driver initialization function */ |
/* Prototype of chassis driver initialization function */ |
73 |
typedef int (*c3600_chassis_init_fn)(c3600_t *router); |
typedef int (*c3600_chassis_init_fn)(c3600_t *router); |
74 |
|
|
75 |
/* Prototype of NM driver initialization function */ |
/* Prototype of NM driver initialization function */ |
76 |
typedef int (*c3600_nm_init_fn)(c3600_t *router,char *name,u_int nm_bay); |
typedef int (*c3600_nm_init_fn)(c3600_t *router,char *name,u_int nm_bay); |
77 |
|
|
78 |
/* Prototype of PA driver shutdown function */ |
/* Prototype of NM driver shutdown function */ |
79 |
typedef int (*c3600_nm_shutdown_fn)(c3600_t *router,u_int nm_bay); |
typedef int (*c3600_nm_shutdown_fn)(c3600_t *router,u_int nm_bay); |
80 |
|
|
81 |
/* Prototype of PA NIO set function */ |
/* Prototype of NM NIO set function */ |
82 |
typedef int (*c3600_nm_set_nio_fn)(c3600_t *router,u_int nm_bay,u_int port_id, |
typedef int (*c3600_nm_set_nio_fn)(c3600_t *router,u_int nm_bay,u_int port_id, |
83 |
netio_desc_t *nio); |
netio_desc_t *nio); |
84 |
|
|
85 |
/* Prototype of PA NIO unset function */ |
/* Prototype of NM NIO unset function */ |
86 |
typedef int (*c3600_nm_unset_nio_fn)(c3600_t *router,u_int nm_bay, |
typedef int (*c3600_nm_unset_nio_fn)(c3600_t *router,u_int nm_bay, |
87 |
u_int port_id); |
u_int port_id); |
88 |
|
|
89 |
|
/* Prototype of NM NIO show info function */ |
90 |
|
typedef int (*c3600_nm_show_info_fn)(c3600_t *router,u_int nm_bay); |
91 |
|
|
92 |
/* C3600 Network Module Driver */ |
/* C3600 Network Module Driver */ |
93 |
struct c3600_nm_driver { |
struct c3600_nm_driver { |
94 |
char *dev_type; |
char *dev_type; |
98 |
c3600_nm_shutdown_fn nm_shutdown; |
c3600_nm_shutdown_fn nm_shutdown; |
99 |
c3600_nm_set_nio_fn nm_set_nio; |
c3600_nm_set_nio_fn nm_set_nio; |
100 |
c3600_nm_unset_nio_fn nm_unset_nio; |
c3600_nm_unset_nio_fn nm_unset_nio; |
101 |
|
c3600_nm_show_info_fn nm_show_info; |
102 |
|
|
103 |
/* TODO: WAN Interface Cards (WIC) */ |
/* TODO: WAN Interface Cards (WIC) */ |
104 |
}; |
}; |
105 |
|
|
114 |
struct c3600_nm_bay { |
struct c3600_nm_bay { |
115 |
char *dev_name; /* Device name */ |
char *dev_name; /* Device name */ |
116 |
char *dev_type; /* Device Type */ |
char *dev_type; /* Device Type */ |
117 |
|
struct cisco_eeprom eeprom; /* NM EEPROM */ |
118 |
struct pci_bus *pci_map; /* PCI bus */ |
struct pci_bus *pci_map; /* PCI bus */ |
|
m_uint16_t *eeprom_data; /* NM EEPROM data */ |
|
|
u_int eeprom_data_len; /* NM EEPROM data length */ |
|
119 |
struct c3600_nm_driver *nm_driver; /* NM Driver */ |
struct c3600_nm_driver *nm_driver; /* NM Driver */ |
120 |
void *drv_info; /* Private driver info */ |
void *drv_info; /* Private driver info */ |
121 |
struct c3600_nio_binding *nio_list; /* NIO bindings to ports */ |
struct c3600_nio_binding *nio_list; /* NIO bindings to ports */ |
127 |
int chassis_id; |
int chassis_id; |
128 |
int supported; |
int supported; |
129 |
c3600_chassis_init_fn chassis_init; |
c3600_chassis_init_fn chassis_init; |
130 |
m_uint16_t *mb_eeprom; |
struct cisco_eeprom *eeprom; |
|
u_int mb_eeprom_len; |
|
131 |
}; |
}; |
132 |
|
|
133 |
/* C3600 router */ |
/* C3600 router */ |
150 |
* Mainboard EEPROM. |
* Mainboard EEPROM. |
151 |
* It can be modified to change the chassis MAC address. |
* It can be modified to change the chassis MAC address. |
152 |
*/ |
*/ |
153 |
m_uint16_t mb_eeprom_data[64]; |
struct cisco_eeprom mb_eeprom; |
|
struct nmc93c46_eeprom_def mb_eeprom; |
|
154 |
struct nmc93c46_group mb_eeprom_group; |
struct nmc93c46_group mb_eeprom_group; |
155 |
|
|
156 |
/* Network Module EEPROMs (3620/3640) */ |
/* Network Module EEPROMs (3620/3640) */ |
|
struct nmc93c46_eeprom_def nm_eeprom; |
|
157 |
struct nmc93c46_group nm_eeprom_group; |
struct nmc93c46_group nm_eeprom_group; |
158 |
|
|
159 |
/* Cisco 3660 NM EEPROMs */ |
/* Cisco 3660 NM EEPROMs */ |
|
struct nmc93c46_eeprom_def c3660_nm_eeprom_def[C3600_MAX_NM_BAYS]; |
|
160 |
struct nmc93c46_group c3660_nm_eeprom_group[C3600_MAX_NM_BAYS]; |
struct nmc93c46_group c3660_nm_eeprom_group[C3600_MAX_NM_BAYS]; |
161 |
}; |
}; |
162 |
|
|
177 |
|
|
178 |
/* Set NM EEPROM definition */ |
/* Set NM EEPROM definition */ |
179 |
int c3600_nm_set_eeprom(c3600_t *router,u_int nm_bay, |
int c3600_nm_set_eeprom(c3600_t *router,u_int nm_bay, |
180 |
const struct c3600_eeprom *eeprom); |
const struct cisco_eeprom *eeprom); |
181 |
|
|
182 |
/* Unset NM EEPROM definition (empty bay) */ |
/* Unset NM EEPROM definition (empty bay) */ |
183 |
int c3600_nm_unset_eeprom(c3600_t *router,u_int nm_bay); |
int c3600_nm_unset_eeprom(c3600_t *router,u_int nm_bay); |
238 |
/* Shutdown all NM of a router */ |
/* Shutdown all NM of a router */ |
239 |
int c3600_nm_shutdown_all(c3600_t *router); |
int c3600_nm_shutdown_all(c3600_t *router); |
240 |
|
|
241 |
|
/* Show info about all NMs */ |
242 |
|
int c3600_nm_show_all_info(c3600_t *router); |
243 |
|
|
244 |
/* Create a Network Module (command line) */ |
/* Create a Network Module (command line) */ |
245 |
int c3600_cmd_nm_create(c3600_t *router,char *str); |
int c3600_cmd_nm_create(c3600_t *router,char *str); |
246 |
|
|
289 |
extern struct c3600_nm_driver dev_c3600_nm_1fe_tx_driver; |
extern struct c3600_nm_driver dev_c3600_nm_1fe_tx_driver; |
290 |
extern struct c3600_nm_driver dev_c3600_nm_4t_driver; |
extern struct c3600_nm_driver dev_c3600_nm_4t_driver; |
291 |
extern struct c3600_nm_driver dev_c3600_leopard_2fe_driver; |
extern struct c3600_nm_driver dev_c3600_leopard_2fe_driver; |
292 |
|
extern struct c3600_nm_driver dev_c3600_nm_16esw_driver; |
293 |
|
|
294 |
#endif |
#endif |