0001
0002 #ifndef _FORE200E_H
0003 #define _FORE200E_H
0004
0005 #ifdef __KERNEL__
0006
0007
0008
0009 #define SMALL_BUFFER_SIZE 384
0010 #define LARGE_BUFFER_SIZE 4032
0011
0012
0013 #define RBD_BLK_SIZE 32
0014
0015
0016 #define MAX_PDU_SIZE 65535
0017
0018
0019 #define BUFFER_S1_SIZE SMALL_BUFFER_SIZE
0020 #define BUFFER_L1_SIZE LARGE_BUFFER_SIZE
0021
0022 #define BUFFER_S2_SIZE SMALL_BUFFER_SIZE
0023 #define BUFFER_L2_SIZE LARGE_BUFFER_SIZE
0024
0025 #define BUFFER_S1_NBR (RBD_BLK_SIZE * 6)
0026 #define BUFFER_L1_NBR (RBD_BLK_SIZE * 4)
0027
0028 #define BUFFER_S2_NBR (RBD_BLK_SIZE * 6)
0029 #define BUFFER_L2_NBR (RBD_BLK_SIZE * 4)
0030
0031
0032 #define QUEUE_SIZE_CMD 16
0033 #define QUEUE_SIZE_RX 64
0034 #define QUEUE_SIZE_TX 256
0035 #define QUEUE_SIZE_BS 32
0036
0037 #define FORE200E_VPI_BITS 0
0038 #define FORE200E_VCI_BITS 10
0039 #define NBR_CONNECT (1 << (FORE200E_VPI_BITS + FORE200E_VCI_BITS))
0040
0041
0042 #define TSD_FIXED 2
0043 #define TSD_EXTENSION 0
0044 #define TSD_NBR (TSD_FIXED + TSD_EXTENSION)
0045
0046
0047
0048
0049
0050
0051
0052 #define RSD_REQUIRED (((MAX_PDU_SIZE - SMALL_BUFFER_SIZE + LARGE_BUFFER_SIZE) / LARGE_BUFFER_SIZE) + 1)
0053
0054 #define RSD_FIXED 3
0055
0056
0057
0058
0059
0060
0061 #define RSD_EXTENSION ((RSD_REQUIRED - RSD_FIXED) + 1)
0062 #define RSD_NBR (RSD_FIXED + RSD_EXTENSION)
0063
0064
0065 #define FORE200E_DEV(d) ((struct fore200e*)((d)->dev_data))
0066 #define FORE200E_VCC(d) ((struct fore200e_vcc*)((d)->dev_data))
0067
0068
0069
0070 #if defined(__LITTLE_ENDIAN_BITFIELD)
0071 #define BITFIELD2(b1, b2) b1; b2;
0072 #define BITFIELD3(b1, b2, b3) b1; b2; b3;
0073 #define BITFIELD4(b1, b2, b3, b4) b1; b2; b3; b4;
0074 #define BITFIELD5(b1, b2, b3, b4, b5) b1; b2; b3; b4; b5;
0075 #define BITFIELD6(b1, b2, b3, b4, b5, b6) b1; b2; b3; b4; b5; b6;
0076 #elif defined(__BIG_ENDIAN_BITFIELD)
0077 #define BITFIELD2(b1, b2) b2; b1;
0078 #define BITFIELD3(b1, b2, b3) b3; b2; b1;
0079 #define BITFIELD4(b1, b2, b3, b4) b4; b3; b2; b1;
0080 #define BITFIELD5(b1, b2, b3, b4, b5) b5; b4; b3; b2; b1;
0081 #define BITFIELD6(b1, b2, b3, b4, b5, b6) b6; b5; b4; b3; b2; b1;
0082 #else
0083 #error unknown bitfield endianess
0084 #endif
0085
0086
0087
0088
0089 typedef struct atm_header {
0090 BITFIELD5(
0091 u32 clp : 1,
0092 u32 plt : 3,
0093 u32 vci : 16,
0094 u32 vpi : 8,
0095 u32 gfc : 4
0096 )
0097 } atm_header_t;
0098
0099
0100
0101
0102 typedef enum fore200e_aal {
0103 FORE200E_AAL0 = 0,
0104 FORE200E_AAL34 = 4,
0105 FORE200E_AAL5 = 5,
0106 } fore200e_aal_t;
0107
0108
0109
0110
0111 typedef struct tpd_spec {
0112 BITFIELD4(
0113 u32 length : 16,
0114 u32 nseg : 8,
0115 enum fore200e_aal aal : 4,
0116 u32 intr : 4
0117 )
0118 } tpd_spec_t;
0119
0120
0121
0122
0123 typedef struct tpd_rate
0124 {
0125 BITFIELD2(
0126 u32 idle_cells : 16,
0127 u32 data_cells : 16
0128 )
0129 } tpd_rate_t;
0130
0131
0132
0133
0134 typedef struct tsd {
0135 u32 buffer;
0136 u32 length;
0137 } tsd_t;
0138
0139
0140
0141
0142 typedef struct tpd {
0143 struct atm_header atm_header;
0144 struct tpd_spec spec;
0145 struct tpd_rate rate;
0146 u32 pad;
0147 struct tsd tsd[ TSD_NBR ];
0148 } tpd_t;
0149
0150
0151
0152
0153 typedef struct rsd {
0154 u32 handle;
0155 u32 length;
0156 } rsd_t;
0157
0158
0159
0160
0161 typedef struct rpd {
0162 struct atm_header atm_header;
0163 u32 nseg;
0164 struct rsd rsd[ RSD_NBR ];
0165 } rpd_t;
0166
0167
0168
0169
0170 typedef enum buffer_scheme {
0171 BUFFER_SCHEME_ONE,
0172 BUFFER_SCHEME_TWO,
0173 BUFFER_SCHEME_NBR
0174 } buffer_scheme_t;
0175
0176
0177
0178
0179 typedef enum buffer_magn {
0180 BUFFER_MAGN_SMALL,
0181 BUFFER_MAGN_LARGE,
0182 BUFFER_MAGN_NBR
0183 } buffer_magn_t;
0184
0185
0186
0187
0188 typedef struct rbd {
0189 u32 handle;
0190 u32 buffer_haddr;
0191 } rbd_t;
0192
0193
0194
0195
0196 typedef struct rbd_block {
0197 struct rbd rbd[ RBD_BLK_SIZE ];
0198 } rbd_block_t;
0199
0200
0201
0202
0203 typedef struct tpd_haddr {
0204 BITFIELD3(
0205 u32 size : 4,
0206 u32 pad : 1,
0207 u32 haddr : 27
0208 )
0209 } tpd_haddr_t;
0210
0211 #define TPD_HADDR_SHIFT 5
0212
0213
0214
0215 typedef struct cp_txq_entry {
0216 struct tpd_haddr tpd_haddr;
0217 u32 status_haddr;
0218 } cp_txq_entry_t;
0219
0220
0221
0222
0223 typedef struct cp_rxq_entry {
0224 u32 rpd_haddr;
0225 u32 status_haddr;
0226 } cp_rxq_entry_t;
0227
0228
0229
0230
0231 typedef struct cp_bsq_entry {
0232 u32 rbd_block_haddr;
0233 u32 status_haddr;
0234 } cp_bsq_entry_t;
0235
0236
0237
0238
0239 typedef volatile enum status {
0240 STATUS_PENDING = (1<<0),
0241 STATUS_COMPLETE = (1<<1),
0242 STATUS_FREE = (1<<2),
0243 STATUS_ERROR = (1<<3)
0244 } status_t;
0245
0246
0247
0248
0249 typedef enum opcode {
0250 OPCODE_INITIALIZE = 1,
0251 OPCODE_ACTIVATE_VCIN,
0252 OPCODE_ACTIVATE_VCOUT,
0253 OPCODE_DEACTIVATE_VCIN,
0254 OPCODE_DEACTIVATE_VCOUT,
0255 OPCODE_GET_STATS,
0256 OPCODE_SET_OC3,
0257 OPCODE_GET_OC3,
0258 OPCODE_RESET_STATS,
0259 OPCODE_GET_PROM,
0260 OPCODE_SET_VPI_BITS,
0261
0262
0263 OPCODE_REQUEST_INTR = (1<<7)
0264 } opcode_t;
0265
0266
0267
0268
0269 typedef struct vpvc {
0270 BITFIELD3(
0271 u32 vci : 16,
0272 u32 vpi : 8,
0273 u32 pad : 8
0274 )
0275 } vpvc_t;
0276
0277
0278
0279
0280 typedef struct activate_opcode {
0281 BITFIELD4(
0282 enum opcode opcode : 8,
0283 enum fore200e_aal aal : 8,
0284 enum buffer_scheme scheme : 8,
0285 u32 pad : 8
0286 )
0287 } activate_opcode_t;
0288
0289
0290
0291
0292 typedef struct activate_block {
0293 struct activate_opcode opcode;
0294 struct vpvc vpvc;
0295 u32 mtu;
0296
0297 } activate_block_t;
0298
0299
0300
0301
0302 typedef struct deactivate_opcode {
0303 BITFIELD2(
0304 enum opcode opcode : 8,
0305 u32 pad : 24
0306 )
0307 } deactivate_opcode_t;
0308
0309
0310
0311
0312 typedef struct deactivate_block {
0313 struct deactivate_opcode opcode;
0314 struct vpvc vpvc;
0315 } deactivate_block_t;
0316
0317
0318
0319
0320 typedef struct oc3_regs {
0321 u32 reg[ 128 ];
0322
0323
0324 } oc3_regs_t;
0325
0326
0327
0328
0329 typedef struct oc3_opcode {
0330 BITFIELD4(
0331 enum opcode opcode : 8,
0332 u32 reg : 8,
0333 u32 value : 8,
0334 u32 mask : 8
0335
0336
0337 )
0338 } oc3_opcode_t;
0339
0340
0341
0342
0343 typedef struct oc3_block {
0344 struct oc3_opcode opcode;
0345 u32 regs_haddr;
0346 } oc3_block_t;
0347
0348
0349
0350
0351 typedef struct stats_phy {
0352 __be32 crc_header_errors;
0353 __be32 framing_errors;
0354 __be32 pad[ 2 ];
0355 } stats_phy_t;
0356
0357
0358
0359
0360 typedef struct stats_oc3 {
0361 __be32 section_bip8_errors;
0362 __be32 path_bip8_errors;
0363 __be32 line_bip24_errors;
0364 __be32 line_febe_errors;
0365 __be32 path_febe_errors;
0366 __be32 corr_hcs_errors;
0367 __be32 ucorr_hcs_errors;
0368 __be32 pad[ 1 ];
0369 } stats_oc3_t;
0370
0371
0372
0373
0374 typedef struct stats_atm {
0375 __be32 cells_transmitted;
0376 __be32 cells_received;
0377 __be32 vpi_bad_range;
0378 __be32 vpi_no_conn;
0379 __be32 vci_bad_range;
0380 __be32 vci_no_conn;
0381 __be32 pad[ 2 ];
0382 } stats_atm_t;
0383
0384
0385
0386 typedef struct stats_aal0 {
0387 __be32 cells_transmitted;
0388 __be32 cells_received;
0389 __be32 cells_dropped;
0390 __be32 pad[ 1 ];
0391 } stats_aal0_t;
0392
0393
0394
0395
0396 typedef struct stats_aal34 {
0397 __be32 cells_transmitted;
0398 __be32 cells_received;
0399 __be32 cells_crc_errors;
0400 __be32 cells_protocol_errors;
0401 __be32 cells_dropped;
0402 __be32 cspdus_transmitted;
0403 __be32 cspdus_received;
0404 __be32 cspdus_protocol_errors;
0405 __be32 cspdus_dropped;
0406 __be32 pad[ 3 ];
0407 } stats_aal34_t;
0408
0409
0410
0411
0412 typedef struct stats_aal5 {
0413 __be32 cells_transmitted;
0414 __be32 cells_received;
0415 __be32 cells_dropped;
0416 __be32 congestion_experienced;
0417 __be32 cspdus_transmitted;
0418 __be32 cspdus_received;
0419 __be32 cspdus_crc_errors;
0420 __be32 cspdus_protocol_errors;
0421 __be32 cspdus_dropped;
0422 __be32 pad[ 3 ];
0423 } stats_aal5_t;
0424
0425
0426
0427
0428 typedef struct stats_aux {
0429 __be32 small_b1_failed;
0430 __be32 large_b1_failed;
0431 __be32 small_b2_failed;
0432 __be32 large_b2_failed;
0433 __be32 rpd_alloc_failed;
0434 __be32 receive_carrier;
0435 __be32 pad[ 2 ];
0436 } stats_aux_t;
0437
0438
0439
0440
0441 typedef struct stats {
0442 struct stats_phy phy;
0443 struct stats_oc3 oc3;
0444 struct stats_atm atm;
0445 struct stats_aal0 aal0;
0446 struct stats_aal34 aal34;
0447 struct stats_aal5 aal5;
0448 struct stats_aux aux;
0449 } stats_t;
0450
0451
0452
0453
0454 typedef struct stats_opcode {
0455 BITFIELD2(
0456 enum opcode opcode : 8,
0457 u32 pad : 24
0458 )
0459 } stats_opcode_t;
0460
0461
0462
0463
0464 typedef struct stats_block {
0465 struct stats_opcode opcode;
0466 u32 stats_haddr;
0467 } stats_block_t;
0468
0469
0470
0471
0472 typedef struct prom_data {
0473 u32 hw_revision;
0474 u32 serial_number;
0475 u8 mac_addr[ 8 ];
0476 } prom_data_t;
0477
0478
0479
0480
0481 typedef struct prom_opcode {
0482 BITFIELD2(
0483 enum opcode opcode : 8,
0484 u32 pad : 24
0485 )
0486 } prom_opcode_t;
0487
0488
0489
0490
0491 typedef struct prom_block {
0492 struct prom_opcode opcode;
0493 u32 prom_haddr;
0494 } prom_block_t;
0495
0496
0497
0498
0499 typedef union cmd {
0500 enum opcode opcode;
0501 struct activate_block activate_block;
0502 struct deactivate_block deactivate_block;
0503 struct stats_block stats_block;
0504 struct prom_block prom_block;
0505 struct oc3_block oc3_block;
0506 u32 pad[ 4 ];
0507 } cmd_t;
0508
0509
0510
0511
0512 typedef struct cp_cmdq_entry {
0513 union cmd cmd;
0514 u32 status_haddr;
0515 u32 pad[ 3 ];
0516 } cp_cmdq_entry_t;
0517
0518
0519
0520
0521 typedef struct host_txq_entry {
0522 struct cp_txq_entry __iomem *cp_entry;
0523 enum status* status;
0524 struct tpd* tpd;
0525 u32 tpd_dma;
0526 struct sk_buff* skb;
0527 void* data;
0528 unsigned long incarn;
0529 struct fore200e_vc_map* vc_map;
0530
0531 } host_txq_entry_t;
0532
0533
0534
0535
0536 typedef struct host_rxq_entry {
0537 struct cp_rxq_entry __iomem *cp_entry;
0538 enum status* status;
0539 struct rpd* rpd;
0540 u32 rpd_dma;
0541 } host_rxq_entry_t;
0542
0543
0544
0545
0546 typedef struct host_bsq_entry {
0547 struct cp_bsq_entry __iomem *cp_entry;
0548 enum status* status;
0549 struct rbd_block* rbd_block;
0550 u32 rbd_block_dma;
0551 } host_bsq_entry_t;
0552
0553
0554
0555
0556 typedef struct host_cmdq_entry {
0557 struct cp_cmdq_entry __iomem *cp_entry;
0558 enum status *status;
0559 } host_cmdq_entry_t;
0560
0561
0562
0563
0564 typedef struct chunk {
0565 void* alloc_addr;
0566 void* align_addr;
0567 dma_addr_t dma_addr;
0568 int direction;
0569 u32 alloc_size;
0570 u32 align_size;
0571 } chunk_t;
0572
0573 #define dma_size align_size
0574
0575
0576
0577
0578 typedef struct buffer {
0579 struct buffer* next;
0580 enum buffer_scheme scheme;
0581 enum buffer_magn magn;
0582 struct chunk data;
0583 #ifdef FORE200E_BSQ_DEBUG
0584 unsigned long index;
0585 int supplied;
0586 #endif
0587 } buffer_t;
0588
0589
0590 #if (BITS_PER_LONG == 32)
0591 #define FORE200E_BUF2HDL(buffer) ((u32)(buffer))
0592 #define FORE200E_HDL2BUF(handle) ((struct buffer*)(handle))
0593 #else
0594 #define FORE200E_BUF2HDL(buffer) ((u32)((u64)(buffer)))
0595 #define FORE200E_HDL2BUF(handle) ((struct buffer*)(((u64)(handle)) | PAGE_OFFSET))
0596 #endif
0597
0598
0599
0600
0601 typedef struct host_cmdq {
0602 struct host_cmdq_entry host_entry[ QUEUE_SIZE_CMD ];
0603 int head;
0604 struct chunk status;
0605 } host_cmdq_t;
0606
0607
0608
0609
0610 typedef struct host_txq {
0611 struct host_txq_entry host_entry[ QUEUE_SIZE_TX ];
0612 int head;
0613 int tail;
0614 struct chunk tpd;
0615 struct chunk status;
0616 int txing;
0617 } host_txq_t;
0618
0619
0620
0621
0622 typedef struct host_rxq {
0623 struct host_rxq_entry host_entry[ QUEUE_SIZE_RX ];
0624 int head;
0625 struct chunk rpd;
0626 struct chunk status;
0627 } host_rxq_t;
0628
0629
0630
0631
0632 typedef struct host_bsq {
0633 struct host_bsq_entry host_entry[ QUEUE_SIZE_BS ];
0634 int head;
0635 struct chunk rbd_block;
0636 struct chunk status;
0637 struct buffer* buffer;
0638 struct buffer* freebuf;
0639 volatile int freebuf_count;
0640 } host_bsq_t;
0641
0642
0643
0644
0645 typedef struct fw_header {
0646 __le32 magic;
0647 __le32 version;
0648 __le32 load_offset;
0649 __le32 start_offset;
0650 } fw_header_t;
0651
0652 #define FW_HEADER_MAGIC 0x65726f66
0653
0654
0655
0656
0657 typedef struct bs_spec {
0658 u32 queue_length;
0659 u32 buffer_size;
0660 u32 pool_size;
0661 u32 supply_blksize;
0662
0663 } bs_spec_t;
0664
0665
0666
0667
0668 typedef struct init_block {
0669 enum opcode opcode;
0670 enum status status;
0671 u32 receive_threshold;
0672 u32 num_connect;
0673 u32 cmd_queue_len;
0674 u32 tx_queue_len;
0675 u32 rx_queue_len;
0676 u32 rsd_extension;
0677 u32 tsd_extension;
0678 u32 conless_vpvc;
0679 u32 pad[ 2 ];
0680 struct bs_spec bs_spec[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ];
0681 } init_block_t;
0682
0683
0684 typedef enum media_type {
0685 MEDIA_TYPE_CAT5_UTP = 0x06,
0686 MEDIA_TYPE_MM_OC3_ST = 0x16,
0687 MEDIA_TYPE_MM_OC3_SC = 0x26,
0688 MEDIA_TYPE_SM_OC3_ST = 0x36,
0689 MEDIA_TYPE_SM_OC3_SC = 0x46
0690 } media_type_t;
0691
0692 #define FORE200E_MEDIA_INDEX(media_type) ((media_type)>>4)
0693
0694
0695
0696
0697 typedef struct cp_queues {
0698 u32 cp_cmdq;
0699 u32 cp_txq;
0700 u32 cp_rxq;
0701 u32 cp_bsq[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ];
0702 u32 imask;
0703 u32 istat;
0704 u32 heap_base;
0705 u32 heap_size;
0706 u32 hlogger;
0707 u32 heartbeat;
0708 u32 fw_release;
0709 u32 mon960_release;
0710 u32 tq_plen;
0711
0712 struct init_block init;
0713 enum media_type media_type;
0714 u32 oc3_revision;
0715 } cp_queues_t;
0716
0717
0718
0719
0720 typedef enum boot_status {
0721 BSTAT_COLD_START = (u32) 0xc01dc01d,
0722 BSTAT_SELFTEST_OK = (u32) 0x02201958,
0723 BSTAT_SELFTEST_FAIL = (u32) 0xadbadbad,
0724 BSTAT_CP_RUNNING = (u32) 0xce11feed,
0725 BSTAT_MON_TOO_BIG = (u32) 0x10aded00
0726 } boot_status_t;
0727
0728
0729
0730
0731 typedef struct soft_uart {
0732 u32 send;
0733 u32 recv;
0734 } soft_uart_t;
0735
0736 #define FORE200E_CP_MONITOR_UART_FREE 0x00000000
0737 #define FORE200E_CP_MONITOR_UART_AVAIL 0x01000000
0738
0739
0740
0741
0742 typedef struct cp_monitor {
0743 struct soft_uart soft_uart;
0744 enum boot_status bstat;
0745 u32 app_base;
0746 u32 mon_version;
0747 } cp_monitor_t;
0748
0749
0750
0751
0752 typedef enum fore200e_state {
0753 FORE200E_STATE_BLANK,
0754 FORE200E_STATE_REGISTER,
0755 FORE200E_STATE_CONFIGURE,
0756 FORE200E_STATE_MAP,
0757 FORE200E_STATE_RESET,
0758 FORE200E_STATE_START_FW,
0759 FORE200E_STATE_INITIALIZE,
0760 FORE200E_STATE_INIT_CMDQ,
0761 FORE200E_STATE_INIT_TXQ,
0762 FORE200E_STATE_INIT_RXQ,
0763 FORE200E_STATE_INIT_BSQ,
0764 FORE200E_STATE_ALLOC_BUF,
0765 FORE200E_STATE_IRQ,
0766 FORE200E_STATE_COMPLETE
0767 } fore200e_state;
0768
0769
0770
0771
0772 typedef struct fore200e_pca_regs {
0773 volatile u32 __iomem * hcr;
0774 volatile u32 __iomem * imr;
0775 volatile u32 __iomem * psr;
0776 } fore200e_pca_regs_t;
0777
0778
0779
0780
0781 typedef struct fore200e_sba_regs {
0782 u32 __iomem *hcr;
0783 u32 __iomem *bsr;
0784 u32 __iomem *isr;
0785 } fore200e_sba_regs_t;
0786
0787
0788
0789
0790 typedef union fore200e_regs {
0791 struct fore200e_pca_regs pca;
0792 struct fore200e_sba_regs sba;
0793 } fore200e_regs;
0794
0795
0796 struct fore200e;
0797
0798
0799
0800 typedef struct fore200e_bus {
0801 char* model_name;
0802 char* proc_name;
0803 int descr_alignment;
0804 int buffer_alignment;
0805 int status_alignment;
0806 u32 (*read)(volatile u32 __iomem *);
0807 void (*write)(u32, volatile u32 __iomem *);
0808 int (*configure)(struct fore200e*);
0809 int (*map)(struct fore200e*);
0810 void (*reset)(struct fore200e*);
0811 int (*prom_read)(struct fore200e*, struct prom_data*);
0812 void (*unmap)(struct fore200e*);
0813 void (*irq_enable)(struct fore200e*);
0814 int (*irq_check)(struct fore200e*);
0815 void (*irq_ack)(struct fore200e*);
0816 int (*proc_read)(struct fore200e*, char*);
0817 } fore200e_bus_t;
0818
0819
0820
0821 typedef struct fore200e_vc_map {
0822 struct atm_vcc* vcc;
0823 unsigned long incarn;
0824 } fore200e_vc_map_t;
0825
0826 #define FORE200E_VC_MAP(fore200e, vpi, vci) \
0827 (& (fore200e)->vc_map[ ((vpi) << FORE200E_VCI_BITS) | (vci) ])
0828
0829
0830
0831
0832 typedef struct fore200e {
0833 struct list_head entry;
0834 const struct fore200e_bus* bus;
0835 union fore200e_regs regs;
0836 struct atm_dev* atm_dev;
0837
0838 enum fore200e_state state;
0839
0840 char name[16];
0841 struct device *dev;
0842 int irq;
0843 unsigned long phys_base;
0844 void __iomem * virt_base;
0845
0846 unsigned char esi[ ESI_LEN ];
0847
0848 struct cp_monitor __iomem * cp_monitor;
0849 struct cp_queues __iomem * cp_queues;
0850 struct host_cmdq host_cmdq;
0851 struct host_txq host_txq;
0852 struct host_rxq host_rxq;
0853
0854 struct host_bsq host_bsq[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ];
0855
0856 u32 available_cell_rate;
0857
0858 int loop_mode;
0859
0860 struct stats* stats;
0861
0862 struct mutex rate_mtx;
0863 spinlock_t q_lock;
0864 #ifdef FORE200E_USE_TASKLET
0865 struct tasklet_struct tx_tasklet;
0866 struct tasklet_struct rx_tasklet;
0867 #endif
0868 unsigned long tx_sat;
0869
0870 unsigned long incarn_count;
0871 struct fore200e_vc_map vc_map[ NBR_CONNECT ];
0872 } fore200e_t;
0873
0874
0875
0876
0877 typedef struct fore200e_vcc {
0878 enum buffer_scheme scheme;
0879 struct tpd_rate rate;
0880 int rx_min_pdu;
0881 int rx_max_pdu;
0882 int tx_min_pdu;
0883 int tx_max_pdu;
0884 unsigned long tx_pdu;
0885 unsigned long rx_pdu;
0886 } fore200e_vcc_t;
0887
0888
0889
0890
0891
0892 #define FORE200E_CP_MONITOR_OFFSET 0x00000400
0893 #define FORE200E_CP_QUEUES_OFFSET 0x00004d40
0894
0895
0896
0897
0898 #define PCA200E_IOSPACE_LENGTH 0x00200000
0899
0900 #define PCA200E_HCR_OFFSET 0x00100000
0901 #define PCA200E_IMR_OFFSET 0x00100004
0902 #define PCA200E_PSR_OFFSET 0x00100008
0903
0904
0905
0906
0907 #define PCA200E_HCR_RESET (1<<0)
0908 #define PCA200E_HCR_HOLD_LOCK (1<<1)
0909 #define PCA200E_HCR_I960FAIL (1<<2)
0910 #define PCA200E_HCR_INTRB (1<<2)
0911 #define PCA200E_HCR_HOLD_ACK (1<<3)
0912 #define PCA200E_HCR_INTRA (1<<3)
0913 #define PCA200E_HCR_OUTFULL (1<<4)
0914 #define PCA200E_HCR_CLRINTR (1<<4)
0915 #define PCA200E_HCR_ESPHOLD (1<<5)
0916 #define PCA200E_HCR_INFULL (1<<6)
0917 #define PCA200E_HCR_TESTMODE (1<<7)
0918
0919
0920
0921
0922 #define PCA200E_PCI_LATENCY 0x40
0923 #define PCA200E_PCI_MASTER_CTRL 0x41
0924 #define PCA200E_PCI_THRESHOLD 0x42
0925
0926
0927
0928 #define PCA200E_CTRL_DIS_CACHE_RD (1<<0)
0929 #define PCA200E_CTRL_DIS_WRT_INVAL (1<<1)
0930 #define PCA200E_CTRL_2_CACHE_WRT_INVAL (1<<2)
0931 #define PCA200E_CTRL_IGN_LAT_TIMER (1<<3)
0932 #define PCA200E_CTRL_ENA_CONT_REQ_MODE (1<<4)
0933 #define PCA200E_CTRL_LARGE_PCI_BURSTS (1<<5)
0934 #define PCA200E_CTRL_CONVERT_ENDIAN (1<<6)
0935
0936
0937
0938 #define SBA200E_PROM_NAME "FORE,sba-200e"
0939
0940
0941
0942
0943 #define SBA200E_HCR_LENGTH 4
0944 #define SBA200E_BSR_LENGTH 4
0945 #define SBA200E_ISR_LENGTH 4
0946 #define SBA200E_RAM_LENGTH 0x40000
0947
0948
0949
0950
0951 #define SBA200E_BSR_BURST4 0x04
0952 #define SBA200E_BSR_BURST8 0x08
0953 #define SBA200E_BSR_BURST16 0x10
0954
0955
0956
0957
0958 #define SBA200E_HCR_RESET (1<<0)
0959 #define SBA200E_HCR_HOLD_LOCK (1<<1)
0960 #define SBA200E_HCR_I960FAIL (1<<2)
0961 #define SBA200E_HCR_I960SETINTR (1<<2)
0962 #define SBA200E_HCR_OUTFULL (1<<3)
0963 #define SBA200E_HCR_INTR_CLR (1<<3)
0964 #define SBA200E_HCR_INTR_ENA (1<<4)
0965 #define SBA200E_HCR_ESPHOLD (1<<5)
0966 #define SBA200E_HCR_INFULL (1<<6)
0967 #define SBA200E_HCR_TESTMODE (1<<7)
0968 #define SBA200E_HCR_INTR_REQ (1<<8)
0969
0970 #define SBA200E_HCR_STICKY (SBA200E_HCR_RESET | SBA200E_HCR_HOLD_LOCK | SBA200E_HCR_INTR_ENA)
0971
0972
0973 #endif
0974 #endif