Prepared implementation of ETHER_GETLINKSTATE - it would need a bit more work to
get it to work as intended, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20537 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,13 +16,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <KernelExport.h>
|
|
||||||
#include <Errors.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <driver_settings.h>
|
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
@@ -31,6 +25,17 @@
|
|||||||
#include "if_em.h"
|
#include "if_em.h"
|
||||||
#include "if_compat.h"
|
#include "if_compat.h"
|
||||||
|
|
||||||
|
#include <KernelExport.h>
|
||||||
|
#include <driver_settings.h>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
|
# include <net/if_media.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef malloc
|
#undef malloc
|
||||||
#undef free
|
#undef free
|
||||||
|
|
||||||
@@ -331,11 +336,28 @@ ipro1000_control(void *cookie, uint32 op, void *arg, size_t len)
|
|||||||
DEVICE_DEBUGOUT2("ipro1000_control() ETHER_GETFRAMESIZE, framesize = %d (MTU = %d)", device->maxframesize, device->maxframesize - ENET_HEADER_SIZE);
|
DEVICE_DEBUGOUT2("ipro1000_control() ETHER_GETFRAMESIZE, framesize = %d (MTU = %d)", device->maxframesize, device->maxframesize - ENET_HEADER_SIZE);
|
||||||
*(uint32*)arg = device->maxframesize;
|
*(uint32*)arg = device->maxframesize;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
|
#if 0
|
||||||
|
case ETHER_GETLINKSTATE:
|
||||||
|
{
|
||||||
|
ether_link_state_t state;
|
||||||
|
state.link_media = (info->link ? IFM_ACTIVE : 0)
|
||||||
|
| (info->full_duplex ? IFM_FULL_DUPLEX : IFM_HALF_DUPLEX)
|
||||||
|
| (info->speed == LINK_SPEED_100_MBIT ? IFM_100_TX : IFM_10_T);
|
||||||
|
state.link_speed = info->speed == LINK_SPEED_100_MBIT
|
||||||
|
? 100000 : 10000;
|
||||||
|
state.link_quality = 1000;
|
||||||
|
|
||||||
|
return user_memcpy(buffer, &state, sizeof(ether_link_state_t));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DEVICE_DEBUGOUT("ipro1000_control() Invalid command");
|
DEVICE_DEBUGOUT("ipro1000_control() Invalid command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_ERROR;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,23 +38,30 @@
|
|||||||
#define IFCAP_TXCSUM 0x0010
|
#define IFCAP_TXCSUM 0x0010
|
||||||
#define IFCAP_RXCSUM 0x0020
|
#define IFCAP_RXCSUM 0x0020
|
||||||
|
|
||||||
#define IFM_ACTIVE 0x0001
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
#define IFM_FDX 0x0002
|
# define IFM_FDX IFM_FULL_DUPLEX
|
||||||
#define IFM_HDX 0x0004
|
# define IFM_HDX IFM_HALF_DUPLEX
|
||||||
#define IFM_10_T 0x0008
|
# define IFM_1000_TX 17
|
||||||
#define IFM_100_TX 0x0010
|
# define IFM_1000_SX 18
|
||||||
#define IFM_1000_T 0x0020
|
#else
|
||||||
#define IFM_1000_TX 0x0040
|
# define IFM_ACTIVE 0x0001
|
||||||
#define IFM_1000_SX 0x0080
|
# define IFM_FDX 0x0002
|
||||||
#define IFM_ETHER 0x0100
|
# define IFM_HDX 0x0004
|
||||||
#define IFM_AUTO 0x0200
|
# define IFM_10_T 0x0008
|
||||||
#define IFM_AVALID 0x0400
|
# define IFM_100_TX 0x0010
|
||||||
#define IFM_GMASK (IFM_FDX | IFM_HDX)
|
# define IFM_1000_T 0x0020
|
||||||
#define IFM_TYPE_MASK (IFM_ETHER)
|
# define IFM_1000_TX 0x0040
|
||||||
#define IFM_SUBTYPE_MASK (IFM_AUTO | IFM_1000_SX | IFM_1000_TX | IFM_1000_T | IFM_100_TX | IFM_10_T)
|
# define IFM_1000_SX 0x0080
|
||||||
|
# define IFM_ETHER 0x0100
|
||||||
#define IFM_TYPE(media) ((media) & IFM_TYPE_MASK)
|
# define IFM_AUTO 0x0200
|
||||||
#define IFM_SUBTYPE(media) ((media) & IFM_SUBTYPE_MASK)
|
# define IFM_AVALID 0x0400
|
||||||
|
# define IFM_GMASK (IFM_FDX | IFM_HDX)
|
||||||
|
# define IFM_TYPE_MASK (IFM_ETHER)
|
||||||
|
# define IFM_SUBTYPE_MASK \
|
||||||
|
(IFM_AUTO | IFM_1000_SX | IFM_1000_TX | IFM_1000_T | IFM_100_TX | IFM_10_T)
|
||||||
|
# define IFM_TYPE(media) ((media) & IFM_TYPE_MASK)
|
||||||
|
# define IFM_SUBTYPE(media) ((media) & IFM_SUBTYPE_MASK)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CSUM_TCP 0x0001 // ifnet::if_hwassist
|
#define CSUM_TCP 0x0001 // ifnet::if_hwassist
|
||||||
#define CSUM_UDP 0x0002 // ifnet::if_hwassist
|
#define CSUM_UDP 0x0002 // ifnet::if_hwassist
|
||||||
|
|||||||
@@ -34,17 +34,19 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef _IF_EM_OSDEP_H_
|
#ifndef _IF_EM_OSDEP_H_
|
||||||
#define _IF_EM_OSDEP_H_
|
#define _IF_EM_OSDEP_H_
|
||||||
|
|
||||||
#include <OS.h>
|
|
||||||
#include <KernelExport.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
#include <ByteOrder.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "driver.h"
|
#include "driver.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
|
#include <KernelExport.h>
|
||||||
|
#include <ByteOrder.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#define usec_delay(x) snooze(x)
|
#define usec_delay(x) snooze(x)
|
||||||
#define msec_delay(x) snooze(1000*(x))
|
#define msec_delay(x) snooze(1000*(x))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user