diff options
author | Henne <henne@nachtwindheim.de> | 2006-10-02 08:56:23 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-10-03 18:28:29 -0400 |
commit | 1516b55d903a5d370859d9013e48db5caea95204 (patch) | |
tree | 736d9744df90034fac12d973ad1f6701bf26011a /drivers | |
parent | 8f6fd19f1f7ab1dab225845464c96cba36a18533 (diff) |
[SCSI] scsi: Convertion to struct scsi_cmnd in ips-driver
Converts the obsolete Scsi_Cmnd to struct scsi_cmnd in the ips-driver.
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ips.c | 83 | ||||
-rw-r--r-- | drivers/scsi/ips.h | 16 |
2 files changed, 46 insertions, 53 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 58065ff6936c..95b7536626f9 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -250,9 +250,9 @@ module_param(ips, charp, 0); | |||
250 | */ | 250 | */ |
251 | static int ips_detect(struct scsi_host_template *); | 251 | static int ips_detect(struct scsi_host_template *); |
252 | static int ips_release(struct Scsi_Host *); | 252 | static int ips_release(struct Scsi_Host *); |
253 | static int ips_eh_abort(Scsi_Cmnd *); | 253 | static int ips_eh_abort(struct scsi_cmnd *); |
254 | static int ips_eh_reset(Scsi_Cmnd *); | 254 | static int ips_eh_reset(struct scsi_cmnd *); |
255 | static int ips_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); | 255 | static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *)); |
256 | static const char *ips_info(struct Scsi_Host *); | 256 | static const char *ips_info(struct Scsi_Host *); |
257 | static irqreturn_t do_ipsintr(int, void *, struct pt_regs *); | 257 | static irqreturn_t do_ipsintr(int, void *, struct pt_regs *); |
258 | static int ips_hainit(ips_ha_t *); | 258 | static int ips_hainit(ips_ha_t *); |
@@ -325,24 +325,26 @@ static uint32_t ips_statupd_copperhead_memio(ips_ha_t *); | |||
325 | static uint32_t ips_statupd_morpheus(ips_ha_t *); | 325 | static uint32_t ips_statupd_morpheus(ips_ha_t *); |
326 | static ips_scb_t *ips_getscb(ips_ha_t *); | 326 | static ips_scb_t *ips_getscb(ips_ha_t *); |
327 | static void ips_putq_scb_head(ips_scb_queue_t *, ips_scb_t *); | 327 | static void ips_putq_scb_head(ips_scb_queue_t *, ips_scb_t *); |
328 | static void ips_putq_wait_tail(ips_wait_queue_t *, Scsi_Cmnd *); | 328 | static void ips_putq_wait_tail(ips_wait_queue_t *, struct scsi_cmnd *); |
329 | static void ips_putq_copp_tail(ips_copp_queue_t *, | 329 | static void ips_putq_copp_tail(ips_copp_queue_t *, |
330 | ips_copp_wait_item_t *); | 330 | ips_copp_wait_item_t *); |
331 | static ips_scb_t *ips_removeq_scb_head(ips_scb_queue_t *); | 331 | static ips_scb_t *ips_removeq_scb_head(ips_scb_queue_t *); |
332 | static ips_scb_t *ips_removeq_scb(ips_scb_queue_t *, ips_scb_t *); | 332 | static ips_scb_t *ips_removeq_scb(ips_scb_queue_t *, ips_scb_t *); |
333 | static Scsi_Cmnd *ips_removeq_wait_head(ips_wait_queue_t *); | 333 | static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *); |
334 | static Scsi_Cmnd *ips_removeq_wait(ips_wait_queue_t *, Scsi_Cmnd *); | 334 | static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *, |
335 | struct scsi_cmnd *); | ||
335 | static ips_copp_wait_item_t *ips_removeq_copp(ips_copp_queue_t *, | 336 | static ips_copp_wait_item_t *ips_removeq_copp(ips_copp_queue_t *, |
336 | ips_copp_wait_item_t *); | 337 | ips_copp_wait_item_t *); |
337 | static ips_copp_wait_item_t *ips_removeq_copp_head(ips_copp_queue_t *); | 338 | static ips_copp_wait_item_t *ips_removeq_copp_head(ips_copp_queue_t *); |
338 | 339 | ||
339 | static int ips_is_passthru(Scsi_Cmnd *); | 340 | static int ips_is_passthru(struct scsi_cmnd *); |
340 | static int ips_make_passthru(ips_ha_t *, Scsi_Cmnd *, ips_scb_t *, int); | 341 | static int ips_make_passthru(ips_ha_t *, struct scsi_cmnd *, ips_scb_t *, int); |
341 | static int ips_usrcmd(ips_ha_t *, ips_passthru_t *, ips_scb_t *); | 342 | static int ips_usrcmd(ips_ha_t *, ips_passthru_t *, ips_scb_t *); |
342 | static void ips_cleanup_passthru(ips_ha_t *, ips_scb_t *); | 343 | static void ips_cleanup_passthru(ips_ha_t *, ips_scb_t *); |
343 | static void ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, | 344 | static void ips_scmd_buf_write(struct scsi_cmnd * scmd, void *data, |
344 | unsigned int count); | 345 | unsigned int count); |
345 | static void ips_scmd_buf_read(Scsi_Cmnd * scmd, void *data, unsigned int count); | 346 | static void ips_scmd_buf_read(struct scsi_cmnd * scmd, void *data, |
347 | unsigned int count); | ||
346 | 348 | ||
347 | static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); | 349 | static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); |
348 | static int ips_host_info(ips_ha_t *, char *, off_t, int); | 350 | static int ips_host_info(ips_ha_t *, char *, off_t, int); |
@@ -812,8 +814,7 @@ ips_halt(struct notifier_block *nb, ulong event, void *buf) | |||
812 | /* Abort a command (using the new error code stuff) */ | 814 | /* Abort a command (using the new error code stuff) */ |
813 | /* Note: this routine is called under the io_request_lock */ | 815 | /* Note: this routine is called under the io_request_lock */ |
814 | /****************************************************************************/ | 816 | /****************************************************************************/ |
815 | int | 817 | int ips_eh_abort(struct scsi_cmnd *SC) |
816 | ips_eh_abort(Scsi_Cmnd * SC) | ||
817 | { | 818 | { |
818 | ips_ha_t *ha; | 819 | ips_ha_t *ha; |
819 | ips_copp_wait_item_t *item; | 820 | ips_copp_wait_item_t *item; |
@@ -871,8 +872,7 @@ ips_eh_abort(Scsi_Cmnd * SC) | |||
871 | /* NOTE: this routine is called under the io_request_lock spinlock */ | 872 | /* NOTE: this routine is called under the io_request_lock spinlock */ |
872 | /* */ | 873 | /* */ |
873 | /****************************************************************************/ | 874 | /****************************************************************************/ |
874 | static int | 875 | static int __ips_eh_reset(struct scsi_cmnd *SC) |
875 | __ips_eh_reset(Scsi_Cmnd * SC) | ||
876 | { | 876 | { |
877 | int ret; | 877 | int ret; |
878 | int i; | 878 | int i; |
@@ -968,7 +968,7 @@ __ips_eh_reset(Scsi_Cmnd * SC) | |||
968 | ret = (*ha->func.reset) (ha); | 968 | ret = (*ha->func.reset) (ha); |
969 | 969 | ||
970 | if (!ret) { | 970 | if (!ret) { |
971 | Scsi_Cmnd *scsi_cmd; | 971 | struct scsi_cmnd *scsi_cmd; |
972 | 972 | ||
973 | IPS_PRINTK(KERN_NOTICE, ha->pcidev, | 973 | IPS_PRINTK(KERN_NOTICE, ha->pcidev, |
974 | "Controller reset failed - controller now offline.\n"); | 974 | "Controller reset failed - controller now offline.\n"); |
@@ -997,7 +997,7 @@ __ips_eh_reset(Scsi_Cmnd * SC) | |||
997 | } | 997 | } |
998 | 998 | ||
999 | if (!ips_clear_adapter(ha, IPS_INTR_IORL)) { | 999 | if (!ips_clear_adapter(ha, IPS_INTR_IORL)) { |
1000 | Scsi_Cmnd *scsi_cmd; | 1000 | struct scsi_cmnd *scsi_cmd; |
1001 | 1001 | ||
1002 | IPS_PRINTK(KERN_NOTICE, ha->pcidev, | 1002 | IPS_PRINTK(KERN_NOTICE, ha->pcidev, |
1003 | "Controller reset failed - controller now offline.\n"); | 1003 | "Controller reset failed - controller now offline.\n"); |
@@ -1059,8 +1059,7 @@ __ips_eh_reset(Scsi_Cmnd * SC) | |||
1059 | 1059 | ||
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | static int | 1062 | static int ips_eh_reset(struct scsi_cmnd *SC) |
1063 | ips_eh_reset(Scsi_Cmnd * SC) | ||
1064 | { | 1063 | { |
1065 | int rc; | 1064 | int rc; |
1066 | 1065 | ||
@@ -1083,8 +1082,7 @@ ips_eh_reset(Scsi_Cmnd * SC) | |||
1083 | /* Linux obtains io_request_lock before calling this function */ | 1082 | /* Linux obtains io_request_lock before calling this function */ |
1084 | /* */ | 1083 | /* */ |
1085 | /****************************************************************************/ | 1084 | /****************************************************************************/ |
1086 | static int | 1085 | static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) |
1087 | ips_queue(Scsi_Cmnd * SC, void (*done) (Scsi_Cmnd *)) | ||
1088 | { | 1086 | { |
1089 | ips_ha_t *ha; | 1087 | ips_ha_t *ha; |
1090 | ips_passthru_t *pt; | 1088 | ips_passthru_t *pt; |
@@ -1602,8 +1600,7 @@ ips_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, | |||
1602 | /* Determine if the specified SCSI command is really a passthru command */ | 1600 | /* Determine if the specified SCSI command is really a passthru command */ |
1603 | /* */ | 1601 | /* */ |
1604 | /****************************************************************************/ | 1602 | /****************************************************************************/ |
1605 | static int | 1603 | static int ips_is_passthru(struct scsi_cmnd *SC) |
1606 | ips_is_passthru(Scsi_Cmnd * SC) | ||
1607 | { | 1604 | { |
1608 | unsigned long flags; | 1605 | unsigned long flags; |
1609 | 1606 | ||
@@ -1685,7 +1682,7 @@ ips_alloc_passthru_buffer(ips_ha_t * ha, int length) | |||
1685 | /* */ | 1682 | /* */ |
1686 | /****************************************************************************/ | 1683 | /****************************************************************************/ |
1687 | static int | 1684 | static int |
1688 | ips_make_passthru(ips_ha_t * ha, Scsi_Cmnd * SC, ips_scb_t * scb, int intr) | 1685 | ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) |
1689 | { | 1686 | { |
1690 | ips_passthru_t *pt; | 1687 | ips_passthru_t *pt; |
1691 | int length = 0; | 1688 | int length = 0; |
@@ -2734,9 +2731,9 @@ static void | |||
2734 | ips_next(ips_ha_t * ha, int intr) | 2731 | ips_next(ips_ha_t * ha, int intr) |
2735 | { | 2732 | { |
2736 | ips_scb_t *scb; | 2733 | ips_scb_t *scb; |
2737 | Scsi_Cmnd *SC; | 2734 | struct scsi_cmnd *SC; |
2738 | Scsi_Cmnd *p; | 2735 | struct scsi_cmnd *p; |
2739 | Scsi_Cmnd *q; | 2736 | struct scsi_cmnd *q; |
2740 | ips_copp_wait_item_t *item; | 2737 | ips_copp_wait_item_t *item; |
2741 | int ret; | 2738 | int ret; |
2742 | unsigned long cpu_flags = 0; | 2739 | unsigned long cpu_flags = 0; |
@@ -2847,7 +2844,7 @@ ips_next(ips_ha_t * ha, int intr) | |||
2847 | dcdb_active[scmd_channel(p) - | 2844 | dcdb_active[scmd_channel(p) - |
2848 | 1] & (1 << scmd_id(p)))) { | 2845 | 1] & (1 << scmd_id(p)))) { |
2849 | ips_freescb(ha, scb); | 2846 | ips_freescb(ha, scb); |
2850 | p = (Scsi_Cmnd *) p->host_scribble; | 2847 | p = (struct scsi_cmnd *) p->host_scribble; |
2851 | continue; | 2848 | continue; |
2852 | } | 2849 | } |
2853 | 2850 | ||
@@ -2962,7 +2959,7 @@ ips_next(ips_ha_t * ha, int intr) | |||
2962 | break; | 2959 | break; |
2963 | } /* end case */ | 2960 | } /* end case */ |
2964 | 2961 | ||
2965 | p = (Scsi_Cmnd *) p->host_scribble; | 2962 | p = (struct scsi_cmnd *) p->host_scribble; |
2966 | 2963 | ||
2967 | } /* end while */ | 2964 | } /* end while */ |
2968 | 2965 | ||
@@ -3090,8 +3087,7 @@ ips_removeq_scb(ips_scb_queue_t * queue, ips_scb_t * item) | |||
3090 | /* ASSUMED to be called from within the HA lock */ | 3087 | /* ASSUMED to be called from within the HA lock */ |
3091 | /* */ | 3088 | /* */ |
3092 | /****************************************************************************/ | 3089 | /****************************************************************************/ |
3093 | static void | 3090 | static void ips_putq_wait_tail(ips_wait_queue_t *queue, struct scsi_cmnd *item) |
3094 | ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item) | ||
3095 | { | 3091 | { |
3096 | METHOD_TRACE("ips_putq_wait_tail", 1); | 3092 | METHOD_TRACE("ips_putq_wait_tail", 1); |
3097 | 3093 | ||
@@ -3122,10 +3118,9 @@ ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item) | |||
3122 | /* ASSUMED to be called from within the HA lock */ | 3118 | /* ASSUMED to be called from within the HA lock */ |
3123 | /* */ | 3119 | /* */ |
3124 | /****************************************************************************/ | 3120 | /****************************************************************************/ |
3125 | static Scsi_Cmnd * | 3121 | static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *queue) |
3126 | ips_removeq_wait_head(ips_wait_queue_t * queue) | ||
3127 | { | 3122 | { |
3128 | Scsi_Cmnd *item; | 3123 | struct scsi_cmnd *item; |
3129 | 3124 | ||
3130 | METHOD_TRACE("ips_removeq_wait_head", 1); | 3125 | METHOD_TRACE("ips_removeq_wait_head", 1); |
3131 | 3126 | ||
@@ -3135,7 +3130,7 @@ ips_removeq_wait_head(ips_wait_queue_t * queue) | |||
3135 | return (NULL); | 3130 | return (NULL); |
3136 | } | 3131 | } |
3137 | 3132 | ||
3138 | queue->head = (Scsi_Cmnd *) item->host_scribble; | 3133 | queue->head = (struct scsi_cmnd *) item->host_scribble; |
3139 | item->host_scribble = NULL; | 3134 | item->host_scribble = NULL; |
3140 | 3135 | ||
3141 | if (queue->tail == item) | 3136 | if (queue->tail == item) |
@@ -3157,10 +3152,10 @@ ips_removeq_wait_head(ips_wait_queue_t * queue) | |||
3157 | /* ASSUMED to be called from within the HA lock */ | 3152 | /* ASSUMED to be called from within the HA lock */ |
3158 | /* */ | 3153 | /* */ |
3159 | /****************************************************************************/ | 3154 | /****************************************************************************/ |
3160 | static Scsi_Cmnd * | 3155 | static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *queue, |
3161 | ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item) | 3156 | struct scsi_cmnd *item) |
3162 | { | 3157 | { |
3163 | Scsi_Cmnd *p; | 3158 | struct scsi_cmnd *p; |
3164 | 3159 | ||
3165 | METHOD_TRACE("ips_removeq_wait", 1); | 3160 | METHOD_TRACE("ips_removeq_wait", 1); |
3166 | 3161 | ||
@@ -3173,8 +3168,8 @@ ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item) | |||
3173 | 3168 | ||
3174 | p = queue->head; | 3169 | p = queue->head; |
3175 | 3170 | ||
3176 | while ((p) && (item != (Scsi_Cmnd *) p->host_scribble)) | 3171 | while ((p) && (item != (struct scsi_cmnd *) p->host_scribble)) |
3177 | p = (Scsi_Cmnd *) p->host_scribble; | 3172 | p = (struct scsi_cmnd *) p->host_scribble; |
3178 | 3173 | ||
3179 | if (p) { | 3174 | if (p) { |
3180 | /* found a match */ | 3175 | /* found a match */ |
@@ -3659,11 +3654,10 @@ ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) | |||
3659 | /* Routine Name: ips_scmd_buf_write */ | 3654 | /* Routine Name: ips_scmd_buf_write */ |
3660 | /* */ | 3655 | /* */ |
3661 | /* Routine Description: */ | 3656 | /* Routine Description: */ |
3662 | /* Write data to Scsi_Cmnd request_buffer at proper offsets */ | 3657 | /* Write data to struct scsi_cmnd request_buffer at proper offsets */ |
3663 | /****************************************************************************/ | 3658 | /****************************************************************************/ |
3664 | static void | 3659 | static void |
3665 | ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned | 3660 | ips_scmd_buf_write(struct scsi_cmnd *scmd, void *data, unsigned int count) |
3666 | int count) | ||
3667 | { | 3661 | { |
3668 | if (scmd->use_sg) { | 3662 | if (scmd->use_sg) { |
3669 | int i; | 3663 | int i; |
@@ -3698,11 +3692,10 @@ ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned | |||
3698 | /* Routine Name: ips_scmd_buf_read */ | 3692 | /* Routine Name: ips_scmd_buf_read */ |
3699 | /* */ | 3693 | /* */ |
3700 | /* Routine Description: */ | 3694 | /* Routine Description: */ |
3701 | /* Copy data from a Scsi_Cmnd to a new, linear buffer */ | 3695 | /* Copy data from a struct scsi_cmnd to a new, linear buffer */ |
3702 | /****************************************************************************/ | 3696 | /****************************************************************************/ |
3703 | static void | 3697 | static void |
3704 | ips_scmd_buf_read(Scsi_Cmnd * scmd, void *data, unsigned | 3698 | ips_scmd_buf_read(struct scsi_cmnd *scmd, void *data, unsigned int count) |
3705 | int count) | ||
3706 | { | 3699 | { |
3707 | if (scmd->use_sg) { | 3700 | if (scmd->use_sg) { |
3708 | int i; | 3701 | int i; |
diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h index f46c382e5599..34680f3dd452 100644 --- a/drivers/scsi/ips.h +++ b/drivers/scsi/ips.h | |||
@@ -6,7 +6,7 @@ | |||
6 | /* David Jeffery, Adaptec, Inc. */ | 6 | /* David Jeffery, Adaptec, Inc. */ |
7 | /* */ | 7 | /* */ |
8 | /* Copyright (C) 1999 IBM Corporation */ | 8 | /* Copyright (C) 1999 IBM Corporation */ |
9 | /* Copyright (C) 2003 Adaptec, Inc. */ | 9 | /* Copyright (C) 2003 Adaptec, Inc. */ |
10 | /* */ | 10 | /* */ |
11 | /* This program is free software; you can redistribute it and/or modify */ | 11 | /* This program is free software; you can redistribute it and/or modify */ |
12 | /* it under the terms of the GNU General Public License as published by */ | 12 | /* it under the terms of the GNU General Public License as published by */ |
@@ -1033,14 +1033,14 @@ typedef struct ips_scb_queue { | |||
1033 | * Wait queue_format | 1033 | * Wait queue_format |
1034 | */ | 1034 | */ |
1035 | typedef struct ips_wait_queue { | 1035 | typedef struct ips_wait_queue { |
1036 | Scsi_Cmnd *head; | 1036 | struct scsi_cmnd *head; |
1037 | Scsi_Cmnd *tail; | 1037 | struct scsi_cmnd *tail; |
1038 | int count; | 1038 | int count; |
1039 | } ips_wait_queue_t; | 1039 | } ips_wait_queue_t; |
1040 | 1040 | ||
1041 | typedef struct ips_copp_wait_item { | 1041 | typedef struct ips_copp_wait_item { |
1042 | Scsi_Cmnd *scsi_cmd; | 1042 | struct scsi_cmnd *scsi_cmd; |
1043 | struct ips_copp_wait_item *next; | 1043 | struct ips_copp_wait_item *next; |
1044 | } ips_copp_wait_item_t; | 1044 | } ips_copp_wait_item_t; |
1045 | 1045 | ||
1046 | typedef struct ips_copp_queue { | 1046 | typedef struct ips_copp_queue { |
@@ -1149,7 +1149,7 @@ typedef struct ips_scb { | |||
1149 | uint32_t flags; | 1149 | uint32_t flags; |
1150 | uint32_t op_code; | 1150 | uint32_t op_code; |
1151 | IPS_SG_LIST sg_list; | 1151 | IPS_SG_LIST sg_list; |
1152 | Scsi_Cmnd *scsi_cmd; | 1152 | struct scsi_cmnd *scsi_cmd; |
1153 | struct ips_scb *q_next; | 1153 | struct ips_scb *q_next; |
1154 | ips_scb_callback callback; | 1154 | ips_scb_callback callback; |
1155 | uint32_t sg_busaddr; | 1155 | uint32_t sg_busaddr; |
@@ -1175,7 +1175,7 @@ typedef struct ips_scb_pt { | |||
1175 | uint32_t flags; | 1175 | uint32_t flags; |
1176 | uint32_t op_code; | 1176 | uint32_t op_code; |
1177 | IPS_SG_LIST *sg_list; | 1177 | IPS_SG_LIST *sg_list; |
1178 | Scsi_Cmnd *scsi_cmd; | 1178 | struct scsi_cmnd *scsi_cmd; |
1179 | struct ips_scb *q_next; | 1179 | struct ips_scb *q_next; |
1180 | ips_scb_callback callback; | 1180 | ips_scb_callback callback; |
1181 | } ips_scb_pt_t; | 1181 | } ips_scb_pt_t; |