Commit 88827353 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 764a4af9 d7340f46
...@@ -24,15 +24,7 @@ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id) ...@@ -24,15 +24,7 @@ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id)
return -EIO; return -EIO;
} }
/* check for the interafce id return ipc_mux_open_session(ipc_imem->mux, if_id);
* if if_id 1 to 8 then create IP MUX channel sessions.
* To start MUX session from 0 as network interface id would start
* from 1 so map it to if_id = if_id - 1
*/
if (if_id >= IP_MUX_SESSION_START && if_id <= IP_MUX_SESSION_END)
return ipc_mux_open_session(ipc_imem->mux, if_id - 1);
return -EINVAL;
} }
/* Release a net link to CP. */ /* Release a net link to CP. */
...@@ -41,7 +33,7 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id, ...@@ -41,7 +33,7 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id,
{ {
if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START && if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START &&
if_id <= IP_MUX_SESSION_END) if_id <= IP_MUX_SESSION_END)
ipc_mux_close_session(ipc_imem->mux, if_id - 1); ipc_mux_close_session(ipc_imem->mux, if_id);
} }
/* Tasklet call to do uplink transfer. */ /* Tasklet call to do uplink transfer. */
...@@ -83,13 +75,8 @@ int ipc_imem_sys_wwan_transmit(struct iosm_imem *ipc_imem, ...@@ -83,13 +75,8 @@ int ipc_imem_sys_wwan_transmit(struct iosm_imem *ipc_imem,
goto out; goto out;
} }
if (if_id >= IP_MUX_SESSION_START && if_id <= IP_MUX_SESSION_END)
/* Route the UL packet through IP MUX Layer */ /* Route the UL packet through IP MUX Layer */
ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id, skb);
if_id - 1, skb);
else
dev_err(ipc_imem->dev,
"invalid if_id %d: ", if_id);
out: out:
return ret; return ret;
} }
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
#define BOOT_CHECK_DEFAULT_TIMEOUT 400 #define BOOT_CHECK_DEFAULT_TIMEOUT 400
/* IP MUX channel range */ /* IP MUX channel range */
#define IP_MUX_SESSION_START 1 #define IP_MUX_SESSION_START 0
#define IP_MUX_SESSION_END 8 #define IP_MUX_SESSION_END 7
/* Default IP MUX channel */ /* Default IP MUX channel */
#define IP_MUX_SESSION_DEFAULT 1 #define IP_MUX_SESSION_DEFAULT 0
/** /**
* ipc_imem_sys_port_open - Open a port link to CP. * ipc_imem_sys_port_open - Open a port link to CP.
......
...@@ -288,7 +288,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id, ...@@ -288,7 +288,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id,
/* Pass the packet to the netif layer. */ /* Pass the packet to the netif layer. */
dest_skb->priority = service_class; dest_skb->priority = service_class;
return ipc_wwan_receive(wwan, dest_skb, false, if_id + 1); return ipc_wwan_receive(wwan, dest_skb, false, if_id);
} }
/* Decode Flow Credit Table in the block */ /* Decode Flow Credit Table in the block */
......
...@@ -37,7 +37,7 @@ void ipc_uevent_send(struct device *dev, char *uevent) ...@@ -37,7 +37,7 @@ void ipc_uevent_send(struct device *dev, char *uevent)
/* Store the device and event information */ /* Store the device and event information */
info->dev = dev; info->dev = dev;
snprintf(info->uevent, MAX_UEVENT_LEN, "%s: %s", dev_name(dev), uevent); snprintf(info->uevent, MAX_UEVENT_LEN, "IOSM_EVENT=%s", uevent);
/* Schedule uevent in process context using work queue */ /* Schedule uevent in process context using work queue */
schedule_work(&info->work); schedule_work(&info->work);
......
...@@ -107,6 +107,7 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, ...@@ -107,6 +107,7 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
{ {
struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev); struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev);
struct iosm_wwan *ipc_wwan = priv->ipc_wwan; struct iosm_wwan *ipc_wwan = priv->ipc_wwan;
unsigned int len = skb->len;
int if_id = priv->if_id; int if_id = priv->if_id;
int ret; int ret;
...@@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, ...@@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
/* Return code of zero is success */ /* Return code of zero is success */
if (ret == 0) { if (ret == 0) {
netdev->stats.tx_packets++;
netdev->stats.tx_bytes += len;
ret = NETDEV_TX_OK; ret = NETDEV_TX_OK;
} else if (ret == -EBUSY) { } else if (ret == -EBUSY) {
ret = NETDEV_TX_BUSY; ret = NETDEV_TX_BUSY;
...@@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, ...@@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
ret); ret);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return ret; netdev->stats.tx_dropped++;
return NETDEV_TX_OK;
} }
/* Ops structure for wwan net link */ /* Ops structure for wwan net link */
...@@ -158,6 +162,7 @@ static void ipc_wwan_setup(struct net_device *iosm_dev) ...@@ -158,6 +162,7 @@ static void ipc_wwan_setup(struct net_device *iosm_dev)
iosm_dev->priv_flags |= IFF_NO_QUEUE; iosm_dev->priv_flags |= IFF_NO_QUEUE;
iosm_dev->type = ARPHRD_NONE; iosm_dev->type = ARPHRD_NONE;
iosm_dev->mtu = ETH_DATA_LEN;
iosm_dev->min_mtu = ETH_MIN_MTU; iosm_dev->min_mtu = ETH_MIN_MTU;
iosm_dev->max_mtu = ETH_MAX_MTU; iosm_dev->max_mtu = ETH_MAX_MTU;
...@@ -252,8 +257,8 @@ int ipc_wwan_receive(struct iosm_wwan *ipc_wwan, struct sk_buff *skb_arg, ...@@ -252,8 +257,8 @@ int ipc_wwan_receive(struct iosm_wwan *ipc_wwan, struct sk_buff *skb_arg,
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
if (if_id < (IP_MUX_SESSION_START - 1) || if (if_id < IP_MUX_SESSION_START ||
if_id > (IP_MUX_SESSION_END - 1)) { if_id > IP_MUX_SESSION_END) {
ret = -EINVAL; ret = -EINVAL;
goto free; goto free;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment