Skip to content

Commit f712793

Browse files
hkallweitNipaLocal
authored andcommitted
net: phy: add phylib-internal.h
This patch is a starting point for moving phylib-internal declarations to a private header file. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 35541cd commit f712793

File tree

7 files changed

+34
-14
lines changed

7 files changed

+34
-14
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/phy.h>
1010

1111
#include "mdio-open-alliance.h"
12+
#include "phylib-internal.h"
1213

1314
/**
1415
* genphy_c45_baset1_able - checks if the PMA has BASE-T1 extended abilities

drivers/net/phy/phy-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <linux/phy.h>
77
#include <linux/of.h>
88

9+
#include "phylib-internal.h"
10+
911
/**
1012
* phy_speed_to_str - Return a string representing the PHY link speed
1113
*
@@ -544,7 +546,6 @@ void phy_check_downshift(struct phy_device *phydev)
544546

545547
phydev->downshifted_rate = 1;
546548
}
547-
EXPORT_SYMBOL_GPL(phy_check_downshift);
548549

549550
static int phy_resolve_min_speed(struct phy_device *phydev, bool fdx_only)
550551
{

drivers/net/phy/phy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include <net/genetlink.h>
3737
#include <net/sock.h>
3838

39+
#include "phylib-internal.h"
40+
3941
#define PHY_STATE_TIME HZ
4042

4143
#define PHY_STATE_STR(_state) \

drivers/net/phy/phy_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include <linux/uaccess.h>
4242
#include <linux/unistd.h>
4343

44+
#include "phylib-internal.h"
45+
4446
MODULE_DESCRIPTION("PHY library");
4547
MODULE_AUTHOR("Andy Fleming");
4648
MODULE_LICENSE("GPL");

drivers/net/phy/phy_led_triggers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <linux/phy_led_triggers.h>
66
#include <linux/netdevice.h>
77

8+
#include "phylib-internal.h"
9+
810
static struct phy_led_trigger *phy_speed_to_led_trigger(struct phy_device *phy,
911
unsigned int speed)
1012
{

drivers/net/phy/phylib-internal.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* phylib-internal header
4+
*/
5+
6+
#ifndef __PHYLIB_INTERNAL_H
7+
#define __PHYLIB_INTERNAL_H
8+
9+
struct phy_device;
10+
11+
/*
12+
* phy_supported_speeds - return all speeds currently supported by a PHY device
13+
*/
14+
unsigned int phy_supported_speeds(struct phy_device *phy,
15+
unsigned int *speeds,
16+
unsigned int size);
17+
void of_set_phy_supported(struct phy_device *phydev);
18+
void of_set_phy_eee_broken(struct phy_device *phydev);
19+
void of_set_phy_timing_role(struct phy_device *phydev);
20+
int phy_speed_down_core(struct phy_device *phydev);
21+
void phy_check_downshift(struct phy_device *phydev);
22+
23+
int genphy_c45_read_eee_adv(struct phy_device *phydev, unsigned long *adv);
24+
25+
#endif /* __PHYLIB_INTERNAL_H */

include/linux/phy.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,6 @@ static inline void phy_interface_set_rgmii(unsigned long *intf)
181181
__set_bit(PHY_INTERFACE_MODE_RGMII_TXID, intf);
182182
}
183183

184-
/*
185-
* phy_supported_speeds - return all speeds currently supported by a PHY device
186-
*/
187-
unsigned int phy_supported_speeds(struct phy_device *phy,
188-
unsigned int *speeds,
189-
unsigned int size);
190-
191184
/**
192185
* phy_modes - map phy_interface_t enum to device tree binding of phy-mode
193186
* @interface: enum phy_interface_t value
@@ -1296,10 +1289,6 @@ phy_lookup_setting(int speed, int duplex, const unsigned long *mask,
12961289
bool exact);
12971290
size_t phy_speeds(unsigned int *speeds, size_t size,
12981291
unsigned long *mask);
1299-
void of_set_phy_supported(struct phy_device *phydev);
1300-
void of_set_phy_eee_broken(struct phy_device *phydev);
1301-
void of_set_phy_timing_role(struct phy_device *phydev);
1302-
int phy_speed_down_core(struct phy_device *phydev);
13031292

13041293
/**
13051294
* phy_is_started - Convenience function to check whether PHY is started
@@ -1325,7 +1314,6 @@ static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode
13251314

13261315
void phy_resolve_aneg_pause(struct phy_device *phydev);
13271316
void phy_resolve_aneg_linkmode(struct phy_device *phydev);
1328-
void phy_check_downshift(struct phy_device *phydev);
13291317

13301318
/**
13311319
* phy_read - Convenience function for reading a given PHY register
@@ -2000,7 +1988,6 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
20001988
int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
20011989
struct ethtool_keee *data);
20021990
int genphy_c45_an_config_eee_aneg(struct phy_device *phydev);
2003-
int genphy_c45_read_eee_adv(struct phy_device *phydev, unsigned long *adv);
20041991

20051992
/* Generic C45 PHY driver */
20061993
extern struct phy_driver genphy_c45_driver;

0 commit comments

Comments
 (0)