usbatm cxacru.c,1.2,1.3
kagan at infradead.org
kagan at infradead.org
Fri Jan 14 03:32:03 EST 2005
Update of /home/cvs/usbatm
In directory phoenix.infradead.org:/tmp/cvs-serv23312
Modified Files:
cxacru.c
Log Message:
- cxacru_do_timer_poll:
new fuction for type safety
- cxacru_usb_ioctl:
instead of directly modifying atm_dev->signal, forward the request to the modem
and immediately schedule status poll
- cxacru_timer_poll, cxacru_got_firmware, cxacru_usb_ioctl:
use cxacru_do_timer_poll
Index: cxacru.c
===================================================================
RCS file: /home/cvs/usbatm/cxacru.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cxacru.c 29 Dec 2004 21:21:25 -0000 1.2
+++ cxacru.c 14 Jan 2005 08:32:00 -0000 1.3
@@ -342,6 +342,17 @@
return ret;
}
+static void cxacru_do_timer_poll(struct cxacru_instance_data *instance)
+{
+ schedule_work(&instance->poll_work);
+ mod_timer(&instance->poll_timer, jiffies + (5 * HZ));
+}
+
+static void cxacru_timer_poll(unsigned long data)
+{
+ cxacru_do_timer_poll((struct cxacru_instance_data *)data);
+}
+
static void cxacru_got_firmware(struct cxacru_instance_data *instance,
int got_it)
{
@@ -388,7 +399,7 @@
}
/* Start status polling */
- mod_timer(&instance->poll_timer, jiffies + (1 * HZ));
+ cxacru_do_timer_poll(instance);
instance->u.status = UDSL_LOADED_FIRMWARE;
tasklet_schedule(&instance->u.receive_tasklet);
@@ -464,14 +475,6 @@
}
}
-static void cxacru_timer_poll(unsigned long data)
-{
- struct cxacru_instance_data *instance = (void *)data;
-
- schedule_work(&instance->poll_work);
- mod_timer(&instance->poll_timer, jiffies + (5 * HZ));
-}
-
#ifdef USE_FW_LOADER
static int cxacru_fw(struct cxacru_instance_data *instance, enum cxacru_fw_request fw,
u8 code1, u8 code2, u32 addr, u8 *data, int size)
@@ -751,12 +754,11 @@
switch (code) {
case UDSL_IOCTL_LINE_UP:
- instance->u.atm_dev->signal = ATM_PHY_SIG_FOUND;
cxacru_got_firmware(instance, 1);
return (instance->u.status == UDSL_LOADED_FIRMWARE) ? 0 : -EIO;
case UDSL_IOCTL_LINE_DOWN:
- instance->u.atm_dev->signal = ATM_PHY_SIG_LOST;
cxacru_cm(instance, CM_REQUEST_CHIP_ADSL_LINE_STOP, NULL, 0, NULL, 0);
+ cxacru_do_timer_poll(instance);
return 0;
default:
return -ENOTTY;
More information about the Usbatm-commits
mailing list