Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

+5185 -3312
+108
Documentation/scsi/aacraid.txt
···
··· 1 + AACRAID Driver for Linux (take two) 2 + 3 + Introduction 4 + ------------------------- 5 + The aacraid driver adds support for Adaptec (http://www.adaptec.com) 6 + RAID controllers. This is a major rewrite from the original 7 + Adaptec supplied driver. It has signficantly cleaned up both the code 8 + and the running binary size (the module is less than half the size of 9 + the original). 10 + 11 + Supported Cards/Chipsets 12 + ------------------------- 13 + PCI ID (pci.ids) OEM Product 14 + 9005:0285:9005:028a Adaptec 2020ZCR (Skyhawk) 15 + 9005:0285:9005:028e Adaptec 2020SA (Skyhawk) 16 + 9005:0285:9005:028b Adaptec 2025ZCR (Terminator) 17 + 9005:0285:9005:028f Adaptec 2025SA (Terminator) 18 + 9005:0285:9005:0286 Adaptec 2120S (Crusader) 19 + 9005:0286:9005:028d Adaptec 2130S (Lancer) 20 + 9005:0285:9005:0285 Adaptec 2200S (Vulcan) 21 + 9005:0285:9005:0287 Adaptec 2200S (Vulcan-2m) 22 + 9005:0286:9005:028c Adaptec 2230S (Lancer) 23 + 9005:0286:9005:028c Adaptec 2230SLP (Lancer) 24 + 9005:0285:9005:0296 Adaptec 2240S (SabreExpress) 25 + 9005:0285:9005:0290 Adaptec 2410SA (Jaguar) 26 + 9005:0285:9005:0293 Adaptec 21610SA (Corsair-16) 27 + 9005:0285:103c:3227 Adaptec 2610SA (Bearcat) 28 + 9005:0285:9005:0292 Adaptec 2810SA (Corsair-8) 29 + 9005:0285:9005:0294 Adaptec Prowler 30 + 9005:0286:9005:029d Adaptec 2420SA (Intruder) 31 + 9005:0286:9005:029c Adaptec 2620SA (Intruder) 32 + 9005:0286:9005:029b Adaptec 2820SA (Intruder) 33 + 9005:0286:9005:02a7 Adaptec 2830SA (Skyray) 34 + 9005:0286:9005:02a8 Adaptec 2430SA (Skyray) 35 + 9005:0285:9005:0288 Adaptec 3230S (Harrier) 36 + 9005:0285:9005:0289 Adaptec 3240S (Tornado) 37 + 9005:0285:9005:0298 Adaptec 4000SAS (BlackBird) 38 + 9005:0285:9005:0297 Adaptec 4005SAS (AvonPark) 39 + 9005:0285:9005:0299 Adaptec 4800SAS (Marauder-X) 40 + 9005:0285:9005:029a Adaptec 4805SAS (Marauder-E) 41 + 9005:0286:9005:02a2 Adaptec 4810SAS (Hurricane) 42 + 1011:0046:9005:0364 Adaptec 5400S (Mustang) 43 + 1011:0046:9005:0365 Adaptec 5400S (Mustang) 44 + 9005:0283:9005:0283 Adaptec Catapult (3210S with arc firmware) 45 + 9005:0284:9005:0284 Adaptec Tomcat (3410S with arc firmware) 46 + 9005:0287:9005:0800 Adaptec Themisto (Jupiter) 47 + 9005:0200:9005:0200 Adaptec Themisto (Jupiter) 48 + 9005:0286:9005:0800 Adaptec Callisto (Jupiter) 49 + 1011:0046:9005:1364 Dell PERC 2/QC (Quad Channel, Mustang) 50 + 1028:0001:1028:0001 Dell PERC 2/Si (Iguana) 51 + 1028:0003:1028:0003 Dell PERC 3/Si (SlimFast) 52 + 1028:0002:1028:0002 Dell PERC 3/Di (Opal) 53 + 1028:0004:1028:0004 Dell PERC 3/DiF (Iguana) 54 + 1028:0002:1028:00d1 Dell PERC 3/DiV (Viper) 55 + 1028:0002:1028:00d9 Dell PERC 3/DiL (Lexus) 56 + 1028:000a:1028:0106 Dell PERC 3/DiJ (Jaguar) 57 + 1028:000a:1028:011b Dell PERC 3/DiD (Dagger) 58 + 1028:000a:1028:0121 Dell PERC 3/DiB (Boxster) 59 + 9005:0285:1028:0287 Dell PERC 320/DC (Vulcan) 60 + 9005:0285:1028:0291 Dell CERC 2 (DellCorsair) 61 + 1011:0046:103c:10c2 HP NetRAID-4M (Mustang) 62 + 9005:0285:17aa:0286 Legend S220 (Crusader) 63 + 9005:0285:17aa:0287 Legend S230 (Vulcan) 64 + 9005:0285:9005:0290 IBM ServeRAID 7t (Jaguar) 65 + 9005:0285:1014:02F2 IBM ServeRAID 8i (AvonPark) 66 + 9005:0285:1014:0312 IBM ServeRAID 8i (AvonParkLite) 67 + 9005:0286:1014:9580 IBM ServeRAID 8k/8k-l8 (Aurora) 68 + 9005:0286:1014:9540 IBM ServeRAID 8k/8k-l4 (AuroraLite) 69 + 9005:0286:9005:029f ICP ICP9014R0 (Lancer) 70 + 9005:0286:9005:029e ICP ICP9024R0 (Lancer) 71 + 9005:0286:9005:02a0 ICP ICP9047MA (Lancer) 72 + 9005:0286:9005:02a1 ICP ICP9087MA (Lancer) 73 + 9005:0286:9005:02a4 ICP ICP9085LI (Marauder-X) 74 + 9005:0286:9005:02a5 ICP ICP5085BR (Marauder-E) 75 + 9005:0286:9005:02a3 ICP ICP5085AU (Hurricane) 76 + 9005:0286:9005:02a6 ICP ICP9067MA (Intruder-6) 77 + 9005:0286:9005:02a9 ICP ICP5087AU (Skyray) 78 + 9005:0286:9005:02aa ICP ICP5047AU (Skyray) 79 + 80 + People 81 + ------------------------- 82 + Alan Cox <alan@redhat.com> 83 + Christoph Hellwig <hch@infradead.org> (updates for new-style PCI probing and SCSI host registration, 84 + small cleanups/fixes) 85 + Matt Domsch <matt_domsch@dell.com> (revision ioctl, adapter messages) 86 + Deanna Bonds (non-DASD support, PAE fibs and 64 bit, added new adaptec controllers 87 + added new ioctls, changed scsi interface to use new error handler, 88 + increased the number of fibs and outstanding commands to a container) 89 + 90 + (fixed 64bit and 64G memory model, changed confusing naming convention 91 + where fibs that go to the hardware are consistently called hw_fibs and 92 + not just fibs like the name of the driver tracking structure) 93 + Mark Salyzyn <Mark_Salyzyn@adaptec.com> Fixed panic issues and added some new product ids for upcoming hbas. Performance tuning, card failover and bug mitigations. 94 + 95 + Original Driver 96 + ------------------------- 97 + Adaptec Unix OEM Product Group 98 + 99 + Mailing List 100 + ------------------------- 101 + linux-scsi@vger.kernel.org (Interested parties troll here) 102 + Also note this is very different to Brian's original driver 103 + so don't expect him to support it. 104 + Adaptec does support this driver. Contact Adaptec tech support or 105 + aacraid@adaptec.com 106 + 107 + Original by Brian Boerner February 2001 108 + Rewritten by Alan Cox, November 2001
+1
drivers/message/fusion/Kconfig
··· 23 tristate "Fusion MPT ScsiHost drivers for FC" 24 depends on PCI && SCSI 25 select FUSION 26 ---help--- 27 SCSI HOST support for a Fiber Channel host adapters. 28
··· 23 tristate "Fusion MPT ScsiHost drivers for FC" 24 depends on PCI && SCSI 25 select FUSION 26 + select SCSI_FC_ATTRS 27 ---help--- 28 SCSI HOST support for a Fiber Channel host adapters. 29
+7 -3
drivers/message/fusion/lsi/mpi.h
··· 6 * Title: MPI Message independent structures and definitions 7 * Creation Date: July 27, 2000 8 * 9 - * mpi.h Version: 01.05.08 10 * 11 * Version History 12 * --------------- ··· 74 * 06-24-05 01.05.08 Added function codes for SCSI IO 32 and 75 * TargetAssistExtended requests. 76 * Added EEDP IOCStatus codes. 77 * -------------------------------------------------------------------------- 78 */ 79 ··· 106 /* Note: The major versions of 0xe0 through 0xff are reserved */ 107 108 /* versioning for this MPI header set */ 109 - #define MPI_HEADER_VERSION_UNIT (0x0A) 110 #define MPI_HEADER_VERSION_DEV (0x00) 111 #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) 112 #define MPI_HEADER_VERSION_UNIT_SHIFT (8) ··· 713 #define MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D) 714 #define MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E) 715 #define MPI_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F) 716 717 /****************************************************************************/ 718 /* Additional FCP target values (obsolete) */ ··· 749 #define MPI_IOCSTATUS_LAN_CANCELED (0x0087) 750 751 /****************************************************************************/ 752 - /* Serial Attached SCSI values */ 753 /****************************************************************************/ 754 755 #define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
··· 6 * Title: MPI Message independent structures and definitions 7 * Creation Date: July 27, 2000 8 * 9 + * mpi.h Version: 01.05.10 10 * 11 * Version History 12 * --------------- ··· 74 * 06-24-05 01.05.08 Added function codes for SCSI IO 32 and 75 * TargetAssistExtended requests. 76 * Added EEDP IOCStatus codes. 77 + * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. 78 + * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. 79 * -------------------------------------------------------------------------- 80 */ 81 ··· 104 /* Note: The major versions of 0xe0 through 0xff are reserved */ 105 106 /* versioning for this MPI header set */ 107 + #define MPI_HEADER_VERSION_UNIT (0x0C) 108 #define MPI_HEADER_VERSION_DEV (0x00) 109 #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) 110 #define MPI_HEADER_VERSION_UNIT_SHIFT (8) ··· 711 #define MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D) 712 #define MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E) 713 #define MPI_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F) 714 + #define MPI_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT (0x0070) 715 + #define MPI_IOCSTATUS_TARGET_NAK_RECEIVED (0x0071) 716 717 /****************************************************************************/ 718 /* Additional FCP target values (obsolete) */ ··· 745 #define MPI_IOCSTATUS_LAN_CANCELED (0x0087) 746 747 /****************************************************************************/ 748 + /* Serial Attached SCSI values */ 749 /****************************************************************************/ 750 751 #define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
+95 -59
drivers/message/fusion/lsi/mpi_cnfg.h
··· 6 * Title: MPI Config message, structures, and Pages 7 * Creation Date: July 27, 2000 8 * 9 - * mpi_cnfg.h Version: 01.05.09 10 * 11 * Version History 12 * --------------- ··· 249 * Added OwnerDevHandle and Flags field to SAS PHY Page 0. 250 * Added IOC GPIO Flags define to SAS Enclosure Page 0. 251 * Fixed the value for MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT. 252 * -------------------------------------------------------------------------- 253 */ 254 ··· 511 #define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) 512 #define MPI_MANUFACTPAGE_DEVICEID_FC939X (0x0642) 513 #define MPI_MANUFACTPAGE_DEVICEID_FC949X (0x0640) 514 - #define MPI_MANUFACTPAGE_DEVICEID_FC949ES (0x0646) 515 /* SCSI */ 516 #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) 517 #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) ··· 527 #define MPI_MANUFACTPAGE_DEVID_SAS1066E (0x005A) 528 #define MPI_MANUFACTPAGE_DEVID_SAS1068 (0x0054) 529 #define MPI_MANUFACTPAGE_DEVID_SAS1068E (0x0058) 530 - #define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0060) 531 532 533 typedef struct _CONFIG_PAGE_MANUFACTURING_0 ··· 619 U32 IMVolumeSettings; /* 50h */ 620 U32 Reserved3; /* 54h */ 621 U32 Reserved4; /* 58h */ 622 - U8 ISDataScrubRate; /* 5Ch */ 623 - U8 ISResyncRate; /* 5Dh */ 624 - U16 Reserved5; /* 5Eh */ 625 U8 IMEDataScrubRate; /* 60h */ 626 U8 IMEResyncRate; /* 61h */ 627 U16 Reserved6; /* 62h */ ··· 631 } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, 632 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; 633 634 - #define MPI_MANUFACTURING4_PAGEVERSION (0x02) 635 636 /* defines for the Flags field */ 637 #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) 638 639 ··· 689 } CONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, 690 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; 691 692 - #define MPI_IOUNITPAGE1_PAGEVERSION (0x01) 693 694 /* IO Unit Page 1 Flags defines */ 695 #define MPI_IOUNITPAGE1_MULTI_FUNCTION (0x00000000) ··· 701 #define MPI_IOUNITPAGE1_DISABLE_IR (0x00000040) 702 #define MPI_IOUNITPAGE1_FORCE_32 (0x00000080) 703 #define MPI_IOUNITPAGE1_NATIVE_COMMAND_Q_DISABLE (0x00000100) 704 - 705 706 typedef struct _MPI_ADAPTER_INFO 707 { ··· 988 U32 Reserved1; /* 0Ch */ 989 U32 DeviceSettings; /* 10h */ 990 U16 NumberOfDevices; /* 14h */ 991 - U16 Reserved2; /* 16h */ 992 U16 IOTimeoutBlockDevicesNonRM; /* 18h */ 993 U16 IOTimeoutSequential; /* 1Ah */ 994 U16 IOTimeoutOther; /* 1Ch */ ··· 997 } CONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1, 998 BIOSPage1_t, MPI_POINTER pBIOSPage1_t; 999 1000 - #define MPI_BIOSPAGE1_PAGEVERSION (0x02) 1001 1002 /* values for the BiosOptions field */ 1003 #define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) ··· 1006 #define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) 1007 1008 /* values for the IOCSettings field */ 1009 #define MPI_BIOSPAGE1_IOCSET_MASK_PORT_ENABLE_DELAY (0x00F00000) 1010 #define MPI_BIOSPAGE1_IOCSET_SHIFT_PORT_ENABLE_DELAY (20) 1011 #define MPI_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) 1012 #define MPI_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT (0x00000000) 1013 #define MPI_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT (0x00010000) ··· 1043 #define MPI_BIOSPAGE1_DEVSET_DISABLE_RM_LUN (0x00000004) 1044 #define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) 1045 #define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001) 1046 1047 typedef struct _MPI_BOOT_DEVICE_ADAPTER_ORDER 1048 { ··· 1266 1267 #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD (8) 1268 #define MPI_SCSIPORTPAGE0_CAP_GET_MIN_SYNC_PERIOD(Cap) \ 1269 - ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MIN_SYNC_PERIOD) \ 1270 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD \ 1271 ) 1272 #define MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1273 #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET (16) 1274 #define MPI_SCSIPORTPAGE0_CAP_GET_MAX_SYNC_OFFSET(Cap) \ 1275 - ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \ 1276 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \ 1277 ) 1278 #define MPI_SCSIPORTPAGE0_CAP_IDP (0x08000000) ··· 2403 } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, 2404 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; 2405 2406 - #define MPI_SASIOUNITPAGE1_PAGEVERSION (0x04) 2407 2408 /* values for SAS IO Unit Page 1 ControlFlags */ 2409 - #define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST (0x8000) 2410 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_3_0_MAX (0x4000) 2411 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_1_5_MAX (0x2000) 2412 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_SW_PRESERVE (0x1000) 2413 - #define MPI_SAS_IOUNIT1_CONTROL_DISABLE_SAS_HASH (0x0800) 2414 2415 - #define MPI_SAS_IOUNIT1_CONTROL_MASK_DEV_SUPPORT (0x0600) 2416 - #define MPI_SAS_IOUNIT1_CONTROL_SHIFT_DEV_SUPPORT (9) 2417 - #define MPI_SAS_IOUNIT1_CONTROL_DEV_SUPPORT_BOTH (0x00) 2418 - #define MPI_SAS_IOUNIT1_CONTROL_DEV_SAS_SUPPORT (0x01) 2419 - #define MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT (0x02) 2420 2421 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_48BIT_LBA_REQUIRED (0x0080) 2422 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_SMART_REQUIRED (0x0040) 2423 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_NCQ_REQUIRED (0x0020) 2424 - #define MPI_SAS_IOUNIT1_CONTROL_SATA_FUA_REQUIRED (0x0010) 2425 - #define MPI_SAS_IOUNIT1_CONTROL_PHY_ENABLE_ORDER_HIGH (0x0008) 2426 - #define MPI_SAS_IOUNIT1_CONTROL_SUBTRACTIVE_ILLEGAL (0x0004) 2427 - #define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002) 2428 - #define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) 2429 2430 /* values for SAS IO Unit Page 1 PortFlags */ 2431 - #define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) 2432 - #define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) 2433 - #define MPI_SAS_IOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) 2434 2435 /* values for SAS IO Unit Page 0 PhyFlags */ 2436 - #define MPI_SAS_IOUNIT1_PHY_FLAGS_PHY_DISABLE (0x04) 2437 - #define MPI_SAS_IOUNIT1_PHY_FLAGS_TX_INVERT (0x02) 2438 - #define MPI_SAS_IOUNIT1_PHY_FLAGS_RX_INVERT (0x01) 2439 2440 /* values for SAS IO Unit Page 0 MaxMinLinkRate */ 2441 - #define MPI_SAS_IOUNIT1_MAX_RATE_MASK (0xF0) 2442 - #define MPI_SAS_IOUNIT1_MAX_RATE_1_5 (0x80) 2443 - #define MPI_SAS_IOUNIT1_MAX_RATE_3_0 (0x90) 2444 - #define MPI_SAS_IOUNIT1_MIN_RATE_MASK (0x0F) 2445 - #define MPI_SAS_IOUNIT1_MIN_RATE_1_5 (0x08) 2446 - #define MPI_SAS_IOUNIT1_MIN_RATE_3_0 (0x09) 2447 2448 /* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ 2449 ··· 2452 typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2 2453 { 2454 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2455 - U32 Reserved1; /* 08h */ 2456 U16 MaxPersistentIDs; /* 0Ch */ 2457 U16 NumPersistentIDsUsed; /* 0Eh */ 2458 U8 Status; /* 10h */ 2459 U8 Flags; /* 11h */ 2460 - U16 MaxNumPhysicalMappedIDs;/* 12h */ /* 12h */ 2461 } CONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2, 2462 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t; 2463 2464 - #define MPI_SASIOUNITPAGE2_PAGEVERSION (0x04) 2465 2466 /* values for SAS IO Unit Page 2 Status field */ 2467 #define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02) ··· 2477 #define MPI_SAS_IOUNIT2_FLAGS_NO_PHYS_MAP (0x00) 2478 #define MPI_SAS_IOUNIT2_FLAGS_DIRECT_ATTACH_PHYS_MAP (0x01) 2479 #define MPI_SAS_IOUNIT2_FLAGS_ENCLOSURE_SLOT_PHYS_MAP (0x02) 2480 2481 #define MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT (0x10) 2482 #define MPI_SAS_IOUNIT2_FLAGS_DA_STARTING_SLOT (0x20) ··· 2510 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2511 U8 PhysicalPort; /* 08h */ 2512 U8 Reserved1; /* 09h */ 2513 - U16 Reserved2; /* 0Ah */ 2514 U64 SASAddress; /* 0Ch */ 2515 U32 DiscoveryStatus; /* 14h */ 2516 U16 DevHandle; /* 18h */ ··· 2524 } CONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0, 2525 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t; 2526 2527 - #define MPI_SASEXPANDER0_PAGEVERSION (0x02) 2528 2529 /* values for SAS Expander Page 0 DiscoveryStatus field */ 2530 #define MPI_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001) ··· 2564 U8 NegotiatedLinkRate; /* 1Fh */ 2565 U8 PhyIdentifier; /* 20h */ 2566 U8 AttachedPhyIdentifier; /* 21h */ 2567 - U8 NumTableEntriesProg; /* 22h */ 2568 U8 DiscoveryInfo; /* 23h */ 2569 - U32 Reserved3; /* 24h */ 2570 } CONFIG_PAGE_SAS_EXPANDER_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_1, 2571 SasExpanderPage1_t, MPI_POINTER pSasExpanderPage1_t; 2572 ··· 2803 #define MPI_LOG_0_NUM_LOG_ENTRIES (1) 2804 #endif 2805 2806 - #define MPI_LOG_0_LOG_DATA_LENGTH (20) 2807 2808 typedef struct _MPI_LOG_0_ENTRY 2809 { 2810 - U64 WWID; /* 00h */ 2811 - U32 TimeStamp; /* 08h */ 2812 - U32 Reserved1; /* 0Ch */ 2813 - U16 LogSequence; /* 10h */ 2814 - U16 LogEntryQualifier; /* 12h */ 2815 - U8 LogData[MPI_LOG_0_LOG_DATA_LENGTH]; /* 14h */ 2816 } MPI_LOG_0_ENTRY, MPI_POINTER PTR_MPI_LOG_0_ENTRY, 2817 MpiLog0Entry_t, MPI_POINTER pMpiLog0Entry_t; 2818 ··· 2830 } CONFIG_PAGE_LOG_0, MPI_POINTER PTR_CONFIG_PAGE_LOG_0, 2831 LogPage0_t, MPI_POINTER pLogPage0_t; 2832 2833 - #define MPI_LOG_0_PAGEVERSION (0x00) 2834 2835 2836 #endif
··· 6 * Title: MPI Config message, structures, and Pages 7 * Creation Date: July 27, 2000 8 * 9 + * mpi_cnfg.h Version: 01.05.11 10 * 11 * Version History 12 * --------------- ··· 249 * Added OwnerDevHandle and Flags field to SAS PHY Page 0. 250 * Added IOC GPIO Flags define to SAS Enclosure Page 0. 251 * Fixed the value for MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT. 252 + * 08-03-05 01.05.10 Removed ISDataScrubRate and ISResyncRate from 253 + * Manufacturing Page 4. 254 + * Added MPI_IOUNITPAGE1_SATA_WRITE_CACHE_DISABLE bit. 255 + * Added NumDevsPerEnclosure field to SAS IO Unit page 2. 256 + * Added MPI_SAS_IOUNIT2_FLAGS_HOST_ASSIGNED_PHYS_MAP 257 + * define. 258 + * Added EnclosureHandle field to SAS Expander page 0. 259 + * Removed redundant NumTableEntriesProg field from SAS 260 + * Expander Page 1. 261 + * 08-30-05 01.05.11 Added DeviceID for FC949E and changed the DeviceID for 262 + * SAS1078. 263 + * Added more defines for Manufacturing Page 4 Flags field. 264 + * Added more defines for IOCSettings and added 265 + * ExpanderSpinup field to Bios Page 1. 266 + * Added postpone SATA Init bit to SAS IO Unit Page 1 267 + * ControlFlags. 268 + * Changed LogEntry format for Log Page 0. 269 * -------------------------------------------------------------------------- 270 */ 271 ··· 494 #define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) 495 #define MPI_MANUFACTPAGE_DEVICEID_FC939X (0x0642) 496 #define MPI_MANUFACTPAGE_DEVICEID_FC949X (0x0640) 497 + #define MPI_MANUFACTPAGE_DEVICEID_FC949E (0x0646) 498 /* SCSI */ 499 #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) 500 #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) ··· 510 #define MPI_MANUFACTPAGE_DEVID_SAS1066E (0x005A) 511 #define MPI_MANUFACTPAGE_DEVID_SAS1068 (0x0054) 512 #define MPI_MANUFACTPAGE_DEVID_SAS1068E (0x0058) 513 + #define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0062) 514 515 516 typedef struct _CONFIG_PAGE_MANUFACTURING_0 ··· 602 U32 IMVolumeSettings; /* 50h */ 603 U32 Reserved3; /* 54h */ 604 U32 Reserved4; /* 58h */ 605 + U32 Reserved5; /* 5Ch */ 606 U8 IMEDataScrubRate; /* 60h */ 607 U8 IMEResyncRate; /* 61h */ 608 U16 Reserved6; /* 62h */ ··· 616 } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, 617 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; 618 619 + #define MPI_MANUFACTURING4_PAGEVERSION (0x03) 620 621 /* defines for the Flags field */ 622 + #define MPI_MANPAGE4_IME_DISABLE (0x20) 623 + #define MPI_MANPAGE4_IM_DISABLE (0x10) 624 + #define MPI_MANPAGE4_IS_DISABLE (0x08) 625 + #define MPI_MANPAGE4_IR_MODEPAGE8_DISABLE (0x04) 626 + #define MPI_MANPAGE4_IM_RESYNC_CACHE_ENABLE (0x02) 627 #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) 628 629 ··· 669 } CONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, 670 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; 671 672 + #define MPI_IOUNITPAGE1_PAGEVERSION (0x02) 673 674 /* IO Unit Page 1 Flags defines */ 675 #define MPI_IOUNITPAGE1_MULTI_FUNCTION (0x00000000) ··· 681 #define MPI_IOUNITPAGE1_DISABLE_IR (0x00000040) 682 #define MPI_IOUNITPAGE1_FORCE_32 (0x00000080) 683 #define MPI_IOUNITPAGE1_NATIVE_COMMAND_Q_DISABLE (0x00000100) 684 + #define MPI_IOUNITPAGE1_SATA_WRITE_CACHE_DISABLE (0x00000200) 685 686 typedef struct _MPI_ADAPTER_INFO 687 { ··· 968 U32 Reserved1; /* 0Ch */ 969 U32 DeviceSettings; /* 10h */ 970 U16 NumberOfDevices; /* 14h */ 971 + U8 ExpanderSpinup; /* 16h */ 972 + U8 Reserved2; /* 17h */ 973 U16 IOTimeoutBlockDevicesNonRM; /* 18h */ 974 U16 IOTimeoutSequential; /* 1Ah */ 975 U16 IOTimeoutOther; /* 1Ch */ ··· 976 } CONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1, 977 BIOSPage1_t, MPI_POINTER pBIOSPage1_t; 978 979 + #define MPI_BIOSPAGE1_PAGEVERSION (0x03) 980 981 /* values for the BiosOptions field */ 982 #define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) ··· 985 #define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) 986 987 /* values for the IOCSettings field */ 988 + #define MPI_BIOSPAGE1_IOCSET_MASK_INITIAL_SPINUP_DELAY (0x0F000000) 989 + #define MPI_BIOSPAGE1_IOCSET_SHIFT_INITIAL_SPINUP_DELAY (24) 990 + 991 #define MPI_BIOSPAGE1_IOCSET_MASK_PORT_ENABLE_DELAY (0x00F00000) 992 #define MPI_BIOSPAGE1_IOCSET_SHIFT_PORT_ENABLE_DELAY (20) 993 + 994 + #define MPI_BIOSPAGE1_IOCSET_AUTO_PORT_ENABLE (0x00080000) 995 + #define MPI_BIOSPAGE1_IOCSET_DIRECT_ATTACH_SPINUP_MODE (0x00040000) 996 + 997 #define MPI_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) 998 #define MPI_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT (0x00000000) 999 #define MPI_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT (0x00010000) ··· 1015 #define MPI_BIOSPAGE1_DEVSET_DISABLE_RM_LUN (0x00000004) 1016 #define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) 1017 #define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001) 1018 + 1019 + /* defines for the ExpanderSpinup field */ 1020 + #define MPI_BIOSPAGE1_EXPSPINUP_MASK_MAX_TARGET (0xF0) 1021 + #define MPI_BIOSPAGE1_EXPSPINUP_SHIFT_MAX_TARGET (4) 1022 + #define MPI_BIOSPAGE1_EXPSPINUP_MASK_DELAY (0x0F) 1023 1024 typedef struct _MPI_BOOT_DEVICE_ADAPTER_ORDER 1025 { ··· 1233 1234 #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD (8) 1235 #define MPI_SCSIPORTPAGE0_CAP_GET_MIN_SYNC_PERIOD(Cap) \ 1236 + ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK) \ 1237 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD \ 1238 ) 1239 #define MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1240 #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET (16) 1241 #define MPI_SCSIPORTPAGE0_CAP_GET_MAX_SYNC_OFFSET(Cap) \ 1242 + ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK) \ 1243 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \ 1244 ) 1245 #define MPI_SCSIPORTPAGE0_CAP_IDP (0x08000000) ··· 2370 } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, 2371 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; 2372 2373 + #define MPI_SASIOUNITPAGE1_PAGEVERSION (0x05) 2374 2375 /* values for SAS IO Unit Page 1 ControlFlags */ 2376 + #define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST (0x8000) 2377 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_3_0_MAX (0x4000) 2378 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_1_5_MAX (0x2000) 2379 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_SW_PRESERVE (0x1000) 2380 + #define MPI_SAS_IOUNIT1_CONTROL_DISABLE_SAS_HASH (0x0800) 2381 2382 + #define MPI_SAS_IOUNIT1_CONTROL_MASK_DEV_SUPPORT (0x0600) 2383 + #define MPI_SAS_IOUNIT1_CONTROL_SHIFT_DEV_SUPPORT (9) 2384 + #define MPI_SAS_IOUNIT1_CONTROL_DEV_SUPPORT_BOTH (0x00) 2385 + #define MPI_SAS_IOUNIT1_CONTROL_DEV_SAS_SUPPORT (0x01) 2386 + #define MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT (0x02) 2387 2388 + #define MPI_SAS_IOUNIT1_CONTROL_POSTPONE_SATA_INIT (0x0100) 2389 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_48BIT_LBA_REQUIRED (0x0080) 2390 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_SMART_REQUIRED (0x0040) 2391 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_NCQ_REQUIRED (0x0020) 2392 + #define MPI_SAS_IOUNIT1_CONTROL_SATA_FUA_REQUIRED (0x0010) 2393 + #define MPI_SAS_IOUNIT1_CONTROL_PHY_ENABLE_ORDER_HIGH (0x0008) 2394 + #define MPI_SAS_IOUNIT1_CONTROL_SUBTRACTIVE_ILLEGAL (0x0004) 2395 + #define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002) 2396 + #define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) 2397 2398 /* values for SAS IO Unit Page 1 PortFlags */ 2399 + #define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) 2400 + #define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) 2401 + #define MPI_SAS_IOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) 2402 2403 /* values for SAS IO Unit Page 0 PhyFlags */ 2404 + #define MPI_SAS_IOUNIT1_PHY_FLAGS_PHY_DISABLE (0x04) 2405 + #define MPI_SAS_IOUNIT1_PHY_FLAGS_TX_INVERT (0x02) 2406 + #define MPI_SAS_IOUNIT1_PHY_FLAGS_RX_INVERT (0x01) 2407 2408 /* values for SAS IO Unit Page 0 MaxMinLinkRate */ 2409 + #define MPI_SAS_IOUNIT1_MAX_RATE_MASK (0xF0) 2410 + #define MPI_SAS_IOUNIT1_MAX_RATE_1_5 (0x80) 2411 + #define MPI_SAS_IOUNIT1_MAX_RATE_3_0 (0x90) 2412 + #define MPI_SAS_IOUNIT1_MIN_RATE_MASK (0x0F) 2413 + #define MPI_SAS_IOUNIT1_MIN_RATE_1_5 (0x08) 2414 + #define MPI_SAS_IOUNIT1_MIN_RATE_3_0 (0x09) 2415 2416 /* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ 2417 ··· 2418 typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2 2419 { 2420 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2421 + U8 NumDevsPerEnclosure; /* 08h */ 2422 + U8 Reserved1; /* 09h */ 2423 + U16 Reserved2; /* 0Ah */ 2424 U16 MaxPersistentIDs; /* 0Ch */ 2425 U16 NumPersistentIDsUsed; /* 0Eh */ 2426 U8 Status; /* 10h */ 2427 U8 Flags; /* 11h */ 2428 + U16 MaxNumPhysicalMappedIDs;/* 12h */ 2429 } CONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2, 2430 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t; 2431 2432 + #define MPI_SASIOUNITPAGE2_PAGEVERSION (0x05) 2433 2434 /* values for SAS IO Unit Page 2 Status field */ 2435 #define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02) ··· 2441 #define MPI_SAS_IOUNIT2_FLAGS_NO_PHYS_MAP (0x00) 2442 #define MPI_SAS_IOUNIT2_FLAGS_DIRECT_ATTACH_PHYS_MAP (0x01) 2443 #define MPI_SAS_IOUNIT2_FLAGS_ENCLOSURE_SLOT_PHYS_MAP (0x02) 2444 + #define MPI_SAS_IOUNIT2_FLAGS_HOST_ASSIGNED_PHYS_MAP (0x07) 2445 2446 #define MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT (0x10) 2447 #define MPI_SAS_IOUNIT2_FLAGS_DA_STARTING_SLOT (0x20) ··· 2473 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2474 U8 PhysicalPort; /* 08h */ 2475 U8 Reserved1; /* 09h */ 2476 + U16 EnclosureHandle; /* 0Ah */ 2477 U64 SASAddress; /* 0Ch */ 2478 U32 DiscoveryStatus; /* 14h */ 2479 U16 DevHandle; /* 18h */ ··· 2487 } CONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0, 2488 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t; 2489 2490 + #define MPI_SASEXPANDER0_PAGEVERSION (0x03) 2491 2492 /* values for SAS Expander Page 0 DiscoveryStatus field */ 2493 #define MPI_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001) ··· 2527 U8 NegotiatedLinkRate; /* 1Fh */ 2528 U8 PhyIdentifier; /* 20h */ 2529 U8 AttachedPhyIdentifier; /* 21h */ 2530 + U8 Reserved3; /* 22h */ 2531 U8 DiscoveryInfo; /* 23h */ 2532 + U32 Reserved4; /* 24h */ 2533 } CONFIG_PAGE_SAS_EXPANDER_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_1, 2534 SasExpanderPage1_t, MPI_POINTER pSasExpanderPage1_t; 2535 ··· 2766 #define MPI_LOG_0_NUM_LOG_ENTRIES (1) 2767 #endif 2768 2769 + #define MPI_LOG_0_LOG_DATA_LENGTH (0x1C) 2770 2771 typedef struct _MPI_LOG_0_ENTRY 2772 { 2773 + U32 TimeStamp; /* 00h */ 2774 + U32 Reserved1; /* 04h */ 2775 + U16 LogSequence; /* 08h */ 2776 + U16 LogEntryQualifier; /* 0Ah */ 2777 + U8 LogData[MPI_LOG_0_LOG_DATA_LENGTH]; /* 0Ch */ 2778 } MPI_LOG_0_ENTRY, MPI_POINTER PTR_MPI_LOG_0_ENTRY, 2779 MpiLog0Entry_t, MPI_POINTER pMpiLog0Entry_t; 2780 ··· 2794 } CONFIG_PAGE_LOG_0, MPI_POINTER PTR_CONFIG_PAGE_LOG_0, 2795 LogPage0_t, MPI_POINTER pLogPage0_t; 2796 2797 + #define MPI_LOG_0_PAGEVERSION (0x01) 2798 2799 2800 #endif
+53 -24
drivers/message/fusion/lsi/mpi_history.txt
··· 6 Copyright (c) 2000-2005 LSI Logic Corporation. 7 8 --------------------------------------- 9 - Header Set Release Version: 01.05.10 10 - Header Set Release Date: 03-11-05 11 --------------------------------------- 12 13 Filename Current version Prior version 14 ---------- --------------- ------------- 15 - mpi.h 01.05.08 01.05.07 16 - mpi_ioc.h 01.05.09 01.05.08 17 - mpi_cnfg.h 01.05.09 01.05.08 18 - mpi_init.h 01.05.05 01.05.04 19 - mpi_targ.h 01.05.05 01.05.04 20 mpi_fc.h 01.05.01 01.05.01 21 mpi_lan.h 01.05.01 01.05.01 22 mpi_raid.h 01.05.02 01.05.02 23 mpi_tool.h 01.05.03 01.05.03 24 mpi_inb.h 01.05.01 01.05.01 25 - mpi_sas.h 01.05.01 01.05.01 26 - mpi_type.h 01.05.01 01.05.01 27 - mpi_history.txt 01.05.09 01.05.09 28 29 30 * Date Version Description ··· 91 * 06-24-05 01.05.08 Added function codes for SCSI IO 32 and 92 * TargetAssistExtended requests. 93 * Added EEDP IOCStatus codes. 94 * -------------------------------------------------------------------------- 95 96 mpi_ioc.h ··· 166 * Removed IOCFacts Reply EEDP Capability bit. 167 * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. 168 * Added Max SATA Targets to SAS Discovery Error event. 169 * -------------------------------------------------------------------------- 170 171 mpi_cnfg.h ··· 408 * Added OwnerDevHandle and Flags field to SAS PHY Page 0. 409 * Added IOC GPIO Flags define to SAS Enclosure Page 0. 410 * Fixed the value for MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT. 411 * -------------------------------------------------------------------------- 412 413 mpi_init.h ··· 465 * addressing. 466 * 06-24-05 01.05.05 Added SCSI IO 32 structures and defines. 467 * Added four new defines for SEP SlotStatus. 468 * -------------------------------------------------------------------------- 469 470 mpi_targ.h ··· 607 608 mpi_sas.h 609 * 08-19-04 01.05.01 Original release. 610 * -------------------------------------------------------------------------- 611 612 mpi_type.h ··· 620 * 08-08-01 01.02.01 Original release for v1.2 work. 621 * 05-11-04 01.03.01 Original release for MPI v1.3. 622 * 08-19-04 01.05.01 Original release for MPI v1.5. 623 * -------------------------------------------------------------------------- 624 625 mpi_history.txt Parts list history 626 627 - Filename 01.05.10 01.05.09 628 - ---------- -------- -------- 629 - mpi.h 01.05.08 01.05.07 630 - mpi_ioc.h 01.05.09 01.05.08 631 - mpi_cnfg.h 01.05.09 01.05.08 632 - mpi_init.h 01.05.05 01.05.04 633 - mpi_targ.h 01.05.05 01.05.04 634 - mpi_fc.h 01.05.01 01.05.01 635 - mpi_lan.h 01.05.01 01.05.01 636 - mpi_raid.h 01.05.02 01.05.02 637 - mpi_tool.h 01.05.03 01.05.03 638 - mpi_inb.h 01.05.01 01.05.01 639 - mpi_sas.h 01.05.01 01.05.01 640 - mpi_type.h 01.05.01 01.05.01 641 642 Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 643 ---------- -------- -------- -------- -------- -------- --------
··· 6 Copyright (c) 2000-2005 LSI Logic Corporation. 7 8 --------------------------------------- 9 + Header Set Release Version: 01.05.12 10 + Header Set Release Date: 08-30-05 11 --------------------------------------- 12 13 Filename Current version Prior version 14 ---------- --------------- ------------- 15 + mpi.h 01.05.10 01.05.09 16 + mpi_ioc.h 01.05.10 01.05.09 17 + mpi_cnfg.h 01.05.11 01.05.10 18 + mpi_init.h 01.05.06 01.05.06 19 + mpi_targ.h 01.05.05 01.05.05 20 mpi_fc.h 01.05.01 01.05.01 21 mpi_lan.h 01.05.01 01.05.01 22 mpi_raid.h 01.05.02 01.05.02 23 mpi_tool.h 01.05.03 01.05.03 24 mpi_inb.h 01.05.01 01.05.01 25 + mpi_sas.h 01.05.02 01.05.01 26 + mpi_type.h 01.05.02 01.05.01 27 + mpi_history.txt 01.05.12 01.05.11 28 29 30 * Date Version Description ··· 91 * 06-24-05 01.05.08 Added function codes for SCSI IO 32 and 92 * TargetAssistExtended requests. 93 * Added EEDP IOCStatus codes. 94 + * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. 95 + * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. 96 * -------------------------------------------------------------------------- 97 98 mpi_ioc.h ··· 164 * Removed IOCFacts Reply EEDP Capability bit. 165 * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. 166 * Added Max SATA Targets to SAS Discovery Error event. 167 + * 08-30-05 01.05.10 Added 4 new events and their event data structures. 168 + * Added new ReasonCode value for SAS Device Status Change 169 + * event. 170 + * Added new family code for FC949E. 171 * -------------------------------------------------------------------------- 172 173 mpi_cnfg.h ··· 402 * Added OwnerDevHandle and Flags field to SAS PHY Page 0. 403 * Added IOC GPIO Flags define to SAS Enclosure Page 0. 404 * Fixed the value for MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT. 405 + * 08-03-05 01.05.10 Removed ISDataScrubRate and ISResyncRate from 406 + * Manufacturing Page 4. 407 + * Added MPI_IOUNITPAGE1_SATA_WRITE_CACHE_DISABLE bit. 408 + * Added NumDevsPerEnclosure field to SAS IO Unit page 2. 409 + * Added MPI_SAS_IOUNIT2_FLAGS_HOST_ASSIGNED_PHYS_MAP 410 + * define. 411 + * Added EnclosureHandle field to SAS Expander page 0. 412 + * Removed redundant NumTableEntriesProg field from SAS 413 + * Expander Page 1. 414 + * 08-30-05 01.05.11 Added DeviceID for FC949E and changed the DeviceID for 415 + * SAS1078. 416 + * Added more defines for Manufacturing Page 4 Flags field. 417 + * Added more defines for IOCSettings and added 418 + * ExpanderSpinup field to Bios Page 1. 419 + * Added postpone SATA Init bit to SAS IO Unit Page 1 420 + * ControlFlags. 421 + * Changed LogEntry format for Log Page 0. 422 * -------------------------------------------------------------------------- 423 424 mpi_init.h ··· 442 * addressing. 443 * 06-24-05 01.05.05 Added SCSI IO 32 structures and defines. 444 * Added four new defines for SEP SlotStatus. 445 + * 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them 446 + * unique in the first 32 characters. 447 * -------------------------------------------------------------------------- 448 449 mpi_targ.h ··· 582 583 mpi_sas.h 584 * 08-19-04 01.05.01 Original release. 585 + * 08-30-05 01.05.02 Added DeviceInfo bit for SEP. 586 + * Added PrimFlags and Primitive field to SAS IO Unit 587 + * Control request, and added a new operation code. 588 * -------------------------------------------------------------------------- 589 590 mpi_type.h ··· 592 * 08-08-01 01.02.01 Original release for v1.2 work. 593 * 05-11-04 01.03.01 Original release for MPI v1.3. 594 * 08-19-04 01.05.01 Original release for MPI v1.5. 595 + * 08-30-05 01.05.02 Added PowerPC option to #ifdef's. 596 * -------------------------------------------------------------------------- 597 598 mpi_history.txt Parts list history 599 600 + Filename 01.05.12 01.05.11 01.05.10 01.05.09 601 + ---------- -------- -------- -------- -------- 602 + mpi.h 01.05.10 01.05.09 01.05.08 01.05.07 603 + mpi_ioc.h 01.05.10 01.05.09 01.05.09 01.05.08 604 + mpi_cnfg.h 01.05.11 01.05.10 01.05.09 01.05.08 605 + mpi_init.h 01.05.06 01.05.06 01.05.05 01.05.04 606 + mpi_targ.h 01.05.05 01.05.05 01.05.05 01.05.04 607 + mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 608 + mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 609 + mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.02 610 + mpi_tool.h 01.05.03 01.05.03 01.05.03 01.05.03 611 + mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 612 + mpi_sas.h 01.05.02 01.05.01 01.05.01 01.05.01 613 + mpi_type.h 01.05.02 01.05.01 01.05.01 01.05.01 614 615 Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 616 ---------- -------- -------- -------- -------- -------- --------
+5 -3
drivers/message/fusion/lsi/mpi_init.h
··· 6 * Title: MPI initiator mode messages and structures 7 * Creation Date: June 8, 2000 8 * 9 - * mpi_init.h Version: 01.05.05 10 * 11 * Version History 12 * --------------- ··· 50 * addressing. 51 * 06-24-05 01.05.05 Added SCSI IO 32 structures and defines. 52 * Added four new defines for SEP SlotStatus. 53 * -------------------------------------------------------------------------- 54 */ 55 ··· 292 293 /* SCSI IO 32 MsgFlags bits */ 294 #define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH (0x01) 295 - #define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH_32 (0x00) 296 - #define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH_64 (0x01) 297 298 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION (0x02) 299 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST (0x00)
··· 6 * Title: MPI initiator mode messages and structures 7 * Creation Date: June 8, 2000 8 * 9 + * mpi_init.h Version: 01.05.06 10 * 11 * Version History 12 * --------------- ··· 50 * addressing. 51 * 06-24-05 01.05.05 Added SCSI IO 32 structures and defines. 52 * Added four new defines for SEP SlotStatus. 53 + * 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them 54 + * unique in the first 32 characters. 55 * -------------------------------------------------------------------------- 56 */ 57 ··· 290 291 /* SCSI IO 32 MsgFlags bits */ 292 #define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH (0x01) 293 + #define MPI_SCSIIO32_MSGFLGS_32_SENSE_WIDTH (0x00) 294 + #define MPI_SCSIIO32_MSGFLGS_64_SENSE_WIDTH (0x01) 295 296 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION (0x02) 297 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST (0x00)
+121 -1
drivers/message/fusion/lsi/mpi_ioc.h
··· 6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 7 * Creation Date: August 11, 2000 8 * 9 - * mpi_ioc.h Version: 01.05.09 10 * 11 * Version History 12 * --------------- ··· 83 * Removed IOCFacts Reply EEDP Capability bit. 84 * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. 85 * Added Max SATA Targets to SAS Discovery Error event. 86 * -------------------------------------------------------------------------- 87 */ 88 ··· 468 #define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) 469 #define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) 470 #define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) 471 472 /* AckRequired field values */ 473 ··· 487 U16 Reserved1; /* 02h */ 488 } EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE, 489 EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t; 490 491 /* SCSI Event data for Port, Bus and Device forms */ 492 ··· 569 #define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) 570 #define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) 571 #define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) 572 573 574 /* SCSI Event data for Queue Full event */ ··· 610 #define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) 611 #define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) 612 #define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) 613 614 /* MPI Link Status Change Event data */ 615 ··· 764 #define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03) 765 #define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08) 766 #define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09) 767 768 /* SAS Discovery Errror Event data */ 769 ··· 988 #define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) /* 919XL and 929XL */ 989 #define MPI_FW_HEADER_PID_FAMILY_939X_FC (0x0004) /* 939X and 949X */ 990 #define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005) 991 /* SAS */ 992 #define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001) 993 #define MPI_FW_HEADER_PID_FAMILY_1068_SAS (0x0002)
··· 6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 7 * Creation Date: August 11, 2000 8 * 9 + * mpi_ioc.h Version: 01.05.10 10 * 11 * Version History 12 * --------------- ··· 83 * Removed IOCFacts Reply EEDP Capability bit. 84 * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. 85 * Added Max SATA Targets to SAS Discovery Error event. 86 + * 08-30-05 01.05.10 Added 4 new events and their event data structures. 87 + * Added new ReasonCode value for SAS Device Status Change 88 + * event. 89 + * Added new family code for FC949E. 90 * -------------------------------------------------------------------------- 91 */ 92 ··· 464 #define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) 465 #define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) 466 #define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) 467 + #define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014) 468 + #define MPI_EVENT_IR2 (0x00000015) 469 + #define MPI_EVENT_SAS_DISCOVERY (0x00000016) 470 + #define MPI_EVENT_LOG_ENTRY_ADDED (0x00000021) 471 472 /* AckRequired field values */ 473 ··· 479 U16 Reserved1; /* 02h */ 480 } EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE, 481 EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t; 482 + 483 + /* LogEntryAdded Event data */ 484 + 485 + /* this structure matches MPI_LOG_0_ENTRY in mpi_cnfg.h */ 486 + #define MPI_EVENT_DATA_LOG_ENTRY_DATA_LENGTH (0x1C) 487 + typedef struct _EVENT_DATA_LOG_ENTRY 488 + { 489 + U32 TimeStamp; /* 00h */ 490 + U32 Reserved1; /* 04h */ 491 + U16 LogSequence; /* 08h */ 492 + U16 LogEntryQualifier; /* 0Ah */ 493 + U8 LogData[MPI_EVENT_DATA_LOG_ENTRY_DATA_LENGTH]; /* 0Ch */ 494 + } EVENT_DATA_LOG_ENTRY, MPI_POINTER PTR_EVENT_DATA_LOG_ENTRY, 495 + MpiEventDataLogEntry_t, MPI_POINTER pMpiEventDataLogEntry_t; 496 + 497 + typedef struct _EVENT_DATA_LOG_ENTRY_ADDED 498 + { 499 + U16 LogSequence; /* 00h */ 500 + U16 Reserved1; /* 02h */ 501 + U32 Reserved2; /* 04h */ 502 + EVENT_DATA_LOG_ENTRY LogEntry; /* 08h */ 503 + } EVENT_DATA_LOG_ENTRY_ADDED, MPI_POINTER PTR_EVENT_DATA_LOG_ENTRY_ADDED, 504 + MpiEventDataLogEntryAdded_t, MPI_POINTER pMpiEventDataLogEntryAdded_t; 505 506 /* SCSI Event data for Port, Bus and Device forms */ 507 ··· 538 #define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) 539 #define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) 540 #define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) 541 + #define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) 542 543 544 /* SCSI Event data for Queue Full event */ ··· 578 #define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) 579 #define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) 580 #define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) 581 + 582 + 583 + /* MPI Integrated RAID Resync Update Event data */ 584 + 585 + typedef struct _MPI_EVENT_DATA_IR_RESYNC_UPDATE 586 + { 587 + U8 VolumeID; /* 00h */ 588 + U8 VolumeBus; /* 01h */ 589 + U8 ResyncComplete; /* 02h */ 590 + U8 Reserved1; /* 03h */ 591 + U32 Reserved2; /* 04h */ 592 + } MPI_EVENT_DATA_IR_RESYNC_UPDATE, 593 + MPI_POINTER PTR_MPI_EVENT_DATA_IR_RESYNC_UPDATE, 594 + MpiEventDataIrResyncUpdate_t, MPI_POINTER pMpiEventDataIrResyncUpdate_t; 595 + 596 + /* MPI IR2 Event data */ 597 + 598 + /* MPI_LD_STATE or MPI_PD_STATE */ 599 + typedef struct _IR2_STATE_CHANGED 600 + { 601 + U16 PreviousState; /* 00h */ 602 + U16 NewState; /* 02h */ 603 + } IR2_STATE_CHANGED, MPI_POINTER PTR_IR2_STATE_CHANGED; 604 + 605 + typedef struct _IR2_PD_INFO 606 + { 607 + U16 DeviceHandle; /* 00h */ 608 + U8 TruncEnclosureHandle; /* 02h */ 609 + U8 TruncatedSlot; /* 03h */ 610 + } IR2_PD_INFO, MPI_POINTER PTR_IR2_PD_INFO; 611 + 612 + typedef union _MPI_IR2_RC_EVENT_DATA 613 + { 614 + IR2_STATE_CHANGED StateChanged; 615 + U32 Lba; 616 + IR2_PD_INFO PdInfo; 617 + } MPI_IR2_RC_EVENT_DATA, MPI_POINTER PTR_MPI_IR2_RC_EVENT_DATA; 618 + 619 + typedef struct _MPI_EVENT_DATA_IR2 620 + { 621 + U8 TargetID; /* 00h */ 622 + U8 Bus; /* 01h */ 623 + U8 ReasonCode; /* 02h */ 624 + U8 PhysDiskNum; /* 03h */ 625 + MPI_IR2_RC_EVENT_DATA IR2EventData; /* 04h */ 626 + } MPI_EVENT_DATA_IR2, MPI_POINTER PTR_MPI_EVENT_DATA_IR2, 627 + MpiEventDataIR2_t, MPI_POINTER pMpiEventDataIR2_t; 628 + 629 + /* MPI IR2 Event data ReasonCode values */ 630 + #define MPI_EVENT_IR2_RC_LD_STATE_CHANGED (0x01) 631 + #define MPI_EVENT_IR2_RC_PD_STATE_CHANGED (0x02) 632 + #define MPI_EVENT_IR2_RC_BAD_BLOCK_TABLE_FULL (0x03) 633 + #define MPI_EVENT_IR2_RC_PD_INSERTED (0x04) 634 + #define MPI_EVENT_IR2_RC_PD_REMOVED (0x05) 635 + #define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED (0x06) 636 + #define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR (0x07) 637 + 638 + /* defines for logical disk states */ 639 + #define MPI_LD_STATE_OPTIMAL (0x00) 640 + #define MPI_LD_STATE_DEGRADED (0x01) 641 + #define MPI_LD_STATE_FAILED (0x02) 642 + #define MPI_LD_STATE_MISSING (0x03) 643 + #define MPI_LD_STATE_OFFLINE (0x04) 644 + 645 + /* defines for physical disk states */ 646 + #define MPI_PD_STATE_ONLINE (0x00) 647 + #define MPI_PD_STATE_MISSING (0x01) 648 + #define MPI_PD_STATE_NOT_COMPATIBLE (0x02) 649 + #define MPI_PD_STATE_FAILED (0x03) 650 + #define MPI_PD_STATE_INITIALIZING (0x04) 651 + #define MPI_PD_STATE_OFFLINE_AT_HOST_REQUEST (0x05) 652 + #define MPI_PD_STATE_FAILED_AT_HOST_REQUEST (0x06) 653 + #define MPI_PD_STATE_OFFLINE_FOR_ANOTHER_REASON (0xFF) 654 655 /* MPI Link Status Change Event data */ 656 ··· 659 #define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03) 660 #define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08) 661 #define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09) 662 + 663 + /* SAS Discovery Event data */ 664 + 665 + typedef struct _EVENT_DATA_SAS_DISCOVERY 666 + { 667 + U32 DiscoveryStatus; /* 00h */ 668 + U32 Reserved1; /* 04h */ 669 + } EVENT_DATA_SAS_DISCOVERY, MPI_POINTER PTR_EVENT_DATA_SAS_DISCOVERY, 670 + EventDataSasDiscovery_t, MPI_POINTER pEventDataSasDiscovery_t; 671 + 672 + #define MPI_EVENT_SAS_DSCVRY_COMPLETE (0x00000000) 673 + #define MPI_EVENT_SAS_DSCVRY_IN_PROGRESS (0x00000001) 674 + #define MPI_EVENT_SAS_DSCVRY_PHY_BITS_MASK (0xFFFF0000) 675 + #define MPI_EVENT_SAS_DSCVRY_PHY_BITS_SHIFT (16) 676 677 /* SAS Discovery Errror Event data */ 678 ··· 869 #define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) /* 919XL and 929XL */ 870 #define MPI_FW_HEADER_PID_FAMILY_939X_FC (0x0004) /* 939X and 949X */ 871 #define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005) 872 + #define MPI_FW_HEADER_PID_FAMILY_949E_FC (0x0006) 873 /* SAS */ 874 #define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001) 875 #define MPI_FW_HEADER_PID_FAMILY_1068_SAS (0x0002)
+89
drivers/message/fusion/lsi/mpi_log_fc.h
···
··· 1 + /* 2 + * Copyright (c) 2000-2001 LSI Logic Corporation. All rights reserved. 3 + * 4 + * NAME: fc_log.h 5 + * SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips 6 + * DESCRIPTION: Contains the enumerated list of values that may be returned 7 + * in the IOCLogInfo field of a MPI Default Reply Message. 8 + * 9 + * CREATION DATE: 6/02/2000 10 + * ID: $Id: fc_log.h,v 4.6 2001/07/26 14:41:33 sschremm Exp $ 11 + */ 12 + 13 + 14 + /* 15 + * MpiIocLogInfo_t enum 16 + * 17 + * These 32 bit values are used in the IOCLogInfo field of the MPI reply 18 + * messages. 19 + * The value is 0xabcccccc where 20 + * a = The type of log info as per the MPI spec. Since these codes are 21 + * all for Fibre Channel this value will always be 2. 22 + * b = Specifies a subclass of the firmware where 23 + * 0 = FCP Initiator 24 + * 1 = FCP Target 25 + * 2 = LAN 26 + * 3 = MPI Message Layer 27 + * 4 = FC Link 28 + * 5 = Context Manager 29 + * 6 = Invalid Field Offset 30 + * 7 = State Change Info 31 + * all others are reserved for future use 32 + * c = A specific value within the subclass. 33 + * 34 + * NOTE: Any new values should be added to the end of each subclass so that the 35 + * codes remain consistent across firmware releases. 36 + */ 37 + typedef enum _MpiIocLogInfoFc 38 + { 39 + MPI_IOCLOGINFO_FC_INIT_BASE = 0x20000000, 40 + MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME = 0x20000001, /* received an out of order frame - unsupported */ 41 + MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* Bad Rx Frame, bad start of frame primative */ 42 + MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME = 0x20000003, /* Bad Rx Frame, bad end of frame primative */ 43 + MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN = 0x20000004, /* Bad Rx Frame, overrun */ 44 + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OTHER = 0x20000005, /* Other errors caught by IOC which require retries */ 45 + MPI_IOCLOGINFO_FC_INIT_ERROR_SUBPROC_DEAD = 0x20000006, /* Main processor could not initialize sub-processor */ 46 + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OVERRUN = 0x20000007, /* Scatter Gather overrun */ 47 + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_BAD_STATUS = 0x20000008, /* Receiver detected context mismatch via invalid header */ 48 + MPI_IOCLOGINFO_FC_INIT_ERROR_RX_UNEXPECTED_FRAME= 0x20000009, /* CtxMgr detected unsupported frame type */ 49 + MPI_IOCLOGINFO_FC_INIT_ERROR_LINK_FAILURE = 0x2000000A, /* Link failure occurred */ 50 + MPI_IOCLOGINFO_FC_INIT_ERROR_TX_TIMEOUT = 0x2000000B, /* Transmitter timeout error */ 51 + 52 + MPI_IOCLOGINFO_FC_TARGET_BASE = 0x21000000, 53 + MPI_IOCLOGINFO_FC_TARGET_NO_PDISC = 0x21000001, /* not sent because we are waiting for a PDISC from the initiator */ 54 + MPI_IOCLOGINFO_FC_TARGET_NO_LOGIN = 0x21000002, /* not sent because we are not logged in to the remote node */ 55 + MPI_IOCLOGINFO_FC_TARGET_DOAR_KILLED_BY_LIP = 0x21000003, /* Data Out, Auto Response, not sent due to a LIP */ 56 + MPI_IOCLOGINFO_FC_TARGET_DIAR_KILLED_BY_LIP = 0x21000004, /* Data In, Auto Response, not sent due to a LIP */ 57 + MPI_IOCLOGINFO_FC_TARGET_DIAR_MISSING_DATA = 0x21000005, /* Data In, Auto Response, missing data frames */ 58 + MPI_IOCLOGINFO_FC_TARGET_DONR_KILLED_BY_LIP = 0x21000006, /* Data Out, No Response, not sent due to a LIP */ 59 + MPI_IOCLOGINFO_FC_TARGET_WRSP_KILLED_BY_LIP = 0x21000007, /* Auto-response after a write not sent due to a LIP */ 60 + MPI_IOCLOGINFO_FC_TARGET_DINR_KILLED_BY_LIP = 0x21000008, /* Data In, No Response, not completed due to a LIP */ 61 + MPI_IOCLOGINFO_FC_TARGET_DINR_MISSING_DATA = 0x21000009, /* Data In, No Response, missing data frames */ 62 + MPI_IOCLOGINFO_FC_TARGET_MRSP_KILLED_BY_LIP = 0x2100000a, /* Manual Response not sent due to a LIP */ 63 + MPI_IOCLOGINFO_FC_TARGET_NO_CLASS_3 = 0x2100000b, /* not sent because remote node does not support Class 3 */ 64 + MPI_IOCLOGINFO_FC_TARGET_LOGIN_NOT_VALID = 0x2100000c, /* not sent because login to remote node not validated */ 65 + MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND = 0x2100000e, /* cleared from the outbound queue after a logout */ 66 + MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN = 0x2100000f, /* cleared waiting for data after a logout */ 67 + 68 + MPI_IOCLOGINFO_FC_LAN_BASE = 0x22000000, 69 + MPI_IOCLOGINFO_FC_LAN_TRANS_SGL_MISSING = 0x22000001, /* Transaction Context Sgl Missing */ 70 + MPI_IOCLOGINFO_FC_LAN_TRANS_WRONG_PLACE = 0x22000002, /* Transaction Context found before an EOB */ 71 + MPI_IOCLOGINFO_FC_LAN_TRANS_RES_BITS_SET = 0x22000003, /* Transaction Context value has reserved bits set */ 72 + MPI_IOCLOGINFO_FC_LAN_WRONG_SGL_FLAG = 0x22000004, /* Invalid SGL Flags */ 73 + 74 + MPI_IOCLOGINFO_FC_MSG_BASE = 0x23000000, 75 + 76 + MPI_IOCLOGINFO_FC_LINK_BASE = 0x24000000, 77 + MPI_IOCLOGINFO_FC_LINK_LOOP_INIT_TIMEOUT = 0x24000001, /* Loop initialization timed out */ 78 + MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED = 0x24000002, /* Another system controller already initialized the loop */ 79 + MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED = 0x24000003, /* Not synchronized to signal or still negotiating (possible cable problem) */ 80 + MPI_IOCLOGINFO_FC_LINK_CRC_ERROR = 0x24000004, /* CRC check detected error on received frame */ 81 + 82 + MPI_IOCLOGINFO_FC_CTX_BASE = 0x25000000, 83 + 84 + MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET = 0x26000000, /* The lower 24 bits give the byte offset of the field in the request message that is invalid */ 85 + MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET = 0x26ffffff, 86 + 87 + MPI_IOCLOGINFO_FC_STATE_CHANGE = 0x27000000 /* The lower 24 bits give additional information concerning state change */ 88 + 89 + } MpiIocLogInfoFc_t;
+162
drivers/message/fusion/lsi/mpi_log_sas.h
···
··· 1 + 2 + /*************************************************************************** 3 + * * 4 + * Copyright 2003 LSI Logic Corporation. All rights reserved. * 5 + * * 6 + * This file is confidential and a trade secret of LSI Logic. The * 7 + * receipt of or possession of this file does not convey any rights to * 8 + * reproduce or disclose its contents or to manufacture, use, or sell * 9 + * anything it may describe, in whole, or in part, without the specific * 10 + * written consent of LSI Logic Corporation. * 11 + * * 12 + *************************************************************************** 13 + * 14 + * Name: iopiIocLogInfo.h 15 + * Title: SAS Firmware IOP Interface IOC Log Info Definitions 16 + * Programmer: Guy Kendall 17 + * Creation Date: September 24, 2003 18 + * 19 + * Version History 20 + * --------------- 21 + * 22 + * Last Updated 23 + * ------------- 24 + * Version %version: 22 % 25 + * Date Updated %date_modified: % 26 + * Programmer %created_by: nperucca % 27 + * 28 + * Date Who Description 29 + * -------- --- ------------------------------------------------------- 30 + * 09/24/03 GWK Initial version 31 + * 32 + * 33 + * Description 34 + * ------------ 35 + * This include file contains SAS firmware interface IOC Log Info codes 36 + * 37 + *------------------------------------------------------------------------- 38 + */ 39 + 40 + #ifndef IOPI_IOCLOGINFO_H_INCLUDED 41 + #define IOPI_IOCLOGINFO_H_INCLUDED 42 + 43 + 44 + /****************************************************************************/ 45 + /* IOC LOGINFO defines, 0x00000000 - 0x0FFFFFFF */ 46 + /* Format: */ 47 + /* Bits 31-28: MPI_IOCLOGINFO_TYPE_SAS (3) */ 48 + /* Bits 27-24: IOC_LOGINFO_ORIGINATOR: 0=IOP, 1=PL, 2=IR */ 49 + /* Bits 23-16: LOGINFO_CODE */ 50 + /* Bits 15-0: LOGINFO_CODE Specific */ 51 + /****************************************************************************/ 52 + 53 + /****************************************************************************/ 54 + /* IOC_LOGINFO_ORIGINATOR defines */ 55 + /****************************************************************************/ 56 + #define IOC_LOGINFO_ORIGINATOR_IOP (0x00000000) 57 + #define IOC_LOGINFO_ORIGINATOR_PL (0x01000000) 58 + #define IOC_LOGINFO_ORIGINATOR_IR (0x02000000) 59 + 60 + /****************************************************************************/ 61 + /* LOGINFO_CODE defines */ 62 + /****************************************************************************/ 63 + #define IOC_LOGINFO_CODE_MASK (0x00FF0000) 64 + #define IOC_LOGINFO_CODE_SHIFT (16) 65 + 66 + /****************************************************************************/ 67 + /* IOP LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IOP */ 68 + /****************************************************************************/ 69 + #define IOP_LOGINFO_CODE_INVALID_SAS_ADDRESS (0x00010000) 70 + #define IOP_LOGINFO_CODE_UNUSED2 (0x00020000) 71 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE (0x00030000) 72 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_RT (0x00030100) /* Route Table Entry not found */ 73 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PN (0x00030200) /* Invalid Page Number */ 74 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_FORM (0x00030300) /* Invalid FORM */ 75 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PT (0x00030400) /* Invalid Page Type */ 76 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DNM (0x00030500) /* Device Not Mapped */ 77 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PERSIST (0x00030600) /* Persistent Page not found */ 78 + #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DEFAULT (0x00030700) /* Default Page not found */ 79 + #define IOP_LOGINFO_CODE_TASK_TERMINATED (0x00050000) 80 + 81 + 82 + /****************************************************************************/ 83 + /* PL LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = PL */ 84 + /****************************************************************************/ 85 + #define PL_LOGINFO_CODE_OPEN_FAILURE (0x00010000) 86 + #define PL_LOGINFO_CODE_INVALID_SGL (0x00020000) 87 + #define PL_LOGINFO_CODE_WRONG_REL_OFF_OR_FRAME_LENGTH (0x00030000) 88 + #define PL_LOGINFO_CODE_FRAME_XFER_ERROR (0x00040000) 89 + #define PL_LOGINFO_CODE_TX_FM_CONNECTED_LOW (0x00050000) 90 + #define PL_LOGINFO_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET (0x00060000) 91 + #define PL_LOGINFO_CODE_SATA_READ_LOG_RECEIVE_DATA_ERR (0x00070000) 92 + #define PL_LOGINFO_CODE_SATA_NCQ_FAIL_ALL_CMDS_AFTR_ERR (0x00080000) 93 + #define PL_LOGINFO_CODE_SATA_ERR_IN_RCV_SET_DEV_BIT_FIS (0x00090000) 94 + #define PL_LOGINFO_CODE_RX_FM_INVALID_MESSAGE (0x000A0000) 95 + #define PL_LOGINFO_CODE_RX_CTX_MESSAGE_VALID_ERROR (0x000B0000) 96 + #define PL_LOGINFO_CODE_RX_FM_CURRENT_FRAME_ERROR (0x000C0000) 97 + #define PL_LOGINFO_CODE_SATA_LINK_DOWN (0x000D0000) 98 + #define PL_LOGINFO_CODE_DISCOVERY_SATA_INIT_W_IOS (0x000E0000) 99 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE (0x000F0000) 100 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_PT (0x000F0100) /* Invalid Page Type */ 101 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NUM_PHYS (0x000F0200) /* Invalid Number of Phys */ 102 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NOT_IMP (0x000F0300) /* Case Not Handled */ 103 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NO_DEV (0x000F0400) /* No Device Found */ 104 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_FORM (0x000F0500) /* Invalid FORM */ 105 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_PHY (0x000F0600) /* Invalid Phy */ 106 + #define PL_LOGINFO_CODE_CONFIG_INVALID_PAGE_NO_OWNER (0x000F0700) /* No Owner Found */ 107 + #define PL_LOGINFO_CODE_DSCVRY_SATA_INIT_TIMEOUT (0x00100000) 108 + #define PL_LOGINFO_CODE_RESET (0x00110000) 109 + #define PL_LOGINFO_CODE_ABORT (0x00120000) 110 + #define PL_LOGINFO_CODE_IO_NOT_YET_EXECUTED (0x00130000) 111 + #define PL_LOGINFO_CODE_IO_EXECUTED (0x00140000) 112 + #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE (0x00000100) 113 + #define PL_LOGINFO_SUB_CODE_INVALID_SGL (0x00000200) 114 + #define PL_LOGINFO_SUB_CODE_WRONG_REL_OFF_OR_FRAME_LENGTH (0x00000300) 115 + #define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR (0x00000400) 116 + #define PL_LOGINFO_SUB_CODE_TX_FM_CONNECTED_LOW (0x00000500) 117 + #define PL_LOGINFO_SUB_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET (0x00000600) 118 + #define PL_LOGINFO_SUB_CODE_SATA_READ_LOG_RECEIVE_DATA_ERR (0x00000700) 119 + #define PL_LOGINFO_SUB_CODE_SATA_NCQ_FAIL_ALL_CMDS_AFTR_ERR (0x00000800) 120 + #define PL_LOGINFO_SUB_CODE_SATA_ERR_IN_RCV_SET_DEV_BIT_FIS (0x00000900) 121 + #define PL_LOGINFO_SUB_CODE_RX_FM_INVALID_MESSAGE (0x00000A00) 122 + #define PL_LOGINFO_SUB_CODE_RX_CTX_MESSAGE_VALID_ERROR (0x00000B00) 123 + #define PL_LOGINFO_SUB_CODE_RX_FM_CURRENT_FRAME_ERROR (0x00000C00) 124 + #define PL_LOGINFO_SUB_CODE_SATA_LINK_DOWN (0x00000D00) 125 + #define PL_LOGINFO_SUB_CODE_DISCOVERY_SATA_INIT_W_IOS (0x00000E00) 126 + #define PL_LOGINFO_SUB_CODE_DSCVRY_SATA_INIT_TIMEOUT (0x00001000) 127 + 128 + 129 + #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_FRAME_FAILURE (0x00200000) /* Can't get SMP Frame */ 130 + #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_READ_ERROR (0x00200001) /* Error occured on SMP Read */ 131 + #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_WRITE_ERROR (0x00200002) /* Error occured on SMP Write */ 132 + #define PL_LOGINFO_CODE_ENCL_MGMT_NOT_SUPPORTED_ON_ENCL (0x00200004) /* Encl Mgmt services not available for this WWID */ 133 + #define PL_LOGINFO_CODE_ENCL_MGMT_ADDR_MODE_NOT_SUPPORTED (0x00200005) /* Address Mode not suppored */ 134 + #define PL_LOGINFO_CODE_ENCL_MGMT_BAD_SLOT_NUM (0x00200006) /* Invalid Slot Number in SEP Msg */ 135 + #define PL_LOGINFO_CODE_ENCL_MGMT_SGPIO_NOT_PRESENT (0x00200007) /* SGPIO not present/enabled */ 136 + 137 + #define PL_LOGINFO_DA_SEP_NOT_PRESENT (0x00200100) /* SEP not present when msg received */ 138 + #define PL_LOGINFO_DA_SEP_SINGLE_THREAD_ERROR (0x00200101) /* Can only accept 1 msg at a time */ 139 + #define PL_LOGINFO_DA_SEP_ISTWI_INTR_IN_IDLE_STATE (0x00200102) /* ISTWI interrupt recvd. while IDLE */ 140 + #define PL_LOGINFO_DA_SEP_RECEIVED_NACK_FROM_SLAVE (0x00200103) /* SEP NACK'd, it is busy */ 141 + #define PL_LOGINFO_DA_SEP_BAD_STATUS_HDR_CHKSUM (0x00200104) /* SEP stopped or sent bad chksum in Hdr */ 142 + #define PL_LOGINFO_DA_SEP_UNSUPPORTED_SCSI_STATUS_1 (0x00200105) /* SEP returned unknown scsi status */ 143 + #define PL_LOGINFO_DA_SEP_UNSUPPORTED_SCSI_STATUS_2 (0x00200106) /* SEP returned unknown scsi status */ 144 + #define PL_LOGINFO_DA_SEP_CHKSUM_ERROR_AFTER_STOP (0x00200107) /* SEP returned bad chksum after STOP */ 145 + #define PL_LOGINFO_DA_SEP_CHKSUM_ERROR_AFTER_STOP_GETDATA (0x00200108) /* SEP returned bad chksum after STOP while gettin data*/ 146 + 147 + 148 + /****************************************************************************/ 149 + /* IR LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IR */ 150 + /****************************************************************************/ 151 + #define IR_LOGINFO_CODE_UNUSED1 (0x00010000) 152 + #define IR_LOGINFO_CODE_UNUSED2 (0x00020000) 153 + 154 + /****************************************************************************/ 155 + /* Defines for convienence */ 156 + /****************************************************************************/ 157 + #define IOC_LOGINFO_PREFIX_IOP ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IOP) 158 + #define IOC_LOGINFO_PREFIX_PL ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_PL) 159 + #define IOC_LOGINFO_PREFIX_IR ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IR) 160 + 161 + #endif /* end of file */ 162 +
+20 -10
drivers/message/fusion/lsi/mpi_sas.h
··· 6 * Title: MPI Serial Attached SCSI structures and definitions 7 * Creation Date: August 19, 2004 8 * 9 - * mpi_sas.h Version: 01.05.01 10 * 11 * Version History 12 * --------------- ··· 14 * Date Version Description 15 * -------- -------- ------------------------------------------------------ 16 * 08-19-04 01.05.01 Original release. 17 * -------------------------------------------------------------------------- 18 */ 19 ··· 54 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event 55 * data and SAS IO Unit Configuration pages. 56 */ 57 #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) 58 #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) 59 #define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800) ··· 216 U8 TargetID; /* 0Ch */ 217 U8 Bus; /* 0Dh */ 218 U8 PhyNum; /* 0Eh */ 219 - U8 Reserved4; /* 0Fh */ 220 - U32 Reserved5; /* 10h */ 221 U64 SASAddress; /* 14h */ 222 - U32 Reserved6; /* 1Ch */ 223 } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 224 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 225 226 /* values for the Operation field */ 227 - #define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01) 228 - #define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02) 229 - #define MPI_SAS_OP_PHY_LINK_RESET (0x06) 230 - #define MPI_SAS_OP_PHY_HARD_RESET (0x07) 231 - #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 232 - #define MPI_SAS_OP_MAP_CURRENT (0x09) 233 234 235 /* SAS IO Unit Control Reply */
··· 6 * Title: MPI Serial Attached SCSI structures and definitions 7 * Creation Date: August 19, 2004 8 * 9 + * mpi_sas.h Version: 01.05.02 10 * 11 * Version History 12 * --------------- ··· 14 * Date Version Description 15 * -------- -------- ------------------------------------------------------ 16 * 08-19-04 01.05.01 Original release. 17 + * 08-30-05 01.05.02 Added DeviceInfo bit for SEP. 18 + * Added PrimFlags and Primitive field to SAS IO Unit 19 + * Control request, and added a new operation code. 20 * -------------------------------------------------------------------------- 21 */ 22 ··· 51 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event 52 * data and SAS IO Unit Configuration pages. 53 */ 54 + #define MPI_SAS_DEVICE_INFO_SEP (0x00004000) 55 #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) 56 #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) 57 #define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800) ··· 212 U8 TargetID; /* 0Ch */ 213 U8 Bus; /* 0Dh */ 214 U8 PhyNum; /* 0Eh */ 215 + U8 PrimFlags; /* 0Fh */ 216 + U32 Primitive; /* 10h */ 217 U64 SASAddress; /* 14h */ 218 + U32 Reserved4; /* 1Ch */ 219 } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 220 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 221 222 /* values for the Operation field */ 223 + #define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01) 224 + #define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02) 225 + #define MPI_SAS_OP_PHY_LINK_RESET (0x06) 226 + #define MPI_SAS_OP_PHY_HARD_RESET (0x07) 227 + #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 228 + #define MPI_SAS_OP_MAP_CURRENT (0x09) 229 + #define MPI_SAS_OP_SEND_PRIMITIVE (0x0A) 230 + 231 + /* values for the PrimFlags field */ 232 + #define MPI_SAS_PRIMFLAGS_SINGLE (0x08) 233 + #define MPI_SAS_PRIMFLAGS_TRIPLE (0x02) 234 + #define MPI_SAS_PRIMFLAGS_REDUNDANT (0x01) 235 236 237 /* SAS IO Unit Control Reply */
+37 -11
drivers/message/fusion/mptbase.c
··· 148 static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 149 static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 150 static int GetLanConfigPages(MPT_ADAPTER *ioc); 151 - static int GetFcPortPage0(MPT_ADAPTER *ioc, int portnum); 152 static int GetIoUnitPage2(MPT_ADAPTER *ioc); 153 int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 154 static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum); ··· 1231 dprintk((KERN_INFO MYNAM 1232 ": Not using 64 bit consistent mask\n")); 1233 1234 - ioc = kmalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); 1235 if (ioc == NULL) { 1236 printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); 1237 return -ENOMEM; 1238 } 1239 - memset(ioc, 0, sizeof(MPT_ADAPTER)); 1240 ioc->alloc_total = sizeof(MPT_ADAPTER); 1241 ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ 1242 ioc->reply_sz = MPT_REPLY_FRAME_SIZE; ··· 1243 ioc->pcidev = pdev; 1244 ioc->diagPending = 0; 1245 spin_lock_init(&ioc->diagLock); 1246 spin_lock_init(&ioc->initializing_hba_lock); 1247 1248 /* Initialize the event logging. ··· 1267 /* Initialize the running configQ head. 1268 */ 1269 INIT_LIST_HEAD(&ioc->configQ); 1270 1271 /* Find lookup slot. */ 1272 INIT_LIST_HEAD(&ioc->list); ··· 1377 ioc->prod_name = "LSIFC949X"; 1378 ioc->bus_type = FC; 1379 ioc->errata_flag_1064 = 1; 1380 } 1381 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { 1382 ioc->prod_name = "LSI53C1030"; ··· 1630 pci_enable_device(pdev); 1631 1632 /* enable interrupts */ 1633 - CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1634 ioc->active = 1; 1635 1636 /* F/W not running */ ··· 1723 /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */ 1724 dprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1725 ioc->alt_ioc->name)); 1726 - CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1727 ioc->alt_ioc->active = 1; 1728 } 1729 ··· 1839 1840 if (ret == 0) { 1841 /* Enable! (reply interrupt) */ 1842 - CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1843 ioc->active = 1; 1844 } 1845 ··· 1847 /* (re)Enable alt-IOC! (reply interrupt) */ 1848 dinitprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1849 ioc->alt_ioc->name)); 1850 - CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1851 ioc->alt_ioc->active = 1; 1852 } 1853 ··· 1888 * (FCPortPage0_t stuff) 1889 */ 1890 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 1891 - (void) GetFcPortPage0(ioc, ii); 1892 } 1893 1894 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && ··· 4207 4208 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 4209 /* 4210 - * GetFcPortPage0 - Fetch FCPort config Page0. 4211 * @ioc: Pointer to MPT_ADAPTER structure 4212 * @portnum: IOC Port number 4213 * ··· 4217 * -EAGAIN if no msg frames currently available 4218 * -EFAULT for non-successful reply or no reply (timeout) 4219 */ 4220 - static int 4221 - GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) 4222 { 4223 ConfigPageHeader_t hdr; 4224 CONFIGPARMS cfg; ··· 4228 int data_sz; 4229 int copy_sz; 4230 int rc; 4231 4232 /* Get FCPort Page 0 header */ 4233 hdr.PageVersion = 0; ··· 4253 rc = -ENOMEM; 4254 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); 4255 if (ppage0_alloc) { 4256 memset((u8 *)ppage0_alloc, 0, data_sz); 4257 cfg.physAddr = page0_dma; 4258 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; ··· 4286 pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount); 4287 pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators); 4288 4289 } 4290 4291 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); ··· 6383 EXPORT_SYMBOL(mpt_free_fw_memory); 6384 EXPORT_SYMBOL(mptbase_sas_persist_operation); 6385 EXPORT_SYMBOL(mpt_alt_ioc_wait); 6386 6387 6388 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
··· 148 static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 149 static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 150 static int GetLanConfigPages(MPT_ADAPTER *ioc); 151 static int GetIoUnitPage2(MPT_ADAPTER *ioc); 152 int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 153 static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum); ··· 1232 dprintk((KERN_INFO MYNAM 1233 ": Not using 64 bit consistent mask\n")); 1234 1235 + ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); 1236 if (ioc == NULL) { 1237 printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); 1238 return -ENOMEM; 1239 } 1240 ioc->alloc_total = sizeof(MPT_ADAPTER); 1241 ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ 1242 ioc->reply_sz = MPT_REPLY_FRAME_SIZE; ··· 1245 ioc->pcidev = pdev; 1246 ioc->diagPending = 0; 1247 spin_lock_init(&ioc->diagLock); 1248 + spin_lock_init(&ioc->fc_rescan_work_lock); 1249 + spin_lock_init(&ioc->fc_rport_lock); 1250 spin_lock_init(&ioc->initializing_hba_lock); 1251 1252 /* Initialize the event logging. ··· 1267 /* Initialize the running configQ head. 1268 */ 1269 INIT_LIST_HEAD(&ioc->configQ); 1270 + 1271 + /* Initialize the fc rport list head. 1272 + */ 1273 + INIT_LIST_HEAD(&ioc->fc_rports); 1274 1275 /* Find lookup slot. */ 1276 INIT_LIST_HEAD(&ioc->list); ··· 1373 ioc->prod_name = "LSIFC949X"; 1374 ioc->bus_type = FC; 1375 ioc->errata_flag_1064 = 1; 1376 + } 1377 + else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949E) { 1378 + ioc->prod_name = "LSIFC949E"; 1379 + ioc->bus_type = FC; 1380 } 1381 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { 1382 ioc->prod_name = "LSI53C1030"; ··· 1622 pci_enable_device(pdev); 1623 1624 /* enable interrupts */ 1625 + CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); 1626 ioc->active = 1; 1627 1628 /* F/W not running */ ··· 1715 /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */ 1716 dprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1717 ioc->alt_ioc->name)); 1718 + CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 1719 ioc->alt_ioc->active = 1; 1720 } 1721 ··· 1831 1832 if (ret == 0) { 1833 /* Enable! (reply interrupt) */ 1834 + CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); 1835 ioc->active = 1; 1836 } 1837 ··· 1839 /* (re)Enable alt-IOC! (reply interrupt) */ 1840 dinitprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1841 ioc->alt_ioc->name)); 1842 + CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 1843 ioc->alt_ioc->active = 1; 1844 } 1845 ··· 1880 * (FCPortPage0_t stuff) 1881 */ 1882 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 1883 + (void) mptbase_GetFcPortPage0(ioc, ii); 1884 } 1885 1886 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && ··· 4199 4200 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 4201 /* 4202 + * mptbase_GetFcPortPage0 - Fetch FCPort config Page0. 4203 * @ioc: Pointer to MPT_ADAPTER structure 4204 * @portnum: IOC Port number 4205 * ··· 4209 * -EAGAIN if no msg frames currently available 4210 * -EFAULT for non-successful reply or no reply (timeout) 4211 */ 4212 + int 4213 + mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) 4214 { 4215 ConfigPageHeader_t hdr; 4216 CONFIGPARMS cfg; ··· 4220 int data_sz; 4221 int copy_sz; 4222 int rc; 4223 + int count = 400; 4224 + 4225 4226 /* Get FCPort Page 0 header */ 4227 hdr.PageVersion = 0; ··· 4243 rc = -ENOMEM; 4244 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); 4245 if (ppage0_alloc) { 4246 + 4247 + try_again: 4248 memset((u8 *)ppage0_alloc, 0, data_sz); 4249 cfg.physAddr = page0_dma; 4250 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; ··· 4274 pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount); 4275 pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators); 4276 4277 + /* 4278 + * if still doing discovery, 4279 + * hang loose a while until finished 4280 + */ 4281 + if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) { 4282 + if (count-- > 0) { 4283 + msleep_interruptible(100); 4284 + goto try_again; 4285 + } 4286 + printk(MYIOC_s_INFO_FMT "Firmware discovery not" 4287 + " complete.\n", 4288 + ioc->name); 4289 + } 4290 } 4291 4292 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); ··· 6358 EXPORT_SYMBOL(mpt_free_fw_memory); 6359 EXPORT_SYMBOL(mptbase_sas_persist_operation); 6360 EXPORT_SYMBOL(mpt_alt_ioc_wait); 6361 + EXPORT_SYMBOL(mptbase_GetFcPortPage0); 6362 6363 6364 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+30 -4
drivers/message/fusion/mptbase.h
··· 76 #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR 77 #endif 78 79 - #define MPT_LINUX_VERSION_COMMON "3.03.05" 80 - #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.05" 81 #define WHAT_MAGIC_STRING "@" "(" "#" ")" 82 83 #define show_mptmod_ver(s,ver) \ ··· 413 u8 status; /* current command status */ 414 u8 reset; /* 1 if bus reset allowed */ 415 u8 target; /* target for reset */ 416 - struct semaphore sem_ioc; 417 } MPT_IOCTL; 418 419 #define MPT_SAS_MGMT_STATUS_RF_VALID 0x02 /* The Reply Frame is VALID */ ··· 421 #define MPT_SAS_MGMT_STATUS_TM_FAILED 0x40 /* User TM request failed */ 422 423 typedef struct _MPT_SAS_MGMT { 424 - struct semaphore mutex; 425 struct completion done; 426 u8 reply[MPT_DEFAULT_FRAME_SIZE]; /* reply frame data */ 427 u8 status; /* current command status */ ··· 498 IOCPage3_t *pIocPg3; /* table of physical disks */ 499 int isRaid; /* bit field, 1 if RAID */ 500 }RaidCfgData; 501 502 /* 503 * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS ··· 628 struct list_head list; 629 struct net_device *netdev; 630 struct list_head sas_topology; 631 MPT_SAS_MGMT sas_mgmt; 632 } MPT_ADAPTER; 633 634 /* ··· 1024 extern int mpt_findImVolumes(MPT_ADAPTER *ioc); 1025 extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); 1026 extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 1027 extern int mpt_alt_ioc_wait(MPT_ADAPTER *ioc); 1028 1029 /*
··· 76 #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR 77 #endif 78 79 + #define MPT_LINUX_VERSION_COMMON "3.03.06" 80 + #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.06" 81 #define WHAT_MAGIC_STRING "@" "(" "#" ")" 82 83 #define show_mptmod_ver(s,ver) \ ··· 413 u8 status; /* current command status */ 414 u8 reset; /* 1 if bus reset allowed */ 415 u8 target; /* target for reset */ 416 + struct mutex ioctl_mutex; 417 } MPT_IOCTL; 418 419 #define MPT_SAS_MGMT_STATUS_RF_VALID 0x02 /* The Reply Frame is VALID */ ··· 421 #define MPT_SAS_MGMT_STATUS_TM_FAILED 0x40 /* User TM request failed */ 422 423 typedef struct _MPT_SAS_MGMT { 424 + struct mutex mutex; 425 struct completion done; 426 u8 reply[MPT_DEFAULT_FRAME_SIZE]; /* reply frame data */ 427 u8 status; /* current command status */ ··· 498 IOCPage3_t *pIocPg3; /* table of physical disks */ 499 int isRaid; /* bit field, 1 if RAID */ 500 }RaidCfgData; 501 + 502 + #define MPT_RPORT_INFO_FLAGS_REGISTERED 0x01 /* rport registered */ 503 + #define MPT_RPORT_INFO_FLAGS_MISSING 0x02 /* missing from DevPage0 scan */ 504 + #define MPT_RPORT_INFO_FLAGS_MAPPED_VDEV 0x04 /* target mapped in vdev */ 505 + 506 + /* 507 + * data allocated for each fc rport device 508 + */ 509 + struct mptfc_rport_info 510 + { 511 + struct list_head list; 512 + struct fc_rport *rport; 513 + VirtDevice *vdev; 514 + FCDevicePage0_t pg0; 515 + u8 flags; 516 + }; 517 518 /* 519 * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS ··· 612 struct list_head list; 613 struct net_device *netdev; 614 struct list_head sas_topology; 615 + struct mutex sas_topology_mutex; 616 MPT_SAS_MGMT sas_mgmt; 617 + int num_ports; 618 + 619 + struct list_head fc_rports; 620 + spinlock_t fc_rport_lock; /* list and ri flags */ 621 + spinlock_t fc_rescan_work_lock; 622 + int fc_rescan_work_count; 623 + struct work_struct fc_rescan_work; 624 + 625 } MPT_ADAPTER; 626 627 /* ··· 999 extern int mpt_findImVolumes(MPT_ADAPTER *ioc); 1000 extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); 1001 extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 1002 + extern int mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum); 1003 extern int mpt_alt_ioc_wait(MPT_ADAPTER *ioc); 1004 1005 /*
+6 -6
drivers/message/fusion/mptctl.c
··· 177 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock)); 178 179 if (nonblock) { 180 - if (down_trylock(&ioc->ioctl->sem_ioc)) 181 rc = -EAGAIN; 182 } else { 183 - if (down_interruptible(&ioc->ioctl->sem_ioc)) 184 rc = -ERESTARTSYS; 185 } 186 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc)); ··· 557 else 558 ret = -EINVAL; 559 560 - up(&iocp->ioctl->sem_ioc); 561 562 return ret; 563 } ··· 2619 2620 ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); 2621 2622 - up(&iocp->ioctl->sem_ioc); 2623 2624 return ret; 2625 } ··· 2673 */ 2674 ret = mptctl_do_mpt_command (karg, &uarg->MF); 2675 2676 - up(&iocp->ioctl->sem_ioc); 2677 2678 return ret; 2679 } ··· 2743 memset(mem, 0, sz); 2744 ioc->ioctl = (MPT_IOCTL *) mem; 2745 ioc->ioctl->ioc = ioc; 2746 - sema_init(&ioc->ioctl->sem_ioc, 1); 2747 return 0; 2748 2749 out_fail:
··· 177 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock)); 178 179 if (nonblock) { 180 + if (!mutex_trylock(&ioc->ioctl->ioctl_mutex)) 181 rc = -EAGAIN; 182 } else { 183 + if (mutex_lock_interruptible(&ioc->ioctl->ioctl_mutex)) 184 rc = -ERESTARTSYS; 185 } 186 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc)); ··· 557 else 558 ret = -EINVAL; 559 560 + mutex_unlock(&iocp->ioctl->ioctl_mutex); 561 562 return ret; 563 } ··· 2619 2620 ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); 2621 2622 + mutex_unlock(&iocp->ioctl->ioctl_mutex); 2623 2624 return ret; 2625 } ··· 2673 */ 2674 ret = mptctl_do_mpt_command (karg, &uarg->MF); 2675 2676 + mutex_unlock(&iocp->ioctl->ioctl_mutex); 2677 2678 return ret; 2679 } ··· 2743 memset(mem, 0, sz); 2744 ioc->ioctl = (MPT_IOCTL *) mem; 2745 ioc->ioctl->ioc = ioc; 2746 + mutex_init(&ioc->ioctl->ioctl_mutex); 2747 return 0; 2748 2749 out_fail:
+546 -35
drivers/message/fusion/mptfc.c
··· 55 #include <linux/reboot.h> /* notifier code */ 56 #include <linux/sched.h> 57 #include <linux/workqueue.h> 58 59 #include <scsi/scsi.h> 60 #include <scsi/scsi_cmnd.h> 61 #include <scsi/scsi_device.h> 62 #include <scsi/scsi_host.h> 63 #include <scsi/scsi_tcq.h> 64 65 #include "mptbase.h" 66 #include "mptscsih.h" ··· 81 module_param(mpt_pq_filter, int, 0); 82 MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)"); 83 84 static int mptfcDoneCtx = -1; 85 static int mptfcTaskCtx = -1; 86 static int mptfcInternalCtx = -1; /* Used only for internal commands */ 87 88 static struct scsi_host_template mptfc_driver_template = { 89 .module = THIS_MODULE, ··· 106 .proc_info = mptscsih_proc_info, 107 .name = "MPT FC Host", 108 .info = mptscsih_info, 109 - .queuecommand = mptscsih_qcmd, 110 .target_alloc = mptscsih_target_alloc, 111 - .slave_alloc = mptscsih_slave_alloc, 112 .slave_configure = mptscsih_slave_configure, 113 .target_destroy = mptscsih_target_destroy, 114 .slave_destroy = mptscsih_slave_destroy, ··· 145 PCI_ANY_ID, PCI_ANY_ID }, 146 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X, 147 PCI_ANY_ID, PCI_ANY_ID }, 148 {0} /* Terminating entry */ 149 }; 150 MODULE_DEVICE_TABLE(pci, mptfc_pci_table); 151 152 - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 153 - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 154 - /* 155 - * mptfc_probe - Installs scsi devices per bus. 156 - * @pdev: Pointer to pci_dev structure 157 - * 158 - * Returns 0 for success, non-zero for failure. 159 - * 160 */ 161 static int 162 mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) 163 { ··· 624 MPT_SCSI_HOST *hd; 625 MPT_ADAPTER *ioc; 626 unsigned long flags; 627 - int sz, ii; 628 int numSGE = 0; 629 int scale; 630 int ioc_cap; 631 - u8 *mem; 632 int error=0; 633 int r; 634 - 635 if ((r = mpt_attach(pdev,id)) != 0) 636 return r; 637 - 638 ioc = pci_get_drvdata(pdev); 639 ioc->DoneCtx = mptfcDoneCtx; 640 ioc->TaskCtx = mptfcTaskCtx; ··· 669 printk(MYIOC_s_WARN_FMT 670 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n", 671 ioc->name, ioc); 672 - return 0; 673 } 674 675 sh = scsi_host_alloc(&mptfc_driver_template, sizeof(MPT_SCSI_HOST)); ··· 681 error = -1; 682 goto out_mptfc_probe; 683 } 684 685 spin_lock_irqsave(&ioc->FreeQlock, flags); 686 ··· 745 /* SCSI needs scsi_cmnd lookup table! 746 * (with size equal to req_depth*PtrSz!) 747 */ 748 - sz = ioc->req_depth * sizeof(void *); 749 - mem = kmalloc(sz, GFP_ATOMIC); 750 - if (mem == NULL) { 751 error = -ENOMEM; 752 goto out_mptfc_probe; 753 } 754 755 - memset(mem, 0, sz); 756 - hd->ScsiLookup = (struct scsi_cmnd **) mem; 757 - 758 - dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n", 759 - ioc->name, hd->ScsiLookup, sz)); 760 761 /* Allocate memory for the device structures. 762 * A non-Null pointer at an offset 763 * indicates a device exists. 764 * max_id = 1 + maximum id (hosts.h) 765 */ 766 - sz = sh->max_id * sizeof(void *); 767 - mem = kmalloc(sz, GFP_ATOMIC); 768 - if (mem == NULL) { 769 error = -ENOMEM; 770 goto out_mptfc_probe; 771 } 772 773 - memset(mem, 0, sz); 774 - hd->Targets = (VirtTarget **) mem; 775 - 776 - dprintk((KERN_INFO 777 - " vdev @ %p, sz=%d\n", hd->Targets, sz)); 778 779 /* Clear the TM flags 780 */ ··· 800 hd->scandv_wait_done = 0; 801 hd->last_queue_full = 0; 802 803 error = scsi_add_host (sh, &ioc->pcidev->dev); 804 if(error) { 805 dprintk((KERN_ERR MYNAM ··· 808 goto out_mptfc_probe; 809 } 810 811 - scsi_scan_host(sh); 812 return 0; 813 814 out_mptfc_probe: ··· 825 .name = "mptfc", 826 .id_table = mptfc_pci_table, 827 .probe = mptfc_probe, 828 - .remove = __devexit_p(mptscsih_remove), 829 .shutdown = mptscsih_shutdown, 830 #ifdef CONFIG_PM 831 .suspend = mptscsih_suspend, ··· 843 static int __init 844 mptfc_init(void) 845 { 846 847 show_mptmod_ver(my_NAME, my_VERSION); 848 849 mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER); 850 mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER); ··· 871 ": Registered for IOC reset notifications\n")); 872 } 873 874 - return pci_register_driver(&mptfc_driver); 875 } 876 877 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ ··· 910 mptfc_exit(void) 911 { 912 pci_unregister_driver(&mptfc_driver); 913 - 914 mpt_reset_deregister(mptfcDoneCtx); 915 dprintk((KERN_INFO MYNAM 916 ": Deregistered for IOC reset notifications\n"));
··· 55 #include <linux/reboot.h> /* notifier code */ 56 #include <linux/sched.h> 57 #include <linux/workqueue.h> 58 + #include <linux/sort.h> 59 60 #include <scsi/scsi.h> 61 #include <scsi/scsi_cmnd.h> 62 #include <scsi/scsi_device.h> 63 #include <scsi/scsi_host.h> 64 #include <scsi/scsi_tcq.h> 65 + #include <scsi/scsi_transport_fc.h> 66 67 #include "mptbase.h" 68 #include "mptscsih.h" ··· 79 module_param(mpt_pq_filter, int, 0); 80 MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)"); 81 82 + #define MPTFC_DEV_LOSS_TMO (60) 83 + static int mptfc_dev_loss_tmo = MPTFC_DEV_LOSS_TMO; /* reasonable default */ 84 + module_param(mptfc_dev_loss_tmo, int, 0); 85 + MODULE_PARM_DESC(mptfc_dev_loss_tmo, " Initial time the driver programs the " 86 + " transport to wait for an rport to " 87 + " return following a device loss event." 88 + " Default=60."); 89 + 90 static int mptfcDoneCtx = -1; 91 static int mptfcTaskCtx = -1; 92 static int mptfcInternalCtx = -1; /* Used only for internal commands */ 93 + 94 + int mptfc_slave_alloc(struct scsi_device *device); 95 + static int mptfc_qcmd(struct scsi_cmnd *SCpnt, 96 + void (*done)(struct scsi_cmnd *)); 97 + 98 + static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); 99 + static void __devexit mptfc_remove(struct pci_dev *pdev); 100 101 static struct scsi_host_template mptfc_driver_template = { 102 .module = THIS_MODULE, ··· 89 .proc_info = mptscsih_proc_info, 90 .name = "MPT FC Host", 91 .info = mptscsih_info, 92 + .queuecommand = mptfc_qcmd, 93 .target_alloc = mptscsih_target_alloc, 94 + .slave_alloc = mptfc_slave_alloc, 95 .slave_configure = mptscsih_slave_configure, 96 .target_destroy = mptscsih_target_destroy, 97 .slave_destroy = mptscsih_slave_destroy, ··· 128 PCI_ANY_ID, PCI_ANY_ID }, 129 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X, 130 PCI_ANY_ID, PCI_ANY_ID }, 131 + { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949ES, 132 + PCI_ANY_ID, PCI_ANY_ID }, 133 {0} /* Terminating entry */ 134 }; 135 MODULE_DEVICE_TABLE(pci, mptfc_pci_table); 136 137 + static struct scsi_transport_template *mptfc_transport_template = NULL; 138 + 139 + struct fc_function_template mptfc_transport_functions = { 140 + .dd_fcrport_size = 8, 141 + .show_host_node_name = 1, 142 + .show_host_port_name = 1, 143 + .show_host_supported_classes = 1, 144 + .show_host_port_id = 1, 145 + .show_rport_supported_classes = 1, 146 + .show_starget_node_name = 1, 147 + .show_starget_port_name = 1, 148 + .show_starget_port_id = 1, 149 + .set_rport_dev_loss_tmo = mptfc_set_rport_loss_tmo, 150 + .show_rport_dev_loss_tmo = 1, 151 + 152 + }; 153 + 154 + /* FIXME! values controlling firmware RESCAN event 155 + * need to be set low to allow dev_loss_tmo to 156 + * work as expected. Currently, firmware doesn't 157 + * notify driver of RESCAN event until some number 158 + * of seconds elapse. This value can be set via 159 + * lsiutil. 160 */ 161 + static void 162 + mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) 163 + { 164 + if (timeout > 0) 165 + rport->dev_loss_tmo = timeout; 166 + else 167 + rport->dev_loss_tmo = mptfc_dev_loss_tmo; 168 + } 169 + 170 + static int 171 + mptfc_FcDevPage0_cmp_func(const void *a, const void *b) 172 + { 173 + FCDevicePage0_t **aa = (FCDevicePage0_t **)a; 174 + FCDevicePage0_t **bb = (FCDevicePage0_t **)b; 175 + 176 + if ((*aa)->CurrentBus == (*bb)->CurrentBus) { 177 + if ((*aa)->CurrentTargetID == (*bb)->CurrentTargetID) 178 + return 0; 179 + if ((*aa)->CurrentTargetID < (*bb)->CurrentTargetID) 180 + return -1; 181 + return 1; 182 + } 183 + if ((*aa)->CurrentBus < (*bb)->CurrentBus) 184 + return -1; 185 + return 1; 186 + } 187 + 188 + static int 189 + mptfc_GetFcDevPage0(MPT_ADAPTER *ioc, int ioc_port, 190 + void(*func)(MPT_ADAPTER *ioc,int channel, FCDevicePage0_t *arg)) 191 + { 192 + ConfigPageHeader_t hdr; 193 + CONFIGPARMS cfg; 194 + FCDevicePage0_t *ppage0_alloc, *fc; 195 + dma_addr_t page0_dma; 196 + int data_sz; 197 + int ii; 198 + 199 + FCDevicePage0_t *p0_array=NULL, *p_p0; 200 + FCDevicePage0_t **pp0_array=NULL, **p_pp0; 201 + 202 + int rc = -ENOMEM; 203 + U32 port_id = 0xffffff; 204 + int num_targ = 0; 205 + int max_bus = ioc->facts.MaxBuses; 206 + int max_targ = ioc->facts.MaxDevices; 207 + 208 + if (max_bus == 0 || max_targ == 0) 209 + goto out; 210 + 211 + data_sz = sizeof(FCDevicePage0_t) * max_bus * max_targ; 212 + p_p0 = p0_array = kzalloc(data_sz, GFP_KERNEL); 213 + if (!p0_array) 214 + goto out; 215 + 216 + data_sz = sizeof(FCDevicePage0_t *) * max_bus * max_targ; 217 + p_pp0 = pp0_array = kzalloc(data_sz, GFP_KERNEL); 218 + if (!pp0_array) 219 + goto out; 220 + 221 + do { 222 + /* Get FC Device Page 0 header */ 223 + hdr.PageVersion = 0; 224 + hdr.PageLength = 0; 225 + hdr.PageNumber = 0; 226 + hdr.PageType = MPI_CONFIG_PAGETYPE_FC_DEVICE; 227 + cfg.cfghdr.hdr = &hdr; 228 + cfg.physAddr = -1; 229 + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 230 + cfg.dir = 0; 231 + cfg.pageAddr = port_id; 232 + cfg.timeout = 0; 233 + 234 + if ((rc = mpt_config(ioc, &cfg)) != 0) 235 + break; 236 + 237 + if (hdr.PageLength <= 0) 238 + break; 239 + 240 + data_sz = hdr.PageLength * 4; 241 + ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, 242 + &page0_dma); 243 + rc = -ENOMEM; 244 + if (!ppage0_alloc) 245 + break; 246 + 247 + cfg.physAddr = page0_dma; 248 + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; 249 + 250 + if ((rc = mpt_config(ioc, &cfg)) == 0) { 251 + ppage0_alloc->PortIdentifier = 252 + le32_to_cpu(ppage0_alloc->PortIdentifier); 253 + 254 + ppage0_alloc->WWNN.Low = 255 + le32_to_cpu(ppage0_alloc->WWNN.Low); 256 + 257 + ppage0_alloc->WWNN.High = 258 + le32_to_cpu(ppage0_alloc->WWNN.High); 259 + 260 + ppage0_alloc->WWPN.Low = 261 + le32_to_cpu(ppage0_alloc->WWPN.Low); 262 + 263 + ppage0_alloc->WWPN.High = 264 + le32_to_cpu(ppage0_alloc->WWPN.High); 265 + 266 + ppage0_alloc->BBCredit = 267 + le16_to_cpu(ppage0_alloc->BBCredit); 268 + 269 + ppage0_alloc->MaxRxFrameSize = 270 + le16_to_cpu(ppage0_alloc->MaxRxFrameSize); 271 + 272 + port_id = ppage0_alloc->PortIdentifier; 273 + num_targ++; 274 + *p_p0 = *ppage0_alloc; /* save data */ 275 + *p_pp0++ = p_p0++; /* save addr */ 276 + } 277 + pci_free_consistent(ioc->pcidev, data_sz, 278 + (u8 *) ppage0_alloc, page0_dma); 279 + if (rc != 0) 280 + break; 281 + 282 + } while (port_id <= 0xff0000); 283 + 284 + if (num_targ) { 285 + /* sort array */ 286 + if (num_targ > 1) 287 + sort (pp0_array, num_targ, sizeof(FCDevicePage0_t *), 288 + mptfc_FcDevPage0_cmp_func, NULL); 289 + /* call caller's func for each targ */ 290 + for (ii = 0; ii < num_targ; ii++) { 291 + fc = *(pp0_array+ii); 292 + func(ioc, ioc_port, fc); 293 + } 294 + } 295 + 296 + out: 297 + if (pp0_array) 298 + kfree(pp0_array); 299 + if (p0_array) 300 + kfree(p0_array); 301 + return rc; 302 + } 303 + 304 + static int 305 + mptfc_generate_rport_ids(FCDevicePage0_t *pg0, struct fc_rport_identifiers *rid) 306 + { 307 + /* not currently usable */ 308 + if (pg0->Flags & (MPI_FC_DEVICE_PAGE0_FLAGS_PLOGI_INVALID | 309 + MPI_FC_DEVICE_PAGE0_FLAGS_PRLI_INVALID)) 310 + return -1; 311 + 312 + if (!(pg0->Flags & MPI_FC_DEVICE_PAGE0_FLAGS_TARGETID_BUS_VALID)) 313 + return -1; 314 + 315 + if (!(pg0->Protocol & MPI_FC_DEVICE_PAGE0_PROT_FCP_TARGET)) 316 + return -1; 317 + 318 + /* 319 + * board data structure already normalized to platform endianness 320 + * shifted to avoid unaligned access on 64 bit architecture 321 + */ 322 + rid->node_name = ((u64)pg0->WWNN.High) << 32 | (u64)pg0->WWNN.Low; 323 + rid->port_name = ((u64)pg0->WWPN.High) << 32 | (u64)pg0->WWPN.Low; 324 + rid->port_id = pg0->PortIdentifier; 325 + rid->roles = FC_RPORT_ROLE_UNKNOWN; 326 + rid->roles |= FC_RPORT_ROLE_FCP_TARGET; 327 + if (pg0->Protocol & MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR) 328 + rid->roles |= FC_RPORT_ROLE_FCP_INITIATOR; 329 + 330 + return 0; 331 + } 332 + 333 + static void 334 + mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) 335 + { 336 + struct fc_rport_identifiers rport_ids; 337 + struct fc_rport *rport; 338 + struct mptfc_rport_info *ri; 339 + int match = 0; 340 + u64 port_name; 341 + unsigned long flags; 342 + 343 + if (mptfc_generate_rport_ids(pg0, &rport_ids) < 0) 344 + return; 345 + 346 + /* scan list looking for a match */ 347 + spin_lock_irqsave(&ioc->fc_rport_lock, flags); 348 + list_for_each_entry(ri, &ioc->fc_rports, list) { 349 + port_name = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; 350 + if (port_name == rport_ids.port_name) { /* match */ 351 + list_move_tail(&ri->list, &ioc->fc_rports); 352 + match = 1; 353 + break; 354 + } 355 + } 356 + if (!match) { /* allocate one */ 357 + spin_unlock_irqrestore(&ioc->fc_rport_lock, flags); 358 + ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL); 359 + if (!ri) 360 + return; 361 + spin_lock_irqsave(&ioc->fc_rport_lock, flags); 362 + list_add_tail(&ri->list, &ioc->fc_rports); 363 + } 364 + 365 + ri->pg0 = *pg0; /* add/update pg0 data */ 366 + ri->flags &= ~MPT_RPORT_INFO_FLAGS_MISSING; 367 + 368 + if (!(ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED)) { 369 + ri->flags |= MPT_RPORT_INFO_FLAGS_REGISTERED; 370 + spin_unlock_irqrestore(&ioc->fc_rport_lock, flags); 371 + rport = fc_remote_port_add(ioc->sh,channel, &rport_ids); 372 + spin_lock_irqsave(&ioc->fc_rport_lock, flags); 373 + if (rport) { 374 + if (*((struct mptfc_rport_info **)rport->dd_data) != ri) { 375 + ri->flags &= ~MPT_RPORT_INFO_FLAGS_MAPPED_VDEV; 376 + ri->vdev = NULL; 377 + ri->rport = rport; 378 + *((struct mptfc_rport_info **)rport->dd_data) = ri; 379 + } 380 + rport->dev_loss_tmo = mptfc_dev_loss_tmo; 381 + /* 382 + * if already mapped, remap here. If not mapped, 383 + * slave_alloc will allocate vdev and map 384 + */ 385 + if (ri->flags & MPT_RPORT_INFO_FLAGS_MAPPED_VDEV) { 386 + ri->vdev->target_id = ri->pg0.CurrentTargetID; 387 + ri->vdev->bus_id = ri->pg0.CurrentBus; 388 + ri->vdev->vtarget->target_id = ri->vdev->target_id; 389 + ri->vdev->vtarget->bus_id = ri->vdev->bus_id; 390 + } 391 + #ifdef MPT_DEBUG 392 + printk ("mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " 393 + "rport tid %d, tmo %d\n", 394 + ioc->sh->host_no, 395 + pg0->PortIdentifier, 396 + pg0->WWNN, 397 + pg0->WWPN, 398 + pg0->CurrentTargetID, 399 + ri->rport->scsi_target_id, 400 + ri->rport->dev_loss_tmo); 401 + #endif 402 + } else { 403 + list_del(&ri->list); 404 + kfree(ri); 405 + ri = NULL; 406 + } 407 + } 408 + spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); 409 + 410 + } 411 + 412 + /* 413 + * OS entry point to allow host driver to alloc memory 414 + * for each scsi device. Called once per device the bus scan. 415 + * Return non-zero if allocation fails. 416 + * Init memory once per LUN. 417 + */ 418 + int 419 + mptfc_slave_alloc(struct scsi_device *sdev) 420 + { 421 + MPT_SCSI_HOST *hd; 422 + VirtTarget *vtarget; 423 + VirtDevice *vdev; 424 + struct scsi_target *starget; 425 + struct fc_rport *rport; 426 + struct mptfc_rport_info *ri; 427 + unsigned long flags; 428 + 429 + 430 + rport = starget_to_rport(scsi_target(sdev)); 431 + 432 + if (!rport || fc_remote_port_chkready(rport)) 433 + return -ENXIO; 434 + 435 + hd = (MPT_SCSI_HOST *)sdev->host->hostdata; 436 + 437 + vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); 438 + if (!vdev) { 439 + printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 440 + hd->ioc->name, sizeof(VirtDevice)); 441 + return -ENOMEM; 442 + } 443 + memset(vdev, 0, sizeof(VirtDevice)); 444 + 445 + spin_lock_irqsave(&hd->ioc->fc_rport_lock,flags); 446 + 447 + if (!(ri = *((struct mptfc_rport_info **)rport->dd_data))) { 448 + spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); 449 + kfree(vdev); 450 + return -ENODEV; 451 + } 452 + 453 + sdev->hostdata = vdev; 454 + starget = scsi_target(sdev); 455 + vtarget = starget->hostdata; 456 + if (vtarget->num_luns == 0) { 457 + vtarget->tflags = MPT_TARGET_FLAGS_Q_YES | 458 + MPT_TARGET_FLAGS_VALID_INQUIRY; 459 + hd->Targets[sdev->id] = vtarget; 460 + } 461 + 462 + vtarget->target_id = vdev->target_id; 463 + vtarget->bus_id = vdev->bus_id; 464 + 465 + vdev->vtarget = vtarget; 466 + vdev->ioc_id = hd->ioc->id; 467 + vdev->lun = sdev->lun; 468 + vdev->target_id = ri->pg0.CurrentTargetID; 469 + vdev->bus_id = ri->pg0.CurrentBus; 470 + 471 + ri->flags |= MPT_RPORT_INFO_FLAGS_MAPPED_VDEV; 472 + ri->vdev = vdev; 473 + 474 + spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); 475 + 476 + vtarget->num_luns++; 477 + 478 + #ifdef MPT_DEBUG 479 + printk ("mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " 480 + "CurrentTargetID %d, %x %llx %llx\n", 481 + sdev->host->host_no, 482 + vtarget->num_luns, 483 + sdev->id, ri->pg0.CurrentTargetID, 484 + ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN); 485 + #endif 486 + 487 + return 0; 488 + } 489 + 490 + static int 491 + mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 492 + { 493 + struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); 494 + int err; 495 + 496 + err = fc_remote_port_chkready(rport); 497 + if (unlikely(err)) { 498 + SCpnt->result = err; 499 + done(SCpnt); 500 + return 0; 501 + } 502 + return mptscsih_qcmd(SCpnt,done); 503 + } 504 + 505 + static void 506 + mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum) 507 + { 508 + unsigned class = 0, cos = 0; 509 + 510 + /* don't know what to do as only one scsi (fc) host was allocated */ 511 + if (portnum != 0) 512 + return; 513 + 514 + class = ioc->fc_port_page0[portnum].SupportedServiceClass; 515 + if (class & MPI_FCPORTPAGE0_SUPPORT_CLASS_1) 516 + cos |= FC_COS_CLASS1; 517 + if (class & MPI_FCPORTPAGE0_SUPPORT_CLASS_2) 518 + cos |= FC_COS_CLASS2; 519 + if (class & MPI_FCPORTPAGE0_SUPPORT_CLASS_3) 520 + cos |= FC_COS_CLASS3; 521 + 522 + fc_host_node_name(ioc->sh) = 523 + (u64)ioc->fc_port_page0[portnum].WWNN.High << 32 524 + | (u64)ioc->fc_port_page0[portnum].WWNN.Low; 525 + 526 + fc_host_port_name(ioc->sh) = 527 + (u64)ioc->fc_port_page0[portnum].WWPN.High << 32 528 + | (u64)ioc->fc_port_page0[portnum].WWPN.Low; 529 + 530 + fc_host_port_id(ioc->sh) = ioc->fc_port_page0[portnum].PortIdentifier; 531 + 532 + fc_host_supported_classes(ioc->sh) = cos; 533 + 534 + fc_host_tgtid_bind_type(ioc->sh) = FC_TGTID_BIND_BY_WWPN; 535 + } 536 + 537 + static void 538 + mptfc_rescan_devices(void *arg) 539 + { 540 + MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; 541 + int ii; 542 + int work_to_do; 543 + unsigned long flags; 544 + struct mptfc_rport_info *ri; 545 + 546 + do { 547 + /* start by tagging all ports as missing */ 548 + spin_lock_irqsave(&ioc->fc_rport_lock,flags); 549 + list_for_each_entry(ri, &ioc->fc_rports, list) { 550 + if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) { 551 + ri->flags |= MPT_RPORT_INFO_FLAGS_MISSING; 552 + } 553 + } 554 + spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); 555 + 556 + /* 557 + * now rescan devices known to adapter, 558 + * will reregister existing rports 559 + */ 560 + for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 561 + (void) mptbase_GetFcPortPage0(ioc, ii); 562 + mptfc_init_host_attr(ioc,ii); /* refresh */ 563 + mptfc_GetFcDevPage0(ioc,ii,mptfc_register_dev); 564 + } 565 + 566 + /* delete devices still missing */ 567 + spin_lock_irqsave(&ioc->fc_rport_lock, flags); 568 + list_for_each_entry(ri, &ioc->fc_rports, list) { 569 + /* if newly missing, delete it */ 570 + if ((ri->flags & (MPT_RPORT_INFO_FLAGS_REGISTERED | 571 + MPT_RPORT_INFO_FLAGS_MISSING)) 572 + == (MPT_RPORT_INFO_FLAGS_REGISTERED | 573 + MPT_RPORT_INFO_FLAGS_MISSING)) { 574 + 575 + ri->flags &= ~(MPT_RPORT_INFO_FLAGS_REGISTERED| 576 + MPT_RPORT_INFO_FLAGS_MISSING); 577 + fc_remote_port_delete(ri->rport); 578 + /* 579 + * remote port not really deleted 'cause 580 + * binding is by WWPN and driver only 581 + * registers FCP_TARGETs 582 + */ 583 + #ifdef MPT_DEBUG 584 + printk ("mptfc_rescan.%d: %llx deleted\n", 585 + ioc->sh->host_no, ri->pg0.WWPN); 586 + #endif 587 + } 588 + } 589 + spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); 590 + 591 + /* 592 + * allow multiple passes as target state 593 + * might have changed during scan 594 + */ 595 + spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); 596 + if (ioc->fc_rescan_work_count > 2) /* only need one more */ 597 + ioc->fc_rescan_work_count = 2; 598 + work_to_do = --ioc->fc_rescan_work_count; 599 + spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); 600 + } while (work_to_do); 601 + } 602 + 603 static int 604 mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) 605 { ··· 148 MPT_SCSI_HOST *hd; 149 MPT_ADAPTER *ioc; 150 unsigned long flags; 151 + int ii; 152 int numSGE = 0; 153 int scale; 154 int ioc_cap; 155 int error=0; 156 int r; 157 + 158 if ((r = mpt_attach(pdev,id)) != 0) 159 return r; 160 + 161 ioc = pci_get_drvdata(pdev); 162 ioc->DoneCtx = mptfcDoneCtx; 163 ioc->TaskCtx = mptfcTaskCtx; ··· 194 printk(MYIOC_s_WARN_FMT 195 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n", 196 ioc->name, ioc); 197 + return -ENODEV; 198 } 199 200 sh = scsi_host_alloc(&mptfc_driver_template, sizeof(MPT_SCSI_HOST)); ··· 206 error = -1; 207 goto out_mptfc_probe; 208 } 209 + 210 + INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices,(void *)ioc); 211 212 spin_lock_irqsave(&ioc->FreeQlock, flags); 213 ··· 268 /* SCSI needs scsi_cmnd lookup table! 269 * (with size equal to req_depth*PtrSz!) 270 */ 271 + hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); 272 + if (!hd->ScsiLookup) { 273 error = -ENOMEM; 274 goto out_mptfc_probe; 275 } 276 277 + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n", 278 + ioc->name, hd->ScsiLookup)); 279 280 /* Allocate memory for the device structures. 281 * A non-Null pointer at an offset 282 * indicates a device exists. 283 * max_id = 1 + maximum id (hosts.h) 284 */ 285 + hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC); 286 + if (!hd->Targets) { 287 error = -ENOMEM; 288 goto out_mptfc_probe; 289 } 290 291 + dprintk((KERN_INFO " vdev @ %p\n", hd->Targets)); 292 293 /* Clear the TM flags 294 */ ··· 332 hd->scandv_wait_done = 0; 333 hd->last_queue_full = 0; 334 335 + sh->transportt = mptfc_transport_template; 336 error = scsi_add_host (sh, &ioc->pcidev->dev); 337 if(error) { 338 dprintk((KERN_ERR MYNAM ··· 339 goto out_mptfc_probe; 340 } 341 342 + for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 343 + mptfc_init_host_attr(ioc,ii); 344 + mptfc_GetFcDevPage0(ioc,ii,mptfc_register_dev); 345 + } 346 + 347 return 0; 348 349 out_mptfc_probe: ··· 352 .name = "mptfc", 353 .id_table = mptfc_pci_table, 354 .probe = mptfc_probe, 355 + .remove = __devexit_p(mptfc_remove), 356 .shutdown = mptscsih_shutdown, 357 #ifdef CONFIG_PM 358 .suspend = mptscsih_suspend, ··· 370 static int __init 371 mptfc_init(void) 372 { 373 + int error; 374 375 show_mptmod_ver(my_NAME, my_VERSION); 376 + 377 + /* sanity check module parameter */ 378 + if (mptfc_dev_loss_tmo == 0) 379 + mptfc_dev_loss_tmo = MPTFC_DEV_LOSS_TMO; 380 + 381 + mptfc_transport_template = 382 + fc_attach_transport(&mptfc_transport_functions); 383 + 384 + if (!mptfc_transport_template) 385 + return -ENODEV; 386 387 mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER); 388 mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER); ··· 387 ": Registered for IOC reset notifications\n")); 388 } 389 390 + error = pci_register_driver(&mptfc_driver); 391 + if (error) { 392 + fc_release_transport(mptfc_transport_template); 393 + } 394 + 395 + return error; 396 + } 397 + 398 + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 399 + /** 400 + * mptfc_remove - Removed fc infrastructure for devices 401 + * @pdev: Pointer to pci_dev structure 402 + * 403 + */ 404 + static void __devexit mptfc_remove(struct pci_dev *pdev) 405 + { 406 + MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 407 + struct mptfc_rport_info *p, *n; 408 + 409 + fc_remove_host(ioc->sh); 410 + 411 + list_for_each_entry_safe(p, n, &ioc->fc_rports, list) { 412 + list_del(&p->list); 413 + kfree(p); 414 + } 415 + 416 + mptscsih_remove(pdev); 417 } 418 419 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ ··· 400 mptfc_exit(void) 401 { 402 pci_unregister_driver(&mptfc_driver); 403 + fc_release_transport(mptfc_transport_template); 404 + 405 mpt_reset_deregister(mptfcDoneCtx); 406 dprintk((KERN_INFO MYNAM 407 ": Deregistered for IOC reset notifications\n"));
+5 -9
drivers/message/fusion/mptlan.c
··· 411 goto out; 412 priv->mpt_txfidx_tail = -1; 413 414 - priv->SendCtl = kmalloc(priv->tx_max_out * sizeof(struct BufferControl), 415 GFP_KERNEL); 416 if (priv->SendCtl == NULL) 417 goto out_mpt_txfidx; 418 - for (i = 0; i < priv->tx_max_out; i++) { 419 - memset(&priv->SendCtl[i], 0, sizeof(struct BufferControl)); 420 priv->mpt_txfidx[++priv->mpt_txfidx_tail] = i; 421 - } 422 423 dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); 424 ··· 426 goto out_SendCtl; 427 priv->mpt_rxfidx_tail = -1; 428 429 - priv->RcvCtl = kmalloc(priv->max_buckets_out * 430 - sizeof(struct BufferControl), 431 GFP_KERNEL); 432 if (priv->RcvCtl == NULL) 433 goto out_mpt_rxfidx; 434 - for (i = 0; i < priv->max_buckets_out; i++) { 435 - memset(&priv->RcvCtl[i], 0, sizeof(struct BufferControl)); 436 priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; 437 - } 438 439 /**/ dlprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); 440 /**/ for (i = 0; i < priv->tx_max_out; i++)
··· 411 goto out; 412 priv->mpt_txfidx_tail = -1; 413 414 + priv->SendCtl = kcalloc(priv->tx_max_out, sizeof(struct BufferControl), 415 GFP_KERNEL); 416 if (priv->SendCtl == NULL) 417 goto out_mpt_txfidx; 418 + for (i = 0; i < priv->tx_max_out; i++) 419 priv->mpt_txfidx[++priv->mpt_txfidx_tail] = i; 420 421 dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); 422 ··· 428 goto out_SendCtl; 429 priv->mpt_rxfidx_tail = -1; 430 431 + priv->RcvCtl = kcalloc(priv->max_buckets_out, 432 + sizeof(struct BufferControl), 433 GFP_KERNEL); 434 if (priv->RcvCtl == NULL) 435 goto out_mpt_rxfidx; 436 + for (i = 0; i < priv->max_buckets_out; i++) 437 priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; 438 439 /**/ dlprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); 440 /**/ for (i = 0; i < priv->tx_max_out; i++)
+346 -58
drivers/message/fusion/mptsas.c
··· 5 * 6 * Copyright (c) 1999-2005 LSI Logic Corporation 7 * (mailto:mpt_linux_developer@lsil.com) 8 - * Copyright (c) 2005 Dell 9 */ 10 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 11 /* ··· 86 static int mptsasMgmtCtx = -1; 87 88 89 /* 90 * SAS topology structures 91 * ··· 117 u8 phy_id; /* phy number of parent device */ 118 u8 port_id; /* sas physical port this device 119 is assoc'd with */ 120 - u8 target; /* logical target id of this device */ 121 - u8 bus; /* logical bus number of this device */ 122 u64 sas_address; /* WWN of this device, 123 SATA is assigned by HBA,expander */ 124 u32 device_info; /* bitfield detailed info about this device */ ··· 132 u8 programmed_link_rate; /* programmed max/min phy link rate */ 133 struct mptsas_devinfo identify; /* point to phy device info */ 134 struct mptsas_devinfo attached; /* point to attached device info */ 135 struct sas_rphy *rphy; 136 }; 137 ··· 258 struct scsi_target *starget; 259 int i; 260 261 - vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); 262 if (!vdev) { 263 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 264 hd->ioc->name, sizeof(VirtDevice)); 265 return -ENOMEM; 266 } 267 - memset(vdev, 0, sizeof(VirtDevice)); 268 vdev->ioc_id = hd->ioc->id; 269 sdev->hostdata = vdev; 270 starget = scsi_target(sdev); ··· 274 hd->Targets[sdev->id] = vtarget; 275 } 276 277 rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 278 list_for_each_entry(p, &hd->ioc->sas_topology, list) { 279 for (i = 0; i < p->num_phys; i++) { 280 if (p->phy_info[i].attached.sas_address == 281 rphy->identify.sas_address) { 282 vdev->target_id = 283 - p->phy_info[i].attached.target; 284 - vdev->bus_id = p->phy_info[i].attached.bus; 285 vdev->lun = sdev->lun; 286 goto out; 287 } 288 } 289 } 290 291 printk("No matching SAS device found!!\n"); 292 kfree(vdev); ··· 313 return 0; 314 } 315 316 static struct scsi_host_template mptsas_driver_template = { 317 .module = THIS_MODULE, 318 .proc_name = "mptsas", ··· 360 .slave_alloc = mptsas_slave_alloc, 361 .slave_configure = mptscsih_slave_configure, 362 .target_destroy = mptscsih_target_destroy, 363 - .slave_destroy = mptscsih_slave_destroy, 364 .change_queue_depth = mptscsih_change_queue_depth, 365 .eh_abort_handler = mptscsih_abort, 366 .eh_device_reset_handler = mptscsih_dev_reset, ··· 466 if (phy->identify.target_port_protocols & SAS_PROTOCOL_SMP) 467 return -ENXIO; 468 469 - if (down_interruptible(&ioc->sas_mgmt.mutex)) 470 goto out; 471 472 mf = mpt_get_msg_frame(mptsasMgmtCtx, ioc); ··· 517 error = 0; 518 519 out_unlock: 520 - up(&ioc->sas_mgmt.mutex); 521 out: 522 return error; 523 } ··· 716 device_info->handle = le16_to_cpu(buffer->DevHandle); 717 device_info->phy_id = buffer->PhyNum; 718 device_info->port_id = buffer->PhysicalPort; 719 - device_info->target = buffer->TargetID; 720 - device_info->bus = buffer->Bus; 721 memcpy(&sas_address, &buffer->SASAddress, sizeof(__le64)); 722 device_info->sas_address = le64_to_cpu(sas_address); 723 device_info->device_info = ··· 925 static int mptsas_probe_one_phy(struct device *dev, 926 struct mptsas_phyinfo *phy_info, int index, int local) 927 { 928 - struct sas_phy *port; 929 int error; 930 931 - port = sas_phy_alloc(dev, index); 932 - if (!port) 933 return -ENOMEM; 934 935 - port->port_identifier = phy_info->port_id; 936 - mptsas_parse_device_info(&port->identify, &phy_info->identify); 937 938 /* 939 * Set Negotiated link rate. 940 */ 941 switch (phy_info->negotiated_link_rate) { 942 case MPI_SAS_IOUNIT0_RATE_PHY_DISABLED: 943 - port->negotiated_linkrate = SAS_PHY_DISABLED; 944 break; 945 case MPI_SAS_IOUNIT0_RATE_FAILED_SPEED_NEGOTIATION: 946 - port->negotiated_linkrate = SAS_LINK_RATE_FAILED; 947 break; 948 case MPI_SAS_IOUNIT0_RATE_1_5: 949 - port->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; 950 break; 951 case MPI_SAS_IOUNIT0_RATE_3_0: 952 - port->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; 953 break; 954 case MPI_SAS_IOUNIT0_RATE_SATA_OOB_COMPLETE: 955 case MPI_SAS_IOUNIT0_RATE_UNKNOWN: 956 default: 957 - port->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; 958 break; 959 } 960 ··· 963 */ 964 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) { 965 case MPI_SAS_PHY0_HWRATE_MAX_RATE_1_5: 966 - port->maximum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 967 break; 968 case MPI_SAS_PHY0_PRATE_MAX_RATE_3_0: 969 - port->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 970 break; 971 default: 972 break; ··· 978 switch (phy_info->programmed_link_rate & 979 MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) { 980 case MPI_SAS_PHY0_PRATE_MAX_RATE_1_5: 981 - port->maximum_linkrate = SAS_LINK_RATE_1_5_GBPS; 982 break; 983 case MPI_SAS_PHY0_PRATE_MAX_RATE_3_0: 984 - port->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS; 985 break; 986 default: 987 break; ··· 992 */ 993 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_HWRATE_MIN_RATE_MASK) { 994 case MPI_SAS_PHY0_HWRATE_MIN_RATE_1_5: 995 - port->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 996 break; 997 case MPI_SAS_PHY0_PRATE_MIN_RATE_3_0: 998 - port->minimum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 999 break; 1000 default: 1001 break; ··· 1007 switch (phy_info->programmed_link_rate & 1008 MPI_SAS_PHY0_PRATE_MIN_RATE_MASK) { 1009 case MPI_SAS_PHY0_PRATE_MIN_RATE_1_5: 1010 - port->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 1011 break; 1012 case MPI_SAS_PHY0_PRATE_MIN_RATE_3_0: 1013 - port->minimum_linkrate = SAS_LINK_RATE_3_0_GBPS; 1014 break; 1015 default: 1016 break; 1017 } 1018 1019 if (local) 1020 - port->local_attached = 1; 1021 1022 - error = sas_phy_add(port); 1023 if (error) { 1024 - sas_phy_free(port); 1025 return error; 1026 } 1027 1028 if (phy_info->attached.handle) { 1029 struct sas_rphy *rphy; 1030 1031 - rphy = sas_rphy_alloc(port); 1032 if (!rphy) 1033 return 0; /* non-fatal: an rphy can be added later */ 1034 ··· 1053 u32 handle = 0xFFFF; 1054 int error = -ENOMEM, i; 1055 1056 - port_info = kmalloc(sizeof(*port_info), GFP_KERNEL); 1057 if (!port_info) 1058 goto out; 1059 - memset(port_info, 0, sizeof(*port_info)); 1060 1061 error = mptsas_sas_io_unit_pg0(ioc, port_info); 1062 if (error) 1063 goto out_free_port_info; 1064 1065 list_add_tail(&port_info->list, &ioc->sas_topology); 1066 for (i = 0; i < port_info->num_phys; i++) { 1067 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], 1068 (MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER << ··· 1105 struct mptsas_portinfo *port_info, *p; 1106 int error = -ENOMEM, i, j; 1107 1108 - port_info = kmalloc(sizeof(*port_info), GFP_KERNEL); 1109 if (!port_info) 1110 goto out; 1111 - memset(port_info, 0, sizeof(*port_info)); 1112 1113 error = mptsas_sas_expander_pg0(ioc, port_info, 1114 (MPI_SAS_EXPAND_PGAD_FORM_GET_NEXT_HANDLE << ··· 1117 1118 *handle = port_info->handle; 1119 1120 list_add_tail(&port_info->list, &ioc->sas_topology); 1121 for (i = 0; i < port_info->num_phys; i++) { 1122 struct device *parent; 1123 ··· 1152 * HBA phys. 1153 */ 1154 parent = &ioc->sh->shost_gendev; 1155 list_for_each_entry(p, &ioc->sas_topology, list) { 1156 for (j = 0; j < p->num_phys; j++) { 1157 if (port_info->phy_info[i].identify.handle == ··· 1160 parent = &p->phy_info[j].rphy->dev; 1161 } 1162 } 1163 1164 mptsas_probe_one_phy(parent, &port_info->phy_info[i], 1165 *index, 0); ··· 1186 ; 1187 } 1188 1189 static int 1190 mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1191 { ··· 1398 MPT_SCSI_HOST *hd; 1399 MPT_ADAPTER *ioc; 1400 unsigned long flags; 1401 - int sz, ii; 1402 int numSGE = 0; 1403 int scale; 1404 int ioc_cap; 1405 - u8 *mem; 1406 int error=0; 1407 int r; 1408 ··· 1482 sh->unique_id = ioc->id; 1483 1484 INIT_LIST_HEAD(&ioc->sas_topology); 1485 - init_MUTEX(&ioc->sas_mgmt.mutex); 1486 init_completion(&ioc->sas_mgmt.done); 1487 1488 /* Verify that we won't exceed the maximum ··· 1525 /* SCSI needs scsi_cmnd lookup table! 1526 * (with size equal to req_depth*PtrSz!) 1527 */ 1528 - sz = ioc->req_depth * sizeof(void *); 1529 - mem = kmalloc(sz, GFP_ATOMIC); 1530 - if (mem == NULL) { 1531 error = -ENOMEM; 1532 goto out_mptsas_probe; 1533 } 1534 1535 - memset(mem, 0, sz); 1536 - hd->ScsiLookup = (struct scsi_cmnd **) mem; 1537 - 1538 - dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n", 1539 - ioc->name, hd->ScsiLookup, sz)); 1540 1541 /* Allocate memory for the device structures. 1542 * A non-Null pointer at an offset 1543 * indicates a device exists. 1544 * max_id = 1 + maximum id (hosts.h) 1545 */ 1546 - sz = sh->max_id * sizeof(void *); 1547 - mem = kmalloc(sz, GFP_ATOMIC); 1548 - if (mem == NULL) { 1549 error = -ENOMEM; 1550 goto out_mptsas_probe; 1551 } 1552 1553 - memset(mem, 0, sz); 1554 - hd->Targets = (VirtTarget **) mem; 1555 - 1556 - dprintk((KERN_INFO 1557 - " vtarget @ %p, sz=%d\n", hd->Targets, sz)); 1558 1559 /* Clear the TM flags 1560 */ ··· 1596 1597 mptsas_scan_sas_topology(ioc); 1598 1599 return 0; 1600 1601 out_mptsas_probe: ··· 1625 1626 sas_remove_host(ioc->sh); 1627 1628 list_for_each_entry_safe(p, n, &ioc->sas_topology, list) { 1629 list_del(&p->list); 1630 kfree(p); 1631 } 1632 1633 mptscsih_remove(pdev); 1634 } ··· 1681 mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER); 1682 mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); 1683 1684 - if (mpt_event_register(mptsasDoneCtx, mptscsih_event_process) == 0) { 1685 devtprintk((KERN_INFO MYNAM 1686 ": Registered for IOC event notifications\n")); 1687 }
··· 5 * 6 * Copyright (c) 1999-2005 LSI Logic Corporation 7 * (mailto:mpt_linux_developer@lsil.com) 8 + * Copyright (c) 2005-2006 Dell 9 */ 10 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 11 /* ··· 86 static int mptsasMgmtCtx = -1; 87 88 89 + enum mptsas_hotplug_action { 90 + MPTSAS_ADD_DEVICE, 91 + MPTSAS_DEL_DEVICE, 92 + }; 93 + 94 + struct mptsas_hotplug_event { 95 + struct work_struct work; 96 + MPT_ADAPTER *ioc; 97 + enum mptsas_hotplug_action event_type; 98 + u64 sas_address; 99 + u32 channel; 100 + u32 id; 101 + u32 device_info; 102 + u16 handle; 103 + u16 parent_handle; 104 + u8 phy_id; 105 + }; 106 + 107 /* 108 * SAS topology structures 109 * ··· 99 u8 phy_id; /* phy number of parent device */ 100 u8 port_id; /* sas physical port this device 101 is assoc'd with */ 102 + u8 id; /* logical target id of this device */ 103 + u8 channel; /* logical bus number of this device */ 104 u64 sas_address; /* WWN of this device, 105 SATA is assigned by HBA,expander */ 106 u32 device_info; /* bitfield detailed info about this device */ ··· 114 u8 programmed_link_rate; /* programmed max/min phy link rate */ 115 struct mptsas_devinfo identify; /* point to phy device info */ 116 struct mptsas_devinfo attached; /* point to attached device info */ 117 + struct sas_phy *phy; 118 struct sas_rphy *rphy; 119 }; 120 ··· 239 struct scsi_target *starget; 240 int i; 241 242 + vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); 243 if (!vdev) { 244 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 245 hd->ioc->name, sizeof(VirtDevice)); 246 return -ENOMEM; 247 } 248 vdev->ioc_id = hd->ioc->id; 249 sdev->hostdata = vdev; 250 starget = scsi_target(sdev); ··· 256 hd->Targets[sdev->id] = vtarget; 257 } 258 259 + /* 260 + RAID volumes placed beyond the last expected port. 261 + */ 262 + if (sdev->channel == hd->ioc->num_ports) { 263 + vdev->target_id = sdev->id; 264 + vdev->bus_id = 0; 265 + vdev->lun = 0; 266 + goto out; 267 + } 268 + 269 rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 270 + mutex_lock(&hd->ioc->sas_topology_mutex); 271 list_for_each_entry(p, &hd->ioc->sas_topology, list) { 272 for (i = 0; i < p->num_phys; i++) { 273 if (p->phy_info[i].attached.sas_address == 274 rphy->identify.sas_address) { 275 vdev->target_id = 276 + p->phy_info[i].attached.id; 277 + vdev->bus_id = p->phy_info[i].attached.channel; 278 vdev->lun = sdev->lun; 279 + mutex_unlock(&hd->ioc->sas_topology_mutex); 280 goto out; 281 } 282 } 283 } 284 + mutex_unlock(&hd->ioc->sas_topology_mutex); 285 286 printk("No matching SAS device found!!\n"); 287 kfree(vdev); ··· 282 return 0; 283 } 284 285 + static void 286 + mptsas_slave_destroy(struct scsi_device *sdev) 287 + { 288 + struct Scsi_Host *host = sdev->host; 289 + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; 290 + struct sas_rphy *rphy; 291 + struct mptsas_portinfo *p; 292 + int i; 293 + 294 + /* 295 + * Handle hotplug removal case. 296 + * We need to clear out attached data structure. 297 + */ 298 + rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 299 + 300 + mutex_lock(&hd->ioc->sas_topology_mutex); 301 + list_for_each_entry(p, &hd->ioc->sas_topology, list) { 302 + for (i = 0; i < p->num_phys; i++) { 303 + if (p->phy_info[i].attached.sas_address == 304 + rphy->identify.sas_address) { 305 + memset(&p->phy_info[i].attached, 0, 306 + sizeof(struct mptsas_devinfo)); 307 + p->phy_info[i].rphy = NULL; 308 + goto out; 309 + } 310 + } 311 + } 312 + 313 + out: 314 + mutex_unlock(&hd->ioc->sas_topology_mutex); 315 + /* 316 + * TODO: Issue target reset to flush firmware outstanding commands. 317 + */ 318 + mptscsih_slave_destroy(sdev); 319 + } 320 + 321 static struct scsi_host_template mptsas_driver_template = { 322 .module = THIS_MODULE, 323 .proc_name = "mptsas", ··· 293 .slave_alloc = mptsas_slave_alloc, 294 .slave_configure = mptscsih_slave_configure, 295 .target_destroy = mptscsih_target_destroy, 296 + .slave_destroy = mptsas_slave_destroy, 297 .change_queue_depth = mptscsih_change_queue_depth, 298 .eh_abort_handler = mptscsih_abort, 299 .eh_device_reset_handler = mptscsih_dev_reset, ··· 399 if (phy->identify.target_port_protocols & SAS_PROTOCOL_SMP) 400 return -ENXIO; 401 402 + if (mutex_lock_interruptible(&ioc->sas_mgmt.mutex)) 403 goto out; 404 405 mf = mpt_get_msg_frame(mptsasMgmtCtx, ioc); ··· 450 error = 0; 451 452 out_unlock: 453 + mutex_unlock(&ioc->sas_mgmt.mutex); 454 out: 455 return error; 456 } ··· 649 device_info->handle = le16_to_cpu(buffer->DevHandle); 650 device_info->phy_id = buffer->PhyNum; 651 device_info->port_id = buffer->PhysicalPort; 652 + device_info->id = buffer->TargetID; 653 + device_info->channel = buffer->Bus; 654 memcpy(&sas_address, &buffer->SASAddress, sizeof(__le64)); 655 device_info->sas_address = le64_to_cpu(sas_address); 656 device_info->device_info = ··· 858 static int mptsas_probe_one_phy(struct device *dev, 859 struct mptsas_phyinfo *phy_info, int index, int local) 860 { 861 + struct sas_phy *phy; 862 int error; 863 864 + phy = sas_phy_alloc(dev, index); 865 + if (!phy) 866 return -ENOMEM; 867 868 + phy->port_identifier = phy_info->port_id; 869 + mptsas_parse_device_info(&phy->identify, &phy_info->identify); 870 871 /* 872 * Set Negotiated link rate. 873 */ 874 switch (phy_info->negotiated_link_rate) { 875 case MPI_SAS_IOUNIT0_RATE_PHY_DISABLED: 876 + phy->negotiated_linkrate = SAS_PHY_DISABLED; 877 break; 878 case MPI_SAS_IOUNIT0_RATE_FAILED_SPEED_NEGOTIATION: 879 + phy->negotiated_linkrate = SAS_LINK_RATE_FAILED; 880 break; 881 case MPI_SAS_IOUNIT0_RATE_1_5: 882 + phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; 883 break; 884 case MPI_SAS_IOUNIT0_RATE_3_0: 885 + phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; 886 break; 887 case MPI_SAS_IOUNIT0_RATE_SATA_OOB_COMPLETE: 888 case MPI_SAS_IOUNIT0_RATE_UNKNOWN: 889 default: 890 + phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; 891 break; 892 } 893 ··· 896 */ 897 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) { 898 case MPI_SAS_PHY0_HWRATE_MAX_RATE_1_5: 899 + phy->maximum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 900 break; 901 case MPI_SAS_PHY0_PRATE_MAX_RATE_3_0: 902 + phy->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 903 break; 904 default: 905 break; ··· 911 switch (phy_info->programmed_link_rate & 912 MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) { 913 case MPI_SAS_PHY0_PRATE_MAX_RATE_1_5: 914 + phy->maximum_linkrate = SAS_LINK_RATE_1_5_GBPS; 915 break; 916 case MPI_SAS_PHY0_PRATE_MAX_RATE_3_0: 917 + phy->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS; 918 break; 919 default: 920 break; ··· 925 */ 926 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_HWRATE_MIN_RATE_MASK) { 927 case MPI_SAS_PHY0_HWRATE_MIN_RATE_1_5: 928 + phy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 929 break; 930 case MPI_SAS_PHY0_PRATE_MIN_RATE_3_0: 931 + phy->minimum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 932 break; 933 default: 934 break; ··· 940 switch (phy_info->programmed_link_rate & 941 MPI_SAS_PHY0_PRATE_MIN_RATE_MASK) { 942 case MPI_SAS_PHY0_PRATE_MIN_RATE_1_5: 943 + phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 944 break; 945 case MPI_SAS_PHY0_PRATE_MIN_RATE_3_0: 946 + phy->minimum_linkrate = SAS_LINK_RATE_3_0_GBPS; 947 break; 948 default: 949 break; 950 } 951 952 if (local) 953 + phy->local_attached = 1; 954 955 + error = sas_phy_add(phy); 956 if (error) { 957 + sas_phy_free(phy); 958 return error; 959 } 960 + phy_info->phy = phy; 961 962 if (phy_info->attached.handle) { 963 struct sas_rphy *rphy; 964 965 + rphy = sas_rphy_alloc(phy); 966 if (!rphy) 967 return 0; /* non-fatal: an rphy can be added later */ 968 ··· 985 u32 handle = 0xFFFF; 986 int error = -ENOMEM, i; 987 988 + port_info = kzalloc(sizeof(*port_info), GFP_KERNEL); 989 if (!port_info) 990 goto out; 991 992 error = mptsas_sas_io_unit_pg0(ioc, port_info); 993 if (error) 994 goto out_free_port_info; 995 996 + ioc->num_ports = port_info->num_phys; 997 + mutex_lock(&ioc->sas_topology_mutex); 998 list_add_tail(&port_info->list, &ioc->sas_topology); 999 + mutex_unlock(&ioc->sas_topology_mutex); 1000 + 1001 for (i = 0; i < port_info->num_phys; i++) { 1002 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], 1003 (MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER << ··· 1034 struct mptsas_portinfo *port_info, *p; 1035 int error = -ENOMEM, i, j; 1036 1037 + port_info = kzalloc(sizeof(*port_info), GFP_KERNEL); 1038 if (!port_info) 1039 goto out; 1040 1041 error = mptsas_sas_expander_pg0(ioc, port_info, 1042 (MPI_SAS_EXPAND_PGAD_FORM_GET_NEXT_HANDLE << ··· 1047 1048 *handle = port_info->handle; 1049 1050 + mutex_lock(&ioc->sas_topology_mutex); 1051 list_add_tail(&port_info->list, &ioc->sas_topology); 1052 + mutex_unlock(&ioc->sas_topology_mutex); 1053 + 1054 for (i = 0; i < port_info->num_phys; i++) { 1055 struct device *parent; 1056 ··· 1079 * HBA phys. 1080 */ 1081 parent = &ioc->sh->shost_gendev; 1082 + mutex_lock(&ioc->sas_topology_mutex); 1083 list_for_each_entry(p, &ioc->sas_topology, list) { 1084 for (j = 0; j < p->num_phys; j++) { 1085 if (port_info->phy_info[i].identify.handle == ··· 1086 parent = &p->phy_info[j].rphy->dev; 1087 } 1088 } 1089 + mutex_unlock(&ioc->sas_topology_mutex); 1090 1091 mptsas_probe_one_phy(parent, &port_info->phy_info[i], 1092 *index, 0); ··· 1111 ; 1112 } 1113 1114 + static struct mptsas_phyinfo * 1115 + mptsas_find_phyinfo_by_parent(MPT_ADAPTER *ioc, u16 parent_handle, u8 phy_id) 1116 + { 1117 + struct mptsas_portinfo *port_info; 1118 + struct mptsas_devinfo device_info; 1119 + struct mptsas_phyinfo *phy_info = NULL; 1120 + int i, error; 1121 + 1122 + /* 1123 + * Retrieve the parent sas_address 1124 + */ 1125 + error = mptsas_sas_device_pg0(ioc, &device_info, 1126 + (MPI_SAS_DEVICE_PGAD_FORM_HANDLE << 1127 + MPI_SAS_DEVICE_PGAD_FORM_SHIFT), 1128 + parent_handle); 1129 + if (error) { 1130 + printk("mptsas: failed to retrieve device page\n"); 1131 + return NULL; 1132 + } 1133 + 1134 + /* 1135 + * The phy_info structures are never deallocated during lifetime of 1136 + * a host, so the code below is safe without additional refcounting. 1137 + */ 1138 + mutex_lock(&ioc->sas_topology_mutex); 1139 + list_for_each_entry(port_info, &ioc->sas_topology, list) { 1140 + for (i = 0; i < port_info->num_phys; i++) { 1141 + if (port_info->phy_info[i].identify.sas_address == 1142 + device_info.sas_address && 1143 + port_info->phy_info[i].phy_id == phy_id) { 1144 + phy_info = &port_info->phy_info[i]; 1145 + break; 1146 + } 1147 + } 1148 + } 1149 + mutex_unlock(&ioc->sas_topology_mutex); 1150 + 1151 + return phy_info; 1152 + } 1153 + 1154 + static struct mptsas_phyinfo * 1155 + mptsas_find_phyinfo_by_handle(MPT_ADAPTER *ioc, u16 handle) 1156 + { 1157 + struct mptsas_portinfo *port_info; 1158 + struct mptsas_phyinfo *phy_info = NULL; 1159 + int i; 1160 + 1161 + /* 1162 + * The phy_info structures are never deallocated during lifetime of 1163 + * a host, so the code below is safe without additional refcounting. 1164 + */ 1165 + mutex_lock(&ioc->sas_topology_mutex); 1166 + list_for_each_entry(port_info, &ioc->sas_topology, list) { 1167 + for (i = 0; i < port_info->num_phys; i++) { 1168 + if (port_info->phy_info[i].attached.handle == handle) { 1169 + phy_info = &port_info->phy_info[i]; 1170 + break; 1171 + } 1172 + } 1173 + } 1174 + mutex_unlock(&ioc->sas_topology_mutex); 1175 + 1176 + return phy_info; 1177 + } 1178 + 1179 + static void 1180 + mptsas_hotplug_work(void *arg) 1181 + { 1182 + struct mptsas_hotplug_event *ev = arg; 1183 + MPT_ADAPTER *ioc = ev->ioc; 1184 + struct mptsas_phyinfo *phy_info; 1185 + struct sas_rphy *rphy; 1186 + char *ds = NULL; 1187 + 1188 + if (ev->device_info & MPI_SAS_DEVICE_INFO_SSP_TARGET) 1189 + ds = "ssp"; 1190 + if (ev->device_info & MPI_SAS_DEVICE_INFO_STP_TARGET) 1191 + ds = "stp"; 1192 + if (ev->device_info & MPI_SAS_DEVICE_INFO_SATA_DEVICE) 1193 + ds = "sata"; 1194 + 1195 + switch (ev->event_type) { 1196 + case MPTSAS_DEL_DEVICE: 1197 + printk(MYIOC_s_INFO_FMT 1198 + "removing %s device, channel %d, id %d, phy %d\n", 1199 + ioc->name, ds, ev->channel, ev->id, ev->phy_id); 1200 + 1201 + phy_info = mptsas_find_phyinfo_by_handle(ioc, ev->handle); 1202 + if (!phy_info) { 1203 + printk("mptsas: remove event for non-existant PHY.\n"); 1204 + break; 1205 + } 1206 + 1207 + if (phy_info->rphy) { 1208 + sas_rphy_delete(phy_info->rphy); 1209 + phy_info->rphy = NULL; 1210 + } 1211 + break; 1212 + case MPTSAS_ADD_DEVICE: 1213 + printk(MYIOC_s_INFO_FMT 1214 + "attaching %s device, channel %d, id %d, phy %d\n", 1215 + ioc->name, ds, ev->channel, ev->id, ev->phy_id); 1216 + 1217 + phy_info = mptsas_find_phyinfo_by_parent(ioc, 1218 + ev->parent_handle, ev->phy_id); 1219 + if (!phy_info) { 1220 + printk("mptsas: add event for non-existant PHY.\n"); 1221 + break; 1222 + } 1223 + 1224 + if (phy_info->rphy) { 1225 + printk("mptsas: trying to add existing device.\n"); 1226 + break; 1227 + } 1228 + 1229 + /* fill attached info */ 1230 + phy_info->attached.handle = ev->handle; 1231 + phy_info->attached.phy_id = ev->phy_id; 1232 + phy_info->attached.port_id = phy_info->identify.port_id; 1233 + phy_info->attached.id = ev->id; 1234 + phy_info->attached.channel = ev->channel; 1235 + phy_info->attached.sas_address = ev->sas_address; 1236 + phy_info->attached.device_info = ev->device_info; 1237 + 1238 + rphy = sas_rphy_alloc(phy_info->phy); 1239 + if (!rphy) 1240 + break; /* non-fatal: an rphy can be added later */ 1241 + 1242 + mptsas_parse_device_info(&rphy->identify, &phy_info->attached); 1243 + if (sas_rphy_add(rphy)) { 1244 + sas_rphy_free(rphy); 1245 + break; 1246 + } 1247 + 1248 + phy_info->rphy = rphy; 1249 + break; 1250 + } 1251 + 1252 + kfree(ev); 1253 + } 1254 + 1255 + static void 1256 + mptscsih_send_sas_event(MPT_ADAPTER *ioc, 1257 + EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *sas_event_data) 1258 + { 1259 + struct mptsas_hotplug_event *ev; 1260 + u32 device_info = le32_to_cpu(sas_event_data->DeviceInfo); 1261 + __le64 sas_address; 1262 + 1263 + if ((device_info & 1264 + (MPI_SAS_DEVICE_INFO_SSP_TARGET | 1265 + MPI_SAS_DEVICE_INFO_STP_TARGET | 1266 + MPI_SAS_DEVICE_INFO_SATA_DEVICE )) == 0) 1267 + return; 1268 + 1269 + if ((sas_event_data->ReasonCode & 1270 + (MPI_EVENT_SAS_DEV_STAT_RC_ADDED | 1271 + MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING)) == 0) 1272 + return; 1273 + 1274 + ev = kmalloc(sizeof(*ev), GFP_ATOMIC); 1275 + if (!ev) { 1276 + printk(KERN_WARNING "mptsas: lost hotplug event\n"); 1277 + return; 1278 + } 1279 + 1280 + 1281 + INIT_WORK(&ev->work, mptsas_hotplug_work, ev); 1282 + ev->ioc = ioc; 1283 + ev->handle = le16_to_cpu(sas_event_data->DevHandle); 1284 + ev->parent_handle = le16_to_cpu(sas_event_data->ParentDevHandle); 1285 + ev->channel = sas_event_data->Bus; 1286 + ev->id = sas_event_data->TargetID; 1287 + ev->phy_id = sas_event_data->PhyNum; 1288 + memcpy(&sas_address, &sas_event_data->SASAddress, sizeof(__le64)); 1289 + ev->sas_address = le64_to_cpu(sas_address); 1290 + ev->device_info = device_info; 1291 + 1292 + if (sas_event_data->ReasonCode & MPI_EVENT_SAS_DEV_STAT_RC_ADDED) 1293 + ev->event_type = MPTSAS_ADD_DEVICE; 1294 + else 1295 + ev->event_type = MPTSAS_DEL_DEVICE; 1296 + 1297 + schedule_work(&ev->work); 1298 + } 1299 + 1300 + static int 1301 + mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) 1302 + { 1303 + u8 event = le32_to_cpu(reply->Event) & 0xFF; 1304 + 1305 + if (!ioc->sh) 1306 + return 1; 1307 + 1308 + switch (event) { 1309 + case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: 1310 + mptscsih_send_sas_event(ioc, 1311 + (EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)reply->Data); 1312 + return 1; /* currently means nothing really */ 1313 + 1314 + default: 1315 + return mptscsih_event_process(ioc, reply); 1316 + } 1317 + } 1318 + 1319 static int 1320 mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1321 { ··· 1118 MPT_SCSI_HOST *hd; 1119 MPT_ADAPTER *ioc; 1120 unsigned long flags; 1121 + int ii; 1122 int numSGE = 0; 1123 int scale; 1124 int ioc_cap; 1125 int error=0; 1126 int r; 1127 ··· 1203 sh->unique_id = ioc->id; 1204 1205 INIT_LIST_HEAD(&ioc->sas_topology); 1206 + mutex_init(&ioc->sas_topology_mutex); 1207 + 1208 + mutex_init(&ioc->sas_mgmt.mutex); 1209 init_completion(&ioc->sas_mgmt.done); 1210 1211 /* Verify that we won't exceed the maximum ··· 1244 /* SCSI needs scsi_cmnd lookup table! 1245 * (with size equal to req_depth*PtrSz!) 1246 */ 1247 + hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); 1248 + if (!hd->ScsiLookup) { 1249 error = -ENOMEM; 1250 goto out_mptsas_probe; 1251 } 1252 1253 + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n", 1254 + ioc->name, hd->ScsiLookup)); 1255 1256 /* Allocate memory for the device structures. 1257 * A non-Null pointer at an offset 1258 * indicates a device exists. 1259 * max_id = 1 + maximum id (hosts.h) 1260 */ 1261 + hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC); 1262 + if (!hd->Targets) { 1263 error = -ENOMEM; 1264 goto out_mptsas_probe; 1265 } 1266 1267 + dprintk((KERN_INFO " vtarget @ %p\n", hd->Targets)); 1268 1269 /* Clear the TM flags 1270 */ ··· 1324 1325 mptsas_scan_sas_topology(ioc); 1326 1327 + /* 1328 + Reporting RAID volumes. 1329 + */ 1330 + if (!ioc->raid_data.pIocPg2) 1331 + return 0; 1332 + if (!ioc->raid_data.pIocPg2->NumActiveVolumes) 1333 + return 0; 1334 + for (ii=0;ii<ioc->raid_data.pIocPg2->NumActiveVolumes;ii++) { 1335 + scsi_add_device(sh, 1336 + ioc->num_ports, 1337 + ioc->raid_data.pIocPg2->RaidVolume[ii].VolumeID, 1338 + 0); 1339 + } 1340 + 1341 return 0; 1342 1343 out_mptsas_probe: ··· 1339 1340 sas_remove_host(ioc->sh); 1341 1342 + mutex_lock(&ioc->sas_topology_mutex); 1343 list_for_each_entry_safe(p, n, &ioc->sas_topology, list) { 1344 list_del(&p->list); 1345 kfree(p); 1346 } 1347 + mutex_unlock(&ioc->sas_topology_mutex); 1348 1349 mptscsih_remove(pdev); 1350 } ··· 1393 mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER); 1394 mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); 1395 1396 + if (mpt_event_register(mptsasDoneCtx, mptsas_event_process) == 0) { 1397 devtprintk((KERN_INFO MYNAM 1398 ": Registered for IOC event notifications\n")); 1399 }
+26 -8
drivers/message/fusion/mptscsih.c
··· 893 * when a lun is disable by mid-layer. 894 * Do NOT access the referenced scsi_cmnd structure or 895 * members. Will cause either a paging or NULL ptr error. 896 * @hd: Pointer to a SCSI HOST structure 897 * @vdevice: per device private data 898 * ··· 2163 { 2164 VirtTarget *vtarget; 2165 2166 - vtarget = kmalloc(sizeof(VirtTarget), GFP_KERNEL); 2167 if (!vtarget) 2168 return -ENOMEM; 2169 - memset(vtarget, 0, sizeof(VirtTarget)); 2170 starget->hostdata = vtarget; 2171 return 0; 2172 } ··· 2185 VirtDevice *vdev; 2186 struct scsi_target *starget; 2187 2188 - vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); 2189 if (!vdev) { 2190 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 2191 hd->ioc->name, sizeof(VirtDevice)); 2192 return -ENOMEM; 2193 } 2194 2195 - memset(vdev, 0, sizeof(VirtDevice)); 2196 vdev->ioc_id = hd->ioc->id; 2197 vdev->target_id = sdev->id; 2198 vdev->bus_id = sdev->channel; ··· 2558 hd->cmdPtr = NULL; 2559 } 2560 2561 - /* 7. Set flag to force DV and re-read IOC Page 3 2562 */ 2563 if (ioc->bus_type == SPI) { 2564 ioc->spi_data.forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3; 2565 ddvtprintk(("Set reload IOC Pg3 Flag\n")); 2566 } 2567 2568 dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name)); 2569 2570 } ··· 2600 { 2601 MPT_SCSI_HOST *hd; 2602 u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; 2603 2604 devtprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", 2605 ioc->name, event)); ··· 2623 /* FIXME! */ 2624 break; 2625 2626 /* 2627 * CHECKME! Don't think we need to do 2628 * anything for these, but... 2629 */ 2630 - case MPI_EVENT_RESCAN: /* 06 */ 2631 case MPI_EVENT_LINK_STATUS_CHANGE: /* 07 */ 2632 case MPI_EVENT_LOOP_STATE_CHANGE: /* 08 */ 2633 /* ··· 3972 mptscsih_do_cmd(hd, &iocmd); 3973 } 3974 3975 - /* Search IOC page 3 to determine if this is hidden physical disk 3976 - */ 3977 /* Search IOC page 3 to determine if this is hidden physical disk 3978 */ 3979 static int
··· 893 * when a lun is disable by mid-layer. 894 * Do NOT access the referenced scsi_cmnd structure or 895 * members. Will cause either a paging or NULL ptr error. 896 + * (BUT, BUT, BUT, the code does reference it! - mdr) 897 * @hd: Pointer to a SCSI HOST structure 898 * @vdevice: per device private data 899 * ··· 2162 { 2163 VirtTarget *vtarget; 2164 2165 + vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); 2166 if (!vtarget) 2167 return -ENOMEM; 2168 starget->hostdata = vtarget; 2169 return 0; 2170 } ··· 2185 VirtDevice *vdev; 2186 struct scsi_target *starget; 2187 2188 + vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); 2189 if (!vdev) { 2190 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 2191 hd->ioc->name, sizeof(VirtDevice)); 2192 return -ENOMEM; 2193 } 2194 2195 vdev->ioc_id = hd->ioc->id; 2196 vdev->target_id = sdev->id; 2197 vdev->bus_id = sdev->channel; ··· 2559 hd->cmdPtr = NULL; 2560 } 2561 2562 + /* 7. SPI: Set flag to force DV and re-read IOC Page 3 2563 */ 2564 if (ioc->bus_type == SPI) { 2565 ioc->spi_data.forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3; 2566 ddvtprintk(("Set reload IOC Pg3 Flag\n")); 2567 } 2568 2569 + /* 7. FC: Rescan for blocked rports which might have returned. 2570 + */ 2571 + else if (ioc->bus_type == FC) { 2572 + int work_count; 2573 + unsigned long flags; 2574 + 2575 + spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); 2576 + work_count = ++ioc->fc_rescan_work_count; 2577 + spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); 2578 + if (work_count == 1) 2579 + schedule_work(&ioc->fc_rescan_work); 2580 + } 2581 dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name)); 2582 2583 } ··· 2589 { 2590 MPT_SCSI_HOST *hd; 2591 u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; 2592 + int work_count; 2593 + unsigned long flags; 2594 2595 devtprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", 2596 ioc->name, event)); ··· 2610 /* FIXME! */ 2611 break; 2612 2613 + case MPI_EVENT_RESCAN: /* 06 */ 2614 + spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); 2615 + work_count = ++ioc->fc_rescan_work_count; 2616 + spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); 2617 + if (work_count == 1) 2618 + schedule_work(&ioc->fc_rescan_work); 2619 + break; 2620 + 2621 /* 2622 * CHECKME! Don't think we need to do 2623 * anything for these, but... 2624 */ 2625 case MPI_EVENT_LINK_STATUS_CHANGE: /* 07 */ 2626 case MPI_EVENT_LOOP_STATE_CHANGE: /* 08 */ 2627 /* ··· 3952 mptscsih_do_cmd(hd, &iocmd); 3953 } 3954 3955 /* Search IOC page 3 to determine if this is hidden physical disk 3956 */ 3957 static int
+8 -18
drivers/message/fusion/mptspi.c
··· 158 MPT_SCSI_HOST *hd; 159 MPT_ADAPTER *ioc; 160 unsigned long flags; 161 - int sz, ii; 162 int numSGE = 0; 163 int scale; 164 int ioc_cap; 165 - u8 *mem; 166 int error=0; 167 int r; 168 ··· 287 /* SCSI needs scsi_cmnd lookup table! 288 * (with size equal to req_depth*PtrSz!) 289 */ 290 - sz = ioc->req_depth * sizeof(void *); 291 - mem = kmalloc(sz, GFP_ATOMIC); 292 - if (mem == NULL) { 293 error = -ENOMEM; 294 goto out_mptspi_probe; 295 } 296 297 - memset(mem, 0, sz); 298 - hd->ScsiLookup = (struct scsi_cmnd **) mem; 299 - 300 - dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n", 301 - ioc->name, hd->ScsiLookup, sz)); 302 303 /* Allocate memory for the device structures. 304 * A non-Null pointer at an offset 305 * indicates a device exists. 306 * max_id = 1 + maximum id (hosts.h) 307 */ 308 - sz = sh->max_id * sizeof(void *); 309 - mem = kmalloc(sz, GFP_ATOMIC); 310 - if (mem == NULL) { 311 error = -ENOMEM; 312 goto out_mptspi_probe; 313 } 314 315 - memset(mem, 0, sz); 316 - hd->Targets = (VirtTarget **) mem; 317 - 318 - dprintk((KERN_INFO 319 - " vdev @ %p, sz=%d\n", hd->Targets, sz)); 320 321 /* Clear the TM flags 322 */
··· 158 MPT_SCSI_HOST *hd; 159 MPT_ADAPTER *ioc; 160 unsigned long flags; 161 + int ii; 162 int numSGE = 0; 163 int scale; 164 int ioc_cap; 165 int error=0; 166 int r; 167 ··· 288 /* SCSI needs scsi_cmnd lookup table! 289 * (with size equal to req_depth*PtrSz!) 290 */ 291 + hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); 292 + if (!hd->ScsiLookup) { 293 error = -ENOMEM; 294 goto out_mptspi_probe; 295 } 296 297 + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n", 298 + ioc->name, hd->ScsiLookup)); 299 300 /* Allocate memory for the device structures. 301 * A non-Null pointer at an offset 302 * indicates a device exists. 303 * max_id = 1 + maximum id (hosts.h) 304 */ 305 + hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC); 306 + if (!hd->Targets) { 307 error = -ENOMEM; 308 goto out_mptspi_probe; 309 } 310 311 + dprintk((KERN_INFO " vdev @ %p\n", hd->Targets)); 312 313 /* Clear the TM flags 314 */
+5 -5
drivers/message/i2o/pci.c
··· 88 struct device *dev = &pdev->dev; 89 int i; 90 91 - if (pci_request_regions(pdev, OSM_DESCRIPTION)) { 92 - printk(KERN_ERR "%s: device already claimed\n", c->name); 93 - return -ENODEV; 94 - } 95 - 96 for (i = 0; i < 6; i++) { 97 /* Skip I/O spaces */ 98 if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { ··· 312 printk(KERN_WARNING "i2o: couldn't enable device %s\n", 313 pci_name(pdev)); 314 return rc; 315 } 316 317 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
··· 88 struct device *dev = &pdev->dev; 89 int i; 90 91 for (i = 0; i < 6; i++) { 92 /* Skip I/O spaces */ 93 if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { ··· 317 printk(KERN_WARNING "i2o: couldn't enable device %s\n", 318 pci_name(pdev)); 319 return rc; 320 + } 321 + 322 + if (pci_request_regions(pdev, OSM_DESCRIPTION)) { 323 + printk(KERN_ERR "i2o: device already claimed\n"); 324 + return -ENODEV; 325 } 326 327 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+2
drivers/s390/scsi/zfcp_aux.c
··· 1125 zfcp_free_low_mem_buffers(adapter); 1126 /* free memory of adapter data structure and queues */ 1127 zfcp_qdio_free_queues(adapter); 1128 ZFCP_LOG_TRACE("freeing adapter structure\n"); 1129 kfree(adapter); 1130 out:
··· 1125 zfcp_free_low_mem_buffers(adapter); 1126 /* free memory of adapter data structure and queues */ 1127 zfcp_qdio_free_queues(adapter); 1128 + kfree(adapter->fc_stats); 1129 + kfree(adapter->stats_reset_data); 1130 ZFCP_LOG_TRACE("freeing adapter structure\n"); 1131 kfree(adapter); 1132 out:
+3 -1
drivers/s390/scsi/zfcp_def.h
··· 921 u32 physical_s_id; /* local FC port ID */ 922 struct ccw_device *ccw_device; /* S/390 ccw device */ 923 u8 fc_service_class; 924 - u32 fc_topology; /* FC topology */ 925 u32 hydra_version; /* Hydra version */ 926 u32 fsf_lic_version; 927 u32 adapter_features; /* FCP channel features */ ··· 977 struct zfcp_adapter_mempool pool; /* Adapter memory pools */ 978 struct qdio_initialize qdio_init_data; /* for qdio_establish */ 979 struct device generic_services; /* directory for WKA ports */ 980 }; 981 982 /*
··· 921 u32 physical_s_id; /* local FC port ID */ 922 struct ccw_device *ccw_device; /* S/390 ccw device */ 923 u8 fc_service_class; 924 u32 hydra_version; /* Hydra version */ 925 u32 fsf_lic_version; 926 u32 adapter_features; /* FCP channel features */ ··· 978 struct zfcp_adapter_mempool pool; /* Adapter memory pools */ 979 struct qdio_initialize qdio_init_data; /* for qdio_establish */ 980 struct device generic_services; /* directory for WKA ports */ 981 + struct fc_host_statistics *fc_stats; 982 + struct fsf_qtcb_bottom_port *stats_reset_data; 983 + unsigned long stats_reset; 984 }; 985 986 /*
+1 -1
drivers/s390/scsi/zfcp_erp.c
··· 2613 case ZFCP_ERP_STEP_UNINITIALIZED: 2614 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: 2615 case ZFCP_ERP_STEP_PORT_CLOSING: 2616 - if (adapter->fc_topology == FSF_TOPO_P2P) { 2617 if (port->wwpn != adapter->peer_wwpn) { 2618 ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " 2619 "on adapter %s.\nPeer WWPN "
··· 2613 case ZFCP_ERP_STEP_UNINITIALIZED: 2614 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: 2615 case ZFCP_ERP_STEP_PORT_CLOSING: 2616 + if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) { 2617 if (port->wwpn != adapter->peer_wwpn) { 2618 ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " 2619 "on adapter %s.\nPeer WWPN "
+60 -24
drivers/s390/scsi/zfcp_fsf.c
··· 964 | ZFCP_STATUS_COMMON_ERP_FAILED); 965 break; 966 967 case FSF_STATUS_READ_CFDC_UPDATED: 968 ZFCP_LOG_NORMAL("CFDC has been updated on the adapter %s\n", 969 zfcp_get_busid_by_adapter(adapter)); ··· 1988 erp_action->fsf_req->qtcb->bottom.config.feature_selection = 1989 FSF_FEATURE_CFDC | 1990 FSF_FEATURE_LUN_SHARING | 1991 FSF_FEATURE_UPDATE_ALERT; 1992 1993 /* start QDIO request for this FSF request */ ··· 2043 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; 2044 fc_host_speed(shost) = bottom->fc_link_speed; 2045 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; 2046 - adapter->fc_topology = bottom->fc_topology; 2047 adapter->hydra_version = bottom->adapter_type; 2048 - if (adapter->physical_wwpn == 0) 2049 - adapter->physical_wwpn = fc_host_port_name(shost); 2050 - if (adapter->physical_s_id == 0) 2051 - adapter->physical_s_id = fc_host_port_id(shost); 2052 } else { 2053 fc_host_node_name(shost) = 0; 2054 fc_host_port_name(shost) = 0; 2055 fc_host_port_id(shost) = 0; 2056 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; 2057 - adapter->fc_topology = 0; 2058 adapter->hydra_version = 0; 2059 - } 2060 - 2061 - if (adapter->fc_topology == FSF_TOPO_P2P) { 2062 - adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; 2063 - adapter->peer_wwpn = bottom->plogi_payload.wwpn; 2064 - adapter->peer_wwnn = bottom->plogi_payload.wwnn; 2065 } 2066 2067 if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { ··· 2135 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) 2136 return -EIO; 2137 2138 - switch (adapter->fc_topology) { 2139 - case FSF_TOPO_P2P: 2140 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " 2141 "configuration detected at adapter %s\n" 2142 "Peer WWNN 0x%016llx, " ··· 2149 debug_text_event(fsf_req->adapter->erp_dbf, 0, 2150 "top-p-to-p"); 2151 break; 2152 - case FSF_TOPO_AL: 2153 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " 2154 "topology detected at adapter %s " 2155 "unsupported, shutting down adapter\n", ··· 2158 "top-al"); 2159 zfcp_erp_adapter_shutdown(adapter, 0); 2160 return -EIO; 2161 - case FSF_TOPO_FABRIC: 2162 ZFCP_LOG_NORMAL("Switched fabric fibrechannel " 2163 "network detected at adapter %s.\n", 2164 zfcp_get_busid_by_adapter(adapter)); ··· 2171 "of a type known to the zfcp " 2172 "driver, shutting down adapter\n", 2173 zfcp_get_busid_by_adapter(adapter)); 2174 - adapter->fc_topology = FSF_TOPO_ERROR; 2175 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 2176 "unknown-topo"); 2177 zfcp_erp_adapter_shutdown(adapter, 0); ··· 2330 data = (struct fsf_qtcb_bottom_port*) fsf_req->data; 2331 if (data) 2332 memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); 2333 - if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) { 2334 - adapter->physical_wwpn = bottom->wwpn; 2335 - adapter->physical_s_id = bottom->fc_port_id; 2336 - } else { 2337 - adapter->physical_wwpn = fc_host_port_name(shost); 2338 - adapter->physical_s_id = fc_host_port_id(shost); 2339 - } 2340 fc_host_maxframe_size(shost) = bottom->maximum_frame_size; 2341 break; 2342 2343 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
··· 964 | ZFCP_STATUS_COMMON_ERP_FAILED); 965 break; 966 967 + case FSF_STATUS_READ_NOTIFICATION_LOST: 968 + ZFCP_LOG_NORMAL("Unsolicited status notification(s) lost: " 969 + "adapter %s%s%s%s%s%s%s%s%s\n", 970 + zfcp_get_busid_by_adapter(adapter), 971 + (status_buffer->status_subtype & 972 + FSF_STATUS_READ_SUB_INCOMING_ELS) ? 973 + ", incoming ELS" : "", 974 + (status_buffer->status_subtype & 975 + FSF_STATUS_READ_SUB_SENSE_DATA) ? 976 + ", sense data" : "", 977 + (status_buffer->status_subtype & 978 + FSF_STATUS_READ_SUB_LINK_STATUS) ? 979 + ", link status change" : "", 980 + (status_buffer->status_subtype & 981 + FSF_STATUS_READ_SUB_PORT_CLOSED) ? 982 + ", port close" : "", 983 + (status_buffer->status_subtype & 984 + FSF_STATUS_READ_SUB_BIT_ERROR_THRESHOLD) ? 985 + ", bit error exception" : "", 986 + (status_buffer->status_subtype & 987 + FSF_STATUS_READ_SUB_ACT_UPDATED) ? 988 + ", ACT update" : "", 989 + (status_buffer->status_subtype & 990 + FSF_STATUS_READ_SUB_ACT_HARDENED) ? 991 + ", ACT hardening" : "", 992 + (status_buffer->status_subtype & 993 + FSF_STATUS_READ_SUB_FEATURE_UPDATE_ALERT) ? 994 + ", adapter feature change" : ""); 995 + 996 + if (status_buffer->status_subtype & 997 + FSF_STATUS_READ_SUB_ACT_UPDATED) 998 + zfcp_erp_adapter_access_changed(adapter); 999 + break; 1000 + 1001 case FSF_STATUS_READ_CFDC_UPDATED: 1002 ZFCP_LOG_NORMAL("CFDC has been updated on the adapter %s\n", 1003 zfcp_get_busid_by_adapter(adapter)); ··· 1954 erp_action->fsf_req->qtcb->bottom.config.feature_selection = 1955 FSF_FEATURE_CFDC | 1956 FSF_FEATURE_LUN_SHARING | 1957 + FSF_FEATURE_NOTIFICATION_LOST | 1958 FSF_FEATURE_UPDATE_ALERT; 1959 1960 /* start QDIO request for this FSF request */ ··· 2008 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; 2009 fc_host_speed(shost) = bottom->fc_link_speed; 2010 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; 2011 adapter->hydra_version = bottom->adapter_type; 2012 + if (fc_host_permanent_port_name(shost) == -1) 2013 + fc_host_permanent_port_name(shost) = 2014 + fc_host_port_name(shost); 2015 + if (bottom->fc_topology == FSF_TOPO_P2P) { 2016 + adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; 2017 + adapter->peer_wwpn = bottom->plogi_payload.wwpn; 2018 + adapter->peer_wwnn = bottom->plogi_payload.wwnn; 2019 + fc_host_port_type(shost) = FC_PORTTYPE_PTP; 2020 + } else if (bottom->fc_topology == FSF_TOPO_FABRIC) 2021 + fc_host_port_type(shost) = FC_PORTTYPE_NPORT; 2022 + else if (bottom->fc_topology == FSF_TOPO_AL) 2023 + fc_host_port_type(shost) = FC_PORTTYPE_NLPORT; 2024 + else 2025 + fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; 2026 } else { 2027 fc_host_node_name(shost) = 0; 2028 fc_host_port_name(shost) = 0; 2029 fc_host_port_id(shost) = 0; 2030 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; 2031 + fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; 2032 adapter->hydra_version = 0; 2033 } 2034 2035 if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { ··· 2097 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) 2098 return -EIO; 2099 2100 + switch (fc_host_port_type(adapter->scsi_host)) { 2101 + case FC_PORTTYPE_PTP: 2102 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " 2103 "configuration detected at adapter %s\n" 2104 "Peer WWNN 0x%016llx, " ··· 2111 debug_text_event(fsf_req->adapter->erp_dbf, 0, 2112 "top-p-to-p"); 2113 break; 2114 + case FC_PORTTYPE_NLPORT: 2115 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " 2116 "topology detected at adapter %s " 2117 "unsupported, shutting down adapter\n", ··· 2120 "top-al"); 2121 zfcp_erp_adapter_shutdown(adapter, 0); 2122 return -EIO; 2123 + case FC_PORTTYPE_NPORT: 2124 ZFCP_LOG_NORMAL("Switched fabric fibrechannel " 2125 "network detected at adapter %s.\n", 2126 zfcp_get_busid_by_adapter(adapter)); ··· 2133 "of a type known to the zfcp " 2134 "driver, shutting down adapter\n", 2135 zfcp_get_busid_by_adapter(adapter)); 2136 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 2137 "unknown-topo"); 2138 zfcp_erp_adapter_shutdown(adapter, 0); ··· 2293 data = (struct fsf_qtcb_bottom_port*) fsf_req->data; 2294 if (data) 2295 memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); 2296 + if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) 2297 + fc_host_permanent_port_name(shost) = bottom->wwpn; 2298 + else 2299 + fc_host_permanent_port_name(shost) = 2300 + fc_host_port_name(shost); 2301 fc_host_maxframe_size(shost) = bottom->maximum_frame_size; 2302 + fc_host_supported_speeds(shost) = bottom->supported_speed; 2303 break; 2304 2305 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
+12 -1
drivers/s390/scsi/zfcp_fsf.h
··· 166 #define FSF_STATUS_READ_BIT_ERROR_THRESHOLD 0x00000004 167 #define FSF_STATUS_READ_LINK_DOWN 0x00000005 168 #define FSF_STATUS_READ_LINK_UP 0x00000006 169 #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A 170 #define FSF_STATUS_READ_CFDC_HARDENED 0x0000000B 171 #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C ··· 180 #define FSF_STATUS_READ_SUB_FDISC_FAILED 0x00000001 181 #define FSF_STATUS_READ_SUB_FIRMWARE_UPDATE 0x00000002 182 183 /* status subtypes for CFDC */ 184 #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE 0x00000002 185 #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE2 0x0000000F ··· 199 #define FSF_TOPO_P2P 0x00000001 200 #define FSF_TOPO_FABRIC 0x00000002 201 #define FSF_TOPO_AL 0x00000003 202 - #define FSF_TOPO_FABRIC_VIRT 0x00000004 203 204 /* data direction for FCP commands */ 205 #define FSF_DATADIR_WRITE 0x00000001 ··· 221 /* channel features */ 222 #define FSF_FEATURE_CFDC 0x00000002 223 #define FSF_FEATURE_LUN_SHARING 0x00000004 224 #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 225 #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 226 #define FSF_FEATURE_UPDATE_ALERT 0x00000100
··· 166 #define FSF_STATUS_READ_BIT_ERROR_THRESHOLD 0x00000004 167 #define FSF_STATUS_READ_LINK_DOWN 0x00000005 168 #define FSF_STATUS_READ_LINK_UP 0x00000006 169 + #define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 170 #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A 171 #define FSF_STATUS_READ_CFDC_HARDENED 0x0000000B 172 #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C ··· 179 #define FSF_STATUS_READ_SUB_FDISC_FAILED 0x00000001 180 #define FSF_STATUS_READ_SUB_FIRMWARE_UPDATE 0x00000002 181 182 + /* status subtypes for unsolicited status notification lost */ 183 + #define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 184 + #define FSF_STATUS_READ_SUB_SENSE_DATA 0x00000002 185 + #define FSF_STATUS_READ_SUB_LINK_STATUS 0x00000004 186 + #define FSF_STATUS_READ_SUB_PORT_CLOSED 0x00000008 187 + #define FSF_STATUS_READ_SUB_BIT_ERROR_THRESHOLD 0x00000010 188 + #define FSF_STATUS_READ_SUB_ACT_UPDATED 0x00000020 189 + #define FSF_STATUS_READ_SUB_ACT_HARDENED 0x00000040 190 + #define FSF_STATUS_READ_SUB_FEATURE_UPDATE_ALERT 0x00000080 191 + 192 /* status subtypes for CFDC */ 193 #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE 0x00000002 194 #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE2 0x0000000F ··· 188 #define FSF_TOPO_P2P 0x00000001 189 #define FSF_TOPO_FABRIC 0x00000002 190 #define FSF_TOPO_AL 0x00000003 191 192 /* data direction for FCP commands */ 193 #define FSF_DATADIR_WRITE 0x00000001 ··· 211 /* channel features */ 212 #define FSF_FEATURE_CFDC 0x00000002 213 #define FSF_FEATURE_LUN_SHARING 0x00000004 214 + #define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 215 #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 216 #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 217 #define FSF_FEATURE_UPDATE_ALERT 0x00000100
+135 -55
drivers/s390/scsi/zfcp_scsi.c
··· 49 50 static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *, int, scsi_id_t, 51 scsi_lun_t); 52 - static struct zfcp_port *zfcp_port_lookup(struct zfcp_adapter *, int, 53 - scsi_id_t); 54 55 static struct device_attribute *zfcp_sysfs_sdev_attrs[]; 56 ··· 404 return retval; 405 } 406 407 - static struct zfcp_port * 408 - zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id) 409 - { 410 - struct zfcp_port *port; 411 - 412 - list_for_each_entry(port, &adapter->port_list_head, list) { 413 - if (port->rport && (id == port->rport->scsi_target_id)) 414 - return port; 415 - } 416 - return (struct zfcp_port *) NULL; 417 - } 418 - 419 /** 420 * zfcp_scsi_eh_abort_handler - abort the specified SCSI command 421 * @scpnt: pointer to scsi_cmnd to be aborted ··· 717 /* 718 * Support functions for FC transport class 719 */ 720 - static void 721 - zfcp_get_port_id(struct scsi_target *starget) 722 { 723 - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 724 - struct zfcp_adapter *adapter = (struct zfcp_adapter *)shost->hostdata[0]; 725 - struct zfcp_port *port; 726 - unsigned long flags; 727 728 - read_lock_irqsave(&zfcp_data.config_lock, flags); 729 - port = zfcp_port_lookup(adapter, starget->channel, starget->id); 730 - if (port) 731 - fc_starget_port_id(starget) = port->d_id; 732 - else 733 - fc_starget_port_id(starget) = -1; 734 - read_unlock_irqrestore(&zfcp_data.config_lock, flags); 735 } 736 737 static void 738 - zfcp_get_port_name(struct scsi_target *starget) 739 { 740 - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 741 - struct zfcp_adapter *adapter = (struct zfcp_adapter *)shost->hostdata[0]; 742 - struct zfcp_port *port; 743 - unsigned long flags; 744 - 745 - read_lock_irqsave(&zfcp_data.config_lock, flags); 746 - port = zfcp_port_lookup(adapter, starget->channel, starget->id); 747 - if (port) 748 - fc_starget_port_name(starget) = port->wwpn; 749 - else 750 - fc_starget_port_name(starget) = -1; 751 - read_unlock_irqrestore(&zfcp_data.config_lock, flags); 752 } 753 754 static void 755 - zfcp_get_node_name(struct scsi_target *starget) 756 { 757 - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 758 - struct zfcp_adapter *adapter = (struct zfcp_adapter *)shost->hostdata[0]; 759 - struct zfcp_port *port; 760 - unsigned long flags; 761 762 - read_lock_irqsave(&zfcp_data.config_lock, flags); 763 - port = zfcp_port_lookup(adapter, starget->channel, starget->id); 764 - if (port) 765 - fc_starget_node_name(starget) = port->wwnn; 766 - else 767 - fc_starget_node_name(starget) = -1; 768 - read_unlock_irqrestore(&zfcp_data.config_lock, flags); 769 } 770 771 struct fc_function_template zfcp_transport_functions = { 772 - .get_starget_port_id = zfcp_get_port_id, 773 - .get_starget_port_name = zfcp_get_port_name, 774 - .get_starget_node_name = zfcp_get_node_name, 775 .show_starget_port_id = 1, 776 .show_starget_port_name = 1, 777 .show_starget_node_name = 1, 778 .show_rport_supported_classes = 1, 779 .show_host_node_name = 1, 780 .show_host_port_name = 1, 781 .show_host_supported_classes = 1, 782 .show_host_maxframe_size = 1, 783 .show_host_serial_number = 1, 784 .show_host_speed = 1, 785 .show_host_port_id = 1, 786 };
··· 49 50 static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *, int, scsi_id_t, 51 scsi_lun_t); 52 53 static struct device_attribute *zfcp_sysfs_sdev_attrs[]; 54 ··· 406 return retval; 407 } 408 409 /** 410 * zfcp_scsi_eh_abort_handler - abort the specified SCSI command 411 * @scpnt: pointer to scsi_cmnd to be aborted ··· 731 /* 732 * Support functions for FC transport class 733 */ 734 + static struct fc_host_statistics* 735 + zfcp_init_fc_host_stats(struct zfcp_adapter *adapter) 736 { 737 + struct fc_host_statistics *fc_stats; 738 739 + if (!adapter->fc_stats) { 740 + fc_stats = kmalloc(sizeof(*fc_stats), GFP_KERNEL); 741 + if (!fc_stats) 742 + return NULL; 743 + adapter->fc_stats = fc_stats; /* freed in adater_dequeue */ 744 + } 745 + memset(adapter->fc_stats, 0, sizeof(*adapter->fc_stats)); 746 + return adapter->fc_stats; 747 } 748 749 static void 750 + zfcp_adjust_fc_host_stats(struct fc_host_statistics *fc_stats, 751 + struct fsf_qtcb_bottom_port *data, 752 + struct fsf_qtcb_bottom_port *old) 753 { 754 + fc_stats->seconds_since_last_reset = data->seconds_since_last_reset - 755 + old->seconds_since_last_reset; 756 + fc_stats->tx_frames = data->tx_frames - old->tx_frames; 757 + fc_stats->tx_words = data->tx_words - old->tx_words; 758 + fc_stats->rx_frames = data->rx_frames - old->rx_frames; 759 + fc_stats->rx_words = data->rx_words - old->rx_words; 760 + fc_stats->lip_count = data->lip - old->lip; 761 + fc_stats->nos_count = data->nos - old->nos; 762 + fc_stats->error_frames = data->error_frames - old->error_frames; 763 + fc_stats->dumped_frames = data->dumped_frames - old->dumped_frames; 764 + fc_stats->link_failure_count = data->link_failure - old->link_failure; 765 + fc_stats->loss_of_sync_count = data->loss_of_sync - old->loss_of_sync; 766 + fc_stats->loss_of_signal_count = data->loss_of_signal - 767 + old->loss_of_signal; 768 + fc_stats->prim_seq_protocol_err_count = data->psp_error_counts - 769 + old->psp_error_counts; 770 + fc_stats->invalid_tx_word_count = data->invalid_tx_words - 771 + old->invalid_tx_words; 772 + fc_stats->invalid_crc_count = data->invalid_crcs - old->invalid_crcs; 773 + fc_stats->fcp_input_requests = data->input_requests - 774 + old->input_requests; 775 + fc_stats->fcp_output_requests = data->output_requests - 776 + old->output_requests; 777 + fc_stats->fcp_control_requests = data->control_requests - 778 + old->control_requests; 779 + fc_stats->fcp_input_megabytes = data->input_mb - old->input_mb; 780 + fc_stats->fcp_output_megabytes = data->output_mb - old->output_mb; 781 } 782 783 static void 784 + zfcp_set_fc_host_stats(struct fc_host_statistics *fc_stats, 785 + struct fsf_qtcb_bottom_port *data) 786 { 787 + fc_stats->seconds_since_last_reset = data->seconds_since_last_reset; 788 + fc_stats->tx_frames = data->tx_frames; 789 + fc_stats->tx_words = data->tx_words; 790 + fc_stats->rx_frames = data->rx_frames; 791 + fc_stats->rx_words = data->rx_words; 792 + fc_stats->lip_count = data->lip; 793 + fc_stats->nos_count = data->nos; 794 + fc_stats->error_frames = data->error_frames; 795 + fc_stats->dumped_frames = data->dumped_frames; 796 + fc_stats->link_failure_count = data->link_failure; 797 + fc_stats->loss_of_sync_count = data->loss_of_sync; 798 + fc_stats->loss_of_signal_count = data->loss_of_signal; 799 + fc_stats->prim_seq_protocol_err_count = data->psp_error_counts; 800 + fc_stats->invalid_tx_word_count = data->invalid_tx_words; 801 + fc_stats->invalid_crc_count = data->invalid_crcs; 802 + fc_stats->fcp_input_requests = data->input_requests; 803 + fc_stats->fcp_output_requests = data->output_requests; 804 + fc_stats->fcp_control_requests = data->control_requests; 805 + fc_stats->fcp_input_megabytes = data->input_mb; 806 + fc_stats->fcp_output_megabytes = data->output_mb; 807 + } 808 809 + /** 810 + * zfcp_get_fc_host_stats - provide fc_host_statistics for scsi_transport_fc 811 + * 812 + * assumption: scsi_transport_fc synchronizes calls of 813 + * get_fc_host_stats and reset_fc_host_stats 814 + * (XXX to be checked otherwise introduce locking) 815 + */ 816 + static struct fc_host_statistics * 817 + zfcp_get_fc_host_stats(struct Scsi_Host *shost) 818 + { 819 + struct zfcp_adapter *adapter; 820 + struct fc_host_statistics *fc_stats; 821 + struct fsf_qtcb_bottom_port *data; 822 + int ret; 823 + 824 + adapter = (struct zfcp_adapter *)shost->hostdata[0]; 825 + fc_stats = zfcp_init_fc_host_stats(adapter); 826 + if (!fc_stats) 827 + return NULL; 828 + 829 + data = kmalloc(sizeof(*data), GFP_KERNEL); 830 + if (!data) 831 + return NULL; 832 + memset(data, 0, sizeof(*data)); 833 + 834 + ret = zfcp_fsf_exchange_port_data(NULL, adapter, data); 835 + if (ret) { 836 + kfree(data); 837 + return NULL; /* XXX return zeroed fc_stats? */ 838 + } 839 + 840 + if (adapter->stats_reset && 841 + ((jiffies/HZ - adapter->stats_reset) < 842 + data->seconds_since_last_reset)) { 843 + zfcp_adjust_fc_host_stats(fc_stats, data, 844 + adapter->stats_reset_data); 845 + } else 846 + zfcp_set_fc_host_stats(fc_stats, data); 847 + 848 + kfree(data); 849 + return fc_stats; 850 + } 851 + 852 + static void 853 + zfcp_reset_fc_host_stats(struct Scsi_Host *shost) 854 + { 855 + struct zfcp_adapter *adapter; 856 + struct fsf_qtcb_bottom_port *data, *old_data; 857 + int ret; 858 + 859 + adapter = (struct zfcp_adapter *)shost->hostdata[0]; 860 + data = kmalloc(sizeof(*data), GFP_KERNEL); 861 + if (!data) 862 + return; 863 + memset(data, 0, sizeof(*data)); 864 + 865 + ret = zfcp_fsf_exchange_port_data(NULL, adapter, data); 866 + if (ret == 0) { 867 + adapter->stats_reset = jiffies/HZ; 868 + old_data = adapter->stats_reset_data; 869 + adapter->stats_reset_data = data; /* finally freed in 870 + adater_dequeue */ 871 + kfree(old_data); 872 + } 873 } 874 875 struct fc_function_template zfcp_transport_functions = { 876 .show_starget_port_id = 1, 877 .show_starget_port_name = 1, 878 .show_starget_node_name = 1, 879 .show_rport_supported_classes = 1, 880 .show_host_node_name = 1, 881 .show_host_port_name = 1, 882 + .show_host_permanent_port_name = 1, 883 .show_host_supported_classes = 1, 884 + .show_host_supported_speeds = 1, 885 .show_host_maxframe_size = 1, 886 .show_host_serial_number = 1, 887 + .get_fc_host_stats = zfcp_get_fc_host_stats, 888 + .reset_fc_host_stats = zfcp_reset_fc_host_stats, 889 + /* no functions registered for following dynamic attributes but 890 + directly set by LLDD */ 891 + .show_host_port_type = 1, 892 .show_host_speed = 1, 893 .show_host_port_id = 1, 894 };
-15
drivers/s390/scsi/zfcp_sysfs_adapter.c
··· 33 34 #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG 35 36 - static const char fc_topologies[5][25] = { 37 - "<error>", 38 - "point-to-point", 39 - "fabric", 40 - "arbitrated loop", 41 - "fabric (virt. adapter)" 42 - }; 43 - 44 /** 45 * ZFCP_DEFINE_ADAPTER_ATTR 46 * @_name: name of show attribute ··· 61 ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); 62 ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); 63 ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); 64 - ZFCP_DEFINE_ADAPTER_ATTR(fc_service_class, "%d\n", adapter->fc_service_class); 65 - ZFCP_DEFINE_ADAPTER_ATTR(fc_topology, "%s\n", 66 - fc_topologies[adapter->fc_topology]); 67 ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", 68 adapter->hardware_version); 69 - ZFCP_DEFINE_ADAPTER_ATTR(scsi_host_no, "0x%x\n", adapter->scsi_host_no); 70 ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask 71 (ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status)); 72 ··· 247 &dev_attr_physical_s_id.attr, 248 &dev_attr_card_version.attr, 249 &dev_attr_lic_version.attr, 250 - &dev_attr_fc_service_class.attr, 251 - &dev_attr_fc_topology.attr, 252 - &dev_attr_scsi_host_no.attr, 253 &dev_attr_status.attr, 254 &dev_attr_hardware_version.attr, 255 NULL
··· 33 34 #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG 35 36 /** 37 * ZFCP_DEFINE_ADAPTER_ATTR 38 * @_name: name of show attribute ··· 69 ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); 70 ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); 71 ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); 72 ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", 73 adapter->hardware_version); 74 ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask 75 (ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status)); 76 ··· 259 &dev_attr_physical_s_id.attr, 260 &dev_attr_card_version.attr, 261 &dev_attr_lic_version.attr, 262 &dev_attr_status.attr, 263 &dev_attr_hardware_version.attr, 264 NULL
-4
drivers/s390/scsi/zfcp_sysfs_port.c
··· 65 static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_port_##_name##_show, NULL); 66 67 ZFCP_DEFINE_PORT_ATTR(status, "0x%08x\n", atomic_read(&port->status)); 68 - ZFCP_DEFINE_PORT_ATTR(wwnn, "0x%016llx\n", port->wwnn); 69 - ZFCP_DEFINE_PORT_ATTR(d_id, "0x%06x\n", port->d_id); 70 ZFCP_DEFINE_PORT_ATTR(in_recovery, "%d\n", atomic_test_mask 71 (ZFCP_STATUS_COMMON_ERP_INUSE, &port->status)); 72 ZFCP_DEFINE_PORT_ATTR(access_denied, "%d\n", atomic_test_mask ··· 243 &dev_attr_failed.attr, 244 &dev_attr_in_recovery.attr, 245 &dev_attr_status.attr, 246 - &dev_attr_wwnn.attr, 247 - &dev_attr_d_id.attr, 248 &dev_attr_access_denied.attr, 249 NULL 250 };
··· 65 static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_port_##_name##_show, NULL); 66 67 ZFCP_DEFINE_PORT_ATTR(status, "0x%08x\n", atomic_read(&port->status)); 68 ZFCP_DEFINE_PORT_ATTR(in_recovery, "%d\n", atomic_test_mask 69 (ZFCP_STATUS_COMMON_ERP_INUSE, &port->status)); 70 ZFCP_DEFINE_PORT_ATTR(access_denied, "%d\n", atomic_test_mask ··· 245 &dev_attr_failed.attr, 246 &dev_attr_in_recovery.attr, 247 &dev_attr_status.attr, 248 &dev_attr_access_denied.attr, 249 NULL 250 };
-2
drivers/s390/scsi/zfcp_sysfs_unit.c
··· 65 static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_unit_##_name##_show, NULL); 66 67 ZFCP_DEFINE_UNIT_ATTR(status, "0x%08x\n", atomic_read(&unit->status)); 68 - ZFCP_DEFINE_UNIT_ATTR(scsi_lun, "0x%x\n", unit->scsi_lun); 69 ZFCP_DEFINE_UNIT_ATTR(in_recovery, "%d\n", atomic_test_mask 70 (ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status)); 71 ZFCP_DEFINE_UNIT_ATTR(access_denied, "%d\n", atomic_test_mask ··· 137 zfcp_sysfs_unit_failed_store); 138 139 static struct attribute *zfcp_unit_attrs[] = { 140 - &dev_attr_scsi_lun.attr, 141 &dev_attr_failed.attr, 142 &dev_attr_in_recovery.attr, 143 &dev_attr_status.attr,
··· 65 static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_unit_##_name##_show, NULL); 66 67 ZFCP_DEFINE_UNIT_ATTR(status, "0x%08x\n", atomic_read(&unit->status)); 68 ZFCP_DEFINE_UNIT_ATTR(in_recovery, "%d\n", atomic_test_mask 69 (ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status)); 70 ZFCP_DEFINE_UNIT_ATTR(access_denied, "%d\n", atomic_test_mask ··· 138 zfcp_sysfs_unit_failed_store); 139 140 static struct attribute *zfcp_unit_attrs[] = { 141 &dev_attr_failed.attr, 142 &dev_attr_in_recovery.attr, 143 &dev_attr_status.attr,
+4 -3
drivers/scsi/3w-9xxx.c
··· 73 #include <linux/delay.h> 74 #include <linux/pci.h> 75 #include <linux/time.h> 76 #include <asm/io.h> 77 #include <asm/irq.h> 78 #include <asm/uaccess.h> ··· 616 void __user *argp = (void __user *)arg; 617 618 /* Only let one of these through at a time */ 619 - if (down_interruptible(&tw_dev->ioctl_sem)) { 620 retval = TW_IOCTL_ERROR_OS_EINTR; 621 goto out; 622 } ··· 853 /* Now free ioctl buf memory */ 854 dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_Ioctl_Buf_Apache) - 1, cpu_addr, dma_handle); 855 out2: 856 - up(&tw_dev->ioctl_sem); 857 out: 858 return retval; 859 } /* End twa_chrdev_ioctl() */ ··· 1183 tw_dev->error_sequence_id = 1; 1184 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; 1185 1186 - init_MUTEX(&tw_dev->ioctl_sem); 1187 init_waitqueue_head(&tw_dev->ioctl_wqueue); 1188 1189 retval = 0;
··· 73 #include <linux/delay.h> 74 #include <linux/pci.h> 75 #include <linux/time.h> 76 + #include <linux/mutex.h> 77 #include <asm/io.h> 78 #include <asm/irq.h> 79 #include <asm/uaccess.h> ··· 615 void __user *argp = (void __user *)arg; 616 617 /* Only let one of these through at a time */ 618 + if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { 619 retval = TW_IOCTL_ERROR_OS_EINTR; 620 goto out; 621 } ··· 852 /* Now free ioctl buf memory */ 853 dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_Ioctl_Buf_Apache) - 1, cpu_addr, dma_handle); 854 out2: 855 + mutex_unlock(&tw_dev->ioctl_lock); 856 out: 857 return retval; 858 } /* End twa_chrdev_ioctl() */ ··· 1182 tw_dev->error_sequence_id = 1; 1183 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; 1184 1185 + mutex_init(&tw_dev->ioctl_lock); 1186 init_waitqueue_head(&tw_dev->ioctl_wqueue); 1187 1188 retval = 0;
+1 -1
drivers/scsi/3w-9xxx.h
··· 672 u32 ioctl_msec; 673 int chrdev_request_id; 674 wait_queue_head_t ioctl_wqueue; 675 - struct semaphore ioctl_sem; 676 char aen_clobber; 677 unsigned short working_srl; 678 unsigned short working_branch;
··· 672 u32 ioctl_msec; 673 int chrdev_request_id; 674 wait_queue_head_t ioctl_wqueue; 675 + struct mutex ioctl_lock; 676 char aen_clobber; 677 unsigned short working_srl; 678 unsigned short working_branch;
+4 -3
drivers/scsi/3w-xxxx.c
··· 203 #include <linux/delay.h> 204 #include <linux/pci.h> 205 #include <linux/time.h> 206 #include <asm/io.h> 207 #include <asm/irq.h> 208 #include <asm/uaccess.h> ··· 889 dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl()\n"); 890 891 /* Only let one of these through at a time */ 892 - if (down_interruptible(&tw_dev->ioctl_sem)) 893 return -EINTR; 894 895 /* First copy down the buffer length */ ··· 1030 /* Now free ioctl buf memory */ 1031 dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, cpu_addr, dma_handle); 1032 out: 1033 - up(&tw_dev->ioctl_sem); 1034 return retval; 1035 } /* End tw_chrdev_ioctl() */ 1036 ··· 1271 tw_dev->pending_tail = TW_Q_START; 1272 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; 1273 1274 - init_MUTEX(&tw_dev->ioctl_sem); 1275 init_waitqueue_head(&tw_dev->ioctl_wqueue); 1276 1277 return 0;
··· 203 #include <linux/delay.h> 204 #include <linux/pci.h> 205 #include <linux/time.h> 206 + #include <linux/mutex.h> 207 #include <asm/io.h> 208 #include <asm/irq.h> 209 #include <asm/uaccess.h> ··· 888 dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl()\n"); 889 890 /* Only let one of these through at a time */ 891 + if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) 892 return -EINTR; 893 894 /* First copy down the buffer length */ ··· 1029 /* Now free ioctl buf memory */ 1030 dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, cpu_addr, dma_handle); 1031 out: 1032 + mutex_unlock(&tw_dev->ioctl_lock); 1033 return retval; 1034 } /* End tw_chrdev_ioctl() */ 1035 ··· 1270 tw_dev->pending_tail = TW_Q_START; 1271 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; 1272 1273 + mutex_init(&tw_dev->ioctl_lock); 1274 init_waitqueue_head(&tw_dev->ioctl_wqueue); 1275 1276 return 0;
+1 -1
drivers/scsi/3w-xxxx.h
··· 420 u32 max_sector_count; 421 u32 aen_count; 422 struct Scsi_Host *host; 423 - struct semaphore ioctl_sem; 424 unsigned short aen_queue[TW_Q_LENGTH]; 425 unsigned char aen_head; 426 unsigned char aen_tail;
··· 420 u32 max_sector_count; 421 u32 aen_count; 422 struct Scsi_Host *host; 423 + struct mutex ioctl_lock; 424 unsigned short aen_queue[TW_Q_LENGTH]; 425 unsigned char aen_head; 426 unsigned char aen_tail;
+2 -1
drivers/scsi/BusLogic.c
··· 2216 HostAdapter->PCI_Address = ProbeInfo->PCI_Address; 2217 HostAdapter->Bus = ProbeInfo->Bus; 2218 HostAdapter->Device = ProbeInfo->Device; 2219 HostAdapter->IRQ_Channel = ProbeInfo->IRQ_Channel; 2220 HostAdapter->AddressCount = BusLogic_HostAdapterAddressCount[HostAdapter->HostAdapterType]; 2221 /* ··· 2297 scsi_host_put(Host); 2298 } else { 2299 BusLogic_InitializeHostStructure(HostAdapter, Host); 2300 - scsi_add_host(Host, NULL); 2301 scsi_scan_host(Host); 2302 BusLogicHostAdapterCount++; 2303 }
··· 2216 HostAdapter->PCI_Address = ProbeInfo->PCI_Address; 2217 HostAdapter->Bus = ProbeInfo->Bus; 2218 HostAdapter->Device = ProbeInfo->Device; 2219 + HostAdapter->PCI_Device = ProbeInfo->PCI_Device; 2220 HostAdapter->IRQ_Channel = ProbeInfo->IRQ_Channel; 2221 HostAdapter->AddressCount = BusLogic_HostAdapterAddressCount[HostAdapter->HostAdapterType]; 2222 /* ··· 2296 scsi_host_put(Host); 2297 } else { 2298 BusLogic_InitializeHostStructure(HostAdapter, Host); 2299 + scsi_add_host(Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev : NULL); 2300 scsi_scan_host(Host); 2301 BusLogicHostAdapterCount++; 2302 }
+1 -1
drivers/scsi/Makefile
··· 80 obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o 81 obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o 82 obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o 83 - obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/ 84 obj-$(CONFIG_SCSI_LPFC) += lpfc/ 85 obj-$(CONFIG_SCSI_PAS16) += pas16.o 86 obj-$(CONFIG_SCSI_SEAGATE) += seagate.o
··· 80 obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o 81 obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o 82 obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o 83 + obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx/ 84 obj-$(CONFIG_SCSI_LPFC) += lpfc/ 85 obj-$(CONFIG_SCSI_PAS16) += pas16.o 86 obj-$(CONFIG_SCSI_SEAGATE) += seagate.o
-74
drivers/scsi/aacraid/README
··· 1 - AACRAID Driver for Linux (take two) 2 - 3 - Introduction 4 - ------------------------- 5 - The aacraid driver adds support for Adaptec (http://www.adaptec.com) 6 - RAID controllers. This is a major rewrite from the original 7 - Adaptec supplied driver. It has signficantly cleaned up both the code 8 - and the running binary size (the module is less than half the size of 9 - the original). 10 - 11 - Supported Cards/Chipsets 12 - ------------------------- 13 - Adaptec 2020S 14 - Adaptec 2025S 15 - Adaptec 2120S 16 - Adaptec 2130S 17 - Adaptec 2200S 18 - Adaptec 2230S 19 - Adaptec 2240S 20 - Adaptec 2410SA 21 - Adaptec 2610SA 22 - Adaptec 2810SA 23 - Adaptec 21610SA 24 - Adaptec 3230S 25 - Adaptec 3240S 26 - Adaptec 4000SAS 27 - Adaptec 4005SAS 28 - Adaptec 4800SAS 29 - Adaptec 4805SAS 30 - Adaptec 5400S 31 - Dell PERC 2 Quad Channel 32 - Dell PERC 2/Si 33 - Dell PERC 3/Si 34 - Dell PERC 3/Di 35 - Dell CERC 2 36 - HP NetRAID-4M 37 - Legend S220 38 - Legend S230 39 - IBM ServeRAID 8i 40 - ICP 9014R0 41 - ICP 9024R0 42 - ICP 9047MA 43 - ICP 9087MA 44 - ICP 9085LI 45 - ICP 5085AU 46 - 47 - People 48 - ------------------------- 49 - Alan Cox <alan@redhat.com> 50 - Christoph Hellwig <hch@infradead.org> (updates for new-style PCI probing and SCSI host registration, 51 - small cleanups/fixes) 52 - Matt Domsch <matt_domsch@dell.com> (revision ioctl, adapter messages) 53 - Deanna Bonds (non-DASD support, PAE fibs and 64 bit, added new adaptec controllers 54 - added new ioctls, changed scsi interface to use new error handler, 55 - increased the number of fibs and outstanding commands to a container) 56 - 57 - (fixed 64bit and 64G memory model, changed confusing naming convention 58 - where fibs that go to the hardware are consistently called hw_fibs and 59 - not just fibs like the name of the driver tracking structure) 60 - Mark Salyzyn <Mark_Salyzyn@adaptec.com> Fixed panic issues and added some new product ids for upcoming hbas. Performance tuning, card failover and bug mitigations. 61 - 62 - Original Driver 63 - ------------------------- 64 - Adaptec Unix OEM Product Group 65 - 66 - Mailing List 67 - ------------------------- 68 - linux-scsi@vger.kernel.org (Interested parties troll here) 69 - Also note this is very different to Brian's original driver 70 - so don't expect him to support it. 71 - Adaptec does support this driver. Contact either tech support or Mark Salyzyn. 72 - 73 - Original by Brian Boerner February 2001 74 - Rewritten by Alan Cox, November 2001
···
+7
drivers/scsi/aacraid/aacraid.h
··· 532 #define AAC_QUIRK_MASTER 0x0008 533 534 /* 535 * The adapter interface specs all queues to be located in the same 536 * physically contigous block. The host structure that defines the 537 * commuication queues will assume they are each a separate physically
··· 532 #define AAC_QUIRK_MASTER 0x0008 533 534 /* 535 + * Some adapter firmware perform poorly when it must split up scatter gathers 536 + * in order to deal with the limits of the underlying CHIM. This limit in this 537 + * class of adapters is 17 scatter gather elements. 538 + */ 539 + #define AAC_QUIRK_17SG 0x0010 540 + 541 + /* 542 * The adapter interface specs all queues to be located in the same 543 * physically contigous block. The host structure that defines the 544 * commuication queues will assume they are each a separate physically
+4
drivers/scsi/aacraid/commctrl.c
··· 85 if (size < le16_to_cpu(kfib->header.SenderSize)) 86 size = le16_to_cpu(kfib->header.SenderSize); 87 if (size > dev->max_fib_size) { 88 /* Highjack the hw_fib */ 89 hw_fib = fibptr->hw_fib; 90 hw_fib_pa = fibptr->hw_fib_pa;
··· 85 if (size < le16_to_cpu(kfib->header.SenderSize)) 86 size = le16_to_cpu(kfib->header.SenderSize); 87 if (size > dev->max_fib_size) { 88 + if (size > 2048) { 89 + retval = -EINVAL; 90 + goto cleanup; 91 + } 92 /* Highjack the hw_fib */ 93 hw_fib = fibptr->hw_fib; 94 hw_fib_pa = fibptr->hw_fib_pa;
+29 -6
drivers/scsi/aacraid/linit.c
··· 200 { aac_rkt_init, "aacraid", "ADAPTEC ", "Callisto ", 2, AAC_QUIRK_MASTER }, /* Jupiter Platform */ 201 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2020SA ", 1 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */ 202 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2025SA ", 1 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */ 203 - { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2410SA SATA ", 1 }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */ 204 - { aac_rx_init, "aacraid", "DELL ", "CERC SR2 ", 1 }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */ 205 - { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2810SA SATA ", 1 }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */ 206 - { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-21610SA SATA", 1 }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */ 207 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2026ZCR ", 1 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ 208 { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2610SA ", 1 }, /* SATA 6Ch (Bearcat) */ 209 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2240S ", 1 }, /* ASR-2240S (SabreExpress) */ ··· 574 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; 575 int len; 576 577 - len = snprintf(buf, PAGE_SIZE, "%s\n", 578 aac_drivers[dev->cardtype].model); 579 return len; 580 } ··· 593 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; 594 int len; 595 596 - len = snprintf(buf, PAGE_SIZE, "%s\n", 597 aac_drivers[dev->cardtype].vname); 598 return len; 599 } ··· 849 if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && 850 (aac->scsi_host_ptr->sg_tablesize > 34)) { 851 aac->scsi_host_ptr->sg_tablesize = 34; 852 aac->scsi_host_ptr->max_sectors 853 = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; 854 }
··· 200 { aac_rkt_init, "aacraid", "ADAPTEC ", "Callisto ", 2, AAC_QUIRK_MASTER }, /* Jupiter Platform */ 201 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2020SA ", 1 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */ 202 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2025SA ", 1 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */ 203 + { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2410SA SATA ", 1, AAC_QUIRK_17SG }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */ 204 + { aac_rx_init, "aacraid", "DELL ", "CERC SR2 ", 1, AAC_QUIRK_17SG }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */ 205 + { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2810SA SATA ", 1, AAC_QUIRK_17SG }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */ 206 + { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-21610SA SATA", 1, AAC_QUIRK_17SG }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */ 207 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2026ZCR ", 1 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ 208 { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2610SA ", 1 }, /* SATA 6Ch (Bearcat) */ 209 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2240S ", 1 }, /* ASR-2240S (SabreExpress) */ ··· 574 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; 575 int len; 576 577 + if (dev->supplement_adapter_info.AdapterTypeText[0]) { 578 + char * cp = dev->supplement_adapter_info.AdapterTypeText; 579 + while (*cp && *cp != ' ') 580 + ++cp; 581 + while (*cp == ' ') 582 + ++cp; 583 + len = snprintf(buf, PAGE_SIZE, "%s\n", cp); 584 + } else 585 + len = snprintf(buf, PAGE_SIZE, "%s\n", 586 aac_drivers[dev->cardtype].model); 587 return len; 588 } ··· 585 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; 586 int len; 587 588 + if (dev->supplement_adapter_info.AdapterTypeText[0]) { 589 + char * cp = dev->supplement_adapter_info.AdapterTypeText; 590 + while (*cp && *cp != ' ') 591 + ++cp; 592 + len = snprintf(buf, PAGE_SIZE, "%.*s\n", 593 + (int)(cp - (char *)dev->supplement_adapter_info.AdapterTypeText), 594 + dev->supplement_adapter_info.AdapterTypeText); 595 + } else 596 + len = snprintf(buf, PAGE_SIZE, "%s\n", 597 aac_drivers[dev->cardtype].vname); 598 return len; 599 } ··· 833 if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && 834 (aac->scsi_host_ptr->sg_tablesize > 34)) { 835 aac->scsi_host_ptr->sg_tablesize = 34; 836 + aac->scsi_host_ptr->max_sectors 837 + = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; 838 + } 839 + 840 + if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) && 841 + (aac->scsi_host_ptr->sg_tablesize > 17)) { 842 + aac->scsi_host_ptr->sg_tablesize = 17; 843 aac->scsi_host_ptr->max_sectors 844 = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; 845 }
+2 -2
drivers/scsi/aic7xxx/Kconfig.aic7xxx
··· 42 config AIC7XXX_RESET_DELAY_MS 43 int "Initial bus reset delay in milli-seconds" 44 depends on SCSI_AIC7XXX 45 - default "15000" 46 ---help--- 47 The number of milliseconds to delay after an initial bus reset. 48 The bus settle delay following all error recovery actions is 49 dictated by the SCSI layer and is not affected by this value. 50 51 - Default: 15000 (15 seconds) 52 53 config AIC7XXX_PROBE_EISA_VL 54 bool "Probe for EISA and VL AIC7XXX Adapters"
··· 42 config AIC7XXX_RESET_DELAY_MS 43 int "Initial bus reset delay in milli-seconds" 44 depends on SCSI_AIC7XXX 45 + default "5000" 46 ---help--- 47 The number of milliseconds to delay after an initial bus reset. 48 The bus settle delay following all error recovery actions is 49 dictated by the SCSI layer and is not affected by this value. 50 51 + Default: 5000 (5 seconds) 52 53 config AIC7XXX_PROBE_EISA_VL 54 bool "Probe for EISA and VL AIC7XXX Adapters"
+26 -13
drivers/scsi/aic7xxx/aic79xx.h
··· 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGES. 39 * 40 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#95 $ 41 * 42 * $FreeBSD$ 43 */ ··· 75 #define INITIATOR_WILDCARD (~0) 76 #define SCB_LIST_NULL 0xFF00 77 #define SCB_LIST_NULL_LE (ahd_htole16(SCB_LIST_NULL)) 78 - #define QOUTFIFO_ENTRY_VALID 0x8000 79 - #define QOUTFIFO_ENTRY_VALID_LE (ahd_htole16(0x8000)) 80 #define SCBID_IS_NULL(scbid) (((scbid) & 0xFF00 ) == SCB_LIST_NULL) 81 82 #define SCSIID_TARGET(ahd, scsiid) \ ··· 1052 1053 typedef void ahd_callback_t (void *); 1054 1055 struct ahd_softc { 1056 bus_space_tag_t tags[2]; 1057 bus_space_handle_t bshs[2]; ··· 1068 struct scb_data scb_data; 1069 1070 struct hardware_scb *next_queued_hscb; 1071 1072 /* 1073 * SCBs that have been sent to the controller ··· 1147 ahd_flag flags; 1148 struct seeprom_config *seep_config; 1149 1150 - /* Values to store in the SEQCTL register for pause and unpause */ 1151 - uint8_t unpause; 1152 - uint8_t pause; 1153 - 1154 /* Command Queues */ 1155 uint16_t qoutfifonext; 1156 uint16_t qoutfifonext_valid_tag; 1157 uint16_t qinfifonext; 1158 uint16_t qinfifo[AHD_SCB_MAX]; 1159 - uint16_t *qoutfifo; 1160 1161 /* Critical Section Data */ 1162 struct cs *critical_sections; ··· 1211 */ 1212 bus_dma_tag_t parent_dmat; 1213 bus_dma_tag_t shared_data_dmat; 1214 - bus_dmamap_t shared_data_dmamap; 1215 - dma_addr_t shared_data_busaddr; 1216 1217 /* Information saved through suspend/resume cycles */ 1218 struct ahd_suspend_state suspend_state; ··· 1309 }; 1310 1311 /****************************** PCI Structures ********************************/ 1312 - #define AHD_PCI_IOADDR0 PCIR_MAPS /* I/O BAR*/ 1313 - #define AHD_PCI_MEMADDR (PCIR_MAPS + 4) /* Memory BAR */ 1314 - #define AHD_PCI_IOADDR1 (PCIR_MAPS + 12)/* Second I/O BAR */ 1315 1316 typedef int (ahd_device_setup_t)(struct ahd_softc *); 1317
··· 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGES. 39 * 40 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#108 $ 41 * 42 * $FreeBSD$ 43 */ ··· 75 #define INITIATOR_WILDCARD (~0) 76 #define SCB_LIST_NULL 0xFF00 77 #define SCB_LIST_NULL_LE (ahd_htole16(SCB_LIST_NULL)) 78 + #define QOUTFIFO_ENTRY_VALID 0x80 79 #define SCBID_IS_NULL(scbid) (((scbid) & 0xFF00 ) == SCB_LIST_NULL) 80 81 #define SCSIID_TARGET(ahd, scsiid) \ ··· 1053 1054 typedef void ahd_callback_t (void *); 1055 1056 + struct ahd_completion 1057 + { 1058 + uint16_t tag; 1059 + uint8_t sg_status; 1060 + uint8_t valid_tag; 1061 + }; 1062 + 1063 struct ahd_softc { 1064 bus_space_tag_t tags[2]; 1065 bus_space_handle_t bshs[2]; ··· 1062 struct scb_data scb_data; 1063 1064 struct hardware_scb *next_queued_hscb; 1065 + struct map_node *next_queued_hscb_map; 1066 1067 /* 1068 * SCBs that have been sent to the controller ··· 1140 ahd_flag flags; 1141 struct seeprom_config *seep_config; 1142 1143 /* Command Queues */ 1144 + struct ahd_completion *qoutfifo; 1145 uint16_t qoutfifonext; 1146 uint16_t qoutfifonext_valid_tag; 1147 uint16_t qinfifonext; 1148 uint16_t qinfifo[AHD_SCB_MAX]; 1149 + 1150 + /* 1151 + * Our qfreeze count. The sequencer compares 1152 + * this value with its own counter to determine 1153 + * whether to allow selections to occur. 1154 + */ 1155 + uint16_t qfreeze_cnt; 1156 + 1157 + /* Values to store in the SEQCTL register for pause and unpause */ 1158 + uint8_t unpause; 1159 + uint8_t pause; 1160 1161 /* Critical Section Data */ 1162 struct cs *critical_sections; ··· 1197 */ 1198 bus_dma_tag_t parent_dmat; 1199 bus_dma_tag_t shared_data_dmat; 1200 + struct map_node shared_data_map; 1201 1202 /* Information saved through suspend/resume cycles */ 1203 struct ahd_suspend_state suspend_state; ··· 1296 }; 1297 1298 /****************************** PCI Structures ********************************/ 1299 + #define AHD_PCI_IOADDR0 PCIR_BAR(0) /* I/O BAR*/ 1300 + #define AHD_PCI_MEMADDR PCIR_BAR(1) /* Memory BAR */ 1301 + #define AHD_PCI_IOADDR1 PCIR_BAR(3) /* Second I/O BAR */ 1302 1303 typedef int (ahd_device_setup_t)(struct ahd_softc *); 1304
+39 -21
drivers/scsi/aic7xxx/aic79xx.reg
··· 39 * 40 * $FreeBSD$ 41 */ 42 - VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $" 43 44 /* 45 * This file is processed by the aic7xxx_asm utility for use in assembling ··· 65 mvi MODE_PTR, MK_MODE(src, dst); \ 66 } 67 68 - #define TOGGLE_DFF_MODE \ 69 - if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \ 70 - call toggle_dff_mode_work_around; \ 71 - } else { \ 72 - xor MODE_PTR, MK_MODE(M_DFF1, M_DFF1); \ 73 - } 74 - 75 #define RESTORE_MODE(mode) \ 76 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \ 77 mov mode call set_mode_work_around; \ ··· 1192 1193 /* 1194 * LQ Packet In 1195 - * The last LQ Packet received 1196 */ 1197 register LQIN { 1198 address 0x020 ··· 3535 COMPLETE_DMA_SCB_HEAD { 3536 size 2 3537 } 3538 - /* Counting semaphore to prevent new select-outs */ 3539 QFREEZE_COUNT { 3540 size 2 3541 } 3542 /* ··· 3642 size 1 3643 } 3644 /* 3645 * Base address of our shared data with the kernel driver in host 3646 * memory. This includes the qoutfifo and target mode 3647 * incoming command queue. ··· 3666 */ 3667 QOUTFIFO_NEXT_ADDR { 3668 size 4 3669 - } 3670 - /* 3671 - * Kernel and sequencer offsets into the queue of 3672 - * incoming target mode command descriptors. The 3673 - * queue is full when the KERNEL_TQINPOS == TQINPOS. 3674 - */ 3675 - KERNEL_TQINPOS { 3676 - size 1 3677 - } 3678 - TQINPOS { 3679 - size 1 3680 } 3681 ARG_1 { 3682 size 1 ··· 3968 const SG_SIZEOF download 3969 const PKT_OVERRUN_BUFOFFSET download 3970 const SCB_TRANSFER_SIZE download 3971 3972 /* 3973 * BIOS SCB offsets
··· 39 * 40 * $FreeBSD$ 41 */ 42 + VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $" 43 44 /* 45 * This file is processed by the aic7xxx_asm utility for use in assembling ··· 65 mvi MODE_PTR, MK_MODE(src, dst); \ 66 } 67 68 #define RESTORE_MODE(mode) \ 69 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \ 70 mov mode call set_mode_work_around; \ ··· 1199 1200 /* 1201 * LQ Packet In 1202 + * The last LQ Packet recieved 1203 */ 1204 register LQIN { 1205 address 0x020 ··· 3542 COMPLETE_DMA_SCB_HEAD { 3543 size 2 3544 } 3545 + /* 3546 + * tail of list of SCBs that have 3547 + * completed but need to be uploaded 3548 + * to the host prior to being completed. 3549 + */ 3550 + COMPLETE_DMA_SCB_TAIL { 3551 + size 2 3552 + } 3553 + /* 3554 + * head of list of SCBs that have 3555 + * been uploaded to the host, but cannot 3556 + * be completed until the QFREEZE is in 3557 + * full effect (i.e. no selections pending). 3558 + */ 3559 + COMPLETE_ON_QFREEZE_HEAD { 3560 + size 2 3561 + } 3562 + /* 3563 + * Counting semaphore to prevent new select-outs 3564 + * The queue is frozen so long as the sequencer 3565 + * and kernel freeze counts differ. 3566 + */ 3567 QFREEZE_COUNT { 3568 + size 2 3569 + } 3570 + KERNEL_QFREEZE_COUNT { 3571 size 2 3572 } 3573 /* ··· 3625 size 1 3626 } 3627 /* 3628 + * Kernel and sequencer offsets into the queue of 3629 + * incoming target mode command descriptors. The 3630 + * queue is full when the KERNEL_TQINPOS == TQINPOS. 3631 + */ 3632 + KERNEL_TQINPOS { 3633 + size 1 3634 + } 3635 + TQINPOS { 3636 + size 1 3637 + } 3638 + /* 3639 * Base address of our shared data with the kernel driver in host 3640 * memory. This includes the qoutfifo and target mode 3641 * incoming command queue. ··· 3638 */ 3639 QOUTFIFO_NEXT_ADDR { 3640 size 4 3641 } 3642 ARG_1 { 3643 size 1 ··· 3951 const SG_SIZEOF download 3952 const PKT_OVERRUN_BUFOFFSET download 3953 const SCB_TRANSFER_SIZE download 3954 + const CACHELINE_MASK download 3955 3956 /* 3957 * BIOS SCB offsets
+188 -53
drivers/scsi/aic7xxx/aic79xx.seq
··· 40 * $FreeBSD$ 41 */ 42 43 - VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#99 $" 44 PATCH_ARG_LIST = "struct ahd_softc *ahd" 45 PREFIX = "ahd_" 46 ··· 68 } 69 SET_MODE(M_SCSI, M_SCSI) 70 test SCSISEQ0, ENSELO|ENARBO jnz idle_loop_checkbus; 71 - test SEQ_FLAGS2, SELECTOUT_QFROZEN jnz idle_loop_checkbus; 72 cmp WAITING_TID_HEAD[1], SCB_LIST_NULL je idle_loop_checkbus; 73 /* 74 * ENSELO is cleared by a SELDO, so we must test for SELDO 75 * one last time. 76 */ 77 - BEGIN_CRITICAL; 78 test SSTAT0, SELDO jnz select_out; 79 END_CRITICAL; 80 call start_selection; ··· 124 test SSTAT2, NONPACKREQ jz . + 2; 125 call unexpected_nonpkt_phase_find_ctxt; 126 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) { 127 and A, FIFO0FREE|FIFO1FREE, DFFSTAT; 128 cmp A, FIFO0FREE|FIFO1FREE jne . + 3; 129 and SBLKCTL, ~DIAGLEDEN|DIAGLEDON; ··· 142 call idle_loop_cchan; 143 jmp idle_loop; 144 145 - BEGIN_CRITICAL; 146 idle_loop_gsfifo: 147 SET_MODE(M_SCSI, M_SCSI) 148 idle_loop_gsfifo_in_scsi_mode: 149 test LQISTAT2, LQIGSAVAIL jz return; 150 /* ··· 193 194 idle_loop_service_fifos: 195 SET_MODE(M_DFF0, M_DFF0) 196 test LONGJMP_ADDR[1], INVALID_ADDR jnz idle_loop_next_fifo; 197 call longjmp; 198 idle_loop_next_fifo: 199 SET_MODE(M_DFF1, M_DFF1) 200 test LONGJMP_ADDR[1], INVALID_ADDR jz longjmp; 201 return: 202 ret; 203 ··· 215 test CCSCBCTL, CCARREN|CCSCBEN jz scbdma_idle; 216 test CCSCBCTL, CCSCBDIR jnz fetch_new_scb_inprog; 217 test CCSCBCTL, CCSCBDONE jz return; 218 - END_CRITICAL; 219 /* FALLTHROUGH */ 220 scbdma_tohost_done: 221 test CCSCBCTL, CCARREN jz fill_qoutfifo_dmadone; ··· 224 * bad SCSI status (currently only for underruns), we 225 * queue the SCB for normal completion. Otherwise, we 226 * wait until any select-out activity has halted, and 227 - * then notify the host so that the transaction can be 228 - * dealt with. 229 */ 230 - test SCB_SCSI_STATUS, 0xff jnz scbdma_notify_host; 231 and CCSCBCTL, ~(CCARREN|CCSCBEN); 232 bmov COMPLETE_DMA_SCB_HEAD, SCB_NEXT_COMPLETE, 2; 233 bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 234 bmov COMPLETE_SCB_HEAD, SCBPTR, 2 ret; 235 - scbdma_notify_host: 236 - SET_MODE(M_SCSI, M_SCSI) 237 - test SCSISEQ0, ENSELO jnz return; 238 - test SSTAT0, (SELDO|SELINGO) jnz return; 239 - SET_MODE(M_CCHAN, M_CCHAN) 240 - /* 241 - * Remove SCB and notify host. 242 - */ 243 - and CCSCBCTL, ~(CCARREN|CCSCBEN); 244 - bmov COMPLETE_DMA_SCB_HEAD, SCB_NEXT_COMPLETE, 2; 245 - SET_SEQINTCODE(BAD_SCB_STATUS) 246 - ret; 247 fill_qoutfifo_dmadone: 248 and CCSCBCTL, ~(CCARREN|CCSCBEN); 249 call qoutfifo_updated; ··· 244 test QOFF_CTLSTA, SDSCB_ROLLOVR jz return; 245 bmov QOUTFIFO_NEXT_ADDR, SHARED_DATA_ADDR, 4; 246 xor QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID_TOGGLE ret; 247 248 qoutfifo_updated: 249 /* ··· 361 * Keep track of the SCBs we are dmaing just 362 * in case the DMA fails or is aborted. 363 */ 364 - mov A, QOUTFIFO_ENTRY_VALID_TAG; 365 bmov COMPLETE_SCB_DMAINPROG_HEAD, COMPLETE_SCB_HEAD, 2; 366 mvi CCSCBCTL, CCSCBRESET; 367 bmov SCBHADDR, QOUTFIFO_NEXT_ADDR, 4; 368 bmov SCBPTR, COMPLETE_SCB_HEAD, 2; 369 fill_qoutfifo_loop: 370 - mov CCSCBRAM, SCBPTR; 371 - or CCSCBRAM, A, SCBPTR[1]; 372 mov NONE, SDSCB_QOFF; 373 inc INT_COALESCING_CMDCOUNT; 374 add CMDS_PENDING, -1; ··· 377 cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL je fill_qoutfifo_done; 378 cmp CCSCBADDR, CCSCBADDR_MAX je fill_qoutfifo_done; 379 test QOFF_CTLSTA, SDSCB_ROLLOVR jnz fill_qoutfifo_done; 380 bmov SCBPTR, SCB_NEXT_COMPLETE, 2; 381 jmp fill_qoutfifo_loop; 382 fill_qoutfifo_done: ··· 404 bmov SCBPTR, COMPLETE_DMA_SCB_HEAD, 2; 405 bmov SCBHADDR, SCB_BUSADDR, 4; 406 mvi CCARREN|CCSCBEN|CCSCBRESET jmp dma_scb; 407 - END_CRITICAL; 408 409 /* 410 * Either post or fetch an SCB from host memory. The caller ··· 420 mvi SCBHCNT, SCB_TRANSFER_SIZE; 421 mov CCSCBCTL, SINDEX ret; 422 423 - BEGIN_CRITICAL; 424 setjmp: 425 - bmov LONGJMP_ADDR, STACK, 2 ret; 426 setjmp_inline: 427 bmov LONGJMP_ADDR, STACK, 2; 428 longjmp: ··· 450 set_mode_work_around: 451 mvi SEQINTCTL, INTVEC1DSL; 452 mov MODE_PTR, SINDEX; 453 - clr SEQINTCTL ret; 454 - 455 - toggle_dff_mode_work_around: 456 - mvi SEQINTCTL, INTVEC1DSL; 457 - xor MODE_PTR, MK_MODE(M_DFF1, M_DFF1); 458 clr SEQINTCTL ret; 459 } 460 ··· 544 SET_SRC_MODE M_SCSI; 545 SET_DST_MODE M_SCSI; 546 select_in: 547 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) { 548 /* 549 * Test to ensure that the bus has not ··· 597 SET_DST_MODE M_SCSI; 598 select_out: 599 BEGIN_CRITICAL; 600 /* Clear out all SCBs that have been successfully sent. */ 601 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) { 602 /* ··· 1084 /* 1085 * We received a "command complete" message. Put the SCB on the complete 1086 * queue and trigger a completion interrupt via the idle loop. Before doing 1087 - * so, check to see if there 1088 - * is a residual or the status byte is something other than STATUS_GOOD (0). 1089 - * In either of these conditions, we upload the SCB back to the host so it can 1090 - * process this information. In the case of a non zero status byte, we 1091 - * additionally interrupt the kernel driver synchronously, allowing it to 1092 - * decide if sense should be retrieved. If the kernel driver wishes to request 1093 - * sense, it will fill the kernel SCB with a request sense command, requeue 1094 - * it to the QINFIFO and tell us not to post to the QOUTFIFO by setting 1095 - * RETURN_1 to SEND_SENSE. 1096 */ 1097 mesgin_complete: 1098 ··· 1131 call queue_scb_completion; 1132 jmp await_busfree; 1133 1134 freeze_queue: 1135 /* Cancel any pending select-out. */ 1136 test SSTAT0, SELDO|SELINGO jnz . + 2; ··· 1142 adc QFREEZE_COUNT[1], A; 1143 or SEQ_FLAGS2, SELECTOUT_QFROZEN; 1144 mov A, ACCUM_SAVE ret; 1145 1146 /* 1147 * Complete the current FIFO's SCB if data for this same ··· 1165 test SCB_SGPTR, SG_FULL_RESID jnz upload_scb;/* Never xfered */ 1166 test SCB_RESIDUAL_SGPTR, SG_LIST_NULL jz upload_scb; 1167 complete: 1168 bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 1169 bmov COMPLETE_SCB_HEAD, SCBPTR, 2 ret; 1170 bad_status: 1171 cmp SCB_SCSI_STATUS, STATUS_PKT_SENSE je upload_scb; 1172 call freeze_queue; ··· 1179 * it on the host. 1180 */ 1181 bmov SCB_TAG, SCBPTR, 2; 1182 - bmov SCB_NEXT_COMPLETE, COMPLETE_DMA_SCB_HEAD, 2; 1183 bmov COMPLETE_DMA_SCB_HEAD, SCBPTR, 2; 1184 - or SCB_SGPTR, SG_STATUS_VALID ret; 1185 1186 /* 1187 * Is it a disconnect message? Set a flag in the SCB to remind us ··· 1237 await_busfree_clrchn: 1238 mvi DFFSXFRCTL, CLRCHN; 1239 await_busfree_not_m_dff: 1240 - call clear_target_state; 1241 test SSTAT1,REQINIT|BUSFREE jz .; 1242 test SSTAT1, BUSFREE jnz idle_loop; 1243 SET_SEQINTCODE(MISSED_BUSFREE) 1244 ··· 1302 msgin_rdptrs_get_fifo: 1303 call allocate_fifo; 1304 jmp mesgin_done; 1305 - 1306 - clear_target_state: 1307 - mvi LASTPHASE, P_BUSFREE; 1308 - /* clear target specific flags */ 1309 - mvi SEQ_FLAGS, NOT_IDENTIFIED|NO_CDB_SENT ret; 1310 1311 phase_lock: 1312 if ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0) { ··· 1394 test CCSGCTL, CCSGENACK jnz return; 1395 1396 /* 1397 * We fetch a "cacheline aligned" and sized amount of data 1398 * so we don't end up referencing a non-existant page. 1399 * Cacheline aligned is in quotes because the kernel will ··· 1445 mvi SGHCNT, SG_PREFETCH_CNT; 1446 if ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0) { 1447 /* 1448 - * Need two instruction between "touches" of SGHADDR. 1449 */ 1450 nop; 1451 } ··· 1795 * savepointer in the current FIFO. We do this so that 1796 * a pending CTXTDONE or SAVEPTR is visible in the active 1797 * FIFO. This status is the only way we can detect if we 1798 - * have lost the race (e.g. host paused us) and our attepts 1799 * to disable the channel occurred after all REQs were 1800 * already seen and acked (REQINIT never comes true). 1801 */ ··· 1804 test DFCNTRL, DIRECTION jz interrupt_return; 1805 and DFCNTRL, ~SCSIEN; 1806 snapshot_wait_data_valid: 1807 - test SEQINTSRC, (CTXTDONE|SAVEPTRS) jnz snapshot_data_valid; 1808 test SSTAT1, REQINIT jz snapshot_wait_data_valid; 1809 snapshot_data_valid: 1810 or DFCNTRL, SCSIEN; ··· 1971 dec SCB_FIFO_USE_COUNT; 1972 test SCB_CONTROL, STATUS_RCVD jnz pkt_complete_scb_if_fifos_idle; 1973 mvi DFFSXFRCTL, CLRCHN ret; 1974 - END_CRITICAL; 1975 1976 /* 1977 * LAST_SEG_DONE status has been seen in the current FIFO. ··· 1979 * Check for overrun and see if we can complete this command. 1980 */ 1981 pkt_last_seg_done: 1982 - BEGIN_CRITICAL; 1983 /* 1984 * Mark transfer as completed. 1985 */
··· 40 * $FreeBSD$ 41 */ 42 43 + VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $" 44 PATCH_ARG_LIST = "struct ahd_softc *ahd" 45 PREFIX = "ahd_" 46 ··· 68 } 69 SET_MODE(M_SCSI, M_SCSI) 70 test SCSISEQ0, ENSELO|ENARBO jnz idle_loop_checkbus; 71 + test SEQ_FLAGS2, SELECTOUT_QFROZEN jz check_waiting_list; 72 + /* 73 + * If the kernel has caught up with us, thaw the queue. 74 + */ 75 + mov A, KERNEL_QFREEZE_COUNT; 76 + cmp QFREEZE_COUNT, A jne check_frozen_completions; 77 + mov A, KERNEL_QFREEZE_COUNT[1]; 78 + cmp QFREEZE_COUNT[1], A jne check_frozen_completions; 79 + and SEQ_FLAGS2, ~SELECTOUT_QFROZEN; 80 + jmp check_waiting_list; 81 + check_frozen_completions: 82 + test SSTAT0, SELDO|SELINGO jnz idle_loop_checkbus; 83 + BEGIN_CRITICAL; 84 + /* 85 + * If we have completions stalled waiting for the qfreeze 86 + * to take effect, move them over to the complete_scb list 87 + * now that no selections are pending. 88 + */ 89 + cmp COMPLETE_ON_QFREEZE_HEAD[1],SCB_LIST_NULL je idle_loop_checkbus; 90 + /* 91 + * Find the end of the qfreeze list. The first element has 92 + * to be treated specially. 93 + */ 94 + bmov SCBPTR, COMPLETE_ON_QFREEZE_HEAD, 2; 95 + cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL je join_lists; 96 + /* 97 + * Now the normal loop. 98 + */ 99 + bmov SCBPTR, SCB_NEXT_COMPLETE, 2; 100 + cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL jne . - 1; 101 + join_lists: 102 + bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 103 + bmov COMPLETE_SCB_HEAD, COMPLETE_ON_QFREEZE_HEAD, 2; 104 + mvi COMPLETE_ON_QFREEZE_HEAD[1], SCB_LIST_NULL; 105 + jmp idle_loop_checkbus; 106 + check_waiting_list: 107 cmp WAITING_TID_HEAD[1], SCB_LIST_NULL je idle_loop_checkbus; 108 /* 109 * ENSELO is cleared by a SELDO, so we must test for SELDO 110 * one last time. 111 */ 112 test SSTAT0, SELDO jnz select_out; 113 END_CRITICAL; 114 call start_selection; ··· 90 test SSTAT2, NONPACKREQ jz . + 2; 91 call unexpected_nonpkt_phase_find_ctxt; 92 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) { 93 + /* 94 + * On Rev A. hardware, the busy LED is only 95 + * turned on automaically during selections 96 + * and re-selections. Make the LED status 97 + * more useful by forcing it to be on so 98 + * long as one of our data FIFOs is active. 99 + */ 100 and A, FIFO0FREE|FIFO1FREE, DFFSTAT; 101 cmp A, FIFO0FREE|FIFO1FREE jne . + 3; 102 and SBLKCTL, ~DIAGLEDEN|DIAGLEDON; ··· 101 call idle_loop_cchan; 102 jmp idle_loop; 103 104 idle_loop_gsfifo: 105 SET_MODE(M_SCSI, M_SCSI) 106 + BEGIN_CRITICAL; 107 idle_loop_gsfifo_in_scsi_mode: 108 test LQISTAT2, LQIGSAVAIL jz return; 109 /* ··· 152 153 idle_loop_service_fifos: 154 SET_MODE(M_DFF0, M_DFF0) 155 + BEGIN_CRITICAL; 156 test LONGJMP_ADDR[1], INVALID_ADDR jnz idle_loop_next_fifo; 157 call longjmp; 158 + END_CRITICAL; 159 idle_loop_next_fifo: 160 SET_MODE(M_DFF1, M_DFF1) 161 + BEGIN_CRITICAL; 162 test LONGJMP_ADDR[1], INVALID_ADDR jz longjmp; 163 + END_CRITICAL; 164 return: 165 ret; 166 ··· 170 test CCSCBCTL, CCARREN|CCSCBEN jz scbdma_idle; 171 test CCSCBCTL, CCSCBDIR jnz fetch_new_scb_inprog; 172 test CCSCBCTL, CCSCBDONE jz return; 173 /* FALLTHROUGH */ 174 scbdma_tohost_done: 175 test CCSCBCTL, CCARREN jz fill_qoutfifo_dmadone; ··· 180 * bad SCSI status (currently only for underruns), we 181 * queue the SCB for normal completion. Otherwise, we 182 * wait until any select-out activity has halted, and 183 + * then queue the completion. 184 */ 185 and CCSCBCTL, ~(CCARREN|CCSCBEN); 186 bmov COMPLETE_DMA_SCB_HEAD, SCB_NEXT_COMPLETE, 2; 187 + cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL jne . + 2; 188 + mvi COMPLETE_DMA_SCB_TAIL[1], SCB_LIST_NULL; 189 + test SCB_SCSI_STATUS, 0xff jz scbdma_queue_completion; 190 + bmov SCB_NEXT_COMPLETE, COMPLETE_ON_QFREEZE_HEAD, 2; 191 + bmov COMPLETE_ON_QFREEZE_HEAD, SCBPTR, 2 ret; 192 + scbdma_queue_completion: 193 bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 194 bmov COMPLETE_SCB_HEAD, SCBPTR, 2 ret; 195 fill_qoutfifo_dmadone: 196 and CCSCBCTL, ~(CCARREN|CCSCBEN); 197 call qoutfifo_updated; ··· 208 test QOFF_CTLSTA, SDSCB_ROLLOVR jz return; 209 bmov QOUTFIFO_NEXT_ADDR, SHARED_DATA_ADDR, 4; 210 xor QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID_TOGGLE ret; 211 + END_CRITICAL; 212 213 qoutfifo_updated: 214 /* ··· 324 * Keep track of the SCBs we are dmaing just 325 * in case the DMA fails or is aborted. 326 */ 327 bmov COMPLETE_SCB_DMAINPROG_HEAD, COMPLETE_SCB_HEAD, 2; 328 mvi CCSCBCTL, CCSCBRESET; 329 bmov SCBHADDR, QOUTFIFO_NEXT_ADDR, 4; 330 + mov A, QOUTFIFO_NEXT_ADDR; 331 bmov SCBPTR, COMPLETE_SCB_HEAD, 2; 332 fill_qoutfifo_loop: 333 + bmov CCSCBRAM, SCBPTR, 2; 334 + mov CCSCBRAM, SCB_SGPTR[0]; 335 + mov CCSCBRAM, QOUTFIFO_ENTRY_VALID_TAG; 336 mov NONE, SDSCB_QOFF; 337 inc INT_COALESCING_CMDCOUNT; 338 add CMDS_PENDING, -1; ··· 339 cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL je fill_qoutfifo_done; 340 cmp CCSCBADDR, CCSCBADDR_MAX je fill_qoutfifo_done; 341 test QOFF_CTLSTA, SDSCB_ROLLOVR jnz fill_qoutfifo_done; 342 + /* 343 + * Don't cross an ADB or Cachline boundary when DMA'ing 344 + * completion entries. In PCI mode, at least in 32/33 345 + * configurations, the SCB DMA engine may lose its place 346 + * in the data-stream should the target force a retry on 347 + * something other than an 8byte aligned boundary. In 348 + * PCI-X mode, we do this to avoid split transactions since 349 + * many chipsets seem to be unable to format proper split 350 + * completions to continue the data transfer. 351 + */ 352 + add SINDEX, A, CCSCBADDR; 353 + test SINDEX, CACHELINE_MASK jz fill_qoutfifo_done; 354 bmov SCBPTR, SCB_NEXT_COMPLETE, 2; 355 jmp fill_qoutfifo_loop; 356 fill_qoutfifo_done: ··· 354 bmov SCBPTR, COMPLETE_DMA_SCB_HEAD, 2; 355 bmov SCBHADDR, SCB_BUSADDR, 4; 356 mvi CCARREN|CCSCBEN|CCSCBRESET jmp dma_scb; 357 358 /* 359 * Either post or fetch an SCB from host memory. The caller ··· 371 mvi SCBHCNT, SCB_TRANSFER_SIZE; 372 mov CCSCBCTL, SINDEX ret; 373 374 setjmp: 375 + /* 376 + * At least on the A, a return in the same 377 + * instruction as the bmov results in a return 378 + * to the caller, not to the new address at the 379 + * top of the stack. Since we want the latter 380 + * (we use setjmp to register a handler from an 381 + * interrupt context but not invoke that handler 382 + * until we return to our idle loop), use a 383 + * separate ret instruction. 384 + */ 385 + bmov LONGJMP_ADDR, STACK, 2; 386 + ret; 387 setjmp_inline: 388 bmov LONGJMP_ADDR, STACK, 2; 389 longjmp: ··· 391 set_mode_work_around: 392 mvi SEQINTCTL, INTVEC1DSL; 393 mov MODE_PTR, SINDEX; 394 clr SEQINTCTL ret; 395 } 396 ··· 490 SET_SRC_MODE M_SCSI; 491 SET_DST_MODE M_SCSI; 492 select_in: 493 + if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) { 494 + /* 495 + * On Rev A. hardware, the busy LED is only 496 + * turned on automaically during selections 497 + * and re-selections. Make the LED status 498 + * more useful by forcing it to be on from 499 + * the point of selection until our idle 500 + * loop determines that neither of our FIFOs 501 + * are busy. This handles the non-packetized 502 + * case nicely as we will not return to the 503 + * idle loop until the busfree at the end of 504 + * each transaction. 505 + */ 506 + or SBLKCTL, DIAGLEDEN|DIAGLEDON; 507 + } 508 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) { 509 /* 510 * Test to ensure that the bus has not ··· 528 SET_DST_MODE M_SCSI; 529 select_out: 530 BEGIN_CRITICAL; 531 + if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) { 532 + /* 533 + * On Rev A. hardware, the busy LED is only 534 + * turned on automaically during selections 535 + * and re-selections. Make the LED status 536 + * more useful by forcing it to be on from 537 + * the point of re-selection until our idle 538 + * loop determines that neither of our FIFOs 539 + * are busy. This handles the non-packetized 540 + * case nicely as we will not return to the 541 + * idle loop until the busfree at the end of 542 + * each transaction. 543 + */ 544 + or SBLKCTL, DIAGLEDEN|DIAGLEDON; 545 + } 546 /* Clear out all SCBs that have been successfully sent. */ 547 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) { 548 /* ··· 1000 /* 1001 * We received a "command complete" message. Put the SCB on the complete 1002 * queue and trigger a completion interrupt via the idle loop. Before doing 1003 + * so, check to see if there is a residual or the status byte is something 1004 + * other than STATUS_GOOD (0). In either of these conditions, we upload the 1005 + * SCB back to the host so it can process this information. 1006 */ 1007 mesgin_complete: 1008 ··· 1053 call queue_scb_completion; 1054 jmp await_busfree; 1055 1056 + BEGIN_CRITICAL; 1057 freeze_queue: 1058 /* Cancel any pending select-out. */ 1059 test SSTAT0, SELDO|SELINGO jnz . + 2; ··· 1063 adc QFREEZE_COUNT[1], A; 1064 or SEQ_FLAGS2, SELECTOUT_QFROZEN; 1065 mov A, ACCUM_SAVE ret; 1066 + END_CRITICAL; 1067 1068 /* 1069 * Complete the current FIFO's SCB if data for this same ··· 1085 test SCB_SGPTR, SG_FULL_RESID jnz upload_scb;/* Never xfered */ 1086 test SCB_RESIDUAL_SGPTR, SG_LIST_NULL jz upload_scb; 1087 complete: 1088 + BEGIN_CRITICAL; 1089 bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 1090 bmov COMPLETE_SCB_HEAD, SCBPTR, 2 ret; 1091 + END_CRITICAL; 1092 bad_status: 1093 cmp SCB_SCSI_STATUS, STATUS_PKT_SENSE je upload_scb; 1094 call freeze_queue; ··· 1097 * it on the host. 1098 */ 1099 bmov SCB_TAG, SCBPTR, 2; 1100 + BEGIN_CRITICAL; 1101 + or SCB_SGPTR, SG_STATUS_VALID; 1102 + mvi SCB_NEXT_COMPLETE[1], SCB_LIST_NULL; 1103 + cmp COMPLETE_DMA_SCB_HEAD[1], SCB_LIST_NULL jne add_dma_scb_tail; 1104 bmov COMPLETE_DMA_SCB_HEAD, SCBPTR, 2; 1105 + bmov COMPLETE_DMA_SCB_TAIL, SCBPTR, 2 ret; 1106 + add_dma_scb_tail: 1107 + bmov REG0, SCBPTR, 2; 1108 + bmov SCBPTR, COMPLETE_DMA_SCB_TAIL, 2; 1109 + bmov SCB_NEXT_COMPLETE, REG0, 2; 1110 + bmov COMPLETE_DMA_SCB_TAIL, REG0, 2 ret; 1111 + END_CRITICAL; 1112 1113 /* 1114 * Is it a disconnect message? Set a flag in the SCB to remind us ··· 1146 await_busfree_clrchn: 1147 mvi DFFSXFRCTL, CLRCHN; 1148 await_busfree_not_m_dff: 1149 + /* clear target specific flags */ 1150 + mvi SEQ_FLAGS, NOT_IDENTIFIED|NO_CDB_SENT; 1151 test SSTAT1,REQINIT|BUSFREE jz .; 1152 + /* 1153 + * We only set BUSFREE status once either a new 1154 + * phase has been detected or we are really 1155 + * BUSFREE. This allows the driver to know 1156 + * that we are active on the bus even though 1157 + * no identified transaction exists should a 1158 + * timeout occur while awaiting busfree. 1159 + */ 1160 + mvi LASTPHASE, P_BUSFREE; 1161 test SSTAT1, BUSFREE jnz idle_loop; 1162 SET_SEQINTCODE(MISSED_BUSFREE) 1163 ··· 1201 msgin_rdptrs_get_fifo: 1202 call allocate_fifo; 1203 jmp mesgin_done; 1204 1205 phase_lock: 1206 if ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0) { ··· 1298 test CCSGCTL, CCSGENACK jnz return; 1299 1300 /* 1301 + * Should the other FIFO get the S/G cache first? If 1302 + * both FIFOs have been allocated since we last checked 1303 + * any FIFO, it is important that we service a FIFO 1304 + * that is not actively on the bus first. This guarantees 1305 + * that a FIFO will be freed to handle snapshot requests for 1306 + * any FIFO that is still on the bus. Chips with RTI do not 1307 + * perform snapshots, so don't bother with this test there. 1308 + */ 1309 + if ((ahd->features & AHD_RTI) == 0) { 1310 + /* 1311 + * If we're not still receiving SCSI data, 1312 + * it is safe to allocate the S/G cache to 1313 + * this FIFO. 1314 + */ 1315 + test DFCNTRL, SCSIEN jz idle_sgfetch_start; 1316 + 1317 + /* 1318 + * Switch to the other FIFO. Non-RTI chips 1319 + * also have the "set mode" bug, so we must 1320 + * disable interrupts during the switch. 1321 + */ 1322 + mvi SEQINTCTL, INTVEC1DSL; 1323 + xor MODE_PTR, MK_MODE(M_DFF1, M_DFF1); 1324 + 1325 + /* 1326 + * If the other FIFO needs loading, then it 1327 + * must not have claimed the S/G cache yet 1328 + * (SG_CACHE_AVAIL would have been cleared in 1329 + * the orginal FIFO mode and we test this above). 1330 + * Return to the idle loop so we can process the 1331 + * FIFO not currently on the bus first. 1332 + */ 1333 + test SG_STATE, LOADING_NEEDED jz idle_sgfetch_okay; 1334 + clr SEQINTCTL ret; 1335 + idle_sgfetch_okay: 1336 + xor MODE_PTR, MK_MODE(M_DFF1, M_DFF1); 1337 + clr SEQINTCTL; 1338 + } 1339 + 1340 + idle_sgfetch_start: 1341 + /* 1342 * We fetch a "cacheline aligned" and sized amount of data 1343 * so we don't end up referencing a non-existant page. 1344 * Cacheline aligned is in quotes because the kernel will ··· 1308 mvi SGHCNT, SG_PREFETCH_CNT; 1309 if ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0) { 1310 /* 1311 + * Need two instructions between "touches" of SGHADDR. 1312 */ 1313 nop; 1314 } ··· 1658 * savepointer in the current FIFO. We do this so that 1659 * a pending CTXTDONE or SAVEPTR is visible in the active 1660 * FIFO. This status is the only way we can detect if we 1661 + * have lost the race (e.g. host paused us) and our attempts 1662 * to disable the channel occurred after all REQs were 1663 * already seen and acked (REQINIT never comes true). 1664 */ ··· 1667 test DFCNTRL, DIRECTION jz interrupt_return; 1668 and DFCNTRL, ~SCSIEN; 1669 snapshot_wait_data_valid: 1670 + test SEQINTSRC, (CTXTDONE|SAVEPTRS) jnz interrupt_return; 1671 test SSTAT1, REQINIT jz snapshot_wait_data_valid; 1672 snapshot_data_valid: 1673 or DFCNTRL, SCSIEN; ··· 1834 dec SCB_FIFO_USE_COUNT; 1835 test SCB_CONTROL, STATUS_RCVD jnz pkt_complete_scb_if_fifos_idle; 1836 mvi DFFSXFRCTL, CLRCHN ret; 1837 1838 /* 1839 * LAST_SEG_DONE status has been seen in the current FIFO. ··· 1843 * Check for overrun and see if we can complete this command. 1844 */ 1845 pkt_last_seg_done: 1846 /* 1847 * Mark transfer as completed. 1848 */
+418 -365
drivers/scsi/aic7xxx/aic79xx_core.c
··· 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGES. 39 * 40 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#202 $ 41 - * 42 - * $FreeBSD$ 43 */ 44 45 #ifdef __linux__ ··· 330 ahd_outb(ahd, SCSISEQ1, 331 ahd_inb(ahd, SCSISEQ_TEMPLATE) & (ENSELI|ENRSELI|ENAUTOATNP)); 332 ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN); 333 ahd_outb(ahd, SEQCTL0, FASTMODE|SEQRESET); 334 ahd_unpause(ahd); 335 } ··· 379 saved_modes = ahd_save_modes(ahd); 380 381 /* 382 - * Complete any SCBs that just finished being 383 - * DMA'ed into the qoutfifo. 384 - */ 385 - ahd_run_qoutfifo(ahd); 386 - 387 - /* 388 - * Flush the good status FIFO for compelted packetized commands. 389 */ 390 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 391 saved_scbptr = ahd_get_scbptr(ahd); ··· 387 u_int fifo_mode; 388 u_int i; 389 390 - scbid = (ahd_inb(ahd, GSFIFO+1) << 8) 391 - | ahd_inb(ahd, GSFIFO); 392 scb = ahd_lookup_scb(ahd, scbid); 393 if (scb == NULL) { 394 printf("%s: Warning - GSFIFO SCB %d invalid\n", ··· 400 * the host before completing the command. 401 */ 402 fifo_mode = 0; 403 for (i = 0; i < 2; i++) { 404 /* Toggle to the other mode. */ 405 fifo_mode ^= 1; 406 ahd_set_modes(ahd, fifo_mode, fifo_mode); 407 if (ahd_scb_active_in_fifo(ahd, scb) == 0) 408 continue; 409 410 ahd_run_data_fifo(ahd, scb); 411 412 /* 413 - * Clearing this transaction in this FIFO may 414 - * cause a CFG4DATA for this same transaction 415 - * to assert in the other FIFO. Make sure we 416 - * loop one more time and check the other FIFO. 417 */ 418 - i = 0; 419 } 420 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 421 ahd_set_scbptr(ahd, scbid); ··· 439 /* 440 * The transfer completed with a residual. 441 * Place this SCB on the complete DMA list 442 - * so that we Update our in-core copy of the 443 * SCB before completing the command. 444 */ 445 ahd_outb(ahd, SCB_SCSI_STATUS, 0); 446 ahd_outb(ahd, SCB_SGPTR, 447 ahd_inb_scbram(ahd, SCB_SGPTR) 448 | SG_STATUS_VALID); 449 - ahd_outw(ahd, SCB_TAG, SCB_GET_TAG(scb)); 450 comp_head = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD); 451 - ahd_outw(ahd, SCB_NEXT_COMPLETE, comp_head); 452 - if (SCBID_IS_NULL(comp_head)) 453 - ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, 454 - SCB_GET_TAG(scb)); 455 } else 456 ahd_complete_scb(ahd, scb); 457 } ··· 484 break; 485 ahd_delay(200); 486 } 487 - if ((ccscbctl & CCSCBDIR) != 0) 488 ahd_outb(ahd, CCSCBCTL, ccscbctl & ~(CCARREN|CCSCBEN)); 489 490 saved_scbptr = ahd_get_scbptr(ahd); 491 /* ··· 526 scbid = next_scbid; 527 } 528 ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, SCB_LIST_NULL); 529 530 scbid = ahd_inw(ahd, COMPLETE_SCB_HEAD); 531 while (!SCBID_IS_NULL(scbid)) { ··· 608 { 609 u_int seqintsrc; 610 611 - while (1) { 612 - seqintsrc = ahd_inb(ahd, SEQINTSRC); 613 - if ((seqintsrc & CFG4DATA) != 0) { 614 - uint32_t datacnt; 615 - uint32_t sgptr; 616 617 - /* 618 - * Clear full residual flag. 619 - */ 620 - sgptr = ahd_inl_scbram(ahd, SCB_SGPTR) & ~SG_FULL_RESID; 621 - ahd_outb(ahd, SCB_SGPTR, sgptr); 622 623 - /* 624 - * Load datacnt and address. 625 - */ 626 - datacnt = ahd_inl_scbram(ahd, SCB_DATACNT); 627 - if ((datacnt & AHD_DMA_LAST_SEG) != 0) { 628 - sgptr |= LAST_SEG; 629 - ahd_outb(ahd, SG_STATE, 0); 630 - } else 631 - ahd_outb(ahd, SG_STATE, LOADING_NEEDED); 632 - ahd_outq(ahd, HADDR, ahd_inq_scbram(ahd, SCB_DATAPTR)); 633 - ahd_outl(ahd, HCNT, datacnt & AHD_SG_LEN_MASK); 634 - ahd_outb(ahd, SG_CACHE_PRE, sgptr); 635 - ahd_outb(ahd, DFCNTRL, PRELOADEN|SCSIEN|HDMAEN); 636 - 637 - /* 638 - * Initialize Residual Fields. 639 - */ 640 - ahd_outb(ahd, SCB_RESIDUAL_DATACNT+3, datacnt >> 24); 641 - ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr & SG_PTR_MASK); 642 - 643 - /* 644 - * Mark the SCB as having a FIFO in use. 645 - */ 646 - ahd_outb(ahd, SCB_FIFO_USE_COUNT, 647 - ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT) + 1); 648 - 649 - /* 650 - * Install a "fake" handler for this FIFO. 651 - */ 652 - ahd_outw(ahd, LONGJMP_ADDR, 0); 653 - 654 - /* 655 - * Notify the hardware that we have satisfied 656 - * this sequencer interrupt. 657 - */ 658 - ahd_outb(ahd, CLRSEQINTSRC, CLRCFG4DATA); 659 - } else if ((seqintsrc & SAVEPTRS) != 0) { 660 - uint32_t sgptr; 661 - uint32_t resid; 662 - 663 - if ((ahd_inb(ahd, LONGJMP_ADDR+1)&INVALID_ADDR) != 0) { 664 - /* 665 - * Snapshot Save Pointers. Clear 666 - * the snapshot and continue. 667 - */ 668 - ahd_outb(ahd, DFFSXFRCTL, CLRCHN); 669 - continue; 670 - } 671 - 672 - /* 673 - * Disable S/G fetch so the DMA engine 674 - * is available to future users. 675 - */ 676 - if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0) 677 - ahd_outb(ahd, CCSGCTL, 0); 678 ahd_outb(ahd, SG_STATE, 0); 679 680 - /* 681 - * Flush the data FIFO. Strickly only 682 - * necessary for Rev A parts. 683 - */ 684 - ahd_outb(ahd, DFCNTRL, 685 - ahd_inb(ahd, DFCNTRL) | FIFOFLUSH); 686 687 - /* 688 - * Calculate residual. 689 - */ 690 - sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR); 691 - resid = ahd_inl(ahd, SHCNT); 692 - resid |= 693 - ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT+3) << 24; 694 - ahd_outl(ahd, SCB_RESIDUAL_DATACNT, resid); 695 - if ((ahd_inb(ahd, SG_CACHE_SHADOW) & LAST_SEG) == 0) { 696 - /* 697 - * Must back up to the correct S/G element. 698 - * Typically this just means resetting our 699 - * low byte to the offset in the SG_CACHE, 700 - * but if we wrapped, we have to correct 701 - * the other bytes of the sgptr too. 702 - */ 703 - if ((ahd_inb(ahd, SG_CACHE_SHADOW) & 0x80) != 0 704 - && (sgptr & 0x80) == 0) 705 - sgptr -= 0x100; 706 - sgptr &= ~0xFF; 707 - sgptr |= ahd_inb(ahd, SG_CACHE_SHADOW) 708 - & SG_ADDR_MASK; 709 - ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr); 710 - ahd_outb(ahd, SCB_RESIDUAL_DATACNT + 3, 0); 711 - } else if ((resid & AHD_SG_LEN_MASK) == 0) { 712 - ahd_outb(ahd, SCB_RESIDUAL_SGPTR, 713 - sgptr | SG_LIST_NULL); 714 - } 715 - /* 716 - * Save Pointers. 717 - */ 718 - ahd_outq(ahd, SCB_DATAPTR, ahd_inq(ahd, SHADDR)); 719 - ahd_outl(ahd, SCB_DATACNT, resid); 720 - ahd_outl(ahd, SCB_SGPTR, sgptr); 721 - ahd_outb(ahd, CLRSEQINTSRC, CLRSAVEPTRS); 722 - ahd_outb(ahd, SEQIMODE, 723 - ahd_inb(ahd, SEQIMODE) | ENSAVEPTRS); 724 - /* 725 - * If the data is to the SCSI bus, we are 726 - * done, otherwise wait for FIFOEMP. 727 - */ 728 - if ((ahd_inb(ahd, DFCNTRL) & DIRECTION) != 0) 729 - break; 730 - } else if ((ahd_inb(ahd, SG_STATE) & LOADING_NEEDED) != 0) { 731 - uint32_t sgptr; 732 - uint64_t data_addr; 733 - uint32_t data_len; 734 - u_int dfcntrl; 735 736 - /* 737 - * Disable S/G fetch so the DMA engine 738 - * is available to future users. 739 - */ 740 - if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0) { 741 - ahd_outb(ahd, CCSGCTL, 0); 742 - ahd_outb(ahd, SG_STATE, LOADING_NEEDED); 743 - } 744 745 /* 746 - * Wait for the DMA engine to notice that the 747 - * host transfer is enabled and that there is 748 - * space in the S/G FIFO for new segments before 749 - * loading more segments. 750 */ 751 - if ((ahd_inb(ahd, DFSTATUS) & PRELOAD_AVAIL) == 0) 752 - continue; 753 - if ((ahd_inb(ahd, DFCNTRL) & HDMAENACK) == 0) 754 - continue; 755 756 /* 757 * Determine the offset of the next S/G ··· 794 * Advertise the segment to the hardware. 795 */ 796 dfcntrl = ahd_inb(ahd, DFCNTRL)|PRELOADEN|HDMAEN; 797 - if ((ahd->features & AHD_NEW_DFCNTRL_OPTS)!=0) { 798 /* 799 * Use SCSIENWRDIS so that SCSIEN 800 * is never modified by this ··· 803 dfcntrl |= SCSIENWRDIS; 804 } 805 ahd_outb(ahd, DFCNTRL, dfcntrl); 806 - } else if ((ahd_inb(ahd, SG_CACHE_SHADOW) 807 - & LAST_SEG_DONE) != 0) { 808 - 809 - /* 810 - * Transfer completed to the end of SG list 811 - * and has flushed to the host. 812 - */ 813 - ahd_outb(ahd, SCB_SGPTR, 814 - ahd_inb_scbram(ahd, SCB_SGPTR) | SG_LIST_NULL); 815 - break; 816 - } else if ((ahd_inb(ahd, DFSTATUS) & FIFOEMP) != 0) { 817 - break; 818 } 819 - ahd_delay(200); 820 } 821 - /* 822 - * Clear any handler for this FIFO, decrement 823 - * the FIFO use count for the SCB, and release 824 - * the FIFO. 825 - */ 826 - ahd_outb(ahd, LONGJMP_ADDR + 1, INVALID_ADDR); 827 - ahd_outb(ahd, SCB_FIFO_USE_COUNT, 828 - ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT) - 1); 829 - ahd_outb(ahd, DFFSXFRCTL, CLRCHN); 830 } 831 832 void 833 ahd_run_qoutfifo(struct ahd_softc *ahd) 834 { 835 struct scb *scb; 836 u_int scb_index; 837 ··· 848 panic("ahd_run_qoutfifo recursion"); 849 ahd->flags |= AHD_RUNNING_QOUTFIFO; 850 ahd_sync_qoutfifo(ahd, BUS_DMASYNC_POSTREAD); 851 - while ((ahd->qoutfifo[ahd->qoutfifonext] 852 - & QOUTFIFO_ENTRY_VALID_LE) == ahd->qoutfifonext_valid_tag) { 853 854 - scb_index = ahd_le16toh(ahd->qoutfifo[ahd->qoutfifonext] 855 - & ~QOUTFIFO_ENTRY_VALID_LE); 856 scb = ahd_lookup_scb(ahd, scb_index); 857 if (scb == NULL) { 858 printf("%s: WARNING no command for scb %d " ··· 862 ahd_name(ahd), scb_index, 863 ahd->qoutfifonext); 864 ahd_dump_card_state(ahd); 865 - } else 866 - ahd_complete_scb(ahd, scb); 867 868 ahd->qoutfifonext = (ahd->qoutfifonext+1) & (AHD_QOUT_SIZE-1); 869 if (ahd->qoutfifonext == 0) 870 - ahd->qoutfifonext_valid_tag ^= QOUTFIFO_ENTRY_VALID_LE; 871 } 872 ahd->flags &= ~AHD_RUNNING_QOUTFIFO; 873 } ··· 936 ahd_name(ahd), seqintcode); 937 #endif 938 switch (seqintcode) { 939 - case BAD_SCB_STATUS: 940 - { 941 - struct scb *scb; 942 - u_int scbid; 943 - int cmds_pending; 944 - 945 - scbid = ahd_get_scbptr(ahd); 946 - scb = ahd_lookup_scb(ahd, scbid); 947 - if (scb != NULL) { 948 - ahd_complete_scb(ahd, scb); 949 - } else { 950 - printf("%s: WARNING no command for scb %d " 951 - "(bad status)\n", ahd_name(ahd), scbid); 952 - ahd_dump_card_state(ahd); 953 - } 954 - cmds_pending = ahd_inw(ahd, CMDS_PENDING); 955 - if (cmds_pending > 0) 956 - ahd_outw(ahd, CMDS_PENDING, cmds_pending - 1); 957 - break; 958 - } 959 case ENTERING_NONPACK: 960 { 961 struct scb *scb; ··· 1100 ahd_outb(ahd, SAVED_LUN, 0); 1101 ahd_outb(ahd, SEQ_FLAGS, 0); 1102 ahd_assert_atn(ahd); 1103 - scb->flags &= ~(SCB_PACKETIZED); 1104 scb->flags |= SCB_ABORT|SCB_CMDPHASE_ABORT; 1105 ahd_freeze_devq(ahd, scb); 1106 ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); ··· 1543 && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) != 0) 1544 scb = NULL; 1545 1546 - /* Make sure the sequencer is in a safe location. */ 1547 - ahd_clear_critical_section(ahd); 1548 - 1549 if ((status0 & IOERR) != 0) { 1550 u_int now_lvd; 1551 ··· 1558 ahd_setup_iocell_workaround(ahd); 1559 ahd_unpause(ahd); 1560 } else if ((status0 & OVERRUN) != 0) { 1561 printf("%s: SCSI offset overrun detected. Resetting bus.\n", 1562 ahd_name(ahd)); 1563 ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); 1564 } else if ((status & SCSIRSTI) != 0) { 1565 printf("%s: Someone reset channel A\n", ahd_name(ahd)); 1566 ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE); 1567 } else if ((status & SCSIPERR) != 0) { 1568 ahd_handle_transmission_error(ahd); 1569 } else if (lqostat0 != 0) { 1570 printf("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0); 1571 ahd_outb(ahd, CLRLQOINT0, lqostat0); 1572 - if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) { 1573 ahd_outb(ahd, CLRLQOINT1, 0); 1574 - } 1575 } else if ((status & SELTO) != 0) { 1576 u_int scbid; 1577 1578 /* Stop the selection */ 1579 ahd_outb(ahd, SCSISEQ0, 0); 1580 1581 /* No more pending messages */ 1582 ahd_clear_msg_state(ahd); ··· 1619 scbid); 1620 } 1621 #endif 1622 - /* 1623 - * Force a renegotiation with this target just in 1624 - * case the cable was pulled and will later be 1625 - * re-attached. The target may forget its negotiation 1626 - * settings with us should it attempt to reselect 1627 - * during the interruption. The target will not issue 1628 - * a unit attention in this case, so we must always 1629 - * renegotiate. 1630 - */ 1631 ahd_scb_devinfo(ahd, &devinfo, scb); 1632 - ahd_force_renegotiation(ahd, &devinfo); 1633 ahd_set_transaction_status(scb, CAM_SEL_TIMEOUT); 1634 ahd_freeze_devq(ahd, scb); 1635 } 1636 ahd_outb(ahd, CLRINT, CLRSCSIINT); 1637 ahd_iocell_first_selection(ahd); 1638 ahd_unpause(ahd); 1639 } else if ((status0 & (SELDI|SELDO)) != 0) { 1640 ahd_iocell_first_selection(ahd); 1641 ahd_unpause(ahd); 1642 } else if (status3 != 0) { ··· 1647 ahd_name(ahd), status3); 1648 ahd_outb(ahd, CLRSINT3, status3); 1649 } else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) { 1650 ahd_handle_lqiphase_error(ahd, lqistat1); 1651 } else if ((lqistat1 & LQICRCI_NLQ) != 0) { 1652 /* ··· 1674 * go about selecting the target while we handle the event. 1675 */ 1676 ahd_outb(ahd, SCSISEQ0, 0); 1677 1678 /* 1679 * Determine what we were up to at the time of ··· 1715 clear_fifo = 0; 1716 packetized = (lqostat1 & LQOBUSFREE) != 0; 1717 if (!packetized 1718 - && ahd_inb(ahd, LASTPHASE) == P_BUSFREE) 1719 packetized = 1; 1720 break; 1721 } ··· 2375 "PRGMCNT == 0x%x\n", 2376 ahd_lookup_phase_entry(lastphase)->phasemsg, 2377 aborted, 2378 - ahd_inb(ahd, PRGMCNT) 2379 - | (ahd_inb(ahd, PRGMCNT+1) << 8)); 2380 ahd_dump_card_state(ahd); 2381 } 2382 /* Always restart the sequencer. */ ··· 2538 u_int i; 2539 2540 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 2541 - seqaddr = ahd_inb(ahd, CURADDR) 2542 - | (ahd_inb(ahd, CURADDR+1) << 8); 2543 2544 cs = ahd->critical_sections; 2545 for (i = 0; i < ahd->num_critical_sections; i++, cs++) { ··· 3259 iocell_opts[AHD_PRECOMP_SLEW_INDEX] &= ~AHD_PRECOMP_MASK; 3260 3261 if ((ahd->features & AHD_NEW_IOCELL_OPTS) != 0 3262 - && (ppr_opts & MSG_EXT_PPR_DT_REQ) != 0) { 3263 /* 3264 * Slow down our CRC interval to be 3265 - * compatible with devices that can't 3266 - * handle a CRC at full speed. 3267 */ 3268 con_opts |= ENSLOWCRC; 3269 } 3270 } 3271 ··· 3366 * Force the sequencer to reinitialize the selection for 3367 * the command at the head of the execution queue if it 3368 * has already been setup. The negotiation changes may 3369 - * effect whether we select-out with ATN. 3370 */ 3371 saved_modes = ahd_save_modes(ahd); 3372 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 3373 - ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); 3374 saved_scbptr = ahd_get_scbptr(ahd); 3375 /* Ensure that the hscbs down on the card match the new information */ 3376 for (scb_tag = 0; scb_tag < ahd->scb_data.maxhscbs; scb_tag++) { ··· 4987 * Determine initial values for data_addr and data_cnt 4988 * for resuming the data phase. 4989 */ 4990 - sgptr = (ahd_inb_scbram(ahd, SCB_RESIDUAL_SGPTR + 3) << 24) 4991 - | (ahd_inb_scbram(ahd, SCB_RESIDUAL_SGPTR + 2) << 16) 4992 - | (ahd_inb_scbram(ahd, SCB_RESIDUAL_SGPTR + 1) << 8) 4993 - | ahd_inb_scbram(ahd, SCB_RESIDUAL_SGPTR); 4994 sgptr &= SG_PTR_MASK; 4995 4996 resid = (ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT + 2) << 16) ··· 5005 dataptr = ahd_le64toh(sg->addr) 5006 + (ahd_le32toh(sg->len) & AHD_SG_LEN_MASK) 5007 - resid; 5008 - ahd_outb(ahd, HADDR + 7, dataptr >> 56); 5009 - ahd_outb(ahd, HADDR + 6, dataptr >> 48); 5010 - ahd_outb(ahd, HADDR + 5, dataptr >> 40); 5011 - ahd_outb(ahd, HADDR + 4, dataptr >> 32); 5012 } else { 5013 struct ahd_dma_seg *sg; 5014 ··· 5020 ahd_outb(ahd, HADDR + 4, 5021 (ahd_le32toh(sg->len) & ~AHD_SG_LEN_MASK) >> 24); 5022 } 5023 - ahd_outb(ahd, HADDR + 3, dataptr >> 24); 5024 - ahd_outb(ahd, HADDR + 2, dataptr >> 16); 5025 - ahd_outb(ahd, HADDR + 1, dataptr >> 8); 5026 - ahd_outb(ahd, HADDR, dataptr); 5027 ahd_outb(ahd, HCNT + 2, resid >> 16); 5028 ahd_outb(ahd, HCNT + 1, resid >> 8); 5029 ahd_outb(ahd, HCNT, resid); ··· 5080 ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT, 5081 AHD_TRANS_CUR, /*paused*/TRUE); 5082 ahd_set_syncrate(ahd, devinfo, /*period*/0, /*offset*/0, 5083 - /*ppr_options*/0, AHD_TRANS_CUR, /*paused*/TRUE); 5084 5085 - ahd_send_async(ahd, devinfo->channel, devinfo->target, 5086 - lun, AC_SENT_BDR, NULL); 5087 5088 - if (message != NULL 5089 - && (verbose_level <= bootverbose)) 5090 printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), 5091 message, devinfo->channel, devinfo->target, found); 5092 } ··· 5273 /* FALLTHROUGH */ 5274 case 4: 5275 ahd_dmamap_unload(ahd, ahd->shared_data_dmat, 5276 - ahd->shared_data_dmamap); 5277 /* FALLTHROUGH */ 5278 case 3: 5279 ahd_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo, 5280 - ahd->shared_data_dmamap); 5281 ahd_dmamap_destroy(ahd, ahd->shared_data_dmat, 5282 - ahd->shared_data_dmamap); 5283 /* FALLTHROUGH */ 5284 case 2: 5285 ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat); ··· 6045 newcount = MIN(scb_data->sense_left, scb_data->scbs_left); 6046 newcount = MIN(newcount, scb_data->sgs_left); 6047 newcount = MIN(newcount, (AHD_SCB_MAX_ALLOC - scb_data->numscbs)); 6048 - scb_data->sense_left -= newcount; 6049 - scb_data->scbs_left -= newcount; 6050 - scb_data->sgs_left -= newcount; 6051 for (i = 0; i < newcount; i++) { 6052 - u_int col_tag; 6053 - 6054 struct scb_platform_data *pdata; 6055 #ifndef __linux__ 6056 int error; 6057 #endif 6058 next_scb = (struct scb *)malloc(sizeof(*next_scb), 6059 M_DEVBUF, M_NOWAIT); 6060 if (next_scb == NULL) ··· 6108 sense_data += AHD_SENSE_BUFSIZE; 6109 sense_busaddr += AHD_SENSE_BUFSIZE; 6110 scb_data->numscbs++; 6111 } 6112 } 6113 ··· 6158 int 6159 ahd_init(struct ahd_softc *ahd) 6160 { 6161 - uint8_t *base_vaddr; 6162 uint8_t *next_vaddr; 6163 dma_addr_t next_baddr; 6164 size_t driver_data_size; ··· 6225 * for the target mode role, we must additionally provide space for 6226 * the incoming target command fifo. 6227 */ 6228 - driver_data_size = AHD_SCB_MAX * sizeof(uint16_t) 6229 + sizeof(struct hardware_scb); 6230 if ((ahd->features & AHD_TARGETMODE) != 0) 6231 driver_data_size += AHD_TMODE_CMDS * sizeof(struct target_cmd); ··· 6247 6248 /* Allocation of driver data */ 6249 if (ahd_dmamem_alloc(ahd, ahd->shared_data_dmat, 6250 - (void **)&base_vaddr, 6251 - BUS_DMA_NOWAIT, &ahd->shared_data_dmamap) != 0) { 6252 return (ENOMEM); 6253 } 6254 6255 ahd->init_level++; 6256 6257 /* And permanently map it in */ 6258 - ahd_dmamap_load(ahd, ahd->shared_data_dmat, ahd->shared_data_dmamap, 6259 - base_vaddr, driver_data_size, ahd_dmamap_cb, 6260 - &ahd->shared_data_busaddr, /*flags*/0); 6261 - ahd->qoutfifo = (uint16_t *)base_vaddr; 6262 next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE]; 6263 - next_baddr = ahd->shared_data_busaddr + AHD_QOUT_SIZE*sizeof(uint16_t); 6264 if ((ahd->features & AHD_TARGETMODE) != 0) { 6265 ahd->targetcmds = (struct target_cmd *)next_vaddr; 6266 next_vaddr += AHD_TMODE_CMDS * sizeof(struct target_cmd); ··· 6284 * specially from the DMA safe memory chunk used for the QOUTFIFO. 6285 */ 6286 ahd->next_queued_hscb = (struct hardware_scb *)next_vaddr; 6287 ahd->next_queued_hscb->hscb_busaddr = ahd_htole32(next_baddr); 6288 6289 ahd->init_level++; ··· 6590 6591 /* All of our queues are empty */ 6592 ahd->qoutfifonext = 0; 6593 - ahd->qoutfifonext_valid_tag = QOUTFIFO_ENTRY_VALID_LE; 6594 - ahd_outb(ahd, QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID >> 8); 6595 for (i = 0; i < AHD_QOUT_SIZE; i++) 6596 - ahd->qoutfifo[i] = 0; 6597 ahd_sync_qoutfifo(ahd, BUS_DMASYNC_PREREAD); 6598 6599 ahd->qinfifonext = 0; ··· 6626 ahd_outw(ahd, COMPLETE_SCB_HEAD, SCB_LIST_NULL); 6627 ahd_outw(ahd, COMPLETE_SCB_DMAINPROG_HEAD, SCB_LIST_NULL); 6628 ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, SCB_LIST_NULL); 6629 6630 /* 6631 * The Freeze Count is 0. 6632 */ 6633 ahd_outw(ahd, QFREEZE_COUNT, 0); 6634 6635 /* 6636 * Tell the sequencer where it can find our arrays in memory. 6637 */ 6638 - busaddr = ahd->shared_data_busaddr; 6639 - ahd_outb(ahd, SHARED_DATA_ADDR, busaddr & 0xFF); 6640 - ahd_outb(ahd, SHARED_DATA_ADDR + 1, (busaddr >> 8) & 0xFF); 6641 - ahd_outb(ahd, SHARED_DATA_ADDR + 2, (busaddr >> 16) & 0xFF); 6642 - ahd_outb(ahd, SHARED_DATA_ADDR + 3, (busaddr >> 24) & 0xFF); 6643 - ahd_outb(ahd, QOUTFIFO_NEXT_ADDR, busaddr & 0xFF); 6644 - ahd_outb(ahd, QOUTFIFO_NEXT_ADDR + 1, (busaddr >> 8) & 0xFF); 6645 - ahd_outb(ahd, QOUTFIFO_NEXT_ADDR + 2, (busaddr >> 16) & 0xFF); 6646 - ahd_outb(ahd, QOUTFIFO_NEXT_ADDR + 3, (busaddr >> 24) & 0xFF); 6647 6648 /* 6649 * Setup the allowed SCSI Sequences based on operational mode. ··· 6690 * Tell the sequencer which SCB will be the next one it receives. 6691 */ 6692 busaddr = ahd_le32toh(ahd->next_queued_hscb->hscb_busaddr); 6693 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 0, busaddr & 0xFF); 6694 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 1, (busaddr >> 8) & 0xFF); 6695 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 2, (busaddr >> 16) & 0xFF); 6696 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 3, (busaddr >> 24) & 0xFF); 6697 6698 /* 6699 * Default to coalescing disabled. ··· 6994 { 6995 u_int intstat; 6996 u_int maxloops; 6997 - u_int qfreeze_cnt; 6998 6999 maxloops = 1000; 7000 ahd->flags |= AHD_ALL_INTERRUPTS; 7001 ahd_pause(ahd); 7002 /* 7003 - * Increment the QFreeze Count so that the sequencer 7004 - * will not start new selections. We do this only 7005 * until we are safely paused without further selections 7006 * pending. 7007 */ 7008 - ahd_outw(ahd, QFREEZE_COUNT, ahd_inw(ahd, QFREEZE_COUNT) + 1); 7009 ahd_outb(ahd, SEQ_FLAGS2, ahd_inb(ahd, SEQ_FLAGS2) | SELECTOUT_QFROZEN); 7010 do { 7011 - struct scb *waiting_scb; 7012 7013 ahd_unpause(ahd); 7014 ahd_intr(ahd); 7015 ahd_pause(ahd); 7016 - ahd_clear_critical_section(ahd); 7017 intstat = ahd_inb(ahd, INTSTAT); 7018 - ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 7019 - if ((ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) == 0) 7020 - ahd_outb(ahd, SCSISEQ0, 7021 - ahd_inb(ahd, SCSISEQ0) & ~ENSELO); 7022 - /* 7023 - * In the non-packetized case, the sequencer (for Rev A), 7024 - * relies on ENSELO remaining set after SELDO. The hardware 7025 - * auto-clears ENSELO in the packetized case. 7026 - */ 7027 - waiting_scb = ahd_lookup_scb(ahd, 7028 - ahd_inw(ahd, WAITING_TID_HEAD)); 7029 - if (waiting_scb != NULL 7030 - && (waiting_scb->flags & SCB_PACKETIZED) == 0 7031 - && (ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) != 0) 7032 - ahd_outb(ahd, SCSISEQ0, 7033 - ahd_inb(ahd, SCSISEQ0) | ENSELO); 7034 } while (--maxloops 7035 && (intstat != 0xFF || (ahd->features & AHD_REMOVABLE) == 0) 7036 && ((intstat & INT_PEND) != 0 ··· 7032 printf("Infinite interrupt loop, INTSTAT = %x", 7033 ahd_inb(ahd, INTSTAT)); 7034 } 7035 - qfreeze_cnt = ahd_inw(ahd, QFREEZE_COUNT); 7036 - if (qfreeze_cnt == 0) { 7037 - printf("%s: ahd_pause_and_flushwork with 0 qfreeze count!\n", 7038 - ahd_name(ahd)); 7039 - } else { 7040 - qfreeze_cnt--; 7041 - } 7042 - ahd_outw(ahd, QFREEZE_COUNT, qfreeze_cnt); 7043 - if (qfreeze_cnt == 0) 7044 - ahd_outb(ahd, SEQ_FLAGS2, 7045 - ahd_inb(ahd, SEQ_FLAGS2) & ~SELECTOUT_QFROZEN); 7046 7047 ahd_flush_qoutfifo(ahd); 7048 ··· 7205 uint32_t busaddr; 7206 7207 busaddr = ahd_le32toh(scb->hscb->hscb_busaddr); 7208 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 0, busaddr & 0xFF); 7209 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 1, (busaddr >> 8) & 0xFF); 7210 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 2, (busaddr >> 16) & 0xFF); 7211 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 3, (busaddr >> 24) & 0xFF); 7212 } else { 7213 prev_scb->hscb->next_hscb_busaddr = scb->hscb->hscb_busaddr; 7214 ahd_sync_scb(ahd, prev_scb, ··· 7312 */ 7313 ahd->qinfifonext = qinstart; 7314 busaddr = ahd_le32toh(ahd->next_queued_hscb->hscb_busaddr); 7315 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 0, busaddr & 0xFF); 7316 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 1, (busaddr >> 8) & 0xFF); 7317 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 2, (busaddr >> 16) & 0xFF); 7318 - ahd_outb(ahd, NEXT_QUEUED_SCB_ADDR + 3, (busaddr >> 24) & 0xFF); 7319 7320 while (qinpos != qintail) { 7321 scb = ahd_lookup_scb(ahd, ahd->qinfifo[qinpos]); ··· 7374 * appropriate, traverse the SCBs of each "their id" 7375 * looking for matches. 7376 */ 7377 savedscbptr = ahd_get_scbptr(ahd); 7378 tid_next = ahd_inw(ahd, WAITING_TID_HEAD); 7379 tid_prev = SCB_LIST_NULL; ··· 7444 u_int prev; 7445 int found; 7446 7447 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 7448 found = 0; 7449 prev = SCB_LIST_NULL; 7450 next = *list_head; ··· 7511 ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev, 7512 u_int tid_cur, u_int tid_next) 7513 { 7514 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 7515 7516 if (SCBID_IS_NULL(tid_cur)) { 7517 ··· 7551 { 7552 u_int tail_offset; 7553 7554 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 7555 if (!SCBID_IS_NULL(prev)) { 7556 ahd_set_scbptr(ahd, prev); 7557 ahd_outw(ahd, SCB_NEXT, next); ··· 7784 */ 7785 ahd_clear_msg_state(ahd); 7786 ahd_outb(ahd, SIMODE1, 7787 - ahd_inb(ahd, SIMODE1) & ~(ENBUSFREE|ENSCSIRST|ENBUSFREE)); 7788 7789 if (initiate_reset) 7790 ahd_reset_current_bus(ahd); ··· 7955 void 7956 ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) 7957 { 7958 - struct hardware_scb *hscb; 7959 - u_int qfreeze_cnt; 7960 7961 /* 7962 * The sequencer freezes its select-out queue 7963 * anytime a SCSI status error occurs. We must 7964 - * handle the error and decrement the QFREEZE count 7965 - * to allow the sequencer to continue. 7966 */ 7967 hscb = scb->hscb; 7968 7969 /* Freeze the queue until the client sees the error. */ 7970 ahd_freeze_devq(ahd, scb); 7971 ahd_freeze_scb(scb); 7972 - qfreeze_cnt = ahd_inw(ahd, QFREEZE_COUNT); 7973 - if (qfreeze_cnt == 0) { 7974 - printf("%s: Bad status with 0 qfreeze count!\n", ahd_name(ahd)); 7975 - } else { 7976 - qfreeze_cnt--; 7977 - ahd_outw(ahd, QFREEZE_COUNT, qfreeze_cnt); 7978 - } 7979 - if (qfreeze_cnt == 0) 7980 - ahd_outb(ahd, SEQ_FLAGS2, 7981 - ahd_inb(ahd, SEQ_FLAGS2) & ~SELECTOUT_QFROZEN); 7982 7983 /* Don't want to clobber the original sense code */ 7984 if ((scb->flags & SCB_SENSE) != 0) { ··· 8367 max_prog = 2048; 8368 8369 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM); 8370 - ahd_outb(ahd, PRGMCNT, 0); 8371 - ahd_outb(ahd, PRGMCNT+1, 0); 8372 for (i = 0; i < max_prog; i++) { 8373 uint8_t ins_bytes[4]; 8374 ··· 8396 u_int sg_prefetch_cnt_limit; 8397 u_int sg_prefetch_align; 8398 u_int sg_size; 8399 uint8_t download_consts[DOWNLOAD_CONST_COUNT]; 8400 8401 if (bootverbose) 8402 printf("%s: Downloading Sequencer Program...", 8403 ahd_name(ahd)); 8404 8405 - #if DOWNLOAD_CONST_COUNT != 7 8406 #error "Download Const Mismatch" 8407 #endif 8408 /* ··· 8439 /* Round down to the nearest power of 2. */ 8440 while (powerof2(sg_prefetch_align) == 0) 8441 sg_prefetch_align--; 8442 /* 8443 * If the cacheline boundary is greater than half our prefetch RAM 8444 * we risk not being able to fetch even a single complete S/G ··· 8482 download_consts[PKT_OVERRUN_BUFOFFSET] = 8483 (ahd->overrun_buf - (uint8_t *)ahd->qoutfifo) / 256; 8484 download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_1BYTE_LUN; 8485 cur_patch = patches; 8486 downloaded = 0; 8487 skip_addr = 0; 8488 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM); 8489 - ahd_outb(ahd, PRGMCNT, 0); 8490 - ahd_outb(ahd, PRGMCNT+1, 0); 8491 8492 for (i = 0; i < sizeof(seqprog)/4; i++) { 8493 if (ahd_check_patch(ahd, &cur_patch, i, &skip_addr) == 0) { ··· 8780 printf(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" 8781 "%s: Dumping Card State at program address 0x%x Mode 0x%x\n", 8782 ahd_name(ahd), 8783 - ahd_inb(ahd, CURADDR) | (ahd_inb(ahd, CURADDR+1) << 8), 8784 ahd_build_mode_state(ahd, ahd->saved_src_mode, 8785 ahd->saved_dst_mode)); 8786 if (paused) ··· 8889 8890 printf("Sequencer DMA-Up and Complete list: "); 8891 scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD); 8892 i = 0; 8893 while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { 8894 ahd_set_scbptr(ahd, scb_index); ··· 9139 { 9140 int cnt; 9141 9142 - cnt = 20; 9143 while ((ahd_inb(ahd, SEESTAT) & (SEEARBACK|SEEBUSY)) != 0 && --cnt) 9144 ahd_delay(5); 9145 ··· 9485 if ((ahd->features & AHD_MULTI_TID) != 0) { 9486 u_int targid_mask; 9487 9488 - targid_mask = ahd_inb(ahd, TARGID) 9489 - | (ahd_inb(ahd, TARGID + 1) << 8); 9490 - 9491 targid_mask |= target_mask; 9492 - ahd_outb(ahd, TARGID, targid_mask); 9493 - ahd_outb(ahd, TARGID+1, (targid_mask >> 8)); 9494 - 9495 ahd_update_scsiid(ahd, targid_mask); 9496 } else { 9497 u_int our_id; ··· 9601 if (ahd->features & AHD_MULTI_TID) { 9602 u_int targid_mask; 9603 9604 - targid_mask = ahd_inb(ahd, TARGID) 9605 - | (ahd_inb(ahd, TARGID + 1) 9606 - << 8); 9607 - 9608 targid_mask &= ~target_mask; 9609 - ahd_outb(ahd, TARGID, targid_mask); 9610 - ahd_outb(ahd, TARGID+1, 9611 - (targid_mask >> 8)); 9612 ahd_update_scsiid(ahd, targid_mask); 9613 } 9614 } ··· 9704 9705 cmd->cmd_valid = 0; 9706 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 9707 - ahd->shared_data_dmamap, 9708 ahd_targetcmd_offset(ahd, ahd->tqinfifonext), 9709 sizeof(struct target_cmd), 9710 BUS_DMASYNC_PREREAD);
··· 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGES. 39 * 40 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#247 $ 41 */ 42 43 #ifdef __linux__ ··· 332 ahd_outb(ahd, SCSISEQ1, 333 ahd_inb(ahd, SCSISEQ_TEMPLATE) & (ENSELI|ENRSELI|ENAUTOATNP)); 334 ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN); 335 + 336 + /* 337 + * Clear any pending sequencer interrupt. It is no 338 + * longer relevant since we're resetting the Program 339 + * Counter. 340 + */ 341 + ahd_outb(ahd, CLRINT, CLRSEQINT); 342 + 343 ahd_outb(ahd, SEQCTL0, FASTMODE|SEQRESET); 344 ahd_unpause(ahd); 345 } ··· 373 saved_modes = ahd_save_modes(ahd); 374 375 /* 376 + * Flush the good status FIFO for completed packetized commands. 377 */ 378 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 379 saved_scbptr = ahd_get_scbptr(ahd); ··· 387 u_int fifo_mode; 388 u_int i; 389 390 + scbid = ahd_inw(ahd, GSFIFO); 391 scb = ahd_lookup_scb(ahd, scbid); 392 if (scb == NULL) { 393 printf("%s: Warning - GSFIFO SCB %d invalid\n", ··· 401 * the host before completing the command. 402 */ 403 fifo_mode = 0; 404 + rescan_fifos: 405 for (i = 0; i < 2; i++) { 406 /* Toggle to the other mode. */ 407 fifo_mode ^= 1; 408 ahd_set_modes(ahd, fifo_mode, fifo_mode); 409 + 410 if (ahd_scb_active_in_fifo(ahd, scb) == 0) 411 continue; 412 413 ahd_run_data_fifo(ahd, scb); 414 415 /* 416 + * Running this FIFO may cause a CFG4DATA for 417 + * this same transaction to assert in the other 418 + * FIFO or a new snapshot SAVEPTRS interrupt 419 + * in this FIFO. Even running a FIFO may not 420 + * clear the transaction if we are still waiting 421 + * for data to drain to the host. We must loop 422 + * until the transaction is not active in either 423 + * FIFO just to be sure. Reset our loop counter 424 + * so we will visit both FIFOs again before 425 + * declaring this transaction finished. We 426 + * also delay a bit so that status has a chance 427 + * to change before we look at this FIFO again. 428 */ 429 + ahd_delay(200); 430 + goto rescan_fifos; 431 } 432 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 433 ahd_set_scbptr(ahd, scbid); ··· 429 /* 430 * The transfer completed with a residual. 431 * Place this SCB on the complete DMA list 432 + * so that we update our in-core copy of the 433 * SCB before completing the command. 434 */ 435 ahd_outb(ahd, SCB_SCSI_STATUS, 0); 436 ahd_outb(ahd, SCB_SGPTR, 437 ahd_inb_scbram(ahd, SCB_SGPTR) 438 | SG_STATUS_VALID); 439 + ahd_outw(ahd, SCB_TAG, scbid); 440 + ahd_outw(ahd, SCB_NEXT_COMPLETE, SCB_LIST_NULL); 441 comp_head = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD); 442 + if (SCBID_IS_NULL(comp_head)) { 443 + ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, scbid); 444 + ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, scbid); 445 + } else { 446 + u_int tail; 447 + 448 + tail = ahd_inw(ahd, COMPLETE_DMA_SCB_TAIL); 449 + ahd_set_scbptr(ahd, tail); 450 + ahd_outw(ahd, SCB_NEXT_COMPLETE, scbid); 451 + ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, scbid); 452 + ahd_set_scbptr(ahd, scbid); 453 + } 454 } else 455 ahd_complete_scb(ahd, scb); 456 } ··· 465 break; 466 ahd_delay(200); 467 } 468 + /* 469 + * We leave the sequencer to cleanup in the case of DMA's to 470 + * update the qoutfifo. In all other cases (DMA's to the 471 + * chip or a push of an SCB from the COMPLETE_DMA_SCB list), 472 + * we disable the DMA engine so that the sequencer will not 473 + * attempt to handle the DMA completion. 474 + */ 475 + if ((ccscbctl & CCSCBDIR) != 0 || (ccscbctl & ARRDONE) != 0) 476 ahd_outb(ahd, CCSCBCTL, ccscbctl & ~(CCARREN|CCSCBEN)); 477 + 478 + /* 479 + * Complete any SCBs that just finished 480 + * being DMA'ed into the qoutfifo. 481 + */ 482 + ahd_run_qoutfifo(ahd); 483 484 saved_scbptr = ahd_get_scbptr(ahd); 485 /* ··· 494 scbid = next_scbid; 495 } 496 ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, SCB_LIST_NULL); 497 + ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, SCB_LIST_NULL); 498 + 499 + scbid = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD); 500 + while (!SCBID_IS_NULL(scbid)) { 501 + 502 + ahd_set_scbptr(ahd, scbid); 503 + next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); 504 + scb = ahd_lookup_scb(ahd, scbid); 505 + if (scb == NULL) { 506 + printf("%s: Warning - Complete Qfrz SCB %d invalid\n", 507 + ahd_name(ahd), scbid); 508 + continue; 509 + } 510 + 511 + ahd_complete_scb(ahd, scb); 512 + scbid = next_scbid; 513 + } 514 + ahd_outw(ahd, COMPLETE_ON_QFREEZE_HEAD, SCB_LIST_NULL); 515 516 scbid = ahd_inw(ahd, COMPLETE_SCB_HEAD); 517 while (!SCBID_IS_NULL(scbid)) { ··· 558 { 559 u_int seqintsrc; 560 561 + seqintsrc = ahd_inb(ahd, SEQINTSRC); 562 + if ((seqintsrc & CFG4DATA) != 0) { 563 + uint32_t datacnt; 564 + uint32_t sgptr; 565 566 + /* 567 + * Clear full residual flag. 568 + */ 569 + sgptr = ahd_inl_scbram(ahd, SCB_SGPTR) & ~SG_FULL_RESID; 570 + ahd_outb(ahd, SCB_SGPTR, sgptr); 571 572 + /* 573 + * Load datacnt and address. 574 + */ 575 + datacnt = ahd_inl_scbram(ahd, SCB_DATACNT); 576 + if ((datacnt & AHD_DMA_LAST_SEG) != 0) { 577 + sgptr |= LAST_SEG; 578 ahd_outb(ahd, SG_STATE, 0); 579 + } else 580 + ahd_outb(ahd, SG_STATE, LOADING_NEEDED); 581 + ahd_outq(ahd, HADDR, ahd_inq_scbram(ahd, SCB_DATAPTR)); 582 + ahd_outl(ahd, HCNT, datacnt & AHD_SG_LEN_MASK); 583 + ahd_outb(ahd, SG_CACHE_PRE, sgptr); 584 + ahd_outb(ahd, DFCNTRL, PRELOADEN|SCSIEN|HDMAEN); 585 586 + /* 587 + * Initialize Residual Fields. 588 + */ 589 + ahd_outb(ahd, SCB_RESIDUAL_DATACNT+3, datacnt >> 24); 590 + ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr & SG_PTR_MASK); 591 592 + /* 593 + * Mark the SCB as having a FIFO in use. 594 + */ 595 + ahd_outb(ahd, SCB_FIFO_USE_COUNT, 596 + ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT) + 1); 597 598 + /* 599 + * Install a "fake" handler for this FIFO. 600 + */ 601 + ahd_outw(ahd, LONGJMP_ADDR, 0); 602 603 + /* 604 + * Notify the hardware that we have satisfied 605 + * this sequencer interrupt. 606 + */ 607 + ahd_outb(ahd, CLRSEQINTSRC, CLRCFG4DATA); 608 + } else if ((seqintsrc & SAVEPTRS) != 0) { 609 + uint32_t sgptr; 610 + uint32_t resid; 611 + 612 + if ((ahd_inb(ahd, LONGJMP_ADDR+1)&INVALID_ADDR) != 0) { 613 /* 614 + * Snapshot Save Pointers. All that 615 + * is necessary to clear the snapshot 616 + * is a CLRCHN. 617 */ 618 + goto clrchn; 619 + } 620 + 621 + /* 622 + * Disable S/G fetch so the DMA engine 623 + * is available to future users. 624 + */ 625 + if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0) 626 + ahd_outb(ahd, CCSGCTL, 0); 627 + ahd_outb(ahd, SG_STATE, 0); 628 + 629 + /* 630 + * Flush the data FIFO. Strickly only 631 + * necessary for Rev A parts. 632 + */ 633 + ahd_outb(ahd, DFCNTRL, ahd_inb(ahd, DFCNTRL) | FIFOFLUSH); 634 + 635 + /* 636 + * Calculate residual. 637 + */ 638 + sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR); 639 + resid = ahd_inl(ahd, SHCNT); 640 + resid |= ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT+3) << 24; 641 + ahd_outl(ahd, SCB_RESIDUAL_DATACNT, resid); 642 + if ((ahd_inb(ahd, SG_CACHE_SHADOW) & LAST_SEG) == 0) { 643 + /* 644 + * Must back up to the correct S/G element. 645 + * Typically this just means resetting our 646 + * low byte to the offset in the SG_CACHE, 647 + * but if we wrapped, we have to correct 648 + * the other bytes of the sgptr too. 649 + */ 650 + if ((ahd_inb(ahd, SG_CACHE_SHADOW) & 0x80) != 0 651 + && (sgptr & 0x80) == 0) 652 + sgptr -= 0x100; 653 + sgptr &= ~0xFF; 654 + sgptr |= ahd_inb(ahd, SG_CACHE_SHADOW) 655 + & SG_ADDR_MASK; 656 + ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr); 657 + ahd_outb(ahd, SCB_RESIDUAL_DATACNT + 3, 0); 658 + } else if ((resid & AHD_SG_LEN_MASK) == 0) { 659 + ahd_outb(ahd, SCB_RESIDUAL_SGPTR, 660 + sgptr | SG_LIST_NULL); 661 + } 662 + /* 663 + * Save Pointers. 664 + */ 665 + ahd_outq(ahd, SCB_DATAPTR, ahd_inq(ahd, SHADDR)); 666 + ahd_outl(ahd, SCB_DATACNT, resid); 667 + ahd_outl(ahd, SCB_SGPTR, sgptr); 668 + ahd_outb(ahd, CLRSEQINTSRC, CLRSAVEPTRS); 669 + ahd_outb(ahd, SEQIMODE, 670 + ahd_inb(ahd, SEQIMODE) | ENSAVEPTRS); 671 + /* 672 + * If the data is to the SCSI bus, we are 673 + * done, otherwise wait for FIFOEMP. 674 + */ 675 + if ((ahd_inb(ahd, DFCNTRL) & DIRECTION) != 0) 676 + goto clrchn; 677 + } else if ((ahd_inb(ahd, SG_STATE) & LOADING_NEEDED) != 0) { 678 + uint32_t sgptr; 679 + uint64_t data_addr; 680 + uint32_t data_len; 681 + u_int dfcntrl; 682 + 683 + /* 684 + * Disable S/G fetch so the DMA engine 685 + * is available to future users. We won't 686 + * be using the DMA engine to load segments. 687 + */ 688 + if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0) { 689 + ahd_outb(ahd, CCSGCTL, 0); 690 + ahd_outb(ahd, SG_STATE, LOADING_NEEDED); 691 + } 692 + 693 + /* 694 + * Wait for the DMA engine to notice that the 695 + * host transfer is enabled and that there is 696 + * space in the S/G FIFO for new segments before 697 + * loading more segments. 698 + */ 699 + if ((ahd_inb(ahd, DFSTATUS) & PRELOAD_AVAIL) != 0 700 + && (ahd_inb(ahd, DFCNTRL) & HDMAENACK) != 0) { 701 702 /* 703 * Determine the offset of the next S/G ··· 748 * Advertise the segment to the hardware. 749 */ 750 dfcntrl = ahd_inb(ahd, DFCNTRL)|PRELOADEN|HDMAEN; 751 + if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0) { 752 /* 753 * Use SCSIENWRDIS so that SCSIEN 754 * is never modified by this ··· 757 dfcntrl |= SCSIENWRDIS; 758 } 759 ahd_outb(ahd, DFCNTRL, dfcntrl); 760 } 761 + } else if ((ahd_inb(ahd, SG_CACHE_SHADOW) & LAST_SEG_DONE) != 0) { 762 + 763 + /* 764 + * Transfer completed to the end of SG list 765 + * and has flushed to the host. 766 + */ 767 + ahd_outb(ahd, SCB_SGPTR, 768 + ahd_inb_scbram(ahd, SCB_SGPTR) | SG_LIST_NULL); 769 + goto clrchn; 770 + } else if ((ahd_inb(ahd, DFSTATUS) & FIFOEMP) != 0) { 771 + clrchn: 772 + /* 773 + * Clear any handler for this FIFO, decrement 774 + * the FIFO use count for the SCB, and release 775 + * the FIFO. 776 + */ 777 + ahd_outb(ahd, LONGJMP_ADDR + 1, INVALID_ADDR); 778 + ahd_outb(ahd, SCB_FIFO_USE_COUNT, 779 + ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT) - 1); 780 + ahd_outb(ahd, DFFSXFRCTL, CLRCHN); 781 } 782 } 783 784 + /* 785 + * Look for entries in the QoutFIFO that have completed. 786 + * The valid_tag completion field indicates the validity 787 + * of the entry - the valid value toggles each time through 788 + * the queue. We use the sg_status field in the completion 789 + * entry to avoid referencing the hscb if the completion 790 + * occurred with no errors and no residual. sg_status is 791 + * a copy of the first byte (little endian) of the sgptr 792 + * hscb field. 793 + */ 794 void 795 ahd_run_qoutfifo(struct ahd_softc *ahd) 796 { 797 + struct ahd_completion *completion; 798 struct scb *scb; 799 u_int scb_index; 800 ··· 793 panic("ahd_run_qoutfifo recursion"); 794 ahd->flags |= AHD_RUNNING_QOUTFIFO; 795 ahd_sync_qoutfifo(ahd, BUS_DMASYNC_POSTREAD); 796 + for (;;) { 797 + completion = &ahd->qoutfifo[ahd->qoutfifonext]; 798 799 + if (completion->valid_tag != ahd->qoutfifonext_valid_tag) 800 + break; 801 + 802 + scb_index = ahd_le16toh(completion->tag); 803 scb = ahd_lookup_scb(ahd, scb_index); 804 if (scb == NULL) { 805 printf("%s: WARNING no command for scb %d " ··· 805 ahd_name(ahd), scb_index, 806 ahd->qoutfifonext); 807 ahd_dump_card_state(ahd); 808 + } else if ((completion->sg_status & SG_STATUS_VALID) != 0) { 809 + ahd_handle_scb_status(ahd, scb); 810 + } else { 811 + ahd_done(ahd, scb); 812 + } 813 814 ahd->qoutfifonext = (ahd->qoutfifonext+1) & (AHD_QOUT_SIZE-1); 815 if (ahd->qoutfifonext == 0) 816 + ahd->qoutfifonext_valid_tag ^= QOUTFIFO_ENTRY_VALID; 817 } 818 ahd->flags &= ~AHD_RUNNING_QOUTFIFO; 819 } ··· 876 ahd_name(ahd), seqintcode); 877 #endif 878 switch (seqintcode) { 879 case ENTERING_NONPACK: 880 { 881 struct scb *scb; ··· 1060 ahd_outb(ahd, SAVED_LUN, 0); 1061 ahd_outb(ahd, SEQ_FLAGS, 0); 1062 ahd_assert_atn(ahd); 1063 + scb->flags &= ~SCB_PACKETIZED; 1064 scb->flags |= SCB_ABORT|SCB_CMDPHASE_ABORT; 1065 ahd_freeze_devq(ahd, scb); 1066 ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); ··· 1503 && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) != 0) 1504 scb = NULL; 1505 1506 if ((status0 & IOERR) != 0) { 1507 u_int now_lvd; 1508 ··· 1521 ahd_setup_iocell_workaround(ahd); 1522 ahd_unpause(ahd); 1523 } else if ((status0 & OVERRUN) != 0) { 1524 + 1525 printf("%s: SCSI offset overrun detected. Resetting bus.\n", 1526 ahd_name(ahd)); 1527 ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); 1528 } else if ((status & SCSIRSTI) != 0) { 1529 + 1530 printf("%s: Someone reset channel A\n", ahd_name(ahd)); 1531 ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE); 1532 } else if ((status & SCSIPERR) != 0) { 1533 + 1534 + /* Make sure the sequencer is in a safe location. */ 1535 + ahd_clear_critical_section(ahd); 1536 + 1537 ahd_handle_transmission_error(ahd); 1538 } else if (lqostat0 != 0) { 1539 + 1540 printf("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0); 1541 ahd_outb(ahd, CLRLQOINT0, lqostat0); 1542 + if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) 1543 ahd_outb(ahd, CLRLQOINT1, 0); 1544 } else if ((status & SELTO) != 0) { 1545 u_int scbid; 1546 1547 /* Stop the selection */ 1548 ahd_outb(ahd, SCSISEQ0, 0); 1549 + 1550 + /* Make sure the sequencer is in a safe location. */ 1551 + ahd_clear_critical_section(ahd); 1552 1553 /* No more pending messages */ 1554 ahd_clear_msg_state(ahd); ··· 1573 scbid); 1574 } 1575 #endif 1576 ahd_scb_devinfo(ahd, &devinfo, scb); 1577 ahd_set_transaction_status(scb, CAM_SEL_TIMEOUT); 1578 ahd_freeze_devq(ahd, scb); 1579 + 1580 + /* 1581 + * Cancel any pending transactions on the device 1582 + * now that it seems to be missing. This will 1583 + * also revert us to async/narrow transfers until 1584 + * we can renegotiate with the device. 1585 + */ 1586 + ahd_handle_devreset(ahd, &devinfo, 1587 + CAM_LUN_WILDCARD, 1588 + CAM_SEL_TIMEOUT, 1589 + "Selection Timeout", 1590 + /*verbose_level*/1); 1591 } 1592 ahd_outb(ahd, CLRINT, CLRSCSIINT); 1593 ahd_iocell_first_selection(ahd); 1594 ahd_unpause(ahd); 1595 } else if ((status0 & (SELDI|SELDO)) != 0) { 1596 + 1597 ahd_iocell_first_selection(ahd); 1598 ahd_unpause(ahd); 1599 } else if (status3 != 0) { ··· 1598 ahd_name(ahd), status3); 1599 ahd_outb(ahd, CLRSINT3, status3); 1600 } else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) { 1601 + 1602 + /* Make sure the sequencer is in a safe location. */ 1603 + ahd_clear_critical_section(ahd); 1604 + 1605 ahd_handle_lqiphase_error(ahd, lqistat1); 1606 } else if ((lqistat1 & LQICRCI_NLQ) != 0) { 1607 /* ··· 1621 * go about selecting the target while we handle the event. 1622 */ 1623 ahd_outb(ahd, SCSISEQ0, 0); 1624 + 1625 + /* Make sure the sequencer is in a safe location. */ 1626 + ahd_clear_critical_section(ahd); 1627 1628 /* 1629 * Determine what we were up to at the time of ··· 1659 clear_fifo = 0; 1660 packetized = (lqostat1 & LQOBUSFREE) != 0; 1661 if (!packetized 1662 + && ahd_inb(ahd, LASTPHASE) == P_BUSFREE 1663 + && (ahd_inb(ahd, SSTAT0) & SELDI) == 0 1664 + && ((ahd_inb(ahd, SSTAT0) & SELDO) == 0 1665 + || (ahd_inb(ahd, SCSISEQ0) & ENSELO) == 0)) 1666 + /* 1667 + * Assume packetized if we are not 1668 + * on the bus in a non-packetized 1669 + * capacity and any pending selection 1670 + * was a packetized selection. 1671 + */ 1672 packetized = 1; 1673 break; 1674 } ··· 2310 "PRGMCNT == 0x%x\n", 2311 ahd_lookup_phase_entry(lastphase)->phasemsg, 2312 aborted, 2313 + ahd_inw(ahd, PRGMCNT)); 2314 ahd_dump_card_state(ahd); 2315 } 2316 /* Always restart the sequencer. */ ··· 2474 u_int i; 2475 2476 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 2477 + seqaddr = ahd_inw(ahd, CURADDR); 2478 2479 cs = ahd->critical_sections; 2480 for (i = 0; i < ahd->num_critical_sections; i++, cs++) { ··· 3196 iocell_opts[AHD_PRECOMP_SLEW_INDEX] &= ~AHD_PRECOMP_MASK; 3197 3198 if ((ahd->features & AHD_NEW_IOCELL_OPTS) != 0 3199 + && (ppr_opts & MSG_EXT_PPR_DT_REQ) != 0 3200 + && (ppr_opts & MSG_EXT_PPR_IU_REQ) == 0) { 3201 /* 3202 * Slow down our CRC interval to be 3203 + * compatible with non-packetized 3204 + * U160 devices that can't handle a 3205 + * CRC at full speed. 3206 */ 3207 con_opts |= ENSLOWCRC; 3208 + } 3209 + 3210 + if ((ahd->bugs & AHD_PACED_NEGTABLE_BUG) != 0) { 3211 + /* 3212 + * On H2A4, revert to a slower slewrate 3213 + * on non-paced transfers. 3214 + */ 3215 + iocell_opts[AHD_PRECOMP_SLEW_INDEX] &= 3216 + ~AHD_SLEWRATE_MASK; 3217 } 3218 } 3219 ··· 3292 * Force the sequencer to reinitialize the selection for 3293 * the command at the head of the execution queue if it 3294 * has already been setup. The negotiation changes may 3295 + * effect whether we select-out with ATN. It is only 3296 + * safe to clear ENSELO when the bus is not free and no 3297 + * selection is in progres or completed. 3298 */ 3299 saved_modes = ahd_save_modes(ahd); 3300 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 3301 + if ((ahd_inb(ahd, SCSISIGI) & BSYI) != 0 3302 + && (ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) == 0) 3303 + ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); 3304 saved_scbptr = ahd_get_scbptr(ahd); 3305 /* Ensure that the hscbs down on the card match the new information */ 3306 for (scb_tag = 0; scb_tag < ahd->scb_data.maxhscbs; scb_tag++) { ··· 4909 * Determine initial values for data_addr and data_cnt 4910 * for resuming the data phase. 4911 */ 4912 + sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR); 4913 sgptr &= SG_PTR_MASK; 4914 4915 resid = (ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT + 2) << 16) ··· 4930 dataptr = ahd_le64toh(sg->addr) 4931 + (ahd_le32toh(sg->len) & AHD_SG_LEN_MASK) 4932 - resid; 4933 + ahd_outl(ahd, HADDR + 4, dataptr >> 32); 4934 } else { 4935 struct ahd_dma_seg *sg; 4936 ··· 4948 ahd_outb(ahd, HADDR + 4, 4949 (ahd_le32toh(sg->len) & ~AHD_SG_LEN_MASK) >> 24); 4950 } 4951 + ahd_outl(ahd, HADDR, dataptr); 4952 ahd_outb(ahd, HCNT + 2, resid >> 16); 4953 ahd_outb(ahd, HCNT + 1, resid >> 8); 4954 ahd_outb(ahd, HCNT, resid); ··· 5011 ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT, 5012 AHD_TRANS_CUR, /*paused*/TRUE); 5013 ahd_set_syncrate(ahd, devinfo, /*period*/0, /*offset*/0, 5014 + /*ppr_options*/0, AHD_TRANS_CUR, 5015 + /*paused*/TRUE); 5016 5017 + if (status != CAM_SEL_TIMEOUT) 5018 + ahd_send_async(ahd, devinfo->channel, devinfo->target, 5019 + CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); 5020 5021 + if (message != NULL && bootverbose) 5022 printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), 5023 message, devinfo->channel, devinfo->target, found); 5024 } ··· 5203 /* FALLTHROUGH */ 5204 case 4: 5205 ahd_dmamap_unload(ahd, ahd->shared_data_dmat, 5206 + ahd->shared_data_map.dmamap); 5207 /* FALLTHROUGH */ 5208 case 3: 5209 ahd_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo, 5210 + ahd->shared_data_map.dmamap); 5211 ahd_dmamap_destroy(ahd, ahd->shared_data_dmat, 5212 + ahd->shared_data_map.dmamap); 5213 /* FALLTHROUGH */ 5214 case 2: 5215 ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat); ··· 5975 newcount = MIN(scb_data->sense_left, scb_data->scbs_left); 5976 newcount = MIN(newcount, scb_data->sgs_left); 5977 newcount = MIN(newcount, (AHD_SCB_MAX_ALLOC - scb_data->numscbs)); 5978 for (i = 0; i < newcount; i++) { 5979 struct scb_platform_data *pdata; 5980 + u_int col_tag; 5981 #ifndef __linux__ 5982 int error; 5983 #endif 5984 + 5985 next_scb = (struct scb *)malloc(sizeof(*next_scb), 5986 M_DEVBUF, M_NOWAIT); 5987 if (next_scb == NULL) ··· 6041 sense_data += AHD_SENSE_BUFSIZE; 6042 sense_busaddr += AHD_SENSE_BUFSIZE; 6043 scb_data->numscbs++; 6044 + scb_data->sense_left--; 6045 + scb_data->scbs_left--; 6046 + scb_data->sgs_left--; 6047 } 6048 } 6049 ··· 6088 int 6089 ahd_init(struct ahd_softc *ahd) 6090 { 6091 uint8_t *next_vaddr; 6092 dma_addr_t next_baddr; 6093 size_t driver_data_size; ··· 6156 * for the target mode role, we must additionally provide space for 6157 * the incoming target command fifo. 6158 */ 6159 + driver_data_size = AHD_SCB_MAX * sizeof(*ahd->qoutfifo) 6160 + sizeof(struct hardware_scb); 6161 if ((ahd->features & AHD_TARGETMODE) != 0) 6162 driver_data_size += AHD_TMODE_CMDS * sizeof(struct target_cmd); ··· 6178 6179 /* Allocation of driver data */ 6180 if (ahd_dmamem_alloc(ahd, ahd->shared_data_dmat, 6181 + (void **)&ahd->shared_data_map.vaddr, 6182 + BUS_DMA_NOWAIT, 6183 + &ahd->shared_data_map.dmamap) != 0) { 6184 return (ENOMEM); 6185 } 6186 6187 ahd->init_level++; 6188 6189 /* And permanently map it in */ 6190 + ahd_dmamap_load(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 6191 + ahd->shared_data_map.vaddr, driver_data_size, 6192 + ahd_dmamap_cb, &ahd->shared_data_map.physaddr, 6193 + /*flags*/0); 6194 + ahd->qoutfifo = (struct ahd_completion *)ahd->shared_data_map.vaddr; 6195 next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE]; 6196 + next_baddr = ahd->shared_data_map.physaddr 6197 + + AHD_QOUT_SIZE*sizeof(struct ahd_completion); 6198 if ((ahd->features & AHD_TARGETMODE) != 0) { 6199 ahd->targetcmds = (struct target_cmd *)next_vaddr; 6200 next_vaddr += AHD_TMODE_CMDS * sizeof(struct target_cmd); ··· 6212 * specially from the DMA safe memory chunk used for the QOUTFIFO. 6213 */ 6214 ahd->next_queued_hscb = (struct hardware_scb *)next_vaddr; 6215 + ahd->next_queued_hscb_map = &ahd->shared_data_map; 6216 ahd->next_queued_hscb->hscb_busaddr = ahd_htole32(next_baddr); 6217 6218 ahd->init_level++; ··· 6517 6518 /* All of our queues are empty */ 6519 ahd->qoutfifonext = 0; 6520 + ahd->qoutfifonext_valid_tag = QOUTFIFO_ENTRY_VALID; 6521 + ahd_outb(ahd, QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID); 6522 for (i = 0; i < AHD_QOUT_SIZE; i++) 6523 + ahd->qoutfifo[i].valid_tag = 0; 6524 ahd_sync_qoutfifo(ahd, BUS_DMASYNC_PREREAD); 6525 6526 ahd->qinfifonext = 0; ··· 6553 ahd_outw(ahd, COMPLETE_SCB_HEAD, SCB_LIST_NULL); 6554 ahd_outw(ahd, COMPLETE_SCB_DMAINPROG_HEAD, SCB_LIST_NULL); 6555 ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, SCB_LIST_NULL); 6556 + ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, SCB_LIST_NULL); 6557 + ahd_outw(ahd, COMPLETE_ON_QFREEZE_HEAD, SCB_LIST_NULL); 6558 6559 /* 6560 * The Freeze Count is 0. 6561 */ 6562 + ahd->qfreeze_cnt = 0; 6563 ahd_outw(ahd, QFREEZE_COUNT, 0); 6564 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, 0); 6565 6566 /* 6567 * Tell the sequencer where it can find our arrays in memory. 6568 */ 6569 + busaddr = ahd->shared_data_map.physaddr; 6570 + ahd_outl(ahd, SHARED_DATA_ADDR, busaddr); 6571 + ahd_outl(ahd, QOUTFIFO_NEXT_ADDR, busaddr); 6572 6573 /* 6574 * Setup the allowed SCSI Sequences based on operational mode. ··· 6619 * Tell the sequencer which SCB will be the next one it receives. 6620 */ 6621 busaddr = ahd_le32toh(ahd->next_queued_hscb->hscb_busaddr); 6622 + ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr); 6623 6624 /* 6625 * Default to coalescing disabled. ··· 6926 { 6927 u_int intstat; 6928 u_int maxloops; 6929 6930 maxloops = 1000; 6931 ahd->flags |= AHD_ALL_INTERRUPTS; 6932 ahd_pause(ahd); 6933 /* 6934 + * Freeze the outgoing selections. We do this only 6935 * until we are safely paused without further selections 6936 * pending. 6937 */ 6938 + ahd->qfreeze_cnt--; 6939 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); 6940 ahd_outb(ahd, SEQ_FLAGS2, ahd_inb(ahd, SEQ_FLAGS2) | SELECTOUT_QFROZEN); 6941 do { 6942 6943 ahd_unpause(ahd); 6944 + /* 6945 + * Give the sequencer some time to service 6946 + * any active selections. 6947 + */ 6948 + ahd_delay(500); 6949 + 6950 ahd_intr(ahd); 6951 ahd_pause(ahd); 6952 intstat = ahd_inb(ahd, INTSTAT); 6953 + if ((intstat & INT_PEND) == 0) { 6954 + ahd_clear_critical_section(ahd); 6955 + intstat = ahd_inb(ahd, INTSTAT); 6956 + } 6957 } while (--maxloops 6958 && (intstat != 0xFF || (ahd->features & AHD_REMOVABLE) == 0) 6959 && ((intstat & INT_PEND) != 0 ··· 6973 printf("Infinite interrupt loop, INTSTAT = %x", 6974 ahd_inb(ahd, INTSTAT)); 6975 } 6976 + ahd->qfreeze_cnt++; 6977 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); 6978 6979 ahd_flush_qoutfifo(ahd); 6980 ··· 7155 uint32_t busaddr; 7156 7157 busaddr = ahd_le32toh(scb->hscb->hscb_busaddr); 7158 + ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr); 7159 } else { 7160 prev_scb->hscb->next_hscb_busaddr = scb->hscb->hscb_busaddr; 7161 ahd_sync_scb(ahd, prev_scb, ··· 7265 */ 7266 ahd->qinfifonext = qinstart; 7267 busaddr = ahd_le32toh(ahd->next_queued_hscb->hscb_busaddr); 7268 + ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr); 7269 7270 while (qinpos != qintail) { 7271 scb = ahd_lookup_scb(ahd, ahd->qinfifo[qinpos]); ··· 7330 * appropriate, traverse the SCBs of each "their id" 7331 * looking for matches. 7332 */ 7333 + ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 7334 savedscbptr = ahd_get_scbptr(ahd); 7335 tid_next = ahd_inw(ahd, WAITING_TID_HEAD); 7336 tid_prev = SCB_LIST_NULL; ··· 7399 u_int prev; 7400 int found; 7401 7402 + AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); 7403 found = 0; 7404 prev = SCB_LIST_NULL; 7405 next = *list_head; ··· 7466 ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev, 7467 u_int tid_cur, u_int tid_next) 7468 { 7469 + AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); 7470 7471 if (SCBID_IS_NULL(tid_cur)) { 7472 ··· 7506 { 7507 u_int tail_offset; 7508 7509 + AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); 7510 if (!SCBID_IS_NULL(prev)) { 7511 ahd_set_scbptr(ahd, prev); 7512 ahd_outw(ahd, SCB_NEXT, next); ··· 7739 */ 7740 ahd_clear_msg_state(ahd); 7741 ahd_outb(ahd, SIMODE1, 7742 + ahd_inb(ahd, SIMODE1) & ~(ENBUSFREE|ENSCSIRST)); 7743 7744 if (initiate_reset) 7745 ahd_reset_current_bus(ahd); ··· 7910 void 7911 ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) 7912 { 7913 + struct hardware_scb *hscb; 7914 + int paused; 7915 7916 /* 7917 * The sequencer freezes its select-out queue 7918 * anytime a SCSI status error occurs. We must 7919 + * handle the error and increment our qfreeze count 7920 + * to allow the sequencer to continue. We don't 7921 + * bother clearing critical sections here since all 7922 + * operations are on data structures that the sequencer 7923 + * is not touching once the queue is frozen. 7924 */ 7925 hscb = scb->hscb; 7926 + 7927 + if (ahd_is_paused(ahd)) { 7928 + paused = 1; 7929 + } else { 7930 + paused = 0; 7931 + ahd_pause(ahd); 7932 + } 7933 7934 /* Freeze the queue until the client sees the error. */ 7935 ahd_freeze_devq(ahd, scb); 7936 ahd_freeze_scb(scb); 7937 + ahd->qfreeze_cnt++; 7938 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); 7939 + 7940 + if (paused == 0) 7941 + ahd_unpause(ahd); 7942 7943 /* Don't want to clobber the original sense code */ 7944 if ((scb->flags & SCB_SENSE) != 0) { ··· 8317 max_prog = 2048; 8318 8319 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM); 8320 + ahd_outw(ahd, PRGMCNT, 0); 8321 for (i = 0; i < max_prog; i++) { 8322 uint8_t ins_bytes[4]; 8323 ··· 8347 u_int sg_prefetch_cnt_limit; 8348 u_int sg_prefetch_align; 8349 u_int sg_size; 8350 + u_int cacheline_mask; 8351 uint8_t download_consts[DOWNLOAD_CONST_COUNT]; 8352 8353 if (bootverbose) 8354 printf("%s: Downloading Sequencer Program...", 8355 ahd_name(ahd)); 8356 8357 + #if DOWNLOAD_CONST_COUNT != 8 8358 #error "Download Const Mismatch" 8359 #endif 8360 /* ··· 8389 /* Round down to the nearest power of 2. */ 8390 while (powerof2(sg_prefetch_align) == 0) 8391 sg_prefetch_align--; 8392 + 8393 + cacheline_mask = sg_prefetch_align - 1; 8394 + 8395 /* 8396 * If the cacheline boundary is greater than half our prefetch RAM 8397 * we risk not being able to fetch even a single complete S/G ··· 8429 download_consts[PKT_OVERRUN_BUFOFFSET] = 8430 (ahd->overrun_buf - (uint8_t *)ahd->qoutfifo) / 256; 8431 download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_1BYTE_LUN; 8432 + download_consts[CACHELINE_MASK] = cacheline_mask; 8433 cur_patch = patches; 8434 downloaded = 0; 8435 skip_addr = 0; 8436 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM); 8437 + ahd_outw(ahd, PRGMCNT, 0); 8438 8439 for (i = 0; i < sizeof(seqprog)/4; i++) { 8440 if (ahd_check_patch(ahd, &cur_patch, i, &skip_addr) == 0) { ··· 8727 printf(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" 8728 "%s: Dumping Card State at program address 0x%x Mode 0x%x\n", 8729 ahd_name(ahd), 8730 + ahd_inw(ahd, CURADDR), 8731 ahd_build_mode_state(ahd, ahd->saved_src_mode, 8732 ahd->saved_dst_mode)); 8733 if (paused) ··· 8836 8837 printf("Sequencer DMA-Up and Complete list: "); 8838 scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD); 8839 + i = 0; 8840 + while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { 8841 + ahd_set_scbptr(ahd, scb_index); 8842 + printf("%d ", scb_index); 8843 + scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE); 8844 + } 8845 + printf("\n"); 8846 + printf("Sequencer On QFreeze and Complete list: "); 8847 + scb_index = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD); 8848 i = 0; 8849 while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { 8850 ahd_set_scbptr(ahd, scb_index); ··· 9077 { 9078 int cnt; 9079 9080 + cnt = 5000; 9081 while ((ahd_inb(ahd, SEESTAT) & (SEEARBACK|SEEBUSY)) != 0 && --cnt) 9082 ahd_delay(5); 9083 ··· 9423 if ((ahd->features & AHD_MULTI_TID) != 0) { 9424 u_int targid_mask; 9425 9426 + targid_mask = ahd_inw(ahd, TARGID); 9427 targid_mask |= target_mask; 9428 + ahd_outw(ahd, TARGID, targid_mask); 9429 ahd_update_scsiid(ahd, targid_mask); 9430 } else { 9431 u_int our_id; ··· 9543 if (ahd->features & AHD_MULTI_TID) { 9544 u_int targid_mask; 9545 9546 + targid_mask = ahd_inw(ahd, TARGID); 9547 targid_mask &= ~target_mask; 9548 + ahd_outw(ahd, TARGID, targid_mask); 9549 ahd_update_scsiid(ahd, targid_mask); 9550 } 9551 } ··· 9651 9652 cmd->cmd_valid = 0; 9653 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 9654 + ahd->shared_data_map.dmamap, 9655 ahd_targetcmd_offset(ahd, ahd->tqinfifonext), 9656 sizeof(struct target_cmd), 9657 BUS_DMASYNC_PREREAD);
+26 -12
drivers/scsi/aic7xxx/aic79xx_inline.h
··· 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGES. 39 * 40 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#51 $ 41 * 42 * $FreeBSD$ 43 */ ··· 522 static __inline uint16_t 523 ahd_inw(struct ahd_softc *ahd, u_int port) 524 { 525 return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port)); 526 } 527 528 static __inline void 529 ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) 530 { 531 ahd_outb(ahd, port, value & 0xFF); 532 ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 533 } ··· 693 * Razor #528 694 */ 695 value = ahd_inb(ahd, offset); 696 - if ((ahd->flags & AHD_PCIX_SCBRAM_RD_BUG) != 0) 697 ahd_inb(ahd, MODE_PTR); 698 return (value); 699 } ··· 736 static __inline void 737 ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) 738 { 739 - struct hardware_scb *q_hscb; 740 uint32_t saved_hscb_busaddr; 741 742 /* ··· 753 * locate the correct SCB by SCB_TAG. 754 */ 755 q_hscb = ahd->next_queued_hscb; 756 saved_hscb_busaddr = q_hscb->hscb_busaddr; 757 memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 758 q_hscb->hscb_busaddr = saved_hscb_busaddr; ··· 761 762 /* Now swap HSCB pointers. */ 763 ahd->next_queued_hscb = scb->hscb; 764 scb->hscb = q_hscb; 765 766 /* Now define the mapping from tag to SCB in the scbindex */ 767 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb; ··· 837 static __inline void 838 ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) 839 { 840 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_dmamap, 841 - /*offset*/0, /*len*/AHC_SCB_MAX * sizeof(uint16_t), op); 842 } 843 844 static __inline void ··· 848 #ifdef AHD_TARGET_MODE 849 if ((ahd->flags & AHD_TARGETROLE) != 0) { 850 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 851 - ahd->shared_data_dmamap, 852 ahd_targetcmd_offset(ahd, 0), 853 sizeof(struct target_cmd) * AHD_TMODE_CMDS, 854 op); ··· 868 u_int retval; 869 870 retval = 0; 871 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_dmamap, 872 - /*offset*/ahd->qoutfifonext, /*len*/2, 873 - BUS_DMASYNC_POSTREAD); 874 - if ((ahd->qoutfifo[ahd->qoutfifonext] 875 - & QOUTFIFO_ENTRY_VALID_LE) == ahd->qoutfifonext_valid_tag) 876 retval |= AHD_RUN_QOUTFIFO; 877 #ifdef AHD_TARGET_MODE 878 if ((ahd->flags & AHD_TARGETROLE) != 0 879 && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) { 880 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 881 - ahd->shared_data_dmamap, 882 ahd_targetcmd_offset(ahd, ahd->tqinfifofnext), 883 /*len*/sizeof(struct target_cmd), 884 BUS_DMASYNC_POSTREAD);
··· 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGES. 39 * 40 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#58 $ 41 * 42 * $FreeBSD$ 43 */ ··· 522 static __inline uint16_t 523 ahd_inw(struct ahd_softc *ahd, u_int port) 524 { 525 + /* 526 + * Read high byte first as some registers increment 527 + * or have other side effects when the low byte is 528 + * read. 529 + */ 530 return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port)); 531 } 532 533 static __inline void 534 ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) 535 { 536 + /* 537 + * Write low byte first to accomodate registers 538 + * such as PRGMCNT where the order maters. 539 + */ 540 ahd_outb(ahd, port, value & 0xFF); 541 ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 542 } ··· 684 * Razor #528 685 */ 686 value = ahd_inb(ahd, offset); 687 + if ((ahd->bugs & AHD_PCIX_SCBRAM_RD_BUG) != 0) 688 ahd_inb(ahd, MODE_PTR); 689 return (value); 690 } ··· 727 static __inline void 728 ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) 729 { 730 + struct hardware_scb *q_hscb; 731 + struct map_node *q_hscb_map; 732 uint32_t saved_hscb_busaddr; 733 734 /* ··· 743 * locate the correct SCB by SCB_TAG. 744 */ 745 q_hscb = ahd->next_queued_hscb; 746 + q_hscb_map = ahd->next_queued_hscb_map; 747 saved_hscb_busaddr = q_hscb->hscb_busaddr; 748 memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 749 q_hscb->hscb_busaddr = saved_hscb_busaddr; ··· 750 751 /* Now swap HSCB pointers. */ 752 ahd->next_queued_hscb = scb->hscb; 753 + ahd->next_queued_hscb_map = scb->hscb_map; 754 scb->hscb = q_hscb; 755 + scb->hscb_map = q_hscb_map; 756 757 /* Now define the mapping from tag to SCB in the scbindex */ 758 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb; ··· 824 static __inline void 825 ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) 826 { 827 + ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 828 + /*offset*/0, 829 + /*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op); 830 } 831 832 static __inline void ··· 834 #ifdef AHD_TARGET_MODE 835 if ((ahd->flags & AHD_TARGETROLE) != 0) { 836 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 837 + ahd->shared_data_map.dmamap, 838 ahd_targetcmd_offset(ahd, 0), 839 sizeof(struct target_cmd) * AHD_TMODE_CMDS, 840 op); ··· 854 u_int retval; 855 856 retval = 0; 857 + ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, 858 + /*offset*/ahd->qoutfifonext * sizeof(*ahd->qoutfifo), 859 + /*len*/sizeof(*ahd->qoutfifo), BUS_DMASYNC_POSTREAD); 860 + if (ahd->qoutfifo[ahd->qoutfifonext].valid_tag 861 + == ahd->qoutfifonext_valid_tag) 862 retval |= AHD_RUN_QOUTFIFO; 863 #ifdef AHD_TARGET_MODE 864 if ((ahd->flags & AHD_TARGETROLE) != 0 865 && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) { 866 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 867 + ahd->shared_data_map.dmamap, 868 ahd_targetcmd_offset(ahd, ahd->tqinfifofnext), 869 /*len*/sizeof(struct target_cmd), 870 BUS_DMASYNC_POSTREAD);
+51 -11
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 1468 if ((tstate->auto_negotiate & mask) != 0) { 1469 scb->flags |= SCB_AUTO_NEGOTIATE; 1470 scb->hscb->control |= MK_MESSAGE; 1471 } 1472 1473 if ((dev->flags & (AHD_DEV_Q_TAGGED|AHD_DEV_Q_BASIC)) != 0) { ··· 2082 int paused; 2083 int wait; 2084 int disconnected; 2085 ahd_mode_state saved_modes; 2086 unsigned long flags; 2087 ··· 2201 last_phase = ahd_inb(ahd, LASTPHASE); 2202 saved_scbptr = ahd_get_scbptr(ahd); 2203 active_scbptr = saved_scbptr; 2204 - if (disconnected && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) == 0) { 2205 struct scb *bus_scb; 2206 2207 bus_scb = ahd_lookup_scb(ahd, active_scbptr); ··· 2220 * bus or is in the disconnected state. 2221 */ 2222 saved_scsiid = ahd_inb(ahd, SAVED_SCSIID); 2223 - if (last_phase != P_BUSFREE 2224 - && (SCB_GET_TAG(pending_scb) == active_scbptr 2225 || (flag == SCB_DEVICE_RESET 2226 - && SCSIID_TARGET(ahd, saved_scsiid) == scmd_id(cmd)))) { 2227 2228 /* 2229 * We're active on the bus, so assert ATN 2230 * and hope that the target responds. 2231 */ 2232 pending_scb = ahd_lookup_scb(ahd, active_scbptr); 2233 - pending_scb->flags |= SCB_RECOVERY_SCB|flag; 2234 ahd_outb(ahd, MSG_OUT, HOST_MSG); 2235 ahd_outb(ahd, SCSISIGO, last_phase|ATNO); 2236 - scmd_printk(KERN_INFO, cmd, "Device is active, asserting ATN\n"); 2237 wait = TRUE; 2238 } else if (disconnected) { 2239 2240 /* 2241 * Actually re-queue this SCB in an attempt 2242 * to select the device before it reconnects. 2243 */ 2244 - pending_scb->flags |= SCB_RECOVERY_SCB|SCB_ABORT; 2245 ahd_set_scbptr(ahd, SCB_GET_TAG(pending_scb)); 2246 pending_scb->hscb->cdb_len = 0; 2247 pending_scb->hscb->task_attribute = 0; ··· 2335 timer.expires = jiffies + (5 * HZ); 2336 timer.function = ahd_linux_sem_timeout; 2337 add_timer(&timer); 2338 - printf("Recovery code sleeping\n"); 2339 down(&ahd->platform_data->eh_sem); 2340 - printf("Recovery code awake\n"); 2341 ret = del_timer_sync(&timer); 2342 if (ret == 0) { 2343 - printf("Timer Expired\n"); 2344 retval = FAILED; 2345 } 2346 } 2347 - ahd_unlock(ahd, &flags); 2348 return (retval); 2349 } 2350
··· 1468 if ((tstate->auto_negotiate & mask) != 0) { 1469 scb->flags |= SCB_AUTO_NEGOTIATE; 1470 scb->hscb->control |= MK_MESSAGE; 1471 + } else if (cmd->cmnd[0] == INQUIRY 1472 + && (tinfo->curr.offset != 0 1473 + || tinfo->curr.width != MSG_EXT_WDTR_BUS_8_BIT 1474 + || tinfo->curr.ppr_options != 0) 1475 + && (tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ)==0) { 1476 + /* 1477 + * The SCSI spec requires inquiry 1478 + * commands to complete without 1479 + * reporting unit attention conditions. 1480 + * Because of this, an inquiry command 1481 + * that occurs just after a device is 1482 + * reset will result in a data phase 1483 + * with mismatched negotiated rates. 1484 + * The core already forces a renegotiation 1485 + * for reset events that are visible to 1486 + * our controller or that we initiate, 1487 + * but a third party device reset or a 1488 + * hot-plug insertion can still cause this 1489 + * issue. Therefore, we force a re-negotiation 1490 + * for every inquiry command unless we 1491 + * are async. 1492 + */ 1493 + scb->flags |= SCB_NEGOTIATE; 1494 + scb->hscb->control |= MK_MESSAGE; 1495 } 1496 1497 if ((dev->flags & (AHD_DEV_Q_TAGGED|AHD_DEV_Q_BASIC)) != 0) { ··· 2058 int paused; 2059 int wait; 2060 int disconnected; 2061 + int found; 2062 ahd_mode_state saved_modes; 2063 unsigned long flags; 2064 ··· 2176 last_phase = ahd_inb(ahd, LASTPHASE); 2177 saved_scbptr = ahd_get_scbptr(ahd); 2178 active_scbptr = saved_scbptr; 2179 + if (disconnected && ((last_phase != P_BUSFREE) || 2180 + (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) == 0)) { 2181 struct scb *bus_scb; 2182 2183 bus_scb = ahd_lookup_scb(ahd, active_scbptr); ··· 2194 * bus or is in the disconnected state. 2195 */ 2196 saved_scsiid = ahd_inb(ahd, SAVED_SCSIID); 2197 + if (SCB_GET_TAG(pending_scb) == active_scbptr 2198 || (flag == SCB_DEVICE_RESET 2199 + && SCSIID_TARGET(ahd, saved_scsiid) == scmd_id(cmd))) { 2200 2201 /* 2202 * We're active on the bus, so assert ATN 2203 * and hope that the target responds. 2204 */ 2205 pending_scb = ahd_lookup_scb(ahd, active_scbptr); 2206 + pending_scb->flags |= SCB_RECOVERY_SCB|SCB_DEVICE_RESET; 2207 ahd_outb(ahd, MSG_OUT, HOST_MSG); 2208 ahd_outb(ahd, SCSISIGO, last_phase|ATNO); 2209 + scmd_printk(KERN_INFO, cmd, "BDR message in message buffer\n"); 2210 wait = TRUE; 2211 + } else if (last_phase != P_BUSFREE 2212 + && ahd_inb(ahd, SCSIPHASE) == 0) { 2213 + /* 2214 + * SCB is not identified, there 2215 + * is no pending REQ, and the sequencer 2216 + * has not seen a busfree. Looks like 2217 + * a stuck connection waiting to 2218 + * go busfree. Reset the bus. 2219 + */ 2220 + found = ahd_reset_channel(ahd, cmd->device->channel + 'A', 2221 + /*Initiate Reset*/TRUE); 2222 + printf("%s: Issued Channel %c Bus Reset. " 2223 + "%d SCBs aborted\n", ahd_name(ahd), 2224 + cmd->device->channel + 'A', found); 2225 } else if (disconnected) { 2226 2227 /* 2228 * Actually re-queue this SCB in an attempt 2229 * to select the device before it reconnects. 2230 */ 2231 + pending_scb->flags |= SCB_RECOVERY_SCB|flag; 2232 ahd_set_scbptr(ahd, SCB_GET_TAG(pending_scb)); 2233 pending_scb->hscb->cdb_len = 0; 2234 pending_scb->hscb->task_attribute = 0; ··· 2296 timer.expires = jiffies + (5 * HZ); 2297 timer.function = ahd_linux_sem_timeout; 2298 add_timer(&timer); 2299 + printf("%s: Recovery code sleeping\n", ahd_name(ahd)); 2300 down(&ahd->platform_data->eh_sem); 2301 + printf("%s: Recovery code awake\n", ahd_name(ahd)); 2302 ret = del_timer_sync(&timer); 2303 if (ret == 0) { 2304 + printf("%s: Timer Expired (active %d)\n", 2305 + ahd_name(ahd), dev->active); 2306 retval = FAILED; 2307 } 2308 } 2309 + ahd_unlock(ahd, &flags); 2310 return (retval); 2311 } 2312
+1 -1
drivers/scsi/aic7xxx/aic79xx_osm.h
··· 252 /***************************** SMP support ************************************/ 253 #include <linux/spinlock.h> 254 255 - #define AIC79XX_DRIVER_VERSION "1.3.11" 256 257 /*************************** Device Data Structures ***************************/ 258 /*
··· 252 /***************************** SMP support ************************************/ 253 #include <linux/spinlock.h> 254 255 + #define AIC79XX_DRIVER_VERSION "3.0" 256 257 /*************************** Device Data Structures ***************************/ 258 /*
+15 -9
drivers/scsi/aic7xxx/aic79xx_pci.c
··· 38 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 * POSSIBILITY OF SUCH DAMAGES. 40 * 41 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#77 $ 42 - * 43 - * $FreeBSD$ 44 */ 45 46 #ifdef __linux__ ··· 112 "Adaptec 29320ALP Ultra320 SCSI adapter", 113 ahd_aic7901_setup 114 }, 115 /* aic7902 based controllers */ 116 { 117 ID_AHA_29320, ··· 133 ahd_aic7902_setup 134 }, 135 { 136 - ID_AHA_29320LP, 137 - ID_ALL_MASK, 138 - "Adaptec 29320LP Ultra320 SCSI adapter", 139 - ahd_aic7901A_setup 140 - }, 141 - { 142 ID_AHA_39320, 143 ID_ALL_MASK, 144 "Adaptec 39320 Ultra320 SCSI adapter", ··· 142 ID_AHA_39320_B, 143 ID_ALL_MASK, 144 "Adaptec 39320 Ultra320 SCSI adapter", 145 ahd_aic7902_setup 146 }, 147 { ··· 673 * Now set the termination based on what we found. 674 */ 675 sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN; 676 if ((termctl & FLX_TERMCTL_ENPRILOW) != 0) { 677 ahd->flags |= AHD_TERM_ENB_A; 678 sxfrctl1 |= STPWEN;
··· 38 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 * POSSIBILITY OF SUCH DAMAGES. 40 * 41 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#89 $ 42 */ 43 44 #ifdef __linux__ ··· 114 "Adaptec 29320ALP Ultra320 SCSI adapter", 115 ahd_aic7901_setup 116 }, 117 + /* aic7901A based controllers */ 118 + { 119 + ID_AHA_29320LP, 120 + ID_ALL_MASK, 121 + "Adaptec 29320LP Ultra320 SCSI adapter", 122 + ahd_aic7901A_setup 123 + }, 124 /* aic7902 based controllers */ 125 { 126 ID_AHA_29320, ··· 128 ahd_aic7902_setup 129 }, 130 { 131 ID_AHA_39320, 132 ID_ALL_MASK, 133 "Adaptec 39320 Ultra320 SCSI adapter", ··· 143 ID_AHA_39320_B, 144 ID_ALL_MASK, 145 "Adaptec 39320 Ultra320 SCSI adapter", 146 + ahd_aic7902_setup 147 + }, 148 + { 149 + ID_AHA_39320_B_DELL, 150 + ID_ALL_MASK, 151 + "Adaptec (Dell OEM) 39320 Ultra320 SCSI adapter", 152 ahd_aic7902_setup 153 }, 154 { ··· 668 * Now set the termination based on what we found. 669 */ 670 sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN; 671 + ahd->flags &= ~AHD_TERM_ENB_A; 672 if ((termctl & FLX_TERMCTL_ENPRILOW) != 0) { 673 ahd->flags |= AHD_TERM_ENB_A; 674 sxfrctl1 |= STPWEN;
+3 -2
drivers/scsi/aic7xxx/aic79xx_pci.h
··· 53 #define ID_AHA_29320ALP 0x8017900500449005ull 54 55 #define ID_AIC7901A 0x801E9005FFFF9005ull 56 - #define ID_AHA_29320 0x8012900500429005ull 57 - #define ID_AHA_29320B 0x8013900500439005ull 58 #define ID_AHA_29320LP 0x8014900500449005ull 59 60 #define ID_AIC7902 0x801F9005FFFF9005ull 61 #define ID_AIC7902_B 0x801D9005FFFF9005ull 62 #define ID_AHA_39320 0x8010900500409005ull 63 #define ID_AHA_39320_B 0x8015900500409005ull 64 #define ID_AHA_39320A 0x8016900500409005ull 65 #define ID_AHA_39320D 0x8011900500419005ull 66 #define ID_AHA_39320D_B 0x801C900500419005ull
··· 53 #define ID_AHA_29320ALP 0x8017900500449005ull 54 55 #define ID_AIC7901A 0x801E9005FFFF9005ull 56 #define ID_AHA_29320LP 0x8014900500449005ull 57 58 #define ID_AIC7902 0x801F9005FFFF9005ull 59 #define ID_AIC7902_B 0x801D9005FFFF9005ull 60 #define ID_AHA_39320 0x8010900500409005ull 61 + #define ID_AHA_29320 0x8012900500429005ull 62 + #define ID_AHA_29320B 0x8013900500439005ull 63 #define ID_AHA_39320_B 0x8015900500409005ull 64 + #define ID_AHA_39320_B_DELL 0x8015900501681028ull 65 #define ID_AHA_39320A 0x8016900500409005ull 66 #define ID_AHA_39320D 0x8011900500419005ull 67 #define ID_AHA_39320D_B 0x801C900500419005ull
+352 -324
drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
··· 2 * DO NOT EDIT - This file is automatically generated 3 * from the following source files: 4 * 5 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#94 $ 6 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $ 7 */ 8 typedef int (ahd_reg_print_t)(u_int, u_int *, u_int); 9 typedef struct ahd_reg_parse_entry { ··· 83 #endif 84 85 #if AIC_DEBUG_REGISTERS 86 - ahd_reg_print_t ahd_clrseqintstat_print; 87 - #else 88 - #define ahd_clrseqintstat_print(regvalue, cur_col, wrap) \ 89 - ahd_print_register(NULL, 0, "CLRSEQINTSTAT", 0x0c, regvalue, cur_col, wrap) 90 - #endif 91 - 92 - #if AIC_DEBUG_REGISTERS 93 ahd_reg_print_t ahd_seqintstat_print; 94 #else 95 #define ahd_seqintstat_print(regvalue, cur_col, wrap) \ 96 ahd_print_register(NULL, 0, "SEQINTSTAT", 0x0c, regvalue, cur_col, wrap) 97 #endif 98 99 #if AIC_DEBUG_REGISTERS ··· 412 #endif 413 414 #if AIC_DEBUG_REGISTERS 415 - ahd_reg_print_t ahd_businitid_print; 416 - #else 417 - #define ahd_businitid_print(regvalue, cur_col, wrap) \ 418 - ahd_print_register(NULL, 0, "BUSINITID", 0x3c, regvalue, cur_col, wrap) 419 - #endif 420 - 421 - #if AIC_DEBUG_REGISTERS 422 ahd_reg_print_t ahd_dlcount_print; 423 #else 424 #define ahd_dlcount_print(regvalue, cur_col, wrap) \ 425 ahd_print_register(NULL, 0, "DLCOUNT", 0x3c, regvalue, cur_col, wrap) 426 #endif 427 428 #if AIC_DEBUG_REGISTERS ··· 517 #endif 518 519 #if AIC_DEBUG_REGISTERS 520 - ahd_reg_print_t ahd_sblkctl_print; 521 - #else 522 - #define ahd_sblkctl_print(regvalue, cur_col, wrap) \ 523 - ahd_print_register(NULL, 0, "SBLKCTL", 0x4a, regvalue, cur_col, wrap) 524 - #endif 525 - 526 - #if AIC_DEBUG_REGISTERS 527 ahd_reg_print_t ahd_optionmode_print; 528 #else 529 #define ahd_optionmode_print(regvalue, cur_col, wrap) \ ··· 524 #endif 525 526 #if AIC_DEBUG_REGISTERS 527 - ahd_reg_print_t ahd_sstat0_print; 528 #else 529 - #define ahd_sstat0_print(regvalue, cur_col, wrap) \ 530 - ahd_print_register(NULL, 0, "SSTAT0", 0x4b, regvalue, cur_col, wrap) 531 #endif 532 533 #if AIC_DEBUG_REGISTERS ··· 535 #else 536 #define ahd_clrsint0_print(regvalue, cur_col, wrap) \ 537 ahd_print_register(NULL, 0, "CLRSINT0", 0x4b, regvalue, cur_col, wrap) 538 #endif 539 540 #if AIC_DEBUG_REGISTERS ··· 573 #endif 574 575 #if AIC_DEBUG_REGISTERS 576 - ahd_reg_print_t ahd_clrsint2_print; 577 - #else 578 - #define ahd_clrsint2_print(regvalue, cur_col, wrap) \ 579 - ahd_print_register(NULL, 0, "CLRSINT2", 0x4d, regvalue, cur_col, wrap) 580 - #endif 581 - 582 - #if AIC_DEBUG_REGISTERS 583 ahd_reg_print_t ahd_simode2_print; 584 #else 585 #define ahd_simode2_print(regvalue, cur_col, wrap) \ 586 ahd_print_register(NULL, 0, "SIMODE2", 0x4d, regvalue, cur_col, wrap) 587 #endif 588 589 #if AIC_DEBUG_REGISTERS ··· 685 #endif 686 687 #if AIC_DEBUG_REGISTERS 688 - ahd_reg_print_t ahd_lqomode0_print; 689 - #else 690 - #define ahd_lqomode0_print(regvalue, cur_col, wrap) \ 691 - ahd_print_register(NULL, 0, "LQOMODE0", 0x54, regvalue, cur_col, wrap) 692 - #endif 693 - 694 - #if AIC_DEBUG_REGISTERS 695 ahd_reg_print_t ahd_lqostat0_print; 696 #else 697 #define ahd_lqostat0_print(regvalue, cur_col, wrap) \ ··· 699 #endif 700 701 #if AIC_DEBUG_REGISTERS 702 ahd_reg_print_t ahd_lqostat1_print; 703 #else 704 #define ahd_lqostat1_print(regvalue, cur_col, wrap) \ ··· 724 #else 725 #define ahd_clrlqoint1_print(regvalue, cur_col, wrap) \ 726 ahd_print_register(NULL, 0, "CLRLQOINT1", 0x55, regvalue, cur_col, wrap) 727 - #endif 728 - 729 - #if AIC_DEBUG_REGISTERS 730 - ahd_reg_print_t ahd_lqomode1_print; 731 - #else 732 - #define ahd_lqomode1_print(regvalue, cur_col, wrap) \ 733 - ahd_print_register(NULL, 0, "LQOMODE1", 0x55, regvalue, cur_col, wrap) 734 #endif 735 736 #if AIC_DEBUG_REGISTERS ··· 909 #endif 910 911 #if AIC_DEBUG_REGISTERS 912 - ahd_reg_print_t ahd_scschkn_print; 913 - #else 914 - #define ahd_scschkn_print(regvalue, cur_col, wrap) \ 915 - ahd_print_register(NULL, 0, "SCSCHKN", 0x66, regvalue, cur_col, wrap) 916 - #endif 917 - 918 - #if AIC_DEBUG_REGISTERS 919 ahd_reg_print_t ahd_annexdat_print; 920 #else 921 #define ahd_annexdat_print(regvalue, cur_col, wrap) \ 922 ahd_print_register(NULL, 0, "ANNEXDAT", 0x66, regvalue, cur_col, wrap) 923 #endif 924 925 #if AIC_DEBUG_REGISTERS ··· 1000 #endif 1001 1002 #if AIC_DEBUG_REGISTERS 1003 - ahd_reg_print_t ahd_pll400cnt0_print; 1004 - #else 1005 - #define ahd_pll400cnt0_print(regvalue, cur_col, wrap) \ 1006 - ahd_print_register(NULL, 0, "PLL400CNT0", 0x6e, regvalue, cur_col, wrap) 1007 - #endif 1008 - 1009 - #if AIC_DEBUG_REGISTERS 1010 ahd_reg_print_t ahd_unfairness_print; 1011 #else 1012 #define ahd_unfairness_print(regvalue, cur_col, wrap) \ 1013 ahd_print_register(NULL, 0, "UNFAIRNESS", 0x6e, regvalue, cur_col, wrap) 1014 #endif 1015 1016 #if AIC_DEBUG_REGISTERS ··· 1056 #endif 1057 1058 #if AIC_DEBUG_REGISTERS 1059 - ahd_reg_print_t ahd_sghaddr_print; 1060 - #else 1061 - #define ahd_sghaddr_print(regvalue, cur_col, wrap) \ 1062 - ahd_print_register(NULL, 0, "SGHADDR", 0x7c, regvalue, cur_col, wrap) 1063 - #endif 1064 - 1065 - #if AIC_DEBUG_REGISTERS 1066 ahd_reg_print_t ahd_scbhaddr_print; 1067 #else 1068 #define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ ··· 1063 #endif 1064 1065 #if AIC_DEBUG_REGISTERS 1066 - ahd_reg_print_t ahd_sghcnt_print; 1067 #else 1068 - #define ahd_sghcnt_print(regvalue, cur_col, wrap) \ 1069 - ahd_print_register(NULL, 0, "SGHCNT", 0x84, regvalue, cur_col, wrap) 1070 #endif 1071 1072 #if AIC_DEBUG_REGISTERS ··· 1074 #else 1075 #define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ 1076 ahd_print_register(NULL, 0, "SCBHCNT", 0x84, regvalue, cur_col, wrap) 1077 #endif 1078 1079 #if AIC_DEBUG_REGISTERS ··· 1154 #endif 1155 1156 #if AIC_DEBUG_REGISTERS 1157 - ahd_reg_print_t ahd_dchrxmsg1_print; 1158 - #else 1159 - #define ahd_dchrxmsg1_print(regvalue, cur_col, wrap) \ 1160 - ahd_print_register(NULL, 0, "DCHRXMSG1", 0x91, regvalue, cur_col, wrap) 1161 - #endif 1162 - 1163 - #if AIC_DEBUG_REGISTERS 1164 ahd_reg_print_t ahd_cmcrxmsg1_print; 1165 #else 1166 #define ahd_cmcrxmsg1_print(regvalue, cur_col, wrap) \ ··· 1161 #endif 1162 1163 #if AIC_DEBUG_REGISTERS 1164 ahd_reg_print_t ahd_dchrxmsg2_print; 1165 #else 1166 #define ahd_dchrxmsg2_print(regvalue, cur_col, wrap) \ 1167 ahd_print_register(NULL, 0, "DCHRXMSG2", 0x92, regvalue, cur_col, wrap) 1168 - #endif 1169 - 1170 - #if AIC_DEBUG_REGISTERS 1171 - ahd_reg_print_t ahd_ovlyrxmsg2_print; 1172 - #else 1173 - #define ahd_ovlyrxmsg2_print(regvalue, cur_col, wrap) \ 1174 - ahd_print_register(NULL, 0, "OVLYRXMSG2", 0x92, regvalue, cur_col, wrap) 1175 #endif 1176 1177 #if AIC_DEBUG_REGISTERS ··· 1189 #endif 1190 1191 #if AIC_DEBUG_REGISTERS 1192 ahd_reg_print_t ahd_dchrxmsg3_print; 1193 #else 1194 #define ahd_dchrxmsg3_print(regvalue, cur_col, wrap) \ 1195 ahd_print_register(NULL, 0, "DCHRXMSG3", 0x93, regvalue, cur_col, wrap) 1196 #endif 1197 1198 #if AIC_DEBUG_REGISTERS ··· 1224 #endif 1225 1226 #if AIC_DEBUG_REGISTERS 1227 - ahd_reg_print_t ahd_ovlyrxmsg3_print; 1228 - #else 1229 - #define ahd_ovlyrxmsg3_print(regvalue, cur_col, wrap) \ 1230 - ahd_print_register(NULL, 0, "OVLYRXMSG3", 0x93, regvalue, cur_col, wrap) 1231 - #endif 1232 - 1233 - #if AIC_DEBUG_REGISTERS 1234 ahd_reg_print_t ahd_ovlyseqbcnt_print; 1235 #else 1236 #define ahd_ovlyseqbcnt_print(regvalue, cur_col, wrap) \ 1237 ahd_print_register(NULL, 0, "OVLYSEQBCNT", 0x94, regvalue, cur_col, wrap) 1238 - #endif 1239 - 1240 - #if AIC_DEBUG_REGISTERS 1241 - ahd_reg_print_t ahd_cmcseqbcnt_print; 1242 - #else 1243 - #define ahd_cmcseqbcnt_print(regvalue, cur_col, wrap) \ 1244 - ahd_print_register(NULL, 0, "CMCSEQBCNT", 0x94, regvalue, cur_col, wrap) 1245 #endif 1246 1247 #if AIC_DEBUG_REGISTERS ··· 1238 #endif 1239 1240 #if AIC_DEBUG_REGISTERS 1241 ahd_reg_print_t ahd_cmcspltstat0_print; 1242 #else 1243 #define ahd_cmcspltstat0_print(regvalue, cur_col, wrap) \ 1244 ahd_print_register(NULL, 0, "CMCSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 1245 - #endif 1246 - 1247 - #if AIC_DEBUG_REGISTERS 1248 - ahd_reg_print_t ahd_ovlyspltstat0_print; 1249 - #else 1250 - #define ahd_ovlyspltstat0_print(regvalue, cur_col, wrap) \ 1251 - ahd_print_register(NULL, 0, "OVLYSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 1252 #endif 1253 1254 #if AIC_DEBUG_REGISTERS ··· 1259 #endif 1260 1261 #if AIC_DEBUG_REGISTERS 1262 - ahd_reg_print_t ahd_dchspltstat1_print; 1263 #else 1264 - #define ahd_dchspltstat1_print(regvalue, cur_col, wrap) \ 1265 - ahd_print_register(NULL, 0, "DCHSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 1266 #endif 1267 1268 #if AIC_DEBUG_REGISTERS ··· 1277 #else 1278 #define ahd_ovlyspltstat1_print(regvalue, cur_col, wrap) \ 1279 ahd_print_register(NULL, 0, "OVLYSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 1280 #endif 1281 1282 #if AIC_DEBUG_REGISTERS ··· 1378 #endif 1379 1380 #if AIC_DEBUG_REGISTERS 1381 - ahd_reg_print_t ahd_sfunct_print; 1382 - #else 1383 - #define ahd_sfunct_print(regvalue, cur_col, wrap) \ 1384 - ahd_print_register(NULL, 0, "SFUNCT", 0x9f, regvalue, cur_col, wrap) 1385 - #endif 1386 - 1387 - #if AIC_DEBUG_REGISTERS 1388 ahd_reg_print_t ahd_sgspltstat1_print; 1389 #else 1390 #define ahd_sgspltstat1_print(regvalue, cur_col, wrap) \ 1391 ahd_print_register(NULL, 0, "SGSPLTSTAT1", 0x9f, regvalue, cur_col, wrap) 1392 #endif 1393 1394 #if AIC_DEBUG_REGISTERS ··· 1504 #endif 1505 1506 #if AIC_DEBUG_REGISTERS 1507 - ahd_reg_print_t ahd_ccscbaddr_print; 1508 - #else 1509 - #define ahd_ccscbaddr_print(regvalue, cur_col, wrap) \ 1510 - ahd_print_register(NULL, 0, "CCSCBADDR", 0xac, regvalue, cur_col, wrap) 1511 - #endif 1512 - 1513 - #if AIC_DEBUG_REGISTERS 1514 ahd_reg_print_t ahd_ccscbadr_bk_print; 1515 #else 1516 #define ahd_ccscbadr_bk_print(regvalue, cur_col, wrap) \ 1517 ahd_print_register(NULL, 0, "CCSCBADR_BK", 0xac, regvalue, cur_col, wrap) 1518 #endif 1519 1520 #if AIC_DEBUG_REGISTERS ··· 1525 #endif 1526 1527 #if AIC_DEBUG_REGISTERS 1528 - ahd_reg_print_t ahd_ccsgctl_print; 1529 - #else 1530 - #define ahd_ccsgctl_print(regvalue, cur_col, wrap) \ 1531 - ahd_print_register(NULL, 0, "CCSGCTL", 0xad, regvalue, cur_col, wrap) 1532 - #endif 1533 - 1534 - #if AIC_DEBUG_REGISTERS 1535 ahd_reg_print_t ahd_ccscbctl_print; 1536 #else 1537 #define ahd_ccscbctl_print(regvalue, cur_col, wrap) \ 1538 ahd_print_register(NULL, 0, "CCSCBCTL", 0xad, regvalue, cur_col, wrap) 1539 #endif 1540 1541 #if AIC_DEBUG_REGISTERS ··· 1707 #endif 1708 1709 #if AIC_DEBUG_REGISTERS 1710 - ahd_reg_print_t ahd_dfptrs_print; 1711 - #else 1712 - #define ahd_dfptrs_print(regvalue, cur_col, wrap) \ 1713 - ahd_print_register(NULL, 0, "DFPTRS", 0xc8, regvalue, cur_col, wrap) 1714 - #endif 1715 - 1716 - #if AIC_DEBUG_REGISTERS 1717 ahd_reg_print_t ahd_rcvrbiascalc_print; 1718 #else 1719 #define ahd_rcvrbiascalc_print(regvalue, cur_col, wrap) \ ··· 1714 #endif 1715 1716 #if AIC_DEBUG_REGISTERS 1717 - ahd_reg_print_t ahd_dfbkptr_print; 1718 #else 1719 - #define ahd_dfbkptr_print(regvalue, cur_col, wrap) \ 1720 - ahd_print_register(NULL, 0, "DFBKPTR", 0xc9, regvalue, cur_col, wrap) 1721 #endif 1722 1723 #if AIC_DEBUG_REGISTERS ··· 1725 #else 1726 #define ahd_skewcalc_print(regvalue, cur_col, wrap) \ 1727 ahd_print_register(NULL, 0, "SKEWCALC", 0xc9, regvalue, cur_col, wrap) 1728 #endif 1729 1730 #if AIC_DEBUG_REGISTERS ··· 1826 #endif 1827 1828 #if AIC_DEBUG_REGISTERS 1829 - ahd_reg_print_t ahd_brkaddr1_print; 1830 - #else 1831 - #define ahd_brkaddr1_print(regvalue, cur_col, wrap) \ 1832 - ahd_print_register(NULL, 0, "BRKADDR1", 0xe6, regvalue, cur_col, wrap) 1833 - #endif 1834 - 1835 - #if AIC_DEBUG_REGISTERS 1836 ahd_reg_print_t ahd_brkaddr0_print; 1837 #else 1838 #define ahd_brkaddr0_print(regvalue, cur_col, wrap) \ 1839 ahd_print_register(NULL, 0, "BRKADDR0", 0xe6, regvalue, cur_col, wrap) 1840 #endif 1841 1842 #if AIC_DEBUG_REGISTERS ··· 1889 #endif 1890 1891 #if AIC_DEBUG_REGISTERS 1892 - ahd_reg_print_t ahd_curaddr_print; 1893 - #else 1894 - #define ahd_curaddr_print(regvalue, cur_col, wrap) \ 1895 - ahd_print_register(NULL, 0, "CURADDR", 0xf4, regvalue, cur_col, wrap) 1896 - #endif 1897 - 1898 - #if AIC_DEBUG_REGISTERS 1899 ahd_reg_print_t ahd_intvec1_addr_print; 1900 #else 1901 #define ahd_intvec1_addr_print(regvalue, cur_col, wrap) \ ··· 1896 #endif 1897 1898 #if AIC_DEBUG_REGISTERS 1899 - ahd_reg_print_t ahd_intvec2_addr_print; 1900 #else 1901 - #define ahd_intvec2_addr_print(regvalue, cur_col, wrap) \ 1902 - ahd_print_register(NULL, 0, "INTVEC2_ADDR", 0xf6, regvalue, cur_col, wrap) 1903 #endif 1904 1905 #if AIC_DEBUG_REGISTERS ··· 1907 #else 1908 #define ahd_lastaddr_print(regvalue, cur_col, wrap) \ 1909 ahd_print_register(NULL, 0, "LASTADDR", 0xf6, regvalue, cur_col, wrap) 1910 #endif 1911 1912 #if AIC_DEBUG_REGISTERS ··· 1994 #endif 1995 1996 #if AIC_DEBUG_REGISTERS 1997 ahd_reg_print_t ahd_qfreeze_count_print; 1998 #else 1999 #define ahd_qfreeze_count_print(regvalue, cur_col, wrap) \ 2000 - ahd_print_register(NULL, 0, "QFREEZE_COUNT", 0x12e, regvalue, cur_col, wrap) 2001 #endif 2002 2003 #if AIC_DEBUG_REGISTERS 2004 ahd_reg_print_t ahd_saved_mode_print; 2005 #else 2006 #define ahd_saved_mode_print(regvalue, cur_col, wrap) \ 2007 - ahd_print_register(NULL, 0, "SAVED_MODE", 0x130, regvalue, cur_col, wrap) 2008 #endif 2009 2010 #if AIC_DEBUG_REGISTERS 2011 ahd_reg_print_t ahd_msg_out_print; 2012 #else 2013 #define ahd_msg_out_print(regvalue, cur_col, wrap) \ 2014 - ahd_print_register(NULL, 0, "MSG_OUT", 0x131, regvalue, cur_col, wrap) 2015 #endif 2016 2017 #if AIC_DEBUG_REGISTERS 2018 ahd_reg_print_t ahd_dmaparams_print; 2019 #else 2020 #define ahd_dmaparams_print(regvalue, cur_col, wrap) \ 2021 - ahd_print_register(NULL, 0, "DMAPARAMS", 0x132, regvalue, cur_col, wrap) 2022 #endif 2023 2024 #if AIC_DEBUG_REGISTERS 2025 ahd_reg_print_t ahd_seq_flags_print; 2026 #else 2027 #define ahd_seq_flags_print(regvalue, cur_col, wrap) \ 2028 - ahd_print_register(NULL, 0, "SEQ_FLAGS", 0x133, regvalue, cur_col, wrap) 2029 #endif 2030 2031 #if AIC_DEBUG_REGISTERS 2032 ahd_reg_print_t ahd_saved_scsiid_print; 2033 #else 2034 #define ahd_saved_scsiid_print(regvalue, cur_col, wrap) \ 2035 - ahd_print_register(NULL, 0, "SAVED_SCSIID", 0x134, regvalue, cur_col, wrap) 2036 #endif 2037 2038 #if AIC_DEBUG_REGISTERS 2039 ahd_reg_print_t ahd_saved_lun_print; 2040 #else 2041 #define ahd_saved_lun_print(regvalue, cur_col, wrap) \ 2042 - ahd_print_register(NULL, 0, "SAVED_LUN", 0x135, regvalue, cur_col, wrap) 2043 #endif 2044 2045 #if AIC_DEBUG_REGISTERS 2046 ahd_reg_print_t ahd_lastphase_print; 2047 #else 2048 #define ahd_lastphase_print(regvalue, cur_col, wrap) \ 2049 - ahd_print_register(NULL, 0, "LASTPHASE", 0x136, regvalue, cur_col, wrap) 2050 #endif 2051 2052 #if AIC_DEBUG_REGISTERS 2053 ahd_reg_print_t ahd_qoutfifo_entry_valid_tag_print; 2054 #else 2055 #define ahd_qoutfifo_entry_valid_tag_print(regvalue, cur_col, wrap) \ 2056 - ahd_print_register(NULL, 0, "QOUTFIFO_ENTRY_VALID_TAG", 0x137, regvalue, cur_col, wrap) 2057 - #endif 2058 - 2059 - #if AIC_DEBUG_REGISTERS 2060 - ahd_reg_print_t ahd_shared_data_addr_print; 2061 - #else 2062 - #define ahd_shared_data_addr_print(regvalue, cur_col, wrap) \ 2063 - ahd_print_register(NULL, 0, "SHARED_DATA_ADDR", 0x138, regvalue, cur_col, wrap) 2064 - #endif 2065 - 2066 - #if AIC_DEBUG_REGISTERS 2067 - ahd_reg_print_t ahd_qoutfifo_next_addr_print; 2068 - #else 2069 - #define ahd_qoutfifo_next_addr_print(regvalue, cur_col, wrap) \ 2070 - ahd_print_register(NULL, 0, "QOUTFIFO_NEXT_ADDR", 0x13c, regvalue, cur_col, wrap) 2071 #endif 2072 2073 #if AIC_DEBUG_REGISTERS 2074 ahd_reg_print_t ahd_kernel_tqinpos_print; 2075 #else 2076 #define ahd_kernel_tqinpos_print(regvalue, cur_col, wrap) \ 2077 - ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 0x140, regvalue, cur_col, wrap) 2078 #endif 2079 2080 #if AIC_DEBUG_REGISTERS 2081 ahd_reg_print_t ahd_tqinpos_print; 2082 #else 2083 #define ahd_tqinpos_print(regvalue, cur_col, wrap) \ 2084 - ahd_print_register(NULL, 0, "TQINPOS", 0x141, regvalue, cur_col, wrap) 2085 #endif 2086 2087 #if AIC_DEBUG_REGISTERS 2088 ahd_reg_print_t ahd_arg_1_print; 2089 #else 2090 #define ahd_arg_1_print(regvalue, cur_col, wrap) \ 2091 - ahd_print_register(NULL, 0, "ARG_1", 0x142, regvalue, cur_col, wrap) 2092 #endif 2093 2094 #if AIC_DEBUG_REGISTERS 2095 ahd_reg_print_t ahd_arg_2_print; 2096 #else 2097 #define ahd_arg_2_print(regvalue, cur_col, wrap) \ 2098 - ahd_print_register(NULL, 0, "ARG_2", 0x143, regvalue, cur_col, wrap) 2099 #endif 2100 2101 #if AIC_DEBUG_REGISTERS 2102 ahd_reg_print_t ahd_last_msg_print; 2103 #else 2104 #define ahd_last_msg_print(regvalue, cur_col, wrap) \ 2105 - ahd_print_register(NULL, 0, "LAST_MSG", 0x144, regvalue, cur_col, wrap) 2106 #endif 2107 2108 #if AIC_DEBUG_REGISTERS 2109 ahd_reg_print_t ahd_scsiseq_template_print; 2110 #else 2111 #define ahd_scsiseq_template_print(regvalue, cur_col, wrap) \ 2112 - ahd_print_register(NULL, 0, "SCSISEQ_TEMPLATE", 0x145, regvalue, cur_col, wrap) 2113 #endif 2114 2115 #if AIC_DEBUG_REGISTERS 2116 ahd_reg_print_t ahd_initiator_tag_print; 2117 #else 2118 #define ahd_initiator_tag_print(regvalue, cur_col, wrap) \ 2119 - ahd_print_register(NULL, 0, "INITIATOR_TAG", 0x146, regvalue, cur_col, wrap) 2120 #endif 2121 2122 #if AIC_DEBUG_REGISTERS 2123 ahd_reg_print_t ahd_seq_flags2_print; 2124 #else 2125 #define ahd_seq_flags2_print(regvalue, cur_col, wrap) \ 2126 - ahd_print_register(NULL, 0, "SEQ_FLAGS2", 0x147, regvalue, cur_col, wrap) 2127 #endif 2128 2129 #if AIC_DEBUG_REGISTERS 2130 ahd_reg_print_t ahd_allocfifo_scbptr_print; 2131 #else 2132 #define ahd_allocfifo_scbptr_print(regvalue, cur_col, wrap) \ 2133 - ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 0x148, regvalue, cur_col, wrap) 2134 #endif 2135 2136 #if AIC_DEBUG_REGISTERS 2137 ahd_reg_print_t ahd_int_coalescing_timer_print; 2138 #else 2139 #define ahd_int_coalescing_timer_print(regvalue, cur_col, wrap) \ 2140 - ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 0x14a, regvalue, cur_col, wrap) 2141 #endif 2142 2143 #if AIC_DEBUG_REGISTERS 2144 ahd_reg_print_t ahd_int_coalescing_maxcmds_print; 2145 #else 2146 #define ahd_int_coalescing_maxcmds_print(regvalue, cur_col, wrap) \ 2147 - ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 0x14c, regvalue, cur_col, wrap) 2148 #endif 2149 2150 #if AIC_DEBUG_REGISTERS 2151 ahd_reg_print_t ahd_int_coalescing_mincmds_print; 2152 #else 2153 #define ahd_int_coalescing_mincmds_print(regvalue, cur_col, wrap) \ 2154 - ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 0x14d, regvalue, cur_col, wrap) 2155 #endif 2156 2157 #if AIC_DEBUG_REGISTERS 2158 ahd_reg_print_t ahd_cmds_pending_print; 2159 #else 2160 #define ahd_cmds_pending_print(regvalue, cur_col, wrap) \ 2161 - ahd_print_register(NULL, 0, "CMDS_PENDING", 0x14e, regvalue, cur_col, wrap) 2162 #endif 2163 2164 #if AIC_DEBUG_REGISTERS 2165 ahd_reg_print_t ahd_int_coalescing_cmdcount_print; 2166 #else 2167 #define ahd_int_coalescing_cmdcount_print(regvalue, cur_col, wrap) \ 2168 - ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 0x150, regvalue, cur_col, wrap) 2169 #endif 2170 2171 #if AIC_DEBUG_REGISTERS 2172 ahd_reg_print_t ahd_local_hs_mailbox_print; 2173 #else 2174 #define ahd_local_hs_mailbox_print(regvalue, cur_col, wrap) \ 2175 - ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 0x151, regvalue, cur_col, wrap) 2176 #endif 2177 2178 #if AIC_DEBUG_REGISTERS 2179 ahd_reg_print_t ahd_cmdsize_table_print; 2180 #else 2181 #define ahd_cmdsize_table_print(regvalue, cur_col, wrap) \ 2182 - ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 0x152, regvalue, cur_col, wrap) 2183 #endif 2184 2185 #if AIC_DEBUG_REGISTERS ··· 2455 #define HOST_TQINPOS 0x80 2456 #define ENINT_COALESCE 0x40 2457 2458 - #define CLRSEQINTSTAT 0x0c 2459 - #define CLRSEQ_SWTMRTO 0x10 2460 - #define CLRSEQ_SEQINT 0x08 2461 - #define CLRSEQ_SCSIINT 0x04 2462 - #define CLRSEQ_PCIINT 0x02 2463 - #define CLRSEQ_SPLTINT 0x01 2464 - 2465 #define SEQINTSTAT 0x0c 2466 #define SEQ_SWTMRTO 0x10 2467 #define SEQ_SEQINT 0x08 2468 #define SEQ_SCSIINT 0x04 2469 #define SEQ_PCIINT 0x02 2470 #define SEQ_SPLTINT 0x01 2471 2472 #define SWTIMER 0x0e 2473 ··· 2644 #define BIOSCANCELEN 0x10 2645 #define SPIOEN 0x08 2646 2647 - #define BUSINITID 0x3c 2648 - 2649 #define DLCOUNT 0x3c 2650 2651 #define SXFRCTL1 0x3d 2652 #define BITBUCKET 0x80 ··· 2714 #define SELID_MASK 0xf0 2715 #define ONEBIT 0x08 2716 2717 - #define SBLKCTL 0x4a 2718 - #define DIAGLEDEN 0x80 2719 - #define DIAGLEDON 0x40 2720 - #define ENAB40 0x08 2721 - #define ENAB20 0x04 2722 - #define SELWIDE 0x02 2723 - 2724 #define OPTIONMODE 0x4a 2725 #define OPTIONMODE_DEFAULTS 0x02 2726 #define BIOSCANCTL 0x80 ··· 2722 #define BUSFREEREV 0x10 2723 #define ENDGFORMCHK 0x04 2724 #define AUTO_MSGOUT_DE 0x02 2725 2726 #define SSTAT0 0x4b 2727 #define TARGET 0x80 ··· 2748 #define OVERRUN 0x04 2749 #define SPIORDY 0x02 2750 #define ARBDO 0x01 2751 - 2752 - #define CLRSINT0 0x4b 2753 - #define CLRSELDO 0x40 2754 - #define CLRSELDI 0x20 2755 - #define CLRSELINGO 0x10 2756 - #define CLRIOERR 0x08 2757 - #define CLROVERRUN 0x04 2758 - #define CLRSPIORDY 0x02 2759 - #define CLRARBDO 0x01 2760 2761 #define SIMODE0 0x4b 2762 #define ENSELDO 0x40 ··· 2789 #define BUSFREE_DFF0 0x80 2790 #define BUSFREE_LQO 0x40 2791 2792 #define CLRSINT2 0x4d 2793 #define CLRNONPACKREQ 0x20 2794 #define CLRWIDE_RES 0x04 2795 #define CLRSDONE 0x02 2796 #define CLRDMADONE 0x01 2797 - 2798 - #define SIMODE2 0x4d 2799 - #define ENWIDE_RES 0x04 2800 - #define ENSDONE 0x02 2801 - #define ENDMADONE 0x01 2802 2803 #define PERRDIAG 0x4e 2804 #define HIZERO 0x80 ··· 2892 #define CLRNTRAMPERR 0x02 2893 #define CLROSRAMPERR 0x01 2894 2895 - #define LQOMODE0 0x54 2896 - #define ENLQOTARGSCBPERR 0x10 2897 - #define ENLQOSTOPT2 0x08 2898 - #define ENLQOATNLQ 0x04 2899 - #define ENLQOATNPKT 0x02 2900 - #define ENLQOTCRC 0x01 2901 - 2902 #define LQOSTAT0 0x54 2903 #define LQOTARGSCBPERR 0x10 2904 #define LQOSTOPT2 0x08 ··· 2906 #define CLRLQOATNPKT 0x02 2907 #define CLRLQOTCRC 0x01 2908 2909 #define LQOSTAT1 0x55 2910 #define LQOINITSCBPERR 0x10 2911 #define LQOSTOPI2 0x08 ··· 2933 #define CLRLQOBADQAS 0x04 2934 #define CLRLQOBUSFREE 0x02 2935 #define CLRLQOPHACHGINPKT 0x01 2936 - 2937 - #define LQOMODE1 0x55 2938 - #define ENLQOINITSCBPERR 0x10 2939 - #define ENLQOSTOPI2 0x08 2940 - #define ENLQOBADQAS 0x04 2941 - #define ENLQOBUSFREE 0x02 2942 - #define ENLQOPHACHGINPKT 0x01 2943 2944 #define LQOSTAT2 0x56 2945 #define LQOPKT 0xe0 ··· 3049 3050 #define ANNEXCOL 0x65 3051 3052 #define SCSCHKN 0x66 3053 #define STSELSKIDDIS 0x40 3054 #define CURRFIFODEF 0x20 ··· 3059 #define DFFACTCLR 0x04 3060 #define SHVALIDSTDIS 0x02 3061 #define LSTSGCLRDIS 0x01 3062 - 3063 - #define ANNEXDAT 0x66 3064 3065 #define IOWNID 0x67 3066 ··· 3092 #define PLL_CNTCLR 0x40 3093 #define PLL_RST 0x01 3094 3095 - #define PLL400CNT0 0x6e 3096 - 3097 #define UNFAIRNESS 0x6e 3098 3099 #define HADDR 0x70 3100 ··· 3109 3110 #define HODMAEN 0x7a 3111 3112 - #define SGHADDR 0x7c 3113 - 3114 #define SCBHADDR 0x7c 3115 3116 - #define SGHCNT 0x84 3117 3118 #define SCBHCNT 0x84 3119 3120 #define DFF_THRSH 0x88 3121 #define WR_DFTHRSH 0x70 ··· 3134 #define RD_DFTHRSH_63 0x03 3135 #define RD_DFTHRSH_50 0x02 3136 #define RD_DFTHRSH_25 0x01 3137 - #define WR_DFTHRSH_MIN 0x00 3138 #define RD_DFTHRSH_MIN 0x00 3139 3140 #define ROMADDR 0x8a 3141 ··· 3171 #define DCH1NSEN 0x02 3172 #define DCH0NSEN 0x01 3173 3174 - #define DCHRXMSG1 0x91 3175 - 3176 #define CMCRXMSG1 0x91 3177 3178 - #define DCHRXMSG2 0x92 3179 3180 - #define OVLYRXMSG2 0x92 3181 3182 #define CMCRXMSG2 0x92 3183 3184 #define OST 0x92 3185 3186 #define DCHRXMSG3 0x93 3187 3188 #define CMCRXMSG3 0x93 3189 ··· 3198 #define TSCSERREN 0x02 3199 #define CMPABCDIS 0x01 3200 3201 - #define OVLYRXMSG3 0x93 3202 - 3203 #define OVLYSEQBCNT 0x94 3204 - 3205 - #define CMCSEQBCNT 0x94 3206 3207 #define DCHSEQBCNT 0x94 3208 3209 - #define CMCSPLTSTAT0 0x96 3210 3211 - #define OVLYSPLTSTAT0 0x96 3212 3213 #define DCHSPLTSTAT0 0x96 3214 3215 - #define DCHSPLTSTAT1 0x97 3216 3217 #define CMCSPLTSTAT1 0x97 3218 3219 #define OVLYSPLTSTAT1 0x97 3220 3221 #define SGRXMSG0 0x98 3222 #define CDNUM 0xf8 ··· 3265 #define RXSCEMSG 0x02 3266 #define RXSPLTRSP 0x01 3267 3268 #define SFUNCT 0x9f 3269 #define TEST_GROUP 0xf0 3270 #define TEST_NUM 0x0f 3271 - 3272 - #define SGSPLTSTAT1 0x9f 3273 - #define RXDATABUCKET 0x01 3274 3275 #define DF0PCISTAT 0xa0 3276 ··· 3320 3321 #define CCSGADDR 0xac 3322 3323 - #define CCSCBADDR 0xac 3324 - 3325 #define CCSCBADR_BK 0xac 3326 3327 #define CMC_RAMBIST 0xad 3328 #define SG_ELEMENT_SIZE 0x80 ··· 3332 #define CMC_BUFFER_BIST_FAIL 0x02 3333 #define CMC_BUFFER_BIST_EN 0x01 3334 3335 - #define CCSGCTL 0xad 3336 - #define CCSGEN 0x0c 3337 - #define CCSGDONE 0x80 3338 - #define SG_CACHE_AVAIL 0x10 3339 - #define CCSGENACK 0x08 3340 - #define SG_FETCH_REQ 0x02 3341 - #define CCSGRESET 0x01 3342 - 3343 #define CCSCBCTL 0xad 3344 #define CCSCBDONE 0x80 3345 #define ARRDONE 0x40 ··· 3339 #define CCSCBEN 0x08 3340 #define CCSCBDIR 0x04 3341 #define CCSCBRESET 0x01 3342 3343 #define CCSGRAM 0xb0 3344 ··· 3377 #define SEEDAT 0xbc 3378 3379 #define SEECTL 0xbe 3380 - #define SEEOP_EWEN 0x40 3381 #define SEEOP_WALL 0x40 3382 #define SEEOP_EWDS 0x40 3383 #define SEEOPCODE 0x70 3384 #define SEERST 0x02 ··· 3435 3436 #define WRTBIASCALC 0xc7 3437 3438 - #define DFPTRS 0xc8 3439 - 3440 #define RCVRBIASCALC 0xc8 3441 3442 - #define DFBKPTR 0xc9 3443 3444 #define SKEWCALC 0xc9 3445 3446 #define DFDBCTL 0xcb 3447 #define DFF_CIO_WR_RDY 0x20 ··· 3496 3497 #define DINDEX 0xe4 3498 3499 #define BRKADDR1 0xe6 3500 #define BRKDIS 0x80 3501 - 3502 - #define BRKADDR0 0xe6 3503 3504 #define ALLONES 0xe8 3505 ··· 3515 3516 #define STACK 0xf2 3517 3518 - #define CURADDR 0xf4 3519 - 3520 #define INTVEC1_ADDR 0xf4 3521 3522 - #define INTVEC2_ADDR 0xf6 3523 3524 #define LASTADDR 0xf6 3525 3526 #define LONGJMP_ADDR 0xf8 3527 ··· 3545 3546 #define COMPLETE_DMA_SCB_HEAD 0x12c 3547 3548 - #define QFREEZE_COUNT 0x12e 3549 3550 - #define SAVED_MODE 0x130 3551 3552 - #define MSG_OUT 0x131 3553 3554 - #define DMAPARAMS 0x132 3555 #define PRELOADEN 0x80 3556 #define WIDEODD 0x40 3557 #define SCSIEN 0x20 3558 #define SDMAEN 0x10 3559 #define SDMAENACK 0x10 3560 - #define HDMAENACK 0x08 3561 #define HDMAEN 0x08 3562 #define DIRECTION 0x04 3563 #define FIFOFLUSH 0x02 3564 #define FIFORESET 0x01 3565 3566 - #define SEQ_FLAGS 0x133 3567 #define NOT_IDENTIFIED 0x80 3568 #define NO_CDB_SENT 0x40 3569 #define TARGET_CMD_IS_TAGGED 0x40 ··· 3580 #define SPHASE_PENDING 0x02 3581 #define NO_DISCONNECT 0x01 3582 3583 - #define SAVED_SCSIID 0x134 3584 3585 - #define SAVED_LUN 0x135 3586 3587 - #define LASTPHASE 0x136 3588 #define PHASE_MASK 0xe0 3589 #define CDI 0x80 3590 #define IOI 0x40 ··· 3599 #define P_DATAOUT_DT 0x20 3600 #define P_DATAOUT 0x00 3601 3602 - #define QOUTFIFO_ENTRY_VALID_TAG 0x137 3603 3604 - #define SHARED_DATA_ADDR 0x138 3605 3606 - #define QOUTFIFO_NEXT_ADDR 0x13c 3607 3608 - #define KERNEL_TQINPOS 0x140 3609 3610 - #define TQINPOS 0x141 3611 3612 - #define ARG_1 0x142 3613 - #define RETURN_1 0x142 3614 #define SEND_MSG 0x80 3615 #define SEND_SENSE 0x40 3616 #define SEND_REJ 0x20 ··· 3620 #define CONT_MSG_LOOP_READ 0x03 3621 #define CONT_MSG_LOOP_TARG 0x02 3622 3623 - #define ARG_2 0x143 3624 - #define RETURN_2 0x143 3625 3626 - #define LAST_MSG 0x144 3627 3628 - #define SCSISEQ_TEMPLATE 0x145 3629 #define MANUALCTL 0x40 3630 #define ENSELI 0x20 3631 #define ENRSELI 0x10 ··· 3633 #define ENAUTOATNP 0x02 3634 #define ALTSTIM 0x01 3635 3636 - #define INITIATOR_TAG 0x146 3637 3638 - #define SEQ_FLAGS2 0x147 3639 #define SELECTOUT_QFROZEN 0x04 3640 #define TARGET_MSG_PENDING 0x02 3641 3642 - #define ALLOCFIFO_SCBPTR 0x148 3643 3644 - #define INT_COALESCING_TIMER 0x14a 3645 3646 - #define INT_COALESCING_MAXCMDS 0x14c 3647 3648 - #define INT_COALESCING_MINCMDS 0x14d 3649 3650 - #define CMDS_PENDING 0x14e 3651 3652 - #define INT_COALESCING_CMDCOUNT 0x150 3653 3654 - #define LOCAL_HS_MAILBOX 0x151 3655 3656 - #define CMDSIZE_TABLE 0x152 3657 3658 #define SCB_BASE 0x180 3659 ··· 3728 #define SCB_DISCONNECTED_LISTS 0x1b8 3729 3730 3731 #define AHD_TIMER_US_PER_TICK 0x19 3732 #define SCB_TRANSFER_SIZE_FULL_LUN 0x38 3733 #define STATUS_QUEUE_FULL 0x28 ··· 3761 #define B_CURRFIFO_0 0x02 3762 #define LUNLEN_SINGLE_LEVEL_LUN 0x0f 3763 #define NVRAM_SCB_OFFSET 0x2c 3764 - #define AHD_TIMER_MAX_US 0x18ffe7 3765 - #define AHD_TIMER_MAX_TICKS 0xffff 3766 #define STATUS_PKT_SENSE 0xff 3767 #define CMD_GROUP_CODE_SHIFT 0x05 3768 - #define AHD_SENSE_BUFSIZE 0x100 3769 #define MAX_OFFSET_PACED_BUG 0x7f 3770 - #define BUS_8_BIT 0x00 3771 #define STIMESEL_BUG_ADJ 0x08 3772 #define STIMESEL_MIN 0x18 3773 #define STIMESEL_SHIFT 0x03 3774 #define CCSGRAM_MAXSEGS 0x10 3775 #define INVALID_ADDR 0x80 3776 - #define TARGET_CMD_CMPLT 0xfe 3777 - #define SEEOP_WRAL_ADDR 0x40 3778 #define SEEOP_ERAL_ADDR 0x80 3779 - #define AHD_AMPLITUDE_DEF 0x07 3780 #define AHD_SLEWRATE_DEF_REVB 0x08 3781 - #define AHD_PRECOMP_CUTBACK_37 0x07 3782 #define AHD_PRECOMP_CUTBACK_17 0x04 3783 - #define AHD_PRECOMP_SHIFT 0x00 3784 #define AHD_PRECOMP_MASK 0x07 3785 - #define AHD_ANNEXCOL_PRECOMP_SLEW 0x04 3786 #define SRC_MODE_SHIFT 0x00 3787 #define PKT_OVERRUN_BUFSIZE 0x200 3788 #define SCB_TRANSFER_SIZE_1BYTE_LUN 0x30 ··· 3788 3789 3790 /* Downloaded Constant Definitions */ 3791 #define SCB_TRANSFER_SIZE 0x06 3792 #define PKT_OVERRUN_BUFOFFSET 0x05 3793 #define SG_SIZEOF 0x04 ··· 3796 #define SG_PREFETCH_ALIGN_MASK 0x02 3797 #define SG_PREFETCH_CNT_LIMIT 0x01 3798 #define SG_PREFETCH_CNT 0x00 3799 - #define DOWNLOAD_CONST_COUNT 0x07 3800 3801 3802 /* Exported Labels */ 3803 - #define LABEL_seq_isr 0x269 3804 - #define LABEL_timer_isr 0x265
··· 2 * DO NOT EDIT - This file is automatically generated 3 * from the following source files: 4 * 5 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $ 6 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $ 7 */ 8 typedef int (ahd_reg_print_t)(u_int, u_int *, u_int); 9 typedef struct ahd_reg_parse_entry { ··· 83 #endif 84 85 #if AIC_DEBUG_REGISTERS 86 ahd_reg_print_t ahd_seqintstat_print; 87 #else 88 #define ahd_seqintstat_print(regvalue, cur_col, wrap) \ 89 ahd_print_register(NULL, 0, "SEQINTSTAT", 0x0c, regvalue, cur_col, wrap) 90 + #endif 91 + 92 + #if AIC_DEBUG_REGISTERS 93 + ahd_reg_print_t ahd_clrseqintstat_print; 94 + #else 95 + #define ahd_clrseqintstat_print(regvalue, cur_col, wrap) \ 96 + ahd_print_register(NULL, 0, "CLRSEQINTSTAT", 0x0c, regvalue, cur_col, wrap) 97 #endif 98 99 #if AIC_DEBUG_REGISTERS ··· 412 #endif 413 414 #if AIC_DEBUG_REGISTERS 415 ahd_reg_print_t ahd_dlcount_print; 416 #else 417 #define ahd_dlcount_print(regvalue, cur_col, wrap) \ 418 ahd_print_register(NULL, 0, "DLCOUNT", 0x3c, regvalue, cur_col, wrap) 419 + #endif 420 + 421 + #if AIC_DEBUG_REGISTERS 422 + ahd_reg_print_t ahd_businitid_print; 423 + #else 424 + #define ahd_businitid_print(regvalue, cur_col, wrap) \ 425 + ahd_print_register(NULL, 0, "BUSINITID", 0x3c, regvalue, cur_col, wrap) 426 #endif 427 428 #if AIC_DEBUG_REGISTERS ··· 517 #endif 518 519 #if AIC_DEBUG_REGISTERS 520 ahd_reg_print_t ahd_optionmode_print; 521 #else 522 #define ahd_optionmode_print(regvalue, cur_col, wrap) \ ··· 531 #endif 532 533 #if AIC_DEBUG_REGISTERS 534 + ahd_reg_print_t ahd_sblkctl_print; 535 #else 536 + #define ahd_sblkctl_print(regvalue, cur_col, wrap) \ 537 + ahd_print_register(NULL, 0, "SBLKCTL", 0x4a, regvalue, cur_col, wrap) 538 #endif 539 540 #if AIC_DEBUG_REGISTERS ··· 542 #else 543 #define ahd_clrsint0_print(regvalue, cur_col, wrap) \ 544 ahd_print_register(NULL, 0, "CLRSINT0", 0x4b, regvalue, cur_col, wrap) 545 + #endif 546 + 547 + #if AIC_DEBUG_REGISTERS 548 + ahd_reg_print_t ahd_sstat0_print; 549 + #else 550 + #define ahd_sstat0_print(regvalue, cur_col, wrap) \ 551 + ahd_print_register(NULL, 0, "SSTAT0", 0x4b, regvalue, cur_col, wrap) 552 #endif 553 554 #if AIC_DEBUG_REGISTERS ··· 573 #endif 574 575 #if AIC_DEBUG_REGISTERS 576 ahd_reg_print_t ahd_simode2_print; 577 #else 578 #define ahd_simode2_print(regvalue, cur_col, wrap) \ 579 ahd_print_register(NULL, 0, "SIMODE2", 0x4d, regvalue, cur_col, wrap) 580 + #endif 581 + 582 + #if AIC_DEBUG_REGISTERS 583 + ahd_reg_print_t ahd_clrsint2_print; 584 + #else 585 + #define ahd_clrsint2_print(regvalue, cur_col, wrap) \ 586 + ahd_print_register(NULL, 0, "CLRSINT2", 0x4d, regvalue, cur_col, wrap) 587 #endif 588 589 #if AIC_DEBUG_REGISTERS ··· 685 #endif 686 687 #if AIC_DEBUG_REGISTERS 688 ahd_reg_print_t ahd_lqostat0_print; 689 #else 690 #define ahd_lqostat0_print(regvalue, cur_col, wrap) \ ··· 706 #endif 707 708 #if AIC_DEBUG_REGISTERS 709 + ahd_reg_print_t ahd_lqomode0_print; 710 + #else 711 + #define ahd_lqomode0_print(regvalue, cur_col, wrap) \ 712 + ahd_print_register(NULL, 0, "LQOMODE0", 0x54, regvalue, cur_col, wrap) 713 + #endif 714 + 715 + #if AIC_DEBUG_REGISTERS 716 + ahd_reg_print_t ahd_lqomode1_print; 717 + #else 718 + #define ahd_lqomode1_print(regvalue, cur_col, wrap) \ 719 + ahd_print_register(NULL, 0, "LQOMODE1", 0x55, regvalue, cur_col, wrap) 720 + #endif 721 + 722 + #if AIC_DEBUG_REGISTERS 723 ahd_reg_print_t ahd_lqostat1_print; 724 #else 725 #define ahd_lqostat1_print(regvalue, cur_col, wrap) \ ··· 717 #else 718 #define ahd_clrlqoint1_print(regvalue, cur_col, wrap) \ 719 ahd_print_register(NULL, 0, "CLRLQOINT1", 0x55, regvalue, cur_col, wrap) 720 #endif 721 722 #if AIC_DEBUG_REGISTERS ··· 909 #endif 910 911 #if AIC_DEBUG_REGISTERS 912 ahd_reg_print_t ahd_annexdat_print; 913 #else 914 #define ahd_annexdat_print(regvalue, cur_col, wrap) \ 915 ahd_print_register(NULL, 0, "ANNEXDAT", 0x66, regvalue, cur_col, wrap) 916 + #endif 917 + 918 + #if AIC_DEBUG_REGISTERS 919 + ahd_reg_print_t ahd_scschkn_print; 920 + #else 921 + #define ahd_scschkn_print(regvalue, cur_col, wrap) \ 922 + ahd_print_register(NULL, 0, "SCSCHKN", 0x66, regvalue, cur_col, wrap) 923 #endif 924 925 #if AIC_DEBUG_REGISTERS ··· 1000 #endif 1001 1002 #if AIC_DEBUG_REGISTERS 1003 ahd_reg_print_t ahd_unfairness_print; 1004 #else 1005 #define ahd_unfairness_print(regvalue, cur_col, wrap) \ 1006 ahd_print_register(NULL, 0, "UNFAIRNESS", 0x6e, regvalue, cur_col, wrap) 1007 + #endif 1008 + 1009 + #if AIC_DEBUG_REGISTERS 1010 + ahd_reg_print_t ahd_pll400cnt0_print; 1011 + #else 1012 + #define ahd_pll400cnt0_print(regvalue, cur_col, wrap) \ 1013 + ahd_print_register(NULL, 0, "PLL400CNT0", 0x6e, regvalue, cur_col, wrap) 1014 #endif 1015 1016 #if AIC_DEBUG_REGISTERS ··· 1056 #endif 1057 1058 #if AIC_DEBUG_REGISTERS 1059 ahd_reg_print_t ahd_scbhaddr_print; 1060 #else 1061 #define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ ··· 1070 #endif 1071 1072 #if AIC_DEBUG_REGISTERS 1073 + ahd_reg_print_t ahd_sghaddr_print; 1074 #else 1075 + #define ahd_sghaddr_print(regvalue, cur_col, wrap) \ 1076 + ahd_print_register(NULL, 0, "SGHADDR", 0x7c, regvalue, cur_col, wrap) 1077 #endif 1078 1079 #if AIC_DEBUG_REGISTERS ··· 1081 #else 1082 #define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ 1083 ahd_print_register(NULL, 0, "SCBHCNT", 0x84, regvalue, cur_col, wrap) 1084 + #endif 1085 + 1086 + #if AIC_DEBUG_REGISTERS 1087 + ahd_reg_print_t ahd_sghcnt_print; 1088 + #else 1089 + #define ahd_sghcnt_print(regvalue, cur_col, wrap) \ 1090 + ahd_print_register(NULL, 0, "SGHCNT", 0x84, regvalue, cur_col, wrap) 1091 #endif 1092 1093 #if AIC_DEBUG_REGISTERS ··· 1154 #endif 1155 1156 #if AIC_DEBUG_REGISTERS 1157 ahd_reg_print_t ahd_cmcrxmsg1_print; 1158 #else 1159 #define ahd_cmcrxmsg1_print(regvalue, cur_col, wrap) \ ··· 1168 #endif 1169 1170 #if AIC_DEBUG_REGISTERS 1171 + ahd_reg_print_t ahd_dchrxmsg1_print; 1172 + #else 1173 + #define ahd_dchrxmsg1_print(regvalue, cur_col, wrap) \ 1174 + ahd_print_register(NULL, 0, "DCHRXMSG1", 0x91, regvalue, cur_col, wrap) 1175 + #endif 1176 + 1177 + #if AIC_DEBUG_REGISTERS 1178 ahd_reg_print_t ahd_dchrxmsg2_print; 1179 #else 1180 #define ahd_dchrxmsg2_print(regvalue, cur_col, wrap) \ 1181 ahd_print_register(NULL, 0, "DCHRXMSG2", 0x92, regvalue, cur_col, wrap) 1182 #endif 1183 1184 #if AIC_DEBUG_REGISTERS ··· 1196 #endif 1197 1198 #if AIC_DEBUG_REGISTERS 1199 + ahd_reg_print_t ahd_ovlyrxmsg2_print; 1200 + #else 1201 + #define ahd_ovlyrxmsg2_print(regvalue, cur_col, wrap) \ 1202 + ahd_print_register(NULL, 0, "OVLYRXMSG2", 0x92, regvalue, cur_col, wrap) 1203 + #endif 1204 + 1205 + #if AIC_DEBUG_REGISTERS 1206 ahd_reg_print_t ahd_dchrxmsg3_print; 1207 #else 1208 #define ahd_dchrxmsg3_print(regvalue, cur_col, wrap) \ 1209 ahd_print_register(NULL, 0, "DCHRXMSG3", 0x93, regvalue, cur_col, wrap) 1210 + #endif 1211 + 1212 + #if AIC_DEBUG_REGISTERS 1213 + ahd_reg_print_t ahd_ovlyrxmsg3_print; 1214 + #else 1215 + #define ahd_ovlyrxmsg3_print(regvalue, cur_col, wrap) \ 1216 + ahd_print_register(NULL, 0, "OVLYRXMSG3", 0x93, regvalue, cur_col, wrap) 1217 #endif 1218 1219 #if AIC_DEBUG_REGISTERS ··· 1217 #endif 1218 1219 #if AIC_DEBUG_REGISTERS 1220 ahd_reg_print_t ahd_ovlyseqbcnt_print; 1221 #else 1222 #define ahd_ovlyseqbcnt_print(regvalue, cur_col, wrap) \ 1223 ahd_print_register(NULL, 0, "OVLYSEQBCNT", 0x94, regvalue, cur_col, wrap) 1224 #endif 1225 1226 #if AIC_DEBUG_REGISTERS ··· 1245 #endif 1246 1247 #if AIC_DEBUG_REGISTERS 1248 + ahd_reg_print_t ahd_cmcseqbcnt_print; 1249 + #else 1250 + #define ahd_cmcseqbcnt_print(regvalue, cur_col, wrap) \ 1251 + ahd_print_register(NULL, 0, "CMCSEQBCNT", 0x94, regvalue, cur_col, wrap) 1252 + #endif 1253 + 1254 + #if AIC_DEBUG_REGISTERS 1255 ahd_reg_print_t ahd_cmcspltstat0_print; 1256 #else 1257 #define ahd_cmcspltstat0_print(regvalue, cur_col, wrap) \ 1258 ahd_print_register(NULL, 0, "CMCSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 1259 #endif 1260 1261 #if AIC_DEBUG_REGISTERS ··· 1266 #endif 1267 1268 #if AIC_DEBUG_REGISTERS 1269 + ahd_reg_print_t ahd_ovlyspltstat0_print; 1270 #else 1271 + #define ahd_ovlyspltstat0_print(regvalue, cur_col, wrap) \ 1272 + ahd_print_register(NULL, 0, "OVLYSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 1273 #endif 1274 1275 #if AIC_DEBUG_REGISTERS ··· 1284 #else 1285 #define ahd_ovlyspltstat1_print(regvalue, cur_col, wrap) \ 1286 ahd_print_register(NULL, 0, "OVLYSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 1287 + #endif 1288 + 1289 + #if AIC_DEBUG_REGISTERS 1290 + ahd_reg_print_t ahd_dchspltstat1_print; 1291 + #else 1292 + #define ahd_dchspltstat1_print(regvalue, cur_col, wrap) \ 1293 + ahd_print_register(NULL, 0, "DCHSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 1294 #endif 1295 1296 #if AIC_DEBUG_REGISTERS ··· 1378 #endif 1379 1380 #if AIC_DEBUG_REGISTERS 1381 ahd_reg_print_t ahd_sgspltstat1_print; 1382 #else 1383 #define ahd_sgspltstat1_print(regvalue, cur_col, wrap) \ 1384 ahd_print_register(NULL, 0, "SGSPLTSTAT1", 0x9f, regvalue, cur_col, wrap) 1385 + #endif 1386 + 1387 + #if AIC_DEBUG_REGISTERS 1388 + ahd_reg_print_t ahd_sfunct_print; 1389 + #else 1390 + #define ahd_sfunct_print(regvalue, cur_col, wrap) \ 1391 + ahd_print_register(NULL, 0, "SFUNCT", 0x9f, regvalue, cur_col, wrap) 1392 #endif 1393 1394 #if AIC_DEBUG_REGISTERS ··· 1504 #endif 1505 1506 #if AIC_DEBUG_REGISTERS 1507 ahd_reg_print_t ahd_ccscbadr_bk_print; 1508 #else 1509 #define ahd_ccscbadr_bk_print(regvalue, cur_col, wrap) \ 1510 ahd_print_register(NULL, 0, "CCSCBADR_BK", 0xac, regvalue, cur_col, wrap) 1511 + #endif 1512 + 1513 + #if AIC_DEBUG_REGISTERS 1514 + ahd_reg_print_t ahd_ccscbaddr_print; 1515 + #else 1516 + #define ahd_ccscbaddr_print(regvalue, cur_col, wrap) \ 1517 + ahd_print_register(NULL, 0, "CCSCBADDR", 0xac, regvalue, cur_col, wrap) 1518 #endif 1519 1520 #if AIC_DEBUG_REGISTERS ··· 1525 #endif 1526 1527 #if AIC_DEBUG_REGISTERS 1528 ahd_reg_print_t ahd_ccscbctl_print; 1529 #else 1530 #define ahd_ccscbctl_print(regvalue, cur_col, wrap) \ 1531 ahd_print_register(NULL, 0, "CCSCBCTL", 0xad, regvalue, cur_col, wrap) 1532 + #endif 1533 + 1534 + #if AIC_DEBUG_REGISTERS 1535 + ahd_reg_print_t ahd_ccsgctl_print; 1536 + #else 1537 + #define ahd_ccsgctl_print(regvalue, cur_col, wrap) \ 1538 + ahd_print_register(NULL, 0, "CCSGCTL", 0xad, regvalue, cur_col, wrap) 1539 #endif 1540 1541 #if AIC_DEBUG_REGISTERS ··· 1707 #endif 1708 1709 #if AIC_DEBUG_REGISTERS 1710 ahd_reg_print_t ahd_rcvrbiascalc_print; 1711 #else 1712 #define ahd_rcvrbiascalc_print(regvalue, cur_col, wrap) \ ··· 1721 #endif 1722 1723 #if AIC_DEBUG_REGISTERS 1724 + ahd_reg_print_t ahd_dfptrs_print; 1725 #else 1726 + #define ahd_dfptrs_print(regvalue, cur_col, wrap) \ 1727 + ahd_print_register(NULL, 0, "DFPTRS", 0xc8, regvalue, cur_col, wrap) 1728 #endif 1729 1730 #if AIC_DEBUG_REGISTERS ··· 1732 #else 1733 #define ahd_skewcalc_print(regvalue, cur_col, wrap) \ 1734 ahd_print_register(NULL, 0, "SKEWCALC", 0xc9, regvalue, cur_col, wrap) 1735 + #endif 1736 + 1737 + #if AIC_DEBUG_REGISTERS 1738 + ahd_reg_print_t ahd_dfbkptr_print; 1739 + #else 1740 + #define ahd_dfbkptr_print(regvalue, cur_col, wrap) \ 1741 + ahd_print_register(NULL, 0, "DFBKPTR", 0xc9, regvalue, cur_col, wrap) 1742 #endif 1743 1744 #if AIC_DEBUG_REGISTERS ··· 1826 #endif 1827 1828 #if AIC_DEBUG_REGISTERS 1829 ahd_reg_print_t ahd_brkaddr0_print; 1830 #else 1831 #define ahd_brkaddr0_print(regvalue, cur_col, wrap) \ 1832 ahd_print_register(NULL, 0, "BRKADDR0", 0xe6, regvalue, cur_col, wrap) 1833 + #endif 1834 + 1835 + #if AIC_DEBUG_REGISTERS 1836 + ahd_reg_print_t ahd_brkaddr1_print; 1837 + #else 1838 + #define ahd_brkaddr1_print(regvalue, cur_col, wrap) \ 1839 + ahd_print_register(NULL, 0, "BRKADDR1", 0xe6, regvalue, cur_col, wrap) 1840 #endif 1841 1842 #if AIC_DEBUG_REGISTERS ··· 1889 #endif 1890 1891 #if AIC_DEBUG_REGISTERS 1892 ahd_reg_print_t ahd_intvec1_addr_print; 1893 #else 1894 #define ahd_intvec1_addr_print(regvalue, cur_col, wrap) \ ··· 1903 #endif 1904 1905 #if AIC_DEBUG_REGISTERS 1906 + ahd_reg_print_t ahd_curaddr_print; 1907 #else 1908 + #define ahd_curaddr_print(regvalue, cur_col, wrap) \ 1909 + ahd_print_register(NULL, 0, "CURADDR", 0xf4, regvalue, cur_col, wrap) 1910 #endif 1911 1912 #if AIC_DEBUG_REGISTERS ··· 1914 #else 1915 #define ahd_lastaddr_print(regvalue, cur_col, wrap) \ 1916 ahd_print_register(NULL, 0, "LASTADDR", 0xf6, regvalue, cur_col, wrap) 1917 + #endif 1918 + 1919 + #if AIC_DEBUG_REGISTERS 1920 + ahd_reg_print_t ahd_intvec2_addr_print; 1921 + #else 1922 + #define ahd_intvec2_addr_print(regvalue, cur_col, wrap) \ 1923 + ahd_print_register(NULL, 0, "INTVEC2_ADDR", 0xf6, regvalue, cur_col, wrap) 1924 #endif 1925 1926 #if AIC_DEBUG_REGISTERS ··· 1994 #endif 1995 1996 #if AIC_DEBUG_REGISTERS 1997 + ahd_reg_print_t ahd_complete_dma_scb_tail_print; 1998 + #else 1999 + #define ahd_complete_dma_scb_tail_print(regvalue, cur_col, wrap) \ 2000 + ahd_print_register(NULL, 0, "COMPLETE_DMA_SCB_TAIL", 0x12e, regvalue, cur_col, wrap) 2001 + #endif 2002 + 2003 + #if AIC_DEBUG_REGISTERS 2004 + ahd_reg_print_t ahd_complete_on_qfreeze_head_print; 2005 + #else 2006 + #define ahd_complete_on_qfreeze_head_print(regvalue, cur_col, wrap) \ 2007 + ahd_print_register(NULL, 0, "COMPLETE_ON_QFREEZE_HEAD", 0x130, regvalue, cur_col, wrap) 2008 + #endif 2009 + 2010 + #if AIC_DEBUG_REGISTERS 2011 ahd_reg_print_t ahd_qfreeze_count_print; 2012 #else 2013 #define ahd_qfreeze_count_print(regvalue, cur_col, wrap) \ 2014 + ahd_print_register(NULL, 0, "QFREEZE_COUNT", 0x132, regvalue, cur_col, wrap) 2015 + #endif 2016 + 2017 + #if AIC_DEBUG_REGISTERS 2018 + ahd_reg_print_t ahd_kernel_qfreeze_count_print; 2019 + #else 2020 + #define ahd_kernel_qfreeze_count_print(regvalue, cur_col, wrap) \ 2021 + ahd_print_register(NULL, 0, "KERNEL_QFREEZE_COUNT", 0x134, regvalue, cur_col, wrap) 2022 #endif 2023 2024 #if AIC_DEBUG_REGISTERS 2025 ahd_reg_print_t ahd_saved_mode_print; 2026 #else 2027 #define ahd_saved_mode_print(regvalue, cur_col, wrap) \ 2028 + ahd_print_register(NULL, 0, "SAVED_MODE", 0x136, regvalue, cur_col, wrap) 2029 #endif 2030 2031 #if AIC_DEBUG_REGISTERS 2032 ahd_reg_print_t ahd_msg_out_print; 2033 #else 2034 #define ahd_msg_out_print(regvalue, cur_col, wrap) \ 2035 + ahd_print_register(NULL, 0, "MSG_OUT", 0x137, regvalue, cur_col, wrap) 2036 #endif 2037 2038 #if AIC_DEBUG_REGISTERS 2039 ahd_reg_print_t ahd_dmaparams_print; 2040 #else 2041 #define ahd_dmaparams_print(regvalue, cur_col, wrap) \ 2042 + ahd_print_register(NULL, 0, "DMAPARAMS", 0x138, regvalue, cur_col, wrap) 2043 #endif 2044 2045 #if AIC_DEBUG_REGISTERS 2046 ahd_reg_print_t ahd_seq_flags_print; 2047 #else 2048 #define ahd_seq_flags_print(regvalue, cur_col, wrap) \ 2049 + ahd_print_register(NULL, 0, "SEQ_FLAGS", 0x139, regvalue, cur_col, wrap) 2050 #endif 2051 2052 #if AIC_DEBUG_REGISTERS 2053 ahd_reg_print_t ahd_saved_scsiid_print; 2054 #else 2055 #define ahd_saved_scsiid_print(regvalue, cur_col, wrap) \ 2056 + ahd_print_register(NULL, 0, "SAVED_SCSIID", 0x13a, regvalue, cur_col, wrap) 2057 #endif 2058 2059 #if AIC_DEBUG_REGISTERS 2060 ahd_reg_print_t ahd_saved_lun_print; 2061 #else 2062 #define ahd_saved_lun_print(regvalue, cur_col, wrap) \ 2063 + ahd_print_register(NULL, 0, "SAVED_LUN", 0x13b, regvalue, cur_col, wrap) 2064 #endif 2065 2066 #if AIC_DEBUG_REGISTERS 2067 ahd_reg_print_t ahd_lastphase_print; 2068 #else 2069 #define ahd_lastphase_print(regvalue, cur_col, wrap) \ 2070 + ahd_print_register(NULL, 0, "LASTPHASE", 0x13c, regvalue, cur_col, wrap) 2071 #endif 2072 2073 #if AIC_DEBUG_REGISTERS 2074 ahd_reg_print_t ahd_qoutfifo_entry_valid_tag_print; 2075 #else 2076 #define ahd_qoutfifo_entry_valid_tag_print(regvalue, cur_col, wrap) \ 2077 + ahd_print_register(NULL, 0, "QOUTFIFO_ENTRY_VALID_TAG", 0x13d, regvalue, cur_col, wrap) 2078 #endif 2079 2080 #if AIC_DEBUG_REGISTERS 2081 ahd_reg_print_t ahd_kernel_tqinpos_print; 2082 #else 2083 #define ahd_kernel_tqinpos_print(regvalue, cur_col, wrap) \ 2084 + ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 0x13e, regvalue, cur_col, wrap) 2085 #endif 2086 2087 #if AIC_DEBUG_REGISTERS 2088 ahd_reg_print_t ahd_tqinpos_print; 2089 #else 2090 #define ahd_tqinpos_print(regvalue, cur_col, wrap) \ 2091 + ahd_print_register(NULL, 0, "TQINPOS", 0x13f, regvalue, cur_col, wrap) 2092 + #endif 2093 + 2094 + #if AIC_DEBUG_REGISTERS 2095 + ahd_reg_print_t ahd_shared_data_addr_print; 2096 + #else 2097 + #define ahd_shared_data_addr_print(regvalue, cur_col, wrap) \ 2098 + ahd_print_register(NULL, 0, "SHARED_DATA_ADDR", 0x140, regvalue, cur_col, wrap) 2099 + #endif 2100 + 2101 + #if AIC_DEBUG_REGISTERS 2102 + ahd_reg_print_t ahd_qoutfifo_next_addr_print; 2103 + #else 2104 + #define ahd_qoutfifo_next_addr_print(regvalue, cur_col, wrap) \ 2105 + ahd_print_register(NULL, 0, "QOUTFIFO_NEXT_ADDR", 0x144, regvalue, cur_col, wrap) 2106 #endif 2107 2108 #if AIC_DEBUG_REGISTERS 2109 ahd_reg_print_t ahd_arg_1_print; 2110 #else 2111 #define ahd_arg_1_print(regvalue, cur_col, wrap) \ 2112 + ahd_print_register(NULL, 0, "ARG_1", 0x148, regvalue, cur_col, wrap) 2113 #endif 2114 2115 #if AIC_DEBUG_REGISTERS 2116 ahd_reg_print_t ahd_arg_2_print; 2117 #else 2118 #define ahd_arg_2_print(regvalue, cur_col, wrap) \ 2119 + ahd_print_register(NULL, 0, "ARG_2", 0x149, regvalue, cur_col, wrap) 2120 #endif 2121 2122 #if AIC_DEBUG_REGISTERS 2123 ahd_reg_print_t ahd_last_msg_print; 2124 #else 2125 #define ahd_last_msg_print(regvalue, cur_col, wrap) \ 2126 + ahd_print_register(NULL, 0, "LAST_MSG", 0x14a, regvalue, cur_col, wrap) 2127 #endif 2128 2129 #if AIC_DEBUG_REGISTERS 2130 ahd_reg_print_t ahd_scsiseq_template_print; 2131 #else 2132 #define ahd_scsiseq_template_print(regvalue, cur_col, wrap) \ 2133 + ahd_print_register(NULL, 0, "SCSISEQ_TEMPLATE", 0x14b, regvalue, cur_col, wrap) 2134 #endif 2135 2136 #if AIC_DEBUG_REGISTERS 2137 ahd_reg_print_t ahd_initiator_tag_print; 2138 #else 2139 #define ahd_initiator_tag_print(regvalue, cur_col, wrap) \ 2140 + ahd_print_register(NULL, 0, "INITIATOR_TAG", 0x14c, regvalue, cur_col, wrap) 2141 #endif 2142 2143 #if AIC_DEBUG_REGISTERS 2144 ahd_reg_print_t ahd_seq_flags2_print; 2145 #else 2146 #define ahd_seq_flags2_print(regvalue, cur_col, wrap) \ 2147 + ahd_print_register(NULL, 0, "SEQ_FLAGS2", 0x14d, regvalue, cur_col, wrap) 2148 #endif 2149 2150 #if AIC_DEBUG_REGISTERS 2151 ahd_reg_print_t ahd_allocfifo_scbptr_print; 2152 #else 2153 #define ahd_allocfifo_scbptr_print(regvalue, cur_col, wrap) \ 2154 + ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 0x14e, regvalue, cur_col, wrap) 2155 #endif 2156 2157 #if AIC_DEBUG_REGISTERS 2158 ahd_reg_print_t ahd_int_coalescing_timer_print; 2159 #else 2160 #define ahd_int_coalescing_timer_print(regvalue, cur_col, wrap) \ 2161 + ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 0x150, regvalue, cur_col, wrap) 2162 #endif 2163 2164 #if AIC_DEBUG_REGISTERS 2165 ahd_reg_print_t ahd_int_coalescing_maxcmds_print; 2166 #else 2167 #define ahd_int_coalescing_maxcmds_print(regvalue, cur_col, wrap) \ 2168 + ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 0x152, regvalue, cur_col, wrap) 2169 #endif 2170 2171 #if AIC_DEBUG_REGISTERS 2172 ahd_reg_print_t ahd_int_coalescing_mincmds_print; 2173 #else 2174 #define ahd_int_coalescing_mincmds_print(regvalue, cur_col, wrap) \ 2175 + ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 0x153, regvalue, cur_col, wrap) 2176 #endif 2177 2178 #if AIC_DEBUG_REGISTERS 2179 ahd_reg_print_t ahd_cmds_pending_print; 2180 #else 2181 #define ahd_cmds_pending_print(regvalue, cur_col, wrap) \ 2182 + ahd_print_register(NULL, 0, "CMDS_PENDING", 0x154, regvalue, cur_col, wrap) 2183 #endif 2184 2185 #if AIC_DEBUG_REGISTERS 2186 ahd_reg_print_t ahd_int_coalescing_cmdcount_print; 2187 #else 2188 #define ahd_int_coalescing_cmdcount_print(regvalue, cur_col, wrap) \ 2189 + ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 0x156, regvalue, cur_col, wrap) 2190 #endif 2191 2192 #if AIC_DEBUG_REGISTERS 2193 ahd_reg_print_t ahd_local_hs_mailbox_print; 2194 #else 2195 #define ahd_local_hs_mailbox_print(regvalue, cur_col, wrap) \ 2196 + ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 0x157, regvalue, cur_col, wrap) 2197 #endif 2198 2199 #if AIC_DEBUG_REGISTERS 2200 ahd_reg_print_t ahd_cmdsize_table_print; 2201 #else 2202 #define ahd_cmdsize_table_print(regvalue, cur_col, wrap) \ 2203 + ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 0x158, regvalue, cur_col, wrap) 2204 #endif 2205 2206 #if AIC_DEBUG_REGISTERS ··· 2434 #define HOST_TQINPOS 0x80 2435 #define ENINT_COALESCE 0x40 2436 2437 #define SEQINTSTAT 0x0c 2438 #define SEQ_SWTMRTO 0x10 2439 #define SEQ_SEQINT 0x08 2440 #define SEQ_SCSIINT 0x04 2441 #define SEQ_PCIINT 0x02 2442 #define SEQ_SPLTINT 0x01 2443 + 2444 + #define CLRSEQINTSTAT 0x0c 2445 + #define CLRSEQ_SWTMRTO 0x10 2446 + #define CLRSEQ_SEQINT 0x08 2447 + #define CLRSEQ_SCSIINT 0x04 2448 + #define CLRSEQ_PCIINT 0x02 2449 + #define CLRSEQ_SPLTINT 0x01 2450 2451 #define SWTIMER 0x0e 2452 ··· 2623 #define BIOSCANCELEN 0x10 2624 #define SPIOEN 0x08 2625 2626 #define DLCOUNT 0x3c 2627 + 2628 + #define BUSINITID 0x3c 2629 2630 #define SXFRCTL1 0x3d 2631 #define BITBUCKET 0x80 ··· 2693 #define SELID_MASK 0xf0 2694 #define ONEBIT 0x08 2695 2696 #define OPTIONMODE 0x4a 2697 #define OPTIONMODE_DEFAULTS 0x02 2698 #define BIOSCANCTL 0x80 ··· 2708 #define BUSFREEREV 0x10 2709 #define ENDGFORMCHK 0x04 2710 #define AUTO_MSGOUT_DE 0x02 2711 + 2712 + #define SBLKCTL 0x4a 2713 + #define DIAGLEDEN 0x80 2714 + #define DIAGLEDON 0x40 2715 + #define ENAB40 0x08 2716 + #define ENAB20 0x04 2717 + #define SELWIDE 0x02 2718 + 2719 + #define CLRSINT0 0x4b 2720 + #define CLRSELDO 0x40 2721 + #define CLRSELDI 0x20 2722 + #define CLRSELINGO 0x10 2723 + #define CLRIOERR 0x08 2724 + #define CLROVERRUN 0x04 2725 + #define CLRSPIORDY 0x02 2726 + #define CLRARBDO 0x01 2727 2728 #define SSTAT0 0x4b 2729 #define TARGET 0x80 ··· 2718 #define OVERRUN 0x04 2719 #define SPIORDY 0x02 2720 #define ARBDO 0x01 2721 2722 #define SIMODE0 0x4b 2723 #define ENSELDO 0x40 ··· 2768 #define BUSFREE_DFF0 0x80 2769 #define BUSFREE_LQO 0x40 2770 2771 + #define SIMODE2 0x4d 2772 + #define ENWIDE_RES 0x04 2773 + #define ENSDONE 0x02 2774 + #define ENDMADONE 0x01 2775 + 2776 #define CLRSINT2 0x4d 2777 #define CLRNONPACKREQ 0x20 2778 #define CLRWIDE_RES 0x04 2779 #define CLRSDONE 0x02 2780 #define CLRDMADONE 0x01 2781 2782 #define PERRDIAG 0x4e 2783 #define HIZERO 0x80 ··· 2871 #define CLRNTRAMPERR 0x02 2872 #define CLROSRAMPERR 0x01 2873 2874 #define LQOSTAT0 0x54 2875 #define LQOTARGSCBPERR 0x10 2876 #define LQOSTOPT2 0x08 ··· 2892 #define CLRLQOATNPKT 0x02 2893 #define CLRLQOTCRC 0x01 2894 2895 + #define LQOMODE0 0x54 2896 + #define ENLQOTARGSCBPERR 0x10 2897 + #define ENLQOSTOPT2 0x08 2898 + #define ENLQOATNLQ 0x04 2899 + #define ENLQOATNPKT 0x02 2900 + #define ENLQOTCRC 0x01 2901 + 2902 + #define LQOMODE1 0x55 2903 + #define ENLQOINITSCBPERR 0x10 2904 + #define ENLQOSTOPI2 0x08 2905 + #define ENLQOBADQAS 0x04 2906 + #define ENLQOBUSFREE 0x02 2907 + #define ENLQOPHACHGINPKT 0x01 2908 + 2909 #define LQOSTAT1 0x55 2910 #define LQOINITSCBPERR 0x10 2911 #define LQOSTOPI2 0x08 ··· 2905 #define CLRLQOBADQAS 0x04 2906 #define CLRLQOBUSFREE 0x02 2907 #define CLRLQOPHACHGINPKT 0x01 2908 2909 #define LQOSTAT2 0x56 2910 #define LQOPKT 0xe0 ··· 3028 3029 #define ANNEXCOL 0x65 3030 3031 + #define ANNEXDAT 0x66 3032 + 3033 #define SCSCHKN 0x66 3034 #define STSELSKIDDIS 0x40 3035 #define CURRFIFODEF 0x20 ··· 3036 #define DFFACTCLR 0x04 3037 #define SHVALIDSTDIS 0x02 3038 #define LSTSGCLRDIS 0x01 3039 3040 #define IOWNID 0x67 3041 ··· 3071 #define PLL_CNTCLR 0x40 3072 #define PLL_RST 0x01 3073 3074 #define UNFAIRNESS 0x6e 3075 + 3076 + #define PLL400CNT0 0x6e 3077 3078 #define HADDR 0x70 3079 ··· 3088 3089 #define HODMAEN 0x7a 3090 3091 #define SCBHADDR 0x7c 3092 3093 + #define SGHADDR 0x7c 3094 3095 #define SCBHCNT 0x84 3096 + 3097 + #define SGHCNT 0x84 3098 3099 #define DFF_THRSH 0x88 3100 #define WR_DFTHRSH 0x70 ··· 3113 #define RD_DFTHRSH_63 0x03 3114 #define RD_DFTHRSH_50 0x02 3115 #define RD_DFTHRSH_25 0x01 3116 #define RD_DFTHRSH_MIN 0x00 3117 + #define WR_DFTHRSH_MIN 0x00 3118 3119 #define ROMADDR 0x8a 3120 ··· 3150 #define DCH1NSEN 0x02 3151 #define DCH0NSEN 0x01 3152 3153 #define CMCRXMSG1 0x91 3154 3155 + #define DCHRXMSG1 0x91 3156 3157 + #define DCHRXMSG2 0x92 3158 3159 #define CMCRXMSG2 0x92 3160 3161 #define OST 0x92 3162 3163 + #define OVLYRXMSG2 0x92 3164 + 3165 #define DCHRXMSG3 0x93 3166 + 3167 + #define OVLYRXMSG3 0x93 3168 3169 #define CMCRXMSG3 0x93 3170 ··· 3175 #define TSCSERREN 0x02 3176 #define CMPABCDIS 0x01 3177 3178 #define OVLYSEQBCNT 0x94 3179 3180 #define DCHSEQBCNT 0x94 3181 3182 + #define CMCSEQBCNT 0x94 3183 3184 + #define CMCSPLTSTAT0 0x96 3185 3186 #define DCHSPLTSTAT0 0x96 3187 3188 + #define OVLYSPLTSTAT0 0x96 3189 3190 #define CMCSPLTSTAT1 0x97 3191 3192 #define OVLYSPLTSTAT1 0x97 3193 + 3194 + #define DCHSPLTSTAT1 0x97 3195 3196 #define SGRXMSG0 0x98 3197 #define CDNUM 0xf8 ··· 3244 #define RXSCEMSG 0x02 3245 #define RXSPLTRSP 0x01 3246 3247 + #define SGSPLTSTAT1 0x9f 3248 + #define RXDATABUCKET 0x01 3249 + 3250 #define SFUNCT 0x9f 3251 #define TEST_GROUP 0xf0 3252 #define TEST_NUM 0x0f 3253 3254 #define DF0PCISTAT 0xa0 3255 ··· 3299 3300 #define CCSGADDR 0xac 3301 3302 #define CCSCBADR_BK 0xac 3303 + 3304 + #define CCSCBADDR 0xac 3305 3306 #define CMC_RAMBIST 0xad 3307 #define SG_ELEMENT_SIZE 0x80 ··· 3311 #define CMC_BUFFER_BIST_FAIL 0x02 3312 #define CMC_BUFFER_BIST_EN 0x01 3313 3314 #define CCSCBCTL 0xad 3315 #define CCSCBDONE 0x80 3316 #define ARRDONE 0x40 ··· 3326 #define CCSCBEN 0x08 3327 #define CCSCBDIR 0x04 3328 #define CCSCBRESET 0x01 3329 + 3330 + #define CCSGCTL 0xad 3331 + #define CCSGEN 0x0c 3332 + #define CCSGDONE 0x80 3333 + #define SG_CACHE_AVAIL 0x10 3334 + #define CCSGENACK 0x08 3335 + #define SG_FETCH_REQ 0x02 3336 + #define CCSGRESET 0x01 3337 3338 #define CCSGRAM 0xb0 3339 ··· 3356 #define SEEDAT 0xbc 3357 3358 #define SEECTL 0xbe 3359 #define SEEOP_WALL 0x40 3360 + #define SEEOP_EWEN 0x40 3361 #define SEEOP_EWDS 0x40 3362 #define SEEOPCODE 0x70 3363 #define SEERST 0x02 ··· 3414 3415 #define WRTBIASCALC 0xc7 3416 3417 #define RCVRBIASCALC 0xc8 3418 3419 + #define DFPTRS 0xc8 3420 3421 #define SKEWCALC 0xc9 3422 + 3423 + #define DFBKPTR 0xc9 3424 3425 #define DFDBCTL 0xcb 3426 #define DFF_CIO_WR_RDY 0x20 ··· 3475 3476 #define DINDEX 0xe4 3477 3478 + #define BRKADDR0 0xe6 3479 + 3480 #define BRKADDR1 0xe6 3481 #define BRKDIS 0x80 3482 3483 #define ALLONES 0xe8 3484 ··· 3494 3495 #define STACK 0xf2 3496 3497 #define INTVEC1_ADDR 0xf4 3498 3499 + #define CURADDR 0xf4 3500 3501 #define LASTADDR 0xf6 3502 + 3503 + #define INTVEC2_ADDR 0xf6 3504 3505 #define LONGJMP_ADDR 0xf8 3506 ··· 3524 3525 #define COMPLETE_DMA_SCB_HEAD 0x12c 3526 3527 + #define COMPLETE_DMA_SCB_TAIL 0x12e 3528 3529 + #define COMPLETE_ON_QFREEZE_HEAD 0x130 3530 3531 + #define QFREEZE_COUNT 0x132 3532 3533 + #define KERNEL_QFREEZE_COUNT 0x134 3534 + 3535 + #define SAVED_MODE 0x136 3536 + 3537 + #define MSG_OUT 0x137 3538 + 3539 + #define DMAPARAMS 0x138 3540 #define PRELOADEN 0x80 3541 #define WIDEODD 0x40 3542 #define SCSIEN 0x20 3543 #define SDMAEN 0x10 3544 #define SDMAENACK 0x10 3545 #define HDMAEN 0x08 3546 + #define HDMAENACK 0x08 3547 #define DIRECTION 0x04 3548 #define FIFOFLUSH 0x02 3549 #define FIFORESET 0x01 3550 3551 + #define SEQ_FLAGS 0x139 3552 #define NOT_IDENTIFIED 0x80 3553 #define NO_CDB_SENT 0x40 3554 #define TARGET_CMD_IS_TAGGED 0x40 ··· 3553 #define SPHASE_PENDING 0x02 3554 #define NO_DISCONNECT 0x01 3555 3556 + #define SAVED_SCSIID 0x13a 3557 3558 + #define SAVED_LUN 0x13b 3559 3560 + #define LASTPHASE 0x13c 3561 #define PHASE_MASK 0xe0 3562 #define CDI 0x80 3563 #define IOI 0x40 ··· 3572 #define P_DATAOUT_DT 0x20 3573 #define P_DATAOUT 0x00 3574 3575 + #define QOUTFIFO_ENTRY_VALID_TAG 0x13d 3576 3577 + #define KERNEL_TQINPOS 0x13e 3578 3579 + #define TQINPOS 0x13f 3580 3581 + #define SHARED_DATA_ADDR 0x140 3582 3583 + #define QOUTFIFO_NEXT_ADDR 0x144 3584 3585 + #define ARG_1 0x148 3586 + #define RETURN_1 0x148 3587 #define SEND_MSG 0x80 3588 #define SEND_SENSE 0x40 3589 #define SEND_REJ 0x20 ··· 3593 #define CONT_MSG_LOOP_READ 0x03 3594 #define CONT_MSG_LOOP_TARG 0x02 3595 3596 + #define ARG_2 0x149 3597 + #define RETURN_2 0x149 3598 3599 + #define LAST_MSG 0x14a 3600 3601 + #define SCSISEQ_TEMPLATE 0x14b 3602 #define MANUALCTL 0x40 3603 #define ENSELI 0x20 3604 #define ENRSELI 0x10 ··· 3606 #define ENAUTOATNP 0x02 3607 #define ALTSTIM 0x01 3608 3609 + #define INITIATOR_TAG 0x14c 3610 3611 + #define SEQ_FLAGS2 0x14d 3612 #define SELECTOUT_QFROZEN 0x04 3613 #define TARGET_MSG_PENDING 0x02 3614 3615 + #define ALLOCFIFO_SCBPTR 0x14e 3616 3617 + #define INT_COALESCING_TIMER 0x150 3618 3619 + #define INT_COALESCING_MAXCMDS 0x152 3620 3621 + #define INT_COALESCING_MINCMDS 0x153 3622 3623 + #define CMDS_PENDING 0x154 3624 3625 + #define INT_COALESCING_CMDCOUNT 0x156 3626 3627 + #define LOCAL_HS_MAILBOX 0x157 3628 3629 + #define CMDSIZE_TABLE 0x158 3630 3631 #define SCB_BASE 0x180 3632 ··· 3701 #define SCB_DISCONNECTED_LISTS 0x1b8 3702 3703 3704 + #define AHD_TIMER_MAX_US 0x18ffe7 3705 + #define AHD_TIMER_MAX_TICKS 0xffff 3706 + #define AHD_SENSE_BUFSIZE 0x100 3707 + #define BUS_8_BIT 0x00 3708 + #define TARGET_CMD_CMPLT 0xfe 3709 + #define SEEOP_WRAL_ADDR 0x40 3710 + #define AHD_AMPLITUDE_DEF 0x07 3711 + #define AHD_PRECOMP_CUTBACK_37 0x07 3712 + #define AHD_PRECOMP_SHIFT 0x00 3713 + #define AHD_ANNEXCOL_PRECOMP_SLEW 0x04 3714 #define AHD_TIMER_US_PER_TICK 0x19 3715 #define SCB_TRANSFER_SIZE_FULL_LUN 0x38 3716 #define STATUS_QUEUE_FULL 0x28 ··· 3724 #define B_CURRFIFO_0 0x02 3725 #define LUNLEN_SINGLE_LEVEL_LUN 0x0f 3726 #define NVRAM_SCB_OFFSET 0x2c 3727 #define STATUS_PKT_SENSE 0xff 3728 #define CMD_GROUP_CODE_SHIFT 0x05 3729 #define MAX_OFFSET_PACED_BUG 0x7f 3730 #define STIMESEL_BUG_ADJ 0x08 3731 #define STIMESEL_MIN 0x18 3732 #define STIMESEL_SHIFT 0x03 3733 #define CCSGRAM_MAXSEGS 0x10 3734 #define INVALID_ADDR 0x80 3735 #define SEEOP_ERAL_ADDR 0x80 3736 #define AHD_SLEWRATE_DEF_REVB 0x08 3737 #define AHD_PRECOMP_CUTBACK_17 0x04 3738 #define AHD_PRECOMP_MASK 0x07 3739 #define SRC_MODE_SHIFT 0x00 3740 #define PKT_OVERRUN_BUFSIZE 0x200 3741 #define SCB_TRANSFER_SIZE_1BYTE_LUN 0x30 ··· 3761 3762 3763 /* Downloaded Constant Definitions */ 3764 + #define CACHELINE_MASK 0x07 3765 #define SCB_TRANSFER_SIZE 0x06 3766 #define PKT_OVERRUN_BUFOFFSET 0x05 3767 #define SG_SIZEOF 0x04 ··· 3768 #define SG_PREFETCH_ALIGN_MASK 0x02 3769 #define SG_PREFETCH_CNT_LIMIT 0x01 3770 #define SG_PREFETCH_CNT 0x00 3771 + #define DOWNLOAD_CONST_COUNT 0x08 3772 3773 3774 /* Exported Labels */ 3775 + #define LABEL_seq_isr 0x285 3776 + #define LABEL_timer_isr 0x281
+290 -269
drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped
··· 2 * DO NOT EDIT - This file is automatically generated 3 * from the following source files: 4 * 5 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#94 $ 6 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $ 7 */ 8 9 #include "aic79xx_osm.h" ··· 172 0x0b, regvalue, cur_col, wrap)); 173 } 174 175 - static ahd_reg_parse_entry_t CLRSEQINTSTAT_parse_table[] = { 176 - { "CLRSEQ_SPLTINT", 0x01, 0x01 }, 177 - { "CLRSEQ_PCIINT", 0x02, 0x02 }, 178 - { "CLRSEQ_SCSIINT", 0x04, 0x04 }, 179 - { "CLRSEQ_SEQINT", 0x08, 0x08 }, 180 - { "CLRSEQ_SWTMRTO", 0x10, 0x10 } 181 - }; 182 - 183 - int 184 - ahd_clrseqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 185 - { 186 - return (ahd_print_register(CLRSEQINTSTAT_parse_table, 5, "CLRSEQINTSTAT", 187 - 0x0c, regvalue, cur_col, wrap)); 188 - } 189 - 190 static ahd_reg_parse_entry_t SEQINTSTAT_parse_table[] = { 191 { "SEQ_SPLTINT", 0x01, 0x01 }, 192 { "SEQ_PCIINT", 0x02, 0x02 }, ··· 184 ahd_seqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 185 { 186 return (ahd_print_register(SEQINTSTAT_parse_table, 5, "SEQINTSTAT", 187 0x0c, regvalue, cur_col, wrap)); 188 } 189 ··· 670 } 671 672 int 673 - ahd_businitid_print(u_int regvalue, u_int *cur_col, u_int wrap) 674 { 675 - return (ahd_print_register(NULL, 0, "BUSINITID", 676 0x3c, regvalue, cur_col, wrap)); 677 } 678 679 int 680 - ahd_dlcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 681 { 682 - return (ahd_print_register(NULL, 0, "DLCOUNT", 683 0x3c, regvalue, cur_col, wrap)); 684 } 685 ··· 859 0x49, regvalue, cur_col, wrap)); 860 } 861 862 - static ahd_reg_parse_entry_t SBLKCTL_parse_table[] = { 863 - { "SELWIDE", 0x02, 0x02 }, 864 - { "ENAB20", 0x04, 0x04 }, 865 - { "ENAB40", 0x08, 0x08 }, 866 - { "DIAGLEDON", 0x40, 0x40 }, 867 - { "DIAGLEDEN", 0x80, 0x80 } 868 - }; 869 - 870 - int 871 - ahd_sblkctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 872 - { 873 - return (ahd_print_register(SBLKCTL_parse_table, 5, "SBLKCTL", 874 - 0x4a, regvalue, cur_col, wrap)); 875 - } 876 - 877 static ahd_reg_parse_entry_t OPTIONMODE_parse_table[] = { 878 { "AUTO_MSGOUT_DE", 0x02, 0x02 }, 879 { "ENDGFORMCHK", 0x04, 0x04 }, ··· 876 0x4a, regvalue, cur_col, wrap)); 877 } 878 879 - static ahd_reg_parse_entry_t SSTAT0_parse_table[] = { 880 - { "ARBDO", 0x01, 0x01 }, 881 - { "SPIORDY", 0x02, 0x02 }, 882 - { "OVERRUN", 0x04, 0x04 }, 883 - { "IOERR", 0x08, 0x08 }, 884 - { "SELINGO", 0x10, 0x10 }, 885 - { "SELDI", 0x20, 0x20 }, 886 - { "SELDO", 0x40, 0x40 }, 887 - { "TARGET", 0x80, 0x80 } 888 }; 889 890 int 891 - ahd_sstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 892 { 893 - return (ahd_print_register(SSTAT0_parse_table, 8, "SSTAT0", 894 - 0x4b, regvalue, cur_col, wrap)); 895 } 896 897 static ahd_reg_parse_entry_t CLRSINT0_parse_table[] = { ··· 905 ahd_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 906 { 907 return (ahd_print_register(CLRSINT0_parse_table, 7, "CLRSINT0", 908 0x4b, regvalue, cur_col, wrap)); 909 } 910 ··· 998 0x4d, regvalue, cur_col, wrap)); 999 } 1000 1001 static ahd_reg_parse_entry_t CLRSINT2_parse_table[] = { 1002 { "CLRDMADONE", 0x01, 0x01 }, 1003 { "CLRSDONE", 0x02, 0x02 }, ··· 1022 ahd_clrsint2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1023 { 1024 return (ahd_print_register(CLRSINT2_parse_table, 4, "CLRSINT2", 1025 - 0x4d, regvalue, cur_col, wrap)); 1026 - } 1027 - 1028 - static ahd_reg_parse_entry_t SIMODE2_parse_table[] = { 1029 - { "ENDMADONE", 0x01, 0x01 }, 1030 - { "ENSDONE", 0x02, 0x02 }, 1031 - { "ENWIDE_RES", 0x04, 0x04 } 1032 - }; 1033 - 1034 - int 1035 - ahd_simode2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1036 - { 1037 - return (ahd_print_register(SIMODE2_parse_table, 3, "SIMODE2", 1038 0x4d, regvalue, cur_col, wrap)); 1039 } 1040 ··· 1220 0x53, regvalue, cur_col, wrap)); 1221 } 1222 1223 - static ahd_reg_parse_entry_t LQOMODE0_parse_table[] = { 1224 - { "ENLQOTCRC", 0x01, 0x01 }, 1225 - { "ENLQOATNPKT", 0x02, 0x02 }, 1226 - { "ENLQOATNLQ", 0x04, 0x04 }, 1227 - { "ENLQOSTOPT2", 0x08, 0x08 }, 1228 - { "ENLQOTARGSCBPERR", 0x10, 0x10 } 1229 - }; 1230 - 1231 - int 1232 - ahd_lqomode0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1233 - { 1234 - return (ahd_print_register(LQOMODE0_parse_table, 5, "LQOMODE0", 1235 - 0x54, regvalue, cur_col, wrap)); 1236 - } 1237 - 1238 static ahd_reg_parse_entry_t LQOSTAT0_parse_table[] = { 1239 { "LQOTCRC", 0x01, 0x01 }, 1240 { "LQOATNPKT", 0x02, 0x02 }, ··· 1250 0x54, regvalue, cur_col, wrap)); 1251 } 1252 1253 static ahd_reg_parse_entry_t LQOSTAT1_parse_table[] = { 1254 { "LQOPHACHGINPKT", 0x01, 0x01 }, 1255 { "LQOBUSFREE", 0x02, 0x02 }, ··· 1307 ahd_clrlqoint1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1308 { 1309 return (ahd_print_register(CLRLQOINT1_parse_table, 5, "CLRLQOINT1", 1310 - 0x55, regvalue, cur_col, wrap)); 1311 - } 1312 - 1313 - static ahd_reg_parse_entry_t LQOMODE1_parse_table[] = { 1314 - { "ENLQOPHACHGINPKT", 0x01, 0x01 }, 1315 - { "ENLQOBUSFREE", 0x02, 0x02 }, 1316 - { "ENLQOBADQAS", 0x04, 0x04 }, 1317 - { "ENLQOSTOPI2", 0x08, 0x08 }, 1318 - { "ENLQOINITSCBPERR", 0x10, 0x10 } 1319 - }; 1320 - 1321 - int 1322 - ahd_lqomode1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1323 - { 1324 - return (ahd_print_register(LQOMODE1_parse_table, 5, "LQOMODE1", 1325 0x55, regvalue, cur_col, wrap)); 1326 } 1327 ··· 1594 0x65, regvalue, cur_col, wrap)); 1595 } 1596 1597 static ahd_reg_parse_entry_t SCSCHKN_parse_table[] = { 1598 { "LSTSGCLRDIS", 0x01, 0x01 }, 1599 { "SHVALIDSTDIS", 0x02, 0x02 }, ··· 1615 ahd_scschkn_print(u_int regvalue, u_int *cur_col, u_int wrap) 1616 { 1617 return (ahd_print_register(SCSCHKN_parse_table, 7, "SCSCHKN", 1618 - 0x66, regvalue, cur_col, wrap)); 1619 - } 1620 - 1621 - int 1622 - ahd_annexdat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1623 - { 1624 - return (ahd_print_register(NULL, 0, "ANNEXDAT", 1625 0x66, regvalue, cur_col, wrap)); 1626 } 1627 ··· 1728 } 1729 1730 int 1731 - ahd_pll400cnt0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1732 { 1733 - return (ahd_print_register(NULL, 0, "PLL400CNT0", 1734 0x6e, regvalue, cur_col, wrap)); 1735 } 1736 1737 int 1738 - ahd_unfairness_print(u_int regvalue, u_int *cur_col, u_int wrap) 1739 { 1740 - return (ahd_print_register(NULL, 0, "UNFAIRNESS", 1741 0x6e, regvalue, cur_col, wrap)); 1742 } 1743 ··· 1788 } 1789 1790 int 1791 - ahd_sghaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1792 - { 1793 - return (ahd_print_register(NULL, 0, "SGHADDR", 1794 - 0x7c, regvalue, cur_col, wrap)); 1795 - } 1796 - 1797 - int 1798 ahd_scbhaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1799 { 1800 return (ahd_print_register(NULL, 0, "SCBHADDR", ··· 1795 } 1796 1797 int 1798 - ahd_sghcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1799 { 1800 - return (ahd_print_register(NULL, 0, "SGHCNT", 1801 - 0x84, regvalue, cur_col, wrap)); 1802 } 1803 1804 int 1805 ahd_scbhcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1806 { 1807 return (ahd_print_register(NULL, 0, "SCBHCNT", 1808 0x84, regvalue, cur_col, wrap)); 1809 } 1810 ··· 1950 0x91, regvalue, cur_col, wrap)); 1951 } 1952 1953 - static ahd_reg_parse_entry_t DCHRXMSG1_parse_table[] = { 1954 - { "CBNUM", 0xff, 0xff } 1955 - }; 1956 - 1957 - int 1958 - ahd_dchrxmsg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1959 - { 1960 - return (ahd_print_register(DCHRXMSG1_parse_table, 1, "DCHRXMSG1", 1961 - 0x91, regvalue, cur_col, wrap)); 1962 - } 1963 - 1964 static ahd_reg_parse_entry_t CMCRXMSG1_parse_table[] = { 1965 { "CBNUM", 0xff, 0xff } 1966 }; ··· 1961 0x91, regvalue, cur_col, wrap)); 1962 } 1963 1964 static ahd_reg_parse_entry_t DCHRXMSG2_parse_table[] = { 1965 { "MINDEX", 0xff, 0xff } 1966 }; ··· 1980 ahd_dchrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1981 { 1982 return (ahd_print_register(DCHRXMSG2_parse_table, 1, "DCHRXMSG2", 1983 - 0x92, regvalue, cur_col, wrap)); 1984 - } 1985 - 1986 - static ahd_reg_parse_entry_t OVLYRXMSG2_parse_table[] = { 1987 - { "MINDEX", 0xff, 0xff } 1988 - }; 1989 - 1990 - int 1991 - ahd_ovlyrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1992 - { 1993 - return (ahd_print_register(OVLYRXMSG2_parse_table, 1, "OVLYRXMSG2", 1994 0x92, regvalue, cur_col, wrap)); 1995 } 1996 ··· 2001 0x92, regvalue, cur_col, wrap)); 2002 } 2003 2004 static ahd_reg_parse_entry_t DCHRXMSG3_parse_table[] = { 2005 { "MCLASS", 0x0f, 0x0f } 2006 }; ··· 2020 ahd_dchrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 2021 { 2022 return (ahd_print_register(DCHRXMSG3_parse_table, 1, "DCHRXMSG3", 2023 0x93, regvalue, cur_col, wrap)); 2024 } 2025 ··· 2062 0x93, regvalue, cur_col, wrap)); 2063 } 2064 2065 - static ahd_reg_parse_entry_t OVLYRXMSG3_parse_table[] = { 2066 - { "MCLASS", 0x0f, 0x0f } 2067 - }; 2068 - 2069 - int 2070 - ahd_ovlyrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 2071 - { 2072 - return (ahd_print_register(OVLYRXMSG3_parse_table, 1, "OVLYRXMSG3", 2073 - 0x93, regvalue, cur_col, wrap)); 2074 - } 2075 - 2076 int 2077 ahd_ovlyseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2078 { ··· 2070 } 2071 2072 int 2073 - ahd_cmcseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2074 { 2075 - return (ahd_print_register(NULL, 0, "CMCSEQBCNT", 2076 0x94, regvalue, cur_col, wrap)); 2077 } 2078 2079 int 2080 - ahd_dchseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2081 { 2082 - return (ahd_print_register(NULL, 0, "DCHSEQBCNT", 2083 0x94, regvalue, cur_col, wrap)); 2084 } 2085 ··· 2101 0x96, regvalue, cur_col, wrap)); 2102 } 2103 2104 - static ahd_reg_parse_entry_t OVLYSPLTSTAT0_parse_table[] = { 2105 - { "RXSPLTRSP", 0x01, 0x01 }, 2106 - { "RXSCEMSG", 0x02, 0x02 }, 2107 - { "RXOVRUN", 0x04, 0x04 }, 2108 - { "CNTNOTCMPLT", 0x08, 0x08 }, 2109 - { "SCDATBUCKET", 0x10, 0x10 }, 2110 - { "SCADERR", 0x20, 0x20 }, 2111 - { "SCBCERR", 0x40, 0x40 }, 2112 - { "STAETERM", 0x80, 0x80 } 2113 - }; 2114 - 2115 - int 2116 - ahd_ovlyspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 2117 - { 2118 - return (ahd_print_register(OVLYSPLTSTAT0_parse_table, 8, "OVLYSPLTSTAT0", 2119 - 0x96, regvalue, cur_col, wrap)); 2120 - } 2121 - 2122 static ahd_reg_parse_entry_t DCHSPLTSTAT0_parse_table[] = { 2123 { "RXSPLTRSP", 0x01, 0x01 }, 2124 { "RXSCEMSG", 0x02, 0x02 }, ··· 2119 0x96, regvalue, cur_col, wrap)); 2120 } 2121 2122 - static ahd_reg_parse_entry_t DCHSPLTSTAT1_parse_table[] = { 2123 - { "RXDATABUCKET", 0x01, 0x01 } 2124 }; 2125 2126 int 2127 - ahd_dchspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2128 { 2129 - return (ahd_print_register(DCHSPLTSTAT1_parse_table, 1, "DCHSPLTSTAT1", 2130 - 0x97, regvalue, cur_col, wrap)); 2131 } 2132 2133 static ahd_reg_parse_entry_t CMCSPLTSTAT1_parse_table[] = { ··· 2156 ahd_ovlyspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2157 { 2158 return (ahd_print_register(OVLYSPLTSTAT1_parse_table, 1, "OVLYSPLTSTAT1", 2159 0x97, regvalue, cur_col, wrap)); 2160 } 2161 ··· 2320 0x9e, regvalue, cur_col, wrap)); 2321 } 2322 2323 static ahd_reg_parse_entry_t SFUNCT_parse_table[] = { 2324 { "TEST_NUM", 0x0f, 0x0f }, 2325 { "TEST_GROUP", 0xf0, 0xf0 } ··· 2340 ahd_sfunct_print(u_int regvalue, u_int *cur_col, u_int wrap) 2341 { 2342 return (ahd_print_register(SFUNCT_parse_table, 2, "SFUNCT", 2343 - 0x9f, regvalue, cur_col, wrap)); 2344 - } 2345 - 2346 - static ahd_reg_parse_entry_t SGSPLTSTAT1_parse_table[] = { 2347 - { "RXDATABUCKET", 0x01, 0x01 } 2348 - }; 2349 - 2350 - int 2351 - ahd_sgspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2352 - { 2353 - return (ahd_print_register(SGSPLTSTAT1_parse_table, 1, "SGSPLTSTAT1", 2354 0x9f, regvalue, cur_col, wrap)); 2355 } 2356 ··· 2537 } 2538 2539 int 2540 - ahd_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2541 { 2542 - return (ahd_print_register(NULL, 0, "CCSCBADDR", 2543 0xac, regvalue, cur_col, wrap)); 2544 } 2545 2546 int 2547 - ahd_ccscbadr_bk_print(u_int regvalue, u_int *cur_col, u_int wrap) 2548 { 2549 - return (ahd_print_register(NULL, 0, "CCSCBADR_BK", 2550 0xac, regvalue, cur_col, wrap)); 2551 } 2552 ··· 2566 0xad, regvalue, cur_col, wrap)); 2567 } 2568 2569 - static ahd_reg_parse_entry_t CCSGCTL_parse_table[] = { 2570 - { "CCSGRESET", 0x01, 0x01 }, 2571 - { "SG_FETCH_REQ", 0x02, 0x02 }, 2572 - { "CCSGENACK", 0x08, 0x08 }, 2573 - { "SG_CACHE_AVAIL", 0x10, 0x10 }, 2574 - { "CCSGDONE", 0x80, 0x80 }, 2575 - { "CCSGEN", 0x0c, 0x0c } 2576 - }; 2577 - 2578 - int 2579 - ahd_ccsgctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 2580 - { 2581 - return (ahd_print_register(CCSGCTL_parse_table, 6, "CCSGCTL", 2582 - 0xad, regvalue, cur_col, wrap)); 2583 - } 2584 - 2585 static ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { 2586 { "CCSCBRESET", 0x01, 0x01 }, 2587 { "CCSCBDIR", 0x04, 0x04 }, ··· 2579 ahd_ccscbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 2580 { 2581 return (ahd_print_register(CCSCBCTL_parse_table, 6, "CCSCBCTL", 2582 0xad, regvalue, cur_col, wrap)); 2583 } 2584 ··· 2841 } 2842 2843 int 2844 - ahd_dfptrs_print(u_int regvalue, u_int *cur_col, u_int wrap) 2845 - { 2846 - return (ahd_print_register(NULL, 0, "DFPTRS", 2847 - 0xc8, regvalue, cur_col, wrap)); 2848 - } 2849 - 2850 - int 2851 ahd_rcvrbiascalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 2852 { 2853 return (ahd_print_register(NULL, 0, "RCVRBIASCALC", ··· 2848 } 2849 2850 int 2851 - ahd_dfbkptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2852 { 2853 - return (ahd_print_register(NULL, 0, "DFBKPTR", 2854 - 0xc9, regvalue, cur_col, wrap)); 2855 } 2856 2857 int 2858 ahd_skewcalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 2859 { 2860 return (ahd_print_register(NULL, 0, "SKEWCALC", 2861 0xc9, regvalue, cur_col, wrap)); 2862 } 2863 ··· 3001 0xe4, regvalue, cur_col, wrap)); 3002 } 3003 3004 static ahd_reg_parse_entry_t BRKADDR1_parse_table[] = { 3005 { "BRKDIS", 0x80, 0x80 } 3006 }; ··· 3016 ahd_brkaddr1_print(u_int regvalue, u_int *cur_col, u_int wrap) 3017 { 3018 return (ahd_print_register(BRKADDR1_parse_table, 1, "BRKADDR1", 3019 - 0xe6, regvalue, cur_col, wrap)); 3020 - } 3021 - 3022 - int 3023 - ahd_brkaddr0_print(u_int regvalue, u_int *cur_col, u_int wrap) 3024 - { 3025 - return (ahd_print_register(NULL, 0, "BRKADDR0", 3026 0xe6, regvalue, cur_col, wrap)); 3027 } 3028 ··· 3069 } 3070 3071 int 3072 - ahd_curaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3073 - { 3074 - return (ahd_print_register(NULL, 0, "CURADDR", 3075 - 0xf4, regvalue, cur_col, wrap)); 3076 - } 3077 - 3078 - int 3079 ahd_intvec1_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3080 { 3081 return (ahd_print_register(NULL, 0, "INTVEC1_ADDR", ··· 3076 } 3077 3078 int 3079 - ahd_intvec2_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3080 { 3081 - return (ahd_print_register(NULL, 0, "INTVEC2_ADDR", 3082 - 0xf6, regvalue, cur_col, wrap)); 3083 } 3084 3085 int 3086 ahd_lastaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3087 { 3088 return (ahd_print_register(NULL, 0, "LASTADDR", 3089 0xf6, regvalue, cur_col, wrap)); 3090 } 3091 ··· 3174 } 3175 3176 int 3177 ahd_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) 3178 { 3179 return (ahd_print_register(NULL, 0, "QFREEZE_COUNT", 3180 - 0x12e, regvalue, cur_col, wrap)); 3181 } 3182 3183 int 3184 ahd_saved_mode_print(u_int regvalue, u_int *cur_col, u_int wrap) 3185 { 3186 return (ahd_print_register(NULL, 0, "SAVED_MODE", 3187 - 0x130, regvalue, cur_col, wrap)); 3188 } 3189 3190 int 3191 ahd_msg_out_print(u_int regvalue, u_int *cur_col, u_int wrap) 3192 { 3193 return (ahd_print_register(NULL, 0, "MSG_OUT", 3194 - 0x131, regvalue, cur_col, wrap)); 3195 } 3196 3197 static ahd_reg_parse_entry_t DMAPARAMS_parse_table[] = { ··· 3232 ahd_dmaparams_print(u_int regvalue, u_int *cur_col, u_int wrap) 3233 { 3234 return (ahd_print_register(DMAPARAMS_parse_table, 10, "DMAPARAMS", 3235 - 0x132, regvalue, cur_col, wrap)); 3236 } 3237 3238 static ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { ··· 3251 ahd_seq_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) 3252 { 3253 return (ahd_print_register(SEQ_FLAGS_parse_table, 9, "SEQ_FLAGS", 3254 - 0x133, regvalue, cur_col, wrap)); 3255 } 3256 3257 int 3258 ahd_saved_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) 3259 { 3260 return (ahd_print_register(NULL, 0, "SAVED_SCSIID", 3261 - 0x134, regvalue, cur_col, wrap)); 3262 } 3263 3264 int 3265 ahd_saved_lun_print(u_int regvalue, u_int *cur_col, u_int wrap) 3266 { 3267 return (ahd_print_register(NULL, 0, "SAVED_LUN", 3268 - 0x135, regvalue, cur_col, wrap)); 3269 } 3270 3271 static ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { ··· 3288 ahd_lastphase_print(u_int regvalue, u_int *cur_col, u_int wrap) 3289 { 3290 return (ahd_print_register(LASTPHASE_parse_table, 13, "LASTPHASE", 3291 - 0x136, regvalue, cur_col, wrap)); 3292 } 3293 3294 int 3295 ahd_qoutfifo_entry_valid_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 3296 { 3297 return (ahd_print_register(NULL, 0, "QOUTFIFO_ENTRY_VALID_TAG", 3298 - 0x137, regvalue, cur_col, wrap)); 3299 - } 3300 - 3301 - int 3302 - ahd_shared_data_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3303 - { 3304 - return (ahd_print_register(NULL, 0, "SHARED_DATA_ADDR", 3305 - 0x138, regvalue, cur_col, wrap)); 3306 - } 3307 - 3308 - int 3309 - ahd_qoutfifo_next_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3310 - { 3311 - return (ahd_print_register(NULL, 0, "QOUTFIFO_NEXT_ADDR", 3312 - 0x13c, regvalue, cur_col, wrap)); 3313 } 3314 3315 int 3316 ahd_kernel_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) 3317 { 3318 return (ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 3319 - 0x140, regvalue, cur_col, wrap)); 3320 } 3321 3322 int 3323 ahd_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) 3324 { 3325 return (ahd_print_register(NULL, 0, "TQINPOS", 3326 - 0x141, regvalue, cur_col, wrap)); 3327 } 3328 3329 static ahd_reg_parse_entry_t ARG_1_parse_table[] = { ··· 3341 ahd_arg_1_print(u_int regvalue, u_int *cur_col, u_int wrap) 3342 { 3343 return (ahd_print_register(ARG_1_parse_table, 8, "ARG_1", 3344 - 0x142, regvalue, cur_col, wrap)); 3345 } 3346 3347 int 3348 ahd_arg_2_print(u_int regvalue, u_int *cur_col, u_int wrap) 3349 { 3350 return (ahd_print_register(NULL, 0, "ARG_2", 3351 - 0x143, regvalue, cur_col, wrap)); 3352 } 3353 3354 int 3355 ahd_last_msg_print(u_int regvalue, u_int *cur_col, u_int wrap) 3356 { 3357 return (ahd_print_register(NULL, 0, "LAST_MSG", 3358 - 0x144, regvalue, cur_col, wrap)); 3359 } 3360 3361 static ahd_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { ··· 3371 ahd_scsiseq_template_print(u_int regvalue, u_int *cur_col, u_int wrap) 3372 { 3373 return (ahd_print_register(SCSISEQ_TEMPLATE_parse_table, 6, "SCSISEQ_TEMPLATE", 3374 - 0x145, regvalue, cur_col, wrap)); 3375 } 3376 3377 int 3378 ahd_initiator_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 3379 { 3380 return (ahd_print_register(NULL, 0, "INITIATOR_TAG", 3381 - 0x146, regvalue, cur_col, wrap)); 3382 } 3383 3384 static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { ··· 3390 ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) 3391 { 3392 return (ahd_print_register(SEQ_FLAGS2_parse_table, 2, "SEQ_FLAGS2", 3393 - 0x147, regvalue, cur_col, wrap)); 3394 } 3395 3396 int 3397 ahd_allocfifo_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3398 { 3399 return (ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 3400 - 0x148, regvalue, cur_col, wrap)); 3401 } 3402 3403 int 3404 ahd_int_coalescing_timer_print(u_int regvalue, u_int *cur_col, u_int wrap) 3405 { 3406 return (ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 3407 - 0x14a, regvalue, cur_col, wrap)); 3408 } 3409 3410 int 3411 ahd_int_coalescing_maxcmds_print(u_int regvalue, u_int *cur_col, u_int wrap) 3412 { 3413 return (ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 3414 - 0x14c, regvalue, cur_col, wrap)); 3415 } 3416 3417 int 3418 ahd_int_coalescing_mincmds_print(u_int regvalue, u_int *cur_col, u_int wrap) 3419 { 3420 return (ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 3421 - 0x14d, regvalue, cur_col, wrap)); 3422 } 3423 3424 int 3425 ahd_cmds_pending_print(u_int regvalue, u_int *cur_col, u_int wrap) 3426 { 3427 return (ahd_print_register(NULL, 0, "CMDS_PENDING", 3428 - 0x14e, regvalue, cur_col, wrap)); 3429 } 3430 3431 int 3432 ahd_int_coalescing_cmdcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 3433 { 3434 return (ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 3435 - 0x150, regvalue, cur_col, wrap)); 3436 } 3437 3438 int 3439 ahd_local_hs_mailbox_print(u_int regvalue, u_int *cur_col, u_int wrap) 3440 { 3441 return (ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 3442 - 0x151, regvalue, cur_col, wrap)); 3443 } 3444 3445 int 3446 ahd_cmdsize_table_print(u_int regvalue, u_int *cur_col, u_int wrap) 3447 { 3448 return (ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 3449 - 0x152, regvalue, cur_col, wrap)); 3450 } 3451 3452 int
··· 2 * DO NOT EDIT - This file is automatically generated 3 * from the following source files: 4 * 5 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#118 $ 6 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#75 $ 7 */ 8 9 #include "aic79xx_osm.h" ··· 172 0x0b, regvalue, cur_col, wrap)); 173 } 174 175 static ahd_reg_parse_entry_t SEQINTSTAT_parse_table[] = { 176 { "SEQ_SPLTINT", 0x01, 0x01 }, 177 { "SEQ_PCIINT", 0x02, 0x02 }, ··· 199 ahd_seqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 200 { 201 return (ahd_print_register(SEQINTSTAT_parse_table, 5, "SEQINTSTAT", 202 + 0x0c, regvalue, cur_col, wrap)); 203 + } 204 + 205 + static ahd_reg_parse_entry_t CLRSEQINTSTAT_parse_table[] = { 206 + { "CLRSEQ_SPLTINT", 0x01, 0x01 }, 207 + { "CLRSEQ_PCIINT", 0x02, 0x02 }, 208 + { "CLRSEQ_SCSIINT", 0x04, 0x04 }, 209 + { "CLRSEQ_SEQINT", 0x08, 0x08 }, 210 + { "CLRSEQ_SWTMRTO", 0x10, 0x10 } 211 + }; 212 + 213 + int 214 + ahd_clrseqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 215 + { 216 + return (ahd_print_register(CLRSEQINTSTAT_parse_table, 5, "CLRSEQINTSTAT", 217 0x0c, regvalue, cur_col, wrap)); 218 } 219 ··· 670 } 671 672 int 673 + ahd_dlcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 674 { 675 + return (ahd_print_register(NULL, 0, "DLCOUNT", 676 0x3c, regvalue, cur_col, wrap)); 677 } 678 679 int 680 + ahd_businitid_print(u_int regvalue, u_int *cur_col, u_int wrap) 681 { 682 + return (ahd_print_register(NULL, 0, "BUSINITID", 683 0x3c, regvalue, cur_col, wrap)); 684 } 685 ··· 859 0x49, regvalue, cur_col, wrap)); 860 } 861 862 static ahd_reg_parse_entry_t OPTIONMODE_parse_table[] = { 863 { "AUTO_MSGOUT_DE", 0x02, 0x02 }, 864 { "ENDGFORMCHK", 0x04, 0x04 }, ··· 891 0x4a, regvalue, cur_col, wrap)); 892 } 893 894 + static ahd_reg_parse_entry_t SBLKCTL_parse_table[] = { 895 + { "SELWIDE", 0x02, 0x02 }, 896 + { "ENAB20", 0x04, 0x04 }, 897 + { "ENAB40", 0x08, 0x08 }, 898 + { "DIAGLEDON", 0x40, 0x40 }, 899 + { "DIAGLEDEN", 0x80, 0x80 } 900 }; 901 902 int 903 + ahd_sblkctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 904 { 905 + return (ahd_print_register(SBLKCTL_parse_table, 5, "SBLKCTL", 906 + 0x4a, regvalue, cur_col, wrap)); 907 } 908 909 static ahd_reg_parse_entry_t CLRSINT0_parse_table[] = { ··· 923 ahd_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 924 { 925 return (ahd_print_register(CLRSINT0_parse_table, 7, "CLRSINT0", 926 + 0x4b, regvalue, cur_col, wrap)); 927 + } 928 + 929 + static ahd_reg_parse_entry_t SSTAT0_parse_table[] = { 930 + { "ARBDO", 0x01, 0x01 }, 931 + { "SPIORDY", 0x02, 0x02 }, 932 + { "OVERRUN", 0x04, 0x04 }, 933 + { "IOERR", 0x08, 0x08 }, 934 + { "SELINGO", 0x10, 0x10 }, 935 + { "SELDI", 0x20, 0x20 }, 936 + { "SELDO", 0x40, 0x40 }, 937 + { "TARGET", 0x80, 0x80 } 938 + }; 939 + 940 + int 941 + ahd_sstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 942 + { 943 + return (ahd_print_register(SSTAT0_parse_table, 8, "SSTAT0", 944 0x4b, regvalue, cur_col, wrap)); 945 } 946 ··· 998 0x4d, regvalue, cur_col, wrap)); 999 } 1000 1001 + static ahd_reg_parse_entry_t SIMODE2_parse_table[] = { 1002 + { "ENDMADONE", 0x01, 0x01 }, 1003 + { "ENSDONE", 0x02, 0x02 }, 1004 + { "ENWIDE_RES", 0x04, 0x04 } 1005 + }; 1006 + 1007 + int 1008 + ahd_simode2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1009 + { 1010 + return (ahd_print_register(SIMODE2_parse_table, 3, "SIMODE2", 1011 + 0x4d, regvalue, cur_col, wrap)); 1012 + } 1013 + 1014 static ahd_reg_parse_entry_t CLRSINT2_parse_table[] = { 1015 { "CLRDMADONE", 0x01, 0x01 }, 1016 { "CLRSDONE", 0x02, 0x02 }, ··· 1009 ahd_clrsint2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1010 { 1011 return (ahd_print_register(CLRSINT2_parse_table, 4, "CLRSINT2", 1012 0x4d, regvalue, cur_col, wrap)); 1013 } 1014 ··· 1220 0x53, regvalue, cur_col, wrap)); 1221 } 1222 1223 static ahd_reg_parse_entry_t LQOSTAT0_parse_table[] = { 1224 { "LQOTCRC", 0x01, 0x01 }, 1225 { "LQOATNPKT", 0x02, 0x02 }, ··· 1265 0x54, regvalue, cur_col, wrap)); 1266 } 1267 1268 + static ahd_reg_parse_entry_t LQOMODE0_parse_table[] = { 1269 + { "ENLQOTCRC", 0x01, 0x01 }, 1270 + { "ENLQOATNPKT", 0x02, 0x02 }, 1271 + { "ENLQOATNLQ", 0x04, 0x04 }, 1272 + { "ENLQOSTOPT2", 0x08, 0x08 }, 1273 + { "ENLQOTARGSCBPERR", 0x10, 0x10 } 1274 + }; 1275 + 1276 + int 1277 + ahd_lqomode0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1278 + { 1279 + return (ahd_print_register(LQOMODE0_parse_table, 5, "LQOMODE0", 1280 + 0x54, regvalue, cur_col, wrap)); 1281 + } 1282 + 1283 + static ahd_reg_parse_entry_t LQOMODE1_parse_table[] = { 1284 + { "ENLQOPHACHGINPKT", 0x01, 0x01 }, 1285 + { "ENLQOBUSFREE", 0x02, 0x02 }, 1286 + { "ENLQOBADQAS", 0x04, 0x04 }, 1287 + { "ENLQOSTOPI2", 0x08, 0x08 }, 1288 + { "ENLQOINITSCBPERR", 0x10, 0x10 } 1289 + }; 1290 + 1291 + int 1292 + ahd_lqomode1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1293 + { 1294 + return (ahd_print_register(LQOMODE1_parse_table, 5, "LQOMODE1", 1295 + 0x55, regvalue, cur_col, wrap)); 1296 + } 1297 + 1298 static ahd_reg_parse_entry_t LQOSTAT1_parse_table[] = { 1299 { "LQOPHACHGINPKT", 0x01, 0x01 }, 1300 { "LQOBUSFREE", 0x02, 0x02 }, ··· 1292 ahd_clrlqoint1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1293 { 1294 return (ahd_print_register(CLRLQOINT1_parse_table, 5, "CLRLQOINT1", 1295 0x55, regvalue, cur_col, wrap)); 1296 } 1297 ··· 1594 0x65, regvalue, cur_col, wrap)); 1595 } 1596 1597 + int 1598 + ahd_annexdat_print(u_int regvalue, u_int *cur_col, u_int wrap) 1599 + { 1600 + return (ahd_print_register(NULL, 0, "ANNEXDAT", 1601 + 0x66, regvalue, cur_col, wrap)); 1602 + } 1603 + 1604 static ahd_reg_parse_entry_t SCSCHKN_parse_table[] = { 1605 { "LSTSGCLRDIS", 0x01, 0x01 }, 1606 { "SHVALIDSTDIS", 0x02, 0x02 }, ··· 1608 ahd_scschkn_print(u_int regvalue, u_int *cur_col, u_int wrap) 1609 { 1610 return (ahd_print_register(SCSCHKN_parse_table, 7, "SCSCHKN", 1611 0x66, regvalue, cur_col, wrap)); 1612 } 1613 ··· 1728 } 1729 1730 int 1731 + ahd_unfairness_print(u_int regvalue, u_int *cur_col, u_int wrap) 1732 { 1733 + return (ahd_print_register(NULL, 0, "UNFAIRNESS", 1734 0x6e, regvalue, cur_col, wrap)); 1735 } 1736 1737 int 1738 + ahd_pll400cnt0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1739 { 1740 + return (ahd_print_register(NULL, 0, "PLL400CNT0", 1741 0x6e, regvalue, cur_col, wrap)); 1742 } 1743 ··· 1788 } 1789 1790 int 1791 ahd_scbhaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1792 { 1793 return (ahd_print_register(NULL, 0, "SCBHADDR", ··· 1802 } 1803 1804 int 1805 + ahd_sghaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1806 { 1807 + return (ahd_print_register(NULL, 0, "SGHADDR", 1808 + 0x7c, regvalue, cur_col, wrap)); 1809 } 1810 1811 int 1812 ahd_scbhcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1813 { 1814 return (ahd_print_register(NULL, 0, "SCBHCNT", 1815 + 0x84, regvalue, cur_col, wrap)); 1816 + } 1817 + 1818 + int 1819 + ahd_sghcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1820 + { 1821 + return (ahd_print_register(NULL, 0, "SGHCNT", 1822 0x84, regvalue, cur_col, wrap)); 1823 } 1824 ··· 1950 0x91, regvalue, cur_col, wrap)); 1951 } 1952 1953 static ahd_reg_parse_entry_t CMCRXMSG1_parse_table[] = { 1954 { "CBNUM", 0xff, 0xff } 1955 }; ··· 1972 0x91, regvalue, cur_col, wrap)); 1973 } 1974 1975 + static ahd_reg_parse_entry_t DCHRXMSG1_parse_table[] = { 1976 + { "CBNUM", 0xff, 0xff } 1977 + }; 1978 + 1979 + int 1980 + ahd_dchrxmsg1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1981 + { 1982 + return (ahd_print_register(DCHRXMSG1_parse_table, 1, "DCHRXMSG1", 1983 + 0x91, regvalue, cur_col, wrap)); 1984 + } 1985 + 1986 static ahd_reg_parse_entry_t DCHRXMSG2_parse_table[] = { 1987 { "MINDEX", 0xff, 0xff } 1988 }; ··· 1980 ahd_dchrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1981 { 1982 return (ahd_print_register(DCHRXMSG2_parse_table, 1, "DCHRXMSG2", 1983 0x92, regvalue, cur_col, wrap)); 1984 } 1985 ··· 2012 0x92, regvalue, cur_col, wrap)); 2013 } 2014 2015 + static ahd_reg_parse_entry_t OVLYRXMSG2_parse_table[] = { 2016 + { "MINDEX", 0xff, 0xff } 2017 + }; 2018 + 2019 + int 2020 + ahd_ovlyrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 2021 + { 2022 + return (ahd_print_register(OVLYRXMSG2_parse_table, 1, "OVLYRXMSG2", 2023 + 0x92, regvalue, cur_col, wrap)); 2024 + } 2025 + 2026 static ahd_reg_parse_entry_t DCHRXMSG3_parse_table[] = { 2027 { "MCLASS", 0x0f, 0x0f } 2028 }; ··· 2020 ahd_dchrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 2021 { 2022 return (ahd_print_register(DCHRXMSG3_parse_table, 1, "DCHRXMSG3", 2023 + 0x93, regvalue, cur_col, wrap)); 2024 + } 2025 + 2026 + static ahd_reg_parse_entry_t OVLYRXMSG3_parse_table[] = { 2027 + { "MCLASS", 0x0f, 0x0f } 2028 + }; 2029 + 2030 + int 2031 + ahd_ovlyrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 2032 + { 2033 + return (ahd_print_register(OVLYRXMSG3_parse_table, 1, "OVLYRXMSG3", 2034 0x93, regvalue, cur_col, wrap)); 2035 } 2036 ··· 2051 0x93, regvalue, cur_col, wrap)); 2052 } 2053 2054 int 2055 ahd_ovlyseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2056 { ··· 2070 } 2071 2072 int 2073 + ahd_dchseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2074 { 2075 + return (ahd_print_register(NULL, 0, "DCHSEQBCNT", 2076 0x94, regvalue, cur_col, wrap)); 2077 } 2078 2079 int 2080 + ahd_cmcseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2081 { 2082 + return (ahd_print_register(NULL, 0, "CMCSEQBCNT", 2083 0x94, regvalue, cur_col, wrap)); 2084 } 2085 ··· 2101 0x96, regvalue, cur_col, wrap)); 2102 } 2103 2104 static ahd_reg_parse_entry_t DCHSPLTSTAT0_parse_table[] = { 2105 { "RXSPLTRSP", 0x01, 0x01 }, 2106 { "RXSCEMSG", 0x02, 0x02 }, ··· 2137 0x96, regvalue, cur_col, wrap)); 2138 } 2139 2140 + static ahd_reg_parse_entry_t OVLYSPLTSTAT0_parse_table[] = { 2141 + { "RXSPLTRSP", 0x01, 0x01 }, 2142 + { "RXSCEMSG", 0x02, 0x02 }, 2143 + { "RXOVRUN", 0x04, 0x04 }, 2144 + { "CNTNOTCMPLT", 0x08, 0x08 }, 2145 + { "SCDATBUCKET", 0x10, 0x10 }, 2146 + { "SCADERR", 0x20, 0x20 }, 2147 + { "SCBCERR", 0x40, 0x40 }, 2148 + { "STAETERM", 0x80, 0x80 } 2149 }; 2150 2151 int 2152 + ahd_ovlyspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 2153 { 2154 + return (ahd_print_register(OVLYSPLTSTAT0_parse_table, 8, "OVLYSPLTSTAT0", 2155 + 0x96, regvalue, cur_col, wrap)); 2156 } 2157 2158 static ahd_reg_parse_entry_t CMCSPLTSTAT1_parse_table[] = { ··· 2167 ahd_ovlyspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2168 { 2169 return (ahd_print_register(OVLYSPLTSTAT1_parse_table, 1, "OVLYSPLTSTAT1", 2170 + 0x97, regvalue, cur_col, wrap)); 2171 + } 2172 + 2173 + static ahd_reg_parse_entry_t DCHSPLTSTAT1_parse_table[] = { 2174 + { "RXDATABUCKET", 0x01, 0x01 } 2175 + }; 2176 + 2177 + int 2178 + ahd_dchspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2179 + { 2180 + return (ahd_print_register(DCHSPLTSTAT1_parse_table, 1, "DCHSPLTSTAT1", 2181 0x97, regvalue, cur_col, wrap)); 2182 } 2183 ··· 2320 0x9e, regvalue, cur_col, wrap)); 2321 } 2322 2323 + static ahd_reg_parse_entry_t SGSPLTSTAT1_parse_table[] = { 2324 + { "RXDATABUCKET", 0x01, 0x01 } 2325 + }; 2326 + 2327 + int 2328 + ahd_sgspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2329 + { 2330 + return (ahd_print_register(SGSPLTSTAT1_parse_table, 1, "SGSPLTSTAT1", 2331 + 0x9f, regvalue, cur_col, wrap)); 2332 + } 2333 + 2334 static ahd_reg_parse_entry_t SFUNCT_parse_table[] = { 2335 { "TEST_NUM", 0x0f, 0x0f }, 2336 { "TEST_GROUP", 0xf0, 0xf0 } ··· 2329 ahd_sfunct_print(u_int regvalue, u_int *cur_col, u_int wrap) 2330 { 2331 return (ahd_print_register(SFUNCT_parse_table, 2, "SFUNCT", 2332 0x9f, regvalue, cur_col, wrap)); 2333 } 2334 ··· 2537 } 2538 2539 int 2540 + ahd_ccscbadr_bk_print(u_int regvalue, u_int *cur_col, u_int wrap) 2541 { 2542 + return (ahd_print_register(NULL, 0, "CCSCBADR_BK", 2543 0xac, regvalue, cur_col, wrap)); 2544 } 2545 2546 int 2547 + ahd_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2548 { 2549 + return (ahd_print_register(NULL, 0, "CCSCBADDR", 2550 0xac, regvalue, cur_col, wrap)); 2551 } 2552 ··· 2566 0xad, regvalue, cur_col, wrap)); 2567 } 2568 2569 static ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { 2570 { "CCSCBRESET", 0x01, 0x01 }, 2571 { "CCSCBDIR", 0x04, 0x04 }, ··· 2595 ahd_ccscbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 2596 { 2597 return (ahd_print_register(CCSCBCTL_parse_table, 6, "CCSCBCTL", 2598 + 0xad, regvalue, cur_col, wrap)); 2599 + } 2600 + 2601 + static ahd_reg_parse_entry_t CCSGCTL_parse_table[] = { 2602 + { "CCSGRESET", 0x01, 0x01 }, 2603 + { "SG_FETCH_REQ", 0x02, 0x02 }, 2604 + { "CCSGENACK", 0x08, 0x08 }, 2605 + { "SG_CACHE_AVAIL", 0x10, 0x10 }, 2606 + { "CCSGDONE", 0x80, 0x80 }, 2607 + { "CCSGEN", 0x0c, 0x0c } 2608 + }; 2609 + 2610 + int 2611 + ahd_ccsgctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 2612 + { 2613 + return (ahd_print_register(CCSGCTL_parse_table, 6, "CCSGCTL", 2614 0xad, regvalue, cur_col, wrap)); 2615 } 2616 ··· 2841 } 2842 2843 int 2844 ahd_rcvrbiascalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 2845 { 2846 return (ahd_print_register(NULL, 0, "RCVRBIASCALC", ··· 2855 } 2856 2857 int 2858 + ahd_dfptrs_print(u_int regvalue, u_int *cur_col, u_int wrap) 2859 { 2860 + return (ahd_print_register(NULL, 0, "DFPTRS", 2861 + 0xc8, regvalue, cur_col, wrap)); 2862 } 2863 2864 int 2865 ahd_skewcalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 2866 { 2867 return (ahd_print_register(NULL, 0, "SKEWCALC", 2868 + 0xc9, regvalue, cur_col, wrap)); 2869 + } 2870 + 2871 + int 2872 + ahd_dfbkptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2873 + { 2874 + return (ahd_print_register(NULL, 0, "DFBKPTR", 2875 0xc9, regvalue, cur_col, wrap)); 2876 } 2877 ··· 3001 0xe4, regvalue, cur_col, wrap)); 3002 } 3003 3004 + int 3005 + ahd_brkaddr0_print(u_int regvalue, u_int *cur_col, u_int wrap) 3006 + { 3007 + return (ahd_print_register(NULL, 0, "BRKADDR0", 3008 + 0xe6, regvalue, cur_col, wrap)); 3009 + } 3010 + 3011 static ahd_reg_parse_entry_t BRKADDR1_parse_table[] = { 3012 { "BRKDIS", 0x80, 0x80 } 3013 }; ··· 3009 ahd_brkaddr1_print(u_int regvalue, u_int *cur_col, u_int wrap) 3010 { 3011 return (ahd_print_register(BRKADDR1_parse_table, 1, "BRKADDR1", 3012 0xe6, regvalue, cur_col, wrap)); 3013 } 3014 ··· 3069 } 3070 3071 int 3072 ahd_intvec1_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3073 { 3074 return (ahd_print_register(NULL, 0, "INTVEC1_ADDR", ··· 3083 } 3084 3085 int 3086 + ahd_curaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3087 { 3088 + return (ahd_print_register(NULL, 0, "CURADDR", 3089 + 0xf4, regvalue, cur_col, wrap)); 3090 } 3091 3092 int 3093 ahd_lastaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3094 { 3095 return (ahd_print_register(NULL, 0, "LASTADDR", 3096 + 0xf6, regvalue, cur_col, wrap)); 3097 + } 3098 + 3099 + int 3100 + ahd_intvec2_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3101 + { 3102 + return (ahd_print_register(NULL, 0, "INTVEC2_ADDR", 3103 0xf6, regvalue, cur_col, wrap)); 3104 } 3105 ··· 3174 } 3175 3176 int 3177 + ahd_complete_dma_scb_tail_print(u_int regvalue, u_int *cur_col, u_int wrap) 3178 + { 3179 + return (ahd_print_register(NULL, 0, "COMPLETE_DMA_SCB_TAIL", 3180 + 0x12e, regvalue, cur_col, wrap)); 3181 + } 3182 + 3183 + int 3184 + ahd_complete_on_qfreeze_head_print(u_int regvalue, u_int *cur_col, u_int wrap) 3185 + { 3186 + return (ahd_print_register(NULL, 0, "COMPLETE_ON_QFREEZE_HEAD", 3187 + 0x130, regvalue, cur_col, wrap)); 3188 + } 3189 + 3190 + int 3191 ahd_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) 3192 { 3193 return (ahd_print_register(NULL, 0, "QFREEZE_COUNT", 3194 + 0x132, regvalue, cur_col, wrap)); 3195 + } 3196 + 3197 + int 3198 + ahd_kernel_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) 3199 + { 3200 + return (ahd_print_register(NULL, 0, "KERNEL_QFREEZE_COUNT", 3201 + 0x134, regvalue, cur_col, wrap)); 3202 } 3203 3204 int 3205 ahd_saved_mode_print(u_int regvalue, u_int *cur_col, u_int wrap) 3206 { 3207 return (ahd_print_register(NULL, 0, "SAVED_MODE", 3208 + 0x136, regvalue, cur_col, wrap)); 3209 } 3210 3211 int 3212 ahd_msg_out_print(u_int regvalue, u_int *cur_col, u_int wrap) 3213 { 3214 return (ahd_print_register(NULL, 0, "MSG_OUT", 3215 + 0x137, regvalue, cur_col, wrap)); 3216 } 3217 3218 static ahd_reg_parse_entry_t DMAPARAMS_parse_table[] = { ··· 3211 ahd_dmaparams_print(u_int regvalue, u_int *cur_col, u_int wrap) 3212 { 3213 return (ahd_print_register(DMAPARAMS_parse_table, 10, "DMAPARAMS", 3214 + 0x138, regvalue, cur_col, wrap)); 3215 } 3216 3217 static ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { ··· 3230 ahd_seq_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) 3231 { 3232 return (ahd_print_register(SEQ_FLAGS_parse_table, 9, "SEQ_FLAGS", 3233 + 0x139, regvalue, cur_col, wrap)); 3234 } 3235 3236 int 3237 ahd_saved_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) 3238 { 3239 return (ahd_print_register(NULL, 0, "SAVED_SCSIID", 3240 + 0x13a, regvalue, cur_col, wrap)); 3241 } 3242 3243 int 3244 ahd_saved_lun_print(u_int regvalue, u_int *cur_col, u_int wrap) 3245 { 3246 return (ahd_print_register(NULL, 0, "SAVED_LUN", 3247 + 0x13b, regvalue, cur_col, wrap)); 3248 } 3249 3250 static ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { ··· 3267 ahd_lastphase_print(u_int regvalue, u_int *cur_col, u_int wrap) 3268 { 3269 return (ahd_print_register(LASTPHASE_parse_table, 13, "LASTPHASE", 3270 + 0x13c, regvalue, cur_col, wrap)); 3271 } 3272 3273 int 3274 ahd_qoutfifo_entry_valid_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 3275 { 3276 return (ahd_print_register(NULL, 0, "QOUTFIFO_ENTRY_VALID_TAG", 3277 + 0x13d, regvalue, cur_col, wrap)); 3278 } 3279 3280 int 3281 ahd_kernel_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) 3282 { 3283 return (ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 3284 + 0x13e, regvalue, cur_col, wrap)); 3285 } 3286 3287 int 3288 ahd_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) 3289 { 3290 return (ahd_print_register(NULL, 0, "TQINPOS", 3291 + 0x13f, regvalue, cur_col, wrap)); 3292 + } 3293 + 3294 + int 3295 + ahd_shared_data_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3296 + { 3297 + return (ahd_print_register(NULL, 0, "SHARED_DATA_ADDR", 3298 + 0x140, regvalue, cur_col, wrap)); 3299 + } 3300 + 3301 + int 3302 + ahd_qoutfifo_next_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3303 + { 3304 + return (ahd_print_register(NULL, 0, "QOUTFIFO_NEXT_ADDR", 3305 + 0x144, regvalue, cur_col, wrap)); 3306 } 3307 3308 static ahd_reg_parse_entry_t ARG_1_parse_table[] = { ··· 3320 ahd_arg_1_print(u_int regvalue, u_int *cur_col, u_int wrap) 3321 { 3322 return (ahd_print_register(ARG_1_parse_table, 8, "ARG_1", 3323 + 0x148, regvalue, cur_col, wrap)); 3324 } 3325 3326 int 3327 ahd_arg_2_print(u_int regvalue, u_int *cur_col, u_int wrap) 3328 { 3329 return (ahd_print_register(NULL, 0, "ARG_2", 3330 + 0x149, regvalue, cur_col, wrap)); 3331 } 3332 3333 int 3334 ahd_last_msg_print(u_int regvalue, u_int *cur_col, u_int wrap) 3335 { 3336 return (ahd_print_register(NULL, 0, "LAST_MSG", 3337 + 0x14a, regvalue, cur_col, wrap)); 3338 } 3339 3340 static ahd_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { ··· 3350 ahd_scsiseq_template_print(u_int regvalue, u_int *cur_col, u_int wrap) 3351 { 3352 return (ahd_print_register(SCSISEQ_TEMPLATE_parse_table, 6, "SCSISEQ_TEMPLATE", 3353 + 0x14b, regvalue, cur_col, wrap)); 3354 } 3355 3356 int 3357 ahd_initiator_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 3358 { 3359 return (ahd_print_register(NULL, 0, "INITIATOR_TAG", 3360 + 0x14c, regvalue, cur_col, wrap)); 3361 } 3362 3363 static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { ··· 3369 ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) 3370 { 3371 return (ahd_print_register(SEQ_FLAGS2_parse_table, 2, "SEQ_FLAGS2", 3372 + 0x14d, regvalue, cur_col, wrap)); 3373 } 3374 3375 int 3376 ahd_allocfifo_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3377 { 3378 return (ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 3379 + 0x14e, regvalue, cur_col, wrap)); 3380 } 3381 3382 int 3383 ahd_int_coalescing_timer_print(u_int regvalue, u_int *cur_col, u_int wrap) 3384 { 3385 return (ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 3386 + 0x150, regvalue, cur_col, wrap)); 3387 } 3388 3389 int 3390 ahd_int_coalescing_maxcmds_print(u_int regvalue, u_int *cur_col, u_int wrap) 3391 { 3392 return (ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 3393 + 0x152, regvalue, cur_col, wrap)); 3394 } 3395 3396 int 3397 ahd_int_coalescing_mincmds_print(u_int regvalue, u_int *cur_col, u_int wrap) 3398 { 3399 return (ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 3400 + 0x153, regvalue, cur_col, wrap)); 3401 } 3402 3403 int 3404 ahd_cmds_pending_print(u_int regvalue, u_int *cur_col, u_int wrap) 3405 { 3406 return (ahd_print_register(NULL, 0, "CMDS_PENDING", 3407 + 0x154, regvalue, cur_col, wrap)); 3408 } 3409 3410 int 3411 ahd_int_coalescing_cmdcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 3412 { 3413 return (ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 3414 + 0x156, regvalue, cur_col, wrap)); 3415 } 3416 3417 int 3418 ahd_local_hs_mailbox_print(u_int regvalue, u_int *cur_col, u_int wrap) 3419 { 3420 return (ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 3421 + 0x157, regvalue, cur_col, wrap)); 3422 } 3423 3424 int 3425 ahd_cmdsize_table_print(u_int regvalue, u_int *cur_col, u_int wrap) 3426 { 3427 return (ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 3428 + 0x158, regvalue, cur_col, wrap)); 3429 } 3430 3431 int
+645 -607
drivers/scsi/aic7xxx/aic79xx_seq.h_shipped
··· 2 * DO NOT EDIT - This file is automatically generated 3 * from the following source files: 4 * 5 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#94 $ 6 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $ 7 */ 8 static uint8_t seqprog[] = { 9 0xff, 0x02, 0x06, 0x78, 10 - 0x00, 0xea, 0x50, 0x59, 11 0x01, 0xea, 0x04, 0x30, 12 0xff, 0x04, 0x0c, 0x78, 13 - 0x19, 0xea, 0x50, 0x59, 14 0x19, 0xea, 0x04, 0x00, 15 - 0x33, 0xea, 0x44, 0x59, 16 0x33, 0xea, 0x00, 0x00, 17 - 0x60, 0x3a, 0x1a, 0x68, 18 - 0x04, 0x47, 0x1b, 0x68, 19 - 0xff, 0x21, 0x1b, 0x70, 20 - 0x40, 0x4b, 0x92, 0x69, 21 - 0x00, 0xe2, 0x54, 0x59, 22 - 0x40, 0x4b, 0x92, 0x69, 23 - 0x20, 0x4b, 0x82, 0x69, 24 - 0xfc, 0x42, 0x24, 0x78, 25 - 0x10, 0x40, 0x24, 0x78, 26 - 0x00, 0xe2, 0xc4, 0x5d, 27 - 0x20, 0x4d, 0x28, 0x78, 28 - 0x00, 0xe2, 0xc4, 0x5d, 29 0x30, 0x3f, 0xc0, 0x09, 30 - 0x30, 0xe0, 0x30, 0x60, 31 0x7f, 0x4a, 0x94, 0x08, 32 - 0x00, 0xe2, 0x32, 0x40, 33 0xc0, 0x4a, 0x94, 0x00, 34 - 0x00, 0xe2, 0x3e, 0x58, 35 - 0x00, 0xe2, 0x56, 0x58, 36 - 0x00, 0xe2, 0x66, 0x58, 37 0x00, 0xe2, 0x06, 0x40, 38 - 0x33, 0xea, 0x44, 0x59, 39 0x33, 0xea, 0x00, 0x00, 40 - 0x01, 0x52, 0x64, 0x78, 41 0x02, 0x58, 0x50, 0x31, 42 0xff, 0xea, 0x10, 0x0b, 43 - 0xff, 0x97, 0x4f, 0x78, 44 - 0x50, 0x4b, 0x4a, 0x68, 45 0xbf, 0x3a, 0x74, 0x08, 46 - 0x14, 0xea, 0x50, 0x59, 47 0x14, 0xea, 0x04, 0x00, 48 0x08, 0x92, 0x25, 0x03, 49 - 0xff, 0x90, 0x3f, 0x68, 50 - 0x00, 0xe2, 0x56, 0x5b, 51 - 0x00, 0xe2, 0x3e, 0x40, 52 - 0x00, 0xea, 0x44, 0x59, 53 0x01, 0xea, 0x00, 0x30, 54 - 0x80, 0xf9, 0x5e, 0x68, 55 - 0x00, 0xe2, 0x42, 0x59, 56 - 0x11, 0xea, 0x44, 0x59, 57 0x11, 0xea, 0x00, 0x00, 58 - 0x80, 0xf9, 0x42, 0x79, 59 0xff, 0xea, 0xd4, 0x0d, 60 - 0x22, 0xea, 0x44, 0x59, 61 0x22, 0xea, 0x00, 0x00, 62 - 0x10, 0x16, 0x70, 0x78, 63 - 0x01, 0x0b, 0xa2, 0x32, 64 0x10, 0x16, 0x2c, 0x00, 65 - 0x18, 0xad, 0x00, 0x79, 66 - 0x04, 0xad, 0xca, 0x68, 67 - 0x80, 0xad, 0x64, 0x78, 68 - 0x10, 0xad, 0x98, 0x78, 69 - 0xff, 0x88, 0x83, 0x68, 70 0xe7, 0xad, 0x5a, 0x09, 71 0x02, 0x8c, 0x59, 0x32, 72 0x02, 0x28, 0x19, 0x33, 73 0x02, 0xa8, 0x50, 0x36, 74 - 0x33, 0xea, 0x44, 0x59, 75 - 0x33, 0xea, 0x00, 0x00, 76 - 0x40, 0x3a, 0x64, 0x68, 77 - 0x50, 0x4b, 0x64, 0x68, 78 - 0x22, 0xea, 0x44, 0x59, 79 - 0x22, 0xea, 0x00, 0x00, 80 0xe7, 0xad, 0x5a, 0x09, 81 - 0x02, 0x8c, 0x59, 0x32, 82 - 0x1a, 0xea, 0x50, 0x59, 83 - 0x1a, 0xea, 0x04, 0x00, 84 - 0xff, 0xea, 0xd4, 0x0d, 85 - 0xe7, 0xad, 0x5a, 0x09, 86 - 0x00, 0xe2, 0xa6, 0x58, 87 0xff, 0xea, 0x56, 0x02, 88 - 0x04, 0x7c, 0x78, 0x32, 89 - 0x20, 0x16, 0x64, 0x78, 90 - 0x04, 0x38, 0x79, 0x32, 91 - 0x80, 0x37, 0x6f, 0x16, 92 - 0xff, 0x2d, 0xb5, 0x60, 93 - 0xff, 0x29, 0xb5, 0x60, 94 - 0x40, 0x51, 0xc5, 0x78, 95 - 0xff, 0x4f, 0xb5, 0x68, 96 - 0xff, 0x4d, 0xc1, 0x19, 97 - 0x00, 0x4e, 0xd5, 0x19, 98 - 0x00, 0xe2, 0xc4, 0x50, 99 - 0x01, 0x4c, 0xc1, 0x31, 100 - 0x00, 0x50, 0xd5, 0x19, 101 - 0x00, 0xe2, 0xc4, 0x48, 102 - 0x80, 0x18, 0x64, 0x78, 103 - 0x02, 0x4a, 0x1d, 0x30, 104 0x10, 0xea, 0x18, 0x00, 105 0x60, 0x18, 0x30, 0x00, 106 0x7f, 0x18, 0x30, 0x0c, 107 0x02, 0xea, 0x02, 0x00, 108 - 0xff, 0xea, 0xa0, 0x0a, 109 0x80, 0x18, 0x30, 0x04, 110 - 0x40, 0xad, 0x64, 0x78, 111 0xe7, 0xad, 0x5a, 0x09, 112 0x02, 0xa8, 0x40, 0x31, 113 0xff, 0xea, 0xc0, 0x09, 114 - 0x01, 0x4e, 0x9d, 0x1a, 115 - 0x00, 0x4f, 0x9f, 0x22, 116 0x01, 0x94, 0x6d, 0x33, 117 - 0x01, 0xea, 0x20, 0x33, 118 0x04, 0xac, 0x49, 0x32, 119 0xff, 0xea, 0x5a, 0x03, 120 0xff, 0xea, 0x5e, 0x03, 121 0x01, 0x10, 0xd4, 0x31, 122 - 0x10, 0x92, 0xf5, 0x68, 123 0x3d, 0x93, 0xc5, 0x29, 124 0xfe, 0xe2, 0xc4, 0x09, 125 0x01, 0xea, 0xc6, 0x01, 126 0x02, 0xe2, 0xc8, 0x31, 127 0x02, 0xec, 0x50, 0x31, 128 0x02, 0xa0, 0xda, 0x31, 129 - 0xff, 0xa9, 0xf4, 0x70, 130 0x02, 0xa0, 0x58, 0x37, 131 - 0xff, 0x21, 0xfd, 0x70, 132 0x02, 0x22, 0x51, 0x31, 133 0x02, 0xa0, 0x5c, 0x33, 134 0x02, 0xa0, 0x44, 0x36, 135 0x02, 0xa0, 0x40, 0x32, 136 0x02, 0xa0, 0x44, 0x36, 137 - 0x04, 0x47, 0x05, 0x69, 138 - 0x40, 0x16, 0x30, 0x69, 139 - 0xff, 0x2d, 0x35, 0x61, 140 - 0xff, 0x29, 0x65, 0x70, 141 - 0x01, 0x37, 0xc1, 0x31, 142 0x02, 0x28, 0x55, 0x32, 143 0x01, 0xea, 0x5a, 0x01, 144 - 0x04, 0x3c, 0xf9, 0x30, 145 0x02, 0x28, 0x51, 0x31, 146 - 0x01, 0xa8, 0x60, 0x31, 147 - 0x00, 0xa9, 0x60, 0x01, 148 0x01, 0x14, 0xd4, 0x31, 149 - 0x01, 0x50, 0xa1, 0x1a, 150 - 0xff, 0x4e, 0x9d, 0x1a, 151 - 0xff, 0x4f, 0x9f, 0x22, 152 - 0xff, 0x8d, 0x29, 0x71, 153 - 0x80, 0xac, 0x28, 0x71, 154 - 0x20, 0x16, 0x28, 0x69, 155 0x02, 0x8c, 0x51, 0x31, 156 - 0x00, 0xe2, 0x12, 0x41, 157 0x01, 0xac, 0x08, 0x31, 158 0x09, 0xea, 0x5a, 0x01, 159 0x02, 0x8c, 0x51, 0x32, 160 0xff, 0xea, 0x1a, 0x07, 161 0x04, 0x24, 0xf9, 0x30, 162 - 0x1d, 0xea, 0x3a, 0x41, 163 0x02, 0x2c, 0x51, 0x31, 164 0x04, 0xa8, 0xf9, 0x30, 165 - 0x19, 0xea, 0x3a, 0x41, 166 0x06, 0xea, 0x08, 0x81, 167 0x01, 0xe2, 0x5a, 0x35, 168 - 0x02, 0xf2, 0xf0, 0x35, 169 0x02, 0xf2, 0xf0, 0x31, 170 0x02, 0xf8, 0xe4, 0x35, 171 0x80, 0xea, 0xb2, 0x01, 172 0x01, 0xe2, 0x00, 0x30, 173 - 0xff, 0xea, 0xb2, 0x0d, 174 - 0x80, 0xea, 0xb2, 0x01, 175 - 0x11, 0x00, 0x00, 0x10, 176 0xff, 0xea, 0xb2, 0x0d, 177 0x01, 0xe2, 0x04, 0x30, 178 0x01, 0xea, 0x04, 0x34, ··· 190 0x02, 0x20, 0xb9, 0x30, 191 0x02, 0x20, 0x51, 0x31, 192 0x4c, 0x93, 0xd7, 0x28, 193 - 0x10, 0x92, 0x63, 0x79, 194 0x01, 0x6b, 0xc0, 0x30, 195 0x02, 0x64, 0xc8, 0x00, 196 0x40, 0x3a, 0x74, 0x04, 197 - 0x00, 0xe2, 0x56, 0x58, 198 - 0x33, 0xea, 0x44, 0x59, 199 0x33, 0xea, 0x00, 0x00, 200 0x30, 0x3f, 0xc0, 0x09, 201 - 0x30, 0xe0, 0x64, 0x61, 202 - 0x20, 0x3f, 0x7a, 0x69, 203 - 0x10, 0x3f, 0x64, 0x79, 204 0x02, 0xea, 0x7e, 0x00, 205 - 0x00, 0xea, 0x44, 0x59, 206 0x01, 0xea, 0x00, 0x30, 207 - 0x02, 0x48, 0x51, 0x35, 208 0x01, 0xea, 0x7e, 0x00, 209 - 0x11, 0xea, 0x44, 0x59, 210 0x11, 0xea, 0x00, 0x00, 211 - 0x02, 0x48, 0x51, 0x35, 212 0x08, 0xea, 0x98, 0x00, 213 0x08, 0x57, 0xae, 0x00, 214 0x08, 0x3c, 0x78, 0x00, 215 - 0xf0, 0x49, 0x68, 0x0a, 216 0x0f, 0x67, 0xc0, 0x09, 217 - 0x00, 0x34, 0x69, 0x02, 218 0x20, 0xea, 0x96, 0x00, 219 - 0x00, 0xe2, 0xf8, 0x41, 220 - 0x40, 0x3a, 0xae, 0x69, 221 0x02, 0x55, 0x06, 0x68, 222 - 0x02, 0x56, 0xae, 0x69, 223 - 0xff, 0x5b, 0xae, 0x61, 224 0x02, 0x20, 0x51, 0x31, 225 0x80, 0xea, 0xb2, 0x01, 226 0x44, 0xea, 0x00, 0x00, ··· 231 0x33, 0xea, 0x00, 0x00, 232 0xff, 0xea, 0xb2, 0x09, 233 0xff, 0xe0, 0xc0, 0x19, 234 - 0xff, 0xe0, 0xb0, 0x79, 235 0x02, 0xac, 0x51, 0x31, 236 - 0x00, 0xe2, 0xa6, 0x41, 237 0x02, 0x5e, 0x50, 0x31, 238 0x02, 0xa8, 0xb8, 0x30, 239 0x02, 0x5c, 0x50, 0x31, 240 - 0xff, 0xad, 0xc1, 0x71, 241 0x02, 0xac, 0x41, 0x31, 242 0x02, 0x22, 0x51, 0x31, 243 0x02, 0xa0, 0x5c, 0x33, 244 0x02, 0xa0, 0x44, 0x32, 245 - 0x00, 0xe2, 0xca, 0x41, 246 - 0x10, 0x92, 0xcb, 0x69, 247 0x3d, 0x93, 0xc9, 0x29, 248 0x01, 0xe4, 0xc8, 0x01, 249 0x01, 0xea, 0xca, 0x01, 250 0xff, 0xea, 0xda, 0x01, 251 0x02, 0x20, 0x51, 0x31, 252 0x02, 0xae, 0x41, 0x32, 253 - 0xff, 0x21, 0xd3, 0x61, 254 0xff, 0xea, 0x46, 0x02, 255 0x02, 0x5c, 0x50, 0x31, 256 0x40, 0xea, 0x96, 0x00, 257 - 0x02, 0x56, 0xcc, 0x6d, 258 - 0x01, 0x55, 0xcc, 0x6d, 259 - 0x10, 0x92, 0xdf, 0x79, 260 - 0x10, 0x40, 0xe8, 0x69, 261 - 0x01, 0x56, 0xe8, 0x79, 262 0xff, 0x97, 0x07, 0x78, 263 - 0x13, 0xea, 0x50, 0x59, 264 0x13, 0xea, 0x04, 0x00, 265 0x00, 0xe2, 0x06, 0x40, 266 0xbf, 0x3a, 0x74, 0x08, 267 0x08, 0xea, 0x98, 0x00, 268 0x08, 0x57, 0xae, 0x00, 269 - 0x01, 0x93, 0x69, 0x32, 270 - 0x01, 0x94, 0x6b, 0x32, 271 - 0x40, 0xea, 0x66, 0x02, 272 0x08, 0x3c, 0x78, 0x00, 273 - 0x80, 0xea, 0x62, 0x02, 274 - 0x00, 0xe2, 0xb8, 0x5b, 275 - 0x01, 0x36, 0xc1, 0x31, 276 - 0x9f, 0xe0, 0x4c, 0x7c, 277 - 0x80, 0xe0, 0x0c, 0x72, 278 - 0xa0, 0xe0, 0x44, 0x72, 279 - 0xc0, 0xe0, 0x3a, 0x72, 280 - 0xe0, 0xe0, 0x74, 0x72, 281 - 0x01, 0xea, 0x50, 0x59, 282 0x01, 0xea, 0x04, 0x00, 283 - 0x00, 0xe2, 0xf8, 0x41, 284 - 0x80, 0x33, 0x13, 0x7a, 285 - 0x03, 0xea, 0x50, 0x59, 286 0x03, 0xea, 0x04, 0x00, 287 - 0xee, 0x00, 0x1a, 0x6a, 288 0x05, 0xea, 0xb4, 0x00, 289 - 0x33, 0xea, 0x44, 0x59, 290 0x33, 0xea, 0x00, 0x00, 291 - 0x02, 0xa8, 0x90, 0x32, 292 - 0x00, 0xe2, 0x6a, 0x59, 293 0xef, 0x96, 0xd5, 0x19, 294 - 0x00, 0xe2, 0x2a, 0x52, 295 0x09, 0x80, 0xe1, 0x30, 296 0x02, 0xea, 0x36, 0x00, 297 0xa8, 0xea, 0x32, 0x00, 298 - 0x00, 0xe2, 0x30, 0x42, 299 0x01, 0x96, 0xd1, 0x30, 300 0x10, 0x80, 0x89, 0x31, 301 0x20, 0xea, 0x32, 0x00, 302 - 0xbf, 0x33, 0x67, 0x0a, 303 - 0x20, 0x19, 0x32, 0x6a, 304 - 0x02, 0x4d, 0xf8, 0x69, 305 - 0x40, 0x33, 0x67, 0x02, 306 - 0x00, 0xe2, 0xf8, 0x41, 307 - 0x80, 0x33, 0xb5, 0x6a, 308 0x01, 0x44, 0x10, 0x33, 309 0x08, 0x92, 0x25, 0x03, 310 - 0x00, 0xe2, 0xf8, 0x41, 311 0x10, 0xea, 0x80, 0x00, 312 - 0x01, 0x31, 0xc5, 0x31, 313 - 0x80, 0xe2, 0x60, 0x62, 314 - 0x10, 0x92, 0x85, 0x6a, 315 0xc0, 0x94, 0xc5, 0x01, 316 - 0x40, 0x92, 0x51, 0x6a, 317 0xbf, 0xe2, 0xc4, 0x09, 318 - 0x20, 0x92, 0x65, 0x7a, 319 0x01, 0xe2, 0x88, 0x30, 320 - 0x00, 0xe2, 0xb8, 0x5b, 321 - 0xa0, 0x36, 0x6d, 0x62, 322 0x23, 0x92, 0x89, 0x08, 323 - 0x00, 0xe2, 0xb8, 0x5b, 324 - 0xa0, 0x36, 0x6d, 0x62, 325 - 0x00, 0xa8, 0x64, 0x42, 326 - 0xff, 0xe2, 0x64, 0x62, 327 - 0x00, 0xe2, 0x84, 0x42, 328 0x40, 0xea, 0x98, 0x00, 329 0x01, 0xe2, 0x88, 0x30, 330 - 0x00, 0xe2, 0xb8, 0x5b, 331 - 0xa0, 0x36, 0x43, 0x72, 332 0x40, 0xea, 0x98, 0x00, 333 - 0x01, 0x31, 0x89, 0x32, 334 - 0x08, 0xea, 0x62, 0x02, 335 - 0x00, 0xe2, 0xf8, 0x41, 336 - 0xe0, 0xea, 0xd4, 0x5b, 337 - 0x80, 0xe0, 0xc0, 0x6a, 338 - 0x04, 0xe0, 0x66, 0x73, 339 - 0x02, 0xe0, 0x96, 0x73, 340 - 0x00, 0xea, 0x1e, 0x73, 341 - 0x03, 0xe0, 0xa6, 0x73, 342 - 0x23, 0xe0, 0x96, 0x72, 343 - 0x08, 0xe0, 0xbc, 0x72, 344 - 0x00, 0xe2, 0xb8, 0x5b, 345 - 0x07, 0xea, 0x50, 0x59, 346 0x07, 0xea, 0x04, 0x00, 347 - 0x08, 0x42, 0xf9, 0x71, 348 - 0x04, 0x42, 0x93, 0x62, 349 - 0x01, 0x43, 0x89, 0x30, 350 - 0x00, 0xe2, 0x84, 0x42, 351 0x01, 0x44, 0xd4, 0x31, 352 - 0x00, 0xe2, 0x84, 0x42, 353 - 0x01, 0x00, 0x60, 0x32, 354 - 0x33, 0xea, 0x44, 0x59, 355 0x33, 0xea, 0x00, 0x00, 356 - 0x4c, 0x34, 0xc1, 0x28, 357 0x01, 0x64, 0xc0, 0x31, 358 - 0x00, 0x30, 0x45, 0x59, 359 - 0x01, 0x30, 0x01, 0x30, 360 - 0x01, 0xe0, 0xba, 0x7a, 361 - 0xa0, 0xea, 0xca, 0x5b, 362 - 0x01, 0xa0, 0xba, 0x62, 363 - 0x01, 0x84, 0xaf, 0x7a, 364 - 0x01, 0x95, 0xbd, 0x6a, 365 - 0x05, 0xea, 0x50, 0x59, 366 0x05, 0xea, 0x04, 0x00, 367 - 0x00, 0xe2, 0xbc, 0x42, 368 - 0x03, 0xea, 0x50, 0x59, 369 0x03, 0xea, 0x04, 0x00, 370 - 0x00, 0xe2, 0xbc, 0x42, 371 - 0x07, 0xea, 0xdc, 0x5b, 372 0x01, 0x44, 0xd4, 0x31, 373 - 0x00, 0xe2, 0xf8, 0x41, 374 - 0x3f, 0xe0, 0x6a, 0x0a, 375 - 0xc0, 0x34, 0xc1, 0x09, 376 - 0x00, 0x35, 0x51, 0x01, 377 0xff, 0xea, 0x52, 0x09, 378 - 0x30, 0x34, 0xc5, 0x09, 379 0x3d, 0xe2, 0xc4, 0x29, 380 0xb8, 0xe2, 0xc4, 0x19, 381 0x01, 0xea, 0xc6, 0x01, 382 0x02, 0xe2, 0xc8, 0x31, 383 0x02, 0xec, 0x40, 0x31, 384 - 0xff, 0xa1, 0xdc, 0x72, 385 0x02, 0xe8, 0xda, 0x31, 386 0x02, 0xa0, 0x50, 0x31, 387 - 0x00, 0xe2, 0xfe, 0x42, 388 - 0x80, 0x33, 0x67, 0x02, 389 0x01, 0x44, 0xd4, 0x31, 390 - 0x00, 0xe2, 0xb8, 0x5b, 391 - 0x01, 0x33, 0x67, 0x02, 392 - 0xe0, 0x36, 0x19, 0x63, 393 - 0x02, 0x33, 0x67, 0x02, 394 - 0x20, 0x46, 0x12, 0x63, 395 0xff, 0xea, 0x52, 0x09, 396 - 0xa8, 0xea, 0xca, 0x5b, 397 - 0x04, 0x92, 0xf9, 0x7a, 398 - 0x01, 0x34, 0xc1, 0x31, 399 - 0x00, 0x93, 0xf9, 0x62, 400 - 0x01, 0x35, 0xc1, 0x31, 401 - 0x00, 0x94, 0x03, 0x73, 402 0x01, 0xa9, 0x52, 0x11, 403 - 0xff, 0xa9, 0xee, 0x6a, 404 - 0x00, 0xe2, 0x12, 0x43, 405 - 0x10, 0x33, 0x67, 0x02, 406 - 0x04, 0x92, 0x13, 0x7b, 407 0xfb, 0x92, 0x25, 0x0b, 408 - 0xff, 0xea, 0x66, 0x0a, 409 - 0x01, 0xa4, 0x0d, 0x6b, 410 - 0x02, 0xa8, 0x90, 0x32, 411 - 0x00, 0xe2, 0x6a, 0x59, 412 - 0x10, 0x92, 0xbd, 0x7a, 413 - 0xff, 0xea, 0xdc, 0x5b, 414 - 0x00, 0xe2, 0xbc, 0x42, 415 - 0x04, 0xea, 0x50, 0x59, 416 0x04, 0xea, 0x04, 0x00, 417 - 0x00, 0xe2, 0xbc, 0x42, 418 - 0x04, 0xea, 0x50, 0x59, 419 0x04, 0xea, 0x04, 0x00, 420 - 0x00, 0xe2, 0xf8, 0x41, 421 - 0x08, 0x92, 0xb5, 0x7a, 422 - 0xc0, 0x33, 0x29, 0x7b, 423 - 0x80, 0x33, 0xb5, 0x6a, 424 - 0xff, 0x88, 0x29, 0x6b, 425 - 0x40, 0x33, 0xb5, 0x6a, 426 - 0x10, 0x92, 0x2f, 0x7b, 427 - 0x0a, 0xea, 0x50, 0x59, 428 0x0a, 0xea, 0x04, 0x00, 429 - 0x00, 0xe2, 0x4e, 0x5b, 430 - 0x00, 0xe2, 0x82, 0x43, 431 - 0x50, 0x4b, 0x36, 0x6b, 432 0xbf, 0x3a, 0x74, 0x08, 433 0x01, 0xe0, 0xf4, 0x31, 434 0xff, 0xea, 0xc0, 0x09, 435 - 0x01, 0x2e, 0x5d, 0x1a, 436 - 0x00, 0x2f, 0x5f, 0x22, 437 - 0x04, 0x47, 0x8f, 0x02, 438 0x01, 0xfa, 0xc0, 0x35, 439 - 0x02, 0xa8, 0x84, 0x32, 440 0x02, 0xea, 0xb4, 0x00, 441 - 0x33, 0xea, 0x44, 0x59, 442 0x33, 0xea, 0x00, 0x00, 443 - 0x02, 0x42, 0x51, 0x31, 444 - 0xff, 0x90, 0x65, 0x68, 445 - 0xff, 0x88, 0x5b, 0x6b, 446 - 0x01, 0xa4, 0x57, 0x6b, 447 - 0x02, 0xa4, 0x5f, 0x6b, 448 - 0x01, 0x84, 0x5f, 0x7b, 449 0x02, 0x28, 0x19, 0x33, 450 0x02, 0xa8, 0x50, 0x36, 451 - 0xff, 0x88, 0x5f, 0x73, 452 - 0x00, 0xe2, 0x32, 0x5b, 453 0x02, 0xa8, 0x20, 0x33, 454 - 0x02, 0x2c, 0x19, 0x33, 455 0x02, 0xa8, 0x58, 0x32, 456 - 0x04, 0xa4, 0x49, 0x07, 457 - 0xc0, 0x33, 0xb5, 0x6a, 458 - 0x04, 0x92, 0x25, 0x03, 459 - 0x20, 0x92, 0x83, 0x6b, 460 0x02, 0xa8, 0x40, 0x31, 461 - 0xc0, 0x34, 0xc1, 0x09, 462 - 0x00, 0x35, 0x51, 0x01, 463 0xff, 0xea, 0x52, 0x09, 464 - 0x30, 0x34, 0xc5, 0x09, 465 0x3d, 0xe2, 0xc4, 0x29, 466 0xb8, 0xe2, 0xc4, 0x19, 467 0x01, 0xea, 0xc6, 0x01, ··· 480 0xf7, 0x57, 0xae, 0x08, 481 0x08, 0xea, 0x98, 0x00, 482 0x01, 0x44, 0xd4, 0x31, 483 - 0xee, 0x00, 0x8c, 0x6b, 484 0x02, 0xea, 0xb4, 0x00, 485 - 0x00, 0xe2, 0xb4, 0x5b, 486 - 0x09, 0x4c, 0x8e, 0x7b, 487 0x08, 0x4c, 0x06, 0x68, 488 - 0x0b, 0xea, 0x50, 0x59, 489 0x0b, 0xea, 0x04, 0x00, 490 0x01, 0x44, 0xd4, 0x31, 491 - 0x20, 0x33, 0xf9, 0x79, 492 - 0x00, 0xe2, 0x9e, 0x5b, 493 - 0x00, 0xe2, 0xf8, 0x41, 494 - 0x01, 0x84, 0xa3, 0x7b, 495 0x01, 0xa4, 0x49, 0x07, 496 0x08, 0x60, 0x30, 0x33, 497 0x08, 0x80, 0x41, 0x37, 498 - 0xdf, 0x33, 0x67, 0x0a, 499 - 0xee, 0x00, 0xb0, 0x6b, 500 0x05, 0xea, 0xb4, 0x00, 501 - 0x33, 0xea, 0x44, 0x59, 502 0x33, 0xea, 0x00, 0x00, 503 - 0x00, 0xe2, 0x6a, 0x59, 504 - 0x00, 0xe2, 0xbc, 0x42, 505 - 0x01, 0xea, 0x6c, 0x02, 506 - 0xc0, 0xea, 0x66, 0x06, 507 - 0xff, 0x42, 0xc4, 0x6b, 508 - 0x01, 0x41, 0xb8, 0x6b, 509 - 0x02, 0x41, 0xb8, 0x7b, 510 - 0xff, 0x42, 0xc4, 0x6b, 511 - 0x01, 0x41, 0xb8, 0x6b, 512 - 0x02, 0x41, 0xb8, 0x7b, 513 - 0xff, 0x42, 0xc4, 0x7b, 514 - 0x04, 0x4c, 0xb8, 0x6b, 515 - 0xe0, 0x41, 0x6c, 0x0e, 516 0x01, 0x44, 0xd4, 0x31, 517 - 0xff, 0x42, 0xcc, 0x7b, 518 - 0x04, 0x4c, 0xcc, 0x6b, 519 - 0xe0, 0x41, 0x6c, 0x0a, 520 - 0xe0, 0x36, 0xf9, 0x61, 521 0xff, 0xea, 0xca, 0x09, 522 0x01, 0xe2, 0xc8, 0x31, 523 0x01, 0x46, 0xda, 0x35, 524 0x01, 0x44, 0xd4, 0x35, 525 0x10, 0xea, 0x80, 0x00, 526 - 0x01, 0xe2, 0x62, 0x36, 527 - 0x04, 0xa6, 0xe4, 0x7b, 528 0xff, 0xea, 0x5a, 0x09, 529 0xff, 0xea, 0x4c, 0x0d, 530 - 0x01, 0xa6, 0x02, 0x6c, 531 - 0x10, 0xad, 0x64, 0x78, 532 - 0x80, 0xad, 0xfa, 0x6b, 533 - 0x08, 0xad, 0x64, 0x68, 534 0x04, 0x84, 0xf9, 0x30, 535 0x00, 0xea, 0x08, 0x81, 536 0xff, 0xea, 0xd4, 0x09, 537 0x02, 0x84, 0xf9, 0x88, 538 0x0d, 0xea, 0x5a, 0x01, 539 0x04, 0xa6, 0x4c, 0x05, 540 - 0x04, 0xa6, 0x64, 0x78, 541 0xff, 0xea, 0x5a, 0x09, 542 0x03, 0x84, 0x59, 0x89, 543 0x03, 0xea, 0x4c, 0x01, 544 - 0x80, 0x1a, 0x64, 0x78, 545 - 0x08, 0x19, 0x64, 0x78, 546 0x08, 0xb0, 0xe0, 0x30, 547 0x04, 0xb0, 0xe0, 0x30, 548 0x03, 0xb0, 0xf0, 0x30, ··· 561 0x00, 0x86, 0x0d, 0x23, 562 0x00, 0x87, 0x0f, 0x23, 563 0x01, 0x84, 0xc5, 0x31, 564 - 0x80, 0x83, 0x25, 0x7c, 565 0x02, 0xe2, 0xc4, 0x01, 566 0xff, 0xea, 0x4c, 0x09, 567 0x01, 0xe2, 0x36, 0x30, 568 0xc8, 0x19, 0x32, 0x00, 569 0x88, 0x19, 0x32, 0x00, 570 0x01, 0xac, 0xd4, 0x99, 571 - 0x00, 0xe2, 0x64, 0x50, 572 0xfe, 0xa6, 0x4c, 0x0d, 573 0x0b, 0x98, 0xe1, 0x30, 574 0xfd, 0xa4, 0x49, 0x09, 575 - 0x80, 0xa3, 0x39, 0x7c, 576 0x02, 0xa4, 0x48, 0x01, 577 0x01, 0xa4, 0x36, 0x30, 578 0xa8, 0xea, 0x32, 0x00, 579 0xfd, 0xa4, 0x49, 0x0b, 580 0x05, 0xa3, 0x07, 0x33, 581 - 0x80, 0x83, 0x45, 0x6c, 582 0x02, 0xea, 0x4c, 0x05, 583 0xff, 0xea, 0x4c, 0x0d, 584 - 0x00, 0xe2, 0x3e, 0x59, 585 - 0x02, 0xa6, 0xe6, 0x6b, 586 0x80, 0xf9, 0xf2, 0x05, 587 - 0xc0, 0x33, 0x53, 0x7c, 588 - 0x03, 0xea, 0x50, 0x59, 589 0x03, 0xea, 0x04, 0x00, 590 - 0x20, 0x33, 0x77, 0x7c, 591 - 0x01, 0x84, 0x5d, 0x6c, 592 - 0x06, 0xea, 0x50, 0x59, 593 0x06, 0xea, 0x04, 0x00, 594 - 0x00, 0xe2, 0x7a, 0x44, 595 - 0x01, 0x00, 0x60, 0x32, 596 - 0xee, 0x00, 0x66, 0x6c, 597 0x05, 0xea, 0xb4, 0x00, 598 - 0x33, 0xea, 0x44, 0x59, 599 0x33, 0xea, 0x00, 0x00, 600 0x80, 0x3d, 0x7a, 0x00, 601 - 0xfc, 0x42, 0x68, 0x7c, 602 0x7f, 0x3d, 0x7a, 0x08, 603 - 0x00, 0x30, 0x45, 0x59, 604 - 0x01, 0x30, 0x01, 0x30, 605 - 0x09, 0xea, 0x50, 0x59, 606 0x09, 0xea, 0x04, 0x00, 607 - 0x00, 0xe2, 0xf8, 0x41, 608 - 0x01, 0xa4, 0x5d, 0x6c, 609 - 0x00, 0xe2, 0x30, 0x5c, 610 - 0x20, 0x33, 0x67, 0x02, 611 - 0x01, 0x00, 0x60, 0x32, 612 - 0x02, 0xa6, 0x82, 0x7c, 613 - 0x00, 0xe2, 0x46, 0x5c, 614 - 0x00, 0xe2, 0x56, 0x58, 615 - 0x00, 0xe2, 0x66, 0x58, 616 - 0x00, 0xe2, 0x3a, 0x58, 617 - 0x00, 0x30, 0x45, 0x59, 618 - 0x01, 0x30, 0x01, 0x30, 619 - 0x20, 0x19, 0x82, 0x6c, 620 - 0x00, 0xe2, 0xb2, 0x5c, 621 - 0x04, 0x19, 0x9c, 0x6c, 622 0x02, 0x19, 0x32, 0x00, 623 - 0x01, 0x84, 0x9d, 0x7c, 624 - 0x01, 0x1b, 0x96, 0x7c, 625 - 0x01, 0x1a, 0x9c, 0x6c, 626 - 0x00, 0xe2, 0x4c, 0x44, 627 - 0x80, 0x4b, 0xa2, 0x6c, 628 - 0x01, 0x4c, 0x9e, 0x7c, 629 - 0x03, 0x42, 0x4c, 0x6c, 630 - 0x00, 0xe2, 0xe0, 0x5b, 631 0x80, 0xf9, 0xf2, 0x01, 632 - 0x04, 0x33, 0xf9, 0x79, 633 - 0x00, 0xe2, 0xf8, 0x41, 634 - 0x08, 0x5d, 0xba, 0x6c, 635 - 0x00, 0xe2, 0x56, 0x58, 636 - 0x00, 0x30, 0x45, 0x59, 637 - 0x01, 0x30, 0x01, 0x30, 638 - 0x02, 0x1b, 0xaa, 0x7c, 639 - 0x08, 0x5d, 0xb8, 0x7c, 640 0x03, 0x68, 0x00, 0x37, 641 0x01, 0x84, 0x09, 0x07, 642 - 0x80, 0x1b, 0xc4, 0x7c, 643 - 0x80, 0x84, 0xc5, 0x6c, 644 0xff, 0x85, 0x0b, 0x1b, 645 0xff, 0x86, 0x0d, 0x23, 646 0xff, 0x87, 0x0f, 0x23, 647 0xf8, 0x1b, 0x08, 0x0b, 648 0xff, 0xea, 0x06, 0x0b, 649 0x03, 0x68, 0x00, 0x37, 650 - 0x00, 0xe2, 0xc4, 0x58, 651 0x10, 0xea, 0x18, 0x00, 652 0xf9, 0xd9, 0xb2, 0x0d, 653 0x01, 0xd9, 0xb2, 0x05, 654 0x01, 0x52, 0x48, 0x31, 655 - 0x20, 0xa4, 0xee, 0x7c, 656 - 0x20, 0x5b, 0xee, 0x7c, 657 - 0x80, 0xf9, 0xfc, 0x7c, 658 0x02, 0xea, 0xb4, 0x00, 659 0x11, 0x00, 0x00, 0x10, 660 - 0x04, 0x19, 0x08, 0x7d, 661 0xdf, 0x19, 0x32, 0x08, 662 - 0x60, 0x5b, 0xe6, 0x6c, 663 - 0x01, 0x4c, 0xe2, 0x7c, 664 0x20, 0x19, 0x32, 0x00, 665 0x01, 0xd9, 0xb2, 0x05, 666 0x02, 0xea, 0xb4, 0x00, 667 0x01, 0xd9, 0xb2, 0x05, 668 - 0x10, 0x5b, 0x00, 0x6d, 669 - 0x08, 0x5b, 0x0a, 0x6d, 670 - 0x20, 0x5b, 0xfa, 0x6c, 671 - 0x02, 0x5b, 0x2a, 0x6d, 672 - 0x0e, 0xea, 0x50, 0x59, 673 0x0e, 0xea, 0x04, 0x00, 674 - 0x80, 0xf9, 0xea, 0x6c, 675 0xdf, 0x5c, 0xb8, 0x08, 676 0x01, 0xd9, 0xb2, 0x05, 677 - 0x01, 0xa4, 0xe5, 0x6d, 678 - 0x00, 0xe2, 0x30, 0x5c, 679 - 0x00, 0xe2, 0x34, 0x5d, 680 0x01, 0x90, 0x21, 0x1b, 681 0x01, 0xd9, 0xb2, 0x05, 682 - 0x00, 0xe2, 0x32, 0x5b, 683 0xf3, 0x96, 0xd5, 0x19, 684 - 0x00, 0xe2, 0x18, 0x55, 685 - 0x80, 0x96, 0x19, 0x6d, 686 - 0x0f, 0xea, 0x50, 0x59, 687 0x0f, 0xea, 0x04, 0x00, 688 - 0x00, 0xe2, 0x20, 0x45, 689 0x04, 0x8c, 0xe1, 0x30, 690 0x01, 0xea, 0xf2, 0x00, 691 0x02, 0xea, 0x36, 0x00, 692 0xa8, 0xea, 0x32, 0x00, 693 - 0xff, 0x97, 0x27, 0x7d, 694 - 0x14, 0xea, 0x50, 0x59, 695 0x14, 0xea, 0x04, 0x00, 696 - 0x00, 0xe2, 0x96, 0x5d, 697 0x01, 0xd9, 0xb2, 0x05, 698 0x09, 0x80, 0xe1, 0x30, 699 0x02, 0xea, 0x36, 0x00, 700 0xa8, 0xea, 0x32, 0x00, 701 - 0x00, 0xe2, 0x8e, 0x5d, 702 0x01, 0xd9, 0xb2, 0x05, 703 - 0x02, 0xa6, 0x44, 0x7d, 704 - 0x00, 0xe2, 0x3e, 0x59, 705 - 0x20, 0x5b, 0x52, 0x6d, 706 - 0xfc, 0x42, 0x3e, 0x7d, 707 - 0x10, 0x40, 0x40, 0x6d, 708 - 0x20, 0x4d, 0x42, 0x7d, 709 - 0x08, 0x5d, 0x52, 0x6d, 710 - 0x02, 0xa6, 0xe6, 0x6b, 711 - 0x00, 0xe2, 0x3e, 0x59, 712 - 0x20, 0x5b, 0x52, 0x6d, 713 - 0x01, 0x1b, 0x72, 0x6d, 714 - 0xfc, 0x42, 0x4e, 0x7d, 715 - 0x10, 0x40, 0x50, 0x6d, 716 - 0x20, 0x4d, 0x64, 0x78, 717 - 0x08, 0x5d, 0x64, 0x78, 718 0x02, 0x19, 0x32, 0x00, 719 0x01, 0x5b, 0x40, 0x31, 720 - 0x00, 0xe2, 0xb2, 0x5c, 721 - 0x00, 0xe2, 0x9e, 0x5b, 722 0x20, 0xea, 0xb6, 0x00, 723 - 0x00, 0xe2, 0xe0, 0x5b, 724 0x20, 0x5c, 0xb8, 0x00, 725 - 0x04, 0x19, 0x68, 0x6d, 726 - 0x01, 0x1a, 0x68, 0x6d, 727 - 0x00, 0xe2, 0x3e, 0x59, 728 - 0x01, 0x1a, 0x64, 0x78, 729 0x80, 0xf9, 0xf2, 0x01, 730 - 0x20, 0xa0, 0xcc, 0x7d, 731 0xff, 0x90, 0x21, 0x1b, 732 - 0x08, 0x92, 0x43, 0x6b, 733 0x02, 0xea, 0xb4, 0x04, 734 0x01, 0xa4, 0x49, 0x03, 735 - 0x40, 0x5b, 0x82, 0x6d, 736 - 0x00, 0xe2, 0x3e, 0x59, 737 - 0x40, 0x5b, 0x82, 0x6d, 738 - 0x04, 0x5d, 0xe6, 0x7d, 739 - 0x01, 0x1a, 0xe6, 0x7d, 740 - 0x20, 0x4d, 0x64, 0x78, 741 - 0x40, 0x5b, 0xcc, 0x7d, 742 - 0x04, 0x5d, 0xe6, 0x7d, 743 - 0x01, 0x1a, 0xe6, 0x7d, 744 0x80, 0xf9, 0xf2, 0x01, 745 0xff, 0x90, 0x21, 0x1b, 746 - 0x08, 0x92, 0x43, 0x6b, 747 0x02, 0xea, 0xb4, 0x04, 748 - 0x00, 0xe2, 0x3e, 0x59, 749 - 0x01, 0x1b, 0x64, 0x78, 750 0x80, 0xf9, 0xf2, 0x01, 751 0x02, 0xea, 0xb4, 0x04, 752 - 0x00, 0xe2, 0x3e, 0x59, 753 - 0x01, 0x1b, 0xaa, 0x6d, 754 - 0x40, 0x5b, 0xb8, 0x7d, 755 - 0x01, 0x1b, 0xaa, 0x6d, 756 0x02, 0x19, 0x32, 0x00, 757 - 0x01, 0x1a, 0x64, 0x78, 758 0x80, 0xf9, 0xf2, 0x01, 759 0xff, 0xea, 0x10, 0x03, 760 0x08, 0x92, 0x25, 0x03, 761 - 0x00, 0xe2, 0x42, 0x43, 762 - 0x01, 0x1a, 0xb4, 0x7d, 763 - 0x40, 0x5b, 0xb0, 0x7d, 764 - 0x01, 0x1a, 0x9e, 0x6d, 765 - 0xfc, 0x42, 0x64, 0x78, 766 - 0x01, 0x1a, 0xb8, 0x6d, 767 - 0x10, 0xea, 0x50, 0x59, 768 0x10, 0xea, 0x04, 0x00, 769 - 0xfc, 0x42, 0x64, 0x78, 770 - 0x10, 0x40, 0xbe, 0x6d, 771 - 0x20, 0x4d, 0x64, 0x78, 772 - 0x40, 0x5b, 0x9e, 0x6d, 773 - 0x01, 0x1a, 0x64, 0x78, 774 0x01, 0x90, 0x21, 0x1b, 775 0x30, 0x3f, 0xc0, 0x09, 776 - 0x30, 0xe0, 0x64, 0x60, 777 - 0x40, 0x4b, 0x64, 0x68, 778 0xff, 0xea, 0x52, 0x01, 779 - 0xee, 0x00, 0xd2, 0x6d, 780 0x80, 0xf9, 0xf2, 0x01, 781 0xff, 0x90, 0x21, 0x1b, 782 0x02, 0xea, 0xb4, 0x00, 783 0x20, 0xea, 0x9a, 0x00, 784 - 0xf3, 0x42, 0xde, 0x6d, 785 - 0x12, 0xea, 0x50, 0x59, 786 0x12, 0xea, 0x04, 0x00, 787 - 0x00, 0xe2, 0xf8, 0x41, 788 - 0x0d, 0xea, 0x50, 0x59, 789 0x0d, 0xea, 0x04, 0x00, 790 - 0x00, 0xe2, 0xf8, 0x41, 791 0x01, 0x90, 0x21, 0x1b, 792 - 0x11, 0xea, 0x50, 0x59, 793 0x11, 0xea, 0x04, 0x00, 794 - 0x00, 0xe2, 0x32, 0x5b, 795 0x08, 0x5a, 0xb4, 0x00, 796 - 0x00, 0xe2, 0x0c, 0x5e, 797 0xa8, 0xea, 0x32, 0x00, 798 - 0x00, 0xe2, 0x3e, 0x59, 799 - 0x80, 0x1a, 0xfa, 0x7d, 800 - 0x00, 0xe2, 0x0c, 0x5e, 801 0x80, 0x19, 0x32, 0x00, 802 - 0x40, 0x5b, 0x00, 0x6e, 803 - 0x08, 0x5a, 0x00, 0x7e, 804 - 0x20, 0x4d, 0x64, 0x78, 805 0x02, 0x84, 0x09, 0x03, 806 - 0x40, 0x5b, 0xcc, 0x7d, 807 0xff, 0x90, 0x21, 0x1b, 808 0x80, 0xf9, 0xf2, 0x01, 809 - 0x08, 0x92, 0x43, 0x6b, 810 0x02, 0xea, 0xb4, 0x04, 811 - 0x01, 0x38, 0xe1, 0x30, 812 - 0x05, 0x39, 0xe3, 0x98, 813 0x01, 0xe0, 0xf4, 0x31, 814 0xff, 0xea, 0xc0, 0x09, 815 - 0x00, 0x3a, 0xe5, 0x20, 816 - 0x00, 0x3b, 0xe7, 0x20, 817 0x01, 0xfa, 0xc0, 0x31, 818 0x04, 0xea, 0xe8, 0x30, 819 0xff, 0xea, 0xf0, 0x08, ··· 822 }; 823 824 typedef int ahd_patch_func_t (struct ahd_softc *ahd); 825 static ahd_patch_func_t ahd_patch22_func; 826 827 static int 828 ahd_patch22_func(struct ahd_softc *ahd) 829 { 830 - return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0); 831 } 832 833 static ahd_patch_func_t ahd_patch21_func; ··· 843 static int 844 ahd_patch21_func(struct ahd_softc *ahd) 845 { 846 - return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0); 847 } 848 849 static ahd_patch_func_t ahd_patch20_func; ··· 851 static int 852 ahd_patch20_func(struct ahd_softc *ahd) 853 { 854 - return ((ahd->features & AHD_RTI) == 0); 855 } 856 857 static ahd_patch_func_t ahd_patch19_func; ··· 859 static int 860 ahd_patch19_func(struct ahd_softc *ahd) 861 { 862 - return ((ahd->flags & AHD_INITIATORROLE) != 0); 863 } 864 865 static ahd_patch_func_t ahd_patch18_func; ··· 867 static int 868 ahd_patch18_func(struct ahd_softc *ahd) 869 { 870 - return ((ahd->flags & AHD_TARGETROLE) != 0); 871 } 872 873 static ahd_patch_func_t ahd_patch17_func; ··· 875 static int 876 ahd_patch17_func(struct ahd_softc *ahd) 877 { 878 - return ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0); 879 } 880 881 static ahd_patch_func_t ahd_patch16_func; ··· 883 static int 884 ahd_patch16_func(struct ahd_softc *ahd) 885 { 886 - return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0); 887 } 888 889 static ahd_patch_func_t ahd_patch15_func; ··· 891 static int 892 ahd_patch15_func(struct ahd_softc *ahd) 893 { 894 - return ((ahd->flags & AHD_39BIT_ADDRESSING) != 0); 895 } 896 897 static ahd_patch_func_t ahd_patch14_func; ··· 899 static int 900 ahd_patch14_func(struct ahd_softc *ahd) 901 { 902 - return ((ahd->flags & AHD_64BIT_ADDRESSING) != 0); 903 } 904 905 static ahd_patch_func_t ahd_patch13_func; ··· 907 static int 908 ahd_patch13_func(struct ahd_softc *ahd) 909 { 910 - return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0); 911 } 912 913 static ahd_patch_func_t ahd_patch12_func; ··· 915 static int 916 ahd_patch12_func(struct ahd_softc *ahd) 917 { 918 - return ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0); 919 } 920 921 static ahd_patch_func_t ahd_patch11_func; ··· 923 static int 924 ahd_patch11_func(struct ahd_softc *ahd) 925 { 926 - return ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0); 927 } 928 929 static ahd_patch_func_t ahd_patch10_func; ··· 931 static int 932 ahd_patch10_func(struct ahd_softc *ahd) 933 { 934 - return ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0); 935 } 936 937 static ahd_patch_func_t ahd_patch9_func; ··· 939 static int 940 ahd_patch9_func(struct ahd_softc *ahd) 941 { 942 - return ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0); 943 } 944 945 static ahd_patch_func_t ahd_patch8_func; ··· 1028 { ahd_patch0_func, 5, 1, 1 }, 1029 { ahd_patch2_func, 6, 1, 2 }, 1030 { ahd_patch0_func, 7, 1, 1 }, 1031 - { ahd_patch3_func, 20, 5, 1 }, 1032 - { ahd_patch2_func, 29, 1, 2 }, 1033 - { ahd_patch0_func, 30, 1, 1 }, 1034 - { ahd_patch1_func, 37, 1, 2 }, 1035 - { ahd_patch0_func, 38, 1, 1 }, 1036 - { ahd_patch2_func, 43, 1, 2 }, 1037 - { ahd_patch0_func, 44, 1, 1 }, 1038 - { ahd_patch2_func, 47, 1, 2 }, 1039 - { ahd_patch0_func, 48, 1, 1 }, 1040 - { ahd_patch2_func, 51, 1, 2 }, 1041 - { ahd_patch0_func, 52, 1, 1 }, 1042 - { ahd_patch2_func, 65, 1, 2 }, 1043 - { ahd_patch0_func, 66, 1, 1 }, 1044 - { ahd_patch2_func, 69, 1, 2 }, 1045 - { ahd_patch0_func, 70, 1, 1 }, 1046 - { ahd_patch1_func, 73, 1, 2 }, 1047 - { ahd_patch0_func, 74, 1, 1 }, 1048 - { ahd_patch4_func, 107, 1, 1 }, 1049 - { ahd_patch2_func, 162, 6, 1 }, 1050 - { ahd_patch1_func, 168, 2, 1 }, 1051 - { ahd_patch5_func, 170, 1, 1 }, 1052 - { ahd_patch2_func, 179, 1, 2 }, 1053 - { ahd_patch0_func, 180, 1, 1 }, 1054 - { ahd_patch6_func, 181, 2, 2 }, 1055 - { ahd_patch0_func, 183, 6, 3 }, 1056 - { ahd_patch2_func, 186, 1, 2 }, 1057 - { ahd_patch0_func, 187, 1, 1 }, 1058 - { ahd_patch2_func, 190, 1, 2 }, 1059 - { ahd_patch0_func, 191, 1, 1 }, 1060 - { ahd_patch7_func, 193, 2, 1 }, 1061 - { ahd_patch5_func, 201, 16, 2 }, 1062 - { ahd_patch0_func, 217, 1, 1 }, 1063 - { ahd_patch8_func, 237, 2, 1 }, 1064 - { ahd_patch1_func, 241, 1, 2 }, 1065 - { ahd_patch0_func, 242, 1, 1 }, 1066 - { ahd_patch7_func, 245, 2, 1 }, 1067 - { ahd_patch1_func, 259, 1, 2 }, 1068 - { ahd_patch0_func, 260, 1, 1 }, 1069 - { ahd_patch1_func, 263, 1, 2 }, 1070 - { ahd_patch0_func, 264, 1, 1 }, 1071 - { ahd_patch2_func, 267, 1, 2 }, 1072 - { ahd_patch0_func, 268, 1, 1 }, 1073 - { ahd_patch1_func, 323, 1, 2 }, 1074 - { ahd_patch0_func, 324, 1, 1 }, 1075 - { ahd_patch2_func, 332, 1, 2 }, 1076 - { ahd_patch0_func, 333, 1, 1 }, 1077 - { ahd_patch2_func, 336, 1, 2 }, 1078 - { ahd_patch0_func, 337, 1, 1 }, 1079 - { ahd_patch1_func, 343, 1, 2 }, 1080 - { ahd_patch0_func, 344, 1, 1 }, 1081 - { ahd_patch1_func, 346, 1, 2 }, 1082 - { ahd_patch0_func, 347, 1, 1 }, 1083 - { ahd_patch9_func, 366, 1, 1 }, 1084 - { ahd_patch9_func, 369, 1, 1 }, 1085 - { ahd_patch9_func, 371, 1, 1 }, 1086 - { ahd_patch9_func, 383, 1, 1 }, 1087 - { ahd_patch1_func, 393, 1, 2 }, 1088 - { ahd_patch0_func, 394, 1, 1 }, 1089 - { ahd_patch1_func, 396, 1, 2 }, 1090 - { ahd_patch0_func, 397, 1, 1 }, 1091 - { ahd_patch1_func, 405, 1, 2 }, 1092 - { ahd_patch0_func, 406, 1, 1 }, 1093 - { ahd_patch2_func, 419, 1, 2 }, 1094 - { ahd_patch0_func, 420, 1, 1 }, 1095 - { ahd_patch10_func, 450, 1, 1 }, 1096 - { ahd_patch1_func, 457, 1, 2 }, 1097 - { ahd_patch0_func, 458, 1, 1 }, 1098 - { ahd_patch2_func, 470, 1, 2 }, 1099 - { ahd_patch0_func, 471, 1, 1 }, 1100 - { ahd_patch11_func, 476, 6, 2 }, 1101 - { ahd_patch0_func, 482, 1, 1 }, 1102 - { ahd_patch12_func, 505, 1, 1 }, 1103 - { ahd_patch13_func, 514, 1, 1 }, 1104 - { ahd_patch14_func, 515, 1, 2 }, 1105 - { ahd_patch0_func, 516, 1, 1 }, 1106 - { ahd_patch15_func, 519, 1, 1 }, 1107 - { ahd_patch14_func, 520, 1, 1 }, 1108 - { ahd_patch16_func, 531, 1, 2 }, 1109 - { ahd_patch0_func, 532, 1, 1 }, 1110 - { ahd_patch1_func, 551, 1, 2 }, 1111 - { ahd_patch0_func, 552, 1, 1 }, 1112 - { ahd_patch1_func, 555, 1, 2 }, 1113 - { ahd_patch0_func, 556, 1, 1 }, 1114 - { ahd_patch2_func, 561, 1, 2 }, 1115 - { ahd_patch0_func, 562, 1, 1 }, 1116 - { ahd_patch2_func, 566, 1, 2 }, 1117 - { ahd_patch0_func, 567, 1, 1 }, 1118 - { ahd_patch1_func, 568, 1, 2 }, 1119 - { ahd_patch0_func, 569, 1, 1 }, 1120 - { ahd_patch2_func, 580, 1, 2 }, 1121 - { ahd_patch0_func, 581, 1, 1 }, 1122 - { ahd_patch17_func, 585, 1, 1 }, 1123 - { ahd_patch18_func, 590, 1, 1 }, 1124 - { ahd_patch19_func, 591, 2, 1 }, 1125 - { ahd_patch18_func, 595, 1, 2 }, 1126 - { ahd_patch0_func, 596, 1, 1 }, 1127 - { ahd_patch2_func, 599, 1, 2 }, 1128 - { ahd_patch0_func, 600, 1, 1 }, 1129 - { ahd_patch2_func, 615, 1, 2 }, 1130 - { ahd_patch0_func, 616, 1, 1 }, 1131 - { ahd_patch20_func, 617, 14, 1 }, 1132 - { ahd_patch1_func, 635, 1, 2 }, 1133 - { ahd_patch0_func, 636, 1, 1 }, 1134 - { ahd_patch20_func, 637, 1, 1 }, 1135 - { ahd_patch1_func, 649, 1, 2 }, 1136 - { ahd_patch0_func, 650, 1, 1 }, 1137 - { ahd_patch1_func, 657, 1, 2 }, 1138 - { ahd_patch0_func, 658, 1, 1 }, 1139 - { ahd_patch17_func, 681, 1, 1 }, 1140 - { ahd_patch17_func, 719, 1, 1 }, 1141 - { ahd_patch1_func, 730, 1, 2 }, 1142 - { ahd_patch0_func, 731, 1, 1 }, 1143 - { ahd_patch1_func, 748, 1, 2 }, 1144 - { ahd_patch0_func, 749, 1, 1 }, 1145 - { ahd_patch1_func, 751, 1, 2 }, 1146 - { ahd_patch0_func, 752, 1, 1 }, 1147 - { ahd_patch1_func, 755, 1, 2 }, 1148 - { ahd_patch0_func, 756, 1, 1 }, 1149 - { ahd_patch21_func, 758, 1, 2 }, 1150 - { ahd_patch0_func, 759, 2, 1 }, 1151 - { ahd_patch22_func, 762, 4, 2 }, 1152 - { ahd_patch0_func, 766, 1, 1 }, 1153 - { ahd_patch22_func, 774, 11, 1 } 1154 }; 1155 1156 static struct cs { 1157 uint16_t begin; 1158 uint16_t end; 1159 } critical_sections[] = { 1160 - { 11, 12 }, 1161 - { 13, 14 }, 1162 - { 29, 42 }, 1163 - { 56, 59 }, 1164 - { 101, 128 }, 1165 - { 129, 157 }, 1166 - { 159, 162 }, 1167 - { 170, 178 }, 1168 - { 201, 250 }, 1169 - { 681, 697 }, 1170 - { 697, 711 }, 1171 - { 721, 725 } 1172 }; 1173 1174 static const int num_critical_sections = sizeof(critical_sections)
··· 2 * DO NOT EDIT - This file is automatically generated 3 * from the following source files: 4 * 5 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $ 6 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $ 7 */ 8 static uint8_t seqprog[] = { 9 0xff, 0x02, 0x06, 0x78, 10 + 0x00, 0xea, 0x64, 0x59, 11 0x01, 0xea, 0x04, 0x30, 12 0xff, 0x04, 0x0c, 0x78, 13 + 0x19, 0xea, 0x64, 0x59, 14 0x19, 0xea, 0x04, 0x00, 15 + 0x33, 0xea, 0x5e, 0x59, 16 0x33, 0xea, 0x00, 0x00, 17 + 0x60, 0x3a, 0x3a, 0x68, 18 + 0x04, 0x4d, 0x35, 0x78, 19 + 0x01, 0x34, 0xc1, 0x31, 20 + 0x00, 0x32, 0x21, 0x60, 21 + 0x01, 0x35, 0xc1, 0x31, 22 + 0x00, 0x33, 0x21, 0x60, 23 + 0xfb, 0x4d, 0x9b, 0x0a, 24 + 0x00, 0xe2, 0x34, 0x40, 25 + 0x50, 0x4b, 0x3a, 0x68, 26 + 0xff, 0x31, 0x3b, 0x70, 27 + 0x02, 0x30, 0x51, 0x31, 28 + 0xff, 0x8d, 0x2d, 0x70, 29 + 0x02, 0x8c, 0x51, 0x31, 30 + 0xff, 0x8d, 0x29, 0x60, 31 + 0x02, 0x28, 0x19, 0x33, 32 + 0x02, 0x30, 0x51, 0x32, 33 + 0xff, 0xea, 0x62, 0x02, 34 + 0x00, 0xe2, 0x3a, 0x40, 35 + 0xff, 0x21, 0x3b, 0x70, 36 + 0x40, 0x4b, 0xaa, 0x69, 37 + 0x00, 0xe2, 0x68, 0x59, 38 + 0x40, 0x4b, 0xaa, 0x69, 39 + 0x20, 0x4b, 0x96, 0x69, 40 + 0xfc, 0x42, 0x44, 0x78, 41 + 0x10, 0x40, 0x44, 0x78, 42 + 0x00, 0xe2, 0xfc, 0x5d, 43 + 0x20, 0x4d, 0x48, 0x78, 44 + 0x00, 0xe2, 0xfc, 0x5d, 45 0x30, 0x3f, 0xc0, 0x09, 46 + 0x30, 0xe0, 0x50, 0x60, 47 0x7f, 0x4a, 0x94, 0x08, 48 + 0x00, 0xe2, 0x52, 0x40, 49 0xc0, 0x4a, 0x94, 0x00, 50 + 0x00, 0xe2, 0x5e, 0x58, 51 + 0x00, 0xe2, 0x76, 0x58, 52 + 0x00, 0xe2, 0x86, 0x58, 53 0x00, 0xe2, 0x06, 0x40, 54 + 0x33, 0xea, 0x5e, 0x59, 55 0x33, 0xea, 0x00, 0x00, 56 + 0x01, 0x52, 0x84, 0x78, 57 0x02, 0x58, 0x50, 0x31, 58 0xff, 0xea, 0x10, 0x0b, 59 + 0xff, 0x97, 0x6f, 0x78, 60 + 0x50, 0x4b, 0x6a, 0x68, 61 0xbf, 0x3a, 0x74, 0x08, 62 + 0x14, 0xea, 0x64, 0x59, 63 0x14, 0xea, 0x04, 0x00, 64 0x08, 0x92, 0x25, 0x03, 65 + 0xff, 0x90, 0x5f, 0x68, 66 + 0x00, 0xe2, 0x76, 0x5b, 67 + 0x00, 0xe2, 0x5e, 0x40, 68 + 0x00, 0xea, 0x5e, 0x59, 69 0x01, 0xea, 0x00, 0x30, 70 + 0x80, 0xf9, 0x7e, 0x68, 71 + 0x00, 0xe2, 0x5c, 0x59, 72 + 0x11, 0xea, 0x5e, 0x59, 73 0x11, 0xea, 0x00, 0x00, 74 + 0x80, 0xf9, 0x5c, 0x79, 75 0xff, 0xea, 0xd4, 0x0d, 76 + 0x22, 0xea, 0x5e, 0x59, 77 0x22, 0xea, 0x00, 0x00, 78 + 0x10, 0x16, 0x90, 0x78, 79 0x10, 0x16, 0x2c, 0x00, 80 + 0x01, 0x0b, 0xae, 0x32, 81 + 0x18, 0xad, 0x12, 0x79, 82 + 0x04, 0xad, 0xdc, 0x68, 83 + 0x80, 0xad, 0x84, 0x78, 84 + 0x10, 0xad, 0xaa, 0x78, 85 0xe7, 0xad, 0x5a, 0x09, 86 0x02, 0x8c, 0x59, 0x32, 87 + 0xff, 0x8d, 0xa1, 0x60, 88 + 0xff, 0xea, 0x5e, 0x02, 89 + 0xff, 0x88, 0xa7, 0x78, 90 + 0x02, 0x30, 0x19, 0x33, 91 + 0x02, 0xa8, 0x60, 0x36, 92 0x02, 0x28, 0x19, 0x33, 93 0x02, 0xa8, 0x50, 0x36, 94 0xe7, 0xad, 0x5a, 0x09, 95 + 0x00, 0xe2, 0xb8, 0x58, 96 0xff, 0xea, 0x56, 0x02, 97 + 0x04, 0x7c, 0x88, 0x32, 98 + 0x20, 0x16, 0x84, 0x78, 99 + 0x04, 0x40, 0x89, 0x32, 100 + 0x80, 0x3d, 0x7b, 0x16, 101 + 0xff, 0x2d, 0xc7, 0x60, 102 + 0xff, 0x29, 0xc7, 0x60, 103 + 0x40, 0x57, 0xd7, 0x78, 104 + 0xff, 0x55, 0xc7, 0x68, 105 + 0xff, 0x53, 0xc1, 0x19, 106 + 0x00, 0x54, 0xd5, 0x19, 107 + 0x00, 0xe2, 0xd6, 0x50, 108 + 0x01, 0x52, 0xc1, 0x31, 109 + 0x00, 0x56, 0xd5, 0x19, 110 + 0x00, 0xe2, 0xd6, 0x48, 111 + 0x80, 0x18, 0x84, 0x78, 112 + 0x02, 0x50, 0x1d, 0x30, 113 0x10, 0xea, 0x18, 0x00, 114 0x60, 0x18, 0x30, 0x00, 115 0x7f, 0x18, 0x30, 0x0c, 116 0x02, 0xea, 0x02, 0x00, 117 + 0xff, 0xea, 0xac, 0x0a, 118 0x80, 0x18, 0x30, 0x04, 119 + 0x40, 0xad, 0x84, 0x78, 120 0xe7, 0xad, 0x5a, 0x09, 121 0x02, 0xa8, 0x40, 0x31, 122 0xff, 0xea, 0xc0, 0x09, 123 + 0x01, 0x54, 0xa9, 0x1a, 124 + 0x00, 0x55, 0xab, 0x22, 125 0x01, 0x94, 0x6d, 0x33, 126 + 0xff, 0xea, 0x20, 0x0b, 127 0x04, 0xac, 0x49, 0x32, 128 0xff, 0xea, 0x5a, 0x03, 129 0xff, 0xea, 0x5e, 0x03, 130 0x01, 0x10, 0xd4, 0x31, 131 + 0x10, 0x92, 0x07, 0x69, 132 0x3d, 0x93, 0xc5, 0x29, 133 0xfe, 0xe2, 0xc4, 0x09, 134 0x01, 0xea, 0xc6, 0x01, 135 0x02, 0xe2, 0xc8, 0x31, 136 0x02, 0xec, 0x50, 0x31, 137 0x02, 0xa0, 0xda, 0x31, 138 + 0xff, 0xa9, 0x06, 0x71, 139 0x02, 0xa0, 0x58, 0x37, 140 + 0xff, 0x21, 0x0f, 0x71, 141 0x02, 0x22, 0x51, 0x31, 142 0x02, 0xa0, 0x5c, 0x33, 143 0x02, 0xa0, 0x44, 0x36, 144 0x02, 0xa0, 0x40, 0x32, 145 0x02, 0xa0, 0x44, 0x36, 146 + 0x04, 0x4d, 0x17, 0x69, 147 + 0x40, 0x16, 0x48, 0x69, 148 + 0xff, 0x2d, 0x4d, 0x61, 149 + 0xff, 0x29, 0x85, 0x70, 150 0x02, 0x28, 0x55, 0x32, 151 0x01, 0xea, 0x5a, 0x01, 152 + 0x04, 0x44, 0xf9, 0x30, 153 + 0x01, 0x44, 0xc1, 0x31, 154 0x02, 0x28, 0x51, 0x31, 155 + 0x02, 0xa8, 0x60, 0x31, 156 + 0x01, 0xa4, 0x61, 0x31, 157 + 0x01, 0x3d, 0x61, 0x31, 158 0x01, 0x14, 0xd4, 0x31, 159 + 0x01, 0x56, 0xad, 0x1a, 160 + 0xff, 0x54, 0xa9, 0x1a, 161 + 0xff, 0x55, 0xab, 0x22, 162 + 0xff, 0x8d, 0x41, 0x71, 163 + 0x80, 0xac, 0x40, 0x71, 164 + 0x20, 0x16, 0x40, 0x69, 165 + 0x00, 0xac, 0xc4, 0x19, 166 + 0x07, 0xe2, 0x40, 0xf9, 167 0x02, 0x8c, 0x51, 0x31, 168 + 0x00, 0xe2, 0x24, 0x41, 169 0x01, 0xac, 0x08, 0x31, 170 0x09, 0xea, 0x5a, 0x01, 171 0x02, 0x8c, 0x51, 0x32, 172 0xff, 0xea, 0x1a, 0x07, 173 0x04, 0x24, 0xf9, 0x30, 174 + 0x1d, 0xea, 0x52, 0x41, 175 0x02, 0x2c, 0x51, 0x31, 176 0x04, 0xa8, 0xf9, 0x30, 177 + 0x19, 0xea, 0x52, 0x41, 178 0x06, 0xea, 0x08, 0x81, 179 0x01, 0xe2, 0x5a, 0x35, 180 + 0x02, 0xf2, 0xf0, 0x31, 181 + 0xff, 0xea, 0xd4, 0x0d, 182 0x02, 0xf2, 0xf0, 0x31, 183 0x02, 0xf8, 0xe4, 0x35, 184 0x80, 0xea, 0xb2, 0x01, 185 0x01, 0xe2, 0x00, 0x30, 186 0xff, 0xea, 0xb2, 0x0d, 187 0x01, 0xe2, 0x04, 0x30, 188 0x01, 0xea, 0x04, 0x34, ··· 180 0x02, 0x20, 0xb9, 0x30, 181 0x02, 0x20, 0x51, 0x31, 182 0x4c, 0x93, 0xd7, 0x28, 183 + 0x10, 0x92, 0x77, 0x79, 184 0x01, 0x6b, 0xc0, 0x30, 185 0x02, 0x64, 0xc8, 0x00, 186 0x40, 0x3a, 0x74, 0x04, 187 + 0x00, 0xe2, 0x76, 0x58, 188 + 0x33, 0xea, 0x5e, 0x59, 189 0x33, 0xea, 0x00, 0x00, 190 0x30, 0x3f, 0xc0, 0x09, 191 + 0x30, 0xe0, 0x78, 0x61, 192 + 0x20, 0x3f, 0x8e, 0x69, 193 + 0x10, 0x3f, 0x78, 0x79, 194 0x02, 0xea, 0x7e, 0x00, 195 + 0x00, 0xea, 0x5e, 0x59, 196 0x01, 0xea, 0x00, 0x30, 197 + 0x02, 0x4e, 0x51, 0x35, 198 0x01, 0xea, 0x7e, 0x00, 199 + 0x11, 0xea, 0x5e, 0x59, 200 0x11, 0xea, 0x00, 0x00, 201 + 0x02, 0x4e, 0x51, 0x35, 202 + 0xc0, 0x4a, 0x94, 0x00, 203 + 0x04, 0x41, 0x9c, 0x79, 204 0x08, 0xea, 0x98, 0x00, 205 0x08, 0x57, 0xae, 0x00, 206 0x08, 0x3c, 0x78, 0x00, 207 + 0xf0, 0x49, 0x74, 0x0a, 208 0x0f, 0x67, 0xc0, 0x09, 209 + 0x00, 0x3a, 0x75, 0x02, 210 0x20, 0xea, 0x96, 0x00, 211 + 0x00, 0xe2, 0x14, 0x42, 212 + 0xc0, 0x4a, 0x94, 0x00, 213 + 0x40, 0x3a, 0xc8, 0x69, 214 0x02, 0x55, 0x06, 0x68, 215 + 0x02, 0x56, 0xc8, 0x69, 216 + 0xff, 0x5b, 0xc8, 0x61, 217 0x02, 0x20, 0x51, 0x31, 218 0x80, 0xea, 0xb2, 0x01, 219 0x44, 0xea, 0x00, 0x00, ··· 218 0x33, 0xea, 0x00, 0x00, 219 0xff, 0xea, 0xb2, 0x09, 220 0xff, 0xe0, 0xc0, 0x19, 221 + 0xff, 0xe0, 0xca, 0x79, 222 0x02, 0xac, 0x51, 0x31, 223 + 0x00, 0xe2, 0xc0, 0x41, 224 0x02, 0x5e, 0x50, 0x31, 225 0x02, 0xa8, 0xb8, 0x30, 226 0x02, 0x5c, 0x50, 0x31, 227 + 0xff, 0xad, 0xdb, 0x71, 228 0x02, 0xac, 0x41, 0x31, 229 0x02, 0x22, 0x51, 0x31, 230 0x02, 0xa0, 0x5c, 0x33, 231 0x02, 0xa0, 0x44, 0x32, 232 + 0x00, 0xe2, 0xe4, 0x41, 233 + 0x10, 0x92, 0xe5, 0x69, 234 0x3d, 0x93, 0xc9, 0x29, 235 0x01, 0xe4, 0xc8, 0x01, 236 0x01, 0xea, 0xca, 0x01, 237 0xff, 0xea, 0xda, 0x01, 238 0x02, 0x20, 0x51, 0x31, 239 0x02, 0xae, 0x41, 0x32, 240 + 0xff, 0x21, 0xed, 0x61, 241 0xff, 0xea, 0x46, 0x02, 242 0x02, 0x5c, 0x50, 0x31, 243 0x40, 0xea, 0x96, 0x00, 244 + 0x02, 0x56, 0x04, 0x6e, 245 + 0x01, 0x55, 0x04, 0x6e, 246 + 0x10, 0x92, 0xf9, 0x79, 247 + 0x10, 0x40, 0x02, 0x6a, 248 + 0x01, 0x56, 0x02, 0x7a, 249 0xff, 0x97, 0x07, 0x78, 250 + 0x13, 0xea, 0x64, 0x59, 251 0x13, 0xea, 0x04, 0x00, 252 0x00, 0xe2, 0x06, 0x40, 253 0xbf, 0x3a, 0x74, 0x08, 254 + 0x04, 0x41, 0x08, 0x7a, 255 0x08, 0xea, 0x98, 0x00, 256 0x08, 0x57, 0xae, 0x00, 257 + 0x01, 0x93, 0x75, 0x32, 258 + 0x01, 0x94, 0x77, 0x32, 259 + 0x40, 0xea, 0x72, 0x02, 260 0x08, 0x3c, 0x78, 0x00, 261 + 0x80, 0xea, 0x6e, 0x02, 262 + 0x00, 0xe2, 0xe2, 0x5b, 263 + 0x01, 0x3c, 0xc1, 0x31, 264 + 0x9f, 0xe0, 0x84, 0x7c, 265 + 0x80, 0xe0, 0x28, 0x72, 266 + 0xa0, 0xe0, 0x64, 0x72, 267 + 0xc0, 0xe0, 0x5a, 0x72, 268 + 0xe0, 0xe0, 0x94, 0x72, 269 + 0x01, 0xea, 0x64, 0x59, 270 0x01, 0xea, 0x04, 0x00, 271 + 0x00, 0xe2, 0x14, 0x42, 272 + 0x80, 0x39, 0x2f, 0x7a, 273 + 0x03, 0xea, 0x64, 0x59, 274 0x03, 0xea, 0x04, 0x00, 275 + 0xee, 0x00, 0x36, 0x6a, 276 0x05, 0xea, 0xb4, 0x00, 277 + 0x33, 0xea, 0x5e, 0x59, 278 0x33, 0xea, 0x00, 0x00, 279 + 0x02, 0xa8, 0x9c, 0x32, 280 + 0x00, 0xe2, 0x7e, 0x59, 281 0xef, 0x96, 0xd5, 0x19, 282 + 0x00, 0xe2, 0x46, 0x52, 283 0x09, 0x80, 0xe1, 0x30, 284 0x02, 0xea, 0x36, 0x00, 285 0xa8, 0xea, 0x32, 0x00, 286 + 0x00, 0xe2, 0x4c, 0x42, 287 0x01, 0x96, 0xd1, 0x30, 288 0x10, 0x80, 0x89, 0x31, 289 0x20, 0xea, 0x32, 0x00, 290 + 0xbf, 0x39, 0x73, 0x0a, 291 + 0x10, 0x4c, 0x56, 0x6a, 292 + 0x20, 0x19, 0x4e, 0x6a, 293 + 0x20, 0x19, 0x52, 0x6a, 294 + 0x02, 0x4d, 0x14, 0x6a, 295 + 0x40, 0x39, 0x73, 0x02, 296 + 0x00, 0xe2, 0x14, 0x42, 297 + 0x80, 0x39, 0xd5, 0x6a, 298 0x01, 0x44, 0x10, 0x33, 299 0x08, 0x92, 0x25, 0x03, 300 + 0x00, 0xe2, 0x14, 0x42, 301 0x10, 0xea, 0x80, 0x00, 302 + 0x01, 0x37, 0xc5, 0x31, 303 + 0x80, 0xe2, 0x80, 0x62, 304 + 0x10, 0x92, 0xa5, 0x6a, 305 0xc0, 0x94, 0xc5, 0x01, 306 + 0x40, 0x92, 0x71, 0x6a, 307 0xbf, 0xe2, 0xc4, 0x09, 308 + 0x20, 0x92, 0x85, 0x7a, 309 0x01, 0xe2, 0x88, 0x30, 310 + 0x00, 0xe2, 0xe2, 0x5b, 311 + 0xa0, 0x3c, 0x8d, 0x62, 312 0x23, 0x92, 0x89, 0x08, 313 + 0x00, 0xe2, 0xe2, 0x5b, 314 + 0xa0, 0x3c, 0x8d, 0x62, 315 + 0x00, 0xa8, 0x84, 0x42, 316 + 0xff, 0xe2, 0x84, 0x62, 317 + 0x00, 0xe2, 0xa4, 0x42, 318 0x40, 0xea, 0x98, 0x00, 319 0x01, 0xe2, 0x88, 0x30, 320 + 0x00, 0xe2, 0xe2, 0x5b, 321 + 0xa0, 0x3c, 0x63, 0x72, 322 0x40, 0xea, 0x98, 0x00, 323 + 0x01, 0x37, 0x95, 0x32, 324 + 0x08, 0xea, 0x6e, 0x02, 325 + 0x00, 0xe2, 0x14, 0x42, 326 + 0xe0, 0xea, 0xfe, 0x5b, 327 + 0x80, 0xe0, 0xe0, 0x6a, 328 + 0x04, 0xe0, 0x92, 0x73, 329 + 0x02, 0xe0, 0xc4, 0x73, 330 + 0x00, 0xea, 0x3e, 0x73, 331 + 0x03, 0xe0, 0xd4, 0x73, 332 + 0x23, 0xe0, 0xb6, 0x72, 333 + 0x08, 0xe0, 0xdc, 0x72, 334 + 0x00, 0xe2, 0xe2, 0x5b, 335 + 0x07, 0xea, 0x64, 0x59, 336 0x07, 0xea, 0x04, 0x00, 337 + 0x08, 0x48, 0x15, 0x72, 338 + 0x04, 0x48, 0xb3, 0x62, 339 + 0x01, 0x49, 0x89, 0x30, 340 + 0x00, 0xe2, 0xa4, 0x42, 341 0x01, 0x44, 0xd4, 0x31, 342 + 0x00, 0xe2, 0xa4, 0x42, 343 + 0x01, 0x00, 0x6c, 0x32, 344 + 0x33, 0xea, 0x5e, 0x59, 345 0x33, 0xea, 0x00, 0x00, 346 + 0x4c, 0x3a, 0xc1, 0x28, 347 0x01, 0x64, 0xc0, 0x31, 348 + 0x00, 0x36, 0x5f, 0x59, 349 + 0x01, 0x36, 0x01, 0x30, 350 + 0x01, 0xe0, 0xda, 0x7a, 351 + 0xa0, 0xea, 0xf4, 0x5b, 352 + 0x01, 0xa0, 0xda, 0x62, 353 + 0x01, 0x84, 0xcf, 0x7a, 354 + 0x01, 0x95, 0xdd, 0x6a, 355 + 0x05, 0xea, 0x64, 0x59, 356 0x05, 0xea, 0x04, 0x00, 357 + 0x00, 0xe2, 0xdc, 0x42, 358 + 0x03, 0xea, 0x64, 0x59, 359 0x03, 0xea, 0x04, 0x00, 360 + 0x00, 0xe2, 0xdc, 0x42, 361 + 0x07, 0xea, 0x06, 0x5c, 362 0x01, 0x44, 0xd4, 0x31, 363 + 0x00, 0xe2, 0x14, 0x42, 364 + 0x3f, 0xe0, 0x76, 0x0a, 365 + 0xc0, 0x3a, 0xc1, 0x09, 366 + 0x00, 0x3b, 0x51, 0x01, 367 0xff, 0xea, 0x52, 0x09, 368 + 0x30, 0x3a, 0xc5, 0x09, 369 0x3d, 0xe2, 0xc4, 0x29, 370 0xb8, 0xe2, 0xc4, 0x19, 371 0x01, 0xea, 0xc6, 0x01, 372 0x02, 0xe2, 0xc8, 0x31, 373 0x02, 0xec, 0x40, 0x31, 374 + 0xff, 0xa1, 0xfc, 0x72, 375 0x02, 0xe8, 0xda, 0x31, 376 0x02, 0xa0, 0x50, 0x31, 377 + 0x00, 0xe2, 0x1e, 0x43, 378 + 0x80, 0x39, 0x73, 0x02, 379 0x01, 0x44, 0xd4, 0x31, 380 + 0x00, 0xe2, 0xe2, 0x5b, 381 + 0x01, 0x39, 0x73, 0x02, 382 + 0xe0, 0x3c, 0x39, 0x63, 383 + 0x02, 0x39, 0x73, 0x02, 384 + 0x20, 0x46, 0x32, 0x63, 385 0xff, 0xea, 0x52, 0x09, 386 + 0xa8, 0xea, 0xf4, 0x5b, 387 + 0x04, 0x92, 0x19, 0x7b, 388 + 0x01, 0x3a, 0xc1, 0x31, 389 + 0x00, 0x93, 0x19, 0x63, 390 + 0x01, 0x3b, 0xc1, 0x31, 391 + 0x00, 0x94, 0x23, 0x73, 392 0x01, 0xa9, 0x52, 0x11, 393 + 0xff, 0xa9, 0x0e, 0x6b, 394 + 0x00, 0xe2, 0x32, 0x43, 395 + 0x10, 0x39, 0x73, 0x02, 396 + 0x04, 0x92, 0x33, 0x7b, 397 0xfb, 0x92, 0x25, 0x0b, 398 + 0xff, 0xea, 0x72, 0x0a, 399 + 0x01, 0xa4, 0x2d, 0x6b, 400 + 0x02, 0xa8, 0x9c, 0x32, 401 + 0x00, 0xe2, 0x7e, 0x59, 402 + 0x10, 0x92, 0xdd, 0x7a, 403 + 0xff, 0xea, 0x06, 0x5c, 404 + 0x00, 0xe2, 0xdc, 0x42, 405 + 0x04, 0xea, 0x64, 0x59, 406 0x04, 0xea, 0x04, 0x00, 407 + 0x00, 0xe2, 0xdc, 0x42, 408 + 0x04, 0xea, 0x64, 0x59, 409 0x04, 0xea, 0x04, 0x00, 410 + 0x00, 0xe2, 0x14, 0x42, 411 + 0x08, 0x92, 0xd5, 0x7a, 412 + 0xc0, 0x39, 0x49, 0x7b, 413 + 0x80, 0x39, 0xd5, 0x6a, 414 + 0xff, 0x88, 0x49, 0x6b, 415 + 0x40, 0x39, 0xd5, 0x6a, 416 + 0x10, 0x92, 0x4f, 0x7b, 417 + 0x0a, 0xea, 0x64, 0x59, 418 0x0a, 0xea, 0x04, 0x00, 419 + 0x00, 0xe2, 0x6e, 0x5b, 420 + 0x00, 0xe2, 0xae, 0x43, 421 + 0x50, 0x4b, 0x56, 0x6b, 422 0xbf, 0x3a, 0x74, 0x08, 423 0x01, 0xe0, 0xf4, 0x31, 424 0xff, 0xea, 0xc0, 0x09, 425 + 0x01, 0x32, 0x65, 0x1a, 426 + 0x00, 0x33, 0x67, 0x22, 427 + 0x04, 0x4d, 0x9b, 0x02, 428 0x01, 0xfa, 0xc0, 0x35, 429 + 0x02, 0xa8, 0x90, 0x32, 430 0x02, 0xea, 0xb4, 0x00, 431 + 0x33, 0xea, 0x5e, 0x59, 432 0x33, 0xea, 0x00, 0x00, 433 + 0x02, 0x48, 0x51, 0x31, 434 + 0xff, 0x90, 0x85, 0x68, 435 + 0xff, 0x88, 0x7b, 0x6b, 436 + 0x01, 0xa4, 0x77, 0x6b, 437 + 0x02, 0xa4, 0x7f, 0x6b, 438 + 0x01, 0x84, 0x7f, 0x7b, 439 0x02, 0x28, 0x19, 0x33, 440 0x02, 0xa8, 0x50, 0x36, 441 + 0xff, 0x88, 0x7f, 0x73, 442 + 0x00, 0xe2, 0x52, 0x5b, 443 0x02, 0xa8, 0x20, 0x33, 444 + 0x04, 0xa4, 0x49, 0x03, 445 + 0xff, 0xea, 0x1a, 0x03, 446 + 0xff, 0x2d, 0x8b, 0x63, 447 0x02, 0xa8, 0x58, 0x32, 448 + 0x02, 0xa8, 0x5c, 0x36, 449 0x02, 0xa8, 0x40, 0x31, 450 + 0x02, 0x2e, 0x51, 0x31, 451 + 0x02, 0xa0, 0x18, 0x33, 452 + 0x02, 0xa0, 0x5c, 0x36, 453 + 0xc0, 0x39, 0xd5, 0x6a, 454 + 0x04, 0x92, 0x25, 0x03, 455 + 0x20, 0x92, 0xaf, 0x6b, 456 + 0x02, 0xa8, 0x40, 0x31, 457 + 0xc0, 0x3a, 0xc1, 0x09, 458 + 0x00, 0x3b, 0x51, 0x01, 459 0xff, 0xea, 0x52, 0x09, 460 + 0x30, 0x3a, 0xc5, 0x09, 461 0x3d, 0xe2, 0xc4, 0x29, 462 0xb8, 0xe2, 0xc4, 0x19, 463 0x01, 0xea, 0xc6, 0x01, ··· 458 0xf7, 0x57, 0xae, 0x08, 459 0x08, 0xea, 0x98, 0x00, 460 0x01, 0x44, 0xd4, 0x31, 461 + 0xee, 0x00, 0xb8, 0x6b, 462 0x02, 0xea, 0xb4, 0x00, 463 + 0xc0, 0xea, 0x72, 0x02, 464 + 0x09, 0x4c, 0xba, 0x7b, 465 + 0x01, 0xea, 0x78, 0x02, 466 0x08, 0x4c, 0x06, 0x68, 467 + 0x0b, 0xea, 0x64, 0x59, 468 0x0b, 0xea, 0x04, 0x00, 469 0x01, 0x44, 0xd4, 0x31, 470 + 0x20, 0x39, 0x15, 0x7a, 471 + 0x00, 0xe2, 0xcc, 0x5b, 472 + 0x00, 0xe2, 0x14, 0x42, 473 + 0x01, 0x84, 0xd1, 0x7b, 474 0x01, 0xa4, 0x49, 0x07, 475 0x08, 0x60, 0x30, 0x33, 476 0x08, 0x80, 0x41, 0x37, 477 + 0xdf, 0x39, 0x73, 0x0a, 478 + 0xee, 0x00, 0xde, 0x6b, 479 0x05, 0xea, 0xb4, 0x00, 480 + 0x33, 0xea, 0x5e, 0x59, 481 0x33, 0xea, 0x00, 0x00, 482 + 0x00, 0xe2, 0x7e, 0x59, 483 + 0x00, 0xe2, 0xdc, 0x42, 484 + 0xff, 0x42, 0xee, 0x6b, 485 + 0x01, 0x41, 0xe2, 0x6b, 486 + 0x02, 0x41, 0xe2, 0x7b, 487 + 0xff, 0x42, 0xee, 0x6b, 488 + 0x01, 0x41, 0xe2, 0x6b, 489 + 0x02, 0x41, 0xe2, 0x7b, 490 + 0xff, 0x42, 0xee, 0x7b, 491 + 0x04, 0x4c, 0xe2, 0x6b, 492 + 0xe0, 0x41, 0x78, 0x0e, 493 0x01, 0x44, 0xd4, 0x31, 494 + 0xff, 0x42, 0xf6, 0x7b, 495 + 0x04, 0x4c, 0xf6, 0x6b, 496 + 0xe0, 0x41, 0x78, 0x0a, 497 + 0xe0, 0x3c, 0x15, 0x62, 498 0xff, 0xea, 0xca, 0x09, 499 0x01, 0xe2, 0xc8, 0x31, 500 0x01, 0x46, 0xda, 0x35, 501 0x01, 0x44, 0xd4, 0x35, 502 0x10, 0xea, 0x80, 0x00, 503 + 0x01, 0xe2, 0x6e, 0x36, 504 + 0x04, 0xa6, 0x0e, 0x7c, 505 0xff, 0xea, 0x5a, 0x09, 506 0xff, 0xea, 0x4c, 0x0d, 507 + 0x01, 0xa6, 0x3a, 0x6c, 508 + 0x10, 0xad, 0x84, 0x78, 509 + 0x80, 0xad, 0x32, 0x6c, 510 + 0x08, 0xad, 0x84, 0x68, 511 + 0x20, 0x19, 0x26, 0x7c, 512 + 0x80, 0xea, 0xb2, 0x01, 513 + 0x11, 0x00, 0x00, 0x10, 514 + 0x02, 0xa6, 0x22, 0x7c, 515 + 0xff, 0xea, 0xb2, 0x0d, 516 + 0x11, 0x00, 0x00, 0x10, 517 + 0xff, 0xea, 0xb2, 0x09, 518 0x04, 0x84, 0xf9, 0x30, 519 0x00, 0xea, 0x08, 0x81, 520 0xff, 0xea, 0xd4, 0x09, 521 0x02, 0x84, 0xf9, 0x88, 522 0x0d, 0xea, 0x5a, 0x01, 523 0x04, 0xa6, 0x4c, 0x05, 524 + 0x04, 0xa6, 0x84, 0x78, 525 0xff, 0xea, 0x5a, 0x09, 526 0x03, 0x84, 0x59, 0x89, 527 0x03, 0xea, 0x4c, 0x01, 528 + 0x80, 0x1a, 0x84, 0x78, 529 + 0x08, 0x19, 0x84, 0x78, 530 0x08, 0xb0, 0xe0, 0x30, 531 0x04, 0xb0, 0xe0, 0x30, 532 0x03, 0xb0, 0xf0, 0x30, ··· 533 0x00, 0x86, 0x0d, 0x23, 534 0x00, 0x87, 0x0f, 0x23, 535 0x01, 0x84, 0xc5, 0x31, 536 + 0x80, 0x83, 0x5d, 0x7c, 537 0x02, 0xe2, 0xc4, 0x01, 538 0xff, 0xea, 0x4c, 0x09, 539 0x01, 0xe2, 0x36, 0x30, 540 0xc8, 0x19, 0x32, 0x00, 541 0x88, 0x19, 0x32, 0x00, 542 0x01, 0xac, 0xd4, 0x99, 543 + 0x00, 0xe2, 0x84, 0x50, 544 0xfe, 0xa6, 0x4c, 0x0d, 545 0x0b, 0x98, 0xe1, 0x30, 546 0xfd, 0xa4, 0x49, 0x09, 547 + 0x80, 0xa3, 0x71, 0x7c, 548 0x02, 0xa4, 0x48, 0x01, 549 0x01, 0xa4, 0x36, 0x30, 550 0xa8, 0xea, 0x32, 0x00, 551 0xfd, 0xa4, 0x49, 0x0b, 552 0x05, 0xa3, 0x07, 0x33, 553 + 0x80, 0x83, 0x7d, 0x6c, 554 0x02, 0xea, 0x4c, 0x05, 555 0xff, 0xea, 0x4c, 0x0d, 556 + 0x00, 0xe2, 0x56, 0x59, 557 + 0x02, 0xa6, 0x10, 0x6c, 558 0x80, 0xf9, 0xf2, 0x05, 559 + 0xc0, 0x39, 0x8b, 0x7c, 560 + 0x03, 0xea, 0x64, 0x59, 561 0x03, 0xea, 0x04, 0x00, 562 + 0x20, 0x39, 0xaf, 0x7c, 563 + 0x01, 0x84, 0x95, 0x6c, 564 + 0x06, 0xea, 0x64, 0x59, 565 0x06, 0xea, 0x04, 0x00, 566 + 0x00, 0xe2, 0xb2, 0x44, 567 + 0x01, 0x00, 0x6c, 0x32, 568 + 0xee, 0x00, 0x9e, 0x6c, 569 0x05, 0xea, 0xb4, 0x00, 570 + 0x33, 0xea, 0x5e, 0x59, 571 0x33, 0xea, 0x00, 0x00, 572 0x80, 0x3d, 0x7a, 0x00, 573 + 0xfc, 0x42, 0xa0, 0x7c, 574 0x7f, 0x3d, 0x7a, 0x08, 575 + 0x00, 0x36, 0x5f, 0x59, 576 + 0x01, 0x36, 0x01, 0x30, 577 + 0x09, 0xea, 0x64, 0x59, 578 0x09, 0xea, 0x04, 0x00, 579 + 0x00, 0xe2, 0x14, 0x42, 580 + 0x01, 0xa4, 0x95, 0x6c, 581 + 0x00, 0xe2, 0x68, 0x5c, 582 + 0x20, 0x39, 0x73, 0x02, 583 + 0x01, 0x00, 0x6c, 0x32, 584 + 0x02, 0xa6, 0xba, 0x7c, 585 + 0x00, 0xe2, 0x7e, 0x5c, 586 + 0x00, 0xe2, 0x76, 0x58, 587 + 0x00, 0xe2, 0x86, 0x58, 588 + 0x00, 0xe2, 0x5a, 0x58, 589 + 0x00, 0x36, 0x5f, 0x59, 590 + 0x01, 0x36, 0x01, 0x30, 591 + 0x20, 0x19, 0xba, 0x6c, 592 + 0x00, 0xe2, 0xea, 0x5c, 593 + 0x04, 0x19, 0xd4, 0x6c, 594 0x02, 0x19, 0x32, 0x00, 595 + 0x01, 0x84, 0xd5, 0x7c, 596 + 0x01, 0x1b, 0xce, 0x7c, 597 + 0x01, 0x1a, 0xd4, 0x6c, 598 + 0x00, 0xe2, 0x84, 0x44, 599 + 0x80, 0x4b, 0xda, 0x6c, 600 + 0x01, 0x4c, 0xd6, 0x7c, 601 + 0x03, 0x42, 0x84, 0x6c, 602 + 0x00, 0xe2, 0x0a, 0x5c, 603 0x80, 0xf9, 0xf2, 0x01, 604 + 0x04, 0x39, 0x15, 0x7a, 605 + 0x00, 0xe2, 0x14, 0x42, 606 + 0x08, 0x5d, 0xf2, 0x6c, 607 + 0x00, 0xe2, 0x76, 0x58, 608 + 0x00, 0x36, 0x5f, 0x59, 609 + 0x01, 0x36, 0x01, 0x30, 610 + 0x02, 0x1b, 0xe2, 0x7c, 611 + 0x08, 0x5d, 0xf0, 0x7c, 612 0x03, 0x68, 0x00, 0x37, 613 0x01, 0x84, 0x09, 0x07, 614 + 0x80, 0x1b, 0xfc, 0x7c, 615 + 0x80, 0x84, 0xfd, 0x6c, 616 0xff, 0x85, 0x0b, 0x1b, 617 0xff, 0x86, 0x0d, 0x23, 618 0xff, 0x87, 0x0f, 0x23, 619 0xf8, 0x1b, 0x08, 0x0b, 620 0xff, 0xea, 0x06, 0x0b, 621 0x03, 0x68, 0x00, 0x37, 622 + 0x00, 0xe2, 0xd6, 0x58, 623 0x10, 0xea, 0x18, 0x00, 624 0xf9, 0xd9, 0xb2, 0x0d, 625 0x01, 0xd9, 0xb2, 0x05, 626 0x01, 0x52, 0x48, 0x31, 627 + 0x20, 0xa4, 0x26, 0x7d, 628 + 0x20, 0x5b, 0x26, 0x7d, 629 + 0x80, 0xf9, 0x34, 0x7d, 630 0x02, 0xea, 0xb4, 0x00, 631 0x11, 0x00, 0x00, 0x10, 632 + 0x04, 0x19, 0x40, 0x7d, 633 0xdf, 0x19, 0x32, 0x08, 634 + 0x60, 0x5b, 0x40, 0x6d, 635 + 0x01, 0x4c, 0x1a, 0x7d, 636 0x20, 0x19, 0x32, 0x00, 637 0x01, 0xd9, 0xb2, 0x05, 638 0x02, 0xea, 0xb4, 0x00, 639 0x01, 0xd9, 0xb2, 0x05, 640 + 0x10, 0x5b, 0x38, 0x6d, 641 + 0x08, 0x5b, 0x42, 0x6d, 642 + 0x20, 0x5b, 0x32, 0x6d, 643 + 0x02, 0x5b, 0x62, 0x6d, 644 + 0x0e, 0xea, 0x64, 0x59, 645 0x0e, 0xea, 0x04, 0x00, 646 + 0x80, 0xf9, 0x22, 0x6d, 647 0xdf, 0x5c, 0xb8, 0x08, 648 0x01, 0xd9, 0xb2, 0x05, 649 + 0x01, 0xa4, 0x1d, 0x6e, 650 + 0x00, 0xe2, 0x68, 0x5c, 651 + 0x00, 0xe2, 0x6c, 0x5d, 652 0x01, 0x90, 0x21, 0x1b, 653 0x01, 0xd9, 0xb2, 0x05, 654 + 0x00, 0xe2, 0x52, 0x5b, 655 0xf3, 0x96, 0xd5, 0x19, 656 + 0x00, 0xe2, 0x50, 0x55, 657 + 0x80, 0x96, 0x51, 0x6d, 658 + 0x0f, 0xea, 0x64, 0x59, 659 0x0f, 0xea, 0x04, 0x00, 660 + 0x00, 0xe2, 0x58, 0x45, 661 0x04, 0x8c, 0xe1, 0x30, 662 0x01, 0xea, 0xf2, 0x00, 663 0x02, 0xea, 0x36, 0x00, 664 0xa8, 0xea, 0x32, 0x00, 665 + 0xff, 0x97, 0x5f, 0x7d, 666 + 0x14, 0xea, 0x64, 0x59, 667 0x14, 0xea, 0x04, 0x00, 668 + 0x00, 0xe2, 0xce, 0x5d, 669 0x01, 0xd9, 0xb2, 0x05, 670 0x09, 0x80, 0xe1, 0x30, 671 0x02, 0xea, 0x36, 0x00, 672 0xa8, 0xea, 0x32, 0x00, 673 + 0x00, 0xe2, 0xc6, 0x5d, 674 0x01, 0xd9, 0xb2, 0x05, 675 + 0x02, 0xa6, 0x7c, 0x7d, 676 + 0x00, 0xe2, 0x56, 0x59, 677 + 0x20, 0x5b, 0x8a, 0x6d, 678 + 0xfc, 0x42, 0x76, 0x7d, 679 + 0x10, 0x40, 0x78, 0x6d, 680 + 0x20, 0x4d, 0x7a, 0x7d, 681 + 0x08, 0x5d, 0x8a, 0x6d, 682 + 0x02, 0xa6, 0x10, 0x6c, 683 + 0x00, 0xe2, 0x56, 0x59, 684 + 0x20, 0x5b, 0x8a, 0x6d, 685 + 0x01, 0x1b, 0xaa, 0x6d, 686 + 0xfc, 0x42, 0x86, 0x7d, 687 + 0x10, 0x40, 0x88, 0x6d, 688 + 0x20, 0x4d, 0x84, 0x78, 689 + 0x08, 0x5d, 0x84, 0x78, 690 0x02, 0x19, 0x32, 0x00, 691 0x01, 0x5b, 0x40, 0x31, 692 + 0x00, 0xe2, 0xea, 0x5c, 693 + 0x00, 0xe2, 0xcc, 0x5b, 694 0x20, 0xea, 0xb6, 0x00, 695 + 0x00, 0xe2, 0x0a, 0x5c, 696 0x20, 0x5c, 0xb8, 0x00, 697 + 0x04, 0x19, 0xa0, 0x6d, 698 + 0x01, 0x1a, 0xa0, 0x6d, 699 + 0x00, 0xe2, 0x56, 0x59, 700 + 0x01, 0x1a, 0x84, 0x78, 701 0x80, 0xf9, 0xf2, 0x01, 702 + 0x20, 0xa0, 0x04, 0x7e, 703 0xff, 0x90, 0x21, 0x1b, 704 + 0x08, 0x92, 0x63, 0x6b, 705 0x02, 0xea, 0xb4, 0x04, 706 0x01, 0xa4, 0x49, 0x03, 707 + 0x40, 0x5b, 0xba, 0x6d, 708 + 0x00, 0xe2, 0x56, 0x59, 709 + 0x40, 0x5b, 0xba, 0x6d, 710 + 0x04, 0x5d, 0x1e, 0x7e, 711 + 0x01, 0x1a, 0x1e, 0x7e, 712 + 0x20, 0x4d, 0x84, 0x78, 713 + 0x40, 0x5b, 0x04, 0x7e, 714 + 0x04, 0x5d, 0x1e, 0x7e, 715 + 0x01, 0x1a, 0x1e, 0x7e, 716 0x80, 0xf9, 0xf2, 0x01, 717 0xff, 0x90, 0x21, 0x1b, 718 + 0x08, 0x92, 0x63, 0x6b, 719 0x02, 0xea, 0xb4, 0x04, 720 + 0x00, 0xe2, 0x56, 0x59, 721 + 0x01, 0x1b, 0x84, 0x78, 722 0x80, 0xf9, 0xf2, 0x01, 723 0x02, 0xea, 0xb4, 0x04, 724 + 0x00, 0xe2, 0x56, 0x59, 725 + 0x01, 0x1b, 0xe2, 0x6d, 726 + 0x40, 0x5b, 0xf0, 0x7d, 727 + 0x01, 0x1b, 0xe2, 0x6d, 728 0x02, 0x19, 0x32, 0x00, 729 + 0x01, 0x1a, 0x84, 0x78, 730 0x80, 0xf9, 0xf2, 0x01, 731 0xff, 0xea, 0x10, 0x03, 732 0x08, 0x92, 0x25, 0x03, 733 + 0x00, 0xe2, 0x62, 0x43, 734 + 0x01, 0x1a, 0xec, 0x7d, 735 + 0x40, 0x5b, 0xe8, 0x7d, 736 + 0x01, 0x1a, 0xd6, 0x6d, 737 + 0xfc, 0x42, 0x84, 0x78, 738 + 0x01, 0x1a, 0xf0, 0x6d, 739 + 0x10, 0xea, 0x64, 0x59, 740 0x10, 0xea, 0x04, 0x00, 741 + 0xfc, 0x42, 0x84, 0x78, 742 + 0x10, 0x40, 0xf6, 0x6d, 743 + 0x20, 0x4d, 0x84, 0x78, 744 + 0x40, 0x5b, 0xd6, 0x6d, 745 + 0x01, 0x1a, 0x84, 0x78, 746 0x01, 0x90, 0x21, 0x1b, 747 0x30, 0x3f, 0xc0, 0x09, 748 + 0x30, 0xe0, 0x84, 0x60, 749 + 0x40, 0x4b, 0x84, 0x68, 750 0xff, 0xea, 0x52, 0x01, 751 + 0xee, 0x00, 0x0c, 0x6e, 752 0x80, 0xf9, 0xf2, 0x01, 753 0xff, 0x90, 0x21, 0x1b, 754 0x02, 0xea, 0xb4, 0x00, 755 0x20, 0xea, 0x9a, 0x00, 756 + 0xf3, 0x42, 0x16, 0x6e, 757 + 0x12, 0xea, 0x64, 0x59, 758 0x12, 0xea, 0x04, 0x00, 759 + 0x00, 0xe2, 0x14, 0x42, 760 + 0x0d, 0xea, 0x64, 0x59, 761 0x0d, 0xea, 0x04, 0x00, 762 + 0x00, 0xe2, 0x14, 0x42, 763 0x01, 0x90, 0x21, 0x1b, 764 + 0x11, 0xea, 0x64, 0x59, 765 0x11, 0xea, 0x04, 0x00, 766 + 0x00, 0xe2, 0x52, 0x5b, 767 0x08, 0x5a, 0xb4, 0x00, 768 + 0x00, 0xe2, 0x44, 0x5e, 769 0xa8, 0xea, 0x32, 0x00, 770 + 0x00, 0xe2, 0x56, 0x59, 771 + 0x80, 0x1a, 0x32, 0x7e, 772 + 0x00, 0xe2, 0x44, 0x5e, 773 0x80, 0x19, 0x32, 0x00, 774 + 0x40, 0x5b, 0x38, 0x6e, 775 + 0x08, 0x5a, 0x38, 0x7e, 776 + 0x20, 0x4d, 0x84, 0x78, 777 0x02, 0x84, 0x09, 0x03, 778 + 0x40, 0x5b, 0x04, 0x7e, 779 0xff, 0x90, 0x21, 0x1b, 780 0x80, 0xf9, 0xf2, 0x01, 781 + 0x08, 0x92, 0x63, 0x6b, 782 0x02, 0xea, 0xb4, 0x04, 783 + 0x01, 0x40, 0xe1, 0x30, 784 + 0x05, 0x41, 0xe3, 0x98, 785 0x01, 0xe0, 0xf4, 0x31, 786 0xff, 0xea, 0xc0, 0x09, 787 + 0x00, 0x42, 0xe5, 0x20, 788 + 0x00, 0x43, 0xe7, 0x20, 789 0x01, 0xfa, 0xc0, 0x31, 790 0x04, 0xea, 0xe8, 0x30, 791 0xff, 0xea, 0xf0, 0x08, ··· 794 }; 795 796 typedef int ahd_patch_func_t (struct ahd_softc *ahd); 797 + static ahd_patch_func_t ahd_patch23_func; 798 + 799 + static int 800 + ahd_patch23_func(struct ahd_softc *ahd) 801 + { 802 + return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0); 803 + } 804 + 805 static ahd_patch_func_t ahd_patch22_func; 806 807 static int 808 ahd_patch22_func(struct ahd_softc *ahd) 809 { 810 + return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0); 811 } 812 813 static ahd_patch_func_t ahd_patch21_func; ··· 807 static int 808 ahd_patch21_func(struct ahd_softc *ahd) 809 { 810 + return ((ahd->flags & AHD_INITIATORROLE) != 0); 811 } 812 813 static ahd_patch_func_t ahd_patch20_func; ··· 815 static int 816 ahd_patch20_func(struct ahd_softc *ahd) 817 { 818 + return ((ahd->flags & AHD_TARGETROLE) != 0); 819 } 820 821 static ahd_patch_func_t ahd_patch19_func; ··· 823 static int 824 ahd_patch19_func(struct ahd_softc *ahd) 825 { 826 + return ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0); 827 } 828 829 static ahd_patch_func_t ahd_patch18_func; ··· 831 static int 832 ahd_patch18_func(struct ahd_softc *ahd) 833 { 834 + return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0); 835 } 836 837 static ahd_patch_func_t ahd_patch17_func; ··· 839 static int 840 ahd_patch17_func(struct ahd_softc *ahd) 841 { 842 + return ((ahd->flags & AHD_39BIT_ADDRESSING) != 0); 843 } 844 845 static ahd_patch_func_t ahd_patch16_func; ··· 847 static int 848 ahd_patch16_func(struct ahd_softc *ahd) 849 { 850 + return ((ahd->flags & AHD_64BIT_ADDRESSING) != 0); 851 } 852 853 static ahd_patch_func_t ahd_patch15_func; ··· 855 static int 856 ahd_patch15_func(struct ahd_softc *ahd) 857 { 858 + return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0); 859 } 860 861 static ahd_patch_func_t ahd_patch14_func; ··· 863 static int 864 ahd_patch14_func(struct ahd_softc *ahd) 865 { 866 + return ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0); 867 } 868 869 static ahd_patch_func_t ahd_patch13_func; ··· 871 static int 872 ahd_patch13_func(struct ahd_softc *ahd) 873 { 874 + return ((ahd->features & AHD_RTI) == 0); 875 } 876 877 static ahd_patch_func_t ahd_patch12_func; ··· 879 static int 880 ahd_patch12_func(struct ahd_softc *ahd) 881 { 882 + return ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0); 883 } 884 885 static ahd_patch_func_t ahd_patch11_func; ··· 887 static int 888 ahd_patch11_func(struct ahd_softc *ahd) 889 { 890 + return ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0); 891 } 892 893 static ahd_patch_func_t ahd_patch10_func; ··· 895 static int 896 ahd_patch10_func(struct ahd_softc *ahd) 897 { 898 + return ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0); 899 } 900 901 static ahd_patch_func_t ahd_patch9_func; ··· 903 static int 904 ahd_patch9_func(struct ahd_softc *ahd) 905 { 906 + return ((ahd->features & AHD_FAST_CDB_DELIVERY) != 0); 907 } 908 909 static ahd_patch_func_t ahd_patch8_func; ··· 992 { ahd_patch0_func, 5, 1, 1 }, 993 { ahd_patch2_func, 6, 1, 2 }, 994 { ahd_patch0_func, 7, 1, 1 }, 995 + { ahd_patch3_func, 36, 5, 1 }, 996 + { ahd_patch2_func, 45, 1, 2 }, 997 + { ahd_patch0_func, 46, 1, 1 }, 998 + { ahd_patch1_func, 53, 1, 2 }, 999 + { ahd_patch0_func, 54, 1, 1 }, 1000 + { ahd_patch2_func, 59, 1, 2 }, 1001 + { ahd_patch0_func, 60, 1, 1 }, 1002 + { ahd_patch2_func, 63, 1, 2 }, 1003 + { ahd_patch0_func, 64, 1, 1 }, 1004 + { ahd_patch2_func, 67, 1, 2 }, 1005 + { ahd_patch0_func, 68, 1, 1 }, 1006 + { ahd_patch4_func, 116, 1, 1 }, 1007 + { ahd_patch2_func, 175, 3, 1 }, 1008 + { ahd_patch1_func, 178, 2, 1 }, 1009 + { ahd_patch5_func, 180, 1, 1 }, 1010 + { ahd_patch2_func, 189, 1, 2 }, 1011 + { ahd_patch0_func, 190, 1, 1 }, 1012 + { ahd_patch6_func, 191, 2, 2 }, 1013 + { ahd_patch0_func, 193, 6, 3 }, 1014 + { ahd_patch2_func, 196, 1, 2 }, 1015 + { ahd_patch0_func, 197, 1, 1 }, 1016 + { ahd_patch2_func, 200, 1, 2 }, 1017 + { ahd_patch0_func, 201, 1, 1 }, 1018 + { ahd_patch3_func, 203, 1, 1 }, 1019 + { ahd_patch7_func, 204, 3, 1 }, 1020 + { ahd_patch3_func, 213, 1, 1 }, 1021 + { ahd_patch5_func, 214, 16, 2 }, 1022 + { ahd_patch0_func, 230, 1, 1 }, 1023 + { ahd_patch8_func, 250, 2, 1 }, 1024 + { ahd_patch1_func, 254, 1, 2 }, 1025 + { ahd_patch0_func, 255, 1, 1 }, 1026 + { ahd_patch7_func, 258, 3, 1 }, 1027 + { ahd_patch1_func, 273, 1, 2 }, 1028 + { ahd_patch0_func, 274, 1, 1 }, 1029 + { ahd_patch1_func, 277, 1, 2 }, 1030 + { ahd_patch0_func, 278, 1, 1 }, 1031 + { ahd_patch2_func, 281, 1, 2 }, 1032 + { ahd_patch0_func, 282, 1, 1 }, 1033 + { ahd_patch9_func, 295, 2, 2 }, 1034 + { ahd_patch0_func, 297, 1, 1 }, 1035 + { ahd_patch1_func, 339, 1, 2 }, 1036 + { ahd_patch0_func, 340, 1, 1 }, 1037 + { ahd_patch2_func, 348, 1, 2 }, 1038 + { ahd_patch0_func, 349, 1, 1 }, 1039 + { ahd_patch2_func, 352, 1, 2 }, 1040 + { ahd_patch0_func, 353, 1, 1 }, 1041 + { ahd_patch1_func, 359, 1, 2 }, 1042 + { ahd_patch0_func, 360, 1, 1 }, 1043 + { ahd_patch1_func, 362, 1, 2 }, 1044 + { ahd_patch0_func, 363, 1, 1 }, 1045 + { ahd_patch10_func, 382, 1, 1 }, 1046 + { ahd_patch10_func, 385, 1, 1 }, 1047 + { ahd_patch10_func, 387, 1, 1 }, 1048 + { ahd_patch10_func, 399, 1, 1 }, 1049 + { ahd_patch1_func, 409, 1, 2 }, 1050 + { ahd_patch0_func, 410, 1, 1 }, 1051 + { ahd_patch1_func, 412, 1, 2 }, 1052 + { ahd_patch0_func, 413, 1, 1 }, 1053 + { ahd_patch1_func, 421, 1, 2 }, 1054 + { ahd_patch0_func, 422, 1, 1 }, 1055 + { ahd_patch2_func, 435, 1, 2 }, 1056 + { ahd_patch0_func, 436, 1, 1 }, 1057 + { ahd_patch11_func, 472, 1, 1 }, 1058 + { ahd_patch1_func, 480, 1, 2 }, 1059 + { ahd_patch0_func, 481, 1, 1 }, 1060 + { ahd_patch2_func, 493, 1, 2 }, 1061 + { ahd_patch0_func, 494, 1, 1 }, 1062 + { ahd_patch12_func, 497, 6, 2 }, 1063 + { ahd_patch0_func, 503, 1, 1 }, 1064 + { ahd_patch13_func, 524, 7, 1 }, 1065 + { ahd_patch14_func, 533, 1, 1 }, 1066 + { ahd_patch15_func, 542, 1, 1 }, 1067 + { ahd_patch16_func, 543, 1, 2 }, 1068 + { ahd_patch0_func, 544, 1, 1 }, 1069 + { ahd_patch17_func, 547, 1, 1 }, 1070 + { ahd_patch16_func, 548, 1, 1 }, 1071 + { ahd_patch18_func, 559, 1, 2 }, 1072 + { ahd_patch0_func, 560, 1, 1 }, 1073 + { ahd_patch1_func, 579, 1, 2 }, 1074 + { ahd_patch0_func, 580, 1, 1 }, 1075 + { ahd_patch1_func, 583, 1, 2 }, 1076 + { ahd_patch0_func, 584, 1, 1 }, 1077 + { ahd_patch2_func, 589, 1, 2 }, 1078 + { ahd_patch0_func, 590, 1, 1 }, 1079 + { ahd_patch2_func, 594, 1, 2 }, 1080 + { ahd_patch0_func, 595, 1, 1 }, 1081 + { ahd_patch1_func, 596, 1, 2 }, 1082 + { ahd_patch0_func, 597, 1, 1 }, 1083 + { ahd_patch2_func, 608, 1, 2 }, 1084 + { ahd_patch0_func, 609, 1, 1 }, 1085 + { ahd_patch19_func, 613, 1, 1 }, 1086 + { ahd_patch20_func, 618, 1, 1 }, 1087 + { ahd_patch21_func, 619, 2, 1 }, 1088 + { ahd_patch20_func, 623, 1, 2 }, 1089 + { ahd_patch0_func, 624, 1, 1 }, 1090 + { ahd_patch2_func, 627, 1, 2 }, 1091 + { ahd_patch0_func, 628, 1, 1 }, 1092 + { ahd_patch2_func, 643, 1, 2 }, 1093 + { ahd_patch0_func, 644, 1, 1 }, 1094 + { ahd_patch13_func, 645, 14, 1 }, 1095 + { ahd_patch1_func, 663, 1, 2 }, 1096 + { ahd_patch0_func, 664, 1, 1 }, 1097 + { ahd_patch13_func, 665, 1, 1 }, 1098 + { ahd_patch1_func, 677, 1, 2 }, 1099 + { ahd_patch0_func, 678, 1, 1 }, 1100 + { ahd_patch1_func, 685, 1, 2 }, 1101 + { ahd_patch0_func, 686, 1, 1 }, 1102 + { ahd_patch19_func, 709, 1, 1 }, 1103 + { ahd_patch19_func, 747, 1, 1 }, 1104 + { ahd_patch1_func, 758, 1, 2 }, 1105 + { ahd_patch0_func, 759, 1, 1 }, 1106 + { ahd_patch1_func, 776, 1, 2 }, 1107 + { ahd_patch0_func, 777, 1, 1 }, 1108 + { ahd_patch1_func, 779, 1, 2 }, 1109 + { ahd_patch0_func, 780, 1, 1 }, 1110 + { ahd_patch1_func, 783, 1, 2 }, 1111 + { ahd_patch0_func, 784, 1, 1 }, 1112 + { ahd_patch22_func, 786, 1, 2 }, 1113 + { ahd_patch0_func, 787, 2, 1 }, 1114 + { ahd_patch23_func, 790, 4, 2 }, 1115 + { ahd_patch0_func, 794, 1, 1 }, 1116 + { ahd_patch23_func, 802, 11, 1 } 1117 }; 1118 1119 static struct cs { 1120 uint16_t begin; 1121 uint16_t end; 1122 } critical_sections[] = { 1123 + { 17, 28 }, 1124 + { 29, 30 }, 1125 + { 47, 58 }, 1126 + { 61, 63 }, 1127 + { 65, 66 }, 1128 + { 72, 92 }, 1129 + { 110, 137 }, 1130 + { 138, 175 }, 1131 + { 180, 188 }, 1132 + { 213, 264 }, 1133 + { 425, 433 }, 1134 + { 443, 445 }, 1135 + { 448, 457 }, 1136 + { 709, 739 }, 1137 + { 749, 753 } 1138 }; 1139 1140 static const int num_critical_sections = sizeof(critical_sections)
+14 -14
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 375 struct scsi_cmnd *cmd); 376 static void ahc_linux_sem_timeout(u_long arg); 377 static void ahc_linux_freeze_simq(struct ahc_softc *ahc); 378 - static void ahc_linux_release_simq(u_long arg); 379 static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag); 380 static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc); 381 static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc, ··· 1073 return (ENOMEM); 1074 1075 *((struct ahc_softc **)host->hostdata) = ahc; 1076 - ahc_lock(ahc, &s); 1077 ahc->platform_data->host = host; 1078 host->can_queue = AHC_MAX_QUEUE; 1079 host->cmd_per_lun = 2; ··· 1083 host->max_lun = AHC_NUM_LUNS; 1084 host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0; 1085 host->sg_tablesize = AHC_NSEG; 1086 ahc_set_unit(ahc, ahc_linux_unit++); 1087 sprintf(buf, "scsi%d", host->host_no); 1088 new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); 1089 if (new_name != NULL) { ··· 1095 host->unique_id = ahc->unit; 1096 ahc_linux_initialize_scsi_bus(ahc); 1097 ahc_intr_enable(ahc, TRUE); 1098 - ahc_unlock(ahc, &s); 1099 1100 host->transportt = ahc_linux_transport_template; 1101 ··· 1120 { 1121 int i; 1122 int numtarg; 1123 1124 i = 0; 1125 numtarg = 0; 1126 1127 if (aic7xxx_no_reset != 0) 1128 ahc->flags &= ~(AHC_RESET_BUS_A|AHC_RESET_BUS_B); ··· 1173 ahc_update_neg_request(ahc, &devinfo, tstate, 1174 tinfo, AHC_NEG_ALWAYS); 1175 } 1176 /* Give the bus some time to recover */ 1177 if ((ahc->flags & (AHC_RESET_BUS_A|AHC_RESET_BUS_B)) != 0) { 1178 ahc_linux_freeze_simq(ahc); 1179 - init_timer(&ahc->platform_data->reset_timer); 1180 - ahc->platform_data->reset_timer.data = (u_long)ahc; 1181 - ahc->platform_data->reset_timer.expires = 1182 - jiffies + (AIC7XXX_RESET_DELAY * HZ)/1000; 1183 - ahc->platform_data->reset_timer.function = 1184 - ahc_linux_release_simq; 1185 - add_timer(&ahc->platform_data->reset_timer); 1186 } 1187 } 1188 ··· 2058 static void 2059 ahc_linux_freeze_simq(struct ahc_softc *ahc) 2060 { 2061 ahc->platform_data->qfrozen++; 2062 if (ahc->platform_data->qfrozen == 1) { 2063 scsi_block_requests(ahc->platform_data->host); ··· 2070 CAM_LUN_WILDCARD, SCB_LIST_NULL, 2071 ROLE_INITIATOR, CAM_REQUEUE_REQ); 2072 } 2073 } 2074 2075 static void 2076 - ahc_linux_release_simq(u_long arg) 2077 { 2078 - struct ahc_softc *ahc; 2079 u_long s; 2080 int unblock_reqs; 2081 - 2082 - ahc = (struct ahc_softc *)arg; 2083 2084 unblock_reqs = 0; 2085 ahc_lock(ahc, &s);
··· 375 struct scsi_cmnd *cmd); 376 static void ahc_linux_sem_timeout(u_long arg); 377 static void ahc_linux_freeze_simq(struct ahc_softc *ahc); 378 + static void ahc_linux_release_simq(struct ahc_softc *ahc); 379 static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag); 380 static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc); 381 static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc, ··· 1073 return (ENOMEM); 1074 1075 *((struct ahc_softc **)host->hostdata) = ahc; 1076 ahc->platform_data->host = host; 1077 host->can_queue = AHC_MAX_QUEUE; 1078 host->cmd_per_lun = 2; ··· 1084 host->max_lun = AHC_NUM_LUNS; 1085 host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0; 1086 host->sg_tablesize = AHC_NSEG; 1087 + ahc_lock(ahc, &s); 1088 ahc_set_unit(ahc, ahc_linux_unit++); 1089 + ahc_unlock(ahc, &s); 1090 sprintf(buf, "scsi%d", host->host_no); 1091 new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); 1092 if (new_name != NULL) { ··· 1094 host->unique_id = ahc->unit; 1095 ahc_linux_initialize_scsi_bus(ahc); 1096 ahc_intr_enable(ahc, TRUE); 1097 1098 host->transportt = ahc_linux_transport_template; 1099 ··· 1120 { 1121 int i; 1122 int numtarg; 1123 + unsigned long s; 1124 1125 i = 0; 1126 numtarg = 0; 1127 + 1128 + ahc_lock(ahc, &s); 1129 1130 if (aic7xxx_no_reset != 0) 1131 ahc->flags &= ~(AHC_RESET_BUS_A|AHC_RESET_BUS_B); ··· 1170 ahc_update_neg_request(ahc, &devinfo, tstate, 1171 tinfo, AHC_NEG_ALWAYS); 1172 } 1173 + ahc_unlock(ahc, &s); 1174 /* Give the bus some time to recover */ 1175 if ((ahc->flags & (AHC_RESET_BUS_A|AHC_RESET_BUS_B)) != 0) { 1176 ahc_linux_freeze_simq(ahc); 1177 + msleep(AIC7XXX_RESET_DELAY); 1178 + ahc_linux_release_simq(ahc); 1179 } 1180 } 1181 ··· 2059 static void 2060 ahc_linux_freeze_simq(struct ahc_softc *ahc) 2061 { 2062 + unsigned long s; 2063 + 2064 + ahc_lock(ahc, &s); 2065 ahc->platform_data->qfrozen++; 2066 if (ahc->platform_data->qfrozen == 1) { 2067 scsi_block_requests(ahc->platform_data->host); ··· 2068 CAM_LUN_WILDCARD, SCB_LIST_NULL, 2069 ROLE_INITIATOR, CAM_REQUEUE_REQ); 2070 } 2071 + ahc_unlock(ahc, &s); 2072 } 2073 2074 static void 2075 + ahc_linux_release_simq(struct ahc_softc *ahc) 2076 { 2077 u_long s; 2078 int unblock_reqs; 2079 2080 unblock_reqs = 0; 2081 ahc_lock(ahc, &s);
-25
drivers/scsi/aic7xxx/aic7xxx_osm.h
··· 223 */ 224 #define ahc_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op) 225 226 - /************************** Timer DataStructures ******************************/ 227 - typedef struct timer_list ahc_timer_t; 228 - 229 /********************************** Includes **********************************/ 230 #ifdef CONFIG_AIC7XXX_REG_PRETTY_PRINT 231 #define AIC_DEBUG_REGISTERS 1 ··· 232 #include "aic7xxx.h" 233 234 /***************************** Timer Facilities *******************************/ 235 - #define ahc_timer_init init_timer 236 - #define ahc_timer_stop del_timer_sync 237 - typedef void ahc_linux_callback_t (u_long); 238 - static __inline void ahc_timer_reset(ahc_timer_t *timer, int usec, 239 - ahc_callback_t *func, void *arg); 240 - static __inline void ahc_scb_timer_reset(struct scb *scb, u_int usec); 241 - 242 - static __inline void 243 - ahc_timer_reset(ahc_timer_t *timer, int usec, ahc_callback_t *func, void *arg) 244 - { 245 - struct ahc_softc *ahc; 246 - 247 - ahc = (struct ahc_softc *)arg; 248 - del_timer(timer); 249 - timer->data = (u_long)arg; 250 - timer->expires = jiffies + (usec * HZ)/1000000; 251 - timer->function = (ahc_linux_callback_t*)func; 252 - add_timer(timer); 253 - } 254 - 255 static __inline void 256 ahc_scb_timer_reset(struct scb *scb, u_int usec) 257 { 258 - mod_timer(&scb->io_ctx->eh_timeout, jiffies + (usec * HZ)/1000000); 259 } 260 261 /***************************** SMP support ************************************/ ··· 369 370 spinlock_t spin_lock; 371 u_int qfrozen; 372 - struct timer_list reset_timer; 373 struct semaphore eh_sem; 374 struct Scsi_Host *host; /* pointer to scsi host */ 375 #define AHC_LINUX_NOIRQ ((uint32_t)~0)
··· 223 */ 224 #define ahc_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op) 225 226 /********************************** Includes **********************************/ 227 #ifdef CONFIG_AIC7XXX_REG_PRETTY_PRINT 228 #define AIC_DEBUG_REGISTERS 1 ··· 235 #include "aic7xxx.h" 236 237 /***************************** Timer Facilities *******************************/ 238 static __inline void 239 ahc_scb_timer_reset(struct scb *scb, u_int usec) 240 { 241 } 242 243 /***************************** SMP support ************************************/ ··· 393 394 spinlock_t spin_lock; 395 u_int qfrozen; 396 struct semaphore eh_sem; 397 struct Scsi_Host *host; /* pointer to scsi host */ 398 #define AHC_LINUX_NOIRQ ((uint32_t)~0)
+21 -3
drivers/scsi/aic7xxx/aic7xxx_pci.c
··· 39 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 * POSSIBILITY OF SUCH DAMAGES. 41 * 42 - * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#69 $ 43 - * 44 - * $FreeBSD$ 45 */ 46 47 #ifdef __linux__ ··· 389 ID_AIC7892_ARO, 390 ID_ALL_MASK, 391 "Adaptec aic7892 Ultra160 SCSI adapter (ARO)", 392 ahc_aic7892_setup 393 }, 394 /* aic7895 based controllers */ ··· 1197 * use for this test. 1198 */ 1199 hcntrl = ahc_inb(ahc, HCNTRL); 1200 if (hcntrl == 0xFF) 1201 goto fail; 1202 1203 /* 1204 * Next create a situation where write combining ··· 1321 sd.sd_chip = C56_66; 1322 } 1323 ahc_release_seeprom(&sd); 1324 } 1325 1326 if (!have_seeprom) {
··· 39 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 * POSSIBILITY OF SUCH DAMAGES. 41 * 42 + * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $ 43 */ 44 45 #ifdef __linux__ ··· 391 ID_AIC7892_ARO, 392 ID_ALL_MASK, 393 "Adaptec aic7892 Ultra160 SCSI adapter (ARO)", 394 + ahc_aic7892_setup 395 + }, 396 + { 397 + ID_AHA_2915_30LP, 398 + ID_ALL_MASK, 399 + "Adaptec 2915/30LP Ultra160 SCSI adapter", 400 ahc_aic7892_setup 401 }, 402 /* aic7895 based controllers */ ··· 1193 * use for this test. 1194 */ 1195 hcntrl = ahc_inb(ahc, HCNTRL); 1196 + 1197 if (hcntrl == 0xFF) 1198 goto fail; 1199 + 1200 + if ((hcntrl & CHIPRST) != 0) { 1201 + /* 1202 + * The chip has not been initialized since 1203 + * PCI/EISA/VLB bus reset. Don't trust 1204 + * "left over BIOS data". 1205 + */ 1206 + ahc->flags |= AHC_NO_BIOS_INIT; 1207 + } 1208 1209 /* 1210 * Next create a situation where write combining ··· 1307 sd.sd_chip = C56_66; 1308 } 1309 ahc_release_seeprom(&sd); 1310 + 1311 + /* Remember the SEEPROM type for later */ 1312 + if (sd.sd_chip == C56_66) 1313 + ahc->flags |= AHC_LARGE_SEEPROM; 1314 } 1315 1316 if (!have_seeprom) {
+1
drivers/scsi/aic7xxx/aic7xxx_pci.h
··· 105 #define ID_AHA_29160C 0x0080900562209005ull 106 #define ID_AHA_29160B 0x00809005E2209005ull 107 #define ID_AHA_19160B 0x0081900562A19005ull 108 109 #define ID_AIC7896 0x005F9005FFFF9005ull 110 #define ID_AIC7896_ARO 0x00539005FFFF9005ull
··· 105 #define ID_AHA_29160C 0x0080900562209005ull 106 #define ID_AHA_29160B 0x00809005E2209005ull 107 #define ID_AHA_19160B 0x0081900562A19005ull 108 + #define ID_AHA_2915_30LP 0x0082900502109005ull 109 110 #define ID_AIC7896 0x005F9005FFFF9005ull 111 #define ID_AIC7896_ARO 0x00539005FFFF9005ull
+17 -16
drivers/scsi/ch.c
··· 22 #include <linux/completion.h> 23 #include <linux/compat.h> 24 #include <linux/chio.h> /* here are all the ioctls */ 25 26 #include <scsi/scsi.h> 27 #include <scsi/scsi_cmnd.h> ··· 112 u_int counts[CH_TYPES]; 113 u_int unit_attention; 114 u_int voltags; 115 - struct semaphore lock; 116 } scsi_changer; 117 118 static LIST_HEAD(ch_devlist); ··· 566 u_char data[16]; 567 unsigned int i; 568 569 - down(&ch->lock); 570 for (i = 0; i < ch->counts[type]; i++) { 571 if (0 != ch_read_element_status 572 (ch, ch->firsts[type]+i,data)) { ··· 583 if (0 != retval) 584 break; 585 } 586 - up(&ch->lock); 587 return retval; 588 } 589 ··· 688 dprintk("CHIOPOSITION: invalid parameter\n"); 689 return -EBADSLT; 690 } 691 - down(&ch->lock); 692 retval = ch_position(ch,0, 693 ch->firsts[pos.cp_type] + pos.cp_unit, 694 pos.cp_flags & CP_INVERT); 695 - up(&ch->lock); 696 return retval; 697 } 698 ··· 709 return -EBADSLT; 710 } 711 712 - down(&ch->lock); 713 retval = ch_move(ch,0, 714 ch->firsts[mv.cm_fromtype] + mv.cm_fromunit, 715 ch->firsts[mv.cm_totype] + mv.cm_tounit, 716 mv.cm_flags & CM_INVERT); 717 - up(&ch->lock); 718 return retval; 719 } 720 ··· 732 return -EBADSLT; 733 } 734 735 - down(&ch->lock); 736 retval = ch_exchange 737 (ch,0, 738 ch->firsts[mv.ce_srctype] + mv.ce_srcunit, 739 ch->firsts[mv.ce_fdsttype] + mv.ce_fdstunit, 740 ch->firsts[mv.ce_sdsttype] + mv.ce_sdstunit, 741 mv.ce_flags & CE_INVERT1, mv.ce_flags & CE_INVERT2); 742 - up(&ch->lock); 743 return retval; 744 } 745 ··· 773 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); 774 if (!buffer) 775 return -ENOMEM; 776 - down(&ch->lock); 777 778 voltag_retry: 779 memset(cmd,0,sizeof(cmd)); ··· 824 goto voltag_retry; 825 } 826 kfree(buffer); 827 - up(&ch->lock); 828 829 if (copy_to_user(argp, &cge, sizeof (cge))) 830 return -EFAULT; ··· 833 834 case CHIOINITELEM: 835 { 836 - down(&ch->lock); 837 retval = ch_init_elem(ch); 838 - up(&ch->lock); 839 return retval; 840 } 841 ··· 852 return -EBADSLT; 853 } 854 elem = ch->firsts[csv.csv_type] + csv.csv_unit; 855 - down(&ch->lock); 856 retval = ch_set_voltag(ch, elem, 857 csv.csv_flags & CSV_AVOLTAG, 858 csv.csv_flags & CSV_CLEARTAG, 859 csv.csv_voltag); 860 - up(&ch->lock); 861 return retval; 862 } 863 ··· 930 memset(ch,0,sizeof(*ch)); 931 ch->minor = ch_devcount; 932 sprintf(ch->name,"ch%d",ch->minor); 933 - init_MUTEX(&ch->lock); 934 ch->device = sd; 935 ch_readconfig(ch); 936 if (init)
··· 22 #include <linux/completion.h> 23 #include <linux/compat.h> 24 #include <linux/chio.h> /* here are all the ioctls */ 25 + #include <linux/mutex.h> 26 27 #include <scsi/scsi.h> 28 #include <scsi/scsi_cmnd.h> ··· 111 u_int counts[CH_TYPES]; 112 u_int unit_attention; 113 u_int voltags; 114 + struct mutex lock; 115 } scsi_changer; 116 117 static LIST_HEAD(ch_devlist); ··· 565 u_char data[16]; 566 unsigned int i; 567 568 + mutex_lock(&ch->lock); 569 for (i = 0; i < ch->counts[type]; i++) { 570 if (0 != ch_read_element_status 571 (ch, ch->firsts[type]+i,data)) { ··· 582 if (0 != retval) 583 break; 584 } 585 + mutex_unlock(&ch->lock); 586 return retval; 587 } 588 ··· 687 dprintk("CHIOPOSITION: invalid parameter\n"); 688 return -EBADSLT; 689 } 690 + mutex_lock(&ch->lock); 691 retval = ch_position(ch,0, 692 ch->firsts[pos.cp_type] + pos.cp_unit, 693 pos.cp_flags & CP_INVERT); 694 + mutex_unlock(&ch->lock); 695 return retval; 696 } 697 ··· 708 return -EBADSLT; 709 } 710 711 + mutex_lock(&ch->lock); 712 retval = ch_move(ch,0, 713 ch->firsts[mv.cm_fromtype] + mv.cm_fromunit, 714 ch->firsts[mv.cm_totype] + mv.cm_tounit, 715 mv.cm_flags & CM_INVERT); 716 + mutex_unlock(&ch->lock); 717 return retval; 718 } 719 ··· 731 return -EBADSLT; 732 } 733 734 + mutex_lock(&ch->lock); 735 retval = ch_exchange 736 (ch,0, 737 ch->firsts[mv.ce_srctype] + mv.ce_srcunit, 738 ch->firsts[mv.ce_fdsttype] + mv.ce_fdstunit, 739 ch->firsts[mv.ce_sdsttype] + mv.ce_sdstunit, 740 mv.ce_flags & CE_INVERT1, mv.ce_flags & CE_INVERT2); 741 + mutex_unlock(&ch->lock); 742 return retval; 743 } 744 ··· 772 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); 773 if (!buffer) 774 return -ENOMEM; 775 + mutex_lock(&ch->lock); 776 777 voltag_retry: 778 memset(cmd,0,sizeof(cmd)); ··· 823 goto voltag_retry; 824 } 825 kfree(buffer); 826 + mutex_unlock(&ch->lock); 827 828 if (copy_to_user(argp, &cge, sizeof (cge))) 829 return -EFAULT; ··· 832 833 case CHIOINITELEM: 834 { 835 + mutex_lock(&ch->lock); 836 retval = ch_init_elem(ch); 837 + mutex_unlock(&ch->lock); 838 return retval; 839 } 840 ··· 851 return -EBADSLT; 852 } 853 elem = ch->firsts[csv.csv_type] + csv.csv_unit; 854 + mutex_lock(&ch->lock); 855 retval = ch_set_voltag(ch, elem, 856 csv.csv_flags & CSV_AVOLTAG, 857 csv.csv_flags & CSV_CLEARTAG, 858 csv.csv_voltag); 859 + mutex_unlock(&ch->lock); 860 return retval; 861 } 862 ··· 929 memset(ch,0,sizeof(*ch)); 930 ch->minor = ch_devcount; 931 sprintf(ch->name,"ch%d",ch->minor); 932 + mutex_init(&ch->lock); 933 ch->device = sd; 934 ch_readconfig(ch); 935 if (init)
+24 -21
drivers/scsi/dpt_i2o.c
··· 61 #include <linux/timer.h> 62 #include <linux/string.h> 63 #include <linux/ioport.h> 64 65 #include <asm/processor.h> /* for boot_cpu_data */ 66 #include <asm/pgtable.h> ··· 107 *============================================================================ 108 */ 109 110 - static DECLARE_MUTEX(adpt_configuration_lock); 111 112 static struct i2o_sys_tbl *sys_tbl = NULL; 113 static int sys_tbl_ind = 0; ··· 538 */ 539 540 // Find HBA (host bus adapter) we are looking for 541 - down(&adpt_configuration_lock); 542 for (pHba = hba_chain; pHba; pHba = pHba->next) { 543 if (pHba->host == host) { 544 break; /* found adapter */ 545 } 546 } 547 - up(&adpt_configuration_lock); 548 if (pHba == NULL) { 549 return 0; 550 } ··· 899 if(pci_enable_device(pDev)) { 900 return -EINVAL; 901 } 902 pci_set_master(pDev); 903 if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && 904 pci_set_dma_mask(pDev, 0xffffffffULL)) ··· 930 raptorFlag = TRUE; 931 } 932 933 - if (pci_request_regions(pDev, "dpt_i2o")) { 934 - PERROR("dpti: adpt_config_hba: pci request region failed\n"); 935 - return -EINVAL; 936 - } 937 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); 938 if (!base_addr_virt) { 939 pci_release_regions(pDev); ··· 961 } 962 memset(pHba, 0, sizeof(adpt_hba)); 963 964 - down(&adpt_configuration_lock); 965 966 if(hba_chain != NULL){ 967 for(p = hba_chain; p->next; p = p->next); ··· 974 sprintf(pHba->name, "dpti%d", hba_count); 975 hba_count++; 976 977 - up(&adpt_configuration_lock); 978 979 pHba->pDev = pDev; 980 pHba->base_addr_phys = base_addr0_phys; ··· 1030 struct adpt_device* pNext; 1031 1032 1033 - down(&adpt_configuration_lock); 1034 // scsi_unregister calls our adpt_release which 1035 // does a quiese 1036 if(pHba->host){ ··· 1049 } 1050 1051 hba_count--; 1052 - up(&adpt_configuration_lock); 1053 1054 iounmap(pHba->base_addr_virt); 1055 pci_release_regions(pHba->pDev); ··· 1552 1553 static int adpt_i2o_install_device(adpt_hba* pHba, struct i2o_device *d) 1554 { 1555 - down(&adpt_configuration_lock); 1556 d->controller=pHba; 1557 d->owner=NULL; 1558 d->next=pHba->devices; ··· 1563 pHba->devices=d; 1564 *d->dev_name = 0; 1565 1566 - up(&adpt_configuration_lock); 1567 return 0; 1568 } 1569 ··· 1578 if (minor >= hba_count) { 1579 return -ENXIO; 1580 } 1581 - down(&adpt_configuration_lock); 1582 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1583 if (pHba->unit == minor) { 1584 break; /* found adapter */ 1585 } 1586 } 1587 if (pHba == NULL) { 1588 - up(&adpt_configuration_lock); 1589 return -ENXIO; 1590 } 1591 1592 // if(pHba->in_use){ 1593 - // up(&adpt_configuration_lock); 1594 // return -EBUSY; 1595 // } 1596 1597 pHba->in_use = 1; 1598 - up(&adpt_configuration_lock); 1599 1600 return 0; 1601 } ··· 1609 if (minor >= hba_count) { 1610 return -ENXIO; 1611 } 1612 - down(&adpt_configuration_lock); 1613 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1614 if (pHba->unit == minor) { 1615 break; /* found adapter */ 1616 } 1617 } 1618 - up(&adpt_configuration_lock); 1619 if (pHba == NULL) { 1620 return -ENXIO; 1621 } ··· 1913 if (minor >= DPTI_MAX_HBA){ 1914 return -ENXIO; 1915 } 1916 - down(&adpt_configuration_lock); 1917 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1918 if (pHba->unit == minor) { 1919 break; /* found adapter */ 1920 } 1921 } 1922 - up(&adpt_configuration_lock); 1923 if(pHba == NULL){ 1924 return -ENXIO; 1925 }
··· 61 #include <linux/timer.h> 62 #include <linux/string.h> 63 #include <linux/ioport.h> 64 + #include <linux/mutex.h> 65 66 #include <asm/processor.h> /* for boot_cpu_data */ 67 #include <asm/pgtable.h> ··· 106 *============================================================================ 107 */ 108 109 + static DEFINE_MUTEX(adpt_configuration_lock); 110 111 static struct i2o_sys_tbl *sys_tbl = NULL; 112 static int sys_tbl_ind = 0; ··· 537 */ 538 539 // Find HBA (host bus adapter) we are looking for 540 + mutex_lock(&adpt_configuration_lock); 541 for (pHba = hba_chain; pHba; pHba = pHba->next) { 542 if (pHba->host == host) { 543 break; /* found adapter */ 544 } 545 } 546 + mutex_unlock(&adpt_configuration_lock); 547 if (pHba == NULL) { 548 return 0; 549 } ··· 898 if(pci_enable_device(pDev)) { 899 return -EINVAL; 900 } 901 + 902 + if (pci_request_regions(pDev, "dpt_i2o")) { 903 + PERROR("dpti: adpt_config_hba: pci request region failed\n"); 904 + return -EINVAL; 905 + } 906 + 907 pci_set_master(pDev); 908 if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && 909 pci_set_dma_mask(pDev, 0xffffffffULL)) ··· 923 raptorFlag = TRUE; 924 } 925 926 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); 927 if (!base_addr_virt) { 928 pci_release_regions(pDev); ··· 958 } 959 memset(pHba, 0, sizeof(adpt_hba)); 960 961 + mutex_lock(&adpt_configuration_lock); 962 963 if(hba_chain != NULL){ 964 for(p = hba_chain; p->next; p = p->next); ··· 971 sprintf(pHba->name, "dpti%d", hba_count); 972 hba_count++; 973 974 + mutex_unlock(&adpt_configuration_lock); 975 976 pHba->pDev = pDev; 977 pHba->base_addr_phys = base_addr0_phys; ··· 1027 struct adpt_device* pNext; 1028 1029 1030 + mutex_lock(&adpt_configuration_lock); 1031 // scsi_unregister calls our adpt_release which 1032 // does a quiese 1033 if(pHba->host){ ··· 1046 } 1047 1048 hba_count--; 1049 + mutex_unlock(&adpt_configuration_lock); 1050 1051 iounmap(pHba->base_addr_virt); 1052 pci_release_regions(pHba->pDev); ··· 1549 1550 static int adpt_i2o_install_device(adpt_hba* pHba, struct i2o_device *d) 1551 { 1552 + mutex_lock(&adpt_configuration_lock); 1553 d->controller=pHba; 1554 d->owner=NULL; 1555 d->next=pHba->devices; ··· 1560 pHba->devices=d; 1561 *d->dev_name = 0; 1562 1563 + mutex_unlock(&adpt_configuration_lock); 1564 return 0; 1565 } 1566 ··· 1575 if (minor >= hba_count) { 1576 return -ENXIO; 1577 } 1578 + mutex_lock(&adpt_configuration_lock); 1579 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1580 if (pHba->unit == minor) { 1581 break; /* found adapter */ 1582 } 1583 } 1584 if (pHba == NULL) { 1585 + mutex_unlock(&adpt_configuration_lock); 1586 return -ENXIO; 1587 } 1588 1589 // if(pHba->in_use){ 1590 + // mutex_unlock(&adpt_configuration_lock); 1591 // return -EBUSY; 1592 // } 1593 1594 pHba->in_use = 1; 1595 + mutex_unlock(&adpt_configuration_lock); 1596 1597 return 0; 1598 } ··· 1606 if (minor >= hba_count) { 1607 return -ENXIO; 1608 } 1609 + mutex_lock(&adpt_configuration_lock); 1610 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1611 if (pHba->unit == minor) { 1612 break; /* found adapter */ 1613 } 1614 } 1615 + mutex_unlock(&adpt_configuration_lock); 1616 if (pHba == NULL) { 1617 return -ENXIO; 1618 } ··· 1910 if (minor >= DPTI_MAX_HBA){ 1911 return -ENXIO; 1912 } 1913 + mutex_lock(&adpt_configuration_lock); 1914 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1915 if (pHba->unit == minor) { 1916 break; /* found adapter */ 1917 } 1918 } 1919 + mutex_unlock(&adpt_configuration_lock); 1920 if(pHba == NULL){ 1921 return -ENXIO; 1922 }
+4 -4
drivers/scsi/hosts.c
··· 156 void scsi_remove_host(struct Scsi_Host *shost) 157 { 158 unsigned long flags; 159 - down(&shost->scan_mutex); 160 spin_lock_irqsave(shost->host_lock, flags); 161 if (scsi_host_set_state(shost, SHOST_CANCEL)) 162 if (scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY)) { 163 spin_unlock_irqrestore(shost->host_lock, flags); 164 - up(&shost->scan_mutex); 165 return; 166 } 167 spin_unlock_irqrestore(shost->host_lock, flags); 168 - up(&shost->scan_mutex); 169 scsi_forget_host(shost); 170 scsi_proc_host_rm(shost); 171 ··· 320 INIT_LIST_HEAD(&shost->starved_list); 321 init_waitqueue_head(&shost->host_wait); 322 323 - init_MUTEX(&shost->scan_mutex); 324 325 shost->host_no = scsi_host_next_hn++; /* XXX(hch): still racy */ 326 shost->dma_channel = 0xff;
··· 156 void scsi_remove_host(struct Scsi_Host *shost) 157 { 158 unsigned long flags; 159 + mutex_lock(&shost->scan_mutex); 160 spin_lock_irqsave(shost->host_lock, flags); 161 if (scsi_host_set_state(shost, SHOST_CANCEL)) 162 if (scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY)) { 163 spin_unlock_irqrestore(shost->host_lock, flags); 164 + mutex_unlock(&shost->scan_mutex); 165 return; 166 } 167 spin_unlock_irqrestore(shost->host_lock, flags); 168 + mutex_unlock(&shost->scan_mutex); 169 scsi_forget_host(shost); 170 scsi_proc_host_rm(shost); 171 ··· 320 INIT_LIST_HEAD(&shost->starved_list); 321 init_waitqueue_head(&shost->host_wait); 322 323 + mutex_init(&shost->scan_mutex); 324 325 shost->host_no = scsi_host_next_hn++; /* XXX(hch): still racy */ 326 shost->dma_channel = 0xff;
+3
drivers/scsi/ips.c
··· 1319 min = ha->max_cmds - 1; 1320 scsi_adjust_queue_depth(SDptr, MSG_ORDERED_TAG, min); 1321 } 1322 return 0; 1323 } 1324 #endif
··· 1319 min = ha->max_cmds - 1; 1320 scsi_adjust_queue_depth(SDptr, MSG_ORDERED_TAG, min); 1321 } 1322 + 1323 + SDptr->skip_ms_page_8 = 1; 1324 + SDptr->skip_ms_page_3f = 1; 1325 return 0; 1326 } 1327 #endif
+147 -156
drivers/scsi/iscsi_tcp.c
··· 33 #include <linux/delay.h> 34 #include <linux/kfifo.h> 35 #include <linux/scatterlist.h> 36 #include <net/tcp.h> 37 #include <scsi/scsi_cmnd.h> 38 #include <scsi/scsi_device.h> ··· 87 { 88 sg_init_one(&ibuf->sg, (u8 *)vbuf, size); 89 ibuf->sent = 0; 90 } 91 92 static inline void 93 iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size) 94 { 95 - ibuf->sg.page = (void*)vbuf; 96 - ibuf->sg.offset = (unsigned int)-1; 97 ibuf->sg.length = size; 98 ibuf->sent = 0; 99 - } 100 - 101 - static inline void* 102 - iscsi_buf_iov_base(struct iscsi_buf *ibuf) 103 - { 104 - return (char*)ibuf->sg.page + ibuf->sent; 105 } 106 107 static inline void 108 iscsi_buf_init_sg(struct iscsi_buf *ibuf, struct scatterlist *sg) 109 { 110 /* 111 * Fastpath: sg element fits into single page 112 */ 113 - if (sg->length + sg->offset <= PAGE_SIZE && page_count(sg->page) >= 2) { 114 - ibuf->sg.page = sg->page; 115 - ibuf->sg.offset = sg->offset; 116 - ibuf->sg.length = sg->length; 117 - } else 118 - iscsi_buf_init_iov(ibuf, page_address(sg->page), sg->length); 119 ibuf->sent = 0; 120 } 121 ··· 354 struct scsi_cmnd *sc = ctask->sc; 355 356 conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1; 357 - if (rhdr->flags & ISCSI_FLAG_CMD_UNDERFLOW) { 358 int res_count = be32_to_cpu(rhdr->residual_count); 359 360 if (res_count > 0 && ··· 364 } else 365 sc->result = (DID_BAD_TARGET << 16) | 366 rhdr->cmd_status; 367 - } else if (rhdr->flags & ISCSI_FLAG_CMD_BIDI_UNDERFLOW) 368 - sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status; 369 - else if (rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW) { 370 sc->resid = be32_to_cpu(rhdr->residual_count); 371 sc->result = (DID_OK << 16) | rhdr->cmd_status; 372 } else ··· 525 __kfifo_put(ctask->r2tqueue, (void*)&r2t, sizeof(void*)); 526 __kfifo_put(conn->writequeue, (void*)&ctask, sizeof(void*)); 527 528 - schedule_work(&conn->xmitwork); 529 conn->r2t_pdus_cnt++; 530 spin_unlock(&session->lock); 531 ··· 682 switch(conn->in.opcode) { 683 case ISCSI_OP_LOGIN_RSP: 684 case ISCSI_OP_TEXT_RSP: 685 - case ISCSI_OP_LOGOUT_RSP: 686 rc = iscsi_check_assign_cmdsn(session, 687 (struct iscsi_nopin*)hdr); 688 if (rc) ··· 723 } 724 spin_unlock(&session->lock); 725 break; 726 - case ISCSI_OP_NOOP_IN: 727 if (hdr->ttt != ISCSI_RESERVED_TAG) { 728 rc = ISCSI_ERR_PROTO; 729 break; 730 } 731 - rc = iscsi_check_assign_cmdsn(session, 732 (struct iscsi_nopin*)hdr); 733 if (rc) 734 break; ··· 763 if (!rc && hdr->ttt != ISCSI_RESERVED_TAG) 764 rc = iscsi_recv_pdu(iscsi_handle(conn), 765 hdr, NULL, 0); 766 - } else 767 rc = ISCSI_ERR_PROTO; 768 break; 769 case ISCSI_OP_REJECT: ··· 925 sc->request_bufflen, ctask->data_offset); 926 if (rc == -EAGAIN) 927 return rc; 928 - if (conn->datadgst_en) 929 iscsi_recv_digest_update(conn, sc->request_buffer, i); 930 rc = 0; 931 goto done; ··· 1020 conn->in.hdr = &conn->hdr; 1021 conn->senselen = (conn->data[0] << 8) | conn->data[1]; 1022 rc = iscsi_cmd_rsp(conn, conn->in.ctask); 1023 - if (!rc && conn->datadgst_en) 1024 iscsi_recv_digest_update(conn, conn->data, 1025 conn->in.datalen); 1026 } ··· 1047 rc = iscsi_recv_pdu(iscsi_handle(conn), conn->in.hdr, 1048 conn->data, conn->in.datalen); 1049 1050 - if (!rc && conn->datadgst_en && 1051 conn->in.opcode != ISCSI_OP_LOGIN_RSP) 1052 iscsi_recv_digest_update(conn, conn->data, 1053 conn->in.datalen); ··· 1267 conn->old_write_space(sk); 1268 debug_tcp("iscsi_write_space: cid %d\n", conn->id); 1269 clear_bit(SUSPEND_BIT, &conn->suspend_tx); 1270 - schedule_work(&conn->xmitwork); 1271 } 1272 1273 static void ··· 1308 * @buf: buffer to write from 1309 * @size: actual size to write 1310 * @flags: socket's flags 1311 - * 1312 - * Notes: 1313 - * depending on buffer will use tcp_sendpage() or tcp_sendmsg(). 1314 - * buf->sg.offset == -1 tells us that buffer is non S/G and forces 1315 - * to use tcp_sendmsg(). 1316 */ 1317 static inline int 1318 - iscsi_send(struct socket *sk, struct iscsi_buf *buf, int size, int flags) 1319 { 1320 - int res; 1321 1322 - if ((int)buf->sg.offset >= 0) { 1323 - int offset = buf->sg.offset + buf->sent; 1324 - 1325 - /* tcp_sendpage */ 1326 - res = sk->ops->sendpage(sk, buf->sg.page, offset, size, flags); 1327 - } else { 1328 - struct msghdr msg; 1329 - 1330 - buf->iov.iov_base = iscsi_buf_iov_base(buf); 1331 - buf->iov.iov_len = size; 1332 - 1333 - memset(&msg, 0, sizeof(struct msghdr)); 1334 - 1335 - /* tcp_sendmsg */ 1336 - res = kernel_sendmsg(sk, &msg, &buf->iov, 1, size); 1337 - } 1338 - 1339 - return res; 1340 } 1341 1342 /** ··· 1341 static inline int 1342 iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf, int datalen) 1343 { 1344 - struct socket *sk = conn->sock; 1345 int flags = 0; /* MSG_DONTWAIT; */ 1346 int res, size; 1347 ··· 1349 if (buf->sent + size != buf->sg.length || datalen) 1350 flags |= MSG_MORE; 1351 1352 - res = iscsi_send(sk, buf, size, flags); 1353 debug_tcp("sendhdr %d bytes, sent %d res %d\n", size, buf->sent, res); 1354 if (res >= 0) { 1355 conn->txdata_octets += res; ··· 1380 iscsi_sendpage(struct iscsi_conn *conn, struct iscsi_buf *buf, 1381 int *count, int *sent) 1382 { 1383 - struct socket *sk = conn->sock; 1384 int flags = 0; /* MSG_DONTWAIT; */ 1385 int res, size; 1386 ··· 1390 if (buf->sent + size != buf->sg.length || *count != size) 1391 flags |= MSG_MORE; 1392 1393 - res = iscsi_send(sk, buf, size, flags); 1394 debug_tcp("sendpage: %d bytes, sent %d left %d sent %d res %d\n", 1395 size, buf->sent, *count, *sent, res); 1396 if (res >= 0) { ··· 1416 BUG_ON(!conn->data_tx_tfm); 1417 crypto_digest_init(conn->data_tx_tfm); 1418 ctask->digest_count = 4; 1419 - } 1420 - 1421 - static inline void 1422 - iscsi_buf_data_digest_update(struct iscsi_conn *conn, struct iscsi_buf *buf) 1423 - { 1424 - struct scatterlist sg; 1425 - 1426 - if (buf->sg.offset != -1) 1427 - crypto_digest_update(conn->data_tx_tfm, &buf->sg, 1); 1428 - else { 1429 - sg_init_one(&sg, (char *)buf->sg.page, buf->sg.length); 1430 - crypto_digest_update(conn->data_tx_tfm, &sg, 1); 1431 - } 1432 } 1433 1434 static inline int ··· 1651 zero_data(ctask->hdr.dlength); 1652 } 1653 1654 - iscsi_buf_init_virt(&ctask->headbuf, (char*)&ctask->hdr, 1655 sizeof(struct iscsi_hdr)); 1656 conn->scsicmd_pdus_cnt++; 1657 } ··· 1717 handle_xmstate_r_hdr(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) 1718 { 1719 ctask->xmstate &= ~XMSTATE_R_HDR; 1720 - if (conn->hdrdgst_en) 1721 iscsi_hdr_digest(conn, &ctask->headbuf, (u8*)ctask->hdrext); 1722 if (!iscsi_sendhdr(conn, &ctask->headbuf, 0)) { 1723 BUG_ON(ctask->xmstate != XMSTATE_IDLE); ··· 1731 handle_xmstate_w_hdr(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) 1732 { 1733 ctask->xmstate &= ~XMSTATE_W_HDR; 1734 - if (conn->hdrdgst_en) 1735 iscsi_hdr_digest(conn, &ctask->headbuf, (u8*)ctask->hdrext); 1736 if (iscsi_sendhdr(conn, &ctask->headbuf, ctask->imm_count)) { 1737 ctask->xmstate |= XMSTATE_W_HDR; ··· 1780 return -EAGAIN; 1781 } 1782 if (conn->datadgst_en) 1783 - iscsi_buf_data_digest_update(conn, &ctask->sendbuf); 1784 1785 if (!ctask->imm_count) 1786 break; ··· 1866 * so pass it 1867 */ 1868 if (conn->datadgst_en && ctask->sent - start > 0) 1869 - iscsi_buf_data_digest_update(conn, &ctask->sendbuf); 1870 1871 if (!ctask->data_count) 1872 break; ··· 1945 1946 BUG_ON(r2t->data_count < 0); 1947 if (conn->datadgst_en) 1948 - iscsi_buf_data_digest_update(conn, &r2t->sendbuf); 1949 1950 if (r2t->data_count) { 1951 BUG_ON(ctask->sc->use_sg == 0); ··· 2027 } 2028 2029 if (conn->datadgst_en) { 2030 - iscsi_buf_data_digest_update(conn, &ctask->sendbuf); 2031 /* imm data? */ 2032 if (!dtask) { 2033 if (iscsi_digest_final_send(conn, ctask, &ctask->immbuf, ··· 2121 solicit_head_again: 2122 r2t = ctask->r2t; 2123 if (conn->hdrdgst_en) 2124 - iscsi_hdr_digest(conn, &r2t->headbuf, 2125 (u8*)r2t->dtask->hdrext); 2126 if (iscsi_sendhdr(conn, &r2t->headbuf, r2t->data_count)) { 2127 ctask->xmstate &= ~XMSTATE_SOL_DATA; ··· 2273 /* 2274 * serialize Xmit worker on a per-connection basis. 2275 */ 2276 - down(&conn->xmitsema); 2277 if (iscsi_data_xmit(conn)) 2278 - schedule_work(&conn->xmitwork); 2279 - up(&conn->xmitsema); 2280 } 2281 2282 #define FAILURE_BAD_HOST 1 ··· 2340 session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1); 2341 spin_unlock(&session->lock); 2342 2343 - if (!in_interrupt() && !down_trylock(&conn->xmitsema)) { 2344 - spin_unlock_irq(host->host_lock); 2345 - if (iscsi_data_xmit(conn)) 2346 - schedule_work(&conn->xmitwork); 2347 - up(&conn->xmitsema); 2348 - spin_lock_irq(host->host_lock); 2349 - } else 2350 - schedule_work(&conn->xmitwork); 2351 - 2352 return 0; 2353 2354 reject: ··· 2427 kfree(items); 2428 } 2429 2430 - static iscsi_connh_t 2431 - iscsi_conn_create(iscsi_sessionh_t sessionh, uint32_t conn_idx) 2432 { 2433 - struct iscsi_session *session = iscsi_ptr(sessionh); 2434 - struct iscsi_conn *conn = NULL; 2435 2436 - conn = kmalloc(sizeof(struct iscsi_conn), GFP_KERNEL); 2437 - if (conn == NULL) 2438 - goto conn_alloc_fail; 2439 memset(conn, 0, sizeof(struct iscsi_conn)); 2440 - 2441 conn->c_stage = ISCSI_CONN_INITIAL_STAGE; 2442 conn->in_progress = IN_PROGRESS_WAIT_HEADER; 2443 conn->id = conn_idx; ··· 2499 goto max_recv_dlenght_alloc_fail; 2500 2501 init_timer(&conn->tmabort_timer); 2502 - init_MUTEX(&conn->xmitsema); 2503 init_waitqueue_head(&conn->ehwait); 2504 2505 - return iscsi_handle(conn); 2506 2507 max_recv_dlenght_alloc_fail: 2508 spin_lock_bh(&session->lock); ··· 2518 writequeue_alloc_fail: 2519 kfifo_free(conn->xmitqueue); 2520 xmitqueue_alloc_fail: 2521 - kfree(conn); 2522 - conn_alloc_fail: 2523 - return iscsi_handle(NULL); 2524 } 2525 2526 static void 2527 - iscsi_conn_destroy(iscsi_connh_t connh) 2528 { 2529 - struct iscsi_conn *conn = iscsi_ptr(connh); 2530 struct iscsi_session *session = conn->session; 2531 2532 - down(&conn->xmitsema); 2533 set_bit(SUSPEND_BIT, &conn->suspend_tx); 2534 if (conn->c_stage == ISCSI_CONN_INITIAL_STAGE && conn->sock) { 2535 struct sock *sk = conn->sock->sk; ··· 2560 } 2561 spin_unlock_bh(&session->lock); 2562 2563 - up(&conn->xmitsema); 2564 2565 /* 2566 * Block until all in-progress commands for this connection 2567 * time out or fail. 2568 */ 2569 for (;;) { 2570 - spin_lock_bh(&conn->lock); 2571 if (!session->host->host_busy) { /* OK for ERL == 0 */ 2572 - spin_unlock_bh(&conn->lock); 2573 break; 2574 } 2575 - spin_unlock_bh(&conn->lock); 2576 msleep_interruptible(500); 2577 printk("conn_destroy(): host_busy %d host_failed %d\n", 2578 session->host->host_busy, session->host->host_failed); ··· 2620 kfifo_free(conn->writequeue); 2621 kfifo_free(conn->immqueue); 2622 kfifo_free(conn->mgmtqueue); 2623 - kfree(conn); 2624 } 2625 2626 static int ··· 2681 * processing. 2682 */ 2683 iscsi_conn_set_callbacks(conn); 2684 2685 /* 2686 * set receive state machine into initial state ··· 2767 set_bit(SUSPEND_BIT, &conn->suspend_rx); 2768 write_unlock_bh(&sk->sk_callback_lock); 2769 2770 - down(&conn->xmitsema); 2771 2772 spin_lock_irqsave(session->host->host_lock, flags); 2773 spin_lock(&session->lock); ··· 2849 conn->datadgst_en = 0; 2850 } 2851 } 2852 - up(&conn->xmitsema); 2853 } 2854 2855 static int ··· 2934 else 2935 __kfifo_put(conn->mgmtqueue, (void*)&mtask, sizeof(void*)); 2936 2937 - schedule_work(&conn->xmitwork); 2938 - 2939 return 0; 2940 } 2941 ··· 2999 * 1) connection-level failure; 3000 * 2) recovery due protocol error; 3001 */ 3002 - down(&conn->xmitsema); 3003 spin_lock_bh(&session->lock); 3004 if (session->state != ISCSI_STATE_LOGGED_IN) { 3005 if (session->state == ISCSI_STATE_TERMINATE) { 3006 spin_unlock_bh(&session->lock); 3007 - up(&conn->xmitsema); 3008 goto failed; 3009 } 3010 spin_unlock_bh(&session->lock); ··· 3022 * 2) session was re-open during time out of ctask. 3023 */ 3024 spin_unlock_bh(&session->lock); 3025 - up(&conn->xmitsema); 3026 goto success; 3027 } 3028 conn->tmabort_state = TMABORT_INITIAL; ··· 3077 conn->tmabort_state == TMABORT_SUCCESS) { 3078 conn->tmabort_state = TMABORT_INITIAL; 3079 spin_unlock_bh(&session->lock); 3080 - up(&conn->xmitsema); 3081 goto success; 3082 } 3083 conn->tmabort_state = TMABORT_INITIAL; ··· 3086 spin_unlock_bh(&session->lock); 3087 } 3088 } 3089 - up(&conn->xmitsema); 3090 3091 3092 /* ··· 3152 exit: 3153 del_timer_sync(&conn->tmabort_timer); 3154 3155 - down(&conn->xmitsema); 3156 if (conn->sock) { 3157 struct sock *sk = conn->sock->sk; 3158 ··· 3160 iscsi_ctask_cleanup(conn, ctask); 3161 write_unlock_bh(&sk->sk_callback_lock); 3162 } 3163 - up(&conn->xmitsema); 3164 return rc; 3165 } 3166 ··· 3251 .this_id = -1, 3252 }; 3253 3254 - static iscsi_sessionh_t 3255 - iscsi_session_create(uint32_t initial_cmdsn, struct Scsi_Host *host) 3256 { 3257 - int cmd_i; 3258 struct iscsi_session *session; 3259 3260 - session = iscsi_hostdata(host->hostdata); 3261 memset(session, 0, sizeof(struct iscsi_session)); 3262 - 3263 - session->host = host; 3264 - session->id = host->host_no; 3265 session->state = ISCSI_STATE_LOGGED_IN; 3266 session->mgmtpool_max = ISCSI_MGMT_CMDS_MAX; 3267 session->cmds_max = ISCSI_XMIT_CMDS_MAX; ··· 3311 if (iscsi_r2tpool_alloc(session)) 3312 goto r2tpool_alloc_fail; 3313 3314 - return iscsi_handle(session); 3315 3316 r2tpool_alloc_fail: 3317 for (cmd_i = 0; cmd_i < session->mgmtpool_max; cmd_i++) ··· 3321 mgmtpool_alloc_fail: 3322 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 3323 cmdpool_alloc_fail: 3324 - return iscsi_handle(NULL); 3325 } 3326 3327 static void 3328 - iscsi_session_destroy(iscsi_sessionh_t sessionh) 3329 { 3330 int cmd_i; 3331 struct iscsi_data_task *dtask, *n; 3332 - struct iscsi_session *session = iscsi_ptr(sessionh); 3333 3334 for (cmd_i = 0; cmd_i < session->cmds_max; cmd_i++) { 3335 struct iscsi_cmd_task *ctask = session->cmds[cmd_i]; ··· 3345 iscsi_r2tpool_free(session); 3346 iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds); 3347 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 3348 } 3349 3350 static int ··· 3445 if (conn->data_rx_tfm) 3446 crypto_free_tfm(conn->data_rx_tfm); 3447 } 3448 break; 3449 case ISCSI_PARAM_INITIAL_R2T_EN: 3450 session->initial_r2t_en = value; ··· 3495 } 3496 3497 static int 3498 - iscsi_conn_get_param(iscsi_connh_t connh, enum iscsi_param param, 3499 - uint32_t *value) 3500 { 3501 - struct iscsi_conn *conn = iscsi_ptr(connh); 3502 - struct iscsi_session *session = conn->session; 3503 3504 switch(param) { 3505 - case ISCSI_PARAM_MAX_RECV_DLENGTH: 3506 - *value = conn->max_recv_dlength; 3507 - break; 3508 - case ISCSI_PARAM_MAX_XMIT_DLENGTH: 3509 - *value = conn->max_xmit_dlength; 3510 - break; 3511 - case ISCSI_PARAM_HDRDGST_EN: 3512 - *value = conn->hdrdgst_en; 3513 - break; 3514 - case ISCSI_PARAM_DATADGST_EN: 3515 - *value = conn->datadgst_en; 3516 - break; 3517 case ISCSI_PARAM_INITIAL_R2T_EN: 3518 *value = session->initial_r2t_en; 3519 break; ··· 3530 break; 3531 case ISCSI_PARAM_OFMARKER_EN: 3532 *value = session->ofmarker_en; 3533 break; 3534 default: 3535 return ISCSI_ERR_PARAM_NOT_FOUND; ··· 3593 struct iscsi_conn *conn = iscsi_ptr(connh); 3594 int rc; 3595 3596 - down(&conn->xmitsema); 3597 rc = iscsi_conn_send_generic(conn, hdr, data, data_size); 3598 - up(&conn->xmitsema); 3599 3600 return rc; 3601 } ··· 3607 | CAP_DATADGST, 3608 .host_template = &iscsi_sht, 3609 .hostdata_size = sizeof(struct iscsi_session), 3610 .max_conn = 1, 3611 .max_cmd_len = ISCSI_TCP_MAX_CMD_LEN, 3612 .create_session = iscsi_session_create, ··· 3616 .bind_conn = iscsi_conn_bind, 3617 .destroy_conn = iscsi_conn_destroy, 3618 .set_param = iscsi_conn_set_param, 3619 - .get_param = iscsi_conn_get_param, 3620 .start_conn = iscsi_conn_start, 3621 .stop_conn = iscsi_conn_stop, 3622 .send_pdu = iscsi_conn_send_pdu, ··· 3627 static int __init 3628 iscsi_tcp_init(void) 3629 { 3630 - int error; 3631 - 3632 if (iscsi_max_lun < 1) { 3633 printk(KERN_ERR "Invalid max_lun value of %u\n", iscsi_max_lun); 3634 return -EINVAL; ··· 3639 if (!taskcache) 3640 return -ENOMEM; 3641 3642 - error = iscsi_register_transport(&iscsi_tcp_transport); 3643 - if (error) 3644 kmem_cache_destroy(taskcache); 3645 3646 - return error; 3647 } 3648 3649 static void __exit
··· 33 #include <linux/delay.h> 34 #include <linux/kfifo.h> 35 #include <linux/scatterlist.h> 36 + #include <linux/mutex.h> 37 #include <net/tcp.h> 38 #include <scsi/scsi_cmnd.h> 39 #include <scsi/scsi_device.h> ··· 86 { 87 sg_init_one(&ibuf->sg, (u8 *)vbuf, size); 88 ibuf->sent = 0; 89 + ibuf->use_sendmsg = 0; 90 } 91 92 static inline void 93 iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size) 94 { 95 + ibuf->sg.page = virt_to_page(vbuf); 96 + ibuf->sg.offset = offset_in_page(vbuf); 97 ibuf->sg.length = size; 98 ibuf->sent = 0; 99 + ibuf->use_sendmsg = 1; 100 } 101 102 static inline void 103 iscsi_buf_init_sg(struct iscsi_buf *ibuf, struct scatterlist *sg) 104 { 105 + ibuf->sg.page = sg->page; 106 + ibuf->sg.offset = sg->offset; 107 + ibuf->sg.length = sg->length; 108 /* 109 * Fastpath: sg element fits into single page 110 */ 111 + if (sg->length + sg->offset <= PAGE_SIZE && !PageSlab(sg->page)) 112 + ibuf->use_sendmsg = 0; 113 + else 114 + ibuf->use_sendmsg = 1; 115 ibuf->sent = 0; 116 } 117 ··· 356 struct scsi_cmnd *sc = ctask->sc; 357 358 conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1; 359 + if (rhdr->flags & ISCSI_FLAG_DATA_UNDERFLOW) { 360 int res_count = be32_to_cpu(rhdr->residual_count); 361 362 if (res_count > 0 && ··· 366 } else 367 sc->result = (DID_BAD_TARGET << 16) | 368 rhdr->cmd_status; 369 + } else if (rhdr->flags & ISCSI_FLAG_DATA_OVERFLOW) { 370 sc->resid = be32_to_cpu(rhdr->residual_count); 371 sc->result = (DID_OK << 16) | rhdr->cmd_status; 372 } else ··· 529 __kfifo_put(ctask->r2tqueue, (void*)&r2t, sizeof(void*)); 530 __kfifo_put(conn->writequeue, (void*)&ctask, sizeof(void*)); 531 532 + scsi_queue_work(session->host, &conn->xmitwork); 533 conn->r2t_pdus_cnt++; 534 spin_unlock(&session->lock); 535 ··· 686 switch(conn->in.opcode) { 687 case ISCSI_OP_LOGIN_RSP: 688 case ISCSI_OP_TEXT_RSP: 689 + case ISCSI_OP_LOGOUT_RSP: 690 rc = iscsi_check_assign_cmdsn(session, 691 (struct iscsi_nopin*)hdr); 692 if (rc) ··· 727 } 728 spin_unlock(&session->lock); 729 break; 730 + case ISCSI_OP_NOOP_IN: 731 if (hdr->ttt != ISCSI_RESERVED_TAG) { 732 rc = ISCSI_ERR_PROTO; 733 break; 734 } 735 + rc = iscsi_check_assign_cmdsn(session, 736 (struct iscsi_nopin*)hdr); 737 if (rc) 738 break; ··· 767 if (!rc && hdr->ttt != ISCSI_RESERVED_TAG) 768 rc = iscsi_recv_pdu(iscsi_handle(conn), 769 hdr, NULL, 0); 770 + } else 771 rc = ISCSI_ERR_PROTO; 772 break; 773 case ISCSI_OP_REJECT: ··· 929 sc->request_bufflen, ctask->data_offset); 930 if (rc == -EAGAIN) 931 return rc; 932 + if (conn->datadgst_en) 933 iscsi_recv_digest_update(conn, sc->request_buffer, i); 934 rc = 0; 935 goto done; ··· 1024 conn->in.hdr = &conn->hdr; 1025 conn->senselen = (conn->data[0] << 8) | conn->data[1]; 1026 rc = iscsi_cmd_rsp(conn, conn->in.ctask); 1027 + if (!rc && conn->datadgst_en) 1028 iscsi_recv_digest_update(conn, conn->data, 1029 conn->in.datalen); 1030 } ··· 1051 rc = iscsi_recv_pdu(iscsi_handle(conn), conn->in.hdr, 1052 conn->data, conn->in.datalen); 1053 1054 + if (!rc && conn->datadgst_en && 1055 conn->in.opcode != ISCSI_OP_LOGIN_RSP) 1056 iscsi_recv_digest_update(conn, conn->data, 1057 conn->in.datalen); ··· 1271 conn->old_write_space(sk); 1272 debug_tcp("iscsi_write_space: cid %d\n", conn->id); 1273 clear_bit(SUSPEND_BIT, &conn->suspend_tx); 1274 + scsi_queue_work(conn->session->host, &conn->xmitwork); 1275 } 1276 1277 static void ··· 1312 * @buf: buffer to write from 1313 * @size: actual size to write 1314 * @flags: socket's flags 1315 */ 1316 static inline int 1317 + iscsi_send(struct iscsi_conn *conn, struct iscsi_buf *buf, int size, int flags) 1318 { 1319 + struct socket *sk = conn->sock; 1320 + int offset = buf->sg.offset + buf->sent; 1321 1322 + /* 1323 + * if we got use_sg=0 or are sending something we kmallocd 1324 + * then we did not have to do kmap (kmap returns page_address) 1325 + * 1326 + * if we got use_sg > 0, but had to drop down, we do not 1327 + * set clustering so this should only happen for that 1328 + * slab case. 1329 + */ 1330 + if (buf->use_sendmsg) 1331 + return sock_no_sendpage(sk, buf->sg.page, offset, size, flags); 1332 + else 1333 + return conn->sendpage(sk, buf->sg.page, offset, size, flags); 1334 } 1335 1336 /** ··· 1355 static inline int 1356 iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf, int datalen) 1357 { 1358 int flags = 0; /* MSG_DONTWAIT; */ 1359 int res, size; 1360 ··· 1364 if (buf->sent + size != buf->sg.length || datalen) 1365 flags |= MSG_MORE; 1366 1367 + res = iscsi_send(conn, buf, size, flags); 1368 debug_tcp("sendhdr %d bytes, sent %d res %d\n", size, buf->sent, res); 1369 if (res >= 0) { 1370 conn->txdata_octets += res; ··· 1395 iscsi_sendpage(struct iscsi_conn *conn, struct iscsi_buf *buf, 1396 int *count, int *sent) 1397 { 1398 int flags = 0; /* MSG_DONTWAIT; */ 1399 int res, size; 1400 ··· 1406 if (buf->sent + size != buf->sg.length || *count != size) 1407 flags |= MSG_MORE; 1408 1409 + res = iscsi_send(conn, buf, size, flags); 1410 debug_tcp("sendpage: %d bytes, sent %d left %d sent %d res %d\n", 1411 size, buf->sent, *count, *sent, res); 1412 if (res >= 0) { ··· 1432 BUG_ON(!conn->data_tx_tfm); 1433 crypto_digest_init(conn->data_tx_tfm); 1434 ctask->digest_count = 4; 1435 } 1436 1437 static inline int ··· 1680 zero_data(ctask->hdr.dlength); 1681 } 1682 1683 + iscsi_buf_init_virt(&ctask->headbuf, (char*)&ctask->hdr, 1684 sizeof(struct iscsi_hdr)); 1685 conn->scsicmd_pdus_cnt++; 1686 } ··· 1746 handle_xmstate_r_hdr(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) 1747 { 1748 ctask->xmstate &= ~XMSTATE_R_HDR; 1749 + if (conn->hdrdgst_en) 1750 iscsi_hdr_digest(conn, &ctask->headbuf, (u8*)ctask->hdrext); 1751 if (!iscsi_sendhdr(conn, &ctask->headbuf, 0)) { 1752 BUG_ON(ctask->xmstate != XMSTATE_IDLE); ··· 1760 handle_xmstate_w_hdr(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) 1761 { 1762 ctask->xmstate &= ~XMSTATE_W_HDR; 1763 + if (conn->hdrdgst_en) 1764 iscsi_hdr_digest(conn, &ctask->headbuf, (u8*)ctask->hdrext); 1765 if (iscsi_sendhdr(conn, &ctask->headbuf, ctask->imm_count)) { 1766 ctask->xmstate |= XMSTATE_W_HDR; ··· 1809 return -EAGAIN; 1810 } 1811 if (conn->datadgst_en) 1812 + crypto_digest_update(conn->data_tx_tfm, 1813 + &ctask->sendbuf.sg, 1); 1814 1815 if (!ctask->imm_count) 1816 break; ··· 1894 * so pass it 1895 */ 1896 if (conn->datadgst_en && ctask->sent - start > 0) 1897 + crypto_digest_update(conn->data_tx_tfm, 1898 + &ctask->sendbuf.sg, 1); 1899 1900 if (!ctask->data_count) 1901 break; ··· 1972 1973 BUG_ON(r2t->data_count < 0); 1974 if (conn->datadgst_en) 1975 + crypto_digest_update(conn->data_tx_tfm, &r2t->sendbuf.sg, 1); 1976 1977 if (r2t->data_count) { 1978 BUG_ON(ctask->sc->use_sg == 0); ··· 2054 } 2055 2056 if (conn->datadgst_en) { 2057 + crypto_digest_update(conn->data_tx_tfm, &ctask->sendbuf.sg, 1); 2058 /* imm data? */ 2059 if (!dtask) { 2060 if (iscsi_digest_final_send(conn, ctask, &ctask->immbuf, ··· 2148 solicit_head_again: 2149 r2t = ctask->r2t; 2150 if (conn->hdrdgst_en) 2151 + iscsi_hdr_digest(conn, &r2t->headbuf, 2152 (u8*)r2t->dtask->hdrext); 2153 if (iscsi_sendhdr(conn, &r2t->headbuf, r2t->data_count)) { 2154 ctask->xmstate &= ~XMSTATE_SOL_DATA; ··· 2300 /* 2301 * serialize Xmit worker on a per-connection basis. 2302 */ 2303 + mutex_lock(&conn->xmitmutex); 2304 if (iscsi_data_xmit(conn)) 2305 + scsi_queue_work(conn->session->host, &conn->xmitwork); 2306 + mutex_unlock(&conn->xmitmutex); 2307 } 2308 2309 #define FAILURE_BAD_HOST 1 ··· 2367 session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1); 2368 spin_unlock(&session->lock); 2369 2370 + scsi_queue_work(host, &conn->xmitwork); 2371 return 0; 2372 2373 reject: ··· 2462 kfree(items); 2463 } 2464 2465 + static struct iscsi_cls_conn * 2466 + iscsi_conn_create(struct Scsi_Host *shost, uint32_t conn_idx) 2467 { 2468 + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 2469 + struct iscsi_conn *conn; 2470 + struct iscsi_cls_conn *cls_conn; 2471 2472 + cls_conn = iscsi_create_conn(hostdata_session(shost->hostdata), 2473 + conn_idx); 2474 + if (!cls_conn) 2475 + return NULL; 2476 + conn = cls_conn->dd_data; 2477 + 2478 memset(conn, 0, sizeof(struct iscsi_conn)); 2479 conn->c_stage = ISCSI_CONN_INITIAL_STAGE; 2480 conn->in_progress = IN_PROGRESS_WAIT_HEADER; 2481 conn->id = conn_idx; ··· 2531 goto max_recv_dlenght_alloc_fail; 2532 2533 init_timer(&conn->tmabort_timer); 2534 + mutex_init(&conn->xmitmutex); 2535 init_waitqueue_head(&conn->ehwait); 2536 2537 + return cls_conn; 2538 2539 max_recv_dlenght_alloc_fail: 2540 spin_lock_bh(&session->lock); ··· 2550 writequeue_alloc_fail: 2551 kfifo_free(conn->xmitqueue); 2552 xmitqueue_alloc_fail: 2553 + iscsi_destroy_conn(cls_conn); 2554 + return NULL; 2555 } 2556 2557 static void 2558 + iscsi_conn_destroy(struct iscsi_cls_conn *cls_conn) 2559 { 2560 + struct iscsi_conn *conn = cls_conn->dd_data; 2561 struct iscsi_session *session = conn->session; 2562 + unsigned long flags; 2563 2564 + mutex_lock(&conn->xmitmutex); 2565 set_bit(SUSPEND_BIT, &conn->suspend_tx); 2566 if (conn->c_stage == ISCSI_CONN_INITIAL_STAGE && conn->sock) { 2567 struct sock *sk = conn->sock->sk; ··· 2592 } 2593 spin_unlock_bh(&session->lock); 2594 2595 + mutex_unlock(&conn->xmitmutex); 2596 2597 /* 2598 * Block until all in-progress commands for this connection 2599 * time out or fail. 2600 */ 2601 for (;;) { 2602 + spin_lock_irqsave(session->host->host_lock, flags); 2603 if (!session->host->host_busy) { /* OK for ERL == 0 */ 2604 + spin_unlock_irqrestore(session->host->host_lock, flags); 2605 break; 2606 } 2607 + spin_unlock_irqrestore(session->host->host_lock, flags); 2608 msleep_interruptible(500); 2609 printk("conn_destroy(): host_busy %d host_failed %d\n", 2610 session->host->host_busy, session->host->host_failed); ··· 2652 kfifo_free(conn->writequeue); 2653 kfifo_free(conn->immqueue); 2654 kfifo_free(conn->mgmtqueue); 2655 + 2656 + iscsi_destroy_conn(cls_conn); 2657 } 2658 2659 static int ··· 2712 * processing. 2713 */ 2714 iscsi_conn_set_callbacks(conn); 2715 + 2716 + conn->sendpage = conn->sock->ops->sendpage; 2717 2718 /* 2719 * set receive state machine into initial state ··· 2796 set_bit(SUSPEND_BIT, &conn->suspend_rx); 2797 write_unlock_bh(&sk->sk_callback_lock); 2798 2799 + mutex_lock(&conn->xmitmutex); 2800 2801 spin_lock_irqsave(session->host->host_lock, flags); 2802 spin_lock(&session->lock); ··· 2878 conn->datadgst_en = 0; 2879 } 2880 } 2881 + mutex_unlock(&conn->xmitmutex); 2882 } 2883 2884 static int ··· 2963 else 2964 __kfifo_put(conn->mgmtqueue, (void*)&mtask, sizeof(void*)); 2965 2966 + scsi_queue_work(session->host, &conn->xmitwork); 2967 return 0; 2968 } 2969 ··· 3029 * 1) connection-level failure; 3030 * 2) recovery due protocol error; 3031 */ 3032 + mutex_lock(&conn->xmitmutex); 3033 spin_lock_bh(&session->lock); 3034 if (session->state != ISCSI_STATE_LOGGED_IN) { 3035 if (session->state == ISCSI_STATE_TERMINATE) { 3036 spin_unlock_bh(&session->lock); 3037 + mutex_unlock(&conn->xmitmutex); 3038 goto failed; 3039 } 3040 spin_unlock_bh(&session->lock); ··· 3052 * 2) session was re-open during time out of ctask. 3053 */ 3054 spin_unlock_bh(&session->lock); 3055 + mutex_unlock(&conn->xmitmutex); 3056 goto success; 3057 } 3058 conn->tmabort_state = TMABORT_INITIAL; ··· 3107 conn->tmabort_state == TMABORT_SUCCESS) { 3108 conn->tmabort_state = TMABORT_INITIAL; 3109 spin_unlock_bh(&session->lock); 3110 + mutex_unlock(&conn->xmitmutex); 3111 goto success; 3112 } 3113 conn->tmabort_state = TMABORT_INITIAL; ··· 3116 spin_unlock_bh(&session->lock); 3117 } 3118 } 3119 + mutex_unlock(&conn->xmitmutex); 3120 3121 3122 /* ··· 3182 exit: 3183 del_timer_sync(&conn->tmabort_timer); 3184 3185 + mutex_lock(&conn->xmitmutex); 3186 if (conn->sock) { 3187 struct sock *sk = conn->sock->sk; 3188 ··· 3190 iscsi_ctask_cleanup(conn, ctask); 3191 write_unlock_bh(&sk->sk_callback_lock); 3192 } 3193 + mutex_unlock(&conn->xmitmutex); 3194 return rc; 3195 } 3196 ··· 3281 .this_id = -1, 3282 }; 3283 3284 + static struct iscsi_transport iscsi_tcp_transport; 3285 + 3286 + static struct Scsi_Host * 3287 + iscsi_session_create(struct scsi_transport_template *scsit, 3288 + uint32_t initial_cmdsn) 3289 { 3290 + struct Scsi_Host *shost; 3291 struct iscsi_session *session; 3292 + int cmd_i; 3293 3294 + shost = iscsi_transport_create_session(scsit, &iscsi_tcp_transport); 3295 + if (!shost) 3296 + return NULL; 3297 + 3298 + session = iscsi_hostdata(shost->hostdata); 3299 memset(session, 0, sizeof(struct iscsi_session)); 3300 + session->host = shost; 3301 session->state = ISCSI_STATE_LOGGED_IN; 3302 session->mgmtpool_max = ISCSI_MGMT_CMDS_MAX; 3303 session->cmds_max = ISCSI_XMIT_CMDS_MAX; ··· 3335 if (iscsi_r2tpool_alloc(session)) 3336 goto r2tpool_alloc_fail; 3337 3338 + return shost; 3339 3340 r2tpool_alloc_fail: 3341 for (cmd_i = 0; cmd_i < session->mgmtpool_max; cmd_i++) ··· 3345 mgmtpool_alloc_fail: 3346 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 3347 cmdpool_alloc_fail: 3348 + return NULL; 3349 } 3350 3351 static void 3352 + iscsi_session_destroy(struct Scsi_Host *shost) 3353 { 3354 + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 3355 int cmd_i; 3356 struct iscsi_data_task *dtask, *n; 3357 3358 for (cmd_i = 0; cmd_i < session->cmds_max; cmd_i++) { 3359 struct iscsi_cmd_task *ctask = session->cmds[cmd_i]; ··· 3369 iscsi_r2tpool_free(session); 3370 iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds); 3371 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 3372 + 3373 + iscsi_transport_destroy_session(shost); 3374 } 3375 3376 static int ··· 3467 if (conn->data_rx_tfm) 3468 crypto_free_tfm(conn->data_rx_tfm); 3469 } 3470 + conn->sendpage = conn->datadgst_en ? 3471 + sock_no_sendpage : conn->sock->ops->sendpage; 3472 break; 3473 case ISCSI_PARAM_INITIAL_R2T_EN: 3474 session->initial_r2t_en = value; ··· 3515 } 3516 3517 static int 3518 + iscsi_session_get_param(struct Scsi_Host *shost, 3519 + enum iscsi_param param, uint32_t *value) 3520 { 3521 + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 3522 3523 switch(param) { 3524 case ISCSI_PARAM_INITIAL_R2T_EN: 3525 *value = session->initial_r2t_en; 3526 break; ··· 3563 break; 3564 case ISCSI_PARAM_OFMARKER_EN: 3565 *value = session->ofmarker_en; 3566 + break; 3567 + default: 3568 + return ISCSI_ERR_PARAM_NOT_FOUND; 3569 + } 3570 + 3571 + return 0; 3572 + } 3573 + 3574 + static int 3575 + iscsi_conn_get_param(void *data, enum iscsi_param param, uint32_t *value) 3576 + { 3577 + struct iscsi_conn *conn = data; 3578 + 3579 + switch(param) { 3580 + case ISCSI_PARAM_MAX_RECV_DLENGTH: 3581 + *value = conn->max_recv_dlength; 3582 + break; 3583 + case ISCSI_PARAM_MAX_XMIT_DLENGTH: 3584 + *value = conn->max_xmit_dlength; 3585 + break; 3586 + case ISCSI_PARAM_HDRDGST_EN: 3587 + *value = conn->hdrdgst_en; 3588 + break; 3589 + case ISCSI_PARAM_DATADGST_EN: 3590 + *value = conn->datadgst_en; 3591 break; 3592 default: 3593 return ISCSI_ERR_PARAM_NOT_FOUND; ··· 3601 struct iscsi_conn *conn = iscsi_ptr(connh); 3602 int rc; 3603 3604 + mutex_lock(&conn->xmitmutex); 3605 rc = iscsi_conn_send_generic(conn, hdr, data, data_size); 3606 + mutex_unlock(&conn->xmitmutex); 3607 3608 return rc; 3609 } ··· 3615 | CAP_DATADGST, 3616 .host_template = &iscsi_sht, 3617 .hostdata_size = sizeof(struct iscsi_session), 3618 + .conndata_size = sizeof(struct iscsi_conn), 3619 .max_conn = 1, 3620 .max_cmd_len = ISCSI_TCP_MAX_CMD_LEN, 3621 .create_session = iscsi_session_create, ··· 3623 .bind_conn = iscsi_conn_bind, 3624 .destroy_conn = iscsi_conn_destroy, 3625 .set_param = iscsi_conn_set_param, 3626 + .get_conn_param = iscsi_conn_get_param, 3627 + .get_session_param = iscsi_session_get_param, 3628 .start_conn = iscsi_conn_start, 3629 .stop_conn = iscsi_conn_stop, 3630 .send_pdu = iscsi_conn_send_pdu, ··· 3633 static int __init 3634 iscsi_tcp_init(void) 3635 { 3636 if (iscsi_max_lun < 1) { 3637 printk(KERN_ERR "Invalid max_lun value of %u\n", iscsi_max_lun); 3638 return -EINVAL; ··· 3647 if (!taskcache) 3648 return -ENOMEM; 3649 3650 + if (!iscsi_register_transport(&iscsi_tcp_transport)) 3651 kmem_cache_destroy(taskcache); 3652 3653 + return 0; 3654 } 3655 3656 static void __exit
+4 -2
drivers/scsi/iscsi_tcp.h
··· 158 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ 159 struct kfifo *xmitqueue; /* data-path cmd queue */ 160 struct work_struct xmitwork; /* per-conn. xmit workqueue */ 161 - struct semaphore xmitsema; /* serializes connection xmit, 162 * access to kfifos: * 163 * xmitqueue, writequeue, * 164 * immqueue, mgmtqueue */ ··· 191 uint32_t sendpage_failures_cnt; 192 uint32_t discontiguous_hdr_cnt; 193 uint32_t eh_abort_cnt; 194 }; 195 196 struct iscsi_session { ··· 242 243 struct iscsi_buf { 244 struct scatterlist sg; 245 - struct kvec iov; 246 unsigned int sent; 247 }; 248 249 struct iscsi_data_task {
··· 158 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ 159 struct kfifo *xmitqueue; /* data-path cmd queue */ 160 struct work_struct xmitwork; /* per-conn. xmit workqueue */ 161 + struct mutex xmitmutex; /* serializes connection xmit, 162 * access to kfifos: * 163 * xmitqueue, writequeue, * 164 * immqueue, mgmtqueue */ ··· 191 uint32_t sendpage_failures_cnt; 192 uint32_t discontiguous_hdr_cnt; 193 uint32_t eh_abort_cnt; 194 + 195 + ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int); 196 }; 197 198 struct iscsi_session { ··· 240 241 struct iscsi_buf { 242 struct scatterlist sg; 243 unsigned int sent; 244 + char use_sendmsg; 245 }; 246 247 struct iscsi_data_task {
+1 -1
drivers/scsi/lpfc/lpfc_scsi.c
··· 150 return psb; 151 } 152 153 - struct lpfc_scsi_buf* 154 lpfc_get_scsi_buf(struct lpfc_hba * phba) 155 { 156 struct lpfc_scsi_buf * lpfc_cmd = NULL;
··· 150 return psb; 151 } 152 153 + static struct lpfc_scsi_buf* 154 lpfc_get_scsi_buf(struct lpfc_hba * phba) 155 { 156 struct lpfc_scsi_buf * lpfc_cmd = NULL;
+3 -3
drivers/scsi/megaraid.c
··· 4479 * serialized. This is so because we want to reserve maximum number of 4480 * available command ids for the I/O commands. 4481 */ 4482 - down(&adapter->int_mtx); 4483 4484 scb = &adapter->int_scb; 4485 memset(scb, 0, sizeof(scb_t)); ··· 4527 mc->cmd, mc->opcode, mc->subopcode, scmd->result); 4528 } 4529 4530 - up(&adapter->int_mtx); 4531 4532 return rval; 4533 } ··· 4866 adapter->has_64bit_addr = 0; 4867 } 4868 4869 - init_MUTEX(&adapter->int_mtx); 4870 init_completion(&adapter->int_waitq); 4871 4872 adapter->this_id = DEFAULT_INITIATOR_ID;
··· 4479 * serialized. This is so because we want to reserve maximum number of 4480 * available command ids for the I/O commands. 4481 */ 4482 + mutex_lock(&adapter->int_mtx); 4483 4484 scb = &adapter->int_scb; 4485 memset(scb, 0, sizeof(scb_t)); ··· 4527 mc->cmd, mc->opcode, mc->subopcode, scmd->result); 4528 } 4529 4530 + mutex_unlock(&adapter->int_mtx); 4531 4532 return rval; 4533 } ··· 4866 adapter->has_64bit_addr = 0; 4867 } 4868 4869 + mutex_init(&adapter->int_mtx); 4870 init_completion(&adapter->int_waitq); 4871 4872 adapter->this_id = DEFAULT_INITIATOR_ID;
+2 -2
drivers/scsi/megaraid.h
··· 2 #define __MEGARAID_H__ 3 4 #include <linux/spinlock.h> 5 - 6 7 #define MEGARAID_VERSION \ 8 "v2.00.3 (Release Date: Wed Feb 19 08:51:30 EST 2003)\n" ··· 889 890 scb_t int_scb; 891 Scsi_Cmnd int_scmd; 892 - struct semaphore int_mtx; /* To synchronize the internal 893 commands */ 894 struct completion int_waitq; /* wait queue for internal 895 cmds */
··· 2 #define __MEGARAID_H__ 3 4 #include <linux/spinlock.h> 5 + #include <linux/mutex.h> 6 7 #define MEGARAID_VERSION \ 8 "v2.00.3 (Release Date: Wed Feb 19 08:51:30 EST 2003)\n" ··· 889 890 scb_t int_scb; 891 Scsi_Cmnd int_scmd; 892 + struct mutex int_mtx; /* To synchronize the internal 893 commands */ 894 struct completion int_waitq; /* wait queue for internal 895 cmds */
+4 -3
drivers/scsi/megaraid/megaraid_sas.c
··· 35 #include <asm/uaccess.h> 36 #include <linux/fs.h> 37 #include <linux/compat.h> 38 39 #include <scsi/scsi.h> 40 #include <scsi/scsi_cmnd.h> ··· 73 static int megasas_mgmt_majorno; 74 static struct megasas_mgmt_info megasas_mgmt_info; 75 static struct fasync_struct *megasas_async_queue; 76 - static DECLARE_MUTEX(megasas_async_queue_mutex); 77 78 /** 79 * megasas_get_cmd - Get a command from the free pool ··· 2363 { 2364 int rc; 2365 2366 - down(&megasas_async_queue_mutex); 2367 2368 rc = fasync_helper(fd, filep, mode, &megasas_async_queue); 2369 2370 - up(&megasas_async_queue_mutex); 2371 2372 if (rc >= 0) { 2373 /* For sanity check when we get ioctl */
··· 35 #include <asm/uaccess.h> 36 #include <linux/fs.h> 37 #include <linux/compat.h> 38 + #include <linux/mutex.h> 39 40 #include <scsi/scsi.h> 41 #include <scsi/scsi_cmnd.h> ··· 72 static int megasas_mgmt_majorno; 73 static struct megasas_mgmt_info megasas_mgmt_info; 74 static struct fasync_struct *megasas_async_queue; 75 + static DEFINE_MUTEX(megasas_async_queue_mutex); 76 77 /** 78 * megasas_get_cmd - Get a command from the free pool ··· 2362 { 2363 int rc; 2364 2365 + mutex_lock(&megasas_async_queue_mutex); 2366 2367 rc = fasync_helper(fd, filep, mode, &megasas_async_queue); 2368 2369 + mutex_unlock(&megasas_async_queue_mutex); 2370 2371 if (rc >= 0) { 2372 /* For sanity check when we get ioctl */
+16 -8
drivers/scsi/qla2xxx/Kconfig
··· 1 - config SCSI_QLA2XXX 2 tristate "QLogic QLA2XXX Fibre Channel Support" 3 depends on PCI && SCSI 4 select SCSI_FC_ATTRS ··· 22 Upon request, the driver caches the firmware image until 23 the driver is unloaded. 24 25 NOTE: The original method of building firmware-loader 26 modules has been deprecated as the firmware-images will 27 be removed from the kernel sources. 28 29 config SCSI_QLA2XXX_EMBEDDED_FIRMWARE 30 bool " Use firmware-loader modules (DEPRECATED)" 31 - depends on SCSI_QLA2XXX 32 33 config SCSI_QLA21XX 34 tristate " Build QLogic ISP2100 firmware-module" 35 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 36 ---help--- 37 This driver supports the QLogic 21xx (ISP2100) host adapter family. 38 39 config SCSI_QLA22XX 40 tristate " Build QLogic ISP2200 firmware-module" 41 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 42 ---help--- 43 This driver supports the QLogic 22xx (ISP2200) host adapter family. 44 45 config SCSI_QLA2300 46 tristate " Build QLogic ISP2300 firmware-module" 47 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 48 ---help--- 49 This driver supports the QLogic 2300 (ISP2300 and ISP2312) host 50 adapter family. 51 52 config SCSI_QLA2322 53 tristate " Build QLogic ISP2322 firmware-module" 54 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 55 ---help--- 56 This driver supports the QLogic 2322 (ISP2322) host adapter family. 57 58 config SCSI_QLA6312 59 tristate " Build QLogic ISP63xx firmware-module" 60 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 61 ---help--- 62 This driver supports the QLogic 63xx (ISP6312 and ISP6322) host 63 adapter family. 64 65 config SCSI_QLA24XX 66 tristate " Build QLogic ISP24xx firmware-module" 67 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 68 ---help--- 69 This driver supports the QLogic 24xx (ISP2422 and ISP2432) host 70 adapter family.
··· 1 + config SCSI_QLA_FC 2 tristate "QLogic QLA2XXX Fibre Channel Support" 3 depends on PCI && SCSI 4 select SCSI_FC_ATTRS ··· 22 Upon request, the driver caches the firmware image until 23 the driver is unloaded. 24 25 + Firmware images can be retrieved from: 26 + 27 + ftp://ftp.qlogic.com/outgoing/linux/firmware/ 28 + 29 NOTE: The original method of building firmware-loader 30 modules has been deprecated as the firmware-images will 31 be removed from the kernel sources. 32 33 config SCSI_QLA2XXX_EMBEDDED_FIRMWARE 34 bool " Use firmware-loader modules (DEPRECATED)" 35 + depends on SCSI_QLA_FC 36 + help 37 + This option offers you the deprecated firmware-loader 38 + modules that have been obsoleted by the usage of the 39 + Firmware Loader interface in the qla2xxx driver. 40 41 config SCSI_QLA21XX 42 tristate " Build QLogic ISP2100 firmware-module" 43 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 44 ---help--- 45 This driver supports the QLogic 21xx (ISP2100) host adapter family. 46 47 config SCSI_QLA22XX 48 tristate " Build QLogic ISP2200 firmware-module" 49 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 50 ---help--- 51 This driver supports the QLogic 22xx (ISP2200) host adapter family. 52 53 config SCSI_QLA2300 54 tristate " Build QLogic ISP2300 firmware-module" 55 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 56 ---help--- 57 This driver supports the QLogic 2300 (ISP2300 and ISP2312) host 58 adapter family. 59 60 config SCSI_QLA2322 61 tristate " Build QLogic ISP2322 firmware-module" 62 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 63 ---help--- 64 This driver supports the QLogic 2322 (ISP2322) host adapter family. 65 66 config SCSI_QLA6312 67 tristate " Build QLogic ISP63xx firmware-module" 68 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 69 ---help--- 70 This driver supports the QLogic 63xx (ISP6312 and ISP6322) host 71 adapter family. 72 73 config SCSI_QLA24XX 74 tristate " Build QLogic ISP24xx firmware-module" 75 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 76 ---help--- 77 This driver supports the QLogic 24xx (ISP2422 and ISP2432) host 78 adapter family.
+1 -1
drivers/scsi/qla2xxx/Makefile
··· 3 qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ 4 qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o 5 6 - obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx.o 7 8 qla2100-y := ql2100.o ql2100_fw.o 9 qla2200-y := ql2200.o ql2200_fw.o
··· 3 qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ 4 qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o 5 6 + obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o 7 8 qla2100-y := ql2100.o ql2100_fw.o 9 qla2200-y := ql2200.o ql2200_fw.o
+2 -2
drivers/scsi/qla2xxx/qla_attr.c
··· 541 void 542 qla2x00_init_host_attr(scsi_qla_host_t *ha) 543 { 544 - fc_host_node_name(ha->host) = wwn_to_u64(ha->init_cb->node_name); 545 - fc_host_port_name(ha->host) = wwn_to_u64(ha->init_cb->port_name); 546 fc_host_supported_classes(ha->host) = FC_COS_CLASS3; 547 }
··· 541 void 542 qla2x00_init_host_attr(scsi_qla_host_t *ha) 543 { 544 + fc_host_node_name(ha->host) = wwn_to_u64(ha->node_name); 545 + fc_host_port_name(ha->host) = wwn_to_u64(ha->port_name); 546 fc_host_supported_classes(ha->host) = FC_COS_CLASS3; 547 }
+53 -52
drivers/scsi/qla2xxx/qla_dbg.c
··· 1003 fw = (struct qla24xx_fw_dump *) ha->fw_dump24; 1004 1005 rval = QLA_SUCCESS; 1006 - fw->hccr = RD_REG_DWORD(&reg->hccr); 1007 1008 /* Pause RISC. */ 1009 - if ((fw->hccr & HCCRX_RISC_PAUSE) == 0) { 1010 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET | 1011 HCCRX_CLR_HOST_INT); 1012 RD_REG_DWORD(&reg->hccr); /* PCI Posting. */ ··· 1021 } 1022 } 1023 1024 - /* Disable interrupts. */ 1025 - WRT_REG_DWORD(&reg->ictrl, 0); 1026 - RD_REG_DWORD(&reg->ictrl); 1027 - 1028 if (rval == QLA_SUCCESS) { 1029 /* Host interface registers. */ 1030 dmp_reg = (uint32_t __iomem *)(reg + 0); 1031 for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) 1032 fw->host_reg[cnt] = RD_REG_DWORD(dmp_reg++); 1033 1034 /* Mailbox registers. */ 1035 mbx_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); ··· 1345 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); 1346 for (cnt = 0; cnt < 16; cnt++) 1347 *iter_reg++ = RD_REG_DWORD(dmp_reg++); 1348 - 1349 - WRT_REG_DWORD(&reg->iobase_addr, 0x0F70); 1350 - RD_REG_DWORD(&reg->iobase_addr); 1351 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1352 - WRT_REG_DWORD(dmp_reg, 0xB0000000); 1353 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1354 - fw->shadow_reg[0] = RD_REG_DWORD(dmp_reg); 1355 - 1356 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1357 - WRT_REG_DWORD(dmp_reg, 0xB0100000); 1358 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1359 - fw->shadow_reg[1] = RD_REG_DWORD(dmp_reg); 1360 - 1361 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1362 - WRT_REG_DWORD(dmp_reg, 0xB0200000); 1363 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1364 - fw->shadow_reg[2] = RD_REG_DWORD(dmp_reg); 1365 - 1366 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1367 - WRT_REG_DWORD(dmp_reg, 0xB0300000); 1368 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1369 - fw->shadow_reg[3] = RD_REG_DWORD(dmp_reg); 1370 - 1371 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1372 - WRT_REG_DWORD(dmp_reg, 0xB0400000); 1373 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1374 - fw->shadow_reg[4] = RD_REG_DWORD(dmp_reg); 1375 - 1376 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1377 - WRT_REG_DWORD(dmp_reg, 0xB0500000); 1378 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1379 - fw->shadow_reg[5] = RD_REG_DWORD(dmp_reg); 1380 - 1381 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1382 - WRT_REG_DWORD(dmp_reg, 0xB0600000); 1383 - dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1384 - fw->shadow_reg[6] = RD_REG_DWORD(dmp_reg); 1385 1386 /* Local memory controller registers. */ 1387 iter_reg = fw->lmc_reg; ··· 1678 ha->fw_major_version, ha->fw_minor_version, 1679 ha->fw_subminor_version, ha->fw_attributes); 1680 1681 - qla_uprintf(&uiter, "\nHCCR Register\n%04x\n", fw->hccr); 1682 1683 qla_uprintf(&uiter, "\nHost Interface Registers"); 1684 for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) { ··· 1686 qla_uprintf(&uiter, "\n"); 1687 1688 qla_uprintf(&uiter, "%08x ", fw->host_reg[cnt]); 1689 } 1690 1691 qla_uprintf(&uiter, "\n\nMailbox Registers"); ··· 1862 qla_uprintf(&uiter, "\n"); 1863 1864 qla_uprintf(&uiter, "%08x ", fw->risc_gp_reg[cnt]); 1865 - } 1866 - 1867 - qla_uprintf(&uiter, "\n\nShadow Registers"); 1868 - for (cnt = 0; cnt < sizeof(fw->shadow_reg) / 4; cnt++) { 1869 - if (cnt % 8 == 0) 1870 - qla_uprintf(&uiter, "\n"); 1871 - 1872 - qla_uprintf(&uiter, "%08x ", fw->shadow_reg[cnt]); 1873 } 1874 1875 qla_uprintf(&uiter, "\n\nLMC Registers");
··· 1003 fw = (struct qla24xx_fw_dump *) ha->fw_dump24; 1004 1005 rval = QLA_SUCCESS; 1006 + fw->host_status = RD_REG_DWORD(&reg->host_status); 1007 1008 /* Pause RISC. */ 1009 + if ((RD_REG_DWORD(&reg->hccr) & HCCRX_RISC_PAUSE) == 0) { 1010 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET | 1011 HCCRX_CLR_HOST_INT); 1012 RD_REG_DWORD(&reg->hccr); /* PCI Posting. */ ··· 1021 } 1022 } 1023 1024 if (rval == QLA_SUCCESS) { 1025 /* Host interface registers. */ 1026 dmp_reg = (uint32_t __iomem *)(reg + 0); 1027 for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) 1028 fw->host_reg[cnt] = RD_REG_DWORD(dmp_reg++); 1029 + 1030 + /* Disable interrupts. */ 1031 + WRT_REG_DWORD(&reg->ictrl, 0); 1032 + RD_REG_DWORD(&reg->ictrl); 1033 + 1034 + /* Shadow registers. */ 1035 + WRT_REG_DWORD(&reg->iobase_addr, 0x0F70); 1036 + RD_REG_DWORD(&reg->iobase_addr); 1037 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1038 + WRT_REG_DWORD(dmp_reg, 0xB0000000); 1039 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1040 + fw->shadow_reg[0] = RD_REG_DWORD(dmp_reg); 1041 + 1042 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1043 + WRT_REG_DWORD(dmp_reg, 0xB0100000); 1044 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1045 + fw->shadow_reg[1] = RD_REG_DWORD(dmp_reg); 1046 + 1047 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1048 + WRT_REG_DWORD(dmp_reg, 0xB0200000); 1049 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1050 + fw->shadow_reg[2] = RD_REG_DWORD(dmp_reg); 1051 + 1052 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1053 + WRT_REG_DWORD(dmp_reg, 0xB0300000); 1054 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1055 + fw->shadow_reg[3] = RD_REG_DWORD(dmp_reg); 1056 + 1057 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1058 + WRT_REG_DWORD(dmp_reg, 0xB0400000); 1059 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1060 + fw->shadow_reg[4] = RD_REG_DWORD(dmp_reg); 1061 + 1062 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1063 + WRT_REG_DWORD(dmp_reg, 0xB0500000); 1064 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1065 + fw->shadow_reg[5] = RD_REG_DWORD(dmp_reg); 1066 + 1067 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1068 + WRT_REG_DWORD(dmp_reg, 0xB0600000); 1069 + dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC); 1070 + fw->shadow_reg[6] = RD_REG_DWORD(dmp_reg); 1071 1072 /* Mailbox registers. */ 1073 mbx_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); ··· 1307 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); 1308 for (cnt = 0; cnt < 16; cnt++) 1309 *iter_reg++ = RD_REG_DWORD(dmp_reg++); 1310 1311 /* Local memory controller registers. */ 1312 iter_reg = fw->lmc_reg; ··· 1677 ha->fw_major_version, ha->fw_minor_version, 1678 ha->fw_subminor_version, ha->fw_attributes); 1679 1680 + qla_uprintf(&uiter, "\nR2H Status Register\n%04x\n", fw->host_status); 1681 1682 qla_uprintf(&uiter, "\nHost Interface Registers"); 1683 for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) { ··· 1685 qla_uprintf(&uiter, "\n"); 1686 1687 qla_uprintf(&uiter, "%08x ", fw->host_reg[cnt]); 1688 + } 1689 + 1690 + qla_uprintf(&uiter, "\n\nShadow Registers"); 1691 + for (cnt = 0; cnt < sizeof(fw->shadow_reg) / 4; cnt++) { 1692 + if (cnt % 8 == 0) 1693 + qla_uprintf(&uiter, "\n"); 1694 + 1695 + qla_uprintf(&uiter, "%08x ", fw->shadow_reg[cnt]); 1696 } 1697 1698 qla_uprintf(&uiter, "\n\nMailbox Registers"); ··· 1853 qla_uprintf(&uiter, "\n"); 1854 1855 qla_uprintf(&uiter, "%08x ", fw->risc_gp_reg[cnt]); 1856 } 1857 1858 qla_uprintf(&uiter, "\n\nLMC Registers");
+2 -2
drivers/scsi/qla2xxx/qla_dbg.h
··· 227 #define FW_DUMP_SIZE_24XX 0x2B0000 228 229 struct qla24xx_fw_dump { 230 - uint32_t hccr; 231 uint32_t host_reg[32]; 232 uint16_t mailbox_reg[32]; 233 uint32_t xseq_gp_reg[128]; 234 uint32_t xseq_0_reg[16]; ··· 251 uint32_t rcvt0_data_dma_reg[32]; 252 uint32_t rcvt1_data_dma_reg[32]; 253 uint32_t risc_gp_reg[128]; 254 - uint32_t shadow_reg[7]; 255 uint32_t lmc_reg[112]; 256 uint32_t fpm_hdw_reg[192]; 257 uint32_t fb_hdw_reg[176];
··· 227 #define FW_DUMP_SIZE_24XX 0x2B0000 228 229 struct qla24xx_fw_dump { 230 + uint32_t host_status; 231 uint32_t host_reg[32]; 232 + uint32_t shadow_reg[7]; 233 uint16_t mailbox_reg[32]; 234 uint32_t xseq_gp_reg[128]; 235 uint32_t xseq_0_reg[16]; ··· 250 uint32_t rcvt0_data_dma_reg[32]; 251 uint32_t rcvt1_data_dma_reg[32]; 252 uint32_t risc_gp_reg[128]; 253 uint32_t lmc_reg[112]; 254 uint32_t fpm_hdw_reg[192]; 255 uint32_t fb_hdw_reg[176];
+2 -4
drivers/scsi/qla2xxx/qla_gbl.h
··· 62 extern int ql2xplogiabsentdevice; 63 extern int ql2xloginretrycount; 64 extern int ql2xfdmienable; 65 66 extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *); 67 ··· 97 * Global Function Prototypes in qla_mbx.c source file. 98 */ 99 extern int 100 - qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t); 101 - 102 - extern int 103 - qla2x00_load_ram_ext(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); 104 105 extern int 106 qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
··· 62 extern int ql2xplogiabsentdevice; 63 extern int ql2xloginretrycount; 64 extern int ql2xfdmienable; 65 + extern int ql2xprocessrscn; 66 67 extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *); 68 ··· 96 * Global Function Prototypes in qla_mbx.c source file. 97 */ 98 extern int 99 + qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); 100 101 extern int 102 qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
+3 -5
drivers/scsi/qla2xxx/qla_gs.c
··· 538 ct_req->req.rff_id.port_id[1] = ha->d_id.b.area; 539 ct_req->req.rff_id.port_id[2] = ha->d_id.b.al_pa; 540 541 ct_req->req.rff_id.fc4_type = 0x08; /* SCSI - FCP */ 542 543 /* Execute MS IOCB */ ··· 1530 eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED); 1531 eiter->len = __constant_cpu_to_be16(4 + 4); 1532 if (IS_QLA25XX(ha)) 1533 - eiter->a.sup_speed = __constant_cpu_to_be32(4); 1534 - else if (IS_QLA24XX(ha)) 1535 eiter->a.sup_speed = __constant_cpu_to_be32(8); 1536 else if (IS_QLA23XX(ha)) 1537 eiter->a.sup_speed = __constant_cpu_to_be32(2); 1538 else ··· 1554 eiter->a.cur_speed = __constant_cpu_to_be32(2); 1555 break; 1556 case 3: 1557 - eiter->a.cur_speed = __constant_cpu_to_be32(8); 1558 - break; 1559 - case 4: 1560 eiter->a.cur_speed = __constant_cpu_to_be32(4); 1561 break; 1562 }
··· 538 ct_req->req.rff_id.port_id[1] = ha->d_id.b.area; 539 ct_req->req.rff_id.port_id[2] = ha->d_id.b.al_pa; 540 541 + ct_req->req.rff_id.fc4_feature = BIT_1; 542 ct_req->req.rff_id.fc4_type = 0x08; /* SCSI - FCP */ 543 544 /* Execute MS IOCB */ ··· 1529 eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED); 1530 eiter->len = __constant_cpu_to_be16(4 + 4); 1531 if (IS_QLA25XX(ha)) 1532 eiter->a.sup_speed = __constant_cpu_to_be32(8); 1533 + else if (IS_QLA24XX(ha)) 1534 + eiter->a.sup_speed = __constant_cpu_to_be32(4); 1535 else if (IS_QLA23XX(ha)) 1536 eiter->a.sup_speed = __constant_cpu_to_be32(2); 1537 else ··· 1553 eiter->a.cur_speed = __constant_cpu_to_be32(2); 1554 break; 1555 case 3: 1556 eiter->a.cur_speed = __constant_cpu_to_be32(4); 1557 break; 1558 }
+16 -8
drivers/scsi/qla2xxx/qla_init.c
··· 1014 int rval; 1015 1016 /* Update Serial Link options. */ 1017 - if ((ha->fw_seriallink_options24[0] & BIT_0) == 0) 1018 return; 1019 1020 - rval = qla2x00_set_serdes_params(ha, ha->fw_seriallink_options24[1], 1021 - ha->fw_seriallink_options24[2], ha->fw_seriallink_options24[3]); 1022 if (rval != QLA_SUCCESS) { 1023 qla_printk(KERN_WARNING, ha, 1024 "Unable to update Serial Link options (%x).\n", rval); ··· 1941 "information -- get_port_database=%x, " 1942 "loop_id=0x%04x\n", 1943 ha->host_no, rval2, new_fcport->loop_id)); 1944 continue; 1945 } 1946 ··· 2653 2654 switch (format) { 2655 case 0: 2656 - if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && 2657 !IS_QLA6312(ha) && !IS_QLA6322(ha) && 2658 !IS_QLA24XX(ha) && !IS_QLA25XX(ha) && 2659 ha->flags.init_done) { ··· 3408 ha->node_name = icb->node_name; 3409 ha->port_name = icb->port_name; 3410 3411 ha->retry_count = le16_to_cpu(nv->login_retry_count); 3412 3413 /* Set minimum login_timeout to 4 seconds. */ ··· 3675 for (i = 0; i < dlen; i++) 3676 dcode[i] = swab32(dcode[i]); 3677 3678 - rval = qla2x00_load_ram_ext(ha, ha->request_dma, 3679 - risc_addr, dlen); 3680 if (rval) { 3681 DEBUG(printk("scsi(%ld):[ERROR] Failed to load " 3682 "segment %d of firmware\n", ha->host_no, ··· 3876 for (i = 0; i < dlen; i++) 3877 dcode[i] = swab32(fwcode[i]); 3878 3879 - rval = qla2x00_load_ram_ext(ha, ha->request_dma, 3880 - risc_addr, dlen); 3881 if (rval) { 3882 DEBUG(printk("scsi(%ld):[ERROR] Failed to load " 3883 "segment %d of firmware\n", ha->host_no,
··· 1014 int rval; 1015 1016 /* Update Serial Link options. */ 1017 + if ((le16_to_cpu(ha->fw_seriallink_options24[0]) & BIT_0) == 0) 1018 return; 1019 1020 + rval = qla2x00_set_serdes_params(ha, 1021 + le16_to_cpu(ha->fw_seriallink_options24[1]), 1022 + le16_to_cpu(ha->fw_seriallink_options24[2]), 1023 + le16_to_cpu(ha->fw_seriallink_options24[3])); 1024 if (rval != QLA_SUCCESS) { 1025 qla_printk(KERN_WARNING, ha, 1026 "Unable to update Serial Link options (%x).\n", rval); ··· 1939 "information -- get_port_database=%x, " 1940 "loop_id=0x%04x\n", 1941 ha->host_no, rval2, new_fcport->loop_id)); 1942 + DEBUG2(printk("scsi(%ld): Scheduling resync...\n", 1943 + ha->host_no)); 1944 + set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); 1945 continue; 1946 } 1947 ··· 2648 2649 switch (format) { 2650 case 0: 2651 + if (ql2xprocessrscn && 2652 + !IS_QLA2100(ha) && !IS_QLA2200(ha) && 2653 !IS_QLA6312(ha) && !IS_QLA6322(ha) && 2654 !IS_QLA24XX(ha) && !IS_QLA25XX(ha) && 2655 ha->flags.init_done) { ··· 3402 ha->node_name = icb->node_name; 3403 ha->port_name = icb->port_name; 3404 3405 + icb->execution_throttle = __constant_cpu_to_le16(0xFFFF); 3406 + 3407 ha->retry_count = le16_to_cpu(nv->login_retry_count); 3408 3409 /* Set minimum login_timeout to 4 seconds. */ ··· 3667 for (i = 0; i < dlen; i++) 3668 dcode[i] = swab32(dcode[i]); 3669 3670 + rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, 3671 + dlen); 3672 if (rval) { 3673 DEBUG(printk("scsi(%ld):[ERROR] Failed to load " 3674 "segment %d of firmware\n", ha->host_no, ··· 3868 for (i = 0; i < dlen; i++) 3869 dcode[i] = swab32(fwcode[i]); 3870 3871 + rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, 3872 + dlen); 3873 if (rval) { 3874 DEBUG(printk("scsi(%ld):[ERROR] Failed to load " 3875 "segment %d of firmware\n", ha->host_no,
+8 -6
drivers/scsi/qla2xxx/qla_isr.c
··· 519 * us, create a new entry in our rscn fcports list and handle 520 * the event like an RSCN. 521 */ 522 - if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA6312(ha) && 523 !IS_QLA6322(ha) && !IS_QLA24XX(ha) && !IS_QLA25XX(ha) && 524 ha->flags.init_done && mb[1] != 0xffff && 525 ((ha->operating_mode == P2P && mb[1] != 0) || ··· 964 break; 965 966 case CS_DATA_UNDERRUN: 967 - DEBUG2(printk(KERN_INFO 968 - "scsi(%ld:%d:%d) UNDERRUN status detected 0x%x-0x%x.\n", 969 - ha->host_no, cp->device->id, cp->device->lun, comp_status, 970 - scsi_status)); 971 - 972 resid = resid_len; 973 if (scsi_status & SS_RESIDUAL_UNDER) { 974 cp->resid = resid; 975 CMD_RESID_LEN(cp) = resid; 976 } 977 978 /*
··· 519 * us, create a new entry in our rscn fcports list and handle 520 * the event like an RSCN. 521 */ 522 + if (ql2xprocessrscn && 523 + !IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA6312(ha) && 524 !IS_QLA6322(ha) && !IS_QLA24XX(ha) && !IS_QLA25XX(ha) && 525 ha->flags.init_done && mb[1] != 0xffff && 526 ((ha->operating_mode == P2P && mb[1] != 0) || ··· 963 break; 964 965 case CS_DATA_UNDERRUN: 966 resid = resid_len; 967 if (scsi_status & SS_RESIDUAL_UNDER) { 968 cp->resid = resid; 969 CMD_RESID_LEN(cp) = resid; 970 + } else { 971 + DEBUG2(printk(KERN_INFO 972 + "scsi(%ld:%d:%d) UNDERRUN status detected " 973 + "0x%x-0x%x.\n", ha->host_no, cp->device->id, 974 + cp->device->lun, comp_status, scsi_status)); 975 + 976 } 977 978 /*
+14 -95
drivers/scsi/qla2xxx/qla_mbx.c
··· 196 /* Check for pending interrupts. */ 197 qla2x00_poll(ha); 198 199 - udelay(10); /* v4.27 */ 200 } /* while */ 201 } 202 ··· 327 return rval; 328 } 329 330 - /* 331 - * qla2x00_load_ram 332 - * Load adapter RAM using DMA. 333 - * 334 - * Input: 335 - * ha = adapter block pointer. 336 - * 337 - * Returns: 338 - * qla2x00 local function return status code. 339 - * 340 - * Context: 341 - * Kernel context. 342 - */ 343 int 344 - qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint16_t risc_addr, 345 - uint16_t risc_code_size) 346 - { 347 - int rval; 348 - mbx_cmd_t mc; 349 - mbx_cmd_t *mcp = &mc; 350 - uint32_t req_len; 351 - dma_addr_t nml_dma; 352 - uint32_t nml_len; 353 - uint32_t normalized; 354 - 355 - DEBUG11(printk("qla2x00_load_ram(%ld): entered.\n", 356 - ha->host_no);) 357 - 358 - req_len = risc_code_size; 359 - nml_dma = 0; 360 - nml_len = 0; 361 - 362 - normalized = qla2x00_normalize_dma_addr(&req_dma, &req_len, &nml_dma, 363 - &nml_len); 364 - 365 - /* Load first segment */ 366 - mcp->mb[0] = MBC_LOAD_RISC_RAM; 367 - mcp->mb[1] = risc_addr; 368 - mcp->mb[2] = MSW(req_dma); 369 - mcp->mb[3] = LSW(req_dma); 370 - mcp->mb[4] = (uint16_t)req_len; 371 - mcp->mb[6] = MSW(MSD(req_dma)); 372 - mcp->mb[7] = LSW(MSD(req_dma)); 373 - mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; 374 - mcp->in_mb = MBX_0; 375 - mcp->tov = 30; 376 - mcp->flags = 0; 377 - rval = qla2x00_mailbox_command(ha, mcp); 378 - 379 - /* Load second segment - if necessary */ 380 - if (normalized && (rval == QLA_SUCCESS)) { 381 - mcp->mb[0] = MBC_LOAD_RISC_RAM; 382 - mcp->mb[1] = risc_addr + (uint16_t)req_len; 383 - mcp->mb[2] = MSW(nml_dma); 384 - mcp->mb[3] = LSW(nml_dma); 385 - mcp->mb[4] = (uint16_t)nml_len; 386 - mcp->mb[6] = MSW(MSD(nml_dma)); 387 - mcp->mb[7] = LSW(MSD(nml_dma)); 388 - mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; 389 - mcp->in_mb = MBX_0; 390 - mcp->tov = 30; 391 - mcp->flags = 0; 392 - rval = qla2x00_mailbox_command(ha, mcp); 393 - } 394 - 395 - if (rval == QLA_SUCCESS) { 396 - /* Empty */ 397 - DEBUG11(printk("qla2x00_load_ram(%ld): done.\n", ha->host_no);) 398 - } else { 399 - /* Empty */ 400 - DEBUG2_3_11(printk("qla2x00_load_ram(%ld): failed. rval=%x " 401 - "mb[0]=%x.\n", ha->host_no, rval, mcp->mb[0]);) 402 - } 403 - return rval; 404 - } 405 - 406 - /* 407 - * qla2x00_load_ram_ext 408 - * Load adapter extended RAM using DMA. 409 - * 410 - * Input: 411 - * ha = adapter block pointer. 412 - * 413 - * Returns: 414 - * qla2x00 local function return status code. 415 - * 416 - * Context: 417 - * Kernel context. 418 - */ 419 - int 420 - qla2x00_load_ram_ext(scsi_qla_host_t *ha, dma_addr_t req_dma, 421 - uint32_t risc_addr, uint32_t risc_code_size) 422 { 423 int rval; 424 mbx_cmd_t mc; ··· 337 338 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 339 340 - mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED; 341 mcp->mb[1] = LSW(risc_addr); 342 mcp->mb[2] = MSW(req_dma); 343 mcp->mb[3] = LSW(req_dma); 344 mcp->mb[6] = MSW(MSD(req_dma)); 345 mcp->mb[7] = LSW(MSD(req_dma)); 346 - mcp->mb[8] = MSW(risc_addr); 347 - mcp->out_mb = MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; 348 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 349 mcp->mb[4] = MSW(risc_code_size); 350 mcp->mb[5] = LSW(risc_code_size);
··· 196 /* Check for pending interrupts. */ 197 qla2x00_poll(ha); 198 199 + if (command != MBC_LOAD_RISC_RAM_EXTENDED && 200 + !ha->flags.mbox_int) 201 + msleep(10); 202 } /* while */ 203 } 204 ··· 325 return rval; 326 } 327 328 int 329 + qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t risc_addr, 330 + uint32_t risc_code_size) 331 { 332 int rval; 333 mbx_cmd_t mc; ··· 424 425 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 426 427 + if (MSW(risc_addr) || IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 428 + mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED; 429 + mcp->mb[8] = MSW(risc_addr); 430 + mcp->out_mb = MBX_8|MBX_0; 431 + } else { 432 + mcp->mb[0] = MBC_LOAD_RISC_RAM; 433 + mcp->out_mb = MBX_0; 434 + } 435 mcp->mb[1] = LSW(risc_addr); 436 mcp->mb[2] = MSW(req_dma); 437 mcp->mb[3] = LSW(req_dma); 438 mcp->mb[6] = MSW(MSD(req_dma)); 439 mcp->mb[7] = LSW(MSD(req_dma)); 440 + mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1; 441 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 442 mcp->mb[4] = MSW(risc_code_size); 443 mcp->mb[5] = LSW(risc_code_size);
+6
drivers/scsi/qla2xxx/qla_os.c
··· 71 "Enables FDMI registratons " 72 "Default is 0 - no FDMI. 1 - perfom FDMI."); 73 74 /* 75 * SCSI host template entry points 76 */
··· 71 "Enables FDMI registratons " 72 "Default is 0 - no FDMI. 1 - perfom FDMI."); 73 74 + int ql2xprocessrscn; 75 + module_param(ql2xprocessrscn, int, S_IRUGO|S_IRUSR); 76 + MODULE_PARM_DESC(ql2xprocessrscn, 77 + "Option to enable port RSCN handling via a series of less" 78 + "fabric intrusive ADISCs and PLOGIs."); 79 + 80 /* 81 * SCSI host template entry points 82 */
+3
drivers/scsi/qla2xxx/qla_sup.c
··· 573 } 574 } while (0); 575 576 /* Disable flash write. */ 577 WRT_REG_DWORD(&reg->ctrl_status, 578 RD_REG_DWORD(&reg->ctrl_status) & ~CSRX_FLASH_ENABLE);
··· 573 } 574 } while (0); 575 576 + /* Enable flash write-protection. */ 577 + qla24xx_write_flash_dword(ha, flash_conf_to_access_addr(0x101), 0x9c); 578 + 579 /* Disable flash write. */ 580 WRT_REG_DWORD(&reg->ctrl_status, 581 RD_REG_DWORD(&reg->ctrl_status) & ~CSRX_FLASH_ENABLE);
+2 -2
drivers/scsi/qla2xxx/qla_version.h
··· 7 /* 8 * Driver version 9 */ 10 - #define QLA2XXX_VERSION "8.01.03-k" 11 12 #define QLA_DRIVER_MAJOR_VER 8 13 #define QLA_DRIVER_MINOR_VER 1 14 - #define QLA_DRIVER_PATCH_VER 3 15 #define QLA_DRIVER_BETA_VER 0
··· 7 /* 8 * Driver version 9 */ 10 + #define QLA2XXX_VERSION "8.01.04-k" 11 12 #define QLA_DRIVER_MAJOR_VER 8 13 #define QLA_DRIVER_MINOR_VER 1 14 + #define QLA_DRIVER_PATCH_VER 4 15 #define QLA_DRIVER_BETA_VER 0
+2
drivers/scsi/raid_class.c
··· 148 { RAID_LEVEL_LINEAR, "linear" }, 149 { RAID_LEVEL_0, "raid0" }, 150 { RAID_LEVEL_1, "raid1" }, 151 { RAID_LEVEL_3, "raid3" }, 152 { RAID_LEVEL_4, "raid4" }, 153 { RAID_LEVEL_5, "raid5" }, 154 { RAID_LEVEL_6, "raid6" }, 155 }; 156
··· 148 { RAID_LEVEL_LINEAR, "linear" }, 149 { RAID_LEVEL_0, "raid0" }, 150 { RAID_LEVEL_1, "raid1" }, 151 + { RAID_LEVEL_10, "raid10" }, 152 { RAID_LEVEL_3, "raid3" }, 153 { RAID_LEVEL_4, "raid4" }, 154 { RAID_LEVEL_5, "raid5" }, 155 + { RAID_LEVEL_50, "raid50" }, 156 { RAID_LEVEL_6, "raid6" }, 157 }; 158
+7 -6
drivers/scsi/scsi.c
··· 55 #include <linux/interrupt.h> 56 #include <linux/notifier.h> 57 #include <linux/cpu.h> 58 59 #include <scsi/scsi.h> 60 #include <scsi/scsi_cmnd.h> ··· 210 .gfp_mask = __GFP_DMA, 211 }; 212 213 - static DECLARE_MUTEX(host_cmd_pool_mutex); 214 215 static struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, 216 gfp_t gfp_mask) ··· 331 * Select a command slab for this host and create it if not 332 * yet existant. 333 */ 334 - down(&host_cmd_pool_mutex); 335 pool = (shost->unchecked_isa_dma ? &scsi_cmd_dma_pool : &scsi_cmd_pool); 336 if (!pool->users) { 337 pool->slab = kmem_cache_create(pool->name, ··· 343 344 pool->users++; 345 shost->cmd_pool = pool; 346 - up(&host_cmd_pool_mutex); 347 348 /* 349 * Get one backup command for this host. ··· 360 kmem_cache_destroy(pool->slab); 361 return -ENOMEM; 362 fail: 363 - up(&host_cmd_pool_mutex); 364 return -ENOMEM; 365 366 } ··· 382 kmem_cache_free(shost->cmd_pool->slab, cmd); 383 } 384 385 - down(&host_cmd_pool_mutex); 386 if (!--shost->cmd_pool->users) 387 kmem_cache_destroy(shost->cmd_pool->slab); 388 - up(&host_cmd_pool_mutex); 389 } 390 391 #ifdef CONFIG_SCSI_LOGGING
··· 55 #include <linux/interrupt.h> 56 #include <linux/notifier.h> 57 #include <linux/cpu.h> 58 + #include <linux/mutex.h> 59 60 #include <scsi/scsi.h> 61 #include <scsi/scsi_cmnd.h> ··· 209 .gfp_mask = __GFP_DMA, 210 }; 211 212 + static DEFINE_MUTEX(host_cmd_pool_mutex); 213 214 static struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, 215 gfp_t gfp_mask) ··· 330 * Select a command slab for this host and create it if not 331 * yet existant. 332 */ 333 + mutex_lock(&host_cmd_pool_mutex); 334 pool = (shost->unchecked_isa_dma ? &scsi_cmd_dma_pool : &scsi_cmd_pool); 335 if (!pool->users) { 336 pool->slab = kmem_cache_create(pool->name, ··· 342 343 pool->users++; 344 shost->cmd_pool = pool; 345 + mutex_unlock(&host_cmd_pool_mutex); 346 347 /* 348 * Get one backup command for this host. ··· 359 kmem_cache_destroy(pool->slab); 360 return -ENOMEM; 361 fail: 362 + mutex_unlock(&host_cmd_pool_mutex); 363 return -ENOMEM; 364 365 } ··· 381 kmem_cache_free(shost->cmd_pool->slab, cmd); 382 } 383 384 + mutex_lock(&host_cmd_pool_mutex); 385 if (!--shost->cmd_pool->users) 386 kmem_cache_destroy(shost->cmd_pool->slab); 387 + mutex_unlock(&host_cmd_pool_mutex); 388 } 389 390 #ifdef CONFIG_SCSI_LOGGING
+8 -8
drivers/scsi/scsi_lib.c
··· 1212 return -EOPNOTSUPP; 1213 } 1214 1215 - static void scsi_generic_done(struct scsi_cmnd *cmd) 1216 { 1217 BUG_ON(!blk_pc_request(cmd->request)); 1218 /* ··· 1224 scsi_io_completion(cmd, cmd->bufflen, 0); 1225 } 1226 1227 - void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) 1228 { 1229 struct request *req = cmd->request; 1230 ··· 1241 cmd->transfersize = req->data_len; 1242 cmd->allowed = req->retries; 1243 cmd->timeout_per_command = req->timeout; 1244 } 1245 - EXPORT_SYMBOL_GPL(scsi_setup_blk_pc_cmnd); 1246 1247 static int scsi_prep_fn(struct request_queue *q, struct request *req) 1248 { ··· 1339 * happening now. 1340 */ 1341 if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { 1342 - struct scsi_driver *drv; 1343 int ret; 1344 1345 /* ··· 1370 /* 1371 * Initialize the actual SCSI command for this request. 1372 */ 1373 - if (req->rq_disk) { 1374 drv = *(struct scsi_driver **)req->rq_disk->private_data; 1375 if (unlikely(!drv->init_command(cmd))) { 1376 scsi_release_buffers(cmd); 1377 scsi_put_command(cmd); 1378 goto kill; 1379 } 1380 - } else { 1381 - scsi_setup_blk_pc_cmnd(cmd); 1382 - cmd->done = scsi_generic_done; 1383 } 1384 } 1385
··· 1212 return -EOPNOTSUPP; 1213 } 1214 1215 + static void scsi_blk_pc_done(struct scsi_cmnd *cmd) 1216 { 1217 BUG_ON(!blk_pc_request(cmd->request)); 1218 /* ··· 1224 scsi_io_completion(cmd, cmd->bufflen, 0); 1225 } 1226 1227 + static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) 1228 { 1229 struct request *req = cmd->request; 1230 ··· 1241 cmd->transfersize = req->data_len; 1242 cmd->allowed = req->retries; 1243 cmd->timeout_per_command = req->timeout; 1244 + cmd->done = scsi_blk_pc_done; 1245 } 1246 1247 static int scsi_prep_fn(struct request_queue *q, struct request *req) 1248 { ··· 1339 * happening now. 1340 */ 1341 if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { 1342 int ret; 1343 1344 /* ··· 1371 /* 1372 * Initialize the actual SCSI command for this request. 1373 */ 1374 + if (req->flags & REQ_BLOCK_PC) { 1375 + scsi_setup_blk_pc_cmnd(cmd); 1376 + } else if (req->rq_disk) { 1377 + struct scsi_driver *drv; 1378 + 1379 drv = *(struct scsi_driver **)req->rq_disk->private_data; 1380 if (unlikely(!drv->init_command(cmd))) { 1381 scsi_release_buffers(cmd); 1382 scsi_put_command(cmd); 1383 goto kill; 1384 } 1385 } 1386 } 1387
-6
drivers/scsi/scsi_priv.h
··· 26 #define SCSI_SENSE_VALID(scmd) \ 27 (((scmd)->sense_buffer[0] & 0x70) == 0x70) 28 29 - /* 30 - * Special value for scanning to specify scanning or rescanning of all 31 - * possible channels, (target) ids, or luns on a given shost. 32 - */ 33 - #define SCAN_WILD_CARD ~0 34 - 35 /* hosts.c */ 36 extern int scsi_init_hosts(void); 37 extern void scsi_exit_hosts(void);
··· 26 #define SCSI_SENSE_VALID(scmd) \ 27 (((scmd)->sense_buffer[0] & 0x70) == 0x70) 28 29 /* hosts.c */ 30 extern int scsi_init_hosts(void); 31 extern void scsi_exit_hosts(void);
+11 -6
drivers/scsi/scsi_proc.c
··· 25 #include <linux/errno.h> 26 #include <linux/blkdev.h> 27 #include <linux/seq_file.h> 28 #include <asm/uaccess.h> 29 30 #include <scsi/scsi.h> 31 #include <scsi/scsi_device.h> 32 #include <scsi/scsi_host.h> 33 34 #include "scsi_priv.h" 35 #include "scsi_logging.h" ··· 43 static struct proc_dir_entry *proc_scsi; 44 45 /* Protect sht->present and sht->proc_dir */ 46 - static DECLARE_MUTEX(global_host_template_sem); 47 48 static int proc_scsi_read(char *buffer, char **start, off_t offset, 49 int length, int *eof, void *data) ··· 85 if (!sht->proc_info) 86 return; 87 88 - down(&global_host_template_sem); 89 if (!sht->present++) { 90 sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi); 91 if (!sht->proc_dir) ··· 94 else 95 sht->proc_dir->owner = sht->module; 96 } 97 - up(&global_host_template_sem); 98 } 99 100 void scsi_proc_hostdir_rm(struct scsi_host_template *sht) ··· 102 if (!sht->proc_info) 103 return; 104 105 - down(&global_host_template_sem); 106 if (!--sht->present && sht->proc_dir) { 107 remove_proc_entry(sht->proc_name, proc_scsi); 108 sht->proc_dir = NULL; 109 } 110 - up(&global_host_template_sem); 111 } 112 113 void scsi_proc_host_add(struct Scsi_Host *shost) ··· 201 if (IS_ERR(shost)) 202 return PTR_ERR(shost); 203 204 - error = scsi_scan_host_selected(shost, channel, id, lun, 1); 205 scsi_host_put(shost); 206 return error; 207 }
··· 25 #include <linux/errno.h> 26 #include <linux/blkdev.h> 27 #include <linux/seq_file.h> 28 + #include <linux/mutex.h> 29 #include <asm/uaccess.h> 30 31 #include <scsi/scsi.h> 32 #include <scsi/scsi_device.h> 33 #include <scsi/scsi_host.h> 34 + #include <scsi/scsi_transport.h> 35 36 #include "scsi_priv.h" 37 #include "scsi_logging.h" ··· 41 static struct proc_dir_entry *proc_scsi; 42 43 /* Protect sht->present and sht->proc_dir */ 44 + static DEFINE_MUTEX(global_host_template_mutex); 45 46 static int proc_scsi_read(char *buffer, char **start, off_t offset, 47 int length, int *eof, void *data) ··· 83 if (!sht->proc_info) 84 return; 85 86 + mutex_lock(&global_host_template_mutex); 87 if (!sht->present++) { 88 sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi); 89 if (!sht->proc_dir) ··· 92 else 93 sht->proc_dir->owner = sht->module; 94 } 95 + mutex_unlock(&global_host_template_mutex); 96 } 97 98 void scsi_proc_hostdir_rm(struct scsi_host_template *sht) ··· 100 if (!sht->proc_info) 101 return; 102 103 + mutex_lock(&global_host_template_mutex); 104 if (!--sht->present && sht->proc_dir) { 105 remove_proc_entry(sht->proc_name, proc_scsi); 106 sht->proc_dir = NULL; 107 } 108 + mutex_unlock(&global_host_template_mutex); 109 } 110 111 void scsi_proc_host_add(struct Scsi_Host *shost) ··· 199 if (IS_ERR(shost)) 200 return PTR_ERR(shost); 201 202 + if (shost->transportt->user_scan) 203 + error = shost->transportt->user_scan(shost, channel, id, lun); 204 + else 205 + error = scsi_scan_host_selected(shost, channel, id, lun, 1); 206 scsi_host_put(shost); 207 return error; 208 }
+10 -22
drivers/scsi/scsi_scan.c
··· 334 struct scsi_target *starget; 335 struct scsi_target *found_target; 336 337 - /* 338 - * Obtain the real parent from the transport. The transport 339 - * is allowed to fail (no error) if there is nothing at that 340 - * target id. 341 - */ 342 - if (shost->transportt->target_parent) { 343 - spin_lock_irqsave(shost->host_lock, flags); 344 - parent = shost->transportt->target_parent(shost, channel, id); 345 - spin_unlock_irqrestore(shost->host_lock, flags); 346 - if (!parent) 347 - return NULL; 348 - } 349 - 350 starget = kmalloc(size, GFP_KERNEL); 351 if (!starget) { 352 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); ··· 1270 struct scsi_device *sdev; 1271 struct device *parent = &shost->shost_gendev; 1272 int res; 1273 - struct scsi_target *starget = scsi_alloc_target(parent, channel, id); 1274 1275 if (!starget) 1276 return ERR_PTR(-ENOMEM); 1277 1278 get_device(&starget->dev); 1279 - down(&shost->scan_mutex); 1280 if (scsi_host_scan_allowed(shost)) { 1281 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, 1282 hostdata); 1283 if (res != SCSI_SCAN_LUN_PRESENT) 1284 sdev = ERR_PTR(-ENODEV); 1285 } 1286 - up(&shost->scan_mutex); 1287 scsi_target_reap(starget); 1288 put_device(&starget->dev); 1289 ··· 1392 { 1393 struct Scsi_Host *shost = dev_to_shost(parent); 1394 1395 - down(&shost->scan_mutex); 1396 if (scsi_host_scan_allowed(shost)) 1397 __scsi_scan_target(parent, channel, id, lun, rescan); 1398 - up(&shost->scan_mutex); 1399 } 1400 EXPORT_SYMBOL(scsi_scan_target); 1401 ··· 1442 ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) 1443 return -EINVAL; 1444 1445 - down(&shost->scan_mutex); 1446 if (scsi_host_scan_allowed(shost)) { 1447 if (channel == SCAN_WILD_CARD) 1448 for (channel = 0; channel <= shost->max_channel; ··· 1452 else 1453 scsi_scan_channel(shost, channel, id, lun, rescan); 1454 } 1455 - up(&shost->scan_mutex); 1456 1457 return 0; 1458 } ··· 1510 struct scsi_device *sdev = NULL; 1511 struct scsi_target *starget; 1512 1513 - down(&shost->scan_mutex); 1514 if (!scsi_host_scan_allowed(shost)) 1515 goto out; 1516 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); ··· 1524 } 1525 put_device(&starget->dev); 1526 out: 1527 - up(&shost->scan_mutex); 1528 return sdev; 1529 } 1530 EXPORT_SYMBOL(scsi_get_host_dev);
··· 334 struct scsi_target *starget; 335 struct scsi_target *found_target; 336 337 starget = kmalloc(size, GFP_KERNEL); 338 if (!starget) { 339 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); ··· 1283 struct scsi_device *sdev; 1284 struct device *parent = &shost->shost_gendev; 1285 int res; 1286 + struct scsi_target *starget; 1287 1288 + starget = scsi_alloc_target(parent, channel, id); 1289 if (!starget) 1290 return ERR_PTR(-ENOMEM); 1291 1292 get_device(&starget->dev); 1293 + mutex_lock(&shost->scan_mutex); 1294 if (scsi_host_scan_allowed(shost)) { 1295 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, 1296 hostdata); 1297 if (res != SCSI_SCAN_LUN_PRESENT) 1298 sdev = ERR_PTR(-ENODEV); 1299 } 1300 + mutex_unlock(&shost->scan_mutex); 1301 scsi_target_reap(starget); 1302 put_device(&starget->dev); 1303 ··· 1404 { 1405 struct Scsi_Host *shost = dev_to_shost(parent); 1406 1407 + mutex_lock(&shost->scan_mutex); 1408 if (scsi_host_scan_allowed(shost)) 1409 __scsi_scan_target(parent, channel, id, lun, rescan); 1410 + mutex_unlock(&shost->scan_mutex); 1411 } 1412 EXPORT_SYMBOL(scsi_scan_target); 1413 ··· 1454 ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) 1455 return -EINVAL; 1456 1457 + mutex_lock(&shost->scan_mutex); 1458 if (scsi_host_scan_allowed(shost)) { 1459 if (channel == SCAN_WILD_CARD) 1460 for (channel = 0; channel <= shost->max_channel; ··· 1464 else 1465 scsi_scan_channel(shost, channel, id, lun, rescan); 1466 } 1467 + mutex_unlock(&shost->scan_mutex); 1468 1469 return 0; 1470 } ··· 1522 struct scsi_device *sdev = NULL; 1523 struct scsi_target *starget; 1524 1525 + mutex_lock(&shost->scan_mutex); 1526 if (!scsi_host_scan_allowed(shost)) 1527 goto out; 1528 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); ··· 1536 } 1537 put_device(&starget->dev); 1538 out: 1539 + mutex_unlock(&shost->scan_mutex); 1540 return sdev; 1541 } 1542 EXPORT_SYMBOL(scsi_get_host_dev);
+6 -3
drivers/scsi/scsi_sysfs.c
··· 106 return -EINVAL; 107 if (check_set(&lun, s3)) 108 return -EINVAL; 109 - res = scsi_scan_host_selected(shost, channel, id, lun, 1); 110 return res; 111 } 112 ··· 748 { 749 struct Scsi_Host *shost = sdev->host; 750 751 - down(&shost->scan_mutex); 752 __scsi_remove_device(sdev); 753 - up(&shost->scan_mutex); 754 } 755 EXPORT_SYMBOL(scsi_remove_device); 756
··· 106 return -EINVAL; 107 if (check_set(&lun, s3)) 108 return -EINVAL; 109 + if (shost->transportt->user_scan) 110 + res = shost->transportt->user_scan(shost, channel, id, lun); 111 + else 112 + res = scsi_scan_host_selected(shost, channel, id, lun, 1); 113 return res; 114 } 115 ··· 745 { 746 struct Scsi_Host *shost = sdev->host; 747 748 + mutex_lock(&shost->scan_mutex); 749 __scsi_remove_device(sdev); 750 + mutex_unlock(&shost->scan_mutex); 751 } 752 EXPORT_SYMBOL(scsi_remove_device); 753
+18 -8
drivers/scsi/scsi_transport_fc.c
··· 295 */ 296 fc_host_node_name(shost) = -1; 297 fc_host_port_name(shost) = -1; 298 fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED; 299 memset(fc_host_supported_fc4s(shost), 0, 300 sizeof(fc_host_supported_fc4s(shost))); ··· 796 797 fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long); 798 fc_private_host_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long); 799 fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1)); 800 fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20); 801 fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1)); ··· 1093 /* 1094 * Must be called with shost->host_lock held 1095 */ 1096 - static struct device *fc_target_parent(struct Scsi_Host *shost, 1097 - int channel, uint id) 1098 { 1099 struct fc_rport *rport; 1100 1101 - list_for_each_entry(rport, &fc_host_rports(shost), peers) 1102 - if ((rport->channel == channel) && 1103 - (rport->scsi_target_id == id)) 1104 - return &rport->dev; 1105 1106 - return NULL; 1107 } 1108 1109 struct scsi_transport_template * ··· 1148 /* Transport uses the shost workq for scsi scanning */ 1149 i->t.create_work_queue = 1; 1150 1151 - i->t.target_parent = fc_target_parent; 1152 1153 /* 1154 * Setup SCSI Target Attributes. ··· 1169 count=0; 1170 SETUP_HOST_ATTRIBUTE_RD(node_name); 1171 SETUP_HOST_ATTRIBUTE_RD(port_name); 1172 SETUP_HOST_ATTRIBUTE_RD(supported_classes); 1173 SETUP_HOST_ATTRIBUTE_RD(supported_fc4s); 1174 SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
··· 295 */ 296 fc_host_node_name(shost) = -1; 297 fc_host_port_name(shost) = -1; 298 + fc_host_permanent_port_name(shost) = -1; 299 fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED; 300 memset(fc_host_supported_fc4s(shost), 0, 301 sizeof(fc_host_supported_fc4s(shost))); ··· 795 796 fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long); 797 fc_private_host_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long); 798 + fc_private_host_rd_attr_cast(permanent_port_name, "0x%llx\n", 20, 799 + unsigned long long); 800 fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1)); 801 fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20); 802 fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1)); ··· 1090 /* 1091 * Must be called with shost->host_lock held 1092 */ 1093 + static int fc_user_scan(struct Scsi_Host *shost, uint channel, 1094 + uint id, uint lun) 1095 { 1096 struct fc_rport *rport; 1097 1098 + list_for_each_entry(rport, &fc_host_rports(shost), peers) { 1099 + if (rport->scsi_target_id == -1) 1100 + continue; 1101 1102 + if ((channel == SCAN_WILD_CARD || channel == rport->channel) && 1103 + (id == SCAN_WILD_CARD || id == rport->scsi_target_id)) { 1104 + scsi_scan_target(&rport->dev, rport->channel, 1105 + rport->scsi_target_id, lun, 1); 1106 + } 1107 + } 1108 + 1109 + return 0; 1110 } 1111 1112 struct scsi_transport_template * ··· 1139 /* Transport uses the shost workq for scsi scanning */ 1140 i->t.create_work_queue = 1; 1141 1142 + i->t.user_scan = fc_user_scan; 1143 1144 /* 1145 * Setup SCSI Target Attributes. ··· 1160 count=0; 1161 SETUP_HOST_ATTRIBUTE_RD(node_name); 1162 SETUP_HOST_ATTRIBUTE_RD(port_name); 1163 + SETUP_HOST_ATTRIBUTE_RD(permanent_port_name); 1164 SETUP_HOST_ATTRIBUTE_RD(supported_classes); 1165 SETUP_HOST_ATTRIBUTE_RD(supported_fc4s); 1166 SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
+474 -437
drivers/scsi/scsi_transport_iscsi.c
··· 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 */ 23 #include <linux/module.h> 24 - #include <linux/string.h> 25 - #include <linux/slab.h> 26 #include <linux/mempool.h> 27 #include <net/tcp.h> 28 - 29 #include <scsi/scsi.h> 30 #include <scsi/scsi_host.h> 31 #include <scsi/scsi_device.h> ··· 42 * List of sessions for this transport 43 */ 44 struct list_head sessions; 45 - /* 46 - * lock to serialize access to the sessions list which must 47 - * be taken after the rx_queue_sema 48 - */ 49 - spinlock_t session_lock; 50 /* 51 * based on transport capabilities, at register time we set these 52 * bits to tell the transport class it wants attributes displayed ··· 63 /* 64 * list of registered transports and lock that must 65 * be held while accessing list. The iscsi_transport_lock must 66 - * be acquired after the rx_queue_sema. 67 */ 68 static LIST_HEAD(iscsi_transports); 69 static DEFINE_SPINLOCK(iscsi_transport_lock); ··· 138 139 static struct sock *nls; 140 static int daemon_pid; 141 - static DECLARE_MUTEX(rx_queue_sema); 142 143 struct mempool_zone { 144 mempool_t *pool; ··· 149 spinlock_t freelock; 150 }; 151 152 - static struct mempool_zone z_reply; 153 154 /* 155 * Z_MAX_* - actual mempool size allocated at the mempool_zone_init() time ··· 164 #define Z_MAX_ERROR 16 165 #define Z_HIWAT_ERROR 12 166 167 - struct iscsi_if_conn { 168 - struct list_head conn_list; /* item in connlist */ 169 - struct list_head session_list; /* item in session->connections */ 170 - iscsi_connh_t connh; 171 - int active; /* must be accessed with the connlock */ 172 - struct Scsi_Host *host; /* originated shost */ 173 - struct device dev; /* sysfs transport/container device */ 174 - struct iscsi_transport *transport; 175 - struct mempool_zone z_error; 176 - struct mempool_zone z_pdu; 177 - struct list_head freequeue; 178 - }; 179 - 180 - #define iscsi_dev_to_if_conn(_dev) \ 181 - container_of(_dev, struct iscsi_if_conn, dev) 182 - 183 - #define iscsi_cdev_to_if_conn(_cdev) \ 184 - iscsi_dev_to_if_conn(_cdev->dev) 185 - 186 static LIST_HEAD(connlist); 187 static DEFINE_SPINLOCK(connlock); 188 189 - struct iscsi_if_session { 190 - struct list_head list; /* item in session_list */ 191 - struct list_head connections; 192 - iscsi_sessionh_t sessionh; 193 - struct iscsi_transport *transport; 194 - struct device dev; /* sysfs transport/container device */ 195 - }; 196 197 - #define iscsi_dev_to_if_session(_dev) \ 198 - container_of(_dev, struct iscsi_if_session, dev) 199 200 - #define iscsi_cdev_to_if_session(_cdev) \ 201 - iscsi_dev_to_if_session(_cdev->dev) 202 203 - #define iscsi_if_session_to_shost(_session) \ 204 - dev_to_shost(_session->dev.parent) 205 206 - static struct iscsi_if_conn* 207 iscsi_if_find_conn(uint64_t key) 208 { 209 unsigned long flags; 210 - struct iscsi_if_conn *conn; 211 212 spin_lock_irqsave(&connlock, flags); 213 list_for_each_entry(conn, &connlist, conn_list) ··· 463 } 464 465 static void* 466 - mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data) 467 { 468 struct mempool_zone *zone = pool_data; 469 ··· 495 spin_unlock_irqrestore(&zone->freelock, flags); 496 } 497 498 - static int 499 - mempool_zone_init(struct mempool_zone *zp, unsigned max, unsigned size, 500 - unsigned hiwat) 501 { 502 zp->pool = mempool_create(max, mempool_zone_alloc_skb, 503 mempool_zone_free_skb, zp); 504 - if (!zp->pool) 505 - return -ENOMEM; 506 507 zp->size = size; 508 zp->hiwat = hiwat; ··· 518 spin_lock_init(&zp->freelock); 519 atomic_set(&zp->allocated, 0); 520 521 - return 0; 522 } 523 524 525 static struct sk_buff* 526 mempool_zone_get_skb(struct mempool_zone *zone) ··· 565 struct nlmsghdr *nlh; 566 struct sk_buff *skb; 567 struct iscsi_uevent *ev; 568 - struct iscsi_if_conn *conn; 569 char *pdu; 570 int len = NLMSG_SPACE(sizeof(*ev) + sizeof(struct iscsi_hdr) + 571 data_size); ··· 573 conn = iscsi_if_find_conn(connh); 574 BUG_ON(!conn); 575 576 - mempool_zone_complete(&conn->z_pdu); 577 578 - skb = mempool_zone_get_skb(&conn->z_pdu); 579 if (!skb) { 580 iscsi_conn_error(connh, ISCSI_ERR_CONN_FAILED); 581 - printk(KERN_ERR "iscsi%d: can not deliver control PDU: OOM\n", 582 - conn->host->host_no); 583 return -ENOMEM; 584 } 585 ··· 588 memset(ev, 0, sizeof(*ev)); 589 ev->transport_handle = iscsi_handle(conn->transport); 590 ev->type = ISCSI_KEVENT_RECV_PDU; 591 - if (atomic_read(&conn->z_pdu.allocated) >= conn->z_pdu.hiwat) 592 ev->iferror = -ENOMEM; 593 ev->r.recv_req.conn_handle = connh; 594 pdu = (char*)ev + sizeof(*ev); 595 memcpy(pdu, hdr, sizeof(struct iscsi_hdr)); 596 memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size); 597 598 - return iscsi_unicast_skb(&conn->z_pdu, skb); 599 } 600 EXPORT_SYMBOL_GPL(iscsi_recv_pdu); 601 ··· 604 struct nlmsghdr *nlh; 605 struct sk_buff *skb; 606 struct iscsi_uevent *ev; 607 - struct iscsi_if_conn *conn; 608 int len = NLMSG_SPACE(sizeof(*ev)); 609 610 conn = iscsi_if_find_conn(connh); 611 BUG_ON(!conn); 612 613 - mempool_zone_complete(&conn->z_error); 614 615 - skb = mempool_zone_get_skb(&conn->z_error); 616 if (!skb) { 617 - printk(KERN_ERR "iscsi%d: gracefully ignored conn error (%d)\n", 618 - conn->host->host_no, error); 619 return; 620 } 621 ··· 623 ev = NLMSG_DATA(nlh); 624 ev->transport_handle = iscsi_handle(conn->transport); 625 ev->type = ISCSI_KEVENT_CONN_ERROR; 626 - if (atomic_read(&conn->z_error.allocated) >= conn->z_error.hiwat) 627 ev->iferror = -ENOMEM; 628 ev->r.connerror.error = error; 629 ev->r.connerror.conn_handle = connh; 630 631 - iscsi_unicast_skb(&conn->z_error, skb); 632 633 - printk(KERN_INFO "iscsi%d: detected conn error (%d)\n", 634 - conn->host->host_no, error); 635 } 636 EXPORT_SYMBOL_GPL(iscsi_conn_error); 637 ··· 645 int flags = multi ? NLM_F_MULTI : 0; 646 int t = done ? NLMSG_DONE : type; 647 648 - mempool_zone_complete(&z_reply); 649 650 - skb = mempool_zone_get_skb(&z_reply); 651 /* 652 * FIXME: 653 * user is supposed to react on iferror == -ENOMEM; ··· 658 nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0); 659 nlh->nlmsg_flags = flags; 660 memcpy(NLMSG_DATA(nlh), payload, size); 661 - return iscsi_unicast_skb(&z_reply, skb); 662 - } 663 - 664 - /* 665 - * iSCSI Session's hostdata organization: 666 - * 667 - * *------------------* <== host->hostdata 668 - * | transport | 669 - * |------------------| <== iscsi_hostdata(host->hostdata) 670 - * | transport's data | 671 - * |------------------| <== hostdata_session(host->hostdata) 672 - * | interface's data | 673 - * *------------------* 674 - */ 675 - 676 - #define hostdata_privsize(_t) (sizeof(unsigned long) + _t->hostdata_size + \ 677 - _t->hostdata_size % sizeof(unsigned long) + \ 678 - sizeof(struct iscsi_if_session)) 679 - 680 - #define hostdata_session(_hostdata) ((void*)_hostdata + sizeof(unsigned long) + \ 681 - ((struct iscsi_transport *) \ 682 - iscsi_ptr(*(uint64_t *)_hostdata))->hostdata_size) 683 - 684 - static void iscsi_if_session_dev_release(struct device *dev) 685 - { 686 - struct iscsi_if_session *session = iscsi_dev_to_if_session(dev); 687 - struct iscsi_transport *transport = session->transport; 688 - struct Scsi_Host *shost = iscsi_if_session_to_shost(session); 689 - struct iscsi_if_conn *conn, *tmp; 690 - unsigned long flags; 691 - 692 - /* now free connections */ 693 - spin_lock_irqsave(&connlock, flags); 694 - list_for_each_entry_safe(conn, tmp, &session->connections, 695 - session_list) { 696 - list_del(&conn->session_list); 697 - mempool_destroy(conn->z_pdu.pool); 698 - mempool_destroy(conn->z_error.pool); 699 - kfree(conn); 700 - } 701 - spin_unlock_irqrestore(&connlock, flags); 702 - scsi_host_put(shost); 703 - module_put(transport->owner); 704 - } 705 - 706 - static int 707 - iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_uevent *ev) 708 - { 709 - struct iscsi_transport *transport = priv->iscsi_transport; 710 - struct iscsi_if_session *session; 711 - struct Scsi_Host *shost; 712 - unsigned long flags; 713 - int error; 714 - 715 - if (!try_module_get(transport->owner)) 716 - return -EPERM; 717 - 718 - shost = scsi_host_alloc(transport->host_template, 719 - hostdata_privsize(transport)); 720 - if (!shost) { 721 - ev->r.c_session_ret.session_handle = iscsi_handle(NULL); 722 - printk(KERN_ERR "iscsi: can not allocate SCSI host for " 723 - "session\n"); 724 - error = -ENOMEM; 725 - goto out_module_put; 726 - } 727 - shost->max_id = 1; 728 - shost->max_channel = 0; 729 - shost->max_lun = transport->max_lun; 730 - shost->max_cmd_len = transport->max_cmd_len; 731 - shost->transportt = &priv->t; 732 - 733 - /* store struct iscsi_transport in hostdata */ 734 - *(uint64_t*)shost->hostdata = ev->transport_handle; 735 - 736 - ev->r.c_session_ret.session_handle = transport->create_session( 737 - ev->u.c_session.initial_cmdsn, shost); 738 - if (ev->r.c_session_ret.session_handle == iscsi_handle(NULL)) { 739 - error = 0; 740 - goto out_host_put; 741 - } 742 - 743 - /* host_no becomes assigned SID */ 744 - ev->r.c_session_ret.sid = shost->host_no; 745 - /* initialize session */ 746 - session = hostdata_session(shost->hostdata); 747 - INIT_LIST_HEAD(&session->connections); 748 - INIT_LIST_HEAD(&session->list); 749 - session->sessionh = ev->r.c_session_ret.session_handle; 750 - session->transport = transport; 751 - 752 - error = scsi_add_host(shost, NULL); 753 - if (error) 754 - goto out_destroy_session; 755 - 756 - /* 757 - * this is released in the dev's release function) 758 - */ 759 - scsi_host_get(shost); 760 - snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u", shost->host_no); 761 - session->dev.parent = &shost->shost_gendev; 762 - session->dev.release = iscsi_if_session_dev_release; 763 - error = device_register(&session->dev); 764 - if (error) { 765 - printk(KERN_ERR "iscsi: could not register session%d's dev\n", 766 - shost->host_no); 767 - goto out_remove_host; 768 - } 769 - transport_register_device(&session->dev); 770 - 771 - /* add this session to the list of active sessions */ 772 - spin_lock_irqsave(&priv->session_lock, flags); 773 - list_add(&session->list, &priv->sessions); 774 - spin_unlock_irqrestore(&priv->session_lock, flags); 775 - 776 - return 0; 777 - 778 - out_remove_host: 779 - scsi_remove_host(shost); 780 - out_destroy_session: 781 - transport->destroy_session(ev->r.c_session_ret.session_handle); 782 - ev->r.c_session_ret.session_handle = iscsi_handle(NULL); 783 - out_host_put: 784 - scsi_host_put(shost); 785 - out_module_put: 786 - module_put(transport->owner); 787 - return error; 788 - } 789 - 790 - static int 791 - iscsi_if_destroy_session(struct iscsi_internal *priv, struct iscsi_uevent *ev) 792 - { 793 - struct iscsi_transport *transport = priv->iscsi_transport; 794 - struct Scsi_Host *shost; 795 - struct iscsi_if_session *session; 796 - unsigned long flags; 797 - struct iscsi_if_conn *conn; 798 - int error = 0; 799 - 800 - shost = scsi_host_lookup(ev->u.d_session.sid); 801 - if (shost == ERR_PTR(-ENXIO)) 802 - return -EEXIST; 803 - session = hostdata_session(shost->hostdata); 804 - 805 - /* check if we have active connections */ 806 - spin_lock_irqsave(&connlock, flags); 807 - list_for_each_entry(conn, &session->connections, session_list) { 808 - if (conn->active) { 809 - printk(KERN_ERR "iscsi%d: can not destroy session: " 810 - "has active connection (%p)\n", 811 - shost->host_no, iscsi_ptr(conn->connh)); 812 - spin_unlock_irqrestore(&connlock, flags); 813 - error = EIO; 814 - goto out_release_ref; 815 - } 816 - } 817 - spin_unlock_irqrestore(&connlock, flags); 818 - 819 - scsi_remove_host(shost); 820 - transport->destroy_session(ev->u.d_session.session_handle); 821 - transport_unregister_device(&session->dev); 822 - device_unregister(&session->dev); 823 - 824 - /* remove this session from the list of active sessions */ 825 - spin_lock_irqsave(&priv->session_lock, flags); 826 - list_del(&session->list); 827 - spin_unlock_irqrestore(&priv->session_lock, flags); 828 - 829 - /* ref from host alloc */ 830 - scsi_host_put(shost); 831 - out_release_ref: 832 - /* ref from host lookup */ 833 - scsi_host_put(shost); 834 - return error; 835 - } 836 - 837 - static void iscsi_if_conn_dev_release(struct device *dev) 838 - { 839 - struct iscsi_if_conn *conn = iscsi_dev_to_if_conn(dev); 840 - struct Scsi_Host *shost = conn->host; 841 - 842 - scsi_host_put(shost); 843 - } 844 - 845 - static int 846 - iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) 847 - { 848 - struct iscsi_if_session *session; 849 - struct Scsi_Host *shost; 850 - struct iscsi_if_conn *conn; 851 - unsigned long flags; 852 - int error; 853 - 854 - shost = scsi_host_lookup(ev->u.c_conn.sid); 855 - if (shost == ERR_PTR(-ENXIO)) 856 - return -EEXIST; 857 - session = hostdata_session(shost->hostdata); 858 - 859 - conn = kmalloc(sizeof(struct iscsi_if_conn), GFP_KERNEL); 860 - if (!conn) { 861 - error = -ENOMEM; 862 - goto out_release_ref; 863 - } 864 - memset(conn, 0, sizeof(struct iscsi_if_conn)); 865 - INIT_LIST_HEAD(&conn->session_list); 866 - INIT_LIST_HEAD(&conn->conn_list); 867 - conn->host = shost; 868 - conn->transport = transport; 869 - 870 - error = mempool_zone_init(&conn->z_pdu, Z_MAX_PDU, 871 - NLMSG_SPACE(sizeof(struct iscsi_uevent) + 872 - sizeof(struct iscsi_hdr) + 873 - DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH), 874 - Z_HIWAT_PDU); 875 - if (error) { 876 - printk(KERN_ERR "iscsi%d: can not allocate pdu zone for new " 877 - "conn\n", shost->host_no); 878 - goto out_free_conn; 879 - } 880 - error = mempool_zone_init(&conn->z_error, Z_MAX_ERROR, 881 - NLMSG_SPACE(sizeof(struct iscsi_uevent)), 882 - Z_HIWAT_ERROR); 883 - if (error) { 884 - printk(KERN_ERR "iscsi%d: can not allocate error zone for " 885 - "new conn\n", shost->host_no); 886 - goto out_free_pdu_pool; 887 - } 888 - 889 - ev->r.handle = transport->create_conn(ev->u.c_conn.session_handle, 890 - ev->u.c_conn.cid); 891 - if (!ev->r.handle) { 892 - error = -ENODEV; 893 - goto out_free_error_pool; 894 - } 895 - 896 - conn->connh = ev->r.handle; 897 - 898 - /* 899 - * this is released in the dev's release function 900 - */ 901 - if (!scsi_host_get(shost)) 902 - goto out_destroy_conn; 903 - snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u", 904 - shost->host_no, ev->u.c_conn.cid); 905 - conn->dev.parent = &session->dev; 906 - conn->dev.release = iscsi_if_conn_dev_release; 907 - error = device_register(&conn->dev); 908 - if (error) { 909 - printk(KERN_ERR "iscsi%d: could not register connections%u " 910 - "dev\n", shost->host_no, ev->u.c_conn.cid); 911 - goto out_release_parent_ref; 912 - } 913 - transport_register_device(&conn->dev); 914 - 915 - spin_lock_irqsave(&connlock, flags); 916 - list_add(&conn->conn_list, &connlist); 917 - list_add(&conn->session_list, &session->connections); 918 - conn->active = 1; 919 - spin_unlock_irqrestore(&connlock, flags); 920 - 921 - scsi_host_put(shost); 922 - return 0; 923 - 924 - out_release_parent_ref: 925 - scsi_host_put(shost); 926 - out_destroy_conn: 927 - transport->destroy_conn(ev->r.handle); 928 - out_free_error_pool: 929 - mempool_destroy(conn->z_error.pool); 930 - out_free_pdu_pool: 931 - mempool_destroy(conn->z_pdu.pool); 932 - out_free_conn: 933 - kfree(conn); 934 - out_release_ref: 935 - scsi_host_put(shost); 936 - return error; 937 - } 938 - 939 - static int 940 - iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) 941 - { 942 - unsigned long flags; 943 - struct iscsi_if_conn *conn; 944 - 945 - conn = iscsi_if_find_conn(ev->u.d_conn.conn_handle); 946 - if (!conn) 947 - return -EEXIST; 948 - 949 - transport->destroy_conn(ev->u.d_conn.conn_handle); 950 - 951 - spin_lock_irqsave(&connlock, flags); 952 - conn->active = 0; 953 - list_del(&conn->conn_list); 954 - spin_unlock_irqrestore(&connlock, flags); 955 - 956 - transport_unregister_device(&conn->dev); 957 - device_unregister(&conn->dev); 958 - return 0; 959 } 960 961 static int ··· 668 struct iscsi_uevent *ev = NLMSG_DATA(nlh); 669 struct iscsi_stats *stats; 670 struct sk_buff *skbstat; 671 - struct iscsi_if_conn *conn; 672 struct nlmsghdr *nlhstat; 673 struct iscsi_uevent *evstat; 674 int len = NLMSG_SPACE(sizeof(*ev) + ··· 684 do { 685 int actual_size; 686 687 - mempool_zone_complete(&conn->z_pdu); 688 689 - skbstat = mempool_zone_get_skb(&conn->z_pdu); 690 if (!skbstat) { 691 - printk(KERN_ERR "iscsi%d: can not deliver stats: OOM\n", 692 - conn->host->host_no); 693 return -ENOMEM; 694 } 695 ··· 699 memset(evstat, 0, sizeof(*evstat)); 700 evstat->transport_handle = iscsi_handle(conn->transport); 701 evstat->type = nlh->nlmsg_type; 702 - if (atomic_read(&conn->z_pdu.allocated) >= conn->z_pdu.hiwat) 703 evstat->iferror = -ENOMEM; 704 evstat->u.get_stats.conn_handle = 705 ev->u.get_stats.conn_handle; ··· 717 skb_trim(skb, NLMSG_ALIGN(actual_size)); 718 nlhstat->nlmsg_len = actual_size; 719 720 - err = iscsi_unicast_skb(&conn->z_pdu, skbstat); 721 } while (err < 0 && err != -ECONNREFUSED); 722 723 return err; 724 } 725 726 static int ··· 938 { 939 struct sk_buff *skb; 940 941 - down(&rx_queue_sema); 942 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { 943 while (skb->len >= NLMSG_SPACE(0)) { 944 int err; ··· 972 err = iscsi_if_send_reply( 973 NETLINK_CREDS(skb)->pid, nlh->nlmsg_seq, 974 nlh->nlmsg_type, 0, 0, ev, sizeof(*ev)); 975 - if (atomic_read(&z_reply.allocated) >= 976 - z_reply.hiwat) 977 ev->iferror = -ENOMEM; 978 } while (err < 0 && err != -ECONNREFUSED); 979 skb_pull(skb, rlen); 980 } 981 kfree_skb(skb); 982 } 983 - up(&rx_queue_sema); 984 } 985 986 /* 987 * iSCSI connection attrs ··· 994 show_conn_int_param_##param(struct class_device *cdev, char *buf) \ 995 { \ 996 uint32_t value = 0; \ 997 - struct iscsi_if_conn *conn = iscsi_cdev_to_if_conn(cdev); \ 998 - struct iscsi_internal *priv; \ 999 \ 1000 - priv = to_iscsi_internal(conn->host->transportt); \ 1001 - if (priv->param_mask & (1 << param)) \ 1002 - priv->iscsi_transport->get_param(conn->connh, param, &value); \ 1003 return snprintf(buf, 20, format"\n", value); \ 1004 } 1005 ··· 1012 iscsi_conn_int_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN, "%d"); 1013 iscsi_conn_int_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN, "%d"); 1014 1015 /* 1016 * iSCSI session attrs 1017 */ ··· 1023 show_session_int_param_##param(struct class_device *cdev, char *buf) \ 1024 { \ 1025 uint32_t value = 0; \ 1026 - struct iscsi_if_session *session = iscsi_cdev_to_if_session(cdev); \ 1027 - struct Scsi_Host *shost = iscsi_if_session_to_shost(session); \ 1028 - struct iscsi_internal *priv = to_iscsi_internal(shost->transportt); \ 1029 - struct iscsi_if_conn *conn = NULL; \ 1030 - unsigned long flags; \ 1031 \ 1032 - spin_lock_irqsave(&connlock, flags); \ 1033 - if (!list_empty(&session->connections)) \ 1034 - conn = list_entry(session->connections.next, \ 1035 - struct iscsi_if_conn, session_list); \ 1036 - spin_unlock_irqrestore(&connlock, flags); \ 1037 - \ 1038 - if (conn && (priv->param_mask & (1 << param))) \ 1039 - priv->iscsi_transport->get_param(conn->connh, param, &value);\ 1040 return snprintf(buf, 20, format"\n", value); \ 1041 } 1042 ··· 1056 count++; \ 1057 } 1058 1059 - static int iscsi_is_session_dev(const struct device *dev) 1060 - { 1061 - return dev->release == iscsi_if_session_dev_release; 1062 - } 1063 - 1064 static int iscsi_session_match(struct attribute_container *cont, 1065 struct device *dev) 1066 { 1067 - struct iscsi_if_session *session; 1068 struct Scsi_Host *shost; 1069 struct iscsi_internal *priv; 1070 1071 if (!iscsi_is_session_dev(dev)) 1072 return 0; 1073 1074 - session = iscsi_dev_to_if_session(dev); 1075 - shost = iscsi_if_session_to_shost(session); 1076 if (!shost->transportt) 1077 return 0; 1078 ··· 1078 return &priv->session_cont.ac == cont; 1079 } 1080 1081 - static int iscsi_is_conn_dev(const struct device *dev) 1082 - { 1083 - return dev->release == iscsi_if_conn_dev_release; 1084 - } 1085 - 1086 static int iscsi_conn_match(struct attribute_container *cont, 1087 struct device *dev) 1088 { 1089 - struct iscsi_if_conn *conn; 1090 struct Scsi_Host *shost; 1091 struct iscsi_internal *priv; 1092 1093 if (!iscsi_is_conn_dev(dev)) 1094 return 0; 1095 1096 - conn = iscsi_dev_to_if_conn(dev); 1097 - shost = conn->host; 1098 if (!shost->transportt) 1099 return 0; 1100 ··· 1103 return &priv->conn_cont.ac == cont; 1104 } 1105 1106 - int iscsi_register_transport(struct iscsi_transport *tt) 1107 { 1108 struct iscsi_internal *priv; 1109 unsigned long flags; ··· 1114 1115 priv = iscsi_if_transport_lookup(tt); 1116 if (priv) 1117 - return -EEXIST; 1118 1119 priv = kmalloc(sizeof(*priv), GFP_KERNEL); 1120 if (!priv) 1121 - return -ENOMEM; 1122 memset(priv, 0, sizeof(*priv)); 1123 INIT_LIST_HEAD(&priv->list); 1124 INIT_LIST_HEAD(&priv->sessions); 1125 - spin_lock_init(&priv->session_lock); 1126 priv->iscsi_transport = tt; 1127 1128 priv->cdev.class = &iscsi_transport_class; ··· 1187 spin_unlock_irqrestore(&iscsi_transport_lock, flags); 1188 1189 printk(KERN_NOTICE "iscsi: registered transport (%s)\n", tt->name); 1190 - return 0; 1191 1192 unregister_cdev: 1193 class_device_unregister(&priv->cdev); 1194 free_priv: 1195 kfree(priv); 1196 - return err; 1197 } 1198 EXPORT_SYMBOL_GPL(iscsi_register_transport); 1199 ··· 1204 1205 BUG_ON(!tt); 1206 1207 - down(&rx_queue_sema); 1208 1209 priv = iscsi_if_transport_lookup(tt); 1210 BUG_ON (!priv); 1211 - 1212 - spin_lock_irqsave(&priv->session_lock, flags); 1213 - if (!list_empty(&priv->sessions)) { 1214 - spin_unlock_irqrestore(&priv->session_lock, flags); 1215 - up(&rx_queue_sema); 1216 - return -EPERM; 1217 - } 1218 - spin_unlock_irqrestore(&priv->session_lock, flags); 1219 1220 spin_lock_irqsave(&iscsi_transport_lock, flags); 1221 list_del(&priv->list); ··· 1218 1219 sysfs_remove_group(&priv->cdev.kobj, &iscsi_transport_group); 1220 class_device_unregister(&priv->cdev); 1221 - up(&rx_queue_sema); 1222 1223 return 0; 1224 } ··· 1231 1232 if (event == NETLINK_URELEASE && 1233 n->protocol == NETLINK_ISCSI && n->pid) { 1234 - struct iscsi_if_conn *conn; 1235 unsigned long flags; 1236 1237 - mempool_zone_complete(&z_reply); 1238 spin_lock_irqsave(&connlock, flags); 1239 list_for_each_entry(conn, &connlist, conn_list) { 1240 - mempool_zone_complete(&conn->z_error); 1241 - mempool_zone_complete(&conn->z_pdu); 1242 } 1243 spin_unlock_irqrestore(&connlock, flags); 1244 } ··· 1271 goto unregister_session_class; 1272 1273 nls = netlink_kernel_create(NETLINK_ISCSI, 1, iscsi_if_rx, 1274 - THIS_MODULE); 1275 if (!nls) { 1276 err = -ENOBUFS; 1277 goto unregister_notifier; 1278 } 1279 1280 - err = mempool_zone_init(&z_reply, Z_MAX_REPLY, 1281 NLMSG_SPACE(sizeof(struct iscsi_uevent)), Z_HIWAT_REPLY); 1282 - if (!err) 1283 return 0; 1284 1285 sock_release(nls->sk_socket); ··· 1296 1297 static void __exit iscsi_transport_exit(void) 1298 { 1299 - mempool_destroy(z_reply.pool); 1300 sock_release(nls->sk_socket); 1301 netlink_unregister_notifier(&iscsi_nl_notifier); 1302 transport_class_unregister(&iscsi_connection_class);
··· 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 */ 23 #include <linux/module.h> 24 #include <linux/mempool.h> 25 + #include <linux/mutex.h> 26 #include <net/tcp.h> 27 #include <scsi/scsi.h> 28 #include <scsi/scsi_host.h> 29 #include <scsi/scsi_device.h> ··· 44 * List of sessions for this transport 45 */ 46 struct list_head sessions; 47 /* 48 * based on transport capabilities, at register time we set these 49 * bits to tell the transport class it wants attributes displayed ··· 70 /* 71 * list of registered transports and lock that must 72 * be held while accessing list. The iscsi_transport_lock must 73 + * be acquired after the rx_queue_mutex. 74 */ 75 static LIST_HEAD(iscsi_transports); 76 static DEFINE_SPINLOCK(iscsi_transport_lock); ··· 145 146 static struct sock *nls; 147 static int daemon_pid; 148 + static DEFINE_MUTEX(rx_queue_mutex); 149 150 struct mempool_zone { 151 mempool_t *pool; ··· 156 spinlock_t freelock; 157 }; 158 159 + static struct mempool_zone *z_reply; 160 161 /* 162 * Z_MAX_* - actual mempool size allocated at the mempool_zone_init() time ··· 171 #define Z_MAX_ERROR 16 172 #define Z_HIWAT_ERROR 12 173 174 static LIST_HEAD(connlist); 175 static DEFINE_SPINLOCK(connlock); 176 177 + /* 178 + * The following functions can be used by LLDs that allocate 179 + * their own scsi_hosts or by software iscsi LLDs 180 + */ 181 + static void iscsi_session_release(struct device *dev) 182 + { 183 + struct iscsi_cls_session *session = iscsi_dev_to_session(dev); 184 + struct iscsi_transport *transport = session->transport; 185 + struct Scsi_Host *shost; 186 187 + shost = iscsi_session_to_shost(session); 188 + scsi_host_put(shost); 189 + kfree(session); 190 + module_put(transport->owner); 191 + } 192 193 + static int iscsi_is_session_dev(const struct device *dev) 194 + { 195 + return dev->release == iscsi_session_release; 196 + } 197 198 + /** 199 + * iscsi_create_session - create iscsi class session 200 + * @shost: scsi host 201 + * @transport: iscsi transport 202 + * 203 + * This can be called from a LLD or iscsi_transport 204 + **/ 205 + struct iscsi_cls_session * 206 + iscsi_create_session(struct Scsi_Host *shost, struct iscsi_transport *transport) 207 + { 208 + struct iscsi_cls_session *session; 209 + int err; 210 211 + if (!try_module_get(transport->owner)) 212 + return NULL; 213 + 214 + session = kzalloc(sizeof(*session), GFP_KERNEL); 215 + if (!session) 216 + goto module_put; 217 + session->transport = transport; 218 + 219 + /* this is released in the dev's release function */ 220 + scsi_host_get(shost); 221 + snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u", shost->host_no); 222 + session->dev.parent = &shost->shost_gendev; 223 + session->dev.release = iscsi_session_release; 224 + err = device_register(&session->dev); 225 + if (err) { 226 + dev_printk(KERN_ERR, &session->dev, "iscsi: could not " 227 + "register session's dev\n"); 228 + goto free_session; 229 + } 230 + transport_register_device(&session->dev); 231 + 232 + return session; 233 + 234 + free_session: 235 + kfree(session); 236 + module_put: 237 + module_put(transport->owner); 238 + return NULL; 239 + } 240 + 241 + EXPORT_SYMBOL_GPL(iscsi_create_session); 242 + 243 + /** 244 + * iscsi_destroy_session - destroy iscsi session 245 + * @session: iscsi_session 246 + * 247 + * Can be called by a LLD or iscsi_transport. There must not be 248 + * any running connections. 249 + **/ 250 + int iscsi_destroy_session(struct iscsi_cls_session *session) 251 + { 252 + transport_unregister_device(&session->dev); 253 + device_unregister(&session->dev); 254 + return 0; 255 + } 256 + 257 + EXPORT_SYMBOL_GPL(iscsi_destroy_session); 258 + 259 + static void iscsi_conn_release(struct device *dev) 260 + { 261 + struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev); 262 + struct device *parent = conn->dev.parent; 263 + 264 + kfree(conn); 265 + put_device(parent); 266 + } 267 + 268 + static int iscsi_is_conn_dev(const struct device *dev) 269 + { 270 + return dev->release == iscsi_conn_release; 271 + } 272 + 273 + /** 274 + * iscsi_create_conn - create iscsi class connection 275 + * @session: iscsi cls session 276 + * @cid: connection id 277 + * 278 + * This can be called from a LLD or iscsi_transport. The connection 279 + * is child of the session so cid must be unique for all connections 280 + * on the session. 281 + **/ 282 + struct iscsi_cls_conn * 283 + iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid) 284 + { 285 + struct iscsi_transport *transport = session->transport; 286 + struct Scsi_Host *shost = iscsi_session_to_shost(session); 287 + struct iscsi_cls_conn *conn; 288 + int err; 289 + 290 + conn = kzalloc(sizeof(*conn) + transport->conndata_size, GFP_KERNEL); 291 + if (!conn) 292 + return NULL; 293 + 294 + if (transport->conndata_size) 295 + conn->dd_data = &conn[1]; 296 + 297 + INIT_LIST_HEAD(&conn->conn_list); 298 + conn->transport = transport; 299 + 300 + /* this is released in the dev's release function */ 301 + if (!get_device(&session->dev)) 302 + goto free_conn; 303 + snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u", 304 + shost->host_no, cid); 305 + conn->dev.parent = &session->dev; 306 + conn->dev.release = iscsi_conn_release; 307 + err = device_register(&conn->dev); 308 + if (err) { 309 + dev_printk(KERN_ERR, &conn->dev, "iscsi: could not register " 310 + "connection's dev\n"); 311 + goto release_parent_ref; 312 + } 313 + transport_register_device(&conn->dev); 314 + return conn; 315 + 316 + release_parent_ref: 317 + put_device(&session->dev); 318 + free_conn: 319 + kfree(conn); 320 + return NULL; 321 + } 322 + 323 + EXPORT_SYMBOL_GPL(iscsi_create_conn); 324 + 325 + /** 326 + * iscsi_destroy_conn - destroy iscsi class connection 327 + * @session: iscsi cls session 328 + * 329 + * This can be called from a LLD or iscsi_transport. 330 + **/ 331 + int iscsi_destroy_conn(struct iscsi_cls_conn *conn) 332 + { 333 + transport_unregister_device(&conn->dev); 334 + device_unregister(&conn->dev); 335 + return 0; 336 + } 337 + 338 + EXPORT_SYMBOL_GPL(iscsi_destroy_conn); 339 + 340 + /* 341 + * These functions are used only by software iscsi_transports 342 + * which do not allocate and more their scsi_hosts since this 343 + * is initiated from userspace. 344 + */ 345 + 346 + /* 347 + * iSCSI Session's hostdata organization: 348 + * 349 + * *------------------* <== hostdata_session(host->hostdata) 350 + * | ptr to class sess| 351 + * |------------------| <== iscsi_hostdata(host->hostdata) 352 + * | transport's data | 353 + * *------------------* 354 + */ 355 + 356 + #define hostdata_privsize(_t) (sizeof(unsigned long) + _t->hostdata_size + \ 357 + _t->hostdata_size % sizeof(unsigned long)) 358 + 359 + #define hostdata_session(_hostdata) (iscsi_ptr(*(unsigned long *)_hostdata)) 360 + 361 + /** 362 + * iscsi_transport_create_session - create iscsi cls session and host 363 + * scsit: scsi transport template 364 + * transport: iscsi transport template 365 + * 366 + * This can be used by software iscsi_transports that allocate 367 + * a session per scsi host. 368 + **/ 369 + struct Scsi_Host * 370 + iscsi_transport_create_session(struct scsi_transport_template *scsit, 371 + struct iscsi_transport *transport) 372 + { 373 + struct iscsi_cls_session *session; 374 + struct Scsi_Host *shost; 375 + 376 + shost = scsi_host_alloc(transport->host_template, 377 + hostdata_privsize(transport)); 378 + if (!shost) { 379 + printk(KERN_ERR "iscsi: can not allocate SCSI host for " 380 + "session\n"); 381 + return NULL; 382 + } 383 + 384 + shost->max_id = 1; 385 + shost->max_channel = 0; 386 + shost->max_lun = transport->max_lun; 387 + shost->max_cmd_len = transport->max_cmd_len; 388 + shost->transportt = scsit; 389 + shost->transportt->create_work_queue = 1; 390 + 391 + if (scsi_add_host(shost, NULL)) 392 + goto free_host; 393 + 394 + session = iscsi_create_session(shost, transport); 395 + if (!session) 396 + goto remove_host; 397 + 398 + *(unsigned long*)shost->hostdata = (unsigned long)session; 399 + return shost; 400 + 401 + remove_host: 402 + scsi_remove_host(shost); 403 + free_host: 404 + scsi_host_put(shost); 405 + return NULL; 406 + } 407 + 408 + EXPORT_SYMBOL_GPL(iscsi_transport_create_session); 409 + 410 + /** 411 + * iscsi_transport_destroy_session - destroy session and scsi host 412 + * shost: scsi host 413 + * 414 + * This can be used by software iscsi_transports that allocate 415 + * a session per scsi host. 416 + **/ 417 + int iscsi_transport_destroy_session(struct Scsi_Host *shost) 418 + { 419 + struct iscsi_cls_session *session; 420 + 421 + scsi_remove_host(shost); 422 + session = hostdata_session(shost->hostdata); 423 + iscsi_destroy_session(session); 424 + /* ref from host alloc */ 425 + scsi_host_put(shost); 426 + return 0; 427 + } 428 + 429 + EXPORT_SYMBOL_GPL(iscsi_transport_destroy_session); 430 + 431 + /* 432 + * iscsi interface functions 433 + */ 434 + static struct iscsi_cls_conn* 435 iscsi_if_find_conn(uint64_t key) 436 { 437 unsigned long flags; 438 + struct iscsi_cls_conn *conn; 439 440 spin_lock_irqsave(&connlock, flags); 441 list_for_each_entry(conn, &connlist, conn_list) ··· 249 } 250 251 static void* 252 + mempool_zone_alloc_skb(unsigned int gfp_mask, void *pool_data) 253 { 254 struct mempool_zone *zone = pool_data; 255 ··· 281 spin_unlock_irqrestore(&zone->freelock, flags); 282 } 283 284 + static struct mempool_zone * 285 + mempool_zone_init(unsigned max, unsigned size, unsigned hiwat) 286 { 287 + struct mempool_zone *zp; 288 + 289 + zp = kzalloc(sizeof(*zp), GFP_KERNEL); 290 + if (!zp) 291 + return NULL; 292 + 293 zp->pool = mempool_create(max, mempool_zone_alloc_skb, 294 mempool_zone_free_skb, zp); 295 + if (!zp->pool) { 296 + kfree(zp); 297 + return NULL; 298 + } 299 300 zp->size = size; 301 zp->hiwat = hiwat; ··· 297 spin_lock_init(&zp->freelock); 298 atomic_set(&zp->allocated, 0); 299 300 + return zp; 301 } 302 303 + static void mempool_zone_destroy(struct mempool_zone *zp) 304 + { 305 + mempool_destroy(zp->pool); 306 + kfree(zp); 307 + } 308 309 static struct sk_buff* 310 mempool_zone_get_skb(struct mempool_zone *zone) ··· 339 struct nlmsghdr *nlh; 340 struct sk_buff *skb; 341 struct iscsi_uevent *ev; 342 + struct iscsi_cls_conn *conn; 343 char *pdu; 344 int len = NLMSG_SPACE(sizeof(*ev) + sizeof(struct iscsi_hdr) + 345 data_size); ··· 347 conn = iscsi_if_find_conn(connh); 348 BUG_ON(!conn); 349 350 + mempool_zone_complete(conn->z_pdu); 351 352 + skb = mempool_zone_get_skb(conn->z_pdu); 353 if (!skb) { 354 iscsi_conn_error(connh, ISCSI_ERR_CONN_FAILED); 355 + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not deliver " 356 + "control PDU: OOM\n"); 357 return -ENOMEM; 358 } 359 ··· 362 memset(ev, 0, sizeof(*ev)); 363 ev->transport_handle = iscsi_handle(conn->transport); 364 ev->type = ISCSI_KEVENT_RECV_PDU; 365 + if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat) 366 ev->iferror = -ENOMEM; 367 ev->r.recv_req.conn_handle = connh; 368 pdu = (char*)ev + sizeof(*ev); 369 memcpy(pdu, hdr, sizeof(struct iscsi_hdr)); 370 memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size); 371 372 + return iscsi_unicast_skb(conn->z_pdu, skb); 373 } 374 EXPORT_SYMBOL_GPL(iscsi_recv_pdu); 375 ··· 378 struct nlmsghdr *nlh; 379 struct sk_buff *skb; 380 struct iscsi_uevent *ev; 381 + struct iscsi_cls_conn *conn; 382 int len = NLMSG_SPACE(sizeof(*ev)); 383 384 conn = iscsi_if_find_conn(connh); 385 BUG_ON(!conn); 386 387 + mempool_zone_complete(conn->z_error); 388 389 + skb = mempool_zone_get_skb(conn->z_error); 390 if (!skb) { 391 + dev_printk(KERN_ERR, &conn->dev, "iscsi: gracefully ignored " 392 + "conn error (%d)\n", error); 393 return; 394 } 395 ··· 397 ev = NLMSG_DATA(nlh); 398 ev->transport_handle = iscsi_handle(conn->transport); 399 ev->type = ISCSI_KEVENT_CONN_ERROR; 400 + if (atomic_read(&conn->z_error->allocated) >= conn->z_error->hiwat) 401 ev->iferror = -ENOMEM; 402 ev->r.connerror.error = error; 403 ev->r.connerror.conn_handle = connh; 404 405 + iscsi_unicast_skb(conn->z_error, skb); 406 407 + dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n", 408 + error); 409 } 410 EXPORT_SYMBOL_GPL(iscsi_conn_error); 411 ··· 419 int flags = multi ? NLM_F_MULTI : 0; 420 int t = done ? NLMSG_DONE : type; 421 422 + mempool_zone_complete(z_reply); 423 424 + skb = mempool_zone_get_skb(z_reply); 425 /* 426 * FIXME: 427 * user is supposed to react on iferror == -ENOMEM; ··· 432 nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0); 433 nlh->nlmsg_flags = flags; 434 memcpy(NLMSG_DATA(nlh), payload, size); 435 + return iscsi_unicast_skb(z_reply, skb); 436 } 437 438 static int ··· 739 struct iscsi_uevent *ev = NLMSG_DATA(nlh); 740 struct iscsi_stats *stats; 741 struct sk_buff *skbstat; 742 + struct iscsi_cls_conn *conn; 743 struct nlmsghdr *nlhstat; 744 struct iscsi_uevent *evstat; 745 int len = NLMSG_SPACE(sizeof(*ev) + ··· 755 do { 756 int actual_size; 757 758 + mempool_zone_complete(conn->z_pdu); 759 760 + skbstat = mempool_zone_get_skb(conn->z_pdu); 761 if (!skbstat) { 762 + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not " 763 + "deliver stats: OOM\n"); 764 return -ENOMEM; 765 } 766 ··· 770 memset(evstat, 0, sizeof(*evstat)); 771 evstat->transport_handle = iscsi_handle(conn->transport); 772 evstat->type = nlh->nlmsg_type; 773 + if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat) 774 evstat->iferror = -ENOMEM; 775 evstat->u.get_stats.conn_handle = 776 ev->u.get_stats.conn_handle; ··· 788 skb_trim(skb, NLMSG_ALIGN(actual_size)); 789 nlhstat->nlmsg_len = actual_size; 790 791 + err = iscsi_unicast_skb(conn->z_pdu, skbstat); 792 } while (err < 0 && err != -ECONNREFUSED); 793 794 return err; 795 + } 796 + 797 + static int 798 + iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_uevent *ev) 799 + { 800 + struct iscsi_transport *transport = priv->iscsi_transport; 801 + struct Scsi_Host *shost; 802 + 803 + if (!transport->create_session) 804 + return -EINVAL; 805 + 806 + shost = transport->create_session(&priv->t, 807 + ev->u.c_session.initial_cmdsn); 808 + if (!shost) 809 + return -ENOMEM; 810 + 811 + ev->r.c_session_ret.session_handle = iscsi_handle(iscsi_hostdata(shost->hostdata)); 812 + ev->r.c_session_ret.sid = shost->host_no; 813 + return 0; 814 + } 815 + 816 + static int 817 + iscsi_if_destroy_session(struct iscsi_internal *priv, struct iscsi_uevent *ev) 818 + { 819 + struct iscsi_transport *transport = priv->iscsi_transport; 820 + 821 + struct Scsi_Host *shost; 822 + 823 + if (!transport->destroy_session) 824 + return -EINVAL; 825 + 826 + shost = scsi_host_lookup(ev->u.d_session.sid); 827 + if (shost == ERR_PTR(-ENXIO)) 828 + return -EEXIST; 829 + 830 + if (transport->destroy_session) 831 + transport->destroy_session(shost); 832 + /* ref from host lookup */ 833 + scsi_host_put(shost); 834 + return 0; 835 + } 836 + 837 + static int 838 + iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev){ 839 + struct Scsi_Host *shost; 840 + struct iscsi_cls_conn *conn; 841 + unsigned long flags; 842 + 843 + if (!transport->create_conn) 844 + return -EINVAL; 845 + 846 + shost = scsi_host_lookup(ev->u.c_conn.sid); 847 + if (shost == ERR_PTR(-ENXIO)) 848 + return -EEXIST; 849 + 850 + conn = transport->create_conn(shost, ev->u.c_conn.cid); 851 + if (!conn) 852 + goto release_ref; 853 + 854 + conn->z_pdu = mempool_zone_init(Z_MAX_PDU, 855 + NLMSG_SPACE(sizeof(struct iscsi_uevent) + 856 + sizeof(struct iscsi_hdr) + 857 + DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH), 858 + Z_HIWAT_PDU); 859 + if (!conn->z_pdu) { 860 + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate " 861 + "pdu zone for new conn\n"); 862 + goto destroy_conn; 863 + } 864 + 865 + conn->z_error = mempool_zone_init(Z_MAX_ERROR, 866 + NLMSG_SPACE(sizeof(struct iscsi_uevent)), 867 + Z_HIWAT_ERROR); 868 + if (!conn->z_error) { 869 + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate " 870 + "error zone for new conn\n"); 871 + goto free_pdu_pool; 872 + } 873 + 874 + ev->r.handle = conn->connh = iscsi_handle(conn->dd_data); 875 + 876 + spin_lock_irqsave(&connlock, flags); 877 + list_add(&conn->conn_list, &connlist); 878 + conn->active = 1; 879 + spin_unlock_irqrestore(&connlock, flags); 880 + 881 + scsi_host_put(shost); 882 + return 0; 883 + 884 + free_pdu_pool: 885 + mempool_zone_destroy(conn->z_pdu); 886 + destroy_conn: 887 + if (transport->destroy_conn) 888 + transport->destroy_conn(conn->dd_data); 889 + release_ref: 890 + scsi_host_put(shost); 891 + return -ENOMEM; 892 + } 893 + 894 + static int 895 + iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) 896 + { 897 + unsigned long flags; 898 + struct iscsi_cls_conn *conn; 899 + struct mempool_zone *z_error, *z_pdu; 900 + 901 + conn = iscsi_if_find_conn(ev->u.d_conn.conn_handle); 902 + if (!conn) 903 + return -EEXIST; 904 + 905 + if (!transport->destroy_conn) 906 + return -EINVAL; 907 + 908 + spin_lock_irqsave(&connlock, flags); 909 + conn->active = 0; 910 + list_del(&conn->conn_list); 911 + spin_unlock_irqrestore(&connlock, flags); 912 + 913 + z_pdu = conn->z_pdu; 914 + z_error = conn->z_error; 915 + 916 + if (transport->destroy_conn) 917 + transport->destroy_conn(conn); 918 + 919 + mempool_zone_destroy(z_pdu); 920 + mempool_zone_destroy(z_error); 921 + 922 + return 0; 923 } 924 925 static int ··· 881 { 882 struct sk_buff *skb; 883 884 + mutex_lock(&rx_queue_mutex); 885 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { 886 while (skb->len >= NLMSG_SPACE(0)) { 887 int err; ··· 915 err = iscsi_if_send_reply( 916 NETLINK_CREDS(skb)->pid, nlh->nlmsg_seq, 917 nlh->nlmsg_type, 0, 0, ev, sizeof(*ev)); 918 + if (atomic_read(&z_reply->allocated) >= 919 + z_reply->hiwat) 920 ev->iferror = -ENOMEM; 921 } while (err < 0 && err != -ECONNREFUSED); 922 skb_pull(skb, rlen); 923 } 924 kfree_skb(skb); 925 } 926 + mutex_unlock(&rx_queue_mutex); 927 } 928 + 929 + #define iscsi_cdev_to_conn(_cdev) \ 930 + iscsi_dev_to_conn(_cdev->dev) 931 932 /* 933 * iSCSI connection attrs ··· 934 show_conn_int_param_##param(struct class_device *cdev, char *buf) \ 935 { \ 936 uint32_t value = 0; \ 937 + struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev); \ 938 + struct iscsi_transport *t = conn->transport; \ 939 \ 940 + t->get_conn_param(conn->dd_data, param, &value); \ 941 return snprintf(buf, 20, format"\n", value); \ 942 } 943 ··· 954 iscsi_conn_int_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN, "%d"); 955 iscsi_conn_int_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN, "%d"); 956 957 + #define iscsi_cdev_to_session(_cdev) \ 958 + iscsi_dev_to_session(_cdev->dev) 959 + 960 /* 961 * iSCSI session attrs 962 */ ··· 962 show_session_int_param_##param(struct class_device *cdev, char *buf) \ 963 { \ 964 uint32_t value = 0; \ 965 + struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \ 966 + struct Scsi_Host *shost = iscsi_session_to_shost(session); \ 967 + struct iscsi_transport *t = session->transport; \ 968 \ 969 + t->get_session_param(shost, param, &value); \ 970 return snprintf(buf, 20, format"\n", value); \ 971 } 972 ··· 1004 count++; \ 1005 } 1006 1007 static int iscsi_session_match(struct attribute_container *cont, 1008 struct device *dev) 1009 { 1010 + struct iscsi_cls_session *session; 1011 struct Scsi_Host *shost; 1012 struct iscsi_internal *priv; 1013 1014 if (!iscsi_is_session_dev(dev)) 1015 return 0; 1016 1017 + session = iscsi_dev_to_session(dev); 1018 + shost = iscsi_session_to_shost(session); 1019 if (!shost->transportt) 1020 return 0; 1021 ··· 1031 return &priv->session_cont.ac == cont; 1032 } 1033 1034 static int iscsi_conn_match(struct attribute_container *cont, 1035 struct device *dev) 1036 { 1037 + struct iscsi_cls_session *session; 1038 + struct iscsi_cls_conn *conn; 1039 struct Scsi_Host *shost; 1040 struct iscsi_internal *priv; 1041 1042 if (!iscsi_is_conn_dev(dev)) 1043 return 0; 1044 1045 + conn = iscsi_dev_to_conn(dev); 1046 + session = iscsi_dev_to_session(conn->dev.parent); 1047 + shost = iscsi_session_to_shost(session); 1048 + 1049 if (!shost->transportt) 1050 return 0; 1051 ··· 1058 return &priv->conn_cont.ac == cont; 1059 } 1060 1061 + struct scsi_transport_template * 1062 + iscsi_register_transport(struct iscsi_transport *tt) 1063 { 1064 struct iscsi_internal *priv; 1065 unsigned long flags; ··· 1068 1069 priv = iscsi_if_transport_lookup(tt); 1070 if (priv) 1071 + return NULL; 1072 1073 priv = kmalloc(sizeof(*priv), GFP_KERNEL); 1074 if (!priv) 1075 + return NULL; 1076 memset(priv, 0, sizeof(*priv)); 1077 INIT_LIST_HEAD(&priv->list); 1078 INIT_LIST_HEAD(&priv->sessions); 1079 priv->iscsi_transport = tt; 1080 1081 priv->cdev.class = &iscsi_transport_class; ··· 1142 spin_unlock_irqrestore(&iscsi_transport_lock, flags); 1143 1144 printk(KERN_NOTICE "iscsi: registered transport (%s)\n", tt->name); 1145 + return &priv->t; 1146 1147 unregister_cdev: 1148 class_device_unregister(&priv->cdev); 1149 free_priv: 1150 kfree(priv); 1151 + return NULL; 1152 } 1153 EXPORT_SYMBOL_GPL(iscsi_register_transport); 1154 ··· 1159 1160 BUG_ON(!tt); 1161 1162 + mutex_lock(&rx_queue_mutex); 1163 1164 priv = iscsi_if_transport_lookup(tt); 1165 BUG_ON (!priv); 1166 1167 spin_lock_irqsave(&iscsi_transport_lock, flags); 1168 list_del(&priv->list); ··· 1181 1182 sysfs_remove_group(&priv->cdev.kobj, &iscsi_transport_group); 1183 class_device_unregister(&priv->cdev); 1184 + mutex_unlock(&rx_queue_mutex); 1185 1186 return 0; 1187 } ··· 1194 1195 if (event == NETLINK_URELEASE && 1196 n->protocol == NETLINK_ISCSI && n->pid) { 1197 + struct iscsi_cls_conn *conn; 1198 unsigned long flags; 1199 1200 + mempool_zone_complete(z_reply); 1201 spin_lock_irqsave(&connlock, flags); 1202 list_for_each_entry(conn, &connlist, conn_list) { 1203 + mempool_zone_complete(conn->z_error); 1204 + mempool_zone_complete(conn->z_pdu); 1205 } 1206 spin_unlock_irqrestore(&connlock, flags); 1207 } ··· 1234 goto unregister_session_class; 1235 1236 nls = netlink_kernel_create(NETLINK_ISCSI, 1, iscsi_if_rx, 1237 + THIS_MODULE); 1238 if (!nls) { 1239 err = -ENOBUFS; 1240 goto unregister_notifier; 1241 } 1242 1243 + z_reply = mempool_zone_init(Z_MAX_REPLY, 1244 NLMSG_SPACE(sizeof(struct iscsi_uevent)), Z_HIWAT_REPLY); 1245 + if (z_reply) 1246 return 0; 1247 1248 sock_release(nls->sk_socket); ··· 1259 1260 static void __exit iscsi_transport_exit(void) 1261 { 1262 + mempool_zone_destroy(z_reply); 1263 sock_release(nls->sk_socket); 1264 netlink_unregister_notifier(&iscsi_nl_notifier); 1265 transport_class_unregister(&iscsi_connection_class);
+39 -21
drivers/scsi/scsi_transport_sas.c
··· 29 #include <linux/slab.h> 30 #include <linux/string.h> 31 32 #include <scsi/scsi_device.h> 33 #include <scsi/scsi_host.h> 34 #include <scsi/scsi_transport.h> ··· 63 64 struct sas_host_attrs { 65 struct list_head rphy_list; 66 - spinlock_t lock; 67 u32 next_target_id; 68 }; 69 #define to_sas_host_attrs(host) ((struct sas_host_attrs *)(host)->shost_data) ··· 166 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 167 168 INIT_LIST_HEAD(&sas_host->rphy_list); 169 - spin_lock_init(&sas_host->lock); 170 sas_host->next_target_id = 0; 171 return 0; 172 } ··· 627 transport_add_device(&rphy->dev); 628 transport_configure_device(&rphy->dev); 629 630 - spin_lock(&sas_host->lock); 631 list_add_tail(&rphy->list, &sas_host->rphy_list); 632 if (identify->device_type == SAS_END_DEVICE && 633 (identify->target_port_protocols & ··· 635 rphy->scsi_target_id = sas_host->next_target_id++; 636 else 637 rphy->scsi_target_id = -1; 638 - spin_unlock(&sas_host->lock); 639 640 if (rphy->scsi_target_id != -1) { 641 - scsi_scan_target(&rphy->dev, parent->number, 642 rphy->scsi_target_id, ~0, 0); 643 } 644 ··· 662 struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent); 663 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 664 665 - spin_lock(&sas_host->lock); 666 list_del(&rphy->list); 667 - spin_unlock(&sas_host->lock); 668 669 transport_destroy_device(&rphy->dev); 670 put_device(rphy->dev.parent); ··· 688 struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); 689 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 690 691 - scsi_remove_target(dev); 692 693 transport_remove_device(dev); 694 device_del(dev); 695 transport_destroy_device(dev); 696 697 - spin_lock(&sas_host->lock); 698 list_del(&rphy->list); 699 - spin_unlock(&sas_host->lock); 700 701 put_device(&parent->dev); 702 } ··· 732 * SCSI scan helper 733 */ 734 735 - static struct device *sas_target_parent(struct Scsi_Host *shost, 736 - int channel, uint id) 737 { 738 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 739 struct sas_rphy *rphy; 740 - struct device *dev = NULL; 741 742 - spin_lock(&sas_host->lock); 743 list_for_each_entry(rphy, &sas_host->rphy_list, list) { 744 struct sas_phy *parent = dev_to_phy(rphy->dev.parent); 745 - if (parent->number == channel && 746 - rphy->scsi_target_id == id) 747 - dev = &rphy->dev; 748 - } 749 - spin_unlock(&sas_host->lock); 750 751 - return dev; 752 } 753 754 ··· 798 return NULL; 799 memset(i, 0, sizeof(struct sas_internal)); 800 801 - i->t.target_parent = sas_target_parent; 802 803 i->t.host_attrs.ac.attrs = &i->host_attrs[0]; 804 i->t.host_attrs.ac.class = &sas_host_class.class;
··· 29 #include <linux/slab.h> 30 #include <linux/string.h> 31 32 + #include <scsi/scsi.h> 33 #include <scsi/scsi_device.h> 34 #include <scsi/scsi_host.h> 35 #include <scsi/scsi_transport.h> ··· 62 63 struct sas_host_attrs { 64 struct list_head rphy_list; 65 + struct mutex lock; 66 u32 next_target_id; 67 }; 68 #define to_sas_host_attrs(host) ((struct sas_host_attrs *)(host)->shost_data) ··· 165 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 166 167 INIT_LIST_HEAD(&sas_host->rphy_list); 168 + mutex_init(&sas_host->lock); 169 sas_host->next_target_id = 0; 170 return 0; 171 } ··· 626 transport_add_device(&rphy->dev); 627 transport_configure_device(&rphy->dev); 628 629 + mutex_lock(&sas_host->lock); 630 list_add_tail(&rphy->list, &sas_host->rphy_list); 631 if (identify->device_type == SAS_END_DEVICE && 632 (identify->target_port_protocols & ··· 634 rphy->scsi_target_id = sas_host->next_target_id++; 635 else 636 rphy->scsi_target_id = -1; 637 + mutex_unlock(&sas_host->lock); 638 639 if (rphy->scsi_target_id != -1) { 640 + scsi_scan_target(&rphy->dev, parent->port_identifier, 641 rphy->scsi_target_id, ~0, 0); 642 } 643 ··· 661 struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent); 662 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 663 664 + mutex_lock(&sas_host->lock); 665 list_del(&rphy->list); 666 + mutex_unlock(&sas_host->lock); 667 668 transport_destroy_device(&rphy->dev); 669 put_device(rphy->dev.parent); ··· 687 struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); 688 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 689 690 + switch (rphy->identify.device_type) { 691 + case SAS_END_DEVICE: 692 + scsi_remove_target(dev); 693 + break; 694 + case SAS_EDGE_EXPANDER_DEVICE: 695 + case SAS_FANOUT_EXPANDER_DEVICE: 696 + device_for_each_child(dev, NULL, do_sas_phy_delete); 697 + break; 698 + default: 699 + break; 700 + } 701 702 transport_remove_device(dev); 703 device_del(dev); 704 transport_destroy_device(dev); 705 706 + mutex_lock(&sas_host->lock); 707 list_del(&rphy->list); 708 + mutex_unlock(&sas_host->lock); 709 + 710 + parent->rphy = NULL; 711 712 put_device(&parent->dev); 713 } ··· 719 * SCSI scan helper 720 */ 721 722 + static int sas_user_scan(struct Scsi_Host *shost, uint channel, 723 + uint id, uint lun) 724 { 725 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 726 struct sas_rphy *rphy; 727 728 + mutex_lock(&sas_host->lock); 729 list_for_each_entry(rphy, &sas_host->rphy_list, list) { 730 struct sas_phy *parent = dev_to_phy(rphy->dev.parent); 731 732 + if (rphy->scsi_target_id == -1) 733 + continue; 734 + 735 + if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && 736 + (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) { 737 + scsi_scan_target(&rphy->dev, parent->port_identifier, 738 + rphy->scsi_target_id, lun, 1); 739 + } 740 + } 741 + mutex_unlock(&sas_host->lock); 742 + 743 + return 0; 744 } 745 746 ··· 780 return NULL; 781 memset(i, 0, sizeof(struct sas_internal)); 782 783 + i->t.user_scan = sas_user_scan; 784 785 i->t.host_attrs.ac.attrs = &i->host_attrs[0]; 786 i->t.host_attrs.ac.class = &sas_host_class.class;
+6 -6
drivers/scsi/scsi_transport_spi.c
··· 24 #include <linux/module.h> 25 #include <linux/workqueue.h> 26 #include <linux/blkdev.h> 27 - #include <asm/semaphore.h> 28 #include <scsi/scsi.h> 29 #include "scsi_priv.h" 30 #include <scsi/scsi_device.h> ··· 48 49 /* Private data accessors (keep these out of the header file) */ 50 #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending) 51 - #define spi_dv_sem(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_sem) 52 53 struct spi_internal { 54 struct scsi_transport_template t; ··· 242 spi_hold_mcs(starget) = 0; 243 spi_dv_pending(starget) = 0; 244 spi_initial_dv(starget) = 0; 245 - init_MUTEX(&spi_dv_sem(starget)); 246 247 return 0; 248 } ··· 915 scsi_target_quiesce(starget); 916 917 spi_dv_pending(starget) = 1; 918 - down(&spi_dv_sem(starget)); 919 920 starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n"); 921 ··· 923 924 starget_printk(KERN_INFO, starget, "Ending Domain Validation\n"); 925 926 - up(&spi_dv_sem(starget)); 927 spi_dv_pending(starget) = 0; 928 929 scsi_target_resume(starget); ··· 1075 /* 0x04 */ "Parallel Protocol Request" 1076 }; 1077 1078 - void print_nego(const unsigned char *msg, int per, int off, int width) 1079 { 1080 if (per) { 1081 char buf[20];
··· 24 #include <linux/module.h> 25 #include <linux/workqueue.h> 26 #include <linux/blkdev.h> 27 + #include <linux/mutex.h> 28 #include <scsi/scsi.h> 29 #include "scsi_priv.h" 30 #include <scsi/scsi_device.h> ··· 48 49 /* Private data accessors (keep these out of the header file) */ 50 #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending) 51 + #define spi_dv_mutex(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_mutex) 52 53 struct spi_internal { 54 struct scsi_transport_template t; ··· 242 spi_hold_mcs(starget) = 0; 243 spi_dv_pending(starget) = 0; 244 spi_initial_dv(starget) = 0; 245 + mutex_init(&spi_dv_mutex(starget)); 246 247 return 0; 248 } ··· 915 scsi_target_quiesce(starget); 916 917 spi_dv_pending(starget) = 1; 918 + mutex_lock(&spi_dv_mutex(starget)); 919 920 starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n"); 921 ··· 923 924 starget_printk(KERN_INFO, starget, "Ending Domain Validation\n"); 925 926 + mutex_unlock(&spi_dv_mutex(starget)); 927 spi_dv_pending(starget) = 0; 928 929 scsi_target_resume(starget); ··· 1075 /* 0x04 */ "Parallel Protocol Request" 1076 }; 1077 1078 + static void print_nego(const unsigned char *msg, int per, int off, int width) 1079 { 1080 if (per) { 1081 char buf[20];
+16 -47
drivers/scsi/sd.c
··· 49 #include <linux/blkpg.h> 50 #include <linux/kref.h> 51 #include <linux/delay.h> 52 #include <asm/uaccess.h> 53 54 #include <scsi/scsi.h> ··· 112 /* This semaphore is used to mediate the 0->1 reference get in the 113 * face of object destruction (i.e. we can't allow a get on an 114 * object after last put) */ 115 - static DECLARE_MUTEX(sd_ref_sem); 116 117 static int sd_revalidate_disk(struct gendisk *disk); 118 static void sd_rw_intr(struct scsi_cmnd * SCpnt); ··· 194 { 195 struct scsi_disk *sdkp; 196 197 - down(&sd_ref_sem); 198 sdkp = __scsi_disk_get(disk); 199 - up(&sd_ref_sem); 200 return sdkp; 201 } 202 ··· 204 { 205 struct scsi_disk *sdkp; 206 207 - down(&sd_ref_sem); 208 sdkp = dev_get_drvdata(dev); 209 if (sdkp) 210 sdkp = __scsi_disk_get(sdkp->disk); 211 - up(&sd_ref_sem); 212 return sdkp; 213 } 214 ··· 216 { 217 struct scsi_device *sdev = sdkp->device; 218 219 - down(&sd_ref_sem); 220 kref_put(&sdkp->kref, scsi_disk_release); 221 scsi_device_put(sdev); 222 - up(&sd_ref_sem); 223 } 224 225 /** ··· 232 **/ 233 static int sd_init_command(struct scsi_cmnd * SCpnt) 234 { 235 - unsigned int this_count, timeout; 236 - struct gendisk *disk; 237 - sector_t block; 238 struct scsi_device *sdp = SCpnt->device; 239 struct request *rq = SCpnt->request; 240 - 241 - timeout = sdp->timeout; 242 - 243 - /* 244 - * SG_IO from block layer already setup, just copy cdb basically 245 - */ 246 - if (blk_pc_request(rq)) { 247 - scsi_setup_blk_pc_cmnd(SCpnt); 248 - if (rq->timeout) 249 - timeout = rq->timeout; 250 - 251 - goto queue; 252 - } 253 - 254 - /* 255 - * we only do REQ_CMD and REQ_BLOCK_PC 256 - */ 257 - if (!blk_fs_request(rq)) 258 - return 0; 259 - 260 - disk = rq->rq_disk; 261 - block = rq->sector; 262 - this_count = SCpnt->request_bufflen >> 9; 263 264 SCSI_LOG_HLQUEUE(1, printk("sd_init_command: disk=%s, block=%llu, " 265 "count=%d\n", disk->disk_name, ··· 380 SCpnt->transfersize = sdp->sector_size; 381 SCpnt->underflow = this_count << 9; 382 SCpnt->allowed = SD_MAX_RETRIES; 383 - 384 - queue: 385 SCpnt->timeout_per_command = timeout; 386 387 /* ··· 813 relatively rare error condition, no care is taken to avoid 814 unnecessary additional work such as memcpy's that could be avoided. 815 */ 816 - 817 - /* 818 - * If SG_IO from block layer then set good_bytes to stop retries; 819 - * else if errors, check them, and if necessary prepare for 820 - * (partial) retries. 821 - */ 822 - if (blk_pc_request(SCpnt->request)) 823 - good_bytes = this_count; 824 - else if (driver_byte(result) != 0 && 825 sense_valid && !sense_deferred) { 826 switch (sshdr.sense_key) { 827 case MEDIUM_ERROR: ··· 1604 del_gendisk(sdkp->disk); 1605 sd_shutdown(dev); 1606 1607 - down(&sd_ref_sem); 1608 dev_set_drvdata(dev, NULL); 1609 kref_put(&sdkp->kref, scsi_disk_release); 1610 - up(&sd_ref_sem); 1611 1612 return 0; 1613 } ··· 1616 * scsi_disk_release - Called to free the scsi_disk structure 1617 * @kref: pointer to embedded kref 1618 * 1619 - * sd_ref_sem must be held entering this routine. Because it is 1620 * called on last put, you should always use the scsi_disk_get() 1621 * scsi_disk_put() helpers which manipulate the semaphore directly 1622 * and never do a direct kref_put().
··· 49 #include <linux/blkpg.h> 50 #include <linux/kref.h> 51 #include <linux/delay.h> 52 + #include <linux/mutex.h> 53 #include <asm/uaccess.h> 54 55 #include <scsi/scsi.h> ··· 111 /* This semaphore is used to mediate the 0->1 reference get in the 112 * face of object destruction (i.e. we can't allow a get on an 113 * object after last put) */ 114 + static DEFINE_MUTEX(sd_ref_mutex); 115 116 static int sd_revalidate_disk(struct gendisk *disk); 117 static void sd_rw_intr(struct scsi_cmnd * SCpnt); ··· 193 { 194 struct scsi_disk *sdkp; 195 196 + mutex_lock(&sd_ref_mutex); 197 sdkp = __scsi_disk_get(disk); 198 + mutex_unlock(&sd_ref_mutex); 199 return sdkp; 200 } 201 ··· 203 { 204 struct scsi_disk *sdkp; 205 206 + mutex_lock(&sd_ref_mutex); 207 sdkp = dev_get_drvdata(dev); 208 if (sdkp) 209 sdkp = __scsi_disk_get(sdkp->disk); 210 + mutex_unlock(&sd_ref_mutex); 211 return sdkp; 212 } 213 ··· 215 { 216 struct scsi_device *sdev = sdkp->device; 217 218 + mutex_lock(&sd_ref_mutex); 219 kref_put(&sdkp->kref, scsi_disk_release); 220 scsi_device_put(sdev); 221 + mutex_unlock(&sd_ref_mutex); 222 } 223 224 /** ··· 231 **/ 232 static int sd_init_command(struct scsi_cmnd * SCpnt) 233 { 234 struct scsi_device *sdp = SCpnt->device; 235 struct request *rq = SCpnt->request; 236 + struct gendisk *disk = rq->rq_disk; 237 + sector_t block = rq->sector; 238 + unsigned int this_count = SCpnt->request_bufflen >> 9; 239 + unsigned int timeout = sdp->timeout; 240 241 SCSI_LOG_HLQUEUE(1, printk("sd_init_command: disk=%s, block=%llu, " 242 "count=%d\n", disk->disk_name, ··· 401 SCpnt->transfersize = sdp->sector_size; 402 SCpnt->underflow = this_count << 9; 403 SCpnt->allowed = SD_MAX_RETRIES; 404 SCpnt->timeout_per_command = timeout; 405 406 /* ··· 836 relatively rare error condition, no care is taken to avoid 837 unnecessary additional work such as memcpy's that could be avoided. 838 */ 839 + if (driver_byte(result) != 0 && 840 sense_valid && !sense_deferred) { 841 switch (sshdr.sense_key) { 842 case MEDIUM_ERROR: ··· 1635 del_gendisk(sdkp->disk); 1636 sd_shutdown(dev); 1637 1638 + mutex_lock(&sd_ref_mutex); 1639 dev_set_drvdata(dev, NULL); 1640 kref_put(&sdkp->kref, scsi_disk_release); 1641 + mutex_unlock(&sd_ref_mutex); 1642 1643 return 0; 1644 } ··· 1647 * scsi_disk_release - Called to free the scsi_disk structure 1648 * @kref: pointer to embedded kref 1649 * 1650 + * sd_ref_mutex must be held entering this routine. Because it is 1651 * called on last put, you should always use the scsi_disk_get() 1652 * scsi_disk_put() helpers which manipulate the semaphore directly 1653 * and never do a direct kref_put().
+12 -31
drivers/scsi/sr.c
··· 44 #include <linux/interrupt.h> 45 #include <linux/init.h> 46 #include <linux/blkdev.h> 47 #include <asm/uaccess.h> 48 49 #include <scsi/scsi.h> ··· 91 /* This semaphore is used to mediate the 0->1 reference get in the 92 * face of object destruction (i.e. we can't allow a get on an 93 * object after last put) */ 94 - static DECLARE_MUTEX(sr_ref_sem); 95 96 static int sr_open(struct cdrom_device_info *, int); 97 static void sr_release(struct cdrom_device_info *); ··· 134 { 135 struct scsi_cd *cd = NULL; 136 137 - down(&sr_ref_sem); 138 if (disk->private_data == NULL) 139 goto out; 140 cd = scsi_cd(disk); ··· 147 kref_put(&cd->kref, sr_kref_release); 148 cd = NULL; 149 out: 150 - up(&sr_ref_sem); 151 return cd; 152 } 153 ··· 155 { 156 struct scsi_device *sdev = cd->device; 157 158 - down(&sr_ref_sem); 159 kref_put(&cd->kref, sr_kref_release); 160 scsi_device_put(sdev); 161 - up(&sr_ref_sem); 162 } 163 164 /* ··· 238 case ILLEGAL_REQUEST: 239 if (!(SCpnt->sense_buffer[0] & 0x90)) 240 break; 241 - if (!blk_fs_request(SCpnt->request)) 242 - break; 243 error_sector = (SCpnt->sense_buffer[3] << 24) | 244 (SCpnt->sense_buffer[4] << 16) | 245 (SCpnt->sense_buffer[5] << 8) | ··· 312 * quietly refuse to do anything to a changed disc until the 313 * changed bit has been reset 314 */ 315 - return 0; 316 - } 317 - 318 - /* 319 - * these are already setup, just copy cdb basically 320 - */ 321 - if (SCpnt->request->flags & REQ_BLOCK_PC) { 322 - scsi_setup_blk_pc_cmnd(SCpnt); 323 - 324 - if (SCpnt->timeout_per_command) 325 - timeout = SCpnt->timeout_per_command; 326 - 327 - goto queue; 328 - } 329 - 330 - if (!(SCpnt->request->flags & REQ_CMD)) { 331 - blk_dump_rq_flags(SCpnt->request, "sr unsup command"); 332 return 0; 333 } 334 ··· 403 */ 404 SCpnt->transfersize = cd->device->sector_size; 405 SCpnt->underflow = this_count << 9; 406 - 407 - queue: 408 SCpnt->allowed = MAX_RETRIES; 409 SCpnt->timeout_per_command = timeout; 410 ··· 742 /* failed, drive doesn't have capabilities mode page */ 743 cd->cdi.speed = 1; 744 cd->cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R | 745 - CDC_DVD | CDC_DVD_RAM | 746 - CDC_SELECT_DISC | CDC_SELECT_SPEED); 747 kfree(buffer); 748 printk("%s: scsi-1 drive\n", cd->cdi.name); 749 return; ··· 826 * sr_kref_release - Called to free the scsi_cd structure 827 * @kref: pointer to embedded kref 828 * 829 - * sr_ref_sem must be held entering this routine. Because it is 830 * called on last put, you should always use the scsi_cd_get() 831 * scsi_cd_put() helpers which manipulate the semaphore directly 832 * and never do a direct kref_put(). ··· 855 856 del_gendisk(cd->disk); 857 858 - down(&sr_ref_sem); 859 kref_put(&cd->kref, sr_kref_release); 860 - up(&sr_ref_sem); 861 862 return 0; 863 }
··· 44 #include <linux/interrupt.h> 45 #include <linux/init.h> 46 #include <linux/blkdev.h> 47 + #include <linux/mutex.h> 48 #include <asm/uaccess.h> 49 50 #include <scsi/scsi.h> ··· 90 /* This semaphore is used to mediate the 0->1 reference get in the 91 * face of object destruction (i.e. we can't allow a get on an 92 * object after last put) */ 93 + static DEFINE_MUTEX(sr_ref_mutex); 94 95 static int sr_open(struct cdrom_device_info *, int); 96 static void sr_release(struct cdrom_device_info *); ··· 133 { 134 struct scsi_cd *cd = NULL; 135 136 + mutex_lock(&sr_ref_mutex); 137 if (disk->private_data == NULL) 138 goto out; 139 cd = scsi_cd(disk); ··· 146 kref_put(&cd->kref, sr_kref_release); 147 cd = NULL; 148 out: 149 + mutex_unlock(&sr_ref_mutex); 150 return cd; 151 } 152 ··· 154 { 155 struct scsi_device *sdev = cd->device; 156 157 + mutex_lock(&sr_ref_mutex); 158 kref_put(&cd->kref, sr_kref_release); 159 scsi_device_put(sdev); 160 + mutex_unlock(&sr_ref_mutex); 161 } 162 163 /* ··· 237 case ILLEGAL_REQUEST: 238 if (!(SCpnt->sense_buffer[0] & 0x90)) 239 break; 240 error_sector = (SCpnt->sense_buffer[3] << 24) | 241 (SCpnt->sense_buffer[4] << 16) | 242 (SCpnt->sense_buffer[5] << 8) | ··· 313 * quietly refuse to do anything to a changed disc until the 314 * changed bit has been reset 315 */ 316 return 0; 317 } 318 ··· 421 */ 422 SCpnt->transfersize = cd->device->sector_size; 423 SCpnt->underflow = this_count << 9; 424 SCpnt->allowed = MAX_RETRIES; 425 SCpnt->timeout_per_command = timeout; 426 ··· 762 /* failed, drive doesn't have capabilities mode page */ 763 cd->cdi.speed = 1; 764 cd->cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R | 765 + CDC_DVD | CDC_DVD_RAM | 766 + CDC_SELECT_DISC | CDC_SELECT_SPEED | 767 + CDC_MRW | CDC_MRW_W | CDC_RAM); 768 kfree(buffer); 769 printk("%s: scsi-1 drive\n", cd->cdi.name); 770 return; ··· 845 * sr_kref_release - Called to free the scsi_cd structure 846 * @kref: pointer to embedded kref 847 * 848 + * sr_ref_mutex must be held entering this routine. Because it is 849 * called on last put, you should always use the scsi_cd_get() 850 * scsi_cd_put() helpers which manipulate the semaphore directly 851 * and never do a direct kref_put(). ··· 874 875 del_gendisk(cd->disk); 876 877 + mutex_lock(&sr_ref_mutex); 878 kref_put(&cd->kref, sr_kref_release); 879 + mutex_unlock(&sr_ref_mutex); 880 881 return 0; 882 }
+111 -91
drivers/scsi/sr_ioctl.c
··· 31 32 module_param(xa_test, int, S_IRUGO | S_IWUSR); 33 34 35 #define IOCTL_RETRIES 3 36 ··· 118 struct packet_command cgc; 119 int ntracks, ret; 120 121 - if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCHDR, &tochdr))) 122 return ret; 123 124 ntracks = tochdr.cdth_trk1 - tochdr.cdth_trk0 + 1; ··· 134 trk1_te.cdte_track = ti->cdti_trk1; 135 trk1_te.cdte_format = CDROM_MSF; 136 137 - if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &trk0_te))) 138 return ret; 139 - if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &trk1_te))) 140 return ret; 141 142 memset(&cgc, 0, sizeof(struct packet_command)); ··· 152 cgc.data_direction = DMA_NONE; 153 cgc.timeout = IOCTL_TIMEOUT; 154 return sr_do_ioctl(cdi->handle, &cgc); 155 } 156 157 /* We do our own retries because we want to know what the specific ··· 329 int i, rc, have_datatracks = 0; 330 331 /* look for data tracks */ 332 - if (0 != (rc = sr_audio_ioctl(cdi, CDROMREADTOCHDR, &toc_h))) 333 return (rc == -ENOMEDIUM) ? CDS_NO_DISC : CDS_NO_INFO; 334 335 for (i = toc_h.cdth_trk0; i <= toc_h.cdth_trk1; i++) { 336 toc_e.cdte_track = i; 337 toc_e.cdte_format = CDROM_LBA; 338 - if (sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &toc_e)) 339 return CDS_NO_INFO; 340 if (toc_e.cdte_ctrl & CDROM_DATA_TRACK) { 341 have_datatracks = 1; ··· 362 363 return 0; 364 } 365 - 366 - /* primitive to determine whether we need to have GFP_DMA set based on 367 - * the status of the unchecked_isa_dma flag in the host structure */ 368 - #define SR_GFP_DMA(cd) (((cd)->device->host->unchecked_isa_dma) ? GFP_DMA : 0) 369 370 int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) 371 { ··· 426 427 int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg) 428 { 429 - Scsi_CD *cd = cdi->handle; 430 - struct packet_command cgc; 431 - int result; 432 - unsigned char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); 433 - 434 - if (!buffer) 435 - return -ENOMEM; 436 - 437 - memset(&cgc, 0, sizeof(struct packet_command)); 438 - cgc.timeout = IOCTL_TIMEOUT; 439 - 440 switch (cmd) { 441 case CDROMREADTOCHDR: 442 - { 443 - struct cdrom_tochdr *tochdr = (struct cdrom_tochdr *) arg; 444 - 445 - cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; 446 - cgc.cmd[8] = 12; /* LSB of length */ 447 - cgc.buffer = buffer; 448 - cgc.buflen = 12; 449 - cgc.quiet = 1; 450 - cgc.data_direction = DMA_FROM_DEVICE; 451 - 452 - result = sr_do_ioctl(cd, &cgc); 453 - 454 - tochdr->cdth_trk0 = buffer[2]; 455 - tochdr->cdth_trk1 = buffer[3]; 456 - 457 - break; 458 - } 459 - 460 case CDROMREADTOCENTRY: 461 - { 462 - struct cdrom_tocentry *tocentry = (struct cdrom_tocentry *) arg; 463 - 464 - cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; 465 - cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0; 466 - cgc.cmd[6] = tocentry->cdte_track; 467 - cgc.cmd[8] = 12; /* LSB of length */ 468 - cgc.buffer = buffer; 469 - cgc.buflen = 12; 470 - cgc.data_direction = DMA_FROM_DEVICE; 471 - 472 - result = sr_do_ioctl(cd, &cgc); 473 - 474 - tocentry->cdte_ctrl = buffer[5] & 0xf; 475 - tocentry->cdte_adr = buffer[5] >> 4; 476 - tocentry->cdte_datamode = (tocentry->cdte_ctrl & 0x04) ? 1 : 0; 477 - if (tocentry->cdte_format == CDROM_MSF) { 478 - tocentry->cdte_addr.msf.minute = buffer[9]; 479 - tocentry->cdte_addr.msf.second = buffer[10]; 480 - tocentry->cdte_addr.msf.frame = buffer[11]; 481 - } else 482 - tocentry->cdte_addr.lba = (((((buffer[8] << 8) + buffer[9]) << 8) 483 - + buffer[10]) << 8) + buffer[11]; 484 - 485 - break; 486 - } 487 - 488 - case CDROMPLAYTRKIND: { 489 - struct cdrom_ti* ti = (struct cdrom_ti*)arg; 490 - 491 - cgc.cmd[0] = GPCMD_PLAYAUDIO_TI; 492 - cgc.cmd[4] = ti->cdti_trk0; 493 - cgc.cmd[5] = ti->cdti_ind0; 494 - cgc.cmd[7] = ti->cdti_trk1; 495 - cgc.cmd[8] = ti->cdti_ind1; 496 - cgc.data_direction = DMA_NONE; 497 - 498 - result = sr_do_ioctl(cd, &cgc); 499 - if (result == -EDRIVE_CANT_DO_THIS) 500 - result = sr_fake_playtrkind(cdi, ti); 501 - 502 - break; 503 - } 504 - 505 default: 506 - result = -EINVAL; 507 } 508 - 509 - #if 0 510 - if (result) 511 - printk("DEBUG: sr_audio: result for ioctl %x: %x\n", cmd, result); 512 - #endif 513 - 514 - kfree(buffer); 515 - return result; 516 } 517 518 /* -----------------------------------------------------------------------
··· 31 32 module_param(xa_test, int, S_IRUGO | S_IWUSR); 33 34 + /* primitive to determine whether we need to have GFP_DMA set based on 35 + * the status of the unchecked_isa_dma flag in the host structure */ 36 + #define SR_GFP_DMA(cd) (((cd)->device->host->unchecked_isa_dma) ? GFP_DMA : 0) 37 + 38 + 39 + static int sr_read_tochdr(struct cdrom_device_info *cdi, 40 + struct cdrom_tochdr *tochdr) 41 + { 42 + struct scsi_cd *cd = cdi->handle; 43 + struct packet_command cgc; 44 + int result; 45 + unsigned char *buffer; 46 + 47 + buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); 48 + if (!buffer) 49 + return -ENOMEM; 50 + 51 + memset(&cgc, 0, sizeof(struct packet_command)); 52 + cgc.timeout = IOCTL_TIMEOUT; 53 + cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; 54 + cgc.cmd[8] = 12; /* LSB of length */ 55 + cgc.buffer = buffer; 56 + cgc.buflen = 12; 57 + cgc.quiet = 1; 58 + cgc.data_direction = DMA_FROM_DEVICE; 59 + 60 + result = sr_do_ioctl(cd, &cgc); 61 + 62 + tochdr->cdth_trk0 = buffer[2]; 63 + tochdr->cdth_trk1 = buffer[3]; 64 + 65 + kfree(buffer); 66 + return result; 67 + } 68 + 69 + static int sr_read_tocentry(struct cdrom_device_info *cdi, 70 + struct cdrom_tocentry *tocentry) 71 + { 72 + struct scsi_cd *cd = cdi->handle; 73 + struct packet_command cgc; 74 + int result; 75 + unsigned char *buffer; 76 + 77 + buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); 78 + if (!buffer) 79 + return -ENOMEM; 80 + 81 + memset(&cgc, 0, sizeof(struct packet_command)); 82 + cgc.timeout = IOCTL_TIMEOUT; 83 + cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; 84 + cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0; 85 + cgc.cmd[6] = tocentry->cdte_track; 86 + cgc.cmd[8] = 12; /* LSB of length */ 87 + cgc.buffer = buffer; 88 + cgc.buflen = 12; 89 + cgc.data_direction = DMA_FROM_DEVICE; 90 + 91 + result = sr_do_ioctl(cd, &cgc); 92 + 93 + tocentry->cdte_ctrl = buffer[5] & 0xf; 94 + tocentry->cdte_adr = buffer[5] >> 4; 95 + tocentry->cdte_datamode = (tocentry->cdte_ctrl & 0x04) ? 1 : 0; 96 + if (tocentry->cdte_format == CDROM_MSF) { 97 + tocentry->cdte_addr.msf.minute = buffer[9]; 98 + tocentry->cdte_addr.msf.second = buffer[10]; 99 + tocentry->cdte_addr.msf.frame = buffer[11]; 100 + } else 101 + tocentry->cdte_addr.lba = (((((buffer[8] << 8) + buffer[9]) << 8) 102 + + buffer[10]) << 8) + buffer[11]; 103 + 104 + kfree(buffer); 105 + return result; 106 + } 107 108 #define IOCTL_RETRIES 3 109 ··· 45 struct packet_command cgc; 46 int ntracks, ret; 47 48 + ret = sr_read_tochdr(cdi, &tochdr); 49 + if (ret) 50 return ret; 51 52 ntracks = tochdr.cdth_trk1 - tochdr.cdth_trk0 + 1; ··· 60 trk1_te.cdte_track = ti->cdti_trk1; 61 trk1_te.cdte_format = CDROM_MSF; 62 63 + ret = sr_read_tocentry(cdi, &trk0_te); 64 + if (ret) 65 return ret; 66 + ret = sr_read_tocentry(cdi, &trk1_te); 67 + if (ret) 68 return ret; 69 70 memset(&cgc, 0, sizeof(struct packet_command)); ··· 76 cgc.data_direction = DMA_NONE; 77 cgc.timeout = IOCTL_TIMEOUT; 78 return sr_do_ioctl(cdi->handle, &cgc); 79 + } 80 + 81 + static int sr_play_trkind(struct cdrom_device_info *cdi, 82 + struct cdrom_ti *ti) 83 + 84 + { 85 + struct scsi_cd *cd = cdi->handle; 86 + struct packet_command cgc; 87 + int result; 88 + 89 + memset(&cgc, 0, sizeof(struct packet_command)); 90 + cgc.timeout = IOCTL_TIMEOUT; 91 + cgc.cmd[0] = GPCMD_PLAYAUDIO_TI; 92 + cgc.cmd[4] = ti->cdti_trk0; 93 + cgc.cmd[5] = ti->cdti_ind0; 94 + cgc.cmd[7] = ti->cdti_trk1; 95 + cgc.cmd[8] = ti->cdti_ind1; 96 + cgc.data_direction = DMA_NONE; 97 + 98 + result = sr_do_ioctl(cd, &cgc); 99 + if (result == -EDRIVE_CANT_DO_THIS) 100 + result = sr_fake_playtrkind(cdi, ti); 101 + 102 + return result; 103 } 104 105 /* We do our own retries because we want to know what the specific ··· 229 int i, rc, have_datatracks = 0; 230 231 /* look for data tracks */ 232 + rc = sr_read_tochdr(cdi, &toc_h); 233 + if (rc) 234 return (rc == -ENOMEDIUM) ? CDS_NO_DISC : CDS_NO_INFO; 235 236 for (i = toc_h.cdth_trk0; i <= toc_h.cdth_trk1; i++) { 237 toc_e.cdte_track = i; 238 toc_e.cdte_format = CDROM_LBA; 239 + if (sr_read_tocentry(cdi, &toc_e)) 240 return CDS_NO_INFO; 241 if (toc_e.cdte_ctrl & CDROM_DATA_TRACK) { 242 have_datatracks = 1; ··· 261 262 return 0; 263 } 264 265 int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) 266 { ··· 329 330 int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg) 331 { 332 switch (cmd) { 333 case CDROMREADTOCHDR: 334 + return sr_read_tochdr(cdi, arg); 335 case CDROMREADTOCENTRY: 336 + return sr_read_tocentry(cdi, arg); 337 + case CDROMPLAYTRKIND: 338 + return sr_play_trkind(cdi, arg); 339 default: 340 + return -EINVAL; 341 } 342 } 343 344 /* -----------------------------------------------------------------------
+9 -33
drivers/scsi/st.c
··· 38 #include <linux/devfs_fs_kernel.h> 39 #include <linux/cdev.h> 40 #include <linux/delay.h> 41 42 #include <asm/uaccess.h> 43 #include <asm/dma.h> ··· 194 195 static int st_probe(struct device *); 196 static int st_remove(struct device *); 197 - static int st_init_command(struct scsi_cmnd *); 198 199 static void do_create_driverfs_files(void); 200 static void do_remove_driverfs_files(void); ··· 206 .probe = st_probe, 207 .remove = st_remove, 208 }, 209 - .init_command = st_init_command, 210 }; 211 212 static int st_compression(struct scsi_tape *, int); ··· 219 220 #define to_scsi_tape(obj) container_of(obj, struct scsi_tape, kref) 221 222 - static DECLARE_MUTEX(st_ref_sem); 223 224 225 #include "osst_detect.h" ··· 236 { 237 struct scsi_tape *STp = NULL; 238 239 - down(&st_ref_sem); 240 write_lock(&st_dev_arr_lock); 241 242 if (dev < st_dev_max && scsi_tapes != NULL) ··· 258 STp = NULL; 259 out: 260 write_unlock(&st_dev_arr_lock); 261 - up(&st_ref_sem); 262 return STp; 263 } 264 ··· 266 { 267 struct scsi_device *sdev = STp->device; 268 269 - down(&st_ref_sem); 270 kref_put(&STp->kref, scsi_tape_release); 271 scsi_device_put(sdev); 272 - up(&st_ref_sem); 273 } 274 275 struct st_reject_data { ··· 4140 } 4141 } 4142 4143 - down(&st_ref_sem); 4144 kref_put(&tpnt->kref, scsi_tape_release); 4145 - up(&st_ref_sem); 4146 return 0; 4147 } 4148 } ··· 4155 * scsi_tape_release - Called to free the Scsi_Tape structure 4156 * @kref: pointer to embedded kref 4157 * 4158 - * st_ref_sem must be held entering this routine. Because it is 4159 * called on last put, you should always use the scsi_tape_get() 4160 * scsi_tape_put() helpers which manipulate the semaphore directly 4161 * and never do a direct kref_put(). ··· 4177 put_disk(disk); 4178 kfree(tpnt); 4179 return; 4180 - } 4181 - 4182 - static void st_intr(struct scsi_cmnd *SCpnt) 4183 - { 4184 - /* 4185 - * The caller should be checking the request's errors 4186 - * value. 4187 - */ 4188 - scsi_io_completion(SCpnt, SCpnt->bufflen, 0); 4189 - } 4190 - 4191 - /* 4192 - * st_init_command: only called via the scsi_cmd_ioctl (block SG_IO) 4193 - * interface for REQ_BLOCK_PC commands. 4194 - */ 4195 - static int st_init_command(struct scsi_cmnd *SCpnt) 4196 - { 4197 - if (!(SCpnt->request->flags & REQ_BLOCK_PC)) 4198 - return 0; 4199 - 4200 - scsi_setup_blk_pc_cmnd(SCpnt); 4201 - SCpnt->done = st_intr; 4202 - return 1; 4203 } 4204 4205 static int __init init_st(void)
··· 38 #include <linux/devfs_fs_kernel.h> 39 #include <linux/cdev.h> 40 #include <linux/delay.h> 41 + #include <linux/mutex.h> 42 43 #include <asm/uaccess.h> 44 #include <asm/dma.h> ··· 193 194 static int st_probe(struct device *); 195 static int st_remove(struct device *); 196 197 static void do_create_driverfs_files(void); 198 static void do_remove_driverfs_files(void); ··· 206 .probe = st_probe, 207 .remove = st_remove, 208 }, 209 }; 210 211 static int st_compression(struct scsi_tape *, int); ··· 220 221 #define to_scsi_tape(obj) container_of(obj, struct scsi_tape, kref) 222 223 + static DEFINE_MUTEX(st_ref_mutex); 224 225 226 #include "osst_detect.h" ··· 237 { 238 struct scsi_tape *STp = NULL; 239 240 + mutex_lock(&st_ref_mutex); 241 write_lock(&st_dev_arr_lock); 242 243 if (dev < st_dev_max && scsi_tapes != NULL) ··· 259 STp = NULL; 260 out: 261 write_unlock(&st_dev_arr_lock); 262 + mutex_unlock(&st_ref_mutex); 263 return STp; 264 } 265 ··· 267 { 268 struct scsi_device *sdev = STp->device; 269 270 + mutex_lock(&st_ref_mutex); 271 kref_put(&STp->kref, scsi_tape_release); 272 scsi_device_put(sdev); 273 + mutex_unlock(&st_ref_mutex); 274 } 275 276 struct st_reject_data { ··· 4141 } 4142 } 4143 4144 + mutex_lock(&st_ref_mutex); 4145 kref_put(&tpnt->kref, scsi_tape_release); 4146 + mutex_unlock(&st_ref_mutex); 4147 return 0; 4148 } 4149 } ··· 4156 * scsi_tape_release - Called to free the Scsi_Tape structure 4157 * @kref: pointer to embedded kref 4158 * 4159 + * st_ref_mutex must be held entering this routine. Because it is 4160 * called on last put, you should always use the scsi_tape_get() 4161 * scsi_tape_put() helpers which manipulate the semaphore directly 4162 * and never do a direct kref_put(). ··· 4178 put_disk(disk); 4179 kfree(tpnt); 4180 return; 4181 } 4182 4183 static int __init init_st(void)
+1
include/linux/pci_ids.h
··· 181 #define PCI_DEVICE_ID_LSI_FC929X 0x0626 182 #define PCI_DEVICE_ID_LSI_FC939X 0x0642 183 #define PCI_DEVICE_ID_LSI_FC949X 0x0640 184 #define PCI_DEVICE_ID_LSI_FC919X 0x0628 185 #define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701 186 #define PCI_DEVICE_ID_LSI_61C102 0x0901
··· 181 #define PCI_DEVICE_ID_LSI_FC929X 0x0626 182 #define PCI_DEVICE_ID_LSI_FC939X 0x0642 183 #define PCI_DEVICE_ID_LSI_FC949X 0x0640 184 + #define PCI_DEVICE_ID_LSI_FC949ES 0x0646 185 #define PCI_DEVICE_ID_LSI_FC919X 0x0628 186 #define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701 187 #define PCI_DEVICE_ID_LSI_61C102 0x0901
+2
include/linux/raid_class.h
··· 31 RAID_LEVEL_LINEAR, 32 RAID_LEVEL_0, 33 RAID_LEVEL_1, 34 RAID_LEVEL_3, 35 RAID_LEVEL_4, 36 RAID_LEVEL_5, 37 RAID_LEVEL_6, 38 }; 39
··· 31 RAID_LEVEL_LINEAR, 32 RAID_LEVEL_0, 33 RAID_LEVEL_1, 34 + RAID_LEVEL_10, 35 RAID_LEVEL_3, 36 RAID_LEVEL_4, 37 RAID_LEVEL_5, 38 + RAID_LEVEL_50, 39 RAID_LEVEL_6, 40 }; 41
+6
include/scsi/iscsi_if.h
··· 168 169 #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 170 #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 171 #define iscsi_hostdata(_hostdata) ((void*)_hostdata + sizeof(unsigned long)) 172 173 /*
··· 168 169 #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 170 #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 171 + #define hostdata_session(_hostdata) (iscsi_ptr(*(unsigned long *)_hostdata)) 172 + 173 + /** 174 + * iscsi_hostdata - get LLD hostdata from scsi_host 175 + * @_hostdata: pointer to scsi host's hostdata 176 + **/ 177 #define iscsi_hostdata(_hostdata) ((void*)_hostdata + sizeof(unsigned long)) 178 179 /*
+6
include/scsi/scsi.h
··· 32 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 33 34 /* 35 * SCSI opcodes 36 */ 37
··· 32 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 33 34 /* 35 + * Special value for scanning to specify scanning or rescanning of all 36 + * possible channels, (target) ids, or luns on a given shost. 37 + */ 38 + #define SCAN_WILD_CARD ~0 39 + 40 + /* 41 * SCSI opcodes 42 */ 43
-1
include/scsi/scsi_cmnd.h
··· 151 extern void scsi_put_command(struct scsi_cmnd *); 152 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 153 extern void scsi_finish_command(struct scsi_cmnd *cmd); 154 - extern void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd); 155 156 #endif /* _SCSI_SCSI_CMND_H */
··· 151 extern void scsi_put_command(struct scsi_cmnd *); 152 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 153 extern void scsi_finish_command(struct scsi_cmnd *cmd); 154 155 #endif /* _SCSI_SCSI_CMND_H */
+2 -1
include/scsi/scsi_host.h
··· 5 #include <linux/list.h> 6 #include <linux/types.h> 7 #include <linux/workqueue.h> 8 9 struct block_device; 10 struct completion; ··· 470 spinlock_t default_lock; 471 spinlock_t *host_lock; 472 473 - struct semaphore scan_mutex;/* serialize scanning activity */ 474 475 struct list_head eh_cmd_q; 476 struct task_struct * ehandler; /* Error recovery thread. */
··· 5 #include <linux/list.h> 6 #include <linux/types.h> 7 #include <linux/workqueue.h> 8 + #include <linux/mutex.h> 9 10 struct block_device; 11 struct completion; ··· 469 spinlock_t default_lock; 470 spinlock_t *host_lock; 471 472 + struct mutex scan_mutex;/* serialize scanning activity */ 473 474 struct list_head eh_cmd_q; 475 struct task_struct * ehandler; /* Error recovery thread. */
+2 -5
include/scsi/scsi_transport.h
··· 30 struct transport_container device_attrs; 31 32 /* 33 - * If set, call target_parent prior to allocating a scsi_target, 34 - * so we get the appropriate parent for the target. This function 35 - * is required for transports like FC and iSCSI that do not put the 36 - * scsi_target under scsi_host. 37 */ 38 - struct device *(*target_parent)(struct Scsi_Host *, int, uint); 39 40 /* The size of the specific transport attribute structure (a 41 * space of this size will be left at the end of the
··· 30 struct transport_container device_attrs; 31 32 /* 33 + * If set, called from sysfs and legacy procfs rescanning code. 34 */ 35 + int (*user_scan)(struct Scsi_Host *, uint, uint, uint); 36 37 /* The size of the specific transport attribute structure (a 38 * space of this size will be left at the end of the
+4
include/scsi/scsi_transport_fc.h
··· 303 /* Fixed Attributes */ 304 u64 node_name; 305 u64 port_name; 306 u32 supported_classes; 307 u8 supported_fc4s[FC_FC4_LIST_SIZE]; 308 char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; ··· 339 (((struct fc_host_attrs *)(x)->shost_data)->node_name) 340 #define fc_host_port_name(x) \ 341 (((struct fc_host_attrs *)(x)->shost_data)->port_name) 342 #define fc_host_supported_classes(x) \ 343 (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) 344 #define fc_host_supported_fc4s(x) \ ··· 429 /* host fixed attributes */ 430 unsigned long show_host_node_name:1; 431 unsigned long show_host_port_name:1; 432 unsigned long show_host_supported_classes:1; 433 unsigned long show_host_supported_fc4s:1; 434 unsigned long show_host_symbolic_name:1;
··· 303 /* Fixed Attributes */ 304 u64 node_name; 305 u64 port_name; 306 + u64 permanent_port_name; 307 u32 supported_classes; 308 u8 supported_fc4s[FC_FC4_LIST_SIZE]; 309 char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; ··· 338 (((struct fc_host_attrs *)(x)->shost_data)->node_name) 339 #define fc_host_port_name(x) \ 340 (((struct fc_host_attrs *)(x)->shost_data)->port_name) 341 + #define fc_host_permanent_port_name(x) \ 342 + (((struct fc_host_attrs *)(x)->shost_data)->permanent_port_name) 343 #define fc_host_supported_classes(x) \ 344 (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) 345 #define fc_host_supported_fc4s(x) \ ··· 426 /* host fixed attributes */ 427 unsigned long show_host_node_name:1; 428 unsigned long show_host_port_name:1; 429 + unsigned long show_host_permanent_port_name:1; 430 unsigned long show_host_supported_classes:1; 431 unsigned long show_host_supported_fc4s:1; 432 unsigned long show_host_symbolic_name:1;
+67 -8
include/scsi/scsi_transport_iscsi.h
··· 23 #ifndef SCSI_TRANSPORT_ISCSI_H 24 #define SCSI_TRANSPORT_ISCSI_H 25 26 #include <scsi/iscsi_if.h> 27 28 /** 29 * struct iscsi_transport - iSCSI Transport template ··· 54 char *name; 55 unsigned int caps; 56 struct scsi_host_template *host_template; 57 int hostdata_size; 58 int max_lun; 59 unsigned int max_conn; 60 unsigned int max_cmd_len; 61 - iscsi_sessionh_t (*create_session) (uint32_t initial_cmdsn, 62 - struct Scsi_Host *shost); 63 - void (*destroy_session) (iscsi_sessionh_t session); 64 - iscsi_connh_t (*create_conn) (iscsi_sessionh_t session, uint32_t cid); 65 int (*bind_conn) (iscsi_sessionh_t session, iscsi_connh_t conn, 66 uint32_t transport_fd, int is_leading); 67 int (*start_conn) (iscsi_connh_t conn); 68 void (*stop_conn) (iscsi_connh_t conn, int flag); 69 - void (*destroy_conn) (iscsi_connh_t conn); 70 int (*set_param) (iscsi_connh_t conn, enum iscsi_param param, 71 uint32_t value); 72 - int (*get_param) (iscsi_connh_t conn, enum iscsi_param param, 73 - uint32_t *value); 74 int (*send_pdu) (iscsi_connh_t conn, struct iscsi_hdr *hdr, 75 char *data, uint32_t data_size); 76 void (*get_stats) (iscsi_connh_t conn, struct iscsi_stats *stats); ··· 87 /* 88 * transport registration upcalls 89 */ 90 - extern int iscsi_register_transport(struct iscsi_transport *tt); 91 extern int iscsi_unregister_transport(struct iscsi_transport *tt); 92 93 /* ··· 96 extern void iscsi_conn_error(iscsi_connh_t conn, enum iscsi_err error); 97 extern int iscsi_recv_pdu(iscsi_connh_t conn, struct iscsi_hdr *hdr, 98 char *data, uint32_t data_size); 99 100 #endif
··· 23 #ifndef SCSI_TRANSPORT_ISCSI_H 24 #define SCSI_TRANSPORT_ISCSI_H 25 26 + #include <linux/device.h> 27 #include <scsi/iscsi_if.h> 28 + 29 + struct scsi_transport_template; 30 + struct Scsi_Host; 31 + struct mempool_zone; 32 + struct iscsi_cls_conn; 33 34 /** 35 * struct iscsi_transport - iSCSI Transport template ··· 48 char *name; 49 unsigned int caps; 50 struct scsi_host_template *host_template; 51 + /* LLD session/scsi_host data size */ 52 int hostdata_size; 53 + /* LLD iscsi_host data size */ 54 + int ihostdata_size; 55 + /* LLD connection data size */ 56 + int conndata_size; 57 int max_lun; 58 unsigned int max_conn; 59 unsigned int max_cmd_len; 60 + struct Scsi_Host *(*create_session) (struct scsi_transport_template *t, 61 + uint32_t initial_cmdsn); 62 + void (*destroy_session) (struct Scsi_Host *shost); 63 + struct iscsi_cls_conn *(*create_conn) (struct Scsi_Host *shost, 64 + uint32_t cid); 65 int (*bind_conn) (iscsi_sessionh_t session, iscsi_connh_t conn, 66 uint32_t transport_fd, int is_leading); 67 int (*start_conn) (iscsi_connh_t conn); 68 void (*stop_conn) (iscsi_connh_t conn, int flag); 69 + void (*destroy_conn) (struct iscsi_cls_conn *conn); 70 int (*set_param) (iscsi_connh_t conn, enum iscsi_param param, 71 uint32_t value); 72 + int (*get_conn_param) (void *conndata, enum iscsi_param param, 73 + uint32_t *value); 74 + int (*get_session_param) (struct Scsi_Host *shost, 75 + enum iscsi_param param, uint32_t *value); 76 int (*send_pdu) (iscsi_connh_t conn, struct iscsi_hdr *hdr, 77 char *data, uint32_t data_size); 78 void (*get_stats) (iscsi_connh_t conn, struct iscsi_stats *stats); ··· 73 /* 74 * transport registration upcalls 75 */ 76 + extern struct scsi_transport_template *iscsi_register_transport(struct iscsi_transport *tt); 77 extern int iscsi_unregister_transport(struct iscsi_transport *tt); 78 79 /* ··· 82 extern void iscsi_conn_error(iscsi_connh_t conn, enum iscsi_err error); 83 extern int iscsi_recv_pdu(iscsi_connh_t conn, struct iscsi_hdr *hdr, 84 char *data, uint32_t data_size); 85 + 86 + struct iscsi_cls_conn { 87 + struct list_head conn_list; /* item in connlist */ 88 + void *dd_data; /* LLD private data */ 89 + struct iscsi_transport *transport; 90 + iscsi_connh_t connh; 91 + int active; /* must be accessed with the connlock */ 92 + struct device dev; /* sysfs transport/container device */ 93 + struct mempool_zone *z_error; 94 + struct mempool_zone *z_pdu; 95 + struct list_head freequeue; 96 + }; 97 + 98 + #define iscsi_dev_to_conn(_dev) \ 99 + container_of(_dev, struct iscsi_cls_conn, dev) 100 + 101 + struct iscsi_cls_session { 102 + struct list_head list; /* item in session_list */ 103 + struct iscsi_transport *transport; 104 + struct device dev; /* sysfs transport/container device */ 105 + }; 106 + 107 + #define iscsi_dev_to_session(_dev) \ 108 + container_of(_dev, struct iscsi_cls_session, dev) 109 + 110 + #define iscsi_session_to_shost(_session) \ 111 + dev_to_shost(_session->dev.parent) 112 + 113 + /* 114 + * session and connection functions that can be used by HW iSCSI LLDs 115 + */ 116 + extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, 117 + struct iscsi_transport *t); 118 + extern int iscsi_destroy_session(struct iscsi_cls_session *session); 119 + extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, 120 + uint32_t cid); 121 + extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); 122 + 123 + /* 124 + * session functions used by software iscsi 125 + */ 126 + extern struct Scsi_Host * 127 + iscsi_transport_create_session(struct scsi_transport_template *scsit, 128 + struct iscsi_transport *transport); 129 + extern int iscsi_transport_destroy_session(struct Scsi_Host *shost); 130 131 #endif
+1 -1
include/scsi/scsi_transport_spi.h
··· 54 unsigned int support_qas; /* supports quick arbitration and selection */ 55 /* Private Fields */ 56 unsigned int dv_pending:1; /* Internal flag */ 57 - struct semaphore dv_sem; /* semaphore to serialise dv */ 58 }; 59 60 enum spi_signal_type {
··· 54 unsigned int support_qas; /* supports quick arbitration and selection */ 55 /* Private Fields */ 56 unsigned int dv_pending:1; /* Internal flag */ 57 + struct mutex dv_mutex; /* semaphore to serialise dv */ 58 }; 59 60 enum spi_signal_type {