hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * 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.
84 */
95
106 #include <linux/acpi.h>
....@@ -370,7 +366,7 @@
370366 static void hns_mac_param_get(struct mac_params *param,
371367 struct hns_mac_cb *mac_cb)
372368 {
373
- param->vaddr = (void *)mac_cb->vaddr;
369
+ param->vaddr = mac_cb->vaddr;
374370 param->mac_mode = hns_get_enet_interface(mac_cb);
375371 ether_addr_copy(param->addr, mac_cb->addr_entry_idx[0].addr);
376372 param->mac_id = mac_cb->mac_id;
....@@ -378,11 +374,12 @@
378374 }
379375
380376 /**
381
- *hns_mac_queue_config_bc_en - set broadcast rx&tx enable
382
- *@mac_cb: mac device
383
- *@queue: queue number
384
- *@en:enable
385
- *retuen 0 - success , negative --fail
377
+ * hns_mac_queue_config_bc_en - set broadcast rx&tx enable
378
+ * @mac_cb: mac device
379
+ * @port_num: queue number
380
+ * @vlan_id: vlan id`
381
+ * @enable: enable
382
+ * return 0 - success , negative --fail
386383 */
387384 static int hns_mac_port_config_bc_en(struct hns_mac_cb *mac_cb,
388385 u32 port_num, u16 vlan_id, bool enable)
....@@ -412,11 +409,11 @@
412409 }
413410
414411 /**
415
- *hns_mac_vm_config_bc_en - set broadcast rx&tx enable
416
- *@mac_cb: mac device
417
- *@vmid: vm id
418
- *@en:enable
419
- *retuen 0 - success , negative --fail
412
+ * hns_mac_vm_config_bc_en - set broadcast rx&tx enable
413
+ * @mac_cb: mac device
414
+ * @vmid: vm id
415
+ * @enable: enable
416
+ * return 0 - success , negative --fail
420417 */
421418 int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vmid, bool enable)
422419 {
....@@ -546,8 +543,8 @@
546543 /**
547544 * hns_mac_get_autoneg - get auto autonegotiation
548545 * @mac_cb: mac control block
549
- * @enable: enable or not
550
- * retuen 0 - success , negative --fail
546
+ * @auto_neg: output pointer to autoneg result
547
+ * return 0 - success , negative --fail
551548 */
552549 void hns_mac_get_autoneg(struct hns_mac_cb *mac_cb, u32 *auto_neg)
553550 {
....@@ -564,7 +561,7 @@
564561 * @mac_cb: mac control block
565562 * @rx_en: rx enable status
566563 * @tx_en: tx enable status
567
- * retuen 0 - success , negative --fail
564
+ * return 0 - success , negative --fail
568565 */
569566 void hns_mac_get_pauseparam(struct hns_mac_cb *mac_cb, u32 *rx_en, u32 *tx_en)
570567 {
....@@ -582,7 +579,7 @@
582579 * hns_mac_set_autoneg - set auto autonegotiation
583580 * @mac_cb: mac control block
584581 * @enable: enable or not
585
- * retuen 0 - success , negative --fail
582
+ * return 0 - success , negative --fail
586583 */
587584 int hns_mac_set_autoneg(struct hns_mac_cb *mac_cb, u8 enable)
588585 {
....@@ -627,7 +624,7 @@
627624 /**
628625 * hns_mac_init_ex - mac init
629626 * @mac_cb: mac control block
630
- * retuen 0 - success , negative --fail
627
+ * return 0 - success , negative --fail
631628 */
632629 static int hns_mac_init_ex(struct hns_mac_cb *mac_cb)
633630 {
....@@ -701,9 +698,9 @@
701698 return rc;
702699
703700 if (!strcmp(phy_type, phy_modes(PHY_INTERFACE_MODE_XGMII)))
704
- is_c45 = 1;
701
+ is_c45 = true;
705702 else if (!strcmp(phy_type, phy_modes(PHY_INTERFACE_MODE_SGMII)))
706
- is_c45 = 0;
703
+ is_c45 = false;
707704 else
708705 return -ENODATA;
709706
....@@ -804,7 +801,6 @@
804801 /**
805802 *hns_mac_get_info - get mac information from device node
806803 *@mac_cb: mac device
807
- *@np:device node
808804 * return: 0 --success, negative --fail
809805 */
810806 static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
....@@ -848,8 +844,8 @@
848844 */
849845 put_device(&mac_cb->phy_dev->mdio.dev);
850846
851
- dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
852
- mac_cb->mac_id, np->name);
847
+ dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
848
+ mac_cb->mac_id, np);
853849 }
854850 of_node_put(np);
855851
....@@ -866,8 +862,8 @@
866862 * if the phy_dev is found
867863 */
868864 put_device(&mac_cb->phy_dev->mdio.dev);
869
- dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
870
- mac_cb->mac_id, np->name);
865
+ dev_dbg(mac_cb->dev, "mac%d phy_node: %pOFn\n",
866
+ mac_cb->mac_id, np);
871867 }
872868 of_node_put(np);
873869
....@@ -955,7 +951,7 @@
955951 /**
956952 * hns_mac_get_mode - get mac mode
957953 * @phy_if: phy interface
958
- * retuen 0 - gmac, 1 - xgmac , negative --fail
954
+ * return 0 - gmac, 1 - xgmac , negative --fail
959955 */
960956 static int hns_mac_get_mode(phy_interface_t phy_if)
961957 {