Porting PicoTCP WIP
This commit is contained in:
36
kernel/netdev/netdev.h
Normal file
36
kernel/netdev/netdev.h
Normal 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_
|
||||
Reference in New Issue
Block a user