Commit 2ffbbf0f authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan Committed by David S. Miller

net: qualcomm: rmnet: Fix the return value of rmnet_rx_handler()

Since packet is always consumed by rmnet_rx_handler(), we always
return RX_HANDLER_CONSUMED. There is no need to pass on this
value through multiple functions.
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc49c8ff
...@@ -43,7 +43,7 @@ static void rmnet_set_skb_proto(struct sk_buff *skb) ...@@ -43,7 +43,7 @@ static void rmnet_set_skb_proto(struct sk_buff *skb)
/* Generic handler */ /* Generic handler */
static rx_handler_result_t static void
rmnet_deliver_skb(struct sk_buff *skb) rmnet_deliver_skb(struct sk_buff *skb)
{ {
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
...@@ -53,12 +53,11 @@ rmnet_deliver_skb(struct sk_buff *skb) ...@@ -53,12 +53,11 @@ rmnet_deliver_skb(struct sk_buff *skb)
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb_set_mac_header(skb, 0); skb_set_mac_header(skb, 0);
netif_receive_skb(skb); netif_receive_skb(skb);
return RX_HANDLER_CONSUMED;
} }
/* MAP handler */ /* MAP handler */
static rx_handler_result_t static void
__rmnet_map_ingress_handler(struct sk_buff *skb, __rmnet_map_ingress_handler(struct sk_buff *skb,
struct rmnet_port *port) struct rmnet_port *port)
{ {
...@@ -91,31 +90,27 @@ __rmnet_map_ingress_handler(struct sk_buff *skb, ...@@ -91,31 +90,27 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
skb_pull(skb, sizeof(struct rmnet_map_header)); skb_pull(skb, sizeof(struct rmnet_map_header));
skb_trim(skb, len); skb_trim(skb, len);
rmnet_set_skb_proto(skb); rmnet_set_skb_proto(skb);
return rmnet_deliver_skb(skb); rmnet_deliver_skb(skb);
return;
free_skb: free_skb:
kfree_skb(skb); kfree_skb(skb);
return RX_HANDLER_CONSUMED;
} }
static rx_handler_result_t static void
rmnet_map_ingress_handler(struct sk_buff *skb, rmnet_map_ingress_handler(struct sk_buff *skb,
struct rmnet_port *port) struct rmnet_port *port)
{ {
struct sk_buff *skbn; struct sk_buff *skbn;
int rc;
if (port->ingress_data_format & RMNET_INGRESS_FORMAT_DEAGGREGATION) { if (port->ingress_data_format & RMNET_INGRESS_FORMAT_DEAGGREGATION) {
while ((skbn = rmnet_map_deaggregate(skb)) != NULL) while ((skbn = rmnet_map_deaggregate(skb)) != NULL)
__rmnet_map_ingress_handler(skbn, port); __rmnet_map_ingress_handler(skbn, port);
consume_skb(skb); consume_skb(skb);
rc = RX_HANDLER_CONSUMED;
} else { } else {
rc = __rmnet_map_ingress_handler(skb, port); __rmnet_map_ingress_handler(skb, port);
} }
return rc;
} }
static int rmnet_map_egress_handler(struct sk_buff *skb, static int rmnet_map_egress_handler(struct sk_buff *skb,
...@@ -149,15 +144,13 @@ static int rmnet_map_egress_handler(struct sk_buff *skb, ...@@ -149,15 +144,13 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
return RMNET_MAP_SUCCESS; return RMNET_MAP_SUCCESS;
} }
static rx_handler_result_t static void
rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev) rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev)
{ {
if (bridge_dev) { if (bridge_dev) {
skb->dev = bridge_dev; skb->dev = bridge_dev;
dev_queue_xmit(skb); dev_queue_xmit(skb);
} }
return RX_HANDLER_CONSUMED;
} }
/* Ingress / Egress Entry Points */ /* Ingress / Egress Entry Points */
...@@ -168,13 +161,12 @@ rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev) ...@@ -168,13 +161,12 @@ rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev)
*/ */
rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb) rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
{ {
int rc = RX_HANDLER_CONSUMED;
struct sk_buff *skb = *pskb; struct sk_buff *skb = *pskb;
struct rmnet_port *port; struct rmnet_port *port;
struct net_device *dev; struct net_device *dev;
if (!skb) if (!skb)
return RX_HANDLER_CONSUMED; goto done;
dev = skb->dev; dev = skb->dev;
port = rmnet_get_port(dev); port = rmnet_get_port(dev);
...@@ -182,14 +174,15 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb) ...@@ -182,14 +174,15 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
switch (port->rmnet_mode) { switch (port->rmnet_mode) {
case RMNET_EPMODE_VND: case RMNET_EPMODE_VND:
if (port->ingress_data_format & RMNET_INGRESS_FORMAT_MAP) if (port->ingress_data_format & RMNET_INGRESS_FORMAT_MAP)
rc = rmnet_map_ingress_handler(skb, port); rmnet_map_ingress_handler(skb, port);
break; break;
case RMNET_EPMODE_BRIDGE: case RMNET_EPMODE_BRIDGE:
rc = rmnet_bridge_handler(skb, port->bridge_ep); rmnet_bridge_handler(skb, port->bridge_ep);
break; break;
} }
return rc; done:
return RX_HANDLER_CONSUMED;
} }
/* Modifies packet as per logical endpoint configuration and egress data format /* Modifies packet as per logical endpoint configuration and egress data format
......
...@@ -80,7 +80,6 @@ u8 rmnet_map_demultiplex(struct sk_buff *skb); ...@@ -80,7 +80,6 @@ u8 rmnet_map_demultiplex(struct sk_buff *skb);
struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb); struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb);
struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb, struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb,
int hdrlen, int pad); int hdrlen, int pad);
rx_handler_result_t rmnet_map_command(struct sk_buff *skb, void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port);
struct rmnet_port *port);
#endif /* _RMNET_MAP_H_ */ #endif /* _RMNET_MAP_H_ */
...@@ -76,8 +76,7 @@ static void rmnet_map_send_ack(struct sk_buff *skb, ...@@ -76,8 +76,7 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
/* Process MAP command frame and send N/ACK message as appropriate. Message cmd /* Process MAP command frame and send N/ACK message as appropriate. Message cmd
* name is decoded here and appropriate handler is called. * name is decoded here and appropriate handler is called.
*/ */
rx_handler_result_t rmnet_map_command(struct sk_buff *skb, void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port)
struct rmnet_port *port)
{ {
struct rmnet_map_control_command *cmd; struct rmnet_map_control_command *cmd;
unsigned char command_name; unsigned char command_name;
...@@ -102,5 +101,4 @@ rx_handler_result_t rmnet_map_command(struct sk_buff *skb, ...@@ -102,5 +101,4 @@ rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
} }
if (rc == RMNET_MAP_COMMAND_ACK) if (rc == RMNET_MAP_COMMAND_ACK)
rmnet_map_send_ack(skb, rc); rmnet_map_send_ack(skb, rc);
return RX_HANDLER_CONSUMED;
} }
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