+ udi_cb_t *gcb = UDI_GCB(cb);
+ rdata_t *rdata = gcb->context;
+
+ DEBUG_OUT("flags=%x, intr_result=%x", flags, cb->intr_result);
+ if( cb->intr_result == 0 )
+ {
+ // An IRQ from something other than RX
+ udi_intr_event_rdy(cb);
+ return ;
+ }
+
+ if( rdata->rx_buffer && rdata->rx_buffer->buf_size + cb->intr_result > MAX_RX_BUFFER_SIZE )
+ {
+ // Drop, buffer is full
+ DEBUG_OUT("dropping %i bytes, full rx buffer", cb->intr_result);
+ udi_intr_event_rdy(cb);
+ return ;
+ }
+
+ // Copy cb->intr_result bytes into the RX buffer
+ CONTIN(uart_bus_irq_intr_event_ind, udi_buf_copy,
+ (cb->event_buf, 0, cb->intr_result,
+ rdata->rx_buffer, rdata->rx_buffer->buf_size, 0,
+ UDI_NULL_BUF_PATH),
+ (udi_buf_t *new_buf));
+
+ udi_intr_event_cb_t *cb = UDI_MCB(gcb, udi_intr_event_cb_t);
+
+ rdata->rx_buffer = new_buf;
+
+ DEBUG_OUT("copied %i bytes", cb->intr_result);
+
+ // Emit a signal to GIO client
+ if( rdata->event_cb && !rdata->event_cb_used )
+ {
+ rdata->event_pending = FALSE;
+ rdata->event_cb_used = TRUE;
+ udi_gio_event_ind(rdata->event_cb);
+ }
+ else