Re: [lwip-users] Cable unplugged

2019-12-11 Thread Stephen Cowell

Top posting is a crime!

Here's how I do it in Atmel-ese... no OS, in the main while(1) loop:
<>
    modCount++;
...
        if (!(modCount%0x0008))// check Ethernet PHY once in a 
while to make sure we're connected

        {
            if (ethernetOK != ERR_OK)// only worried about initial try 
for connection here.

            {
                // test for Ethernet OK
                ethernetOK = init_ethernet();// put skips in place for 
second time through

            }
            else // this handles unplug notification... replug should 
be automatic after first successful init_ethernet()

            {
                static bool alarmLamps = false;

                gmac_enable_management(GMAC, true);    // this is 
necessary for direct access
                gmac_phy_read(GMAC, BOARD_GMAC_PHY_ADDR, GMII_BMSR, 
_stat1);// get status from PHY
                gmac_enable_management(GMAC, false);  // give PHY back 
to GMAC


                if ((ul_stat1 & GMII_LINK_STATUS) == 0)// We are 
unplugged, or something

                {// do something!  blink lamps etc






On 12/11/2019 5:07 PM, Trampas Stern wrote:
Thanks I was wondering about the "Link Status" but was not sure if you 
had to try and auto negotiate first.


Thanks again
Trampas

On Wed, Dec 11, 2019 at 5:14 PM Sergey A. Borshch via Mailing list for 
lwIP users mailto:lwip-users@nongnu.org>> wrote:


On 11.12.2019 23:55, Trampas Stern wrote:
> This is not directly LWIP related but I was wondering if there
was a way to
> detect when cable is unplugged through a GMII/RMII interface?
basic status register (index 1), bit 2.
>
> Specifically my hardware does not have the carrier sense pin
connected to
> microcontroller and I was wondering if there was a way to poll
the GMII/RMII
> registers to see when a cable is connected or not?
>
> I did not see anything in the documentation right off but
thought I would ask,
> as maybe I am not looking at the correct registers.
>
> Thanks
> Trampas
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org 
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>

---
  Regards, Sergey



___
lwip-users mailing list
lwip-users@nongnu.org 
https://lists.nongnu.org/mailman/listinfo/lwip-users


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users



___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Cable unplugged

2019-12-11 Thread Trampas Stern
Thanks I was wondering about the "Link Status" but was not sure if you had
to try and auto negotiate first.

Thanks again
Trampas

On Wed, Dec 11, 2019 at 5:14 PM Sergey A. Borshch via Mailing list for lwIP
users  wrote:

> On 11.12.2019 23:55, Trampas Stern wrote:
> > This is not directly LWIP related but I was wondering if there was a way
> to
> > detect when cable is unplugged through a GMII/RMII interface?
> basic status register (index 1), bit 2.
> >
> > Specifically my hardware does not have the carrier sense pin connected
> to
> > microcontroller and I was wondering if there was a way to poll the
> GMII/RMII
> > registers to see when a cable is connected or not?
> >
> > I did not see anything in the documentation right off but thought I
> would ask,
> > as maybe I am not looking at the correct registers.
> >
> > Thanks
> > Trampas
> >
> > ___
> > lwip-users mailing list
> > lwip-users@nongnu.org
> > https://lists.nongnu.org/mailman/listinfo/lwip-users
> >
>
> ---
>   Regards, Sergey
>
>
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Cable unplugged

2019-12-11 Thread Sergey A. Borshch

On 11.12.2019 23:55, Trampas Stern wrote:
This is not directly LWIP related but I was wondering if there was a way to 
detect when cable is unplugged through a GMII/RMII interface?

basic status register (index 1), bit 2.


Specifically my hardware does not have the carrier sense pin connected to 
microcontroller and I was wondering if there was a way to poll the GMII/RMII 
registers to see when a cable is connected or not?


I did not see anything in the documentation right off but thought I would ask, 
as maybe I am not looking at the correct registers.


Thanks
Trampas

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users



---
 Regards, Sergey



___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

[lwip-users] Cable unplugged

2019-12-11 Thread Trampas Stern
This is not directly LWIP related but I was wondering if there was a way to
detect when cable is unplugged through a GMII/RMII interface?

Specifically my hardware does not have the carrier sense pin connected to
microcontroller and I was wondering if there was a way to poll the
GMII/RMII registers to see when a cable is connected or not?

I did not see anything in the documentation right off but thought I would
ask, as maybe I am not looking at the correct registers.

Thanks
Trampas
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users