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 __cpuinit dr_cpu_configure(struct ds_info *dp, 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 __cpuinit dr_cpu_data(struct ds_info *dp, in dr_cpu_data() argument
649 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
665 err = dr_cpu_configure(dp, cp, req_num, &mask); in dr_cpu_data()
667 err = dr_cpu_unconfigure(dp, cp, req_num, &mask); in dr_cpu_data()
670 dr_cpu_send_error(dp, cp, data); in dr_cpu_data()
682 static void ds_pri_data(struct ds_info *dp, in ds_pri_data() argument
692 dp->id, rp->req_num, rp->type, len); in ds_pri_data()
727 static void ds_var_data(struct ds_info *dp, in ds_var_data() argument
748 struct ds_info *dp; in ldom_set_var() local
753 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
756 tmp = find_cap_by_string(dp, "var-config"); in ldom_set_var()
763 for (dp = ds_info_list; dp; dp = dp->next) { in ldom_set_var()
766 tmp = find_cap_by_string(dp, "var-config-backup"); in ldom_set_var()
808 __ds_send(dp->lp, &pkt, msg_len); in ldom_set_var()
825 dp->id, var, value, in ldom_set_var()
869 static void ds_conn_reset(struct ds_info *dp) in ds_conn_reset() argument
872 dp->id, __builtin_return_address(0)); in ds_conn_reset()
875 static int register_services(struct ds_info *dp) in register_services() argument
877 struct ldc_channel *lp = dp->lp; in register_services()
880 for (i = 0; i < dp->num_ds_states; i++) { in register_services()
885 struct ds_cap_state *cp = &dp->ds_states[i]; in register_services()
913 static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt) in ds_handshake() argument
916 if (dp->hs_state == DS_HS_START) { in ds_handshake()
920 dp->hs_state = DS_HS_DONE; in ds_handshake()
922 return register_services(dp); in ds_handshake()
925 if (dp->hs_state != DS_HS_DONE) in ds_handshake()
930 struct ds_cap_state *cp = find_cap(dp, ap->handle); in ds_handshake()
934 "handle %llx\n", dp->id, ap->handle); in ds_handshake()
938 dp->id, cp->service_id); in ds_handshake()
942 struct ds_cap_state *cp = find_cap(dp, np->handle); in ds_handshake()
947 dp->id, np->handle); in ds_handshake()
956 ds_conn_reset(dp); in ds_handshake()
960 static void __send_ds_nack(struct ds_info *dp, u64 handle) in __send_ds_nack() argument
972 __ds_send(dp->lp, &nack, sizeof(nack)); in __send_ds_nack()
980 struct ds_info *dp; member
998 struct ds_info *dp = qp->dp; in process_ds_work() local
999 struct ds_cap_state *cp = find_cap(dp, dpkt->handle); in process_ds_work()
1005 dp->id, dpkt->handle); in process_ds_work()
1008 __send_ds_nack(dp, dpkt->handle); in process_ds_work()
1011 cp->data(dp, cp, dpkt, req_len); in process_ds_work()
1038 static int ds_data(struct ds_info *dp, struct ds_msg_tag *pkt, int len) in ds_data() argument
1045 __send_ds_nack(dp, dpkt->handle); in ds_data()
1047 qp->dp = dp; in ds_data()
1055 static void ds_up(struct ds_info *dp) in ds_up() argument
1057 struct ldc_channel *lp = dp->lp; in ds_up()
1068 dp->hs_state = DS_HS_START; in ds_up()
1071 static void ds_reset(struct ds_info *dp) in ds_reset() argument
1075 dp->hs_state = 0; in ds_reset()
1077 for (i = 0; i < dp->num_ds_states; i++) { in ds_reset()
1078 struct ds_cap_state *cp = &dp->ds_states[i]; in ds_reset()
1086 struct ds_info *dp = arg; in ds_event() local
1087 struct ldc_channel *lp = dp->lp; in ds_event()
1094 ds_up(dp); in ds_event()
1100 ds_reset(dp); in ds_event()
1107 dp->id, event); in ds_event()
1116 err = ldc_read(lp, dp->rcv_buf, sizeof(*tag)); in ds_event()
1120 ds_conn_reset(dp); in ds_event()
1126 tag = dp->rcv_buf; in ds_event()
1131 ds_conn_reset(dp); in ds_event()
1138 err = ds_handshake(dp, dp->rcv_buf); in ds_event()
1140 err = ds_data(dp, dp->rcv_buf, in ds_event()
1160 struct ds_info *dp; in ds_probe() local
1167 dp = kzalloc(sizeof(*dp), GFP_KERNEL); in ds_probe()
1169 if (!dp) in ds_probe()
1175 dp->id = *val; in ds_probe()
1178 dp->rcv_buf = kzalloc(4096, GFP_KERNEL); in ds_probe()
1179 if (!dp->rcv_buf) in ds_probe()
1182 dp->rcv_buf_len = 4096; in ds_probe()
1184 dp->ds_states = kmemdup(ds_states_template, in ds_probe()
1186 if (!dp->ds_states) in ds_probe()
1189 dp->num_ds_states = ARRAY_SIZE(ds_states_template); in ds_probe()
1191 for (i = 0; i < dp->num_ds_states; i++) in ds_probe()
1192 dp->ds_states[i].handle = ((u64)i << 32); in ds_probe()
1197 lp = ldc_alloc(vdev->channel_id, &ds_cfg, dp); in ds_probe()
1202 dp->lp = lp; in ds_probe()
1209 dp->next = ds_info_list; in ds_probe()
1210 ds_info_list = dp; in ds_probe()
1216 ldc_free(dp->lp); in ds_probe()
1219 kfree(dp->ds_states); in ds_probe()
1222 kfree(dp->rcv_buf); in ds_probe()
1225 kfree(dp); in ds_probe()