On Mon, Jan 15, 2024 at 11:10:17AM +0100, Mark Kettenis wrote:
>
> > Date: Mon, 15 Jan 2024 00:17:53 -0800
> > From: Mike Larkin <[email protected]>
> >
> > On Mon, Jan 15, 2024 at 08:58:52AM +0100, Mizsei Zolt?n wrote:
> > > Thanks, that did the trick, see new dmesg below. Would it possible to
> > > enable iwn* in the upstream sources?
> > >
> > > Best Regards,
> > > --Zoltan
> > >
> >
> > I think that should be doable. Mark, Patrick, any objections (and if no, do
> > we
> > want iwm in there too?)
>
> If we add iwn(4), we probably should add iwm(4) too.
>
> I think I had some worries that these Intel wireless cards were
> somehow closely tied to Intel chipsets and therefore adding them made
> only sense for amd64. But iwx(4) works and if iwn(4) works, I think
> we cane safely assume that iwm(4) should work as well.
>
> So no objection from me.
iwm(4) failed to build:
In file included from /usr/src/sys/dev/pci/if_iwm.c:167:
/usr/src/sys/dev/pci/if_iwmreg.h:3358:2: error: field within 'struct
iwm_rx_mpdu_desc_v1' is less aligned than 'union
iwm_rx_mpdu_desc_v1::(anonymous at /usr/src/sys/dev/pci/if_iwmreg.h:3358:2)'
and is usually due to 'struct iwm_rx_mpdu_desc_v1' being packed, which can lead
to unaligned accesses [-Werror,-Wunaligned-access]
union {
^
1 error generated.
*** Error 1 in /usr/src/sys/arch/arm64/compile/GENERIC.MP (Makefile:1562
'if_iwm.o')
The below diff fixes clang warning about possible unaligned access.
With that fixed, iwm(4) works as expected on my Rock 3A.
iwm0 at pci1 dev 0 function 0 "Intel Dual Band Wireless-AC 9260" rev 0x29, msix
iwm0: hw rev 0x320, fw ver 46.ff18e32a.0, address fc:77:74:xx:xx:xx
Index: sys/dev/pci/if_iwmreg.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwmreg.h,v
retrieving revision 1.68
diff -u -p -u -p -r1.68 if_iwmreg.h
--- sys/dev/pci/if_iwmreg.h 19 Mar 2022 10:26:52 -0000 1.68
+++ sys/dev/pci/if_iwmreg.h 16 Jan 2024 06:06:00 -0000
@@ -3361,7 +3361,7 @@ struct iwm_rx_mpdu_desc_v1 {
uint32_t phy_data0;
uint32_t phy_data1;
};
- };
+ } __packed;
} __packed;
#define IWM_RX_REORDER_DATA_INVALID_BAID 0x7f