diff options
author | Philip Balister <philip@opensdr.com> | 2010-09-21 18:07:25 +0000 |
---|---|---|
committer | Philip Balister <philip@opensdr.com> | 2010-09-21 18:07:25 +0000 |
commit | d6c4fbb29e818aec79864d25a0d308decb0db92d (patch) | |
tree | 7c2b13337ac3a823f2a8c48869d256b5e5071195 /host/include | |
parent | d4a80a2b93a13dc371ef100df962ba99c53a9bb9 (diff) | |
download | uhd-d6c4fbb29e818aec79864d25a0d308decb0db92d.tar.gz uhd-d6c4fbb29e818aec79864d25a0d308decb0db92d.tar.bz2 uhd-d6c4fbb29e818aec79864d25a0d308decb0db92d.zip |
Read the ring buffer size from the kernel and use that to set up the
structures that read and write the ring buffer.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/linux/usrp_e.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/host/include/linux/usrp_e.h b/host/include/linux/usrp_e.h index b098ad114..fd38027d4 100644 --- a/host/include/linux/usrp_e.h +++ b/host/include/linux/usrp_e.h @@ -34,8 +34,8 @@ struct usrp_e_ctl32 { #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_CTRL_TXNEG (BIT(10)) +#define UE_SPI_CTRL_RXNEG (BIT(9)) #define UE_SPI_PUSH_RISE 0 #define UE_SPI_PUSH_FALL UE_SPI_CTRL_TXNEG @@ -64,25 +64,24 @@ struct usrp_e_i2c { #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) -/* Data transfer frame definition */ - -struct usrp_transfer_frame { - __u32 status; - __u32 len; - __u8 buf[]; +/* Flag defines */ +#define RB_USER (1<<0) +#define RB_KERNEL (1<<1) +#define RB_OVERRUN (1<<2) +#define RB_DMA_ACTIVE (1<<3) + +struct ring_buffer_info { + int flags; + int len; }; -/* Flag defines */ -#define RB_USER (1 << 0) -#define RB_KERNEL (1 << 1) -#define RB_OVERRUN (1 << 2) -#define RB_DMA_ACTIVE (1 << 3) - -struct ring_buffer_entry { - unsigned int flags; - unsigned long dma_addr; - struct usrp_transfer_frame *frame_addr; +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 |