Sponsored Content
Top Forums Programming ndd commands using function calls Post 302298242 by binary_boy on Tuesday 17th of March 2009 03:53:46 AM
Old 03-17-2009
ndd

Actually you can write a litle bash script to get all the informations you require:

all the commands below, just assemble them to do anything you need:

#To find which driver, interfaces you have:
<ifconfig -a>

Here are some NIC drivers userd by Solaris (just in case)
# hme - Sun Fast-Ethernet device driver
# qfe - Sun qfe Quad Fast-Ethernet device driver
# eri - Fast-Ethernet device driver
# fjqe - Fujitsu PCI Quad 10/100 Ethernet
# fjgi - Fujitsu PCI Gigabit Ethernet
# e1000g - Gigabit Ethernet driver Intel PRO/1000
# bge - Gigabit Ethernet driver for Broadcom BCM57xx
# nxge - Sun 10/1 Gigabit Ethernet network driver
# ce - Cassini Gigabit-Ethernet device driver

#Check the which instance of NIC port we are connecting to:

ndd -get /dev/interface instance

#Check status:
ndd -get /dev/interface link_status (0=down, 1=up)

#Check link mode:
ndd -get /dev/interface link_mode (0=half-duplex, 1=full-duplex)

#Check link speed :
ndd -get /dev/interface link_speed (0=10mbs, 1=100mbs)

#Check autonegotiation capabilities:
ndd -get /dev/interface adv_autoneg_cap (0=false, 1=true)

#Set autonegotiation:
ndd -set /dev/intergace adv_autoneg_cap 1 (set to true)

#Finding errors in dmesg
grep -i <interface> /var/adm/messages

Note: Those changes written with ndd -set, are not persisten, they will be lost at system reboot. But if you like to add them permanently, you may consider editing file /kernel/drv/<interface>.conf


Hope this helped Smilie
______________________
The power of Solaris cannot be experienced on an Intel machine!!!
 

10 More Discussions You Might Find Interesting

1. AIX

overriding function calls without recompiling

i want to replace the *alloc and free function calls in an existing project with my own functions, to be able to log the adresses etc in a text file. (memoryleak debugging) I think LD_PRELOAD is what i am looking for. That way i could create a Library with my own malloc functions and link them... (1 Reply)
Discussion started by: Lazzar
1 Replies

2. Solaris

ndd help

Hi Guys, I need help with ndd. I was going through network FAQ but i have more questions then answers regarding ndd. #ndd -set /dev/hme instance 0 #ndd -set /dev/hme adv_100fdx_cap 1 #ndd -set /dev/hme adv_100hdx_cap 0 #ndd -set /dev/hme adv_10fdx_cap 0 #ndd -set /dev/hme adv_10hdx_cap 0... (2 Replies)
Discussion started by: nitinkgoud
2 Replies

3. IP Networking

Identification of data calls & voice calls

Is there any facility to filter/identify the data calls and voice calls coming throug modem? OR Can we get the data or voice calls information through a script(preferably C Kermit)? (0 Replies)
Discussion started by: pcsaji
0 Replies

4. Solaris

Questions related to ndd commands

Hello Gurus I would like to know more about ndd commands related to ethernet(NIC) like how to set link_status, link_speed & link_mode as I know how to check these value. And I also would like to know how to make these setting permanents after reboot as I know that these setting will vanish... (5 Replies)
Discussion started by: amity
5 Replies

5. Programming

Tracing Function Calls in a program

Apart from writing debug and statements in constructors is there any way by which we can trace the function call stack at any depth? The issue that we always face is that when program crashes (Web Server running on Linux) we have no idea where it crashes and we have to do the hard way of... (1 Reply)
Discussion started by: uunniixx
1 Replies

6. Solaris

ndd matters

Hi, I would like to know whether there is any config file that i can refer to for the result of 'ndd -get /dev/tcp tcp_time_wait_interval'? When i man 'ndd', there is one statement which is -> Each driver chooses which parameters to make visible using ndd. Does it answering my question above... (3 Replies)
Discussion started by: honmin
3 Replies

