static int __init robo_init(void) { int notfound = 1; char *device; device = strdup("ethX"); for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) { if (! switch_device_registered (device)) notfound = robo_probe(device); } device[3]--; if (notfound) { kfree(device); return -ENODEV; } else { static const switch_config cfg[] = { { .name = "enable", .read = handle_enable_read, .write = handle_enable_write }, { .name = "enable_vlan", .read = handle_enable_vlan_read, .write = handle_enable_vlan_write }, { .name = "reset",
static int __init robo_init() { char *device = "ethX"; int notfound = 1; for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) { notfound = robo_probe(device); } if (notfound) return -ENODEV; else { switch_config vlan[] = { {"ports", handle_vlan_port_read, handle_vlan_port_write}, {NULL, NULL, NULL} }; switch_driver driver = { name: DRIVER_NAME, ports: max_ports, vlans: max_vlans, driver_handlers: NULL, port_handlers: NULL, vlan_handlers: vlan, }; return switch_register_driver(&driver); } }
static int __init robo_init() { int notfound = 1; device = strdup("ethX"); for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) { notfound = robo_probe(device); } device[3]--; if (notfound) { kfree(device); return -ENODEV; } else { switch_config cfg[] = { {"enable", handle_enable_read, handle_enable_write}, {"enable_vlan", handle_enable_vlan_read, handle_enable_vlan_write}, {"reset", NULL, handle_reset}, {NULL, NULL, NULL} }; switch_config vlan[] = { {"ports", handle_vlan_port_read, handle_vlan_port_write}, {NULL, NULL, NULL} }; switch_driver driver = { name: DRIVER_NAME, version: DRIVER_VERSION, interface: device, cpuport: 5, ports: 6, vlans: 16, driver_handlers: cfg, port_handlers: NULL, vlan_handlers: vlan, }; return switch_register_driver(&driver); } }