o correct mode request handling

o add 802.11 alias support
o suppress display of the default "mode autoselect" when showing the "phy mode"
This commit is contained in:
Sam Leffler 2003-06-25 15:05:17 +00:00
parent 2dd59091ae
commit 2559c28876
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116820

View File

@ -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);
}