cpqarray.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Disk Array driver for Compaq SMART2 Controllers
  3. * Copyright 1998 Compaq Computer Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  13. * NON INFRINGEMENT. See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. *
  19. * Questions/Comments/Bugfixes to iss_storagedev@hp.com
  20. *
  21. * If you want to make changes, improve or add functionality to this
  22. * driver, you'll probably need the Compaq Array Controller Interface
  23. * Specificiation (Document number ECG086/1198)
  24. */
  25. #ifndef CPQARRAY_H
  26. #define CPQARRAY_H
  27. #ifdef __KERNEL__
  28. #include <linux/blkdev.h>
  29. #include <linux/slab.h>
  30. #include <linux/proc_fs.h>
  31. #include <linux/timer.h>
  32. #endif
  33. #include "ida_cmd.h"
  34. #define IO_OK 0
  35. #define IO_ERROR 1
  36. #define NWD 16
  37. #define NWD_SHIFT 4
  38. #define IDA_TIMER (5*HZ)
  39. #define IDA_TIMEOUT (10*HZ)
  40. #define MISC_NONFATAL_WARN 0x01
  41. typedef struct {
  42. unsigned blk_size;
  43. unsigned nr_blks;
  44. unsigned cylinders;
  45. unsigned heads;
  46. unsigned sectors;
  47. int usage_count;
  48. } drv_info_t;
  49. #ifdef __KERNEL__
  50. struct ctlr_info;
  51. typedef struct ctlr_info ctlr_info_t;
  52. struct access_method {
  53. void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
  54. void (*set_intr_mask)(ctlr_info_t *h, unsigned long val);
  55. unsigned long (*fifo_full)(ctlr_info_t *h);
  56. unsigned long (*intr_pending)(ctlr_info_t *h);
  57. unsigned long (*command_completed)(ctlr_info_t *h);
  58. };
  59. struct board_type {
  60. __u32 board_id;
  61. char *product_name;
  62. struct access_method *access;
  63. };
  64. struct ctlr_info {
  65. int ctlr;
  66. char devname[8];
  67. __u32 log_drv_map;
  68. __u32 drv_assign_map;
  69. __u32 drv_spare_map;
  70. __u32 mp_failed_drv_map;
  71. char firm_rev[4];
  72. int ctlr_sig;
  73. int log_drives;
  74. int phys_drives;
  75. struct pci_dev *pci_dev; /* NULL if EISA */
  76. __u32 board_id;
  77. char *product_name;
  78. void __iomem *vaddr;
  79. unsigned long paddr;
  80. unsigned long io_mem_addr;
  81. unsigned long io_mem_length;
  82. int intr;
  83. int usage_count;
  84. drv_info_t drv[NWD];
  85. struct proc_dir_entry *proc;
  86. struct access_method access;
  87. cmdlist_t *reqQ;
  88. cmdlist_t *cmpQ;
  89. cmdlist_t *cmd_pool;
  90. dma_addr_t cmd_pool_dhandle;
  91. unsigned long *cmd_pool_bits;
  92. struct request_queue *queue;
  93. spinlock_t lock;
  94. unsigned int Qdepth;
  95. unsigned int maxQsinceinit;
  96. unsigned int nr_requests;
  97. unsigned int nr_allocs;
  98. unsigned int nr_frees;
  99. struct timer_list timer;
  100. unsigned int misc_tflags;
  101. };
  102. #define IDA_LOCK(i) (&hba[i]->lock)
  103. #endif
  104. #endif /* CPQARRAY_H */