Re: iwx(4) -77 firmware diff for testing
On 3/2/23 10:09, Stefan Sperling wrote: On Wed, Feb 22, 2023 at 03:31:28PM +0100, Stefan Sperling wrote: Below is my work-in-progress diff to update iwx(4) to latest firmware. Every system tracking -current should already have the new -77 firmware images. The new images contain security fixes of (to me) unknown severity. Unfortunately there have been quite a number of firmware API changes since our last upgrade and it took me quite some time to get all the required new bits in place and arrive at an operational state. While testing please enable additional debug output with: ifconfig iwx0 debug To activate it at boot time: echo debug >> /etc/hostname.iwx0 There are some known issue with occasional firmware errors. My devices eventually manage to connect and work regardless. If you see a firmware error in dmesg please include the extra information shown in dmesg after enabling the debugging mode as above. This information is hidden by default and the driver will only print "fatal firmware error" to dmesg without more context, but the extra context is needed for debugging. If you hit an error which looks like this: iwx0: firmware parse error 22, section type 19 iwx0: failed to load init firmware Then you will need to increase this constant in if_iwxvar.h until you get past the error: #define IWX_UCODE_SECT_MAX 56 This new version of the patch fixes two issues: IWX_UCODE_SECT_MAX was bumped to 57 to accommodate some AX211 devices. Fixed iwx0: 0x211A | ADVANCED_SYSASSERT with helpful hints from Johannes Berg at Linux/Intel. This was an annoying issue since it made connecting to an access point fail quite often. Root cause were changes in the mac context command, where the firmware now expects beacon-related info to be initialized early, already before we attempt to associate. The only remaining known issue is: iwx0: 0x20002806 | ADVANCED_SYSASSERT, as seen by jmc@ This seems related to background scans. I could not yet reproduce the error, roaming seems to work as expected for me, but this might depend on the RF environment. Since roaming is evidently not completely broken by this I will not treat this as a blocker for moving development into the tree. Patch test reports are still welcome but please be fast if there is an issue you are seeing that I am not aware of. I will start splitting/committing this soon. Hi Stefan, also this patch works for my AX201 iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x01, msix iwx0: hw rev 0x350, fw 77.f92b5fed.0 Best regards, Sven
Re: iwx(4) -77 firmware diff for testing
On Wed, Feb 22, 2023 at 03:31:28PM +0100, Stefan Sperling wrote: > Below is my work-in-progress diff to update iwx(4) to latest firmware. > Every system tracking -current should already have the new -77 firmware > images. > > The new images contain security fixes of (to me) unknown severity. > Unfortunately there have been quite a number of firmware API changes since > our last upgrade and it took me quite some time to get all the required new > bits in place and arrive at an operational state. > > While testing please enable additional debug output with: > ifconfig iwx0 debug > To activate it at boot time: echo debug >> /etc/hostname.iwx0 > > There are some known issue with occasional firmware errors. > My devices eventually manage to connect and work regardless. If you see a > firmware error in dmesg please include the extra information shown in dmesg > after enabling the debugging mode as above. This information is hidden by > default and the driver will only print "fatal firmware error" to dmesg > without more context, but the extra context is needed for debugging. > > If you hit an error which looks like this: > >iwx0: firmware parse error 22, section type 19 >iwx0: failed to load init firmware > > Then you will need to increase this constant in if_iwxvar.h until you > get past the error: > > #define IWX_UCODE_SECT_MAX 56 This new version of the patch fixes two issues: IWX_UCODE_SECT_MAX was bumped to 57 to accommodate some AX211 devices. Fixed iwx0: 0x211A | ADVANCED_SYSASSERT with helpful hints from Johannes Berg at Linux/Intel. This was an annoying issue since it made connecting to an access point fail quite often. Root cause were changes in the mac context command, where the firmware now expects beacon-related info to be initialized early, already before we attempt to associate. The only remaining known issue is: iwx0: 0x20002806 | ADVANCED_SYSASSERT, as seen by jmc@ This seems related to background scans. I could not yet reproduce the error, roaming seems to work as expected for me, but this might depend on the RF environment. Since roaming is evidently not completely broken by this I will not treat this as a blocker for moving development into the tree. Patch test reports are still welcome but please be fast if there is an issue you are seeing that I am not aware of. I will start splitting/committing this soon. diff refs/heads/master refs/heads/iwxfw commit - 50b5a752f56b56e236653f0da2264f2ec83f9fde commit + 0e6ef712fc262423d483ba4cdeab9f957d41e71e blob - a91a0d85b3877e13d7798e7f90f21fd601eac1e5 blob + b4f90c6d74e76f1b5a4658cde4af19f2fe76a42a --- sys/dev/pci/if_iwx.c +++ sys/dev/pci/if_iwx.c @@ -235,7 +235,6 @@ int iwx_is_mimo_mcs(int); uint8_tiwx_lookup_cmd_ver(struct iwx_softc *, uint8_t, uint8_t); uint8_tiwx_lookup_notif_ver(struct iwx_softc *, uint8_t, uint8_t); intiwx_is_mimo_ht_plcp(uint8_t); -intiwx_is_mimo_mcs(int); intiwx_store_cscheme(struct iwx_softc *, uint8_t *, size_t); intiwx_alloc_fw_monitor_block(struct iwx_softc *, uint8_t, uint8_t); intiwx_alloc_fw_monitor(struct iwx_softc *, uint8_t); @@ -380,10 +379,10 @@ int iwx_phy_ctxt_cmd_uhb_v3(struct iwx_softc *, struct struct iwx_rx_data *); intiwx_binding_cmd(struct iwx_softc *, struct iwx_node *, uint32_t); uint8_tiwx_get_vht_ctrl_pos(struct ieee80211com *, struct ieee80211_channel *); -intiwx_phy_ctxt_cmd_uhb_v3(struct iwx_softc *, struct iwx_phy_ctxt *, uint8_t, - uint8_t, uint32_t, uint8_t, uint8_t); -intiwx_phy_ctxt_cmd_v3(struct iwx_softc *, struct iwx_phy_ctxt *, uint8_t, - uint8_t, uint32_t, uint8_t, uint8_t); +intiwx_phy_ctxt_cmd_uhb_v3_v4(struct iwx_softc *, struct iwx_phy_ctxt *, + uint8_t, uint8_t, uint32_t, uint8_t, uint8_t, int); +intiwx_phy_ctxt_cmd_v3_v4(struct iwx_softc *, struct iwx_phy_ctxt *, + uint8_t, uint8_t, uint32_t, uint8_t, uint8_t, int); intiwx_phy_ctxt_cmd(struct iwx_softc *, struct iwx_phy_ctxt *, uint8_t, uint8_t, uint32_t, uint32_t, uint8_t, uint8_t); intiwx_send_cmd(struct iwx_softc *, struct iwx_host_cmd *); @@ -395,6 +394,8 @@ const struct iwx_rate *iwx_tx_fill_cmd(struct iwx_soft const void *, uint32_t *); void iwx_free_resp(struct iwx_softc *, struct iwx_host_cmd *); void iwx_cmd_done(struct iwx_softc *, int, int, int); +uint32_t iwx_fw_rateidx_ofdm(uint8_t); +uint32_t iwx_fw_rateidx_cck(uint8_t); const struct iwx_rate *iwx_tx_fill_cmd(struct iwx_softc *, struct iwx_node *, struct ieee80211_frame *, uint16_t *, uint32_t *); void iwx_tx_update_byte_tbl(struct iwx_softc *, struct iwx_tx_ring *, int, @@ -446,11 +447,16 @@ int iwx_rs_rval2idx(uint8_t); intiwx_umac_scan_abort(struct iwx_softc *); intiwx_scan_abort(struct iwx_softc *); intiwx_enable_mgmt_queue(struct iwx_softc *); +intiwx_disable_mgmt_queue(struct iwx_softc *); intiwx_rs_rval2idx(uint8_t);
Re: iwx(4) -77 firmware diff for testing
Hi Stefan, thanks for your work. I also can confirm your patch. Thanks, Sven On 2/24/23 10:36, Mikhail wrote: On Wed, Feb 22, 2023 at 03:31:28PM +0100, Stefan Sperling wrote: Below is my work-in-progress diff to update iwx(4) to latest firmware. Every system tracking -current should already have the new -77 firmware images. The new images contain security fixes of (to me) unknown severity. Unfortunately there have been quite a number of firmware API changes since our last upgrade and it took me quite some time to get all the required new bits in place and arrive at an operational state. While testing please enable additional debug output with: ifconfig iwx0 debug To activate it at boot time: echo debug >> /etc/hostname.iwx0 There are some known issue with occasional firmware errors. My devices eventually manage to connect and work regardless. If you see a firmware error in dmesg please include the extra information shown in dmesg after enabling the debugging mode as above. This information is hidden by default and the driver will only print "fatal firmware error" to dmesg without more context, but the extra context is needed for debugging. If you hit an error which looks like this: iwx0: firmware parse error 22, section type 19 iwx0: failed to load init firmware Then you will need to increase this constant in if_iwxvar.h until you get past the error: #define IWX_UCODE_SECT_MAX 56 It will probably just need a +1 or +2. It is possible to find the required maximum by parsing all the firmware files, but I haven't gotten around to that yet. Tested and known to work with occasional firmware errors on: iwx0 at pci2 dev 0 function 0 "Intel Wi-Fi 6 AX200" rev 0x1a, msix iwx0: hw rev 0x340, fw 77.f92b5fed.0 iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x00, msix iwx0: hw rev 0x350, fw 77.f92b5fed.0, iwx0 at pci4 dev 0 function 0 "Intel Wi-Fi 6 AX210" rev 0x1a, msix iwx0: hw rev 0x420, fw 77.f92b5fed.0, pnvm dbd9582f, iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x20, msix iwx0: hw rev 0x350, fw 77.f92b5fed.0, address X iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX211" rev 0x01, msix iwx0: hw rev 0x370, fw 77.f92b5fed.0, pnvm dbd9582f, address X Working fine. AX211 required IWX_UCODE_SECT_MAX 57 to start. Tested with usual activity and iperf3 --bidir overnight. iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x01, msix iwx0: hw rev 0x350, fw 77.f92b5fed.0
Re: iwx(4) -77 firmware diff for testing
On Wed, Feb 22, 2023 at 03:31:28PM +0100, Stefan Sperling wrote: > Below is my work-in-progress diff to update iwx(4) to latest firmware. > Every system tracking -current should already have the new -77 firmware > images. > > The new images contain security fixes of (to me) unknown severity. > Unfortunately there have been quite a number of firmware API changes since > our last upgrade and it took me quite some time to get all the required new > bits in place and arrive at an operational state. > > While testing please enable additional debug output with: > ifconfig iwx0 debug > To activate it at boot time: echo debug >> /etc/hostname.iwx0 > > There are some known issue with occasional firmware errors. > My devices eventually manage to connect and work regardless. If you see a > firmware error in dmesg please include the extra information shown in dmesg > after enabling the debugging mode as above. This information is hidden by > default and the driver will only print "fatal firmware error" to dmesg > without more context, but the extra context is needed for debugging. > > If you hit an error which looks like this: > >iwx0: firmware parse error 22, section type 19 >iwx0: failed to load init firmware > > Then you will need to increase this constant in if_iwxvar.h until you > get past the error: > > #define IWX_UCODE_SECT_MAX 56 > > It will probably just need a +1 or +2. > It is possible to find the required maximum by parsing all the > firmware files, but I haven't gotten around to that yet. > > Tested and known to work with occasional firmware errors on: > > iwx0 at pci2 dev 0 function 0 "Intel Wi-Fi 6 AX200" rev 0x1a, msix > iwx0: hw rev 0x340, fw 77.f92b5fed.0 > > iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x00, msix > iwx0: hw rev 0x350, fw 77.f92b5fed.0, > > iwx0 at pci4 dev 0 function 0 "Intel Wi-Fi 6 AX210" rev 0x1a, msix > iwx0: hw rev 0x420, fw 77.f92b5fed.0, pnvm dbd9582f, iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x20, msix iwx0: hw rev 0x350, fw 77.f92b5fed.0, address X iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX211" rev 0x01, msix iwx0: hw rev 0x370, fw 77.f92b5fed.0, pnvm dbd9582f, address X Working fine. AX211 required IWX_UCODE_SECT_MAX 57 to start. Tested with usual activity and iperf3 --bidir overnight.
iwx(4) -77 firmware diff for testing
Below is my work-in-progress diff to update iwx(4) to latest firmware. Every system tracking -current should already have the new -77 firmware images. The new images contain security fixes of (to me) unknown severity. Unfortunately there have been quite a number of firmware API changes since our last upgrade and it took me quite some time to get all the required new bits in place and arrive at an operational state. While testing please enable additional debug output with: ifconfig iwx0 debug To activate it at boot time: echo debug >> /etc/hostname.iwx0 There are some known issue with occasional firmware errors. My devices eventually manage to connect and work regardless. If you see a firmware error in dmesg please include the extra information shown in dmesg after enabling the debugging mode as above. This information is hidden by default and the driver will only print "fatal firmware error" to dmesg without more context, but the extra context is needed for debugging. If you hit an error which looks like this: iwx0: firmware parse error 22, section type 19 iwx0: failed to load init firmware Then you will need to increase this constant in if_iwxvar.h until you get past the error: #define IWX_UCODE_SECT_MAX 56 It will probably just need a +1 or +2. It is possible to find the required maximum by parsing all the firmware files, but I haven't gotten around to that yet. Tested and known to work with occasional firmware errors on: iwx0 at pci2 dev 0 function 0 "Intel Wi-Fi 6 AX200" rev 0x1a, msix iwx0: hw rev 0x340, fw 77.f92b5fed.0 iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x00, msix iwx0: hw rev 0x350, fw 77.f92b5fed.0, iwx0 at pci4 dev 0 function 0 "Intel Wi-Fi 6 AX210" rev 0x1a, msix iwx0: hw rev 0x420, fw 77.f92b5fed.0, pnvm dbd9582f, diff refs/heads/master refs/heads/iwxfw commit - 1c92691b7a84f0421db1f337820c9101754737fe commit + babe10bea47ca36edb28f4dc8ead5853424475dc blob - a91a0d85b3877e13d7798e7f90f21fd601eac1e5 blob + 0959f986a912ab36ebe8e9ec705973c1de83fbfe --- sys/dev/pci/if_iwx.c +++ sys/dev/pci/if_iwx.c @@ -235,7 +235,6 @@ int iwx_is_mimo_mcs(int); uint8_tiwx_lookup_cmd_ver(struct iwx_softc *, uint8_t, uint8_t); uint8_tiwx_lookup_notif_ver(struct iwx_softc *, uint8_t, uint8_t); intiwx_is_mimo_ht_plcp(uint8_t); -intiwx_is_mimo_mcs(int); intiwx_store_cscheme(struct iwx_softc *, uint8_t *, size_t); intiwx_alloc_fw_monitor_block(struct iwx_softc *, uint8_t, uint8_t); intiwx_alloc_fw_monitor(struct iwx_softc *, uint8_t); @@ -380,10 +379,10 @@ int iwx_phy_ctxt_cmd_uhb_v3(struct iwx_softc *, struct struct iwx_rx_data *); intiwx_binding_cmd(struct iwx_softc *, struct iwx_node *, uint32_t); uint8_tiwx_get_vht_ctrl_pos(struct ieee80211com *, struct ieee80211_channel *); -intiwx_phy_ctxt_cmd_uhb_v3(struct iwx_softc *, struct iwx_phy_ctxt *, uint8_t, - uint8_t, uint32_t, uint8_t, uint8_t); -intiwx_phy_ctxt_cmd_v3(struct iwx_softc *, struct iwx_phy_ctxt *, uint8_t, - uint8_t, uint32_t, uint8_t, uint8_t); +intiwx_phy_ctxt_cmd_uhb_v3_v4(struct iwx_softc *, struct iwx_phy_ctxt *, + uint8_t, uint8_t, uint32_t, uint8_t, uint8_t, int); +intiwx_phy_ctxt_cmd_v3_v4(struct iwx_softc *, struct iwx_phy_ctxt *, + uint8_t, uint8_t, uint32_t, uint8_t, uint8_t, int); intiwx_phy_ctxt_cmd(struct iwx_softc *, struct iwx_phy_ctxt *, uint8_t, uint8_t, uint32_t, uint32_t, uint8_t, uint8_t); intiwx_send_cmd(struct iwx_softc *, struct iwx_host_cmd *); @@ -395,6 +394,8 @@ const struct iwx_rate *iwx_tx_fill_cmd(struct iwx_soft const void *, uint32_t *); void iwx_free_resp(struct iwx_softc *, struct iwx_host_cmd *); void iwx_cmd_done(struct iwx_softc *, int, int, int); +uint32_t iwx_fw_rateidx_ofdm(uint8_t); +uint32_t iwx_fw_rateidx_cck(uint8_t); const struct iwx_rate *iwx_tx_fill_cmd(struct iwx_softc *, struct iwx_node *, struct ieee80211_frame *, uint16_t *, uint32_t *); void iwx_tx_update_byte_tbl(struct iwx_softc *, struct iwx_tx_ring *, int, @@ -446,11 +447,16 @@ int iwx_rs_rval2idx(uint8_t); intiwx_umac_scan_abort(struct iwx_softc *); intiwx_scan_abort(struct iwx_softc *); intiwx_enable_mgmt_queue(struct iwx_softc *); +intiwx_disable_mgmt_queue(struct iwx_softc *); intiwx_rs_rval2idx(uint8_t); uint16_t iwx_rs_ht_rates(struct iwx_softc *, struct ieee80211_node *, int); uint16_t iwx_rs_vht_rates(struct iwx_softc *, struct ieee80211_node *, int); +intiwx_rs_init_v3(struct iwx_softc *, struct iwx_node *); +intiwx_rs_init_v4(struct iwx_softc *, struct iwx_node *); intiwx_rs_init(struct iwx_softc *, struct iwx_node *); intiwx_enable_data_tx_queues(struct iwx_softc *); +intiwx_phy_send_rlc(struct iwx_softc *, struct iwx_phy_ctxt *, + uint8_t, uint8_t); intiwx_phy_ctxt_update(struct iwx_softc *, struct iwx_phy_ctxt *, struct