summaryrefslogtreecommitdiff
path: root/wcfxsusb.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-02-13 14:42:04 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-02-13 14:42:04 +0000
commitf43473efc28d6afeaeac050d260aa665289c9725 (patch)
tree194de8b203ed0eff0691024cdcfcb9a5139a1d87 /wcfxsusb.c
parent39592cd08f832315e81428880f407a6b65f6c992 (diff)
Version 0.1.6 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@57 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxsusb.c')
-rwxr-xr-xwcfxsusb.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/wcfxsusb.c b/wcfxsusb.c
index 1f2cc89..1857f72 100755
--- a/wcfxsusb.c
+++ b/wcfxsusb.c
@@ -160,20 +160,14 @@ typedef enum {
STATE_FOR_LOOP_CLEAR_DIGIT,
} keypad_state_t;
-typedef enum {
- STATE_RUNNING,
- STATE_STOPPED,
-} keypad_control_t;
-
struct wc_keypad_data {
/* Keypad state monitoring variables */
keypad_state_t state;
urb_t urb;
- keypad_control_t control;
+ int running;
char data;
char data12;
char tmp;
- int traffic_count;
int scanned_event;
int i;
int count;
@@ -401,7 +395,7 @@ static void keypad_check_done(urb_t *urb)
char digit = 'z';
p->urbcount--;
- if (d->control == STATE_STOPPED) {
+ if (!d->running) {
printk("Stopping stream (check_done)\n");
return;
}
@@ -910,7 +904,7 @@ static void wcusb_check_keypad(struct wc_usb_pvt *p)
{
struct wc_keypad_data *d = p->pvt_data;
- if (d->control == STATE_STOPPED) {
+ if (!d->running) {
printk("Stopping keypad stream\n");
return;
}
@@ -1086,7 +1080,7 @@ static int StopTransmit(struct wc_usb_pvt *p)
if (p->devclass == WC_KEYPAD) {
struct wc_keypad_data *d = p->pvt_data;
- d->control = STATE_STOPPED;
+ d->running = 0;
}
while(p->urbcount) {
schedule_timeout(1);
@@ -1122,16 +1116,18 @@ static int flip_relays(struct wc_usb_pvt *p, int onoff)
static int InitPrivate(struct wc_usb_pvt *p)
{
int x;
+ unsigned int readpipe;
+ unsigned int writepipe;
/* Endpoint 6 is the wave-in device */
- p->readpipe = usb_rcvisocpipe(p->dev, 0x06);
+ readpipe = usb_rcvisocpipe(p->dev, 0x06);
/* Endpoint 7 is the wave-out device */
- p->writepipe = usb_sndisocpipe(p->dev, 0x07);
+ writepipe = usb_sndisocpipe(p->dev, 0x07);
for (x=0;x<2;x++) {
p->dataread[x].urb.dev = p->dev;
- p->dataread[x].urb.pipe = p->readpipe;
+ p->dataread[x].urb.pipe = readpipe;
p->dataread[x].urb.transfer_flags = USB_ISO_ASAP;
p->dataread[x].urb.number_of_packets = 1;
p->dataread[x].urb.context = p;
@@ -1142,7 +1138,7 @@ static int InitPrivate(struct wc_usb_pvt *p)
p->dataread[x].urb.transfer_buffer_length = ZT_CHUNKSIZE * 2;
p->datawrite[x].urb.dev = p->dev;
- p->datawrite[x].urb.pipe = p->writepipe;
+ p->datawrite[x].urb.pipe = writepipe;
p->datawrite[x].urb.transfer_flags = USB_ISO_ASAP;
p->datawrite[x].urb.number_of_packets = 1;
p->datawrite[x].urb.context = p;
@@ -1283,9 +1279,8 @@ static int init_device_pvt(struct wc_usb_pvt *p)
}
memset(d, 0, sizeof(struct wc_keypad_data));
p->pvt_data = d;
- d->traffic_count = 0;
d->count = 0;
- d->control = STATE_RUNNING;
+ d->running = 1;
d->tone = NULL;
return 0;
} else {
@@ -1444,6 +1439,9 @@ static void __exit wc_cleanup(void)
MODULE_AUTHOR("Mark Spencer <markster@linux-support.net>");
MODULE_DESCRIPTION("Wildcard USB FXS Interface driver");
+#ifdef MODULE_LICENSE
+MODULE_LICENSE("GPL");
+#endif
MODULE_PARM(debug, "i");
MODULE_DEVICE_TABLE(usb, wc_dev_ids);