aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/fc/fc_fcp.h6
-rw-r--r--include/scsi/libfcoe.h2
-rw-r--r--include/scsi/libsas.h20
-rw-r--r--include/scsi/osd_attributes.h2
-rw-r--r--include/scsi/osd_initiator.h4
-rw-r--r--include/scsi/osd_sec.h4
-rw-r--r--include/scsi/sas_ata.h10
-rw-r--r--include/scsi/scsi_bsg_fc.h2
-rw-r--r--include/scsi/scsi_cmnd.h12
-rw-r--r--include/scsi/scsi_device.h4
-rw-r--r--include/scsi/scsi_devinfo.h1
-rw-r--r--include/scsi/scsi_host.h6
-rw-r--r--include/scsi/scsi_netlink.h24
13 files changed, 49 insertions, 48 deletions
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h
index 0d7d67e96d43..9c8702942b61 100644
--- a/include/scsi/fc/fc_fcp.h
+++ b/include/scsi/fc/fc_fcp.h
@@ -127,6 +127,9 @@ struct fcp_txrdy {
127 * 127 *
128 * All response frames will always contain the fcp_resp template. Some 128 * All response frames will always contain the fcp_resp template. Some
129 * will also include the fcp_resp_len template. 129 * will also include the fcp_resp_len template.
130 *
131 * From Table 23, the FCP_RSP_INFO can either be 4 bytes or 8 bytes, both
132 * are valid length.
130 */ 133 */
131struct fcp_resp { 134struct fcp_resp {
132 __u8 _fr_resvd[8]; /* reserved */ 135 __u8 _fr_resvd[8]; /* reserved */
@@ -156,6 +159,9 @@ struct fcp_resp_rsp_info {
156 __u8 _fr_resvd2[4]; /* reserved */ 159 __u8 _fr_resvd2[4]; /* reserved */
157}; 160};
158 161
162#define FCP_RESP_RSP_INFO_LEN4 4 /* without reserved field */
163#define FCP_RESP_RSP_INFO_LEN8 8 /* with reserved field */
164
159struct fcp_resp_with_ext { 165struct fcp_resp_with_ext {
160 struct fcp_resp resp; 166 struct fcp_resp resp;
161 struct fcp_resp_ext ext; 167 struct fcp_resp_ext ext;
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 22b07cc99808..8742d853a3b8 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -327,7 +327,6 @@ struct fcoe_percpu_s {
327 * @lport: The associated local port 327 * @lport: The associated local port
328 * @fcoe_pending_queue: The pending Rx queue of skbs 328 * @fcoe_pending_queue: The pending Rx queue of skbs
329 * @fcoe_pending_queue_active: Indicates if the pending queue is active 329 * @fcoe_pending_queue_active: Indicates if the pending queue is active
330 * @priority: Packet priority (DCB)
331 * @max_queue_depth: Max queue depth of pending queue 330 * @max_queue_depth: Max queue depth of pending queue
332 * @min_queue_depth: Min queue depth of pending queue 331 * @min_queue_depth: Min queue depth of pending queue
333 * @timer: The queue timer 332 * @timer: The queue timer
@@ -343,7 +342,6 @@ struct fcoe_port {
343 struct fc_lport *lport; 342 struct fc_lport *lport;
344 struct sk_buff_head fcoe_pending_queue; 343 struct sk_buff_head fcoe_pending_queue;
345 u8 fcoe_pending_queue_active; 344 u8 fcoe_pending_queue_active;
346 u8 priority;
347 u32 max_queue_depth; 345 u32 max_queue_depth;
348 u32 min_queue_depth; 346 u32 min_queue_depth;
349 struct timer_list timer; 347 struct timer_list timer;
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index ae33706afeb0..ef937b56f9b5 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -79,7 +79,8 @@ enum phy_event {
79 PHYE_OOB_DONE = 1, 79 PHYE_OOB_DONE = 1,
80 PHYE_OOB_ERROR = 2, 80 PHYE_OOB_ERROR = 2,
81 PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */ 81 PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */
82 PHY_NUM_EVENTS = 4, 82 PHYE_RESUME_TIMEOUT = 4,
83 PHY_NUM_EVENTS = 5,
83}; 84};
84 85
85enum discover_event { 86enum discover_event {
@@ -87,8 +88,10 @@ enum discover_event {
87 DISCE_REVALIDATE_DOMAIN = 1, 88 DISCE_REVALIDATE_DOMAIN = 1,
88 DISCE_PORT_GONE = 2, 89 DISCE_PORT_GONE = 2,
89 DISCE_PROBE = 3, 90 DISCE_PROBE = 3,
90 DISCE_DESTRUCT = 4, 91 DISCE_SUSPEND = 4,
91 DISC_NUM_EVENTS = 5, 92 DISCE_RESUME = 5,
93 DISCE_DESTRUCT = 6,
94 DISC_NUM_EVENTS = 7,
92}; 95};
93 96
94/* ---------- Expander Devices ---------- */ 97/* ---------- Expander Devices ---------- */
@@ -128,7 +131,7 @@ struct ex_phy {
128 u8 attached_sas_addr[SAS_ADDR_SIZE]; 131 u8 attached_sas_addr[SAS_ADDR_SIZE];
129 u8 attached_phy_id; 132 u8 attached_phy_id;
130 133
131 u8 phy_change_count; 134 int phy_change_count;
132 enum routing_attribute routing_attr; 135 enum routing_attribute routing_attr;
133 u8 virtual:1; 136 u8 virtual:1;
134 137
@@ -141,7 +144,7 @@ struct ex_phy {
141struct expander_device { 144struct expander_device {
142 struct list_head children; 145 struct list_head children;
143 146
144 u16 ex_change_count; 147 int ex_change_count;
145 u16 max_route_indexes; 148 u16 max_route_indexes;
146 u8 num_phys; 149 u8 num_phys;
147 150
@@ -169,6 +172,7 @@ struct sata_device {
169 enum ata_command_set command_set; 172 enum ata_command_set command_set;
170 struct smp_resp rps_resp; /* report_phy_sata_resp */ 173 struct smp_resp rps_resp; /* report_phy_sata_resp */
171 u8 port_no; /* port number, if this is a PM (Port) */ 174 u8 port_no; /* port number, if this is a PM (Port) */
175 int pm_result;
172 176
173 struct ata_port *ap; 177 struct ata_port *ap;
174 struct ata_host ata_host; 178 struct ata_host ata_host;
@@ -182,6 +186,7 @@ struct ssp_device {
182 186
183enum { 187enum {
184 SAS_DEV_GONE, 188 SAS_DEV_GONE,
189 SAS_DEV_FOUND, /* device notified to lldd */
185 SAS_DEV_DESTROY, 190 SAS_DEV_DESTROY,
186 SAS_DEV_EH_PENDING, 191 SAS_DEV_EH_PENDING,
187 SAS_DEV_LU_RESET, 192 SAS_DEV_LU_RESET,
@@ -273,6 +278,7 @@ struct asd_sas_port {
273 enum sas_linkrate linkrate; 278 enum sas_linkrate linkrate;
274 279
275 struct sas_work work; 280 struct sas_work work;
281 int suspended;
276 282
277/* public: */ 283/* public: */
278 int id; 284 int id;
@@ -321,6 +327,7 @@ struct asd_sas_phy {
321 unsigned long phy_events_pending; 327 unsigned long phy_events_pending;
322 328
323 int error; 329 int error;
330 int suspended;
324 331
325 struct sas_phy *phy; 332 struct sas_phy *phy;
326 333
@@ -687,6 +694,9 @@ struct sas_domain_function_template {
687 694
688extern int sas_register_ha(struct sas_ha_struct *); 695extern int sas_register_ha(struct sas_ha_struct *);
689extern int sas_unregister_ha(struct sas_ha_struct *); 696extern int sas_unregister_ha(struct sas_ha_struct *);
697extern void sas_prep_resume_ha(struct sas_ha_struct *sas_ha);
698extern void sas_resume_ha(struct sas_ha_struct *sas_ha);
699extern void sas_suspend_ha(struct sas_ha_struct *sas_ha);
690 700
691int sas_set_phy_speed(struct sas_phy *phy, 701int sas_set_phy_speed(struct sas_phy *phy,
692 struct sas_phy_linkrates *rates); 702 struct sas_phy_linkrates *rates);
diff --git a/include/scsi/osd_attributes.h b/include/scsi/osd_attributes.h
index 56e920ade326..303ba1118a4d 100644
--- a/include/scsi/osd_attributes.h
+++ b/include/scsi/osd_attributes.h
@@ -1,7 +1,7 @@
1#ifndef __OSD_ATTRIBUTES_H__ 1#ifndef __OSD_ATTRIBUTES_H__
2#define __OSD_ATTRIBUTES_H__ 2#define __OSD_ATTRIBUTES_H__
3 3
4#include "osd_protocol.h" 4#include <scsi/osd_protocol.h>
5 5
6/* 6/*
7 * Contains types and constants that define attribute pages and attribute 7 * Contains types and constants that define attribute pages and attribute
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h
index 572fb5493661..b2e85fdd2ae0 100644
--- a/include/scsi/osd_initiator.h
+++ b/include/scsi/osd_initiator.h
@@ -14,8 +14,8 @@
14#ifndef __OSD_INITIATOR_H__ 14#ifndef __OSD_INITIATOR_H__
15#define __OSD_INITIATOR_H__ 15#define __OSD_INITIATOR_H__
16 16
17#include "osd_protocol.h" 17#include <scsi/osd_protocol.h>
18#include "osd_types.h" 18#include <scsi/osd_types.h>
19 19
20#include <linux/blkdev.h> 20#include <linux/blkdev.h>
21#include <scsi/scsi_device.h> 21#include <scsi/scsi_device.h>
diff --git a/include/scsi/osd_sec.h b/include/scsi/osd_sec.h
index 4c09fee8ae1e..f96151c9c9e8 100644
--- a/include/scsi/osd_sec.h
+++ b/include/scsi/osd_sec.h
@@ -14,8 +14,8 @@
14#ifndef __OSD_SEC_H__ 14#ifndef __OSD_SEC_H__
15#define __OSD_SEC_H__ 15#define __OSD_SEC_H__
16 16
17#include "osd_protocol.h" 17#include <scsi/osd_protocol.h>
18#include "osd_types.h" 18#include <scsi/osd_types.h>
19 19
20/* 20/*
21 * Contains types and constants of osd capabilities and security 21 * Contains types and constants of osd capabilities and security
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index 2dfbdaa0b34a..ff71a5654684 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -45,6 +45,8 @@ void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q,
45void sas_ata_schedule_reset(struct domain_device *dev); 45void sas_ata_schedule_reset(struct domain_device *dev);
46void sas_ata_wait_eh(struct domain_device *dev); 46void sas_ata_wait_eh(struct domain_device *dev);
47void sas_probe_sata(struct asd_sas_port *port); 47void sas_probe_sata(struct asd_sas_port *port);
48void sas_suspend_sata(struct asd_sas_port *port);
49void sas_resume_sata(struct asd_sas_port *port);
48void sas_ata_end_eh(struct ata_port *ap); 50void sas_ata_end_eh(struct ata_port *ap);
49#else 51#else
50 52
@@ -82,6 +84,14 @@ static inline void sas_probe_sata(struct asd_sas_port *port)
82{ 84{
83} 85}
84 86
87static inline void sas_suspend_sata(struct asd_sas_port *port)
88{
89}
90
91static inline void sas_resume_sata(struct asd_sas_port *port)
92{
93}
94
85static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy) 95static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
86{ 96{
87 return 0; 97 return 0;
diff --git a/include/scsi/scsi_bsg_fc.h b/include/scsi/scsi_bsg_fc.h
index 91a4e4ff9a9b..3031b900b087 100644
--- a/include/scsi/scsi_bsg_fc.h
+++ b/include/scsi/scsi_bsg_fc.h
@@ -26,8 +26,6 @@
26 * This file intended to be included by both kernel and user space 26 * This file intended to be included by both kernel and user space
27 */ 27 */
28 28
29#include <scsi/scsi.h>
30
31/* 29/*
32 * FC Transport SGIO v4 BSG Message Support 30 * FC Transport SGIO v4 BSG Message Support
33 */ 31 */
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index ac06cc595890..de5f5d8f1f8a 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -132,18 +132,10 @@ struct scsi_cmnd {
132 unsigned char tag; /* SCSI-II queued command tag */ 132 unsigned char tag; /* SCSI-II queued command tag */
133}; 133};
134 134
135/* make sure not to use it with REQ_TYPE_BLOCK_PC commands */
135static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) 136static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
136{ 137{
137 struct scsi_driver **sdp; 138 return *(struct scsi_driver **)cmd->request->rq_disk->private_data;
138
139 if (!cmd->request->rq_disk)
140 return NULL;
141
142 sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data;
143 if (!sdp)
144 return NULL;
145
146 return *sdp;
147} 139}
148 140
149extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); 141extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 9895f69294fc..88fae8d20154 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -156,6 +156,7 @@ struct scsi_device {
156 unsigned is_visible:1; /* is the device visible in sysfs */ 156 unsigned is_visible:1; /* is the device visible in sysfs */
157 unsigned can_power_off:1; /* Device supports runtime power off */ 157 unsigned can_power_off:1; /* Device supports runtime power off */
158 unsigned wce_default_on:1; /* Cache is ON by default */ 158 unsigned wce_default_on:1; /* Cache is ON by default */
159 unsigned no_dif:1; /* T10 PI (DIF) should be disabled */
159 160
160 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 161 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
161 struct list_head event_list; /* asserted events */ 162 struct list_head event_list; /* asserted events */
@@ -476,6 +477,9 @@ static inline int scsi_device_enclosure(struct scsi_device *sdev)
476 477
477static inline int scsi_device_protection(struct scsi_device *sdev) 478static inline int scsi_device_protection(struct scsi_device *sdev)
478{ 479{
480 if (sdev->no_dif)
481 return 0;
482
479 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); 483 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0);
480} 484}
481 485
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index b4ddd3b18b4c..cc1f3e786ad7 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -30,4 +30,5 @@
30#define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ 30#define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */
31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ 31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */
32#define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ 32#define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */
33#define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */
33#endif 34#endif
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 5f7d5b3b1c6e..49084807eb6b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -873,6 +873,9 @@ static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsign
873 SHOST_DIF_TYPE2_PROTECTION, 873 SHOST_DIF_TYPE2_PROTECTION,
874 SHOST_DIF_TYPE3_PROTECTION }; 874 SHOST_DIF_TYPE3_PROTECTION };
875 875
876 if (target_type > SHOST_DIF_TYPE3_PROTECTION)
877 return 0;
878
876 return shost->prot_capabilities & cap[target_type] ? target_type : 0; 879 return shost->prot_capabilities & cap[target_type] ? target_type : 0;
877} 880}
878 881
@@ -884,6 +887,9 @@ static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsign
884 SHOST_DIX_TYPE2_PROTECTION, 887 SHOST_DIX_TYPE2_PROTECTION,
885 SHOST_DIX_TYPE3_PROTECTION }; 888 SHOST_DIX_TYPE3_PROTECTION };
886 889
890 if (target_type > SHOST_DIX_TYPE3_PROTECTION)
891 return 0;
892
887 return shost->prot_capabilities & cap[target_type]; 893 return shost->prot_capabilities & cap[target_type];
888#endif 894#endif
889 return 0; 895 return 0;
diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h
index 5cb20ccb1956..62b4edab15d3 100644
--- a/include/scsi/scsi_netlink.h
+++ b/include/scsi/scsi_netlink.h
@@ -119,29 +119,5 @@ struct scsi_nl_host_vendor_msg {
119 (hdr)->msglen = mlen; \ 119 (hdr)->msglen = mlen; \
120 } 120 }
121 121
122
123#ifdef __KERNEL__
124
125#include <scsi/scsi_host.h>
126
127/* Exported Kernel Interfaces */
128int scsi_nl_add_transport(u8 tport,
129 int (*msg_handler)(struct sk_buff *),
130 void (*event_handler)(struct notifier_block *, unsigned long, void *));
131void scsi_nl_remove_transport(u8 tport);
132
133int scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt,
134 int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload,
135 u32 len, u32 pid),
136 void (*nlevt_handler)(struct notifier_block *nb,
137 unsigned long event, void *notify_ptr));
138void scsi_nl_remove_driver(u64 vendor_id);
139
140void scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr);
141int scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id,
142 char *data_buf, u32 data_len);
143
144#endif /* __KERNEL__ */
145
146#endif /* SCSI_NETLINK_H */ 122#endif /* SCSI_NETLINK_H */
147 123