mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
isci: Convert SATA fis data structures to Linux native
Converting of sata_fis_reg_d2h to dev_to_host_fis Converting of sata_fis_reg_h2d to host_to_dev_fis Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
c6d4225789
commit
f2f300806f
12 changed files with 35 additions and 102 deletions
|
@ -101,62 +101,6 @@ struct sata_fis_header {
|
|||
u32 error:8;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct sata_fis_reg_h2d - This is the definition for a SATA Host to Device
|
||||
* Register FIS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
struct sata_fis_reg_h2d {
|
||||
u32 fis_type:8; /* word 0 */
|
||||
u32 pm_port:4;
|
||||
u32 reserved0:3;
|
||||
u32 command_flag:1;
|
||||
u32 command:8;
|
||||
u32 features:8;
|
||||
u32 lba_low:8; /* word 1 */
|
||||
u32 lba_mid:8;
|
||||
u32 lba_high:8;
|
||||
u32 device:8;
|
||||
u32 lba_low_exp:8; /* word 2 */
|
||||
u32 lba_mid_exp:8;
|
||||
u32 lba_high_exp:8;
|
||||
u32 features_exp:8;
|
||||
u32 sector_count:8; /* word 3 */
|
||||
u32 sector_count_exp:8;
|
||||
u32 reserved1:8;
|
||||
u32 control:8;
|
||||
u32 reserved2; /* word 4 */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sata_fis_reg_d2h - SATA Device To Host FIS
|
||||
*
|
||||
*
|
||||
*/
|
||||
struct sata_fis_reg_d2h {
|
||||
u32 fis_type:8; /* word 0 */
|
||||
u32 pm_port:4;
|
||||
u32 reserved0:2;
|
||||
u32 irq:1;
|
||||
u32 reserved1:1;
|
||||
u32 status:8;
|
||||
u32 error:8;
|
||||
u8 lba_low; /* word 1 */
|
||||
u8 lba_mid;
|
||||
u8 lba_high;
|
||||
u8 device;
|
||||
u8 lba_low_exp; /* word 2 */
|
||||
u8 lba_mid_exp;
|
||||
u8 lba_high_exp;
|
||||
u8 reserved;
|
||||
u8 sector_count; /* word 3 */
|
||||
u8 sector_count_exp;
|
||||
u16 reserved2;
|
||||
u32 reserved3;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <scsi/sas.h>
|
||||
#include <scsi/libsas.h>
|
||||
#include "sci_status.h"
|
||||
|
||||
#include "intel_sata.h"
|
||||
#include "intel_sas.h"
|
||||
#include <scsi/libsas.h>
|
||||
|
||||
struct scic_sds_phy;
|
||||
struct scic_sds_port;
|
||||
|
@ -141,7 +141,7 @@ struct scic_sata_phy_properties {
|
|||
* This field delineates the signature FIS received from the
|
||||
* attached target.
|
||||
*/
|
||||
struct sata_fis_reg_d2h signature_fis;
|
||||
struct dev_to_host_fis signature_fis;
|
||||
|
||||
/**
|
||||
* This field specifies to the user if a port selector is connected
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <scsi/sas.h>
|
||||
#include "scic_controller.h"
|
||||
#include "scic_phy.h"
|
||||
#include "scic_port.h"
|
||||
|
@ -1754,17 +1755,11 @@ void scic_sds_controller_copy_sata_response(
|
|||
void *frame_header,
|
||||
void *frame_buffer)
|
||||
{
|
||||
memcpy(
|
||||
response_buffer,
|
||||
frame_header,
|
||||
sizeof(u32)
|
||||
);
|
||||
memcpy(response_buffer, frame_header, sizeof(u32));
|
||||
|
||||
memcpy(
|
||||
(char *)((char *)response_buffer + sizeof(u32)),
|
||||
frame_buffer,
|
||||
sizeof(struct sata_fis_reg_d2h) - sizeof(u32)
|
||||
);
|
||||
memcpy(response_buffer + sizeof(u32),
|
||||
frame_buffer,
|
||||
sizeof(struct dev_to_host_fis) - sizeof(u32));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <scsi/sas.h>
|
||||
#include "intel_ata.h"
|
||||
#include "intel_sata.h"
|
||||
#include "sci_base_state.h"
|
||||
|
@ -620,11 +621,9 @@ enum sci_status scic_sata_phy_get_properties(
|
|||
struct scic_sata_phy_properties *properties)
|
||||
{
|
||||
if (sci_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) {
|
||||
memcpy(
|
||||
&properties->signature_fis,
|
||||
&sci_phy->phy_type.sata.signature_fis_buffer,
|
||||
sizeof(struct sata_fis_reg_d2h)
|
||||
);
|
||||
memcpy(&properties->signature_fis,
|
||||
&sci_phy->phy_type.sata.signature_fis_buffer,
|
||||
sizeof(struct dev_to_host_fis));
|
||||
|
||||
/* / @todo add support for port selectors. */
|
||||
properties->is_port_selector_present = false;
|
||||
|
|
|
@ -280,7 +280,7 @@ struct scic_sds_phy {
|
|||
} sas;
|
||||
|
||||
struct {
|
||||
struct sata_fis_reg_d2h signature_fis_buffer;
|
||||
struct dev_to_host_fis signature_fis_buffer;
|
||||
|
||||
} sata;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#include <scsi/sas.h>
|
||||
#include "intel_sas.h"
|
||||
#include "intel_sata.h"
|
||||
#include "intel_sat.h"
|
||||
|
@ -1742,7 +1742,7 @@ enum sci_status scic_io_request_construct(struct scic_sds_controller *scic,
|
|||
scic_sds_ssp_io_request_assign_buffers(sci_req);
|
||||
} else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
|
||||
scic_sds_stp_request_assign_buffers(sci_req);
|
||||
memset(sci_req->command_buffer, 0, sizeof(struct sata_fis_reg_h2d));
|
||||
memset(sci_req->command_buffer, 0, sizeof(struct host_to_dev_fis));
|
||||
} else if (dev_is_expander(dev)) {
|
||||
scic_sds_smp_request_assign_buffers(sci_req);
|
||||
memset(sci_req->command_buffer, 0, sizeof(struct smp_request));
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
* request memory
|
||||
*/
|
||||
#define scic_sds_stp_request_get_h2d_reg_buffer(memory) \
|
||||
((struct sata_fis_reg_h2d *)(\
|
||||
((struct host_to_dev_fis *)(\
|
||||
((char *)(memory)) + sizeof(struct scic_sds_stp_request) \
|
||||
))
|
||||
|
||||
|
@ -90,9 +90,9 @@
|
|||
* request memory
|
||||
*/
|
||||
#define scic_sds_stp_request_get_response_buffer(memory) \
|
||||
((struct sata_fis_reg_d2h *)(\
|
||||
((struct dev_to_host_fis *)(\
|
||||
((char *)(scic_sds_stp_request_get_h2d_reg_buffer(memory))) \
|
||||
+ sizeof(struct sata_fis_reg_h2d) \
|
||||
+ sizeof(struct host_to_dev_fis) \
|
||||
))
|
||||
|
||||
/**
|
||||
|
@ -127,8 +127,8 @@
|
|||
u32 scic_sds_stp_request_get_object_size(void)
|
||||
{
|
||||
return sizeof(struct scic_sds_stp_request)
|
||||
+ sizeof(struct sata_fis_reg_h2d)
|
||||
+ sizeof(struct sata_fis_reg_d2h)
|
||||
+ sizeof(struct host_to_dev_fis)
|
||||
+ sizeof(struct dev_to_host_fis)
|
||||
+ sizeof(struct scu_task_context)
|
||||
+ SMP_CACHE_BYTES
|
||||
+ sizeof(struct scu_sgl_element_pair) * SCU_MAX_SGL_ELEMENT_PAIRS;
|
||||
|
@ -205,7 +205,7 @@ static void scu_sata_reqeust_construct_task_context(
|
|||
task_context->task_phase = 0x01;
|
||||
|
||||
task_context->ssp_command_iu_length =
|
||||
(sizeof(struct sata_fis_reg_h2d) - sizeof(u32)) / sizeof(u32);
|
||||
(sizeof(struct host_to_dev_fis) - sizeof(u32)) / sizeof(u32);
|
||||
|
||||
/* Set the first word of the H2D REG FIS */
|
||||
task_context->type.words[0] = *(u32 *)sds_request->command_buffer;
|
||||
|
@ -354,7 +354,8 @@ static void scu_stp_raw_request_construct_task_context(
|
|||
task_context->priority = SCU_TASK_PRIORITY_NORMAL;
|
||||
task_context->task_type = SCU_TASK_TYPE_SATA_RAW_FRAME;
|
||||
task_context->type.stp.fis_type = SATA_FIS_TYPE_REGH2D;
|
||||
task_context->transfer_length_bytes = sizeof(struct sata_fis_reg_h2d) - sizeof(u32);
|
||||
task_context->transfer_length_bytes =
|
||||
sizeof(struct host_to_dev_fis) - sizeof(u32);
|
||||
}
|
||||
|
||||
void scic_stp_io_request_set_ncq_tag(
|
||||
|
@ -1749,7 +1750,7 @@ static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_complet
|
|||
{
|
||||
struct scic_sds_request *sci_req = object;
|
||||
struct scu_task_context *task_context;
|
||||
struct sata_fis_reg_h2d *h2d_fis;
|
||||
struct host_to_dev_fis *h2d_fis;
|
||||
enum sci_status status;
|
||||
|
||||
/* Clear the SRST bit */
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
struct scic_sds_stp_request {
|
||||
struct scic_sds_request parent;
|
||||
|
||||
struct sata_fis_reg_d2h d2h_reg_fis;
|
||||
struct dev_to_host_fis d2h_reg_fis;
|
||||
|
||||
union {
|
||||
u32 ncq;
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
|
||||
#include "port.h"
|
||||
#include "host.h"
|
||||
#include <scsi/sas.h>
|
||||
#include <scsi/libsas.h>
|
||||
|
||||
|
||||
|
@ -79,10 +80,8 @@ struct isci_phy {
|
|||
u8 sas_addr[SAS_ADDR_SIZE];
|
||||
|
||||
union {
|
||||
|
||||
u8 aif[sizeof(struct sci_sas_identify_address_frame)];
|
||||
u8 fis[sizeof(struct sata_fis_reg_d2h)];
|
||||
|
||||
struct dev_to_host_fis fis;
|
||||
} frame_rcvd;
|
||||
};
|
||||
|
||||
|
|
|
@ -205,11 +205,8 @@ void isci_port_link_up(
|
|||
*/
|
||||
BUG_ON(call_status != SCI_SUCCESS);
|
||||
|
||||
memcpy(isci_phy->frame_rcvd.fis,
|
||||
&sata_phy_properties.signature_fis,
|
||||
sizeof(struct sata_fis_reg_d2h));
|
||||
|
||||
isci_phy->sas_phy.frame_rcvd_size = sizeof(struct sata_fis_reg_d2h);
|
||||
isci_phy->frame_rcvd.fis = sata_phy_properties.signature_fis;
|
||||
isci_phy->sas_phy.frame_rcvd_size = sizeof(struct dev_to_host_fis);
|
||||
|
||||
/*
|
||||
* For direct-attached SATA devices, the SCI core will
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <scsi/sas.h>
|
||||
#include "isci.h"
|
||||
#include "remote_device.h"
|
||||
#include "scic_io_request.h"
|
||||
|
@ -142,11 +143,10 @@ void isci_sata_set_ncq_tag(
|
|||
*
|
||||
* none.
|
||||
*/
|
||||
void isci_request_process_stp_response(
|
||||
struct sas_task *task,
|
||||
void *response_buffer)
|
||||
void isci_request_process_stp_response(struct sas_task *task,
|
||||
void *response_buffer)
|
||||
{
|
||||
struct sata_fis_reg_d2h *d2h_reg_fis = (struct sata_fis_reg_d2h *)response_buffer;
|
||||
struct dev_to_host_fis *d2h_reg_fis = response_buffer;
|
||||
struct task_status_struct *ts = &task->task_status;
|
||||
struct ata_task_resp *resp = (void *)&ts->buf[0];
|
||||
|
||||
|
|
|
@ -1452,10 +1452,8 @@ void isci_task_request_complete(
|
|||
|
||||
memcpy(&tmf->resp.d2h_fis,
|
||||
scic_stp_io_request_get_d2h_reg_address(
|
||||
request->sci_request_handle
|
||||
),
|
||||
sizeof(struct sata_fis_reg_d2h)
|
||||
);
|
||||
request->sci_request_handle),
|
||||
sizeof(struct dev_to_host_fis));
|
||||
}
|
||||
|
||||
/* Manage the timer if it is still running. */
|
||||
|
|
Loading…
Reference in a new issue