This fixes a wrong unconditional write to a field of the scan command.

The scan command struct is a hell of a union of structs which represent
different versions of the scan command. This coding style makes it easy to
write to a wrong offset by accident. I intend to eventually clean this up
but I'm not sure yet which scan command versions will be needed for all the
devices that iwx(4) could cover in the future. So I'm keeping the scan
command data structures aligned with the Linux driver code for now.

ok?
 
diff a6511f65cdcb27cc87ec2022a72e2600f0ab8969 
27b87cbc607cd7feeac9d8b53142a430792e9a5b
blob - ca6d9fead056a08b48f61b30f2107afa68ebcda3
blob + 8fe53e36421a57841702a16a86f4b9f8e25bb681
--- sys/dev/pci/if_iwx.c
+++ sys/dev/pci/if_iwx.c
@@ -5261,6 +5261,8 @@ iwx_umac_scan(struct iwx_softc *sc, int bgscan)
                req->v1.passive_dwell = 110;
                req->v1.fragmented_dwell = 44;
                req->v1.extended_dwell = 90;
+
+               req->v1.scan_priority = htole32(IWX_SCAN_PRIORITY_HIGH);
        }
 
        if (bgscan) {
@@ -5279,7 +5281,6 @@ iwx_umac_scan(struct iwx_softc *sc, int bgscan)
                }
        }
 
-       req->v1.scan_priority = htole32(IWX_SCAN_PRIORITY_HIGH);
        req->ooc_priority = htole32(IWX_SCAN_PRIORITY_HIGH);
 
        cmd_data = iwx_get_scan_req_umac_data(sc, req);



Reply via email to