Lines Matching refs:dp
133 void (*data)(struct ds_info *dp,
145 static void md_update_data(struct ds_info *dp, struct ds_cap_state *cp,
147 static void domain_shutdown_data(struct ds_info *dp,
150 static void domain_panic_data(struct ds_info *dp,
154 static void dr_cpu_data(struct ds_info *dp,
158 static void ds_pri_data(struct ds_info *dp,
161 static void ds_var_data(struct ds_info *dp,
219 static struct ds_cap_state *find_cap(struct ds_info *dp, u64 handle) in find_cap() argument
223 if (index >= dp->num_ds_states) in find_cap()
225 return &dp->ds_states[index]; in find_cap()
228 static struct ds_cap_state *find_cap_by_string(struct ds_info *dp, in find_cap_by_string() argument
233 for (i = 0; i < dp->num_ds_states; i++) { in find_cap_by_string()
234 if (strcmp(dp->ds_states[i].service_id, name)) in find_cap_by_string()
237 return &dp->ds_states[i]; in find_cap_by_string()
278 static void md_update_data(struct ds_info *dp, in md_update_data() argument
282 struct ldc_channel *lp = dp->lp; in md_update_data()
292 printk(KERN_INFO "ds-%llu: Machine description update.\n", dp->id); in md_update_data()
317 static void domain_shutdown_data(struct ds_info *dp, in domain_shutdown_data() argument
321 struct ldc_channel *lp = dp->lp; in domain_shutdown_data()
332 "LDOM manager received.\n", dp->id); in domain_shutdown_data()
357 static void domain_panic_data(struct ds_info *dp, in domain_panic_data() argument
361 struct ldc_channel *lp = dp->lp; in domain_panic_data()
372 "LDOM manager received.\n", dp->id); in domain_panic_data()
420 static void __dr_cpu_send_error(struct ds_info *dp, in __dr_cpu_send_error() argument
443 __ds_send(dp->lp, &pkt, msg_len); in __dr_cpu_send_error()
446 static void dr_cpu_send_error(struct ds_info *dp, in dr_cpu_send_error() argument
453 __dr_cpu_send_error(dp, cp, data); in dr_cpu_send_error()
531 static int dr_cpu_configure(struct ds_info *dp, struct ds_cap_state *cp, in dr_cpu_configure() argument
555 dp->id, cpu); in dr_cpu_configure()
571 dp->id, err); in dr_cpu_configure()
577 __ds_send(dp->lp, resp, resp_len); in dr_cpu_configure()
588 static int dr_cpu_unconfigure(struct ds_info *dp, in dr_cpu_unconfigure() argument
611 dp->id, cpu); in dr_cpu_unconfigure()
620 __ds_send(dp->lp, resp, resp_len); in dr_cpu_unconfigure()
628 static void dr_cpu_data(struct ds_info *dp, struct ds_cap_state *cp, void *buf, in dr_cpu_data() argument
646 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
662 err = dr_cpu_configure(dp, cp, req_num, &mask); in dr_cpu_data()
664 err = dr_cpu_unconfigure(dp, cp, req_num, &mask); in dr_cpu_data()
667 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
679 static void ds_pri_data(struct ds_info *dp, in ds_pri_data() argument
689 dp->id, rp->req_num, rp->type, len); in ds_pri_data()
724 static void ds_var_data(struct ds_info *dp, in ds_var_data() argument
745 struct ds_info *dp; in ldom_set_var() local
750 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
753 tmp = find_cap_by_string(dp, "var-config"); in ldom_set_var()
760 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
763 tmp = find_cap_by_string(dp, "var-config-backup"); in ldom_set_var()
815 __ds_send(dp->lp, &pkt, msg_len); in ldom_set_var()
832 dp->id, var, value, in ldom_set_var()
876 static void ds_conn_reset(struct ds_info *dp) in ds_conn_reset() argument
879 dp->id, __builtin_return_address(0)); in ds_conn_reset()
882 static int register_services(struct ds_info *dp) in register_services() argument
884 struct ldc_channel *lp = dp->lp; in register_services()
887 for (i = 0; i < dp->num_ds_states; i++) { in register_services()
892 struct ds_cap_state *cp = &dp->ds_states[i]; in register_services()
920 static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt) in ds_handshake() argument
923 if (dp->hs_state == DS_HS_START) { in ds_handshake()
927 dp->hs_state = DS_HS_DONE; in ds_handshake()
929 return register_services(dp); in ds_handshake()
932 if (dp->hs_state != DS_HS_DONE) in ds_handshake()
937 struct ds_cap_state *cp = find_cap(dp, ap->handle); in ds_handshake()
941 "handle %llx\n", dp->id, ap->handle); in ds_handshake()
945 dp->id, cp->service_id); in ds_handshake()
949 struct ds_cap_state *cp = find_cap(dp, np->handle); in ds_handshake()
954 dp->id, np->handle); in ds_handshake()
963 ds_conn_reset(dp); in ds_handshake()
967 static void __send_ds_nack(struct ds_info *dp, u64 handle) in __send_ds_nack() argument
979 __ds_send(dp->lp, &nack, sizeof(nack)); in __send_ds_nack()
987 struct ds_info *dp; member
1005 struct ds_info *dp = qp->dp; in process_ds_work() local
1006 struct ds_cap_state *cp = find_cap(dp, dpkt->handle); in process_ds_work()
1012 dp->id, dpkt->handle); in process_ds_work()
1015 __send_ds_nack(dp, dpkt->handle); in process_ds_work()
1018 cp->data(dp, cp, dpkt, req_len); in process_ds_work()
1045 static int ds_data(struct ds_info *dp, struct ds_msg_tag *pkt, int len) in ds_data() argument
1052 __send_ds_nack(dp, dpkt->handle); in ds_data()
1054 qp->dp = dp; in ds_data()
1062 static void ds_up(struct ds_info *dp) in ds_up() argument
1064 struct ldc_channel *lp = dp->lp; in ds_up()
1075 dp->hs_state = DS_HS_START; in ds_up()
1078 static void ds_reset(struct ds_info *dp) in ds_reset() argument
1082 dp->hs_state = 0; in ds_reset()
1084 for (i = 0; i < dp->num_ds_states; i++) { in ds_reset()
1085 struct ds_cap_state *cp = &dp->ds_states[i]; in ds_reset()
1093 struct ds_info *dp = arg; in ds_event() local
1094 struct ldc_channel *lp = dp->lp; in ds_event()
1101 ds_up(dp); in ds_event()
1107 ds_reset(dp); in ds_event()
1114 dp->id, event); in ds_event()
1123 err = ldc_read(lp, dp->rcv_buf, sizeof(*tag)); in ds_event()
1127 ds_conn_reset(dp); in ds_event()
1133 tag = dp->rcv_buf; in ds_event()
1138 ds_conn_reset(dp); in ds_event()
1145 err = ds_handshake(dp, dp->rcv_buf); in ds_event()
1147 err = ds_data(dp, dp->rcv_buf, in ds_event()
1166 struct ds_info *dp; in ds_probe() local
1173 dp = kzalloc(sizeof(*dp), GFP_KERNEL); in ds_probe()
1175 if (!dp) in ds_probe()
1181 dp->id = *val; in ds_probe()
1184 dp->rcv_buf = kzalloc(4096, GFP_KERNEL); in ds_probe()
1185 if (!dp->rcv_buf) in ds_probe()
1188 dp->rcv_buf_len = 4096; in ds_probe()
1190 dp->ds_states = kmemdup(ds_states_template, in ds_probe()
1192 if (!dp->ds_states) in ds_probe()
1195 dp->num_ds_states = ARRAY_SIZE(ds_states_template); in ds_probe()
1197 for (i = 0; i < dp->num_ds_states; i++) in ds_probe()
1198 dp->ds_states[i].handle = ((u64)i << 32); in ds_probe()
1203 lp = ldc_alloc(vdev->channel_id, &ds_cfg, dp, "DS"); in ds_probe()
1208 dp->lp = lp; in ds_probe()
1215 dp->next = ds_info_list; in ds_probe()
1216 ds_info_list = dp; in ds_probe()
1222 ldc_free(dp->lp); in ds_probe()
1225 kfree(dp->ds_states); in ds_probe()
1228 kfree(dp->rcv_buf); in ds_probe()
1231 kfree(dp); in ds_probe()