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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * Generic Generic NCR5380 driver defines
  3.  *
  4.  * Copyright 1993, Drew Eckhardt
  5.  * Visionary Computing
  6.  * (Unix and Linux consulting and custom programming)
  7.  * drew@colorado.edu
  8.  *      +1 (303) 440-4894
  9.  *
  10.  * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
  11.  *    K.Lentin@cs.monash.edu.au
  12.  *
  13.  * ALPHA RELEASE 1. 
  14.  *
  15.  * For more information, please consult 
  16.  *
  17.  * NCR 5380 Family
  18.  * SCSI Protocol Controller
  19.  * Databook
  20.  *
  21.  * NCR Microelectronics
  22.  * 1635 Aeroplaza Drive
  23.  * Colorado Springs, CO 80916
  24.  * 1+ (719) 578-3400
  25.  * 1+ (800) 334-5454
  26.  */
  27. /*
  28.  * $Log: generic_NCR5380.h,v $
  29.  */
  30. #ifndef GENERIC_NCR5380_H
  31. #define GENERIC_NCR5380_H
  32. #include <linux/config.h>
  33. #define GENERIC_NCR5380_PUBLIC_RELEASE 1
  34. #ifdef NCR53C400
  35. #define BIOSPARAM
  36. #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
  37. #else
  38. #define NCR5380_BIOSPARAM NULL
  39. #endif
  40. int generic_NCR5380_abort(Scsi_Cmnd *);
  41. int generic_NCR5380_detect(Scsi_Host_Template *);
  42. int generic_NCR5380_release_resources(struct Scsi_Host *);
  43. int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
  44. int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int);
  45. int notyet_generic_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
  46. const char *generic_NCR5380_info(struct Scsi_Host *);
  47. #ifdef BIOSPARAM
  48. int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
  49. #endif
  50. int generic_NCR5380_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
  51. #ifndef CMD_PER_LUN
  52. #define CMD_PER_LUN 2
  53. #endif
  54. #ifndef CAN_QUEUE
  55. #define CAN_QUEUE 16
  56. #endif
  57. #define GENERIC_NCR5380 {
  58. proc_info:      generic_NCR5380_proc_info,
  59. name:           "Generic NCR5380/NCR53C400 Scsi Driver",
  60. detect:         generic_NCR5380_detect,
  61. release:        generic_NCR5380_release_resources,
  62. info:           (void *)generic_NCR5380_info,
  63. queuecommand:   generic_NCR5380_queue_command,
  64. abort:          generic_NCR5380_abort,
  65. reset:          generic_NCR5380_reset, 
  66. bios_param:     NCR5380_BIOSPARAM,
  67. can_queue:      CAN_QUEUE,
  68.         this_id:        7,
  69.         sg_tablesize:   SG_ALL,
  70. cmd_per_lun:    CMD_PER_LUN ,
  71.         use_clustering: DISABLE_CLUSTERING}
  72. #ifndef HOSTS_C
  73. #define __STRVAL(x) #x
  74. #define STRVAL(x) __STRVAL(x)
  75. #ifdef CONFIG_SCSI_G_NCR5380_PORT
  76. #define NCR5380_map_config port
  77. #define NCR5380_map_type int
  78. #define NCR5380_map_name port
  79. #define NCR5380_instance_name io_port
  80. #define NCR53C400_register_offset 0
  81. #define NCR53C400_address_adjust 8
  82. /*
  83.  * FIXME: size should be runtime decided
  84.  */
  85. #ifdef NCR53C400
  86. #define NCR5380_region_size 16
  87. #else
  88. #define NCR5380_region_size 8
  89. #endif
  90. #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
  91. #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
  92. #else
  93. /* therefore CONFIG_SCSI_G_NCR5380_MEM */
  94. #define NCR5380_map_config memory
  95. #define NCR5380_map_type unsigned long
  96. #define NCR5380_map_name base
  97. #define NCR5380_instance_name base
  98. #define NCR53C400_register_offset 0x108
  99. #define NCR53C400_address_adjust 0
  100. #define NCR53C400_mem_base 0x3880
  101. #define NCR53C400_host_buffer 0x3900
  102. #define NCR5380_region_size 0x3a00
  103. #define NCR5380_read(reg) isa_readb(NCR5380_map_name + NCR53C400_mem_base + (reg))
  104. #define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + NCR53C400_mem_base + (reg), value)
  105. #endif
  106. #define NCR5380_implementation_fields 
  107.     NCR5380_map_type NCR5380_map_name
  108. #define NCR5380_local_declare() 
  109.     register NCR5380_implementation_fields
  110. #define NCR5380_setup(instance) 
  111.     NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
  112. #define NCR5380_intr generic_NCR5380_intr
  113. #define do_NCR5380_intr do_generic_NCR5380_intr
  114. #define NCR5380_queue_command generic_NCR5380_queue_command
  115. #define NCR5380_abort generic_NCR5380_abort
  116. #define NCR5380_reset generic_NCR5380_reset
  117. #define NCR5380_pread generic_NCR5380_pread
  118. #define NCR5380_pwrite generic_NCR5380_pwrite
  119. #define NCR5380_proc_info notyet_generic_proc_info
  120. #define BOARD_NCR5380 0
  121. #define BOARD_NCR53C400 1
  122. #define BOARD_NCR53C400A 2
  123. #define BOARD_DTC3181E 3
  124. #endif /* else def HOSTS_C */
  125. #endif /* GENERIC_NCR5380_H */