Lines Matching refs:chpid
20 #include <asm/chpid.h>
55 /* Set vary state for given chpid. */
56 static void set_chp_logically_online(struct chp_id chpid, int onoff)
58 chpid_to_chp(chpid)->state = onoff;
63 int chp_get_status(struct chp_id chpid)
65 return (chpid_to_chp(chpid) ? chpid_to_chp(chpid)->state : -ENODEV);
77 struct chp_id chpid;
82 chp_id_init(&chpid);
85 chpid.id = sch->schib.pmcw.chpid[i];
86 if (chp_get_status(chpid) != 0)
95 * @chpid: channel-path ID
97 * Return non-zero if a channel-path with the given chpid is registered,
100 int chp_is_registered(struct chp_id chpid)
102 return chpid_to_chp(chpid) != NULL;
107 * Varies the specified chpid online or offline
109 static int s390_vary_chpid(struct chp_id chpid, int on)
114 sprintf(dbf_text, on?"varyon%x.%02x":"varyoff%x.%02x", chpid.cssid,
115 chpid.id);
118 status = chp_get_status(chpid);
122 set_chp_logically_online(chpid, on);
123 chsc_chp_vary(chpid, on);
158 struct chp_id chpid)
164 if (chpid.id < 128) {
166 idx = chpid.id;
169 idx = chpid.id - 128;
196 chp_measurement_copy_block((struct cmg_entry *)buf, css, chp->chpid);
263 error = s390_vary_chpid(cp->chpid, 1);
267 error = s390_vary_chpid(cp->chpid, 0);
284 status = chp_info_get_status(cp->chpid);
306 chp_cfg_schedule(cp->chpid, val);
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);
468 * @chpid: channel-path ID
473 int chp_new(struct chp_id chpid)
475 struct channel_subsystem *css = css_by_id(chpid.cssid);
480 if (chp_is_registered(chpid))
489 chp->chpid = chpid;
504 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
510 chpid.cssid, chpid.id, ret);
522 css->chps[chpid.id] = chp;
533 * @chpid: channel-path ID
538 struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid)
543 chp = chpid_to_chp(chpid);
568 struct chp_id chpid;
588 chp_id_init(&chpid);
589 chpid.id = crw0->rsid;
593 chp_new(chpid);
594 chsc_chp_online(chpid);
598 chsc_chp_offline(chpid);
615 if (!chp_id_is_equal(&ssd->chpid[i], &link->chpid))
658 * @chpid: channel-path ID
663 int chp_info_get_status(struct chp_id chpid)
672 bit = info_bit_num(chpid);
687 /* Return configure task for chpid. */
688 static enum cfg_task_t cfg_get_task(struct chp_id chpid)
690 return chp_cfg_task[chpid.cssid][chpid.id];
693 /* Set configure task for chpid. */
694 static void cfg_set_task(struct chp_id chpid, enum cfg_task_t cfg)
696 chp_cfg_task[chpid.cssid][chpid.id] = cfg;
699 /* Fetch the first configure task. Set chpid accordingly. */
700 static enum cfg_task_t chp_cfg_fetch_task(struct chp_id *chpid)
704 chp_id_for_each(chpid) {
705 t = cfg_get_task(*chpid);
717 struct chp_id chpid;
722 t = chp_cfg_fetch_task(&chpid);
727 rc = sclp_chp_configure(chpid);
730 "%d\n", chpid.cssid, chpid.id, rc);
733 chsc_chp_online(chpid);
737 rc = sclp_chp_deconfigure(chpid);
740 "%d\n", chpid.cssid, chpid.id, rc);
743 chsc_chp_offline(chpid);
753 if (t == cfg_get_task(chpid))
754 cfg_set_task(chpid, cfg_none);
760 * chp_cfg_schedule - schedule chpid configuration request
761 * @chpid: channel-path ID
766 void chp_cfg_schedule(struct chp_id chpid, int configure)
768 CIO_MSG_EVENT(2, "chp_cfg_sched%x.%02x=%d\n", chpid.cssid, chpid.id,
771 cfg_set_task(chpid, configure ? cfg_configure : cfg_deconfigure);
777 * chp_cfg_cancel_deconfigure - cancel chpid deconfiguration request
778 * @chpid: channel-path ID
783 void chp_cfg_cancel_deconfigure(struct chp_id chpid)
785 CIO_MSG_EVENT(2, "chp_cfg_cancel:%x.%02x\n", chpid.cssid, chpid.id);
787 if (cfg_get_task(chpid) == cfg_deconfigure)
788 cfg_set_task(chpid, cfg_none);
794 struct chp_id chpid;
798 t = chp_cfg_fetch_task(&chpid);
813 struct chp_id chpid;
824 chp_id_for_each(&chpid) {
825 state = chp_info_get_status(chpid);
828 chp_new(chpid);