Skip to content

Commit

Permalink
Merge branch 'ieee802154-for-davem-2018-05-08' of git://git.kernel.or…
Browse files Browse the repository at this point in the history
…g/pub/scm/linux/kernel/git/sschmidt/wpan

Stefan Schmidt says:

====================
pull-request: ieee802154 2018-05-08

An update from ieee802154 for your *net* tree.

Two fixes for the mcr20a driver, which was being added in the 4.17 merge window,
by Gustavo and myself.
The atusb driver got a change to GFP_KERNEL where no GFP_ATOMIC is needed by
Jia-Ju.

The last and most important fix is from Alex to get IPv6 reassembly working
again for the ieee802154 6lowpan adaptation. This got broken in 4.16 so please
queue this one also up for the 4.16 stable tree.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 8, 2018
2 parents 2c5d5b1 + f18fa5d commit 2dabf9f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ieee802154/atusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ static int atusb_probe(struct usb_interface *interface,
atusb->tx_dr.bRequest = ATUSB_TX;
atusb->tx_dr.wValue = cpu_to_le16(0);

atusb->tx_urb = usb_alloc_urb(0, GFP_ATOMIC);
atusb->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!atusb->tx_urb)
goto fail;

Expand Down
15 changes: 10 additions & 5 deletions drivers/net/ieee802154/mcr20a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,15 +1267,15 @@ mcr20a_probe(struct spi_device *spi)
ret = mcr20a_get_platform_data(spi, pdata);
if (ret < 0) {
dev_crit(&spi->dev, "mcr20a_get_platform_data failed.\n");
return ret;
goto free_pdata;
}

/* init reset gpio */
if (gpio_is_valid(pdata->rst_gpio)) {
ret = devm_gpio_request_one(&spi->dev, pdata->rst_gpio,
GPIOF_OUT_INIT_HIGH, "reset");
if (ret)
return ret;
goto free_pdata;
}

/* reset mcr20a */
Expand All @@ -1291,7 +1291,8 @@ mcr20a_probe(struct spi_device *spi)
hw = ieee802154_alloc_hw(sizeof(*lp), &mcr20a_hw_ops);
if (!hw) {
dev_crit(&spi->dev, "ieee802154_alloc_hw failed\n");
return -ENOMEM;
ret = -ENOMEM;
goto free_pdata;
}

/* init mcr20a local data */
Expand All @@ -1308,8 +1309,10 @@ mcr20a_probe(struct spi_device *spi)
/* init buf */
lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL);

if (!lp->buf)
return -ENOMEM;
if (!lp->buf) {
ret = -ENOMEM;
goto free_dev;
}

mcr20a_setup_tx_spi_messages(lp);
mcr20a_setup_rx_spi_messages(lp);
Expand Down Expand Up @@ -1366,6 +1369,8 @@ mcr20a_probe(struct spi_device *spi)

free_dev:
ieee802154_free_hw(lp->hw);
free_pdata:
kfree(pdata);

return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions net/ieee802154/6lowpan/6lowpan_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ typedef unsigned __bitwise lowpan_rx_result;
struct frag_lowpan_compare_key {
u16 tag;
u16 d_size;
const struct ieee802154_addr src;
const struct ieee802154_addr dst;
struct ieee802154_addr src;
struct ieee802154_addr dst;
};

/* Equivalent of ipv4 struct ipq
Expand Down
14 changes: 7 additions & 7 deletions net/ieee802154/6lowpan/reassembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ fq_find(struct net *net, const struct lowpan_802154_cb *cb,
{
struct netns_ieee802154_lowpan *ieee802154_lowpan =
net_ieee802154_lowpan(net);
struct frag_lowpan_compare_key key = {
.tag = cb->d_tag,
.d_size = cb->d_size,
.src = *src,
.dst = *dst,
};
struct frag_lowpan_compare_key key = {};
struct inet_frag_queue *q;

key.tag = cb->d_tag;
key.d_size = cb->d_size;
key.src = *src;
key.dst = *dst;

q = inet_frag_find(&ieee802154_lowpan->frags, &key);
if (!q)
return NULL;
Expand Down Expand Up @@ -372,7 +372,7 @@ int lowpan_frag_rcv(struct sk_buff *skb, u8 frag_type)
struct lowpan_frag_queue *fq;
struct net *net = dev_net(skb->dev);
struct lowpan_802154_cb *cb = lowpan_802154_cb(skb);
struct ieee802154_hdr hdr;
struct ieee802154_hdr hdr = {};
int err;

if (ieee802154_hdr_peek_addrs(skb, &hdr) < 0)
Expand Down

0 comments on commit 2dabf9f

Please sign in to comment.