summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2011-05-04 18:45:05 -0700
committerDan Williams <dan.j.williams@intel.com>2011-07-03 04:04:46 -0700
commit2d9c2240e0bad47e8d08091016b537287a263976 (patch)
treed4ca7bb9dbb3730ccc0f6ec89409b205c6206df7 /drivers
parent51a57cff7ca0549bcf87cbb36086269978f42568 (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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/isci/core/intel_sas.h39
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.c22
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.h6
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.c11
-rw-r--r--drivers/scsi/isci/remote_device.c12
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 f2d5ca1c72e..156694fc8de 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 {
SCI_SAS_TASK_FRAME = 0x16
};
-/**
- * struct sci_ssp_frame_header - This structure depicts the contents of an SSP
- * frame header. For specific information on the individual fields please
- * reference the SAS specification transport layer SSP frame format.
- *
- *
- */
-struct sci_ssp_frame_header {
- /* Word 0 */
- u32 hashed_destination_address:24;
- u32 frame_type:8;
-
- /* Word 1 */
- u32 hashed_source_address:24;
- u32 reserved1_0:8;
-
- /* Word 2 */
- u32 reserved2_2:6;
- u32 fill_bytes:2;
- u32 reserved2_1:3;
- u32 tlr_control:2;
- u32 retry_data_frames:1;
- u32 retransmit:1;
- u32 changing_data_pointer:1;
- u32 reserved2_0:16;
-
- /* Word 3 */
- u32 uiResv4;
-
- /* Word 4 */
- u16 target_port_transfer_tag;
- u16 tag;
-
- /* Word 5 */
- u32 data_offset;
-
-};
-
-
#define PHY_OPERATION_NOP 0x00
#define PHY_OPERATION_LINK_RESET 0x01
#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 0b76fc75996..3fe73cbc052 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(
return NULL;
}
-/**
- * This method returnst the sequence value from the io tag value
- * @scic:
- * @io_tag:
- *
- * u16
- */
-
-/**
- * This method returns the IO request associated with the tag value
- * @scic:
- * @io_tag:
- *
- * SCIC_SDS_IO_REQUEST_T* NULL if there is no valid IO request at the tag value
- */
-struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
- struct scic_sds_controller *scic,
- u16 io_tag
- ) {
+struct scic_sds_request *scic_request_by_tag(struct scic_sds_controller *scic,
+ u16 io_tag)
+{
u16 task_index;
u16 task_sequence;
diff --git a/drivers/scsi/isci/core/scic_sds_controller.h b/drivers/scsi/isci/core/scic_sds_controller.h
index 8e3240de3d9..08aee06c124 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
struct scic_sds_controller *this_controller,
u16 node_id);
-struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
- struct scic_sds_controller *this_controller,
- u16 io_tag);
-
+struct scic_sds_request *scic_request_by_tag(struct scic_sds_controller *scic,
+ u16 io_tag);
struct scu_task_context *scic_sds_controller_get_task_context_buffer(
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 e9c69d451f4..f34ca3d8ee3 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,
u32 frame_index)
{
enum sci_status status;
- struct sci_ssp_frame_header *frame_header;
+ u32 *frame_header;
+ struct ssp_frame_hdr ssp_hdr;
+ ssize_t word_cnt;
status = scic_sds_unsolicited_frame_control_get_header(
&(scic_sds_request_get_controller(sci_req)->uf_control),
frame_index,
(void **)&frame_header);
- if (frame_header->frame_type == SCI_SAS_RESPONSE_FRAME) {
+ word_cnt = sizeof(struct ssp_frame_hdr) / sizeof(u32);
+ sci_swab32_cpy(&ssp_hdr, frame_header, word_cnt);
+
+ if (ssp_hdr.frame_type == SSP_RESPONSE) {
struct ssp_response_iu *resp_iu;
ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32);
@@ -1303,7 +1308,7 @@ scic_sds_request_started_state_frame_handler(struct scic_sds_request *sci_req,
__func__,
sci_req,
frame_index,
- frame_header->frame_type);
+ ssp_hdr.frame_type);
}
/*
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index e766b27bdc1..89cdd0a05ab 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -52,6 +52,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <scsi/sas.h>
#include "intel_sas.h"
#include "sas.h"
#include "isci.h"
@@ -305,15 +306,20 @@ enum sci_status scic_sds_remote_device_frame_handler(struct scic_sds_remote_devi
case SCI_BASE_REMOTE_DEVICE_STATE_FAILED:
case SCI_BASE_REMOTE_DEVICE_STATE_RESETTING: {
struct scic_sds_request *sci_req;
- struct sci_ssp_frame_header *hdr;
+ struct ssp_frame_hdr hdr;
+ void *frame_header;
+ ssize_t word_cnt;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
frame_index,
- (void **)&hdr);
+ &frame_header);
if (status != SCI_SUCCESS)
return status;
- sci_req = scic_sds_controller_get_io_request_from_tag(scic, hdr->tag);
+ word_cnt = sizeof(hdr) / sizeof(u32);
+ sci_swab32_cpy(&hdr, frame_header, word_cnt);
+
+ sci_req = scic_request_by_tag(scic, be16_to_cpu(hdr.tag));
if (sci_req && sci_req->target_device == sci_dev) {
/* The IO request is now in charge of releasing the frame */
status = sci_req->state_handlers->frame_handler(sci_req,