Merge with Linux 2.5.74.
[linux-2.6/linux-mips.git] / drivers / scsi / hosts.h
blob03d03ea3691a55153f764f634f84c95e44c7c212
1 /*
2 * hosts.h Copyright (C) 1992 Drew Eckhardt
3 * Copyright (C) 1993, 1994, 1995, 1998, 1999 Eric Youngdale
5 * mid to low-level SCSI driver interface header
6 * Initial versions: Drew Eckhardt
7 * Subsequent revisions: Eric Youngdale
9 * <drew@colorado.edu>
11 * Modified by Eric Youngdale eric@andante.org to
12 * add scatter-gather, multiple outstanding request, and other
13 * enhancements.
15 * Further modified by Eric Youngdale to support multiple host adapters
16 * of the same type.
18 * Jiffies wrap fixes (host->resetting), 3 Dec 1998 Andrea Arcangeli
20 * Restructured scsi_host lists and associated functions.
21 * September 04, 2002 Mike Anderson (andmike@us.ibm.com)
24 #ifndef _HOSTS_H
25 #define _HOSTS_H
27 #include <linux/config.h>
28 #include <linux/proc_fs.h>
30 #include <scsi/scsi_host.h>
32 /**
33 * scsi_find_device - find a device given the host
34 * @shost: SCSI host pointer
35 * @channel: SCSI channel (zero if only one channel)
36 * @pun: SCSI target number (physical unit number)
37 * @lun: SCSI Logical Unit Number
38 **/
39 static inline struct scsi_device *scsi_find_device(struct Scsi_Host *shost,
40 int channel, int pun, int lun) {
41 struct scsi_device *sdev;
43 list_for_each_entry (sdev, &shost->my_devices, siblings)
44 if (sdev->channel == channel && sdev->id == pun
45 && sdev->lun ==lun)
46 return sdev;
47 return NULL;
50 #endif