summaryrefslogtreecommitdiffstats
path: root/src/kiro-sb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kiro-sb.c')
-rw-r--r--src/kiro-sb.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/kiro-sb.c b/src/kiro-sb.c
index 6ec671c..3d6173f 100644
--- a/src/kiro-sb.c
+++ b/src/kiro-sb.c
@@ -274,15 +274,10 @@ kiro_sb_get_data (KiroSb *self)
KiroSbPrivate *priv = KIRO_SB_GET_PRIVATE (self);
struct KiroTrbInfo *header = kiro_trb_get_raw_buffer (priv->trb);
- switch (header->offset) {
- case 0:
- return kiro_trb_get_element (priv->trb, 0);
- break;
- case 1:
- return kiro_trb_get_element (priv->trb, 1);
- break;
- default:
- return kiro_trb_get_element (priv->trb, -1);
+ if (header->offset > 0) {
+ return kiro_trb_get_element (priv->trb, 1);
+ } else {
+ return kiro_trb_get_element (priv->trb, 0);
}
}
@@ -310,6 +305,17 @@ kiro_sb_push_dma (KiroSb *self)
return kiro_trb_dma_push (priv->trb);
}
+void *
+kiro_sb_get_dma_pointer (KiroSb *self)
+{
+ g_return_val_if_fail (self != NULL, NULL);
+
+ KiroSbPrivate *priv = KIRO_SB_GET_PRIVATE (self);
+ g_return_val_if_fail (priv->initialized == 1, NULL);
+
+ return kiro_trb_get_element (priv->trb, -1);
+}
+
gboolean
kiro_sb_clone (KiroSb *self, const gchar* address, const gchar* port)