7. UNIX for Advanced & Expert Users

Using Library Calls (3) as commands

My understanding is when you see a man page command with a (3), is that this is a library call such as XSetScreenSaver(3) .. Sometimes these "calls" seem to do exactly what I need from a command. is there a way to access these calls from the terminal and just run them like a normal binary? How... (1 Reply)
Discussion started by: glev2005
1 Replies

8. Shell Programming and Scripting

Question about Function calls

Hello everyone, here's my problem: I want to create two shell scripts. one of them should includes some functions, the other one just the function calls. Is this possible? Can i call a function which is placed in a scriptfile eg functions.sh out of another script eg call.sh? :confused: And if... (2 Replies)
Discussion started by: Sebi0815
2 Replies

9. Shell Programming and Scripting

How to achieve Parellelism for the function which has multiple cp commands

Hi, Here is my requirement. Currently, there is a function which gets called in a for loop 2 times. doCopy() { cp /src/a*.jar /target/ cp /src/b*.jar /target/ cp /src/c*.jar /target } Since it is called sequentially from the for loop, I was asked to make parellel copy to... (7 Replies)
Discussion started by: kgsrinivas
7 Replies

10. UNIX for Advanced & Expert Users

Linkage of POSIX threads function calls

I wonder if someone knows what is the rationale behind linking function calls of the POSIX threads library at link-time vs. run-time. For example, if I create the following program: #include <pthread.h> void noop() { return; } int main() { pthread_self(); pthread_atfork(noop,... (1 Reply)
Discussion started by: jsimsa
1 Replies
bge(7D) 																   bge(7D)

