Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61f2dcba authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann
Browse files

mac802154: add interframe spacing time handling



This patch adds a new interframe spacing time handling into mac802154
layer. Interframe spacing time is a time period between each transmit.
This patch adds a high resolution timer into mac802154 and starts on
xmit complete with corresponding interframe spacing expire time if
ifs_handling is true. We make it variable because it depends if
interframe spacing time is handled by transceiver or mac802154. At the
timer complete function we wake the netdev queue again. This avoids
new frame transmit in range of interframe spacing time.

For synced driver we add no handling of interframe spacing time. This
is currently a lack of support in all synced xmit drivers. I suppose
it's working because the latency of workqueue which is needed to call
spi_sync.

Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a930430b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -731,7 +731,7 @@ at86rf230_tx_complete(void *context)
			udelay(lp->data->t_sifs);
	}

	ieee802154_xmit_complete(lp->hw, skb);
	ieee802154_xmit_complete(lp->hw, skb, false);
}

static void
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@

#define IEEE802154_EXTENDED_ADDR_LEN	8

#define IEEE802154_LIFS_PERIOD		40
#define IEEE802154_SIFS_PERIOD		12

#define IEEE802154_FC_TYPE_BEACON	0x0	/* Frame is beacon */
#define	IEEE802154_FC_TYPE_DATA		0x1	/* Frame is data */
#define IEEE802154_FC_TYPE_ACK		0x2	/* Frame is acknowledgment */
+8 −0
Original line number Diff line number Diff line
@@ -81,6 +81,14 @@ struct wpan_phy {

	s32 cca_ed_level;

	/* PHY depended MAC PIB values */

	/* 802.15.4 acronym: Tdsym in usec */
	u8 symbol_duration;
	/* lifs and sifs periods timing */
	u16 lifs_period;
	u16 sifs_period;

	struct device dev;

	char priv[0] __aligned(NETDEV_ALIGN);
+2 −1
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb,

void ieee802154_wake_queue(struct ieee802154_hw *hw);
void ieee802154_stop_queue(struct ieee802154_hw *hw);
void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb);
void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
			      bool ifs_handling);

#endif /* NET_MAC802154_H */
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#define __IEEE802154_I_H

#include <linux/mutex.h>
#include <linux/hrtimer.h>
#include <net/cfg802154.h>
#include <net/mac802154.h>
#include <net/ieee802154_netdev.h>
@@ -51,6 +52,8 @@ struct ieee802154_local {
	 */
	struct workqueue_struct	*workqueue;

	struct hrtimer ifs_timer;

	bool started;

	struct tasklet_struct tasklet;
@@ -127,6 +130,7 @@ ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev);
void mac802154_wpan_setup(struct net_device *dev);
netdev_tx_t
ieee802154_subif_start_xmit(struct sk_buff *skb, struct net_device *dev);
enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer);

/* MIB callbacks */
void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val);
Loading