--- upstream/dynamips-0.2.6-RC1/dev_c3600.h 2007/10/06 16:03:58 2 +++ upstream/dynamips-0.2.7-RC2/dev_c3600.h 2007/10/06 16:24:54 8 @@ -14,7 +14,7 @@ #include "net.h" #include "device.h" #include "pci_dev.h" -#include "nmc93c46.h" +#include "nmc93cX6.h" #include "net_io.h" #include "vm.h" @@ -48,6 +48,14 @@ /* C3600 NM Management Interrupt handler */ #define C3600_NM_MGMT_IRQ 3 +/* Network IRQ */ +#define C3600_NETIO_IRQ_BASE 32 +#define C3600_NETIO_IRQ_PORT_BITS 2 +#define C3600_NETIO_IRQ_PORT_MASK ((1 << C3600_NETIO_IRQ_PORT_BITS) - 1) +#define C3600_NETIO_IRQ_PER_SLOT (1 << C3600_NETIO_IRQ_PORT_BITS) +#define C3600_NETIO_IRQ_END \ + (C3600_NETIO_IRQ_BASE + (C3600_MAX_NM_BAYS * C3600_NETIO_IRQ_PER_SLOT) - 1) + /* C3600 common device addresses */ #define C3600_GT64K_ADDR 0x14000000ULL #define C3600_IOFPGA_ADDR 0x1e800000ULL @@ -69,13 +77,6 @@ /* C3600 router */ typedef struct c3600_router c3600_t; -/* C3600 EEPROM */ -struct c3600_eeprom { - char *name; - m_uint16_t *data; - u_int len; -}; - /* Prototype of chassis driver initialization function */ typedef int (*c3600_chassis_init_fn)(c3600_t *router); @@ -121,9 +122,8 @@ struct c3600_nm_bay { char *dev_name; /* Device name */ char *dev_type; /* Device Type */ + struct cisco_eeprom eeprom; /* NM EEPROM */ struct pci_bus *pci_map; /* PCI bus */ - m_uint16_t *eeprom_data; /* NM EEPROM data */ - u_int eeprom_data_len; /* NM EEPROM data length */ struct c3600_nm_driver *nm_driver; /* NM Driver */ void *drv_info; /* Private driver info */ struct c3600_nio_binding *nio_list; /* NIO bindings to ports */ @@ -135,8 +135,7 @@ int chassis_id; int supported; c3600_chassis_init_fn chassis_init; - m_uint16_t *mb_eeprom; - u_int mb_eeprom_len; + struct cisco_eeprom *eeprom; }; /* C3600 router */ @@ -150,6 +149,9 @@ /* IO memory size to be passed to Smart Init */ u_int nm_iomem_size; + /* I/O FPGA */ + struct c3600_iofpga_data *iofpga_data; + /* Chassis information */ struct c3600_chassis_driver *chassis_driver; struct c3600_nm_bay nm_bay[C3600_MAX_NM_BAYS]; @@ -159,17 +161,14 @@ * Mainboard EEPROM. * It can be modified to change the chassis MAC address. */ - m_uint16_t mb_eeprom_data[64]; - struct nmc93c46_eeprom_def mb_eeprom; - struct nmc93c46_group mb_eeprom_group; + struct cisco_eeprom mb_eeprom; + struct nmc93cX6_group mb_eeprom_group; /* Network Module EEPROMs (3620/3640) */ - struct nmc93c46_eeprom_def nm_eeprom; - struct nmc93c46_group nm_eeprom_group; + struct nmc93cX6_group nm_eeprom_group; /* Cisco 3660 NM EEPROMs */ - struct nmc93c46_eeprom_def c3660_nm_eeprom_def[C3600_MAX_NM_BAYS]; - struct nmc93c46_group c3660_nm_eeprom_group[C3600_MAX_NM_BAYS]; + struct nmc93cX6_group c3660_nm_eeprom_group[C3600_MAX_NM_BAYS]; }; /* Create a new router instance */ @@ -187,9 +186,12 @@ /* Save configurations of all C3600 instances */ void c3600_save_config_all(FILE *fd); +/* Get network IRQ for specified slot/port */ +u_int c3600_net_irq_for_slot_port(u_int slot,u_int port); + /* Set NM EEPROM definition */ int c3600_nm_set_eeprom(c3600_t *router,u_int nm_bay, - const struct c3600_eeprom *eeprom); + const struct cisco_eeprom *eeprom); /* Unset NM EEPROM definition (empty bay) */ int c3600_nm_unset_eeprom(c3600_t *router,u_int nm_bay);