summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2015-02-06 11:30:50 +0800
committerDavid S. Miller <davem@davemloft.net>2015-02-07 22:46:25 -0800
commit6e74d1749a338d1435b413a92968f7e3de7c0278 (patch)
tree4f23c97b24cd15ee4774f9666398f3456abd89e5 /drivers
parentccc39faf58113b33ed100b7c24d806538ac75df7 (diff)
downloadlinux-stable-6e74d1749a338d1435b413a92968f7e3de7c0278.tar.gz
linux-stable-6e74d1749a338d1435b413a92968f7e3de7c0278.tar.bz2
linux-stable-6e74d1749a338d1435b413a92968f7e3de7c0278.zip
r8152: replace get_protocol with vlan_get_protocol
vlan_get_protocol() has been defined and use it to replace get_protocol(). Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/r8152.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 8bdd4773233e..24e6aef907eb 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1330,18 +1330,6 @@ static struct tx_agg *r8152_get_tx_agg(struct r8152 *tp)
return agg;
}
-static inline __be16 get_protocol(struct sk_buff *skb)
-{
- __be16 protocol;
-
- if (skb->protocol == htons(ETH_P_8021Q))
- protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
- else
- protocol = skb->protocol;
-
- return protocol;
-}
-
/* r8152_csum_workaround()
* The hw limites the value the transport offset. When the offset is out of the
* range, calculate the checksum by sw.
@@ -1447,7 +1435,7 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
goto unavailable;
}
- switch (get_protocol(skb)) {
+ switch (vlan_get_protocol(skb)) {
case htons(ETH_P_IP):
opts1 |= GTSENDV4;
break;
@@ -1478,7 +1466,7 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
goto unavailable;
}
- switch (get_protocol(skb)) {
+ switch (vlan_get_protocol(skb)) {
case htons(ETH_P_IP):
opts2 |= IPV4_CS;
ip_protocol = ip_hdr(skb)->protocol;