[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH 3/3] cdi: ip-Kommandozeilenparameter in Netzwerktreibern entfernt



- cdi: ip-Kommandozeilenparameter in Netzwerktreibern entfernt

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/cdi/include/cdi/net.h |    3 --
 src/modules/cdi/pcnet/main.c      |   38 +-------------------------------
 src/modules/cdi/rtl8139/main.c    |   38 +-------------------------------
 src/modules/cdi/sis900/main.c     |   44 +------------------------------------
 4 files changed, 3 insertions(+), 120 deletions(-)

diff --git a/src/modules/cdi/include/cdi/net.h b/src/modules/cdi/include/cdi/net.h
index f8ff6d2..89628bd 100644
--- a/src/modules/cdi/include/cdi/net.h
+++ b/src/modules/cdi/include/cdi/net.h
@@ -29,9 +29,6 @@ struct cdi_net_device {
 
     void (*send_packet)
         (struct cdi_net_device* device, void* data, size_t size);
-
-    // LOST-spezifisch
-    uint32_t            ip;
 };
 
 struct cdi_net_driver {
diff --git a/src/modules/cdi/pcnet/main.c b/src/modules/cdi/pcnet/main.c
index d8a77f6..04711ae 100644
--- a/src/modules/cdi/pcnet/main.c
+++ b/src/modules/cdi/pcnet/main.c
@@ -52,12 +52,6 @@ static struct {
 
 static const char* driver_name = "pcnet";
 
-#ifdef TYNDUR
-// FIXME: LOST-spezifisch
-uint32_t string_to_ip(char* ip);
-#endif
-
-static void process_parameter(struct module_options* options, char* param);
 static int pcnet_driver_init(int argc, char* argv[]);
 static void pcnet_driver_destroy(struct cdi_driver* driver);
 
@@ -81,12 +75,6 @@ int init_pcnet(int argc, char* argv[])
 
 static int pcnet_driver_init(int argc, char* argv[])
 {
-    struct module_options options = {
-        // TODO Auf 0 setzen und am Ende pr�fen und ggf. einfach was
-        // freies suchen
-        .ip = 0x0b01a8c0
-    };
-
     // TODO Auf pci-Service warten
     // TODO Auf tcpip-Service warten
 
@@ -101,17 +89,12 @@ static int pcnet_driver_init(int argc, char* argv[])
     driver.net.drv.init_device     = pcnet_init_device;
     driver.net.drv.remove_device   = pcnet_remove_device;
 
-    // Parameter verarbeiten
-    int i;
-    for (i = 1; i < argc; i++) {
-        process_parameter(&options, argv[i]);
-    }
-
     // Passende PCI-Geraete suchen
     cdi_list_t pci_devices = cdi_list_create();
     cdi_pci_get_all_devices(pci_devices);
 
     struct cdi_pci_device* dev;
+    int i;
     for (i = 0; (dev = cdi_list_get(pci_devices, i)); i++) {
         if ((dev->vendor_id == VENDOR_ID) && (dev->device_id == DEVICE_ID)) {
             struct pcnet_device* device;
@@ -120,9 +103,6 @@ static int pcnet_driver_init(int argc, char* argv[])
             memset(device, 0, sizeof(struct pcnet_device));
 
             device->pci = dev;
-#ifdef TYNDUR
-            device->net.ip = options.ip;
-#endif
             cdi_list_push(driver.net.drv.devices, device);
         } else {
             cdi_pci_device_destroy(dev);
@@ -134,22 +114,6 @@ static int pcnet_driver_init(int argc, char* argv[])
     return 0;
 }
 
-
-static void process_parameter(struct module_options* options, char* param)
-{
-#ifdef TYNDUR
-    printf("pcnet-Parameter: %s\n", param);
-
-    if (strncmp(param, "ip=", 3) == 0) {
-        uint32_t ip = string_to_ip(&param[3]);
-        printf("IP-Adresse: %08x\n", ip);
-        options->ip = ip;
-    } else {
-        printf("Unbekannter Parameter %s\n", param);
-    }
-#endif
-}
-
 /**
  * Deinitialisiert die Datenstrukturen fuer den pcnet-Treiber
  */
diff --git a/src/modules/cdi/rtl8139/main.c b/src/modules/cdi/rtl8139/main.c
index 4411a1f..46cd918 100644
--- a/src/modules/cdi/rtl8139/main.c
+++ b/src/modules/cdi/rtl8139/main.c
@@ -44,12 +44,6 @@ static struct {
 
 static const char* driver_name = "rtl8139";
 
-#ifdef TYNDUR
-// FIXME: tyndur-spezifisch
-uint32_t string_to_ip(char* ip);
-#endif
-
-static void process_parameter(struct module_options* options, char* param);
 static int rtl8139_driver_init(int argc, char* argv[]);
 static void rtl8139_driver_destroy(struct cdi_driver* driver);
 
@@ -73,12 +67,6 @@ int init_rtl8139(int argc, char* argv[])
 
 static int rtl8139_driver_init(int argc, char* argv[])
 {
-    struct module_options options = {
-        // TODO Auf 0 setzen und am Ende prüfen und ggf. einfach was
-        // freies suchen
-        .ip = 0x0b01a8c0
-    };
-
     // TODO Auf pci-Service warten
     // TODO Auf tcpip-Service warten
 
@@ -93,17 +81,12 @@ static int rtl8139_driver_init(int argc, char* argv[])
     driver.net.drv.init_device     = rtl8139_init_device;
     driver.net.drv.remove_device   = rtl8139_remove_device;
 
-    // Parameter verarbeiten
-    int i;
-    for (i = 1; i < argc; i++) {
-        process_parameter(&options, argv[i]);
-    }
-
     // Passende PCI-Geraete suchen
     cdi_list_t pci_devices = cdi_list_create();
     cdi_pci_get_all_devices(pci_devices);
 
     struct cdi_pci_device* dev;
+    int i;
     for (i = 0; (dev = cdi_list_get(pci_devices, i)); i++) {
         if ((dev->vendor_id == 0x10ec) && (dev->device_id == 0x8139)) {
             void* phys_device;
@@ -115,9 +98,6 @@ static int rtl8139_driver_init(int argc, char* argv[])
 
             device->phys = phys_device;
             device->pci = dev;
-#ifdef TYNDUR
-            device->net.ip = options.ip;
-#endif
             cdi_list_push(driver.net.drv.devices, device);
         } else {
             cdi_pci_device_destroy(dev);
@@ -129,22 +109,6 @@ static int rtl8139_driver_init(int argc, char* argv[])
     return 0;
 }
 
-
-static void process_parameter(struct module_options* options, char* param)
-{
-#ifdef TYNDUR
-    printf("rtl8139-Parameter: %s\n", param);
-
-    if (strncmp(param, "ip=", 3) == 0) {
-        uint32_t ip = string_to_ip(&param[3]);
-        printf("IP-Adresse: %08x\n", ip);
-        options->ip = ip;
-    } else {
-        printf("Unbekannter Parameter %s\n", param);
-    }
-#endif
-}
-
 /**
  * Deinitialisiert die Datenstrukturen fuer den rtl8139-Treiber
  */
diff --git a/src/modules/cdi/sis900/main.c b/src/modules/cdi/sis900/main.c
index 88bc2f0..aaaf996 100644
--- a/src/modules/cdi/sis900/main.c
+++ b/src/modules/cdi/sis900/main.c
@@ -36,17 +36,6 @@
 
 #include "device.h"
 
-
-struct module_options {
-    uint32_t ip;
-};
-
-#ifdef TYNDUR
-uint32_t string_to_ip(char* ip);
-#endif
-
-static void process_parameter(struct module_options* options, char* param);
-
 struct sis900_driver {
     struct cdi_net_driver net;
 };
@@ -80,12 +69,6 @@ int init_sis900(int argc, char* argv[])
  */
 static void sis900_driver_init(int argc, char* argv[])
 {
-    struct module_options options = {
-        // TODO Auf 0 setzen und am Ende prüfen und ggf. einfach was
-        // freies suchen
-        .ip = 0x0b01a8c0
-    };
-
     // Konstruktor der Vaterklasse
     cdi_net_driver_init((struct cdi_net_driver*) &driver);
     
@@ -97,19 +80,12 @@ static void sis900_driver_init(int argc, char* argv[])
     driver.net.drv.init_device     = sis900_init_device;
     driver.net.drv.remove_device   = sis900_remove_device;
 
-    // Parameter verarbeiten
-    int i;
-#ifdef TYNDUR
-    for (i = 1; i < argc; i++) {
-        process_parameter(&options, argv[i]);
-    }
-#endif
-
     // Passende PCI-Geraete suchen
     cdi_list_t pci_devices = cdi_list_create();
     cdi_pci_get_all_devices(pci_devices);
 
     struct cdi_pci_device* dev;
+    int i;
     for (i = 0; (dev = cdi_list_get(pci_devices, i)); i++) {
         if ((dev->vendor_id == 0x1039) && (dev->device_id == 0x0900)) {
             void* phys_device;
@@ -121,9 +97,6 @@ static void sis900_driver_init(int argc, char* argv[])
 
             device->phys = phys_device;
             device->pci = dev;
-#ifdef TYNDUR
-            device->net.ip = options.ip;
-#endif
             cdi_list_push(driver.net.drv.devices, device);
         } else {
             cdi_pci_device_destroy(dev);
@@ -136,21 +109,6 @@ static void sis900_driver_init(int argc, char* argv[])
     cdi_list_destroy(pci_devices);
 }
 
-#ifdef TYNDUR
-static void process_parameter(struct module_options* options, char* param)
-{
-    printf("sis900-Parameter: %s\n", param);
-
-    if (strncmp(param, "ip=", 3) == 0) {
-        uint32_t ip = string_to_ip(&param[3]);
-        printf("IP-Adresse: %08x\n", ip);
-        options->ip = ip;
-    } else {
-        printf("Unbekannter Parameter %s\n", param);
-    }
-}
-#endif
-
 /**
  * Deinitialisiert die Datenstrukturen fuer den sis900-Treiber
  */
-- 
1.5.6.5