port-qmi: Detect endpoint type based on net driver
At the moment the endpoint type and number for the QMI WDA calls are chosen based on the subsystem of the QMI control port. This does not work correctly for some configurations:
-
SUBSYS_QRTR
currently impliesENDPOINT_TYPE_EMBEDDED
, but this is only valid for QRTR+IPA configurations. For QRTR+BAM-DMUX the correct type isENDPOINT_TYPE_BAM_DMUX
. -
SUBSYS_WWAN
currently impliesENDPOINT_TYPE_PCIE
, but there is already a comment that mentions that this selection works only for MHI/PCIe modems.SUBSYS_WWAN
is also used by RPMSG+BAM-DMUX configurations in which case the correct type is alsoENDPOINT_TYPE_BAM_DMUX
. (see #392 (closed))
Looking closer at these cases suggests that the endpoint type actually refers to the data/net port and not the control port. It is more reliable choose it based on the network driver and not the subsystem of the control port.
Address this partially by choosing the endpoint type based on the
net_driver
. Choosing the endpoint interface number correctly requires
more refactoring since most of the logic is currently handled globally
for a QMI control port, while it's actually specific to the chosen
data/net port in some cases (e.g. multiple BAM-DMUX network interfaces).
Fixes #392 (closed)