[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/148: working a separate ctrl ethernet de
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/148: working a separate ctrl ethernet device into the code |
Date: |
Mon, 15 Aug 2016 00:47:19 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.
commit 418202768e471fae7d77a982fbadcd70831e3fa6
Author: Josh Blum <address@hidden>
Date: Thu Oct 29 19:08:34 2009 -0700
working a separate ctrl ethernet device into the code
---
usrp2/firmware/apps/app_common_v2.c | 13 +++++++------
usrp2/host/lib/usrp2_impl.cc | 10 +++++-----
usrp2/host/lib/usrp2_impl.h | 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/usrp2/firmware/apps/app_common_v2.c
b/usrp2/firmware/apps/app_common_v2.c
index 67cccd5..dbb391e 100644
--- a/usrp2/firmware/apps/app_common_v2.c
+++ b/usrp2/firmware/apps/app_common_v2.c
@@ -71,7 +71,7 @@ set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t
const *cmd_pkt)
{
reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
reply_pkt->ehdr.src = *ethernet_mac_addr();
- reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
+ reply_pkt->ehdr.ethertype = U2_ETHERTYPE+1;
reply_pkt->thdr.flags = 0;
reply_pkt->thdr.fifo_status = 0; // written by protocol engine
reply_pkt->thdr.seqno = 0; // written by protocol engine
@@ -600,7 +600,7 @@ bool
eth_pkt_inspector(dbsm_t *sm, int bufno)
{
u2_eth_packet_t *pkt = (u2_eth_packet_t *) buffer_ram(bufno);
- size_t byte_len = (buffer_pool_status->last_line[bufno] - 1) * 4;
+ size_t byte_len = (buffer_pool_status->last_line[bufno] - 3) * 4;
//static size_t last_len = 0;
@@ -608,16 +608,17 @@ eth_pkt_inspector(dbsm_t *sm, int bufno)
// inspect rcvd frame and figure out what do do.
+ if (pkt->ehdr.ethertype == U2_ETHERTYPE+1){
+ handle_control_chan_frame(pkt, byte_len);
+ return true;
+ }
+
if (pkt->ehdr.ethertype != U2_ETHERTYPE)
return true; // ignore, probably bogus PAUSE frame from MAC
int chan = u2p_chan(&pkt->fixed);
switch (chan){
- case CONTROL_CHAN:
- handle_control_chan_frame(pkt, byte_len);
- return true; // we handled the packet
- break;
case 0:
default:
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index e2988e0..3c199fd 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -154,7 +154,7 @@ namespace usrp2 {
if (!d_eth_data->open(ifc, htons(U2_ETHERTYPE)))
throw std::runtime_error("Unable to open/register USRP2 data protocol");
if (!d_eth_ctrl->open(ifc, htons(U2_ETHERTYPE+1)))
- throw std::runtime_error("Unable to open/register USRP2 data protocol");
+ throw std::runtime_error("Unable to open/register USRP2 control
protocol");
d_addr = p->addr;
@@ -274,9 +274,9 @@ namespace usrp2 {
}
void
- usrp2::impl::init_et_hdrs(u2_eth_packet_t *p, const std::string &dst)
+ usrp2::impl::init_et_hdrs(u2_eth_packet_t *p, const std::string &dst,
unsigned short ethertype)
{
- p->ehdr.ethertype = htons(U2_ETHERTYPE);
+ p->ehdr.ethertype = htons(ethertype);
parse_mac_addr(dst, &p->ehdr.dst);
memcpy(&p->ehdr.src, d_eth_data->mac(), 6);
p->thdr.flags = 0; // FIXME transport header values?
@@ -288,7 +288,7 @@ namespace usrp2 {
usrp2::impl::init_etf_hdrs(u2_eth_packet_t *p, const std::string &dst,
int word0_flags, int chan, uint32_t timestamp)
{
- init_et_hdrs(p, dst);
+ init_et_hdrs(p, dst, (chan == CONTROL_CHAN) ? U2_ETHERTYPE+1 :
U2_ETHERTYPE);
u2p_set_word0(&p->fixed, word0_flags, chan);
u2p_set_timestamp(&p->fixed, timestamp);
@@ -337,7 +337,7 @@ namespace usrp2 {
len = sizeof(tmp);
}
- return d_eth_data->tx_frame(cmd, len) == eth_buffer::EB_OK;
+ return d_eth_ctrl->write_packet(cmd, len) >= 0;
}
bool
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index 16cc685..040e17e 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -105,7 +105,7 @@ namespace usrp2 {
}
static bool parse_mac_addr(const std::string &s, u2_mac_addr_t *p);
- void init_et_hdrs(u2_eth_packet_t *p, const std::string &dst);
+ void init_et_hdrs(u2_eth_packet_t *p, const std::string &dst, unsigned
short ethertype);
void init_etf_hdrs(u2_eth_packet_t *p, const std::string &dst,
int word0_flags, int chan, uint32_t timestamp);
void stop_bg();
- [Commit-gnuradio] [gnuradio] annotated tag old_usrp_devel_udp created (now 90cd6f5), git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 01/148: Create separate raw Ethernet sockets and packet filters, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 03/148: Created a new thread for handling incoming control packets. TX/RX app is working with separate data and control ethernet types., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 10/148: Fix incorrect comparison, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 13/148: usrp2: remove install data hook for usrp2_socket_opener, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 04/148: Hosekeeping after control/data separation., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 05/148: Removed references to U2_ETHERTYPE and CONTROL_CHAN. Moved non-txrx-related apps in firmware broken by this., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 06/148: Common naming convention for control and data thread stuff., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 02/148: working a separate ctrl ethernet device into the code,
git <=
- [Commit-gnuradio] [gnuradio] 07/148: using boost threads for control and data, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 09/148: Refactored timeout handling, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 17/148: Began work on eth data transport class. Switched send in transport to use iovecs. Pass mac addr into eth transports rather than re-parsing., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 14/148: Created transport abstraction. Implemented ethernet transport for control. Control transport works in usrp impl. Needs a lot of cleanup., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 08/148: Removed omnithreads dependency from libusrp2, still debugging, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 18/148: Added a callback into the channel ring enqueue and dequeue. This will allow the deqeue caller to make an arbitrary call when its done with the data. Currently, the enqueue caller makes this callback a release_frames., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 15/148: virtual destructor and shared ptr for transport, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 28/148: Cleaned up the parse ethernet stuff. Made an official max_buffs method for the transport., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 20/148: Created sbuff class to house chunks of memory, their length, and possible callback for freeing/cleanup. Switched ring and transport to make use of the sbuff on receive., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 37/148: Fixes usrp2 firmware configure with mb-gcc on ubuntu 9.10/autoconf 2.64. Disables the regression test for fopen since stdio is non-functional., git, 2016/08/14