Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ti: icssg-prueth: Split out common object into module

icssg_prueth.c and icssg_prueth_sr1.c drivers use multiple common .c
files. These common objects are getting added to multiple modules. As a
result when both drivers are enabled in .config, below warning is seen.

drivers/net/ethernet/ti/Makefile: icssg/icssg_common.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_classifier.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_config.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_mii_cfg.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_stats.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_ethtool.o is added to multiple modules: icssg-prueth icssg-prueth-sr1

Fix this by building a new module (icssg.o) for all the common objects.
Both the driver can then depend on this common module.

Some APIs being exported have emac_ as the prefix which may result into
confusion with other existing APIs with emac_ prefix, to avoid
confusion, rename the APIs being exported with emac_ to icssg_ prefix.

This also fixes below error seen when both drivers are built.
ERROR: modpost: "icssg_queue_pop"
[drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
ERROR: modpost: "icssg_queue_push"
[drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!

Reported-and-tested-by: Thorsten Leemhuis <linux@leemhuis.info>
Closes: https://lore.kernel.org/oe-kbuild-all/202405182038.ncf1mL7Z-lkp@intel.com/
Fixes: 487f7323f39a ("net: ti: icssg-prueth: Add helper functions to configure FDB")
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Reviewed-by: Sai Krishna <saikrishnag@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

MD Danish Anwar and committed by
David S. Miller
a8ea8d53 f8321fa7

+122 -69
+14 -18
drivers/net/ethernet/ti/Makefile
··· 31 31 ti-am65-cpsw-nuss-$(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV) += am65-cpsw-switchdev.o 32 32 obj-$(CONFIG_TI_K3_AM65_CPTS) += am65-cpts.o 33 33 34 - obj-$(CONFIG_TI_ICSSG_PRUETH) += icssg-prueth.o 35 - icssg-prueth-y := icssg/icssg_prueth.o \ 36 - icssg/icssg_common.o \ 37 - icssg/icssg_classifier.o \ 38 - icssg/icssg_queues.o \ 39 - icssg/icssg_config.o \ 40 - icssg/icssg_mii_cfg.o \ 41 - icssg/icssg_stats.o \ 42 - icssg/icssg_ethtool.o \ 43 - icssg/icssg_switchdev.o 44 - obj-$(CONFIG_TI_ICSSG_PRUETH_SR1) += icssg-prueth-sr1.o 45 - icssg-prueth-sr1-y := icssg/icssg_prueth_sr1.o \ 46 - icssg/icssg_common.o \ 47 - icssg/icssg_classifier.o \ 48 - icssg/icssg_config.o \ 49 - icssg/icssg_mii_cfg.o \ 50 - icssg/icssg_stats.o \ 51 - icssg/icssg_ethtool.o 34 + obj-$(CONFIG_TI_ICSSG_PRUETH) += icssg-prueth.o icssg.o 35 + icssg-prueth-y := icssg/icssg_prueth.o icssg/icssg_switchdev.o 36 + 37 + obj-$(CONFIG_TI_ICSSG_PRUETH_SR1) += icssg-prueth-sr1.o icssg.o 38 + icssg-prueth-sr1-y := icssg/icssg_prueth_sr1.o 39 + 40 + icssg-y := icssg/icssg_common.o \ 41 + icssg/icssg_classifier.o \ 42 + icssg/icssg_queues.o \ 43 + icssg/icssg_config.o \ 44 + icssg/icssg_mii_cfg.o \ 45 + icssg/icssg_stats.o \ 46 + icssg/icssg_ethtool.o 47 + 52 48 obj-$(CONFIG_TI_ICSS_IEP) += icssg/icss_iep.o
+6
drivers/net/ethernet/ti/icssg/icssg_classifier.c
··· 297 297 mac[2] << 16 | mac[3] << 24)); 298 298 regmap_write(miig_rt, offs[slice].mac1, (u32)(mac[4] | mac[5] << 8)); 299 299 } 300 + EXPORT_SYMBOL_GPL(icssg_class_set_mac_addr); 300 301 301 302 static void icssg_class_ft1_add_mcast(struct regmap *miig_rt, int slice, 302 303 int slot, const u8 *addr, const u8 *mask) ··· 361 360 /* clear CFG2 */ 362 361 regmap_write(miig_rt, offs[slice].rx_class_cfg2, 0); 363 362 } 363 + EXPORT_SYMBOL_GPL(icssg_class_disable); 364 364 365 365 void icssg_class_default(struct regmap *miig_rt, int slice, bool allmulti, 366 366 bool is_sr1) ··· 392 390 /* clear CFG2 */ 393 391 regmap_write(miig_rt, offs[slice].rx_class_cfg2, 0); 394 392 } 393 + EXPORT_SYMBOL_GPL(icssg_class_default); 395 394 396 395 void icssg_class_promiscuous_sr1(struct regmap *miig_rt, int slice) 397 396 { ··· 411 408 regmap_write(miig_rt, offset, data); 412 409 } 413 410 } 411 + EXPORT_SYMBOL_GPL(icssg_class_promiscuous_sr1); 414 412 415 413 void icssg_class_add_mcast_sr1(struct regmap *miig_rt, int slice, 416 414 struct net_device *ndev) ··· 453 449 slot++; 454 450 } 455 451 } 452 + EXPORT_SYMBOL_GPL(icssg_class_add_mcast_sr1); 456 453 457 454 /* required for SAV check */ 458 455 void icssg_ft1_set_mac_addr(struct regmap *miig_rt, int slice, u8 *mac_addr) ··· 465 460 rx_class_ft1_set_da_mask(miig_rt, slice, 0, mask_addr); 466 461 rx_class_ft1_cfg_set_type(miig_rt, slice, 0, FT1_CFG_TYPE_EQ); 467 462 } 463 + EXPORT_SYMBOL_GPL(icssg_ft1_set_mac_addr);
+41 -9
drivers/net/ethernet/ti/icssg/icssg_common.c
··· 51 51 if (rx_chn->rx_chn) 52 52 k3_udma_glue_release_rx_chn(rx_chn->rx_chn); 53 53 } 54 + EXPORT_SYMBOL_GPL(prueth_cleanup_rx_chns); 54 55 55 56 void prueth_cleanup_tx_chns(struct prueth_emac *emac) 56 57 { ··· 72 71 memset(tx_chn, 0, sizeof(*tx_chn)); 73 72 } 74 73 } 74 + EXPORT_SYMBOL_GPL(prueth_cleanup_tx_chns); 75 75 76 76 void prueth_ndev_del_tx_napi(struct prueth_emac *emac, int num) 77 77 { ··· 86 84 netif_napi_del(&tx_chn->napi_tx); 87 85 } 88 86 } 87 + EXPORT_SYMBOL_GPL(prueth_ndev_del_tx_napi); 89 88 90 89 void prueth_xmit_free(struct prueth_tx_chn *tx_chn, 91 90 struct cppi5_host_desc_t *desc) ··· 123 120 124 121 k3_cppi_desc_pool_free(tx_chn->desc_pool, first_desc); 125 122 } 123 + EXPORT_SYMBOL_GPL(prueth_xmit_free); 126 124 127 125 int emac_tx_complete_packets(struct prueth_emac *emac, int chn, 128 126 int budget, bool *tdown) ··· 268 264 prueth_ndev_del_tx_napi(emac, i); 269 265 return ret; 270 266 } 267 + EXPORT_SYMBOL_GPL(prueth_ndev_add_tx_napi); 271 268 272 269 int prueth_init_tx_chns(struct prueth_emac *emac) 273 270 { ··· 349 344 prueth_cleanup_tx_chns(emac); 350 345 return ret; 351 346 } 347 + EXPORT_SYMBOL_GPL(prueth_init_tx_chns); 352 348 353 349 int prueth_init_rx_chns(struct prueth_emac *emac, 354 350 struct prueth_rx_chn *rx_chn, ··· 459 453 prueth_cleanup_rx_chns(emac, rx_chn, max_rflows); 460 454 return ret; 461 455 } 456 + EXPORT_SYMBOL_GPL(prueth_init_rx_chns); 462 457 463 458 int prueth_dma_rx_push(struct prueth_emac *emac, 464 459 struct sk_buff *skb, ··· 497 490 return k3_udma_glue_push_rx_chn(rx_chn->rx_chn, 0, 498 491 desc_rx, desc_dma); 499 492 } 493 + EXPORT_SYMBOL_GPL(prueth_dma_rx_push); 500 494 501 495 u64 icssg_ts_to_ns(u32 hi_sw, u32 hi, u32 lo, u32 cycle_time_ns) 502 496 { ··· 513 505 514 506 return ns; 515 507 } 508 + EXPORT_SYMBOL_GPL(icssg_ts_to_ns); 516 509 517 510 void emac_rx_timestamp(struct prueth_emac *emac, 518 511 struct sk_buff *skb, u32 *psdata) ··· 645 636 } 646 637 647 638 /** 648 - * emac_ndo_start_xmit - EMAC Transmit function 639 + * icssg_ndo_start_xmit - EMAC Transmit function 649 640 * @skb: SKB pointer 650 641 * @ndev: EMAC network adapter 651 642 * ··· 656 647 * 657 648 * Return: enum netdev_tx 658 649 */ 659 - enum netdev_tx emac_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev) 650 + enum netdev_tx icssg_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev) 660 651 { 661 652 struct cppi5_host_desc_t *first_desc, *next_desc, *cur_desc; 662 653 struct prueth_emac *emac = netdev_priv(ndev); ··· 815 806 netif_tx_stop_queue(netif_txq); 816 807 return NETDEV_TX_BUSY; 817 808 } 809 + EXPORT_SYMBOL_GPL(icssg_ndo_start_xmit); 818 810 819 811 static void prueth_tx_cleanup(void *data, dma_addr_t desc_dma) 820 812 { ··· 841 831 842 832 return IRQ_HANDLED; 843 833 } 834 + EXPORT_SYMBOL_GPL(prueth_rx_irq); 844 835 845 836 void prueth_emac_stop(struct prueth_emac *emac) 846 837 { ··· 866 855 rproc_shutdown(prueth->rtu[slice]); 867 856 rproc_shutdown(prueth->pru[slice]); 868 857 } 858 + EXPORT_SYMBOL_GPL(prueth_emac_stop); 869 859 870 860 void prueth_cleanup_tx_ts(struct prueth_emac *emac) 871 861 { ··· 879 867 } 880 868 } 881 869 } 870 + EXPORT_SYMBOL_GPL(prueth_cleanup_tx_ts); 882 871 883 - int emac_napi_rx_poll(struct napi_struct *napi_rx, int budget) 872 + int icssg_napi_rx_poll(struct napi_struct *napi_rx, int budget) 884 873 { 885 874 struct prueth_emac *emac = prueth_napi_to_emac(napi_rx); 886 875 int rx_flow = emac->is_sr1 ? ··· 918 905 919 906 return num_rx; 920 907 } 908 + EXPORT_SYMBOL_GPL(icssg_napi_rx_poll); 921 909 922 910 int prueth_prepare_rx_chan(struct prueth_emac *emac, 923 911 struct prueth_rx_chn *chn, ··· 944 930 945 931 return 0; 946 932 } 933 + EXPORT_SYMBOL_GPL(prueth_prepare_rx_chan); 947 934 948 935 void prueth_reset_tx_chan(struct prueth_emac *emac, int ch_num, 949 936 bool free_skb) ··· 959 944 k3_udma_glue_disable_tx_chn(emac->tx_chns[i].tx_chn); 960 945 } 961 946 } 947 + EXPORT_SYMBOL_GPL(prueth_reset_tx_chan); 962 948 963 949 void prueth_reset_rx_chan(struct prueth_rx_chn *chn, 964 950 int num_flows, bool disable) ··· 972 956 if (disable) 973 957 k3_udma_glue_disable_rx_chn(chn->rx_chn); 974 958 } 959 + EXPORT_SYMBOL_GPL(prueth_reset_rx_chan); 975 960 976 - void emac_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue) 961 + void icssg_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue) 977 962 { 978 963 ndev->stats.tx_errors++; 979 964 } 965 + EXPORT_SYMBOL_GPL(icssg_ndo_tx_timeout); 980 966 981 967 static int emac_set_ts_config(struct net_device *ndev, struct ifreq *ifr) 982 968 { ··· 1042 1024 -EFAULT : 0; 1043 1025 } 1044 1026 1045 - int emac_ndo_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) 1027 + int icssg_ndo_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) 1046 1028 { 1047 1029 switch (cmd) { 1048 1030 case SIOCGHWTSTAMP: ··· 1055 1037 1056 1038 return phy_do_ioctl(ndev, ifr, cmd); 1057 1039 } 1040 + EXPORT_SYMBOL_GPL(icssg_ndo_ioctl); 1058 1041 1059 - void emac_ndo_get_stats64(struct net_device *ndev, 1060 - struct rtnl_link_stats64 *stats) 1042 + void icssg_ndo_get_stats64(struct net_device *ndev, 1043 + struct rtnl_link_stats64 *stats) 1061 1044 { 1062 1045 struct prueth_emac *emac = netdev_priv(ndev); 1063 1046 ··· 1077 1058 stats->tx_errors = ndev->stats.tx_errors; 1078 1059 stats->tx_dropped = ndev->stats.tx_dropped; 1079 1060 } 1061 + EXPORT_SYMBOL_GPL(icssg_ndo_get_stats64); 1080 1062 1081 - int emac_ndo_get_phys_port_name(struct net_device *ndev, char *name, 1082 - size_t len) 1063 + int icssg_ndo_get_phys_port_name(struct net_device *ndev, char *name, 1064 + size_t len) 1083 1065 { 1084 1066 struct prueth_emac *emac = netdev_priv(ndev); 1085 1067 int ret; ··· 1091 1071 1092 1072 return 0; 1093 1073 } 1074 + EXPORT_SYMBOL_GPL(icssg_ndo_get_phys_port_name); 1094 1075 1095 1076 /* get emac_port corresponding to eth_node name */ 1096 1077 int prueth_node_port(struct device_node *eth_node) ··· 1110 1089 else 1111 1090 return PRUETH_PORT_INVALID; 1112 1091 } 1092 + EXPORT_SYMBOL_GPL(prueth_node_port); 1113 1093 1114 1094 /* get MAC instance corresponding to eth_node name */ 1115 1095 int prueth_node_mac(struct device_node *eth_node) ··· 1129 1107 else 1130 1108 return PRUETH_MAC_INVALID; 1131 1109 } 1110 + EXPORT_SYMBOL_GPL(prueth_node_mac); 1132 1111 1133 1112 void prueth_netdev_exit(struct prueth *prueth, 1134 1113 struct device_node *eth_node) ··· 1155 1132 free_netdev(emac->ndev); 1156 1133 prueth->emac[mac] = NULL; 1157 1134 } 1135 + EXPORT_SYMBOL_GPL(prueth_netdev_exit); 1158 1136 1159 1137 int prueth_get_cores(struct prueth *prueth, int slice, bool is_sr1) 1160 1138 { ··· 1206 1182 1207 1183 return 0; 1208 1184 } 1185 + EXPORT_SYMBOL_GPL(prueth_get_cores); 1209 1186 1210 1187 void prueth_put_cores(struct prueth *prueth, int slice) 1211 1188 { ··· 1219 1194 if (prueth->pru[slice]) 1220 1195 pru_rproc_put(prueth->pru[slice]); 1221 1196 } 1197 + EXPORT_SYMBOL_GPL(prueth_put_cores); 1222 1198 1223 1199 #ifdef CONFIG_PM_SLEEP 1224 1200 static int prueth_suspend(struct device *dev) ··· 1276 1250 const struct dev_pm_ops prueth_dev_pm_ops = { 1277 1251 SET_SYSTEM_SLEEP_PM_OPS(prueth_suspend, prueth_resume) 1278 1252 }; 1253 + EXPORT_SYMBOL_GPL(prueth_dev_pm_ops); 1254 + 1255 + MODULE_AUTHOR("Roger Quadros <rogerq@ti.com>"); 1256 + MODULE_AUTHOR("Md Danish Anwar <danishanwar@ti.com>"); 1257 + MODULE_DESCRIPTION("PRUSS ICSSG Ethernet Driver Common Module"); 1258 + MODULE_LICENSE("GPL");
+13 -2
drivers/net/ethernet/ti/icssg/icssg_config.c
··· 248 248 249 249 icssg_mii_update_ipg(prueth->mii_rt, slice, ipg); 250 250 } 251 + EXPORT_SYMBOL_GPL(icssg_config_ipg); 251 252 252 253 static void emac_r30_cmd_init(struct prueth_emac *emac) 253 254 { ··· 509 508 510 509 return 0; 511 510 } 511 + EXPORT_SYMBOL_GPL(icssg_config); 512 512 513 513 /* Bitmask for ICSSG r30 commands */ 514 514 static const struct icssg_r30_cmd emac_r32_bitmask[] = { ··· 534 532 {{0xffef0000, EMAC_NONE, 0xffef0000, EMAC_NONE}} /* VLAN UNWARE*/ 535 533 }; 536 534 537 - int emac_set_port_state(struct prueth_emac *emac, 538 - enum icssg_port_state_cmd cmd) 535 + int icssg_set_port_state(struct prueth_emac *emac, 536 + enum icssg_port_state_cmd cmd) 539 537 { 540 538 struct icssg_r30_cmd __iomem *p; 541 539 int ret = -ETIMEDOUT; ··· 566 564 567 565 return ret; 568 566 } 567 + EXPORT_SYMBOL_GPL(icssg_set_port_state); 569 568 570 569 void icssg_config_half_duplex(struct prueth_emac *emac) 571 570 { ··· 578 575 val = get_random_u32(); 579 576 writel(val, emac->dram.va + HD_RAND_SEED_OFFSET); 580 577 } 578 + EXPORT_SYMBOL_GPL(icssg_config_half_duplex); 581 579 582 580 void icssg_config_set_speed(struct prueth_emac *emac) 583 581 { ··· 605 601 606 602 writeb(fw_speed, emac->dram.va + PORT_LINK_SPEED_OFFSET); 607 603 } 604 + EXPORT_SYMBOL_GPL(icssg_config_set_speed); 608 605 609 606 int icssg_send_fdb_msg(struct prueth_emac *emac, struct mgmt_cmd *cmd, 610 607 struct mgmt_cmd_rsp *rsp) ··· 640 635 641 636 return 0; 642 637 } 638 + EXPORT_SYMBOL_GPL(icssg_send_fdb_msg); 643 639 644 640 static void icssg_fdb_setup(struct prueth_emac *emac, struct mgmt_cmd *fdb_cmd, 645 641 const unsigned char *addr, u8 fid, int cmd) ··· 693 687 694 688 return -EINVAL; 695 689 } 690 + EXPORT_SYMBOL_GPL(icssg_fdb_add_del); 696 691 697 692 int icssg_fdb_lookup(struct prueth_emac *emac, const unsigned char *addr, 698 693 u8 vid) ··· 723 716 724 717 return 0; 725 718 } 719 + EXPORT_SYMBOL_GPL(icssg_fdb_lookup); 726 720 727 721 void icssg_vtbl_modify(struct prueth_emac *emac, u8 vid, u8 port_mask, 728 722 u8 untag_mask, bool add) ··· 749 741 750 742 tbl[vid].fid_c1 = fid_c1; 751 743 } 744 + EXPORT_SYMBOL_GPL(icssg_vtbl_modify); 752 745 753 746 u16 icssg_get_pvid(struct prueth_emac *emac) 754 747 { ··· 765 756 766 757 return pvid; 767 758 } 759 + EXPORT_SYMBOL_GPL(icssg_get_pvid); 768 760 769 761 void icssg_set_pvid(struct prueth *prueth, u8 vid, u8 port) 770 762 { ··· 781 771 else 782 772 writel(pvid, prueth->shram.va + EMAC_ICSSG_SWITCH_PORT0_DEFAULT_VLAN_OFFSET); 783 773 } 774 + EXPORT_SYMBOL_GPL(icssg_set_pvid);
+1
drivers/net/ethernet/ti/icssg/icssg_ethtool.c
··· 312 312 .nway_reset = emac_nway_reset, 313 313 .get_rmon_stats = emac_get_rmon_stats, 314 314 }; 315 + EXPORT_SYMBOL_GPL(icssg_ethtool_ops);
+4
drivers/net/ethernet/ti/icssg/icssg_mii_cfg.c
··· 40 40 (mtu - 1) << PRUSS_MII_RT_RX_FRMS_MAX_FRM_SHIFT); 41 41 } 42 42 } 43 + EXPORT_SYMBOL_GPL(icssg_mii_update_mtu); 43 44 44 45 void icssg_update_rgmii_cfg(struct regmap *miig_rt, struct prueth_emac *emac) 45 46 { ··· 67 66 regmap_update_bits(miig_rt, RGMII_CFG_OFFSET, full_duplex_mask, 68 67 full_duplex_val); 69 68 } 69 + EXPORT_SYMBOL_GPL(icssg_update_rgmii_cfg); 70 70 71 71 void icssg_miig_set_interface_mode(struct regmap *miig_rt, int mii, phy_interface_t phy_if) 72 72 { ··· 107 105 108 106 return icssg_rgmii_cfg_get_bitfield(miig_rt, mask, shift); 109 107 } 108 + EXPORT_SYMBOL_GPL(icssg_rgmii_get_speed); 110 109 111 110 u32 icssg_rgmii_get_fullduplex(struct regmap *miig_rt, int mii) 112 111 { ··· 121 118 122 119 return icssg_rgmii_cfg_get_bitfield(miig_rt, mask, shift); 123 120 } 121 + EXPORT_SYMBOL_GPL(icssg_rgmii_get_fullduplex);
+19 -19
drivers/net/ethernet/ti/icssg/icssg_prueth.c
··· 249 249 icssg_config_ipg(emac); 250 250 spin_unlock_irqrestore(&emac->lock, flags); 251 251 icssg_config_set_speed(emac); 252 - emac_set_port_state(emac, ICSSG_EMAC_PORT_FORWARD); 252 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_FORWARD); 253 253 254 254 } else { 255 - emac_set_port_state(emac, ICSSG_EMAC_PORT_DISABLE); 255 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_DISABLE); 256 256 } 257 257 } 258 258 ··· 694 694 695 695 promisc = ndev->flags & IFF_PROMISC; 696 696 allmulti = ndev->flags & IFF_ALLMULTI; 697 - emac_set_port_state(emac, ICSSG_EMAC_PORT_UC_FLOODING_DISABLE); 698 - emac_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_DISABLE); 697 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_UC_FLOODING_DISABLE); 698 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_DISABLE); 699 699 700 700 if (promisc) { 701 - emac_set_port_state(emac, ICSSG_EMAC_PORT_UC_FLOODING_ENABLE); 702 - emac_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_ENABLE); 701 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_UC_FLOODING_ENABLE); 702 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_ENABLE); 703 703 return; 704 704 } 705 705 706 706 if (allmulti) { 707 - emac_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_ENABLE); 707 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_ENABLE); 708 708 return; 709 709 } 710 710 ··· 728 728 static const struct net_device_ops emac_netdev_ops = { 729 729 .ndo_open = emac_ndo_open, 730 730 .ndo_stop = emac_ndo_stop, 731 - .ndo_start_xmit = emac_ndo_start_xmit, 731 + .ndo_start_xmit = icssg_ndo_start_xmit, 732 732 .ndo_set_mac_address = eth_mac_addr, 733 733 .ndo_validate_addr = eth_validate_addr, 734 - .ndo_tx_timeout = emac_ndo_tx_timeout, 734 + .ndo_tx_timeout = icssg_ndo_tx_timeout, 735 735 .ndo_set_rx_mode = emac_ndo_set_rx_mode, 736 - .ndo_eth_ioctl = emac_ndo_ioctl, 737 - .ndo_get_stats64 = emac_ndo_get_stats64, 738 - .ndo_get_phys_port_name = emac_ndo_get_phys_port_name, 736 + .ndo_eth_ioctl = icssg_ndo_ioctl, 737 + .ndo_get_stats64 = icssg_ndo_get_stats64, 738 + .ndo_get_phys_port_name = icssg_ndo_get_phys_port_name, 739 739 }; 740 740 741 741 static int prueth_netdev_init(struct prueth *prueth, ··· 771 771 } 772 772 INIT_WORK(&emac->rx_mode_work, emac_ndo_set_rx_mode_work); 773 773 774 - INIT_DELAYED_WORK(&emac->stats_work, emac_stats_work_handler); 774 + INIT_DELAYED_WORK(&emac->stats_work, icssg_stats_work_handler); 775 775 776 776 ret = pruss_request_mem_region(prueth->pruss, 777 777 port == PRUETH_PORT_MII0 ? ··· 864 864 ndev->hw_features = NETIF_F_SG; 865 865 ndev->features = ndev->hw_features; 866 866 867 - netif_napi_add(ndev, &emac->napi_rx, emac_napi_rx_poll); 867 + netif_napi_add(ndev, &emac->napi_rx, icssg_napi_rx_poll); 868 868 hrtimer_init(&emac->rx_hrtimer, CLOCK_MONOTONIC, 869 869 HRTIMER_MODE_REL_PINNED); 870 870 emac->rx_hrtimer.function = &emac_rx_timer_callback; ··· 927 927 netif_device_detach(emac1->ndev); 928 928 929 929 /* Disable both PRUeth ports */ 930 - emac_set_port_state(emac0, ICSSG_EMAC_PORT_DISABLE); 931 - emac_set_port_state(emac1, ICSSG_EMAC_PORT_DISABLE); 930 + icssg_set_port_state(emac0, ICSSG_EMAC_PORT_DISABLE); 931 + icssg_set_port_state(emac1, ICSSG_EMAC_PORT_DISABLE); 932 932 933 933 /* Stop both pru cores for both PRUeth ports*/ 934 934 prueth_emac_stop(emac0); ··· 943 943 prueth->emacs_initialized++; 944 944 945 945 /* Enable forwarding for both PRUeth ports */ 946 - emac_set_port_state(emac0, ICSSG_EMAC_PORT_FORWARD); 947 - emac_set_port_state(emac1, ICSSG_EMAC_PORT_FORWARD); 946 + icssg_set_port_state(emac0, ICSSG_EMAC_PORT_FORWARD); 947 + icssg_set_port_state(emac1, ICSSG_EMAC_PORT_FORWARD); 948 948 949 949 /* Attache net_device for both PRUeth ports */ 950 950 netif_device_attach(emac0->ndev); ··· 972 972 BIT(emac->port_id) | DEFAULT_UNTAG_MASK, 973 973 true); 974 974 icssg_set_pvid(prueth, emac->port_vlan, emac->port_id); 975 - emac_set_port_state(emac, ICSSG_EMAC_PORT_VLAN_AWARE_ENABLE); 975 + icssg_set_port_state(emac, ICSSG_EMAC_PORT_VLAN_AWARE_ENABLE); 976 976 } 977 977 } 978 978 }
+11 -11
drivers/net/ethernet/ti/icssg/icssg_prueth.h
··· 329 329 void icssg_config_ipg(struct prueth_emac *emac); 330 330 int icssg_config(struct prueth *prueth, struct prueth_emac *emac, 331 331 int slice); 332 - int emac_set_port_state(struct prueth_emac *emac, 333 - enum icssg_port_state_cmd state); 332 + int icssg_set_port_state(struct prueth_emac *emac, 333 + enum icssg_port_state_cmd state); 334 334 void icssg_config_set_speed(struct prueth_emac *emac); 335 335 void icssg_config_half_duplex(struct prueth_emac *emac); 336 336 ··· 352 352 #define prueth_napi_to_tx_chn(pnapi) \ 353 353 container_of(pnapi, struct prueth_tx_chn, napi_tx) 354 354 355 - void emac_stats_work_handler(struct work_struct *work); 355 + void icssg_stats_work_handler(struct work_struct *work); 356 356 void emac_update_hardware_stats(struct prueth_emac *emac); 357 357 int emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name); 358 358 ··· 377 377 struct prueth_rx_chn *rx_chn); 378 378 void emac_rx_timestamp(struct prueth_emac *emac, 379 379 struct sk_buff *skb, u32 *psdata); 380 - enum netdev_tx emac_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev); 380 + enum netdev_tx icssg_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev); 381 381 irqreturn_t prueth_rx_irq(int irq, void *dev_id); 382 382 void prueth_emac_stop(struct prueth_emac *emac); 383 383 void prueth_cleanup_tx_ts(struct prueth_emac *emac); 384 - int emac_napi_rx_poll(struct napi_struct *napi_rx, int budget); 384 + int icssg_napi_rx_poll(struct napi_struct *napi_rx, int budget); 385 385 int prueth_prepare_rx_chan(struct prueth_emac *emac, 386 386 struct prueth_rx_chn *chn, 387 387 int buf_size); ··· 389 389 bool free_skb); 390 390 void prueth_reset_rx_chan(struct prueth_rx_chn *chn, 391 391 int num_flows, bool disable); 392 - void emac_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue); 393 - int emac_ndo_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd); 394 - void emac_ndo_get_stats64(struct net_device *ndev, 395 - struct rtnl_link_stats64 *stats); 396 - int emac_ndo_get_phys_port_name(struct net_device *ndev, char *name, 397 - size_t len); 392 + void icssg_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue); 393 + int icssg_ndo_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd); 394 + void icssg_ndo_get_stats64(struct net_device *ndev, 395 + struct rtnl_link_stats64 *stats); 396 + int icssg_ndo_get_phys_port_name(struct net_device *ndev, char *name, 397 + size_t len); 398 398 int prueth_node_port(struct device_node *eth_node); 399 399 int prueth_node_mac(struct device_node *eth_node); 400 400 void prueth_netdev_exit(struct prueth *prueth,
+7 -7
drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
··· 722 722 static const struct net_device_ops emac_netdev_ops = { 723 723 .ndo_open = emac_ndo_open, 724 724 .ndo_stop = emac_ndo_stop, 725 - .ndo_start_xmit = emac_ndo_start_xmit, 725 + .ndo_start_xmit = icssg_ndo_start_xmit, 726 726 .ndo_set_mac_address = eth_mac_addr, 727 727 .ndo_validate_addr = eth_validate_addr, 728 - .ndo_tx_timeout = emac_ndo_tx_timeout, 728 + .ndo_tx_timeout = icssg_ndo_tx_timeout, 729 729 .ndo_set_rx_mode = emac_ndo_set_rx_mode_sr1, 730 - .ndo_eth_ioctl = emac_ndo_ioctl, 731 - .ndo_get_stats64 = emac_ndo_get_stats64, 732 - .ndo_get_phys_port_name = emac_ndo_get_phys_port_name, 730 + .ndo_eth_ioctl = icssg_ndo_ioctl, 731 + .ndo_get_stats64 = icssg_ndo_get_stats64, 732 + .ndo_get_phys_port_name = icssg_ndo_get_phys_port_name, 733 733 }; 734 734 735 735 static int prueth_netdev_init(struct prueth *prueth, ··· 767 767 goto free_ndev; 768 768 } 769 769 770 - INIT_DELAYED_WORK(&emac->stats_work, emac_stats_work_handler); 770 + INIT_DELAYED_WORK(&emac->stats_work, icssg_stats_work_handler); 771 771 772 772 ret = pruss_request_mem_region(prueth->pruss, 773 773 port == PRUETH_PORT_MII0 ? ··· 854 854 ndev->hw_features = NETIF_F_SG; 855 855 ndev->features = ndev->hw_features; 856 856 857 - netif_napi_add(ndev, &emac->napi_rx, emac_napi_rx_poll); 857 + netif_napi_add(ndev, &emac->napi_rx, icssg_napi_rx_poll); 858 858 prueth->emac[mac] = emac; 859 859 860 860 return 0;
+2
drivers/net/ethernet/ti/icssg/icssg_queues.c
··· 28 28 29 29 return val; 30 30 } 31 + EXPORT_SYMBOL_GPL(icssg_queue_pop); 31 32 32 33 void icssg_queue_push(struct prueth *prueth, int queue, u16 addr) 33 34 { ··· 37 36 38 37 regmap_write(prueth->miig_rt, ICSSG_QUEUE_OFFSET + 4 * queue, addr); 39 38 } 39 + EXPORT_SYMBOL_GPL(icssg_queue_push); 40 40 41 41 u32 icssg_queue_level(struct prueth *prueth, int queue) 42 42 {
+2 -1
drivers/net/ethernet/ti/icssg/icssg_stats.c
··· 42 42 } 43 43 } 44 44 45 - void emac_stats_work_handler(struct work_struct *work) 45 + void icssg_stats_work_handler(struct work_struct *work) 46 46 { 47 47 struct prueth_emac *emac = container_of(work, struct prueth_emac, 48 48 stats_work.work); ··· 51 51 queue_delayed_work(system_long_wq, &emac->stats_work, 52 52 msecs_to_jiffies((STATS_TIME_LIMIT_1G_MS * 1000) / emac->speed)); 53 53 } 54 + EXPORT_SYMBOL_GPL(icssg_stats_work_handler); 54 55 55 56 int emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name) 56 57 {
+2 -2
drivers/net/ethernet/ti/icssg/icssg_switchdev.c
··· 44 44 return -EOPNOTSUPP; 45 45 } 46 46 47 - emac_set_port_state(emac, emac_state); 47 + icssg_set_port_state(emac, emac_state); 48 48 netdev_dbg(emac->ndev, "STP state: %u\n", emac_state); 49 49 50 50 return ret; ··· 64 64 netdev_dbg(emac->ndev, "BR_MCAST_FLOOD: %d port %u\n", 65 65 emac_state, emac->port_id); 66 66 67 - emac_set_port_state(emac, emac_state); 67 + icssg_set_port_state(emac, emac_state); 68 68 69 69 return 0; 70 70 }