aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wwan/iosm
AgeCommit message (Collapse)AuthorFilesLines
2021-08-16net: iosm: Prevent underflow in ipc_chnl_cfg_get()Dan Carpenter1-4/+3
The bounds check on "index" doesn't catch negative values. Using ARRAY_SIZE() directly is more readable and more robust because it prevents negative values for "index". Fortunately we only pass valid values to ipc_chnl_cfg_get() so this patch does not affect runtime. Reported-by: Solomon Ucko <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-08-05net: wwan: iosm: fix recursive lock acquire in unregisterM Chetan Kumar1-1/+1
Calling unregister_netdevice() inside wwan del link is trying to acquire the held lock in ndo_stop_cb(). Instead, queue net dev to be unregistered later. Signed-off-by: M Chetan Kumar <[email protected]> Reviewed-by: Loic Poulain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-08-05net: wwan: iosm: correct data protocol mask bitM Chetan Kumar1-2/+2
Correct ul/dl data protocol mask bit to know which protocol capability does device implement. Signed-off-by: M Chetan Kumar <[email protected]> Reviewed-by: Loic Poulain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-08-05net: wwan: iosm: endianness type correctionM Chetan Kumar2-3/+3
Endianness type correction for nr_of_bytes. This field is exchanged as part of host-device protocol communication. Signed-off-by: M Chetan Kumar <[email protected]> Reviewed-by: Loic Poulain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-08-05net: wwan: iosm: fix lkp buildbot warningM Chetan Kumar1-2/+2
Correct td buffer type casting & format specifier to fix lkp buildbot warning. Reported-by: kernel test robot <[email protected]> Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-07-01net: wwan: iosm: set default mtuM Chetan Kumar1-0/+1
Set netdev default mtu size to 1500. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-07-01net: wwan: iosm: fix netdev tx statsM Chetan Kumar1-1/+5
Update tx stats on successful packet consume, drop. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-07-01net: wwan: iosm: correct link-id handlingM Chetan Kumar4-9/+9
Link ID to be kept intact with MBIM session ID Ex: ID 0 should be associated to MBIM session ID 0. Reported-by: Loic Poulain <[email protected]> Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-07-01net: wwan: iosm: remove reduandant checkM Chetan Kumar1-16/+3
Remove reduandant IP session id check since required checks are in place under caller. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-07-01net: wwan: iosm: fix uevent reportingM Chetan Kumar1-1/+1
Change uevent env variable name to IOSM_EVENT & correct reporting format to key=value pair. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-22wwan: core: add WWAN common private data for netdevSergey Ryazanov1-6/+6
The WWAN core not only multiplex the netdev configuration data, but process it too, and needs some space to store its private data associated with the netdev. Add a structure to keep common WWAN core data. The structure will be stored inside the netdev private data before WWAN driver private data and have a field to make it easier to access the driver data. Also add a helper function that simplifies drivers access to their data. At the moment we use the common WWAN private data to store the WWAN data link (channel) id at the time the link is created, and report it back to user using the .fill_info() RTNL callback. This should help the user to be aware which network interface is bound to which WWAN device data channel. Signed-off-by: Sergey Ryazanov <[email protected]> CC: M Chetan Kumar <[email protected]> CC: Intel Corporation <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-22net: iosm: create default link via WWAN coreSergey Ryazanov2-1/+5
Utilize the just introduced WWAN core feature to create a default netdev for the default data (IP MUX) channel. Signed-off-by: Sergey Ryazanov <[email protected]> CC: M Chetan Kumar <[email protected]> CC: Intel Corporation <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-22wwan: core: support default netdev creationSergey Ryazanov1-1/+2
Most, if not each WWAN device driver will create a netdev for the default data channel. Therefore, add an option for the WWAN netdev ops registration function to create a default netdev for the WWAN device. A WWAN device driver should pass a default data channel link id to the ops registering function to request the creation of a default netdev, or a special value WWAN_NO_DEFAULT_LINK to inform the WWAN core that the default netdev should not be created. For now, only wwan_hwsim utilize the default link creation option. Other drivers will be reworked next. Signed-off-by: Sergey Ryazanov <[email protected]> CC: M Chetan Kumar <[email protected]> CC: Intel Corporation <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-22net: iosm: drop custom netdev(s) removingSergey Ryazanov1-14/+1
Since the last commit, the WWAN core will remove all our network interfaces for us at the time of the WWAN netdev ops unregistering. Therefore, we can safely drop the custom code that cleans the list of created netdevs. Anyway it no longer removes any netdev, since all netdevs were removed earlier in the wwan_unregister_ops() call. Signed-off-by: Sergey Ryazanov <[email protected]> Reviewed-by: M Chetan Kumar <[email protected]> CC: M Chetan Kumar <[email protected]> CC: Intel Corporation <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-21net: iosm: remove an unnecessary NULL checkDan Carpenter1-1/+1
The address of &ipc_mux->ul_adb can't be NULL because it points to the middle of a non-NULL struct. Fixes: 9413491e20e1 ("net: iosm: encode or decode datagram") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-16net: iosm: remove the repeated declaration and commentShaokun Zhang1-10/+0
Function 'ipc_mmio_get_cp_version' is declared twice, so remove the repeated declaration and wrong comments. Cc: M Chetan Kumar <[email protected]> Cc: Intel Corporation <[email protected]> Cc: David S. Miller <[email protected]> Cc: Jakub Kicinski <[email protected]> Signed-off-by: Shaokun Zhang <[email protected]> Reviewed-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-16net: iosm: add missing MODULE_DEVICE_TABLEZou Wei1-0/+1
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zou Wei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-14net: wwan: iosm: Remove DEBUG flagLoic Poulain1-3/+0
Author forgot to remove that flag. Fixes: f7af616c632e ("net: iosm: infrastructure") Reported-by: Leon Romanovsky <[email protected]> Signed-off-by: Loic Poulain <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: infrastructureM Chetan Kumar1-0/+26
1) Kconfig & Makefile changes for IOSM Driver compilation. 2) Add IOSM Driver documentation. 3) Modified MAINTAINER file for IOSM Driver addition. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: net driverM Chetan Kumar2-0/+406
1) Create net device & implement net operations for data/IP communication. 2) Bind IP Link to mux IP session for simultaneous IP traffic. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: uevent supportM Chetan Kumar2-0/+85
Report modem status via uevent. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: protocol operationsM Chetan Kumar2-0/+996
1) Update UL/DL transfer descriptors in message ring. 2) Define message set for pipe/sleep protocol. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: shared memory protocolM Chetan Kumar2-0/+520
1) Defines messaging protocol for handling Transfer Descriptor in both UL/DL direction. 2) Ring buffer management. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: power managementM Chetan Kumar2-0/+540
Implements state machine to handle host & device sleep. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: encode or decode datagramM Chetan Kumar2-0/+1103
1) Encode UL packet into datagram. 2) Decode DL datagram and route it to network layer. 3) Supports credit based flow control. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: multiplex IP sessionsM Chetan Kumar2-0/+798
Establish IP session between host-device & session management. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: bottom halfM Chetan Kumar2-0/+299
1) Bottom half(tasklet) for IRQ and task processing. 2) Tasks are processed asynchronous and synchronously. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: wwan port control deviceM Chetan Kumar2-0/+135
Implements wwan port for MBIM & AT protocol communication Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: channel configurationM Chetan Kumar2-0/+147
Defines pipes & channel configurations like channel type, pipe mappings, No. of transfer descriptors and transfer buffer size etc. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: shared memory I/O operationsM Chetan Kumar2-0/+444
1) Binds logical channel between host-device for communication. 2) Implements device specific(Char/Net) IO operations. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: shared memory IPC interfaceM Chetan Kumar2-0/+1942
1) Initializes shared memory for host-device communication. 2) Allocate resources required for control & data operations. 3) Transfers the Device IRQ to IPC execution thread. 4) Defines the timer cbs for async events. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: mmio scratchpadM Chetan Kumar2-0/+416
1) Initializes the Scratchpad region for Host-Device communication. 2) Exposes device capabilities like chip info and device execution stages. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: irq handlingM Chetan Kumar2-0/+123
1) Request interrupt vector, frees allocated resource. 2) Registers IRQ handler. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-06-13net: iosm: entry pointM Chetan Kumar2-0/+788
1) Register IOSM driver with kernel to manage Intel WWAN PCIe device(PCI_VENDOR_ID_INTEL, INTEL_CP_DEVICE_7560_ID). 2) Exposes the EP PCIe device capability to Host PCIe core. 3) Initializes PCIe EP configuration and defines PCIe driver probe, remove and power management OPS. 4) Allocate and map(dma) skb memory for data communication from device to kernel and vice versa. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>