diff options
author | sam <sam@FreeBSD.org> | 2003-06-25 15:05:17 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-06-25 15:05:17 +0000 |
commit | ca22b80a4f44057594bc36faea8b3353679b764f (patch) | |
tree | ac71900cbb1344f34b72301069c25fca9c081e49 /sbin/ifconfig | |
parent | 9d829495776976ffe508763ed0df80b0e1174178 (diff) | |
download | FreeBSD-src-ca22b80a4f44057594bc36faea8b3353679b764f.zip FreeBSD-src-ca22b80a4f44057594bc36faea8b3353679b764f.tar.gz |
o correct mode request handling
o add 802.11 alias support
o suppress display of the default "mode autoselect" when showing the "phy mode"
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifmedia.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index e1b3d39..d8e9d88 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -325,7 +325,6 @@ setmediamode(const char *val, int d, int s, const struct afswtch *afp) free(mwords); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = ifmr.ifm_current; ifr.ifr_media = (ifmr.ifm_current & ~IFM_MMASK) | IFM_MAKEMODE(mode); if (ioctl(s, SIOCSIFMEDIA, (caddr_t)&ifr) < 0) @@ -378,6 +377,9 @@ static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] = struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS; +struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = + IFM_SUBTYPE_IEEE80211_MODE_ALIASES; + static struct ifmedia_description ifm_subtype_atm_descriptions[] = IFM_SUBTYPE_ATM_DESCRIPTIONS; @@ -408,7 +410,7 @@ struct ifmedia_type_to_subtype { struct { struct ifmedia_description *desc; int alias; - } modes[2]; + } modes[3]; }; /* must be in the same order as IFM_TYPE_DESCRIPTIONS */ @@ -479,6 +481,7 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = { }, { { &ifm_subtype_ieee80211_mode_descriptions[0], 0 }, + { &ifm_subtype_ieee80211_mode_aliases[0], 0 }, { NULL, 0 }, }, }, @@ -701,7 +704,7 @@ print_media_word(int ifmw, int print_toptype) if (print_toptype) { desc = get_mode_desc(ifmw, ttos); - if (desc != NULL) + if (desc != NULL && strcasecmp("autoselect", desc->ifmt_string)) printf(" mode %s", desc->ifmt_string); } |