summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi/if_wivar.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-04-26 23:11:23 +0000
committerimp <imp@FreeBSD.org>2002-04-26 23:11:23 +0000
commit968e9b32d8f8dc040d229b3e42dfdab24deb5905 (patch)
tree8f2c862abb4fbe792c263a893a6576a1e5875a9f /sys/dev/wi/if_wivar.h
parent99e543a853914f0d84a2b13980587577cffaf336 (diff)
downloadFreeBSD-src-968e9b32d8f8dc040d229b3e42dfdab24deb5905.zip
FreeBSD-src-968e9b32d8f8dc040d229b3e42dfdab24deb5905.tar.gz
Make this driver compile for -stable also to prep for MFC
Diffstat (limited to 'sys/dev/wi/if_wivar.h')
-rw-r--r--sys/dev/wi/if_wivar.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h
index af1490f..470ba6d 100644
--- a/sys/dev/wi/if_wivar.h
+++ b/sys/dev/wi/if_wivar.h
@@ -160,7 +160,9 @@ struct wi_softc {
u_int32_t wi_icv;
int wi_icv_flag;
struct callout_handle wi_stat_ch;
+#if __FreeBSD_version >= 500000
struct mtx wi_mtx;
+#endif
int wi_nic_type;
int wi_bus_type; /* Bus attachment type */
struct {
@@ -188,8 +190,31 @@ struct wi_card_ident {
u_int8_t firm_type;
};
-#define WI_LOCK(_sc)
-#define WI_UNLOCK(_sc)
+#if __FreeBSD_version < 500000
+/*
+ * Various compat hacks/kludges
+ */
+#define le16toh(x) (x)
+#define htole16(x) (x)
+#define ifaddr_byindex(idx) ifnet_addrs[(idx) - 1];
+#define WI_LOCK(_sc, _s) s = splimp()
+#define WI_UNLOCK(_sc, _s) splx(s)
+#define IF_HANDOFF(q, m, ifp) \
+ if (IF_QFULL((q))) { \
+ IF_DROP((q)); \
+ m_freem((m)); \
+ } else { \
+ (ifp)->if_obytes += (m)->m_pkthdr.len; \
+ if ((m)->m_flags & M_MCAST) \
+ (ifp)->if_omcasts++; \
+ IF_ENQUEUE((q), (m)); \
+ if (((ifp)->if_flags & IFF_OACTIVE) == 0) \
+ (*(ifp)->if_start)((ifp)); \
+ }
+#else
+#define WI_LOCK(_sc, _s) _s = 1
+#define WI_UNLOCK(_sc, _s)
+#endif
int wi_generic_attach(device_t);
int wi_generic_detach(device_t);
OpenPOWER on IntegriCloud