-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: apdu: add QMI backend #131
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
robimarko
force-pushed
the
qmi-refactored
branch
2 times, most recently
from
July 8, 2024 08:54
afe1327
to
c4f3957
Compare
Currently, the .fini driver OP can only be used with global variables, but that will be an issue when we cant use global variables. This will be used with direct QMI in order to free the memory used by the driver private structure instead of global variables. Signed-off-by: Robert Marko <[email protected]>
Almost all of the QRTR QMI helpers will be reused for direct QMI so, lets rename the sources to indicate that. Signed-off-by: Robert Marko <[email protected]>
Support for using QMI directly and not over QRTR would use a lot of the same code as QMI over QRTR, so in order to prevent code duplication lets extract that common code so it can be reused. Signed-off-by: Robert Marko <[email protected]>
Direct QMI backend wont use any of the libqmi QRTR functionality so it wont depend on libqrtr and thus we need to make sure QMI helpers still compile without libqrtr in the system. Signed-off-by: Robert Marko <[email protected]>
Since we split out the common QMI code then we cannot be using global variables since existing QRTR and the coming QMI drivers will clash by trying to use the same global variable names with the common code. So, lets move to passing a structure which is driver specific instead. Since we are not using global variables anymore, we cannot be using atexit anymore, so lets move that cleanup step to driver finish OP instead. Signed-off-by: Robert Marko <[email protected]>
Previously QMI over QRTR support was added, however that is only present in modern Qualcomm modems and only when running in PCIe mode and its quite common to still only use even the latest modems via USB. In that case, they are all still controllable via QMI but it is directly exposed as a character device in Linux so we can reuse most of the code from QMI over QRTR support but drop the support for libqrtr to talk to the modems. We require the QMI device path to be passed via QMI_DEVICE env variable for the backend to operate. Signed-off-by: Robert Marko <[email protected]>
Document the new direct QMI backend ENV variables as well as make it clear that UIM_SLOT is not a QMI QRTR only variable. Signed-off-by: Robert Marko <[email protected]>
Currently, we are using QMI_DEVICE_OPEN_FLAGS_NONE to open the QMI device and thus we are requesting exclusive access to the device while we need to talk to it. This will work fine as long as we are the only thing trying to use that QMI device at the same time or the device was not already opened in proxy mode. This is an issue since ModemManager will open the device in proxy mode so that qmicli or other applications can still talk to the same QMI device but it will break lpac from trying to use QMI. So, lets try and open the device in proxy mode, libqmi will the start the qmi-proxy service automatically as its built and installed as part of it. Signed-off-by: Robert Marko <[email protected]>
Fixed up the build warning |
if you are ready, plz click "Ready for review" convert the PR state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch series adds support for using QMI interface directly.
Previously QMI over QRTR support was added, however that is only present in
modern Qualcomm modems and only when running in PCIe mode and its quite
common to still only use even the latest modems via USB.
In that case, they are all still controllable via QMI but it is directly
exposed as a character device in Linux so we can reuse most of the code
from QMI over QRTR support but drop the support for libqrtr to talk to
the modems.
We require the QMI device path to be passed via QMI_DEVICE env variable
for the backend to operate.
Most commits in the series are to refactor the current QMI code in order to avoid duplicating core,
or to get rid of using global variables for the common code.