[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH 2/5] sis900: tyndur-spezifische Sachen in #ifdef
! sis900: tyndur-spezifische Sachen muessen in #ifdef stehen, damit
andere Systeme den Treiber 1:1 benutzern koennen.
Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
src/modules/cdi/sis900/device.c | 10 +++++++++-
src/modules/cdi/sis900/main.c | 14 +++++++++++---
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/modules/cdi/sis900/device.c b/src/modules/cdi/sis900/device.c
index 40b32fa..fd433f1 100644
--- a/src/modules/cdi/sis900/device.c
+++ b/src/modules/cdi/sis900/device.c
@@ -29,7 +29,6 @@
#include <stdint.h>
#include <stdio.h>
#include <stddef.h>
-#include <syscall.h>
#include "cdi.h"
#include "cdi/misc.h"
@@ -37,6 +36,11 @@
#include "device.h"
#include "sis900_io.h"
+#ifdef TYNDUR
+#include <syscall.h>
+#endif
+
+
#undef DEBUG
#define PHYS(netcard, field) \
@@ -272,9 +276,13 @@ void sis900_send_packet(struct cdi_net_device* device, void* data, size_t size)
// Warten, bis das Paket gesendet ist
// FIXME: Nicht portabel
+#ifdef TYNDUR
qword timeout = get_tick_count() + 500000;
while ((netcard->tx_desc[cur].status & DESC_STATUS_OWN)
&& (get_tick_count() < timeout));
+#else
+ while (netcard->tx_desc[cur].status & DESC_STATUS_OWN);
+#endif
#ifdef DEBUG
if (netcard->tx_desc[cur].status & DESC_STATUS_OWN) {
diff --git a/src/modules/cdi/sis900/main.c b/src/modules/cdi/sis900/main.c
index 5ebcf04..88bc2f0 100644
--- a/src/modules/cdi/sis900/main.c
+++ b/src/modules/cdi/sis900/main.c
@@ -41,8 +41,10 @@ struct module_options {
uint32_t ip;
};
-// FIXME: LOST-spezifisch
+#ifdef TYNDUR
uint32_t string_to_ip(char* ip);
+#endif
+
static void process_parameter(struct module_options* options, char* param);
struct sis900_driver {
@@ -68,7 +70,7 @@ int init_sis900(int argc, char* argv[])
#ifdef CDI_STANDALONE
cdi_run_drivers();
-#endif
+#endif
return 0;
}
@@ -94,12 +96,14 @@ static void sis900_driver_init(int argc, char* argv[])
driver.net.drv.destroy = sis900_driver_destroy;
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();
@@ -117,7 +121,9 @@ 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);
@@ -130,6 +136,7 @@ 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);
@@ -142,6 +149,7 @@ static void process_parameter(struct module_options* options, char* param)
printf("Unbekannter Parameter %s\n", param);
}
}
+#endif
/**
* Deinitialisiert die Datenstrukturen fuer den sis900-Treiber
--
1.6.0.2