From 656bad10aaace557f6f7ace71f5b71be299d81c2 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Mon, 6 Nov 2006 18:12:16 +0000 Subject: Merging xpp driver release 1.2 (rev. 2569), originally team/tzafrir/xpp_1.2 * Should build well. Almost final. * genzaptelconf: Also work when zap_autoreg=0 * README.Astribank updated for rev. 1.2. * xpp/utils/Makefile: Use $< with cc -c * Get xpp/utils configuration from autoconf (without changesin top dir) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@1557 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- xpp/xpp_usb.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'xpp/xpp_usb.c') diff --git a/xpp/xpp_usb.c b/xpp/xpp_usb.c index 89571c3..bc8af46 100644 --- a/xpp/xpp_usb.c +++ b/xpp/xpp_usb.c @@ -229,6 +229,7 @@ void xusb_packet_free(xbus_t *xbus, xpacket_t *p) #else +/* FIXME FIXME FIXME: should move code to card methods */ static void packet_debug(const char msg[], xusb_t *xusb, xpacket_t *pack) { char title[XBUS_DESCLEN]; @@ -261,16 +262,26 @@ static void packet_debug(const char msg[], xusb_t *xusb, xpacket_t *pack) dump_packet("USB SEND PCM", pack, print_dbg); #endif return; - } else if(pack->content.opcode == XPROTO_NAME(FXS, SLIC_WRITE)) { - slic_cmd_t *sc; + } else if(pack->content.opcode == XPROTO_NAME(GLOBAL, REGISTER_REQUEST)) { + reg_cmd_t *regcmd; - sc = &RPACKET_FIELD(pack, FXS, SLIC_WRITE, slic_cmd); - if(sc->bytes == 2 && sc->content.direct.reg_num == 0x06 && sc->content.direct.read) /* ignore SLIC_QUERY */ + regcmd = &RPACKET_FIELD(pack, GLOBAL, REGISTER_REQUEST, reg_cmd); + if(REG_FIELD(regcmd, regnum) == 0x06) /* ignore SLIC_QUERY */ return; - if(sc->bytes == 2 && sc->content.direct.reg_num == DAA_VBAT_REGISTER && sc->content.direct.read) /* ignore DAA_QUERY */ + if(REG_FIELD(regcmd, regnum) == DAA_VBAT_REGISTER) /* ignore DAA_QUERY */ return; - } else if(pack->content.opcode == XPROTO_NAME(FXS, SLIC_REPLY)) { + if(REG_FIELD(regcmd, regnum) == 0x30) { /* ignore BRI query */ +#if 0 + static int rate_limit; + if((rate_limit++ % 1000) < 10) + dump_packet("BRI STATE REG", pack, print_dbg); +#endif + return; + } +#if 0 + } else if(pack->content.opcode == XPROTO_NAME(FXS, REGISTER_REPLY)) { return; +#endif } snprintf(title, XBUS_DESCLEN, "%s: %s", msg, xusb->xbus->busname); dump_packet(title, pack, print_dbg); @@ -405,16 +416,16 @@ static const struct xusb_model_info { struct xusb_endpoint out; xbus_type_t bus_type; } model_table[] = { - XUSB_MODEL(0x86, 0x02, FIRMWARE_LOOPBACK, "bulkloop.hex"), - XUSB_MODEL(0x86, 0x02, FIRMWARE_LOOPBACK, "FPGA_bulkloop.hex"), - XUSB_MODEL(0x86, 0x02, FIRMWARE_XPP, "FPGA_XPD.hex"), + XUSB_MODEL(0x86, 0x02, FIRMWARE_XPP, "FPGA_XPD"), }; /* table of devices that work with this driver */ static const struct usb_device_id xusb_table [] = { // { USB_DEVICE(0x04B4, 0x8613) }, // default of cypress - { USB_DEVICE(0xE4E4, 0x2211), .driver_info=(kernel_ulong_t)&model_table[2] }, // FPGA_XPD.hex - { USB_DEVICE(0xE4E4, 0x1132), .driver_info=(kernel_ulong_t)&model_table[2] }, // FPGA_XPD.hex + { USB_DEVICE(0xE4E4, 0x2211), .driver_info=(kernel_ulong_t)&model_table[0] }, // OLD FPGA + { USB_DEVICE(0xE4E4, 0x1132), .driver_info=(kernel_ulong_t)&model_table[0] }, // FPGA_FXS + { USB_DEVICE(0xE4E4, 0x1142), .driver_info=(kernel_ulong_t)&model_table[0] }, // FPGA_1141 + { USB_DEVICE(0xE4E4, 0x1152), .driver_info=(kernel_ulong_t)&model_table[0] }, // FPGA_1151 /* "Gadget Zero" firmware runs under Linux */ //{ USB_DEVICE(0x0525, 0xa4a0) }, { } /* Terminating entry */ -- cgit v1.2.3