Blame view

drivers/scsi/scsi_priv.h 5.74 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
  #ifndef _SCSI_PRIV_H
  #define _SCSI_PRIV_H
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
4
5
  #include <linux/device.h>
  
  struct request_queue;
242f9dcb8   Jens Axboe   block: unify requ...
6
  struct request;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
7
8
  struct scsi_cmnd;
  struct scsi_device;
bc4f24014   Alan Stern   [SCSI] implement ...
9
  struct scsi_target;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
10
  struct scsi_host_template;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
  struct Scsi_Host;
84314fd47   James Smart   [SCSI] SCSI and F...
12
  struct scsi_nl_hdr;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
13
14
15
  
  
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
17
   * Scsi Error Handler Flags
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18
  #define SCSI_EH_CANCEL_CMD	0x0001	/* Cancel this cmd */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
21
  
  #define SCSI_SENSE_VALID(scmd) \
  	(((scmd)->sense_buffer[0] & 0x70) == 0x70)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
25
26
27
28
29
  /* hosts.c */
  extern int scsi_init_hosts(void);
  extern void scsi_exit_hosts(void);
  
  /* scsi.c */
  extern int scsi_dispatch_cmd(struct scsi_cmnd *cmd);
  extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
  extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
31
32
33
34
35
36
37
38
39
40
  #ifdef CONFIG_SCSI_LOGGING
  void scsi_log_send(struct scsi_cmnd *cmd);
  void scsi_log_completion(struct scsi_cmnd *cmd, int disposition);
  #else
  static inline void scsi_log_send(struct scsi_cmnd *cmd) 
  	{ };
  static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
  	{ };
  #endif
  
  /* scsi_devinfo.c */
598fa4b77   James Bottomley   enhance device in...
41
42
43
44
  
  /* list of keys for the lists */
  enum {
  	SCSI_DEVINFO_GLOBAL = 0,
a9e0edb68   James Bottomley   scsi_transport_sp...
45
  	SCSI_DEVINFO_SPI,
598fa4b77   James Bottomley   enhance device in...
46
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
47
  extern int scsi_get_device_flags(struct scsi_device *sdev,
7f23e146a   James Bottomley   [SCSI] correct so...
48
49
  				 const unsigned char *vendor,
  				 const unsigned char *model);
598fa4b77   James Bottomley   enhance device in...
50
51
52
53
54
55
  extern int scsi_get_device_flags_keyed(struct scsi_device *sdev,
  				       const unsigned char *vendor,
  				       const unsigned char *model, int key);
  extern int scsi_dev_info_list_add_keyed(int compatible, char *vendor,
  					char *model, char *strflags,
  					int flags, int key);
38a039be2   Peter Jones   [SCSI] Add scsi_d...
56
  extern int scsi_dev_info_list_del_keyed(char *vendor, char *model, int key);
598fa4b77   James Bottomley   enhance device in...
57
58
  extern int scsi_dev_info_add_list(int key, const char *name);
  extern int scsi_dev_info_remove_list(int key);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
60
61
62
  extern int __init scsi_init_devinfo(void);
  extern void scsi_exit_devinfo(void);
  
  /* scsi_error.c */
242f9dcb8   Jens Axboe   block: unify requ...
63
  extern enum blk_eh_timer_return scsi_times_out(struct request *req);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
64
65
66
67
  extern int scsi_error_handler(void *host);
  extern int scsi_decide_disposition(struct scsi_cmnd *cmd);
  extern void scsi_eh_wakeup(struct Scsi_Host *shost);
  extern int scsi_eh_scmd_add(struct scsi_cmnd *, int);
dca84e469   Darrick J. Wong   [SCSI] scsi_error...
68
69
70
71
72
  void scsi_eh_ready_devs(struct Scsi_Host *shost,
  			struct list_head *work_q,
  			struct list_head *done_q);
  int scsi_eh_get_sense(struct list_head *work_q,
  		      struct list_head *done_q);
4a27446f3   Mike Christie   [SCSI] modify scs...
73
  int scsi_noretry_cmd(struct scsi_cmnd *scmd);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
75
76
  
  /* scsi_lib.c */
  extern int scsi_maybe_unblock_host(struct scsi_device *sdev);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
77
78
79
  extern void scsi_device_unbusy(struct scsi_device *sdev);
  extern int scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
  extern void scsi_next_command(struct scsi_cmnd *cmd);
7b3d9545f   Linus Torvalds   Revert "scsi: rev...
80
  extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
81
82
83
84
85
  extern void scsi_run_host_queues(struct Scsi_Host *shost);
  extern struct request_queue *scsi_alloc_queue(struct scsi_device *sdev);
  extern void scsi_free_queue(struct request_queue *q);
  extern int scsi_init_queue(void);
  extern void scsi_exit_queue(void);
751bf4d78   James Bottomley   [SCSI] scsi_sysfs...
86
87
  struct request_queue;
  struct request;
7027ad72a   Martin K. Petersen   [SCSI] Support de...
88
  extern struct kmem_cache *scsi_sdb_cache;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
  
  /* scsi_proc.c */
  #ifdef CONFIG_SCSI_PROC_FS
  extern void scsi_proc_hostdir_add(struct scsi_host_template *);
  extern void scsi_proc_hostdir_rm(struct scsi_host_template *);
  extern void scsi_proc_host_add(struct Scsi_Host *);
  extern void scsi_proc_host_rm(struct Scsi_Host *);
  extern int scsi_init_procfs(void);
  extern void scsi_exit_procfs(void);
  #else
  # define scsi_proc_hostdir_add(sht)	do { } while (0)
  # define scsi_proc_hostdir_rm(sht)	do { } while (0)
  # define scsi_proc_host_add(shost)	do { } while (0)
  # define scsi_proc_host_rm(shost)	do { } while (0)
  # define scsi_init_procfs()		(0)
  # define scsi_exit_procfs()		do { } while (0)
  #endif /* CONFIG_PROC_FS */
  
  /* scsi_scan.c */
  extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
  				   unsigned int, unsigned int, int);
  extern void scsi_forget_host(struct Scsi_Host *);
  extern void scsi_rescan_device(struct device *);
  
  /* scsi_sysctl.c */
  #ifdef CONFIG_SYSCTL
  extern int scsi_init_sysctl(void);
  extern void scsi_exit_sysctl(void);
  #else
  # define scsi_init_sysctl()		(0)
  # define scsi_exit_sysctl()		do { } while (0)
  #endif /* CONFIG_SYSCTL */
  
  /* scsi_sysfs.c */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
