Exemplo n.º 1
0
int dev_bootstrap(void)
{
	rtl8139 *rtl;

	dprintf("rtl8139_dev_init: entry\n");

	// detect and setup the device
	if(rtl8139_detect(&rtl) < 0) {
		// no rtl8139 here
		dprintf("rtl8139_dev_init: no device found\n");
		return ERR_GENERAL;
	}

	rtl8139_init(rtl);

	// create device node
	devfs_publish_indexed_device("net/rtl8139", rtl, &rtl8139_hooks);

	return 0;
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
	rtl8139 *rtl;
	int fd;
	

	// detect and setup the device
	if(rtl8139_detect(&rtl) < 0) {
		// no rtl8139 here
		printf("%s","rtl8139_dev_init: no device found\n");
		return 0;
	}
	
	rtl8139_init(rtl);

//	fd = sys_open("/dev/net/rtl8139/0", "", STREAM_TYPE_DEVICE);
//	if(fd < 0) {
//		panic("rtl8139_dev_init: could not open %s\n", "/dev/net/rtl8139/0");
//	}
//	sys_ioctl(fd, 87912, (void *)rtl, 4);
//	sys_close(fd);
	return 0;
}