* ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements @ 2013-03-26 22:41 Stefan Schmidt [not found] ` <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> 2013-03-27 4:53 ` ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements David Miller 0 siblings, 2 replies; 8+ messages in thread From: Stefan Schmidt @ 2013-03-26 22:41 UTC (permalink / raw) To: davem-fT/PcQaiUtIeIZ0/mPfg9Q Cc: netdev-u79uwXL29TY76Z2rM5mHXA, alan-yzvJWuRpmD1zbRFIqnYvSA, linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Hello. Second version. Changes since version 1: - Obey 80 chars rules - Switch logging mode to vdbg to avoid noise - Remove uneeded might_sleep() Thanks Alan, Werner and Alex for the feedback. I feel these are ready so I added DaveM and netdev to pick them up if they think the same. [PATCH 1/3] ieee802154/dgram: Pass source address in dgram_recvmsg Patch from Stephen to fix the ieee802154 stack to actually put in the source address in datagrams. This allows using recvfrom() from userspace. This is a long standing bug. Actually I think it never worked. :) [PATCH 2/3] ieee802154/at86rf230: Implement hardware address filter Allows the to filter frames directly in the transceiver hardware. Useful for normal operation mode and mandatory for automatic ACK and automatic retransmits. [PATCH 3/3] ieee802154/at86rf230: Fix register names for RX_AACK_ON Not needed right now but still a good idea to get in imho. Register names have always been wrong but never used. regards Stefan Schmidt ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org>]
* [PATCH 1/3] ieee802154/dgram: Pass source address in dgram_recvmsg [not found] ` <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> @ 2013-03-26 22:41 ` Stefan Schmidt 2013-03-26 22:41 ` [PATCH 2/3] ieee802154/at86rf230: Implement hardware address filter callback Stefan Schmidt 2013-03-26 22:41 ` [PATCH 3/3] ieee802154/at86rf230: Fix register names for RX_AACK_ON and TX_ARET_ON Stefan Schmidt 2 siblings, 0 replies; 8+ messages in thread From: Stefan Schmidt @ 2013-03-26 22:41 UTC (permalink / raw) To: davem-fT/PcQaiUtIeIZ0/mPfg9Q Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Stephen Röttger, alan-yzvJWuRpmD1zbRFIqnYvSA, linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f From: Stephen Röttger <stephen.roettger@zero-entropy.de> This patch lets dgram_recvmsg fill in the sockaddr struct in msg->msg_name with the source address of the packet. This is used by the userland functions recvmsg and recvfrom to get the senders address. [Stefan: Changed from old zigbee legacy tree to mainline] Signed-off-by: Stephen Röttger <stephen.roettger@zero-entropy.de> Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> --- net/ieee802154/dgram.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index e0da175..581a595 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c @@ -291,6 +291,9 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk, size_t copied = 0; int err = -EOPNOTSUPP; struct sk_buff *skb; + struct sockaddr_ieee802154 *saddr; + + saddr = (struct sockaddr_ieee802154 *)msg->msg_name; skb = skb_recv_datagram(sk, flags, noblock, &err); if (!skb) @@ -309,6 +312,13 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk, sock_recv_ts_and_drops(msg, sk, skb); + if (saddr) { + saddr->family = AF_IEEE802154; + saddr->addr = mac_cb(skb)->sa; + } + if (addr_len) + *addr_len = sizeof(*saddr); + if (flags & MSG_TRUNC) copied = skb->len; done: -- 1.7.10.4 ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] ieee802154/at86rf230: Implement hardware address filter callback. [not found] ` <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> 2013-03-26 22:41 ` [PATCH 1/3] ieee802154/dgram: Pass source address in dgram_recvmsg Stefan Schmidt @ 2013-03-26 22:41 ` Stefan Schmidt 2013-03-26 22:41 ` [PATCH 3/3] ieee802154/at86rf230: Fix register names for RX_AACK_ON and TX_ARET_ON Stefan Schmidt 2 siblings, 0 replies; 8+ messages in thread From: Stefan Schmidt @ 2013-03-26 22:41 UTC (permalink / raw) To: davem-fT/PcQaiUtIeIZ0/mPfg9Q Cc: netdev-u79uwXL29TY76Z2rM5mHXA, alan-yzvJWuRpmD1zbRFIqnYvSA, linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Implement the filter function to update short address, pan id and ieee address on change. Allowing for hardware address filtering needed for auto ACK. Signed-off-by: Stefan Schmidt <stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> --- drivers/net/ieee802154/at86rf230.c | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index fc1687e..2ff1f20 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -619,6 +619,52 @@ err: return -EINVAL; } +static int +at86rf230_set_hw_addr_filt(struct ieee802154_dev *dev, + struct ieee802154_hw_addr_filt *filt, + unsigned long changed) +{ + struct at86rf230_local *lp = dev->priv; + + if (changed & IEEE802515_AFILT_SADDR_CHANGED) { + dev_vdbg(&lp->spi->dev, + "at86rf230_set_hw_addr_filt called for saddr\n"); + __at86rf230_write(lp, RG_SHORT_ADDR_0, filt->short_addr); + __at86rf230_write(lp, RG_SHORT_ADDR_1, filt->short_addr >> 8); + } + + if (changed & IEEE802515_AFILT_PANID_CHANGED) { + dev_vdbg(&lp->spi->dev, + "at86rf230_set_hw_addr_filt called for pan id\n"); + __at86rf230_write(lp, RG_PAN_ID_0, filt->pan_id); + __at86rf230_write(lp, RG_PAN_ID_1, filt->pan_id >> 8); + } + + if (changed & IEEE802515_AFILT_IEEEADDR_CHANGED) { + dev_vdbg(&lp->spi->dev, + "at86rf230_set_hw_addr_filt called for IEEE addr\n"); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_0, filt->ieee_addr[7]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_1, filt->ieee_addr[6]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_2, filt->ieee_addr[5]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_3, filt->ieee_addr[4]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_4, filt->ieee_addr[3]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_5, filt->ieee_addr[2]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_6, filt->ieee_addr[1]); + at86rf230_write_subreg(lp, SR_IEEE_ADDR_7, filt->ieee_addr[0]); + } + + if (changed & IEEE802515_AFILT_PANC_CHANGED) { + dev_vdbg(&lp->spi->dev, + "at86rf230_set_hw_addr_filt called for panc change\n"); + if (filt->pan_coord) + at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1); + else + at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 0); + } + + return 0; +} + static struct ieee802154_ops at86rf230_ops = { .owner = THIS_MODULE, .xmit = at86rf230_xmit, @@ -626,6 +672,7 @@ static struct ieee802154_ops at86rf230_ops = { .set_channel = at86rf230_channel, .start = at86rf230_start, .stop = at86rf230_stop, + .set_hw_addr_filt = at86rf230_set_hw_addr_filt, }; static void at86rf230_irqwork(struct work_struct *work) -- 1.7.10.4 ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] ieee802154/at86rf230: Fix register names for RX_AACK_ON and TX_ARET_ON [not found] ` <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> 2013-03-26 22:41 ` [PATCH 1/3] ieee802154/dgram: Pass source address in dgram_recvmsg Stefan Schmidt 2013-03-26 22:41 ` [PATCH 2/3] ieee802154/at86rf230: Implement hardware address filter callback Stefan Schmidt @ 2013-03-26 22:41 ` Stefan Schmidt 2 siblings, 0 replies; 8+ messages in thread From: Stefan Schmidt @ 2013-03-26 22:41 UTC (permalink / raw) To: davem-fT/PcQaiUtIeIZ0/mPfg9Q Cc: netdev-u79uwXL29TY76Z2rM5mHXA, alan-yzvJWuRpmD1zbRFIqnYvSA, linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f The register names have been wrong since the beginning but it only showed up now as they are actualy used for the upcoming auto ACK support. Signed-off-by: Stefan Schmidt <stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> --- drivers/net/ieee802154/at86rf230.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 2ff1f20..6e88eab 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -233,8 +233,8 @@ struct at86rf230_local { #define STATE_SLEEP 0x0F #define STATE_BUSY_RX_AACK 0x11 #define STATE_BUSY_TX_ARET 0x12 -#define STATE_BUSY_RX_AACK_ON 0x16 -#define STATE_BUSY_TX_ARET_ON 0x19 +#define STATE_RX_AACK_ON 0x16 +#define STATE_TX_ARET_ON 0x19 #define STATE_RX_ON_NOCLK 0x1C #define STATE_RX_AACK_ON_NOCLK 0x1D #define STATE_BUSY_RX_AACK_NOCLK 0x1E -- 1.7.10.4 ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements 2013-03-26 22:41 ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements Stefan Schmidt [not found] ` <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> @ 2013-03-27 4:53 ` David Miller 2013-03-27 18:52 ` Stefan Schmidt 1 sibling, 1 reply; 8+ messages in thread From: David Miller @ 2013-03-27 4:53 UTC (permalink / raw) To: stefan; +Cc: netdev, linux-zigbee-devel, alan From: Stefan Schmidt <stefan@datenfreihafen.org> Date: Tue, 26 Mar 2013 22:41:28 +0000 > Hello. > > Second version. Changes since version 1: > - Obey 80 chars rules > - Switch logging mode to vdbg to avoid noise > - Remove uneeded might_sleep() > > Thanks Alan, Werner and Alex for the feedback. > > I feel these are ready so I added DaveM and netdev to pick them up if they think > the same. All applied. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements 2013-03-27 4:53 ` ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements David Miller @ 2013-03-27 18:52 ` Stefan Schmidt 2013-03-27 19:10 ` David Miller 0 siblings, 1 reply; 8+ messages in thread From: Stefan Schmidt @ 2013-03-27 18:52 UTC (permalink / raw) To: David Miller; +Cc: stefan, netdev, linux-zigbee-devel, alan Hello. On Wed, 2013-03-27 at 00:53, David Miller wrote: > From: Stefan Schmidt <stefan@datenfreihafen.org> > Date: Tue, 26 Mar 2013 22:41:28 +0000 > > > Hello. > > > > Second version. Changes since version 1: > > - Obey 80 chars rules > > - Switch logging mode to vdbg to avoid noise > > - Remove uneeded might_sleep() > > > > Thanks Alan, Werner and Alex for the feedback. > > > > I feel these are ready so I added DaveM and netdev to pick them up if they think > > the same. > > All applied. Thanks. That was quick. :) I wonder what happened to the from of two of my commits. Looking at your repo they only show up my email address: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=1486774d69f6e58da16cdae8f17c77ec6569f711 https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=028889b0b32064a3a23d6d8d4ef589a42a6d43c7 The one from Stephen is fine https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=6364e6ee788ae60f1c2de5c59e39adb157327e6c The later as an explicit from as he was the author and I just the sender. For the two problematic ones git am should have picked up the normal mail from header, no? I did the patches from my local branch with git format-patch and git send-email as I have done quite often already. Looking at the mails I got as CC the from line looks fine too. Also I just saved the mails here from my mutt and did a git am on it and the name was picked up correctly. Is there still some error on my side? I would really like to get it fixed if there is one. :) Or was it juts a glitch on your side? regards Stefan Schmidt ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements 2013-03-27 18:52 ` Stefan Schmidt @ 2013-03-27 19:10 ` David Miller [not found] ` <20130327.151037.378525240140621201.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: David Miller @ 2013-03-27 19:10 UTC (permalink / raw) To: stefan; +Cc: netdev, linux-zigbee-devel, alan From: Stefan Schmidt <stefan@datenfreihafen.org> Date: Wed, 27 Mar 2013 18:52:05 +0000 > Hello. > > On Wed, 2013-03-27 at 00:53, David Miller wrote: >> From: Stefan Schmidt <stefan@datenfreihafen.org> >> Date: Tue, 26 Mar 2013 22:41:28 +0000 >> >> > Hello. >> > >> > Second version. Changes since version 1: >> > - Obey 80 chars rules >> > - Switch logging mode to vdbg to avoid noise >> > - Remove uneeded might_sleep() >> > >> > Thanks Alan, Werner and Alex for the feedback. >> > >> > I feel these are ready so I added DaveM and netdev to pick them up if they think >> > the same. >> >> All applied. > > Thanks. That was quick. :) > > I wonder what happened to the from of two of my commits. Looking at > your repo they only show up my email address: > > https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=1486774d69f6e58da16cdae8f17c77ec6569f711 > https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=028889b0b32064a3a23d6d8d4ef589a42a6d43c7 > > The one from Stephen is fine > https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=6364e6ee788ae60f1c2de5c59e39adb157327e6c > > The later as an explicit from as he was the author and I just the > sender. For the two problematic ones git am should have picked up the > normal mail from header, no? I don't understand what the problem is. The first two patches list you as the author, as that is the sender in the From: field. Oh, I see, the name, have a look at: http://patchwork.ozlabs.org/patch/231579/ That's where I take the patches from, click on Download "mbox" and you'll see that it gave me the headers as: Date: Tue, 26 Mar 2013 12:41:30 -0000 From: stefan@datenfreihafen.org ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20130327.151037.378525240140621201.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>]
* Re: ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements [not found] ` <20130327.151037.378525240140621201.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> @ 2013-03-27 21:21 ` Stefan Schmidt 0 siblings, 0 replies; 8+ messages in thread From: Stefan Schmidt @ 2013-03-27 21:21 UTC (permalink / raw) To: David Miller Cc: alan-yzvJWuRpmD1zbRFIqnYvSA, netdev-u79uwXL29TY76Z2rM5mHXA, linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Hello. On Wed, 2013-03-27 at 15:10, David Miller wrote: > From: Stefan Schmidt <stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> > Date: Wed, 27 Mar 2013 18:52:05 +0000 > > > On Wed, 2013-03-27 at 00:53, David Miller wrote: > >> From: Stefan Schmidt <stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> > >> Date: Tue, 26 Mar 2013 22:41:28 +0000 > >> > >> > Hello. > >> > > >> > Second version. Changes since version 1: > >> > - Obey 80 chars rules > >> > - Switch logging mode to vdbg to avoid noise > >> > - Remove uneeded might_sleep() > >> > > >> > Thanks Alan, Werner and Alex for the feedback. > >> > > >> > I feel these are ready so I added DaveM and netdev to pick them up if they think > >> > the same. > >> > >> All applied. > > > > Thanks. That was quick. :) > > > > I wonder what happened to the from of two of my commits. Looking at > > your repo they only show up my email address: > > > > https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=1486774d69f6e58da16cdae8f17c77ec6569f711 > > https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=028889b0b32064a3a23d6d8d4ef589a42a6d43c7 > > > > The one from Stephen is fine > > https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=6364e6ee788ae60f1c2de5c59e39adb157327e6c > > > > The later as an explicit from as he was the author and I just the > > sender. For the two problematic ones git am should have picked up the > > normal mail from header, no? > > I don't understand what the problem is. > > The first two patches list you as the author, as that is the sender in > the From: field. Yeah, sorry. Should have made that more clear. > Oh, I see, the name, have a look at: > > http://patchwork.ozlabs.org/patch/231579/ > > That's where I take the patches from, click on Download "mbox" and you'll > see that it gave me the headers as: > > Date: Tue, 26 Mar 2013 12:41:30 -0000 > From: stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org Strange, patchwork somehow got the From wrong. Looking through the headers again it seems all correct to me. The only occurance of my email without proper name is the return-path which should should not matter. Its not a big deal anyway, just strange. regards Stefan Schmidt ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-03-27 21:21 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-03-26 22:41 ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements Stefan Schmidt [not found] ` <1364337691-20163-1-git-send-email-stefan-OrPQZGeq07wqhVmZOOOmNx2eb7JE58TQ@public.gmane.org> 2013-03-26 22:41 ` [PATCH 1/3] ieee802154/dgram: Pass source address in dgram_recvmsg Stefan Schmidt 2013-03-26 22:41 ` [PATCH 2/3] ieee802154/at86rf230: Implement hardware address filter callback Stefan Schmidt 2013-03-26 22:41 ` [PATCH 3/3] ieee802154/at86rf230: Fix register names for RX_AACK_ON and TX_ARET_ON Stefan Schmidt 2013-03-27 4:53 ` ieee802154: Source addr fix for dgram and some small at86rf230 driver enhancements David Miller 2013-03-27 18:52 ` Stefan Schmidt 2013-03-27 19:10 ` David Miller [not found] ` <20130327.151037.378525240140621201.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> 2013-03-27 21:21 ` Stefan Schmidt
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).