Commit fa1c1e8f authored by Darrick J. Wong's avatar Darrick J. Wong Committed by James Bottomley

[SCSI] Add SATA support to libsas

Hook the scsi_host_template functions in libsas to delegate
functionality to libata when appropriate.
Signed-off-by: default avatarDarrick J. Wong <djwong@us.ibm.com>

Misc code changes and merge fixes and update for libata->drivers/ata
move
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8b4a4080
......@@ -81,6 +81,9 @@ static struct scsi_host_template aic94xx_sht = {
.use_clustering = ENABLE_CLUSTERING,
.eh_device_reset_handler = sas_eh_device_reset_handler,
.eh_bus_reset_handler = sas_eh_bus_reset_handler,
.slave_alloc = sas_slave_alloc,
.target_destroy = sas_target_destroy,
.ioctl = sas_ioctl,
};
static int __devinit asd_map_memio(struct asd_ha_struct *asd_ha)
......
......@@ -255,6 +255,7 @@ static int sas_get_port_device(struct asd_sas_port *port)
switch (dev->dev_type) {
case SAS_END_DEV:
case SATA_DEV:
rphy = sas_end_device_alloc(port->port);
break;
case EDGE_DEV:
......@@ -265,7 +266,6 @@ static int sas_get_port_device(struct asd_sas_port *port)
rphy = sas_expander_alloc(port->port,
SAS_FANOUT_EXPANDER_DEVICE);
break;
case SATA_DEV:
default:
printk("ERROR: Unidentified device type %d\n", dev->dev_type);
rphy = NULL;
......@@ -480,7 +480,14 @@ static int sas_discover_sata_dev(struct domain_device *dev)
present.
sas_satl_register_dev(dev);
*/
return 0;
sas_fill_in_rphy(dev, dev->rphy);
res = sas_rphy_add(dev->rphy);
if (res)
goto out_err;
return res;
out_err:
dev->sata_dev.identify_packet_device = NULL;
dev->sata_dev.identify_device = NULL;
......
This diff is collapsed.
......@@ -30,6 +30,7 @@
#include <linux/timer.h>
#include <linux/pci.h>
#include <scsi/sas.h>
#include <linux/libata.h>
#include <linux/list.h>
#include <asm/semaphore.h>
#include <scsi/scsi_device.h>
......@@ -165,6 +166,13 @@ struct sata_device {
u8 port_no; /* port number, if this is a PM (Port) */
struct list_head children; /* PM Ports if this is a PM */
struct ata_port *ap;
struct ata_host ata_host;
struct ata_taskfile tf;
u32 sstatus;
u32 serror;
u32 scontrol;
};
/* ---------- Domain device ---------- */
......@@ -661,4 +669,8 @@ int __sas_task_abort(struct sas_task *);
int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
extern void sas_target_destroy(struct scsi_target *);
extern int sas_slave_alloc(struct scsi_device *);
extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);
#endif /* _SASLIB_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment