#
72eedfc4 |
| 07-Jun-2021 |
Sergey Ryazanov <ryazanov.s.a@gmail.com> |
net: wwan: core: expand ports number limit
Currently, we limit the total ports number to 256. It is quite common for PBX or SMS gateway to be equipped with a lot of modems. In now days, a modem coul
net: wwan: core: expand ports number limit
Currently, we limit the total ports number to 256. It is quite common for PBX or SMS gateway to be equipped with a lot of modems. In now days, a modem could have 2-4 control ports or even more, what only accelerates the ports exhausing rate.
To avoid facing the port number limitation issue reports, increase the limit up the maximum number of minors (i.e. up to 1 << MINORBITS).
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Reviewed-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
f458709f |
| 07-Jun-2021 |
Sergey Ryazanov <ryazanov.s.a@gmail.com> |
net: wwan: core: make port names more user-friendly
At the moment, the port name is allocated based on the parent device name, port id and the port type. Where the port id specifies nothing but the
net: wwan: core: make port names more user-friendly
At the moment, the port name is allocated based on the parent device name, port id and the port type. Where the port id specifies nothing but the ports registration order and is only used to make the port name unique.
Most likely, to configure a WWAN device, the user will look for a port of a specific type (e.g. AT port or MBIM port, etc.). The current naming scheme can make it difficult to find a port of a specific type.
Consider a WWAN device that has 3 ports: AT port, MBIM port, and another one AT port. With the global port index, the port names will be: * wwan0p1at * wwan0p2mbim * wwan0p3at
To find the MBIM port, user should know in advance the device ports composition (i.e. the user should know that the MBIM port is the 2nd one) or carefully examine the whole ports list. It is not unusual for USB modems to have a different composition, even if they are build on a same chipset. Moreover, some modems able to change the ports composition based on the user's configuration. All this makes port names fully unpredictable.
To make naming more user-friendly, remove the global port id and enumerate ports by its type. E.g.: * wwan0p1at -> wwan0at0 * wwan0p2mbim -> wwan0mbim0 * wwan0p3at -> wwan0at1
With this naming scheme, the first AT port name will always be wwanXat0, the first MBIM port name will always be wwanXmbim0, etc.
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
392c26f7 |
| 07-Jun-2021 |
Sergey Ryazanov <ryazanov.s.a@gmail.com> |
net: wwan: core: spell port device name in lowercase
Usually a device name is spelled in lowercase, let us follow this practice in the WWAN subsystem as well. The bottom line is that such name is ea
net: wwan: core: spell port device name in lowercase
Usually a device name is spelled in lowercase, let us follow this practice in the WWAN subsystem as well. The bottom line is that such name is easier to type.
To keep the device type attribute contents more natural (i.e., spell abbreviations in uppercase), while making the device name lowercase, turn the port type strings array to an array of structure that contains both the port type name and the device name suffix.
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Reviewed-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
64cc80c0 |
| 07-Jun-2021 |
Sergey Ryazanov <ryazanov.s.a@gmail.com> |
net: wwan: core: init port type string array using enum values
This array is indexed by port type. Make it self-descriptive by using the port type enum values as indices in the array initializer.
S
net: wwan: core: init port type string array using enum values
This array is indexed by port type. Make it self-descriptive by using the port type enum values as indices in the array initializer.
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Reviewed-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
b64d76b7 |
| 07-Jun-2021 |
Sergey Ryazanov <ryazanov.s.a@gmail.com> |
net: wwan: make WWAN_PORT_MAX meaning less surprised
It is quite unusual when some value can not be equal to a defined range max value. Also most subsystems defines FOO_TYPE_MAX as a maximum valid v
net: wwan: make WWAN_PORT_MAX meaning less surprised
It is quite unusual when some value can not be equal to a defined range max value. Also most subsystems defines FOO_TYPE_MAX as a maximum valid value. So turn the WAN_PORT_MAX meaning from the number of supported port types to the maximum valid port type.
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Reviewed-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.10.42, v5.10.41, v5.10.40 |
|
#
e4e92ee7 |
| 25-May-2021 |
Loic Poulain <loic.poulain@linaro.org> |
net: wwan: core: Add WWAN device index sysfs attribute
Add index sysfs attribute for WWAN devices. This index is used to uniquely indentify and reference a WWAN device. 'index' is the attribute name
net: wwan: core: Add WWAN device index sysfs attribute
Add index sysfs attribute for WWAN devices. This index is used to uniquely indentify and reference a WWAN device. 'index' is the attribute name that other device classes use (wireless, v4l2-dev, rfkill, etc...).
Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.10.39 |
|
#
b3e22e10 |
| 17-May-2021 |
Loic Poulain <loic.poulain@linaro.org> |
net: wwan: Add WWAN port type attribute
The port type is by default part of the WWAN port device name. However device name can not be considered as a 'stable' API and may be subject to change in the
net: wwan: Add WWAN port type attribute
The port type is by default part of the WWAN port device name. However device name can not be considered as a 'stable' API and may be subject to change in the future. This change adds a proper device attribute that can be used to determine the WWAN protocol/ type.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.4.119, v5.10.36, v5.10.35, v5.10.34, v5.4.116, v5.10.33, v5.12 |
|
#
57e22247 |
| 22-Apr-2021 |
Loic Poulain <loic.poulain@linaro.org> |
net: wwan: core: Return poll error in case of port removal
Ensure that the poll system call returns proper error flags when port is removed (nullified port ops), allowing user side to properly fail,
net: wwan: core: Return poll error in case of port removal
Ensure that the poll system call returns proper error flags when port is removed (nullified port ops), allowing user side to properly fail, without further read or write.
Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem") Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.10.32 |
|
#
b8c55ce2 |
| 20-Apr-2021 |
Loic Poulain <loic.poulain@linaro.org> |
net: wwan: Fix bit ops double shift
bit operation helpers such as test_bit, clear_bit, etc take bit position as parameter and not value. Current usage causes double shift => BIT(BIT(0)). Fix that in
net: wwan: Fix bit ops double shift
bit operation helpers such as test_bit, clear_bit, etc take bit position as parameter and not value. Current usage causes double shift => BIT(BIT(0)). Fix that in wwan_core and mhi_wwan_ctrl.
Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.10.31 |
|
#
9a44c1cc |
| 16-Apr-2021 |
Loic Poulain <loic.poulain@linaro.org> |
net: Add a WWAN subsystem
This change introduces initial support for a WWAN framework. Given the complexity and heterogeneity of existing WWAN hardwares and interfaces, there is no strict definition
net: Add a WWAN subsystem
This change introduces initial support for a WWAN framework. Given the complexity and heterogeneity of existing WWAN hardwares and interfaces, there is no strict definition of what a WWAN device is and how it should be represented. It's often a collection of multiple devices that perform the global WWAN feature (netdev, tty, chardev, etc).
One usual way to expose modem controls and configuration is via high level protocols such as the well known AT command protocol, MBIM or QMI. The USB modems started to expose them as character devices, and user daemons such as ModemManager learnt to use them.
This initial version adds the concept of WWAN port, which is a logical pipe to a modem control protocol. The protocols are rawly exposed to user via character device, allowing straigthforward support in existing tools (ModemManager, ofono...). The WWAN core takes care of the generic part, including character device management, and relies on port driver operations to receive/submit protocol data.
Since the different devices exposing protocols for a same WWAN hardware do not necessarily know about each others (e.g. two different USB interfaces, PCI/MHI channel devices...) and can be created/removed in different orders, the WWAN core ensures that all WAN ports contributing to the 'whole' WWAN feature are grouped under the same virtual WWAN device, relying on the provided parent device (e.g. mhi controller, USB device). It's a 'trick' I copied from Johannes's earlier WWAN subsystem proposal.
This initial version is purposely minimalist, it's essentially moving the generic part of the previously proposed mhi_wwan_ctrl driver inside a common WWAN framework, but the implementation is open and flexible enough to allow extension for further drivers.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|