diff options
Diffstat (limited to 'xpp/xproto.h')
-rw-r--r-- | xpp/xproto.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xpp/xproto.h b/xpp/xproto.h index fbb6f16..f68fedf 100644 --- a/xpp/xproto.h +++ b/xpp/xproto.h @@ -29,6 +29,11 @@ #include <linux/proc_fs.h> #include <zaptel.h> +/* + * This must match the firmware protocol version + */ +#define XPP_PROTOCOL_VERSION 29 + struct xpd_addr { uint8_t unit:UNIT_BITS; uint8_t subunit:SUBUNIT_BITS; @@ -49,7 +54,12 @@ struct xpacket_header { #define XPACKET_LEN(p) ((p)->head.packet_len) #define XPACKET_IS_PCM(p) ((p)->head.is_pcm) #define XPACKET_PCMSLOT(p) ((p)->head.pcmslot) +#define XPACKET_RESERVED(p) ((p)->head.reserved) #define XPACKET_ADDR(p) ((p)->head.addr) +#define XPACKET_ADDR_UNIT(p) (XPACKET_ADDR(p).unit) +#define XPACKET_ADDR_SUBUNIT(p) (XPACKET_ADDR(p).subunit) +#define XPACKET_ADDR_SYNC(p) (XPACKET_ADDR(p).sync_master) +#define XPACKET_ADDR_RESERVED(p) (XPACKET_ADDR(p).reserved) #define PROTO_TABLE(n) n ## _protocol_table @@ -75,7 +85,6 @@ typedef byte xpd_type_t; #define PCM_CHUNKSIZE (CHANNELS_PERXPD * 8) /* samples of 8 bytes */ bool valid_xpd_addr(const struct xpd_addr *addr); -void xpd_set_addr(struct xpd_addr *addr, int xpd_num); #define XPROTO_NAME(card,op) card ## _ ## op #define XPROTO_HANDLER(card,op) XPROTO_NAME(card,op ## _handler) @@ -122,7 +131,11 @@ void xpd_set_addr(struct xpd_addr *addr, int xpd_num); XPACKET_LEN(p) = RPACKET_SIZE(card,op); \ XPACKET_IS_PCM(p) = (pcm); \ XPACKET_PCMSLOT(p) = (pcmslot); \ - xpd_set_addr(&XPACKET_ADDR(p), (to)); \ + XPACKET_RESERVED(p) = 0; \ + XPACKET_ADDR_UNIT(p) = XBUS_UNIT(to); \ + XPACKET_ADDR_SUBUNIT(p) = XBUS_SUBUNIT(to); \ + XPACKET_ADDR_SYNC(p) = 0; \ + XPACKET_ADDR_RESERVED(p) = 0; \ } while(0) #define XFRAME_NEW_CMD(frm, p, xbus, card, op, to) \ |