laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26849 )
Change subject: icE1usb fw: Reorganize functions in e1.{c,h} ......................................................................
icE1usb fw: Reorganize functions in e1.{c,h}
RX before TX for consistency ...
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: Idcb1890a3a3f4fd2129f73585c4ce9f8475f1e21 --- M firmware/ice40-riscv/icE1usb/e1.c M firmware/ice40-riscv/icE1usb/e1.h 2 files changed, 18 insertions(+), 18 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index f6a41c9..ed3e13f 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -300,15 +300,6 @@ }
void -e1_tx_config(int port, uint16_t cr) -{ - volatile struct e1_core *e1_regs = _get_regs(port); - struct e1_state *e1 = _get_state(port); - e1->tx.cr = (e1->tx.cr & ~TXCR_PERMITTED) | (cr & TXCR_PERMITTED); - e1_regs->tx.csr = e1->tx.cr; -} - -void e1_rx_config(int port, uint16_t cr) { volatile struct e1_core *e1_regs = _get_regs(port); @@ -317,6 +308,15 @@ e1_regs->rx.csr = e1->rx.cr; }
+void +e1_tx_config(int port, uint16_t cr) +{ + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); + e1->tx.cr = (e1->tx.cr & ~TXCR_PERMITTED) | (cr & TXCR_PERMITTED); + e1_regs->tx.csr = e1->tx.cr; +} + unsigned int e1_rx_need_data(int port, unsigned int usb_addr, unsigned int max_frames, unsigned int *pos) { @@ -409,19 +409,19 @@ }
unsigned int -e1_tx_level(int port) -{ - struct e1_state *e1 = _get_state(port); - return e1f_valid_frames(&e1->tx.fifo); -} - -unsigned int e1_rx_level(int port) { struct e1_state *e1 = _get_state(port); return e1f_valid_frames(&e1->rx.fifo); }
+unsigned int +e1_tx_level(int port) +{ + struct e1_state *e1 = _get_state(port); + return e1f_valid_frames(&e1->tx.fifo); +} + const struct e1_error_count * e1_get_error_count(int port) { diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index a93a881..a44c319 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -14,16 +14,16 @@ void e1_poll(int port); void e1_debug_print(int port, bool data);
-void e1_tx_config(int port, uint16_t cr); void e1_rx_config(int port, uint16_t cr); +void e1_tx_config(int port, uint16_t cr);
/* data flow */
unsigned int e1_rx_need_data(int port, unsigned int usb_addr, unsigned int max_len, unsigned int *pos); unsigned int e1_tx_feed_data(int port, unsigned int usb_addr, unsigned int len); -unsigned int e1_tx_level(int port); unsigned int e1_rx_level(int port); +unsigned int e1_tx_level(int port);
/* error reporting */