Michael Chan | c0c050c | 2015-10-22 16:01:17 -0400 | [diff] [blame] | 1 | /* Broadcom NetXtreme-C/E network driver. |
| 2 | * |
Michael Chan | 11f15ed | 2016-04-05 14:08:55 -0400 | [diff] [blame] | 3 | * Copyright (c) 2014-2016 Broadcom Corporation |
Michael Chan | 8e20236 | 2017-04-04 18:14:09 -0400 | [diff] [blame] | 4 | * Copyright (c) 2016-2017 Broadcom Limited |
Michael Chan | c0c050c | 2015-10-22 16:01:17 -0400 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation. |
| 9 | */ |
| 10 | |
| 11 | #ifndef BNXT_ETHTOOL_H |
| 12 | #define BNXT_ETHTOOL_H |
| 13 | |
Michael Chan | 5ad2cbe | 2017-01-13 01:32:03 -0500 | [diff] [blame] | 14 | struct bnxt_led_cfg { |
| 15 | u8 led_id; |
| 16 | u8 led_state; |
| 17 | u8 led_color; |
| 18 | u8 unused; |
| 19 | __le16 led_blink_on; |
| 20 | __le16 led_blink_off; |
| 21 | u8 led_group_id; |
| 22 | u8 rsvd; |
| 23 | }; |
| 24 | |
| 25 | #define BNXT_LED_DFLT_ENA \ |
| 26 | (PORT_LED_CFG_REQ_ENABLES_LED0_ID | \ |
| 27 | PORT_LED_CFG_REQ_ENABLES_LED0_STATE | \ |
| 28 | PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_ON | \ |
| 29 | PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_OFF | \ |
| 30 | PORT_LED_CFG_REQ_ENABLES_LED0_GROUP_ID) |
| 31 | |
| 32 | #define BNXT_LED_DFLT_ENA_SHIFT 6 |
| 33 | |
| 34 | #define BNXT_LED_DFLT_ENABLES(x) \ |
| 35 | cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x))) |
| 36 | |
Michael Chan | c0c050c | 2015-10-22 16:01:17 -0400 | [diff] [blame] | 37 | extern const struct ethtool_ops bnxt_ethtool_ops; |
| 38 | |
Michael Chan | 170ce01 | 2016-04-05 14:08:57 -0400 | [diff] [blame] | 39 | u32 _bnxt_fw_to_ethtool_adv_spds(u16, u8); |
Michael Chan | c0c050c | 2015-10-22 16:01:17 -0400 | [diff] [blame] | 40 | u32 bnxt_fw_to_ethtool_speed(u16); |
Michael Chan | 939f7f0 | 2016-04-05 14:08:58 -0400 | [diff] [blame] | 41 | u16 bnxt_get_fw_auto_link_speeds(u32); |
Michael Chan | eb51365 | 2017-04-04 18:14:12 -0400 | [diff] [blame] | 42 | void bnxt_ethtool_init(struct bnxt *bp); |
| 43 | void bnxt_ethtool_free(struct bnxt *bp); |
Michael Chan | c0c050c | 2015-10-22 16:01:17 -0400 | [diff] [blame] | 44 | |
| 45 | #endif |