Lines Matching refs:pep
280 static int pxa168_init_hw(struct pxa168_eth_private *pep);
287 static inline u32 rdl(struct pxa168_eth_private *pep, int offset) in rdl() argument
289 return readl(pep->base + offset); in rdl()
292 static inline void wrl(struct pxa168_eth_private *pep, int offset, u32 data) in wrl() argument
294 writel(data, pep->base + offset); in wrl()
297 static void abort_dma(struct pxa168_eth_private *pep) in abort_dma() argument
303 wrl(pep, SDMA_CMD, SDMA_CMD_AR | SDMA_CMD_AT); in abort_dma()
307 while ((rdl(pep, SDMA_CMD) & (SDMA_CMD_AR | SDMA_CMD_AT)) in abort_dma()
314 netdev_err(pep->dev, "%s : DMA Stuck\n", __func__); in abort_dma()
319 struct pxa168_eth_private *pep = netdev_priv(dev); in rxq_refill() local
324 while (pep->rx_desc_count < pep->rx_ring_size) { in rxq_refill()
327 skb = netdev_alloc_skb(dev, pep->skb_size); in rxq_refill()
332 pep->rx_desc_count++; in rxq_refill()
334 used_rx_desc = pep->rx_used_desc_q; in rxq_refill()
335 p_used_rx_desc = &pep->p_rx_desc_area[used_rx_desc]; in rxq_refill()
342 pep->rx_skb[used_rx_desc] = skb; in rxq_refill()
350 pep->rx_used_desc_q = (used_rx_desc + 1) % pep->rx_ring_size; in rxq_refill()
353 pep->rx_resource_err = 0; in rxq_refill()
362 if (pep->rx_desc_count == 0) { in rxq_refill()
363 pep->timeout.expires = jiffies + (HZ / 10); in rxq_refill()
364 add_timer(&pep->timeout); in rxq_refill()
370 struct pxa168_eth_private *pep = (void *)data; in rxq_refill_timer_wrapper() local
371 napi_schedule(&pep->napi); in rxq_refill_timer_wrapper()
450 static int add_del_hash_entry(struct pxa168_eth_private *pep, in add_del_hash_entry() argument
480 start = pep->htpr; in add_del_hash_entry()
505 netdev_info(pep->dev, in add_del_hash_entry()
536 static void update_hash_table_mac_address(struct pxa168_eth_private *pep, in update_hash_table_mac_address() argument
542 add_del_hash_entry(pep, oaddr, 1, 0, HASH_DELETE); in update_hash_table_mac_address()
544 add_del_hash_entry(pep, addr, 1, 0, HASH_ADD); in update_hash_table_mac_address()
547 static int init_hash_table(struct pxa168_eth_private *pep) in init_hash_table() argument
562 if (pep->htpr == NULL) { in init_hash_table()
563 pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent, in init_hash_table()
565 &pep->htpr_dma, GFP_KERNEL); in init_hash_table()
566 if (pep->htpr == NULL) in init_hash_table()
569 memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE); in init_hash_table()
571 wrl(pep, HTPR, pep->htpr_dma); in init_hash_table()
577 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_set_rx_mode() local
581 val = rdl(pep, PORT_CONFIG); in pxa168_eth_set_rx_mode()
586 wrl(pep, PORT_CONFIG, val); in pxa168_eth_set_rx_mode()
592 memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE); in pxa168_eth_set_rx_mode()
593 update_hash_table_mac_address(pep, NULL, dev->dev_addr); in pxa168_eth_set_rx_mode()
596 update_hash_table_mac_address(pep, NULL, ha->addr); in pxa168_eth_set_rx_mode()
602 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_get_mac_address() local
603 unsigned int mac_h = rdl(pep, MAC_ADDR_HIGH); in pxa168_eth_get_mac_address()
604 unsigned int mac_l = rdl(pep, MAC_ADDR_LOW); in pxa168_eth_get_mac_address()
617 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_set_mac_address() local
632 wrl(pep, MAC_ADDR_HIGH, mac_h); in pxa168_eth_set_mac_address()
633 wrl(pep, MAC_ADDR_LOW, mac_l); in pxa168_eth_set_mac_address()
636 update_hash_table_mac_address(pep, oldMac, dev->dev_addr); in pxa168_eth_set_mac_address()
644 struct pxa168_eth_private *pep = netdev_priv(dev); in eth_port_start() local
647 phy_start(pep->phy); in eth_port_start()
650 tx_curr_desc = pep->tx_curr_desc_q; in eth_port_start()
651 wrl(pep, ETH_C_TX_DESC_1, in eth_port_start()
652 (u32) (pep->tx_desc_dma + tx_curr_desc * sizeof(struct tx_desc))); in eth_port_start()
655 rx_curr_desc = pep->rx_curr_desc_q; in eth_port_start()
656 wrl(pep, ETH_C_RX_DESC_0, in eth_port_start()
657 (u32) (pep->rx_desc_dma + rx_curr_desc * sizeof(struct rx_desc))); in eth_port_start()
659 wrl(pep, ETH_F_RX_DESC_0, in eth_port_start()
660 (u32) (pep->rx_desc_dma + rx_curr_desc * sizeof(struct rx_desc))); in eth_port_start()
663 wrl(pep, INT_CAUSE, 0); in eth_port_start()
666 wrl(pep, INT_MASK, ALL_INTS); in eth_port_start()
668 val = rdl(pep, PORT_CONFIG); in eth_port_start()
670 wrl(pep, PORT_CONFIG, val); in eth_port_start()
673 val = rdl(pep, SDMA_CMD); in eth_port_start()
675 wrl(pep, SDMA_CMD, val); in eth_port_start()
680 struct pxa168_eth_private *pep = netdev_priv(dev); in eth_port_reset() local
684 wrl(pep, INT_MASK, 0); in eth_port_reset()
687 wrl(pep, INT_CAUSE, 0); in eth_port_reset()
690 val = rdl(pep, SDMA_CMD); in eth_port_reset()
696 abort_dma(pep); in eth_port_reset()
699 val = rdl(pep, PORT_CONFIG); in eth_port_reset()
701 wrl(pep, PORT_CONFIG, val); in eth_port_reset()
703 phy_stop(pep->phy); in eth_port_reset()
712 struct pxa168_eth_private *pep = netdev_priv(dev); in txq_reclaim() local
723 pep->work_todo &= ~WORK_TX_DONE; in txq_reclaim()
724 while (pep->tx_desc_count > 0) { in txq_reclaim()
725 tx_index = pep->tx_used_desc_q; in txq_reclaim()
726 desc = &pep->p_tx_desc_area[tx_index]; in txq_reclaim()
736 pep->tx_used_desc_q = (tx_index + 1) % pep->tx_ring_size; in txq_reclaim()
737 pep->tx_desc_count--; in txq_reclaim()
740 skb = pep->tx_skb[tx_index]; in txq_reclaim()
742 pep->tx_skb[tx_index] = NULL; in txq_reclaim()
761 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_tx_timeout() local
763 netdev_info(dev, "TX timeout desc_count %d\n", pep->tx_desc_count); in pxa168_eth_tx_timeout()
765 schedule_work(&pep->tx_timeout_task); in pxa168_eth_tx_timeout()
770 struct pxa168_eth_private *pep = container_of(work, in pxa168_eth_tx_timeout_task() local
773 struct net_device *dev = pep->dev; in pxa168_eth_tx_timeout_task()
780 struct pxa168_eth_private *pep = netdev_priv(dev); in rxq_process() local
791 if (pep->rx_resource_err) in rxq_process()
793 rx_curr_desc = pep->rx_curr_desc_q; in rxq_process()
794 rx_used_desc = pep->rx_used_desc_q; in rxq_process()
795 rx_desc = &pep->p_rx_desc_area[rx_curr_desc]; in rxq_process()
800 skb = pep->rx_skb[rx_curr_desc]; in rxq_process()
801 pep->rx_skb[rx_curr_desc] = NULL; in rxq_process()
803 rx_next_curr_desc = (rx_curr_desc + 1) % pep->rx_ring_size; in rxq_process()
804 pep->rx_curr_desc_q = rx_next_curr_desc; in rxq_process()
809 pep->rx_resource_err = 1; in rxq_process()
810 pep->rx_desc_count--; in rxq_process()
854 static int pxa168_eth_collect_events(struct pxa168_eth_private *pep, in pxa168_eth_collect_events() argument
860 icr = rdl(pep, INT_CAUSE); in pxa168_eth_collect_events()
864 wrl(pep, INT_CAUSE, ~icr); in pxa168_eth_collect_events()
866 pep->work_todo |= WORK_TX_DONE; in pxa168_eth_collect_events()
877 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_int_handler() local
879 if (unlikely(!pxa168_eth_collect_events(pep, dev))) in pxa168_eth_int_handler()
882 wrl(pep, INT_MASK, 0); in pxa168_eth_int_handler()
883 napi_schedule(&pep->napi); in pxa168_eth_int_handler()
887 static void pxa168_eth_recalc_skb_size(struct pxa168_eth_private *pep) in pxa168_eth_recalc_skb_size() argument
897 skb_size = pep->dev->mtu + 36; in pxa168_eth_recalc_skb_size()
904 pep->skb_size = (skb_size + 7) & ~7; in pxa168_eth_recalc_skb_size()
912 pep->skb_size += SKB_DMA_REALIGN; in pxa168_eth_recalc_skb_size()
916 static int set_port_config_ext(struct pxa168_eth_private *pep) in set_port_config_ext() argument
920 pxa168_eth_recalc_skb_size(pep); in set_port_config_ext()
921 if (pep->skb_size <= 1518) in set_port_config_ext()
923 else if (pep->skb_size <= 1536) in set_port_config_ext()
925 else if (pep->skb_size <= 2048) in set_port_config_ext()
931 wrl(pep, PORT_CONFIG_EXT, in set_port_config_ext()
945 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_adjust_link() local
946 struct phy_device *phy = pep->phy; in pxa168_eth_adjust_link()
947 u32 cfg, cfg_o = rdl(pep, PORT_CONFIG); in pxa168_eth_adjust_link()
948 u32 cfgext, cfgext_o = rdl(pep, PORT_CONFIG_EXT); in pxa168_eth_adjust_link()
966 wrl(pep, PORT_CONFIG, cfg); in pxa168_eth_adjust_link()
967 wrl(pep, PORT_CONFIG_EXT, cfgext); in pxa168_eth_adjust_link()
974 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_init_phy() local
978 if (pep->phy) in pxa168_init_phy()
981 pep->phy = mdiobus_scan(pep->smi_bus, pep->phy_addr); in pxa168_init_phy()
982 if (!pep->phy) in pxa168_init_phy()
985 err = phy_connect_direct(dev, pep->phy, pxa168_eth_adjust_link, in pxa168_init_phy()
986 pep->phy_intf); in pxa168_init_phy()
994 cmd.phy_address = pep->phy_addr; in pxa168_init_phy()
995 cmd.speed = pep->phy_speed; in pxa168_init_phy()
996 cmd.duplex = pep->phy_duplex; in pxa168_init_phy()
1006 static int pxa168_init_hw(struct pxa168_eth_private *pep) in pxa168_init_hw() argument
1011 wrl(pep, INT_MASK, 0); in pxa168_init_hw()
1012 wrl(pep, INT_CAUSE, 0); in pxa168_init_hw()
1014 wrl(pep, INT_W_CLEAR, 0); in pxa168_init_hw()
1018 abort_dma(pep); in pxa168_init_hw()
1020 err = init_hash_table(pep); in pxa168_init_hw()
1024 wrl(pep, SDMA_CONFIG, SDCR_BSZ8 | /* Burst size = 32 bytes */ in pxa168_init_hw()
1030 wrl(pep, PORT_CONFIG, PCR_HS); /* Hash size is 1/2kb */ in pxa168_init_hw()
1031 set_port_config_ext(pep); in pxa168_init_hw()
1038 struct pxa168_eth_private *pep = netdev_priv(dev); in rxq_init() local
1041 int rx_desc_num = pep->rx_ring_size; in rxq_init()
1044 pep->rx_skb = kzalloc(sizeof(*pep->rx_skb) * pep->rx_ring_size, in rxq_init()
1046 if (!pep->rx_skb) in rxq_init()
1050 pep->rx_desc_count = 0; in rxq_init()
1051 size = pep->rx_ring_size * sizeof(struct rx_desc); in rxq_init()
1052 pep->rx_desc_area_size = size; in rxq_init()
1053 pep->p_rx_desc_area = dma_zalloc_coherent(pep->dev->dev.parent, size, in rxq_init()
1054 &pep->rx_desc_dma, in rxq_init()
1056 if (!pep->p_rx_desc_area) in rxq_init()
1060 p_rx_desc = pep->p_rx_desc_area; in rxq_init()
1062 p_rx_desc[i].next_desc_ptr = pep->rx_desc_dma + in rxq_init()
1066 pep->rx_curr_desc_q = 0; in rxq_init()
1067 pep->rx_used_desc_q = 0; in rxq_init()
1068 pep->rx_desc_area_size = rx_desc_num * sizeof(struct rx_desc); in rxq_init()
1071 kfree(pep->rx_skb); in rxq_init()
1077 struct pxa168_eth_private *pep = netdev_priv(dev); in rxq_deinit() local
1081 for (curr = 0; pep->rx_desc_count && curr < pep->rx_ring_size; curr++) { in rxq_deinit()
1082 if (pep->rx_skb[curr]) { in rxq_deinit()
1083 dev_kfree_skb(pep->rx_skb[curr]); in rxq_deinit()
1084 pep->rx_desc_count--; in rxq_deinit()
1087 if (pep->rx_desc_count) in rxq_deinit()
1089 pep->rx_desc_count); in rxq_deinit()
1091 if (pep->p_rx_desc_area) in rxq_deinit()
1092 dma_free_coherent(pep->dev->dev.parent, pep->rx_desc_area_size, in rxq_deinit()
1093 pep->p_rx_desc_area, pep->rx_desc_dma); in rxq_deinit()
1094 kfree(pep->rx_skb); in rxq_deinit()
1099 struct pxa168_eth_private *pep = netdev_priv(dev); in txq_init() local
1102 int tx_desc_num = pep->tx_ring_size; in txq_init()
1104 pep->tx_skb = kzalloc(sizeof(*pep->tx_skb) * pep->tx_ring_size, in txq_init()
1106 if (!pep->tx_skb) in txq_init()
1110 pep->tx_desc_count = 0; in txq_init()
1111 size = pep->tx_ring_size * sizeof(struct tx_desc); in txq_init()
1112 pep->tx_desc_area_size = size; in txq_init()
1113 pep->p_tx_desc_area = dma_zalloc_coherent(pep->dev->dev.parent, size, in txq_init()
1114 &pep->tx_desc_dma, in txq_init()
1116 if (!pep->p_tx_desc_area) in txq_init()
1119 p_tx_desc = pep->p_tx_desc_area; in txq_init()
1121 p_tx_desc[i].next_desc_ptr = pep->tx_desc_dma + in txq_init()
1124 pep->tx_curr_desc_q = 0; in txq_init()
1125 pep->tx_used_desc_q = 0; in txq_init()
1126 pep->tx_desc_area_size = tx_desc_num * sizeof(struct tx_desc); in txq_init()
1129 kfree(pep->tx_skb); in txq_init()
1135 struct pxa168_eth_private *pep = netdev_priv(dev); in txq_deinit() local
1139 BUG_ON(pep->tx_used_desc_q != pep->tx_curr_desc_q); in txq_deinit()
1141 if (pep->p_tx_desc_area) in txq_deinit()
1142 dma_free_coherent(pep->dev->dev.parent, pep->tx_desc_area_size, in txq_deinit()
1143 pep->p_tx_desc_area, pep->tx_desc_dma); in txq_deinit()
1144 kfree(pep->tx_skb); in txq_deinit()
1149 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_open() local
1161 pep->rx_resource_err = 0; in pxa168_eth_open()
1168 pep->rx_used_desc_q = 0; in pxa168_eth_open()
1169 pep->rx_curr_desc_q = 0; in pxa168_eth_open()
1173 pep->rx_used_desc_q = 0; in pxa168_eth_open()
1174 pep->rx_curr_desc_q = 0; in pxa168_eth_open()
1176 napi_enable(&pep->napi); in pxa168_eth_open()
1188 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_stop() local
1192 wrl(pep, INT_MASK, 0); in pxa168_eth_stop()
1193 wrl(pep, INT_CAUSE, 0); in pxa168_eth_stop()
1195 wrl(pep, INT_W_CLEAR, 0); in pxa168_eth_stop()
1196 napi_disable(&pep->napi); in pxa168_eth_stop()
1197 del_timer_sync(&pep->timeout); in pxa168_eth_stop()
1209 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_change_mtu() local
1215 retval = set_port_config_ext(pep); in pxa168_eth_change_mtu()
1235 static int eth_alloc_tx_desc_index(struct pxa168_eth_private *pep) in eth_alloc_tx_desc_index() argument
1239 tx_desc_curr = pep->tx_curr_desc_q; in eth_alloc_tx_desc_index()
1240 pep->tx_curr_desc_q = (tx_desc_curr + 1) % pep->tx_ring_size; in eth_alloc_tx_desc_index()
1241 BUG_ON(pep->tx_curr_desc_q == pep->tx_used_desc_q); in eth_alloc_tx_desc_index()
1242 pep->tx_desc_count++; in eth_alloc_tx_desc_index()
1249 struct pxa168_eth_private *pep = in pxa168_rx_poll() local
1251 struct net_device *dev = pep->dev; in pxa168_rx_poll()
1261 && pep->tx_ring_size - pep->tx_desc_count > 1) { in pxa168_rx_poll()
1267 wrl(pep, INT_MASK, ALL_INTS); in pxa168_rx_poll()
1275 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_start_xmit() local
1281 tx_index = eth_alloc_tx_desc_index(pep); in pxa168_eth_start_xmit()
1282 desc = &pep->p_tx_desc_area[tx_index]; in pxa168_eth_start_xmit()
1284 pep->tx_skb[tx_index] = skb; in pxa168_eth_start_xmit()
1294 wrl(pep, SDMA_CMD, SDMA_CMD_TXDH | SDMA_CMD_ERD); in pxa168_eth_start_xmit()
1299 if (pep->tx_ring_size - pep->tx_desc_count <= 1) { in pxa168_eth_start_xmit()
1307 static int smi_wait_ready(struct pxa168_eth_private *pep) in smi_wait_ready() argument
1312 for (i = 0; rdl(pep, SMI) & SMI_BUSY; i++) { in smi_wait_ready()
1323 struct pxa168_eth_private *pep = bus->priv; in pxa168_smi_read() local
1327 if (smi_wait_ready(pep)) { in pxa168_smi_read()
1328 netdev_warn(pep->dev, "pxa168_eth: SMI bus busy timeout\n"); in pxa168_smi_read()
1331 wrl(pep, SMI, (phy_addr << 16) | (regnum << 21) | SMI_OP_R); in pxa168_smi_read()
1333 for (i = 0; !((val = rdl(pep, SMI)) & SMI_R_VALID); i++) { in pxa168_smi_read()
1335 netdev_warn(pep->dev, in pxa168_smi_read()
1348 struct pxa168_eth_private *pep = bus->priv; in pxa168_smi_write() local
1350 if (smi_wait_ready(pep)) { in pxa168_smi_write()
1351 netdev_warn(pep->dev, "pxa168_eth: SMI bus busy timeout\n"); in pxa168_smi_write()
1355 wrl(pep, SMI, (phy_addr << 16) | (regnum << 21) | in pxa168_smi_write()
1358 if (smi_wait_ready(pep)) { in pxa168_smi_write()
1359 netdev_err(pep->dev, "pxa168_eth: SMI bus busy timeout\n"); in pxa168_smi_write()
1369 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_do_ioctl() local
1370 if (pep->phy != NULL) in pxa168_eth_do_ioctl()
1371 return phy_mii_ioctl(pep->phy, ifr, cmd); in pxa168_eth_do_ioctl()
1378 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_get_settings() local
1381 err = phy_read_status(pep->phy); in pxa168_get_settings()
1383 err = phy_ethtool_gset(pep->phy, cmd); in pxa168_get_settings()
1390 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_set_settings() local
1392 return phy_ethtool_sset(pep->phy, cmd); in pxa168_set_settings()
1426 struct pxa168_eth_private *pep = NULL; in pxa168_eth_probe() local
1450 pep = netdev_priv(dev); in pxa168_eth_probe()
1451 pep->dev = dev; in pxa168_eth_probe()
1452 pep->clk = clk; in pxa168_eth_probe()
1455 pep->base = devm_ioremap_resource(&pdev->dev, res); in pxa168_eth_probe()
1456 if (IS_ERR(pep->base)) { in pxa168_eth_probe()
1469 INIT_WORK(&pep->tx_timeout_task, pxa168_eth_tx_timeout_task); in pxa168_eth_probe()
1485 pep->rx_ring_size = NUM_RX_DESCS; in pxa168_eth_probe()
1486 pep->tx_ring_size = NUM_TX_DESCS; in pxa168_eth_probe()
1488 pep->pd = dev_get_platdata(&pdev->dev); in pxa168_eth_probe()
1489 if (pep->pd) { in pxa168_eth_probe()
1490 if (pep->pd->rx_queue_size) in pxa168_eth_probe()
1491 pep->rx_ring_size = pep->pd->rx_queue_size; in pxa168_eth_probe()
1493 if (pep->pd->tx_queue_size) in pxa168_eth_probe()
1494 pep->tx_ring_size = pep->pd->tx_queue_size; in pxa168_eth_probe()
1496 pep->port_num = pep->pd->port_number; in pxa168_eth_probe()
1497 pep->phy_addr = pep->pd->phy_addr; in pxa168_eth_probe()
1498 pep->phy_speed = pep->pd->speed; in pxa168_eth_probe()
1499 pep->phy_duplex = pep->pd->duplex; in pxa168_eth_probe()
1500 pep->phy_intf = pep->pd->intf; in pxa168_eth_probe()
1502 if (pep->pd->init) in pxa168_eth_probe()
1503 pep->pd->init(); in pxa168_eth_probe()
1506 &pep->port_num); in pxa168_eth_probe()
1514 of_property_read_u32(np, "reg", &pep->phy_addr); in pxa168_eth_probe()
1515 pep->phy_intf = of_get_phy_mode(pdev->dev.of_node); in pxa168_eth_probe()
1519 BUG_ON(pep->port_num > 2); in pxa168_eth_probe()
1520 netif_napi_add(dev, &pep->napi, pxa168_rx_poll, pep->rx_ring_size); in pxa168_eth_probe()
1522 memset(&pep->timeout, 0, sizeof(struct timer_list)); in pxa168_eth_probe()
1523 init_timer(&pep->timeout); in pxa168_eth_probe()
1524 pep->timeout.function = rxq_refill_timer_wrapper; in pxa168_eth_probe()
1525 pep->timeout.data = (unsigned long)pep; in pxa168_eth_probe()
1527 pep->smi_bus = mdiobus_alloc(); in pxa168_eth_probe()
1528 if (pep->smi_bus == NULL) { in pxa168_eth_probe()
1532 pep->smi_bus->priv = pep; in pxa168_eth_probe()
1533 pep->smi_bus->name = "pxa168_eth smi"; in pxa168_eth_probe()
1534 pep->smi_bus->read = pxa168_smi_read; in pxa168_eth_probe()
1535 pep->smi_bus->write = pxa168_smi_write; in pxa168_eth_probe()
1536 snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%s-%d", in pxa168_eth_probe()
1538 pep->smi_bus->parent = &pdev->dev; in pxa168_eth_probe()
1539 pep->smi_bus->phy_mask = 0xffffffff; in pxa168_eth_probe()
1540 err = mdiobus_register(pep->smi_bus); in pxa168_eth_probe()
1545 pxa168_init_hw(pep); in pxa168_eth_probe()
1552 mdiobus_unregister(pep->smi_bus); in pxa168_eth_probe()
1554 mdiobus_free(pep->smi_bus); in pxa168_eth_probe()
1565 struct pxa168_eth_private *pep = netdev_priv(dev); in pxa168_eth_remove() local
1567 if (pep->htpr) { in pxa168_eth_remove()
1568 dma_free_coherent(pep->dev->dev.parent, HASH_ADDR_TABLE_SIZE, in pxa168_eth_remove()
1569 pep->htpr, pep->htpr_dma); in pxa168_eth_remove()
1570 pep->htpr = NULL; in pxa168_eth_remove()
1572 if (pep->phy) in pxa168_eth_remove()
1573 phy_disconnect(pep->phy); in pxa168_eth_remove()
1574 if (pep->clk) { in pxa168_eth_remove()
1575 clk_disable_unprepare(pep->clk); in pxa168_eth_remove()
1578 mdiobus_unregister(pep->smi_bus); in pxa168_eth_remove()
1579 mdiobus_free(pep->smi_bus); in pxa168_eth_remove()
1581 cancel_work_sync(&pep->tx_timeout_task); in pxa168_eth_remove()