aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/jme.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/jme.c')
-rw-r--r--drivers/net/jme.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 0f31497833df..b705ad3a53a7 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -37,6 +37,7 @@
37#include <linux/tcp.h> 37#include <linux/tcp.h>
38#include <linux/udp.h> 38#include <linux/udp.h>
39#include <linux/if_vlan.h> 39#include <linux/if_vlan.h>
40#include <linux/slab.h>
40#include <net/ip6_checksum.h> 41#include <net/ip6_checksum.h>
41#include "jme.h" 42#include "jme.h"
42 43
@@ -946,6 +947,8 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx)
946 jme->jme_vlan_rx(skb, jme->vlgrp, 947 jme->jme_vlan_rx(skb, jme->vlgrp,
947 le16_to_cpu(rxdesc->descwb.vlan)); 948 le16_to_cpu(rxdesc->descwb.vlan));
948 NET_STAT(jme).rx_bytes += 4; 949 NET_STAT(jme).rx_bytes += 4;
950 } else {
951 dev_kfree_skb(skb);
949 } 952 }
950 } else { 953 } else {
951 jme->jme_rx(skb); 954 jme->jme_rx(skb);
@@ -2081,12 +2084,45 @@ jme_tx_timeout(struct net_device *netdev)
2081 jme_reset_link(jme); 2084 jme_reset_link(jme);
2082} 2085}
2083 2086
2087static inline void jme_pause_rx(struct jme_adapter *jme)
2088{
2089 atomic_dec(&jme->link_changing);
2090
2091 jme_set_rx_pcc(jme, PCC_OFF);
2092 if (test_bit(JME_FLAG_POLL, &jme->flags)) {
2093 JME_NAPI_DISABLE(jme);
2094 } else {
2095 tasklet_disable(&jme->rxclean_task);
2096 tasklet_disable(&jme->rxempty_task);
2097 }
2098}
2099
2100static inline void jme_resume_rx(struct jme_adapter *jme)
2101{
2102 struct dynpcc_info *dpi = &(jme->dpi);
2103
2104 if (test_bit(JME_FLAG_POLL, &jme->flags)) {
2105 JME_NAPI_ENABLE(jme);
2106 } else {
2107 tasklet_hi_enable(&jme->rxclean_task);
2108 tasklet_hi_enable(&jme->rxempty_task);
2109 }
2110 dpi->cur = PCC_P1;
2111 dpi->attempt = PCC_P1;
2112 dpi->cnt = 0;
2113 jme_set_rx_pcc(jme, PCC_P1);
2114
2115 atomic_inc(&jme->link_changing);
2116}
2117
2084static void 2118static void
2085jme_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) 2119jme_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
2086{ 2120{
2087 struct jme_adapter *jme = netdev_priv(netdev); 2121 struct jme_adapter *jme = netdev_priv(netdev);
2088 2122
2123 jme_pause_rx(jme);
2089 jme->vlgrp = grp; 2124 jme->vlgrp = grp;
2125 jme_resume_rx(jme);
2090} 2126}
2091 2127
2092static void 2128static void