Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jonathan Currier
litex
Commits
d6cd95d3
Commit
d6cd95d3
authored
Feb 23, 2021
by
Jonathan Currier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add windowing support. this gets us up to ~8KiB/s tranfers speeds!
parent
5717baed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
litex/soc/software/bios/kermit-client.c
litex/soc/software/bios/kermit-client.c
+21
-14
No files found.
litex/soc/software/bios/kermit-client.c
View file @
d6cd95d3
...
...
@@ -100,7 +100,27 @@ static inline int handle_pkt_S(struct mini_kerm_sm *sm, uint8_t * buffer)
/* Error out on non standard ops. this makes the parsing MUCH easier */
if
(
sm
->
line_opts
.
QCTL
!=
'#'
)
return
-
1
;
return
0
;
static
uint8_t
resp
[]
=
"
\x01\0\0
Y
\0
1
\0\0
"
;
static
const
size_t
resp_size
=
sizeof
(
resp
);
resp
[
1
]
=
tochar
(
resp_size
-
2
);
resp
[
2
]
=
buffer
[
2
];
resp
[
4
]
=
tochar
(
94
);
/* capps */
resp
[
13
]
=
tochar
(
2
);
/* window size
* we allow two inback packets at a time*/
resp
[
14
]
=
tochar
(
4
);
/* Adding extended packet length migh be good as well, but it requires changes
* to both checksuming, and packet length detect, where as windowing only require
* advertising support.*/
/* Again, note that this stomps the 'null' terminator, because this is not a c-string */
resp
[
resp_size
-
1
]
=
gen_ori_check
(
resp
);
size_t
i
=
0
;
sendbyte
(
-
1
,
'\n'
);
for
(
i
=
0
;
i
<
resp_size
;
i
++
)
sendbyte
(
-
1
,
resp
[
i
]);
sendbyte
(
-
1
,
'\n'
);
}
/* The 'F' packet is a no-op.
...
...
@@ -183,7 +203,6 @@ static inline int handle_pkt_D(struct mini_kerm_sm *sm, uint8_t * buffer)
}
bool
kermit_valid_packet
(
uint8_t
*
buffer
,
size_t
len
);
//static int kermit_get_file(struct mini_kerm_sm *sm, uint8_t *buffer, size_t buffer_index)
static
int
kermit_get_file
(
struct
mini_kerm_sm
*
sm
,
uint8_t
mark
)
{
/*
...
...
@@ -193,17 +212,11 @@ static int kermit_get_file(struct mini_kerm_sm *sm, uint8_t mark)
* 1 = the handler took care of any needed resonse
*/
int
success
=
-
1
;
#if 0
bool have_whole_pkt = kermit_valid_packet(buffer, buffer_index);
if (have_whole_pkt)
goto whole_pkt_start;
#else
uint8_t
*
buffer
=
sm
->
pkt_buffer
;
size_t
buffer_index
=
0
;
bool
have_whole_pkt
=
false
;
if
(
mark
==
1
)
buffer
[
buffer_index
++
]
=
mark
;
#endif
while
(
true
)
{
...
...
@@ -225,11 +238,6 @@ static int kermit_get_file(struct mini_kerm_sm *sm, uint8_t mark)
if
(
!
check_pkt
(
buffer
))
buffer
[
3
]
=
0
;
#if 0
whole_pkt_start:
printf("found packet len/seq/type %02x/%02x/%c\n",
unchar(buffer[1]), unchar(buffer[2]), buffer[3]);
#endif
switch
(
buffer
[
3
])
{
case
'S'
:
...
...
@@ -369,7 +377,6 @@ int kermit_maybe(uint8_t mark)
if
(
mark
!=
1
)
return
-
1
;
struct
mini_kerm_sm
*
sm
=
init_kermit_sm
();
//printf("Placing output buffer @0x%p\n", sm->outbuffer_base);
/* boot should'nt return */
if
(
!
kermit_get_file
(
sm
,
mark
))
boot
(
0
,
0
,
0
,
sm
->
outbuffer_base
);
...
...
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