1 diff -urN linux.old/drivers/char/avalanche_led/ledmod.c linux.dev/drivers/char/avalanche_led/ledmod.c
2 --- linux.old/drivers/char/avalanche_led/ledmod.c 1970-01-01 01:00:00.000000000 +0100
3 +++ linux.dev/drivers/char/avalanche_led/ledmod.c 2005-07-11 03:16:48.247012224 +0200
5 +#include <linux/config.h>
6 +#include <linux/init.h>
7 +#include <linux/kernel.h>
8 +#include <linux/proc_fs.h>
9 +#include <asm/uaccess.h>
10 +#include <linux/fs.h>
11 +#include <linux/timer.h>
12 +#include <linux/delay.h>
13 +#include <linux/spinlock.h>
14 +#include <asm/ar7/avalanche_regs.h>
15 +#include <asm/ar7/ledapp.h>
16 +#include <linux/module.h>
23 +#define LED_BLINK_UP 5
24 +#define LED_BLINK_DOWN 6
26 +typedef struct state_entry {
29 + void (*handler) (struct state_entry * pState);
30 + unsigned long param;
33 +typedef struct mod_entry {
34 + state_entry_t *states[MAX_STATE_ID];
37 +static mod_entry_t *modArr[MAX_MOD_ID];
38 +static struct proc_dir_entry *led_proc_dir, *led_file;
40 +/* index of the array is the led number HARDWARE SPECIFIC*/
41 +typedef struct led_data {
44 + struct timer_list *pTimer;
45 + unsigned char timer_running;
46 + unsigned long param;
49 +led_data_t led_arr[MAX_LED_ID + 1];
50 +/*!!! The last device is actually being used for ar7 reset to factory default */
52 +/* Ron add for adsl LED blink */
53 +#define GPIO_ADSL_ACT (1<<6)
54 +#define GPIO_ADSL_DOWN (1<<8)
55 +#define BLINK_FAST 5*HZ/100
56 +#define BLINK_SLOW 15*HZ/100
57 +static struct timer_list my_led_timer;
58 +static int my_blink_count = 0;
59 +static int my_mode = 1;
60 +void led_operation(int mod, int state);
62 +static void my_led_on(unsigned long gpio, int logic)
65 + GPIO_DATA_OUTPUT |= gpio;
67 + GPIO_DATA_OUTPUT &= ~gpio;
70 +static void my_led_off(unsigned long gpio, int logic)
73 + GPIO_DATA_OUTPUT &= ~gpio;
75 + GPIO_DATA_OUTPUT |= gpio;
79 +static void my_led_init(unsigned long gpio, int init, int logic)
81 + GPIO_DATA_ENABLE |= gpio;
82 + GPIO_DATA_DIR &= ~gpio;
84 + my_led_on(gpio, logic);
86 + my_led_off(gpio, logic);
89 +static void my_led_blink_timer(unsigned long data)
91 + unsigned long gpio = GPIO_ADSL_ACT;
92 + unsigned int speed = BLINK_FAST;
94 + gpio = GPIO_ADSL_DOWN;
97 + if (my_blink_count) {
98 + if (GPIO_DATA_OUTPUT & gpio) {
99 + GPIO_DATA_OUTPUT &= ~gpio;
101 + my_blink_count = 0;
103 + GPIO_DATA_OUTPUT |= gpio;
106 + my_led_timer.expires = jiffies + speed;
107 + add_timer(&my_led_timer);
110 +/* Ron add for ADSL led blink */
112 +static spinlock_t config_lock;
114 +static void board_led_link_up(state_entry_t * pState);
115 +static void board_led_link_down(state_entry_t * pState);
116 +static void board_led_activity_on(state_entry_t * pState);
117 +static void board_led_activity_off(state_entry_t * pState);
118 +static void led_timer_func(unsigned long data);
120 +static ssize_t proc_read_led_fops(struct file *filp, char *buf, size_t count, loff_t * offp);
121 +static ssize_t proc_write_led_fops(struct file *filp, const char *buffer, size_t count, loff_t * offp);
122 +static int config_led(unsigned long y);
124 +struct file_operations led_fops = {
125 + read:proc_read_led_fops,
126 + write:proc_write_led_fops,
129 +static int led_atoi(char *name)
135 + val = val * 10 + (*name - '0');
143 +static int free_memory(void)
147 + for (i = 0; i < MAX_MOD_ID; i++) {
148 + if (modArr[i] != NULL) {
149 + for (j = 0; j < MAX_STATE_ID; j++) {
150 + if (modArr[i]->states[j] != NULL)
151 + kfree(modArr[i]->states[j]);
160 +static int led_on(state_entry_t * pState)
162 + if (led_arr[pState->led].led == NULL)
164 + led_arr[pState->led].led->onfunc(led_arr[pState->led].led->param);
168 +static int led_off(state_entry_t * pState)
170 + if (led_arr[pState->led].led == NULL)
172 + led_arr[pState->led].led->offfunc(led_arr[pState->led].led->param);
176 +static void board_led_link_up(state_entry_t * pState)
178 + led_arr[pState->led].state = LED_ON;
179 + if (led_arr[pState->led].timer_running == 0)
184 +static void board_led_link_down(state_entry_t * pState)
186 + led_arr[pState->led].state = LED_OFF;
187 + if (led_arr[pState->led].timer_running == 0)
192 +static void add_led_timer(state_entry_t * pState)
194 + led_arr[pState->led].pTimer->expires =
195 + jiffies + HZ * (pState->param) / 1000;
196 + led_arr[pState->led].param = pState->param;
197 + led_arr[pState->led].pTimer->data = pState;
198 + add_timer(led_arr[pState->led].pTimer);
201 +static void board_led_activity_on(state_entry_t * pState)
203 + if (led_arr[pState->led].timer_running == 0) {
205 + add_led_timer(pState);
206 + led_arr[pState->led].timer_running = 1;
207 + led_arr[pState->led].state = LED_BLINK_UP;
208 + } else if (led_arr[pState->led].timer_running > 0xF0) {
209 + led_arr[pState->led].state = LED_BLINK_UP;
210 + led_arr[pState->led].pTimer->expires =
211 + jiffies + HZ * (pState->param) / 1000;
212 + led_arr[pState->led].param = pState->param;
213 + led_arr[pState->led].pTimer->data = pState;
218 +static void board_led_activity_off(state_entry_t * pState)
220 + if (led_arr[pState->led].timer_running == 0) {
222 + add_led_timer(pState);
223 + led_arr[pState->led].timer_running = 1;
224 + led_arr[pState->led].state = LED_BLINK_UP;
225 + } else if (led_arr[pState->led].timer_running > 0xF0) {
226 + led_arr[pState->led].state = LED_BLINK_UP;
227 + led_arr[pState->led].pTimer->expires =
228 + jiffies + HZ * (pState->param) / 1000;
229 + led_arr[pState->led].param = pState->param;
230 + led_arr[pState->led].pTimer->data = pState;
235 +static void board_led_link_flash(state_entry_t * pState)
237 + if (led_on(pState))
239 + if (led_arr[pState->led].timer_running == 0)
240 + add_led_timer(pState);
242 + led_arr[pState->led].param = pState->param;
243 + led_arr[pState->led].timer_running = 0xFF;
244 + led_arr[pState->led].state = LED_FLASH;
248 +static void led_timer_func(unsigned long data)
250 + state_entry_t *pState = NULL;
251 + mod_entry_t *pMod = NULL;
252 + unsigned int flags;
254 + spin_lock_irqsave(&config_lock, flags);
256 + pState = (state_entry_t *) data;
258 + if (led_arr[pState->led].state == LED_BLINK_DOWN) {
259 + led_arr[pState->led].timer_running = 0;
260 + if (pState->mode == 2)
261 + led_arr[pState->led].state = LED_OFF;
263 + led_arr[pState->led].state = LED_ON;
264 + } else if (led_arr[pState->led].state == LED_BLINK_UP) {
265 + led_arr[pState->led].pTimer->expires =
266 + jiffies + HZ * (led_arr[pState->led].param) / 1000;
267 + led_arr[pState->led].pTimer->data = pState;
268 + add_timer(led_arr[pState->led].pTimer);
269 + if (pState->mode == 2) {
271 + led_arr[pState->led].state = LED_BLINK_DOWN;
274 + led_arr[pState->led].state = LED_BLINK_DOWN;
276 + led_arr[pState->led].timer_running = 1;
277 + } else if (led_arr[pState->led].state == LED_FLASH) {
278 + led_arr[pState->led].pTimer->expires =
279 + jiffies + HZ * (led_arr[pState->led].param) / 1000;
280 + led_arr[pState->led].pTimer->data = pState;
281 + add_timer(led_arr[pState->led].pTimer);
283 + if (led_arr[pState->led].timer_running == 0xFF) {
285 + led_arr[pState->led].timer_running--;
288 + led_arr[pState->led].timer_running++;
290 + spin_unlock_irqrestore(&config_lock, flags);
292 + } else if (led_arr[pState->led].state == LED_OFF) {
294 + led_arr[pState->led].timer_running = 0;
295 + } else if (led_arr[pState->led].state == LED_ON) {
297 + led_arr[pState->led].timer_running = 0;
299 + spin_unlock_irqrestore(&config_lock, flags);
303 +static ssize_t proc_read_led_fops(struct file *filp,
304 + char *buf, size_t count, loff_t * offp)
306 + char *pdata = NULL;
307 + int i = 0, j = 0, len = 0, totallen = 0;
314 + len += sprintf(line, "LEDS Registered for use are:");
315 + for (i = 0; i < MAX_LED_ID; i++)
316 + if (led_arr[i].led != NULL)
317 + len += sprintf(&line[len], " %d ", i);
318 + line[len++] = '\n';
320 + copy_to_user(pdata, line, len);
324 + len = sprintf(line, "USER MODULE INFORMATION:\n");
325 + copy_to_user(pdata, line, len);
329 + for (i = 0; i < MAX_MOD_ID; i++) {
330 + if (modArr[i] != NULL) {
331 + len = sprintf(line, " Module ID = %d \n", i);
332 + copy_to_user(pdata, line, len);
336 + for (j = 0; j < MAX_STATE_ID; j++) {
337 + if (modArr[i]->states[j] != NULL) {
338 + len = sprintf(line, " State = %d , Led = %d,", j,
339 + modArr[i]->states[j]->led);
340 + copy_to_user(pdata, line, len);
345 + switch (modArr[i]->states[j]->mode) {
347 + len = sprintf(line, " Mode = OFF\n");
350 + len = sprintf(line, " Mode = BLINK_ON , On Time(ms) = %d\n",
351 + (unsigned int) modArr[i]->states[j]->
355 + len = sprintf(line, " Mode = BLINK_OFF , Off Time(ms) = %d\n",
356 + (unsigned int) modArr[i]->states[j]->
360 + len = sprintf(line, " Mode = ON \n");
363 + len = sprintf(line, " Mode = FLASH , Time Period(ms) = %d\n",
364 + (unsigned int) modArr[i]->states[j]->
371 + copy_to_user(pdata, line, len);
380 + /* Return with configuration information for LEDs */
385 +static ssize_t proc_write_led_fops(struct file *filp, const char *buffer, size_t count, loff_t * offp)
387 + char *pdata = NULL, *ptemp = NULL;
388 + char line[10], temp[10];
390 + int mod = 0xFFFF, state = 0xFFFF;
393 + /* Check if this write is for configuring stuff */
394 + if (*(int *) (buffer) == 0xFFEEDDCC) {
395 + printk("<1>proc write:Calling Configuration\n");
396 + config_led((unsigned long) (buffer + sizeof(int)));
401 + printk("<1>proc write:Input too long,max length = %d\n", 10);
404 + memset(temp, 0x00, 10);
405 + memset(line, 0x00, 10);
406 + copy_from_user(line, buffer, count);
407 + line[count] = 0x00;
410 + while (flag == 0) {
413 + if (((*pdata) >= '0') && ((*pdata) <= '9')) {
416 + } else if ((*pdata) == ',') {
424 + mod = led_atoi(temp);
431 + while (flag == 0) {
434 + if (((*pdata) >= '0') && ((*pdata) <= '9')) {
437 + } else if ((*pdata) == 0x00) {
445 + state = led_atoi(temp);
448 + if ((mod == 0xFFFF) || (state == 0xFFFF))
451 + led_operation(mod, state);
455 +static int config_led(unsigned long y)
457 + config_elem_t *pcfg = NULL;
458 + char *pdata = NULL;
460 + int length = 0, number = 0;
461 + unsigned int flags;
463 + spin_lock_irqsave(&config_lock, flags);
465 + /* ioctl to configure */
466 + length = *((int *) y);
467 + pdata = (char *) y + sizeof(int);
468 + number = (length - sizeof(int)) / sizeof(config_elem_t);
469 + pcfg = (config_elem_t *) (pdata);
471 + /* Check if an earlier configuration exists IF yes free it up */
474 + for (i = 0; i < number; i++) {
475 + /* If no structure has been allocated for the module do so */
476 + if (modArr[pcfg->name] == NULL) {
477 + printk("<1>module = %d\n", pcfg->name);
478 + if (pcfg->name >= MAX_MOD_ID) {
480 + ("<1>Exiting Configuration: Module ID too large %d\n",
483 + spin_unlock_irqrestore(&config_lock, flags);
486 + modArr[pcfg->name] = kmalloc(sizeof(mod_entry_t), GFP_KERNEL);
487 + if (modArr[pcfg->name] == NULL) {
489 + ("<1>Exiting Configuration: Error in allocating memory\n");
491 + spin_unlock_irqrestore(&config_lock, flags);
494 + memset(modArr[pcfg->name], 0x00, sizeof(mod_entry_t));
497 + /* if no structure is allocated previously for this state
498 + allocate a structure, if it's already there fill it up */
499 + if (modArr[pcfg->name]->states[pcfg->state] == NULL) {
500 + printk("<1>STATE = %d\n", pcfg->state);
501 + if (pcfg->state >= MAX_STATE_ID) {
502 + printk("<1>Exiting Configuration: State ID too large\n");
504 + spin_unlock_irqrestore(&config_lock, flags);
507 + modArr[pcfg->name]->states[pcfg->state] =
508 + kmalloc(sizeof(state_entry_t), GFP_KERNEL);
509 + if (modArr[pcfg->name]->states[pcfg->state] == NULL) {
511 + spin_unlock_irqrestore(&config_lock, flags);
514 + memset(modArr[pcfg->name]->states[pcfg->state], 0x00,
515 + sizeof(state_entry_t));
517 + /* Fill up the fields of the state */
518 + if (pcfg->led >= MAX_LED_ID) {
519 + printk("<1>led = %d\n", pcfg->led);
521 + spin_unlock_irqrestore(&config_lock, flags);
524 + modArr[pcfg->name]->states[pcfg->state]->led = pcfg->led;
525 + modArr[pcfg->name]->states[pcfg->state]->mode = pcfg->mode;
526 + modArr[pcfg->name]->states[pcfg->state]->param = pcfg->param;
527 + switch (pcfg->mode) {
529 + modArr[pcfg->name]->states[pcfg->state]->handler =
530 + board_led_link_down;
535 + if (pcfg->mode == 2)
536 + modArr[pcfg->name]->states[pcfg->state]->handler =
537 + board_led_activity_on;
538 + else if (pcfg->mode == 3)
539 + modArr[pcfg->name]->states[pcfg->state]->handler =
540 + board_led_activity_off;
542 + modArr[pcfg->name]->states[pcfg->state]->handler =
543 + board_led_link_flash;
546 + modArr[pcfg->name]->states[pcfg->state]->handler =
550 + printk("<1>Exiting Configuration: Unknown LED Mode\n");
552 + spin_unlock_irqrestore(&config_lock, flags);
557 + spin_unlock_irqrestore(&config_lock, flags);
562 +int __init led_init(void)
565 + /* Clear our memory */
566 + memset(modArr, 0x00, sizeof(mod_entry_t *) * MAX_MOD_ID);
567 + memset(led_arr, 0x00, sizeof(led_data_t *) * MAX_LED_ID);
569 + /* Create spin lock for config data structure */
570 + config_lock = SPIN_LOCK_UNLOCKED;
573 + /* Create directory */
574 + led_proc_dir = proc_mkdir("led_mod", NULL);
575 + if (led_proc_dir == NULL)
579 + /* Create adsl file */
580 + led_file = create_proc_entry("led", 0777, NULL);
581 + if (led_file == NULL)
584 + led_file->owner = THIS_MODULE;
585 + led_file->proc_fops = &led_fops;
587 + memset(modArr, 0x00, sizeof(mod_entry_t *) * MAX_MOD_ID);
589 + /* Ron add for ADSL LED blink */
591 + my_led_init(GPIO_ADSL_ACT, 0, -1);
592 + my_led_init(GPIO_ADSL_DOWN, 0, -1);
593 + init_timer(&my_led_timer);
594 + my_led_timer.function = my_led_blink_timer;
595 + my_led_timer.data = 0;
596 + my_led_timer.expires = jiffies + BLINK_SLOW;
597 + add_timer(&my_led_timer);
598 + /* Ron add for ADSL LED blink */
602 + remove_proc_entry("led", NULL);
610 + remove_proc_entry("led", NULL);
613 +void led_operation(int mod, int state)
616 + unsigned int flags;
618 + spin_lock_irqsave(&config_lock, flags);
620 + /* Ron Add for ADSL LED blink */
621 + //printk("mod==%d state==%d\n",mod,state);
628 + my_blink_count = 0;
629 + my_led_off(GPIO_ADSL_ACT, -1);
630 + my_led_off(GPIO_ADSL_DOWN, -1);
634 + if (my_mode == 1) {
636 + my_led_off(GPIO_ADSL_ACT, -1);
643 + my_blink_count = 0;
644 + my_led_off(GPIO_ADSL_DOWN, -1);
645 + my_led_on(GPIO_ADSL_ACT, -1);
650 + my_led_off(GPIO_ADSL_DOWN, -1);
654 + } /* Ron add for ADSL LED Blink */
656 + if ((mod >= MAX_MOD_ID) || (state >= MAX_STATE_ID)) {
657 + spin_unlock_irqrestore(&config_lock, flags);
660 + if (modArr[mod] == NULL) {
661 + spin_unlock_irqrestore(&config_lock, flags);
664 + if (modArr[mod]->states[state] == NULL) {
665 + spin_unlock_irqrestore(&config_lock, flags);
668 + /* Call the function handler */
669 + modArr[mod]->states[state]->handler(modArr[mod]->states[state]);
671 + spin_unlock_irqrestore(&config_lock, flags);
674 +void register_led_drv(int device, led_reg_t * pInfo)
676 + unsigned int flags;
677 + struct timer_list *pTimer = NULL;
679 + spin_lock_irqsave(&config_lock, flags);
681 + led_arr[device].led = pInfo;
682 + if (led_arr[device].led->init != 0x00)
683 + led_arr[device].led->init(led_arr[device].led->param);
684 + if (led_arr[device].led->offfunc != 0x00)
685 + led_arr[device].led->offfunc(led_arr[device].led->param);
687 + /* Create a timer for blinking */
688 + pTimer = kmalloc(sizeof(struct timer_list), GFP_KERNEL);
689 + init_timer(pTimer);
690 + pTimer->function = led_timer_func;
692 + led_arr[device].pTimer = pTimer;
693 + led_arr[device].timer_running = 0;
695 + spin_unlock_irqrestore(&config_lock, flags);
700 +void deregister_led_drv(int device)
702 + unsigned int flags;
704 + spin_lock_irqsave(&config_lock, flags);
705 + led_arr[device].led = NULL;
707 + if (led_arr[device].pTimer != NULL) {
708 + del_timer(led_arr[device].pTimer);
709 + kfree(led_arr[device].pTimer);
711 + spin_unlock_irqrestore(&config_lock, flags);
716 +module_init(led_init);
717 +module_exit(led_exit);
720 +EXPORT_SYMBOL_NOVERS(led_init);
721 +EXPORT_SYMBOL_NOVERS(led_operation);
722 +EXPORT_SYMBOL_NOVERS(register_led_drv);
723 +EXPORT_SYMBOL_NOVERS(deregister_led_drv);
724 diff -urN linux.old/drivers/char/avalanche_led/Makefile linux.dev/drivers/char/avalanche_led/Makefile
725 --- linux.old/drivers/char/avalanche_led/Makefile 1970-01-01 01:00:00.000000000 +0100
726 +++ linux.dev/drivers/char/avalanche_led/Makefile 2005-07-11 02:42:24.191796312 +0200
728 +# File: drivers/char/avalanche_led/Makefile
730 +# Makefile for the Linux LED device driver.
734 +O_TARGET := avalanche_led.o
735 +obj-m := avalanche_led.o
736 +list-multi := avalanche_led.o
738 +EXTRA_CFLAGS := -I$(TOPDIR)/include/asm/ar7
740 +export-objs := ledmod.o
742 +avalanche_led-objs := ledmod.o
744 +include $(TOPDIR)/Rules.make
746 +avalanche_led.o: $(avalanche_led-objs)
747 + $(LD) -r -o $@ $(avalanche_led-objs)
750 + rm -f core *.o *.a *.s
751 diff -urN linux.old/drivers/char/Config.in linux.dev/drivers/char/Config.in
752 --- linux.old/drivers/char/Config.in 2005-07-10 20:53:55.650624032 +0200
753 +++ linux.dev/drivers/char/Config.in 2005-07-10 20:50:43.556826000 +0200
758 +if [ "$CONFIG_AR7" = "y" ]; then
759 + bool 'Enable LED support' CONFIG_MIPS_AVALANCHE_LED
762 if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then
763 tristate 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232
765 diff -urN linux.old/drivers/char/Makefile linux.dev/drivers/char/Makefile
766 --- linux.old/drivers/char/Makefile 2005-07-10 20:53:55.651623880 +0200
767 +++ linux.dev/drivers/char/Makefile 2005-07-10 20:50:43.556826000 +0200
769 obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP)
773 +# Texas Intruments LED driver
775 +ifeq ($(CONFIG_MIPS_AVALANCHE_LED),y)
776 +obj-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led/avalanche_led.o
777 +subdir-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led
780 +ifeq ($(CONFIG_MIPS_AVALANCHE_LED),m)
781 +obj-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led/avalanche_led.o
782 +subdir-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led
785 obj-$(CONFIG_HIL) += hp_keyb.o
786 obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
787 obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
788 diff -urN linux.old/include/asm-mips/ar7/ledapp.h linux.dev/include/asm-mips/ar7/ledapp.h
789 --- linux.old/include/asm-mips/ar7/ledapp.h 1970-01-01 01:00:00.000000000 +0100
790 +++ linux.dev/include/asm-mips/ar7/ledapp.h 2005-07-10 20:50:43.557826000 +0200
795 +#define CONF_FILE "/etc/led.conf"
796 +#define LED_PROC_FILE "/proc/led_mod/led"
798 +#define CONFIG_LED_MODULE
800 +#define MAX_MOD_ID 25
801 +#define MAX_STATE_ID 25
802 +#define MAX_LED_ID 25
805 +#define DEF_ADSL_IDLE 1
806 +#define DEF_ADSL_TRAINING 2
807 +#define DEF_ADSL_SYNC 3
808 +#define DEF_ADSL_ACTIVITY 4
811 +#define DEF_WAN_IDLE 1
812 +#define DEF_WAN_NEGOTIATE 2
813 +#define DEF_WAN_SESSION 3
816 +#define DEF_LAN_IDLE 1
817 +#define DEF_LAN_LINK_UP 2
818 +#define DEF_LAN_ACTIVITY 3
821 +#define DEF_WLAN_IDLE 1
822 +#define DEF_WLAN_LINK_UP 2
823 +#define DEF_WLAN_ACTIVITY 3
826 +#define DEF_USB_IDLE 1
827 +#define DEF_USB_LINK_UP 2
828 +#define DEF_USB_ACTIVITY 3
831 +#define DEF_ETH_IDLE 1
832 +#define DEF_ETH_LINK_UP 2
833 +#define DEF_ETH_ACTIVITY 3
835 +typedef struct config_elem{
836 + unsigned char name;
837 + unsigned char state;
838 + unsigned char mode;
843 +typedef struct led_reg{
844 + unsigned int param;
845 + void (*init)(unsigned long param);
846 + void (*onfunc)(unsigned long param);
847 + void (*offfunc)(unsigned long param);