Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102782882
D35560.id107271.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
109 KB
Referenced Files
None
Subscribers
None
D35560.id107271.diff
View Options
Index: sys/amd64/vmm/x86.c
===================================================================
--- sys/amd64/vmm/x86.c
+++ sys/amd64/vmm/x86.c
@@ -61,16 +61,6 @@
SYSCTL_ULONG(_hw_vmm, OID_AUTO, bhyve_xcpuids, CTLFLAG_RW, &bhyve_xcpuids, 0,
"Number of times an unknown cpuid leaf was accessed");
-#if __FreeBSD_version < 1200060 /* Remove after 11 EOL helps MFCing */
-extern u_int threads_per_core;
-SYSCTL_UINT(_hw_vmm_topology, OID_AUTO, threads_per_core, CTLFLAG_RDTUN,
- &threads_per_core, 0, NULL);
-
-extern u_int cores_per_package;
-SYSCTL_UINT(_hw_vmm_topology, OID_AUTO, cores_per_package, CTLFLAG_RDTUN,
- &cores_per_package, 0, NULL);
-#endif
-
static int cpuid_leaf_b = 1;
SYSCTL_INT(_hw_vmm_topology, OID_AUTO, cpuid_leaf_b, CTLFLAG_RDTUN,
&cpuid_leaf_b, 0, NULL);
Index: sys/dev/acpica/acpi_container.c
===================================================================
--- sys/dev/acpica/acpi_container.c
+++ sys/dev/acpica/acpi_container.c
@@ -68,9 +68,7 @@
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
-#if __FreeBSD_version >= 1100000
DEVMETHOD(bus_get_cpus, bus_generic_get_cpus),
-#endif
/* pcib interface */
DEVMETHOD(pcib_alloc_msi, acpi_syscont_alloc_msi),
Index: sys/dev/e1000/e1000_osdep.h
===================================================================
--- sys/dev/e1000/e1000_osdep.h
+++ sys/dev/e1000/e1000_osdep.h
@@ -131,18 +131,6 @@
#define __le32 u32
#define __le64 u64
-#if __FreeBSD_version < 800000
-#if defined(__i386__) || defined(__amd64__)
-#define mb() __asm volatile("mfence" ::: "memory")
-#define wmb() __asm volatile("sfence" ::: "memory")
-#define rmb() __asm volatile("lfence" ::: "memory")
-#else
-#define mb()
-#define rmb()
-#define wmb()
-#endif
-#endif /*__FreeBSD_version < 800000 */
-
#ifdef INVARIANTS
#define ASSERT_CTX_LOCK_HELD(hw) (sx_assert(iflib_ctx_lock_get(((struct e1000_osdep *)hw->back)->ctx), SX_XLOCKED))
#else
Index: sys/dev/hptmv/hptproc.c
===================================================================
--- sys/dev/hptmv/hptproc.c
+++ sys/dev/hptmv/hptproc.c
@@ -636,19 +636,11 @@
#define xhptregister_node(name) hptregister_node(name)
-#if __FreeBSD_version >= 1100024
#define hptregister_node(name) \
SYSCTL_ROOT_NODE(OID_AUTO, name, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, \
"Get/Set " #name " state root node"); \
SYSCTL_OID(_ ## name, OID_AUTO, status, \
CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, \
NULL, 0, hpt_status, "A", "Get/Set " #name " state")
-#else
-#define hptregister_node(name) \
- SYSCTL_NODE(, OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \
- SYSCTL_OID(_ ## name, OID_AUTO, status, \
- CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, \
- NULL, 0, hpt_status, "A", "Get/Set " #name " state")
-#endif
-
+
xhptregister_node(PROC_DIR_NAME);
Index: sys/dev/hwpmc/hwpmc_logging.c
===================================================================
--- sys/dev/hwpmc/hwpmc_logging.c
+++ sys/dev/hwpmc/hwpmc_logging.c
@@ -79,9 +79,6 @@
*/
static int pmclog_buffer_size = PMC_LOG_BUFFER_SIZE;
-#if (__FreeBSD_version < 1100000)
-TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "logbuffersize", &pmclog_buffer_size);
-#endif
SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN,
&pmclog_buffer_size, 0, "size of log buffers in kilobytes");
@@ -90,9 +87,6 @@
*/
static int pmc_nlogbuffers_pcpu = PMC_NLOGBUFFERS_PCPU;
-#if (__FreeBSD_version < 1100000)
-TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "nbuffers", &pmc_nlogbuffers_pcpu);
-#endif
SYSCTL_INT(_kern_hwpmc, OID_AUTO, nbuffers_pcpu, CTLFLAG_RDTUN,
&pmc_nlogbuffers_pcpu, 0, "number of log buffers per cpu");
Index: sys/dev/hwpmc/hwpmc_uncore.c
===================================================================
--- sys/dev/hwpmc/hwpmc_uncore.c
+++ sys/dev/hwpmc/hwpmc_uncore.c
@@ -40,11 +40,7 @@
#include <sys/systm.h>
#include <machine/intr.h>
-#if (__FreeBSD_version >= 1100000)
#include <x86/apicvar.h>
-#else
-#include <machine/apicvar.h>
-#endif
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
Index: sys/dev/hwpmc/hwpmc_x86.c
===================================================================
--- sys/dev/hwpmc/hwpmc_x86.c
+++ sys/dev/hwpmc/hwpmc_x86.c
@@ -42,11 +42,7 @@
#include <machine/cpu.h>
#include <machine/cputypes.h>
#include <machine/intr.h>
-#if (__FreeBSD_version >= 1100000)
#include <x86/apicvar.h>
-#else
-#include <machine/apicvar.h>
-#endif
#include <machine/pmc_mdep.h>
#include <machine/md_var.h>
Index: sys/dev/hyperv/netvsc/if_hn.c
===================================================================
--- sys/dev/hyperv/netvsc/if_hn.c
+++ sys/dev/hyperv/netvsc/if_hn.c
@@ -325,17 +325,11 @@
static void hn_nvs_ack_rxbuf(struct hn_rx_ring *,
struct vmbus_channel *, uint64_t);
-#if __FreeBSD_version >= 1100099
static int hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS);
static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS);
-#endif
static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS);
static int hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS);
-#if __FreeBSD_version < 1100095
-static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS);
-#else
static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS);
-#endif
static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS);
static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS);
static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS);
@@ -526,12 +520,10 @@
/* # of LRO entries per RX ring */
#if defined(INET) || defined(INET6)
-#if __FreeBSD_version >= 1100095
static int hn_lro_entry_count = HN_LROENT_CNT_DEF;
SYSCTL_INT(_hw_hn, OID_AUTO, lro_entry_count, CTLFLAG_RDTUN,
&hn_lro_entry_count, 0, "LRO entry count");
#endif
-#endif
static int hn_tx_taskq_cnt = 1;
SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_cnt, CTLFLAG_RDTUN,
@@ -578,11 +570,9 @@
&hn_tx_swq_depth, 0, "Depth of IFQ or BUFRING");
/* Enable sorted LRO, and the depth of the per-channel mbuf queue */
-#if __FreeBSD_version >= 1100095
static u_int hn_lro_mbufq_depth = 0;
SYSCTL_UINT(_hw_hn, OID_AUTO, lro_mbufq_depth, CTLFLAG_RDTUN,
&hn_lro_mbufq_depth, 0, "Depth of LRO mbuf queue");
-#endif
/* Packet transmission aggregation size limit */
static int hn_tx_agg_size = -1;
@@ -665,7 +655,6 @@
MODULE_VERSION(hn, 1);
MODULE_DEPEND(hn, vmbus, 1, 1, 1);
-#if __FreeBSD_version >= 1100099
static void
hn_set_lro_lenlim(struct hn_softc *sc, int lenlim)
{
@@ -674,7 +663,6 @@
for (i = 0; i < sc->hn_rx_ring_cnt; ++i)
sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim;
}
-#endif
static int
hn_txpkt_sglist(struct hn_tx_ring *txr, struct hn_txdesc *txd)
@@ -1430,10 +1418,8 @@
ifp = sc->hn_ifp;
hn_set_tso_maxsize(sc, hn_tso_maxlen, ifp->if_mtu);
-#if __FreeBSD_version >= 1100099
if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp))
hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp));
-#endif
}
static uint32_t
@@ -2268,7 +2254,6 @@
else if (bootverbose)
device_printf(dev, "RNDIS mtu %u\n", mtu);
-#if __FreeBSD_version >= 1100099
if (sc->hn_rx_ring_inuse > 1) {
/*
* Reduce TCP segment aggregation limit for multiple
@@ -2276,7 +2261,6 @@
*/
hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MULTIRX_DEF);
}
-#endif
/*
* Fixup TX/RX stuffs after synthetic parts are attached.
@@ -3421,12 +3405,10 @@
static __inline int
hn_lro_rx(struct lro_ctrl *lc, struct mbuf *m)
{
-#if __FreeBSD_version >= 1100095
if (hn_lro_mbufq_depth) {
tcp_lro_queue_mbuf(lc, m);
return 0;
}
-#endif
return tcp_lro_rx(lc, m, 0);
}
#endif
@@ -4166,8 +4148,6 @@
HN_UNLOCK(sc);
}
-#if __FreeBSD_version >= 1100099
-
static int
hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS)
{
@@ -4222,8 +4202,6 @@
return 0;
}
-#endif
-
static int
hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS)
{
@@ -4272,33 +4250,6 @@
return 0;
}
-#if __FreeBSD_version < 1100095
-static int
-hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS)
-{
- struct hn_softc *sc = arg1;
- int ofs = arg2, i, error;
- struct hn_rx_ring *rxr;
- uint64_t stat;
-
- stat = 0;
- for (i = 0; i < sc->hn_rx_ring_cnt; ++i) {
- rxr = &sc->hn_rx_ring[i];
- stat += *((int *)((uint8_t *)rxr + ofs));
- }
-
- error = sysctl_handle_64(oidp, &stat, 0, req);
- if (error || req->newptr == NULL)
- return error;
-
- /* Zero out this stat. */
- for (i = 0; i < sc->hn_rx_ring_cnt; ++i) {
- rxr = &sc->hn_rx_ring[i];
- *((int *)((uint8_t *)rxr + ofs)) = 0;
- }
- return 0;
-}
-#else
static int
hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS)
{
@@ -4325,8 +4276,6 @@
return 0;
}
-#endif
-
static int
hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS)
{
@@ -4986,9 +4935,7 @@
struct sysctl_ctx_list *ctx;
device_t dev = sc->hn_dev;
#if defined(INET) || defined(INET6)
-#if __FreeBSD_version >= 1100095
int lroent_cnt;
-#endif
#endif
int i;
@@ -5015,13 +4962,11 @@
M_DEVBUF, M_WAITOK | M_ZERO);
#if defined(INET) || defined(INET6)
-#if __FreeBSD_version >= 1100095
lroent_cnt = hn_lro_entry_count;
if (lroent_cnt < TCP_LRO_ENTRIES)
lroent_cnt = TCP_LRO_ENTRIES;
if (bootverbose)
device_printf(dev, "LRO: entry count %d\n", lroent_cnt);
-#endif
#endif /* INET || INET6 */
ctx = device_get_sysctl_ctx(dev);
@@ -5061,17 +5006,10 @@
* Initialize LRO.
*/
#if defined(INET) || defined(INET6)
-#if __FreeBSD_version >= 1100095
tcp_lro_init_args(&rxr->hn_lro, sc->hn_ifp, lroent_cnt,
hn_lro_mbufq_depth);
-#else
- tcp_lro_init(&rxr->hn_lro);
- rxr->hn_lro.ifp = sc->hn_ifp;
-#endif
-#if __FreeBSD_version >= 1100099
rxr->hn_lro.lro_length_lim = HN_LRO_LENLIM_DEF;
rxr->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF;
-#endif
#endif /* INET || INET6 */
if (sc->hn_rx_sysctl_tree != NULL) {
@@ -5122,26 +5060,17 @@
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued",
CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc,
__offsetof(struct hn_rx_ring, hn_lro.lro_queued),
-#if __FreeBSD_version < 1100095
- hn_rx_stat_int_sysctl,
-#else
hn_rx_stat_u64_sysctl,
-#endif
"LU", "LRO queued");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed",
CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc,
__offsetof(struct hn_rx_ring, hn_lro.lro_flushed),
-#if __FreeBSD_version < 1100095
- hn_rx_stat_int_sysctl,
-#else
hn_rx_stat_u64_sysctl,
-#endif
"LU", "LRO flushed");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried",
CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc,
__offsetof(struct hn_rx_ring, hn_lro_tried),
hn_rx_stat_ulong_sysctl, "LU", "# of LRO tries");
-#if __FreeBSD_version >= 1100099
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim",
CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0,
hn_lro_lenlim_sysctl, "IU",
@@ -5150,7 +5079,6 @@
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0,
hn_lro_ackcnt_sysctl, "I",
"Max # of ACKs to be aggregated by LRO");
-#endif
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp",
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, HN_TRUST_HCSUM_TCP,
hn_trust_hcsum_sysctl, "I",
Index: sys/dev/hyperv/pcib/vmbus_pcib.c
===================================================================
--- sys/dev/hyperv/pcib/vmbus_pcib.c
+++ sys/dev/hyperv/pcib/vmbus_pcib.c
@@ -74,11 +74,6 @@
#include "vmbus_if.h"
-#if __FreeBSD_version < 1100000
-typedef u_long rman_res_t;
-#define RM_MAX_END (~(rman_res_t)0)
-#endif
-
struct completion {
unsigned int done;
struct mtx lock;
@@ -631,131 +626,12 @@
return (NULL);
}
-#if __FreeBSD_version < 1100000
-
-/* Old versions don't have BUS_RESCAN(). Let's copy it from FreeBSD 11. */
-
-static struct pci_devinfo *
-pci_identify_function(device_t pcib, device_t dev, int domain, int busno,
- int slot, int func, size_t dinfo_size)
-{
- struct pci_devinfo *dinfo;
-
- dinfo = pci_read_device(pcib, domain, busno, slot, func, dinfo_size);
- if (dinfo != NULL)
- pci_add_child(dev, dinfo);
-
- return (dinfo);
-}
-
-static int
-pci_rescan(device_t dev)
-{
-#define REG(n, w) PCIB_READ_CONFIG(pcib, busno, s, f, n, w)
- device_t pcib = device_get_parent(dev);
- struct pci_softc *sc;
- device_t child, *devlist, *unchanged;
- int devcount, error, i, j, maxslots, oldcount;
- int busno, domain, s, f, pcifunchigh;
- uint8_t hdrtype;
-
- /* No need to check for ARI on a rescan. */
- error = device_get_children(dev, &devlist, &devcount);
- if (error)
- return (error);
- if (devcount != 0) {
- unchanged = malloc(devcount * sizeof(device_t), M_TEMP,
- M_NOWAIT | M_ZERO);
- if (unchanged == NULL) {
- free(devlist, M_TEMP);
- return (ENOMEM);
- }
- } else
- unchanged = NULL;
-
- sc = device_get_softc(dev);
- domain = pcib_get_domain(dev);
- busno = pcib_get_bus(dev);
- maxslots = PCIB_MAXSLOTS(pcib);
- for (s = 0; s <= maxslots; s++) {
- /* If function 0 is not present, skip to the next slot. */
- f = 0;
- if (REG(PCIR_VENDOR, 2) == 0xffff)
- continue;
- pcifunchigh = 0;
- hdrtype = REG(PCIR_HDRTYPE, 1);
- if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
- continue;
- if (hdrtype & PCIM_MFDEV)
- pcifunchigh = PCIB_MAXFUNCS(pcib);
- for (f = 0; f <= pcifunchigh; f++) {
- if (REG(PCIR_VENDOR, 2) == 0xffff)
- continue;
-
- /*
- * Found a valid function. Check if a
- * device_t for this device already exists.
- */
- for (i = 0; i < devcount; i++) {
- child = devlist[i];
- if (child == NULL)
- continue;
- if (pci_get_slot(child) == s &&
- pci_get_function(child) == f) {
- unchanged[i] = child;
- goto next_func;
- }
- }
-
- pci_identify_function(pcib, dev, domain, busno, s, f,
- sizeof(struct pci_devinfo));
- next_func:;
- }
- }
-
- /* Remove devices that are no longer present. */
- for (i = 0; i < devcount; i++) {
- if (unchanged[i] != NULL)
- continue;
- device_delete_child(dev, devlist[i]);
- }
-
- free(devlist, M_TEMP);
- oldcount = devcount;
-
- /* Try to attach the devices just added. */
- error = device_get_children(dev, &devlist, &devcount);
- if (error) {
- free(unchanged, M_TEMP);
- return (error);
- }
-
- for (i = 0; i < devcount; i++) {
- for (j = 0; j < oldcount; j++) {
- if (devlist[i] == unchanged[j])
- goto next_device;
- }
-
- device_probe_and_attach(devlist[i]);
- next_device:;
- }
-
- free(unchanged, M_TEMP);
- free(devlist, M_TEMP);
- return (0);
-#undef REG
-}
-
-#else
-
static int
pci_rescan(device_t dev)
{
return (BUS_RESCAN(dev));
}
-#endif
-
static void
pci_devices_present_work(void *arg, int pending __unused)
{
@@ -1686,14 +1562,12 @@
return (bus_generic_release_resource(dev, child, type, rid, r));
}
-#if __FreeBSD_version >= 1100000
static int
vmbus_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op,
size_t setsize, cpuset_t *cpuset)
{
return (bus_get_cpus(pcib, op, setsize, cpuset));
}
-#endif
static uint32_t
vmbus_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
@@ -1871,9 +1745,7 @@
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
-#if __FreeBSD_version >= 1100000
DEVMETHOD(bus_get_cpus, vmbus_pcib_get_cpus),
-#endif
/* pcib interface */
DEVMETHOD(pcib_maxslots, pcib_maxslots),
Index: sys/dev/hyperv/vmbus/vmbus.c
===================================================================
--- sys/dev/hyperv/vmbus/vmbus.c
+++ sys/dev/hyperv/vmbus/vmbus.c
@@ -182,9 +182,7 @@
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
-#if __FreeBSD_version >= 1100000
DEVMETHOD(bus_get_cpus, bus_generic_get_cpus),
-#endif
/* pcib interface */
DEVMETHOD(pcib_alloc_msi, vmbus_alloc_msi),
Index: sys/dev/hyperv/vmbus/vmbus_var.h
===================================================================
--- sys/dev/hyperv/vmbus/vmbus_var.h
+++ sys/dev/hyperv/vmbus/vmbus_var.h
@@ -81,10 +81,6 @@
struct task message_task; /* message task */
} __aligned(CACHE_LINE_SIZE);
-#if __FreeBSD_version < 1100000
-typedef u_long rman_res_t;
-#endif
-
struct vmbus_softc {
void (*vmbus_event_proc)(struct vmbus_softc *, int);
u_long *vmbus_tx_evtflags;
Index: sys/dev/iavf/iavf_lib.h
===================================================================
--- sys/dev/iavf/iavf_lib.h
+++ sys/dev/iavf/iavf_lib.h
@@ -206,7 +206,6 @@
IAVF_DEFAULT_ADV_RSS_HENA)
/* Pre-11 counter(9) compatibility */
-#if __FreeBSD_version >= 1100036
#define IAVF_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count)
#define IAVF_SET_IERRORS(vsi, count) (vsi)->ierrors = (count)
#define IAVF_SET_OPACKETS(vsi, count) (vsi)->opackets = (count)
@@ -219,20 +218,6 @@
#define IAVF_SET_IQDROPS(vsi, count) (vsi)->iqdrops = (count)
#define IAVF_SET_OQDROPS(vsi, count) (vsi)->oqdrops = (count)
#define IAVF_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
-#else
-#define IAVF_SET_IPACKETS(vsi, count) (vsi)->ifp->if_ipackets = (count)
-#define IAVF_SET_IERRORS(vsi, count) (vsi)->ifp->if_ierrors = (count)
-#define IAVF_SET_OPACKETS(vsi, count) (vsi)->ifp->if_opackets = (count)
-#define IAVF_SET_OERRORS(vsi, count) (vsi)->ifp->if_oerrors = (count)
-#define IAVF_SET_COLLISIONS(vsi, count) (vsi)->ifp->if_collisions = (count)
-#define IAVF_SET_IBYTES(vsi, count) (vsi)->ifp->if_ibytes = (count)
-#define IAVF_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count)
-#define IAVF_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count)
-#define IAVF_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count)
-#define IAVF_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count)
-#define IAVF_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops)
-#define IAVF_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
-#endif
/* For stats sysctl naming */
#define IAVF_QUEUE_NAME_LEN 32
Index: sys/dev/iavf/iavf_lib.c
===================================================================
--- sys/dev/iavf/iavf_lib.c
+++ sys/dev/iavf/iavf_lib.c
@@ -986,11 +986,7 @@
void
iavf_set_initial_baudrate(struct ifnet *ifp)
{
-#if __FreeBSD_version >= 1100000
if_setbaudrate(ifp, IF_Gbps(40));
-#else
- if_initbaudrate(ifp, IF_Gbps(40));
-#endif
}
/**
Index: sys/dev/ixgbe/ixgbe_osdep.h
===================================================================
--- sys/dev/ixgbe/ixgbe_osdep.h
+++ sys/dev/ixgbe/ixgbe_osdep.h
@@ -161,18 +161,6 @@
#define le16_to_cpu
-#if __FreeBSD_version < 800000
-#if defined(__i386__) || defined(__amd64__)
-#define mb() __asm volatile("mfence" ::: "memory")
-#define wmb() __asm volatile("sfence" ::: "memory")
-#define rmb() __asm volatile("lfence" ::: "memory")
-#else
-#define mb()
-#define rmb()
-#define wmb()
-#endif
-#endif
-
#if defined(__i386__) || defined(__amd64__)
static __inline
void prefetch(void *x)
Index: sys/dev/ixl/if_ixl.c
===================================================================
--- sys/dev/ixl/if_ixl.c
+++ sys/dev/ixl/if_ixl.c
@@ -314,11 +314,7 @@
SYSCTL_INT(_hw_ixl, OID_AUTO, enable_iwarp, CTLFLAG_RDTUN,
&ixl_enable_iwarp, 0, "iWARP enabled");
-#if __FreeBSD_version < 1100000
-int ixl_limit_iwarp_msix = 1;
-#else
int ixl_limit_iwarp_msix = IXL_IW_MAX_MSIX;
-#endif
TUNABLE_INT("hw.ixl.limit_iwarp_msix", &ixl_limit_iwarp_msix);
SYSCTL_INT(_hw_ixl, OID_AUTO, limit_iwarp_msix, CTLFLAG_RDTUN,
&ixl_limit_iwarp_msix, 0, "Limit MSI-X vectors assigned to iWARP");
Index: sys/dev/ixl/ixl.h
===================================================================
--- sys/dev/ixl/ixl.h
+++ sys/dev/ixl/ixl.h
@@ -273,7 +273,6 @@
(CSUM_IP|CSUM_IP_TSO)
/* Pre-11 counter(9) compatibility */
-#if __FreeBSD_version >= 1100036
#define IXL_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count)
#define IXL_SET_IERRORS(vsi, count) (vsi)->ierrors = (count)
#define IXL_SET_OPACKETS(vsi, count) (vsi)->opackets = (count)
@@ -286,20 +285,6 @@
#define IXL_SET_IQDROPS(vsi, count) (vsi)->iqdrops = (count)
#define IXL_SET_OQDROPS(vsi, count) (vsi)->oqdrops = (count)
#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
-#else
-#define IXL_SET_IPACKETS(vsi, count) (vsi)->ifp->if_ipackets = (count)
-#define IXL_SET_IERRORS(vsi, count) (vsi)->ifp->if_ierrors = (count)
-#define IXL_SET_OPACKETS(vsi, count) (vsi)->ifp->if_opackets = (count)
-#define IXL_SET_OERRORS(vsi, count) (vsi)->ifp->if_oerrors = (count)
-#define IXL_SET_COLLISIONS(vsi, count) (vsi)->ifp->if_collisions = (count)
-#define IXL_SET_IBYTES(vsi, count) (vsi)->ifp->if_ibytes = (count)
-#define IXL_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count)
-#define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count)
-#define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count)
-#define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count)
-#define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops)
-#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
-#endif
/* For stats sysctl naming */
#define IXL_QUEUE_NAME_LEN 32
Index: sys/dev/ixl/ixl_pf_main.c
===================================================================
--- sys/dev/ixl/ixl_pf_main.c
+++ sys/dev/ixl/ixl_pf_main.c
@@ -2267,7 +2267,7 @@
{
u64 new_data;
-#if defined(__FreeBSD__) && (__FreeBSD_version >= 1000000) && defined(__amd64__)
+#if defined(__FreeBSD__) && defined(__amd64__)
new_data = rd64(hw, loreg);
#else
/*
Index: sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
===================================================================
--- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
+++ sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
@@ -2067,7 +2067,6 @@
mutex_unlock(&mdev->state_lock);
VLAN_CAPABILITIES(dev);
break;
-#if __FreeBSD_version >= 1100036
case SIOCGI2C: {
struct ifi2creq i2c;
@@ -2091,7 +2090,6 @@
error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
break;
}
-#endif
case SIOCGIFRSSKEY:
ifrk = (struct ifrsskey *)data;
ifrk->ifrk_func = RSS_FUNC_TOEPLITZ;
@@ -2263,12 +2261,10 @@
if (mdev->LSO_support)
dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO;
-#if __FreeBSD_version >= 1100000
/* set TSO limits so that we don't have to drop TX packets */
dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */;
dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */;
dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE;
-#endif
dev->if_capenable = dev->if_capabilities;
Index: sys/dev/mlx4/mlx4_en/mlx4_en_port.c
===================================================================
--- sys/dev/mlx4/mlx4_en/mlx4_en_port.c
+++ sys/dev/mlx4/mlx4_en/mlx4_en_port.c
@@ -346,7 +346,6 @@
vport_stats->tx_frames = be64_to_cpu(tmp_vport_stats.tx_frames);
}
-#if __FreeBSD_version >= 1100000
if (reset == 0) {
if_inc_counter(dev, IFCOUNTER_IPACKETS,
priv->pkstats.rx_packets - priv->pkstats_last.rx_packets);
@@ -366,17 +365,6 @@
priv->pkstats.tx_multicast_packets - priv->pkstats_last.tx_multicast_packets);
}
priv->pkstats_last = priv->pkstats;
-#else
- dev->if_ipackets = priv->pkstats.rx_packets;
- dev->if_opackets = priv->pkstats.tx_packets;
- dev->if_ibytes = priv->pkstats.rx_bytes;
- dev->if_obytes = priv->pkstats.tx_bytes;
- dev->if_ierrors = priv->pkstats.rx_errors;
- dev->if_iqdrops = priv->pkstats.rx_dropped;
- dev->if_imcasts = priv->pkstats.rx_multicast_packets;
- dev->if_omcasts = priv->pkstats.tx_multicast_packets;
- dev->if_collisions = 0;
-#endif
spin_unlock(&priv->stats_lock);
Index: sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
===================================================================
--- sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+++ sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
@@ -981,10 +981,9 @@
/* Poll CQ here */
mlx4_en_xmit_poll(priv, i);
-#if __FreeBSD_version >= 1100000
if (unlikely(err != 0))
if_inc_counter(dev, IFCOUNTER_IQDROPS, 1);
-#endif
+
return (err);
}
Index: sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c
===================================================================
--- sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c
+++ sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c
@@ -568,8 +568,6 @@
}
EXPORT_SYMBOL(mlx5_fpga_client_unregister);
-#if (__FreeBSD_version >= 1100000)
MODULE_DEPEND(mlx5fpga, linuxkpi, 1, 1, 1);
-#endif
MODULE_DEPEND(mlx5fpga, mlx5, 1, 1, 1);
MODULE_VERSION(mlx5fpga, 1);
Index: sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c
===================================================================
--- sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c
+++ sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c
@@ -36,9 +36,7 @@
#include <dev/mlx5/mlx5_fpga_tools/tools.h>
#include <dev/mlx5/mlx5_fpga_tools/tools_char.h>
-#if (__FreeBSD_version >= 1100000)
MODULE_DEPEND(mlx5fpga_tools, linuxkpi, 1, 1, 1);
-#endif
MODULE_DEPEND(mlx5fpga_tools, mlx5, 1, 1, 1);
MODULE_DEPEND(mlx5fpga_tools, mlx5fpga, 1, 1, 1);
MODULE_VERSION(mlx5fpga_tools, 1);
Index: sys/dev/mmc/mmcsd.c
===================================================================
--- sys/dev/mmc/mmcsd.c
+++ sys/dev/mmc/mmcsd.c
@@ -87,11 +87,6 @@
#include "mmcbus_if.h"
-#if __FreeBSD_version < 800002
-#define kproc_create kthread_create
-#define kproc_exit kthread_exit
-#endif
-
#define MMCSD_CMD_RETRIES 5
#define MMCSD_FMT_BOOT "mmcsd%dboot"
Index: sys/dev/mpt/mpt_cam.h
===================================================================
--- sys/dev/mpt/mpt_cam.h
+++ sys/dev/mpt/mpt_cam.h
@@ -145,11 +145,6 @@
}
/************************** Version Compatibility *************************/
-#if __FreeBSD_version < 700031
-#define mpt_sim_alloc(a, b, c, mpt, e, f, g) \
- cam_sim_alloc(a, b, c, mpt, (mpt)->unit, e, f, g)
-#else
#define mpt_sim_alloc(a, b, c, mpt, e, f, g) \
cam_sim_alloc(a, b, c, mpt, (mpt)->unit, &(mpt)->mpt_lock, e, f, g)
-#endif
#endif /*_MPT_CAM_H_ */
Index: sys/dev/mrsas/mrsas.h
===================================================================
--- sys/dev/mrsas/mrsas.h
+++ sys/dev/mrsas/mrsas.h
@@ -138,12 +138,6 @@
/*
* Boolean types
*/
-#if (__FreeBSD_version < 901000)
-typedef enum _boolean {
- false, true
-} boolean;
-
-#endif
enum err {
SUCCESS, FAIL
};
@@ -3632,15 +3626,9 @@
};
/* Compatibility shims for different OS versions */
-#if __FreeBSD_version >= 800001
#define mrsas_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
#define mrsas_kproc_exit(arg) kproc_exit(arg)
-#else
-#define mrsas_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
- kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
-#define mrsas_kproc_exit(arg) kthread_exit(arg)
-#endif
static __inline void
mrsas_clear_bit(int b, volatile void *p)
Index: sys/dev/mrsas/mrsas_cam.c
===================================================================
--- sys/dev/mrsas/mrsas_cam.c
+++ sys/dev/mrsas/mrsas_cam.c
@@ -222,12 +222,6 @@
}
mtx_unlock(&sc->sim_lock);
-#if (__FreeBSD_version <= 704000)
- if (mrsas_bus_scan(sc)) {
- device_printf(sc->mrsas_dev, "Error in bus scan.\n");
- return (1);
- }
-#endif
return (0);
}
@@ -346,11 +340,7 @@
ccb->cpi.version_num = 1;
ccb->cpi.hba_inquiry = 0;
ccb->cpi.target_sprt = 0;
-#if (__FreeBSD_version >= 902001)
ccb->cpi.hba_misc = PIM_UNMAPPED;
-#else
- ccb->cpi.hba_misc = 0;
-#endif
ccb->cpi.hba_eng_cnt = 0;
ccb->cpi.max_lun = MRSAS_SCSI_MAX_LUNS;
ccb->cpi.unit_number = cam_sim_unit(sim);
@@ -368,9 +358,7 @@
ccb->cpi.max_target = MRSAS_MAX_PD - 1;
else
ccb->cpi.max_target = MRSAS_MAX_LD_IDS - 1;
-#if (__FreeBSD_version > 704000)
ccb->cpi.maxio = sc->max_sectors_per_req * 512;
-#endif
ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb);
break;
@@ -418,13 +406,8 @@
* on OCR enable/disable property of Controller from ocr_thread
* context.
*/
-#if (__FreeBSD_version >= 1000510)
callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0,
mrsas_scsiio_timeout, cmd, 0);
-#else
- callout_reset(&cmd->cm_callout, (180000 * hz) / 1000,
- mrsas_scsiio_timeout, cmd);
-#endif
if (cmd->ccb_ptr->cpi.bus_id == 0)
target_id = cmd->ccb_ptr->ccb_h.target_id;
@@ -492,8 +475,6 @@
} else
cmd->flags = MRSAS_DIR_NONE; /* no data */
-/* For FreeBSD 9.2 and higher */
-#if (__FreeBSD_version >= 902001)
/*
* XXX We don't yet support physical addresses here.
*/
@@ -526,24 +507,7 @@
ccb->ccb_h.status = CAM_REQ_INVALID;
goto done;
}
-#else
- if (!(ccb_h->flags & CAM_DATA_PHYS)) { /* Virtual data address */
- if (!(ccb_h->flags & CAM_SCATTER_VALID)) {
- cmd->length = csio->dxfer_len;
- if (cmd->length)
- cmd->data = csio->data_ptr;
- } else {
- mrsas_release_mpt_cmd(cmd);
- ccb_h->status = CAM_REQ_INVALID;
- goto done;
- }
- } else { /* Data addresses are physical. */
- mrsas_release_mpt_cmd(cmd);
- ccb_h->status = CAM_REQ_INVALID;
- ccb_h->status &= ~CAM_SIM_QUEUED;
- goto done;
- }
-#endif
+
/* save ccb ptr */
cmd->ccb_ptr = ccb;
@@ -624,13 +588,8 @@
* Start timer for IO timeout. Default timeout value is 90 second.
*/
cmd->callout_owner = true;
-#if (__FreeBSD_version >= 1000510)
callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0,
mrsas_scsiio_timeout, cmd, 0);
-#else
- callout_reset(&cmd->cm_callout, (180000 * hz) / 1000,
- mrsas_scsiio_timeout, cmd);
-#endif
if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater)
sc->io_cmds_highwater++;
@@ -1435,13 +1394,8 @@
if (cmd->data != NULL) {
/* Map data buffer into bus space */
mtx_lock(&sc->io_lock);
-#if (__FreeBSD_version >= 902001)
retcode = bus_dmamap_load_ccb(sc->data_tag, cmd->data_dmamap, ccb,
mrsas_data_load_cb, cmd, 0);
-#else
- retcode = bus_dmamap_load(sc->data_tag, cmd->data_dmamap, cmd->data,
- cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT);
-#endif
mtx_unlock(&sc->io_lock);
if (retcode)
device_printf(sc->mrsas_dev, "bus_dmamap_load(): retcode = %d\n", retcode);
Index: sys/dev/mrsas/mrsas_ioctl.h
===================================================================
--- sys/dev/mrsas/mrsas_ioctl.h
+++ sys/dev/mrsas/mrsas_ioctl.h
@@ -49,9 +49,6 @@
#ifdef COMPAT_FREEBSD32
/* Compilation error FIX */
-#if (__FreeBSD_version <= 900000)
-#include <sys/socket.h>
-#endif
#include <sys/mount.h>
#include <compat/freebsd32/freebsd32.h>
#endif
Index: sys/dev/mrsas/mrsas_linux.c
===================================================================
--- sys/dev/mrsas/mrsas_linux.c
+++ sys/dev/mrsas/mrsas_linux.c
@@ -43,11 +43,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#if (__FreeBSD_version >= 1001511)
#include <sys/capsicum.h>
-#elif (__FreeBSD_version > 900000)
-#include <sys/capability.h>
-#endif
#include <sys/conf.h>
#include <sys/kernel.h>
@@ -108,10 +104,7 @@
static int
mrsas_linux_ioctl(struct thread *p, struct linux_ioctl_args *args)
{
-#if (__FreeBSD_version >= 1000000)
cap_rights_t rights;
-
-#endif
struct file *fp;
int error;
u_long cmd = args->cmd;
@@ -120,14 +113,7 @@
error = ENOTSUP;
goto END;
}
-#if (__FreeBSD_version >= 1000000)
error = fget(p, args->fd, cap_rights_init_one(&rights, CAP_IOCTL), &fp);
-#elif (__FreeBSD_version <= 900000)
- error = fget(p, args->fd, &fp);
-#else /* For FreeBSD version greater than
- * 9.0.0 but less than 10.0.0 */
- error = fget(p, args->fd, CAP_IOCTL, &fp);
-#endif
if (error != 0)
goto END;
Index: sys/dev/mxge/if_mxge.c
===================================================================
--- sys/dev/mxge/if_mxge.c
+++ sys/dev/mxge/if_mxge.c
@@ -4582,10 +4582,7 @@
for (i = 0; i < sc->num_slices; i++) {
err = bus_setup_intr(sc->dev, sc->msix_irq_res[i],
- INTR_TYPE_NET | INTR_MPSAFE,
-#if __FreeBSD_version > 700030
- NULL,
-#endif
+ INTR_TYPE_NET | INTR_MPSAFE, NULL,
mxge_intr, &sc->ss[i], &sc->msix_ih[i]);
if (err != 0) {
device_printf(sc->dev, "couldn't setup intr for "
@@ -4658,10 +4655,7 @@
sc->legacy_irq ? "INTx" : "MSI",
rman_get_start(sc->irq_res));
err = bus_setup_intr(sc->dev, sc->irq_res,
- INTR_TYPE_NET | INTR_MPSAFE,
-#if __FreeBSD_version > 700030
- NULL,
-#endif
+ INTR_TYPE_NET | INTR_MPSAFE, NULL,
mxge_intr, &sc->ss[0], &sc->ih);
if (err != 0) {
bus_release_resource(sc->dev, SYS_RES_IRQ,
Index: sys/dev/mxge/if_mxge_var.h
===================================================================
--- sys/dev/mxge/if_mxge_var.h
+++ sys/dev/mxge/if_mxge_var.h
@@ -40,25 +40,9 @@
#define MXGE_EEPROM_STRINGS_SIZE 256
#define MXGE_MAX_SEND_DESC 128
-#if ((__FreeBSD_version > 800000 && __FreeBSD_version < 800005) \
- || __FreeBSD_version < 700111)
-#define MXGE_VIRT_JUMBOS 1
-#else
#define MXGE_VIRT_JUMBOS 0
-#endif
-#if (__FreeBSD_version > 800082)
#define IFNET_BUF_RING 1
-#endif
-
-#if (__FreeBSD_version < 1000020)
-#undef IF_Kbps
-#undef IF_Mbps
-#undef IF_Gbps
-#define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */
-#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */
-#define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */
-#endif
#ifndef VLAN_CAPABILITIES
#define VLAN_CAPABILITIES(ifp)
Index: sys/dev/netmap/if_ptnet.c
===================================================================
--- sys/dev/netmap/if_ptnet.c
+++ sys/dev/netmap/if_ptnet.c
@@ -93,12 +93,7 @@
#error "INET not defined, cannot support offloadings"
#endif
-#if __FreeBSD_version >= 1100000
static uint64_t ptnet_get_counter(if_t, ift_counter);
-#else
-typedef struct ifnet *if_t;
-#define if_getsoftc(_ifp) (_ifp)->if_softc
-#endif
//#define PTNETMAP_STATS
//#define DEBUG
@@ -418,9 +413,7 @@
ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX;
ifp->if_init = ptnet_init;
ifp->if_ioctl = ptnet_ioctl;
-#if __FreeBSD_version >= 1100000
ifp->if_get_counter = ptnet_get_counter;
-#endif
ifp->if_transmit = ptnet_transmit;
ifp->if_qflush = ptnet_qflush;
@@ -1014,7 +1007,6 @@
return 0;
}
-#if __FreeBSD_version >= 1100000
static uint64_t
ptnet_get_counter(if_t ifp, ift_counter cnt)
{
@@ -1052,8 +1044,6 @@
return (if_get_counter_default(ifp, cnt));
}
}
-#endif
-
#ifdef PTNETMAP_STATS
/* Called under core lock. */
Index: sys/dev/netmap/netmap_freebsd.c
===================================================================
--- sys/dev/netmap/netmap_freebsd.c
+++ sys/dev/netmap/netmap_freebsd.c
@@ -211,11 +211,7 @@
unsigned
nm_os_ifnet_mtu(struct ifnet *ifp)
{
-#if __FreeBSD_version < 1100030
- return ifp->if_data.ifi_mtu;
-#else /* __FreeBSD_version >= 1100030 */
return ifp->if_mtu;
-#endif
}
rawsum_t
@@ -423,26 +419,10 @@
struct ifnet *ifp = a->ifp;
struct mbuf *m = a->m;
-#if __FreeBSD_version < 1100000
- /*
- * Old FreeBSD versions. The mbuf has a cluster attached,
- * we need to copy from the cluster to the netmap buffer.
- */
- if (MBUF_REFCNT(m) != 1) {
- nm_prerr("invalid refcnt %d for %p", MBUF_REFCNT(m), m);
- panic("in generic_xmit_frame");
- }
- if (m->m_ext.ext_size < len) {
- nm_prlim(2, "size %d < len %d", m->m_ext.ext_size, len);
- len = m->m_ext.ext_size;
- }
- bcopy(a->addr, m->m_data, len);
-#else /* __FreeBSD_version >= 1100000 */
/* New FreeBSD versions. Link the external storage to
* the netmap buffer, so that no copy is necessary. */
m->m_ext.ext_buf = m->m_data = a->addr;
m->m_ext.ext_size = len;
-#endif /* __FreeBSD_version >= 1100000 */
m->m_flags |= M_PKTHDR;
m->m_len = m->m_pkthdr.len = len;
@@ -460,13 +440,11 @@
}
-#if __FreeBSD_version >= 1100005
struct netmap_adapter *
netmap_getna(if_t ifp)
{
return (NA((struct ifnet *)ifp));
}
-#endif /* __FreeBSD_version >= 1100005 */
/*
* The following two functions are empty until we have a generic
Index: sys/dev/netmap/netmap_generic.c
===================================================================
--- sys/dev/netmap/netmap_generic.c
+++ sys/dev/netmap/netmap_generic.c
@@ -482,11 +482,7 @@
* txsync. */
netmap_generic_irq(na, r, NULL);
#ifdef __FreeBSD__
-#if __FreeBSD_version <= 1200050
- void_mbuf_dtor(m, NULL, NULL);
-#else /* __FreeBSD_version >= 1200051 */
void_mbuf_dtor(m);
-#endif /* __FreeBSD_version >= 1200051 */
#endif
}
Index: sys/dev/netmap/netmap_kern.h
===================================================================
--- sys/dev/netmap/netmap_kern.h
+++ sys/dev/netmap/netmap_kern.h
@@ -110,23 +110,12 @@
#define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1))
#define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0)
-#if __FreeBSD_version >= 1100030
#define WNA(_ifp) (_ifp)->if_netmap
-#else /* older FreeBSD */
-#define WNA(_ifp) (_ifp)->if_pspare[0]
-#endif /* older FreeBSD */
-#if __FreeBSD_version >= 1100005
struct netmap_adapter *netmap_getna(if_t ifp);
-#endif
-#if __FreeBSD_version >= 1100027
#define MBUF_REFCNT(m) ((m)->m_ext.ext_count)
#define SET_MBUF_REFCNT(m, x) (m)->m_ext.ext_count = x
-#else
-#define MBUF_REFCNT(m) ((m)->m_ext.ref_cnt ? *((m)->m_ext.ref_cnt) : -1)
-#define SET_MBUF_REFCNT(m, x) *((m)->m_ext.ref_cnt) = x
-#endif
#define MBUF_QUEUED(m) 1
@@ -2387,70 +2376,7 @@
#ifdef __FreeBSD__
/*
- * FreeBSD mbuf allocator/deallocator in emulation mode:
- */
-#if __FreeBSD_version < 1100000
-
-/*
- * For older versions of FreeBSD:
- *
- * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE
- * so that the destructor, if invoked, will not free the packet.
- * In principle we should set the destructor only on demand,
- * but since there might be a race we better do it on allocation.
- * As a consequence, we also need to set the destructor or we
- * would leak buffers.
- */
-
-/* mbuf destructor, also need to change the type to EXT_EXTREF,
- * add an M_NOFREE flag, and then clear the flag and
- * chain into uma_zfree(zone_pack, mf)
- * (or reinstall the buffer ?)
- */
-#define SET_MBUF_DESTRUCTOR(m, fn) do { \
- (m)->m_ext.ext_free = (void *)fn; \
- (m)->m_ext.ext_type = EXT_EXTREF; \
-} while (0)
-
-static int
-void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2)
-{
- /* restore original mbuf */
- m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1;
- m->m_ext.ext_arg1 = NULL;
- m->m_ext.ext_type = EXT_PACKET;
- m->m_ext.ext_free = NULL;
- if (MBUF_REFCNT(m) == 0)
- SET_MBUF_REFCNT(m, 1);
- uma_zfree(zone_pack, m);
-
- return 0;
-}
-
-static inline struct mbuf *
-nm_os_get_mbuf(struct ifnet *ifp, int len)
-{
- struct mbuf *m;
-
- (void)ifp;
- m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
- if (m) {
- /* m_getcl() (mb_ctor_mbuf) has an assert that checks that
- * M_NOFREE flag is not specified as third argument,
- * so we have to set M_NOFREE after m_getcl(). */
- m->m_flags |= M_NOFREE;
- m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save
- m->m_ext.ext_free = (void *)void_mbuf_dtor;
- m->m_ext.ext_type = EXT_EXTREF;
- nm_prdis(5, "create m %p refcnt %d", m, MBUF_REFCNT(m));
- }
- return m;
-}
-
-#else /* __FreeBSD_version >= 1100000 */
-
-/*
- * Newer versions of FreeBSD, using a straightforward scheme.
+ * FreeBSD mbuf allocator/deallocator, using a straightforward scheme.
*
* We allocate mbufs with m_gethdr(), since the mbuf header is needed
* by the driver. We also attach a customly-provided external storage,
@@ -2463,13 +2389,9 @@
* has a KASSERT(), checking that the mbuf dtor function is not NULL.
*/
-#if __FreeBSD_version <= 1200050
-static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { }
-#else /* __FreeBSD_version >= 1200051 */
/* The arg1 and arg2 pointers argument were removed by r324446, which
* in included since version 1200051. */
static void void_mbuf_dtor(struct mbuf *m) { }
-#endif /* __FreeBSD_version >= 1200051 */
#define SET_MBUF_DESTRUCTOR(m, fn) do { \
(m)->m_ext.ext_free = (fn != NULL) ? \
@@ -2494,8 +2416,6 @@
return m;
}
-
-#endif /* __FreeBSD_version >= 1100000 */
#endif /* __FreeBSD__ */
struct nmreq_option * nmreq_getoption(struct nmreq_header *, uint16_t);
Index: sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
===================================================================
--- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
+++ sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
@@ -1933,13 +1933,11 @@
ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
-#if __FreeBSD_version >= 900026
case XPT_SMP_IO:
{
agtiapi_QueueSMP( pmcsc, ccb );
return;
}
-#endif /* __FreeBSD_version >= 900026 */
case XPT_SCSI_IO:
{
if(pmcsc->dev_scan == agFALSE)
@@ -2426,7 +2424,6 @@
return status;
} /* agtiapi_StartTM */
-#if __FreeBSD_version > 901000
/******************************************************************************
agtiapi_PrepareSGList()
@@ -2502,87 +2499,7 @@
}
return tiSuccess;
}
-#else
-/******************************************************************************
-agtiapi_PrepareSGList()
-
-Purpose:
- This function prepares scatter-gather list for the given ccb
-Parameters:
- struct agtiapi_softc *pmsc (IN) Pointer to the HBA data structure
- ccb_t *pccb (IN) A pointer to the driver's own CCB, not CAM's CCB
-Return:
- 0 - success
- 1 - failure
-
-Note:
-******************************************************************************/
-static int agtiapi_PrepareSGList(struct agtiapi_softc *pmcsc, ccb_t *pccb)
-{
- union ccb *ccb = pccb->ccb;
- struct ccb_scsiio *csio = &ccb->csio;
- struct ccb_hdr *ccbh = &ccb->ccb_h;
- AGTIAPI_IO( "agtiapi_PrepareSGList: start\n" );
-// agtiapi_DumpCDB("agtiapi_PrepareSGList", pccb);
- AGTIAPI_IO( "agtiapi_PrepareSGList: dxfer_len %d\n", csio->dxfer_len );
-
- if ((ccbh->flags & CAM_DIR_MASK) != CAM_DIR_NONE)
- {
- if ((ccbh->flags & CAM_SCATTER_VALID) == 0)
- {
- /* We've been given a pointer to a single buffer. */
- if ((ccbh->flags & CAM_DATA_PHYS) == 0)
- {
- /* Virtual address that needs to translated into one or more physical address ranges. */
- int error;
- // AG_LOCAL_LOCK(&(pmcsc->pCardInfo->pmIOLock));
- AGTIAPI_IO( "agtiapi_PrepareSGList: virtual address\n" );
- error = bus_dmamap_load( pmcsc->buffer_dmat,
- pccb->CCB_dmamap,
- csio->data_ptr,
- csio->dxfer_len,
- agtiapi_PrepareSGListCB,
- pccb,
- BUS_DMA_NOWAIT/* 0 */ );
- // AG_LOCAL_UNLOCK( &(pmcsc->pCardInfo->pmIOLock) );
-
- if (error == EINPROGRESS)
- {
- /* So as to maintain ordering, freeze the controller queue until our mapping is returned. */
- AGTIAPI_PRINTK("agtiapi_PrepareSGList: EINPROGRESS\n");
- xpt_freeze_simq(pmcsc->sim, 1);
- pmcsc->SimQFrozen = agTRUE;
- ccbh->status |= CAM_RELEASE_SIMQ;
- }
- }
- else
- {
- /* We have been given a pointer to single physical buffer. */
- /* pccb->tiSuperScsiRequest.sglVirtualAddr = seg.ds_addr; */
- struct bus_dma_segment seg;
- AGTIAPI_PRINTK("agtiapi_PrepareSGList: physical address\n");
- seg.ds_addr =
- (bus_addr_t)(vm_offset_t)csio->data_ptr;
- seg.ds_len = csio->dxfer_len;
- // * 0xFF to be defined
- agtiapi_PrepareSGListCB(pccb, &seg, 1, 0xAABBCCDD);
- }
- }
- else
- {
-
- AGTIAPI_PRINTK("agtiapi_PrepareSGList: unexpected case\n");
- return tiReject;
- }
- }
- else
- {
- agtiapi_PrepareSGListCB(pccb, NULL, 0, 0xAAAAAAAA);
- }
- return tiSuccess;
-}
-#endif
/******************************************************************************
agtiapi_PrepareSGListCB()
@@ -3382,7 +3299,6 @@
return;
}
-#if __FreeBSD_version > 901000
/******************************************************************************
agtiapi_PrepareSMPSGList()
@@ -3513,142 +3429,7 @@
return tiSuccess;
}
-#else
-
-/******************************************************************************
-agtiapi_PrepareSMPSGList()
-
-Purpose:
- This function prepares scatter-gather list for the given ccb
-Parameters:
- struct agtiapi_softc *pmsc (IN) Pointer to the HBA data structure
- ccb_t *pccb (IN) A pointer to the driver's own CCB, not CAM's CCB
-Return:
- 0 - success
- 1 - failure
-
-Note:
-******************************************************************************/
-static int agtiapi_PrepareSMPSGList( struct agtiapi_softc *pmcsc, ccb_t *pccb )
-{
- /* Pointer to CAM's ccb */
- union ccb *ccb = pccb->ccb;
- struct ccb_smpio *csmpio = &ccb->smpio;
- struct ccb_hdr *ccbh = &ccb->ccb_h;
-
- AGTIAPI_PRINTK("agtiapi_PrepareSMPSGList: start\n");
-
- if (ccbh->flags & (CAM_DATA_PHYS|CAM_SG_LIST_PHYS))
- {
- AGTIAPI_PRINTK( "agtiapi_PrepareSMPSGList: Physical Address "
- "not supported\n" );
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- return tiReject;
- }
-
- if (ccbh->flags & CAM_SCATTER_VALID)
- {
- /*
- * Currently we do not support Multiple SG list
- * return error for now
- */
- if ( (csmpio->smp_request_sglist_cnt > 1)
- || (csmpio->smp_response_sglist_cnt > 1) )
- {
- AGTIAPI_PRINTK( "agtiapi_PrepareSMPSGList: Multiple SG list "
- "not supported\n" );
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- return tiReject;
- }
- if ( csmpio->smp_request_sglist_cnt != 0 )
- {
- /*
- * Virtual address that needs to translated into
- * one or more physical address ranges.
- */
- int error;
- //AG_LOCAL_LOCK(&(pmcsc->pCardInfo->pmIOLock));
- AGTIAPI_PRINTK("agtiapi_PrepareSGList: virtual address\n");
- error = bus_dmamap_load( pmcsc->buffer_dmat,
- pccb->CCB_dmamap,
- csmpio->smp_request,
- csmpio->smp_request_len,
- agtiapi_PrepareSMPSGListCB,
- pccb,
- BUS_DMA_NOWAIT /* 0 */ );
-
- //AG_LOCAL_UNLOCK(&(pmcsc->pCardInfo->pmIOLock));
-
- if (error == EINPROGRESS)
- {
- /*
- * So as to maintain ordering,
- * freeze the controller queue
- * until our mapping is
- * returned.
- */
- AGTIAPI_PRINTK( "agtiapi_PrepareSGList: EINPROGRESS\n" );
- xpt_freeze_simq( pmcsc->sim, 1 );
- pmcsc->SimQFrozen = agTRUE;
- ccbh->status |= CAM_RELEASE_SIMQ;
- }
- }
- if( csmpio->smp_response_sglist_cnt != 0 )
- {
- /*
- * Virtual address that needs to translated into
- * one or more physical address ranges.
- */
- int error;
- //AG_LOCAL_LOCK( &(pmcsc->pCardInfo->pmIOLock) );
- AGTIAPI_PRINTK( "agtiapi_PrepareSGList: virtual address\n" );
- error = bus_dmamap_load( pmcsc->buffer_dmat,
- pccb->CCB_dmamap,
- csmpio->smp_response,
- csmpio->smp_response_len,
- agtiapi_PrepareSMPSGListCB,
- pccb,
- BUS_DMA_NOWAIT /* 0 */ );
-
- //AG_LOCAL_UNLOCK( &(pmcsc->pCardInfo->pmIOLock) );
-
- if ( error == EINPROGRESS )
- {
- /*
- * So as to maintain ordering,
- * freeze the controller queue
- * until our mapping is
- * returned.
- */
- AGTIAPI_PRINTK( "agtiapi_PrepareSGList: EINPROGRESS\n" );
- xpt_freeze_simq( pmcsc->sim, 1 );
- pmcsc->SimQFrozen = agTRUE;
- ccbh->status |= CAM_RELEASE_SIMQ;
- }
- }
- }
- else
- {
- if ( (csmpio->smp_request_sglist_cnt == 0) &&
- (csmpio->smp_response_sglist_cnt == 0) )
- {
- AGTIAPI_PRINTK( "agtiapi_PrepareSMPSGList: physical address\n" );
- pccb->tiSMPFrame.outFrameBuf = (void *)csmpio->smp_request;
- pccb->tiSMPFrame.outFrameLen = csmpio->smp_request_len;
- pccb->tiSMPFrame.expectedRespLen = csmpio->smp_response_len;
-
- // 0xFF to be defined
- agtiapi_PrepareSMPSGListCB( pccb, NULL, 0, 0xAABBCCDD );
- }
- pccb->tiSMPFrame.flag = 0;
- }
-
- return tiSuccess;
-}
-#endif
/******************************************************************************
agtiapi_PrepareSMPSGListCB()
Index: sys/dev/qlnx/qlnxe/bcm_osal.h
===================================================================
--- sys/dev/qlnx/qlnxe/bcm_osal.h
+++ sys/dev/qlnx/qlnxe/bcm_osal.h
@@ -35,16 +35,7 @@
#include <sys/bitstring.h>
#include <linux/types.h>
-
-#if __FreeBSD_version >= 1200032
#include <linux/bitmap.h>
-#else
-#if __FreeBSD_version >= 1100090
-#include <compat/linuxkpi/common/include/linux/bitops.h>
-#else
-#include <ofed/include/linux/bitops.h>
-#endif
-#endif
#define OSAL_NUM_CPUS() mp_ncpus
/*
@@ -481,34 +472,12 @@
val = *var;
-#if __FreeBSD_version >= 1100000
if (val & bit)
return (test_and_clear_bit(bit, var));
return (test_and_set_bit(bit, var));
-#else
- if (val & bit)
- return (test_and_clear_bit(bit, (long *)var));
-
- return (test_and_set_bit(bit, (long *)var));
-
-#endif
}
-#if __FreeBSD_version < 1100000
-static inline unsigned
-bitmap_weight(unsigned long *bitmap, unsigned nbits)
-{
- unsigned bit;
- unsigned retval = 0;
-
- for_each_set_bit(bit, bitmap, nbits)
- retval++;
- return (retval);
-}
-
-#endif
-
#define OSAL_TEST_AND_FLIP_BIT qlnx_test_and_change_bit
#define OSAL_TEST_AND_CLEAR_BIT test_and_clear_bit
#define OSAL_MEMCMP memcmp
Index: sys/dev/qlnx/qlnxe/qlnx_def.h
===================================================================
--- sys/dev/qlnx/qlnxe/qlnx_def.h
+++ sys/dev/qlnx/qlnxe/qlnx_def.h
@@ -715,17 +715,6 @@
#define QLNX_IFM_25G_CR IFM_UNKNOWN
#endif /* #if (defined IFM_25G_SR) */
-#if __FreeBSD_version < 1100000
-
-#define QLNX_INC_IERRORS(ifp) ifp->if_ierrors++
-#define QLNX_INC_IQDROPS(ifp) ifp->if_iqdrops++
-#define QLNX_INC_IPACKETS(ifp) ifp->if_ipackets++
-#define QLNX_INC_OPACKETS(ifp) ifp->if_opackets++
-#define QLNX_INC_OBYTES(ifp, len) ifp->if_obytes += len
-#define QLNX_INC_IBYTES(ifp, len) ifp->if_ibytes += len
-
-#else
-
#define QLNX_INC_IERRORS(ifp) if_inc_counter(ifp, IFCOUNTER_IERRORS, 1)
#define QLNX_INC_IQDROPS(ifp) if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1)
#define QLNX_INC_IPACKETS(ifp) if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1)
@@ -736,8 +725,6 @@
#define QLNX_INC_IBYTES(ifp, len) \
if_inc_counter(ha->ifp, IFCOUNTER_IBYTES, len)
-#endif /* #if __FreeBSD_version < 1100000 */
-
#define CQE_L3_PACKET(flags) \
((((flags) & PARSING_AND_ERR_FLAGS_L3TYPE_MASK) == e_l3_type_ipv4) || \
(((flags) & PARSING_AND_ERR_FLAGS_L3TYPE_MASK) == e_l3_type_ipv6))
Index: sys/dev/qlnx/qlnxe/qlnx_os.h
===================================================================
--- sys/dev/qlnx/qlnxe/qlnx_os.h
+++ sys/dev/qlnx/qlnxe/qlnx_os.h
@@ -50,8 +50,8 @@
#include <machine/_inttypes.h>
#include <sys/conf.h>
-#if __FreeBSD_version < 1000000
-#error FreeBSD Version not supported - use version >= 1000000
+#if __FreeBSD_version < 1203000
+#error FreeBSD Version not supported - use version >= 1203000
#endif
#include <net/if.h>
Index: sys/dev/qlnx/qlnxe/qlnx_os.c
===================================================================
--- sys/dev/qlnx/qlnxe/qlnx_os.c
+++ sys/dev/qlnx/qlnxe/qlnx_os.c
@@ -152,9 +152,7 @@
struct qlnx_agg_info *tpa);
static void qlnx_free_tpa_mbuf(qlnx_host_t *ha, struct qlnx_agg_info *tpa);
-#if __FreeBSD_version >= 1100000
static uint64_t qlnx_get_counter(if_t ifp, ift_counter cnt);
-#endif
/*
* Hooks to the Operating Systems
@@ -274,12 +272,6 @@
/* Number of Queues: 0 (Auto) or 1 to 32 (fixed queue number) */
static int qlnxe_queue_count = QLNX_DEFAULT_RSS;
-#if __FreeBSD_version < 1100000
-
-TUNABLE_INT("hw.qlnxe.queue_count", &qlnxe_queue_count);
-
-#endif
-
SYSCTL_INT(_hw_qlnxe, OID_AUTO, queue_count, CTLFLAG_RDTUN,
&qlnxe_queue_count, 0, "Multi-Queue queue count");
@@ -304,20 +296,9 @@
/* RDMA configuration; 64bit field allows setting for 16 physical functions*/
static uint64_t qlnxe_rdma_configuration = 0x22222222;
-#if __FreeBSD_version < 1100000
-
-TUNABLE_QUAD("hw.qlnxe.rdma_configuration", &qlnxe_rdma_configuration);
-
-SYSCTL_UQUAD(_hw_qlnxe, OID_AUTO, rdma_configuration, CTLFLAG_RDTUN,
- &qlnxe_rdma_configuration, 0, "RDMA Configuration");
-
-#else
-
SYSCTL_U64(_hw_qlnxe, OID_AUTO, rdma_configuration, CTLFLAG_RDTUN,
&qlnxe_rdma_configuration, 0, "RDMA Configuration");
-#endif /* #if __FreeBSD_version < 1100000 */
-
int
qlnx_vf_device(qlnx_host_t *ha)
{
@@ -2333,8 +2314,6 @@
device_id = pci_get_device(ha->pci_dev);
-#if __FreeBSD_version >= 1000000
-
if (device_id == QLOGIC_PCI_DEVICE_ID_1634)
ifp->if_baudrate = IF_Gbps(40);
else if ((device_id == QLOGIC_PCI_DEVICE_ID_1656) ||
@@ -2346,11 +2325,6 @@
ifp->if_baudrate = IF_Gbps(100);
ifp->if_capabilities = IFCAP_LINKSTATE;
-#else
- ifp->if_mtu = ETHERMTU;
- ifp->if_baudrate = (1 * 1000 * 1000 *1000);
-
-#endif /* #if __FreeBSD_version >= 1000000 */
ifp->if_init = qlnx_init;
ifp->if_softc = ha;
@@ -2363,9 +2337,7 @@
ifp->if_snd.ifq_drv_maxlen = qlnx_get_ifq_snd_maxlen(ha);
IFQ_SET_READY(&ifp->if_snd);
-#if __FreeBSD_version >= 1100036
if_setgetcounterfn(ifp, qlnx_get_counter);
-#endif
ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
@@ -2789,8 +2761,6 @@
VLAN_CAPABILITIES(ifp);
break;
-#if (__FreeBSD_version >= 1100101)
-
case SIOCGI2C:
{
struct ifi2creq i2c;
@@ -2838,7 +2808,6 @@
i2c.data[4], i2c.data[5], i2c.data[6], i2c.data[7]);
break;
}
-#endif /* #if (__FreeBSD_version >= 1100101) */
default:
QL_DPRINT4(ha, "default (0x%lx)\n", cmd);
@@ -3085,11 +3054,7 @@
QL_DPRINT2(ha, "enter\n");
-#if __FreeBSD_version >= 1100000
if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE)
-#else
- if (mp->m_flags & M_FLOWID)
-#endif
rss_id = (mp->m_pkthdr.flowid % ECORE_RSS_IND_TABLE_SIZE) %
ha->num_rss;
@@ -3971,9 +3936,7 @@
bus_dmamap_t map;
struct eth_rx_bd *rx_bd;
int i;
-#if __FreeBSD_version >= 1100000
uint8_t hash_type;
-#endif /* #if __FreeBSD_version >= 1100000 */
agg_index = cqe->tpa_agg_index;
@@ -4225,8 +4188,6 @@
//mp->m_pkthdr.flowid = fp->rss_id;
mp->m_pkthdr.flowid = cqe->rss_hash;
-#if __FreeBSD_version >= 1100000
-
hash_type = cqe->bitfields &
(ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_MASK <<
ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_SHIFT);
@@ -4253,10 +4214,6 @@
break;
}
-#else
- mp->m_flags |= M_FLOWID;
-#endif
-
mp->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID |
CSUM_DATA_VALID | CSUM_PSEUDO_HDR);
@@ -4600,9 +4557,7 @@
enum eth_rx_cqe_type cqe_type;
uint16_t len, pad, len_on_first_bd;
uint8_t *data;
-#if __FreeBSD_version >= 1100000
uint8_t hash_type;
-#endif /* #if __FreeBSD_version >= 1100000 */
/* Get the CQE from the completion ring */
cqe = (union eth_rx_cqe *)
@@ -4742,8 +4697,6 @@
mp->m_pkthdr.flowid = fp_cqe->rss_hash;
-#if __FreeBSD_version >= 1100000
-
hash_type = fp_cqe->bitfields &
(ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_MASK <<
ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_SHIFT);
@@ -4770,10 +4723,6 @@
break;
}
-#else
- mp->m_flags |= M_FLOWID;
-#endif
-
if (CQE_L3_PACKET(fp_cqe->pars_flags.flags)) {
mp->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
}
@@ -4797,22 +4746,10 @@
QLNX_INC_IBYTES(ifp, len);
#ifdef QLNX_SOFT_LRO
-
- if (lro_enable) {
-#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
-
+ if (lro_enable)
tcp_lro_queue_mbuf(lro, mp);
-
-#else
-
- if (tcp_lro_rx(lro, mp, 0))
- (*ifp->if_input)(ifp, mp);
-
-#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
-
- } else {
+ else
(*ifp->if_input)(ifp, mp);
- }
#else
(*ifp->if_input)(ifp, mp);
@@ -4932,7 +4869,6 @@
lro = &fp->rxq->lro;
if (lro_enable && total_rx_count) {
-#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
#ifdef QLNX_TRACE_LRO_CNT
if (lro->lro_mbuf_count & ~1023)
@@ -4948,17 +4884,6 @@
#endif /* #ifdef QLNX_TRACE_LRO_CNT */
tcp_lro_flush_all(lro);
-
-#else
- struct lro_entry *queued;
-
- while ((!SLIST_EMPTY(&lro->lro_active))) {
- queued = SLIST_FIRST(&lro->lro_active);
- SLIST_REMOVE_HEAD(&lro->lro_active, \
- next);
- tcp_lro_flush(lro, queued);
- }
-#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
}
}
#endif /* #ifdef QLNX_SOFT_LRO */
@@ -6287,19 +6212,11 @@
lro = &rxq->lro;
-#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
if (tcp_lro_init_args(lro, ifp, 0, rxq->num_rx_buffers)) {
QL_DPRINT1(ha, "tcp_lro_init[%d] failed\n",
rxq->rxq_id);
goto err;
}
-#else
- if (tcp_lro_init(lro)) {
- QL_DPRINT1(ha, "tcp_lro_init[%d] failed\n",
- rxq->rxq_id);
- goto err;
- }
-#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
lro->ifp = ha->ifp;
}
@@ -7197,7 +7114,6 @@
return (rc);
}
-#if __FreeBSD_version >= 1100000
static uint64_t
qlnx_get_counter(if_t ifp, ift_counter cnt)
{
@@ -7262,7 +7178,6 @@
}
return (count);
}
-#endif
static void
qlnx_timer(void *arg)
@@ -7382,20 +7297,7 @@
lro = &fp->rxq->lro;
-#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
-
tcp_lro_flush_all(lro);
-
-#else
- struct lro_entry *queued;
-
- while ((!SLIST_EMPTY(&lro->lro_active))){
- queued = SLIST_FIRST(&lro->lro_active);
- SLIST_REMOVE_HEAD(&lro->lro_active, next);
- tcp_lro_flush(lro, queued);
- }
-
-#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
}
}
Index: sys/dev/qlnx/qlnxr/qlnxr_cm.h
===================================================================
--- sys/dev/qlnx/qlnxr/qlnxr_cm.h
+++ sys/dev/qlnx/qlnxr/qlnxr_cm.h
@@ -42,20 +42,10 @@
#define ETH_P_ROCE (0x8915)
#define QLNXR_ROCE_V2_UDP_SPORT (0000)
-#if __FreeBSD_version >= 1102000
-
#define rdma_wr(_wr) rdma_wr(_wr)
#define ud_wr(_wr) ud_wr(_wr)
#define atomic_wr(_wr) atomic_wr(_wr)
-#else
-
-#define rdma_wr(_wr) (&(_wr->wr.rdma))
-#define ud_wr(_wr) (&(_wr->wr.ud))
-#define atomic_wr(_wr) (&(_wr->wr.atomic))
-
-#endif /* #if __FreeBSD_version >= 1102000 */
-
static inline u32 qlnxr_get_ipv4_from_gid(u8 *gid)
{
return *(u32 *)(void *)&gid[12];
Index: sys/dev/qlnx/qlnxr/qlnxr_cm.c
===================================================================
--- sys/dev/qlnx/qlnxr/qlnxr_cm.c
+++ sys/dev/qlnx/qlnxr/qlnxr_cm.c
@@ -494,11 +494,9 @@
u16 vlan_id = 0;
u16 ether_type;
-#if __FreeBSD_version >= 1102000
int rc = 0;
int ip_ver = 0;
bool has_udp = false;
-#endif /* #if __FreeBSD_version >= 1102000 */
#if !DEFINE_IB_AH_ATTR_WITH_DMAC
u8 mac[ETH_ALEN];
@@ -517,8 +515,6 @@
else
sgid = dev->sgid_tbl[0];
-#if __FreeBSD_version >= 1102000
-
rc = ib_ud_header_init(send_size, false /* LRH */, true /* ETH */,
has_vlan, has_grh_ipv6, ip_ver, has_udp,
0 /* immediate */, udh);
@@ -528,12 +524,6 @@
return rc;
}
-#else
- ib_ud_header_init(send_size, false /* LRH */, true /* ETH */,
- has_vlan, has_grh_ipv6, 0 /* immediate */, udh);
-
-#endif /* #if __FreeBSD_version >= 1102000 */
-
/* ENET + VLAN headers*/
#if DEFINE_IB_AH_ATTR_WITH_DMAC
memcpy(udh->eth.dmac_h, ah_attr->dmac, ETH_ALEN);
@@ -846,7 +836,6 @@
wc[i].byte_len = qp->rqe_wr_id[qp->rq.cons].sg_list[0].length;
wc[i].wc_flags |= IB_WC_GRH | IB_WC_IP_CSUM_OK;
-#if __FreeBSD_version >= 1100000
memcpy(&wc[i].smac, qp->rqe_wr_id[qp->rq.cons].smac, ETH_ALEN);
wc[i].wc_flags |= IB_WC_WITH_SMAC;
@@ -855,7 +844,6 @@
wc[i].vlan_id = qp->rqe_wr_id[qp->rq.cons].vlan_id;
}
-#endif
qlnxr_inc_sw_cons(&qp->rq);
i++;
}
Index: sys/dev/qlnx/qlnxr/qlnxr_def.h
===================================================================
--- sys/dev/qlnx/qlnxr/qlnxr_def.h
+++ sys/dev/qlnx/qlnxr/qlnxr_def.h
@@ -67,10 +67,6 @@
#include <rdma/ib_sa.h>
#include <rdma/uverbs_ioctl.h>
-#if __FreeBSD_version < 1100000
-#undef MODULE_VERSION
-#endif
-
#include "qlnx_os.h"
#include "bcm_osal.h"
@@ -627,11 +623,7 @@
u32 completed_handled;
};
-#if __FreeBSD_version < 1102000
-#define DEFINE_IB_FAST_REG
-#else
#define DEFINE_ALLOC_MR
-#endif
#ifdef DEFINE_IB_FAST_REG
struct qlnxr_fast_reg_page_list {
@@ -649,11 +641,7 @@
u32 max_inline_data;
-#if __FreeBSD_version >= 1100000
spinlock_t q_lock ____cacheline_aligned;
-#else
- spinlock_t q_lock;
-#endif
struct qlnxr_cq *sq_cq;
struct qlnxr_cq *rq_cq;
@@ -899,12 +887,7 @@
#define QLNXR_ROCE_PKEY_TABLE_LEN 1
#define QLNXR_ROCE_PKEY_DEFAULT 0xffff
-#if __FreeBSD_version < 1100000
-#define DEFINE_IB_AH_ATTR_WITH_DMAC (0)
-#define DEFINE_IB_UMEM_WITH_CHUNK (1)
-#else
#define DEFINE_IB_AH_ATTR_WITH_DMAC (1)
-#endif
#define QLNX_IS_IWARP(rdev) IS_IWARP(ECORE_LEADING_HWFN(rdev->cdev))
#define QLNX_IS_ROCE(rdev) IS_ROCE(ECORE_LEADING_HWFN(rdev->cdev))
Index: sys/dev/qlnx/qlnxr/qlnxr_os.c
===================================================================
--- sys/dev/qlnx/qlnxr/qlnxr_os.c
+++ sys/dev/qlnx/qlnxr/qlnxr_os.c
@@ -248,16 +248,9 @@
ibdev->dereg_mr = qlnxr_dereg_mr;
ibdev->reg_user_mr = qlnxr_reg_user_mr;
-#if __FreeBSD_version >= 1102000
ibdev->alloc_mr = qlnxr_alloc_mr;
ibdev->map_mr_sg = qlnxr_map_mr_sg;
ibdev->get_port_immutable = qlnxr_get_port_immutable;
-#else
- ibdev->reg_phys_mr = qlnxr_reg_kernel_mr;
- ibdev->alloc_fast_reg_mr = qlnxr_alloc_frmr;
- ibdev->alloc_fast_reg_page_list = qlnxr_alloc_frmr_page_list;
- ibdev->free_fast_reg_page_list = qlnxr_free_frmr_page_list;
-#endif /* #if __FreeBSD_version >= 1102000 */
ibdev->poll_cq = qlnxr_poll_cq;
ibdev->post_send = qlnxr_post_send;
@@ -281,14 +274,9 @@
iwcm->accept = qlnxr_iw_accept;
iwcm->reject = qlnxr_iw_reject;
-#if (__FreeBSD_version >= 1004000) && (__FreeBSD_version < 1102000)
-
- iwcm->create_listen_ep = qlnxr_iw_create_listen;
- iwcm->destroy_listen_ep = qlnxr_iw_destroy_listen;
-#else
iwcm->create_listen = qlnxr_iw_create_listen;
iwcm->destroy_listen = __qlnxr_iw_destroy_listen;
-#endif
+
iwcm->add_ref = qlnxr_iw_qp_add_ref;
iwcm->rem_ref = qlnxr_iw_qp_rem_ref;
iwcm->get_qp = qlnxr_iw_get_qp;
@@ -949,27 +937,6 @@
return found;
}
-#if __FreeBSD_version < 1100000
-
-static inline int
-is_vlan_dev(struct ifnet *ifp)
-{
- return (ifp->if_type == IFT_L2VLAN);
-}
-
-static inline uint16_t
-vlan_dev_vlan_id(struct ifnet *ifp)
-{
- uint16_t vtag;
-
- if (VLAN_TAG(ifp, &vtag) == 0)
- return (vtag);
-
- return (0);
-}
-
-#endif /* #if __FreeBSD_version < 1100000 */
-
static void
qlnxr_add_sgids(struct qlnxr_dev *dev)
{
@@ -1342,9 +1309,6 @@
MODULE_VERSION(qlnxr, 1);
MODULE_DEPEND(qlnxr, if_qlnxe, 1, 1, 1);
MODULE_DEPEND(qlnxr, ibcore, 1, 1, 1);
-
-#if __FreeBSD_version >= 1100000
MODULE_DEPEND(qlnxr, linuxkpi, 1, 1, 1);
-#endif /* #if __FreeBSD_version >= 1100000 */
DECLARE_MODULE(qlnxr, qlnxr_mod_info, SI_SUB_LAST, SI_ORDER_ANY);
Index: sys/dev/qlnx/qlnxr/qlnxr_verbs.h
===================================================================
--- sys/dev/qlnx/qlnxr/qlnxr_verbs.h
+++ sys/dev/qlnx/qlnxr/qlnxr_verbs.h
@@ -59,14 +59,10 @@
const struct ib_recv_wr *,
const struct ib_recv_wr **bad_recv_wr);
-#if __FreeBSD_version < 1102000
-extern int qlnxr_query_device(struct ib_device *, struct ib_device_attr *);
-#else
extern int qlnxr_query_device(struct ib_device *, struct ib_device_attr *,
struct ib_udata *);
extern int qlnxr_get_port_immutable(struct ib_device *ibdev, u8 port_num,
struct ib_port_immutable *immutable);
-#endif
extern int qlnxr_query_port(struct ib_device *,
u8 port,
@@ -130,7 +126,6 @@
extern int qlnxr_modify_ah(struct ib_ah *ibah,
struct ib_ah_attr *attr);
-#if __FreeBSD_version >= 1102000
extern int qlnxr_process_mad(struct ib_device *ibdev,
int process_mad_flags,
u8 port_num,
@@ -141,15 +136,6 @@
struct ib_mad_hdr *out_mad,
size_t *out_mad_size,
u16 *out_mad_pkey_index);
-#else
-extern int qlnxr_process_mad(struct ib_device *ibdev,
- int process_mad_flags,
- u8 port_num,
- struct ib_wc *in_wc,
- struct ib_grh *in_grh,
- struct ib_mad *in_mad,
- struct ib_mad *out_mad);
-#endif /* #if __FreeBSD_version >= 1102000 */
extern int qlnxr_post_send(struct ib_qp *,
const struct ib_send_wr *,
@@ -165,34 +151,14 @@
extern struct ib_mr *qlnxr_get_dma_mr(struct ib_pd *,
int acc);
-#if __FreeBSD_version < 1102000
-extern struct ib_mr *qlnxr_reg_kernel_mr(struct ib_pd *,
- struct ib_phys_buf *buffer_list,
- int num_phys_buf,
- int acc,
- u64 *iova_start);
-#endif /* #if __FreeBSD_version < 1102000 */
-
extern int qlnxr_dereg_mr(struct ib_mr *, struct ib_udata *);
-#if __FreeBSD_version >= 1102000
extern struct ib_mr *qlnxr_reg_user_mr(struct ib_pd *,
u64 start,
u64 length,
u64 virt,
int acc,
struct ib_udata *);
-#else
-extern struct ib_mr *qlnxr_reg_user_mr(struct ib_pd *,
- u64 start,
- u64 length,
- u64 virt,
- int acc,
- struct ib_udata *,
- int mr_id);
-#endif /* #if __FreeBSD_version >= 1102000 */
-
-#if __FreeBSD_version >= 1102000
extern struct ib_mr *qlnxr_alloc_mr(struct ib_pd *pd,
enum ib_mr_type mr_type, u32 max_num_sg,
@@ -200,18 +166,6 @@
extern int qlnxr_map_mr_sg(struct ib_mr *mr, struct scatterlist *sg,
int sg_nents, unsigned int *sg_offset);
-#else
-
-extern struct ib_mr *qlnxr_alloc_frmr(struct ib_pd *pd,
- int max_page_list_len);
-
-extern struct ib_fast_reg_page_list *qlnxr_alloc_frmr_page_list(
- struct ib_device *ibdev,
- int page_list_len);
-
-extern void qlnxr_free_frmr_page_list(struct ib_fast_reg_page_list *page_list);
-
-#endif /* #if __FreeBSD_version >= 1102000 */
extern int qlnxr_alloc_ucontext(struct ib_ucontext *uctx,
struct ib_udata *udata);
Index: sys/dev/qlnx/qlnxr/qlnxr_verbs.c
===================================================================
--- sys/dev/qlnx/qlnxr/qlnxr_verbs.c
+++ sys/dev/qlnx/qlnxr/qlnxr_verbs.c
@@ -469,13 +469,8 @@
}
int
-#if __FreeBSD_version < 1102000
-qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr)
-#else
qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
struct ib_udata *udata)
-#endif /* #if __FreeBSD_version < 1102000 */
-
{
struct qlnxr_dev *dev;
struct ecore_rdma_device *qattr;
@@ -486,10 +481,8 @@
QL_DPRINT12(ha, "enter\n");
-#if __FreeBSD_version > 1102000
if (udata->inlen || udata->outlen)
return -EINVAL;
-#endif /* #if __FreeBSD_version > 1102000 */
if (dev->rdma_ctx == NULL) {
return -EINVAL;
@@ -820,16 +813,14 @@
{
bool ret = false;
- QL_DPRINT12(ha, "enter \n");
-
- *vlan_id = 0;
-
-#if __FreeBSD_version >= 1100000
u16 tmp_vlan_id;
-#if __FreeBSD_version >= 1102000
union ib_gid *dgid;
+ QL_DPRINT12(ha, "enter \n");
+
+ *vlan_id = 0;
+
dgid = &attr->ah_attr.grh.dgid;
tmp_vlan_id = (dgid->raw[11] << 8) | dgid->raw[12];
@@ -837,20 +828,6 @@
*vlan_id = tmp_vlan_id;
ret = true;
}
-#else
- tmp_vlan_id = attr->vlan_id;
-
- if ((attr_mask & IB_QP_VID) && (!(tmp_vlan_id & ~EVL_VLID_MASK))) {
- *vlan_id = tmp_vlan_id;
- ret = true;
- }
-
-#endif /* #if __FreeBSD_version > 1102000 */
-
-#else
- ret = true;
-
-#endif /* #if __FreeBSD_version >= 1100000 */
QL_DPRINT12(ha, "exit vlan_id = 0x%x ret = %d \n", *vlan_id, ret);
@@ -1060,11 +1037,7 @@
ha = dev->ha;
-#if __FreeBSD_version > 1102000
unmapped_db = dev->db_phys_addr + (ucontext->dpi * ucontext->dpi_size);
-#else
- unmapped_db = dev->db_phys_addr;
-#endif /* #if __FreeBSD_version > 1102000 */
QL_DPRINT12(ha, "qedr_mmap enter vm_page=0x%lx"
" vm_pgoff=0x%lx unmapped_db=0x%llx db_size=%x, len=%lx\n",
@@ -1087,8 +1060,6 @@
QL_DPRINT12(ha, "Mapping doorbell bar\n");
-#if __FreeBSD_version > 1102000
-
if ((vm_page < unmapped_db) ||
((vm_page + len) > (unmapped_db + ucontext->dpi_size))) {
QL_DPRINT11(ha, "failed pages are outside of dpi;"
@@ -1106,24 +1077,6 @@
rc = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, len,
vma->vm_page_prot);
-#else
-
- if ((vm_page >= unmapped_db) && (vm_page <= (unmapped_db +
- dev->db_size))) {
- QL_DPRINT12(ha, "Mapping doorbell bar\n");
-
- vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
-
- rc = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
- PAGE_SIZE, vma->vm_page_prot);
- } else {
- QL_DPRINT12(ha, "Mapping chains\n");
- rc = io_remap_pfn_range(vma, vma->vm_start,
- vma->vm_pgoff, len, vma->vm_page_prot);
- }
-
-#endif /* #if __FreeBSD_version > 1102000 */
-
QL_DPRINT12(ha, "exit [%d]\n", rc);
return rc;
}
@@ -1514,13 +1467,8 @@
}
struct ib_mr *
-#if __FreeBSD_version >= 1102000
qlnxr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len,
u64 usr_addr, int acc, struct ib_udata *udata)
-#else
-qlnxr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len,
- u64 usr_addr, int acc, struct ib_udata *udata, int mr_id)
-#endif /* #if __FreeBSD_version >= 1102000 */
{
int rc = -ENOMEM;
struct qlnxr_dev *dev = get_qlnxr_dev((ibpd->device));
@@ -1592,11 +1540,7 @@
mr->hw_mr.pbl_page_size_log = ilog2(mr->info.pbl_info.pbl_size);
mr->hw_mr.page_size_log = ilog2(mr->umem->page_size); /* for the MR pages */
-#if __FreeBSD_version >= 1102000
mr->hw_mr.fbo = ib_umem_offset(mr->umem);
-#else
- mr->hw_mr.fbo = mr->umem->offset;
-#endif
mr->hw_mr.length = len;
mr->hw_mr.vaddr = usr_addr;
mr->hw_mr.zbva = false; /* TBD figure when this should be true */
@@ -1802,10 +1746,8 @@
struct ecore_rdma_create_cq_in_params params;
struct qlnxr_create_cq_ureq ureq;
-#if __FreeBSD_version >= 1100000
int vector = attr->comp_vector;
int entries = attr->cqe;
-#endif
struct qlnxr_cq *cq = get_qlnxr_cq(ibcq);
int chain_entries, rc, page_cnt;
u64 pbl_ptr;
@@ -2030,10 +1972,6 @@
QL_DPRINT12(ha, "attrs->qp_type = %d\n", attrs->qp_type);
QL_DPRINT12(ha, "attrs->create_flags = %d\n", attrs->create_flags);
-#if __FreeBSD_version < 1102000
- QL_DPRINT12(ha, "attrs->qpg_type = %d\n", attrs->qpg_type);
-#endif
-
QL_DPRINT12(ha, "attrs->port_num = %d\n", attrs->port_num);
QL_DPRINT12(ha, "attrs->cap.max_send_wr = 0x%x\n", attrs->cap.max_send_wr);
QL_DPRINT12(ha, "attrs->cap.max_recv_wr = 0x%x\n", attrs->cap.max_recv_wr);
@@ -2042,11 +1980,6 @@
QL_DPRINT12(ha, "attrs->cap.max_inline_data = 0x%x\n",
attrs->cap.max_inline_data);
-#if __FreeBSD_version < 1102000
- QL_DPRINT12(ha, "attrs->cap.qpg_tss_mask_sz = 0x%x\n",
- attrs->cap.qpg_tss_mask_sz);
-#endif
-
QL_DPRINT12(ha, "\n\nqattr->vendor_id = 0x%x\n", qattr->vendor_id);
QL_DPRINT12(ha, "qattr->vendor_part_id = 0x%x\n", qattr->vendor_part_id);
QL_DPRINT12(ha, "qattr->hw_ver = 0x%x\n", qattr->hw_ver);
@@ -4225,8 +4158,6 @@
return;
}
-#if __FreeBSD_version >= 1102000
-
static int qlnxr_prepare_reg(struct qlnxr_qp *qp,
struct rdma_sq_fmr_wqe_1st *fwqe1,
const struct ib_reg_wr *wr)
@@ -4265,163 +4196,6 @@
return 0;
}
-#else
-
-static void
-build_frmr_pbes(struct qlnxr_dev *dev, const struct ib_send_wr *wr,
- struct mr_info *info)
-{
- int i;
- u64 buf_addr = 0;
- int num_pbes, total_num_pbes = 0;
- struct regpair *pbe;
- struct qlnxr_pbl *pbl_tbl = info->pbl_table;
- struct qlnxr_pbl_info *pbl_info = &info->pbl_info;
- qlnx_host_t *ha;
-
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- pbe = (struct regpair *)pbl_tbl->va;
- num_pbes = 0;
-
- for (i = 0; i < wr->wr.fast_reg.page_list_len; i++) {
- buf_addr = wr->wr.fast_reg.page_list->page_list[i];
- pbe->lo = cpu_to_le32((u32)buf_addr);
- pbe->hi = cpu_to_le32((u32)upper_32_bits(buf_addr));
-
- num_pbes += 1;
- pbe++;
- total_num_pbes++;
-
- if (total_num_pbes == pbl_info->num_pbes)
- return;
-
- /* if the given pbl is full storing the pbes,
- * move to next pbl.
- */
- if (num_pbes ==
- (pbl_info->pbl_size / sizeof(u64))) {
- pbl_tbl++;
- pbe = (struct regpair *)pbl_tbl->va;
- num_pbes = 0;
- }
- }
- QL_DPRINT12(ha, "exit\n");
-
- return;
-}
-
-static int
-qlnxr_prepare_safe_pbl(struct qlnxr_dev *dev, struct mr_info *info)
-{
- int rc = 0;
- qlnx_host_t *ha;
-
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- if (info->completed == 0) {
- //DP_VERBOSE(dev, QLNXR_MSG_MR, "First FMR\n");
- /* first fmr */
- return 0;
- }
-
- qlnx_handle_completed_mrs(dev, info);
-
- list_add_tail(&info->pbl_table->list_entry, &info->inuse_pbl_list);
-
- if (list_empty(&info->free_pbl_list)) {
- info->pbl_table = qlnxr_alloc_pbl_tbl(dev, &info->pbl_info,
- GFP_ATOMIC);
- } else {
- info->pbl_table = list_first_entry(&info->free_pbl_list,
- struct qlnxr_pbl,
- list_entry);
- list_del(&info->pbl_table->list_entry);
- }
-
- if (!info->pbl_table)
- rc = -ENOMEM;
-
- QL_DPRINT12(ha, "exit\n");
- return rc;
-}
-
-static inline int
-qlnxr_prepare_fmr(struct qlnxr_qp *qp,
- struct rdma_sq_fmr_wqe_1st *fwqe1,
- const struct ib_send_wr *wr)
-{
- struct qlnxr_dev *dev = qp->dev;
- u64 fbo;
- struct qlnxr_fast_reg_page_list *frmr_list =
- get_qlnxr_frmr_list(wr->wr.fast_reg.page_list);
- struct rdma_sq_fmr_wqe *fwqe2 =
- (struct rdma_sq_fmr_wqe *)ecore_chain_produce(&qp->sq.pbl);
- int rc = 0;
- qlnx_host_t *ha;
-
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- if (wr->wr.fast_reg.page_list_len == 0)
- BUG();
-
- rc = qlnxr_prepare_safe_pbl(dev, &frmr_list->info);
- if (rc)
- return rc;
-
- fwqe1->addr.hi = upper_32_bits(wr->wr.fast_reg.iova_start);
- fwqe1->addr.lo = lower_32_bits(wr->wr.fast_reg.iova_start);
- fwqe1->l_key = wr->wr.fast_reg.rkey;
-
- SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_REMOTE_READ,
- !!(wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_READ));
- SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_REMOTE_WRITE,
- !!(wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_WRITE));
- SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_ENABLE_ATOMIC,
- !!(wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_ATOMIC));
- SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_LOCAL_READ, 1);
- SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_LOCAL_WRITE,
- !!(wr->wr.fast_reg.access_flags & IB_ACCESS_LOCAL_WRITE));
-
- fwqe2->fmr_ctrl = 0;
-
- SET_FIELD2(fwqe2->fmr_ctrl, RDMA_SQ_FMR_WQE_2ND_PAGE_SIZE_LOG,
- ilog2(1 << wr->wr.fast_reg.page_shift) - 12);
- SET_FIELD2(fwqe2->fmr_ctrl, RDMA_SQ_FMR_WQE_2ND_ZERO_BASED, 0);
-
- fwqe2->length_hi = 0; /* Todo - figure this out... why length is only 32bit.. */
- fwqe2->length_lo = wr->wr.fast_reg.length;
- fwqe2->pbl_addr.hi = upper_32_bits(frmr_list->info.pbl_table->pa);
- fwqe2->pbl_addr.lo = lower_32_bits(frmr_list->info.pbl_table->pa);
-
- /* produce another wqe for fwqe3 */
- ecore_chain_produce(&qp->sq.pbl);
-
- fbo = wr->wr.fast_reg.iova_start -
- (wr->wr.fast_reg.page_list->page_list[0] & PAGE_MASK);
-
- QL_DPRINT12(ha, "wr.fast_reg.iova_start = %p rkey=%x addr=%x:%x"
- " length = %x pbl_addr %x:%x\n",
- wr->wr.fast_reg.iova_start, wr->wr.fast_reg.rkey,
- fwqe1->addr.hi, fwqe1->addr.lo, fwqe2->length_lo,
- fwqe2->pbl_addr.hi, fwqe2->pbl_addr.lo);
-
- build_frmr_pbes(dev, wr, &frmr_list->info);
-
- qp->wqe_wr_id[qp->sq.prod].frmr = frmr_list;
-
- QL_DPRINT12(ha, "exit\n");
- return 0;
-}
-
-#endif /* #if __FreeBSD_version >= 1102000 */
-
static enum ib_wc_opcode
qlnxr_ib_to_wc_opcode(enum ib_wr_opcode opcode)
{
@@ -4439,15 +4213,8 @@
return IB_WC_COMP_SWAP;
case IB_WR_ATOMIC_FETCH_AND_ADD:
return IB_WC_FETCH_ADD;
-
-#if __FreeBSD_version >= 1102000
case IB_WR_REG_MR:
return IB_WC_REG_MR;
-#else
- case IB_WR_FAST_REG_MR:
- return IB_WC_FAST_REG_MR;
-#endif /* #if __FreeBSD_version >= 1102000 */
-
case IB_WR_LOCAL_INV:
return IB_WC_LOCAL_INV;
default:
@@ -4784,8 +4551,6 @@
break;
-#if __FreeBSD_version >= 1102000
-
case IB_WR_REG_MR:
QL_DPRINT12(ha, "IB_WR_REG_MR\n");
@@ -4805,30 +4570,6 @@
qp->prev_wqe_size = fwqe1->wqe_size;
break;
-#else
- case IB_WR_FAST_REG_MR:
-
- QL_DPRINT12(ha, "FAST_MR (IB_WR_FAST_REG_MR)\n");
-
- wqe->req_type = RDMA_SQ_REQ_TYPE_FAST_MR;
- fwqe1 = (struct rdma_sq_fmr_wqe_1st *)wqe;
- fwqe1->prev_wqe_size = 3;
-
- rc = qlnxr_prepare_fmr(qp, fwqe1, wr);
-
- if (rc) {
- QL_DPRINT12(ha,
- "FAST_MR (IB_WR_FAST_REG_MR) failed"
- " rc = %d\n", rc);
- *bad_wr = wr;
- break;
- }
-
- qp->wqe_wr_id[qp->sq.prod].wqe_size = fwqe1->prev_wqe_size;
- qp->prev_wqe_size = fwqe1->prev_wqe_size;
-
- break;
-#endif /* #if __FreeBSD_version >= 1102000 */
default:
@@ -5037,15 +4778,9 @@
static inline void
qlnxr_chk_if_fmr(struct qlnxr_qp *qp)
{
-#if __FreeBSD_version >= 1102000
if (qp->wqe_wr_id[qp->sq.cons].opcode == IB_WC_REG_MR)
qp->wqe_wr_id[qp->sq.cons].mr->info.completed++;
-#else
- if (qp->wqe_wr_id[qp->sq.cons].opcode == IB_WC_FAST_REG_MR)
- qp->wqe_wr_id[qp->sq.cons].frmr->info.completed++;
-
-#endif /* #if __FreeBSD_version >= 1102000 */
}
static int
@@ -5096,15 +4831,9 @@
wc->byte_len = 8;
break;
-#if __FreeBSD_version >= 1102000
case IB_WC_REG_MR:
qp->wqe_wr_id[qp->sq.cons].mr->info.completed++;
break;
-#else
- case IB_WC_FAST_REG_MR:
- qp->wqe_wr_id[qp->sq.cons].frmr->info.completed++;
- break;
-#endif /* #if __FreeBSD_version >= 1102000 */
case IB_WC_RDMA_READ:
case IB_WC_SEND:
@@ -5220,9 +4949,6 @@
u64 wr_id)
{
enum ib_wc_status wc_status = IB_WC_SUCCESS;
-#if __FreeBSD_version < 1102000
- u8 flags;
-#endif
qlnx_host_t *ha = dev->ha;
QL_DPRINT12(ha, "enter qp = %p resp->status = 0x%x\n",
@@ -5257,8 +4983,6 @@
break;
case RDMA_CQE_RESP_STS_OK:
-
-#if __FreeBSD_version >= 1102000
if (resp->flags & QLNXR_RESP_IMM) {
wc->ex.imm_data =
le32_to_cpu(resp->imm_data_or_inv_r_Key);
@@ -5291,32 +5015,6 @@
"qp = %p qp->id = 0x%x cq = %p cq->icid = 0x%x\n",
resp->flags, qp, qp->id, cq, cq->icid );
}
-#else
- wc_status = IB_WC_SUCCESS;
- wc->byte_len = le32_to_cpu(resp->length);
-
- flags = resp->flags & QLNXR_RESP_RDMA_IMM;
-
- switch (flags) {
- case QLNXR_RESP_RDMA_IMM:
- /* update opcode */
- wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
- /* fall to set imm data */
- case QLNXR_RESP_IMM:
- wc->ex.imm_data =
- le32_to_cpu(resp->imm_data_or_inv_r_Key);
- wc->wc_flags |= IB_WC_WITH_IMM;
- break;
- case QLNXR_RESP_RDMA:
- QL_DPRINT11(ha, "Invalid flags QLNXR_RESP_RDMA [0x%x]"
- "qp = %p qp->id = 0x%x cq = %p cq->icid = 0x%x\n",
- resp->flags, qp, qp->id, cq, cq->icid );
- break;
- default:
- /* valid configuration, but nothing todo here */
- ;
- }
-#endif /* #if __FreeBSD_version >= 1102000 */
break;
default:
@@ -5764,8 +5462,6 @@
return ERR_PTR(rc);
}
-#if __FreeBSD_version >= 1102000
-
struct ib_mr *
qlnxr_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type,
u32 max_num_sg, struct ib_udata *udata)
@@ -5855,348 +5551,6 @@
return (ret);
}
-#else
-
-struct ib_mr *
-qlnxr_alloc_frmr(struct ib_pd *ibpd, int max_page_list_len)
-{
- struct qlnxr_dev *dev;
- struct qlnxr_mr *mr;
- qlnx_host_t *ha;
- struct ib_mr *ibmr = NULL;
-
- dev = get_qlnxr_dev((ibpd->device));
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- mr = __qlnxr_alloc_mr(ibpd, max_page_list_len);
-
- if (IS_ERR(mr)) {
- ibmr = ERR_PTR(-EINVAL);
- } else {
- ibmr = &mr->ibmr;
- }
-
- QL_DPRINT12(ha, "exit %p\n", ibmr);
- return (ibmr);
-}
-
-void
-qlnxr_free_frmr_page_list(struct ib_fast_reg_page_list *page_list)
-{
- struct qlnxr_fast_reg_page_list *frmr_list;
-
- frmr_list = get_qlnxr_frmr_list(page_list);
-
- free_mr_info(frmr_list->dev, &frmr_list->info);
-
- kfree(frmr_list->ibfrpl.page_list);
- kfree(frmr_list);
-
- return;
-}
-
-struct ib_fast_reg_page_list *
-qlnxr_alloc_frmr_page_list(struct ib_device *ibdev, int page_list_len)
-{
- struct qlnxr_fast_reg_page_list *frmr_list = NULL;
- struct qlnxr_dev *dev;
- int size = page_list_len * sizeof(u64);
- int rc = -ENOMEM;
- qlnx_host_t *ha;
-
- dev = get_qlnxr_dev(ibdev);
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- frmr_list = kzalloc(sizeof(*frmr_list), GFP_KERNEL);
- if (!frmr_list) {
- QL_DPRINT11(ha, "kzalloc(frmr_list) failed\n");
- goto err;
- }
-
- frmr_list->dev = dev;
- frmr_list->ibfrpl.page_list = kzalloc(size, GFP_KERNEL);
- if (!frmr_list->ibfrpl.page_list) {
- QL_DPRINT11(ha, "frmr_list->ibfrpl.page_list = NULL failed\n");
- goto err0;
- }
-
- rc = qlnxr_init_mr_info(dev, &frmr_list->info, page_list_len,
- 1 /* allow dual layer pbl */);
- if (rc)
- goto err1;
-
- QL_DPRINT12(ha, "exit %p\n", &frmr_list->ibfrpl);
-
- return &frmr_list->ibfrpl;
-
-err1:
- kfree(frmr_list->ibfrpl.page_list);
-err0:
- kfree(frmr_list);
-err:
- QL_DPRINT12(ha, "exit with error\n");
-
- return ERR_PTR(rc);
-}
-
-static int
-qlnxr_validate_phys_buf_list(qlnx_host_t *ha, struct ib_phys_buf *buf_list,
- int buf_cnt, uint64_t *total_size)
-{
- u64 size = 0;
-
- *total_size = 0;
-
- if (!buf_cnt || buf_list == NULL) {
- QL_DPRINT11(ha,
- "failed buf_list = %p buf_cnt = %d\n", buf_list, buf_cnt);
- return (-1);
- }
-
- size = buf_list->size;
-
- if (!size) {
- QL_DPRINT11(ha,
- "failed buf_list = %p buf_cnt = %d"
- " buf_list->size = 0\n", buf_list, buf_cnt);
- return (-1);
- }
-
- while (buf_cnt) {
- *total_size += buf_list->size;
-
- if (buf_list->size != size) {
- QL_DPRINT11(ha,
- "failed buf_list = %p buf_cnt = %d"
- " all buffers should have same size\n",
- buf_list, buf_cnt);
- return (-1);
- }
-
- buf_list++;
- buf_cnt--;
- }
- return (0);
-}
-
-static size_t
-qlnxr_get_num_pages(qlnx_host_t *ha, struct ib_phys_buf *buf_list,
- int buf_cnt)
-{
- int i;
- size_t num_pages = 0;
- u64 size;
-
- for (i = 0; i < buf_cnt; i++) {
- size = 0;
- while (size < buf_list->size) {
- size += PAGE_SIZE;
- num_pages++;
- }
- buf_list++;
- }
- return (num_pages);
-}
-
-static void
-qlnxr_populate_phys_mem_pbls(struct qlnxr_dev *dev,
- struct ib_phys_buf *buf_list, int buf_cnt,
- struct qlnxr_pbl *pbl, struct qlnxr_pbl_info *pbl_info)
-{
- struct regpair *pbe;
- struct qlnxr_pbl *pbl_tbl;
- int pg_cnt, pages, pbe_cnt, total_num_pbes = 0;
- qlnx_host_t *ha;
- int i;
- u64 pbe_addr;
-
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- if (!pbl_info) {
- QL_DPRINT11(ha, "PBL_INFO not initialized\n");
- return;
- }
-
- if (!pbl_info->num_pbes) {
- QL_DPRINT11(ha, "pbl_info->num_pbes == 0\n");
- return;
- }
-
- /* If we have a two layered pbl, the first pbl points to the rest
- * of the pbls and the first entry lays on the second pbl in the table
- */
- if (pbl_info->two_layered)
- pbl_tbl = &pbl[1];
- else
- pbl_tbl = pbl;
-
- pbe = (struct regpair *)pbl_tbl->va;
- if (!pbe) {
- QL_DPRINT12(ha, "pbe is NULL\n");
- return;
- }
-
- pbe_cnt = 0;
-
- for (i = 0; i < buf_cnt; i++) {
- pages = buf_list->size >> PAGE_SHIFT;
-
- for (pg_cnt = 0; pg_cnt < pages; pg_cnt++) {
- /* store the page address in pbe */
-
- pbe_addr = buf_list->addr + (PAGE_SIZE * pg_cnt);
-
- pbe->lo = cpu_to_le32((u32)pbe_addr);
- pbe->hi = cpu_to_le32(((u32)(pbe_addr >> 32)));
-
- QL_DPRINT12(ha, "Populate pbl table:"
- " pbe->addr=0x%x:0x%x "
- " pbe_cnt = %d total_num_pbes=%d"
- " pbe=%p\n", pbe->lo, pbe->hi, pbe_cnt,
- total_num_pbes, pbe);
-
- pbe_cnt ++;
- total_num_pbes ++;
- pbe++;
-
- if (total_num_pbes == pbl_info->num_pbes)
- return;
-
- /* if the given pbl is full storing the pbes,
- * move to next pbl. */
-
- if (pbe_cnt == (pbl_info->pbl_size / sizeof(u64))) {
- pbl_tbl++;
- pbe = (struct regpair *)pbl_tbl->va;
- pbe_cnt = 0;
- }
- }
- buf_list++;
- }
- QL_DPRINT12(ha, "exit\n");
- return;
-}
-
-struct ib_mr *
-qlnxr_reg_kernel_mr(struct ib_pd *ibpd,
- struct ib_phys_buf *buf_list,
- int buf_cnt, int acc, u64 *iova_start)
-{
- int rc = -ENOMEM;
- struct qlnxr_dev *dev = get_qlnxr_dev((ibpd->device));
- struct qlnxr_mr *mr;
- struct qlnxr_pd *pd;
- qlnx_host_t *ha;
- size_t num_pages = 0;
- uint64_t length;
-
- ha = dev->ha;
-
- QL_DPRINT12(ha, "enter\n");
-
- pd = get_qlnxr_pd(ibpd);
-
- QL_DPRINT12(ha, "pd = %d buf_list = %p, buf_cnt = %d,"
- " iova_start = %p, acc = %d\n",
- pd->pd_id, buf_list, buf_cnt, iova_start, acc);
-
- //if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) {
- // QL_DPRINT11(ha, "(acc & IB_ACCESS_REMOTE_WRITE &&"
- // " !(acc & IB_ACCESS_LOCAL_WRITE))\n");
- // return ERR_PTR(-EINVAL);
- //}
-
- mr = kzalloc(sizeof(*mr), GFP_KERNEL);
- if (!mr) {
- QL_DPRINT11(ha, "kzalloc(mr) failed\n");
- return ERR_PTR(rc);
- }
-
- mr->type = QLNXR_MR_KERNEL;
- mr->iova_start = iova_start;
-
- rc = qlnxr_validate_phys_buf_list(ha, buf_list, buf_cnt, &length);
- if (rc)
- goto err0;
-
- num_pages = qlnxr_get_num_pages(ha, buf_list, buf_cnt);
- if (!num_pages)
- goto err0;
-
- rc = qlnxr_init_mr_info(dev, &mr->info, num_pages, 1);
- if (rc) {
- QL_DPRINT11(ha,
- "qlnxr_init_mr_info failed [%d]\n", rc);
- goto err1;
- }
-
- qlnxr_populate_phys_mem_pbls(dev, buf_list, buf_cnt, mr->info.pbl_table,
- &mr->info.pbl_info);
-
- rc = ecore_rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid);
-
- if (rc) {
- QL_DPRINT11(ha, "roce alloc tid returned an error %d\n", rc);
- goto err1;
- }
-
- /* index only, 18 bit long, lkey = itid << 8 | key */
- mr->hw_mr.tid_type = ECORE_RDMA_TID_REGISTERED_MR;
- mr->hw_mr.key = 0;
- mr->hw_mr.pd = pd->pd_id;
- mr->hw_mr.local_read = 1;
- mr->hw_mr.local_write = (acc & IB_ACCESS_LOCAL_WRITE) ? 1 : 0;
- mr->hw_mr.remote_read = (acc & IB_ACCESS_REMOTE_READ) ? 1 : 0;
- mr->hw_mr.remote_write = (acc & IB_ACCESS_REMOTE_WRITE) ? 1 : 0;
- mr->hw_mr.remote_atomic = (acc & IB_ACCESS_REMOTE_ATOMIC) ? 1 : 0;
- mr->hw_mr.mw_bind = false; /* TBD MW BIND */
- mr->hw_mr.pbl_ptr = mr->info.pbl_table[0].pa;
- mr->hw_mr.pbl_two_level = mr->info.pbl_info.two_layered;
- mr->hw_mr.pbl_page_size_log = ilog2(mr->info.pbl_info.pbl_size);
- mr->hw_mr.page_size_log = ilog2(PAGE_SIZE); /* for the MR pages */
-
- mr->hw_mr.fbo = 0;
-
- mr->hw_mr.length = length;
- mr->hw_mr.vaddr = (uint64_t)iova_start;
- mr->hw_mr.zbva = false; /* TBD figure when this should be true */
- mr->hw_mr.phy_mr = false; /* Fast MR - True, Regular Register False */
- mr->hw_mr.dma_mr = false;
-
- rc = ecore_rdma_register_tid(dev->rdma_ctx, &mr->hw_mr);
- if (rc) {
- QL_DPRINT11(ha, "roce register tid returned an error %d\n", rc);
- goto err2;
- }
-
- mr->ibmr.lkey = mr->hw_mr.itid << 8 | mr->hw_mr.key;
- if (mr->hw_mr.remote_write || mr->hw_mr.remote_read ||
- mr->hw_mr.remote_atomic)
- mr->ibmr.rkey = mr->hw_mr.itid << 8 | mr->hw_mr.key;
-
- QL_DPRINT12(ha, "lkey: %x\n", mr->ibmr.lkey);
-
- return (&mr->ibmr);
-
-err2:
- ecore_rdma_free_tid(dev->rdma_ctx, mr->hw_mr.itid);
-err1:
- qlnxr_free_pbl(dev, &mr->info.pbl_info, mr->info.pbl_table);
-err0:
- kfree(mr);
-
- QL_DPRINT12(ha, "exit [%d]\n", rc);
- return (ERR_PTR(rc));
-}
-
-#endif /* #if __FreeBSD_version >= 1102000 */
-
int
qlnxr_create_ah(struct ib_ah *ibah,
struct ib_ah_attr *attr, u32 flags,
@@ -6245,7 +5599,6 @@
return -ENOSYS;
}
-#if __FreeBSD_version >= 1102000
int
qlnxr_process_mad(struct ib_device *ibdev,
int process_mad_flags,
@@ -6257,19 +5610,6 @@
struct ib_mad_hdr *out_mad,
size_t *out_mad_size,
u16 *out_mad_pkey_index)
-
-#else
-
-int
-qlnxr_process_mad(struct ib_device *ibdev,
- int process_mad_flags,
- u8 port_num,
- struct ib_wc *in_wc,
- struct ib_grh *in_grh,
- struct ib_mad *in_mad,
- struct ib_mad *out_mad)
-
-#endif /* #if __FreeBSD_version >= 1102000 */
{
struct qlnxr_dev *dev;
qlnx_host_t *ha;
@@ -6288,7 +5628,6 @@
// return IB_MAD_RESULT_SUCCESS;
}
-#if __FreeBSD_version >= 1102000
int
qlnxr_get_port_immutable(struct ib_device *ibdev, u8 port_num,
struct ib_port_immutable *immutable)
@@ -6322,7 +5661,6 @@
QL_DPRINT12(ha, "exit\n");
return 0;
}
-#endif /* #if __FreeBSD_version > 1102000 */
/***** iWARP related functions *************/
@@ -6379,10 +5717,8 @@
event.private_data = (void *)params->cm_info->private_data;
event.private_data_len = (u8)params->cm_info->private_data_len;
-#if __FreeBSD_version >= 1100000
event.ord = params->cm_info->ord;
event.ird = params->cm_info->ird;
-#endif /* #if __FreeBSD_version >= 1100000 */
listener->cm_id->event_handler(listener->cm_id, &event);
@@ -6411,12 +5747,10 @@
event.event = event_type;
if (params->cm_info != NULL) {
-#if __FreeBSD_version >= 1100000
event.ird = params->cm_info->ird;
event.ord = params->cm_info->ord;
QL_DPRINT12(ha, "ord=[%d] \n", event.ord);
QL_DPRINT12(ha, "ird=[%d] \n", event.ird);
-#endif /* #if __FreeBSD_version >= 1100000 */
event.private_data_len = params->cm_info->private_data_len;
event.private_data = (void *)params->cm_info->private_data;
@@ -6467,8 +5801,6 @@
return;
}
-#if __FreeBSD_version >= 1102000
-
static void
qlnxr_iw_passive_complete(void *context,
struct ecore_iwarp_cm_event_params *params)
@@ -6579,8 +5911,6 @@
return;
}
-#endif /* #if __FreeBSD_version >= 1102000 */
-
static int
qlnxr_iw_mpa_reply(void *context,
struct ecore_iwarp_cm_event_params *params)
@@ -6660,18 +5990,8 @@
/* Passive side established ( ack on mpa response ) */
case ECORE_IWARP_EVENT_PASSIVE_COMPLETE:
-
-#if __FreeBSD_version >= 1102000
-
ep->during_connect = 0;
qlnxr_iw_passive_complete(context, params);
-
-#else
- qlnxr_iw_issue_event(context,
- params,
- IW_CM_EVENT_ESTABLISHED,
- "IW_CM_EVENT_ESTABLISHED");
-#endif /* #if __FreeBSD_version >= 1102000 */
break;
/* Active side reply received */
@@ -6690,16 +6010,7 @@
break;
case ECORE_IWARP_EVENT_DISCONNECT:
-
-#if __FreeBSD_version >= 1102000
qlnxr_iw_disconnect_event(context, params);
-#else
- qlnxr_iw_issue_event(context,
- params,
- IW_CM_EVENT_DISCONNECT,
- "IW_CM_EVENT_DISCONNECT");
- qlnxr_iw_close_event(context, params);
-#endif /* #if __FreeBSD_version >= 1102000 */
break;
case ECORE_IWARP_EVENT_CLOSE:
@@ -6771,15 +6082,8 @@
{
int rc;
-#if __FreeBSD_version >= 1100000
rc = arpresolve(dev->ha->ifp, 0, NULL, (struct sockaddr *)dst_in,
dst_mac, NULL, NULL);
-#else
- struct llentry *lle;
-
- rc = arpresolve(dev->ha->ifp, NULL, NULL, (struct sockaddr *)dst_in,
- dst_mac, &lle);
-#endif
QL_DPRINT12(dev->ha, "rc = %d "
"sa_len = 0x%x sa_family = 0x%x IP Address = %d.%d.%d.%d "
@@ -7045,8 +6349,6 @@
int
qlnxr_iw_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
{
-#if __FreeBSD_version >= 1102000
-
struct qlnxr_iw_ep *ep = (struct qlnxr_iw_ep *)cm_id->provider_data;
struct qlnxr_dev *dev = ep->dev;
struct ecore_iwarp_reject_in params;
@@ -7061,13 +6363,6 @@
rc = ecore_iwarp_reject(dev->rdma_ctx, ¶ms);
return rc;
-
-#else
-
- printf("iWARP reject_cr not implemented\n");
- return -EINVAL;
-
-#endif /* #if __FreeBSD_version >= 1102000 */
}
void
Index: sys/dev/qlxgb/qla_os.h
===================================================================
--- sys/dev/qlxgb/qla_os.h
+++ sys/dev/qlxgb/qla_os.h
@@ -51,8 +51,8 @@
#include <machine/atomic.h>
#include <sys/conf.h>
-#if __FreeBSD_version < 700112
-#error FreeBSD Version not supported - use version >= 700112
+#if __FreeBSD_version < 1203000
+#error FreeBSD Version not supported - use version >= 1203000
#endif
#include <net/if.h>
Index: sys/dev/qlxgb/qla_os.c
===================================================================
--- sys/dev/qlxgb/qla_os.c
+++ sys/dev/qlxgb/qla_os.c
@@ -688,11 +688,6 @@
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
ifp->if_capabilities |= IFCAP_LINKSTATE;
-#if defined(__FreeBSD_version) && (__FreeBSD_version < 900002)
- ifp->if_timer = 0;
- ifp->if_watchdog = NULL;
-#endif /* #if defined(__FreeBSD_version) && (__FreeBSD_version < 900002) */
-
ifp->if_capenable = ifp->if_capabilities;
ifp->if_hdrlen = sizeof(struct ether_vlan_header);
Index: sys/dev/qlxgbe/ql_hw.c
===================================================================
--- sys/dev/qlxgbe/ql_hw.c
+++ sys/dev/qlxgbe/ql_hw.c
@@ -2761,21 +2761,12 @@
bzero(lro, sizeof(struct lro_ctrl));
-#if (__FreeBSD_version >= 1100101)
if (tcp_lro_init_args(lro, ha->ifp, 0, NUM_RX_DESCRIPTORS)) {
device_printf(ha->pci_dev,
"%s: tcp_lro_init_args [%d] failed\n",
__func__, i);
return (-1);
}
-#else
- if (tcp_lro_init(lro)) {
- device_printf(ha->pci_dev,
- "%s: tcp_lro_init [%d] failed\n",
- __func__, i);
- return (-1);
- }
-#endif /* #if (__FreeBSD_version >= 1100101) */
lro->ifp = ha->ifp;
}
@@ -2796,17 +2787,7 @@
for (i = 0; i < hw->num_sds_rings; i++) {
lro = &hw->sds[i].lro;
-#if (__FreeBSD_version >= 1100101)
tcp_lro_flush_all(lro);
-#else
- struct lro_entry *queued;
-
- while ((!SLIST_EMPTY(&lro->lro_active))) {
- queued = SLIST_FIRST(&lro->lro_active);
- SLIST_REMOVE_HEAD(&lro->lro_active, next);
- tcp_lro_flush(lro, queued);
- }
-#endif /* #if (__FreeBSD_version >= 1100101) */
}
#endif
Index: sys/dev/qlxgbe/ql_isr.c
===================================================================
--- sys/dev/qlxgbe/ql_isr.c
+++ sys/dev/qlxgbe/ql_isr.c
@@ -165,33 +165,14 @@
mpf->m_pkthdr.flowid = sgc->rss_hash;
-#if __FreeBSD_version >= 1100000
M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH);
-#else
-#if (__FreeBSD_version >= 903511 && __FreeBSD_version < 1100000)
- M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE);
-#else
- M_HASHTYPE_SET(mpf, M_HASHTYPE_NONE);
-#endif
-#endif /* #if __FreeBSD_version >= 1100000 */
#if defined(INET) || defined(INET6)
- if (ha->hw.enable_soft_lro) {
-#if (__FreeBSD_version >= 1100101)
-
+ if (ha->hw.enable_soft_lro)
tcp_lro_queue_mbuf(lro, mpf);
-
-#else
- if (tcp_lro_rx(lro, mpf, 0))
- (*ifp->if_input)(ifp, mpf);
-
-#endif /* #if (__FreeBSD_version >= 1100101) */
-
- } else
+ else
#endif
- {
(*ifp->if_input)(ifp, mpf);
- }
if (sdsp->rx_free > ha->std_replenish)
qla_replenish_normal_rx(ha, sdsp, r_idx);
@@ -735,21 +716,7 @@
struct lro_ctrl *lro;
lro = &ha->hw.sds[sds_idx].lro;
-
-#if (__FreeBSD_version >= 1100101)
-
tcp_lro_flush_all(lro);
-
-#else
- struct lro_entry *queued;
-
- while ((!SLIST_EMPTY(&lro->lro_active))) {
- queued = SLIST_FIRST(&lro->lro_active);
- SLIST_REMOVE_HEAD(&lro->lro_active, next);
- tcp_lro_flush(lro, queued);
- }
-
-#endif /* #if (__FreeBSD_version >= 1100101) */
}
#endif
Index: sys/dev/qlxgbe/ql_os.h
===================================================================
--- sys/dev/qlxgbe/ql_os.h
+++ sys/dev/qlxgbe/ql_os.h
@@ -52,8 +52,8 @@
#include <machine/_inttypes.h>
#include <sys/conf.h>
-#if __FreeBSD_version < 900044
-#error FreeBSD Version not supported - use version >= 900044
+#if __FreeBSD_version < 1203000
+#error FreeBSD Version not supported - use version >= 1203000
#endif
#include <net/if.h>
Index: sys/dev/qlxgbe/ql_os.c
===================================================================
--- sys/dev/qlxgbe/ql_os.c
+++ sys/dev/qlxgbe/ql_os.c
@@ -1583,11 +1583,7 @@
QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
-#if __FreeBSD_version >= 1100000
if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE)
-#else
- if (mp->m_flags & M_FLOWID)
-#endif
rss_id = (mp->m_pkthdr.flowid & Q8_RSS_IND_TBL_MAX_IDX) %
ha->hw.num_sds_rings;
fp = &ha->tx_fp[rss_id];
Index: sys/dev/qlxge/qls_os.h
===================================================================
--- sys/dev/qlxge/qls_os.h
+++ sys/dev/qlxge/qls_os.h
@@ -52,8 +52,8 @@
#include <machine/_inttypes.h>
#include <sys/conf.h>
-#if __FreeBSD_version < 900044
-#error FreeBSD Version not supported - use version >= 900044
+#if __FreeBSD_version < 1203000
+#error FreeBSD Version not supported - use version >= 1203000
#endif
#include <net/if.h>
Index: sys/dev/rtsx/rtsxreg.h
===================================================================
--- sys/dev/rtsx/rtsxreg.h
+++ sys/dev/rtsx/rtsxreg.h
@@ -28,10 +28,6 @@
#ifndef _RTSXREG_H_
#define _RTSXREG_H_
-#if __FreeBSD_version < 1200000
-#define IO_SEND_OP_COND 5
-#endif
-
/* Host command buffer control register. */
#define RTSX_HCBAR 0x00
#define RTSX_HCBCTLR 0x04
Index: sys/dev/rtwn/if_rtwn_cam.c
===================================================================
--- sys/dev/rtwn/if_rtwn_cam.c
+++ sys/dev/rtwn/if_rtwn_cam.c
@@ -117,11 +117,7 @@
if (&vap->iv_nw_keys[0] <= k &&
k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) {
-#if __FreeBSD_version > 1200018
*keyix = ieee80211_crypto_get_key_wepidx(vap, k);
-#else
- *keyix = k - vap->iv_nw_keys;
-#endif
if (sc->sc_hwcrypto != RTWN_CRYPTO_FULL)
k->wk_flags |= IEEE80211_KEY_SWCRYPT;
else {
@@ -176,15 +172,9 @@
}
RTWN_UNLOCK(sc);
if (i == sc->cam_entry_limit) {
-#if __FreeBSD_version > 1200008
/* XXX check and remove keys with the same MAC address */
k->wk_flags |= IEEE80211_KEY_SWCRYPT;
*keyix = 0;
-#else
- device_printf(sc->sc_dev,
- "%s: no free space in the key table\n", __func__);
- return (0);
-#endif
}
end:
@@ -322,16 +312,7 @@
if (&vap->iv_nw_keys[0] <= k &&
k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) {
-#if __FreeBSD_version <= 1200008
- struct ieee80211_key *k1 = &vap->iv_nw_keys[k->wk_keyix];
-
- if (sc->sc_hwcrypto != RTWN_CRYPTO_FULL) {
- k1->wk_flags |= IEEE80211_KEY_SWCRYPT;
- return (k->wk_cipher->ic_setkey(k1));
- } else {
-#else
if (sc->sc_hwcrypto == RTWN_CRYPTO_FULL) {
-#endif
struct rtwn_vap *rvp = RTWN_VAP(vap);
RTWN_LOCK(sc);
Index: sys/dev/rtwn/rtl8188e/r88e_rx.c
===================================================================
--- sys/dev/rtwn/rtl8188e/r88e_rx.c
+++ sys/dev/rtwn/rtl8188e/r88e_rx.c
@@ -77,9 +77,7 @@
void
r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
{
-#if __FreeBSD_version >= 1200012
struct ieee80211_ratectl_tx_status txs;
-#endif
struct r88e_tx_rpt_ccx *rpt;
struct ieee80211_node *ni;
uint8_t macid;
@@ -120,7 +118,6 @@
(rpt->rptb1 & R88E_RPTB1_PKT_OK) ? "" : " not",
ntries);
-#if __FreeBSD_version >= 1200012
txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY |
IEEE80211_RATECTL_STATUS_FINAL_RATE;
txs.long_retries = ntries;
@@ -139,16 +136,6 @@
else
txs.status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED;
ieee80211_ratectl_tx_complete(ni, &txs);
-#else
- struct ieee80211vap *vap = ni->ni_vap;
- if (rpt->rptb1 & R88E_RPTB1_PKT_OK) {
- ieee80211_ratectl_tx_complete(vap, ni,
- IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL);
- } else {
- ieee80211_ratectl_tx_complete(vap, ni,
- IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL);
- }
-#endif
} else {
RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: macid %u, ni is NULL\n",
__func__, macid);
Index: sys/dev/rtwn/rtl8192c/r92c_fw.c
===================================================================
--- sys/dev/rtwn/rtl8192c/r92c_fw.c
+++ sys/dev/rtwn/rtl8192c/r92c_fw.c
@@ -364,9 +364,7 @@
static void
r92c_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
{
-#if __FreeBSD_version >= 1200012
struct ieee80211_ratectl_tx_status txs;
-#endif
struct r92c_c2h_tx_rpt *rpt;
struct ieee80211_node *ni;
uint8_t macid;
@@ -412,7 +410,6 @@
(rpt->rptb7 & R92C_RPTB7_PKT_OK) ? "" : " not",
ntries);
-#if __FreeBSD_version >= 1200012
txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY;
txs.long_retries = ntries;
if (rpt->rptb7 & R92C_RPTB7_PKT_OK)
@@ -424,16 +421,6 @@
else
txs.status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED;
ieee80211_ratectl_tx_complete(ni, &txs);
-#else
- struct ieee80211vap *vap = ni->ni_vap;
- if (rpt->rptb7 & R92C_RPTB7_PKT_OK) {
- ieee80211_ratectl_tx_complete(vap, ni,
- IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL);
- } else {
- ieee80211_ratectl_tx_complete(vap, ni,
- IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL);
- }
-#endif
} else {
RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: macid %u, ni is NULL\n",
__func__, macid);
Index: sys/dev/rtwn/rtl8812a/r12a_rx.c
===================================================================
--- sys/dev/rtwn/rtl8812a/r12a_rx.c
+++ sys/dev/rtwn/rtl8812a/r12a_rx.c
@@ -66,9 +66,7 @@
void
r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
{
-#if __FreeBSD_version >= 1200012
struct ieee80211_ratectl_tx_status txs;
-#endif
struct r12a_c2h_tx_rpt *rpt;
struct ieee80211_node *ni;
int ntries;
@@ -108,7 +106,6 @@
(rpt->txrptb0 & (R12A_TXRPTB0_RETRY_OVER |
R12A_TXRPTB0_LIFE_EXPIRE)) ? " not" : "", ntries);
-#if __FreeBSD_version >= 1200012
txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY |
IEEE80211_RATECTL_STATUS_FINAL_RATE;
txs.long_retries = ntries;
@@ -125,16 +122,6 @@
else
txs.status = IEEE80211_RATECTL_TX_SUCCESS;
ieee80211_ratectl_tx_complete(ni, &txs);
-#else
- struct ieee80211vap *vap = ni->ni_vap;
- if (rpt->txrptb0 & R12A_TXRPTB0_RETRY_OVER) {
- ieee80211_ratectl_tx_complete(vap, ni,
- IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL);
- } else {
- ieee80211_ratectl_tx_complete(vap, ni,
- IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL);
- }
-#endif
} else {
RTWN_DPRINTF(sc, RTWN_DEBUG_INTR,
"%s: macid %u, ni is NULL\n", __func__, rpt->macid);
Index: sys/dev/usb/controller/ehci_pci.c
===================================================================
--- sys/dev/usb/controller/ehci_pci.c
+++ sys/dev/usb/controller/ehci_pci.c
@@ -410,13 +410,8 @@
sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
}
-#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
-#else
- err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
- (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
-#endif
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->sc_intr_hdl = NULL;
Index: sys/dev/usb/controller/ohci_pci.c
===================================================================
--- sys/dev/usb/controller/ohci_pci.c
+++ sys/dev/usb/controller/ohci_pci.c
@@ -296,13 +296,8 @@
/* sc->sc_bus.usbrev; set by ohci_init() */
-#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
-#else
- err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
- (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
-#endif
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->sc_intr_hdl = NULL;
Index: sys/dev/usb/controller/uhci_pci.c
===================================================================
--- sys/dev/usb/controller/uhci_pci.c
+++ sys/dev/usb/controller/uhci_pci.c
@@ -349,13 +349,8 @@
break;
}
-#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
-#else
- err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
- (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
-#endif
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
Index: sys/dev/usb/input/wmt.c
===================================================================
--- sys/dev/usb/input/wmt.c
+++ sys/dev/usb/input/wmt.c
@@ -261,22 +261,12 @@
static device_attach_t wmt_attach;
static device_detach_t wmt_detach;
-#if __FreeBSD_version >= 1200077
static evdev_open_t wmt_ev_open;
static evdev_close_t wmt_ev_close;
-#else
-static evdev_open_t wmt_ev_open_11;
-static evdev_close_t wmt_ev_close_11;
-#endif
static const struct evdev_methods wmt_evdev_methods = {
-#if __FreeBSD_version >= 1200077
.ev_open = &wmt_ev_open,
.ev_close = &wmt_ev_close,
-#else
- .ev_open = &wmt_ev_open_11,
- .ev_close = &wmt_ev_close_11,
-#endif
};
static const struct usb_config wmt_config[WMT_N_TRANSFER] = {
@@ -719,7 +709,6 @@
return (0);
}
-#if __FreeBSD_version >= 1200077
static int
wmt_ev_close(struct evdev_dev *evdev)
{
@@ -738,7 +727,6 @@
return (wmt_ev_open_11(evdev, sc));
}
-#endif
static enum wmt_type
wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len)
Index: sys/dev/usb/usb_busdma.h
===================================================================
--- sys/dev/usb/usb_busdma.h
+++ sys/dev/usb/usb_busdma.h
@@ -40,11 +40,7 @@
#define USB_PAGE_SIZE PAGE_SIZE /* use system PAGE_SIZE */
-#if (__FreeBSD_version >= 700020)
#define USB_GET_DMA_TAG(dev) bus_get_dma_tag(dev)
-#else
-#define USB_GET_DMA_TAG(dev) NULL /* XXX */
-#endif
/* structure prototypes */
Index: sys/dev/usb/usb_dev.c
===================================================================
--- sys/dev/usb/usb_dev.c
+++ sys/dev/usb/usb_dev.c
@@ -96,12 +96,7 @@
&usb_fifo_debug, 0, "Debug Level");
#endif
-#if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \
- ((__FreeBSD_version >= 600034) && (__FreeBSD_version < 700000)))
#define USB_UCRED struct ucred *ucred,
-#else
-#define USB_UCRED
-#endif
/* prototypes */
Index: sys/dev/usb/usb_process.h
===================================================================
--- sys/dev/usb/usb_process.h
+++ sys/dev/usb/usb_process.h
@@ -57,11 +57,7 @@
struct cv up_cv;
struct cv up_drain;
-#if (__FreeBSD_version >= 800000)
struct thread *up_ptr;
-#else
- struct proc *up_ptr;
-#endif
struct thread *up_curtd;
struct mtx *up_mtx;
Index: sys/dev/usb/usb_process.c
===================================================================
--- sys/dev/usb/usb_process.c
+++ sys/dev/usb/usb_process.c
@@ -62,31 +62,14 @@
#include <sys/sched.h>
#endif /* USB_GLOBAL_INCLUDE_FILE */
-#if (__FreeBSD_version < 700000)
-#define thread_lock(td) mtx_lock_spin(&sched_lock)
-#define thread_unlock(td) mtx_unlock_spin(&sched_lock)
-#endif
-
-#if (__FreeBSD_version >= 800000)
static struct proc *usbproc;
static int usb_pcount;
#define USB_THREAD_CREATE(f, s, p, ...) \
kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \
0, "usb", __VA_ARGS__)
-#if (__FreeBSD_version >= 900000)
#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
-#else
-#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curthread)
-#endif
#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
#define USB_THREAD_EXIT(err) kthread_exit()
-#else
-#define USB_THREAD_CREATE(f, s, p, ...) \
- kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
-#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curproc)
-#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
-#define USB_THREAD_EXIT(err) kthread_exit(err)
-#endif
#ifdef USB_DEBUG
static int usb_proc_debug;
@@ -198,11 +181,9 @@
up->up_ptr = NULL;
cv_signal(&up->up_cv);
USB_MTX_UNLOCK(up->up_mtx);
-#if (__FreeBSD_version >= 800000)
/* Clear the proc pointer if this is the last thread. */
if (--usb_pcount == 0)
usbproc = NULL;
-#endif
USB_THREAD_EXIT(0);
}
@@ -238,9 +219,7 @@
up->up_ptr = NULL;
goto error;
}
-#if (__FreeBSD_version >= 800000)
usb_pcount++;
-#endif
return (0);
error:
Index: sys/fs/nfsserver/nfs_nfsdstate.c
===================================================================
--- sys/fs/nfsserver/nfs_nfsdstate.c
+++ sys/fs/nfsserver/nfs_nfsdstate.c
@@ -4989,9 +4989,7 @@
int i;
struct nfsvattr nva;
vnode_t vp;
-#if defined(__FreeBSD_version) && (__FreeBSD_version >= 500000)
mount_t mp = NULL;
-#endif
int error;
if (sf->nsf_fp == NULL || (sf->nsf_flags & NFSNSF_UPDATEDONE))
Index: sys/net/altq/altq_rmclass.c
===================================================================
--- sys/net/altq/altq_rmclass.c
+++ sys/net/altq/altq_rmclass.c
@@ -1448,13 +1448,8 @@
}
}
-#if (__FreeBSD_version > 300000)
-/* hzto() is removed from FreeBSD-3.0 */
-static int hzto(struct timeval *);
-
static int
-hzto(tv)
- struct timeval *tv;
+hzto(struct timeval *tv)
{
struct timeval t2;
@@ -1463,7 +1458,6 @@
t2.tv_usec = tv->tv_usec - t2.tv_usec;
return (tvtohz(&t2));
}
-#endif /* __FreeBSD_version > 300000 */
/*
* void
Index: sys/net/altq/altq_subr.c
===================================================================
--- sys/net/altq/altq_subr.c
+++ sys/net/altq/altq_subr.c
@@ -81,11 +81,7 @@
int (*altq_input)(struct mbuf *, int) = NULL;
static struct mbuf *tbr_dequeue(struct ifaltq *, int);
static int tbr_timer = 0; /* token bucket regulator timer */
-#if !defined(__FreeBSD__) || (__FreeBSD_version < 600000)
-static struct callout tbr_callout = CALLOUT_INITIALIZER;
-#else
static struct callout tbr_callout;
-#endif
#ifdef ALTQ3_CLFIER_COMPAT
static int extract_ports4(struct mbuf *, struct ip *, struct flowinfo_in *);
@@ -883,7 +879,6 @@
extern u_int64_t cpu_tsc_freq;
#endif
-#if (__FreeBSD_version >= 700035)
/* Update TSC freq with the value indicated by the caller. */
static void
tsc_freq_changed(void *arg, const struct cf_level *level, int status)
@@ -892,7 +887,7 @@
if (status != 0)
return;
-#if (__FreeBSD_version >= 701102) && (defined(__amd64__) || defined(__i386__))
+#if defined(__amd64__) || defined(__i386__)
/* If TSC is P-state invariant, don't do anything. */
if (tsc_is_invariant)
return;
@@ -903,7 +898,7 @@
}
EVENTHANDLER_DEFINE(cpufreq_post_change, tsc_freq_changed, NULL,
EVENTHANDLER_PRI_LAST);
-#endif /* __FreeBSD_version >= 700035 */
+#endif /* defined(__amd64__) || defined(__i386__) */
static void
init_machclk_setup(void)
Index: sys/net/altq/altq_var.h
===================================================================
--- sys/net/altq/altq_var.h
+++ sys/net/altq/altq_var.h
@@ -64,25 +64,16 @@
#endif
#define ACC_GET_HINDEX(handle) ((handle) >> 20)
-#if (__FreeBSD_version > 500000)
#define ACC_LOCK_INIT(ac) mtx_init(&(ac)->acc_mtx, "classifier", MTX_DEF)
#define ACC_LOCK_DESTROY(ac) mtx_destroy(&(ac)->acc_mtx)
#define ACC_LOCK(ac) mtx_lock(&(ac)->acc_mtx)
#define ACC_UNLOCK(ac) mtx_unlock(&(ac)->acc_mtx)
-#else
-#define ACC_LOCK_INIT(ac)
-#define ACC_LOCK_DESTROY(ac)
-#define ACC_LOCK(ac)
-#define ACC_UNLOCK(ac)
-#endif
struct acc_classifier {
u_int32_t acc_fbmask;
LIST_HEAD(filt, acc_filter) acc_filters[ACC_FILTER_TABLESIZE];
-#if (__FreeBSD_version > 500000)
struct mtx acc_mtx;
-#endif
};
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 3:19 AM (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14689003
Default Alt Text
D35560.id107271.diff (109 KB)
Attached To
Mode
D35560: sys: purge EOL release compatibility
Attached
Detach File
Event Timeline
Log In to Comment