/**1* aQuantia Corporation Network Driver2* Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7*8* (1) Redistributions of source code must retain the above9* copyright notice, this list of conditions and the following10* disclaimer.11*12* (2) Redistributions in binary form must reproduce the above13* copyright notice, this list of conditions and the following14* disclaimer in the documentation and/or other materials provided15* with the distribution.16*17* (3) The name of the author may not be used to endorse or promote18* products derived from this software without specific prior19* written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS22* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED23* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY25* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE27* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS28* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,29* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING30* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS31* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.32*/33#ifndef AQ_FW_H34#define AQ_FW_H3536struct aq_hw;3738typedef enum aq_fw_link_speed39{40aq_fw_none = 0,41aq_fw_100M = (1 << 0),42aq_fw_1G = (1 << 1),43aq_fw_2G5 = (1 << 2),44aq_fw_5G = (1 << 3),45aq_fw_10G = (1 << 4),46} aq_fw_link_speed_t;4748typedef enum aq_fw_link_fc49{50aq_fw_fc_none = 0,51aq_fw_fc_ENABLE_RX = BIT(0),52aq_fw_fc_ENABLE_TX = BIT(1),53aq_fw_fc_ENABLE_ALL = aq_fw_fc_ENABLE_RX | aq_fw_fc_ENABLE_TX,54} aq_fw_link_fc_t;5556#define aq_fw_speed_auto \57(aq_fw_100M | aq_fw_1G | aq_fw_2G5 | aq_fw_5G | aq_fw_10G)5859struct aq_firmware_ops60{61int (*reset)(struct aq_hw* hal);6263int (*set_mode)(struct aq_hw* hal, enum aq_hw_fw_mpi_state_e mode, aq_fw_link_speed_t speed);64int (*get_mode)(struct aq_hw* hal, enum aq_hw_fw_mpi_state_e* mode, aq_fw_link_speed_t* speed, aq_fw_link_fc_t* fc);6566int (*get_mac_addr)(struct aq_hw* hal, uint8_t* mac_addr);67int (*get_stats)(struct aq_hw* hal, struct aq_hw_stats_s* stats);6869int (*led_control)(struct aq_hw* hal, uint32_t mode);70};717273int aq_fw_reset(struct aq_hw* hw);74int aq_fw_ops_init(struct aq_hw* hw);7576#endif // AQ_FW_H777879