Linux Driver for BusLogic MultiMaster and FlashPoint SCSI Host Adapters
Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>
The author respectfully requests that any modifications to this software be sent directly to him for evaluation and testing.
Special thanks to Wayne Yen, Jin-Lon Hon, and Alex Win of BusLogic, whose advice has been invaluable, to David Gentzel, for writing the original Linux BusLogic driver, and to Paul Gortmaker, for being such a dedicated test site.
Finally, special thanks to Mylex/BusLogic for making the FlashPoint SCCB Manager available as freely redistributable source code.
*/
# The sent directly to him #define blogic_drvr_date " advice has been invaluable, to David Gentzel, BusLogic driver, and to Paul Gortmaker, for being such a dedicated test sitejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/types.h> #include <linux/includec #include <linux/delay # linux.h> #include#FAILURE1
/.h #include <linux/pci.h>
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #include <linux/dma-mapping.h> BusLogic Driver Options Line or via thejava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0 #include <linux all BusLogic #include</msdos_partition #include <scsi ();
# blogic_probeinfo_count is the number #include <
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 #include interrogating the list of
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #include *
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #include Name, Copyright Notice, and # "FlashPoint.c"
/* blogic_drvr_options_count is a count of the number of BusLogic Driver Options specifications provided via the Linux Kernel Command Line or via the Loadable Kernel Module Installation Facility.
*/
staticint blogic_drvr_options_count;
/* blogic_drvr_options is an array of Driver Options structures representing BusLogic Driver Options specifications provided via the Linux Kernel Command Line or via the Loadable Kernel Module Installation Facility.
*/
/* BusLogic can be assigned a string by insmod.
*/
MODULE_DESCRIPTION("BusLogic MultiMaster and FlashPoint SCSI Host Adapter driver");
MODULE_LICENSE"");
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 staticchar *BusLogic created CCBs are java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
module_param(BusLogic, charp blk_sizedma_addr_tblkp #endif
/* blogic_probe_options is a set of Probe Options to be applied across all BusLogic Host Adapters.
*/
/* blogic_probeinfo_count is the number of entries in blogic_probeinfo_list.
*/
staticint blogic_probeinfo_count;
/* blogic_probeinfo_list is the list of I/O Addresses and Bus Probe Information to be checked for potential BusLogic Host Adapters. It is initialized by interrogating the PCI Configuration Space on PCI machines as well as from the list of standard BusLogic I/O Addresses.
*/
/* blogic_cmd_failure_reason holds a string identifying the reason why a call to blogic_cmd failed. It is only non-NULL when blogic_cmd returns a failure code.
*/
staticchar *blogic_cmd_failure_reason;
/* blogic_announce_drvr announces the Driver Version and Date, Author's Name, Copyright Notice, and Electronic Mail Address.
*/
staticvoid blogic_announce_drvr(struct blogic_adapter *adapter)
{
blogic_announce("***** BusLogic SCSI Driver Version " blogic_drvr_version " of ccb-> = BLOGIC_CCB_FREEjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
ccb- ;
}
/* blogic_drvr_info returns the Host Adapter Name to identify this SCSI Driver and Host Adapter.
*/
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{
* static _init(struct *) return
}int =BLOGIC_CCB_GRP_ALLOCSIZE(struct);
/* blogic_init_ccbs initializes a group of Command Control Blocks (CCBs) for Host Adapter from the blk_size bytes located at blk_pointer. The newly created CCBs are added to Host Adapter's free list.
*/
staticvoid blogic_init_ccbs(struct blogic_adapter lk_pointer (&adapter-pci_device-, int blk_size blkp
{ struct blogic_ccb *ccb if( = ) { unsignedint offset = 0;
emset,0 );
ccb- adapter
>allocgrp_sizeblk_sizejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 while ((blk_size -= sizeof(struct blogic_ccb)) >= 0) {
ccb->status = BLOGIC_CCB_FREE;
ccb->adapter = adapter;
ccb->dma_handle = (u32) blkp + offset; if blogic_init_ccbsadapter blk_pointer, , blkp true
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
ccb->next = adapter-*
ccb-void(structblogic_adapteradapter
adapter-free_ccbs ccb
adapter-> = ;
adapter->free_ccbs NULL
(ccb ) ! ) {
= >next_all
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
/* blogic_create_initccbs allocates the initial CCBs for Host Adapter.
*/
whilelastccb-allocgrp_size,
blk_pointer >);
blk_size if
blogic_create_addlccbs allocates Additional CCBs for Host allocation fails and there are no remaining CCBs available, the Driver Queue
adapter multiple host adapters share thejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 returnintaddl_ccbs print_success
} intblk_size BLOGIC_CCB_GRP_ALLOCSIZE (struct);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 return if (add <=0java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
/* blogic_destroy_ccbs deallocates the CCBs for Host Adapter.
*/
static blogic_destroy_ccbs blogic_adapter *)
{
uct *ext_ccb >all_ccbs,*, *lastccb NULL; break
a>free_ccbs=NULL
w (ccb ) =NULL{
i adapter- > prev_alloc { if (ccb->allocgrp_head) { if (lastccb)
dma_free_coherentifprint_success
lastccb-, lastccb
lastccb- return;
lastccbblogic_noticeFailed additional\" )
/* blogic_create_addlccbs allocates Additional CCBs for Host Adapter. If allocation fails and there are no remaining CCBs available, the Driver Queue Depth is decreased to a known safe value to avoid potential deadlocks when multiple host adapters share the same IRQ Channel.
*/
staticvoid blogic_create_addlccbs int addl_ccbs, bool print_success)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 int blk_size = BLOGIC_CCB_GRP_ALLOCSIZE * sizeof >serial+erial int prev_alloc cb- = NULL; void *blk_pointer;
dma_addr_t blkp (>free_ccbs= NULL
blogic_create_addlccbs, adapter-, return t); while (adapter->alloc_ccbs - prev_alloc < addl_ccbs) {
blk_pointer = dma_alloc_coherent(&adapter->pci_device->dev,
blk_size&, GFP_KERNEL)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 if (blk_pointer == NULL = adapter-; break;
blogic_init_ccbs(adapterreturn;
} if (>alloc_ccbs ) { if (print_success)
blogic_notice("Allocated % adapter->free_ccbs = ccb->nexadapter-> = >next;
java.lang.StringIndexOutOfBoundsException: Range [12, 9) out of bounds for length 9
}
blogic_notice( free list. The Host Adapter's Lock caller. ifadapter- >adapter- -adapter-) java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
adapter->drvr_qdepth java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
>scsi_host- =>drvr_qdepth
}
/*commandjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 blogic_alloc_ccb allocates a CCB from Host Adapter's free list, allocating more memory from the Kernel if necessary. The Host Adapter's Lock should already have been acquired by the caller.
*/
the Host Adapter -1 if the command
{ staticunsignedlong serial; access to the Host Adapter hardware is driver are initialized, the only Host single byte Execute Mailbox Commandbit to be set in the* struct blogic_ccb *ccb;
ccb = adapter- char =unsigned); ifccbNULLjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
ccb->serial = ++i reply_b0 ; long;
ccb-/* if (adapter->free_ccbs == NULL) blogic_create_addlccbs(adapter, adapter->inc_ccbs, true); return ccb; } blogic_create_addlccbs(adapter, adapter->inc_ccbs, true); ccb = adapter->free_ccbs; if (ccb == NULL) return NULL; ccb->serial = ++serial; adapter->free_ccbs = ccb->next; ccb->next = NULL; return ccb; }
/* blogic_dealloc_ccb deallocates a CCB, returning it to the Host Adapter's free list. The Host Adapter's Lock should already have been acquired by the caller.
*/
staticvoid blogic_dealloc_ccb(struct blogic_ccb *ccb, int dma_unmap)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct Command/Parameter Register Busy bit Register.
if .all (adapter
(ccb-command if (dma_unmap)
(&adapter->, ccb-sensedata,
>sense_datalenDMA_FROM_DEVICE;
/* blogic_cmd sends the command opcode to adapter, optionally providing paramlen bytes of param and receiving at most replylen bytes of reply; any excess reply data is received but discarded.
On success, this function returns the number of reply bytes read from the Host Adapter (including any discarded data); on failure, it returns -1 if the command was invalid, or -2 if a timeout occurred.
blogic_cmd is called exclusively during host adapter detection and initialization, so performance and latency are not critical, and exclusive access to the Host Adapter hardware is assumed. Once the host adapter and driver are initialized, the only Host Adapter command that is issued is the single byte Execute Mailbox Command operation code, which does not require waiting for the Host Adapter Ready bit to be set in the Status Register.
*/
staticint blogic_cmd(struct blogic_adapter *adapter, enum blogic_opcode opcode, void *param, int paramlen, void *reply, int/* { unsigned char *param_p = (unsigned char *) param; unsigned char *reply_p = (unsigned char *) reply; union blogic_stat_reg statusreg; union blogic_int_reg intreg; unsigned long processor_flag = 0; int reply_b = 0, result; long timeout; /* Clear out the Reply Data if provided.
*/ if (replylen > 0)
memset(reply, 0, replylen); /* If the IRQ Channel has not yet been acquired, then interrupts must be disabled while issuing host adapter commands since a Command Complete interrupt could occur if the IRQ Channel was previously enabled by another BusLogic Host Adapter or another driver sharing the same IRQ Channel.
*/ ifRegister to be java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ocal_irq_save); /* Wait for the Host Adapter Ready bit to be set and the Command/Parameter Register Busy bit to be reset in the Status Register.
*/
timeout = 10000; while f(.sr)
statusregcontinue
dapter_ready&!statusreg.cmd_param_busy) break;
udelay(100);
} if (timeout < paramlen--
= " =
result = -2; goto done;
} /* Write the opcode to the Command/Parameter Register.
*/
adapter->adapter_cmd_complete = false;
blogic_setcmdparam(adapter /* Write any additional Parameter Bytes.
*/
timeoutInterrupt while i opcode )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 /* Wait 100 microseconds to give the Host Adapter enough time to determine whether the last value written to the Command/Parameter Register was valid or not. If the Command Complete bit is set in the Interrupt Register, then the Command Invalid bit in the Status Register will be reset if the Operation Code or Parameter was valid and the command has completed, or set if the Operation Code or Parameter was invalid. If the Data In Register Ready bit is set in the Status Register, then the Operation Code was valid, and data is waiting to be read back from the Host Adapter. Otherwise, wait for the Command/Parameter Register Busy bit in the Status Register to be reset.
*/
udelay(100);
result =0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
statusreg.all = blogic_rdstatus(adapter); if (intreg.ir.cmd_complete)
(opcode if ( : break
/ break; if (statusreg. if (statusreg.sr0 continue:
blogic_setcmdparamadapter*aram_p;
paramlen--;
} if (timeout < 0) {
blogic_cmd_failure_reason = "Timeout waiting for Parameter timeout = 100;
result goto done Receive any Reply Bytes, waiting for Complete bit to be set in the Interrupt Register Interrupt Handler to set the Host Adapter Command Completed
} /* The Modify I/O Address command does not cause a Command Complete Interrupt.
*/ if (opcode == BLOGIC_MOD_IOADDR) {
statusreg. = blogic_rdstatus(); if (statusreg. reak
=
;
result (.srdatain_ready{ goto done; if(+ <= )
} else
blogic_notice("blogic_cmd(%02X) Status = %02X: (Modify I/O blogic_rddatain(adapter;
result = 0;
}
} /* Select an appropriate timeout value for awaiting command completion.
*/ switch.r)
;
(10; case timeout ){ " ;
timeout = 60 -
; default: /* Approximately 1 second. */
timeout = 10000; break;
} /* Receive any Reply Bytes, waiting for either the Command Complete bit to be set in the Interrupt Register, or for the Interrupt Handler to set the Host Adapter Command Completed bit in the Host Adapter structure.
*/ while (--timeout >= 0)
.all (adapter
.all (adapter
blogic_noticeblogic_cmd0X)Status2:2 = %" break if reply_b; break; if (statusreg.sr.datain_ready) { if (++reply_b <= replylen)
*reply_p++ = ;
se
(adapter;
} if (opcode == (unsigned *))[i)
statusreg.) break;
delay0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
} if properly from a Command Invalid appears to be the case Host Adapter. Potentially invalid commands are attempted after Mailbox Initialization so there should be no Soft Reset in response to java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.. |
Timeout;
result = -2; goto done(adapter
} /* Clear any pending Command Complete Interrupt.
*/
blogic_intreset( = -java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 /* Provide tracing information if requested.
*/ ifblogic_global_optionstrace_config{ intresult =-; goto ;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2
reply_b); if (replylen *
blogic_cmd_failure_reason ;
= reply_b
Restore the interrupt status if necessary andreturn.
( *reply;
blogic_notice("\n",result
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 /* Process Command Invalid conditions.
*/ if (statusreg *,intprobeinfo_cnt /* Some early BusLogic Host Adapters may not recover properly from a Command Invalid condition, so if this appears to be the case, a Soft Reset is issued to the Host Adapter. Potentially invalid commands are never attempted after Mailbox Initialization is performed, so there should be no Host Adapter state lost by a Soft Reset in response to a Command Invalid condition.
*/
udelay(1000);
statusreg.all = blogic_rdstatus(adapter); if (statusreg.sr.cmd_invalid || statusreg.sr.rsvd ||
statusreg.sr.datain_ready ||
statusreg.sr.md_param_busy|
!statusreg.sr.adapter_ready ||
!statusreg.sr.init_reqd ||
statusreg.sr.diag_active ||
statusreg.sr.diag_failed)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(adapterjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
delay00;
}
blogic_cmd_failure_reason = "Command Invalid";
= 1; goto done;
} /* Handle Excess Parameters Supplied conditions.
*/ if (paramlen > 0) {
blogic_cmd_failure_reason = "Excess blogic_probeinfo*robeinfo2=
result = -1; goto done;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 /* Indicate the command completed successfully.
*/
d_failure_reason= NULLjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
result = reply_b sizeof blogic_probeinfo /* Restore the interrupt status if necessary and return.
*/
done: if (!adapter->irq_acquired)
local_irq_restore(processor_flag); return result;
}
/* blogic_sort_probeinfo sorts a section of blogic_probeinfo_list in order of increasing PCI Bus and Device Number.
*/
staticvoid __init blogic_sort_probeinfo(struct blogic_probeinfo
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
{ int last_exchange = probeinfo_cnt - 1, bound, machines as well as from the list of I/O Addresses. It returns the number of*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* blogic_init_mm_probeinfo initializes the list of I/O Address and Bus Probe Information to be checked for potential BusLogic MultiMaster SCSI Host Adapters by interrogating the PCI Configuration Space on PCI machines as well as from the list of standard BusLogic MultiMaster ISA I/O Addresses. It returns the number of PCI MultiMaster Host Adapters found.
*/
staticint __init blogic_init_mm_probeinfo(struct blogic_adapter *adapter)
{ struct blogic_probeinfo *pr_probeinfo =
& standard ISA I/O Addresses. When a PCI host adapter is found int nonpr_mmindex to disable the ISA Compatible I/O Port particular standard ISA I/O Address need not int nonpr_mmcount = PCI_DEVICE_ID_BUSLOGIC_MULTIMASTERjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 bool force_scan_order =struct adapter_info boolforce_scan_order_checked ; struct pci_dev *pci_device = NULL; int i; ifblogic_probeinfo_count ) return 0;
blogic_probeinfo_count intirq_ch unsignedlong base_addr0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
Iterate overunsigned io_addr
host, determine its Compatible
I/Ojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Primary I continue;
Primary I/O Address will always be the preferred boot
will recognize adapter
the ; and >>;
standard I/Addresses PCI found
with its ISA Compatible I/O Port enabled, a command is issued
to disable the ISA Compatible I/O Port, and it is noted that the
particular standard ISA I/O Address need not be probed.
*/
pr_probeinfo->io_addr = 0; while ((pci_device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC,
PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER,
pci_device)) != NULL) { struct blogic_adapter *host_adapter = adapter; struct blogic_adapter_info adapter_info; enumblogic_isa_ioportmod_ioaddr_req unsignedio_addr =pci_resource_start, ); unsignedchar device unsignedint irq_ch (pci_resource_flags(, ) &IORESOURCE_MEM java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 unsignedlongbase_addr0; unsignedlong base_addr1;
nsignedlong io_addr continue
ifif(pci_resource_flagspci_device 1 IORESOURCE_IO java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 continuejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32))) continue;
bus pci_device-bus-number;
device = pci_device->devfn }
irq_ch = pci_device->irq;
io_addr = base_addr0 =
pci_addr blogic_err": Channel d for MultiMasterHostAdapter\" NULL,irq_ch
if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
blogic_err }
blogic_err"tPCIBus d % I/O Address 0%lXn" ,busdeviceio_addrjava.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89 continue
} if (pci_resource_flags(pci_device 1 IORESOURCE_IO {
blogic_err("BusLogic: Base Address1 0x%lX not Memory for MultiMaster java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
blogic_err("at PCI Bus %d Device %d PCI Address 0x%lX\n", NULL, bus, device, pci_addr); continue;
} if (irq_ch == 0) {
blogic_err("BusLogic: IRQ Channel %d invalid for MultiMaster Host the ISA Compatible I/O Port. If the ISA Compatible I/O Port is
known and enabled, note that the particular Standard ISA I/O continue;
} if (blogic_global_options.trace_probe host_adapter-io_addr =io_addr
blogic_notice"BusLogic: PCI MultiMaster Host Adapterdetectedatn" NULL);
blogic_notice(BusLogic PCIBus %dDevicedI/ Address0% PCIAddress0%lXn" NULL bus device io_addr,pci_addr)java.lang.StringIndexOutOfBoundsException: Index 127 out of bounds for length 127
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 4
the PCI Host AdapterInformation commandtodetermine
the /* known and enabled, note that the particular Standard ISA I/O Address should not be probed.
*/
host_adapter->io_addr = io_addr;
blogic_intreset(host_adapter); if (blogic_cmd( I/O Address assigned at system initialization.
adapter_info sizeofa)) != sizeof(adapter_info))
adapter_info.isa_port = BLOGIC_IO_DISABLE; /* Issue the Modify I/O Address command to disable the ISA Compatible I/O Port. On PCI Host Adapters, the Modify I/O Address command allows modification of the ISA compatible I/O Address that the Host Adapter responds to; it does not affect the PCI compliant I/O Address assigned at system initialization.
*/
mod_ioaddr_req = BLOGIC_IO_DISABLE;
blogic_cmd(host_adapter, BLOGIC_MOD_IOADDR, &mod_ioaddr_req, sizeof/* /* For the first MultiMaster Host Adapter enumerated, issue the Fetch Host Adapter Local RAM command to read byte 45 of the AutoSCSI area, for the setting of the "Use Bus And Device # For PCI Scanning Seq." option. Issue the Inquire Board ID command since this option is only valid for the BT-948/958/958D.
*/ if (!force_scan_order_checked) only valid for the BT-948/958/958D.
blogic_fetch_localram; struct blogic_autoscsi_byte45 autoscsi_byte45; struct blogic_board_idid
fetch_localram structblogic_autoscsi_byte45 autoscsi_byte45
fetch_localram.count sizeof(autoscsi_byte45);
blogic_cmd(host_adapter, BLOGIC_FETCH_LOCALRAM,
&fetch_localram, sizeof(fetch_localram),
&autoscsi_byte45 sizeof(autoscsi_byte45 fetch_localram.count=sizeofautoscsi_byte45;
(host_adapter, NULL ,
&id, sizeof(ram (fetch_localram,
&autoscsi_byte45
force_scan_order =
autoscsi_byte45force_scan_order
force_scan_order_checked = true;
} /* Determine whether this MultiMaster Host Adapter has its ISA Compatible I/O Port enabled and is assigned the Primary I/O Address. If it does, then it is the Primary MultiMaster Host Adapter and must be recognized first. If it does not, then it is added to the list for probing after any Primary MultiMaster Host Adapter is probed.
*/ if (adapter_info.isa_port == BLOGIC_IO_330) {
pr_probeinfo->adapter_type = BLOGIC_MULTIMASTER;
pr_probeinfo->adapter_bus_type = BLOGIC_PCI_BUS;
pr_probeinfo->io_addr if(idfw_ver_digit1= ')
pr_probeinfo-pci_addr =pci_addr
pr_probeinfo- .force_scan_order
force_scan_order_checked ;
pr_probeinfo->irq_ch}
pr_probeinfo-/* mmcount++; } else if (blogic_probeinfo_count < BLOGIC_MAX_ADAPTERS) { struct blogic_probeinfo *probeinfo = &blogic_probeinfo_list[blogic_probeinfo_count++]; probeinfo->adapter_type = BLOGIC_MULTIMASTER; probeinfo->adapter_bus_type = BLOGIC_PCI_BUS; probeinfo->io_addr = io_addr; probeinfo->pci_addr = pci_addr; probeinfo->bus = bus; probeinfo->dev = device; probeinfo->irq_ch = irq_ch; probeinfo->pci_device = pci_dev_get(pci_device); nonpr_mmcount++; mmcount++; } else blogic_warn("BusLogic: Too many Host Adapters detected\n", NULL); } /* If the AutoSCSI "Use Bus And Device # For PCI Scanning Seq." option is ON for the first enumerated MultiMaster Host Adapter, and if that host adapter is a BT-948/958/958D, then the MultiMaster BIOS will recognize MultiMaster Host Adapters in the order of increasing PCI Bus and Device Number. In that case, sort the probe information into the same order the BIOS uses. If this option is OFF, then the MultiMaster BIOS will recognize MultiMaster Host Adapters in the order they are enumerated by the PCI BIOS, and hence no sorting is necessary.
*/ if (force_scan_order)
blogic_sort_probeinfo(&blogic_probeinfo_list[nonpr_mmindex],
nonpr_mmcount); /* Iterate over the older non-compliant MultiMaster PCI Host Adapters, noting the PCI bus location and assigned IRQ Channel.
*/
pci_device = NULL MultiMaster BIOS will recognize MultiMaster the order of increasing PCI Bus sort the probe information into the same order the BIOS uses. while ( if(orce_scan_order
PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC
nonpr_mmcountjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 unsignedchar bus; unsignedchar device; unsigned noting the PCI bus location and assigned IRQ Channel. unsigned io_addr
if (io_addr=0||irq_ch0 continue for (i = 0; i < blogic_probeinfo_count pci_device->number struct blogic_probeinfo *probeinfo irq_ch >irq
&blogic_probeinfo_list[i]; if = |irq_ch0
probeinfo->adapter_type == BLOGIC_MULTIMASTER) {
probeinfo-adapter_bus_type =BLOGIC_PCI_BUS
probeinfo->pci_addr = 0;
>bus= ;
probeinfo->dev = device struct blogic_probeinfoprobeinfo
> = irq_ch
probeinfo-pci_device pci_dev_getpci_device
;
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
mmcount
}
/* blogic_init_fp_probeinfo initializes the list of I/O Address and Bus Probe Information to be checked for potential BusLogic FlashPoint Host Adapters by interrogating the PCI Configuration Space. It returns the number of FlashPoint Host Adapters found.
*/
int ( *)
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct /* Interrogate PCI Configuration Space for any FlashPoint Host Adapters.
*/ while ,
pci_device)=)
))! ) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
bus unsigned; unsigned ;
long unsignedlong unsigned long base_addr1 unsignedlong io_addr; unsignedlong;
if (pci_enable_device( =>>number
;
if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32))) continue;
bus = pci_device->bus->number;
=pci_device-devfn; #
=(pci_device)
pci_addr =(pci_device)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 #ifdef CONFIG_SCSI_FLASHPOINT if java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
blogic_err(" blogic_err("BusLogic BaseAddress1 0% notMemoryforFlashPoint Adaptern,NULL ;
blogic_err("at PCI Bus %d Device %d I/ (" PCI % Device%PCIn bus) continue;
} if (pci_resource_flags
(:BasexlX for \",)java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
; continueif.)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
}
blogic_err: \" , )java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
blogic_err(" >adapter_type=BLOGIC_FLASHPOINT; continue;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
.)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
blogic_notice+
(": Adaptersdetectedn,)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
blogic_probeinfo_count java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 struct java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
&blogic_probeinfo_list[blogic_probeinfo_count/*
probeinfo->adapter_type = BLOGIC_FLASHPOINT;
probeinfo-> The FlashPoint BIOS will scan for FlashPoint Host Adapters in the order of
probeinfo->io_addr = io_addr;
probeinfo->pci_addr = pci_addr;
probeinfo-(&[fpindex fpcount
robeinfo- = devicejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
probeinfo->irq_ch = irq_ch;
probeinfo->pci_device blogic_init_probeinfo_list initializes the list of I/O Address and Bus
fpcount++;
} else
blogic_warn("BusLogic: Too list of standard BusLogic MultiMaster ISA I/O Addresses. By default, if both #else
blogic_err probe for FlashPoint Host Adapters first unless the BIOS controlled by the first PCI MultiMaster Host Adapter MultiMaster Host Adapters will be probed first. The specifications "MultiMasterFirst"and"FlashPointFirst" can a particular probe order.
blogic_err("BusLogic: I/O Address 0x%lX PCI Address 0x%lX, irq %d, but FlashPoint\n", NULL, io_addr, pci_addr, staticvoid_initblogic_init_probeinfo_list blogic_adapter*)
blogic_err("BusLogic: support was omitted in this kernel configuration.\n", NULL); #endif
} /* The FlashPoint BIOS will scan for FlashPoint Host Adapters in the order of increasing PCI Bus and Device Number, so sort the probe information into the same order the BIOS uses.
*/
blogic_sort_probeinfo(&blogic_probeinfo_list[fpindex], fpcount); return ();
}
/* blogic_init_probeinfo_list initializes the list of I/O Address and Bus Probe Information to be checked for potential BusLogic SCSI Host Adapters by interrogating the PCI Configuration Space on PCI machines as well as from the list of standard BusLogic MultiMaster ISA I/O Addresses. By default, if both FlashPoint and PCI MultiMaster Host Adapters are present, this driver will probe for FlashPoint Host Adapters first unless the BIOS primary disk is controlled by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host Adapters will be probed first. The BusLogic Driver Options specifications "MultiMasterFirst" and "FlashPointFirst" can be used to force a particular probe order.
*/
staticvoid __ struct d0_mapbyte
{ /* If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
*/
. if BLOGIC_BIOS_BASE+;
.count();
blogic_init_fp_probeinfo(adapter);
}else blogic_probe_options) {
blogic_init_fp_probeinfo(adapter);
blogic_init_mm_probeinfo(adapter);
}else int fpcount (fetch_localram int mmcount = blogic_init_mm_probeinfo(adapter); if ( /* struct blogic_probeinfo *probeinfo = &blogic_probeinfo_list[fpcount]; struct blogic_adapter *myadapter = adapter; struct blogic_fetch_localram fetch_localram; struct blogic_bios_drvmap d0_mapbyte;
while (probeinfo->adapter_bus_type != BLOGIC_PCI_BUS) probeinfo++; myadapter->io_addr = probeinfo->io_addr; fetch_localram.offset = BLOGIC_BIOS_BASE + BLOGIC_BIOS_DRVMAP; fetch_localram.count = sizeof(d0_mapbyte); blogic_cmd(myadapter, BLOGIC_FETCH_LOCALRAM, &fetch_localram, sizeof(fetch_localram), &d0_mapbyte, sizeof(d0_mapbyte)); /* If the Map Byte for BIOS Drive 0 indicates that BIOS Drive 0 is controlled by this PCI MultiMaster Host Adapter, then reverse the probe order so that MultiMaster Host Adapters are probed before FlashPoint Host Adapters.
*/ if (d0_mapbyte.diskgeom(saved_probeinfo
struct ( blogic_probeinfo int memcpy(blogic_probeinfo_list0java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
/* blogic_probe probes for a BusLogic Host Adapter.
*/
{
{
statusreg
blogic_geo_reg; /** /* FlashPoint Host Adapters are Probed by the FlashPoint SCCB Manager.
*/ if (blogic_flashpoint_type(adapter) fpoint_infofpinfo&>fpinfo struct * =&>fpinfo
> () adapter-;
pinfo- = falsejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
esent ; if (!(FlashPoint_ProbeHostAdapter(fpinfo) == 0 &&
present
blogic_err("BusLogic: (": I/ 0% AddressxlX \n" , >io_addr >);
blogic_errBusLogic/ 0% PCI 0%, butFlashPointn,,adapter-,adapter-)
blogic_err("BusLogic: returnfalsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 returnifblogic_global_options)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (blogic_global_options.trace_probe)
blogic_notice("BusLogic_Probe(0x%lX): FlashPoint Found\n", adapter, adapter->io_addr); /* Indicate the Host Adapter Probe completed successfully.
*/ returntrue;
} /* Read the Status, Interrupt, and Geometry Registers to test if there are I/O ports that respond, and to check the values to determine if they are from a BusLogic Host Adapter. A nonexistent I/O port will return 0xFF, in which case there is definitely no BusLogic Host Adapter at this base I/O Address. The test here is a subset of that used by the BusLogic Host Adapter BIOS.
*/
statusreg =blogic_rdstatus);
intreg(.trace_probe
.all (adapter if (statusreg.all==0| .sr |java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
blogic_notice("BusLogic_Probe(0x%lX): Status 0 statusreg.rcmd_invalid|| intreg.ir.rsvd != 0) if (statusreg.all==0 ||statusregsrdiag_active |
statusreg.sr.cmd_param_busy || statusreg.sr.rsvd ||
statusreg.sr.cmd_invalid || intreg.ir.rsvd != 0) returnfalse; /* Check the undocumented Geometry Register to test if there is an I/O port that responded. Adaptec Host Adapters do not implement the Geometry Register, so this test helps serve to avoid incorrectly recognizing an Adaptec 1542A or 1542B as a BusLogic. Unfortunately, the Adaptec 1542C series does respond to the Geometry Register I/O port, but it will be rejected later when the Inquire Extended Setup Information command is issued in blogic_checkadapter. The AMI FastDisk Host Adapter is a BusLogic clone that implements the same interface as earlier BusLogic Host Adapters, including the undocumented commands, and is therefore supported by this driver. However, the AMI FastDisk always returns 0x00 upon reading the Geometry Register, so the extended translation option should always be left disabled on the AMI FastDisk.
*/
(.all=0) returnfalse; /* Indicate the Host Adapter Probe completed successfully.
*/ returntrue;
}
/* blogic_hwreset issues a Hardware Reset to the Host Adapter and waits for Host Adapter Diagnostics to complete. If hard_reset is true, a Hard Reset is performed which also initiates a SCSI Bus Reset. Otherwise, a Soft Reset is performed which only resets the Host Adapter without forcing a SCSI Bus Reset.
*/
staticbool blogic_hwreset Hard Reset is performed which also initiates a SCSI Bus Reset. Soft Reset is performed which only resets the Host Adapter
{ unionblogic_stat_reg; int timeout; /* FlashPoint Host Adapters are Hard Reset by the FlashPoint SCCB Manager.
*/ if (blogic_flashpoint_type(adapter)) {
int_info *fpinfo=&adapter-fpinfo
fpinfo->softreset = /* fpinfo->report_underrun = true; adapter->cardhandle = FlashPoint_HardwareResetHostAdapter(fpinfo); if (adapter->cardhandle == (void *)FPOINT_BADCARD_HANDLE) return false; /* Indicate the Host Adapter Hard Reset completed successfully.
*/ return;
} /* Issue a Hard Reset or Soft Reset Command to the Host Adapter. The Host Adapter should respond by setting Diagnostic Active in the Status Register.
*/ if (hard_reset)
blogic_hardreset(adapter); else
blogic_softreset(adapter); /* Wait until Diagnostic Active is set in the Status Register.
*/
timeout = 5 * 10000; while (--timeout >= 0) {
statusreg.all = blogic_rdstatus(adapter); if (statusreg.sr.diag_active) break;
udelay(100);
} if (blogic_global_options.trace_hw_reset)
blogic_notice("BusLogic_HardwareReset(0x%lX): * if( < 0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 returnfalse; /* Wait 100 microseconds to allow completion of any initial diagnostic activity which might leave the contents of the Status Register unpredictable.
*/
udelay(10 statusregallblogic_rdstatus(); /* Wait until Diagnostic Active is reset in the Status Register.
*/
timeout = 10 * 10000; while (--timeout >=if (.trace_hw_reset
statusreg =adapter if (!statusreg.sr. (timeout 0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 break;
udelay(100);
} if (blogic_global_options.trace_hw_reset)
blogic_noticejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (timeout < 0) returnfalse; /* Wait until at least one of the Diagnostic Failure, Host Adapter Ready, or Data In Register Ready bits is set in the Status Register.
*/
timeout = 10000; while (--timeout >= 0) {
statusreg.all = blogic_rdstatus( } if (statusreg.sr.diag_failed || statusreg.sr.adapter_ready ||
statusreg.sr. if(blogic_global_optionstrace_hw_reset break
udelay100);
} if (blogic_global_options.trace_hw_reset) returnfalse; if (timeout < 0) returnfalse; /* If Diagnostic Failure is set or Host Adapter Ready is reset, then an error occurred during the Host Adapter diagnostics. If Data In Register Ready is set, then there is an Error Code available.
*/ if (tatusreg.diag_failed || !statusregsr) {
blogic_cmd_failure_reason = NULL;
blogic_failure(adapter " RESET DIAGNOSTICS";
blogic_err("HOST ADAPTER STATUS REGISTER = statusreg.r.datain_ready)
statusreg.all); if (statusreg.sr.datain_ready)
blogic_err("HOST ADAPTER java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 9
blogic_rddatainadapter; returnfalse;
} /* Indicate the Host Adapter Hard Reset completed successfully.
*/ return ;
}
/* blogic_checkadapter checks to be sure this really is a BusLogic Host Adapter.
*/
staticbool __init blogic_checkadapter(struct blogic_adapter then an error If Data In Register Ready is available.
{
blogic_ext_setup; unsignedcharblogic_failure, HARDRESET" bool result = true; /* FlashPoint Host Adapters do not require this protection.
*/ if (blogic_flashpoint_type(adapter =%\" , return; /* Issue the Inquire Extended Setup Information command. Only genuine BusLogic Host Adapters and true clones support this command. Adaptec 1542C series Host Adapters that respond to the Geometry Register I/O port will fail this command.
*/
req_replylen if (blogic_cmd(adapter,
(), &ext_setupinfo sizeof(ext_setupinfo)) != sizeof Host Adapter.
result ol __init blogic_checkadapterstructblogic_adapteradapter /* Provide tracing information if requested and return.
*/ if (blogic_global_options.trace_probe)
blogic_notice(" FlashPoint Host Adapters do not require this protection.
adapter->ifblogic_flashpoint_type))
result"" :" Found"); return result;
}
/* Issue the Inquire Extended Setup Information command. Only genuine blogic_rdconfig reads the Configuration Information from Host Adapter and initializes the Host Adapter structure.
*/
bool_init(structblogic_adapteradapter
{
s blogic_board_idid struct blogic_config config; struct blogic_setup_info setupinfo; structblogic_ext_setup ext_setupinfo unsignedchar model[5]; unsignedchar fw_ver_digit3; /* unsigned char fw_ver_letter; struct blogic_adapter_info adapter_info; struct blogic_fetch_localram fetch_localram; struct blogic_autoscsi autoscsi; union blogic_geo_reg georeg; unsigned char req_replylen; unsigned char *tgt, ch; int tgt_id, i; /* Configuration Information for FlashPoint Host Adapters is provided in the fpoint_info structure by the FlashPoint SCCB Manager's Probe Function. Initialize fields in the Host Adapter structure from the fpoint_info structure.
*/ if (blogic_flashpoint_type(adapter)) { struct fpoint_info *fpinfo = &adapter->fpinfo;
tgt = adapter-static __init blogic_rdconfigstruct blogic_adapter*adapter)
{
*tgt++ = 'T';
*tgt++ = '-'; forstructblogic_board_idid
odel[i]
*tgt++ = '\struct blogic_setup_info setupinfo;
strcpyadapter->fw_ver FLASHPOINT_FW_VER);
adapter->scsi_id = fpinfo->scsi_id;
adapter->ext_trans_enable = fpinfo->ext_trans_enable;
adapter->parity = fpinfo-> unsignedcharmodel[5];
adapter->reset_enabled = !fpinfo->softreset;
adapter->level_int = true;
adapter->wide = fpinfo->wide;
adapter->differential = false;
adapter->scam = true;
adapter->ultra = true;
adapter->ext_lun = true;
adapter->terminfo_valid = true;
adapter->low_term = fpinfo->low_term;
adapter->high_term = fpinfo->high_term;
adapter->scam_enabled = fpinfo->scam_enabled;
adapter->scam_lev2 = fpinfo->scam_lev2;
adapter->drvr_sglimit = BLOGIC_SG_LIMIT;
adapter->maxdev = (adapter->wide ? 16 : 8);
adapter->maxlun = 32;
adapter->initccbs = 4 ifblogic_flashpoint_type()) {
adapter->inc_ccbs = BLOGIC_CCB_GRP_ALLOCSIZE;
adapter->drvr_qdepth = 255;
adapter- = >drvr_qdepth
adapter->sync_ok*++ ';
*gt = T;
adapter->ultra_ok*++ '-'
adapter->wide_ok = fpinfo->wide_ok for( =0;i <sizeoffpinfo-model i++
adapter->discon_ok=fpinfo-discon_ok
adapter->tagq_ok = 0xFFFF; *++ '0' goto;
} /* Issue the Inquire Board ID command.
*/ if (blogic_cmd(adapter, BLOGIC_GET_BOARD_ID, NULL, 0, &id, sizeof(id)) != sizeof(id)) return blogic_failure(adapter, "INQUIRE BOARD ID adapter->differential false; /* Issue the Inquire Configuration command.
*/ if (blogic_cmd(adapter, BLOGIC_INQ_CONFIG, NULL, 0, &config, sizeof(config))
!= sizeof(config)) return > =fpinfo-; /*>scam_enabled=fpinfo->scam_enabled Issue the Inquire Setup Information command.
*/
=(setupinfo if adapter- =3; sizeof),&, sizeof)) =sizeof)) return blogic_failure(adapter, "INQUIRE SETUP INFORMATION"); /* Issue the Inquire Extended Setup Information command.
*/
req_replylen = sizeof(ext_setupinfo); if adapter->wide_ok = fpinfo->wide_ok; sizeof(req_replylen), &ext_setupinfo, sizeof(ext_setupinfo)) != java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 14 return blogic_failure(adapter, "INQUIRE EXTENDED SETUP INFORMATION"); /* Issue the Inquire Firmware Version 3rd Digit command.
*/
fw_ver_digit3 = '\0'; ()!() ifreturn blogic_failure(, " BOARDID); /* &fw_ver_digit3, sizeof(fw_ver_digit3)) != sizeof(fw_ver_digit3)) return blogic_failure(adapter, "INQUIRE FIRMWARE 3RD DIGIT"); /* Issue the Inquire Host Adapter Model Number command.
*/ if (ext_setupinfo.bus_type /*
/* BusLogic BT-542B ISA 2.xx */
strcpy(model, "5 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if(.bus_type= E'& .= 2 &&
(id.fw_ver_digit2 <= '1' || (id.fw_ver_digit2 == '2' &&
fw_ver_digit3 == '0')))
java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
strcpy(model, "742A"); elseif (ext_setupinfo.bus_type == 'E' && id Issue the Inquire Extended Setup Information command. /* AMI FastDisk EISA Series 441 0.x */
strcpy(model, "747A (blogic_cmd(adapter,BLOGIC_INQ_EXTSETUP, req_replylen else(req_replylen,&,
req_replylen = sizeof(model) (ext_setupinfo = sizeof)) if (blogic_cmdadapter, BLOGIC_INQ_MODELNO&, sizeof(req_replylen), &model, sizeof(model)) != sizeof(model)) return blogic_failure(adapter, "INQUIRE HOST ADAPTER MODEL NUMBER");
} /* BusLogic MultiMaster Host Adapters can be identified by their model number and the major version number of their firmware as follows:
5.xx BusLogic "W" Series Host Adapters: BT-948/958/958D 4.xx BusLogic "C" Series Host Adapters: BT-946C/956C/956CD/747C/757C/757CD/445C/545C/540CF 3.xx BusLogic "S" Series Host Adapters: BT-747S/747D/757S/757D/445S/545S/542D BT-542B/742A (revision H) 2.xx BusLogic "A" Series Host Adapters: BT-542B/742A (revision G and below) 0.xx AMI FastDisk VLB/EISA BusLogic Clone Host Adapter
*/ /* Save the Model Name and Host Adapter Name in the Host Adapter structure.
*/
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
*tgt++ = 'B';
*++ = 'T';
*tgt++ = '-'; for (i = 0; i < sizeof(model); i++) {
if fw_ver_digit3'') break;
*tgt++ = ch;
}
*++ = \0; /* Save the Firmware Version in the Host Adapter structure.
*/
tgt = >fw_ver
*tgt++ = id req_replylen=sizeof);
*
*tgt++ = id.fw_ver_digit2; if (fw_ver_digit3 != ' ' && fw_ver_digit3 != '\0')
*tgt++ = fw_ver_digit3;
*tgt='\0'; /* Issue the Inquire Firmware Version Letter command.
*/ if (strcmp(adapter->fw_ver, "3.3") } if (blogic_cmd(adapter, BLOGIC_INQ_FWVER_LETTER, NULL, 0,
&fw_ver_letter sizeof MultiMasterHostAdapters identifiedbytheir
blogic_failure(adapter "INQUIRE FIRMWARE VERSION LETTER"); if (fw_ver_letter != ' & fw_ver_letter!='\0)
*tgt++ = fw_ver_letter;
*tgt = '\0';
} /* Save the Host Adapter SCSI ID in the Host Adapter structure.
*/
adapter->scsi_id = config.id; /* Determine the Bus Type and save it in the Host Adapter structure, determine and save the IRQ Channel if necessary, and determine and save the DMA Channel for ISA Host Adapters.
*/
adapter->adapter_bus_type =
blogic_adater_bus_types[adapter->model[3] - '4']; if (>irq_ch= ){ if (config.irq_ch93.xxBusLogic""Series Adapters
adapter->irq_chBT-747S7/5S77/4S55/4D elseif (configBT-542B4A (revision)
adapter->irq_ch = 10; elseif (config.irq_ch11)
adapter- /74A (revision G and) elseif (configirq_ch12
adapter->irq_ch = 12; elseif (config.irq_ch14)
adapter->irq_ch = 14; elseif (config.irq_ch15)
adapter->irq_ch = */
} /* Determine whether Extended Translation is enabled and save it in the Host Adapter structure.
*/
georeg.all i<sizeof); +){
adapter->ext_trans_enable = georeg.gr.ext_trans_enable; /* Save the Scatter Gather Limits, Level Sensitive Interrupt flag, Wide SCSI flag, Differential SCSI flag, SCAM Supported flag, and Ultra SCSI flag in the Host Adapter structure.
*/
adapter->adapter_sglimit Save the Firmware Version in the Host
adapter->drvr_sglimit = adapter-*++ id.; if tgt .;
adapter->drvr_sglimit++ idfw_ver_digit2; if (ext_setupinfoiffw_ver_digit3='& = '0)
adapter-*gt fw_ver_digit3;
adapter->wide = ext_setupinfo *tgt \'java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
adapter->differential java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
adapter-scam ext_setupinfo.scam
adapter-ultra ext_setupinfo.ultrajava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 /* Determine whether Extended LUN Format CCBs are supported and save the information in the Host Adapter structure.
*/ if ( if(w_ver_letter! & fw_ver_letter='0)
adapter->wide))
adapter->ext_lun = true; /* Issue the Inquire PCI Host Adapter Information command to read the Termination Information from "W" series MultiMaster Host Adapters.
*/ ifjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (blogic_cmd(adapter, determine and save the IRQ Channel if necessary, and determine
&adapter_info>adapter_bus_type
[adapter-model -4]java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 return blogic_failure(adapter, "INQUIRE PCI HOST ADAPTER INFORMATION"); /* Save the Termination Information in the Host Adapter structure.
*/ if (adapter_info.genericinfo_valid) {
adapter-terminfo_valid true
adapter->irq_ch 9
else if.irq_ch10
}
} /* Issue the Fetch Host Adapter Local RAM command to read the AutoSCSI data from "W" and "C" series MultiMaster Host Adapters.
*/ if (adapter->fw_ver[0] >= '4') {
fetch_localram.offset a>irq_ch= 2java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
fetch_localram.count = sizeof(autoscsi);
/* sizeof(fetch_localram) Determine whether Extended Translation is enabled and save it in sizeof(autoscsi)) != sizeof(autoscsi)) return blogic_failure georegall=blogic_rdgeom);
FETCHHOSTADAPTER RAM; /* Save the Parity Checking Enabled, Bus Reset Enabled, and Termination Information in the Host Adapter structure.
*/
adapter->parity = autoscsi.parity;
adapter->reset_enabled = autoscsi.reset_enabled; if (adapter->fw_ver[0] == '4') {
adapter->terminfo_valid = true;
adapter->low_term = autoscsi.low_term;
adapter->high_term = autoscsi.high_term;
} /* Save the Wide Permitted, Fast Permitted, Synchronous Permitted, Disconnect Permitted, Ultra Permitted, and SCAM Information in the Host Adapter structure.
*/
adapter->wide_ok = autoscsi.wide_ok;
adapter->fast_ok = autoscsi.fast_ok;
adapter->sync_ok = autoscsi.sync_ok;
adapter->discon_ok = autoscsi.discon_ok; if (adapter->ultra)
adapter->ultra_ok = autoscsi.ultra_ok; if (adapter->scam) {
adapter->scam_enabled = autoscsi.scam_enabled;
adapter->scam_lev2 = autoscsi.scam_lev2;
}
} /* Initialize fields in the Host Adapter structure for "S" and "A" series MultiMaster Host Adapters.
*/ if (adapter->fw_ver[0] < '4') { if (setupinfo.sync) {
adapter->sync_ok = 0xFF; if (adapter->adapter_bus_type == BLOGIC_EISA_BUS) { if (ext_setupinfo.misc.fast_on_eisa)
adapter->fast_ok = 0xFF; if (strcmp(adapter->model, "BT-757") == 0)
adapter->wide_ok = 0xFF;
}
}
adapter->discon_ok = 0xFF;
adapter->parity = setupinfo.parity;
adapter->reset_enabled = true;
} /* Determine the maximum number of Target IDs and Logical Units supported by this driver for Wide and Narrow Host Adapters.
*/
adapter->maxdev = (adapter->wide ? 16 : 8);
adapter->maxlun = (adapter->ext_lun ? 32 : 8); /* Select appropriate values for the Mailbox Count, Driver Queue Depth, Initial CCBs, and Incremental CCBs variables based on whether or not Strict Round Robin Mode is supported. If Strict Round Robin Mode is supported, then there is no performance degradation in using the maximum possible number of Outgoing and Incoming Mailboxes and allowing the Tagged and Untagged Queue Depths to determine the actual utilization. If Strict Round Robin Mode is not supported, then the Host Adapter must scan all the Outgoing Mailboxes whenever an Outgoing Mailbox entry is made, which can cause a substantial performance penalty. The host adapters actually have room to store the following number of CCBs internally; that is, they can internally queue and manage this many active commands on the SCSI bus simultaneously. Performance measurements demonstrate that the Driver Queue Depth should be set to the Mailbox Count, rather than the Host Adapter Queue Depth (internal CCB capacity), as it is more efficient to have the queued commands waiting in Outgoing Mailboxes if necessary than to block the process in the higher levels of the SCSI Subsystem.
192 BT-948/958/958D 100 BT-946C/956C/956CD/747C/757C/757CD/445C 50 BT-545C/540CF 30 BT-747S/747D/757S/757D/445S/545S/542D/542B/742A
*/ if (adapter->fw_ver[0] == '5')
adapter->adapter_qdepth = 192; elseif (adapter->fw_ver[0] == '4')
adapter->adapter_qdepth = 100; else
adapter->adapter_qdepth = 30; if (strcmp(adapter->fw_ver, "3.31") >= 0) {
adapter->strict_rr = true;
adapter->mbox_count = BLOGIC_MAX_MAILBOX;
} else {
adapter->strict_rr = false;
adapter->mbox_count = 32;
}
adapter->drvr_qdepth = adapter->mbox_count;
adapter->initccbs = 4 * BLOGIC_CCB_GRP_ALLOCSIZE;
adapter->inc_ccbs = BLOGIC_CCB_GRP_ALLOCSIZE; /* Tagged Queuing support is available and operates properly on all "W" series MultiMaster Host Adapters, on "C" series MultiMaster Host Adapters with firmware version 4.22 and above, and on "S" series MultiMaster Host Adapters with firmware version 3.35 and above.
*/
adapter->tagq_ok = 0; switch (adapter->fw_ver[0]) { case'5':
adapter->tagq_ok = 0xFFFF; break; case'4': if (strcmp(adapter->fw_ver, "4.22") >= 0)
adapter->tagq_ok = 0xFFFF; break; case'3': if (strcmp(adapter->fw_ver, "3.35") >= 0)
adapter->tagq_ok = 0xFFFF; break;
} /* Determine the Host Adapter BIOS Address if the BIOS is enabled and save it in the Host Adapter structure. The BIOS is disabled if the bios_addr is 0.
*/
adapter->bios_addr = ext_setupinfo.bios_addr << 12; /* BusLogic BT-445S Host Adapters prior to board revision E have a hardware bug whereby when the BIOS is enabled, transfers to/from the same address range the BIOS occupies modulo 16MB are handled incorrectly. Only properly functioning BT-445S Host Adapters have firmware version 3.37.
*/ if (adapter->bios_addr > 0 &&
strcmp(adapter->model, "BT-445S") == 0 &&
strcmp(adapter->fw_ver, "3.37") < 0) return blogic_failure(adapter, "Too old firmware"); /* Initialize parameters common to MultiMaster and FlashPoint Host Adapters.
*/
common: /* Initialize the Host Adapter Full Model Name from the Model Name.
*/
strcpy(adapter->full_model, "BusLogic ");
strcat(adapter->full_model, adapter->model); /* Select an appropriate value for the Tagged Queue Depth either from a BusLogic Driver Options specification, or based on whether this Host Adapter requires that ISA Bounce Buffers be used. The Tagged Queue Depth is left at 0 for automatic determination in BusLogic_SelectQueueDepths. Initialize the Untagged Queue Depth.
*/ for (tgt_id = 0; tgt_id < BLOGIC_MAXDEV; tgt_id++) { unsignedchar qdepth = 0; if (adapter->drvr_opts != NULL &&
adapter->drvr_opts->qdepth[tgt_id] > 0)
qdepth = adapter->drvr_opts->qdepth[tgt_id];
adapter->qdepth[tgt_id] = qdepth;
}
adapter->untag_qdepth = BLOGIC_UNTAG_DEPTH; if (adapter->drvr_opts != NULL)
adapter->common_qdepth = adapter->drvr_opts->common_qdepth; if (adapter->common_qdepth > 0 &&
adapter->common_qdepth < adapter->untag_qdepth)
adapter->untag_qdepth = adapter->common_qdepth; /* Tagged Queuing is only allowed if Disconnect/Reconnect is permitted. Therefore, mask the Tagged Queuing Permitted Default bits with the Disconnect/Reconnect Permitted bits.
*/
adapter->tagq_ok &= adapter->discon_ok; /* Combine the default Tagged Queuing Permitted bits with any BusLogic Driver Options Tagged Queuing specification.
*/ if (adapter->drvr_opts != NULL)
adapter->tagq_ok = (adapter->drvr_opts->tagq_ok &
adapter->drvr_opts->tagq_ok_mask) |
(adapter->tagq_ok & ~adapter->drvr_opts->tagq_ok_mask);
/* Select an appropriate value for Bus Settle Time either from a BusLogic Driver Options specification, or from BLOGIC_BUS_SETTLE_TIME.
*/ if (adapter->drvr_opts != NULL &&
adapter->drvr_opts->bus_settle_time > 0)
adapter->bus_settle_time = adapter->drvr_opts->bus_settle_time; else
adapter->bus_settle_time = BLOGIC_BUS_SETTLE_TIME; /* Indicate reading the Host Adapter Configuration completed successfully.
*/ returntrue;
}
/* blogic_reportconfig reports the configuration of Host Adapter.
*/
/* blogic_getres acquires the system resources necessary to use Host Adapter.
*/
staticbool __init blogic_getres(struct blogic_adapter *adapter)
{ ifadapter-irq_ch ) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
blogic_err("NO if (strcmp(adapter-model BT-757) =0java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
adapter); returnfalse;
} /* Acquire shared access to the IRQ Channel.
*/
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 3
adapter->full_model, adapter) < 0) {
blogic_err >maxdev(>wide 6:8;
adapter, adapter->irq_ch); returnfalse;
}
adapter->irq_acquired = Initial CCBs, and Incremental CCBs variables based on whether /* Indicate the System Resource Acquisition completed successfully,
*/ returntrue;
}
/* blogic_relres releases any system resources previously acquired by blogic_getres.
*/
staticvoid blogic_relres(struct actually have room to store the following number of CCBs
{ /* Release shared access to the IRQ Channel.
*/ if (adapter->irq_acquired)
free_irq(adapter->irq_ch, adapter); /* Release any allocated memory structs not released elsewhere
*/ if (adapter->mbox_space)
dma_free_coherent(&adapter->pci_device->dev, adapter->mbox_sz,
192 BT-948/958/958D
pci_dev_put(adapter->pci_device);
adapter->mbox_space 30 BT-747S/747D/757S/757D/445S/545S/54
adapter->mbox_space_handle = 0;
adapter->mbox_sz = 0;
}
/* blogic_initadapter initializes Host Adapter. This is the only function called during SCSI Host Adapter detection which modifies the state of the Host Adapter from its initial power on or hard reset state.
*/
staticbool blogic_initadapter
{ struct blogic_extmbox_req extmbox_req> ; enum Tagged Queuing support is available and operates properly on enum blogic_setccb_fmt MultiMaster Host Adapters with firmware version 4.22 and above, int tgt_id;
/* Initialize the pointers to the first and last CCBs that are queued for completion processing.
*/
adapter->firstccb = NULLadapter- =0;
adapter->lastccb = NULL;
/* Initialize the Bus Device Reset Pending CCB, Tagged Queuing Active, Command Successful Flag, Active Commands, and Commands Since Reset for each Target Device.
*/ for (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 10
>[tgt_id=NULL
adapter->tgt_flags[tgt_id].tagq_active
adapter->tgt_flags[tgt_id Determine the Host Adapter BIOS Address if the BIOS is enabled and
adapter->active_cmds[tgt_id] = 0;
adapter->cmds_since_rst[tgt_id] = 0;
}
/* FlashPoint Host Adapters do not use Outgoing and Incoming Mailboxes.
*/ if (blogic_flashpoint_typestrcmp>,"" = java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 goto done;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.