Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (c) 2014-2015 Hisilicon Limited.
0004  */
0005 
0006 #ifndef _HNS_DSAF_MAC_H
0007 #define _HNS_DSAF_MAC_H
0008 
0009 #include <linux/if_vlan.h>
0010 #include <linux/kernel.h>
0011 #include <linux/phy.h>
0012 #include <linux/regmap.h>
0013 #include "hns_dsaf_main.h"
0014 
0015 struct dsaf_device;
0016 
0017 #define MAC_GMAC_SUPPORTED \
0018     (SUPPORTED_10baseT_Half \
0019     | SUPPORTED_10baseT_Full \
0020     | SUPPORTED_100baseT_Half \
0021     | SUPPORTED_100baseT_Full \
0022     | SUPPORTED_Autoneg)
0023 
0024 #define MAC_DEFAULT_MTU (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN + ETH_DATA_LEN)
0025 #define MAC_MAX_MTU     9600
0026 #define MAC_MAX_MTU_V2      9728
0027 #define MAC_MIN_MTU     68
0028 #define MAC_MAX_MTU_DBG     MAC_DEFAULT_MTU
0029 
0030 #define MAC_DEFAULT_PAUSE_TIME 0xffff
0031 
0032 #define MAC_GMAC_IDX 0
0033 #define MAC_XGMAC_IDX 1
0034 
0035 #define ETH_STATIC_REG   1
0036 #define ETH_DUMP_REG     5
0037 /* check mac addr broadcast */
0038 #define MAC_IS_BROADCAST(p) ((*(p) == 0xff) && (*((p) + 1) == 0xff) && \
0039         (*((p) + 2) == 0xff) &&  (*((p) + 3) == 0xff)  && \
0040         (*((p) + 4) == 0xff) && (*((p) + 5) == 0xff))
0041 
0042 /* check mac addr is 01-00-5e-xx-xx-xx*/
0043 #define MAC_IS_L3_MULTICAST(p) ((*((p) + 0) == 0x01) && \
0044             (*((p) + 1) == 0x00)   && \
0045             (*((p) + 2) == 0x5e))
0046 
0047 /*check the mac addr is 0 in all bit*/
0048 #define MAC_IS_ALL_ZEROS(p)   ((*(p) == 0) && (*((p) + 1) == 0) && \
0049     (*((p) + 2) == 0) && (*((p) + 3) == 0) && \
0050     (*((p) + 4) == 0) && (*((p) + 5) == 0))
0051 
0052 /*check mac addr multicast*/
0053 #define MAC_IS_MULTICAST(p) ((*((u8 *)((p) + 0)) & 0x01) ? (1) : (0))
0054 
0055 struct mac_priv {
0056     void *mac;
0057 };
0058 
0059 /* net speed */
0060 enum mac_speed {
0061     MAC_SPEED_10    = 10,      /**< 10 Mbps */
0062     MAC_SPEED_100   = 100,    /**< 100 Mbps */
0063     MAC_SPEED_1000  = 1000,  /**< 1000 Mbps = 1 Gbps */
0064     MAC_SPEED_10000 = 10000  /**< 10000 Mbps = 10 Gbps */
0065 };
0066 
0067 /*mac interface keyword */
0068 enum mac_intf {
0069     MAC_IF_NONE  = 0x00000000,   /**< interface not invalid */
0070     MAC_IF_MII   = 0x00010000,   /**< MII interface */
0071     MAC_IF_RMII  = 0x00020000,   /**< RMII interface */
0072     MAC_IF_SMII  = 0x00030000,   /**< SMII interface */
0073     MAC_IF_GMII  = 0x00040000,   /**< GMII interface */
0074     MAC_IF_RGMII = 0x00050000,   /**< RGMII interface */
0075     MAC_IF_TBI   = 0x00060000,   /**< TBI interface */
0076     MAC_IF_RTBI  = 0x00070000,   /**< RTBI interface */
0077     MAC_IF_SGMII = 0x00080000,   /**< SGMII interface */
0078     MAC_IF_XGMII = 0x00090000,   /**< XGMII interface */
0079     MAC_IF_QSGMII = 0x000a0000  /**< QSGMII interface */
0080 };
0081 
0082 /*mac mode */
0083 enum mac_mode {
0084     /**< Invalid Ethernet mode */
0085     MAC_MODE_INVALID     = 0,
0086     /**<    10 Mbps MII   */
0087     MAC_MODE_MII_10   = (MAC_IF_MII   | MAC_SPEED_10),
0088     /**<   100 Mbps MII   */
0089     MAC_MODE_MII_100     = (MAC_IF_MII   | MAC_SPEED_100),
0090     /**<    10 Mbps RMII  */
0091     MAC_MODE_RMII_10     = (MAC_IF_RMII  | MAC_SPEED_10),
0092     /**<   100 Mbps RMII  */
0093     MAC_MODE_RMII_100   = (MAC_IF_RMII  | MAC_SPEED_100),
0094     /**<    10 Mbps SMII  */
0095     MAC_MODE_SMII_10     = (MAC_IF_SMII  | MAC_SPEED_10),
0096     /**<   100 Mbps SMII  */
0097     MAC_MODE_SMII_100   = (MAC_IF_SMII  | MAC_SPEED_100),
0098     /**<  1000 Mbps GMII  */
0099     MAC_MODE_GMII_1000   = (MAC_IF_GMII  | MAC_SPEED_1000),
0100     /**<    10 Mbps RGMII */
0101     MAC_MODE_RGMII_10   = (MAC_IF_RGMII | MAC_SPEED_10),
0102     /**<   100 Mbps RGMII */
0103     MAC_MODE_RGMII_100   = (MAC_IF_RGMII | MAC_SPEED_100),
0104     /**<  1000 Mbps RGMII */
0105     MAC_MODE_RGMII_1000  = (MAC_IF_RGMII | MAC_SPEED_1000),
0106     /**<  1000 Mbps TBI   */
0107     MAC_MODE_TBI_1000   = (MAC_IF_TBI   | MAC_SPEED_1000),
0108     /**<  1000 Mbps RTBI  */
0109     MAC_MODE_RTBI_1000   = (MAC_IF_RTBI  | MAC_SPEED_1000),
0110     /**<    10 Mbps SGMII */
0111     MAC_MODE_SGMII_10   = (MAC_IF_SGMII | MAC_SPEED_10),
0112     /**<   100 Mbps SGMII */
0113     MAC_MODE_SGMII_100   = (MAC_IF_SGMII | MAC_SPEED_100),
0114     /**<  1000 Mbps SGMII */
0115     MAC_MODE_SGMII_1000  = (MAC_IF_SGMII | MAC_SPEED_1000),
0116     /**< 10000 Mbps XGMII */
0117     MAC_MODE_XGMII_10000 = (MAC_IF_XGMII | MAC_SPEED_10000),
0118     /**<  1000 Mbps QSGMII */
0119     MAC_MODE_QSGMII_1000 = (MAC_IF_QSGMII | MAC_SPEED_1000)
0120 };
0121 
0122 /*mac communicate mode*/
0123 enum mac_commom_mode {
0124     MAC_COMM_MODE_NONE    = 0, /**< No transmit/receive communication */
0125     MAC_COMM_MODE_RX        = 1, /**< Only receive communication */
0126     MAC_COMM_MODE_TX        = 2, /**< Only transmit communication */
0127     MAC_COMM_MODE_RX_AND_TX = 3  /**< Both tx and rx communication */
0128 };
0129 
0130 /*mac statistics */
0131 struct mac_statistics {
0132     u64  stat_pkts64; /* r-10G tr-DT 64 byte frame counter */
0133     u64  stat_pkts65to127; /* r-10G 65 to 127 byte frame counter */
0134     u64  stat_pkts128to255; /* r-10G 128 to 255 byte frame counter */
0135     u64  stat_pkts256to511; /*r-10G 256 to 511 byte frame counter */
0136     u64  stat_pkts512to1023;/* r-10G 512 to 1023 byte frame counter */
0137     u64  stat_pkts1024to1518; /* r-10G 1024 to 1518 byte frame counter */
0138     u64  stat_pkts1519to1522; /* r-10G 1519 to 1522 byte good frame count*/
0139     /* Total number of packets that were less than 64 octets */
0140     /*          long with a wrong CRC.*/
0141     u64  stat_fragments;
0142     /* Total number of packets longer than valid maximum length octets */
0143     u64  stat_jabbers;
0144     /* number of dropped packets due to internal errors of */
0145     /*          the MAC Client. */
0146     u64  stat_drop_events;
0147     /* Incremented when frames of correct length but with */
0148     /*          CRC error are received.*/
0149     u64  stat_crc_align_errors;
0150     /* Total number of packets that were less than 64 octets */
0151     /*          long with a good CRC.*/
0152     u64  stat_undersize_pkts;
0153     u64  stat_oversize_pkts;  /**< T,B.D*/
0154 
0155     u64  stat_rx_pause;        /**< Pause MAC Control received */
0156     u64  stat_tx_pause;        /**< Pause MAC Control sent */
0157 
0158     u64  in_octets;     /**< Total number of byte received. */
0159     u64  in_pkts;       /* Total number of packets received.*/
0160     u64  in_mcast_pkts; /* Total number of multicast frame received */
0161     u64  in_bcast_pkts; /* Total number of broadcast frame received */
0162                 /* Frames received, but discarded due to */
0163                 /* problems within the MAC RX. */
0164     u64  in_discards;
0165     u64  in_errors;     /* Number of frames received with error: */
0166                 /*  - FIFO Overflow Error */
0167                 /*  - CRC Error */
0168                 /*  - Frame Too Long Error */
0169                 /*  - Alignment Error */
0170     u64  out_octets; /*Total number of byte sent. */
0171     u64  out_pkts;  /**< Total number of packets sent .*/
0172     u64  out_mcast_pkts; /* Total number of multicast frame sent */
0173     u64  out_bcast_pkts; /* Total number of multicast frame sent */
0174     /* Frames received, but discarded due to problems within */
0175     /*          the MAC TX N/A!.*/
0176     u64  out_discards;
0177     u64  out_errors;    /*Number of frames transmitted with error: */
0178             /*  - FIFO Overflow Error */
0179             /*  - FIFO Underflow Error */
0180             /*   - Other */
0181 };
0182 
0183 /*mac para struct ,mac get param from nic or dsaf when initialize*/
0184 struct mac_params {
0185     char addr[ETH_ALEN];
0186     u8 __iomem *vaddr; /*virtual address*/
0187     struct device *dev;
0188     u8 mac_id;
0189     /**< Ethernet operation mode (MAC-PHY interface and speed) */
0190     enum mac_mode mac_mode;
0191 };
0192 
0193 struct mac_info {
0194     u16 speed;/* The forced speed (lower bits) in */
0195         /*       *mbps. Please use */
0196         /*       * ethtool_cmd_speed()/_set() to */
0197         /*       * access it */
0198     u8 duplex;      /* Duplex, half or full */
0199     u8 auto_neg;    /* Enable or disable autonegotiation */
0200     enum hnae_loop loop_mode;
0201     u8 tx_pause_en;
0202     u8 tx_pause_time;
0203     u8 rx_pause_en;
0204     u8 pad_and_crc_en;
0205     u8 promiscuous_en;
0206     u8 port_en;  /*port enable*/
0207 };
0208 
0209 struct mac_entry_idx {
0210     u8 addr[ETH_ALEN];
0211     u16 vlan_id:12;
0212     u16 valid:1;
0213     u16 qos:3;
0214 };
0215 
0216 struct mac_hw_stats {
0217     u64 rx_good_pkts;   /* only for xgmac */
0218     u64 rx_good_bytes;
0219     u64 rx_total_pkts;  /* only for xgmac */
0220     u64 rx_total_bytes; /* only for xgmac */
0221     u64 rx_bad_bytes;   /* only for gmac */
0222     u64 rx_uc_pkts;
0223     u64 rx_mc_pkts;
0224     u64 rx_bc_pkts;
0225     u64 rx_fragment_err;    /* only for xgmac */
0226     u64 rx_undersize;   /* only for xgmac */
0227     u64 rx_under_min;
0228     u64 rx_minto64;     /* only for gmac */
0229     u64 rx_64bytes;
0230     u64 rx_65to127;
0231     u64 rx_128to255;
0232     u64 rx_256to511;
0233     u64 rx_512to1023;
0234     u64 rx_1024to1518;
0235     u64 rx_1519tomax;
0236     u64 rx_1519tomax_good;  /* only for xgmac */
0237     u64 rx_oversize;
0238     u64 rx_jabber_err;
0239     u64 rx_fcs_err;
0240     u64 rx_vlan_pkts;   /* only for gmac */
0241     u64 rx_data_err;    /* only for gmac */
0242     u64 rx_align_err;   /* only for gmac */
0243     u64 rx_long_err;    /* only for gmac */
0244     u64 rx_pfc_tc0;
0245     u64 rx_pfc_tc1;     /* only for xgmac */
0246     u64 rx_pfc_tc2;     /* only for xgmac */
0247     u64 rx_pfc_tc3;     /* only for xgmac */
0248     u64 rx_pfc_tc4;     /* only for xgmac */
0249     u64 rx_pfc_tc5;     /* only for xgmac */
0250     u64 rx_pfc_tc6;     /* only for xgmac */
0251     u64 rx_pfc_tc7;     /* only for xgmac */
0252     u64 rx_unknown_ctrl;
0253     u64 rx_filter_pkts; /* only for gmac */
0254     u64 rx_filter_bytes;    /* only for gmac */
0255     u64 rx_fifo_overrun_err;/* only for gmac */
0256     u64 rx_len_err;     /* only for gmac */
0257     u64 rx_comma_err;   /* only for gmac */
0258     u64 rx_symbol_err;  /* only for xgmac */
0259     u64 tx_good_to_sw;  /* only for xgmac */
0260     u64 tx_bad_to_sw;   /* only for xgmac */
0261     u64 rx_1731_pkts;   /* only for xgmac */
0262 
0263     u64 tx_good_bytes;
0264     u64 tx_good_pkts;   /* only for xgmac */
0265     u64 tx_total_bytes; /* only for xgmac */
0266     u64 tx_total_pkts;  /* only for xgmac */
0267     u64 tx_bad_bytes;   /* only for gmac */
0268     u64 tx_bad_pkts;    /* only for xgmac */
0269     u64 tx_uc_pkts;
0270     u64 tx_mc_pkts;
0271     u64 tx_bc_pkts;
0272     u64 tx_undersize;   /* only for xgmac */
0273     u64 tx_fragment_err;    /* only for xgmac */
0274     u64 tx_under_min_pkts;  /* only for gmac */
0275     u64 tx_64bytes;
0276     u64 tx_65to127;
0277     u64 tx_128to255;
0278     u64 tx_256to511;
0279     u64 tx_512to1023;
0280     u64 tx_1024to1518;
0281     u64 tx_1519tomax;
0282     u64 tx_1519tomax_good;  /* only for xgmac */
0283     u64 tx_oversize;    /* only for xgmac */
0284     u64 tx_jabber_err;
0285     u64 tx_underrun_err;    /* only for gmac */
0286     u64 tx_vlan;        /* only for gmac */
0287     u64 tx_crc_err;     /* only for gmac */
0288     u64 tx_pfc_tc0;
0289     u64 tx_pfc_tc1;     /* only for xgmac */
0290     u64 tx_pfc_tc2;     /* only for xgmac */
0291     u64 tx_pfc_tc3;     /* only for xgmac */
0292     u64 tx_pfc_tc4;     /* only for xgmac */
0293     u64 tx_pfc_tc5;     /* only for xgmac */
0294     u64 tx_pfc_tc6;     /* only for xgmac */
0295     u64 tx_pfc_tc7;     /* only for xgmac */
0296     u64 tx_ctrl;        /* only for xgmac */
0297     u64 tx_1731_pkts;   /* only for xgmac */
0298     u64 tx_1588_pkts;   /* only for xgmac */
0299     u64 rx_good_from_sw;    /* only for xgmac */
0300     u64 rx_bad_from_sw; /* only for xgmac */
0301 };
0302 
0303 struct hns_mac_cb {
0304     struct device *dev;
0305     struct dsaf_device *dsaf_dev;
0306     struct mac_priv priv;
0307     struct fwnode_handle *fw_port;
0308     u8 __iomem *vaddr;
0309     u8 __iomem *sys_ctl_vaddr;
0310     u8 __iomem *serdes_vaddr;
0311     struct regmap *serdes_ctrl;
0312     struct regmap *cpld_ctrl;
0313     char mc_mask[ETH_ALEN];
0314     u32 cpld_ctrl_reg;
0315     u32 port_rst_off;
0316     u32 port_mode_off;
0317     struct mac_entry_idx addr_entry_idx[DSAF_MAX_VM_NUM];
0318     u8 sfp_prsnt;
0319     u8 cpld_led_value;
0320     u8 mac_id;
0321 
0322     u8 link;
0323     u8 half_duplex;
0324     u16 speed;
0325     u16 max_speed;
0326     u16 max_frm;
0327     u16 tx_pause_frm_time;
0328     u32 if_support;
0329     u64 txpkt_for_led;
0330     u64 rxpkt_for_led;
0331     enum hnae_port_type mac_type;
0332     enum hnae_media_type media_type;
0333     phy_interface_t phy_if;
0334     enum hnae_loop loop_mode;
0335 
0336     struct phy_device *phy_dev;
0337 
0338     struct mac_hw_stats hw_stats;
0339 };
0340 
0341 struct mac_driver {
0342     /*init Mac when init nic or dsaf*/
0343     void (*mac_init)(void *mac_drv);
0344     /*remove mac when remove nic or dsaf*/
0345     void (*mac_free)(void *mac_drv);
0346     /*enable mac when enable nic or dsaf*/
0347     void (*mac_enable)(void *mac_drv, enum mac_commom_mode mode);
0348     /*disable mac when disable nic or dsaf*/
0349     void (*mac_disable)(void *mac_drv, enum mac_commom_mode mode);
0350     /* config mac address*/
0351     void (*set_mac_addr)(void *mac_drv, const char *mac_addr);
0352     /*adjust mac mode of port,include speed and duplex*/
0353     int (*adjust_link)(void *mac_drv, enum mac_speed speed,
0354                u32 full_duplex);
0355     /* need adjust link */
0356     bool (*need_adjust_link)(void *mac_drv, enum mac_speed speed,
0357                  int duplex);
0358     /* config autoegotaite mode of port*/
0359     void (*set_an_mode)(void *mac_drv, u8 enable);
0360     /* config loopbank mode */
0361     int (*config_loopback)(void *mac_drv, enum hnae_loop loop_mode,
0362                    u8 enable);
0363     /* config mtu*/
0364     void (*config_max_frame_length)(void *mac_drv, u16 newval);
0365     /*config PAD and CRC enable */
0366     void (*config_pad_and_crc)(void *mac_drv, u8 newval);
0367     /*config tx pause time,if pause_time is zero,disable tx pause enable*/
0368     void (*set_tx_auto_pause_frames)(void *mac_drv, u16 pause_time);
0369     /* config rx mode for promiscuous*/
0370     void (*set_promiscuous)(void *mac_drv, u8 enable);
0371     void (*mac_pausefrm_cfg)(void *mac_drv, u32 rx_en, u32 tx_en);
0372 
0373     void (*autoneg_stat)(void *mac_drv, u32 *enable);
0374     int (*set_pause_enable)(void *mac_drv, u32 rx_en, u32 tx_en);
0375     void (*get_pause_enable)(void *mac_drv, u32 *rx_en, u32 *tx_en);
0376     void (*get_link_status)(void *mac_drv, u32 *link_stat);
0377     /* get the imporant regs*/
0378     void (*get_regs)(void *mac_drv, void *data);
0379     int (*get_regs_count)(void);
0380     /* get strings name for ethtool statistic */
0381     void (*get_strings)(u32 stringset, u8 *data);
0382     /* get the number of strings*/
0383     int (*get_sset_count)(int stringset);
0384 
0385     /* get the statistic by ethtools*/
0386     void (*get_ethtool_stats)(void *mac_drv, u64 *data);
0387 
0388     /* get mac information */
0389     void (*get_info)(void *mac_drv, struct mac_info *mac_info);
0390 
0391     void (*update_stats)(void *mac_drv);
0392     int (*wait_fifo_clean)(void *mac_drv);
0393 
0394     enum mac_mode mac_mode;
0395     u8 mac_id;
0396     struct hns_mac_cb *mac_cb;
0397     u8 __iomem *io_base;
0398     unsigned int mac_en_flg;/*you'd better don't enable mac twice*/
0399     unsigned int virt_dev_num;
0400     struct device *dev;
0401 };
0402 
0403 struct mac_stats_string {
0404     const char desc[ETH_GSTRING_LEN];
0405     unsigned long offset;
0406 };
0407 
0408 #define MAC_MAKE_MODE(interface, speed) (enum mac_mode)((interface) | (speed))
0409 #define MAC_INTERFACE_FROM_MODE(mode) (enum mac_intf)((mode) & 0xFFFF0000)
0410 #define MAC_SPEED_FROM_MODE(mode) (enum mac_speed)((mode) & 0x0000FFFF)
0411 #define MAC_STATS_FIELD_OFF(field) (offsetof(struct mac_hw_stats, field))
0412 
0413 static inline struct mac_driver *hns_mac_get_drv(
0414     const struct hns_mac_cb *mac_cb)
0415 {
0416     return (struct mac_driver *)(mac_cb->priv.mac);
0417 }
0418 
0419 void *hns_gmac_config(struct hns_mac_cb *mac_cb,
0420               struct mac_params *mac_param);
0421 void *hns_xgmac_config(struct hns_mac_cb *mac_cb,
0422                struct mac_params *mac_param);
0423 
0424 int hns_mac_init(struct dsaf_device *dsaf_dev);
0425 void mac_adjust_link(struct net_device *net_dev);
0426 bool hns_mac_need_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex);
0427 void hns_mac_get_link_status(struct hns_mac_cb *mac_cb, u32 *link_status);
0428 int hns_mac_change_vf_addr(struct hns_mac_cb *mac_cb, u32 vmid,
0429                const char *addr);
0430 int hns_mac_set_multi(struct hns_mac_cb *mac_cb,
0431               u32 port_num, char *addr, bool enable);
0432 int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vm, bool enable);
0433 void hns_mac_start(struct hns_mac_cb *mac_cb);
0434 void hns_mac_stop(struct hns_mac_cb *mac_cb);
0435 void hns_mac_uninit(struct dsaf_device *dsaf_dev);
0436 void hns_mac_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex);
0437 void hns_mac_reset(struct hns_mac_cb *mac_cb);
0438 void hns_mac_get_autoneg(struct hns_mac_cb *mac_cb, u32 *auto_neg);
0439 void hns_mac_get_pauseparam(struct hns_mac_cb *mac_cb, u32 *rx_en, u32 *tx_en);
0440 int hns_mac_set_autoneg(struct hns_mac_cb *mac_cb, u8 enable);
0441 int hns_mac_set_pauseparam(struct hns_mac_cb *mac_cb, u32 rx_en, u32 tx_en);
0442 int hns_mac_set_mtu(struct hns_mac_cb *mac_cb, u32 new_mtu, u32 buf_size);
0443 int hns_mac_get_port_info(struct hns_mac_cb *mac_cb,
0444               u8 *auto_neg, u16 *speed, u8 *duplex);
0445 int hns_mac_config_mac_loopback(struct hns_mac_cb *mac_cb,
0446                 enum hnae_loop loop, int en);
0447 void hns_mac_update_stats(struct hns_mac_cb *mac_cb);
0448 void hns_mac_get_stats(struct hns_mac_cb *mac_cb, u64 *data);
0449 void hns_mac_get_strings(struct hns_mac_cb *mac_cb, int stringset, u8 *data);
0450 int hns_mac_get_sset_count(struct hns_mac_cb *mac_cb, int stringset);
0451 void hns_mac_get_regs(struct hns_mac_cb *mac_cb, void *data);
0452 int hns_mac_get_regs_count(struct hns_mac_cb *mac_cb);
0453 void hns_set_led_opt(struct hns_mac_cb *mac_cb);
0454 int hns_cpld_led_set_id(struct hns_mac_cb *mac_cb,
0455             enum hnae_led_state status);
0456 void hns_mac_set_promisc(struct hns_mac_cb *mac_cb, u8 en);
0457 int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb,
0458                    u8 vmid, u8 *port_num);
0459 int hns_mac_add_uc_addr(struct hns_mac_cb *mac_cb, u8 vf_id,
0460             const unsigned char *addr);
0461 int hns_mac_rm_uc_addr(struct hns_mac_cb *mac_cb, u8 vf_id,
0462                const unsigned char *addr);
0463 int hns_mac_clr_multicast(struct hns_mac_cb *mac_cb, int vfn);
0464 void hns_mac_enable(struct hns_mac_cb *mac_cb, enum mac_commom_mode mode);
0465 void hns_mac_disable(struct hns_mac_cb *mac_cb, enum mac_commom_mode mode);
0466 int hns_mac_wait_fifo_clean(struct hns_mac_cb *mac_cb);
0467 
0468 #endif /* _HNS_DSAF_MAC_H */