summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2005-07-05Since scsi_link now includes a copy of the INQUIRY data, don't keep aKenneth R Westerback
copy of the vendor/product/revision fields in sd_softc. Just use the INQUIRY data to build the disklabel 'label' when required. No functional change.
2005-07-03Add missing reserved byte to page_disk_format struct inKenneth R Westerback
scsi_disk_pages union. From FreeBSD and SCSI spec.
2005-07-02Remove unused cd_softc.name field. Use the saved INQUIRY data inKenneth R Westerback
scsi_link to determine device type, rather than keeping a copy in sd_softc.type. Remove unused sd_softc.type field.
2005-07-02Remove unused struct sd_ops.Kenneth R Westerback
2005-07-02Unused files.Kenneth R Westerback
2005-07-02Don't use READ FORMAT CAPACITIES to determine the size of ATAPI sdKenneth R Westerback
devices. Use READ CAPACITY like NetBSD, FreeBSD, Linux and OpenSolaris do. Well, NetBSD keeps READ FORMAT CAPACITIES as a backup. Fixes problems with devices (such as my IBM USB Memory Key) which return block counts that are off by one for READ FORMAT CAPACITIES. This eliminates the significant difference between sd_atapi.c and sd_scsi.c so merge sd_scsi.c into sd.c and just be careful to mark ATAPI removable devices as both SDEV_NOSYNCCACHE and unable to return MODE SENSE page 4 info. All geometry faking is now in one place. Where it can be 'improved'. sd_scsi.c, sd_atapi.c and atapi_disk.h will be removed as a result.
2005-06-27Further cleanup and rationalize sd_scsibus_getparms(). No (intended)Kenneth R Westerback
functional change. ok tdeval@
2005-06-27Zap unused member of cd_softc: sc_ops.Kenneth R Westerback
2005-06-24Fix botch introduced in r1.12. reduced_geometry.sectors is a 5 byteKenneth R Westerback
field, with reduced_geometry.sectors[0] not being sectors/track. Add _5btol() to correctly parse entire field. From NetBSD.
2005-06-24Eliminate sd_scsibus_get_optparms() as unnecessary, instead gettingKenneth R Westerback
the blocksize from scsi_size() at the same time as the capacity is found. Use the fake geometry already present in sd_scsibus_get_parms(), which is identical to the one _optparms used. Eliminates another old mode sense usage and associated struct. Only affects T_OPTICAL sd devices, which seem extremely rare. Similar to what netbsd does, and freebsd as far as I can make out.
2005-06-24Move st.c to new mode sense mechanism. Don't save page0 data (if any), justKenneth R Westerback
ask for it when needed. Eliminate the page_0_size quirk. Tested on various tape drives by myself, hshoexer@ and henning@.
2005-06-23Reword some comments to better reflect reality. Remove some unhelpfulKenneth R Westerback
debugging statements. As a result remove an used variable.
2005-06-23Don't discard the blocksize information provided by the READ CAPACITYKenneth R Westerback
command. Return it in a new parameter to scsi_size.
2005-06-22Get rpm from filled in structure, not unused one. Remove nowKenneth R Westerback
unreferenced variable. Fixes rpm value for FLEX GEOMETRY devices.
2005-06-19Eradicate unused struct atapi_sd_mode_data. Eradicate structKenneth R Westerback
atapi_capacity_descriptor in favour of equivalent struct scsi_direct_blk_desc. No code change. One verbiage adjustment.
2005-06-18Shorten a couple of structure names:Kenneth R Westerback
scsi_mode_direct_blk_desc -> scsi_direct_blk_desc scsi_mode_blk_desc_big -> scsi_blk_desc_big
2005-06-18Switch to trying 6 byte MODE SENSE commands (for non ATAPI devices atKenneth R Westerback
least) before 10 byte MODE SENSE. Some older devices can't/won't distinguish between the two and return 6 byte MODE SENSE data for 10 byte requests. Check that at least a full header was returned. Tested by miod@ hshoexer@ and Ed Wandasiewisz on troublesome devices.
2005-06-15Use scsi_size() as preferred disk size in all cases. Allow devicesKenneth R Westerback
using FLEX GEOMETRY mode sense page to use the existing heads * sectors * cyls calculation if scsi_size() fails. Fixes jolan@'s iPod Shuffle, and presumably other devices lying or confused about their geometry and it's relation to the number of blocks. Also save any supplied rpm and blocksize when faking, as previous code tried to do. ok jolan@ fgsch@ tdeval@
2005-06-15Typo. 'dp->cyls' -> 'dp->sectors'.Kenneth R Westerback
2005-06-12It turns out you need to ask for 16 byte block descriptors. We don't,Kenneth R Westerback
so eliminate code dealing with 16 byte block descriptors. No one else seems to use them anyway. Add define for appropriate permission bit in case we ever need it. Simplify and clean up scsi_do_mode_sense() code as a result. Strengthen check to ensure block descriptor data is a valid by checking if it is a multiple of 8 bytes rather than just > 8 bytes. Moves code to closer to what it was before scsi_do_mode_sense().
2005-06-11Elminate a few unnecessary casts by using union field names, bit of KNF.Kenneth R Westerback
2005-06-09Fix typo in ASC/ASQ messages: DEnied -> Denied.Kenneth R Westerback
2005-06-08fix include for userland (tsk, tsk, krw).Marc Espie
okay pval, nits miod.
2005-06-05Fix scsi_mode_select() and scsi_mode_select_big() to send just theKenneth R Westerback
required number of bytes, rather than a full scsi_mode_sense_buf. Some devices (e.g. my HP SureStore DAT/24) decline to accept such oversized transfers. Instead, force callers to fill in the data_length field in the header and use that information to set the size of the transfer.
2005-06-05Revert ss_mustek use of new scsi_mode_select(). Further developmentKenneth R Westerback
revealed it is doing it's own weird stuff not reproduced in new functions. e.g. it doesn't use mode sense headers. Rather than try to fix it or figure it out at this time ...
2005-06-04Make scsi_do_mode_sense() aware of the difference between the 8 byteKenneth R Westerback
general block descriptor and the 8 byte direct block descriptor, and return the correct values for density, block_count and block_size based on the type of the device. First cut has T_SEQUENTIAL (i.e. tape devices) as the only device type using general block descriptors, so the behaviour change is minimal.
2005-06-03No longer used.Kenneth R Westerback
2005-06-03Move definitions of struct cd_softc{} and CDRETRIES from cdvar.h intoKenneth R Westerback
cd.h. Remove include of cdvar.h from cd.c. cdvar.h becomes expendable. No functional change.
2005-06-03Tweak scsi_do_mode_sense(). NetBSD was right and I was wrong. Sigh.Kenneth R Westerback
Add 'big' parameter to report which mode sense header type is being returned. Eliminate icky pointer arithmetic, since it won't work if only block descriptors are returned by the device. No functional change.
2005-06-03Cache a copy of the INQUIRY data obtained during device attachment inKenneth R Westerback
the scsi_link structure. This is a more general solution than the current inconsistant copying of fields into _softc structures. The redundant fields in _softc's will be cleaned up later. The device field will be used immediately to finish up the new mode sense code. ok marco@
2005-06-02Fix pasto - use correct pointer to extract block count from 8 byteKenneth R Westerback
block descriptors. Not that we actually use this information anywhere.
2005-05-31Remove unused sc_err1() parameter 'async'. Lint.Kenneth R Westerback
2005-05-28Sprinkle some /* FALLTHROUGH */'s as suggested by lint.Kenneth R Westerback
2005-05-28'openings' is u_int16_t, so 'openings <= 0' is wrong. Lint.Kenneth R Westerback
2005-05-28Forgot to specify parameter type. Lint.Kenneth R Westerback
2005-05-28snprintf returns int not size_t. Thank you lint.Kenneth R Westerback
2005-05-28Kill extra semi-colon. Amazing what lint can find ...Kenneth R Westerback
2005-05-28Add _lto8b() and _8btol() to decode nblocks field ofKenneth R Westerback
scsi_mode_blk_desc_big. Will be needed to move st to new mode sense function. Be a bit more careful with types of parameters to scsi_do_mode_sense, using u_int32_t instead of int. No functional change.
2005-05-28Handle XS_SHORTSENSE error codes in ioctl situations. From NetBSD.Kenneth R Westerback
Fixes spurious error messages from cdparanoia when using ATAPI CDROM in USB enclosure. ok pascoe@.
2005-05-27Don't bother issuing a MODE SELECT in cd_set_pa_immed() if we aren'tKenneth R Westerback
going to change anything. From NetBSD. Fixes playing music cd in ATAPI drive in USB enclosure pascoe@ is using. ok pascoe@.
2005-05-27No longer used after merge of atapi/scsi cd code.Kenneth R Westerback
2005-05-27Convert cd code to new mode sense framework. Merge cd_scsi andKenneth R Westerback
cd_atapi into cd since code is now almost identical, and only affects volume adjusting ioctl's. Minor side effect of allowing cd_load_unload() attempts to scsi cd's as NetBSD does.
2005-05-27Reduce size of scsi_mode_sense_buf to 255 characters from 256. FixesKenneth R Westerback
Lexar Jumpdrive and probably others. Use better structure declaration idiom, as suggested by drahn@.
2005-05-26Use new mode sense mechanism for atapi disks. Make sure that fakeKenneth R Westerback
geometry is set even if (as for some USB devices) the MODE SENSE works but zero values are returned for cylinders/heads/sectors. This fixes my USB floppy which returns 0/0/0.
2005-05-25With PQUIK_NOMODESENSE gone, SDEV_NOMODESENSE can go too.Kenneth R Westerback
2005-05-25Introduce safer, more general mode sense capability. Transparently useKenneth R Westerback
both 10 byte and 6 byte MODE SENSE commands and just return error checked values. Convert sd_scsi.c to use new mechanism for non-optical drives. USB umass devices will now display actual mode sense info if it is available via a 10 byte MODE SENSE. Which may mean 0 heads, etc. is shown until cosmetics are finalized. ok marco@ 'that is pretty cool' deraadt@
2005-05-24When processing the flex_geometry page, don't use a reduced_geometryKenneth R Westerback
field to get the blocksize. ok marco@
2005-05-23Remove superfluous and confusing define and use correct field namesKenneth R Westerback
instead.
2005-05-23Don't bzero() data before calling scsi_mode_sense[_big]() sinceKenneth R Westerback
scsi_mode_sense[_big] bzero()'s it.
2005-05-23Remove more superfluous structures, etc. No functional change.Kenneth R Westerback