commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8655 - in usrp2/branches/features/host-ng/firmware: a


From: eb
Subject: [Commit-gnuradio] r8655 - in usrp2/branches/features/host-ng/firmware: apps include lib
Date: Sun, 22 Jun 2008 18:04:45 -0600 (MDT)

Author: eb
Date: 2008-06-22 18:04:44 -0600 (Sun, 22 Jun 2008)
New Revision: 8655

Added:
   usrp2/branches/features/host-ng/firmware/lib/usrp2_bytesex.h
Removed:
   usrp2/branches/features/host-ng/firmware/include/usrp2_bytesex.h
Modified:
   usrp2/branches/features/host-ng/firmware/apps/app_common_v2.h
   usrp2/branches/features/host-ng/firmware/apps/gen_eth_packets.c
   usrp2/branches/features/host-ng/firmware/apps/rcv_eth_packets.c
   usrp2/branches/features/host-ng/firmware/apps/rx_only_v2.c
   usrp2/branches/features/host-ng/firmware/apps/test_serdes.c
   usrp2/branches/features/host-ng/firmware/apps/tx_only_v2.c
   usrp2/branches/features/host-ng/firmware/apps/tx_standalone.c
   usrp2/branches/features/host-ng/firmware/apps/txrx.c
   usrp2/branches/features/host-ng/firmware/include/usrp2_eth_packet.h
   usrp2/branches/features/host-ng/firmware/lib/Makefile.am
Log:
removed include of usrp2_bytesex.h from usrp2_eth_packet.h

Modified: usrp2/branches/features/host-ng/firmware/apps/app_common_v2.h
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/app_common_v2.h       
2008-06-22 22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/app_common_v2.h       
2008-06-23 00:04:44 UTC (rev 8655)
@@ -20,6 +20,7 @@
 #define INCLUDED_APP_COMMON_H
 
 #include "bool.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "dbsm.h"
 #include "memory_map.h"

Modified: usrp2/branches/features/host-ng/firmware/apps/gen_eth_packets.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/gen_eth_packets.c     
2008-06-22 22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/gen_eth_packets.c     
2008-06-23 00:04:44 UTC (rev 8655)
@@ -27,6 +27,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "memcpy_wa.h"
 #include "print_rmon_regs.h"

Modified: usrp2/branches/features/host-ng/firmware/apps/rcv_eth_packets.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/rcv_eth_packets.c     
2008-06-22 22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/rcv_eth_packets.c     
2008-06-23 00:04:44 UTC (rev 8655)
@@ -27,6 +27,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "memcpy_wa.h"
 #include <stddef.h>

Modified: usrp2/branches/features/host-ng/firmware/apps/rx_only_v2.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/rx_only_v2.c  2008-06-22 
22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/rx_only_v2.c  2008-06-23 
00:04:44 UTC (rev 8655)
@@ -28,6 +28,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "memcpy_wa.h"
 #include "dbsm.h"

Modified: usrp2/branches/features/host-ng/firmware/apps/test_serdes.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/test_serdes.c 2008-06-22 
22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/test_serdes.c 2008-06-23 
00:04:44 UTC (rev 8655)
@@ -24,6 +24,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "memcpy_wa.h"
 #include <stddef.h>

Modified: usrp2/branches/features/host-ng/firmware/apps/tx_only_v2.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/tx_only_v2.c  2008-06-22 
22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/tx_only_v2.c  2008-06-23 
00:04:44 UTC (rev 8655)
@@ -28,6 +28,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "dbsm.h"
 #include "app_common_v2.h"

Modified: usrp2/branches/features/host-ng/firmware/apps/tx_standalone.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/tx_standalone.c       
2008-06-22 22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/tx_standalone.c       
2008-06-23 00:04:44 UTC (rev 8655)
@@ -28,6 +28,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "memcpy_wa.h"
 #include "dbsm.h"

Modified: usrp2/branches/features/host-ng/firmware/apps/txrx.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/txrx.c        2008-06-22 
22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/apps/txrx.c        2008-06-23 
00:04:44 UTC (rev 8655)
@@ -28,6 +28,7 @@
 #include "bool.h"
 #include "ethernet.h"
 #include "nonstdio.h"
