Page MenuHomeFreeBSD

urtwn(4): add error handling for urtwn_write_X() functions
ClosedPublic

Authored by avos on Nov 26 2015, 11:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 20, 2:48 PM
Unknown Object (File)
Fri, Jun 7, 5:03 AM
Unknown Object (File)
Thu, Jun 6, 11:44 AM
Unknown Object (File)
Jan 10 2024, 3:33 PM
Unknown Object (File)
Jan 7 2024, 9:14 PM
Unknown Object (File)
Dec 20 2023, 1:07 AM
Unknown Object (File)
Aug 23 2023, 7:49 AM
Unknown Object (File)
Aug 17 2023, 1:32 AM
Subscribers

Details

Summary
  • Return an error when urtwn_write_<smth>() fails.
  • Handle errors from them in:
  • urtwn_fw_cmd();
  • urtwn_llt_write();
  • urtwn_efuse_*();
  • urtwn_*_power_on();
  • urtwn_*_dma_init();
  • urtwn_mac_init();
  • urtwn_init();
  • Call ieee80211_stop() when urtwn_init() fails.
Test Plan

Tested with RTL8188EU, STA mode

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avos retitled this revision from to urtwn(4): add error handling for urtwn_write_X() functions.
avos updated this object.
avos edited the test plan for this revision. (Show Details)
avos added reviewers: adrian, kevlo.
avos set the repository for this revision to rS FreeBSD src repository - subversion.

The error handing is bogus. Is it really needded?

In D4291#90697, @kevlo wrote:

The error handing is bogus. Is it really needded?

As for me, it works fine without this code. But:

  • ieee80211_stop() will mark this interface as stopped when an error in urtwn_init() happens (for example, some time ago I have seen 'timeout waiting for checksum report' error). As a result, after an error - with this change - you can try to reinit the device with 'ifconfig wlan0 up'
  • error handling for <name>_write() / <name>_read is already implemented for other usb wlan drivers; I have not seen any reason to drop it here.
In D4291#90993, @s3erios_gmail.com wrote:
In D4291#90697, @kevlo wrote:

The error handing is bogus. Is it really needded?

As for me, it works fine without this code. But:

  • ieee80211_stop() will mark this interface as stopped when an error in urtwn_init() happens (for example, some time ago I have seen 'timeout waiting for checksum report' error). As a result, after an error - with this change - you can try to reinit the device with 'ifconfig wlan0 up'

I had seen this message once, but it appears I didn't fix it :(

  • error handling for <name>_write() / <name>_read is already implemented for other usb wlan drivers; I have not seen any reason to drop it here.

Well, I'm not against making changes, I just think why we introduced
unaffected code just because others are also doing it.

In D4291#91096, @kevlo wrote:
In D4291#90993, @s3erios_gmail.com wrote:
In D4291#90697, @kevlo wrote:

The error handing is bogus. Is it really needded?

As for me, it works fine without this code. But:

  • ieee80211_stop() will mark this interface as stopped when an error in urtwn_init() happens (for example, some time ago I have seen 'timeout waiting for checksum report' error). As a result, after an error - with this change - you can try to reinit the device with 'ifconfig wlan0 up'

I had seen this message once, but it appears I didn't fix it :(

This is not the only case - for example, user may forget to install the corresponding firmware.

  • error handling for <name>_write() / <name>_read is already implemented for other usb wlan drivers; I have not seen any reason to drop it here.

Well, I'm not against making changes, I just think why we introduced
unaffected code just because others are also doing it.

It may help when device <-> USB connection is not stable (so, the driver will not hang when device disconnects + there is a guarantee, that the device will be configured properly).

kevlo edited edge metadata.
This revision is now accepted and ready to land.Dec 3 2015, 2:04 AM
adrian edited edge metadata.
This revision was automatically updated to reflect the committed changes.