Lines Matching refs:jme
50 struct jme_adapter *jme = netdev_priv(netdev); in jme_mdio_read() local
54 jwrite32(jme, JME_SMI, SMI_OP_REQ | in jme_mdio_read()
61 val = jread32(jme, JME_SMI); in jme_mdio_read()
81 struct jme_adapter *jme = netdev_priv(netdev); in jme_mdio_write() local
84 jwrite32(jme, JME_SMI, SMI_OP_WRITE | SMI_OP_REQ | in jme_mdio_write()
91 if ((jread32(jme, JME_SMI) & SMI_OP_REQ) == 0) in jme_mdio_write()
100 jme_reset_phy_processor(struct jme_adapter *jme) in jme_reset_phy_processor() argument
104 jme_mdio_write(jme->dev, in jme_reset_phy_processor()
105 jme->mii_if.phy_id, in jme_reset_phy_processor()
109 if (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) in jme_reset_phy_processor()
110 jme_mdio_write(jme->dev, in jme_reset_phy_processor()
111 jme->mii_if.phy_id, in jme_reset_phy_processor()
115 val = jme_mdio_read(jme->dev, in jme_reset_phy_processor()
116 jme->mii_if.phy_id, in jme_reset_phy_processor()
119 jme_mdio_write(jme->dev, in jme_reset_phy_processor()
120 jme->mii_if.phy_id, in jme_reset_phy_processor()
125 jme_setup_wakeup_frame(struct jme_adapter *jme, in jme_setup_wakeup_frame() argument
133 jwrite32(jme, JME_WFOI, WFOI_CRC_SEL | (fnr & WFOI_FRAME_SEL)); in jme_setup_wakeup_frame()
135 jwrite32(jme, JME_WFODP, crc); in jme_setup_wakeup_frame()
142 jwrite32(jme, JME_WFOI, in jme_setup_wakeup_frame()
146 jwrite32(jme, JME_WFODP, mask[i]); in jme_setup_wakeup_frame()
152 jme_mac_rxclk_off(struct jme_adapter *jme) in jme_mac_rxclk_off() argument
154 jme->reg_gpreg1 |= GPREG1_RXCLKOFF; in jme_mac_rxclk_off()
155 jwrite32f(jme, JME_GPREG1, jme->reg_gpreg1); in jme_mac_rxclk_off()
159 jme_mac_rxclk_on(struct jme_adapter *jme) in jme_mac_rxclk_on() argument
161 jme->reg_gpreg1 &= ~GPREG1_RXCLKOFF; in jme_mac_rxclk_on()
162 jwrite32f(jme, JME_GPREG1, jme->reg_gpreg1); in jme_mac_rxclk_on()
166 jme_mac_txclk_off(struct jme_adapter *jme) in jme_mac_txclk_off() argument
168 jme->reg_ghc &= ~(GHC_TO_CLK_SRC | GHC_TXMAC_CLK_SRC); in jme_mac_txclk_off()
169 jwrite32f(jme, JME_GHC, jme->reg_ghc); in jme_mac_txclk_off()
173 jme_mac_txclk_on(struct jme_adapter *jme) in jme_mac_txclk_on() argument
175 u32 speed = jme->reg_ghc & GHC_SPEED; in jme_mac_txclk_on()
177 jme->reg_ghc |= GHC_TO_CLK_GPHY | GHC_TXMAC_CLK_GPHY; in jme_mac_txclk_on()
179 jme->reg_ghc |= GHC_TO_CLK_PCIE | GHC_TXMAC_CLK_PCIE; in jme_mac_txclk_on()
180 jwrite32f(jme, JME_GHC, jme->reg_ghc); in jme_mac_txclk_on()
184 jme_reset_ghc_speed(struct jme_adapter *jme) in jme_reset_ghc_speed() argument
186 jme->reg_ghc &= ~(GHC_SPEED | GHC_DPX); in jme_reset_ghc_speed()
187 jwrite32f(jme, JME_GHC, jme->reg_ghc); in jme_reset_ghc_speed()
191 jme_reset_250A2_workaround(struct jme_adapter *jme) in jme_reset_250A2_workaround() argument
193 jme->reg_gpreg1 &= ~(GPREG1_HALFMODEPATCH | in jme_reset_250A2_workaround()
195 jwrite32(jme, JME_GPREG1, jme->reg_gpreg1); in jme_reset_250A2_workaround()
199 jme_assert_ghc_reset(struct jme_adapter *jme) in jme_assert_ghc_reset() argument
201 jme->reg_ghc |= GHC_SWRST; in jme_assert_ghc_reset()
202 jwrite32f(jme, JME_GHC, jme->reg_ghc); in jme_assert_ghc_reset()
206 jme_clear_ghc_reset(struct jme_adapter *jme) in jme_clear_ghc_reset() argument
208 jme->reg_ghc &= ~GHC_SWRST; in jme_clear_ghc_reset()
209 jwrite32f(jme, JME_GHC, jme->reg_ghc); in jme_clear_ghc_reset()
213 jme_reset_mac_processor(struct jme_adapter *jme) in jme_reset_mac_processor() argument
220 jme_reset_ghc_speed(jme); in jme_reset_mac_processor()
221 jme_reset_250A2_workaround(jme); in jme_reset_mac_processor()
223 jme_mac_rxclk_on(jme); in jme_reset_mac_processor()
224 jme_mac_txclk_on(jme); in jme_reset_mac_processor()
226 jme_assert_ghc_reset(jme); in jme_reset_mac_processor()
228 jme_mac_rxclk_off(jme); in jme_reset_mac_processor()
229 jme_mac_txclk_off(jme); in jme_reset_mac_processor()
231 jme_clear_ghc_reset(jme); in jme_reset_mac_processor()
233 jme_mac_rxclk_on(jme); in jme_reset_mac_processor()
234 jme_mac_txclk_on(jme); in jme_reset_mac_processor()
236 jme_mac_rxclk_off(jme); in jme_reset_mac_processor()
237 jme_mac_txclk_off(jme); in jme_reset_mac_processor()
239 jwrite32(jme, JME_RXDBA_LO, 0x00000000); in jme_reset_mac_processor()
240 jwrite32(jme, JME_RXDBA_HI, 0x00000000); in jme_reset_mac_processor()
241 jwrite32(jme, JME_RXQDC, 0x00000000); in jme_reset_mac_processor()
242 jwrite32(jme, JME_RXNDA, 0x00000000); in jme_reset_mac_processor()
243 jwrite32(jme, JME_TXDBA_LO, 0x00000000); in jme_reset_mac_processor()
244 jwrite32(jme, JME_TXDBA_HI, 0x00000000); in jme_reset_mac_processor()
245 jwrite32(jme, JME_TXQDC, 0x00000000); in jme_reset_mac_processor()
246 jwrite32(jme, JME_TXNDA, 0x00000000); in jme_reset_mac_processor()
248 jwrite32(jme, JME_RXMCHT_LO, 0x00000000); in jme_reset_mac_processor()
249 jwrite32(jme, JME_RXMCHT_HI, 0x00000000); in jme_reset_mac_processor()
251 jme_setup_wakeup_frame(jme, mask, crc, i); in jme_reset_mac_processor()
252 if (jme->fpgaver) in jme_reset_mac_processor()
256 jwrite32(jme, JME_GPREG0, gpreg0); in jme_reset_mac_processor()
260 jme_clear_pm_enable_wol(struct jme_adapter *jme) in jme_clear_pm_enable_wol() argument
262 jwrite32(jme, JME_PMCS, PMCS_STMASK | jme->reg_pmcs); in jme_clear_pm_enable_wol()
266 jme_clear_pm_disable_wol(struct jme_adapter *jme) in jme_clear_pm_disable_wol() argument
268 jwrite32(jme, JME_PMCS, PMCS_STMASK); in jme_clear_pm_disable_wol()
272 jme_reload_eeprom(struct jme_adapter *jme) in jme_reload_eeprom() argument
277 val = jread32(jme, JME_SMBCSR); in jme_reload_eeprom()
281 jwrite32(jme, JME_SMBCSR, val); in jme_reload_eeprom()
283 jwrite32(jme, JME_SMBCSR, val); in jme_reload_eeprom()
288 if ((jread32(jme, JME_SMBCSR) & SMBCSR_RELOAD) == 0) in jme_reload_eeprom()
304 struct jme_adapter *jme = netdev_priv(netdev); in jme_load_macaddr() local
308 spin_lock_bh(&jme->macaddr_lock); in jme_load_macaddr()
309 val = jread32(jme, JME_RXUMA_LO); in jme_load_macaddr()
314 val = jread32(jme, JME_RXUMA_HI); in jme_load_macaddr()
318 spin_unlock_bh(&jme->macaddr_lock); in jme_load_macaddr()
322 jme_set_rx_pcc(struct jme_adapter *jme, int p) in jme_set_rx_pcc() argument
326 jwrite32(jme, JME_PCCRX0, in jme_set_rx_pcc()
331 jwrite32(jme, JME_PCCRX0, in jme_set_rx_pcc()
336 jwrite32(jme, JME_PCCRX0, in jme_set_rx_pcc()
341 jwrite32(jme, JME_PCCRX0, in jme_set_rx_pcc()
350 if (!(test_bit(JME_FLAG_POLL, &jme->flags))) in jme_set_rx_pcc()
351 netif_info(jme, rx_status, jme->dev, "Switched to PCC_P%d\n", p); in jme_set_rx_pcc()
355 jme_start_irq(struct jme_adapter *jme) in jme_start_irq() argument
357 register struct dynpcc_info *dpi = &(jme->dpi); in jme_start_irq()
359 jme_set_rx_pcc(jme, PCC_P1); in jme_start_irq()
364 jwrite32(jme, JME_PCCTX, in jme_start_irq()
373 jwrite32(jme, JME_IENS, INTR_ENABLE); in jme_start_irq()
377 jme_stop_irq(struct jme_adapter *jme) in jme_stop_irq() argument
382 jwrite32f(jme, JME_IENC, INTR_ENABLE); in jme_stop_irq()
386 jme_linkstat_from_phy(struct jme_adapter *jme) in jme_linkstat_from_phy() argument
390 phylink = jme_mdio_read(jme->dev, jme->mii_if.phy_id, 17); in jme_linkstat_from_phy()
391 bmsr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMSR); in jme_linkstat_from_phy()
399 jme_set_phyfifo_5level(struct jme_adapter *jme) in jme_set_phyfifo_5level() argument
401 jme_mdio_write(jme->dev, jme->mii_if.phy_id, 27, 0x0004); in jme_set_phyfifo_5level()
405 jme_set_phyfifo_8level(struct jme_adapter *jme) in jme_set_phyfifo_8level() argument
407 jme_mdio_write(jme->dev, jme->mii_if.phy_id, 27, 0x0000); in jme_set_phyfifo_8level()
413 struct jme_adapter *jme = netdev_priv(netdev); in jme_check_link() local
420 if (jme->fpgaver) in jme_check_link()
421 phylink = jme_linkstat_from_phy(jme); in jme_check_link()
423 phylink = jread32(jme, JME_PHY_LINK); in jme_check_link()
433 bmcr = jme_mdio_read(jme->dev, in jme_check_link()
434 jme->mii_if.phy_id, in jme_check_link()
457 if (jme->fpgaver) in jme_check_link()
458 phylink = jme_linkstat_from_phy(jme); in jme_check_link()
460 phylink = jread32(jme, JME_PHY_LINK); in jme_check_link()
468 if (jme->phylink == phylink) { in jme_check_link()
475 jme->phylink = phylink; in jme_check_link()
483 jme->reg_ghc |= GHC_SPEED_10M; in jme_check_link()
487 jme->reg_ghc |= GHC_SPEED_100M; in jme_check_link()
491 jme->reg_ghc |= GHC_SPEED_1000M; in jme_check_link()
499 jwrite32(jme, JME_TXMCS, TXMCS_DEFAULT); in jme_check_link()
500 jwrite32(jme, JME_TXTRHD, TXTRHD_FULLDUPLEX); in jme_check_link()
501 jme->reg_ghc |= GHC_DPX; in jme_check_link()
503 jwrite32(jme, JME_TXMCS, TXMCS_DEFAULT | in jme_check_link()
507 jwrite32(jme, JME_TXTRHD, TXTRHD_HALFDUPLEX); in jme_check_link()
510 jwrite32(jme, JME_GHC, jme->reg_ghc); in jme_check_link()
512 if (is_buggy250(jme->pdev->device, jme->chiprev)) { in jme_check_link()
513 jme->reg_gpreg1 &= ~(GPREG1_HALFMODEPATCH | in jme_check_link()
516 jme->reg_gpreg1 |= GPREG1_HALFMODEPATCH; in jme_check_link()
519 jme_set_phyfifo_8level(jme); in jme_check_link()
520 jme->reg_gpreg1 |= GPREG1_RSSPATCH; in jme_check_link()
523 jme_set_phyfifo_5level(jme); in jme_check_link()
524 jme->reg_gpreg1 |= GPREG1_RSSPATCH; in jme_check_link()
527 jme_set_phyfifo_8level(jme); in jme_check_link()
533 jwrite32(jme, JME_GPREG1, jme->reg_gpreg1); in jme_check_link()
541 netif_info(jme, link, jme->dev, "Link is up at %s\n", linkmsg); in jme_check_link()
547 netif_info(jme, link, jme->dev, "Link is down\n"); in jme_check_link()
548 jme->phylink = 0; in jme_check_link()
557 jme_setup_tx_resources(struct jme_adapter *jme) in jme_setup_tx_resources() argument
559 struct jme_ring *txring = &(jme->txring[0]); in jme_setup_tx_resources()
561 txring->alloc = dma_alloc_coherent(&(jme->pdev->dev), in jme_setup_tx_resources()
562 TX_RING_ALLOC_SIZE(jme->tx_ring_size), in jme_setup_tx_resources()
577 atomic_set(&txring->nr_free, jme->tx_ring_size); in jme_setup_tx_resources()
579 txring->bufinf = kcalloc(jme->tx_ring_size, in jme_setup_tx_resources()
588 dma_free_coherent(&(jme->pdev->dev), in jme_setup_tx_resources()
589 TX_RING_ALLOC_SIZE(jme->tx_ring_size), in jme_setup_tx_resources()
603 jme_free_tx_resources(struct jme_adapter *jme) in jme_free_tx_resources() argument
606 struct jme_ring *txring = &(jme->txring[0]); in jme_free_tx_resources()
611 for (i = 0 ; i < jme->tx_ring_size ; ++i) { in jme_free_tx_resources()
625 dma_free_coherent(&(jme->pdev->dev), in jme_free_tx_resources()
626 TX_RING_ALLOC_SIZE(jme->tx_ring_size), in jme_free_tx_resources()
642 jme_enable_tx_engine(struct jme_adapter *jme) in jme_enable_tx_engine() argument
647 jwrite32(jme, JME_TXCS, TXCS_DEFAULT | TXCS_SELECT_QUEUE0); in jme_enable_tx_engine()
653 jwrite32(jme, JME_TXDBA_LO, (__u64)jme->txring[0].dma & 0xFFFFFFFFUL); in jme_enable_tx_engine()
654 jwrite32(jme, JME_TXDBA_HI, (__u64)(jme->txring[0].dma) >> 32); in jme_enable_tx_engine()
655 jwrite32(jme, JME_TXNDA, (__u64)jme->txring[0].dma & 0xFFFFFFFFUL); in jme_enable_tx_engine()
660 jwrite32(jme, JME_TXQDC, jme->tx_ring_size); in jme_enable_tx_engine()
666 jwrite32f(jme, JME_TXCS, jme->reg_txcs | in jme_enable_tx_engine()
673 jme_mac_txclk_on(jme); in jme_enable_tx_engine()
677 jme_disable_tx_engine(struct jme_adapter *jme) in jme_disable_tx_engine() argument
685 jwrite32(jme, JME_TXCS, jme->reg_txcs | TXCS_SELECT_QUEUE0); in jme_disable_tx_engine()
688 val = jread32(jme, JME_TXCS); in jme_disable_tx_engine()
691 val = jread32(jme, JME_TXCS); in jme_disable_tx_engine()
701 jme_mac_txclk_off(jme); in jme_disable_tx_engine()
705 jme_set_clean_rxdesc(struct jme_adapter *jme, int i) in jme_set_clean_rxdesc() argument
707 struct jme_ring *rxring = &(jme->rxring[0]); in jme_set_clean_rxdesc()
719 if (jme->dev->features & NETIF_F_HIGHDMA) in jme_set_clean_rxdesc()
726 jme_make_new_rx_buf(struct jme_adapter *jme, int i) in jme_make_new_rx_buf() argument
728 struct jme_ring *rxring = &(jme->rxring[0]); in jme_make_new_rx_buf()
733 skb = netdev_alloc_skb(jme->dev, in jme_make_new_rx_buf()
734 jme->dev->mtu + RX_EXTRA_LEN); in jme_make_new_rx_buf()
738 mapping = dma_map_page(&jme->pdev->dev, virt_to_page(skb->data), in jme_make_new_rx_buf()
741 if (unlikely(dma_mapping_error(&jme->pdev->dev, mapping))) { in jme_make_new_rx_buf()
747 dma_unmap_page(&jme->pdev->dev, rxbi->mapping, rxbi->len, in jme_make_new_rx_buf()
757 jme_free_rx_buf(struct jme_adapter *jme, int i) in jme_free_rx_buf() argument
759 struct jme_ring *rxring = &(jme->rxring[0]); in jme_free_rx_buf()
764 dma_unmap_page(&jme->pdev->dev, rxbi->mapping, rxbi->len, in jme_free_rx_buf()
774 jme_free_rx_resources(struct jme_adapter *jme) in jme_free_rx_resources() argument
777 struct jme_ring *rxring = &(jme->rxring[0]); in jme_free_rx_resources()
781 for (i = 0 ; i < jme->rx_ring_size ; ++i) in jme_free_rx_resources()
782 jme_free_rx_buf(jme, i); in jme_free_rx_resources()
786 dma_free_coherent(&(jme->pdev->dev), in jme_free_rx_resources()
787 RX_RING_ALLOC_SIZE(jme->rx_ring_size), in jme_free_rx_resources()
801 jme_setup_rx_resources(struct jme_adapter *jme) in jme_setup_rx_resources() argument
804 struct jme_ring *rxring = &(jme->rxring[0]); in jme_setup_rx_resources()
806 rxring->alloc = dma_alloc_coherent(&(jme->pdev->dev), in jme_setup_rx_resources()
807 RX_RING_ALLOC_SIZE(jme->rx_ring_size), in jme_setup_rx_resources()
822 rxring->bufinf = kcalloc(jme->rx_ring_size, in jme_setup_rx_resources()
831 for (i = 0 ; i < jme->rx_ring_size ; ++i) { in jme_setup_rx_resources()
832 if (unlikely(jme_make_new_rx_buf(jme, i))) { in jme_setup_rx_resources()
833 jme_free_rx_resources(jme); in jme_setup_rx_resources()
837 jme_set_clean_rxdesc(jme, i); in jme_setup_rx_resources()
843 dma_free_coherent(&(jme->pdev->dev), in jme_setup_rx_resources()
844 RX_RING_ALLOC_SIZE(jme->rx_ring_size), in jme_setup_rx_resources()
857 jme_enable_rx_engine(struct jme_adapter *jme) in jme_enable_rx_engine() argument
862 jwrite32(jme, JME_RXCS, jme->reg_rxcs | in jme_enable_rx_engine()
869 jwrite32(jme, JME_RXDBA_LO, (__u64)(jme->rxring[0].dma) & 0xFFFFFFFFUL); in jme_enable_rx_engine()
870 jwrite32(jme, JME_RXDBA_HI, (__u64)(jme->rxring[0].dma) >> 32); in jme_enable_rx_engine()
871 jwrite32(jme, JME_RXNDA, (__u64)(jme->rxring[0].dma) & 0xFFFFFFFFUL); in jme_enable_rx_engine()
876 jwrite32(jme, JME_RXQDC, jme->rx_ring_size); in jme_enable_rx_engine()
881 jme_set_unicastaddr(jme->dev); in jme_enable_rx_engine()
882 jme_set_multi(jme->dev); in jme_enable_rx_engine()
888 jwrite32f(jme, JME_RXCS, jme->reg_rxcs | in jme_enable_rx_engine()
896 jme_mac_rxclk_on(jme); in jme_enable_rx_engine()
900 jme_restart_rx_engine(struct jme_adapter *jme) in jme_restart_rx_engine() argument
905 jwrite32(jme, JME_RXCS, jme->reg_rxcs | in jme_restart_rx_engine()
912 jme_disable_rx_engine(struct jme_adapter *jme) in jme_disable_rx_engine() argument
920 jwrite32(jme, JME_RXCS, jme->reg_rxcs); in jme_disable_rx_engine()
923 val = jread32(jme, JME_RXCS); in jme_disable_rx_engine()
926 val = jread32(jme, JME_RXCS); in jme_disable_rx_engine()
936 jme_mac_rxclk_off(jme); in jme_disable_rx_engine()
964 jme_rxsum_ok(struct jme_adapter *jme, u16 flags, struct sk_buff *skb) in jme_rxsum_ok() argument
972 netif_err(jme, rx_err, jme->dev, "TCP Checksum error\n"); in jme_rxsum_ok()
979 netif_err(jme, rx_err, jme->dev, "UDP Checksum error\n"); in jme_rxsum_ok()
985 netif_err(jme, rx_err, jme->dev, "IPv4 Checksum error\n"); in jme_rxsum_ok()
993 jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx) in jme_alloc_and_feed_skb() argument
995 struct jme_ring *rxring = &(jme->rxring[0]); in jme_alloc_and_feed_skb()
1005 dma_sync_single_for_cpu(&jme->pdev->dev, rxbi->mapping, rxbi->len, in jme_alloc_and_feed_skb()
1008 if (unlikely(jme_make_new_rx_buf(jme, idx))) { in jme_alloc_and_feed_skb()
1009 dma_sync_single_for_device(&jme->pdev->dev, rxbi->mapping, in jme_alloc_and_feed_skb()
1012 ++(NET_STAT(jme).rx_dropped); in jme_alloc_and_feed_skb()
1019 skb->protocol = eth_type_trans(skb, jme->dev); in jme_alloc_and_feed_skb()
1021 if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags), skb)) in jme_alloc_and_feed_skb()
1030 NET_STAT(jme).rx_bytes += 4; in jme_alloc_and_feed_skb()
1032 jme->jme_rx(skb); in jme_alloc_and_feed_skb()
1036 ++(NET_STAT(jme).multicast); in jme_alloc_and_feed_skb()
1038 NET_STAT(jme).rx_bytes += framesize; in jme_alloc_and_feed_skb()
1039 ++(NET_STAT(jme).rx_packets); in jme_alloc_and_feed_skb()
1042 jme_set_clean_rxdesc(jme, idx); in jme_alloc_and_feed_skb()
1047 jme_process_receive(struct jme_adapter *jme, int limit) in jme_process_receive() argument
1049 struct jme_ring *rxring = &(jme->rxring[0]); in jme_process_receive()
1051 int i, j, ccnt, desccnt, mask = jme->rx_ring_mask; in jme_process_receive()
1053 if (unlikely(!atomic_dec_and_test(&jme->rx_cleaning))) in jme_process_receive()
1056 if (unlikely(atomic_read(&jme->link_changing) != 1)) in jme_process_receive()
1059 if (unlikely(!netif_carrier_ok(jme->dev))) in jme_process_receive()
1079 ++(NET_STAT(jme).rx_crc_errors); in jme_process_receive()
1081 ++(NET_STAT(jme).rx_fifo_errors); in jme_process_receive()
1083 ++(NET_STAT(jme).rx_errors); in jme_process_receive()
1089 jme_set_clean_rxdesc(jme, j); in jme_process_receive()
1094 jme_alloc_and_feed_skb(jme, i); in jme_process_receive()
1104 atomic_inc(&jme->rx_cleaning); in jme_process_receive()
1128 jme_dynamic_pcc(struct jme_adapter *jme) in jme_dynamic_pcc() argument
1130 register struct dynpcc_info *dpi = &(jme->dpi); in jme_dynamic_pcc()
1132 if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD) in jme_dynamic_pcc()
1134 else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD || in jme_dynamic_pcc()
1142 tasklet_schedule(&jme->rxclean_task); in jme_dynamic_pcc()
1143 jme_set_rx_pcc(jme, dpi->attempt); in jme_dynamic_pcc()
1150 jme_start_pcc_timer(struct jme_adapter *jme) in jme_start_pcc_timer() argument
1152 struct dynpcc_info *dpi = &(jme->dpi); in jme_start_pcc_timer()
1153 dpi->last_bytes = NET_STAT(jme).rx_bytes; in jme_start_pcc_timer()
1154 dpi->last_pkts = NET_STAT(jme).rx_packets; in jme_start_pcc_timer()
1156 jwrite32(jme, JME_TMCSR, in jme_start_pcc_timer()
1161 jme_stop_pcc_timer(struct jme_adapter *jme) in jme_stop_pcc_timer() argument
1163 jwrite32(jme, JME_TMCSR, 0); in jme_stop_pcc_timer()
1167 jme_shutdown_nic(struct jme_adapter *jme) in jme_shutdown_nic() argument
1171 phylink = jme_linkstat_from_phy(jme); in jme_shutdown_nic()
1177 jme_stop_irq(jme); in jme_shutdown_nic()
1178 jwrite32(jme, JME_TIMER2, TMCSR_EN | 0xFFFFFE); in jme_shutdown_nic()
1185 struct jme_adapter *jme = from_tasklet(jme, t, pcc_task); in jme_pcc_tasklet() local
1186 struct net_device *netdev = jme->dev; in jme_pcc_tasklet()
1188 if (unlikely(test_bit(JME_FLAG_SHUTDOWN, &jme->flags))) { in jme_pcc_tasklet()
1189 jme_shutdown_nic(jme); in jme_pcc_tasklet()
1194 (atomic_read(&jme->link_changing) != 1) in jme_pcc_tasklet()
1196 jme_stop_pcc_timer(jme); in jme_pcc_tasklet()
1200 if (!(test_bit(JME_FLAG_POLL, &jme->flags))) in jme_pcc_tasklet()
1201 jme_dynamic_pcc(jme); in jme_pcc_tasklet()
1203 jme_start_pcc_timer(jme); in jme_pcc_tasklet()
1207 jme_polling_mode(struct jme_adapter *jme) in jme_polling_mode() argument
1209 jme_set_rx_pcc(jme, PCC_OFF); in jme_polling_mode()
1213 jme_interrupt_mode(struct jme_adapter *jme) in jme_interrupt_mode() argument
1215 jme_set_rx_pcc(jme, PCC_P1); in jme_interrupt_mode()
1219 jme_pseudo_hotplug_enabled(struct jme_adapter *jme) in jme_pseudo_hotplug_enabled() argument
1222 apmc = jread32(jme, JME_APMC); in jme_pseudo_hotplug_enabled()
1227 jme_start_shutdown_timer(struct jme_adapter *jme) in jme_start_shutdown_timer() argument
1231 apmc = jread32(jme, JME_APMC) | JME_APMC_PCIE_SD_EN; in jme_start_shutdown_timer()
1234 jwrite32f(jme, JME_APMC, apmc | JME_APMC_EPIEN_CTRL_EN); in jme_start_shutdown_timer()
1237 jwrite32f(jme, JME_APMC, apmc); in jme_start_shutdown_timer()
1239 jwrite32f(jme, JME_TIMER2, 0); in jme_start_shutdown_timer()
1240 set_bit(JME_FLAG_SHUTDOWN, &jme->flags); in jme_start_shutdown_timer()
1241 jwrite32(jme, JME_TMCSR, in jme_start_shutdown_timer()
1246 jme_stop_shutdown_timer(struct jme_adapter *jme) in jme_stop_shutdown_timer() argument
1250 jwrite32f(jme, JME_TMCSR, 0); in jme_stop_shutdown_timer()
1251 jwrite32f(jme, JME_TIMER2, 0); in jme_stop_shutdown_timer()
1252 clear_bit(JME_FLAG_SHUTDOWN, &jme->flags); in jme_stop_shutdown_timer()
1254 apmc = jread32(jme, JME_APMC); in jme_stop_shutdown_timer()
1256 jwrite32f(jme, JME_APMC, apmc | JME_APMC_EPIEN_CTRL_DIS); in jme_stop_shutdown_timer()
1258 jwrite32f(jme, JME_APMC, apmc); in jme_stop_shutdown_timer()
1263 struct jme_adapter *jme = container_of(work, struct jme_adapter, linkch_task); in jme_link_change_work() local
1264 struct net_device *netdev = jme->dev; in jme_link_change_work()
1267 while (!atomic_dec_and_test(&jme->link_changing)) { in jme_link_change_work()
1268 atomic_inc(&jme->link_changing); in jme_link_change_work()
1269 netif_info(jme, intr, jme->dev, "Get link change lock failed\n"); in jme_link_change_work()
1270 while (atomic_read(&jme->link_changing) != 1) in jme_link_change_work()
1271 netif_info(jme, intr, jme->dev, "Waiting link change lock\n"); in jme_link_change_work()
1274 if (jme_check_link(netdev, 1) && jme->old_mtu == netdev->mtu) in jme_link_change_work()
1277 jme->old_mtu = netdev->mtu; in jme_link_change_work()
1279 if (jme_pseudo_hotplug_enabled(jme)) in jme_link_change_work()
1280 jme_stop_shutdown_timer(jme); in jme_link_change_work()
1282 jme_stop_pcc_timer(jme); in jme_link_change_work()
1283 tasklet_disable(&jme->txclean_task); in jme_link_change_work()
1284 tasklet_disable(&jme->rxclean_task); in jme_link_change_work()
1285 tasklet_disable(&jme->rxempty_task); in jme_link_change_work()
1288 jme_disable_rx_engine(jme); in jme_link_change_work()
1289 jme_disable_tx_engine(jme); in jme_link_change_work()
1290 jme_reset_mac_processor(jme); in jme_link_change_work()
1291 jme_free_rx_resources(jme); in jme_link_change_work()
1292 jme_free_tx_resources(jme); in jme_link_change_work()
1294 if (test_bit(JME_FLAG_POLL, &jme->flags)) in jme_link_change_work()
1295 jme_polling_mode(jme); in jme_link_change_work()
1302 rc = jme_setup_rx_resources(jme); in jme_link_change_work()
1308 rc = jme_setup_tx_resources(jme); in jme_link_change_work()
1314 jme_enable_rx_engine(jme); in jme_link_change_work()
1315 jme_enable_tx_engine(jme); in jme_link_change_work()
1319 if (test_bit(JME_FLAG_POLL, &jme->flags)) in jme_link_change_work()
1320 jme_interrupt_mode(jme); in jme_link_change_work()
1322 jme_start_pcc_timer(jme); in jme_link_change_work()
1323 } else if (jme_pseudo_hotplug_enabled(jme)) { in jme_link_change_work()
1324 jme_start_shutdown_timer(jme); in jme_link_change_work()
1330 jme_free_rx_resources(jme); in jme_link_change_work()
1332 tasklet_enable(&jme->txclean_task); in jme_link_change_work()
1333 tasklet_enable(&jme->rxclean_task); in jme_link_change_work()
1334 tasklet_enable(&jme->rxempty_task); in jme_link_change_work()
1336 atomic_inc(&jme->link_changing); in jme_link_change_work()
1342 struct jme_adapter *jme = from_tasklet(jme, t, rxclean_task); in jme_rx_clean_tasklet() local
1343 struct dynpcc_info *dpi = &(jme->dpi); in jme_rx_clean_tasklet()
1345 jme_process_receive(jme, jme->rx_ring_size); in jme_rx_clean_tasklet()
1353 struct jme_adapter *jme = jme_napi_priv(holder); in jme_poll() local
1356 rest = jme_process_receive(jme, JME_NAPI_WEIGHT_VAL(budget)); in jme_poll()
1358 while (atomic_read(&jme->rx_empty) > 0) { in jme_poll()
1359 atomic_dec(&jme->rx_empty); in jme_poll()
1360 ++(NET_STAT(jme).rx_dropped); in jme_poll()
1361 jme_restart_rx_engine(jme); in jme_poll()
1363 atomic_inc(&jme->rx_empty); in jme_poll()
1367 jme_interrupt_mode(jme); in jme_poll()
1377 struct jme_adapter *jme = from_tasklet(jme, t, rxempty_task); in jme_rx_empty_tasklet() local
1379 if (unlikely(atomic_read(&jme->link_changing) != 1)) in jme_rx_empty_tasklet()
1382 if (unlikely(!netif_carrier_ok(jme->dev))) in jme_rx_empty_tasklet()
1385 netif_info(jme, rx_status, jme->dev, "RX Queue Full!\n"); in jme_rx_empty_tasklet()
1387 jme_rx_clean_tasklet(&jme->rxclean_task); in jme_rx_empty_tasklet()
1389 while (atomic_read(&jme->rx_empty) > 0) { in jme_rx_empty_tasklet()
1390 atomic_dec(&jme->rx_empty); in jme_rx_empty_tasklet()
1391 ++(NET_STAT(jme).rx_dropped); in jme_rx_empty_tasklet()
1392 jme_restart_rx_engine(jme); in jme_rx_empty_tasklet()
1394 atomic_inc(&jme->rx_empty); in jme_rx_empty_tasklet()
1398 jme_wake_queue_if_stopped(struct jme_adapter *jme) in jme_wake_queue_if_stopped() argument
1400 struct jme_ring *txring = &(jme->txring[0]); in jme_wake_queue_if_stopped()
1403 if (unlikely(netif_queue_stopped(jme->dev) && in jme_wake_queue_if_stopped()
1404 atomic_read(&txring->nr_free) >= (jme->tx_wake_threshold))) { in jme_wake_queue_if_stopped()
1405 netif_info(jme, tx_done, jme->dev, "TX Queue Waked\n"); in jme_wake_queue_if_stopped()
1406 netif_wake_queue(jme->dev); in jme_wake_queue_if_stopped()
1413 struct jme_adapter *jme = from_tasklet(jme, t, txclean_task); in jme_tx_clean_tasklet() local
1414 struct jme_ring *txring = &(jme->txring[0]); in jme_tx_clean_tasklet()
1419 tx_dbg(jme, "Into txclean\n"); in jme_tx_clean_tasklet()
1421 if (unlikely(!atomic_dec_and_test(&jme->tx_cleaning))) in jme_tx_clean_tasklet()
1424 if (unlikely(atomic_read(&jme->link_changing) != 1)) in jme_tx_clean_tasklet()
1427 if (unlikely(!netif_carrier_ok(jme->dev))) in jme_tx_clean_tasklet()
1430 max = jme->tx_ring_size - atomic_read(&txring->nr_free); in jme_tx_clean_tasklet()
1431 mask = jme->tx_ring_mask; in jme_tx_clean_tasklet()
1440 tx_dbg(jme, "txclean: %d+%d@%lu\n", in jme_tx_clean_tasklet()
1449 dma_unmap_page(&jme->pdev->dev, in jme_tx_clean_tasklet()
1462 ++(NET_STAT(jme).tx_carrier_errors); in jme_tx_clean_tasklet()
1464 ++(NET_STAT(jme).tx_packets); in jme_tx_clean_tasklet()
1465 NET_STAT(jme).tx_bytes += ctxbi->len; in jme_tx_clean_tasklet()
1481 tx_dbg(jme, "txclean: done %d@%lu\n", i, jiffies); in jme_tx_clean_tasklet()
1485 jme_wake_queue_if_stopped(jme); in jme_tx_clean_tasklet()
1488 atomic_inc(&jme->tx_cleaning); in jme_tx_clean_tasklet()
1492 jme_intr_msi(struct jme_adapter *jme, u32 intrstat) in jme_intr_msi() argument
1497 jwrite32f(jme, JME_IENC, INTR_ENABLE); in jme_intr_msi()
1504 jwrite32(jme, JME_IEVE, intrstat); in jme_intr_msi()
1505 schedule_work(&jme->linkch_task); in jme_intr_msi()
1510 jwrite32(jme, JME_IEVE, INTR_TMINTR); in jme_intr_msi()
1511 tasklet_schedule(&jme->pcc_task); in jme_intr_msi()
1515 jwrite32(jme, JME_IEVE, INTR_PCCTXTO | INTR_PCCTX | INTR_TX0); in jme_intr_msi()
1516 tasklet_schedule(&jme->txclean_task); in jme_intr_msi()
1520 jwrite32(jme, JME_IEVE, (intrstat & (INTR_PCCRX0TO | in jme_intr_msi()
1526 if (test_bit(JME_FLAG_POLL, &jme->flags)) { in jme_intr_msi()
1528 atomic_inc(&jme->rx_empty); in jme_intr_msi()
1531 if (likely(JME_RX_SCHEDULE_PREP(jme))) { in jme_intr_msi()
1532 jme_polling_mode(jme); in jme_intr_msi()
1533 JME_RX_SCHEDULE(jme); in jme_intr_msi()
1538 atomic_inc(&jme->rx_empty); in jme_intr_msi()
1539 tasklet_hi_schedule(&jme->rxempty_task); in jme_intr_msi()
1541 tasklet_hi_schedule(&jme->rxclean_task); in jme_intr_msi()
1549 jwrite32f(jme, JME_IENS, INTR_ENABLE); in jme_intr_msi()
1556 struct jme_adapter *jme = netdev_priv(netdev); in jme_intr() local
1559 intrstat = jread32(jme, JME_IEVE); in jme_intr()
1573 jme_intr_msi(jme, intrstat); in jme_intr()
1582 struct jme_adapter *jme = netdev_priv(netdev); in jme_msi() local
1585 intrstat = jread32(jme, JME_IEVE); in jme_msi()
1587 jme_intr_msi(jme, intrstat); in jme_msi()
1593 jme_reset_link(struct jme_adapter *jme) in jme_reset_link() argument
1595 jwrite32(jme, JME_TMCSR, TMCSR_SWIT); in jme_reset_link()
1599 jme_restart_an(struct jme_adapter *jme) in jme_restart_an() argument
1603 spin_lock_bh(&jme->phy_lock); in jme_restart_an()
1604 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_restart_an()
1606 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr); in jme_restart_an()
1607 spin_unlock_bh(&jme->phy_lock); in jme_restart_an()
1611 jme_request_irq(struct jme_adapter *jme) in jme_request_irq() argument
1614 struct net_device *netdev = jme->dev; in jme_request_irq()
1618 if (!pci_enable_msi(jme->pdev)) { in jme_request_irq()
1619 set_bit(JME_FLAG_MSI, &jme->flags); in jme_request_irq()
1624 rc = request_irq(jme->pdev->irq, handler, irq_flags, netdev->name, in jme_request_irq()
1629 test_bit(JME_FLAG_MSI, &jme->flags) ? "MSI" : "INTx", in jme_request_irq()
1632 if (test_bit(JME_FLAG_MSI, &jme->flags)) { in jme_request_irq()
1633 pci_disable_msi(jme->pdev); in jme_request_irq()
1634 clear_bit(JME_FLAG_MSI, &jme->flags); in jme_request_irq()
1637 netdev->irq = jme->pdev->irq; in jme_request_irq()
1644 jme_free_irq(struct jme_adapter *jme) in jme_free_irq() argument
1646 free_irq(jme->pdev->irq, jme->dev); in jme_free_irq()
1647 if (test_bit(JME_FLAG_MSI, &jme->flags)) { in jme_free_irq()
1648 pci_disable_msi(jme->pdev); in jme_free_irq()
1649 clear_bit(JME_FLAG_MSI, &jme->flags); in jme_free_irq()
1650 jme->dev->irq = jme->pdev->irq; in jme_free_irq()
1655 jme_new_phy_on(struct jme_adapter *jme) in jme_new_phy_on() argument
1659 reg = jread32(jme, JME_PHY_PWR); in jme_new_phy_on()
1662 jwrite32(jme, JME_PHY_PWR, reg); in jme_new_phy_on()
1664 pci_read_config_dword(jme->pdev, PCI_PRIV_PE1, ®); in jme_new_phy_on()
1667 pci_write_config_dword(jme->pdev, PCI_PRIV_PE1, reg); in jme_new_phy_on()
1671 jme_new_phy_off(struct jme_adapter *jme) in jme_new_phy_off() argument
1675 reg = jread32(jme, JME_PHY_PWR); in jme_new_phy_off()
1678 jwrite32(jme, JME_PHY_PWR, reg); in jme_new_phy_off()
1680 pci_read_config_dword(jme->pdev, PCI_PRIV_PE1, ®); in jme_new_phy_off()
1683 pci_write_config_dword(jme->pdev, PCI_PRIV_PE1, reg); in jme_new_phy_off()
1687 jme_phy_on(struct jme_adapter *jme) in jme_phy_on() argument
1691 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_phy_on()
1693 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr); in jme_phy_on()
1695 if (new_phy_power_ctrl(jme->chip_main_rev)) in jme_phy_on()
1696 jme_new_phy_on(jme); in jme_phy_on()
1700 jme_phy_off(struct jme_adapter *jme) in jme_phy_off() argument
1704 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_phy_off()
1706 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr); in jme_phy_off()
1708 if (new_phy_power_ctrl(jme->chip_main_rev)) in jme_phy_off()
1709 jme_new_phy_off(jme); in jme_phy_off()
1713 jme_phy_specreg_read(struct jme_adapter *jme, u32 specreg) in jme_phy_specreg_read() argument
1718 jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG, in jme_phy_specreg_read()
1720 return jme_mdio_read(jme->dev, jme->mii_if.phy_id, in jme_phy_specreg_read()
1725 jme_phy_specreg_write(struct jme_adapter *jme, u32 ext_reg, u32 phy_data) in jme_phy_specreg_write() argument
1730 jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_DATA_REG, in jme_phy_specreg_write()
1732 jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG, in jme_phy_specreg_write()
1737 jme_phy_calibration(struct jme_adapter *jme) in jme_phy_calibration() argument
1741 jme_phy_off(jme); in jme_phy_calibration()
1742 jme_phy_on(jme); in jme_phy_calibration()
1744 ctrl1000 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_CTRL1000); in jme_phy_calibration()
1747 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, ctrl1000); in jme_phy_calibration()
1749 phy_data = jme_phy_specreg_read(jme, JM_PHY_EXT_COMM_2_REG); in jme_phy_calibration()
1753 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_2_REG, phy_data); in jme_phy_calibration()
1755 phy_data = jme_phy_specreg_read(jme, JM_PHY_EXT_COMM_2_REG); in jme_phy_calibration()
1759 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_2_REG, phy_data); in jme_phy_calibration()
1762 ctrl1000 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_CTRL1000); in jme_phy_calibration()
1764 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, ctrl1000); in jme_phy_calibration()
1769 jme_phy_setEA(struct jme_adapter *jme) in jme_phy_setEA() argument
1774 pci_read_config_byte(jme->pdev, PCI_PRIV_SHARE_NICCTRL, &nic_ctrl); in jme_phy_setEA()
1778 switch (jme->pdev->device) { in jme_phy_setEA()
1780 if (((jme->chip_main_rev == 5) && in jme_phy_setEA()
1781 ((jme->chip_sub_rev == 0) || (jme->chip_sub_rev == 1) || in jme_phy_setEA()
1782 (jme->chip_sub_rev == 3))) || in jme_phy_setEA()
1783 (jme->chip_main_rev >= 6)) { in jme_phy_setEA()
1787 if ((jme->chip_main_rev == 3) && in jme_phy_setEA()
1788 ((jme->chip_sub_rev == 1) || (jme->chip_sub_rev == 2))) in jme_phy_setEA()
1792 if (((jme->chip_main_rev == 5) && in jme_phy_setEA()
1793 ((jme->chip_sub_rev == 0) || (jme->chip_sub_rev == 1) || in jme_phy_setEA()
1794 (jme->chip_sub_rev == 3))) || in jme_phy_setEA()
1795 (jme->chip_main_rev >= 6)) { in jme_phy_setEA()
1799 if ((jme->chip_main_rev == 3) && in jme_phy_setEA()
1800 ((jme->chip_sub_rev == 1) || (jme->chip_sub_rev == 2))) in jme_phy_setEA()
1802 if ((jme->chip_main_rev == 2) && (jme->chip_sub_rev == 0)) in jme_phy_setEA()
1804 if ((jme->chip_main_rev == 2) && (jme->chip_sub_rev == 2)) in jme_phy_setEA()
1811 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_0_REG, phy_comm0); in jme_phy_setEA()
1813 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_1_REG, phy_comm1); in jme_phy_setEA()
1821 struct jme_adapter *jme = netdev_priv(netdev); in jme_open() local
1824 jme_clear_pm_disable_wol(jme); in jme_open()
1825 JME_NAPI_ENABLE(jme); in jme_open()
1827 tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet); in jme_open()
1828 tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet); in jme_open()
1829 tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet); in jme_open()
1831 rc = jme_request_irq(jme); in jme_open()
1835 jme_start_irq(jme); in jme_open()
1837 jme_phy_on(jme); in jme_open()
1838 if (test_bit(JME_FLAG_SSET, &jme->flags)) in jme_open()
1839 jme_set_link_ksettings(netdev, &jme->old_cmd); in jme_open()
1841 jme_reset_phy_processor(jme); in jme_open()
1842 jme_phy_calibration(jme); in jme_open()
1843 jme_phy_setEA(jme); in jme_open()
1844 jme_reset_link(jme); in jme_open()
1855 jme_set_100m_half(struct jme_adapter *jme) in jme_set_100m_half() argument
1859 jme_phy_on(jme); in jme_set_100m_half()
1860 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_set_100m_half()
1866 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, tmp); in jme_set_100m_half()
1868 if (jme->fpgaver) in jme_set_100m_half()
1869 jwrite32(jme, JME_GHC, GHC_SPEED_100M | GHC_LINK_POLL); in jme_set_100m_half()
1871 jwrite32(jme, JME_GHC, GHC_SPEED_100M); in jme_set_100m_half()
1876 jme_wait_link(struct jme_adapter *jme) in jme_wait_link() argument
1881 phylink = jme_linkstat_from_phy(jme); in jme_wait_link()
1884 phylink = jme_linkstat_from_phy(jme); in jme_wait_link()
1889 jme_powersave_phy(struct jme_adapter *jme) in jme_powersave_phy() argument
1891 if (jme->reg_pmcs && device_may_wakeup(&jme->pdev->dev)) { in jme_powersave_phy()
1892 jme_set_100m_half(jme); in jme_powersave_phy()
1893 if (jme->reg_pmcs & (PMCS_LFEN | PMCS_LREN)) in jme_powersave_phy()
1894 jme_wait_link(jme); in jme_powersave_phy()
1895 jme_clear_pm_enable_wol(jme); in jme_powersave_phy()
1897 jme_phy_off(jme); in jme_powersave_phy()
1904 struct jme_adapter *jme = netdev_priv(netdev); in jme_close() local
1909 jme_stop_irq(jme); in jme_close()
1910 jme_free_irq(jme); in jme_close()
1912 JME_NAPI_DISABLE(jme); in jme_close()
1914 cancel_work_sync(&jme->linkch_task); in jme_close()
1915 tasklet_kill(&jme->txclean_task); in jme_close()
1916 tasklet_kill(&jme->rxclean_task); in jme_close()
1917 tasklet_kill(&jme->rxempty_task); in jme_close()
1919 jme_disable_rx_engine(jme); in jme_close()
1920 jme_disable_tx_engine(jme); in jme_close()
1921 jme_reset_mac_processor(jme); in jme_close()
1922 jme_free_rx_resources(jme); in jme_close()
1923 jme_free_tx_resources(jme); in jme_close()
1924 jme->phylink = 0; in jme_close()
1925 jme_phy_off(jme); in jme_close()
1931 jme_alloc_txdesc(struct jme_adapter *jme, in jme_alloc_txdesc() argument
1934 struct jme_ring *txring = &(jme->txring[0]); in jme_alloc_txdesc()
1935 int idx, nr_alloc, mask = jme->tx_ring_mask; in jme_alloc_txdesc()
1983 static void jme_drop_tx_map(struct jme_adapter *jme, int startidx, int count) in jme_drop_tx_map() argument
1985 struct jme_ring *txring = &(jme->txring[0]); in jme_drop_tx_map()
1987 int mask = jme->tx_ring_mask; in jme_drop_tx_map()
1992 dma_unmap_page(&jme->pdev->dev, ctxbi->mapping, ctxbi->len, in jme_drop_tx_map()
2001 jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx) in jme_map_tx_skb() argument
2003 struct jme_ring *txring = &(jme->txring[0]); in jme_map_tx_skb()
2006 bool hidma = jme->dev->features & NETIF_F_HIGHDMA; in jme_map_tx_skb()
2008 int mask = jme->tx_ring_mask; in jme_map_tx_skb()
2018 ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, in jme_map_tx_skb()
2022 jme_drop_tx_map(jme, idx, i); in jme_map_tx_skb()
2030 ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, virt_to_page(skb->data), in jme_map_tx_skb()
2033 jme_drop_tx_map(jme, idx, i); in jme_map_tx_skb()
2067 jme_tx_csum(struct jme_adapter *jme, struct sk_buff *skb, u8 *flags) in jme_tx_csum() argument
2092 netif_err(jme, tx_err, jme->dev, "Error upper layer protocol\n"); in jme_tx_csum()
2108 jme_fill_tx_desc(struct jme_adapter *jme, struct sk_buff *skb, int idx) in jme_fill_tx_desc() argument
2110 struct jme_ring *txring = &(jme->txring[0]); in jme_fill_tx_desc()
2137 jme_tx_csum(jme, skb, &flags); in jme_fill_tx_desc()
2139 ret = jme_map_tx_skb(jme, skb, idx); in jme_fill_tx_desc()
2160 jme_stop_queue_if_full(struct jme_adapter *jme) in jme_stop_queue_if_full() argument
2162 struct jme_ring *txring = &(jme->txring[0]); in jme_stop_queue_if_full()
2170 netif_stop_queue(jme->dev); in jme_stop_queue_if_full()
2171 netif_info(jme, tx_queued, jme->dev, "TX Queue Paused\n"); in jme_stop_queue_if_full()
2174 >= (jme->tx_wake_threshold)) { in jme_stop_queue_if_full()
2175 netif_wake_queue(jme->dev); in jme_stop_queue_if_full()
2176 netif_info(jme, tx_queued, jme->dev, "TX Queue Fast Waked\n"); in jme_stop_queue_if_full()
2183 netif_stop_queue(jme->dev); in jme_stop_queue_if_full()
2184 netif_info(jme, tx_queued, jme->dev, in jme_stop_queue_if_full()
2196 struct jme_adapter *jme = netdev_priv(netdev); in jme_start_xmit() local
2201 ++(NET_STAT(jme).tx_dropped); in jme_start_xmit()
2205 idx = jme_alloc_txdesc(jme, skb); in jme_start_xmit()
2209 netif_err(jme, tx_err, jme->dev, in jme_start_xmit()
2215 if (jme_fill_tx_desc(jme, skb, idx)) in jme_start_xmit()
2218 jwrite32(jme, JME_TXCS, jme->reg_txcs | in jme_start_xmit()
2223 tx_dbg(jme, "xmit: %d+%d@%lu\n", in jme_start_xmit()
2225 jme_stop_queue_if_full(jme); in jme_start_xmit()
2233 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_unicastaddr() local
2240 jwrite32(jme, JME_RXUMA_LO, val); in jme_set_unicastaddr()
2243 jwrite32(jme, JME_RXUMA_HI, val); in jme_set_unicastaddr()
2249 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_macaddr() local
2255 spin_lock_bh(&jme->macaddr_lock); in jme_set_macaddr()
2258 spin_unlock_bh(&jme->macaddr_lock); in jme_set_macaddr()
2266 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_multi() local
2269 spin_lock_bh(&jme->rxmcs_lock); in jme_set_multi()
2271 jme->reg_rxmcs |= RXMCS_BRDFRAME | RXMCS_UNIFRAME; in jme_set_multi()
2274 jme->reg_rxmcs |= RXMCS_ALLFRAME; in jme_set_multi()
2276 jme->reg_rxmcs |= RXMCS_ALLMULFRAME; in jme_set_multi()
2281 jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED; in jme_set_multi()
2287 jwrite32(jme, JME_RXMCHT_LO, mc_hash[0]); in jme_set_multi()
2288 jwrite32(jme, JME_RXMCHT_HI, mc_hash[1]); in jme_set_multi()
2292 jwrite32(jme, JME_RXMCS, jme->reg_rxmcs); in jme_set_multi()
2294 spin_unlock_bh(&jme->rxmcs_lock); in jme_set_multi()
2300 struct jme_adapter *jme = netdev_priv(netdev); in jme_change_mtu() local
2305 jme_restart_rx_engine(jme); in jme_change_mtu()
2306 jme_reset_link(jme); in jme_change_mtu()
2314 struct jme_adapter *jme = netdev_priv(netdev); in jme_tx_timeout() local
2316 jme->phylink = 0; in jme_tx_timeout()
2317 jme_reset_phy_processor(jme); in jme_tx_timeout()
2318 if (test_bit(JME_FLAG_SSET, &jme->flags)) in jme_tx_timeout()
2319 jme_set_link_ksettings(netdev, &jme->old_cmd); in jme_tx_timeout()
2324 jme_reset_link(jme); in jme_tx_timeout()
2331 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_drvinfo() local
2335 strscpy(info->bus_info, pci_name(jme->pdev), sizeof(info->bus_info)); in jme_get_drvinfo()
2345 mmapio_memcpy(struct jme_adapter *jme, u32 *p, u32 reg, int len) in mmapio_memcpy() argument
2350 p[i >> 2] = jread32(jme, reg + i); in mmapio_memcpy()
2354 mdio_memcpy(struct jme_adapter *jme, u32 *p, int reg_nr) in mdio_memcpy() argument
2360 p16[i] = jme_mdio_read(jme->dev, jme->mii_if.phy_id, i); in mdio_memcpy()
2366 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_regs() local
2372 mmapio_memcpy(jme, p32, JME_MAC, JME_MAC_LEN); in jme_get_regs()
2375 mmapio_memcpy(jme, p32, JME_PHY, JME_PHY_LEN); in jme_get_regs()
2378 mmapio_memcpy(jme, p32, JME_MISC, JME_MISC_LEN); in jme_get_regs()
2381 mmapio_memcpy(jme, p32, JME_RSS, JME_RSS_LEN); in jme_get_regs()
2384 mdio_memcpy(jme, p32, JME_PHY_REG_NR); in jme_get_regs()
2392 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_coalesce() local
2397 if (test_bit(JME_FLAG_POLL, &jme->flags)) { in jme_get_coalesce()
2406 switch (jme->dpi.cur) { in jme_get_coalesce()
2431 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_coalesce() local
2432 struct dynpcc_info *dpi = &(jme->dpi); in jme_set_coalesce()
2438 test_bit(JME_FLAG_POLL, &jme->flags)) { in jme_set_coalesce()
2439 clear_bit(JME_FLAG_POLL, &jme->flags); in jme_set_coalesce()
2440 jme->jme_rx = netif_rx; in jme_set_coalesce()
2444 jme_set_rx_pcc(jme, PCC_P1); in jme_set_coalesce()
2445 jme_interrupt_mode(jme); in jme_set_coalesce()
2447 !(test_bit(JME_FLAG_POLL, &jme->flags))) { in jme_set_coalesce()
2448 set_bit(JME_FLAG_POLL, &jme->flags); in jme_set_coalesce()
2449 jme->jme_rx = netif_receive_skb; in jme_set_coalesce()
2450 jme_interrupt_mode(jme); in jme_set_coalesce()
2460 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_pauseparam() local
2463 ecmd->tx_pause = (jme->reg_txpfc & TXPFC_PF_EN) != 0; in jme_get_pauseparam()
2464 ecmd->rx_pause = (jme->reg_rxmcs & RXMCS_FLOWCTRL) != 0; in jme_get_pauseparam()
2466 spin_lock_bh(&jme->phy_lock); in jme_get_pauseparam()
2467 val = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_ADVERTISE); in jme_get_pauseparam()
2468 spin_unlock_bh(&jme->phy_lock); in jme_get_pauseparam()
2478 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_pauseparam() local
2481 if (((jme->reg_txpfc & TXPFC_PF_EN) != 0) ^ in jme_set_pauseparam()
2485 jme->reg_txpfc |= TXPFC_PF_EN; in jme_set_pauseparam()
2487 jme->reg_txpfc &= ~TXPFC_PF_EN; in jme_set_pauseparam()
2489 jwrite32(jme, JME_TXPFC, jme->reg_txpfc); in jme_set_pauseparam()
2492 spin_lock_bh(&jme->rxmcs_lock); in jme_set_pauseparam()
2493 if (((jme->reg_rxmcs & RXMCS_FLOWCTRL) != 0) ^ in jme_set_pauseparam()
2497 jme->reg_rxmcs |= RXMCS_FLOWCTRL; in jme_set_pauseparam()
2499 jme->reg_rxmcs &= ~RXMCS_FLOWCTRL; in jme_set_pauseparam()
2501 jwrite32(jme, JME_RXMCS, jme->reg_rxmcs); in jme_set_pauseparam()
2503 spin_unlock_bh(&jme->rxmcs_lock); in jme_set_pauseparam()
2505 spin_lock_bh(&jme->phy_lock); in jme_set_pauseparam()
2506 val = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_ADVERTISE); in jme_set_pauseparam()
2515 jme_mdio_write(jme->dev, jme->mii_if.phy_id, in jme_set_pauseparam()
2518 spin_unlock_bh(&jme->phy_lock); in jme_set_pauseparam()
2527 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_wol() local
2533 if (jme->reg_pmcs & (PMCS_LFEN | PMCS_LREN)) in jme_get_wol()
2536 if (jme->reg_pmcs & PMCS_MFEN) in jme_get_wol()
2545 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_wol() local
2554 jme->reg_pmcs = 0; in jme_set_wol()
2557 jme->reg_pmcs |= PMCS_LFEN | PMCS_LREN; in jme_set_wol()
2560 jme->reg_pmcs |= PMCS_MFEN; in jme_set_wol()
2569 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_link_ksettings() local
2571 spin_lock_bh(&jme->phy_lock); in jme_get_link_ksettings()
2572 mii_ethtool_get_link_ksettings(&jme->mii_if, cmd); in jme_get_link_ksettings()
2573 spin_unlock_bh(&jme->phy_lock); in jme_get_link_ksettings()
2581 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_link_ksettings() local
2592 if (jme->mii_if.force_media && in jme_set_link_ksettings()
2594 (jme->mii_if.full_duplex != cmd->base.duplex)) in jme_set_link_ksettings()
2597 spin_lock_bh(&jme->phy_lock); in jme_set_link_ksettings()
2598 rc = mii_ethtool_set_link_ksettings(&jme->mii_if, cmd); in jme_set_link_ksettings()
2599 spin_unlock_bh(&jme->phy_lock); in jme_set_link_ksettings()
2603 jme_reset_link(jme); in jme_set_link_ksettings()
2604 jme->old_cmd = *cmd; in jme_set_link_ksettings()
2605 set_bit(JME_FLAG_SSET, &jme->flags); in jme_set_link_ksettings()
2615 struct jme_adapter *jme = netdev_priv(netdev); in jme_ioctl() local
2626 spin_lock_bh(&jme->phy_lock); in jme_ioctl()
2627 rc = generic_mii_ioctl(&jme->mii_if, mii_data, cmd, &duplex_chg); in jme_ioctl()
2628 spin_unlock_bh(&jme->phy_lock); in jme_ioctl()
2632 jme_reset_link(jme); in jme_ioctl()
2633 jme_get_link_ksettings(netdev, &jme->old_cmd); in jme_ioctl()
2634 set_bit(JME_FLAG_SSET, &jme->flags); in jme_ioctl()
2643 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_link() local
2644 return jread32(jme, JME_PHY_LINK) & PHY_LINK_UP; in jme_get_link()
2650 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_msglevel() local
2651 return jme->msg_enable; in jme_get_msglevel()
2657 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_msglevel() local
2658 jme->msg_enable = value; in jme_set_msglevel()
2672 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_features() local
2674 spin_lock_bh(&jme->rxmcs_lock); in jme_set_features()
2676 jme->reg_rxmcs |= RXMCS_CHECKSUM; in jme_set_features()
2678 jme->reg_rxmcs &= ~RXMCS_CHECKSUM; in jme_set_features()
2679 jwrite32(jme, JME_RXMCS, jme->reg_rxmcs); in jme_set_features()
2680 spin_unlock_bh(&jme->rxmcs_lock); in jme_set_features()
2699 struct jme_adapter *jme = netdev_priv(netdev); in jme_nway_reset() local
2700 jme_restart_an(jme); in jme_nway_reset()
2705 jme_smb_read(struct jme_adapter *jme, unsigned int addr) in jme_smb_read() argument
2710 val = jread32(jme, JME_SMBCSR); in jme_smb_read()
2714 val = jread32(jme, JME_SMBCSR); in jme_smb_read()
2717 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_read()
2721 jwrite32(jme, JME_SMBINTF, in jme_smb_read()
2726 val = jread32(jme, JME_SMBINTF); in jme_smb_read()
2730 val = jread32(jme, JME_SMBINTF); in jme_smb_read()
2733 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_read()
2741 jme_smb_write(struct jme_adapter *jme, unsigned int addr, u8 data) in jme_smb_write() argument
2746 val = jread32(jme, JME_SMBCSR); in jme_smb_write()
2750 val = jread32(jme, JME_SMBCSR); in jme_smb_write()
2753 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_write()
2757 jwrite32(jme, JME_SMBINTF, in jme_smb_write()
2763 val = jread32(jme, JME_SMBINTF); in jme_smb_write()
2767 val = jread32(jme, JME_SMBINTF); in jme_smb_write()
2770 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_write()
2780 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_eeprom_len() local
2782 val = jread32(jme, JME_SMBCSR); in jme_get_eeprom_len()
2790 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_eeprom() local
2798 data[i] = jme_smb_read(jme, i + offset); in jme_get_eeprom()
2807 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_eeprom() local
2817 jme_smb_write(jme, i + offset, data[i]); in jme_set_eeprom()
2864 jme_phy_init(struct jme_adapter *jme) in jme_phy_init() argument
2868 reg26 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, 26); in jme_phy_init()
2869 jme_mdio_write(jme->dev, jme->mii_if.phy_id, 26, reg26 | 0x1000); in jme_phy_init()
2873 jme_check_hw_ver(struct jme_adapter *jme) in jme_check_hw_ver() argument
2877 chipmode = jread32(jme, JME_CHIPMODE); in jme_check_hw_ver()
2879 jme->fpgaver = (chipmode & CM_FPGAVER_MASK) >> CM_FPGAVER_SHIFT; in jme_check_hw_ver()
2880 jme->chiprev = (chipmode & CM_CHIPREV_MASK) >> CM_CHIPREV_SHIFT; in jme_check_hw_ver()
2881 jme->chip_main_rev = jme->chiprev & 0xF; in jme_check_hw_ver()
2882 jme->chip_sub_rev = (jme->chiprev >> 4) & 0xF; in jme_check_hw_ver()
2908 struct jme_adapter *jme; in jme_init_one() local
2948 netdev = alloc_etherdev(sizeof(*jme)); in jme_init_one()
2982 jme = netdev_priv(netdev); in jme_init_one()
2983 jme->pdev = pdev; in jme_init_one()
2984 jme->dev = netdev; in jme_init_one()
2985 jme->jme_rx = netif_rx; in jme_init_one()
2986 jme->old_mtu = netdev->mtu = 1500; in jme_init_one()
2987 jme->phylink = 0; in jme_init_one()
2988 jme->tx_ring_size = 1 << 10; in jme_init_one()
2989 jme->tx_ring_mask = jme->tx_ring_size - 1; in jme_init_one()
2990 jme->tx_wake_threshold = 1 << 9; in jme_init_one()
2991 jme->rx_ring_size = 1 << 9; in jme_init_one()
2992 jme->rx_ring_mask = jme->rx_ring_size - 1; in jme_init_one()
2993 jme->msg_enable = JME_DEF_MSG_ENABLE; in jme_init_one()
2994 jme->regs = ioremap(pci_resource_start(pdev, 0), in jme_init_one()
2996 if (!(jme->regs)) { in jme_init_one()
3003 apmc = jread32(jme, JME_APMC) & ~JME_APMC_PSEUDO_HP_EN; in jme_init_one()
3004 jwrite32(jme, JME_APMC, apmc); in jme_init_one()
3006 apmc = jread32(jme, JME_APMC) | JME_APMC_PSEUDO_HP_EN; in jme_init_one()
3007 jwrite32(jme, JME_APMC, apmc); in jme_init_one()
3010 netif_napi_add(netdev, &jme->napi, jme_poll); in jme_init_one()
3012 spin_lock_init(&jme->phy_lock); in jme_init_one()
3013 spin_lock_init(&jme->macaddr_lock); in jme_init_one()
3014 spin_lock_init(&jme->rxmcs_lock); in jme_init_one()
3016 atomic_set(&jme->link_changing, 1); in jme_init_one()
3017 atomic_set(&jme->rx_cleaning, 1); in jme_init_one()
3018 atomic_set(&jme->tx_cleaning, 1); in jme_init_one()
3019 atomic_set(&jme->rx_empty, 1); in jme_init_one()
3021 tasklet_setup(&jme->pcc_task, jme_pcc_tasklet); in jme_init_one()
3022 INIT_WORK(&jme->linkch_task, jme_link_change_work); in jme_init_one()
3023 jme->dpi.cur = PCC_P1; in jme_init_one()
3025 jme->reg_ghc = 0; in jme_init_one()
3026 jme->reg_rxcs = RXCS_DEFAULT; in jme_init_one()
3027 jme->reg_rxmcs = RXMCS_DEFAULT; in jme_init_one()
3028 jme->reg_txpfc = 0; in jme_init_one()
3029 jme->reg_pmcs = PMCS_MFEN; in jme_init_one()
3030 jme->reg_gpreg1 = GPREG1_DEFAULT; in jme_init_one()
3032 if (jme->reg_rxmcs & RXMCS_CHECKSUM) in jme_init_one()
3038 pci_read_config_byte(pdev, PCI_DCSR_MRRS, &jme->mrrs); in jme_init_one()
3039 jme->mrrs &= PCI_DCSR_MRRS_MASK; in jme_init_one()
3040 switch (jme->mrrs) { in jme_init_one()
3042 jme->reg_txcs = TXCS_DEFAULT | TXCS_DMASIZE_128B; in jme_init_one()
3045 jme->reg_txcs = TXCS_DEFAULT | TXCS_DMASIZE_256B; in jme_init_one()
3048 jme->reg_txcs = TXCS_DEFAULT | TXCS_DMASIZE_512B; in jme_init_one()
3055 jme_check_hw_ver(jme); in jme_init_one()
3056 jme->mii_if.dev = netdev; in jme_init_one()
3057 if (jme->fpgaver) { in jme_init_one()
3058 jme->mii_if.phy_id = 0; in jme_init_one()
3063 jme->mii_if.phy_id = i; in jme_init_one()
3068 if (!jme->mii_if.phy_id) { in jme_init_one()
3074 jme->reg_ghc |= GHC_LINK_POLL; in jme_init_one()
3076 jme->mii_if.phy_id = 1; in jme_init_one()
3079 jme->mii_if.supports_gmii = true; in jme_init_one()
3081 jme->mii_if.supports_gmii = false; in jme_init_one()
3082 jme->mii_if.phy_id_mask = 0x1F; in jme_init_one()
3083 jme->mii_if.reg_num_mask = 0x1F; in jme_init_one()
3084 jme->mii_if.mdio_read = jme_mdio_read; in jme_init_one()
3085 jme->mii_if.mdio_write = jme_mdio_write; in jme_init_one()
3087 jme_clear_pm_disable_wol(jme); in jme_init_one()
3090 jme_set_phyfifo_5level(jme); in jme_init_one()
3091 jme->pcirev = pdev->revision; in jme_init_one()
3092 if (!jme->fpgaver) in jme_init_one()
3093 jme_phy_init(jme); in jme_init_one()
3094 jme_phy_off(jme); in jme_init_one()
3099 jme_reset_mac_processor(jme); in jme_init_one()
3100 rc = jme_reload_eeprom(jme); in jme_init_one()
3118 netif_info(jme, probe, jme->dev, "%s%s chiprev:%x pcirev:%x macaddr:%pM\n", in jme_init_one()
3119 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ? in jme_init_one()
3121 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ? in jme_init_one()
3123 (jme->fpgaver != 0) ? " (FPGA)" : "", in jme_init_one()
3124 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, in jme_init_one()
3125 jme->pcirev, netdev->dev_addr); in jme_init_one()
3130 iounmap(jme->regs); in jme_init_one()
3145 struct jme_adapter *jme = netdev_priv(netdev); in jme_remove_one() local
3148 iounmap(jme->regs); in jme_remove_one()
3159 struct jme_adapter *jme = netdev_priv(netdev); in jme_shutdown() local
3161 jme_powersave_phy(jme); in jme_shutdown()
3170 struct jme_adapter *jme = netdev_priv(netdev); in jme_suspend() local
3175 atomic_dec(&jme->link_changing); in jme_suspend()
3179 jme_stop_irq(jme); in jme_suspend()
3181 tasklet_disable(&jme->txclean_task); in jme_suspend()
3182 tasklet_disable(&jme->rxclean_task); in jme_suspend()
3183 tasklet_disable(&jme->rxempty_task); in jme_suspend()
3186 if (test_bit(JME_FLAG_POLL, &jme->flags)) in jme_suspend()
3187 jme_polling_mode(jme); in jme_suspend()
3189 jme_stop_pcc_timer(jme); in jme_suspend()
3190 jme_disable_rx_engine(jme); in jme_suspend()
3191 jme_disable_tx_engine(jme); in jme_suspend()
3192 jme_reset_mac_processor(jme); in jme_suspend()
3193 jme_free_rx_resources(jme); in jme_suspend()
3194 jme_free_tx_resources(jme); in jme_suspend()
3196 jme->phylink = 0; in jme_suspend()
3199 tasklet_enable(&jme->txclean_task); in jme_suspend()
3200 tasklet_enable(&jme->rxclean_task); in jme_suspend()
3201 tasklet_enable(&jme->rxempty_task); in jme_suspend()
3203 jme_powersave_phy(jme); in jme_suspend()
3212 struct jme_adapter *jme = netdev_priv(netdev); in jme_resume() local
3217 jme_clear_pm_disable_wol(jme); in jme_resume()
3218 jme_phy_on(jme); in jme_resume()
3219 if (test_bit(JME_FLAG_SSET, &jme->flags)) in jme_resume()
3220 jme_set_link_ksettings(netdev, &jme->old_cmd); in jme_resume()
3222 jme_reset_phy_processor(jme); in jme_resume()
3223 jme_phy_calibration(jme); in jme_resume()
3224 jme_phy_setEA(jme); in jme_resume()
3227 atomic_inc(&jme->link_changing); in jme_resume()
3229 jme_reset_link(jme); in jme_resume()
3231 jme_start_irq(jme); in jme_resume()