* Using net/wan/hdlc with serdev
@ 2023-08-03 15:24 Ayush Singh
2023-08-10 19:10 ` Ayush Singh
0 siblings, 1 reply; 3+ messages in thread
From: Ayush Singh @ 2023-08-03 15:24 UTC (permalink / raw)
To: kernelnewbies
[-- Attachment #1.1: Type: text/plain, Size: 736 bytes --]
Hello everyone. I have a serdev driver that communicates with a
coprocessor using HDLC [1]. I am currently using my own HDLC
implementation, but someone pointed out to me that I might be able to
use `drivers/net/wan/hdlc` instead.
However, I am not quite sure how I am supposed to use it. I think I am
supposed to `register_hdlc_protocol` in the serdev probe. The
`hdlc_proto->netif_rx` callback is called when data is available, and
`hdlc_proto->xmit` is called to send data? What is the format of
`skb-data` in rx?
It would be great if someone could point me to some drivers that use
Linux internal HDLC implementation.
Ayush Singh
[1]:
https://git.beagleboard.org/gsoc/greybus/beagleplay-greybus-driver/-/tree/develop
[-- Attachment #1.2: Type: text/html, Size: 1257 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using net/wan/hdlc with serdev
2023-08-03 15:24 Using net/wan/hdlc with serdev Ayush Singh
@ 2023-08-10 19:10 ` Ayush Singh
2023-08-11 6:48 ` Bjørn Mork
0 siblings, 1 reply; 3+ messages in thread
From: Ayush Singh @ 2023-08-10 19:10 UTC (permalink / raw)
To: kernelnewbies; +Cc: khc
[-- Attachment #1.1: Type: text/plain, Size: 720 bytes --]
So after some more looking around in the code, I think the workflow is
quite a bit different than what I thought in the previous mail. I think
I am supposed to allocate hdlc device using `alloc_hdlcdev` in the
`serdev->probe` and then implementing `hdlc->xmit` to send data over UART.
But well, I am not sure how to create an HDLC frame? Is there a helper
that creates HDLC frame skbuff for me? Or maybe the hdlc implementation
is simply not designed to be used for Asynchronous framing [1]. It would
be great if someone could explain how to use this HDLC module or point
to some resource I might have missed.
Ayush Singh
[1]:
https://en.wikipedia.org/wiki/High-Level_Data_Link_Control#Asynchronous_framing
[-- Attachment #1.2: Type: text/html, Size: 1187 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using net/wan/hdlc with serdev
2023-08-10 19:10 ` Ayush Singh
@ 2023-08-11 6:48 ` Bjørn Mork
0 siblings, 0 replies; 3+ messages in thread
From: Bjørn Mork @ 2023-08-11 6:48 UTC (permalink / raw)
To: Ayush Singh; +Cc: khc, kernelnewbies
Ayush Singh <ayushdevel1325@gmail.com> writes:
> But well, I am not sure how to create an HDLC frame? Is there a helper
> that creates HDLC frame skbuff for me? Or maybe the hdlc
> implementation is simply not designed to be used for Asynchronous
> framing [1]. It would be great if someone could explain how to use
> this HDLC module or point to some resource I might have missed.
I don't know anything at all about this subject, but I believe the wan
HDLC stuff is sync only.
Noting that the ppp driver does all the async framing internally. And
interleaved with ppp specific stuff, so probably not re-usable even if
exported. Ref ppp_async_encode() in drivers/net/ppp/ppp_async.c
I assume it would have used a shared implementation if there was one.
But I could be wrong...
Bjørn
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-11 6:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 15:24 Using net/wan/hdlc with serdev Ayush Singh
2023-08-10 19:10 ` Ayush Singh
2023-08-11 6:48 ` Bjørn Mork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).