Skip to contentSkip to conversation

pull-request: wpan-next 2014-08-11

PATCH In review Alexander Aring 2 participants 11 messages Aug 11, 2014

Subsystems (3)
lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

Hi Marcel,

this is a pull request for the bluetooth-next tree. The pull request contains some cleanup patches for mac802154 and the ieee802154 6lowpan part.

- Alex

author maintainer
#1 lore raw

PATCH 1/4 mac802154: cleanup in rx path

From: Varka Bhadram <[email protected]>

This patch replace the sizeof(struct rx_work) with sizeof(*work) and directly passing the skb in mac802154_subif_rx()

---
 net/mac802154/rx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/mac802154/rx.c +2 -3
index 7f820a1..a14cf9e 100644
@@ -86,9 +86,8 @@ fail:
 static void mac802154_rx_worker(struct work_struct *work)
 {
 	struct rx_work *rw = container_of(work, struct rx_work, work);
-	struct sk_buff *skb = rw->skb;
 
-	mac802154_subif_rx(rw->dev, skb, rw->lqi);
+	mac802154_subif_rx(rw->dev, rw->skb, rw->lqi);
 	kfree(rw);
 }
 
@@ -101,7 +100,7 @@ ieee802154_rx_irqsafe(struct ieee802154_dev *dev, struct sk_buff *skb, u8 lqi)
 	if (!skb)
 		return;
 
-	work = kzalloc(sizeof(struct rx_work), GFP_ATOMIC);
+	work = kzalloc(sizeof(*work), GFP_ATOMIC);
 	if (!work)
 		return;
 
Signature · 1 line
2.0.3
author maintainer
#3 lore raw

PATCH 2/4 mac802154: common error path

In reply to Alexander Aring

From: Varka Bhadram <[email protected]>

By introducing label fail, making the common error path for mac802154_llsec_decrypt() and packet type default case.

---
 net/mac802154/wpan.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/mac802154/wpan.c +6 -4
index 3c3069f..ce17570 100644
@@ -472,8 +472,7 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
 	rc = mac802154_llsec_decrypt(&sdata->sec, skb);
 	if (rc) {
 		pr_debug("decryption failed: %i\n", rc);
-		kfree_skb(skb);
-		return NET_RX_DROP;
+		goto fail;
 	}
 
 	sdata->dev->stats.rx_packets++;
@@ -485,9 +484,12 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
 	default:
 		pr_warn("ieee802154: bad frame received (type = %d)\n",
 			mac_cb(skb)->type);
-		kfree_skb(skb);
-		return NET_RX_DROP;
+		goto fail;
 	}
+
+fail:
+	kfree_skb(skb);
+	return NET_RX_DROP;
 }
 
 static void mac802154_print_addr(const char *name,
Signature · 1 line
2.0.3
author maintainer
#5 lore raw

PATCH 3/4 ieee802154: 6lowpan: remove unused function

In reply to Alexander Aring
---
 net/ieee802154/6lowpan_rtnl.c | 8 --------
 1 file changed, 8 deletions(-)
net/ieee802154/6lowpan_rtnl.c +0 -8
index 016b77e..509d7a6 100644
@@ -77,14 +77,6 @@ lowpan_dev_info *lowpan_dev_info(const struct net_device *dev)
 	return netdev_priv(dev);
 }
 
-static inline void lowpan_address_flip(u8 *src, u8 *dest)
-{
-	int i;
-
-	for (i = 0; i < IEEE802154_ADDR_LEN; i++)
-		(dest)[IEEE802154_ADDR_LEN - i - 1] = (src)[i];
-}
-
 static int lowpan_header_create(struct sk_buff *skb, struct net_device *dev,
 				unsigned short type, const void *_daddr,
 				const void *_saddr, unsigned int len)
Signature · 1 line
2.0.3
author maintainer
#7 lore raw

PATCH 4/4 mac802154: common tx error path

In reply to Alexander Aring

From: Varka Bhadram <[email protected]>

This patch introduce the common error path on failure of Tx by inserting the label 'err_tx'.

---
 net/mac802154/tx.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
net/mac802154/tx.c +8 -7
index 8124353..fdf4c0e6 100644
@@ -89,8 +89,7 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
 
 	if (!(priv->phy->channels_supported[page] & (1 << chan))) {
 		WARN_ON(1);
-		kfree_skb(skb);
-		return NETDEV_TX_OK;
+		goto err_tx;
 	}
 
 	mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb);
@@ -103,12 +102,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
 		data[1] = crc >> 8;
 	}
 
-	if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) {
-		kfree_skb(skb);
-		return NETDEV_TX_OK;
-	}
+	if (skb_cow_head(skb, priv->hw.extra_tx_headroom))
+		goto err_tx;
 
-	work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC);
+	work = kzalloc(sizeof(*work), GFP_ATOMIC);
 	if (!work) {
 		kfree_skb(skb);
 		return NETDEV_TX_BUSY;
@@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
 	queue_work(priv->dev_workqueue, &work->work);
 
 	return NETDEV_TX_OK;
+
+err_tx:
+	kfree_skb(skb);
+	return NETDEV_TX_OK;
 }
Signature · 1 line
2.0.3
author maintainer
#9 lore raw
In reply to Alexander Aring

Hi Marcel,

Quoted 4 lines · Alexander Aring

Hi Marcel,

this is a pull request for the bluetooth-next tree. The pull request contains some cleanup patches for mac802154 and the ieee802154 6lowpan part.

I fight with my git setup and this was a complete fail.

Sorry, for the noise.

- Alex

maintainer
#8 lore raw

Re: [PATCH 4/4] mac802154: common tx error path

In reply to Alexander Aring

Hi Alex,

Quoted 10 lines

From: Varka Bhadram <[email protected]>

This patch introduce the common error path on failure of Tx by inserting the label 'err_tx'.

---
net/mac802154/tx.c | 15 ++++++++-------

1 file changed, 8 insertions(+), 7 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

maintainer
#4 lore raw

Re: [PATCH 2/4] mac802154: common error path

In reply to Alexander Aring

Hi Alex,

Quoted 10 lines

From: Varka Bhadram <[email protected]>

By introducing label fail, making the common error path for mac802154_llsec_decrypt() and packet type default case.

---
net/mac802154/wpan.c | 10 ++++++----

1 file changed, 6 insertions(+), 4 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

maintainer
#2 lore raw

Re: [PATCH 1/4] mac802154: cleanup in rx path

In reply to Alexander Aring

Hi Alex,

Quoted 10 lines

From: Varka Bhadram <[email protected]>

This patch replace the sizeof(struct rx_work) with sizeof(*work) and directly passing the skb in mac802154_subif_rx()

---
net/mac802154/rx.c | 5 ++---

1 file changed, 2 insertions(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

maintainer
#10 lore raw
In reply to Alexander Aring

Hi Alex,

Quoted 6 lines
Quoted 2 lines

this is a pull request for the bluetooth-next tree. The pull request contains some cleanup patches for mac802154 and the ieee802154 6lowpan part.

I fight with my git setup and this was a complete fail.

Sorry, for the noise.

no problem. And I am totally fine if you just send patch series using git send-email. I can as easily apply them as a pull request.

Regards

Marcel