haiku/headers/posix/net/if_media.h
Axel Dörfler 1a3ab92b81 * Rewrote ether_driver.h, removed some BONE stuff we don't support at this point;
it might also be a good idea to change the constants to better match the usual
  style.
* Added a BSD-style if_media.h.
* Added interface flags IFF_LINK, IFF_AUTO_CONFIGURED, and IFF_CONFIGURING. The
  former will be set automatically by the stack, the rest will be set by the
  net_server depending on the current state.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-03 14:42:07 +00:00

56 lines
1.5 KiB
C

/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _NET_IF_MEDIA_H
#define _NET_IF_MEDIA_H
/* bits usage
* ---- -----
* 0-4 Media subtype
* 5-7 Media type
* 8-15 Type specific options
* 16-31 General options
*/
/* Media types */
#define IFM_ETHER 0x00000020 /* Ethernet */
#define IFM_TOKEN 0x00000040 /* Token Ring */
#define IFM_FDDI 0x00000060 /* Fiber Distributed Data Interface */
#define IFM_IEEE80211 0x00000080 /* Wireless IEEE 802.11 */
#define IFM_ATM 0x000000a0
#define IFM_CARP 0x000000c0 /* Common Address Redundancy Protocol */
/* Media subtypes */
/* Ethernet */
#define IFM_10_T 3 /* 10Base-T - RJ45 */
#define IFM_100_TX 6 /* 100Base-TX - RJ45 */
#define IFM_1000_T 16 /* 1000Base-T - RJ45 */
/* General options */
#define IFM_FULL_DUPLEX 0x00100000 /* Full duplex */
#define IFM_HALF_DUPLEX 0x00200000 /* Half duplex */
#define IFM_LOOP 0x00400000 /* hardware in loopback */
#define IFM_ACTIVE 0x00800000 /* Media link is active */
/* Masks */
#define IFM_NMASK 0x000000e0 /* Media type */
#define IFM_TMASK 0x0000001f /* Media subtype */
#define IFM_OMASK 0x0000ff00 /* Type specific options */
#define IFM_GMASK 0xffff0000 /* Generic options */
/* Macros for the masks */
#define IFM_TYPE(x) ((x) & IFM_NMASK)
#define IFM_SUBTYPE(x) ((x) & IFM_TMASK)
#define IFM_TYPE_OPTIONS(x) \
((x) & IFM_OMASK)
#define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK))
#endif /* _NET_IF_MEDIA_H */