| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | |
|---|
| 2 | 3 | /* |
|---|
| 3 | 4 | |
|---|
| .. | .. |
|---|
| 5 | 6 | |
|---|
| 6 | 7 | Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com> |
|---|
| 7 | 8 | |
|---|
| 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. |
|---|
| 16 | 9 | |
|---|
| 17 | 10 | The author respectfully requests that any modifications to this software be |
|---|
| 18 | 11 | sent directly to him for evaluation and testing. |
|---|
| .. | .. |
|---|
| 43 | 36 | #include <linux/jiffies.h> |
|---|
| 44 | 37 | #include <linux/dma-mapping.h> |
|---|
| 45 | 38 | #include <linux/slab.h> |
|---|
| 39 | +#include <linux/msdos_partition.h> |
|---|
| 46 | 40 | #include <scsi/scsicam.h> |
|---|
| 47 | 41 | |
|---|
| 48 | 42 | #include <asm/dma.h> |
|---|
| .. | .. |
|---|
| 141 | 135 | static void blogic_announce_drvr(struct blogic_adapter *adapter) |
|---|
| 142 | 136 | { |
|---|
| 143 | 137 | 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); |
|---|
| 145 | 139 | } |
|---|
| 146 | 140 | |
|---|
| 147 | 141 | |
|---|
| .. | .. |
|---|
| 201 | 195 | dma_addr_t blkp; |
|---|
| 202 | 196 | |
|---|
| 203 | 197 | 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); |
|---|
| 206 | 200 | if (blk_pointer == NULL) { |
|---|
| 207 | 201 | blogic_err("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n", |
|---|
| 208 | 202 | adapter); |
|---|
| .. | .. |
|---|
| 227 | 221 | next_ccb = ccb->next_all; |
|---|
| 228 | 222 | if (ccb->allocgrp_head) { |
|---|
| 229 | 223 | if (lastccb) |
|---|
| 230 | | - pci_free_consistent(adapter->pci_device, |
|---|
| 224 | + dma_free_coherent(&adapter->pci_device->dev, |
|---|
| 231 | 225 | lastccb->allocgrp_size, lastccb, |
|---|
| 232 | 226 | lastccb->allocgrp_head); |
|---|
| 233 | 227 | lastccb = ccb; |
|---|
| 234 | 228 | } |
|---|
| 235 | 229 | } |
|---|
| 236 | 230 | 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); |
|---|
| 239 | 234 | } |
|---|
| 240 | 235 | |
|---|
| 241 | 236 | |
|---|
| .. | .. |
|---|
| 256 | 251 | if (addl_ccbs <= 0) |
|---|
| 257 | 252 | return; |
|---|
| 258 | 253 | 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); |
|---|
| 261 | 256 | if (blk_pointer == NULL) |
|---|
| 262 | 257 | break; |
|---|
| 263 | 258 | blogic_init_ccbs(adapter, blk_pointer, blk_size, blkp); |
|---|
| .. | .. |
|---|
| 318 | 313 | if (ccb->command != NULL) |
|---|
| 319 | 314 | scsi_dma_unmap(ccb->command); |
|---|
| 320 | 315 | 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); |
|---|
| 323 | 318 | |
|---|
| 324 | 319 | ccb->command = NULL; |
|---|
| 325 | 320 | ccb->status = BLOGIC_CCB_FREE; |
|---|
| .. | .. |
|---|
| 446 | 441 | goto done; |
|---|
| 447 | 442 | } |
|---|
| 448 | 443 | 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); |
|---|
| 450 | 445 | result = 0; |
|---|
| 451 | 446 | goto done; |
|---|
| 452 | 447 | } |
|---|
| .. | .. |
|---|
| 712 | 707 | if (pci_enable_device(pci_device)) |
|---|
| 713 | 708 | continue; |
|---|
| 714 | 709 | |
|---|
| 715 | | - if (pci_set_dma_mask(pci_device, DMA_BIT_MASK(32))) |
|---|
| 710 | + if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32))) |
|---|
| 716 | 711 | continue; |
|---|
| 717 | 712 | |
|---|
| 718 | 713 | bus = pci_device->bus->number; |
|---|
| .. | .. |
|---|
| 722 | 717 | pci_addr = base_addr1 = pci_resource_start(pci_device, 1); |
|---|
| 723 | 718 | |
|---|
| 724 | 719 | 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); |
|---|
| 727 | 722 | continue; |
|---|
| 728 | 723 | } |
|---|
| 729 | 724 | 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); |
|---|
| 732 | 727 | continue; |
|---|
| 733 | 728 | } |
|---|
| 734 | 729 | 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); |
|---|
| 737 | 732 | continue; |
|---|
| 738 | 733 | } |
|---|
| 739 | 734 | 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); |
|---|
| 742 | 737 | } |
|---|
| 743 | 738 | /* |
|---|
| 744 | 739 | Issue the Inquire PCI Host Adapter Information command to determine |
|---|
| .. | .. |
|---|
| 824 | 819 | nonpr_mmcount++; |
|---|
| 825 | 820 | mmcount++; |
|---|
| 826 | 821 | } else |
|---|
| 827 | | - blogic_warn("BusLogic: Too many Host Adapters " "detected\n", NULL); |
|---|
| 822 | + blogic_warn("BusLogic: Too many Host Adapters detected\n", NULL); |
|---|
| 828 | 823 | } |
|---|
| 829 | 824 | /* |
|---|
| 830 | 825 | If the AutoSCSI "Use Bus And Device # For PCI Scanning Seq." |
|---|
| .. | .. |
|---|
| 895 | 890 | if (pci_enable_device(pci_device)) |
|---|
| 896 | 891 | continue; |
|---|
| 897 | 892 | |
|---|
| 898 | | - if (pci_set_dma_mask(pci_device, DMA_BIT_MASK(32))) |
|---|
| 893 | + if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32))) |
|---|
| 899 | 894 | continue; |
|---|
| 900 | 895 | |
|---|
| 901 | 896 | bus = pci_device->bus->number; |
|---|
| .. | .. |
|---|
| 952 | 947 | if (pci_enable_device(pci_device)) |
|---|
| 953 | 948 | continue; |
|---|
| 954 | 949 | |
|---|
| 955 | | - if (pci_set_dma_mask(pci_device, DMA_BIT_MASK(32))) |
|---|
| 950 | + if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32))) |
|---|
| 956 | 951 | continue; |
|---|
| 957 | 952 | |
|---|
| 958 | 953 | bus = pci_device->bus->number; |
|---|
| .. | .. |
|---|
| 962 | 957 | pci_addr = base_addr1 = pci_resource_start(pci_device, 1); |
|---|
| 963 | 958 | #ifdef CONFIG_SCSI_FLASHPOINT |
|---|
| 964 | 959 | 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); |
|---|
| 967 | 962 | continue; |
|---|
| 968 | 963 | } |
|---|
| 969 | 964 | 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); |
|---|
| 972 | 967 | continue; |
|---|
| 973 | 968 | } |
|---|
| 974 | 969 | 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); |
|---|
| 977 | 972 | continue; |
|---|
| 978 | 973 | } |
|---|
| 979 | 974 | 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); |
|---|
| 982 | 977 | } |
|---|
| 983 | 978 | if (blogic_probeinfo_count < BLOGIC_MAX_ADAPTERS) { |
|---|
| 984 | 979 | struct blogic_probeinfo *probeinfo = |
|---|
| .. | .. |
|---|
| 993 | 988 | probeinfo->pci_device = pci_dev_get(pci_device); |
|---|
| 994 | 989 | fpcount++; |
|---|
| 995 | 990 | } else |
|---|
| 996 | | - blogic_warn("BusLogic: Too many Host Adapters " "detected\n", NULL); |
|---|
| 991 | + blogic_warn("BusLogic: Too many Host Adapters detected\n", NULL); |
|---|
| 997 | 992 | #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); |
|---|
| 1001 | 996 | #endif |
|---|
| 1002 | 997 | } |
|---|
| 1003 | 998 | /* |
|---|
| .. | .. |
|---|
| 1105 | 1100 | if (adapter->adapter_bus_type == BLOGIC_PCI_BUS) { |
|---|
| 1106 | 1101 | blogic_err("While configuring BusLogic PCI Host Adapter at\n", |
|---|
| 1107 | 1102 | 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); |
|---|
| 1109 | 1104 | } 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); |
|---|
| 1111 | 1106 | blogic_err("%s FAILED - DETACHING\n", adapter, msg); |
|---|
| 1112 | 1107 | if (blogic_cmd_failure_reason != NULL) |
|---|
| 1113 | 1108 | blogic_err("ADDITIONAL FAILURE INFO - %s\n", adapter, |
|---|
| .. | .. |
|---|
| 1135 | 1130 | fpinfo->present = false; |
|---|
| 1136 | 1131 | if (!(FlashPoint_ProbeHostAdapter(fpinfo) == 0 && |
|---|
| 1137 | 1132 | 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); |
|---|
| 1140 | 1135 | blogic_err("BusLogic: Probe Function failed to validate it.\n", adapter); |
|---|
| 1141 | 1136 | return false; |
|---|
| 1142 | 1137 | } |
|---|
| 1143 | 1138 | 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); |
|---|
| 1145 | 1140 | /* |
|---|
| 1146 | 1141 | Indicate the Host Adapter Probe completed successfully. |
|---|
| 1147 | 1142 | */ |
|---|
| .. | .. |
|---|
| 1158 | 1153 | intreg.all = blogic_rdint(adapter); |
|---|
| 1159 | 1154 | georeg.all = blogic_rdgeom(adapter); |
|---|
| 1160 | 1155 | 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); |
|---|
| 1162 | 1157 | if (statusreg.all == 0 || statusreg.sr.diag_active || |
|---|
| 1163 | 1158 | statusreg.sr.cmd_param_busy || statusreg.sr.rsvd || |
|---|
| 1164 | 1159 | statusreg.sr.cmd_invalid || intreg.ir.rsvd != 0) |
|---|
| .. | .. |
|---|
| 1237 | 1232 | udelay(100); |
|---|
| 1238 | 1233 | } |
|---|
| 1239 | 1234 | 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); |
|---|
| 1241 | 1236 | if (timeout < 0) |
|---|
| 1242 | 1237 | return false; |
|---|
| 1243 | 1238 | /* |
|---|
| .. | .. |
|---|
| 1257 | 1252 | udelay(100); |
|---|
| 1258 | 1253 | } |
|---|
| 1259 | 1254 | 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); |
|---|
| 1261 | 1256 | if (timeout < 0) |
|---|
| 1262 | 1257 | return false; |
|---|
| 1263 | 1258 | /* |
|---|
| .. | .. |
|---|
| 1273 | 1268 | udelay(100); |
|---|
| 1274 | 1269 | } |
|---|
| 1275 | 1270 | 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); |
|---|
| 1277 | 1272 | if (timeout < 0) |
|---|
| 1278 | 1273 | return false; |
|---|
| 1279 | 1274 | /* |
|---|
| .. | .. |
|---|
| 1329 | 1324 | Provide tracing information if requested and return. |
|---|
| 1330 | 1325 | */ |
|---|
| 1331 | 1326 | 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, |
|---|
| 1333 | 1328 | adapter->io_addr, |
|---|
| 1334 | 1329 | (result ? "Found" : "Not Found")); |
|---|
| 1335 | 1330 | return result; |
|---|
| .. | .. |
|---|
| 1842 | 1837 | int tgt_id; |
|---|
| 1843 | 1838 | |
|---|
| 1844 | 1839 | 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")); |
|---|
| 1846 | 1841 | if (adapter->adapter_bus_type != BLOGIC_PCI_BUS) { |
|---|
| 1847 | 1842 | blogic_info(" DMA Channel: ", adapter); |
|---|
| 1848 | 1843 | if (adapter->dma_ch > 0) |
|---|
| .. | .. |
|---|
| 1858 | 1853 | blogic_info(" PCI Bus: %d, Device: %d, Address: ", adapter, |
|---|
| 1859 | 1854 | adapter->bus, adapter->dev); |
|---|
| 1860 | 1855 | if (adapter->pci_addr > 0) |
|---|
| 1861 | | - blogic_info("0x%X, ", adapter, adapter->pci_addr); |
|---|
| 1856 | + blogic_info("0x%lX, ", adapter, adapter->pci_addr); |
|---|
| 1862 | 1857 | else |
|---|
| 1863 | 1858 | blogic_info("Unassigned, ", adapter); |
|---|
| 1864 | 1859 | } |
|---|
| .. | .. |
|---|
| 1938 | 1933 | blogic_info(" Disconnect/Reconnect: %s, Tagged Queuing: %s\n", adapter, |
|---|
| 1939 | 1934 | discon_msg, tagq_msg); |
|---|
| 1940 | 1935 | 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); |
|---|
| 1943 | 1938 | } 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); |
|---|
| 1945 | 1940 | blogic_info(" Tagged Queue Depth: ", adapter); |
|---|
| 1946 | 1941 | common_tagq_depth = true; |
|---|
| 1947 | 1942 | for (tgt_id = 1; tgt_id < adapter->maxdev; tgt_id++) |
|---|
| .. | .. |
|---|
| 2040 | 2035 | Release any allocated memory structs not released elsewhere |
|---|
| 2041 | 2036 | */ |
|---|
| 2042 | 2037 | 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, |
|---|
| 2044 | 2039 | adapter->mbox_space, adapter->mbox_space_handle); |
|---|
| 2045 | 2040 | pci_dev_put(adapter->pci_device); |
|---|
| 2046 | 2041 | adapter->mbox_space = NULL; |
|---|
| .. | .. |
|---|
| 2092 | 2087 | Initialize the Outgoing and Incoming Mailbox pointers. |
|---|
| 2093 | 2088 | */ |
|---|
| 2094 | 2089 | 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); |
|---|
| 2097 | 2093 | if (adapter->mbox_space == NULL) |
|---|
| 2098 | 2094 | return blogic_failure(adapter, "MAILBOX ALLOCATION"); |
|---|
| 2099 | 2095 | adapter->first_outbox = (struct blogic_outbox *) adapter->mbox_space; |
|---|
| .. | .. |
|---|
| 2241 | 2237 | "INQUIRE INSTALLED DEVICES ID 0 TO 7"); |
|---|
| 2242 | 2238 | for (tgt_id = 0; tgt_id < 8; tgt_id++) |
|---|
| 2243 | 2239 | adapter->tgt_flags[tgt_id].tgt_exists = |
|---|
| 2244 | | - (installed_devs0to7[tgt_id] != 0 ? true : false); |
|---|
| 2240 | + installed_devs0to7[tgt_id] != 0; |
|---|
| 2245 | 2241 | } |
|---|
| 2246 | 2242 | /* |
|---|
| 2247 | 2243 | Issue the Inquire Setup Information command. |
|---|
| .. | .. |
|---|
| 2639 | 2635 | case BLOGIC_BAD_CMD_PARAM: |
|---|
| 2640 | 2636 | blogic_warn("BusLogic Driver Protocol Error 0x%02X\n", |
|---|
| 2641 | 2637 | adapter, adapter_status); |
|---|
| 2638 | + fallthrough; |
|---|
| 2642 | 2639 | case BLOGIC_DATA_UNDERRUN: |
|---|
| 2643 | 2640 | case BLOGIC_DATA_OVERRUN: |
|---|
| 2644 | 2641 | case BLOGIC_NOEXPECT_BUSFREE: |
|---|
| .. | .. |
|---|
| 2721 | 2718 | then there is most likely a bug in |
|---|
| 2722 | 2719 | the Host Adapter firmware. |
|---|
| 2723 | 2720 | */ |
|---|
| 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); |
|---|
| 2725 | 2722 | } |
|---|
| 2726 | 2723 | } |
|---|
| 2727 | 2724 | next_inbox->comp_code = BLOGIC_INBOX_FREE; |
|---|
| .. | .. |
|---|
| 2756 | 2753 | if (ccb->opcode == BLOGIC_BDR) { |
|---|
| 2757 | 2754 | int tgt_id = ccb->tgt_id; |
|---|
| 2758 | 2755 | |
|---|
| 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); |
|---|
| 2760 | 2757 | blogic_inc_count(&adapter->tgt_stats[tgt_id].bdr_done); |
|---|
| 2761 | 2758 | adapter->tgt_flags[tgt_id].tagq_active = false; |
|---|
| 2762 | 2759 | adapter->cmds_since_rst[tgt_id] = 0; |
|---|
| .. | .. |
|---|
| 2833 | 2830 | if (blogic_global_options.trace_err) { |
|---|
| 2834 | 2831 | int i; |
|---|
| 2835 | 2832 | 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); |
|---|
| 2837 | 2834 | blogic_notice("CDB ", adapter); |
|---|
| 2838 | 2835 | for (i = 0; i < ccb->cdblen; i++) |
|---|
| 2839 | 2836 | blogic_notice(" %02X", adapter, ccb->cdb[i]); |
|---|
| .. | .. |
|---|
| 3183 | 3180 | memcpy(ccb->cdb, cdb, cdblen); |
|---|
| 3184 | 3181 | ccb->sense_datalen = SCSI_SENSE_BUFFERSIZE; |
|---|
| 3185 | 3182 | ccb->command = command; |
|---|
| 3186 | | - sense_buf = pci_map_single(adapter->pci_device, |
|---|
| 3183 | + sense_buf = dma_map_single(&adapter->pci_device->dev, |
|---|
| 3187 | 3184 | command->sense_buffer, ccb->sense_datalen, |
|---|
| 3188 | | - PCI_DMA_FROMDEVICE); |
|---|
| 3185 | + DMA_FROM_DEVICE); |
|---|
| 3189 | 3186 | if (dma_mapping_error(&adapter->pci_device->dev, sense_buf)) { |
|---|
| 3190 | 3187 | blogic_err("DMA mapping for sense data buffer failed\n", |
|---|
| 3191 | 3188 | adapter); |
|---|
| .. | .. |
|---|
| 3207 | 3204 | */ |
|---|
| 3208 | 3205 | if (!blogic_write_outbox(adapter, BLOGIC_MBOX_START, ccb)) { |
|---|
| 3209 | 3206 | 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); |
|---|
| 3211 | 3208 | blogic_delay(1); |
|---|
| 3212 | 3209 | spin_lock_irq(adapter->scsi_host->host_lock); |
|---|
| 3213 | 3210 | if (!blogic_write_outbox(adapter, BLOGIC_MBOX_START, |
|---|
| 3214 | 3211 | 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); |
|---|
| 3216 | 3213 | blogic_dealloc_ccb(ccb, 1); |
|---|
| 3217 | 3214 | command->result = DID_ERROR << 16; |
|---|
| 3218 | 3215 | command->scsi_done(command); |
|---|
| .. | .. |
|---|
| 3414 | 3411 | a partition table entry whose end_head matches one of the |
|---|
| 3415 | 3412 | standard BusLogic geometry translations (64/32, 128/32, or 255/63). |
|---|
| 3416 | 3413 | */ |
|---|
| 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; |
|---|
| 3420 | 3418 | int saved_cyl = diskparam->cylinders, part_no; |
|---|
| 3421 | 3419 | unsigned char part_end_head = 0, part_end_sector = 0; |
|---|
| 3422 | 3420 | |
|---|
| .. | .. |
|---|
| 3447 | 3445 | if (diskparam->cylinders != saved_cyl) |
|---|
| 3448 | 3446 | blogic_warn("Adopting Geometry %d/%d from Partition Table\n", adapter, diskparam->heads, diskparam->sectors); |
|---|
| 3449 | 3447 | } 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); |
|---|
| 3452 | 3450 | } |
|---|
| 3453 | 3451 | } |
|---|
| 3454 | 3452 | kfree(buf); |
|---|
| .. | .. |
|---|
| 3656 | 3654 | selected host adapter. |
|---|
| 3657 | 3655 | |
|---|
| 3658 | 3656 | The BusLogic Driver Probing Options are described in |
|---|
| 3659 | | - <file:Documentation/scsi/BusLogic.txt>. |
|---|
| 3657 | + <file:Documentation/scsi/BusLogic.rst>. |
|---|
| 3660 | 3658 | */ |
|---|
| 3661 | 3659 | |
|---|
| 3662 | 3660 | static int __init blogic_parseopts(char *options) |
|---|
| .. | .. |
|---|
| 3693 | 3691 | blogic_probe_options.probe134 = true; |
|---|
| 3694 | 3692 | break; |
|---|
| 3695 | 3693 | 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); |
|---|
| 3697 | 3695 | return 0; |
|---|
| 3698 | 3696 | } |
|---|
| 3699 | 3697 | } else if (blogic_parse(&options, "NoProbeISA")) |
|---|
| .. | .. |
|---|
| 3714 | 3712 | for (tgt_id = 0; tgt_id < BLOGIC_MAXDEV; tgt_id++) { |
|---|
| 3715 | 3713 | unsigned short qdepth = simple_strtoul(options, &options, 0); |
|---|
| 3716 | 3714 | 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); |
|---|
| 3718 | 3716 | return 0; |
|---|
| 3719 | 3717 | } |
|---|
| 3720 | 3718 | drvr_opts->qdepth[tgt_id] = qdepth; |
|---|
| .. | .. |
|---|
| 3723 | 3721 | else if (*options == ']') |
|---|
| 3724 | 3722 | break; |
|---|
| 3725 | 3723 | 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); |
|---|
| 3727 | 3725 | return 0; |
|---|
| 3728 | 3726 | } |
|---|
| 3729 | 3727 | } |
|---|
| 3730 | 3728 | 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); |
|---|
| 3732 | 3730 | return 0; |
|---|
| 3733 | 3731 | } else |
|---|
| 3734 | 3732 | options++; |
|---|
| .. | .. |
|---|
| 3736 | 3734 | unsigned short qdepth = simple_strtoul(options, &options, 0); |
|---|
| 3737 | 3735 | if (qdepth == 0 || |
|---|
| 3738 | 3736 | 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); |
|---|
| 3740 | 3738 | return 0; |
|---|
| 3741 | 3739 | } |
|---|
| 3742 | 3740 | drvr_opts->common_qdepth = qdepth; |
|---|
| .. | .. |
|---|
| 3782 | 3780 | unsigned short bus_settle_time = |
|---|
| 3783 | 3781 | simple_strtoul(options, &options, 0); |
|---|
| 3784 | 3782 | 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); |
|---|
| 3786 | 3784 | return 0; |
|---|
| 3787 | 3785 | } |
|---|
| 3788 | 3786 | drvr_opts->bus_settle_time = bus_settle_time; |
|---|
| .. | .. |
|---|
| 3807 | 3805 | if (*options == ',') |
|---|
| 3808 | 3806 | options++; |
|---|
| 3809 | 3807 | 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); |
|---|
| 3811 | 3809 | *options = '\0'; |
|---|
| 3812 | 3810 | } |
|---|
| 3813 | 3811 | } |
|---|
| 3814 | 3812 | if (!(blogic_drvr_options_count == 0 || |
|---|
| 3815 | 3813 | blogic_probeinfo_count == 0 || |
|---|
| 3816 | 3814 | 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); |
|---|
| 3818 | 3816 | return 0; |
|---|
| 3819 | 3817 | } |
|---|
| 3820 | 3818 | /* |
|---|
| .. | .. |
|---|
| 3855 | 3853 | #endif |
|---|
| 3856 | 3854 | .unchecked_isa_dma = 1, |
|---|
| 3857 | 3855 | .max_sectors = 128, |
|---|
| 3858 | | - .use_clustering = ENABLE_CLUSTERING, |
|---|
| 3859 | 3856 | }; |
|---|
| 3860 | 3857 | |
|---|
| 3861 | 3858 | /* |
|---|
| .. | .. |
|---|
| 3869 | 3866 | (void) get_options(str, ARRAY_SIZE(ints), ints); |
|---|
| 3870 | 3867 | |
|---|
| 3871 | 3868 | 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); |
|---|
| 3873 | 3870 | return 0; |
|---|
| 3874 | 3871 | } |
|---|
| 3875 | 3872 | if (str == NULL || *str == '\0') |
|---|