summaryrefslogtreecommitdiffstats
path: root/sys/net/if_atm.h
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-06-10 16:49:24 +0000
committerbrooks <brooks@FreeBSD.org>2005-06-10 16:49:24 +0000
commit567ba9b00a248431e7c1147c4e079fd7a11b9ecf (patch)
treef65b6d7834b40dfcd48534829a0a1e9529ab87ee /sys/net/if_atm.h
parent3eaa67c3ad947d85be5350e0e184cd6ee5b93a52 (diff)
downloadFreeBSD-src-567ba9b00a248431e7c1147c4e079fd7a11b9ecf.zip
FreeBSD-src-567ba9b00a248431e7c1147c4e079fd7a11b9ecf.tar.gz
Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
Diffstat (limited to 'sys/net/if_atm.h')
-rw-r--r--sys/net/if_atm.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/net/if_atm.h b/sys/net/if_atm.h
index 4084569..4b07f36 100644
--- a/sys/net/if_atm.h
+++ b/sys/net/if_atm.h
@@ -176,11 +176,12 @@ struct atmio_vcctable {
* this structure.
*/
struct ifatm {
- struct ifnet ifnet; /* required by if_var.h */
+ struct ifnet *ifp;
struct ifatm_mib mib; /* exported data */
void *phy; /* usually SUNI */
void *ngpriv; /* netgraph link */
};
+#define IFP2IFATM(ifp) ((struct ifatm *)(ifp)->if_l2com)
#endif
/*
@@ -304,7 +305,7 @@ void atm_event(struct ifnet *, u_int, void *);
_arg.vpi = (VPI); \
_arg.vci = (VCI); \
_arg.busy = (BUSY); \
- atm_event(&(ATMIF)->ifnet, ATMEV_FLOW_CONTROL, &_arg); \
+ atm_event((ATMIF)->ifp, ATMEV_FLOW_CONTROL, &_arg); \
} while (0)
#define ATMEV_SEND_VCC_CHANGED(ATMIF, VPI, VCI, UP) \
@@ -313,16 +314,16 @@ void atm_event(struct ifnet *, u_int, void *);
_arg.vpi = (VPI); \
_arg.vci = (VCI); \
_arg.up = (UP); \
- atm_event(&(ATMIF)->ifnet, ATMEV_VCC_CHANGED, &_arg); \
+ atm_event((ATMIF)->ifp, ATMEV_VCC_CHANGED, &_arg); \
} while (0)
#define ATMEV_SEND_IFSTATE_CHANGED(ATMIF, CARRIER) \
do { \
struct atmev_ifstate_changed _arg; \
- _arg.running = (((ATMIF)->ifnet.if_flags & \
+ _arg.running = (((ATMIF)->ifp->if_flags & \
IFF_RUNNING) != 0); \
_arg.carrier = ((CARRIER) != 0); \
- atm_event(&(ATMIF)->ifnet, ATMEV_IFSTATE_CHANGED, &_arg); \
+ atm_event((ATMIF)->ifp, ATMEV_IFSTATE_CHANGED, &_arg); \
} while (0)
#define ATMEV_SEND_ACR_CHANGED(ATMIF, VPI, VCI, ACR) \
@@ -331,6 +332,6 @@ void atm_event(struct ifnet *, u_int, void *);
_arg.vpi = (VPI); \
_arg.vci = (VCI); \
_arg.acr= (ACR); \
- atm_event(&(ATMIF)->ifnet, ATMEV_ACR_CHANGED, &_arg); \
+ atm_event((ATMIF)->ifp, ATMEV_ACR_CHANGED, &_arg); \
} while (0)
#endif
OpenPOWER on IntegriCloud