hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/scsi/BusLogic.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12
23 /*
34
....@@ -5,14 +6,6 @@
56
67 Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>
78
8
- This program is free software; you may redistribute and/or modify it under
9
- the terms of the GNU General Public License Version 2 as published by the
10
- Free Software Foundation.
11
-
12
- This program is distributed in the hope that it will be useful, but
13
- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
14
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
- for complete details.
169
1710 The author respectfully requests that any modifications to this software be
1811 sent directly to him for evaluation and testing.
....@@ -43,6 +36,7 @@
4336 #include <linux/jiffies.h>
4437 #include <linux/dma-mapping.h>
4538 #include <linux/slab.h>
39
+#include <linux/msdos_partition.h>
4640 #include <scsi/scsicam.h>
4741
4842 #include <asm/dma.h>
....@@ -141,7 +135,7 @@
141135 static void blogic_announce_drvr(struct blogic_adapter *adapter)
142136 {
143137 blogic_announce("***** BusLogic SCSI Driver Version " blogic_drvr_version " of " blogic_drvr_date " *****\n", adapter);
144
- blogic_announce("Copyright 1995-1998 by Leonard N. Zubkoff " "<lnz@dandelion.com>\n", adapter);
138
+ blogic_announce("Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>\n", adapter);
145139 }
146140
147141
....@@ -201,8 +195,8 @@
201195 dma_addr_t blkp;
202196
203197 while (adapter->alloc_ccbs < adapter->initccbs) {
204
- blk_pointer = pci_alloc_consistent(adapter->pci_device,
205
- blk_size, &blkp);
198
+ blk_pointer = dma_alloc_coherent(&adapter->pci_device->dev,
199
+ blk_size, &blkp, GFP_KERNEL);
206200 if (blk_pointer == NULL) {
207201 blogic_err("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n",
208202 adapter);
....@@ -227,15 +221,16 @@
227221 next_ccb = ccb->next_all;
228222 if (ccb->allocgrp_head) {
229223 if (lastccb)
230
- pci_free_consistent(adapter->pci_device,
224
+ dma_free_coherent(&adapter->pci_device->dev,
231225 lastccb->allocgrp_size, lastccb,
232226 lastccb->allocgrp_head);
233227 lastccb = ccb;
234228 }
235229 }
236230 if (lastccb)
237
- pci_free_consistent(adapter->pci_device, lastccb->allocgrp_size,
238
- lastccb, lastccb->allocgrp_head);
231
+ dma_free_coherent(&adapter->pci_device->dev,
232
+ lastccb->allocgrp_size, lastccb,
233
+ lastccb->allocgrp_head);
239234 }
240235
241236
....@@ -256,8 +251,8 @@
256251 if (addl_ccbs <= 0)
257252 return;
258253 while (adapter->alloc_ccbs - prev_alloc < addl_ccbs) {
259
- blk_pointer = pci_alloc_consistent(adapter->pci_device,
260
- blk_size, &blkp);
254
+ blk_pointer = dma_alloc_coherent(&adapter->pci_device->dev,
255
+ blk_size, &blkp, GFP_KERNEL);
261256 if (blk_pointer == NULL)
262257 break;
263258 blogic_init_ccbs(adapter, blk_pointer, blk_size, blkp);
....@@ -318,8 +313,8 @@
318313 if (ccb->command != NULL)
319314 scsi_dma_unmap(ccb->command);
320315 if (dma_unmap)
321
- pci_unmap_single(adapter->pci_device, ccb->sensedata,
322
- ccb->sense_datalen, PCI_DMA_FROMDEVICE);
316
+ dma_unmap_single(&adapter->pci_device->dev, ccb->sensedata,
317
+ ccb->sense_datalen, DMA_FROM_DEVICE);
323318
324319 ccb->command = NULL;
325320 ccb->status = BLOGIC_CCB_FREE;
....@@ -446,7 +441,7 @@
446441 goto done;
447442 }
448443 if (blogic_global_options.trace_config)
449
- blogic_notice("blogic_cmd(%02X) Status = %02X: " "(Modify I/O Address)\n", adapter, opcode, statusreg.all);
444
+ blogic_notice("blogic_cmd(%02X) Status = %02X: (Modify I/O Address)\n", adapter, opcode, statusreg.all);
450445 result = 0;
451446 goto done;
452447 }
....@@ -712,7 +707,7 @@
712707 if (pci_enable_device(pci_device))
713708 continue;
714709
715
- if (pci_set_dma_mask(pci_device, DMA_BIT_MASK(32)))
710
+ if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32)))
716711 continue;
717712
718713 bus = pci_device->bus->number;
....@@ -722,23 +717,23 @@
722717 pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
723718
724719 if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
725
- blogic_err("BusLogic: Base Address0 0x%X not I/O for " "MultiMaster Host Adapter\n", NULL, base_addr0);
726
- blogic_err("at PCI Bus %d Device %d I/O Address 0x%X\n", NULL, bus, device, io_addr);
720
+ blogic_err("BusLogic: Base Address0 0x%lX not I/O for MultiMaster Host Adapter\n", NULL, base_addr0);
721
+ blogic_err("at PCI Bus %d Device %d I/O Address 0x%lX\n", NULL, bus, device, io_addr);
727722 continue;
728723 }
729724 if (pci_resource_flags(pci_device, 1) & IORESOURCE_IO) {
730
- blogic_err("BusLogic: Base Address1 0x%X not Memory for " "MultiMaster Host Adapter\n", NULL, base_addr1);
731
- blogic_err("at PCI Bus %d Device %d PCI Address 0x%X\n", NULL, bus, device, pci_addr);
725
+ blogic_err("BusLogic: Base Address1 0x%lX not Memory for MultiMaster Host Adapter\n", NULL, base_addr1);
726
+ blogic_err("at PCI Bus %d Device %d PCI Address 0x%lX\n", NULL, bus, device, pci_addr);
732727 continue;
733728 }
734729 if (irq_ch == 0) {
735
- blogic_err("BusLogic: IRQ Channel %d invalid for " "MultiMaster Host Adapter\n", NULL, irq_ch);
736
- blogic_err("at PCI Bus %d Device %d I/O Address 0x%X\n", NULL, bus, device, io_addr);
730
+ blogic_err("BusLogic: IRQ Channel %d invalid for MultiMaster Host Adapter\n", NULL, irq_ch);
731
+ blogic_err("at PCI Bus %d Device %d I/O Address 0x%lX\n", NULL, bus, device, io_addr);
737732 continue;
738733 }
739734 if (blogic_global_options.trace_probe) {
740
- blogic_notice("BusLogic: PCI MultiMaster Host Adapter " "detected at\n", NULL);
741
- blogic_notice("BusLogic: PCI Bus %d Device %d I/O Address " "0x%X PCI Address 0x%X\n", NULL, bus, device, io_addr, pci_addr);
735
+ blogic_notice("BusLogic: PCI MultiMaster Host Adapter detected at\n", NULL);
736
+ blogic_notice("BusLogic: PCI Bus %d Device %d I/O Address 0x%lX PCI Address 0x%lX\n", NULL, bus, device, io_addr, pci_addr);
742737 }
743738 /*
744739 Issue the Inquire PCI Host Adapter Information command to determine
....@@ -824,7 +819,7 @@
824819 nonpr_mmcount++;
825820 mmcount++;
826821 } else
827
- blogic_warn("BusLogic: Too many Host Adapters " "detected\n", NULL);
822
+ blogic_warn("BusLogic: Too many Host Adapters detected\n", NULL);
828823 }
829824 /*
830825 If the AutoSCSI "Use Bus And Device # For PCI Scanning Seq."
....@@ -895,7 +890,7 @@
895890 if (pci_enable_device(pci_device))
896891 continue;
897892
898
- if (pci_set_dma_mask(pci_device, DMA_BIT_MASK(32)))
893
+ if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32)))
899894 continue;
900895
901896 bus = pci_device->bus->number;
....@@ -952,7 +947,7 @@
952947 if (pci_enable_device(pci_device))
953948 continue;
954949
955
- if (pci_set_dma_mask(pci_device, DMA_BIT_MASK(32)))
950
+ if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32)))
956951 continue;
957952
958953 bus = pci_device->bus->number;
....@@ -962,23 +957,23 @@
962957 pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
963958 #ifdef CONFIG_SCSI_FLASHPOINT
964959 if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
965
- blogic_err("BusLogic: Base Address0 0x%X not I/O for " "FlashPoint Host Adapter\n", NULL, base_addr0);
966
- blogic_err("at PCI Bus %d Device %d I/O Address 0x%X\n", NULL, bus, device, io_addr);
960
+ blogic_err("BusLogic: Base Address0 0x%lX not I/O for FlashPoint Host Adapter\n", NULL, base_addr0);
961
+ blogic_err("at PCI Bus %d Device %d I/O Address 0x%lX\n", NULL, bus, device, io_addr);
967962 continue;
968963 }
969964 if (pci_resource_flags(pci_device, 1) & IORESOURCE_IO) {
970
- blogic_err("BusLogic: Base Address1 0x%X not Memory for " "FlashPoint Host Adapter\n", NULL, base_addr1);
971
- blogic_err("at PCI Bus %d Device %d PCI Address 0x%X\n", NULL, bus, device, pci_addr);
965
+ blogic_err("BusLogic: Base Address1 0x%lX not Memory for FlashPoint Host Adapter\n", NULL, base_addr1);
966
+ blogic_err("at PCI Bus %d Device %d PCI Address 0x%lX\n", NULL, bus, device, pci_addr);
972967 continue;
973968 }
974969 if (irq_ch == 0) {
975
- blogic_err("BusLogic: IRQ Channel %d invalid for " "FlashPoint Host Adapter\n", NULL, irq_ch);
976
- blogic_err("at PCI Bus %d Device %d I/O Address 0x%X\n", NULL, bus, device, io_addr);
970
+ blogic_err("BusLogic: IRQ Channel %d invalid for FlashPoint Host Adapter\n", NULL, irq_ch);
971
+ blogic_err("at PCI Bus %d Device %d I/O Address 0x%lX\n", NULL, bus, device, io_addr);
977972 continue;
978973 }
979974 if (blogic_global_options.trace_probe) {
980
- blogic_notice("BusLogic: FlashPoint Host Adapter " "detected at\n", NULL);
981
- blogic_notice("BusLogic: PCI Bus %d Device %d I/O Address " "0x%X PCI Address 0x%X\n", NULL, bus, device, io_addr, pci_addr);
975
+ blogic_notice("BusLogic: FlashPoint Host Adapter detected at\n", NULL);
976
+ blogic_notice("BusLogic: PCI Bus %d Device %d I/O Address 0x%lX PCI Address 0x%lX\n", NULL, bus, device, io_addr, pci_addr);
982977 }
983978 if (blogic_probeinfo_count < BLOGIC_MAX_ADAPTERS) {
984979 struct blogic_probeinfo *probeinfo =
....@@ -993,11 +988,11 @@
993988 probeinfo->pci_device = pci_dev_get(pci_device);
994989 fpcount++;
995990 } else
996
- blogic_warn("BusLogic: Too many Host Adapters " "detected\n", NULL);
991
+ blogic_warn("BusLogic: Too many Host Adapters detected\n", NULL);
997992 #else
998
- blogic_err("BusLogic: FlashPoint Host Adapter detected at " "PCI Bus %d Device %d\n", NULL, bus, device);
999
- blogic_err("BusLogic: I/O Address 0x%X PCI Address 0x%X, irq %d, " "but FlashPoint\n", NULL, io_addr, pci_addr, irq_ch);
1000
- blogic_err("BusLogic: support was omitted in this kernel " "configuration.\n", NULL);
993
+ blogic_err("BusLogic: FlashPoint Host Adapter detected at PCI Bus %d Device %d\n", NULL, bus, device);
994
+ blogic_err("BusLogic: I/O Address 0x%lX PCI Address 0x%lX, irq %d, but FlashPoint\n", NULL, io_addr, pci_addr, irq_ch);
995
+ blogic_err("BusLogic: support was omitted in this kernel configuration.\n", NULL);
1001996 #endif
1002997 }
1003998 /*
....@@ -1105,9 +1100,9 @@
11051100 if (adapter->adapter_bus_type == BLOGIC_PCI_BUS) {
11061101 blogic_err("While configuring BusLogic PCI Host Adapter at\n",
11071102 adapter);
1108
- blogic_err("Bus %d Device %d I/O Address 0x%X PCI Address 0x%X:\n", adapter, adapter->bus, adapter->dev, adapter->io_addr, adapter->pci_addr);
1103
+ blogic_err("Bus %d Device %d I/O Address 0x%lX PCI Address 0x%lX:\n", adapter, adapter->bus, adapter->dev, adapter->io_addr, adapter->pci_addr);
11091104 } else
1110
- blogic_err("While configuring BusLogic Host Adapter at " "I/O Address 0x%X:\n", adapter, adapter->io_addr);
1105
+ blogic_err("While configuring BusLogic Host Adapter at I/O Address 0x%lX:\n", adapter, adapter->io_addr);
11111106 blogic_err("%s FAILED - DETACHING\n", adapter, msg);
11121107 if (blogic_cmd_failure_reason != NULL)
11131108 blogic_err("ADDITIONAL FAILURE INFO - %s\n", adapter,
....@@ -1135,13 +1130,13 @@
11351130 fpinfo->present = false;
11361131 if (!(FlashPoint_ProbeHostAdapter(fpinfo) == 0 &&
11371132 fpinfo->present)) {
1138
- blogic_err("BusLogic: FlashPoint Host Adapter detected at " "PCI Bus %d Device %d\n", adapter, adapter->bus, adapter->dev);
1139
- blogic_err("BusLogic: I/O Address 0x%X PCI Address 0x%X, " "but FlashPoint\n", adapter, adapter->io_addr, adapter->pci_addr);
1133
+ blogic_err("BusLogic: FlashPoint Host Adapter detected at PCI Bus %d Device %d\n", adapter, adapter->bus, adapter->dev);
1134
+ blogic_err("BusLogic: I/O Address 0x%lX PCI Address 0x%lX, but FlashPoint\n", adapter, adapter->io_addr, adapter->pci_addr);
11401135 blogic_err("BusLogic: Probe Function failed to validate it.\n", adapter);
11411136 return false;
11421137 }
11431138 if (blogic_global_options.trace_probe)
1144
- blogic_notice("BusLogic_Probe(0x%X): FlashPoint Found\n", adapter, adapter->io_addr);
1139
+ blogic_notice("BusLogic_Probe(0x%lX): FlashPoint Found\n", adapter, adapter->io_addr);
11451140 /*
11461141 Indicate the Host Adapter Probe completed successfully.
11471142 */
....@@ -1158,7 +1153,7 @@
11581153 intreg.all = blogic_rdint(adapter);
11591154 georeg.all = blogic_rdgeom(adapter);
11601155 if (blogic_global_options.trace_probe)
1161
- blogic_notice("BusLogic_Probe(0x%X): Status 0x%02X, Interrupt 0x%02X, " "Geometry 0x%02X\n", adapter, adapter->io_addr, statusreg.all, intreg.all, georeg.all);
1156
+ blogic_notice("BusLogic_Probe(0x%lX): Status 0x%02X, Interrupt 0x%02X, Geometry 0x%02X\n", adapter, adapter->io_addr, statusreg.all, intreg.all, georeg.all);
11621157 if (statusreg.all == 0 || statusreg.sr.diag_active ||
11631158 statusreg.sr.cmd_param_busy || statusreg.sr.rsvd ||
11641159 statusreg.sr.cmd_invalid || intreg.ir.rsvd != 0)
....@@ -1237,7 +1232,7 @@
12371232 udelay(100);
12381233 }
12391234 if (blogic_global_options.trace_hw_reset)
1240
- blogic_notice("BusLogic_HardwareReset(0x%X): Diagnostic Active, " "Status 0x%02X\n", adapter, adapter->io_addr, statusreg.all);
1235
+ blogic_notice("BusLogic_HardwareReset(0x%lX): Diagnostic Active, Status 0x%02X\n", adapter, adapter->io_addr, statusreg.all);
12411236 if (timeout < 0)
12421237 return false;
12431238 /*
....@@ -1257,7 +1252,7 @@
12571252 udelay(100);
12581253 }
12591254 if (blogic_global_options.trace_hw_reset)
1260
- blogic_notice("BusLogic_HardwareReset(0x%X): Diagnostic Completed, " "Status 0x%02X\n", adapter, adapter->io_addr, statusreg.all);
1255
+ blogic_notice("BusLogic_HardwareReset(0x%lX): Diagnostic Completed, Status 0x%02X\n", adapter, adapter->io_addr, statusreg.all);
12611256 if (timeout < 0)
12621257 return false;
12631258 /*
....@@ -1273,7 +1268,7 @@
12731268 udelay(100);
12741269 }
12751270 if (blogic_global_options.trace_hw_reset)
1276
- blogic_notice("BusLogic_HardwareReset(0x%X): Host Adapter Ready, " "Status 0x%02X\n", adapter, adapter->io_addr, statusreg.all);
1271
+ blogic_notice("BusLogic_HardwareReset(0x%lX): Host Adapter Ready, Status 0x%02X\n", adapter, adapter->io_addr, statusreg.all);
12771272 if (timeout < 0)
12781273 return false;
12791274 /*
....@@ -1329,7 +1324,7 @@
13291324 Provide tracing information if requested and return.
13301325 */
13311326 if (blogic_global_options.trace_probe)
1332
- blogic_notice("BusLogic_Check(0x%X): MultiMaster %s\n", adapter,
1327
+ blogic_notice("BusLogic_Check(0x%lX): MultiMaster %s\n", adapter,
13331328 adapter->io_addr,
13341329 (result ? "Found" : "Not Found"));
13351330 return result;
....@@ -1842,7 +1837,7 @@
18421837 int tgt_id;
18431838
18441839 blogic_info("Configuring BusLogic Model %s %s%s%s%s SCSI Host Adapter\n", adapter, adapter->model, blogic_adapter_busnames[adapter->adapter_bus_type], (adapter->wide ? " Wide" : ""), (adapter->differential ? " Differential" : ""), (adapter->ultra ? " Ultra" : ""));
1845
- blogic_info(" Firmware Version: %s, I/O Address: 0x%X, " "IRQ Channel: %d/%s\n", adapter, adapter->fw_ver, adapter->io_addr, adapter->irq_ch, (adapter->level_int ? "Level" : "Edge"));
1840
+ blogic_info(" Firmware Version: %s, I/O Address: 0x%lX, IRQ Channel: %d/%s\n", adapter, adapter->fw_ver, adapter->io_addr, adapter->irq_ch, (adapter->level_int ? "Level" : "Edge"));
18461841 if (adapter->adapter_bus_type != BLOGIC_PCI_BUS) {
18471842 blogic_info(" DMA Channel: ", adapter);
18481843 if (adapter->dma_ch > 0)
....@@ -1858,7 +1853,7 @@
18581853 blogic_info(" PCI Bus: %d, Device: %d, Address: ", adapter,
18591854 adapter->bus, adapter->dev);
18601855 if (adapter->pci_addr > 0)
1861
- blogic_info("0x%X, ", adapter, adapter->pci_addr);
1856
+ blogic_info("0x%lX, ", adapter, adapter->pci_addr);
18621857 else
18631858 blogic_info("Unassigned, ", adapter);
18641859 }
....@@ -1938,10 +1933,10 @@
19381933 blogic_info(" Disconnect/Reconnect: %s, Tagged Queuing: %s\n", adapter,
19391934 discon_msg, tagq_msg);
19401935 if (blogic_multimaster_type(adapter)) {
1941
- blogic_info(" Scatter/Gather Limit: %d of %d segments, " "Mailboxes: %d\n", adapter, adapter->drvr_sglimit, adapter->adapter_sglimit, adapter->mbox_count);
1942
- blogic_info(" Driver Queue Depth: %d, " "Host Adapter Queue Depth: %d\n", adapter, adapter->drvr_qdepth, adapter->adapter_qdepth);
1936
+ blogic_info(" Scatter/Gather Limit: %d of %d segments, Mailboxes: %d\n", adapter, adapter->drvr_sglimit, adapter->adapter_sglimit, adapter->mbox_count);
1937
+ blogic_info(" Driver Queue Depth: %d, Host Adapter Queue Depth: %d\n", adapter, adapter->drvr_qdepth, adapter->adapter_qdepth);
19431938 } else
1944
- blogic_info(" Driver Queue Depth: %d, " "Scatter/Gather Limit: %d segments\n", adapter, adapter->drvr_qdepth, adapter->drvr_sglimit);
1939
+ blogic_info(" Driver Queue Depth: %d, Scatter/Gather Limit: %d segments\n", adapter, adapter->drvr_qdepth, adapter->drvr_sglimit);
19451940 blogic_info(" Tagged Queue Depth: ", adapter);
19461941 common_tagq_depth = true;
19471942 for (tgt_id = 1; tgt_id < adapter->maxdev; tgt_id++)
....@@ -2040,7 +2035,7 @@
20402035 Release any allocated memory structs not released elsewhere
20412036 */
20422037 if (adapter->mbox_space)
2043
- pci_free_consistent(adapter->pci_device, adapter->mbox_sz,
2038
+ dma_free_coherent(&adapter->pci_device->dev, adapter->mbox_sz,
20442039 adapter->mbox_space, adapter->mbox_space_handle);
20452040 pci_dev_put(adapter->pci_device);
20462041 adapter->mbox_space = NULL;
....@@ -2092,8 +2087,9 @@
20922087 Initialize the Outgoing and Incoming Mailbox pointers.
20932088 */
20942089 adapter->mbox_sz = adapter->mbox_count * (sizeof(struct blogic_outbox) + sizeof(struct blogic_inbox));
2095
- adapter->mbox_space = pci_alloc_consistent(adapter->pci_device,
2096
- adapter->mbox_sz, &adapter->mbox_space_handle);
2090
+ adapter->mbox_space = dma_alloc_coherent(&adapter->pci_device->dev,
2091
+ adapter->mbox_sz, &adapter->mbox_space_handle,
2092
+ GFP_KERNEL);
20972093 if (adapter->mbox_space == NULL)
20982094 return blogic_failure(adapter, "MAILBOX ALLOCATION");
20992095 adapter->first_outbox = (struct blogic_outbox *) adapter->mbox_space;
....@@ -2241,7 +2237,7 @@
22412237 "INQUIRE INSTALLED DEVICES ID 0 TO 7");
22422238 for (tgt_id = 0; tgt_id < 8; tgt_id++)
22432239 adapter->tgt_flags[tgt_id].tgt_exists =
2244
- (installed_devs0to7[tgt_id] != 0 ? true : false);
2240
+ installed_devs0to7[tgt_id] != 0;
22452241 }
22462242 /*
22472243 Issue the Inquire Setup Information command.
....@@ -2639,6 +2635,7 @@
26392635 case BLOGIC_BAD_CMD_PARAM:
26402636 blogic_warn("BusLogic Driver Protocol Error 0x%02X\n",
26412637 adapter, adapter_status);
2638
+ fallthrough;
26422639 case BLOGIC_DATA_UNDERRUN:
26432640 case BLOGIC_DATA_OVERRUN:
26442641 case BLOGIC_NOEXPECT_BUSFREE:
....@@ -2721,7 +2718,7 @@
27212718 then there is most likely a bug in
27222719 the Host Adapter firmware.
27232720 */
2724
- blogic_warn("Illegal CCB #%ld status %d in " "Incoming Mailbox\n", adapter, ccb->serial, ccb->status);
2721
+ blogic_warn("Illegal CCB #%ld status %d in Incoming Mailbox\n", adapter, ccb->serial, ccb->status);
27252722 }
27262723 }
27272724 next_inbox->comp_code = BLOGIC_INBOX_FREE;
....@@ -2756,7 +2753,7 @@
27562753 if (ccb->opcode == BLOGIC_BDR) {
27572754 int tgt_id = ccb->tgt_id;
27582755
2759
- blogic_warn("Bus Device Reset CCB #%ld to Target " "%d Completed\n", adapter, ccb->serial, tgt_id);
2756
+ blogic_warn("Bus Device Reset CCB #%ld to Target %d Completed\n", adapter, ccb->serial, tgt_id);
27602757 blogic_inc_count(&adapter->tgt_stats[tgt_id].bdr_done);
27612758 adapter->tgt_flags[tgt_id].tagq_active = false;
27622759 adapter->cmds_since_rst[tgt_id] = 0;
....@@ -2833,7 +2830,7 @@
28332830 if (blogic_global_options.trace_err) {
28342831 int i;
28352832 blogic_notice("CCB #%ld Target %d: Result %X Host "
2836
- "Adapter Status %02X " "Target Status %02X\n", adapter, ccb->serial, ccb->tgt_id, command->result, ccb->adapter_status, ccb->tgt_status);
2833
+ "Adapter Status %02X Target Status %02X\n", adapter, ccb->serial, ccb->tgt_id, command->result, ccb->adapter_status, ccb->tgt_status);
28372834 blogic_notice("CDB ", adapter);
28382835 for (i = 0; i < ccb->cdblen; i++)
28392836 blogic_notice(" %02X", adapter, ccb->cdb[i]);
....@@ -3183,9 +3180,9 @@
31833180 memcpy(ccb->cdb, cdb, cdblen);
31843181 ccb->sense_datalen = SCSI_SENSE_BUFFERSIZE;
31853182 ccb->command = command;
3186
- sense_buf = pci_map_single(adapter->pci_device,
3183
+ sense_buf = dma_map_single(&adapter->pci_device->dev,
31873184 command->sense_buffer, ccb->sense_datalen,
3188
- PCI_DMA_FROMDEVICE);
3185
+ DMA_FROM_DEVICE);
31893186 if (dma_mapping_error(&adapter->pci_device->dev, sense_buf)) {
31903187 blogic_err("DMA mapping for sense data buffer failed\n",
31913188 adapter);
....@@ -3207,12 +3204,12 @@
32073204 */
32083205 if (!blogic_write_outbox(adapter, BLOGIC_MBOX_START, ccb)) {
32093206 spin_unlock_irq(adapter->scsi_host->host_lock);
3210
- blogic_warn("Unable to write Outgoing Mailbox - " "Pausing for 1 second\n", adapter);
3207
+ blogic_warn("Unable to write Outgoing Mailbox - Pausing for 1 second\n", adapter);
32113208 blogic_delay(1);
32123209 spin_lock_irq(adapter->scsi_host->host_lock);
32133210 if (!blogic_write_outbox(adapter, BLOGIC_MBOX_START,
32143211 ccb)) {
3215
- blogic_warn("Still unable to write Outgoing Mailbox - " "Host Adapter Dead?\n", adapter);
3212
+ blogic_warn("Still unable to write Outgoing Mailbox - Host Adapter Dead?\n", adapter);
32163213 blogic_dealloc_ccb(ccb, 1);
32173214 command->result = DID_ERROR << 16;
32183215 command->scsi_done(command);
....@@ -3414,9 +3411,10 @@
34143411 a partition table entry whose end_head matches one of the
34153412 standard BusLogic geometry translations (64/32, 128/32, or 255/63).
34163413 */
3417
- if (*(unsigned short *) (buf + 64) == 0xAA55) {
3418
- struct partition *part1_entry = (struct partition *) buf;
3419
- struct partition *part_entry = part1_entry;
3414
+ if (*(unsigned short *) (buf + 64) == MSDOS_LABEL_MAGIC) {
3415
+ struct msdos_partition *part1_entry =
3416
+ (struct msdos_partition *)buf;
3417
+ struct msdos_partition *part_entry = part1_entry;
34203418 int saved_cyl = diskparam->cylinders, part_no;
34213419 unsigned char part_end_head = 0, part_end_sector = 0;
34223420
....@@ -3447,8 +3445,8 @@
34473445 if (diskparam->cylinders != saved_cyl)
34483446 blogic_warn("Adopting Geometry %d/%d from Partition Table\n", adapter, diskparam->heads, diskparam->sectors);
34493447 } else if (part_end_head > 0 || part_end_sector > 0) {
3450
- blogic_warn("Warning: Partition Table appears to " "have Geometry %d/%d which is\n", adapter, part_end_head + 1, part_end_sector);
3451
- blogic_warn("not compatible with current BusLogic " "Host Adapter Geometry %d/%d\n", adapter, diskparam->heads, diskparam->sectors);
3448
+ blogic_warn("Warning: Partition Table appears to have Geometry %d/%d which is\n", adapter, part_end_head + 1, part_end_sector);
3449
+ blogic_warn("not compatible with current BusLogic Host Adapter Geometry %d/%d\n", adapter, diskparam->heads, diskparam->sectors);
34523450 }
34533451 }
34543452 kfree(buf);
....@@ -3656,7 +3654,7 @@
36563654 selected host adapter.
36573655
36583656 The BusLogic Driver Probing Options are described in
3659
- <file:Documentation/scsi/BusLogic.txt>.
3657
+ <file:Documentation/scsi/BusLogic.rst>.
36603658 */
36613659
36623660 static int __init blogic_parseopts(char *options)
....@@ -3693,7 +3691,7 @@
36933691 blogic_probe_options.probe134 = true;
36943692 break;
36953693 default:
3696
- blogic_err("BusLogic: Invalid Driver Options " "(invalid I/O Address 0x%X)\n", NULL, io_addr);
3694
+ blogic_err("BusLogic: Invalid Driver Options (invalid I/O Address 0x%lX)\n", NULL, io_addr);
36973695 return 0;
36983696 }
36993697 } else if (blogic_parse(&options, "NoProbeISA"))
....@@ -3714,7 +3712,7 @@
37143712 for (tgt_id = 0; tgt_id < BLOGIC_MAXDEV; tgt_id++) {
37153713 unsigned short qdepth = simple_strtoul(options, &options, 0);
37163714 if (qdepth > BLOGIC_MAX_TAG_DEPTH) {
3717
- blogic_err("BusLogic: Invalid Driver Options " "(invalid Queue Depth %d)\n", NULL, qdepth);
3715
+ blogic_err("BusLogic: Invalid Driver Options (invalid Queue Depth %d)\n", NULL, qdepth);
37183716 return 0;
37193717 }
37203718 drvr_opts->qdepth[tgt_id] = qdepth;
....@@ -3723,12 +3721,12 @@
37233721 else if (*options == ']')
37243722 break;
37253723 else {
3726
- blogic_err("BusLogic: Invalid Driver Options " "(',' or ']' expected at '%s')\n", NULL, options);
3724
+ blogic_err("BusLogic: Invalid Driver Options (',' or ']' expected at '%s')\n", NULL, options);
37273725 return 0;
37283726 }
37293727 }
37303728 if (*options != ']') {
3731
- blogic_err("BusLogic: Invalid Driver Options " "(']' expected at '%s')\n", NULL, options);
3729
+ blogic_err("BusLogic: Invalid Driver Options (']' expected at '%s')\n", NULL, options);
37323730 return 0;
37333731 } else
37343732 options++;
....@@ -3736,7 +3734,7 @@
37363734 unsigned short qdepth = simple_strtoul(options, &options, 0);
37373735 if (qdepth == 0 ||
37383736 qdepth > BLOGIC_MAX_TAG_DEPTH) {
3739
- blogic_err("BusLogic: Invalid Driver Options " "(invalid Queue Depth %d)\n", NULL, qdepth);
3737
+ blogic_err("BusLogic: Invalid Driver Options (invalid Queue Depth %d)\n", NULL, qdepth);
37403738 return 0;
37413739 }
37423740 drvr_opts->common_qdepth = qdepth;
....@@ -3782,7 +3780,7 @@
37823780 unsigned short bus_settle_time =
37833781 simple_strtoul(options, &options, 0);
37843782 if (bus_settle_time > 5 * 60) {
3785
- blogic_err("BusLogic: Invalid Driver Options " "(invalid Bus Settle Time %d)\n", NULL, bus_settle_time);
3783
+ blogic_err("BusLogic: Invalid Driver Options (invalid Bus Settle Time %d)\n", NULL, bus_settle_time);
37863784 return 0;
37873785 }
37883786 drvr_opts->bus_settle_time = bus_settle_time;
....@@ -3807,14 +3805,14 @@
38073805 if (*options == ',')
38083806 options++;
38093807 else if (*options != ';' && *options != '\0') {
3810
- blogic_err("BusLogic: Unexpected Driver Option '%s' " "ignored\n", NULL, options);
3808
+ blogic_err("BusLogic: Unexpected Driver Option '%s' ignored\n", NULL, options);
38113809 *options = '\0';
38123810 }
38133811 }
38143812 if (!(blogic_drvr_options_count == 0 ||
38153813 blogic_probeinfo_count == 0 ||
38163814 blogic_drvr_options_count == blogic_probeinfo_count)) {
3817
- blogic_err("BusLogic: Invalid Driver Options " "(all or no I/O Addresses must be specified)\n", NULL);
3815
+ blogic_err("BusLogic: Invalid Driver Options (all or no I/O Addresses must be specified)\n", NULL);
38183816 return 0;
38193817 }
38203818 /*
....@@ -3855,7 +3853,6 @@
38553853 #endif
38563854 .unchecked_isa_dma = 1,
38573855 .max_sectors = 128,
3858
- .use_clustering = ENABLE_CLUSTERING,
38593856 };
38603857
38613858 /*
....@@ -3869,7 +3866,7 @@
38693866 (void) get_options(str, ARRAY_SIZE(ints), ints);
38703867
38713868 if (ints[0] != 0) {
3872
- blogic_err("BusLogic: Obsolete Command Line Entry " "Format Ignored\n", NULL);
3869
+ blogic_err("BusLogic: Obsolete Command Line Entry Format Ignored\n", NULL);
38733870 return 0;
38743871 }
38753872 if (str == NULL || *str == '\0')