Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'wwan-iosm-fixes'

M Chetan Kumar says:

====================
net: wwan: iosm: fixes

This patch series contains IOSM Driver fixes and details are
are mentioned below.

Patch1: Corrects uevent reporting format key=value pair.
Patch2: Removes redundant IP session checks.
Patch3: Correct link-Id number to be in sycn with MBIM session Id.
Patch4: Update netdev tx stats.
Patch5: Set netdev default mtu size.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+17 -25
+4 -17
drivers/net/wwan/iosm/iosm_ipc_imem_ops.c
··· 24 24 return -EIO; 25 25 } 26 26 27 - /* check for the interafce id 28 - * if if_id 1 to 8 then create IP MUX channel sessions. 29 - * To start MUX session from 0 as network interface id would start 30 - * from 1 so map it to if_id = if_id - 1 31 - */ 32 - if (if_id >= IP_MUX_SESSION_START && if_id <= IP_MUX_SESSION_END) 33 - return ipc_mux_open_session(ipc_imem->mux, if_id - 1); 34 - 35 - return -EINVAL; 27 + return ipc_mux_open_session(ipc_imem->mux, if_id); 36 28 } 37 29 38 30 /* Release a net link to CP. */ ··· 33 41 { 34 42 if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START && 35 43 if_id <= IP_MUX_SESSION_END) 36 - ipc_mux_close_session(ipc_imem->mux, if_id - 1); 44 + ipc_mux_close_session(ipc_imem->mux, if_id); 37 45 } 38 46 39 47 /* Tasklet call to do uplink transfer. */ ··· 75 83 goto out; 76 84 } 77 85 78 - if (if_id >= IP_MUX_SESSION_START && if_id <= IP_MUX_SESSION_END) 79 - /* Route the UL packet through IP MUX Layer */ 80 - ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, 81 - if_id - 1, skb); 82 - else 83 - dev_err(ipc_imem->dev, 84 - "invalid if_id %d: ", if_id); 86 + /* Route the UL packet through IP MUX Layer */ 87 + ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id, skb); 85 88 out: 86 89 return ret; 87 90 }
+3 -3
drivers/net/wwan/iosm/iosm_ipc_imem_ops.h
··· 27 27 #define BOOT_CHECK_DEFAULT_TIMEOUT 400 28 28 29 29 /* IP MUX channel range */ 30 - #define IP_MUX_SESSION_START 1 31 - #define IP_MUX_SESSION_END 8 30 + #define IP_MUX_SESSION_START 0 31 + #define IP_MUX_SESSION_END 7 32 32 33 33 /* Default IP MUX channel */ 34 - #define IP_MUX_SESSION_DEFAULT 1 34 + #define IP_MUX_SESSION_DEFAULT 0 35 35 36 36 /** 37 37 * ipc_imem_sys_port_open - Open a port link to CP.
+1 -1
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
··· 288 288 /* Pass the packet to the netif layer. */ 289 289 dest_skb->priority = service_class; 290 290 291 - return ipc_wwan_receive(wwan, dest_skb, false, if_id + 1); 291 + return ipc_wwan_receive(wwan, dest_skb, false, if_id); 292 292 } 293 293 294 294 /* Decode Flow Credit Table in the block */
+1 -1
drivers/net/wwan/iosm/iosm_ipc_uevent.c
··· 37 37 38 38 /* Store the device and event information */ 39 39 info->dev = dev; 40 - snprintf(info->uevent, MAX_UEVENT_LEN, "%s: %s", dev_name(dev), uevent); 40 + snprintf(info->uevent, MAX_UEVENT_LEN, "IOSM_EVENT=%s", uevent); 41 41 42 42 /* Schedule uevent in process context using work queue */ 43 43 schedule_work(&info->work);
+8 -3
drivers/net/wwan/iosm/iosm_ipc_wwan.c
··· 107 107 { 108 108 struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev); 109 109 struct iosm_wwan *ipc_wwan = priv->ipc_wwan; 110 + unsigned int len = skb->len; 110 111 int if_id = priv->if_id; 111 112 int ret; 112 113 ··· 124 123 125 124 /* Return code of zero is success */ 126 125 if (ret == 0) { 126 + netdev->stats.tx_packets++; 127 + netdev->stats.tx_bytes += len; 127 128 ret = NETDEV_TX_OK; 128 129 } else if (ret == -EBUSY) { 129 130 ret = NETDEV_TX_BUSY; ··· 143 140 ret); 144 141 145 142 dev_kfree_skb_any(skb); 146 - return ret; 143 + netdev->stats.tx_dropped++; 144 + return NETDEV_TX_OK; 147 145 } 148 146 149 147 /* Ops structure for wwan net link */ ··· 162 158 iosm_dev->priv_flags |= IFF_NO_QUEUE; 163 159 164 160 iosm_dev->type = ARPHRD_NONE; 161 + iosm_dev->mtu = ETH_DATA_LEN; 165 162 iosm_dev->min_mtu = ETH_MIN_MTU; 166 163 iosm_dev->max_mtu = ETH_MAX_MTU; 167 164 ··· 257 252 258 253 skb->pkt_type = PACKET_HOST; 259 254 260 - if (if_id < (IP_MUX_SESSION_START - 1) || 261 - if_id > (IP_MUX_SESSION_END - 1)) { 255 + if (if_id < IP_MUX_SESSION_START || 256 + if_id > IP_MUX_SESSION_END) { 262 257 ret = -EINVAL; 263 258 goto free; 264 259 }