Lines Matching refs:chp
141 struct channel_path *chp; in chp_measurement_chars_read() local
145 chp = to_channelpath(device); in chp_measurement_chars_read()
146 if (!chp->cmg_chars) in chp_measurement_chars_read()
150 chp->cmg_chars, sizeof(struct cmg_chars)); in chp_measurement_chars_read()
188 struct channel_path *chp; in chp_measurement_read() local
194 chp = to_channelpath(device); in chp_measurement_read()
195 css = to_css(chp->dev.parent); in chp_measurement_read()
202 chp_measurement_copy_block((struct cmg_entry *)buf, css, chp->chpid); in chp_measurement_read()
216 void chp_remove_cmg_attr(struct channel_path *chp) in chp_remove_cmg_attr() argument
218 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr); in chp_remove_cmg_attr()
219 device_remove_bin_file(&chp->dev, &chp_measurement_attr); in chp_remove_cmg_attr()
222 int chp_add_cmg_attr(struct channel_path *chp) in chp_add_cmg_attr() argument
226 ret = device_create_bin_file(&chp->dev, &chp_measurement_chars_attr); in chp_add_cmg_attr()
229 ret = device_create_bin_file(&chp->dev, &chp_measurement_attr); in chp_add_cmg_attr()
231 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr); in chp_add_cmg_attr()
241 struct channel_path *chp = to_channelpath(dev); in chp_status_show() local
243 if (!chp) in chp_status_show()
245 return (chp_get_status(chp->chpid) ? sprintf(buf, "online\n") : in chp_status_show()
315 struct channel_path *chp = to_channelpath(dev); in chp_type_show() local
317 if (!chp) in chp_type_show()
319 return sprintf(buf, "%x\n", chp->desc.desc); in chp_type_show()
327 struct channel_path *chp = to_channelpath(dev); in chp_cmg_show() local
329 if (!chp) in chp_cmg_show()
331 if (chp->cmg == -1) /* channel measurements not available */ in chp_cmg_show()
333 return sprintf(buf, "%x\n", chp->cmg); in chp_cmg_show()
341 struct channel_path *chp = to_channelpath(dev); in chp_shared_show() local
343 if (!chp) in chp_shared_show()
345 if (chp->shared == -1) /* channel measurements not available */ in chp_shared_show()
347 return sprintf(buf, "%x\n", chp->shared); in chp_shared_show()
382 struct channel_path *chp; in chp_new() local
387 chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL); in chp_new()
388 if (!chp) in chp_new()
392 chp->chpid = chpid; in chp_new()
393 chp->state = 1; in chp_new()
394 chp->dev.parent = &channel_subsystems[chpid.cssid]->device; in chp_new()
395 chp->dev.release = chp_release; in chp_new()
396 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id); in chp_new()
399 ret = chsc_determine_base_channel_path_desc(chpid, &chp->desc); in chp_new()
402 if ((chp->desc.flags & 0x80) == 0) { in chp_new()
408 ret = chsc_get_channel_measurement_chars(chp); in chp_new()
412 chp->cmg = -1; in chp_new()
416 ret = device_register(&chp->dev); in chp_new()
422 ret = sysfs_create_group(&chp->dev.kobj, &chp_attr_group); in chp_new()
424 device_unregister(&chp->dev); in chp_new()
429 ret = chp_add_cmg_attr(chp); in chp_new()
431 sysfs_remove_group(&chp->dev.kobj, &chp_attr_group); in chp_new()
432 device_unregister(&chp->dev); in chp_new()
437 channel_subsystems[chpid.cssid]->chps[chpid.id] = chp; in chp_new()
441 kfree(chp); in chp_new()
455 struct channel_path *chp; in chp_get_chp_desc() local
458 chp = chpid_to_chp(chpid); in chp_get_chp_desc()
459 if (!chp) in chp_get_chp_desc()
464 memcpy(desc, &chp->desc, sizeof(struct channel_path_desc)); in chp_get_chp_desc()