linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* HDLC - Char or Network driver?
@ 2001-09-14 16:31 Goddeeris Frederic
  2001-09-15 21:43 ` andrew may
  0 siblings, 1 reply; 2+ messages in thread
From: Goddeeris Frederic @ 2001-09-14 16:31 UTC (permalink / raw)
  To: 'linuxppc-embedded@lists.linuxppc.org'


Hi,

I need to exchange data between an MPC860 and other components over an HDLC
bus. I found a "PPP over HDLC" driver for the MPC850. Out of this I made a
(quick and dirty) new driver for HDLC and it seems to work so I will be able
to make a nice driver out of this but I am unsure whether this needs to be
char driver of a network driver.

>From an application I need to send and receive native HDLC packets, so no
additional protocol is needed.

All examples and documents I find about network-drivers are so IP-related. A
network driver registers itself but how can an application reach it? An
Ethernet driver seems to be linked to the TCP/IP stack by using ifconfig.
But what about an HDLC driver for example?

I posted a similar question before to a news-group and several people
suggested that I write a char-driver. When you write to it, you send a HDLC
packet, when you read from it you get the packets that where received. My
temporary quick-and-dirty driver now is a char-driver. But I still feel a
bit uncomfortable about it.

How would you approach this?

Thanks,
Frederic


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: HDLC - Char or Network driver?
  2001-09-14 16:31 HDLC - Char or Network driver? Goddeeris Frederic
@ 2001-09-15 21:43 ` andrew may
  0 siblings, 0 replies; 2+ messages in thread
From: andrew may @ 2001-09-15 21:43 UTC (permalink / raw)
  To: Goddeeris Frederic; +Cc: 'linuxppc-embedded@lists.linuxppc.org'


On Fri, Sep 14, 2001 at 06:31:30PM +0200, Goddeeris Frederic wrote:
>
> Hi,
>
> I need to exchange data between an MPC860 and other components over an HDLC
> bus. I found a "PPP over HDLC" driver for the MPC850. Out of this I made a
> (quick and dirty) new driver for HDLC and it seems to work so I will be able
> to make a nice driver out of this but I am unsure whether this needs to be
> char driver of a network driver.
>
> From an application I need to send and receive native HDLC packets, so no
> additional protocol is needed.
>
> All examples and documents I find about network-drivers are so IP-related. A
> network driver registers itself but how can an application reach it? An
> Ethernet driver seems to be linked to the TCP/IP stack by using ifconfig.
> But what about an HDLC driver for example?

This would be better on a netdev mailling list.

look at linux/if_ether.h and pick a type from there or a number that won't
class with anything else you use. In the driver you will key off of skb->protocol
with that number and then at the app level you will use raw sockets bound to the
same protocol. ETH_P_WAN_PPP may be a good choice.

Look at drivers/wan/*.c in how the skb is setup before netif_rx. Also look at
hardheader functions if you want. They can be left out.

There should be plenty of examples of raw socket code. Even if it is IP based
it will show you how to use them to get raw packets down to and from the driver.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-15 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-14 16:31 HDLC - Char or Network driver? Goddeeris Frederic
2001-09-15 21:43 ` andrew may

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).