Re: bugfixes for dc(4)

2010-12-14 Thread Mark Kettenis
 Date: Mon, 13 Dec 2010 23:24:52 -0500 (EST)
 From: logana...@devio.us (Loganaden Velvindron)
 
 Hi, I separated the mclgeti part from the bugfixes for PNIC. Give it a try.

What does this actually fix?

 Index: src/sys/dev/ic/dc.c
 ===
 RCS file: /cvs/src/sys/dev/ic/dc.c,v
 retrieving revision 1.121
 diff -u -p -r1.121 dc.c
 --- src/sys/dev/ic/dc.c   7 Sep 2010 16:21:42 -   1.121
 +++ src/sys/dev/ic/dc.c   14 Dec 2010 04:18:50 -
 @@ -1224,7 +1224,7 @@ dc_setcfg(struct dc_softc *sc, int media
   }
  
   if (i == DC_TIMEOUT) {
 - if (!(isr  DC_ISR_TX_IDLE)  !DC_IS_ASIX(sc))
 + if (!(isr  DC_ISR_TX_IDLE)  !DC_IS_ASIX(sc)  
 !DC_IS_PNIC(sc))
   printf(%s: failed to force tx to idle state\n,
   sc-sc_dev.dv_xname);
   if (!((isr  DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED ||
 @@ -1792,9 +1792,11 @@ hasmac:
   ifmedia_add(sc-sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
   ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_NONE);
   printf(%s: MII without any PHY!\n, sc-sc_dev.dv_xname);
 - } else if (sc-dc_type == DC_TYPE_21145) {
 + } else if (sc-dc_type == DC_TYPE_21145)
   ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_10_T);
 - } else
 +   else if (sc-dc_type == DC_TYPE_PNIC)
 + ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_10_T);
 +   else
   ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
  
   if (DC_IS_DAVICOM(sc)  sc-dc_revision = DC_REVISION_DM9102A)



Re: bugfixes for dc(4)

2010-12-14 Thread Loganaden Velvindron
Hi,
It fixes the idle timeout messages (which is not an issue on PNIC) and sets the 
speed to 10BaseTX, since autonegociation is broken on PNIC.

//Logan
C-x-C-c



Re: bugfixes for dc(4)

2010-12-14 Thread Kevin Chadwick
On Tue, 14 Dec 2010 04:16:46 -0500 (EST)
logana...@devio.us (Loganaden Velvindron) wrote:

 Hi,
 It fixes the idle timeout messages (which is not an issue on PNIC) and sets 
 the speed to 10BaseTX, since autonegociation is broken on PNIC.
 
 //Logan
 C-x-C-c
 

I had a dc with timeout messages during boot and trouble getting it to
then work. I think?? I had to fix it with a hostname.dc0 config and it
worked for over a year, but after a reinstall, I had lost track of what
I had done previously to fix it and so just swapped the nic. dc seems
to get some praise in the man page too.



bugfixes for dc(4)

2010-12-13 Thread Loganaden Velvindron
Hi, I separated the mclgeti part from the bugfixes for PNIC. Give it a try.

Thanks

Index: src/sys/dev/ic/dc.c
===
RCS file: /cvs/src/sys/dev/ic/dc.c,v
retrieving revision 1.121
diff -u -p -r1.121 dc.c
--- src/sys/dev/ic/dc.c 7 Sep 2010 16:21:42 -   1.121
+++ src/sys/dev/ic/dc.c 14 Dec 2010 04:18:50 -
@@ -1224,7 +1224,7 @@ dc_setcfg(struct dc_softc *sc, int media
}
 
if (i == DC_TIMEOUT) {
-   if (!(isr  DC_ISR_TX_IDLE)  !DC_IS_ASIX(sc))
+   if (!(isr  DC_ISR_TX_IDLE)  !DC_IS_ASIX(sc)  
!DC_IS_PNIC(sc))
printf(%s: failed to force tx to idle state\n,
sc-sc_dev.dv_xname);
if (!((isr  DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED ||
@@ -1792,9 +1792,11 @@ hasmac:
ifmedia_add(sc-sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_NONE);
printf(%s: MII without any PHY!\n, sc-sc_dev.dv_xname);
-   } else if (sc-dc_type == DC_TYPE_21145) {
+   } else if (sc-dc_type == DC_TYPE_21145)
ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_10_T);
-   } else
+ else if (sc-dc_type == DC_TYPE_PNIC)
+   ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_10_T);
+ else
ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
 
if (DC_IS_DAVICOM(sc)  sc-dc_revision = DC_REVISION_DM9102A)