Lines Matching refs:dp

134 	void			(*data)(struct ds_info *dp,
146 static void md_update_data(struct ds_info *dp, struct ds_cap_state *cp,
148 static void domain_shutdown_data(struct ds_info *dp,
151 static void domain_panic_data(struct ds_info *dp,
155 static void dr_cpu_data(struct ds_info *dp,
159 static void ds_pri_data(struct ds_info *dp,
162 static void ds_var_data(struct ds_info *dp,
220 static struct ds_cap_state *find_cap(struct ds_info *dp, u64 handle) in find_cap() argument
224 if (index >= dp->num_ds_states) in find_cap()
226 return &dp->ds_states[index]; in find_cap()
229 static struct ds_cap_state *find_cap_by_string(struct ds_info *dp, in find_cap_by_string() argument
234 for (i = 0; i < dp->num_ds_states; i++) { in find_cap_by_string()
235 if (strcmp(dp->ds_states[i].service_id, name)) in find_cap_by_string()
238 return &dp->ds_states[i]; in find_cap_by_string()
279 static void md_update_data(struct ds_info *dp, in md_update_data() argument
283 struct ldc_channel *lp = dp->lp; in md_update_data()
293 printk(KERN_INFO "ds-%llu: Machine description update.\n", dp->id); in md_update_data()
318 static void domain_shutdown_data(struct ds_info *dp, in domain_shutdown_data() argument
322 struct ldc_channel *lp = dp->lp; in domain_shutdown_data()
333 "LDOM manager received.\n", dp->id); in domain_shutdown_data()
358 static void domain_panic_data(struct ds_info *dp, in domain_panic_data() argument
362 struct ldc_channel *lp = dp->lp; in domain_panic_data()
373 "LDOM manager received.\n", dp->id); in domain_panic_data()
421 static void __dr_cpu_send_error(struct ds_info *dp, in __dr_cpu_send_error() argument
444 __ds_send(dp->lp, &pkt, msg_len); in __dr_cpu_send_error()
447 static void dr_cpu_send_error(struct ds_info *dp, in dr_cpu_send_error() argument
454 __dr_cpu_send_error(dp, cp, data); in dr_cpu_send_error()
532 static int dr_cpu_configure(struct ds_info *dp, struct ds_cap_state *cp, in dr_cpu_configure() argument
556 dp->id, cpu); in dr_cpu_configure()
572 dp->id, err); in dr_cpu_configure()
578 __ds_send(dp->lp, resp, resp_len); in dr_cpu_configure()
589 static int dr_cpu_unconfigure(struct ds_info *dp, in dr_cpu_unconfigure() argument
612 dp->id, cpu); in dr_cpu_unconfigure()
621 __ds_send(dp->lp, resp, resp_len); in dr_cpu_unconfigure()
629 static void dr_cpu_data(struct ds_info *dp, struct ds_cap_state *cp, void *buf, in dr_cpu_data() argument
647 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
663 err = dr_cpu_configure(dp, cp, req_num, &mask); in dr_cpu_data()
665 err = dr_cpu_unconfigure(dp, cp, req_num, &mask); in dr_cpu_data()
668 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
680 static void ds_pri_data(struct ds_info *dp, in ds_pri_data() argument
690 dp->id, rp->req_num, rp->type, len); in ds_pri_data()
725 static void ds_var_data(struct ds_info *dp, in ds_var_data() argument
746 struct ds_info *dp; in ldom_set_var() local
751 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
754 tmp = find_cap_by_string(dp, "var-config"); in ldom_set_var()
761 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
764 tmp = find_cap_by_string(dp, "var-config-backup"); in ldom_set_var()
816 __ds_send(dp->lp, &pkt, msg_len); in ldom_set_var()
833 dp->id, var, value, in ldom_set_var()
877 static void ds_conn_reset(struct ds_info *dp) in ds_conn_reset() argument
880 dp->id, __builtin_return_address(0)); in ds_conn_reset()
883 static int register_services(struct ds_info *dp) in register_services() argument
885 struct ldc_channel *lp = dp->lp; in register_services()
888 for (i = 0; i < dp->num_ds_states; i++) { in register_services()
893 struct ds_cap_state *cp = &dp->ds_states[i]; in register_services()
921 static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt) in ds_handshake() argument
924 if (dp->hs_state == DS_HS_START) { in ds_handshake()
928 dp->hs_state = DS_HS_DONE; in ds_handshake()
930 return register_services(dp); in ds_handshake()
933 if (dp->hs_state != DS_HS_DONE) in ds_handshake()
938 struct ds_cap_state *cp = find_cap(dp, ap->handle); in ds_handshake()
942 "handle %llx\n", dp->id, ap->handle); in ds_handshake()
946 dp->id, cp->service_id); in ds_handshake()
950 struct ds_cap_state *cp = find_cap(dp, np->handle); in ds_handshake()
955 dp->id, np->handle); in ds_handshake()
964 ds_conn_reset(dp); in ds_handshake()
968 static void __send_ds_nack(struct ds_info *dp, u64 handle) in __send_ds_nack() argument
980 __ds_send(dp->lp, &nack, sizeof(nack)); in __send_ds_nack()
988 struct ds_info *dp; member
1006 struct ds_info *dp = qp->dp; in process_ds_work() local
1007 struct ds_cap_state *cp = find_cap(dp, dpkt->handle); in process_ds_work()
1013 dp->id, dpkt->handle); in process_ds_work()
1016 __send_ds_nack(dp, dpkt->handle); in process_ds_work()
1019 cp->data(dp, cp, dpkt, req_len); in process_ds_work()
1046 static int ds_data(struct ds_info *dp, struct ds_msg_tag *pkt, int len) in ds_data() argument
1053 __send_ds_nack(dp, dpkt->handle); in ds_data()
1055 qp->dp = dp; in ds_data()
1063 static void ds_up(struct ds_info *dp) in ds_up() argument
1065 struct ldc_channel *lp = dp->lp; in ds_up()
1076 dp->hs_state = DS_HS_START; in ds_up()
1079 static void ds_reset(struct ds_info *dp) in ds_reset() argument
1083 dp->hs_state = 0; in ds_reset()
1085 for (i = 0; i < dp->num_ds_states; i++) { in ds_reset()
1086 struct ds_cap_state *cp = &dp->ds_states[i]; in ds_reset()
1094 struct ds_info *dp = arg; in ds_event() local
1095 struct ldc_channel *lp = dp->lp; in ds_event()
1102 ds_up(dp); in ds_event()
1108 ds_reset(dp); in ds_event()
1115 dp->id, event); in ds_event()
1124 err = ldc_read(lp, dp->rcv_buf, sizeof(*tag)); in ds_event()
1128 ds_conn_reset(dp); in ds_event()
1134 tag = dp->rcv_buf; in ds_event()
1139 ds_conn_reset(dp); in ds_event()
1146 err = ds_handshake(dp, dp->rcv_buf); in ds_event()
1148 err = ds_data(dp, dp->rcv_buf, in ds_event()
1167 struct ds_info *dp; in ds_probe() local
1174 dp = kzalloc(sizeof(*dp), GFP_KERNEL); in ds_probe()
1176 if (!dp) in ds_probe()
1182 dp->id = *val; in ds_probe()
1185 dp->rcv_buf = kzalloc(4096, GFP_KERNEL); in ds_probe()
1186 if (!dp->rcv_buf) in ds_probe()
1189 dp->rcv_buf_len = 4096; in ds_probe()
1191 dp->ds_states = kmemdup(ds_states_template, in ds_probe()
1193 if (!dp->ds_states) in ds_probe()
1196 dp->num_ds_states = ARRAY_SIZE(ds_states_template); in ds_probe()
1198 for (i = 0; i < dp->num_ds_states; i++) in ds_probe()
1199 dp->ds_states[i].handle = ((u64)i << 32); in ds_probe()
1204 lp = ldc_alloc(vdev->channel_id, &ds_cfg, dp, "DS"); in ds_probe()
1209 dp->lp = lp; in ds_probe()
1216 dp->next = ds_info_list; in ds_probe()
1217 ds_info_list = dp; in ds_probe()
1223 ldc_free(dp->lp); in ds_probe()
1226 kfree(dp->ds_states); in ds_probe()
1229 kfree(dp->rcv_buf); in ds_probe()
1232 kfree(dp); in ds_probe()