Commit Graph

77 Commits

Author SHA1 Message Date
Denis Kenzior 66bc5b3fd4 mbim: Don't copy too much
_mbim_message_build doesn't really care about the fragmentation header
contents, so just don't copy those unnecessarily.
2019-11-13 17:01:15 -06:00
Denis Kenzior 5ee73d9101 mbim: Fix warning
CC       drivers/mbimmodem/mbim-message.o
	 drivers/mbimmodem/mbim-message.c: In function ‘_iter_copy_string’:
	 drivers/mbimmodem/mbim-message.c:199:18: error: cast increases required
	 alignment of target type [-Werror=cast-align]
2019-06-21 12:47:18 -05:00
Denis Kenzior 765c6655f2 treewide: Use L_TFR macro 2019-05-24 11:55:38 -05:00
Marcel Holtmann 2a5c9cf0f2 mbimmodem: Convert back to using __builtin_bswap16 with proper indexing 2018-10-31 21:03:49 +01:00
Marcel Holtmann 2df69194ac mbimmodem: Fix conversion of strings into UTF16-LE on big endian 2018-10-31 21:00:38 +01:00
Marcel Holtmann 63ed2c2080 mbimmodem: Fix endian issue with UTF16-LE to UTF16-CPU conversion 2018-10-31 20:42:14 +01:00
Denis Kenzior 4029ef3a11 mbimmodem: Fix compilation on 32-bit
CC       drivers/mbimmodem/mbim.o
drivers/mbimmodem/mbim.c: In function ‘command_write_handler’:
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
   l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
   ^
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat=]
drivers/mbimmodem/mbim.c: In function ‘command_read_handler’:
drivers/mbimmodem/mbim.c:649:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
  l_info("header_offset: %lu", device->header_offset);
  ^
drivers/mbimmodem/mbim.c:650:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
  l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
  ^
