aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@google.com>2010-05-25 15:31:38 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-10-21 20:21:03 -0400
commitd9027470b88631d0956ac37cdadfdeb9cdcf2c99 (patch)
treeb15273e88431ba734a24965dfc81132ac13bc8bd /drivers/ata/libata-scsi.c
parentf6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff)
[libata] Add ATA transport class
This is a scheleton for libata transport class. All information is read only, exporting information from libata: - ata_port class: one per ATA port - ata_link class: one per ATA port or 15 for SATA Port Multiplier - ata_device class: up to 2 for PATA link, usually one for SATA. Signed-off-by: Gwendal Grignou <gwendal@google.com> Reviewed-by: Grant Grundler <grundler@google.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a89172c100f5..c16f5c151735 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -51,6 +51,7 @@
51#include <asm/unaligned.h> 51#include <asm/unaligned.h>
52 52
53#include "libata.h" 53#include "libata.h"
54#include "libata-transport.h"
54 55
55#define SECTOR_SIZE 512 56#define SECTOR_SIZE 512
56#define ATA_SCSI_RBUF_SIZE 4096 57#define ATA_SCSI_RBUF_SIZE 4096
@@ -64,9 +65,6 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap,
64 const struct scsi_device *scsidev); 65 const struct scsi_device *scsidev);
65static struct ata_device *ata_scsi_find_dev(struct ata_port *ap, 66static struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
66 const struct scsi_device *scsidev); 67 const struct scsi_device *scsidev);
67static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
68 unsigned int id, unsigned int lun);
69
70 68
71#define RW_RECOVERY_MPAGE 0x1 69#define RW_RECOVERY_MPAGE 0x1
72#define RW_RECOVERY_MPAGE_LEN 12 70#define RW_RECOVERY_MPAGE_LEN 12
@@ -106,17 +104,6 @@ static const u8 def_control_mpage[CONTROL_MPAGE_LEN] = {
106 0, 30 /* extended self test time, see 05-359r1 */ 104 0, 30 /* extended self test time, see 05-359r1 */
107}; 105};
108 106
109/*
110 * libata transport template. libata doesn't do real transport stuff.
111 * It just needs the eh_timed_out hook.
112 */
113static struct scsi_transport_template ata_scsi_transport_template = {
114 .eh_strategy_handler = ata_scsi_error,
115 .eh_timed_out = ata_scsi_timed_out,
116 .user_scan = ata_scsi_user_scan,
117};
118
119
120static const struct { 107static const struct {
121 enum link_pm value; 108 enum link_pm value;
122 const char *name; 109 const char *name;
@@ -3334,7 +3321,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
3334 *(struct ata_port **)&shost->hostdata[0] = ap; 3321 *(struct ata_port **)&shost->hostdata[0] = ap;
3335 ap->scsi_host = shost; 3322 ap->scsi_host = shost;
3336 3323
3337 shost->transportt = &ata_scsi_transport_template; 3324 shost->transportt = ata_scsi_transport_template;
3338 shost->unique_id = ap->print_id; 3325 shost->unique_id = ap->print_id;
3339 shost->max_id = 16; 3326 shost->max_id = 16;
3340 shost->max_lun = 1; 3327 shost->max_lun = 1;
@@ -3616,8 +3603,8 @@ void ata_scsi_hotplug(struct work_struct *work)
3616 * RETURNS: 3603 * RETURNS:
3617 * Zero. 3604 * Zero.
3618 */ 3605 */
3619static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, 3606int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3620 unsigned int id, unsigned int lun) 3607 unsigned int id, unsigned int lun)
3621{ 3608{
3622 struct ata_port *ap = ata_shost_to_port(shost); 3609 struct ata_port *ap = ata_shost_to_port(shost);
3623 unsigned long flags; 3610 unsigned long flags;