diff options
-rw-r--r-- | tdm/xivo_ep80579_p.h | 54 | ||||
-rw-r--r-- | xhfc/Makefile | 3 | ||||
-rw-r--r-- | xivovp/base.c | 6 |
3 files changed, 60 insertions, 3 deletions
diff --git a/tdm/xivo_ep80579_p.h b/tdm/xivo_ep80579_p.h new file mode 100644 index 0000000..1c7c7cb --- /dev/null +++ b/tdm/xivo_ep80579_p.h @@ -0,0 +1,54 @@ +#ifndef XIVO_EP80579_P_H +#define XIVO_EP80579_P_H + +#include <linux/kernel.h> + +struct hss_queue_entry { + __le32 lsc; /* bytes 0 to 3: len_lsb | len_msb | status | chan_id */ + u32 data_ptr; + u32 packet_len; + u32 entry_ptr; +} __attribute__ ((aligned (16))); + +static inline __le32 len_status_cid( + unsigned len, + unsigned status, + unsigned chan_id) +{ + return cpu_to_le32( (len & 0xffff) + | ((status & 0xff) << 16) + | ((chan_id & 0xff) << 24)); +} + +static inline unsigned lsc_len(__le32 lsc) +{ + return le32_to_cpu(lsc) & 0xffffu; +} + +static inline unsigned lsc_status(__le32 lsc) +{ + return (le32_to_cpu(lsc) >> 16) & 0xffu; +} + +static inline unsigned lsc_cid(__le32 lsc) +{ + return (le32_to_cpu(lsc) >> 24) & 0xffu; +} + +/* Not sure it's really necessary to allocate that wide npe buffer entries for + * the rx buffers (struct hss_queue_entry might maybe be enough), but we won't + * take the risk of data corruption, and maybe they need to be 32 bytes + * aligned anyway. + * (If this doesn't work we indeed might even try cache line size alignment: + * 64 bytes on EP80579 -- in this case we could put the buffers in the + * 32 bytes gap between entries :) + */ +struct hss_piu_entry { + struct hss_queue_entry q_entry; + u32 next_buf_ptr; /* don't know what it is... */ + u32 reserved[3]; +} __attribute__ ((aligned (32))); + +#define HSS_PIU_ENTRY_CHANNEL_ID(pe_ptr) lsc_cid((pe_ptr)->q_entry.lsc) + +#endif /* XIVO_EP80579_P_H */ diff --git a/xhfc/Makefile b/xhfc/Makefile index 346544d..558c296 100644 --- a/xhfc/Makefile +++ b/xhfc/Makefile @@ -4,6 +4,9 @@ KSRC ?= /bad__ksrc__not_set DAHDI_INCLUDE ?= /bad__dahdi_include__not_set CFLAGS_MODULE += -I$(DAHDI_INCLUDE) -I$(abspath $(src)/../) -DUSE_GPIO -DAUDIO +ifeq (1,$(XIVO_AUDIO)) +CFLAGS_MODULE += -DAUDIO +endif obj-m := xivoxhfc.o xivoxhfc-objs := base.o xhfc_leb.o xhfc_st_state.o diff --git a/xivovp/base.c b/xivovp/base.c index d9f2a0a..35dfe23 100644 --- a/xivovp/base.c +++ b/xivovp/base.c @@ -75,8 +75,8 @@ static int alawoverride = 1; /* It's named like that in every DAHDI driver except I prefer it to be 1 so the name doesn't make much sense. */ static int reverse_polarity = false; -static int wait_port0 = false; -static uint reset_gpio = 21; +static int wait_port0 = true; +static uint reset_gpio = 28; module_param(init_dbg, uint, 0444); module_param(reset_gpio, uint, 0444); @@ -875,7 +875,7 @@ xivovp_port0_configured_cb(void *data) printk(KERN_ERR "%s START\n", __func__); if ((rc = xivo_tdm_config_port(xivovp.tdm_port, - LE89316_ASYNC_MEGREZ_PROTO_XIVO_CONFIG)) + LE89316_MEGREZ_PROTO_XIVO_CONFIG)) < 0) { printk(KERN_CRIT "%s: xivo_tdm_config_port returned %d\n", __func__, rc); |