+#include "usrp2_bytesex.h"
 #include "usrp2_eth_packet.h"
 #include "dbsm.h"
 #include "app_common_v2.h"

Deleted: usrp2/branches/features/host-ng/firmware/include/usrp2_bytesex.h

Modified: usrp2/branches/features/host-ng/firmware/include/usrp2_eth_packet.h
===================================================================
--- usrp2/branches/features/host-ng/firmware/include/usrp2_eth_packet.h 
2008-06-22 22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/include/usrp2_eth_packet.h 
2008-06-23 00:04:44 UTC (rev 8655)
@@ -20,7 +20,6 @@
 #define INCLUDED_USRP2_ETH_PACKET_H
 
 #include "usrp2_cdefs.h"
-#include "usrp2_bytesex.h"
 #include "usrp2_mac_addr.h"
 
 __U2_BEGIN_DECLS

Modified: usrp2/branches/features/host-ng/firmware/lib/Makefile.am
===================================================================
--- usrp2/branches/features/host-ng/firmware/lib/Makefile.am    2008-06-22 
22:56:48 UTC (rev 8654)
+++ usrp2/branches/features/host-ng/firmware/lib/Makefile.am    2008-06-23 
00:04:44 UTC (rev 8655)
@@ -48,3 +48,35 @@
        printf.c \
        spi.c \
        u2_init.c       
+
+noinst_HEADERS = \
+       ad9510.h \
+       ad9777.h \
+       ad9777_regs.h \
+       bool.h \
+       buffer_pool.h \
+       db.h \
+       db_base.h \
+       dbsm.h \
+       eth_mac.h \
+       eth_mac_regs.h \
+       eth_phy.h \
+       ethernet.h \
+       hal_io.h \
+       hal_uart.h \
+       i2c.h \
+       lsadc.h \
+       lsdac.h \
+       mdelay.h \
+       memcpy_wa.h \
+       memory_map.h \
+       memset_wa.h \
+       nonstdio.h \
+       pic.h \
+       print_rmon_regs.h \
+       spi.h \
+       stdint.h \
+       stdio.h \
+       u2_init.h \
+       usrp2_bytesex.h \
+       wb16550.h

Copied: usrp2/branches/features/host-ng/firmware/lib/usrp2_bytesex.h (from rev 
8654, usrp2/branches/features/host-ng/firmware/include/usrp2_bytesex.h)
===================================================================
--- usrp2/branches/features/host-ng/firmware/lib/usrp2_bytesex.h                
                (rev 0)
+++ usrp2/branches/features/host-ng/firmware/lib/usrp2_bytesex.h        
2008-06-23 00:04:44 UTC (rev 8655)
@@ -0,0 +1,66 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef INCLUDED_USRP2_BYTESEX_H
+#define INCLUDED_USRP2_BYTESEX_H
+
+// The USRP2 speaks big-endian...
+// Use the standard include files or provide substitutions for
+// htons and friends
+
+#if defined(HAVE_ARPA_INET_H)
+#include <arpa/inet.h>
+#elif defined(HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#else
+#include <stdint.h>
+
+#ifdef WORDS_BIGENDIAN  // nothing to do...
+
+static inline uint32_t htonl(uint32_t x){ return x; }
+static inline uint16_t htons(uint16_t x){ return x; }
+static inline uint32_t ntohl(uint32_t x){ return x; }
+static inline uint16_t ntohs(uint16_t x){ return x; }
+
+#else
+
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#else
+
+static inline uint16_t
+bswap_16 (uint16_t x)
+{
+  return ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8));
+}
+
+static inline uint32_t
+bswap_32 (uint32_t x)
+{
+  return ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) \
+        | (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24));
+}
+#endif
+
+static inline uint32_t htonl(uint32_t x){ return bswap_32(x); }
+static inline uint16_t htons(uint16_t x){ return bswap_16(x); }
+static inline uint32_t ntohl(uint32_t x){ return bswap_32(x); }
+static inline uint16_t ntohs(uint16_t x){ return bswap_16(x); }
+
+#endif
+#endif
+#endif /* INCLUDED_USRP2_BYTESEX_H */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]