osmo-e1-hardware/software/e1-tracer/record/idt82v2081_regs.h

82 lines
2.3 KiB
C
Raw Normal View History

import latest e1-tracer host software This was originally in https://github.com/smunaut/ice40-playground but has meanwhile been removed, only a fork at https://github.com/laf0rge/ice40-playground remained. Let's import the code here. The history is not all that exciting so I'm saving myself the effort of git filter-branch or the like to import the actual old commits. The commit log is here for reference: commit bd36d40cc30acbae68978df79eff03f0539a9a21 Author: Harald Welte <laforge@osmocom.org> Date: Fri Sep 4 10:21:51 2020 +0200 e1-recorder main.c: Don't exist just because one ISO transfer failed I get LIBUSB_TRANSFER_ERROR every so often (once every few hours) on my laptop. Sure, it likely means there was some data lost, but the trace can continue juts fine after this error. So make it non-fatal and continue running. commit 9b02b3e87400ba3d27bff05e2632fbd5a0698e8c Author: Harald Welte <laforge@osmocom.org> Date: Mon Aug 31 10:01:20 2020 +0200 Add 'replay' to re-play 2Mbps stream with realistic speed (to stdout) commit 23103d3a8f9cc8b3f0ba602dbb4240040b2d008a Author: Harald Welte <laforge@osmocom.org> Date: Sun Aug 30 15:41:12 2020 +0200 dump: Use osmo_e1f to decode; send HLDC over GSMTAP commit 7acd063a1245a34835d4488be3caad592f3c19d5 Author: Harald Welte <laforge@osmocom.org> Date: Thu Aug 20 16:48:15 2020 +0200 dump.c: Add error plotting support commit 90b90d04fff494b70ad220bd82ac48d43f3096c9 Author: Harald Welte <laforge@osmocom.org> Date: Mon Jan 13 18:20:39 2020 +0100 dump: Add support for writing LAPD PCAP of E1 superchannel commit f3a0cc34f0901c2cf257367351dddfddc6f7301e Author: Harald Welte <laforge@osmocom.org> Date: Mon Jan 13 16:37:23 2020 +0100 dump.c: Move handling of frames to separate function commit 8deffb5907979e43e3a4236ea7bb8d54513513ac Author: Harald Welte <laforge@osmocom.org> Date: Mon Jan 13 16:34:39 2020 +0100 dump.c: remove local hexdump.[ch] and use libosmocore proper commit 80d81e78737237ba3b6bae1deb7d5107d7f613b6 Author: Harald Welte <laforge@osmocom.org> Date: Tue Sep 1 13:52:52 2020 +0200 tracer: use 0x6151 as PID See https://github.com/openmoko/openmoko-usb-oui/commit/5e68831b26dbf912d831a0c00ca3045e6285b458 commit b219af27b34bbd6deb2419aa38852d8d227b9fc0 Author: Harald Welte <laforge@osmocom.org> Date: Mon Jan 6 13:47:28 2020 +0100 e1-recorder: Don't silently ignore write failures The disk may be full, for example. We should report that to the user and terminate the program. commit ead99fdfae6f1db54c79a91ef407a86c67352d87 Author: Harald Welte <laforge@osmocom.org> Date: Mon Jan 6 12:41:23 2020 +0100 e1-recorder: Exit process on transfer + resubmit failure This is particularly importnat in case the USB device for some reason gets disconnected and re-connects. We want the process to fail fast and have systemd respawn us. commit a521e026c76056a60531c490fa2ef84e8e633c9a Author: Harald Welte <laforge@osmocom.org> Date: Mon Jan 6 12:35:20 2020 +0100 e1-recorder: use libusb_strerror() to decode error messages commit 43a8fbdfdc35f5ba7564cfe5c92f43b124abf710 Author: Harald Welte <laforge@osmocom.org> Date: Sun Jan 5 19:49:58 2020 +0100 e1-recorder: Acytually make '-r' (SCHED_RR) work commit 84e28225d9ba1de9fb09660a96bd3b0b798c88d9 Author: Harald Welte <laforge@osmocom.org> Date: Sun Jan 5 17:53:11 2020 +0100 e1-recorder: Add small 'dump' program This program will print one line for each E1 frame, where each line consists of 32 hex bytes: one for each timeslot commit 0c697b40620b5d18480e626991dc639daadf58a6 Author: Sylvain Munaut <tnt@246tNt.com> Date: Sun Dec 29 13:13:17 2019 +0100 projects/riscv_usb: Host software for the dual channel sniffer Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Closes: OS#5673 Change-Id: I9319c1eb8f822830307c1a181d357c58ce43efba
2022-10-30 21:20:55 +00:00
#ifndef _IDT82_REGS_H
#define _IDT82_REGS_H
/* Section 4.1 of Data Sheet */
enum idt82v2081_reg {
IDT_REG_ID, /* control */
IDT_REG_RST,
IDT_REG_GCF,
IDT_REG_TERM,
IDT_REG_JACF,
IDT_REG_TCF0, /* Tx path control */
IDT_REG_TCF1,
IDT_REG_TCF2,
IDT_REG_TCF3,
IDT_REG_TCF4,
IDT_REG_RCF0, /* Rx path control */
IDT_REG_RCF1,
IDT_REG_RCF2,
IDT_REG_MAINT0, /* Net Diag Ctrl */
IDT_REG_MAINT1,
IDT_REG_MAINT2,
IDT_REG_MAINT3,
IDT_REG_MAINT4,
IDT_REG_MAINT5,
IDT_REG_MAINT6,
IDT_REG_INTM0, /* Interrupt Control */
IDT_REG_INTM1,
IDT_REG_INTES,
IDT_REG_STAT0, /* Line Status */
IDT_REG_STAT1,
IDT_REG_INTS0, /* Interrupt Status */
IDT_REG_INTS1,
IDT_REG_CNT0, /* Counter */
IDT_REG_CNT1,
};
#define IDT_GCF_T1E1_E1 (0 << 2)
#define IDT_GCF_T1E1_T1 (1 << 2)
#define IDT_GCF_T1E1_MASK (1 << 2)
#define IDT_TERM_T_SHIFT 3
#define IDT_TERM_T_MASK (7 << IDT_TERM_T_SHIFT)
#define IDT_TERM_R_SHIFT 0
#define IDT_TERM_R_MASK (7 << IDT_TERM_R_SHIFT)
#define IDT_TCF1_PULS_MASK 0xF
#define IDT_TCF2_SCAL_MASK 0x3F
#define IDT_RCF2_MG_MASK 3
#define IDT_RCF2_UPDW_SHIFT 2
#define IDT_RCF2_UPDW_MASK (3 << IDT_TERM_INT_75)
#define IDT_RCF2_SLICE_SHIFT 4
#define IDT_RCF2_SLICE_MASK (3 << IDT_RCF2_SLICE_SHIFT)
#define IDT_INTM0_EQ (1 << 7) /* equalizer out of range */
#define IDT_INTM0_IBLBA (1 << 6) /* in-band LB act detect */
#define IDT_INTM0_IBLBD (1 << 5) /* in-band LB deact detect */
#define IDT_INTM0_PRBS (1 << 4) /* prbs sync signal detect */
#define IDT_INTM0_TCLK (1 << 3) /* tclk loss */
#define IDT_INTM0_DF (1 << 2) /* driver failure */
#define IDT_INTM0_AIS (1 << 1) /* Alarm Indication Signal */
#define IDT_INTM0_LOS (1 << 0) /* Loss Of Signal */
#define IDT_INTM1_DAC_OV (1 << 7) /* DAC arithmetic overflow */
#define IDT_INTM1_JA_OV (1 << 6) /* JA overflow */
#define IDT_INTM1_JA_UD (1 << 5) /* JA underflow */
#define IDT_INTM1_ERR (1 << 4) /* PRBS/QRBS logic error detect */
#define IDT_INTM1_EXZ (1 << 3) /* Receive excess zeros */
#define IDT_INTM1_CV (1 << 2) /* Receive error */
#define IDT_INTM1_TIMER (1 << 1) /* One second timer expiration */
#define IDT_INTM1_CNT (1 << 0) /* Counter overflow */
/* STAT0 == INTES == INTS0 == INTM0 */
/* INTS1 == INTM1 */
#define IDT_STAT1_RLP (1 << 5)
#define IDT_STAT1_ATT_MASK 0x1F
#endif /* _IDT82_REGS_H */