NAME
bge - SUNW,bge Gigabit Ethernet driver for Broadcom BCM57xx SYNOPSIS
/dev/bge* The bge Gigabit Ethernet driver is a multi-threaded, loadable, clonable, GLD-based STREAMS driver supporting the Data Link Provider Inter- face, dlpi(7P), on Broadcom BCM57xx (BCM5700/5701/5703/5704/5705/5705M/5714/5721/5751/5751M/5782/5788 on ) Gigabit Ethernet controllers fitted to the system motherboard. With the exception of BCM5700/BCM5701/BCM5704S, these devices incorporate both MAC and PHY functions and provide three-speed (copper) Ethernet operation on the RJ-45 connectors. (BCM5700/BCM5701/BCM5704S do not have a PHY integrated into the MAC chipset.) The bge driver functions include controller initialization, frame transmit and receive, promiscuous and multicast support, and error recov- ery and reporting. The bge driver and hardware support auto-negotiation, a protocol specified by the 1000 Base-T standard. Auto-negotiation allows each device to advertise its capabilities and discover those of its peer (link partner). The highest common denominator supported by both link partners is automatically selected, yielding the greatest available throughput, while requiring no manual configuration. The bge driver also allows you to configure the advertised capabilities to less than the maximum (where the full speed of the interface is not required), or to force a specific mode of operation, irrespective of the link partner's advertised capabilities. APPLICATION PROGRAMMING INTERFACE
The cloning character-special device, /dev/bge, is used to access all BCM57xx devices ( (BCM5700/5701/5703/5704, 5705/5714/5721/5751/5751M/5782 on ) fitted to the system motherboard. The bge driver is managed by the dladm(1M) command line utility, which allows VLANs to be defined on top of bge instances and for bge instances to be aggregated. See dladm(1M) for more details. You must send an explicit DL_ATTACH_REQ message to associate the opened stream with a particular device (PPA). The PPA ID is interpreted as an unsigned integer data type and indicates the corresponding device instance (unit) number. The driver returns an error (DL_ERROR_ACK) if the PPA field value does not correspond to a valid device instance number for the system. The device is initialized on first attach and de- initialized (stopped) at last detach. The values returned by the driver in the DL_INFO_ACK primitive in response to a DL_INFO_REQ are: o Maximum SDU is 1500 (ETHERMTU - defined in <sys/ethernet.h>). o Minimum SDU is 0. o DLSAP address length is 8. o MAC type is DL_ETHER. o SAP length value is -2, meaning the physical address component is followed immediately by a 2-byte SAP component within the DLSAP address. o Broadcast address value is the Ethernet/IEEE broadcast address (FF:FF:FF:FF:FF:FF). Once in the DL_ATTACHED state, you must send a DL_BIND_REQ to associate a particular Service Access Point (SAP) with the stream. CONFIGURATION
By default, the bge driver performs auto-negotiation to select the link speed and mode. Link speed and mode can be any one of the follow- ing, (as described in the IEEE803.2 standard): o 1000 Mbps, full-duplex o 1000 Mbps, half-duplex o 100 Mbps, full-duplex o 100 Mbps, half-duplex o 10 Mbps, full-duplex o 10 Mbps, half-duplex The auto-negotiation protocol automatically selects: o Speed (1000 Mbps, 100 Mbps, or 10 Mbps) o Operation mode (full-duplex or half-duplex) as the highest common denominator supported by both link partners. Because the bge device supports all modes, the effect is to select the highest throughput mode supported by the other device. Alternatively, you can set the capabilities advertised by the bge device using ndd(1M). The driver supports a number of parameters whose names begin with adv_ (see below). Each of these parameters contains a boolean value that determines whether the device advertises that mode of operation. The adv_pause_cap indicates whether half/full duplex pause is advertised to link partner. And the adv_asym_pause_cap can be set to advertise to link partner that asymmetric pause is desired. In addition, bge uses adv_100T4_cap to advertise its 100T4 capabil- ity. The adv_autoneg_cap parameter controls whether autonegotiation is performed. If adv_autoneg_cap is set to 0, the driver forces the mode of operation selected by the first non-zero parameter in priority order as listed below: (highest priority/greatest throughput) adv_1000fdx_cap 1000Mbps full duplex adv_1000hdx_cap 1000Mpbs half duplex adv_100fdx_cap 100Mpbs full duplex adv_100hdx_cap 100Mpbs half duplex adv_10fdx_cap 10Mpbs full duplex adv_10hdx_cap 10Mpbs half duplex (lowest priority/least throughput) For example, to prevent the device 'bge2' from advertising gigabit capabilities, enter (as super-user): # ndd -set /dev/bge2 adv_1000hdx_cap 0 # ndd -set /dev/bge2 adv_1000fdx_cap 0 All capabilities default to enabled. Note that changing any capability parameter causes the link to go down while the link partners renego- tiate the link speed/duplex using the newly changed capabilities. The current settings of the parameters may be found using ndd -get. In addition, the driver exports the current state, speed, duplex set- ting, and working mode of the link via ndd parameters (these are read only and may not be changed). For example, to check link state of device bge0: # ndd -get /dev/bge0 link_status 1 # ndd -get /dev/bge0 link_speed 100 # ndd -get /dev/bge0 link_duplex 2 # ndd -get /dev/bge0 link_rx_pause 1 # ndd -get /dev/bge0 link_tx_pause 1 The output above indicates that the link is up and running at 100Mbps full-duplex with its rx/tx direction pause capability. In addition, the driver exports its working mode by loop_mode. If it is set to 0, the loopback mode is disabled. /dev/bge* Character special device. /kernel/drv/sparcv9/bge SPARC bge driver binary. /kernel/drv/amd64/bge kernel module for 64-bit platform /platform/i86pc/kernel/drv/bge 32-bit bge driver binary. /platform/i86pc/kernel/drv/amd64/bge 64-bit bge driver binary. See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |SPARC, | +-----------------------------+-----------------------------+ dladm(1M), attributes(5), streamio(7I), dlpi(7P) Writing Device Drivers STREAMS Programming Guide Network Interfaces Programmer's Guide 23 Feb 2005 bge(7D)
All times are GMT -4. The time now is 12:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy