ieee802154: pending patches
Alexander Aring
maintainercover ieee802154: pending patches
Hi Marcel,
these are currently the pending patches for ieee802154 subsystem.
There is one patch which was send before ~ 5 months ago and I dropped it again because the there was something wrong in the complete patch series and then I forget that fix. Nevertheless it seems that the RIOT people hit it, see:
https://github.com/RIOT-OS/RIOT/issues/3588#issuecomment-129509141
I hope the issue is fixed by PATCH "ieee802154: 6lowpan: fix error frag handling".
One fix from Lukasz Duda which fixes the traffic class decompression in 6LoWPAN code. There is indeed something wrong but I think the code needs a complete reqwork.
The other patches changes the aret handling in ieee802154 by removing the max_frame_retries "-1" value and do the ack handling per frame. To set the ackrequest bit for 802.15.4 6LoWPAN frames we introcued the ackrequest bit default handling which can set by nl802154.
Note:
There is another pending patch:
"cc2520: set the default fifo pin value from platform data"
but Varka didn't ack it yet, can you please apply this patch when Varka acked it, otherwise we will include them for the next "pending patches" series.
- Alex
Alexander Aring (7):
ieee802154: 6lowpan: remove multiple lowpan per wpan support
mac802154: fix wpan mac setting while lowpan is there
mac802154: cfg: remove test and set checks
mac802154: change frame_retries behaviour
at86rf230: use STATE_TX_ARET mode only
ieee802154: add ack request default handling
ieee802154: 6lowpan: fix error frag handling
Lukasz Duda (1):
6lowpan: Fix extraction of flow label field
drivers/net/ieee802154/at86rf230.c | 52 ++++++++--------------------- include/net/cfg802154.h | 8 +++++ include/net/nl802154.h | 4 +++ net/6lowpan/iphc.c | 2 +- net/ieee802154/6lowpan/6lowpan_i.h | 8 ----- net/ieee802154/6lowpan/core.c | 67 +++++++++++--------------------------- net/ieee802154/6lowpan/rx.c | 38 +++++---------------- net/ieee802154/6lowpan/tx.c | 4 +-- net/ieee802154/nl802154.c | 33 +++++++++++++++++++ net/ieee802154/rdev-ops.h | 13 ++++++++ net/ieee802154/trace.h | 19 +++++++++++ net/mac802154/cfg.c | 27 +++++++-------- net/mac802154/iface.c | 18 ++++++++-- net/mac802154/main.c | 9 ++--- 14 files changed, 151 insertions(+), 151 deletions(-)
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 1/8 6lowpan: Fix extraction of flow label field
From: Lukasz Duda <[email protected]>
The lowpan_fetch_skb function is used to fetch the first byte, which also increments the data pointer in skb structure, making subsequent array lookup of byte 0 actually being byte 1.
To decompress the first byte of the Flow Label when the TF flag is set to 0x01, the second half of the first byte is needed.
The patch fixes the extraction of the Flow Label field.
--- net/6lowpan/iphc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/6lowpan/iphc.c +1 -1
@@ -284,7 +284,7 @@ lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev,if (lowpan_fetch_skb (skb, &tmp,sizeof (tmp)))return -EINVAL ; - hdr.flow_lbl[0 ] = (skb->data[0 ] &0x0F ) | ((tmp >>2 ) &0x30 ); + hdr.flow_lbl[0 ] = (tmp &0x0F ) | ((tmp >>2 ) &0x30 );memcpy (&hdr.flow_lbl[1 ], &skb->data[0 ],2 );skb_pull (skb,2 );break ;
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 2/8 ieee802154: 6lowpan: remove multiple lowpan per wpan support
In reply to Alexander AringWe currently supports multiple lowpan interfaces per wpan interface. I never saw any use case into such functionality. We drop this feature now because it's much easier do deal with address changes inside the under laying wpan interface.
This patch removes the multiple lowpan interface and adds a lowpan_dev netdev pointer into the wpan_dev, if this pointer isn't null the wpan interface belongs to the assigned lowpan interface.
--- include/net/cfg802154.h | 3 ++ net/ieee802154/6lowpan/6lowpan_i.h | 8 ----- net/ieee802154/6lowpan/core.c | 67 +++++++++++--------------------------- net/ieee802154/6lowpan/rx.c | 38 +++++---------------- 4 files changed, 30 insertions(+), 86 deletions(-)
include/net/cfg802154.h +3 -0
@@ -173,6 +173,9 @@ struct wpan_dev {struct list_head list;struct net_device *netdev; +/* lowpan interface, set when the wpan_dev belongs to one lowpan_dev */ +struct net_device *lowpan_dev; +u32 identifier;/* MAC PIB */
net/ieee802154/6lowpan/6lowpan_i.h +0 -8
@@ -37,15 +37,9 @@ static inline u32 ieee802154_addr_hash(const struct ieee802154_addr *a) } } -struct lowpan_dev_record { -struct net_device *ldev; -struct list_head list; -}; -/* private device info */ struct lowpan_dev_info {struct net_device *real_dev;/* real WPAN device ptr */ -struct mutex dev_list_mtx;/* mutex for list ops */ u16 fragment_tag; };
@@ -55,8 +49,6 @@ lowpan_dev_info *lowpan_dev_info(const struct net_device *dev)return netdev_priv (dev); } -extern struct list_head lowpan_devices; -int lowpan_frag_rcv (struct sk_buff *skb,const u8 frag_type);void lowpan_net_frag_exit (void );int lowpan_net_frag_init (void );
net/ieee802154/6lowpan/core.c +19 -48
112 lines not on this page · raw message
net/ieee802154/6lowpan/rx.c +8 -30
@@ -15,36 +15,14 @@#include "6lowpan_i.h" -static int lowpan_give_skb_to_devices (struct sk_buff *skb, -struct net_device *dev) +static int lowpan_give_skb_to_device (struct sk_buff *skb, +struct net_device *dev) { -struct lowpan_dev_record *entry; -struct sk_buff *skb_cp; -int stat =NET_RX_SUCCESS ; - + skb->dev = dev->ieee802154_ptr->lowpan_dev; skb->protocol =htons (ETH_P_IPV6 ); skb->pkt_type =PACKET_HOST ; -rcu_read_lock (); -list_for_each_entry_rcu (entry, &lowpan_devices, list) -if (lowpan_dev_info (entry->ldev)->real_dev == skb->dev) { - skb_cp =skb_copy (skb,GFP_ATOMIC ); -if (!skb_cp) { -kfree_skb (skb); -rcu_read_unlock (); -return NET_RX_DROP ; - } - - skb_cp->dev = entry->ldev; - stat =netif_rx (skb_cp); -if (stat ==NET_RX_DROP ) -break ; - } -rcu_read_unlock (); - -consume_skb (skb); - -return stat; +return netif_rx (skb); } static int
@@ -109,7 +87,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,if (skb->data[0 ] ==LOWPAN_DISPATCH_IPV6 ) {/* Pull off the 1-byte of 6lowpan header. */ skb_pull (skb,1 ); -return lowpan_give_skb_to_devices (skb,NULL ); +return lowpan_give_skb_to_device (skb, dev); }else {switch (skb->data[0 ] &0xe0 ) {case LOWPAN_DISPATCH_IPHC :/* ipv6 datagram */
@@ -117,7 +95,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,if (ret <0 ) goto drop_skb; -return lowpan_give_skb_to_devices (skb,NULL ); +return lowpan_give_skb_to_device (skb, dev);case LOWPAN_DISPATCH_FRAG1 :/* first fragment header */ ret =lowpan_frag_rcv (skb,LOWPAN_DISPATCH_FRAG1 );if (ret ==1 ) {
@@ -125,7 +103,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,if (ret <0 ) goto drop_skb; -return lowpan_give_skb_to_devices (skb,NULL ); +return lowpan_give_skb_to_device (skb, dev); }else if (ret ==-1 ) {return NET_RX_DROP ; }else {
@@ -138,7 +116,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,if (ret <0 ) goto drop_skb; -return lowpan_give_skb_to_devices (skb,NULL ); +return lowpan_give_skb_to_device (skb, dev); }else if (ret ==-1 ) {return NET_RX_DROP ; }else {
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 3/8 mac802154: fix wpan mac setting while lowpan is there
In reply to Alexander AringIf we currently change the mac address inside the wpan interface while we have a lowpan interface on top of the wpan interface, the mac address setting doesn't reach the lowpan interface. The effect would be that the IPv6 lowpan interface has the old SLAAC address and isn't working anymore because the lowpan interface use in internal mechanism sometimes dev->addr which is the old mac address of the wpan interface.
This patch checks if a wpan interface belongs to lowpan interface, if yes then we need to check if the lowpan interface is down and change the mac address also at the lowpan interface. When the lowpan interface will be set up afterwards, it will use the correct SLAAC address which based on the updated mac address setting.
--- net/mac802154/iface.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
net/mac802154/iface.c +15 -0
@@ -125,6 +125,14 @@ static int mac802154_wpan_mac_addr(struct net_device *dev, void *p)if (netif_running (dev))return -EBUSY ; +/* lowpan need to be down for update +* SLAAC address after ifup +*/ +if (sdata->wpan_dev.lowpan_dev) { +if (netif_running (sdata->wpan_dev.lowpan_dev)) +return -EBUSY ; + } +ieee802154_be64_to_le64 (&extended_addr, addr->sa_data);if (!ieee802154_is_valid_extended_unicast_addr (extended_addr))return -EINVAL ;
@@ -132,6 +140,13 @@ static int mac802154_wpan_mac_addr(struct net_device *dev, void *p)memcpy (dev->dev_addr, addr->sa_data, dev->addr_len); sdata->wpan_dev.extended_addr = extended_addr; +/* update lowpan interface mac address when +* wpan mac has been changed +*/ +if (sdata->wpan_dev.lowpan_dev) +memcpy (sdata->wpan_dev.lowpan_dev->dev_addr, dev->dev_addr, + dev->addr_len); +return mac802154_wpan_update_llsec (dev); }
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 4/8 mac802154: cfg: remove test and set checks
In reply to Alexander AringThis patch removes several checks if a value is really changed. This makes only sense if we have another layer call e.g. calling the driver_ops which is done by callbacks like "set_channel".
For MAC settings which need to be set by phy registers (if the phy supports that handling) this is set by doing an interface up currently and are not direct driver_ops calls, so we remove the checks from these configuration callbacks.
--- net/mac802154/cfg.c | 16 ---------------- 1 file changed, 16 deletions(-)
net/mac802154/cfg.c +0 -16
@@ -209,10 +209,6 @@ ieee802154_set_backoff_exponent(struct wpan_phy *wpan_phy, {ASSERT_RTNL (); -if (wpan_dev->min_be == min_be && - wpan_dev->max_be == max_be) -return 0 ; - wpan_dev->min_be = min_be; wpan_dev->max_be = max_be;return 0 ;
@@ -224,9 +220,6 @@ ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, {ASSERT_RTNL (); -if (wpan_dev->short_addr == short_addr) -return 0 ; - wpan_dev->short_addr = short_addr;return 0 ; }
@@ -238,9 +231,6 @@ ieee802154_set_max_csma_backoffs(struct wpan_phy *wpan_phy, {ASSERT_RTNL (); -if (wpan_dev->csma_retries == max_csma_backoffs) -return 0 ; - wpan_dev->csma_retries = max_csma_backoffs;return 0 ; }
@@ -252,9 +242,6 @@ ieee802154_set_max_frame_retries(struct wpan_phy *wpan_phy, {ASSERT_RTNL (); -if (wpan_dev->frame_retries == max_frame_retries) -return 0 ; - wpan_dev->frame_retries = max_frame_retries;return 0 ; }
@@ -265,9 +252,6 @@ ieee802154_set_lbt_mode(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, {ASSERT_RTNL (); -if (wpan_dev->lbt == mode) -return 0 ; - wpan_dev->lbt = mode;return 0 ; }
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 5/8 mac802154: change frame_retries behaviour
In reply to Alexander AringThis patch changes the default minimum value of frame_retries to 0 and changes the frame_retries default value to 3 which is also 802.15.4 default.
We don't use the frame_retries "-1" value as indicator for no-aret mode anymore, instead we checking on the ack request bit inside the 802.15.4 frame control field. This allows a acknowledge handling per frame. This checking is done by transceiver or inside xmit callback of driver layer.
If a transceiver doesn't support ARET handling the transmit functionality ignores ack frames then, which isn't well but should not effect anything of current functionality.
--- net/mac802154/iface.c | 3 +-- net/mac802154/main.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-)
net/mac802154/iface.c +1 -2
@@ -498,8 +498,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, wpan_dev->min_be =3 ; wpan_dev->max_be =5 ; wpan_dev->csma_retries =4 ; -/* for compatibility, actual default is 3 */ - wpan_dev->frame_retries =-1 ; + wpan_dev->frame_retries =3 ; wpan_dev->pan_id =cpu_to_le16 (IEEE802154_PANID_BROADCAST ); wpan_dev->short_addr =cpu_to_le16 (IEEE802154_ADDR_BROADCAST );
net/mac802154/main.c +3 -6
@@ -111,7 +111,7 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops) phy->supported.max_minbe =8 ; phy->supported.min_maxbe =3 ; phy->supported.max_maxbe =8 ; - phy->supported.min_frame_retries =-1 ; + phy->supported.min_frame_retries =0 ; phy->supported.max_frame_retries =7 ; phy->supported.max_csma_backoffs =5 ; phy->supported.lbt =NL802154_SUPPORTED_BOOL_FALSE ;
@@ -177,11 +177,8 @@ int ieee802154_register_hw(struct ieee802154_hw *hw) }if (!(hw->flags &IEEE802154_HW_FRAME_RETRIES )) { -/* TODO should be 3, but our default value is -1 which means -* no ARET handling. -*/ - local->phy->supported.min_frame_retries =-1 ; - local->phy->supported.max_frame_retries =-1 ; + local->phy->supported.min_frame_retries =3 ; + local->phy->supported.max_frame_retries =3 ; }if (hw->flags &IEEE802154_HW_PROMISCUOUS )
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 6/8 at86rf230: use STATE_TX_ARET mode only
In reply to Alexander AringThis patch changes the state change behaviour of at86rf230 to always TX_ARET mode. According the at86rf2xx datasheets TX_ARET mode doesn't mean to be always waiting for ack frames after transmit. The transceiver will automatically wait for ack frames or not if the acknowledge request bit is set. See section "TX_ARET_ON – Transmit with Automatic Frame Retransmission and CSMA-CA Retry".
--- drivers/net/ieee802154/at86rf230.c | 52 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 38 deletions(-)
drivers/net/ieee802154/at86rf230.c +14 -38
@@ -97,9 +97,7 @@ struct at86rf230_local {struct at86rf230_state_change irq; -bool tx_aret;unsigned long cal_timeout; -s8 max_frame_retries;bool is_tx;bool is_tx_from_off;u8 tx_retry;
@@ -651,7 +649,7 @@ at86rf230_tx_complete(void *context)enable_irq (ctx->irq); -ieee802154_xmit_complete (lp->hw, lp->tx_skb, !lp->tx_aret); +ieee802154_xmit_complete (lp->hw, lp->tx_skb, false); } static void
@@ -760,17 +758,10 @@ at86rf230_irq_trx_end(struct at86rf230_local *lp) {if (lp->is_tx) { lp->is_tx =0 ; - -if (lp->tx_aret) -at86rf230_async_state_change (lp, &lp->irq, -STATE_FORCE_TX_ON , - at86rf230_tx_trac_status, - true); -else -at86rf230_async_state_change (lp, &lp->irq, -STATE_RX_AACK_ON , - at86rf230_tx_complete, - true); +at86rf230_async_state_change (lp, &lp->irq, +STATE_FORCE_TX_ON , + at86rf230_tx_trac_status, + true); }else {at86rf230_async_read_reg (lp,RG_TRX_STATE , &lp->irq, at86rf230_rx_trac_check, true);
@@ -876,24 +867,16 @@ at86rf230_xmit_start(void *context)struct at86rf230_state_change *ctx = context;struct at86rf230_local *lp = ctx->lp; -/* In ARET mode we need to go into STATE_TX_ARET_ON after we -* are in STATE_TX_ON. The pfad differs here, so we change -* the complete handler. -*/ -if (lp->tx_aret) { -if (lp->is_tx_from_off) { - lp->is_tx_from_off = false; -at86rf230_async_state_change (lp, ctx,STATE_TX_ARET_ON , - at86rf230_write_frame, - false); - }else { -at86rf230_async_state_change (lp, ctx,STATE_TX_ON , - at86rf230_xmit_tx_on, - false); - } +/* check if we change from off state */ +if (lp->is_tx_from_off) { + lp->is_tx_from_off = false; +at86rf230_async_state_change (lp, ctx,STATE_TX_ARET_ON , + at86rf230_write_frame, + false); }else {at86rf230_async_state_change (lp, ctx,STATE_TX_ON , - at86rf230_write_frame, false); + at86rf230_xmit_tx_on, + false); } }
@@ -1267,15 +1250,8 @@ static int at86rf230_set_frame_retries(struct ieee802154_hw *hw, s8 retries) {struct at86rf230_local *lp = hw->priv; -int rc =0 ; - - lp->tx_aret = retries >=0 ; - lp->max_frame_retries = retries; -if (retries >=0 ) - rc =at86rf230_write_subreg (lp,SR_MAX_FRAME_RETRIES , retries); - -return rc; +return at86rf230_write_subreg (lp,SR_MAX_FRAME_RETRIES , retries); } static int
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 7/8 ieee802154: add ack request default handling
In reply to Alexander AringThis patch introduce a new mib entry which isn't part of 802.15.4 but useful as default behaviour to set the ack request bit or not if we don't know if the ack request bit should set. This is currently used for stacks like IEEE 802.15.4 6LoWPAN.
--- include/net/cfg802154.h | 5 +++++ include/net/nl802154.h | 4 ++++ net/ieee802154/6lowpan/tx.c | 2 +- net/ieee802154/nl802154.c | 33 +++++++++++++++++++++++++++++++++ net/ieee802154/rdev-ops.h | 13 +++++++++++++ net/ieee802154/trace.h | 19 +++++++++++++++++++ net/mac802154/cfg.c | 11 +++++++++++ 7 files changed, 86 insertions(+), 1 deletion(-)
include/net/cfg802154.h +5 -0
@@ -63,6 +63,8 @@ struct cfg802154_ops { s8 max_frame_retries);int (*set_lbt_mode)(struct wpan_phy *wpan_phy,struct wpan_dev *wpan_dev,bool mode); +int (*set_ackreq_default)(struct wpan_phy *wpan_phy, +struct wpan_dev *wpan_dev,bool ackreq); }; static inline bool
@@ -196,6 +198,9 @@ struct wpan_dev {bool lbt;bool promiscuous_mode; + +/* fallback for acknowledgment bit setting */ +bool ackreq; };#define to_phy (_dev) container_of(_dev, struct wpan_phy, dev)
include/net/nl802154.h +4 -0
@@ -52,6 +52,8 @@ enum nl802154_commands {NL802154_CMD_SET_LBT_MODE , + NL802154_CMD_SET_ACKREQ_DEFAULT, +/* add new commands above here */ /* used to define NL802154_CMD_MAX below */
@@ -104,6 +106,8 @@ enum nl802154_attrs {NL802154_ATTR_SUPPORTED_COMMANDS , +NL802154_ATTR_ACKREQ_DEFAULT , +/* add attributes here, update the policy in nl802154.c */ __NL802154_ATTR_AFTER_LAST,
net/ieee802154/6lowpan/tx.c +1 -1
@@ -224,7 +224,7 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *dev) }else { da.mode =IEEE802154_ADDR_LONG ; da.extended_addr =ieee802154_devaddr_from_raw (daddr); - cb->ackreq = wpan_dev->frame_retries >=0 ; + cb->ackreq = wpan_dev->ackreq; } return dev_hard_header(skb, lowpan_dev_info(dev)->real_dev,
net/ieee802154/nl802154.c +33 -0
@@ -230,6 +230,8 @@ static const struct nla_policy nl802154_policy[NL802154_ATTR_MAX+1] = { [NL802154_ATTR_WPAN_PHY_CAPS] = { .type = NLA_NESTED }, [NL802154_ATTR_SUPPORTED_COMMANDS] = { .type = NLA_NESTED }, + + [NL802154_ATTR_ACKREQ_DEFAULT] = { .type = NLA_U8 }, };/* message building helper */
@@ -458,6 +460,7 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,CMD (set_max_csma_backoffs,SET_MAX_CSMA_BACKOFFS );CMD (set_max_frame_retries,SET_MAX_FRAME_RETRIES );CMD (set_lbt_mode,SET_LBT_MODE ); +CMD (set_ackreq_default,SET_ACKREQ_DEFAULT );if (rdev->wpan_phy.flags &WPAN_PHY_FLAG_TXPOWER )CMD (set_tx_power,SET_TX_POWER );
@@ -656,6 +659,10 @@ nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags,if (nla_put_u8 (msg,NL802154_ATTR_LBT_MODE , wpan_dev->lbt)) goto nla_put_failure; +/* ackreq default behaviour */ +if (nla_put_u8 (msg,NL802154_ATTR_ACKREQ_DEFAULT , wpan_dev->ackreq)) + goto nla_put_failure; +genlmsg_end (msg, hdr);return 0 ;
@@ -1042,6 +1049,24 @@ static int nl802154_set_lbt_mode(struct sk_buff *skb, struct genl_info *info)return rdev_set_lbt_mode (rdev, wpan_dev, mode); } +static int +nl802154_set_ackreq_default (struct sk_buff *skb,struct genl_info *info) +{ +struct cfg802154_registered_device *rdev = info->user_ptr[0 ]; +struct net_device *dev = info->user_ptr[1 ]; +struct wpan_dev *wpan_dev = dev->ieee802154_ptr; +bool ackreq; + +if (netif_running (dev)) +return -EBUSY ; + +if (!info->attrs[NL802154_ATTR_ACKREQ_DEFAULT ]) +return -EINVAL ; + + ackreq = !!nla_get_u8 (info->attrs[NL802154_ATTR_ACKREQ_DEFAULT ]); +return rdev_set_ackreq_default (rdev, wpan_dev, ackreq); +} +#define NL802154_FLAG_NEED_WPAN_PHY 0x01#define NL802154_FLAG_NEED_NETDEV 0x02#define NL802154_FLAG_NEED_RTNL 0x04
@@ -1248,6 +1273,14 @@ static const struct genl_ops nl802154_ops[] = { .internal_flags = NL802154_FLAG_NEED_NETDEV | NL802154_FLAG_NEED_RTNL, }, + { + .cmd = NL802154_CMD_SET_ACKREQ_DEFAULT, + .doit = nl802154_set_ackreq_default, + .policy = nl802154_policy, + .flags = GENL_ADMIN_PERM, + .internal_flags = NL802154_FLAG_NEED_NETDEV | + NL802154_FLAG_NEED_RTNL, + }, };/* initialisation/exit functions */
net/ieee802154/rdev-ops.h +13 -0
@@ -195,4 +195,17 @@ rdev_set_lbt_mode(struct cfg802154_registered_device *rdev, return ret; } +static inline int +rdev_set_ackreq_default (struct cfg802154_registered_device *rdev, +struct wpan_dev *wpan_dev,bool ackreq) +{ +int ret; + +trace_802154_rdev_set_ackreq_default (&rdev->wpan_phy, wpan_dev, + ackreq); + ret = rdev->ops->set_ackreq_default (&rdev->wpan_phy, wpan_dev, ackreq); +trace_802154_rdev_return_int (&rdev->wpan_phy, ret); +return ret; +} +#endif /* __CFG802154_RDEV_OPS */
net/ieee802154/trace.h +19 -0
@@ -275,6 +275,25 @@ TRACE_EVENT(802154_rdev_set_lbt_mode, WPAN_DEV_PR_ARG, BOOL_TO_STR(__entry->mode)) ); +TRACE_EVENT(802154_rdev_set_ackreq_default, + TP_PROTO(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, + bool ackreq), +TP_ARGS (wpan_phy, wpan_dev, ackreq), +TP_STRUCT__entry ( + WPAN_PHY_ENTRY + WPAN_DEV_ENTRY +__field (bool, ackreq) + ), +TP_fast_assign ( + WPAN_PHY_ASSIGN; + WPAN_DEV_ASSIGN; + __entry->ackreq = ackreq; + ), +TP_printk (WPAN_PHY_PR_FMT ", " WPAN_DEV_PR_FMT +", ackreq default: %s" ,WPAN_PHY_PR_ARG , +WPAN_DEV_PR_ARG ,BOOL_TO_STR (__entry->ackreq)) +); + TRACE_EVENT(802154_rdev_return_int, TP_PROTO(struct wpan_phy *wpan_phy, int ret), TP_ARGS(wpan_phy, ret),
net/mac802154/cfg.c +11 -0
@@ -256,6 +256,16 @@ ieee802154_set_lbt_mode(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,return 0 ; } +static int +ieee802154_set_ackreq_default (struct wpan_phy *wpan_phy, +struct wpan_dev *wpan_dev,bool ackreq) +{ +ASSERT_RTNL (); + + wpan_dev->ackreq = ackreq; +return 0 ; +} +const struct cfg802154_ops mac802154_config_ops = { .add_virtual_intf_deprecated = ieee802154_add_iface_deprecated, .del_virtual_intf_deprecated = ieee802154_del_iface_deprecated,
@@ -273,4 +283,5 @@ const struct cfg802154_ops mac802154_config_ops = { .set_max_csma_backoffs = ieee802154_set_max_csma_backoffs, .set_max_frame_retries = ieee802154_set_max_frame_retries, .set_lbt_mode = ieee802154_set_lbt_mode, + .set_ackreq_default = ieee802154_set_ackreq_default, };
Signature · 1 line
2.5.0
Alexander Aring
maintainerPATCH 8/8 ieee802154: 6lowpan: fix error frag handling
In reply to Alexander AringThis patch fixes the error handling for lowpan_xmit_fragment by replace "-PTR_ERR" to "PTR_ERR". PTR_ERR returns already a negative errno code.
--- net/ieee802154/6lowpan/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ieee802154/6lowpan/tx.c +1 -1
@@ -112,7 +112,7 @@ lowpan_xmit_fragment(struct sk_buff *skb, const struct ieee802154_hdr *wpan_hdr, frag =lowpan_alloc_frag (skb, frag_hdrlen + len, wpan_hdr);if (IS_ERR (frag)) -return -PTR_ERR (frag); +return PTR_ERR (frag);memcpy (skb_put (frag, frag_hdrlen), frag_hdr, frag_hdrlen);memcpy (skb_put (frag, len),skb_network_header (skb) + offset, len);
Signature · 1 line
2.5.0
Hi Alex,
Quoted 44 lines
these are currently the pending patches for ieee802154 subsystem.
There is one patch which was send before ~ 5 months ago and I dropped it again because the there was something wrong in the complete patch series and then I forget that fix. Nevertheless it seems that the RIOT people hit it, see:
https://github.com/RIOT-OS/RIOT/issues/3588#issuecomment-129509141
I hope the issue is fixed by PATCH "ieee802154: 6lowpan: fix error frag handling".
One fix from Lukasz Duda which fixes the traffic class decompression in 6LoWPAN code. There is indeed something wrong but I think the code needs a complete reqwork.
The other patches changes the aret handling in ieee802154 by removing the
max_frame_retries"-1" value and do the ack handling per frame. To set the ackrequest bit for 802.15.4 6LoWPAN frames we introcued the ackrequest bit default handling which can set by nl802154.Note:
There is another pending patch:
"cc2520: set the default fifo pin value from platform data"
but Varka didn't ack it yet, can you please apply this patch when Varka acked it, otherwise we will include them for the next "pending patches" series.
- Alex
Alexander Aring (7):
ieee802154: 6lowpan: remove multiple lowpan per wpan support
mac802154: fix wpan mac setting while lowpan is there
mac802154: cfg: remove test and set checks
mac802154: changeframe_retriesbehaviour
at86rf230: useSTATE_TX_ARETmode only
ieee802154: add ack request default handling
ieee802154: 6lowpan: fix error frag handlingLukasz Duda (1):
6lowpan: Fix extraction of flow label field
Quoted 15 lines
drivers/net/ieee802154/at86rf230.c | 52 ++++++++--------------------- include/net/cfg802154.h | 8 +++++ include/net/nl802154.h | 4 +++ net/6lowpan/iphc.c | 2 +- net/ieee802154/6lowpan/6lowpan_i.h | 8 ----- net/ieee802154/6lowpan/core.c | 67 +++++++++++--------------------------- net/ieee802154/6lowpan/rx.c | 38 +++++---------------- net/ieee802154/6lowpan/tx.c | 4 +-- net/ieee802154/nl802154.c | 33 +++++++++++++++++++ net/ieee802154/rdev-ops.h | 13 ++++++++ net/ieee802154/trace.h | 19 +++++++++++ net/mac802154/cfg.c | 27 +++++++-------- net/mac802154/iface.c | 18 ++++++++-- net/mac802154/main.c | 9 ++--- 14 files changed, 151 insertions(+), 151 deletions(-)
all 8 patches have been applied to bluetooth-next tree.
Regards
Marcel