Lines Matching refs:chp

28 #include "chp.h"
135 struct channel_path *chp;
139 chp = to_channelpath(device);
140 if (chp->cmg == -1)
143 return memory_read_from_buffer(buf, count, &off, &chp->cmg_chars,
144 sizeof(chp->cmg_chars));
182 struct channel_path *chp;
188 chp = to_channelpath(device);
189 css = to_css(chp->dev.parent);
196 chp_measurement_copy_block((struct cmg_entry *)buf, css, chp->chpid);
210 void chp_remove_cmg_attr(struct channel_path *chp)
212 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr);
213 device_remove_bin_file(&chp->dev, &chp_measurement_attr);
216 int chp_add_cmg_attr(struct channel_path *chp)
220 ret = device_create_bin_file(&chp->dev, &chp_measurement_chars_attr);
223 ret = device_create_bin_file(&chp->dev, &chp_measurement_attr);
225 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr);
235 struct channel_path *chp = to_channelpath(dev);
238 mutex_lock(&chp->lock);
239 status = chp->state;
240 mutex_unlock(&chp->lock);
317 struct channel_path *chp = to_channelpath(dev);
320 mutex_lock(&chp->lock);
321 type = chp->desc.desc;
322 mutex_unlock(&chp->lock);
331 struct channel_path *chp = to_channelpath(dev);
333 if (!chp)
335 if (chp->cmg == -1) /* channel measurements not available */
337 return sprintf(buf, "%x\n", chp->cmg);
345 struct channel_path *chp = to_channelpath(dev);
347 if (!chp)
349 if (chp->shared == -1) /* channel measurements not available */
351 return sprintf(buf, "%x\n", chp->shared);
359 struct channel_path *chp = to_channelpath(dev);
362 mutex_lock(&chp->lock);
363 if (chp->desc_fmt1.flags & 0x10)
364 rc = sprintf(buf, "%04x\n", chp->desc_fmt1.chid);
367 mutex_unlock(&chp->lock);
376 struct channel_path *chp = to_channelpath(dev);
379 mutex_lock(&chp->lock);
380 if (chp->desc_fmt1.flags & 0x10)
381 rc = sprintf(buf, "%x\n", chp->desc_fmt1.flags & 0x8 ? 1 : 0);
384 mutex_unlock(&chp->lock);
394 struct channel_path *chp = to_channelpath(kobj_to_dev(kobj));
397 mutex_lock(&chp->lock);
398 rc = memory_read_from_buffer(buf, count, &off, chp->desc_fmt3.util_str,
399 sizeof(chp->desc_fmt3.util_str));
400 mutex_unlock(&chp->lock);
441 * @chp: channel-path
447 int chp_update_desc(struct channel_path *chp)
451 rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc);
459 chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
460 chsc_determine_fmt3_channel_path_desc(chp->chpid, &chp->desc_fmt3);
461 chsc_get_channel_measurement_chars(chp);
476 struct channel_path *chp;
483 chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL);
484 if (!chp) {
489 chp->chpid = chpid;
490 chp->state = 1;
491 chp->dev.parent = &css->device;
492 chp->dev.groups = chp_attr_groups;
493 chp->dev.release = chp_release;
494 mutex_init(&chp->lock);
497 ret = chp_update_desc(chp);
500 if ((chp->desc.flags & 0x80) == 0) {
504 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
507 ret = device_register(&chp->dev);
509 CIO_MSG_EVENT(0, "Could not register chp%x.%02x: %d\n",
511 put_device(&chp->dev);
516 ret = chp_add_cmg_attr(chp);
518 device_unregister(&chp->dev);
522 css->chps[chpid.id] = chp;
525 kfree(chp);
540 struct channel_path *chp;
543 chp = chpid_to_chp(chpid);
544 if (!chp)
550 mutex_lock(&chp->lock);
551 memcpy(desc, &chp->desc, sizeof(*desc));
552 mutex_unlock(&chp->lock);
729 CIO_MSG_EVENT(2, "chp: sclp_chp_configure(%x.%02x)="
739 CIO_MSG_EVENT(2, "chp: sclp_chp_deconfigure(%x.%02x)="