• Home
  • Raw
  • Download

Lines Matching refs:sdev

264 #define sdev_dbg(sdev, fmt, a...) \  argument
265 dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
275 #define sdev_printk(l, sdev, fmt, a...) \ argument
276 sdev_prefix_printk(l, sdev, NULL, fmt, ##a)
345 static inline struct scsi_target *scsi_target(struct scsi_device *sdev) in scsi_target() argument
347 return to_scsi_target(sdev->sdev_gendev.parent); in scsi_target()
362 void scsi_attach_vpd(struct scsi_device *sdev);
394 #define shost_for_each_device(sdev, shost) \ argument
395 for ((sdev) = __scsi_iterate_devices((shost), NULL); \
396 (sdev); \
397 (sdev) = __scsi_iterate_devices((shost), (sdev)))
412 #define __shost_for_each_device(sdev, shost) \ argument
413 list_for_each_entry((sdev), &((shost)->__devices), siblings)
420 extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
424 extern int scsi_mode_select(struct scsi_device *sdev, int pf, int sp,
429 extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
433 extern int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
435 extern int scsi_device_set_state(struct scsi_device *sdev,
439 extern void sdev_evt_send(struct scsi_device *sdev, struct scsi_event *evt);
440 extern void sdev_evt_send_simple(struct scsi_device *sdev,
442 extern int scsi_device_quiesce(struct scsi_device *sdev);
443 extern void scsi_device_resume(struct scsi_device *sdev);
457 extern int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
463 #define scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense, \ argument
468 __scsi_execute(sdev, cmd, data_direction, buffer, bufflen, \
472 static inline int scsi_execute_req(struct scsi_device *sdev, in scsi_execute_req() argument
477 return scsi_execute(sdev, cmd, data_direction, buffer, in scsi_execute_req()
480 extern void sdev_disable_disk_events(struct scsi_device *sdev);
481 extern void sdev_enable_disk_events(struct scsi_device *sdev);
493 static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev) in scsi_device_reprobe() argument
495 return device_reprobe(&sdev->sdev_gendev); in scsi_device_reprobe()
498 static inline unsigned int sdev_channel(struct scsi_device *sdev) in sdev_channel() argument
500 return sdev->channel; in sdev_channel()
503 static inline unsigned int sdev_id(struct scsi_device *sdev) in sdev_id() argument
505 return sdev->id; in sdev_id()
514 static inline int scsi_device_online(struct scsi_device *sdev) in scsi_device_online() argument
516 return (sdev->sdev_state != SDEV_OFFLINE && in scsi_device_online()
517 sdev->sdev_state != SDEV_TRANSPORT_OFFLINE && in scsi_device_online()
518 sdev->sdev_state != SDEV_DEL); in scsi_device_online()
520 static inline int scsi_device_blocked(struct scsi_device *sdev) in scsi_device_blocked() argument
522 return sdev->sdev_state == SDEV_BLOCK || in scsi_device_blocked()
523 sdev->sdev_state == SDEV_CREATED_BLOCK; in scsi_device_blocked()
525 static inline int scsi_device_created(struct scsi_device *sdev) in scsi_device_created() argument
527 return sdev->sdev_state == SDEV_CREATED || in scsi_device_created()
528 sdev->sdev_state == SDEV_CREATED_BLOCK; in scsi_device_created()
531 int scsi_internal_device_block_nowait(struct scsi_device *sdev);
532 int scsi_internal_device_unblock_nowait(struct scsi_device *sdev,
536 static inline int scsi_device_sync(struct scsi_device *sdev) in scsi_device_sync() argument
538 return sdev->sdtr; in scsi_device_sync()
540 static inline int scsi_device_wide(struct scsi_device *sdev) in scsi_device_wide() argument
542 return sdev->wdtr; in scsi_device_wide()
544 static inline int scsi_device_dt(struct scsi_device *sdev) in scsi_device_dt() argument
546 return sdev->ppr; in scsi_device_dt()
548 static inline int scsi_device_dt_only(struct scsi_device *sdev) in scsi_device_dt_only() argument
550 if (sdev->inquiry_len < 57) in scsi_device_dt_only()
552 return (sdev->inquiry[56] & 0x0c) == 0x04; in scsi_device_dt_only()
554 static inline int scsi_device_ius(struct scsi_device *sdev) in scsi_device_ius() argument
556 if (sdev->inquiry_len < 57) in scsi_device_ius()
558 return sdev->inquiry[56] & 0x01; in scsi_device_ius()
560 static inline int scsi_device_qas(struct scsi_device *sdev) in scsi_device_qas() argument
562 if (sdev->inquiry_len < 57) in scsi_device_qas()
564 return sdev->inquiry[56] & 0x02; in scsi_device_qas()
566 static inline int scsi_device_enclosure(struct scsi_device *sdev) in scsi_device_enclosure() argument
568 return sdev->inquiry ? (sdev->inquiry[6] & (1<<6)) : 1; in scsi_device_enclosure()
571 static inline int scsi_device_protection(struct scsi_device *sdev) in scsi_device_protection() argument
573 if (sdev->no_dif) in scsi_device_protection()
576 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); in scsi_device_protection()
579 static inline int scsi_device_tpgs(struct scsi_device *sdev) in scsi_device_tpgs() argument
581 return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; in scsi_device_tpgs()
592 static inline int scsi_device_supports_vpd(struct scsi_device *sdev) in scsi_device_supports_vpd() argument
597 if (sdev->try_vpd_pages) in scsi_device_supports_vpd()
604 if (sdev->scsi_level >= SCSI_SPC_2 && !sdev->skip_vpd_pages) in scsi_device_supports_vpd()
609 static inline int scsi_device_busy(struct scsi_device *sdev) in scsi_device_busy() argument
611 return sbitmap_weight(&sdev->budget_map); in scsi_device_busy()