enic_dev.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright 2011 Cisco Systems, Inc. All rights reserved. */
  3. #ifndef _ENIC_DEV_H_
  4. #define _ENIC_DEV_H_
  5. #include "vnic_dev.h"
  6. #include "vnic_vic.h"
  7. /*
  8. * Calls the devcmd function given by argument vnicdevcmdfn.
  9. * If vf argument is valid, it proxies the devcmd
  10. */
  11. #define ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnicdevcmdfn, ...) \
  12. do { \
  13. spin_lock_bh(&enic->devcmd_lock); \
  14. if (enic_is_valid_vf(enic, vf)) { \
  15. vnic_dev_cmd_proxy_by_index_start(enic->vdev, vf); \
  16. err = vnicdevcmdfn(enic->vdev, ##__VA_ARGS__); \
  17. vnic_dev_cmd_proxy_end(enic->vdev); \
  18. } else { \
  19. err = vnicdevcmdfn(enic->vdev, ##__VA_ARGS__); \
  20. } \
  21. spin_unlock_bh(&enic->devcmd_lock); \
  22. } while (0)
  23. int enic_dev_fw_info(struct enic *enic, struct vnic_devcmd_fw_info **fw_info);
  24. int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats);
  25. int enic_dev_add_station_addr(struct enic *enic);
  26. int enic_dev_del_station_addr(struct enic *enic);
  27. int enic_dev_packet_filter(struct enic *enic, int directed, int multicast,
  28. int broadcast, int promisc, int allmulti);
  29. int enic_dev_add_addr(struct enic *enic, const u8 *addr);
  30. int enic_dev_del_addr(struct enic *enic, const u8 *addr);
  31. int enic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid);
  32. int enic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid);
  33. int enic_dev_notify_unset(struct enic *enic);
  34. int enic_dev_hang_notify(struct enic *enic);
  35. int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
  36. int enic_dev_enable(struct enic *enic);
  37. int enic_dev_disable(struct enic *enic);
  38. int enic_dev_intr_coal_timer_info(struct enic *enic);
  39. int enic_dev_status_to_errno(int devcmd_status);
  40. #endif /* _ENIC_DEV_H_ */