PERFORCE change 112380 for review
Matt Jacob
mjacob at FreeBSD.org
Sun Dec 31 16:32:24 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=112380
Change 112380 by mjacob at mjexp_6 on 2007/01/01 00:32:00
Integrate from releng_6 vendor branch.
Affected files ...
.. //depot/projects/mjexp_6/sys/amd64/amd64/mptable_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/amd64/pci/pci_bus.c#2 integrate
.. //depot/projects/mjexp_6/sys/cam/cam.c#2 integrate
.. //depot/projects/mjexp_6/sys/cam/cam_xpt.c#2 integrate
.. //depot/projects/mjexp_6/sys/cam/scsi/scsi_da.c#2 integrate
.. //depot/projects/mjexp_6/sys/conf/NOTES#3 integrate
.. //depot/projects/mjexp_6/sys/conf/files#3 integrate
.. //depot/projects/mjexp_6/sys/conf/files.arm#2 integrate
.. //depot/projects/mjexp_6/sys/dev/acpica/acpi_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/acpica/acpi_pcib_acpi.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/acpica/acpi_pcib_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/ath/if_ath_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/bge/if_bge.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/bge/if_bgereg.h#2 integrate
.. //depot/projects/mjexp_6/sys/dev/cardbus/cardbus.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/drm/drm_agpsupport.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/pci/pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/pci/pci_if.m#2 integrate
.. //depot/projects/mjexp_6/sys/dev/pci/pci_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/pci/pci_private.h#2 integrate
.. //depot/projects/mjexp_6/sys/dev/pci/pcib_private.h#2 integrate
.. //depot/projects/mjexp_6/sys/dev/pci/pcivar.h#2 integrate
.. //depot/projects/mjexp_6/sys/dev/ral/if_ral.c#2 delete
.. //depot/projects/mjexp_6/sys/dev/ral/if_ral_pccard.c#2 delete
.. //depot/projects/mjexp_6/sys/dev/ral/if_ral_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/ral/if_ralreg.h#2 delete
.. //depot/projects/mjexp_6/sys/dev/ral/if_ralvar.h#2 delete
.. //depot/projects/mjexp_6/sys/dev/ral/rt2560.c#1 branch
.. //depot/projects/mjexp_6/sys/dev/ral/rt2560reg.h#1 branch
.. //depot/projects/mjexp_6/sys/dev/ral/rt2560var.h#1 branch
.. //depot/projects/mjexp_6/sys/dev/ral/rt2661.c#1 branch
.. //depot/projects/mjexp_6/sys/dev/ral/rt2661_ucode.h#1 branch
.. //depot/projects/mjexp_6/sys/dev/ral/rt2661reg.h#1 branch
.. //depot/projects/mjexp_6/sys/dev/ral/rt2661var.h#1 branch
.. //depot/projects/mjexp_6/sys/dev/sound/pci/ich.c#2 integrate
.. //depot/projects/mjexp_6/sys/dev/usb/uark.c#1 branch
.. //depot/projects/mjexp_6/sys/dev/usb/usbdevs#2 integrate
.. //depot/projects/mjexp_6/sys/fs/msdosfs/msdosfs_conv.c#2 integrate
.. //depot/projects/mjexp_6/sys/fs/msdosfs/msdosfs_vnops.c#2 integrate
.. //depot/projects/mjexp_6/sys/fs/udf/udf_vnops.c#2 integrate
.. //depot/projects/mjexp_6/sys/gnu/fs/ext2fs/ext2_vfsops.c#2 integrate
.. //depot/projects/mjexp_6/sys/i386/i386/mptable_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/i386/pci/pci_bus.c#2 integrate
.. //depot/projects/mjexp_6/sys/kern/link_elf_obj.c#2 integrate
.. //depot/projects/mjexp_6/sys/kern/subr_bus.c#2 integrate
.. //depot/projects/mjexp_6/sys/kern/tty.c#2 integrate
.. //depot/projects/mjexp_6/sys/modules/Makefile#2 integrate
.. //depot/projects/mjexp_6/sys/modules/ral/Makefile#2 integrate
.. //depot/projects/mjexp_6/sys/modules/uark/Makefile#1 branch
.. //depot/projects/mjexp_6/sys/net/ethernet.h#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/in_pcb.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/in_pcb.h#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/ip_divert.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/raw_ip.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/tcp_subr.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/tcp_usrreq.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet/udp_usrreq.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet6/in6_pcb.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet6/raw_ip6.c#2 integrate
.. //depot/projects/mjexp_6/sys/netinet6/udp6_usrreq.c#2 integrate
.. //depot/projects/mjexp_6/sys/nfsclient/bootp_subr.c#2 integrate
.. //depot/projects/mjexp_6/sys/pci/agp.c#2 integrate
.. //depot/projects/mjexp_6/sys/pci/agp_i810.c#2 integrate
.. //depot/projects/mjexp_6/sys/pci/agpreg.h#2 integrate
.. //depot/projects/mjexp_6/sys/pci/if_rl.c#2 integrate
.. //depot/projects/mjexp_6/sys/powerpc/ofw/ofw_pcib_pci.c#2 integrate
.. //depot/projects/mjexp_6/sys/sparc64/pci/apb.c#2 integrate
.. //depot/projects/mjexp_6/sys/sparc64/pci/ofw_pcib.c#2 integrate
.. //depot/projects/mjexp_6/sys/sparc64/pci/ofw_pcibus.c#2 integrate
.. //depot/projects/mjexp_6/sys/sys/copyright.h#2 integrate
.. //depot/projects/mjexp_6/sys/sys/param.h#2 integrate
Differences ...
==== //depot/projects/mjexp_6/sys/amd64/amd64/mptable_pci.c#2 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.2.8.1 2005/09/18 02:55:09 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.2.8.2 2006/12/28 22:09:46 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -100,13 +100,10 @@
{ 0, 0 }
};
-static driver_t mptable_hostb_driver = {
- "pcib",
- mptable_hostb_methods,
- 1,
-};
+static devclass_t hostb_devclass;
-DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, pcib_devclass, 0, 0);
+DEFINE_CLASS_0(pcib, mptable_hostb_driver, mptable_hostb_methods, 1);
+DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, hostb_devclass, 0, 0);
/* PCI to PCI bridge driver. */
@@ -155,11 +152,9 @@
{0, 0}
};
-static driver_t mptable_pcib_driver = {
- "pcib",
- mptable_pcib_pci_methods,
- sizeof(struct pcib_softc),
-};
+static devclass_t pcib_devclass;
+DEFINE_CLASS_0(pcib, mptable_pcib_driver, mptable_pcib_pci_methods,
+ sizeof(struct pcib_softc));
DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0);
==== //depot/projects/mjexp_6/sys/amd64/pci/pci_bus.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.113.2.1 2005/09/18 02:55:10 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.113.2.2 2006/12/28 22:09:46 jhb Exp $");
#include "opt_cpu.h"
@@ -326,12 +326,9 @@
{ 0, 0 }
};
-static driver_t legacy_pcib_driver = {
- "pcib",
- legacy_pcib_methods,
- 1,
-};
+static devclass_t pcib_devclass;
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, pcib_devclass, 0, 0);
@@ -435,12 +432,7 @@
{ 0, 0 }
};
-static driver_t pcibus_pnp_driver = {
- "pcibus_pnp",
- pcibus_pnp_methods,
- 1, /* no softc */
-};
-
static devclass_t pcibus_pnp_devclass;
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
==== //depot/projects/mjexp_6/sys/cam/cam.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam.c,v 1.9 2005/01/05 22:34:34 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam.c,v 1.9.2.1 2006/12/21 19:51:53 mjacob Exp $");
#include <sys/param.h>
#ifdef _KERNEL
@@ -373,7 +373,16 @@
{
uint32_t size_mb, secs_per_cylinder;
- size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size);
+ if (ccg->block_size == 0) {
+ ccg->ccb_h.status = CAM_REQ_CMP_ERR;
+ return;
+ }
+ size_mb = (1024L * 1024L) / ccg->block_size;
+ if (size_mb == 0) {
+ ccg->ccb_h.status = CAM_REQ_CMP_ERR;
+ return;
+ }
+ size_mb = ccg->volume_size / size_mb;
if (size_mb > 1024 && extended) {
ccg->heads = 255;
ccg->secs_per_track = 63;
@@ -382,6 +391,10 @@
ccg->secs_per_track = 32;
}
secs_per_cylinder = ccg->heads * ccg->secs_per_track;
+ if (secs_per_cylinder == 0) {
+ ccg->ccb_h.status = CAM_REQ_CMP_ERR;
+ return;
+ }
ccg->cylinders = ccg->volume_size / secs_per_cylinder;
ccg->ccb_h.status = CAM_REQ_CMP;
}
==== //depot/projects/mjexp_6/sys/cam/cam_xpt.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.155.2.9 2006/12/16 07:05:54 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.155.2.10 2006/12/24 03:23:43 mjacob Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -1446,7 +1446,11 @@
devq);
xpt_max_ccbs = 16;
- xpt_bus_register(xpt_sim, /*bus #*/0);
+ if ((status = xpt_bus_register(xpt_sim, /*bus #*/0)) != CAM_SUCCESS) {
+ printf("xpt_init: xpt_bus_register failed with status %#x,"
+ " failing attach\n", status);
+ return;
+ }
/*
* Looking at the XPT from the SIM layer, the XPT is
==== //depot/projects/mjexp_6/sys/cam/scsi/scsi_da.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.180.2.9 2006/11/14 12:54:39 flz Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.180.2.10 2006/12/19 19:19:16 maxim Exp $");
#include <sys/param.h>
@@ -459,6 +459,14 @@
{T_DIRECT, SIP_MEDIA_REMOVABLE, "iriver", "H10*",
"*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE
},
+ {
+ /*
+ * X-Micro Flash Disk
+ * PR: usb/96901
+ */
+ {T_DIRECT, SIP_MEDIA_REMOVABLE, "X-Micro" , "Flash Disk",
+ "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE
+ },
};
static disk_strategy_t dastrategy;
==== //depot/projects/mjexp_6/sys/conf/NOTES#3 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1325.2.24 2006/10/21 05:28:50 scottl Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1325.2.25 2006/12/30 17:55:15 maxim Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -2356,6 +2356,8 @@
#
# USB serial support
device ucom
+# USB support for Arkmicro Technologies ARK3116 based serial adapters
+device uark
# USB support for Belkin F5U103 and compatible serial adapters
device ubsa
# USB support for BWCT console serial adapters
==== //depot/projects/mjexp_6/sys/conf/files#3 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1031.2.46 2006/11/20 07:18:24 imp Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1031.2.48 2006/12/30 17:55:15 maxim Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -809,9 +809,9 @@
dev/puc/puc_sbus.c optional puc fhc
dev/puc/puc_sbus.c optional puc sbus
dev/puc/pucdata.c optional puc pci
-dev/ral/if_ral.c optional ral
+dev/ral/rt2560.c optional ral
+dev/ral/rt2661.c optional ral
dev/ral/if_ralrate.c optional ral
-dev/ral/if_ral_pccard.c optional ral pccard
dev/ral/if_ral_pci.c optional ral pci
dev/random/harvest.c standard
dev/random/hash.c optional random
@@ -972,6 +972,7 @@
dev/usb/if_udav.c optional udav
dev/usb/ohci.c optional ohci
dev/usb/ohci_pci.c optional ohci pci
+dev/usb/uark.c optional uark ucom
dev/usb/ubsa.c optional ubsa ucom
dev/usb/ubser.c optional ubser
dev/usb/ucom.c optional ucom
==== //depot/projects/mjexp_6/sys/conf/files.arm#2 (text+ko) ====
@@ -1,4 +1,7 @@
-# $FreeBSD: src/sys/conf/files.arm,v 1.8 2005/06/09 19:45:07 jkoshy Exp $
+# $FreeBSD: src/sys/conf/files.arm,v 1.8.2.2 2006/12/24 00:09:56 sam Exp $
+crypto/blowfish/bf_enc.c optional crypto | ipsec ipsec_esp
+crypto/des/des_enc.c optional crypto | ipsec ipsec_esp | \
+ netsmb
arm/arm/autoconf.c standard
arm/arm/bcopy_page.S standard
arm/arm/bcopyinout.S standard
@@ -58,6 +61,7 @@
libkern/ashrdi3.c standard
libkern/divdi3.c standard
libkern/ffsl.c standard
+libkern/fls.c standard
libkern/flsl.c standard
libkern/lshrdi3.c standard
libkern/moddi3.c standard
==== //depot/projects/mjexp_6/sys/dev/acpica/acpi_pci.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.26.2.1 2005/11/07 09:53:22 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.26.2.3 2006/12/28 22:20:40 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,50 +83,21 @@
/* Device interface */
DEVMETHOD(device_probe, acpi_pci_probe),
DEVMETHOD(device_attach, acpi_pci_attach),
- DEVMETHOD(device_shutdown, bus_generic_shutdown),
- DEVMETHOD(device_suspend, pci_suspend),
- DEVMETHOD(device_resume, pci_resume),
/* Bus interface */
- DEVMETHOD(bus_print_child, pci_print_child),
- DEVMETHOD(bus_probe_nomatch, pci_probe_nomatch),
DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar),
DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar),
- DEVMETHOD(bus_driver_added, pci_driver_added),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
-
- DEVMETHOD(bus_get_resource_list,pci_get_resource_list),
- DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
- DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
- DEVMETHOD(bus_delete_resource, pci_delete_resource),
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
- DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method),
DEVMETHOD(bus_child_location_str, acpi_pci_child_location_str_method),
/* PCI interface */
- DEVMETHOD(pci_read_config, pci_read_config_method),
- DEVMETHOD(pci_write_config, pci_write_config_method),
- DEVMETHOD(pci_enable_busmaster, pci_enable_busmaster_method),
- DEVMETHOD(pci_disable_busmaster, pci_disable_busmaster_method),
- DEVMETHOD(pci_enable_io, pci_enable_io_method),
- DEVMETHOD(pci_disable_io, pci_disable_io_method),
- DEVMETHOD(pci_get_powerstate, pci_get_powerstate_method),
DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method),
- DEVMETHOD(pci_assign_interrupt, pci_assign_interrupt_method),
{ 0, 0 }
};
-static driver_t acpi_pci_driver = {
- "pci",
- acpi_pci_methods,
- 0, /* no softc */
-};
+static devclass_t pci_devclass;
+DEFINE_CLASS_1(pci, acpi_pci_driver, acpi_pci_methods, 0, pci_driver);
DRIVER_MODULE(acpi_pci, pcib, acpi_pci_driver, pci_devclass, 0, 0);
MODULE_DEPEND(acpi_pci, acpi, 1, 1, 1);
MODULE_DEPEND(acpi_pci, pci, 1, 1, 1);
==== //depot/projects/mjexp_6/sys/dev/acpica/acpi_pcib_acpi.c#2 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.47.2.2 2005/11/07 09:53:22 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.47.2.3 2006/12/28 22:09:46 jhb Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -107,12 +107,10 @@
{0, 0}
};
-static driver_t acpi_pcib_acpi_driver = {
- "pcib",
- acpi_pcib_acpi_methods,
- sizeof(struct acpi_hpcib_softc),
-};
+static devclass_t pcib_devclass;
+DEFINE_CLASS_0(pcib, acpi_pcib_acpi_driver, acpi_pcib_acpi_methods,
+ sizeof(struct acpi_hpcib_softc));
DRIVER_MODULE(acpi_pcib, acpi, acpi_pcib_acpi_driver, pcib_devclass, 0, 0);
MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1);
==== //depot/projects/mjexp_6/sys/dev/acpica/acpi_pcib_pci.c#2 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.12.2.1 2005/11/07 09:53:23 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.12.2.2 2006/12/28 22:09:46 jhb Exp $");
#include "opt_acpi.h"
@@ -97,12 +97,10 @@
{0, 0}
};
-static driver_t acpi_pcib_pci_driver = {
- "pcib",
- acpi_pcib_pci_methods,
- sizeof(struct acpi_pcib_softc),
-};
+static devclass_t pcib_devclass;
+DEFINE_CLASS_0(pcib, acpi_pcib_pci_driver, acpi_pcib_pci_methods,
+ sizeof(struct acpi_pcib_softc));
DRIVER_MODULE(acpi_pcib, pci, acpi_pcib_pci_driver, pcib_devclass, 0, 0);
MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1);
==== //depot/projects/mjexp_6/sys/dev/ath/if_ath_pci.c#2 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath_pci.c,v 1.12.2.1 2006/07/11 16:33:12 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath_pci.c,v 1.12.2.2 2006/12/24 00:15:55 sam Exp $");
/*
* PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.
@@ -196,8 +196,8 @@
ATH_LOCK_INIT(sc);
error = ath_attach(pci_get_device(dev), sc);
- if (error == 0)
- return error;
+ if (error == 0) /* success */
+ return 0;
ATH_LOCK_DESTROY(sc);
bus_dma_tag_destroy(sc->sc_dmat);
==== //depot/projects/mjexp_6/sys/dev/bge/if_bge.c#2 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.91.2.18 2006/10/13 08:05:55 glebius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.91.2.19 2006/12/21 21:51:44 scottl Exp $");
/*
* Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -171,17 +171,10 @@
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5753 },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5753F },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5753M },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5754 },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5780 },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5780S },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5781 },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5782 },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5786 },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5787 },
- { BCOM_VENDORID, BCOM_DEVICEID_BCM5787M },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5788 },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5789 },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5901 },
@@ -274,8 +267,6 @@
{ BGE_ASICREV_BCM5752, "unknown BCM5752" },
{ BGE_ASICREV_BCM5780, "unknown BCM5780" },
{ BGE_ASICREV_BCM5714, "unknown BCM5714" },
- { BGE_ASICREV_BCM5755, "unknown BCM5755" },
- { BGE_ASICREV_BCM5787, "unknown BCM5787" },
{ 0, NULL }
};
@@ -286,18 +277,14 @@
(sc)->bge_asicrev == BGE_ASICREV_BCM5714_A0 || \
(sc)->bge_asicrev == BGE_ASICREV_BCM5780 || \
(sc)->bge_asicrev == BGE_ASICREV_BCM5714 || \
- (sc)->bge_asicrev == BGE_ASICREV_BCM5752 || \
- (sc)->bge_asicrev == BGE_ASICREV_BCM5755 || \
- (sc)->bge_asicrev == BGE_ASICREV_BCM5787)
+ (sc)->bge_asicrev == BGE_ASICREV_BCM5752)
#define BGE_IS_575X_PLUS(sc) \
((sc)->bge_asicrev == BGE_ASICREV_BCM5750 || \
(sc)->bge_asicrev == BGE_ASICREV_BCM5714_A0 || \
(sc)->bge_asicrev == BGE_ASICREV_BCM5780 || \
(sc)->bge_asicrev == BGE_ASICREV_BCM5714 || \
- (sc)->bge_asicrev == BGE_ASICREV_BCM5752 || \
- (sc)->bge_asicrev == BGE_ASICREV_BCM5755 || \
- (sc)->bge_asicrev == BGE_ASICREV_BCM5787)
+ (sc)->bge_asicrev == BGE_ASICREV_BCM5752)
#define BGE_IS_5714_FAMILY(sc) \
((sc)->bge_asicrev == BGE_ASICREV_BCM5714_A0 || \
==== //depot/projects/mjexp_6/sys/dev/bge/if_bgereg.h#2 (text+ko) ====
@@ -30,7 +30,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.36.2.8 2006/10/13 08:05:55 glebius Exp $
+ * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.36.2.9 2006/12/21 21:51:44 scottl Exp $
*/
/*
@@ -279,8 +279,6 @@
#define BGE_ASICREV_BCM5700 0x07
#define BGE_ASICREV_BCM5780 0x08
#define BGE_ASICREV_BCM5714 0x09
-#define BGE_ASICREV_BCM5755 0x0a
-#define BGE_ASICREV_BCM5787 0x0b
/* chip revisions */
#define BGE_CHIPREV(x) ((x) >> 24)
@@ -1993,17 +1991,10 @@
#define BCOM_DEVICEID_BCM5753 0x16F7
#define BCOM_DEVICEID_BCM5753F 0x16FE
#define BCOM_DEVICEID_BCM5753M 0x16FD
-#define BCOM_DEVICEID_BCM5754 0x167A
-#define BCOM_DEVICEID_BCM5754M 0x1672
-#define BCOM_DEVICEID_BCM5755 0x167B
-#define BCOM_DEVICEID_BCM5755M 0x1673
#define BCOM_DEVICEID_BCM5780 0x166A
#define BCOM_DEVICEID_BCM5780S 0x166B
#define BCOM_DEVICEID_BCM5781 0x16DD
#define BCOM_DEVICEID_BCM5782 0x1696
-#define BCOM_DEVICEID_BCM5786 0x169A
-#define BCOM_DEVICEID_BCM5787 0x169B
-#define BCOM_DEVICEID_BCM5787M 0x1693
#define BCOM_DEVICEID_BCM5788 0x169C
#define BCOM_DEVICEID_BCM5789 0x169D
#define BCOM_DEVICEID_BCM5901 0x170D
==== //depot/projects/mjexp_6/sys/dev/cardbus/cardbus.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.52.2.3 2006/03/01 18:19:33 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.52.2.4 2006/12/28 22:20:40 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -664,7 +664,6 @@
{0,0}
};
-DECLARE_CLASS(pci_driver);
DEFINE_CLASS_1(cardbus, cardbus_driver, cardbus_methods, 0, pci_driver);
static devclass_t cardbus_devclass;
==== //depot/projects/mjexp_6/sys/dev/drm/drm_agpsupport.c#2 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/drm/drm_agpsupport.c,v 1.1.2.3 2006/05/17 07:40:11 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/drm/drm_agpsupport.c,v 1.1.2.4 2006/12/28 21:54:49 jhb Exp $");
#include "dev/drm/drmP.h"
@@ -46,7 +46,7 @@
drm_device_find_capability(drm_device_t *dev, int cap)
{
#ifdef __FreeBSD__
-#if __FreeBSD_version >= 700010
+#if __FreeBSD_version >= 602102
return (pci_find_extcap(dev->device, cap, NULL) == 0);
#else
==== //depot/projects/mjexp_6/sys/dev/pci/pci.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.292.2.10 2006/12/01 16:55:14 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.292.2.12 2006/12/28 22:20:40 jhb Exp $");
#include "opt_bus.h"
@@ -131,13 +131,14 @@
DEVMETHOD(pci_get_powerstate, pci_get_powerstate_method),
DEVMETHOD(pci_set_powerstate, pci_set_powerstate_method),
DEVMETHOD(pci_assign_interrupt, pci_assign_interrupt_method),
+ DEVMETHOD(pci_find_extcap, pci_find_extcap_method),
{ 0, 0 }
};
DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
-devclass_t pci_devclass;
+static devclass_t pci_devclass;
DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, 0);
MODULE_VERSION(pci, 1);
@@ -429,7 +430,7 @@
ptrptr = PCIR_CAP_PTR;
break;
case 2:
- ptrptr = 0x14;
+ ptrptr = PCIR_CAP_PTR_2; /* cardbus capabilities ptr */
break;
default:
return; /* no extended capabilities support */
@@ -448,10 +449,10 @@
}
/* Find the next entry */
ptr = nextptr;
- nextptr = REG(ptr + 1, 1);
+ nextptr = REG(ptr + PCICAP_NEXTPTR, 1);
/* Process this entry */
- switch (REG(ptr, 1)) {
+ switch (REG(ptr + PCICAP_ID, 1)) {
case PCIY_PMG: /* PCI power management */
if (cfg->pp.pp_cap == 0) {
cfg->pp.pp_cap = REG(ptr + PCIR_POWER_CAP, 2);
@@ -476,6 +477,58 @@
#undef REG
}
+/*
+ * Return the offset in configuration space of the requested extended
+ * capability entry or 0 if the specified capability was not found.
+ */
+int
+pci_find_extcap_method(device_t dev, device_t child, int capability,
+ int *capreg)
+{
+ struct pci_devinfo *dinfo = device_get_ivars(child);
+ pcicfgregs *cfg = &dinfo->cfg;
+ u_int32_t status;
+ u_int8_t ptr;
+
+ /*
+ * Check the CAP_LIST bit of the PCI status register first.
+ */
+ status = pci_read_config(child, PCIR_STATUS, 2);
+ if (!(status & PCIM_STATUS_CAPPRESENT))
+ return (ENXIO);
+
+ /*
+ * Determine the start pointer of the capabilities list.
+ */
+ switch (cfg->hdrtype & PCIM_HDRTYPE) {
+ case 0:
+ case 1:
+ ptr = PCIR_CAP_PTR;
+ break;
+ case 2:
+ ptr = PCIR_CAP_PTR_2;
+ break;
+ default:
+ /* XXX: panic? */
+ return (ENXIO); /* no extended capabilities support */
+ }
+ ptr = pci_read_config(child, ptr, 1);
+
+ /*
+ * Traverse the capabilities list.
+ */
+ while (ptr != 0) {
+ if (pci_read_config(child, ptr + PCICAP_ID, 1) == capability) {
+ if (capreg != NULL)
+ *capreg = ptr;
+ return (0);
+ }
+ ptr = pci_read_config(child, ptr + PCICAP_NEXTPTR, 1);
+ }
+
+ return (ENOENT);
+}
+
/* free pcicfgregs structure and all depending data structures */
int
==== //depot/projects/mjexp_6/sys/dev/pci/pci_if.m#2 (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/dev/pci/pci_if.m,v 1.7 2005/01/06 01:43:05 imp Exp $
+# $FreeBSD: src/sys/dev/pci/pci_if.m,v 1.7.2.1 2006/12/28 21:40:54 jhb Exp $
#
#include <sys/bus.h>
@@ -82,3 +82,10 @@
device_t dev;
device_t child;
};
+
+METHOD int find_extcap {
+ device_t dev;
+ device_t child;
+ int capability;
+ int *capreg;
+};
==== //depot/projects/mjexp_6/sys/dev/pci/pci_pci.c#2 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.37.2.2 2006/12/01 16:11:05 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.37.2.3 2006/12/28 22:09:46 jhb Exp $");
/*
* PCI:PCI bridge support.
@@ -83,14 +83,9 @@
{ 0, 0 }
};
-static driver_t pcib_driver = {
- "pcib",
- pcib_methods,
- sizeof(struct pcib_softc),
-};
+static devclass_t pcib_devclass;
-devclass_t pcib_devclass;
-
+DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc));
DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0);
/*
==== //depot/projects/mjexp_6/sys/dev/pci/pci_private.h#2 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pci/pci_private.h,v 1.14.2.1 2006/01/30 18:38:08 imp Exp $
+ * $FreeBSD: src/sys/dev/pci/pci_private.h,v 1.14.2.3 2006/12/28 22:20:40 jhb Exp $
*
*/
@@ -34,10 +34,9 @@
/*
* Export definitions of the pci bus so that we can more easily share
- * it with "subclass" busses. A more generic subclassing mechanism would
- * be nice, but is not present in the tree at this time.
+ * it with "subclass" busses.
*/
-extern devclass_t pci_devclass;
+DECLARE_CLASS(pci_driver);
void pci_add_children(device_t dev, int busno, size_t dinfo_size);
void pci_add_child(device_t bus, struct pci_devinfo *dinfo);
@@ -61,6 +60,8 @@
int pci_disable_busmaster_method(device_t dev, device_t child);
int pci_enable_io_method(device_t dev, device_t child, int space);
int pci_disable_io_method(device_t dev, device_t child, int space);
+int pci_find_extcap_method(device_t dev, device_t child,
+ int capability, int *capreg);
struct resource *pci_alloc_resource(device_t dev, device_t child,
int type, int *rid, u_long start, u_long end, u_long count,
u_int flags);
==== //depot/projects/mjexp_6/sys/dev/pci/pcib_private.h#2 (text+ko) ====
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pci/pcib_private.h,v 1.6 2004/01/11 06:52:31 imp Exp $
+ * $FreeBSD: src/sys/dev/pci/pcib_private.h,v 1.6.8.1 2006/12/28 22:09:46 jhb Exp $
*/
#ifndef __PCIB_PRIVATE_H__
@@ -75,6 +75,4 @@
void pcib_write_config(device_t dev, int b, int s, int f, int reg, uint32_t val, int width);
int pcib_route_interrupt(device_t pcib, device_t dev, int pin);
-extern devclass_t pcib_devclass;
-
#endif
==== //depot/projects/mjexp_6/sys/dev/pci/pcivar.h#2 (text+ko) ====
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.66.2.1 2006/01/30 18:34:41 imp Exp $
+ * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.66.2.2 2006/12/28 21:40:54 jhb Exp $
*
*/
@@ -343,6 +343,12 @@
return PCI_GET_POWERSTATE(device_get_parent(dev), dev);
}
+static __inline int
+pci_find_extcap(device_t dev, int capability, int *capreg)
+{
+ return PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg);
+}
+
device_t pci_find_bsf(uint8_t, uint8_t, uint8_t);
device_t pci_find_device(uint16_t, uint16_t);
#endif /* _SYS_BUS_H_ */
==== //depot/projects/mjexp_6/sys/dev/ral/if_ral_pci.c#2 (text+ko) ====
@@ -1,7 +1,7 @@
-/* $FreeBSD: src/sys/dev/ral/if_ral_pci.c,v 1.1.2.1 2005/08/25 05:01:14 rwatson Exp $ */
+/* $FreeBSD: src/sys/dev/ral/if_ral_pci.c,v 1.1.2.2 2006/12/23 07:14:42 fjoe Exp $ */
/*-
- * Copyright (c) 2005
+ * Copyright (c) 2005, 2006
* Damien Bergamini <damien.bergamini at free.fr>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -18,10 +18,10 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ral/if_ral_pci.c,v 1.1.2.1 2005/08/25 05:01:14 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ral/if_ral_pci.c,v 1.1.2.2 2006/12/23 07:14:42 fjoe Exp $");
/*
- * PCI front-end for the Ralink RT2500 driver.
+ * PCI/Cardbus front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
*/
#include <sys/param.h>
@@ -38,7 +38,6 @@
#include <machine/bus.h>
#include <machine/resource.h>
-#include <machine/clock.h>
#include <sys/rman.h>
#include <net/bpf.h>
@@ -56,8 +55,8 @@
#include <dev/pci/pcivar.h>
#include <dev/ral/if_ralrate.h>
-#include <dev/ral/if_ralreg.h>
-#include <dev/ral/if_ralvar.h>
+#include <dev/ral/rt2560var.h>
+#include <dev/ral/rt2661var.h>
MODULE_DEPEND(ral, pci, 1, 1, 1);
MODULE_DEPEND(ral, wlan, 1, 1, 1);
@@ -69,13 +68,57 @@
};
static const struct ral_pci_ident ral_pci_ids[] = {
- { 0x1814, 0x0201, "Ralink Technology RT2500" },
+ { 0x1814, 0x0201, "Ralink Technology RT2560" },
+ { 0x1814, 0x0301, "Ralink Technology RT2561S" },
+ { 0x1814, 0x0302, "Ralink Technology RT2561" },
+ { 0x1814, 0x0401, "Ralink Technology RT2661" },
{ 0, 0, NULL }
};
+static struct ral_opns {
+ int (*attach)(device_t, int);
+ int (*detach)(void *);
+ void (*shutdown)(void *);
+ void (*suspend)(void *);
+ void (*resume)(void *);
+ void (*intr)(void *);
+
+} ral_rt2560_opns = {
+ rt2560_attach,
+ rt2560_detach,
+ rt2560_shutdown,
+ rt2560_suspend,
+ rt2560_resume,
+ rt2560_intr
+
+}, ral_rt2661_opns = {
+ rt2661_attach,
+ rt2661_detach,
+ rt2661_shutdown,
+ rt2661_suspend,
+ rt2661_resume,
+ rt2661_intr
+};
+
+struct ral_pci_softc {
+ union {
+ struct rt2560_softc sc_rt2560;
+ struct rt2661_softc sc_rt2661;
+ } u;
+
+ struct ral_opns *sc_opns;
+ int irq_rid;
+ int mem_rid;
+ struct resource *irq;
+ struct resource *mem;
+ void *sc_ih;
+};
+
static int ral_pci_probe(device_t);
static int ral_pci_attach(device_t);
+static int ral_pci_detach(device_t);
+static int ral_pci_shutdown(device_t);
static int ral_pci_suspend(device_t);
static int ral_pci_resume(device_t);
@@ -83,7 +126,8 @@
/* Device interface */
DEVMETHOD(device_probe, ral_pci_probe),
DEVMETHOD(device_attach, ral_pci_attach),
- DEVMETHOD(device_detach, ral_detach),
+ DEVMETHOD(device_detach, ral_pci_detach),
+ DEVMETHOD(device_shutdown, ral_pci_shutdown),
DEVMETHOD(device_suspend, ral_pci_suspend),
DEVMETHOD(device_resume, ral_pci_resume),
@@ -93,9 +137,11 @@
static driver_t ral_pci_driver = {
"ral",
ral_pci_methods,
- sizeof (struct ral_softc)
+ sizeof (struct ral_pci_softc)
};
+static devclass_t ral_devclass;
+
DRIVER_MODULE(ral, pci, ral_pci_driver, ral_devclass, 0, 0);
DRIVER_MODULE(ral, cardbus, ral_pci_driver, ral_devclass, 0, 0);
@@ -120,6 +166,8 @@
static int
ral_pci_attach(device_t dev)
{
+ struct ral_pci_softc *psc = device_get_softc(dev);
+ struct rt2560_softc *sc = &psc->u.sc_rt2560;
int error;
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
@@ -131,23 +179,77 @@
/* enable bus-mastering */
pci_enable_busmaster(dev);
- error = ral_alloc(dev, RAL_PCI_BAR0);
+ psc->sc_opns = (pci_get_device(dev) == 0x0201) ? &ral_rt2560_opns :
+ &ral_rt2661_opns;
+
+ psc->mem_rid = RAL_PCI_BAR0;
+ psc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &psc->mem_rid,
+ RF_ACTIVE);
+ if (psc->mem == NULL) {
+ device_printf(dev, "could not allocate memory resource\n");
+ return ENXIO;
+ }
+
+ sc->sc_st = rman_get_bustag(psc->mem);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list