Yiping Chen wrote:
> Dear Sir:
> I have a question about Freebsd driver.
> If we want to support some options in driver(like speed and duplex mode
> setting) ,
> user can use this option to change driver configurations.
> I am not sure whether freebsd driver support driver parameter or something
> else.
> Can you give me some suggestions? Thanks!!

For LAN drivers, you can set a large number of predefined options,
such as spped and duplex, as well as vendor specific options.

The command you are looking for is "ifconfig".

To find the source code to any FreeBSD command, you should type
"which command" at a root prompt.  For example, if the command
you were looking for was "foo" or "fee":

        # which foo
        # cd /usr/src/usr.bin/foo
        # ls

        # which fee
        # cd /usr/src/sbin/fee
        # ls
        fee .c

The ifconfig command is odd in that it gathers up its arguments,
and then ioctl's down on a socket descriptor.  This is handled by
code in the /sys/net directory, and then in the drivers itself.

It's best if you start with code in a specific driver.

As a general rule, for things like duplex and speed, you will want
to write your driver to autonegotiate, if the hardware can do that,
since that's one less thing the user has to worry about.  The use
of duplex and speed settings us usually _ONLY_ to defeat the use
of autonegotiation, and force user settings.  Many cards support
doing this (for example, when using FreeBSD as a router or a hub).

Hope this helps.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to