extern endpoint_t lwip_ep;
void nic_assign_driver(const char * dev_type,
- unsigned dev_num,
+ unsigned int dev_num,
const char * driver_name,
- unsigned instance,
+ unsigned int instance,
int is_default)
{
struct nic * nic;
void nic_init_all(void)
{
int i;
- unsigned g;
+ unsigned int g;
for (i = 0; i < MAX_DEVS; i++) {
devices[i].drv_ep = NONE;
int driver_tx(struct nic * nic)
{
struct packet_q * pkt;
- unsigned len;
+ unsigned int len;
message m;
int err;
struct pbuf *pbuf)
{
struct pbuf * p;
- unsigned rem_len = m->COUNT;
- unsigned written = 0;
+ unsigned int rem_len = m->COUNT;
+ unsigned int written = 0;
int err;
debug_print("user buffer size : %d\n", rem_len);
return 0;
}
-static void nic_pkt_received(struct nic * nic, unsigned size)
+static void nic_pkt_received(struct nic * nic, unsigned int size)
{
assert(nic->netif.input);
struct packet_q {
struct packet_q * next;
- unsigned buf_len;
+ unsigned int buf_len;
char buf[];
};
#define DRV_RECEIVING 2
struct nic {
- unsigned flags;
+ unsigned int flags;
char name[NIC_NAME_LEN];
char drv_name[DRV_NAME_LEN];
endpoint_t drv_ep;
struct packet_q * tx_tail;
void * tx_buffer;
struct netif netif;
- unsigned max_pkt_sz;
- unsigned min_pkt_sz;
+ unsigned int max_pkt_sz;
+ unsigned int min_pkt_sz;
struct socket * raw_socket;
};
static int cfg_fd;
static char word[16];
static unsigned char line[256], *lineptr;
-static unsigned linenr;
+static unsigned int linenr;
static __dead void error(void)
{
while (nextline()) {
token(1);
char drv_name[128];
- unsigned instance;
+ unsigned int instance;
if (strncmp(word, "eth", 3) == 0) {
static int sef_cb_init_fresh(__unused int type, __unused sef_init_info_t *info)
{
int err;
- unsigned hz;
+ unsigned int hz;
char my_name[16];
int my_priv;
/* driver .c */
void nic_assign_driver(const char * dev_type,
- unsigned dev_num,
+ unsigned int dev_num,
const char * driver_name,
- unsigned instance,
+ unsigned int instance,
int is_default);
void nic_init_all(void);
void driver_request(message * m);
struct pbuf *pbuf)
{
struct pbuf * p;
- unsigned rem_len = m->COUNT;
- unsigned written = 0, hdr_sz = 0;
+ unsigned int rem_len = m->COUNT;
+ unsigned int written = 0, hdr_sz = 0;
int err;
debug_print("user buffer size : %d\n", rem_len);
ipopt.nwio_rem = pcb->remote_ip.addr;
ipopt.nwio_flags = sock->usr_flags;
- if ((unsigned) m->COUNT < sizeof(ipopt)) {
+ if ((unsigned int) m->COUNT < sizeof(ipopt)) {
sock_reply(sock, EINVAL);
return;
}
#endif
struct wbuf {
- unsigned len;
- unsigned written;
- unsigned unacked;
- unsigned rem_len;
+ unsigned int len;
+ unsigned int written;
+ unsigned int unacked;
+ unsigned int rem_len;
struct wbuf * next;
char data[];
};
static int read_from_tcp(struct socket * sock, message * m)
{
- unsigned rem_buf, written = 0;
+ unsigned int rem_buf, written = 0;
struct pbuf * p;
assert(!(sock->flags & SOCK_FLG_OP_LISTENING) && sock->recv_head);
}
}
-static struct wbuf * wbuf_add(struct socket * sock, unsigned sz)
+static struct wbuf * wbuf_add(struct socket * sock, unsigned int sz)
{
struct wbuf * wbuf;
struct wbuf_chain * wc = (struct wbuf_chain *)sock->buf;
return wbuf;
}
-static struct wbuf * wbuf_ack_sent(struct socket * sock, unsigned sz)
+static struct wbuf * wbuf_ack_sent(struct socket * sock, unsigned int sz)
{
struct wbuf_chain * wc = (struct wbuf_chain *) sock->buf;
struct wbuf ** wb;
{
int ret;
struct wbuf * wbuf;
- unsigned snd_buf_len, usr_buf_len;
+ unsigned int snd_buf_len, usr_buf_len;
u8_t flgs = 0;
(unsigned int) tconf.nwtc_locaddr);
debug_tcp_print("tconf.nwtc_locport = 0x%x", ntohs(tconf.nwtc_locport));
- if ((unsigned) m->COUNT < sizeof(tconf)) {
+ if ((unsigned int) m->COUNT < sizeof(tconf)) {
sock_reply(sock, EINVAL);
return;
}
struct socket * sock = (struct socket *) arg;
struct wbuf * wbuf;
struct wbuf_chain * wc = (struct wbuf_chain *) sock->buf;
- unsigned snd_buf_len;
+ unsigned int snd_buf_len;
int ret;
debug_tcp_print("socket num %ld", get_sock_num(sock));
wbuf = wc->unsent;
while (wbuf) {
- unsigned towrite;
+ unsigned int towrite;
u8_t flgs = 0;
towrite = (snd_buf_len < wbuf->rem_len ?
struct tcp_pcb * newpcb)
{
struct socket * newsock;
- unsigned sock_num;
+ unsigned int sock_num;
int ret;
debug_tcp_print("socket num %ld", get_sock_num(listen_sock));
static void tcp_op_get_cookie(struct socket * sock, message * m)
{
tcp_cookie_t cookie;
- unsigned sock_num;
+ unsigned int sock_num;
assert(sizeof(cookie) >= sizeof(sock));
assert(pcb);
- if ((unsigned) m->COUNT < sizeof(tcpopt)) {
+ if ((unsigned int) m->COUNT < sizeof(tcpopt)) {
sock_reply(sock, EINVAL);
return;
}
u16_t port)
{
struct pbuf * p;
- unsigned rem_len = m->COUNT;
- unsigned written = 0, hdr_sz = 0;
+ unsigned int rem_len = m->COUNT;
+ unsigned int written = 0, hdr_sz = 0;
int err;
debug_udp_print("user buffer size : %d", rem_len);
debug_udp_print("udpopt.nwuo_locport = 0x%x",
ntohs(udpopt.nwuo_locport));
- if ((unsigned) m->COUNT < sizeof(udpopt)) {
+ if ((unsigned int) m->COUNT < sizeof(udpopt)) {
sock_reply(sock, EINVAL);
return;
}