From: Alexander Aring <alex.aring@gmail.com>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Stefan Schmidt <stefan@osg.samsung.com>,
linux-wpan@vger.kernel.org,
Stefan Schmidt <s.schmidt@samsung.com>
Subject: Re: [PATCH bluetooth-next 2/3] ieee802154/atusb: Mark driver as AACK enabled in hardware.
Date: Tue, 26 May 2015 10:56:18 +0200 [thread overview]
Message-ID: <20150526085615.GA2747@omega> (raw)
In-Reply-To: <20150525074133.GH11340@wantstofly.org>
Hi Lennert,
On Mon, May 25, 2015 at 10:41:33AM +0300, Lennert Buytenhek wrote:
> On Thu, May 21, 2015 at 04:51:36PM +0200, Stefan Schmidt wrote:
>
> > Since firmware version 0.2 we use AACK handling directly in the firmware.
> > Inform the stack that the hardware supports and uses it.
> >
> > Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> > ---
> > drivers/net/ieee802154/atusb.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> > index 9d07dd7..eef1d8a 100644
> > --- a/drivers/net/ieee802154/atusb.c
> > +++ b/drivers/net/ieee802154/atusb.c
> > @@ -568,7 +568,8 @@ static int atusb_probe(struct usb_interface *interface,
> > goto fail;
> >
> > hw->parent = &usb_dev->dev;
> > - hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT;
> > + hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT |
> > + IEEE802154_HW_AACK;
> >
> > hw->phy->current_page = 0;
> > hw->phy->current_channel = 11; /* reset default */
>
> I'm wondering about this patch...
>
> The IEEE802154_HW_AACK flag is defined in the core:
>
> include/net/mac802154.h:
> /* Indicates that receiver will autorespond with ACK frames. */
> #define IEEE802154_HW_AACK 0x00000002
>
> And is set by various drivers:
>
> drivers/net/ieee802154/at86rf230.c: lp->hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AACK |
> drivers/net/ieee802154/atusb.c: IEEE802154_HW_AACK;
> drivers/net/ieee802154/cc2520.c: priv->hw->flags = IEEE802154_HW_OMIT_CKSUM | IEEE802154_HW_AACK |
> drivers/net/ieee802154/mrf24j40.c: devrec->hw->flags = IEEE802154_HW_OMIT_CKSUM | IEEE802154_HW_AACK |
>
> But there's no code anywhere in the tree that tests for this flag, and
> if I think about it for a bit, I'm not sure what the core code could do
> with this information, as I don't think it's feasible to generate ACKs
> in software if the hardware doesn't support auto-ACKing? (Is hardware
> that doesn't support this useful or usable at all? Maybe just remove
> the flag altogether?)
yes this is true, this flag isn't evaluated and we can't never
supporting ack handling in software. I never saw a transceiver which
doesn't support auto-ACK handling also.
One use case would be that we check on this flag when we receive an ack
frame in mac802154 frame parsing. Then we could drop a WARN_ONCE which
means "hey care that you support aack handling in your driver".
But our logic is for _all_ drivers now is that they should _always_
support AACK handling by default, there is no feature disable or enable.
So maybe removing this flag and then making always WARN_ONCE if we get an
ACK frame in mac802154 (except monitor interface).
The reason is that a sending node which using max_frame_retries above or
equal zero, needs to get an ACK frame after tranmsitting. Otherwise for
frame_retries e.g. 3 the receiving node will receive the frame three
times contiguoues.
So AACK frame handling is always enabled (in mac header is a bit to
enable ack request, this should be configureable somehow (also for
6LoWPAN, it's currently hard coded always enabled)). And ARET handling
can be configureable by max_frame_retries parameters, (-1) means in this
case don't waiting for a ack frame while tranmsit. (0) Means sending
frame but wait for ack frame without retransmit, but possible further
error counting could check on "why transmit failed" and this there
should some counters "no ack frame". All setting above 0 is the same just
with retransmit support, which is can't be done by software but we have
the option to disable/enable it.
btw: I having some plans to rework the frame parsing/creation. The
parsing is based on mac802154 frame parsing [0]. There I have implement
the WARN_ONCE [1]. The frame parsing isn't mainline yet, because I can't
test the crypto layer. For doing this draft I simple removed the crypto
layer which makes the parts easier. The current frame parsing is much
oriented to support data frames only to deal with 6LoWPAN. It's a mess
currently to support new things into the frame parsing and we should
really look how mac802154 dealing with frame parsing and doing the same
in mac802154 and ieee802154 6lowpan, just other hex values and static
inline functions. Then we also don't need to parse always the whole
frame when we just want the addresses for example. Also the wireless
community (if they want) getting easier familar with the code.
- Alex
[0] https://github.com/linux-wpan/linux-wpan-next/blob/wpan_rework_rfc/net/mac802154/rx.c
[1] https://github.com/linux-wpan/linux-wpan-next/blob/wpan_rework_rfc/net/mac802154/rx.c#L171
next prev parent reply other threads:[~2015-05-26 13:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-21 14:51 [PATCH bluetooth-next 0/3] ATUSB driver updates Stefan Schmidt
2015-05-21 14:51 ` [PATCH bluetooth-next 1/3] ieee802154/atusb: Warn about outdated device firmware Stefan Schmidt
2015-05-21 14:51 ` [PATCH bluetooth-next 2/3] ieee802154/atusb: Mark driver as AACK enabled in hardware Stefan Schmidt
2015-05-25 7:41 ` Lennert Buytenhek
2015-05-26 8:56 ` Alexander Aring [this message]
2015-05-27 12:45 ` Lennert Buytenhek
2015-05-27 13:46 ` Alexander Aring
2015-05-27 16:12 ` Alexander Aring
2015-05-28 10:36 ` Lennert Buytenhek
2015-05-28 11:30 ` Alexander Aring
2015-05-28 10:29 ` Lennert Buytenhek
2015-05-28 11:25 ` Alexander Aring
2015-05-21 14:51 ` [PATCH bluetooth-next 3/3] ieee802154/atusb: Set default ed level to 0xbe like the rest of these drivers Stefan Schmidt
2015-05-21 15:36 ` [PATCH bluetooth-next 0/3] ATUSB driver updates Alexander Aring
2015-05-21 15:55 ` Marcel Holtmann
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=20150526085615.GA2747@omega \
--to=alex.aring@gmail.com \
--cc=buytenh@wantstofly.org \
--cc=linux-wpan@vger.kernel.org \
--cc=s.schmidt@samsung.com \
--cc=stefan@osg.samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.