Lines Matching refs:chp

28 #include "chp.h"
134 struct channel_path *chp;
138 chp = to_channelpath(device);
139 if (chp->cmg == -1)
142 return memory_read_from_buffer(buf, count, &off, &chp->cmg_chars,
143 sizeof(chp->cmg_chars));
150 struct channel_path *chp;
158 chp = to_channelpath(device);
159 css = to_css(chp->dev.parent);
160 id = chp->chpid.id;
164 if (!chp->extended)
210 void chp_remove_cmg_attr(struct channel_path *chp)
212 device_remove_groups(&chp->dev, measurement_groups);
215 int chp_add_cmg_attr(struct channel_path *chp)
217 return device_add_groups(&chp->dev, measurement_groups);
226 struct channel_path *chp = to_channelpath(dev);
229 mutex_lock(&chp->lock);
230 status = chp->state;
231 mutex_unlock(&chp->lock);
308 struct channel_path *chp = to_channelpath(dev);
311 mutex_lock(&chp->lock);
312 type = chp->desc.desc;
313 mutex_unlock(&chp->lock);
322 struct channel_path *chp = to_channelpath(dev);
324 if (!chp)
326 if (chp->cmg == -1) /* channel measurements not available */
328 return sprintf(buf, "%d\n", chp->cmg);
336 struct channel_path *chp = to_channelpath(dev);
338 if (!chp)
340 if (chp->shared == -1) /* channel measurements not available */
342 return sprintf(buf, "%x\n", chp->shared);
350 struct channel_path *chp = to_channelpath(dev);
353 mutex_lock(&chp->lock);
354 if (chp->desc_fmt1.flags & 0x10)
355 rc = sprintf(buf, "%04x\n", chp->desc_fmt1.chid);
358 mutex_unlock(&chp->lock);
367 struct channel_path *chp = to_channelpath(dev);
370 mutex_lock(&chp->lock);
371 if (chp->desc_fmt1.flags & 0x10)
372 rc = sprintf(buf, "%x\n", chp->desc_fmt1.flags & 0x8 ? 1 : 0);
375 mutex_unlock(&chp->lock);
384 struct channel_path *chp = to_channelpath(dev);
387 mutex_lock(&chp->lock);
388 rc = sprintf(buf, "%x\n", chp->desc_fmt1.esc);
389 mutex_unlock(&chp->lock);
412 struct channel_path *chp = to_channelpath(dev);
413 unsigned long speed = chp->speed;
428 struct channel_path *chp = to_channelpath(kobj_to_dev(kobj));
431 mutex_lock(&chp->lock);
432 rc = memory_read_from_buffer(buf, count, &off, chp->desc_fmt3.util_str,
433 sizeof(chp->desc_fmt3.util_str));
434 mutex_unlock(&chp->lock);
477 * @chp: channel-path
483 int chp_update_desc(struct channel_path *chp)
487 rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc);
495 chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
496 chsc_determine_fmt3_channel_path_desc(chp->chpid, &chp->desc_fmt3);
497 chsc_get_channel_measurement_chars(chp);
512 struct channel_path *chp;
519 chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL);
520 if (!chp) {
525 chp->chpid = chpid;
526 chp->state = 1;
527 chp->dev.parent = &css->device;
528 chp->dev.groups = chp_attr_groups;
529 chp->dev.release = chp_release;
530 mutex_init(&chp->lock);
533 ret = chp_update_desc(chp);
536 if ((chp->desc.flags & 0x80) == 0) {
540 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
543 ret = device_register(&chp->dev);
545 CIO_MSG_EVENT(0, "Could not register chp%x.%02x: %d\n",
547 put_device(&chp->dev);
552 ret = chp_add_cmg_attr(chp);
554 device_unregister(&chp->dev);
558 css->chps[chpid.id] = chp;
561 kfree(chp);
576 struct channel_path *chp;
579 chp = chpid_to_chp(chpid);
580 if (!chp)
586 mutex_lock(&chp->lock);
587 memcpy(desc, &chp->desc, sizeof(*desc));
588 mutex_unlock(&chp->lock);
765 CIO_MSG_EVENT(2, "chp: sclp_chp_configure(%x.%02x)="
775 CIO_MSG_EVENT(2, "chp: sclp_chp_deconfigure(%x.%02x)="