aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/fc4/fc.c28
-rw-r--r--drivers/fc4/fcp_impl.h15
2 files changed, 23 insertions, 20 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;
diff --git a/drivers/fc4/fcp_impl.h b/drivers/fc4/fcp_impl.h
index c397c84bef63..1ac61330592e 100644
--- a/drivers/fc4/fcp_impl.h
+++ b/drivers/fc4/fcp_impl.h
@@ -39,7 +39,7 @@ struct _fc_channel;
39typedef struct fcp_cmnd { 39typedef struct fcp_cmnd {
40 struct fcp_cmnd *next; 40 struct fcp_cmnd *next;
41 struct fcp_cmnd *prev; 41 struct fcp_cmnd *prev;
42 void (*done)(Scsi_Cmnd *); 42 void (*done)(struct scsi_cmnd *);
43 unsigned short proto; 43 unsigned short proto;
44 unsigned short token; 44 unsigned short token;
45 unsigned int did; 45 unsigned int did;
@@ -94,14 +94,14 @@ typedef struct _fc_channel {
94 long *scsi_bitmap; 94 long *scsi_bitmap;
95 long scsi_bitmap_end; 95 long scsi_bitmap_end;
96 int scsi_free; 96 int scsi_free;
97 int (*encode_addr)(Scsi_Cmnd *, u16 *, struct _fc_channel *, fcp_cmnd *); 97 int (*encode_addr)(struct scsi_cmnd *, u16 *, struct _fc_channel *, fcp_cmnd *);
98 fcp_cmnd *scsi_que; 98 fcp_cmnd *scsi_que;
99 char scsi_name[4]; 99 char scsi_name[4];
100 fcp_cmnd **cmd_slots; 100 fcp_cmnd **cmd_slots;
101 int channels; 101 int channels;
102 int targets; 102 int targets;
103 long *ages; 103 long *ages;
104 Scsi_Cmnd *rst_pkt; 104 struct scsi_cmnd *rst_pkt;
105 fcp_posmap *posmap; 105 fcp_posmap *posmap;
106 /* LOGIN stuff */ 106 /* LOGIN stuff */
107 fcp_cmnd *login; 107 fcp_cmnd *login;
@@ -155,9 +155,10 @@ int fc_do_prli(fc_channel *, unsigned char);
155 for_each_fc_channel(fc) \ 155 for_each_fc_channel(fc) \
156 if (fc->state == FC_STATE_ONLINE) 156 if (fc->state == FC_STATE_ONLINE)
157 157
158int fcp_scsi_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *)); 158int fcp_scsi_queuecommand(struct scsi_cmnd *,
159int fcp_scsi_abort(Scsi_Cmnd *); 159 void (* done) (struct scsi_cmnd *));
160int fcp_scsi_dev_reset(Scsi_Cmnd *); 160int fcp_scsi_abort(struct scsi_cmnd *);
161int fcp_scsi_host_reset(Scsi_Cmnd *); 161int fcp_scsi_dev_reset(struct scsi_cmnd *);
162int fcp_scsi_host_reset(struct scsi_cmnd *);
162 163
163#endif /* !(_FCP_SCSI_H) */ 164#endif /* !(_FCP_SCSI_H) */