summaryrefslogtreecommitdiff
path: root/kernel/xpp/xpp_usb.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-13 21:08:09 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-13 21:08:09 +0000
commitd7e54a785544ac40abc4a88383df3a913ca466e8 (patch)
treeabf630c8372e7c81407172ad31190fa8a617a8ed /kernel/xpp/xpp_usb.c
parent823cf303caf13cc6e4fd2c2173804f0990b29532 (diff)
xpp r5723: Includes, among others:
* New firmware protocol version: 3.0 . * New numbers for the device types: (e.g. in card_init* scripts) - FXS: 1 (was: 3) - FXO: 2 (was: 4) - BRI: 3 (was: 6 for TE, 7 for NT) - PRI: 4 (was: 9) * Init scripts of FXS and FXO modules are now written in Perl as well (be sure to have File::Basename, e.g: perl-modules in Debian). * calibrate_slics merged into init_card_1_30 . * Module parameter print_dbg replaced with debug . Same meaning. * init_fxo_modes removed: content moved into init_card_2_30, verified at build time. * Code tested with sparse. Most warnings were fixed. * Set ZT_SIG_DACS for the bchans in the PRI and BRI modules to not get ignored by ztscan. * Handle null config_desc we get from some crazy USB controllers. * genzaptelconf: Fix reporting of empty slots in list mode. * xpp_blink can now blink a single analog port. * "slics" has been renamed "chipregs". * Fixed a small typo in fpga_load(8). * Fixed bashism in xpp_fxloader. Merged revisions 4264 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4266 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/xpp/xpp_usb.c')
-rw-r--r--kernel/xpp/xpp_usb.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/kernel/xpp/xpp_usb.c b/kernel/xpp/xpp_usb.c
index 796b127..2b633c6 100644
--- a/kernel/xpp/xpp_usb.c
+++ b/kernel/xpp/xpp_usb.c
@@ -45,10 +45,10 @@
static const char rcsid[] = "$Id$";
-DEF_PARM(int, print_dbg, 0, 0644, "Print DBG statements"); /* must be before zap_debug.h */
-DEF_PARM(int, usb1, 0, 0644, "Allow using USB 1.1 interfaces");
-DEF_PARM(uint, tx_sluggish, 2000, 0644, "A sluggish transmit (usec)");
-DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggish to drop a PCM frame");
+static DEF_PARM(int, debug, 0, 0644, "Print DBG statements"); /* must be before zap_debug.h */
+static DEF_PARM(int, usb1, 0, 0644, "Allow using USB 1.1 interfaces");
+static DEF_PARM(uint, tx_sluggish, 2000, 0644, "A sluggish transmit (usec)");
+static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggish to drop a PCM frame");
#include "zap_debug.h"
@@ -58,7 +58,7 @@ DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggish to dr
THIS_MODULE->name, (xusb)->index, xusb->path, xusb->serial, ## __VA_ARGS__)
#define XUSB_DBG(bits, xusb, fmt, ...) \
- ((void)((print_dbg & (DBG_ ## bits)) && XUSB_PRINTK(DEBUG, xusb, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
+ ((void)((debug & (DBG_ ## bits)) && XUSB_PRINTK(DEBUG, xusb, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
#define XUSB_ERR(xusb, fmt, ...) XUSB_PRINTK(ERR, xusb, fmt, ## __VA_ARGS__)
#define XUSB_NOTICE(xusb, fmt, ...) XUSB_PRINTK(NOTICE, xusb, fmt, ## __VA_ARGS__)
#define XUSB_INFO(xusb, fmt, ...) XUSB_PRINTK(INFO, xusb, fmt, ## __VA_ARGS__)
@@ -323,7 +323,7 @@ static xframe_t *alloc_xframe(xbus_t *xbus, gfp_t gfp_flags)
return &uframe->xframe;
}
-void free_xframe(xbus_t *xbus, xframe_t *xframe)
+static void free_xframe(xbus_t *xbus, xframe_t *xframe)
{
struct uframe *uframe = xframe_to_uframe(xframe);
struct urb *urb = &uframe->urb;
@@ -348,13 +348,14 @@ static int do_send_xframe(xbus_t *xbus, xframe_t *xframe)
xusb_t *xusb;
int ret = 0;
struct uframe *uframe;
- static int rate_limit;
BUG_ON(!xframe);
BUG_ON(xframe->xframe_magic != XFRAME_MAGIC);
xusb = xusb_of(xbus);
BUG_ON(!xusb);
if(!xusb->present) {
+ static int rate_limit;
+
if((rate_limit++ % 1003) == 0)
XUSB_ERR(xusb,
"abort do_send_xframe during device disconnect (%d)\n", rate_limit);
@@ -393,8 +394,8 @@ static int do_send_xframe(xbus_t *xbus, xframe_t *xframe)
ret = -EBADF;
goto failure;
}
-// if (print_dbg)
-// dump_xframe("USB_FRAME_SEND", xbus, xframe, print_dbg);
+// if (debug)
+// dump_xframe("USB_FRAME_SEND", xbus, xframe, debug);
atomic_inc(&xusb->pending_writes);
return 0;
failure:
@@ -480,7 +481,7 @@ static const struct xusb_model_info {
struct xusb_endpoint in;
struct xusb_endpoint out;
} model_table[] = {
- [MODEL_FPGA_XPD] {
+ [MODEL_FPGA_XPD] = {
.iface_num = 0,
.in = { .ep_addr = 0x86 },
.out = { .ep_addr = 0x02 },
@@ -950,8 +951,8 @@ static void xpp_receive_callback(USB_PASS_CB(urb))
atomic_set(&xframe->frame_len, size);
xframe->tv_received = now;
-// if (print_dbg)
-// dump_xframe("USB_FRAME_RECEIVE", xbus, xframe, print_dbg);
+// if (debug)
+// dump_xframe("USB_FRAME_RECEIVE", xbus, xframe, debug);
XUSB_COUNTER(xusb, RX_FRAMES)++;
/* Send UP */
xbus_receive_xframe(xbus, xframe);
@@ -978,7 +979,7 @@ static void xpp_usb_cleanup(void)
}
}
-int __init xpp_usb_init(void)
+static int __init xpp_usb_init(void)
{
int ret;
//xusb_t *xusb;
@@ -1009,7 +1010,7 @@ failure:
}
-void __exit xpp_usb_shutdown(void)
+static void __exit xpp_usb_shutdown(void)
{
DBG(GENERAL, "\n");
/* deregister this driver with the USB subsystem */