From dd9ed984465845ba1807ad894b5cf81130230e40 Mon Sep 17 00:00:00 2001 From: ru Date: Sun, 11 Apr 2004 13:36:52 +0000 Subject: [PATCH] Added the new interface capability option for drivers that implement user-configurable polling(4) support. Make ifconfig(8) aware of it. Suggested by: luigi --- sbin/ifconfig/ifconfig.8 | 10 +++++++++- sbin/ifconfig/ifconfig.c | 4 +++- sys/net/if.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index d3c0031d9960..2f47884c1020 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd April 11, 2004 .Dt IFCONFIG 8 .Os .Sh NAME @@ -332,6 +332,14 @@ support, the exact level of offloading varies between drivers. If the driver supports user-configurable checksum offloading, disable receive (or transmit) checksum offloading on the interface. These settings may not always be independent of each other. +.It Cm polling +If the driver has user-configurable +.Xr polling 4 +support, select the polling mode on the interface. +.It Fl polling +If the driver has user-configurable +.Xr polling 4 +support, select the interrupt mode on the interface. .It Cm tunnel Ar src_addr dest_addr (IP tunnel devices only.) Configure the physical source and destination address for IP tunnel diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 35c0597f662b..07722fe9edd9 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -283,6 +283,8 @@ struct cmd { { "-txcsum", -IFCAP_TXCSUM, setifcap }, { "netcons", IFCAP_NETCONS, setifcap }, { "-netcons", -IFCAP_NETCONS, setifcap }, + { "polling", IFCAP_POLLING, setifcap }, + { "-polling", -IFCAP_POLLING, setifcap }, { "normal", -IFF_LINK0, setifflags }, { "compress", IFF_LINK0, setifflags }, { "noicmp", IFF_LINK1, setifflags }, @@ -1074,7 +1076,7 @@ setifname(const char *val, int dummy __unused, int s, "\20MULTICAST\21POLLING\23MONITOR\24STATICARP" #define IFCAPBITS \ -"\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU" +"\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" /* * Print the status of the interface. If an address family was diff --git a/sys/net/if.h b/sys/net/if.h index 62f4f9232e48..625dfe0750d8 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -169,6 +169,7 @@ struct if_data { #define IFCAP_VLAN_MTU 0x0008 /* VLAN-compatible MTU */ #define IFCAP_VLAN_HWTAGGING 0x0010 /* hardware VLAN tag support */ #define IFCAP_JUMBO_MTU 0x0020 /* 9000 byte MTU supported */ +#define IFCAP_POLLING 0x0040 /* driver supports polling */ #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)