/[dynamips]/trunk/dev_c3600.h
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.h

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

upstream/dynamips-0.2.6-RC1/dev_c3600.h revision 2 by dpavlin, Sat Oct 6 16:03:58 2007 UTC upstream/dynamips-0.2.7/dev_c3600.h revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC
# Line 14  Line 14 
14  #include "net.h"  #include "net.h"
15  #include "device.h"  #include "device.h"
16  #include "pci_dev.h"  #include "pci_dev.h"
17  #include "nmc93c46.h"  #include "nmc93cX6.h"
18  #include "net_io.h"  #include "net_io.h"
19  #include "vm.h"  #include "vm.h"
20    
# Line 48  Line 48 
48  /* C3600 NM Management Interrupt handler */  /* C3600 NM Management Interrupt handler */
49  #define C3600_NM_MGMT_IRQ  3  #define C3600_NM_MGMT_IRQ  3
50    
51    /* Network IRQ */
52    #define C3600_NETIO_IRQ_BASE       32
53    #define C3600_NETIO_IRQ_PORT_BITS  2
54    #define C3600_NETIO_IRQ_PORT_MASK  ((1 << C3600_NETIO_IRQ_PORT_BITS) - 1)
55    #define C3600_NETIO_IRQ_PER_SLOT   (1 << C3600_NETIO_IRQ_PORT_BITS)
56    #define C3600_NETIO_IRQ_END        \
57        (C3600_NETIO_IRQ_BASE + (C3600_MAX_NM_BAYS * C3600_NETIO_IRQ_PER_SLOT) - 1)
58    
59  /* C3600 common device addresses */  /* C3600 common device addresses */
60  #define C3600_GT64K_ADDR      0x14000000ULL  #define C3600_GT64K_ADDR      0x14000000ULL
61  #define C3600_IOFPGA_ADDR     0x1e800000ULL  #define C3600_IOFPGA_ADDR     0x1e800000ULL
# Line 69  Line 77 
77  /* C3600 router */  /* C3600 router */
78  typedef struct c3600_router c3600_t;  typedef struct c3600_router c3600_t;
79    
 /* C3600 EEPROM */  
 struct c3600_eeprom {  
    char *name;  
    m_uint16_t *data;  
    u_int len;  
 };  
   
80  /* Prototype of chassis driver initialization function */  /* Prototype of chassis driver initialization function */
81  typedef int (*c3600_chassis_init_fn)(c3600_t *router);  typedef int (*c3600_chassis_init_fn)(c3600_t *router);
82    
# Line 121  struct c3600_nio_binding { Line 122  struct c3600_nio_binding {
122  struct c3600_nm_bay {  struct c3600_nm_bay {
123     char *dev_name;                       /* Device name */     char *dev_name;                       /* Device name */
124     char *dev_type;                       /* Device Type */     char *dev_type;                       /* Device Type */
125       struct cisco_eeprom eeprom;           /* NM EEPROM */
126     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 */  
127     struct c3600_nm_driver *nm_driver;    /* NM Driver */     struct c3600_nm_driver *nm_driver;    /* NM Driver */
128     void *drv_info;                       /* Private driver info */     void *drv_info;                       /* Private driver info */
129     struct c3600_nio_binding *nio_list;   /* NIO bindings to ports */     struct c3600_nio_binding *nio_list;   /* NIO bindings to ports */
# Line 135  struct c3600_chassis_driver { Line 135  struct c3600_chassis_driver {
135     int chassis_id;     int chassis_id;
136     int supported;       int supported;  
137     c3600_chassis_init_fn chassis_init;     c3600_chassis_init_fn chassis_init;
138     m_uint16_t *mb_eeprom;     struct cisco_eeprom *eeprom;
    u_int mb_eeprom_len;  
139  };  };
140    
141  /* C3600 router */  /* C3600 router */
# Line 150  struct c3600_router { Line 149  struct c3600_router {
149     /* IO memory size to be passed to Smart Init */     /* IO memory size to be passed to Smart Init */
150     u_int nm_iomem_size;     u_int nm_iomem_size;
151    
152       /* I/O FPGA */
153       struct c3600_iofpga_data *iofpga_data;
154    
155     /* Chassis information */     /* Chassis information */
156     struct c3600_chassis_driver *chassis_driver;     struct c3600_chassis_driver *chassis_driver;
157     struct c3600_nm_bay nm_bay[C3600_MAX_NM_BAYS];     struct c3600_nm_bay nm_bay[C3600_MAX_NM_BAYS];
# Line 159  struct c3600_router { Line 161  struct c3600_router {
161      * Mainboard EEPROM.      * Mainboard EEPROM.
162      * It can be modified to change the chassis MAC address.      * It can be modified to change the chassis MAC address.
163      */      */
164     m_uint16_t mb_eeprom_data[64];     struct cisco_eeprom mb_eeprom;
165     struct nmc93c46_eeprom_def mb_eeprom;       struct nmc93cX6_group mb_eeprom_group;
    struct nmc93c46_group mb_eeprom_group;  
166    
167     /* Network Module EEPROMs (3620/3640) */     /* Network Module EEPROMs (3620/3640) */
168     struct nmc93c46_eeprom_def nm_eeprom;     struct nmc93cX6_group nm_eeprom_group;
    struct nmc93c46_group nm_eeprom_group;  
169    
170     /* Cisco 3660 NM EEPROMs */     /* Cisco 3660 NM EEPROMs */
171     struct nmc93c46_eeprom_def c3660_nm_eeprom_def[C3600_MAX_NM_BAYS];     struct nmc93cX6_group c3660_nm_eeprom_group[C3600_MAX_NM_BAYS];
    struct nmc93c46_group c3660_nm_eeprom_group[C3600_MAX_NM_BAYS];  
172  };  };
173    
174  /* Create a new router instance */  /* Create a new router instance */
# Line 187  void c3600_save_config(c3600_t *router,F Line 186  void c3600_save_config(c3600_t *router,F
186  /* Save configurations of all C3600 instances */  /* Save configurations of all C3600 instances */
187  void c3600_save_config_all(FILE *fd);  void c3600_save_config_all(FILE *fd);
188    
189    /* Get network IRQ for specified slot/port */
190    u_int c3600_net_irq_for_slot_port(u_int slot,u_int port);
191    
192  /* Set NM EEPROM definition */  /* Set NM EEPROM definition */
193  int c3600_nm_set_eeprom(c3600_t *router,u_int nm_bay,  int c3600_nm_set_eeprom(c3600_t *router,u_int nm_bay,
194                          const struct c3600_eeprom *eeprom);                          const struct cisco_eeprom *eeprom);
195    
196  /* Unset NM EEPROM definition (empty bay) */  /* Unset NM EEPROM definition (empty bay) */
197  int c3600_nm_unset_eeprom(c3600_t *router,u_int nm_bay);  int c3600_nm_unset_eeprom(c3600_t *router,u_int nm_bay);

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

  ViewVC Help
Powered by ViewVC 1.1.26