net: ipa: header pad field only valid for AP->modem endpoint
authorAlex Elder <elder@linaro.org>
Thu, 11 Jun 2020 19:48:33 +0000 (14:48 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Jun 2020 01:39:08 +0000 (18:39 -0700)
commitf330fda331d276464baec8ba938d031b4adcf5c7
tree905d63da5236dd5d1bb37ddf48fd9ebd04598e0b
parent636edeaad5577b6023f0de2b98a010d1cea73607
net: ipa: header pad field only valid for AP->modem endpoint

Only QMAP endpoints should be configured to find a pad size field
within packet headers.  They are found in the first byte of the QMAP
header (and the hardware fills only the 6 bits in that byte that
constitute the pad_len field).

The RMNet driver assumes the pad_len field is valid for received
packets, so we want to ensure the pad_len field is filled in that
case.  That driver also assumes the length in the QMAP header
includes the pad bytes.

The RMNet driver does *not* pad the packets it sends, so the pad_len
field can be ignored.

Fix ipa_endpoint_init_hdr_ext() so it only marks the pad field
offset valid for QMAP RX endpoints, and in that case indicates
that the length field in the header includes the pad bytes.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_endpoint.c