11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Linux Driver for BusLogic MultiMaster and FlashPoint SCSI Host Adapters 41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com> 61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds This program is free software; you may redistribute and/or modify it under 81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds the terms of the GNU General Public License Version 2 as published by the 91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Free Software Foundation. 101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds This program is distributed in the hope that it will be useful, but 121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY 131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds for complete details. 151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds The author respectfully requests that any modifications to this software be 171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds sent directly to him for evaluation and testing. 181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Special thanks to Wayne Yen, Jin-Lon Hon, and Alex Win of BusLogic, whose 201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds advice has been invaluable, to David Gentzel, for writing the original Linux 211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds BusLogic driver, and to Paul Gortmaker, for being such a dedicated test site. 221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Finally, special thanks to Mylex/BusLogic for making the FlashPoint SCCB 241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Manager available as freely redistributable source code. 251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef _BUSLOGIC_H 291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _BUSLOGIC_H 301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef PACKED 331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define PACKED __attribute__((packed)) 341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif 351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the maximum number of BusLogic Host Adapters supported by this driver. 381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 40839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MAX_ADAPTERS 16 411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the maximum number of Target Devices supported by this driver. 451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 47839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MAXDEV 16 481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the maximum number of Scatter/Gather Segments used by this driver. 521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds For optimal performance, it is important that this limit be at least as 531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds large as the largest single request generated by the I/O Subsystem. 541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 56839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_SG_LIMIT 128 571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the maximum, maximum automatic, minimum automatic, and default Queue 611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Depth to allow for Target Devices depending on whether or not they support 621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Tagged Queuing and whether or not ISA Bounce Buffers are required. 631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 65839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MAX_TAG_DEPTH 64 66839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MAX_AUTO_TAG_DEPTH 28 67839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MIN_AUTO_TAG_DEPTH 7 68839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_TAG_DEPTH_BB 3 69839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_UNTAG_DEPTH 3 70839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_UNTAG_DEPTH_BB 2 711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the default amount of time in seconds to wait between a Host Adapter 751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Hard Reset which initiates a SCSI Bus Reset and issuing any SCSI commands. 761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Some SCSI devices get confused if they receive SCSI commands too soon after 771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds a SCSI Bus Reset. 781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 80839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_BUS_SETTLE_TIME 2 811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the maximum number of Mailboxes that should be used for MultiMaster 851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Host Adapters. This number is chosen to be larger than the maximum Host 861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Adapter Queue Depth and small enough so that the Host Adapter structure 871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds does not cross an allocation block size boundary. 881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 90839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MAX_MAILBOX 211 911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the number of CCBs that should be allocated as a group to optimize 951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Kernel memory allocation. 961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 98839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_CCB_GRP_ALLOCSIZE 7 991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Line and Message Buffer Sizes. 1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 105839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_LINEBUF_SIZE 100 106839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MSGBUF_SIZE 9700 1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Driver Message Levels. 1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 113839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_msglevel { 114839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ANNOUNCE_LEVEL = 0, 115839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INFO_LEVEL = 1, 116839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_NOTICE_LEVEL = 2, 117839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_WARN_LEVEL = 3, 118839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ERR_LEVEL = 4 1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 121839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic char *blogic_msglevelmap[] = { KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR }; 1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define Driver Message macros. 1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 128839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_announce(format, args...) \ 129839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_msg(BLOGIC_ANNOUNCE_LEVEL, format, ##args) 1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 131839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_info(format, args...) \ 132839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_msg(BLOGIC_INFO_LEVEL, format, ##args) 1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 134839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_notice(format, args...) \ 135839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_msg(BLOGIC_NOTICE_LEVEL, format, ##args) 1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 137839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_warn(format, args...) \ 138839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_msg(BLOGIC_WARN_LEVEL, format, ##args) 1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 140839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_err(format, args...) \ 141839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_msg(BLOGIC_ERR_LEVEL, format, ##args) 1421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the types of BusLogic Host Adapters that are supported and the number 1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds of I/O Addresses required by each type. 1471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 149839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_adapter_type { 150839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_MULTIMASTER = 1, 151839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_FLASHPOINT = 2 1521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 1531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 154839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_MULTIMASTER_ADDR_COUNT 4 155839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_FLASHPOINT_ADDR_COUNT 256 1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 157839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic int blogic_adapter_addr_count[3] = { 0, BLOGIC_MULTIMASTER_ADDR_COUNT, BLOGIC_FLASHPOINT_ADDR_COUNT }; 1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define macros for testing the Host Adapter Type. 1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 1631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 16478b4b05db57b04b3ed17dc71259bf1402c04abfaMatthew Wilcox#ifdef CONFIG_SCSI_FLASHPOINT 1651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 166839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_multimaster_type(adapter) \ 167839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz (adapter->adapter_type == BLOGIC_MULTIMASTER) 1681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 169839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_flashpoint_type(adapter) \ 170839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz (adapter->adapter_type == BLOGIC_FLASHPOINT) 1711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#else 1731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 174839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_multimaster_type(adapter) (true) 175839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define blogic_flashpoint_type(adapter) (false) 1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif 1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the possible Host Adapter Bus Types. 1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 184839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_adapter_bus_type { 185839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_UNKNOWN_BUS = 0, 186839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ISA_BUS = 1, 187839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_EISA_BUS = 2, 188839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_PCI_BUS = 3, 189839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_VESA_BUS = 4, 190839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_MCA_BUS = 5 1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 193839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic char *blogic_adapter_busnames[] = { "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" }; 1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 195839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic enum blogic_adapter_bus_type blogic_adater_bus_types[] = { 196839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_VESA_BUS, /* BT-4xx */ 197839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ISA_BUS, /* BT-5xx */ 198839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_MCA_BUS, /* BT-6xx */ 199839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_EISA_BUS, /* BT-7xx */ 200839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_UNKNOWN_BUS, /* BT-8xx */ 201839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_PCI_BUS /* BT-9xx */ 2021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 2031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the possible Host Adapter BIOS Disk Geometry Translations. 2061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 208839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_bios_diskgeometry { 209839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BIOS_NODISK = 0, 210839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BIOS_DISK64x32 = 1, 211839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BIOS_DISK128x32 = 2, 212839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BIOS_DISK255x63 = 3 2131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 2141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define a 10^18 Statistics Byte Counter data type. 2181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 220839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_byte_count { 221839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int units; 222839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int billions; 2231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 2241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the structure for I/O Address and Bus Probing Information. 2281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 230839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_probeinfo { 231839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_adapter_type adapter_type; 232839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_adapter_bus_type adapter_bus_type; 233839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long io_addr; 234839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long pci_addr; 235839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct pci_dev *pci_device; 236839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus; 237839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dev; 238839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char irq_ch; 2391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 2401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Probe Options. 2431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 245839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_probe_options { 246839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool noprobe:1; /* Bit 0 */ 247839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool noprobe_isa:1; /* Bit 1 */ 248839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool noprobe_pci:1; /* Bit 2 */ 249839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool nosort_pci:1; /* Bit 3 */ 250839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool multimaster_first:1; /* Bit 4 */ 251839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool flashpoint_first:1; /* Bit 5 */ 252839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool limited_isa:1; /* Bit 6 */ 253839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool probe330:1; /* Bit 7 */ 254839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool probe334:1; /* Bit 8 */ 255839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool probe230:1; /* Bit 9 */ 256839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool probe234:1; /* Bit 10 */ 257839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool probe130:1; /* Bit 11 */ 258839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool probe134:1; /* Bit 12 */ 2591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 2601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Global Options. 2631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 265839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_global_options { 266839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool trace_probe:1; /* Bit 0 */ 267839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool trace_hw_reset:1; /* Bit 1 */ 268839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool trace_config:1; /* Bit 2 */ 269839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool trace_err:1; /* Bit 3 */ 2701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 2711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the BusLogic SCSI Host Adapter I/O Register Offsets. 2741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 276839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_CNTRL_REG 0 /* WO register */ 277839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_STATUS_REG 0 /* RO register */ 278839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_CMD_PARM_REG 1 /* WO register */ 279839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_DATAIN_REG 1 /* RO register */ 280839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_INT_REG 2 /* RO register */ 281839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_GEOMETRY_REG 3 /* RO register */ 2821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the structure of the write-only Control Register. 2851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 2861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 287839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizunion blogic_cntrl_reg { 288839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char all; 2891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct { 2901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:4; /* Bits 0-3 */ 291839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool bus_reset:1; /* Bit 4 */ 292839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool int_reset:1; /* Bit 5 */ 293839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool soft_reset:1; /* Bit 6 */ 294839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool hard_reset:1; /* Bit 7 */ 2951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } cr; 2961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 2971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the structure of the read-only Status Register. 3001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 3011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 302839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizunion blogic_stat_reg { 303839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char all; 3041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct { 305839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool cmd_invalid:1; /* Bit 0 */ 306839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool rsvd:1; /* Bit 1 */ 307839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool datain_ready:1; /* Bit 2 */ 308839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool cmd_param_busy:1; /* Bit 3 */ 309839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool adapter_ready:1; /* Bit 4 */ 310839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool init_reqd:1; /* Bit 5 */ 311839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool diag_failed:1; /* Bit 6 */ 312839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool diag_active:1; /* Bit 7 */ 3131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } sr; 3141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 3151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 3161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 3171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the structure of the read-only Interrupt Register. 3181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 3191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 320839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizunion blogic_int_reg { 321839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char all; 3221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct { 323839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool mailin_loaded:1; /* Bit 0 */ 324839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool mailout_avail:1; /* Bit 1 */ 325839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool cmd_complete:1; /* Bit 2 */ 326839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ext_busreset:1; /* Bit 3 */ 327839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char rsvd:3; /* Bits 4-6 */ 328839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool int_valid:1; /* Bit 7 */ 3291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } ir; 3301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 3311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 3321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 3331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the structure of the read-only Geometry Register. 3341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 3351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 336839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizunion blogic_geo_reg { 337839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char all; 3381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct { 339839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_bios_diskgeometry d0_geo:2; /* Bits 0-1 */ 340839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_bios_diskgeometry d1_geo:2; /* Bits 2-3 */ 3411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:3; /* Bits 4-6 */ 342839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ext_trans_enable:1; /* Bit 7 */ 3431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } gr; 3441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 3451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 3461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 3471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the BusLogic SCSI Host Adapter Command Register Operation Codes. 3481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 3491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 350839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_opcode { 351839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_TEST_CMP_COMPLETE = 0x00, 352839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INIT_MBOX = 0x01, 353839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_EXEC_MBOX_CMD = 0x02, 354839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_EXEC_BIOS_CMD = 0x03, 355839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_GET_BOARD_ID = 0x04, 356839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ENABLE_OUTBOX_AVAIL_INT = 0x05, 357839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SET_SELECT_TIMEOUT = 0x06, 358839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SET_PREEMPT_TIME = 0x07, 359839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SET_TIMEOFF_BUS = 0x08, 360839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SET_TXRATE = 0x09, 361839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_DEV0TO7 = 0x0A, 362839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_CONFIG = 0x0B, 363839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_TGT_MODE = 0x0C, 364839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_SETUPINFO = 0x0D, 365839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_WRITE_LOCALRAM = 0x1A, 366839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_READ_LOCALRAM = 0x1B, 367839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_WRITE_BUSMASTER_FIFO = 0x1C, 368839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_READ_BUSMASTER_FIFO = 0x1D, 369839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ECHO_CMDDATA = 0x1F, 370839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ADAPTER_DIAG = 0x20, 371839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SET_OPTIONS = 0x21, 372839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_DEV8TO15 = 0x23, 373839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_DEV = 0x24, 374839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_DISABLE_INT = 0x25, 375839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INIT_EXT_MBOX = 0x81, 376839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_EXEC_SCS_CMD = 0x83, 377839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_FWVER_D3 = 0x84, 378839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_FWVER_LETTER = 0x85, 379839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_PCI_INFO = 0x86, 380839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_MODELNO = 0x8B, 381839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_SYNC_PERIOD = 0x8C, 382839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INQ_EXTSETUP = 0x8D, 383839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_STRICT_RR = 0x8F, 384839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_STORE_LOCALRAM = 0x90, 385839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_FETCH_LOCALRAM = 0x91, 386839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_STORE_TO_EEPROM = 0x92, 387839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_LOAD_AUTOSCSICODE = 0x94, 388839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_MOD_IOADDR = 0x95, 389839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SETCCB_FMT = 0x96, 390839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_WRITE_INQBUF = 0x9A, 391839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_READ_INQBUF = 0x9B, 392839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_FLASH_LOAD = 0xA7, 393839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_READ_SCAMDATA = 0xA8, 394839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_WRITE_SCAMDATA = 0xA9 3951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 3961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 3971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 3981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Inquire Board ID reply structure. 3991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 4001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 401839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_board_id { 402839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char type; /* Byte 0 */ 403839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char custom_features; /* Byte 1 */ 404839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char fw_ver_digit1; /* Byte 2 */ 405839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char fw_ver_digit2; /* Byte 3 */ 4061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 4071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 4081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 4091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Inquire Configuration reply structure. 4101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 4111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 412839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_config { 4131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:5; /* Byte 0 Bits 0-4 */ 414839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool dma_ch5:1; /* Byte 0 Bit 5 */ 415839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool dma_ch6:1; /* Byte 0 Bit 6 */ 416839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool dma_ch7:1; /* Byte 0 Bit 7 */ 417839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_ch9:1; /* Byte 1 Bit 0 */ 418839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_ch10:1; /* Byte 1 Bit 1 */ 419839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_ch11:1; /* Byte 1 Bit 2 */ 420839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_ch12:1; /* Byte 1 Bit 3 */ 4211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:1; /* Byte 1 Bit 4 */ 422839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_ch14:1; /* Byte 1 Bit 5 */ 423839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_ch15:1; /* Byte 1 Bit 6 */ 4241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:1; /* Byte 1 Bit 7 */ 425839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char id:4; /* Byte 2 Bits 0-3 */ 4261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:4; /* Byte 2 Bits 4-7 */ 4271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 4281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 4291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 4301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Inquire Setup Information reply structure. 4311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 4321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 433839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_syncval { 434839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char offset:4; /* Bits 0-3 */ 435839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char tx_period:3; /* Bits 4-6 */ 436839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool sync:1; /* Bit 7 */ 4371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 4381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 439839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_setup_info { 440839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool sync:1; /* Byte 0 Bit 0 */ 441839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool parity:1; /* Byte 0 Bit 1 */ 442839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:6; /* Byte 0 Bits 2-7 */ 443839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char tx_rate; /* Byte 1 */ 444839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char preempt_time; /* Byte 2 */ 445839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char timeoff_bus; /* Byte 3 */ 446839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char mbox_count; /* Byte 4 */ 447839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char mbox_addr[3]; /* Bytes 5-7 */ 448839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_syncval sync0to7[8]; /* Bytes 8-15 */ 449839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char disconnect_ok0to7; /* Byte 16 */ 450839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char sig; /* Byte 17 */ 451839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char char_d; /* Byte 18 */ 452839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus_type; /* Byte 19 */ 453839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char wide_tx_ok0to7; /* Byte 20 */ 454839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char wide_tx_active0to7; /* Byte 21 */ 455839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_syncval sync8to15[8]; /* Bytes 22-29 */ 456839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char disconnect_ok8to15; /* Byte 30 */ 457839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 31 */ 458839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char wide_tx_ok8to15; /* Byte 32 */ 459839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char wide_tx_active8to15; /* Byte 33 */ 4601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 4611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 4621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 4631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Initialize Extended Mailbox request structure. 4641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 4651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 466839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_extmbox_req { 467839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char mbox_count; /* Byte 0 */ 468839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 base_mbox_addr; /* Bytes 1-4 */ 4691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 4701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 4711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 4721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 4731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Inquire PCI Host Adapter Information reply type. The ISA 4741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Compatible I/O Port values are defined here and are also used with 4751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds the Modify I/O Address command. 4761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 4771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 478839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_isa_ioport { 479839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_330 = 0, 480839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_334 = 1, 481839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_230 = 2, 482839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_234 = 3, 483839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_130 = 4, 484839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_134 = 5, 485839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_DISABLE = 6, 486839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_IO_DISABLE2 = 7 4871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 4881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 489839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_adapter_info { 490839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_isa_ioport isa_port; /* Byte 0 */ 491839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char irq_ch; /* Byte 1 */ 492839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool low_term:1; /* Byte 2 Bit 0 */ 493839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool high_term:1; /* Byte 2 Bit 1 */ 494839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:2; /* Byte 2 Bits 2-3 */ 495839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool JP1:1; /* Byte 2 Bit 4 */ 496839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool JP2:1; /* Byte 2 Bit 5 */ 497839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool JP3:1; /* Byte 2 Bit 6 */ 498839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool genericinfo_valid:1; /* Byte 2 Bit 7 */ 499839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 3 */ 5001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 5011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 5021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 5031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Inquire Extended Setup Information reply structure. 5041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 5051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 506839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_ext_setup { 507839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus_type; /* Byte 0 */ 508839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bios_addr; /* Byte 1 */ 509839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short sg_limit; /* Bytes 2-3 */ 510839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char mbox_count; /* Byte 4 */ 511839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 base_mbox_addr; /* Bytes 5-8 */ 5121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct { 5131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:2; /* Byte 9 Bits 0-1 */ 514839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool fast_on_eisa:1; /* Byte 9 Bit 2 */ 5151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:3; /* Byte 9 Bits 3-5 */ 516839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool level_int:1; /* Byte 9 Bit 6 */ 5171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:1; /* Byte 9 Bit 7 */ 518839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz } misc; 519839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char fw_rev[3]; /* Bytes 10-12 */ 520839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool wide:1; /* Byte 13 Bit 0 */ 521839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool differential:1; /* Byte 13 Bit 1 */ 522839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam:1; /* Byte 13 Bit 2 */ 523839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ultra:1; /* Byte 13 Bit 3 */ 524839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool smart_term:1; /* Byte 13 Bit 4 */ 525839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:3; /* Byte 13 Bits 5-7 */ 5261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 5271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 5281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 5291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Enable Strict Round Robin Mode request type. 5301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 5311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 532839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_rr_req { 533839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_AGGRESSIVE_RR = 0, 534839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_STRICT_RR_MODE = 1 5351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 5361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 5371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 5381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 5391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Fetch Host Adapter Local RAM request type. 5401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 5411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 542839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_BIOS_BASE 0 543839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_AUTOSCSI_BASE 64 5441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 545839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_fetch_localram { 546839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char offset; /* Byte 0 */ 547839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char count; /* Byte 1 */ 5481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 5491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 5501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 5511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Local RAM AutoSCSI structure. 5521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 5531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 554839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_autoscsi { 555839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char factory_sig[2]; /* Bytes 0-1 */ 556839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char info_bytes; /* Byte 2 */ 557839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char adapter_type[6]; /* Bytes 3-8 */ 558839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 9 */ 559839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool floppy:1; /* Byte 10 Bit 0 */ 560839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool floppy_sec:1; /* Byte 10 Bit 1 */ 561839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool level_int:1; /* Byte 10 Bit 2 */ 562839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:2; /* Byte 10 Bits 3-4 */ 563839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char systemram_bios:3; /* Byte 10 Bits 5-7 */ 564839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dma_ch:7; /* Byte 11 Bits 0-6 */ 565839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool dma_autoconf:1; /* Byte 11 Bit 7 */ 566839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char irq_ch:7; /* Byte 12 Bits 0-6 */ 567839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_autoconf:1; /* Byte 12 Bit 7 */ 568839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dma_tx_rate; /* Byte 13 */ 569839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char scsi_id; /* Byte 14 */ 570839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool low_term:1; /* Byte 15 Bit 0 */ 571839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool parity:1; /* Byte 15 Bit 1 */ 572839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool high_term:1; /* Byte 15 Bit 2 */ 573839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool noisy_cable:1; /* Byte 15 Bit 3 */ 574839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool fast_sync_neg:1; /* Byte 15 Bit 4 */ 575839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool reset_enabled:1; /* Byte 15 Bit 5 */ 576839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool:1; /* Byte 15 Bit 6 */ 577839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool active_negation:1; /* Byte 15 Bit 7 */ 578839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus_on_delay; /* Byte 16 */ 579839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus_off_delay; /* Byte 17 */ 580839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool bios_enabled:1; /* Byte 18 Bit 0 */ 581839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool int19_redir_enabled:1; /* Byte 18 Bit 1 */ 582839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ext_trans_enable:1; /* Byte 18 Bit 2 */ 583839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool removable_as_fixed:1; /* Byte 18 Bit 3 */ 584839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool:1; /* Byte 18 Bit 4 */ 585839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool morethan2_drives:1; /* Byte 18 Bit 5 */ 586839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool bios_int:1; /* Byte 18 Bit 6 */ 587839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool floptical:1; /* Byte 19 Bit 7 */ 588839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short dev_enabled; /* Bytes 19-20 */ 589839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short wide_ok; /* Bytes 21-22 */ 590839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short fast_ok; /* Bytes 23-24 */ 591839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short sync_ok; /* Bytes 25-26 */ 592839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short discon_ok; /* Bytes 27-28 */ 593839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short send_start_unit; /* Bytes 29-30 */ 594839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short ignore_bios_scan; /* Bytes 31-32 */ 595839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char pci_int_pin:2; /* Byte 33 Bits 0-1 */ 596839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char adapter_ioport:2; /* Byte 33 Bits 2-3 */ 597839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool strict_rr_enabled:1; /* Byte 33 Bit 4 */ 598839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool vesabus_33mhzplus:1; /* Byte 33 Bit 5 */ 599839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool vesa_burst_write:1; /* Byte 33 Bit 6 */ 600839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool vesa_burst_read:1; /* Byte 33 Bit 7 */ 601839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short ultra_ok; /* Bytes 34-35 */ 602839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int:32; /* Bytes 36-39 */ 603839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 40 */ 604839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char autoscsi_maxlun; /* Byte 41 */ 605839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool:1; /* Byte 42 Bit 0 */ 606839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_dominant:1; /* Byte 42 Bit 1 */ 607839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_enabled:1; /* Byte 42 Bit 2 */ 608839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_lev2:1; /* Byte 42 Bit 3 */ 609839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:4; /* Byte 42 Bits 4-7 */ 610839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool int13_exten:1; /* Byte 43 Bit 0 */ 611839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool:1; /* Byte 43 Bit 1 */ 612839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool cd_boot:1; /* Byte 43 Bit 2 */ 613839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:5; /* Byte 43 Bits 3-7 */ 614839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char boot_id:4; /* Byte 44 Bits 0-3 */ 615839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char boot_ch:4; /* Byte 44 Bits 4-7 */ 616839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char force_scan_order:1; /* Byte 45 Bit 0 */ 617839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:7; /* Byte 45 Bits 1-7 */ 618839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short nontagged_to_alt_ok; /* Bytes 46-47 */ 619839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short reneg_sync_on_check; /* Bytes 48-49 */ 620839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char rsvd[10]; /* Bytes 50-59 */ 621839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char manuf_diag[2]; /* Bytes 60-61 */ 622839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short cksum; /* Bytes 62-63 */ 6231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 6241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Local RAM Auto SCSI Byte 45 structure. 6271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 6281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 629839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_autoscsi_byte45 { 630839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char force_scan_order:1; /* Bit 0 */ 6311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char:7; /* Bits 1-7 */ 6321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 6331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Local RAM BIOS Drive Map Byte structure. 6361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 6371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 638839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_BIOS_DRVMAP 17 6391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 640839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_bios_drvmap { 641839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char tgt_idbit3:1; /* Bit 0 */ 642839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:2; /* Bits 1-2 */ 643839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_bios_diskgeometry diskgeom:2; /* Bits 3-4 */ 644839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char tgt_id:3; /* Bits 5-7 */ 6451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 6461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Set CCB Format request type. Extended LUN Format CCBs are 6491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds necessary to support more than 8 Logical Units per Target Device. 6501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 6511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 652839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_setccb_fmt { 653839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_LEGACY_LUN_CCB = 0, 654839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_EXT_LUN_CCB = 1 6551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 6561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Outgoing Mailbox Action Codes. 6591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 6601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 661839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_action { 662839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_OUTBOX_FREE = 0x00, 663839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_MBOX_START = 0x01, 664839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_MBOX_ABORT = 0x02 6651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 6661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Incoming Mailbox Completion Codes. The MultiMaster Firmware 6701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds only uses codes 0 - 4. The FlashPoint SCCB Manager has no mailboxes, so 6711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds completion codes are stored in the CCB; it only uses codes 1, 2, 4, and 5. 6721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 6731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 674839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_cmplt_code { 675839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INBOX_FREE = 0x00, 676839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CMD_COMPLETE_GOOD = 0x01, 677839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CMD_ABORT_BY_HOST = 0x02, 678839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CMD_NOTFOUND = 0x03, 679839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CMD_COMPLETE_ERROR = 0x04, 680839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INVALID_CCB = 0x05 6811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 6821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Command Control Block (CCB) Opcodes. 6851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 6861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 687839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_ccb_opcode { 688839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INITIATOR_CCB = 0x00, 689839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_TGT_CCB = 0x01, 690839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INITIATOR_CCB_SG = 0x02, 691839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INITIATOR_CCBB_RESIDUAL = 0x03, 692839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INITIATOR_CCB_SG_RESIDUAL = 0x04, 693839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BDR = 0x81 6941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 6951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the CCB Data Direction Codes. 6991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 701839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_datadir { 702839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_UNCHECKED_TX = 0, 703839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_DATAIN_CHECKED = 1, 704839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_DATAOUT_CHECKED = 2, 705839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_NOTX = 3 7061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 7071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Status Codes. The MultiMaster Firmware does not 7111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds return status code 0x0C; it uses 0x12 for both overruns and underruns. 7121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 714839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_adapter_status { 715839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CMD_CMPLT_NORMAL = 0x00, 716839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_LINK_CMD_CMPLT = 0x0A, 717839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_LINK_CMD_CMPLT_FLAG = 0x0B, 718839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_DATA_UNDERRUN = 0x0C, 719839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SELECT_TIMEOUT = 0x11, 720839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_DATA_OVERRUN = 0x12, 721839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_NOEXPECT_BUSFREE = 0x13, 722839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INVALID_BUSPHASE = 0x14, 723839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INVALID_OUTBOX_CODE = 0x15, 724839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_INVALID_CMD_CODE = 0x16, 725839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_LINKCCB_BADLUN = 0x17, 726839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BAD_CMD_PARAM = 0x1A, 727839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_AUTOREQSENSE_FAIL = 0x1B, 728839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_TAGQUEUE_REJECT = 0x1C, 729839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BAD_MSG_RCVD = 0x1D, 730839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_HW_FAIL = 0x20, 731839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_NORESPONSE_TO_ATN = 0x21, 732839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_HW_RESET = 0x22, 733839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_RST_FROM_OTHERDEV = 0x23, 734839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_BAD_RECONNECT = 0x24, 735839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_HW_BDR = 0x25, 736839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ABRT_QUEUE = 0x26, 737839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ADAPTER_SW_ERROR = 0x27, 738839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_HW_TIMEOUT = 0x30, 739839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_PARITY_ERR = 0x34 7401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 7411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the SCSI Target Device Status Codes. 7451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 747839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_tgt_status { 748839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_OP_GOOD = 0x00, 749839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CHECKCONDITION = 0x02, 750839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_DEVBUSY = 0x08 7511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 7521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Queue Tag Codes. 7551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 757839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_queuetag { 758839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_SIMPLETAG = 0, 759839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_HEADTAG = 1, 760839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_ORDEREDTAG = 2, 761839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_RSVDTAG = 3 7621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 7631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the SCSI Command Descriptor Block (CDB). 7661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 768839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_CDB_MAXLEN 12 7691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Scatter/Gather Segment structure required by the MultiMaster 7731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Firmware Interface and the FlashPoint SCCB Manager. 7741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 776839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_sg_seg { 777839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 segbytes; /* Bytes 0-3 */ 778839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 segdata; /* Bytes 4-7 */ 7791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 7801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Driver CCB Status Codes. 7831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 7841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 785839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizenum blogic_ccb_status { 786839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CCB_FREE = 0, 787839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CCB_ACTIVE = 1, 788839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CCB_COMPLETE = 2, 789839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz BLOGIC_CCB_RESET = 3 7901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} PACKED; 7911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 7931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the 32 Bit Mode Command Control Block (CCB) structure. The first 40 7951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds bytes are defined by and common to both the MultiMaster Firmware and the 7961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds FlashPoint SCCB Manager. The next 60 bytes are defined by the FlashPoint 7971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds SCCB Manager. The remaining components are defined by the Linux BusLogic 7981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Driver. Extended LUN Format CCBs differ from Legacy LUN Format 32 Bit Mode 7991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds CCBs only in having the TagEnable and QueueTag fields moved from byte 17 to 8001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds byte 1, and the Logical Unit field in byte 17 expanded to 6 bits. In theory, 8011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Extended LUN Format CCBs can support up to 64 Logical Units, but in practice 8021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds many devices will respond improperly to Logical Units between 32 and 63, and 8031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds the SCSI-2 specification defines Bit 5 as LUNTAR. Extended LUN Format CCBs 8041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds are used by recent versions of the MultiMaster Firmware, as well as by the 8051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds FlashPoint SCCB Manager; the FlashPoint SCCB Manager only supports 32 Logical 8061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Units. Since 64 Logical Units are unlikely to be needed in practice, and 8071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds since they are problematic for the above reasons, and since limiting them to 8081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 5 bits simplifies the CCB structure definition, this driver only supports 8091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 32 Logical Units per Target Device. 8101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 8111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 812839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_ccb { 8131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds /* 8141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds MultiMaster Firmware and FlashPoint SCCB Manager Common Portion. 8151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 816839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_ccb_opcode opcode; /* Byte 0 */ 817839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:3; /* Byte 1 Bits 0-2 */ 818839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_datadir datadir:2; /* Byte 1 Bits 3-4 */ 819839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool tag_enable:1; /* Byte 1 Bit 5 */ 820839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_queuetag queuetag:2; /* Byte 1 Bits 6-7 */ 821839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char cdblen; /* Byte 2 */ 822839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char sense_datalen; /* Byte 3 */ 823839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 datalen; /* Bytes 4-7 */ 824391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz void *data; /* Bytes 8-11 */ 825839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 12 */ 826839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 13 */ 827839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_adapter_status adapter_status; /* Byte 14 */ 828839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_tgt_status tgt_status; /* Byte 15 */ 829839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char tgt_id; /* Byte 16 */ 830839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char lun:5; /* Byte 17 Bits 0-4 */ 831839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool legacytag_enable:1; /* Byte 17 Bit 5 */ 832839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_queuetag legacy_tag:2; /* Byte 17 Bits 6-7 */ 833839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char cdb[BLOGIC_CDB_MAXLEN]; /* Bytes 18-29 */ 834839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 30 */ 835839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 31 */ 836391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u32 rsvd_int; /* Bytes 32-35 */ 837839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 sensedata; /* Bytes 36-39 */ 8381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds /* 8391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds FlashPoint SCCB Manager Defined Portion. 8401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 841839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz void (*callback) (struct blogic_ccb *); /* Bytes 40-43 */ 842839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 base_addr; /* Bytes 44-47 */ 843839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_cmplt_code comp_code; /* Byte 48 */ 84478b4b05db57b04b3ed17dc71259bf1402c04abfaMatthew Wilcox#ifdef CONFIG_SCSI_FLASHPOINT 845839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 49 */ 846391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 os_flags; /* Bytes 50-51 */ 847391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz unsigned char private[24]; /* Bytes 52-99 */ 848391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz void *rsvd1; 849391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz void *rsvd2; 850391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz unsigned char private2[16]; 8511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif 8521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds /* 8531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds BusLogic Linux Driver Defined Portion. 8541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 855839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz dma_addr_t allocgrp_head; 856839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int allocgrp_size; 857839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 dma_handle; 858839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_ccb_status status; 859839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long serial; 860839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct scsi_cmnd *command; 861839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_adapter *adapter; 862839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *next; 863839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *next_all; 864839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_sg_seg sglist[BLOGIC_SG_LIMIT]; 8651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 8661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 8671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 8681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the 32 Bit Mode Outgoing Mailbox structure. 8691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 8701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 871839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_outbox { 872839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 ccb; /* Bytes 0-3 */ 873391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u32:24; /* Bytes 4-6 */ 874839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_action action; /* Byte 7 */ 8751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 8761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 8771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 8781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the 32 Bit Mode Incoming Mailbox structure. 8791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 8801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 881839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_inbox { 882391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u32 ccb; /* Bytes 0-3 */ 883839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_adapter_status adapter_status; /* Byte 4 */ 884391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz enum blogic_tgt_status tgt_status; /* Byte 5 */ 885391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz unsigned char:8; /* Byte 6 */ 886391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz enum blogic_cmplt_code comp_code; /* Byte 7 */ 8871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 8881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 8891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 8901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 8911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the BusLogic Driver Options structure. 8921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 8931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 894839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_drvr_options { 895839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short tagq_ok; 896839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short tagq_ok_mask; 897839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short bus_settle_time; 898839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short stop_tgt_inquiry; 899839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char common_qdepth; 900839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char qdepth[BLOGIC_MAXDEV]; 9011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 9021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 9041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Target Flags structure. 9051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 9061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 907839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_tgt_flags { 908839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool tgt_exists:1; 909839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool tagq_ok:1; 910839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool wide_ok:1; 911839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool tagq_active:1; 912839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool wide_active:1; 913839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool cmd_good:1; 914839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool tgt_info_in:1; 9151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 9161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 9181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the Host Adapter Target Statistics structure. 9191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 9201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 921839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define BLOGIC_SZ_BUCKETS 10 922839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz 923839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_tgt_stats { 924839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int cmds_tried; 925839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int cmds_complete; 926839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int read_cmds; 927839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int write_cmds; 928839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_byte_count bytesread; 929839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_byte_count byteswritten; 930839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int read_sz_buckets[BLOGIC_SZ_BUCKETS]; 931839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int write_sz_buckets[BLOGIC_SZ_BUCKETS]; 932839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short aborts_request; 933839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short aborts_tried; 934839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short aborts_done; 935839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short bdr_request; 936839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short bdr_tried; 937839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short bdr_done; 938839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short adatper_reset_req; 939839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short adapter_reset_attempt; 940839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short adapter_reset_done; 9411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 9421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 9441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the FlashPoint Card Handle data type. 9451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 9461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 947391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz#define FPOINT_BADCARD_HANDLE 0xFFFFFFFFL 9481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 9511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the FlashPoint Information structure. This structure is defined 9521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds by the FlashPoint SCCB Manager. 9531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 9541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 955839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct fpoint_info { 956839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 base_addr; /* Bytes 0-3 */ 957839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool present; /* Byte 4 */ 958839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char irq_ch; /* Byte 5 */ 959839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char scsi_id; /* Byte 6 */ 960839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char scsi_lun; /* Byte 7 */ 961391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 fw_rev; /* Bytes 8-9 */ 962391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 sync_ok; /* Bytes 10-11 */ 963391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 fast_ok; /* Bytes 12-13 */ 964391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 ultra_ok; /* Bytes 14-15 */ 965391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 discon_ok; /* Bytes 16-17 */ 966391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u16 wide_ok; /* Bytes 18-19 */ 967839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool parity:1; /* Byte 20 Bit 0 */ 968839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool wide:1; /* Byte 20 Bit 1 */ 969839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool softreset:1; /* Byte 20 Bit 2 */ 970839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ext_trans_enable:1; /* Byte 20 Bit 3 */ 971839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool low_term:1; /* Byte 20 Bit 4 */ 972839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool high_term:1; /* Byte 20 Bit 5 */ 973839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool report_underrun:1; /* Byte 20 Bit 6 */ 974839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_enabled:1; /* Byte 20 Bit 7 */ 975839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_lev2:1; /* Byte 21 Bit 0 */ 976839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:7; /* Byte 21 Bits 1-7 */ 977839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char family; /* Byte 22 */ 978839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus_type; /* Byte 23 */ 979839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char model[3]; /* Bytes 24-26 */ 980839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char relative_cardnum; /* Byte 27 */ 981839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char rsvd[4]; /* Bytes 28-31 */ 982391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u32 os_rsvd; /* Bytes 32-35 */ 983839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char translation_info[4]; /* Bytes 36-39 */ 984391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u32 rsvd2[5]; /* Bytes 40-59 */ 985391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz u32 sec_range; /* Bytes 60-63 */ 9861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 9871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 9891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the BusLogic Driver Host Adapter structure. 9901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 9911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 992839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct blogic_adapter { 993839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct Scsi_Host *scsi_host; 994839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct pci_dev *pci_device; 995839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_adapter_type adapter_type; 996839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz enum blogic_adapter_bus_type adapter_bus_type; 997839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long io_addr; 998839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long pci_addr; 999839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short addr_count; 1000839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char host_no; 1001839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char model[9]; 1002839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char fw_ver[6]; 1003839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char full_model[18]; 1004839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char bus; 1005839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dev; 1006839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char irq_ch; 1007839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dma_ch; 1008839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char scsi_id; 1009839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool irq_acquired:1; 1010839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool dma_chan_acquired:1; 1011839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ext_trans_enable:1; 1012839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool parity:1; 1013839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool reset_enabled:1; 1014839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool level_int:1; 1015839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool wide:1; 1016839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool differential:1; 1017839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam:1; 1018839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ultra:1; 1019839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool ext_lun:1; 1020839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool terminfo_valid:1; 1021839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool low_term:1; 1022839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool high_term:1; 1023839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool need_bouncebuf:1; 1024839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool strict_rr:1; 1025839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_enabled:1; 1026839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool scam_lev2:1; 1027839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool adapter_initd:1; 1028839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool adapter_extreset:1; 1029839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool adapter_intern_err:1; 1030839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool processing_ccbs; 1031839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz volatile bool adapter_cmd_complete; 1032839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short adapter_sglimit; 1033839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short drvr_sglimit; 1034839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short maxdev; 1035839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short maxlun; 1036839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short mbox_count; 1037839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short initccbs; 1038839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short inc_ccbs; 1039839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short alloc_ccbs; 1040839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short drvr_qdepth; 1041839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short adapter_qdepth; 1042839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short untag_qdepth; 1043839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short common_qdepth; 1044839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short bus_settle_time; 1045839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short sync_ok; 1046839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short fast_ok; 1047839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short ultra_ok; 1048839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short wide_ok; 1049839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short discon_ok; 1050839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short tagq_ok; 1051839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short ext_resets; 1052839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short adapter_intern_errors; 1053839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short tgt_count; 1054839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned short msgbuflen; 1055839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz u32 bios_addr; 1056839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_drvr_options *drvr_opts; 1057839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct fpoint_info fpinfo; 1058391e2f25601e34a7d7e5dc155e487bc58dffd8c6Khalid Aziz void *cardhandle; 10591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct list_head host_list; 1060839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *all_ccbs; 1061839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *free_ccbs; 1062839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *firstccb; 1063839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *lastccb; 1064839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_ccb *bdr_pend[BLOGIC_MAXDEV]; 1065839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_tgt_flags tgt_flags[BLOGIC_MAXDEV]; 1066839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char qdepth[BLOGIC_MAXDEV]; 1067839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char sync_period[BLOGIC_MAXDEV]; 1068839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char sync_offset[BLOGIC_MAXDEV]; 1069839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char active_cmds[BLOGIC_MAXDEV]; 1070839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int cmds_since_rst[BLOGIC_MAXDEV]; 1071839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long last_seqpoint[BLOGIC_MAXDEV]; 1072839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long last_resettried[BLOGIC_MAXDEV]; 1073839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long last_resetdone[BLOGIC_MAXDEV]; 1074839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_outbox *first_outbox; 1075839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_outbox *last_outbox; 1076839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_outbox *next_outbox; 1077839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_inbox *first_inbox; 1078839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_inbox *last_inbox; 1079839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_inbox *next_inbox; 1080839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz struct blogic_tgt_stats tgt_stats[BLOGIC_MAXDEV]; 1081839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char *mbox_space; 1082839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz dma_addr_t mbox_space_handle; 1083839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int mbox_sz; 1084839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned long ccb_offset; 1085839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz char msgbuf[BLOGIC_MSGBUF_SIZE]; 10861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 10871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 10881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 10891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define a structure for the BIOS Disk Parameters. 10901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 10911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1092839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct bios_diskparam { 1093839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz int heads; 1094839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz int sectors; 1095839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz int cylinders; 10961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 10971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 10981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 10991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define a structure for the SCSI Inquiry command results. 11001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 11011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1102839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstruct scsi_inquiry { 1103839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char devtype:5; /* Byte 0 Bits 0-4 */ 1104839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dev_qual:3; /* Byte 0 Bits 5-7 */ 1105839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char dev_modifier:7; /* Byte 1 Bits 0-6 */ 1106839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool rmb:1; /* Byte 1 Bit 7 */ 1107839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char ansi_ver:3; /* Byte 2 Bits 0-2 */ 1108839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char ecma_ver:3; /* Byte 2 Bits 3-5 */ 1109839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char iso_ver:2; /* Byte 2 Bits 6-7 */ 1110839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char resp_fmt:4; /* Byte 3 Bits 0-3 */ 1111839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:2; /* Byte 3 Bits 4-5 */ 1112839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool TrmIOP:1; /* Byte 3 Bit 6 */ 1113839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool AENC:1; /* Byte 3 Bit 7 */ 1114839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char addl_len; /* Byte 4 */ 1115839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 5 */ 1116839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char:8; /* Byte 6 */ 1117839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool SftRe:1; /* Byte 7 Bit 0 */ 1118839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool CmdQue:1; /* Byte 7 Bit 1 */ 1119839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool:1; /* Byte 7 Bit 2 */ 1120839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool linked:1; /* Byte 7 Bit 3 */ 1121839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool sync:1; /* Byte 7 Bit 4 */ 1122839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool WBus16:1; /* Byte 7 Bit 5 */ 1123839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool WBus32:1; /* Byte 7 Bit 6 */ 1124839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bool RelAdr:1; /* Byte 7 Bit 7 */ 1125839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char vendor[8]; /* Bytes 8-15 */ 1126839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char product[16]; /* Bytes 16-31 */ 1127839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char product_rev[4]; /* Bytes 32-35 */ 11281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 11291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 11301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 11311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 11321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define functions to provide an abstraction for reading and writing the 11331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Host Adapter I/O Registers. 11341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 11351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1136839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_busreset(struct blogic_adapter *adapter) 11371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1138839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz union blogic_cntrl_reg cr; 1139839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.all = 0; 1140839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.cr.bus_reset = true; 1141839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz outb(cr.all, adapter->io_addr + BLOGIC_CNTRL_REG); 11421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1144839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_intreset(struct blogic_adapter *adapter) 11451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1146839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz union blogic_cntrl_reg cr; 1147839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.all = 0; 1148839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.cr.int_reset = true; 1149839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz outb(cr.all, adapter->io_addr + BLOGIC_CNTRL_REG); 11501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1152839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_softreset(struct blogic_adapter *adapter) 11531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1154839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz union blogic_cntrl_reg cr; 1155839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.all = 0; 1156839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.cr.soft_reset = true; 1157839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz outb(cr.all, adapter->io_addr + BLOGIC_CNTRL_REG); 11581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1160839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_hardreset(struct blogic_adapter *adapter) 11611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1162839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz union blogic_cntrl_reg cr; 1163839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.all = 0; 1164839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cr.cr.hard_reset = true; 1165839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz outb(cr.all, adapter->io_addr + BLOGIC_CNTRL_REG); 11661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1168839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline unsigned char blogic_rdstatus(struct blogic_adapter *adapter) 11691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1170839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz return inb(adapter->io_addr + BLOGIC_STATUS_REG); 11711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1173839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_setcmdparam(struct blogic_adapter *adapter, 1174839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned char value) 11751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1176839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz outb(value, adapter->io_addr + BLOGIC_CMD_PARM_REG); 11771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1179839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline unsigned char blogic_rddatain(struct blogic_adapter *adapter) 11801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1181839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz return inb(adapter->io_addr + BLOGIC_DATAIN_REG); 11821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1184839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline unsigned char blogic_rdint(struct blogic_adapter *adapter) 11851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1186839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz return inb(adapter->io_addr + BLOGIC_INT_REG); 11871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1189839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline unsigned char blogic_rdgeom(struct blogic_adapter *adapter) 11901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1191839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz return inb(adapter->io_addr + BLOGIC_GEOMETRY_REG); 11921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 11931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 11941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1195839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_execmbox issues an Execute Mailbox Command, which 11961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds notifies the Host Adapter that an entry has been made in an Outgoing 11971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Mailbox. 11981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 11991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1200839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_execmbox(struct blogic_adapter *adapter) 12011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1202839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_setcmdparam(adapter, BLOGIC_EXEC_MBOX_CMD); 12031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 12041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1206839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_delay waits for Seconds to elapse. 12071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1209839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_delay(int seconds) 12101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1211839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz mdelay(1000 * seconds); 12121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 12131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1215839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz virt_to_32bit_virt maps between Kernel Virtual Addresses and 12161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 32 bit Kernel Virtual Addresses. This avoids compilation warnings 12171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds on 64 bit architectures. 12181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1220839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline u32 virt_to_32bit_virt(void *virt_addr) 12211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1222839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz return (u32) (unsigned long) virt_addr; 12231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 12241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1226839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_inc_count increments counter by 1, stopping at 12271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 65535 rather than wrapping around to 0. 12281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1230839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_inc_count(unsigned short *count) 12311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1232839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz if (*count < 65535) 1233839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz (*count)++; 12341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 12351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1237839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_addcount increments Byte Counter by Amount. 12381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1240839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_addcount(struct blogic_byte_count *bytecount, 1241839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int amount) 12421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1243839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bytecount->units += amount; 1244839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz if (bytecount->units > 999999999) { 1245839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bytecount->units -= 1000000000; 1246839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz bytecount->billions++; 12471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } 12481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 12491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1251839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz blogic_incszbucket increments the Bucket for Amount. 12521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1254839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic inline void blogic_incszbucket(unsigned int *cmdsz_buckets, 1255839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz unsigned int amount) 12561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{ 1257839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz int index = 0; 1258839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz if (amount < 8 * 1024) { 1259839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz if (amount < 2 * 1024) 1260839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz index = (amount < 1 * 1024 ? 0 : 1); 12611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds else 1262839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz index = (amount < 4 * 1024 ? 2 : 3); 1263839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz } else if (amount < 128 * 1024) { 1264839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz if (amount < 32 * 1024) 1265839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz index = (amount < 16 * 1024 ? 4 : 5); 12661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds else 1267839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz index = (amount < 64 * 1024 ? 6 : 7); 12681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } else 1269839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz index = (amount < 256 * 1024 ? 8 : 9); 1270839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz cmdsz_buckets[index]++; 12711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} 12721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 12741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the version number of the FlashPoint Firmware (SCCB Manager). 12751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1277839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define FLASHPOINT_FW_VER "5.02" 12781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 12801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define the possible return values from FlashPoint_HandleInterrupt. 12811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1283839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define FPOINT_NORMAL_INT 0x00 1284839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define FPOINT_INTERN_ERR 0xFE 1285839cb99e8f748391059d10388c8aea48a88c142cKhalid Aziz#define FPOINT_EXT_RESET 0xFF 12861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 12881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Define prototypes for the forward referenced BusLogic Driver 12891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds Internal Functions. 12901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 12911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1292839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic const char *blogic_drvr_info(struct Scsi_Host *); 1293839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic int blogic_qcmd(struct Scsi_Host *h, struct scsi_cmnd *); 1294839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic int blogic_diskparam(struct scsi_device *, struct block_device *, sector_t, int *); 1295839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic int blogic_slaveconfig(struct scsi_device *); 1296839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic void blogic_qcompleted_ccb(struct blogic_ccb *); 1297839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic irqreturn_t blogic_inthandler(int, void *); 1298839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic int blogic_resetadapter(struct blogic_adapter *, bool hard_reset); 1299839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic void blogic_msg(enum blogic_msglevel, char *, struct blogic_adapter *, ...); 1300839cb99e8f748391059d10388c8aea48a88c142cKhalid Azizstatic int __init blogic_setup(char *); 13011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 13021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* _BUSLOGIC_H */ 1303