#define HCLGE_NIC_CMQ_DESC_NUM 1024
#define HCLGE_NIC_CMQ_DESC_NUM_S 3
-#define HCLGE_LED_PORT_SPEED_STATE_S 0
-#define HCLGE_LED_PORT_SPEED_STATE_M GENMASK(5, 0)
-#define HCLGE_LED_ACTIVITY_STATE_S 0
-#define HCLGE_LED_ACTIVITY_STATE_M GENMASK(1, 0)
-#define HCLGE_LED_LINK_STATE_S 0
-#define HCLGE_LED_LINK_STATE_M GENMASK(1, 0)
#define HCLGE_LED_LOCATE_STATE_S 0
#define HCLGE_LED_LOCATE_STATE_M GENMASK(1, 0)
struct hclge_set_led_state_cmd {
- u8 port_speed_led_config;
- u8 link_led_config;
- u8 activity_led_config;
+ u8 rsv1[3];
u8 locate_led_config;
- u8 rsv[20];
+ u8 rsv2[20];
};
int hclge_cmd_init(struct hclge_dev *hdev);
"Get 64 bit register failed, ret = %d.\n", ret);
}
-static int hclge_set_led_status_sfp(struct hclge_dev *hdev, u8 speed_led_status,
- u8 act_led_status, u8 link_led_status,
- u8 locate_led_status)
+static int hclge_set_led_status(struct hclge_dev *hdev, u8 locate_led_status)
{
struct hclge_set_led_state_cmd *req;
struct hclge_desc desc;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_LED_STATUS_CFG, false);
req = (struct hclge_set_led_state_cmd *)desc.data;
- hnae_set_field(req->port_speed_led_config, HCLGE_LED_PORT_SPEED_STATE_M,
- HCLGE_LED_PORT_SPEED_STATE_S, speed_led_status);
- hnae_set_field(req->link_led_config, HCLGE_LED_ACTIVITY_STATE_M,
- HCLGE_LED_ACTIVITY_STATE_S, act_led_status);
- hnae_set_field(req->activity_led_config, HCLGE_LED_LINK_STATE_M,
- HCLGE_LED_LINK_STATE_S, link_led_status);
hnae_set_field(req->locate_led_config, HCLGE_LED_LOCATE_STATE_M,
HCLGE_LED_LOCATE_STATE_S, locate_led_status);
static int hclge_set_led_id(struct hnae3_handle *handle,
enum ethtool_phys_id_state status)
{
-#define BLINK_FREQUENCY 2
struct hclge_vport *vport = hclge_get_vport(handle);
struct hclge_dev *hdev = vport->back;
- struct phy_device *phydev = hdev->hw.mac.phydev;
- int ret = 0;
-
- if (phydev || hdev->hw.mac.media_type != HNAE3_MEDIA_TYPE_FIBER)
- return -EOPNOTSUPP;
switch (status) {
case ETHTOOL_ID_ACTIVE:
- ret = hclge_set_led_status_sfp(hdev,
- HCLGE_LED_NO_CHANGE,
- HCLGE_LED_NO_CHANGE,
- HCLGE_LED_NO_CHANGE,
- HCLGE_LED_ON);
- break;
+ return hclge_set_led_status(hdev, HCLGE_LED_ON);
case ETHTOOL_ID_INACTIVE:
- ret = hclge_set_led_status_sfp(hdev,
- HCLGE_LED_NO_CHANGE,
- HCLGE_LED_NO_CHANGE,
- HCLGE_LED_NO_CHANGE,
- HCLGE_LED_OFF);
- break;
+ return hclge_set_led_status(hdev, HCLGE_LED_OFF);
default:
- ret = -EINVAL;
- break;
+ return -EINVAL;
}
-
- return ret;
}
static void hclge_get_link_mode(struct hnae3_handle *handle,