Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| 5c6e2d25 | 2020-09-23 15:24:16 | Remove 'void *sc_sdhook' member of sd_softc. Unused since mpi@ removed sd_shutdown() in 2014. | ||
| 664c6166 | 2020-09-22 19:32:51 | Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd' member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@ | ||
| 37656c4c | 2020-09-14 18:44:54 | No need to check for SDEV_DYING as the first thing in both branches of an if/else. Just do it once before the if. Move the SC_DEBUG() documenting entry into sdopen() to before the various error bailouts. | ||
| 3e16148d | 2020-09-13 14:26:56 | Always use READ(16)/WRITE(16) commands for disks large enough to require READ(16)/WRITE(16) to access the last sectors Fixes (at least) large 512E (a.k.a. emulated 512-byte sector) devices plugged into overly helpful USB <-> ATA/ATAPI bridges. Which can tell you they are using 512-byte sector addresses but spontaneously/silently interpret READ(10)/WRITE(10) commands as using 4K sector addresses/sizes. Diagnosed and fix tested with James Cook. Thanks! | ||
| 3da569d0 | 2020-09-12 17:03:51 | Use SID_SCSI2_RESPONSE instead of '2' when checking INQUIRY data format. | ||
| 7be1499a | 2020-09-12 16:51:04 | No need to check inq for NULL when it always points at the inqdata inside a scsi_link. | ||
| 96a16d09 | 2020-09-12 15:54:51 | No need to ask for extra INQUIRY data, all available data is already cached in scsi_link's inqdata. | ||
| ac22ea16 | 2020-09-08 12:36:42 | If SCSI_IGNORE_ILLEGAL_REQUEST is set no error is returned from scsi_xs_sync() when the request is unsupported. So check mode sense(6) and mode sense(10) results for valid headers before passing the results back. Avoid overwriting any error that was returned. ok jmatthew@ | ||
| 65e0582e | 2020-09-05 14:21:52 | Rename SID_INQUIRY_HDR (a.k.a. 5) to more explicit SID_SCSI2_HDRLEN and use it to replace various uses of '5' when calculating the amount of data in the INQUIRY response. Matches up more naturally with SID_SCSI2_ALEN. Also use to fix SCSIDEBUG display of INQUIRY responses to show correct count of bytes received/available. | ||
| ed09ea98 | 2020-09-02 23:41:01 | Add #define SID_SCSI2_RESPONSE 0x2 to allow elimination of another bunch of magic numbers. As the nearby comment says '< 2 is obsolete. >2 is reserved'. So 0x2 is just right. | ||
| eccd596d | 2020-09-01 12:17:52 | Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big to struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test) | ||
| 626e0bda | 2020-08-30 19:41:25 | Compactify SDEV_/ADEV_ flags & quirks to eliminate the gaps in bit use and thus allow shrinking the names arrays. | ||
| b8fc71d1 | 2020-08-29 19:34:07 | More recent MMC specificiations add READ(12)/WRITE(12). So add cd_cmd_rw12() and let cdstart() use it if the requested i/o is unable to fit into a READ(10). Certainly better than silently truncating the i/o into a READ(10)/WRITE(10). | ||
| 57a0c0c6 | 2020-08-29 18:20:12 | Use ISSET() to check b_flags for B_READ. | ||
| 3da91bb4 | 2020-08-29 17:10:06 | Missing u_int -> u_int32_t chunks from previous. | ||
| 81e09b69 | 2020-08-29 16:07:19 | Use u_int32_t for nsecs, making it crystal clear that the values are expected to fit into a 4-byte field. | ||
| 4459c984 | 2020-08-29 02:03:31 | Have [cd|sd]_cmd_rw[6|10|12|16] return the length of the created command and have the caller assign it to xs->cmdlen. Pass in xs->cmd instead of xs. A slightly cleaner API that provides the potential of detecting and reacting to a failure to create the desired command. | ||
| 257244d2 | 2020-08-28 21:01:54 | Shuffle [cd|sd]start code into closer alignment. Move the initialization of the xs fields to a more convenient location, shrinking upcoming diffs. Nuke some Captain Obvious comments. | ||
| 927e8030 | 2020-08-28 18:57:16 | Abstract cd_cmd_rw6() and cd_cmd_rw10() a la sd_cmd_rw6() and sd_cmd_rw10(). | ||
| b9499433 | 2020-08-28 15:18:14 | Nuke CDF_ANCIENT, SDF_ANCIENT SDEV_ONLYBIG and bogus check of SID_RelAdr in favour of simply using the device's claimed SCSI level of support. Except of course for ATAPI/USB devices which often don't claim anything. Keep assuming they are at least SCSI-2. Use consistant tests in sdminphys/cdminphys/sdstart/cdstart. | ||
| fc548c49 | 2020-08-26 13:57:19 | Remove needless uses of SDEV_ONLYBIG. It was always set when SDEV_UMASS was set, and was always checked in concert with SDEV_ATAPI. Just rely on SDEV_ATAPI and SDEV_UMASS in all but the one place sd(4) where SDEV_ONLYBIG is set independently of SDEV_ATAPI/_UMASS. ok jmatthew@ | ||
| 6a0d0cec | 2020-08-22 15:07:11 | The last timeout_add(sc_timeout) died in the great XS_NO_CCB purge of 2017. Nuke pointless timeout_set(sc_timoeut) and timeout_del(sc_timeout) calls and the sc_timeout fields themselves. | ||
| d35ed37d | 2020-08-20 01:47:45 | Revert DYING. At least some USB memory sticks get very upset. | ||
| 382a5d4c | 2020-08-19 22:46:19 | Replace last 2 'blah & (flag1 | flag2) == 0' with !ISSET(blah, (flag1 | flag2)). | ||
| 9ed449b7 | 2020-08-19 14:53:39 | Nuke SDF_DYING, CDF_DYING and ST_DYING flags. Use the scsi_link flag SDEV_S_DYING instead. Makes it clear that the scsi_link and the [cd|sd|st] device always agree on their state. | ||
| f803c2f9 | 2020-08-18 16:30:38 | Try to avoid a theoretical infinite loop while detaching all the scsi_link's on the bus. Use SLIST_FOREACH_SAFE() rather than 'while (!SLIST_EMPTY())'' as there is a condition which would cause scsi_detach_link() to return without removing the scsi_link from the SLIST. | ||
| ecb1c2be | 2020-08-16 13:39:21 | Don't include scsi_debug.h via scsiconf.h. Nobody but scsi/* should be using the contents thereof. Compile tests by martjn@ (alpha), visa@ (sgi) jmatthew@ (sparc64) aoyama@ (luna88k) | ||
| 66dcdfe8 | 2020-08-15 17:50:45 | The last SET()s of CDF_WAITING, SDF_WAITING, and ST_WAITING died in the great XS_NO_CCB purge of 2017. Nuke pointless ISSET()/CLR() checks and the #define's. | ||
| 58fa39c1 | 2020-08-14 16:45:48 | Redistribute and tweak the scsi_[attach|probe|detach]_[bus|target|lun]() code to make the three variants more similar and easier to understand. Ensures consistent error checks and eliminates pointless adapter_buswidth checks when processing the list of scsi_links. | ||
| bba39a67 | 2020-08-11 15:23:57 | Explicitly #include <scsi/scsi_debug.h> rather than assuming scsiconf.h will do it. Prepares for removal of #include <scsi/scsi_debug.h> from scsiconf.h as soon as the alpha tester digs out from hurricane to compile last untested files. | ||
| ae7c6741 | 2020-08-10 12:12:44 | Minor code shuffle to get all *_activate(), *_probe() and *_detach() functions nestled together. Rename scsibusprint() to scsibussubprint() since it is used with scsibussubmatch(). | ||
| 9c2a17ab | 2020-08-09 15:06:01 | More code shuffling. Fix a rename missed in previous. | ||
| 14832242 | 2020-08-09 13:29:08 | Shuffle functions and declarations around to more logical grouping. Nuke some leading whitespace. Rename some local functions. | ||
| cdca80fc | 2020-08-08 13:08:23 | scsi_link's are born knowing their bus. Use that instead of passing extra scsibus_softc pointers around. | ||
| c85ebcd4 | 2020-07-27 19:19:49 | Refactor scsi_show_flags() to allow 32-bit flags. Display unnamed flags as one hex value after named flags. Make flag name arrays NULL terminated rathar than fixed size. | ||
| 6e0c44f3 | 2020-07-27 13:08:25 | SDEV_2NDBUS is gone. Update flagnames[] appropriately. | ||
| 7380a3a4 | 2020-07-22 13:16:04 | Nuke unused struct scsi_link members of adapter softc's where the driver successfully compiles on one or more of amd64, i386, hppa. | ||
| e5eae15d | 2020-07-20 14:41:12 | Move remaining scsi bus initialization info from "prototype scsi link" fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables. | ||
| ead808c4 | 2020-07-19 18:57:57 | Move the adapter related items (luns, adapter, adapter_target, adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k). | ||
| 67c3123b | 2020-07-16 14:44:55 | Access scsibus_softc info (luns, adapter, adapter_target, adapter_softc, adapter_buswidth) via link->bus rather than using copies currently residing in the link. | ||
| 41e86d54 | 2020-07-16 12:38:43 | Beef up struct scsibus_softc to hold the information needed to initialize the scsi_link's on the bus. After sucking this information out of the "prototype" link provided by the scsibus_attach_arg, no need to keep a pointer to that prototype. | ||
| 17e73562 | 2020-07-05 20:17:25 | Nuke struct scsi_link's "scsibus" member. The two drivers using it (ahc(4) and qlw(4)) can just compare the values of the "bus" member directly. A slightly different path to the same result that matthew@ traversed in his work culminating in scsiconf.h r1.146. | ||
| 0fbd355c | 2020-06-30 18:43:36 | Nuke unneeded 'sa_inqbuf' member of struct scsi_attach_args. It always points to the inquiry data contained in the struct scsi_link pointed to by the other member, sa_sc_link. | ||
| a667fc03 | 2020-06-30 18:05:02 | Garbage collect SDEV_S_WAITING, last used in scsi_base.c r1.167 in 2010. Part of matthew@'s reverted scsiconf.h r1.146. | ||
| 1b83eff9 | 2020-06-27 21:01:20 | Garbage collect SDEV_2NDBUS. Only used in isp(4) which was removed in 2015 in favour of ql*(4). | ||
| a7997e14 | 2020-06-27 14:29:44 | No need to bzero()/memset() 'struct scsibus_attach_args' variables immediately before initializing the only field in the struct. | ||
| 182e13b7 | 2020-06-24 18:59:30 | Use SDEV_NO_ADAPTER_TARGET instead of the value that is being aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff. | ||
| 13a00b8a | 2020-06-24 16:07:53 | Adapters that do not appear as a target on the SCSI bus must set 'adapter_target' to a value greater than or equal to 'adapater_buswidth' to allow all possible targets to be probed. Add SDEV_NO_ADAPTER_TARGET (0xffff), a value guaranteed to be greater than or equal to the u_int16_t 'adapter_buswidth'. ok dlg@ as part of a larger diff. | ||
| 586de4b8 | 2020-03-12 19:21:01 | Pass scsi_mode_sense_buf pointers to scsi_mode_sense[_buf]() rather than scsi_mode_header[_big] pointers to the same data. Continues the umtamgling and simplification of the mode sense code. CID 1491299 CID 1491297 | ||
| b9aee7ab | 2020-03-12 16:15:03 | Check for short mode sense error inside scsi_mode_sense_big() rather than after the only invocation. No functional change. | ||
| fe20f155 | 2020-03-12 13:49:25 | Eliminate 'len' parameter from scsi_mode_sense[_big](). It's always sizeof(struct scsi_mode_sense_buf). No functional change. | ||
| b2c9587a | 2020-03-11 19:23:08 | No need to pass 20000 to scsi_mode_sense[_big]() as the desired xs->timeout. Just set xs->timeout to 20000 and drop the parameter. No functional change. | ||
| 1d2f13ac | 2020-03-10 02:01:21 | Access 4-byte address field with _4btol() not _8btol(), fixing detecton of a 0 value. CID 1488899 | ||
| 7f649021 | 2020-02-20 16:26:01 | Relax the grip the dead hand of QBUS (a.k.a. MAXPHYS) has on the throat of physio(). Allows individual devices to eventually be modified to support larger physio() (a.k.a. 'raw') i/o's if they prove capable of them. No immediate functional change. Tested for many weeks by and ok robert@. | ||
| 4674773e | 2020-02-06 21:06:15 | Try to reduce the lying, hyperbolic or obsolete commentary on the relationships between various scsi structs. | ||
| ca82ddf5 | 2020-02-05 21:50:41 | Ooops. Missed a file in nuke of scsi_minphys. mpath_minphys() needs to check dev_minphys for NULL before calling it. | ||
| 21ceeee0 | 2020-02-05 16:29:29 | Nuke unnecessary abstraction 'scsi_minphys()' which just calls 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio(). | ||
| 0d9c2585 | 2020-01-27 07:41:02 | Make the commonalities of cdminphys, sdminphys and stminphys more obvious by consistently using the variable names and idiom of sdminphys. No functional change. | ||
| 9f36bc94 | 2020-01-26 00:53:31 | Shuffle some names around to make reading the code less headache inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys' to reflect what it is supposed to do. Use consistent naming convention (<dev>_minphys) for the actual device functions. No functional change. | ||
| f5f2a2d0 | 2020-01-25 21:40:34 | Ensure scsi_minphys() is always called on the physio() path. Will allow simplification of individual driver *minphys() functions. ok jmatthew@ as part of larger diff | ||
| 854a1b2d | 2020-01-24 05:14:51 | cleanup unused headers generated by config ok tedu@ krw@ deraadt@ | ||
| a867c811 | 2020-01-23 07:52:59 | Use a consistant idiom/format when declaring scsi_adapter structures in drivers. Terse one liners, NULLs instead of 0's, explicitly specify all members, etc. Nuke #ifdef notyet blocks related to the scsi_adapter in aic. No intentional functional change. ok tedu@ | ||
| 911b201f | 2020-01-22 00:17:46 | scsi_delay(): sleep without lbolt If we want to sleep for a multiple of seconds we can do that without involving lbolt. This may cause some paths to sleep longer than they have on average, as sleeping on lbolt wakes you up within one second, not after one second. If this is a problem we will need to shorten the intervals given to scsi_delay(). With insight from deraadt@. ok krw@ | ||
| 89ea875e | 2019-12-08 16:38:45 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| ce9fc84e | 2019-12-08 13:05:12 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| b088678d | 2019-12-07 15:16:24 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 57343048 | 2019-12-07 14:13:49 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 43b5650c | 2019-12-07 13:03:57 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 0af55edb | 2019-12-06 16:57:24 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 5b140de7 | 2019-12-06 15:13:07 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 3d8812d3 | 2019-12-06 13:53:26 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 9c0f6582 | 2019-12-05 21:32:13 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 906b410b | 2019-12-05 19:53:05 | Don't discard error from mode sense (6) if mode sense (10) is not attempted. | ||
| 85f9847c | 2019-12-05 18:42:13 | Shrink scsi_mode_do_sense() parameter list by eliminating the three pointers returning possible block descriptor values for block size, block count and density. Most calls were passing "NULL, NULL, NULL" since they did not care. Call scsi_parse_blkdesc() directly in those few cases where one or more of the values is of interest. No intentional functional change. | ||
| 054c2353 | 2019-12-05 16:33:53 | No need for 'byte2' parameter to scsi_mode_sense[_big]() since we always pass 0. i.e. never disable block descriptors, never accept long LBA values. | ||
| 5c0ba001 | 2019-12-05 16:16:01 | Move prototypes for scsi_mode_sense(), scsi_mode_sense_big(), scsi_mode_sense_page() and scsi_mode_sense_big_page() into scsi_base.c. They are just internal helper functions for scsi_do_mode_sense(). | ||
| 43389b15 | 2019-12-04 10:22:05 | Convert infinite sleeps to {m,t}sleep_nsec(9). ok krw@, jca@ | ||
| 724ba685 | 2019-12-03 15:58:28 | Check for expected mode sense page code as well as expected mode page length when constructing the pointer to the page data. Remove now unneeded DISK_PGCODE(). Usual misc whitespace/modernization tweaks to functions being modified. | ||
| c24e0dbc | 2019-12-03 13:25:57 | Add display of mode sense data to SCSIDEBUG. | ||
| c340ff09 | 2019-12-02 17:53:05 | Have SCSIDEBUG show the number of bytes of VPD inquiry data received, not the number of bytes that were available in the buffer. | ||
| 4213291d | 2019-12-02 15:10:27 | Don't forget the scsi_vpd_header when calculating the number of bytes obtained by scsi_inquire_vpd(). | ||
| d3956194 | 2019-12-01 16:56:26 | Tweak variable names to be consistent with 'pg_code' and 'pg_length' field names in sense mode structs. | ||
| e41f21f1 | 2019-12-01 16:26:10 | Make prototype and implementation signatures the same by removing 'const' from the only two 'const int' instances. | ||
| 050be8af | 2019-12-01 15:41:43 | Don't overwrite original error returned by scsi_do_mode_sense(). | ||
| 35e05388 | 2019-11-29 15:17:28 | DISK_PGCODE() #define includes a check for NULL, so no need to do the same check before invoking it. | ||
| f82a5783 | 2019-11-29 14:06:21 | Add defines for changer mode page codes. Move AUDIO_PAGE define to nestle amoung its friends. | ||
| 577d7b69 | 2019-11-28 17:25:59 | Abstract mode sense block descriptor parsing into a separate function. | ||
| 7733df1a | 2019-11-28 16:41:07 | Align an annoying comment. | ||
| 944c98ad | 2019-11-28 16:27:35 | Always pass a pointer to 'big' to scsi_do_mode_sense(). Sets up some simplifications. | ||
| 56ce827e | 2019-11-26 20:51:20 | Reinitialize 'err' to ensure we are not checking a stale value. Discovered by and ok tim@ | ||
| ac47be6b | 2019-11-26 20:48:03 | Don't zero existing values for density, block_count and block_size in scsi_do_mode_sense(). Just update the values when valid data is available. Initialize the variables passed to scsi_do_mode_sense() in the one instance where they weren't already set. Fixes issue with softraid crypto volumes on 4K-sector disks. Found, fix tested, and ok tim@ | ||
| b1c28262 | 2019-11-25 17:48:31 | Use scsi_read_cap[10|16] instead of re-rolling the code. More careful initialization, better error/debug messages. | ||
| 85680492 | 2019-11-25 17:02:56 | Move struct scsi_read_cap_data and struct scsi_read_cap_data_16 to scsi_all.h. Add scsi_read_cap_10() and scsi_read_cap_16() functions to scsi_base.c, i.e. move logic to do actual READ_CAPACITY commands out of sd_read_cap() and sd_read_cap_16(). This will allow the READ_CAPACITY code to be reused by cd(4). Return -1 for errors where the error code is just discarded, reducing ENOMEM, ENXIO, EIO uses. No intentional functional change. | ||
| c3094a8a | 2019-11-23 17:10:13 | Consistently use ISSET() to check for set flags. | ||
| 1b9e05ce | 2019-11-23 12:27:32 | Consistently use !ISSET() to check for unset flags. | ||
| dacf4336 | 2019-11-23 01:16:05 | Consistently use SET() to set bits. | ||
| 64e2b1d6 | 2019-11-22 15:34:29 | Be consistent and always use CLR() to clear flags. | ||
| 0e3cac37 | 2019-11-21 23:22:14 | Be consistent and always use [!]ISSET() to test flags in xs->flags. | ||
| 36e286aa | 2019-11-21 22:31:26 | Be consistent and always use SET() to set flags in xs->flags. | ||
| 33dc79de | 2019-11-10 17:55:57 | Tedu scsi_scanner.h as krw@ intended to do |