Andrew Boyd(deleted)
|
RE: MDIO/MII settings for Ethernet with io-net and io-pkt
|
Andrew Boyd(deleted)
01/22/2009 11:10 AM
post20621
|
RE: MDIO/MII settings for Ethernet with io-net and io-pkt
> how I can access PHY device registers via MDIO/MII?
The network driver does this all the time, for link
management - see the mii.c source.
> have found "DCMD_IO_NET_MIIPHY"
I just grepped the io-net driver source - I really,
really wish it was publicly available, but I understand
if we do, our lawyers will tar and feather us - and
it appears that this extension was added for the
"tulip" driver.
> Can I just add DCMD_IO_NET_MIIPHY to the devctl
> switch statement?
That's what the tulip driver did - it just calls
a function, with pointers to the driver structure,
and the devctl data.
> Do I need some locking against other threads here?
You sure do! You must ensure that you acquire the
same mutex as the driver does, before it accesses
the mii registers.
> Can I "invent" my own parameter formats for
> DCMD_IO_NET_MIIPHY or is there any standard?
I would just copy what the tulip driver does.
I can probably give you some source, as long
as our lawyers don't find out about it.
> how is this all solved with io-pkt?
I don't think io-pkt has an API for reading
and writing network driver MII registers, but
I may be mistaken. Rob? Sean?
--
aboyd
|
|
|
Andrew Boyd(deleted)
|
RE: MDIO/MII settings for Ethernet with io-net and io-pkt
|
Andrew Boyd(deleted)
01/22/2009 1:37 PM
post20643
|
RE: MDIO/MII settings for Ethernet with io-net and io-pkt
> parameter formats for DCMD_IO_NET_MIIPHY or is there any standard?
At the end of usr/include/hw/nicinfo.h I see a typedef
of nic_miiphy_dcmd_t ... that struct is passed in as
the "data" for the devctl, to the tulip driver. I
would probably just copy that. There are a bunch of
NIC_MIIPHY defines there, that you will probably find
handy.
--
aboyd
|
|
|