aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fc4/fc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fc4/fc.c')
-rw-r--r--drivers/fc4/fc.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index 22d17474755f..ca4e67a022d0 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -70,9 +70,9 @@
70 70
71#define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp)) 71#define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
72#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->device->host->hostdata[0])) 72#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->device->host->hostdata[0]))
73#define SC_FCMND(fcmnd) ((Scsi_Cmnd *)((long)fcmnd - (long)&(((Scsi_Cmnd *)0)->SCp))) 73#define SC_FCMND(fcmnd) ((struct scsi_cmnd *)((long)fcmnd - (long)&(((struct scsi_cmnd *)0)->SCp)))
74 74
75static int fcp_scsi_queue_it(fc_channel *, Scsi_Cmnd *, fcp_cmnd *, int); 75static int fcp_scsi_queue_it(fc_channel *, struct scsi_cmnd *, fcp_cmnd *, int);
76void fcp_queue_empty(fc_channel *); 76void fcp_queue_empty(fc_channel *);
77 77
78static void fcp_scsi_insert_queue (fc_channel *fc, fcp_cmnd *fcmd) 78static void fcp_scsi_insert_queue (fc_channel *fc, fcp_cmnd *fcmd)
@@ -378,14 +378,14 @@ void fcp_register(fc_channel *fc, u8 type, int unregister)
378 printk ("FC: %segistering unknown type %02x\n", unregister ? "Unr" : "R", type); 378 printk ("FC: %segistering unknown type %02x\n", unregister ? "Unr" : "R", type);
379} 379}
380 380
381static void fcp_scsi_done(Scsi_Cmnd *SCpnt); 381static void fcp_scsi_done(struct scsi_cmnd *SCpnt);
382 382
383static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hdr *fch) 383static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hdr *fch)
384{ 384{
385 fcp_cmnd *fcmd; 385 fcp_cmnd *fcmd;
386 fcp_rsp *rsp; 386 fcp_rsp *rsp;
387 int host_status; 387 int host_status;
388 Scsi_Cmnd *SCpnt; 388 struct scsi_cmnd *SCpnt;
389 int sense_len; 389 int sense_len;
390 int rsp_status; 390 int rsp_status;
391 391
@@ -757,13 +757,14 @@ void fcp_release(fc_channel *fcchain, int count) /* count must > 0 */
757} 757}
758 758
759 759
760static void fcp_scsi_done (Scsi_Cmnd *SCpnt) 760static void fcp_scsi_done(struct scsi_cmnd *SCpnt)
761{ 761{
762 if (FCP_CMND(SCpnt)->done) 762 if (FCP_CMND(SCpnt)->done)
763 FCP_CMND(SCpnt)->done(SCpnt); 763 FCP_CMND(SCpnt)->done(SCpnt);
764} 764}
765 765
766static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare) 766static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt,
767 fcp_cmnd *fcmd, int prepare)
767{ 768{
768 long i; 769 long i;
769 fcp_cmd *cmd; 770 fcp_cmd *cmd;
@@ -837,7 +838,8 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
837 return 0; 838 return 0;
838} 839}
839 840
840int fcp_scsi_queuecommand(Scsi_Cmnd *SCpnt, void (* done)(Scsi_Cmnd *)) 841int fcp_scsi_queuecommand(struct scsi_cmnd *SCpnt,
842 void (* done)(struct scsi_cmnd *))
841{ 843{
842 fcp_cmnd *fcmd = FCP_CMND(SCpnt); 844 fcp_cmnd *fcmd = FCP_CMND(SCpnt);
843 fc_channel *fc = FC_SCMND(SCpnt); 845 fc_channel *fc = FC_SCMND(SCpnt);
@@ -873,7 +875,7 @@ void fcp_queue_empty(fc_channel *fc)
873 } 875 }
874} 876}
875 877
876int fcp_scsi_abort(Scsi_Cmnd *SCpnt) 878int fcp_scsi_abort(struct scsi_cmnd *SCpnt)
877{ 879{
878 /* Internal bookkeeping only. Lose 1 cmd_slots slot. */ 880 /* Internal bookkeeping only. Lose 1 cmd_slots slot. */
879 fcp_cmnd *fcmd = FCP_CMND(SCpnt); 881 fcp_cmnd *fcmd = FCP_CMND(SCpnt);
@@ -910,7 +912,7 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
910} 912}
911 913
912#if 0 914#if 0
913void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt) 915void fcp_scsi_reset_done(struct scsi_cmnd *SCpnt)
914{ 916{
915 fc_channel *fc = FC_SCMND(SCpnt); 917 fc_channel *fc = FC_SCMND(SCpnt);
916 918
@@ -921,7 +923,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
921 923
922#define FCP_RESET_TIMEOUT (2*HZ) 924#define FCP_RESET_TIMEOUT (2*HZ)
923 925
924int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) 926int fcp_scsi_dev_reset(struct scsi_cmnd *SCpnt)
925{ 927{
926#if 0 /* broken junk, but if davem wants to compile this driver, let him.. */ 928#if 0 /* broken junk, but if davem wants to compile this driver, let him.. */
927 unsigned long flags; 929 unsigned long flags;
@@ -931,7 +933,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
931 DECLARE_MUTEX_LOCKED(sem); 933 DECLARE_MUTEX_LOCKED(sem);
932 934
933 if (!fc->rst_pkt) { 935 if (!fc->rst_pkt) {
934 fc->rst_pkt = (Scsi_Cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL); 936 fc->rst_pkt = (struct scsi_cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL);
935 if (!fc->rst_pkt) return FAILED; 937 if (!fc->rst_pkt) return FAILED;
936 938
937 fcmd = FCP_CMND(fc->rst_pkt); 939 fcmd = FCP_CMND(fc->rst_pkt);
@@ -999,7 +1001,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
999 return SUCCESS; 1001 return SUCCESS;
1000} 1002}
1001 1003
1002static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) 1004static int __fcp_scsi_host_reset(struct scsi_cmnd *SCpnt)
1003{ 1005{
1004 fc_channel *fc = FC_SCMND(SCpnt); 1006 fc_channel *fc = FC_SCMND(SCpnt);
1005 fcp_cmnd *fcmd = FCP_CMND(SCpnt); 1007 fcp_cmnd *fcmd = FCP_CMND(SCpnt);
@@ -1020,7 +1022,7 @@ static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1020 else return FAILED; 1022 else return FAILED;
1021} 1023}
1022 1024
1023int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) 1025int fcp_scsi_host_reset(struct scsi_cmnd *SCpnt)
1024{ 1026{
1025 unsigned long flags; 1027 unsigned long flags;
1026 int rc; 1028 int rc;