Network drivers are built based on CONFIGs
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 6 Jun 2013 01:14:09 +0000 (18:14 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 6 Jun 2013 19:05:21 +0000 (12:05 -0700)
Also realigns the obj-X entries in Kbuild so we have room for most CONFIG_FOO
variables.

Kconfig
kern/arch/i686/Kbuild
kern/arch/i686/init.c
kern/arch/riscv/Kbuild
kern/arch/sparc/Kbuild
kern/src/Kbuild
kern/src/net/Kbuild

diff --git a/Kconfig b/Kconfig
index b67c9dd..5049963 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -43,21 +43,27 @@ config E1000_ON_S142
 
 endif # E1000
 
 
 endif # E1000
 
-# Mostly just a placeholder.  These options do nothing.
-config REALTEK8168
+config RL8168
        depends on NETWORKING && X86
        bool "Realtek 8168"
        default n
        help
        depends on NETWORKING && X86
        bool "Realtek 8168"
        default n
        help
-               Buggy realtek driver.  Use at your own risk.  This CONFIG option
-               actually does nothing; the code is built regardless.
+               Buggy realtek driver.  Use at your own risk.
+
+config NE2K
+       depends on NETWORKING && X86
+       bool "NE2000"
+       default n
+       help
+               Buggy NE2000 driver.  Use at your own risk.
 
 config ETH_AUDIO
        depends on NETWORKING && X86
        bool "Ethernet audio"
        default n
        help
 
 config ETH_AUDIO
        depends on NETWORKING && X86
        bool "Ethernet audio"
        default n
        help
-               Build old support for David Wessel's ethernet audio device.
+               Build old support for David Wessel's ethernet audio device.  This is
+               less a driver than a NIC-level "intercept".
 
 endmenu
 
 
 endmenu
 
index fcdb59d..05a5493 100644 (file)
@@ -1,26 +1,27 @@
-obj-y                          += apic.o
-obj-y                          += colored_caches.o
-obj-y                          += console.o
-obj-y                          += cpuinfo.o
-obj-y                          += e1000.o
-obj-y                          += entry.o
-obj-y                          += env.o
-obj-y                          += frontend.o
-obj-y                          += init.o
-obj-y                          += ioapic.o
-obj-y                          += kclock.o
-obj-y                          += kdebug.o
-obj-y                          += mptables.o
-obj-y                          += ne2k.o
-obj-y                          += page_alloc.o
-obj-y                          += pci.o
-obj-y                          += perfmon.o
-obj-y                          += pmap.o
-obj-y                          += process.o
-obj-y                          += rdtsc_test.o
-obj-y                          += rl8168.o
-obj-y                          += smp.o
-obj-y                          += smp_boot.o
-obj-y                          += smp_entry.o
-obj-y                          += trap.o
-obj-y                          += trapentry.o
+obj-$(CONFIG_E1000)                    += e1000.o
+obj-$(CONFIG_NE2K)                     += ne2k.o
+obj-$(CONFIG_RL8168)           += rl8168.o
+
+obj-y                                          += apic.o
+obj-y                                          += colored_caches.o
+obj-y                                          += console.o
+obj-y                                          += cpuinfo.o
+obj-y                                          += entry.o
+obj-y                                          += env.o
+obj-y                                          += frontend.o
+obj-y                                          += init.o
+obj-y                                          += ioapic.o
+obj-y                                          += kclock.o
+obj-y                                          += kdebug.o
+obj-y                                          += mptables.o
+obj-y                                          += page_alloc.o
+obj-y                                          += pci.o
+obj-y                                          += perfmon.o
+obj-y                                          += pmap.o
+obj-y                                          += process.o
+obj-y                                          += rdtsc_test.o
+obj-y                                          += smp.o
+obj-y                                          += smp_boot.o
+obj-y                                          += smp_entry.o
+obj-y                                          += trap.o
+obj-y                                          += trapentry.o
index adc7cad..6c2ecee 100644 (file)
@@ -92,9 +92,17 @@ void arch_init()
        #ifdef CONFIG_SINGLE_CORE
                warn("You currently can't have networking if you boot into single core mode!!\n");
        #else
        #ifdef CONFIG_SINGLE_CORE
                warn("You currently can't have networking if you boot into single core mode!!\n");
        #else
+               /* TODO: need to call these init methods when we detect the devices, not
+                * the other way around */
+               #ifdef CONFIG_RL8168
                rl8168_init();          
                rl8168_init();          
+               #endif
+               #ifdef CONFIG_NE2K
                ne2k_init();
                ne2k_init();
+               #endif
+               #ifdef CONFIG_E1000
                e1000_init();
                e1000_init();
+               #endif
        #endif // CONFIG_SINGLE_CORE
        #endif // CONFIG_NETWORKING
 
        #endif // CONFIG_SINGLE_CORE
        #endif // CONFIG_NETWORKING
 
index bdb309c..f232284 100644 (file)
@@ -1,17 +1,17 @@
-obj-y                          += boot.o
-obj-y                          += cboot.o
-obj-y                          += colored_caches.o
-obj-y                          += console.o
-obj-y                          += cpuinfo.o
-obj-y                          += entry.o
-obj-y                          += env.o
-obj-y                          += fpu.o
-obj-y                          += init.o
-obj-y                          += kdebug.o
-obj-y                          += page_alloc.o
-obj-y                          += pmap.o
-obj-y                          += process.o
-obj-y                          += smp.o
-obj-y                          += softfloat.o
-obj-y                          += time.o
-obj-y                          += trap.o
+obj-y                                          += boot.o
+obj-y                                          += cboot.o
+obj-y                                          += colored_caches.o
+obj-y                                          += console.o
+obj-y                                          += cpuinfo.o
+obj-y                                          += entry.o
+obj-y                                          += env.o
+obj-y                                          += fpu.o
+obj-y                                          += init.o
+obj-y                                          += kdebug.o
+obj-y                                          += page_alloc.o
+obj-y                                          += pmap.o
+obj-y                                          += process.o
+obj-y                                          += smp.o
+obj-y                                          += softfloat.o
+obj-y                                          += time.o
+obj-y                                          += trap.o
index c364fa3..df24785 100644 (file)
@@ -1,23 +1,23 @@
-obj-y                          += boot.o
-obj-y                          += colored_caches.o
-obj-y                          += console.o
-obj-y                          += cpuinfo.o
-obj-y                          += entry.o
-obj-y                          += env.o
-obj-y                          += fpu.o
-obj-y                          += init.o
-obj-y                          += kdebug.o
-obj-y                          += page_alloc.o
-obj-y                          += pmap.o
-obj-y                          += process.o
-obj-y                          += recip.o
-obj-y                          += smp.o
-obj-y                          += softfloat.o
-obj-y                          += sparc.h
-obj-y                          += sparcfpu.o
-obj-y                          += spillfill.o
-obj-y                          += time.o
-obj-y                          += trap.o
-obj-y                          += trap.h
-obj-y                          += trap_entry.o
-obj-y                          += trap_table.o
+obj-y                                          += boot.o
+obj-y                                          += colored_caches.o
+obj-y                                          += console.o
+obj-y                                          += cpuinfo.o
+obj-y                                          += entry.o
+obj-y                                          += env.o
+obj-y                                          += fpu.o
+obj-y                                          += init.o
+obj-y                                          += kdebug.o
+obj-y                                          += page_alloc.o
+obj-y                                          += pmap.o
+obj-y                                          += process.o
+obj-y                                          += recip.o
+obj-y                                          += smp.o
+obj-y                                          += softfloat.o
+obj-y                                          += sparc.h
+obj-y                                          += sparcfpu.o
+obj-y                                          += spillfill.o
+obj-y                                          += time.o
+obj-y                                          += trap.o
+obj-y                                          += trap.h
+obj-y                                          += trap_entry.o
+obj-y                                          += trap_table.o
index 4559db9..efe585f 100644 (file)
@@ -1,47 +1,48 @@
-obj-y                          += alarm.o
-obj-y                          += arsc.o
-obj-y                          += atomic.o
-obj-y                          += blockdev.o
-obj-y                          += colored_caches.o
-obj-y                          += console.o
-obj-y                          += devfs.o
-obj-y                          += elf.o
-obj-y                          += env.o
-obj-y                          += eth_audio.o
-obj-y                          += event.o
-obj-y                          += ext2fs.o
-obj-y                          += frontend.o
-obj-y                          += hashtable.o
-obj-y                          += init.o
-obj-y                          += kdebug.o
-obj-y                          += kfs.o
-obj-y                          += kmalloc.o
-obj-y                          += kthread.o
-obj-y                          += manager.o
-obj-y                          += mm.o
-obj-y                          += monitor.o
-obj-y                          += multiboot.o
-obj-y                          += net/
-obj-y                          += net.o
-obj-y                          += page_alloc.o
-obj-y                          += pagemap.o
-obj-y                          += pmap.o
-obj-y                          += printf.o
-obj-y                          += printfmt.o
-obj-y                          += process.o
-obj-y                          += radix.o
-obj-y                          += readline.o
-obj-y                          += schedule.o
-obj-y                          += slab.o
-obj-y                          += smp.o
-obj-y                          += socket.o
-obj-y                          += string.o
-obj-y                          += syscall.o
-obj-y                          += sysevent.o
-obj-y                          += testing.o
-obj-y                          += time.o
-obj-y                          += trap.o
-obj-y                          += ucq.o
-obj-y                          += umem.o
-obj-y                          += vfs.o
+obj-$(CONFIG_ETH_AUDIO)                += eth_audio.o
+
+obj-y                                          += alarm.o
+obj-y                                          += arsc.o
+obj-y                                          += atomic.o
+obj-y                                          += blockdev.o
+obj-y                                          += colored_caches.o
+obj-y                                          += console.o
+obj-y                                          += devfs.o
+obj-y                                          += elf.o
+obj-y                                          += env.o
+obj-y                                          += event.o
+obj-y                                          += ext2fs.o
+obj-y                                          += frontend.o
+obj-y                                          += hashtable.o
+obj-y                                          += init.o
+obj-y                                          += kdebug.o
+obj-y                                          += kfs.o
+obj-y                                          += kmalloc.o
+obj-y                                          += kthread.o
+obj-y                                          += manager.o
+obj-y                                          += mm.o
+obj-y                                          += monitor.o
+obj-y                                          += multiboot.o
+obj-y                                          += net/
+obj-y                                          += net.o
+obj-y                                          += page_alloc.o
+obj-y                                          += pagemap.o
+obj-y                                          += pmap.o
+obj-y                                          += printf.o
+obj-y                                          += printfmt.o
+obj-y                                          += process.o
+obj-y                                          += radix.o
+obj-y                                          += readline.o
+obj-y                                          += schedule.o
+obj-y                                          += slab.o
+obj-y                                          += smp.o
+obj-y                                          += socket.o
+obj-y                                          += string.o
+obj-y                                          += syscall.o
+obj-y                                          += sysevent.o
+obj-y                                          += testing.o
+obj-y                                          += time.o
+obj-y                                          += trap.o
+obj-y                                          += ucq.o
+obj-y                                          += umem.o
+obj-y                                          += vfs.o
 
 
index cc1167a..12f72d1 100644 (file)
@@ -1,8 +1,8 @@
-obj-y                          += ip.o
-obj-y                          += nic_common.o
-obj-y                          += pbuf.o
-obj-y                          += tcp.o
-obj-y                          += tcp_in.o
-obj-y                          += tcp_out.o
-obj-y                          += timers.o
-obj-y                          += udp.o
+obj-y                                          += ip.o
+obj-y                                          += nic_common.o
+obj-y                                          += pbuf.o
+obj-y                                          += tcp.o
+obj-y                                          += tcp_in.o
+obj-y                                          += tcp_out.o
+obj-y                                          += timers.o
+obj-y                                          += udp.o