| /* |
| * Copyright (c) 2013 Qualcomm Atheros, Inc. |
| * |
| * Permission to use, copy, modify, and/or distribute this software for any |
| * purpose with or without fee is hereby granted, provided that the above |
| * copyright notice and this permission notice appear in all copies. |
| * |
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| */ |
| |
| #include <config.h> |
| #include <linux/types.h> |
| #include <common.h> |
| #include <miiphy.h> |
| #include "phy.h" |
| #include <asm/addrspace.h> |
| #include <atheros.h> |
| |
| #define MODULE_NAME "ATHRS_VIR_PHY" |
| |
| #define TRUE 1 |
| #define FALSE 0 |
| #define BOOL int |
| |
| /* Forward references */ |
| BOOL athr_vir_phy_is_link_alive(int phyUnit); |
| |
| |
| /****************************************************************************** |
| * |
| * athr_vir_phy_is_link_alive - test to see if the specified link is alive |
| * |
| * RETURNS: |
| * TRUE --> link is alive |
| * FALSE --> link is down |
| */ |
| BOOL |
| athr_vir_phy_is_link_alive(int phyUnit) |
| { |
| return TRUE; |
| } |
| |
| /****************************************************************************** |
| * |
| * athr_vir_phy_setup - reset and setup the PHY associated with |
| * the specified MAC unit number. |
| * |
| * Resets the associated PHY port. |
| * |
| * RETURNS: |
| * TRUE --> associated PHY is alive |
| * FALSE --> no LINKs on this ethernet unit |
| */ |
| |
| BOOL |
| athr_vir_phy_setup(int ethUnit) |
| { |
| return 0; |
| } |
| |
| /****************************************************************************** |
| * |
| * athr_vir_phy_is_fdx - Determines whether the phy ports associated with the |
| * specified device are FULL or HALF duplex. |
| * |
| * RETURNS: |
| * 1 --> FULL |
| * 0 --> HALF |
| */ |
| int |
| athr_vir_phy_is_fdx(int ethUnit,int phyUnit) |
| { |
| return TRUE; |
| } |
| |
| /****************************************************************************** |
| * |
| * athr_vir_phy_speed - Determines the speed of phy ports associated with the |
| * specified device. |
| * |
| * RETURNS: |
| * AG7240_PHY_SPEED_10T, AG7240_PHY_SPEED_100T; |
| * AG7240_PHY_SPEED_1000T; |
| */ |
| |
| int |
| athr_vir_phy_speed(int ethUnit,int phyUnit) |
| { |
| return _1000BASET; |
| } |
| |
| /***************************************************************************** |
| * |
| * athr_vir_phy_is_up -- checks for significant changes in PHY state. |
| * |
| * A "significant change" is: |
| * dropped link (e.g. ethernet cable unplugged) OR |
| * autonegotiation completed + link (e.g. ethernet cable plugged in) |
| * |
| * When a PHY is plugged in, phyLinkGained is called. |
| * When a PHY is unplugged, phyLinkLost is called. |
| */ |
| |
| int |
| athr_vir_phy_is_up(int ethUnit) |
| { |
| return 1; |
| |
| } |
| /* Place holders */ |
| |
| int |
| athr_vir_reg_init(void *arg) |
| { |
| return 0; |
| } |
| |