3 * \author John Hodge (thePowersGang)
8 #include <udi_internal.h>
11 EXPORT(udi_channel_anchor);
12 EXPORT(udi_channel_spawn);
13 EXPORT(udi_channel_set_context);
14 EXPORT(udi_channel_op_abort);
15 EXPORT(udi_channel_close);
16 EXPORT(udi_channel_event_ind);
17 EXPORT(udi_channel_event_complete);
22 void udi_channel_anchor(
23 udi_channel_anchor_call_t *callback, udi_cb_t *gcb,
24 udi_channel_t channel, udi_index_t ops_idx, void *channel_context
32 extern void udi_channel_spawn(
33 udi_channel_spawn_call_t *callback, udi_cb_t *gcb,
34 udi_channel_t channel, udi_index_t spawn_idx,
35 udi_index_t ops_idx, void *channel_context
38 LOG("gcb=%p,channel=%p", gcb, channel, spawn_idx, ops_idx, channel_context);
40 // Search existing channel for a matching spawn_idx
41 udi_channel_t ret = UDI_CreateChannel_Linked(channel, spawn_idx);
43 // Bind local end of channel to ops_idx (with channel_context)
46 udi_index_t region_idx;
47 tUDI_DriverInstance *inst = UDI_int_ChannelGetInstance(gcb, false, ®ion_idx);
48 UDI_BindChannel(ret, false, inst, ops_idx, region_idx, channel_context, false,0);
61 void udi_channel_set_context(
62 udi_channel_t target_channel, void *channel_context
65 LOG("target_channel=%p,channel_context=%p", target_channel, channel_context);
66 UDI_int_ChannelSetContext(target_channel, channel_context);
69 void udi_channel_op_abort(
70 udi_channel_t target_channel, udi_cb_t *orig_cb
73 udi_channel_event_cb_t cb;
74 cb.gcb.channel = target_channel;
75 cb.event = UDI_CHANNEL_CLOSED;
76 cb.params.orig_cb = orig_cb;
77 udi_channel_event_ind(&cb);
80 void udi_channel_close(udi_channel_t channel)
82 Warning("%s Unimplemented", __func__);
85 void udi_channel_event_ind(udi_channel_event_cb_t *cb)
87 LOG("cb=%p{...}", cb);
89 udi_channel_event_ind_op_t *channel_event_ind_op;
90 } *ops = UDI_int_ChannelPrepForCall( UDI_GCB(cb), NULL, 0 );
92 Log_Warning("UDI", "udi_channel_event_ind on wrong channel type");
96 // UDI_int_MakeDeferredCb( UDI_GCB(cb), ops->channel_event_ind_op );
98 UDI_int_ChannelReleaseFromCall( UDI_GCB(cb) );
99 ops->channel_event_ind_op(cb);
102 void udi_channel_event_complete(udi_channel_event_cb_t *cb, udi_status_t status)