2018-10-31 14:20:00 -05:00
Marcel Holtmann 8452a7f349 build: Add support for internal and external Embedded Linux library 2018-10-31 19:58:10 +01:00
Jonas Bonn 3beeff758d treewide: Remove superfluous use of _GNU_SOURCE
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag.  This patch
removes all these definitions in one fell swoop...
2018-10-17 10:01:57 -05:00
Jonas Bonn 67701b1c40 drivers: constify vtables
The driver vtables are read-only structures.  This patch declares them as
'const' allowing the compiler to (optionally) put them in the RELRO
section.  RELRO pages may be marked as read-only by the linker after
the relocations have been done ensuring that they aren't inadvertently
or maliciously altered at runtime.
2018-10-17 09:56:27 -05:00
Giacinto Cifelli bd6f807849 drivers: support for auth NONE
Added the explicit support for auth NONE.
It needs to be added in all drivers/*/gprs-context.c atoms.

This method is already supported by all atoms that support
authentication (ie, all but Sierra' swmodem driver).

The behavior is left unchanged in case of inconsistent parameters:
if username is empty, then fallback to auth NONE.
2018-10-09 12:35:44 -05:00
Giacinto Cifelli 9f747730a8 mbim: fix calling mbim_sms_exit instead of _init 2018-09-20 10:49:06 -05:00
Denis Kenzior 22c625080e mbimmodem: fix crash
==12340== Invalid read of size 1
==12340==    at 0x4C2F9A0: __strncpy_sse2_unaligned (vg_replace_strmem.c:548)
==12340==    by 0x4A3520: strncpy (string3.h:126)
==12340==    by 0x4A3520: mbim_current_operator_cb (network-registration.c:178)
==12340==    by 0x49DC5D: dispatch_command_done (mbim.c:529)
==12340==    by 0x49DC5D: dispatch_message (mbim.c:594)
==12340==    by 0x49DC5D: command_read_handler (mbim.c:701)
2017-11-13 21:24:37 -06:00
Denis Kenzior a004120a99 mbimmodem: Add provisioned context query (debug only) 2017-11-13 21:24:37 -06:00
Denis Kenzior 2abfd90edd mbimmodem: Add gprs-context driver 2017-11-13 21:24:37 -06:00
Denis Kenzior f43341af2f mbim: Add IPv4/v6 Element & Address extractors
The IP Configuration data structure does not match any of the existing
data structure serialization conventions in the rest of the MBIM
specification.  So add IPv4 / v6 specific extractors for IPV4 address
and IPV4 Element structures.
2017-11-13 21:24:37 -06:00
Denis Kenzior 2690d1c8dd mbim: Add mbim context type UUIDs 2017-11-13 21:24:37 -06:00
Denis Kenzior 2d164c38c4 mbimmodem: Add GPRS atom driver 2017-11-13 21:24:37 -06:00
Denis Kenzior f7bd6900c3 mbim: Properly write values in little endian format 2017-11-13 21:24:37 -06:00
Denis Kenzior cc196e6503 mbim: Add support for 64-bit integers 2017-11-13 21:24:37 -06:00
Denis Kenzior f8b4730d4f mbimmodem: Move available_data_classes_to_tech
to util.[ch] so it can be used from other drivers
2017-11-09 11:39:43 -06:00
Denis Kenzior 47b562b91c mbim: Silence unused variable warning 2017-11-09 11:39:07 -06:00
Denis Kenzior bd0ba8bf3b mbim: Support variable struct signatures in arrays
DEVICE_SUBSCRIBE_LIST uses an array of structures.  The structure
contains the UUID of the service and then a variable number of CIDs that
are enabled.
2017-11-08 21:41:34 -06:00
Denis Kenzior 3ed0a1e077 mbimmodem: Add SMS atom 2017-11-08 21:41:34 -06:00
Denis Kenzior 529d522a00 mbim: Support embedded databuffers
SMS_SEND uses an embedded databuffer inside MBIM_SET_SMS_SEND which
wants to use a local offset (local to the databuffer structure) as
opposed to the offset from the start of the static buffer.
2017-11-08 21:41:31 -06:00
Denis Kenzior 5ef333b363 mbim: Fix incorrectly generating arrays 2017-11-08 21:02:22 -06:00
Denis Kenzior bae2843eac mbim: Add additional sanity checking
For zero element arrays we might inadvertently run past the end of the
iov buffer.  Fix this by adding additional checks that n_elem > 0 and
don't call _iter_get_data unless needed.
2017-11-08 21:02:22 -06:00
Denis Kenzior dc8574ba55 mbim: Support appending byte arrays 2017-11-08 21:02:22 -06:00
Denis Kenzior 79ebe4beb9 mbim: Fix iterator advance logic 2017-11-08 21:02:22 -06:00
Denis Kenzior 2ec8ed30bf mbimmodem: Add netreg driver 2017-11-08 21:02:22 -06:00
Denis Kenzior 689ebc808f mbim: Add MBIM_DATA_CLASS enum 2017-11-08 21:02:22 -06:00
Denis Kenzior 0222e657a0 mbimmodem: Support PIN/PUK operations 2017-11-08 21:02:22 -06:00
Denis Kenzior ecc6332e28 mbim: Fix comment typo 2017-11-08 21:02:22 -06:00
Denis Kenzior 9315d73f62 mbim: Add support for registering to notifications 2017-11-08 21:02:22 -06:00
Denis Kenzior 92296924ff mbim: Add basic SIM driver 2017-10-09 16:37:39 -05:00
Denis Kenzior 94cefc7cff mbim: Add CIDs from the specification 2017-10-05 11:08:38 -05:00
Denis Kenzior f0c1bdcf88 mbim: Support all types in _mbim_message_build 2017-10-05 11:08:38 -05:00
Denis Kenzior 978752bcd6 mbim: Add devinfo driver
Querying Manufacturer and Model is still not supported
2017-10-05 11:08:38 -05:00
Denis Kenzior cc90b1f71e mbim: Add mbim_device_cancel_group 2017-10-05 11:08:38 -05:00
Denis Kenzior db42e75a9c mbim: Add mbim_device_cancel 2017-10-05 11:08:38 -05:00
Denis Kenzior b5512b2775 mbim: Implement receiving responses 2017-10-05 11:08:38 -05:00
Denis Kenzior f92ca542e7 mbim: Implement sending commands 2017-10-05 11:08:38 -05:00
Denis Kenzior c995e657f4 mbim: Close IO in an idle event 2017-10-05 11:08:38 -05:00
Denis Kenzior 65d6d7d199 mbim: Add is_ready flag 2017-10-05 11:08:38 -05:00
Denis Kenzior b1a089eb0f mbim: Add message_assembly utilities 2017-10-05 11:08:38 -05:00
Denis Kenzior 1d16d4ac4e mbim: Add header & body accessors for mbim-message 2017-10-05 11:08:38 -05:00
Denis Kenzior 0c8199dca5 mbim: Implement MBIM_CLOSE_MSG 2017-10-05 11:08:38 -05:00
Denis Kenzior 076faf21d7 mbim: Implement MBIM_OPEN_MSG 2017-10-05 11:08:38 -05:00
Denis Kenzior 4e058ece2c mbim: Add mbim_device_set_ready_handler 2017-10-05 11:08:38 -05:00
Denis Kenzior d8686704e7 mbim: Rework constructor 2017-10-05 11:08:38 -05:00