hns_dsaf_misc.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * 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. */
  9. #ifndef _HNS_DSAF_MISC_H
  10. #define _HNS_DSAF_MISC_H
  11. #include <linux/of.h>
  12. #include <linux/of_address.h>
  13. #include <linux/platform_device.h>
  14. #include "hns_dsaf_mac.h"
  15. #define CPLD_ADDR_PORT_OFFSET 0x4
  16. #define HS_LED_ON 0xE
  17. #define HS_LED_OFF 0xF
  18. #define CPLD_LED_ON_VALUE 1
  19. #define CPLD_LED_DEFAULT_VALUE 0
  20. #define MAC_SFP_PORT_OFFSET 0x2
  21. #define DSAF_LED_SPEED_S 0
  22. #define DSAF_LED_SPEED_M (0x3 << DSAF_LED_SPEED_S)
  23. #define DSAF_LED_LINK_B 2
  24. #define DSAF_LED_DATA_B 4
  25. #define DSAF_LED_ANCHOR_B 5
  26. void hns_cpld_set_led(struct hns_mac_cb *mac_cb, int link_status,
  27. u16 speed, int data);
  28. void cpld_led_reset(struct hns_mac_cb *mac_cb);
  29. int cpld_set_led_id(struct hns_mac_cb *mac_cb,
  30. enum hnae_led_state status);
  31. int hns_mac_get_sfp_prsnt(struct hns_mac_cb *mac_cb, int *sfp_prsnt);
  32. #endif