From c8e8f119a90dd4a7447c44cd2d630277d38d3171 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 20 Apr 2004 10:35:31 +0000 Subject: 2004-04-20 Ralf Corsepius * libchip/network/if_media.h: Update from FreeBSD. * libchip/network/open_eth.c, libchip/network/cs8900.c, libchip/network/i82586.c: #include . --- c/src/ChangeLog | 6 ++ c/src/libchip/network/cs8900.c | 2 +- c/src/libchip/network/i82586.c | 2 +- c/src/libchip/network/if_media.h | 149 +++++++++++++++++++++++++++++++-------- c/src/libchip/network/open_eth.c | 2 + 5 files changed, 130 insertions(+), 31 deletions(-) (limited to 'c') diff --git a/c/src/ChangeLog b/c/src/ChangeLog index 4066e403b5..150551550e 100644 --- a/c/src/ChangeLog +++ b/c/src/ChangeLog @@ -1,3 +1,9 @@ +2004-04-20 Ralf Corsepius + + * libchip/network/if_media.h: Update from FreeBSD. + * libchip/network/open_eth.c, libchip/network/cs8900.c, + libchip/network/i82586.c: #include . + 2004-04-14 Ralf Corsepius * aclocal/rtems-top.4: Remove RTEMS_ROOT (Obsolete). diff --git a/c/src/libchip/network/cs8900.c b/c/src/libchip/network/cs8900.c index 9774642463..3dbce70a8e 100644 --- a/c/src/libchip/network/cs8900.c +++ b/c/src/libchip/network/cs8900.c @@ -26,7 +26,7 @@ */ -#include +#include #include #include diff --git a/c/src/libchip/network/i82586.c b/c/src/libchip/network/i82586.c index 7ffc0edc12..788641d027 100644 --- a/c/src/libchip/network/i82586.c +++ b/c/src/libchip/network/i82586.c @@ -154,13 +154,13 @@ Mode of operation: #include #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/c/src/libchip/network/if_media.h b/c/src/libchip/network/if_media.h index 926a803ddb..e52c89c021 100644 --- a/c/src/libchip/network/if_media.h +++ b/c/src/libchip/network/if_media.h @@ -1,5 +1,5 @@ /* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */ -/* $FreeBSD: /repoman/r/ncvs/src/sys/net/if_media.h,v 1.18 2002/07/14 21:58:19 kbyanc Exp $ */ +/* $FreeBSD: src/sys/net/if_media.h,v 1.26 2004/01/26 11:52:32 harti Exp $ */ /* * Copyright (c) 1997 @@ -113,7 +113,8 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, * 0-4 Media variant * 5-7 Media type * 8-15 Type specific options - * 16-19 RFU + * 16-18 Mode (for multi-mode devices) + * 19 RFU * 20-27 Shared (global) options * 28-31 Instance */ @@ -171,6 +172,7 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, * IEEE 802.11 Wireless */ #define IFM_IEEE80211 0x00000080 +/* NB: 0,1,2 are auto, manual, none defined below */ #define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */ #define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */ #define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */ @@ -178,19 +180,46 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, #define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */ #define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */ #define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */ -#define IFM_IEEE80211_ODFM6 10 /* ODFM 6Mbps */ -#define IFM_IEEE80211_ODFM9 11 /* ODFM 9Mbps */ -#define IFM_IEEE80211_ODFM12 12 /* ODFM 12Mbps */ -#define IFM_IEEE80211_ODFM18 13 /* ODFM 18Mbps */ -#define IFM_IEEE80211_ODFM24 14 /* ODFM 24Mbps */ -#define IFM_IEEE80211_ODFM36 15 /* ODFM 36Mbps */ -#define IFM_IEEE80211_ODFM48 16 /* ODFM 48Mbps */ -#define IFM_IEEE80211_ODFM54 17 /* ODFM 54Mbps */ -#define IFM_IEEE80211_ODFM72 18 /* ODFM 72Mbps */ +#define IFM_IEEE80211_OFDM6 10 /* OFDM 6Mbps */ +#define IFM_IEEE80211_OFDM9 11 /* OFDM 9Mbps */ +#define IFM_IEEE80211_OFDM12 12 /* OFDM 12Mbps */ +#define IFM_IEEE80211_OFDM18 13 /* OFDM 18Mbps */ +#define IFM_IEEE80211_OFDM24 14 /* OFDM 24Mbps */ +#define IFM_IEEE80211_OFDM36 15 /* OFDM 36Mbps */ +#define IFM_IEEE80211_OFDM48 16 /* OFDM 48Mbps */ +#define IFM_IEEE80211_OFDM54 17 /* OFDM 54Mbps */ +#define IFM_IEEE80211_OFDM72 18 /* OFDM 72Mbps */ + #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */ #define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */ +#define IFM_IEEE80211_TURBO 0x00001000 /* Operate in turbo mode */ +#define IFM_IEEE80211_MONITOR 0x00002000 /* Operate in monitor mode */ + +/* operating mode for multi-mode devices */ +#define IFM_IEEE80211_11A 0x00010000 /* 5Ghz, OFDM mode */ +#define IFM_IEEE80211_11B 0x00020000 /* Direct Sequence mode */ +#define IFM_IEEE80211_11G 0x00030000 /* 2Ghz, CCK mode */ +#define IFM_IEEE80211_FH 0x00040000 /* 2Ghz, GFSK mode */ + +/* + * ATM + */ +#define IFM_ATM 0x000000a0 +#define IFM_ATM_UNKNOWN 3 +#define IFM_ATM_UTP_25 4 +#define IFM_ATM_TAXI_100 5 +#define IFM_ATM_TAXI_140 6 +#define IFM_ATM_MM_155 7 +#define IFM_ATM_SM_155 8 +#define IFM_ATM_UTP_155 9 +#define IFM_ATM_MM_622 10 +#define IFM_ATM_SM_622 11 +#define IFM_ATM_VIRTUAL 12 +#define IFM_ATM_SDH 0x00000100 /* SDH instead of SONET */ +#define IFM_ATM_NOSCRAMB 0x00000200 /* no scrambling */ +#define IFM_ATM_UNASSIGNED 0x00000400 /* unassigned cells */ /* * Shared media sub-types @@ -217,6 +246,8 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, #define IFM_IMASK 0xf0000000 /* Instance */ #define IFM_ISHIFT 28 /* Instance shift */ #define IFM_OMASK 0x0000ff00 /* Type specific options */ +#define IFM_MMASK 0x00070000 /* Mode */ +#define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ /* @@ -233,6 +264,7 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, #define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK)) +#define IFM_MODE(x) ((x) & IFM_MMASK) #define IFM_INST_MAX IFM_INST(IFM_IMASK) @@ -241,6 +273,8 @@ int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, */ #define IFM_MAKEWORD(type, subtype, options, instance) \ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) +#define IFM_MAKEMODE(mode) \ + (((mode) << IFM_MSHIFT) & IFM_MMASK) /* * NetBSD extension not defined in the BSDI API. This is used in various @@ -259,6 +293,7 @@ struct ifmedia_description { { IFM_TOKEN, "Token ring" }, \ { IFM_FDDI, "FDDI" }, \ { IFM_IEEE80211, "IEEE 802.11 Wireless Ethernet" }, \ + { IFM_ATM, "ATM" }, \ { 0, NULL }, \ } @@ -364,15 +399,15 @@ struct ifmedia_description { { IFM_IEEE80211_DS5, "DS/5.5Mbps" }, \ { IFM_IEEE80211_DS11, "DS/11Mbps" }, \ { IFM_IEEE80211_DS22, "DS/22Mbps" }, \ - { IFM_IEEE80211_ODFM6, "ODFM/6Mbps" }, \ - { IFM_IEEE80211_ODFM9, "ODFM/9Mbps" }, \ - { IFM_IEEE80211_ODFM12, "ODFM/12Mbps" }, \ - { IFM_IEEE80211_ODFM18, "ODFM/18Mbps" }, \ - { IFM_IEEE80211_ODFM24, "ODFM/24Mbps" }, \ - { IFM_IEEE80211_ODFM36, "ODFM/36Mbps" }, \ - { IFM_IEEE80211_ODFM48, "ODFM/48Mbps" }, \ - { IFM_IEEE80211_ODFM54, "ODFM/54Mbps" }, \ - { IFM_IEEE80211_ODFM72, "ODFM/72Mbps" }, \ + { IFM_IEEE80211_OFDM6, "OFDM/6Mbps" }, \ + { IFM_IEEE80211_OFDM9, "OFDM/9Mbps" }, \ + { IFM_IEEE80211_OFDM12, "OFDM/12Mbps" }, \ + { IFM_IEEE80211_OFDM18, "OFDM/18Mbps" }, \ + { IFM_IEEE80211_OFDM24, "OFDM/24Mbps" }, \ + { IFM_IEEE80211_OFDM36, "OFDM/36Mbps" }, \ + { IFM_IEEE80211_OFDM48, "OFDM/48Mbps" }, \ + { IFM_IEEE80211_OFDM54, "OFDM/54Mbps" }, \ + { IFM_IEEE80211_OFDM72, "OFDM/72Mbps" }, \ { 0, NULL }, \ } @@ -391,15 +426,19 @@ struct ifmedia_description { { IFM_IEEE80211_DS5, "DirectSequence/5.5Mbps" }, \ { IFM_IEEE80211_DS11, "DirectSequence/11Mbps" }, \ { IFM_IEEE80211_DS22, "DirectSequence/22Mbps" }, \ - { IFM_IEEE80211_ODFM6, "ODFM6" }, \ - { IFM_IEEE80211_ODFM9, "ODFM9" }, \ - { IFM_IEEE80211_ODFM12, "ODFM12" }, \ - { IFM_IEEE80211_ODFM18, "ODFM18" }, \ - { IFM_IEEE80211_ODFM24, "ODFM24" }, \ - { IFM_IEEE80211_ODFM36, "ODFM36" }, \ - { IFM_IEEE80211_ODFM48, "ODFM48" }, \ - { IFM_IEEE80211_ODFM54, "ODFM54" }, \ - { IFM_IEEE80211_ODFM72, "ODFM72" }, \ + { IFM_IEEE80211_OFDM6, "OFDM6" }, \ + { IFM_IEEE80211_OFDM9, "OFDM9" }, \ + { IFM_IEEE80211_OFDM12, "OFDM12" }, \ + { IFM_IEEE80211_OFDM18, "OFDM18" }, \ + { IFM_IEEE80211_OFDM24, "OFDM24" }, \ + { IFM_IEEE80211_OFDM36, "OFDM36" }, \ + { IFM_IEEE80211_OFDM48, "OFDM48" }, \ + { IFM_IEEE80211_OFDM54, "OFDM54" }, \ + { IFM_IEEE80211_OFDM72, "OFDM72" }, \ + { IFM_IEEE80211_DS1, "CCK1" }, \ + { IFM_IEEE80211_DS2, "CCK2" }, \ + { IFM_IEEE80211_DS5, "CCK5.5" }, \ + { IFM_IEEE80211_DS11, "CCK11" }, \ { 0, NULL }, \ } @@ -408,9 +447,61 @@ struct ifmedia_description { { IFM_IEEE80211_HOSTAP, "hostap" }, \ { IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211_IBSSMASTER, "ibss-master" }, \ + { IFM_IEEE80211_TURBO, "turbo" }, \ + { IFM_IEEE80211_MONITOR, "monitor" }, \ + { 0, NULL }, \ +} + +#define IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS { \ + { IFM_AUTO, "autoselect" }, \ + { IFM_IEEE80211_11A, "11a" }, \ + { IFM_IEEE80211_11B, "11b" }, \ + { IFM_IEEE80211_11G, "11g" }, \ + { IFM_IEEE80211_FH, "fh" }, \ + { 0, NULL }, \ +} + +#define IFM_SUBTYPE_IEEE80211_MODE_ALIASES { \ + { IFM_AUTO, "auto" }, \ { 0, NULL }, \ } +# define IFM_SUBTYPE_ATM_DESCRIPTIONS { \ + { IFM_ATM_UNKNOWN, "Unknown" }, \ + { IFM_ATM_UTP_25, "UTP/25.6MBit" }, \ + { IFM_ATM_TAXI_100, "Taxi/100MBit" }, \ + { IFM_ATM_TAXI_140, "Taxi/140MBit" }, \ + { IFM_ATM_MM_155, "Multi-mode/155MBit" }, \ + { IFM_ATM_SM_155, "Single-mode/155MBit" }, \ + { IFM_ATM_UTP_155, "UTP/155MBit" }, \ + { IFM_ATM_MM_622, "Multi-mode/622MBit" }, \ + { IFM_ATM_SM_622, "Single-mode/622MBit" }, \ + { IFM_ATM_VIRTUAL, "Virtual" }, \ + { 0, NULL }, \ +} + +# define IFM_SUBTYPE_ATM_ALIASES { \ + { IFM_ATM_UNKNOWN, "UNKNOWN" }, \ + { IFM_ATM_UTP_25, "UTP-25" }, \ + { IFM_ATM_TAXI_100, "TAXI-100" }, \ + { IFM_ATM_TAXI_140, "TAXI-140" }, \ + { IFM_ATM_MM_155, "MM-155" }, \ + { IFM_ATM_SM_155, "SM-155" }, \ + { IFM_ATM_UTP_155, "UTP-155" }, \ + { IFM_ATM_MM_622, "MM-622" }, \ + { IFM_ATM_SM_622, "SM-622" }, \ + { IFM_ATM_VIRTUAL, "VIRTUAL" }, \ + { 0, NULL }, \ +} + +#define IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS { \ + { IFM_ATM_SDH, "SDH" }, \ + { IFM_ATM_NOSCRAMB, "Noscramb" }, \ + { IFM_ATM_UNASSIGNED, "Unassigned" }, \ + { 0, NULL }, \ +} + + #define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \ { IFM_AUTO, "autoselect" }, \ { IFM_MANUAL, "manual" }, \ diff --git a/c/src/libchip/network/open_eth.c b/c/src/libchip/network/open_eth.c index b1a5f6d1cc..4ba88f85c2 100644 --- a/c/src/libchip/network/open_eth.c +++ b/c/src/libchip/network/open_eth.c @@ -33,6 +33,8 @@ #include #include #include +#include + #include #include #include -- cgit v1.2.3