91 |
/* C7200 router */ |
/* C7200 router */ |
92 |
typedef struct c7200_router c7200_t; |
typedef struct c7200_router c7200_t; |
93 |
|
|
|
/* C7200 EEPROM */ |
|
|
struct c7200_eeprom { |
|
|
char *name; |
|
|
m_uint16_t *data; |
|
|
u_int len; |
|
|
}; |
|
|
|
|
94 |
/* Prototype of NPE driver initialization function */ |
/* Prototype of NPE driver initialization function */ |
95 |
typedef int (*c7200_npe_init_fn)(c7200_t *router); |
typedef int (*c7200_npe_init_fn)(c7200_t *router); |
96 |
|
|
108 |
typedef int (*c7200_pa_unset_nio_fn)(c7200_t *router,u_int pa_bay, |
typedef int (*c7200_pa_unset_nio_fn)(c7200_t *router,u_int pa_bay, |
109 |
u_int port_id); |
u_int port_id); |
110 |
|
|
111 |
|
/* Prototype of NM NIO show info function */ |
112 |
|
typedef int (*c7200_pa_show_info_fn)(c7200_t *router,u_int pa_bay); |
113 |
|
|
114 |
/* C7200 Port Adapter Driver */ |
/* C7200 Port Adapter Driver */ |
115 |
struct c7200_pa_driver { |
struct c7200_pa_driver { |
116 |
char *dev_type; |
char *dev_type; |
119 |
c7200_pa_shutdown_fn pa_shutdown; |
c7200_pa_shutdown_fn pa_shutdown; |
120 |
c7200_pa_set_nio_fn pa_set_nio; |
c7200_pa_set_nio_fn pa_set_nio; |
121 |
c7200_pa_unset_nio_fn pa_unset_nio; |
c7200_pa_unset_nio_fn pa_unset_nio; |
122 |
|
c7200_pa_show_info_fn pa_show_info; |
123 |
}; |
}; |
124 |
|
|
125 |
/* C7200 NIO binding to a slot/port */ |
/* C7200 NIO binding to a slot/port */ |
133 |
struct c7200_pa_bay { |
struct c7200_pa_bay { |
134 |
char *dev_name; /* Device Name */ |
char *dev_name; /* Device Name */ |
135 |
char *dev_type; /* Device Type */ |
char *dev_type; /* Device Type */ |
136 |
|
struct cisco_eeprom eeprom; /* PA EEPROM */ |
137 |
struct pci_bus *pci_map; /* PCI bus */ |
struct pci_bus *pci_map; /* PCI bus */ |
|
struct nmc93c46_eeprom_def eeprom; /* PA EEPROM */ |
|
138 |
struct c7200_pa_driver *pa_driver; /* PA driver */ |
struct c7200_pa_driver *pa_driver; /* PA driver */ |
139 |
void *drv_info; /* Private driver info */ |
void *drv_info; /* Private driver info */ |
140 |
struct c7200_nio_binding *nio_list; /* NIO bindings to ports */ |
struct c7200_nio_binding *nio_list; /* NIO bindings to ports */ |
173 |
struct pci_bus *pcmcia_bus; |
struct pci_bus *pcmcia_bus; |
174 |
|
|
175 |
/* Midplane EEPROM can be modified to change the chassis MAC address... */ |
/* Midplane EEPROM can be modified to change the chassis MAC address... */ |
176 |
m_uint16_t mp_eeprom_data[64]; |
struct cisco_eeprom cpu_eeprom,mp_eeprom,pem_eeprom; |
|
|
|
|
struct nmc93c46_eeprom_def cpu_eeprom; /* CPU EEPROM */ |
|
|
struct nmc93c46_eeprom_def mp_eeprom; /* Midplane EEPROM */ |
|
|
struct nmc93c46_eeprom_def pem_eeprom; /* Power Entry Module EEPROM */ |
|
177 |
|
|
178 |
struct nmc93c46_group sys_eeprom_g1; /* EEPROMs for CPU and Midplane */ |
struct nmc93c46_group sys_eeprom_g1; /* EEPROMs for CPU and Midplane */ |
179 |
struct nmc93c46_group sys_eeprom_g2; /* EEPROM for PEM */ |
struct nmc93c46_group sys_eeprom_g2; /* EEPROM for PEM */ |
184 |
/* Initialize EEPROM groups */ |
/* Initialize EEPROM groups */ |
185 |
void c7200_init_eeprom_groups(c7200_t *router); |
void c7200_init_eeprom_groups(c7200_t *router); |
186 |
|
|
|
/* Find an EEPROM in the specified array */ |
|
|
struct c7200_eeprom *c7200_get_eeprom(struct c7200_eeprom *eeproms,char *name); |
|
|
|
|
|
/* Get an EEPROM for a given NPE model */ |
|
|
struct c7200_eeprom *c7200_get_cpu_eeprom(char *npe_name); |
|
|
|
|
|
/* Get an EEPROM for a given midplane model */ |
|
|
struct c7200_eeprom *c7200_get_midplane_eeprom(char *midplane_name); |
|
|
|
|
|
/* Get a PEM EEPROM for a given NPE model */ |
|
|
struct c7200_eeprom *c7200_get_pem_eeprom(char *npe_name); |
|
|
|
|
187 |
/* Create a new router instance */ |
/* Create a new router instance */ |
188 |
c7200_t *c7200_create_instance(char *name,int instance_id); |
c7200_t *c7200_create_instance(char *name,int instance_id); |
189 |
|
|
201 |
|
|
202 |
/* Set PA EEPROM definition */ |
/* Set PA EEPROM definition */ |
203 |
int c7200_pa_set_eeprom(c7200_t *router,u_int pa_bay, |
int c7200_pa_set_eeprom(c7200_t *router,u_int pa_bay, |
204 |
const struct c7200_eeprom *eeprom); |
const struct cisco_eeprom *eeprom); |
205 |
|
|
206 |
/* Unset PA EEPROM definition (empty bay) */ |
/* Unset PA EEPROM definition (empty bay) */ |
207 |
int c7200_pa_unset_eeprom(c7200_t *router,u_int pa_bay); |
int c7200_pa_unset_eeprom(c7200_t *router,u_int pa_bay); |
262 |
/* Shutdown all PA of a router */ |
/* Shutdown all PA of a router */ |
263 |
int c7200_pa_shutdown_all(c7200_t *router); |
int c7200_pa_shutdown_all(c7200_t *router); |
264 |
|
|
265 |
|
/* Show info about all NMs */ |
266 |
|
int c7200_pa_show_all_info(c7200_t *router); |
267 |
|
|
268 |
/* Create a Port Adapter (command line) */ |
/* Create a Port Adapter (command line) */ |
269 |
int c7200_cmd_pa_create(c7200_t *router,char *str); |
int c7200_cmd_pa_create(c7200_t *router,char *str); |
270 |
|
|