Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103048008
D19946.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D19946.diff
View Options
Index: head/sys/net/iflib.h
===================================================================
--- head/sys/net/iflib.h
+++ head/sys/net/iflib.h
@@ -228,8 +228,10 @@
pci_vendor_info_t isc_vendor_info; /* set by iflib prior to attach_pre */
int isc_disable_msix;
if_txrx_t isc_txrx;
+ struct ifmedia *isc_media;
} *if_softc_ctx_t;
+
/*
* Initialization values for device
*/
@@ -361,6 +363,10 @@
* Interface needs admin task to ignore interface up/down status
*/
#define IFLIB_ADMIN_ALWAYS_RUN 0x10000
+/*
+ * Driver will pass the media
+ */
+#define IFLIB_DRIVER_MEDIA 0x20000
/*
Index: head/sys/net/iflib.c
===================================================================
--- head/sys/net/iflib.c
+++ head/sys/net/iflib.c
@@ -182,6 +182,7 @@
struct grouptask ifc_vflr_task;
struct iflib_filter_info ifc_filter_info;
struct ifmedia ifc_media;
+ struct ifmedia *ifc_mediap;
struct sysctl_oid *ifc_sysctl_node;
uint16_t ifc_sysctl_ntxqs;
@@ -238,7 +239,7 @@
iflib_get_media(if_ctx_t ctx)
{
- return (&ctx->ifc_media);
+ return (ctx->ifc_mediap);
}
uint32_t
@@ -4184,7 +4185,7 @@
/* falls thru */
case SIOCGIFMEDIA:
case SIOCGIFXMEDIA:
- err = ifmedia_ioctl(ifp, ifr, &ctx->ifc_media, command);
+ err = ifmedia_ioctl(ifp, ifr, ctx->ifc_mediap, command);
break;
case SIOCGI2C:
{
@@ -4583,6 +4584,9 @@
_iflib_pre_assert(scctx);
ctx->ifc_txrx = *scctx->isc_txrx;
+ if (sctx->isc_flags & IFLIB_DRIVER_MEDIA)
+ ctx->ifc_mediap = scctx->isc_media;
+
#ifdef INVARIANTS
if (scctx->isc_capabilities & IFCAP_TXCSUM)
MPASS(scctx->isc_tx_csum_flags);
@@ -4819,9 +4823,9 @@
device_printf(dev, "IFDI_CLONEATTACH failed %d\n", err);
goto fail_ctx_free;
}
- ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
- ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
- ifmedia_set(&ctx->ifc_media, IFM_ETHER | IFM_AUTO);
+ ifmedia_add(ctx->ifc_mediap, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
+ ifmedia_add(ctx->ifc_mediap, IFM_ETHER | IFM_AUTO, 0, NULL);
+ ifmedia_set(ctx->ifc_mediap, IFM_ETHER | IFM_AUTO);
#ifdef INVARIANTS
if (scctx->isc_capabilities & IFCAP_TXCSUM)
@@ -5348,9 +5352,11 @@
EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx,
EVENTHANDLER_PRI_FIRST);
- ifmedia_init(&ctx->ifc_media, IFM_IMASK,
- iflib_media_change, iflib_media_status);
-
+ if ((sctx->isc_flags & IFLIB_DRIVER_MEDIA) == 0) {
+ ctx->ifc_mediap = &ctx->ifc_media;
+ ifmedia_init(ctx->ifc_mediap, IFM_IMASK,
+ iflib_media_change, iflib_media_status);
+ }
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 6:15 AM (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14756091
Default Alt Text
D19946.diff (2 KB)
Attached To
Mode
D19946: allow iflib drivers to pass their own ifmedia
Attached
Detach File
Event Timeline
Log In to Comment