11 #include <cdi/lists.h> 16 #include "cdi-osdep.h" 18 #include "pedigree/kernel/compiler.h" 19 #include "pedigree/kernel/processor/types.h" 21 static unsigned long netcard_highest_id = 0;
22 static cdi_list_t netcard_list;
24 static cdi_list_t ethernet_packet_receivers;
26 static bool bListsDefined =
false;
28 typedef unsigned long dword;
32 void cdi_cpp_net_register(
void* void_pdev,
struct cdi_net_device* dev);
33 struct cdi_net_device* cdi_net_get_device(
int num);
48 driver->drv.type = CDI_NETWORK;
49 cdi_driver_init(reinterpret_cast<struct cdi_driver*>(driver));
53 netcard_list = cdi_list_create();
54 ethernet_packet_receivers = cdi_list_create();
65 EXPORTED_PUBLIC void cdi_net_driver_destroy(
struct cdi_net_driver* driver)
67 cdi_driver_destroy(reinterpret_cast<struct cdi_driver*>(driver));
75 device->number = netcard_highest_id;
78 cdi_list_push(netcard_list, device);
82 cdi_device_type_t type = device->dev.bus_data->bus_type;
85 pDev =
reinterpret_cast<struct cdi_pci_device*
>(device->dev.bus_data)->meta.backdev;
89 cdi_cpp_net_register(pDev, device);
100 for (
size_t i = 0; i < cdi_list_size(netcard_list); i++)
102 struct cdi_net_device *device =
reinterpret_cast<struct cdi_net_device*
>(cdi_list_get(netcard_list, i));
103 if (device->number == num)