diff options
author | Dave Jiang <dave.jiang@intel.com> | 2011-05-04 21:45:05 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:04:46 -0400 |
commit | 2d9c2240e0bad47e8d08091016b537287a263976 (patch) | |
tree | d4ca7bb9dbb3730ccc0f6ec89409b205c6206df7 | |
parent | 51a57cff7ca0549bcf87cbb36086269978f42568 (diff) |
isci: Using Linux SSP frame header
Removing of struct sci_ssp_frame_header and migrate to struct ssp_frame_hdr.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/core/intel_sas.h | 39 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_controller.c | 22 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_controller.h | 6 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_request.c | 11 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 12 |
5 files changed, 22 insertions, 68 deletions
diff --git a/drivers/scsi/isci/core/intel_sas.h b/drivers/scsi/isci/core/intel_sas.h index f2d5ca1c72ed..156694fc8dee 100644 --- a/drivers/scsi/isci/core/intel_sas.h +++ b/drivers/scsi/isci/core/intel_sas.h | |||
@@ -133,45 +133,6 @@ enum sci_sas_frame_type { | |||
133 | SCI_SAS_TASK_FRAME = 0x16 | 133 | SCI_SAS_TASK_FRAME = 0x16 |
134 | }; | 134 | }; |
135 | 135 | ||
136 | /** | ||
137 | * struct sci_ssp_frame_header - This structure depicts the contents of an SSP | ||
138 | * frame header. For specific information on the individual fields please | ||
139 | * reference the SAS specification transport layer SSP frame format. | ||
140 | * | ||
141 | * | ||
142 | */ | ||
143 | struct sci_ssp_frame_header { | ||
144 | /* Word 0 */ | ||
145 | u32 hashed_destination_address:24; | ||
146 | u32 frame_type:8; | ||
147 | |||
148 | /* Word 1 */ | ||
149 | u32 hashed_source_address:24; | ||
150 | u32 reserved1_0:8; | ||
151 | |||
152 | /* Word 2 */ | ||
153 | u32 reserved2_2:6; | ||
154 | u32 fill_bytes:2; | ||
155 | u32 reserved2_1:3; | ||
156 | u32 tlr_control:2; | ||
157 | u32 retry_data_frames:1; | ||
158 | u32 retransmit:1; | ||
159 | u32 changing_data_pointer:1; | ||
160 | u32 reserved2_0:16; | ||
161 | |||
162 | /* Word 3 */ | ||
163 | u32 uiResv4; | ||
164 | |||
165 | /* Word 4 */ | ||
166 | u16 target_port_transfer_tag; | ||
167 | u16 tag; | ||
168 | |||
169 | /* Word 5 */ | ||
170 | u32 data_offset; | ||
171 | |||
172 | }; | ||
173 | |||
174 | |||
175 | #define PHY_OPERATION_NOP 0x00 | 136 | #define PHY_OPERATION_NOP 0x00 |
176 | #define PHY_OPERATION_LINK_RESET 0x01 | 137 | #define PHY_OPERATION_LINK_RESET 0x01 |
177 | #define PHY_OPERATION_HARD_RESET 0x02 | 138 | #define PHY_OPERATION_HARD_RESET 0x02 |
diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c index 0b76fc75996f..3fe73cbc0524 100644 --- a/drivers/scsi/isci/core/scic_sds_controller.c +++ b/drivers/scsi/isci/core/scic_sds_controller.c | |||
@@ -1619,25 +1619,9 @@ struct scu_task_context *scic_sds_controller_get_task_context_buffer( | |||
1619 | return NULL; | 1619 | return NULL; |
1620 | } | 1620 | } |
1621 | 1621 | ||
1622 | /** | 1622 | struct scic_sds_request *scic_request_by_tag(struct scic_sds_controller *scic, |
1623 | * This method returnst the sequence value from the io tag value | 1623 | u16 io_tag) |
1624 | * @scic: | 1624 | { |
1625 | * @io_tag: | ||
1626 | * | ||
1627 | * u16 | ||
1628 | */ | ||
1629 | |||
1630 | /** | ||
1631 | * This method returns the IO request associated with the tag value | ||
1632 | * @scic: | ||
1633 | * @io_tag: | ||
1634 | * | ||
1635 | * SCIC_SDS_IO_REQUEST_T* NULL if there is no valid IO request at the tag value | ||
1636 | */ | ||
1637 | struct scic_sds_request *scic_sds_controller_get_io_request_from_tag( | ||
1638 | struct scic_sds_controller *scic, | ||
1639 | u16 io_tag | ||
1640 | ) { | ||
1641 | u16 task_index; | 1625 | u16 task_index; |
1642 | u16 task_sequence; | 1626 | u16 task_sequence; |
1643 | 1627 | ||
diff --git a/drivers/scsi/isci/core/scic_sds_controller.h b/drivers/scsi/isci/core/scic_sds_controller.h index 8e3240de3d92..08aee06c124d 100644 --- a/drivers/scsi/isci/core/scic_sds_controller.h +++ b/drivers/scsi/isci/core/scic_sds_controller.h | |||
@@ -556,10 +556,8 @@ union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffe | |||
556 | struct scic_sds_controller *this_controller, | 556 | struct scic_sds_controller *this_controller, |
557 | u16 node_id); | 557 | u16 node_id); |
558 | 558 | ||
559 | struct scic_sds_request *scic_sds_controller_get_io_request_from_tag( | 559 | struct scic_sds_request *scic_request_by_tag(struct scic_sds_controller *scic, |
560 | struct scic_sds_controller *this_controller, | 560 | u16 io_tag); |
561 | u16 io_tag); | ||
562 | |||
563 | 561 | ||
564 | struct scu_task_context *scic_sds_controller_get_task_context_buffer( | 562 | struct scu_task_context *scic_sds_controller_get_task_context_buffer( |
565 | struct scic_sds_controller *this_controller, | 563 | struct scic_sds_controller *this_controller, |
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c index e9c69d451f43..f34ca3d8ee33 100644 --- a/drivers/scsi/isci/core/scic_sds_request.c +++ b/drivers/scsi/isci/core/scic_sds_request.c | |||
@@ -1265,14 +1265,19 @@ scic_sds_request_started_state_frame_handler(struct scic_sds_request *sci_req, | |||
1265 | u32 frame_index) | 1265 | u32 frame_index) |
1266 | { | 1266 | { |
1267 | enum sci_status status; | 1267 | enum sci_status status; |
1268 | struct sci_ssp_frame_header *frame_header; | 1268 | u32 *frame_header; |
1269 | struct ssp_frame_hdr ssp_hdr; | ||
1270 | ssize_t word_cnt; | ||
1269 | 1271 | ||
1270 | status = scic_sds_unsolicited_frame_control_get_header( | 1272 | status = scic_sds_unsolicited_frame_control_get_header( |
1271 | &(scic_sds_request_get_controller(sci_req)->uf_control), | 1273 | &(scic_sds_request_get_controller(sci_req)->uf_control), |
1272 | frame_index, | 1274 | frame_index, |
1273 | (void **)&frame_header); | 1275 | (void **)&frame_header); |
1274 | 1276 | ||
1275 | if (frame_header->frame_type == SCI_SAS_RESPONSE_FRAME) { | 1277 | word_cnt = sizeof(struct ssp_frame_hdr) / sizeof(u32); |
1278 | sci_swab32_cpy(&ssp_hdr, frame_header, word_cnt); | ||
1279 | |||
1280 | if (ssp_hdr.frame_type == SSP_RESPONSE) { | ||
1276 | struct ssp_response_iu *resp_iu; | 1281 | struct ssp_response_iu *resp_iu; |
1277 | ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32); | 1282 | ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32); |
1278 | 1283 | ||
@@ -1303,7 +1308,7 @@ scic_sds_request_started_state_frame_handler(struct scic_sds_request *sci_req, | |||
1303 | __func__, | 1308 | __func__, |
1304 | sci_req, | 1309 | sci_req, |
1305 | frame_index, | 1310 | frame_index, |
1306 | frame_header->frame_type); | 1311 | ssp_hdr.frame_type); |
1307 | } | 1312 | } |
1308 | 1313 | ||
1309 | /* | 1314 | /* |
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index e766b27bdc19..89cdd0a05abc 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c | |||
@@ -52,6 +52,7 @@ | |||
52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | */ | 54 | */ |
55 | #include <scsi/sas.h> | ||
55 | #include "intel_sas.h" | 56 | #include "intel_sas.h" |
56 | #include "sas.h" | 57 | #include "sas.h" |
57 | #include "isci.h" | 58 | #include "isci.h" |
@@ -305,15 +306,20 @@ enum sci_status scic_sds_remote_device_frame_handler(struct scic_sds_remote_devi | |||
305 | case SCI_BASE_REMOTE_DEVICE_STATE_FAILED: | 306 | case SCI_BASE_REMOTE_DEVICE_STATE_FAILED: |
306 | case SCI_BASE_REMOTE_DEVICE_STATE_RESETTING: { | 307 | case SCI_BASE_REMOTE_DEVICE_STATE_RESETTING: { |
307 | struct scic_sds_request *sci_req; | 308 | struct scic_sds_request *sci_req; |
308 | struct sci_ssp_frame_header *hdr; | 309 | struct ssp_frame_hdr hdr; |
310 | void *frame_header; | ||
311 | ssize_t word_cnt; | ||
309 | 312 | ||
310 | status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control, | 313 | status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control, |
311 | frame_index, | 314 | frame_index, |
312 | (void **)&hdr); | 315 | &frame_header); |
313 | if (status != SCI_SUCCESS) | 316 | if (status != SCI_SUCCESS) |
314 | return status; | 317 | return status; |
315 | 318 | ||
316 | sci_req = scic_sds_controller_get_io_request_from_tag(scic, hdr->tag); | 319 | word_cnt = sizeof(hdr) / sizeof(u32); |
320 | sci_swab32_cpy(&hdr, frame_header, word_cnt); | ||
321 | |||
322 | sci_req = scic_request_by_tag(scic, be16_to_cpu(hdr.tag)); | ||
317 | if (sci_req && sci_req->target_device == sci_dev) { | 323 | if (sci_req && sci_req->target_device == sci_dev) { |
318 | /* The IO request is now in charge of releasing the frame */ | 324 | /* The IO request is now in charge of releasing the frame */ |
319 | status = sci_req->state_handlers->frame_handler(sci_req, | 325 | status = sci_req->state_handlers->frame_handler(sci_req, |