#include "gpio.h"
#define DRIVER_NAME "adm6996"
+#define DRIVER_VERSION "0.01"
static int eecs = 2;
static int eesk = 3;
#define adm_write16(cs, w) { __u16 val = hton16(w); adm_write(cs, (__u8 *)&val, sizeof(val)*8); }
#define adm_write32(cs, i) { uint32 val = hton32(i); adm_write(cs, (__u8 *)&val, sizeof(val)*8); }
+#define atoi(str) simple_strtoul(((str != NULL) ? str : ""), NULL, 0)
-extern int getintvar(char **vars, char *name);
+extern char *nvram_get(char *name);
static void adm_write(int cs, char *buf, unsigned int bits)
int ret = 0;
#if defined(BCMGPIO2) || defined(BCMGPIO)
-#ifdef LINUX_2_4
- int boardflags = getintvar(NULL, "boardflags");
-#else
- extern int boardflags;
-#endif
+ int boardflags = atoi(nvram_get("boardflags"));
+
if ((boardflags & 0x80) || force)
ret = 1;
else
#else
ret = 1;
#endif
- if (ret == 1) {
- int i = adm_rreg(0, 0);
- if ((i == 0) || (i == 0xffff)) {
- printk("No ADM6996 chip detected.\n");
- ret = 0;
- }
- }
return ret;
}
{NULL, NULL, NULL}
};
switch_config port[] = {
- {"enabled", handle_port_enable_read, handle_port_enable_write},
+ {"enable", handle_port_enable_read, handle_port_enable_write},
{"media", handle_port_media_read, handle_port_media_write},
{NULL, NULL, NULL}
};
};
switch_driver driver = {
name: DRIVER_NAME,
+ version: DRIVER_VERSION,
interface: "eth0",
ports: 6,
cpuport: 5,