Lines Matching full: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()
817 __ds_send(dp->lp, &pkt, msg_len); in ldom_set_var()
834 dp->id, var, value, in ldom_set_var()
878 static void ds_conn_reset(struct ds_info *dp) in ds_conn_reset() argument
881 dp->id, __builtin_return_address(0)); in ds_conn_reset()
884 static int register_services(struct ds_info *dp) in register_services() argument
886 struct ldc_channel *lp = dp->lp; in register_services()
889 for (i = 0; i < dp->num_ds_states; i++) { in register_services()
894 struct ds_cap_state *cp = &dp->ds_states[i]; in register_services()
922 static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt) in ds_handshake() argument
925 if (dp->hs_state == DS_HS_START) { in ds_handshake()
929 dp->hs_state = DS_HS_DONE; in ds_handshake()
931 return register_services(dp); in ds_handshake()
934 if (dp->hs_state != DS_HS_DONE) in ds_handshake()
939 struct ds_cap_state *cp = find_cap(dp, ap->handle); in ds_handshake()
943 "handle %llx\n", dp->id, ap->handle); in ds_handshake()
947 dp->id, cp->service_id); in ds_handshake()
951 struct ds_cap_state *cp = find_cap(dp, np->handle); in ds_handshake()
956 dp->id, np->handle); in ds_handshake()
965 ds_conn_reset(dp); in ds_handshake()
969 static void __send_ds_nack(struct ds_info *dp, u64 handle) in __send_ds_nack() argument
981 __ds_send(dp->lp, &nack, sizeof(nack)); in __send_ds_nack()
989 struct ds_info *dp; member
1007 struct ds_info *dp = qp->dp; in process_ds_work() local
1008 struct ds_cap_state *cp = find_cap(dp, dpkt->handle); in process_ds_work()
1014 dp->id, dpkt->handle); in process_ds_work()
1017 __send_ds_nack(dp, dpkt->handle); in process_ds_work()
1020 cp->data(dp, cp, dpkt, req_len); in process_ds_work()
1047 static int ds_data(struct ds_info *dp, struct ds_msg_tag *pkt, int len) in ds_data() argument
1054 __send_ds_nack(dp, dpkt->handle); in ds_data()
1056 qp->dp = dp; in ds_data()
1064 static void ds_up(struct ds_info *dp) in ds_up() argument
1066 struct ldc_channel *lp = dp->lp; in ds_up()
1077 dp->hs_state = DS_HS_START; in ds_up()
1080 static void ds_reset(struct ds_info *dp) in ds_reset() argument
1084 dp->hs_state = 0; in ds_reset()
1086 for (i = 0; i < dp->num_ds_states; i++) { in ds_reset()
1087 struct ds_cap_state *cp = &dp->ds_states[i]; in ds_reset()
1095 struct ds_info *dp = arg; in ds_event() local
1096 struct ldc_channel *lp = dp->lp; in ds_event()
1103 ds_up(dp); in ds_event()
1109 ds_reset(dp); in ds_event()
1116 dp->id, event); in ds_event()
1125 err = ldc_read(lp, dp->rcv_buf, sizeof(*tag)); in ds_event()
1129 ds_conn_reset(dp); in ds_event()
1135 tag = dp->rcv_buf; in ds_event()
1140 ds_conn_reset(dp); in ds_event()
1147 err = ds_handshake(dp, dp->rcv_buf); in ds_event()
1149 err = ds_data(dp, dp->rcv_buf, in ds_event()
1168 struct ds_info *dp; in ds_probe() local
1175 dp = kzalloc(sizeof(*dp), GFP_KERNEL); in ds_probe()
1177 if (!dp) in ds_probe()
1183 dp->id = *val; in ds_probe()
1186 dp->rcv_buf = kzalloc(4096, GFP_KERNEL); in ds_probe()
1187 if (!dp->rcv_buf) in ds_probe()
1190 dp->rcv_buf_len = 4096; in ds_probe()
1192 dp->ds_states = kmemdup(ds_states_template, in ds_probe()
1194 if (!dp->ds_states) in ds_probe()
1197 dp->num_ds_states = ARRAY_SIZE(ds_states_template); in ds_probe()
1199 for (i = 0; i < dp->num_ds_states; i++) in ds_probe()
1200 dp->ds_states[i].handle = ((u64)i << 32); in ds_probe()
1205 lp = ldc_alloc(vdev->channel_id, &ds_cfg, dp, "DS"); in ds_probe()
1210 dp->lp = lp; in ds_probe()
1217 dp->next = ds_info_list; in ds_probe()
1218 ds_info_list = dp; in ds_probe()
1224 ldc_free(dp->lp); in ds_probe()
1227 kfree(dp->ds_states); in ds_probe()
1230 kfree(dp->rcv_buf); in ds_probe()
1233 kfree(dp); in ds_probe()