PERFORCE change 37978 for review
Marcel Moolenaar
marcel at FreeBSD.org
Fri Sep 12 15:53:47 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37978
Change 37978 by marcel at marcel_nfs on 2003/09/12 15:53:04
IFC @37975
Affected files ...
.. //depot/projects/uart/alpha/alpha/pmap.c#12 integrate
.. //depot/projects/uart/amd64/amd64/pmap.c#15 integrate
.. //depot/projects/uart/cam/scsi/scsi_cd.c#4 integrate
.. //depot/projects/uart/conf/NOTES#13 integrate
.. //depot/projects/uart/conf/options#12 integrate
.. //depot/projects/uart/dev/ata/atapi-cam.c#5 integrate
.. //depot/projects/uart/dev/ata/atapi-cd.c#6 integrate
.. //depot/projects/uart/dev/ata/atapi-cd.h#4 integrate
.. //depot/projects/uart/dev/ips/ips.h#3 integrate
.. //depot/projects/uart/dev/ips/ips_pci.c#6 integrate
.. //depot/projects/uart/dev/mii/rgephy.c#2 integrate
.. //depot/projects/uart/dev/re/if_re.c#2 integrate
.. //depot/projects/uart/dev/uart/uart_bus.h#28 integrate
.. //depot/projects/uart/dev/uart/uart_core.c#28 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_sparc64.c#13 integrate
.. //depot/projects/uart/dev/uart/uart_tty.c#16 integrate
.. //depot/projects/uart/i386/i386/pmap.c#16 integrate
.. //depot/projects/uart/ia64/ia64/pmap.c#10 integrate
.. //depot/projects/uart/isa/fd.c#4 integrate
.. //depot/projects/uart/kern/sys_pipe.c#9 integrate
.. //depot/projects/uart/net/raw_usrreq.c#2 integrate
.. //depot/projects/uart/netinet/tcp_subr.c#3 integrate
.. //depot/projects/uart/netinet6/in6_pcb.c#2 integrate
.. //depot/projects/uart/netipx/ipx_input.c#2 integrate
.. //depot/projects/uart/netipx/spx_usrreq.c#2 integrate
.. //depot/projects/uart/nfsclient/nfs_node.c#2 integrate
.. //depot/projects/uart/nfsclient/nfs_subs.c#2 integrate
.. //depot/projects/uart/nfsclient/nfs_vnops.c#5 integrate
.. //depot/projects/uart/nfsclient/nfsnode.h#2 integrate
.. //depot/projects/uart/pc98/conf/NOTES#4 integrate
.. //depot/projects/uart/pc98/i386/machdep.c#4 integrate
.. //depot/projects/uart/pc98/pc98/clock.c#5 integrate
.. //depot/projects/uart/pc98/pc98/fd.c#3 integrate
.. //depot/projects/uart/pci/if_rlreg.h#7 integrate
.. //depot/projects/uart/sparc64/sparc64/ofw_machdep.c#8 integrate
.. //depot/projects/uart/sparc64/sparc64/pmap.c#8 integrate
.. //depot/projects/uart/vm/pmap.h#5 integrate
Differences ...
==== //depot/projects/uart/alpha/alpha/pmap.c#12 (text+ko) ====
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.137 2003/09/08 02:45:01 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.138 2003/09/12 07:07:47 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -815,10 +815,11 @@
* Routine: pmap_extract_and_hold
* Function:
* Atomically extract and hold the physical page
- * with the given pmap and virtual address.
+ * with the given pmap and virtual address pair
+ * if that mapping permits the given protection.
*/
vm_page_t
-pmap_extract_and_hold(pmap_t pmap, vm_offset_t va)
+pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
{
vm_paddr_t pa;
vm_page_t m;
==== //depot/projects/uart/amd64/amd64/pmap.c#15 (text+ko) ====
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.435 2003/09/08 02:45:02 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.436 2003/09/12 07:07:48 alc Exp $");
/*
* Manages physical address maps.
@@ -753,10 +753,11 @@
* Routine: pmap_extract_and_hold
* Function:
* Atomically extract and hold the physical page
- * with the given pmap and virtual address.
+ * with the given pmap and virtual address pair
+ * if that mapping permits the given protection.
*/
vm_page_t
-pmap_extract_and_hold(pmap_t pmap, vm_offset_t va)
+pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
{
vm_paddr_t pa;
vm_page_t m;
==== //depot/projects/uart/cam/scsi/scsi_cd.c#4 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.82 2003/09/05 10:40:15 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.83 2003/09/11 19:27:24 phk Exp $");
#include "opt_cd.h"
@@ -152,7 +152,7 @@
int bufs_left;
struct cam_periph *periph;
dev_t dev;
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
eventhandler_tag clonetag;
#endif
int minimum_command_size;
@@ -343,7 +343,7 @@
static STAILQ_HEAD(changerlist, cdchanger) changerq;
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
static void
cdclone(void *arg, char *name, int namelen, dev_t *dev)
{
@@ -535,7 +535,7 @@
}
devstat_remove_entry(softc->device_stats);
destroy_dev(softc->dev);
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
EVENTHANDLER_DEREGISTER(dev_clone, softc->clonetag);
#endif
free(softc, M_DEVBUF);
@@ -782,7 +782,7 @@
softc->dev = make_dev(&cd_cdevsw, periph->unit_number,
UID_ROOT, GID_OPERATOR, 0640, "cd%d", periph->unit_number);
softc->dev->si_drv1 = periph;
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
softc->clonetag =
EVENTHANDLER_REGISTER(dev_clone, cdclone, softc, 1000);
#endif
==== //depot/projects/uart/conf/NOTES#13 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1174 2003/09/07 19:19:49 marcel Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1175 2003/09/11 23:06:41 marcel Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -1465,6 +1465,10 @@
#
device uart
+# Options for uart(4)
+options UART_PPS_ON_CTS # Do time pulse capturing using CTS
+ # instead of DCD.
+
# The following hint should only be used for pure ISA devices. It is not
# needed otherwise. Use of hints is strongly discouraged.
hint.uart.0.at="isa"
==== //depot/projects/uart/conf/options#12 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.413 2003/09/07 07:43:09 tjr Exp $
+# $FreeBSD: src/sys/conf/options,v 1.414 2003/09/11 23:06:41 marcel Exp $
#
# On the handling of kernel options
#
@@ -537,6 +537,9 @@
BREAK_TO_DEBUGGER opt_comconsole.h
ALT_BREAK_TO_DEBUGGER opt_comconsole.h
+# Options to support PPS
+UART_PPS_ON_CTS opt_uart.h
+
# options for bus/device framework
BUS_DEBUG opt_bus.h
==== //depot/projects/uart/dev/ata/atapi-cam.c#5 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.21 2003/08/28 03:56:04 thomas Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.22 2003/09/11 17:34:47 thomas Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -277,7 +277,9 @@
strncpy(cpi->dev_name, cam_sim_name(sim), sizeof cpi->dev_name);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
- if (softc->ata_ch && ccb_h->target_id >= 0) {
+ cpi->base_transfer_speed = 3300;
+
+ if (softc->ata_ch && ccb_h->target_id != CAM_TARGET_WILDCARD) {
switch (softc->ata_ch->device[ccb_h->target_id].mode) {
case ATA_PIO1:
cpi->base_transfer_speed = 5200;
@@ -305,7 +307,8 @@
case ATA_UDMA6:
cpi->base_transfer_speed = 133000;
break;
- default: cpi->base_transfer_speed = 3300;
+ default:
+ break;
}
}
ccb->ccb_h.status = CAM_REQ_CMP;
==== //depot/projects/uart/dev/ata/atapi-cd.c#6 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.142 2003/09/05 10:40:16 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.144 2003/09/11 19:27:24 phk Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -42,6 +42,7 @@
#include <sys/cdio.h>
#include <sys/cdrio.h>
#include <sys/dvdio.h>
+#include <sys/disk.h>
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/ctype.h>
@@ -242,7 +243,7 @@
free(entry, M_ACD);
}
destroy_dev(cdp->dev);
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
EVENTHANDLER_DEREGISTER(dev_clone, cdp->clone_evh);
#endif
devstat_remove_entry(cdp->stats);
@@ -275,7 +276,7 @@
return cdp;
}
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
static void
acd_clone(void *arg, char *name, int namelen, dev_t *dev)
{
@@ -304,7 +305,7 @@
dev->si_drv1 = cdp;
cdp->dev = dev;
cdp->device->flags |= ATA_D_MEDIA_CHANGED;
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
cdp->clone_evh = EVENTHANDLER_REGISTER(dev_clone, acd_clone, cdp, 1000);
#endif
acd_set_ioparm(cdp);
@@ -1032,6 +1033,14 @@
error = EINVAL;
break;
+ case DIOCGMEDIASIZE:
+ *(off_t *)addr = cdp->disk_size * cdp->block_size;
+ break;
+
+ case DIOCGSECTORSIZE:
+ *(u_int *)addr = cdp->block_size;
+ break;
+
default:
error = ENOTTY;
}
==== //depot/projects/uart/dev/ata/atapi-cd.h#4 (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/ata/atapi-cd.h,v 1.37 2003/09/05 11:08:55 phk Exp $
+ * $FreeBSD: src/sys/dev/ata/atapi-cd.h,v 1.39 2003/09/11 19:27:24 phk Exp $
*/
/* CDROM Table Of Contents */
@@ -318,11 +318,11 @@
struct acd_softc **driver; /* softc's of changer slots */
int slot; /* this instance slot number */
time_t timestamp; /* this instance timestamp */
- int disk_size; /* size of current media */
- int block_size; /* blocksize currently used */
+ u_int disk_size; /* size of current media */
+ u_int block_size; /* blocksize currently used */
struct devstat *stats; /* devstat entry */
dev_t dev; /* device place holders */
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
eventhandler_tag clone_evh;
#endif
};
==== //depot/projects/uart/dev/ips/ips.h#3 (text+ko) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/ips/ips.h,v 1.3 2003/08/22 06:00:27 imp Exp $
+ * $FreeBSD: src/sys/dev/ips/ips.h,v 1.4 2003/09/11 23:30:28 ps Exp $
*/
@@ -343,6 +343,7 @@
typedef struct ips_softc{
struct resource * iores;
struct resource * irqres;
+ struct intr_config_hook ips_ich;
int configured;
int state;
int iotype;
==== //depot/projects/uart/dev/ips/ips_pci.c#6 (text+ko) ====
@@ -27,11 +27,12 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.6 2003/09/02 17:30:36 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.7 2003/09/11 23:30:28 ps Exp $");
#include <dev/ips/ips.h>
static int ips_pci_free(ips_softc_t *sc);
+static void ips_intrhook(void *arg);
static int ips_pci_probe(device_t dev)
{
@@ -132,15 +133,30 @@
printf("IPS can't alloc dma tag\n");
goto error;
}
- if(ips_adapter_init(sc))
+ sc->ips_ich.ich_func = ips_intrhook;
+ sc->ips_ich.ich_arg = sc;
+ if (config_intrhook_establish(&sc->ips_ich) != 0) {
+ printf("IPS can't establish configuration hook\n");
goto error;
- sc->configured = 1;
+ }
return 0;
error:
ips_pci_free(sc);
return (ENXIO);
}
+static void
+ips_intrhook(void *arg)
+{
+ struct ips_softc *sc = (struct ips_softc *)arg;
+
+ config_intrhook_disestablish(&sc->ips_ich);
+ if (ips_adapter_init(sc))
+ ips_pci_free(sc);
+ else
+ sc->configured = 1;
+}
+
static int ips_pci_free(ips_softc_t *sc)
{
if(sc->adapter_dmatag)
==== //depot/projects/uart/dev/mii/rgephy.c#2 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/rgephy.c,v 1.1 2003/09/11 03:53:46 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/rgephy.c,v 1.2 2003/09/11 08:28:38 wpaul Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -311,7 +311,7 @@
/*
* Callback if something changed. Note that we need to poke
- * the DSP on the Broadcom PHYs if the media changes.
+ * the DSP on the RealTek PHYs if the media changes.
*
*/
if (sc->mii_media_active != mii->mii_media_active ||
@@ -328,7 +328,7 @@
struct mii_softc *sc;
{
struct mii_data *mii = sc->mii_pdata;
- int bmsr, bmcr/*, anlpar*/;
+ int bmsr, bmcr;
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
@@ -350,18 +350,6 @@
mii->mii_media_active |= IFM_NONE;
return;
}
-/*
- anlpar = PHY_READ(sc, RL_GMEDIASTAT);
- if (anlpar & RL_GMEDIASTAT_10MBPS)
- mii->mii_media_active |= IFM_10_T;
- if (anlpar & RL_GMEDIASTAT_100MBPS)
- mii->mii_media_active |= IFM_100_TX;
- if (anlpar & RL_GMEDIASTAT_1000MBPS)
- mii->mii_media_active |= IFM_1000_T;
- if (anlpar & RL_GMEDIASTAT_FDX)
- mii->mii_media_active |= IFM_FDX;
- return;
-*/
}
bmsr = PHY_READ(sc, RL_GMEDIASTAT);
@@ -423,7 +411,12 @@
#define PHY_CLRBIT(x, y, z) \
PHY_WRITE(x, y, (PHY_READ(x, y) & ~(z)))
-/* Initialize RealTek PHY per datasheet */
+/*
+ * Initialize RealTek PHY per the datasheet. The DSP in the PHYs of
+ * existing revisions of the 8169S/8110S chips need to be tuned in
+ * order to reliably negotiate a 1000Mbps link. Later revs of the
+ * chips may not require this software tuning.
+ */
static void
rgephy_load_dspcode(struct mii_softc *sc)
{
==== //depot/projects/uart/dev/re/if_re.c#2 (text+ko) ====
@@ -106,7 +106,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.4 2003/09/11 03:53:46 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.6 2003/09/11 07:54:16 wpaul Exp $");
#include <sys/param.h>
#include <sys/endian.h>
@@ -728,6 +728,9 @@
ifp->if_flags |= IFF_PROMISC;
sc->rl_testmode = 1;
re_init(sc);
+ re_stop(sc);
+ DELAY(100000);
+ re_init(sc);
/* Put some data in the mbuf */
@@ -740,14 +743,17 @@
/* Queue the packet, start transmission */
IF_HANDOFF(&ifp->if_snd, m0, ifp);
+ CSR_WRITE_2(sc, RL_ISR, 0xFFFF);
re_start(ifp);
m0 = NULL;
/* Wait for it to propagate through the chip */
+ DELAY(100000);
for (i = 0; i < RL_TIMEOUT; i++) {
status = CSR_READ_2(sc, RL_ISR);
- if (status & RL_ISR_RX_OK)
+ if ((status & (RL_ISR_TIMEOUT_EXPIRED|RL_ISR_RX_OK)) ==
+ (RL_ISR_TIMEOUT_EXPIRED|RL_ISR_RX_OK))
break;
DELAY(10);
}
@@ -1155,22 +1161,56 @@
/* Reset the adapter. */
re_reset(sc);
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_PROGRAM);
- sc->rl_eecmd_read = RL_EECMD_READ_6BIT;
- re_read_eeprom(sc, (caddr_t)&re_did, 0, 1, 0);
- if (re_did != 0x8129)
- sc->rl_eecmd_read = RL_EECMD_READ_8BIT;
- /*
- * Get station address from the EEPROM.
- */
- re_read_eeprom(sc, (caddr_t)as, RL_EE_EADDR, 3, 0);
- for (i = 0; i < 3; i++) {
- eaddr[(i * 2) + 0] = as[i] & 0xff;
- eaddr[(i * 2) + 1] = as[i] >> 8;
+ hw_rev = re_hwrevs;
+ hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
+ while (hw_rev->rl_desc != NULL) {
+ if (hw_rev->rl_rev == hwrev) {
+ sc->rl_type = hw_rev->rl_type;
+ break;
+ }
+ hw_rev++;
}
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
+ if (sc->rl_type == RL_8169) {
+
+ /* Set RX length mask */
+
+ sc->rl_rxlenmask = RL_RDESC_STAT_GFRAGLEN;
+
+ /* Force station address autoload from the EEPROM */
+
+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_AUTOLOAD);
+ for (i = 0; i < RL_TIMEOUT; i++) {
+ if (!(CSR_READ_1(sc, RL_EECMD) & RL_EEMODE_AUTOLOAD))
+ break;
+ DELAY(100);
+ }
+ if (i == RL_TIMEOUT)
+ printf ("re%d: eeprom autoload timed out\n", unit);
+
+ for (i = 0; i < ETHER_ADDR_LEN; i++)
+ eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i);
+ } else {
+
+ /* Set RX length mask */
+
+ sc->rl_rxlenmask = RL_RDESC_STAT_FRAGLEN;
+
+ sc->rl_eecmd_read = RL_EECMD_READ_6BIT;
+ re_read_eeprom(sc, (caddr_t)&re_did, 0, 1, 0);
+ if (re_did != 0x8129)
+ sc->rl_eecmd_read = RL_EECMD_READ_8BIT;
+
+ /*
+ * Get station address from the EEPROM.
+ */
+ re_read_eeprom(sc, (caddr_t)as, RL_EE_EADDR, 3, 0);
+ for (i = 0; i < 3; i++) {
+ eaddr[(i * 2) + 0] = as[i] & 0xff;
+ eaddr[(i * 2) + 1] = as[i] >> 8;
+ }
+ }
/*
* A RealTek chip was detected. Inform the world.
@@ -1180,16 +1220,6 @@
sc->rl_unit = unit;
bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
- hw_rev = re_hwrevs;
- hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
- while (hw_rev->rl_desc != NULL) {
- if (hw_rev->rl_rev == hwrev) {
- sc->rl_type = hw_rev->rl_type;
- break;
- }
- hw_rev++;
- }
-
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
@@ -2071,9 +2101,14 @@
/*
* Set the initial TX and RX configuration.
*/
- if (sc->rl_testmode)
- CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG|RL_LOOPTEST_ON);
- else
+ if (sc->rl_testmode) {
+ if (sc->rl_type == RL_8169)
+ CSR_WRITE_4(sc, RL_TXCFG,
+ RL_TXCFG_CONFIG|RL_LOOPTEST_ON);
+ else
+ CSR_WRITE_4(sc, RL_TXCFG,
+ RL_TXCFG_CONFIG|RL_LOOPTEST_ON_CPLUS);
+ } else
CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG);
CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG);
==== //depot/projects/uart/dev/uart/uart_bus.h#28 (text+ko) ====
@@ -23,12 +23,18 @@
* (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$
+ * $FreeBSD: src/sys/dev/uart/uart_bus.h,v 1.2 2003/09/11 23:06:42 marcel Exp $
*/
#ifndef _DEV_UART_BUS_H_
#define _DEV_UART_BUS_H_
+#ifndef KLD_MODULE
+#include "opt_uart.h"
+#endif
+
+#include <sys/timepps.h>
+
/* Drain and flush targets. */
#define UART_DRAIN_RECEIVER 0x0001
#define UART_DRAIN_TRANSMITTER 0x0002
@@ -75,6 +81,14 @@
#define UART_SIGMASK_STATE 0x003f
#define UART_SIGMASK_DELTA 0x3f00
+#ifdef UART_PPS_ON_CTS
+#define UART_SIG_DPPS UART_SIG_DCTS
+#define UART_SIG_PPS UART_SIG_CTS
+#else
+#define UART_SIG_DPPS UART_SIG_DDCD
+#define UART_SIG_PPS UART_SIG_DCD
+#endif
+
/* UART_IOCTL() requests */
#define UART_IOCTL_BREAK 1
#define UART_IOCTL_IFLOW 2
@@ -133,6 +147,9 @@
int sc_txdatasz;
int sc_txfifosz; /* Size of TX FIFO and buffer. */
+ /* Pulse capturing support (PPS). */
+ struct pps_state sc_pps;
+
/* Upper layer data. */
void *sc_softih;
uint32_t sc_ttypend;
==== //depot/projects/uart/dev/uart/uart_core.c#28 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.2 2003/09/11 23:06:42 marcel Exp $");
#ifndef KLD_MODULE
#include "opt_comconsole.h"
@@ -162,6 +162,15 @@
int new, old, sig;
sig = UART_GETSIG(sc);
+
+ if (sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) {
+ if (sig & UART_SIG_DPPS) {
+ pps_capture(&sc->sc_pps);
+ pps_event(&sc->sc_pps, (sig & UART_SIG_PPS) ?
+ PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
+ }
+ }
+
do {
old = sc->sc_ttypend;
new = old & ~UART_SIGMASK_STATE;
@@ -393,6 +402,9 @@
sc->sc_sysdev->stopbits);
}
+ sc->sc_pps.ppscap = PPS_CAPTUREBOTH;
+ pps_init(&sc->sc_pps);
+
error = (sc->sc_sysdev != NULL && sc->sc_sysdev->attach != NULL)
? (*sc->sc_sysdev->attach)(sc) : uart_tty_attach(sc);
if (error)
==== //depot/projects/uart/dev/uart/uart_cpu_sparc64.c#13 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_sparc64.c,v 1.2 2003/09/07 21:51:03 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_sparc64.c,v 1.3 2003/09/12 20:13:23 tmm Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -75,7 +75,7 @@
int
uart_cpu_getdev(int devtype, struct uart_devinfo *di)
{
- char buf[32], dev[32];
+ char buf[32], dev[32], compat[32];
phandle_t input, options, output;
bus_addr_t addr;
int baud, bits, ch, error, space, stop;
@@ -124,6 +124,8 @@
/* Get the device class. */
if (OF_getprop(input, "name", buf, sizeof(buf)) == -1)
return (ENXIO);
+ if (OF_getprop(input, "compatible", compat, sizeof(compat)) == -1)
+ compat[0] = '\0';
di->bas.regshft = 0;
di->bas.rclk = 0;
if (!strcmp(buf, "se")) {
@@ -134,7 +136,8 @@
di->bas.regshft = 1;
ch = uart_cpu_channel(dev);
addr += 4 - 4 * ch;
- } else if (!strcmp(buf, "su") || !strcmp(buf, "su_pnp"))
+ } else if (!strcmp(buf, "su") || !strcmp(buf, "su_pnp") ||
+ !strcmp(compat, "su") || !strcmp(compat, "su16550"))
di->ops = uart_ns8250_ops;
else
return (ENXIO);
==== //depot/projects/uart/dev/uart/uart_tty.c#16 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.2 2003/09/11 23:06:42 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -476,6 +476,9 @@
if (sc->sc_sysdev == NULL)
UART_SETSIG(sc, UART_SIG_DDTR | UART_SIG_DRTS);
+ /* Disable pulse capturing. */
+ sc->sc_pps.ppsparam.mode = 0;
+
(*linesw[tp->t_line].l_close)(tp, flags);
ttyclose(tp);
wakeup(sc);
@@ -505,6 +508,7 @@
if (error != ENOIOCTL)
return (error);
+ error = 0;
switch (cmd) {
case TIOCSBRK:
UART_IOCTL(sc, UART_IOCTL_BREAK, 1);
@@ -563,7 +567,10 @@
*(int*)data = bits;
break;
default:
- return (ENOTTY);
+ error = pps_ioctl(cmd, data, &sc->sc_pps);
+ if (error == ENODEV)
+ error = ENOTTY;
+ break;
}
- return (0);
+ return (error);
}
==== //depot/projects/uart/i386/i386/pmap.c#16 (text+ko) ====
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.431 2003/09/08 02:45:02 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.432 2003/09/12 07:07:48 alc Exp $");
/*
* Manages physical address maps.
@@ -865,10 +865,11 @@
* Routine: pmap_extract_and_hold
* Function:
* Atomically extract and hold the physical page
- * with the given pmap and virtual address.
+ * with the given pmap and virtual address pair
+ * if that mapping permits the given protection.
*/
vm_page_t
-pmap_extract_and_hold(pmap_t pmap, vm_offset_t va)
+pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
{
vm_paddr_t pa;
vm_page_t m;
==== //depot/projects/uart/ia64/ia64/pmap.c#10 (text+ko) ====
@@ -43,7 +43,7 @@
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp
* with some ideas from NetBSD's alpha pmap
- * $FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.121 2003/09/09 05:59:09 marcel Exp $
+ * $FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.122 2003/09/12 07:07:48 alc Exp $
*/
/*
@@ -1106,10 +1106,11 @@
* Routine: pmap_extract_and_hold
* Function:
* Atomically extract and hold the physical page
- * with the given pmap and virtual address.
+ * with the given pmap and virtual address pair
+ * if that mapping permits the given protection.
*/
vm_page_t
-pmap_extract_and_hold(pmap_t pmap, vm_offset_t va)
+pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
{
vm_paddr_t pa;
vm_page_t m;
==== //depot/projects/uart/isa/fd.c#4 (text+ko) ====
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/isa/fd.c,v 1.257 2003/09/05 10:40:16 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/isa/fd.c,v 1.258 2003/09/11 19:27:24 phk Exp $");
#include "opt_fdc.h"
#include "card.h"
@@ -317,7 +317,7 @@
struct callout_handle tohandle;
struct devstat *device_stats;
dev_t masterdev;
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
eventhandler_tag clonetag;
dev_t clonedevs[NUMDENS - 1];
#endif
@@ -388,7 +388,7 @@
static void fdc_add_child(device_t, const char *, int);
static int fdc_attach(device_t);
static int fdc_print_child(device_t, device_t);
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
static void fd_clone (void *, char *, int, dev_t *);
#endif
static int fd_probe(device_t);
@@ -1121,7 +1121,7 @@
#endif /* NCARD > 0 */
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
/*
* Create a clone device upon request by devfs.
*/
@@ -1331,12 +1331,12 @@
struct fd_data *fd;
fd = device_get_softc(dev);
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
fd->clonetag = EVENTHANDLER_REGISTER(dev_clone, fd_clone, fd, 1000);
#endif
fd->masterdev = make_dev(&fd_cdevsw, fd->fdu << 6,
UID_ROOT, GID_OPERATOR, 0640, "fd%d", fd->fdu);
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
{
int i;
for (i = 0; i < NUMDENS - 1; i++)
@@ -1359,7 +1359,7 @@
untimeout(fd_turnoff, fd, fd->toffhandle);
devstat_remove_entry(fd->device_stats);
destroy_dev(fd->masterdev);
-#ifndef BURN_BRIDGES
+#ifdef GONE_IN_5
{
int i;
for (i = 0; i < NUMDENS - 1; i++)
==== //depot/projects/uart/kern/sys_pipe.c#9 (text+ko) ====
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sys_pipe.c,v 1.150 2003/09/08 04:58:32 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sys_pipe.c,v 1.151 2003/09/12 07:13:15 alc Exp $");
#include "opt_mac.h"
@@ -668,7 +668,8 @@
vm_page_unlock_queues();
return (EFAULT);
}
- wpipe->pipe_map.ms[i] = pmap_extract_and_hold(pmap, addr);
+ wpipe->pipe_map.ms[i] = pmap_extract_and_hold(pmap, addr,
+ VM_PROT_READ);
if (wpipe->pipe_map.ms[i] == NULL)
goto race;
}
==== //depot/projects/uart/net/raw_usrreq.c#2 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/net/raw_usrreq.c,v 1.28 2002/12/28 02:29:19 kbyanc Exp $
+ * $FreeBSD: src/sys/net/raw_usrreq.c,v 1.29 2003/09/11 21:40:20 ru Exp $
*/
#include <sys/param.h>
@@ -129,7 +129,7 @@
void *dummy;
{
- if (cmd < 0 || cmd > PRC_NCMDS)
+ if (cmd < 0 || cmd >= PRC_NCMDS)
return;
/* INCOMPLETE */
}
==== //depot/projects/uart/netinet/tcp_subr.c#3 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.161 2003/08/21 18:39:16 rwatson Exp $
+ * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.162 2003/09/11 21:40:20 ru Exp $
*/
#include "opt_compat.h"
@@ -1138,7 +1138,7 @@
notify = in_rtchange;
} else if (cmd == PRC_HOSTDEAD)
ip = 0;
- else if ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0)
+ else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0)
return;
if (ip) {
s = splnet();
@@ -1204,7 +1204,7 @@
else if (cmd == PRC_MSGSIZE)
notify = tcp_mtudisc;
else if (!PRC_IS_REDIRECT(cmd) &&
- ((unsigned)cmd > PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
+ ((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
return;
/* if the parameter is from icmp6, decode it. */
==== //depot/projects/uart/netinet6/in6_pcb.c#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.37 2003/06/17 00:31:30 cognet Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.38 2003/09/11 21:40:20 ru Exp $ */
/* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */
/*
@@ -824,7 +824,7 @@
u_int32_t flowinfo;
int errno, s;
- if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET6)
+ if ((unsigned)cmd >= PRC_NCMDS || dst->sa_family != AF_INET6)
return;
sa6_dst = (struct sockaddr_in6 *)dst;
==== //depot/projects/uart/netipx/ipx_input.c#2 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netipx/ipx_input.c,v 1.32 2003/06/11 05:25:14 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/netipx/ipx_input.c,v 1.33 2003/09/11 21:40:21 ru Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -279,7 +279,7 @@
caddr_t arg = (/* XXX */ caddr_t)arg_as_sa;
struct ipx_addr *ipx;
- if (cmd < 0 || cmd > PRC_NCMDS)
+ if (cmd < 0 || cmd >= PRC_NCMDS)
return;
switch (cmd) {
struct sockaddr_ipx *sipx;
==== //depot/projects/uart/netipx/spx_usrreq.c#2 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.38 2003/06/11 05:25:14 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.39 2003/09/11 21:40:21 ru Exp $");
#include <sys/param.h>
#include <sys/lock.h>
@@ -638,7 +638,7 @@
struct ipx_addr *na;
struct sockaddr_ipx *sipx;
- if (cmd < 0 || cmd > PRC_NCMDS)
+ if (cmd < 0 || cmd >= PRC_NCMDS)
return;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list