Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jun 2011 12:40:55 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223078 - in head: sbin/ifconfig sys/net
Message-ID:  <201106141240.p5ECetMH034678@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Tue Jun 14 12:40:55 2011
New Revision: 223078
URL: http://svn.freebsd.org/changeset/base/223078

Log:
  Grab one of the ifcap bits for netmap, and enable printing in ifconfig.
  
  Document the fact that we might want an IFCAP_CANTCHANGE mask,
  even though the value is not yet used in sys/net/if.c
  
  (asked on -current a week ago, no feedback so i assume no objection).

Modified:
  head/sbin/ifconfig/ifconfig.c
  head/sys/net/if.h

Modified: head/sbin/ifconfig/ifconfig.c
==============================================================================
--- head/sbin/ifconfig/ifconfig.c	Tue Jun 14 12:06:38 2011	(r223077)
+++ head/sbin/ifconfig/ifconfig.c	Tue Jun 14 12:40:55 2011	(r223078)
@@ -908,7 +908,7 @@ unsetifdescr(const char *val, int value,
 #define	IFCAPBITS \
 "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \
 "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \
-"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE"
+"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP"
 
 /*
  * Print the status of the interface.  If an address family was

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Tue Jun 14 12:06:38 2011	(r223077)
+++ head/sys/net/if.h	Tue Jun 14 12:40:55 2011	(r223078)
@@ -199,6 +199,13 @@ struct if_data {
  *   field.  IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
  *   more detailed or differenciated than IFCAP_*.
  *   Hwassist features are defined CSUM_* in sys/mbuf.h
+ *
+ * Capabilities that cannot be arbitrarily changed with ifconfig/ioctl
+ * are listed in IFCAP_CANTCHANGE, similar to IFF_CANTCHANGE.
+ * This is not strictly necessary because the common code never
+ * changes capabilities, and it is left to the individual driver
+ * to do the right thing. However, having the filter here
+ * avoids replication of the same code in all individual drivers.
  */
 #define	IFCAP_RXCSUM		0x00001  /* can offload checksum on RX */
 #define	IFCAP_TXCSUM		0x00002  /* can offload checksum on TX */
@@ -220,12 +227,15 @@ struct if_data {
 #define	IFCAP_POLLING_NOCOUNT	0x20000 /* polling ticks cannot be fragmented */
 #define	IFCAP_VLAN_HWTSO	0x40000 /* can do IFCAP_TSO on VLANs */
 #define	IFCAP_LINKSTATE		0x80000 /* the runtime link state is dynamic */
+#define	IFCAP_NETMAP		0x100000 /* netmap mode supported/enabled */
 
 #define IFCAP_HWCSUM	(IFCAP_RXCSUM | IFCAP_TXCSUM)
 #define	IFCAP_TSO	(IFCAP_TSO4 | IFCAP_TSO6)
 #define	IFCAP_WOL	(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
 #define	IFCAP_TOE	(IFCAP_TOE4 | IFCAP_TOE6)
 
+#define	IFCAP_CANTCHANGE	(IFCAP_NETMAP)
+
 #define	IFQ_MAXLEN	50
 #define	IFNET_SLOWHZ	1		/* granularity is 1 second */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106141240.p5ECetMH034678>