cpqarray.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  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 arrays@compaq.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/locks.h>
  30. #include <linux/slab.h>
  31. #include <linux/proc_fs.h>
  32. #include <linux/timer.h>
  33. #endif
  34. #include "ida_cmd.h"
  35. #define IO_OK 0
  36. #define IO_ERROR 1
  37. #define NWD 16
  38. #define NWD_SHIFT 4
  39. #define IDA_MAX_PART 16
  40. #define IDA_TIMER (5*HZ)
  41. #define IDA_TIMEOUT (10*HZ)
  42. #define MISC_NONFATAL_WARN 0x01
  43. typedef struct {
  44. unsigned blk_size;
  45. unsigned nr_blks;
  46. unsigned cylinders;
  47. unsigned heads;
  48. unsigned sectors;
  49. int usage_count;
  50. } drv_info_t;
  51. #ifdef __KERNEL__
  52. struct ctlr_info;
  53. typedef struct ctlr_info ctlr_info_t;
  54. struct access_method {
  55. void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
  56. void (*set_intr_mask)(ctlr_info_t *h, unsigned long val);
  57. unsigned long (*fifo_full)(ctlr_info_t *h);
  58. unsigned long (*intr_pending)(ctlr_info_t *h);
  59. unsigned long (*command_completed)(ctlr_info_t *h);
  60. };
  61. struct board_type {
  62. __u32 board_id;
  63. char *product_name;
  64. struct access_method *access;
  65. };
  66. struct ctlr_info {
  67. int ctlr;
  68. char devname[8];
  69. __u32 log_drv_map;
  70. __u32 drv_assign_map;
  71. __u32 drv_spare_map;
  72. __u32 mp_failed_drv_map;
  73. char firm_rev[4];
  74. struct pci_dev *pdev;
  75. int ctlr_sig;
  76. int log_drives;
  77. int highest_lun;
  78. int phys_drives;
  79. struct pci_dev *pci_dev;    /* NULL if EISA */
  80. __u32 board_id;
  81. char *product_name;
  82. void *vaddr;
  83. unsigned long paddr;
  84. unsigned long io_mem_addr;
  85. unsigned long io_mem_length;
  86. int intr;
  87. int usage_count;
  88. drv_info_t drv[NWD];
  89. struct proc_dir_entry *proc;
  90. struct access_method access;
  91. cmdlist_t *reqQ;
  92. cmdlist_t *cmpQ;
  93. cmdlist_t *cmd_pool;
  94. dma_addr_t cmd_pool_dhandle;
  95. __u32 *cmd_pool_bits;
  96. unsigned int Qdepth;
  97. unsigned int maxQsinceinit;
  98. unsigned int nr_requests;
  99. unsigned int nr_allocs;
  100. unsigned int nr_frees;
  101. struct timer_list timer;
  102. unsigned int misc_tflags;
  103. // Disk structures we need to pass back
  104. struct gendisk gendisk;
  105. // Index by Minor Numbers
  106. struct hd_struct hd[256];
  107. int sizes[256];
  108. int blocksizes[256];
  109. int hardsizes[256];
  110. };
  111. #endif
  112. #endif /* CPQARRAY_H */