Skip to content

Commit 8e38b7d

Browse files
Stefan Schmidtholtmann
authored andcommitted
ieee802154: atusb: fix driver to work with older firmware versions
After the addition of the frame_retries callback we could run into cases where a ATUSB device with an older firmware version would now longer be able to bring the interface up. We keep this functionality disabled now if the minimum firmware version for this feature is not available. Fixes: 5d82288 ("ieee802154: atusb: implement .set_frame_retries ops callback") Reported-by: Alexander Aring <[email protected]> Acked-by: Alexander Aring <[email protected]> Signed-off-by: Stefan Schmidt <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent f301606 commit 8e38b7d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/net/ieee802154/atusb.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,6 @@ static int
562562
atusb_set_frame_retries(struct ieee802154_hw *hw, s8 retries)
563563
{
564564
struct atusb *atusb = hw->priv;
565-
struct device *dev = &atusb->usb_dev->dev;
566-
567-
if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 3) {
568-
dev_info(dev, "Automatic frame retransmission is only available from "
569-
"firmware version 0.3. Please update if you want this feature.");
570-
return -EINVAL;
571-
}
572565

573566
return atusb_write_subreg(atusb, SR_MAX_FRAME_RETRIES, retries);
574567
}
@@ -802,8 +795,7 @@ static int atusb_probe(struct usb_interface *interface,
802795

803796
hw->parent = &usb_dev->dev;
804797
hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT |
805-
IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_CSMA_PARAMS |
806-
IEEE802154_HW_FRAME_RETRIES;
798+
IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_CSMA_PARAMS;
807799

808800
hw->phy->flags = WPAN_PHY_FLAG_TXPOWER | WPAN_PHY_FLAG_CCA_ED_LEVEL |
809801
WPAN_PHY_FLAG_CCA_MODE;
@@ -832,6 +824,9 @@ static int atusb_probe(struct usb_interface *interface,
832824
atusb_get_and_show_build(atusb);
833825
atusb_set_extended_addr(atusb);
834826

827+
if (atusb->fw_ver_maj >= 0 && atusb->fw_ver_min >= 3)
828+
hw->flags |= IEEE802154_HW_FRAME_RETRIES;
829+
835830
ret = atusb_get_and_clear_error(atusb);
836831
if (ret) {
837832
dev_err(&atusb->usb_dev->dev,

0 commit comments

Comments
 (0)