123
124
125
126
127
128
129
  extern int scsi_sysfs_add_sdev(struct scsi_device *);
  extern int scsi_sysfs_add_host(struct Scsi_Host *);
  extern int scsi_sysfs_register(void);
  extern void scsi_sysfs_unregister(void);
  extern void scsi_sysfs_device_initialize(struct scsi_device *);
  extern int scsi_sysfs_target_initialize(struct scsi_device *);
  extern struct scsi_transport_template blank_transport_template;
903f4fed8   Alan Stern   [SCSI] fix caller...
130
  extern void __scsi_remove_device(struct scsi_device *);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
131

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
132
  extern struct bus_type scsi_bus_type;
a4dbd6740   David Brownell   driver model: con...
133
  extern const struct attribute_group *scsi_sysfs_shost_attr_groups[];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
134

84314fd47   James Smart   [SCSI] SCSI and F...
135
136
137
138
139
140
141
142
143
  /* scsi_netlink.c */
  #ifdef CONFIG_SCSI_NETLINK
  extern void scsi_netlink_init(void);
  extern void scsi_netlink_exit(void);
  extern struct sock *scsi_nl_sock;
  #else
  static inline void scsi_netlink_init(void) {}
  static inline void scsi_netlink_exit(void) {}
  #endif
db5bd1e0b   Alan Stern   [SCSI] convert to...
144
  /* scsi_pm.c */
aa3386015   Rafael J. Wysocki   PM: Remove CONFIG...
145
  #ifdef CONFIG_PM
db5bd1e0b   Alan Stern   [SCSI] convert to...
146
  extern const struct dev_pm_ops scsi_bus_pm_ops;
db5bd1e0b   Alan Stern   [SCSI] convert to...
147
  #endif
bc4f24014   Alan Stern   [SCSI] implement ...
148
149
150
151
152
153
154
155
156
157
158
  #ifdef CONFIG_PM_RUNTIME
  extern void scsi_autopm_get_target(struct scsi_target *);
  extern void scsi_autopm_put_target(struct scsi_target *);
  extern int scsi_autopm_get_host(struct Scsi_Host *);
  extern void scsi_autopm_put_host(struct Scsi_Host *);
  #else
  static inline void scsi_autopm_get_target(struct scsi_target *t) {}
  static inline void scsi_autopm_put_target(struct scsi_target *t) {}
  static inline int scsi_autopm_get_host(struct Scsi_Host *h) { return 0; }
  static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
  #endif /* CONFIG_PM_RUNTIME */
db5bd1e0b   Alan Stern   [SCSI] convert to...
159

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
160
161
162
163
  /* 
   * internal scsi timeout functions: for use by mid-layer and transport
   * classes.
   */
1c9e16e47   James Smart   [SCSI] update max...
164
  #define SCSI_DEVICE_BLOCK_MAX_TIMEOUT	600	/* units in seconds */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
165
166
167
168
  extern int scsi_internal_device_block(struct scsi_device *sdev);
  extern int scsi_internal_device_unblock(struct scsi_device *sdev);
  
  #endif /* _SCSI_PRIV_H */