aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrian King <brking@us.ibm.com>2006-08-07 15:27:17 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-09 00:08:38 -0400
commit155a8a9c8f4084016d9e27bf03ba1f19201438f4 (patch)
tree31ea68dd479537b3d1e039f124e34d4270cb9eb8 /drivers
parentb03732f006bd1ecee32587ec8235c41af5ad905f (diff)
[PATCH] libata: Add ata_port_init
Separate out the ata_port initialization from ata_host_init so that it can be used in future SAS patches. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c49
-rw-r--r--drivers/scsi/libata.h2
2 files changed, 36 insertions, 15 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 886440b128a5..f553c9dd962d 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -5218,35 +5218,25 @@ void ata_dev_init(struct ata_device *dev)
5218} 5218}
5219 5219
5220/** 5220/**
5221 * ata_host_init - Initialize an ata_port structure 5221 * ata_port_init - Initialize an ata_port structure
5222 * @ap: Structure to initialize 5222 * @ap: Structure to initialize
5223 * @host: associated SCSI mid-layer structure
5224 * @host_set: Collection of hosts to which @ap belongs 5223 * @host_set: Collection of hosts to which @ap belongs
5225 * @ent: Probe information provided by low-level driver 5224 * @ent: Probe information provided by low-level driver
5226 * @port_no: Port number associated with this ata_port 5225 * @port_no: Port number associated with this ata_port
5227 * 5226 *
5228 * Initialize a new ata_port structure, and its associated 5227 * Initialize a new ata_port structure.
5229 * scsi_host.
5230 * 5228 *
5231 * LOCKING: 5229 * LOCKING:
5232 * Inherited from caller. 5230 * Inherited from caller.
5233 */ 5231 */
5234static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, 5232void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set,
5235 struct ata_host_set *host_set, 5233 const struct ata_probe_ent *ent, unsigned int port_no)
5236 const struct ata_probe_ent *ent, unsigned int port_no)
5237{ 5234{
5238 unsigned int i; 5235 unsigned int i;
5239 5236
5240 host->max_id = 16;
5241 host->max_lun = 1;
5242 host->max_channel = 1;
5243 host->unique_id = ata_unique_id++;
5244 host->max_cmd_len = 12;
5245
5246 ap->lock = &host_set->lock; 5237 ap->lock = &host_set->lock;
5247 ap->flags = ATA_FLAG_DISABLED; 5238 ap->flags = ATA_FLAG_DISABLED;
5248 ap->id = host->unique_id; 5239 ap->id = ata_unique_id++;
5249 ap->host = host;
5250 ap->ctl = ATA_DEVCTL_OBS; 5240 ap->ctl = ATA_DEVCTL_OBS;
5251 ap->host_set = host_set; 5241 ap->host_set = host_set;
5252 ap->dev = ent->dev; 5242 ap->dev = ent->dev;
@@ -5298,6 +5288,35 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
5298} 5288}
5299 5289
5300/** 5290/**
5291 * ata_host_init - Initialize an ata_port structure
5292 * @ap: Structure to initialize
5293 * @host: associated SCSI mid-layer structure
5294 * @host_set: Collection of hosts to which @ap belongs
5295 * @ent: Probe information provided by low-level driver
5296 * @port_no: Port number associated with this ata_port
5297 *
5298 * Initialize a new ata_port structure, and its associated
5299 * scsi_host.
5300 *
5301 * LOCKING:
5302 * Inherited from caller.
5303 */
5304
5305static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
5306 struct ata_host_set *host_set,
5307 const struct ata_probe_ent *ent, unsigned int port_no)
5308{
5309 ata_port_init(ap, host_set, ent, port_no);
5310 ap->host = host;
5311
5312 host->unique_id = ap->id;
5313 host->max_id = 16;
5314 host->max_lun = 1;
5315 host->max_channel = 1;
5316 host->max_cmd_len = 12;
5317}
5318
5319/**
5301 * ata_host_add - Attach low-level ATA driver to system 5320 * ata_host_add - Attach low-level ATA driver to system
5302 * @ent: Information provided by low-level driver 5321 * @ent: Information provided by low-level driver
5303 * @host_set: Collections of ports to which we add 5322 * @host_set: Collections of ports to which we add
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index c325679d9b54..b38aa4a286be 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -69,6 +69,8 @@ extern int ata_flush_cache(struct ata_device *dev);
69extern void ata_dev_init(struct ata_device *dev); 69extern void ata_dev_init(struct ata_device *dev);
70extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg); 70extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
71extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); 71extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
72extern void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set,
73 const struct ata_probe_ent *ent, unsigned int port_no);
72 74
73 75
74/* libata-scsi.c */ 76/* libata-scsi.c */