Skip to content

Commit 391e2f2

Browse files
hikerockiesJames Bottomley
authored andcommitted
[SCSI] BusLogic: Port driver to 64-bit.
[jejb: fix up pointer to int cast warning] Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1 parent 839cb99 commit 391e2f2

4 files changed

Lines changed: 311 additions & 364 deletions

File tree

‎drivers/scsi/BusLogic.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ static bool blogic_hwreset(struct blogic_adapter *adapter, bool hard_reset)
12081208
fpinfo->report_underrun = true;
12091209
adapter->cardhandle =
12101210
FlashPoint_HardwareResetHostAdapter(fpinfo);
1211-
if (adapter->cardhandle == FPOINT_BADCARD_HANDLE)
1211+
if (adapter->cardhandle == (void *)FPOINT_BADCARD_HANDLE)
12121212
return false;
12131213
/*
12141214
Indicate the Host Adapter Hard Reset completed successfully.
@@ -2372,8 +2372,7 @@ static int __init blogic_init(void)
23722372
return -ENOMEM;
23732373
}
23742374

2375-
adapter =
2376-
kzalloc(sizeof(struct blogic_adapter), GFP_KERNEL);
2375+
adapter = kzalloc(sizeof(struct blogic_adapter), GFP_KERNEL);
23772376
if (adapter == NULL) {
23782377
kfree(blogic_probeinfo_list);
23792378
blogic_err("BusLogic: Unable to allocate Prototype Host Adapter\n", NULL);
@@ -3079,11 +3078,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command,
30793078
ccb->opcode = BLOGIC_INITIATOR_CCB_SG;
30803079
ccb->datalen = count * sizeof(struct blogic_sg_seg);
30813080
if (blogic_multimaster_type(adapter))
3082-
ccb->data = (unsigned int) ccb->dma_handle +
3081+
ccb->data = (void *)((unsigned int) ccb->dma_handle +
30833082
((unsigned long) &ccb->sglist -
3084-
(unsigned long) ccb);
3083+
(unsigned long) ccb));
30853084
else
3086-
ccb->data = virt_to_32bit_virt(ccb->sglist);
3085+
ccb->data = ccb->sglist;
30873086

30883087
scsi_for_each_sg(command, sg, count, i) {
30893088
ccb->sglist[i].segbytes = sg_dma_len(sg);

‎drivers/scsi/BusLogic.h‎

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ struct blogic_ccb {
821821
unsigned char cdblen; /* Byte 2 */
822822
unsigned char sense_datalen; /* Byte 3 */
823823
u32 datalen; /* Bytes 4-7 */
824-
u32 data; /* Bytes 8-11 */
824+
void *data; /* Bytes 8-11 */
825825
unsigned char:8; /* Byte 12 */
826826
unsigned char:8; /* Byte 13 */
827827
enum blogic_adapter_status adapter_status; /* Byte 14 */
@@ -833,7 +833,7 @@ struct blogic_ccb {
833833
unsigned char cdb[BLOGIC_CDB_MAXLEN]; /* Bytes 18-29 */
834834
unsigned char:8; /* Byte 30 */
835835
unsigned char:8; /* Byte 31 */
836-
unsigned int:32; /* Bytes 32-35 */
836+
u32 rsvd_int; /* Bytes 32-35 */
837837
u32 sensedata; /* Bytes 36-39 */
838838
/*
839839
FlashPoint SCCB Manager Defined Portion.
@@ -843,8 +843,11 @@ struct blogic_ccb {
843843
enum blogic_cmplt_code comp_code; /* Byte 48 */
844844
#ifdef CONFIG_SCSI_FLASHPOINT
845845
unsigned char:8; /* Byte 49 */
846-
unsigned short os_flags; /* Bytes 50-51 */
847-
unsigned char private[48]; /* Bytes 52-99 */
846+
u16 os_flags; /* Bytes 50-51 */
847+
unsigned char private[24]; /* Bytes 52-99 */
848+
void *rsvd1;
849+
void *rsvd2;
850+
unsigned char private2[16];
848851
#endif
849852
/*
850853
BusLogic Linux Driver Defined Portion.
@@ -867,7 +870,7 @@ struct blogic_ccb {
867870

868871
struct blogic_outbox {
869872
u32 ccb; /* Bytes 0-3 */
870-
unsigned int:24; /* Bytes 4-6 */
873+
u32:24; /* Bytes 4-6 */
871874
enum blogic_action action; /* Byte 7 */
872875
};
873876

