summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-09 19:23:17 -0800
committerJosh Blum <josh@joshknows.com>2010-11-09 19:23:17 -0800
commitb43a1a9d5e01566457d9c9ee478d13e899a46e77 (patch)
treef41d1b4ae8d1fac78b1a59c507ce714d46b86464 /host/lib/usrp
parent5f2c71383a2b5dd0f2f469f6ad8c4720358f2a12 (diff)
downloaduhd-b43a1a9d5e01566457d9c9ee478d13e899a46e77.tar.gz
uhd-b43a1a9d5e01566457d9c9ee478d13e899a46e77.tar.bz2
uhd-b43a1a9d5e01566457d9c9ee478d13e899a46e77.zip
usrp-e100: moved kernel header to lib dir, remove the header check, default enable to false
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/usrp_e100/CMakeLists.txt10
-rw-r--r--host/lib/usrp/usrp_e100/include/linux/usrp_e.h91
-rw-r--r--host/lib/usrp/usrp_e100/usrp_e100_impl.cpp2
3 files changed, 95 insertions, 8 deletions
diff --git a/host/lib/usrp/usrp_e100/CMakeLists.txt b/host/lib/usrp/usrp_e100/CMakeLists.txt
index 97a3d5d9a..66c87e0d8 100644
--- a/host/lib/usrp/usrp_e100/CMakeLists.txt
+++ b/host/lib/usrp/usrp_e100/CMakeLists.txt
@@ -22,24 +22,20 @@
########################################################################
MESSAGE(STATUS "Configuring USRP-E100 support...")
-INCLUDE(CheckIncludeFileCXX)
-CHECK_INCLUDE_FILE_CXX(linux/usrp_e.h HAVE_LINUX_USRP_E_H)
-
-SET(ENABLE_USRP_E TRUE)
-
IF(DEFINED ENABLE_USRP_E100)
IF(ENABLE_USRP_E100)
MESSAGE(STATUS "USRP-E100 support enabled by configure flag")
ELSE(ENABLE_USRP_E100)
MESSAGE(STATUS "USRP-E100 support disabled by configure flag")
ENDIF(ENABLE_USRP_E100)
-ELSE(DEFINED ENABLE_USRP_E100) #not defined: automatic enabling of component
- SET(ENABLE_USRP_E100 ${HAVE_LINUX_USRP_E_H})
+ELSE(DEFINED ENABLE_USRP_E100) #not defined: automatic disabling of component
+ SET(ENABLE_USRP_E100 FALSE)
ENDIF(DEFINED ENABLE_USRP_E100)
SET(ENABLE_USRP_E100 ${ENABLE_USRP_E100} CACHE BOOL "enable USRP-E100 support")
IF(ENABLE_USRP_E100)
MESSAGE(STATUS " Building USRP-E100 support.")
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e100/include)
LIBUHD_APPEND_SOURCES(
${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e100/clock_ctrl.cpp
${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e100/clock_ctrl.hpp
diff --git a/host/lib/usrp/usrp_e100/include/linux/usrp_e.h b/host/lib/usrp/usrp_e100/include/linux/usrp_e.h
new file mode 100644
index 000000000..4c6a5dd89
--- /dev/null
+++ b/host/lib/usrp/usrp_e100/include/linux/usrp_e.h
@@ -0,0 +1,91 @@
+
+/*
+ * Copyright (C) 2010 Ettus Research, LLC
+ *
+ * Written by Philip Balister <philip@opensdr.com>
+ *
+ * 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 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __USRP_E_H
+#define __USRP_E_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+struct usrp_e_ctl16 {
+ __u32 offset;
+ __u32 count;
+ __u16 buf[20];
+};
+
+struct usrp_e_ctl32 {
+ __u32 offset;
+ __u32 count;
+ __u32 buf[10];
+};
+
+/* SPI interface */
+
+#define UE_SPI_TXONLY 0
+#define UE_SPI_TXRX 1
+
+/* Defines for spi ctrl register */
+#define UE_SPI_CTRL_TXNEG (1<<10)
+#define UE_SPI_CTRL_RXNEG (1<<9)
+
+#define UE_SPI_PUSH_RISE 0
+#define UE_SPI_PUSH_FALL UE_SPI_CTRL_TXNEG
+#define UE_SPI_LATCH_RISE 0
+#define UE_SPI_LATCH_FALL UE_SPI_CTRL_RXNEG
+
+struct usrp_e_spi {
+ __u8 readback;
+ __u32 slave;
+ __u32 data;
+ __u32 length;
+ __u32 flags;
+};
+
+struct usrp_e_i2c {
+ __u8 addr;
+ __u32 len;
+ __u8 data[];
+};
+
+#define USRP_E_IOC_MAGIC 'u'
+#define USRP_E_WRITE_CTL16 _IOW(USRP_E_IOC_MAGIC, 0x20, struct usrp_e_ctl16)
+#define USRP_E_READ_CTL16 _IOWR(USRP_E_IOC_MAGIC, 0x21, struct usrp_e_ctl16)
+#define USRP_E_WRITE_CTL32 _IOW(USRP_E_IOC_MAGIC, 0x22, struct usrp_e_ctl32)
+#define USRP_E_READ_CTL32 _IOWR(USRP_E_IOC_MAGIC, 0x23, struct usrp_e_ctl32)
+#define USRP_E_SPI _IOWR(USRP_E_IOC_MAGIC, 0x24, struct usrp_e_spi)
+#define USRP_E_I2C_READ _IOWR(USRP_E_IOC_MAGIC, 0x25, struct usrp_e_i2c)
+#define USRP_E_I2C_WRITE _IOW(USRP_E_IOC_MAGIC, 0x26, struct usrp_e_i2c)
+#define USRP_E_GET_RB_INFO _IOR(USRP_E_IOC_MAGIC, 0x27, struct usrp_e_ring_buffer_size_t)
+#define USRP_E_GET_COMPAT_NUMBER _IO(USRP_E_IOC_MAGIC, 0x28)
+
+#define USRP_E_COMPAT_NUMBER 1
+
+/* Flag defines */
+#define RB_USER (1<<0)
+#define RB_KERNEL (1<<1)
+#define RB_OVERRUN (1<<2)
+#define RB_DMA_ACTIVE (1<<3)
+#define RB_USER_PROCESS (1<<4)
+
+struct ring_buffer_info {
+ int flags;
+ int len;
+};
+
+struct usrp_e_ring_buffer_size_t {
+ int num_pages_rx_flags;
+ int num_rx_frames;
+ int num_pages_tx_flags;
+ int num_tx_frames;
+};
+
+#endif
diff --git a/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp b/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp
index 73cb1f285..1ff135eac 100644
--- a/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp
+++ b/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp
@@ -51,7 +51,7 @@ static device_addrs_t usrp_e100_find(const device_addr_t &hint){
//device node not provided, assume its 0
if (not hint.has_key("node")){
device_addr_t new_addr = hint;
- new_addr["node"] = "/dev/usrp_e1000";
+ new_addr["node"] = "/dev/usrp_e0";
return usrp_e100_find(new_addr);
}