Skip to content

Commit 8882735

Browse files
committed
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 <[email protected]>
2 parents 764a4af + d7340f4 commit 8882735

File tree

5 files changed

+17
-25
lines changed

5 files changed

+17
-25
lines changed

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id)
2424
return -EIO;
2525
}
2626

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);
3628
}
3729

3830
/* Release a net link to CP. */
@@ -41,7 +33,7 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id,
4133
{
4234
if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START &&
4335
if_id <= IP_MUX_SESSION_END)
44-
ipc_mux_close_session(ipc_imem->mux, if_id - 1);
36+
ipc_mux_close_session(ipc_imem->mux, if_id);
4537
}
4638

4739
/* Tasklet call to do uplink transfer. */
@@ -83,13 +75,8 @@ int ipc_imem_sys_wwan_transmit(struct iosm_imem *ipc_imem,
8375
goto out;
8476
}
8577

86-
if (if_id >= IP_MUX_SESSION_START && if_id <= IP_MUX_SESSION_END)
87-
/* Route the UL packet through IP MUX Layer */
88-
ret = ipc_mux_ul_trigger_encode(ipc_imem->mux,
89-
if_id - 1, skb);
90-
else
91-
dev_err(ipc_imem->dev,
92-
"invalid if_id %d: ", if_id);
78+
/* Route the UL packet through IP MUX Layer */
79+
ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id, skb);
9380
out:
9481
return ret;
9582
}

drivers/net/wwan/iosm/iosm_ipc_imem_ops.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#define BOOT_CHECK_DEFAULT_TIMEOUT 400
2828

2929
/* 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
3232

3333
/* Default IP MUX channel */
34-
#define IP_MUX_SESSION_DEFAULT 1
34+
#define IP_MUX_SESSION_DEFAULT 0
3535

3636
/**
3737
* ipc_imem_sys_port_open - Open a port link to CP.

drivers/net/wwan/iosm/iosm_ipc_mux_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id,
288288
/* Pass the packet to the netif layer. */
289289
dest_skb->priority = service_class;
290290

291-
return ipc_wwan_receive(wwan, dest_skb, false, if_id + 1);
291+
return ipc_wwan_receive(wwan, dest_skb, false, if_id);
292292
}
293293

294294
/* Decode Flow Credit Table in the block */

drivers/net/wwan/iosm/iosm_ipc_uevent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void ipc_uevent_send(struct device *dev, char *uevent)
3737

3838
/* Store the device and event information */
3939
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);
4141

4242
/* Schedule uevent in process context using work queue */
4343
schedule_work(&info->work);

drivers/net/wwan/iosm/iosm_ipc_wwan.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
107107
{
108108
struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev);
109109
struct iosm_wwan *ipc_wwan = priv->ipc_wwan;
110+
unsigned int len = skb->len;
110111
int if_id = priv->if_id;
111112
int ret;
112113

@@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
123124

124125
/* Return code of zero is success */
125126
if (ret == 0) {
127+
netdev->stats.tx_packets++;
128+
netdev->stats.tx_bytes += len;
126129
ret = NETDEV_TX_OK;
127130
} else if (ret == -EBUSY) {
128131
ret = NETDEV_TX_BUSY;
@@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
140143
ret);
141144

142145
dev_kfree_skb_any(skb);
143-
return ret;
146+
netdev->stats.tx_dropped++;
147+
return NETDEV_TX_OK;
144148
}
145149

146150
/* Ops structure for wwan net link */
@@ -158,6 +162,7 @@ static void ipc_wwan_setup(struct net_device *iosm_dev)
158162
iosm_dev->priv_flags |= IFF_NO_QUEUE;
159163

160164
iosm_dev->type = ARPHRD_NONE;
165+
iosm_dev->mtu = ETH_DATA_LEN;
161166
iosm_dev->min_mtu = ETH_MIN_MTU;
162167
iosm_dev->max_mtu = ETH_MAX_MTU;
163168

@@ -252,8 +257,8 @@ int ipc_wwan_receive(struct iosm_wwan *ipc_wwan, struct sk_buff *skb_arg,
252257

253258
skb->pkt_type = PACKET_HOST;
254259

255-
if (if_id < (IP_MUX_SESSION_START - 1) ||
256-
if_id > (IP_MUX_SESSION_END - 1)) {
260+
if (if_id < IP_MUX_SESSION_START ||
261+
if_id > IP_MUX_SESSION_END) {
257262
ret = -EINVAL;
258263
goto free;
259264
}

0 commit comments

Comments
 (0)