broadcom-diag: support for the WNDR3700v3
[openwrt/openwrt.git] / package / broadcom-diag / src / diag.h
index af30823aae1b2a0975eeea11cfd3cc06146975b2..d9b5b006fe8399ebf03b874c4c68dc885890930c 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id:$
  */
 
+#include <linux/irq.h>
 #define MODULE_NAME "diag"
 
-#define MAX_GPIO 8
+#define MAX_GPIO 16
 #define FLASH_TIME HZ/6
 
 enum polarity_t {
        REVERSE = 0,
        NORMAL = 1,
+       INPUT = 2,
 };
 
 enum {
@@ -73,9 +74,16 @@ struct platform_t {
 
 struct event_t {
        struct work_struct wq;
-       char buf[256];
-       char *argv[3];
-       char *envp[6];
+       unsigned long seen;
+       char *name, *action;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+       struct sk_buff *skb;
+#else
+       char *scratch;
+       char *argv[4];
+       char *envp[7];
+       u8 enr, anr;
+#endif
 };
 
 extern char *nvram_get(char *str);
@@ -87,8 +95,8 @@ static struct platform_t platform;
 static void register_buttons(struct button_t *b);
 static void unregister_buttons(struct button_t *b);
 
-static void hotplug_button(struct event_t *event);
-static irqreturn_t button_handler(int irq, void *dev_id, struct pt_regs *regs);
+static void hotplug_button(struct work_struct *work);
+static irqreturn_t button_handler(int irq, void *dev_id);
 
 /* leds */
 
@@ -96,6 +104,7 @@ static void register_leds(struct led_t *l);
 static void unregister_leds(struct led_t *l);
 
 static void set_led_extif(struct led_t *led);
+static void set_led_shift(struct led_t *led);
 static void led_flash(unsigned long dummy);
 
 /* 2.4 compatibility */