Skip to content

Commit c7a5ec9

Browse files
author
whitequark
committedJul 8, 2016
runtime: update ppp code for lwip 2.0.0.
Fixes #499.
1 parent 375e821 commit c7a5ec9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed
 

‎artiq/runtime/main.c

+8-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#else
2323
#include <netif/ppp/ppp.h>
2424
#include <netif/ppp/pppos.h>
25-
#include <lwip/sio.h>
2625
#endif
2726

2827
#include "bridge_ctl.h"
@@ -149,6 +148,13 @@ static void network_init(void)
149148

150149
static int ppp_connected;
151150

151+
static u32_t ppp_output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
152+
{
153+
for(int i = 0; i < len; i++)
154+
uart_write(data[i]);
155+
return len;
156+
}
157+
152158
static void ppp_status_cb(ppp_pcb *pcb, int err_code, void *ctx)
153159
{
154160
if (err_code == PPPERR_NONE) {
@@ -161,21 +167,12 @@ static void ppp_status_cb(ppp_pcb *pcb, int err_code, void *ctx)
161167
}
162168
}
163169

164-
u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len)
165-
{
166-
int i;
167-
168-
for(i=0;i<len;i++)
169-
uart_write(data[i]);
170-
return len;
171-
}
172-
173170
static void network_init(void)
174171
{
175172
lwip_init();
176173

177174
ppp_connected = 0;
178-
ppp = pppos_create(&netif, NULL, ppp_status_cb, NULL);
175+
ppp = pppos_create(&netif, ppp_output_cb, ppp_status_cb, NULL);
179176
ppp_set_auth(ppp, PPPAUTHTYPE_NONE, "", "");
180177
ppp_set_default(ppp);
181178
ppp_connect(ppp, 0);

0 commit comments

Comments
 (0)
Please sign in to comment.