mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
net: dsa: microchip: move KSZ9477 and LAN937 ksz_dev_ops to individual drivers
The ksz_dev_ops() are specific to each switch family so they should belong to the individual drivers instead of the common section. Move the ksz_dev_ops() definitions of the KSZ9477 and the LAN937 to their individual drivers. Set static the functions that aren't exported anymore. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com> Link: https://patch.msgid.link/20260505-clean-ksz-driver-v1-4-05d70fa42461@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
2d0a20e4af
commit
0e3e45d330
|
|
@ -43,7 +43,7 @@ static void ksz9477_port_cfg32(struct ksz_device *dev, int port, int offset,
|
|||
bits, set ? bits : 0);
|
||||
}
|
||||
|
||||
int ksz9477_change_mtu(struct ksz_device *dev, int port, int mtu)
|
||||
static int ksz9477_change_mtu(struct ksz_device *dev, int port, int mtu)
|
||||
{
|
||||
u16 frame_size;
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ static int ksz9477_pcs_write(struct mii_bus *bus, int phy, int mmd, int reg,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ksz9477_pcs_create(struct ksz_device *dev)
|
||||
static int ksz9477_pcs_create(struct ksz_device *dev)
|
||||
{
|
||||
int port = ksz_get_sgmii_port(dev);
|
||||
struct ksz_port *p = &dev->ports[port];
|
||||
|
|
@ -341,7 +341,7 @@ int ksz9477_pcs_create(struct ksz_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ksz9477_reset_switch(struct ksz_device *dev)
|
||||
static int ksz9477_reset_switch(struct ksz_device *dev)
|
||||
{
|
||||
u8 data8;
|
||||
u32 data32;
|
||||
|
|
@ -516,7 +516,7 @@ static void ksz9477_r_phy_quirks(struct ksz_device *dev, u16 addr, u16 reg,
|
|||
*data &= ~(BMSR_ESTATEN | BMSR_ERCAP);
|
||||
}
|
||||
|
||||
int ksz9477_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data)
|
||||
static int ksz9477_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data)
|
||||
{
|
||||
u16 val = 0xffff;
|
||||
int ret;
|
||||
|
|
@ -572,7 +572,7 @@ int ksz9477_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ksz9477_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val)
|
||||
static int ksz9477_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val)
|
||||
{
|
||||
u32 mask, val32;
|
||||
|
||||
|
|
@ -1150,8 +1150,8 @@ static phy_interface_t ksz9477_get_interface(struct ksz_device *dev, int port)
|
|||
return interface;
|
||||
}
|
||||
|
||||
void ksz9477_get_caps(struct ksz_device *dev, int port,
|
||||
struct phylink_config *config)
|
||||
static void ksz9477_get_caps(struct ksz_device *dev, int port,
|
||||
struct phylink_config *config)
|
||||
{
|
||||
config->mac_capabilities = MAC_10 | MAC_100 | MAC_ASYM_PAUSE |
|
||||
MAC_SYM_PAUSE;
|
||||
|
|
@ -1168,7 +1168,7 @@ void ksz9477_get_caps(struct ksz_device *dev, int port,
|
|||
}
|
||||
}
|
||||
|
||||
int ksz9477_set_ageing_time(struct ksz_device *dev, unsigned int msecs)
|
||||
static int ksz9477_set_ageing_time(struct ksz_device *dev, unsigned int msecs)
|
||||
{
|
||||
u32 secs = msecs / 1000;
|
||||
u8 data, mult, value;
|
||||
|
|
@ -1234,7 +1234,7 @@ void ksz9477_port_queue_split(struct ksz_device *dev, int port)
|
|||
ksz_prmw8(dev, port, REG_PORT_CTRL_0, PORT_QUEUE_SPLIT_MASK, data);
|
||||
}
|
||||
|
||||
void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
|
||||
static void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
|
||||
{
|
||||
const u16 *regs = dev->info->regs;
|
||||
struct dsa_switch *ds = dev->ds;
|
||||
|
|
@ -1289,7 +1289,7 @@ void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
|
|||
ksz_pwrite8(dev, port, regs[REG_PORT_PME_CTRL], 0);
|
||||
}
|
||||
|
||||
void ksz9477_config_cpu_port(struct dsa_switch *ds)
|
||||
static void ksz9477_config_cpu_port(struct dsa_switch *ds)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
struct ksz_port *p;
|
||||
|
|
@ -1454,7 +1454,7 @@ int ksz9477_enable_stp_addr(struct ksz_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ksz9477_setup(struct dsa_switch *ds)
|
||||
static int ksz9477_setup(struct dsa_switch *ds)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
const u16 *regs = dev->info->regs;
|
||||
|
|
@ -1500,7 +1500,7 @@ u32 ksz9477_get_port_addr(int port, int offset)
|
|||
return PORT_CTRL_ADDR(port, offset);
|
||||
}
|
||||
|
||||
int ksz9477_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val)
|
||||
static int ksz9477_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val)
|
||||
{
|
||||
val = val >> 8;
|
||||
|
||||
|
|
@ -1584,7 +1584,7 @@ void ksz9477_hsr_leave(struct dsa_switch *ds, int port, struct net_device *hsr)
|
|||
ksz_port_cfg(dev, port, REG_PORT_LUE_CTRL, PORT_SRC_ADDR_FILTER, false);
|
||||
}
|
||||
|
||||
int ksz9477_switch_init(struct ksz_device *dev)
|
||||
static int ksz9477_switch_init(struct ksz_device *dev)
|
||||
{
|
||||
u8 data8;
|
||||
int ret;
|
||||
|
|
@ -1604,11 +1604,49 @@ int ksz9477_switch_init(struct ksz_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ksz9477_switch_exit(struct ksz_device *dev)
|
||||
static void ksz9477_switch_exit(struct ksz_device *dev)
|
||||
{
|
||||
ksz9477_reset_switch(dev);
|
||||
}
|
||||
|
||||
const struct ksz_dev_ops ksz9477_dev_ops = {
|
||||
.setup = ksz9477_setup,
|
||||
.get_port_addr = ksz9477_get_port_addr,
|
||||
.cfg_port_member = ksz9477_cfg_port_member,
|
||||
.flush_dyn_mac_table = ksz9477_flush_dyn_mac_table,
|
||||
.port_setup = ksz9477_port_setup,
|
||||
.set_ageing_time = ksz9477_set_ageing_time,
|
||||
.r_phy = ksz9477_r_phy,
|
||||
.w_phy = ksz9477_w_phy,
|
||||
.r_mib_cnt = ksz9477_r_mib_cnt,
|
||||
.r_mib_pkt = ksz9477_r_mib_pkt,
|
||||
.r_mib_stat64 = ksz_r_mib_stats64,
|
||||
.freeze_mib = ksz9477_freeze_mib,
|
||||
.port_init_cnt = ksz9477_port_init_cnt,
|
||||
.vlan_filtering = ksz9477_port_vlan_filtering,
|
||||
.vlan_add = ksz9477_port_vlan_add,
|
||||
.vlan_del = ksz9477_port_vlan_del,
|
||||
.mirror_add = ksz9477_port_mirror_add,
|
||||
.mirror_del = ksz9477_port_mirror_del,
|
||||
.get_caps = ksz9477_get_caps,
|
||||
.fdb_dump = ksz9477_fdb_dump,
|
||||
.fdb_add = ksz9477_fdb_add,
|
||||
.fdb_del = ksz9477_fdb_del,
|
||||
.mdb_add = ksz9477_mdb_add,
|
||||
.mdb_del = ksz9477_mdb_del,
|
||||
.change_mtu = ksz9477_change_mtu,
|
||||
.pme_write8 = ksz_write8,
|
||||
.pme_pread8 = ksz_pread8,
|
||||
.pme_pwrite8 = ksz_pwrite8,
|
||||
.config_cpu_port = ksz9477_config_cpu_port,
|
||||
.tc_cbs_set_cinc = ksz9477_tc_cbs_set_cinc,
|
||||
.enable_stp_addr = ksz9477_enable_stp_addr,
|
||||
.reset = ksz9477_reset_switch,
|
||||
.init = ksz9477_switch_init,
|
||||
.exit = ksz9477_switch_exit,
|
||||
.pcs_create = ksz9477_pcs_create,
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Woojung Huh <Woojung.Huh@microchip.com>");
|
||||
MODULE_DESCRIPTION("Microchip KSZ9477 Series Switch DSA Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
|
|
@ -11,14 +11,9 @@
|
|||
#include <net/dsa.h>
|
||||
#include "ksz_common.h"
|
||||
|
||||
int ksz9477_setup(struct dsa_switch *ds);
|
||||
u32 ksz9477_get_port_addr(int port, int offset);
|
||||
void ksz9477_cfg_port_member(struct ksz_device *dev, int port, u8 member);
|
||||
void ksz9477_flush_dyn_mac_table(struct ksz_device *dev, int port);
|
||||
void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port);
|
||||
int ksz9477_set_ageing_time(struct ksz_device *dev, unsigned int msecs);
|
||||
int ksz9477_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data);
|
||||
int ksz9477_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val);
|
||||
void ksz9477_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, u64 *cnt);
|
||||
void ksz9477_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
|
||||
u64 *dropped, u64 *cnt);
|
||||
|
|
@ -38,8 +33,6 @@ void ksz9477_port_mirror_del(struct ksz_device *dev, int port,
|
|||
struct dsa_mall_mirror_tc_entry *mirror);
|
||||
int ksz9477_errata_monitor(struct ksz_device *dev, int port,
|
||||
u64 tx_late_col);
|
||||
void ksz9477_get_caps(struct ksz_device *dev, int port,
|
||||
struct phylink_config *config);
|
||||
int ksz9477_fdb_dump(struct ksz_device *dev, int port,
|
||||
dsa_fdb_dump_cb_t *cb, void *data);
|
||||
int ksz9477_fdb_add(struct ksz_device *dev, int port,
|
||||
|
|
@ -50,13 +43,7 @@ int ksz9477_mdb_add(struct ksz_device *dev, int port,
|
|||
const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
|
||||
int ksz9477_mdb_del(struct ksz_device *dev, int port,
|
||||
const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
|
||||
int ksz9477_change_mtu(struct ksz_device *dev, int port, int mtu);
|
||||
void ksz9477_config_cpu_port(struct dsa_switch *ds);
|
||||
int ksz9477_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val);
|
||||
int ksz9477_enable_stp_addr(struct ksz_device *dev);
|
||||
int ksz9477_reset_switch(struct ksz_device *dev);
|
||||
int ksz9477_switch_init(struct ksz_device *dev);
|
||||
void ksz9477_switch_exit(struct ksz_device *dev);
|
||||
void ksz9477_port_queue_split(struct ksz_device *dev, int port);
|
||||
void ksz9477_hsr_join(struct dsa_switch *ds, int port, struct net_device *hsr);
|
||||
void ksz9477_hsr_leave(struct dsa_switch *ds, int port, struct net_device *hsr);
|
||||
|
|
@ -97,6 +84,6 @@ void ksz9477_acl_match_process_l2(struct ksz_device *dev, int port,
|
|||
u16 ethtype, u8 *src_mac, u8 *dst_mac,
|
||||
unsigned long cookie, u32 prio);
|
||||
|
||||
int ksz9477_pcs_create(struct ksz_device *dev);
|
||||
extern const struct ksz_dev_ops ksz9477_dev_ops;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -364,44 +364,6 @@ static const struct phylink_mac_ops ksz9477_phylink_mac_ops = {
|
|||
.mac_select_pcs = ksz_phylink_mac_select_pcs,
|
||||
};
|
||||
|
||||
static const struct ksz_dev_ops ksz9477_dev_ops = {
|
||||
.setup = ksz9477_setup,
|
||||
.get_port_addr = ksz9477_get_port_addr,
|
||||
.cfg_port_member = ksz9477_cfg_port_member,
|
||||
.flush_dyn_mac_table = ksz9477_flush_dyn_mac_table,
|
||||
.port_setup = ksz9477_port_setup,
|
||||
.set_ageing_time = ksz9477_set_ageing_time,
|
||||
.r_phy = ksz9477_r_phy,
|
||||
.w_phy = ksz9477_w_phy,
|
||||
.r_mib_cnt = ksz9477_r_mib_cnt,
|
||||
.r_mib_pkt = ksz9477_r_mib_pkt,
|
||||
.r_mib_stat64 = ksz_r_mib_stats64,
|
||||
.freeze_mib = ksz9477_freeze_mib,
|
||||
.port_init_cnt = ksz9477_port_init_cnt,
|
||||
.vlan_filtering = ksz9477_port_vlan_filtering,
|
||||
.vlan_add = ksz9477_port_vlan_add,
|
||||
.vlan_del = ksz9477_port_vlan_del,
|
||||
.mirror_add = ksz9477_port_mirror_add,
|
||||
.mirror_del = ksz9477_port_mirror_del,
|
||||
.get_caps = ksz9477_get_caps,
|
||||
.fdb_dump = ksz9477_fdb_dump,
|
||||
.fdb_add = ksz9477_fdb_add,
|
||||
.fdb_del = ksz9477_fdb_del,
|
||||
.mdb_add = ksz9477_mdb_add,
|
||||
.mdb_del = ksz9477_mdb_del,
|
||||
.change_mtu = ksz9477_change_mtu,
|
||||
.pme_write8 = ksz_write8,
|
||||
.pme_pread8 = ksz_pread8,
|
||||
.pme_pwrite8 = ksz_pwrite8,
|
||||
.config_cpu_port = ksz9477_config_cpu_port,
|
||||
.tc_cbs_set_cinc = ksz9477_tc_cbs_set_cinc,
|
||||
.enable_stp_addr = ksz9477_enable_stp_addr,
|
||||
.reset = ksz9477_reset_switch,
|
||||
.init = ksz9477_switch_init,
|
||||
.exit = ksz9477_switch_exit,
|
||||
.pcs_create = ksz9477_pcs_create,
|
||||
};
|
||||
|
||||
static const struct phylink_mac_ops lan937x_phylink_mac_ops = {
|
||||
.mac_config = ksz_phylink_mac_config,
|
||||
.mac_link_down = ksz_phylink_mac_link_down,
|
||||
|
|
@ -410,44 +372,6 @@ static const struct phylink_mac_ops lan937x_phylink_mac_ops = {
|
|||
.mac_enable_tx_lpi = ksz_phylink_mac_enable_tx_lpi,
|
||||
};
|
||||
|
||||
static const struct ksz_dev_ops lan937x_dev_ops = {
|
||||
.setup = lan937x_setup,
|
||||
.teardown = lan937x_teardown,
|
||||
.get_port_addr = ksz9477_get_port_addr,
|
||||
.cfg_port_member = ksz9477_cfg_port_member,
|
||||
.flush_dyn_mac_table = ksz9477_flush_dyn_mac_table,
|
||||
.port_setup = lan937x_port_setup,
|
||||
.set_ageing_time = lan937x_set_ageing_time,
|
||||
.mdio_bus_preinit = lan937x_mdio_bus_preinit,
|
||||
.create_phy_addr_map = lan937x_create_phy_addr_map,
|
||||
.r_phy = lan937x_r_phy,
|
||||
.w_phy = lan937x_w_phy,
|
||||
.r_mib_cnt = ksz9477_r_mib_cnt,
|
||||
.r_mib_pkt = ksz9477_r_mib_pkt,
|
||||
.r_mib_stat64 = ksz_r_mib_stats64,
|
||||
.freeze_mib = ksz9477_freeze_mib,
|
||||
.port_init_cnt = ksz9477_port_init_cnt,
|
||||
.vlan_filtering = ksz9477_port_vlan_filtering,
|
||||
.vlan_add = ksz9477_port_vlan_add,
|
||||
.vlan_del = ksz9477_port_vlan_del,
|
||||
.mirror_add = ksz9477_port_mirror_add,
|
||||
.mirror_del = ksz9477_port_mirror_del,
|
||||
.get_caps = lan937x_phylink_get_caps,
|
||||
.setup_rgmii_delay = lan937x_setup_rgmii_delay,
|
||||
.fdb_dump = ksz9477_fdb_dump,
|
||||
.fdb_add = ksz9477_fdb_add,
|
||||
.fdb_del = ksz9477_fdb_del,
|
||||
.mdb_add = ksz9477_mdb_add,
|
||||
.mdb_del = ksz9477_mdb_del,
|
||||
.change_mtu = lan937x_change_mtu,
|
||||
.config_cpu_port = lan937x_config_cpu_port,
|
||||
.tc_cbs_set_cinc = lan937x_tc_cbs_set_cinc,
|
||||
.enable_stp_addr = ksz9477_enable_stp_addr,
|
||||
.reset = lan937x_reset_switch,
|
||||
.init = lan937x_switch_init,
|
||||
.exit = lan937x_switch_exit,
|
||||
};
|
||||
|
||||
static const u16 ksz8463_regs[] = {
|
||||
[REG_SW_MAC_ADDR] = 0x10,
|
||||
[REG_IND_CTRL_0] = 0x30,
|
||||
|
|
|
|||
|
|
@ -6,21 +6,6 @@
|
|||
#ifndef __LAN937X_CFG_H
|
||||
#define __LAN937X_CFG_H
|
||||
|
||||
int lan937x_reset_switch(struct ksz_device *dev);
|
||||
int lan937x_setup(struct dsa_switch *ds);
|
||||
void lan937x_teardown(struct dsa_switch *ds);
|
||||
void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port);
|
||||
void lan937x_config_cpu_port(struct dsa_switch *ds);
|
||||
int lan937x_switch_init(struct ksz_device *dev);
|
||||
void lan937x_switch_exit(struct ksz_device *dev);
|
||||
int lan937x_mdio_bus_preinit(struct ksz_device *dev, bool side_mdio);
|
||||
int lan937x_create_phy_addr_map(struct ksz_device *dev, bool side_mdio);
|
||||
int lan937x_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data);
|
||||
int lan937x_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val);
|
||||
int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu);
|
||||
void lan937x_phylink_get_caps(struct ksz_device *dev, int port,
|
||||
struct phylink_config *config);
|
||||
void lan937x_setup_rgmii_delay(struct ksz_device *dev, int port);
|
||||
int lan937x_set_ageing_time(struct ksz_device *dev, unsigned int msecs);
|
||||
int lan937x_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val);
|
||||
extern const struct ksz_dev_ops lan937x_dev_ops;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static int lan937x_port_cfg(struct ksz_device *dev, int port, int offset,
|
|||
*
|
||||
* Return: 0 on success, error code on failure.
|
||||
*/
|
||||
int lan937x_create_phy_addr_map(struct ksz_device *dev, bool side_mdio)
|
||||
static int lan937x_create_phy_addr_map(struct ksz_device *dev, bool side_mdio)
|
||||
{
|
||||
static const u8 *phy_addr_map;
|
||||
u32 strap_val;
|
||||
|
|
@ -221,7 +221,7 @@ int lan937x_create_phy_addr_map(struct ksz_device *dev, bool side_mdio)
|
|||
*
|
||||
* Return: 0 on success, error code on failure.
|
||||
*/
|
||||
int lan937x_mdio_bus_preinit(struct ksz_device *dev, bool side_mdio)
|
||||
static int lan937x_mdio_bus_preinit(struct ksz_device *dev, bool side_mdio)
|
||||
{
|
||||
u16 data16;
|
||||
int ret;
|
||||
|
|
@ -332,17 +332,17 @@ static int lan937x_internal_phy_read(struct ksz_device *dev, int addr, int reg,
|
|||
return ksz_read16(dev, REG_VPHY_IND_DATA__2, val);
|
||||
}
|
||||
|
||||
int lan937x_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data)
|
||||
static int lan937x_r_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 *data)
|
||||
{
|
||||
return lan937x_internal_phy_read(dev, addr, reg, data);
|
||||
}
|
||||
|
||||
int lan937x_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val)
|
||||
static int lan937x_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val)
|
||||
{
|
||||
return lan937x_internal_phy_write(dev, addr, reg, val);
|
||||
}
|
||||
|
||||
int lan937x_reset_switch(struct ksz_device *dev)
|
||||
static int lan937x_reset_switch(struct ksz_device *dev)
|
||||
{
|
||||
u32 data32;
|
||||
int ret;
|
||||
|
|
@ -373,7 +373,7 @@ int lan937x_reset_switch(struct ksz_device *dev)
|
|||
return ksz_read32(dev, REG_SW_PORT_INT_STATUS__4, &data32);
|
||||
}
|
||||
|
||||
void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port)
|
||||
static void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port)
|
||||
{
|
||||
const u32 *masks = dev->info->masks;
|
||||
const u16 *regs = dev->info->regs;
|
||||
|
|
@ -409,7 +409,7 @@ void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port)
|
|||
dev->dev_ops->cfg_port_member(dev, port, member);
|
||||
}
|
||||
|
||||
void lan937x_config_cpu_port(struct dsa_switch *ds)
|
||||
static void lan937x_config_cpu_port(struct dsa_switch *ds)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
struct dsa_port *dp;
|
||||
|
|
@ -428,7 +428,7 @@ void lan937x_config_cpu_port(struct dsa_switch *ds)
|
|||
}
|
||||
}
|
||||
|
||||
int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu)
|
||||
static int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu)
|
||||
{
|
||||
struct dsa_switch *ds = dev->ds;
|
||||
int ret;
|
||||
|
|
@ -459,7 +459,7 @@ int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int lan937x_set_ageing_time(struct ksz_device *dev, unsigned int msecs)
|
||||
static int lan937x_set_ageing_time(struct ksz_device *dev, unsigned int msecs)
|
||||
{
|
||||
u8 data, mult, value8;
|
||||
bool in_msec = false;
|
||||
|
|
@ -572,8 +572,8 @@ static void lan937x_set_rgmii_rx_delay(struct ksz_device *dev, int port)
|
|||
lan937x_set_tune_adj(dev, port, REG_PORT_XMII_CTRL_4, val);
|
||||
}
|
||||
|
||||
void lan937x_phylink_get_caps(struct ksz_device *dev, int port,
|
||||
struct phylink_config *config)
|
||||
static void lan937x_phylink_get_caps(struct ksz_device *dev, int port,
|
||||
struct phylink_config *config)
|
||||
{
|
||||
config->mac_capabilities = MAC_100FD;
|
||||
|
||||
|
|
@ -587,7 +587,7 @@ void lan937x_phylink_get_caps(struct ksz_device *dev, int port,
|
|||
}
|
||||
}
|
||||
|
||||
void lan937x_setup_rgmii_delay(struct ksz_device *dev, int port)
|
||||
static void lan937x_setup_rgmii_delay(struct ksz_device *dev, int port)
|
||||
{
|
||||
struct ksz_port *p = &dev->ports[port];
|
||||
|
||||
|
|
@ -604,19 +604,19 @@ void lan937x_setup_rgmii_delay(struct ksz_device *dev, int port)
|
|||
}
|
||||
}
|
||||
|
||||
int lan937x_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val)
|
||||
static int lan937x_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val)
|
||||
{
|
||||
return ksz_pwrite32(dev, port, REG_PORT_MTI_CREDIT_INCREMENT, val);
|
||||
}
|
||||
|
||||
int lan937x_switch_init(struct ksz_device *dev)
|
||||
static int lan937x_switch_init(struct ksz_device *dev)
|
||||
{
|
||||
dev->port_mask = (1 << dev->info->port_cnt) - 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lan937x_setup(struct dsa_switch *ds)
|
||||
static int lan937x_setup(struct dsa_switch *ds)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
int ret;
|
||||
|
|
@ -656,16 +656,54 @@ int lan937x_setup(struct dsa_switch *ds)
|
|||
SW_VPHY_DISABLE);
|
||||
}
|
||||
|
||||
void lan937x_teardown(struct dsa_switch *ds)
|
||||
static void lan937x_teardown(struct dsa_switch *ds)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void lan937x_switch_exit(struct ksz_device *dev)
|
||||
static void lan937x_switch_exit(struct ksz_device *dev)
|
||||
{
|
||||
lan937x_reset_switch(dev);
|
||||
}
|
||||
|
||||
const struct ksz_dev_ops lan937x_dev_ops = {
|
||||
.setup = lan937x_setup,
|
||||
.teardown = lan937x_teardown,
|
||||
.get_port_addr = ksz9477_get_port_addr,
|
||||
.cfg_port_member = ksz9477_cfg_port_member,
|
||||
.flush_dyn_mac_table = ksz9477_flush_dyn_mac_table,
|
||||
.port_setup = lan937x_port_setup,
|
||||
.set_ageing_time = lan937x_set_ageing_time,
|
||||
.mdio_bus_preinit = lan937x_mdio_bus_preinit,
|
||||
.create_phy_addr_map = lan937x_create_phy_addr_map,
|
||||
.r_phy = lan937x_r_phy,
|
||||
.w_phy = lan937x_w_phy,
|
||||
.r_mib_cnt = ksz9477_r_mib_cnt,
|
||||
.r_mib_pkt = ksz9477_r_mib_pkt,
|
||||
.r_mib_stat64 = ksz_r_mib_stats64,
|
||||
.freeze_mib = ksz9477_freeze_mib,
|
||||
.port_init_cnt = ksz9477_port_init_cnt,
|
||||
.vlan_filtering = ksz9477_port_vlan_filtering,
|
||||
.vlan_add = ksz9477_port_vlan_add,
|
||||
.vlan_del = ksz9477_port_vlan_del,
|
||||
.mirror_add = ksz9477_port_mirror_add,
|
||||
.mirror_del = ksz9477_port_mirror_del,
|
||||
.get_caps = lan937x_phylink_get_caps,
|
||||
.setup_rgmii_delay = lan937x_setup_rgmii_delay,
|
||||
.fdb_dump = ksz9477_fdb_dump,
|
||||
.fdb_add = ksz9477_fdb_add,
|
||||
.fdb_del = ksz9477_fdb_del,
|
||||
.mdb_add = ksz9477_mdb_add,
|
||||
.mdb_del = ksz9477_mdb_del,
|
||||
.change_mtu = lan937x_change_mtu,
|
||||
.config_cpu_port = lan937x_config_cpu_port,
|
||||
.tc_cbs_set_cinc = lan937x_tc_cbs_set_cinc,
|
||||
.enable_stp_addr = ksz9477_enable_stp_addr,
|
||||
.reset = lan937x_reset_switch,
|
||||
.init = lan937x_switch_init,
|
||||
.exit = lan937x_switch_exit,
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Arun Ramadoss <arun.ramadoss@microchip.com>");
|
||||
MODULE_DESCRIPTION("Microchip LAN937x Series Switch DSA Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user