net: hns: add dsaf misc operation method
[deliverable/linux.git] / drivers / net / ethernet / hisilicon / hns / hns_dsaf_main.h
index f0502ba0a677674493d36957d269967d72bd9826..2e55b3cc451531a14792c5b6c741335f3fee73d1 100644 (file)
@@ -268,6 +268,27 @@ struct dsaf_int_stat {
 
 };
 
+struct dsaf_misc_op {
+       void (*cpld_set_led)(struct hns_mac_cb *mac_cb, int link_status,
+                            u16 speed, int data);
+       void (*cpld_reset_led)(struct hns_mac_cb *mac_cb);
+       int (*cpld_set_led_id)(struct hns_mac_cb *mac_cb,
+                              enum hnae_led_state status);
+       /* reset seris function, it will be reset if the dereseet is 0 */
+       void (*dsaf_reset)(struct dsaf_device *dsaf_dev, bool dereset);
+       void (*xge_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset);
+       void (*xge_core_srst)(struct dsaf_device *dsaf_dev, u32 port,
+                             bool dereset);
+       void (*ge_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset);
+       void (*ppe_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset);
+       void (*ppe_comm_srst)(struct dsaf_device *dsaf_dev, bool dereset);
+
+       phy_interface_t (*get_phy_if)(struct hns_mac_cb *mac_cb);
+       int (*get_sfp_prsnt)(struct hns_mac_cb *mac_cb, int *sfp_prsnt);
+
+       int (*cfg_serdes_loopback)(struct hns_mac_cb *mac_cb, bool en);
+};
+
 /* Dsaf device struct define ,and mac ->  dsaf */
 struct dsaf_device {
        struct device *dev;
@@ -292,6 +313,7 @@ struct dsaf_device {
        struct ppe_common_cb *ppe_common[DSAF_COMM_DEV_NUM];
        struct rcb_common_cb *rcb_common[DSAF_COMM_DEV_NUM];
        struct hns_mac_cb *mac_cb[DSAF_MAX_PORT_NUM];
+       struct dsaf_misc_op *misc_op;
 
        struct dsaf_hw_stats hw_stats[DSAF_NODE_NUM];
        struct dsaf_int_stat int_stat;
@@ -388,22 +410,11 @@ int hns_dsaf_get_mac_entry_by_index(
        u16 entry_index,
        struct dsaf_drv_mac_multi_dest_entry *mac_entry);
 
-void hns_dsaf_rst(struct dsaf_device *dsaf_dev, u32 val);
-
-void hns_ppe_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, u32 val);
-
-void hns_ppe_com_srst(struct ppe_common_cb *ppe_common, u32 val);
-
 void hns_dsaf_fix_mac_mode(struct hns_mac_cb *mac_cb);
 
 int hns_dsaf_ae_init(struct dsaf_device *dsaf_dev);
 void hns_dsaf_ae_uninit(struct dsaf_device *dsaf_dev);
 
-void hns_dsaf_xge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, u32 val);
-void hns_dsaf_ge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port, u32 val);
-void hns_dsaf_xge_core_srst_by_port(struct dsaf_device *dsaf_dev,
-                                   u32 port, u32 val);
-
 void hns_dsaf_update_stats(struct dsaf_device *dsaf_dev, u32 inode_num);
 
 int hns_dsaf_get_sset_count(int stringset);
This page took 0.027725 seconds and 5 git commands to generate.