diff -uNr madwifi-orig/driver/if_ath.c madwifi-gpio-proc/driver/if_ath.c
--- madwifi-orig/driver/if_ath.c	2004-05-27 01:39:12.000000000 +0200
+++ madwifi-gpio-proc/driver/if_ath.c	2004-06-03 01:59:53.000000000 +0200
@@ -3329,6 +3354,9 @@
 	ATH_REGDOMAIN	= 8,
 	ATH_XCHANMODE	= 9,
 	ATH_CTLPKT	= 10,
+#ifdef SOFTLED
+	ATH_GPIO	= 11,
+#endif
 };
 static	char ath_dump[12];
 
@@ -3359,6 +3387,52 @@
 	return ret;
 }
 
+#ifdef SOFTLED
+
+#define ATH_GPIO_COUNT 6
+#define ATH_GPIO_READBUF_LEN ATH_GPIO_COUNT*10+1
+static char ath_gpio_strbuf[ATH_GPIO_READBUF_LEN];
+static	int *ath_gpio_intbuf = (int*)ath_gpio_strbuf;
+
+static int
+ath_gpio_sysctl_handler(ctl_table *ctl, int write, struct file *filp,
+	void *buffer, size_t *lenp)
+{
+	struct net_device *dev;
+	struct ath_hal *ah;
+	int ret, i, pos;
+
+	dev = dev_get_by_name("ath0");		/* XXX */
+	if (!dev) {
+		printk("%s: no ath0 device\n", __func__);
+		return EINVAL;
+	}
+	ah = ((struct ath_softc*)dev->priv)->sc_ah;
+	if (write) {
+		ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+		if (ret == 0 &&
+		   ath_gpio_intbuf[0] >= 0 &&
+		   ath_gpio_intbuf[0] <= ATH_GPIO_COUNT &&
+		   (ath_gpio_intbuf[1] & ~1) == 0) {
+			ath_hal_gpioCfgOutput(ah, ath_gpio_intbuf[0]);
+			ath_hal_gpioSet(ah, ath_gpio_intbuf[0], ath_gpio_intbuf[1]);
+		}
+	} else {
+		pos = 0;
+		for (i = 0; i<ATH_GPIO_COUNT; i++) {
+			ath_hal_gpioCfgInput(ah, i);
+			pos += sprintf(ath_gpio_strbuf+pos, "GPIO %i: %i\n", i,
+					ath_hal_gpioGet(ah, i));
+		}
+		*lenp = pos;
+		//printk("debug: %s", ath_gpio_strbuf);
+		ret = proc_dostring(ctl, write, filp, buffer, lenp);
+	}
+	dev_put(dev);
+	return ret;
+}
+#endif /* SOFTLED */
+
 static int
 ath_sysctl_dump(ctl_table *ctl, int write, struct file *filp,
 	void *buffer, size_t *lenp)
@@ -3414,6 +3488,10 @@
 	  sizeof(ath_xchanmode),0444,	NULL,	ath_sysctl_handler },
 	{ ATH_CTLPKT,		"ctlpkt",	&ath_ctlpkt_type,
 	  sizeof(ath_ctlpkt_type),0644, NULL,	ath_sysctl_handler },
+#ifdef SOFTLED
+	{ ATH_GPIO,		"gpio",		&ath_gpio_strbuf,
+	  sizeof(ath_gpio_strbuf),0644, NULL,	ath_gpio_sysctl_handler },
+#endif /* SOFTLED */
 	{ 0 }
 };
 static ctl_table ath_ath_table[] = {
