Lines Matching refs:lp

155 #define SMC_ENABLE_INT(lp, x) do {			\  argument
157 __mask = SMC_GET_INT_EN((lp)); \
159 SMC_SET_INT_EN((lp), __mask); \
163 #define SMC_DISABLE_INT(lp, x) do { \ argument
165 __mask = SMC_GET_INT_EN((lp)); \
167 SMC_SET_INT_EN((lp), __mask); \
175 struct smc911x_local *lp = netdev_priv(dev); in smc911x_reset() local
182 if ((SMC_GET_PMT_CTRL(lp) & PMT_CTRL_READY_) == 0) { in smc911x_reset()
184 SMC_SET_BYTE_TEST(lp, 0); in smc911x_reset()
188 reg = SMC_GET_PMT_CTRL(lp) & PMT_CTRL_READY_; in smc911x_reset()
197 spin_lock_irqsave(&lp->lock, flags); in smc911x_reset()
198 SMC_SET_INT_EN(lp, 0); in smc911x_reset()
199 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_reset()
202 SMC_SET_HW_CFG(lp, HW_CFG_SRST_); in smc911x_reset()
206 reg = SMC_GET_HW_CFG(lp); in smc911x_reset()
222 while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) in smc911x_reset()
231 SMC_SET_INT_EN(lp, 0); in smc911x_reset()
232 SMC_ACK_INT(lp, -1); in smc911x_reset()
235 SMC_SET_HW_CFG(lp, (lp->tx_fifo_kb & 0xF) << 16); in smc911x_reset()
237 SMC_SET_FLOW(lp, FLOW_FCPT_ | FLOW_FCEN_); in smc911x_reset()
238 SMC_SET_AFC_CFG(lp, lp->afc_cfg); in smc911x_reset()
242 SMC_SET_GPIO_CFG(lp, 0x70070000); in smc911x_reset()
250 if (lp->cfg.irq_polarity) in smc911x_reset()
253 SMC_SET_IRQ_CFG(lp, irq_cfg); in smc911x_reset()
256 if (lp->pending_tx_skb != NULL) { in smc911x_reset()
257 dev_kfree_skb (lp->pending_tx_skb); in smc911x_reset()
258 lp->pending_tx_skb = NULL; in smc911x_reset()
269 struct smc911x_local *lp = netdev_priv(dev); in smc911x_enable() local
275 spin_lock_irqsave(&lp->lock, flags); in smc911x_enable()
277 SMC_SET_MAC_ADDR(lp, dev->dev_addr); in smc911x_enable()
280 cfg = SMC_GET_HW_CFG(lp); in smc911x_enable()
283 SMC_SET_HW_CFG(lp, cfg); in smc911x_enable()
284 SMC_SET_FIFO_TDA(lp, 0xFF); in smc911x_enable()
286 SMC_SET_FIFO_TSL(lp, 64); in smc911x_enable()
287 SMC_SET_GPT_CFG(lp, GPT_CFG_TIMER_EN_ | 10000); in smc911x_enable()
289 SMC_GET_MAC_CR(lp, cr); in smc911x_enable()
291 SMC_SET_MAC_CR(lp, cr); in smc911x_enable()
292 SMC_SET_TX_CFG(lp, TX_CFG_TX_ON_); in smc911x_enable()
295 SMC_SET_RX_CFG(lp, (2<<8) & RX_CFG_RXDOFF_); in smc911x_enable()
301 SMC_SET_MAC_CR(lp, cr | MAC_CR_RXEN_); in smc911x_enable()
304 SMC_SET_FIFO_RSA(lp, 0x01); in smc911x_enable()
305 SMC_SET_FIFO_RSL(lp, 0x00); in smc911x_enable()
311 if (IS_REV_A(lp->revision)) in smc911x_enable()
316 SMC_ENABLE_INT(lp, mask); in smc911x_enable()
318 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_enable()
326 struct smc911x_local *lp = netdev_priv(dev); in smc911x_shutdown() local
333 SMC_SET_INT_EN(lp, 0); in smc911x_shutdown()
336 spin_lock_irqsave(&lp->lock, flags); in smc911x_shutdown()
337 SMC_GET_MAC_CR(lp, cr); in smc911x_shutdown()
339 SMC_SET_MAC_CR(lp, cr); in smc911x_shutdown()
340 SMC_SET_TX_CFG(lp, TX_CFG_STOP_TX_); in smc911x_shutdown()
341 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_shutdown()
346 struct smc911x_local *lp = netdev_priv(dev); in smc911x_drop_pkt() local
351 fifo_count = SMC_GET_RX_FIFO_INF(lp) & 0xFFFF; in smc911x_drop_pkt()
355 SMC_GET_RX_FIFO(lp); in smc911x_drop_pkt()
358 SMC_SET_RX_DP_CTRL(lp, RX_DP_CTRL_FFWD_BUSY_); in smc911x_drop_pkt()
362 reg = SMC_GET_RX_DP_CTRL(lp) & RX_DP_CTRL_FFWD_BUSY_; in smc911x_drop_pkt()
378 struct smc911x_local *lp = netdev_priv(dev); in smc911x_rcv() local
385 status = SMC_GET_RX_STS_FIFO(lp); in smc911x_rcv()
423 fifo = SMC_GET_FIFO_INT(lp); in smc911x_rcv()
427 SMC_SET_FIFO_INT(lp, fifo); in smc911x_rcv()
429 SMC_SET_RX_CFG(lp, RX_CFG_RX_END_ALGN16_ | ((2<<8) & RX_CFG_RXDOFF_)); in smc911x_rcv()
430 lp->rxdma_active = 1; in smc911x_rcv()
431 lp->current_rx_skb = skb; in smc911x_rcv()
432 SMC_PULL_DATA(lp, data, (pkt_len+2+15) & ~15); in smc911x_rcv()
436 SMC_SET_RX_CFG(lp, RX_CFG_RX_END_ALGN4_ | ((2<<8) & RX_CFG_RXDOFF_)); in smc911x_rcv()
437 SMC_PULL_DATA(lp, data, pkt_len+2+3); in smc911x_rcv()
454 struct smc911x_local *lp = netdev_priv(dev); in smc911x_hardware_send_pkt() local
460 BUG_ON(lp->pending_tx_skb == NULL); in smc911x_hardware_send_pkt()
462 skb = lp->pending_tx_skb; in smc911x_hardware_send_pkt()
463 lp->pending_tx_skb = NULL; in smc911x_hardware_send_pkt()
486 SMC_SET_TX_FIFO(lp, cmdA); in smc911x_hardware_send_pkt()
487 SMC_SET_TX_FIFO(lp, cmdB); in smc911x_hardware_send_pkt()
494 lp->current_tx_skb = skb; in smc911x_hardware_send_pkt()
495 SMC_PUSH_DATA(lp, buf, len); in smc911x_hardware_send_pkt()
498 SMC_PUSH_DATA(lp, buf, len); in smc911x_hardware_send_pkt()
502 if (!lp->tx_throttle) { in smc911x_hardware_send_pkt()
505 SMC_ENABLE_INT(lp, INT_EN_TDFA_EN_ | INT_EN_TSFL_EN_); in smc911x_hardware_send_pkt()
516 struct smc911x_local *lp = netdev_priv(dev); in smc911x_hard_start_xmit() local
523 spin_lock_irqsave(&lp->lock, flags); in smc911x_hard_start_xmit()
525 BUG_ON(lp->pending_tx_skb != NULL); in smc911x_hard_start_xmit()
527 free = SMC_GET_TX_FIFO_INF(lp) & TX_FIFO_INF_TDFREE_; in smc911x_hard_start_xmit()
535 SMC_SET_FIFO_TDA(lp, (SMC911X_TX_FIFO_LOW_THRESHOLD)/64); in smc911x_hard_start_xmit()
536 lp->tx_throttle = 1; in smc911x_hard_start_xmit()
550 lp->pending_tx_skb = NULL; in smc911x_hard_start_xmit()
553 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_hard_start_xmit()
563 if (lp->txdma_active) { in smc911x_hard_start_xmit()
565 lp->pending_tx_skb = skb; in smc911x_hard_start_xmit()
567 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_hard_start_xmit()
571 lp->txdma_active = 1; in smc911x_hard_start_xmit()
575 lp->pending_tx_skb = skb; in smc911x_hard_start_xmit()
577 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_hard_start_xmit()
589 struct smc911x_local *lp = netdev_priv(dev); in smc911x_tx() local
596 while (((SMC_GET_TX_FIFO_INF(lp) & TX_FIFO_INF_TSUSED_) >> 16) != 0) { in smc911x_tx()
598 (SMC_GET_TX_FIFO_INF(lp) & TX_FIFO_INF_TSUSED_) >> 16); in smc911x_tx()
599 tx_status = SMC_GET_TX_STS_FIFO(lp); in smc911x_tx()
607 if ((tx_status & TX_STS_ES_) && !(lp->ctl_rfduplx && in smc911x_tx()
619 !lp->ctl_rfduplx) { in smc911x_tx()
637 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_read() local
640 SMC_GET_MII(lp, phyreg, phyaddr, phydata); in smc911x_phy_read()
654 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_write() local
659 SMC_SET_MII(lp, phyreg, phyaddr, phydata); in smc911x_phy_write()
668 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_detect() local
674 lp->phy_type = 0; in smc911x_phy_detect()
680 switch(lp->version) { in smc911x_phy_detect()
685 cfg = SMC_GET_HW_CFG(lp); in smc911x_phy_detect()
689 SMC_SET_HW_CFG(lp, cfg); in smc911x_phy_detect()
693 SMC_SET_HW_CFG(lp, cfg); in smc911x_phy_detect()
698 SMC_SET_HW_CFG(lp, cfg); in smc911x_phy_detect()
702 SMC_SET_HW_CFG(lp, cfg); in smc911x_phy_detect()
707 SMC_GET_PHY_ID1(lp, phyaddr & 31, id1); in smc911x_phy_detect()
708 SMC_GET_PHY_ID2(lp, phyaddr & 31, id2); in smc911x_phy_detect()
715 lp->mii.phy_id = phyaddr & 31; in smc911x_phy_detect()
716 lp->phy_type = id1 << 16 | id2; in smc911x_phy_detect()
726 SMC_GET_PHY_ID1(lp, 1, id1); in smc911x_phy_detect()
727 SMC_GET_PHY_ID2(lp, 1, id2); in smc911x_phy_detect()
729 lp->mii.phy_id = 1; in smc911x_phy_detect()
730 lp->phy_type = id1 << 16 | id2; in smc911x_phy_detect()
734 id1, id2, lp->mii.phy_id); in smc911x_phy_detect()
743 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_fixed() local
744 int phyaddr = lp->mii.phy_id; in smc911x_phy_fixed()
750 SMC_GET_PHY_BMCR(lp, phyaddr, bmcr); in smc911x_phy_fixed()
752 SMC_SET_PHY_BMCR(lp, phyaddr, bmcr); in smc911x_phy_fixed()
759 if (lp->ctl_rfduplx) in smc911x_phy_fixed()
762 if (lp->ctl_rspeed == 100) in smc911x_phy_fixed()
766 SMC_SET_PHY_BMCR(lp, phyaddr, bmcr); in smc911x_phy_fixed()
770 SMC_SET_PHY_BMCR(lp, phyaddr, bmcr); in smc911x_phy_fixed()
789 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_reset() local
796 spin_lock_irqsave(&lp->lock, flags); in smc911x_phy_reset()
797 reg = SMC_GET_PMT_CTRL(lp); in smc911x_phy_reset()
800 SMC_SET_PMT_CTRL(lp, reg); in smc911x_phy_reset()
801 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_phy_reset()
804 spin_lock_irqsave(&lp->lock, flags); in smc911x_phy_reset()
805 reg = SMC_GET_PMT_CTRL(lp); in smc911x_phy_reset()
806 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_phy_reset()
830 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_powerdown() local
834 SMC_GET_PHY_BMCR(lp, phy, bmcr); in smc911x_phy_powerdown()
836 SMC_SET_PHY_BMCR(lp, phy, bmcr); in smc911x_phy_powerdown()
849 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_check_media() local
850 int phyaddr = lp->mii.phy_id; in smc911x_phy_check_media()
855 if (mii_check_media(&lp->mii, netif_msg_link(lp), init)) { in smc911x_phy_check_media()
857 SMC_GET_PHY_BMCR(lp, phyaddr, bmcr); in smc911x_phy_check_media()
858 SMC_GET_MAC_CR(lp, cr); in smc911x_phy_check_media()
859 if (lp->mii.full_duplex) { in smc911x_phy_check_media()
868 SMC_SET_PHY_BMCR(lp, phyaddr, bmcr); in smc911x_phy_check_media()
869 SMC_SET_MAC_CR(lp, cr); in smc911x_phy_check_media()
884 struct smc911x_local *lp = container_of(work, struct smc911x_local, in smc911x_phy_configure() local
886 struct net_device *dev = lp->netdev; in smc911x_phy_configure()
887 int phyaddr = lp->mii.phy_id; in smc911x_phy_configure()
898 if (lp->phy_type == 0) in smc911x_phy_configure()
905 spin_lock_irqsave(&lp->lock, flags); in smc911x_phy_configure()
911 SMC_SET_PHY_INT_MASK(lp, phyaddr, PHY_INT_MASK_ENERGY_ON_ | in smc911x_phy_configure()
916 if (lp->mii.force_media) { in smc911x_phy_configure()
922 SMC_GET_PHY_BMSR(lp, phyaddr, my_phy_caps); in smc911x_phy_configure()
944 if (lp->ctl_rspeed != 100) in smc911x_phy_configure()
947 if (!lp->ctl_rfduplx) in smc911x_phy_configure()
951 SMC_SET_PHY_MII_ADV(lp, phyaddr, my_ad_caps); in smc911x_phy_configure()
952 lp->mii.advertising = my_ad_caps; in smc911x_phy_configure()
960 SMC_GET_PHY_MII_ADV(lp, phyaddr, status); in smc911x_phy_configure()
966 SMC_SET_PHY_BMCR(lp, phyaddr, BMCR_ANENABLE | BMCR_ANRESTART); in smc911x_phy_configure()
971 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_phy_configure()
982 struct smc911x_local *lp = netdev_priv(dev); in smc911x_phy_interrupt() local
983 int phyaddr = lp->mii.phy_id; in smc911x_phy_interrupt()
988 if (lp->phy_type == 0) in smc911x_phy_interrupt()
993 SMC_GET_PHY_INT_SRC(lp, phyaddr,status); in smc911x_phy_interrupt()
997 SMC_GET_AFC_CFG(lp)); in smc911x_phy_interrupt()
1009 struct smc911x_local *lp = netdev_priv(dev); in smc911x_interrupt() local
1016 spin_lock_irqsave(&lp->lock, flags); in smc911x_interrupt()
1019 if ((SMC_GET_IRQ_CFG(lp) & (INT_CFG_IRQ_INT_ | INT_CFG_IRQ_EN_)) != in smc911x_interrupt()
1021 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_interrupt()
1025 mask = SMC_GET_INT_EN(lp); in smc911x_interrupt()
1026 SMC_SET_INT_EN(lp, 0); in smc911x_interrupt()
1033 status = SMC_GET_INT(lp); in smc911x_interrupt()
1044 SMC_ACK_INT(lp, INT_STS_SW_INT_); in smc911x_interrupt()
1049 SMC_ACK_INT(lp, INT_STS_RXE_); in smc911x_interrupt()
1053 SMC_ACK_INT(lp, INT_STS_RXDFH_INT_); in smc911x_interrupt()
1054 dev->stats.rx_dropped+=SMC_GET_RX_DROP(lp); in smc911x_interrupt()
1058 SMC_ACK_INT(lp, INT_STS_RXDF_INT_); in smc911x_interrupt()
1063 if (IS_REV_A(lp->revision)) { in smc911x_interrupt()
1065 SMC_GET_MAC_CR(lp, cr); in smc911x_interrupt()
1067 SMC_SET_MAC_CR(lp, cr); in smc911x_interrupt()
1072 SMC_ACK_INT(lp, INT_STS_RDFL_); in smc911x_interrupt()
1075 if (!IS_REV_A(lp->revision)) { in smc911x_interrupt()
1076 SMC_GET_MAC_CR(lp, cr); in smc911x_interrupt()
1078 SMC_SET_MAC_CR(lp, cr); in smc911x_interrupt()
1084 SMC_ACK_INT(lp, INT_STS_RDFO_); in smc911x_interrupt()
1090 fifo = SMC_GET_RX_FIFO_INF(lp); in smc911x_interrupt()
1097 if (lp->rxdma_active){ in smc911x_interrupt()
1101 fifo = SMC_GET_FIFO_INT(lp) & ~0xFF; in smc911x_interrupt()
1106 SMC_SET_FIFO_INT(lp, fifo); in smc911x_interrupt()
1111 SMC_ACK_INT(lp, INT_STS_RSFL_); in smc911x_interrupt()
1116 SMC_SET_FIFO_TDA(lp, 0xFF); in smc911x_interrupt()
1117 lp->tx_throttle = 0; in smc911x_interrupt()
1119 if (!lp->txdma_active) in smc911x_interrupt()
1122 SMC_ACK_INT(lp, INT_STS_TDFA_); in smc911x_interrupt()
1129 (SMC_GET_FIFO_INT(lp) & 0x00ff0000) >> 16); in smc911x_interrupt()
1131 SMC_SET_GPT_CFG(lp, GPT_CFG_TIMER_EN_ | 10000); in smc911x_interrupt()
1132 SMC_ACK_INT(lp, INT_STS_TSFL_); in smc911x_interrupt()
1133 SMC_ACK_INT(lp, INT_STS_TSFL_ | INT_STS_GPT_INT_); in smc911x_interrupt()
1139 SMC_ACK_INT(lp, INT_STS_TSFL_); in smc911x_interrupt()
1144 SMC_GET_IRQ_CFG(lp), in smc911x_interrupt()
1145 SMC_GET_FIFO_INT(lp), in smc911x_interrupt()
1146 SMC_GET_RX_CFG(lp)); in smc911x_interrupt()
1148 (SMC_GET_RX_FIFO_INF(lp) & 0x00ff0000) >> 16, in smc911x_interrupt()
1149 SMC_GET_RX_FIFO_INF(lp) & 0xffff, in smc911x_interrupt()
1150 SMC_GET_RX_STS_FIFO_PEEK(lp)); in smc911x_interrupt()
1151 SMC_SET_GPT_CFG(lp, GPT_CFG_TIMER_EN_ | 10000); in smc911x_interrupt()
1152 SMC_ACK_INT(lp, INT_STS_GPT_INT_); in smc911x_interrupt()
1160 SMC_ACK_INT(lp, INT_STS_PHY_INT_); in smc911x_interrupt()
1165 SMC_SET_INT_EN(lp, mask); in smc911x_interrupt()
1170 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_interrupt()
1180 struct smc911x_local *lp = netdev_priv(dev); in smc911x_tx_dma_irq() local
1181 struct sk_buff *skb = lp->current_tx_skb; in smc911x_tx_dma_irq()
1193 lp->current_tx_skb = NULL; in smc911x_tx_dma_irq()
1194 if (lp->pending_tx_skb != NULL) in smc911x_tx_dma_irq()
1199 spin_lock_irqsave(&lp->lock, flags); in smc911x_tx_dma_irq()
1200 lp->txdma_active = 0; in smc911x_tx_dma_irq()
1201 if (!lp->tx_throttle) { in smc911x_tx_dma_irq()
1204 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_tx_dma_irq()
1214 struct smc911x_local *lp = netdev_priv(dev); in smc911x_rx_dma_irq() local
1215 struct sk_buff *skb = lp->current_rx_skb; in smc911x_rx_dma_irq()
1225 lp->current_rx_skb = NULL; in smc911x_rx_dma_irq()
1232 spin_lock_irqsave(&lp->lock, flags); in smc911x_rx_dma_irq()
1233 pkts = (SMC_GET_RX_FIFO_INF(lp) & RX_FIFO_INF_RXSUSED_) >> 16; in smc911x_rx_dma_irq()
1237 lp->rxdma_active = 0; in smc911x_rx_dma_irq()
1239 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_rx_dma_irq()
1262 struct smc911x_local *lp = netdev_priv(dev); in smc911x_timeout() local
1268 spin_lock_irqsave(&lp->lock, flags); in smc911x_timeout()
1269 status = SMC_GET_INT(lp); in smc911x_timeout()
1270 mask = SMC_GET_INT_EN(lp); in smc911x_timeout()
1271 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_timeout()
1276 mask = SMC_GET_TX_CFG(lp); in smc911x_timeout()
1277 SMC_SET_TX_CFG(lp, mask | TX_CFG_TXS_DUMP_ | TX_CFG_TXD_DUMP_); in smc911x_timeout()
1283 if (lp->phy_type != 0) in smc911x_timeout()
1284 schedule_work(&lp->phy_configure); in smc911x_timeout()
1299 struct smc911x_local *lp = netdev_priv(dev); in smc911x_set_multicast_list() local
1306 spin_lock_irqsave(&lp->lock, flags); in smc911x_set_multicast_list()
1307 SMC_GET_MAC_CR(lp, mcr); in smc911x_set_multicast_list()
1308 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_set_multicast_list()
1372 spin_lock_irqsave(&lp->lock, flags); in smc911x_set_multicast_list()
1373 SMC_SET_MAC_CR(lp, mcr); in smc911x_set_multicast_list()
1378 SMC_SET_HASHL(lp, multicast_table[0]); in smc911x_set_multicast_list()
1379 SMC_SET_HASHH(lp, multicast_table[1]); in smc911x_set_multicast_list()
1381 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_set_multicast_list()
1393 struct smc911x_local *lp = netdev_priv(dev); in smc911x_open() local
1401 smc911x_phy_configure(&lp->phy_configure); in smc911x_open()
1420 struct smc911x_local *lp = netdev_priv(dev); in smc911x_close() local
1430 if (lp->phy_type != 0) { in smc911x_close()
1434 cancel_work_sync(&lp->phy_configure); in smc911x_close()
1435 smc911x_phy_powerdown(dev, lp->mii.phy_id); in smc911x_close()
1438 if (lp->pending_tx_skb) { in smc911x_close()
1439 dev_kfree_skb(lp->pending_tx_skb); in smc911x_close()
1440 lp->pending_tx_skb = NULL; in smc911x_close()
1452 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_getsettings() local
1460 if (lp->phy_type != 0) { in smc911x_ethtool_getsettings()
1461 spin_lock_irqsave(&lp->lock, flags); in smc911x_ethtool_getsettings()
1462 ret = mii_ethtool_gset(&lp->mii, cmd); in smc911x_ethtool_getsettings()
1463 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_ethtool_getsettings()
1469 if (lp->ctl_rspeed == 10) in smc911x_ethtool_getsettings()
1471 else if (lp->ctl_rspeed == 100) in smc911x_ethtool_getsettings()
1475 if (lp->mii.phy_id==1) in smc911x_ethtool_getsettings()
1480 SMC_GET_PHY_SPECIAL(lp, lp->mii.phy_id, status); in smc911x_ethtool_getsettings()
1493 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_setsettings() local
1497 if (lp->phy_type != 0) { in smc911x_ethtool_setsettings()
1498 spin_lock_irqsave(&lp->lock, flags); in smc911x_ethtool_setsettings()
1499 ret = mii_ethtool_sset(&lp->mii, cmd); in smc911x_ethtool_setsettings()
1500 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_ethtool_setsettings()
1508 lp->ctl_rfduplx = cmd->duplex == DUPLEX_FULL; in smc911x_ethtool_setsettings()
1527 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_nwayreset() local
1531 if (lp->phy_type != 0) { in smc911x_ethtool_nwayreset()
1532 spin_lock_irqsave(&lp->lock, flags); in smc911x_ethtool_nwayreset()
1533 ret = mii_nway_restart(&lp->mii); in smc911x_ethtool_nwayreset()
1534 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_ethtool_nwayreset()
1542 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_getmsglevel() local
1543 return lp->msg_enable; in smc911x_ethtool_getmsglevel()
1548 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_setmsglevel() local
1549 lp->msg_enable = level; in smc911x_ethtool_setmsglevel()
1562 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_getregs() local
1567 regs->version = lp->version; in smc911x_ethtool_getregs()
1569 data[j++] = SMC_inl(lp, i); in smc911x_ethtool_getregs()
1572 spin_lock_irqsave(&lp->lock, flags); in smc911x_ethtool_getregs()
1573 SMC_GET_MAC_CSR(lp, i, reg); in smc911x_ethtool_getregs()
1574 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_ethtool_getregs()
1578 spin_lock_irqsave(&lp->lock, flags); in smc911x_ethtool_getregs()
1579 SMC_GET_MII(lp, i, lp->mii.phy_id, reg); in smc911x_ethtool_getregs()
1580 spin_unlock_irqrestore(&lp->lock, flags); in smc911x_ethtool_getregs()
1587 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_wait_eeprom_ready() local
1591 e2p_cmd = SMC_GET_E2P_CMD(lp); in smc911x_ethtool_wait_eeprom_ready()
1599 e2p_cmd = SMC_GET_E2P_CMD(lp); in smc911x_ethtool_wait_eeprom_ready()
1612 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_write_eeprom_cmd() local
1617 SMC_SET_E2P_CMD(lp, E2P_CMD_EPC_BUSY_ | in smc911x_ethtool_write_eeprom_cmd()
1626 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_read_eeprom_byte() local
1631 *data = SMC_GET_E2P_DATA(lp); in smc911x_ethtool_read_eeprom_byte()
1638 struct smc911x_local *lp = netdev_priv(dev); in smc911x_ethtool_write_eeprom_byte() local
1643 SMC_SET_E2P_DATA(lp, data); in smc911x_ethtool_write_eeprom_byte()
1712 struct smc911x_local *lp = netdev_priv(dev); in smc911x_findirq() local
1724 SMC_SET_INT_EN(lp, INT_EN_SW_INT_EN_); in smc911x_findirq()
1732 int_status = SMC_GET_INT_EN(lp); in smc911x_findirq()
1745 SMC_SET_INT_EN(lp, 0); in smc911x_findirq()
1790 struct smc911x_local *lp = netdev_priv(dev); in smc911x_probe() local
1799 val = SMC_GET_BYTE_TEST(lp); in smc911x_probe()
1813 chip_id = SMC_GET_PN(lp); in smc911x_probe()
1826 revision = SMC_GET_REV(lp); in smc911x_probe()
1842 lp->version = chip_ids[i].id; in smc911x_probe()
1843 lp->revision = revision; in smc911x_probe()
1844 lp->tx_fifo_kb = tx_fifo_kb; in smc911x_probe()
1846 lp->tx_fifo_size=(lp->tx_fifo_kb<<10) - 512; in smc911x_probe()
1847 lp->rx_fifo_size= ((0x4000 - 512 - lp->tx_fifo_size) / 16) * 15; in smc911x_probe()
1850 switch(lp->tx_fifo_kb) { in smc911x_probe()
1857 lp->afc_cfg=0x008C46AF;break; in smc911x_probe()
1859 lp->afc_cfg=0x0082419F;break; in smc911x_probe()
1861 lp->afc_cfg=0x00783C9F;break; in smc911x_probe()
1863 lp->afc_cfg=0x006E374F;break; in smc911x_probe()
1865 lp->afc_cfg=0x0064328F;break; in smc911x_probe()
1867 lp->afc_cfg=0x005A2D7F;break; in smc911x_probe()
1869 lp->afc_cfg=0x0050287F;break; in smc911x_probe()
1871 lp->afc_cfg=0x0046236F;break; in smc911x_probe()
1873 lp->afc_cfg=0x003C1E6F;break; in smc911x_probe()
1875 lp->afc_cfg=0x0032195F;break; in smc911x_probe()
1882 lp->afc_cfg=0x0024124F;break; in smc911x_probe()
1884 lp->afc_cfg=0x0015073F;break; in smc911x_probe()
1886 lp->afc_cfg=0x0006032F;break; in smc911x_probe()
1894 lp->tx_fifo_size, lp->rx_fifo_size, lp->afc_cfg); in smc911x_probe()
1896 spin_lock_init(&lp->lock); in smc911x_probe()
1899 SMC_GET_MAC_ADDR(lp, dev->dev_addr); in smc911x_probe()
1934 INIT_WORK(&lp->phy_configure, smc911x_phy_configure); in smc911x_probe()
1935 lp->mii.phy_id_mask = 0x1f; in smc911x_probe()
1936 lp->mii.reg_num_mask = 0x1f; in smc911x_probe()
1937 lp->mii.force_media = 0; in smc911x_probe()
1938 lp->mii.full_duplex = 0; in smc911x_probe()
1939 lp->mii.dev = dev; in smc911x_probe()
1940 lp->mii.mdio_read = smc911x_phy_read; in smc911x_probe()
1941 lp->mii.mdio_write = smc911x_phy_write; in smc911x_probe()
1949 lp->msg_enable = NETIF_MSG_LINK; in smc911x_probe()
1950 lp->ctl_rfduplx = 1; in smc911x_probe()
1951 lp->ctl_rspeed = 100; in smc911x_probe()
1954 irq_flags = lp->cfg.irq_flags; in smc911x_probe()
1966 lp->rxdma = SMC_DMA_REQUEST(dev, smc911x_rx_dma_irq); in smc911x_probe()
1967 lp->txdma = SMC_DMA_REQUEST(dev, smc911x_tx_dma_irq); in smc911x_probe()
1968 lp->rxdma_active = 0; in smc911x_probe()
1969 lp->txdma_active = 0; in smc911x_probe()
1970 dev->dma = lp->rxdma; in smc911x_probe()
1977 version_string, lp->revision, in smc911x_probe()
1981 if (lp->rxdma != -1) in smc911x_probe()
1982 pr_cont(" RXDMA %d", lp->rxdma); in smc911x_probe()
1984 if (lp->txdma != -1) in smc911x_probe()
1985 pr_cont(" TXDMA %d", lp->txdma); in smc911x_probe()
1996 if (lp->phy_type == 0) { in smc911x_probe()
1998 } else if ((lp->phy_type & ~0xff) == LAN911X_INTERNAL_PHY_ID) { in smc911x_probe()
2001 PRINTK(dev, "External PHY 0x%08x\n", lp->phy_type); in smc911x_probe()
2008 if (lp->rxdma != -1) { in smc911x_probe()
2009 SMC_DMA_FREE(dev, lp->rxdma); in smc911x_probe()
2011 if (lp->txdma != -1) { in smc911x_probe()
2012 SMC_DMA_FREE(dev, lp->txdma); in smc911x_probe()
2030 struct smc911x_local *lp; in smc911x_drv_probe() local
2059 lp = netdev_priv(ndev); in smc911x_drv_probe()
2060 lp->netdev = ndev; in smc911x_drv_probe()
2068 memcpy(&lp->cfg, pd, sizeof(lp->cfg)); in smc911x_drv_probe()
2079 lp->base = addr; in smc911x_drv_probe()
2093 lp->physaddr = res->start; in smc911x_drv_probe()
2094 lp->dev = &pdev->dev; in smc911x_drv_probe()
2104 struct smc911x_local *lp = netdev_priv(ndev); in smc911x_drv_remove() local
2115 if (lp->rxdma != -1) { in smc911x_drv_remove()
2116 SMC_DMA_FREE(dev, lp->rxdma); in smc911x_drv_remove()
2118 if (lp->txdma != -1) { in smc911x_drv_remove()
2119 SMC_DMA_FREE(dev, lp->txdma); in smc911x_drv_remove()
2123 iounmap(lp->base); in smc911x_drv_remove()
2134 struct smc911x_local *lp = netdev_priv(ndev); in smc911x_drv_suspend() local
2143 SMC_SET_PMT_CTRL(lp, 2<<12); in smc911x_drv_suspend()
2156 struct smc911x_local *lp = netdev_priv(ndev); in smc911x_drv_resume() local
2160 if (lp->phy_type != 0) in smc911x_drv_resume()
2161 smc911x_phy_configure(&lp->phy_configure); in smc911x_drv_resume()