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 23 tristate "Fusion MPT ScsiHost drivers for FC" 24 24 depends on PCI && SCSI 25 25 select FUSION 26 + select SCSI_FC_ATTRS 26 27 ---help--- 27 28 SCSI HOST support for a Fiber Channel host adapters. 28 29
+7 -3
drivers/message/fusion/lsi/mpi.h
··· 6 6 * Title: MPI Message independent structures and definitions 7 7 * Creation Date: July 27, 2000 8 8 * 9 - * mpi.h Version: 01.05.08 9 + * mpi.h Version: 01.05.10 10 10 * 11 11 * Version History 12 12 * --------------- ··· 74 74 * 06-24-05 01.05.08 Added function codes for SCSI IO 32 and 75 75 * TargetAssistExtended requests. 76 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. 77 79 * -------------------------------------------------------------------------- 78 80 */ 79 81 ··· 106 104 /* Note: The major versions of 0xe0 through 0xff are reserved */ 107 105 108 106 /* versioning for this MPI header set */ 109 - #define MPI_HEADER_VERSION_UNIT (0x0A) 107 + #define MPI_HEADER_VERSION_UNIT (0x0C) 110 108 #define MPI_HEADER_VERSION_DEV (0x00) 111 109 #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) 112 110 #define MPI_HEADER_VERSION_UNIT_SHIFT (8) ··· 713 711 #define MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D) 714 712 #define MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E) 715 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 716 717 717 /****************************************************************************/ 718 718 /* Additional FCP target values (obsolete) */ ··· 749 745 #define MPI_IOCSTATUS_LAN_CANCELED (0x0087) 750 746 751 747 /****************************************************************************/ 752 - /* Serial Attached SCSI values */ 748 + /* Serial Attached SCSI values */ 753 749 /****************************************************************************/ 754 750 755 751 #define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
+95 -59
drivers/message/fusion/lsi/mpi_cnfg.h
··· 6 6 * Title: MPI Config message, structures, and Pages 7 7 * Creation Date: July 27, 2000 8 8 * 9 - * mpi_cnfg.h Version: 01.05.09 9 + * mpi_cnfg.h Version: 01.05.11 10 10 * 11 11 * Version History 12 12 * --------------- ··· 249 249 * Added OwnerDevHandle and Flags field to SAS PHY Page 0. 250 250 * Added IOC GPIO Flags define to SAS Enclosure Page 0. 251 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. 252 269 * -------------------------------------------------------------------------- 253 270 */ 254 271 ··· 511 494 #define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) 512 495 #define MPI_MANUFACTPAGE_DEVICEID_FC939X (0x0642) 513 496 #define MPI_MANUFACTPAGE_DEVICEID_FC949X (0x0640) 514 - #define MPI_MANUFACTPAGE_DEVICEID_FC949ES (0x0646) 497 + #define MPI_MANUFACTPAGE_DEVICEID_FC949E (0x0646) 515 498 /* SCSI */ 516 499 #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) 517 500 #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) ··· 527 510 #define MPI_MANUFACTPAGE_DEVID_SAS1066E (0x005A) 528 511 #define MPI_MANUFACTPAGE_DEVID_SAS1068 (0x0054) 529 512 #define MPI_MANUFACTPAGE_DEVID_SAS1068E (0x0058) 530 - #define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0060) 513 + #define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0062) 531 514 532 515 533 516 typedef struct _CONFIG_PAGE_MANUFACTURING_0 ··· 619 602 U32 IMVolumeSettings; /* 50h */ 620 603 U32 Reserved3; /* 54h */ 621 604 U32 Reserved4; /* 58h */ 622 - U8 ISDataScrubRate; /* 5Ch */ 623 - U8 ISResyncRate; /* 5Dh */ 624 - U16 Reserved5; /* 5Eh */ 605 + U32 Reserved5; /* 5Ch */ 625 606 U8 IMEDataScrubRate; /* 60h */ 626 607 U8 IMEResyncRate; /* 61h */ 627 608 U16 Reserved6; /* 62h */ ··· 631 616 } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, 632 617 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; 633 618 634 - #define MPI_MANUFACTURING4_PAGEVERSION (0x02) 619 + #define MPI_MANUFACTURING4_PAGEVERSION (0x03) 635 620 636 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) 637 627 #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) 638 628 639 629 ··· 689 669 } CONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, 690 670 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; 691 671 692 - #define MPI_IOUNITPAGE1_PAGEVERSION (0x01) 672 + #define MPI_IOUNITPAGE1_PAGEVERSION (0x02) 693 673 694 674 /* IO Unit Page 1 Flags defines */ 695 675 #define MPI_IOUNITPAGE1_MULTI_FUNCTION (0x00000000) ··· 701 681 #define MPI_IOUNITPAGE1_DISABLE_IR (0x00000040) 702 682 #define MPI_IOUNITPAGE1_FORCE_32 (0x00000080) 703 683 #define MPI_IOUNITPAGE1_NATIVE_COMMAND_Q_DISABLE (0x00000100) 704 - 684 + #define MPI_IOUNITPAGE1_SATA_WRITE_CACHE_DISABLE (0x00000200) 705 685 706 686 typedef struct _MPI_ADAPTER_INFO 707 687 { ··· 988 968 U32 Reserved1; /* 0Ch */ 989 969 U32 DeviceSettings; /* 10h */ 990 970 U16 NumberOfDevices; /* 14h */ 991 - U16 Reserved2; /* 16h */ 971 + U8 ExpanderSpinup; /* 16h */ 972 + U8 Reserved2; /* 17h */ 992 973 U16 IOTimeoutBlockDevicesNonRM; /* 18h */ 993 974 U16 IOTimeoutSequential; /* 1Ah */ 994 975 U16 IOTimeoutOther; /* 1Ch */ ··· 997 976 } CONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1, 998 977 BIOSPage1_t, MPI_POINTER pBIOSPage1_t; 999 978 1000 - #define MPI_BIOSPAGE1_PAGEVERSION (0x02) 979 + #define MPI_BIOSPAGE1_PAGEVERSION (0x03) 1001 980 1002 981 /* values for the BiosOptions field */ 1003 982 #define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) ··· 1006 985 #define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) 1007 986 1008 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 + 1009 991 #define MPI_BIOSPAGE1_IOCSET_MASK_PORT_ENABLE_DELAY (0x00F00000) 1010 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 + 1011 997 #define MPI_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) 1012 998 #define MPI_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT (0x00000000) 1013 999 #define MPI_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT (0x00010000) ··· 1043 1015 #define MPI_BIOSPAGE1_DEVSET_DISABLE_RM_LUN (0x00000004) 1044 1016 #define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) 1045 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) 1046 1023 1047 1024 typedef struct _MPI_BOOT_DEVICE_ADAPTER_ORDER 1048 1025 { ··· 1266 1233 1267 1234 #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD (8) 1268 1235 #define MPI_SCSIPORTPAGE0_CAP_GET_MIN_SYNC_PERIOD(Cap) \ 1269 - ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MIN_SYNC_PERIOD) \ 1236 + ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK) \ 1270 1237 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MIN_SYNC_PERIOD \ 1271 1238 ) 1272 1239 #define MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1273 1240 #define MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET (16) 1274 1241 #define MPI_SCSIPORTPAGE0_CAP_GET_MAX_SYNC_OFFSET(Cap) \ 1275 - ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \ 1242 + ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK) \ 1276 1243 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \ 1277 1244 ) 1278 1245 #define MPI_SCSIPORTPAGE0_CAP_IDP (0x08000000) ··· 2403 2370 } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, 2404 2371 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; 2405 2372 2406 - #define MPI_SASIOUNITPAGE1_PAGEVERSION (0x04) 2373 + #define MPI_SASIOUNITPAGE1_PAGEVERSION (0x05) 2407 2374 2408 2375 /* 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) 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) 2414 2381 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) 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) 2420 2387 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) 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) 2429 2397 2430 2398 /* 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) 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) 2434 2402 2435 2403 /* 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) 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) 2439 2407 2440 2408 /* 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) 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) 2447 2415 2448 2416 /* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ 2449 2417 ··· 2452 2418 typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2 2453 2419 { 2454 2420 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2455 - U32 Reserved1; /* 08h */ 2421 + U8 NumDevsPerEnclosure; /* 08h */ 2422 + U8 Reserved1; /* 09h */ 2423 + U16 Reserved2; /* 0Ah */ 2456 2424 U16 MaxPersistentIDs; /* 0Ch */ 2457 2425 U16 NumPersistentIDsUsed; /* 0Eh */ 2458 2426 U8 Status; /* 10h */ 2459 2427 U8 Flags; /* 11h */ 2460 - U16 MaxNumPhysicalMappedIDs;/* 12h */ /* 12h */ 2428 + U16 MaxNumPhysicalMappedIDs;/* 12h */ 2461 2429 } CONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2, 2462 2430 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t; 2463 2431 2464 - #define MPI_SASIOUNITPAGE2_PAGEVERSION (0x04) 2432 + #define MPI_SASIOUNITPAGE2_PAGEVERSION (0x05) 2465 2433 2466 2434 /* values for SAS IO Unit Page 2 Status field */ 2467 2435 #define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02) ··· 2477 2441 #define MPI_SAS_IOUNIT2_FLAGS_NO_PHYS_MAP (0x00) 2478 2442 #define MPI_SAS_IOUNIT2_FLAGS_DIRECT_ATTACH_PHYS_MAP (0x01) 2479 2443 #define MPI_SAS_IOUNIT2_FLAGS_ENCLOSURE_SLOT_PHYS_MAP (0x02) 2444 + #define MPI_SAS_IOUNIT2_FLAGS_HOST_ASSIGNED_PHYS_MAP (0x07) 2480 2445 2481 2446 #define MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT (0x10) 2482 2447 #define MPI_SAS_IOUNIT2_FLAGS_DA_STARTING_SLOT (0x20) ··· 2510 2473 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2511 2474 U8 PhysicalPort; /* 08h */ 2512 2475 U8 Reserved1; /* 09h */ 2513 - U16 Reserved2; /* 0Ah */ 2476 + U16 EnclosureHandle; /* 0Ah */ 2514 2477 U64 SASAddress; /* 0Ch */ 2515 2478 U32 DiscoveryStatus; /* 14h */ 2516 2479 U16 DevHandle; /* 18h */ ··· 2524 2487 } CONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0, 2525 2488 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t; 2526 2489 2527 - #define MPI_SASEXPANDER0_PAGEVERSION (0x02) 2490 + #define MPI_SASEXPANDER0_PAGEVERSION (0x03) 2528 2491 2529 2492 /* values for SAS Expander Page 0 DiscoveryStatus field */ 2530 2493 #define MPI_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001) ··· 2564 2527 U8 NegotiatedLinkRate; /* 1Fh */ 2565 2528 U8 PhyIdentifier; /* 20h */ 2566 2529 U8 AttachedPhyIdentifier; /* 21h */ 2567 - U8 NumTableEntriesProg; /* 22h */ 2530 + U8 Reserved3; /* 22h */ 2568 2531 U8 DiscoveryInfo; /* 23h */ 2569 - U32 Reserved3; /* 24h */ 2532 + U32 Reserved4; /* 24h */ 2570 2533 } CONFIG_PAGE_SAS_EXPANDER_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_1, 2571 2534 SasExpanderPage1_t, MPI_POINTER pSasExpanderPage1_t; 2572 2535 ··· 2803 2766 #define MPI_LOG_0_NUM_LOG_ENTRIES (1) 2804 2767 #endif 2805 2768 2806 - #define MPI_LOG_0_LOG_DATA_LENGTH (20) 2769 + #define MPI_LOG_0_LOG_DATA_LENGTH (0x1C) 2807 2770 2808 2771 typedef struct _MPI_LOG_0_ENTRY 2809 2772 { 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 */ 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 */ 2816 2778 } MPI_LOG_0_ENTRY, MPI_POINTER PTR_MPI_LOG_0_ENTRY, 2817 2779 MpiLog0Entry_t, MPI_POINTER pMpiLog0Entry_t; 2818 2780 ··· 2830 2794 } CONFIG_PAGE_LOG_0, MPI_POINTER PTR_CONFIG_PAGE_LOG_0, 2831 2795 LogPage0_t, MPI_POINTER pLogPage0_t; 2832 2796 2833 - #define MPI_LOG_0_PAGEVERSION (0x00) 2797 + #define MPI_LOG_0_PAGEVERSION (0x01) 2834 2798 2835 2799 2836 2800 #endif
+53 -24
drivers/message/fusion/lsi/mpi_history.txt
··· 6 6 Copyright (c) 2000-2005 LSI Logic Corporation. 7 7 8 8 --------------------------------------- 9 - Header Set Release Version: 01.05.10 10 - Header Set Release Date: 03-11-05 9 + Header Set Release Version: 01.05.12 10 + Header Set Release Date: 08-30-05 11 11 --------------------------------------- 12 12 13 13 Filename Current version Prior version 14 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 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 20 mpi_fc.h 01.05.01 01.05.01 21 21 mpi_lan.h 01.05.01 01.05.01 22 22 mpi_raid.h 01.05.02 01.05.02 23 23 mpi_tool.h 01.05.03 01.05.03 24 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 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 28 29 29 30 30 * Date Version Description ··· 91 91 * 06-24-05 01.05.08 Added function codes for SCSI IO 32 and 92 92 * TargetAssistExtended requests. 93 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. 94 96 * -------------------------------------------------------------------------- 95 97 96 98 mpi_ioc.h ··· 166 164 * Removed IOCFacts Reply EEDP Capability bit. 167 165 * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. 168 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. 169 171 * -------------------------------------------------------------------------- 170 172 171 173 mpi_cnfg.h ··· 408 402 * Added OwnerDevHandle and Flags field to SAS PHY Page 0. 409 403 * Added IOC GPIO Flags define to SAS Enclosure Page 0. 410 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. 411 422 * -------------------------------------------------------------------------- 412 423 413 424 mpi_init.h ··· 465 442 * addressing. 466 443 * 06-24-05 01.05.05 Added SCSI IO 32 structures and defines. 467 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. 468 447 * -------------------------------------------------------------------------- 469 448 470 449 mpi_targ.h ··· 607 582 608 583 mpi_sas.h 609 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. 610 588 * -------------------------------------------------------------------------- 611 589 612 590 mpi_type.h ··· 620 592 * 08-08-01 01.02.01 Original release for v1.2 work. 621 593 * 05-11-04 01.03.01 Original release for MPI v1.3. 622 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. 623 596 * -------------------------------------------------------------------------- 624 597 625 598 mpi_history.txt Parts list history 626 599 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 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 641 614 642 615 Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 643 616 ---------- -------- -------- -------- -------- -------- --------
+5 -3
drivers/message/fusion/lsi/mpi_init.h
··· 6 6 * Title: MPI initiator mode messages and structures 7 7 * Creation Date: June 8, 2000 8 8 * 9 - * mpi_init.h Version: 01.05.05 9 + * mpi_init.h Version: 01.05.06 10 10 * 11 11 * Version History 12 12 * --------------- ··· 50 50 * addressing. 51 51 * 06-24-05 01.05.05 Added SCSI IO 32 structures and defines. 52 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. 53 55 * -------------------------------------------------------------------------- 54 56 */ 55 57 ··· 292 290 293 291 /* SCSI IO 32 MsgFlags bits */ 294 292 #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) 293 + #define MPI_SCSIIO32_MSGFLGS_32_SENSE_WIDTH (0x00) 294 + #define MPI_SCSIIO32_MSGFLGS_64_SENSE_WIDTH (0x01) 297 295 298 296 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION (0x02) 299 297 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST (0x00)
+121 -1
drivers/message/fusion/lsi/mpi_ioc.h
··· 6 6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 7 7 * Creation Date: August 11, 2000 8 8 * 9 - * mpi_ioc.h Version: 01.05.09 9 + * mpi_ioc.h Version: 01.05.10 10 10 * 11 11 * Version History 12 12 * --------------- ··· 83 83 * Removed IOCFacts Reply EEDP Capability bit. 84 84 * 06-24-05 01.05.09 Added 5 new IOCFacts Reply IOCCapabilities bits. 85 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. 86 90 * -------------------------------------------------------------------------- 87 91 */ 88 92 ··· 468 464 #define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) 469 465 #define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) 470 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 471 472 472 /* AckRequired field values */ 473 473 ··· 487 479 U16 Reserved1; /* 02h */ 488 480 } EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE, 489 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; 490 505 491 506 /* SCSI Event data for Port, Bus and Device forms */ 492 507 ··· 569 538 #define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) 570 539 #define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) 571 540 #define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) 541 + #define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) 572 542 573 543 574 544 /* SCSI Event data for Queue Full event */ ··· 610 578 #define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) 611 579 #define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) 612 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) 613 654 614 655 /* MPI Link Status Change Event data */ 615 656 ··· 764 659 #define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03) 765 660 #define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08) 766 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) 767 676 768 677 /* SAS Discovery Errror Event data */ 769 678 ··· 988 869 #define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) /* 919XL and 929XL */ 989 870 #define MPI_FW_HEADER_PID_FAMILY_939X_FC (0x0004) /* 939X and 949X */ 990 871 #define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005) 872 + #define MPI_FW_HEADER_PID_FAMILY_949E_FC (0x0006) 991 873 /* SAS */ 992 874 #define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001) 993 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 6 * Title: MPI Serial Attached SCSI structures and definitions 7 7 * Creation Date: August 19, 2004 8 8 * 9 - * mpi_sas.h Version: 01.05.01 9 + * mpi_sas.h Version: 01.05.02 10 10 * 11 11 * Version History 12 12 * --------------- ··· 14 14 * Date Version Description 15 15 * -------- -------- ------------------------------------------------------ 16 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. 17 20 * -------------------------------------------------------------------------- 18 21 */ 19 22 ··· 54 51 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event 55 52 * data and SAS IO Unit Configuration pages. 56 53 */ 54 + #define MPI_SAS_DEVICE_INFO_SEP (0x00004000) 57 55 #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) 58 56 #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) 59 57 #define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800) ··· 216 212 U8 TargetID; /* 0Ch */ 217 213 U8 Bus; /* 0Dh */ 218 214 U8 PhyNum; /* 0Eh */ 219 - U8 Reserved4; /* 0Fh */ 220 - U32 Reserved5; /* 10h */ 215 + U8 PrimFlags; /* 0Fh */ 216 + U32 Primitive; /* 10h */ 221 217 U64 SASAddress; /* 14h */ 222 - U32 Reserved6; /* 1Ch */ 218 + U32 Reserved4; /* 1Ch */ 223 219 } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 224 220 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 225 221 226 222 /* 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) 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) 233 235 234 236 235 237 /* SAS IO Unit Control Reply */
+37 -11
drivers/message/fusion/mptbase.c
··· 148 148 static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 149 149 static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 150 150 static int GetLanConfigPages(MPT_ADAPTER *ioc); 151 - static int GetFcPortPage0(MPT_ADAPTER *ioc, int portnum); 152 151 static int GetIoUnitPage2(MPT_ADAPTER *ioc); 153 152 int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 154 153 static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum); ··· 1231 1232 dprintk((KERN_INFO MYNAM 1232 1233 ": Not using 64 bit consistent mask\n")); 1233 1234 1234 - ioc = kmalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); 1235 + ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); 1235 1236 if (ioc == NULL) { 1236 1237 printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); 1237 1238 return -ENOMEM; 1238 1239 } 1239 - memset(ioc, 0, sizeof(MPT_ADAPTER)); 1240 1240 ioc->alloc_total = sizeof(MPT_ADAPTER); 1241 1241 ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ 1242 1242 ioc->reply_sz = MPT_REPLY_FRAME_SIZE; ··· 1243 1245 ioc->pcidev = pdev; 1244 1246 ioc->diagPending = 0; 1245 1247 spin_lock_init(&ioc->diagLock); 1248 + spin_lock_init(&ioc->fc_rescan_work_lock); 1249 + spin_lock_init(&ioc->fc_rport_lock); 1246 1250 spin_lock_init(&ioc->initializing_hba_lock); 1247 1251 1248 1252 /* Initialize the event logging. ··· 1267 1267 /* Initialize the running configQ head. 1268 1268 */ 1269 1269 INIT_LIST_HEAD(&ioc->configQ); 1270 + 1271 + /* Initialize the fc rport list head. 1272 + */ 1273 + INIT_LIST_HEAD(&ioc->fc_rports); 1270 1274 1271 1275 /* Find lookup slot. */ 1272 1276 INIT_LIST_HEAD(&ioc->list); ··· 1377 1373 ioc->prod_name = "LSIFC949X"; 1378 1374 ioc->bus_type = FC; 1379 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 1380 } 1381 1381 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { 1382 1382 ioc->prod_name = "LSI53C1030"; ··· 1630 1622 pci_enable_device(pdev); 1631 1623 1632 1624 /* enable interrupts */ 1633 - CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1625 + CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); 1634 1626 ioc->active = 1; 1635 1627 1636 1628 /* F/W not running */ ··· 1723 1715 /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */ 1724 1716 dprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1725 1717 ioc->alt_ioc->name)); 1726 - CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1718 + CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 1727 1719 ioc->alt_ioc->active = 1; 1728 1720 } 1729 1721 ··· 1839 1831 1840 1832 if (ret == 0) { 1841 1833 /* Enable! (reply interrupt) */ 1842 - CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1834 + CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); 1843 1835 ioc->active = 1; 1844 1836 } 1845 1837 ··· 1847 1839 /* (re)Enable alt-IOC! (reply interrupt) */ 1848 1840 dinitprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1849 1841 ioc->alt_ioc->name)); 1850 - CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1842 + CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 1851 1843 ioc->alt_ioc->active = 1; 1852 1844 } 1853 1845 ··· 1888 1880 * (FCPortPage0_t stuff) 1889 1881 */ 1890 1882 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 1891 - (void) GetFcPortPage0(ioc, ii); 1883 + (void) mptbase_GetFcPortPage0(ioc, ii); 1892 1884 } 1893 1885 1894 1886 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && ··· 4207 4199 4208 4200 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 4209 4201 /* 4210 - * GetFcPortPage0 - Fetch FCPort config Page0. 4202 + * mptbase_GetFcPortPage0 - Fetch FCPort config Page0. 4211 4203 * @ioc: Pointer to MPT_ADAPTER structure 4212 4204 * @portnum: IOC Port number 4213 4205 * ··· 4217 4209 * -EAGAIN if no msg frames currently available 4218 4210 * -EFAULT for non-successful reply or no reply (timeout) 4219 4211 */ 4220 - static int 4221 - GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) 4212 + int 4213 + mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) 4222 4214 { 4223 4215 ConfigPageHeader_t hdr; 4224 4216 CONFIGPARMS cfg; ··· 4228 4220 int data_sz; 4229 4221 int copy_sz; 4230 4222 int rc; 4223 + int count = 400; 4224 + 4231 4225 4232 4226 /* Get FCPort Page 0 header */ 4233 4227 hdr.PageVersion = 0; ··· 4253 4243 rc = -ENOMEM; 4254 4244 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); 4255 4245 if (ppage0_alloc) { 4246 + 4247 + try_again: 4256 4248 memset((u8 *)ppage0_alloc, 0, data_sz); 4257 4249 cfg.physAddr = page0_dma; 4258 4250 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; ··· 4286 4274 pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount); 4287 4275 pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators); 4288 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 + } 4289 4290 } 4290 4291 4291 4292 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); ··· 6383 6358 EXPORT_SYMBOL(mpt_free_fw_memory); 6384 6359 EXPORT_SYMBOL(mptbase_sas_persist_operation); 6385 6360 EXPORT_SYMBOL(mpt_alt_ioc_wait); 6361 + EXPORT_SYMBOL(mptbase_GetFcPortPage0); 6386 6362 6387 6363 6388 6364 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+30 -4
drivers/message/fusion/mptbase.h
··· 76 76 #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR 77 77 #endif 78 78 79 - #define MPT_LINUX_VERSION_COMMON "3.03.05" 80 - #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.05" 79 + #define MPT_LINUX_VERSION_COMMON "3.03.06" 80 + #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.06" 81 81 #define WHAT_MAGIC_STRING "@" "(" "#" ")" 82 82 83 83 #define show_mptmod_ver(s,ver) \ ··· 413 413 u8 status; /* current command status */ 414 414 u8 reset; /* 1 if bus reset allowed */ 415 415 u8 target; /* target for reset */ 416 - struct semaphore sem_ioc; 416 + struct mutex ioctl_mutex; 417 417 } MPT_IOCTL; 418 418 419 419 #define MPT_SAS_MGMT_STATUS_RF_VALID 0x02 /* The Reply Frame is VALID */ ··· 421 421 #define MPT_SAS_MGMT_STATUS_TM_FAILED 0x40 /* User TM request failed */ 422 422 423 423 typedef struct _MPT_SAS_MGMT { 424 - struct semaphore mutex; 424 + struct mutex mutex; 425 425 struct completion done; 426 426 u8 reply[MPT_DEFAULT_FRAME_SIZE]; /* reply frame data */ 427 427 u8 status; /* current command status */ ··· 498 498 IOCPage3_t *pIocPg3; /* table of physical disks */ 499 499 int isRaid; /* bit field, 1 if RAID */ 500 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 + }; 501 517 502 518 /* 503 519 * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS ··· 628 612 struct list_head list; 629 613 struct net_device *netdev; 630 614 struct list_head sas_topology; 615 + struct mutex sas_topology_mutex; 631 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 + 632 625 } MPT_ADAPTER; 633 626 634 627 /* ··· 1024 999 extern int mpt_findImVolumes(MPT_ADAPTER *ioc); 1025 1000 extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); 1026 1001 extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 1002 + extern int mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum); 1027 1003 extern int mpt_alt_ioc_wait(MPT_ADAPTER *ioc); 1028 1004 1029 1005 /*
+6 -6
drivers/message/fusion/mptctl.c
··· 177 177 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock)); 178 178 179 179 if (nonblock) { 180 - if (down_trylock(&ioc->ioctl->sem_ioc)) 180 + if (!mutex_trylock(&ioc->ioctl->ioctl_mutex)) 181 181 rc = -EAGAIN; 182 182 } else { 183 - if (down_interruptible(&ioc->ioctl->sem_ioc)) 183 + if (mutex_lock_interruptible(&ioc->ioctl->ioctl_mutex)) 184 184 rc = -ERESTARTSYS; 185 185 } 186 186 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc)); ··· 557 557 else 558 558 ret = -EINVAL; 559 559 560 - up(&iocp->ioctl->sem_ioc); 560 + mutex_unlock(&iocp->ioctl->ioctl_mutex); 561 561 562 562 return ret; 563 563 } ··· 2619 2619 2620 2620 ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); 2621 2621 2622 - up(&iocp->ioctl->sem_ioc); 2622 + mutex_unlock(&iocp->ioctl->ioctl_mutex); 2623 2623 2624 2624 return ret; 2625 2625 } ··· 2673 2673 */ 2674 2674 ret = mptctl_do_mpt_command (karg, &uarg->MF); 2675 2675 2676 - up(&iocp->ioctl->sem_ioc); 2676 + mutex_unlock(&iocp->ioctl->ioctl_mutex); 2677 2677 2678 2678 return ret; 2679 2679 } ··· 2743 2743 memset(mem, 0, sz); 2744 2744 ioc->ioctl = (MPT_IOCTL *) mem; 2745 2745 ioc->ioctl->ioc = ioc; 2746 - sema_init(&ioc->ioctl->sem_ioc, 1); 2746 + mutex_init(&ioc->ioctl->ioctl_mutex); 2747 2747 return 0; 2748 2748 2749 2749 out_fail:
+546 -35
drivers/message/fusion/mptfc.c
··· 55 55 #include <linux/reboot.h> /* notifier code */ 56 56 #include <linux/sched.h> 57 57 #include <linux/workqueue.h> 58 + #include <linux/sort.h> 58 59 59 60 #include <scsi/scsi.h> 60 61 #include <scsi/scsi_cmnd.h> 61 62 #include <scsi/scsi_device.h> 62 63 #include <scsi/scsi_host.h> 63 64 #include <scsi/scsi_tcq.h> 65 + #include <scsi/scsi_transport_fc.h> 64 66 65 67 #include "mptbase.h" 66 68 #include "mptscsih.h" ··· 81 79 module_param(mpt_pq_filter, int, 0); 82 80 MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)"); 83 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 + 84 90 static int mptfcDoneCtx = -1; 85 91 static int mptfcTaskCtx = -1; 86 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); 87 100 88 101 static struct scsi_host_template mptfc_driver_template = { 89 102 .module = THIS_MODULE, ··· 106 89 .proc_info = mptscsih_proc_info, 107 90 .name = "MPT FC Host", 108 91 .info = mptscsih_info, 109 - .queuecommand = mptscsih_qcmd, 92 + .queuecommand = mptfc_qcmd, 110 93 .target_alloc = mptscsih_target_alloc, 111 - .slave_alloc = mptscsih_slave_alloc, 94 + .slave_alloc = mptfc_slave_alloc, 112 95 .slave_configure = mptscsih_slave_configure, 113 96 .target_destroy = mptscsih_target_destroy, 114 97 .slave_destroy = mptscsih_slave_destroy, ··· 145 128 PCI_ANY_ID, PCI_ANY_ID }, 146 129 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X, 147 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 }, 148 133 {0} /* Terminating entry */ 149 134 }; 150 135 MODULE_DEVICE_TABLE(pci, mptfc_pci_table); 151 136 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 - * 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 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 + 161 603 static int 162 604 mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) 163 605 { ··· 624 148 MPT_SCSI_HOST *hd; 625 149 MPT_ADAPTER *ioc; 626 150 unsigned long flags; 627 - int sz, ii; 151 + int ii; 628 152 int numSGE = 0; 629 153 int scale; 630 154 int ioc_cap; 631 - u8 *mem; 632 155 int error=0; 633 156 int r; 634 - 157 + 635 158 if ((r = mpt_attach(pdev,id)) != 0) 636 159 return r; 637 - 160 + 638 161 ioc = pci_get_drvdata(pdev); 639 162 ioc->DoneCtx = mptfcDoneCtx; 640 163 ioc->TaskCtx = mptfcTaskCtx; ··· 669 194 printk(MYIOC_s_WARN_FMT 670 195 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n", 671 196 ioc->name, ioc); 672 - return 0; 197 + return -ENODEV; 673 198 } 674 199 675 200 sh = scsi_host_alloc(&mptfc_driver_template, sizeof(MPT_SCSI_HOST)); ··· 681 206 error = -1; 682 207 goto out_mptfc_probe; 683 208 } 209 + 210 + INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices,(void *)ioc); 684 211 685 212 spin_lock_irqsave(&ioc->FreeQlock, flags); 686 213 ··· 745 268 /* SCSI needs scsi_cmnd lookup table! 746 269 * (with size equal to req_depth*PtrSz!) 747 270 */ 748 - sz = ioc->req_depth * sizeof(void *); 749 - mem = kmalloc(sz, GFP_ATOMIC); 750 - if (mem == NULL) { 271 + hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); 272 + if (!hd->ScsiLookup) { 751 273 error = -ENOMEM; 752 274 goto out_mptfc_probe; 753 275 } 754 276 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)); 277 + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n", 278 + ioc->name, hd->ScsiLookup)); 760 279 761 280 /* Allocate memory for the device structures. 762 281 * A non-Null pointer at an offset 763 282 * indicates a device exists. 764 283 * max_id = 1 + maximum id (hosts.h) 765 284 */ 766 - sz = sh->max_id * sizeof(void *); 767 - mem = kmalloc(sz, GFP_ATOMIC); 768 - if (mem == NULL) { 285 + hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC); 286 + if (!hd->Targets) { 769 287 error = -ENOMEM; 770 288 goto out_mptfc_probe; 771 289 } 772 290 773 - memset(mem, 0, sz); 774 - hd->Targets = (VirtTarget **) mem; 775 - 776 - dprintk((KERN_INFO 777 - " vdev @ %p, sz=%d\n", hd->Targets, sz)); 291 + dprintk((KERN_INFO " vdev @ %p\n", hd->Targets)); 778 292 779 293 /* Clear the TM flags 780 294 */ ··· 800 332 hd->scandv_wait_done = 0; 801 333 hd->last_queue_full = 0; 802 334 335 + sh->transportt = mptfc_transport_template; 803 336 error = scsi_add_host (sh, &ioc->pcidev->dev); 804 337 if(error) { 805 338 dprintk((KERN_ERR MYNAM ··· 808 339 goto out_mptfc_probe; 809 340 } 810 341 811 - scsi_scan_host(sh); 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 + 812 347 return 0; 813 348 814 349 out_mptfc_probe: ··· 825 352 .name = "mptfc", 826 353 .id_table = mptfc_pci_table, 827 354 .probe = mptfc_probe, 828 - .remove = __devexit_p(mptscsih_remove), 355 + .remove = __devexit_p(mptfc_remove), 829 356 .shutdown = mptscsih_shutdown, 830 357 #ifdef CONFIG_PM 831 358 .suspend = mptscsih_suspend, ··· 843 370 static int __init 844 371 mptfc_init(void) 845 372 { 373 + int error; 846 374 847 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; 848 386 849 387 mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER); 850 388 mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER); ··· 871 387 ": Registered for IOC reset notifications\n")); 872 388 } 873 389 874 - return pci_register_driver(&mptfc_driver); 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); 875 417 } 876 418 877 419 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ ··· 910 400 mptfc_exit(void) 911 401 { 912 402 pci_unregister_driver(&mptfc_driver); 913 - 403 + fc_release_transport(mptfc_transport_template); 404 + 914 405 mpt_reset_deregister(mptfcDoneCtx); 915 406 dprintk((KERN_INFO MYNAM 916 407 ": Deregistered for IOC reset notifications\n"));
+5 -9
drivers/message/fusion/mptlan.c
··· 411 411 goto out; 412 412 priv->mpt_txfidx_tail = -1; 413 413 414 - priv->SendCtl = kmalloc(priv->tx_max_out * sizeof(struct BufferControl), 414 + priv->SendCtl = kcalloc(priv->tx_max_out, sizeof(struct BufferControl), 415 415 GFP_KERNEL); 416 416 if (priv->SendCtl == NULL) 417 417 goto out_mpt_txfidx; 418 - for (i = 0; i < priv->tx_max_out; i++) { 419 - memset(&priv->SendCtl[i], 0, sizeof(struct BufferControl)); 418 + for (i = 0; i < priv->tx_max_out; i++) 420 419 priv->mpt_txfidx[++priv->mpt_txfidx_tail] = i; 421 - } 422 420 423 421 dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); 424 422 ··· 426 428 goto out_SendCtl; 427 429 priv->mpt_rxfidx_tail = -1; 428 430 429 - priv->RcvCtl = kmalloc(priv->max_buckets_out * 430 - sizeof(struct BufferControl), 431 + priv->RcvCtl = kcalloc(priv->max_buckets_out, 432 + sizeof(struct BufferControl), 431 433 GFP_KERNEL); 432 434 if (priv->RcvCtl == NULL) 433 435 goto out_mpt_rxfidx; 434 - for (i = 0; i < priv->max_buckets_out; i++) { 435 - memset(&priv->RcvCtl[i], 0, sizeof(struct BufferControl)); 436 + for (i = 0; i < priv->max_buckets_out; i++) 436 437 priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; 437 - } 438 438 439 439 /**/ dlprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); 440 440 /**/ for (i = 0; i < priv->tx_max_out; i++)
+346 -58
drivers/message/fusion/mptsas.c
··· 5 5 * 6 6 * Copyright (c) 1999-2005 LSI Logic Corporation 7 7 * (mailto:mpt_linux_developer@lsil.com) 8 - * Copyright (c) 2005 Dell 8 + * Copyright (c) 2005-2006 Dell 9 9 */ 10 10 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 11 11 /* ··· 86 86 static int mptsasMgmtCtx = -1; 87 87 88 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 + 89 107 /* 90 108 * SAS topology structures 91 109 * ··· 117 99 u8 phy_id; /* phy number of parent device */ 118 100 u8 port_id; /* sas physical port this device 119 101 is assoc'd with */ 120 - u8 target; /* logical target id of this device */ 121 - u8 bus; /* logical bus number of this device */ 102 + u8 id; /* logical target id of this device */ 103 + u8 channel; /* logical bus number of this device */ 122 104 u64 sas_address; /* WWN of this device, 123 105 SATA is assigned by HBA,expander */ 124 106 u32 device_info; /* bitfield detailed info about this device */ ··· 132 114 u8 programmed_link_rate; /* programmed max/min phy link rate */ 133 115 struct mptsas_devinfo identify; /* point to phy device info */ 134 116 struct mptsas_devinfo attached; /* point to attached device info */ 117 + struct sas_phy *phy; 135 118 struct sas_rphy *rphy; 136 119 }; 137 120 ··· 258 239 struct scsi_target *starget; 259 240 int i; 260 241 261 - vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); 242 + vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); 262 243 if (!vdev) { 263 244 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 264 245 hd->ioc->name, sizeof(VirtDevice)); 265 246 return -ENOMEM; 266 247 } 267 - memset(vdev, 0, sizeof(VirtDevice)); 268 248 vdev->ioc_id = hd->ioc->id; 269 249 sdev->hostdata = vdev; 270 250 starget = scsi_target(sdev); ··· 274 256 hd->Targets[sdev->id] = vtarget; 275 257 } 276 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 + 277 269 rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 270 + mutex_lock(&hd->ioc->sas_topology_mutex); 278 271 list_for_each_entry(p, &hd->ioc->sas_topology, list) { 279 272 for (i = 0; i < p->num_phys; i++) { 280 273 if (p->phy_info[i].attached.sas_address == 281 274 rphy->identify.sas_address) { 282 275 vdev->target_id = 283 - p->phy_info[i].attached.target; 284 - vdev->bus_id = p->phy_info[i].attached.bus; 276 + p->phy_info[i].attached.id; 277 + vdev->bus_id = p->phy_info[i].attached.channel; 285 278 vdev->lun = sdev->lun; 279 + mutex_unlock(&hd->ioc->sas_topology_mutex); 286 280 goto out; 287 281 } 288 282 } 289 283 } 284 + mutex_unlock(&hd->ioc->sas_topology_mutex); 290 285 291 286 printk("No matching SAS device found!!\n"); 292 287 kfree(vdev); ··· 313 282 return 0; 314 283 } 315 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 + 316 321 static struct scsi_host_template mptsas_driver_template = { 317 322 .module = THIS_MODULE, 318 323 .proc_name = "mptsas", ··· 360 293 .slave_alloc = mptsas_slave_alloc, 361 294 .slave_configure = mptscsih_slave_configure, 362 295 .target_destroy = mptscsih_target_destroy, 363 - .slave_destroy = mptscsih_slave_destroy, 296 + .slave_destroy = mptsas_slave_destroy, 364 297 .change_queue_depth = mptscsih_change_queue_depth, 365 298 .eh_abort_handler = mptscsih_abort, 366 299 .eh_device_reset_handler = mptscsih_dev_reset, ··· 466 399 if (phy->identify.target_port_protocols & SAS_PROTOCOL_SMP) 467 400 return -ENXIO; 468 401 469 - if (down_interruptible(&ioc->sas_mgmt.mutex)) 402 + if (mutex_lock_interruptible(&ioc->sas_mgmt.mutex)) 470 403 goto out; 471 404 472 405 mf = mpt_get_msg_frame(mptsasMgmtCtx, ioc); ··· 517 450 error = 0; 518 451 519 452 out_unlock: 520 - up(&ioc->sas_mgmt.mutex); 453 + mutex_unlock(&ioc->sas_mgmt.mutex); 521 454 out: 522 455 return error; 523 456 } ··· 716 649 device_info->handle = le16_to_cpu(buffer->DevHandle); 717 650 device_info->phy_id = buffer->PhyNum; 718 651 device_info->port_id = buffer->PhysicalPort; 719 - device_info->target = buffer->TargetID; 720 - device_info->bus = buffer->Bus; 652 + device_info->id = buffer->TargetID; 653 + device_info->channel = buffer->Bus; 721 654 memcpy(&sas_address, &buffer->SASAddress, sizeof(__le64)); 722 655 device_info->sas_address = le64_to_cpu(sas_address); 723 656 device_info->device_info = ··· 925 858 static int mptsas_probe_one_phy(struct device *dev, 926 859 struct mptsas_phyinfo *phy_info, int index, int local) 927 860 { 928 - struct sas_phy *port; 861 + struct sas_phy *phy; 929 862 int error; 930 863 931 - port = sas_phy_alloc(dev, index); 932 - if (!port) 864 + phy = sas_phy_alloc(dev, index); 865 + if (!phy) 933 866 return -ENOMEM; 934 867 935 - port->port_identifier = phy_info->port_id; 936 - mptsas_parse_device_info(&port->identify, &phy_info->identify); 868 + phy->port_identifier = phy_info->port_id; 869 + mptsas_parse_device_info(&phy->identify, &phy_info->identify); 937 870 938 871 /* 939 872 * Set Negotiated link rate. 940 873 */ 941 874 switch (phy_info->negotiated_link_rate) { 942 875 case MPI_SAS_IOUNIT0_RATE_PHY_DISABLED: 943 - port->negotiated_linkrate = SAS_PHY_DISABLED; 876 + phy->negotiated_linkrate = SAS_PHY_DISABLED; 944 877 break; 945 878 case MPI_SAS_IOUNIT0_RATE_FAILED_SPEED_NEGOTIATION: 946 - port->negotiated_linkrate = SAS_LINK_RATE_FAILED; 879 + phy->negotiated_linkrate = SAS_LINK_RATE_FAILED; 947 880 break; 948 881 case MPI_SAS_IOUNIT0_RATE_1_5: 949 - port->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; 882 + phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; 950 883 break; 951 884 case MPI_SAS_IOUNIT0_RATE_3_0: 952 - port->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; 885 + phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; 953 886 break; 954 887 case MPI_SAS_IOUNIT0_RATE_SATA_OOB_COMPLETE: 955 888 case MPI_SAS_IOUNIT0_RATE_UNKNOWN: 956 889 default: 957 - port->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; 890 + phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; 958 891 break; 959 892 } 960 893 ··· 963 896 */ 964 897 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) { 965 898 case MPI_SAS_PHY0_HWRATE_MAX_RATE_1_5: 966 - port->maximum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 899 + phy->maximum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 967 900 break; 968 901 case MPI_SAS_PHY0_PRATE_MAX_RATE_3_0: 969 - port->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 902 + phy->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 970 903 break; 971 904 default: 972 905 break; ··· 978 911 switch (phy_info->programmed_link_rate & 979 912 MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) { 980 913 case MPI_SAS_PHY0_PRATE_MAX_RATE_1_5: 981 - port->maximum_linkrate = SAS_LINK_RATE_1_5_GBPS; 914 + phy->maximum_linkrate = SAS_LINK_RATE_1_5_GBPS; 982 915 break; 983 916 case MPI_SAS_PHY0_PRATE_MAX_RATE_3_0: 984 - port->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS; 917 + phy->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS; 985 918 break; 986 919 default: 987 920 break; ··· 992 925 */ 993 926 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_HWRATE_MIN_RATE_MASK) { 994 927 case MPI_SAS_PHY0_HWRATE_MIN_RATE_1_5: 995 - port->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 928 + phy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS; 996 929 break; 997 930 case MPI_SAS_PHY0_PRATE_MIN_RATE_3_0: 998 - port->minimum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 931 + phy->minimum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 999 932 break; 1000 933 default: 1001 934 break; ··· 1007 940 switch (phy_info->programmed_link_rate & 1008 941 MPI_SAS_PHY0_PRATE_MIN_RATE_MASK) { 1009 942 case MPI_SAS_PHY0_PRATE_MIN_RATE_1_5: 1010 - port->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 943 + phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 1011 944 break; 1012 945 case MPI_SAS_PHY0_PRATE_MIN_RATE_3_0: 1013 - port->minimum_linkrate = SAS_LINK_RATE_3_0_GBPS; 946 + phy->minimum_linkrate = SAS_LINK_RATE_3_0_GBPS; 1014 947 break; 1015 948 default: 1016 949 break; 1017 950 } 1018 951 1019 952 if (local) 1020 - port->local_attached = 1; 953 + phy->local_attached = 1; 1021 954 1022 - error = sas_phy_add(port); 955 + error = sas_phy_add(phy); 1023 956 if (error) { 1024 - sas_phy_free(port); 957 + sas_phy_free(phy); 1025 958 return error; 1026 959 } 960 + phy_info->phy = phy; 1027 961 1028 962 if (phy_info->attached.handle) { 1029 963 struct sas_rphy *rphy; 1030 964 1031 - rphy = sas_rphy_alloc(port); 965 + rphy = sas_rphy_alloc(phy); 1032 966 if (!rphy) 1033 967 return 0; /* non-fatal: an rphy can be added later */ 1034 968 ··· 1053 985 u32 handle = 0xFFFF; 1054 986 int error = -ENOMEM, i; 1055 987 1056 - port_info = kmalloc(sizeof(*port_info), GFP_KERNEL); 988 + port_info = kzalloc(sizeof(*port_info), GFP_KERNEL); 1057 989 if (!port_info) 1058 990 goto out; 1059 - memset(port_info, 0, sizeof(*port_info)); 1060 991 1061 992 error = mptsas_sas_io_unit_pg0(ioc, port_info); 1062 993 if (error) 1063 994 goto out_free_port_info; 1064 995 996 + ioc->num_ports = port_info->num_phys; 997 + mutex_lock(&ioc->sas_topology_mutex); 1065 998 list_add_tail(&port_info->list, &ioc->sas_topology); 999 + mutex_unlock(&ioc->sas_topology_mutex); 1000 + 1066 1001 for (i = 0; i < port_info->num_phys; i++) { 1067 1002 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], 1068 1003 (MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER << ··· 1105 1034 struct mptsas_portinfo *port_info, *p; 1106 1035 int error = -ENOMEM, i, j; 1107 1036 1108 - port_info = kmalloc(sizeof(*port_info), GFP_KERNEL); 1037 + port_info = kzalloc(sizeof(*port_info), GFP_KERNEL); 1109 1038 if (!port_info) 1110 1039 goto out; 1111 - memset(port_info, 0, sizeof(*port_info)); 1112 1040 1113 1041 error = mptsas_sas_expander_pg0(ioc, port_info, 1114 1042 (MPI_SAS_EXPAND_PGAD_FORM_GET_NEXT_HANDLE << ··· 1117 1047 1118 1048 *handle = port_info->handle; 1119 1049 1050 + mutex_lock(&ioc->sas_topology_mutex); 1120 1051 list_add_tail(&port_info->list, &ioc->sas_topology); 1052 + mutex_unlock(&ioc->sas_topology_mutex); 1053 + 1121 1054 for (i = 0; i < port_info->num_phys; i++) { 1122 1055 struct device *parent; 1123 1056 ··· 1152 1079 * HBA phys. 1153 1080 */ 1154 1081 parent = &ioc->sh->shost_gendev; 1082 + mutex_lock(&ioc->sas_topology_mutex); 1155 1083 list_for_each_entry(p, &ioc->sas_topology, list) { 1156 1084 for (j = 0; j < p->num_phys; j++) { 1157 1085 if (port_info->phy_info[i].identify.handle == ··· 1160 1086 parent = &p->phy_info[j].rphy->dev; 1161 1087 } 1162 1088 } 1089 + mutex_unlock(&ioc->sas_topology_mutex); 1163 1090 1164 1091 mptsas_probe_one_phy(parent, &port_info->phy_info[i], 1165 1092 *index, 0); ··· 1186 1111 ; 1187 1112 } 1188 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 + 1189 1319 static int 1190 1320 mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1191 1321 { ··· 1398 1118 MPT_SCSI_HOST *hd; 1399 1119 MPT_ADAPTER *ioc; 1400 1120 unsigned long flags; 1401 - int sz, ii; 1121 + int ii; 1402 1122 int numSGE = 0; 1403 1123 int scale; 1404 1124 int ioc_cap; 1405 - u8 *mem; 1406 1125 int error=0; 1407 1126 int r; 1408 1127 ··· 1482 1203 sh->unique_id = ioc->id; 1483 1204 1484 1205 INIT_LIST_HEAD(&ioc->sas_topology); 1485 - init_MUTEX(&ioc->sas_mgmt.mutex); 1206 + mutex_init(&ioc->sas_topology_mutex); 1207 + 1208 + mutex_init(&ioc->sas_mgmt.mutex); 1486 1209 init_completion(&ioc->sas_mgmt.done); 1487 1210 1488 1211 /* Verify that we won't exceed the maximum ··· 1525 1244 /* SCSI needs scsi_cmnd lookup table! 1526 1245 * (with size equal to req_depth*PtrSz!) 1527 1246 */ 1528 - sz = ioc->req_depth * sizeof(void *); 1529 - mem = kmalloc(sz, GFP_ATOMIC); 1530 - if (mem == NULL) { 1247 + hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); 1248 + if (!hd->ScsiLookup) { 1531 1249 error = -ENOMEM; 1532 1250 goto out_mptsas_probe; 1533 1251 } 1534 1252 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)); 1253 + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n", 1254 + ioc->name, hd->ScsiLookup)); 1540 1255 1541 1256 /* Allocate memory for the device structures. 1542 1257 * A non-Null pointer at an offset 1543 1258 * indicates a device exists. 1544 1259 * max_id = 1 + maximum id (hosts.h) 1545 1260 */ 1546 - sz = sh->max_id * sizeof(void *); 1547 - mem = kmalloc(sz, GFP_ATOMIC); 1548 - if (mem == NULL) { 1261 + hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC); 1262 + if (!hd->Targets) { 1549 1263 error = -ENOMEM; 1550 1264 goto out_mptsas_probe; 1551 1265 } 1552 1266 1553 - memset(mem, 0, sz); 1554 - hd->Targets = (VirtTarget **) mem; 1555 - 1556 - dprintk((KERN_INFO 1557 - " vtarget @ %p, sz=%d\n", hd->Targets, sz)); 1267 + dprintk((KERN_INFO " vtarget @ %p\n", hd->Targets)); 1558 1268 1559 1269 /* Clear the TM flags 1560 1270 */ ··· 1596 1324 1597 1325 mptsas_scan_sas_topology(ioc); 1598 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 + 1599 1341 return 0; 1600 1342 1601 1343 out_mptsas_probe: ··· 1625 1339 1626 1340 sas_remove_host(ioc->sh); 1627 1341 1342 + mutex_lock(&ioc->sas_topology_mutex); 1628 1343 list_for_each_entry_safe(p, n, &ioc->sas_topology, list) { 1629 1344 list_del(&p->list); 1630 1345 kfree(p); 1631 1346 } 1347 + mutex_unlock(&ioc->sas_topology_mutex); 1632 1348 1633 1349 mptscsih_remove(pdev); 1634 1350 } ··· 1681 1393 mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER); 1682 1394 mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); 1683 1395 1684 - if (mpt_event_register(mptsasDoneCtx, mptscsih_event_process) == 0) { 1396 + if (mpt_event_register(mptsasDoneCtx, mptsas_event_process) == 0) { 1685 1397 devtprintk((KERN_INFO MYNAM 1686 1398 ": Registered for IOC event notifications\n")); 1687 1399 }
+26 -8
drivers/message/fusion/mptscsih.c
··· 893 893 * when a lun is disable by mid-layer. 894 894 * Do NOT access the referenced scsi_cmnd structure or 895 895 * members. Will cause either a paging or NULL ptr error. 896 + * (BUT, BUT, BUT, the code does reference it! - mdr) 896 897 * @hd: Pointer to a SCSI HOST structure 897 898 * @vdevice: per device private data 898 899 * ··· 2163 2162 { 2164 2163 VirtTarget *vtarget; 2165 2164 2166 - vtarget = kmalloc(sizeof(VirtTarget), GFP_KERNEL); 2165 + vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); 2167 2166 if (!vtarget) 2168 2167 return -ENOMEM; 2169 - memset(vtarget, 0, sizeof(VirtTarget)); 2170 2168 starget->hostdata = vtarget; 2171 2169 return 0; 2172 2170 } ··· 2185 2185 VirtDevice *vdev; 2186 2186 struct scsi_target *starget; 2187 2187 2188 - vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); 2188 + vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); 2189 2189 if (!vdev) { 2190 2190 printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", 2191 2191 hd->ioc->name, sizeof(VirtDevice)); 2192 2192 return -ENOMEM; 2193 2193 } 2194 2194 2195 - memset(vdev, 0, sizeof(VirtDevice)); 2196 2195 vdev->ioc_id = hd->ioc->id; 2197 2196 vdev->target_id = sdev->id; 2198 2197 vdev->bus_id = sdev->channel; ··· 2558 2559 hd->cmdPtr = NULL; 2559 2560 } 2560 2561 2561 - /* 7. Set flag to force DV and re-read IOC Page 3 2562 + /* 7. SPI: Set flag to force DV and re-read IOC Page 3 2562 2563 */ 2563 2564 if (ioc->bus_type == SPI) { 2564 2565 ioc->spi_data.forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3; 2565 2566 ddvtprintk(("Set reload IOC Pg3 Flag\n")); 2566 2567 } 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 + } 2568 2581 dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name)); 2569 2582 2570 2583 } ··· 2600 2589 { 2601 2590 MPT_SCSI_HOST *hd; 2602 2591 u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; 2592 + int work_count; 2593 + unsigned long flags; 2603 2594 2604 2595 devtprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", 2605 2596 ioc->name, event)); ··· 2623 2610 /* FIXME! */ 2624 2611 break; 2625 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 + 2626 2621 /* 2627 2622 * CHECKME! Don't think we need to do 2628 2623 * anything for these, but... 2629 2624 */ 2630 - case MPI_EVENT_RESCAN: /* 06 */ 2631 2625 case MPI_EVENT_LINK_STATUS_CHANGE: /* 07 */ 2632 2626 case MPI_EVENT_LOOP_STATE_CHANGE: /* 08 */ 2633 2627 /* ··· 3972 3952 mptscsih_do_cmd(hd, &iocmd); 3973 3953 } 3974 3954 3975 - /* Search IOC page 3 to determine if this is hidden physical disk 3976 - */ 3977 3955 /* Search IOC page 3 to determine if this is hidden physical disk 3978 3956 */ 3979 3957 static int
+8 -18
drivers/message/fusion/mptspi.c
··· 158 158 MPT_SCSI_HOST *hd; 159 159 MPT_ADAPTER *ioc; 160 160 unsigned long flags; 161 - int sz, ii; 161 + int ii; 162 162 int numSGE = 0; 163 163 int scale; 164 164 int ioc_cap; 165 - u8 *mem; 166 165 int error=0; 167 166 int r; 168 167 ··· 287 288 /* SCSI needs scsi_cmnd lookup table! 288 289 * (with size equal to req_depth*PtrSz!) 289 290 */ 290 - sz = ioc->req_depth * sizeof(void *); 291 - mem = kmalloc(sz, GFP_ATOMIC); 292 - if (mem == NULL) { 291 + hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); 292 + if (!hd->ScsiLookup) { 293 293 error = -ENOMEM; 294 294 goto out_mptspi_probe; 295 295 } 296 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)); 297 + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n", 298 + ioc->name, hd->ScsiLookup)); 302 299 303 300 /* Allocate memory for the device structures. 304 301 * A non-Null pointer at an offset 305 302 * indicates a device exists. 306 303 * max_id = 1 + maximum id (hosts.h) 307 304 */ 308 - sz = sh->max_id * sizeof(void *); 309 - mem = kmalloc(sz, GFP_ATOMIC); 310 - if (mem == NULL) { 305 + hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC); 306 + if (!hd->Targets) { 311 307 error = -ENOMEM; 312 308 goto out_mptspi_probe; 313 309 } 314 310 315 - memset(mem, 0, sz); 316 - hd->Targets = (VirtTarget **) mem; 317 - 318 - dprintk((KERN_INFO 319 - " vdev @ %p, sz=%d\n", hd->Targets, sz)); 311 + dprintk((KERN_INFO " vdev @ %p\n", hd->Targets)); 320 312 321 313 /* Clear the TM flags 322 314 */
+5 -5
drivers/message/i2o/pci.c
··· 88 88 struct device *dev = &pdev->dev; 89 89 int i; 90 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 91 for (i = 0; i < 6; i++) { 97 92 /* Skip I/O spaces */ 98 93 if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { ··· 312 317 printk(KERN_WARNING "i2o: couldn't enable device %s\n", 313 318 pci_name(pdev)); 314 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; 315 325 } 316 326 317 327 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+2
drivers/s390/scsi/zfcp_aux.c
··· 1125 1125 zfcp_free_low_mem_buffers(adapter); 1126 1126 /* free memory of adapter data structure and queues */ 1127 1127 zfcp_qdio_free_queues(adapter); 1128 + kfree(adapter->fc_stats); 1129 + kfree(adapter->stats_reset_data); 1128 1130 ZFCP_LOG_TRACE("freeing adapter structure\n"); 1129 1131 kfree(adapter); 1130 1132 out:
+3 -1
drivers/s390/scsi/zfcp_def.h
··· 921 921 u32 physical_s_id; /* local FC port ID */ 922 922 struct ccw_device *ccw_device; /* S/390 ccw device */ 923 923 u8 fc_service_class; 924 - u32 fc_topology; /* FC topology */ 925 924 u32 hydra_version; /* Hydra version */ 926 925 u32 fsf_lic_version; 927 926 u32 adapter_features; /* FCP channel features */ ··· 977 978 struct zfcp_adapter_mempool pool; /* Adapter memory pools */ 978 979 struct qdio_initialize qdio_init_data; /* for qdio_establish */ 979 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; 980 984 }; 981 985 982 986 /*
+1 -1
drivers/s390/scsi/zfcp_erp.c
··· 2613 2613 case ZFCP_ERP_STEP_UNINITIALIZED: 2614 2614 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: 2615 2615 case ZFCP_ERP_STEP_PORT_CLOSING: 2616 - if (adapter->fc_topology == FSF_TOPO_P2P) { 2616 + if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) { 2617 2617 if (port->wwpn != adapter->peer_wwpn) { 2618 2618 ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " 2619 2619 "on adapter %s.\nPeer WWPN "
+60 -24
drivers/s390/scsi/zfcp_fsf.c
··· 964 964 | ZFCP_STATUS_COMMON_ERP_FAILED); 965 965 break; 966 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 + 967 1001 case FSF_STATUS_READ_CFDC_UPDATED: 968 1002 ZFCP_LOG_NORMAL("CFDC has been updated on the adapter %s\n", 969 1003 zfcp_get_busid_by_adapter(adapter)); ··· 1988 1954 erp_action->fsf_req->qtcb->bottom.config.feature_selection = 1989 1955 FSF_FEATURE_CFDC | 1990 1956 FSF_FEATURE_LUN_SHARING | 1957 + FSF_FEATURE_NOTIFICATION_LOST | 1991 1958 FSF_FEATURE_UPDATE_ALERT; 1992 1959 1993 1960 /* start QDIO request for this FSF request */ ··· 2043 2008 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; 2044 2009 fc_host_speed(shost) = bottom->fc_link_speed; 2045 2010 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; 2046 - adapter->fc_topology = bottom->fc_topology; 2047 2011 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); 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; 2052 2026 } else { 2053 2027 fc_host_node_name(shost) = 0; 2054 2028 fc_host_port_name(shost) = 0; 2055 2029 fc_host_port_id(shost) = 0; 2056 2030 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; 2057 - adapter->fc_topology = 0; 2031 + fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; 2058 2032 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 2033 } 2066 2034 2067 2035 if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { ··· 2135 2097 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) 2136 2098 return -EIO; 2137 2099 2138 - switch (adapter->fc_topology) { 2139 - case FSF_TOPO_P2P: 2100 + switch (fc_host_port_type(adapter->scsi_host)) { 2101 + case FC_PORTTYPE_PTP: 2140 2102 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " 2141 2103 "configuration detected at adapter %s\n" 2142 2104 "Peer WWNN 0x%016llx, " ··· 2149 2111 debug_text_event(fsf_req->adapter->erp_dbf, 0, 2150 2112 "top-p-to-p"); 2151 2113 break; 2152 - case FSF_TOPO_AL: 2114 + case FC_PORTTYPE_NLPORT: 2153 2115 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " 2154 2116 "topology detected at adapter %s " 2155 2117 "unsupported, shutting down adapter\n", ··· 2158 2120 "top-al"); 2159 2121 zfcp_erp_adapter_shutdown(adapter, 0); 2160 2122 return -EIO; 2161 - case FSF_TOPO_FABRIC: 2123 + case FC_PORTTYPE_NPORT: 2162 2124 ZFCP_LOG_NORMAL("Switched fabric fibrechannel " 2163 2125 "network detected at adapter %s.\n", 2164 2126 zfcp_get_busid_by_adapter(adapter)); ··· 2171 2133 "of a type known to the zfcp " 2172 2134 "driver, shutting down adapter\n", 2173 2135 zfcp_get_busid_by_adapter(adapter)); 2174 - adapter->fc_topology = FSF_TOPO_ERROR; 2175 2136 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 2176 2137 "unknown-topo"); 2177 2138 zfcp_erp_adapter_shutdown(adapter, 0); ··· 2330 2293 data = (struct fsf_qtcb_bottom_port*) fsf_req->data; 2331 2294 if (data) 2332 2295 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 - } 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); 2340 2301 fc_host_maxframe_size(shost) = bottom->maximum_frame_size; 2302 + fc_host_supported_speeds(shost) = bottom->supported_speed; 2341 2303 break; 2342 2304 2343 2305 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
+12 -1
drivers/s390/scsi/zfcp_fsf.h
··· 166 166 #define FSF_STATUS_READ_BIT_ERROR_THRESHOLD 0x00000004 167 167 #define FSF_STATUS_READ_LINK_DOWN 0x00000005 168 168 #define FSF_STATUS_READ_LINK_UP 0x00000006 169 + #define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 169 170 #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A 170 171 #define FSF_STATUS_READ_CFDC_HARDENED 0x0000000B 171 172 #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C ··· 180 179 #define FSF_STATUS_READ_SUB_FDISC_FAILED 0x00000001 181 180 #define FSF_STATUS_READ_SUB_FIRMWARE_UPDATE 0x00000002 182 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 + 183 192 /* status subtypes for CFDC */ 184 193 #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE 0x00000002 185 194 #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE2 0x0000000F ··· 199 188 #define FSF_TOPO_P2P 0x00000001 200 189 #define FSF_TOPO_FABRIC 0x00000002 201 190 #define FSF_TOPO_AL 0x00000003 202 - #define FSF_TOPO_FABRIC_VIRT 0x00000004 203 191 204 192 /* data direction for FCP commands */ 205 193 #define FSF_DATADIR_WRITE 0x00000001 ··· 221 211 /* channel features */ 222 212 #define FSF_FEATURE_CFDC 0x00000002 223 213 #define FSF_FEATURE_LUN_SHARING 0x00000004 214 + #define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 224 215 #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 225 216 #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 226 217 #define FSF_FEATURE_UPDATE_ALERT 0x00000100
+135 -55
drivers/s390/scsi/zfcp_scsi.c
··· 49 49 50 50 static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *, int, scsi_id_t, 51 51 scsi_lun_t); 52 - static struct zfcp_port *zfcp_port_lookup(struct zfcp_adapter *, int, 53 - scsi_id_t); 54 52 55 53 static struct device_attribute *zfcp_sysfs_sdev_attrs[]; 56 54 ··· 404 406 return retval; 405 407 } 406 408 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 409 /** 420 410 * zfcp_scsi_eh_abort_handler - abort the specified SCSI command 421 411 * @scpnt: pointer to scsi_cmnd to be aborted ··· 717 731 /* 718 732 * Support functions for FC transport class 719 733 */ 720 - static void 721 - zfcp_get_port_id(struct scsi_target *starget) 734 + static struct fc_host_statistics* 735 + zfcp_init_fc_host_stats(struct zfcp_adapter *adapter) 722 736 { 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; 737 + struct fc_host_statistics *fc_stats; 727 738 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); 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; 735 747 } 736 748 737 749 static void 738 - zfcp_get_port_name(struct scsi_target *starget) 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) 739 753 { 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); 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; 752 781 } 753 782 754 783 static void 755 - zfcp_get_node_name(struct scsi_target *starget) 784 + zfcp_set_fc_host_stats(struct fc_host_statistics *fc_stats, 785 + struct fsf_qtcb_bottom_port *data) 756 786 { 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; 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 + } 761 808 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); 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 + } 769 873 } 770 874 771 875 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 876 .show_starget_port_id = 1, 776 877 .show_starget_port_name = 1, 777 878 .show_starget_node_name = 1, 778 879 .show_rport_supported_classes = 1, 779 880 .show_host_node_name = 1, 780 881 .show_host_port_name = 1, 882 + .show_host_permanent_port_name = 1, 781 883 .show_host_supported_classes = 1, 884 + .show_host_supported_speeds = 1, 782 885 .show_host_maxframe_size = 1, 783 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, 784 892 .show_host_speed = 1, 785 893 .show_host_port_id = 1, 786 894 };
-15
drivers/s390/scsi/zfcp_sysfs_adapter.c
··· 33 33 34 34 #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG 35 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 36 /** 45 37 * ZFCP_DEFINE_ADAPTER_ATTR 46 38 * @_name: name of show attribute ··· 61 69 ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); 62 70 ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); 63 71 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 72 ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", 68 73 adapter->hardware_version); 69 - ZFCP_DEFINE_ADAPTER_ATTR(scsi_host_no, "0x%x\n", adapter->scsi_host_no); 70 74 ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask 71 75 (ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status)); 72 76 ··· 247 259 &dev_attr_physical_s_id.attr, 248 260 &dev_attr_card_version.attr, 249 261 &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 262 &dev_attr_status.attr, 254 263 &dev_attr_hardware_version.attr, 255 264 NULL
-4
drivers/s390/scsi/zfcp_sysfs_port.c
··· 65 65 static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_port_##_name##_show, NULL); 66 66 67 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 68 ZFCP_DEFINE_PORT_ATTR(in_recovery, "%d\n", atomic_test_mask 71 69 (ZFCP_STATUS_COMMON_ERP_INUSE, &port->status)); 72 70 ZFCP_DEFINE_PORT_ATTR(access_denied, "%d\n", atomic_test_mask ··· 243 245 &dev_attr_failed.attr, 244 246 &dev_attr_in_recovery.attr, 245 247 &dev_attr_status.attr, 246 - &dev_attr_wwnn.attr, 247 - &dev_attr_d_id.attr, 248 248 &dev_attr_access_denied.attr, 249 249 NULL 250 250 };
-2
drivers/s390/scsi/zfcp_sysfs_unit.c
··· 65 65 static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_unit_##_name##_show, NULL); 66 66 67 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 68 ZFCP_DEFINE_UNIT_ATTR(in_recovery, "%d\n", atomic_test_mask 70 69 (ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status)); 71 70 ZFCP_DEFINE_UNIT_ATTR(access_denied, "%d\n", atomic_test_mask ··· 137 138 zfcp_sysfs_unit_failed_store); 138 139 139 140 static struct attribute *zfcp_unit_attrs[] = { 140 - &dev_attr_scsi_lun.attr, 141 141 &dev_attr_failed.attr, 142 142 &dev_attr_in_recovery.attr, 143 143 &dev_attr_status.attr,
+4 -3
drivers/scsi/3w-9xxx.c
··· 73 73 #include <linux/delay.h> 74 74 #include <linux/pci.h> 75 75 #include <linux/time.h> 76 + #include <linux/mutex.h> 76 77 #include <asm/io.h> 77 78 #include <asm/irq.h> 78 79 #include <asm/uaccess.h> ··· 616 615 void __user *argp = (void __user *)arg; 617 616 618 617 /* Only let one of these through at a time */ 619 - if (down_interruptible(&tw_dev->ioctl_sem)) { 618 + if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { 620 619 retval = TW_IOCTL_ERROR_OS_EINTR; 621 620 goto out; 622 621 } ··· 853 852 /* Now free ioctl buf memory */ 854 853 dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_Ioctl_Buf_Apache) - 1, cpu_addr, dma_handle); 855 854 out2: 856 - up(&tw_dev->ioctl_sem); 855 + mutex_unlock(&tw_dev->ioctl_lock); 857 856 out: 858 857 return retval; 859 858 } /* End twa_chrdev_ioctl() */ ··· 1183 1182 tw_dev->error_sequence_id = 1; 1184 1183 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; 1185 1184 1186 - init_MUTEX(&tw_dev->ioctl_sem); 1185 + mutex_init(&tw_dev->ioctl_lock); 1187 1186 init_waitqueue_head(&tw_dev->ioctl_wqueue); 1188 1187 1189 1188 retval = 0;
+1 -1
drivers/scsi/3w-9xxx.h
··· 672 672 u32 ioctl_msec; 673 673 int chrdev_request_id; 674 674 wait_queue_head_t ioctl_wqueue; 675 - struct semaphore ioctl_sem; 675 + struct mutex ioctl_lock; 676 676 char aen_clobber; 677 677 unsigned short working_srl; 678 678 unsigned short working_branch;
+4 -3
drivers/scsi/3w-xxxx.c
··· 203 203 #include <linux/delay.h> 204 204 #include <linux/pci.h> 205 205 #include <linux/time.h> 206 + #include <linux/mutex.h> 206 207 #include <asm/io.h> 207 208 #include <asm/irq.h> 208 209 #include <asm/uaccess.h> ··· 889 888 dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl()\n"); 890 889 891 890 /* Only let one of these through at a time */ 892 - if (down_interruptible(&tw_dev->ioctl_sem)) 891 + if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) 893 892 return -EINTR; 894 893 895 894 /* First copy down the buffer length */ ··· 1030 1029 /* Now free ioctl buf memory */ 1031 1030 dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, cpu_addr, dma_handle); 1032 1031 out: 1033 - up(&tw_dev->ioctl_sem); 1032 + mutex_unlock(&tw_dev->ioctl_lock); 1034 1033 return retval; 1035 1034 } /* End tw_chrdev_ioctl() */ 1036 1035 ··· 1271 1270 tw_dev->pending_tail = TW_Q_START; 1272 1271 tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; 1273 1272 1274 - init_MUTEX(&tw_dev->ioctl_sem); 1273 + mutex_init(&tw_dev->ioctl_lock); 1275 1274 init_waitqueue_head(&tw_dev->ioctl_wqueue); 1276 1275 1277 1276 return 0;
+1 -1
drivers/scsi/3w-xxxx.h
··· 420 420 u32 max_sector_count; 421 421 u32 aen_count; 422 422 struct Scsi_Host *host; 423 - struct semaphore ioctl_sem; 423 + struct mutex ioctl_lock; 424 424 unsigned short aen_queue[TW_Q_LENGTH]; 425 425 unsigned char aen_head; 426 426 unsigned char aen_tail;
+2 -1
drivers/scsi/BusLogic.c
··· 2216 2216 HostAdapter->PCI_Address = ProbeInfo->PCI_Address; 2217 2217 HostAdapter->Bus = ProbeInfo->Bus; 2218 2218 HostAdapter->Device = ProbeInfo->Device; 2219 + HostAdapter->PCI_Device = ProbeInfo->PCI_Device; 2219 2220 HostAdapter->IRQ_Channel = ProbeInfo->IRQ_Channel; 2220 2221 HostAdapter->AddressCount = BusLogic_HostAdapterAddressCount[HostAdapter->HostAdapterType]; 2221 2222 /* ··· 2297 2296 scsi_host_put(Host); 2298 2297 } else { 2299 2298 BusLogic_InitializeHostStructure(HostAdapter, Host); 2300 - scsi_add_host(Host, NULL); 2299 + scsi_add_host(Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev : NULL); 2301 2300 scsi_scan_host(Host); 2302 2301 BusLogicHostAdapterCount++; 2303 2302 }
+1 -1
drivers/scsi/Makefile
··· 80 80 obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o 81 81 obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o 82 82 obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o 83 - obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/ 83 + obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx/ 84 84 obj-$(CONFIG_SCSI_LPFC) += lpfc/ 85 85 obj-$(CONFIG_SCSI_PAS16) += pas16.o 86 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 532 #define AAC_QUIRK_MASTER 0x0008 533 533 534 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 + /* 535 542 * The adapter interface specs all queues to be located in the same 536 543 * physically contigous block. The host structure that defines the 537 544 * commuication queues will assume they are each a separate physically
+4
drivers/scsi/aacraid/commctrl.c
··· 85 85 if (size < le16_to_cpu(kfib->header.SenderSize)) 86 86 size = le16_to_cpu(kfib->header.SenderSize); 87 87 if (size > dev->max_fib_size) { 88 + if (size > 2048) { 89 + retval = -EINVAL; 90 + goto cleanup; 91 + } 88 92 /* Highjack the hw_fib */ 89 93 hw_fib = fibptr->hw_fib; 90 94 hw_fib_pa = fibptr->hw_fib_pa;
+29 -6
drivers/scsi/aacraid/linit.c
··· 200 200 { aac_rkt_init, "aacraid", "ADAPTEC ", "Callisto ", 2, AAC_QUIRK_MASTER }, /* Jupiter Platform */ 201 201 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2020SA ", 1 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */ 202 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) */ 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 207 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2026ZCR ", 1 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ 208 208 { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2610SA ", 1 }, /* SATA 6Ch (Bearcat) */ 209 209 { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2240S ", 1 }, /* ASR-2240S (SabreExpress) */ ··· 574 574 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; 575 575 int len; 576 576 577 - len = snprintf(buf, PAGE_SIZE, "%s\n", 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", 578 586 aac_drivers[dev->cardtype].model); 579 587 return len; 580 588 } ··· 593 585 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; 594 586 int len; 595 587 596 - len = snprintf(buf, PAGE_SIZE, "%s\n", 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 597 aac_drivers[dev->cardtype].vname); 598 598 return len; 599 599 } ··· 849 833 if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && 850 834 (aac->scsi_host_ptr->sg_tablesize > 34)) { 851 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; 852 843 aac->scsi_host_ptr->max_sectors 853 844 = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; 854 845 }
+2 -2
drivers/scsi/aic7xxx/Kconfig.aic7xxx
··· 42 42 config AIC7XXX_RESET_DELAY_MS 43 43 int "Initial bus reset delay in milli-seconds" 44 44 depends on SCSI_AIC7XXX 45 - default "15000" 45 + default "5000" 46 46 ---help--- 47 47 The number of milliseconds to delay after an initial bus reset. 48 48 The bus settle delay following all error recovery actions is 49 49 dictated by the SCSI layer and is not affected by this value. 50 50 51 - Default: 15000 (15 seconds) 51 + Default: 5000 (5 seconds) 52 52 53 53 config AIC7XXX_PROBE_EISA_VL 54 54 bool "Probe for EISA and VL AIC7XXX Adapters"
+26 -13
drivers/scsi/aic7xxx/aic79xx.h
··· 37 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 38 * POSSIBILITY OF SUCH DAMAGES. 39 39 * 40 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#95 $ 40 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#108 $ 41 41 * 42 42 * $FreeBSD$ 43 43 */ ··· 75 75 #define INITIATOR_WILDCARD (~0) 76 76 #define SCB_LIST_NULL 0xFF00 77 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)) 78 + #define QOUTFIFO_ENTRY_VALID 0x80 80 79 #define SCBID_IS_NULL(scbid) (((scbid) & 0xFF00 ) == SCB_LIST_NULL) 81 80 82 81 #define SCSIID_TARGET(ahd, scsiid) \ ··· 1052 1053 1053 1054 typedef void ahd_callback_t (void *); 1054 1055 1056 + struct ahd_completion 1057 + { 1058 + uint16_t tag; 1059 + uint8_t sg_status; 1060 + uint8_t valid_tag; 1061 + }; 1062 + 1055 1063 struct ahd_softc { 1056 1064 bus_space_tag_t tags[2]; 1057 1065 bus_space_handle_t bshs[2]; ··· 1068 1062 struct scb_data scb_data; 1069 1063 1070 1064 struct hardware_scb *next_queued_hscb; 1065 + struct map_node *next_queued_hscb_map; 1071 1066 1072 1067 /* 1073 1068 * SCBs that have been sent to the controller ··· 1147 1140 ahd_flag flags; 1148 1141 struct seeprom_config *seep_config; 1149 1142 1150 - /* Values to store in the SEQCTL register for pause and unpause */ 1151 - uint8_t unpause; 1152 - uint8_t pause; 1153 - 1154 1143 /* Command Queues */ 1144 + struct ahd_completion *qoutfifo; 1155 1145 uint16_t qoutfifonext; 1156 1146 uint16_t qoutfifonext_valid_tag; 1157 1147 uint16_t qinfifonext; 1158 1148 uint16_t qinfifo[AHD_SCB_MAX]; 1159 - uint16_t *qoutfifo; 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 1160 1161 1161 /* Critical Section Data */ 1162 1162 struct cs *critical_sections; ··· 1211 1197 */ 1212 1198 bus_dma_tag_t parent_dmat; 1213 1199 bus_dma_tag_t shared_data_dmat; 1214 - bus_dmamap_t shared_data_dmamap; 1215 - dma_addr_t shared_data_busaddr; 1200 + struct map_node shared_data_map; 1216 1201 1217 1202 /* Information saved through suspend/resume cycles */ 1218 1203 struct ahd_suspend_state suspend_state; ··· 1309 1296 }; 1310 1297 1311 1298 /****************************** 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 */ 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 */ 1315 1302 1316 1303 typedef int (ahd_device_setup_t)(struct ahd_softc *); 1317 1304
+39 -21
drivers/scsi/aic7xxx/aic79xx.reg
··· 39 39 * 40 40 * $FreeBSD$ 41 41 */ 42 - VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $" 42 + VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $" 43 43 44 44 /* 45 45 * This file is processed by the aic7xxx_asm utility for use in assembling ··· 65 65 mvi MODE_PTR, MK_MODE(src, dst); \ 66 66 } 67 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 68 #define RESTORE_MODE(mode) \ 76 69 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \ 77 70 mov mode call set_mode_work_around; \ ··· 1192 1199 1193 1200 /* 1194 1201 * LQ Packet In 1195 - * The last LQ Packet received 1202 + * The last LQ Packet recieved 1196 1203 */ 1197 1204 register LQIN { 1198 1205 address 0x020 ··· 3535 3542 COMPLETE_DMA_SCB_HEAD { 3536 3543 size 2 3537 3544 } 3538 - /* Counting semaphore to prevent new select-outs */ 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 + */ 3539 3567 QFREEZE_COUNT { 3568 + size 2 3569 + } 3570 + KERNEL_QFREEZE_COUNT { 3540 3571 size 2 3541 3572 } 3542 3573 /* ··· 3642 3625 size 1 3643 3626 } 3644 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 + /* 3645 3639 * Base address of our shared data with the kernel driver in host 3646 3640 * memory. This includes the qoutfifo and target mode 3647 3641 * incoming command queue. ··· 3666 3638 */ 3667 3639 QOUTFIFO_NEXT_ADDR { 3668 3640 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 3641 } 3681 3642 ARG_1 { 3682 3643 size 1 ··· 3968 3951 const SG_SIZEOF download 3969 3952 const PKT_OVERRUN_BUFOFFSET download 3970 3953 const SCB_TRANSFER_SIZE download 3954 + const CACHELINE_MASK download 3971 3955 3972 3956 /* 3973 3957 * BIOS SCB offsets
+188 -53
drivers/scsi/aic7xxx/aic79xx.seq
··· 40 40 * $FreeBSD$ 41 41 */ 42 42 43 - VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#99 $" 43 + VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $" 44 44 PATCH_ARG_LIST = "struct ahd_softc *ahd" 45 45 PREFIX = "ahd_" 46 46 ··· 68 68 } 69 69 SET_MODE(M_SCSI, M_SCSI) 70 70 test SCSISEQ0, ENSELO|ENARBO jnz idle_loop_checkbus; 71 - test SEQ_FLAGS2, SELECTOUT_QFROZEN 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: 72 107 cmp WAITING_TID_HEAD[1], SCB_LIST_NULL je idle_loop_checkbus; 73 108 /* 74 109 * ENSELO is cleared by a SELDO, so we must test for SELDO 75 110 * one last time. 76 111 */ 77 - BEGIN_CRITICAL; 78 112 test SSTAT0, SELDO jnz select_out; 79 113 END_CRITICAL; 80 114 call start_selection; ··· 124 90 test SSTAT2, NONPACKREQ jz . + 2; 125 91 call unexpected_nonpkt_phase_find_ctxt; 126 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 + */ 127 100 and A, FIFO0FREE|FIFO1FREE, DFFSTAT; 128 101 cmp A, FIFO0FREE|FIFO1FREE jne . + 3; 129 102 and SBLKCTL, ~DIAGLEDEN|DIAGLEDON; ··· 142 101 call idle_loop_cchan; 143 102 jmp idle_loop; 144 103 145 - BEGIN_CRITICAL; 146 104 idle_loop_gsfifo: 147 105 SET_MODE(M_SCSI, M_SCSI) 106 + BEGIN_CRITICAL; 148 107 idle_loop_gsfifo_in_scsi_mode: 149 108 test LQISTAT2, LQIGSAVAIL jz return; 150 109 /* ··· 193 152 194 153 idle_loop_service_fifos: 195 154 SET_MODE(M_DFF0, M_DFF0) 155 + BEGIN_CRITICAL; 196 156 test LONGJMP_ADDR[1], INVALID_ADDR jnz idle_loop_next_fifo; 197 157 call longjmp; 158 + END_CRITICAL; 198 159 idle_loop_next_fifo: 199 160 SET_MODE(M_DFF1, M_DFF1) 161 + BEGIN_CRITICAL; 200 162 test LONGJMP_ADDR[1], INVALID_ADDR jz longjmp; 163 + END_CRITICAL; 201 164 return: 202 165 ret; 203 166 ··· 215 170 test CCSCBCTL, CCARREN|CCSCBEN jz scbdma_idle; 216 171 test CCSCBCTL, CCSCBDIR jnz fetch_new_scb_inprog; 217 172 test CCSCBCTL, CCSCBDONE jz return; 218 - END_CRITICAL; 219 173 /* FALLTHROUGH */ 220 174 scbdma_tohost_done: 221 175 test CCSCBCTL, CCARREN jz fill_qoutfifo_dmadone; ··· 224 180 * bad SCSI status (currently only for underruns), we 225 181 * queue the SCB for normal completion. Otherwise, we 226 182 * wait until any select-out activity has halted, and 227 - * then notify the host so that the transaction can be 228 - * dealt with. 183 + * then queue the completion. 229 184 */ 230 - test SCB_SCSI_STATUS, 0xff jnz scbdma_notify_host; 231 185 and CCSCBCTL, ~(CCARREN|CCSCBEN); 232 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: 233 193 bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 234 194 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 195 fill_qoutfifo_dmadone: 248 196 and CCSCBCTL, ~(CCARREN|CCSCBEN); 249 197 call qoutfifo_updated; ··· 244 208 test QOFF_CTLSTA, SDSCB_ROLLOVR jz return; 245 209 bmov QOUTFIFO_NEXT_ADDR, SHARED_DATA_ADDR, 4; 246 210 xor QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID_TOGGLE ret; 211 + END_CRITICAL; 247 212 248 213 qoutfifo_updated: 249 214 /* ··· 361 324 * Keep track of the SCBs we are dmaing just 362 325 * in case the DMA fails or is aborted. 363 326 */ 364 - mov A, QOUTFIFO_ENTRY_VALID_TAG; 365 327 bmov COMPLETE_SCB_DMAINPROG_HEAD, COMPLETE_SCB_HEAD, 2; 366 328 mvi CCSCBCTL, CCSCBRESET; 367 329 bmov SCBHADDR, QOUTFIFO_NEXT_ADDR, 4; 330 + mov A, QOUTFIFO_NEXT_ADDR; 368 331 bmov SCBPTR, COMPLETE_SCB_HEAD, 2; 369 332 fill_qoutfifo_loop: 370 - mov CCSCBRAM, SCBPTR; 371 - or CCSCBRAM, A, SCBPTR[1]; 333 + bmov CCSCBRAM, SCBPTR, 2; 334 + mov CCSCBRAM, SCB_SGPTR[0]; 335 + mov CCSCBRAM, QOUTFIFO_ENTRY_VALID_TAG; 372 336 mov NONE, SDSCB_QOFF; 373 337 inc INT_COALESCING_CMDCOUNT; 374 338 add CMDS_PENDING, -1; ··· 377 339 cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL je fill_qoutfifo_done; 378 340 cmp CCSCBADDR, CCSCBADDR_MAX je fill_qoutfifo_done; 379 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; 380 354 bmov SCBPTR, SCB_NEXT_COMPLETE, 2; 381 355 jmp fill_qoutfifo_loop; 382 356 fill_qoutfifo_done: ··· 404 354 bmov SCBPTR, COMPLETE_DMA_SCB_HEAD, 2; 405 355 bmov SCBHADDR, SCB_BUSADDR, 4; 406 356 mvi CCARREN|CCSCBEN|CCSCBRESET jmp dma_scb; 407 - END_CRITICAL; 408 357 409 358 /* 410 359 * Either post or fetch an SCB from host memory. The caller ··· 420 371 mvi SCBHCNT, SCB_TRANSFER_SIZE; 421 372 mov CCSCBCTL, SINDEX ret; 422 373 423 - BEGIN_CRITICAL; 424 374 setjmp: 425 - bmov LONGJMP_ADDR, STACK, 2 ret; 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; 426 387 setjmp_inline: 427 388 bmov LONGJMP_ADDR, STACK, 2; 428 389 longjmp: ··· 450 391 set_mode_work_around: 451 392 mvi SEQINTCTL, INTVEC1DSL; 452 393 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 394 clr SEQINTCTL ret; 459 395 } 460 396 ··· 544 490 SET_SRC_MODE M_SCSI; 545 491 SET_DST_MODE M_SCSI; 546 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 + } 547 508 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) { 548 509 /* 549 510 * Test to ensure that the bus has not ··· 597 528 SET_DST_MODE M_SCSI; 598 529 select_out: 599 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 + } 600 546 /* Clear out all SCBs that have been successfully sent. */ 601 547 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) { 602 548 /* ··· 1084 1000 /* 1085 1001 * We received a "command complete" message. Put the SCB on the complete 1086 1002 * 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. 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. 1096 1006 */ 1097 1007 mesgin_complete: 1098 1008 ··· 1131 1053 call queue_scb_completion; 1132 1054 jmp await_busfree; 1133 1055 1056 + BEGIN_CRITICAL; 1134 1057 freeze_queue: 1135 1058 /* Cancel any pending select-out. */ 1136 1059 test SSTAT0, SELDO|SELINGO jnz . + 2; ··· 1142 1063 adc QFREEZE_COUNT[1], A; 1143 1064 or SEQ_FLAGS2, SELECTOUT_QFROZEN; 1144 1065 mov A, ACCUM_SAVE ret; 1066 + END_CRITICAL; 1145 1067 1146 1068 /* 1147 1069 * Complete the current FIFO's SCB if data for this same ··· 1165 1085 test SCB_SGPTR, SG_FULL_RESID jnz upload_scb;/* Never xfered */ 1166 1086 test SCB_RESIDUAL_SGPTR, SG_LIST_NULL jz upload_scb; 1167 1087 complete: 1088 + BEGIN_CRITICAL; 1168 1089 bmov SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2; 1169 1090 bmov COMPLETE_SCB_HEAD, SCBPTR, 2 ret; 1091 + END_CRITICAL; 1170 1092 bad_status: 1171 1093 cmp SCB_SCSI_STATUS, STATUS_PKT_SENSE je upload_scb; 1172 1094 call freeze_queue; ··· 1179 1097 * it on the host. 1180 1098 */ 1181 1099 bmov SCB_TAG, SCBPTR, 2; 1182 - bmov SCB_NEXT_COMPLETE, COMPLETE_DMA_SCB_HEAD, 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; 1183 1104 bmov COMPLETE_DMA_SCB_HEAD, SCBPTR, 2; 1184 - or SCB_SGPTR, SG_STATUS_VALID ret; 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; 1185 1112 1186 1113 /* 1187 1114 * Is it a disconnect message? Set a flag in the SCB to remind us ··· 1237 1146 await_busfree_clrchn: 1238 1147 mvi DFFSXFRCTL, CLRCHN; 1239 1148 await_busfree_not_m_dff: 1240 - call clear_target_state; 1149 + /* clear target specific flags */ 1150 + mvi SEQ_FLAGS, NOT_IDENTIFIED|NO_CDB_SENT; 1241 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; 1242 1161 test SSTAT1, BUSFREE jnz idle_loop; 1243 1162 SET_SEQINTCODE(MISSED_BUSFREE) 1244 1163 ··· 1302 1201 msgin_rdptrs_get_fifo: 1303 1202 call allocate_fifo; 1304 1203 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 1204 1311 1205 phase_lock: 1312 1206 if ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0) { ··· 1394 1298 test CCSGCTL, CCSGENACK jnz return; 1395 1299 1396 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 + /* 1397 1342 * We fetch a "cacheline aligned" and sized amount of data 1398 1343 * so we don't end up referencing a non-existant page. 1399 1344 * Cacheline aligned is in quotes because the kernel will ··· 1445 1308 mvi SGHCNT, SG_PREFETCH_CNT; 1446 1309 if ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0) { 1447 1310 /* 1448 - * Need two instruction between "touches" of SGHADDR. 1311 + * Need two instructions between "touches" of SGHADDR. 1449 1312 */ 1450 1313 nop; 1451 1314 } ··· 1795 1658 * savepointer in the current FIFO. We do this so that 1796 1659 * a pending CTXTDONE or SAVEPTR is visible in the active 1797 1660 * 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 1661 + * have lost the race (e.g. host paused us) and our attempts 1799 1662 * to disable the channel occurred after all REQs were 1800 1663 * already seen and acked (REQINIT never comes true). 1801 1664 */ ··· 1804 1667 test DFCNTRL, DIRECTION jz interrupt_return; 1805 1668 and DFCNTRL, ~SCSIEN; 1806 1669 snapshot_wait_data_valid: 1807 - test SEQINTSRC, (CTXTDONE|SAVEPTRS) jnz snapshot_data_valid; 1670 + test SEQINTSRC, (CTXTDONE|SAVEPTRS) jnz interrupt_return; 1808 1671 test SSTAT1, REQINIT jz snapshot_wait_data_valid; 1809 1672 snapshot_data_valid: 1810 1673 or DFCNTRL, SCSIEN; ··· 1971 1834 dec SCB_FIFO_USE_COUNT; 1972 1835 test SCB_CONTROL, STATUS_RCVD jnz pkt_complete_scb_if_fifos_idle; 1973 1836 mvi DFFSXFRCTL, CLRCHN ret; 1974 - END_CRITICAL; 1975 1837 1976 1838 /* 1977 1839 * LAST_SEG_DONE status has been seen in the current FIFO. ··· 1979 1843 * Check for overrun and see if we can complete this command. 1980 1844 */ 1981 1845 pkt_last_seg_done: 1982 - BEGIN_CRITICAL; 1983 1846 /* 1984 1847 * Mark transfer as completed. 1985 1848 */
+418 -365
drivers/scsi/aic7xxx/aic79xx_core.c
··· 37 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 38 * POSSIBILITY OF SUCH DAMAGES. 39 39 * 40 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#202 $ 41 - * 42 - * $FreeBSD$ 40 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#247 $ 43 41 */ 44 42 45 43 #ifdef __linux__ ··· 330 332 ahd_outb(ahd, SCSISEQ1, 331 333 ahd_inb(ahd, SCSISEQ_TEMPLATE) & (ENSELI|ENRSELI|ENAUTOATNP)); 332 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 + 333 343 ahd_outb(ahd, SEQCTL0, FASTMODE|SEQRESET); 334 344 ahd_unpause(ahd); 335 345 } ··· 379 373 saved_modes = ahd_save_modes(ahd); 380 374 381 375 /* 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. 376 + * Flush the good status FIFO for completed packetized commands. 389 377 */ 390 378 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 391 379 saved_scbptr = ahd_get_scbptr(ahd); ··· 387 387 u_int fifo_mode; 388 388 u_int i; 389 389 390 - scbid = (ahd_inb(ahd, GSFIFO+1) << 8) 391 - | ahd_inb(ahd, GSFIFO); 390 + scbid = ahd_inw(ahd, GSFIFO); 392 391 scb = ahd_lookup_scb(ahd, scbid); 393 392 if (scb == NULL) { 394 393 printf("%s: Warning - GSFIFO SCB %d invalid\n", ··· 400 401 * the host before completing the command. 401 402 */ 402 403 fifo_mode = 0; 404 + rescan_fifos: 403 405 for (i = 0; i < 2; i++) { 404 406 /* Toggle to the other mode. */ 405 407 fifo_mode ^= 1; 406 408 ahd_set_modes(ahd, fifo_mode, fifo_mode); 409 + 407 410 if (ahd_scb_active_in_fifo(ahd, scb) == 0) 408 411 continue; 409 412 410 413 ahd_run_data_fifo(ahd, scb); 411 414 412 415 /* 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. 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. 417 428 */ 418 - i = 0; 429 + ahd_delay(200); 430 + goto rescan_fifos; 419 431 } 420 432 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 421 433 ahd_set_scbptr(ahd, scbid); ··· 439 429 /* 440 430 * The transfer completed with a residual. 441 431 * Place this SCB on the complete DMA list 442 - * so that we Update our in-core copy of the 432 + * so that we update our in-core copy of the 443 433 * SCB before completing the command. 444 434 */ 445 435 ahd_outb(ahd, SCB_SCSI_STATUS, 0); 446 436 ahd_outb(ahd, SCB_SGPTR, 447 437 ahd_inb_scbram(ahd, SCB_SGPTR) 448 438 | SG_STATUS_VALID); 449 - ahd_outw(ahd, SCB_TAG, SCB_GET_TAG(scb)); 439 + ahd_outw(ahd, SCB_TAG, scbid); 440 + ahd_outw(ahd, SCB_NEXT_COMPLETE, SCB_LIST_NULL); 450 441 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)); 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 + } 455 454 } else 456 455 ahd_complete_scb(ahd, scb); 457 456 } ··· 484 465 break; 485 466 ahd_delay(200); 486 467 } 487 - if ((ccscbctl & CCSCBDIR) != 0) 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) 488 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); 489 483 490 484 saved_scbptr = ahd_get_scbptr(ahd); 491 485 /* ··· 526 494 scbid = next_scbid; 527 495 } 528 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); 529 515 530 516 scbid = ahd_inw(ahd, COMPLETE_SCB_HEAD); 531 517 while (!SCBID_IS_NULL(scbid)) { ··· 608 558 { 609 559 u_int seqintsrc; 610 560 611 - while (1) { 612 - seqintsrc = ahd_inb(ahd, SEQINTSRC); 613 - if ((seqintsrc & CFG4DATA) != 0) { 614 - uint32_t datacnt; 615 - uint32_t sgptr; 561 + seqintsrc = ahd_inb(ahd, SEQINTSRC); 562 + if ((seqintsrc & CFG4DATA) != 0) { 563 + uint32_t datacnt; 564 + uint32_t sgptr; 616 565 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); 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); 622 571 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); 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; 678 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); 679 585 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); 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); 686 591 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; 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); 735 597 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 - } 598 + /* 599 + * Install a "fake" handler for this FIFO. 600 + */ 601 + ahd_outw(ahd, LONGJMP_ADDR, 0); 744 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) { 745 613 /* 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. 614 + * Snapshot Save Pointers. All that 615 + * is necessary to clear the snapshot 616 + * is a CLRCHN. 750 617 */ 751 - if ((ahd_inb(ahd, DFSTATUS) & PRELOAD_AVAIL) == 0) 752 - continue; 753 - if ((ahd_inb(ahd, DFCNTRL) & HDMAENACK) == 0) 754 - continue; 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) { 755 701 756 702 /* 757 703 * Determine the offset of the next S/G ··· 794 748 * Advertise the segment to the hardware. 795 749 */ 796 750 dfcntrl = ahd_inb(ahd, DFCNTRL)|PRELOADEN|HDMAEN; 797 - if ((ahd->features & AHD_NEW_DFCNTRL_OPTS)!=0) { 751 + if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0) { 798 752 /* 799 753 * Use SCSIENWRDIS so that SCSIEN 800 754 * is never modified by this ··· 803 757 dfcntrl |= SCSIENWRDIS; 804 758 } 805 759 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 760 } 819 - ahd_delay(200); 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); 820 781 } 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 782 } 831 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 + */ 832 794 void 833 795 ahd_run_qoutfifo(struct ahd_softc *ahd) 834 796 { 797 + struct ahd_completion *completion; 835 798 struct scb *scb; 836 799 u_int scb_index; 837 800 ··· 848 793 panic("ahd_run_qoutfifo recursion"); 849 794 ahd->flags |= AHD_RUNNING_QOUTFIFO; 850 795 ahd_sync_qoutfifo(ahd, BUS_DMASYNC_POSTREAD); 851 - while ((ahd->qoutfifo[ahd->qoutfifonext] 852 - & QOUTFIFO_ENTRY_VALID_LE) == ahd->qoutfifonext_valid_tag) { 796 + for (;;) { 797 + completion = &ahd->qoutfifo[ahd->qoutfifonext]; 853 798 854 - scb_index = ahd_le16toh(ahd->qoutfifo[ahd->qoutfifonext] 855 - & ~QOUTFIFO_ENTRY_VALID_LE); 799 + if (completion->valid_tag != ahd->qoutfifonext_valid_tag) 800 + break; 801 + 802 + scb_index = ahd_le16toh(completion->tag); 856 803 scb = ahd_lookup_scb(ahd, scb_index); 857 804 if (scb == NULL) { 858 805 printf("%s: WARNING no command for scb %d " ··· 862 805 ahd_name(ahd), scb_index, 863 806 ahd->qoutfifonext); 864 807 ahd_dump_card_state(ahd); 865 - } else 866 - ahd_complete_scb(ahd, scb); 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 + } 867 813 868 814 ahd->qoutfifonext = (ahd->qoutfifonext+1) & (AHD_QOUT_SIZE-1); 869 815 if (ahd->qoutfifonext == 0) 870 - ahd->qoutfifonext_valid_tag ^= QOUTFIFO_ENTRY_VALID_LE; 816 + ahd->qoutfifonext_valid_tag ^= QOUTFIFO_ENTRY_VALID; 871 817 } 872 818 ahd->flags &= ~AHD_RUNNING_QOUTFIFO; 873 819 } ··· 936 876 ahd_name(ahd), seqintcode); 937 877 #endif 938 878 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 879 case ENTERING_NONPACK: 960 880 { 961 881 struct scb *scb; ··· 1100 1060 ahd_outb(ahd, SAVED_LUN, 0); 1101 1061 ahd_outb(ahd, SEQ_FLAGS, 0); 1102 1062 ahd_assert_atn(ahd); 1103 - scb->flags &= ~(SCB_PACKETIZED); 1063 + scb->flags &= ~SCB_PACKETIZED; 1104 1064 scb->flags |= SCB_ABORT|SCB_CMDPHASE_ABORT; 1105 1065 ahd_freeze_devq(ahd, scb); 1106 1066 ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); ··· 1543 1503 && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) != 0) 1544 1504 scb = NULL; 1545 1505 1546 - /* Make sure the sequencer is in a safe location. */ 1547 - ahd_clear_critical_section(ahd); 1548 - 1549 1506 if ((status0 & IOERR) != 0) { 1550 1507 u_int now_lvd; 1551 1508 ··· 1558 1521 ahd_setup_iocell_workaround(ahd); 1559 1522 ahd_unpause(ahd); 1560 1523 } else if ((status0 & OVERRUN) != 0) { 1524 + 1561 1525 printf("%s: SCSI offset overrun detected. Resetting bus.\n", 1562 1526 ahd_name(ahd)); 1563 1527 ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE); 1564 1528 } else if ((status & SCSIRSTI) != 0) { 1529 + 1565 1530 printf("%s: Someone reset channel A\n", ahd_name(ahd)); 1566 1531 ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE); 1567 1532 } else if ((status & SCSIPERR) != 0) { 1533 + 1534 + /* Make sure the sequencer is in a safe location. */ 1535 + ahd_clear_critical_section(ahd); 1536 + 1568 1537 ahd_handle_transmission_error(ahd); 1569 1538 } else if (lqostat0 != 0) { 1539 + 1570 1540 printf("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0); 1571 1541 ahd_outb(ahd, CLRLQOINT0, lqostat0); 1572 - if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) { 1542 + if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) 1573 1543 ahd_outb(ahd, CLRLQOINT1, 0); 1574 - } 1575 1544 } else if ((status & SELTO) != 0) { 1576 1545 u_int scbid; 1577 1546 1578 1547 /* Stop the selection */ 1579 1548 ahd_outb(ahd, SCSISEQ0, 0); 1549 + 1550 + /* Make sure the sequencer is in a safe location. */ 1551 + ahd_clear_critical_section(ahd); 1580 1552 1581 1553 /* No more pending messages */ 1582 1554 ahd_clear_msg_state(ahd); ··· 1619 1573 scbid); 1620 1574 } 1621 1575 #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 1576 ahd_scb_devinfo(ahd, &devinfo, scb); 1632 - ahd_force_renegotiation(ahd, &devinfo); 1633 1577 ahd_set_transaction_status(scb, CAM_SEL_TIMEOUT); 1634 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); 1635 1591 } 1636 1592 ahd_outb(ahd, CLRINT, CLRSCSIINT); 1637 1593 ahd_iocell_first_selection(ahd); 1638 1594 ahd_unpause(ahd); 1639 1595 } else if ((status0 & (SELDI|SELDO)) != 0) { 1596 + 1640 1597 ahd_iocell_first_selection(ahd); 1641 1598 ahd_unpause(ahd); 1642 1599 } else if (status3 != 0) { ··· 1647 1598 ahd_name(ahd), status3); 1648 1599 ahd_outb(ahd, CLRSINT3, status3); 1649 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 + 1650 1605 ahd_handle_lqiphase_error(ahd, lqistat1); 1651 1606 } else if ((lqistat1 & LQICRCI_NLQ) != 0) { 1652 1607 /* ··· 1674 1621 * go about selecting the target while we handle the event. 1675 1622 */ 1676 1623 ahd_outb(ahd, SCSISEQ0, 0); 1624 + 1625 + /* Make sure the sequencer is in a safe location. */ 1626 + ahd_clear_critical_section(ahd); 1677 1627 1678 1628 /* 1679 1629 * Determine what we were up to at the time of ··· 1715 1659 clear_fifo = 0; 1716 1660 packetized = (lqostat1 & LQOBUSFREE) != 0; 1717 1661 if (!packetized 1718 - && ahd_inb(ahd, LASTPHASE) == P_BUSFREE) 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 + */ 1719 1672 packetized = 1; 1720 1673 break; 1721 1674 } ··· 2375 2310 "PRGMCNT == 0x%x\n", 2376 2311 ahd_lookup_phase_entry(lastphase)->phasemsg, 2377 2312 aborted, 2378 - ahd_inb(ahd, PRGMCNT) 2379 - | (ahd_inb(ahd, PRGMCNT+1) << 8)); 2313 + ahd_inw(ahd, PRGMCNT)); 2380 2314 ahd_dump_card_state(ahd); 2381 2315 } 2382 2316 /* Always restart the sequencer. */ ··· 2538 2474 u_int i; 2539 2475 2540 2476 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 2541 - seqaddr = ahd_inb(ahd, CURADDR) 2542 - | (ahd_inb(ahd, CURADDR+1) << 8); 2477 + seqaddr = ahd_inw(ahd, CURADDR); 2543 2478 2544 2479 cs = ahd->critical_sections; 2545 2480 for (i = 0; i < ahd->num_critical_sections; i++, cs++) { ··· 3259 3196 iocell_opts[AHD_PRECOMP_SLEW_INDEX] &= ~AHD_PRECOMP_MASK; 3260 3197 3261 3198 if ((ahd->features & AHD_NEW_IOCELL_OPTS) != 0 3262 - && (ppr_opts & MSG_EXT_PPR_DT_REQ) != 0) { 3199 + && (ppr_opts & MSG_EXT_PPR_DT_REQ) != 0 3200 + && (ppr_opts & MSG_EXT_PPR_IU_REQ) == 0) { 3263 3201 /* 3264 3202 * Slow down our CRC interval to be 3265 - * compatible with devices that can't 3266 - * handle a CRC at full speed. 3203 + * compatible with non-packetized 3204 + * U160 devices that can't handle a 3205 + * CRC at full speed. 3267 3206 */ 3268 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; 3269 3217 } 3270 3218 } 3271 3219 ··· 3366 3292 * Force the sequencer to reinitialize the selection for 3367 3293 * the command at the head of the execution queue if it 3368 3294 * has already been setup. The negotiation changes may 3369 - * effect whether we select-out with ATN. 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. 3370 3298 */ 3371 3299 saved_modes = ahd_save_modes(ahd); 3372 3300 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 3373 - ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); 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); 3374 3304 saved_scbptr = ahd_get_scbptr(ahd); 3375 3305 /* Ensure that the hscbs down on the card match the new information */ 3376 3306 for (scb_tag = 0; scb_tag < ahd->scb_data.maxhscbs; scb_tag++) { ··· 4987 4909 * Determine initial values for data_addr and data_cnt 4988 4910 * for resuming the data phase. 4989 4911 */ 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); 4912 + sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR); 4994 4913 sgptr &= SG_PTR_MASK; 4995 4914 4996 4915 resid = (ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT + 2) << 16) ··· 5005 4930 dataptr = ahd_le64toh(sg->addr) 5006 4931 + (ahd_le32toh(sg->len) & AHD_SG_LEN_MASK) 5007 4932 - 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); 4933 + ahd_outl(ahd, HADDR + 4, dataptr >> 32); 5012 4934 } else { 5013 4935 struct ahd_dma_seg *sg; 5014 4936 ··· 5020 4948 ahd_outb(ahd, HADDR + 4, 5021 4949 (ahd_le32toh(sg->len) & ~AHD_SG_LEN_MASK) >> 24); 5022 4950 } 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); 4951 + ahd_outl(ahd, HADDR, dataptr); 5027 4952 ahd_outb(ahd, HCNT + 2, resid >> 16); 5028 4953 ahd_outb(ahd, HCNT + 1, resid >> 8); 5029 4954 ahd_outb(ahd, HCNT, resid); ··· 5080 5011 ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT, 5081 5012 AHD_TRANS_CUR, /*paused*/TRUE); 5082 5013 ahd_set_syncrate(ahd, devinfo, /*period*/0, /*offset*/0, 5083 - /*ppr_options*/0, AHD_TRANS_CUR, /*paused*/TRUE); 5014 + /*ppr_options*/0, AHD_TRANS_CUR, 5015 + /*paused*/TRUE); 5084 5016 5085 - ahd_send_async(ahd, devinfo->channel, devinfo->target, 5086 - lun, AC_SENT_BDR, NULL); 5017 + if (status != CAM_SEL_TIMEOUT) 5018 + ahd_send_async(ahd, devinfo->channel, devinfo->target, 5019 + CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); 5087 5020 5088 - if (message != NULL 5089 - && (verbose_level <= bootverbose)) 5021 + if (message != NULL && bootverbose) 5090 5022 printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), 5091 5023 message, devinfo->channel, devinfo->target, found); 5092 5024 } ··· 5273 5203 /* FALLTHROUGH */ 5274 5204 case 4: 5275 5205 ahd_dmamap_unload(ahd, ahd->shared_data_dmat, 5276 - ahd->shared_data_dmamap); 5206 + ahd->shared_data_map.dmamap); 5277 5207 /* FALLTHROUGH */ 5278 5208 case 3: 5279 5209 ahd_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo, 5280 - ahd->shared_data_dmamap); 5210 + ahd->shared_data_map.dmamap); 5281 5211 ahd_dmamap_destroy(ahd, ahd->shared_data_dmat, 5282 - ahd->shared_data_dmamap); 5212 + ahd->shared_data_map.dmamap); 5283 5213 /* FALLTHROUGH */ 5284 5214 case 2: 5285 5215 ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat); ··· 6045 5975 newcount = MIN(scb_data->sense_left, scb_data->scbs_left); 6046 5976 newcount = MIN(newcount, scb_data->sgs_left); 6047 5977 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 5978 for (i = 0; i < newcount; i++) { 6052 - u_int col_tag; 6053 - 6054 5979 struct scb_platform_data *pdata; 5980 + u_int col_tag; 6055 5981 #ifndef __linux__ 6056 5982 int error; 6057 5983 #endif 5984 + 6058 5985 next_scb = (struct scb *)malloc(sizeof(*next_scb), 6059 5986 M_DEVBUF, M_NOWAIT); 6060 5987 if (next_scb == NULL) ··· 6108 6041 sense_data += AHD_SENSE_BUFSIZE; 6109 6042 sense_busaddr += AHD_SENSE_BUFSIZE; 6110 6043 scb_data->numscbs++; 6044 + scb_data->sense_left--; 6045 + scb_data->scbs_left--; 6046 + scb_data->sgs_left--; 6111 6047 } 6112 6048 } 6113 6049 ··· 6158 6088 int 6159 6089 ahd_init(struct ahd_softc *ahd) 6160 6090 { 6161 - uint8_t *base_vaddr; 6162 6091 uint8_t *next_vaddr; 6163 6092 dma_addr_t next_baddr; 6164 6093 size_t driver_data_size; ··· 6225 6156 * for the target mode role, we must additionally provide space for 6226 6157 * the incoming target command fifo. 6227 6158 */ 6228 - driver_data_size = AHD_SCB_MAX * sizeof(uint16_t) 6159 + driver_data_size = AHD_SCB_MAX * sizeof(*ahd->qoutfifo) 6229 6160 + sizeof(struct hardware_scb); 6230 6161 if ((ahd->features & AHD_TARGETMODE) != 0) 6231 6162 driver_data_size += AHD_TMODE_CMDS * sizeof(struct target_cmd); ··· 6247 6178 6248 6179 /* Allocation of driver data */ 6249 6180 if (ahd_dmamem_alloc(ahd, ahd->shared_data_dmat, 6250 - (void **)&base_vaddr, 6251 - BUS_DMA_NOWAIT, &ahd->shared_data_dmamap) != 0) { 6181 + (void **)&ahd->shared_data_map.vaddr, 6182 + BUS_DMA_NOWAIT, 6183 + &ahd->shared_data_map.dmamap) != 0) { 6252 6184 return (ENOMEM); 6253 6185 } 6254 6186 6255 6187 ahd->init_level++; 6256 6188 6257 6189 /* 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; 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; 6262 6195 next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE]; 6263 - next_baddr = ahd->shared_data_busaddr + AHD_QOUT_SIZE*sizeof(uint16_t); 6196 + next_baddr = ahd->shared_data_map.physaddr 6197 + + AHD_QOUT_SIZE*sizeof(struct ahd_completion); 6264 6198 if ((ahd->features & AHD_TARGETMODE) != 0) { 6265 6199 ahd->targetcmds = (struct target_cmd *)next_vaddr; 6266 6200 next_vaddr += AHD_TMODE_CMDS * sizeof(struct target_cmd); ··· 6284 6212 * specially from the DMA safe memory chunk used for the QOUTFIFO. 6285 6213 */ 6286 6214 ahd->next_queued_hscb = (struct hardware_scb *)next_vaddr; 6215 + ahd->next_queued_hscb_map = &ahd->shared_data_map; 6287 6216 ahd->next_queued_hscb->hscb_busaddr = ahd_htole32(next_baddr); 6288 6217 6289 6218 ahd->init_level++; ··· 6590 6517 6591 6518 /* All of our queues are empty */ 6592 6519 ahd->qoutfifonext = 0; 6593 - ahd->qoutfifonext_valid_tag = QOUTFIFO_ENTRY_VALID_LE; 6594 - ahd_outb(ahd, QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID >> 8); 6520 + ahd->qoutfifonext_valid_tag = QOUTFIFO_ENTRY_VALID; 6521 + ahd_outb(ahd, QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID); 6595 6522 for (i = 0; i < AHD_QOUT_SIZE; i++) 6596 - ahd->qoutfifo[i] = 0; 6523 + ahd->qoutfifo[i].valid_tag = 0; 6597 6524 ahd_sync_qoutfifo(ahd, BUS_DMASYNC_PREREAD); 6598 6525 6599 6526 ahd->qinfifonext = 0; ··· 6626 6553 ahd_outw(ahd, COMPLETE_SCB_HEAD, SCB_LIST_NULL); 6627 6554 ahd_outw(ahd, COMPLETE_SCB_DMAINPROG_HEAD, SCB_LIST_NULL); 6628 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); 6629 6558 6630 6559 /* 6631 6560 * The Freeze Count is 0. 6632 6561 */ 6562 + ahd->qfreeze_cnt = 0; 6633 6563 ahd_outw(ahd, QFREEZE_COUNT, 0); 6564 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, 0); 6634 6565 6635 6566 /* 6636 6567 * Tell the sequencer where it can find our arrays in memory. 6637 6568 */ 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); 6569 + busaddr = ahd->shared_data_map.physaddr; 6570 + ahd_outl(ahd, SHARED_DATA_ADDR, busaddr); 6571 + ahd_outl(ahd, QOUTFIFO_NEXT_ADDR, busaddr); 6647 6572 6648 6573 /* 6649 6574 * Setup the allowed SCSI Sequences based on operational mode. ··· 6690 6619 * Tell the sequencer which SCB will be the next one it receives. 6691 6620 */ 6692 6621 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); 6622 + ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr); 6697 6623 6698 6624 /* 6699 6625 * Default to coalescing disabled. ··· 6994 6926 { 6995 6927 u_int intstat; 6996 6928 u_int maxloops; 6997 - u_int qfreeze_cnt; 6998 6929 6999 6930 maxloops = 1000; 7000 6931 ahd->flags |= AHD_ALL_INTERRUPTS; 7001 6932 ahd_pause(ahd); 7002 6933 /* 7003 - * Increment the QFreeze Count so that the sequencer 7004 - * will not start new selections. We do this only 6934 + * Freeze the outgoing selections. We do this only 7005 6935 * until we are safely paused without further selections 7006 6936 * pending. 7007 6937 */ 7008 - ahd_outw(ahd, QFREEZE_COUNT, ahd_inw(ahd, QFREEZE_COUNT) + 1); 6938 + ahd->qfreeze_cnt--; 6939 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); 7009 6940 ahd_outb(ahd, SEQ_FLAGS2, ahd_inb(ahd, SEQ_FLAGS2) | SELECTOUT_QFROZEN); 7010 6941 do { 7011 - struct scb *waiting_scb; 7012 6942 7013 6943 ahd_unpause(ahd); 6944 + /* 6945 + * Give the sequencer some time to service 6946 + * any active selections. 6947 + */ 6948 + ahd_delay(500); 6949 + 7014 6950 ahd_intr(ahd); 7015 6951 ahd_pause(ahd); 7016 - ahd_clear_critical_section(ahd); 7017 6952 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); 6953 + if ((intstat & INT_PEND) == 0) { 6954 + ahd_clear_critical_section(ahd); 6955 + intstat = ahd_inb(ahd, INTSTAT); 6956 + } 7034 6957 } while (--maxloops 7035 6958 && (intstat != 0xFF || (ahd->features & AHD_REMOVABLE) == 0) 7036 6959 && ((intstat & INT_PEND) != 0 ··· 7032 6973 printf("Infinite interrupt loop, INTSTAT = %x", 7033 6974 ahd_inb(ahd, INTSTAT)); 7034 6975 } 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); 6976 + ahd->qfreeze_cnt++; 6977 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); 7046 6978 7047 6979 ahd_flush_qoutfifo(ahd); 7048 6980 ··· 7205 7155 uint32_t busaddr; 7206 7156 7207 7157 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); 7158 + ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr); 7212 7159 } else { 7213 7160 prev_scb->hscb->next_hscb_busaddr = scb->hscb->hscb_busaddr; 7214 7161 ahd_sync_scb(ahd, prev_scb, ··· 7312 7265 */ 7313 7266 ahd->qinfifonext = qinstart; 7314 7267 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); 7268 + ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr); 7319 7269 7320 7270 while (qinpos != qintail) { 7321 7271 scb = ahd_lookup_scb(ahd, ahd->qinfifo[qinpos]); ··· 7374 7330 * appropriate, traverse the SCBs of each "their id" 7375 7331 * looking for matches. 7376 7332 */ 7333 + ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); 7377 7334 savedscbptr = ahd_get_scbptr(ahd); 7378 7335 tid_next = ahd_inw(ahd, WAITING_TID_HEAD); 7379 7336 tid_prev = SCB_LIST_NULL; ··· 7444 7399 u_int prev; 7445 7400 int found; 7446 7401 7447 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 7402 + AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); 7448 7403 found = 0; 7449 7404 prev = SCB_LIST_NULL; 7450 7405 next = *list_head; ··· 7511 7466 ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev, 7512 7467 u_int tid_cur, u_int tid_next) 7513 7468 { 7514 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 7469 + AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); 7515 7470 7516 7471 if (SCBID_IS_NULL(tid_cur)) { 7517 7472 ··· 7551 7506 { 7552 7507 u_int tail_offset; 7553 7508 7554 - AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); 7509 + AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); 7555 7510 if (!SCBID_IS_NULL(prev)) { 7556 7511 ahd_set_scbptr(ahd, prev); 7557 7512 ahd_outw(ahd, SCB_NEXT, next); ··· 7784 7739 */ 7785 7740 ahd_clear_msg_state(ahd); 7786 7741 ahd_outb(ahd, SIMODE1, 7787 - ahd_inb(ahd, SIMODE1) & ~(ENBUSFREE|ENSCSIRST|ENBUSFREE)); 7742 + ahd_inb(ahd, SIMODE1) & ~(ENBUSFREE|ENSCSIRST)); 7788 7743 7789 7744 if (initiate_reset) 7790 7745 ahd_reset_current_bus(ahd); ··· 7955 7910 void 7956 7911 ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) 7957 7912 { 7958 - struct hardware_scb *hscb; 7959 - u_int qfreeze_cnt; 7913 + struct hardware_scb *hscb; 7914 + int paused; 7960 7915 7961 7916 /* 7962 7917 * The sequencer freezes its select-out queue 7963 7918 * anytime a SCSI status error occurs. We must 7964 - * handle the error and decrement the QFREEZE count 7965 - * to allow the sequencer to continue. 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. 7966 7924 */ 7967 7925 hscb = scb->hscb; 7926 + 7927 + if (ahd_is_paused(ahd)) { 7928 + paused = 1; 7929 + } else { 7930 + paused = 0; 7931 + ahd_pause(ahd); 7932 + } 7968 7933 7969 7934 /* Freeze the queue until the client sees the error. */ 7970 7935 ahd_freeze_devq(ahd, scb); 7971 7936 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); 7937 + ahd->qfreeze_cnt++; 7938 + ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt); 7939 + 7940 + if (paused == 0) 7941 + ahd_unpause(ahd); 7982 7942 7983 7943 /* Don't want to clobber the original sense code */ 7984 7944 if ((scb->flags & SCB_SENSE) != 0) { ··· 8367 8317 max_prog = 2048; 8368 8318 8369 8319 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM); 8370 - ahd_outb(ahd, PRGMCNT, 0); 8371 - ahd_outb(ahd, PRGMCNT+1, 0); 8320 + ahd_outw(ahd, PRGMCNT, 0); 8372 8321 for (i = 0; i < max_prog; i++) { 8373 8322 uint8_t ins_bytes[4]; 8374 8323 ··· 8396 8347 u_int sg_prefetch_cnt_limit; 8397 8348 u_int sg_prefetch_align; 8398 8349 u_int sg_size; 8350 + u_int cacheline_mask; 8399 8351 uint8_t download_consts[DOWNLOAD_CONST_COUNT]; 8400 8352 8401 8353 if (bootverbose) 8402 8354 printf("%s: Downloading Sequencer Program...", 8403 8355 ahd_name(ahd)); 8404 8356 8405 - #if DOWNLOAD_CONST_COUNT != 7 8357 + #if DOWNLOAD_CONST_COUNT != 8 8406 8358 #error "Download Const Mismatch" 8407 8359 #endif 8408 8360 /* ··· 8439 8389 /* Round down to the nearest power of 2. */ 8440 8390 while (powerof2(sg_prefetch_align) == 0) 8441 8391 sg_prefetch_align--; 8392 + 8393 + cacheline_mask = sg_prefetch_align - 1; 8394 + 8442 8395 /* 8443 8396 * If the cacheline boundary is greater than half our prefetch RAM 8444 8397 * we risk not being able to fetch even a single complete S/G ··· 8482 8429 download_consts[PKT_OVERRUN_BUFOFFSET] = 8483 8430 (ahd->overrun_buf - (uint8_t *)ahd->qoutfifo) / 256; 8484 8431 download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_1BYTE_LUN; 8432 + download_consts[CACHELINE_MASK] = cacheline_mask; 8485 8433 cur_patch = patches; 8486 8434 downloaded = 0; 8487 8435 skip_addr = 0; 8488 8436 ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM); 8489 - ahd_outb(ahd, PRGMCNT, 0); 8490 - ahd_outb(ahd, PRGMCNT+1, 0); 8437 + ahd_outw(ahd, PRGMCNT, 0); 8491 8438 8492 8439 for (i = 0; i < sizeof(seqprog)/4; i++) { 8493 8440 if (ahd_check_patch(ahd, &cur_patch, i, &skip_addr) == 0) { ··· 8780 8727 printf(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n" 8781 8728 "%s: Dumping Card State at program address 0x%x Mode 0x%x\n", 8782 8729 ahd_name(ahd), 8783 - ahd_inb(ahd, CURADDR) | (ahd_inb(ahd, CURADDR+1) << 8), 8730 + ahd_inw(ahd, CURADDR), 8784 8731 ahd_build_mode_state(ahd, ahd->saved_src_mode, 8785 8732 ahd->saved_dst_mode)); 8786 8733 if (paused) ··· 8889 8836 8890 8837 printf("Sequencer DMA-Up and Complete list: "); 8891 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); 8892 8848 i = 0; 8893 8849 while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) { 8894 8850 ahd_set_scbptr(ahd, scb_index); ··· 9139 9077 { 9140 9078 int cnt; 9141 9079 9142 - cnt = 20; 9080 + cnt = 5000; 9143 9081 while ((ahd_inb(ahd, SEESTAT) & (SEEARBACK|SEEBUSY)) != 0 && --cnt) 9144 9082 ahd_delay(5); 9145 9083 ··· 9485 9423 if ((ahd->features & AHD_MULTI_TID) != 0) { 9486 9424 u_int targid_mask; 9487 9425 9488 - targid_mask = ahd_inb(ahd, TARGID) 9489 - | (ahd_inb(ahd, TARGID + 1) << 8); 9490 - 9426 + targid_mask = ahd_inw(ahd, TARGID); 9491 9427 targid_mask |= target_mask; 9492 - ahd_outb(ahd, TARGID, targid_mask); 9493 - ahd_outb(ahd, TARGID+1, (targid_mask >> 8)); 9494 - 9428 + ahd_outw(ahd, TARGID, targid_mask); 9495 9429 ahd_update_scsiid(ahd, targid_mask); 9496 9430 } else { 9497 9431 u_int our_id; ··· 9601 9543 if (ahd->features & AHD_MULTI_TID) { 9602 9544 u_int targid_mask; 9603 9545 9604 - targid_mask = ahd_inb(ahd, TARGID) 9605 - | (ahd_inb(ahd, TARGID + 1) 9606 - << 8); 9607 - 9546 + targid_mask = ahd_inw(ahd, TARGID); 9608 9547 targid_mask &= ~target_mask; 9609 - ahd_outb(ahd, TARGID, targid_mask); 9610 - ahd_outb(ahd, TARGID+1, 9611 - (targid_mask >> 8)); 9548 + ahd_outw(ahd, TARGID, targid_mask); 9612 9549 ahd_update_scsiid(ahd, targid_mask); 9613 9550 } 9614 9551 } ··· 9704 9651 9705 9652 cmd->cmd_valid = 0; 9706 9653 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 9707 - ahd->shared_data_dmamap, 9654 + ahd->shared_data_map.dmamap, 9708 9655 ahd_targetcmd_offset(ahd, ahd->tqinfifonext), 9709 9656 sizeof(struct target_cmd), 9710 9657 BUS_DMASYNC_PREREAD);
+26 -12
drivers/scsi/aic7xxx/aic79xx_inline.h
··· 37 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 38 * POSSIBILITY OF SUCH DAMAGES. 39 39 * 40 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#51 $ 40 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#58 $ 41 41 * 42 42 * $FreeBSD$ 43 43 */ ··· 522 522 static __inline uint16_t 523 523 ahd_inw(struct ahd_softc *ahd, u_int port) 524 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 + */ 525 530 return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port)); 526 531 } 527 532 528 533 static __inline void 529 534 ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) 530 535 { 536 + /* 537 + * Write low byte first to accomodate registers 538 + * such as PRGMCNT where the order maters. 539 + */ 531 540 ahd_outb(ahd, port, value & 0xFF); 532 541 ahd_outb(ahd, port+1, (value >> 8) & 0xFF); 533 542 } ··· 693 684 * Razor #528 694 685 */ 695 686 value = ahd_inb(ahd, offset); 696 - if ((ahd->flags & AHD_PCIX_SCBRAM_RD_BUG) != 0) 687 + if ((ahd->bugs & AHD_PCIX_SCBRAM_RD_BUG) != 0) 697 688 ahd_inb(ahd, MODE_PTR); 698 689 return (value); 699 690 } ··· 736 727 static __inline void 737 728 ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) 738 729 { 739 - struct hardware_scb *q_hscb; 730 + struct hardware_scb *q_hscb; 731 + struct map_node *q_hscb_map; 740 732 uint32_t saved_hscb_busaddr; 741 733 742 734 /* ··· 753 743 * locate the correct SCB by SCB_TAG. 754 744 */ 755 745 q_hscb = ahd->next_queued_hscb; 746 + q_hscb_map = ahd->next_queued_hscb_map; 756 747 saved_hscb_busaddr = q_hscb->hscb_busaddr; 757 748 memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); 758 749 q_hscb->hscb_busaddr = saved_hscb_busaddr; ··· 761 750 762 751 /* Now swap HSCB pointers. */ 763 752 ahd->next_queued_hscb = scb->hscb; 753 + ahd->next_queued_hscb_map = scb->hscb_map; 764 754 scb->hscb = q_hscb; 755 + scb->hscb_map = q_hscb_map; 765 756 766 757 /* Now define the mapping from tag to SCB in the scbindex */ 767 758 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb; ··· 837 824 static __inline void 838 825 ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) 839 826 { 840 - ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_dmamap, 841 - /*offset*/0, /*len*/AHC_SCB_MAX * sizeof(uint16_t), op); 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); 842 830 } 843 831 844 832 static __inline void ··· 848 834 #ifdef AHD_TARGET_MODE 849 835 if ((ahd->flags & AHD_TARGETROLE) != 0) { 850 836 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 851 - ahd->shared_data_dmamap, 837 + ahd->shared_data_map.dmamap, 852 838 ahd_targetcmd_offset(ahd, 0), 853 839 sizeof(struct target_cmd) * AHD_TMODE_CMDS, 854 840 op); ··· 868 854 u_int retval; 869 855 870 856 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) 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) 876 862 retval |= AHD_RUN_QOUTFIFO; 877 863 #ifdef AHD_TARGET_MODE 878 864 if ((ahd->flags & AHD_TARGETROLE) != 0 879 865 && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) { 880 866 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 881 - ahd->shared_data_dmamap, 867 + ahd->shared_data_map.dmamap, 882 868 ahd_targetcmd_offset(ahd, ahd->tqinfifofnext), 883 869 /*len*/sizeof(struct target_cmd), 884 870 BUS_DMASYNC_POSTREAD);
+51 -11
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 1468 1468 if ((tstate->auto_negotiate & mask) != 0) { 1469 1469 scb->flags |= SCB_AUTO_NEGOTIATE; 1470 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; 1471 1495 } 1472 1496 1473 1497 if ((dev->flags & (AHD_DEV_Q_TAGGED|AHD_DEV_Q_BASIC)) != 0) { ··· 2082 2058 int paused; 2083 2059 int wait; 2084 2060 int disconnected; 2061 + int found; 2085 2062 ahd_mode_state saved_modes; 2086 2063 unsigned long flags; 2087 2064 ··· 2201 2176 last_phase = ahd_inb(ahd, LASTPHASE); 2202 2177 saved_scbptr = ahd_get_scbptr(ahd); 2203 2178 active_scbptr = saved_scbptr; 2204 - if (disconnected && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) == 0) { 2179 + if (disconnected && ((last_phase != P_BUSFREE) || 2180 + (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) == 0)) { 2205 2181 struct scb *bus_scb; 2206 2182 2207 2183 bus_scb = ahd_lookup_scb(ahd, active_scbptr); ··· 2220 2194 * bus or is in the disconnected state. 2221 2195 */ 2222 2196 saved_scsiid = ahd_inb(ahd, SAVED_SCSIID); 2223 - if (last_phase != P_BUSFREE 2224 - && (SCB_GET_TAG(pending_scb) == active_scbptr 2197 + if (SCB_GET_TAG(pending_scb) == active_scbptr 2225 2198 || (flag == SCB_DEVICE_RESET 2226 - && SCSIID_TARGET(ahd, saved_scsiid) == scmd_id(cmd)))) { 2199 + && SCSIID_TARGET(ahd, saved_scsiid) == scmd_id(cmd))) { 2227 2200 2228 2201 /* 2229 2202 * We're active on the bus, so assert ATN 2230 2203 * and hope that the target responds. 2231 2204 */ 2232 2205 pending_scb = ahd_lookup_scb(ahd, active_scbptr); 2233 - pending_scb->flags |= SCB_RECOVERY_SCB|flag; 2206 + pending_scb->flags |= SCB_RECOVERY_SCB|SCB_DEVICE_RESET; 2234 2207 ahd_outb(ahd, MSG_OUT, HOST_MSG); 2235 2208 ahd_outb(ahd, SCSISIGO, last_phase|ATNO); 2236 - scmd_printk(KERN_INFO, cmd, "Device is active, asserting ATN\n"); 2209 + scmd_printk(KERN_INFO, cmd, "BDR message in message buffer\n"); 2237 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); 2238 2225 } else if (disconnected) { 2239 2226 2240 2227 /* 2241 2228 * Actually re-queue this SCB in an attempt 2242 2229 * to select the device before it reconnects. 2243 2230 */ 2244 - pending_scb->flags |= SCB_RECOVERY_SCB|SCB_ABORT; 2231 + pending_scb->flags |= SCB_RECOVERY_SCB|flag; 2245 2232 ahd_set_scbptr(ahd, SCB_GET_TAG(pending_scb)); 2246 2233 pending_scb->hscb->cdb_len = 0; 2247 2234 pending_scb->hscb->task_attribute = 0; ··· 2335 2296 timer.expires = jiffies + (5 * HZ); 2336 2297 timer.function = ahd_linux_sem_timeout; 2337 2298 add_timer(&timer); 2338 - printf("Recovery code sleeping\n"); 2299 + printf("%s: Recovery code sleeping\n", ahd_name(ahd)); 2339 2300 down(&ahd->platform_data->eh_sem); 2340 - printf("Recovery code awake\n"); 2301 + printf("%s: Recovery code awake\n", ahd_name(ahd)); 2341 2302 ret = del_timer_sync(&timer); 2342 2303 if (ret == 0) { 2343 - printf("Timer Expired\n"); 2304 + printf("%s: Timer Expired (active %d)\n", 2305 + ahd_name(ahd), dev->active); 2344 2306 retval = FAILED; 2345 2307 } 2346 2308 } 2347 - ahd_unlock(ahd, &flags); 2309 + ahd_unlock(ahd, &flags); 2348 2310 return (retval); 2349 2311 } 2350 2312
+1 -1
drivers/scsi/aic7xxx/aic79xx_osm.h
··· 252 252 /***************************** SMP support ************************************/ 253 253 #include <linux/spinlock.h> 254 254 255 - #define AIC79XX_DRIVER_VERSION "1.3.11" 255 + #define AIC79XX_DRIVER_VERSION "3.0" 256 256 257 257 /*************************** Device Data Structures ***************************/ 258 258 /*
+15 -9
drivers/scsi/aic7xxx/aic79xx_pci.c
··· 38 38 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 39 * POSSIBILITY OF SUCH DAMAGES. 40 40 * 41 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#77 $ 42 - * 43 - * $FreeBSD$ 41 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#89 $ 44 42 */ 45 43 46 44 #ifdef __linux__ ··· 112 114 "Adaptec 29320ALP Ultra320 SCSI adapter", 113 115 ahd_aic7901_setup 114 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 + }, 115 124 /* aic7902 based controllers */ 116 125 { 117 126 ID_AHA_29320, ··· 133 128 ahd_aic7902_setup 134 129 }, 135 130 { 136 - ID_AHA_29320LP, 137 - ID_ALL_MASK, 138 - "Adaptec 29320LP Ultra320 SCSI adapter", 139 - ahd_aic7901A_setup 140 - }, 141 - { 142 131 ID_AHA_39320, 143 132 ID_ALL_MASK, 144 133 "Adaptec 39320 Ultra320 SCSI adapter", ··· 142 143 ID_AHA_39320_B, 143 144 ID_ALL_MASK, 144 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", 145 152 ahd_aic7902_setup 146 153 }, 147 154 { ··· 673 668 * Now set the termination based on what we found. 674 669 */ 675 670 sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN; 671 + ahd->flags &= ~AHD_TERM_ENB_A; 676 672 if ((termctl & FLX_TERMCTL_ENPRILOW) != 0) { 677 673 ahd->flags |= AHD_TERM_ENB_A; 678 674 sxfrctl1 |= STPWEN;
+3 -2
drivers/scsi/aic7xxx/aic79xx_pci.h
··· 53 53 #define ID_AHA_29320ALP 0x8017900500449005ull 54 54 55 55 #define ID_AIC7901A 0x801E9005FFFF9005ull 56 - #define ID_AHA_29320 0x8012900500429005ull 57 - #define ID_AHA_29320B 0x8013900500439005ull 58 56 #define ID_AHA_29320LP 0x8014900500449005ull 59 57 60 58 #define ID_AIC7902 0x801F9005FFFF9005ull 61 59 #define ID_AIC7902_B 0x801D9005FFFF9005ull 62 60 #define ID_AHA_39320 0x8010900500409005ull 61 + #define ID_AHA_29320 0x8012900500429005ull 62 + #define ID_AHA_29320B 0x8013900500439005ull 63 63 #define ID_AHA_39320_B 0x8015900500409005ull 64 + #define ID_AHA_39320_B_DELL 0x8015900501681028ull 64 65 #define ID_AHA_39320A 0x8016900500409005ull 65 66 #define ID_AHA_39320D 0x8011900500419005ull 66 67 #define ID_AHA_39320D_B 0x801C900500419005ull
+352 -324
drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
··· 2 2 * DO NOT EDIT - This file is automatically generated 3 3 * from the following source files: 4 4 * 5 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#94 $ 6 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $ 5 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $ 6 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $ 7 7 */ 8 8 typedef int (ahd_reg_print_t)(u_int, u_int *, u_int); 9 9 typedef struct ahd_reg_parse_entry { ··· 83 83 #endif 84 84 85 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 86 ahd_reg_print_t ahd_seqintstat_print; 94 87 #else 95 88 #define ahd_seqintstat_print(regvalue, cur_col, wrap) \ 96 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 97 #endif 98 98 99 99 #if AIC_DEBUG_REGISTERS ··· 412 412 #endif 413 413 414 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 415 ahd_reg_print_t ahd_dlcount_print; 423 416 #else 424 417 #define ahd_dlcount_print(regvalue, cur_col, wrap) \ 425 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 426 #endif 427 427 428 428 #if AIC_DEBUG_REGISTERS ··· 517 517 #endif 518 518 519 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 520 ahd_reg_print_t ahd_optionmode_print; 528 521 #else 529 522 #define ahd_optionmode_print(regvalue, cur_col, wrap) \ ··· 524 531 #endif 525 532 526 533 #if AIC_DEBUG_REGISTERS 527 - ahd_reg_print_t ahd_sstat0_print; 534 + ahd_reg_print_t ahd_sblkctl_print; 528 535 #else 529 - #define ahd_sstat0_print(regvalue, cur_col, wrap) \ 530 - ahd_print_register(NULL, 0, "SSTAT0", 0x4b, regvalue, cur_col, wrap) 536 + #define ahd_sblkctl_print(regvalue, cur_col, wrap) \ 537 + ahd_print_register(NULL, 0, "SBLKCTL", 0x4a, regvalue, cur_col, wrap) 531 538 #endif 532 539 533 540 #if AIC_DEBUG_REGISTERS ··· 535 542 #else 536 543 #define ahd_clrsint0_print(regvalue, cur_col, wrap) \ 537 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) 538 552 #endif 539 553 540 554 #if AIC_DEBUG_REGISTERS ··· 573 573 #endif 574 574 575 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 576 ahd_reg_print_t ahd_simode2_print; 584 577 #else 585 578 #define ahd_simode2_print(regvalue, cur_col, wrap) \ 586 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 587 #endif 588 588 589 589 #if AIC_DEBUG_REGISTERS ··· 685 685 #endif 686 686 687 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 688 ahd_reg_print_t ahd_lqostat0_print; 696 689 #else 697 690 #define ahd_lqostat0_print(regvalue, cur_col, wrap) \ ··· 699 706 #endif 700 707 701 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 702 723 ahd_reg_print_t ahd_lqostat1_print; 703 724 #else 704 725 #define ahd_lqostat1_print(regvalue, cur_col, wrap) \ ··· 724 717 #else 725 718 #define ahd_clrlqoint1_print(regvalue, cur_col, wrap) \ 726 719 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 720 #endif 735 721 736 722 #if AIC_DEBUG_REGISTERS ··· 909 909 #endif 910 910 911 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 912 ahd_reg_print_t ahd_annexdat_print; 920 913 #else 921 914 #define ahd_annexdat_print(regvalue, cur_col, wrap) \ 922 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 923 #endif 924 924 925 925 #if AIC_DEBUG_REGISTERS ··· 1000 1000 #endif 1001 1001 1002 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 1003 ahd_reg_print_t ahd_unfairness_print; 1011 1004 #else 1012 1005 #define ahd_unfairness_print(regvalue, cur_col, wrap) \ 1013 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 1014 #endif 1015 1015 1016 1016 #if AIC_DEBUG_REGISTERS ··· 1056 1056 #endif 1057 1057 1058 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 1059 ahd_reg_print_t ahd_scbhaddr_print; 1067 1060 #else 1068 1061 #define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ ··· 1063 1070 #endif 1064 1071 1065 1072 #if AIC_DEBUG_REGISTERS 1066 - ahd_reg_print_t ahd_sghcnt_print; 1073 + ahd_reg_print_t ahd_sghaddr_print; 1067 1074 #else 1068 - #define ahd_sghcnt_print(regvalue, cur_col, wrap) \ 1069 - ahd_print_register(NULL, 0, "SGHCNT", 0x84, regvalue, cur_col, wrap) 1075 + #define ahd_sghaddr_print(regvalue, cur_col, wrap) \ 1076 + ahd_print_register(NULL, 0, "SGHADDR", 0x7c, regvalue, cur_col, wrap) 1070 1077 #endif 1071 1078 1072 1079 #if AIC_DEBUG_REGISTERS ··· 1074 1081 #else 1075 1082 #define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ 1076 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) 1077 1091 #endif 1078 1092 1079 1093 #if AIC_DEBUG_REGISTERS ··· 1154 1154 #endif 1155 1155 1156 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 1157 ahd_reg_print_t ahd_cmcrxmsg1_print; 1165 1158 #else 1166 1159 #define ahd_cmcrxmsg1_print(regvalue, cur_col, wrap) \ ··· 1161 1168 #endif 1162 1169 1163 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 1164 1178 ahd_reg_print_t ahd_dchrxmsg2_print; 1165 1179 #else 1166 1180 #define ahd_dchrxmsg2_print(regvalue, cur_col, wrap) \ 1167 1181 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 1182 #endif 1176 1183 1177 1184 #if AIC_DEBUG_REGISTERS ··· 1189 1196 #endif 1190 1197 1191 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 1192 1206 ahd_reg_print_t ahd_dchrxmsg3_print; 1193 1207 #else 1194 1208 #define ahd_dchrxmsg3_print(regvalue, cur_col, wrap) \ 1195 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) 1196 1217 #endif 1197 1218 1198 1219 #if AIC_DEBUG_REGISTERS ··· 1224 1217 #endif 1225 1218 1226 1219 #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 1220 ahd_reg_print_t ahd_ovlyseqbcnt_print; 1235 1221 #else 1236 1222 #define ahd_ovlyseqbcnt_print(regvalue, cur_col, wrap) \ 1237 1223 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 1224 #endif 1246 1225 1247 1226 #if AIC_DEBUG_REGISTERS ··· 1238 1245 #endif 1239 1246 1240 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 1241 1255 ahd_reg_print_t ahd_cmcspltstat0_print; 1242 1256 #else 1243 1257 #define ahd_cmcspltstat0_print(regvalue, cur_col, wrap) \ 1244 1258 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 1259 #endif 1253 1260 1254 1261 #if AIC_DEBUG_REGISTERS ··· 1259 1266 #endif 1260 1267 1261 1268 #if AIC_DEBUG_REGISTERS 1262 - ahd_reg_print_t ahd_dchspltstat1_print; 1269 + ahd_reg_print_t ahd_ovlyspltstat0_print; 1263 1270 #else 1264 - #define ahd_dchspltstat1_print(regvalue, cur_col, wrap) \ 1265 - ahd_print_register(NULL, 0, "DCHSPLTSTAT1", 0x97, regvalue, cur_col, wrap) 1271 + #define ahd_ovlyspltstat0_print(regvalue, cur_col, wrap) \ 1272 + ahd_print_register(NULL, 0, "OVLYSPLTSTAT0", 0x96, regvalue, cur_col, wrap) 1266 1273 #endif 1267 1274 1268 1275 #if AIC_DEBUG_REGISTERS ··· 1277 1284 #else 1278 1285 #define ahd_ovlyspltstat1_print(regvalue, cur_col, wrap) \ 1279 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) 1280 1294 #endif 1281 1295 1282 1296 #if AIC_DEBUG_REGISTERS ··· 1378 1378 #endif 1379 1379 1380 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 1381 ahd_reg_print_t ahd_sgspltstat1_print; 1389 1382 #else 1390 1383 #define ahd_sgspltstat1_print(regvalue, cur_col, wrap) \ 1391 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 1392 #endif 1393 1393 1394 1394 #if AIC_DEBUG_REGISTERS ··· 1504 1504 #endif 1505 1505 1506 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 1507 ahd_reg_print_t ahd_ccscbadr_bk_print; 1515 1508 #else 1516 1509 #define ahd_ccscbadr_bk_print(regvalue, cur_col, wrap) \ 1517 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 1518 #endif 1519 1519 1520 1520 #if AIC_DEBUG_REGISTERS ··· 1525 1525 #endif 1526 1526 1527 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 1528 ahd_reg_print_t ahd_ccscbctl_print; 1536 1529 #else 1537 1530 #define ahd_ccscbctl_print(regvalue, cur_col, wrap) \ 1538 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 1539 #endif 1540 1540 1541 1541 #if AIC_DEBUG_REGISTERS ··· 1707 1707 #endif 1708 1708 1709 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 1710 ahd_reg_print_t ahd_rcvrbiascalc_print; 1718 1711 #else 1719 1712 #define ahd_rcvrbiascalc_print(regvalue, cur_col, wrap) \ ··· 1714 1721 #endif 1715 1722 1716 1723 #if AIC_DEBUG_REGISTERS 1717 - ahd_reg_print_t ahd_dfbkptr_print; 1724 + ahd_reg_print_t ahd_dfptrs_print; 1718 1725 #else 1719 - #define ahd_dfbkptr_print(regvalue, cur_col, wrap) \ 1720 - ahd_print_register(NULL, 0, "DFBKPTR", 0xc9, regvalue, cur_col, wrap) 1726 + #define ahd_dfptrs_print(regvalue, cur_col, wrap) \ 1727 + ahd_print_register(NULL, 0, "DFPTRS", 0xc8, regvalue, cur_col, wrap) 1721 1728 #endif 1722 1729 1723 1730 #if AIC_DEBUG_REGISTERS ··· 1725 1732 #else 1726 1733 #define ahd_skewcalc_print(regvalue, cur_col, wrap) \ 1727 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) 1728 1742 #endif 1729 1743 1730 1744 #if AIC_DEBUG_REGISTERS ··· 1826 1826 #endif 1827 1827 1828 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 1829 ahd_reg_print_t ahd_brkaddr0_print; 1837 1830 #else 1838 1831 #define ahd_brkaddr0_print(regvalue, cur_col, wrap) \ 1839 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 1840 #endif 1841 1841 1842 1842 #if AIC_DEBUG_REGISTERS ··· 1889 1889 #endif 1890 1890 1891 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 1892 ahd_reg_print_t ahd_intvec1_addr_print; 1900 1893 #else 1901 1894 #define ahd_intvec1_addr_print(regvalue, cur_col, wrap) \ ··· 1896 1903 #endif 1897 1904 1898 1905 #if AIC_DEBUG_REGISTERS 1899 - ahd_reg_print_t ahd_intvec2_addr_print; 1906 + ahd_reg_print_t ahd_curaddr_print; 1900 1907 #else 1901 - #define ahd_intvec2_addr_print(regvalue, cur_col, wrap) \ 1902 - ahd_print_register(NULL, 0, "INTVEC2_ADDR", 0xf6, regvalue, cur_col, wrap) 1908 + #define ahd_curaddr_print(regvalue, cur_col, wrap) \ 1909 + ahd_print_register(NULL, 0, "CURADDR", 0xf4, regvalue, cur_col, wrap) 1903 1910 #endif 1904 1911 1905 1912 #if AIC_DEBUG_REGISTERS ··· 1907 1914 #else 1908 1915 #define ahd_lastaddr_print(regvalue, cur_col, wrap) \ 1909 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) 1910 1924 #endif 1911 1925 1912 1926 #if AIC_DEBUG_REGISTERS ··· 1994 1994 #endif 1995 1995 1996 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 1997 2011 ahd_reg_print_t ahd_qfreeze_count_print; 1998 2012 #else 1999 2013 #define ahd_qfreeze_count_print(regvalue, cur_col, wrap) \ 2000 - ahd_print_register(NULL, 0, "QFREEZE_COUNT", 0x12e, 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) 2001 2022 #endif 2002 2023 2003 2024 #if AIC_DEBUG_REGISTERS 2004 2025 ahd_reg_print_t ahd_saved_mode_print; 2005 2026 #else 2006 2027 #define ahd_saved_mode_print(regvalue, cur_col, wrap) \ 2007 - ahd_print_register(NULL, 0, "SAVED_MODE", 0x130, regvalue, cur_col, wrap) 2028 + ahd_print_register(NULL, 0, "SAVED_MODE", 0x136, regvalue, cur_col, wrap) 2008 2029 #endif 2009 2030 2010 2031 #if AIC_DEBUG_REGISTERS 2011 2032 ahd_reg_print_t ahd_msg_out_print; 2012 2033 #else 2013 2034 #define ahd_msg_out_print(regvalue, cur_col, wrap) \ 2014 - ahd_print_register(NULL, 0, "MSG_OUT", 0x131, regvalue, cur_col, wrap) 2035 + ahd_print_register(NULL, 0, "MSG_OUT", 0x137, regvalue, cur_col, wrap) 2015 2036 #endif 2016 2037 2017 2038 #if AIC_DEBUG_REGISTERS 2018 2039 ahd_reg_print_t ahd_dmaparams_print; 2019 2040 #else 2020 2041 #define ahd_dmaparams_print(regvalue, cur_col, wrap) \ 2021 - ahd_print_register(NULL, 0, "DMAPARAMS", 0x132, regvalue, cur_col, wrap) 2042 + ahd_print_register(NULL, 0, "DMAPARAMS", 0x138, regvalue, cur_col, wrap) 2022 2043 #endif 2023 2044 2024 2045 #if AIC_DEBUG_REGISTERS 2025 2046 ahd_reg_print_t ahd_seq_flags_print; 2026 2047 #else 2027 2048 #define ahd_seq_flags_print(regvalue, cur_col, wrap) \ 2028 - ahd_print_register(NULL, 0, "SEQ_FLAGS", 0x133, regvalue, cur_col, wrap) 2049 + ahd_print_register(NULL, 0, "SEQ_FLAGS", 0x139, regvalue, cur_col, wrap) 2029 2050 #endif 2030 2051 2031 2052 #if AIC_DEBUG_REGISTERS 2032 2053 ahd_reg_print_t ahd_saved_scsiid_print; 2033 2054 #else 2034 2055 #define ahd_saved_scsiid_print(regvalue, cur_col, wrap) \ 2035 - ahd_print_register(NULL, 0, "SAVED_SCSIID", 0x134, regvalue, cur_col, wrap) 2056 + ahd_print_register(NULL, 0, "SAVED_SCSIID", 0x13a, regvalue, cur_col, wrap) 2036 2057 #endif 2037 2058 2038 2059 #if AIC_DEBUG_REGISTERS 2039 2060 ahd_reg_print_t ahd_saved_lun_print; 2040 2061 #else 2041 2062 #define ahd_saved_lun_print(regvalue, cur_col, wrap) \ 2042 - ahd_print_register(NULL, 0, "SAVED_LUN", 0x135, regvalue, cur_col, wrap) 2063 + ahd_print_register(NULL, 0, "SAVED_LUN", 0x13b, regvalue, cur_col, wrap) 2043 2064 #endif 2044 2065 2045 2066 #if AIC_DEBUG_REGISTERS 2046 2067 ahd_reg_print_t ahd_lastphase_print; 2047 2068 #else 2048 2069 #define ahd_lastphase_print(regvalue, cur_col, wrap) \ 2049 - ahd_print_register(NULL, 0, "LASTPHASE", 0x136, regvalue, cur_col, wrap) 2070 + ahd_print_register(NULL, 0, "LASTPHASE", 0x13c, regvalue, cur_col, wrap) 2050 2071 #endif 2051 2072 2052 2073 #if AIC_DEBUG_REGISTERS 2053 2074 ahd_reg_print_t ahd_qoutfifo_entry_valid_tag_print; 2054 2075 #else 2055 2076 #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) 2077 + ahd_print_register(NULL, 0, "QOUTFIFO_ENTRY_VALID_TAG", 0x13d, regvalue, cur_col, wrap) 2071 2078 #endif 2072 2079 2073 2080 #if AIC_DEBUG_REGISTERS 2074 2081 ahd_reg_print_t ahd_kernel_tqinpos_print; 2075 2082 #else 2076 2083 #define ahd_kernel_tqinpos_print(regvalue, cur_col, wrap) \ 2077 - ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 0x140, regvalue, cur_col, wrap) 2084 + ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 0x13e, regvalue, cur_col, wrap) 2078 2085 #endif 2079 2086 2080 2087 #if AIC_DEBUG_REGISTERS 2081 2088 ahd_reg_print_t ahd_tqinpos_print; 2082 2089 #else 2083 2090 #define ahd_tqinpos_print(regvalue, cur_col, wrap) \ 2084 - ahd_print_register(NULL, 0, "TQINPOS", 0x141, 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) 2085 2106 #endif 2086 2107 2087 2108 #if AIC_DEBUG_REGISTERS 2088 2109 ahd_reg_print_t ahd_arg_1_print; 2089 2110 #else 2090 2111 #define ahd_arg_1_print(regvalue, cur_col, wrap) \ 2091 - ahd_print_register(NULL, 0, "ARG_1", 0x142, regvalue, cur_col, wrap) 2112 + ahd_print_register(NULL, 0, "ARG_1", 0x148, regvalue, cur_col, wrap) 2092 2113 #endif 2093 2114 2094 2115 #if AIC_DEBUG_REGISTERS 2095 2116 ahd_reg_print_t ahd_arg_2_print; 2096 2117 #else 2097 2118 #define ahd_arg_2_print(regvalue, cur_col, wrap) \ 2098 - ahd_print_register(NULL, 0, "ARG_2", 0x143, regvalue, cur_col, wrap) 2119 + ahd_print_register(NULL, 0, "ARG_2", 0x149, regvalue, cur_col, wrap) 2099 2120 #endif 2100 2121 2101 2122 #if AIC_DEBUG_REGISTERS 2102 2123 ahd_reg_print_t ahd_last_msg_print; 2103 2124 #else 2104 2125 #define ahd_last_msg_print(regvalue, cur_col, wrap) \ 2105 - ahd_print_register(NULL, 0, "LAST_MSG", 0x144, regvalue, cur_col, wrap) 2126 + ahd_print_register(NULL, 0, "LAST_MSG", 0x14a, regvalue, cur_col, wrap) 2106 2127 #endif 2107 2128 2108 2129 #if AIC_DEBUG_REGISTERS 2109 2130 ahd_reg_print_t ahd_scsiseq_template_print; 2110 2131 #else 2111 2132 #define ahd_scsiseq_template_print(regvalue, cur_col, wrap) \ 2112 - ahd_print_register(NULL, 0, "SCSISEQ_TEMPLATE", 0x145, regvalue, cur_col, wrap) 2133 + ahd_print_register(NULL, 0, "SCSISEQ_TEMPLATE", 0x14b, regvalue, cur_col, wrap) 2113 2134 #endif 2114 2135 2115 2136 #if AIC_DEBUG_REGISTERS 2116 2137 ahd_reg_print_t ahd_initiator_tag_print; 2117 2138 #else 2118 2139 #define ahd_initiator_tag_print(regvalue, cur_col, wrap) \ 2119 - ahd_print_register(NULL, 0, "INITIATOR_TAG", 0x146, regvalue, cur_col, wrap) 2140 + ahd_print_register(NULL, 0, "INITIATOR_TAG", 0x14c, regvalue, cur_col, wrap) 2120 2141 #endif 2121 2142 2122 2143 #if AIC_DEBUG_REGISTERS 2123 2144 ahd_reg_print_t ahd_seq_flags2_print; 2124 2145 #else 2125 2146 #define ahd_seq_flags2_print(regvalue, cur_col, wrap) \ 2126 - ahd_print_register(NULL, 0, "SEQ_FLAGS2", 0x147, regvalue, cur_col, wrap) 2147 + ahd_print_register(NULL, 0, "SEQ_FLAGS2", 0x14d, regvalue, cur_col, wrap) 2127 2148 #endif 2128 2149 2129 2150 #if AIC_DEBUG_REGISTERS 2130 2151 ahd_reg_print_t ahd_allocfifo_scbptr_print; 2131 2152 #else 2132 2153 #define ahd_allocfifo_scbptr_print(regvalue, cur_col, wrap) \ 2133 - ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 0x148, regvalue, cur_col, wrap) 2154 + ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 0x14e, regvalue, cur_col, wrap) 2134 2155 #endif 2135 2156 2136 2157 #if AIC_DEBUG_REGISTERS 2137 2158 ahd_reg_print_t ahd_int_coalescing_timer_print; 2138 2159 #else 2139 2160 #define ahd_int_coalescing_timer_print(regvalue, cur_col, wrap) \ 2140 - ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 0x14a, regvalue, cur_col, wrap) 2161 + ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 0x150, regvalue, cur_col, wrap) 2141 2162 #endif 2142 2163 2143 2164 #if AIC_DEBUG_REGISTERS 2144 2165 ahd_reg_print_t ahd_int_coalescing_maxcmds_print; 2145 2166 #else 2146 2167 #define ahd_int_coalescing_maxcmds_print(regvalue, cur_col, wrap) \ 2147 - ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 0x14c, regvalue, cur_col, wrap) 2168 + ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 0x152, regvalue, cur_col, wrap) 2148 2169 #endif 2149 2170 2150 2171 #if AIC_DEBUG_REGISTERS 2151 2172 ahd_reg_print_t ahd_int_coalescing_mincmds_print; 2152 2173 #else 2153 2174 #define ahd_int_coalescing_mincmds_print(regvalue, cur_col, wrap) \ 2154 - ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 0x14d, regvalue, cur_col, wrap) 2175 + ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 0x153, regvalue, cur_col, wrap) 2155 2176 #endif 2156 2177 2157 2178 #if AIC_DEBUG_REGISTERS 2158 2179 ahd_reg_print_t ahd_cmds_pending_print; 2159 2180 #else 2160 2181 #define ahd_cmds_pending_print(regvalue, cur_col, wrap) \ 2161 - ahd_print_register(NULL, 0, "CMDS_PENDING", 0x14e, regvalue, cur_col, wrap) 2182 + ahd_print_register(NULL, 0, "CMDS_PENDING", 0x154, regvalue, cur_col, wrap) 2162 2183 #endif 2163 2184 2164 2185 #if AIC_DEBUG_REGISTERS 2165 2186 ahd_reg_print_t ahd_int_coalescing_cmdcount_print; 2166 2187 #else 2167 2188 #define ahd_int_coalescing_cmdcount_print(regvalue, cur_col, wrap) \ 2168 - ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 0x150, regvalue, cur_col, wrap) 2189 + ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 0x156, regvalue, cur_col, wrap) 2169 2190 #endif 2170 2191 2171 2192 #if AIC_DEBUG_REGISTERS 2172 2193 ahd_reg_print_t ahd_local_hs_mailbox_print; 2173 2194 #else 2174 2195 #define ahd_local_hs_mailbox_print(regvalue, cur_col, wrap) \ 2175 - ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 0x151, regvalue, cur_col, wrap) 2196 + ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 0x157, regvalue, cur_col, wrap) 2176 2197 #endif 2177 2198 2178 2199 #if AIC_DEBUG_REGISTERS 2179 2200 ahd_reg_print_t ahd_cmdsize_table_print; 2180 2201 #else 2181 2202 #define ahd_cmdsize_table_print(regvalue, cur_col, wrap) \ 2182 - ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 0x152, regvalue, cur_col, wrap) 2203 + ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 0x158, regvalue, cur_col, wrap) 2183 2204 #endif 2184 2205 2185 2206 #if AIC_DEBUG_REGISTERS ··· 2455 2434 #define HOST_TQINPOS 0x80 2456 2435 #define ENINT_COALESCE 0x40 2457 2436 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 2437 #define SEQINTSTAT 0x0c 2466 2438 #define SEQ_SWTMRTO 0x10 2467 2439 #define SEQ_SEQINT 0x08 2468 2440 #define SEQ_SCSIINT 0x04 2469 2441 #define SEQ_PCIINT 0x02 2470 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 2471 2450 2472 2451 #define SWTIMER 0x0e 2473 2452 ··· 2644 2623 #define BIOSCANCELEN 0x10 2645 2624 #define SPIOEN 0x08 2646 2625 2647 - #define BUSINITID 0x3c 2648 - 2649 2626 #define DLCOUNT 0x3c 2627 + 2628 + #define BUSINITID 0x3c 2650 2629 2651 2630 #define SXFRCTL1 0x3d 2652 2631 #define BITBUCKET 0x80 ··· 2714 2693 #define SELID_MASK 0xf0 2715 2694 #define ONEBIT 0x08 2716 2695 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 2696 #define OPTIONMODE 0x4a 2725 2697 #define OPTIONMODE_DEFAULTS 0x02 2726 2698 #define BIOSCANCTL 0x80 ··· 2722 2708 #define BUSFREEREV 0x10 2723 2709 #define ENDGFORMCHK 0x04 2724 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 2725 2727 2726 2728 #define SSTAT0 0x4b 2727 2729 #define TARGET 0x80 ··· 2748 2718 #define OVERRUN 0x04 2749 2719 #define SPIORDY 0x02 2750 2720 #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 2721 2761 2722 #define SIMODE0 0x4b 2762 2723 #define ENSELDO 0x40 ··· 2789 2768 #define BUSFREE_DFF0 0x80 2790 2769 #define BUSFREE_LQO 0x40 2791 2770 2771 + #define SIMODE2 0x4d 2772 + #define ENWIDE_RES 0x04 2773 + #define ENSDONE 0x02 2774 + #define ENDMADONE 0x01 2775 + 2792 2776 #define CLRSINT2 0x4d 2793 2777 #define CLRNONPACKREQ 0x20 2794 2778 #define CLRWIDE_RES 0x04 2795 2779 #define CLRSDONE 0x02 2796 2780 #define CLRDMADONE 0x01 2797 - 2798 - #define SIMODE2 0x4d 2799 - #define ENWIDE_RES 0x04 2800 - #define ENSDONE 0x02 2801 - #define ENDMADONE 0x01 2802 2781 2803 2782 #define PERRDIAG 0x4e 2804 2783 #define HIZERO 0x80 ··· 2892 2871 #define CLRNTRAMPERR 0x02 2893 2872 #define CLROSRAMPERR 0x01 2894 2873 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 2874 #define LQOSTAT0 0x54 2903 2875 #define LQOTARGSCBPERR 0x10 2904 2876 #define LQOSTOPT2 0x08 ··· 2906 2892 #define CLRLQOATNPKT 0x02 2907 2893 #define CLRLQOTCRC 0x01 2908 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 2909 #define LQOSTAT1 0x55 2910 2910 #define LQOINITSCBPERR 0x10 2911 2911 #define LQOSTOPI2 0x08 ··· 2933 2905 #define CLRLQOBADQAS 0x04 2934 2906 #define CLRLQOBUSFREE 0x02 2935 2907 #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 2908 2944 2909 #define LQOSTAT2 0x56 2945 2910 #define LQOPKT 0xe0 ··· 3049 3028 3050 3029 #define ANNEXCOL 0x65 3051 3030 3031 + #define ANNEXDAT 0x66 3032 + 3052 3033 #define SCSCHKN 0x66 3053 3034 #define STSELSKIDDIS 0x40 3054 3035 #define CURRFIFODEF 0x20 ··· 3059 3036 #define DFFACTCLR 0x04 3060 3037 #define SHVALIDSTDIS 0x02 3061 3038 #define LSTSGCLRDIS 0x01 3062 - 3063 - #define ANNEXDAT 0x66 3064 3039 3065 3040 #define IOWNID 0x67 3066 3041 ··· 3092 3071 #define PLL_CNTCLR 0x40 3093 3072 #define PLL_RST 0x01 3094 3073 3095 - #define PLL400CNT0 0x6e 3096 - 3097 3074 #define UNFAIRNESS 0x6e 3075 + 3076 + #define PLL400CNT0 0x6e 3098 3077 3099 3078 #define HADDR 0x70 3100 3079 ··· 3109 3088 3110 3089 #define HODMAEN 0x7a 3111 3090 3112 - #define SGHADDR 0x7c 3113 - 3114 3091 #define SCBHADDR 0x7c 3115 3092 3116 - #define SGHCNT 0x84 3093 + #define SGHADDR 0x7c 3117 3094 3118 3095 #define SCBHCNT 0x84 3096 + 3097 + #define SGHCNT 0x84 3119 3098 3120 3099 #define DFF_THRSH 0x88 3121 3100 #define WR_DFTHRSH 0x70 ··· 3134 3113 #define RD_DFTHRSH_63 0x03 3135 3114 #define RD_DFTHRSH_50 0x02 3136 3115 #define RD_DFTHRSH_25 0x01 3137 - #define WR_DFTHRSH_MIN 0x00 3138 3116 #define RD_DFTHRSH_MIN 0x00 3117 + #define WR_DFTHRSH_MIN 0x00 3139 3118 3140 3119 #define ROMADDR 0x8a 3141 3120 ··· 3171 3150 #define DCH1NSEN 0x02 3172 3151 #define DCH0NSEN 0x01 3173 3152 3174 - #define DCHRXMSG1 0x91 3175 - 3176 3153 #define CMCRXMSG1 0x91 3177 3154 3178 - #define DCHRXMSG2 0x92 3155 + #define DCHRXMSG1 0x91 3179 3156 3180 - #define OVLYRXMSG2 0x92 3157 + #define DCHRXMSG2 0x92 3181 3158 3182 3159 #define CMCRXMSG2 0x92 3183 3160 3184 3161 #define OST 0x92 3185 3162 3163 + #define OVLYRXMSG2 0x92 3164 + 3186 3165 #define DCHRXMSG3 0x93 3166 + 3167 + #define OVLYRXMSG3 0x93 3187 3168 3188 3169 #define CMCRXMSG3 0x93 3189 3170 ··· 3198 3175 #define TSCSERREN 0x02 3199 3176 #define CMPABCDIS 0x01 3200 3177 3201 - #define OVLYRXMSG3 0x93 3202 - 3203 3178 #define OVLYSEQBCNT 0x94 3204 - 3205 - #define CMCSEQBCNT 0x94 3206 3179 3207 3180 #define DCHSEQBCNT 0x94 3208 3181 3209 - #define CMCSPLTSTAT0 0x96 3182 + #define CMCSEQBCNT 0x94 3210 3183 3211 - #define OVLYSPLTSTAT0 0x96 3184 + #define CMCSPLTSTAT0 0x96 3212 3185 3213 3186 #define DCHSPLTSTAT0 0x96 3214 3187 3215 - #define DCHSPLTSTAT1 0x97 3188 + #define OVLYSPLTSTAT0 0x96 3216 3189 3217 3190 #define CMCSPLTSTAT1 0x97 3218 3191 3219 3192 #define OVLYSPLTSTAT1 0x97 3193 + 3194 + #define DCHSPLTSTAT1 0x97 3220 3195 3221 3196 #define SGRXMSG0 0x98 3222 3197 #define CDNUM 0xf8 ··· 3265 3244 #define RXSCEMSG 0x02 3266 3245 #define RXSPLTRSP 0x01 3267 3246 3247 + #define SGSPLTSTAT1 0x9f 3248 + #define RXDATABUCKET 0x01 3249 + 3268 3250 #define SFUNCT 0x9f 3269 3251 #define TEST_GROUP 0xf0 3270 3252 #define TEST_NUM 0x0f 3271 - 3272 - #define SGSPLTSTAT1 0x9f 3273 - #define RXDATABUCKET 0x01 3274 3253 3275 3254 #define DF0PCISTAT 0xa0 3276 3255 ··· 3320 3299 3321 3300 #define CCSGADDR 0xac 3322 3301 3323 - #define CCSCBADDR 0xac 3324 - 3325 3302 #define CCSCBADR_BK 0xac 3303 + 3304 + #define CCSCBADDR 0xac 3326 3305 3327 3306 #define CMC_RAMBIST 0xad 3328 3307 #define SG_ELEMENT_SIZE 0x80 ··· 3332 3311 #define CMC_BUFFER_BIST_FAIL 0x02 3333 3312 #define CMC_BUFFER_BIST_EN 0x01 3334 3313 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 3314 #define CCSCBCTL 0xad 3344 3315 #define CCSCBDONE 0x80 3345 3316 #define ARRDONE 0x40 ··· 3339 3326 #define CCSCBEN 0x08 3340 3327 #define CCSCBDIR 0x04 3341 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 3342 3337 3343 3338 #define CCSGRAM 0xb0 3344 3339 ··· 3377 3356 #define SEEDAT 0xbc 3378 3357 3379 3358 #define SEECTL 0xbe 3380 - #define SEEOP_EWEN 0x40 3381 3359 #define SEEOP_WALL 0x40 3360 + #define SEEOP_EWEN 0x40 3382 3361 #define SEEOP_EWDS 0x40 3383 3362 #define SEEOPCODE 0x70 3384 3363 #define SEERST 0x02 ··· 3435 3414 3436 3415 #define WRTBIASCALC 0xc7 3437 3416 3438 - #define DFPTRS 0xc8 3439 - 3440 3417 #define RCVRBIASCALC 0xc8 3441 3418 3442 - #define DFBKPTR 0xc9 3419 + #define DFPTRS 0xc8 3443 3420 3444 3421 #define SKEWCALC 0xc9 3422 + 3423 + #define DFBKPTR 0xc9 3445 3424 3446 3425 #define DFDBCTL 0xcb 3447 3426 #define DFF_CIO_WR_RDY 0x20 ··· 3496 3475 3497 3476 #define DINDEX 0xe4 3498 3477 3478 + #define BRKADDR0 0xe6 3479 + 3499 3480 #define BRKADDR1 0xe6 3500 3481 #define BRKDIS 0x80 3501 - 3502 - #define BRKADDR0 0xe6 3503 3482 3504 3483 #define ALLONES 0xe8 3505 3484 ··· 3515 3494 3516 3495 #define STACK 0xf2 3517 3496 3518 - #define CURADDR 0xf4 3519 - 3520 3497 #define INTVEC1_ADDR 0xf4 3521 3498 3522 - #define INTVEC2_ADDR 0xf6 3499 + #define CURADDR 0xf4 3523 3500 3524 3501 #define LASTADDR 0xf6 3502 + 3503 + #define INTVEC2_ADDR 0xf6 3525 3504 3526 3505 #define LONGJMP_ADDR 0xf8 3527 3506 ··· 3545 3524 3546 3525 #define COMPLETE_DMA_SCB_HEAD 0x12c 3547 3526 3548 - #define QFREEZE_COUNT 0x12e 3527 + #define COMPLETE_DMA_SCB_TAIL 0x12e 3549 3528 3550 - #define SAVED_MODE 0x130 3529 + #define COMPLETE_ON_QFREEZE_HEAD 0x130 3551 3530 3552 - #define MSG_OUT 0x131 3531 + #define QFREEZE_COUNT 0x132 3553 3532 3554 - #define DMAPARAMS 0x132 3533 + #define KERNEL_QFREEZE_COUNT 0x134 3534 + 3535 + #define SAVED_MODE 0x136 3536 + 3537 + #define MSG_OUT 0x137 3538 + 3539 + #define DMAPARAMS 0x138 3555 3540 #define PRELOADEN 0x80 3556 3541 #define WIDEODD 0x40 3557 3542 #define SCSIEN 0x20 3558 3543 #define SDMAEN 0x10 3559 3544 #define SDMAENACK 0x10 3560 - #define HDMAENACK 0x08 3561 3545 #define HDMAEN 0x08 3546 + #define HDMAENACK 0x08 3562 3547 #define DIRECTION 0x04 3563 3548 #define FIFOFLUSH 0x02 3564 3549 #define FIFORESET 0x01 3565 3550 3566 - #define SEQ_FLAGS 0x133 3551 + #define SEQ_FLAGS 0x139 3567 3552 #define NOT_IDENTIFIED 0x80 3568 3553 #define NO_CDB_SENT 0x40 3569 3554 #define TARGET_CMD_IS_TAGGED 0x40 ··· 3580 3553 #define SPHASE_PENDING 0x02 3581 3554 #define NO_DISCONNECT 0x01 3582 3555 3583 - #define SAVED_SCSIID 0x134 3556 + #define SAVED_SCSIID 0x13a 3584 3557 3585 - #define SAVED_LUN 0x135 3558 + #define SAVED_LUN 0x13b 3586 3559 3587 - #define LASTPHASE 0x136 3560 + #define LASTPHASE 0x13c 3588 3561 #define PHASE_MASK 0xe0 3589 3562 #define CDI 0x80 3590 3563 #define IOI 0x40 ··· 3599 3572 #define P_DATAOUT_DT 0x20 3600 3573 #define P_DATAOUT 0x00 3601 3574 3602 - #define QOUTFIFO_ENTRY_VALID_TAG 0x137 3575 + #define QOUTFIFO_ENTRY_VALID_TAG 0x13d 3603 3576 3604 - #define SHARED_DATA_ADDR 0x138 3577 + #define KERNEL_TQINPOS 0x13e 3605 3578 3606 - #define QOUTFIFO_NEXT_ADDR 0x13c 3579 + #define TQINPOS 0x13f 3607 3580 3608 - #define KERNEL_TQINPOS 0x140 3581 + #define SHARED_DATA_ADDR 0x140 3609 3582 3610 - #define TQINPOS 0x141 3583 + #define QOUTFIFO_NEXT_ADDR 0x144 3611 3584 3612 - #define ARG_1 0x142 3613 - #define RETURN_1 0x142 3585 + #define ARG_1 0x148 3586 + #define RETURN_1 0x148 3614 3587 #define SEND_MSG 0x80 3615 3588 #define SEND_SENSE 0x40 3616 3589 #define SEND_REJ 0x20 ··· 3620 3593 #define CONT_MSG_LOOP_READ 0x03 3621 3594 #define CONT_MSG_LOOP_TARG 0x02 3622 3595 3623 - #define ARG_2 0x143 3624 - #define RETURN_2 0x143 3596 + #define ARG_2 0x149 3597 + #define RETURN_2 0x149 3625 3598 3626 - #define LAST_MSG 0x144 3599 + #define LAST_MSG 0x14a 3627 3600 3628 - #define SCSISEQ_TEMPLATE 0x145 3601 + #define SCSISEQ_TEMPLATE 0x14b 3629 3602 #define MANUALCTL 0x40 3630 3603 #define ENSELI 0x20 3631 3604 #define ENRSELI 0x10 ··· 3633 3606 #define ENAUTOATNP 0x02 3634 3607 #define ALTSTIM 0x01 3635 3608 3636 - #define INITIATOR_TAG 0x146 3609 + #define INITIATOR_TAG 0x14c 3637 3610 3638 - #define SEQ_FLAGS2 0x147 3611 + #define SEQ_FLAGS2 0x14d 3639 3612 #define SELECTOUT_QFROZEN 0x04 3640 3613 #define TARGET_MSG_PENDING 0x02 3641 3614 3642 - #define ALLOCFIFO_SCBPTR 0x148 3615 + #define ALLOCFIFO_SCBPTR 0x14e 3643 3616 3644 - #define INT_COALESCING_TIMER 0x14a 3617 + #define INT_COALESCING_TIMER 0x150 3645 3618 3646 - #define INT_COALESCING_MAXCMDS 0x14c 3619 + #define INT_COALESCING_MAXCMDS 0x152 3647 3620 3648 - #define INT_COALESCING_MINCMDS 0x14d 3621 + #define INT_COALESCING_MINCMDS 0x153 3649 3622 3650 - #define CMDS_PENDING 0x14e 3623 + #define CMDS_PENDING 0x154 3651 3624 3652 - #define INT_COALESCING_CMDCOUNT 0x150 3625 + #define INT_COALESCING_CMDCOUNT 0x156 3653 3626 3654 - #define LOCAL_HS_MAILBOX 0x151 3627 + #define LOCAL_HS_MAILBOX 0x157 3655 3628 3656 - #define CMDSIZE_TABLE 0x152 3629 + #define CMDSIZE_TABLE 0x158 3657 3630 3658 3631 #define SCB_BASE 0x180 3659 3632 ··· 3728 3701 #define SCB_DISCONNECTED_LISTS 0x1b8 3729 3702 3730 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 3731 3714 #define AHD_TIMER_US_PER_TICK 0x19 3732 3715 #define SCB_TRANSFER_SIZE_FULL_LUN 0x38 3733 3716 #define STATUS_QUEUE_FULL 0x28 ··· 3761 3724 #define B_CURRFIFO_0 0x02 3762 3725 #define LUNLEN_SINGLE_LEVEL_LUN 0x0f 3763 3726 #define NVRAM_SCB_OFFSET 0x2c 3764 - #define AHD_TIMER_MAX_US 0x18ffe7 3765 - #define AHD_TIMER_MAX_TICKS 0xffff 3766 3727 #define STATUS_PKT_SENSE 0xff 3767 3728 #define CMD_GROUP_CODE_SHIFT 0x05 3768 - #define AHD_SENSE_BUFSIZE 0x100 3769 3729 #define MAX_OFFSET_PACED_BUG 0x7f 3770 - #define BUS_8_BIT 0x00 3771 3730 #define STIMESEL_BUG_ADJ 0x08 3772 3731 #define STIMESEL_MIN 0x18 3773 3732 #define STIMESEL_SHIFT 0x03 3774 3733 #define CCSGRAM_MAXSEGS 0x10 3775 3734 #define INVALID_ADDR 0x80 3776 - #define TARGET_CMD_CMPLT 0xfe 3777 - #define SEEOP_WRAL_ADDR 0x40 3778 3735 #define SEEOP_ERAL_ADDR 0x80 3779 - #define AHD_AMPLITUDE_DEF 0x07 3780 3736 #define AHD_SLEWRATE_DEF_REVB 0x08 3781 - #define AHD_PRECOMP_CUTBACK_37 0x07 3782 3737 #define AHD_PRECOMP_CUTBACK_17 0x04 3783 - #define AHD_PRECOMP_SHIFT 0x00 3784 3738 #define AHD_PRECOMP_MASK 0x07 3785 - #define AHD_ANNEXCOL_PRECOMP_SLEW 0x04 3786 3739 #define SRC_MODE_SHIFT 0x00 3787 3740 #define PKT_OVERRUN_BUFSIZE 0x200 3788 3741 #define SCB_TRANSFER_SIZE_1BYTE_LUN 0x30 ··· 3788 3761 3789 3762 3790 3763 /* Downloaded Constant Definitions */ 3764 + #define CACHELINE_MASK 0x07 3791 3765 #define SCB_TRANSFER_SIZE 0x06 3792 3766 #define PKT_OVERRUN_BUFOFFSET 0x05 3793 3767 #define SG_SIZEOF 0x04 ··· 3796 3768 #define SG_PREFETCH_ALIGN_MASK 0x02 3797 3769 #define SG_PREFETCH_CNT_LIMIT 0x01 3798 3770 #define SG_PREFETCH_CNT 0x00 3799 - #define DOWNLOAD_CONST_COUNT 0x07 3771 + #define DOWNLOAD_CONST_COUNT 0x08 3800 3772 3801 3773 3802 3774 /* Exported Labels */ 3803 - #define LABEL_seq_isr 0x269 3804 - #define LABEL_timer_isr 0x265 3775 + #define LABEL_seq_isr 0x285 3776 + #define LABEL_timer_isr 0x281
+290 -269
drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped
··· 2 2 * DO NOT EDIT - This file is automatically generated 3 3 * from the following source files: 4 4 * 5 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#94 $ 6 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $ 5 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#118 $ 6 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#75 $ 7 7 */ 8 8 9 9 #include "aic79xx_osm.h" ··· 172 172 0x0b, regvalue, cur_col, wrap)); 173 173 } 174 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 175 static ahd_reg_parse_entry_t SEQINTSTAT_parse_table[] = { 191 176 { "SEQ_SPLTINT", 0x01, 0x01 }, 192 177 { "SEQ_PCIINT", 0x02, 0x02 }, ··· 184 199 ahd_seqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 185 200 { 186 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", 187 217 0x0c, regvalue, cur_col, wrap)); 188 218 } 189 219 ··· 670 670 } 671 671 672 672 int 673 - ahd_businitid_print(u_int regvalue, u_int *cur_col, u_int wrap) 673 + ahd_dlcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 674 674 { 675 - return (ahd_print_register(NULL, 0, "BUSINITID", 675 + return (ahd_print_register(NULL, 0, "DLCOUNT", 676 676 0x3c, regvalue, cur_col, wrap)); 677 677 } 678 678 679 679 int 680 - ahd_dlcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 680 + ahd_businitid_print(u_int regvalue, u_int *cur_col, u_int wrap) 681 681 { 682 - return (ahd_print_register(NULL, 0, "DLCOUNT", 682 + return (ahd_print_register(NULL, 0, "BUSINITID", 683 683 0x3c, regvalue, cur_col, wrap)); 684 684 } 685 685 ··· 859 859 0x49, regvalue, cur_col, wrap)); 860 860 } 861 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 862 static ahd_reg_parse_entry_t OPTIONMODE_parse_table[] = { 878 863 { "AUTO_MSGOUT_DE", 0x02, 0x02 }, 879 864 { "ENDGFORMCHK", 0x04, 0x04 }, ··· 876 891 0x4a, regvalue, cur_col, wrap)); 877 892 } 878 893 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 } 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 } 888 900 }; 889 901 890 902 int 891 - ahd_sstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 903 + ahd_sblkctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 892 904 { 893 - return (ahd_print_register(SSTAT0_parse_table, 8, "SSTAT0", 894 - 0x4b, regvalue, cur_col, wrap)); 905 + return (ahd_print_register(SBLKCTL_parse_table, 5, "SBLKCTL", 906 + 0x4a, regvalue, cur_col, wrap)); 895 907 } 896 908 897 909 static ahd_reg_parse_entry_t CLRSINT0_parse_table[] = { ··· 905 923 ahd_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) 906 924 { 907 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", 908 944 0x4b, regvalue, cur_col, wrap)); 909 945 } 910 946 ··· 998 998 0x4d, regvalue, cur_col, wrap)); 999 999 } 1000 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 + 1001 1014 static ahd_reg_parse_entry_t CLRSINT2_parse_table[] = { 1002 1015 { "CLRDMADONE", 0x01, 0x01 }, 1003 1016 { "CLRSDONE", 0x02, 0x02 }, ··· 1022 1009 ahd_clrsint2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1023 1010 { 1024 1011 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 1012 0x4d, regvalue, cur_col, wrap)); 1039 1013 } 1040 1014 ··· 1220 1220 0x53, regvalue, cur_col, wrap)); 1221 1221 } 1222 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 1223 static ahd_reg_parse_entry_t LQOSTAT0_parse_table[] = { 1239 1224 { "LQOTCRC", 0x01, 0x01 }, 1240 1225 { "LQOATNPKT", 0x02, 0x02 }, ··· 1250 1265 0x54, regvalue, cur_col, wrap)); 1251 1266 } 1252 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 + 1253 1298 static ahd_reg_parse_entry_t LQOSTAT1_parse_table[] = { 1254 1299 { "LQOPHACHGINPKT", 0x01, 0x01 }, 1255 1300 { "LQOBUSFREE", 0x02, 0x02 }, ··· 1307 1292 ahd_clrlqoint1_print(u_int regvalue, u_int *cur_col, u_int wrap) 1308 1293 { 1309 1294 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 1295 0x55, regvalue, cur_col, wrap)); 1326 1296 } 1327 1297 ··· 1594 1594 0x65, regvalue, cur_col, wrap)); 1595 1595 } 1596 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 + 1597 1604 static ahd_reg_parse_entry_t SCSCHKN_parse_table[] = { 1598 1605 { "LSTSGCLRDIS", 0x01, 0x01 }, 1599 1606 { "SHVALIDSTDIS", 0x02, 0x02 }, ··· 1615 1608 ahd_scschkn_print(u_int regvalue, u_int *cur_col, u_int wrap) 1616 1609 { 1617 1610 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 1611 0x66, regvalue, cur_col, wrap)); 1626 1612 } 1627 1613 ··· 1728 1728 } 1729 1729 1730 1730 int 1731 - ahd_pll400cnt0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1731 + ahd_unfairness_print(u_int regvalue, u_int *cur_col, u_int wrap) 1732 1732 { 1733 - return (ahd_print_register(NULL, 0, "PLL400CNT0", 1733 + return (ahd_print_register(NULL, 0, "UNFAIRNESS", 1734 1734 0x6e, regvalue, cur_col, wrap)); 1735 1735 } 1736 1736 1737 1737 int 1738 - ahd_unfairness_print(u_int regvalue, u_int *cur_col, u_int wrap) 1738 + ahd_pll400cnt0_print(u_int regvalue, u_int *cur_col, u_int wrap) 1739 1739 { 1740 - return (ahd_print_register(NULL, 0, "UNFAIRNESS", 1740 + return (ahd_print_register(NULL, 0, "PLL400CNT0", 1741 1741 0x6e, regvalue, cur_col, wrap)); 1742 1742 } 1743 1743 ··· 1788 1788 } 1789 1789 1790 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 1791 ahd_scbhaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1799 1792 { 1800 1793 return (ahd_print_register(NULL, 0, "SCBHADDR", ··· 1795 1802 } 1796 1803 1797 1804 int 1798 - ahd_sghcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1805 + ahd_sghaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 1799 1806 { 1800 - return (ahd_print_register(NULL, 0, "SGHCNT", 1801 - 0x84, regvalue, cur_col, wrap)); 1807 + return (ahd_print_register(NULL, 0, "SGHADDR", 1808 + 0x7c, regvalue, cur_col, wrap)); 1802 1809 } 1803 1810 1804 1811 int 1805 1812 ahd_scbhcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 1806 1813 { 1807 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", 1808 1822 0x84, regvalue, cur_col, wrap)); 1809 1823 } 1810 1824 ··· 1950 1950 0x91, regvalue, cur_col, wrap)); 1951 1951 } 1952 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 1953 static ahd_reg_parse_entry_t CMCRXMSG1_parse_table[] = { 1965 1954 { "CBNUM", 0xff, 0xff } 1966 1955 }; ··· 1961 1972 0x91, regvalue, cur_col, wrap)); 1962 1973 } 1963 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 + 1964 1986 static ahd_reg_parse_entry_t DCHRXMSG2_parse_table[] = { 1965 1987 { "MINDEX", 0xff, 0xff } 1966 1988 }; ··· 1980 1980 ahd_dchrxmsg2_print(u_int regvalue, u_int *cur_col, u_int wrap) 1981 1981 { 1982 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 1983 0x92, regvalue, cur_col, wrap)); 1995 1984 } 1996 1985 ··· 2001 2012 0x92, regvalue, cur_col, wrap)); 2002 2013 } 2003 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 + 2004 2026 static ahd_reg_parse_entry_t DCHRXMSG3_parse_table[] = { 2005 2027 { "MCLASS", 0x0f, 0x0f } 2006 2028 }; ··· 2020 2020 ahd_dchrxmsg3_print(u_int regvalue, u_int *cur_col, u_int wrap) 2021 2021 { 2022 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", 2023 2034 0x93, regvalue, cur_col, wrap)); 2024 2035 } 2025 2036 ··· 2062 2051 0x93, regvalue, cur_col, wrap)); 2063 2052 } 2064 2053 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 2054 int 2077 2055 ahd_ovlyseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2078 2056 { ··· 2070 2070 } 2071 2071 2072 2072 int 2073 - ahd_cmcseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2073 + ahd_dchseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2074 2074 { 2075 - return (ahd_print_register(NULL, 0, "CMCSEQBCNT", 2075 + return (ahd_print_register(NULL, 0, "DCHSEQBCNT", 2076 2076 0x94, regvalue, cur_col, wrap)); 2077 2077 } 2078 2078 2079 2079 int 2080 - ahd_dchseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2080 + ahd_cmcseqbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 2081 2081 { 2082 - return (ahd_print_register(NULL, 0, "DCHSEQBCNT", 2082 + return (ahd_print_register(NULL, 0, "CMCSEQBCNT", 2083 2083 0x94, regvalue, cur_col, wrap)); 2084 2084 } 2085 2085 ··· 2101 2101 0x96, regvalue, cur_col, wrap)); 2102 2102 } 2103 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 2104 static ahd_reg_parse_entry_t DCHSPLTSTAT0_parse_table[] = { 2123 2105 { "RXSPLTRSP", 0x01, 0x01 }, 2124 2106 { "RXSCEMSG", 0x02, 0x02 }, ··· 2119 2137 0x96, regvalue, cur_col, wrap)); 2120 2138 } 2121 2139 2122 - static ahd_reg_parse_entry_t DCHSPLTSTAT1_parse_table[] = { 2123 - { "RXDATABUCKET", 0x01, 0x01 } 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 } 2124 2149 }; 2125 2150 2126 2151 int 2127 - ahd_dchspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2152 + ahd_ovlyspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 2128 2153 { 2129 - return (ahd_print_register(DCHSPLTSTAT1_parse_table, 1, "DCHSPLTSTAT1", 2130 - 0x97, regvalue, cur_col, wrap)); 2154 + return (ahd_print_register(OVLYSPLTSTAT0_parse_table, 8, "OVLYSPLTSTAT0", 2155 + 0x96, regvalue, cur_col, wrap)); 2131 2156 } 2132 2157 2133 2158 static ahd_reg_parse_entry_t CMCSPLTSTAT1_parse_table[] = { ··· 2156 2167 ahd_ovlyspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 2157 2168 { 2158 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", 2159 2181 0x97, regvalue, cur_col, wrap)); 2160 2182 } 2161 2183 ··· 2320 2320 0x9e, regvalue, cur_col, wrap)); 2321 2321 } 2322 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 + 2323 2334 static ahd_reg_parse_entry_t SFUNCT_parse_table[] = { 2324 2335 { "TEST_NUM", 0x0f, 0x0f }, 2325 2336 { "TEST_GROUP", 0xf0, 0xf0 } ··· 2340 2329 ahd_sfunct_print(u_int regvalue, u_int *cur_col, u_int wrap) 2341 2330 { 2342 2331 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 2332 0x9f, regvalue, cur_col, wrap)); 2355 2333 } 2356 2334 ··· 2537 2537 } 2538 2538 2539 2539 int 2540 - ahd_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2540 + ahd_ccscbadr_bk_print(u_int regvalue, u_int *cur_col, u_int wrap) 2541 2541 { 2542 - return (ahd_print_register(NULL, 0, "CCSCBADDR", 2542 + return (ahd_print_register(NULL, 0, "CCSCBADR_BK", 2543 2543 0xac, regvalue, cur_col, wrap)); 2544 2544 } 2545 2545 2546 2546 int 2547 - ahd_ccscbadr_bk_print(u_int regvalue, u_int *cur_col, u_int wrap) 2547 + ahd_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2548 2548 { 2549 - return (ahd_print_register(NULL, 0, "CCSCBADR_BK", 2549 + return (ahd_print_register(NULL, 0, "CCSCBADDR", 2550 2550 0xac, regvalue, cur_col, wrap)); 2551 2551 } 2552 2552 ··· 2566 2566 0xad, regvalue, cur_col, wrap)); 2567 2567 } 2568 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 2569 static ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { 2586 2570 { "CCSCBRESET", 0x01, 0x01 }, 2587 2571 { "CCSCBDIR", 0x04, 0x04 }, ··· 2579 2595 ahd_ccscbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 2580 2596 { 2581 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", 2582 2614 0xad, regvalue, cur_col, wrap)); 2583 2615 } 2584 2616 ··· 2841 2841 } 2842 2842 2843 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 2844 ahd_rcvrbiascalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 2852 2845 { 2853 2846 return (ahd_print_register(NULL, 0, "RCVRBIASCALC", ··· 2848 2855 } 2849 2856 2850 2857 int 2851 - ahd_dfbkptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 2858 + ahd_dfptrs_print(u_int regvalue, u_int *cur_col, u_int wrap) 2852 2859 { 2853 - return (ahd_print_register(NULL, 0, "DFBKPTR", 2854 - 0xc9, regvalue, cur_col, wrap)); 2860 + return (ahd_print_register(NULL, 0, "DFPTRS", 2861 + 0xc8, regvalue, cur_col, wrap)); 2855 2862 } 2856 2863 2857 2864 int 2858 2865 ahd_skewcalc_print(u_int regvalue, u_int *cur_col, u_int wrap) 2859 2866 { 2860 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", 2861 2875 0xc9, regvalue, cur_col, wrap)); 2862 2876 } 2863 2877 ··· 3001 3001 0xe4, regvalue, cur_col, wrap)); 3002 3002 } 3003 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 + 3004 3011 static ahd_reg_parse_entry_t BRKADDR1_parse_table[] = { 3005 3012 { "BRKDIS", 0x80, 0x80 } 3006 3013 }; ··· 3016 3009 ahd_brkaddr1_print(u_int regvalue, u_int *cur_col, u_int wrap) 3017 3010 { 3018 3011 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 3012 0xe6, regvalue, cur_col, wrap)); 3027 3013 } 3028 3014 ··· 3069 3069 } 3070 3070 3071 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 3072 ahd_intvec1_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3080 3073 { 3081 3074 return (ahd_print_register(NULL, 0, "INTVEC1_ADDR", ··· 3076 3083 } 3077 3084 3078 3085 int 3079 - ahd_intvec2_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3086 + ahd_curaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3080 3087 { 3081 - return (ahd_print_register(NULL, 0, "INTVEC2_ADDR", 3082 - 0xf6, regvalue, cur_col, wrap)); 3088 + return (ahd_print_register(NULL, 0, "CURADDR", 3089 + 0xf4, regvalue, cur_col, wrap)); 3083 3090 } 3084 3091 3085 3092 int 3086 3093 ahd_lastaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3087 3094 { 3088 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", 3089 3103 0xf6, regvalue, cur_col, wrap)); 3090 3104 } 3091 3105 ··· 3174 3174 } 3175 3175 3176 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 3177 3191 ahd_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) 3178 3192 { 3179 3193 return (ahd_print_register(NULL, 0, "QFREEZE_COUNT", 3180 - 0x12e, regvalue, cur_col, wrap)); 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)); 3181 3202 } 3182 3203 3183 3204 int 3184 3205 ahd_saved_mode_print(u_int regvalue, u_int *cur_col, u_int wrap) 3185 3206 { 3186 3207 return (ahd_print_register(NULL, 0, "SAVED_MODE", 3187 - 0x130, regvalue, cur_col, wrap)); 3208 + 0x136, regvalue, cur_col, wrap)); 3188 3209 } 3189 3210 3190 3211 int 3191 3212 ahd_msg_out_print(u_int regvalue, u_int *cur_col, u_int wrap) 3192 3213 { 3193 3214 return (ahd_print_register(NULL, 0, "MSG_OUT", 3194 - 0x131, regvalue, cur_col, wrap)); 3215 + 0x137, regvalue, cur_col, wrap)); 3195 3216 } 3196 3217 3197 3218 static ahd_reg_parse_entry_t DMAPARAMS_parse_table[] = { ··· 3232 3211 ahd_dmaparams_print(u_int regvalue, u_int *cur_col, u_int wrap) 3233 3212 { 3234 3213 return (ahd_print_register(DMAPARAMS_parse_table, 10, "DMAPARAMS", 3235 - 0x132, regvalue, cur_col, wrap)); 3214 + 0x138, regvalue, cur_col, wrap)); 3236 3215 } 3237 3216 3238 3217 static ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { ··· 3251 3230 ahd_seq_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) 3252 3231 { 3253 3232 return (ahd_print_register(SEQ_FLAGS_parse_table, 9, "SEQ_FLAGS", 3254 - 0x133, regvalue, cur_col, wrap)); 3233 + 0x139, regvalue, cur_col, wrap)); 3255 3234 } 3256 3235 3257 3236 int 3258 3237 ahd_saved_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) 3259 3238 { 3260 3239 return (ahd_print_register(NULL, 0, "SAVED_SCSIID", 3261 - 0x134, regvalue, cur_col, wrap)); 3240 + 0x13a, regvalue, cur_col, wrap)); 3262 3241 } 3263 3242 3264 3243 int 3265 3244 ahd_saved_lun_print(u_int regvalue, u_int *cur_col, u_int wrap) 3266 3245 { 3267 3246 return (ahd_print_register(NULL, 0, "SAVED_LUN", 3268 - 0x135, regvalue, cur_col, wrap)); 3247 + 0x13b, regvalue, cur_col, wrap)); 3269 3248 } 3270 3249 3271 3250 static ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { ··· 3288 3267 ahd_lastphase_print(u_int regvalue, u_int *cur_col, u_int wrap) 3289 3268 { 3290 3269 return (ahd_print_register(LASTPHASE_parse_table, 13, "LASTPHASE", 3291 - 0x136, regvalue, cur_col, wrap)); 3270 + 0x13c, regvalue, cur_col, wrap)); 3292 3271 } 3293 3272 3294 3273 int 3295 3274 ahd_qoutfifo_entry_valid_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 3296 3275 { 3297 3276 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)); 3277 + 0x13d, regvalue, cur_col, wrap)); 3313 3278 } 3314 3279 3315 3280 int 3316 3281 ahd_kernel_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) 3317 3282 { 3318 3283 return (ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 3319 - 0x140, regvalue, cur_col, wrap)); 3284 + 0x13e, regvalue, cur_col, wrap)); 3320 3285 } 3321 3286 3322 3287 int 3323 3288 ahd_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) 3324 3289 { 3325 3290 return (ahd_print_register(NULL, 0, "TQINPOS", 3326 - 0x141, regvalue, cur_col, wrap)); 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)); 3327 3306 } 3328 3307 3329 3308 static ahd_reg_parse_entry_t ARG_1_parse_table[] = { ··· 3341 3320 ahd_arg_1_print(u_int regvalue, u_int *cur_col, u_int wrap) 3342 3321 { 3343 3322 return (ahd_print_register(ARG_1_parse_table, 8, "ARG_1", 3344 - 0x142, regvalue, cur_col, wrap)); 3323 + 0x148, regvalue, cur_col, wrap)); 3345 3324 } 3346 3325 3347 3326 int 3348 3327 ahd_arg_2_print(u_int regvalue, u_int *cur_col, u_int wrap) 3349 3328 { 3350 3329 return (ahd_print_register(NULL, 0, "ARG_2", 3351 - 0x143, regvalue, cur_col, wrap)); 3330 + 0x149, regvalue, cur_col, wrap)); 3352 3331 } 3353 3332 3354 3333 int 3355 3334 ahd_last_msg_print(u_int regvalue, u_int *cur_col, u_int wrap) 3356 3335 { 3357 3336 return (ahd_print_register(NULL, 0, "LAST_MSG", 3358 - 0x144, regvalue, cur_col, wrap)); 3337 + 0x14a, regvalue, cur_col, wrap)); 3359 3338 } 3360 3339 3361 3340 static ahd_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { ··· 3371 3350 ahd_scsiseq_template_print(u_int regvalue, u_int *cur_col, u_int wrap) 3372 3351 { 3373 3352 return (ahd_print_register(SCSISEQ_TEMPLATE_parse_table, 6, "SCSISEQ_TEMPLATE", 3374 - 0x145, regvalue, cur_col, wrap)); 3353 + 0x14b, regvalue, cur_col, wrap)); 3375 3354 } 3376 3355 3377 3356 int 3378 3357 ahd_initiator_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 3379 3358 { 3380 3359 return (ahd_print_register(NULL, 0, "INITIATOR_TAG", 3381 - 0x146, regvalue, cur_col, wrap)); 3360 + 0x14c, regvalue, cur_col, wrap)); 3382 3361 } 3383 3362 3384 3363 static ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { ··· 3390 3369 ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) 3391 3370 { 3392 3371 return (ahd_print_register(SEQ_FLAGS2_parse_table, 2, "SEQ_FLAGS2", 3393 - 0x147, regvalue, cur_col, wrap)); 3372 + 0x14d, regvalue, cur_col, wrap)); 3394 3373 } 3395 3374 3396 3375 int 3397 3376 ahd_allocfifo_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) 3398 3377 { 3399 3378 return (ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", 3400 - 0x148, regvalue, cur_col, wrap)); 3379 + 0x14e, regvalue, cur_col, wrap)); 3401 3380 } 3402 3381 3403 3382 int 3404 3383 ahd_int_coalescing_timer_print(u_int regvalue, u_int *cur_col, u_int wrap) 3405 3384 { 3406 3385 return (ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", 3407 - 0x14a, regvalue, cur_col, wrap)); 3386 + 0x150, regvalue, cur_col, wrap)); 3408 3387 } 3409 3388 3410 3389 int 3411 3390 ahd_int_coalescing_maxcmds_print(u_int regvalue, u_int *cur_col, u_int wrap) 3412 3391 { 3413 3392 return (ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", 3414 - 0x14c, regvalue, cur_col, wrap)); 3393 + 0x152, regvalue, cur_col, wrap)); 3415 3394 } 3416 3395 3417 3396 int 3418 3397 ahd_int_coalescing_mincmds_print(u_int regvalue, u_int *cur_col, u_int wrap) 3419 3398 { 3420 3399 return (ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", 3421 - 0x14d, regvalue, cur_col, wrap)); 3400 + 0x153, regvalue, cur_col, wrap)); 3422 3401 } 3423 3402 3424 3403 int 3425 3404 ahd_cmds_pending_print(u_int regvalue, u_int *cur_col, u_int wrap) 3426 3405 { 3427 3406 return (ahd_print_register(NULL, 0, "CMDS_PENDING", 3428 - 0x14e, regvalue, cur_col, wrap)); 3407 + 0x154, regvalue, cur_col, wrap)); 3429 3408 } 3430 3409 3431 3410 int 3432 3411 ahd_int_coalescing_cmdcount_print(u_int regvalue, u_int *cur_col, u_int wrap) 3433 3412 { 3434 3413 return (ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", 3435 - 0x150, regvalue, cur_col, wrap)); 3414 + 0x156, regvalue, cur_col, wrap)); 3436 3415 } 3437 3416 3438 3417 int 3439 3418 ahd_local_hs_mailbox_print(u_int regvalue, u_int *cur_col, u_int wrap) 3440 3419 { 3441 3420 return (ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", 3442 - 0x151, regvalue, cur_col, wrap)); 3421 + 0x157, regvalue, cur_col, wrap)); 3443 3422 } 3444 3423 3445 3424 int 3446 3425 ahd_cmdsize_table_print(u_int regvalue, u_int *cur_col, u_int wrap) 3447 3426 { 3448 3427 return (ahd_print_register(NULL, 0, "CMDSIZE_TABLE", 3449 - 0x152, regvalue, cur_col, wrap)); 3428 + 0x158, regvalue, cur_col, wrap)); 3450 3429 } 3451 3430 3452 3431 int
+645 -607
drivers/scsi/aic7xxx/aic79xx_seq.h_shipped
··· 2 2 * DO NOT EDIT - This file is automatically generated 3 3 * from the following source files: 4 4 * 5 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#94 $ 6 - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $ 5 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $ 6 + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $ 7 7 */ 8 8 static uint8_t seqprog[] = { 9 9 0xff, 0x02, 0x06, 0x78, 10 - 0x00, 0xea, 0x50, 0x59, 10 + 0x00, 0xea, 0x64, 0x59, 11 11 0x01, 0xea, 0x04, 0x30, 12 12 0xff, 0x04, 0x0c, 0x78, 13 - 0x19, 0xea, 0x50, 0x59, 13 + 0x19, 0xea, 0x64, 0x59, 14 14 0x19, 0xea, 0x04, 0x00, 15 - 0x33, 0xea, 0x44, 0x59, 15 + 0x33, 0xea, 0x5e, 0x59, 16 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, 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, 29 45 0x30, 0x3f, 0xc0, 0x09, 30 - 0x30, 0xe0, 0x30, 0x60, 46 + 0x30, 0xe0, 0x50, 0x60, 31 47 0x7f, 0x4a, 0x94, 0x08, 32 - 0x00, 0xe2, 0x32, 0x40, 48 + 0x00, 0xe2, 0x52, 0x40, 33 49 0xc0, 0x4a, 0x94, 0x00, 34 - 0x00, 0xe2, 0x3e, 0x58, 35 - 0x00, 0xe2, 0x56, 0x58, 36 - 0x00, 0xe2, 0x66, 0x58, 50 + 0x00, 0xe2, 0x5e, 0x58, 51 + 0x00, 0xe2, 0x76, 0x58, 52 + 0x00, 0xe2, 0x86, 0x58, 37 53 0x00, 0xe2, 0x06, 0x40, 38 - 0x33, 0xea, 0x44, 0x59, 54 + 0x33, 0xea, 0x5e, 0x59, 39 55 0x33, 0xea, 0x00, 0x00, 40 - 0x01, 0x52, 0x64, 0x78, 56 + 0x01, 0x52, 0x84, 0x78, 41 57 0x02, 0x58, 0x50, 0x31, 42 58 0xff, 0xea, 0x10, 0x0b, 43 - 0xff, 0x97, 0x4f, 0x78, 44 - 0x50, 0x4b, 0x4a, 0x68, 59 + 0xff, 0x97, 0x6f, 0x78, 60 + 0x50, 0x4b, 0x6a, 0x68, 45 61 0xbf, 0x3a, 0x74, 0x08, 46 - 0x14, 0xea, 0x50, 0x59, 62 + 0x14, 0xea, 0x64, 0x59, 47 63 0x14, 0xea, 0x04, 0x00, 48 64 0x08, 0x92, 0x25, 0x03, 49 - 0xff, 0x90, 0x3f, 0x68, 50 - 0x00, 0xe2, 0x56, 0x5b, 51 - 0x00, 0xe2, 0x3e, 0x40, 52 - 0x00, 0xea, 0x44, 0x59, 65 + 0xff, 0x90, 0x5f, 0x68, 66 + 0x00, 0xe2, 0x76, 0x5b, 67 + 0x00, 0xe2, 0x5e, 0x40, 68 + 0x00, 0xea, 0x5e, 0x59, 53 69 0x01, 0xea, 0x00, 0x30, 54 - 0x80, 0xf9, 0x5e, 0x68, 55 - 0x00, 0xe2, 0x42, 0x59, 56 - 0x11, 0xea, 0x44, 0x59, 70 + 0x80, 0xf9, 0x7e, 0x68, 71 + 0x00, 0xe2, 0x5c, 0x59, 72 + 0x11, 0xea, 0x5e, 0x59, 57 73 0x11, 0xea, 0x00, 0x00, 58 - 0x80, 0xf9, 0x42, 0x79, 74 + 0x80, 0xf9, 0x5c, 0x79, 59 75 0xff, 0xea, 0xd4, 0x0d, 60 - 0x22, 0xea, 0x44, 0x59, 76 + 0x22, 0xea, 0x5e, 0x59, 61 77 0x22, 0xea, 0x00, 0x00, 62 - 0x10, 0x16, 0x70, 0x78, 63 - 0x01, 0x0b, 0xa2, 0x32, 78 + 0x10, 0x16, 0x90, 0x78, 64 79 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, 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, 70 85 0xe7, 0xad, 0x5a, 0x09, 71 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, 72 92 0x02, 0x28, 0x19, 0x33, 73 93 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 94 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, 95 + 0x00, 0xe2, 0xb8, 0x58, 87 96 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, 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, 104 113 0x10, 0xea, 0x18, 0x00, 105 114 0x60, 0x18, 0x30, 0x00, 106 115 0x7f, 0x18, 0x30, 0x0c, 107 116 0x02, 0xea, 0x02, 0x00, 108 - 0xff, 0xea, 0xa0, 0x0a, 117 + 0xff, 0xea, 0xac, 0x0a, 109 118 0x80, 0x18, 0x30, 0x04, 110 - 0x40, 0xad, 0x64, 0x78, 119 + 0x40, 0xad, 0x84, 0x78, 111 120 0xe7, 0xad, 0x5a, 0x09, 112 121 0x02, 0xa8, 0x40, 0x31, 113 122 0xff, 0xea, 0xc0, 0x09, 114 - 0x01, 0x4e, 0x9d, 0x1a, 115 - 0x00, 0x4f, 0x9f, 0x22, 123 + 0x01, 0x54, 0xa9, 0x1a, 124 + 0x00, 0x55, 0xab, 0x22, 116 125 0x01, 0x94, 0x6d, 0x33, 117 - 0x01, 0xea, 0x20, 0x33, 126 + 0xff, 0xea, 0x20, 0x0b, 118 127 0x04, 0xac, 0x49, 0x32, 119 128 0xff, 0xea, 0x5a, 0x03, 120 129 0xff, 0xea, 0x5e, 0x03, 121 130 0x01, 0x10, 0xd4, 0x31, 122 - 0x10, 0x92, 0xf5, 0x68, 131 + 0x10, 0x92, 0x07, 0x69, 123 132 0x3d, 0x93, 0xc5, 0x29, 124 133 0xfe, 0xe2, 0xc4, 0x09, 125 134 0x01, 0xea, 0xc6, 0x01, 126 135 0x02, 0xe2, 0xc8, 0x31, 127 136 0x02, 0xec, 0x50, 0x31, 128 137 0x02, 0xa0, 0xda, 0x31, 129 - 0xff, 0xa9, 0xf4, 0x70, 138 + 0xff, 0xa9, 0x06, 0x71, 130 139 0x02, 0xa0, 0x58, 0x37, 131 - 0xff, 0x21, 0xfd, 0x70, 140 + 0xff, 0x21, 0x0f, 0x71, 132 141 0x02, 0x22, 0x51, 0x31, 133 142 0x02, 0xa0, 0x5c, 0x33, 134 143 0x02, 0xa0, 0x44, 0x36, 135 144 0x02, 0xa0, 0x40, 0x32, 136 145 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, 146 + 0x04, 0x4d, 0x17, 0x69, 147 + 0x40, 0x16, 0x48, 0x69, 148 + 0xff, 0x2d, 0x4d, 0x61, 149 + 0xff, 0x29, 0x85, 0x70, 142 150 0x02, 0x28, 0x55, 0x32, 143 151 0x01, 0xea, 0x5a, 0x01, 144 - 0x04, 0x3c, 0xf9, 0x30, 152 + 0x04, 0x44, 0xf9, 0x30, 153 + 0x01, 0x44, 0xc1, 0x31, 145 154 0x02, 0x28, 0x51, 0x31, 146 - 0x01, 0xa8, 0x60, 0x31, 147 - 0x00, 0xa9, 0x60, 0x01, 155 + 0x02, 0xa8, 0x60, 0x31, 156 + 0x01, 0xa4, 0x61, 0x31, 157 + 0x01, 0x3d, 0x61, 0x31, 148 158 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, 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, 155 167 0x02, 0x8c, 0x51, 0x31, 156 - 0x00, 0xe2, 0x12, 0x41, 168 + 0x00, 0xe2, 0x24, 0x41, 157 169 0x01, 0xac, 0x08, 0x31, 158 170 0x09, 0xea, 0x5a, 0x01, 159 171 0x02, 0x8c, 0x51, 0x32, 160 172 0xff, 0xea, 0x1a, 0x07, 161 173 0x04, 0x24, 0xf9, 0x30, 162 - 0x1d, 0xea, 0x3a, 0x41, 174 + 0x1d, 0xea, 0x52, 0x41, 163 175 0x02, 0x2c, 0x51, 0x31, 164 176 0x04, 0xa8, 0xf9, 0x30, 165 - 0x19, 0xea, 0x3a, 0x41, 177 + 0x19, 0xea, 0x52, 0x41, 166 178 0x06, 0xea, 0x08, 0x81, 167 179 0x01, 0xe2, 0x5a, 0x35, 168 - 0x02, 0xf2, 0xf0, 0x35, 180 + 0x02, 0xf2, 0xf0, 0x31, 181 + 0xff, 0xea, 0xd4, 0x0d, 169 182 0x02, 0xf2, 0xf0, 0x31, 170 183 0x02, 0xf8, 0xe4, 0x35, 171 184 0x80, 0xea, 0xb2, 0x01, 172 185 0x01, 0xe2, 0x00, 0x30, 173 - 0xff, 0xea, 0xb2, 0x0d, 174 - 0x80, 0xea, 0xb2, 0x01, 175 - 0x11, 0x00, 0x00, 0x10, 176 186 0xff, 0xea, 0xb2, 0x0d, 177 187 0x01, 0xe2, 0x04, 0x30, 178 188 0x01, 0xea, 0x04, 0x34, ··· 190 180 0x02, 0x20, 0xb9, 0x30, 191 181 0x02, 0x20, 0x51, 0x31, 192 182 0x4c, 0x93, 0xd7, 0x28, 193 - 0x10, 0x92, 0x63, 0x79, 183 + 0x10, 0x92, 0x77, 0x79, 194 184 0x01, 0x6b, 0xc0, 0x30, 195 185 0x02, 0x64, 0xc8, 0x00, 196 186 0x40, 0x3a, 0x74, 0x04, 197 - 0x00, 0xe2, 0x56, 0x58, 198 - 0x33, 0xea, 0x44, 0x59, 187 + 0x00, 0xe2, 0x76, 0x58, 188 + 0x33, 0xea, 0x5e, 0x59, 199 189 0x33, 0xea, 0x00, 0x00, 200 190 0x30, 0x3f, 0xc0, 0x09, 201 - 0x30, 0xe0, 0x64, 0x61, 202 - 0x20, 0x3f, 0x7a, 0x69, 203 - 0x10, 0x3f, 0x64, 0x79, 191 + 0x30, 0xe0, 0x78, 0x61, 192 + 0x20, 0x3f, 0x8e, 0x69, 193 + 0x10, 0x3f, 0x78, 0x79, 204 194 0x02, 0xea, 0x7e, 0x00, 205 - 0x00, 0xea, 0x44, 0x59, 195 + 0x00, 0xea, 0x5e, 0x59, 206 196 0x01, 0xea, 0x00, 0x30, 207 - 0x02, 0x48, 0x51, 0x35, 197 + 0x02, 0x4e, 0x51, 0x35, 208 198 0x01, 0xea, 0x7e, 0x00, 209 - 0x11, 0xea, 0x44, 0x59, 199 + 0x11, 0xea, 0x5e, 0x59, 210 200 0x11, 0xea, 0x00, 0x00, 211 - 0x02, 0x48, 0x51, 0x35, 201 + 0x02, 0x4e, 0x51, 0x35, 202 + 0xc0, 0x4a, 0x94, 0x00, 203 + 0x04, 0x41, 0x9c, 0x79, 212 204 0x08, 0xea, 0x98, 0x00, 213 205 0x08, 0x57, 0xae, 0x00, 214 206 0x08, 0x3c, 0x78, 0x00, 215 - 0xf0, 0x49, 0x68, 0x0a, 207 + 0xf0, 0x49, 0x74, 0x0a, 216 208 0x0f, 0x67, 0xc0, 0x09, 217 - 0x00, 0x34, 0x69, 0x02, 209 + 0x00, 0x3a, 0x75, 0x02, 218 210 0x20, 0xea, 0x96, 0x00, 219 - 0x00, 0xe2, 0xf8, 0x41, 220 - 0x40, 0x3a, 0xae, 0x69, 211 + 0x00, 0xe2, 0x14, 0x42, 212 + 0xc0, 0x4a, 0x94, 0x00, 213 + 0x40, 0x3a, 0xc8, 0x69, 221 214 0x02, 0x55, 0x06, 0x68, 222 - 0x02, 0x56, 0xae, 0x69, 223 - 0xff, 0x5b, 0xae, 0x61, 215 + 0x02, 0x56, 0xc8, 0x69, 216 + 0xff, 0x5b, 0xc8, 0x61, 224 217 0x02, 0x20, 0x51, 0x31, 225 218 0x80, 0xea, 0xb2, 0x01, 226 219 0x44, 0xea, 0x00, 0x00, ··· 231 218 0x33, 0xea, 0x00, 0x00, 232 219 0xff, 0xea, 0xb2, 0x09, 233 220 0xff, 0xe0, 0xc0, 0x19, 234 - 0xff, 0xe0, 0xb0, 0x79, 221 + 0xff, 0xe0, 0xca, 0x79, 235 222 0x02, 0xac, 0x51, 0x31, 236 - 0x00, 0xe2, 0xa6, 0x41, 223 + 0x00, 0xe2, 0xc0, 0x41, 237 224 0x02, 0x5e, 0x50, 0x31, 238 225 0x02, 0xa8, 0xb8, 0x30, 239 226 0x02, 0x5c, 0x50, 0x31, 240 - 0xff, 0xad, 0xc1, 0x71, 227 + 0xff, 0xad, 0xdb, 0x71, 241 228 0x02, 0xac, 0x41, 0x31, 242 229 0x02, 0x22, 0x51, 0x31, 243 230 0x02, 0xa0, 0x5c, 0x33, 244 231 0x02, 0xa0, 0x44, 0x32, 245 - 0x00, 0xe2, 0xca, 0x41, 246 - 0x10, 0x92, 0xcb, 0x69, 232 + 0x00, 0xe2, 0xe4, 0x41, 233 + 0x10, 0x92, 0xe5, 0x69, 247 234 0x3d, 0x93, 0xc9, 0x29, 248 235 0x01, 0xe4, 0xc8, 0x01, 249 236 0x01, 0xea, 0xca, 0x01, 250 237 0xff, 0xea, 0xda, 0x01, 251 238 0x02, 0x20, 0x51, 0x31, 252 239 0x02, 0xae, 0x41, 0x32, 253 - 0xff, 0x21, 0xd3, 0x61, 240 + 0xff, 0x21, 0xed, 0x61, 254 241 0xff, 0xea, 0x46, 0x02, 255 242 0x02, 0x5c, 0x50, 0x31, 256 243 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, 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, 262 249 0xff, 0x97, 0x07, 0x78, 263 - 0x13, 0xea, 0x50, 0x59, 250 + 0x13, 0xea, 0x64, 0x59, 264 251 0x13, 0xea, 0x04, 0x00, 265 252 0x00, 0xe2, 0x06, 0x40, 266 253 0xbf, 0x3a, 0x74, 0x08, 254 + 0x04, 0x41, 0x08, 0x7a, 267 255 0x08, 0xea, 0x98, 0x00, 268 256 0x08, 0x57, 0xae, 0x00, 269 - 0x01, 0x93, 0x69, 0x32, 270 - 0x01, 0x94, 0x6b, 0x32, 271 - 0x40, 0xea, 0x66, 0x02, 257 + 0x01, 0x93, 0x75, 0x32, 258 + 0x01, 0x94, 0x77, 0x32, 259 + 0x40, 0xea, 0x72, 0x02, 272 260 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, 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, 282 270 0x01, 0xea, 0x04, 0x00, 283 - 0x00, 0xe2, 0xf8, 0x41, 284 - 0x80, 0x33, 0x13, 0x7a, 285 - 0x03, 0xea, 0x50, 0x59, 271 + 0x00, 0xe2, 0x14, 0x42, 272 + 0x80, 0x39, 0x2f, 0x7a, 273 + 0x03, 0xea, 0x64, 0x59, 286 274 0x03, 0xea, 0x04, 0x00, 287 - 0xee, 0x00, 0x1a, 0x6a, 275 + 0xee, 0x00, 0x36, 0x6a, 288 276 0x05, 0xea, 0xb4, 0x00, 289 - 0x33, 0xea, 0x44, 0x59, 277 + 0x33, 0xea, 0x5e, 0x59, 290 278 0x33, 0xea, 0x00, 0x00, 291 - 0x02, 0xa8, 0x90, 0x32, 292 - 0x00, 0xe2, 0x6a, 0x59, 279 + 0x02, 0xa8, 0x9c, 0x32, 280 + 0x00, 0xe2, 0x7e, 0x59, 293 281 0xef, 0x96, 0xd5, 0x19, 294 - 0x00, 0xe2, 0x2a, 0x52, 282 + 0x00, 0xe2, 0x46, 0x52, 295 283 0x09, 0x80, 0xe1, 0x30, 296 284 0x02, 0xea, 0x36, 0x00, 297 285 0xa8, 0xea, 0x32, 0x00, 298 - 0x00, 0xe2, 0x30, 0x42, 286 + 0x00, 0xe2, 0x4c, 0x42, 299 287 0x01, 0x96, 0xd1, 0x30, 300 288 0x10, 0x80, 0x89, 0x31, 301 289 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, 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, 308 298 0x01, 0x44, 0x10, 0x33, 309 299 0x08, 0x92, 0x25, 0x03, 310 - 0x00, 0xe2, 0xf8, 0x41, 300 + 0x00, 0xe2, 0x14, 0x42, 311 301 0x10, 0xea, 0x80, 0x00, 312 - 0x01, 0x31, 0xc5, 0x31, 313 - 0x80, 0xe2, 0x60, 0x62, 314 - 0x10, 0x92, 0x85, 0x6a, 302 + 0x01, 0x37, 0xc5, 0x31, 303 + 0x80, 0xe2, 0x80, 0x62, 304 + 0x10, 0x92, 0xa5, 0x6a, 315 305 0xc0, 0x94, 0xc5, 0x01, 316 - 0x40, 0x92, 0x51, 0x6a, 306 + 0x40, 0x92, 0x71, 0x6a, 317 307 0xbf, 0xe2, 0xc4, 0x09, 318 - 0x20, 0x92, 0x65, 0x7a, 308 + 0x20, 0x92, 0x85, 0x7a, 319 309 0x01, 0xe2, 0x88, 0x30, 320 - 0x00, 0xe2, 0xb8, 0x5b, 321 - 0xa0, 0x36, 0x6d, 0x62, 310 + 0x00, 0xe2, 0xe2, 0x5b, 311 + 0xa0, 0x3c, 0x8d, 0x62, 322 312 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, 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, 328 318 0x40, 0xea, 0x98, 0x00, 329 319 0x01, 0xe2, 0x88, 0x30, 330 - 0x00, 0xe2, 0xb8, 0x5b, 331 - 0xa0, 0x36, 0x43, 0x72, 320 + 0x00, 0xe2, 0xe2, 0x5b, 321 + 0xa0, 0x3c, 0x63, 0x72, 332 322 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, 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, 346 336 0x07, 0xea, 0x04, 0x00, 347 - 0x08, 0x42, 0xf9, 0x71, 348 - 0x04, 0x42, 0x93, 0x62, 349 - 0x01, 0x43, 0x89, 0x30, 350 - 0x00, 0xe2, 0x84, 0x42, 337 + 0x08, 0x48, 0x15, 0x72, 338 + 0x04, 0x48, 0xb3, 0x62, 339 + 0x01, 0x49, 0x89, 0x30, 340 + 0x00, 0xe2, 0xa4, 0x42, 351 341 0x01, 0x44, 0xd4, 0x31, 352 - 0x00, 0xe2, 0x84, 0x42, 353 - 0x01, 0x00, 0x60, 0x32, 354 - 0x33, 0xea, 0x44, 0x59, 342 + 0x00, 0xe2, 0xa4, 0x42, 343 + 0x01, 0x00, 0x6c, 0x32, 344 + 0x33, 0xea, 0x5e, 0x59, 355 345 0x33, 0xea, 0x00, 0x00, 356 - 0x4c, 0x34, 0xc1, 0x28, 346 + 0x4c, 0x3a, 0xc1, 0x28, 357 347 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, 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, 366 356 0x05, 0xea, 0x04, 0x00, 367 - 0x00, 0xe2, 0xbc, 0x42, 368 - 0x03, 0xea, 0x50, 0x59, 357 + 0x00, 0xe2, 0xdc, 0x42, 358 + 0x03, 0xea, 0x64, 0x59, 369 359 0x03, 0xea, 0x04, 0x00, 370 - 0x00, 0xe2, 0xbc, 0x42, 371 - 0x07, 0xea, 0xdc, 0x5b, 360 + 0x00, 0xe2, 0xdc, 0x42, 361 + 0x07, 0xea, 0x06, 0x5c, 372 362 0x01, 0x44, 0xd4, 0x31, 373 - 0x00, 0xe2, 0xf8, 0x41, 374 - 0x3f, 0xe0, 0x6a, 0x0a, 375 - 0xc0, 0x34, 0xc1, 0x09, 376 - 0x00, 0x35, 0x51, 0x01, 363 + 0x00, 0xe2, 0x14, 0x42, 364 + 0x3f, 0xe0, 0x76, 0x0a, 365 + 0xc0, 0x3a, 0xc1, 0x09, 366 + 0x00, 0x3b, 0x51, 0x01, 377 367 0xff, 0xea, 0x52, 0x09, 378 - 0x30, 0x34, 0xc5, 0x09, 368 + 0x30, 0x3a, 0xc5, 0x09, 379 369 0x3d, 0xe2, 0xc4, 0x29, 380 370 0xb8, 0xe2, 0xc4, 0x19, 381 371 0x01, 0xea, 0xc6, 0x01, 382 372 0x02, 0xe2, 0xc8, 0x31, 383 373 0x02, 0xec, 0x40, 0x31, 384 - 0xff, 0xa1, 0xdc, 0x72, 374 + 0xff, 0xa1, 0xfc, 0x72, 385 375 0x02, 0xe8, 0xda, 0x31, 386 376 0x02, 0xa0, 0x50, 0x31, 387 - 0x00, 0xe2, 0xfe, 0x42, 388 - 0x80, 0x33, 0x67, 0x02, 377 + 0x00, 0xe2, 0x1e, 0x43, 378 + 0x80, 0x39, 0x73, 0x02, 389 379 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, 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, 395 385 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, 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, 402 392 0x01, 0xa9, 0x52, 0x11, 403 - 0xff, 0xa9, 0xee, 0x6a, 404 - 0x00, 0xe2, 0x12, 0x43, 405 - 0x10, 0x33, 0x67, 0x02, 406 - 0x04, 0x92, 0x13, 0x7b, 393 + 0xff, 0xa9, 0x0e, 0x6b, 394 + 0x00, 0xe2, 0x32, 0x43, 395 + 0x10, 0x39, 0x73, 0x02, 396 + 0x04, 0x92, 0x33, 0x7b, 407 397 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, 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, 416 406 0x04, 0xea, 0x04, 0x00, 417 - 0x00, 0xe2, 0xbc, 0x42, 418 - 0x04, 0xea, 0x50, 0x59, 407 + 0x00, 0xe2, 0xdc, 0x42, 408 + 0x04, 0xea, 0x64, 0x59, 419 409 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, 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, 428 418 0x0a, 0xea, 0x04, 0x00, 429 - 0x00, 0xe2, 0x4e, 0x5b, 430 - 0x00, 0xe2, 0x82, 0x43, 431 - 0x50, 0x4b, 0x36, 0x6b, 419 + 0x00, 0xe2, 0x6e, 0x5b, 420 + 0x00, 0xe2, 0xae, 0x43, 421 + 0x50, 0x4b, 0x56, 0x6b, 432 422 0xbf, 0x3a, 0x74, 0x08, 433 423 0x01, 0xe0, 0xf4, 0x31, 434 424 0xff, 0xea, 0xc0, 0x09, 435 - 0x01, 0x2e, 0x5d, 0x1a, 436 - 0x00, 0x2f, 0x5f, 0x22, 437 - 0x04, 0x47, 0x8f, 0x02, 425 + 0x01, 0x32, 0x65, 0x1a, 426 + 0x00, 0x33, 0x67, 0x22, 427 + 0x04, 0x4d, 0x9b, 0x02, 438 428 0x01, 0xfa, 0xc0, 0x35, 439 - 0x02, 0xa8, 0x84, 0x32, 429 + 0x02, 0xa8, 0x90, 0x32, 440 430 0x02, 0xea, 0xb4, 0x00, 441 - 0x33, 0xea, 0x44, 0x59, 431 + 0x33, 0xea, 0x5e, 0x59, 442 432 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, 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, 449 439 0x02, 0x28, 0x19, 0x33, 450 440 0x02, 0xa8, 0x50, 0x36, 451 - 0xff, 0x88, 0x5f, 0x73, 452 - 0x00, 0xe2, 0x32, 0x5b, 441 + 0xff, 0x88, 0x7f, 0x73, 442 + 0x00, 0xe2, 0x52, 0x5b, 453 443 0x02, 0xa8, 0x20, 0x33, 454 - 0x02, 0x2c, 0x19, 0x33, 444 + 0x04, 0xa4, 0x49, 0x03, 445 + 0xff, 0xea, 0x1a, 0x03, 446 + 0xff, 0x2d, 0x8b, 0x63, 455 447 0x02, 0xa8, 0x58, 0x32, 456 - 0x04, 0xa4, 0x49, 0x07, 457 - 0xc0, 0x33, 0xb5, 0x6a, 458 - 0x04, 0x92, 0x25, 0x03, 459 - 0x20, 0x92, 0x83, 0x6b, 448 + 0x02, 0xa8, 0x5c, 0x36, 460 449 0x02, 0xa8, 0x40, 0x31, 461 - 0xc0, 0x34, 0xc1, 0x09, 462 - 0x00, 0x35, 0x51, 0x01, 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, 463 459 0xff, 0xea, 0x52, 0x09, 464 - 0x30, 0x34, 0xc5, 0x09, 460 + 0x30, 0x3a, 0xc5, 0x09, 465 461 0x3d, 0xe2, 0xc4, 0x29, 466 462 0xb8, 0xe2, 0xc4, 0x19, 467 463 0x01, 0xea, 0xc6, 0x01, ··· 480 458 0xf7, 0x57, 0xae, 0x08, 481 459 0x08, 0xea, 0x98, 0x00, 482 460 0x01, 0x44, 0xd4, 0x31, 483 - 0xee, 0x00, 0x8c, 0x6b, 461 + 0xee, 0x00, 0xb8, 0x6b, 484 462 0x02, 0xea, 0xb4, 0x00, 485 - 0x00, 0xe2, 0xb4, 0x5b, 486 - 0x09, 0x4c, 0x8e, 0x7b, 463 + 0xc0, 0xea, 0x72, 0x02, 464 + 0x09, 0x4c, 0xba, 0x7b, 465 + 0x01, 0xea, 0x78, 0x02, 487 466 0x08, 0x4c, 0x06, 0x68, 488 - 0x0b, 0xea, 0x50, 0x59, 467 + 0x0b, 0xea, 0x64, 0x59, 489 468 0x0b, 0xea, 0x04, 0x00, 490 469 0x01, 0x44, 0xd4, 0x31, 491 - 0x20, 0x33, 0xf9, 0x79, 492 - 0x00, 0xe2, 0x9e, 0x5b, 493 - 0x00, 0xe2, 0xf8, 0x41, 494 - 0x01, 0x84, 0xa3, 0x7b, 470 + 0x20, 0x39, 0x15, 0x7a, 471 + 0x00, 0xe2, 0xcc, 0x5b, 472 + 0x00, 0xe2, 0x14, 0x42, 473 + 0x01, 0x84, 0xd1, 0x7b, 495 474 0x01, 0xa4, 0x49, 0x07, 496 475 0x08, 0x60, 0x30, 0x33, 497 476 0x08, 0x80, 0x41, 0x37, 498 - 0xdf, 0x33, 0x67, 0x0a, 499 - 0xee, 0x00, 0xb0, 0x6b, 477 + 0xdf, 0x39, 0x73, 0x0a, 478 + 0xee, 0x00, 0xde, 0x6b, 500 479 0x05, 0xea, 0xb4, 0x00, 501 - 0x33, 0xea, 0x44, 0x59, 480 + 0x33, 0xea, 0x5e, 0x59, 502 481 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, 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, 516 493 0x01, 0x44, 0xd4, 0x31, 517 - 0xff, 0x42, 0xcc, 0x7b, 518 - 0x04, 0x4c, 0xcc, 0x6b, 519 - 0xe0, 0x41, 0x6c, 0x0a, 520 - 0xe0, 0x36, 0xf9, 0x61, 494 + 0xff, 0x42, 0xf6, 0x7b, 495 + 0x04, 0x4c, 0xf6, 0x6b, 496 + 0xe0, 0x41, 0x78, 0x0a, 497 + 0xe0, 0x3c, 0x15, 0x62, 521 498 0xff, 0xea, 0xca, 0x09, 522 499 0x01, 0xe2, 0xc8, 0x31, 523 500 0x01, 0x46, 0xda, 0x35, 524 501 0x01, 0x44, 0xd4, 0x35, 525 502 0x10, 0xea, 0x80, 0x00, 526 - 0x01, 0xe2, 0x62, 0x36, 527 - 0x04, 0xa6, 0xe4, 0x7b, 503 + 0x01, 0xe2, 0x6e, 0x36, 504 + 0x04, 0xa6, 0x0e, 0x7c, 528 505 0xff, 0xea, 0x5a, 0x09, 529 506 0xff, 0xea, 0x4c, 0x0d, 530 - 0x01, 0xa6, 0x02, 0x6c, 531 - 0x10, 0xad, 0x64, 0x78, 532 - 0x80, 0xad, 0xfa, 0x6b, 533 - 0x08, 0xad, 0x64, 0x68, 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, 534 518 0x04, 0x84, 0xf9, 0x30, 535 519 0x00, 0xea, 0x08, 0x81, 536 520 0xff, 0xea, 0xd4, 0x09, 537 521 0x02, 0x84, 0xf9, 0x88, 538 522 0x0d, 0xea, 0x5a, 0x01, 539 523 0x04, 0xa6, 0x4c, 0x05, 540 - 0x04, 0xa6, 0x64, 0x78, 524 + 0x04, 0xa6, 0x84, 0x78, 541 525 0xff, 0xea, 0x5a, 0x09, 542 526 0x03, 0x84, 0x59, 0x89, 543 527 0x03, 0xea, 0x4c, 0x01, 544 - 0x80, 0x1a, 0x64, 0x78, 545 - 0x08, 0x19, 0x64, 0x78, 528 + 0x80, 0x1a, 0x84, 0x78, 529 + 0x08, 0x19, 0x84, 0x78, 546 530 0x08, 0xb0, 0xe0, 0x30, 547 531 0x04, 0xb0, 0xe0, 0x30, 548 532 0x03, 0xb0, 0xf0, 0x30, ··· 561 533 0x00, 0x86, 0x0d, 0x23, 562 534 0x00, 0x87, 0x0f, 0x23, 563 535 0x01, 0x84, 0xc5, 0x31, 564 - 0x80, 0x83, 0x25, 0x7c, 536 + 0x80, 0x83, 0x5d, 0x7c, 565 537 0x02, 0xe2, 0xc4, 0x01, 566 538 0xff, 0xea, 0x4c, 0x09, 567 539 0x01, 0xe2, 0x36, 0x30, 568 540 0xc8, 0x19, 0x32, 0x00, 569 541 0x88, 0x19, 0x32, 0x00, 570 542 0x01, 0xac, 0xd4, 0x99, 571 - 0x00, 0xe2, 0x64, 0x50, 543 + 0x00, 0xe2, 0x84, 0x50, 572 544 0xfe, 0xa6, 0x4c, 0x0d, 573 545 0x0b, 0x98, 0xe1, 0x30, 574 546 0xfd, 0xa4, 0x49, 0x09, 575 - 0x80, 0xa3, 0x39, 0x7c, 547 + 0x80, 0xa3, 0x71, 0x7c, 576 548 0x02, 0xa4, 0x48, 0x01, 577 549 0x01, 0xa4, 0x36, 0x30, 578 550 0xa8, 0xea, 0x32, 0x00, 579 551 0xfd, 0xa4, 0x49, 0x0b, 580 552 0x05, 0xa3, 0x07, 0x33, 581 - 0x80, 0x83, 0x45, 0x6c, 553 + 0x80, 0x83, 0x7d, 0x6c, 582 554 0x02, 0xea, 0x4c, 0x05, 583 555 0xff, 0xea, 0x4c, 0x0d, 584 - 0x00, 0xe2, 0x3e, 0x59, 585 - 0x02, 0xa6, 0xe6, 0x6b, 556 + 0x00, 0xe2, 0x56, 0x59, 557 + 0x02, 0xa6, 0x10, 0x6c, 586 558 0x80, 0xf9, 0xf2, 0x05, 587 - 0xc0, 0x33, 0x53, 0x7c, 588 - 0x03, 0xea, 0x50, 0x59, 559 + 0xc0, 0x39, 0x8b, 0x7c, 560 + 0x03, 0xea, 0x64, 0x59, 589 561 0x03, 0xea, 0x04, 0x00, 590 - 0x20, 0x33, 0x77, 0x7c, 591 - 0x01, 0x84, 0x5d, 0x6c, 592 - 0x06, 0xea, 0x50, 0x59, 562 + 0x20, 0x39, 0xaf, 0x7c, 563 + 0x01, 0x84, 0x95, 0x6c, 564 + 0x06, 0xea, 0x64, 0x59, 593 565 0x06, 0xea, 0x04, 0x00, 594 - 0x00, 0xe2, 0x7a, 0x44, 595 - 0x01, 0x00, 0x60, 0x32, 596 - 0xee, 0x00, 0x66, 0x6c, 566 + 0x00, 0xe2, 0xb2, 0x44, 567 + 0x01, 0x00, 0x6c, 0x32, 568 + 0xee, 0x00, 0x9e, 0x6c, 597 569 0x05, 0xea, 0xb4, 0x00, 598 - 0x33, 0xea, 0x44, 0x59, 570 + 0x33, 0xea, 0x5e, 0x59, 599 571 0x33, 0xea, 0x00, 0x00, 600 572 0x80, 0x3d, 0x7a, 0x00, 601 - 0xfc, 0x42, 0x68, 0x7c, 573 + 0xfc, 0x42, 0xa0, 0x7c, 602 574 0x7f, 0x3d, 0x7a, 0x08, 603 - 0x00, 0x30, 0x45, 0x59, 604 - 0x01, 0x30, 0x01, 0x30, 605 - 0x09, 0xea, 0x50, 0x59, 575 + 0x00, 0x36, 0x5f, 0x59, 576 + 0x01, 0x36, 0x01, 0x30, 577 + 0x09, 0xea, 0x64, 0x59, 606 578 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, 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, 622 594 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, 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, 631 603 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, 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, 640 612 0x03, 0x68, 0x00, 0x37, 641 613 0x01, 0x84, 0x09, 0x07, 642 - 0x80, 0x1b, 0xc4, 0x7c, 643 - 0x80, 0x84, 0xc5, 0x6c, 614 + 0x80, 0x1b, 0xfc, 0x7c, 615 + 0x80, 0x84, 0xfd, 0x6c, 644 616 0xff, 0x85, 0x0b, 0x1b, 645 617 0xff, 0x86, 0x0d, 0x23, 646 618 0xff, 0x87, 0x0f, 0x23, 647 619 0xf8, 0x1b, 0x08, 0x0b, 648 620 0xff, 0xea, 0x06, 0x0b, 649 621 0x03, 0x68, 0x00, 0x37, 650 - 0x00, 0xe2, 0xc4, 0x58, 622 + 0x00, 0xe2, 0xd6, 0x58, 651 623 0x10, 0xea, 0x18, 0x00, 652 624 0xf9, 0xd9, 0xb2, 0x0d, 653 625 0x01, 0xd9, 0xb2, 0x05, 654 626 0x01, 0x52, 0x48, 0x31, 655 - 0x20, 0xa4, 0xee, 0x7c, 656 - 0x20, 0x5b, 0xee, 0x7c, 657 - 0x80, 0xf9, 0xfc, 0x7c, 627 + 0x20, 0xa4, 0x26, 0x7d, 628 + 0x20, 0x5b, 0x26, 0x7d, 629 + 0x80, 0xf9, 0x34, 0x7d, 658 630 0x02, 0xea, 0xb4, 0x00, 659 631 0x11, 0x00, 0x00, 0x10, 660 - 0x04, 0x19, 0x08, 0x7d, 632 + 0x04, 0x19, 0x40, 0x7d, 661 633 0xdf, 0x19, 0x32, 0x08, 662 - 0x60, 0x5b, 0xe6, 0x6c, 663 - 0x01, 0x4c, 0xe2, 0x7c, 634 + 0x60, 0x5b, 0x40, 0x6d, 635 + 0x01, 0x4c, 0x1a, 0x7d, 664 636 0x20, 0x19, 0x32, 0x00, 665 637 0x01, 0xd9, 0xb2, 0x05, 666 638 0x02, 0xea, 0xb4, 0x00, 667 639 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, 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, 673 645 0x0e, 0xea, 0x04, 0x00, 674 - 0x80, 0xf9, 0xea, 0x6c, 646 + 0x80, 0xf9, 0x22, 0x6d, 675 647 0xdf, 0x5c, 0xb8, 0x08, 676 648 0x01, 0xd9, 0xb2, 0x05, 677 - 0x01, 0xa4, 0xe5, 0x6d, 678 - 0x00, 0xe2, 0x30, 0x5c, 679 - 0x00, 0xe2, 0x34, 0x5d, 649 + 0x01, 0xa4, 0x1d, 0x6e, 650 + 0x00, 0xe2, 0x68, 0x5c, 651 + 0x00, 0xe2, 0x6c, 0x5d, 680 652 0x01, 0x90, 0x21, 0x1b, 681 653 0x01, 0xd9, 0xb2, 0x05, 682 - 0x00, 0xe2, 0x32, 0x5b, 654 + 0x00, 0xe2, 0x52, 0x5b, 683 655 0xf3, 0x96, 0xd5, 0x19, 684 - 0x00, 0xe2, 0x18, 0x55, 685 - 0x80, 0x96, 0x19, 0x6d, 686 - 0x0f, 0xea, 0x50, 0x59, 656 + 0x00, 0xe2, 0x50, 0x55, 657 + 0x80, 0x96, 0x51, 0x6d, 658 + 0x0f, 0xea, 0x64, 0x59, 687 659 0x0f, 0xea, 0x04, 0x00, 688 - 0x00, 0xe2, 0x20, 0x45, 660 + 0x00, 0xe2, 0x58, 0x45, 689 661 0x04, 0x8c, 0xe1, 0x30, 690 662 0x01, 0xea, 0xf2, 0x00, 691 663 0x02, 0xea, 0x36, 0x00, 692 664 0xa8, 0xea, 0x32, 0x00, 693 - 0xff, 0x97, 0x27, 0x7d, 694 - 0x14, 0xea, 0x50, 0x59, 665 + 0xff, 0x97, 0x5f, 0x7d, 666 + 0x14, 0xea, 0x64, 0x59, 695 667 0x14, 0xea, 0x04, 0x00, 696 - 0x00, 0xe2, 0x96, 0x5d, 668 + 0x00, 0xe2, 0xce, 0x5d, 697 669 0x01, 0xd9, 0xb2, 0x05, 698 670 0x09, 0x80, 0xe1, 0x30, 699 671 0x02, 0xea, 0x36, 0x00, 700 672 0xa8, 0xea, 0x32, 0x00, 701 - 0x00, 0xe2, 0x8e, 0x5d, 673 + 0x00, 0xe2, 0xc6, 0x5d, 702 674 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, 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, 718 690 0x02, 0x19, 0x32, 0x00, 719 691 0x01, 0x5b, 0x40, 0x31, 720 - 0x00, 0xe2, 0xb2, 0x5c, 721 - 0x00, 0xe2, 0x9e, 0x5b, 692 + 0x00, 0xe2, 0xea, 0x5c, 693 + 0x00, 0xe2, 0xcc, 0x5b, 722 694 0x20, 0xea, 0xb6, 0x00, 723 - 0x00, 0xe2, 0xe0, 0x5b, 695 + 0x00, 0xe2, 0x0a, 0x5c, 724 696 0x20, 0x5c, 0xb8, 0x00, 725 - 0x04, 0x19, 0x68, 0x6d, 726 - 0x01, 0x1a, 0x68, 0x6d, 727 - 0x00, 0xe2, 0x3e, 0x59, 728 - 0x01, 0x1a, 0x64, 0x78, 697 + 0x04, 0x19, 0xa0, 0x6d, 698 + 0x01, 0x1a, 0xa0, 0x6d, 699 + 0x00, 0xe2, 0x56, 0x59, 700 + 0x01, 0x1a, 0x84, 0x78, 729 701 0x80, 0xf9, 0xf2, 0x01, 730 - 0x20, 0xa0, 0xcc, 0x7d, 702 + 0x20, 0xa0, 0x04, 0x7e, 731 703 0xff, 0x90, 0x21, 0x1b, 732 - 0x08, 0x92, 0x43, 0x6b, 704 + 0x08, 0x92, 0x63, 0x6b, 733 705 0x02, 0xea, 0xb4, 0x04, 734 706 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, 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, 744 716 0x80, 0xf9, 0xf2, 0x01, 745 717 0xff, 0x90, 0x21, 0x1b, 746 - 0x08, 0x92, 0x43, 0x6b, 718 + 0x08, 0x92, 0x63, 0x6b, 747 719 0x02, 0xea, 0xb4, 0x04, 748 - 0x00, 0xe2, 0x3e, 0x59, 749 - 0x01, 0x1b, 0x64, 0x78, 720 + 0x00, 0xe2, 0x56, 0x59, 721 + 0x01, 0x1b, 0x84, 0x78, 750 722 0x80, 0xf9, 0xf2, 0x01, 751 723 0x02, 0xea, 0xb4, 0x04, 752 - 0x00, 0xe2, 0x3e, 0x59, 753 - 0x01, 0x1b, 0xaa, 0x6d, 754 - 0x40, 0x5b, 0xb8, 0x7d, 755 - 0x01, 0x1b, 0xaa, 0x6d, 724 + 0x00, 0xe2, 0x56, 0x59, 725 + 0x01, 0x1b, 0xe2, 0x6d, 726 + 0x40, 0x5b, 0xf0, 0x7d, 727 + 0x01, 0x1b, 0xe2, 0x6d, 756 728 0x02, 0x19, 0x32, 0x00, 757 - 0x01, 0x1a, 0x64, 0x78, 729 + 0x01, 0x1a, 0x84, 0x78, 758 730 0x80, 0xf9, 0xf2, 0x01, 759 731 0xff, 0xea, 0x10, 0x03, 760 732 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, 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, 768 740 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, 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, 774 746 0x01, 0x90, 0x21, 0x1b, 775 747 0x30, 0x3f, 0xc0, 0x09, 776 - 0x30, 0xe0, 0x64, 0x60, 777 - 0x40, 0x4b, 0x64, 0x68, 748 + 0x30, 0xe0, 0x84, 0x60, 749 + 0x40, 0x4b, 0x84, 0x68, 778 750 0xff, 0xea, 0x52, 0x01, 779 - 0xee, 0x00, 0xd2, 0x6d, 751 + 0xee, 0x00, 0x0c, 0x6e, 780 752 0x80, 0xf9, 0xf2, 0x01, 781 753 0xff, 0x90, 0x21, 0x1b, 782 754 0x02, 0xea, 0xb4, 0x00, 783 755 0x20, 0xea, 0x9a, 0x00, 784 - 0xf3, 0x42, 0xde, 0x6d, 785 - 0x12, 0xea, 0x50, 0x59, 756 + 0xf3, 0x42, 0x16, 0x6e, 757 + 0x12, 0xea, 0x64, 0x59, 786 758 0x12, 0xea, 0x04, 0x00, 787 - 0x00, 0xe2, 0xf8, 0x41, 788 - 0x0d, 0xea, 0x50, 0x59, 759 + 0x00, 0xe2, 0x14, 0x42, 760 + 0x0d, 0xea, 0x64, 0x59, 789 761 0x0d, 0xea, 0x04, 0x00, 790 - 0x00, 0xe2, 0xf8, 0x41, 762 + 0x00, 0xe2, 0x14, 0x42, 791 763 0x01, 0x90, 0x21, 0x1b, 792 - 0x11, 0xea, 0x50, 0x59, 764 + 0x11, 0xea, 0x64, 0x59, 793 765 0x11, 0xea, 0x04, 0x00, 794 - 0x00, 0xe2, 0x32, 0x5b, 766 + 0x00, 0xe2, 0x52, 0x5b, 795 767 0x08, 0x5a, 0xb4, 0x00, 796 - 0x00, 0xe2, 0x0c, 0x5e, 768 + 0x00, 0xe2, 0x44, 0x5e, 797 769 0xa8, 0xea, 0x32, 0x00, 798 - 0x00, 0xe2, 0x3e, 0x59, 799 - 0x80, 0x1a, 0xfa, 0x7d, 800 - 0x00, 0xe2, 0x0c, 0x5e, 770 + 0x00, 0xe2, 0x56, 0x59, 771 + 0x80, 0x1a, 0x32, 0x7e, 772 + 0x00, 0xe2, 0x44, 0x5e, 801 773 0x80, 0x19, 0x32, 0x00, 802 - 0x40, 0x5b, 0x00, 0x6e, 803 - 0x08, 0x5a, 0x00, 0x7e, 804 - 0x20, 0x4d, 0x64, 0x78, 774 + 0x40, 0x5b, 0x38, 0x6e, 775 + 0x08, 0x5a, 0x38, 0x7e, 776 + 0x20, 0x4d, 0x84, 0x78, 805 777 0x02, 0x84, 0x09, 0x03, 806 - 0x40, 0x5b, 0xcc, 0x7d, 778 + 0x40, 0x5b, 0x04, 0x7e, 807 779 0xff, 0x90, 0x21, 0x1b, 808 780 0x80, 0xf9, 0xf2, 0x01, 809 - 0x08, 0x92, 0x43, 0x6b, 781 + 0x08, 0x92, 0x63, 0x6b, 810 782 0x02, 0xea, 0xb4, 0x04, 811 - 0x01, 0x38, 0xe1, 0x30, 812 - 0x05, 0x39, 0xe3, 0x98, 783 + 0x01, 0x40, 0xe1, 0x30, 784 + 0x05, 0x41, 0xe3, 0x98, 813 785 0x01, 0xe0, 0xf4, 0x31, 814 786 0xff, 0xea, 0xc0, 0x09, 815 - 0x00, 0x3a, 0xe5, 0x20, 816 - 0x00, 0x3b, 0xe7, 0x20, 787 + 0x00, 0x42, 0xe5, 0x20, 788 + 0x00, 0x43, 0xe7, 0x20, 817 789 0x01, 0xfa, 0xc0, 0x31, 818 790 0x04, 0xea, 0xe8, 0x30, 819 791 0xff, 0xea, 0xf0, 0x08, ··· 822 794 }; 823 795 824 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 + 825 805 static ahd_patch_func_t ahd_patch22_func; 826 806 827 807 static int 828 808 ahd_patch22_func(struct ahd_softc *ahd) 829 809 { 830 - return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0); 810 + return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0); 831 811 } 832 812 833 813 static ahd_patch_func_t ahd_patch21_func; ··· 843 807 static int 844 808 ahd_patch21_func(struct ahd_softc *ahd) 845 809 { 846 - return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0); 810 + return ((ahd->flags & AHD_INITIATORROLE) != 0); 847 811 } 848 812 849 813 static ahd_patch_func_t ahd_patch20_func; ··· 851 815 static int 852 816 ahd_patch20_func(struct ahd_softc *ahd) 853 817 { 854 - return ((ahd->features & AHD_RTI) == 0); 818 + return ((ahd->flags & AHD_TARGETROLE) != 0); 855 819 } 856 820 857 821 static ahd_patch_func_t ahd_patch19_func; ··· 859 823 static int 860 824 ahd_patch19_func(struct ahd_softc *ahd) 861 825 { 862 - return ((ahd->flags & AHD_INITIATORROLE) != 0); 826 + return ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0); 863 827 } 864 828 865 829 static ahd_patch_func_t ahd_patch18_func; ··· 867 831 static int 868 832 ahd_patch18_func(struct ahd_softc *ahd) 869 833 { 870 - return ((ahd->flags & AHD_TARGETROLE) != 0); 834 + return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0); 871 835 } 872 836 873 837 static ahd_patch_func_t ahd_patch17_func; ··· 875 839 static int 876 840 ahd_patch17_func(struct ahd_softc *ahd) 877 841 { 878 - return ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0); 842 + return ((ahd->flags & AHD_39BIT_ADDRESSING) != 0); 879 843 } 880 844 881 845 static ahd_patch_func_t ahd_patch16_func; ··· 883 847 static int 884 848 ahd_patch16_func(struct ahd_softc *ahd) 885 849 { 886 - return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0); 850 + return ((ahd->flags & AHD_64BIT_ADDRESSING) != 0); 887 851 } 888 852 889 853 static ahd_patch_func_t ahd_patch15_func; ··· 891 855 static int 892 856 ahd_patch15_func(struct ahd_softc *ahd) 893 857 { 894 - return ((ahd->flags & AHD_39BIT_ADDRESSING) != 0); 858 + return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0); 895 859 } 896 860 897 861 static ahd_patch_func_t ahd_patch14_func; ··· 899 863 static int 900 864 ahd_patch14_func(struct ahd_softc *ahd) 901 865 { 902 - return ((ahd->flags & AHD_64BIT_ADDRESSING) != 0); 866 + return ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0); 903 867 } 904 868 905 869 static ahd_patch_func_t ahd_patch13_func; ··· 907 871 static int 908 872 ahd_patch13_func(struct ahd_softc *ahd) 909 873 { 910 - return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0); 874 + return ((ahd->features & AHD_RTI) == 0); 911 875 } 912 876 913 877 static ahd_patch_func_t ahd_patch12_func; ··· 915 879 static int 916 880 ahd_patch12_func(struct ahd_softc *ahd) 917 881 { 918 - return ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0); 882 + return ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0); 919 883 } 920 884 921 885 static ahd_patch_func_t ahd_patch11_func; ··· 923 887 static int 924 888 ahd_patch11_func(struct ahd_softc *ahd) 925 889 { 926 - return ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0); 890 + return ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0); 927 891 } 928 892 929 893 static ahd_patch_func_t ahd_patch10_func; ··· 931 895 static int 932 896 ahd_patch10_func(struct ahd_softc *ahd) 933 897 { 934 - return ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0); 898 + return ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0); 935 899 } 936 900 937 901 static ahd_patch_func_t ahd_patch9_func; ··· 939 903 static int 940 904 ahd_patch9_func(struct ahd_softc *ahd) 941 905 { 942 - return ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0); 906 + return ((ahd->features & AHD_FAST_CDB_DELIVERY) != 0); 943 907 } 944 908 945 909 static ahd_patch_func_t ahd_patch8_func; ··· 1028 992 { ahd_patch0_func, 5, 1, 1 }, 1029 993 { ahd_patch2_func, 6, 1, 2 }, 1030 994 { 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 } 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 } 1154 1117 }; 1155 1118 1156 1119 static struct cs { 1157 1120 uint16_t begin; 1158 1121 uint16_t end; 1159 1122 } 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 } 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 } 1172 1138 }; 1173 1139 1174 1140 static const int num_critical_sections = sizeof(critical_sections)
+14 -14
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 375 375 struct scsi_cmnd *cmd); 376 376 static void ahc_linux_sem_timeout(u_long arg); 377 377 static void ahc_linux_freeze_simq(struct ahc_softc *ahc); 378 - static void ahc_linux_release_simq(u_long arg); 378 + static void ahc_linux_release_simq(struct ahc_softc *ahc); 379 379 static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag); 380 380 static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc); 381 381 static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc, ··· 1073 1073 return (ENOMEM); 1074 1074 1075 1075 *((struct ahc_softc **)host->hostdata) = ahc; 1076 - ahc_lock(ahc, &s); 1077 1076 ahc->platform_data->host = host; 1078 1077 host->can_queue = AHC_MAX_QUEUE; 1079 1078 host->cmd_per_lun = 2; ··· 1083 1084 host->max_lun = AHC_NUM_LUNS; 1084 1085 host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0; 1085 1086 host->sg_tablesize = AHC_NSEG; 1087 + ahc_lock(ahc, &s); 1086 1088 ahc_set_unit(ahc, ahc_linux_unit++); 1089 + ahc_unlock(ahc, &s); 1087 1090 sprintf(buf, "scsi%d", host->host_no); 1088 1091 new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); 1089 1092 if (new_name != NULL) { ··· 1095 1094 host->unique_id = ahc->unit; 1096 1095 ahc_linux_initialize_scsi_bus(ahc); 1097 1096 ahc_intr_enable(ahc, TRUE); 1098 - ahc_unlock(ahc, &s); 1099 1097 1100 1098 host->transportt = ahc_linux_transport_template; 1101 1099 ··· 1120 1120 { 1121 1121 int i; 1122 1122 int numtarg; 1123 + unsigned long s; 1123 1124 1124 1125 i = 0; 1125 1126 numtarg = 0; 1127 + 1128 + ahc_lock(ahc, &s); 1126 1129 1127 1130 if (aic7xxx_no_reset != 0) 1128 1131 ahc->flags &= ~(AHC_RESET_BUS_A|AHC_RESET_BUS_B); ··· 1173 1170 ahc_update_neg_request(ahc, &devinfo, tstate, 1174 1171 tinfo, AHC_NEG_ALWAYS); 1175 1172 } 1173 + ahc_unlock(ahc, &s); 1176 1174 /* Give the bus some time to recover */ 1177 1175 if ((ahc->flags & (AHC_RESET_BUS_A|AHC_RESET_BUS_B)) != 0) { 1178 1176 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); 1177 + msleep(AIC7XXX_RESET_DELAY); 1178 + ahc_linux_release_simq(ahc); 1186 1179 } 1187 1180 } 1188 1181 ··· 2058 2059 static void 2059 2060 ahc_linux_freeze_simq(struct ahc_softc *ahc) 2060 2061 { 2062 + unsigned long s; 2063 + 2064 + ahc_lock(ahc, &s); 2061 2065 ahc->platform_data->qfrozen++; 2062 2066 if (ahc->platform_data->qfrozen == 1) { 2063 2067 scsi_block_requests(ahc->platform_data->host); ··· 2070 2068 CAM_LUN_WILDCARD, SCB_LIST_NULL, 2071 2069 ROLE_INITIATOR, CAM_REQUEUE_REQ); 2072 2070 } 2071 + ahc_unlock(ahc, &s); 2073 2072 } 2074 2073 2075 2074 static void 2076 - ahc_linux_release_simq(u_long arg) 2075 + ahc_linux_release_simq(struct ahc_softc *ahc) 2077 2076 { 2078 - struct ahc_softc *ahc; 2079 2077 u_long s; 2080 2078 int unblock_reqs; 2081 - 2082 - ahc = (struct ahc_softc *)arg; 2083 2079 2084 2080 unblock_reqs = 0; 2085 2081 ahc_lock(ahc, &s);
-25
drivers/scsi/aic7xxx/aic7xxx_osm.h
··· 223 223 */ 224 224 #define ahc_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op) 225 225 226 - /************************** Timer DataStructures ******************************/ 227 - typedef struct timer_list ahc_timer_t; 228 - 229 226 /********************************** Includes **********************************/ 230 227 #ifdef CONFIG_AIC7XXX_REG_PRETTY_PRINT 231 228 #define AIC_DEBUG_REGISTERS 1 ··· 232 235 #include "aic7xxx.h" 233 236 234 237 /***************************** 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 238 static __inline void 256 239 ahc_scb_timer_reset(struct scb *scb, u_int usec) 257 240 { 258 - mod_timer(&scb->io_ctx->eh_timeout, jiffies + (usec * HZ)/1000000); 259 241 } 260 242 261 243 /***************************** SMP support ************************************/ ··· 369 393 370 394 spinlock_t spin_lock; 371 395 u_int qfrozen; 372 - struct timer_list reset_timer; 373 396 struct semaphore eh_sem; 374 397 struct Scsi_Host *host; /* pointer to scsi host */ 375 398 #define AHC_LINUX_NOIRQ ((uint32_t)~0)
+21 -3
drivers/scsi/aic7xxx/aic7xxx_pci.c
··· 39 39 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 40 * POSSIBILITY OF SUCH DAMAGES. 41 41 * 42 - * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#69 $ 43 - * 44 - * $FreeBSD$ 42 + * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $ 45 43 */ 46 44 47 45 #ifdef __linux__ ··· 389 391 ID_AIC7892_ARO, 390 392 ID_ALL_MASK, 391 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", 392 400 ahc_aic7892_setup 393 401 }, 394 402 /* aic7895 based controllers */ ··· 1197 1193 * use for this test. 1198 1194 */ 1199 1195 hcntrl = ahc_inb(ahc, HCNTRL); 1196 + 1200 1197 if (hcntrl == 0xFF) 1201 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 + } 1202 1208 1203 1209 /* 1204 1210 * Next create a situation where write combining ··· 1321 1307 sd.sd_chip = C56_66; 1322 1308 } 1323 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; 1324 1314 } 1325 1315 1326 1316 if (!have_seeprom) {
+1
drivers/scsi/aic7xxx/aic7xxx_pci.h
··· 105 105 #define ID_AHA_29160C 0x0080900562209005ull 106 106 #define ID_AHA_29160B 0x00809005E2209005ull 107 107 #define ID_AHA_19160B 0x0081900562A19005ull 108 + #define ID_AHA_2915_30LP 0x0082900502109005ull 108 109 109 110 #define ID_AIC7896 0x005F9005FFFF9005ull 110 111 #define ID_AIC7896_ARO 0x00539005FFFF9005ull
+17 -16
drivers/scsi/ch.c
··· 22 22 #include <linux/completion.h> 23 23 #include <linux/compat.h> 24 24 #include <linux/chio.h> /* here are all the ioctls */ 25 + #include <linux/mutex.h> 25 26 26 27 #include <scsi/scsi.h> 27 28 #include <scsi/scsi_cmnd.h> ··· 112 111 u_int counts[CH_TYPES]; 113 112 u_int unit_attention; 114 113 u_int voltags; 115 - struct semaphore lock; 114 + struct mutex lock; 116 115 } scsi_changer; 117 116 118 117 static LIST_HEAD(ch_devlist); ··· 566 565 u_char data[16]; 567 566 unsigned int i; 568 567 569 - down(&ch->lock); 568 + mutex_lock(&ch->lock); 570 569 for (i = 0; i < ch->counts[type]; i++) { 571 570 if (0 != ch_read_element_status 572 571 (ch, ch->firsts[type]+i,data)) { ··· 583 582 if (0 != retval) 584 583 break; 585 584 } 586 - up(&ch->lock); 585 + mutex_unlock(&ch->lock); 587 586 return retval; 588 587 } 589 588 ··· 688 687 dprintk("CHIOPOSITION: invalid parameter\n"); 689 688 return -EBADSLT; 690 689 } 691 - down(&ch->lock); 690 + mutex_lock(&ch->lock); 692 691 retval = ch_position(ch,0, 693 692 ch->firsts[pos.cp_type] + pos.cp_unit, 694 693 pos.cp_flags & CP_INVERT); 695 - up(&ch->lock); 694 + mutex_unlock(&ch->lock); 696 695 return retval; 697 696 } 698 697 ··· 709 708 return -EBADSLT; 710 709 } 711 710 712 - down(&ch->lock); 711 + mutex_lock(&ch->lock); 713 712 retval = ch_move(ch,0, 714 713 ch->firsts[mv.cm_fromtype] + mv.cm_fromunit, 715 714 ch->firsts[mv.cm_totype] + mv.cm_tounit, 716 715 mv.cm_flags & CM_INVERT); 717 - up(&ch->lock); 716 + mutex_unlock(&ch->lock); 718 717 return retval; 719 718 } 720 719 ··· 732 731 return -EBADSLT; 733 732 } 734 733 735 - down(&ch->lock); 734 + mutex_lock(&ch->lock); 736 735 retval = ch_exchange 737 736 (ch,0, 738 737 ch->firsts[mv.ce_srctype] + mv.ce_srcunit, 739 738 ch->firsts[mv.ce_fdsttype] + mv.ce_fdstunit, 740 739 ch->firsts[mv.ce_sdsttype] + mv.ce_sdstunit, 741 740 mv.ce_flags & CE_INVERT1, mv.ce_flags & CE_INVERT2); 742 - up(&ch->lock); 741 + mutex_unlock(&ch->lock); 743 742 return retval; 744 743 } 745 744 ··· 773 772 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); 774 773 if (!buffer) 775 774 return -ENOMEM; 776 - down(&ch->lock); 775 + mutex_lock(&ch->lock); 777 776 778 777 voltag_retry: 779 778 memset(cmd,0,sizeof(cmd)); ··· 824 823 goto voltag_retry; 825 824 } 826 825 kfree(buffer); 827 - up(&ch->lock); 826 + mutex_unlock(&ch->lock); 828 827 829 828 if (copy_to_user(argp, &cge, sizeof (cge))) 830 829 return -EFAULT; ··· 833 832 834 833 case CHIOINITELEM: 835 834 { 836 - down(&ch->lock); 835 + mutex_lock(&ch->lock); 837 836 retval = ch_init_elem(ch); 838 - up(&ch->lock); 837 + mutex_unlock(&ch->lock); 839 838 return retval; 840 839 } 841 840 ··· 852 851 return -EBADSLT; 853 852 } 854 853 elem = ch->firsts[csv.csv_type] + csv.csv_unit; 855 - down(&ch->lock); 854 + mutex_lock(&ch->lock); 856 855 retval = ch_set_voltag(ch, elem, 857 856 csv.csv_flags & CSV_AVOLTAG, 858 857 csv.csv_flags & CSV_CLEARTAG, 859 858 csv.csv_voltag); 860 - up(&ch->lock); 859 + mutex_unlock(&ch->lock); 861 860 return retval; 862 861 } 863 862 ··· 930 929 memset(ch,0,sizeof(*ch)); 931 930 ch->minor = ch_devcount; 932 931 sprintf(ch->name,"ch%d",ch->minor); 933 - init_MUTEX(&ch->lock); 932 + mutex_init(&ch->lock); 934 933 ch->device = sd; 935 934 ch_readconfig(ch); 936 935 if (init)
+24 -21
drivers/scsi/dpt_i2o.c
··· 61 61 #include <linux/timer.h> 62 62 #include <linux/string.h> 63 63 #include <linux/ioport.h> 64 + #include <linux/mutex.h> 64 65 65 66 #include <asm/processor.h> /* for boot_cpu_data */ 66 67 #include <asm/pgtable.h> ··· 107 106 *============================================================================ 108 107 */ 109 108 110 - static DECLARE_MUTEX(adpt_configuration_lock); 109 + static DEFINE_MUTEX(adpt_configuration_lock); 111 110 112 111 static struct i2o_sys_tbl *sys_tbl = NULL; 113 112 static int sys_tbl_ind = 0; ··· 538 537 */ 539 538 540 539 // Find HBA (host bus adapter) we are looking for 541 - down(&adpt_configuration_lock); 540 + mutex_lock(&adpt_configuration_lock); 542 541 for (pHba = hba_chain; pHba; pHba = pHba->next) { 543 542 if (pHba->host == host) { 544 543 break; /* found adapter */ 545 544 } 546 545 } 547 - up(&adpt_configuration_lock); 546 + mutex_unlock(&adpt_configuration_lock); 548 547 if (pHba == NULL) { 549 548 return 0; 550 549 } ··· 899 898 if(pci_enable_device(pDev)) { 900 899 return -EINVAL; 901 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 + 902 907 pci_set_master(pDev); 903 908 if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && 904 909 pci_set_dma_mask(pDev, 0xffffffffULL)) ··· 930 923 raptorFlag = TRUE; 931 924 } 932 925 933 - if (pci_request_regions(pDev, "dpt_i2o")) { 934 - PERROR("dpti: adpt_config_hba: pci request region failed\n"); 935 - return -EINVAL; 936 - } 937 926 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); 938 927 if (!base_addr_virt) { 939 928 pci_release_regions(pDev); ··· 961 958 } 962 959 memset(pHba, 0, sizeof(adpt_hba)); 963 960 964 - down(&adpt_configuration_lock); 961 + mutex_lock(&adpt_configuration_lock); 965 962 966 963 if(hba_chain != NULL){ 967 964 for(p = hba_chain; p->next; p = p->next); ··· 974 971 sprintf(pHba->name, "dpti%d", hba_count); 975 972 hba_count++; 976 973 977 - up(&adpt_configuration_lock); 974 + mutex_unlock(&adpt_configuration_lock); 978 975 979 976 pHba->pDev = pDev; 980 977 pHba->base_addr_phys = base_addr0_phys; ··· 1030 1027 struct adpt_device* pNext; 1031 1028 1032 1029 1033 - down(&adpt_configuration_lock); 1030 + mutex_lock(&adpt_configuration_lock); 1034 1031 // scsi_unregister calls our adpt_release which 1035 1032 // does a quiese 1036 1033 if(pHba->host){ ··· 1049 1046 } 1050 1047 1051 1048 hba_count--; 1052 - up(&adpt_configuration_lock); 1049 + mutex_unlock(&adpt_configuration_lock); 1053 1050 1054 1051 iounmap(pHba->base_addr_virt); 1055 1052 pci_release_regions(pHba->pDev); ··· 1552 1549 1553 1550 static int adpt_i2o_install_device(adpt_hba* pHba, struct i2o_device *d) 1554 1551 { 1555 - down(&adpt_configuration_lock); 1552 + mutex_lock(&adpt_configuration_lock); 1556 1553 d->controller=pHba; 1557 1554 d->owner=NULL; 1558 1555 d->next=pHba->devices; ··· 1563 1560 pHba->devices=d; 1564 1561 *d->dev_name = 0; 1565 1562 1566 - up(&adpt_configuration_lock); 1563 + mutex_unlock(&adpt_configuration_lock); 1567 1564 return 0; 1568 1565 } 1569 1566 ··· 1578 1575 if (minor >= hba_count) { 1579 1576 return -ENXIO; 1580 1577 } 1581 - down(&adpt_configuration_lock); 1578 + mutex_lock(&adpt_configuration_lock); 1582 1579 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1583 1580 if (pHba->unit == minor) { 1584 1581 break; /* found adapter */ 1585 1582 } 1586 1583 } 1587 1584 if (pHba == NULL) { 1588 - up(&adpt_configuration_lock); 1585 + mutex_unlock(&adpt_configuration_lock); 1589 1586 return -ENXIO; 1590 1587 } 1591 1588 1592 1589 // if(pHba->in_use){ 1593 - // up(&adpt_configuration_lock); 1590 + // mutex_unlock(&adpt_configuration_lock); 1594 1591 // return -EBUSY; 1595 1592 // } 1596 1593 1597 1594 pHba->in_use = 1; 1598 - up(&adpt_configuration_lock); 1595 + mutex_unlock(&adpt_configuration_lock); 1599 1596 1600 1597 return 0; 1601 1598 } ··· 1609 1606 if (minor >= hba_count) { 1610 1607 return -ENXIO; 1611 1608 } 1612 - down(&adpt_configuration_lock); 1609 + mutex_lock(&adpt_configuration_lock); 1613 1610 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1614 1611 if (pHba->unit == minor) { 1615 1612 break; /* found adapter */ 1616 1613 } 1617 1614 } 1618 - up(&adpt_configuration_lock); 1615 + mutex_unlock(&adpt_configuration_lock); 1619 1616 if (pHba == NULL) { 1620 1617 return -ENXIO; 1621 1618 } ··· 1913 1910 if (minor >= DPTI_MAX_HBA){ 1914 1911 return -ENXIO; 1915 1912 } 1916 - down(&adpt_configuration_lock); 1913 + mutex_lock(&adpt_configuration_lock); 1917 1914 for (pHba = hba_chain; pHba; pHba = pHba->next) { 1918 1915 if (pHba->unit == minor) { 1919 1916 break; /* found adapter */ 1920 1917 } 1921 1918 } 1922 - up(&adpt_configuration_lock); 1919 + mutex_unlock(&adpt_configuration_lock); 1923 1920 if(pHba == NULL){ 1924 1921 return -ENXIO; 1925 1922 }
+4 -4
drivers/scsi/hosts.c
··· 156 156 void scsi_remove_host(struct Scsi_Host *shost) 157 157 { 158 158 unsigned long flags; 159 - down(&shost->scan_mutex); 159 + mutex_lock(&shost->scan_mutex); 160 160 spin_lock_irqsave(shost->host_lock, flags); 161 161 if (scsi_host_set_state(shost, SHOST_CANCEL)) 162 162 if (scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY)) { 163 163 spin_unlock_irqrestore(shost->host_lock, flags); 164 - up(&shost->scan_mutex); 164 + mutex_unlock(&shost->scan_mutex); 165 165 return; 166 166 } 167 167 spin_unlock_irqrestore(shost->host_lock, flags); 168 - up(&shost->scan_mutex); 168 + mutex_unlock(&shost->scan_mutex); 169 169 scsi_forget_host(shost); 170 170 scsi_proc_host_rm(shost); 171 171 ··· 320 320 INIT_LIST_HEAD(&shost->starved_list); 321 321 init_waitqueue_head(&shost->host_wait); 322 322 323 - init_MUTEX(&shost->scan_mutex); 323 + mutex_init(&shost->scan_mutex); 324 324 325 325 shost->host_no = scsi_host_next_hn++; /* XXX(hch): still racy */ 326 326 shost->dma_channel = 0xff;
+3
drivers/scsi/ips.c
··· 1319 1319 min = ha->max_cmds - 1; 1320 1320 scsi_adjust_queue_depth(SDptr, MSG_ORDERED_TAG, min); 1321 1321 } 1322 + 1323 + SDptr->skip_ms_page_8 = 1; 1324 + SDptr->skip_ms_page_3f = 1; 1322 1325 return 0; 1323 1326 } 1324 1327 #endif
+147 -156
drivers/scsi/iscsi_tcp.c
··· 33 33 #include <linux/delay.h> 34 34 #include <linux/kfifo.h> 35 35 #include <linux/scatterlist.h> 36 + #include <linux/mutex.h> 36 37 #include <net/tcp.h> 37 38 #include <scsi/scsi_cmnd.h> 38 39 #include <scsi/scsi_device.h> ··· 87 86 { 88 87 sg_init_one(&ibuf->sg, (u8 *)vbuf, size); 89 88 ibuf->sent = 0; 89 + ibuf->use_sendmsg = 0; 90 90 } 91 91 92 92 static inline void 93 93 iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size) 94 94 { 95 - ibuf->sg.page = (void*)vbuf; 96 - ibuf->sg.offset = (unsigned int)-1; 95 + ibuf->sg.page = virt_to_page(vbuf); 96 + ibuf->sg.offset = offset_in_page(vbuf); 97 97 ibuf->sg.length = size; 98 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; 99 + ibuf->use_sendmsg = 1; 105 100 } 106 101 107 102 static inline void 108 103 iscsi_buf_init_sg(struct iscsi_buf *ibuf, struct scatterlist *sg) 109 104 { 105 + ibuf->sg.page = sg->page; 106 + ibuf->sg.offset = sg->offset; 107 + ibuf->sg.length = sg->length; 110 108 /* 111 109 * Fastpath: sg element fits into single page 112 110 */ 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); 111 + if (sg->length + sg->offset <= PAGE_SIZE && !PageSlab(sg->page)) 112 + ibuf->use_sendmsg = 0; 113 + else 114 + ibuf->use_sendmsg = 1; 119 115 ibuf->sent = 0; 120 116 } 121 117 ··· 354 356 struct scsi_cmnd *sc = ctask->sc; 355 357 356 358 conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1; 357 - if (rhdr->flags & ISCSI_FLAG_CMD_UNDERFLOW) { 359 + if (rhdr->flags & ISCSI_FLAG_DATA_UNDERFLOW) { 358 360 int res_count = be32_to_cpu(rhdr->residual_count); 359 361 360 362 if (res_count > 0 && ··· 364 366 } else 365 367 sc->result = (DID_BAD_TARGET << 16) | 366 368 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) { 369 + } else if (rhdr->flags & ISCSI_FLAG_DATA_OVERFLOW) { 370 370 sc->resid = be32_to_cpu(rhdr->residual_count); 371 371 sc->result = (DID_OK << 16) | rhdr->cmd_status; 372 372 } else ··· 525 529 __kfifo_put(ctask->r2tqueue, (void*)&r2t, sizeof(void*)); 526 530 __kfifo_put(conn->writequeue, (void*)&ctask, sizeof(void*)); 527 531 528 - schedule_work(&conn->xmitwork); 532 + scsi_queue_work(session->host, &conn->xmitwork); 529 533 conn->r2t_pdus_cnt++; 530 534 spin_unlock(&session->lock); 531 535 ··· 682 686 switch(conn->in.opcode) { 683 687 case ISCSI_OP_LOGIN_RSP: 684 688 case ISCSI_OP_TEXT_RSP: 685 - case ISCSI_OP_LOGOUT_RSP: 689 + case ISCSI_OP_LOGOUT_RSP: 686 690 rc = iscsi_check_assign_cmdsn(session, 687 691 (struct iscsi_nopin*)hdr); 688 692 if (rc) ··· 723 727 } 724 728 spin_unlock(&session->lock); 725 729 break; 726 - case ISCSI_OP_NOOP_IN: 730 + case ISCSI_OP_NOOP_IN: 727 731 if (hdr->ttt != ISCSI_RESERVED_TAG) { 728 732 rc = ISCSI_ERR_PROTO; 729 733 break; 730 734 } 731 - rc = iscsi_check_assign_cmdsn(session, 735 + rc = iscsi_check_assign_cmdsn(session, 732 736 (struct iscsi_nopin*)hdr); 733 737 if (rc) 734 738 break; ··· 763 767 if (!rc && hdr->ttt != ISCSI_RESERVED_TAG) 764 768 rc = iscsi_recv_pdu(iscsi_handle(conn), 765 769 hdr, NULL, 0); 766 - } else 770 + } else 767 771 rc = ISCSI_ERR_PROTO; 768 772 break; 769 773 case ISCSI_OP_REJECT: ··· 925 929 sc->request_bufflen, ctask->data_offset); 926 930 if (rc == -EAGAIN) 927 931 return rc; 928 - if (conn->datadgst_en) 932 + if (conn->datadgst_en) 929 933 iscsi_recv_digest_update(conn, sc->request_buffer, i); 930 934 rc = 0; 931 935 goto done; ··· 1020 1024 conn->in.hdr = &conn->hdr; 1021 1025 conn->senselen = (conn->data[0] << 8) | conn->data[1]; 1022 1026 rc = iscsi_cmd_rsp(conn, conn->in.ctask); 1023 - if (!rc && conn->datadgst_en) 1027 + if (!rc && conn->datadgst_en) 1024 1028 iscsi_recv_digest_update(conn, conn->data, 1025 1029 conn->in.datalen); 1026 1030 } ··· 1047 1051 rc = iscsi_recv_pdu(iscsi_handle(conn), conn->in.hdr, 1048 1052 conn->data, conn->in.datalen); 1049 1053 1050 - if (!rc && conn->datadgst_en && 1054 + if (!rc && conn->datadgst_en && 1051 1055 conn->in.opcode != ISCSI_OP_LOGIN_RSP) 1052 1056 iscsi_recv_digest_update(conn, conn->data, 1053 1057 conn->in.datalen); ··· 1267 1271 conn->old_write_space(sk); 1268 1272 debug_tcp("iscsi_write_space: cid %d\n", conn->id); 1269 1273 clear_bit(SUSPEND_BIT, &conn->suspend_tx); 1270 - schedule_work(&conn->xmitwork); 1274 + scsi_queue_work(conn->session->host, &conn->xmitwork); 1271 1275 } 1272 1276 1273 1277 static void ··· 1308 1312 * @buf: buffer to write from 1309 1313 * @size: actual size to write 1310 1314 * @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 1315 */ 1317 1316 static inline int 1318 - iscsi_send(struct socket *sk, struct iscsi_buf *buf, int size, int flags) 1317 + iscsi_send(struct iscsi_conn *conn, struct iscsi_buf *buf, int size, int flags) 1319 1318 { 1320 - int res; 1319 + struct socket *sk = conn->sock; 1320 + int offset = buf->sg.offset + buf->sent; 1321 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; 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); 1340 1334 } 1341 1335 1342 1336 /** ··· 1341 1355 static inline int 1342 1356 iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf, int datalen) 1343 1357 { 1344 - struct socket *sk = conn->sock; 1345 1358 int flags = 0; /* MSG_DONTWAIT; */ 1346 1359 int res, size; 1347 1360 ··· 1349 1364 if (buf->sent + size != buf->sg.length || datalen) 1350 1365 flags |= MSG_MORE; 1351 1366 1352 - res = iscsi_send(sk, buf, size, flags); 1367 + res = iscsi_send(conn, buf, size, flags); 1353 1368 debug_tcp("sendhdr %d bytes, sent %d res %d\n", size, buf->sent, res); 1354 1369 if (res >= 0) { 1355 1370 conn->txdata_octets += res; ··· 1380 1395 iscsi_sendpage(struct iscsi_conn *conn, struct iscsi_buf *buf, 1381 1396 int *count, int *sent) 1382 1397 { 1383 - struct socket *sk = conn->sock; 1384 1398 int flags = 0; /* MSG_DONTWAIT; */ 1385 1399 int res, size; 1386 1400 ··· 1390 1406 if (buf->sent + size != buf->sg.length || *count != size) 1391 1407 flags |= MSG_MORE; 1392 1408 1393 - res = iscsi_send(sk, buf, size, flags); 1409 + res = iscsi_send(conn, buf, size, flags); 1394 1410 debug_tcp("sendpage: %d bytes, sent %d left %d sent %d res %d\n", 1395 1411 size, buf->sent, *count, *sent, res); 1396 1412 if (res >= 0) { ··· 1416 1432 BUG_ON(!conn->data_tx_tfm); 1417 1433 crypto_digest_init(conn->data_tx_tfm); 1418 1434 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 1435 } 1433 1436 1434 1437 static inline int ··· 1651 1680 zero_data(ctask->hdr.dlength); 1652 1681 } 1653 1682 1654 - iscsi_buf_init_virt(&ctask->headbuf, (char*)&ctask->hdr, 1683 + iscsi_buf_init_virt(&ctask->headbuf, (char*)&ctask->hdr, 1655 1684 sizeof(struct iscsi_hdr)); 1656 1685 conn->scsicmd_pdus_cnt++; 1657 1686 } ··· 1717 1746 handle_xmstate_r_hdr(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) 1718 1747 { 1719 1748 ctask->xmstate &= ~XMSTATE_R_HDR; 1720 - if (conn->hdrdgst_en) 1749 + if (conn->hdrdgst_en) 1721 1750 iscsi_hdr_digest(conn, &ctask->headbuf, (u8*)ctask->hdrext); 1722 1751 if (!iscsi_sendhdr(conn, &ctask->headbuf, 0)) { 1723 1752 BUG_ON(ctask->xmstate != XMSTATE_IDLE); ··· 1731 1760 handle_xmstate_w_hdr(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) 1732 1761 { 1733 1762 ctask->xmstate &= ~XMSTATE_W_HDR; 1734 - if (conn->hdrdgst_en) 1763 + if (conn->hdrdgst_en) 1735 1764 iscsi_hdr_digest(conn, &ctask->headbuf, (u8*)ctask->hdrext); 1736 1765 if (iscsi_sendhdr(conn, &ctask->headbuf, ctask->imm_count)) { 1737 1766 ctask->xmstate |= XMSTATE_W_HDR; ··· 1780 1809 return -EAGAIN; 1781 1810 } 1782 1811 if (conn->datadgst_en) 1783 - iscsi_buf_data_digest_update(conn, &ctask->sendbuf); 1812 + crypto_digest_update(conn->data_tx_tfm, 1813 + &ctask->sendbuf.sg, 1); 1784 1814 1785 1815 if (!ctask->imm_count) 1786 1816 break; ··· 1866 1894 * so pass it 1867 1895 */ 1868 1896 if (conn->datadgst_en && ctask->sent - start > 0) 1869 - iscsi_buf_data_digest_update(conn, &ctask->sendbuf); 1897 + crypto_digest_update(conn->data_tx_tfm, 1898 + &ctask->sendbuf.sg, 1); 1870 1899 1871 1900 if (!ctask->data_count) 1872 1901 break; ··· 1945 1972 1946 1973 BUG_ON(r2t->data_count < 0); 1947 1974 if (conn->datadgst_en) 1948 - iscsi_buf_data_digest_update(conn, &r2t->sendbuf); 1975 + crypto_digest_update(conn->data_tx_tfm, &r2t->sendbuf.sg, 1); 1949 1976 1950 1977 if (r2t->data_count) { 1951 1978 BUG_ON(ctask->sc->use_sg == 0); ··· 2027 2054 } 2028 2055 2029 2056 if (conn->datadgst_en) { 2030 - iscsi_buf_data_digest_update(conn, &ctask->sendbuf); 2057 + crypto_digest_update(conn->data_tx_tfm, &ctask->sendbuf.sg, 1); 2031 2058 /* imm data? */ 2032 2059 if (!dtask) { 2033 2060 if (iscsi_digest_final_send(conn, ctask, &ctask->immbuf, ··· 2121 2148 solicit_head_again: 2122 2149 r2t = ctask->r2t; 2123 2150 if (conn->hdrdgst_en) 2124 - iscsi_hdr_digest(conn, &r2t->headbuf, 2151 + iscsi_hdr_digest(conn, &r2t->headbuf, 2125 2152 (u8*)r2t->dtask->hdrext); 2126 2153 if (iscsi_sendhdr(conn, &r2t->headbuf, r2t->data_count)) { 2127 2154 ctask->xmstate &= ~XMSTATE_SOL_DATA; ··· 2273 2300 /* 2274 2301 * serialize Xmit worker on a per-connection basis. 2275 2302 */ 2276 - down(&conn->xmitsema); 2303 + mutex_lock(&conn->xmitmutex); 2277 2304 if (iscsi_data_xmit(conn)) 2278 - schedule_work(&conn->xmitwork); 2279 - up(&conn->xmitsema); 2305 + scsi_queue_work(conn->session->host, &conn->xmitwork); 2306 + mutex_unlock(&conn->xmitmutex); 2280 2307 } 2281 2308 2282 2309 #define FAILURE_BAD_HOST 1 ··· 2340 2367 session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1); 2341 2368 spin_unlock(&session->lock); 2342 2369 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 - 2370 + scsi_queue_work(host, &conn->xmitwork); 2352 2371 return 0; 2353 2372 2354 2373 reject: ··· 2427 2462 kfree(items); 2428 2463 } 2429 2464 2430 - static iscsi_connh_t 2431 - iscsi_conn_create(iscsi_sessionh_t sessionh, uint32_t conn_idx) 2465 + static struct iscsi_cls_conn * 2466 + iscsi_conn_create(struct Scsi_Host *shost, uint32_t conn_idx) 2432 2467 { 2433 - struct iscsi_session *session = iscsi_ptr(sessionh); 2434 - struct iscsi_conn *conn = NULL; 2468 + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 2469 + struct iscsi_conn *conn; 2470 + struct iscsi_cls_conn *cls_conn; 2435 2471 2436 - conn = kmalloc(sizeof(struct iscsi_conn), GFP_KERNEL); 2437 - if (conn == NULL) 2438 - goto conn_alloc_fail; 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 + 2439 2478 memset(conn, 0, sizeof(struct iscsi_conn)); 2440 - 2441 2479 conn->c_stage = ISCSI_CONN_INITIAL_STAGE; 2442 2480 conn->in_progress = IN_PROGRESS_WAIT_HEADER; 2443 2481 conn->id = conn_idx; ··· 2499 2531 goto max_recv_dlenght_alloc_fail; 2500 2532 2501 2533 init_timer(&conn->tmabort_timer); 2502 - init_MUTEX(&conn->xmitsema); 2534 + mutex_init(&conn->xmitmutex); 2503 2535 init_waitqueue_head(&conn->ehwait); 2504 2536 2505 - return iscsi_handle(conn); 2537 + return cls_conn; 2506 2538 2507 2539 max_recv_dlenght_alloc_fail: 2508 2540 spin_lock_bh(&session->lock); ··· 2518 2550 writequeue_alloc_fail: 2519 2551 kfifo_free(conn->xmitqueue); 2520 2552 xmitqueue_alloc_fail: 2521 - kfree(conn); 2522 - conn_alloc_fail: 2523 - return iscsi_handle(NULL); 2553 + iscsi_destroy_conn(cls_conn); 2554 + return NULL; 2524 2555 } 2525 2556 2526 2557 static void 2527 - iscsi_conn_destroy(iscsi_connh_t connh) 2558 + iscsi_conn_destroy(struct iscsi_cls_conn *cls_conn) 2528 2559 { 2529 - struct iscsi_conn *conn = iscsi_ptr(connh); 2560 + struct iscsi_conn *conn = cls_conn->dd_data; 2530 2561 struct iscsi_session *session = conn->session; 2562 + unsigned long flags; 2531 2563 2532 - down(&conn->xmitsema); 2564 + mutex_lock(&conn->xmitmutex); 2533 2565 set_bit(SUSPEND_BIT, &conn->suspend_tx); 2534 2566 if (conn->c_stage == ISCSI_CONN_INITIAL_STAGE && conn->sock) { 2535 2567 struct sock *sk = conn->sock->sk; ··· 2560 2592 } 2561 2593 spin_unlock_bh(&session->lock); 2562 2594 2563 - up(&conn->xmitsema); 2595 + mutex_unlock(&conn->xmitmutex); 2564 2596 2565 2597 /* 2566 2598 * Block until all in-progress commands for this connection 2567 2599 * time out or fail. 2568 2600 */ 2569 2601 for (;;) { 2570 - spin_lock_bh(&conn->lock); 2602 + spin_lock_irqsave(session->host->host_lock, flags); 2571 2603 if (!session->host->host_busy) { /* OK for ERL == 0 */ 2572 - spin_unlock_bh(&conn->lock); 2604 + spin_unlock_irqrestore(session->host->host_lock, flags); 2573 2605 break; 2574 2606 } 2575 - spin_unlock_bh(&conn->lock); 2607 + spin_unlock_irqrestore(session->host->host_lock, flags); 2576 2608 msleep_interruptible(500); 2577 2609 printk("conn_destroy(): host_busy %d host_failed %d\n", 2578 2610 session->host->host_busy, session->host->host_failed); ··· 2620 2652 kfifo_free(conn->writequeue); 2621 2653 kfifo_free(conn->immqueue); 2622 2654 kfifo_free(conn->mgmtqueue); 2623 - kfree(conn); 2655 + 2656 + iscsi_destroy_conn(cls_conn); 2624 2657 } 2625 2658 2626 2659 static int ··· 2681 2712 * processing. 2682 2713 */ 2683 2714 iscsi_conn_set_callbacks(conn); 2715 + 2716 + conn->sendpage = conn->sock->ops->sendpage; 2684 2717 2685 2718 /* 2686 2719 * set receive state machine into initial state ··· 2767 2796 set_bit(SUSPEND_BIT, &conn->suspend_rx); 2768 2797 write_unlock_bh(&sk->sk_callback_lock); 2769 2798 2770 - down(&conn->xmitsema); 2799 + mutex_lock(&conn->xmitmutex); 2771 2800 2772 2801 spin_lock_irqsave(session->host->host_lock, flags); 2773 2802 spin_lock(&session->lock); ··· 2849 2878 conn->datadgst_en = 0; 2850 2879 } 2851 2880 } 2852 - up(&conn->xmitsema); 2881 + mutex_unlock(&conn->xmitmutex); 2853 2882 } 2854 2883 2855 2884 static int ··· 2934 2963 else 2935 2964 __kfifo_put(conn->mgmtqueue, (void*)&mtask, sizeof(void*)); 2936 2965 2937 - schedule_work(&conn->xmitwork); 2938 - 2966 + scsi_queue_work(session->host, &conn->xmitwork); 2939 2967 return 0; 2940 2968 } 2941 2969 ··· 2999 3029 * 1) connection-level failure; 3000 3030 * 2) recovery due protocol error; 3001 3031 */ 3002 - down(&conn->xmitsema); 3032 + mutex_lock(&conn->xmitmutex); 3003 3033 spin_lock_bh(&session->lock); 3004 3034 if (session->state != ISCSI_STATE_LOGGED_IN) { 3005 3035 if (session->state == ISCSI_STATE_TERMINATE) { 3006 3036 spin_unlock_bh(&session->lock); 3007 - up(&conn->xmitsema); 3037 + mutex_unlock(&conn->xmitmutex); 3008 3038 goto failed; 3009 3039 } 3010 3040 spin_unlock_bh(&session->lock); ··· 3022 3052 * 2) session was re-open during time out of ctask. 3023 3053 */ 3024 3054 spin_unlock_bh(&session->lock); 3025 - up(&conn->xmitsema); 3055 + mutex_unlock(&conn->xmitmutex); 3026 3056 goto success; 3027 3057 } 3028 3058 conn->tmabort_state = TMABORT_INITIAL; ··· 3077 3107 conn->tmabort_state == TMABORT_SUCCESS) { 3078 3108 conn->tmabort_state = TMABORT_INITIAL; 3079 3109 spin_unlock_bh(&session->lock); 3080 - up(&conn->xmitsema); 3110 + mutex_unlock(&conn->xmitmutex); 3081 3111 goto success; 3082 3112 } 3083 3113 conn->tmabort_state = TMABORT_INITIAL; ··· 3086 3116 spin_unlock_bh(&session->lock); 3087 3117 } 3088 3118 } 3089 - up(&conn->xmitsema); 3119 + mutex_unlock(&conn->xmitmutex); 3090 3120 3091 3121 3092 3122 /* ··· 3152 3182 exit: 3153 3183 del_timer_sync(&conn->tmabort_timer); 3154 3184 3155 - down(&conn->xmitsema); 3185 + mutex_lock(&conn->xmitmutex); 3156 3186 if (conn->sock) { 3157 3187 struct sock *sk = conn->sock->sk; 3158 3188 ··· 3160 3190 iscsi_ctask_cleanup(conn, ctask); 3161 3191 write_unlock_bh(&sk->sk_callback_lock); 3162 3192 } 3163 - up(&conn->xmitsema); 3193 + mutex_unlock(&conn->xmitmutex); 3164 3194 return rc; 3165 3195 } 3166 3196 ··· 3251 3281 .this_id = -1, 3252 3282 }; 3253 3283 3254 - static iscsi_sessionh_t 3255 - iscsi_session_create(uint32_t initial_cmdsn, struct Scsi_Host *host) 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) 3256 3289 { 3257 - int cmd_i; 3290 + struct Scsi_Host *shost; 3258 3291 struct iscsi_session *session; 3292 + int cmd_i; 3259 3293 3260 - session = iscsi_hostdata(host->hostdata); 3294 + shost = iscsi_transport_create_session(scsit, &iscsi_tcp_transport); 3295 + if (!shost) 3296 + return NULL; 3297 + 3298 + session = iscsi_hostdata(shost->hostdata); 3261 3299 memset(session, 0, sizeof(struct iscsi_session)); 3262 - 3263 - session->host = host; 3264 - session->id = host->host_no; 3300 + session->host = shost; 3265 3301 session->state = ISCSI_STATE_LOGGED_IN; 3266 3302 session->mgmtpool_max = ISCSI_MGMT_CMDS_MAX; 3267 3303 session->cmds_max = ISCSI_XMIT_CMDS_MAX; ··· 3311 3335 if (iscsi_r2tpool_alloc(session)) 3312 3336 goto r2tpool_alloc_fail; 3313 3337 3314 - return iscsi_handle(session); 3338 + return shost; 3315 3339 3316 3340 r2tpool_alloc_fail: 3317 3341 for (cmd_i = 0; cmd_i < session->mgmtpool_max; cmd_i++) ··· 3321 3345 mgmtpool_alloc_fail: 3322 3346 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 3323 3347 cmdpool_alloc_fail: 3324 - return iscsi_handle(NULL); 3348 + return NULL; 3325 3349 } 3326 3350 3327 3351 static void 3328 - iscsi_session_destroy(iscsi_sessionh_t sessionh) 3352 + iscsi_session_destroy(struct Scsi_Host *shost) 3329 3353 { 3354 + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 3330 3355 int cmd_i; 3331 3356 struct iscsi_data_task *dtask, *n; 3332 - struct iscsi_session *session = iscsi_ptr(sessionh); 3333 3357 3334 3358 for (cmd_i = 0; cmd_i < session->cmds_max; cmd_i++) { 3335 3359 struct iscsi_cmd_task *ctask = session->cmds[cmd_i]; ··· 3345 3369 iscsi_r2tpool_free(session); 3346 3370 iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds); 3347 3371 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 3372 + 3373 + iscsi_transport_destroy_session(shost); 3348 3374 } 3349 3375 3350 3376 static int ··· 3445 3467 if (conn->data_rx_tfm) 3446 3468 crypto_free_tfm(conn->data_rx_tfm); 3447 3469 } 3470 + conn->sendpage = conn->datadgst_en ? 3471 + sock_no_sendpage : conn->sock->ops->sendpage; 3448 3472 break; 3449 3473 case ISCSI_PARAM_INITIAL_R2T_EN: 3450 3474 session->initial_r2t_en = value; ··· 3495 3515 } 3496 3516 3497 3517 static int 3498 - iscsi_conn_get_param(iscsi_connh_t connh, enum iscsi_param param, 3499 - uint32_t *value) 3518 + iscsi_session_get_param(struct Scsi_Host *shost, 3519 + enum iscsi_param param, uint32_t *value) 3500 3520 { 3501 - struct iscsi_conn *conn = iscsi_ptr(connh); 3502 - struct iscsi_session *session = conn->session; 3521 + struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 3503 3522 3504 3523 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 3524 case ISCSI_PARAM_INITIAL_R2T_EN: 3518 3525 *value = session->initial_r2t_en; 3519 3526 break; ··· 3530 3563 break; 3531 3564 case ISCSI_PARAM_OFMARKER_EN: 3532 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; 3533 3591 break; 3534 3592 default: 3535 3593 return ISCSI_ERR_PARAM_NOT_FOUND; ··· 3593 3601 struct iscsi_conn *conn = iscsi_ptr(connh); 3594 3602 int rc; 3595 3603 3596 - down(&conn->xmitsema); 3604 + mutex_lock(&conn->xmitmutex); 3597 3605 rc = iscsi_conn_send_generic(conn, hdr, data, data_size); 3598 - up(&conn->xmitsema); 3606 + mutex_unlock(&conn->xmitmutex); 3599 3607 3600 3608 return rc; 3601 3609 } ··· 3607 3615 | CAP_DATADGST, 3608 3616 .host_template = &iscsi_sht, 3609 3617 .hostdata_size = sizeof(struct iscsi_session), 3618 + .conndata_size = sizeof(struct iscsi_conn), 3610 3619 .max_conn = 1, 3611 3620 .max_cmd_len = ISCSI_TCP_MAX_CMD_LEN, 3612 3621 .create_session = iscsi_session_create, ··· 3616 3623 .bind_conn = iscsi_conn_bind, 3617 3624 .destroy_conn = iscsi_conn_destroy, 3618 3625 .set_param = iscsi_conn_set_param, 3619 - .get_param = iscsi_conn_get_param, 3626 + .get_conn_param = iscsi_conn_get_param, 3627 + .get_session_param = iscsi_session_get_param, 3620 3628 .start_conn = iscsi_conn_start, 3621 3629 .stop_conn = iscsi_conn_stop, 3622 3630 .send_pdu = iscsi_conn_send_pdu, ··· 3627 3633 static int __init 3628 3634 iscsi_tcp_init(void) 3629 3635 { 3630 - int error; 3631 - 3632 3636 if (iscsi_max_lun < 1) { 3633 3637 printk(KERN_ERR "Invalid max_lun value of %u\n", iscsi_max_lun); 3634 3638 return -EINVAL; ··· 3639 3647 if (!taskcache) 3640 3648 return -ENOMEM; 3641 3649 3642 - error = iscsi_register_transport(&iscsi_tcp_transport); 3643 - if (error) 3650 + if (!iscsi_register_transport(&iscsi_tcp_transport)) 3644 3651 kmem_cache_destroy(taskcache); 3645 3652 3646 - return error; 3653 + return 0; 3647 3654 } 3648 3655 3649 3656 static void __exit
+4 -2
drivers/scsi/iscsi_tcp.h
··· 158 158 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ 159 159 struct kfifo *xmitqueue; /* data-path cmd queue */ 160 160 struct work_struct xmitwork; /* per-conn. xmit workqueue */ 161 - struct semaphore xmitsema; /* serializes connection xmit, 161 + struct mutex xmitmutex; /* serializes connection xmit, 162 162 * access to kfifos: * 163 163 * xmitqueue, writequeue, * 164 164 * immqueue, mgmtqueue */ ··· 191 191 uint32_t sendpage_failures_cnt; 192 192 uint32_t discontiguous_hdr_cnt; 193 193 uint32_t eh_abort_cnt; 194 + 195 + ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int); 194 196 }; 195 197 196 198 struct iscsi_session { ··· 242 240 243 241 struct iscsi_buf { 244 242 struct scatterlist sg; 245 - struct kvec iov; 246 243 unsigned int sent; 244 + char use_sendmsg; 247 245 }; 248 246 249 247 struct iscsi_data_task {
+1 -1
drivers/scsi/lpfc/lpfc_scsi.c
··· 150 150 return psb; 151 151 } 152 152 153 - struct lpfc_scsi_buf* 153 + static struct lpfc_scsi_buf* 154 154 lpfc_get_scsi_buf(struct lpfc_hba * phba) 155 155 { 156 156 struct lpfc_scsi_buf * lpfc_cmd = NULL;
+3 -3
drivers/scsi/megaraid.c
··· 4479 4479 * serialized. This is so because we want to reserve maximum number of 4480 4480 * available command ids for the I/O commands. 4481 4481 */ 4482 - down(&adapter->int_mtx); 4482 + mutex_lock(&adapter->int_mtx); 4483 4483 4484 4484 scb = &adapter->int_scb; 4485 4485 memset(scb, 0, sizeof(scb_t)); ··· 4527 4527 mc->cmd, mc->opcode, mc->subopcode, scmd->result); 4528 4528 } 4529 4529 4530 - up(&adapter->int_mtx); 4530 + mutex_unlock(&adapter->int_mtx); 4531 4531 4532 4532 return rval; 4533 4533 } ··· 4866 4866 adapter->has_64bit_addr = 0; 4867 4867 } 4868 4868 4869 - init_MUTEX(&adapter->int_mtx); 4869 + mutex_init(&adapter->int_mtx); 4870 4870 init_completion(&adapter->int_waitq); 4871 4871 4872 4872 adapter->this_id = DEFAULT_INITIATOR_ID;
+2 -2
drivers/scsi/megaraid.h
··· 2 2 #define __MEGARAID_H__ 3 3 4 4 #include <linux/spinlock.h> 5 - 5 + #include <linux/mutex.h> 6 6 7 7 #define MEGARAID_VERSION \ 8 8 "v2.00.3 (Release Date: Wed Feb 19 08:51:30 EST 2003)\n" ··· 889 889 890 890 scb_t int_scb; 891 891 Scsi_Cmnd int_scmd; 892 - struct semaphore int_mtx; /* To synchronize the internal 892 + struct mutex int_mtx; /* To synchronize the internal 893 893 commands */ 894 894 struct completion int_waitq; /* wait queue for internal 895 895 cmds */
+4 -3
drivers/scsi/megaraid/megaraid_sas.c
··· 35 35 #include <asm/uaccess.h> 36 36 #include <linux/fs.h> 37 37 #include <linux/compat.h> 38 + #include <linux/mutex.h> 38 39 39 40 #include <scsi/scsi.h> 40 41 #include <scsi/scsi_cmnd.h> ··· 73 72 static int megasas_mgmt_majorno; 74 73 static struct megasas_mgmt_info megasas_mgmt_info; 75 74 static struct fasync_struct *megasas_async_queue; 76 - static DECLARE_MUTEX(megasas_async_queue_mutex); 75 + static DEFINE_MUTEX(megasas_async_queue_mutex); 77 76 78 77 /** 79 78 * megasas_get_cmd - Get a command from the free pool ··· 2363 2362 { 2364 2363 int rc; 2365 2364 2366 - down(&megasas_async_queue_mutex); 2365 + mutex_lock(&megasas_async_queue_mutex); 2367 2366 2368 2367 rc = fasync_helper(fd, filep, mode, &megasas_async_queue); 2369 2368 2370 - up(&megasas_async_queue_mutex); 2369 + mutex_unlock(&megasas_async_queue_mutex); 2371 2370 2372 2371 if (rc >= 0) { 2373 2372 /* For sanity check when we get ioctl */
+16 -8
drivers/scsi/qla2xxx/Kconfig
··· 1 - config SCSI_QLA2XXX 1 + config SCSI_QLA_FC 2 2 tristate "QLogic QLA2XXX Fibre Channel Support" 3 3 depends on PCI && SCSI 4 4 select SCSI_FC_ATTRS ··· 22 22 Upon request, the driver caches the firmware image until 23 23 the driver is unloaded. 24 24 25 + Firmware images can be retrieved from: 26 + 27 + ftp://ftp.qlogic.com/outgoing/linux/firmware/ 28 + 25 29 NOTE: The original method of building firmware-loader 26 30 modules has been deprecated as the firmware-images will 27 31 be removed from the kernel sources. 28 32 29 33 config SCSI_QLA2XXX_EMBEDDED_FIRMWARE 30 34 bool " Use firmware-loader modules (DEPRECATED)" 31 - depends on SCSI_QLA2XXX 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. 32 40 33 41 config SCSI_QLA21XX 34 42 tristate " Build QLogic ISP2100 firmware-module" 35 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 43 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 36 44 ---help--- 37 45 This driver supports the QLogic 21xx (ISP2100) host adapter family. 38 46 39 47 config SCSI_QLA22XX 40 48 tristate " Build QLogic ISP2200 firmware-module" 41 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 49 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 42 50 ---help--- 43 51 This driver supports the QLogic 22xx (ISP2200) host adapter family. 44 52 45 53 config SCSI_QLA2300 46 54 tristate " Build QLogic ISP2300 firmware-module" 47 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 55 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 48 56 ---help--- 49 57 This driver supports the QLogic 2300 (ISP2300 and ISP2312) host 50 58 adapter family. 51 59 52 60 config SCSI_QLA2322 53 61 tristate " Build QLogic ISP2322 firmware-module" 54 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 62 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 55 63 ---help--- 56 64 This driver supports the QLogic 2322 (ISP2322) host adapter family. 57 65 58 66 config SCSI_QLA6312 59 67 tristate " Build QLogic ISP63xx firmware-module" 60 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 68 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 61 69 ---help--- 62 70 This driver supports the QLogic 63xx (ISP6312 and ISP6322) host 63 71 adapter family. 64 72 65 73 config SCSI_QLA24XX 66 74 tristate " Build QLogic ISP24xx firmware-module" 67 - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE 75 + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE 68 76 ---help--- 69 77 This driver supports the QLogic 24xx (ISP2422 and ISP2432) host 70 78 adapter family.
+1 -1
drivers/scsi/qla2xxx/Makefile
··· 3 3 qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ 4 4 qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o 5 5 6 - obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx.o 6 + obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o 7 7 8 8 qla2100-y := ql2100.o ql2100_fw.o 9 9 qla2200-y := ql2200.o ql2200_fw.o
+2 -2
drivers/scsi/qla2xxx/qla_attr.c
··· 541 541 void 542 542 qla2x00_init_host_attr(scsi_qla_host_t *ha) 543 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); 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 546 fc_host_supported_classes(ha->host) = FC_COS_CLASS3; 547 547 }
+53 -52
drivers/scsi/qla2xxx/qla_dbg.c
··· 1003 1003 fw = (struct qla24xx_fw_dump *) ha->fw_dump24; 1004 1004 1005 1005 rval = QLA_SUCCESS; 1006 - fw->hccr = RD_REG_DWORD(&reg->hccr); 1006 + fw->host_status = RD_REG_DWORD(&reg->host_status); 1007 1007 1008 1008 /* Pause RISC. */ 1009 - if ((fw->hccr & HCCRX_RISC_PAUSE) == 0) { 1009 + if ((RD_REG_DWORD(&reg->hccr) & HCCRX_RISC_PAUSE) == 0) { 1010 1010 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET | 1011 1011 HCCRX_CLR_HOST_INT); 1012 1012 RD_REG_DWORD(&reg->hccr); /* PCI Posting. */ ··· 1021 1021 } 1022 1022 } 1023 1023 1024 - /* Disable interrupts. */ 1025 - WRT_REG_DWORD(&reg->ictrl, 0); 1026 - RD_REG_DWORD(&reg->ictrl); 1027 - 1028 1024 if (rval == QLA_SUCCESS) { 1029 1025 /* Host interface registers. */ 1030 1026 dmp_reg = (uint32_t __iomem *)(reg + 0); 1031 1027 for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) 1032 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); 1033 1071 1034 1072 /* Mailbox registers. */ 1035 1073 mbx_reg = (uint16_t __iomem *)((uint8_t __iomem *)reg + 0x80); ··· 1345 1307 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xC0); 1346 1308 for (cnt = 0; cnt < 16; cnt++) 1347 1309 *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 1310 1386 1311 /* Local memory controller registers. */ 1387 1312 iter_reg = fw->lmc_reg; ··· 1678 1677 ha->fw_major_version, ha->fw_minor_version, 1679 1678 ha->fw_subminor_version, ha->fw_attributes); 1680 1679 1681 - qla_uprintf(&uiter, "\nHCCR Register\n%04x\n", fw->hccr); 1680 + qla_uprintf(&uiter, "\nR2H Status Register\n%04x\n", fw->host_status); 1682 1681 1683 1682 qla_uprintf(&uiter, "\nHost Interface Registers"); 1684 1683 for (cnt = 0; cnt < sizeof(fw->host_reg) / 4; cnt++) { ··· 1686 1685 qla_uprintf(&uiter, "\n"); 1687 1686 1688 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]); 1689 1696 } 1690 1697 1691 1698 qla_uprintf(&uiter, "\n\nMailbox Registers"); ··· 1862 1853 qla_uprintf(&uiter, "\n"); 1863 1854 1864 1855 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 1856 } 1874 1857 1875 1858 qla_uprintf(&uiter, "\n\nLMC Registers");
+2 -2
drivers/scsi/qla2xxx/qla_dbg.h
··· 227 227 #define FW_DUMP_SIZE_24XX 0x2B0000 228 228 229 229 struct qla24xx_fw_dump { 230 - uint32_t hccr; 230 + uint32_t host_status; 231 231 uint32_t host_reg[32]; 232 + uint32_t shadow_reg[7]; 232 233 uint16_t mailbox_reg[32]; 233 234 uint32_t xseq_gp_reg[128]; 234 235 uint32_t xseq_0_reg[16]; ··· 251 250 uint32_t rcvt0_data_dma_reg[32]; 252 251 uint32_t rcvt1_data_dma_reg[32]; 253 252 uint32_t risc_gp_reg[128]; 254 - uint32_t shadow_reg[7]; 255 253 uint32_t lmc_reg[112]; 256 254 uint32_t fpm_hdw_reg[192]; 257 255 uint32_t fb_hdw_reg[176];
+2 -4
drivers/scsi/qla2xxx/qla_gbl.h
··· 62 62 extern int ql2xplogiabsentdevice; 63 63 extern int ql2xloginretrycount; 64 64 extern int ql2xfdmienable; 65 + extern int ql2xprocessrscn; 65 66 66 67 extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *); 67 68 ··· 97 96 * Global Function Prototypes in qla_mbx.c source file. 98 97 */ 99 98 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); 99 + qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); 104 100 105 101 extern int 106 102 qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
+3 -5
drivers/scsi/qla2xxx/qla_gs.c
··· 538 538 ct_req->req.rff_id.port_id[1] = ha->d_id.b.area; 539 539 ct_req->req.rff_id.port_id[2] = ha->d_id.b.al_pa; 540 540 541 + ct_req->req.rff_id.fc4_feature = BIT_1; 541 542 ct_req->req.rff_id.fc4_type = 0x08; /* SCSI - FCP */ 542 543 543 544 /* Execute MS IOCB */ ··· 1530 1529 eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED); 1531 1530 eiter->len = __constant_cpu_to_be16(4 + 4); 1532 1531 if (IS_QLA25XX(ha)) 1533 - eiter->a.sup_speed = __constant_cpu_to_be32(4); 1534 - else if (IS_QLA24XX(ha)) 1535 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); 1536 1535 else if (IS_QLA23XX(ha)) 1537 1536 eiter->a.sup_speed = __constant_cpu_to_be32(2); 1538 1537 else ··· 1554 1553 eiter->a.cur_speed = __constant_cpu_to_be32(2); 1555 1554 break; 1556 1555 case 3: 1557 - eiter->a.cur_speed = __constant_cpu_to_be32(8); 1558 - break; 1559 - case 4: 1560 1556 eiter->a.cur_speed = __constant_cpu_to_be32(4); 1561 1557 break; 1562 1558 }
+16 -8
drivers/scsi/qla2xxx/qla_init.c
··· 1014 1014 int rval; 1015 1015 1016 1016 /* Update Serial Link options. */ 1017 - if ((ha->fw_seriallink_options24[0] & BIT_0) == 0) 1017 + if ((le16_to_cpu(ha->fw_seriallink_options24[0]) & BIT_0) == 0) 1018 1018 return; 1019 1019 1020 - rval = qla2x00_set_serdes_params(ha, ha->fw_seriallink_options24[1], 1021 - ha->fw_seriallink_options24[2], ha->fw_seriallink_options24[3]); 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])); 1022 1024 if (rval != QLA_SUCCESS) { 1023 1025 qla_printk(KERN_WARNING, ha, 1024 1026 "Unable to update Serial Link options (%x).\n", rval); ··· 1941 1939 "information -- get_port_database=%x, " 1942 1940 "loop_id=0x%04x\n", 1943 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); 1944 1945 continue; 1945 1946 } 1946 1947 ··· 2653 2648 2654 2649 switch (format) { 2655 2650 case 0: 2656 - if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && 2651 + if (ql2xprocessrscn && 2652 + !IS_QLA2100(ha) && !IS_QLA2200(ha) && 2657 2653 !IS_QLA6312(ha) && !IS_QLA6322(ha) && 2658 2654 !IS_QLA24XX(ha) && !IS_QLA25XX(ha) && 2659 2655 ha->flags.init_done) { ··· 3408 3402 ha->node_name = icb->node_name; 3409 3403 ha->port_name = icb->port_name; 3410 3404 3405 + icb->execution_throttle = __constant_cpu_to_le16(0xFFFF); 3406 + 3411 3407 ha->retry_count = le16_to_cpu(nv->login_retry_count); 3412 3408 3413 3409 /* Set minimum login_timeout to 4 seconds. */ ··· 3675 3667 for (i = 0; i < dlen; i++) 3676 3668 dcode[i] = swab32(dcode[i]); 3677 3669 3678 - rval = qla2x00_load_ram_ext(ha, ha->request_dma, 3679 - risc_addr, dlen); 3670 + rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, 3671 + dlen); 3680 3672 if (rval) { 3681 3673 DEBUG(printk("scsi(%ld):[ERROR] Failed to load " 3682 3674 "segment %d of firmware\n", ha->host_no, ··· 3876 3868 for (i = 0; i < dlen; i++) 3877 3869 dcode[i] = swab32(fwcode[i]); 3878 3870 3879 - rval = qla2x00_load_ram_ext(ha, ha->request_dma, 3880 - risc_addr, dlen); 3871 + rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, 3872 + dlen); 3881 3873 if (rval) { 3882 3874 DEBUG(printk("scsi(%ld):[ERROR] Failed to load " 3883 3875 "segment %d of firmware\n", ha->host_no,
+8 -6
drivers/scsi/qla2xxx/qla_isr.c
··· 519 519 * us, create a new entry in our rscn fcports list and handle 520 520 * the event like an RSCN. 521 521 */ 522 - if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA6312(ha) && 522 + if (ql2xprocessrscn && 523 + !IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA6312(ha) && 523 524 !IS_QLA6322(ha) && !IS_QLA24XX(ha) && !IS_QLA25XX(ha) && 524 525 ha->flags.init_done && mb[1] != 0xffff && 525 526 ((ha->operating_mode == P2P && mb[1] != 0) || ··· 964 963 break; 965 964 966 965 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 966 resid = resid_len; 973 967 if (scsi_status & SS_RESIDUAL_UNDER) { 974 968 cp->resid = resid; 975 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 976 } 977 977 978 978 /*
+14 -95
drivers/scsi/qla2xxx/qla_mbx.c
··· 196 196 /* Check for pending interrupts. */ 197 197 qla2x00_poll(ha); 198 198 199 - udelay(10); /* v4.27 */ 199 + if (command != MBC_LOAD_RISC_RAM_EXTENDED && 200 + !ha->flags.mbox_int) 201 + msleep(10); 200 202 } /* while */ 201 203 } 202 204 ··· 327 325 return rval; 328 326 } 329 327 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 328 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) 329 + qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t risc_addr, 330 + uint32_t risc_code_size) 422 331 { 423 332 int rval; 424 333 mbx_cmd_t mc; ··· 337 424 338 425 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 339 426 340 - mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED; 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 + } 341 435 mcp->mb[1] = LSW(risc_addr); 342 436 mcp->mb[2] = MSW(req_dma); 343 437 mcp->mb[3] = LSW(req_dma); 344 438 mcp->mb[6] = MSW(MSD(req_dma)); 345 439 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; 440 + mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1; 348 441 if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) { 349 442 mcp->mb[4] = MSW(risc_code_size); 350 443 mcp->mb[5] = LSW(risc_code_size);
+6
drivers/scsi/qla2xxx/qla_os.c
··· 71 71 "Enables FDMI registratons " 72 72 "Default is 0 - no FDMI. 1 - perfom FDMI."); 73 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 + 74 80 /* 75 81 * SCSI host template entry points 76 82 */
+3
drivers/scsi/qla2xxx/qla_sup.c
··· 573 573 } 574 574 } while (0); 575 575 576 + /* Enable flash write-protection. */ 577 + qla24xx_write_flash_dword(ha, flash_conf_to_access_addr(0x101), 0x9c); 578 + 576 579 /* Disable flash write. */ 577 580 WRT_REG_DWORD(&reg->ctrl_status, 578 581 RD_REG_DWORD(&reg->ctrl_status) & ~CSRX_FLASH_ENABLE);
+2 -2
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.01.03-k" 10 + #define QLA2XXX_VERSION "8.01.04-k" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 13 #define QLA_DRIVER_MINOR_VER 1 14 - #define QLA_DRIVER_PATCH_VER 3 14 + #define QLA_DRIVER_PATCH_VER 4 15 15 #define QLA_DRIVER_BETA_VER 0
+2
drivers/scsi/raid_class.c
··· 148 148 { RAID_LEVEL_LINEAR, "linear" }, 149 149 { RAID_LEVEL_0, "raid0" }, 150 150 { RAID_LEVEL_1, "raid1" }, 151 + { RAID_LEVEL_10, "raid10" }, 151 152 { RAID_LEVEL_3, "raid3" }, 152 153 { RAID_LEVEL_4, "raid4" }, 153 154 { RAID_LEVEL_5, "raid5" }, 155 + { RAID_LEVEL_50, "raid50" }, 154 156 { RAID_LEVEL_6, "raid6" }, 155 157 }; 156 158
+7 -6
drivers/scsi/scsi.c
··· 55 55 #include <linux/interrupt.h> 56 56 #include <linux/notifier.h> 57 57 #include <linux/cpu.h> 58 + #include <linux/mutex.h> 58 59 59 60 #include <scsi/scsi.h> 60 61 #include <scsi/scsi_cmnd.h> ··· 210 209 .gfp_mask = __GFP_DMA, 211 210 }; 212 211 213 - static DECLARE_MUTEX(host_cmd_pool_mutex); 212 + static DEFINE_MUTEX(host_cmd_pool_mutex); 214 213 215 214 static struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, 216 215 gfp_t gfp_mask) ··· 331 330 * Select a command slab for this host and create it if not 332 331 * yet existant. 333 332 */ 334 - down(&host_cmd_pool_mutex); 333 + mutex_lock(&host_cmd_pool_mutex); 335 334 pool = (shost->unchecked_isa_dma ? &scsi_cmd_dma_pool : &scsi_cmd_pool); 336 335 if (!pool->users) { 337 336 pool->slab = kmem_cache_create(pool->name, ··· 343 342 344 343 pool->users++; 345 344 shost->cmd_pool = pool; 346 - up(&host_cmd_pool_mutex); 345 + mutex_unlock(&host_cmd_pool_mutex); 347 346 348 347 /* 349 348 * Get one backup command for this host. ··· 360 359 kmem_cache_destroy(pool->slab); 361 360 return -ENOMEM; 362 361 fail: 363 - up(&host_cmd_pool_mutex); 362 + mutex_unlock(&host_cmd_pool_mutex); 364 363 return -ENOMEM; 365 364 366 365 } ··· 382 381 kmem_cache_free(shost->cmd_pool->slab, cmd); 383 382 } 384 383 385 - down(&host_cmd_pool_mutex); 384 + mutex_lock(&host_cmd_pool_mutex); 386 385 if (!--shost->cmd_pool->users) 387 386 kmem_cache_destroy(shost->cmd_pool->slab); 388 - up(&host_cmd_pool_mutex); 387 + mutex_unlock(&host_cmd_pool_mutex); 389 388 } 390 389 391 390 #ifdef CONFIG_SCSI_LOGGING
+8 -8
drivers/scsi/scsi_lib.c
··· 1212 1212 return -EOPNOTSUPP; 1213 1213 } 1214 1214 1215 - static void scsi_generic_done(struct scsi_cmnd *cmd) 1215 + static void scsi_blk_pc_done(struct scsi_cmnd *cmd) 1216 1216 { 1217 1217 BUG_ON(!blk_pc_request(cmd->request)); 1218 1218 /* ··· 1224 1224 scsi_io_completion(cmd, cmd->bufflen, 0); 1225 1225 } 1226 1226 1227 - void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) 1227 + static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) 1228 1228 { 1229 1229 struct request *req = cmd->request; 1230 1230 ··· 1241 1241 cmd->transfersize = req->data_len; 1242 1242 cmd->allowed = req->retries; 1243 1243 cmd->timeout_per_command = req->timeout; 1244 + cmd->done = scsi_blk_pc_done; 1244 1245 } 1245 - EXPORT_SYMBOL_GPL(scsi_setup_blk_pc_cmnd); 1246 1246 1247 1247 static int scsi_prep_fn(struct request_queue *q, struct request *req) 1248 1248 { ··· 1339 1339 * happening now. 1340 1340 */ 1341 1341 if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { 1342 - struct scsi_driver *drv; 1343 1342 int ret; 1344 1343 1345 1344 /* ··· 1370 1371 /* 1371 1372 * Initialize the actual SCSI command for this request. 1372 1373 */ 1373 - if (req->rq_disk) { 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 + 1374 1379 drv = *(struct scsi_driver **)req->rq_disk->private_data; 1375 1380 if (unlikely(!drv->init_command(cmd))) { 1376 1381 scsi_release_buffers(cmd); 1377 1382 scsi_put_command(cmd); 1378 1383 goto kill; 1379 1384 } 1380 - } else { 1381 - scsi_setup_blk_pc_cmnd(cmd); 1382 - cmd->done = scsi_generic_done; 1383 1385 } 1384 1386 } 1385 1387
-6
drivers/scsi/scsi_priv.h
··· 26 26 #define SCSI_SENSE_VALID(scmd) \ 27 27 (((scmd)->sense_buffer[0] & 0x70) == 0x70) 28 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 29 /* hosts.c */ 36 30 extern int scsi_init_hosts(void); 37 31 extern void scsi_exit_hosts(void);
+11 -6
drivers/scsi/scsi_proc.c
··· 25 25 #include <linux/errno.h> 26 26 #include <linux/blkdev.h> 27 27 #include <linux/seq_file.h> 28 + #include <linux/mutex.h> 28 29 #include <asm/uaccess.h> 29 30 30 31 #include <scsi/scsi.h> 31 32 #include <scsi/scsi_device.h> 32 33 #include <scsi/scsi_host.h> 34 + #include <scsi/scsi_transport.h> 33 35 34 36 #include "scsi_priv.h" 35 37 #include "scsi_logging.h" ··· 43 41 static struct proc_dir_entry *proc_scsi; 44 42 45 43 /* Protect sht->present and sht->proc_dir */ 46 - static DECLARE_MUTEX(global_host_template_sem); 44 + static DEFINE_MUTEX(global_host_template_mutex); 47 45 48 46 static int proc_scsi_read(char *buffer, char **start, off_t offset, 49 47 int length, int *eof, void *data) ··· 85 83 if (!sht->proc_info) 86 84 return; 87 85 88 - down(&global_host_template_sem); 86 + mutex_lock(&global_host_template_mutex); 89 87 if (!sht->present++) { 90 88 sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi); 91 89 if (!sht->proc_dir) ··· 94 92 else 95 93 sht->proc_dir->owner = sht->module; 96 94 } 97 - up(&global_host_template_sem); 95 + mutex_unlock(&global_host_template_mutex); 98 96 } 99 97 100 98 void scsi_proc_hostdir_rm(struct scsi_host_template *sht) ··· 102 100 if (!sht->proc_info) 103 101 return; 104 102 105 - down(&global_host_template_sem); 103 + mutex_lock(&global_host_template_mutex); 106 104 if (!--sht->present && sht->proc_dir) { 107 105 remove_proc_entry(sht->proc_name, proc_scsi); 108 106 sht->proc_dir = NULL; 109 107 } 110 - up(&global_host_template_sem); 108 + mutex_unlock(&global_host_template_mutex); 111 109 } 112 110 113 111 void scsi_proc_host_add(struct Scsi_Host *shost) ··· 201 199 if (IS_ERR(shost)) 202 200 return PTR_ERR(shost); 203 201 204 - error = scsi_scan_host_selected(shost, channel, id, lun, 1); 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); 205 206 scsi_host_put(shost); 206 207 return error; 207 208 }
+10 -22
drivers/scsi/scsi_scan.c
··· 334 334 struct scsi_target *starget; 335 335 struct scsi_target *found_target; 336 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 337 starget = kmalloc(size, GFP_KERNEL); 351 338 if (!starget) { 352 339 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); ··· 1270 1283 struct scsi_device *sdev; 1271 1284 struct device *parent = &shost->shost_gendev; 1272 1285 int res; 1273 - struct scsi_target *starget = scsi_alloc_target(parent, channel, id); 1286 + struct scsi_target *starget; 1274 1287 1288 + starget = scsi_alloc_target(parent, channel, id); 1275 1289 if (!starget) 1276 1290 return ERR_PTR(-ENOMEM); 1277 1291 1278 1292 get_device(&starget->dev); 1279 - down(&shost->scan_mutex); 1293 + mutex_lock(&shost->scan_mutex); 1280 1294 if (scsi_host_scan_allowed(shost)) { 1281 1295 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, 1282 1296 hostdata); 1283 1297 if (res != SCSI_SCAN_LUN_PRESENT) 1284 1298 sdev = ERR_PTR(-ENODEV); 1285 1299 } 1286 - up(&shost->scan_mutex); 1300 + mutex_unlock(&shost->scan_mutex); 1287 1301 scsi_target_reap(starget); 1288 1302 put_device(&starget->dev); 1289 1303 ··· 1392 1404 { 1393 1405 struct Scsi_Host *shost = dev_to_shost(parent); 1394 1406 1395 - down(&shost->scan_mutex); 1407 + mutex_lock(&shost->scan_mutex); 1396 1408 if (scsi_host_scan_allowed(shost)) 1397 1409 __scsi_scan_target(parent, channel, id, lun, rescan); 1398 - up(&shost->scan_mutex); 1410 + mutex_unlock(&shost->scan_mutex); 1399 1411 } 1400 1412 EXPORT_SYMBOL(scsi_scan_target); 1401 1413 ··· 1442 1454 ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) 1443 1455 return -EINVAL; 1444 1456 1445 - down(&shost->scan_mutex); 1457 + mutex_lock(&shost->scan_mutex); 1446 1458 if (scsi_host_scan_allowed(shost)) { 1447 1459 if (channel == SCAN_WILD_CARD) 1448 1460 for (channel = 0; channel <= shost->max_channel; ··· 1452 1464 else 1453 1465 scsi_scan_channel(shost, channel, id, lun, rescan); 1454 1466 } 1455 - up(&shost->scan_mutex); 1467 + mutex_unlock(&shost->scan_mutex); 1456 1468 1457 1469 return 0; 1458 1470 } ··· 1510 1522 struct scsi_device *sdev = NULL; 1511 1523 struct scsi_target *starget; 1512 1524 1513 - down(&shost->scan_mutex); 1525 + mutex_lock(&shost->scan_mutex); 1514 1526 if (!scsi_host_scan_allowed(shost)) 1515 1527 goto out; 1516 1528 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); ··· 1524 1536 } 1525 1537 put_device(&starget->dev); 1526 1538 out: 1527 - up(&shost->scan_mutex); 1539 + mutex_unlock(&shost->scan_mutex); 1528 1540 return sdev; 1529 1541 } 1530 1542 EXPORT_SYMBOL(scsi_get_host_dev);
+6 -3
drivers/scsi/scsi_sysfs.c
··· 106 106 return -EINVAL; 107 107 if (check_set(&lun, s3)) 108 108 return -EINVAL; 109 - res = scsi_scan_host_selected(shost, channel, id, lun, 1); 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); 110 113 return res; 111 114 } 112 115 ··· 748 745 { 749 746 struct Scsi_Host *shost = sdev->host; 750 747 751 - down(&shost->scan_mutex); 748 + mutex_lock(&shost->scan_mutex); 752 749 __scsi_remove_device(sdev); 753 - up(&shost->scan_mutex); 750 + mutex_unlock(&shost->scan_mutex); 754 751 } 755 752 EXPORT_SYMBOL(scsi_remove_device); 756 753
+18 -8
drivers/scsi/scsi_transport_fc.c
··· 295 295 */ 296 296 fc_host_node_name(shost) = -1; 297 297 fc_host_port_name(shost) = -1; 298 + fc_host_permanent_port_name(shost) = -1; 298 299 fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED; 299 300 memset(fc_host_supported_fc4s(shost), 0, 300 301 sizeof(fc_host_supported_fc4s(shost))); ··· 796 795 797 796 fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long); 798 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); 799 800 fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1)); 800 801 fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20); 801 802 fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1)); ··· 1093 1090 /* 1094 1091 * Must be called with shost->host_lock held 1095 1092 */ 1096 - static struct device *fc_target_parent(struct Scsi_Host *shost, 1097 - int channel, uint id) 1093 + static int fc_user_scan(struct Scsi_Host *shost, uint channel, 1094 + uint id, uint lun) 1098 1095 { 1099 1096 struct fc_rport *rport; 1100 1097 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; 1098 + list_for_each_entry(rport, &fc_host_rports(shost), peers) { 1099 + if (rport->scsi_target_id == -1) 1100 + continue; 1105 1101 1106 - return NULL; 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; 1107 1110 } 1108 1111 1109 1112 struct scsi_transport_template * ··· 1148 1139 /* Transport uses the shost workq for scsi scanning */ 1149 1140 i->t.create_work_queue = 1; 1150 1141 1151 - i->t.target_parent = fc_target_parent; 1142 + i->t.user_scan = fc_user_scan; 1152 1143 1153 1144 /* 1154 1145 * Setup SCSI Target Attributes. ··· 1169 1160 count=0; 1170 1161 SETUP_HOST_ATTRIBUTE_RD(node_name); 1171 1162 SETUP_HOST_ATTRIBUTE_RD(port_name); 1163 + SETUP_HOST_ATTRIBUTE_RD(permanent_port_name); 1172 1164 SETUP_HOST_ATTRIBUTE_RD(supported_classes); 1173 1165 SETUP_HOST_ATTRIBUTE_RD(supported_fc4s); 1174 1166 SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
+474 -437
drivers/scsi/scsi_transport_iscsi.c
··· 21 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 22 */ 23 23 #include <linux/module.h> 24 - #include <linux/string.h> 25 - #include <linux/slab.h> 26 24 #include <linux/mempool.h> 25 + #include <linux/mutex.h> 27 26 #include <net/tcp.h> 28 - 29 27 #include <scsi/scsi.h> 30 28 #include <scsi/scsi_host.h> 31 29 #include <scsi/scsi_device.h> ··· 42 44 * List of sessions for this transport 43 45 */ 44 46 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 47 /* 51 48 * based on transport capabilities, at register time we set these 52 49 * bits to tell the transport class it wants attributes displayed ··· 63 70 /* 64 71 * list of registered transports and lock that must 65 72 * be held while accessing list. The iscsi_transport_lock must 66 - * be acquired after the rx_queue_sema. 73 + * be acquired after the rx_queue_mutex. 67 74 */ 68 75 static LIST_HEAD(iscsi_transports); 69 76 static DEFINE_SPINLOCK(iscsi_transport_lock); ··· 138 145 139 146 static struct sock *nls; 140 147 static int daemon_pid; 141 - static DECLARE_MUTEX(rx_queue_sema); 148 + static DEFINE_MUTEX(rx_queue_mutex); 142 149 143 150 struct mempool_zone { 144 151 mempool_t *pool; ··· 149 156 spinlock_t freelock; 150 157 }; 151 158 152 - static struct mempool_zone z_reply; 159 + static struct mempool_zone *z_reply; 153 160 154 161 /* 155 162 * Z_MAX_* - actual mempool size allocated at the mempool_zone_init() time ··· 164 171 #define Z_MAX_ERROR 16 165 172 #define Z_HIWAT_ERROR 12 166 173 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 174 static LIST_HEAD(connlist); 187 175 static DEFINE_SPINLOCK(connlock); 188 176 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 - }; 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; 196 186 197 - #define iscsi_dev_to_if_session(_dev) \ 198 - container_of(_dev, struct iscsi_if_session, dev) 187 + shost = iscsi_session_to_shost(session); 188 + scsi_host_put(shost); 189 + kfree(session); 190 + module_put(transport->owner); 191 + } 199 192 200 - #define iscsi_cdev_to_if_session(_cdev) \ 201 - iscsi_dev_to_if_session(_cdev->dev) 193 + static int iscsi_is_session_dev(const struct device *dev) 194 + { 195 + return dev->release == iscsi_session_release; 196 + } 202 197 203 - #define iscsi_if_session_to_shost(_session) \ 204 - dev_to_shost(_session->dev.parent) 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; 205 210 206 - static struct iscsi_if_conn* 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* 207 435 iscsi_if_find_conn(uint64_t key) 208 436 { 209 437 unsigned long flags; 210 - struct iscsi_if_conn *conn; 438 + struct iscsi_cls_conn *conn; 211 439 212 440 spin_lock_irqsave(&connlock, flags); 213 441 list_for_each_entry(conn, &connlist, conn_list) ··· 463 249 } 464 250 465 251 static void* 466 - mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data) 252 + mempool_zone_alloc_skb(unsigned int gfp_mask, void *pool_data) 467 253 { 468 254 struct mempool_zone *zone = pool_data; 469 255 ··· 495 281 spin_unlock_irqrestore(&zone->freelock, flags); 496 282 } 497 283 498 - static int 499 - mempool_zone_init(struct mempool_zone *zp, unsigned max, unsigned size, 500 - unsigned hiwat) 284 + static struct mempool_zone * 285 + mempool_zone_init(unsigned max, unsigned size, unsigned hiwat) 501 286 { 287 + struct mempool_zone *zp; 288 + 289 + zp = kzalloc(sizeof(*zp), GFP_KERNEL); 290 + if (!zp) 291 + return NULL; 292 + 502 293 zp->pool = mempool_create(max, mempool_zone_alloc_skb, 503 294 mempool_zone_free_skb, zp); 504 - if (!zp->pool) 505 - return -ENOMEM; 295 + if (!zp->pool) { 296 + kfree(zp); 297 + return NULL; 298 + } 506 299 507 300 zp->size = size; 508 301 zp->hiwat = hiwat; ··· 518 297 spin_lock_init(&zp->freelock); 519 298 atomic_set(&zp->allocated, 0); 520 299 521 - return 0; 300 + return zp; 522 301 } 523 302 303 + static void mempool_zone_destroy(struct mempool_zone *zp) 304 + { 305 + mempool_destroy(zp->pool); 306 + kfree(zp); 307 + } 524 308 525 309 static struct sk_buff* 526 310 mempool_zone_get_skb(struct mempool_zone *zone) ··· 565 339 struct nlmsghdr *nlh; 566 340 struct sk_buff *skb; 567 341 struct iscsi_uevent *ev; 568 - struct iscsi_if_conn *conn; 342 + struct iscsi_cls_conn *conn; 569 343 char *pdu; 570 344 int len = NLMSG_SPACE(sizeof(*ev) + sizeof(struct iscsi_hdr) + 571 345 data_size); ··· 573 347 conn = iscsi_if_find_conn(connh); 574 348 BUG_ON(!conn); 575 349 576 - mempool_zone_complete(&conn->z_pdu); 350 + mempool_zone_complete(conn->z_pdu); 577 351 578 - skb = mempool_zone_get_skb(&conn->z_pdu); 352 + skb = mempool_zone_get_skb(conn->z_pdu); 579 353 if (!skb) { 580 354 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); 355 + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not deliver " 356 + "control PDU: OOM\n"); 583 357 return -ENOMEM; 584 358 } 585 359 ··· 588 362 memset(ev, 0, sizeof(*ev)); 589 363 ev->transport_handle = iscsi_handle(conn->transport); 590 364 ev->type = ISCSI_KEVENT_RECV_PDU; 591 - if (atomic_read(&conn->z_pdu.allocated) >= conn->z_pdu.hiwat) 365 + if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat) 592 366 ev->iferror = -ENOMEM; 593 367 ev->r.recv_req.conn_handle = connh; 594 368 pdu = (char*)ev + sizeof(*ev); 595 369 memcpy(pdu, hdr, sizeof(struct iscsi_hdr)); 596 370 memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size); 597 371 598 - return iscsi_unicast_skb(&conn->z_pdu, skb); 372 + return iscsi_unicast_skb(conn->z_pdu, skb); 599 373 } 600 374 EXPORT_SYMBOL_GPL(iscsi_recv_pdu); 601 375 ··· 604 378 struct nlmsghdr *nlh; 605 379 struct sk_buff *skb; 606 380 struct iscsi_uevent *ev; 607 - struct iscsi_if_conn *conn; 381 + struct iscsi_cls_conn *conn; 608 382 int len = NLMSG_SPACE(sizeof(*ev)); 609 383 610 384 conn = iscsi_if_find_conn(connh); 611 385 BUG_ON(!conn); 612 386 613 - mempool_zone_complete(&conn->z_error); 387 + mempool_zone_complete(conn->z_error); 614 388 615 - skb = mempool_zone_get_skb(&conn->z_error); 389 + skb = mempool_zone_get_skb(conn->z_error); 616 390 if (!skb) { 617 - printk(KERN_ERR "iscsi%d: gracefully ignored conn error (%d)\n", 618 - conn->host->host_no, error); 391 + dev_printk(KERN_ERR, &conn->dev, "iscsi: gracefully ignored " 392 + "conn error (%d)\n", error); 619 393 return; 620 394 } 621 395 ··· 623 397 ev = NLMSG_DATA(nlh); 624 398 ev->transport_handle = iscsi_handle(conn->transport); 625 399 ev->type = ISCSI_KEVENT_CONN_ERROR; 626 - if (atomic_read(&conn->z_error.allocated) >= conn->z_error.hiwat) 400 + if (atomic_read(&conn->z_error->allocated) >= conn->z_error->hiwat) 627 401 ev->iferror = -ENOMEM; 628 402 ev->r.connerror.error = error; 629 403 ev->r.connerror.conn_handle = connh; 630 404 631 - iscsi_unicast_skb(&conn->z_error, skb); 405 + iscsi_unicast_skb(conn->z_error, skb); 632 406 633 - printk(KERN_INFO "iscsi%d: detected conn error (%d)\n", 634 - conn->host->host_no, error); 407 + dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n", 408 + error); 635 409 } 636 410 EXPORT_SYMBOL_GPL(iscsi_conn_error); 637 411 ··· 645 419 int flags = multi ? NLM_F_MULTI : 0; 646 420 int t = done ? NLMSG_DONE : type; 647 421 648 - mempool_zone_complete(&z_reply); 422 + mempool_zone_complete(z_reply); 649 423 650 - skb = mempool_zone_get_skb(&z_reply); 424 + skb = mempool_zone_get_skb(z_reply); 651 425 /* 652 426 * FIXME: 653 427 * user is supposed to react on iferror == -ENOMEM; ··· 658 432 nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0); 659 433 nlh->nlmsg_flags = flags; 660 434 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; 435 + return iscsi_unicast_skb(z_reply, skb); 959 436 } 960 437 961 438 static int ··· 668 739 struct iscsi_uevent *ev = NLMSG_DATA(nlh); 669 740 struct iscsi_stats *stats; 670 741 struct sk_buff *skbstat; 671 - struct iscsi_if_conn *conn; 742 + struct iscsi_cls_conn *conn; 672 743 struct nlmsghdr *nlhstat; 673 744 struct iscsi_uevent *evstat; 674 745 int len = NLMSG_SPACE(sizeof(*ev) + ··· 684 755 do { 685 756 int actual_size; 686 757 687 - mempool_zone_complete(&conn->z_pdu); 758 + mempool_zone_complete(conn->z_pdu); 688 759 689 - skbstat = mempool_zone_get_skb(&conn->z_pdu); 760 + skbstat = mempool_zone_get_skb(conn->z_pdu); 690 761 if (!skbstat) { 691 - printk(KERN_ERR "iscsi%d: can not deliver stats: OOM\n", 692 - conn->host->host_no); 762 + dev_printk(KERN_ERR, &conn->dev, "iscsi: can not " 763 + "deliver stats: OOM\n"); 693 764 return -ENOMEM; 694 765 } 695 766 ··· 699 770 memset(evstat, 0, sizeof(*evstat)); 700 771 evstat->transport_handle = iscsi_handle(conn->transport); 701 772 evstat->type = nlh->nlmsg_type; 702 - if (atomic_read(&conn->z_pdu.allocated) >= conn->z_pdu.hiwat) 773 + if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat) 703 774 evstat->iferror = -ENOMEM; 704 775 evstat->u.get_stats.conn_handle = 705 776 ev->u.get_stats.conn_handle; ··· 717 788 skb_trim(skb, NLMSG_ALIGN(actual_size)); 718 789 nlhstat->nlmsg_len = actual_size; 719 790 720 - err = iscsi_unicast_skb(&conn->z_pdu, skbstat); 791 + err = iscsi_unicast_skb(conn->z_pdu, skbstat); 721 792 } while (err < 0 && err != -ECONNREFUSED); 722 793 723 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; 724 923 } 725 924 726 925 static int ··· 938 881 { 939 882 struct sk_buff *skb; 940 883 941 - down(&rx_queue_sema); 884 + mutex_lock(&rx_queue_mutex); 942 885 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { 943 886 while (skb->len >= NLMSG_SPACE(0)) { 944 887 int err; ··· 972 915 err = iscsi_if_send_reply( 973 916 NETLINK_CREDS(skb)->pid, nlh->nlmsg_seq, 974 917 nlh->nlmsg_type, 0, 0, ev, sizeof(*ev)); 975 - if (atomic_read(&z_reply.allocated) >= 976 - z_reply.hiwat) 918 + if (atomic_read(&z_reply->allocated) >= 919 + z_reply->hiwat) 977 920 ev->iferror = -ENOMEM; 978 921 } while (err < 0 && err != -ECONNREFUSED); 979 922 skb_pull(skb, rlen); 980 923 } 981 924 kfree_skb(skb); 982 925 } 983 - up(&rx_queue_sema); 926 + mutex_unlock(&rx_queue_mutex); 984 927 } 928 + 929 + #define iscsi_cdev_to_conn(_cdev) \ 930 + iscsi_dev_to_conn(_cdev->dev) 985 931 986 932 /* 987 933 * iSCSI connection attrs ··· 994 934 show_conn_int_param_##param(struct class_device *cdev, char *buf) \ 995 935 { \ 996 936 uint32_t value = 0; \ 997 - struct iscsi_if_conn *conn = iscsi_cdev_to_if_conn(cdev); \ 998 - struct iscsi_internal *priv; \ 937 + struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev); \ 938 + struct iscsi_transport *t = conn->transport; \ 999 939 \ 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); \ 940 + t->get_conn_param(conn->dd_data, param, &value); \ 1003 941 return snprintf(buf, 20, format"\n", value); \ 1004 942 } 1005 943 ··· 1012 954 iscsi_conn_int_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN, "%d"); 1013 955 iscsi_conn_int_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN, "%d"); 1014 956 957 + #define iscsi_cdev_to_session(_cdev) \ 958 + iscsi_dev_to_session(_cdev->dev) 959 + 1015 960 /* 1016 961 * iSCSI session attrs 1017 962 */ ··· 1023 962 show_session_int_param_##param(struct class_device *cdev, char *buf) \ 1024 963 { \ 1025 964 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; \ 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; \ 1031 968 \ 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);\ 969 + t->get_session_param(shost, param, &value); \ 1040 970 return snprintf(buf, 20, format"\n", value); \ 1041 971 } 1042 972 ··· 1056 1004 count++; \ 1057 1005 } 1058 1006 1059 - static int iscsi_is_session_dev(const struct device *dev) 1060 - { 1061 - return dev->release == iscsi_if_session_dev_release; 1062 - } 1063 - 1064 1007 static int iscsi_session_match(struct attribute_container *cont, 1065 1008 struct device *dev) 1066 1009 { 1067 - struct iscsi_if_session *session; 1010 + struct iscsi_cls_session *session; 1068 1011 struct Scsi_Host *shost; 1069 1012 struct iscsi_internal *priv; 1070 1013 1071 1014 if (!iscsi_is_session_dev(dev)) 1072 1015 return 0; 1073 1016 1074 - session = iscsi_dev_to_if_session(dev); 1075 - shost = iscsi_if_session_to_shost(session); 1017 + session = iscsi_dev_to_session(dev); 1018 + shost = iscsi_session_to_shost(session); 1076 1019 if (!shost->transportt) 1077 1020 return 0; 1078 1021 ··· 1078 1031 return &priv->session_cont.ac == cont; 1079 1032 } 1080 1033 1081 - static int iscsi_is_conn_dev(const struct device *dev) 1082 - { 1083 - return dev->release == iscsi_if_conn_dev_release; 1084 - } 1085 - 1086 1034 static int iscsi_conn_match(struct attribute_container *cont, 1087 1035 struct device *dev) 1088 1036 { 1089 - struct iscsi_if_conn *conn; 1037 + struct iscsi_cls_session *session; 1038 + struct iscsi_cls_conn *conn; 1090 1039 struct Scsi_Host *shost; 1091 1040 struct iscsi_internal *priv; 1092 1041 1093 1042 if (!iscsi_is_conn_dev(dev)) 1094 1043 return 0; 1095 1044 1096 - conn = iscsi_dev_to_if_conn(dev); 1097 - shost = conn->host; 1045 + conn = iscsi_dev_to_conn(dev); 1046 + session = iscsi_dev_to_session(conn->dev.parent); 1047 + shost = iscsi_session_to_shost(session); 1048 + 1098 1049 if (!shost->transportt) 1099 1050 return 0; 1100 1051 ··· 1103 1058 return &priv->conn_cont.ac == cont; 1104 1059 } 1105 1060 1106 - int iscsi_register_transport(struct iscsi_transport *tt) 1061 + struct scsi_transport_template * 1062 + iscsi_register_transport(struct iscsi_transport *tt) 1107 1063 { 1108 1064 struct iscsi_internal *priv; 1109 1065 unsigned long flags; ··· 1114 1068 1115 1069 priv = iscsi_if_transport_lookup(tt); 1116 1070 if (priv) 1117 - return -EEXIST; 1071 + return NULL; 1118 1072 1119 1073 priv = kmalloc(sizeof(*priv), GFP_KERNEL); 1120 1074 if (!priv) 1121 - return -ENOMEM; 1075 + return NULL; 1122 1076 memset(priv, 0, sizeof(*priv)); 1123 1077 INIT_LIST_HEAD(&priv->list); 1124 1078 INIT_LIST_HEAD(&priv->sessions); 1125 - spin_lock_init(&priv->session_lock); 1126 1079 priv->iscsi_transport = tt; 1127 1080 1128 1081 priv->cdev.class = &iscsi_transport_class; ··· 1187 1142 spin_unlock_irqrestore(&iscsi_transport_lock, flags); 1188 1143 1189 1144 printk(KERN_NOTICE "iscsi: registered transport (%s)\n", tt->name); 1190 - return 0; 1145 + return &priv->t; 1191 1146 1192 1147 unregister_cdev: 1193 1148 class_device_unregister(&priv->cdev); 1194 1149 free_priv: 1195 1150 kfree(priv); 1196 - return err; 1151 + return NULL; 1197 1152 } 1198 1153 EXPORT_SYMBOL_GPL(iscsi_register_transport); 1199 1154 ··· 1204 1159 1205 1160 BUG_ON(!tt); 1206 1161 1207 - down(&rx_queue_sema); 1162 + mutex_lock(&rx_queue_mutex); 1208 1163 1209 1164 priv = iscsi_if_transport_lookup(tt); 1210 1165 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 1166 1220 1167 spin_lock_irqsave(&iscsi_transport_lock, flags); 1221 1168 list_del(&priv->list); ··· 1218 1181 1219 1182 sysfs_remove_group(&priv->cdev.kobj, &iscsi_transport_group); 1220 1183 class_device_unregister(&priv->cdev); 1221 - up(&rx_queue_sema); 1184 + mutex_unlock(&rx_queue_mutex); 1222 1185 1223 1186 return 0; 1224 1187 } ··· 1231 1194 1232 1195 if (event == NETLINK_URELEASE && 1233 1196 n->protocol == NETLINK_ISCSI && n->pid) { 1234 - struct iscsi_if_conn *conn; 1197 + struct iscsi_cls_conn *conn; 1235 1198 unsigned long flags; 1236 1199 1237 - mempool_zone_complete(&z_reply); 1200 + mempool_zone_complete(z_reply); 1238 1201 spin_lock_irqsave(&connlock, flags); 1239 1202 list_for_each_entry(conn, &connlist, conn_list) { 1240 - mempool_zone_complete(&conn->z_error); 1241 - mempool_zone_complete(&conn->z_pdu); 1203 + mempool_zone_complete(conn->z_error); 1204 + mempool_zone_complete(conn->z_pdu); 1242 1205 } 1243 1206 spin_unlock_irqrestore(&connlock, flags); 1244 1207 } ··· 1271 1234 goto unregister_session_class; 1272 1235 1273 1236 nls = netlink_kernel_create(NETLINK_ISCSI, 1, iscsi_if_rx, 1274 - THIS_MODULE); 1237 + THIS_MODULE); 1275 1238 if (!nls) { 1276 1239 err = -ENOBUFS; 1277 1240 goto unregister_notifier; 1278 1241 } 1279 1242 1280 - err = mempool_zone_init(&z_reply, Z_MAX_REPLY, 1243 + z_reply = mempool_zone_init(Z_MAX_REPLY, 1281 1244 NLMSG_SPACE(sizeof(struct iscsi_uevent)), Z_HIWAT_REPLY); 1282 - if (!err) 1245 + if (z_reply) 1283 1246 return 0; 1284 1247 1285 1248 sock_release(nls->sk_socket); ··· 1296 1259 1297 1260 static void __exit iscsi_transport_exit(void) 1298 1261 { 1299 - mempool_destroy(z_reply.pool); 1262 + mempool_zone_destroy(z_reply); 1300 1263 sock_release(nls->sk_socket); 1301 1264 netlink_unregister_notifier(&iscsi_nl_notifier); 1302 1265 transport_class_unregister(&iscsi_connection_class);
+39 -21
drivers/scsi/scsi_transport_sas.c
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/string.h> 31 31 32 + #include <scsi/scsi.h> 32 33 #include <scsi/scsi_device.h> 33 34 #include <scsi/scsi_host.h> 34 35 #include <scsi/scsi_transport.h> ··· 63 62 64 63 struct sas_host_attrs { 65 64 struct list_head rphy_list; 66 - spinlock_t lock; 65 + struct mutex lock; 67 66 u32 next_target_id; 68 67 }; 69 68 #define to_sas_host_attrs(host) ((struct sas_host_attrs *)(host)->shost_data) ··· 166 165 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 167 166 168 167 INIT_LIST_HEAD(&sas_host->rphy_list); 169 - spin_lock_init(&sas_host->lock); 168 + mutex_init(&sas_host->lock); 170 169 sas_host->next_target_id = 0; 171 170 return 0; 172 171 } ··· 627 626 transport_add_device(&rphy->dev); 628 627 transport_configure_device(&rphy->dev); 629 628 630 - spin_lock(&sas_host->lock); 629 + mutex_lock(&sas_host->lock); 631 630 list_add_tail(&rphy->list, &sas_host->rphy_list); 632 631 if (identify->device_type == SAS_END_DEVICE && 633 632 (identify->target_port_protocols & ··· 635 634 rphy->scsi_target_id = sas_host->next_target_id++; 636 635 else 637 636 rphy->scsi_target_id = -1; 638 - spin_unlock(&sas_host->lock); 637 + mutex_unlock(&sas_host->lock); 639 638 640 639 if (rphy->scsi_target_id != -1) { 641 - scsi_scan_target(&rphy->dev, parent->number, 640 + scsi_scan_target(&rphy->dev, parent->port_identifier, 642 641 rphy->scsi_target_id, ~0, 0); 643 642 } 644 643 ··· 662 661 struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent); 663 662 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 664 663 665 - spin_lock(&sas_host->lock); 664 + mutex_lock(&sas_host->lock); 666 665 list_del(&rphy->list); 667 - spin_unlock(&sas_host->lock); 666 + mutex_unlock(&sas_host->lock); 668 667 669 668 transport_destroy_device(&rphy->dev); 670 669 put_device(rphy->dev.parent); ··· 688 687 struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); 689 688 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 690 689 691 - scsi_remove_target(dev); 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 + } 692 701 693 702 transport_remove_device(dev); 694 703 device_del(dev); 695 704 transport_destroy_device(dev); 696 705 697 - spin_lock(&sas_host->lock); 706 + mutex_lock(&sas_host->lock); 698 707 list_del(&rphy->list); 699 - spin_unlock(&sas_host->lock); 708 + mutex_unlock(&sas_host->lock); 709 + 710 + parent->rphy = NULL; 700 711 701 712 put_device(&parent->dev); 702 713 } ··· 732 719 * SCSI scan helper 733 720 */ 734 721 735 - static struct device *sas_target_parent(struct Scsi_Host *shost, 736 - int channel, uint id) 722 + static int sas_user_scan(struct Scsi_Host *shost, uint channel, 723 + uint id, uint lun) 737 724 { 738 725 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 739 726 struct sas_rphy *rphy; 740 - struct device *dev = NULL; 741 727 742 - spin_lock(&sas_host->lock); 728 + mutex_lock(&sas_host->lock); 743 729 list_for_each_entry(rphy, &sas_host->rphy_list, list) { 744 730 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 731 751 - return dev; 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; 752 744 } 753 745 754 746 ··· 798 780 return NULL; 799 781 memset(i, 0, sizeof(struct sas_internal)); 800 782 801 - i->t.target_parent = sas_target_parent; 783 + i->t.user_scan = sas_user_scan; 802 784 803 785 i->t.host_attrs.ac.attrs = &i->host_attrs[0]; 804 786 i->t.host_attrs.ac.class = &sas_host_class.class;
+6 -6
drivers/scsi/scsi_transport_spi.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/workqueue.h> 26 26 #include <linux/blkdev.h> 27 - #include <asm/semaphore.h> 27 + #include <linux/mutex.h> 28 28 #include <scsi/scsi.h> 29 29 #include "scsi_priv.h" 30 30 #include <scsi/scsi_device.h> ··· 48 48 49 49 /* Private data accessors (keep these out of the header file) */ 50 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) 51 + #define spi_dv_mutex(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_mutex) 52 52 53 53 struct spi_internal { 54 54 struct scsi_transport_template t; ··· 242 242 spi_hold_mcs(starget) = 0; 243 243 spi_dv_pending(starget) = 0; 244 244 spi_initial_dv(starget) = 0; 245 - init_MUTEX(&spi_dv_sem(starget)); 245 + mutex_init(&spi_dv_mutex(starget)); 246 246 247 247 return 0; 248 248 } ··· 915 915 scsi_target_quiesce(starget); 916 916 917 917 spi_dv_pending(starget) = 1; 918 - down(&spi_dv_sem(starget)); 918 + mutex_lock(&spi_dv_mutex(starget)); 919 919 920 920 starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n"); 921 921 ··· 923 923 924 924 starget_printk(KERN_INFO, starget, "Ending Domain Validation\n"); 925 925 926 - up(&spi_dv_sem(starget)); 926 + mutex_unlock(&spi_dv_mutex(starget)); 927 927 spi_dv_pending(starget) = 0; 928 928 929 929 scsi_target_resume(starget); ··· 1075 1075 /* 0x04 */ "Parallel Protocol Request" 1076 1076 }; 1077 1077 1078 - void print_nego(const unsigned char *msg, int per, int off, int width) 1078 + static void print_nego(const unsigned char *msg, int per, int off, int width) 1079 1079 { 1080 1080 if (per) { 1081 1081 char buf[20];
+16 -47
drivers/scsi/sd.c
··· 49 49 #include <linux/blkpg.h> 50 50 #include <linux/kref.h> 51 51 #include <linux/delay.h> 52 + #include <linux/mutex.h> 52 53 #include <asm/uaccess.h> 53 54 54 55 #include <scsi/scsi.h> ··· 112 111 /* This semaphore is used to mediate the 0->1 reference get in the 113 112 * face of object destruction (i.e. we can't allow a get on an 114 113 * object after last put) */ 115 - static DECLARE_MUTEX(sd_ref_sem); 114 + static DEFINE_MUTEX(sd_ref_mutex); 116 115 117 116 static int sd_revalidate_disk(struct gendisk *disk); 118 117 static void sd_rw_intr(struct scsi_cmnd * SCpnt); ··· 194 193 { 195 194 struct scsi_disk *sdkp; 196 195 197 - down(&sd_ref_sem); 196 + mutex_lock(&sd_ref_mutex); 198 197 sdkp = __scsi_disk_get(disk); 199 - up(&sd_ref_sem); 198 + mutex_unlock(&sd_ref_mutex); 200 199 return sdkp; 201 200 } 202 201 ··· 204 203 { 205 204 struct scsi_disk *sdkp; 206 205 207 - down(&sd_ref_sem); 206 + mutex_lock(&sd_ref_mutex); 208 207 sdkp = dev_get_drvdata(dev); 209 208 if (sdkp) 210 209 sdkp = __scsi_disk_get(sdkp->disk); 211 - up(&sd_ref_sem); 210 + mutex_unlock(&sd_ref_mutex); 212 211 return sdkp; 213 212 } 214 213 ··· 216 215 { 217 216 struct scsi_device *sdev = sdkp->device; 218 217 219 - down(&sd_ref_sem); 218 + mutex_lock(&sd_ref_mutex); 220 219 kref_put(&sdkp->kref, scsi_disk_release); 221 220 scsi_device_put(sdev); 222 - up(&sd_ref_sem); 221 + mutex_unlock(&sd_ref_mutex); 223 222 } 224 223 225 224 /** ··· 232 231 **/ 233 232 static int sd_init_command(struct scsi_cmnd * SCpnt) 234 233 { 235 - unsigned int this_count, timeout; 236 - struct gendisk *disk; 237 - sector_t block; 238 234 struct scsi_device *sdp = SCpnt->device; 239 235 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; 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; 263 240 264 241 SCSI_LOG_HLQUEUE(1, printk("sd_init_command: disk=%s, block=%llu, " 265 242 "count=%d\n", disk->disk_name, ··· 380 401 SCpnt->transfersize = sdp->sector_size; 381 402 SCpnt->underflow = this_count << 9; 382 403 SCpnt->allowed = SD_MAX_RETRIES; 383 - 384 - queue: 385 404 SCpnt->timeout_per_command = timeout; 386 405 387 406 /* ··· 813 836 relatively rare error condition, no care is taken to avoid 814 837 unnecessary additional work such as memcpy's that could be avoided. 815 838 */ 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 && 839 + if (driver_byte(result) != 0 && 825 840 sense_valid && !sense_deferred) { 826 841 switch (sshdr.sense_key) { 827 842 case MEDIUM_ERROR: ··· 1604 1635 del_gendisk(sdkp->disk); 1605 1636 sd_shutdown(dev); 1606 1637 1607 - down(&sd_ref_sem); 1638 + mutex_lock(&sd_ref_mutex); 1608 1639 dev_set_drvdata(dev, NULL); 1609 1640 kref_put(&sdkp->kref, scsi_disk_release); 1610 - up(&sd_ref_sem); 1641 + mutex_unlock(&sd_ref_mutex); 1611 1642 1612 1643 return 0; 1613 1644 } ··· 1616 1647 * scsi_disk_release - Called to free the scsi_disk structure 1617 1648 * @kref: pointer to embedded kref 1618 1649 * 1619 - * sd_ref_sem must be held entering this routine. Because it is 1650 + * sd_ref_mutex must be held entering this routine. Because it is 1620 1651 * called on last put, you should always use the scsi_disk_get() 1621 1652 * scsi_disk_put() helpers which manipulate the semaphore directly 1622 1653 * and never do a direct kref_put().
+12 -31
drivers/scsi/sr.c
··· 44 44 #include <linux/interrupt.h> 45 45 #include <linux/init.h> 46 46 #include <linux/blkdev.h> 47 + #include <linux/mutex.h> 47 48 #include <asm/uaccess.h> 48 49 49 50 #include <scsi/scsi.h> ··· 91 90 /* This semaphore is used to mediate the 0->1 reference get in the 92 91 * face of object destruction (i.e. we can't allow a get on an 93 92 * object after last put) */ 94 - static DECLARE_MUTEX(sr_ref_sem); 93 + static DEFINE_MUTEX(sr_ref_mutex); 95 94 96 95 static int sr_open(struct cdrom_device_info *, int); 97 96 static void sr_release(struct cdrom_device_info *); ··· 134 133 { 135 134 struct scsi_cd *cd = NULL; 136 135 137 - down(&sr_ref_sem); 136 + mutex_lock(&sr_ref_mutex); 138 137 if (disk->private_data == NULL) 139 138 goto out; 140 139 cd = scsi_cd(disk); ··· 147 146 kref_put(&cd->kref, sr_kref_release); 148 147 cd = NULL; 149 148 out: 150 - up(&sr_ref_sem); 149 + mutex_unlock(&sr_ref_mutex); 151 150 return cd; 152 151 } 153 152 ··· 155 154 { 156 155 struct scsi_device *sdev = cd->device; 157 156 158 - down(&sr_ref_sem); 157 + mutex_lock(&sr_ref_mutex); 159 158 kref_put(&cd->kref, sr_kref_release); 160 159 scsi_device_put(sdev); 161 - up(&sr_ref_sem); 160 + mutex_unlock(&sr_ref_mutex); 162 161 } 163 162 164 163 /* ··· 238 237 case ILLEGAL_REQUEST: 239 238 if (!(SCpnt->sense_buffer[0] & 0x90)) 240 239 break; 241 - if (!blk_fs_request(SCpnt->request)) 242 - break; 243 240 error_sector = (SCpnt->sense_buffer[3] << 24) | 244 241 (SCpnt->sense_buffer[4] << 16) | 245 242 (SCpnt->sense_buffer[5] << 8) | ··· 312 313 * quietly refuse to do anything to a changed disc until the 313 314 * changed bit has been reset 314 315 */ 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 316 return 0; 333 317 } 334 318 ··· 403 421 */ 404 422 SCpnt->transfersize = cd->device->sector_size; 405 423 SCpnt->underflow = this_count << 9; 406 - 407 - queue: 408 424 SCpnt->allowed = MAX_RETRIES; 409 425 SCpnt->timeout_per_command = timeout; 410 426 ··· 742 762 /* failed, drive doesn't have capabilities mode page */ 743 763 cd->cdi.speed = 1; 744 764 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); 765 + CDC_DVD | CDC_DVD_RAM | 766 + CDC_SELECT_DISC | CDC_SELECT_SPEED | 767 + CDC_MRW | CDC_MRW_W | CDC_RAM); 747 768 kfree(buffer); 748 769 printk("%s: scsi-1 drive\n", cd->cdi.name); 749 770 return; ··· 826 845 * sr_kref_release - Called to free the scsi_cd structure 827 846 * @kref: pointer to embedded kref 828 847 * 829 - * sr_ref_sem must be held entering this routine. Because it is 848 + * sr_ref_mutex must be held entering this routine. Because it is 830 849 * called on last put, you should always use the scsi_cd_get() 831 850 * scsi_cd_put() helpers which manipulate the semaphore directly 832 851 * and never do a direct kref_put(). ··· 855 874 856 875 del_gendisk(cd->disk); 857 876 858 - down(&sr_ref_sem); 877 + mutex_lock(&sr_ref_mutex); 859 878 kref_put(&cd->kref, sr_kref_release); 860 - up(&sr_ref_sem); 879 + mutex_unlock(&sr_ref_mutex); 861 880 862 881 return 0; 863 882 }
+111 -91
drivers/scsi/sr_ioctl.c
··· 31 31 32 32 module_param(xa_test, int, S_IRUGO | S_IWUSR); 33 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 + } 34 107 35 108 #define IOCTL_RETRIES 3 36 109 ··· 118 45 struct packet_command cgc; 119 46 int ntracks, ret; 120 47 121 - if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCHDR, &tochdr))) 48 + ret = sr_read_tochdr(cdi, &tochdr); 49 + if (ret) 122 50 return ret; 123 51 124 52 ntracks = tochdr.cdth_trk1 - tochdr.cdth_trk0 + 1; ··· 134 60 trk1_te.cdte_track = ti->cdti_trk1; 135 61 trk1_te.cdte_format = CDROM_MSF; 136 62 137 - if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &trk0_te))) 63 + ret = sr_read_tocentry(cdi, &trk0_te); 64 + if (ret) 138 65 return ret; 139 - if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &trk1_te))) 66 + ret = sr_read_tocentry(cdi, &trk1_te); 67 + if (ret) 140 68 return ret; 141 69 142 70 memset(&cgc, 0, sizeof(struct packet_command)); ··· 152 76 cgc.data_direction = DMA_NONE; 153 77 cgc.timeout = IOCTL_TIMEOUT; 154 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; 155 103 } 156 104 157 105 /* We do our own retries because we want to know what the specific ··· 329 229 int i, rc, have_datatracks = 0; 330 230 331 231 /* look for data tracks */ 332 - if (0 != (rc = sr_audio_ioctl(cdi, CDROMREADTOCHDR, &toc_h))) 232 + rc = sr_read_tochdr(cdi, &toc_h); 233 + if (rc) 333 234 return (rc == -ENOMEDIUM) ? CDS_NO_DISC : CDS_NO_INFO; 334 235 335 236 for (i = toc_h.cdth_trk0; i <= toc_h.cdth_trk1; i++) { 336 237 toc_e.cdte_track = i; 337 238 toc_e.cdte_format = CDROM_LBA; 338 - if (sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &toc_e)) 239 + if (sr_read_tocentry(cdi, &toc_e)) 339 240 return CDS_NO_INFO; 340 241 if (toc_e.cdte_ctrl & CDROM_DATA_TRACK) { 341 242 have_datatracks = 1; ··· 362 261 363 262 return 0; 364 263 } 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 264 370 265 int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) 371 266 { ··· 426 329 427 330 int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg) 428 331 { 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 332 switch (cmd) { 441 333 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 - 334 + return sr_read_tochdr(cdi, arg); 460 335 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 - 336 + return sr_read_tocentry(cdi, arg); 337 + case CDROMPLAYTRKIND: 338 + return sr_play_trkind(cdi, arg); 505 339 default: 506 - result = -EINVAL; 340 + return -EINVAL; 507 341 } 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 342 } 517 343 518 344 /* -----------------------------------------------------------------------
+9 -33
drivers/scsi/st.c
··· 38 38 #include <linux/devfs_fs_kernel.h> 39 39 #include <linux/cdev.h> 40 40 #include <linux/delay.h> 41 + #include <linux/mutex.h> 41 42 42 43 #include <asm/uaccess.h> 43 44 #include <asm/dma.h> ··· 194 193 195 194 static int st_probe(struct device *); 196 195 static int st_remove(struct device *); 197 - static int st_init_command(struct scsi_cmnd *); 198 196 199 197 static void do_create_driverfs_files(void); 200 198 static void do_remove_driverfs_files(void); ··· 206 206 .probe = st_probe, 207 207 .remove = st_remove, 208 208 }, 209 - .init_command = st_init_command, 210 209 }; 211 210 212 211 static int st_compression(struct scsi_tape *, int); ··· 219 220 220 221 #define to_scsi_tape(obj) container_of(obj, struct scsi_tape, kref) 221 222 222 - static DECLARE_MUTEX(st_ref_sem); 223 + static DEFINE_MUTEX(st_ref_mutex); 223 224 224 225 225 226 #include "osst_detect.h" ··· 236 237 { 237 238 struct scsi_tape *STp = NULL; 238 239 239 - down(&st_ref_sem); 240 + mutex_lock(&st_ref_mutex); 240 241 write_lock(&st_dev_arr_lock); 241 242 242 243 if (dev < st_dev_max && scsi_tapes != NULL) ··· 258 259 STp = NULL; 259 260 out: 260 261 write_unlock(&st_dev_arr_lock); 261 - up(&st_ref_sem); 262 + mutex_unlock(&st_ref_mutex); 262 263 return STp; 263 264 } 264 265 ··· 266 267 { 267 268 struct scsi_device *sdev = STp->device; 268 269 269 - down(&st_ref_sem); 270 + mutex_lock(&st_ref_mutex); 270 271 kref_put(&STp->kref, scsi_tape_release); 271 272 scsi_device_put(sdev); 272 - up(&st_ref_sem); 273 + mutex_unlock(&st_ref_mutex); 273 274 } 274 275 275 276 struct st_reject_data { ··· 4140 4141 } 4141 4142 } 4142 4143 4143 - down(&st_ref_sem); 4144 + mutex_lock(&st_ref_mutex); 4144 4145 kref_put(&tpnt->kref, scsi_tape_release); 4145 - up(&st_ref_sem); 4146 + mutex_unlock(&st_ref_mutex); 4146 4147 return 0; 4147 4148 } 4148 4149 } ··· 4155 4156 * scsi_tape_release - Called to free the Scsi_Tape structure 4156 4157 * @kref: pointer to embedded kref 4157 4158 * 4158 - * st_ref_sem must be held entering this routine. Because it is 4159 + * st_ref_mutex must be held entering this routine. Because it is 4159 4160 * called on last put, you should always use the scsi_tape_get() 4160 4161 * scsi_tape_put() helpers which manipulate the semaphore directly 4161 4162 * and never do a direct kref_put(). ··· 4177 4178 put_disk(disk); 4178 4179 kfree(tpnt); 4179 4180 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 4181 } 4204 4182 4205 4183 static int __init init_st(void)
+1
include/linux/pci_ids.h
··· 181 181 #define PCI_DEVICE_ID_LSI_FC929X 0x0626 182 182 #define PCI_DEVICE_ID_LSI_FC939X 0x0642 183 183 #define PCI_DEVICE_ID_LSI_FC949X 0x0640 184 + #define PCI_DEVICE_ID_LSI_FC949ES 0x0646 184 185 #define PCI_DEVICE_ID_LSI_FC919X 0x0628 185 186 #define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701 186 187 #define PCI_DEVICE_ID_LSI_61C102 0x0901
+2
include/linux/raid_class.h
··· 31 31 RAID_LEVEL_LINEAR, 32 32 RAID_LEVEL_0, 33 33 RAID_LEVEL_1, 34 + RAID_LEVEL_10, 34 35 RAID_LEVEL_3, 35 36 RAID_LEVEL_4, 36 37 RAID_LEVEL_5, 38 + RAID_LEVEL_50, 37 39 RAID_LEVEL_6, 38 40 }; 39 41
+6
include/scsi/iscsi_if.h
··· 168 168 169 169 #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 170 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 + **/ 171 177 #define iscsi_hostdata(_hostdata) ((void*)_hostdata + sizeof(unsigned long)) 172 178 173 179 /*
+6
include/scsi/scsi.h
··· 32 32 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 33 33 34 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 + /* 35 41 * SCSI opcodes 36 42 */ 37 43
-1
include/scsi/scsi_cmnd.h
··· 151 151 extern void scsi_put_command(struct scsi_cmnd *); 152 152 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 153 153 extern void scsi_finish_command(struct scsi_cmnd *cmd); 154 - extern void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd); 155 154 156 155 #endif /* _SCSI_SCSI_CMND_H */
+2 -1
include/scsi/scsi_host.h
··· 5 5 #include <linux/list.h> 6 6 #include <linux/types.h> 7 7 #include <linux/workqueue.h> 8 + #include <linux/mutex.h> 8 9 9 10 struct block_device; 10 11 struct completion; ··· 470 469 spinlock_t default_lock; 471 470 spinlock_t *host_lock; 472 471 473 - struct semaphore scan_mutex;/* serialize scanning activity */ 472 + struct mutex scan_mutex;/* serialize scanning activity */ 474 473 475 474 struct list_head eh_cmd_q; 476 475 struct task_struct * ehandler; /* Error recovery thread. */
+2 -5
include/scsi/scsi_transport.h
··· 30 30 struct transport_container device_attrs; 31 31 32 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. 33 + * If set, called from sysfs and legacy procfs rescanning code. 37 34 */ 38 - struct device *(*target_parent)(struct Scsi_Host *, int, uint); 35 + int (*user_scan)(struct Scsi_Host *, uint, uint, uint); 39 36 40 37 /* The size of the specific transport attribute structure (a 41 38 * space of this size will be left at the end of the
+4
include/scsi/scsi_transport_fc.h
··· 303 303 /* Fixed Attributes */ 304 304 u64 node_name; 305 305 u64 port_name; 306 + u64 permanent_port_name; 306 307 u32 supported_classes; 307 308 u8 supported_fc4s[FC_FC4_LIST_SIZE]; 308 309 char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; ··· 339 338 (((struct fc_host_attrs *)(x)->shost_data)->node_name) 340 339 #define fc_host_port_name(x) \ 341 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) 342 343 #define fc_host_supported_classes(x) \ 343 344 (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) 344 345 #define fc_host_supported_fc4s(x) \ ··· 429 426 /* host fixed attributes */ 430 427 unsigned long show_host_node_name:1; 431 428 unsigned long show_host_port_name:1; 429 + unsigned long show_host_permanent_port_name:1; 432 430 unsigned long show_host_supported_classes:1; 433 431 unsigned long show_host_supported_fc4s:1; 434 432 unsigned long show_host_symbolic_name:1;
+67 -8
include/scsi/scsi_transport_iscsi.h
··· 23 23 #ifndef SCSI_TRANSPORT_ISCSI_H 24 24 #define SCSI_TRANSPORT_ISCSI_H 25 25 26 + #include <linux/device.h> 26 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; 27 33 28 34 /** 29 35 * struct iscsi_transport - iSCSI Transport template ··· 54 48 char *name; 55 49 unsigned int caps; 56 50 struct scsi_host_template *host_template; 51 + /* LLD session/scsi_host data size */ 57 52 int hostdata_size; 53 + /* LLD iscsi_host data size */ 54 + int ihostdata_size; 55 + /* LLD connection data size */ 56 + int conndata_size; 58 57 int max_lun; 59 58 unsigned int max_conn; 60 59 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); 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 65 int (*bind_conn) (iscsi_sessionh_t session, iscsi_connh_t conn, 66 66 uint32_t transport_fd, int is_leading); 67 67 int (*start_conn) (iscsi_connh_t conn); 68 68 void (*stop_conn) (iscsi_connh_t conn, int flag); 69 - void (*destroy_conn) (iscsi_connh_t conn); 69 + void (*destroy_conn) (struct iscsi_cls_conn *conn); 70 70 int (*set_param) (iscsi_connh_t conn, enum iscsi_param param, 71 71 uint32_t value); 72 - int (*get_param) (iscsi_connh_t conn, enum iscsi_param param, 73 - 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); 74 76 int (*send_pdu) (iscsi_connh_t conn, struct iscsi_hdr *hdr, 75 77 char *data, uint32_t data_size); 76 78 void (*get_stats) (iscsi_connh_t conn, struct iscsi_stats *stats); ··· 87 73 /* 88 74 * transport registration upcalls 89 75 */ 90 - extern int iscsi_register_transport(struct iscsi_transport *tt); 76 + extern struct scsi_transport_template *iscsi_register_transport(struct iscsi_transport *tt); 91 77 extern int iscsi_unregister_transport(struct iscsi_transport *tt); 92 78 93 79 /* ··· 96 82 extern void iscsi_conn_error(iscsi_connh_t conn, enum iscsi_err error); 97 83 extern int iscsi_recv_pdu(iscsi_connh_t conn, struct iscsi_hdr *hdr, 98 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); 99 130 100 131 #endif
+1 -1
include/scsi/scsi_transport_spi.h
··· 54 54 unsigned int support_qas; /* supports quick arbitration and selection */ 55 55 /* Private Fields */ 56 56 unsigned int dv_pending:1; /* Internal flag */ 57 - struct semaphore dv_sem; /* semaphore to serialise dv */ 57 + struct mutex dv_mutex; /* semaphore to serialise dv */ 58 58 }; 59 59 60 60 enum spi_signal_type {