Lines Matching refs:pm8001_dev

394 #define DEV_IS_GONE(pm8001_dev)	\  argument
395 ((!pm8001_dev || (pm8001_dev->dev_type == SAS_PHY_UNUSED)))
437 struct pm8001_device *pm8001_dev = dev->lldd_dev; in pm8001_queue_command() local
465 pm8001_dev = dev->lldd_dev; in pm8001_queue_command()
469 (DEV_IS_GONE(pm8001_dev) || !port->port_attached)) { in pm8001_queue_command()
483 ccb = pm8001_ccb_alloc(pm8001_ha, pm8001_dev, task); in pm8001_queue_command()
505 atomic_inc(&pm8001_dev->running_req); in pm8001_queue_command()
509 atomic_dec(&pm8001_dev->running_req); in pm8001_queue_command()
535 struct pm8001_device *pm8001_dev; in pm8001_ccb_task_free() local
563 pm8001_dev = ccb->device; in pm8001_ccb_task_free()
565 pm8001_dev ? pm8001_dev->attached_phy : PM8001_MAX_PHYS, in pm8001_ccb_task_free()
568 pm8001_dev ? atomic_read(&pm8001_dev->running_req) : -1); in pm8001_ccb_task_free()
614 void pm8001_free_dev(struct pm8001_device *pm8001_dev) in pm8001_free_dev() argument
616 u32 id = pm8001_dev->id; in pm8001_free_dev()
617 memset(pm8001_dev, 0, sizeof(*pm8001_dev)); in pm8001_free_dev()
618 pm8001_dev->id = id; in pm8001_free_dev()
619 pm8001_dev->dev_type = SAS_PHY_UNUSED; in pm8001_free_dev()
620 pm8001_dev->device_id = PM8001_MAX_DEVICES; in pm8001_free_dev()
621 pm8001_dev->sas_device = NULL; in pm8001_free_dev()
705 struct pm8001_device *pm8001_dev = dev->lldd_dev; in pm8001_dev_gone_notify() local
709 if (pm8001_dev) { in pm8001_dev_gone_notify()
710 u32 device_id = pm8001_dev->device_id; in pm8001_dev_gone_notify()
713 pm8001_dev->device_id, pm8001_dev->dev_type); in pm8001_dev_gone_notify()
714 if (atomic_read(&pm8001_dev->running_req)) { in pm8001_dev_gone_notify()
717 while (atomic_read(&pm8001_dev->running_req)) in pm8001_dev_gone_notify()
722 pm8001_free_dev(pm8001_dev); in pm8001_dev_gone_notify()
752 struct pm8001_device *pm8001_dev; in pm8001_open_reject_retry() local
759 pm8001_dev = ccb->device; in pm8001_open_reject_retry()
760 if (!pm8001_dev || (pm8001_dev->dev_type == SAS_PHY_UNUSED)) in pm8001_open_reject_retry()
763 uintptr_t d = (uintptr_t)pm8001_dev in pm8001_open_reject_retry()
765 if (((d % sizeof(*pm8001_dev)) != 0) in pm8001_open_reject_retry()
766 || ((d / sizeof(*pm8001_dev)) >= PM8001_MAX_DEVICES)) in pm8001_open_reject_retry()
768 } else if (pm8001_dev != device_to_close) in pm8001_open_reject_retry()
780 if (pm8001_dev) in pm8001_open_reject_retry()
781 atomic_dec(&pm8001_dev->running_req); in pm8001_open_reject_retry()
814 struct pm8001_device *pm8001_dev; in pm8001_I_T_nexus_reset() local
821 pm8001_dev = dev->lldd_dev; in pm8001_I_T_nexus_reset()
834 "with rc %d\n", pm8001_dev->device_id, rc); in pm8001_I_T_nexus_reset()
842 "with rc %d\n", pm8001_dev->device_id, rc); in pm8001_I_T_nexus_reset()
850 pm8001_dev->device_id, rc); in pm8001_I_T_nexus_reset()
863 struct pm8001_device *pm8001_dev; in pm8001_I_T_nexus_event_handler() local
870 pm8001_dev = dev->lldd_dev; in pm8001_I_T_nexus_event_handler()
894 pm8001_dev->setds_completion = &completion_setstate; in pm8001_I_T_nexus_event_handler()
911 pm8001_dev->device_id, rc); in pm8001_I_T_nexus_event_handler()
921 struct pm8001_device *pm8001_dev = dev->lldd_dev; in pm8001_lu_reset() local
940 pm8001_dev->setds_completion = &completion_setstate; in pm8001_lu_reset()
942 pm8001_dev, DS_OPERATIONAL); in pm8001_lu_reset()
949 pm8001_dev->device_id, rc); in pm8001_lu_reset()
1001 struct pm8001_device *pm8001_dev; in pm8001_abort_task() local
1010 pm8001_dev = dev->lldd_dev; in pm8001_abort_task()
1012 phy_id = pm8001_dev->attached_phy; in pm8001_abort_task()
1048 pm8001_dev->setds_completion = &completion; in pm8001_abort_task()
1050 pm8001_dev, DS_IN_RECOVERY); in pm8001_abort_task()
1122 pm8001_dev->setds_completion = &completion; in pm8001_abort_task()
1124 pm8001_dev, DS_OPERATIONAL); in pm8001_abort_task()
1154 struct pm8001_device *pm8001_dev = dev->lldd_dev; in pm8001_clear_task_set() local
1158 pm8001_dev->device_id); in pm8001_clear_task_set()
1180 struct pm8001_device *pm8001_dev = dev->lldd_dev; in pm8001_setds_completion() local
1184 pm8001_dev->setds_completion = &completion_setstate; in pm8001_setds_completion()
1186 pm8001_dev, DS_OPERATIONAL); in pm8001_setds_completion()