Lines Matching defs:sdp
136 struct scsi_device *sdp = sdkp->device;
143 if (sdp->type != TYPE_DISK)
161 if (scsi_mode_sense(sdp, 0x08, 8, buffer, sizeof(buffer), SD_TIMEOUT,
172 if (scsi_mode_select(sdp, 1, sp, 8, buffer_data, len, SD_TIMEOUT,
187 struct scsi_device *sdp = sdkp->device;
192 sdp->manage_start_stop = simple_strtoul(buf, NULL, 10);
202 struct scsi_device *sdp = sdkp->device;
207 if (sdp->type != TYPE_DISK)
210 sdp->allow_restart = simple_strtoul(buf, NULL, 10);
238 struct scsi_device *sdp = sdkp->device;
240 return snprintf(buf, 20, "%u\n", sdp->manage_start_stop);
416 * @sdp: scsi device to operate one
422 static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
469 ret = scsi_setup_blk_pc_cmnd(sdp, rq);
478 static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
485 return scsi_setup_blk_pc_cmnd(sdp, rq);
507 struct scsi_device *sdp = q->queuedata;
521 ret = scsi_setup_discard_cmnd(sdp, rq);
524 ret = scsi_setup_flush_cmnd(sdp, rq);
527 ret = scsi_setup_blk_pc_cmnd(sdp, rq);
533 ret = scsi_setup_fs_cmnd(sdp, rq);
549 if (!sdp || !scsi_device_online(sdp) ||
559 if (sdp->changed) {
573 (sdp->sector_size / 512);
575 if (unlikely(sdp->last_sector_bug && block + this_count > threshold)) {
581 this_count = sdp->sector_size / 512;
599 if (sdp->sector_size == 1024) {
609 if (sdp->sector_size == 2048) {
619 if (sdp->sector_size == 4096) {
630 if (!sdp->writeable) {
637 sd_dif_prepare(rq, block, sdp->sector_size) == -EIO)
655 host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type);
747 SCpnt->sdb.length = this_count * sdp->sector_size;
758 SCpnt->transfersize = sdp->sector_size;
887 struct scsi_device *sdp = sdkp->device;
888 struct Scsi_Host *host = sdp->host;
898 host->hostt->bios_param(sdp, bdev, sdkp->capacity, diskinfo);
926 struct scsi_device *sdp = scsi_disk(disk)->device;
939 error = scsi_nonblockable_ioctl(sdp, cmd, p,
941 if (!scsi_block_when_processing_errors(sdp) || !error)
952 error = scsi_ioctl(sdp, cmd, p);
958 error = scsi_ioctl(sdp, cmd, p);
983 struct scsi_device *sdp = sdkp->device;
989 if (!sdp->removable)
998 if (!scsi_device_online(sdp)) {
1015 if (scsi_block_when_processing_errors(sdp)) {
1017 retval = scsi_test_unit_ready(sdp, SD_TIMEOUT, SD_MAX_RETRIES,
1042 retval = sdp->changed;
1043 sdp->changed = 0;
1046 sdev_evt_send_simple(sdp, SDEV_EVT_MEDIA_CHANGE, GFP_KERNEL);
1055 struct scsi_device *sdp = sdkp->device;
1058 if (!scsi_device_online(sdp))
1070 res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
1431 struct scsi_device *sdp = sdkp->device;
1434 if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0)
1451 if (scsi_host_dif_capable(sdp->host, type))
1459 static void read_capacity_error(struct scsi_disk *sdkp, struct scsi_device *sdp,
1473 if (sdp->removable &&
1475 sdp->changed = 1;
1492 static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,
1511 the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE,
1542 read_capacity_error(sdkp, sdp, &sshdr, sense_valid, the_result);
1564 blk_queue_alignment_offset(sdp->request_queue, alignment);
1570 struct request_queue *q = sdp->request_queue;
1586 static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,
1602 the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE,
1625 read_capacity_error(sdkp, sdp, &sshdr, sense_valid, the_result);
1645 static int sd_try_rc16_first(struct scsi_device *sdp)
1647 if (sdp->host->max_cmd_len < 16)
1649 if (sdp->scsi_level > SCSI_SPC_2)
1651 if (scsi_device_protection(sdp))
1663 struct scsi_device *sdp = sdkp->device;
1666 if (sd_try_rc16_first(sdp)) {
1667 sector_size = read_capacity_16(sdkp, sdp, buffer);
1673 sector_size = read_capacity_10(sdkp, sdp, buffer);
1677 sector_size = read_capacity_10(sdkp, sdp, buffer);
1687 sector_size = read_capacity_16(sdkp, sdp, buffer);
1708 if (sdp->fix_capacity ||
1709 (sdp->guess_capacity && (sdkp->capacity & 0x01))) {
1745 blk_queue_logical_block_size(sdp->request_queue, sector_size);
1779 blk_queue_physical_block_size(sdp->request_queue, sdkp->hw_sector_size);
1785 sd_do_mode_sense(struct scsi_device *sdp, int dbd, int modepage,
1789 return scsi_mode_sense(sdp, dbd, modepage, buffer, len,
1802 struct scsi_device *sdp = sdkp->device;
1807 if (sdp->skip_ms_page_3f) {
1812 if (sdp->use_192_bytes_for_3f) {
1813 res = sd_do_mode_sense(sdp, 0, 0x3F, buffer, 192, &data, NULL);
1820 res = sd_do_mode_sense(sdp, 0, 0x3F, buffer, 4, &data, NULL);
1829 res = sd_do_mode_sense(sdp, 0, 0, buffer, 4, &data, NULL);
1835 res = sd_do_mode_sense(sdp, 0, 0x3F, buffer, 255,
1863 struct scsi_device *sdp = sdkp->device;
1873 if (sdp->skip_ms_page_8)
1876 if (sdp->type == TYPE_RBC) {
1885 res = sd_do_mode_sense(sdp, dbd, modepage, buffer, 4, &data, &sshdr);
1913 res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
1978 struct scsi_device *sdp = sdkp->device;
1982 if (sdp->type != TYPE_DISK)
1988 res = scsi_mode_sense(sdp, 1, 0x0a, buffer, 36, SD_TIMEOUT,
2093 static int sd_try_extended_inquiry(struct scsi_device *sdp)
2100 if (sdp->scsi_level > SCSI_SPC_2)
2113 struct scsi_device *sdp = sdkp->device;
2124 if (!scsi_device_online(sdp))
2143 if (sd_try_extended_inquiry(sdp)) {
2248 struct scsi_device *sdp;
2253 sdp = sdkp->device;
2256 dev = &sdp->sdev_gendev;
2267 sdp->sector_size = 512;
2278 blk_queue_prep_rq(sdp->request_queue, sd_prep_fn);
2279 blk_queue_unprep_rq(sdp->request_queue, sd_unprep_fn);
2281 gd->driverfs_dev = &sdp->sdev_gendev;
2283 if (sdp->removable)
2292 sdp->removable ? "removable " : "");
2293 scsi_autopm_put_device(sdp);
2308 * <host,channel,id,lun> (found in sdp) and new device name
2317 struct scsi_device *sdp = to_scsi_device(dev);
2324 if (sdp->type != TYPE_DISK && sdp->type != TYPE_MOD && sdp->type != TYPE_RBC)
2327 SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp,
2353 sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n");
2361 sdkp->device = sdp;
2368 if (!sdp->request_queue->rq_timeout) {
2369 if (sdp->type != TYPE_MOD)
2370 blk_queue_rq_timeout(sdp->request_queue, SD_TIMEOUT);
2372 blk_queue_rq_timeout(sdp->request_queue,
2408 * @sdp: pointer to mid level scsi device object
2466 struct scsi_device *sdp = sdkp->device;
2472 if (sdp->start_stop_pwr_cond)
2475 if (!scsi_device_online(sdp))
2478 res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,