aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifmedia.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2001-05-26 09:27:08 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2001-05-26 09:27:08 +0000
commit419d8080a45c9baf85e2254f2f6f30edb11fb0bd (patch)
treeda27a0f86ea098d14264679df4a59a965ce9f57c /sbin/ifconfig/ifmedia.c
parent3344c5a17e9322ec55ad4e3026e2a1e547b89938 (diff)
downloadsrc-419d8080a45c9baf85e2254f2f6f30edb11fb0bd.tar.gz
src-419d8080a45c9baf85e2254f2f6f30edb11fb0bd.zip
Currently, each wireless networking driver has it's own control program
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>
Notes
Notes: svn path=/head/; revision=77217
Diffstat (limited to 'sbin/ifconfig/ifmedia.c')
-rw-r--r--sbin/ifconfig/ifmedia.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c
index 3ab28f87c79c..0e770f7d22a9 100644
--- a/sbin/ifconfig/ifmedia.c
+++ b/sbin/ifconfig/ifmedia.c
@@ -152,6 +152,13 @@ media_status(s, info)
else
printf("no ring");
break;
+ case IFM_IEEE80211:
+ /* XXX: Different value for adhoc? */
+ if (ifmr.ifm_status & IFM_ACTIVE)
+ printf("associated");
+ else
+ printf("no carrier");
+ break;
}
}
@@ -318,6 +325,15 @@ static struct ifmedia_description ifm_subtype_fddi_aliases[] =
static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] =
IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
+static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
+ IFM_SUBTYPE_IEEE80211_DESCRIPTIONS;
+
+static struct ifmedia_description ifm_subtype_ieee80211_aliases[] =
+ IFM_SUBTYPE_IEEE80211_ALIASES;
+
+static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
+ IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS;
+
static struct ifmedia_description ifm_subtype_shared_descriptions[] =
IFM_SUBTYPE_SHARED_DESCRIPTIONS;
@@ -350,7 +366,7 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
},
{
{ &ifm_shared_option_descriptions[0], 0 },
- { &ifm_subtype_ethernet_option_descriptions[0], 1 },
+ { &ifm_subtype_ethernet_option_descriptions[0], 0 },
{ NULL, 0 },
},
},
@@ -364,7 +380,7 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
},
{
{ &ifm_shared_option_descriptions[0], 0 },
- { &ifm_subtype_tokenring_option_descriptions[0], 1 },
+ { &ifm_subtype_tokenring_option_descriptions[0], 0 },
{ NULL, 0 },
},
},
@@ -378,7 +394,21 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
},
{
{ &ifm_shared_option_descriptions[0], 0 },
- { &ifm_subtype_fddi_option_descriptions[0], 1 },
+ { &ifm_subtype_fddi_option_descriptions[0], 0 },
+ { NULL, 0 },
+ },
+ },
+ {
+ {
+ { &ifm_subtype_shared_descriptions[0], 0 },
+ { &ifm_subtype_shared_aliases[0], 1 },
+ { &ifm_subtype_ieee80211_descriptions[0], 0 },
+ { &ifm_subtype_ieee80211_aliases[0], 1 },
+ { NULL, 0 },
+ },
+ {
+ { &ifm_shared_option_descriptions[0], 0 },
+ { &ifm_subtype_ieee80211_option_descriptions[0], 0 },
{ NULL, 0 },
},
},