• Home
  • Raw
  • Download

Lines Matching full:device

10  * Device mapping and dasd= parameter parsing functions. All devmap
39 * between device number and device index. To find a dasd_devmap_t
40 * that corresponds to a device number of a device index each
42 * the device number and one to search by the device index. As
43 * soon as big minor numbers are available the device index list
44 * can be removed since the device number will then be identical
45 * to the device index.
52 struct dasd_device *device; member
131 * Read a device busid/devno from a string.
141 pr_err("The IPL device is not a CCW device\n"); in dasd_busid()
206 pr_warn("%.*s is not a supported device option\n", in dasd_feature_list()
274 * Split a string of a device range into its pieces and return the from, to, and
286 /* Do we have a range or a single device? */ in dasd_evaluate_range_param()
305 * Try to interprete the range string as a device number or a range of devices.
345 pr_err("%s is not a valid device range\n", range); in dasd_parse_range()
356 /* each device in dasd= parameter should be set initially online */ in dasd_parse_range()
376 * keywords and device ranges. The parameters in that list will be stored as
404 * Add a devmap for the device specified by busid. It is possible that
431 new->device = NULL; in dasd_add_busid()
442 * Find devmap for device with given bus_id.
473 * Forget all about the device numbers added so far.
485 BUG_ON(devmap->device != NULL); in dasd_forget_ranges()
494 * Find the device struct by its device index.
500 struct dasd_device *device; in dasd_device_from_devindex() local
508 /* Found the devmap for the device. */ in dasd_device_from_devindex()
512 if (devmap && devmap->device) { in dasd_device_from_devindex()
513 device = devmap->device; in dasd_device_from_devindex()
514 dasd_get_device(device); in dasd_device_from_devindex()
516 device = ERR_PTR(-ENODEV); in dasd_device_from_devindex()
518 return device; in dasd_device_from_devindex()
538 * Create a dasd device structure for cdev.
544 struct dasd_device *device; in dasd_create_device() local
552 device = dasd_alloc_device(); in dasd_create_device()
553 if (IS_ERR(device)) in dasd_create_device()
554 return device; in dasd_create_device()
555 atomic_set(&device->ref_count, 3); in dasd_create_device()
558 if (!devmap->device) { in dasd_create_device()
559 devmap->device = device; in dasd_create_device()
560 device->devindex = devmap->devindex; in dasd_create_device()
561 device->features = devmap->features; in dasd_create_device()
563 device->cdev = cdev; in dasd_create_device()
571 dasd_free_device(device); in dasd_create_device()
576 dev_set_drvdata(&cdev->dev, device); in dasd_create_device()
579 return device; in dasd_create_device()
588 * Remove a dasd device structure. The passed referenced
592 dasd_delete_device(struct dasd_device *device) in dasd_delete_device() argument
598 /* First remove device pointer from devmap. */ in dasd_delete_device()
599 devmap = dasd_find_busid(dev_name(&device->cdev->dev)); in dasd_delete_device()
602 if (devmap->device != device) { in dasd_delete_device()
604 dasd_put_device(device); in dasd_delete_device()
607 devmap->device = NULL; in dasd_delete_device()
611 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); in dasd_delete_device()
612 dev_set_drvdata(&device->cdev->dev, NULL); in dasd_delete_device()
613 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); in dasd_delete_device()
619 atomic_sub(3, &device->ref_count); in dasd_delete_device()
622 wait_event(dasd_delete_wq, atomic_read(&device->ref_count) == 0); in dasd_delete_device()
624 dasd_generic_free_discipline(device); in dasd_delete_device()
626 cdev = device->cdev; in dasd_delete_device()
627 device->cdev = NULL; in dasd_delete_device()
632 /* Now the device structure can be freed. */ in dasd_delete_device()
633 dasd_free_device(device); in dasd_delete_device()
641 dasd_put_device_wake(struct dasd_device *device) in dasd_put_device_wake() argument
649 * This function needs to be called with the ccw device
655 struct dasd_device *device = dev_get_drvdata(&cdev->dev); in dasd_device_from_cdev_locked() local
657 if (!device) in dasd_device_from_cdev_locked()
659 dasd_get_device(device); in dasd_device_from_cdev_locked()
660 return device; in dasd_device_from_cdev_locked()
669 struct dasd_device *device; in dasd_device_from_cdev() local
673 device = dasd_device_from_cdev_locked(cdev); in dasd_device_from_cdev()
675 return device; in dasd_device_from_cdev()
678 void dasd_add_link_to_gendisk(struct gendisk *gdp, struct dasd_device *device) in dasd_add_link_to_gendisk() argument
682 devmap = dasd_find_busid(dev_name(&device->cdev->dev)); in dasd_add_link_to_gendisk()
692 struct dasd_device *device; in dasd_device_from_gendisk() local
697 device = NULL; in dasd_device_from_gendisk()
700 if (devmap && devmap->device) { in dasd_device_from_gendisk()
701 device = devmap->device; in dasd_device_from_gendisk()
702 dasd_get_device(device); in dasd_device_from_gendisk()
705 return device; in dasd_device_from_gendisk()
715 static ssize_t dasd_ff_show(struct device *dev, struct device_attribute *attr, in dasd_ff_show()
729 static ssize_t dasd_ff_store(struct device *dev, struct device_attribute *attr, in dasd_ff_store()
749 dasd_ro_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_ro_show()
752 struct dasd_device *device; in dasd_ro_show() local
762 device = devmap->device; in dasd_ro_show()
763 if (device) in dasd_ro_show()
764 ro_flag |= test_bit(DASD_FLAG_DEVICE_RO, &device->flags); in dasd_ro_show()
772 dasd_ro_store(struct device *dev, struct device_attribute *attr, in dasd_ro_store()
776 struct dasd_device *device; in dasd_ro_store() local
788 device = dasd_device_from_cdev(cdev); in dasd_ro_store()
789 if (IS_ERR(device)) in dasd_ro_store()
793 val = val || test_bit(DASD_FLAG_DEVICE_RO, &device->flags); in dasd_ro_store()
795 if (!device->block || !device->block->gdp || in dasd_ro_store()
796 test_bit(DASD_FLAG_OFFLINE, &device->flags)) { in dasd_ro_store()
800 /* Increase open_count to avoid losing the block device */ in dasd_ro_store()
801 atomic_inc(&device->block->open_count); in dasd_ro_store()
804 set_disk_ro(device->block->gdp, val); in dasd_ro_store()
805 atomic_dec(&device->block->open_count); in dasd_ro_store()
808 dasd_put_device(device); in dasd_ro_store()
819 dasd_erplog_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_erplog_show()
833 dasd_erplog_store(struct device *dev, struct device_attribute *attr, in dasd_erplog_store()
851 * to talk to the device
854 dasd_use_diag_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_use_diag_show()
868 dasd_use_diag_store(struct device *dev, struct device_attribute *attr, in dasd_use_diag_store()
885 if (!devmap->device && !(devmap->features & DASD_FEATURE_USERAW)) { in dasd_use_diag_store()
903 dasd_use_raw_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_use_raw_show()
917 dasd_use_raw_store(struct device *dev, struct device_attribute *attr, in dasd_use_raw_store()
934 if (!devmap->device && !(devmap->features & DASD_FEATURE_USEDIAG)) { in dasd_use_raw_store()
949 dasd_safe_offline_store(struct device *dev, struct device_attribute *attr, in dasd_safe_offline_store()
953 struct dasd_device *device; in dasd_safe_offline_store() local
958 device = dasd_device_from_cdev_locked(cdev); in dasd_safe_offline_store()
959 if (IS_ERR(device)) { in dasd_safe_offline_store()
960 rc = PTR_ERR(device); in dasd_safe_offline_store()
965 if (test_bit(DASD_FLAG_OFFLINE, &device->flags) || in dasd_safe_offline_store()
966 test_bit(DASD_FLAG_SAFE_OFFLINE_RUNNING, &device->flags)) { in dasd_safe_offline_store()
968 dasd_put_device(device); in dasd_safe_offline_store()
974 set_bit(DASD_FLAG_SAFE_OFFLINE, &device->flags); in dasd_safe_offline_store()
975 dasd_put_device(device); in dasd_safe_offline_store()
987 dasd_access_show(struct device *dev, struct device_attribute *attr, in dasd_access_show()
991 struct dasd_device *device; in dasd_access_show() local
994 device = dasd_device_from_cdev(cdev); in dasd_access_show()
995 if (IS_ERR(device)) in dasd_access_show()
996 return PTR_ERR(device); in dasd_access_show()
998 if (!device->discipline) in dasd_access_show()
1000 else if (!device->discipline->host_access_count) in dasd_access_show()
1003 count = device->discipline->host_access_count(device); in dasd_access_show()
1005 dasd_put_device(device); in dasd_access_show()
1015 dasd_discipline_show(struct device *dev, struct device_attribute *attr, in dasd_discipline_show()
1018 struct dasd_device *device; in dasd_discipline_show() local
1021 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_discipline_show()
1022 if (IS_ERR(device)) in dasd_discipline_show()
1024 else if (!device->discipline) { in dasd_discipline_show()
1025 dasd_put_device(device); in dasd_discipline_show()
1029 device->discipline->name); in dasd_discipline_show()
1030 dasd_put_device(device); in dasd_discipline_show()
1041 dasd_device_status_show(struct device *dev, struct device_attribute *attr, in dasd_device_status_show()
1044 struct dasd_device *device; in dasd_device_status_show() local
1047 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_device_status_show()
1048 if (!IS_ERR(device)) { in dasd_device_status_show()
1049 switch (device->state) { in dasd_device_status_show()
1072 dasd_put_device(device); in dasd_device_status_show()
1080 static ssize_t dasd_alias_show(struct device *dev, in dasd_alias_show()
1083 struct dasd_device *device; in dasd_alias_show() local
1086 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_alias_show()
1087 if (IS_ERR(device)) in dasd_alias_show()
1090 if (device->discipline && device->discipline->get_uid && in dasd_alias_show()
1091 !device->discipline->get_uid(device, &uid)) { in dasd_alias_show()
1094 dasd_put_device(device); in dasd_alias_show()
1098 dasd_put_device(device); in dasd_alias_show()
1105 static ssize_t dasd_vendor_show(struct device *dev, in dasd_vendor_show()
1108 struct dasd_device *device; in dasd_vendor_show() local
1112 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_vendor_show()
1114 if (IS_ERR(device)) in dasd_vendor_show()
1117 if (device->discipline && device->discipline->get_uid && in dasd_vendor_show()
1118 !device->discipline->get_uid(device, &uid)) in dasd_vendor_show()
1121 dasd_put_device(device); in dasd_vendor_show()
1133 dasd_uid_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_uid_show()
1135 struct dasd_device *device; in dasd_uid_show() local
1140 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_uid_show()
1142 if (IS_ERR(device)) in dasd_uid_show()
1145 if (device->discipline && device->discipline->get_uid && in dasd_uid_show()
1146 !device->discipline->get_uid(device, &uid)) { in dasd_uid_show()
1160 /* should not happen, treat like base device */ in dasd_uid_show()
1176 dasd_put_device(device); in dasd_uid_show()
1186 dasd_eer_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_eer_show()
1192 if (!IS_ERR(devmap) && devmap->device) in dasd_eer_show()
1193 eer_flag = dasd_eer_enabled(devmap->device); in dasd_eer_show()
1200 dasd_eer_store(struct device *dev, struct device_attribute *attr, in dasd_eer_store()
1203 struct dasd_device *device; in dasd_eer_store() local
1207 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_eer_store()
1208 if (IS_ERR(device)) in dasd_eer_store()
1209 return PTR_ERR(device); in dasd_eer_store()
1215 rc = dasd_eer_enable(device); in dasd_eer_store()
1217 dasd_eer_disable(device); in dasd_eer_store()
1219 dasd_put_device(device); in dasd_eer_store()
1230 dasd_expires_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_expires_show()
1232 struct dasd_device *device; in dasd_expires_show() local
1235 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_expires_show()
1236 if (IS_ERR(device)) in dasd_expires_show()
1238 len = snprintf(buf, PAGE_SIZE, "%lu\n", device->default_expires); in dasd_expires_show()
1239 dasd_put_device(device); in dasd_expires_show()
1244 dasd_expires_store(struct device *dev, struct device_attribute *attr, in dasd_expires_store()
1247 struct dasd_device *device; in dasd_expires_store() local
1250 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_expires_store()
1251 if (IS_ERR(device)) in dasd_expires_store()
1256 dasd_put_device(device); in dasd_expires_store()
1261 device->default_expires = val; in dasd_expires_store()
1263 dasd_put_device(device); in dasd_expires_store()
1270 dasd_retries_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_retries_show()
1272 struct dasd_device *device; in dasd_retries_show() local
1275 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_retries_show()
1276 if (IS_ERR(device)) in dasd_retries_show()
1278 len = snprintf(buf, PAGE_SIZE, "%lu\n", device->default_retries); in dasd_retries_show()
1279 dasd_put_device(device); in dasd_retries_show()
1284 dasd_retries_store(struct device *dev, struct device_attribute *attr, in dasd_retries_store()
1287 struct dasd_device *device; in dasd_retries_store() local
1290 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_retries_store()
1291 if (IS_ERR(device)) in dasd_retries_store()
1296 dasd_put_device(device); in dasd_retries_store()
1301 device->default_retries = val; in dasd_retries_store()
1303 dasd_put_device(device); in dasd_retries_store()
1310 dasd_timeout_show(struct device *dev, struct device_attribute *attr, in dasd_timeout_show()
1313 struct dasd_device *device; in dasd_timeout_show() local
1316 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_timeout_show()
1317 if (IS_ERR(device)) in dasd_timeout_show()
1319 len = snprintf(buf, PAGE_SIZE, "%lu\n", device->blk_timeout); in dasd_timeout_show()
1320 dasd_put_device(device); in dasd_timeout_show()
1325 dasd_timeout_store(struct device *dev, struct device_attribute *attr, in dasd_timeout_store()
1328 struct dasd_device *device; in dasd_timeout_store() local
1332 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_timeout_store()
1333 if (IS_ERR(device) || !device->block) in dasd_timeout_store()
1338 dasd_put_device(device); in dasd_timeout_store()
1341 q = device->block->request_queue; in dasd_timeout_store()
1343 dasd_put_device(device); in dasd_timeout_store()
1347 device->blk_timeout = val; in dasd_timeout_store()
1349 blk_queue_rq_timeout(q, device->blk_timeout * HZ); in dasd_timeout_store()
1351 dasd_put_device(device); in dasd_timeout_store()
1360 dasd_path_reset_store(struct device *dev, struct device_attribute *attr, in dasd_path_reset_store()
1363 struct dasd_device *device; in dasd_path_reset_store() local
1366 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_path_reset_store()
1367 if (IS_ERR(device)) in dasd_path_reset_store()
1373 if (device->discipline && device->discipline->reset_path) in dasd_path_reset_store()
1374 device->discipline->reset_path(device, (__u8) val); in dasd_path_reset_store()
1376 dasd_put_device(device); in dasd_path_reset_store()
1382 static ssize_t dasd_hpf_show(struct device *dev, struct device_attribute *attr, in dasd_hpf_show()
1385 struct dasd_device *device; in dasd_hpf_show() local
1388 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_hpf_show()
1389 if (IS_ERR(device)) in dasd_hpf_show()
1391 if (!device->discipline || !device->discipline->hpf_enabled) { in dasd_hpf_show()
1392 dasd_put_device(device); in dasd_hpf_show()
1395 hpf = device->discipline->hpf_enabled(device); in dasd_hpf_show()
1396 dasd_put_device(device); in dasd_hpf_show()
1402 static ssize_t dasd_reservation_policy_show(struct device *dev, in dasd_reservation_policy_show()
1423 static ssize_t dasd_reservation_policy_store(struct device *dev, in dasd_reservation_policy_store()
1443 static ssize_t dasd_reservation_state_show(struct device *dev, in dasd_reservation_state_show()
1447 struct dasd_device *device; in dasd_reservation_state_show() local
1450 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_reservation_state_show()
1451 if (IS_ERR(device)) in dasd_reservation_state_show()
1454 if (test_bit(DASD_FLAG_IS_RESERVED, &device->flags)) in dasd_reservation_state_show()
1456 else if (test_bit(DASD_FLAG_LOCK_STOLEN, &device->flags)) in dasd_reservation_state_show()
1460 dasd_put_device(device); in dasd_reservation_state_show()
1464 static ssize_t dasd_reservation_state_store(struct device *dev, in dasd_reservation_state_store()
1468 struct dasd_device *device; in dasd_reservation_state_store() local
1471 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_reservation_state_store()
1472 if (IS_ERR(device)) in dasd_reservation_state_store()
1475 clear_bit(DASD_FLAG_LOCK_STOLEN, &device->flags); in dasd_reservation_state_store()
1478 dasd_put_device(device); in dasd_reservation_state_store()
1489 static ssize_t dasd_pm_show(struct device *dev, in dasd_pm_show()
1492 struct dasd_device *device; in dasd_pm_show() local
1495 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_pm_show()
1496 if (IS_ERR(device)) in dasd_pm_show()
1499 opm = dasd_path_get_opm(device); in dasd_pm_show()
1500 nppm = dasd_path_get_nppm(device); in dasd_pm_show()
1501 cablepm = dasd_path_get_cablepm(device); in dasd_pm_show()
1502 cuirpm = dasd_path_get_cuirpm(device); in dasd_pm_show()
1503 hpfpm = dasd_path_get_hpfpm(device); in dasd_pm_show()
1504 ifccpm = dasd_path_get_ifccpm(device); in dasd_pm_show()
1505 dasd_put_device(device); in dasd_pm_show()
1517 dasd_path_threshold_show(struct device *dev, in dasd_path_threshold_show()
1520 struct dasd_device *device; in dasd_path_threshold_show() local
1523 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_path_threshold_show()
1524 if (IS_ERR(device)) in dasd_path_threshold_show()
1526 len = snprintf(buf, PAGE_SIZE, "%lu\n", device->path_thrhld); in dasd_path_threshold_show()
1527 dasd_put_device(device); in dasd_path_threshold_show()
1532 dasd_path_threshold_store(struct device *dev, struct device_attribute *attr, in dasd_path_threshold_store()
1535 struct dasd_device *device; in dasd_path_threshold_store() local
1539 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_path_threshold_store()
1540 if (IS_ERR(device)) in dasd_path_threshold_store()
1544 dasd_put_device(device); in dasd_path_threshold_store()
1548 device->path_thrhld = val; in dasd_path_threshold_store()
1550 dasd_put_device(device); in dasd_path_threshold_store()
1561 dasd_path_autodisable_show(struct device *dev, in dasd_path_autodisable_show()
1577 dasd_path_autodisable_store(struct device *dev, in dasd_path_autodisable_store()
1602 dasd_path_interval_show(struct device *dev, in dasd_path_interval_show()
1605 struct dasd_device *device; in dasd_path_interval_show() local
1608 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_path_interval_show()
1609 if (IS_ERR(device)) in dasd_path_interval_show()
1611 len = snprintf(buf, PAGE_SIZE, "%lu\n", device->path_interval); in dasd_path_interval_show()
1612 dasd_put_device(device); in dasd_path_interval_show()
1617 dasd_path_interval_store(struct device *dev, struct device_attribute *attr, in dasd_path_interval_store()
1620 struct dasd_device *device; in dasd_path_interval_store() local
1624 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_path_interval_store()
1625 if (IS_ERR(device)) in dasd_path_interval_store()
1630 dasd_put_device(device); in dasd_path_interval_store()
1635 device->path_interval = val; in dasd_path_interval_store()
1637 dasd_put_device(device); in dasd_path_interval_store()
1646 static ssize_t dasd_##_name##_show(struct device *dev, \
1651 struct dasd_device *device = dasd_device_from_cdev(cdev); \
1654 if (IS_ERR(device)) \
1656 if (device->discipline && _func) \
1657 val = _func(device); \
1658 dasd_put_device(device); \
1664 DASD_DEFINE_ATTR(ese, device->discipline->is_ese);
1665 DASD_DEFINE_ATTR(extent_size, device->discipline->ext_size);
1666 DASD_DEFINE_ATTR(pool_id, device->discipline->ext_pool_id);
1667 DASD_DEFINE_ATTR(space_configured, device->discipline->space_configured);
1668 DASD_DEFINE_ATTR(space_allocated, device->discipline->space_allocated);
1669 DASD_DEFINE_ATTR(logical_capacity, device->discipline->logical_capacity);
1670 DASD_DEFINE_ATTR(warn_threshold, device->discipline->ext_pool_warn_thrshld);
1671 DASD_DEFINE_ATTR(cap_at_warnlevel, device->discipline->ext_pool_cap_at_warnlevel);
1672 DASD_DEFINE_ATTR(pool_oos, device->discipline->ext_pool_oos);
1773 if (devmap->device) in dasd_set_feature()
1774 devmap->device->features = devmap->features; in dasd_set_feature()