Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 89ae47a7 authored by Murali Karicheri's avatar Murali Karicheri
Browse files

net: ti: prueth_core: move prueth_hostinit() to inside ndo_open()


As preparatory patch to introduce support for additional Ethernet
types, move prueth_hostinit() to inside ndo_open() as prueth_hostinit()
is common across all Ethernet types and make sense to do it as part
of ndo_open() since driver needs to support run time changing of
Ethernet type. Currently Ethernet type is set inside
prueth_change_to_switch_mode() or prueth_change_to_emac_mode() and
prueth_hostinit() is invoked there. So move this to inside ndo_open().
Now that driver always do rproc_set_firmware() in ndo_open() based on
Ethernet type, remove the restore of firmware names to EMAC firmware
in prueth_sw_shutdown_prus().

For switch based firmwarem there are common resources to be
initialized when the first port is initialized which are done part
of prueth_hostinit(). So introduce a mutex to enter the critical
region inside ndo_open() for initialization and in ndo_stop()
when last port is down. Also set emac_configured at the end after
the port is enabled and use proper input to prueth_port_enable()
call.

Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
parent ff837704
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment