| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2014-2015 Hisilicon Limited. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 6 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | | - * (at your option) any later version. |
|---|
| 8 | 4 | */ |
|---|
| 9 | 5 | |
|---|
| 10 | 6 | #include <linux/acpi.h> |
|---|
| .. | .. |
|---|
| 28 | 24 | #include "hns_dsaf_rcb.h" |
|---|
| 29 | 25 | #include "hns_dsaf_misc.h" |
|---|
| 30 | 26 | |
|---|
| 31 | | -const static char *g_dsaf_mode_match[DSAF_MODE_MAX] = { |
|---|
| 27 | +static const char *g_dsaf_mode_match[DSAF_MODE_MAX] = { |
|---|
| 32 | 28 | [DSAF_MODE_DISABLE_2PORT_64VM] = "2port-64vf", |
|---|
| 33 | 29 | [DSAF_MODE_DISABLE_6PORT_0VM] = "6port-16rss", |
|---|
| 34 | 30 | [DSAF_MODE_DISABLE_6PORT_16VM] = "6port-16vf", |
|---|
| .. | .. |
|---|
| 211 | 207 | |
|---|
| 212 | 208 | /** |
|---|
| 213 | 209 | * hns_dsaf_sbm_link_sram_init_en - config dsaf_sbm_init_en |
|---|
| 214 | | - * @dsaf_id: dsa fabric id |
|---|
| 210 | + * @dsaf_dev: dsa fabric id |
|---|
| 215 | 211 | */ |
|---|
| 216 | 212 | static void hns_dsaf_sbm_link_sram_init_en(struct dsaf_device *dsaf_dev) |
|---|
| 217 | 213 | { |
|---|
| .. | .. |
|---|
| 220 | 216 | |
|---|
| 221 | 217 | /** |
|---|
| 222 | 218 | * hns_dsaf_reg_cnt_clr_ce - config hns_dsaf_reg_cnt_clr_ce |
|---|
| 223 | | - * @dsaf_id: dsa fabric id |
|---|
| 224 | | - * @hns_dsaf_reg_cnt_clr_ce: config value |
|---|
| 219 | + * @dsaf_dev: dsa fabric id |
|---|
| 220 | + * @reg_cnt_clr_ce: config value |
|---|
| 225 | 221 | */ |
|---|
| 226 | 222 | static void |
|---|
| 227 | 223 | hns_dsaf_reg_cnt_clr_ce(struct dsaf_device *dsaf_dev, u32 reg_cnt_clr_ce) |
|---|
| .. | .. |
|---|
| 232 | 228 | |
|---|
| 233 | 229 | /** |
|---|
| 234 | 230 | * hns_ppe_qid_cfg - config ppe qid |
|---|
| 235 | | - * @dsaf_id: dsa fabric id |
|---|
| 236 | | - * @pppe_qid_cfg: value array |
|---|
| 231 | + * @dsaf_dev: dsa fabric id |
|---|
| 232 | + * @qid_cfg: value array |
|---|
| 237 | 233 | */ |
|---|
| 238 | 234 | static void |
|---|
| 239 | 235 | hns_dsaf_ppe_qid_cfg(struct dsaf_device *dsaf_dev, u32 qid_cfg) |
|---|
| .. | .. |
|---|
| 289 | 285 | |
|---|
| 290 | 286 | /** |
|---|
| 291 | 287 | * hns_dsaf_sw_port_type_cfg - cfg sw type |
|---|
| 292 | | - * @dsaf_id: dsa fabric id |
|---|
| 293 | | - * @psw_port_type: array |
|---|
| 288 | + * @dsaf_dev: dsa fabric id |
|---|
| 289 | + * @port_type: array |
|---|
| 294 | 290 | */ |
|---|
| 295 | 291 | static void hns_dsaf_sw_port_type_cfg(struct dsaf_device *dsaf_dev, |
|---|
| 296 | 292 | enum dsaf_sw_port_type port_type) |
|---|
| .. | .. |
|---|
| 307 | 303 | |
|---|
| 308 | 304 | /** |
|---|
| 309 | 305 | * hns_dsaf_stp_port_type_cfg - cfg stp type |
|---|
| 310 | | - * @dsaf_id: dsa fabric id |
|---|
| 311 | | - * @pstp_port_type: array |
|---|
| 306 | + * @dsaf_dev: dsa fabric id |
|---|
| 307 | + * @port_type: array |
|---|
| 312 | 308 | */ |
|---|
| 313 | 309 | static void hns_dsaf_stp_port_type_cfg(struct dsaf_device *dsaf_dev, |
|---|
| 314 | 310 | enum dsaf_stp_port_type port_type) |
|---|
| .. | .. |
|---|
| 327 | 323 | (AE_IS_VER1((dev)->dsaf_ver) ? DSAF_SBM_NUM : DSAFV2_SBM_NUM) |
|---|
| 328 | 324 | /** |
|---|
| 329 | 325 | * hns_dsaf_sbm_cfg - config sbm |
|---|
| 330 | | - * @dsaf_id: dsa fabric id |
|---|
| 326 | + * @dsaf_dev: dsa fabric id |
|---|
| 331 | 327 | */ |
|---|
| 332 | 328 | static void hns_dsaf_sbm_cfg(struct dsaf_device *dsaf_dev) |
|---|
| 333 | 329 | { |
|---|
| .. | .. |
|---|
| 346 | 342 | |
|---|
| 347 | 343 | /** |
|---|
| 348 | 344 | * hns_dsaf_sbm_cfg_mib_en - config sbm |
|---|
| 349 | | - * @dsaf_id: dsa fabric id |
|---|
| 345 | + * @dsaf_dev: dsa fabric id |
|---|
| 350 | 346 | */ |
|---|
| 351 | 347 | static int hns_dsaf_sbm_cfg_mib_en(struct dsaf_device *dsaf_dev) |
|---|
| 352 | 348 | { |
|---|
| .. | .. |
|---|
| 391 | 387 | |
|---|
| 392 | 388 | /** |
|---|
| 393 | 389 | * hns_dsaf_sbm_bp_wl_cfg - config sbm |
|---|
| 394 | | - * @dsaf_id: dsa fabric id |
|---|
| 390 | + * @dsaf_dev: dsa fabric id |
|---|
| 395 | 391 | */ |
|---|
| 396 | 392 | static void hns_dsaf_sbm_bp_wl_cfg(struct dsaf_device *dsaf_dev) |
|---|
| 397 | 393 | { |
|---|
| .. | .. |
|---|
| 560 | 556 | |
|---|
| 561 | 557 | /** |
|---|
| 562 | 558 | * hns_dsaf_voq_bp_all_thrd_cfg - voq |
|---|
| 563 | | - * @dsaf_id: dsa fabric id |
|---|
| 559 | + * @dsaf_dev: dsa fabric id |
|---|
| 564 | 560 | */ |
|---|
| 565 | 561 | static void hns_dsaf_voq_bp_all_thrd_cfg(struct dsaf_device *dsaf_dev) |
|---|
| 566 | 562 | { |
|---|
| .. | .. |
|---|
| 603 | 599 | |
|---|
| 604 | 600 | /** |
|---|
| 605 | 601 | * hns_dsaf_tbl_tcam_data_cfg - tbl |
|---|
| 606 | | - * @dsaf_id: dsa fabric id |
|---|
| 602 | + * @dsaf_dev: dsa fabric id |
|---|
| 607 | 603 | * @ptbl_tcam_data: addr |
|---|
| 608 | 604 | */ |
|---|
| 609 | 605 | static void hns_dsaf_tbl_tcam_data_cfg( |
|---|
| .. | .. |
|---|
| 618 | 614 | |
|---|
| 619 | 615 | /** |
|---|
| 620 | 616 | * dsaf_tbl_tcam_mcast_cfg - tbl |
|---|
| 621 | | - * @dsaf_id: dsa fabric id |
|---|
| 622 | | - * @ptbl_tcam_mcast: addr |
|---|
| 617 | + * @dsaf_dev: dsa fabric id |
|---|
| 618 | + * @mcast: addr |
|---|
| 623 | 619 | */ |
|---|
| 624 | 620 | static void hns_dsaf_tbl_tcam_mcast_cfg( |
|---|
| 625 | 621 | struct dsaf_device *dsaf_dev, |
|---|
| .. | .. |
|---|
| 652 | 648 | |
|---|
| 653 | 649 | /** |
|---|
| 654 | 650 | * hns_dsaf_tbl_tcam_ucast_cfg - tbl |
|---|
| 655 | | - * @dsaf_id: dsa fabric id |
|---|
| 656 | | - * @ptbl_tcam_ucast: addr |
|---|
| 651 | + * @dsaf_dev: dsa fabric id |
|---|
| 652 | + * @tbl_tcam_ucast: addr |
|---|
| 657 | 653 | */ |
|---|
| 658 | 654 | static void hns_dsaf_tbl_tcam_ucast_cfg( |
|---|
| 659 | 655 | struct dsaf_device *dsaf_dev, |
|---|
| .. | .. |
|---|
| 678 | 674 | |
|---|
| 679 | 675 | /** |
|---|
| 680 | 676 | * hns_dsaf_tbl_line_cfg - tbl |
|---|
| 681 | | - * @dsaf_id: dsa fabric id |
|---|
| 682 | | - * @ptbl_lin: addr |
|---|
| 677 | + * @dsaf_dev: dsa fabric id |
|---|
| 678 | + * @tbl_lin: addr |
|---|
| 683 | 679 | */ |
|---|
| 684 | 680 | static void hns_dsaf_tbl_line_cfg(struct dsaf_device *dsaf_dev, |
|---|
| 685 | 681 | struct dsaf_tbl_line_cfg *tbl_lin) |
|---|
| .. | .. |
|---|
| 699 | 695 | |
|---|
| 700 | 696 | /** |
|---|
| 701 | 697 | * hns_dsaf_tbl_tcam_mcast_pul - tbl |
|---|
| 702 | | - * @dsaf_id: dsa fabric id |
|---|
| 698 | + * @dsaf_dev: dsa fabric id |
|---|
| 703 | 699 | */ |
|---|
| 704 | 700 | static void hns_dsaf_tbl_tcam_mcast_pul(struct dsaf_device *dsaf_dev) |
|---|
| 705 | 701 | { |
|---|
| .. | .. |
|---|
| 714 | 710 | |
|---|
| 715 | 711 | /** |
|---|
| 716 | 712 | * hns_dsaf_tbl_line_pul - tbl |
|---|
| 717 | | - * @dsaf_id: dsa fabric id |
|---|
| 713 | + * @dsaf_dev: dsa fabric id |
|---|
| 718 | 714 | */ |
|---|
| 719 | 715 | static void hns_dsaf_tbl_line_pul(struct dsaf_device *dsaf_dev) |
|---|
| 720 | 716 | { |
|---|
| .. | .. |
|---|
| 729 | 725 | |
|---|
| 730 | 726 | /** |
|---|
| 731 | 727 | * hns_dsaf_tbl_tcam_data_mcast_pul - tbl |
|---|
| 732 | | - * @dsaf_id: dsa fabric id |
|---|
| 728 | + * @dsaf_dev: dsa fabric id |
|---|
| 733 | 729 | */ |
|---|
| 734 | 730 | static void hns_dsaf_tbl_tcam_data_mcast_pul( |
|---|
| 735 | 731 | struct dsaf_device *dsaf_dev) |
|---|
| .. | .. |
|---|
| 747 | 743 | |
|---|
| 748 | 744 | /** |
|---|
| 749 | 745 | * hns_dsaf_tbl_tcam_data_ucast_pul - tbl |
|---|
| 750 | | - * @dsaf_id: dsa fabric id |
|---|
| 746 | + * @dsaf_dev: dsa fabric id |
|---|
| 751 | 747 | */ |
|---|
| 752 | 748 | static void hns_dsaf_tbl_tcam_data_ucast_pul( |
|---|
| 753 | 749 | struct dsaf_device *dsaf_dev) |
|---|
| .. | .. |
|---|
| 772 | 768 | |
|---|
| 773 | 769 | /** |
|---|
| 774 | 770 | * hns_dsaf_tbl_stat_en - tbl |
|---|
| 775 | | - * @dsaf_id: dsa fabric id |
|---|
| 776 | | - * @ptbl_stat_en: addr |
|---|
| 771 | + * @dsaf_dev: dsa fabric id |
|---|
| 777 | 772 | */ |
|---|
| 778 | 773 | static void hns_dsaf_tbl_stat_en(struct dsaf_device *dsaf_dev) |
|---|
| 779 | 774 | { |
|---|
| .. | .. |
|---|
| 789 | 784 | |
|---|
| 790 | 785 | /** |
|---|
| 791 | 786 | * hns_dsaf_rocee_bp_en - rocee back press enable |
|---|
| 792 | | - * @dsaf_id: dsa fabric id |
|---|
| 787 | + * @dsaf_dev: dsa fabric id |
|---|
| 793 | 788 | */ |
|---|
| 794 | 789 | static void hns_dsaf_rocee_bp_en(struct dsaf_device *dsaf_dev) |
|---|
| 795 | 790 | { |
|---|
| .. | .. |
|---|
| 856 | 851 | |
|---|
| 857 | 852 | /** |
|---|
| 858 | 853 | * hns_dsaf_single_line_tbl_cfg - INT |
|---|
| 859 | | - * @dsaf_id: dsa fabric id |
|---|
| 860 | | - * @address: |
|---|
| 861 | | - * @ptbl_line: |
|---|
| 854 | + * @dsaf_dev: dsa fabric id |
|---|
| 855 | + * @address: the address |
|---|
| 856 | + * @ptbl_line: the line |
|---|
| 862 | 857 | */ |
|---|
| 863 | 858 | static void hns_dsaf_single_line_tbl_cfg( |
|---|
| 864 | 859 | struct dsaf_device *dsaf_dev, |
|---|
| .. | .. |
|---|
| 880 | 875 | |
|---|
| 881 | 876 | /** |
|---|
| 882 | 877 | * hns_dsaf_tcam_uc_cfg - INT |
|---|
| 883 | | - * @dsaf_id: dsa fabric id |
|---|
| 884 | | - * @address, |
|---|
| 885 | | - * @ptbl_tcam_data, |
|---|
| 878 | + * @dsaf_dev: dsa fabric id |
|---|
| 879 | + * @address: the address |
|---|
| 880 | + * @ptbl_tcam_data: the data |
|---|
| 881 | + * @ptbl_tcam_ucast: unicast |
|---|
| 886 | 882 | */ |
|---|
| 887 | 883 | static void hns_dsaf_tcam_uc_cfg( |
|---|
| 888 | 884 | struct dsaf_device *dsaf_dev, u32 address, |
|---|
| .. | .. |
|---|
| 908 | 904 | * @dsaf_dev: dsa fabric device struct pointer |
|---|
| 909 | 905 | * @address: tcam index |
|---|
| 910 | 906 | * @ptbl_tcam_data: tcam data struct pointer |
|---|
| 911 | | - * @ptbl_tcam_mcast: tcam mask struct pointer, it must be null for HNSv1 |
|---|
| 907 | + * @ptbl_tcam_mask: tcam mask struct pointer, it must be null for HNSv1 |
|---|
| 908 | + * @ptbl_tcam_mcast: tcam data struct pointer |
|---|
| 912 | 909 | */ |
|---|
| 913 | 910 | static void hns_dsaf_tcam_mc_cfg( |
|---|
| 914 | 911 | struct dsaf_device *dsaf_dev, u32 address, |
|---|
| .. | .. |
|---|
| 937 | 934 | /** |
|---|
| 938 | 935 | * hns_dsaf_tcam_uc_cfg_vague - INT |
|---|
| 939 | 936 | * @dsaf_dev: dsa fabric device struct pointer |
|---|
| 940 | | - * @address, |
|---|
| 941 | | - * @ptbl_tcam_data, |
|---|
| 937 | + * @address: the address |
|---|
| 938 | + * @tcam_data: the data |
|---|
| 939 | + * @tcam_mask: the mask |
|---|
| 940 | + * @tcam_uc: the unicast data |
|---|
| 942 | 941 | */ |
|---|
| 943 | 942 | static void hns_dsaf_tcam_uc_cfg_vague(struct dsaf_device *dsaf_dev, |
|---|
| 944 | 943 | u32 address, |
|---|
| .. | .. |
|---|
| 964 | 963 | /** |
|---|
| 965 | 964 | * hns_dsaf_tcam_mc_cfg_vague - INT |
|---|
| 966 | 965 | * @dsaf_dev: dsa fabric device struct pointer |
|---|
| 967 | | - * @address, |
|---|
| 968 | | - * @ptbl_tcam_data, |
|---|
| 969 | | - * @ptbl_tcam_mask |
|---|
| 970 | | - * @ptbl_tcam_mcast |
|---|
| 966 | + * @address: the address |
|---|
| 967 | + * @tcam_data: the data |
|---|
| 968 | + * @tcam_mask: the mask |
|---|
| 969 | + * @tcam_mc: the multicast data |
|---|
| 971 | 970 | */ |
|---|
| 972 | 971 | static void hns_dsaf_tcam_mc_cfg_vague(struct dsaf_device *dsaf_dev, |
|---|
| 973 | 972 | u32 address, |
|---|
| .. | .. |
|---|
| 992 | 991 | |
|---|
| 993 | 992 | /** |
|---|
| 994 | 993 | * hns_dsaf_tcam_mc_invld - INT |
|---|
| 995 | | - * @dsaf_id: dsa fabric id |
|---|
| 996 | | - * @address |
|---|
| 994 | + * @dsaf_dev: dsa fabric id |
|---|
| 995 | + * @address: the address |
|---|
| 997 | 996 | */ |
|---|
| 998 | 997 | static void hns_dsaf_tcam_mc_invld(struct dsaf_device *dsaf_dev, u32 address) |
|---|
| 999 | 998 | { |
|---|
| .. | .. |
|---|
| 1028 | 1027 | |
|---|
| 1029 | 1028 | /** |
|---|
| 1030 | 1029 | * hns_dsaf_tcam_uc_get - INT |
|---|
| 1031 | | - * @dsaf_id: dsa fabric id |
|---|
| 1032 | | - * @address |
|---|
| 1033 | | - * @ptbl_tcam_data |
|---|
| 1034 | | - * @ptbl_tcam_ucast |
|---|
| 1030 | + * @dsaf_dev: dsa fabric id |
|---|
| 1031 | + * @address: the address |
|---|
| 1032 | + * @ptbl_tcam_data: the data |
|---|
| 1033 | + * @ptbl_tcam_ucast: unicast |
|---|
| 1035 | 1034 | */ |
|---|
| 1036 | 1035 | static void hns_dsaf_tcam_uc_get( |
|---|
| 1037 | 1036 | struct dsaf_device *dsaf_dev, u32 address, |
|---|
| .. | .. |
|---|
| 1081 | 1080 | |
|---|
| 1082 | 1081 | /** |
|---|
| 1083 | 1082 | * hns_dsaf_tcam_mc_get - INT |
|---|
| 1084 | | - * @dsaf_id: dsa fabric id |
|---|
| 1085 | | - * @address |
|---|
| 1086 | | - * @ptbl_tcam_data |
|---|
| 1087 | | - * @ptbl_tcam_ucast |
|---|
| 1083 | + * @dsaf_dev: dsa fabric id |
|---|
| 1084 | + * @address: the address |
|---|
| 1085 | + * @ptbl_tcam_data: the data |
|---|
| 1086 | + * @ptbl_tcam_mcast: tcam multicast data |
|---|
| 1088 | 1087 | */ |
|---|
| 1089 | 1088 | static void hns_dsaf_tcam_mc_get( |
|---|
| 1090 | 1089 | struct dsaf_device *dsaf_dev, u32 address, |
|---|
| .. | .. |
|---|
| 1131 | 1130 | |
|---|
| 1132 | 1131 | /** |
|---|
| 1133 | 1132 | * hns_dsaf_tbl_line_init - INT |
|---|
| 1134 | | - * @dsaf_id: dsa fabric id |
|---|
| 1133 | + * @dsaf_dev: dsa fabric id |
|---|
| 1135 | 1134 | */ |
|---|
| 1136 | 1135 | static void hns_dsaf_tbl_line_init(struct dsaf_device *dsaf_dev) |
|---|
| 1137 | 1136 | { |
|---|
| .. | .. |
|---|
| 1145 | 1144 | |
|---|
| 1146 | 1145 | /** |
|---|
| 1147 | 1146 | * hns_dsaf_tbl_tcam_init - INT |
|---|
| 1148 | | - * @dsaf_id: dsa fabric id |
|---|
| 1147 | + * @dsaf_dev: dsa fabric id |
|---|
| 1149 | 1148 | */ |
|---|
| 1150 | 1149 | static void hns_dsaf_tbl_tcam_init(struct dsaf_device *dsaf_dev) |
|---|
| 1151 | 1150 | { |
|---|
| .. | .. |
|---|
| 1160 | 1159 | |
|---|
| 1161 | 1160 | /** |
|---|
| 1162 | 1161 | * hns_dsaf_pfc_en_cfg - dsaf pfc pause cfg |
|---|
| 1163 | | - * @mac_cb: mac contrl block |
|---|
| 1162 | + * @dsaf_dev: dsa fabric id |
|---|
| 1163 | + * @mac_id: mac contrl block |
|---|
| 1164 | + * @tc_en: traffic class |
|---|
| 1164 | 1165 | */ |
|---|
| 1165 | 1166 | static void hns_dsaf_pfc_en_cfg(struct dsaf_device *dsaf_dev, |
|---|
| 1166 | 1167 | int mac_id, int tc_en) |
|---|
| .. | .. |
|---|
| 1213 | 1214 | |
|---|
| 1214 | 1215 | /** |
|---|
| 1215 | 1216 | * hns_dsaf_tbl_tcam_init - INT |
|---|
| 1216 | | - * @dsaf_id: dsa fabric id |
|---|
| 1217 | | - * @dsaf_mode |
|---|
| 1217 | + * @dsaf_dev: dsa fabric id |
|---|
| 1218 | 1218 | */ |
|---|
| 1219 | 1219 | static void hns_dsaf_comm_init(struct dsaf_device *dsaf_dev) |
|---|
| 1220 | 1220 | { |
|---|
| .. | .. |
|---|
| 1267 | 1267 | |
|---|
| 1268 | 1268 | /** |
|---|
| 1269 | 1269 | * hns_dsaf_inode_init - INT |
|---|
| 1270 | | - * @dsaf_id: dsa fabric id |
|---|
| 1270 | + * @dsaf_dev: dsa fabric id |
|---|
| 1271 | 1271 | */ |
|---|
| 1272 | 1272 | static void hns_dsaf_inode_init(struct dsaf_device *dsaf_dev) |
|---|
| 1273 | 1273 | { |
|---|
| .. | .. |
|---|
| 1319 | 1319 | |
|---|
| 1320 | 1320 | /** |
|---|
| 1321 | 1321 | * hns_dsaf_sbm_init - INT |
|---|
| 1322 | | - * @dsaf_id: dsa fabric id |
|---|
| 1322 | + * @dsaf_dev: dsa fabric id |
|---|
| 1323 | 1323 | */ |
|---|
| 1324 | 1324 | static int hns_dsaf_sbm_init(struct dsaf_device *dsaf_dev) |
|---|
| 1325 | 1325 | { |
|---|
| .. | .. |
|---|
| 1373 | 1373 | |
|---|
| 1374 | 1374 | /** |
|---|
| 1375 | 1375 | * hns_dsaf_tbl_init - INT |
|---|
| 1376 | | - * @dsaf_id: dsa fabric id |
|---|
| 1376 | + * @dsaf_dev: dsa fabric id |
|---|
| 1377 | 1377 | */ |
|---|
| 1378 | 1378 | static void hns_dsaf_tbl_init(struct dsaf_device *dsaf_dev) |
|---|
| 1379 | 1379 | { |
|---|
| .. | .. |
|---|
| 1385 | 1385 | |
|---|
| 1386 | 1386 | /** |
|---|
| 1387 | 1387 | * hns_dsaf_voq_init - INT |
|---|
| 1388 | | - * @dsaf_id: dsa fabric id |
|---|
| 1388 | + * @dsaf_dev: dsa fabric id |
|---|
| 1389 | 1389 | */ |
|---|
| 1390 | 1390 | static void hns_dsaf_voq_init(struct dsaf_device *dsaf_dev) |
|---|
| 1391 | 1391 | { |
|---|
| .. | .. |
|---|
| 1439 | 1439 | /** |
|---|
| 1440 | 1440 | * hns_dsaf_init - init dsa fabric |
|---|
| 1441 | 1441 | * @dsaf_dev: dsa fabric device struct pointer |
|---|
| 1442 | | - * retuen 0 - success , negative --fail |
|---|
| 1442 | + * return 0 - success , negative --fail |
|---|
| 1443 | 1443 | */ |
|---|
| 1444 | 1444 | static int hns_dsaf_init(struct dsaf_device *dsaf_dev) |
|---|
| 1445 | 1445 | { |
|---|
| .. | .. |
|---|
| 1602 | 1602 | DSAF_TBL_TCAM_KEY_VLAN_S, vlan_id); |
|---|
| 1603 | 1603 | dsaf_set_field(mac_key->low.bits.port_vlan, DSAF_TBL_TCAM_KEY_PORT_M, |
|---|
| 1604 | 1604 | DSAF_TBL_TCAM_KEY_PORT_S, port); |
|---|
| 1605 | | - |
|---|
| 1606 | | - mac_key->low.bits.port_vlan = le16_to_cpu(mac_key->low.bits.port_vlan); |
|---|
| 1607 | 1605 | } |
|---|
| 1608 | 1606 | |
|---|
| 1609 | 1607 | /** |
|---|
| .. | .. |
|---|
| 1663 | 1661 | /* default config dvc to 0 */ |
|---|
| 1664 | 1662 | mac_data.tbl_ucast_dvc = 0; |
|---|
| 1665 | 1663 | mac_data.tbl_ucast_out_port = mac_entry->port_num; |
|---|
| 1666 | | - tcam_data.tbl_tcam_data_high = cpu_to_le32(mac_key.high.val); |
|---|
| 1667 | | - tcam_data.tbl_tcam_data_low = cpu_to_le32(mac_key.low.val); |
|---|
| 1664 | + tcam_data.tbl_tcam_data_high = mac_key.high.val; |
|---|
| 1665 | + tcam_data.tbl_tcam_data_low = mac_key.low.val; |
|---|
| 1668 | 1666 | |
|---|
| 1669 | 1667 | hns_dsaf_tcam_uc_cfg(dsaf_dev, entry_index, &tcam_data, &mac_data); |
|---|
| 1670 | 1668 | |
|---|
| .. | .. |
|---|
| 1730 | 1728 | u8 port_num, u8 *mask, u8 *addr) |
|---|
| 1731 | 1729 | { |
|---|
| 1732 | 1730 | if (MAC_IS_BROADCAST(addr)) |
|---|
| 1733 | | - memset(mask, 0xff, ETH_ALEN); |
|---|
| 1731 | + eth_broadcast_addr(mask); |
|---|
| 1734 | 1732 | else |
|---|
| 1735 | 1733 | memcpy(mask, dsaf_dev->mac_cb[port_num]->mc_mask, ETH_ALEN); |
|---|
| 1736 | 1734 | } |
|---|
| .. | .. |
|---|
| 1786 | 1784 | 0xff, |
|---|
| 1787 | 1785 | mc_mask); |
|---|
| 1788 | 1786 | |
|---|
| 1789 | | - mask_key.high.val = le32_to_cpu(mask_key.high.val); |
|---|
| 1790 | | - mask_key.low.val = le32_to_cpu(mask_key.low.val); |
|---|
| 1791 | | - |
|---|
| 1792 | 1787 | pmask_key = (struct dsaf_tbl_tcam_data *)(&mask_key); |
|---|
| 1793 | 1788 | } |
|---|
| 1794 | 1789 | |
|---|
| .. | .. |
|---|
| 1840 | 1835 | dsaf_dev->ae_dev.name, mac_key.high.val, |
|---|
| 1841 | 1836 | mac_key.low.val, entry_index); |
|---|
| 1842 | 1837 | |
|---|
| 1843 | | - tcam_data.tbl_tcam_data_high = cpu_to_le32(mac_key.high.val); |
|---|
| 1844 | | - tcam_data.tbl_tcam_data_low = cpu_to_le32(mac_key.low.val); |
|---|
| 1838 | + tcam_data.tbl_tcam_data_high = mac_key.high.val; |
|---|
| 1839 | + tcam_data.tbl_tcam_data_low = mac_key.low.val; |
|---|
| 1845 | 1840 | |
|---|
| 1846 | 1841 | /* config mc entry with mask */ |
|---|
| 1847 | 1842 | hns_dsaf_tcam_mc_cfg(dsaf_dev, entry_index, &tcam_data, |
|---|
| .. | .. |
|---|
| 1956 | 1951 | /* config key mask */ |
|---|
| 1957 | 1952 | hns_dsaf_set_mac_key(dsaf_dev, &mask_key, 0x00, 0xff, mc_mask); |
|---|
| 1958 | 1953 | |
|---|
| 1959 | | - mask_key.high.val = le32_to_cpu(mask_key.high.val); |
|---|
| 1960 | | - mask_key.low.val = le32_to_cpu(mask_key.low.val); |
|---|
| 1961 | | - |
|---|
| 1962 | 1954 | pmask_key = (struct dsaf_tbl_tcam_data *)(&mask_key); |
|---|
| 1963 | 1955 | } |
|---|
| 1964 | 1956 | |
|---|
| .. | .. |
|---|
| 2012 | 2004 | soft_mac_entry += entry_index; |
|---|
| 2013 | 2005 | soft_mac_entry->index = DSAF_INVALID_ENTRY_IDX; |
|---|
| 2014 | 2006 | } else { /* not zero, just del port, update */ |
|---|
| 2015 | | - tcam_data.tbl_tcam_data_high = cpu_to_le32(mac_key.high.val); |
|---|
| 2016 | | - tcam_data.tbl_tcam_data_low = cpu_to_le32(mac_key.low.val); |
|---|
| 2007 | + tcam_data.tbl_tcam_data_high = mac_key.high.val; |
|---|
| 2008 | + tcam_data.tbl_tcam_data_low = mac_key.low.val; |
|---|
| 2017 | 2009 | |
|---|
| 2018 | 2010 | hns_dsaf_tcam_mc_cfg(dsaf_dev, entry_index, |
|---|
| 2019 | 2011 | &tcam_data, |
|---|
| .. | .. |
|---|
| 2111 | 2103 | |
|---|
| 2112 | 2104 | /** |
|---|
| 2113 | 2105 | * hns_dsaf_free_dev - free dev mem |
|---|
| 2114 | | - * @dev: struct device pointer |
|---|
| 2106 | + * @dsaf_dev: struct device pointer |
|---|
| 2115 | 2107 | */ |
|---|
| 2116 | 2108 | static void hns_dsaf_free_dev(struct dsaf_device *dsaf_dev) |
|---|
| 2117 | 2109 | { |
|---|
| .. | .. |
|---|
| 2120 | 2112 | |
|---|
| 2121 | 2113 | /** |
|---|
| 2122 | 2114 | * dsaf_pfc_unit_cnt - set pfc unit count |
|---|
| 2123 | | - * @dsaf_id: dsa fabric id |
|---|
| 2124 | | - * @pport_rate: value array |
|---|
| 2125 | | - * @pdsaf_pfc_unit_cnt: value array |
|---|
| 2115 | + * @dsaf_dev: dsa fabric id |
|---|
| 2116 | + * @mac_id: id in use |
|---|
| 2117 | + * @rate: value array |
|---|
| 2126 | 2118 | */ |
|---|
| 2127 | 2119 | static void hns_dsaf_pfc_unit_cnt(struct dsaf_device *dsaf_dev, int mac_id, |
|---|
| 2128 | 2120 | enum dsaf_port_rate_mode rate) |
|---|
| .. | .. |
|---|
| 2151 | 2143 | |
|---|
| 2152 | 2144 | /** |
|---|
| 2153 | 2145 | * dsaf_port_work_rate_cfg - fifo |
|---|
| 2154 | | - * @dsaf_id: dsa fabric id |
|---|
| 2155 | | - * @xge_ge_work_mode |
|---|
| 2146 | + * @dsaf_dev: dsa fabric id |
|---|
| 2147 | + * @mac_id: mac contrl block |
|---|
| 2148 | + * @rate_mode: value array |
|---|
| 2156 | 2149 | */ |
|---|
| 2157 | 2150 | static void |
|---|
| 2158 | 2151 | hns_dsaf_port_work_rate_cfg(struct dsaf_device *dsaf_dev, int mac_id, |
|---|
| .. | .. |
|---|
| 2265 | 2258 | |
|---|
| 2266 | 2259 | /** |
|---|
| 2267 | 2260 | *hns_dsaf_get_regs - dump dsaf regs |
|---|
| 2268 | | - *@dsaf_dev: dsaf device |
|---|
| 2261 | + *@ddev: dsaf device |
|---|
| 2262 | + *@port: port |
|---|
| 2269 | 2263 | *@data:data for value of regs |
|---|
| 2270 | 2264 | */ |
|---|
| 2271 | 2265 | void hns_dsaf_get_regs(struct dsaf_device *ddev, u32 port, void *data) |
|---|
| .. | .. |
|---|
| 2702 | 2696 | |
|---|
| 2703 | 2697 | /** |
|---|
| 2704 | 2698 | *hns_dsaf_get_sset_count - get dsaf string set count |
|---|
| 2699 | + *@dsaf_dev: dsaf device |
|---|
| 2705 | 2700 | *@stringset: type of values in data |
|---|
| 2706 | 2701 | *return dsaf string name count |
|---|
| 2707 | 2702 | */ |
|---|
| .. | .. |
|---|
| 2723 | 2718 | *@stringset:srting set index |
|---|
| 2724 | 2719 | *@data:strings name value |
|---|
| 2725 | 2720 | *@port:port index |
|---|
| 2721 | + *@dsaf_dev: dsaf device |
|---|
| 2726 | 2722 | */ |
|---|
| 2727 | 2723 | void hns_dsaf_get_strings(int stringset, u8 *data, int port, |
|---|
| 2728 | 2724 | struct dsaf_device *dsaf_dev) |
|---|
| .. | .. |
|---|
| 2955 | 2951 | /** |
|---|
| 2956 | 2952 | * dsaf_probe - probo dsaf dev |
|---|
| 2957 | 2953 | * @pdev: dasf platform device |
|---|
| 2958 | | - * retuen 0 - success , negative --fail |
|---|
| 2954 | + * return 0 - success , negative --fail |
|---|
| 2959 | 2955 | */ |
|---|
| 2960 | 2956 | static int hns_dsaf_probe(struct platform_device *pdev) |
|---|
| 2961 | 2957 | { |
|---|
| .. | .. |
|---|
| 3050 | 3046 | /** |
|---|
| 3051 | 3047 | * hns_dsaf_roce_reset - reset dsaf and roce |
|---|
| 3052 | 3048 | * @dsaf_fwnode: Pointer to framework node for the dasf |
|---|
| 3053 | | - * @enable: false - request reset , true - drop reset |
|---|
| 3054 | | - * retuen 0 - success , negative -fail |
|---|
| 3049 | + * @dereset: false - request reset , true - drop reset |
|---|
| 3050 | + * return 0 - success , negative -fail |
|---|
| 3055 | 3051 | */ |
|---|
| 3056 | 3052 | int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset) |
|---|
| 3057 | 3053 | { |
|---|
| .. | .. |
|---|
| 3061 | 3057 | u32 sl; |
|---|
| 3062 | 3058 | u32 credit; |
|---|
| 3063 | 3059 | int i; |
|---|
| 3064 | | - const u32 port_map[DSAF_ROCE_CREDIT_CHN][DSAF_ROCE_CHAN_MODE_NUM] = { |
|---|
| 3060 | + static const u32 port_map[DSAF_ROCE_CREDIT_CHN][DSAF_ROCE_CHAN_MODE_NUM] = { |
|---|
| 3065 | 3061 | {DSAF_ROCE_PORT_0, DSAF_ROCE_PORT_0, DSAF_ROCE_PORT_0}, |
|---|
| 3066 | 3062 | {DSAF_ROCE_PORT_1, DSAF_ROCE_PORT_0, DSAF_ROCE_PORT_0}, |
|---|
| 3067 | 3063 | {DSAF_ROCE_PORT_2, DSAF_ROCE_PORT_1, DSAF_ROCE_PORT_0}, |
|---|
| .. | .. |
|---|
| 3071 | 3067 | {DSAF_ROCE_PORT_5, DSAF_ROCE_PORT_3, DSAF_ROCE_PORT_1}, |
|---|
| 3072 | 3068 | {DSAF_ROCE_PORT_5, DSAF_ROCE_PORT_3, DSAF_ROCE_PORT_1}, |
|---|
| 3073 | 3069 | }; |
|---|
| 3074 | | - const u32 sl_map[DSAF_ROCE_CREDIT_CHN][DSAF_ROCE_CHAN_MODE_NUM] = { |
|---|
| 3070 | + static const u32 sl_map[DSAF_ROCE_CREDIT_CHN][DSAF_ROCE_CHAN_MODE_NUM] = { |
|---|
| 3075 | 3071 | {DSAF_ROCE_SL_0, DSAF_ROCE_SL_0, DSAF_ROCE_SL_0}, |
|---|
| 3076 | 3072 | {DSAF_ROCE_SL_0, DSAF_ROCE_SL_1, DSAF_ROCE_SL_1}, |
|---|
| 3077 | 3073 | {DSAF_ROCE_SL_0, DSAF_ROCE_SL_0, DSAF_ROCE_SL_2}, |
|---|