aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-08-24 03:19:22 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-24 03:19:22 -0400
commitcca3974e48607c3775dc73b544a5700b2e37c21a (patch)
tree0777d6121ba199af0aad196eb5a693510ec8e62e /drivers/ata/libata-scsi.c
parent54a86bfc3d4601be9c36cd4e8a1bdc580c98fa6a (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-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index d168e3413661..3986ec8741b4 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -321,7 +321,7 @@ int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg)
321 * current command. 321 * current command.
322 * 322 *
323 * LOCKING: 323 * LOCKING:
324 * spin_lock_irqsave(host_set lock) 324 * spin_lock_irqsave(host lock)
325 * 325 *
326 * RETURNS: 326 * RETURNS:
327 * Command allocated, or %NULL if none available. 327 * Command allocated, or %NULL if none available.
@@ -537,7 +537,7 @@ int ata_scsi_device_resume(struct scsi_device *sdev)
537 * format sense blocks. 537 * format sense blocks.
538 * 538 *
539 * LOCKING: 539 * LOCKING:
540 * spin_lock_irqsave(host_set lock) 540 * spin_lock_irqsave(host lock)
541 */ 541 */
542void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc, 542void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc,
543 u8 *ascq, int verbose) 543 u8 *ascq, int verbose)
@@ -649,7 +649,7 @@ void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc,
649 * block. Clear sense key, ASC & ASCQ if there is no error. 649 * block. Clear sense key, ASC & ASCQ if there is no error.
650 * 650 *
651 * LOCKING: 651 * LOCKING:
652 * spin_lock_irqsave(host_set lock) 652 * spin_lock_irqsave(host lock)
653 */ 653 */
654void ata_gen_ata_desc_sense(struct ata_queued_cmd *qc) 654void ata_gen_ata_desc_sense(struct ata_queued_cmd *qc)
655{ 655{
@@ -918,7 +918,7 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth)
918 * [See SAT revision 5 at www.t10.org] 918 * [See SAT revision 5 at www.t10.org]
919 * 919 *
920 * LOCKING: 920 * LOCKING:
921 * spin_lock_irqsave(host_set lock) 921 * spin_lock_irqsave(host lock)
922 * 922 *
923 * RETURNS: 923 * RETURNS:
924 * Zero on success, non-zero on error. 924 * Zero on success, non-zero on error.
@@ -986,7 +986,7 @@ invalid_fld:
986 * FLUSH CACHE EXT. 986 * FLUSH CACHE EXT.
987 * 987 *
988 * LOCKING: 988 * LOCKING:
989 * spin_lock_irqsave(host_set lock) 989 * spin_lock_irqsave(host lock)
990 * 990 *
991 * RETURNS: 991 * RETURNS:
992 * Zero on success, non-zero on error. 992 * Zero on success, non-zero on error.
@@ -1109,7 +1109,7 @@ static void scsi_16_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen)
1109 * Converts SCSI VERIFY command to an ATA READ VERIFY command. 1109 * Converts SCSI VERIFY command to an ATA READ VERIFY command.
1110 * 1110 *
1111 * LOCKING: 1111 * LOCKING:
1112 * spin_lock_irqsave(host_set lock) 1112 * spin_lock_irqsave(host lock)
1113 * 1113 *
1114 * RETURNS: 1114 * RETURNS:
1115 * Zero on success, non-zero on error. 1115 * Zero on success, non-zero on error.
@@ -1233,7 +1233,7 @@ nothing_to_do:
1233 * %WRITE_16 are currently supported. 1233 * %WRITE_16 are currently supported.
1234 * 1234 *
1235 * LOCKING: 1235 * LOCKING:
1236 * spin_lock_irqsave(host_set lock) 1236 * spin_lock_irqsave(host lock)
1237 * 1237 *
1238 * RETURNS: 1238 * RETURNS:
1239 * Zero on success, non-zero on error. 1239 * Zero on success, non-zero on error.
@@ -1467,7 +1467,7 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
1467 * issued to @dev. 1467 * issued to @dev.
1468 * 1468 *
1469 * LOCKING: 1469 * LOCKING:
1470 * spin_lock_irqsave(host_set lock) 1470 * spin_lock_irqsave(host lock)
1471 * 1471 *
1472 * RETURNS: 1472 * RETURNS:
1473 * 1 if deferring is needed, 0 otherwise. 1473 * 1 if deferring is needed, 0 otherwise.
@@ -1510,7 +1510,7 @@ static int ata_scmd_need_defer(struct ata_device *dev, int is_io)
1510 * termination. 1510 * termination.
1511 * 1511 *
1512 * LOCKING: 1512 * LOCKING:
1513 * spin_lock_irqsave(host_set lock) 1513 * spin_lock_irqsave(host lock)
1514 * 1514 *
1515 * RETURNS: 1515 * RETURNS:
1516 * 0 on success, SCSI_ML_QUEUE_DEVICE_BUSY if the command 1516 * 0 on success, SCSI_ML_QUEUE_DEVICE_BUSY if the command
@@ -1589,7 +1589,7 @@ defer:
1589 * Maps buffer contained within SCSI command @cmd. 1589 * Maps buffer contained within SCSI command @cmd.
1590 * 1590 *
1591 * LOCKING: 1591 * LOCKING:
1592 * spin_lock_irqsave(host_set lock) 1592 * spin_lock_irqsave(host lock)
1593 * 1593 *
1594 * RETURNS: 1594 * RETURNS:
1595 * Length of response buffer. 1595 * Length of response buffer.
@@ -1623,7 +1623,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd *cmd, u8 **buf_out)
1623 * Unmaps response buffer contained within @cmd. 1623 * Unmaps response buffer contained within @cmd.
1624 * 1624 *
1625 * LOCKING: 1625 * LOCKING:
1626 * spin_lock_irqsave(host_set lock) 1626 * spin_lock_irqsave(host lock)
1627 */ 1627 */
1628 1628
1629static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf) 1629static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
@@ -1649,7 +1649,7 @@ static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
1649 * and sense buffer are assumed to be set). 1649 * and sense buffer are assumed to be set).
1650 * 1650 *
1651 * LOCKING: 1651 * LOCKING:
1652 * spin_lock_irqsave(host_set lock) 1652 * spin_lock_irqsave(host lock)
1653 */ 1653 */
1654 1654
1655void ata_scsi_rbuf_fill(struct ata_scsi_args *args, 1655void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
@@ -1680,7 +1680,7 @@ void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
1680 * with non-VPD INQUIRY command output. 1680 * with non-VPD INQUIRY command output.
1681 * 1681 *
1682 * LOCKING: 1682 * LOCKING:
1683 * spin_lock_irqsave(host_set lock) 1683 * spin_lock_irqsave(host lock)
1684 */ 1684 */
1685 1685
1686unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, 1686unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
@@ -1736,7 +1736,7 @@ unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
1736 * Returns list of inquiry VPD pages available. 1736 * Returns list of inquiry VPD pages available.
1737 * 1737 *
1738 * LOCKING: 1738 * LOCKING:
1739 * spin_lock_irqsave(host_set lock) 1739 * spin_lock_irqsave(host lock)
1740 */ 1740 */
1741 1741
1742unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf, 1742unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf,
@@ -1764,7 +1764,7 @@ unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf,
1764 * Returns ATA device serial number. 1764 * Returns ATA device serial number.
1765 * 1765 *
1766 * LOCKING: 1766 * LOCKING:
1767 * spin_lock_irqsave(host_set lock) 1767 * spin_lock_irqsave(host lock)
1768 */ 1768 */
1769 1769
1770unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf, 1770unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf,
@@ -1797,7 +1797,7 @@ unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf,
1797 * name ("ATA "), model and serial numbers. 1797 * name ("ATA "), model and serial numbers.
1798 * 1798 *
1799 * LOCKING: 1799 * LOCKING:
1800 * spin_lock_irqsave(host_set lock) 1800 * spin_lock_irqsave(host lock)
1801 */ 1801 */
1802 1802
1803unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf, 1803unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf,
@@ -1849,7 +1849,7 @@ unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf,
1849 * that the caller should successfully complete this SCSI command. 1849 * that the caller should successfully complete this SCSI command.
1850 * 1850 *
1851 * LOCKING: 1851 * LOCKING:
1852 * spin_lock_irqsave(host_set lock) 1852 * spin_lock_irqsave(host lock)
1853 */ 1853 */
1854 1854
1855unsigned int ata_scsiop_noop(struct ata_scsi_args *args, u8 *rbuf, 1855unsigned int ata_scsiop_noop(struct ata_scsi_args *args, u8 *rbuf,
@@ -1990,7 +1990,7 @@ static int ata_dev_supports_fua(u16 *id)
1990 * descriptor for other device types. 1990 * descriptor for other device types.
1991 * 1991 *
1992 * LOCKING: 1992 * LOCKING:
1993 * spin_lock_irqsave(host_set lock) 1993 * spin_lock_irqsave(host lock)
1994 */ 1994 */
1995 1995
1996unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf, 1996unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf,
@@ -2129,7 +2129,7 @@ saving_not_supp:
2129 * Simulate READ CAPACITY commands. 2129 * Simulate READ CAPACITY commands.
2130 * 2130 *
2131 * LOCKING: 2131 * LOCKING:
2132 * spin_lock_irqsave(host_set lock) 2132 * spin_lock_irqsave(host lock)
2133 */ 2133 */
2134 2134
2135unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf, 2135unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
@@ -2204,7 +2204,7 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
2204 * Simulate REPORT LUNS command. 2204 * Simulate REPORT LUNS command.
2205 * 2205 *
2206 * LOCKING: 2206 * LOCKING:
2207 * spin_lock_irqsave(host_set lock) 2207 * spin_lock_irqsave(host lock)
2208 */ 2208 */
2209 2209
2210unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf, 2210unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf,
@@ -2256,7 +2256,7 @@ void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq)
2256 * and the specified additional sense codes. 2256 * and the specified additional sense codes.
2257 * 2257 *
2258 * LOCKING: 2258 * LOCKING:
2259 * spin_lock_irqsave(host_set lock) 2259 * spin_lock_irqsave(host lock)
2260 */ 2260 */
2261 2261
2262void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8 asc, u8 ascq) 2262void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8 asc, u8 ascq)
@@ -2421,7 +2421,7 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
2421 * @scsicmd: SCSI CDB associated with this PACKET command 2421 * @scsicmd: SCSI CDB associated with this PACKET command
2422 * 2422 *
2423 * LOCKING: 2423 * LOCKING:
2424 * spin_lock_irqsave(host_set lock) 2424 * spin_lock_irqsave(host lock)
2425 * 2425 *
2426 * RETURNS: 2426 * RETURNS:
2427 * Zero on success, non-zero on failure. 2427 * Zero on success, non-zero on failure.
@@ -2500,7 +2500,7 @@ static struct ata_device * __ata_scsi_find_dev(struct ata_port *ap,
2500 * Determine if commands should be sent to the specified device. 2500 * Determine if commands should be sent to the specified device.
2501 * 2501 *
2502 * LOCKING: 2502 * LOCKING:
2503 * spin_lock_irqsave(host_set lock) 2503 * spin_lock_irqsave(host lock)
2504 * 2504 *
2505 * RETURNS: 2505 * RETURNS:
2506 * 0 if commands are not allowed / 1 if commands are allowed 2506 * 0 if commands are not allowed / 1 if commands are allowed
@@ -2534,7 +2534,7 @@ static int ata_scsi_dev_enabled(struct ata_device *dev)
2534 * SCSI command to be sent. 2534 * SCSI command to be sent.
2535 * 2535 *
2536 * LOCKING: 2536 * LOCKING:
2537 * spin_lock_irqsave(host_set lock) 2537 * spin_lock_irqsave(host lock)
2538 * 2538 *
2539 * RETURNS: 2539 * RETURNS:
2540 * Associated ATA device, or %NULL if not found. 2540 * Associated ATA device, or %NULL if not found.
@@ -2808,7 +2808,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *cmd,
2808 * ATA and ATAPI devices appearing as SCSI devices. 2808 * ATA and ATAPI devices appearing as SCSI devices.
2809 * 2809 *
2810 * LOCKING: 2810 * LOCKING:
2811 * Releases scsi-layer-held lock, and obtains host_set lock. 2811 * Releases scsi-layer-held lock, and obtains host lock.
2812 * 2812 *
2813 * RETURNS: 2813 * RETURNS:
2814 * Return value from __ata_scsi_queuecmd() if @cmd can be queued, 2814 * Return value from __ata_scsi_queuecmd() if @cmd can be queued,
@@ -2852,7 +2852,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
2852 * that can be handled internally. 2852 * that can be handled internally.
2853 * 2853 *
2854 * LOCKING: 2854 * LOCKING:
2855 * spin_lock_irqsave(host_set lock) 2855 * spin_lock_irqsave(host lock)
2856 */ 2856 */
2857 2857
2858void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, 2858void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
@@ -2944,7 +2944,7 @@ void ata_scsi_scan_host(struct ata_port *ap)
2944 if (!ata_dev_enabled(dev) || dev->sdev) 2944 if (!ata_dev_enabled(dev) || dev->sdev)
2945 continue; 2945 continue;
2946 2946
2947 sdev = __scsi_add_device(ap->host, 0, i, 0, NULL); 2947 sdev = __scsi_add_device(ap->scsi_host, 0, i, 0, NULL);
2948 if (!IS_ERR(sdev)) { 2948 if (!IS_ERR(sdev)) {
2949 dev->sdev = sdev; 2949 dev->sdev = sdev;
2950 scsi_device_put(sdev); 2950 scsi_device_put(sdev);
@@ -2958,11 +2958,11 @@ void ata_scsi_scan_host(struct ata_port *ap)
2958 * 2958 *
2959 * This function is called from ata_eh_hotplug() and responsible 2959 * This function is called from ata_eh_hotplug() and responsible
2960 * for taking the SCSI device attached to @dev offline. This 2960 * for taking the SCSI device attached to @dev offline. This
2961 * function is called with host_set lock which protects dev->sdev 2961 * function is called with host lock which protects dev->sdev
2962 * against clearing. 2962 * against clearing.
2963 * 2963 *
2964 * LOCKING: 2964 * LOCKING:
2965 * spin_lock_irqsave(host_set lock) 2965 * spin_lock_irqsave(host lock)
2966 * 2966 *
2967 * RETURNS: 2967 * RETURNS:
2968 * 1 if attached SCSI device exists, 0 otherwise. 2968 * 1 if attached SCSI device exists, 0 otherwise.
@@ -2998,16 +2998,16 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
2998 * be removed if there is __scsi_device_get() interface which 2998 * be removed if there is __scsi_device_get() interface which
2999 * increments reference counts regardless of device state. 2999 * increments reference counts regardless of device state.
3000 */ 3000 */
3001 mutex_lock(&ap->host->scan_mutex); 3001 mutex_lock(&ap->scsi_host->scan_mutex);
3002 spin_lock_irqsave(ap->lock, flags); 3002 spin_lock_irqsave(ap->lock, flags);
3003 3003
3004 /* clearing dev->sdev is protected by host_set lock */ 3004 /* clearing dev->sdev is protected by host lock */
3005 sdev = dev->sdev; 3005 sdev = dev->sdev;
3006 dev->sdev = NULL; 3006 dev->sdev = NULL;
3007 3007
3008 if (sdev) { 3008 if (sdev) {
3009 /* If user initiated unplug races with us, sdev can go 3009 /* If user initiated unplug races with us, sdev can go
3010 * away underneath us after the host_set lock and 3010 * away underneath us after the host lock and
3011 * scan_mutex are released. Hold onto it. 3011 * scan_mutex are released. Hold onto it.
3012 */ 3012 */
3013 if (scsi_device_get(sdev) == 0) { 3013 if (scsi_device_get(sdev) == 0) {
@@ -3024,7 +3024,7 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
3024 } 3024 }
3025 3025
3026 spin_unlock_irqrestore(ap->lock, flags); 3026 spin_unlock_irqrestore(ap->lock, flags);
3027 mutex_unlock(&ap->host->scan_mutex); 3027 mutex_unlock(&ap->scsi_host->scan_mutex);
3028 3028
3029 if (sdev) { 3029 if (sdev) {
3030 ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n", 3030 ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n",
@@ -3176,7 +3176,7 @@ void ata_scsi_dev_rescan(void *data)
3176 * ata_sas_port_alloc - Allocate port for a SAS attached SATA device 3176 * ata_sas_port_alloc - Allocate port for a SAS attached SATA device
3177 * @pdev: PCI device that the scsi device is attached to 3177 * @pdev: PCI device that the scsi device is attached to
3178 * @port_info: Information from low-level host driver 3178 * @port_info: Information from low-level host driver
3179 * @host: SCSI host that the scsi device is attached to 3179 * @shost: SCSI host that the scsi device is attached to
3180 * 3180 *
3181 * LOCKING: 3181 * LOCKING:
3182 * PCI/etc. bus probe sem. 3182 * PCI/etc. bus probe sem.
@@ -3185,9 +3185,9 @@ void ata_scsi_dev_rescan(void *data)
3185 * ata_port pointer on success / NULL on failure. 3185 * ata_port pointer on success / NULL on failure.
3186 */ 3186 */
3187 3187
3188struct ata_port *ata_sas_port_alloc(struct ata_host_set *host_set, 3188struct ata_port *ata_sas_port_alloc(struct ata_host *host,
3189 struct ata_port_info *port_info, 3189 struct ata_port_info *port_info,
3190 struct Scsi_Host *host) 3190 struct Scsi_Host *shost)
3191{ 3191{
3192 struct ata_port *ap = kzalloc(sizeof(*ap), GFP_KERNEL); 3192 struct ata_port *ap = kzalloc(sizeof(*ap), GFP_KERNEL);
3193 struct ata_probe_ent *ent; 3193 struct ata_probe_ent *ent;
@@ -3195,14 +3195,14 @@ struct ata_port *ata_sas_port_alloc(struct ata_host_set *host_set,
3195 if (!ap) 3195 if (!ap)
3196 return NULL; 3196 return NULL;
3197 3197
3198 ent = ata_probe_ent_alloc(host_set->dev, port_info); 3198 ent = ata_probe_ent_alloc(host->dev, port_info);
3199 if (!ent) { 3199 if (!ent) {
3200 kfree(ap); 3200 kfree(ap);
3201 return NULL; 3201 return NULL;
3202 } 3202 }
3203 3203
3204 ata_port_init(ap, host_set, ent, 0); 3204 ata_port_init(ap, host, ent, 0);
3205 ap->lock = host->host_lock; 3205 ap->lock = shost->host_lock;
3206 kfree(ent); 3206 kfree(ent);
3207 return ap; 3207 return ap;
3208} 3208}