PERFORCE change 119254 for review
John Baldwin
jhb at FreeBSD.org
Fri May 4 21:56:01 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119254
Change 119254 by jhb at jhb_mutex on 2007/05/04 21:55:16
IFC @119253.
Affected files ...
.. //depot/projects/smpng/sys/amd64/amd64/mptable_pci.c#8 integrate
.. //depot/projects/smpng/sys/amd64/amd64/msi.c#5 integrate
.. //depot/projects/smpng/sys/amd64/amd64/nexus.c#25 integrate
.. //depot/projects/smpng/sys/amd64/include/intr_machdep.h#15 integrate
.. //depot/projects/smpng/sys/amd64/pci/pci_bus.c#20 integrate
.. //depot/projects/smpng/sys/arm/xscale/i80321/ep80219_machdep.c#5 integrate
.. //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#24 integrate
.. //depot/projects/smpng/sys/arm/xscale/ixp425/avila_machdep.c#3 integrate
.. //depot/projects/smpng/sys/conf/files#205 integrate
.. //depot/projects/smpng/sys/conf/kern.pre.mk#55 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_pcib_acpi.c#25 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_pcib_pci.c#14 integrate
.. //depot/projects/smpng/sys/dev/em/LICENSE#5 integrate
.. //depot/projects/smpng/sys/dev/em/README#14 integrate
.. //depot/projects/smpng/sys/dev/em/e1000_80003es2lan.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_80003es2lan.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82540.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82541.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82541.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82542.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82543.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82543.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82571.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82571.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82575.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_82575.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_api.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_api.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_defines.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_hw.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_ich8lan.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_ich8lan.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_mac.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_mac.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_manage.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_manage.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_nvm.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_nvm.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_osdep.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_phy.c#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_phy.h#1 branch
.. //depot/projects/smpng/sys/dev/em/e1000_regs.h#1 branch
.. //depot/projects/smpng/sys/dev/em/if_em.c#81 integrate
.. //depot/projects/smpng/sys/dev/em/if_em.h#40 integrate
.. //depot/projects/smpng/sys/dev/em/if_em_hw.c#21 delete
.. //depot/projects/smpng/sys/dev/em/if_em_hw.h#21 delete
.. //depot/projects/smpng/sys/dev/em/if_em_osdep.h#20 delete
.. //depot/projects/smpng/sys/dev/gem/if_gem.c#31 integrate
.. //depot/projects/smpng/sys/dev/gem/if_gem_pci.c#21 integrate
.. //depot/projects/smpng/sys/dev/gem/if_gemvar.h#13 integrate
.. //depot/projects/smpng/sys/dev/ipmi/ipmi_smbios.c#3 integrate
.. //depot/projects/smpng/sys/dev/pci/pci.c#92 integrate
.. //depot/projects/smpng/sys/dev/pci/pci_if.m#9 integrate
.. //depot/projects/smpng/sys/dev/pci/pci_pci.c#34 integrate
.. //depot/projects/smpng/sys/dev/pci/pci_private.h#21 integrate
.. //depot/projects/smpng/sys/dev/pci/pcib_if.m#7 integrate
.. //depot/projects/smpng/sys/dev/pci/pcib_private.h#12 integrate
.. //depot/projects/smpng/sys/dev/pci/pcivar.h#27 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/emu10kx.c#6 integrate
.. //depot/projects/smpng/sys/i386/i386/mptable_pci.c#8 integrate
.. //depot/projects/smpng/sys/i386/i386/msi.c#5 integrate
.. //depot/projects/smpng/sys/i386/i386/nexus.c#27 integrate
.. //depot/projects/smpng/sys/i386/include/intr_machdep.h#17 integrate
.. //depot/projects/smpng/sys/i386/pci/pci_bus.c#33 integrate
.. //depot/projects/smpng/sys/kern/kern_descrip.c#107 integrate
.. //depot/projects/smpng/sys/kern/uipc_debug.c#2 integrate
.. //depot/projects/smpng/sys/kern/uipc_sockbuf.c#7 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket.c#104 integrate
.. //depot/projects/smpng/sys/kern/uipc_syscalls.c#104 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#129 integrate
.. //depot/projects/smpng/sys/modules/em/Makefile#6 integrate
.. //depot/projects/smpng/sys/net/ieee8023ad_lacp.c#4 integrate
.. //depot/projects/smpng/sys/net/if_lagg.c#3 integrate
.. //depot/projects/smpng/sys/net/if_lagg.h#2 integrate
.. //depot/projects/smpng/sys/netgraph/ng_mppc.c#13 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw.h#37 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw2.c#86 integrate
.. //depot/projects/smpng/sys/netinet/sctp_pcb.c#11 integrate
.. //depot/projects/smpng/sys/netinet/sctp_usrreq.c#12 integrate
.. //depot/projects/smpng/sys/netinet/sctputil.c#13 integrate
.. //depot/projects/smpng/sys/netinet/tcp_input.c#104 integrate
.. //depot/projects/smpng/sys/netinet6/nd6.c#40 integrate
.. //depot/projects/smpng/sys/netinet6/nd6_nbr.c#24 integrate
.. //depot/projects/smpng/sys/sys/filedesc.h#31 integrate
.. //depot/projects/smpng/sys/sys/socketvar.h#57 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_softdep.c#64 integrate
Differences ...
==== //depot/projects/smpng/sys/amd64/amd64/mptable_pci.c#8 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.7 2007/01/22 21:48:42 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.8 2007/05/02 17:50:34 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,7 +72,7 @@
return (bus_generic_attach(dev));
}
-/* Pass MSI alloc requests up to the nexus. */
+/* Pass MSI requests up to the nexus. */
static int
mptable_hostb_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
int *irqs)
@@ -85,12 +85,22 @@
}
static int
-mptable_hostb_alloc_msix(device_t pcib, device_t dev, int index, int *irq)
+mptable_hostb_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+mptable_hostb_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
{
device_t bus;
bus = device_get_parent(pcib);
- return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, index, irq));
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
}
static device_method_t mptable_hostb_methods[] = {
@@ -120,8 +130,8 @@
DEVMETHOD(pcib_alloc_msi, mptable_hostb_alloc_msi),
DEVMETHOD(pcib_release_msi, pcib_release_msi),
DEVMETHOD(pcib_alloc_msix, mptable_hostb_alloc_msix),
- DEVMETHOD(pcib_remap_msix, pcib_remap_msix),
DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, mptable_hostb_map_msi),
{ 0, 0 }
};
@@ -177,8 +187,8 @@
DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
DEVMETHOD(pcib_release_msi, pcib_release_msi),
DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
- DEVMETHOD(pcib_remap_msix, pcib_remap_msix),
DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
{0, 0}
};
==== //depot/projects/smpng/sys/amd64/amd64/msi.c#5 (text+ko) ====
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/msi.c,v 1.4 2007/02/15 22:22:56 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/msi.c,v 1.5 2007/05/02 17:50:34 jhb Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -99,21 +99,20 @@
* assigned an ID by the system; however, a group will use the ID from
* the first message.
*
- * For MSI-X, each message is isolated, and msi_index indicates the
- * index of this message in the device's MSI-X table.
+ * For MSI-X, each message is isolated.
*/
struct msi_intsrc {
struct intsrc msi_intsrc;
device_t msi_dev; /* Owning device. (g) */
struct msi_intsrc *msi_first; /* First source in group. */
u_int msi_irq; /* IRQ cookie. */
- u_int msi_index; /* Index of this message. */
u_int msi_msix; /* MSI-X message. */
u_int msi_vector:8; /* IDT vector. */
u_int msi_cpu:8; /* Local APIC ID. (g) */
u_int msi_count:8; /* Messages in this group. (g) */
};
+static struct msi_intsrc *msi_create_source(u_int irq);
static void msi_enable_source(struct intsrc *isrc);
static void msi_disable_source(struct intsrc *isrc, int eoi);
static void msi_eoi_source(struct intsrc *isrc);
@@ -123,16 +122,10 @@
static int msi_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
static void msi_assign_cpu(struct intsrc *isrc, u_int apic_id);
-static void msix_enable_intr(struct intsrc *isrc);
-static int msix_source_pending(struct intsrc *isrc);
-static void msix_assign_cpu(struct intsrc *isrc, u_int apic_id);
struct pic msi_pic = { msi_enable_source, msi_disable_source, msi_eoi_source,
msi_enable_intr, msi_vector, msi_source_pending,
NULL, NULL, msi_config_intr, msi_assign_cpu };
-struct pic msix_pic = { msi_enable_source, msi_disable_source, msi_eoi_source,
- msix_enable_intr, msi_vector, msix_source_pending,
- NULL, NULL, msi_config_intr, msix_assign_cpu };
static int msi_enabled;
static struct sx msi_sx;
@@ -162,17 +155,6 @@
{
struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
- /*
- * Since we can only enable the entire group at once, go ahead and
- * enable the messages when the first message is given a handler.
- * Note that we assume all devices will register a handler for the
- * first message.
- */
- if (msi->msi_index == 0) {
- mtx_lock_spin(&icu_lock);
- pci_enable_msi(msi->msi_dev, INTEL_ADDR(msi), INTEL_DATA(msi));
- mtx_unlock_spin(&icu_lock);
- }
apic_enable_vector(msi->msi_vector);
}
@@ -206,51 +188,13 @@
msi->msi_cpu = apic_id;
if (bootverbose)
- printf("msi: Assigning MSI IRQ %d to local APIC %u\n",
- msi->msi_irq, msi->msi_cpu);
- mtx_lock_spin(&icu_lock);
+ printf("msi: Assigning %s IRQ %d to local APIC %u\n",
+ msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq,
+ msi->msi_cpu);
if (isrc->is_enabled)
- pci_enable_msi(msi->msi_dev, INTEL_ADDR(msi), INTEL_DATA(msi));
- mtx_unlock_spin(&icu_lock);
+ pci_remap_msi_irq(msi->msi_dev, msi->msi_irq);
}
-static void
-msix_enable_intr(struct intsrc *isrc)
-{
- struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
-
- mtx_lock_spin(&icu_lock);
- pci_enable_msix(msi->msi_dev, msi->msi_index, INTEL_ADDR(msi),
- INTEL_DATA(msi));
- pci_unmask_msix(msi->msi_dev, msi->msi_index);
- mtx_unlock_spin(&icu_lock);
- apic_enable_vector(msi->msi_vector);
-}
-
-static int
-msix_source_pending(struct intsrc *isrc)
-{
- struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
-
- return (pci_pending_msix(msi->msi_dev, msi->msi_index));
-}
-
-static void
-msix_assign_cpu(struct intsrc *isrc, u_int apic_id)
-{
- struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
-
- msi->msi_cpu = apic_id;
- if (bootverbose)
- printf("msi: Assigning MSI-X IRQ %d to local APIC %u\n",
- msi->msi_irq, msi->msi_cpu);
- mtx_lock_spin(&icu_lock);
- if (isrc->is_enabled)
- pci_enable_msix(msi->msi_dev, msi->msi_index, INTEL_ADDR(msi),
- INTEL_DATA(msi));
- mtx_unlock_spin(&icu_lock);
-}
-
void
msi_init(void)
{
@@ -262,10 +206,21 @@
msi_enabled = 1;
intr_register_pic(&msi_pic);
- intr_register_pic(&msix_pic);
sx_init(&msi_sx, "msi");
}
+struct msi_intsrc *
+msi_create_source(u_int irq)
+{
+ struct msi_intsrc *msi;
+
+ msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO);
+ msi->msi_intsrc.is_pic = &msi_pic;
+ msi->msi_irq = irq;
+ intr_register_source(&msi->msi_intsrc);
+ return (msi);
+}
+
/*
* Try to allocate 'count' interrupt sources with contiguous IDT values. If
* we allocate any new sources, then their IRQ values will be at the end of
@@ -317,14 +272,8 @@
*newcount = count - cnt;
for (j = 0; j < *newcount; j++) {
- /* Create a new MSI source. */
- msi = malloc(sizeof(struct msi_intsrc), M_MSI,
- M_WAITOK | M_ZERO);
- msi->msi_intsrc.is_pic = &msi_pic;
- msi->msi_irq = i + j;
- intr_register_source(&msi->msi_intsrc);
-
- /* Add it to our array. */
+ /* Create a new MSI source and add it to our array. */
+ msi_create_source(i + j);
irqs[cnt] = i + j;
cnt++;
}
@@ -344,13 +293,11 @@
fsrc = (struct msi_intsrc *)intr_lookup_source(irqs[0]);
for (i = 0; i < count; i++) {
msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]);
- msi->msi_intsrc.is_pic = &msi_pic;
msi->msi_dev = dev;
msi->msi_vector = vector + i;
if (bootverbose)
printf("msi: routing MSI IRQ %d to vector %u\n",
msi->msi_irq, msi->msi_vector);
- msi->msi_index = i;
msi->msi_first = fsrc;
/* XXX: Somewhat gross. */
@@ -395,8 +342,6 @@
sx_xunlock(&msi_sx);
return (EINVAL);
}
- KASSERT(first->msi_index == 0, ("index mismatch"));
-
KASSERT(first->msi_dev != NULL, ("unowned group"));
/* Clear all the extra messages in the group. */
@@ -408,7 +353,6 @@
msi->msi_dev = NULL;
apic_free_vector(msi->msi_vector, msi->msi_irq);
msi->msi_vector = 0;
- msi->msi_index = 0;
}
/* Clear out the first message. */
@@ -423,7 +367,44 @@
}
int
-msix_alloc(device_t dev, int index, int *irq, int *new)
+msi_map(int irq, uint64_t *addr, uint32_t *data)
+{
+ struct msi_intsrc *msi;
+
+ sx_slock(&msi_sx);
+ msi = (struct msi_intsrc *)intr_lookup_source(irq);
+ if (msi == NULL) {
+ sx_sunlock(&msi_sx);
+ return (ENOENT);
+ }
+
+ /* Make sure this message is allocated to a device. */
+ if (msi->msi_dev == NULL) {
+ sx_sunlock(&msi_sx);
+ return (ENXIO);
+ }
+
+ /*
+ * If this message isn't an MSI-X message, make sure it's part
+ * of a gruop, and switch to the first message in the
+ * group.
+ */
+ if (!msi->msi_msix) {
+ if (msi->msi_first == NULL) {
+ sx_sunlock(&msi_sx);
+ return (ENXIO);
+ }
+ msi = msi->msi_first;
+ }
+
+ *addr = INTEL_ADDR(msi);
+ *data = INTEL_DATA(msi);
+ sx_sunlock(&msi_sx);
+ return (0);
+}
+
+int
+msix_alloc(device_t dev, int *irq, int *new)
{
struct msi_intsrc *msi;
int i, vector;
@@ -457,11 +438,7 @@
/* Create a new source. */
*new = 1;
- msi = malloc(sizeof(struct msi_intsrc), M_MSI,
- M_WAITOK | M_ZERO);
- msi->msi_intsrc.is_pic = &msix_pic;
- msi->msi_irq = i;
- intr_register_source(&msi->msi_intsrc);
+ msi = msi_create_source(i);
}
/* Allocate an IDT vector. */
@@ -471,10 +448,8 @@
vector);
/* Setup source. */
- msi->msi_intsrc.is_pic = &msix_pic;
msi->msi_dev = dev;
msi->msi_vector = vector;
- msi->msi_index = index;
msi->msi_msix = 1;
/* XXX: Somewhat gross. */
@@ -486,30 +461,6 @@
}
int
-msix_remap(int index, int irq)
-{
- struct msi_intsrc *msi;
-
- sx_xlock(&msi_sx);
- msi = (struct msi_intsrc *)intr_lookup_source(irq);
- if (msi == NULL) {
- sx_xunlock(&msi_sx);
- return (ENOENT);
- }
-
- /* Make sure this is an MSI-X message. */
- if (!msi->msi_msix) {
- sx_xunlock(&msi_sx);
- return (EINVAL);
- }
-
- KASSERT(msi->msi_dev != NULL, ("unowned message"));
- msi->msi_index = index;
- sx_xunlock(&msi_sx);
- return (0);
-}
-
-int
msix_release(int irq)
{
struct msi_intsrc *msi;
@@ -533,7 +484,6 @@
msi->msi_dev = NULL;
apic_free_vector(msi->msi_vector, msi->msi_irq);
msi->msi_vector = 0;
- msi->msi_index = 0;
msi->msi_msix = 0;
sx_xunlock(&msi_sx);
==== //depot/projects/smpng/sys/amd64/amd64/nexus.c#25 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.75 2007/03/21 15:36:38 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.76 2007/05/02 17:50:34 jhb Exp $");
/*
* This code implements a `root nexus' for Intel Architecture
@@ -108,9 +108,9 @@
static void nexus_delete_resource(device_t, device_t, int, int);
static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs);
static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs);
-static int nexus_alloc_msix(device_t pcib, device_t dev, int index, int *irq);
-static int nexus_remap_msix(device_t pcib, device_t dev, int index, int irq);
+static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq);
static int nexus_release_msix(device_t pcib, device_t dev, int irq);
+static int nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data);
static device_method_t nexus_methods[] = {
/* Device interface */
@@ -140,8 +140,8 @@
DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi),
DEVMETHOD(pcib_release_msi, nexus_release_msi),
DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix),
- DEVMETHOD(pcib_remap_msix, nexus_remap_msix),
DEVMETHOD(pcib_release_msix, nexus_release_msix),
+ DEVMETHOD(pcib_map_msi, nexus_map_msi),
{ 0, 0 }
};
@@ -504,24 +504,17 @@
}
static int
-nexus_alloc_msix(device_t pcib, device_t dev, int index, int *irq)
+nexus_alloc_msix(device_t pcib, device_t dev, int *irq)
{
int error, new;
- error = msix_alloc(dev, index, irq, &new);
+ error = msix_alloc(dev, irq, &new);
if (new)
rman_manage_region(&irq_rman, *irq, *irq);
return (error);
}
static int
-nexus_remap_msix(device_t pcib, device_t dev, int index, int irq)
-{
-
- return (msix_remap(index, irq));
-}
-
-static int
nexus_release_msix(device_t pcib, device_t dev, int irq)
{
@@ -551,6 +544,13 @@
return (msi_release(irqs, count));
}
+static int
+nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data)
+{
+
+ return (msi_map(irq, addr, data));
+}
+
/* Placeholder for system RAM. */
static void
ram_identify(driver_t *driver, device_t parent)
==== //depot/projects/smpng/sys/amd64/include/intr_machdep.h#15 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.16 2007/03/06 17:16:46 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.17 2007/05/02 17:50:34 jhb Exp $
*/
#ifndef __MACHINE_INTR_MACHDEP_H__
@@ -149,9 +149,9 @@
int msi_alloc(device_t dev, int count, int maxcount, int *irqs, int *newirq,
int *newcount);
void msi_init(void);
+int msi_map(int irq, uint64_t *addr, uint32_t *data);
int msi_release(int *irqs, int count);
-int msix_alloc(device_t dev, int index, int *irq, int *new);
-int msix_remap(int index, int irq);
+int msix_alloc(device_t dev, int *irq, int *new);
int msix_release(int irq);
#endif /* !LOCORE */
==== //depot/projects/smpng/sys/amd64/pci/pci_bus.c#20 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.120 2007/01/22 21:48:42 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.121 2007/05/02 17:50:34 jhb Exp $");
#include "opt_cpu.h"
@@ -81,7 +81,7 @@
return (PCI_INVALID_IRQ);
}
-/* Pass MSI alloc requests up to the nexus. */
+/* Pass MSI requests up to the nexus. */
static int
legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
@@ -95,12 +95,22 @@
}
static int
-legacy_pcib_alloc_msix(device_t pcib, device_t dev, int index, int *irq)
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
{
device_t bus;
bus = device_get_parent(pcib);
- return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, index, irq));
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
}
static const char *
@@ -347,8 +357,8 @@
DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
DEVMETHOD(pcib_release_msi, pcib_release_msi),
DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
- DEVMETHOD(pcib_remap_msix, pcib_remap_msix),
DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
{ 0, 0 }
};
==== //depot/projects/smpng/sys/arm/xscale/i80321/ep80219_machdep.c#5 (text+ko) ====
@@ -49,7 +49,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.5 2006/12/06 06:34:54 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.6 2007/05/03 09:51:12 kevlo Exp $");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
@@ -125,8 +125,6 @@
extern void *_end;
-extern vm_offset_t sa1_cache_clean_addr;
-
extern int *end;
struct pcpu __pcpu;
==== //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#24 (text+ko) ====
@@ -49,7 +49,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.26 2006/12/06 06:34:54 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.27 2007/05/03 09:51:12 kevlo Exp $");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
@@ -125,8 +125,6 @@
extern void *_end;
-extern vm_offset_t sa1_cache_clean_addr;
-
extern int *end;
struct pcpu __pcpu;
==== //depot/projects/smpng/sys/arm/xscale/ixp425/avila_machdep.c#3 (text+ko) ====
@@ -49,7 +49,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.3 2007/02/02 05:14:21 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.4 2007/05/03 09:51:12 kevlo Exp $");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
@@ -124,8 +124,6 @@
extern void *_end;
-extern vm_offset_t sa1_cache_clean_addr;
-
extern int *end;
struct pcpu __pcpu;
==== //depot/projects/smpng/sys/conf/files#205 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1198 2007/04/25 15:30:17 mav Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1201 2007/05/04 13:29:45 rwatson Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -600,8 +600,34 @@
dev/ed/if_ed_pci.c optional ed pci
dev/eisa/eisa_if.m standard
dev/eisa/eisaconf.c optional eisa
-dev/em/if_em.c optional em
-dev/em/if_em_hw.c optional em
+dev/em/if_em.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_80003es2lan.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_82540.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_82541.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_82542.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_82543.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_82571.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_82575.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_api.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_ich8lan.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_mac.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_manage.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_nvm.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
+dev/em/e1000_phy.c optional em \
+ compile-with "${NORMAL_C} -I$S/dev/em"
dev/en/if_en_pci.c optional en pci
dev/en/midway.c optional en
dev/ep/if_ep.c optional ep
==== //depot/projects/smpng/sys/conf/kern.pre.mk#55 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.81 2006/10/26 15:16:43 bde Exp $
+# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.82 2007/05/04 00:00:10 jfv Exp $
# Part of a unified Makefile for building kernels. This part contains all
# of the definitions that need to be before %BEFORE_DEPEND.
@@ -76,6 +76,9 @@
# .. and the same for twa
INCLUDES+= -I$S/dev/twa
+# .. and the same for em
+INCLUDES+= -I$S/dev/em
+
# ... and XFS
INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs
==== //depot/projects/smpng/sys/dev/acpica/acpi_pcib_acpi.c#25 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.53 2007/01/22 21:48:43 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.54 2007/05/02 17:50:35 jhb Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -76,8 +76,10 @@
device_t dev, int pin);
static int acpi_pcib_alloc_msi(device_t pcib, device_t dev,
int count, int maxcount, int *irqs);
+static int acpi_pcib_map_msi(device_t pcib, device_t dev,
+ int irq, uint64_t *addr, uint32_t *data);
static int acpi_pcib_alloc_msix(device_t pcib, device_t dev,
- int index, int *irq);
+ int *irq);
static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev,
device_t child, int type, int *rid,
u_long start, u_long end, u_long count,
@@ -110,8 +112,8 @@
DEVMETHOD(pcib_alloc_msi, acpi_pcib_alloc_msi),
DEVMETHOD(pcib_release_msi, pcib_release_msi),
DEVMETHOD(pcib_alloc_msix, acpi_pcib_alloc_msix),
- DEVMETHOD(pcib_remap_msix, pcib_remap_msix),
DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, acpi_pcib_map_msi),
{0, 0}
};
@@ -323,12 +325,22 @@
}
static int
-acpi_pcib_alloc_msix(device_t pcib, device_t dev, int index, int *irq)
+acpi_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+acpi_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
{
device_t bus;
bus = device_get_parent(pcib);
- return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, index, irq));
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
}
static u_long acpi_host_mem_start = 0x80000000;
==== //depot/projects/smpng/sys/dev/acpica/acpi_pcib_pci.c#14 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.16 2007/01/22 21:48:43 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.17 2007/05/02 17:50:35 jhb Exp $");
#include "opt_acpi.h"
@@ -96,8 +96,8 @@
DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
DEVMETHOD(pcib_release_msi, pcib_release_msi),
DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
- DEVMETHOD(pcib_remap_msix, pcib_remap_msix),
DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
{0, 0}
};
==== //depot/projects/smpng/sys/dev/em/LICENSE#5 (text+ko) ====
@@ -1,31 +1,31 @@
-$FreeBSD: src/sys/dev/em/LICENSE,v 1.5 2006/04/07 10:18:24 glebius Exp $
-/*-
-Copyright (c) 2001-2005, Intel Corporation
-All rights reserved.
+$FreeBSD: src/sys/dev/em/LICENSE,v 1.6 2007/05/04 00:00:11 jfv Exp $
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+ Copyright (c) 2001-2007, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of the Intel Corporation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-*/
==== //depot/projects/smpng/sys/dev/em/README#14 (text+ko) ====
@@ -1,8 +1,8 @@
-$FreeBSD: src/sys/dev/em/README,v 1.13 2006/08/03 09:20:11 glebius Exp $
-FreeBSD* Driver for the Intel(R) PRO/1000 Family of Adapters
+$FreeBSD: src/sys/dev/em/README,v 1.14 2007/05/04 00:00:11 jfv Exp $
+FreeBSD Driver for the Gigabit Family of Adapters
============================================================
-May 2, 2006
+April 18, 2007
Contents
@@ -21,11 +21,11 @@
Overview
========
-This file describes the FreeBSD* driver for the Intel(R) PRO/1000 Family of
+This file describes the FreeBSD* driver for the Gigabit Family of
Adapters. This driver has been developed for use with FreeBSD, Release 6.x.
For questions related to hardware requirements, refer to the documentation
-supplied with your Intel PRO/1000 adapter. All hardware requirements listed
+supplied with your Gigabit adapter. All hardware requirements listed
apply to use with FreeBSD.
@@ -62,7 +62,7 @@
2. Untar/unzip the archive:
- tar xvfz em-x.x.x.tar.gz
+ tar xzvf em-x.x.x.tar.gz
This will create an em-x.x.x directory.
@@ -74,7 +74,7 @@
cd em-x.x.x
make
- b. To install the compiled module in system directory:
+ b. To install the compiled module to the system directory:
make install
@@ -84,35 +84,26 @@
if_em_load="YES"
-4. To compile the driver into the kernel:
+4. To compile the driver into the kernel, enter:
cd em-x.x.x/src
-
- cp if_em* /usr/src/sys/dev/em
-
+ cp *.[ch] /usr/src/sys/dev/em
cp Makefile.kernel /usr/src/sys/modules/em/Makefile
- Edit the /usr/src/sys/conf/files file, and add the following lines only if
- they don't already exist:
+ NOTE: At this point you MUST install a patch, kernbuild.patch, which is
+ located in the patches directory. This is applied as shown below where
+ "$PATH_TO_KERNBUILD_PATCH" is the location of the kernbuild.patch:
- dev/em/if_em.c optional em
+ cd /usr/src/sys; patch -p1 < $PATH_TO_KERNBUILD_PATCH
- dev/em/if_em_hw.c optional em
+ Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in
+ /usr/src/sys/i386/conf, and ensure the following line is present:
- Remove the following lines from the /usr/src/sys/conf/files file,
- if they exist:
-
- dev/em/if_em_fxhw.c optional em
- dev/em/if_em_phy.c optional em
-
- Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in
- /usr/src/sys/i386/conf, and ensure the following line is present:
-
device em
- Compile and install the kernel. The system must be rebooted for the kernel
- updates to take effect. For additional information on compiling the
- kernel, consult the FreeBSD operating system documentation.
+ Compile and install the kernel. The system must be rebooted for the
+ kernel updates to take effect. For additional information on compiling
+ the kernel, consult the FreeBSD operating system documentation.
5. To assign an IP address to the interface, enter the following:
@@ -150,6 +141,12 @@
not specified and you are not running at gigabit speed, the driver
defaults to half-duplex.
+If the interface is currently forced to 100 full duplex, in order to change
+to half duplex you must use this command:
+
+ ifconfig em<interface_num> <IP_address> media 100baseTX -mediaopt
+ full-duplex
+
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list