aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib/pkt_ctrl.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-17 17:12:01 -0800
committerJosh Blum <josh@joshknows.com>2010-12-11 18:43:09 -0800
commit68af2b9ccf556f42d7697c73406abdcc31093d1b (patch)
tree4045a45d702f678446f1d89db3082b548a8f4c8e /firmware/microblaze/lib/pkt_ctrl.c
parent58d19c5adf7bde9298ad4363c275f72e4bbecd73 (diff)
downloaduhd-68af2b9ccf556f42d7697c73406abdcc31093d1b.tar.gz
uhd-68af2b9ccf556f42d7697c73406abdcc31093d1b.tar.bz2
uhd-68af2b9ccf556f42d7697c73406abdcc31093d1b.zip
usrp2: implement routing mode calls, and prefix pkt ctrl calls
Diffstat (limited to 'firmware/microblaze/lib/pkt_ctrl.c')
-rw-r--r--firmware/microblaze/lib/pkt_ctrl.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/firmware/microblaze/lib/pkt_ctrl.c b/firmware/microblaze/lib/pkt_ctrl.c
index 235a09459..f7f808cfc 100644
--- a/firmware/microblaze/lib/pkt_ctrl.c
+++ b/firmware/microblaze/lib/pkt_ctrl.c
@@ -30,24 +30,35 @@ static void set_control(uint32_t value, uint32_t mask){
buffer_pool_ctrl->ctrl = ctrl_shadow;
}
-void *claim_incoming_buffer(size_t *num_lines){
+void pkt_ctrl_set_routing_mode(pkt_ctrl_routing_mode_t mode){
+ switch(mode){
+ case PKT_CTRL_ROUTING_MODE_SLAVE:
+ set_control(0x0, 0x4);
+ break;
+ case PKT_CTRL_ROUTING_MODE_MASTER:
+ set_control(0x4, 0x4);
+ break;
+ }
+}
+
+void *pkt_ctrl_claim_incoming_buffer(size_t *num_lines){
if ((buffer_pool_status->status & 0x1) != 1) return NULL;
*num_lines = (buffer_pool_status->status >> 16) & 0xffff;
set_control(0x1, 0x1);
return buffer_ram(0);
}
-void release_incoming_buffer(void){
+void pkt_ctrl_release_incoming_buffer(void){
set_control(0x0, 0x1);
while ((buffer_pool_status->status & 0x1) != 0){}
}
-void *claim_outgoing_buffer(void){
+void *pkt_ctrl_claim_outgoing_buffer(void){
while ((buffer_pool_status->status & 0x2) != 0x2){}
return buffer_ram(1);
}
-void commit_outgoing_buffer(size_t num_lines){
+void pkt_ctrl_commit_outgoing_buffer(size_t num_lines){
set_control(0x2 | (num_lines << 16), 0x2 | (0xffff << 16));
while ((buffer_pool_status->status & 0x2) != 0x0){}
set_control(0x0, 0x2);