diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-08-24 03:19:22 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-08-24 03:19:22 -0400 |
commit | cca3974e48607c3775dc73b544a5700b2e37c21a (patch) | |
tree | 0777d6121ba199af0aad196eb5a693510ec8e62e /drivers/ata/libata-core.c | |
parent | 54a86bfc3d4601be9c36cd4e8a1bdc580c98fa6a (diff) |
libata: Grand renaming.
The biggest change is that ata_host_set is renamed to ata_host.
* ata_host_set => ata_host
* ata_probe_ent->host_flags => ata_probe_ent->port_flags
* ata_probe_ent->host_set_flags => ata_probe_ent->_host_flags
* ata_host_stats => ata_port_stats
* ata_port->host => ata_port->scsi_host
* ata_port->host_set => ata_port->host
* ata_port_info->host_flags => ata_port_info->flags
* ata_(.*)host_set(.*)\(\) => ata_\1host\2()
The leading underscore in ata_probe_ent->_host_flags is to avoid
reusing ->host_flags for different purpose. Currently, the only user
of the field is libata-bmdma.c and probe_ent itself is scheduled to be
removed.
ata_port->host is reused for different purpose but this field is used
inside libata core proper and of different type.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 292 |
1 files changed, 146 insertions, 146 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 9092416a6301..1c9315401f7a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1335,7 +1335,7 @@ static void ata_dev_config_ncq(struct ata_device *dev, | |||
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | if (ap->flags & ATA_FLAG_NCQ) { | 1337 | if (ap->flags & ATA_FLAG_NCQ) { |
1338 | hdepth = min(ap->host->can_queue, ATA_MAX_QUEUE - 1); | 1338 | hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE - 1); |
1339 | dev->flags |= ATA_DFLAG_NCQ; | 1339 | dev->flags |= ATA_DFLAG_NCQ; |
1340 | } | 1340 | } |
1341 | 1341 | ||
@@ -1349,12 +1349,13 @@ static void ata_set_port_max_cmd_len(struct ata_port *ap) | |||
1349 | { | 1349 | { |
1350 | int i; | 1350 | int i; |
1351 | 1351 | ||
1352 | if (ap->host) { | 1352 | if (ap->scsi_host) { |
1353 | ap->host->max_cmd_len = 0; | 1353 | unsigned int len = 0; |
1354 | |||
1354 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 1355 | for (i = 0; i < ATA_MAX_DEVICES; i++) |
1355 | ap->host->max_cmd_len = max_t(unsigned int, | 1356 | len = max(len, ap->device[i].cdb_len); |
1356 | ap->host->max_cmd_len, | 1357 | |
1357 | ap->device[i].cdb_len); | 1358 | ap->scsi_host->max_cmd_len = len; |
1358 | } | 1359 | } |
1359 | } | 1360 | } |
1360 | 1361 | ||
@@ -1662,7 +1663,7 @@ int ata_bus_probe(struct ata_port *ap) | |||
1662 | * Modify @ap data structure such that the system | 1663 | * Modify @ap data structure such that the system |
1663 | * thinks that the entire port is enabled. | 1664 | * thinks that the entire port is enabled. |
1664 | * | 1665 | * |
1665 | * LOCKING: host_set lock, or some other form of | 1666 | * LOCKING: host lock, or some other form of |
1666 | * serialization. | 1667 | * serialization. |
1667 | */ | 1668 | */ |
1668 | 1669 | ||
@@ -1800,7 +1801,7 @@ struct ata_device *ata_dev_pair(struct ata_device *adev) | |||
1800 | * never attempt to probe or communicate with devices | 1801 | * never attempt to probe or communicate with devices |
1801 | * on this port. | 1802 | * on this port. |
1802 | * | 1803 | * |
1803 | * LOCKING: host_set lock, or some other form of | 1804 | * LOCKING: host lock, or some other form of |
1804 | * serialization. | 1805 | * serialization. |
1805 | */ | 1806 | */ |
1806 | 1807 | ||
@@ -2258,8 +2259,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) | |||
2258 | /* Record simplex status. If we selected DMA then the other | 2259 | /* Record simplex status. If we selected DMA then the other |
2259 | * host channels are not permitted to do so. | 2260 | * host channels are not permitted to do so. |
2260 | */ | 2261 | */ |
2261 | if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX)) | 2262 | if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) |
2262 | ap->host_set->simplex_claimed = 1; | 2263 | ap->host->simplex_claimed = 1; |
2263 | 2264 | ||
2264 | /* step5: chip specific finalisation */ | 2265 | /* step5: chip specific finalisation */ |
2265 | if (ap->ops->post_set_mode) | 2266 | if (ap->ops->post_set_mode) |
@@ -2281,7 +2282,7 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) | |||
2281 | * other threads. | 2282 | * other threads. |
2282 | * | 2283 | * |
2283 | * LOCKING: | 2284 | * LOCKING: |
2284 | * spin_lock_irqsave(host_set lock) | 2285 | * spin_lock_irqsave(host lock) |
2285 | */ | 2286 | */ |
2286 | 2287 | ||
2287 | static inline void ata_tf_to_host(struct ata_port *ap, | 2288 | static inline void ata_tf_to_host(struct ata_port *ap, |
@@ -2445,7 +2446,7 @@ static unsigned int ata_bus_softreset(struct ata_port *ap, | |||
2445 | * | 2446 | * |
2446 | * LOCKING: | 2447 | * LOCKING: |
2447 | * PCI/etc. bus probe sem. | 2448 | * PCI/etc. bus probe sem. |
2448 | * Obtains host_set lock. | 2449 | * Obtains host lock. |
2449 | * | 2450 | * |
2450 | * SIDE EFFECTS: | 2451 | * SIDE EFFECTS: |
2451 | * Sets ATA_FLAG_DISABLED if bus reset fails. | 2452 | * Sets ATA_FLAG_DISABLED if bus reset fails. |
@@ -3080,7 +3081,7 @@ static int ata_dma_blacklisted(const struct ata_device *dev) | |||
3080 | static void ata_dev_xfermask(struct ata_device *dev) | 3081 | static void ata_dev_xfermask(struct ata_device *dev) |
3081 | { | 3082 | { |
3082 | struct ata_port *ap = dev->ap; | 3083 | struct ata_port *ap = dev->ap; |
3083 | struct ata_host_set *hs = ap->host_set; | 3084 | struct ata_host *host = ap->host; |
3084 | unsigned long xfer_mask; | 3085 | unsigned long xfer_mask; |
3085 | 3086 | ||
3086 | /* controller modes available */ | 3087 | /* controller modes available */ |
@@ -3114,7 +3115,7 @@ static void ata_dev_xfermask(struct ata_device *dev) | |||
3114 | "device is on DMA blacklist, disabling DMA\n"); | 3115 | "device is on DMA blacklist, disabling DMA\n"); |
3115 | } | 3116 | } |
3116 | 3117 | ||
3117 | if ((hs->flags & ATA_HOST_SIMPLEX) && hs->simplex_claimed) { | 3118 | if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed) { |
3118 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); | 3119 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); |
3119 | ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " | 3120 | ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " |
3120 | "other device, disabling DMA\n"); | 3121 | "other device, disabling DMA\n"); |
@@ -3207,7 +3208,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev, | |||
3207 | * Unmap all mapped DMA memory associated with this command. | 3208 | * Unmap all mapped DMA memory associated with this command. |
3208 | * | 3209 | * |
3209 | * LOCKING: | 3210 | * LOCKING: |
3210 | * spin_lock_irqsave(host_set lock) | 3211 | * spin_lock_irqsave(host lock) |
3211 | */ | 3212 | */ |
3212 | 3213 | ||
3213 | static void ata_sg_clean(struct ata_queued_cmd *qc) | 3214 | static void ata_sg_clean(struct ata_queued_cmd *qc) |
@@ -3267,7 +3268,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc) | |||
3267 | * associated with the current disk command. | 3268 | * associated with the current disk command. |
3268 | * | 3269 | * |
3269 | * LOCKING: | 3270 | * LOCKING: |
3270 | * spin_lock_irqsave(host_set lock) | 3271 | * spin_lock_irqsave(host lock) |
3271 | * | 3272 | * |
3272 | */ | 3273 | */ |
3273 | static void ata_fill_sg(struct ata_queued_cmd *qc) | 3274 | static void ata_fill_sg(struct ata_queued_cmd *qc) |
@@ -3319,7 +3320,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc) | |||
3319 | * supplied PACKET command. | 3320 | * supplied PACKET command. |
3320 | * | 3321 | * |
3321 | * LOCKING: | 3322 | * LOCKING: |
3322 | * spin_lock_irqsave(host_set lock) | 3323 | * spin_lock_irqsave(host lock) |
3323 | * | 3324 | * |
3324 | * RETURNS: 0 when ATAPI DMA can be used | 3325 | * RETURNS: 0 when ATAPI DMA can be used |
3325 | * nonzero otherwise | 3326 | * nonzero otherwise |
@@ -3341,7 +3342,7 @@ int ata_check_atapi_dma(struct ata_queued_cmd *qc) | |||
3341 | * Prepare ATA taskfile for submission. | 3342 | * Prepare ATA taskfile for submission. |
3342 | * | 3343 | * |
3343 | * LOCKING: | 3344 | * LOCKING: |
3344 | * spin_lock_irqsave(host_set lock) | 3345 | * spin_lock_irqsave(host lock) |
3345 | */ | 3346 | */ |
3346 | void ata_qc_prep(struct ata_queued_cmd *qc) | 3347 | void ata_qc_prep(struct ata_queued_cmd *qc) |
3347 | { | 3348 | { |
@@ -3363,7 +3364,7 @@ void ata_noop_qc_prep(struct ata_queued_cmd *qc) { } | |||
3363 | * to point to a single memory buffer, @buf of byte length @buflen. | 3364 | * to point to a single memory buffer, @buf of byte length @buflen. |
3364 | * | 3365 | * |
3365 | * LOCKING: | 3366 | * LOCKING: |
3366 | * spin_lock_irqsave(host_set lock) | 3367 | * spin_lock_irqsave(host lock) |
3367 | */ | 3368 | */ |
3368 | 3369 | ||
3369 | void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) | 3370 | void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) |
@@ -3394,7 +3395,7 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) | |||
3394 | * elements. | 3395 | * elements. |
3395 | * | 3396 | * |
3396 | * LOCKING: | 3397 | * LOCKING: |
3397 | * spin_lock_irqsave(host_set lock) | 3398 | * spin_lock_irqsave(host lock) |
3398 | */ | 3399 | */ |
3399 | 3400 | ||
3400 | void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 3401 | void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
@@ -3413,7 +3414,7 @@ void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | |||
3413 | * DMA-map the memory buffer associated with queued_cmd @qc. | 3414 | * DMA-map the memory buffer associated with queued_cmd @qc. |
3414 | * | 3415 | * |
3415 | * LOCKING: | 3416 | * LOCKING: |
3416 | * spin_lock_irqsave(host_set lock) | 3417 | * spin_lock_irqsave(host lock) |
3417 | * | 3418 | * |
3418 | * RETURNS: | 3419 | * RETURNS: |
3419 | * Zero on success, negative on error. | 3420 | * Zero on success, negative on error. |
@@ -3482,7 +3483,7 @@ skip_map: | |||
3482 | * DMA-map the scatter-gather table associated with queued_cmd @qc. | 3483 | * DMA-map the scatter-gather table associated with queued_cmd @qc. |
3483 | * | 3484 | * |
3484 | * LOCKING: | 3485 | * LOCKING: |
3485 | * spin_lock_irqsave(host_set lock) | 3486 | * spin_lock_irqsave(host lock) |
3486 | * | 3487 | * |
3487 | * RETURNS: | 3488 | * RETURNS: |
3488 | * Zero on success, negative on error. | 3489 | * Zero on success, negative on error. |
@@ -3991,7 +3992,7 @@ static inline int ata_hsm_ok_in_wq(struct ata_port *ap, struct ata_queued_cmd *q | |||
3991 | * Finish @qc which is running on standard HSM. | 3992 | * Finish @qc which is running on standard HSM. |
3992 | * | 3993 | * |
3993 | * LOCKING: | 3994 | * LOCKING: |
3994 | * If @in_wq is zero, spin_lock_irqsave(host_set lock). | 3995 | * If @in_wq is zero, spin_lock_irqsave(host lock). |
3995 | * Otherwise, none on entry and grabs host lock. | 3996 | * Otherwise, none on entry and grabs host lock. |
3996 | */ | 3997 | */ |
3997 | static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) | 3998 | static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) |
@@ -4003,8 +4004,8 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) | |||
4003 | if (in_wq) { | 4004 | if (in_wq) { |
4004 | spin_lock_irqsave(ap->lock, flags); | 4005 | spin_lock_irqsave(ap->lock, flags); |
4005 | 4006 | ||
4006 | /* EH might have kicked in while host_set lock | 4007 | /* EH might have kicked in while host lock is |
4007 | * is released. | 4008 | * released. |
4008 | */ | 4009 | */ |
4009 | qc = ata_qc_from_tag(ap, qc->tag); | 4010 | qc = ata_qc_from_tag(ap, qc->tag); |
4010 | if (qc) { | 4011 | if (qc) { |
@@ -4369,7 +4370,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev) | |||
4369 | * in case something prevents using it. | 4370 | * in case something prevents using it. |
4370 | * | 4371 | * |
4371 | * LOCKING: | 4372 | * LOCKING: |
4372 | * spin_lock_irqsave(host_set lock) | 4373 | * spin_lock_irqsave(host lock) |
4373 | */ | 4374 | */ |
4374 | void ata_qc_free(struct ata_queued_cmd *qc) | 4375 | void ata_qc_free(struct ata_queued_cmd *qc) |
4375 | { | 4376 | { |
@@ -4422,7 +4423,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) | |||
4422 | * command has completed, with either an ok or not-ok status. | 4423 | * command has completed, with either an ok or not-ok status. |
4423 | * | 4424 | * |
4424 | * LOCKING: | 4425 | * LOCKING: |
4425 | * spin_lock_irqsave(host_set lock) | 4426 | * spin_lock_irqsave(host lock) |
4426 | */ | 4427 | */ |
4427 | void ata_qc_complete(struct ata_queued_cmd *qc) | 4428 | void ata_qc_complete(struct ata_queued_cmd *qc) |
4428 | { | 4429 | { |
@@ -4485,7 +4486,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
4485 | * and commands are completed accordingly. | 4486 | * and commands are completed accordingly. |
4486 | * | 4487 | * |
4487 | * LOCKING: | 4488 | * LOCKING: |
4488 | * spin_lock_irqsave(host_set lock) | 4489 | * spin_lock_irqsave(host lock) |
4489 | * | 4490 | * |
4490 | * RETURNS: | 4491 | * RETURNS: |
4491 | * Number of completed commands on success, -errno otherwise. | 4492 | * Number of completed commands on success, -errno otherwise. |
@@ -4556,7 +4557,7 @@ static inline int ata_should_dma_map(struct ata_queued_cmd *qc) | |||
4556 | * writing the taskfile to hardware, starting the command. | 4557 | * writing the taskfile to hardware, starting the command. |
4557 | * | 4558 | * |
4558 | * LOCKING: | 4559 | * LOCKING: |
4559 | * spin_lock_irqsave(host_set lock) | 4560 | * spin_lock_irqsave(host lock) |
4560 | */ | 4561 | */ |
4561 | void ata_qc_issue(struct ata_queued_cmd *qc) | 4562 | void ata_qc_issue(struct ata_queued_cmd *qc) |
4562 | { | 4563 | { |
@@ -4617,7 +4618,7 @@ err: | |||
4617 | * May be used as the qc_issue() entry in ata_port_operations. | 4618 | * May be used as the qc_issue() entry in ata_port_operations. |
4618 | * | 4619 | * |
4619 | * LOCKING: | 4620 | * LOCKING: |
4620 | * spin_lock_irqsave(host_set lock) | 4621 | * spin_lock_irqsave(host lock) |
4621 | * | 4622 | * |
4622 | * RETURNS: | 4623 | * RETURNS: |
4623 | * Zero on success, AC_ERR_* mask on failure | 4624 | * Zero on success, AC_ERR_* mask on failure |
@@ -4746,7 +4747,7 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc) | |||
4746 | * handled via polling with interrupts disabled (nIEN bit). | 4747 | * handled via polling with interrupts disabled (nIEN bit). |
4747 | * | 4748 | * |
4748 | * LOCKING: | 4749 | * LOCKING: |
4749 | * spin_lock_irqsave(host_set lock) | 4750 | * spin_lock_irqsave(host lock) |
4750 | * | 4751 | * |
4751 | * RETURNS: | 4752 | * RETURNS: |
4752 | * One if interrupt was handled, zero if not (shared irq). | 4753 | * One if interrupt was handled, zero if not (shared irq). |
@@ -4833,14 +4834,14 @@ idle_irq: | |||
4833 | /** | 4834 | /** |
4834 | * ata_interrupt - Default ATA host interrupt handler | 4835 | * ata_interrupt - Default ATA host interrupt handler |
4835 | * @irq: irq line (unused) | 4836 | * @irq: irq line (unused) |
4836 | * @dev_instance: pointer to our ata_host_set information structure | 4837 | * @dev_instance: pointer to our ata_host information structure |
4837 | * @regs: unused | 4838 | * @regs: unused |
4838 | * | 4839 | * |
4839 | * Default interrupt handler for PCI IDE devices. Calls | 4840 | * Default interrupt handler for PCI IDE devices. Calls |
4840 | * ata_host_intr() for each port that is not disabled. | 4841 | * ata_host_intr() for each port that is not disabled. |
4841 | * | 4842 | * |
4842 | * LOCKING: | 4843 | * LOCKING: |
4843 | * Obtains host_set lock during operation. | 4844 | * Obtains host lock during operation. |
4844 | * | 4845 | * |
4845 | * RETURNS: | 4846 | * RETURNS: |
4846 | * IRQ_NONE or IRQ_HANDLED. | 4847 | * IRQ_NONE or IRQ_HANDLED. |
@@ -4848,18 +4849,18 @@ idle_irq: | |||
4848 | 4849 | ||
4849 | irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs) | 4850 | irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs) |
4850 | { | 4851 | { |
4851 | struct ata_host_set *host_set = dev_instance; | 4852 | struct ata_host *host = dev_instance; |
4852 | unsigned int i; | 4853 | unsigned int i; |
4853 | unsigned int handled = 0; | 4854 | unsigned int handled = 0; |
4854 | unsigned long flags; | 4855 | unsigned long flags; |
4855 | 4856 | ||
4856 | /* TODO: make _irqsave conditional on x86 PCI IDE legacy mode */ | 4857 | /* TODO: make _irqsave conditional on x86 PCI IDE legacy mode */ |
4857 | spin_lock_irqsave(&host_set->lock, flags); | 4858 | spin_lock_irqsave(&host->lock, flags); |
4858 | 4859 | ||
4859 | for (i = 0; i < host_set->n_ports; i++) { | 4860 | for (i = 0; i < host->n_ports; i++) { |
4860 | struct ata_port *ap; | 4861 | struct ata_port *ap; |
4861 | 4862 | ||
4862 | ap = host_set->ports[i]; | 4863 | ap = host->ports[i]; |
4863 | if (ap && | 4864 | if (ap && |
4864 | !(ap->flags & ATA_FLAG_DISABLED)) { | 4865 | !(ap->flags & ATA_FLAG_DISABLED)) { |
4865 | struct ata_queued_cmd *qc; | 4866 | struct ata_queued_cmd *qc; |
@@ -4871,7 +4872,7 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs) | |||
4871 | } | 4872 | } |
4872 | } | 4873 | } |
4873 | 4874 | ||
4874 | spin_unlock_irqrestore(&host_set->lock, flags); | 4875 | spin_unlock_irqrestore(&host->lock, flags); |
4875 | 4876 | ||
4876 | return IRQ_RETVAL(handled); | 4877 | return IRQ_RETVAL(handled); |
4877 | } | 4878 | } |
@@ -5036,15 +5037,15 @@ int ata_flush_cache(struct ata_device *dev) | |||
5036 | return 0; | 5037 | return 0; |
5037 | } | 5038 | } |
5038 | 5039 | ||
5039 | static int ata_host_set_request_pm(struct ata_host_set *host_set, | 5040 | static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, |
5040 | pm_message_t mesg, unsigned int action, | 5041 | unsigned int action, unsigned int ehi_flags, |
5041 | unsigned int ehi_flags, int wait) | 5042 | int wait) |
5042 | { | 5043 | { |
5043 | unsigned long flags; | 5044 | unsigned long flags; |
5044 | int i, rc; | 5045 | int i, rc; |
5045 | 5046 | ||
5046 | for (i = 0; i < host_set->n_ports; i++) { | 5047 | for (i = 0; i < host->n_ports; i++) { |
5047 | struct ata_port *ap = host_set->ports[i]; | 5048 | struct ata_port *ap = host->ports[i]; |
5048 | 5049 | ||
5049 | /* Previous resume operation might still be in | 5050 | /* Previous resume operation might still be in |
5050 | * progress. Wait for PM_PENDING to clear. | 5051 | * progress. Wait for PM_PENDING to clear. |
@@ -5084,11 +5085,11 @@ static int ata_host_set_request_pm(struct ata_host_set *host_set, | |||
5084 | } | 5085 | } |
5085 | 5086 | ||
5086 | /** | 5087 | /** |
5087 | * ata_host_set_suspend - suspend host_set | 5088 | * ata_host_suspend - suspend host |
5088 | * @host_set: host_set to suspend | 5089 | * @host: host to suspend |
5089 | * @mesg: PM message | 5090 | * @mesg: PM message |
5090 | * | 5091 | * |
5091 | * Suspend @host_set. Actual operation is performed by EH. This | 5092 | * Suspend @host. Actual operation is performed by EH. This |
5092 | * function requests EH to perform PM operations and waits for EH | 5093 | * function requests EH to perform PM operations and waits for EH |
5093 | * to finish. | 5094 | * to finish. |
5094 | * | 5095 | * |
@@ -5098,11 +5099,11 @@ static int ata_host_set_request_pm(struct ata_host_set *host_set, | |||
5098 | * RETURNS: | 5099 | * RETURNS: |
5099 | * 0 on success, -errno on failure. | 5100 | * 0 on success, -errno on failure. |
5100 | */ | 5101 | */ |
5101 | int ata_host_set_suspend(struct ata_host_set *host_set, pm_message_t mesg) | 5102 | int ata_host_suspend(struct ata_host *host, pm_message_t mesg) |
5102 | { | 5103 | { |
5103 | int i, j, rc; | 5104 | int i, j, rc; |
5104 | 5105 | ||
5105 | rc = ata_host_set_request_pm(host_set, mesg, 0, ATA_EHI_QUIET, 1); | 5106 | rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1); |
5106 | if (rc) | 5107 | if (rc) |
5107 | goto fail; | 5108 | goto fail; |
5108 | 5109 | ||
@@ -5110,8 +5111,8 @@ int ata_host_set_suspend(struct ata_host_set *host_set, pm_message_t mesg) | |||
5110 | * This happens if hotplug occurs between completion of device | 5111 | * This happens if hotplug occurs between completion of device |
5111 | * suspension and here. | 5112 | * suspension and here. |
5112 | */ | 5113 | */ |
5113 | for (i = 0; i < host_set->n_ports; i++) { | 5114 | for (i = 0; i < host->n_ports; i++) { |
5114 | struct ata_port *ap = host_set->ports[i]; | 5115 | struct ata_port *ap = host->ports[i]; |
5115 | 5116 | ||
5116 | for (j = 0; j < ATA_MAX_DEVICES; j++) { | 5117 | for (j = 0; j < ATA_MAX_DEVICES; j++) { |
5117 | struct ata_device *dev = &ap->device[j]; | 5118 | struct ata_device *dev = &ap->device[j]; |
@@ -5126,30 +5127,30 @@ int ata_host_set_suspend(struct ata_host_set *host_set, pm_message_t mesg) | |||
5126 | } | 5127 | } |
5127 | } | 5128 | } |
5128 | 5129 | ||
5129 | host_set->dev->power.power_state = mesg; | 5130 | host->dev->power.power_state = mesg; |
5130 | return 0; | 5131 | return 0; |
5131 | 5132 | ||
5132 | fail: | 5133 | fail: |
5133 | ata_host_set_resume(host_set); | 5134 | ata_host_resume(host); |
5134 | return rc; | 5135 | return rc; |
5135 | } | 5136 | } |
5136 | 5137 | ||
5137 | /** | 5138 | /** |
5138 | * ata_host_set_resume - resume host_set | 5139 | * ata_host_resume - resume host |
5139 | * @host_set: host_set to resume | 5140 | * @host: host to resume |
5140 | * | 5141 | * |
5141 | * Resume @host_set. Actual operation is performed by EH. This | 5142 | * Resume @host. Actual operation is performed by EH. This |
5142 | * function requests EH to perform PM operations and returns. | 5143 | * function requests EH to perform PM operations and returns. |
5143 | * Note that all resume operations are performed parallely. | 5144 | * Note that all resume operations are performed parallely. |
5144 | * | 5145 | * |
5145 | * LOCKING: | 5146 | * LOCKING: |
5146 | * Kernel thread context (may sleep). | 5147 | * Kernel thread context (may sleep). |
5147 | */ | 5148 | */ |
5148 | void ata_host_set_resume(struct ata_host_set *host_set) | 5149 | void ata_host_resume(struct ata_host *host) |
5149 | { | 5150 | { |
5150 | ata_host_set_request_pm(host_set, PMSG_ON, ATA_EH_SOFTRESET, | 5151 | ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET, |
5151 | ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0); | 5152 | ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0); |
5152 | host_set->dev->power.power_state = PMSG_ON; | 5153 | host->dev->power.power_state = PMSG_ON; |
5153 | } | 5154 | } |
5154 | 5155 | ||
5155 | /** | 5156 | /** |
@@ -5206,10 +5207,10 @@ void ata_port_stop (struct ata_port *ap) | |||
5206 | ata_pad_free(ap, dev); | 5207 | ata_pad_free(ap, dev); |
5207 | } | 5208 | } |
5208 | 5209 | ||
5209 | void ata_host_stop (struct ata_host_set *host_set) | 5210 | void ata_host_stop (struct ata_host *host) |
5210 | { | 5211 | { |
5211 | if (host_set->mmio_base) | 5212 | if (host->mmio_base) |
5212 | iounmap(host_set->mmio_base); | 5213 | iounmap(host->mmio_base); |
5213 | } | 5214 | } |
5214 | 5215 | ||
5215 | /** | 5216 | /** |
@@ -5231,7 +5232,7 @@ void ata_dev_init(struct ata_device *dev) | |||
5231 | 5232 | ||
5232 | /* High bits of dev->flags are used to record warm plug | 5233 | /* High bits of dev->flags are used to record warm plug |
5233 | * requests which occur asynchronously. Synchronize using | 5234 | * requests which occur asynchronously. Synchronize using |
5234 | * host_set lock. | 5235 | * host lock. |
5235 | */ | 5236 | */ |
5236 | spin_lock_irqsave(ap->lock, flags); | 5237 | spin_lock_irqsave(ap->lock, flags); |
5237 | dev->flags &= ~ATA_DFLAG_INIT_MASK; | 5238 | dev->flags &= ~ATA_DFLAG_INIT_MASK; |
@@ -5247,7 +5248,7 @@ void ata_dev_init(struct ata_device *dev) | |||
5247 | /** | 5248 | /** |
5248 | * ata_port_init - Initialize an ata_port structure | 5249 | * ata_port_init - Initialize an ata_port structure |
5249 | * @ap: Structure to initialize | 5250 | * @ap: Structure to initialize |
5250 | * @host_set: Collection of hosts to which @ap belongs | 5251 | * @host: Collection of hosts to which @ap belongs |
5251 | * @ent: Probe information provided by low-level driver | 5252 | * @ent: Probe information provided by low-level driver |
5252 | * @port_no: Port number associated with this ata_port | 5253 | * @port_no: Port number associated with this ata_port |
5253 | * | 5254 | * |
@@ -5256,22 +5257,22 @@ void ata_dev_init(struct ata_device *dev) | |||
5256 | * LOCKING: | 5257 | * LOCKING: |
5257 | * Inherited from caller. | 5258 | * Inherited from caller. |
5258 | */ | 5259 | */ |
5259 | void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set, | 5260 | void ata_port_init(struct ata_port *ap, struct ata_host *host, |
5260 | const struct ata_probe_ent *ent, unsigned int port_no) | 5261 | const struct ata_probe_ent *ent, unsigned int port_no) |
5261 | { | 5262 | { |
5262 | unsigned int i; | 5263 | unsigned int i; |
5263 | 5264 | ||
5264 | ap->lock = &host_set->lock; | 5265 | ap->lock = &host->lock; |
5265 | ap->flags = ATA_FLAG_DISABLED; | 5266 | ap->flags = ATA_FLAG_DISABLED; |
5266 | ap->id = ata_unique_id++; | 5267 | ap->id = ata_unique_id++; |
5267 | ap->ctl = ATA_DEVCTL_OBS; | 5268 | ap->ctl = ATA_DEVCTL_OBS; |
5268 | ap->host_set = host_set; | 5269 | ap->host = host; |
5269 | ap->dev = ent->dev; | 5270 | ap->dev = ent->dev; |
5270 | ap->port_no = port_no; | 5271 | ap->port_no = port_no; |
5271 | ap->pio_mask = ent->pio_mask; | 5272 | ap->pio_mask = ent->pio_mask; |
5272 | ap->mwdma_mask = ent->mwdma_mask; | 5273 | ap->mwdma_mask = ent->mwdma_mask; |
5273 | ap->udma_mask = ent->udma_mask; | 5274 | ap->udma_mask = ent->udma_mask; |
5274 | ap->flags |= ent->host_flags; | 5275 | ap->flags |= ent->port_flags; |
5275 | ap->ops = ent->port_ops; | 5276 | ap->ops = ent->port_ops; |
5276 | ap->hw_sata_spd_limit = UINT_MAX; | 5277 | ap->hw_sata_spd_limit = UINT_MAX; |
5277 | ap->active_tag = ATA_TAG_POISON; | 5278 | ap->active_tag = ATA_TAG_POISON; |
@@ -5324,7 +5325,7 @@ void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set, | |||
5324 | */ | 5325 | */ |
5325 | static void ata_port_init_shost(struct ata_port *ap, struct Scsi_Host *shost) | 5326 | static void ata_port_init_shost(struct ata_port *ap, struct Scsi_Host *shost) |
5326 | { | 5327 | { |
5327 | ap->host = shost; | 5328 | ap->scsi_host = shost; |
5328 | 5329 | ||
5329 | shost->unique_id = ap->id; | 5330 | shost->unique_id = ap->id; |
5330 | shost->max_id = 16; | 5331 | shost->max_id = 16; |
@@ -5336,7 +5337,7 @@ static void ata_port_init_shost(struct ata_port *ap, struct Scsi_Host *shost) | |||
5336 | /** | 5337 | /** |
5337 | * ata_port_add - Attach low-level ATA driver to system | 5338 | * ata_port_add - Attach low-level ATA driver to system |
5338 | * @ent: Information provided by low-level driver | 5339 | * @ent: Information provided by low-level driver |
5339 | * @host_set: Collections of ports to which we add | 5340 | * @host: Collections of ports to which we add |
5340 | * @port_no: Port number associated with this host | 5341 | * @port_no: Port number associated with this host |
5341 | * | 5342 | * |
5342 | * Attach low-level ATA driver to system. | 5343 | * Attach low-level ATA driver to system. |
@@ -5348,7 +5349,7 @@ static void ata_port_init_shost(struct ata_port *ap, struct Scsi_Host *shost) | |||
5348 | * New ata_port on success, for NULL on error. | 5349 | * New ata_port on success, for NULL on error. |
5349 | */ | 5350 | */ |
5350 | static struct ata_port * ata_port_add(const struct ata_probe_ent *ent, | 5351 | static struct ata_port * ata_port_add(const struct ata_probe_ent *ent, |
5351 | struct ata_host_set *host_set, | 5352 | struct ata_host *host, |
5352 | unsigned int port_no) | 5353 | unsigned int port_no) |
5353 | { | 5354 | { |
5354 | struct Scsi_Host *shost; | 5355 | struct Scsi_Host *shost; |
@@ -5357,7 +5358,7 @@ static struct ata_port * ata_port_add(const struct ata_probe_ent *ent, | |||
5357 | DPRINTK("ENTER\n"); | 5358 | DPRINTK("ENTER\n"); |
5358 | 5359 | ||
5359 | if (!ent->port_ops->error_handler && | 5360 | if (!ent->port_ops->error_handler && |
5360 | !(ent->host_flags & (ATA_FLAG_SATA_RESET | ATA_FLAG_SRST))) { | 5361 | !(ent->port_flags & (ATA_FLAG_SATA_RESET | ATA_FLAG_SRST))) { |
5361 | printk(KERN_ERR "ata%u: no reset mechanism available\n", | 5362 | printk(KERN_ERR "ata%u: no reset mechanism available\n", |
5362 | port_no); | 5363 | port_no); |
5363 | return NULL; | 5364 | return NULL; |
@@ -5371,32 +5372,31 @@ static struct ata_port * ata_port_add(const struct ata_probe_ent *ent, | |||
5371 | 5372 | ||
5372 | ap = ata_shost_to_port(shost); | 5373 | ap = ata_shost_to_port(shost); |
5373 | 5374 | ||
5374 | ata_port_init(ap, host_set, ent, port_no); | 5375 | ata_port_init(ap, host, ent, port_no); |
5375 | ata_port_init_shost(ap, shost); | 5376 | ata_port_init_shost(ap, shost); |
5376 | 5377 | ||
5377 | return ap; | 5378 | return ap; |
5378 | } | 5379 | } |
5379 | 5380 | ||
5380 | /** | 5381 | /** |
5381 | * ata_sas_host_init - Initialize a host_set struct | 5382 | * ata_sas_host_init - Initialize a host struct |
5382 | * @host_set: host_set to initialize | 5383 | * @host: host to initialize |
5383 | * @dev: device host_set is attached to | 5384 | * @dev: device host is attached to |
5384 | * @flags: host_set flags | 5385 | * @flags: host flags |
5385 | * @ops: port_ops | 5386 | * @ops: port_ops |
5386 | * | 5387 | * |
5387 | * LOCKING: | 5388 | * LOCKING: |
5388 | * PCI/etc. bus probe sem. | 5389 | * PCI/etc. bus probe sem. |
5389 | * | 5390 | * |
5390 | */ | 5391 | */ |
5391 | 5392 | ||
5392 | void ata_host_set_init(struct ata_host_set *host_set, | 5393 | void ata_host_init(struct ata_host *host, struct device *dev, |
5393 | struct device *dev, unsigned long flags, | 5394 | unsigned long flags, const struct ata_port_operations *ops) |
5394 | const struct ata_port_operations *ops) | ||
5395 | { | 5395 | { |
5396 | spin_lock_init(&host_set->lock); | 5396 | spin_lock_init(&host->lock); |
5397 | host_set->dev = dev; | 5397 | host->dev = dev; |
5398 | host_set->flags = flags; | 5398 | host->flags = flags; |
5399 | host_set->ops = ops; | 5399 | host->ops = ops; |
5400 | } | 5400 | } |
5401 | 5401 | ||
5402 | /** | 5402 | /** |
@@ -5421,34 +5421,34 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5421 | { | 5421 | { |
5422 | unsigned int i; | 5422 | unsigned int i; |
5423 | struct device *dev = ent->dev; | 5423 | struct device *dev = ent->dev; |
5424 | struct ata_host_set *host_set; | 5424 | struct ata_host *host; |
5425 | int rc; | 5425 | int rc; |
5426 | 5426 | ||
5427 | DPRINTK("ENTER\n"); | 5427 | DPRINTK("ENTER\n"); |
5428 | /* alloc a container for our list of ATA ports (buses) */ | 5428 | /* alloc a container for our list of ATA ports (buses) */ |
5429 | host_set = kzalloc(sizeof(struct ata_host_set) + | 5429 | host = kzalloc(sizeof(struct ata_host) + |
5430 | (ent->n_ports * sizeof(void *)), GFP_KERNEL); | 5430 | (ent->n_ports * sizeof(void *)), GFP_KERNEL); |
5431 | if (!host_set) | 5431 | if (!host) |
5432 | return 0; | 5432 | return 0; |
5433 | 5433 | ||
5434 | ata_host_set_init(host_set, dev, ent->host_set_flags, ent->port_ops); | 5434 | ata_host_init(host, dev, ent->_host_flags, ent->port_ops); |
5435 | host_set->n_ports = ent->n_ports; | 5435 | host->n_ports = ent->n_ports; |
5436 | host_set->irq = ent->irq; | 5436 | host->irq = ent->irq; |
5437 | host_set->irq2 = ent->irq2; | 5437 | host->irq2 = ent->irq2; |
5438 | host_set->mmio_base = ent->mmio_base; | 5438 | host->mmio_base = ent->mmio_base; |
5439 | host_set->private_data = ent->private_data; | 5439 | host->private_data = ent->private_data; |
5440 | 5440 | ||
5441 | /* register each port bound to this device */ | 5441 | /* register each port bound to this device */ |
5442 | for (i = 0; i < host_set->n_ports; i++) { | 5442 | for (i = 0; i < host->n_ports; i++) { |
5443 | struct ata_port *ap; | 5443 | struct ata_port *ap; |
5444 | unsigned long xfer_mode_mask; | 5444 | unsigned long xfer_mode_mask; |
5445 | int irq_line = ent->irq; | 5445 | int irq_line = ent->irq; |
5446 | 5446 | ||
5447 | ap = ata_port_add(ent, host_set, i); | 5447 | ap = ata_port_add(ent, host, i); |
5448 | if (!ap) | 5448 | if (!ap) |
5449 | goto err_out; | 5449 | goto err_out; |
5450 | 5450 | ||
5451 | host_set->ports[i] = ap; | 5451 | host->ports[i] = ap; |
5452 | 5452 | ||
5453 | /* dummy? */ | 5453 | /* dummy? */ |
5454 | if (ent->dummy_port_mask & (1 << i)) { | 5454 | if (ent->dummy_port_mask & (1 << i)) { |
@@ -5460,8 +5460,8 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5460 | /* start port */ | 5460 | /* start port */ |
5461 | rc = ap->ops->port_start(ap); | 5461 | rc = ap->ops->port_start(ap); |
5462 | if (rc) { | 5462 | if (rc) { |
5463 | host_set->ports[i] = NULL; | 5463 | host->ports[i] = NULL; |
5464 | scsi_host_put(ap->host); | 5464 | scsi_host_put(ap->scsi_host); |
5465 | goto err_out; | 5465 | goto err_out; |
5466 | } | 5466 | } |
5467 | 5467 | ||
@@ -5484,13 +5484,13 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5484 | irq_line); | 5484 | irq_line); |
5485 | 5485 | ||
5486 | ata_chk_status(ap); | 5486 | ata_chk_status(ap); |
5487 | host_set->ops->irq_clear(ap); | 5487 | host->ops->irq_clear(ap); |
5488 | ata_eh_freeze_port(ap); /* freeze port before requesting IRQ */ | 5488 | ata_eh_freeze_port(ap); /* freeze port before requesting IRQ */ |
5489 | } | 5489 | } |
5490 | 5490 | ||
5491 | /* obtain irq, that may be shared between channels */ | 5491 | /* obtain irq, that may be shared between channels */ |
5492 | rc = request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags, | 5492 | rc = request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags, |
5493 | DRV_NAME, host_set); | 5493 | DRV_NAME, host); |
5494 | if (rc) { | 5494 | if (rc) { |
5495 | dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n", | 5495 | dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n", |
5496 | ent->irq, rc); | 5496 | ent->irq, rc); |
@@ -5504,7 +5504,7 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5504 | BUG_ON(ent->irq == ent->irq2); | 5504 | BUG_ON(ent->irq == ent->irq2); |
5505 | 5505 | ||
5506 | rc = request_irq(ent->irq2, ent->port_ops->irq_handler, ent->irq_flags, | 5506 | rc = request_irq(ent->irq2, ent->port_ops->irq_handler, ent->irq_flags, |
5507 | DRV_NAME, host_set); | 5507 | DRV_NAME, host); |
5508 | if (rc) { | 5508 | if (rc) { |
5509 | dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n", | 5509 | dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n", |
5510 | ent->irq2, rc); | 5510 | ent->irq2, rc); |
@@ -5514,8 +5514,8 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5514 | 5514 | ||
5515 | /* perform each probe synchronously */ | 5515 | /* perform each probe synchronously */ |
5516 | DPRINTK("probe begin\n"); | 5516 | DPRINTK("probe begin\n"); |
5517 | for (i = 0; i < host_set->n_ports; i++) { | 5517 | for (i = 0; i < host->n_ports; i++) { |
5518 | struct ata_port *ap = host_set->ports[i]; | 5518 | struct ata_port *ap = host->ports[i]; |
5519 | u32 scontrol; | 5519 | u32 scontrol; |
5520 | int rc; | 5520 | int rc; |
5521 | 5521 | ||
@@ -5526,7 +5526,7 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5526 | } | 5526 | } |
5527 | ap->sata_spd_limit = ap->hw_sata_spd_limit; | 5527 | ap->sata_spd_limit = ap->hw_sata_spd_limit; |
5528 | 5528 | ||
5529 | rc = scsi_add_host(ap->host, dev); | 5529 | rc = scsi_add_host(ap->scsi_host, dev); |
5530 | if (rc) { | 5530 | if (rc) { |
5531 | ata_port_printk(ap, KERN_ERR, "scsi_add_host failed\n"); | 5531 | ata_port_printk(ap, KERN_ERR, "scsi_add_host failed\n"); |
5532 | /* FIXME: do something useful here */ | 5532 | /* FIXME: do something useful here */ |
@@ -5574,29 +5574,29 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
5574 | 5574 | ||
5575 | /* probes are done, now scan each port's disk(s) */ | 5575 | /* probes are done, now scan each port's disk(s) */ |
5576 | DPRINTK("host probe begin\n"); | 5576 | DPRINTK("host probe begin\n"); |
5577 | for (i = 0; i < host_set->n_ports; i++) { | 5577 | for (i = 0; i < host->n_ports; i++) { |
5578 | struct ata_port *ap = host_set->ports[i]; | 5578 | struct ata_port *ap = host->ports[i]; |
5579 | 5579 | ||
5580 | ata_scsi_scan_host(ap); | 5580 | ata_scsi_scan_host(ap); |
5581 | } | 5581 | } |
5582 | 5582 | ||
5583 | dev_set_drvdata(dev, host_set); | 5583 | dev_set_drvdata(dev, host); |
5584 | 5584 | ||
5585 | VPRINTK("EXIT, returning %u\n", ent->n_ports); | 5585 | VPRINTK("EXIT, returning %u\n", ent->n_ports); |
5586 | return ent->n_ports; /* success */ | 5586 | return ent->n_ports; /* success */ |
5587 | 5587 | ||
5588 | err_out_free_irq: | 5588 | err_out_free_irq: |
5589 | free_irq(ent->irq, host_set); | 5589 | free_irq(ent->irq, host); |
5590 | err_out: | 5590 | err_out: |
5591 | for (i = 0; i < host_set->n_ports; i++) { | 5591 | for (i = 0; i < host->n_ports; i++) { |
5592 | struct ata_port *ap = host_set->ports[i]; | 5592 | struct ata_port *ap = host->ports[i]; |
5593 | if (ap) { | 5593 | if (ap) { |
5594 | ap->ops->port_stop(ap); | 5594 | ap->ops->port_stop(ap); |
5595 | scsi_host_put(ap->host); | 5595 | scsi_host_put(ap->scsi_host); |
5596 | } | 5596 | } |
5597 | } | 5597 | } |
5598 | 5598 | ||
5599 | kfree(host_set); | 5599 | kfree(host); |
5600 | VPRINTK("EXIT, returning 0\n"); | 5600 | VPRINTK("EXIT, returning 0\n"); |
5601 | return 0; | 5601 | return 0; |
5602 | } | 5602 | } |
@@ -5656,12 +5656,12 @@ void ata_port_detach(struct ata_port *ap) | |||
5656 | 5656 | ||
5657 | skip_eh: | 5657 | skip_eh: |
5658 | /* remove the associated SCSI host */ | 5658 | /* remove the associated SCSI host */ |
5659 | scsi_remove_host(ap->host); | 5659 | scsi_remove_host(ap->scsi_host); |
5660 | } | 5660 | } |
5661 | 5661 | ||
5662 | /** | 5662 | /** |
5663 | * ata_host_set_remove - PCI layer callback for device removal | 5663 | * ata_host_remove - PCI layer callback for device removal |
5664 | * @host_set: ATA host set that was removed | 5664 | * @host: ATA host set that was removed |
5665 | * | 5665 | * |
5666 | * Unregister all objects associated with this host set. Free those | 5666 | * Unregister all objects associated with this host set. Free those |
5667 | * objects. | 5667 | * objects. |
@@ -5670,21 +5670,21 @@ void ata_port_detach(struct ata_port *ap) | |||
5670 | * Inherited from calling layer (may sleep). | 5670 | * Inherited from calling layer (may sleep). |
5671 | */ | 5671 | */ |
5672 | 5672 | ||
5673 | void ata_host_set_remove(struct ata_host_set *host_set) | 5673 | void ata_host_remove(struct ata_host *host) |
5674 | { | 5674 | { |
5675 | unsigned int i; | 5675 | unsigned int i; |
5676 | 5676 | ||
5677 | for (i = 0; i < host_set->n_ports; i++) | 5677 | for (i = 0; i < host->n_ports; i++) |
5678 | ata_port_detach(host_set->ports[i]); | 5678 | ata_port_detach(host->ports[i]); |
5679 | 5679 | ||
5680 | free_irq(host_set->irq, host_set); | 5680 | free_irq(host->irq, host); |
5681 | if (host_set->irq2) | 5681 | if (host->irq2) |
5682 | free_irq(host_set->irq2, host_set); | 5682 | free_irq(host->irq2, host); |
5683 | 5683 | ||
5684 | for (i = 0; i < host_set->n_ports; i++) { | 5684 | for (i = 0; i < host->n_ports; i++) { |
5685 | struct ata_port *ap = host_set->ports[i]; | 5685 | struct ata_port *ap = host->ports[i]; |
5686 | 5686 | ||
5687 | ata_scsi_release(ap->host); | 5687 | ata_scsi_release(ap->scsi_host); |
5688 | 5688 | ||
5689 | if ((ap->flags & ATA_FLAG_NO_LEGACY) == 0) { | 5689 | if ((ap->flags & ATA_FLAG_NO_LEGACY) == 0) { |
5690 | struct ata_ioports *ioaddr = &ap->ioaddr; | 5690 | struct ata_ioports *ioaddr = &ap->ioaddr; |
@@ -5696,13 +5696,13 @@ void ata_host_set_remove(struct ata_host_set *host_set) | |||
5696 | release_region(ATA_SECONDARY_CMD, 8); | 5696 | release_region(ATA_SECONDARY_CMD, 8); |
5697 | } | 5697 | } |
5698 | 5698 | ||
5699 | scsi_host_put(ap->host); | 5699 | scsi_host_put(ap->scsi_host); |
5700 | } | 5700 | } |
5701 | 5701 | ||
5702 | if (host_set->ops->host_stop) | 5702 | if (host->ops->host_stop) |
5703 | host_set->ops->host_stop(host_set); | 5703 | host->ops->host_stop(host); |
5704 | 5704 | ||
5705 | kfree(host_set); | 5705 | kfree(host); |
5706 | } | 5706 | } |
5707 | 5707 | ||
5708 | /** | 5708 | /** |
@@ -5719,9 +5719,9 @@ void ata_host_set_remove(struct ata_host_set *host_set) | |||
5719 | * One. | 5719 | * One. |
5720 | */ | 5720 | */ |
5721 | 5721 | ||
5722 | int ata_scsi_release(struct Scsi_Host *host) | 5722 | int ata_scsi_release(struct Scsi_Host *shost) |
5723 | { | 5723 | { |
5724 | struct ata_port *ap = ata_shost_to_port(host); | 5724 | struct ata_port *ap = ata_shost_to_port(shost); |
5725 | 5725 | ||
5726 | DPRINTK("ENTER\n"); | 5726 | DPRINTK("ENTER\n"); |
5727 | 5727 | ||
@@ -5748,7 +5748,7 @@ ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port) | |||
5748 | probe_ent->dev = dev; | 5748 | probe_ent->dev = dev; |
5749 | 5749 | ||
5750 | probe_ent->sht = port->sht; | 5750 | probe_ent->sht = port->sht; |
5751 | probe_ent->host_flags = port->host_flags; | 5751 | probe_ent->port_flags = port->flags; |
5752 | probe_ent->pio_mask = port->pio_mask; | 5752 | probe_ent->pio_mask = port->pio_mask; |
5753 | probe_ent->mwdma_mask = port->mwdma_mask; | 5753 | probe_ent->mwdma_mask = port->mwdma_mask; |
5754 | probe_ent->udma_mask = port->udma_mask; | 5754 | probe_ent->udma_mask = port->udma_mask; |
@@ -5786,11 +5786,11 @@ void ata_std_ports(struct ata_ioports *ioaddr) | |||
5786 | 5786 | ||
5787 | #ifdef CONFIG_PCI | 5787 | #ifdef CONFIG_PCI |
5788 | 5788 | ||
5789 | void ata_pci_host_stop (struct ata_host_set *host_set) | 5789 | void ata_pci_host_stop (struct ata_host *host) |
5790 | { | 5790 | { |
5791 | struct pci_dev *pdev = to_pci_dev(host_set->dev); | 5791 | struct pci_dev *pdev = to_pci_dev(host->dev); |
5792 | 5792 | ||
5793 | pci_iounmap(pdev, host_set->mmio_base); | 5793 | pci_iounmap(pdev, host->mmio_base); |
5794 | } | 5794 | } |
5795 | 5795 | ||
5796 | /** | 5796 | /** |
@@ -5810,9 +5810,9 @@ void ata_pci_host_stop (struct ata_host_set *host_set) | |||
5810 | void ata_pci_remove_one (struct pci_dev *pdev) | 5810 | void ata_pci_remove_one (struct pci_dev *pdev) |
5811 | { | 5811 | { |
5812 | struct device *dev = pci_dev_to_dev(pdev); | 5812 | struct device *dev = pci_dev_to_dev(pdev); |
5813 | struct ata_host_set *host_set = dev_get_drvdata(dev); | 5813 | struct ata_host *host = dev_get_drvdata(dev); |
5814 | 5814 | ||
5815 | ata_host_set_remove(host_set); | 5815 | ata_host_remove(host); |
5816 | 5816 | ||
5817 | pci_release_regions(pdev); | 5817 | pci_release_regions(pdev); |
5818 | pci_disable_device(pdev); | 5818 | pci_disable_device(pdev); |
@@ -5873,10 +5873,10 @@ void ata_pci_device_do_resume(struct pci_dev *pdev) | |||
5873 | 5873 | ||
5874 | int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | 5874 | int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) |
5875 | { | 5875 | { |
5876 | struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev); | 5876 | struct ata_host *host = dev_get_drvdata(&pdev->dev); |
5877 | int rc = 0; | 5877 | int rc = 0; |
5878 | 5878 | ||
5879 | rc = ata_host_set_suspend(host_set, mesg); | 5879 | rc = ata_host_suspend(host, mesg); |
5880 | if (rc) | 5880 | if (rc) |
5881 | return rc; | 5881 | return rc; |
5882 | 5882 | ||
@@ -5887,10 +5887,10 @@ int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
5887 | 5887 | ||
5888 | int ata_pci_device_resume(struct pci_dev *pdev) | 5888 | int ata_pci_device_resume(struct pci_dev *pdev) |
5889 | { | 5889 | { |
5890 | struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev); | 5890 | struct ata_host *host = dev_get_drvdata(&pdev->dev); |
5891 | 5891 | ||
5892 | ata_pci_device_do_resume(pdev); | 5892 | ata_pci_device_do_resume(pdev); |
5893 | ata_host_set_resume(host_set); | 5893 | ata_host_resume(host); |
5894 | return 0; | 5894 | return 0; |
5895 | } | 5895 | } |
5896 | #endif /* CONFIG_PCI */ | 5896 | #endif /* CONFIG_PCI */ |
@@ -6035,10 +6035,10 @@ EXPORT_SYMBOL_GPL(sata_deb_timing_long); | |||
6035 | EXPORT_SYMBOL_GPL(ata_dummy_port_ops); | 6035 | EXPORT_SYMBOL_GPL(ata_dummy_port_ops); |
6036 | EXPORT_SYMBOL_GPL(ata_std_bios_param); | 6036 | EXPORT_SYMBOL_GPL(ata_std_bios_param); |
6037 | EXPORT_SYMBOL_GPL(ata_std_ports); | 6037 | EXPORT_SYMBOL_GPL(ata_std_ports); |
6038 | EXPORT_SYMBOL_GPL(ata_host_set_init); | 6038 | EXPORT_SYMBOL_GPL(ata_host_init); |
6039 | EXPORT_SYMBOL_GPL(ata_device_add); | 6039 | EXPORT_SYMBOL_GPL(ata_device_add); |
6040 | EXPORT_SYMBOL_GPL(ata_port_detach); | 6040 | EXPORT_SYMBOL_GPL(ata_port_detach); |
6041 | EXPORT_SYMBOL_GPL(ata_host_set_remove); | 6041 | EXPORT_SYMBOL_GPL(ata_host_remove); |
6042 | EXPORT_SYMBOL_GPL(ata_sg_init); | 6042 | EXPORT_SYMBOL_GPL(ata_sg_init); |
6043 | EXPORT_SYMBOL_GPL(ata_sg_init_one); | 6043 | EXPORT_SYMBOL_GPL(ata_sg_init_one); |
6044 | EXPORT_SYMBOL_GPL(ata_hsm_move); | 6044 | EXPORT_SYMBOL_GPL(ata_hsm_move); |
@@ -6105,8 +6105,8 @@ EXPORT_SYMBOL_GPL(sata_scr_write); | |||
6105 | EXPORT_SYMBOL_GPL(sata_scr_write_flush); | 6105 | EXPORT_SYMBOL_GPL(sata_scr_write_flush); |
6106 | EXPORT_SYMBOL_GPL(ata_port_online); | 6106 | EXPORT_SYMBOL_GPL(ata_port_online); |
6107 | EXPORT_SYMBOL_GPL(ata_port_offline); | 6107 | EXPORT_SYMBOL_GPL(ata_port_offline); |
6108 | EXPORT_SYMBOL_GPL(ata_host_set_suspend); | 6108 | EXPORT_SYMBOL_GPL(ata_host_suspend); |
6109 | EXPORT_SYMBOL_GPL(ata_host_set_resume); | 6109 | EXPORT_SYMBOL_GPL(ata_host_resume); |
6110 | EXPORT_SYMBOL_GPL(ata_id_string); | 6110 | EXPORT_SYMBOL_GPL(ata_id_string); |
6111 | EXPORT_SYMBOL_GPL(ata_id_c_string); | 6111 | EXPORT_SYMBOL_GPL(ata_id_c_string); |
6112 | EXPORT_SYMBOL_GPL(ata_scsi_simulate); | 6112 | EXPORT_SYMBOL_GPL(ata_scsi_simulate); |