summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifmedia.c
Commit message (Collapse)AuthorAgeFilesLines
* When setting media always and not just in case of switching to IFM_AUTOmarius2011-05-151-5/+1
| | | | | | | | | | | | | | | | | | clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. MFC after: 2 weeks
* Teach ifconfig(8) the handy shared option shortcut aliases the NetBSDmarius2011-01-051-1/+9
| | | | | | | | counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for "flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback" for "hw-loopback". MFC after: 1 week
* Remove the advertising clause from UCB copyrighted files in sbin. Thisjoel2010-12-121-4/+0
| | | | | is in accordance with the information at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
* When setting a media with no sub-type specified also reset the typemarius2010-11-131-1/+1
| | | | | | | specific options along with the global ones so these options don't stick when f.e. switching to IFM_AUTO. MFC after: 2 weeks
* When printing media with more than one media option set aggregate thesemarius2010-11-131-2/+5
| | | | | | | | in a comma delimited list instead of repeating "mediaopt" for each one. This matches how the options of the active media are printed with print_media_word() and brings us in line what NetBSD does. MFC after: 2 weeks
* Implementation of the upcoming Wireless Mesh standard, 802.11s, on therpaulo2009-07-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net80211 wireless stack. This work is based on the March 2009 D3.0 draft standard. This standard is expected to become final next year. This includes two main net80211 modules, ieee80211_mesh.c which deals with peer link management, link metric calculation, routing table control and mesh configuration and ieee80211_hwmp.c which deals with the actually routing process on the mesh network. HWMP is the mandatory routing protocol on by the mesh standard, but others, such as RA-OLSR, can be implemented. Authentication and encryption are not implemented. There are several scripts under tools/tools/net80211/scripts that can be used to test different mesh network topologies and they also teach you how to setup a mesh vap (for the impatient: ifconfig wlan0 create wlandev ... wlanmode mesh). A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled by default on GENERIC kernels for i386, amd64, sparc64 and pc98. Drivers that support mesh networks right now are: ath, ral and mwl. More information at: http://wiki.freebsd.org/WifiMesh Please note that this work is experimental. Also, please note that bridging a mesh vap with another network interface is not yet supported. Many thanks to the FreeBSD Foundation for sponsoring this project and to Sam Leffler for his support. Also, I would like to thank Gateworks Corporation for sending me a Cambria board which was used during the development of this project. Reviewed by: sam Approved by: re (kensmith) Obtained from: projects/mesh11s
* - Use size_t instead of int when appropriate;delphij2009-06-231-2/+2
| | | | | | - Use C99 sparse initialization. With these changes ifconfig(8) is WARNS=2 clean.
* Multi-bss (aka vap) support for 802.11 devices.sam2008-04-201-4/+12
| | | | | | | | | | | Note this includes changes to all drivers and moves some device firmware loading to use firmware(9) and a separate module (e.g. ral). Also there no longer are separate wlan_scan* modules; this functionality is now bundled into the wlan module. Supported by: Hobnob and Marvell Reviewed by: many Obtained from: Atheros (some bits)
* Update for revised 802.11 support:sam2007-06-111-6/+6
| | | | | | | | | | | | | | | | | | | | o revised channel handling support; ifconfig now queries the kernel to find the list of available channels and handles channel promotion; channel attributes can be specified as part of the channel; e.g. 36:a for channel 36 in 11a (as opposed to turbo A or HT A) o use channel list to map between freq and IEEE channel #; this eliminates all knowledge of how the mapping is done and fixes handling of cases where channels overlap in the IEEE channel # space but are distinct in the frequency+attributes space (e.g. PSB) o add new knobs: bgscan, ff (Atheors fast frames), dturbo (Atheros Dynamic Turbo mode), bgscanidle, bgscanintvl, scanvalid, roam:rssi11a, roam:rssi11b, roam:rssi11g, roam:rate11a, roam:rate11b, roam:rate11g (roaming parameters), burst, doth (forthcoming 11h support) o print contents of WME, ATH, WPA, RSN, information elements with -v option o print signal strength in dBm o print noise floor in dBm o add list txpow to print tx power caps/channel o change default channel display in status to be more informative
* Actually fully emulate NetBSD and print the media instance numbermarius2007-01-221-2/+3
| | | | | | | only for non-zero instances so the typical output for IFM_IEEE80211 type media doesn't overflow 80 columns. Requested by: sam
* - Display the media instance numbers and allow the user to set the activemarius2007-01-201-1/+25
| | | | | | | | one. This is based on NetBSD but unlike NetBSD this implementation prints the instance number for all media instances and doesn't skip it for the first one as I don't see a reason to suppress it except for the vague reason to preserve the output for single-instance configurations. - Fix some whitespace nits.
* Clear full-duplex when half-duplex flag is set. This actually makesjkim2006-12-191-2/+6
| | | | | 'mediaopt half-duplex' working as it should. It is now equivalent of '-mediaopt full-duplex'.
* (media_status): Factor common code between IFM_ETHER and IFM_ATM cases.thomas2006-08-221-21/+9
| | | | | | | | | (print_media_word, print_media_word_ifconfig): Remove unnecessary goto following test for null desc. PR: bin/102354 Submitted by: Ricardo Nabinger Sanchez <rnsanchez@gmail.com> MFC after: 1 week
* Grab the media from the passed in structure to put it into theambrisko2006-01-111-0/+1
| | | | | | | global structure. PR: bin/91399 Submitted by: Spencer Minear
* Change the ifr_media operation to only get its value and only setambrisko2005-01-271-79/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | its value once per ifconfig run. Use Sam's new callback operation to set it when everything is done. The purpose for this is that if you did something like ifconfig bge0 media 100baseTX mediaopt full-duplex multiple times it would end up causing the PHY to re-sync since it would send the IOCTLs: ifconfig bge0 media 100baseTX -mediaopt full-duplex ifconfig bge0 media 100baseTX mediaopt full-duplex This would cause the PHY to be updated twice even though there really wasn't any change since the check in sys/net/if_media.c would always fail. Caveat is that this doesn't fix the case of: ifconfig bge0 media autoselect etc. since in sys/net/if_media.c it forces an autoselect to go through the entire process in ifmedia_ioctl :-( : /* * If no change, we're done. * XXX Automedia may invole software intervention. * Keep going in case the the connected media changed. * Similarly, if best match changed (kernel debugger?). */ if ((IFM_SUBTYPE(newmedia) != IFM_AUTO) && (newmedia == ifm->ifm_media) && (match == ifm->ifm_cur)) return 0; Briefly looked at by: sam
* Fix special status reporting. Prior to the reorg there wassam2004-12-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | special-purpose code to display status for an interface for state that was not address-oriented. This status reporting was merged in to the address-oriented status reporting but did not work for link address reporting (as discovered with fwip interfaces). Correct this mis-merge and eliminate the bogus kludge that was used for link-level address reporting. o add an af_other_status method for an address family for reporting status of things like media, vlan, etc. o call the af_other_status methods after reporting address status for an interface o special-case link address status; when reporting all status for an interface invoke it specially prior to reporting af_other_status methods (since it requires the sockaddr_dl that is passed in to status separately from the rtmsg address state) o correct the calling convention for link address status; don't cast types, construct the proper parameter This fixes ifconfig on fwip interfaces.
* Overhaul to cleanup some of the tangled logic that's grown over the years.sam2004-12-081-6/+30
| | | | | | | | | | | | | | | | | | | | o break per-address family support out into separate files o modularize per-address family and functional operations using a registration mechanism; this permits configuration according to which files you include (but beware that order of the files is important to insure backwards compatibility) o many cleanups to eliminate incestuous behaviour, global variables, and poor coding practices (still much more to fix) The original motivation of this work was to support dynamic addition of functionality based on the interface so we can eliminate the various little control programs and so that vendors can distribute ifconfig plugins that support their in-kernel code. That work is still to be completed. o Update 802.11 support for all the new net80211 functionality; some of these operations (e.g. list *) may be better suited in a different program
* 802.11 mode bits are now masks; convert to suitsam2004-01-151-1/+1
|
* o correct mode request handlingsam2003-06-251-3/+6
| | | | | o add 802.11 alias support o suppress display of the default "mode autoselect" when showing the "phy mode"
* Add media types and options for ATM. While on most ATM cards media cannotharti2003-04-291-0/+34
| | | | | | | | be changed, it is very convenient to be able to toggle SDH/Sonet, idle/unassigned cells and scrambled mode and to see the carrier state. Reviewed by: -arch (if_media.h definitions)
* add a "mode" directive to specify the operating mode for multi-mode devices;sam2003-04-281-3/+118
| | | | | this is mostly intended for use with multi-mode 802.11 devices that support some combination of 11a, 11b, and 11g
* De-__P, use ansi function definitionsimp2002-04-181-54/+25
|
* Back out previous commit.asmodai2001-11-151-2/+0
| | | | | | | | | This works for wi(4), but apparantly other wireless drivers seem to do the right thing. Submitter and yours truly both got Mislead(tm). Submitted by: udp <udp@sneakerz.org>
* Report ad hoc mode correctly.asmodai2001-11-151-0/+2
| | | | Submitted by: udp <udp@sneakerz.org>
* Cosmetic: Don't output a blank line if a driver providesyar2001-11-021-2/+1
| | | | | | | | no media status. PR: bin/30587 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> MFC after: 1 week
* When using interfaces that support if_media, the supported media list isphk2001-05-291-22/+120
| | | | | | | | | printed on a single, very long, and generally unreadable line. This isn't very useful. It's also really ugly and most of the time you don't care what media is supported anyway. PR: 27701 Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
* Currently, each wireless networking driver has it's own control programphk2001-05-261-3/+33
| | | | | | | | | | | | despite the fact that most people want to set exactly the same settings regardless of which card they have. It has been repeatidly suggested that this configuration should be done via ifconfig. This patch implements the required functionality in ifconfig and add support to the wi and an drivers. It also provides partial, untested support for the awi driver. PR: 25577 Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Removed most unused includes of <net/if_var.h> outside the kernel.bde1998-01-161-2/+1
|
* Make the supported media info output the default.peter1997-10-161-2/+2
| | | | | | The -m switch is now accepted for backwards compatability. Suggested by: davidg
* Clean up some more. Move parsing of sysctl iflist data into a singlepeter1997-05-101-2/+3
| | | | | | place rather than updating the main loop's index variables from within a subroutine and other revolting things like that. Move some more globals into local variables.
* Grumble.. My last patchup here didn't quite work either. I hate thispeter1997-05-101-4/+7
| | | | | | | program and it's use of global variables. Somehow, I managed to miss the most obvious case.. "ifconfig ed0 10.0.0.1" failed (no "inet") Submitted by: dfr
* Bring in the ifmedia components of NetBSD's ifconfig as a seperate file.peter1997-05-041-0/+526
Obtained from: Jason Thorpe via NetBSD
OpenPOWER on IntegriCloud