Lines Matching refs:rb

23 	struct ishtp_cl_rb *rb;  in ishtp_cl_alloc_rx_ring()  local
28 rb = ishtp_io_rb_init(cl); in ishtp_cl_alloc_rx_ring()
29 if (!rb) { in ishtp_cl_alloc_rx_ring()
33 ret = ishtp_io_rb_alloc_buf(rb, len); in ishtp_cl_alloc_rx_ring()
37 list_add_tail(&rb->list, &cl->free_rb_list.list); in ishtp_cl_alloc_rx_ring()
99 struct ishtp_cl_rb *rb; in ishtp_cl_free_rx_ring() local
105 rb = list_entry(cl->free_rb_list.list.next, struct ishtp_cl_rb, in ishtp_cl_free_rx_ring()
107 list_del(&rb->list); in ishtp_cl_free_rx_ring()
108 kfree(rb->buffer.data); in ishtp_cl_free_rx_ring()
109 kfree(rb); in ishtp_cl_free_rx_ring()
115 rb = list_entry(cl->in_process_list.list.next, in ishtp_cl_free_rx_ring()
117 list_del(&rb->list); in ishtp_cl_free_rx_ring()
118 kfree(rb->buffer.data); in ishtp_cl_free_rx_ring()
119 kfree(rb); in ishtp_cl_free_rx_ring()
165 void ishtp_io_rb_free(struct ishtp_cl_rb *rb) in ishtp_io_rb_free() argument
167 if (rb == NULL) in ishtp_io_rb_free()
170 kfree(rb->buffer.data); in ishtp_io_rb_free()
171 kfree(rb); in ishtp_io_rb_free()
184 struct ishtp_cl_rb *rb; in ishtp_io_rb_init() local
186 rb = kzalloc(sizeof(struct ishtp_cl_rb), GFP_KERNEL); in ishtp_io_rb_init()
187 if (!rb) in ishtp_io_rb_init()
190 INIT_LIST_HEAD(&rb->list); in ishtp_io_rb_init()
191 rb->cl = cl; in ishtp_io_rb_init()
192 rb->buf_idx = 0; in ishtp_io_rb_init()
193 return rb; in ishtp_io_rb_init()
205 int ishtp_io_rb_alloc_buf(struct ishtp_cl_rb *rb, size_t length) in ishtp_io_rb_alloc_buf() argument
207 if (!rb) in ishtp_io_rb_alloc_buf()
213 rb->buffer.data = kmalloc(length, GFP_KERNEL); in ishtp_io_rb_alloc_buf()
214 if (!rb->buffer.data) in ishtp_io_rb_alloc_buf()
217 rb->buffer.size = length; in ishtp_io_rb_alloc_buf()
229 int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb) in ishtp_cl_io_rb_recycle() argument
235 if (!rb || !rb->cl) in ishtp_cl_io_rb_recycle()
238 cl = rb->cl; in ishtp_cl_io_rb_recycle()
240 list_add_tail(&rb->list, &cl->free_rb_list.list); in ishtp_cl_io_rb_recycle()
286 struct ishtp_cl_rb *rb; in ishtp_cl_rx_get_rb() local
289 rb = list_first_entry_or_null(&cl->in_process_list.list, in ishtp_cl_rx_get_rb()
291 if (rb) in ishtp_cl_rx_get_rb()
292 list_del_init(&rb->list); in ishtp_cl_rx_get_rb()
295 return rb; in ishtp_cl_rx_get_rb()