2006-08-08 17:07:07 +04:00
|
|
|
/*
|
2007-04-03 18:42:07 +04:00
|
|
|
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
2006-08-08 17:07:07 +04:00
|
|
|
*/
|
|
|
|
#ifndef _ETHER_DRIVER_H
|
|
|
|
#define _ETHER_DRIVER_H
|
|
|
|
|
2007-04-03 18:42:07 +04:00
|
|
|
/*! Standard ethernet driver interface */
|
|
|
|
|
2006-08-08 17:07:07 +04:00
|
|
|
|
|
|
|
#include <Drivers.h>
|
|
|
|
|
2007-04-03 18:42:07 +04:00
|
|
|
|
|
|
|
/* ioctl() opcodes a driver should support */
|
2006-08-08 17:07:07 +04:00
|
|
|
enum {
|
2007-04-03 18:42:07 +04:00
|
|
|
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 *) */
|
2007-04-04 13:41:04 +04:00
|
|
|
ETHER_SET_LINK_STATE_SEM,
|
|
|
|
/* pass over a semaphore to release on link state changes (sem_id *) */
|
|
|
|
ETHER_GET_LINK_STATE
|
2007-04-03 18:42:07 +04:00
|
|
|
/* get line speed, quality, duplex mode, etc. (ether_link_state_t *) */
|
2006-08-08 17:07:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-04-03 18:42:07 +04:00
|
|
|
/* ETHER_GETADDR - MAC address */
|
2007-04-04 13:41:04 +04:00
|
|
|
typedef struct ether_address {
|
|
|
|
uint8 ebyte[6];
|
2006-08-08 17:07:07 +04:00
|
|
|
} ether_address_t;
|
|
|
|
|
2007-04-03 18:42:07 +04:00
|
|
|
/* ETHER_GETLINKSTATE */
|
2006-08-08 17:07:07 +04:00
|
|
|
typedef struct ether_link_state {
|
2007-04-04 13:41:04 +04:00
|
|
|
uint32 media; /* as specified in net/if_media.h */
|
|
|
|
uint32 quality; /* in one tenth of a percent */
|
2010-11-23 16:35:30 +03:00
|
|
|
uint64 speed; /* in bit/s */
|
2006-08-08 17:07:07 +04:00
|
|
|
} ether_link_state_t;
|
|
|
|
|
2007-04-03 18:42:07 +04:00
|
|
|
#endif /* _ETHER_DRIVER_H */
|