Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
02fd5db3
Commit
02fd5db3
authored
Mar 21, 2012
by
Grzegorz Daniluk
Committed by
Alessandro Rubini
Mar 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: add missing networking stuff
parent
b9b5f9c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
spec-socket.c
arch-spec/spec-socket.c
+35
-5
No files found.
arch-spec/spec-socket.c
View file @
02fd5db3
...
...
@@ -3,9 +3,11 @@
*/
#include <pptp/pptp.h>
#include "spec.h"
#include "include/gpio.h"
#include "include/syscon.h"
#include<pptp/diag.h>
int
spec_errno
;
Octet
buffer_out
[
PP_PACKET_SIZE
+
14
];
// 14 is ppi->proto_ofst for ethernet mode
/* This function should init the minic and get the mac address */
int
spec_open_ch
(
struct
pp_instance
*
ppi
)
...
...
@@ -13,8 +15,9 @@ int spec_open_ch(struct pp_instance *ppi)
uint8_t
fake_addr
[]
=
{
0x00
,
0x10
,
0x20
,
0x30
,
0x40
,
0x50
};
ep_init
(
fake_addr
);
ep_enable
(
1
,
1
);
ep_enable
(
1
,
0
);
minic_init
();
pps_gen_init
();
memcpy
(
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
addr
,
fake_addr
,
6
);
memcpy
(
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
addr
,
fake_addr
,
6
);
...
...
@@ -27,14 +30,17 @@ int spec_recv_packet(struct pp_instance *ppi, void *pkt, int len,
TimeInternal
*
t
)
{
static
int
led
;
int
got
;
led
^=
1
;
/* blink one led at each rx event */
gpio_out
(
GPIO_PIN_LED_LINK
,
led
);
return
minic_rx_frame
(
pkt
,
pkt
+
14
,
len
-
14
,
NULL
);
got
=
minic_rx_frame
(
pkt
,
pkt
+
14
,
len
-
14
,
NULL
);
pp_printf
(
"%s: got=%d
\n
"
,
__FUNCTION__
,
got
);
return
got
;
}
int
spec_send_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
,
int
chtype
,
int
use_pdelay_addr
)
int
use_pdelay_addr
)
{
static
int
led
;
...
...
@@ -43,8 +49,32 @@ int spec_send_packet(struct pp_instance *ppi, void *pkt, int len, int chtype,
return
minic_tx_frame
(
pkt
,
pkt
+
14
,
len
,
NULL
);
}
int
spec_net_init
(
struct
pp_instance
*
ppi
)
{
uint32_t
i
;
ppi
->
buf_out
=
buffer_out
;
ppi
->
buf_out
=
PROTO_PAYLOAD
(
ppi
->
buf_out
);
//UDP only for now
pp_printf
(
"spec_net_init UDP
\n
"
);
spec_open_ch
(
ppi
);
return
0
;
}
int
spec_net_shutdown
(
struct
pp_instance
*
ppi
)
{
//GGDD
return
0
;
}
int
pp_net_init
(
struct
pp_instance
*
ppi
)
__attribute__
((
alias
(
"spec_net_init"
)));
int
pp_net_shutdown
(
struct
pp_instance
*
ppi
)
__attribute__
((
alias
(
"spec_net_shutdown"
)));
int
pp_recv_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
,
TimeInternal
*
t
)
__attribute__
((
alias
(
"spec_recv_packet"
)));
int
pp_send_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
,
int
chtype
,
int
use_pdelay_addr
)
int
use_pdelay_addr
)
__attribute__
((
alias
(
"spec_send_packet"
)));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment