Lines Matching refs:dp
135 void (*data)(struct ds_info *dp,
147 static void md_update_data(struct ds_info *dp, struct ds_cap_state *cp,
149 static void domain_shutdown_data(struct ds_info *dp,
152 static void domain_panic_data(struct ds_info *dp,
156 static void dr_cpu_data(struct ds_info *dp,
160 static void ds_pri_data(struct ds_info *dp,
163 static void ds_var_data(struct ds_info *dp,
221 static struct ds_cap_state *find_cap(struct ds_info *dp, u64 handle) in find_cap() argument
225 if (index >= dp->num_ds_states) in find_cap()
227 return &dp->ds_states[index]; in find_cap()
230 static struct ds_cap_state *find_cap_by_string(struct ds_info *dp, in find_cap_by_string() argument
235 for (i = 0; i < dp->num_ds_states; i++) { in find_cap_by_string()
236 if (strcmp(dp->ds_states[i].service_id, name)) in find_cap_by_string()
239 return &dp->ds_states[i]; in find_cap_by_string()
280 static void md_update_data(struct ds_info *dp, in md_update_data() argument
284 struct ldc_channel *lp = dp->lp; in md_update_data()
294 printk(KERN_INFO "ds-%llu: Machine description update.\n", dp->id); in md_update_data()
319 static void domain_shutdown_data(struct ds_info *dp, in domain_shutdown_data() argument
323 struct ldc_channel *lp = dp->lp; in domain_shutdown_data()
334 "LDOM manager received.\n", dp->id); in domain_shutdown_data()
359 static void domain_panic_data(struct ds_info *dp, in domain_panic_data() argument
363 struct ldc_channel *lp = dp->lp; in domain_panic_data()
374 "LDOM manager received.\n", dp->id); in domain_panic_data()
422 static void __dr_cpu_send_error(struct ds_info *dp, in __dr_cpu_send_error() argument
445 __ds_send(dp->lp, &pkt, msg_len); in __dr_cpu_send_error()
448 static void dr_cpu_send_error(struct ds_info *dp, in dr_cpu_send_error() argument
455 __dr_cpu_send_error(dp, cp, data); in dr_cpu_send_error()
533 static int dr_cpu_configure(struct ds_info *dp, struct ds_cap_state *cp, in dr_cpu_configure() argument
557 dp->id, cpu); in dr_cpu_configure()
573 dp->id, err); in dr_cpu_configure()
579 __ds_send(dp->lp, resp, resp_len); in dr_cpu_configure()
590 static int dr_cpu_unconfigure(struct ds_info *dp, in dr_cpu_unconfigure() argument
613 dp->id, cpu); in dr_cpu_unconfigure()
622 __ds_send(dp->lp, resp, resp_len); in dr_cpu_unconfigure()
630 static void dr_cpu_data(struct ds_info *dp, struct ds_cap_state *cp, void *buf, in dr_cpu_data() argument
648 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
664 err = dr_cpu_configure(dp, cp, req_num, &mask); in dr_cpu_data()
666 err = dr_cpu_unconfigure(dp, cp, req_num, &mask); in dr_cpu_data()
669 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
681 static void ds_pri_data(struct ds_info *dp, in ds_pri_data() argument
691 dp->id, rp->req_num, rp->type, len); in ds_pri_data()
726 static void ds_var_data(struct ds_info *dp, in ds_var_data() argument
747 struct ds_info *dp; in ldom_set_var() local
752 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
755 tmp = find_cap_by_string(dp, "var-config"); in ldom_set_var()
762 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
765 tmp = find_cap_by_string(dp, "var-config-backup"); in ldom_set_var()
820 __ds_send(dp->lp, &pkt, msg_len); in ldom_set_var()
837 dp->id, var, value, in ldom_set_var()
881 static void ds_conn_reset(struct ds_info *dp) in ds_conn_reset() argument
884 dp->id, __builtin_return_address(0)); in ds_conn_reset()
887 static int register_services(struct ds_info *dp) in register_services() argument
889 struct ldc_channel *lp = dp->lp; in register_services()
892 for (i = 0; i < dp->num_ds_states; i++) { in register_services()
897 struct ds_cap_state *cp = &dp->ds_states[i]; in register_services()
925 static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt) in ds_handshake() argument
928 if (dp->hs_state == DS_HS_START) { in ds_handshake()
932 dp->hs_state = DS_HS_DONE; in ds_handshake()
934 return register_services(dp); in ds_handshake()
937 if (dp->hs_state != DS_HS_DONE) in ds_handshake()
942 struct ds_cap_state *cp = find_cap(dp, ap->handle); in ds_handshake()
946 "handle %llx\n", dp->id, ap->handle); in ds_handshake()
950 dp->id, cp->service_id); in ds_handshake()
954 struct ds_cap_state *cp = find_cap(dp, np->handle); in ds_handshake()
959 dp->id, np->handle); in ds_handshake()
968 ds_conn_reset(dp); in ds_handshake()
972 static void __send_ds_nack(struct ds_info *dp, u64 handle) in __send_ds_nack() argument
984 __ds_send(dp->lp, &nack, sizeof(nack)); in __send_ds_nack()
992 struct ds_info *dp; member
1010 struct ds_info *dp = qp->dp; in process_ds_work() local
1011 struct ds_cap_state *cp = find_cap(dp, dpkt->handle); in process_ds_work()
1017 dp->id, dpkt->handle); in process_ds_work()
1020 __send_ds_nack(dp, dpkt->handle); in process_ds_work()
1023 cp->data(dp, cp, dpkt, req_len); in process_ds_work()
1050 static int ds_data(struct ds_info *dp, struct ds_msg_tag *pkt, int len) in ds_data() argument
1057 __send_ds_nack(dp, dpkt->handle); in ds_data()
1059 qp->dp = dp; in ds_data()
1067 static void ds_up(struct ds_info *dp) in ds_up() argument
1069 struct ldc_channel *lp = dp->lp; in ds_up()
1080 dp->hs_state = DS_HS_START; in ds_up()
1083 static void ds_reset(struct ds_info *dp) in ds_reset() argument
1087 dp->hs_state = 0; in ds_reset()
1089 for (i = 0; i < dp->num_ds_states; i++) { in ds_reset()
1090 struct ds_cap_state *cp = &dp->ds_states[i]; in ds_reset()
1098 struct ds_info *dp = arg; in ds_event() local
1099 struct ldc_channel *lp = dp->lp; in ds_event()
1106 ds_up(dp); in ds_event()
1112 ds_reset(dp); in ds_event()
1119 dp->id, event); in ds_event()
1128 err = ldc_read(lp, dp->rcv_buf, sizeof(*tag)); in ds_event()
1132 ds_conn_reset(dp); in ds_event()
1138 tag = dp->rcv_buf; in ds_event()
1143 ds_conn_reset(dp); in ds_event()
1150 err = ds_handshake(dp, dp->rcv_buf); in ds_event()
1152 err = ds_data(dp, dp->rcv_buf, in ds_event()
1171 struct ds_info *dp; in ds_probe() local
1178 dp = kzalloc_obj(*dp); in ds_probe()
1180 if (!dp) in ds_probe()
1186 dp->id = *val; in ds_probe()
1189 dp->rcv_buf = kzalloc(4096, GFP_KERNEL); in ds_probe()
1190 if (!dp->rcv_buf) in ds_probe()
1193 dp->rcv_buf_len = 4096; in ds_probe()
1195 dp->ds_states = kmemdup(ds_states_template, in ds_probe()
1197 if (!dp->ds_states) in ds_probe()
1200 dp->num_ds_states = ARRAY_SIZE(ds_states_template); in ds_probe()
1202 for (i = 0; i < dp->num_ds_states; i++) in ds_probe()
1203 dp->ds_states[i].handle = ((u64)i << 32); in ds_probe()
1208 lp = ldc_alloc(vdev->channel_id, &ds_cfg, dp, "DS"); in ds_probe()
1213 dp->lp = lp; in ds_probe()
1220 dp->next = ds_info_list; in ds_probe()
1221 ds_info_list = dp; in ds_probe()
1227 ldc_free(dp->lp); in ds_probe()
1230 kfree(dp->ds_states); in ds_probe()
1233 kfree(dp->rcv_buf); in ds_probe()
1236 kfree(dp); in ds_probe()