aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x/bnx2x_link.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_link.h')
-rw-r--r--drivers/net/bnx2x/bnx2x_link.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/net/bnx2x/bnx2x_link.h b/drivers/net/bnx2x/bnx2x_link.h
index ac348daae2f2..418bef472e08 100644
--- a/drivers/net/bnx2x/bnx2x_link.h
+++ b/drivers/net/bnx2x/bnx2x_link.h
@@ -281,40 +281,41 @@ struct link_vars {
281/***********************************************************/ 281/***********************************************************/
282/* Functions */ 282/* Functions */
283/***********************************************************/ 283/***********************************************************/
284u8 bnx2x_phy_init(struct link_params *input, struct link_vars *output); 284int bnx2x_phy_init(struct link_params *params, struct link_vars *vars);
285 285
286/* Reset the link. Should be called when driver or interface goes down 286/* Reset the link. Should be called when driver or interface goes down
287 Before calling phy firmware upgrade, the reset_ext_phy should be set 287 Before calling phy firmware upgrade, the reset_ext_phy should be set
288 to 0 */ 288 to 0 */
289u8 bnx2x_link_reset(struct link_params *params, struct link_vars *vars, 289int bnx2x_link_reset(struct link_params *params, struct link_vars *vars,
290 u8 reset_ext_phy); 290 u8 reset_ext_phy);
291 291
292/* bnx2x_link_update should be called upon link interrupt */ 292/* bnx2x_link_update should be called upon link interrupt */
293u8 bnx2x_link_update(struct link_params *input, struct link_vars *output); 293int bnx2x_link_update(struct link_params *params, struct link_vars *vars);
294 294
295/* use the following phy functions to read/write from external_phy 295/* use the following phy functions to read/write from external_phy
296 In order to use it to read/write internal phy registers, use 296 In order to use it to read/write internal phy registers, use
297 DEFAULT_PHY_DEV_ADDR as devad, and (_bank + (_addr & 0xf)) as 297 DEFAULT_PHY_DEV_ADDR as devad, and (_bank + (_addr & 0xf)) as
298 the register */ 298 the register */
299u8 bnx2x_phy_read(struct link_params *params, u8 phy_addr, 299int bnx2x_phy_read(struct link_params *params, u8 phy_addr,
300 u8 devad, u16 reg, u16 *ret_val); 300 u8 devad, u16 reg, u16 *ret_val);
301
302int bnx2x_phy_write(struct link_params *params, u8 phy_addr,
303 u8 devad, u16 reg, u16 val);
301 304
302u8 bnx2x_phy_write(struct link_params *params, u8 phy_addr,
303 u8 devad, u16 reg, u16 val);
304/* Reads the link_status from the shmem, 305/* Reads the link_status from the shmem,
305 and update the link vars accordingly */ 306 and update the link vars accordingly */
306void bnx2x_link_status_update(struct link_params *input, 307void bnx2x_link_status_update(struct link_params *input,
307 struct link_vars *output); 308 struct link_vars *output);
308/* returns string representing the fw_version of the external phy */ 309/* returns string representing the fw_version of the external phy */
309u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded, 310int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
310 u8 *version, u16 len); 311 u8 *version, u16 len);
311 312
312/* Set/Unset the led 313/* Set/Unset the led
313 Basically, the CLC takes care of the led for the link, but in case one needs 314 Basically, the CLC takes care of the led for the link, but in case one needs
314 to set/unset the led unnaturally, set the "mode" to LED_MODE_OPER to 315 to set/unset the led unnaturally, set the "mode" to LED_MODE_OPER to
315 blink the led, and LED_MODE_OFF to set the led off.*/ 316 blink the led, and LED_MODE_OFF to set the led off.*/
316u8 bnx2x_set_led(struct link_params *params, struct link_vars *vars, 317int bnx2x_set_led(struct link_params *params,
317 u8 mode, u32 speed); 318 struct link_vars *vars, u8 mode, u32 speed);
318#define LED_MODE_OFF 0 319#define LED_MODE_OFF 0
319#define LED_MODE_ON 1 320#define LED_MODE_ON 1
320#define LED_MODE_OPER 2 321#define LED_MODE_OPER 2
@@ -326,12 +327,12 @@ void bnx2x_handle_module_detect_int(struct link_params *params);
326 327
327/* Get the actual link status. In case it returns 0, link is up, 328/* Get the actual link status. In case it returns 0, link is up,
328 otherwise link is down*/ 329 otherwise link is down*/
329u8 bnx2x_test_link(struct link_params *input, struct link_vars *vars, 330int bnx2x_test_link(struct link_params *params, struct link_vars *vars,
330 u8 is_serdes); 331 u8 is_serdes);
331 332
332/* One-time initialization for external phy after power up */ 333/* One-time initialization for external phy after power up */
333u8 bnx2x_common_init_phy(struct bnx2x *bp, u32 shmem_base_path[], 334int bnx2x_common_init_phy(struct bnx2x *bp, u32 shmem_base_path[],
334 u32 shmem2_base_path[], u32 chip_id); 335 u32 shmem2_base_path[], u32 chip_id);
335 336
336/* Reset the external PHY using GPIO */ 337/* Reset the external PHY using GPIO */
337void bnx2x_ext_phy_hw_reset(struct bnx2x *bp, u8 port); 338void bnx2x_ext_phy_hw_reset(struct bnx2x *bp, u8 port);
@@ -340,9 +341,9 @@ void bnx2x_ext_phy_hw_reset(struct bnx2x *bp, u8 port);
340void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp, struct bnx2x_phy *phy); 341void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp, struct bnx2x_phy *phy);
341 342
342/* Read "byte_cnt" bytes from address "addr" from the SFP+ EEPROM */ 343/* Read "byte_cnt" bytes from address "addr" from the SFP+ EEPROM */
343u8 bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy, 344int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy,
344 struct link_params *params, u16 addr, 345 struct link_params *params, u16 addr,
345 u8 byte_cnt, u8 *o_buf); 346 u8 byte_cnt, u8 *o_buf);
346 347
347void bnx2x_hw_reset_phy(struct link_params *params); 348void bnx2x_hw_reset_phy(struct link_params *params);
348 349
@@ -354,7 +355,8 @@ u8 bnx2x_hw_lock_required(struct bnx2x *bp, u32 shmem_base,
354u32 bnx2x_phy_selection(struct link_params *params); 355u32 bnx2x_phy_selection(struct link_params *params);
355 356
356/* Probe the phys on board, and populate them in "params" */ 357/* Probe the phys on board, and populate them in "params" */
357u8 bnx2x_phy_probe(struct link_params *params); 358int bnx2x_phy_probe(struct link_params *params);
359
358/* Checks if fan failure detection is required on one of the phys on board */ 360/* Checks if fan failure detection is required on one of the phys on board */
359u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base, 361u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base,
360 u32 shmem2_base, u8 port); 362 u32 shmem2_base, u8 port);
@@ -392,7 +394,7 @@ void bnx2x_ets_bw_limit(const struct link_params *params, const u32 cos0_bw,
392 const u32 cos1_bw); 394 const u32 cos1_bw);
393 395
394/* Used to configure the ETS to strict */ 396/* Used to configure the ETS to strict */
395u8 bnx2x_ets_strict(const struct link_params *params, const u8 strict_cos); 397int bnx2x_ets_strict(const struct link_params *params, const u8 strict_cos);
396 398
397/* Read pfc statistic*/ 399/* Read pfc statistic*/
398void bnx2x_pfc_statistic(struct link_params *params, struct link_vars *vars, 400void bnx2x_pfc_statistic(struct link_params *params, struct link_vars *vars,