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()
966 jme_rxsum_ok(struct jme_adapter *jme, u16 flags, struct sk_buff *skb) in jme_rxsum_ok() argument
974 netif_err(jme, rx_err, jme->dev, "TCP Checksum error\n"); in jme_rxsum_ok()
981 netif_err(jme, rx_err, jme->dev, "UDP Checksum error\n"); in jme_rxsum_ok()
987 netif_err(jme, rx_err, jme->dev, "IPv4 Checksum error\n"); in jme_rxsum_ok()
995 jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx) in jme_alloc_and_feed_skb() argument
997 struct jme_ring *rxring = &(jme->rxring[0]); in jme_alloc_and_feed_skb()
1007 dma_sync_single_for_cpu(&jme->pdev->dev, rxbi->mapping, rxbi->len, in jme_alloc_and_feed_skb()
1010 if (unlikely(jme_make_new_rx_buf(jme, idx))) { in jme_alloc_and_feed_skb()
1011 dma_sync_single_for_device(&jme->pdev->dev, rxbi->mapping, in jme_alloc_and_feed_skb()
1014 ++(NET_STAT(jme).rx_dropped); in jme_alloc_and_feed_skb()
1021 skb->protocol = eth_type_trans(skb, jme->dev); in jme_alloc_and_feed_skb()
1023 if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags), skb)) in jme_alloc_and_feed_skb()
1032 NET_STAT(jme).rx_bytes += 4; in jme_alloc_and_feed_skb()
1034 jme->jme_rx(skb); in jme_alloc_and_feed_skb()
1038 ++(NET_STAT(jme).multicast); in jme_alloc_and_feed_skb()
1040 NET_STAT(jme).rx_bytes += framesize; in jme_alloc_and_feed_skb()
1041 ++(NET_STAT(jme).rx_packets); in jme_alloc_and_feed_skb()
1044 jme_set_clean_rxdesc(jme, idx); in jme_alloc_and_feed_skb()
1049 jme_process_receive(struct jme_adapter *jme, int limit) in jme_process_receive() argument
1051 struct jme_ring *rxring = &(jme->rxring[0]); in jme_process_receive()
1053 int i, j, ccnt, desccnt, mask = jme->rx_ring_mask; in jme_process_receive()
1055 if (unlikely(!atomic_dec_and_test(&jme->rx_cleaning))) in jme_process_receive()
1058 if (unlikely(atomic_read(&jme->link_changing) != 1)) in jme_process_receive()
1061 if (unlikely(!netif_carrier_ok(jme->dev))) in jme_process_receive()
1081 ++(NET_STAT(jme).rx_crc_errors); in jme_process_receive()
1083 ++(NET_STAT(jme).rx_fifo_errors); in jme_process_receive()
1085 ++(NET_STAT(jme).rx_errors); in jme_process_receive()
1091 jme_set_clean_rxdesc(jme, j); in jme_process_receive()
1096 jme_alloc_and_feed_skb(jme, i); in jme_process_receive()
1106 atomic_inc(&jme->rx_cleaning); in jme_process_receive()
1130 jme_dynamic_pcc(struct jme_adapter *jme) in jme_dynamic_pcc() argument
1132 register struct dynpcc_info *dpi = &(jme->dpi); in jme_dynamic_pcc()
1134 if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD) in jme_dynamic_pcc()
1136 else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD || in jme_dynamic_pcc()
1144 tasklet_schedule(&jme->rxclean_task); in jme_dynamic_pcc()
1145 jme_set_rx_pcc(jme, dpi->attempt); in jme_dynamic_pcc()
1152 jme_start_pcc_timer(struct jme_adapter *jme) in jme_start_pcc_timer() argument
1154 struct dynpcc_info *dpi = &(jme->dpi); in jme_start_pcc_timer()
1155 dpi->last_bytes = NET_STAT(jme).rx_bytes; in jme_start_pcc_timer()
1156 dpi->last_pkts = NET_STAT(jme).rx_packets; in jme_start_pcc_timer()
1158 jwrite32(jme, JME_TMCSR, in jme_start_pcc_timer()
1163 jme_stop_pcc_timer(struct jme_adapter *jme) in jme_stop_pcc_timer() argument
1165 jwrite32(jme, JME_TMCSR, 0); in jme_stop_pcc_timer()
1169 jme_shutdown_nic(struct jme_adapter *jme) in jme_shutdown_nic() argument
1173 phylink = jme_linkstat_from_phy(jme); in jme_shutdown_nic()
1179 jme_stop_irq(jme); in jme_shutdown_nic()
1180 jwrite32(jme, JME_TIMER2, TMCSR_EN | 0xFFFFFE); in jme_shutdown_nic()
1187 struct jme_adapter *jme = from_tasklet(jme, t, pcc_task); in jme_pcc_tasklet() local
1188 struct net_device *netdev = jme->dev; in jme_pcc_tasklet()
1190 if (unlikely(test_bit(JME_FLAG_SHUTDOWN, &jme->flags))) { in jme_pcc_tasklet()
1191 jme_shutdown_nic(jme); in jme_pcc_tasklet()
1196 (atomic_read(&jme->link_changing) != 1) in jme_pcc_tasklet()
1198 jme_stop_pcc_timer(jme); in jme_pcc_tasklet()
1202 if (!(test_bit(JME_FLAG_POLL, &jme->flags))) in jme_pcc_tasklet()
1203 jme_dynamic_pcc(jme); in jme_pcc_tasklet()
1205 jme_start_pcc_timer(jme); in jme_pcc_tasklet()
1209 jme_polling_mode(struct jme_adapter *jme) in jme_polling_mode() argument
1211 jme_set_rx_pcc(jme, PCC_OFF); in jme_polling_mode()
1215 jme_interrupt_mode(struct jme_adapter *jme) in jme_interrupt_mode() argument
1217 jme_set_rx_pcc(jme, PCC_P1); in jme_interrupt_mode()
1221 jme_pseudo_hotplug_enabled(struct jme_adapter *jme) in jme_pseudo_hotplug_enabled() argument
1224 apmc = jread32(jme, JME_APMC); in jme_pseudo_hotplug_enabled()
1229 jme_start_shutdown_timer(struct jme_adapter *jme) in jme_start_shutdown_timer() argument
1233 apmc = jread32(jme, JME_APMC) | JME_APMC_PCIE_SD_EN; in jme_start_shutdown_timer()
1236 jwrite32f(jme, JME_APMC, apmc | JME_APMC_EPIEN_CTRL_EN); in jme_start_shutdown_timer()
1239 jwrite32f(jme, JME_APMC, apmc); in jme_start_shutdown_timer()
1241 jwrite32f(jme, JME_TIMER2, 0); in jme_start_shutdown_timer()
1242 set_bit(JME_FLAG_SHUTDOWN, &jme->flags); in jme_start_shutdown_timer()
1243 jwrite32(jme, JME_TMCSR, in jme_start_shutdown_timer()
1248 jme_stop_shutdown_timer(struct jme_adapter *jme) in jme_stop_shutdown_timer() argument
1252 jwrite32f(jme, JME_TMCSR, 0); in jme_stop_shutdown_timer()
1253 jwrite32f(jme, JME_TIMER2, 0); in jme_stop_shutdown_timer()
1254 clear_bit(JME_FLAG_SHUTDOWN, &jme->flags); in jme_stop_shutdown_timer()
1256 apmc = jread32(jme, JME_APMC); in jme_stop_shutdown_timer()
1258 jwrite32f(jme, JME_APMC, apmc | JME_APMC_EPIEN_CTRL_DIS); in jme_stop_shutdown_timer()
1260 jwrite32f(jme, JME_APMC, apmc); in jme_stop_shutdown_timer()
1265 struct jme_adapter *jme = container_of(work, struct jme_adapter, linkch_task); in jme_link_change_work() local
1266 struct net_device *netdev = jme->dev; in jme_link_change_work()
1269 while (!atomic_dec_and_test(&jme->link_changing)) { in jme_link_change_work()
1270 atomic_inc(&jme->link_changing); in jme_link_change_work()
1271 netif_info(jme, intr, jme->dev, "Get link change lock failed\n"); in jme_link_change_work()
1272 while (atomic_read(&jme->link_changing) != 1) in jme_link_change_work()
1273 netif_info(jme, intr, jme->dev, "Waiting link change lock\n"); in jme_link_change_work()
1276 if (jme_check_link(netdev, 1) && jme->old_mtu == netdev->mtu) in jme_link_change_work()
1279 jme->old_mtu = netdev->mtu; in jme_link_change_work()
1281 if (jme_pseudo_hotplug_enabled(jme)) in jme_link_change_work()
1282 jme_stop_shutdown_timer(jme); in jme_link_change_work()
1284 jme_stop_pcc_timer(jme); in jme_link_change_work()
1285 tasklet_disable(&jme->txclean_task); in jme_link_change_work()
1286 tasklet_disable(&jme->rxclean_task); in jme_link_change_work()
1287 tasklet_disable(&jme->rxempty_task); in jme_link_change_work()
1290 jme_disable_rx_engine(jme); in jme_link_change_work()
1291 jme_disable_tx_engine(jme); in jme_link_change_work()
1292 jme_reset_mac_processor(jme); in jme_link_change_work()
1293 jme_free_rx_resources(jme); in jme_link_change_work()
1294 jme_free_tx_resources(jme); in jme_link_change_work()
1296 if (test_bit(JME_FLAG_POLL, &jme->flags)) in jme_link_change_work()
1297 jme_polling_mode(jme); in jme_link_change_work()
1304 rc = jme_setup_rx_resources(jme); in jme_link_change_work()
1310 rc = jme_setup_tx_resources(jme); in jme_link_change_work()
1316 jme_enable_rx_engine(jme); in jme_link_change_work()
1317 jme_enable_tx_engine(jme); in jme_link_change_work()
1321 if (test_bit(JME_FLAG_POLL, &jme->flags)) in jme_link_change_work()
1322 jme_interrupt_mode(jme); in jme_link_change_work()
1324 jme_start_pcc_timer(jme); in jme_link_change_work()
1325 } else if (jme_pseudo_hotplug_enabled(jme)) { in jme_link_change_work()
1326 jme_start_shutdown_timer(jme); in jme_link_change_work()
1332 jme_free_rx_resources(jme); in jme_link_change_work()
1334 tasklet_enable(&jme->txclean_task); in jme_link_change_work()
1335 tasklet_enable(&jme->rxclean_task); in jme_link_change_work()
1336 tasklet_enable(&jme->rxempty_task); in jme_link_change_work()
1338 atomic_inc(&jme->link_changing); in jme_link_change_work()
1344 struct jme_adapter *jme = from_tasklet(jme, t, rxclean_task); in jme_rx_clean_tasklet() local
1345 struct dynpcc_info *dpi = &(jme->dpi); in jme_rx_clean_tasklet()
1347 jme_process_receive(jme, jme->rx_ring_size); in jme_rx_clean_tasklet()
1355 struct jme_adapter *jme = jme_napi_priv(holder); in jme_poll() local
1358 rest = jme_process_receive(jme, JME_NAPI_WEIGHT_VAL(budget)); in jme_poll()
1360 while (atomic_read(&jme->rx_empty) > 0) { in jme_poll()
1361 atomic_dec(&jme->rx_empty); in jme_poll()
1362 ++(NET_STAT(jme).rx_dropped); in jme_poll()
1363 jme_restart_rx_engine(jme); in jme_poll()
1365 atomic_inc(&jme->rx_empty); in jme_poll()
1369 jme_interrupt_mode(jme); in jme_poll()
1379 struct jme_adapter *jme = from_tasklet(jme, t, rxempty_task); in jme_rx_empty_tasklet() local
1381 if (unlikely(atomic_read(&jme->link_changing) != 1)) in jme_rx_empty_tasklet()
1384 if (unlikely(!netif_carrier_ok(jme->dev))) in jme_rx_empty_tasklet()
1387 netif_info(jme, rx_status, jme->dev, "RX Queue Full!\n"); in jme_rx_empty_tasklet()
1389 jme_rx_clean_tasklet(&jme->rxclean_task); in jme_rx_empty_tasklet()
1391 while (atomic_read(&jme->rx_empty) > 0) { in jme_rx_empty_tasklet()
1392 atomic_dec(&jme->rx_empty); in jme_rx_empty_tasklet()
1393 ++(NET_STAT(jme).rx_dropped); in jme_rx_empty_tasklet()
1394 jme_restart_rx_engine(jme); in jme_rx_empty_tasklet()
1396 atomic_inc(&jme->rx_empty); in jme_rx_empty_tasklet()
1400 jme_wake_queue_if_stopped(struct jme_adapter *jme) in jme_wake_queue_if_stopped() argument
1402 struct jme_ring *txring = &(jme->txring[0]); in jme_wake_queue_if_stopped()
1405 if (unlikely(netif_queue_stopped(jme->dev) && in jme_wake_queue_if_stopped()
1406 atomic_read(&txring->nr_free) >= (jme->tx_wake_threshold))) { in jme_wake_queue_if_stopped()
1407 netif_info(jme, tx_done, jme->dev, "TX Queue Waked\n"); in jme_wake_queue_if_stopped()
1408 netif_wake_queue(jme->dev); in jme_wake_queue_if_stopped()
1415 struct jme_adapter *jme = from_tasklet(jme, t, txclean_task); in jme_tx_clean_tasklet() local
1416 struct jme_ring *txring = &(jme->txring[0]); in jme_tx_clean_tasklet()
1421 tx_dbg(jme, "Into txclean\n"); in jme_tx_clean_tasklet()
1423 if (unlikely(!atomic_dec_and_test(&jme->tx_cleaning))) in jme_tx_clean_tasklet()
1426 if (unlikely(atomic_read(&jme->link_changing) != 1)) in jme_tx_clean_tasklet()
1429 if (unlikely(!netif_carrier_ok(jme->dev))) in jme_tx_clean_tasklet()
1432 max = jme->tx_ring_size - atomic_read(&txring->nr_free); in jme_tx_clean_tasklet()
1433 mask = jme->tx_ring_mask; in jme_tx_clean_tasklet()
1442 tx_dbg(jme, "txclean: %d+%d@%lu\n", in jme_tx_clean_tasklet()
1451 dma_unmap_page(&jme->pdev->dev, in jme_tx_clean_tasklet()
1464 ++(NET_STAT(jme).tx_carrier_errors); in jme_tx_clean_tasklet()
1466 ++(NET_STAT(jme).tx_packets); in jme_tx_clean_tasklet()
1467 NET_STAT(jme).tx_bytes += ctxbi->len; in jme_tx_clean_tasklet()
1483 tx_dbg(jme, "txclean: done %d@%lu\n", i, jiffies); in jme_tx_clean_tasklet()
1487 jme_wake_queue_if_stopped(jme); in jme_tx_clean_tasklet()
1490 atomic_inc(&jme->tx_cleaning); in jme_tx_clean_tasklet()
1494 jme_intr_msi(struct jme_adapter *jme, u32 intrstat) in jme_intr_msi() argument
1499 jwrite32f(jme, JME_IENC, INTR_ENABLE); in jme_intr_msi()
1506 jwrite32(jme, JME_IEVE, intrstat); in jme_intr_msi()
1507 schedule_work(&jme->linkch_task); in jme_intr_msi()
1512 jwrite32(jme, JME_IEVE, INTR_TMINTR); in jme_intr_msi()
1513 tasklet_schedule(&jme->pcc_task); in jme_intr_msi()
1517 jwrite32(jme, JME_IEVE, INTR_PCCTXTO | INTR_PCCTX | INTR_TX0); in jme_intr_msi()
1518 tasklet_schedule(&jme->txclean_task); in jme_intr_msi()
1522 jwrite32(jme, JME_IEVE, (intrstat & (INTR_PCCRX0TO | in jme_intr_msi()
1528 if (test_bit(JME_FLAG_POLL, &jme->flags)) { in jme_intr_msi()
1530 atomic_inc(&jme->rx_empty); in jme_intr_msi()
1533 if (likely(JME_RX_SCHEDULE_PREP(jme))) { in jme_intr_msi()
1534 jme_polling_mode(jme); in jme_intr_msi()
1535 JME_RX_SCHEDULE(jme); in jme_intr_msi()
1540 atomic_inc(&jme->rx_empty); in jme_intr_msi()
1541 tasklet_hi_schedule(&jme->rxempty_task); in jme_intr_msi()
1543 tasklet_hi_schedule(&jme->rxclean_task); in jme_intr_msi()
1551 jwrite32f(jme, JME_IENS, INTR_ENABLE); in jme_intr_msi()
1558 struct jme_adapter *jme = netdev_priv(netdev); in jme_intr() local
1561 intrstat = jread32(jme, JME_IEVE); in jme_intr()
1575 jme_intr_msi(jme, intrstat); in jme_intr()
1584 struct jme_adapter *jme = netdev_priv(netdev); in jme_msi() local
1587 intrstat = jread32(jme, JME_IEVE); in jme_msi()
1589 jme_intr_msi(jme, intrstat); in jme_msi()
1595 jme_reset_link(struct jme_adapter *jme) in jme_reset_link() argument
1597 jwrite32(jme, JME_TMCSR, TMCSR_SWIT); in jme_reset_link()
1601 jme_restart_an(struct jme_adapter *jme) in jme_restart_an() argument
1605 spin_lock_bh(&jme->phy_lock); in jme_restart_an()
1606 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_restart_an()
1608 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr); in jme_restart_an()
1609 spin_unlock_bh(&jme->phy_lock); in jme_restart_an()
1613 jme_request_irq(struct jme_adapter *jme) in jme_request_irq() argument
1616 struct net_device *netdev = jme->dev; in jme_request_irq()
1620 if (!pci_enable_msi(jme->pdev)) { in jme_request_irq()
1621 set_bit(JME_FLAG_MSI, &jme->flags); in jme_request_irq()
1626 rc = request_irq(jme->pdev->irq, handler, irq_flags, netdev->name, in jme_request_irq()
1631 test_bit(JME_FLAG_MSI, &jme->flags) ? "MSI" : "INTx", in jme_request_irq()
1634 if (test_bit(JME_FLAG_MSI, &jme->flags)) { in jme_request_irq()
1635 pci_disable_msi(jme->pdev); in jme_request_irq()
1636 clear_bit(JME_FLAG_MSI, &jme->flags); in jme_request_irq()
1639 netdev->irq = jme->pdev->irq; in jme_request_irq()
1646 jme_free_irq(struct jme_adapter *jme) in jme_free_irq() argument
1648 free_irq(jme->pdev->irq, jme->dev); in jme_free_irq()
1649 if (test_bit(JME_FLAG_MSI, &jme->flags)) { in jme_free_irq()
1650 pci_disable_msi(jme->pdev); in jme_free_irq()
1651 clear_bit(JME_FLAG_MSI, &jme->flags); in jme_free_irq()
1652 jme->dev->irq = jme->pdev->irq; in jme_free_irq()
1657 jme_new_phy_on(struct jme_adapter *jme) in jme_new_phy_on() argument
1661 reg = jread32(jme, JME_PHY_PWR); in jme_new_phy_on()
1664 jwrite32(jme, JME_PHY_PWR, reg); in jme_new_phy_on()
1666 pci_read_config_dword(jme->pdev, PCI_PRIV_PE1, &reg); in jme_new_phy_on()
1669 pci_write_config_dword(jme->pdev, PCI_PRIV_PE1, reg); in jme_new_phy_on()
1673 jme_new_phy_off(struct jme_adapter *jme) in jme_new_phy_off() argument
1677 reg = jread32(jme, JME_PHY_PWR); in jme_new_phy_off()
1680 jwrite32(jme, JME_PHY_PWR, reg); in jme_new_phy_off()
1682 pci_read_config_dword(jme->pdev, PCI_PRIV_PE1, &reg); in jme_new_phy_off()
1685 pci_write_config_dword(jme->pdev, PCI_PRIV_PE1, reg); in jme_new_phy_off()
1689 jme_phy_on(struct jme_adapter *jme) in jme_phy_on() argument
1693 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_phy_on()
1695 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr); in jme_phy_on()
1697 if (new_phy_power_ctrl(jme->chip_main_rev)) in jme_phy_on()
1698 jme_new_phy_on(jme); in jme_phy_on()
1702 jme_phy_off(struct jme_adapter *jme) in jme_phy_off() argument
1706 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_phy_off()
1708 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr); in jme_phy_off()
1710 if (new_phy_power_ctrl(jme->chip_main_rev)) in jme_phy_off()
1711 jme_new_phy_off(jme); in jme_phy_off()
1715 jme_phy_specreg_read(struct jme_adapter *jme, u32 specreg) in jme_phy_specreg_read() argument
1720 jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG, in jme_phy_specreg_read()
1722 return jme_mdio_read(jme->dev, jme->mii_if.phy_id, in jme_phy_specreg_read()
1727 jme_phy_specreg_write(struct jme_adapter *jme, u32 ext_reg, u32 phy_data) in jme_phy_specreg_write() argument
1732 jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_DATA_REG, in jme_phy_specreg_write()
1734 jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG, in jme_phy_specreg_write()
1739 jme_phy_calibration(struct jme_adapter *jme) in jme_phy_calibration() argument
1743 jme_phy_off(jme); in jme_phy_calibration()
1744 jme_phy_on(jme); in jme_phy_calibration()
1746 ctrl1000 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_CTRL1000); in jme_phy_calibration()
1749 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, ctrl1000); in jme_phy_calibration()
1751 phy_data = jme_phy_specreg_read(jme, JM_PHY_EXT_COMM_2_REG); in jme_phy_calibration()
1755 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_2_REG, phy_data); in jme_phy_calibration()
1757 phy_data = jme_phy_specreg_read(jme, JM_PHY_EXT_COMM_2_REG); in jme_phy_calibration()
1761 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_2_REG, phy_data); in jme_phy_calibration()
1764 ctrl1000 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_CTRL1000); in jme_phy_calibration()
1766 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, ctrl1000); in jme_phy_calibration()
1771 jme_phy_setEA(struct jme_adapter *jme) in jme_phy_setEA() argument
1776 pci_read_config_byte(jme->pdev, PCI_PRIV_SHARE_NICCTRL, &nic_ctrl); in jme_phy_setEA()
1780 switch (jme->pdev->device) { in jme_phy_setEA()
1782 if (((jme->chip_main_rev == 5) && in jme_phy_setEA()
1783 ((jme->chip_sub_rev == 0) || (jme->chip_sub_rev == 1) || in jme_phy_setEA()
1784 (jme->chip_sub_rev == 3))) || in jme_phy_setEA()
1785 (jme->chip_main_rev >= 6)) { in jme_phy_setEA()
1789 if ((jme->chip_main_rev == 3) && in jme_phy_setEA()
1790 ((jme->chip_sub_rev == 1) || (jme->chip_sub_rev == 2))) in jme_phy_setEA()
1794 if (((jme->chip_main_rev == 5) && in jme_phy_setEA()
1795 ((jme->chip_sub_rev == 0) || (jme->chip_sub_rev == 1) || in jme_phy_setEA()
1796 (jme->chip_sub_rev == 3))) || in jme_phy_setEA()
1797 (jme->chip_main_rev >= 6)) { in jme_phy_setEA()
1801 if ((jme->chip_main_rev == 3) && in jme_phy_setEA()
1802 ((jme->chip_sub_rev == 1) || (jme->chip_sub_rev == 2))) in jme_phy_setEA()
1804 if ((jme->chip_main_rev == 2) && (jme->chip_sub_rev == 0)) in jme_phy_setEA()
1806 if ((jme->chip_main_rev == 2) && (jme->chip_sub_rev == 2)) in jme_phy_setEA()
1813 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_0_REG, phy_comm0); in jme_phy_setEA()
1815 jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_1_REG, phy_comm1); in jme_phy_setEA()
1823 struct jme_adapter *jme = netdev_priv(netdev); in jme_open() local
1826 jme_clear_pm_disable_wol(jme); in jme_open()
1827 JME_NAPI_ENABLE(jme); in jme_open()
1829 tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet); in jme_open()
1830 tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet); in jme_open()
1831 tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet); in jme_open()
1833 rc = jme_request_irq(jme); in jme_open()
1837 jme_start_irq(jme); in jme_open()
1839 jme_phy_on(jme); in jme_open()
1840 if (test_bit(JME_FLAG_SSET, &jme->flags)) in jme_open()
1841 jme_set_link_ksettings(netdev, &jme->old_cmd); in jme_open()
1843 jme_reset_phy_processor(jme); in jme_open()
1844 jme_phy_calibration(jme); in jme_open()
1845 jme_phy_setEA(jme); in jme_open()
1846 jme_reset_link(jme); in jme_open()
1857 jme_set_100m_half(struct jme_adapter *jme) in jme_set_100m_half() argument
1861 jme_phy_on(jme); in jme_set_100m_half()
1862 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR); in jme_set_100m_half()
1868 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, tmp); in jme_set_100m_half()
1870 if (jme->fpgaver) in jme_set_100m_half()
1871 jwrite32(jme, JME_GHC, GHC_SPEED_100M | GHC_LINK_POLL); in jme_set_100m_half()
1873 jwrite32(jme, JME_GHC, GHC_SPEED_100M); in jme_set_100m_half()
1878 jme_wait_link(struct jme_adapter *jme) in jme_wait_link() argument
1883 phylink = jme_linkstat_from_phy(jme); in jme_wait_link()
1886 phylink = jme_linkstat_from_phy(jme); in jme_wait_link()
1891 jme_powersave_phy(struct jme_adapter *jme) in jme_powersave_phy() argument
1893 if (jme->reg_pmcs && device_may_wakeup(&jme->pdev->dev)) { in jme_powersave_phy()
1894 jme_set_100m_half(jme); in jme_powersave_phy()
1895 if (jme->reg_pmcs & (PMCS_LFEN | PMCS_LREN)) in jme_powersave_phy()
1896 jme_wait_link(jme); in jme_powersave_phy()
1897 jme_clear_pm_enable_wol(jme); in jme_powersave_phy()
1899 jme_phy_off(jme); in jme_powersave_phy()
1906 struct jme_adapter *jme = netdev_priv(netdev); in jme_close() local
1911 jme_stop_irq(jme); in jme_close()
1912 jme_free_irq(jme); in jme_close()
1914 JME_NAPI_DISABLE(jme); in jme_close()
1916 cancel_work_sync(&jme->linkch_task); in jme_close()
1917 tasklet_kill(&jme->txclean_task); in jme_close()
1918 tasklet_kill(&jme->rxclean_task); in jme_close()
1919 tasklet_kill(&jme->rxempty_task); in jme_close()
1921 jme_disable_rx_engine(jme); in jme_close()
1922 jme_disable_tx_engine(jme); in jme_close()
1923 jme_reset_mac_processor(jme); in jme_close()
1924 jme_free_rx_resources(jme); in jme_close()
1925 jme_free_tx_resources(jme); in jme_close()
1926 jme->phylink = 0; in jme_close()
1927 jme_phy_off(jme); in jme_close()
1933 jme_alloc_txdesc(struct jme_adapter *jme, in jme_alloc_txdesc() argument
1936 struct jme_ring *txring = &(jme->txring[0]); in jme_alloc_txdesc()
1937 int idx, nr_alloc, mask = jme->tx_ring_mask; in jme_alloc_txdesc()
1985 static void jme_drop_tx_map(struct jme_adapter *jme, int startidx, int count) in jme_drop_tx_map() argument
1987 struct jme_ring *txring = &(jme->txring[0]); in jme_drop_tx_map()
1989 int mask = jme->tx_ring_mask; in jme_drop_tx_map()
1994 dma_unmap_page(&jme->pdev->dev, ctxbi->mapping, ctxbi->len, in jme_drop_tx_map()
2003 jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx) in jme_map_tx_skb() argument
2005 struct jme_ring *txring = &(jme->txring[0]); in jme_map_tx_skb()
2008 bool hidma = jme->dev->features & NETIF_F_HIGHDMA; in jme_map_tx_skb()
2010 int mask = jme->tx_ring_mask; in jme_map_tx_skb()
2020 ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, in jme_map_tx_skb()
2024 jme_drop_tx_map(jme, idx, i); in jme_map_tx_skb()
2032 ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, virt_to_page(skb->data), in jme_map_tx_skb()
2035 jme_drop_tx_map(jme, idx, i); in jme_map_tx_skb()
2069 jme_tx_csum(struct jme_adapter *jme, struct sk_buff *skb, u8 *flags) in jme_tx_csum() argument
2094 netif_err(jme, tx_err, jme->dev, "Error upper layer protocol\n"); in jme_tx_csum()
2110 jme_fill_tx_desc(struct jme_adapter *jme, struct sk_buff *skb, int idx) in jme_fill_tx_desc() argument
2112 struct jme_ring *txring = &(jme->txring[0]); in jme_fill_tx_desc()
2139 jme_tx_csum(jme, skb, &flags); in jme_fill_tx_desc()
2141 ret = jme_map_tx_skb(jme, skb, idx); in jme_fill_tx_desc()
2162 jme_stop_queue_if_full(struct jme_adapter *jme) in jme_stop_queue_if_full() argument
2164 struct jme_ring *txring = &(jme->txring[0]); in jme_stop_queue_if_full()
2172 netif_stop_queue(jme->dev); in jme_stop_queue_if_full()
2173 netif_info(jme, tx_queued, jme->dev, "TX Queue Paused\n"); in jme_stop_queue_if_full()
2176 >= (jme->tx_wake_threshold)) { in jme_stop_queue_if_full()
2177 netif_wake_queue(jme->dev); in jme_stop_queue_if_full()
2178 netif_info(jme, tx_queued, jme->dev, "TX Queue Fast Waked\n"); in jme_stop_queue_if_full()
2185 netif_stop_queue(jme->dev); in jme_stop_queue_if_full()
2186 netif_info(jme, tx_queued, jme->dev, in jme_stop_queue_if_full()
2198 struct jme_adapter *jme = netdev_priv(netdev); in jme_start_xmit() local
2203 ++(NET_STAT(jme).tx_dropped); in jme_start_xmit()
2207 idx = jme_alloc_txdesc(jme, skb); in jme_start_xmit()
2211 netif_err(jme, tx_err, jme->dev, in jme_start_xmit()
2217 if (jme_fill_tx_desc(jme, skb, idx)) in jme_start_xmit()
2220 jwrite32(jme, JME_TXCS, jme->reg_txcs | in jme_start_xmit()
2225 tx_dbg(jme, "xmit: %d+%d@%lu\n", in jme_start_xmit()
2227 jme_stop_queue_if_full(jme); in jme_start_xmit()
2235 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_unicastaddr() local
2242 jwrite32(jme, JME_RXUMA_LO, val); in jme_set_unicastaddr()
2245 jwrite32(jme, JME_RXUMA_HI, val); in jme_set_unicastaddr()
2251 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_macaddr() local
2257 spin_lock_bh(&jme->macaddr_lock); in jme_set_macaddr()
2260 spin_unlock_bh(&jme->macaddr_lock); in jme_set_macaddr()
2268 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_multi() local
2271 spin_lock_bh(&jme->rxmcs_lock); in jme_set_multi()
2273 jme->reg_rxmcs |= RXMCS_BRDFRAME | RXMCS_UNIFRAME; in jme_set_multi()
2276 jme->reg_rxmcs |= RXMCS_ALLFRAME; in jme_set_multi()
2278 jme->reg_rxmcs |= RXMCS_ALLMULFRAME; in jme_set_multi()
2283 jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED; in jme_set_multi()
2289 jwrite32(jme, JME_RXMCHT_LO, mc_hash[0]); in jme_set_multi()
2290 jwrite32(jme, JME_RXMCHT_HI, mc_hash[1]); in jme_set_multi()
2294 jwrite32(jme, JME_RXMCS, jme->reg_rxmcs); in jme_set_multi()
2296 spin_unlock_bh(&jme->rxmcs_lock); in jme_set_multi()
2302 struct jme_adapter *jme = netdev_priv(netdev); in jme_change_mtu() local
2307 jme_restart_rx_engine(jme); in jme_change_mtu()
2308 jme_reset_link(jme); in jme_change_mtu()
2316 struct jme_adapter *jme = netdev_priv(netdev); in jme_tx_timeout() local
2318 jme->phylink = 0; in jme_tx_timeout()
2319 jme_reset_phy_processor(jme); in jme_tx_timeout()
2320 if (test_bit(JME_FLAG_SSET, &jme->flags)) in jme_tx_timeout()
2321 jme_set_link_ksettings(netdev, &jme->old_cmd); in jme_tx_timeout()
2326 jme_reset_link(jme); in jme_tx_timeout()
2333 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_drvinfo() local
2337 strscpy(info->bus_info, pci_name(jme->pdev), sizeof(info->bus_info)); in jme_get_drvinfo()
2347 mmapio_memcpy(struct jme_adapter *jme, u32 *p, u32 reg, int len) in mmapio_memcpy() argument
2352 p[i >> 2] = jread32(jme, reg + i); in mmapio_memcpy()
2356 mdio_memcpy(struct jme_adapter *jme, u32 *p, int reg_nr) in mdio_memcpy() argument
2362 p16[i] = jme_mdio_read(jme->dev, jme->mii_if.phy_id, i); in mdio_memcpy()
2368 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_regs() local
2374 mmapio_memcpy(jme, p32, JME_MAC, JME_MAC_LEN); in jme_get_regs()
2377 mmapio_memcpy(jme, p32, JME_PHY, JME_PHY_LEN); in jme_get_regs()
2380 mmapio_memcpy(jme, p32, JME_MISC, JME_MISC_LEN); in jme_get_regs()
2383 mmapio_memcpy(jme, p32, JME_RSS, JME_RSS_LEN); in jme_get_regs()
2386 mdio_memcpy(jme, p32, JME_PHY_REG_NR); in jme_get_regs()
2394 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_coalesce() local
2399 if (test_bit(JME_FLAG_POLL, &jme->flags)) { in jme_get_coalesce()
2408 switch (jme->dpi.cur) { in jme_get_coalesce()
2433 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_coalesce() local
2434 struct dynpcc_info *dpi = &(jme->dpi); in jme_set_coalesce()
2440 test_bit(JME_FLAG_POLL, &jme->flags)) { in jme_set_coalesce()
2441 clear_bit(JME_FLAG_POLL, &jme->flags); in jme_set_coalesce()
2442 jme->jme_rx = netif_rx; in jme_set_coalesce()
2446 jme_set_rx_pcc(jme, PCC_P1); in jme_set_coalesce()
2447 jme_interrupt_mode(jme); in jme_set_coalesce()
2449 !(test_bit(JME_FLAG_POLL, &jme->flags))) { in jme_set_coalesce()
2450 set_bit(JME_FLAG_POLL, &jme->flags); in jme_set_coalesce()
2451 jme->jme_rx = netif_receive_skb; in jme_set_coalesce()
2452 jme_interrupt_mode(jme); in jme_set_coalesce()
2462 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_pauseparam() local
2465 ecmd->tx_pause = (jme->reg_txpfc & TXPFC_PF_EN) != 0; in jme_get_pauseparam()
2466 ecmd->rx_pause = (jme->reg_rxmcs & RXMCS_FLOWCTRL) != 0; in jme_get_pauseparam()
2468 spin_lock_bh(&jme->phy_lock); in jme_get_pauseparam()
2469 val = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_ADVERTISE); in jme_get_pauseparam()
2470 spin_unlock_bh(&jme->phy_lock); in jme_get_pauseparam()
2480 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_pauseparam() local
2483 if (((jme->reg_txpfc & TXPFC_PF_EN) != 0) ^ in jme_set_pauseparam()
2487 jme->reg_txpfc |= TXPFC_PF_EN; in jme_set_pauseparam()
2489 jme->reg_txpfc &= ~TXPFC_PF_EN; in jme_set_pauseparam()
2491 jwrite32(jme, JME_TXPFC, jme->reg_txpfc); in jme_set_pauseparam()
2494 spin_lock_bh(&jme->rxmcs_lock); in jme_set_pauseparam()
2495 if (((jme->reg_rxmcs & RXMCS_FLOWCTRL) != 0) ^ in jme_set_pauseparam()
2499 jme->reg_rxmcs |= RXMCS_FLOWCTRL; in jme_set_pauseparam()
2501 jme->reg_rxmcs &= ~RXMCS_FLOWCTRL; in jme_set_pauseparam()
2503 jwrite32(jme, JME_RXMCS, jme->reg_rxmcs); in jme_set_pauseparam()
2505 spin_unlock_bh(&jme->rxmcs_lock); in jme_set_pauseparam()
2507 spin_lock_bh(&jme->phy_lock); in jme_set_pauseparam()
2508 val = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_ADVERTISE); in jme_set_pauseparam()
2517 jme_mdio_write(jme->dev, jme->mii_if.phy_id, in jme_set_pauseparam()
2520 spin_unlock_bh(&jme->phy_lock); in jme_set_pauseparam()
2529 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_wol() local
2535 if (jme->reg_pmcs & (PMCS_LFEN | PMCS_LREN)) in jme_get_wol()
2538 if (jme->reg_pmcs & PMCS_MFEN) in jme_get_wol()
2547 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_wol() local
2556 jme->reg_pmcs = 0; in jme_set_wol()
2559 jme->reg_pmcs |= PMCS_LFEN | PMCS_LREN; in jme_set_wol()
2562 jme->reg_pmcs |= PMCS_MFEN; in jme_set_wol()
2571 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_link_ksettings() local
2573 spin_lock_bh(&jme->phy_lock); in jme_get_link_ksettings()
2574 mii_ethtool_get_link_ksettings(&jme->mii_if, cmd); in jme_get_link_ksettings()
2575 spin_unlock_bh(&jme->phy_lock); in jme_get_link_ksettings()
2583 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_link_ksettings() local
2594 if (jme->mii_if.force_media && in jme_set_link_ksettings()
2596 (jme->mii_if.full_duplex != cmd->base.duplex)) in jme_set_link_ksettings()
2599 spin_lock_bh(&jme->phy_lock); in jme_set_link_ksettings()
2600 rc = mii_ethtool_set_link_ksettings(&jme->mii_if, cmd); in jme_set_link_ksettings()
2601 spin_unlock_bh(&jme->phy_lock); in jme_set_link_ksettings()
2605 jme_reset_link(jme); in jme_set_link_ksettings()
2606 jme->old_cmd = *cmd; in jme_set_link_ksettings()
2607 set_bit(JME_FLAG_SSET, &jme->flags); in jme_set_link_ksettings()
2617 struct jme_adapter *jme = netdev_priv(netdev); in jme_ioctl() local
2628 spin_lock_bh(&jme->phy_lock); in jme_ioctl()
2629 rc = generic_mii_ioctl(&jme->mii_if, mii_data, cmd, &duplex_chg); in jme_ioctl()
2630 spin_unlock_bh(&jme->phy_lock); in jme_ioctl()
2634 jme_reset_link(jme); in jme_ioctl()
2635 jme_get_link_ksettings(netdev, &jme->old_cmd); in jme_ioctl()
2636 set_bit(JME_FLAG_SSET, &jme->flags); in jme_ioctl()
2645 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_link() local
2646 return jread32(jme, JME_PHY_LINK) & PHY_LINK_UP; in jme_get_link()
2652 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_msglevel() local
2653 return jme->msg_enable; in jme_get_msglevel()
2659 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_msglevel() local
2660 jme->msg_enable = value; in jme_set_msglevel()
2674 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_features() local
2676 spin_lock_bh(&jme->rxmcs_lock); in jme_set_features()
2678 jme->reg_rxmcs |= RXMCS_CHECKSUM; in jme_set_features()
2680 jme->reg_rxmcs &= ~RXMCS_CHECKSUM; in jme_set_features()
2681 jwrite32(jme, JME_RXMCS, jme->reg_rxmcs); in jme_set_features()
2682 spin_unlock_bh(&jme->rxmcs_lock); in jme_set_features()
2701 struct jme_adapter *jme = netdev_priv(netdev); in jme_nway_reset() local
2702 jme_restart_an(jme); in jme_nway_reset()
2707 jme_smb_read(struct jme_adapter *jme, unsigned int addr) in jme_smb_read() argument
2712 val = jread32(jme, JME_SMBCSR); in jme_smb_read()
2716 val = jread32(jme, JME_SMBCSR); in jme_smb_read()
2719 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_read()
2723 jwrite32(jme, JME_SMBINTF, in jme_smb_read()
2728 val = jread32(jme, JME_SMBINTF); in jme_smb_read()
2732 val = jread32(jme, JME_SMBINTF); in jme_smb_read()
2735 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_read()
2743 jme_smb_write(struct jme_adapter *jme, unsigned int addr, u8 data) in jme_smb_write() argument
2748 val = jread32(jme, JME_SMBCSR); in jme_smb_write()
2752 val = jread32(jme, JME_SMBCSR); in jme_smb_write()
2755 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_write()
2759 jwrite32(jme, JME_SMBINTF, in jme_smb_write()
2765 val = jread32(jme, JME_SMBINTF); in jme_smb_write()
2769 val = jread32(jme, JME_SMBINTF); in jme_smb_write()
2772 netif_err(jme, hw, jme->dev, "SMB Bus Busy\n"); in jme_smb_write()
2782 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_eeprom_len() local
2784 val = jread32(jme, JME_SMBCSR); in jme_get_eeprom_len()
2792 struct jme_adapter *jme = netdev_priv(netdev); in jme_get_eeprom() local
2800 data[i] = jme_smb_read(jme, i + offset); in jme_get_eeprom()
2809 struct jme_adapter *jme = netdev_priv(netdev); in jme_set_eeprom() local
2819 jme_smb_write(jme, i + offset, data[i]); in jme_set_eeprom()
2866 jme_phy_init(struct jme_adapter *jme) in jme_phy_init() argument
2870 reg26 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, 26); in jme_phy_init()
2871 jme_mdio_write(jme->dev, jme->mii_if.phy_id, 26, reg26 | 0x1000); in jme_phy_init()
2875 jme_check_hw_ver(struct jme_adapter *jme) in jme_check_hw_ver() argument
2879 chipmode = jread32(jme, JME_CHIPMODE); in jme_check_hw_ver()
2881 jme->fpgaver = (chipmode & CM_FPGAVER_MASK) >> CM_FPGAVER_SHIFT; in jme_check_hw_ver()
2882 jme->chiprev = (chipmode & CM_CHIPREV_MASK) >> CM_CHIPREV_SHIFT; in jme_check_hw_ver()
2883 jme->chip_main_rev = jme->chiprev & 0xF; in jme_check_hw_ver()
2884 jme->chip_sub_rev = (jme->chiprev >> 4) & 0xF; in jme_check_hw_ver()
2910 struct jme_adapter *jme; in jme_init_one() local
2950 netdev = alloc_etherdev(sizeof(*jme)); in jme_init_one()
2984 jme = netdev_priv(netdev); in jme_init_one()
2985 jme->pdev = pdev; in jme_init_one()
2986 jme->dev = netdev; in jme_init_one()
2987 jme->jme_rx = netif_rx; in jme_init_one()
2988 jme->old_mtu = netdev->mtu = 1500; in jme_init_one()
2989 jme->phylink = 0; in jme_init_one()
2990 jme->tx_ring_size = 1 << 10; in jme_init_one()
2991 jme->tx_ring_mask = jme->tx_ring_size - 1; in jme_init_one()
2992 jme->tx_wake_threshold = 1 << 9; in jme_init_one()
2993 jme->rx_ring_size = 1 << 9; in jme_init_one()
2994 jme->rx_ring_mask = jme->rx_ring_size - 1; in jme_init_one()
2995 jme->msg_enable = JME_DEF_MSG_ENABLE; in jme_init_one()
2996 jme->regs = ioremap(pci_resource_start(pdev, 0), in jme_init_one()
2998 if (!(jme->regs)) { in jme_init_one()
3005 apmc = jread32(jme, JME_APMC) & ~JME_APMC_PSEUDO_HP_EN; in jme_init_one()
3006 jwrite32(jme, JME_APMC, apmc); in jme_init_one()
3008 apmc = jread32(jme, JME_APMC) | JME_APMC_PSEUDO_HP_EN; in jme_init_one()
3009 jwrite32(jme, JME_APMC, apmc); in jme_init_one()
3012 netif_napi_add(netdev, &jme->napi, jme_poll); in jme_init_one()
3014 spin_lock_init(&jme->phy_lock); in jme_init_one()
3015 spin_lock_init(&jme->macaddr_lock); in jme_init_one()
3016 spin_lock_init(&jme->rxmcs_lock); in jme_init_one()
3018 atomic_set(&jme->link_changing, 1); in jme_init_one()
3019 atomic_set(&jme->rx_cleaning, 1); in jme_init_one()
3020 atomic_set(&jme->tx_cleaning, 1); in jme_init_one()
3021 atomic_set(&jme->rx_empty, 1); in jme_init_one()
3023 tasklet_setup(&jme->pcc_task, jme_pcc_tasklet); in jme_init_one()
3024 INIT_WORK(&jme->linkch_task, jme_link_change_work); in jme_init_one()
3025 jme->dpi.cur = PCC_P1; in jme_init_one()
3027 jme->reg_ghc = 0; in jme_init_one()
3028 jme->reg_rxcs = RXCS_DEFAULT; in jme_init_one()
3029 jme->reg_rxmcs = RXMCS_DEFAULT; in jme_init_one()
3030 jme->reg_txpfc = 0; in jme_init_one()
3031 jme->reg_pmcs = PMCS_MFEN; in jme_init_one()
3032 jme->reg_gpreg1 = GPREG1_DEFAULT; in jme_init_one()
3034 if (jme->reg_rxmcs & RXMCS_CHECKSUM) in jme_init_one()
3040 pci_read_config_byte(pdev, PCI_DCSR_MRRS, &jme->mrrs); in jme_init_one()
3041 jme->mrrs &= PCI_DCSR_MRRS_MASK; in jme_init_one()
3042 switch (jme->mrrs) { in jme_init_one()
3044 jme->reg_txcs = TXCS_DEFAULT | TXCS_DMASIZE_128B; in jme_init_one()
3047 jme->reg_txcs = TXCS_DEFAULT | TXCS_DMASIZE_256B; in jme_init_one()
3050 jme->reg_txcs = TXCS_DEFAULT | TXCS_DMASIZE_512B; in jme_init_one()
3057 jme_check_hw_ver(jme); in jme_init_one()
3058 jme->mii_if.dev = netdev; in jme_init_one()
3059 if (jme->fpgaver) { in jme_init_one()
3060 jme->mii_if.phy_id = 0; in jme_init_one()
3065 jme->mii_if.phy_id = i; in jme_init_one()
3070 if (!jme->mii_if.phy_id) { in jme_init_one()
3076 jme->reg_ghc |= GHC_LINK_POLL; in jme_init_one()
3078 jme->mii_if.phy_id = 1; in jme_init_one()
3081 jme->mii_if.supports_gmii = true; in jme_init_one()
3083 jme->mii_if.supports_gmii = false; in jme_init_one()
3084 jme->mii_if.phy_id_mask = 0x1F; in jme_init_one()
3085 jme->mii_if.reg_num_mask = 0x1F; in jme_init_one()
3086 jme->mii_if.mdio_read = jme_mdio_read; in jme_init_one()
3087 jme->mii_if.mdio_write = jme_mdio_write; in jme_init_one()
3089 jme_clear_pm_disable_wol(jme); in jme_init_one()
3092 jme_set_phyfifo_5level(jme); in jme_init_one()
3093 jme->pcirev = pdev->revision; in jme_init_one()
3094 if (!jme->fpgaver) in jme_init_one()
3095 jme_phy_init(jme); in jme_init_one()
3096 jme_phy_off(jme); in jme_init_one()
3101 jme_reset_mac_processor(jme); in jme_init_one()
3102 rc = jme_reload_eeprom(jme); in jme_init_one()
3120 netif_info(jme, probe, jme->dev, "%s%s chiprev:%x pcirev:%x macaddr:%pM\n", in jme_init_one()
3121 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ? in jme_init_one()
3123 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ? in jme_init_one()
3125 (jme->fpgaver != 0) ? " (FPGA)" : "", in jme_init_one()
3126 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, in jme_init_one()
3127 jme->pcirev, netdev->dev_addr); in jme_init_one()
3132 iounmap(jme->regs); in jme_init_one()
3147 struct jme_adapter *jme = netdev_priv(netdev); in jme_remove_one() local
3150 iounmap(jme->regs); in jme_remove_one()
3161 struct jme_adapter *jme = netdev_priv(netdev); in jme_shutdown() local
3163 jme_powersave_phy(jme); in jme_shutdown()
3172 struct jme_adapter *jme = netdev_priv(netdev); in jme_suspend() local
3177 atomic_dec(&jme->link_changing); in jme_suspend()
3181 jme_stop_irq(jme); in jme_suspend()
3183 tasklet_disable(&jme->txclean_task); in jme_suspend()
3184 tasklet_disable(&jme->rxclean_task); in jme_suspend()
3185 tasklet_disable(&jme->rxempty_task); in jme_suspend()
3188 if (test_bit(JME_FLAG_POLL, &jme->flags)) in jme_suspend()
3189 jme_polling_mode(jme); in jme_suspend()
3191 jme_stop_pcc_timer(jme); in jme_suspend()
3192 jme_disable_rx_engine(jme); in jme_suspend()
3193 jme_disable_tx_engine(jme); in jme_suspend()
3194 jme_reset_mac_processor(jme); in jme_suspend()
3195 jme_free_rx_resources(jme); in jme_suspend()
3196 jme_free_tx_resources(jme); in jme_suspend()
3198 jme->phylink = 0; in jme_suspend()
3201 tasklet_enable(&jme->txclean_task); in jme_suspend()
3202 tasklet_enable(&jme->rxclean_task); in jme_suspend()
3203 tasklet_enable(&jme->rxempty_task); in jme_suspend()
3205 jme_powersave_phy(jme); in jme_suspend()
3214 struct jme_adapter *jme = netdev_priv(netdev); in jme_resume() local
3219 jme_clear_pm_disable_wol(jme); in jme_resume()
3220 jme_phy_on(jme); in jme_resume()
3221 if (test_bit(JME_FLAG_SSET, &jme->flags)) in jme_resume()
3222 jme_set_link_ksettings(netdev, &jme->old_cmd); in jme_resume()
3224 jme_reset_phy_processor(jme); in jme_resume()
3225 jme_phy_calibration(jme); in jme_resume()
3226 jme_phy_setEA(jme); in jme_resume()
3229 atomic_inc(&jme->link_changing); in jme_resume()
3231 jme_reset_link(jme); in jme_resume()
3233 jme_start_irq(jme); in jme_resume()