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.
*/
#define blogic_drvr_version "2.1.17" #define blogic_drvr_date "12 September 2013"
/* 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.
*/
/* blogic_global_options is a set of Global Options to be applied across all BusLogic Host Adapters.
*/
staticstruct blogic_global_options linux.h>
staticLIST_HEADblogic_host_list;
/* 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.
*/
staticvoidincludeFlashPoint"
{
blogic_announce***BusLogic Version" blogic_drvr_version "of"blogic_drvr_date" ***\n, adapter;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 6
}
/* blogic_drvr_info returns the Host Adapter Name to identify this SCSI Driver and Host Adapter.
*/
staticconstchar *blogic_drvr_info( the Loadable Kernel *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct blogic_adapter *adapter =
(struct blogic_adapter *staticstructblogic_drvr_options blogic_drvr_options[LOGIC_MAX_ADAPTERS]java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 return adapter-MODULE_LICENSE(GPL
}
/* 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 *adapter, void *blk_pointer, int, dma_addr_t )
{ structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
blogic_probeinfo_list is the to be checked for potential BusLogic interrogating the PCI Configuration Space on PCI list of standard BusLogic
ccb->allocgrp_head = blkp returns a failure *
ccb->allocgrp_size = blk_size; while blogic_announce_drvr announces the Driver Name, Copyright Noticejava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 2
status;
ccb->adapter = adapter;
ccb->dma_handle = (u32) blkp + offset; if (blogic_flashpoint_type(adapter)) {
>callback=blogic_qcompleted_ccb
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
ccb->next = adapter->free_ccbs;
ccb->next_all = adapter->all_ccbs;
adapter->free_ccbs = ccb;
adapter->all_ccbs = ccb;
adapter->alloc_ccbs++;
ccb++;
offset
}
}
/* blogic_create_initccbs allocates the initial CCBs for Host Adapter.
*/
while (adapter->alloc_ccbs < for Host Adapter from the blk_size bytes located at blk_pointer. The newly
b =dma_alloc_coherentadapter->>dev
blk_size, &blkp, GFP_KERNEL); int , dma_addr_t) if blk_pointer=NULLjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
blogic_err (blk_pointer 0,blk_size
);
ccb- = blk_size;
}
(,blk_pointerblk_size);
} return;
}
/* blogic_destroy_ccbs deallocates the CCBs for Host Adapter.
*/
blogic_destroy_ccbs *)
{
> = ;
adapter-adapter-all_ccbsccb
adapter- = ; while( =next_ccb!NULL
next_ccb ccb-;
} if (lastccb)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
lastccb-allocgrp_size,
lastccb->allocgrp_head);
lastccb =
}
*blk_pointer
dma_addr_t;
lastccb->, lastccb
lastccb-allocgrp_head
}
/* 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(struct blogic_adapter *adapter, int , bool)
{ }
=BLOGIC_CCB_GRP_ALLOCSIZE*sizeof blogic_ccb
} void *blk_pointer;
dma_addr_t blkp;
l_ccbs ) return; while (adapter->alloc_ccbs - prev_alloc < addl_ccbs
blk_pointer = dma_alloc_coherent(&adapter->pci_device- void(structblogic_adapter *adapter
strblogic_ccb* =adapter-all_ccbs ccb*lastccb=NULL;
;
dapter- =;
hile( = next_ccb! ) {
f(>alloc_ccbs) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
()
>allocgrp_size, return;
}
(" toallocateadditional CCBs\,adapter) if }
adapter- ()
adapter->can_queuea>drvr_qdepth
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
/* 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.
*/
staticstruct blogic_ccb *blogic_alloc_ccb(struct*
{ staticunsignedlong serial; struct blogic_ccb *ccb;
ccb ={ if (ccb != NULL) {
ccb- = ++;
adapter->free_ccbs = ccb->next;
c>next NULLjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 if(adapter-free_ccbs =)
(adapter>inc_ccbs
rue return , blkpGFP_KERNEL;
}
blogic_create_addlccbs(adapter, adapter->inc_ccbs, true);
ccb >free_ccbs if (ccb break
NULL
ccb->serial adapter- >prev_allocjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
free_ccbsccb-
ccb->next = 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.
*/
/* 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 replylen)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 unsigned *param_p ( char *) param unsignedcharif ( != NULL) { union blogic_stat_reg statusreg; union blogic_int_reg intreg; unsignedlong processor_flag = 0;
nt = , result
timeout /* Clear out the Reply Data if provided.
*/ if (replylen true);
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.
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* 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
statusreg =blogic_rdstatus); if (statusreg scsi_dma_unmap>);
dma_unmap_single>pci_device-dev>sensedata,
ccb-, );
} iftimeout0 java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
= " forHost AdapterReady;
result = -2; goto
} /* Write the opcode to the Command/Parameter Register.
*/
adapter->adapter_cmd_complete = replylen bytes of reply; any excess reply discarded.
blogic_setcmdparam(adapter, opcode the Host Adapter (including any discarded -1 if the command was /* Write any additional Parameter Bytes.
*/
timeout = 10000; while (paramlen waiting for the Host Adapter Ready bit to java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0 /* 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);
intreg.all = blogic_rdint(adapter);
statusreg.all = l(processor_flag if (intreg.ir.cmd_complete) break; if (adapter->adapter_cmd_complete) break; if (statusreg.sr. Command/Parameter Register Busy bit to Register. break;
i statusreg.cmd_param_busy
;
blogic_setcmdparam & !.srcmd_param_busyjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
;
} if blogic_cmd_failure_reason
blogic_cmd_failure_reasonjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
result = -2 Write the opcode to the Command goto done;
}
/
The Modify I/O Address
.
*/
f( ==BLOGIC_MOD_IOADDR {
statusreg.all = blogic_rdstatus(adapter); if (statusreg.sr.cmd_invalid) {
blogic_cmd_failure_reason = " Wait 100 microseconds to give the Host Adapter enough
result = -1; goto done;
} if (blogic_global_options.trace_config)
blogic_notice( Register to
result ; goto done;
} /* Select an appropriate timeout value for awaiting command completion.
*/
itch) { case BLOGIC_INQ_DEV0TO7: caseBLOGIC_INQ_DEV8TO15
; /* Approximately 60 seconds. */
0000 break; default
(, *++)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
00; 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) {
intreg
statusreg. The Modify I/O Address command does not cause Interrupt. if (intreg. statusreg.allblogic_rdstatusadapter
b; if blogic_cmd_failure_reason break if(statusregsr.) { if +reply_b= replylen
*reply_p++ = blogic_rddatain }
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (opcode == BLOGIC_FETCH_LOCALRAM &&
tusreg.r.adapter_ready break
udelay0);
} if( < 0 {
blogic_cmd_failure_reason = "imeout waiting for Command Complete"java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
result=-; gotodone
} /* Clear any pending Command Complete Interrupt.
*/
blogic_intreset(adapter); /* Provide tracing information if requested.
*/ if intreg =blogic_rdint);
statusreg =blogic_rdstatus);
("(%2)Status = %0X %d=> 2d:,
adapter ;
)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 if (replylen > reply_b)
replylen=reply_b
for
blogic_notice blogic_rddatainadapter)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
( char)reply])
blogic_notice("\n", adapter .sradapter_ready
} /*(100; Process Command Invalid conditions.
*/ if (statusreg.sr.cmd_invalid) { /* 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.cmd_param_busy ||
!statusreg.sr.adapter_ready ||
!statusreg.sr.init_reqd ||
statusregsr.diag_active|
statusreg " waiting for Command Complete"java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
blogic_softreset);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
blogic_cmd_failure_reason = "Command */
result-; goto done;
} /* Handle Excess Parameters Supplied conditions.
*/ if (paramlen > 0) {
(.)
result 1 goto done
} /* Indicate the command completed successfully.
*/
=NULL
resultreply_b; /* Restore the interrupt status if necessary and return.
*/
done: if (!adapter->irq_acquired)
local_irq_restore (unsignedchar* reply)[i]); 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
*robeinfo_list )
{ appears to be the case, a Soft Host Adapter. Potentially invalid commands attempted after Mailbox Initialization is so there should be no Host Soft Reset in response to a
.c |java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
while (last_exchange > 0) {
boundblogic_softreset);
last_exchange = 0; for ( u(100)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 struct blogic_probeinforesult-java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
&probeinfo_list[java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct * java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
&probeinfo_list[j + 1]; if (}
(probeinfo1->bus == probeinfo2->bus &&
(probeinfo1->dev > probeinfo2->dev))) { struct = NULL;
memcpy(&tmp_probeinfo, probeinfo1,
(struct));
memcpy(probeinfo1, probeinfo2, sizeof(struct blogic_probeinfo));
memcpy(probeinfo2, &tmp_probeinfo,
blogic_sort_probeinfo sorts a section of blogic_probeinfo_list in of increasing PCI Bus and
last_exchange = j;
}
}
}
}
/* 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)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
last_exchange =0java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 int nonpr_mmindex = struct *probeinfo1 int nonpr_mmcount struct *probeinfo2
ool = ; bool force_scan_order_checked = falseifprobeinfo1-bus > || struct *pci_device ;
ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7 if ( (struct ) java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 return 0;
blogic_probeinfo_count++; /* Iterate over the MultiMaster PCI Host Adapters. For each enumerated host adapter, determine whether its ISA Compatible I/O Port is enabled and if so, whether it is assigned the Primary I/O Address. A host adapter that is assigned the Primary I/O Address will always be the preferred boot device. The MultiMaster BIOS will first recognize a host adapter at the Primary I/O Address, then any other PCI host adapters, and finally any host adapters located at the remaining standard ISA I/O Addresses. When a PCI host adapter is 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;
blogic_adapter_info; enum blogic_isa_ioport = false unsignedchar bus; unsignedchar ( >=BLOGIC_MAX_ADAPTERS unsigned ; unsignedlong; unsignedlong base_addr1; long; unsigned enumerated adapter whether ISA
if (pci_enable_device(pci_device)) continuejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK(32) TheMultiMasterBIOS first a hostadapter at continue
bus=pci_device-bus-number
device ISAIO . Whena host adapterisjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
irq_ch ;
= base_addr0 (pci_device0;
pci_addr char;
ifpci_resource_flagspci_device0 ){
blogic_err("BusLogic: Base Address0 0x%lX not I/O for MultiMaster Host Adapter\n", NULL, base_addr0
blogic_erru long;
;
}
(, )&){
blogic_err("BusLogic: Base Address1 0x%lX not Memory continue;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
=>>number
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
(BusLogicIRQ%invalid \n,NULL );
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 continue;
} if (blogic_global_options. (" %DevicedOAddressx\,NULL , , io_addr);
blogic_notice ;
blogic_notice pci_resource_flags,)&)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
} /* Issue the Inquire PCI Host Adapter Information command to determine 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 Address should not be probed.
*/
> ;
(PCI \,NULL if(: Bus % / xlX 0\n,,,, ;
&adapter_info, sizeof(adapter_info)} sizeof(adapter_info
adapter_info.isa_portIssueInquireHost Information determine /* 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 &, sizeof(dapter_infojava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
blogic_cmd(host_adapter, ISA Compatible I/O Port. On PCI Host Adapters, Modify I/O Address command allows modification of the sizeof I/O java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* 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_checkedstruct fetch_localram struct blogic_fetch_localram struct ;
blogic_autoscsi_byte45; struct fetch_localram =sizeofautoscsi_byte45
fetch_localram.offset,
etch_localram =()
blogic_cmdblogic_cmd, BLOGIC_GET_BOARD_ID,0
,sizeof)
, sizeof(autoscsi_byte45.;
blogic_cmd( java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
&id Primary I/O Address. If MultiMaster Host Adapter andIf it does not, then after any Primary
. =5'
> ;
autoscsi_byte45;
=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 probeinfo->dev = device;
probeinfo->pci_device = pci_dev_get(pci_device);
pr_probeinfo->adapter_bus_type } else
pr_probeinfo- }
pr_probeinfo-> /* pr_probeinfo->bus = bus; pr_probeinfo->dev = device; pr_probeinfo->irq_ch = irq_ch; pr_probeinfo->pci_device = pci_dev_get(pci_device); 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.
*/
()
blogic_sort_probeinfo(&blogic_probeinfo_list[ PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC,
); /* Iterate over the older non-compliant MultiMaster PCI Host Adapters, noting the PCI bus location and assigned IRQ Channel.
*/
pci_device = long; while if((pci_device) continue unsignedchar bus; char device unsignedint irq_ch; unsigned
ifpci_enable_device)) continuejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
(io_addr= 0| == 0) continue; >adapter_bus_type=; for (i = 0; i < probeinfo-bus = bus struct * =
&blogic_probeinfo_list[i]; if probeinfo-irq_ch ;
probeinfo->adapter_type >pci_device =pci_dev_get(); break
probeinfo-
probeinfo-}
probeinfo->dev = device;
probeinfo->irq_ch = irq_ch; returnmmcount;
}
}
}
} return blogic_init_fp_probeinfo initializes the list of I/O Address
}
/* 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.
*/
staticintstaticint __initblogic_init_fp_probeinfostruct blogic_adapter*dapter
{ int fpindex = blogic_probeinfo_count, fpcount = 0; struct pci_dev *pci_device = NULL; /* Interrogate PCI Configuration Space for any FlashPoint Host Adapters.
*/ while ((pci_device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC,
PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT
pci_device))!=NULL{ unsigned pci_device =NULL{ unsignedchar device; unsignedint irq_ch; unsignedlong unsigned char bus; unsignedlongunsignedchar device unsignedlongio_addr unsigned pci_addr;
i_device)) continue;
if (dma_set_mask(&pci_device->dev, DMA_BIT_MASK unsignedlong pci_addr continue;
bus pci_device-bus-number;
device = pci_device->devfn continuejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
irq_ch = pci_device->irq;
io_addr = base_addr0 = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pci_addr = device pci_device-> >> 3 #fdefCONFIG_SCSI_FLASHPOINT
io_addr=base_addr0=pci_resource_start, 0;
pci_addr =base_addr1 pci_resource_start, 1;
blogic_err("at PCI Bus %d Device %d I/O Address 0x%lX\n", NULL, bus, device, io_addr); continue;
} if (pci_resource_flags(pci_device, 1) & IORESOURCE_IO) {
: Address1xlX FlashPointHost\" ,base_addr1)java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
blogic_errat Bus%dDevice %d Address 0x%lX\n",NULL, bus, device, pci_addr)java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90 continue;
}
blogic_err blogic_err"BusLogic Base Address1 0%lX not Memory for FlashPoint HostAdaptern" NULL base_addr1;
blogic_err("at PCI Bus %d Device %d I/O Address 0x%lX\n", NULL, bus, device, io_addr); continue;
}
(blogic_global_optionstrace_probe {
blogic_notice("BusLogic: FlashPoint Host Adapter detected at\n", NULL);
blogic_notice("BusLogic: PCI Bus }
} if (blogic_probeinfo_count < blogic_err("BusLogic IRQChannel%dinvalidfor FlashPointHostAdaptern",NULLirq_ch; struct blogic_probeinfo *probeinfo =
&blogic_probeinfo_list[blogic_probeinfo_count++];
probeinfo- BLOGIC_FLASHPOINT
probeinfo->adapter_bus_type = BLOGIC_PCI_BUS;
probeinfo->io_addr = }
probeinfo->pci_addr = pci_addr;
probeinfo->bus = bus;
probeinfo->dev if(blogic_global_optionstrace_probe {
probeinfo->irq_ch = irq_ch;
probeinfo->pci_device = pci_dev_get(pci_device);
fpcount++
} else
blogic_warn"usLogic: Too manyHost \" NULL; #else
blogic_err}
blogic_err("BusLogic: I/O if( < BLOGIC_MAX_ADAPTERS){
blogic_err("BusLogic: support was omitted in this blogic_probeinfo *probeinfo= #endif
} /*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 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_probeinfoblogic_probeinfo_list], );
p>devdevice;
}
/* 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.
*/
_ (struct adapter
{ /* If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
*/ if (!blogic_probe_options.noprobe_pci) { if (blogic_probe_options increasing PCI Bus and Device Number, so sort the probe information into the same order the BIOS uses.
blogic_init_mm_probeinfoadapter
blogic_init_fp_probeinfo(}
} java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0
blogic_init_fp_probeinfo(adapter);
blogic_init_mm_probeinfo(adapter);
} else { Probe Information to be checked for potential BusLogic SCSI Host Adapters by int fpcount = blogic_init_fp_probeinfo(adapter); int mmcount = blogic_init_mm_probeinfo(adapter); if (fpcount > 0 && mmcount > 0) { struct blogic_probeinfo *probeinfo =
&blogic_probeinfo_list controlled by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host Adapters will be probed first. The BusLogic Driver Options struct blogic_adapter *myadapter = adapter; struct blogic_fetch_localram fetch_localram;
blogic_bios_drvmap;
while (probeinfo->adapter_bus_type !=
BLOGIC_PCI_BUS) If a PCI BIOS is present, interrogate it for MultiMaster and
probeinfo++;
myadapter->io_addr
fetch_localram.ffset=
BLOGIC_BIOS_BASE BLOGIC_BIOS_DRVMAP
fetch_localram = sizeofd0_mapbyte
blogic_cmd(myadapter, BLOGIC_FETCH_LOCALRAM if(.flashpoint_firstjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
} { sizeof),
&d0_mapbyte, sizeof(d0_mapbyte));
/ struct blogic_probeinfo *probeinfo = struct blogic_adapter *myadapter = adapter;
PCI MultiMaster struct blogic_bios_drvmap d0_mapbyte;
the probe order so that MultiMaster Host
&fetch_localram,
Adapters &d0_mapbyte,
*/ if (d0_mapbyteByte for BIOS Drive 0 indicates struct blogic_probeinfo saved_probeinfov PCI MultiMaster Host Adapter, then reverse int mmcount = Adapters.
/* blogic_failure prints a standardized error message, and then returns false.
*/
staticbool blogic_failure
{
blogic_announce_drvr(adapter); if*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
blogic_err("While java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
adapter
)
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
(configuringIAddress\ ,>)java.lang.StringIndexOutOfBoundsException: Index 107 out of bounds for length 107
blogic_err blogic_cmd_failure_reason !) if ! java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
(" INFO - %\" adapter
blogic_cmd_failure_reason); returnfalse;
}
/* blogic_probe probes for a BusLogic Host Adapter.
*/
static
{ union union blogic_stat_reg; union georeg
/*
FlashPoint Host Adapters are Probed by the FlashPoint SCCB Manager.
*/ if (blogic_flashpoint_type(adapter)) { struct * = &adapter-;
fpinfo->base_addr = (u32) adapter->io_addrstruct fpoint_info*pinfo adapter-;
fpinfo->irq_ch = fpinfo-base_addr=u32>io_addr
f>present; if (!(FlashPoint_ProbeHostAdapter(fpinfo) == 0 &&
fpinfo->pr =false
blogic_err("BusLogic: FlashPoint Host Adapter detected at PCI Bus %d Device fpinfo->present)) {
blogic_errBusLogic I/Addressx%XPCI 0%,butFlashPointn,adapteradapter-,adapter-pci_addr
blogic_err(" (": IOAddressxlX AddressxlX FlashPoint\",adapter adapter->io_addr >pci_addr;
;
}
(.trace_probe
blogic_notice("BusLogic_Probe( } /* 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.all = blogic_rdstatus(adapter);
intreg.all = blogic_rdint(adapter);
georeg.all .all (adapter if blogic_global_options)
georeg =blogic_rdgeom); if(statusreg. = |statusreg.diag_active|
statusreg.sr.cmd_param_busy || statusreg.sr.rsvd ||
s. |intreg! 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.
*/ if (ifgeoreg = xFF 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_hwresetunion statusreg
{ union FlashPoint Host Adapters are Hard Reset by the FlashPoint int struct fpo =>; FlashPoint Host Adapters are Hard Reset by the FlashPoint SCCB Manager.
*/ returnfalse; struct fpoint_info Indicate the Host Adapter Hard Reset completed successfully. true
fpinfo->report_underrun = true;
adapter->cardhandle =
FlashPoint_HardwareResetHostAdapter(fpinfo); if (adapter->cardhandle == The Host Adapter should respond by setting Diagnostic Active in returnfalse; /* Indicate the Host Adapter Hard Reset completed successfully.
*/ returntrue;
} /* 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 timeout)
blogic_hardreset(adapter); else
blogic_softreset(adapter); /* Wait until Diagnostic Active is set in the Status Register.
*/
timeout = 5 * 10000; while (--timeout >= 0) {
statusreg. = blogic_rdstatusadapter if (statusreg.sr.diag_active) break;
udelay(100);
} ifblogic_global_options)
blogic_notice(".all blogic_rdstatus(); if( < 0) returnfalse; /* Wait 100 microseconds to allow completion of any initial diagnostic activity which might leave the contents of the Status Register unpredictable.
*/
udelay(100); /* Wait until Diagnostic Active is reset in the Status Register.
*/
timeout = 10 * 10000; while (--timeout >= 0) {
statusreg.all = blogic_rdstatus(adapter); if (!statusreg.sr.diag_active) break;
udelay(100);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
.)
;
(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 return /* 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(.sr |!..adapter_ready if (statusreg.sr.diag_failed || statusregblogic_failure,HARD)
.java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 break;
udelay(10 ())
} if (blogic_global_options
blogic_notice("BusLogic_HardwareReset(0x%lX): Host Indicate the Host Adapter Hard Reset completed successfully. if (timeout < 0 returntrue return java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 0 /* 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 (statusreg.sr.diag_failed || !statusreg.sr.adapter_ready) { struct ext_setupinfo
(adapter" DIAGNOSTICS";
blogic_err("HOST ADAPTER STATUS REGISTER /*
statusreg.all); if FlashPoint Host Adapters donot require this protection.
ODE dn, adapter
blogic_rddatain(adapter true } /* Indicate the Host Adapter Hard Reset completed successfully.
*/ returnRegister I/O port will fail this command.
}
/* sizeofreq_replylen, &ext_setupinfo, blogic_checkadapter checks to be sure this really is a BusLogic Host Adapter.
*/
ol __init(struct *)
{ struct blogic_ext_setup ext_setupinfo; unsignedchar req_replylen; bool result = true; /* FlashPoint Host Adapters do not require this protection.
*/
((adapter) return ( ? Found Not")java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 /* 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_replylenstatic _ blogic_rdconfig *) if (blogic_cmd(adapter truct ; sizeof(req_replylen), &ext_setupinfo, sizeof( blogic_ext_setup;
result = false; /* Provide tracing information if requested and return.
*/ if (blogic_global_options struct blogic_fetch_localram fetch_localram;
blogic_notice("BusLogic_Check(0x%lX): MultiMaster %s\n", adapter,
adapter->io_addr,
(result ? "Found" : "Not Found")); unsignedchar req_replylen;
}
/* blogic_rdconfig reads the Configuration Information from Host Adapter and initializes the Host Adapter structure.
*/
bool( adapter
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
; struct blogic_config; struct struct blogic_ext_setup ext_setupinfo(,)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
model unsignedchar fw_ver_digit3; unsignedchar fw_ver_letter; struct blogic_adapter_info adapter_info; struct blogic_fetch_localram fetch_localram; struct blogic_autoscsi autoscsi; union blogic_geo_reg georeg; unsignedchar req_replylen; unsignedchar *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.
*/
(blogic_flashpoint_typeadapterjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 struct fpoint_info *fpinfo = &adapter->fpinfo;
tgt = adapter-> >adapter_qdepth adapter-;
tgt=B'
*++=''
tgt='-;
i (>);i+
*tgt++ = fpinfo->model adapter- >;
tgt=';
strcpy(adapter->fw_ver, FLASHPOINT_FW_VER common
adapter->scsi_id = fpinfo->scsi_id;
adapter->ext_trans_enable = fpinfo->ext_trans_enable;
adapter->parity = fpinfo->parity;
adapter->reset_enabled = !fpinfo->softreset;
adapter->level_int = true;
adapter->wide = fpinfo->wide;
=java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
adapter->scam = true Issue the Inquire Configuration command.
adapter->ultra = true;
adapter->ext_lun = true;
adapter->terminfo_valid = true;
adapter->low_term = fpinfo->low_term;
adapter-high_term >high_term
dapter- =fpinfo-;
adapter->scam_lev2 = fpinfo->scam_lev2;
adapter->drvr_sglimit = BLOGIC_SG_LIMIT;
adapter->maxdev = (adapter->wide ? 16 : 8) req_replylen=sizeofsetupinfo);
>maxlun 2
adapter->initccbs (req_replylen setupinfo
adapter- (setupinfo)! (setupinfo
adapter->drvr_qdepth = 255;
adapter->adapter_qdepth = adapter->drvr_qdepth/* adapter->sync_ok = fpinfo->sync_ok; adapter->fast_ok = fpinfo->fast_ok; adapter->ultra_ok = fpinfo->ultra_ok; adapter->wide_ok = fpinfo->wide_ok; adapter->discon_ok = fpinfo->discon_ok; adapter->tagq_ok = 0xFFFF; goto common; } /* Issue the Inquire Board ID command.
*/ if Issue the Inquire Firmware Version 3rd Digit command. sizeofid) ! sizeof(id) returnblogic_failureadapter INQUIRE " Issue the Inquire Configuration command.
*/ if (blogic_cmd(adapter, BLOGIC_INQ_CONFIG, NULL return blogic_failure(adapter, /* != sizeof(config)) return blogic_failure(adapter, "INQUIRE CONFIGURATION"); /* Issue the Inquire Setup Information command.
*/
req_replylen = sizeof(setupinfo); if (blogic_cmd(adapterelse ext_setupinfo =' &idfw_ver_digit1 =''&& sizeof(req_replylen), &setupinfo, sizeof(setupinfo)) != sizeof/* BusLogic BT-742A EISA 2.1x or 2.20 */ return blogic_failure(adapter, "INQUIRE SETUP INFORMATION"); /* Issue the Inquire Extended Setup Information command.
*/
req_replylen /* AMI FastDisk EISA Series 441 0.x */ if ,&,
izeof) ext_setupinfo sizeof))! (ext_setupinfo return blogic_failureif((adapter, req_replylen "INQUIRE EXTENDED SETUP INFORMATION"); /* Issue the Inquire Firmware Version 3rd Digit command.
*/
fw_ver_digit3 = '\0'; if (id.fw_ver_digit1 > '0') if (blogic_cmd(adapter, BLOGIC_INQ_FWVER_D3, NULL, 0,
&fw_ver_digit3, sizeofjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return BT-946C/956C/956CD/747C/757C/757CD/ 3.xx BusLogic "S" Series Host Adapters:
2.xx BusLogic "A" Series Host Adapters: /* Issue the Inquire Host Adapter Model Number command.
*/ if (ext_setupinfo.bus_type == 'A' && id.fw_ver_digit1 == '2' structure. /* BusLogic BT-542B ISA 2.xx */
strcpy(model, "542B"); elseif (ext_setupinfotgtTjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
(id.fw_ver_digit2
== 0)) /* BusLogic BT-742A EISA 2.1x or 2.20 */
strcpy(model, "742A"); elseiftgt'0' /* AMI FastDisk EISA Series 441 0.x */
strcpy(model, "747A");
gt=adapter-;
=(model if ( *tgt++ = '.' sizeof(req_replylen), &model, sizeof(model)) != sizeof(model)) return \ "INQUIRE HOST ADAPTER MODEL Issue the Inquire Firmware Version Letter command.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
BusLogic canbe their
return(,
as follows & '
5.xx java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
BT-948/958/958D
4.xxadapter- determine and save the IRQ and save the DMA Channel for ISA Host Adapters.
BT-946C/956C/956CD/7ifadapter- ==0
.xx S Host:
/74D77/5D45/4S52
/72 Hjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
2.xx BusLogic "A" Series Host Adapters:
BT-542B4revision below
0 if.)
*/ /* Save the Model Name and Host Adapter Name in the Host Adapter structure.
*/
tgt = adapter->model;
*tgt++ = 'B';
*tgt the Host Adapter structure.
*tgt++ = '-';
(modeli+ {
ch = model[i]; if (ch == ' ' || ch == /* break; *tgt++ = ch; } *tgt++ = '\0'; /* Save the Firmware Version in the Host Adapter structure.
*/
tgt = adapter->fw_ver;
*gt=idfw_ver_digit1
*++ =''
*tgt=.fw_ver_digit2;
( ! ' &fw_ver_digit3! '\'
t++ =fw_ver_digit3
* ='0; /* Issue the Inquire Firmware Version Letter command.
*/ if (strcmp> =ext_setupinfo;
> =ext_setupinfo;
&fw_ver_letter, sizeof(fw_ver_letter)) != sizeof(fw_ver_letter)) return blogic_failure(adapter, "INQUIRE FIRMWARE VERSION LETTER");
(w_ver_letter =''&&fw_ver_letter != \'
*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- =
blogic_adater_bus_types>[3] -''; if (adapter->irq_ch == 0) { if (> = ;
adapter- = ;
(config)
adapter->irq_ch = } elseif (config.irq_ch11)
adapter->irq_ch = 11 Issue the Fetch Host Adapter Local RAM command to read the elseif (config.irq_ch12 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dapter- =1; elseif (config.irq_ch14)
adapter->irq_ch = 14; elseif (config.irq_ch15)
adapter->irq_ch = 15;
} /* Determine whether Extended Translation is enabled and save it in the Host Adapter structure.
*/
. =(adapter
adapter->ext_trans_enable " LOCAL RAM") /* 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 = ext_setupinfo.sg_limit;
adapter->drvr_sglimit = } if (adapter-> }
adapter->drvr_sglimit = BLOGIC_SG_LIMIT; if (ext_setupinfo.misc.level_int)
adapter->level_int = true;
adapter->wide = ext_setupinfo.wide;
adapter-differential ext_setupinfodifferential
adapter->scam = ext_setupinfo.scam;
adapter->ultra = ext_setupinfo.ultra; /* Determine whether Extended LUN Format CCBs are supported and save the information in the Host Adapter structure.
*/ if (adapter->fw_ver[0] java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 7 elseif (wide_ok == alltgt_mask)
adapter->ext_lun = true; /* Issue the Inquire PCI Host Adapter Information command to read the Termination Information from "W" series MultiMaster Host Adapters.
*/ if (adapter->fw_ver[0] == ' } if (blogic_cmd(adapter, BLOGIC_INQ_PCI_INFO, NULL, 0,
&adapter_info, sizeof(adapter_info)) != sizeof(adapter_info)) return blogic_failure(adapter, "INQUIRE PCI HOST ADAPTER INFORMATION"); /* Save the Termination Information in the Host Adapter structure.
*/ if (adapter_info. else {
adapter->terminfo_valid = true;
adapter-adapter->scsi_id] = '#';
adapter- }
}
} /* 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 = BLOGIC_AUTOSCSI_BASE;
fetch_localram.count = sizeof(autoscsi); if (blogic_cmd(adapter common_tagq_depth = true; for (tgt_id = 1; tgt_id < adapter->maxdev; tgt_id++) sizeof(autoscsi)) != sizeof(autoscsi)) return blogic_failure(adapter, "FETCH HOST ADAPTER LOCAL RAM"); /* Save the Parity Checking Enabled, Bus Reset Enabled, and Termination Information in the Host Adapter structure.
*/
adapter->parity = autoscsi else
adapter->reset_enabled = autoscsi.reset_enabled; if (adapter->fw_ver[0] == '4') {
adapter->terminfo_valid = true;
adapter->low_term = autoscsi.low_term;
adapter- if (adapter->wide)
} /* Save the Wide Permitted, Fast Permitted, Synchronous Permitted, Disconnect Permitted, Ultra Permitted, and SCAM Information in the Host Adapter structure.
*/ if (adapter->scam)
adapter-info(", SCAM: %s", adapter,
adapter->sync_ok = autoscsi.sync_ok;
adapter->discon_ok = autoscsi.discon_ok; if (adapter->ultra)
adapter->ultra_ok = autoscsi.ultra_ok; if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
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-> if ( (> == 0 { if (ext_setupinfo.misc.fast_on_eisa)
adapter->fast_ok = 0xFF;
>,"" = )
adapter->wide_ok = 0xFF;
}
}
adapter->discon_ok = 0xFF;
adapter->parity = setupinfo.parity;
adapter->reset_enabled = true Acquire shared access to the IRQ Channel.
} /* Determine the maximum number of Target IDs and Logical Units supported by this driver for Wide and Narrow Host Adapters.
*/
adapter- = adapter- ?1 )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
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]) Initialize the pointers to the first and last CCBs that are case'5':
>tagq_ok xFFFF break; case'4': if (strcmp( Command Successful Flag, Active Commands, and Commands Since Reset
adapter->tagq_ok = * break; case'3': if (strcmp(adapter->fw_ver, "3.35") >= 0)
adapter- adapter-bdr_pendtgt_id] = ; 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 return blogic_failure(adapter, "MAILBOX ALLOCATION"); /* 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; Initialize the Outgoing and Incoming Mailbox structures. 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)
{ if (adapter->irq_ch == 0) {
blogic_err("NO LEGAL INTERRUPT CHANNEL ASSIGNED - DETACHING\n",
adapter); returnfalse;
} /* Acquire shared access to the IRQ Channel.
*/ if (request_irq(adapter->irq_ch, blogic_inthandler, IRQF_SHARED,
adapter->full_model, adapter) < 0) {
blogic_err("UNABLE TO ACQUIRE IRQ CHANNEL %d - DETACHING\n",
adapter, adapter->irq_ch); returnfalse;
}
adapter->irq_acquired = true; /* Indicate the System Resource Acquisition completed successfully,
*/ returntrue;
}
/* blogic_relres releases any system resources previously acquired by blogic_getres.
*/
staticvoid blogic_relres(struct blogic_adapter *adapter)
{ /* 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,
adapter->mbox_space, adapter->mbox_space_handle);
pci_dev_put(adapter->pci_device);
adapter->mbox_space = NULL;
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.
*/
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.