diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 1 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
-rw-r--r-- | include/linux/workqueue.h | 6 | ||||
-rw-r--r-- | include/scsi/scsi.h | 2 | ||||
-rw-r--r-- | include/scsi/scsi_cmnd.h | 20 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 16 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 14 | ||||
-rw-r--r-- | include/scsi/scsi_transport.h | 11 | ||||
-rw-r--r-- | include/scsi/scsi_transport_sas.h | 53 | ||||
-rw-r--r-- | include/scsi/scsi_transport_spi.h | 4 |
10 files changed, 101 insertions, 28 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 58df18d9cd3e..e8ac5bcfbec7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -378,6 +378,7 @@ extern void device_bind_driver(struct device * dev); | |||
378 | extern void device_release_driver(struct device * dev); | 378 | extern void device_release_driver(struct device * dev); |
379 | extern int device_attach(struct device * dev); | 379 | extern int device_attach(struct device * dev); |
380 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
381 | extern void device_reprobe(struct device *dev); | ||
381 | 382 | ||
382 | 383 | ||
383 | /* | 384 | /* |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1709b5009d2e..a6fdbe13a245 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -852,6 +852,8 @@ | |||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 | 852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 | 853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 | 854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 |
855 | #define PCI_DEVICE_ID_QLOGIC_ISP5422 0x5422 | ||
856 | #define PCI_DEVICE_ID_QLOGIC_ISP5432 0x5432 | ||
855 | 857 | ||
856 | #define PCI_VENDOR_ID_CYRIX 0x1078 | 858 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
857 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 | 859 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 86b111300231..957c21c16d62 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -20,6 +20,10 @@ struct work_struct { | |||
20 | struct timer_list timer; | 20 | struct timer_list timer; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct execute_work { | ||
24 | struct work_struct work; | ||
25 | }; | ||
26 | |||
23 | #define __WORK_INITIALIZER(n, f, d) { \ | 27 | #define __WORK_INITIALIZER(n, f, d) { \ |
24 | .entry = { &(n).entry, &(n).entry }, \ | 28 | .entry = { &(n).entry, &(n).entry }, \ |
25 | .func = (f), \ | 29 | .func = (f), \ |
@@ -74,6 +78,8 @@ extern void init_workqueues(void); | |||
74 | void cancel_rearming_delayed_work(struct work_struct *work); | 78 | void cancel_rearming_delayed_work(struct work_struct *work); |
75 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | 79 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, |
76 | struct work_struct *); | 80 | struct work_struct *); |
81 | int execute_in_process_context(void (*fn)(void *), void *, | ||
82 | struct execute_work *); | ||
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 85 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 9c331258bc27..c60b8ff2f5e4 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -433,6 +433,4 @@ struct scsi_lun { | |||
433 | /* Used to obtain the PCI location of a device */ | 433 | /* Used to obtain the PCI location of a device */ |
434 | #define SCSI_IOCTL_GET_PCI 0x5387 | 434 | #define SCSI_IOCTL_GET_PCI 0x5387 |
435 | 435 | ||
436 | int scsi_execute_in_process_context(void (*fn)(void *data), void *data); | ||
437 | |||
438 | #endif /* _SCSI_SCSI_H */ | 436 | #endif /* _SCSI_SCSI_H */ |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 7529f4388bb4..1ace1b9fe537 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -104,10 +104,10 @@ struct scsi_cmnd { | |||
104 | working on */ | 104 | working on */ |
105 | 105 | ||
106 | #define SCSI_SENSE_BUFFERSIZE 96 | 106 | #define SCSI_SENSE_BUFFERSIZE 96 |
107 | unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; /* obtained by REQUEST SENSE | 107 | unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; |
108 | * when CHECK CONDITION is | 108 | /* obtained by REQUEST SENSE when |
109 | * received on original command | 109 | * CHECK CONDITION is received on original |
110 | * (auto-sense) */ | 110 | * command (auto-sense) */ |
111 | 111 | ||
112 | /* Low-level done function - can be used by low-level driver to point | 112 | /* Low-level done function - can be used by low-level driver to point |
113 | * to completion function. Not used by mid/upper level code. */ | 113 | * to completion function. Not used by mid/upper level code. */ |
@@ -120,12 +120,12 @@ struct scsi_cmnd { | |||
120 | struct scsi_pointer SCp; /* Scratchpad used by some host adapters */ | 120 | struct scsi_pointer SCp; /* Scratchpad used by some host adapters */ |
121 | 121 | ||
122 | unsigned char *host_scribble; /* The host adapter is allowed to | 122 | unsigned char *host_scribble; /* The host adapter is allowed to |
123 | * call scsi_malloc and get some memory | 123 | * call scsi_malloc and get some memory |
124 | * and hang it here. The host adapter | 124 | * and hang it here. The host adapter |
125 | * is also expected to call scsi_free | 125 | * is also expected to call scsi_free |
126 | * to release this memory. (The memory | 126 | * to release this memory. (The memory |
127 | * obtained by scsi_malloc is guaranteed | 127 | * obtained by scsi_malloc is guaranteed |
128 | * to be at an address < 16Mb). */ | 128 | * to be at an address < 16Mb). */ |
129 | 129 | ||
130 | int result; /* Status code from lower level driver */ | 130 | int result; /* Status code from lower level driver */ |
131 | 131 | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 290e3b4d2aec..1ec17ee12815 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/workqueue.h> | ||
7 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
8 | 9 | ||
9 | struct request_queue; | 10 | struct request_queue; |
@@ -73,7 +74,6 @@ struct scsi_device { | |||
73 | unsigned sector_size; /* size in bytes */ | 74 | unsigned sector_size; /* size in bytes */ |
74 | 75 | ||
75 | void *hostdata; /* available to low-level driver */ | 76 | void *hostdata; /* available to low-level driver */ |
76 | char devfs_name[256]; /* devfs junk */ | ||
77 | char type; | 77 | char type; |
78 | char scsi_level; | 78 | char scsi_level; |
79 | char inq_periph_qual; /* PQ from INQUIRY data */ | 79 | char inq_periph_qual; /* PQ from INQUIRY data */ |
@@ -138,6 +138,8 @@ struct scsi_device { | |||
138 | struct device sdev_gendev; | 138 | struct device sdev_gendev; |
139 | struct class_device sdev_classdev; | 139 | struct class_device sdev_classdev; |
140 | 140 | ||
141 | struct execute_work ew; /* used to get process context on put */ | ||
142 | |||
141 | enum scsi_device_state sdev_state; | 143 | enum scsi_device_state sdev_state; |
142 | unsigned long sdev_data[0]; | 144 | unsigned long sdev_data[0]; |
143 | } __attribute__((aligned(sizeof(unsigned long)))); | 145 | } __attribute__((aligned(sizeof(unsigned long)))); |
@@ -154,6 +156,11 @@ struct scsi_device { | |||
154 | #define scmd_printk(prefix, scmd, fmt, a...) \ | 156 | #define scmd_printk(prefix, scmd, fmt, a...) \ |
155 | dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a) | 157 | dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a) |
156 | 158 | ||
159 | enum scsi_target_state { | ||
160 | STARGET_RUNNING = 1, | ||
161 | STARGET_DEL, | ||
162 | }; | ||
163 | |||
157 | /* | 164 | /* |
158 | * scsi_target: representation of a scsi target, for now, this is only | 165 | * scsi_target: representation of a scsi target, for now, this is only |
159 | * used for single_lun devices. If no one has active IO to the target, | 166 | * used for single_lun devices. If no one has active IO to the target, |
@@ -168,8 +175,13 @@ struct scsi_target { | |||
168 | unsigned int channel; | 175 | unsigned int channel; |
169 | unsigned int id; /* target id ... replace | 176 | unsigned int id; /* target id ... replace |
170 | * scsi_device.id eventually */ | 177 | * scsi_device.id eventually */ |
171 | unsigned long create:1; /* signal that it needs to be added */ | 178 | unsigned int create:1; /* signal that it needs to be added */ |
179 | unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ | ||
180 | /* means no lun present */ | ||
181 | |||
172 | char scsi_level; | 182 | char scsi_level; |
183 | struct execute_work ew; | ||
184 | enum scsi_target_state state; | ||
173 | void *hostdata; /* available to low-level driver */ | 185 | void *hostdata; /* available to low-level driver */ |
174 | unsigned long starget_data[0]; /* for the transport */ | 186 | unsigned long starget_data[0]; /* for the transport */ |
175 | /* starget_data must be the last element!!!! */ | 187 | /* starget_data must be the last element!!!! */ |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 827992949c4b..a6cf3e535c0b 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -147,20 +147,6 @@ struct scsi_host_template { | |||
147 | int (* eh_host_reset_handler)(struct scsi_cmnd *); | 147 | int (* eh_host_reset_handler)(struct scsi_cmnd *); |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * This is an optional routine to notify the host that the scsi | ||
151 | * timer just fired. The returns tell the timer routine what to | ||
152 | * do about this: | ||
153 | * | ||
154 | * EH_HANDLED: I fixed the error, please complete the command | ||
155 | * EH_RESET_TIMER: I need more time, reset the timer and | ||
156 | * begin counting again | ||
157 | * EH_NOT_HANDLED Begin normal error recovery | ||
158 | * | ||
159 | * Status: OPTIONAL | ||
160 | */ | ||
161 | enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); | ||
162 | |||
163 | /* | ||
164 | * Before the mid layer attempts to scan for a new device where none | 150 | * Before the mid layer attempts to scan for a new device where none |
165 | * currently exists, it will call this entry in your driver. Should | 151 | * currently exists, it will call this entry in your driver. Should |
166 | * your driver need to allocate any structs or perform any other init | 152 | * your driver need to allocate any structs or perform any other init |
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index e7b1054adf86..b3657f111937 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -48,6 +48,17 @@ struct scsi_transport_template { | |||
48 | * True if the transport wants to use a host-based work-queue | 48 | * True if the transport wants to use a host-based work-queue |
49 | */ | 49 | */ |
50 | unsigned int create_work_queue : 1; | 50 | unsigned int create_work_queue : 1; |
51 | |||
52 | /* | ||
53 | * This is an optional routine that allows the transport to become | ||
54 | * involved when a scsi io timer fires. The return value tells the | ||
55 | * timer routine how to finish the io timeout handling: | ||
56 | * EH_HANDLED: I fixed the error, please complete the command | ||
57 | * EH_RESET_TIMER: I need more time, reset the timer and | ||
58 | * begin counting again | ||
59 | * EH_NOT_HANDLED Begin normal error recovery | ||
60 | */ | ||
61 | enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); | ||
51 | }; | 62 | }; |
52 | 63 | ||
53 | #define transport_class_to_shost(tc) \ | 64 | #define transport_class_to_shost(tc) \ |
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index b91400bfb02a..2943ccc22a43 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -30,6 +30,7 @@ enum sas_linkrate { | |||
30 | SAS_SATA_PORT_SELECTOR, | 30 | SAS_SATA_PORT_SELECTOR, |
31 | SAS_LINK_RATE_1_5_GBPS, | 31 | SAS_LINK_RATE_1_5_GBPS, |
32 | SAS_LINK_RATE_3_0_GBPS, | 32 | SAS_LINK_RATE_3_0_GBPS, |
33 | SAS_LINK_RATE_6_0_GBPS, | ||
33 | SAS_LINK_VIRTUAL, | 34 | SAS_LINK_VIRTUAL, |
34 | }; | 35 | }; |
35 | 36 | ||
@@ -81,6 +82,10 @@ struct sas_rphy { | |||
81 | struct sas_identify identify; | 82 | struct sas_identify identify; |
82 | struct list_head list; | 83 | struct list_head list; |
83 | u32 scsi_target_id; | 84 | u32 scsi_target_id; |
85 | /* temporary expedient: mark the rphy as being contained | ||
86 | * within a type specific rphy | ||
87 | * FIXME: pull this out when everything uses the containers */ | ||
88 | unsigned contained:1; | ||
84 | }; | 89 | }; |
85 | 90 | ||
86 | #define dev_to_rphy(d) \ | 91 | #define dev_to_rphy(d) \ |
@@ -89,11 +94,45 @@ struct sas_rphy { | |||
89 | dev_to_rphy((cdev)->dev) | 94 | dev_to_rphy((cdev)->dev) |
90 | #define rphy_to_shost(rphy) \ | 95 | #define rphy_to_shost(rphy) \ |
91 | dev_to_shost((rphy)->dev.parent) | 96 | dev_to_shost((rphy)->dev.parent) |
97 | #define target_to_rphy(targ) \ | ||
98 | dev_to_rphy((targ)->dev.parent) | ||
99 | |||
100 | struct sas_end_device { | ||
101 | struct sas_rphy rphy; | ||
102 | /* flags */ | ||
103 | unsigned ready_led_meaning:1; | ||
104 | /* parameters */ | ||
105 | u16 I_T_nexus_loss_timeout; | ||
106 | u16 initiator_response_timeout; | ||
107 | }; | ||
108 | #define rphy_to_end_device(r) \ | ||
109 | container_of((r), struct sas_end_device, rphy) | ||
110 | |||
111 | struct sas_expander_device { | ||
112 | int level; | ||
113 | |||
114 | #define SAS_EXPANDER_VENDOR_ID_LEN 8 | ||
115 | char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1]; | ||
116 | #define SAS_EXPANDER_PRODUCT_ID_LEN 16 | ||
117 | char product_id[SAS_EXPANDER_PRODUCT_ID_LEN+1]; | ||
118 | #define SAS_EXPANDER_PRODUCT_REV_LEN 4 | ||
119 | char product_rev[SAS_EXPANDER_PRODUCT_REV_LEN+1]; | ||
120 | #define SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN 8 | ||
121 | char component_vendor_id[SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN+1]; | ||
122 | u16 component_id; | ||
123 | u8 component_revision_id; | ||
92 | 124 | ||
125 | struct sas_rphy rphy; | ||
126 | |||
127 | }; | ||
128 | #define rphy_to_expander_device(r) \ | ||
129 | container_of((r), struct sas_expander_device, rphy) | ||
93 | 130 | ||
94 | /* The functions by which the transport class and the driver communicate */ | 131 | /* The functions by which the transport class and the driver communicate */ |
95 | struct sas_function_template { | 132 | struct sas_function_template { |
96 | int (*get_linkerrors)(struct sas_phy *); | 133 | int (*get_linkerrors)(struct sas_phy *); |
134 | int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); | ||
135 | int (*get_bay_identifier)(struct sas_rphy *); | ||
97 | int (*phy_reset)(struct sas_phy *, int); | 136 | int (*phy_reset)(struct sas_phy *, int); |
98 | }; | 137 | }; |
99 | 138 | ||
@@ -107,6 +146,8 @@ extern void sas_phy_delete(struct sas_phy *); | |||
107 | extern int scsi_is_sas_phy(const struct device *); | 146 | extern int scsi_is_sas_phy(const struct device *); |
108 | 147 | ||
109 | extern struct sas_rphy *sas_rphy_alloc(struct sas_phy *); | 148 | extern struct sas_rphy *sas_rphy_alloc(struct sas_phy *); |
149 | extern struct sas_rphy *sas_end_device_alloc(struct sas_phy *); | ||
150 | extern struct sas_rphy *sas_expander_alloc(struct sas_phy *, enum sas_device_type); | ||
110 | void sas_rphy_free(struct sas_rphy *); | 151 | void sas_rphy_free(struct sas_rphy *); |
111 | extern int sas_rphy_add(struct sas_rphy *); | 152 | extern int sas_rphy_add(struct sas_rphy *); |
112 | extern void sas_rphy_delete(struct sas_rphy *); | 153 | extern void sas_rphy_delete(struct sas_rphy *); |
@@ -115,5 +156,17 @@ extern int scsi_is_sas_rphy(const struct device *); | |||
115 | extern struct scsi_transport_template * | 156 | extern struct scsi_transport_template * |
116 | sas_attach_transport(struct sas_function_template *); | 157 | sas_attach_transport(struct sas_function_template *); |
117 | extern void sas_release_transport(struct scsi_transport_template *); | 158 | extern void sas_release_transport(struct scsi_transport_template *); |
159 | int sas_read_port_mode_page(struct scsi_device *); | ||
160 | |||
161 | static inline int | ||
162 | scsi_is_sas_expander_device(struct device *dev) | ||
163 | { | ||
164 | struct sas_rphy *rphy; | ||
165 | if (!scsi_is_sas_rphy(dev)) | ||
166 | return 0; | ||
167 | rphy = dev_to_rphy(dev); | ||
168 | return rphy->identify.device_type == SAS_FANOUT_EXPANDER_DEVICE || | ||
169 | rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE; | ||
170 | } | ||
118 | 171 | ||
119 | #endif /* SCSI_TRANSPORT_SAS_H */ | 172 | #endif /* SCSI_TRANSPORT_SAS_H */ |
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index fb5a2ffae939..5e1d61913d4e 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h | |||
@@ -148,5 +148,9 @@ void spi_schedule_dv_device(struct scsi_device *); | |||
148 | void spi_dv_device(struct scsi_device *); | 148 | void spi_dv_device(struct scsi_device *); |
149 | void spi_display_xfer_agreement(struct scsi_target *); | 149 | void spi_display_xfer_agreement(struct scsi_target *); |
150 | int spi_print_msg(const unsigned char *); | 150 | int spi_print_msg(const unsigned char *); |
151 | int spi_populate_width_msg(unsigned char *msg, int width); | ||
152 | int spi_populate_sync_msg(unsigned char *msg, int period, int offset); | ||
153 | int spi_populate_ppr_msg(unsigned char *msg, int period, int offset, int width, | ||
154 | int options); | ||
151 | 155 | ||
152 | #endif /* SCSI_TRANSPORT_SPI_H */ | 156 | #endif /* SCSI_TRANSPORT_SPI_H */ |