Lines Matching refs:chp

137 	struct channel_path *chp;  in chp_measurement_chars_read()  local
141 chp = to_channelpath(device); in chp_measurement_chars_read()
142 if (!chp->cmg_chars) in chp_measurement_chars_read()
146 chp->cmg_chars, sizeof(struct cmg_chars)); in chp_measurement_chars_read()
184 struct channel_path *chp; in chp_measurement_read() local
190 chp = to_channelpath(device); in chp_measurement_read()
191 css = to_css(chp->dev.parent); in chp_measurement_read()
198 chp_measurement_copy_block((struct cmg_entry *)buf, css, chp->chpid); in chp_measurement_read()
212 void chp_remove_cmg_attr(struct channel_path *chp) in chp_remove_cmg_attr() argument
214 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr); in chp_remove_cmg_attr()
215 device_remove_bin_file(&chp->dev, &chp_measurement_attr); in chp_remove_cmg_attr()
218 int chp_add_cmg_attr(struct channel_path *chp) in chp_add_cmg_attr() argument
222 ret = device_create_bin_file(&chp->dev, &chp_measurement_chars_attr); in chp_add_cmg_attr()
225 ret = device_create_bin_file(&chp->dev, &chp_measurement_attr); in chp_add_cmg_attr()
227 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr); in chp_add_cmg_attr()
237 struct channel_path *chp = to_channelpath(dev); in chp_status_show() local
240 mutex_lock(&chp->lock); in chp_status_show()
241 status = chp->state; in chp_status_show()
242 mutex_unlock(&chp->lock); in chp_status_show()
316 struct channel_path *chp = to_channelpath(dev); in chp_type_show() local
319 mutex_lock(&chp->lock); in chp_type_show()
320 type = chp->desc.desc; in chp_type_show()
321 mutex_unlock(&chp->lock); in chp_type_show()
330 struct channel_path *chp = to_channelpath(dev); in chp_cmg_show() local
332 if (!chp) in chp_cmg_show()
334 if (chp->cmg == -1) /* channel measurements not available */ in chp_cmg_show()
336 return sprintf(buf, "%x\n", chp->cmg); in chp_cmg_show()
344 struct channel_path *chp = to_channelpath(dev); in chp_shared_show() local
346 if (!chp) in chp_shared_show()
348 if (chp->shared == -1) /* channel measurements not available */ in chp_shared_show()
350 return sprintf(buf, "%x\n", chp->shared); in chp_shared_show()
358 struct channel_path *chp = to_channelpath(dev); in chp_chid_show() local
361 mutex_lock(&chp->lock); in chp_chid_show()
362 if (chp->desc_fmt1.flags & 0x10) in chp_chid_show()
363 rc = sprintf(buf, "%04x\n", chp->desc_fmt1.chid); in chp_chid_show()
366 mutex_unlock(&chp->lock); in chp_chid_show()
375 struct channel_path *chp = to_channelpath(dev); in chp_chid_external_show() local
378 mutex_lock(&chp->lock); in chp_chid_external_show()
379 if (chp->desc_fmt1.flags & 0x10) in chp_chid_external_show()
380 rc = sprintf(buf, "%x\n", chp->desc_fmt1.flags & 0x8 ? 1 : 0); in chp_chid_external_show()
383 mutex_unlock(&chp->lock); in chp_chid_external_show()
422 int chp_update_desc(struct channel_path *chp) in chp_update_desc() argument
426 rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc); in chp_update_desc()
430 rc = chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1); in chp_update_desc()
444 struct channel_path *chp; in chp_new() local
449 chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL); in chp_new()
450 if (!chp) in chp_new()
454 chp->chpid = chpid; in chp_new()
455 chp->state = 1; in chp_new()
456 chp->dev.parent = &channel_subsystems[chpid.cssid]->device; in chp_new()
457 chp->dev.groups = chp_attr_groups; in chp_new()
458 chp->dev.release = chp_release; in chp_new()
459 mutex_init(&chp->lock); in chp_new()
462 ret = chp_update_desc(chp); in chp_new()
465 if ((chp->desc.flags & 0x80) == 0) { in chp_new()
471 ret = chsc_get_channel_measurement_chars(chp); in chp_new()
475 chp->cmg = -1; in chp_new()
477 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id); in chp_new()
480 ret = device_register(&chp->dev); in chp_new()
484 put_device(&chp->dev); in chp_new()
489 ret = chp_add_cmg_attr(chp); in chp_new()
491 device_unregister(&chp->dev); in chp_new()
496 channel_subsystems[chpid.cssid]->chps[chpid.id] = chp; in chp_new()
500 kfree(chp); in chp_new()
514 struct channel_path *chp; in chp_get_chp_desc() local
517 chp = chpid_to_chp(chpid); in chp_get_chp_desc()
518 if (!chp) in chp_get_chp_desc()
524 mutex_lock(&chp->lock); in chp_get_chp_desc()
525 memcpy(desc, &chp->desc, sizeof(struct channel_path_desc)); in chp_get_chp_desc()
526 mutex_unlock(&chp->lock); in chp_get_chp_desc()