9206bb3779
* The device interface list now uses class DoublyLinkedList instead of struct list. * Implemented SIOC[SG]IFMEDIA for setting (not supported by any device yet), and retrieving the device media information. * Fixed a locking bug in list_domain_interfaces(). * Added new stack function device_link_changed() that should be called in case the link state (media) changed. * The ethernet device module now spawns a thread and will periodically check the media state of all ethernet devices that support this (if any). * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20546 a95241bf-73f2-0310-859d-f6bbb57e9c96
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/*
|
|
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _ETHER_DRIVER_H
|
|
#define _ETHER_DRIVER_H
|
|
|
|
/*! Standard ethernet driver interface */
|
|
|
|
|
|
#include <Drivers.h>
|
|
|
|
|
|
/* ioctl() opcodes a driver should support */
|
|
enum {
|
|
ETHER_GETADDR = B_DEVICE_OP_CODES_END,
|
|
/* get ethernet address (required) */
|
|
ETHER_INIT, /* (obsolete) */
|
|
ETHER_NONBLOCK, /* change non blocking mode (int *) */
|
|
ETHER_ADDMULTI, /* add multicast address */
|
|
ETHER_REMMULTI, /* remove multicast address */
|
|
ETHER_SETPROMISC, /* set promiscuous mode (int *) */
|
|
ETHER_GETFRAMESIZE, /* get frame size (required) (int *) */
|
|
ETHER_SET_LINK_STATE_SEM,
|
|
/* pass over a semaphore to release on link state changes (sem_id *) */
|
|
ETHER_GET_LINK_STATE
|
|
/* get line speed, quality, duplex mode, etc. (ether_link_state_t *) */
|
|
};
|
|
|
|
|
|
/* ETHER_GETADDR - MAC address */
|
|
typedef struct ether_address {
|
|
uint8 ebyte[6];
|
|
} ether_address_t;
|
|
|
|
/* ETHER_GETLINKSTATE */
|
|
typedef struct ether_link_state {
|
|
uint32 media; /* as specified in net/if_media.h */
|
|
uint32 quality; /* in one tenth of a percent */
|
|
uint64 speed; /* in Kbit/s */
|
|
} ether_link_state_t;
|
|
|
|
#endif /* _ETHER_DRIVER_H */
|