Skip to content

Commit

Permalink
r8169: replace get_protocol with vlan_get_protocol
Browse files Browse the repository at this point in the history
This patch is basically the same as 6e74d17 ("r8152: replace
get_protocol with vlan_get_protocol"). Use vlan_get_protocol
instead of duplicating the functionality.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed May 2, 2018
1 parent 353af85 commit 4ff3646
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -6510,18 +6510,6 @@ static int msdn_giant_send_check(struct sk_buff *skb)
return ret;
}

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;
}

static bool rtl8169_tso_csum_v1(struct rtl8169_private *tp,
struct sk_buff *skb, u32 *opts)
{
Expand Down Expand Up @@ -6558,7 +6546,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
return false;
}

switch (get_protocol(skb)) {
switch (vlan_get_protocol(skb)) {
case htons(ETH_P_IP):
opts[0] |= TD1_GTSENV4;
break;
Expand Down Expand Up @@ -6590,7 +6578,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
return false;
}

switch (get_protocol(skb)) {
switch (vlan_get_protocol(skb)) {
case htons(ETH_P_IP):
opts[1] |= TD1_IPv4_CS;
ip_protocol = ip_hdr(skb)->protocol;
Expand Down

0 comments on commit 4ff3646

Please sign in to comment.