summaryrefslogtreecommitdiffstats
path: root/src/kiro-sb.c
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2015-06-16 17:25:08 +0200
committerTimo Dritschler <timo.dritschler@kit.edu>2015-06-16 17:25:08 +0200
commitfa417b373e93903c8c41cdfd800a0311bc495e15 (patch)
treee262fea43ded5eaf69b2cf98e4ccee9c05173cd4 /src/kiro-sb.c
parent9ea244a2a7a52495bf033dd9f1cca7c865baf200 (diff)
downloadkiro-fa417b373e93903c8c41cdfd800a0311bc495e15.tar.gz
kiro-fa417b373e93903c8c41cdfd800a0311bc495e15.tar.bz2
kiro-fa417b373e93903c8c41cdfd800a0311bc495e15.tar.xz
kiro-fa417b373e93903c8c41cdfd800a0311bc495e15.zip
Pushed to version 1.3.0HEADmaster
Highlights: - KiroSb: Added kiro_sb_get_dma_pointer interface
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)