rpm = _2btol(scsi_sense.pages.flex_geometry.rpm);
rpm = _2btol(sense_pages->flex_geometry.rpm);
sd_scsibus_get_parms(sd, dp, flags)	struct sd_softc *sd;	struct disk_parms *dp;	int flags;{	struct sd_scsibus_mode_sense_data scsi_sense;	struct scsi_mode_sense_buf buf;	union scsi_disk_pages *sense_pages = NULL;	u_int32_t blksize;	u_int16_t rpm = 0;	int page, error;	dp->disksize = scsi_size(sd->sc_link, flags);	dp->rot_rate = 3600;	/*	 * If offline, the SDEV_MEDIA_LOADED flag will be	 * cleared by the caller if necessary.	 */	if (sd->type == T_OPTICAL)		return (sd_scsibus_get_optparms(sd, dp, flags));	error = scsi_do_mode_sense(sd->sc_link, page = 4, &buf,	    (void **)&sense_pages, NULL, NULL, &blksize,	    sizeof(sense_pages->rigid_geometry), flags | SCSI_SILENT, NULL);	if (error == 0) {		if (sense_pages) { 			SC_DEBUG(sd->sc_link, SDEV_DB3,			    ("%d cyls, %d heads, %d precomp, %d red_write,"			     " %d land_zone\n",			    _3btol(sense_pages->rigid_geometry.ncyl),			    sense_pages->rigid_geometry.nheads,			    _2btol(sense_pages->rigid_geometry.st_cyl_wp),			    _2btol(sense_pages->rigid_geometry.st_cyl_rwc),			    _2btol(sense_pages->rigid_geometry.land_zone)));			/*			 * KLUDGE!! (for zone recorded disks)			 * give a number of sectors so that sec * trks * cyls			 * is <= disk_size			 * can lead to wasted space! THINK ABOUT THIS !			 */			dp->heads = sense_pages->rigid_geometry.nheads;			dp->cyls = _3btol(sense_pages->rigid_geometry.ncyl);			rpm = _2btol(sense_pages->rigid_geometry.rpm);		}			if (rpm)			dp->rot_rate = rpm;		dp->blksize = (blksize == 0) ? 512 : blksize;		if (dp->disksize == 0 || dp->heads == 0 || dp->cyls == 0)			goto fake_it;		/* XXX dubious on SCSI */		dp->sectors = dp->disksize / (dp->heads * dp->cyls);		return (SDGP_RESULT_OK);	}	error = scsi_do_mode_sense(sd->sc_link, page = 5, &buf,	    (void **)&sense_pages, NULL, NULL, &blksize,	    sizeof(sense_pages->flex_geometry), flags | SCSI_SILENT, NULL);	if (error == 0) {		if (sense_pages) {			dp->heads = sense_pages->flex_geometry.nheads;			dp->cyls = _2btol(sense_pages->flex_geometry.ncyl);			dp->sectors = sense_pages->flex_geometry.ph_sec_tr;			if (blksize == 0)				blksize = _2btol(sense_pages->				    flex_geometry.bytes_s);			rpm = _2btol(scsi_sense.pages.flex_geometry.rpm);		}			if (rpm)			dp->rot_rate = rpm;		dp->blksize = (blksize == 0) ? 512 : blksize;		if (dp->cyls == 0 || dp->heads == 0 || dp->sectors == 0)			goto fake_it;		if (dp->disksize == 0)			/* XXX Why go on if READ CAPACITY failed? */			dp->disksize = dp->heads * dp->cyls * dp->sectors;					return (SDGP_RESULT_OK);	}	/* T_RDIRECT defines page 6. */	if (sd->type != T_RDIRECT)		goto fake_it;	error = scsi_do_mode_sense(sd->sc_link, page = 6, &buf,	    (void **)&sense_pages, NULL, NULL, &blksize,	    sizeof(sense_pages->reduced_geometry), flags | SCSI_SILENT, NULL);	if (error == 0) {		dp->heads = 64;		dp->sectors = 32;		if (sense_pages) {			if (dp->disksize == 0)				dp->disksize = _4btol(sense_pages->				    reduced_geometry.sectors+1);			if (blksize == 0)				blksize = _2btol(sense_pages->				    reduced_geometry.bytes_s);		    	dp->sectors = sense_pages->reduced_geometry.sectors[0];		}		dp->blksize = (blksize == 0) ? 512 : blksize;		if (dp->disksize == 0 || dp->sectors == 0)			goto fake_it;		dp->cyls = dp->disksize / (dp->heads * dp->sectors);		return (SDGP_RESULT_OK);	}fake_it:	if (dp->disksize == 0)		return (SDGP_RESULT_OFFLINE);	SC_DEBUG(sd->sc_link, SDEV_DB1, ("error %d on pg %d, fake geometry.\n",	    error, page));	/* Use adaptec standard fictitious geometry. */	dp->heads = 64;	dp->sectors = 32;	dp->cyls = dp->disksize / (64 * 32);	dp->blksize = (blksize == 0) ? 512 : blksize;	return (SDGP_RESULT_OK);}