Lines Matching refs:ugeth

224 static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth,  in get_new_skb()  argument
229 skb = netdev_alloc_skb(ugeth->ndev, in get_new_skb()
230 ugeth->ug_info->uf_info.max_rx_buf_length + in get_new_skb()
244 dma_map_single(ugeth->dev, in get_new_skb()
246 ugeth->ug_info->uf_info.max_rx_buf_length + in get_new_skb()
256 static int rx_bd_buffer_set(struct ucc_geth_private *ugeth, u8 rxQ) in rx_bd_buffer_set() argument
263 bd = ugeth->p_rx_bd_ring[rxQ]; in rx_bd_buffer_set()
268 skb = get_new_skb(ugeth, bd); in rx_bd_buffer_set()
274 ugeth->rx_skbuff[rxQ][i] = skb; in rx_bd_buffer_set()
284 static int fill_init_enet_entries(struct ucc_geth_private *ugeth, in fill_init_enet_entries() argument
298 if (netif_msg_ifup(ugeth)) in fill_init_enet_entries()
309 if (netif_msg_ifup(ugeth)) in fill_init_enet_entries()
323 static int return_init_enet_entries(struct ucc_geth_private *ugeth, in return_init_enet_entries() argument
357 static int dump_init_enet_entries(struct ucc_geth_private *ugeth, in dump_init_enet_entries() argument
409 static int hw_clear_addr_in_paddr(struct ucc_geth_private *ugeth, u8 paddr_num) in hw_clear_addr_in_paddr() argument
419 (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth->p_rx_glbl_pram-> in hw_clear_addr_in_paddr()
431 static void hw_add_addr_in_hash(struct ucc_geth_private *ugeth, in hw_add_addr_in_hash() argument
438 (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth->p_rx_glbl_pram-> in hw_add_addr_in_hash()
442 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num); in hw_add_addr_in_hash()
455 static void get_statistics(struct ucc_geth_private *ugeth, in get_statistics() argument
467 ug_regs = ugeth->ug_regs; in get_statistics()
469 p_tx_fw_statistics_pram = ugeth->p_tx_fw_statistics_pram; in get_statistics()
470 p_rx_fw_statistics_pram = ugeth->p_rx_fw_statistics_pram; in get_statistics()
575 static void dump_bds(struct ucc_geth_private *ugeth) in dump_bds() argument
580 for (i = 0; i < ucc_geth_tx_queues(ugeth->ug_info); i++) { in dump_bds()
581 if (ugeth->p_tx_bd_ring[i]) { in dump_bds()
583 (ugeth->ug_info->bdRingLenTx[i] * in dump_bds()
586 mem_disp(ugeth->p_tx_bd_ring[i], length); in dump_bds()
589 for (i = 0; i < ucc_geth_rx_queues(ugeth->ug_info); i++) { in dump_bds()
590 if (ugeth->p_rx_bd_ring[i]) { in dump_bds()
592 (ugeth->ug_info->bdRingLenRx[i] * in dump_bds()
595 mem_disp(ugeth->p_rx_bd_ring[i], length); in dump_bds()
600 static void dump_regs(struct ucc_geth_private *ugeth) in dump_regs() argument
604 pr_info("UCC%d Geth registers:\n", ugeth->ug_info->uf_info.ucc_num + 1); in dump_regs()
605 pr_info("Base address: 0x%08x\n", (u32)ugeth->ug_regs); in dump_regs()
608 (u32)&ugeth->ug_regs->maccfg1, in dump_regs()
609 in_be32(&ugeth->ug_regs->maccfg1)); in dump_regs()
611 (u32)&ugeth->ug_regs->maccfg2, in dump_regs()
612 in_be32(&ugeth->ug_regs->maccfg2)); in dump_regs()
614 (u32)&ugeth->ug_regs->ipgifg, in dump_regs()
615 in_be32(&ugeth->ug_regs->ipgifg)); in dump_regs()
617 (u32)&ugeth->ug_regs->hafdup, in dump_regs()
618 in_be32(&ugeth->ug_regs->hafdup)); in dump_regs()
620 (u32)&ugeth->ug_regs->ifctl, in dump_regs()
621 in_be32(&ugeth->ug_regs->ifctl)); in dump_regs()
623 (u32)&ugeth->ug_regs->ifstat, in dump_regs()
624 in_be32(&ugeth->ug_regs->ifstat)); in dump_regs()
626 (u32)&ugeth->ug_regs->macstnaddr1, in dump_regs()
627 in_be32(&ugeth->ug_regs->macstnaddr1)); in dump_regs()
629 (u32)&ugeth->ug_regs->macstnaddr2, in dump_regs()
630 in_be32(&ugeth->ug_regs->macstnaddr2)); in dump_regs()
632 (u32)&ugeth->ug_regs->uempr, in dump_regs()
633 in_be32(&ugeth->ug_regs->uempr)); in dump_regs()
635 (u32)&ugeth->ug_regs->utbipar, in dump_regs()
636 in_be32(&ugeth->ug_regs->utbipar)); in dump_regs()
638 (u32)&ugeth->ug_regs->uescr, in dump_regs()
639 in_be16(&ugeth->ug_regs->uescr)); in dump_regs()
641 (u32)&ugeth->ug_regs->tx64, in dump_regs()
642 in_be32(&ugeth->ug_regs->tx64)); in dump_regs()
644 (u32)&ugeth->ug_regs->tx127, in dump_regs()
645 in_be32(&ugeth->ug_regs->tx127)); in dump_regs()
647 (u32)&ugeth->ug_regs->tx255, in dump_regs()
648 in_be32(&ugeth->ug_regs->tx255)); in dump_regs()
650 (u32)&ugeth->ug_regs->rx64, in dump_regs()
651 in_be32(&ugeth->ug_regs->rx64)); in dump_regs()
653 (u32)&ugeth->ug_regs->rx127, in dump_regs()
654 in_be32(&ugeth->ug_regs->rx127)); in dump_regs()
656 (u32)&ugeth->ug_regs->rx255, in dump_regs()
657 in_be32(&ugeth->ug_regs->rx255)); in dump_regs()
659 (u32)&ugeth->ug_regs->txok, in dump_regs()
660 in_be32(&ugeth->ug_regs->txok)); in dump_regs()
662 (u32)&ugeth->ug_regs->txcf, in dump_regs()
663 in_be16(&ugeth->ug_regs->txcf)); in dump_regs()
665 (u32)&ugeth->ug_regs->tmca, in dump_regs()
666 in_be32(&ugeth->ug_regs->tmca)); in dump_regs()
668 (u32)&ugeth->ug_regs->tbca, in dump_regs()
669 in_be32(&ugeth->ug_regs->tbca)); in dump_regs()
671 (u32)&ugeth->ug_regs->rxfok, in dump_regs()
672 in_be32(&ugeth->ug_regs->rxfok)); in dump_regs()
674 (u32)&ugeth->ug_regs->rxbok, in dump_regs()
675 in_be32(&ugeth->ug_regs->rxbok)); in dump_regs()
677 (u32)&ugeth->ug_regs->rbyt, in dump_regs()
678 in_be32(&ugeth->ug_regs->rbyt)); in dump_regs()
680 (u32)&ugeth->ug_regs->rmca, in dump_regs()
681 in_be32(&ugeth->ug_regs->rmca)); in dump_regs()
683 (u32)&ugeth->ug_regs->rbca, in dump_regs()
684 in_be32(&ugeth->ug_regs->rbca)); in dump_regs()
686 (u32)&ugeth->ug_regs->scar, in dump_regs()
687 in_be32(&ugeth->ug_regs->scar)); in dump_regs()
689 (u32)&ugeth->ug_regs->scam, in dump_regs()
690 in_be32(&ugeth->ug_regs->scam)); in dump_regs()
692 if (ugeth->p_thread_data_tx) { in dump_regs()
693 int count = ucc_geth_thread_count(ugeth->ug_info->numThreadsTx); in dump_regs()
697 (u32)ugeth->p_thread_data_tx); in dump_regs()
701 (u32)&ugeth->p_thread_data_tx[i]); in dump_regs()
702 mem_disp((u8 *) & ugeth->p_thread_data_tx[i], in dump_regs()
706 if (ugeth->p_thread_data_rx) { in dump_regs()
707 int count = ucc_geth_thread_count(ugeth->ug_info->numThreadsRx); in dump_regs()
711 (u32)ugeth->p_thread_data_rx); in dump_regs()
715 (u32)&ugeth->p_thread_data_rx[i]); in dump_regs()
716 mem_disp((u8 *) & ugeth->p_thread_data_rx[i], in dump_regs()
720 if (ugeth->p_exf_glbl_param) { in dump_regs()
723 (u32)ugeth->p_exf_glbl_param); in dump_regs()
724 mem_disp((u8 *) ugeth->p_exf_glbl_param, in dump_regs()
725 sizeof(*ugeth->p_exf_glbl_param)); in dump_regs()
727 if (ugeth->p_tx_glbl_pram) { in dump_regs()
729 pr_info("Base address: 0x%08x\n", (u32)ugeth->p_tx_glbl_pram); in dump_regs()
731 (u32)&ugeth->p_tx_glbl_pram->temoder, in dump_regs()
732 in_be16(&ugeth->p_tx_glbl_pram->temoder)); in dump_regs()
734 (u32)&ugeth->p_tx_glbl_pram->sqptr, in dump_regs()
735 in_be32(&ugeth->p_tx_glbl_pram->sqptr)); in dump_regs()
737 (u32)&ugeth->p_tx_glbl_pram->schedulerbasepointer, in dump_regs()
738 in_be32(&ugeth->p_tx_glbl_pram->schedulerbasepointer)); in dump_regs()
740 (u32)&ugeth->p_tx_glbl_pram->txrmonbaseptr, in dump_regs()
741 in_be32(&ugeth->p_tx_glbl_pram->txrmonbaseptr)); in dump_regs()
743 (u32)&ugeth->p_tx_glbl_pram->tstate, in dump_regs()
744 in_be32(&ugeth->p_tx_glbl_pram->tstate)); in dump_regs()
746 (u32)&ugeth->p_tx_glbl_pram->iphoffset[0], in dump_regs()
747 ugeth->p_tx_glbl_pram->iphoffset[0]); in dump_regs()
749 (u32)&ugeth->p_tx_glbl_pram->iphoffset[1], in dump_regs()
750 ugeth->p_tx_glbl_pram->iphoffset[1]); in dump_regs()
752 (u32)&ugeth->p_tx_glbl_pram->iphoffset[2], in dump_regs()
753 ugeth->p_tx_glbl_pram->iphoffset[2]); in dump_regs()
755 (u32)&ugeth->p_tx_glbl_pram->iphoffset[3], in dump_regs()
756 ugeth->p_tx_glbl_pram->iphoffset[3]); in dump_regs()
758 (u32)&ugeth->p_tx_glbl_pram->iphoffset[4], in dump_regs()
759 ugeth->p_tx_glbl_pram->iphoffset[4]); in dump_regs()
761 (u32)&ugeth->p_tx_glbl_pram->iphoffset[5], in dump_regs()
762 ugeth->p_tx_glbl_pram->iphoffset[5]); in dump_regs()
764 (u32)&ugeth->p_tx_glbl_pram->iphoffset[6], in dump_regs()
765 ugeth->p_tx_glbl_pram->iphoffset[6]); in dump_regs()
767 (u32)&ugeth->p_tx_glbl_pram->iphoffset[7], in dump_regs()
768 ugeth->p_tx_glbl_pram->iphoffset[7]); in dump_regs()
770 (u32)&ugeth->p_tx_glbl_pram->vtagtable[0], in dump_regs()
771 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[0])); in dump_regs()
773 (u32)&ugeth->p_tx_glbl_pram->vtagtable[1], in dump_regs()
774 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[1])); in dump_regs()
776 (u32)&ugeth->p_tx_glbl_pram->vtagtable[2], in dump_regs()
777 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[2])); in dump_regs()
779 (u32)&ugeth->p_tx_glbl_pram->vtagtable[3], in dump_regs()
780 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[3])); in dump_regs()
782 (u32)&ugeth->p_tx_glbl_pram->vtagtable[4], in dump_regs()
783 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[4])); in dump_regs()
785 (u32)&ugeth->p_tx_glbl_pram->vtagtable[5], in dump_regs()
786 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[5])); in dump_regs()
788 (u32)&ugeth->p_tx_glbl_pram->vtagtable[6], in dump_regs()
789 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[6])); in dump_regs()
791 (u32)&ugeth->p_tx_glbl_pram->vtagtable[7], in dump_regs()
792 in_be32(&ugeth->p_tx_glbl_pram->vtagtable[7])); in dump_regs()
794 (u32)&ugeth->p_tx_glbl_pram->tqptr, in dump_regs()
795 in_be32(&ugeth->p_tx_glbl_pram->tqptr)); in dump_regs()
797 if (ugeth->p_rx_glbl_pram) { in dump_regs()
799 pr_info("Base address: 0x%08x\n", (u32)ugeth->p_rx_glbl_pram); in dump_regs()
801 (u32)&ugeth->p_rx_glbl_pram->remoder, in dump_regs()
802 in_be32(&ugeth->p_rx_glbl_pram->remoder)); in dump_regs()
804 (u32)&ugeth->p_rx_glbl_pram->rqptr, in dump_regs()
805 in_be32(&ugeth->p_rx_glbl_pram->rqptr)); in dump_regs()
807 (u32)&ugeth->p_rx_glbl_pram->typeorlen, in dump_regs()
808 in_be16(&ugeth->p_rx_glbl_pram->typeorlen)); in dump_regs()
810 (u32)&ugeth->p_rx_glbl_pram->rxgstpack, in dump_regs()
811 ugeth->p_rx_glbl_pram->rxgstpack); in dump_regs()
813 (u32)&ugeth->p_rx_glbl_pram->rxrmonbaseptr, in dump_regs()
814 in_be32(&ugeth->p_rx_glbl_pram->rxrmonbaseptr)); in dump_regs()
816 (u32)&ugeth->p_rx_glbl_pram->intcoalescingptr, in dump_regs()
817 in_be32(&ugeth->p_rx_glbl_pram->intcoalescingptr)); in dump_regs()
819 (u32)&ugeth->p_rx_glbl_pram->rstate, in dump_regs()
820 ugeth->p_rx_glbl_pram->rstate); in dump_regs()
822 (u32)&ugeth->p_rx_glbl_pram->mrblr, in dump_regs()
823 in_be16(&ugeth->p_rx_glbl_pram->mrblr)); in dump_regs()
825 (u32)&ugeth->p_rx_glbl_pram->rbdqptr, in dump_regs()
826 in_be32(&ugeth->p_rx_glbl_pram->rbdqptr)); in dump_regs()
828 (u32)&ugeth->p_rx_glbl_pram->mflr, in dump_regs()
829 in_be16(&ugeth->p_rx_glbl_pram->mflr)); in dump_regs()
831 (u32)&ugeth->p_rx_glbl_pram->minflr, in dump_regs()
832 in_be16(&ugeth->p_rx_glbl_pram->minflr)); in dump_regs()
834 (u32)&ugeth->p_rx_glbl_pram->maxd1, in dump_regs()
835 in_be16(&ugeth->p_rx_glbl_pram->maxd1)); in dump_regs()
837 (u32)&ugeth->p_rx_glbl_pram->maxd2, in dump_regs()
838 in_be16(&ugeth->p_rx_glbl_pram->maxd2)); in dump_regs()
840 (u32)&ugeth->p_rx_glbl_pram->ecamptr, in dump_regs()
841 in_be32(&ugeth->p_rx_glbl_pram->ecamptr)); in dump_regs()
843 (u32)&ugeth->p_rx_glbl_pram->l2qt, in dump_regs()
844 in_be32(&ugeth->p_rx_glbl_pram->l2qt)); in dump_regs()
846 (u32)&ugeth->p_rx_glbl_pram->l3qt[0], in dump_regs()
847 in_be32(&ugeth->p_rx_glbl_pram->l3qt[0])); in dump_regs()
849 (u32)&ugeth->p_rx_glbl_pram->l3qt[1], in dump_regs()
850 in_be32(&ugeth->p_rx_glbl_pram->l3qt[1])); in dump_regs()
852 (u32)&ugeth->p_rx_glbl_pram->l3qt[2], in dump_regs()
853 in_be32(&ugeth->p_rx_glbl_pram->l3qt[2])); in dump_regs()
855 (u32)&ugeth->p_rx_glbl_pram->l3qt[3], in dump_regs()
856 in_be32(&ugeth->p_rx_glbl_pram->l3qt[3])); in dump_regs()
858 (u32)&ugeth->p_rx_glbl_pram->l3qt[4], in dump_regs()
859 in_be32(&ugeth->p_rx_glbl_pram->l3qt[4])); in dump_regs()
861 (u32)&ugeth->p_rx_glbl_pram->l3qt[5], in dump_regs()
862 in_be32(&ugeth->p_rx_glbl_pram->l3qt[5])); in dump_regs()
864 (u32)&ugeth->p_rx_glbl_pram->l3qt[6], in dump_regs()
865 in_be32(&ugeth->p_rx_glbl_pram->l3qt[6])); in dump_regs()
867 (u32)&ugeth->p_rx_glbl_pram->l3qt[7], in dump_regs()
868 in_be32(&ugeth->p_rx_glbl_pram->l3qt[7])); in dump_regs()
870 (u32)&ugeth->p_rx_glbl_pram->vlantype, in dump_regs()
871 in_be16(&ugeth->p_rx_glbl_pram->vlantype)); in dump_regs()
873 (u32)&ugeth->p_rx_glbl_pram->vlantci, in dump_regs()
874 in_be16(&ugeth->p_rx_glbl_pram->vlantci)); in dump_regs()
878 (u32)&ugeth->p_rx_glbl_pram->addressfiltering[i], in dump_regs()
879 ugeth->p_rx_glbl_pram->addressfiltering[i]); in dump_regs()
881 (u32)&ugeth->p_rx_glbl_pram->exfGlobalParam, in dump_regs()
882 in_be32(&ugeth->p_rx_glbl_pram->exfGlobalParam)); in dump_regs()
884 if (ugeth->p_send_q_mem_reg) { in dump_regs()
886 pr_info("Base address: 0x%08x\n", (u32)ugeth->p_send_q_mem_reg); in dump_regs()
887 for (i = 0; i < ucc_geth_tx_queues(ugeth->ug_info); i++) { in dump_regs()
890 (u32)&ugeth->p_send_q_mem_reg->sqqd[i]); in dump_regs()
891 mem_disp((u8 *) & ugeth->p_send_q_mem_reg->sqqd[i], in dump_regs()
895 if (ugeth->p_scheduler) { in dump_regs()
897 pr_info("Base address: 0x%08x\n", (u32)ugeth->p_scheduler); in dump_regs()
898 mem_disp((u8 *) ugeth->p_scheduler, in dump_regs()
899 sizeof(*ugeth->p_scheduler)); in dump_regs()
901 if (ugeth->p_tx_fw_statistics_pram) { in dump_regs()
904 (u32)ugeth->p_tx_fw_statistics_pram); in dump_regs()
905 mem_disp((u8 *) ugeth->p_tx_fw_statistics_pram, in dump_regs()
906 sizeof(*ugeth->p_tx_fw_statistics_pram)); in dump_regs()
908 if (ugeth->p_rx_fw_statistics_pram) { in dump_regs()
911 (u32)ugeth->p_rx_fw_statistics_pram); in dump_regs()
912 mem_disp((u8 *) ugeth->p_rx_fw_statistics_pram, in dump_regs()
913 sizeof(*ugeth->p_rx_fw_statistics_pram)); in dump_regs()
915 if (ugeth->p_rx_irq_coalescing_tbl) { in dump_regs()
918 (u32)ugeth->p_rx_irq_coalescing_tbl); in dump_regs()
919 for (i = 0; i < ucc_geth_rx_queues(ugeth->ug_info); i++) { in dump_regs()
922 (u32)&ugeth->p_rx_irq_coalescing_tbl-> in dump_regs()
925 (u32)&ugeth->p_rx_irq_coalescing_tbl-> in dump_regs()
927 in_be32(&ugeth->p_rx_irq_coalescing_tbl-> in dump_regs()
931 (u32)&ugeth->p_rx_irq_coalescing_tbl-> in dump_regs()
933 in_be32(&ugeth->p_rx_irq_coalescing_tbl-> in dump_regs()
938 if (ugeth->p_rx_bd_qs_tbl) { in dump_regs()
940 pr_info("Base address: 0x%08x\n", (u32)ugeth->p_rx_bd_qs_tbl); in dump_regs()
941 for (i = 0; i < ucc_geth_rx_queues(ugeth->ug_info); i++) { in dump_regs()
944 (u32)&ugeth->p_rx_bd_qs_tbl[i]); in dump_regs()
946 (u32)&ugeth->p_rx_bd_qs_tbl[i].bdbaseptr, in dump_regs()
947 in_be32(&ugeth->p_rx_bd_qs_tbl[i].bdbaseptr)); in dump_regs()
949 (u32)&ugeth->p_rx_bd_qs_tbl[i].bdptr, in dump_regs()
950 in_be32(&ugeth->p_rx_bd_qs_tbl[i].bdptr)); in dump_regs()
952 (u32)&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr, in dump_regs()
953 in_be32(&ugeth->p_rx_bd_qs_tbl[i]. in dump_regs()
956 (u32)&ugeth->p_rx_bd_qs_tbl[i].externalbdptr, in dump_regs()
957 in_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdptr)); in dump_regs()
961 (&ugeth->p_rx_bd_qs_tbl[i]. in dump_regs()
965 (&ugeth->p_rx_bd_qs_tbl[i]. in dump_regs()
970 if (ugeth->p_init_enet_param_shadow) { in dump_regs()
974 (u32) ugeth->p_init_enet_param_shadow); in dump_regs()
975 mem_disp((u8 *) ugeth->p_init_enet_param_shadow, in dump_regs()
976 sizeof(*ugeth->p_init_enet_param_shadow)); in dump_regs()
979 if (ugeth->ug_info->rxExtendedFiltering) { in dump_regs()
982 if (ugeth->ug_info->largestexternallookupkeysize == in dump_regs()
986 if (ugeth->ug_info->largestexternallookupkeysize == in dump_regs()
992 dump_init_enet_entries(ugeth, in dump_regs()
993 &(ugeth->p_init_enet_param_shadow-> in dump_regs()
997 ugeth->ug_info->riscTx, 0); in dump_regs()
998 dump_init_enet_entries(ugeth, in dump_regs()
999 &(ugeth->p_init_enet_param_shadow-> in dump_regs()
1002 ugeth->ug_info->riscRx, 1); in dump_regs()
1289 static int adjust_enet_interface(struct ucc_geth_private *ugeth) in adjust_enet_interface() argument
1300 ug_info = ugeth->ug_info; in adjust_enet_interface()
1301 ug_regs = ugeth->ug_regs; in adjust_enet_interface()
1302 uf_regs = ugeth->uccf->uf_regs; in adjust_enet_interface()
1307 if ((ugeth->max_speed == SPEED_10) || in adjust_enet_interface()
1308 (ugeth->max_speed == SPEED_100)) in adjust_enet_interface()
1310 else if (ugeth->max_speed == SPEED_1000) in adjust_enet_interface()
1319 if ((ugeth->phy_interface == PHY_INTERFACE_MODE_RMII) || in adjust_enet_interface()
1320 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII) || in adjust_enet_interface()
1321 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || in adjust_enet_interface()
1322 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) || in adjust_enet_interface()
1323 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || in adjust_enet_interface()
1324 (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { in adjust_enet_interface()
1325 if (ugeth->phy_interface != PHY_INTERFACE_MODE_RMII) in adjust_enet_interface()
1327 switch (ugeth->max_speed) { in adjust_enet_interface()
1332 if (ugeth->phy_interface != PHY_INTERFACE_MODE_RTBI) in adjust_enet_interface()
1336 if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || in adjust_enet_interface()
1337 (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { in adjust_enet_interface()
1340 if (ugeth->phy_interface == PHY_INTERFACE_MODE_SGMII) in adjust_enet_interface()
1348 if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || in adjust_enet_interface()
1349 (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { in adjust_enet_interface()
1350 struct ucc_geth_info *ug_info = ugeth->ug_info; in adjust_enet_interface()
1371 if (netif_msg_probe(ugeth)) in adjust_enet_interface()
1379 static int ugeth_graceful_stop_tx(struct ucc_geth_private *ugeth) in ugeth_graceful_stop_tx() argument
1386 uccf = ugeth->uccf; in ugeth_graceful_stop_tx()
1394 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num); in ugeth_graceful_stop_tx()
1409 static int ugeth_graceful_stop_rx(struct ucc_geth_private *ugeth) in ugeth_graceful_stop_rx() argument
1416 uccf = ugeth->uccf; in ugeth_graceful_stop_rx()
1419 temp = in_8(&ugeth->p_rx_glbl_pram->rxgstpack); in ugeth_graceful_stop_rx()
1421 out_8(&ugeth->p_rx_glbl_pram->rxgstpack, temp); in ugeth_graceful_stop_rx()
1428 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info. in ugeth_graceful_stop_rx()
1433 temp = in_8(&ugeth->p_rx_glbl_pram->rxgstpack); in ugeth_graceful_stop_rx()
1441 static int ugeth_restart_tx(struct ucc_geth_private *ugeth) in ugeth_restart_tx() argument
1446 uccf = ugeth->uccf; in ugeth_restart_tx()
1449 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num); in ugeth_restart_tx()
1456 static int ugeth_restart_rx(struct ucc_geth_private *ugeth) in ugeth_restart_rx() argument
1461 uccf = ugeth->uccf; in ugeth_restart_rx()
1464 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num); in ugeth_restart_rx()
1472 static int ugeth_enable(struct ucc_geth_private *ugeth, enum comm_dir mode) in ugeth_enable() argument
1477 uccf = ugeth->uccf; in ugeth_enable()
1480 if (ugeth->ug_info->uf_info.ucc_num >= UCC_MAX_NUM) { in ugeth_enable()
1481 if (netif_msg_probe(ugeth)) in ugeth_enable()
1492 ugeth_restart_tx(ugeth); in ugeth_enable()
1494 ugeth_restart_rx(ugeth); in ugeth_enable()
1502 static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode) in ugeth_disable() argument
1506 uccf = ugeth->uccf; in ugeth_disable()
1509 if (ugeth->ug_info->uf_info.ucc_num >= UCC_MAX_NUM) { in ugeth_disable()
1510 if (netif_msg_probe(ugeth)) in ugeth_disable()
1517 ugeth_graceful_stop_tx(ugeth); in ugeth_disable()
1521 ugeth_graceful_stop_rx(ugeth); in ugeth_disable()
1523 ucc_fast_disable(ugeth->uccf, mode); /* OK to do even if not enabled */ in ugeth_disable()
1528 static void ugeth_quiesce(struct ucc_geth_private *ugeth) in ugeth_quiesce() argument
1531 netif_tx_stop_all_queues(ugeth->ndev); in ugeth_quiesce()
1534 disable_irq(ugeth->ug_info->uf_info.irq); in ugeth_quiesce()
1537 napi_disable(&ugeth->napi); in ugeth_quiesce()
1540 static void ugeth_activate(struct ucc_geth_private *ugeth) in ugeth_activate() argument
1542 napi_enable(&ugeth->napi); in ugeth_activate()
1543 enable_irq(ugeth->ug_info->uf_info.irq); in ugeth_activate()
1546 netif_tx_wake_all_queues(ugeth->ndev); in ugeth_activate()
1547 __netdev_watchdog_up(ugeth->ndev); in ugeth_activate()
1559 struct ucc_geth_private *ugeth = netdev_priv(dev); in adjust_link() local
1562 struct phy_device *phydev = ugeth->phydev; in adjust_link()
1565 ug_regs = ugeth->ug_regs; in adjust_link()
1566 uf_regs = ugeth->uccf->uf_regs; in adjust_link()
1573 if (phydev->duplex != ugeth->oldduplex) { in adjust_link()
1579 ugeth->oldduplex = phydev->duplex; in adjust_link()
1582 if (phydev->speed != ugeth->oldspeed) { in adjust_link()
1596 if ((ugeth->phy_interface == PHY_INTERFACE_MODE_RMII) || in adjust_link()
1597 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII) || in adjust_link()
1598 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || in adjust_link()
1599 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) || in adjust_link()
1600 (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || in adjust_link()
1601 (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { in adjust_link()
1609 if (netif_msg_link(ugeth)) in adjust_link()
1615 ugeth->oldspeed = phydev->speed; in adjust_link()
1618 if (!ugeth->oldlink) { in adjust_link()
1620 ugeth->oldlink = 1; in adjust_link()
1631 ugeth_quiesce(ugeth); in adjust_link()
1632 ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); in adjust_link()
1637 ugeth_enable(ugeth, COMM_DIR_RX_AND_TX); in adjust_link()
1638 ugeth_activate(ugeth); in adjust_link()
1640 } else if (ugeth->oldlink) { in adjust_link()
1642 ugeth->oldlink = 0; in adjust_link()
1643 ugeth->oldspeed = 0; in adjust_link()
1644 ugeth->oldduplex = -1; in adjust_link()
1647 if (new_state && netif_msg_link(ugeth)) in adjust_link()
1661 struct ucc_geth_private *ugeth = netdev_priv(dev); in uec_configure_serdes() local
1662 struct ucc_geth_info *ug_info = ugeth->ug_info; in uec_configure_serdes()
1728 static void ugeth_dump_regs(struct ucc_geth_private *ugeth) in ugeth_dump_regs() argument
1731 ucc_fast_dump_regs(ugeth->uccf); in ugeth_dump_regs()
1732 dump_regs(ugeth); in ugeth_dump_regs()
1733 dump_bds(ugeth); in ugeth_dump_regs()
1738 ugeth, in ugeth_82xx_filtering_clear_all_addr_in_hash()
1751 uccf = ugeth->uccf; in ugeth_82xx_filtering_clear_all_addr_in_hash()
1755 ugeth->p_rx_glbl_pram->addressfiltering; in ugeth_82xx_filtering_clear_all_addr_in_hash()
1760 p_lh = &ugeth->group_hash_q; in ugeth_82xx_filtering_clear_all_addr_in_hash()
1761 p_counter = &(ugeth->numGroupAddrInHash); in ugeth_82xx_filtering_clear_all_addr_in_hash()
1765 p_lh = &ugeth->ind_hash_q; in ugeth_82xx_filtering_clear_all_addr_in_hash()
1766 p_counter = &(ugeth->numIndAddrInHash); in ugeth_82xx_filtering_clear_all_addr_in_hash()
1776 ugeth_disable(ugeth, comm_dir); in ugeth_82xx_filtering_clear_all_addr_in_hash()
1794 ugeth_enable(ugeth, comm_dir); in ugeth_82xx_filtering_clear_all_addr_in_hash()
1799 static int ugeth_82xx_filtering_clear_addr_in_paddr(struct ucc_geth_private *ugeth, in ugeth_82xx_filtering_clear_addr_in_paddr() argument
1802 ugeth->indAddrRegUsed[paddr_num] = 0; /* mark this paddr as not used */ in ugeth_82xx_filtering_clear_addr_in_paddr()
1803 return hw_clear_addr_in_paddr(ugeth, paddr_num);/* clear in hardware */ in ugeth_82xx_filtering_clear_addr_in_paddr()
1806 static void ucc_geth_free_rx(struct ucc_geth_private *ugeth) in ucc_geth_free_rx() argument
1814 ug_info = ugeth->ug_info; in ucc_geth_free_rx()
1817 for (i = 0; i < ucc_geth_rx_queues(ugeth->ug_info); i++) { in ucc_geth_free_rx()
1818 if (ugeth->p_rx_bd_ring[i]) { in ucc_geth_free_rx()
1820 bd = ugeth->p_rx_bd_ring[i]; in ucc_geth_free_rx()
1821 for (j = 0; j < ugeth->ug_info->bdRingLenRx[i]; j++) { in ucc_geth_free_rx()
1822 if (ugeth->rx_skbuff[i][j]) { in ucc_geth_free_rx()
1823 dma_unmap_single(ugeth->dev, in ucc_geth_free_rx()
1825 ugeth->ug_info-> in ucc_geth_free_rx()
1830 ugeth->rx_skbuff[i][j]); in ucc_geth_free_rx()
1831 ugeth->rx_skbuff[i][j] = NULL; in ucc_geth_free_rx()
1836 kfree(ugeth->rx_skbuff[i]); in ucc_geth_free_rx()
1838 kfree(ugeth->p_rx_bd_ring[i]); in ucc_geth_free_rx()
1839 ugeth->p_rx_bd_ring[i] = NULL; in ucc_geth_free_rx()
1845 static void ucc_geth_free_tx(struct ucc_geth_private *ugeth) in ucc_geth_free_tx() argument
1852 netdev_reset_queue(ugeth->ndev); in ucc_geth_free_tx()
1854 ug_info = ugeth->ug_info; in ucc_geth_free_tx()
1857 for (i = 0; i < ucc_geth_tx_queues(ugeth->ug_info); i++) { in ucc_geth_free_tx()
1858 bd = ugeth->p_tx_bd_ring[i]; in ucc_geth_free_tx()
1861 for (j = 0; j < ugeth->ug_info->bdRingLenTx[i]; j++) { in ucc_geth_free_tx()
1862 if (ugeth->tx_skbuff[i][j]) { in ucc_geth_free_tx()
1863 dma_unmap_single(ugeth->dev, in ucc_geth_free_tx()
1868 dev_kfree_skb_any(ugeth->tx_skbuff[i][j]); in ucc_geth_free_tx()
1869 ugeth->tx_skbuff[i][j] = NULL; in ucc_geth_free_tx()
1873 kfree(ugeth->tx_skbuff[i]); in ucc_geth_free_tx()
1875 kfree(ugeth->p_tx_bd_ring[i]); in ucc_geth_free_tx()
1876 ugeth->p_tx_bd_ring[i] = NULL; in ucc_geth_free_tx()
1881 static void ucc_geth_memclean(struct ucc_geth_private *ugeth) in ucc_geth_memclean() argument
1883 if (!ugeth) in ucc_geth_memclean()
1886 if (ugeth->uccf) { in ucc_geth_memclean()
1887 ucc_fast_free(ugeth->uccf); in ucc_geth_memclean()
1888 ugeth->uccf = NULL; in ucc_geth_memclean()
1891 qe_muram_free_addr(ugeth->p_thread_data_tx); in ucc_geth_memclean()
1892 ugeth->p_thread_data_tx = NULL; in ucc_geth_memclean()
1894 qe_muram_free_addr(ugeth->p_thread_data_rx); in ucc_geth_memclean()
1895 ugeth->p_thread_data_rx = NULL; in ucc_geth_memclean()
1897 qe_muram_free_addr(ugeth->p_exf_glbl_param); in ucc_geth_memclean()
1898 ugeth->p_exf_glbl_param = NULL; in ucc_geth_memclean()
1900 qe_muram_free_addr(ugeth->p_rx_glbl_pram); in ucc_geth_memclean()
1901 ugeth->p_rx_glbl_pram = NULL; in ucc_geth_memclean()
1903 qe_muram_free_addr(ugeth->p_tx_glbl_pram); in ucc_geth_memclean()
1904 ugeth->p_tx_glbl_pram = NULL; in ucc_geth_memclean()
1906 qe_muram_free_addr(ugeth->p_send_q_mem_reg); in ucc_geth_memclean()
1907 ugeth->p_send_q_mem_reg = NULL; in ucc_geth_memclean()
1909 qe_muram_free_addr(ugeth->p_scheduler); in ucc_geth_memclean()
1910 ugeth->p_scheduler = NULL; in ucc_geth_memclean()
1912 qe_muram_free_addr(ugeth->p_tx_fw_statistics_pram); in ucc_geth_memclean()
1913 ugeth->p_tx_fw_statistics_pram = NULL; in ucc_geth_memclean()
1915 qe_muram_free_addr(ugeth->p_rx_fw_statistics_pram); in ucc_geth_memclean()
1916 ugeth->p_rx_fw_statistics_pram = NULL; in ucc_geth_memclean()
1918 qe_muram_free_addr(ugeth->p_rx_irq_coalescing_tbl); in ucc_geth_memclean()
1919 ugeth->p_rx_irq_coalescing_tbl = NULL; in ucc_geth_memclean()
1921 qe_muram_free_addr(ugeth->p_rx_bd_qs_tbl); in ucc_geth_memclean()
1922 ugeth->p_rx_bd_qs_tbl = NULL; in ucc_geth_memclean()
1924 if (ugeth->p_init_enet_param_shadow) { in ucc_geth_memclean()
1925 return_init_enet_entries(ugeth, in ucc_geth_memclean()
1926 &(ugeth->p_init_enet_param_shadow-> in ucc_geth_memclean()
1929 ugeth->ug_info->riscRx, 1); in ucc_geth_memclean()
1930 return_init_enet_entries(ugeth, in ucc_geth_memclean()
1931 &(ugeth->p_init_enet_param_shadow-> in ucc_geth_memclean()
1934 ugeth->ug_info->riscTx, 0); in ucc_geth_memclean()
1935 kfree(ugeth->p_init_enet_param_shadow); in ucc_geth_memclean()
1936 ugeth->p_init_enet_param_shadow = NULL; in ucc_geth_memclean()
1938 ucc_geth_free_tx(ugeth); in ucc_geth_memclean()
1939 ucc_geth_free_rx(ugeth); in ucc_geth_memclean()
1940 while (!list_empty(&ugeth->group_hash_q)) in ucc_geth_memclean()
1942 (dequeue(&ugeth->group_hash_q))); in ucc_geth_memclean()
1943 while (!list_empty(&ugeth->ind_hash_q)) in ucc_geth_memclean()
1945 (dequeue(&ugeth->ind_hash_q))); in ucc_geth_memclean()
1946 if (ugeth->ug_regs) { in ucc_geth_memclean()
1947 iounmap(ugeth->ug_regs); in ucc_geth_memclean()
1948 ugeth->ug_regs = NULL; in ucc_geth_memclean()
1954 struct ucc_geth_private *ugeth; in ucc_geth_set_multi() local
1959 ugeth = netdev_priv(dev); in ucc_geth_set_multi()
1961 uf_regs = ugeth->uccf->uf_regs; in ucc_geth_set_multi()
1969 (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> in ucc_geth_set_multi()
1988 hw_add_addr_in_hash(ugeth, ha->addr); in ucc_geth_set_multi()
1994 static void ucc_geth_stop(struct ucc_geth_private *ugeth) in ucc_geth_stop() argument
1996 struct ucc_geth __iomem *ug_regs = ugeth->ug_regs; in ucc_geth_stop()
1997 struct phy_device *phydev = ugeth->phydev; in ucc_geth_stop()
2009 ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); in ucc_geth_stop()
2012 out_be32(ugeth->uccf->p_uccm, 0x00000000); in ucc_geth_stop()
2015 out_be32(ugeth->uccf->p_ucce, 0xffffffff); in ucc_geth_stop()
2020 ucc_geth_memclean(ugeth); in ucc_geth_stop()
2023 static int ucc_struct_init(struct ucc_geth_private *ugeth) in ucc_struct_init() argument
2029 ug_info = ugeth->ug_info; in ucc_struct_init()
2037 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2046 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2055 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2062 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2069 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2077 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2086 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2093 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2101 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2114 if (ucc_fast_init(uf_info, &ugeth->uccf)) { in ucc_struct_init()
2115 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2128 ugeth->ug_regs = ioremap(uf_info->regs, sizeof(*ugeth->ug_regs)); in ucc_struct_init()
2129 if (!ugeth->ug_regs) { in ucc_struct_init()
2130 if (netif_msg_probe(ugeth)) in ucc_struct_init()
2138 static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) in ucc_geth_alloc_tx() argument
2146 ug_info = ugeth->ug_info; in ucc_geth_alloc_tx()
2159 ugeth->p_tx_bd_ring[j] = kmalloc(alloc, GFP_KERNEL); in ucc_geth_alloc_tx()
2161 if (!ugeth->p_tx_bd_ring[j]) { in ucc_geth_alloc_tx()
2162 if (netif_msg_ifup(ugeth)) in ucc_geth_alloc_tx()
2167 memset(ugeth->p_tx_bd_ring[j] + length, 0, alloc - length); in ucc_geth_alloc_tx()
2173 ugeth->tx_skbuff[j] = in ucc_geth_alloc_tx()
2174 kcalloc(ugeth->ug_info->bdRingLenTx[j], in ucc_geth_alloc_tx()
2177 if (ugeth->tx_skbuff[j] == NULL) { in ucc_geth_alloc_tx()
2178 if (netif_msg_ifup(ugeth)) in ucc_geth_alloc_tx()
2183 ugeth->skb_curtx[j] = ugeth->skb_dirtytx[j] = 0; in ucc_geth_alloc_tx()
2184 bd = ugeth->confBd[j] = ugeth->txBd[j] = ugeth->p_tx_bd_ring[j]; in ucc_geth_alloc_tx()
2200 static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) in ucc_geth_alloc_rx() argument
2208 ug_info = ugeth->ug_info; in ucc_geth_alloc_rx()
2220 ugeth->p_rx_bd_ring[j] = kmalloc(alloc, GFP_KERNEL); in ucc_geth_alloc_rx()
2221 if (!ugeth->p_rx_bd_ring[j]) { in ucc_geth_alloc_rx()
2222 if (netif_msg_ifup(ugeth)) in ucc_geth_alloc_rx()
2231 ugeth->rx_skbuff[j] = in ucc_geth_alloc_rx()
2232 kcalloc(ugeth->ug_info->bdRingLenRx[j], in ucc_geth_alloc_rx()
2235 if (ugeth->rx_skbuff[j] == NULL) { in ucc_geth_alloc_rx()
2236 if (netif_msg_ifup(ugeth)) in ucc_geth_alloc_rx()
2241 ugeth->skb_currx[j] = 0; in ucc_geth_alloc_rx()
2242 bd = ugeth->rxBd[j] = ugeth->p_rx_bd_ring[j]; in ucc_geth_alloc_rx()
2258 static int ucc_geth_startup(struct ucc_geth_private *ugeth) in ucc_geth_startup() argument
2278 uccf = ugeth->uccf; in ucc_geth_startup()
2279 ug_info = ugeth->ug_info; in ucc_geth_startup()
2282 ug_regs = ugeth->ug_regs; in ucc_geth_startup()
2286 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2293 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2299 ugeth->rx_non_dynamic_extended_features = ug_info->ipCheckSumCheck || in ucc_geth_startup()
2304 ugeth->rx_extended_features = ugeth->rx_non_dynamic_extended_features || in ucc_geth_startup()
2341 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2357 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2377 ret_val = ucc_geth_alloc_tx(ugeth); in ucc_geth_startup()
2381 ret_val = ucc_geth_alloc_rx(ugeth); in ucc_geth_startup()
2394 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2398 ugeth->p_tx_glbl_pram = qe_muram_addr(tx_glbl_pram_offset); in ucc_geth_startup()
2403 ugeth->thread_dat_tx_offset = in ucc_geth_startup()
2408 if (IS_ERR_VALUE(ugeth->thread_dat_tx_offset)) { in ucc_geth_startup()
2409 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2414 ugeth->p_thread_data_tx = in ucc_geth_startup()
2415 (struct ucc_geth_thread_data_tx __iomem *) qe_muram_addr(ugeth-> in ucc_geth_startup()
2417 out_be32(&ugeth->p_tx_glbl_pram->tqptr, ugeth->thread_dat_tx_offset); in ucc_geth_startup()
2421 out_be32(&ugeth->p_tx_glbl_pram->vtagtable[i], in ucc_geth_startup()
2426 out_8(&ugeth->p_tx_glbl_pram->iphoffset[i], in ucc_geth_startup()
2431 ugeth->send_q_mem_reg_offset = in ucc_geth_startup()
2435 if (IS_ERR_VALUE(ugeth->send_q_mem_reg_offset)) { in ucc_geth_startup()
2436 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2441 ugeth->p_send_q_mem_reg = in ucc_geth_startup()
2442 (struct ucc_geth_send_queue_mem_region __iomem *) qe_muram_addr(ugeth-> in ucc_geth_startup()
2444 out_be32(&ugeth->p_tx_glbl_pram->sqptr, ugeth->send_q_mem_reg_offset); in ucc_geth_startup()
2450 ugeth->p_tx_bd_ring[i] + (ug_info->bdRingLenTx[i] - in ucc_geth_startup()
2452 out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, in ucc_geth_startup()
2453 (u32) virt_to_phys(ugeth->p_tx_bd_ring[i])); in ucc_geth_startup()
2454 out_be32(&ugeth->p_send_q_mem_reg->sqqd[i]. in ucc_geth_startup()
2463 ugeth->scheduler_offset = in ucc_geth_startup()
2466 if (IS_ERR_VALUE(ugeth->scheduler_offset)) { in ucc_geth_startup()
2467 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2472 ugeth->p_scheduler = in ucc_geth_startup()
2473 (struct ucc_geth_scheduler __iomem *) qe_muram_addr(ugeth-> in ucc_geth_startup()
2475 out_be32(&ugeth->p_tx_glbl_pram->schedulerbasepointer, in ucc_geth_startup()
2476 ugeth->scheduler_offset); in ucc_geth_startup()
2479 out_be32(&ugeth->p_scheduler->mblinterval, in ucc_geth_startup()
2481 out_be16(&ugeth->p_scheduler->nortsrbytetime, in ucc_geth_startup()
2483 out_8(&ugeth->p_scheduler->fracsiz, ug_info->fracsiz); in ucc_geth_startup()
2484 out_8(&ugeth->p_scheduler->strictpriorityq, in ucc_geth_startup()
2486 out_8(&ugeth->p_scheduler->txasap, ug_info->txasap); in ucc_geth_startup()
2487 out_8(&ugeth->p_scheduler->extrabw, ug_info->extrabw); in ucc_geth_startup()
2489 out_8(&ugeth->p_scheduler->weightfactor[i], in ucc_geth_startup()
2493 ugeth->p_cpucount[0] = &(ugeth->p_scheduler->cpucount0); in ucc_geth_startup()
2494 ugeth->p_cpucount[1] = &(ugeth->p_scheduler->cpucount1); in ucc_geth_startup()
2495 ugeth->p_cpucount[2] = &(ugeth->p_scheduler->cpucount2); in ucc_geth_startup()
2496 ugeth->p_cpucount[3] = &(ugeth->p_scheduler->cpucount3); in ucc_geth_startup()
2497 ugeth->p_cpucount[4] = &(ugeth->p_scheduler->cpucount4); in ucc_geth_startup()
2498 ugeth->p_cpucount[5] = &(ugeth->p_scheduler->cpucount5); in ucc_geth_startup()
2499 ugeth->p_cpucount[6] = &(ugeth->p_scheduler->cpucount6); in ucc_geth_startup()
2500 ugeth->p_cpucount[7] = &(ugeth->p_scheduler->cpucount7); in ucc_geth_startup()
2507 ugeth->tx_fw_statistics_pram_offset = in ucc_geth_startup()
2511 if (IS_ERR_VALUE(ugeth->tx_fw_statistics_pram_offset)) { in ucc_geth_startup()
2512 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2516 ugeth->p_tx_fw_statistics_pram = in ucc_geth_startup()
2518 qe_muram_addr(ugeth->tx_fw_statistics_pram_offset); in ucc_geth_startup()
2529 out_be16(&ugeth->p_tx_glbl_pram->temoder, temoder); in ucc_geth_startup()
2536 out_be32(&ugeth->p_tx_glbl_pram->tstate, ((u32) function_code) << 24); in ucc_geth_startup()
2544 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2548 ugeth->p_rx_glbl_pram = qe_muram_addr(rx_glbl_pram_offset); in ucc_geth_startup()
2553 ugeth->thread_dat_rx_offset = in ucc_geth_startup()
2557 if (IS_ERR_VALUE(ugeth->thread_dat_rx_offset)) { in ucc_geth_startup()
2558 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2563 ugeth->p_thread_data_rx = in ucc_geth_startup()
2564 (struct ucc_geth_thread_data_rx __iomem *) qe_muram_addr(ugeth-> in ucc_geth_startup()
2566 out_be32(&ugeth->p_rx_glbl_pram->rqptr, ugeth->thread_dat_rx_offset); in ucc_geth_startup()
2569 out_be16(&ugeth->p_rx_glbl_pram->typeorlen, ug_info->typeorlen); in ucc_geth_startup()
2574 ugeth->rx_fw_statistics_pram_offset = in ucc_geth_startup()
2578 if (IS_ERR_VALUE(ugeth->rx_fw_statistics_pram_offset)) { in ucc_geth_startup()
2579 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2583 ugeth->p_rx_fw_statistics_pram = in ucc_geth_startup()
2585 qe_muram_addr(ugeth->rx_fw_statistics_pram_offset); in ucc_geth_startup()
2591 ugeth->rx_irq_coalescing_tbl_offset = in ucc_geth_startup()
2595 if (IS_ERR_VALUE(ugeth->rx_irq_coalescing_tbl_offset)) { in ucc_geth_startup()
2596 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2601 ugeth->p_rx_irq_coalescing_tbl = in ucc_geth_startup()
2603 qe_muram_addr(ugeth->rx_irq_coalescing_tbl_offset); in ucc_geth_startup()
2604 out_be32(&ugeth->p_rx_glbl_pram->intcoalescingptr, in ucc_geth_startup()
2605 ugeth->rx_irq_coalescing_tbl_offset); in ucc_geth_startup()
2609 out_be32(&ugeth->p_rx_irq_coalescing_tbl->coalescingentry[i]. in ucc_geth_startup()
2612 out_be32(&ugeth->p_rx_irq_coalescing_tbl->coalescingentry[i]. in ucc_geth_startup()
2619 &ugeth->p_rx_glbl_pram->mrblr); in ucc_geth_startup()
2621 out_be16(&ugeth->p_rx_glbl_pram->mflr, ug_info->maxFrameLength); in ucc_geth_startup()
2624 &ugeth->p_rx_glbl_pram->minflr, in ucc_geth_startup()
2625 &ugeth->p_rx_glbl_pram->mrblr); in ucc_geth_startup()
2627 out_be16(&ugeth->p_rx_glbl_pram->maxd1, ug_info->maxD1Length); in ucc_geth_startup()
2629 out_be16(&ugeth->p_rx_glbl_pram->maxd2, ug_info->maxD2Length); in ucc_geth_startup()
2635 out_be32(&ugeth->p_rx_glbl_pram->l2qt, l2qt); in ucc_geth_startup()
2642 out_be32(&ugeth->p_rx_glbl_pram->l3qt[j/8], l3qt); in ucc_geth_startup()
2646 out_be16(&ugeth->p_rx_glbl_pram->vlantype, ug_info->vlantype); in ucc_geth_startup()
2649 out_be16(&ugeth->p_rx_glbl_pram->vlantci, ug_info->vlantci); in ucc_geth_startup()
2652 out_be32(&ugeth->p_rx_glbl_pram->ecamptr, ug_info->ecamptr); in ucc_geth_startup()
2656 ugeth->rx_bd_qs_tbl_offset = in ucc_geth_startup()
2661 if (IS_ERR_VALUE(ugeth->rx_bd_qs_tbl_offset)) { in ucc_geth_startup()
2662 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2667 ugeth->p_rx_bd_qs_tbl = in ucc_geth_startup()
2668 (struct ucc_geth_rx_bd_queues_entry __iomem *) qe_muram_addr(ugeth-> in ucc_geth_startup()
2670 out_be32(&ugeth->p_rx_glbl_pram->rbdqptr, ugeth->rx_bd_qs_tbl_offset); in ucc_geth_startup()
2675 out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr, in ucc_geth_startup()
2676 (u32) virt_to_phys(ugeth->p_rx_bd_ring[i])); in ucc_geth_startup()
2683 if (ugeth->rx_extended_features) in ucc_geth_startup()
2702 out_be32(&ugeth->p_rx_glbl_pram->remoder, remoder); in ucc_geth_startup()
2712 &ugeth->p_tx_glbl_pram->txrmonbaseptr, in ucc_geth_startup()
2713 ugeth->tx_fw_statistics_pram_offset, in ucc_geth_startup()
2714 &ugeth->p_rx_glbl_pram->rxrmonbaseptr, in ucc_geth_startup()
2715 ugeth->rx_fw_statistics_pram_offset, in ucc_geth_startup()
2716 &ugeth->p_tx_glbl_pram->temoder, in ucc_geth_startup()
2717 &ugeth->p_rx_glbl_pram->remoder); in ucc_geth_startup()
2720 out_8(&ugeth->p_rx_glbl_pram->rstate, function_code); in ucc_geth_startup()
2725 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2732 ugeth->exf_glbl_param_offset = in ucc_geth_startup()
2735 if (IS_ERR_VALUE(ugeth->exf_glbl_param_offset)) { in ucc_geth_startup()
2736 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2741 ugeth->p_exf_glbl_param = in ucc_geth_startup()
2742 (struct ucc_geth_exf_global_pram __iomem *) qe_muram_addr(ugeth-> in ucc_geth_startup()
2744 out_be32(&ugeth->p_rx_glbl_pram->exfGlobalParam, in ucc_geth_startup()
2745 ugeth->exf_glbl_param_offset); in ucc_geth_startup()
2746 out_be32(&ugeth->p_exf_glbl_param->l2pcdptr, in ucc_geth_startup()
2754 ugeth_82xx_filtering_clear_addr_in_paddr(ugeth, (u8) j); in ucc_geth_startup()
2757 (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> in ucc_geth_startup()
2760 ugeth_82xx_filtering_clear_all_addr_in_hash(ugeth, in ucc_geth_startup()
2762 ugeth_82xx_filtering_clear_all_addr_in_hash(ugeth, in ucc_geth_startup()
2779 if (!(ugeth->p_init_enet_param_shadow = in ucc_geth_startup()
2781 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2788 ugeth->p_init_enet_param_shadow->resinit1 = in ucc_geth_startup()
2790 ugeth->p_init_enet_param_shadow->resinit2 = in ucc_geth_startup()
2792 ugeth->p_init_enet_param_shadow->resinit3 = in ucc_geth_startup()
2794 ugeth->p_init_enet_param_shadow->resinit4 = in ucc_geth_startup()
2796 ugeth->p_init_enet_param_shadow->resinit5 = in ucc_geth_startup()
2798 ugeth->p_init_enet_param_shadow->rgftgfrxglobal |= in ucc_geth_startup()
2800 ugeth->p_init_enet_param_shadow->rgftgfrxglobal |= in ucc_geth_startup()
2803 ugeth->p_init_enet_param_shadow->rgftgfrxglobal |= in ucc_geth_startup()
2811 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2815 ugeth->p_init_enet_param_shadow->largestexternallookupkeysize = in ucc_geth_startup()
2830 if ((ret_val = fill_init_enet_entries(ugeth, &(ugeth-> in ucc_geth_startup()
2836 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2841 ugeth->p_init_enet_param_shadow->txglobal = in ucc_geth_startup()
2844 fill_init_enet_entries(ugeth, in ucc_geth_startup()
2845 &(ugeth->p_init_enet_param_shadow-> in ucc_geth_startup()
2850 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2857 if ((ret_val = rx_bd_buffer_set(ugeth, (u8) i)) != 0) { in ucc_geth_startup()
2858 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2867 if (netif_msg_ifup(ugeth)) in ucc_geth_startup()
2876 ugeth->p_init_enet_param_shadow->resinit1); in ucc_geth_startup()
2878 ugeth->p_init_enet_param_shadow->resinit2); in ucc_geth_startup()
2880 ugeth->p_init_enet_param_shadow->resinit3); in ucc_geth_startup()
2882 ugeth->p_init_enet_param_shadow->resinit4); in ucc_geth_startup()
2884 ugeth->p_init_enet_param_shadow->resinit5); in ucc_geth_startup()
2886 ugeth->p_init_enet_param_shadow->largestexternallookupkeysize); in ucc_geth_startup()
2888 ugeth->p_init_enet_param_shadow->rgftgfrxglobal); in ucc_geth_startup()
2891 ugeth->p_init_enet_param_shadow->rxthread[i]); in ucc_geth_startup()
2893 ugeth->p_init_enet_param_shadow->txglobal); in ucc_geth_startup()
2896 ugeth->p_init_enet_param_shadow->txthread[i]); in ucc_geth_startup()
2900 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num); in ucc_geth_startup()
2915 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_start_xmit() local
2927 spin_lock_irqsave(&ugeth->lock, flags); in ucc_geth_start_xmit()
2932 bd = ugeth->txBd[txQ]; in ucc_geth_start_xmit()
2935 ugeth->tx_skbuff[txQ][ugeth->skb_curtx[txQ]] = skb; in ucc_geth_start_xmit()
2938 ugeth->skb_curtx[txQ] = in ucc_geth_start_xmit()
2939 (ugeth->skb_curtx[txQ] + in ucc_geth_start_xmit()
2940 1) & TX_RING_MOD_MASK(ugeth->ug_info->bdRingLenTx[txQ]); in ucc_geth_start_xmit()
2944 dma_map_single(ugeth->dev, skb->data, in ucc_geth_start_xmit()
2958 bd = ugeth->p_tx_bd_ring[txQ]; in ucc_geth_start_xmit()
2962 if (bd == ugeth->confBd[txQ]) { in ucc_geth_start_xmit()
2967 ugeth->txBd[txQ] = bd; in ucc_geth_start_xmit()
2971 if (ugeth->p_scheduler) { in ucc_geth_start_xmit()
2972 ugeth->cpucount[txQ]++; in ucc_geth_start_xmit()
2977 out_be16(ugeth->p_cpucount[txQ], ugeth->cpucount[txQ]); in ucc_geth_start_xmit()
2981 uccf = ugeth->uccf; in ucc_geth_start_xmit()
2984 spin_unlock_irqrestore(&ugeth->lock, flags); in ucc_geth_start_xmit()
2989 static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit) in ucc_geth_rx() argument
3000 dev = ugeth->ndev; in ucc_geth_rx()
3003 bd = ugeth->rxBd[rxQ]; in ucc_geth_rx()
3011 skb = ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]]; in ucc_geth_rx()
3018 if (netif_msg_rx_err(ugeth)) in ucc_geth_rx()
3023 ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]] = NULL; in ucc_geth_rx()
3033 skb->protocol = eth_type_trans(skb, ugeth->ndev); in ucc_geth_rx()
3040 skb = get_new_skb(ugeth, bd); in ucc_geth_rx()
3042 if (netif_msg_rx_err(ugeth)) in ucc_geth_rx()
3048 ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]] = skb; in ucc_geth_rx()
3051 ugeth->skb_currx[rxQ] = in ucc_geth_rx()
3052 (ugeth->skb_currx[rxQ] + in ucc_geth_rx()
3053 1) & RX_RING_MOD_MASK(ugeth->ug_info->bdRingLenRx[rxQ]); in ucc_geth_rx()
3056 bd = ugeth->p_rx_bd_ring[rxQ]; in ucc_geth_rx()
3063 ugeth->rxBd[rxQ] = bd; in ucc_geth_rx()
3070 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_tx() local
3076 bd = ugeth->confBd[txQ]; in ucc_geth_tx()
3087 skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]]; in ucc_geth_tx()
3096 ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] = NULL; in ucc_geth_tx()
3097 ugeth->skb_dirtytx[txQ] = in ucc_geth_tx()
3098 (ugeth->skb_dirtytx[txQ] + in ucc_geth_tx()
3099 1) & TX_RING_MOD_MASK(ugeth->ug_info->bdRingLenTx[txQ]); in ucc_geth_tx()
3109 bd = ugeth->p_tx_bd_ring[txQ]; in ucc_geth_tx()
3112 ugeth->confBd[txQ] = bd; in ucc_geth_tx()
3119 struct ucc_geth_private *ugeth = container_of(napi, struct ucc_geth_private, napi); in ucc_geth_poll() local
3123 ug_info = ugeth->ug_info; in ucc_geth_poll()
3126 spin_lock(&ugeth->lock); in ucc_geth_poll()
3128 ucc_geth_tx(ugeth->ndev, i); in ucc_geth_poll()
3129 spin_unlock(&ugeth->lock); in ucc_geth_poll()
3133 howmany += ucc_geth_rx(ugeth, i, budget - howmany); in ucc_geth_poll()
3137 setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS | UCCE_TX_EVENTS); in ucc_geth_poll()
3146 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_irq_handler() local
3154 uccf = ugeth->uccf; in ucc_geth_irq_handler()
3155 ug_info = ugeth->ug_info; in ucc_geth_irq_handler()
3165 if (napi_schedule_prep(&ugeth->napi)) { in ucc_geth_irq_handler()
3168 __napi_schedule(&ugeth->napi); in ucc_geth_irq_handler()
3191 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_netpoll() local
3192 int irq = ugeth->ug_info->uf_info.irq; in ucc_netpoll()
3202 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_set_mac_addr() local
3217 spin_lock_irq(&ugeth->lock); in ucc_geth_set_mac_addr()
3224 &ugeth->ug_regs->macstnaddr1, in ucc_geth_set_mac_addr()
3225 &ugeth->ug_regs->macstnaddr2); in ucc_geth_set_mac_addr()
3226 spin_unlock_irq(&ugeth->lock); in ucc_geth_set_mac_addr()
3231 static int ucc_geth_init_mac(struct ucc_geth_private *ugeth) in ucc_geth_init_mac() argument
3233 struct net_device *dev = ugeth->ndev; in ucc_geth_init_mac()
3236 err = ucc_struct_init(ugeth); in ucc_geth_init_mac()
3238 netif_err(ugeth, ifup, dev, "Cannot configure internal struct, aborting\n"); in ucc_geth_init_mac()
3242 err = ucc_geth_startup(ugeth); in ucc_geth_init_mac()
3244 netif_err(ugeth, ifup, dev, "Cannot configure net device, aborting\n"); in ucc_geth_init_mac()
3248 err = adjust_enet_interface(ugeth); in ucc_geth_init_mac()
3250 netif_err(ugeth, ifup, dev, "Cannot configure net device, aborting\n"); in ucc_geth_init_mac()
3262 &ugeth->ug_regs->macstnaddr1, in ucc_geth_init_mac()
3263 &ugeth->ug_regs->macstnaddr2); in ucc_geth_init_mac()
3265 err = ugeth_enable(ugeth, COMM_DIR_RX_AND_TX); in ucc_geth_init_mac()
3267 netif_err(ugeth, ifup, dev, "Cannot enable net device, aborting\n"); in ucc_geth_init_mac()
3273 ucc_geth_stop(ugeth); in ucc_geth_init_mac()
3281 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_open() local
3288 netif_err(ugeth, ifup, dev, in ucc_geth_open()
3295 netif_err(ugeth, ifup, dev, "Cannot initialize PHY, aborting\n"); in ucc_geth_open()
3299 err = ucc_geth_init_mac(ugeth); in ucc_geth_open()
3301 netif_err(ugeth, ifup, dev, "Cannot initialize MAC, aborting\n"); in ucc_geth_open()
3305 err = request_irq(ugeth->ug_info->uf_info.irq, ucc_geth_irq_handler, in ucc_geth_open()
3308 netif_err(ugeth, ifup, dev, "Cannot get IRQ for net device, aborting\n"); in ucc_geth_open()
3312 phy_start(ugeth->phydev); in ucc_geth_open()
3313 napi_enable(&ugeth->napi); in ucc_geth_open()
3318 qe_alive_during_sleep() || ugeth->phydev->irq); in ucc_geth_open()
3319 device_set_wakeup_enable(&dev->dev, ugeth->wol_en); in ucc_geth_open()
3324 ucc_geth_stop(ugeth); in ucc_geth_open()
3331 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_close() local
3335 napi_disable(&ugeth->napi); in ucc_geth_close()
3337 cancel_work_sync(&ugeth->timeout_work); in ucc_geth_close()
3338 ucc_geth_stop(ugeth); in ucc_geth_close()
3339 phy_disconnect(ugeth->phydev); in ucc_geth_close()
3340 ugeth->phydev = NULL; in ucc_geth_close()
3342 free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev); in ucc_geth_close()
3353 struct ucc_geth_private *ugeth; in ucc_geth_timeout_work() local
3356 ugeth = container_of(work, struct ucc_geth_private, timeout_work); in ucc_geth_timeout_work()
3357 dev = ugeth->ndev; in ucc_geth_timeout_work()
3363 ugeth_dump_regs(ugeth); in ucc_geth_timeout_work()
3371 ucc_geth_stop(ugeth); in ucc_geth_timeout_work()
3372 ucc_geth_init_mac(ugeth); in ucc_geth_timeout_work()
3374 phy_start(ugeth->phydev); in ucc_geth_timeout_work()
3387 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_timeout() local
3389 schedule_work(&ugeth->timeout_work); in ucc_geth_timeout()
3398 struct ucc_geth_private *ugeth = netdev_priv(ndev); in ucc_geth_suspend() local
3404 napi_disable(&ugeth->napi); in ucc_geth_suspend()
3410 ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); in ucc_geth_suspend()
3412 if (ugeth->wol_en & WAKE_MAGIC) { in ucc_geth_suspend()
3413 setbits32(ugeth->uccf->p_uccm, UCC_GETH_UCCE_MPD); in ucc_geth_suspend()
3414 setbits32(&ugeth->ug_regs->maccfg2, MACCFG2_MPE); in ucc_geth_suspend()
3415 ucc_fast_enable(ugeth->uccf, COMM_DIR_RX_AND_TX); in ucc_geth_suspend()
3416 } else if (!(ugeth->wol_en & WAKE_PHY)) { in ucc_geth_suspend()
3417 phy_stop(ugeth->phydev); in ucc_geth_suspend()
3426 struct ucc_geth_private *ugeth = netdev_priv(ndev); in ucc_geth_resume() local
3433 if (ugeth->wol_en & WAKE_MAGIC) { in ucc_geth_resume()
3434 ucc_fast_disable(ugeth->uccf, COMM_DIR_RX_AND_TX); in ucc_geth_resume()
3435 clrbits32(&ugeth->ug_regs->maccfg2, MACCFG2_MPE); in ucc_geth_resume()
3436 clrbits32(ugeth->uccf->p_uccm, UCC_GETH_UCCE_MPD); in ucc_geth_resume()
3438 ugeth_enable(ugeth, COMM_DIR_RX_AND_TX); in ucc_geth_resume()
3444 ucc_geth_memclean(ugeth); in ucc_geth_resume()
3446 err = ucc_geth_init_mac(ugeth); in ucc_geth_resume()
3453 ugeth->oldlink = 0; in ucc_geth_resume()
3454 ugeth->oldspeed = 0; in ucc_geth_resume()
3455 ugeth->oldduplex = -1; in ucc_geth_resume()
3457 phy_stop(ugeth->phydev); in ucc_geth_resume()
3458 phy_start(ugeth->phydev); in ucc_geth_resume()
3460 napi_enable(&ugeth->napi); in ucc_geth_resume()
3499 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_ioctl() local
3504 if (!ugeth->phydev) in ucc_geth_ioctl()
3507 return phy_mii_ioctl(ugeth->phydev, rq, cmd); in ucc_geth_ioctl()
3560 struct ucc_geth_private *ugeth = NULL; in ucc_geth_probe() local
3689 dev = alloc_etherdev(sizeof(*ugeth)); in ucc_geth_probe()
3696 ugeth = netdev_priv(dev); in ucc_geth_probe()
3697 spin_lock_init(&ugeth->lock); in ucc_geth_probe()
3700 INIT_LIST_HEAD(&ugeth->group_hash_q); in ucc_geth_probe()
3701 INIT_LIST_HEAD(&ugeth->ind_hash_q); in ucc_geth_probe()
3714 INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work); in ucc_geth_probe()
3715 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll); in ucc_geth_probe()
3719 ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT); in ucc_geth_probe()
3720 ugeth->phy_interface = phy_interface; in ucc_geth_probe()
3721 ugeth->max_speed = max_speed; in ucc_geth_probe()
3728 if (netif_msg_probe(ugeth)) in ucc_geth_probe()
3736 ugeth->ug_info = ug_info; in ucc_geth_probe()
3737 ugeth->dev = device; in ucc_geth_probe()
3738 ugeth->ndev = dev; in ucc_geth_probe()
3739 ugeth->node = np; in ucc_geth_probe()
3759 struct ucc_geth_private *ugeth = netdev_priv(dev); in ucc_geth_remove() local
3763 ucc_geth_memclean(ugeth); in ucc_geth_remove()
3766 of_node_put(ugeth->ug_info->tbi_node); in ucc_geth_remove()
3767 of_node_put(ugeth->ug_info->phy_node); in ucc_geth_remove()
3768 kfree(ugeth->ug_info); in ucc_geth_remove()