summaryrefslogtreecommitdiffstats
path: root/sys/dev/patm/if_patmvar.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/dev/patm/if_patmvar.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/dev/patm/if_patmvar.h')
-rw-r--r--sys/dev/patm/if_patmvar.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/patm/if_patmvar.h b/sys/dev/patm/if_patmvar.h
index 5cadbc3..e934784 100644
--- a/sys/dev/patm/if_patmvar.h
+++ b/sys/dev/patm/if_patmvar.h
@@ -149,7 +149,7 @@ struct lmbuf {
};
#define PATM_CID(SC, VPI, VCI) \
- (((VPI) << (SC)->ifatm.mib.vci_bits) | (VCI))
+ (((VPI) << IFP2IFATM((SC)->ifp)->mib.vci_bits) | (VCI))
/*
* Internal driver statistics
@@ -218,7 +218,7 @@ struct patm_vcc {
* Per adapter data
*/
struct patm_softc {
- struct ifatm ifatm; /* common ATM stuff */
+ struct ifnet *ifp; /* common ATM stuff */
struct mtx mtx; /* lock */
struct ifmedia media; /* media */
device_t dev; /* device */
@@ -325,7 +325,7 @@ struct patm_softc {
#define TST_PENDING 0x0002 /* need update */
#define TST_WAIT 0x0004 /* wait fo jump */
-#define patm_printf(SC, ...) if_printf(&(SC)->ifatm.ifnet, __VA_ARGS__);
+#define patm_printf(SC, ...) if_printf((SC)->ifp, __VA_ARGS__);
#ifdef PATM_DEBUG
/*
@@ -348,7 +348,7 @@ enum {
#define patm_debug(SC, FLAG, ...) do { \
if((SC)->debug & DBG_##FLAG) { \
- if_printf(&(SC)->ifatm.ifnet, "%s: ", __func__); \
+ if_printf((SC)->ifp, "%s: ", __func__); \
printf(__VA_ARGS__); \
printf("\n"); \
} \
@@ -510,9 +510,9 @@ patm_sram_write4(struct patm_softc *sc, u_int addr, uint32_t v0, uint32_t v1,
}
#define LEGAL_VPI(SC, VPI) \
- (((VPI) & ~((1 << (SC)->ifatm.mib.vpi_bits) - 1)) == 0)
+ (((VPI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vpi_bits) - 1)) == 0)
#define LEGAL_VCI(SC, VCI) \
- (((VCI) & ~((1 << (SC)->ifatm.mib.vci_bits) - 1)) == 0)
+ (((VCI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vci_bits) - 1)) == 0)
extern const uint32_t patm_rtables155[];
extern const uint32_t patm_rtables25[];
OpenPOWER on IntegriCloud