Porting PicoTCP WIP

This commit is contained in:
2025-10-29 14:29:06 +01:00
parent 6722f42e68
commit 815c2239fe
464 changed files with 235009 additions and 24 deletions

36
kernel/netdev/netdev.h Normal file
View File

@ -0,0 +1,36 @@
#ifndef NETDEV_NETDEV_H_
#define NETDEV_NETDEV_H_
#include <stdint.h>
#include <stddef.h>
#include "spinlock/spinlock.h"
#include "compiler/attr.h"
#include "pico_device.h"
#include "pico_ipv4.h"
enum {
NETDEV_LOOPBACK,
};
#define NETDEV_MAGIC 0xB00B
typedef struct NetDev {
struct pico_device *picodev;
uint32_t _magic;
struct NetDev *next;
SpinLock spinlock;
struct pico_ip4 ipaddr4, netmask4;
} NetDev;
typedef struct {
NetDev *head;
SpinLock spinlock;
} NetDevList;
extern NetDevList NETDEV_LIST;
void netdev_init(void);
NetDev *netdev_create(int32_t ndtype, const char *ipaddrstring, const char *netmaskstring);
#endif // NETDEV_NETDEV_H_