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