@@ -876,11 +879,11 @@ struct blogic_outbox {
876879
*/
877880

878881
struct blogic_inbox {
879-
u32 ccb; /* Bytes 0-3 */
882+
u32 ccb; /* Bytes 0-3 */
880883
enum blogic_adapter_status adapter_status; /* Byte 4 */
881-
enum blogic_tgt_status tgt_status; /* Byte 5 */
882-
unsigned char:8; /* Byte 6 */
883-
enum blogic_cmplt_code comp_code; /* Byte 7 */
884+
enum blogic_tgt_status tgt_status; /* Byte 5 */
885+
unsigned char:8; /* Byte 6 */
886+
enum blogic_cmplt_code comp_code; /* Byte 7 */
884887
};
885888

886889

@@ -941,7 +944,7 @@ struct blogic_tgt_stats {
941944
Define the FlashPoint Card Handle data type.
942945
*/
943946

944-
#define FPOINT_BADCARD_HANDLE 0xFFFFFFFF
947+
#define FPOINT_BADCARD_HANDLE 0xFFFFFFFFL
945948

946949

947950
/*
@@ -955,12 +958,12 @@ struct fpoint_info {
955958
unsigned char irq_ch; /* Byte 5 */
956959
unsigned char scsi_id; /* Byte 6 */
957960
unsigned char scsi_lun; /* Byte 7 */
958-
unsigned short fw_rev; /* Bytes 8-9 */
959-
unsigned short sync_ok; /* Bytes 10-11 */
960-
unsigned short fast_ok; /* Bytes 12-13 */
961-
unsigned short ultra_ok; /* Bytes 14-15 */
962-
unsigned short discon_ok; /* Bytes 16-17 */
963-
unsigned short wide_ok; /* Bytes 18-19 */
961+
u16 fw_rev; /* Bytes 8-9 */
962+
u16 sync_ok; /* Bytes 10-11 */
963+
u16 fast_ok; /* Bytes 12-13 */
964+
u16 ultra_ok; /* Bytes 14-15 */
965+
u16 discon_ok; /* Bytes 16-17 */
966+
u16 wide_ok; /* Bytes 18-19 */
964967
bool parity:1; /* Byte 20 Bit 0 */
965968
bool wide:1; /* Byte 20 Bit 1 */
966969
bool softreset:1; /* Byte 20 Bit 2 */
@@ -976,10 +979,10 @@ struct fpoint_info {
976979
unsigned char model[3]; /* Bytes 24-26 */
977980
unsigned char relative_cardnum; /* Byte 27 */
978981
unsigned char rsvd[4]; /* Bytes 28-31 */
979-
unsigned int os_rsvd; /* Bytes 32-35 */
982+
u32 os_rsvd; /* Bytes 32-35 */
980983
unsigned char translation_info[4]; /* Bytes 36-39 */
981-
unsigned int rsvd2[5]; /* Bytes 40-59 */
982-
unsigned int sec_range; /* Bytes 60-63 */
984+
u32 rsvd2[5]; /* Bytes 40-59 */
985+
u32 sec_range; /* Bytes 60-63 */
983986
};
984987

985988
/*
@@ -1052,7 +1055,7 @@ struct blogic_adapter {
10521055
u32 bios_addr;
10531056
struct blogic_drvr_options *drvr_opts;
10541057
struct fpoint_info fpinfo;
1055-
unsigned int cardhandle;
1058+
void *cardhandle;
10561059
struct list_head host_list;
10571060
struct blogic_ccb *all_ccbs;
10581061
struct blogic_ccb *free_ccbs;

0 commit comments

Comments
 (0)