• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/bulk_transfer/

Lines Matching refs:channel

23  * Create a new channel.
25 * @param channel Pointer to unused channel handle
27 * @param callbacks Callbacks for events on this channel
30 errval_t bulk_channel_create(struct bulk_channel *channel,
35 channel->state = BULK_STATE_UNINITIALIZED;
38 * a channel before?
40 channel->ep = local_ep_desc;
41 channel->callbacks = callbacks;
43 channel->direction = setup->direction;
44 channel->role = setup->role;
45 channel->trust = setup->trust;
46 channel->constraints = setup->constraints;
47 channel->meta_size = setup->meta_size;
48 channel->waitset = setup->waitset;
49 channel->user_state = setup->user_state;
50 channel->pools = NULL;
52 return local_ep_desc->f->channel_create(channel);
56 * Bind to an existing unbound channel.
58 * @param channel Pointer to unused channel handle
60 * @param callbacks Callbacks for events on this channel
63 errval_t bulk_channel_bind(struct bulk_channel *channel,
69 if (channel->state != BULK_STATE_UNINITIALIZED) {
73 channel->state = BULK_STATE_UNINITIALIZED;
74 channel->ep = remote_ep_desc;
75 channel->callbacks = callbacks;
77 channel->role = params->role;
78 channel->trust = params->trust;
79 channel->constraints = params->constraints;
80 channel->waitset = params->waitset;
81 channel->user_state = params->user_state;
82 channel->pools = NULL;
84 return remote_ep_desc->f->channel_bind(channel, cont);
88 * Free a channel
90 * @param channel Channel to be freed
93 errval_t bulk_channel_destroy(struct bulk_channel *channel,
97 switch (channel->state) {
125 * Assign a pool to a channel.
127 * @param channel Channel
128 * @param pool Pool to assign (must not be assigned to this channel yet)
130 errval_t bulk_channel_assign_pool(struct bulk_channel *channel,
134 assert(channel);
137 if (channel->state != BULK_STATE_CONNECTED || !(channel->ep)) {
142 /* this pool has never been assigned to a channel */
143 pool->trust = channel->trust;
146 /* a channel must not span trusted and non trusted channels */
147 if (channel->trust != pool->trust) {
151 if (bulk_pool_is_assigned(pool, channel)) {
152 debug_printf("bulk_channel_assign_pool: pool already assigned to channel\n");
166 return channel->ep->f->assign_pool(channel, pool, cont);
170 * Remove a pool from a channel
172 * @param channel Channel
173 * @param pool Pool to remove (must be previously assigned to the channel)
176 errval_t bulk_channel_remove_pool(struct bulk_channel *channel,
180 assert(!"NYI: removing a pool from a channel");
182 assert(channel);
185 if (channel->state != BULK_STATE_CONNECTED) {
189 if (!bulk_pool_is_assigned(pool, channel)) {
191 * XXX: if there is no such pool on this channel simply return
199 struct bulk_pool_list *list = channel->pools;
209 channel->pools = list->next;
221 return channel->ep->f->remove_pool(channel, pool, cont);
224 errval_t bulk_channel_move(struct bulk_channel *channel,
229 assert(channel);
234 if (channel->state != BULK_STATE_CONNECTED) {
238 if (channel->direction != BULK_DIRECTION_TX) {
242 if (!bulk_pool_is_assigned(buffer->pool, channel)) {
258 return channel->ep->f->move(channel, buffer, meta, cont);
264 errval_t bulk_channel_pass(struct bulk_channel *channel,
269 assert(channel);
274 if (channel->state != BULK_STATE_CONNECTED) {
278 if (!bulk_pool_is_assigned(buffer->pool, channel)) {
294 return channel->ep->f->pass(channel, buffer, meta, cont);
300 errval_t bulk_channel_copy(struct bulk_channel *channel,
305 assert(channel);
310 if (channel->state != BULK_STATE_CONNECTED) {
314 if (channel->direction != BULK_DIRECTION_TX) {
318 if (!bulk_pool_is_assigned(buffer->pool, channel)) {
338 return channel->ep->f->copy(channel, buffer, meta, cont);
344 errval_t bulk_channel_release(struct bulk_channel *channel,
348 assert(channel);
353 if (channel->state != BULK_STATE_CONNECTED) {
370 return channel->ep->f->release(channel, buffer, cont);