aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-12 21:27:47 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-12 21:27:47 -0400
commitb981d8b3f5e008ff10d993be633ad00564fc22cd (patch)
treee292dc07b22308912cf6a58354a608b9e5e8e1fd /include/scsi
parentb11d2127c4893a7315d1e16273bc8560049fa3ca (diff)
parent2b9e0aae1d50e880c58d46788e5e3ebd89d75d62 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/macintosh/adbhid.c
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libiscsi.h10
-rw-r--r--include/scsi/libsas.h17
-rw-r--r--include/scsi/sas_ata.h60
-rw-r--r--include/scsi/scsi_driver.h2
-rw-r--r--include/scsi/scsi_host.h2
-rw-r--r--include/scsi/scsi_transport_sas.h11
-rw-r--r--include/scsi/sd.h2
7 files changed, 97 insertions, 7 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 3f631b08a1ab..b4b31132618b 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -205,11 +205,21 @@ struct iscsi_queue {
205}; 205};
206 206
207struct iscsi_session { 207struct iscsi_session {
208 /*
209 * Syncs up the scsi eh thread with the iscsi eh thread when sending
210 * task management functions. This must be taken before the session
211 * and recv lock.
212 */
213 struct mutex eh_mutex;
214
208 /* iSCSI session-wide sequencing */ 215 /* iSCSI session-wide sequencing */
209 uint32_t cmdsn; 216 uint32_t cmdsn;
210 uint32_t exp_cmdsn; 217 uint32_t exp_cmdsn;
211 uint32_t max_cmdsn; 218 uint32_t max_cmdsn;
212 219
220 /* This tracks the reqs queued into the initiator */
221 uint32_t queued_cmdsn;
222
213 /* configuration */ 223 /* configuration */
214 int initial_r2t_en; 224 int initial_r2t_en;
215 unsigned max_r2t; 225 unsigned max_r2t;
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 2e6bdc4e7a0a..8dda2d66b5b9 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -30,6 +30,7 @@
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <scsi/sas.h> 32#include <scsi/sas.h>
33#include <linux/libata.h>
33#include <linux/list.h> 34#include <linux/list.h>
34#include <asm/semaphore.h> 35#include <asm/semaphore.h>
35#include <scsi/scsi_device.h> 36#include <scsi/scsi_device.h>
@@ -165,6 +166,13 @@ struct sata_device {
165 166
166 u8 port_no; /* port number, if this is a PM (Port) */ 167 u8 port_no; /* port number, if this is a PM (Port) */
167 struct list_head children; /* PM Ports if this is a PM */ 168 struct list_head children; /* PM Ports if this is a PM */
169
170 struct ata_port *ap;
171 struct ata_host ata_host;
172 struct ata_taskfile tf;
173 u32 sstatus;
174 u32 serror;
175 u32 scontrol;
168}; 176};
169 177
170/* ---------- Domain device ---------- */ 178/* ---------- Domain device ---------- */
@@ -340,7 +348,7 @@ struct sas_ha_struct {
340 348
341/* public: */ 349/* public: */
342 char *sas_ha_name; 350 char *sas_ha_name;
343 struct pci_dev *pcidev; /* should be set */ 351 struct device *dev; /* should be set */
344 struct module *lldd_module; /* should be set */ 352 struct module *lldd_module; /* should be set */
345 353
346 u8 *sas_addr; /* must be set */ 354 u8 *sas_addr; /* must be set */
@@ -624,6 +632,7 @@ int sas_set_phy_speed(struct sas_phy *phy,
624 struct sas_phy_linkrates *rates); 632 struct sas_phy_linkrates *rates);
625int sas_phy_enable(struct sas_phy *phy, int enabled); 633int sas_phy_enable(struct sas_phy *phy, int enabled);
626int sas_phy_reset(struct sas_phy *phy, int hard_reset); 634int sas_phy_reset(struct sas_phy *phy, int hard_reset);
635int sas_queue_up(struct sas_task *task);
627extern int sas_queuecommand(struct scsi_cmnd *, 636extern int sas_queuecommand(struct scsi_cmnd *,
628 void (*scsi_done)(struct scsi_cmnd *)); 637 void (*scsi_done)(struct scsi_cmnd *));
629extern int sas_target_alloc(struct scsi_target *); 638extern int sas_target_alloc(struct scsi_target *);
@@ -661,4 +670,10 @@ int __sas_task_abort(struct sas_task *);
661int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); 670int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
662int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd); 671int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
663 672
673extern void sas_target_destroy(struct scsi_target *);
674extern int sas_slave_alloc(struct scsi_device *);
675extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);
676
677extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
678 struct request *req);
664#endif /* _SASLIB_H_ */ 679#endif /* _SASLIB_H_ */
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
new file mode 100644
index 000000000000..dd5edc915417
--- /dev/null
+++ b/include/scsi/sas_ata.h
@@ -0,0 +1,60 @@
1/*
2 * Support for SATA devices on Serial Attached SCSI (SAS) controllers
3 *
4 * Copyright (C) 2006 IBM Corporation
5 *
6 * Written by: Darrick J. Wong <djwong@us.ibm.com>, IBM Corporation
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 *
23 */
24
25#ifndef _SAS_ATA_H_
26#define _SAS_ATA_H_
27
28#include <linux/libata.h>
29#include <scsi/libsas.h>
30
31#ifdef CONFIG_SCSI_SAS_ATA
32
33static inline int dev_is_sata(struct domain_device *dev)
34{
35 return (dev->rphy->identify.target_port_protocols & SAS_PROTOCOL_SATA);
36}
37
38int sas_ata_init_host_and_port(struct domain_device *found_dev,
39 struct scsi_target *starget);
40
41void sas_ata_task_abort(struct sas_task *task);
42
43#else
44
45
46static inline int dev_is_sata(struct domain_device *dev)
47{
48 return 0;
49}
50int sas_ata_init_host_and_port(struct domain_device *found_dev,
51 struct scsi_target *starget)
52{
53 return 0;
54}
55void sas_ata_task_abort(struct sas_task *task)
56{
57}
58#endif
59
60#endif /* _SAS_ATA_H_ */
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 02e26c1672bf..3465f31a21c4 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -13,8 +13,6 @@ struct scsi_driver {
13 13
14 int (*init_command)(struct scsi_cmnd *); 14 int (*init_command)(struct scsi_cmnd *);
15 void (*rescan)(struct device *); 15 void (*rescan)(struct device *);
16 int (*issue_flush)(struct device *, sector_t *);
17 int (*prepare_flush)(struct request_queue *, struct request *);
18}; 16};
19#define to_scsi_driver(drv) \ 17#define to_scsi_driver(drv) \
20 container_of((drv), struct scsi_driver, gendrv) 18 container_of((drv), struct scsi_driver, gendrv)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index ba07cf7c04ba..3b8a6a85c2f8 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -341,7 +341,7 @@ struct scsi_host_template {
341 /* 341 /*
342 * Name of proc directory 342 * Name of proc directory
343 */ 343 */
344 char *proc_name; 344 const char *proc_name;
345 345
346 /* 346 /*
347 * Used to store the procfs directory if a driver implements the 347 * Used to store the procfs directory if a driver implements the
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 9aedc19820b0..abdfd2e27dd7 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -7,7 +7,7 @@
7 7
8struct scsi_transport_template; 8struct scsi_transport_template;
9struct sas_rphy; 9struct sas_rphy;
10 10struct request;
11 11
12enum sas_device_type { 12enum sas_device_type {
13 SAS_PHY_UNUSED, 13 SAS_PHY_UNUSED,
@@ -23,6 +23,12 @@ enum sas_protocol {
23 SAS_PROTOCOL_SSP = 0x08, 23 SAS_PROTOCOL_SSP = 0x08,
24}; 24};
25 25
26static inline int sas_protocol_ata(enum sas_protocol proto)
27{
28 return ((proto & SAS_PROTOCOL_SATA) ||
29 (proto & SAS_PROTOCOL_STP))? 1 : 0;
30}
31
26enum sas_linkrate { 32enum sas_linkrate {
27 /* These Values are defined in the SAS standard */ 33 /* These Values are defined in the SAS standard */
28 SAS_LINK_RATE_UNKNOWN = 0, 34 SAS_LINK_RATE_UNKNOWN = 0,
@@ -85,10 +91,12 @@ struct sas_phy {
85#define phy_to_shost(phy) \ 91#define phy_to_shost(phy) \
86 dev_to_shost((phy)->dev.parent) 92 dev_to_shost((phy)->dev.parent)
87 93
94struct request_queue;
88struct sas_rphy { 95struct sas_rphy {
89 struct device dev; 96 struct device dev;
90 struct sas_identify identify; 97 struct sas_identify identify;
91 struct list_head list; 98 struct list_head list;
99 struct request_queue *q;
92 u32 scsi_target_id; 100 u32 scsi_target_id;
93}; 101};
94 102
@@ -166,6 +174,7 @@ struct sas_function_template {
166 int (*phy_reset)(struct sas_phy *, int); 174 int (*phy_reset)(struct sas_phy *, int);
167 int (*phy_enable)(struct sas_phy *, int); 175 int (*phy_enable)(struct sas_phy *, int);
168 int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *); 176 int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *);
177 int (*smp_handler)(struct Scsi_Host *, struct sas_rphy *, struct request *);
169}; 178};
170 179
171 180
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index 5261488e1108..ce02ad1f5185 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -56,8 +56,6 @@ static int sd_suspend(struct device *dev, pm_message_t state);
56static int sd_resume(struct device *dev); 56static int sd_resume(struct device *dev);
57static void sd_rescan(struct device *); 57static void sd_rescan(struct device *);
58static int sd_init_command(struct scsi_cmnd *); 58static int sd_init_command(struct scsi_cmnd *);
59static int sd_issue_flush(struct device *, sector_t *);
60static void sd_prepare_flush(request_queue_t *, struct request *);
61static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); 59static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
62static void scsi_disk_release(struct class_device *cdev); 60static void scsi_disk_release(struct class_device *cdev);
63static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); 61static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);