From uhclem@handsoff.iadfw.net  Thu Sep 25 12:09:47 1997
Received: from handsoff.iadfw.net (handsoff.iadfw.net [206.66.13.72])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA06127
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 25 Sep 1997 12:09:46 -0700 (PDT)
Received: (from uhclem@localhost) by handsoff.iadfw.net (8.7.5/8.7.3) id NAA18169; Thu, 25 Sep 1997 13:55:24 -0500 (CDT)
Message-Id: <199709251855.NAA18169@handsoff.iadfw.net>
Date: Thu, 25 Sep 1997 13:55:24 -0500 (CDT)
From: uhclem@nemesis.lonestar.org
Reply-To: uhclem@nemesis.lonestar.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: Device driver de won't accept "media" parameters to go Full Duplex:FDIV071
X-Send-Pr-Version: 3.2

>Number:         4628
>Category:       kern
>Synopsis:       Device driver de won't accept "media" parameters to go Full Duplex:FDIV071
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 25 12:10:01 PDT 1997
>Closed-Date:    Fri Sep 26 05:42:01 PDT 1997
>Last-Modified:  Fri Sep 26 05:57:31 PDT 1997
>Originator:     Frank Durda IV
>Release:        FreeBSD 2.2-970921-RELENG i386
>Organization:
None
>Environment:


2.2-970921-RELENG system.   

>Description:


On a system that has been running a 0618 snap using the DE driver
in full duplex mode (by downloading the newer drivers directly from
3AM software), I find that using these drivers with the 970921 kernel will
no longer allow you to select full-duplex mode using the -link0 link1 -link2
parameters in ifconfig.  This appears to be because the 3AM drivers detect
the presence of the new if_media mechanisms in the 970921 kernel.

I then reverted to a completely stock 970921 setup (abandoning the add-on
DE driver), and changed rc.conf (small problem here since ifconfig media
command is documented as expecting parms in double quotes and the ifconfig
line in rc.conf is already in double quotes), and the setting was rejected
with the error:

	ifconfig: SIOCGIFMEDIA: Invalid argument


The argument I am trying to pass is "Full Duplex 10baseT", exactly
as it appears in the 970921 pci/if_de.c module.  (The board in use
is a PCI adapter.)   So I tried the other choices listed in the DE
driver and all return the same error message, even when entered from
the command line:
	ifconfig de0 media "Full Duplex 10baseT"
	ifconfig: SIOCGIFMEDIA: Invalid argument
	ifconfig de0 media "10baseT"
	ifconfig: SIOCGIFMEDIA: Invalid argument

I can't tell that this "media" command works at all.

Note that because the choices for the "media" command are not documented
in the man 4 de page, the source code was the only place to obtain what
appears to be the valid choices.

Because we could not get around this problem and must use full duplex,
we were forced to go back to the 0618 kernel we had been using previously
with the 3AM driver and are happily doing full duplex again.  The reason
we tried to go with the newer kernel was to try to get relief from the SCSI
"timed-out while idle errors", but even the 970921 kernel still produces
these (although the volume is reduced).  The SCSI problems will be the
subject of another problem report.


>How-To-Repeat:

With a DE card (2.3 or 2.4 step) installed, attempt to set the card
into Full duplex mode using the ifconfig media command.   You must 
look in the source code since the parameters are not documented.

>Fix:
	
Apart from going back to pre-"if_media" driver code, unknown.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Fri Sep 26 05:42:01 PDT 1997 
State-Changed-Why:  
If one modifies a shell script (such as /etc/rc.conf) one should 
understand basic shell quoting. 

One way might be to do something like this: 
ifconfig_de0="mumble -media 'foo bar'" 
or 
ifconfig_de0='mumble -media "foo bar"' 

The requirement is that the argument string presented to the -media 
switch is a single argument. 

To get the list of currently supported medias for a driver, use 'ifconfig -m'. 

What you are probably after is: 
ifconfig_de0="mumble media 10baseT/UTP mediaopt full-duplex" 
(or s/UTP/BNC/) 

Here, with a SMC9332BDT, the choices are: 
supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP 

So, one can:  ifconfig de0 media 100baseT mediaopt full-duplex 
to override the autoselect setting. 
>Unformatted:
