提交 2fd2b550 编写于 作者: S Stefan Schmidt 提交者: Marcel Holtmann

ieee802154: atusb: make sure we set a randaom extended address if fetching fails

In the unlikely case were the firmware is new enough but the actual USB command
still fails make sure we set a random address and return.
Signed-off-by: NStefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 05a974ef
......@@ -737,8 +737,11 @@ static int atusb_set_extended_addr(struct atusb *atusb)
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_EUI64_READ, ATUSB_REQ_FROM_DEV, 0, 0,
buffer, IEEE802154_EXTENDED_ADDR_LEN, 1000);
if (ret < 0)
dev_err(&usb_dev->dev, "failed to fetch extended address\n");
if (ret < 0) {
dev_err(&usb_dev->dev, "failed to fetch extended address, random address set\n");
ieee802154_random_extended_addr(&atusb->hw->phy->perm_extended_addr);
return ret;
}
memcpy(&extended_addr, buffer, IEEE802154_EXTENDED_ADDR_LEN);
/* Check if read address is not empty and the unicast bit is set correctly */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册