Re: Question about Freebsd driver

2001-12-09 Thread Mike Smith


 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!!

From the question, I infer that you are referring to Ethernet device 
drivers.  In the FreeBSD model, devices fit into one or more of a set of 
classes.  Each class has an established, device-independant mechanism for 
controlling driver parameters.  In the case of Ethernet drivers, 
parameters are controlled via the driver's ioctl interface.

You should be able to find good examples of this in the source for other 
drivers similar to your own.  If you have more specific questions, please 
feel free to ask them here.

Regards,
Mike



-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
   V I C T O R Y   N O T   V E N G E A N C E



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



Question about Freebsd driver

2001-12-07 Thread Yiping Chen

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!!



--
Yiping Chen
VIA Technologies, Inc.
LAN Software Dept.
533 Chung Cheng Road 8F
Hsin Tien, Taipei
Taiwan
TEL : 886-2-22185452  EXT.7512
FAX : 886-2-22185453
E-mail : [EMAIL PROTECTED]


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



Re: Question about Freebsd driver

2001-12-07 Thread Holger Kipp

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!!

I'm not sure if current is the correct mailing list for asking
questions.

Anyway, if you're refering to network device drivers, see 

man ifconfig   (especialle media and mediaopt)
man fxp
man txp
[...]

For a list of devices, see /usr/src/sys/i386/conf/LINT

Regards,
Holger Kipp

-- 
Holger Kipp, Dipl.-Math., Systemadministrator  | alogis AG
Fon: +49 (0)30 / 43 65 8 - 114 | Berliner Strasse 26
Fax: +49 (0)30 / 43 65 8 - 214 | D-13507 Berlin Tegel
email: [EMAIL PROTECTED]  | http://www.alogis.com

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



Re: Question about Freebsd driver

2001-12-07 Thread Terry Lambert

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
/usr/bin/foo
# cd /usr/src/usr.bin/foo
# ls
foo.c

# which fee
/sbin/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