public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: "Miguel Ángel Álvarez" <gotzoncabanes@gmail.com>
Cc: "Francois Romieu" <romieu@fr.zoreil.com>, netdev@vger.kernel.org
Subject: Re: How to use ixp4xx_hss (or generic-hdlc?)
Date: Mon, 24 Nov 2008 17:33:41 +0100	[thread overview]
Message-ID: <m3ljv913tm.fsf@maximus.localdomain> (raw)
In-Reply-To: <b0438a630811240156u161af1em917c7b4d35fe019a@mail.gmail.com> ("Miguel Ángel Álvarez"'s message of "Mon\, 24 Nov 2008 10\:56\:23 +0100")

"Miguel Ángel Álvarez" <gotzoncabanes@gmail.com> writes:

> I am not sure of having understood you. The buffer I send using sendto
> should be just the payload and the generic-hdlc (or the hardware)
> encapsulates it in an hdlc frame, or should I prepare the whole
> frame?

You sendto() the payload, but what is a payload?

With a normal HDLC hw driver, it (and the hardware) will generate the
flag sequences, will do bit-(de)stuffing, will calculate and check the
checksums, residual bits, aborts etc.

You usually have to add 32-bit header: u8 address (broadcast,
multicast, unicast) and control (such as unnumbered frame type), and
u16 protocol number (IPv4, IPv6 etc, LCP/IPCP, Cisco keepalive etc).
That's why it's called "raw HDLC", you're dealing with raw HDLC
packets.

> I took a little different approach, using the same PF_PACKET socket to
> obtain the ifr_ifindex, but in any case using your method or "my"
> method, and activating the debugging in ixp4xx_hss, when I do a two
> byte (0x30 0x31) sendto, the traces in debug_pkt give me:
>
> 1970/01/01,00:00:47 (none) user.debug kernel: hdlc0: hss_hdlc_xmit(2)
> <7> 30<7>31<7>

It should do just that (those '<7>' are weird, though).
-- 
Krzysztof Halasa

  reply	other threads:[~2008-11-24 16:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20 17:42 How to use ixp4xx_hss (or generic-hdlc?) Miguel Ángel Álvarez
2008-11-20 22:24 ` Francois Romieu
2008-11-21  8:18   ` Miguel Ángel Álvarez
2008-11-21 23:28     ` Krzysztof Halasa
2008-11-24  9:56       ` Miguel Ángel Álvarez
2008-11-24 16:33         ` Krzysztof Halasa [this message]
2008-11-25  7:24           ` Miguel Ángel Álvarez
2008-11-21 23:09 ` Krzysztof Halasa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ljv913tm.fsf@maximus.localdomain \
    --to=khc@pm.waw.pl \
    --cc=gotzoncabanes@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox